@mrpatronz/nexusflow 2.21.0 → 2.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gui/assets/AgentsPage-CwgqlrPd.js +3 -0
- package/dist/gui/assets/DashboardPage-BdBo1iDm.js +1 -0
- package/dist/gui/assets/{DocumentPreview-BlUlSRK0.js → DocumentPreview-BF79hZoZ.js} +2 -2
- package/dist/gui/assets/{GettingStartedPage-C-2t-udq.js → GettingStartedPage-BhPWS6qy.js} +1 -1
- package/dist/gui/assets/{MonacoDiffAdapter-C1gYxNl1.js → MonacoDiffAdapter-DgGLd1S5.js} +1 -1
- package/dist/gui/assets/{ProjectsPage-Bll4qUCc.js → ProjectsPage-DfSB-Qul.js} +1 -1
- package/dist/gui/assets/{ScaffoldRepoInline-BYGKL4qv.js → ScaffoldRepoInline-y0YoOFK6.js} +1 -1
- package/dist/gui/assets/SettingsPage-BHly-6Wc.js +1 -0
- package/dist/gui/assets/{SkillsPage-CLGLrRq3.js → SkillsPage-BA2-hZk7.js} +3 -3
- package/dist/gui/assets/StartWorkPage-BIhkPxp6.js +1 -0
- package/dist/gui/assets/{StrategiesPage-nNBMOxvu.js → StrategiesPage-DCPhSuM4.js} +2 -2
- package/dist/gui/assets/WorkroomsPage-BKSxMbg3.js +4 -0
- package/dist/gui/assets/WorkspacesPage-DfTNHupN.js +17 -0
- package/dist/gui/assets/{alert-dialog-DnwZtA87.js → alert-dialog-D0AKLuV3.js} +1 -1
- package/dist/gui/assets/{index-R0fvXNEi.js → index-CvEbFSmU.js} +35 -35
- package/dist/gui/assets/index-XMSrNppd.css +2 -0
- package/dist/gui/assets/{card-BMggHY3n.js → label-D5LXpdA9.js} +1 -1
- package/dist/gui/assets/queries-BSNhQxoS.js +3 -0
- package/dist/gui/assets/{tabs-CIkN5ISA.js → tabs-DRynuaQV.js} +1 -1
- package/dist/gui/index.html +3 -3
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +72 -37
- package/dist/server.js.map +1 -1
- package/dist/terminal/routes.d.ts.map +1 -1
- package/dist/terminal/routes.js +2 -1
- package/dist/terminal/routes.js.map +1 -1
- package/dist/terminal/targets.d.ts +2 -28
- package/dist/terminal/targets.d.ts.map +1 -1
- package/dist/terminal/targets.js +12 -27
- package/dist/terminal/targets.js.map +1 -1
- package/dist/types.d.ts +6 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/cli-harnesses.d.ts +56 -0
- package/dist/utils/cli-harnesses.d.ts.map +1 -0
- package/dist/utils/cli-harnesses.js +20 -0
- package/dist/utils/cli-harnesses.js.map +1 -0
- package/dist/utils/pi-sessions.d.ts +5 -0
- package/dist/utils/pi-sessions.d.ts.map +1 -0
- package/dist/utils/pi-sessions.js +150 -0
- package/dist/utils/pi-sessions.js.map +1 -0
- package/dist/utils/session-finder.d.ts +10 -6
- package/dist/utils/session-finder.d.ts.map +1 -1
- package/dist/utils/session-finder.js +369 -340
- package/dist/utils/session-finder.js.map +1 -1
- package/dist/utils/session-readers.d.ts +21 -0
- package/dist/utils/session-readers.d.ts.map +1 -0
- package/dist/utils/session-readers.js +14 -0
- package/dist/utils/session-readers.js.map +1 -0
- package/dist/utils/terminal-launch.d.ts +1 -0
- package/dist/utils/terminal-launch.d.ts.map +1 -1
- package/dist/utils/terminal-launch.js +11 -32
- package/dist/utils/terminal-launch.js.map +1 -1
- package/package.json +1 -1
- package/dist/gui/assets/AgentsPage-Dhd1ZqwZ.js +0 -3
- package/dist/gui/assets/DashboardPage-DuG3Nx62.js +0 -1
- package/dist/gui/assets/SettingsPage-DP1pJNJm.js +0 -1
- package/dist/gui/assets/StartWorkPage-CcCPKOv8.js +0 -1
- package/dist/gui/assets/WorkroomsPage-CnH1E8mW.js +0 -4
- package/dist/gui/assets/WorkspacesPage-DblU6U2z.js +0 -17
- package/dist/gui/assets/index-BO8b3Dk2.css +0 -2
- package/dist/gui/assets/label-C610MHwq.js +0 -1
- package/dist/gui/assets/queries-F2H3SwGY.js +0 -3
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{h as r}from"./button-BrcP8Wxx.js";import{o as i}from"./monaco-DLwhzYMT.js";import{o as a,u as o}from"./brand-Bj6g9sFF.js";import{n as s}from"./client-CQ3EdyuW.js";var c=e(t(),1),l=n(),u=c.createContext(void 0),d=e=>{let t=c.useContext(u);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},f=({client:e,children:t})=>(c.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,l.jsx)(u.Provider,{value:e,children:t})),p={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},m=new class{#e=p;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 h(e){setTimeout(e,0)}var g=typeof window>`u`||`Deno`in globalThis;function _(){}function v(e,t){return typeof e==`function`?e(t):e}function y(e){return typeof e==`number`&&e>=0&&e!==1/0}function b(e,t){return Math.max(e+(t||0)-Date.now(),0)}function x(e,t){return typeof e==`function`?e(t):e}function S(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ee(o,t.options))return!1}else if(!T(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 C(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(w(t.options.mutationKey)!==w(a))return!1}else if(!T(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ee(e,t){return(t?.queryKeyHashFn||w)(e)}function w(e){return JSON.stringify(e,(e,t)=>re(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function T(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!T(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!T(e[r],t[r]))return!1;return!0}return!1}var te=Object.prototype.hasOwnProperty;function E(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ne(e)&&ne(t);if(!r&&!(re(e)&&re(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:te.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=E(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function D(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 ne(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function re(e){if(!ie(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ie(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ie(e){return Object.prototype.toString.call(e)===`[object Object]`}function ae(e){return new Promise(t=>{m.setTimeout(t,e)})}function oe(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:E(e,t)}function se(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ce(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var le=Symbol();function ue(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===le?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function de(e,t){return typeof e==`function`?e(...t):!!e}function fe(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 pe=()=>g,me=()=>pe(),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(){}},he=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`}},ge=h;function _e(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ge,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 k=_e(),ve=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 ye(e){return Math.min(1e3*2**e,3e4)}function be(e){return(e??`online`)!==`online`||ve.isOnline()}var xe=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Se(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(_);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new xe(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>he.isFocused()&&(e.networkMode===`always`||ve.isOnline())&&e.canRun(),p=()=>be(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),v=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(me()?0:3),a=e.retryDelay??ye,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),ae(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):v()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?v():g().then(v),s)}}var Ce=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),y(this.gcTime)&&(this.#e=m.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(me()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(m.clearTimeout(this.#e),this.#e=void 0)}};function we(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=>{fe(e,()=>t.signal,()=>n=!0)},u=ue(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=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?ce:se;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Ee:Te,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:Te(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function Te(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 Ee(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function De(e,t){return t?Te(e,t)!=null:!1}function Oe(e,t){return!t||!e.getPreviousPageParam?!1:Ee(e,t)!=null}var ke=class extends Ce{#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=Me(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=Me(this.options);e.data!==void 0&&(this.setState(je(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=oe(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(_).catch(_):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=>x(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===le||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>x(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!b(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({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=ue(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`?we(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=Se({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof xe&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.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 xe){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Ae(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...je(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),k.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Ae(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:be(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function je(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Me(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 Ne=class extends O{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Fe(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ie(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ie(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 x(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&&!D(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Le(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||x(this.options.enabled,this.#t)!==x(t.enabled,this.#t)||x(this.options.staleTime,this.#t)!==x(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||x(this.options.enabled,this.#t)!==x(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return D(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(_)),t}#h(e){return!me()&&x(this.options.enabled,this.#t)!==!1&&y(e)}#g(){this.#b();let e=x(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=b(this.#r.dataUpdatedAt,e)+1;this.#u=m.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.#f=e,!(this.#f===0||!this.#h(this.#f))&&(this.#d=m.setInterval(()=>{(this.options.refetchIntervalInBackground||he.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(m.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(m.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Fe(e,t),o=i&&Le(e,n,t,r);(a||o)&&(l={...l,...Ae(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=oe(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=oe(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Re(e,t),refetch:this.refetch,isEnabled:x(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),D(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);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)})})();k.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function Pe(e,t){return x(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||x(t.retryOnMount,e)!==!1)}function Fe(e,t){return Pe(e,t)||e.state.data!==void 0&&Ie(e,t,t.refetchOnMount)}function Ie(e,t,n){if(x(t.enabled,e)!==!1&&x(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Re(e,t)}return!1}function Le(e,t,n,r){return(e!==t||x(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Re(e,n)}function Re(e,t){return x(t.enabled,e)!==!1&&e.isStaleByTime(x(t.staleTime,e))}var ze=class extends Ne{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:De(t,n.data),hasPreviousPage:Oe(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},Be=class extends Ce{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Ve(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=Se({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),k.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ve(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var He=class extends O{#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),D(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&w(t.mutationKey)!==w(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Ve();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){k.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)})})}},Ue=c.createContext(!1),We=()=>c.useContext(Ue);Ue.Provider;function Ge(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ke=c.createContext(Ge()),qe=()=>c.useContext(Ke),Je=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?de(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Ye=e=>{c.useEffect(()=>{e.clearReset()},[e])},Xe=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||de(n,[e.error,r])),Ze=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))}},Qe=(e,t)=>e?.suspense&&t.isPending,$e=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function et(e,t,n){let r=We(),i=qe(),a=d(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),l=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:l?`optimistic`:void 0,Ze(o),Je(o,i,s),Ye(i);let[u]=c.useState(()=>new t(a,o)),f=u.getOptimisticResult(o),p=!r&&l;if(c.useSyncExternalStore(c.useCallback(e=>{let t=p?u.subscribe(k.batchCalls(e)):_;return u.updateResult(),t},[u,p]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),c.useEffect(()=>{u.setOptions(o)},[o,u]),Qe(o,f))throw $e(o,u,i);if(Xe({result:f,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw f.error;return o.notifyOnChangeProps?f:u.trackResult(f)}function A(e,t){return et(e,Ne,t)}function j(e,t){let n=d(t),[r]=c.useState(()=>new He(n,e));c.useEffect(()=>{r.setOptions(e)},[r,e]);let i=c.useSyncExternalStore(c.useCallback(e=>r.subscribe(k.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=c.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(_)},[r]);if(i.error&&de(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function tt(e,t){return et(e,ze,t)}var nt=r(`folder-git-2`,[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 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.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),rt=r(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),it=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,at=/^[\\/]{2}/;function ot(e,t){return t+e.replace(/\\/g,`/`)}var st=`popstate`;function ct(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function lt(e={}){function t(e,t){let{pathname:n=`/`,search:r=``,hash:i=``}=F(e.location.hash.substring(1));return!n.startsWith(`/`)&&!n.startsWith(`.`)&&(n=`/`+n),ft(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){let n=e.document.querySelector(`base`),r=``;if(n&&n.getAttribute(`href`)){let t=e.location.href,n=t.indexOf(`#`);r=n===-1?t:t.slice(0,n)}return r+`#`+(typeof t==`string`?t:P(t))}function r(e,t){N(e.pathname.charAt(0)===`/`,`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}return pt(t,n,r,e)}function M(e,t){if(e===!1||e==null)throw Error(t)}function N(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function ut(){return Math.random().toString(36).substring(2,10)}function dt(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function ft(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?F(t):t,state:n,key:t&&t.key||r||ut(),mask:i}}function P({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function F(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function pt(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=ct(e)?e:ft(h.location,e,t);n&&n(r,e),l=u()+1;let d=dt(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=ct(e)?e:ft(h.location,e,t);n&&n(r,e),l=u();let i=dt(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return mt(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(st,d),c=e,()=>{i.removeEventListener(st,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function mt(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),M(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:P(t);return i=i.replace(/ $/,`%20`),!n&&at.test(i)&&(i=r+i),new URL(i,r)}function ht(e,t,n=`/`){return gt(e,t,n,!1)}function gt(e,t,n,r,i){let a=L((typeof t==`string`?F(t):t).pathname||`/`,n);if(a==null)return null;let o=i??_t(e),s=null,c=Nt(a);for(let e=0;s==null&&e<o.length;++e)s=At(o[e],c,r);return s}function _t(e){let t=vt(e);return bt(t),t}function vt(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;M(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=z([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(M(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),vt(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Ot(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Mt(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of yt(e.path))a(e,t,!0,n)}),t}function yt(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=yt(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function bt(e){e.sort((e,t)=>e.score===t.score?kt(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var xt=/^:[\w-]+$/,St=3,Ct=2,wt=1,Tt=10,Et=-2,Dt=e=>e===`*`;function Ot(e,t){let n=e.split(`/`),r=n.length;return n.some(Dt)&&(r+=Et),t&&(r+=Ct),n.filter(e=>!Dt(e)).reduce((e,t)=>e+(xt.test(t)?St:t===``?wt:Tt),r)}function kt(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function At(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?jt(u,l,s.matcher,s.compiledParams):I(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=I({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:z([a,d.pathname]),pathnameBase:Bt(z([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=z([a,d.pathnameBase]))}return o}function I(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Mt(e.path,e.caseSensitive,e.end);return jt(e,t,n,r)}function jt(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=B(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=B(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Mt(e,t=!1,n=!0){N(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Nt(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return N(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function L(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Pt(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?F(e):e,a;return n?(n=zt(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?Ft(n.substring(1),`/`):Ft(n,t)):a=t,{pathname:a,search:Vt(r),hash:Ht(i)}}function Ft(e,t){let n=B(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function It(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Lt(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Rt(e){let t=Lt(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function R(e,t,n,r=!1){let i;typeof e==`string`?i=F(e):(i={...e},M(!i.pathname||!i.pathname.includes(`?`),It(`?`,`pathname`,`search`,i)),M(!i.pathname||!i.pathname.includes(`#`),It(`#`,`pathname`,`hash`,i)),M(!i.search||!i.search.includes(`#`),It(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Pt(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var zt=e=>e.replace(/[\\/]{2,}/g,`/`),z=e=>zt(e.join(`/`));function B(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var Bt=e=>B(e).replace(/^\/*/,`/`),Vt=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ht=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Ut=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Wt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Gt(e){return z(e.map(e=>e.route.path).filter(Boolean))||`/`}var Kt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function qt(e,t){let n=e;if(typeof n!=`string`||!it.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Kt)try{let e=new URL(window.location.href),r=at.test(n)?new URL(ot(n,e.protocol)):new URL(n),a=L(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{N(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Jt=new URL(`http://localhost`);function Yt(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Jt)}catch{return Jt}}function Xt(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function Zt(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function Qt(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Xt(i,n),s=!Xt(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!Zt(e,i)||!Xt(i,a)))throw Error(`External navigation is not allowed`)}var $t=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set($t);var en=[`GET`,...$t];new Set(en);var tn=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function nn(e){try{return tn.includes(new URL(e).protocol)}catch{return!1}}var V=c.createContext(null);V.displayName=`DataRouter`;var rn=c.createContext(null);rn.displayName=`DataRouterState`;var an=c.createContext(!1);function on(){return c.useContext(an)}var sn=c.createContext({isTransitioning:!1});sn.displayName=`ViewTransition`;var cn=c.createContext(new Map);cn.displayName=`Fetchers`;var ln=c.createContext(null);ln.displayName=`Await`;var H=c.createContext(null);H.displayName=`Navigation`;var U=c.createContext(null);U.displayName=`Location`;var W=c.createContext({outlet:null,matches:[],isDataRoute:!1});W.displayName=`Route`;var un=c.createContext(null);un.displayName=`RouteError`;var dn=`REACT_ROUTER_ERROR`,fn=`REDIRECT`,pn=`ROUTE_ERROR_RESPONSE`;function mn(e){if(e.startsWith(`${dn}:${fn}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function hn(e){if(e.startsWith(`${dn}:${pn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Ut(t.status,t.statusText,t.data)}catch{}}function gn(e,{relative:t}={}){M(G(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=c.useContext(H),{hash:i,pathname:a,search:o}=q(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:z([n,a])),r.createHref({pathname:s,search:o,hash:i})}function G(){return c.useContext(U)!=null}function K(){return M(G(),`useLocation() may be used only in the context of a <Router> component.`),c.useContext(U).location}var _n=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function vn(e){c.useContext(H).static||c.useLayoutEffect(e)}function yn(){let{isDataRoute:e}=c.useContext(W);return e?Ln():bn()}function bn(){M(G(),`useNavigate() may be used only in the context of a <Router> component.`);let e=c.useContext(V),{basename:t,navigator:n}=c.useContext(H),{matches:r}=c.useContext(W),{pathname:i}=K(),a=JSON.stringify(Rt(r)),o=c.useRef(!1);return vn(()=>{o.current=!0}),c.useCallback((r,s={})=>{if(N(o.current,_n),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=R(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:z([t,c.pathname])),Qt(typeof r==`string`?r:P(r),n.createHref(c),Yt(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}c.createContext(null);function q(e,{relative:t}={}){let{matches:n}=c.useContext(W),{pathname:r}=K(),i=JSON.stringify(Rt(n));return c.useMemo(()=>R(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function xn(e,t){return Sn(e,t)}function Sn(e,t,n){M(G(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=c.useContext(H),{matches:i}=c.useContext(W),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,l=a?a.pathnameBase:`/`,u=a&&a.route;{let e=u&&u.path||``;zn(s,!u||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
2
|
+
|
|
3
|
+
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let d=K(),f;if(t){let e=typeof t==`string`?F(t):t;M(l===`/`||e.pathname?.startsWith(l),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${e.pathname}" was given in the \`location\` prop.`),f=e}else f=d;let p=f.pathname||`/`,m=p;if(l!==`/`){let e=l.replace(/^\//,``).split(`/`);m=`/`+p.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let h=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):ht(e,{pathname:m});N(u||h!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),N(h==null||h[h.length-1].route.element!==void 0||h[h.length-1].route.Component!==void 0||h[h.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=kn(h&&h.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:z([l,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?l:z([l,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&g?c.createElement(U.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...f},navigationType:`POP`}},g):g}function Cn(){let e=In(),t=Wt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=c.createElement(c.Fragment,null,c.createElement(`p`,null,`💿 Hey developer 👋`),c.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,c.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,c.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),c.createElement(c.Fragment,null,c.createElement(`h2`,null,`Unexpected Application Error!`),c.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?c.createElement(`pre`,{style:i},n):null,o)}var wn=c.createElement(Cn,null),Tn=class extends c.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=hn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:c.createElement(W.Provider,{value:this.props.routeContext},c.createElement(un.Provider,{value:e,children:this.props.component}));return this.context?c.createElement(Dn,{error:e},t):t}};Tn.contextType=an;var En=new WeakMap;function Dn({children:e,error:t}){let{basename:n,navigator:r}=c.useContext(H);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=mn(t.digest);if(e){let i=En.get(t);if(i)throw i;let a=qt(e.location,n),o=a.absoluteURL||a.to;if(Qt(e.location,o,Yt(r),`allow-explicit`),nn(o))throw Error(`Invalid redirect location`);if(Kt&&!En.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw En.set(t,n),n}}return c.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function On({routeContext:e,match:t,children:n}){let r=c.useContext(V);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),c.createElement(W.Provider,{value:e},n)}function kn(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);M(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let l=n?.onError,u=r&&l?(e,t)=>{l(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Gt(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,l)=>{let d,f=!1,p=null,m=null;r&&(d=a&&n.route.id?a[n.route.id]:void 0,p=n.route.errorElement||wn,o&&(s<0&&l===0?(zn(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):s===l&&(f=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,l+1)),g=()=>{let t;return t=d?p:f?m:n.route.Component?c.createElement(n.route.Component,null):n.route.element?n.route.element:e,c.createElement(On,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||l===0)?c.createElement(Tn,{location:r.location,revalidation:r.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function An(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jn(e){let t=c.useContext(V);return M(t,An(e)),t}function Mn(e){let t=c.useContext(rn);return M(t,An(e)),t}function Nn(e){let t=c.useContext(W);return M(t,An(e)),t}function Pn(e){let t=Nn(e),n=t.matches[t.matches.length-1];return M(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Fn(){return Pn(`useRouteId`)}function In(){let e=c.useContext(un),t=Mn(`useRouteError`),n=Pn(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Ln(){let{router:e}=jn(`useNavigate`),t=Pn(`useNavigate`),n=c.useRef(!1);return vn(()=>{n.current=!0}),c.useCallback(async(r,i={})=>{N(n.current,_n),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Rn={};function zn(e,t,n){!t&&!Rn[e]&&(Rn[e]=!0,N(!1,n))}c.memo(Bn);function Bn({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Sn(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Vn({to:e,replace:t,state:n,relative:r}){M(G(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=c.useContext(H);N(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=c.useContext(W),{pathname:s}=K(),l=yn(),u=R(e,Rt(o),s,r===`path`);Qt(typeof e==`string`?e:P(e),a.createHref(u),Yt(a),`reject`);let d=JSON.stringify(u);return c.useEffect(()=>{l(JSON.parse(d),{replace:t,state:n,relative:r})},[l,d,r,t,n]),null}function Hn(e){M(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Un({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){M(!G(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),l=c.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=F(n));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:m=`default`,mask:h}=n,g=c.useMemo(()=>{let e=L(u,s);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:m,mask:h},navigationType:r}},[s,u,d,f,p,m,r,h]);return N(g!=null,`<Router basename="${s}"> is not able to match the URL "${u}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:c.createElement(H.Provider,{value:l},c.createElement(U.Provider,{children:t,value:g}))}function Wn({children:e,location:t}){return xn(Gn(e),t)}c.Component;function Gn(e,t=[]){let n=[];return c.Children.forEach(e,(e,r)=>{if(!c.isValidElement(e))return;let i=[...t,r];if(e.type===c.Fragment){n.push.apply(n,Gn(e.props.children,i));return}M(e.type===Hn,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),M(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Gn(e.props.children,i)),n.push(a)}),n}var Kn=`get`,qn=`application/x-www-form-urlencoded`;function Jn(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Yn(e){return Jn(e)&&e.tagName.toLowerCase()===`button`}function Xn(e){return Jn(e)&&e.tagName.toLowerCase()===`form`}function Zn(e){return Jn(e)&&e.tagName.toLowerCase()===`input`}function Qn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function $n(e,t){return e.button===0&&(!t||t===`_self`)&&!Qn(e)}function er(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function tr(e,t){let n=er(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var nr=null;function rr(){if(nr===null)try{new FormData(document.createElement(`form`),0),nr=!1}catch{nr=!0}return nr}var ir=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function ar(e){return e!=null&&!ir.has(e)?(N(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${qn}"`),null):e}function or(e,t){let n,r,i,a,o;if(Xn(e)){let o=e.getAttribute(`action`);r=o?L(o,t):null,n=e.getAttribute(`method`)||Kn,i=ar(e.getAttribute(`enctype`))||qn,a=new FormData(e)}else if(Yn(e)||Zn(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?L(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Kn,i=ar(e.getAttribute(`formenctype`))||ar(o.getAttribute(`enctype`))||qn,a=new FormData(o,e),!rr()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Jn(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Kn,r=null,i=qn,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function sr(e,t){if(e===!1||e==null)throw Error(t)}function cr(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&L(i.pathname,t)===`/`?`${B(t)}/_root.${r}`:`${B(i.pathname)}.${r}`,i}async function lr(e,t){if(e.id in t)return t[e.id];try{let n=await i(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ur(e){return e!=null&&typeof e.page==`string`}function dr(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function fr(e,t,n){return _r((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await lr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(dr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function pr(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function mr(e,t,{includeHydrateFallback:n}={}){return hr(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function hr(e){return[...new Set(e)]}function gr(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function _r(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!ur(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(gr(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function vr(){let e=c.useContext(V);return sr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function yr(){let e=c.useContext(rn);return sr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var br=c.createContext(void 0);br.displayName=`FrameworkContext`;function xr(){let e=c.useContext(br);return sr(e,`You must render this element inside a <HydratedRouter> element`),e}function Sr(e,t){let n=c.useContext(br),[r,i]=c.useState(!1),[a,o]=c.useState(!1),{onFocus:s,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=c.useRef(null);c.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),c.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{i(!0)},h=()=>{i(!1),o(!1)};return n?e===`intent`?[a,p,{onFocus:J(s,m),onBlur:J(l,h),onMouseEnter:J(u,m),onMouseLeave:J(d,h),onTouchStart:J(f,m)}]:[a,p,{}]:[!1,p,{}]}function J(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Cr({page:e,...t}){let n=on(),{nonce:r}=xr(),{router:i}=vr(),a=c.useMemo(()=>ht(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?c.createElement(Tr,{page:e,matches:a,...t}):c.createElement(Er,{page:e,matches:a,...t})):null}function wr(e){let{manifest:t,routeModules:n}=xr(),[r,i]=c.useState([]);return c.useEffect(()=>{let r=!1;return fr(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Tr({page:e,matches:t,...n}){let r=K(),{future:i}=xr(),{basename:a}=vr(),o=c.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=cr(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return c.createElement(c.Fragment,null,o.map(e=>c.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Er({page:e,matches:t,...n}){let r=K(),{future:i,manifest:a,routeModules:o}=xr(),{basename:s}=vr(),{loaderData:l,matches:u}=yr(),d=c.useMemo(()=>pr(e,t,u,a,r,`data`),[e,t,u,a,r]),f=c.useMemo(()=>pr(e,t,u,a,r,`assets`),[e,t,u,a,r]),p=c.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,c=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!d.some(t=>t.route.id===e.route.id)&&e.route.id in l&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?c=!0:n.add(e.route.id))}),n.size===0)return[];let u=cr(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return c&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[u.pathname+u.search]},[s,i.v8_trailingSlashAwareDataRequests,l,r,a,d,t,e,o]),m=c.useMemo(()=>mr(f,a),[f,a]),h=wr(f);return c.createElement(c.Fragment,null,p.map(e=>c.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>c.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>c.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Dr(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}c.Component;var Or=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Or&&(window.__reactRouterVersion=`7.18.3`)}catch{}function kr({basename:e,children:t,useTransitions:n,window:r}){let i=c.useRef();i.current??=lt({window:r,v5Compat:!0});let a=i.current,[o,s]=c.useState({action:a.action,location:a.location}),l=c.useCallback(e=>{n===!1?s(e):c.startTransition(()=>s(e))},[n]);return c.useLayoutEffect(()=>a.listen(l),[a,l]),c.createElement(Un,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var Ar=c.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:l,to:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h){let{basename:g,navigator:_,useTransitions:v}=c.useContext(H),y=typeof u==`string`&&it.test(u),b=qt(u,g);u=b.to;let x=gn(u,{relative:r}),S=K(),C=null;if(o){let e=R(o,[],S.mask?S.mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:z([g,e.pathname])),C=_.createHref(e)}let[ee,w,T]=Sr(n,m),te=Fr(u,{replace:a,mask:o,state:s,target:l,preventScrollReset:d,relative:r,viewTransition:f,defaultShouldRevalidate:p,useTransitions:v});function E(t){e&&e(t),t.defaultPrevented||te(t)}let D=!(b.isExternal||i),ne=c.createElement(`a`,{...m,...T,href:(D?C:void 0)||b.absoluteURL||x,onClick:D?E:e,ref:Dr(h,w),target:l,"data-discover":!y&&t===`render`?`true`:void 0});return ee&&!y?c.createElement(c.Fragment,null,ne,c.createElement(Cr,{page:x})):ne});Ar.displayName=`Link`;var jr=c.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...l},u){let d=q(a,{relative:l.relative}),f=K(),p=c.useContext(rn),{navigator:m,basename:h}=c.useContext(H),g=p!=null&&Vr(d)&&o===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=L(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},ee=x?e:void 0,w;w=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(C):i;return c.createElement(Ar,{...l,"aria-current":ee,className:w,ref:u,style:T,to:a,viewTransition:o},typeof s==`function`?s(C):s)});jr.displayName=`NavLink`;var Mr=c.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Kn,action:s,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h)=>{let{useTransitions:g}=c.useContext(H),_=zr(),v=Br(s,{relative:u}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&it.test(s);return c.createElement(`form`,{ref:h,method:y,action:v,onSubmit:r?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,m=()=>_(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p});g&&n!==!1?c.startTransition(()=>m()):m()},...m,"data-discover":!b&&e===`render`?`true`:void 0})});Mr.displayName=`Form`;function Nr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Pr(e){let t=c.useContext(V);return M(t,Nr(e)),t}function Fr(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:l,useTransitions:u}={}){let d=yn(),f=K(),p=q(e,{relative:o});return c.useCallback(m=>{if($n(m,t)){m.preventDefault();let t=n===void 0?P(f)===P(p):n,h=()=>d(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:l});u?c.startTransition(()=>h()):h()}},[f,d,p,n,r,i,t,e,a,o,s,l,u])}function Ir(e){N(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=c.useRef(er(e)),n=c.useRef(!1),r=K(),i=c.useMemo(()=>tr(r.search,n.current?null:t.current),[r.search]),a=yn();return[i,c.useCallback((e,t)=>{let r=er(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Lr=0,Rr=()=>`__${String(++Lr)}__`;function zr(){let{router:e}=Pr(`useSubmit`),{basename:t}=c.useContext(H),n=Fn(),r=e.fetch,i=e.navigate;return c.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=or(e,t);if(a.navigate===!1){let e=a.fetcherKey||Rr();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Br(e,{relative:t}={}){let{basename:n}=c.useContext(H),r=c.useContext(W);M(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...q(e||`.`,{relative:t})},o=K();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:z([n,a.pathname])),P(a)}function Vr(e,{relative:t}={}){let n=c.useContext(sn);M(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Pr(`useViewTransitionState`),i=q(e,{relative:t});if(!n.isTransitioning)return!1;let a=L(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=L(n.nextLocation.pathname,r)||n.nextLocation.pathname;return I(i.pathname,o)!=null||I(i.pathname,a)!=null}var Y={minWidth:380,minHeight:420,defaultWidth:760,defaultHeight:680,compactBreakpointPx:520,splitBreakpointPx:900,splitMinRatio:25,splitMaxRatio:75},Hr=e=>({width:Math.max(Y.minWidth,Math.min(e.width,window.innerWidth||1200)),height:Math.max(Y.minHeight,Math.min(e.height,window.innerHeight||900))}),Ur=e=>Math.max(Y.splitMinRatio,Math.min(Y.splitMaxRatio,e)),X={isOpen:!1,isMinimized:!1,isMaximized:!1,openTabs:[],activeTab:null,splitTab:null,splitRatio:50,position:null,size:{width:Y.defaultWidth,height:Y.defaultHeight},drafts:{},modes:{},harnesses:{},terminalLaunches:{}};function Wr(){try{let e=localStorage.getItem(a)??localStorage.getItem(o);if(!e)return X;let t=JSON.parse(e);return{drafts:{},harnesses:Object.fromEntries(Object.entries(t.harnesses??{}).filter(([,e])=>typeof e==`string`)),terminalLaunches:{},modes:Object.fromEntries(Object.entries(t.modes??{}).filter(([,e])=>e===`cli`||e===`chat`)),isOpen:typeof t.isOpen==`boolean`?t.isOpen:X.isOpen,isMinimized:typeof t.isMinimized==`boolean`?t.isMinimized:X.isMinimized,isMaximized:typeof t.isMaximized==`boolean`?t.isMaximized:X.isMaximized,openTabs:Array.isArray(t.openTabs)?t.openTabs.filter(e=>typeof e==`string`):[],activeTab:typeof t.activeTab==`string`?t.activeTab:null,splitTab:typeof t.splitTab==`string`&&t.splitTab!==t.activeTab?t.splitTab:null,splitRatio:typeof t.splitRatio==`number`&&Number.isFinite(t.splitRatio)?Ur(t.splitRatio):50,position:t.position&&typeof t.position.x==`number`&&typeof t.position.y==`number`?{x:t.position.x,y:t.position.y}:null,size:t.size&&typeof t.size.width==`number`&&typeof t.size.height==`number`?Hr({width:t.size.width,height:t.size.height}):X.size}}catch{return X}}var Z=Wr(),Gr=new Set;function Kr(){try{localStorage.setItem(a,JSON.stringify({...Z,terminalLaunches:{},drafts:{}}))}catch{}for(let e of Gr)e()}function Q(e){Z=e(Z),Kr()}var $={getState:()=>Z,subscribe:e=>(Gr.add(e),()=>Gr.delete(e)),openTerminal:(e,t=`shell`,n,r)=>{let i=Z.terminalLaunches[e];if(n&&i?.target===t&&i.sessionId===n){$.openCli(e);return}$.open(e),$.setHarness(e,t),Q(i=>({...i,modes:{...i.modes,[e]:`cli`},terminalLaunches:{...i.terminalLaunches,[e]:{id:crypto.randomUUID(),target:t,sessionId:n,cwd:r}}}))},consumeTerminalLaunch:(e,t)=>{Q(n=>{if(n.terminalLaunches[e]?.id!==t)return n;let r={...n.terminalLaunches};return delete r[e],{...n,terminalLaunches:r}})},setMode:(e,t)=>Q(n=>({...n,modes:{...n.modes,[e]:t}})),setHarness:(e,t)=>Q(n=>({...n,harnesses:{...n.harnesses,[e]:t}})),openDraft:(e,t)=>{$.open(e),$.setMode(e,`chat`),Q(n=>({...n,drafts:{...n.drafts,[e]:{id:crypto.randomUUID(),text:t}}}))},consumeDraft:(e,t)=>{Q(n=>{if(n.drafts[e]?.id!==t)return n;let r={...n.drafts};return delete r[e],{...n,drafts:r}})},openCli:e=>$.open(e,`cli`),open:(e,t)=>{Q(n=>{let r=[...n.openTabs],i=n.activeTab;return e?(r.includes(e)||r.push(e),i=e):!i&&r.length>0&&(i=r[0]),{...n,isOpen:!0,isMinimized:!1,openTabs:r,activeTab:i,modes:e&&t?{...n.modes,[e]:t}:n.modes,splitTab:i===n.splitTab?n.activeTab:n.splitTab}})},close:()=>{Q(e=>({...e,isOpen:!1,isMinimized:!1}))},minimize:()=>{Q(e=>({...e,isMinimized:!0}))},restore:()=>{Q(e=>({...e,isOpen:!0,isMinimized:!1}))},toggleMaximize:()=>{Q(e=>({...e,isMaximized:!e.isMaximized,isMinimized:!1}))},addTab:e=>{Q(t=>{let n=t.openTabs.includes(e)?t.openTabs:[...t.openTabs,e];return{...t,isOpen:!0,isMinimized:!1,openTabs:n,activeTab:e,splitTab:e===t.splitTab?t.activeTab:t.splitTab}})},removeTab:e=>{Q(t=>{let n=t.openTabs.filter(t=>t!==e),r=t.activeTab;return r===e&&(r=n.find(e=>e!==t.splitTab)??n[0]??null),{...t,openTabs:n,activeTab:r,splitTab:e===t.splitTab||r===t.splitTab?null:t.splitTab,isOpen:n.length>0&&t.isOpen}})},setActiveTab:e=>{Q(t=>t.openTabs.includes(e)?{...t,activeTab:e,splitTab:e===t.splitTab?t.activeTab:t.splitTab,isMinimized:!1}:t)},setSplitTab:e=>{Q(t=>{if(e===t.activeTab)return t;let n=e&&!t.openTabs.includes(e)?[...t.openTabs,e]:t.openTabs;return{...t,openTabs:n,splitTab:e,isMaximized:e?!0:t.isMaximized}})},setSplitRatio:e=>Q(t=>({...t,splitRatio:Ur(e)})),setPosition:e=>{Q(t=>({...t,position:e}))},setSize:e=>{Q(t=>({...t,size:Hr(e)}))}};function qr(){return{...(0,c.useSyncExternalStore)($.subscribe,$.getState,()=>X),...$}}function Jr(){return A({queryKey:[`config`],queryFn:()=>s(`/api/config`)})}function Yr(){return A({queryKey:[`workspaces`],queryFn:()=>s(`/api/workspaces`)})}function Xr(e={}){return tt({queryKey:[`workspaces-status`],queryFn:({pageParam:e})=>s(`/api/workspaces/status?offset=${e.offset}&limit=24${e.snapshot?`&snapshot=${encodeURIComponent(e.snapshot)}`:``}`),initialPageParam:{offset:0,snapshot:``},getNextPageParam:e=>e.nextOffset===null?void 0:{offset:e.nextOffset,snapshot:e.snapshot},enabled:e.enabled??!0,refetchInterval:e.intervalMs??!1})}function Zr(){return A({queryKey:[`domain-packs`],queryFn:async()=>(await s(`/api/enterprise/domain-packs`))?.domainPacks??[]})}function Qr(){let e=d();return j({mutationFn:e=>s(`/api/enterprise/domain-packs`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:[`domain-packs`]}),e.invalidateQueries({queryKey:[`workspace-domain-packs`]})}})}function $r(){let e=d();return j({mutationFn:e=>s(`/api/enterprise/domain-packs/${encodeURIComponent(e.id)}`,{method:`PUT`,body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:[`domain-packs`]}),e.invalidateQueries({queryKey:[`workspace-domain-packs`]})}})}function ei(){let e=d();return j({mutationFn:e=>s(`/api/enterprise/domain-packs/${encodeURIComponent(e)}`,{method:`DELETE`}),onSuccess:()=>{e.invalidateQueries({queryKey:[`domain-packs`]}),e.invalidateQueries({queryKey:[`workspace-domain-packs`]})}})}function ti(){let e=d();return j({mutationFn:e=>s(`/api/workspace`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:[`workspaces`]}),e.invalidateQueries({queryKey:[`workspaces-status`]})}})}function ni(){return A({queryKey:[`projects`],queryFn:()=>s(`/api/projects`)})}function ri(){let e=d();return j({mutationFn:e=>s(`/api/projects`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>e.invalidateQueries({queryKey:[`projects`]})})}function ii(){let e=d();return j({mutationFn:({id:e,...t})=>s(`/api/projects/${encodeURIComponent(e)}`,{method:`PUT`,body:JSON.stringify(t)}),onSuccess:()=>e.invalidateQueries({queryKey:[`projects`]})})}function ai(){let e=d();return j({mutationFn:e=>s(`/api/projects/${encodeURIComponent(e)}`,{method:`DELETE`}),onSuccess:()=>e.invalidateQueries({queryKey:[`projects`]})})}function oi(){return A({queryKey:[`repos`],queryFn:()=>s(`/api/repos`)})}function si(e,t){return A({queryKey:[`repo-branches`,e],queryFn:()=>s(`/api/repos/branches?path=${encodeURIComponent(e)}`),enabled:t,staleTime:6e4})}function ci(e,t=!0){return A({queryKey:[`repos-freshness`,e],queryFn:()=>s(`/api/repos/freshness`,{method:`POST`,body:JSON.stringify({repos:e})}),enabled:t&&e.length>0,staleTime:3e4})}function li(){let e=d();return j({mutationFn:e=>s(`/api/repos/pull`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:[`repo-freshness`]}),e.invalidateQueries({queryKey:[`repos-freshness`]})}})}function ui(){let e=d();return j({mutationFn:e=>s(`/api/repos/new`,{method:`POST`,body:JSON.stringify({name:e})}),onSuccess:()=>e.invalidateQueries({queryKey:[`repos`]})})}function di(){return A({queryKey:[`ai-detect`],queryFn:()=>s(`/api/ai-detect`),staleTime:6e4})}function fi(){return A({queryKey:[`editor-detect`],queryFn:()=>s(`/api/editor-detect`),staleTime:6e4})}function pi(){return A({queryKey:[`workspace-launch-targets`],queryFn:()=>s(`/api/workspace-launch-targets`),staleTime:6e4})}function mi(e,t){return A({queryKey:[`workspace-recent-sessions`,e],queryFn:async()=>{let t=new URLSearchParams({limit:`3`,desktopHandoffOnly:`true`});return(await s(`/api/workspace/${encodeURIComponent(e)}/sessions?${t}`)).sessions},enabled:t,staleTime:3e4})}function hi(){return A({queryKey:[`workflow-templates`],queryFn:async()=>(await s(`/api/workflows/templates`)).templates})}function gi(e){return A({queryKey:[`workspace-services`,e],queryFn:()=>s(`/api/workspace/${encodeURIComponent(e)}/services`),enabled:!!e,refetchInterval:3e3,retry:1})}function _i(e){let t=d();return j({mutationFn:({action:t,service:n})=>{let r=`/api/workspace/${encodeURIComponent(e)}/services`,i=n?`${r}/${encodeURIComponent(n)}/${t}`:`${r}/${t}`;return s(i,{method:`POST`})},onSettled:()=>{t.invalidateQueries({queryKey:[`workspace-services`,e]}),t.invalidateQueries({queryKey:[`workspaces-status`]})}})}function vi(e){let t=d();return j({mutationFn:({action:t,id:n})=>s(`/api/workspace/${encodeURIComponent(e)}/orchestrators/${t}`,{method:`POST`,body:JSON.stringify({id:n})}),onSettled:()=>{t.invalidateQueries({queryKey:[`workspace-services`,e]}),t.invalidateQueries({queryKey:[`workspaces-status`]})}})}function yi(){return A({queryKey:[`skill-categories`],queryFn:async()=>(await s(`/api/skills/categories`)).categories})}function bi(){let e=d();return j({mutationFn:e=>s(`/api/skills/categories`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:[`skill-categories`]}),e.invalidateQueries({queryKey:[`skills`]})}})}function xi(){let e=d();return j({mutationFn:e=>s(`/api/skills/categories/${encodeURIComponent(e)}`,{method:`DELETE`}),onSuccess:()=>{e.invalidateQueries({queryKey:[`skill-categories`]}),e.invalidateQueries({queryKey:[`skills`]})}})}function Si(e){return{queryKey:[`skills`,e],queryFn:()=>s(e?`/api/skills?workspace=${encodeURIComponent(e)}`:`/api/skills`)}}function Ci(e){return A({...Si(e),select:e=>e.diagnostics??[]})}function wi(e){return A({...Si(e),select:e=>e.skills})}function Ti(){let e=d();return j({mutationFn:e=>s(`/api/skills`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:[`skills`]}),e.invalidateQueries({queryKey:[`skill-categories`]}),e.invalidateQueries({queryKey:[`workspace-skills`]})}})}function Ei(){let e=d();return j({mutationFn:e=>{let t=typeof e==`string`?e:e.id,n=typeof e==`string`?void 0:e.workspaceId,r=n?`/api/skills/${encodeURIComponent(t)}?workspace=${encodeURIComponent(n)}`:`/api/skills/${encodeURIComponent(t)}`;return s(r,{method:`DELETE`})},onSuccess:()=>{e.invalidateQueries({queryKey:[`skills`]}),e.invalidateQueries({queryKey:[`workspace-skills`]})}})}function Di(){return A({queryKey:[`codex-agents`],queryFn:async()=>(await s(`/api/agents`)).agents})}function Oi(){let e=d();return j({mutationFn:e=>s(`/api/agents`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>e.invalidateQueries({queryKey:[`codex-agents`]})})}function ki(){let e=d();return j({mutationFn:({toml:e,category:t})=>s(`/api/agents/import`,{method:`POST`,body:JSON.stringify({toml:e,category:t})}),onSuccess:()=>e.invalidateQueries({queryKey:[`codex-agents`]})})}function Ai(){let e=d();return j({mutationFn:e=>s(`/api/agents/${encodeURIComponent(e)}`,{method:`DELETE`}),onSuccess:()=>e.invalidateQueries({queryKey:[`codex-agents`]})})}function ji(e){return A({queryKey:[`workspace-skills`,e],queryFn:async()=>(await s(`/api/skills/workspace/${encodeURIComponent(e)}`)).config,enabled:!!e})}function Mi(){let e=d();return j({mutationFn:({workspaceId:e,expectedRevision:t,...n})=>s(`/api/skills/workspace/${encodeURIComponent(e)}/assign`,{method:`POST`,body:JSON.stringify({...n,expectedRevision:t})}),onSuccess:(t,n)=>{e.setQueryData([`workspace-skills`,n.workspaceId],t.config),e.invalidateQueries({queryKey:[`skills`]})}})}function Ni(){return j({mutationFn:async({workspaceId:e,...t})=>t.assistant?($.openTerminal(e,t.assistant,t.sessionId,t.cwd),{success:!0,command:t.assistant}):s(`/api/workspace/${encodeURIComponent(e)}/terminal`,{method:`POST`,body:JSON.stringify(t)})})}function Pi(){let e=d();return j({mutationFn:({workspaceId:e,force:t})=>s(`/api/workspace/${encodeURIComponent(e)}/refresh`,{method:`POST`,body:JSON.stringify({force:t})}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:[`workspaces`]}),e.invalidateQueries({queryKey:[`workspace-skills`,n.workspaceId]}),e.invalidateQueries({queryKey:[`skills`,n.workspaceId]}),e.invalidateQueries({queryKey:[`workspaces-status`]})}})}function Fi(e){return A({queryKey:[`workspace-lifecycle`,e],queryFn:async()=>await s(`/api/workspace/${encodeURIComponent(e)}/lifecycle`),enabled:!!e,staleTime:1e4})}export{yn as $,yi as A,f as At,Yr as B,oi as C,S as Ct,Ti as D,x as Dt,$r as E,E as Et,pi as F,qr as G,Y as H,Fi as I,jr as J,kr as K,mi as L,wi as M,ii as N,bi as O,D as Ot,hi as P,K as Q,gi as R,si as S,C as St,Oi as T,T as Tt,Hr as U,Xr as V,$ as W,Hn as X,Vn as Y,Wn as Z,Ni as _,he as _t,Qr as a,$e as at,li as b,w as bt,ti as c,Xe as ct,ai as d,We as dt,Ir as et,Ei as f,Be as ft,ki as g,k as gt,fi as h,ve as ht,Jr as i,Ze as it,Ci as j,d as jt,_i as k,le as kt,Ai as l,Ye as lt,Zr as m,ke as mt,di as n,nt,ri as o,Qe as ot,xi as p,Ne as pt,Ar as q,Mi as r,A as rt,ui as s,Je as st,Di as t,rt as tt,ei as u,qe as ut,vi as v,O as vt,ci as w,_ as wt,Pi as x,ee as xt,ni as y,v as yt,ji as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{At as r,E as i,Fn as a,G as o,Gt as s,In as c,Jt as l,Mn as u,Mt as d,On as f,S as p,T as m,Tn as h,Ut as g,Yt as _,_ as v,_t as y,an as b,b as x,cn as S,f as C,ft as w,g as T,gt as E,in as D,jt as O,mt as k,on as A,pt as j,qn as M,rn as N,sn as P,tn as F,v as I,w as L,x as R,y as z,yn as B}from"./input-LtE7Sz4D.js";import{c as V,d as H,i as U,l as W,m as G,p as K,s as q}from"./button-BrcP8Wxx.js";import{b as J,c as ee,t as te,y as ne}from"./isElementDisabled-Cpw8EvLX.js";import{rt as re}from"./index-R0fvXNEi.js";var Y=n(),X=e(t(),1);function ie(){let[,e]=X.useState({});return X.useCallback(()=>{e({})},[])}function Z(e){let t=S(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=B(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return(ne(n)!==a||ne(r)!==o)&&(n=a,r=o),{width:n,height:r}}var ae=X.createContext(void 0);function Q(){let e=X.useContext(ae);if(e===void 0)throw Error(K(64));return e}var $={tabActivationDirection:e=>({"data-activation-direction":e})},oe=X.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:o=`horizontal`,render:s,value:c,style:d,...p}=e,m=e.defaultValue!==void 0,g=X.useRef([]),[_,v]=X.useState(()=>new Map),[y,b]=h({controlled:c,default:r,name:`Tabs`,state:`value`}),x=c!==void 0,[S,C]=X.useState(()=>new Map),w=X.useRef(void 0),T=X.useCallback(e=>se(S,e),[S]),[E,D]=X.useState(()=>({previousValue:y,tabActivationDirection:`none`})),{previousValue:O,tabActivationDirection:k}=E,j=k,M=!1;O!==y&&(j=ce(O,y,o,S),M=O!=null&&y!=null&&T(y)==null);let N=M?O:y,F=O!==N||k!==j;A(()=>{F&&D({previousValue:N,tabActivationDirection:j})},[N,F,j]);let I=P((e,t)=>{t.activationDirection=ce(y,e,o,S),i?.(e,t),!t.isCanceled&&b(e)}),L=P((e,t)=>{i?.(e,l(t,void 0,void 0,{activationDirection:`none`}))}),R=P((e,t)=>(v(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{v(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),z=X.useCallback(e=>_.get(e),[_]),B=X.useCallback(e=>{for(let t of S.values())if(e===t.value)return t.id},[S]),V=X.useMemo(()=>({getTabElementBySelectedValue:T,getTabIdByPanelValue:B,getTabPanelIdByValue:z,onValueChange:I,orientation:o,registerMountedTabPanel:R,setTabMap:C,tabActivationDirection:j,value:y}),[T,B,z,I,o,R,C,j,y]),H=X.useMemo(()=>{for(let e of S.values())if(e.value===y)return e},[S,y]),W=X.useMemo(()=>{for(let e of S.values())if(!e.disabled)return e.value},[S]),G=X.useRef(!m),K=X.useRef(r),q=X.useRef(m),J=X.useRef(!1);A(()=>{if(x)return;function e(e,t){b(e),D({previousValue:e,tabActivationDirection:`none`}),L(e,t),G.current=!1}if(S.size===0){J.current&&y!==null&&!w.current?.isConnected&&e(null,a);return}J.current=!0,w.current=S.keys().next().value;let t=H?.disabled,n=H==null&&y!==null;if(!t&&y===K.current&&(q.current=!1),q.current&&t&&y===K.current)return;let r=G.current;if(t||n){let n=W??null;if(y===n){G.current=!1;return}let i=a;r?i=u:t&&(i=f),e(n,i);return}r&&H!=null&&(L(y,u),G.current=!1)},[W,x,L,H,b,S,y]);let te=U(`div`,e,{state:{orientation:o,tabActivationDirection:j},ref:t,props:p,stateAttributesMapping:$});return(0,Y.jsx)(ae.Provider,{value:V,children:(0,Y.jsx)(ee,{elementsRef:g,children:te})})});function se(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function ce(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=se(r,e),c=se(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}var le=`data-composite-item-active`,ue=X.createContext(void 0);function de(){let e=X.useContext(ue);if(e===void 0)throw Error(K(65));return e}var fe=X.forwardRef(function(e,t){let{className:n,disabled:i=!1,render:a,value:o,id:s,nativeButton:u=!0,style:d,...f}=e,{value:p,getTabPanelIdByValue:m,onValueChange:h,orientation:g,tabActivationDirection:v}=Q(),{activateOnFocus:y,registerTabResizeObserverElement:x,tabsListElement:S}=de(),{highlightedIndex:C,onHighlightedIndexChange:w}=b(),T=_(s),E=X.useMemo(()=>({disabled:i,id:T,value:o}),[i,T,o]),{compositeProps:D,compositeRef:k,index:j}=re({metadata:E}),M=o===p,I=X.useRef(!1),L=X.useRef(null),R=P(e=>{L.current?.(),L.current=e?x(e):null});A(()=>{if(I.current){I.current=!1;return}if(!(M&&j>-1&&C!==j))return;let e=S;if(e!=null){let t=r(N(e));if(t&&O(e,t))return}i||w(j)},[M,j,C,w,i,S]);let{getButtonProps:z,buttonRef:B}=F({disabled:i,native:u,focusableWhenDisabled:!0}),V=m(o),H=X.useRef(!1),W=X.useRef(!1);function G(e){h(o,l(c,e.nativeEvent,void 0,{activationDirection:`none`}))}function K(e){M||i||G(e)}function q(e){M||i||y&&(!H.current||W.current)&&G(e)}function J(e){if(M||i)return;H.current=!0,W.current=e.button===0;let t=N(e.currentTarget);function n(){H.current=!1,W.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return U(`button`,e,{state:{disabled:i,active:M,orientation:g,tabActivationDirection:v},ref:[t,B,k,R],props:[D,{role:`tab`,"aria-controls":V,"aria-selected":M,id:T,onClick:K,onFocus:q,onPointerDown:J,[le]:M?``:void 0,onKeyDownCapture(){I.current=!0}},f,z],stateAttributesMapping:$})}),pe=o();function me(){return W}function he(){return!1}function ge(){return!0}function _e(){return(0,pe.useSyncExternalStore)(me,he,ge)}function ve(e){let{script:t}=e,{nonce:n}=C();return _e()?(0,Y.jsx)(`script`,{nonce:n,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0}):null}var ye,be={...$,activeTabPosition:()=>null,activeTabSize:()=>null},xe=X.forwardRef(function(e,t){let{className:n,render:r,renderBeforeHydration:i=!1,style:a,...o}=e,{getTabElementBySelectedValue:s,orientation:c,tabActivationDirection:l,value:u}=Q(),{tabsListElement:d,registerIndicatorUpdateListener:f}=de(),p=ie();X.useEffect(()=>f(p),[f,p]);let m=0,h=0,g=0,_=0,v=0,y=0,b=!1;if(u!=null&&d!=null){let e=s(u);if(e!=null){b=!0;let{width:t,height:n}=Z(e),{width:r,height:i}=Z(d),a=e.getBoundingClientRect(),o=d.getBoundingClientRect(),s=r>0?o.width/r:1,c=i>0?o.height/i:1;if(s>2**-52&&c>2**-52){let e=a.left-o.left,t=a.top-o.top;m=e/s+d.scrollLeft-d.clientLeft,g=t/c+d.scrollTop-d.clientTop}else m=e.offsetLeft,g=e.offsetTop;v=t,y=n,h=d.scrollWidth-m-v,_=d.scrollHeight-g-y}}let x=b?{left:m,right:h,top:g,bottom:_}:null,S=b?{width:v,height:y}:null,C=b?{"--active-tab-left":`${m}px`,"--active-tab-right":`${h}px`,"--active-tab-top":`${g}px`,"--active-tab-bottom":`${_}px`,"--active-tab-width":`${v}px`,"--active-tab-height":`${y}px`}:void 0,w=U(`span`,e,{state:{orientation:c,activeTabPosition:x,activeTabSize:S,tabActivationDirection:l},ref:t,props:[{role:`presentation`,style:C,hidden:!(b&&v>0&&y>0)},o,{suppressHydrationWarning:!0}],stateAttributesMapping:be});return u==null?null:(0,Y.jsxs)(X.Fragment,{children:[w,i&&(ye||=(0,Y.jsx)(ve,{script:``}))]})}),Se={...$,...M},Ce=X.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:o,...c}=e,{value:l,getTabIdByPanelValue:u,orientation:d,tabActivationDirection:f,registerMountedTabPanel:p}=Q(),m=_(),{ref:h,index:y}=J(),b=r===l,{mounted:x,transitionStatus:S,setMounted:C}=s(b),w=!x,T=u(r),E={hidden:w,orientation:d,tabActivationDirection:f,transitionStatus:S},D=X.useRef(null),O=U(`div`,e,{state:E,ref:[t,h,D],props:[{"aria-labelledby":T,hidden:w,id:m,role:`tabpanel`,tabIndex:b?0:-1,inert:v(!b),"data-index":y},c],stateAttributesMapping:Se});return g({open:b,ref:D,onComplete(){b||C(!1)}}),A(()=>{if(!(m==null||w&&!a))return p(r,m)},[w,a,r,m,p]),a||x?O:null}),we=[];function Te(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:a,direction:o,highlightedIndex:s,onHighlightedIndexChange:c,rootRef:l,enableHomeAndEndKeys:u=!1,stopEventPropagation:f,disabledIndices:h,modifierKeys:g=we}=e,[_,v]=X.useState(0),b=r!=null,S=X.useRef(null),C=H(S,l),T=X.useRef([]),D=X.useRef(!1),O=s??_,M=P((e,t=!1)=>{if((c??v)(e),t){let t=T.current[e];i(S.current,t,o,n)}}),N=P(e=>{if(e.size===0||D.current)return;D.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,a=r?e.get(r)?.index??-1:-1;if(a!==-1)M(a);else if(y(t,O,h)){let e=w(t,{disabledIndices:h});E(t,e)||M(e)}i(S.current,r,o,n)});A(()=>{if(h==null||s!=null||!D.current)return;let e=T.current;if(y(e,O,h)){let t=w(e,{disabledIndices:h});E(e,t)||M(t)}},[h,s,O,T,M]);let F=P((e,t,n)=>a?a(e,t,n,T):n),L=P(e=>{let i=e.key===`Home`||e.key===`End`;if(!p.has(e.key)||!u&&i||Ee(e,g)||!S.current)return;let s=o===`rtl`,c=s?z:x,l=s?x:z,_=n===`vertical`?I:c,v=n===`vertical`?R:l,y=d(e.nativeEvent);if(y!=null&&m(y)&&!te(y)){let t=y.selectionStart,n=y.selectionEnd,r=y.value;if(t==null||e.shiftKey||t!==n||e.key!==v&&t<r.length||e.key!==_&&t>0)return}let C=O,D=k(T,h),A=j(T,h);r!=null&&(C=r({disabledIndices:h,elementsRef:T,event:e,highlightedIndex:O,loopFocus:t,maxIndex:A,minIndex:D,onLoop:F,orientation:n,rtl:s}));let N=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,P=n!==`vertical`&&e.key===l||n!==`horizontal`&&e.key===`ArrowUp`;u&&(e.key===`Home`?C=D:e.key===`End`&&(C=A)),C===O&&(N||P)&&(t&&C===A&&N?(C=D,a&&(C=a(e,O,C,T))):t&&C===D&&P?(C=A,a&&(C=a(e,O,C,T))):C=w(T.current,{startingIndex:C,decrement:P,disabledIndices:h})),C!==O&&!E(T.current,C)&&(f&&e.stopPropagation(),(b||i||N||P)&&e.preventDefault(),M(C,!0),queueMicrotask(()=>{T.current[C]?.focus()}))});return{props:{ref:C,onFocus(e){let t=S.current,n=d(e.nativeEvent);!t||n==null||!m(n)||n.setSelectionRange(0,n.value.length)},onKeyDown:L},highlightedIndex:O,onHighlightedIndexChange:M,elementsRef:T,onMapChange:N,relayKeyboardEvent:L}}function Ee(e,t){for(let n of L)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function De(e){let{render:t,className:n,style:r,refs:i=q,props:a=q,state:o=V,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:v,modifierKeys:y,highlightItemOnHover:b=!1,tag:x=`div`,...S}=e,{props:C,highlightedIndex:w,onHighlightedIndexChange:E,elementsRef:O,onMapChange:k,relayKeyboardEvent:A}=Te({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:T(),disabledIndices:v,modifierKeys:y}),j=U(x,e,{state:o,ref:i,props:[C,...a,S],stateAttributesMapping:s}),M=X.useMemo(()=>({highlightedIndex:w,onHighlightedIndexChange:E,highlightItemOnHover:b,relayKeyboardEvent:A}),[w,E,b,A]);return(0,Y.jsx)(D.Provider,{value:M,children:(0,Y.jsx)(ee,{elementsRef:O,onMapChange:e=>{h?.(e),k(e)},children:j})})}var Oe=X.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,style:o,...s}=e,{orientation:c,setTabMap:l,tabActivationDirection:u}=Q(),[d,f]=X.useState(0),[p,m]=X.useState(null),h=X.useRef(new Set),g=X.useRef(new Set),_=X.useRef(null);A(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{h.current.forEach(e=>{e()})});return _.current=e,p&&e.observe(p),g.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),_.current=null}},[p]);let v=P(e=>(h.current.add(e),()=>{h.current.delete(e)})),y=P(e=>(g.current.add(e),_.current?.observe(e),()=>{g.current.delete(e),_.current?.unobserve(e)})),b={orientation:c,tabActivationDirection:u},x={"aria-orientation":c===`vertical`?`vertical`:void 0,role:`tablist`},S=X.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:v,registerTabResizeObserverElement:y,tabsListElement:p}),[n,v,y,p]);return(0,Y.jsx)(ue.Provider,{value:S,children:(0,Y.jsx)(De,{render:a,className:r,style:o,state:b,refs:[t,m],props:[x,s],stateAttributesMapping:$,highlightedIndex:d,enableHomeAndEndKeys:!0,loopFocus:i,orientation:c,onHighlightedIndexChange:f,onMapChange:l,disabledIndices:q})})});function ke({className:e,...t}){return(0,Y.jsx)(oe,{className:G(`flex flex-col gap-4`,e),"data-slot":`tabs`,...t})}function Ae({className:e,...t}){return(0,Y.jsxs)(Oe,{className:G(`relative z-0 flex w-fit items-center gap-1 rounded-lg bg-muted p-1`,e),"data-slot":`tabs-list`,...t,children:[t.children,(0,Y.jsx)(xe,{className:`absolute top-1/2 left-0 z-[-1] h-[calc(100%-0.5rem)] w-(--active-tab-width) -translate-y-1/2 translate-x-(--active-tab-left) rounded-md bg-background shadow-xs transition-all duration-150`,"data-slot":`tabs-indicator`})]})}function je({className:e,...t}){return(0,Y.jsx)(fe,{className:G(`flex h-7 cursor-pointer items-center justify-center whitespace-nowrap rounded-md border border-transparent px-2.5 font-medium text-muted-foreground text-sm outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring data-selected:text-foreground`,e),"data-slot":`tabs-tab`,...t})}function Me({className:e,...t}){return(0,Y.jsx)(Ce,{className:G(`flex-1 outline-none`,e),"data-slot":`tabs-panel`,...t})}export{Z as a,je as i,Ae as n,Me as r,ke as t};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{At as r,E as i,Fn as a,G as o,Gt as s,In as c,Jt as l,Mn as u,Mt as d,On as f,S as p,T as m,Tn as h,Ut as g,Yt as _,_ as v,_t as y,an as b,b as x,cn as S,f as C,ft as w,g as T,gt as E,in as D,jt as O,mt as k,on as A,pt as j,qn as M,rn as N,sn as P,tn as F,v as I,w as L,x as R,y as z,yn as B}from"./input-LtE7Sz4D.js";import{c as V,d as H,i as U,l as W,m as G,p as K,s as q}from"./button-BrcP8Wxx.js";import{b as J,c as ee,t as te,y as ne}from"./isElementDisabled-Cpw8EvLX.js";import{rt as re}from"./index-CvEbFSmU.js";var Y=n(),X=e(t(),1);function ie(){let[,e]=X.useState({});return X.useCallback(()=>{e({})},[])}function Z(e){let t=S(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=B(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return(ne(n)!==a||ne(r)!==o)&&(n=a,r=o),{width:n,height:r}}var ae=X.createContext(void 0);function Q(){let e=X.useContext(ae);if(e===void 0)throw Error(K(64));return e}var $={tabActivationDirection:e=>({"data-activation-direction":e})},oe=X.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:o=`horizontal`,render:s,value:c,style:d,...p}=e,m=e.defaultValue!==void 0,g=X.useRef([]),[_,v]=X.useState(()=>new Map),[y,b]=h({controlled:c,default:r,name:`Tabs`,state:`value`}),x=c!==void 0,[S,C]=X.useState(()=>new Map),w=X.useRef(void 0),T=X.useCallback(e=>se(S,e),[S]),[E,D]=X.useState(()=>({previousValue:y,tabActivationDirection:`none`})),{previousValue:O,tabActivationDirection:k}=E,j=k,M=!1;O!==y&&(j=ce(O,y,o,S),M=O!=null&&y!=null&&T(y)==null);let N=M?O:y,F=O!==N||k!==j;A(()=>{F&&D({previousValue:N,tabActivationDirection:j})},[N,F,j]);let I=P((e,t)=>{t.activationDirection=ce(y,e,o,S),i?.(e,t),!t.isCanceled&&b(e)}),L=P((e,t)=>{i?.(e,l(t,void 0,void 0,{activationDirection:`none`}))}),R=P((e,t)=>(v(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{v(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),z=X.useCallback(e=>_.get(e),[_]),B=X.useCallback(e=>{for(let t of S.values())if(e===t.value)return t.id},[S]),V=X.useMemo(()=>({getTabElementBySelectedValue:T,getTabIdByPanelValue:B,getTabPanelIdByValue:z,onValueChange:I,orientation:o,registerMountedTabPanel:R,setTabMap:C,tabActivationDirection:j,value:y}),[T,B,z,I,o,R,C,j,y]),H=X.useMemo(()=>{for(let e of S.values())if(e.value===y)return e},[S,y]),W=X.useMemo(()=>{for(let e of S.values())if(!e.disabled)return e.value},[S]),G=X.useRef(!m),K=X.useRef(r),q=X.useRef(m),J=X.useRef(!1);A(()=>{if(x)return;function e(e,t){b(e),D({previousValue:e,tabActivationDirection:`none`}),L(e,t),G.current=!1}if(S.size===0){J.current&&y!==null&&!w.current?.isConnected&&e(null,a);return}J.current=!0,w.current=S.keys().next().value;let t=H?.disabled,n=H==null&&y!==null;if(!t&&y===K.current&&(q.current=!1),q.current&&t&&y===K.current)return;let r=G.current;if(t||n){let n=W??null;if(y===n){G.current=!1;return}let i=a;r?i=u:t&&(i=f),e(n,i);return}r&&H!=null&&(L(y,u),G.current=!1)},[W,x,L,H,b,S,y]);let te=U(`div`,e,{state:{orientation:o,tabActivationDirection:j},ref:t,props:p,stateAttributesMapping:$});return(0,Y.jsx)(ae.Provider,{value:V,children:(0,Y.jsx)(ee,{elementsRef:g,children:te})})});function se(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function ce(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=se(r,e),c=se(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}var le=`data-composite-item-active`,ue=X.createContext(void 0);function de(){let e=X.useContext(ue);if(e===void 0)throw Error(K(65));return e}var fe=X.forwardRef(function(e,t){let{className:n,disabled:i=!1,render:a,value:o,id:s,nativeButton:u=!0,style:d,...f}=e,{value:p,getTabPanelIdByValue:m,onValueChange:h,orientation:g,tabActivationDirection:v}=Q(),{activateOnFocus:y,registerTabResizeObserverElement:x,tabsListElement:S}=de(),{highlightedIndex:C,onHighlightedIndexChange:w}=b(),T=_(s),E=X.useMemo(()=>({disabled:i,id:T,value:o}),[i,T,o]),{compositeProps:D,compositeRef:k,index:j}=re({metadata:E}),M=o===p,I=X.useRef(!1),L=X.useRef(null),R=P(e=>{L.current?.(),L.current=e?x(e):null});A(()=>{if(I.current){I.current=!1;return}if(!(M&&j>-1&&C!==j))return;let e=S;if(e!=null){let t=r(N(e));if(t&&O(e,t))return}i||w(j)},[M,j,C,w,i,S]);let{getButtonProps:z,buttonRef:B}=F({disabled:i,native:u,focusableWhenDisabled:!0}),V=m(o),H=X.useRef(!1),W=X.useRef(!1);function G(e){h(o,l(c,e.nativeEvent,void 0,{activationDirection:`none`}))}function K(e){M||i||G(e)}function q(e){M||i||y&&(!H.current||W.current)&&G(e)}function J(e){if(M||i)return;H.current=!0,W.current=e.button===0;let t=N(e.currentTarget);function n(){H.current=!1,W.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return U(`button`,e,{state:{disabled:i,active:M,orientation:g,tabActivationDirection:v},ref:[t,B,k,R],props:[D,{role:`tab`,"aria-controls":V,"aria-selected":M,id:T,onClick:K,onFocus:q,onPointerDown:J,[le]:M?``:void 0,onKeyDownCapture(){I.current=!0}},f,z],stateAttributesMapping:$})}),pe=o();function me(){return W}function he(){return!1}function ge(){return!0}function _e(){return(0,pe.useSyncExternalStore)(me,he,ge)}function ve(e){let{script:t}=e,{nonce:n}=C();return _e()?(0,Y.jsx)(`script`,{nonce:n,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0}):null}var ye,be={...$,activeTabPosition:()=>null,activeTabSize:()=>null},xe=X.forwardRef(function(e,t){let{className:n,render:r,renderBeforeHydration:i=!1,style:a,...o}=e,{getTabElementBySelectedValue:s,orientation:c,tabActivationDirection:l,value:u}=Q(),{tabsListElement:d,registerIndicatorUpdateListener:f}=de(),p=ie();X.useEffect(()=>f(p),[f,p]);let m=0,h=0,g=0,_=0,v=0,y=0,b=!1;if(u!=null&&d!=null){let e=s(u);if(e!=null){b=!0;let{width:t,height:n}=Z(e),{width:r,height:i}=Z(d),a=e.getBoundingClientRect(),o=d.getBoundingClientRect(),s=r>0?o.width/r:1,c=i>0?o.height/i:1;if(s>2**-52&&c>2**-52){let e=a.left-o.left,t=a.top-o.top;m=e/s+d.scrollLeft-d.clientLeft,g=t/c+d.scrollTop-d.clientTop}else m=e.offsetLeft,g=e.offsetTop;v=t,y=n,h=d.scrollWidth-m-v,_=d.scrollHeight-g-y}}let x=b?{left:m,right:h,top:g,bottom:_}:null,S=b?{width:v,height:y}:null,C=b?{"--active-tab-left":`${m}px`,"--active-tab-right":`${h}px`,"--active-tab-top":`${g}px`,"--active-tab-bottom":`${_}px`,"--active-tab-width":`${v}px`,"--active-tab-height":`${y}px`}:void 0,w=U(`span`,e,{state:{orientation:c,activeTabPosition:x,activeTabSize:S,tabActivationDirection:l},ref:t,props:[{role:`presentation`,style:C,hidden:!(b&&v>0&&y>0)},o,{suppressHydrationWarning:!0}],stateAttributesMapping:be});return u==null?null:(0,Y.jsxs)(X.Fragment,{children:[w,i&&(ye||=(0,Y.jsx)(ve,{script:``}))]})}),Se={...$,...M},Ce=X.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:o,...c}=e,{value:l,getTabIdByPanelValue:u,orientation:d,tabActivationDirection:f,registerMountedTabPanel:p}=Q(),m=_(),{ref:h,index:y}=J(),b=r===l,{mounted:x,transitionStatus:S,setMounted:C}=s(b),w=!x,T=u(r),E={hidden:w,orientation:d,tabActivationDirection:f,transitionStatus:S},D=X.useRef(null),O=U(`div`,e,{state:E,ref:[t,h,D],props:[{"aria-labelledby":T,hidden:w,id:m,role:`tabpanel`,tabIndex:b?0:-1,inert:v(!b),"data-index":y},c],stateAttributesMapping:Se});return g({open:b,ref:D,onComplete(){b||C(!1)}}),A(()=>{if(!(m==null||w&&!a))return p(r,m)},[w,a,r,m,p]),a||x?O:null}),we=[];function Te(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:a,direction:o,highlightedIndex:s,onHighlightedIndexChange:c,rootRef:l,enableHomeAndEndKeys:u=!1,stopEventPropagation:f,disabledIndices:h,modifierKeys:g=we}=e,[_,v]=X.useState(0),b=r!=null,S=X.useRef(null),C=H(S,l),T=X.useRef([]),D=X.useRef(!1),O=s??_,M=P((e,t=!1)=>{if((c??v)(e),t){let t=T.current[e];i(S.current,t,o,n)}}),N=P(e=>{if(e.size===0||D.current)return;D.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,a=r?e.get(r)?.index??-1:-1;if(a!==-1)M(a);else if(y(t,O,h)){let e=w(t,{disabledIndices:h});E(t,e)||M(e)}i(S.current,r,o,n)});A(()=>{if(h==null||s!=null||!D.current)return;let e=T.current;if(y(e,O,h)){let t=w(e,{disabledIndices:h});E(e,t)||M(t)}},[h,s,O,T,M]);let F=P((e,t,n)=>a?a(e,t,n,T):n),L=P(e=>{let i=e.key===`Home`||e.key===`End`;if(!p.has(e.key)||!u&&i||Ee(e,g)||!S.current)return;let s=o===`rtl`,c=s?z:x,l=s?x:z,_=n===`vertical`?I:c,v=n===`vertical`?R:l,y=d(e.nativeEvent);if(y!=null&&m(y)&&!te(y)){let t=y.selectionStart,n=y.selectionEnd,r=y.value;if(t==null||e.shiftKey||t!==n||e.key!==v&&t<r.length||e.key!==_&&t>0)return}let C=O,D=k(T,h),A=j(T,h);r!=null&&(C=r({disabledIndices:h,elementsRef:T,event:e,highlightedIndex:O,loopFocus:t,maxIndex:A,minIndex:D,onLoop:F,orientation:n,rtl:s}));let N=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,P=n!==`vertical`&&e.key===l||n!==`horizontal`&&e.key===`ArrowUp`;u&&(e.key===`Home`?C=D:e.key===`End`&&(C=A)),C===O&&(N||P)&&(t&&C===A&&N?(C=D,a&&(C=a(e,O,C,T))):t&&C===D&&P?(C=A,a&&(C=a(e,O,C,T))):C=w(T.current,{startingIndex:C,decrement:P,disabledIndices:h})),C!==O&&!E(T.current,C)&&(f&&e.stopPropagation(),(b||i||N||P)&&e.preventDefault(),M(C,!0),queueMicrotask(()=>{T.current[C]?.focus()}))});return{props:{ref:C,onFocus(e){let t=S.current,n=d(e.nativeEvent);!t||n==null||!m(n)||n.setSelectionRange(0,n.value.length)},onKeyDown:L},highlightedIndex:O,onHighlightedIndexChange:M,elementsRef:T,onMapChange:N,relayKeyboardEvent:L}}function Ee(e,t){for(let n of L)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function De(e){let{render:t,className:n,style:r,refs:i=q,props:a=q,state:o=V,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:v,modifierKeys:y,highlightItemOnHover:b=!1,tag:x=`div`,...S}=e,{props:C,highlightedIndex:w,onHighlightedIndexChange:E,elementsRef:O,onMapChange:k,relayKeyboardEvent:A}=Te({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:T(),disabledIndices:v,modifierKeys:y}),j=U(x,e,{state:o,ref:i,props:[C,...a,S],stateAttributesMapping:s}),M=X.useMemo(()=>({highlightedIndex:w,onHighlightedIndexChange:E,highlightItemOnHover:b,relayKeyboardEvent:A}),[w,E,b,A]);return(0,Y.jsx)(D.Provider,{value:M,children:(0,Y.jsx)(ee,{elementsRef:O,onMapChange:e=>{h?.(e),k(e)},children:j})})}var Oe=X.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,style:o,...s}=e,{orientation:c,setTabMap:l,tabActivationDirection:u}=Q(),[d,f]=X.useState(0),[p,m]=X.useState(null),h=X.useRef(new Set),g=X.useRef(new Set),_=X.useRef(null);A(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{h.current.forEach(e=>{e()})});return _.current=e,p&&e.observe(p),g.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),_.current=null}},[p]);let v=P(e=>(h.current.add(e),()=>{h.current.delete(e)})),y=P(e=>(g.current.add(e),_.current?.observe(e),()=>{g.current.delete(e),_.current?.unobserve(e)})),b={orientation:c,tabActivationDirection:u},x={"aria-orientation":c===`vertical`?`vertical`:void 0,role:`tablist`},S=X.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:v,registerTabResizeObserverElement:y,tabsListElement:p}),[n,v,y,p]);return(0,Y.jsx)(ue.Provider,{value:S,children:(0,Y.jsx)(De,{render:a,className:r,style:o,state:b,refs:[t,m],props:[x,s],stateAttributesMapping:$,highlightedIndex:d,enableHomeAndEndKeys:!0,loopFocus:i,orientation:c,onHighlightedIndexChange:f,onMapChange:l,disabledIndices:q})})});function ke({className:e,...t}){return(0,Y.jsx)(oe,{className:G(`flex flex-col gap-4`,e),"data-slot":`tabs`,...t})}function Ae({className:e,...t}){return(0,Y.jsxs)(Oe,{className:G(`relative z-0 flex w-fit items-center gap-1 rounded-lg bg-muted p-1`,e),"data-slot":`tabs-list`,...t,children:[t.children,(0,Y.jsx)(xe,{className:`absolute top-1/2 left-0 z-[-1] h-[calc(100%-0.5rem)] w-(--active-tab-width) -translate-y-1/2 translate-x-(--active-tab-left) rounded-md bg-background shadow-xs transition-all duration-150`,"data-slot":`tabs-indicator`})]})}function je({className:e,...t}){return(0,Y.jsx)(fe,{className:G(`flex h-7 cursor-pointer items-center justify-center whitespace-nowrap rounded-md border border-transparent px-2.5 font-medium text-muted-foreground text-sm outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring data-selected:text-foreground`,e),"data-slot":`tabs-tab`,...t})}function Me({className:e,...t}){return(0,Y.jsx)(Ce,{className:G(`flex-1 outline-none`,e),"data-slot":`tabs-panel`,...t})}export{Z as a,je as i,Ae as n,Me as r,ke as t};
|
package/dist/gui/index.html
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
if (link) link.href = iconHref;
|
|
28
28
|
})();
|
|
29
29
|
</script>
|
|
30
|
-
<script type="module" crossorigin src="/assets/index-
|
|
30
|
+
<script type="module" crossorigin src="/assets/index-CvEbFSmU.js"></script>
|
|
31
31
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
32
32
|
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-DE3RlOCf.js">
|
|
33
33
|
<link rel="modulepreload" crossorigin href="/assets/button-BrcP8Wxx.js">
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
<link rel="modulepreload" crossorigin href="/assets/monaco-DLwhzYMT.js">
|
|
36
36
|
<link rel="modulepreload" crossorigin href="/assets/brand-Bj6g9sFF.js">
|
|
37
37
|
<link rel="modulepreload" crossorigin href="/assets/client-CQ3EdyuW.js">
|
|
38
|
-
<link rel="modulepreload" crossorigin href="/assets/queries-
|
|
38
|
+
<link rel="modulepreload" crossorigin href="/assets/queries-BSNhQxoS.js">
|
|
39
39
|
<link rel="modulepreload" crossorigin href="/assets/chevron-down-Dy03VL1q.js">
|
|
40
40
|
<link rel="modulepreload" crossorigin href="/assets/useValueChanged-DcnEcpiS.js">
|
|
41
41
|
<link rel="modulepreload" crossorigin href="/assets/isElementDisabled-Cpw8EvLX.js">
|
|
42
42
|
<link rel="modulepreload" crossorigin href="/assets/status-CKOvrZ16.js">
|
|
43
43
|
<link rel="stylesheet" crossorigin href="/assets/monaco-d9IpiNv7.css">
|
|
44
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
44
|
+
<link rel="stylesheet" crossorigin href="/assets/index-XMSrNppd.css">
|
|
45
45
|
</head>
|
|
46
46
|
<body>
|
|
47
47
|
<div id="root"></div>
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAMA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAMA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AA+E5B,OAAO,EAA6B,aAAa,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAyF7G,eAAO,MAAM,GAAG,4EAAa,CAAC;AAc9B,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,CAAC;AA0K7C,yEAAyE;AACzE,qBAAa,eAAgB,SAAQ,KAAK;gBAC5B,OAAO,SAA2B;CAI/C;AAmBD,kFAAkF;AAClF,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAE9E;AAID;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,QAAQ,GAAE,MAAM,CAAC,QAA2B,EAC5C,YAAY,GAAE,MAAM,CAAC,YAA2B,EAChD,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,eAAe,GAAE,MAAM,OAMtB,GACA,OAAO,CAeT;AAiCD,0EAA0E;AAC1E,wBAAgB,eAAe,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE/E;AA6vHD,wBAAgB,WAAW,CACzB,IAAI,SAAO,EACX,IAAI,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAO,GAClC,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,GAAG,CAAA;CAAE,CAAC,CAwCxC"}
|
package/dist/server.js
CHANGED
|
@@ -22,7 +22,7 @@ import * as path from 'node:path';
|
|
|
22
22
|
import { fileURLToPath } from 'node:url';
|
|
23
23
|
import { execa } from 'execa';
|
|
24
24
|
import * as os from 'node:os';
|
|
25
|
-
import { createHash } from 'node:crypto';
|
|
25
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
26
26
|
import { loadConfig, saveConfig, getConfigDir } from './core/config.js';
|
|
27
27
|
import { saveChatThread, loadChatThread, clearChatThread } from './storage/db.js';
|
|
28
28
|
import { PRIMARY_LOGS_DIR, LEGACY_LOGS_DIR, WORKROOM_BOOTSTRAP_HEADERS, WORKROOM_BOOTSTRAP_COOKIES, ENGINE_ID, LEGACY_ENGINE_ID, ENGINE_NPM_PACKAGE, LEGACY_ENGINE_NPM_PACKAGE, resolveWorkspaceChatLedger, readWorkspaceChatMessages, } from './core/constants.js';
|
|
@@ -42,9 +42,9 @@ import { getAvailableOrganizations, getAvailableDomainPacks, getOrganization, ge
|
|
|
42
42
|
import { detectAIAssistants } from './utils/detect-ai.js';
|
|
43
43
|
import { detectEditors } from './utils/detect-editors.js';
|
|
44
44
|
import { buildWorkspaceLaunchPrompt, detectWorkspaceLaunchTargets, launchTargetIdForEditorCommand, launchWorkspaceTarget, } from './utils/workspace-launch.js';
|
|
45
|
-
import { isBinaryOnPath, launchWorkspaceTerminal, SUPPORTED_ASSISTANTS } from './utils/terminal-launch.js';
|
|
45
|
+
import { buildHarnessCliCommand, buildHarnessContinueCommand, isBinaryOnPath, launchWorkspaceTerminal, SUPPORTED_ASSISTANTS } from './utils/terminal-launch.js';
|
|
46
46
|
import { openInEditor } from './utils/open-editor.js';
|
|
47
|
-
import { canOpenCodexSessionInWorkspace, canTransferClaudeSessionInWorkspace, findActiveAssistants, findSessions, getSessionTranscript, } from './utils/session-finder.js';
|
|
47
|
+
import { canOpenCodexSessionInWorkspace, canTransferClaudeSessionInWorkspace, findActiveAssistants, findSessions, getSessionTranscript, SESSION_SOURCES, } from './utils/session-finder.js';
|
|
48
48
|
import { ProviderRegistry } from './agent/adapters.js';
|
|
49
49
|
import { isValidSessionId, isValidSessionUuid } from './agent/session.js';
|
|
50
50
|
import { defaultTurnSessionManager, AgentTurnGate, dispatchAgentInput } from './agent/TurnSessionManager.js';
|
|
@@ -857,16 +857,60 @@ function worstSyncStatus(states) {
|
|
|
857
857
|
}
|
|
858
858
|
return worst;
|
|
859
859
|
}
|
|
860
|
+
// A paged status scan keeps one stable catalog and PM2 snapshot across requests.
|
|
861
|
+
// The small bounded cache avoids rescanning every manifest for each page.
|
|
862
|
+
const STATUS_SNAPSHOT_TTL_MS = 5 * 60 * 1000;
|
|
863
|
+
const statusSnapshots = new Map();
|
|
860
864
|
// 4b. Aggregate at-a-glance status for every workspace (for the listing overview).
|
|
861
|
-
//
|
|
865
|
+
// Git status is read-only; never fetch/rebase here.
|
|
862
866
|
app.get('/api/workspaces/status', async (c) => {
|
|
863
867
|
try {
|
|
864
868
|
const config = await loadConfig();
|
|
865
|
-
const
|
|
869
|
+
const offsetParam = c.req.query('offset');
|
|
870
|
+
const limitParam = c.req.query('limit');
|
|
871
|
+
const snapshotParam = c.req.query('snapshot');
|
|
872
|
+
const paged = offsetParam !== undefined || limitParam !== undefined || snapshotParam !== undefined;
|
|
873
|
+
if (paged && (!/^(0|[1-9]\d*)$/.test(offsetParam ?? '') || !/^[1-9]\d*$/.test(limitParam ?? ''))) {
|
|
874
|
+
return c.json({ error: 'offset and limit must be non-negative and positive integers' }, 400);
|
|
875
|
+
}
|
|
876
|
+
const offset = Number(offsetParam ?? 0);
|
|
877
|
+
const limit = Number(limitParam ?? 0);
|
|
878
|
+
if (paged && (!Number.isSafeInteger(offset) || !Number.isSafeInteger(limit) || limit > 24)) {
|
|
879
|
+
return c.json({ error: 'limit must be at most 24' }, 400);
|
|
880
|
+
}
|
|
881
|
+
if (paged && offset > 0 && !snapshotParam) {
|
|
882
|
+
return c.json({ error: 'snapshot is required after the first page' }, 400);
|
|
883
|
+
}
|
|
884
|
+
const now = Date.now();
|
|
885
|
+
for (const [key, snapshot] of statusSnapshots) {
|
|
886
|
+
if (snapshot.expiresAt < now)
|
|
887
|
+
statusSnapshots.delete(key);
|
|
888
|
+
}
|
|
889
|
+
let snapshotId = snapshotParam;
|
|
890
|
+
let snapshot = snapshotParam ? statusSnapshots.get(snapshotParam) : undefined;
|
|
891
|
+
if (snapshotParam && (!snapshot || snapshot.workspacesDir !== config.workspacesDir)) {
|
|
892
|
+
return c.json({ error: 'Status snapshot expired; restart from the first page' }, 410);
|
|
893
|
+
}
|
|
894
|
+
if (paged && !snapshot) {
|
|
895
|
+
const workspaces = await listWorkspaces(config.workspacesDir);
|
|
896
|
+
workspaces.sort((a, b) => new Date(b.createdAt || 0).getTime() - new Date(a.createdAt || 0).getTime());
|
|
897
|
+
snapshot = {
|
|
898
|
+
workspacesDir: config.workspacesDir,
|
|
899
|
+
workspaces,
|
|
900
|
+
pm2List: workspaces.length ? getPm2List() : Promise.resolve([]),
|
|
901
|
+
expiresAt: now + STATUS_SNAPSHOT_TTL_MS,
|
|
902
|
+
};
|
|
903
|
+
snapshotId = randomUUID();
|
|
904
|
+
statusSnapshots.set(snapshotId, snapshot);
|
|
905
|
+
while (statusSnapshots.size > 16)
|
|
906
|
+
statusSnapshots.delete(statusSnapshots.keys().next().value);
|
|
907
|
+
}
|
|
908
|
+
const workspaces = snapshot?.workspaces ?? await listWorkspaces(config.workspacesDir);
|
|
909
|
+
const selected = paged ? workspaces.slice(offset, offset + limit) : workspaces;
|
|
866
910
|
// Fetch the PM2 process list once for the whole overview instead of
|
|
867
911
|
// spawning `npx pm2 jlist` per workspace (slow, especially on Windows).
|
|
868
|
-
const pm2List = await getPm2List();
|
|
869
|
-
const entries = await Promise.all(
|
|
912
|
+
const pm2List = selected.length ? await (snapshot?.pm2List ?? getPm2List()) : [];
|
|
913
|
+
const entries = await Promise.all(selected.map(async (ws) => {
|
|
870
914
|
const workspacePath = ws.workspacePath || path.join(config.workspacesDir, ws.branchName);
|
|
871
915
|
const status = {
|
|
872
916
|
id: ws.id,
|
|
@@ -912,7 +956,12 @@ app.get('/api/workspaces/status', async (c) => {
|
|
|
912
956
|
const byWorkspace = {};
|
|
913
957
|
for (const entry of entries)
|
|
914
958
|
byWorkspace[entry.branchName] = entry;
|
|
915
|
-
return c.json(
|
|
959
|
+
return c.json(paged ? {
|
|
960
|
+
statuses: byWorkspace,
|
|
961
|
+
total: workspaces.length,
|
|
962
|
+
nextOffset: offset + selected.length < workspaces.length ? offset + selected.length : null,
|
|
963
|
+
snapshot: snapshotId,
|
|
964
|
+
} : byWorkspace);
|
|
916
965
|
}
|
|
917
966
|
catch (error) {
|
|
918
967
|
return errorResponse(c, error);
|
|
@@ -1016,6 +1065,7 @@ async function runCreationJob(jobId, body, config) {
|
|
|
1016
1065
|
flowType: body.flowType,
|
|
1017
1066
|
workType: body.workType,
|
|
1018
1067
|
projectId: body.projectId,
|
|
1068
|
+
name: body.name?.trim() || undefined,
|
|
1019
1069
|
// In-place features never create a branch; keeping branchName populated
|
|
1020
1070
|
// (= id) avoids breaking every consumer of the non-optional field.
|
|
1021
1071
|
branchName: inPlace ? workspaceId : body.branchName,
|
|
@@ -2482,36 +2532,11 @@ app.post('/api/workspace/:id/resume', async (c) => {
|
|
|
2482
2532
|
}
|
|
2483
2533
|
}
|
|
2484
2534
|
if (selectedSessionId) {
|
|
2485
|
-
if (selectedAssistant
|
|
2486
|
-
resumeCommand =
|
|
2487
|
-
}
|
|
2488
|
-
else if (selectedAssistant === 'claude') {
|
|
2489
|
-
resumeCommand = `claude --resume ${selectedSessionId}`;
|
|
2490
|
-
}
|
|
2491
|
-
else if (selectedAssistant === 'codex') {
|
|
2492
|
-
resumeCommand = `codex resume ${selectedSessionId}`;
|
|
2493
|
-
}
|
|
2494
|
-
else if (selectedAssistant === 'copilot') {
|
|
2495
|
-
resumeCommand = `copilot --resume ${selectedSessionId}`;
|
|
2496
|
-
}
|
|
2535
|
+
if (SUPPORTED_ASSISTANTS.has(selectedAssistant))
|
|
2536
|
+
resumeCommand = buildHarnessCliCommand(selectedAssistant, selectedSessionId);
|
|
2497
2537
|
}
|
|
2498
2538
|
else {
|
|
2499
|
-
|
|
2500
|
-
if (selectedAssistant === 'antigravity') {
|
|
2501
|
-
resumeCommand = 'agy --continue';
|
|
2502
|
-
}
|
|
2503
|
-
else if (selectedAssistant === 'claude') {
|
|
2504
|
-
resumeCommand = 'claude --resume';
|
|
2505
|
-
}
|
|
2506
|
-
else if (selectedAssistant === 'codex') {
|
|
2507
|
-
resumeCommand = 'codex resume';
|
|
2508
|
-
}
|
|
2509
|
-
else if (selectedAssistant === 'copilot') {
|
|
2510
|
-
resumeCommand = 'copilot --resume';
|
|
2511
|
-
}
|
|
2512
|
-
else {
|
|
2513
|
-
resumeCommand = 'agy --continue';
|
|
2514
|
-
}
|
|
2539
|
+
resumeCommand = buildHarnessContinueCommand(SUPPORTED_ASSISTANTS.has(selectedAssistant) ? selectedAssistant : 'antigravity');
|
|
2515
2540
|
}
|
|
2516
2541
|
// Open in editor if command is provided
|
|
2517
2542
|
if (body.command) {
|
|
@@ -2533,12 +2558,22 @@ app.post('/api/workspace/:id/resume', async (c) => {
|
|
|
2533
2558
|
return errorResponse(c, error);
|
|
2534
2559
|
}
|
|
2535
2560
|
});
|
|
2561
|
+
// The GUI asks the backend which history readers exist, then loads each one independently.
|
|
2562
|
+
app.get('/api/session-sources', c => c.json({ sources: SESSION_SOURCES }));
|
|
2536
2563
|
// 15. List past AI sessions for a workspace
|
|
2537
2564
|
app.get('/api/workspace/:id/sessions', async (c) => {
|
|
2538
2565
|
try {
|
|
2539
2566
|
const id = decodeURIComponent(c.req.param('id'));
|
|
2540
2567
|
const limitParam = c.req.query('limit');
|
|
2541
2568
|
const desktopHandoffOnly = c.req.query('desktopHandoffOnly') === 'true';
|
|
2569
|
+
const sourceParam = c.req.query('source');
|
|
2570
|
+
const source = SESSION_SOURCES.find((candidate) => candidate === sourceParam);
|
|
2571
|
+
if (sourceParam && !source) {
|
|
2572
|
+
return c.json({ error: 'Choose a valid session source.' }, 400);
|
|
2573
|
+
}
|
|
2574
|
+
if (source && desktopHandoffOnly) {
|
|
2575
|
+
return c.json({ error: 'Session source cannot be combined with desktop handoff.' }, 400);
|
|
2576
|
+
}
|
|
2542
2577
|
let limit;
|
|
2543
2578
|
if (limitParam !== undefined) {
|
|
2544
2579
|
limit = Number(limitParam);
|
|
@@ -2571,7 +2606,7 @@ app.get('/api/workspace/:id/sessions', async (c) => {
|
|
|
2571
2606
|
if (!feature) {
|
|
2572
2607
|
return c.json({ error: 'Workspace configuration not found.' }, 404);
|
|
2573
2608
|
}
|
|
2574
|
-
const discoveredSessions = await findSessions(workspacePath, feature.repos);
|
|
2609
|
+
const discoveredSessions = await findSessions(workspacePath, feature.repos, source);
|
|
2575
2610
|
if (!desktopHandoffOnly) {
|
|
2576
2611
|
return c.json({ sessions: limit === undefined ? discoveredSessions : discoveredSessions.slice(0, limit) });
|
|
2577
2612
|
}
|