orcasynth 1.3.1 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -34
- package/dist/api/server.js +51 -18
- package/dist/cli/index.js +40 -2
- package/dist/cli/install/index.js +39 -2
- package/dist/cli/launcher.js +9 -1
- package/dist/cli/menu.js +15 -2
- package/dist/cli/setup.js +56 -17
- package/dist/cli/setupWizard.js +65 -16
- package/package.json +1 -1
- package/web-dist/.next/BUILD_ID +1 -1
- package/web-dist/.next/build-manifest.json +3 -3
- package/web-dist/.next/server/app/_global-error.html +1 -1
- package/web-dist/.next/server/app/_global-error.rsc +1 -1
- package/web-dist/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web-dist/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web-dist/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web-dist/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web-dist/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web-dist/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web-dist/.next/server/app/_not-found.html +1 -1
- package/web-dist/.next/server/app/_not-found.rsc +11 -11
- package/web-dist/.next/server/app/_not-found.segments/_full.segment.rsc +11 -11
- package/web-dist/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/web-dist/.next/server/app/_not-found.segments/_index.segment.rsc +6 -6
- package/web-dist/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/web-dist/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/web-dist/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/web-dist/.next/server/app/account/page_client-reference-manifest.js +1 -1
- package/web-dist/.next/server/app/account.html +1 -1
- package/web-dist/.next/server/app/account.rsc +13 -13
- package/web-dist/.next/server/app/account.segments/_full.segment.rsc +13 -13
- package/web-dist/.next/server/app/account.segments/_head.segment.rsc +4 -4
- package/web-dist/.next/server/app/account.segments/_index.segment.rsc +6 -6
- package/web-dist/.next/server/app/account.segments/_tree.segment.rsc +2 -2
- package/web-dist/.next/server/app/account.segments/account/__PAGE__.segment.rsc +4 -4
- package/web-dist/.next/server/app/account.segments/account.segment.rsc +3 -3
- package/web-dist/.next/server/app/dash/page_client-reference-manifest.js +1 -1
- package/web-dist/.next/server/app/dash.html +1 -1
- package/web-dist/.next/server/app/dash.rsc +13 -13
- package/web-dist/.next/server/app/dash.segments/_full.segment.rsc +13 -13
- package/web-dist/.next/server/app/dash.segments/_head.segment.rsc +4 -4
- package/web-dist/.next/server/app/dash.segments/_index.segment.rsc +6 -6
- package/web-dist/.next/server/app/dash.segments/_tree.segment.rsc +2 -2
- package/web-dist/.next/server/app/dash.segments/dash/__PAGE__.segment.rsc +4 -4
- package/web-dist/.next/server/app/dash.segments/dash.segment.rsc +3 -3
- package/web-dist/.next/server/app/escalations/page_client-reference-manifest.js +1 -1
- package/web-dist/.next/server/app/escalations.html +1 -1
- package/web-dist/.next/server/app/escalations.rsc +13 -13
- package/web-dist/.next/server/app/escalations.segments/_full.segment.rsc +13 -13
- package/web-dist/.next/server/app/escalations.segments/_head.segment.rsc +4 -4
- package/web-dist/.next/server/app/escalations.segments/_index.segment.rsc +6 -6
- package/web-dist/.next/server/app/escalations.segments/_tree.segment.rsc +2 -2
- package/web-dist/.next/server/app/escalations.segments/escalations/__PAGE__.segment.rsc +4 -4
- package/web-dist/.next/server/app/escalations.segments/escalations.segment.rsc +3 -3
- package/web-dist/.next/server/app/index.html +1 -1
- package/web-dist/.next/server/app/index.rsc +13 -13
- package/web-dist/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
- package/web-dist/.next/server/app/index.segments/_full.segment.rsc +13 -13
- package/web-dist/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/web-dist/.next/server/app/index.segments/_index.segment.rsc +6 -6
- package/web-dist/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/web-dist/.next/server/app/kanban/page_client-reference-manifest.js +1 -1
- package/web-dist/.next/server/app/kanban.html +1 -1
- package/web-dist/.next/server/app/kanban.rsc +13 -13
- package/web-dist/.next/server/app/kanban.segments/_full.segment.rsc +13 -13
- package/web-dist/.next/server/app/kanban.segments/_head.segment.rsc +4 -4
- package/web-dist/.next/server/app/kanban.segments/_index.segment.rsc +6 -6
- package/web-dist/.next/server/app/kanban.segments/_tree.segment.rsc +2 -2
- package/web-dist/.next/server/app/kanban.segments/kanban/__PAGE__.segment.rsc +4 -4
- package/web-dist/.next/server/app/kanban.segments/kanban.segment.rsc +3 -3
- package/web-dist/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/web-dist/.next/server/app/onboarding.html +1 -1
- package/web-dist/.next/server/app/onboarding.rsc +13 -13
- package/web-dist/.next/server/app/onboarding.segments/_full.segment.rsc +13 -13
- package/web-dist/.next/server/app/onboarding.segments/_head.segment.rsc +4 -4
- package/web-dist/.next/server/app/onboarding.segments/_index.segment.rsc +6 -6
- package/web-dist/.next/server/app/onboarding.segments/_tree.segment.rsc +2 -2
- package/web-dist/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +4 -4
- package/web-dist/.next/server/app/onboarding.segments/onboarding.segment.rsc +3 -3
- package/web-dist/.next/server/app/page_client-reference-manifest.js +1 -1
- package/web-dist/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/web-dist/.next/server/app/projects.html +1 -1
- package/web-dist/.next/server/app/projects.rsc +13 -13
- package/web-dist/.next/server/app/projects.segments/_full.segment.rsc +13 -13
- package/web-dist/.next/server/app/projects.segments/_head.segment.rsc +4 -4
- package/web-dist/.next/server/app/projects.segments/_index.segment.rsc +6 -6
- package/web-dist/.next/server/app/projects.segments/_tree.segment.rsc +2 -2
- package/web-dist/.next/server/app/projects.segments/projects/__PAGE__.segment.rsc +4 -4
- package/web-dist/.next/server/app/projects.segments/projects.segment.rsc +3 -3
- package/web-dist/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
- package/web-dist/.next/server/app/sessions.html +1 -1
- package/web-dist/.next/server/app/sessions.rsc +13 -13
- package/web-dist/.next/server/app/sessions.segments/_full.segment.rsc +13 -13
- package/web-dist/.next/server/app/sessions.segments/_head.segment.rsc +4 -4
- package/web-dist/.next/server/app/sessions.segments/_index.segment.rsc +6 -6
- package/web-dist/.next/server/app/sessions.segments/_tree.segment.rsc +2 -2
- package/web-dist/.next/server/app/sessions.segments/sessions/__PAGE__.segment.rsc +4 -4
- package/web-dist/.next/server/app/sessions.segments/sessions.segment.rsc +3 -3
- package/web-dist/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/web-dist/.next/server/app/settings.html +1 -1
- package/web-dist/.next/server/app/settings.rsc +13 -13
- package/web-dist/.next/server/app/settings.segments/_full.segment.rsc +13 -13
- package/web-dist/.next/server/app/settings.segments/_head.segment.rsc +4 -4
- package/web-dist/.next/server/app/settings.segments/_index.segment.rsc +6 -6
- package/web-dist/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
- package/web-dist/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
- package/web-dist/.next/server/app/settings.segments/settings.segment.rsc +3 -3
- package/web-dist/.next/server/app/tasks/page_client-reference-manifest.js +1 -1
- package/web-dist/.next/server/app/tasks.html +1 -1
- package/web-dist/.next/server/app/tasks.rsc +13 -13
- package/web-dist/.next/server/app/tasks.segments/_full.segment.rsc +13 -13
- package/web-dist/.next/server/app/tasks.segments/_head.segment.rsc +4 -4
- package/web-dist/.next/server/app/tasks.segments/_index.segment.rsc +6 -6
- package/web-dist/.next/server/app/tasks.segments/_tree.segment.rsc +2 -2
- package/web-dist/.next/server/app/tasks.segments/tasks/__PAGE__.segment.rsc +4 -4
- package/web-dist/.next/server/app/tasks.segments/tasks.segment.rsc +3 -3
- package/web-dist/.next/server/app/timeline/page_client-reference-manifest.js +1 -1
- package/web-dist/.next/server/app/timeline.html +1 -1
- package/web-dist/.next/server/app/timeline.rsc +13 -13
- package/web-dist/.next/server/app/timeline.segments/_full.segment.rsc +13 -13
- package/web-dist/.next/server/app/timeline.segments/_head.segment.rsc +4 -4
- package/web-dist/.next/server/app/timeline.segments/_index.segment.rsc +6 -6
- package/web-dist/.next/server/app/timeline.segments/_tree.segment.rsc +2 -2
- package/web-dist/.next/server/app/timeline.segments/timeline/__PAGE__.segment.rsc +4 -4
- package/web-dist/.next/server/app/timeline.segments/timeline.segment.rsc +3 -3
- package/web-dist/.next/server/app/users/page_client-reference-manifest.js +1 -1
- package/web-dist/.next/server/app/users.html +1 -1
- package/web-dist/.next/server/app/users.rsc +13 -13
- package/web-dist/.next/server/app/users.segments/_full.segment.rsc +13 -13
- package/web-dist/.next/server/app/users.segments/_head.segment.rsc +4 -4
- package/web-dist/.next/server/app/users.segments/_index.segment.rsc +6 -6
- package/web-dist/.next/server/app/users.segments/_tree.segment.rsc +2 -2
- package/web-dist/.next/server/app/users.segments/users/__PAGE__.segment.rsc +4 -4
- package/web-dist/.next/server/app/users.segments/users.segment.rsc +3 -3
- package/web-dist/.next/server/chunks/ssr/_057a06r._.js +1 -1
- package/web-dist/.next/server/chunks/ssr/_09x5h4x._.js +1 -1
- package/web-dist/.next/server/chunks/ssr/_0tzourm._.js +1 -1
- package/web-dist/.next/server/chunks/ssr/components_shell_Shell_tsx_1e5c27h._.js +1 -1
- package/web-dist/.next/server/middleware-build-manifest.js +3 -3
- package/web-dist/.next/server/pages/404.html +1 -1
- package/web-dist/.next/server/pages/500.html +1 -1
- package/web-dist/.next/static/chunks/{3bdts7sstygr0.css → 0x8sf96sz490-.css} +1 -1
- package/web-dist/.next/static/chunks/{2-j0lduvppz4v.js → 0xgdqczv5tvu5.js} +1 -1
- package/web-dist/.next/static/chunks/{16rotf1pkrqyn.js → 218i8jnxp91u8.js} +1 -1
- package/web-dist/.next/static/chunks/{0_5u1_tmtxso3.js → 2ki5va2_5l6d6.js} +1 -1
- package/web-dist/.next/static/chunks/3ssnuxdh0r51g.js +1 -0
- package/web-dist/.next/static/chunks/2m810vyp96um0.js +0 -1
- /package/web-dist/.next/static/{-uzOOlExTv_eTD0OFDRq_ → qtJrbMvehxNiblgQJOzhz}/_buildManifest.js +0 -0
- /package/web-dist/.next/static/{-uzOOlExTv_eTD0OFDRq_ → qtJrbMvehxNiblgQJOzhz}/_clientMiddlewareManifest.js +0 -0
- /package/web-dist/.next/static/{-uzOOlExTv_eTD0OFDRq_ → qtJrbMvehxNiblgQJOzhz}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,22833,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(75254);let r=(0,a.default)("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);var n=e.i(19273),i=e.i(86491),l=e.i(40143),o=e.i(15823),u=class extends o.Subscribable{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,s){let a=t.queryKey,r=t.queryHash??(0,n.hashQueryKeyByOptions)(a,t),l=this.get(r);return l||(l=new i.Query({client:e,queryKey:a,queryHash:r,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(a)}),this.add(l)),l}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){l.notifyManager.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.matchQuery)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,n.matchQuery)(e,t)):t}notify(e){l.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){l.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){l.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},c=e.i(14272),d=o,h=class extends d.Subscribable{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#s=new Map,this.#a=0}#t;#s;#a;build(e,t,s){let a=new c.Mutation({client:e,mutationCache:this,mutationId:++this.#a,options:e.defaultMutationOptions(t),state:s});return this.add(a),a}add(e){this.#t.add(e);let t=m(e);if("string"==typeof t){let s=this.#s.get(t);s?s.push(e):this.#s.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){let t=m(e);if("string"==typeof t){let s=this.#s.get(t);if(s)if(s.length>1){let t=s.indexOf(e);-1!==t&&s.splice(t,1)}else s[0]===e&&this.#s.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=m(e);if("string"!=typeof t)return!0;{let s=this.#s.get(t),a=s?.find(e=>"pending"===e.state.status);return!a||a===e}}runNext(e){let t=m(e);if("string"!=typeof t)return Promise.resolve();{let s=this.#s.get(t)?.find(t=>t!==e&&t.state.isPaused);return s?.continue()??Promise.resolve()}}clear(){l.notifyManager.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#s.clear()})}getAll(){return Array.from(this.#t)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.matchMutation)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,n.matchMutation)(e,t))}notify(e){l.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return l.notifyManager.batch(()=>Promise.all(e.map(e=>e.continue().catch(n.noop))))}};function m(e){return e.options.scope?.id}var f=e.i(75555),p=e.i(14448),x=class{#r;#n;#i;#l;#o;#u;#c;#d;constructor(e={}){this.#r=e.queryCache||new u,this.#n=e.mutationCache||new h,this.#i=e.defaultOptions||{},this.#l=new Map,this.#o=new Map,this.#u=0}mount(){this.#u++,1===this.#u&&(this.#c=f.focusManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#r.onFocus())}),this.#d=p.onlineManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#r.onOnline())}))}unmount(){this.#u--,0===this.#u&&(this.#c?.(),this.#c=void 0,this.#d?.(),this.#d=void 0)}isFetching(e){return this.#r.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#r.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),s=this.#r.build(this,t),a=s.state.data;return void 0===a?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime((0,n.resolveStaleTime)(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return this.#r.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,s){let a=this.defaultQueryOptions({queryKey:e}),r=this.#r.get(a.queryHash),i=r?.state.data,l=(0,n.functionalUpdate)(t,i);if(void 0!==l)return this.#r.build(this,a).setData(l,{...s,manual:!0})}setQueriesData(e,t,s){return l.notifyManager.batch(()=>this.#r.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,s)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#r.get(t.queryHash)?.state}removeQueries(e){let t=this.#r;l.notifyManager.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let s=this.#r;return l.notifyManager.batch(()=>(s.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let s={revert:!0,...t};return Promise.all(l.notifyManager.batch(()=>this.#r.findAll(e).map(e=>e.cancel(s)))).then(n.noop).catch(n.noop)}invalidateQueries(e,t={}){return l.notifyManager.batch(()=>(this.#r.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let s={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(l.notifyManager.batch(()=>this.#r.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,s);return s.throwOnError||(t=t.catch(n.noop)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(n.noop)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let s=this.#r.build(this,t);return s.isStaleByTime((0,n.resolveStaleTime)(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(n.noop).catch(n.noop)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n.noop).catch(n.noop)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return p.onlineManager.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#r}getMutationCache(){return this.#n}getDefaultOptions(){return this.#i}setDefaultOptions(e){this.#i=e}setQueryDefaults(e,t){this.#l.set((0,n.hashKey)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#l.values()],s={};return t.forEach(t=>{(0,n.partialMatchKey)(e,t.queryKey)&&Object.assign(s,t.defaultOptions)}),s}setMutationDefaults(e,t){this.#o.set((0,n.hashKey)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#o.values()],s={};return t.forEach(t=>{(0,n.partialMatchKey)(e,t.mutationKey)&&Object.assign(s,t.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#i.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,n.hashQueryKeyByOptions)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===n.skipToken&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#i.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#r.clear(),this.#n.clear()}},g=e.i(12598),y=e.i(40273),b=e.i(51981);function v(){let e,t;return e=(0,g.useQueryClient)(),(t=(0,s.useRef)(void 0)).current=void 0,(0,s.useEffect)(()=>{let s=new EventSource(`${y.BASE}/events`,{withCredentials:!0});s.onerror=()=>{s.readyState===EventSource.CLOSED&&s.close()};let a=e=>t=>{try{JSON.parse(t.data)}catch{return}e()},r=a(()=>{e.invalidateQueries({queryKey:b.QUERY_KEYS.tasks}),e.invalidateQueries({queryKey:["mission"]}),e.invalidateQueries({queryKey:["activity"]})}),n=a(()=>{e.invalidateQueries({queryKey:b.QUERY_KEYS.missions}),e.invalidateQueries({queryKey:["mission"]}),e.invalidateQueries({queryKey:["activity"]})});return s.addEventListener("task",r),s.addEventListener("mission",n),s.addEventListener("signal",t=>{let s;try{s=JSON.parse(t.data)}catch{return}s.session&&s.signal&&e.setQueryData(b.QUERY_KEYS.sessionSignals,e=>({...e??{},[s.session]:s.signal})),e.invalidateQueries({queryKey:b.QUERY_KEYS.sessions}),e.invalidateQueries({queryKey:["activity"]})}),s.addEventListener("plan",t=>{let s;try{s=JSON.parse(t.data)}catch{return}s.jobId&&s.status&&(e.setQueryData(["plan-job",s.jobId],e=>({id:s.jobId,goal:e?.goal??"",epicId:s.epicId??e?.epicId??null,status:s.status,phases:s.phases??e?.phases??[],error:s.error,sessionName:s.sessionName??e?.sessionName})),"done"===s.status&&(e.invalidateQueries({queryKey:b.QUERY_KEYS.tasks}),e.invalidateQueries({queryKey:b.QUERY_KEYS.missions})))}),s.addEventListener("review",s=>{let a;try{a=JSON.parse(s.data)}catch{return}e.invalidateQueries({queryKey:b.QUERY_KEYS.tasks}),e.invalidateQueries({queryKey:["mission"]}),e.invalidateQueries({queryKey:b.QUERY_KEYS.missions}),e.invalidateQueries({queryKey:["activity"]}),a.taskId&&t.current?.({missionId:a.missionId,taskId:a.taskId,approve:!!a.approve,rationale:a.rationale??""})}),()=>s.close()},[e]),null}function w({children:e}){let[a]=(0,s.useState)(()=>new x({defaultOptions:{queries:{retry:(e,t)=>{let s=t instanceof y.OrcaApiError?t.status:void 0;return(null==s||!(s>=400)||!(s<500))&&e<2}}}}));return(0,t.jsx)(g.QueryClientProvider,{client:a,children:e})}e.i(69530);var j=e.i(2942),k=e.i(80809),N=e.i(18566),C=e.i(92852),S=e.i(4552),E=e.i(76525),q=e.i(1206);function O({onAuthed:e}){let[a,r]=(0,s.useState)(""),[n,i]=(0,s.useState)(""),l=(0,S.useLogin)(),{toast:o}=(0,k.useToast)(),{t:u}=(0,j.useTranslation)();return(0,t.jsx)("div",{className:"flex h-screen items-center justify-center bg-bg",children:(0,t.jsxs)("div",{className:"animate-pop-in flex w-full max-w-sm flex-col gap-4 rounded-xl border border-border bg-surface p-8",style:{boxShadow:"var(--shadow-raised)"},children:[(0,t.jsx)("img",{src:"/orca-logo.png",alt:"Orca",className:"mx-auto h-auto w-64"}),(0,t.jsx)("h1",{className:"text-center text-sm uppercase tracking-wide text-text-muted",children:u.auth.signIn}),(0,t.jsxs)("form",{onSubmit:function(t){t.preventDefault(),l.mutate({username:a,password:n},{onSuccess:()=>{e()},onError:e=>{o(String(e),"error")}})},className:"flex flex-col gap-3",children:[(0,t.jsx)(q.Input,{type:"text",placeholder:u.auth.usernamePlaceholder,value:a,onChange:e=>r(e.target.value),autoComplete:"username"}),(0,t.jsx)(q.Input,{type:"password",placeholder:u.auth.passwordPlaceholder,value:n,onChange:e=>i(e.target.value),autoComplete:"current-password"}),(0,t.jsx)(E.Button,{type:"submit",variant:"accent",disabled:l.isPending,className:"w-full justify-center",children:u.auth.signIn})]})]})})}function Q({children:e}){let[a,r]=(0,s.useState)("checking"),n=(0,N.useRouter)(),i=(0,N.usePathname)(),l=(0,g.useQueryClient)();return((0,s.useEffect)(()=>{let e=!0;return y.orcaClient.me().then(()=>{e&&r("open")}).catch(t=>{e&&(401!==(t instanceof y.OrcaApiError?t.status:void 0)?r("login"):y.orcaClient.setupStatus().then(t=>{e&&(t.needsSetup?(r("open"),"/onboarding"!==i&&n.replace("/onboarding")):r("login"))}).catch(()=>{e&&r("login")}))}),()=>{e=!1}},[i,n]),(0,s.useEffect)(()=>{let e=()=>{l.clear(),r("login")};return window.addEventListener(C.AUTH_CLEARED_EVENT,e),()=>window.removeEventListener(C.AUTH_CLEARED_EVENT,e)},[l]),"checking"===a)?null:"login"===a?(0,t.jsx)(O,{onAuthed:()=>r("open")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v,{}),e]})}var M=e.i(22016);let A=(0,a.default)("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);var D=e.i(84614),K=e.i(51737);let P=[{id:"dashboard",label:"Dash",route:"/dash",icon:e.i(60289).LayoutDashboard,group:"Operate"},{id:"tasks",label:"Tasks",route:"/tasks",icon:e.i(63804).ListChecks,group:"Operate"},{id:"kanban",label:"Kanban",route:"/kanban",icon:e.i(41382).KanbanSquare,group:"Operate"},{id:"timeline",label:"Timeline",route:"/timeline",icon:e.i(21218).Activity,group:"Operate"},{id:"escalations",label:"Escalations",route:"/escalations",icon:K.ShieldAlert,group:"Operate"},{id:"sessions",label:"Sessions",route:"/sessions",icon:e.i(20535).SquareTerminal,group:"Operate"},{id:"settings",label:"Settings",route:"/settings",icon:(0,a.default)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),group:"Config"},{id:"projects",label:"Projects",route:"/projects",icon:e.i(90272).FolderGit2,group:"Operate"},{id:"users",label:"Users",route:"/users",icon:e.i(61911).Users,group:"Config"}],T=["Operate","Config"],L="orca-sidebar",I=e=>Math.max(160,Math.min(360,e));function z(e){try{localStorage.setItem(L,JSON.stringify(e))}catch{}}function R({entry:e,active:s,collapsed:a}){let r=e.icon,n=e.badge&&e.badge>0?e.badge:0;return(0,t.jsxs)(M.default,{href:e.href,title:a?e.label:void 0,"aria-current":s?"page":void 0,className:`relative flex items-center gap-3 border-l-2 px-3 py-2 text-sm transition-colors ${s?"border-accent text-text":"border-transparent text-text-muted hover:text-text"}${a?" justify-center":""}`.trim(),children:[(0,t.jsxs)("span",{className:"relative shrink-0",children:[(0,t.jsx)(r,{size:16,strokeWidth:1.5,"aria-hidden":!0}),n>0&&a&&(0,t.jsx)("span",{className:"absolute -right-1.5 -top-1.5 flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-warning px-0.5 text-[9px] font-bold text-black",children:n})]}),!a&&(0,t.jsx)("span",{className:"uppercase tracking-wide text-xs",children:e.label}),n>0&&!a&&(0,t.jsx)("span",{className:"ml-auto flex h-4 min-w-4 items-center justify-center rounded-full bg-warning/15 px-1 text-[10px] font-bold text-warning",children:n})]})}function _({group:e,pathname:s,collapsed:a}){return(0,t.jsxs)("div",{className:"flex flex-col py-1",children:[!a&&(0,t.jsx)("span",{className:"px-3 py-1 font-mono text-tiny uppercase tracking-widest text-text-muted",children:e.label}),e.items.map(e=>(0,t.jsx)(R,{entry:e,active:s===e.href,collapsed:a},e.href))]})}var F=e.i(95468),U=e.i(73884);let $=(0,a.default)("Hourglass",[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]]);var H=e.i(24877),Y=e.i(91842);function B({name:e,onStuck:t}){let{state:a}=(0,Y.useSessionStall)(e,!0),r="stuck"===a;return(0,s.useEffect)(()=>{t(e,r)},[e,r,t]),null}function J({expanded:e}){let{t:a}=(0,j.useTranslation)(),r=(0,b.useTasks)(),n=(0,b.useSessions)(),i=(0,s.useMemo)(()=>n.data??[],[n.data]),l=i.length,o=(0,H.lastClosedTask)(r.data??[]),u=o?.outcome==="fail",[c,d]=(0,s.useState)({}),h=(0,s.useCallback)((e,t)=>{d(s=>s[e]===t?s:{...s,[e]:t})},[]);(0,s.useEffect)(()=>{let e=new Set(i);d(t=>{let s={},a=!1;for(let[r,n]of Object.entries(t))e.has(r)?s[r]=n:a=!0;return a?s:t})},[i]);let m=i.filter(e=>c[e]).length;if(0===l&&!o)return null;let f=(0,t.jsx)("span",{className:`h-2 w-2 shrink-0 rounded-full ${l>0?"live-dot":""}`,style:{backgroundColor:l>0?"var(--color-success)":"var(--color-border-strong)","--live-ring":"color-mix(in srgb, var(--color-success) 50%, transparent)"},"aria-hidden":!0}),p=i.map(e=>(0,t.jsx)(B,{name:e,onStuck:h},e));return e?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 border-t border-border px-2 py-2",children:[p,m>0&&(0,t.jsxs)(M.default,{href:"/sessions",className:"flex items-center gap-2 rounded-md px-2 py-1 text-xs font-medium text-danger transition-colors hover:bg-elevated",children:[(0,t.jsx)($,{size:13,className:"shrink-0","aria-hidden":!0}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a.sidebar.stuckAgents.replace("{count}",String(m))})]}),(0,t.jsxs)(M.default,{href:"/sessions",className:"flex items-center gap-2 rounded-md px-2 py-1 text-xs text-text-muted transition-colors hover:bg-elevated",children:[f,(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a.sidebar.liveAgents.replace("{count}",String(l))})]}),o&&(0,t.jsxs)(M.default,{href:`/tasks?select=${encodeURIComponent(o.id)}`,title:o.result_summary??o.title,className:"flex items-center gap-2 rounded-md px-2 py-1 text-xs text-text-muted transition-colors hover:bg-elevated",children:[u?(0,t.jsx)(U.XCircle,{size:13,className:"shrink-0 text-error","aria-hidden":!0}):(0,t.jsx)(F.CheckCircle2,{size:13,className:"shrink-0 text-success","aria-hidden":!0}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a.sidebar.lastOutcome.replace("{title}",o.title)})]})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 border-t border-border py-2.5",children:[p,m>0&&(0,t.jsxs)(M.default,{href:"/sessions",title:a.sidebar.stuckAgents.replace("{count}",String(m)),className:"relative flex h-7 w-7 items-center justify-center rounded-md text-danger transition-colors hover:bg-elevated",children:[(0,t.jsx)($,{size:15,"aria-hidden":!0}),(0,t.jsx)("span",{className:"absolute -right-0.5 -top-0.5 flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-danger px-0.5 text-[9px] font-bold text-white",children:m})]}),(0,t.jsxs)(M.default,{href:"/sessions",title:a.sidebar.liveAgents.replace("{count}",String(l)),className:"flex items-center gap-1 rounded-md px-1.5 py-1 transition-colors hover:bg-elevated",children:[f,(0,t.jsx)("span",{className:"font-mono text-[11px] text-text-muted",children:l})]})]})}var V=e.i(74080),W=e.i(45423),X=e.i(77154),G=e.i(45286);function Z(){let{t:e}=(0,j.useTranslation)(),a=(0,b.useSessions)(),r=(0,b.useSessionSignals)(),n=(0,b.useTasks)(),i=(0,H.needsInputSessions)(a.data??[],r),l=(0,b.useEscalations)(),o=i.length+l.length,u=(0,s.useRef)(null),[c,d]=(0,s.useState)(!1),[h,m]=(0,s.useState)(null),[f,p]=(0,s.useState)(!1);(0,s.useEffect)(()=>p(!0),[]);let x=()=>{let e=u.current;if(!e)return;let t=e.getBoundingClientRect();m({left:Math.max(8,t.left),bottom:window.innerHeight-t.top+8})};return(0,s.useEffect)(()=>{if(!c)return;let e=e=>{"Escape"===e.key&&d(!1)},t=()=>x();return window.addEventListener("keydown",e),window.addEventListener("resize",t),()=>{window.removeEventListener("keydown",e),window.removeEventListener("resize",t)}},[c]),(0,t.jsxs)("div",{className:"shrink-0",children:[(0,t.jsxs)("button",{ref:u,type:"button",onClick:()=>{c||x(),d(e=>!e)},"aria-label":e.sidebar.notifications,"aria-haspopup":"menu","aria-expanded":c,title:e.sidebar.notifications,className:`relative flex h-7 w-7 items-center justify-center rounded-md transition-colors hover:bg-elevated ${o>0?"text-warning":"text-text-muted hover:text-text"}`,children:[(0,t.jsx)(W.Bell,{size:15,"aria-hidden":!0}),o>0&&(0,t.jsx)("span",{className:"absolute -right-0.5 -top-0.5 flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-warning px-0.5 text-[9px] font-bold text-black",children:o})]}),f&&c&&h&&(0,V.createPortal)((0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-[60]",onClick:()=>d(!1),"aria-hidden":!0}),(0,t.jsxs)("div",{role:"menu","aria-label":e.sidebar.notifications,className:"fixed z-[61] w-80 max-w-[calc(100vw-1rem)] overflow-hidden rounded-lg border border-border bg-surface",style:{left:h.left,bottom:h.bottom,boxShadow:"var(--shadow-raised)"},children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2 text-xs font-semibold text-text",children:[(0,t.jsx)(W.Bell,{size:13,className:o>0?"text-warning":"text-text-muted","aria-hidden":!0}),e.sidebar.notifications,o>0&&(0,t.jsx)("span",{className:"ml-auto flex h-4 min-w-4 items-center justify-center rounded-full bg-warning/15 px-1 text-[10px] font-bold text-warning",children:o})]}),0===o?(0,t.jsx)("div",{className:"px-3 py-7 text-center text-xs text-text-muted",children:e.sidebar.noNotifications}):(0,t.jsxs)("div",{className:"flex max-h-[60vh] flex-col gap-1.5 overflow-auto p-2",children:[l.length>0&&(0,t.jsxs)(M.default,{href:"/escalations",onClick:()=>d(!1),className:"flex items-center gap-2 rounded-md border border-warning/40 bg-warning/[0.06] px-2.5 py-2 transition-colors hover:bg-warning/10",children:[(0,t.jsx)(K.ShieldAlert,{size:14,className:"shrink-0 text-warning","aria-hidden":!0}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block text-xs font-medium text-text",children:e.sidebar.escalations.replace("{count}",String(l.length))}),(0,t.jsx)("span",{className:"block truncate text-tiny text-text-muted",children:l[0].title})]})]}),i.map(e=>{let s=r[e];return(0,t.jsx)(G.NeedsInputRow,{name:e,question:s?.type==="needs_input"?s.question:"",options:s?.type==="needs_input"?s.options:void 0,exec:(0,X.taskExec)((n.data??[]).find(t=>(0,H.taskSessionName)(t)===e)?.labels)},e)})]})]})]}),document.body)]})}var ee=e.i(1544);let et={ready:{color:"var(--color-success)",ring:"color-mix(in srgb, var(--color-success) 50%, transparent)"},busy:{color:"var(--color-warning)",ring:"color-mix(in srgb, var(--color-warning) 50%, transparent)"},fail:{color:"var(--color-error)",ring:"color-mix(in srgb, var(--color-error) 50%, transparent)"}};function es({mobileOpen:e=!1,onMobileClose:a}){let r=(0,N.usePathname)(),{collapsed:n,width:i,toggle:l,setWidth:o}=function(){let[e,t]=(0,s.useState)({collapsed:!1,width:224});(0,s.useEffect)(()=>{t(function(){try{let e=localStorage.getItem(L);if(e){let t=JSON.parse(e);return{collapsed:!!t.collapsed,width:I(Number(t.width??224))}}}catch{}return{collapsed:!1,width:224}}())},[]);let a=(0,s.useCallback)(()=>t(e=>{let t={...e,collapsed:!e.collapsed};return z(t),t}),[]),r=(0,s.useCallback)(e=>t(t=>{let s={...t,width:I(e)};return z(s),s}),[]);return{collapsed:e.collapsed,width:e.width,toggle:a,setWidth:r}}(),{data:u}=(0,b.useHealth)(),c=(0,b.useTasks)(),d=(0,b.useMe)(),h=d.data?.user?.is_admin??!1,m=u?.ok===!0,f=(c.data??[]).some(e=>"in_progress"===e.status),p=m?f?"busy":"ready":"fail",x=(c.data??[]).find(e=>"open"===e.status&&"epic"!==e.type),g=(0,b.useEscalations)(),y=(0,s.useRef)(!1),{t:v,locale:w,setLocale:k}=(0,j.useTranslation)(),[C,S]=(0,s.useState)(!1);(0,s.useEffect)(()=>{let e=window.matchMedia("(max-width: 767px)");S(e.matches);let t=e=>S(e.matches);return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let E=!!C||!n;(0,s.useEffect)(()=>{C&&a?.()},[r]);let q=(0,s.useCallback)(e=>{y.current=!0,e.target.setPointerCapture?.(e.pointerId)},[]),O=(0,s.useCallback)(e=>{y.current&&o(e.clientX)},[o]),Q=(0,s.useCallback)(e=>{y.current=!1,e.target.releasePointerCapture?.(e.pointerId)},[]);return(0,t.jsxs)(t.Fragment,{children:[C&&(0,t.jsx)("div",{"aria-hidden":!0,onClick:a,className:`fixed inset-0 z-40 bg-black/50 transition-opacity md:hidden ${e?"opacity-100":"pointer-events-none opacity-0"}`}),(0,t.jsxs)("nav",{"aria-label":v.common.primaryNav,className:C?`fixed inset-y-0 left-0 z-50 flex h-full w-[264px] flex-col overflow-hidden border-r border-border bg-surface transition-transform duration-200 md:hidden ${e?"translate-x-0":"-translate-x-full"}`:"relative hidden h-full shrink-0 flex-col border-r border-border bg-surface transition-[width] duration-200 md:flex",style:C?{transitionTimingFunction:"var(--ease-out)"}:{width:E?i:56,transitionTimingFunction:"var(--ease-out)"},children:[(0,t.jsx)("div",{className:"flex items-center justify-center border-b border-border px-3 py-3 overflow-hidden",children:E?(0,t.jsx)("img",{src:"/orca-logo.png",alt:v.common.appName,className:"h-9 w-auto"}):(0,t.jsx)("img",{src:"/icon.png",alt:v.common.appName,className:"h-7 w-7 rounded-md"})}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto py-2",children:T.map(e=>({group:e,items:P.filter(t=>t.group===e)})).filter(e=>"Config"!==e.group||h).map(e=>{let s="Operate"===e.group?v.nav.operate:v.nav.config;return(0,t.jsx)(_,{group:{label:s,items:e.items.map(e=>({href:e.route,label:v.nav[e.id]??e.label,icon:e.icon,badge:"escalations"===e.id?g.length:void 0}))},pathname:r,collapsed:!E},e.group)})}),E&&g.length>0&&(0,t.jsxs)(M.default,{href:"/escalations",className:"border-t border-warning/30 bg-warning/[0.06] px-4 py-2.5 transition-colors hover:bg-warning/10",title:g[0].title,children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-tiny font-semibold uppercase tracking-wide text-warning",children:[(0,t.jsx)(K.ShieldAlert,{size:12,"aria-hidden":!0}),v.common.escalationsWaiting.replace("{count}",String(g.length))]}),(0,t.jsx)("div",{className:"mt-0.5 truncate text-xs text-text",children:g[0].title})]}),E&&x&&(0,t.jsxs)(M.default,{href:"/tasks",className:"border-t border-border px-4 py-2.5 transition-colors hover:bg-elevated",title:x.title,children:[(0,t.jsx)("div",{className:"text-tiny font-medium uppercase tracking-wide text-text-muted",children:v.common.nextReady}),(0,t.jsx)("div",{className:"mt-0.5 truncate text-xs text-text",children:x.title})]}),(0,t.jsx)(J,{expanded:E}),(0,t.jsxs)("div",{className:`border-t border-border px-3 py-2 ${E?"flex items-center gap-2":"flex flex-col items-center gap-2"}`,children:[(0,t.jsxs)(M.default,{href:"/account",className:`flex min-w-0 items-center gap-2 rounded-md py-1 transition-colors hover:bg-elevated ${E?"flex-1 px-1":""}`,title:d.data?.user?d.data.user.name||d.data.user.username:v.common.daemon,children:[(0,t.jsxs)("span",{className:"relative flex shrink-0 items-center justify-center",children:[d.data?.user?(0,t.jsx)(ee.Avatar,{user:d.data.user,size:28}):(0,t.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-full border border-border bg-elevated",children:(0,t.jsx)(D.User,{size:14,className:"text-text-muted","aria-hidden":!0})}),(0,t.jsx)("span",{role:"status","aria-label":m?v.common.daemonUp:v.common.daemonDown,title:"fail"===p?v.common.daemonOffline:"busy"===p?v.common.daemonBusy:v.common.daemonReady,className:`absolute -bottom-0.5 -right-0.5 h-2.5 w-2.5 rounded-full border-2 border-surface ${m?"live-dot":""}`,style:{backgroundColor:et[p].color,"--live-ring":et[p].ring}})]}),E&&d.data?.user&&(0,t.jsxs)("span",{className:"flex min-w-0 flex-col leading-tight",children:[(0,t.jsx)("span",{className:"truncate text-xs font-medium text-text",children:d.data.user.name||d.data.user.username}),(0,t.jsx)("span",{className:"truncate text-tiny text-text-muted",children:d.data.user.is_admin?v.users.admin:v.users.member})]})]}),(0,t.jsx)(Z,{}),E&&(0,t.jsxs)("button",{type:"button",onClick:()=>k("en"===w?"cs":"en"),className:"flex shrink-0 items-center gap-1 rounded-md border border-border px-2 py-1 text-tiny font-mono uppercase tracking-wide text-text-muted transition-colors hover:border-border-strong hover:text-text","aria-label":v.common.switchLang,children:[(0,t.jsx)(A,{size:12,"aria-hidden":!0}),"en"===w?"CS":"EN"]})]}),!C&&(0,t.jsx)("button",{type:"button","aria-label":v.common.toggleSidebar,onClick:l,className:"group absolute -right-2 top-1/2 z-10 flex h-14 w-4 -translate-y-1/2 items-center justify-center",children:(0,t.jsx)("span",{className:"h-9 w-1 rounded-full bg-border transition-all duration-200 group-hover:h-12 group-hover:bg-text-muted"})}),!C&&E&&(0,t.jsx)("div",{"data-testid":"sidebar-resize",onPointerDown:q,onPointerMove:O,onPointerUp:Q,onDoubleClick:()=>o(224),className:"absolute right-0 top-0 h-full w-1 cursor-col-resize"})]})]})}var ea=e.i(55436),er=e.i(7233),en=e.i(9912);let ei=(0,a.default)("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);function el({text:e,q:s}){if(!s)return(0,t.jsx)(t.Fragment,{children:e});let a=e.toLowerCase().indexOf(s.toLowerCase());return a<0?(0,t.jsx)(t.Fragment,{children:e}):(0,t.jsxs)(t.Fragment,{children:[e.slice(0,a),(0,t.jsx)("span",{className:"text-accent",children:e.slice(a,a+s.length)}),e.slice(a+s.length)]})}function eo(){let e=(0,N.useRouter)(),{t:a}=(0,j.useTranslation)(),[r,n]=(0,s.useState)(!1),[i,l]=(0,s.useState)(""),[o,u]=(0,s.useState)(0),c=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"k"===e.key.toLowerCase()?(e.preventDefault(),n(e=>!e)):"Escape"===e.key&&n(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]),(0,s.useEffect)(()=>{r&&(l(""),u(0),requestAnimationFrame(()=>c.current?.focus()))},[r]);let d=(0,s.useMemo)(()=>{let t=t=>()=>{e.push(t),n(!1)},s=P.map(e=>({id:`nav:${e.route}`,label:`${a.common.goTo} ${a.page[e.id]??e.label}`,hint:e.route,icon:e.icon,run:t(e.route)}));return[{id:"new-task",label:a.tasks.newTask,hint:"create",icon:er.Plus,run:t("/tasks?new=1")},{id:"new-mission",label:a.missions.newMission,hint:"engage",icon:en.Rocket,run:t("/tasks?new=1")},...s]},[e,a]),h=(0,s.useMemo)(()=>{let e=i.trim().toLowerCase();return e?d.filter(t=>`${t.label} ${t.hint??""}`.toLowerCase().includes(e)):d},[d,i]);return((0,s.useEffect)(()=>{o>=h.length&&u(0)},[h.length,o]),r)?(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/70 p-4 pt-[12vh]",onClick:()=>n(!1),children:(0,t.jsxs)("div",{className:"animate-pop-in w-full max-w-lg overflow-hidden rounded-xl border border-border bg-surface",style:{boxShadow:"var(--shadow-raised)"},onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5 border-b border-border px-4",children:[(0,t.jsx)(ea.Search,{size:16,className:"shrink-0 text-text-muted","aria-hidden":!0}),(0,t.jsx)("input",{ref:c,value:i,onChange:e=>l(e.target.value),onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),u(e=>Math.min(h.length-1,e+1))):"ArrowUp"===e.key?(e.preventDefault(),u(e=>Math.max(0,e-1))):"Enter"===e.key&&(e.preventDefault(),h[o]?.run())},placeholder:a.common.searchCommands,className:"h-12 w-full bg-transparent text-sm text-text placeholder:text-text-muted focus:outline-none"})]}),(0,t.jsx)("ul",{className:"max-h-[50vh] overflow-y-auto p-1.5",children:0===h.length?(0,t.jsx)("li",{className:"px-3 py-6 text-center text-sm text-text-muted",children:a.common.noCommands}):h.map((e,s)=>{let a=e.icon;return(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",onMouseEnter:()=>u(s),onClick:()=>e.run(),className:`flex w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors ${s===o?"bg-elevated text-text":"text-text-muted"}`,children:[(0,t.jsx)(a,{size:15,className:"shrink-0","aria-hidden":!0}),(0,t.jsx)("span",{className:"flex-1 text-text",children:(0,t.jsx)(el,{text:e.label,q:i.trim()})}),e.hint?(0,t.jsx)("span",{className:"font-mono text-[11px] text-text-muted",children:e.hint}):null,s===o?(0,t.jsx)(ei,{size:13,className:"text-text-muted","aria-hidden":!0}):null]})},e.id)})})]})}):null}function eu({children:e}){let{t:a}=(0,j.useTranslation)(),[n,i]=(0,s.useState)(!1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex h-dvh overflow-hidden",children:[(0,t.jsx)(es,{mobileOpen:n,onMobileClose:()=>i(!1)}),(0,t.jsx)("div",{className:"flex min-w-0 flex-1 flex-col",children:(0,t.jsxs)("main",{className:"flex-1 overflow-y-auto overflow-x-hidden overscroll-contain",children:[(0,t.jsxs)("div",{className:"flex h-12 items-center gap-2 border-b border-border bg-surface px-3 md:hidden",children:[(0,t.jsx)("button",{type:"button",onClick:()=>i(!0),"aria-label":a.common.toggleSidebar,className:"flex h-9 w-9 items-center justify-center rounded-md text-text-muted transition-colors hover:bg-elevated hover:text-text",children:(0,t.jsx)(r,{size:20,"aria-hidden":!0})}),(0,t.jsx)("img",{src:"/orca-logo.png",alt:a.common.appName,className:"h-7 w-auto"})]}),(0,t.jsx)("div",{className:"p-4",children:e})]})})]}),(0,t.jsx)(eo,{})]})}e.s(["Shell",0,function({children:e}){return(0,t.jsx)(w,{children:(0,t.jsx)(j.LanguageProvider,{children:(0,t.jsx)(k.ToastProvider,{children:(0,t.jsx)(Q,{children:(0,t.jsx)(eu,{children:e})})})})})}],22833)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,22833,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(75254);let r=(0,a.default)("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);var n=e.i(19273),i=e.i(86491),l=e.i(40143),o=e.i(15823),u=class extends o.Subscribable{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,s){let a=t.queryKey,r=t.queryHash??(0,n.hashQueryKeyByOptions)(a,t),l=this.get(r);return l||(l=new i.Query({client:e,queryKey:a,queryHash:r,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(a)}),this.add(l)),l}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){l.notifyManager.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.matchQuery)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,n.matchQuery)(e,t)):t}notify(e){l.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){l.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){l.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},c=e.i(14272),d=o,h=class extends d.Subscribable{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#s=new Map,this.#a=0}#t;#s;#a;build(e,t,s){let a=new c.Mutation({client:e,mutationCache:this,mutationId:++this.#a,options:e.defaultMutationOptions(t),state:s});return this.add(a),a}add(e){this.#t.add(e);let t=m(e);if("string"==typeof t){let s=this.#s.get(t);s?s.push(e):this.#s.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){let t=m(e);if("string"==typeof t){let s=this.#s.get(t);if(s)if(s.length>1){let t=s.indexOf(e);-1!==t&&s.splice(t,1)}else s[0]===e&&this.#s.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=m(e);if("string"!=typeof t)return!0;{let s=this.#s.get(t),a=s?.find(e=>"pending"===e.state.status);return!a||a===e}}runNext(e){let t=m(e);if("string"!=typeof t)return Promise.resolve();{let s=this.#s.get(t)?.find(t=>t!==e&&t.state.isPaused);return s?.continue()??Promise.resolve()}}clear(){l.notifyManager.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#s.clear()})}getAll(){return Array.from(this.#t)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.matchMutation)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,n.matchMutation)(e,t))}notify(e){l.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return l.notifyManager.batch(()=>Promise.all(e.map(e=>e.continue().catch(n.noop))))}};function m(e){return e.options.scope?.id}var f=e.i(75555),x=e.i(14448),p=class{#r;#n;#i;#l;#o;#u;#c;#d;constructor(e={}){this.#r=e.queryCache||new u,this.#n=e.mutationCache||new h,this.#i=e.defaultOptions||{},this.#l=new Map,this.#o=new Map,this.#u=0}mount(){this.#u++,1===this.#u&&(this.#c=f.focusManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#r.onFocus())}),this.#d=x.onlineManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#r.onOnline())}))}unmount(){this.#u--,0===this.#u&&(this.#c?.(),this.#c=void 0,this.#d?.(),this.#d=void 0)}isFetching(e){return this.#r.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#r.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),s=this.#r.build(this,t),a=s.state.data;return void 0===a?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime((0,n.resolveStaleTime)(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return this.#r.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,s){let a=this.defaultQueryOptions({queryKey:e}),r=this.#r.get(a.queryHash),i=r?.state.data,l=(0,n.functionalUpdate)(t,i);if(void 0!==l)return this.#r.build(this,a).setData(l,{...s,manual:!0})}setQueriesData(e,t,s){return l.notifyManager.batch(()=>this.#r.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,s)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#r.get(t.queryHash)?.state}removeQueries(e){let t=this.#r;l.notifyManager.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let s=this.#r;return l.notifyManager.batch(()=>(s.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let s={revert:!0,...t};return Promise.all(l.notifyManager.batch(()=>this.#r.findAll(e).map(e=>e.cancel(s)))).then(n.noop).catch(n.noop)}invalidateQueries(e,t={}){return l.notifyManager.batch(()=>(this.#r.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let s={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(l.notifyManager.batch(()=>this.#r.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,s);return s.throwOnError||(t=t.catch(n.noop)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(n.noop)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let s=this.#r.build(this,t);return s.isStaleByTime((0,n.resolveStaleTime)(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(n.noop).catch(n.noop)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n.noop).catch(n.noop)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return x.onlineManager.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#r}getMutationCache(){return this.#n}getDefaultOptions(){return this.#i}setDefaultOptions(e){this.#i=e}setQueryDefaults(e,t){this.#l.set((0,n.hashKey)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#l.values()],s={};return t.forEach(t=>{(0,n.partialMatchKey)(e,t.queryKey)&&Object.assign(s,t.defaultOptions)}),s}setMutationDefaults(e,t){this.#o.set((0,n.hashKey)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#o.values()],s={};return t.forEach(t=>{(0,n.partialMatchKey)(e,t.mutationKey)&&Object.assign(s,t.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#i.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,n.hashQueryKeyByOptions)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===n.skipToken&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#i.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#r.clear(),this.#n.clear()}},g=e.i(12598),y=e.i(40273),b=e.i(51981);function v(){let e,t;return e=(0,g.useQueryClient)(),(t=(0,s.useRef)(void 0)).current=void 0,(0,s.useEffect)(()=>{let s=new EventSource(`${y.BASE}/events`,{withCredentials:!0});s.onerror=()=>{s.readyState===EventSource.CLOSED&&s.close()};let a=e=>t=>{try{JSON.parse(t.data)}catch{return}e()},r=a(()=>{e.invalidateQueries({queryKey:b.QUERY_KEYS.tasks}),e.invalidateQueries({queryKey:["mission"]}),e.invalidateQueries({queryKey:["activity"]})}),n=a(()=>{e.invalidateQueries({queryKey:b.QUERY_KEYS.missions}),e.invalidateQueries({queryKey:["mission"]}),e.invalidateQueries({queryKey:["activity"]})});return s.addEventListener("task",r),s.addEventListener("mission",n),s.addEventListener("signal",t=>{let s;try{s=JSON.parse(t.data)}catch{return}s.session&&s.signal&&e.setQueryData(b.QUERY_KEYS.sessionSignals,e=>({...e??{},[s.session]:s.signal})),e.invalidateQueries({queryKey:b.QUERY_KEYS.sessions}),e.invalidateQueries({queryKey:["activity"]})}),s.addEventListener("plan",t=>{let s;try{s=JSON.parse(t.data)}catch{return}s.jobId&&s.status&&(e.setQueryData(["plan-job",s.jobId],e=>({id:s.jobId,goal:e?.goal??"",epicId:s.epicId??e?.epicId??null,status:s.status,phases:s.phases??e?.phases??[],error:s.error,sessionName:s.sessionName??e?.sessionName})),"done"===s.status&&(e.invalidateQueries({queryKey:b.QUERY_KEYS.tasks}),e.invalidateQueries({queryKey:b.QUERY_KEYS.missions})))}),s.addEventListener("review",s=>{let a;try{a=JSON.parse(s.data)}catch{return}e.invalidateQueries({queryKey:b.QUERY_KEYS.tasks}),e.invalidateQueries({queryKey:["mission"]}),e.invalidateQueries({queryKey:b.QUERY_KEYS.missions}),e.invalidateQueries({queryKey:["activity"]}),a.taskId&&t.current?.({missionId:a.missionId,taskId:a.taskId,approve:!!a.approve,rationale:a.rationale??""})}),()=>s.close()},[e]),null}function w({children:e}){let[a]=(0,s.useState)(()=>new p({defaultOptions:{queries:{retry:(e,t)=>{let s=t instanceof y.OrcaApiError?t.status:void 0;return(null==s||!(s>=400)||!(s<500))&&e<2}}}}));return(0,t.jsx)(g.QueryClientProvider,{client:a,children:e})}e.i(69530);var j=e.i(2942),k=e.i(80809),N=e.i(18566),C=e.i(92852),S=e.i(4552),E=e.i(76525),q=e.i(1206);function O({onAuthed:e}){let[a,r]=(0,s.useState)(""),[n,i]=(0,s.useState)(""),l=(0,S.useLogin)(),{toast:o}=(0,k.useToast)(),{t:u}=(0,j.useTranslation)();return(0,t.jsx)("div",{className:"flex h-screen items-center justify-center bg-bg",children:(0,t.jsxs)("div",{className:"animate-pop-in flex w-full max-w-sm flex-col gap-4 rounded-xl border border-border bg-surface p-8",style:{boxShadow:"var(--shadow-raised)"},children:[(0,t.jsx)("img",{src:"/orca-logo.png",alt:"Orca",className:"mx-auto h-auto w-64"}),(0,t.jsx)("h1",{className:"text-center text-sm uppercase tracking-wide text-text-muted",children:u.auth.signIn}),(0,t.jsxs)("form",{onSubmit:function(t){t.preventDefault(),l.mutate({username:a,password:n},{onSuccess:()=>{e()},onError:e=>{o(String(e),"error")}})},className:"flex flex-col gap-3",children:[(0,t.jsx)(q.Input,{type:"text",placeholder:u.auth.usernamePlaceholder,value:a,onChange:e=>r(e.target.value),autoComplete:"username"}),(0,t.jsx)(q.Input,{type:"password",placeholder:u.auth.passwordPlaceholder,value:n,onChange:e=>i(e.target.value),autoComplete:"current-password"}),(0,t.jsx)(E.Button,{type:"submit",variant:"accent",disabled:l.isPending,className:"w-full justify-center",children:u.auth.signIn})]})]})})}function Q({children:e}){let[a,r]=(0,s.useState)("checking"),n=(0,N.useRouter)(),i=(0,N.usePathname)(),l=(0,g.useQueryClient)();return((0,s.useEffect)(()=>{let e=!0;return y.orcaClient.me().then(()=>{e&&r("open")}).catch(t=>{e&&(401!==(t instanceof y.OrcaApiError?t.status:void 0)?r("login"):y.orcaClient.setupStatus().then(t=>{e&&(t.needsSetup?(r("open"),"/onboarding"!==i&&n.replace("/onboarding")):r("login"))}).catch(()=>{e&&r("login")}))}),()=>{e=!1}},[i,n]),(0,s.useEffect)(()=>{let e=()=>{l.clear(),r("login")};return window.addEventListener(C.AUTH_CLEARED_EVENT,e),()=>window.removeEventListener(C.AUTH_CLEARED_EVENT,e)},[l]),"checking"===a)?null:"login"===a?(0,t.jsx)(O,{onAuthed:()=>r("open")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v,{}),e]})}var M=e.i(22016);let A=(0,a.default)("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);var D=e.i(84614),K=e.i(51737);let P=[{id:"dashboard",label:"Dash",route:"/dash",icon:e.i(60289).LayoutDashboard,group:"Operate"},{id:"tasks",label:"Tasks",route:"/tasks",icon:e.i(63804).ListChecks,group:"Operate"},{id:"kanban",label:"Kanban",route:"/kanban",icon:e.i(41382).KanbanSquare,group:"Operate"},{id:"timeline",label:"Timeline",route:"/timeline",icon:e.i(21218).Activity,group:"Operate"},{id:"escalations",label:"Escalations",route:"/escalations",icon:K.ShieldAlert,group:"Operate"},{id:"sessions",label:"Sessions",route:"/sessions",icon:e.i(20535).SquareTerminal,group:"Operate"},{id:"settings",label:"Settings",route:"/settings",icon:(0,a.default)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),group:"Config"},{id:"projects",label:"Projects",route:"/projects",icon:e.i(90272).FolderGit2,group:"Operate"},{id:"users",label:"Users",route:"/users",icon:e.i(61911).Users,group:"Config"}],T=["Operate","Config"],L="orca-sidebar",z=e=>Math.max(160,Math.min(360,e));function I(e){try{localStorage.setItem(L,JSON.stringify(e))}catch{}}function R({entry:e,active:s,collapsed:a}){let r=e.icon,n=e.badge&&e.badge>0?e.badge:0;return(0,t.jsxs)(M.default,{href:e.href,title:a?e.label:void 0,"aria-current":s?"page":void 0,className:`relative flex items-center gap-3 border-l-2 px-3 py-2 text-sm transition-colors ${s?"border-accent text-text":"border-transparent text-text-muted hover:text-text"}${a?" justify-center":""}`.trim(),children:[(0,t.jsxs)("span",{className:"relative shrink-0",children:[(0,t.jsx)(r,{size:16,strokeWidth:1.5,"aria-hidden":!0}),n>0&&a&&(0,t.jsx)("span",{className:"absolute -right-1.5 -top-1.5 flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-warning px-0.5 text-[9px] font-bold text-black",children:n})]}),!a&&(0,t.jsx)("span",{className:"uppercase tracking-wide text-xs",children:e.label}),n>0&&!a&&(0,t.jsx)("span",{className:"ml-auto flex h-4 min-w-4 items-center justify-center rounded-full bg-warning/15 px-1 text-[10px] font-bold text-warning",children:n})]})}function _({group:e,pathname:s,collapsed:a}){return(0,t.jsxs)("div",{className:"flex flex-col py-1",children:[!a&&(0,t.jsx)("span",{className:"px-3 py-1 font-mono text-tiny uppercase tracking-widest text-text-muted",children:e.label}),e.items.map(e=>(0,t.jsx)(R,{entry:e,active:s===e.href,collapsed:a},e.href))]})}var F=e.i(95468),U=e.i(73884);let $=(0,a.default)("Hourglass",[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]]);var H=e.i(24877),Y=e.i(91842);function B({name:e,onStuck:t}){let{state:a}=(0,Y.useSessionStall)(e,!0),r="stuck"===a;return(0,s.useEffect)(()=>{t(e,r)},[e,r,t]),null}function J({expanded:e}){let{t:a}=(0,j.useTranslation)(),r=(0,b.useTasks)(),n=(0,b.useSessions)(),i=(0,s.useMemo)(()=>n.data??[],[n.data]),l=i.length,o=(0,H.lastClosedTask)(r.data??[]),u=o?.outcome==="fail",[c,d]=(0,s.useState)({}),h=(0,s.useCallback)((e,t)=>{d(s=>s[e]===t?s:{...s,[e]:t})},[]);(0,s.useEffect)(()=>{let e=new Set(i);d(t=>{let s={},a=!1;for(let[r,n]of Object.entries(t))e.has(r)?s[r]=n:a=!0;return a?s:t})},[i]);let m=i.filter(e=>c[e]).length;if(0===l&&!o)return null;let f=(0,t.jsx)("span",{className:`h-2 w-2 shrink-0 rounded-full ${l>0?"live-dot":""}`,style:{backgroundColor:l>0?"var(--color-success)":"var(--color-border-strong)","--live-ring":"color-mix(in srgb, var(--color-success) 50%, transparent)"},"aria-hidden":!0}),x=i.map(e=>(0,t.jsx)(B,{name:e,onStuck:h},e));return e?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 border-t border-border px-2 py-2",children:[x,m>0&&(0,t.jsxs)(M.default,{href:"/sessions",className:"flex items-center gap-2 rounded-md px-2 py-1 text-xs font-medium text-danger transition-colors hover:bg-elevated",children:[(0,t.jsx)($,{size:13,className:"shrink-0","aria-hidden":!0}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a.sidebar.stuckAgents.replace("{count}",String(m))})]}),(0,t.jsxs)(M.default,{href:"/sessions",className:"flex items-center gap-2 rounded-md px-2 py-1 text-xs text-text-muted transition-colors hover:bg-elevated",children:[f,(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a.sidebar.liveAgents.replace("{count}",String(l))})]}),o&&(0,t.jsxs)(M.default,{href:`/tasks?select=${encodeURIComponent(o.id)}`,title:o.result_summary??o.title,className:"flex items-center gap-2 rounded-md px-2 py-1 text-xs text-text-muted transition-colors hover:bg-elevated",children:[u?(0,t.jsx)(U.XCircle,{size:13,className:"shrink-0 text-error","aria-hidden":!0}):(0,t.jsx)(F.CheckCircle2,{size:13,className:"shrink-0 text-success","aria-hidden":!0}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a.sidebar.lastOutcome.replace("{title}",o.title)})]})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 border-t border-border py-2.5",children:[x,m>0&&(0,t.jsxs)(M.default,{href:"/sessions",title:a.sidebar.stuckAgents.replace("{count}",String(m)),className:"relative flex h-7 w-7 items-center justify-center rounded-md text-danger transition-colors hover:bg-elevated",children:[(0,t.jsx)($,{size:15,"aria-hidden":!0}),(0,t.jsx)("span",{className:"absolute -right-0.5 -top-0.5 flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-danger px-0.5 text-[9px] font-bold text-white",children:m})]}),(0,t.jsxs)(M.default,{href:"/sessions",title:a.sidebar.liveAgents.replace("{count}",String(l)),className:"flex items-center gap-1 rounded-md px-1.5 py-1 transition-colors hover:bg-elevated",children:[f,(0,t.jsx)("span",{className:"font-mono text-[11px] text-text-muted",children:l})]})]})}var V=e.i(74080),W=e.i(45423),X=e.i(77154),G=e.i(45286);function Z(){let{t:e}=(0,j.useTranslation)(),a=(0,b.useSessions)(),r=(0,b.useSessionSignals)(),n=(0,b.useTasks)(),i=(0,H.needsInputSessions)(a.data??[],r),l=(0,b.useEscalations)(),o=i.length+l.length,u=(0,s.useRef)(null),[c,d]=(0,s.useState)(!1),[h,m]=(0,s.useState)(null),[f,x]=(0,s.useState)(!1);(0,s.useEffect)(()=>x(!0),[]);let p=()=>{let e=u.current;if(!e)return;let t=e.getBoundingClientRect();m({left:Math.max(8,t.left),bottom:window.innerHeight-t.top+8})};return(0,s.useEffect)(()=>{if(!c)return;let e=e=>{"Escape"===e.key&&d(!1)},t=()=>p();return window.addEventListener("keydown",e),window.addEventListener("resize",t),()=>{window.removeEventListener("keydown",e),window.removeEventListener("resize",t)}},[c]),(0,t.jsxs)("div",{className:"shrink-0",children:[(0,t.jsxs)("button",{ref:u,type:"button",onClick:()=>{c||p(),d(e=>!e)},"aria-label":e.sidebar.notifications,"aria-haspopup":"menu","aria-expanded":c,title:e.sidebar.notifications,className:`relative flex h-7 w-7 items-center justify-center rounded-md transition-colors hover:bg-elevated ${o>0?"text-warning":"text-text-muted hover:text-text"}`,children:[(0,t.jsx)(W.Bell,{size:15,"aria-hidden":!0}),o>0&&(0,t.jsx)("span",{className:"absolute -right-0.5 -top-0.5 flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-warning px-0.5 text-[9px] font-bold text-black",children:o})]}),f&&c&&h&&(0,V.createPortal)((0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-[60]",onClick:()=>d(!1),"aria-hidden":!0}),(0,t.jsxs)("div",{role:"menu","aria-label":e.sidebar.notifications,className:"fixed z-[61] w-80 max-w-[calc(100vw-1rem)] overflow-hidden rounded-lg border border-border bg-surface",style:{left:h.left,bottom:h.bottom,boxShadow:"var(--shadow-raised)"},children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2 text-xs font-semibold text-text",children:[(0,t.jsx)(W.Bell,{size:13,className:o>0?"text-warning":"text-text-muted","aria-hidden":!0}),e.sidebar.notifications,o>0&&(0,t.jsx)("span",{className:"ml-auto flex h-4 min-w-4 items-center justify-center rounded-full bg-warning/15 px-1 text-[10px] font-bold text-warning",children:o})]}),0===o?(0,t.jsx)("div",{className:"px-3 py-7 text-center text-xs text-text-muted",children:e.sidebar.noNotifications}):(0,t.jsxs)("div",{className:"flex max-h-[60vh] flex-col gap-1.5 overflow-auto p-2",children:[l.length>0&&(0,t.jsxs)(M.default,{href:"/escalations",onClick:()=>d(!1),className:"flex items-center gap-2 rounded-md border border-warning/40 bg-warning/[0.06] px-2.5 py-2 transition-colors hover:bg-warning/10",children:[(0,t.jsx)(K.ShieldAlert,{size:14,className:"shrink-0 text-warning","aria-hidden":!0}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block text-xs font-medium text-text",children:e.sidebar.escalations.replace("{count}",String(l.length))}),(0,t.jsx)("span",{className:"block truncate text-tiny text-text-muted",children:l[0].title})]})]}),i.map(e=>{let s=r[e];return(0,t.jsx)(G.NeedsInputRow,{name:e,question:s?.type==="needs_input"?s.question:"",options:s?.type==="needs_input"?s.options:void 0,exec:(0,X.taskExec)((n.data??[]).find(t=>(0,H.taskSessionName)(t)===e)?.labels)},e)})]})]})]}),document.body)]})}var ee=e.i(1544);let et={ready:{color:"var(--color-success)",ring:"color-mix(in srgb, var(--color-success) 50%, transparent)"},busy:{color:"var(--color-warning)",ring:"color-mix(in srgb, var(--color-warning) 50%, transparent)"},fail:{color:"var(--color-error)",ring:"color-mix(in srgb, var(--color-error) 50%, transparent)"}};function es({mobileOpen:e=!1,onMobileClose:a}){let r=(0,N.usePathname)(),{collapsed:n,width:i,toggle:l,setWidth:o}=function(){let[e,t]=(0,s.useState)({collapsed:!1,width:224});(0,s.useEffect)(()=>{t(function(){try{let e=localStorage.getItem(L);if(e){let t=JSON.parse(e);return{collapsed:!!t.collapsed,width:z(Number(t.width??224))}}}catch{}return{collapsed:!1,width:224}}())},[]);let a=(0,s.useCallback)(()=>t(e=>{let t={...e,collapsed:!e.collapsed};return I(t),t}),[]),r=(0,s.useCallback)(e=>t(t=>{let s={...t,width:z(e)};return I(s),s}),[]);return{collapsed:e.collapsed,width:e.width,toggle:a,setWidth:r}}(),{data:u}=(0,b.useHealth)(),c=(0,b.useTasks)(),d=(0,b.useMe)(),h=d.data?.user?.is_admin??!1,m=u?.ok===!0,f=(c.data??[]).some(e=>"in_progress"===e.status),x=m?f?"busy":"ready":"fail",p=(c.data??[]).find(e=>"open"===e.status&&"epic"!==e.type),g=(0,b.useEscalations)(),y=(0,s.useRef)(!1),{t:v,locale:w,setLocale:k}=(0,j.useTranslation)(),[C,S]=(0,s.useState)(!1);(0,s.useEffect)(()=>{let e=window.matchMedia("(max-width: 767px)");S(e.matches);let t=e=>S(e.matches);return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let E=!!C||!n;(0,s.useEffect)(()=>{C&&a?.()},[r]);let q=(0,s.useCallback)(e=>{y.current=!0,e.target.setPointerCapture?.(e.pointerId)},[]),O=(0,s.useCallback)(e=>{y.current&&o(e.clientX)},[o]),Q=(0,s.useCallback)(e=>{y.current=!1,e.target.releasePointerCapture?.(e.pointerId)},[]);return(0,t.jsxs)(t.Fragment,{children:[C&&(0,t.jsx)("div",{"aria-hidden":!0,onClick:a,className:`fixed inset-0 z-40 bg-black/50 transition-opacity md:hidden ${e?"opacity-100":"pointer-events-none opacity-0"}`}),(0,t.jsxs)("nav",{"aria-label":v.common.primaryNav,className:C?`fixed inset-y-0 left-0 z-50 flex h-full w-[264px] flex-col overflow-hidden border-r border-border bg-surface transition-transform duration-200 md:hidden ${e?"translate-x-0":"-translate-x-full"}`:"relative hidden h-full shrink-0 flex-col border-r border-border bg-surface transition-[width] duration-200 md:flex",style:C?{transitionTimingFunction:"var(--ease-out)"}:{width:E?i:56,transitionTimingFunction:"var(--ease-out)"},children:[(0,t.jsx)("div",{className:"flex items-center justify-center border-b border-border px-3 py-3 overflow-hidden",children:E?(0,t.jsx)("img",{src:"/orca-logo.png",alt:v.common.appName,className:"h-9 w-auto"}):(0,t.jsx)("img",{src:"/icon.png",alt:v.common.appName,className:"h-7 w-7 rounded-md"})}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto py-2",children:T.map(e=>({group:e,items:P.filter(t=>t.group===e)})).filter(e=>"Config"!==e.group||h).map(e=>{let s="Operate"===e.group?v.nav.operate:v.nav.config;return(0,t.jsx)(_,{group:{label:s,items:e.items.map(e=>({href:e.route,label:v.nav[e.id]??e.label,icon:e.icon,badge:"escalations"===e.id?g.length:void 0}))},pathname:r,collapsed:!E},e.group)})}),E&&g.length>0&&(0,t.jsxs)(M.default,{href:"/escalations",className:"border-t border-warning/30 bg-warning/[0.06] px-4 py-2.5 transition-colors hover:bg-warning/10",title:g[0].title,children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-tiny font-semibold uppercase tracking-wide text-warning",children:[(0,t.jsx)(K.ShieldAlert,{size:12,"aria-hidden":!0}),v.common.escalationsWaiting.replace("{count}",String(g.length))]}),(0,t.jsx)("div",{className:"mt-0.5 truncate text-xs text-text",children:g[0].title})]}),E&&p&&(0,t.jsxs)(M.default,{href:"/tasks",className:"border-t border-border px-4 py-2.5 transition-colors hover:bg-elevated",title:p.title,children:[(0,t.jsx)("div",{className:"text-tiny font-medium uppercase tracking-wide text-text-muted",children:v.common.nextReady}),(0,t.jsx)("div",{className:"mt-0.5 truncate text-xs text-text",children:p.title})]}),(0,t.jsx)(J,{expanded:E}),(0,t.jsxs)("div",{className:`border-t border-border px-3 py-2 ${E?"flex items-center gap-2":"flex flex-col items-center gap-2"}`,children:[(0,t.jsxs)(M.default,{href:"/account",className:`flex min-w-0 items-center gap-2 rounded-md py-1 transition-colors hover:bg-elevated ${E?"flex-1 px-1":""}`,title:d.data?.user?d.data.user.name||d.data.user.username:v.common.daemon,children:[(0,t.jsxs)("span",{className:"relative flex shrink-0 items-center justify-center",children:[d.data?.user?(0,t.jsx)(ee.Avatar,{user:d.data.user,size:28}):(0,t.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-full border border-border bg-elevated",children:(0,t.jsx)(D.User,{size:14,className:"text-text-muted","aria-hidden":!0})}),(0,t.jsx)("span",{role:"status","aria-label":m?v.common.daemonUp:v.common.daemonDown,title:"fail"===x?v.common.daemonOffline:"busy"===x?v.common.daemonBusy:v.common.daemonReady,className:`absolute -bottom-0.5 -right-0.5 h-2.5 w-2.5 rounded-full border-2 border-surface ${m?"live-dot":""}`,style:{backgroundColor:et[x].color,"--live-ring":et[x].ring}})]}),E&&d.data?.user&&(0,t.jsxs)("span",{className:"flex min-w-0 flex-col leading-tight",children:[(0,t.jsx)("span",{className:"truncate text-xs font-medium text-text",children:d.data.user.name||d.data.user.username}),(0,t.jsx)("span",{className:"truncate text-tiny text-text-muted",children:d.data.user.is_admin?v.users.admin:v.users.member})]})]}),(0,t.jsx)(Z,{}),E&&(0,t.jsxs)("button",{type:"button",onClick:()=>k("en"===w?"cs":"en"),className:"flex shrink-0 items-center gap-1 rounded-md border border-border px-2 py-1 text-tiny font-mono uppercase tracking-wide text-text-muted transition-colors hover:border-border-strong hover:text-text","aria-label":v.common.switchLang,children:[(0,t.jsx)(A,{size:12,"aria-hidden":!0}),"en"===w?"CS":"EN"]})]}),E&&(0,t.jsxs)("div",{className:"flex flex-col items-center gap-0.5 border-t border-border px-3 py-2 text-center",children:[(0,t.jsxs)("span",{className:"font-mono text-tiny text-text-muted",children:["orca v",u?.version??"—"]}),(0,t.jsx)("a",{href:"https://dragocz.dev",target:"_blank",rel:"noreferrer",className:"text-tiny font-semibold uppercase tracking-[0.15em] text-text-muted/70 transition-colors hover:text-text",children:"by dragocz.dev"})]}),!C&&(0,t.jsx)("button",{type:"button","aria-label":v.common.toggleSidebar,onClick:l,className:"group absolute -right-2 top-1/2 z-10 flex h-14 w-4 -translate-y-1/2 items-center justify-center",children:(0,t.jsx)("span",{className:"h-9 w-1 rounded-full bg-border transition-all duration-200 group-hover:h-12 group-hover:bg-text-muted"})}),!C&&E&&(0,t.jsx)("div",{"data-testid":"sidebar-resize",onPointerDown:q,onPointerMove:O,onPointerUp:Q,onDoubleClick:()=>o(224),className:"absolute right-0 top-0 h-full w-1 cursor-col-resize"})]})]})}var ea=e.i(55436),er=e.i(7233),en=e.i(9912);let ei=(0,a.default)("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);function el({text:e,q:s}){if(!s)return(0,t.jsx)(t.Fragment,{children:e});let a=e.toLowerCase().indexOf(s.toLowerCase());return a<0?(0,t.jsx)(t.Fragment,{children:e}):(0,t.jsxs)(t.Fragment,{children:[e.slice(0,a),(0,t.jsx)("span",{className:"text-accent",children:e.slice(a,a+s.length)}),e.slice(a+s.length)]})}function eo(){let e=(0,N.useRouter)(),{t:a}=(0,j.useTranslation)(),[r,n]=(0,s.useState)(!1),[i,l]=(0,s.useState)(""),[o,u]=(0,s.useState)(0),c=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"k"===e.key.toLowerCase()?(e.preventDefault(),n(e=>!e)):"Escape"===e.key&&n(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]),(0,s.useEffect)(()=>{r&&(l(""),u(0),requestAnimationFrame(()=>c.current?.focus()))},[r]);let d=(0,s.useMemo)(()=>{let t=t=>()=>{e.push(t),n(!1)},s=P.map(e=>({id:`nav:${e.route}`,label:`${a.common.goTo} ${a.page[e.id]??e.label}`,hint:e.route,icon:e.icon,run:t(e.route)}));return[{id:"new-task",label:a.tasks.newTask,hint:"create",icon:er.Plus,run:t("/tasks?new=1")},{id:"new-mission",label:a.missions.newMission,hint:"engage",icon:en.Rocket,run:t("/tasks?new=1")},...s]},[e,a]),h=(0,s.useMemo)(()=>{let e=i.trim().toLowerCase();return e?d.filter(t=>`${t.label} ${t.hint??""}`.toLowerCase().includes(e)):d},[d,i]);return((0,s.useEffect)(()=>{o>=h.length&&u(0)},[h.length,o]),r)?(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/70 p-4 pt-[12vh]",onClick:()=>n(!1),children:(0,t.jsxs)("div",{className:"animate-pop-in w-full max-w-lg overflow-hidden rounded-xl border border-border bg-surface",style:{boxShadow:"var(--shadow-raised)"},onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5 border-b border-border px-4",children:[(0,t.jsx)(ea.Search,{size:16,className:"shrink-0 text-text-muted","aria-hidden":!0}),(0,t.jsx)("input",{ref:c,value:i,onChange:e=>l(e.target.value),onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),u(e=>Math.min(h.length-1,e+1))):"ArrowUp"===e.key?(e.preventDefault(),u(e=>Math.max(0,e-1))):"Enter"===e.key&&(e.preventDefault(),h[o]?.run())},placeholder:a.common.searchCommands,className:"h-12 w-full bg-transparent text-sm text-text placeholder:text-text-muted focus:outline-none"})]}),(0,t.jsx)("ul",{className:"max-h-[50vh] overflow-y-auto p-1.5",children:0===h.length?(0,t.jsx)("li",{className:"px-3 py-6 text-center text-sm text-text-muted",children:a.common.noCommands}):h.map((e,s)=>{let a=e.icon;return(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",onMouseEnter:()=>u(s),onClick:()=>e.run(),className:`flex w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors ${s===o?"bg-elevated text-text":"text-text-muted"}`,children:[(0,t.jsx)(a,{size:15,className:"shrink-0","aria-hidden":!0}),(0,t.jsx)("span",{className:"flex-1 text-text",children:(0,t.jsx)(el,{text:e.label,q:i.trim()})}),e.hint?(0,t.jsx)("span",{className:"font-mono text-[11px] text-text-muted",children:e.hint}):null,s===o?(0,t.jsx)(ei,{size:13,className:"text-text-muted","aria-hidden":!0}):null]})},e.id)})})]})}):null}function eu({children:e}){let{t:a}=(0,j.useTranslation)(),[n,i]=(0,s.useState)(!1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex h-dvh overflow-hidden",children:[(0,t.jsx)(es,{mobileOpen:n,onMobileClose:()=>i(!1)}),(0,t.jsx)("div",{className:"flex min-w-0 flex-1 flex-col",children:(0,t.jsxs)("main",{className:"flex-1 overflow-y-auto overflow-x-hidden overscroll-contain",children:[(0,t.jsxs)("div",{className:"flex h-12 items-center gap-2 border-b border-border bg-surface px-3 md:hidden",children:[(0,t.jsx)("button",{type:"button",onClick:()=>i(!0),"aria-label":a.common.toggleSidebar,className:"flex h-9 w-9 items-center justify-center rounded-md text-text-muted transition-colors hover:bg-elevated hover:text-text",children:(0,t.jsx)(r,{size:20,"aria-hidden":!0})}),(0,t.jsx)("img",{src:"/orca-logo.png",alt:a.common.appName,className:"h-7 w-auto"})]}),(0,t.jsx)("div",{className:"p-4",children:e})]})})]}),(0,t.jsx)(eo,{})]})}e.s(["Shell",0,function({children:e}){return(0,t.jsx)(w,{children:(0,t.jsx)(j.LanguageProvider,{children:(0,t.jsx)(k.ToastProvider,{children:(0,t.jsx)(Q,{children:(0,t.jsx)(eu,{children:e})})})})})}],22833)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,98183,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o={assign:function(){return l},searchParamsToUrlQuery:function(){return a},urlQueryToSearchParams:function(){return s}};for(var i in o)Object.defineProperty(r,i,{enumerable:!0,get:o[i]});function a(e){let t={};for(let[r,o]of e.entries()){let e=t[r];void 0===e?t[r]=o:Array.isArray(e)?e.push(o):t[r]=[e,o]}return t}function n(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function s(e){let t=new URLSearchParams;for(let[r,o]of Object.entries(e))if(Array.isArray(o))for(let e of o)t.append(r,n(e));else t.set(r,n(o));return t}function l(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,o]of r.entries())e.append(t,o)}return e}},18967,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o={DecodeError:function(){return y},MiddlewareNotFoundError:function(){return k},MissingStaticPage:function(){return v},NormalizeError:function(){return b},PageNotFoundError:function(){return g},SP:function(){return m},ST:function(){return f},WEB_VITALS:function(){return a},execOnce:function(){return n},getDisplayName:function(){return d},getLocationOrigin:function(){return c},getURL:function(){return u},isAbsoluteUrl:function(){return l},isResSent:function(){return h},loadGetInitialProps:function(){return x},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return w}};for(var i in o)Object.defineProperty(r,i,{enumerable:!0,get:o[i]});let a=["CLS","FCP","FID","INP","LCP","TTFB"];function n(e){let t,r=!1;return(...o)=>(r||(r=!0,t=e(...o)),t)}let s=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>s.test(e);function c(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function u(){let{href:e}=window.location,t=c();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function h(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function x(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await x(t.Component,t.ctx)}:{};let o=await e.getInitialProps(t);if(r&&h(r))return o;if(!o)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${o}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return o}let m="u">typeof performance,f=m&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class y extends Error{}class b extends Error{}class g extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class v extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class k extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function w(e){return JSON.stringify({message:e.message,stack:e.stack})}},33525,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return o}});let o=e=>{}},9912,e=>{"use strict";let t=(0,e.i(75254).default)("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);e.s(["Rocket",0,t],9912)},7233,e=>{"use strict";let t=(0,e.i(75254).default)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",0,t],7233)},82458,e=>{"use strict";let t=(0,e.i(75254).default)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["default",0,t])},24877,56474,e=>{"use strict";let t={30:"#3a3a3a",31:"#ef4444",32:"#22c55e",33:"#eab308",34:"#3b82f6",35:"#a855f7",36:"#06b6d4",37:"#d4d4d4",90:"#6b7280",91:"#f87171",92:"#4ade80",93:"#facc15",94:"#60a5fa",95:"#c084fc",96:"#22d3ee",97:"#f5f5f5"};function r(e){let r,o,i=[],a="",n=()=>{a&&(i.push({text:a.replace(/\x1b\[[0-9;?]*[ -/]*[@-ln-~]/g,"").replace(/\x1b[()][0-9A-Za-z]/g,"").replace(/\x1b[=>]/g,"").replace(/\x1b/g,""),color:r}),a="")},s=/\x1b\[([0-9;]*)m/g,l=0;for(;null!==(o=s.exec(e));){a+=e.slice(l,o.index),n(),l=s.lastIndex;let i=(o[1]||"0").split(";").map(e=>Number(e||0));for(let e=0;e<i.length;e++){let o=i[e];0===o||39===o?r=void 0:t[o]?r=t[o]:38===o&&(5===i[e+1]?(r=function(e){if(e<16)return t[e<8?30+e:90+(e-8)]??"#d4d4d4";if(e>=232){let t=8+(e-232)*10;return`rgb(${t},${t},${t})`}let r=e-16,o=Math.floor(r/36),i=Math.floor(r%36/6),a=e=>0===e?0:55+40*e;return`rgb(${a(o)},${a(i)},${a(r%6)})`}(i[e+2]??7),e+=2):2===i[e+1]&&(r=`rgb(${i[e+2]??0},${i[e+3]??0},${i[e+4]??0})`,e+=4))}}return a+=e.slice(l),n(),i.filter(e=>e.text.length>0)}e.s(["parseAnsi",0,r],56474);let o="agent:";function i(e){let t=e.labels?.find(e=>e.startsWith(o));return t?t.slice(o.length):null}function a(e){if(!e)return null;let t=new Date(e.includes("T")?e:e.replace(" ","T")+(e.endsWith("Z")?"":"Z")).getTime();return Number.isNaN(t)?null:t}function n(e){let t=e.labels?.find(e=>e.startsWith("started:"));if(t){let e=Number(t.slice(8));if(Number.isFinite(e))return e}return a(e.created_at)}e.s(["agentDisplayName",0,function(e){return e.replace(/^orca-/,"")||e},"keysForOption",0,function(e){return[...Array(Math.max(0,Number(e)-1)).fill("Down"),"Enter"]},"lastClosedTask",0,function(e){let t=e.filter(e=>"closed"===e.status);return 0===t.length?null:t.reduce((e,t)=>(a(t.closed_at)??0)>(a(e.closed_at)??0)?t:e)},"liveState",0,function(e,t){return e?.type==="needs_input"?"needs_input":t||e?.type==="working"?"working":e?.type==="complete"?"complete":"idle"},"missionEpicId",0,function(e){return e.replace(/^m-/,"")},"needsInputSessions",0,function(e,t){return e.filter(e=>t[e]?.type==="needs_input")},"parseTs",0,a,"tailSnippet",0,function(e){let t=e.split("\n");for(let e=t.length-1;e>=0;e--){let o=r(t[e]).map(e=>e.text).join("").trim();if(o)return o}return""},"taskAgentName",0,i,"taskBlockers",0,function(e,t,r){return t.filter(t=>t.task_id===e).map(e=>r.get(e.depends_on_id)).filter(e=>!!e&&"closed"!==e.status&&"cancelled"!==e.status)},"taskElapsed",0,function(e,t){let r=n(e);if(null==r)return null;let o=Math.max(0,Math.floor((("closed"===e.status||"cancelled"===e.status?a(e.closed_at)??t:t)-r)/1e3));if(o<60)return`${o}s`;let i=Math.floor(o/60);if(i<60)return`${i}m`;let s=Math.floor(i/60);return s<24?`${s}h`:`${Math.floor(s/24)}d`},"taskForSession",0,function(e,t){if(!t.startsWith("orca-"))return;let r=`${o}${t.slice(5)}`,i=e.filter(e=>(e.labels??[]).includes(r));return i.length<=1?i[0]:i.find(e=>"in_progress"===e.status)??[...i].sort((e,t)=>(a(t.created_at)??0)-(a(e.created_at)??0))[0]},"taskSessionName",0,function(e){let t=i(e);return t?`orca-${t}`:null},"taskStartedMs",0,n],24877)},63804,e=>{"use strict";let t=(0,e.i(75254).default)("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);e.s(["ListChecks",0,t],63804)},73884,e=>{"use strict";let t=(0,e.i(75254).default)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",0,t],73884)},93283,e=>{"use strict";var t=e.i(66027),r=e.i(40273);e.s(["useSessionPane",0,function(e,o=8,i=!0){let a=(0,t.useQuery)({queryKey:["session-pane",e,"ansi"],queryFn:()=>r.orcaClient.sessionPane(e,!0),enabled:i&&!!e,refetchInterval:2e3,refetchOnWindowFocus:!1});return{tail:(a.data?.pane??"").split("\n").slice(-o).join("\n"),isLoading:a.isLoading,isError:a.isError}}])},77154,e=>{"use strict";let t="exec:";e.s(["taskExec",0,function(e){let r=e?.find(e=>e.startsWith(t));return r?r.slice(t.length):""}])},91842,e=>{"use strict";var t=e.i(71645),r=e.i(93283);let o={stalledSec:300,stuckSec:900};e.s(["useSessionStall",0,function(e,i,a=o){let{tail:n}=(0,r.useSessionPane)(e,8,i),[s,l]=(0,t.useState)(()=>Date.now()),c=(0,t.useRef)(Date.now());if((0,t.useEffect)(()=>{c.current=Date.now()},[n]),(0,t.useEffect)(()=>{if(!i)return;let e=setInterval(()=>l(Date.now()),1e3);return()=>clearInterval(e)},[i]),!i)return{state:"fresh",silenceSec:0};let u=Math.floor((s-c.current)/1e3);return{state:function(e,t,r=o){if(!t)return"fresh";let i=Math.max(0,e);return i>=r.stuckSec?"stuck":i>=r.stalledSec?"stalled":"fresh"}(u,!0,a),silenceSec:u}}])},95057,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o={formatUrl:function(){return s},formatWithValidation:function(){return c},urlObjectKeys:function(){return l}};for(var i in o)Object.defineProperty(r,i,{enumerable:!0,get:o[i]});let a=e.r(90809)._(e.r(98183)),n=/https?|ftp|gopher|file/;function s(e){let{auth:t,hostname:r}=e,o=e.protocol||"",i=e.pathname||"",s=e.hash||"",l=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:r&&(c=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(c+=":"+e.port)),l&&"object"==typeof l&&(l=String(a.urlQueryToSearchParams(l)));let u=e.search||l&&`?${l}`||"";return o&&!o.endsWith(":")&&(o+=":"),e.slashes||(!o||n.test(o))&&!1!==c?(c="//"+(c||""),i&&"/"!==i[0]&&(i="/"+i)):c||(c=""),s&&"#"!==s[0]&&(s="#"+s),u&&"?"!==u[0]&&(u="?"+u),i=i.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${o}${c}${i}${u}${s}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return s(e)}},18581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return i}});let o=e.r(71645);function i(e,t){let r=(0,o.useRef)(null),i=(0,o.useRef)(null);return(0,o.useCallback)(o=>{if(null===o){let e=r.current;e&&(r.current=null,e());let t=i.current;t&&(i.current=null,t())}else e&&(r.current=a(e,o)),t&&(i.current=a(t,o))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},73668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let o=e.r(18967),i=e.r(52817);function a(e){if(!(0,o.isAbsoluteUrl)(e))return!0;try{let t=(0,o.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,i.hasBasePath)(r.pathname)}catch(e){return!1}}},84508,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return o}});let o=e=>{}},22016,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o={default:function(){return y},useLinkStatus:function(){return g}};for(var i in o)Object.defineProperty(r,i,{enumerable:!0,get:o[i]});let a=e.r(90809),n=e.r(43476),s=a._(e.r(71645)),l=e.r(95057),c=e.r(8372),u=e.r(18581),d=e.r(18967),h=e.r(5550);e.r(33525);let p=e.r(88540),x=e.r(91949),m=e.r(73668),f=e.r(9396);function y(t){var r,o;let i,a,y,[g,v]=(0,s.useOptimistic)(x.IDLE_LINK_STATUS),k=(0,s.useRef)(null),{href:w,as:C,children:S,prefetch:j=null,passHref:E,replace:M,shallow:P,scroll:Q,onClick:q,onMouseEnter:K,onTouchStart:R,legacyBehavior:_=!1,onNavigate:N,transitionTypes:F,ref:O,unstable_dynamicOnHover:T,...z}=t;i=S,_&&("string"==typeof i||"number"==typeof i)&&(i=(0,n.jsx)("a",{children:i}));let U=s.default.useContext(c.AppRouterContext),A=!1!==j,$=!1!==j?null===(o=j)||"auto"===o?f.FetchStrategy.PPR:f.FetchStrategy.Full:f.FetchStrategy.PPR,I="string"==typeof(r=C||w)?r:(0,l.formatUrl)(r);if(_){if(i?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=s.default.Children.only(i)}let Y=_?a&&"object"==typeof a&&a.ref:O,L=s.default.useCallback(e=>(null!==U&&(k.current=(0,x.mountLinkInstance)(e,I,U,$,A,v)),()=>{k.current&&((0,x.unmountLinkForCurrentNavigation)(k.current),k.current=null),(0,x.unmountPrefetchableInstance)(e)}),[A,I,U,$,v]),D={ref:(0,u.useMergedRef)(L,Y),onClick(t){_||"function"!=typeof q||q(t),_&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!U||t.defaultPrevented||function(t,r,o,i,a,n,l){if("u">typeof window){let c,{nodeName:u}=t.currentTarget;if("A"===u.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(r)){i&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),n){let e=!1;if(n({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(99781);s.default.startTransition(()=>{d(r,i?"replace":"push",!1===a?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,o.current,l)})}}(t,I,k,M,Q,N,F)},onMouseEnter(e){_||"function"!=typeof K||K(e),_&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),U&&A&&(0,x.onNavigationIntent)(e.currentTarget,!0===T)},onTouchStart:function(e){_||"function"!=typeof R||R(e),_&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),U&&A&&(0,x.onNavigationIntent)(e.currentTarget,!0===T)}};return(0,d.isAbsoluteUrl)(I)?D.href=I:_&&!E&&("a"!==a.type||"href"in a.props)||(D.href=(0,h.addBasePath)(I)),y=_?s.default.cloneElement(a,D):(0,n.jsx)("a",{...z,...D,children:i}),(0,n.jsx)(b.Provider,{value:g,children:y})}e.r(84508);let b=(0,s.createContext)(x.IDLE_LINK_STATUS),g=()=>(0,s.useContext)(b);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},61911,e=>{"use strict";let t=(0,e.i(75254).default)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);e.s(["Users",0,t],61911)},41382,e=>{"use strict";let t=(0,e.i(75254).default)("SquareKanban",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 7v7",key:"1x2jlm"}],["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M16 7v9",key:"1hp2iy"}]]);e.s(["KanbanSquare",0,t],41382)},21218,e=>{"use strict";let t=(0,e.i(75254).default)("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);e.s(["Activity",0,t],21218)},51737,e=>{"use strict";let t=(0,e.i(75254).default)("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);e.s(["ShieldAlert",0,t],51737)},20535,e=>{"use strict";var t=e.i(84981);e.s(["SquareTerminal",()=>t.default])},45423,e=>{"use strict";let t=(0,e.i(75254).default)("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);e.s(["Bell",0,t],45423)},1544,e=>{"use strict";var t=e.i(43476),r=e.i(71645),o=e.i(40273);let i=["#ef4444","#f59e0b","#10b981","#3b82f6","#8b5cf6","#ec4899","#14b8a6","#f97316"];e.s(["Avatar",0,function({user:e,size:a=36}){let n=e.name?.trim()||e.username,[s,l]=(0,r.useState)(null);return((0,r.useEffect)(()=>{if(!e.avatar)return void l(null);let t=!0;return o.orcaClient.avatarUrl(e.id).then(e=>{t&&l(e)}).catch(()=>{t&&l(null)}),()=>{t=!1}},[e.id,e.avatar]),e.avatar&&s)?(0,t.jsx)("img",{src:s,alt:n,className:"shrink-0 rounded-full border border-border object-cover",style:{width:a,height:a}}):(0,t.jsx)("span",{className:"inline-flex shrink-0 items-center justify-center rounded-full font-mono font-semibold text-white",style:{width:a,height:a,fontSize:.38*a,background:i[[...n].reduce((e,t)=>e+t.charCodeAt(0),0)%i.length]},"aria-label":n,children:n.trim().slice(0,2).toUpperCase()||"?"})}])},84614,e=>{"use strict";let t=(0,e.i(75254).default)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",0,t],84614)},60289,89128,45286,e=>{"use strict";let t=(0,e.i(75254).default)("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);e.s(["LayoutDashboard",0,t],60289);var r=e.i(43476),o=e.i(82458);e.s(["TriangleAlert",()=>o.default],89128);var o=o,i=e.i(4552),a=e.i(24877),n=e.i(89901),s=e.i(80809);e.i(69530);var l=e.i(2942);e.s(["NeedsInputRow",0,function({name:e,question:t,options:c,exec:u}){let{t:d}=(0,l.useTranslation)(),h=(0,i.useSendInput)(),{toast:p}=(0,s.useToast)(),x=!!c&&c.length>0,m=(t,r)=>h.mutate({name:e,keys:t},{onSuccess:()=>p(r),onError:e=>p(String(e),"error")});return(0,r.jsxs)("div",{className:`flex gap-2.5 rounded-md border border-border bg-bg px-3 py-2 ${x?"flex-col items-stretch":"items-center"}`,children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-2.5",children:[(0,r.jsx)("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-border bg-elevated",children:u?(0,r.jsx)(n.ModelIcon,{name:u,size:13}):(0,r.jsx)(o.default,{size:12,className:"text-warning","aria-hidden":!0})}),(0,r.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-text",children:e}),(0,r.jsx)("span",{className:`min-w-0 flex-1 text-xs text-text-muted ${x?"":"truncate"}`,title:t,children:t}),!x&&(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[(0,r.jsx)("button",{type:"button",onClick:()=>m(["Enter"],d.sessions.approved.replace("{name}",e)),className:"rounded-md border border-approve/50 bg-approve/10 px-2.5 py-1 text-xs font-medium text-approve transition-colors hover:bg-approve hover:text-white active:scale-95",children:d.sessions.allow}),(0,r.jsx)("button",{type:"button",onClick:()=>m(["Escape"],d.sessions.rejected.replace("{name}",e)),className:"rounded-md border border-danger/50 bg-danger/10 px-2.5 py-1 text-xs font-medium text-danger transition-colors hover:bg-danger hover:text-white active:scale-95",children:d.sessions.reject})]})]}),x&&(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 pl-[34px]",children:[c.map(t=>(0,r.jsxs)("button",{type:"button",title:t.label,onClick:()=>m((0,a.keysForOption)(t.id),d.sessions.answered.replace("{name}",e).replace("{option}",t.label)),className:"max-w-full truncate rounded-md border border-accent/50 bg-accent/10 px-2.5 py-1 text-xs font-medium text-accent transition-colors hover:bg-accent hover:text-white active:scale-95",children:[(0,r.jsxs)("span",{className:"opacity-60",children:[t.id,"."]})," ",t.label]},t.id)),(0,r.jsx)("button",{type:"button",onClick:()=>m(["Escape"],d.sessions.rejected.replace("{name}",e)),className:"rounded-md border border-danger/50 bg-danger/10 px-2.5 py-1 text-xs font-medium text-danger transition-colors hover:bg-danger hover:text-white active:scale-95",children:d.sessions.reject})]})]})}],45286)},89901,66992,e=>{"use strict";var t=e.i(43476);let r=(0,e.i(75254).default)("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);e.s(["Cpu",0,r],66992);let o=new Set(["ace-text","ace","adobe-color","adobe-text","adobe","adobefirefly-color","adobefirefly-text","adobefirefly","agentvoice-color","agentvoice-text","agentvoice","agui-text","agui","ai2-color","ai2-text","ai2","ai21-brand-color","ai21-brand","ai21-text","ai21","ai302-color","ai302-text","ai302","ai360-color","ai360-text","ai360","aihubmix-color","aihubmix-text","aihubmix","aimass-color","aimass-text","aimass","aionlabs-color","aionlabs-text","aionlabs","airjelly-color","airjelly-text","airjelly","aistudio-text","aistudio","akashchat-color","akashchat-text","akashchat","alephalpha-text","alephalpha","alibaba-brand-color","alibaba-brand","alibaba-color","alibaba-text-cn","alibaba-text","alibaba","alibabacloud-color","alibabacloud-text-cn","alibabacloud-text","alibabacloud","amp-color","amp-text","amp","antgroup-brand-color","antgroup-brand","antgroup-color","antgroup-text-cn","antgroup-text","antgroup","anthropic-text","anthropic","antigravity-color","antigravity-text","antigravity","anyscale-color","anyscale-text","anyscale","apertis-color","apertis-text","apertis","apple-text","apple","arcee-color","arcee-text","arcee","askverdict-color","askverdict-text","askverdict","assemblyai-color","assemblyai-text","assemblyai","atlascloud-text","atlascloud","automatic-color","automatic-text","automatic","aws-brand-color","aws-brand","aws-color","aws-text","aws","aya-color","aya-text","aya","azure-color","azure-text","azure","azureai-color","azureai-text","azureai","baai-text","baai","baichuan-color","baichuan-text","baichuan","baidu-brand-color","baidu-brand","baidu-color","baidu-text-cn","baidu-text","baidu","baiducloud-color","baiducloud-text","baiducloud","bailian-color","bailian-text","bailian","baseten-text","baseten","bedrock-color","bedrock-text","bedrock","bfl-text","bfl","bilibili-color","bilibili-text","bilibili","bilibiliindex-text","bilibiliindex","bing-color","bing-text","bing","briaai-color","briaai-text","briaai","burncloud-color","burncloud-text","burncloud","bytedance-brand-color","bytedance-brand","bytedance-color","bytedance-text-cn","bytedance-text","bytedance","capcut-text","capcut","centml-brand-color","centml-brand","centml-color","centml-text","centml","cerebras-brand-color","cerebras-brand","cerebras-color","cerebras-text","cerebras","chatglm-color","chatglm-text","chatglm","cherrystudio-color","cherrystudio-text","cherrystudio","civitai-color","civitai-text-color","civitai-text","civitai","claude-color","claude-text","claude","claudecode-color","claudecode-text","claudecode","cline-text","cline","clipdrop-text","clipdrop","cloudflare-color","cloudflare-text","cloudflare","codebuddy-color","codebuddy-text","codebuddy","codeflicker-color","codeflicker-text","codeflicker","codegeex-color","codegeex-text","codegeex","codex-color","codex-text","codex","cogvideo-color","cogvideo-text","cogvideo","cogview-color","cogview-text","cogview","cohere-color","cohere-text","cohere","colab-color","colab-text","colab","cometapi-color","cometapi-text","cometapi","comfyui-color","comfyui-text","comfyui","commanda-color","commanda-text","commanda","copilot-color","copilot-text","copilot","copilotkit-color","copilotkit-text","copilotkit","coqui-color","coqui-text","coqui","coze-text","coze","crewai-brand-color","crewai-brand","crewai-color","crewai-text","crewai","crusoe-color","crusoe-text","crusoe","cursor-text","cursor","cybercut-text","cybercut","dalle-color","dalle-text","dalle","dbrx-brand-color","dbrx-brand","dbrx-color","dbrx-text","dbrx","deepai-text","deepai","deepcogito-color","deepcogito-text","deepcogito","deepinfra-color","deepinfra-text","deepinfra","deepl-color","deepl-text","deepl","deepmind-color","deepmind-text","deepmind","deepseek-color","deepseek-text","deepseek","devin-color","devin-text","devin","dify-color","dify-text","dify","doc2x-color","doc2x-text","doc2x","docsearch-color","docsearch-text","docsearch","dolphin-text","dolphin","doubao-color","doubao-text","doubao","dreammachine-text","dreammachine","elevenlabs-text","elevenlabs","elevenx-text","elevenx","essentialai-color","essentialai-text","essentialai","exa-color","exa-text","exa","fal-color","fal-text","fal","fastgpt-color","fastgpt-text","fastgpt","featherless-color","featherless-text","featherless","figma-color","figma-text","figma","fireworks-color","fireworks-text","fireworks","fishaudio-text","fishaudio","flora-text","flora","flowith-text","flowith","flux-text","flux","friendli-text","friendli","gemini-color","gemini-text","gemini","geminicli-color","geminicli-text","geminicli","gemma-color","gemma-text","gemma","giteeai-text","giteeai","github-text","github","githubcopilot-text","githubcopilot","glama-text","glama","glif-text","glif","glmv-color","glmv-text","glmv","google-brand-color","google-brand","google-color","google","googlecloud-brand-color","googlecloud-brand","googlecloud-color","googlecloud","goose-text","goose","gradio-color","gradio-text","gradio","greptile-color","greptile-text","greptile","grok-text","grok","groq-text","groq","hailuo-color","hailuo-text","hailuo","haiper-text","haiper","hedra-text","hedra","hermesagent-text","hermesagent","higress-color","higress-text","higress","huawei-color","huawei-text-cn","huawei-text","huawei","huaweicloud-color","huaweicloud-text-cn","huaweicloud-text","huaweicloud","huggingface-color","huggingface-text","huggingface","hunyuan-color","hunyuan-text","hunyuan","hyperbolic-color","hyperbolic-text","hyperbolic","ibm-text","ibm","ideogram-text","ideogram","iflytekcloud-color","iflytekcloud-text","iflytekcloud","inception-text","inception","inference-text","inference","infermatic-color","infermatic-text","infermatic","infinigence-color","infinigence-text-cn","infinigence-text","infinigence","inflection-text","inflection","internlm-color","internlm-text","internlm","jimeng-color","jimeng-text","jimeng","jina-text","jina","junie-color","junie-text","junie","kilocode-text","kilocode","kimi-color","kimi-text","kimi","kiro-color","kiro-text","kiro","kling-color","kling-text","kling","kluster-color","kluster-text","kluster","kolors-color","kolors-text","kolors","krea-text","krea","kwaikat-text-color","kwaikat-text","kwaikat","kwaipilot-color","kwaipilot-text","kwaipilot","lambda-text","lambda","langchain-color","langchain-text","langchain","langfuse-color","langfuse-text","langfuse","langgraph-color","langgraph-text","langgraph","langsmith-color","langsmith-text","langsmith","leptonai-color","leptonai-text","leptonai","lg-color","lg-text","lg","lightricks-text","lightricks","liquid-text","liquid","livekit-color","livekit-text","livekit","llamaindex-color","llamaindex-text","llamaindex","llava-color","llava-text","llava","llmapi-color","llmapi-text","llmapi","lmstudio-text","lmstudio","lobehub-color","lobehub-text","lobehub","longcat-color","longcat-text","longcat","lovable-color","lovable-text","lovable","lovart-text","lovart","luma-color","luma-text","luma","magic-text","magic","make-color","make-text","make","manus-text","manus","mastra-text","mastra","mcp-text","mcp","mcpso-color","mcpso-text","mcpso","menlo-color","menlo-text","menlo","meshy-color","meshy-text","meshy","meta-brand-color","meta-brand","meta-color","meta-text","meta","metaai-color","metaai-text","metaai","metagpt-text","metagpt","microsoft-color","microsoft-text","microsoft","midjourney-text","midjourney","minimax-color","minimax-text","minimax","mistral-color","mistral-text","mistral","modelscope-color","modelscope-text","modelscope","monica-color","monica-text","monica","moonshot-text","moonshot","morph-color","morph-text","morph","moxt-color","moxt-text","moxt","myshell-color","myshell-text","myshell","n8n-color","n8n-text","n8n","nanobanana-color","nanobanana-text","nanobanana","nebius-text","nebius","newapi-color","newapi-text","newapi","notebooklm-text","notebooklm","notion-text","notion","nousresearch-text","nousresearch","nova-color","nova-text","nova","novelai-text","novelai","novita-color","novita-text","novita","nplcloud-color","nplcloud-text","nplcloud","nvidia-color","nvidia-text","nvidia","obsidian-color","obsidian-text","obsidian","ollama-text","ollama","openai-text","openai","openchat-color","openchat-text","openchat","openclaw-color","openclaw-text","openclaw","opencode-text","opencode","openhands-color","openhands-text","openhands","openhuman-text","openhuman","openrouter-text","openrouter","openwebui-text","openwebui","palm-color","palm-text","palm","parasail-text","parasail","perplexity-color","perplexity-text","perplexity","phidata-color","phidata-text","phidata","phind-text","phind","pika-text","pika","pixverse-color","pixverse-text","pixverse","player2-color","player2-text","player2","poe-color","poe-text","poe","pollinations-text","pollinations","ppio-color","ppio-text-cn","ppio-text","ppio","prunaai-color","prunaai-text","prunaai","pydanticai-color","pydanticai-text","pydanticai","qingyan-color","qingyan-text","qingyan","qiniu-color","qiniu-text","qiniu","qoder-color","qoder-text","qoder","qwen-color","qwen-text","qwen","railway-text","railway","recraft-text","recraft","relace-text","relace","replicate-brand","replicate-text","replicate","replit-color","replit-text","replit","reve-text","reve","roocode-text","roocode","rsshub-color","rsshub-text","rsshub","runway-text","runway","rwkv-color","rwkv-text","rwkv","sambanova-color","sambanova-text","sambanova","search1api-color","search1api-text","search1api","searchapi-text","searchapi","sensenova-brand-color","sensenova-brand","sensenova-color","sensenova-text","sensenova","siliconcloud-color","siliconcloud-text","siliconcloud","sillytavern-color","sillytavern-text","sillytavern","skywork-color","skywork-text","skywork","slock-text","slock","smithery-color","smithery-text","smithery","snowflake-color","snowflake-text","snowflake","sophnet-color","sophnet-text","sophnet","sora-color","sora-text","sora","spark-color","spark-text","spark","speedai-color","speedai-text","speedai","stability-brand-color","stability-brand","stability-color","stability-text","stability","statecloud-color","statecloud-text","statecloud","stepfun-color","stepfun-text","stepfun","straico-color","straico-text","straico","streamlake-color","streamlake-text","streamlake","submodel-color","submodel-text","submodel","suno-text","suno","sync-text","sync","targon-color","targon-text","targon","tavily-color","tavily-text","tavily","tencent-brand-color","tencent-brand","tencent-color","tencent-text-cn","tencent-text","tencent","tencentcloud-color","tencentcloud-text","tencentcloud","tiangong-color","tiangong-text","tiangong","tii-color","tii-text","tii","together-brand-color","together-brand","together-color","together-text","together","topazlabs-text","topazlabs","trae-color","trae-text","trae","tripo-color","tripo-text","tripo","turix-text","turix","udio-color","udio-text","udio","unstructured-color","unstructured-text","unstructured","upstage-color","upstage-text","upstage","v0","vectorizerai-text","vectorizerai","venice-color","venice-text","venice","vercel-text","vercel","vertexai-color","vertexai-text","vertexai","vidu-color","vidu-text","vidu","viggle-text","viggle","vllm-color","vllm-text","vllm","volcengine-color","volcengine-text","volcengine","voyage-color","voyage-text","voyage","wenxin-color","wenxin-text","wenxin","windsurf-text","windsurf","workersai-color","workersai-text","workersai","worldrouter-text","worldrouter","xai-text","xai","xiaomimimo-text","xiaomimimo","xinference-color","xinference-text","xinference","xpay-color","xpay-text","xpay","xuanyuan-color","xuanyuan-text","xuanyuan","yandex-text","yandex","yi-color","yi-text","yi","youmind-text","youmind","yuanbao-color","yuanbao-text","yuanbao","zai-text","zai","zapier-color","zapier-text","zapier","zeabur-color","zeabur-text","zeabur","zencoder-color","zencoder-text","zencoder","zenmux-text","zenmux","zeroone-color","zeroone-text","zeroone","zhipu-color","zhipu-text","zhipu"]),i=[[/deepseek/i,"deepseek"],[/claude[\s_-]?code|claudecode/i,"claudecode"],[/claude|anthropic|sonnet|opus|haiku/i,"claude"],[/codex/i,"codex"],[/gpt|openai|chatgpt|\bo[1-4]\b/i,"openai"],[/kimi|\bk2\b/i,"kimi"],[/moonshot/i,"moonshot"],[/minimax/i,"minimax"],[/qwen|qwq/i,"qwen"],[/gemini/i,"gemini"],[/mistral|mixtral|codestral|magistral|devstral/i,"mistral"],[/grok/i,"grok"],[/\bxai\b/i,"xai"],[/glm|chatglm|zhipu/i,"zhipu"],[/llama|meta[\s_-]?ai|\bmeta\b/i,"metaai"],[/ollama/i,"ollama"]];e.s(["ModelIcon",0,function({name:e,size:a=20,className:n=""}){let s=function(e){if(!e)return null;for(let[t,r]of i)if(t.test(e)){let e=`${r}-color`;if(o.has(e))return{slug:e,color:!0};if(o.has(r))return{slug:r,color:!1}}return null}(e);return s?(0,t.jsx)("img",{src:`/models/${s.slug}.svg`,alt:"",className:`shrink-0 object-contain ${s.color?"":"invert"} ${n}`,style:{width:a,height:a},"aria-hidden":!0}):(0,t.jsx)(r,{size:a,className:`text-text-muted ${n}`,"aria-hidden":!0})}],89901)},75254,e=>{"use strict";var t=e.i(71645);let r=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,t.forwardRef)(({color:e="currentColor",size:i=24,strokeWidth:a=2,absoluteStrokeWidth:n,className:s="",children:l,iconNode:c,...u},d)=>(0,t.createElement)("svg",{ref:d,...o,width:i,height:i,stroke:e,strokeWidth:n?24*Number(a)/Number(i):a,className:r("lucide",s),...u},[...c.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(l)?l:[l]]));e.s(["default",0,(e,o)=>{let a=(0,t.forwardRef)(({className:a,...n},s)=>(0,t.createElement)(i,{ref:s,iconNode:o,className:r(`lucide-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,a),...n}));return a.displayName=`${e}`,a}],75254)},76525,e=>{"use strict";var t=e.i(43476);let r={default:"bg-elevated border-border text-text hover:border-border-strong hover:bg-elevated/80",accent:"bg-accent border-accent text-white hover:opacity-90",ghost:"bg-transparent border-transparent text-text-muted hover:bg-elevated hover:text-text",danger:"bg-danger border-danger text-white hover:opacity-90"};e.s(["Button",0,function({variant:e="default",icon:o,className:i="",children:a,...n}){let s=i.trim();return(0,t.jsxs)("button",{className:`inline-flex h-9 items-center justify-center gap-2 border px-3.5 text-sm font-medium rounded-md transition-[color,background-color,border-color,transform] duration-150 active:scale-[0.97] disabled:opacity-40 disabled:cursor-not-allowed disabled:active:scale-100 ${r[e]}${s?` ${s}`:""}`,...n,children:[o?(0,t.jsx)(o,{size:14,"aria-hidden":!0}):null,a]})}])},14272,e=>{"use strict";var t=e.i(40143),r=e.i(88587),o=e.i(36553),i=class extends r.Removable{#e;#t;#r;#o;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#t=[],this.state=e.state||a(),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.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||("pending"===this.state.status?this.scheduleGc():this.#r.remove(this))}continue(){return this.#o?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#o=(0,o.createRetryer)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):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.#r.canRun(this)});let i="pending"===this.state.status,a=!this.#o.canStart();try{if(i)t();else{this.#i({type:"pending",variables:e,isPaused:a}),this.#r.config.onMutate&&await this.#r.config.onMutate(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#i({type:"pending",context:t,variables:e,isPaused:a})}let o=await this.#o.start();return await this.#r.config.onSuccess?.(o,e,this.state.context,this,r),await this.options.onSuccess?.(o,e,this.state.context,r),await this.#r.config.onSettled?.(o,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(o,null,e,this.state.context,r),this.#i({type:"success",data:o}),o}catch(t){try{await this.#r.config.onError?.(t,e,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,r)}catch(e){Promise.reject(e)}try{await this.#r.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,r)}catch(e){Promise.reject(e)}throw this.#i({type:"error",error:t}),t}finally{this.#r.runNext(this)}}#i(e){this.state=(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.notifyManager.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function a(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}e.s(["Mutation",0,i,"getDefaultState",0,a])},95468,e=>{"use strict";let t=(0,e.i(75254).default)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["CheckCircle2",0,t],95468)},63209,e=>{"use strict";let t=(0,e.i(75254).default)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["AlertCircle",0,t],63209)},37727,e=>{"use strict";let t=(0,e.i(75254).default)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],37727)},80809,e=>{"use strict";var t=e.i(43476),r=e.i(71645),o=e.i(95468),i=e.i(63209),a=e.i(37727);e.i(69530);var n=e.i(2942);let s=(0,r.createContext)(null),l=0;function c({item:e,meta:o,dismissLabel:i,onDismiss:n}){let{Icon:s,color:l,title:u}=o,[d,h]=(0,r.useState)(100),p=(0,r.useRef)(!1);return(0,r.useEffect)(()=>{let e=0,t=performance.now(),r=requestAnimationFrame(function o(i){(p.current||(e+=i-t),t=i,h(Math.max(0,100-e/4500*100)),e>=4500)?n():r=requestAnimationFrame(o)});return()=>cancelAnimationFrame(r)},[n]),(0,t.jsxs)("div",{role:"status",onMouseEnter:()=>{p.current=!0},onMouseLeave:()=>{p.current=!1},className:"pointer-events-auto relative flex items-start gap-3 overflow-hidden rounded-lg border border-border bg-surface py-3 pl-4 pr-3",style:{boxShadow:"var(--shadow-raised)",borderLeft:`3px solid ${l}`,animation:"toast-in 200ms var(--ease-out)"},children:[(0,t.jsx)(s,{size:20,"aria-hidden":!0,className:"mt-px shrink-0",style:{color:l}}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-text",children:u}),(0,t.jsx)("div",{className:"mt-0.5 break-words text-sm leading-snug text-text-muted",children:e.message})]}),(0,t.jsx)("button",{type:"button","aria-label":i,onClick:n,className:"-mr-1 -mt-1 flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-text-muted transition-colors hover:bg-elevated hover:text-text",children:(0,t.jsx)(a.X,{size:15,"aria-hidden":!0})}),(0,t.jsx)("span",{className:"absolute bottom-0 left-0 h-0.5",style:{width:`${d}%`,backgroundColor:l,opacity:.5},"aria-hidden":!0})]})}e.s(["ToastProvider",0,function({children:e}){let{t:a}=(0,n.useTranslation)(),u={ok:{Icon:o.CheckCircle2,color:"var(--color-success)",title:a.common.success},error:{Icon:i.AlertCircle,color:"var(--color-danger)",title:a.common.error}},[d,h]=(0,r.useState)([]),p=(0,r.useCallback)(e=>h(t=>t.filter(t=>t.id!==e)),[]),x=(0,r.useCallback)((e,t="ok")=>{let r=l++;h(o=>[...o,{id:r,message:e,tone:t}])},[]),m=(0,r.useMemo)(()=>({toast:x}),[x]);return(0,t.jsxs)(s.Provider,{value:m,children:[e,(0,t.jsx)("div",{className:"pointer-events-none fixed bottom-5 right-5 z-50 flex w-[22rem] max-w-[calc(100vw-2.5rem)] flex-col gap-2.5",children:d.map(e=>(0,t.jsx)(c,{item:e,meta:u[e.tone],dismissLabel:a.common.dismiss,onDismiss:()=>p(e.id)},e.id))})]})},"useToast",0,function(){let e=(0,r.useContext)(s);if(!e)throw Error("useToast must be used within ToastProvider");return e}])},4552,e=>{"use strict";var t=e.i(71645),r=e.i(14272),o=e.i(40143),i=e.i(15823),a=e.i(19273),n=class extends i.Subscribable{#e;#a=void 0;#n;#s;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#l()}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),(0,a.shallowEqualObjects)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,a.hashKey)(t.mutationKey)!==(0,a.hashKey)(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#l(),this.#c(e)}getCurrentResult(){return this.#a}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#l(),this.#c()}mutate(e,t){return this.#s=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#l(){let e=this.#n?.state??(0,r.getDefaultState)();this.#a={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#c(e){o.notifyManager.batch(()=>{if(this.#s&&this.hasListeners()){let t=this.#a.variables,r=this.#a.context,o={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#s.onSuccess?.(e.data,t,r,o)}catch(e){Promise.reject(e)}try{this.#s.onSettled?.(e.data,null,t,r,o)}catch(e){Promise.reject(e)}}else if(e?.type==="error"){try{this.#s.onError?.(e.error,t,r,o)}catch(e){Promise.reject(e)}try{this.#s.onSettled?.(void 0,e.error,t,r,o)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#a)})})}},s=e.i(12598);function l(e,r){let i=(0,s.useQueryClient)(r),[l]=t.useState(()=>new n(i,e));t.useEffect(()=>{l.setOptions(e)},[l,e]);let c=t.useSyncExternalStore(t.useCallback(e=>l.subscribe(o.notifyManager.batchCalls(e)),[l]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),u=t.useCallback((e,t)=>{l.mutate(e,t).catch(a.noop)},[l]);if(c.error&&(0,a.shouldThrowError)(l.options.throwOnError,[c.error]))throw c.error;return{...c,mutate:u,mutateAsync:c.mutate}}var c=e.i(40273),u=e.i(51981);function d(e,t){e.invalidateQueries({queryKey:["project-files",t]}),e.invalidateQueries({queryKey:["project-git",t]}),e.invalidateQueries({queryKey:["project-changed",t]})}e.s(["useAssignProject",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>e.currentlyAssigned?c.orcaClient.unassignProject(e.userId,e.projectId):c.orcaClient.assignProject(e.userId,e.projectId),onSuccess:(t,r)=>e.invalidateQueries({queryKey:["user-projects",r.userId]})})},"useChangePassword",0,function(){return l({mutationFn:e=>c.orcaClient.changePassword(e.currentPassword,e.newPassword)})},"useCleanupAll",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:()=>c.orcaClient.cleanupAll(),onSuccess:()=>e.invalidateQueries()})},"useCloseTask",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.closeTask(e),onSuccess:()=>e.invalidateQueries({queryKey:u.QUERY_KEYS.tasks})})},"useCopyProjectEntry",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.copyProjectEntry(e.id,e.from,e.to),onSuccess:(t,r)=>d(e,r.id)})},"useCreateProject",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.createProject(e),onSuccess:()=>e.invalidateQueries({queryKey:["projects"]})})},"useCreateTask",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.createTask(e),onSuccess:()=>e.invalidateQueries({queryKey:u.QUERY_KEYS.tasks})})},"useCreateUser",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.createUser(e.username,e.password),onSuccess:()=>e.invalidateQueries({queryKey:["users"]})})},"useDeleteMission",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.deleteMission(e),onSuccess:()=>{e.invalidateQueries({queryKey:u.QUERY_KEYS.tasks}),e.invalidateQueries({queryKey:u.QUERY_KEYS.missions}),e.invalidateQueries({queryKey:["mission"]})}})},"useDeleteProjectEntry",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.deleteProjectEntry(e.id,e.path),onSuccess:(t,r)=>d(e,r.id)})},"useDeleteTask",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.deleteTask(e),onSuccess:()=>e.invalidateQueries({queryKey:u.QUERY_KEYS.tasks})})},"useDeleteUser",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.deleteUser(e),onSuccess:()=>e.invalidateQueries({queryKey:["users"]})})},"useDisengage",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.disengageMission(e),onSuccess:()=>e.invalidateQueries({queryKey:u.QUERY_KEYS.missions})})},"useEngage",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.engage(e),onSuccess:()=>e.invalidateQueries({queryKey:u.QUERY_KEYS.missions})})},"useHermesInstall",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.hermesInstall(e),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:r.home?["hermes-status",r.home]:["hermes-status"]})}})},"useInsertPhases",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.insertPhases(e.epicId,e.body),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:u.QUERY_KEYS.tasks}),e.invalidateQueries({queryKey:["mission",r.epicId]}),e.invalidateQueries({queryKey:u.QUERY_KEYS.missions})}})},"useKillSession",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.killSession(e),onSuccess:()=>e.invalidateQueries({queryKey:u.QUERY_KEYS.sessions})})},"useLogin",0,function(){return l({mutationFn:e=>c.orcaClient.login(e.username,e.password)})},"useLogout",0,function(){return l({mutationFn:()=>c.orcaClient.logout()})},"useNewProjectDir",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.newProjectDir(e.id,e.path),onSuccess:(t,r)=>d(e,r.id)})},"useNewProjectFile",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.newProjectFile(e.id,e.path),onSuccess:(t,r)=>d(e,r.id)})},"usePauseMission",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.pauseMission(e),onSuccess:()=>e.invalidateQueries({queryKey:u.QUERY_KEYS.missions})})},"usePlanTask",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.planTask(e),onSuccess:()=>{e.invalidateQueries({queryKey:u.QUERY_KEYS.tasks}),e.invalidateQueries({queryKey:u.QUERY_KEYS.missions})}})},"useRemoveProject",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.removeProject(e),onSuccess:()=>e.invalidateQueries({queryKey:["projects"]})})},"useRenameProjectEntry",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.renameProjectEntry(e.id,e.from,e.to),onSuccess:(t,r)=>d(e,r.id)})},"useResumeMission",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.resumeMission(e),onSuccess:()=>e.invalidateQueries({queryKey:u.QUERY_KEYS.missions})})},"useSendInput",0,function(){return l({mutationFn:e=>c.orcaClient.sendKeys(e.name,e.keys)})},"useSetTaskExec",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.setTaskExec(e.id,e.exec),onSuccess:()=>e.invalidateQueries({queryKey:u.QUERY_KEYS.tasks})})},"useSetTaskStatus",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.setTaskStatus(e.id,e.status),onSuccess:()=>e.invalidateQueries({queryKey:u.QUERY_KEYS.tasks})})},"useSpawn",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.spawn(e),onSuccess:()=>{e.invalidateQueries({queryKey:u.QUERY_KEYS.tasks}),e.invalidateQueries({queryKey:u.QUERY_KEYS.sessions})}})},"useUpdateConfig",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.updateConfig(e),onSuccess:()=>e.invalidateQueries({queryKey:u.QUERY_KEYS.config})})},"useUpdateMe",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.updateMe(e),onSuccess:()=>e.invalidateQueries({queryKey:["me"]})})},"useUpdateProject",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.updateProject(e.id,{path:e.path,notes:e.notes}),onSuccess:()=>e.invalidateQueries({queryKey:["projects"]})})},"useUpdateTask",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.updateTask(e.id,e.patch),onSuccess:()=>e.invalidateQueries({queryKey:u.QUERY_KEYS.tasks})})},"useUpdateUser",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.updateUser(e.id,e.patch),onSuccess:()=>{e.invalidateQueries({queryKey:["users"]}),e.invalidateQueries({queryKey:["me"]})}})},"useUploadAvatar",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.uploadAvatar(e),onSuccess:()=>e.invalidateQueries({queryKey:["me"]})})},"useWriteProjectFile",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.writeProjectFile(e.id,e.path,e.content),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:["project-file",r.id,r.path]}),e.invalidateQueries({queryKey:["project-git",r.id]})}})}],4552)},1206,e=>{"use strict";var t=e.i(43476);let r=(0,e.i(71645).forwardRef)(function({className:e="",...r},o){let i=e.trim();return(0,t.jsx)("input",{ref:o,className:`h-9 w-full rounded-md border border-border bg-surface px-3 text-sm text-text placeholder:text-text-muted transition-colors focus:border-accent focus:outline-none disabled:opacity-40 disabled:cursor-not-allowed${i?` ${i}`:""}`,...r})});e.s(["Input",0,r])},90272,e=>{"use strict";let t=(0,e.i(75254).default)("FolderGit2",[["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"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);e.s(["FolderGit2",0,t],90272)},18566,(e,t,r)=>{t.exports=e.r(76562)},84981,e=>{"use strict";let t=(0,e.i(75254).default)("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);e.s(["default",0,t])},55436,e=>{"use strict";let t=(0,e.i(75254).default)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);e.s(["Search",0,t],55436)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,98183,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o={assign:function(){return l},searchParamsToUrlQuery:function(){return a},urlQueryToSearchParams:function(){return s}};for(var i in o)Object.defineProperty(r,i,{enumerable:!0,get:o[i]});function a(e){let t={};for(let[r,o]of e.entries()){let e=t[r];void 0===e?t[r]=o:Array.isArray(e)?e.push(o):t[r]=[e,o]}return t}function n(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function s(e){let t=new URLSearchParams;for(let[r,o]of Object.entries(e))if(Array.isArray(o))for(let e of o)t.append(r,n(e));else t.set(r,n(o));return t}function l(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,o]of r.entries())e.append(t,o)}return e}},18967,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o={DecodeError:function(){return y},MiddlewareNotFoundError:function(){return k},MissingStaticPage:function(){return v},NormalizeError:function(){return b},PageNotFoundError:function(){return g},SP:function(){return m},ST:function(){return f},WEB_VITALS:function(){return a},execOnce:function(){return n},getDisplayName:function(){return d},getLocationOrigin:function(){return c},getURL:function(){return u},isAbsoluteUrl:function(){return l},isResSent:function(){return h},loadGetInitialProps:function(){return x},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return w}};for(var i in o)Object.defineProperty(r,i,{enumerable:!0,get:o[i]});let a=["CLS","FCP","FID","INP","LCP","TTFB"];function n(e){let t,r=!1;return(...o)=>(r||(r=!0,t=e(...o)),t)}let s=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>s.test(e);function c(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function u(){let{href:e}=window.location,t=c();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function h(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function x(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await x(t.Component,t.ctx)}:{};let o=await e.getInitialProps(t);if(r&&h(r))return o;if(!o)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${o}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return o}let m="u">typeof performance,f=m&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class y extends Error{}class b extends Error{}class g extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class v extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class k extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function w(e){return JSON.stringify({message:e.message,stack:e.stack})}},33525,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return o}});let o=e=>{}},9912,e=>{"use strict";let t=(0,e.i(75254).default)("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);e.s(["Rocket",0,t],9912)},7233,e=>{"use strict";let t=(0,e.i(75254).default)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",0,t],7233)},82458,e=>{"use strict";let t=(0,e.i(75254).default)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["default",0,t])},24877,56474,e=>{"use strict";let t={30:"#3a3a3a",31:"#ef4444",32:"#22c55e",33:"#eab308",34:"#3b82f6",35:"#a855f7",36:"#06b6d4",37:"#d4d4d4",90:"#6b7280",91:"#f87171",92:"#4ade80",93:"#facc15",94:"#60a5fa",95:"#c084fc",96:"#22d3ee",97:"#f5f5f5"};function r(e){let r,o,i=[],a="",n=()=>{a&&(i.push({text:a.replace(/\x1b\[[0-9;?]*[ -/]*[@-ln-~]/g,"").replace(/\x1b[()][0-9A-Za-z]/g,"").replace(/\x1b[=>]/g,"").replace(/\x1b/g,""),color:r}),a="")},s=/\x1b\[([0-9;]*)m/g,l=0;for(;null!==(o=s.exec(e));){a+=e.slice(l,o.index),n(),l=s.lastIndex;let i=(o[1]||"0").split(";").map(e=>Number(e||0));for(let e=0;e<i.length;e++){let o=i[e];0===o||39===o?r=void 0:t[o]?r=t[o]:38===o&&(5===i[e+1]?(r=function(e){if(e<16)return t[e<8?30+e:90+(e-8)]??"#d4d4d4";if(e>=232){let t=8+(e-232)*10;return`rgb(${t},${t},${t})`}let r=e-16,o=Math.floor(r/36),i=Math.floor(r%36/6),a=e=>0===e?0:55+40*e;return`rgb(${a(o)},${a(i)},${a(r%6)})`}(i[e+2]??7),e+=2):2===i[e+1]&&(r=`rgb(${i[e+2]??0},${i[e+3]??0},${i[e+4]??0})`,e+=4))}}return a+=e.slice(l),n(),i.filter(e=>e.text.length>0)}e.s(["parseAnsi",0,r],56474);let o="agent:";function i(e){let t=e.labels?.find(e=>e.startsWith(o));return t?t.slice(o.length):null}function a(e){if(!e)return null;let t=new Date(e.includes("T")?e:e.replace(" ","T")+(e.endsWith("Z")?"":"Z")).getTime();return Number.isNaN(t)?null:t}function n(e){let t=e.labels?.find(e=>e.startsWith("started:"));if(t){let e=Number(t.slice(8));if(Number.isFinite(e))return e}return a(e.created_at)}e.s(["agentDisplayName",0,function(e){return e.replace(/^orca-/,"")||e},"keysForOption",0,function(e){return[...Array(Math.max(0,Number(e)-1)).fill("Down"),"Enter"]},"lastClosedTask",0,function(e){let t=e.filter(e=>"closed"===e.status);return 0===t.length?null:t.reduce((e,t)=>(a(t.closed_at)??0)>(a(e.closed_at)??0)?t:e)},"liveState",0,function(e,t){return e?.type==="needs_input"?"needs_input":t||e?.type==="working"?"working":e?.type==="complete"?"complete":"idle"},"missionEpicId",0,function(e){return e.replace(/^m-/,"")},"needsInputSessions",0,function(e,t){return e.filter(e=>t[e]?.type==="needs_input")},"parseTs",0,a,"tailSnippet",0,function(e){let t=e.split("\n");for(let e=t.length-1;e>=0;e--){let o=r(t[e]).map(e=>e.text).join("").trim();if(o)return o}return""},"taskAgentName",0,i,"taskBlockers",0,function(e,t,r){return t.filter(t=>t.task_id===e).map(e=>r.get(e.depends_on_id)).filter(e=>!!e&&"closed"!==e.status&&"cancelled"!==e.status)},"taskElapsed",0,function(e,t){let r=n(e);if(null==r)return null;let o=Math.max(0,Math.floor((("closed"===e.status||"cancelled"===e.status?a(e.closed_at)??t:t)-r)/1e3));if(o<60)return`${o}s`;let i=Math.floor(o/60);if(i<60)return`${i}m`;let s=Math.floor(i/60);return s<24?`${s}h`:`${Math.floor(s/24)}d`},"taskForSession",0,function(e,t){if(!t.startsWith("orca-"))return;let r=`${o}${t.slice(5)}`,i=e.filter(e=>(e.labels??[]).includes(r));return i.length<=1?i[0]:i.find(e=>"in_progress"===e.status)??[...i].sort((e,t)=>(a(t.created_at)??0)-(a(e.created_at)??0))[0]},"taskSessionName",0,function(e){let t=i(e);return t?`orca-${t}`:null},"taskStartedMs",0,n],24877)},63804,e=>{"use strict";let t=(0,e.i(75254).default)("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);e.s(["ListChecks",0,t],63804)},73884,e=>{"use strict";let t=(0,e.i(75254).default)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",0,t],73884)},93283,e=>{"use strict";var t=e.i(66027),r=e.i(40273);e.s(["useSessionPane",0,function(e,o=8,i=!0){let a=(0,t.useQuery)({queryKey:["session-pane",e,"ansi"],queryFn:()=>r.orcaClient.sessionPane(e,!0),enabled:i&&!!e,refetchInterval:2e3,refetchOnWindowFocus:!1});return{tail:(a.data?.pane??"").split("\n").slice(-o).join("\n"),isLoading:a.isLoading,isError:a.isError}}])},77154,e=>{"use strict";let t="exec:";e.s(["taskExec",0,function(e){let r=e?.find(e=>e.startsWith(t));return r?r.slice(t.length):""}])},91842,e=>{"use strict";var t=e.i(71645),r=e.i(93283);let o={stalledSec:300,stuckSec:900};e.s(["useSessionStall",0,function(e,i,a=o){let{tail:n}=(0,r.useSessionPane)(e,8,i),[s,l]=(0,t.useState)(()=>Date.now()),c=(0,t.useRef)(Date.now());if((0,t.useEffect)(()=>{c.current=Date.now()},[n]),(0,t.useEffect)(()=>{if(!i)return;let e=setInterval(()=>l(Date.now()),1e3);return()=>clearInterval(e)},[i]),!i)return{state:"fresh",silenceSec:0};let u=Math.floor((s-c.current)/1e3);return{state:function(e,t,r=o){if(!t)return"fresh";let i=Math.max(0,e);return i>=r.stuckSec?"stuck":i>=r.stalledSec?"stalled":"fresh"}(u,!0,a),silenceSec:u}}])},95057,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o={formatUrl:function(){return s},formatWithValidation:function(){return c},urlObjectKeys:function(){return l}};for(var i in o)Object.defineProperty(r,i,{enumerable:!0,get:o[i]});let a=e.r(90809)._(e.r(98183)),n=/https?|ftp|gopher|file/;function s(e){let{auth:t,hostname:r}=e,o=e.protocol||"",i=e.pathname||"",s=e.hash||"",l=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:r&&(c=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(c+=":"+e.port)),l&&"object"==typeof l&&(l=String(a.urlQueryToSearchParams(l)));let u=e.search||l&&`?${l}`||"";return o&&!o.endsWith(":")&&(o+=":"),e.slashes||(!o||n.test(o))&&!1!==c?(c="//"+(c||""),i&&"/"!==i[0]&&(i="/"+i)):c||(c=""),s&&"#"!==s[0]&&(s="#"+s),u&&"?"!==u[0]&&(u="?"+u),i=i.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${o}${c}${i}${u}${s}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return s(e)}},18581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return i}});let o=e.r(71645);function i(e,t){let r=(0,o.useRef)(null),i=(0,o.useRef)(null);return(0,o.useCallback)(o=>{if(null===o){let e=r.current;e&&(r.current=null,e());let t=i.current;t&&(i.current=null,t())}else e&&(r.current=a(e,o)),t&&(i.current=a(t,o))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},73668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let o=e.r(18967),i=e.r(52817);function a(e){if(!(0,o.isAbsoluteUrl)(e))return!0;try{let t=(0,o.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,i.hasBasePath)(r.pathname)}catch(e){return!1}}},84508,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return o}});let o=e=>{}},22016,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o={default:function(){return y},useLinkStatus:function(){return g}};for(var i in o)Object.defineProperty(r,i,{enumerable:!0,get:o[i]});let a=e.r(90809),n=e.r(43476),s=a._(e.r(71645)),l=e.r(95057),c=e.r(8372),u=e.r(18581),d=e.r(18967),h=e.r(5550);e.r(33525);let p=e.r(88540),x=e.r(91949),m=e.r(73668),f=e.r(9396);function y(t){var r,o;let i,a,y,[g,v]=(0,s.useOptimistic)(x.IDLE_LINK_STATUS),k=(0,s.useRef)(null),{href:w,as:C,children:S,prefetch:j=null,passHref:E,replace:M,shallow:P,scroll:Q,onClick:q,onMouseEnter:K,onTouchStart:R,legacyBehavior:_=!1,onNavigate:N,transitionTypes:F,ref:O,unstable_dynamicOnHover:T,...z}=t;i=S,_&&("string"==typeof i||"number"==typeof i)&&(i=(0,n.jsx)("a",{children:i}));let U=s.default.useContext(c.AppRouterContext),A=!1!==j,$=!1!==j?null===(o=j)||"auto"===o?f.FetchStrategy.PPR:f.FetchStrategy.Full:f.FetchStrategy.PPR,I="string"==typeof(r=C||w)?r:(0,l.formatUrl)(r);if(_){if(i?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=s.default.Children.only(i)}let Y=_?a&&"object"==typeof a&&a.ref:O,L=s.default.useCallback(e=>(null!==U&&(k.current=(0,x.mountLinkInstance)(e,I,U,$,A,v)),()=>{k.current&&((0,x.unmountLinkForCurrentNavigation)(k.current),k.current=null),(0,x.unmountPrefetchableInstance)(e)}),[A,I,U,$,v]),D={ref:(0,u.useMergedRef)(L,Y),onClick(t){_||"function"!=typeof q||q(t),_&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!U||t.defaultPrevented||function(t,r,o,i,a,n,l){if("u">typeof window){let c,{nodeName:u}=t.currentTarget;if("A"===u.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(r)){i&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),n){let e=!1;if(n({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(99781);s.default.startTransition(()=>{d(r,i?"replace":"push",!1===a?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,o.current,l)})}}(t,I,k,M,Q,N,F)},onMouseEnter(e){_||"function"!=typeof K||K(e),_&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),U&&A&&(0,x.onNavigationIntent)(e.currentTarget,!0===T)},onTouchStart:function(e){_||"function"!=typeof R||R(e),_&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),U&&A&&(0,x.onNavigationIntent)(e.currentTarget,!0===T)}};return(0,d.isAbsoluteUrl)(I)?D.href=I:_&&!E&&("a"!==a.type||"href"in a.props)||(D.href=(0,h.addBasePath)(I)),y=_?s.default.cloneElement(a,D):(0,n.jsx)("a",{...z,...D,children:i}),(0,n.jsx)(b.Provider,{value:g,children:y})}e.r(84508);let b=(0,s.createContext)(x.IDLE_LINK_STATUS),g=()=>(0,s.useContext)(b);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},61911,e=>{"use strict";let t=(0,e.i(75254).default)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);e.s(["Users",0,t],61911)},41382,e=>{"use strict";let t=(0,e.i(75254).default)("SquareKanban",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 7v7",key:"1x2jlm"}],["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M16 7v9",key:"1hp2iy"}]]);e.s(["KanbanSquare",0,t],41382)},21218,e=>{"use strict";let t=(0,e.i(75254).default)("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);e.s(["Activity",0,t],21218)},51737,e=>{"use strict";let t=(0,e.i(75254).default)("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);e.s(["ShieldAlert",0,t],51737)},20535,e=>{"use strict";var t=e.i(84981);e.s(["SquareTerminal",()=>t.default])},45423,e=>{"use strict";let t=(0,e.i(75254).default)("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);e.s(["Bell",0,t],45423)},1544,e=>{"use strict";var t=e.i(43476),r=e.i(71645),o=e.i(40273);let i=["#ef4444","#f59e0b","#10b981","#3b82f6","#8b5cf6","#ec4899","#14b8a6","#f97316"];e.s(["Avatar",0,function({user:e,size:a=36}){let n=e.name?.trim()||e.username,[s,l]=(0,r.useState)(null);return((0,r.useEffect)(()=>{if(!e.avatar)return void l(null);let t=!0;return o.orcaClient.avatarUrl(e.id).then(e=>{t&&l(e)}).catch(()=>{t&&l(null)}),()=>{t=!1}},[e.id,e.avatar]),e.avatar&&s)?(0,t.jsx)("img",{src:s,alt:n,className:"shrink-0 rounded-full border border-border object-cover",style:{width:a,height:a}}):(0,t.jsx)("span",{className:"inline-flex shrink-0 items-center justify-center rounded-full font-mono font-semibold text-white",style:{width:a,height:a,fontSize:.38*a,background:i[[...n].reduce((e,t)=>e+t.charCodeAt(0),0)%i.length]},"aria-label":n,children:n.trim().slice(0,2).toUpperCase()||"?"})}])},84614,e=>{"use strict";let t=(0,e.i(75254).default)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",0,t],84614)},60289,89128,45286,e=>{"use strict";let t=(0,e.i(75254).default)("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);e.s(["LayoutDashboard",0,t],60289);var r=e.i(43476),o=e.i(82458);e.s(["TriangleAlert",()=>o.default],89128);var o=o,i=e.i(4552),a=e.i(24877),n=e.i(89901),s=e.i(80809);e.i(69530);var l=e.i(2942);e.s(["NeedsInputRow",0,function({name:e,question:t,options:c,exec:u}){let{t:d}=(0,l.useTranslation)(),h=(0,i.useSendInput)(),{toast:p}=(0,s.useToast)(),x=!!c&&c.length>0,m=(t,r)=>h.mutate({name:e,keys:t},{onSuccess:()=>p(r),onError:e=>p(String(e),"error")});return(0,r.jsxs)("div",{className:`flex gap-2.5 rounded-md border border-border bg-bg px-3 py-2 ${x?"flex-col items-stretch":"items-center"}`,children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-2.5",children:[(0,r.jsx)("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-border bg-elevated",children:u?(0,r.jsx)(n.ModelIcon,{name:u,size:13}):(0,r.jsx)(o.default,{size:12,className:"text-warning","aria-hidden":!0})}),(0,r.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-text",children:e}),(0,r.jsx)("span",{className:`min-w-0 flex-1 text-xs text-text-muted ${x?"":"truncate"}`,title:t,children:t}),!x&&(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[(0,r.jsx)("button",{type:"button",onClick:()=>m(["Enter"],d.sessions.approved.replace("{name}",e)),className:"rounded-md border border-approve/50 bg-approve/10 px-2.5 py-1 text-xs font-medium text-approve transition-colors hover:bg-approve hover:text-white active:scale-95",children:d.sessions.allow}),(0,r.jsx)("button",{type:"button",onClick:()=>m(["Escape"],d.sessions.rejected.replace("{name}",e)),className:"rounded-md border border-danger/50 bg-danger/10 px-2.5 py-1 text-xs font-medium text-danger transition-colors hover:bg-danger hover:text-white active:scale-95",children:d.sessions.reject})]})]}),x&&(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 pl-[34px]",children:[c.map(t=>(0,r.jsxs)("button",{type:"button",title:t.label,onClick:()=>m((0,a.keysForOption)(t.id),d.sessions.answered.replace("{name}",e).replace("{option}",t.label)),className:"max-w-full truncate rounded-md border border-accent/50 bg-accent/10 px-2.5 py-1 text-xs font-medium text-accent transition-colors hover:bg-accent hover:text-white active:scale-95",children:[(0,r.jsxs)("span",{className:"opacity-60",children:[t.id,"."]})," ",t.label]},t.id)),(0,r.jsx)("button",{type:"button",onClick:()=>m(["Escape"],d.sessions.rejected.replace("{name}",e)),className:"rounded-md border border-danger/50 bg-danger/10 px-2.5 py-1 text-xs font-medium text-danger transition-colors hover:bg-danger hover:text-white active:scale-95",children:d.sessions.reject})]})]})}],45286)},89901,66992,e=>{"use strict";var t=e.i(43476);let r=(0,e.i(75254).default)("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);e.s(["Cpu",0,r],66992);let o=new Set(["ace-text","ace","adobe-color","adobe-text","adobe","adobefirefly-color","adobefirefly-text","adobefirefly","agentvoice-color","agentvoice-text","agentvoice","agui-text","agui","ai2-color","ai2-text","ai2","ai21-brand-color","ai21-brand","ai21-text","ai21","ai302-color","ai302-text","ai302","ai360-color","ai360-text","ai360","aihubmix-color","aihubmix-text","aihubmix","aimass-color","aimass-text","aimass","aionlabs-color","aionlabs-text","aionlabs","airjelly-color","airjelly-text","airjelly","aistudio-text","aistudio","akashchat-color","akashchat-text","akashchat","alephalpha-text","alephalpha","alibaba-brand-color","alibaba-brand","alibaba-color","alibaba-text-cn","alibaba-text","alibaba","alibabacloud-color","alibabacloud-text-cn","alibabacloud-text","alibabacloud","amp-color","amp-text","amp","antgroup-brand-color","antgroup-brand","antgroup-color","antgroup-text-cn","antgroup-text","antgroup","anthropic-text","anthropic","antigravity-color","antigravity-text","antigravity","anyscale-color","anyscale-text","anyscale","apertis-color","apertis-text","apertis","apple-text","apple","arcee-color","arcee-text","arcee","askverdict-color","askverdict-text","askverdict","assemblyai-color","assemblyai-text","assemblyai","atlascloud-text","atlascloud","automatic-color","automatic-text","automatic","aws-brand-color","aws-brand","aws-color","aws-text","aws","aya-color","aya-text","aya","azure-color","azure-text","azure","azureai-color","azureai-text","azureai","baai-text","baai","baichuan-color","baichuan-text","baichuan","baidu-brand-color","baidu-brand","baidu-color","baidu-text-cn","baidu-text","baidu","baiducloud-color","baiducloud-text","baiducloud","bailian-color","bailian-text","bailian","baseten-text","baseten","bedrock-color","bedrock-text","bedrock","bfl-text","bfl","bilibili-color","bilibili-text","bilibili","bilibiliindex-text","bilibiliindex","bing-color","bing-text","bing","briaai-color","briaai-text","briaai","burncloud-color","burncloud-text","burncloud","bytedance-brand-color","bytedance-brand","bytedance-color","bytedance-text-cn","bytedance-text","bytedance","capcut-text","capcut","centml-brand-color","centml-brand","centml-color","centml-text","centml","cerebras-brand-color","cerebras-brand","cerebras-color","cerebras-text","cerebras","chatglm-color","chatglm-text","chatglm","cherrystudio-color","cherrystudio-text","cherrystudio","civitai-color","civitai-text-color","civitai-text","civitai","claude-color","claude-text","claude","claudecode-color","claudecode-text","claudecode","cline-text","cline","clipdrop-text","clipdrop","cloudflare-color","cloudflare-text","cloudflare","codebuddy-color","codebuddy-text","codebuddy","codeflicker-color","codeflicker-text","codeflicker","codegeex-color","codegeex-text","codegeex","codex-color","codex-text","codex","cogvideo-color","cogvideo-text","cogvideo","cogview-color","cogview-text","cogview","cohere-color","cohere-text","cohere","colab-color","colab-text","colab","cometapi-color","cometapi-text","cometapi","comfyui-color","comfyui-text","comfyui","commanda-color","commanda-text","commanda","copilot-color","copilot-text","copilot","copilotkit-color","copilotkit-text","copilotkit","coqui-color","coqui-text","coqui","coze-text","coze","crewai-brand-color","crewai-brand","crewai-color","crewai-text","crewai","crusoe-color","crusoe-text","crusoe","cursor-text","cursor","cybercut-text","cybercut","dalle-color","dalle-text","dalle","dbrx-brand-color","dbrx-brand","dbrx-color","dbrx-text","dbrx","deepai-text","deepai","deepcogito-color","deepcogito-text","deepcogito","deepinfra-color","deepinfra-text","deepinfra","deepl-color","deepl-text","deepl","deepmind-color","deepmind-text","deepmind","deepseek-color","deepseek-text","deepseek","devin-color","devin-text","devin","dify-color","dify-text","dify","doc2x-color","doc2x-text","doc2x","docsearch-color","docsearch-text","docsearch","dolphin-text","dolphin","doubao-color","doubao-text","doubao","dreammachine-text","dreammachine","elevenlabs-text","elevenlabs","elevenx-text","elevenx","essentialai-color","essentialai-text","essentialai","exa-color","exa-text","exa","fal-color","fal-text","fal","fastgpt-color","fastgpt-text","fastgpt","featherless-color","featherless-text","featherless","figma-color","figma-text","figma","fireworks-color","fireworks-text","fireworks","fishaudio-text","fishaudio","flora-text","flora","flowith-text","flowith","flux-text","flux","friendli-text","friendli","gemini-color","gemini-text","gemini","geminicli-color","geminicli-text","geminicli","gemma-color","gemma-text","gemma","giteeai-text","giteeai","github-text","github","githubcopilot-text","githubcopilot","glama-text","glama","glif-text","glif","glmv-color","glmv-text","glmv","google-brand-color","google-brand","google-color","google","googlecloud-brand-color","googlecloud-brand","googlecloud-color","googlecloud","goose-text","goose","gradio-color","gradio-text","gradio","greptile-color","greptile-text","greptile","grok-text","grok","groq-text","groq","hailuo-color","hailuo-text","hailuo","haiper-text","haiper","hedra-text","hedra","hermesagent-text","hermesagent","higress-color","higress-text","higress","huawei-color","huawei-text-cn","huawei-text","huawei","huaweicloud-color","huaweicloud-text-cn","huaweicloud-text","huaweicloud","huggingface-color","huggingface-text","huggingface","hunyuan-color","hunyuan-text","hunyuan","hyperbolic-color","hyperbolic-text","hyperbolic","ibm-text","ibm","ideogram-text","ideogram","iflytekcloud-color","iflytekcloud-text","iflytekcloud","inception-text","inception","inference-text","inference","infermatic-color","infermatic-text","infermatic","infinigence-color","infinigence-text-cn","infinigence-text","infinigence","inflection-text","inflection","internlm-color","internlm-text","internlm","jimeng-color","jimeng-text","jimeng","jina-text","jina","junie-color","junie-text","junie","kilocode-text","kilocode","kimi-color","kimi-text","kimi","kiro-color","kiro-text","kiro","kling-color","kling-text","kling","kluster-color","kluster-text","kluster","kolors-color","kolors-text","kolors","krea-text","krea","kwaikat-text-color","kwaikat-text","kwaikat","kwaipilot-color","kwaipilot-text","kwaipilot","lambda-text","lambda","langchain-color","langchain-text","langchain","langfuse-color","langfuse-text","langfuse","langgraph-color","langgraph-text","langgraph","langsmith-color","langsmith-text","langsmith","leptonai-color","leptonai-text","leptonai","lg-color","lg-text","lg","lightricks-text","lightricks","liquid-text","liquid","livekit-color","livekit-text","livekit","llamaindex-color","llamaindex-text","llamaindex","llava-color","llava-text","llava","llmapi-color","llmapi-text","llmapi","lmstudio-text","lmstudio","lobehub-color","lobehub-text","lobehub","longcat-color","longcat-text","longcat","lovable-color","lovable-text","lovable","lovart-text","lovart","luma-color","luma-text","luma","magic-text","magic","make-color","make-text","make","manus-text","manus","mastra-text","mastra","mcp-text","mcp","mcpso-color","mcpso-text","mcpso","menlo-color","menlo-text","menlo","meshy-color","meshy-text","meshy","meta-brand-color","meta-brand","meta-color","meta-text","meta","metaai-color","metaai-text","metaai","metagpt-text","metagpt","microsoft-color","microsoft-text","microsoft","midjourney-text","midjourney","minimax-color","minimax-text","minimax","mistral-color","mistral-text","mistral","modelscope-color","modelscope-text","modelscope","monica-color","monica-text","monica","moonshot-text","moonshot","morph-color","morph-text","morph","moxt-color","moxt-text","moxt","myshell-color","myshell-text","myshell","n8n-color","n8n-text","n8n","nanobanana-color","nanobanana-text","nanobanana","nebius-text","nebius","newapi-color","newapi-text","newapi","notebooklm-text","notebooklm","notion-text","notion","nousresearch-text","nousresearch","nova-color","nova-text","nova","novelai-text","novelai","novita-color","novita-text","novita","nplcloud-color","nplcloud-text","nplcloud","nvidia-color","nvidia-text","nvidia","obsidian-color","obsidian-text","obsidian","ollama-text","ollama","openai-text","openai","openchat-color","openchat-text","openchat","openclaw-color","openclaw-text","openclaw","opencode-text","opencode","openhands-color","openhands-text","openhands","openhuman-text","openhuman","openrouter-text","openrouter","openwebui-text","openwebui","palm-color","palm-text","palm","parasail-text","parasail","perplexity-color","perplexity-text","perplexity","phidata-color","phidata-text","phidata","phind-text","phind","pika-text","pika","pixverse-color","pixverse-text","pixverse","player2-color","player2-text","player2","poe-color","poe-text","poe","pollinations-text","pollinations","ppio-color","ppio-text-cn","ppio-text","ppio","prunaai-color","prunaai-text","prunaai","pydanticai-color","pydanticai-text","pydanticai","qingyan-color","qingyan-text","qingyan","qiniu-color","qiniu-text","qiniu","qoder-color","qoder-text","qoder","qwen-color","qwen-text","qwen","railway-text","railway","recraft-text","recraft","relace-text","relace","replicate-brand","replicate-text","replicate","replit-color","replit-text","replit","reve-text","reve","roocode-text","roocode","rsshub-color","rsshub-text","rsshub","runway-text","runway","rwkv-color","rwkv-text","rwkv","sambanova-color","sambanova-text","sambanova","search1api-color","search1api-text","search1api","searchapi-text","searchapi","sensenova-brand-color","sensenova-brand","sensenova-color","sensenova-text","sensenova","siliconcloud-color","siliconcloud-text","siliconcloud","sillytavern-color","sillytavern-text","sillytavern","skywork-color","skywork-text","skywork","slock-text","slock","smithery-color","smithery-text","smithery","snowflake-color","snowflake-text","snowflake","sophnet-color","sophnet-text","sophnet","sora-color","sora-text","sora","spark-color","spark-text","spark","speedai-color","speedai-text","speedai","stability-brand-color","stability-brand","stability-color","stability-text","stability","statecloud-color","statecloud-text","statecloud","stepfun-color","stepfun-text","stepfun","straico-color","straico-text","straico","streamlake-color","streamlake-text","streamlake","submodel-color","submodel-text","submodel","suno-text","suno","sync-text","sync","targon-color","targon-text","targon","tavily-color","tavily-text","tavily","tencent-brand-color","tencent-brand","tencent-color","tencent-text-cn","tencent-text","tencent","tencentcloud-color","tencentcloud-text","tencentcloud","tiangong-color","tiangong-text","tiangong","tii-color","tii-text","tii","together-brand-color","together-brand","together-color","together-text","together","topazlabs-text","topazlabs","trae-color","trae-text","trae","tripo-color","tripo-text","tripo","turix-text","turix","udio-color","udio-text","udio","unstructured-color","unstructured-text","unstructured","upstage-color","upstage-text","upstage","v0","vectorizerai-text","vectorizerai","venice-color","venice-text","venice","vercel-text","vercel","vertexai-color","vertexai-text","vertexai","vidu-color","vidu-text","vidu","viggle-text","viggle","vllm-color","vllm-text","vllm","volcengine-color","volcengine-text","volcengine","voyage-color","voyage-text","voyage","wenxin-color","wenxin-text","wenxin","windsurf-text","windsurf","workersai-color","workersai-text","workersai","worldrouter-text","worldrouter","xai-text","xai","xiaomimimo-text","xiaomimimo","xinference-color","xinference-text","xinference","xpay-color","xpay-text","xpay","xuanyuan-color","xuanyuan-text","xuanyuan","yandex-text","yandex","yi-color","yi-text","yi","youmind-text","youmind","yuanbao-color","yuanbao-text","yuanbao","zai-text","zai","zapier-color","zapier-text","zapier","zeabur-color","zeabur-text","zeabur","zencoder-color","zencoder-text","zencoder","zenmux-text","zenmux","zeroone-color","zeroone-text","zeroone","zhipu-color","zhipu-text","zhipu"]),i=[[/deepseek/i,"deepseek"],[/claude[\s_-]?code|claudecode/i,"claudecode"],[/claude|anthropic|sonnet|opus|haiku/i,"claude"],[/codex/i,"codex"],[/gpt|openai|chatgpt|\bo[1-4]\b/i,"openai"],[/kimi|\bk2\b/i,"kimi"],[/moonshot/i,"moonshot"],[/minimax/i,"minimax"],[/qwen|qwq/i,"qwen"],[/gemini/i,"gemini"],[/mistral|mixtral|codestral|magistral|devstral/i,"mistral"],[/grok/i,"grok"],[/\bxai\b/i,"xai"],[/glm|chatglm|zhipu/i,"zhipu"],[/llama|meta[\s_-]?ai|\bmeta\b/i,"metaai"],[/ollama/i,"ollama"]];e.s(["ModelIcon",0,function({name:e,size:a=20,className:n=""}){let s=function(e){if(!e)return null;for(let[t,r]of i)if(t.test(e)){let e=`${r}-color`;if(o.has(e))return{slug:e,color:!0};if(o.has(r))return{slug:r,color:!1}}return null}(e);return s?(0,t.jsx)("img",{src:`/models/${s.slug}.svg`,alt:"",className:`shrink-0 object-contain ${s.color?"":"invert"} ${n}`,style:{width:a,height:a},"aria-hidden":!0}):(0,t.jsx)(r,{size:a,className:`text-text-muted ${n}`,"aria-hidden":!0})}],89901)},75254,e=>{"use strict";var t=e.i(71645);let r=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,t.forwardRef)(({color:e="currentColor",size:i=24,strokeWidth:a=2,absoluteStrokeWidth:n,className:s="",children:l,iconNode:c,...u},d)=>(0,t.createElement)("svg",{ref:d,...o,width:i,height:i,stroke:e,strokeWidth:n?24*Number(a)/Number(i):a,className:r("lucide",s),...u},[...c.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(l)?l:[l]]));e.s(["default",0,(e,o)=>{let a=(0,t.forwardRef)(({className:a,...n},s)=>(0,t.createElement)(i,{ref:s,iconNode:o,className:r(`lucide-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,a),...n}));return a.displayName=`${e}`,a}],75254)},76525,e=>{"use strict";var t=e.i(43476);let r={default:"bg-elevated border-border text-text hover:border-border-strong hover:bg-elevated/80",accent:"bg-accent border-accent text-white hover:opacity-90",ghost:"bg-transparent border-transparent text-text-muted hover:bg-elevated hover:text-text",danger:"bg-danger border-danger text-white hover:opacity-90"};e.s(["Button",0,function({variant:e="default",icon:o,className:i="",children:a,...n}){let s=i.trim();return(0,t.jsxs)("button",{className:`inline-flex h-9 items-center justify-center gap-2 border px-3.5 text-sm font-medium rounded-md transition-[color,background-color,border-color,transform] duration-150 active:scale-[0.97] disabled:opacity-40 disabled:cursor-not-allowed disabled:active:scale-100 ${r[e]}${s?` ${s}`:""}`,...n,children:[o?(0,t.jsx)(o,{size:14,"aria-hidden":!0}):null,a]})}])},14272,e=>{"use strict";var t=e.i(40143),r=e.i(88587),o=e.i(36553),i=class extends r.Removable{#e;#t;#r;#o;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#t=[],this.state=e.state||a(),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.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||("pending"===this.state.status?this.scheduleGc():this.#r.remove(this))}continue(){return this.#o?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#o=(0,o.createRetryer)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):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.#r.canRun(this)});let i="pending"===this.state.status,a=!this.#o.canStart();try{if(i)t();else{this.#i({type:"pending",variables:e,isPaused:a}),this.#r.config.onMutate&&await this.#r.config.onMutate(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#i({type:"pending",context:t,variables:e,isPaused:a})}let o=await this.#o.start();return await this.#r.config.onSuccess?.(o,e,this.state.context,this,r),await this.options.onSuccess?.(o,e,this.state.context,r),await this.#r.config.onSettled?.(o,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(o,null,e,this.state.context,r),this.#i({type:"success",data:o}),o}catch(t){try{await this.#r.config.onError?.(t,e,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,r)}catch(e){Promise.reject(e)}try{await this.#r.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,r)}catch(e){Promise.reject(e)}throw this.#i({type:"error",error:t}),t}finally{this.#r.runNext(this)}}#i(e){this.state=(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.notifyManager.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function a(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}e.s(["Mutation",0,i,"getDefaultState",0,a])},95468,e=>{"use strict";let t=(0,e.i(75254).default)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["CheckCircle2",0,t],95468)},63209,e=>{"use strict";let t=(0,e.i(75254).default)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["AlertCircle",0,t],63209)},37727,e=>{"use strict";let t=(0,e.i(75254).default)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],37727)},80809,e=>{"use strict";var t=e.i(43476),r=e.i(71645),o=e.i(95468),i=e.i(63209),a=e.i(37727);e.i(69530);var n=e.i(2942);let s=(0,r.createContext)(null),l=0;function c({item:e,meta:o,dismissLabel:i,onDismiss:n}){let{Icon:s,color:l,title:u}=o,[d,h]=(0,r.useState)(100),p=(0,r.useRef)(!1);return(0,r.useEffect)(()=>{let e=0,t=performance.now(),r=requestAnimationFrame(function o(i){(p.current||(e+=i-t),t=i,h(Math.max(0,100-e/4500*100)),e>=4500)?n():r=requestAnimationFrame(o)});return()=>cancelAnimationFrame(r)},[n]),(0,t.jsxs)("div",{role:"status",onMouseEnter:()=>{p.current=!0},onMouseLeave:()=>{p.current=!1},className:"pointer-events-auto relative flex items-start gap-3 overflow-hidden rounded-lg border border-border bg-surface py-3 pl-4 pr-3",style:{boxShadow:"var(--shadow-raised)",borderLeft:`3px solid ${l}`,animation:"toast-in 200ms var(--ease-out)"},children:[(0,t.jsx)(s,{size:20,"aria-hidden":!0,className:"mt-px shrink-0",style:{color:l}}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-text",children:u}),(0,t.jsx)("div",{className:"mt-0.5 break-words text-sm leading-snug text-text-muted",children:e.message})]}),(0,t.jsx)("button",{type:"button","aria-label":i,onClick:n,className:"-mr-1 -mt-1 flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-text-muted transition-colors hover:bg-elevated hover:text-text",children:(0,t.jsx)(a.X,{size:15,"aria-hidden":!0})}),(0,t.jsx)("span",{className:"absolute bottom-0 left-0 h-0.5",style:{width:`${d}%`,backgroundColor:l,opacity:.5},"aria-hidden":!0})]})}e.s(["ToastProvider",0,function({children:e}){let{t:a}=(0,n.useTranslation)(),u={ok:{Icon:o.CheckCircle2,color:"var(--color-success)",title:a.common.success},error:{Icon:i.AlertCircle,color:"var(--color-danger)",title:a.common.error}},[d,h]=(0,r.useState)([]),p=(0,r.useCallback)(e=>h(t=>t.filter(t=>t.id!==e)),[]),x=(0,r.useCallback)((e,t="ok")=>{let r=l++;h(o=>[...o,{id:r,message:e,tone:t}])},[]),m=(0,r.useMemo)(()=>({toast:x}),[x]);return(0,t.jsxs)(s.Provider,{value:m,children:[e,(0,t.jsx)("div",{className:"pointer-events-none fixed bottom-5 right-5 z-50 flex w-[22rem] max-w-[calc(100vw-2.5rem)] flex-col gap-2.5",children:d.map(e=>(0,t.jsx)(c,{item:e,meta:u[e.tone],dismissLabel:a.common.dismiss,onDismiss:()=>p(e.id)},e.id))})]})},"useToast",0,function(){let e=(0,r.useContext)(s);if(!e)throw Error("useToast must be used within ToastProvider");return e}])},4552,e=>{"use strict";var t=e.i(71645),r=e.i(14272),o=e.i(40143),i=e.i(15823),a=e.i(19273),n=class extends i.Subscribable{#e;#a=void 0;#n;#s;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#l()}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),(0,a.shallowEqualObjects)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,a.hashKey)(t.mutationKey)!==(0,a.hashKey)(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#l(),this.#c(e)}getCurrentResult(){return this.#a}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#l(),this.#c()}mutate(e,t){return this.#s=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#l(){let e=this.#n?.state??(0,r.getDefaultState)();this.#a={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#c(e){o.notifyManager.batch(()=>{if(this.#s&&this.hasListeners()){let t=this.#a.variables,r=this.#a.context,o={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#s.onSuccess?.(e.data,t,r,o)}catch(e){Promise.reject(e)}try{this.#s.onSettled?.(e.data,null,t,r,o)}catch(e){Promise.reject(e)}}else if(e?.type==="error"){try{this.#s.onError?.(e.error,t,r,o)}catch(e){Promise.reject(e)}try{this.#s.onSettled?.(void 0,e.error,t,r,o)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#a)})})}},s=e.i(12598);function l(e,r){let i=(0,s.useQueryClient)(r),[l]=t.useState(()=>new n(i,e));t.useEffect(()=>{l.setOptions(e)},[l,e]);let c=t.useSyncExternalStore(t.useCallback(e=>l.subscribe(o.notifyManager.batchCalls(e)),[l]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),u=t.useCallback((e,t)=>{l.mutate(e,t).catch(a.noop)},[l]);if(c.error&&(0,a.shouldThrowError)(l.options.throwOnError,[c.error]))throw c.error;return{...c,mutate:u,mutateAsync:c.mutate}}var c=e.i(40273),u=e.i(51981);function d(e,t){e.invalidateQueries({queryKey:["project-files",t]}),e.invalidateQueries({queryKey:["project-git",t]}),e.invalidateQueries({queryKey:["project-changed",t]})}e.s(["useApproveGate",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.approveGate(e),onSuccess:()=>e.invalidateQueries({queryKey:u.QUERY_KEYS.tasks})})},"useAssignProject",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>e.currentlyAssigned?c.orcaClient.unassignProject(e.userId,e.projectId):c.orcaClient.assignProject(e.userId,e.projectId),onSuccess:(t,r)=>e.invalidateQueries({queryKey:["user-projects",r.userId]})})},"useChangePassword",0,function(){return l({mutationFn:e=>c.orcaClient.changePassword(e.currentPassword,e.newPassword)})},"useCleanupAll",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:()=>c.orcaClient.cleanupAll(),onSuccess:()=>e.invalidateQueries()})},"useCloseTask",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.closeTask(e),onSuccess:()=>e.invalidateQueries({queryKey:u.QUERY_KEYS.tasks})})},"useCopyProjectEntry",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.copyProjectEntry(e.id,e.from,e.to),onSuccess:(t,r)=>d(e,r.id)})},"useCreateProject",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.createProject(e),onSuccess:()=>e.invalidateQueries({queryKey:["projects"]})})},"useCreateTask",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.createTask(e),onSuccess:()=>e.invalidateQueries({queryKey:u.QUERY_KEYS.tasks})})},"useCreateUser",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.createUser(e.username,e.password),onSuccess:()=>e.invalidateQueries({queryKey:["users"]})})},"useDeleteMission",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.deleteMission(e),onSuccess:()=>{e.invalidateQueries({queryKey:u.QUERY_KEYS.tasks}),e.invalidateQueries({queryKey:u.QUERY_KEYS.missions}),e.invalidateQueries({queryKey:["mission"]})}})},"useDeleteProjectEntry",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.deleteProjectEntry(e.id,e.path),onSuccess:(t,r)=>d(e,r.id)})},"useDeleteTask",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.deleteTask(e),onSuccess:()=>e.invalidateQueries({queryKey:u.QUERY_KEYS.tasks})})},"useDeleteUser",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.deleteUser(e),onSuccess:()=>e.invalidateQueries({queryKey:["users"]})})},"useDisengage",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.disengageMission(e),onSuccess:()=>e.invalidateQueries({queryKey:u.QUERY_KEYS.missions})})},"useEngage",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.engage(e),onSuccess:()=>e.invalidateQueries({queryKey:u.QUERY_KEYS.missions})})},"useHermesInstall",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.hermesInstall(e),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:r.home?["hermes-status",r.home]:["hermes-status"]})}})},"useInsertPhases",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.insertPhases(e.epicId,e.body),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:u.QUERY_KEYS.tasks}),e.invalidateQueries({queryKey:["mission",r.epicId]}),e.invalidateQueries({queryKey:u.QUERY_KEYS.missions})}})},"useKillSession",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.killSession(e),onSuccess:()=>e.invalidateQueries({queryKey:u.QUERY_KEYS.sessions})})},"useLogin",0,function(){return l({mutationFn:e=>c.orcaClient.login(e.username,e.password)})},"useLogout",0,function(){return l({mutationFn:()=>c.orcaClient.logout()})},"useNewProjectDir",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.newProjectDir(e.id,e.path),onSuccess:(t,r)=>d(e,r.id)})},"useNewProjectFile",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.newProjectFile(e.id,e.path),onSuccess:(t,r)=>d(e,r.id)})},"usePauseMission",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.pauseMission(e),onSuccess:()=>e.invalidateQueries({queryKey:u.QUERY_KEYS.missions})})},"usePlanTask",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.planTask(e),onSuccess:()=>{e.invalidateQueries({queryKey:u.QUERY_KEYS.tasks}),e.invalidateQueries({queryKey:u.QUERY_KEYS.missions})}})},"useRemoveProject",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.removeProject(e),onSuccess:()=>e.invalidateQueries({queryKey:["projects"]})})},"useRenameProjectEntry",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.renameProjectEntry(e.id,e.from,e.to),onSuccess:(t,r)=>d(e,r.id)})},"useResumeMission",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.resumeMission(e),onSuccess:()=>e.invalidateQueries({queryKey:u.QUERY_KEYS.missions})})},"useSendInput",0,function(){return l({mutationFn:e=>c.orcaClient.sendKeys(e.name,e.keys)})},"useSetTaskExec",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.setTaskExec(e.id,e.exec),onSuccess:()=>e.invalidateQueries({queryKey:u.QUERY_KEYS.tasks})})},"useSetTaskStatus",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.setTaskStatus(e.id,e.status),onSuccess:()=>e.invalidateQueries({queryKey:u.QUERY_KEYS.tasks})})},"useSpawn",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.spawn(e),onSuccess:()=>{e.invalidateQueries({queryKey:u.QUERY_KEYS.tasks}),e.invalidateQueries({queryKey:u.QUERY_KEYS.sessions})}})},"useUpdateConfig",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.updateConfig(e),onSuccess:()=>e.invalidateQueries({queryKey:u.QUERY_KEYS.config})})},"useUpdateMe",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.updateMe(e),onSuccess:()=>e.invalidateQueries({queryKey:["me"]})})},"useUpdateProject",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.updateProject(e.id,{path:e.path,notes:e.notes}),onSuccess:()=>e.invalidateQueries({queryKey:["projects"]})})},"useUpdateTask",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.updateTask(e.id,e.patch),onSuccess:()=>e.invalidateQueries({queryKey:u.QUERY_KEYS.tasks})})},"useUpdateUser",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.updateUser(e.id,e.patch),onSuccess:()=>{e.invalidateQueries({queryKey:["users"]}),e.invalidateQueries({queryKey:["me"]})}})},"useUploadAvatar",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.uploadAvatar(e),onSuccess:()=>e.invalidateQueries({queryKey:["me"]})})},"useWriteProjectFile",0,function(){let e=(0,s.useQueryClient)();return l({mutationFn:e=>c.orcaClient.writeProjectFile(e.id,e.path,e.content),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:["project-file",r.id,r.path]}),e.invalidateQueries({queryKey:["project-git",r.id]})}})}],4552)},1206,e=>{"use strict";var t=e.i(43476);let r=(0,e.i(71645).forwardRef)(function({className:e="",...r},o){let i=e.trim();return(0,t.jsx)("input",{ref:o,className:`h-9 w-full rounded-md border border-border bg-surface px-3 text-sm text-text placeholder:text-text-muted transition-colors focus:border-accent focus:outline-none disabled:opacity-40 disabled:cursor-not-allowed${i?` ${i}`:""}`,...r})});e.s(["Input",0,r])},90272,e=>{"use strict";let t=(0,e.i(75254).default)("FolderGit2",[["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"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);e.s(["FolderGit2",0,t],90272)},18566,(e,t,r)=>{t.exports=e.r(76562)},84981,e=>{"use strict";let t=(0,e.i(75254).default)("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);e.s(["default",0,t])},55436,e=>{"use strict";let t=(0,e.i(75254).default)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);e.s(["Search",0,t],55436)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,26178,e=>{"use strict";var t=e.i(43476);e.s(["ModuleShell",0,function({moduleId:e,children:s}){return(0,t.jsx)("section",{"data-module":e,className:"module-root flex flex-col gap-4",children:s})}])},44375,e=>{"use strict";var t=e.i(43476),s=e.i(76525);e.i(69530);var a=e.i(2942);e.s(["EmptyState",0,function({title:e,description:s,icon:a,action:l}){return(0,t.jsxs)("div",{className:"flex animate-fade-up flex-col items-center justify-center gap-3 py-14 text-center",children:[a?(0,t.jsx)(a,{size:28,strokeWidth:1.25,className:"text-text-muted/40","aria-hidden":!0}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("p",{className:"text-sm uppercase tracking-wide text-text",children:e}),s&&(0,t.jsx)("p",{className:"text-xs text-text-muted",children:s})]}),l]})},"ErrorState",0,function({message:e,onRetry:l}){let{t:i}=(0,a.useTranslation)();return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-12 text-center",children:[(0,t.jsx)("p",{className:"text-sm text-accent",children:e}),l&&(0,t.jsx)(s.Button,{onClick:l,children:i.common.retry})]})},"LoadingState",0,function({label:e,variant:s="list"}){let{t:l}=(0,a.useTranslation)();return e?(0,t.jsx)("div",{className:"flex items-center justify-center py-12 font-mono text-xs text-text-muted animate-pulse",children:e}):"cards"===s?(0,t.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3","aria-busy":"true","aria-label":l.common.loading,children:[0,1,2,3,4,5].map(e=>(0,t.jsxs)("div",{className:"flex flex-col gap-2.5 rounded-lg border border-border bg-surface p-3",style:{boxShadow:"var(--shadow-card)"},children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)("div",{className:"skeleton h-9 w-9 rounded-lg"}),(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-1.5",children:[(0,t.jsx)("div",{className:"skeleton h-3.5 w-2/3 rounded"}),(0,t.jsx)("div",{className:"skeleton h-3 w-1/3 rounded"})]})]}),(0,t.jsx)("div",{className:"skeleton h-6 w-full rounded-md"})]},e))}):"kanban"===s?(0,t.jsx)("div",{className:"flex gap-3 overflow-hidden","aria-busy":"true","aria-label":l.common.loading,children:[0,1,2,3,4].map(e=>(0,t.jsxs)("div",{className:"flex min-w-[14rem] flex-1 flex-col gap-2 rounded-lg border border-border bg-surface p-2",children:[(0,t.jsx)("div",{className:"skeleton h-3 w-20 rounded"}),[0,1,2].map(e=>(0,t.jsx)("div",{className:"skeleton h-12 w-full rounded-md"},e))]},e))}):(0,t.jsx)("div",{className:"flex flex-col gap-2.5 py-2","aria-busy":"true","aria-label":l.common.loading,children:[88,72,80,64].map((e,s)=>(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"skeleton h-4 w-4 rounded-md"}),(0,t.jsx)("div",{className:"skeleton h-3.5 rounded",style:{width:`${e}%`}})]},s))})}])},51509,e=>{"use strict";var t=e.i(43476);e.s(["ModuleHeader",0,function({title:e,count:s,icon:a,children:l}){return(0,t.jsxs)("div",{className:"z-20 -mx-4 -mt-4 mb-5 flex flex-col gap-2 border-b border-border bg-bg px-4 py-3 md:sticky md:top-0 md:flex-row md:flex-wrap md:items-center md:gap-x-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[a?(0,t.jsx)(a,{size:16,className:"shrink-0 text-text-muted","aria-hidden":!0}):null,(0,t.jsx)("h1",{className:"text-base font-semibold tracking-tight text-text",children:e}),void 0!==s?(0,t.jsx)("span",{className:"rounded-full bg-elevated px-2 py-0.5 font-mono text-[11px] text-text-muted",children:s}):null]}),l?(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-2 md:ml-auto",children:l}):null]})}])},81418,e=>{"use strict";let t=(0,e.i(75254).default)("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["ShieldCheck",0,t],81418)},58524,e=>{"use strict";let t=(0,e.i(75254).default)("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);e.s(["Link2",0,t],58524)},3116,e=>{"use strict";let t=(0,e.i(75254).default)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);e.s(["Clock",0,t],3116)},31343,e=>{"use strict";let t=(0,e.i(75254).default)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);e.s(["Play",0,t],31343)},88508,e=>{"use strict";var t=e.i(24877);e.s(["formatTaskTime",0,function(e,s,a){if(!e)return{label:"",title:""};let l=(0,t.parseTs)(e);if(null==l)return{label:e,title:e};let i=new Date(l).toLocaleString(a,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),r=s-l;if(r<864e5){if(r<0)return{label:"0s",title:i};let e=Math.floor(r/1e3);if(e<60)return{label:`${e}s`,title:i};let t=Math.floor(e/60);if(t<60)return{label:`${t}m`,title:i};let s=Math.floor(t/60);return{label:`${s}h`,title:i}}return{label:new Date(l).toLocaleString(a,{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"}),title:i}}])},67240,e=>{"use strict";let t=(0,e.i(75254).default)("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,t],67240)},16116,e=>{"use strict";var t=e.i(43476),s=e.i(26178),a=e.i(51737),l=e.i(81418),i=e.i(9912),r=e.i(31343),n=e.i(67240),d=e.i(58524),c=e.i(3116),o=e.i(51981),x=e.i(4552),m=e.i(40273),u=e.i(88508),h=e.i(51509),p=e.i(76525),f=e.i(44375),g=e.i(80809);e.i(69530);var j=e.i(2942);function b(){let{t:e,locale:s}=(0,j.useTranslation)(),b=(0,o.useEscalations)(),k=(0,x.useSetTaskStatus)(),N=(0,x.useResumeMission)(),{toast:y}=(0,g.useToast)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.ModuleHeader,{title:e.escalations.title,count:b.length,icon:a.ShieldAlert}),0===b.length?(0,t.jsx)(f.EmptyState,{title:e.escalations.empty,description:e.escalations.emptyDesc,icon:l.ShieldCheck}):(0,t.jsx)("div",{className:"flex flex-col gap-3",children:b.map(l=>{let o=(0,u.formatTaskTime)(l.ts,Date.now(),s);return(0,t.jsxs)("article",{className:"flex flex-col gap-3 rounded-lg border border-warning/40 bg-warning/[0.05] p-4",style:{boxShadow:"var(--shadow-card)"},children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg border border-warning/40 bg-warning/10",children:(0,t.jsx)(a.ShieldAlert,{size:20,className:"text-warning","aria-hidden":!0})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h2",{className:"truncate text-sm font-semibold text-text",children:l.title}),(0,t.jsxs)("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 font-mono text-[11px] text-text-muted",children:[l.epicId?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Rocket,{size:11,className:"shrink-0","aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate",children:l.epicId})]}):null,o.label?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"opacity-50",children:"·"}),(0,t.jsx)(c.Clock,{size:11,className:"shrink-0","aria-hidden":!0}),(0,t.jsx)("span",{title:o.title,children:o.label})]}):null]})]})]}),(0,t.jsxs)("div",{className:"rounded-md border border-border bg-elevated p-3",children:[(0,t.jsx)("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-wide text-text-muted",children:e.escalations.rationale}),(0,t.jsx)("p",{className:"whitespace-pre-wrap text-sm leading-relaxed text-text",children:l.rationale||e.escalations.noReason})]}),l.blocked.length>0?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-text-muted",children:e.escalations.blockedBy}),(0,t.jsx)("ul",{className:"flex flex-col gap-1",children:l.blocked.map(e=>(0,t.jsxs)("li",{className:"flex items-center gap-2 text-xs text-text",children:[(0,t.jsx)(d.Link2,{size:12,className:"shrink-0 text-text-muted","aria-hidden":!0}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.title})]},e.id))})]}):null,(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[(0,t.jsx)(p.Button,{variant:"ghost",icon:n.RotateCcw,onClick:()=>{k.mutate({id:l.taskId,status:"open"},{onSuccess:()=>{l.epicId&&
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,26178,e=>{"use strict";var t=e.i(43476);e.s(["ModuleShell",0,function({moduleId:e,children:s}){return(0,t.jsx)("section",{"data-module":e,className:"module-root flex flex-col gap-4",children:s})}])},44375,e=>{"use strict";var t=e.i(43476),s=e.i(76525);e.i(69530);var a=e.i(2942);e.s(["EmptyState",0,function({title:e,description:s,icon:a,action:l}){return(0,t.jsxs)("div",{className:"flex animate-fade-up flex-col items-center justify-center gap-3 py-14 text-center",children:[a?(0,t.jsx)(a,{size:28,strokeWidth:1.25,className:"text-text-muted/40","aria-hidden":!0}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("p",{className:"text-sm uppercase tracking-wide text-text",children:e}),s&&(0,t.jsx)("p",{className:"text-xs text-text-muted",children:s})]}),l]})},"ErrorState",0,function({message:e,onRetry:l}){let{t:i}=(0,a.useTranslation)();return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-12 text-center",children:[(0,t.jsx)("p",{className:"text-sm text-accent",children:e}),l&&(0,t.jsx)(s.Button,{onClick:l,children:i.common.retry})]})},"LoadingState",0,function({label:e,variant:s="list"}){let{t:l}=(0,a.useTranslation)();return e?(0,t.jsx)("div",{className:"flex items-center justify-center py-12 font-mono text-xs text-text-muted animate-pulse",children:e}):"cards"===s?(0,t.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3","aria-busy":"true","aria-label":l.common.loading,children:[0,1,2,3,4,5].map(e=>(0,t.jsxs)("div",{className:"flex flex-col gap-2.5 rounded-lg border border-border bg-surface p-3",style:{boxShadow:"var(--shadow-card)"},children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)("div",{className:"skeleton h-9 w-9 rounded-lg"}),(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-1.5",children:[(0,t.jsx)("div",{className:"skeleton h-3.5 w-2/3 rounded"}),(0,t.jsx)("div",{className:"skeleton h-3 w-1/3 rounded"})]})]}),(0,t.jsx)("div",{className:"skeleton h-6 w-full rounded-md"})]},e))}):"kanban"===s?(0,t.jsx)("div",{className:"flex gap-3 overflow-hidden","aria-busy":"true","aria-label":l.common.loading,children:[0,1,2,3,4].map(e=>(0,t.jsxs)("div",{className:"flex min-w-[14rem] flex-1 flex-col gap-2 rounded-lg border border-border bg-surface p-2",children:[(0,t.jsx)("div",{className:"skeleton h-3 w-20 rounded"}),[0,1,2].map(e=>(0,t.jsx)("div",{className:"skeleton h-12 w-full rounded-md"},e))]},e))}):(0,t.jsx)("div",{className:"flex flex-col gap-2.5 py-2","aria-busy":"true","aria-label":l.common.loading,children:[88,72,80,64].map((e,s)=>(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"skeleton h-4 w-4 rounded-md"}),(0,t.jsx)("div",{className:"skeleton h-3.5 rounded",style:{width:`${e}%`}})]},s))})}])},51509,e=>{"use strict";var t=e.i(43476);e.s(["ModuleHeader",0,function({title:e,count:s,icon:a,children:l}){return(0,t.jsxs)("div",{className:"z-20 -mx-4 -mt-4 mb-5 flex flex-col gap-2 border-b border-border bg-bg px-4 py-3 md:sticky md:top-0 md:flex-row md:flex-wrap md:items-center md:gap-x-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[a?(0,t.jsx)(a,{size:16,className:"shrink-0 text-text-muted","aria-hidden":!0}):null,(0,t.jsx)("h1",{className:"text-base font-semibold tracking-tight text-text",children:e}),void 0!==s?(0,t.jsx)("span",{className:"rounded-full bg-elevated px-2 py-0.5 font-mono text-[11px] text-text-muted",children:s}):null]}),l?(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-2 md:ml-auto",children:l}):null]})}])},81418,e=>{"use strict";let t=(0,e.i(75254).default)("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["ShieldCheck",0,t],81418)},58524,e=>{"use strict";let t=(0,e.i(75254).default)("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);e.s(["Link2",0,t],58524)},3116,e=>{"use strict";let t=(0,e.i(75254).default)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);e.s(["Clock",0,t],3116)},31343,e=>{"use strict";let t=(0,e.i(75254).default)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);e.s(["Play",0,t],31343)},88508,e=>{"use strict";var t=e.i(24877);e.s(["formatTaskTime",0,function(e,s,a){if(!e)return{label:"",title:""};let l=(0,t.parseTs)(e);if(null==l)return{label:e,title:e};let i=new Date(l).toLocaleString(a,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),r=s-l;if(r<864e5){if(r<0)return{label:"0s",title:i};let e=Math.floor(r/1e3);if(e<60)return{label:`${e}s`,title:i};let t=Math.floor(e/60);if(t<60)return{label:`${t}m`,title:i};let s=Math.floor(t/60);return{label:`${s}h`,title:i}}return{label:new Date(l).toLocaleString(a,{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"}),title:i}}])},67240,e=>{"use strict";let t=(0,e.i(75254).default)("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,t],67240)},16116,e=>{"use strict";var t=e.i(43476),s=e.i(26178),a=e.i(51737),l=e.i(81418),i=e.i(9912),r=e.i(31343),n=e.i(67240),d=e.i(58524),c=e.i(3116),o=e.i(51981),x=e.i(4552),m=e.i(40273),u=e.i(88508),h=e.i(51509),p=e.i(76525),f=e.i(44375),g=e.i(80809);e.i(69530);var j=e.i(2942);function b(){let{t:e,locale:s}=(0,j.useTranslation)(),b=(0,o.useEscalations)(),k=(0,x.useSetTaskStatus)(),N=(0,x.useApproveGate)(),v=(0,x.useResumeMission)(),{toast:y}=(0,g.useToast)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.ModuleHeader,{title:e.escalations.title,count:b.length,icon:a.ShieldAlert}),0===b.length?(0,t.jsx)(f.EmptyState,{title:e.escalations.empty,description:e.escalations.emptyDesc,icon:l.ShieldCheck}):(0,t.jsx)("div",{className:"flex flex-col gap-3",children:b.map(l=>{let o=(0,u.formatTaskTime)(l.ts,Date.now(),s);return(0,t.jsxs)("article",{className:"flex flex-col gap-3 rounded-lg border border-warning/40 bg-warning/[0.05] p-4",style:{boxShadow:"var(--shadow-card)"},children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg border border-warning/40 bg-warning/10",children:(0,t.jsx)(a.ShieldAlert,{size:20,className:"text-warning","aria-hidden":!0})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h2",{className:"truncate text-sm font-semibold text-text",children:l.title}),(0,t.jsxs)("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 font-mono text-[11px] text-text-muted",children:[l.epicId?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Rocket,{size:11,className:"shrink-0","aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate",children:l.epicId})]}):null,o.label?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"opacity-50",children:"·"}),(0,t.jsx)(c.Clock,{size:11,className:"shrink-0","aria-hidden":!0}),(0,t.jsx)("span",{title:o.title,children:o.label})]}):null]})]})]}),(0,t.jsxs)("div",{className:"rounded-md border border-border bg-elevated p-3",children:[(0,t.jsx)("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-wide text-text-muted",children:e.escalations.rationale}),(0,t.jsx)("p",{className:"whitespace-pre-wrap text-sm leading-relaxed text-text",children:l.rationale||e.escalations.noReason})]}),l.blocked.length>0?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-text-muted",children:e.escalations.blockedBy}),(0,t.jsx)("ul",{className:"flex flex-col gap-1",children:l.blocked.map(e=>(0,t.jsxs)("li",{className:"flex items-center gap-2 text-xs text-text",children:[(0,t.jsx)(d.Link2,{size:12,className:"shrink-0 text-text-muted","aria-hidden":!0}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.title})]},e.id))})]}):null,(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[(0,t.jsx)(p.Button,{variant:"ghost",icon:n.RotateCcw,onClick:()=>{k.mutate({id:l.taskId,status:"open"},{onSuccess:()=>{l.epicId&&v.mutate(`m-${l.epicId}`,{onError:()=>{}}),y(e.escalations.rerunning)},onError:t=>y((0,m.apiErrorMessage)(t)||e.escalations.actionError,"error")})},disabled:k.isPending,children:e.escalations.rerun}),(0,t.jsx)(p.Button,{variant:"accent",icon:r.Play,onClick:()=>{0!==l.blocked.length&&N.mutate(l.taskId,{onSuccess:()=>{l.epicId&&v.mutate(`m-${l.epicId}`,{onError:()=>{}}),y(e.escalations.approved)},onError:t=>y((0,m.apiErrorMessage)(t)||e.escalations.actionError,"error")})},disabled:0===l.blocked.length||N.isPending,children:e.escalations.approve})]})]},`${l.taskId}-${l.ts}`)})})]})}e.s(["default",0,function(){return(0,t.jsx)(s.ModuleShell,{moduleId:"escalations",children:(0,t.jsx)(b,{})})},"dynamic",0,"force-dynamic"],16116)}]);
|