@nextclaw/ui 0.22.2 → 0.22.3
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/CHANGELOG.md +7 -0
- package/dist/assets/{appearance-settings-page-BLaxNij2.js → appearance-settings-page-Bh_65RFw.js} +1 -1
- package/dist/assets/{channels-list-page-eUVEhukh.js → channels-list-page-Bd3_YlyV.js} +1 -1
- package/dist/assets/{desktop-capabilities-page-FV7xowDx.js → desktop-capabilities-page-CQxp8NvQ.js} +1 -1
- package/dist/assets/{desktop-update-config-BWP2Pr4u.js → desktop-update-config-DsyKUJbp.js} +1 -1
- package/dist/assets/{extensions-Mc3juAVp.js → extensions-C_FUBhUf.js} +1 -1
- package/dist/assets/{index-DIkMNtbu.js → index-C83VUh83.js} +2 -2
- package/dist/assets/{index-CBmwJjwE.css → index-CwCTiMM9.css} +1 -1
- package/dist/assets/{model-config-page-DAseq1vr.js → model-config-page-B_w0J2p1.js} +1 -1
- package/dist/assets/{privacy-settings-page-COFa7LrK.js → privacy-settings-page-D3RzjGyz.js} +1 -1
- package/dist/assets/{providers-config-page-zP-J1Asx.js → providers-config-page-ONfW4tjw.js} +1 -1
- package/dist/assets/remote-DRh0aAHG.js +1 -0
- package/dist/assets/{runtime-config-page-D5KbQ3ue.js → runtime-config-page-CdwKIwZc.js} +1 -1
- package/dist/assets/{search-config-page-Bi9J2kYR.js → search-config-page-C0YgfpcA.js} +1 -1
- package/dist/assets/{secrets-config-page-0MP2MSvq.js → secrets-config-page-Bb28CTv4.js} +1 -1
- package/dist/index.html +10 -2
- package/dist/themes/island/island-atmosphere-7a037243.webp +0 -0
- package/index.html +8 -0
- package/package.json +4 -4
- package/public/themes/island/island-atmosphere-7a037243.webp +0 -0
- package/src/app/styles/island-theme.css +2 -2
- package/dist/assets/remote-EeKMCoyb.js +0 -1
- package/dist/themes/island/island-atmosphere.webp +0 -0
- package/public/themes/island/island-atmosphere.webp +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-ySrvolIe.js","assets/preload-helper-D4M6sveU.js","assets/chunk-HOUHSVGY-DPkq8FCm.js","assets/src-Bw-mzbQb.js","assets/chunk-DseTPa7n.js","assets/chunk-Y2CYZVJY-D1mAU_Po.js","assets/chunk-WYO6CB5R-Dn9To_OI.js","assets/chunk-ICXQ74PX-FAatv5fC.js","assets/dist--ta5rX12.js","assets/chunk-Q4XR5HBZ-DQFeUPxZ.js","assets/chunk-52WLFC77-viIcqj9q.js","assets/line-Cos7PIOj.js","assets/path-10BjdyLh.js","assets/array-BQVzeGRt.js","assets/chunk-7BUUIJ7U-BvydOcm3.js","assets/chunk-C7G6YPKG-DAizzYwr.js","assets/chunk-OGEWGWER-C3jdH3Ty.js","assets/chunk-ZGVPDNZ5-C6YtZDU0.js","assets/rough.esm-DxgC_14r.js","assets/chunk-FWX5IMBZ-D0ksHZZ9.js","assets/chunk-VAUOI2AC-BGvh3yIx.js","assets/chunk-ZIRB5QZD-DMuYtnHF.js","assets/docx-preview-BqwAjrj3.js","assets/jszip.min-8hyJpgpx.js","assets/aiden0z-pptx-renderer.es-Dp2ezlQn.js","assets/doc-browser-y3e2_MXe.js","assets/doc-browser-CKpps-rb.js","assets/dist-WPei0-v8.js","assets/react-BwGMzqXA.js","assets/dist-GWWehc4w.js","assets/createLucideIcon-CLfqNlvk.js","assets/search-BVeIVVGT.js","assets/book-open-DMnwJfVM.js","assets/navigation-link-DI0mOIVl.js","assets/host-capabilities-Tk038i04.js","assets/plus-C6Kx4b6T.js","assets/refresh-cw-DmR6-f9A.js","assets/x-27QFIvUt.js","assets/doc-browser-context-Vx418ptC.js","assets/middleware-DXsbf9xI.js","assets/model-config-page-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-ySrvolIe.js","assets/preload-helper-D4M6sveU.js","assets/chunk-HOUHSVGY-DPkq8FCm.js","assets/src-Bw-mzbQb.js","assets/chunk-DseTPa7n.js","assets/chunk-Y2CYZVJY-D1mAU_Po.js","assets/chunk-WYO6CB5R-Dn9To_OI.js","assets/chunk-ICXQ74PX-FAatv5fC.js","assets/dist--ta5rX12.js","assets/chunk-Q4XR5HBZ-DQFeUPxZ.js","assets/chunk-52WLFC77-viIcqj9q.js","assets/line-Cos7PIOj.js","assets/path-10BjdyLh.js","assets/array-BQVzeGRt.js","assets/chunk-7BUUIJ7U-BvydOcm3.js","assets/chunk-C7G6YPKG-DAizzYwr.js","assets/chunk-OGEWGWER-C3jdH3Ty.js","assets/chunk-ZGVPDNZ5-C6YtZDU0.js","assets/rough.esm-DxgC_14r.js","assets/chunk-FWX5IMBZ-D0ksHZZ9.js","assets/chunk-VAUOI2AC-BGvh3yIx.js","assets/chunk-ZIRB5QZD-DMuYtnHF.js","assets/docx-preview-BqwAjrj3.js","assets/jszip.min-8hyJpgpx.js","assets/aiden0z-pptx-renderer.es-Dp2ezlQn.js","assets/doc-browser-y3e2_MXe.js","assets/doc-browser-CKpps-rb.js","assets/dist-WPei0-v8.js","assets/react-BwGMzqXA.js","assets/dist-GWWehc4w.js","assets/createLucideIcon-CLfqNlvk.js","assets/search-BVeIVVGT.js","assets/book-open-DMnwJfVM.js","assets/navigation-link-DI0mOIVl.js","assets/host-capabilities-Tk038i04.js","assets/plus-C6Kx4b6T.js","assets/refresh-cw-DmR6-f9A.js","assets/x-27QFIvUt.js","assets/doc-browser-context-Vx418ptC.js","assets/middleware-DXsbf9xI.js","assets/model-config-page-B_w0J2p1.js","assets/api-DU3C4HfX.js","assets/loader-circle-DXH2fVRq.js","assets/form-actions-DJlfyLEH.js","assets/skeleton-u2lc3JJg.js","assets/config-hints-nV5HPOvq.js","assets/appearance-settings-page-Bh_65RFw.js","assets/select-DvuHOwPH.js","assets/mcp-marketplace-page-CEr3FgVp.js","assets/confirm-dialog-B539oJpr.js","assets/tag-chip-BI9NffVf.js","assets/search-config-page-C0YgfpcA.js","assets/config-split-page-DON62DcK.js","assets/providers-config-page-ONfW4tjw.js","assets/extensions-C_FUBhUf.js","assets/channels-list-page-Bd3_YlyV.js","assets/runtime-config-page-CdwKIwZc.js","assets/rotate-cw-BUWqEgob.js","assets/save-DdohrEEJ.js","assets/desktop-update-config-DsyKUJbp.js","assets/security-config-CNdun2s-.js","assets/secrets-config-page-Bb28CTv4.js","assets/privacy-settings-page-D3RzjGyz.js","assets/desktop-capabilities-page-CQxp8NvQ.js","assets/mcp-marketplace-page-Dj0xiFAV.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{i as e,n as t,t as n}from"./chunk-DseTPa7n.js";import{A as r,B as i,C as a,D as o,E as s,F as c,H as l,L as u,M as d,N as f,O as p,P as m,R as h,S as g,T as _,V as v,_ as y,a as b,b as x,c as S,f as C,g as w,h as T,i as E,j as D,k as O,n as k,o as A,p as j,r as M,s as N,t as P,v as ee,w as te,x as ne,y as re,z as ie}from"./react-BwGMzqXA.js";import{t as ae}from"./preload-helper-D4M6sveU.js";import{a as oe,c as se,d as ce,f as le,i as ue,l as de,n as fe,o as pe,r as me,s as he,t as ge,u as _e}from"./navigation-link-DI0mOIVl.js";import{$ as ve,$t as ye,A as be,An as F,B as xe,Bt as Se,C as Ce,Cn as we,Ct as Te,D as Ee,Dn as De,Dt as Oe,E as ke,En as Ae,Et as je,F as Me,Fn as Ne,Ft as Pe,Ht as Fe,I as Ie,In as Le,It as I,Jt as Re,L as ze,Ln as Be,Lt as Ve,M as He,N as Ue,Nt as We,O as Ge,On as eee,Ot as Ke,P as qe,Pn as Je,Pt as Ye,Q as Xe,Qt as Ze,R as Qe,Rn as $e,S as et,Sn as tt,St as nt,T as rt,Tn as it,Tt as at,Ut as ot,V as st,Vt as ct,X as lt,Yt as ut,Z as dt,Zt as ft,_ as pt,_n as L,_t as mt,a as ht,an as gt,at as _t,b as vt,bt as yt,c as bt,cn as xt,ct as tee,d as nee,dn as St,dt as Ct,en as wt,et as Tt,fn as R,ft as Et,g as Dt,gn as Ot,gt as kt,h as At,hn as jt,ht as Mt,i as Nt,it as Pt,j as Ft,k as It,kn as Lt,kt as Rt,l as zt,ln as Bt,lt as Vt,m as Ht,mn as Ut,mt as Wt,n as Gt,nn as Kt,nt as qt,o as Jt,on as Yt,ot as Xt,p as Zt,pn as Qt,pt as $t,qt as en,r as tn,rn as nn,rt as rn,s as an,sn as on,st as sn,t as cn,tt as ln,u as un,un as dn,ut as fn,v as pn,vn as z,vt as mn,w as hn,wn as gn,wt as _n,x as vn,xn as yn,xt as bn,y as xn,yn as Sn,yt as Cn,z as wn,zn as Tn,zt as En}from"./api-DU3C4HfX.js";import{C as Dn,S as On,T as kn,_ as An,a as jn,b as Mn,c as Nn,d as Pn,f as Fn,g as In,h as Ln,i as Rn,l as zn,m as Bn,n as Vn,o as ree,p as iee,r as aee,s as oee,u as see,v as Hn,w as Un,x as Wn,y as cee}from"./mcp-marketplace-page-CEr3FgVp.js";import{a as Gn,b as Kn,c as qn,d as Jn,f as Yn,h as Xn,i as Zn,l as Qn,m as $n,o as er,r as tr,s as nr,v as rr,y as ir}from"./dist-WPei0-v8.js";import{C as ar,D as or,E as sr,O as cr,S as lr,T as ur,_ as dr,a as fr,b as pr,c as mr,d as hr,f as gr,g as _r,h as vr,i as yr,l as br,m as xr,n as Sr,o as Cr,p as wr,r as Tr,s as Er,t as Dr,u as Or,v as kr,w as Ar,x as jr,y as Mr}from"./select-DvuHOwPH.js";import{t as Nr}from"./dist-GWWehc4w.js";import{a as Pr,c as Fr,d as Ir,f as Lr,g as Rr,h as zr,i as Br,l as Vr,m as Hr,n as Ur,o as Wr,p as Gr,r as Kr,s as qr,t as Jr,u as Yr}from"./confirm-dialog-B539oJpr.js";import{t as B}from"./createLucideIcon-CLfqNlvk.js";import{C as Xr,D as Zr,E as Qr,O as $r,S as ei,T as ti,_ as ni,a as ri,b as ii,c as ai,d as oi,f as si,g as ci,h as li,i as ui,k as di,l as fi,m as pi,n as mi,o as hi,p as V,r as gi,s as _i,u as vi,v as yi,w as bi,x as xi,y as Si}from"./doc-browser-CKpps-rb.js";import{n as Ci,t as wi}from"./search-BVeIVVGT.js";import{t as Ti}from"./book-open-DMnwJfVM.js";import{t as Ei}from"./loader-circle-DXH2fVRq.js";import{t as Di}from"./plus-C6Kx4b6T.js";import{t as Oi}from"./refresh-cw-DmR6-f9A.js";import{t as ki}from"./x-27QFIvUt.js";import{t as Ai}from"./host-capabilities-Tk038i04.js";import{n as ji,t as Mi}from"./middleware-DXsbf9xI.js";import{t as Ni}from"./skeleton-u2lc3JJg.js";import{_ as Pi,a as Fi,c as Ii,d as Li,g as Ri,h as zi,i as Bi,l as Vi,n as Hi,o as Ui,p as Wi,r as Gi,s as Ki,t as qi,u as Ji,v as Yi}from"./doc-browser-context-Vx418ptC.js";import{t as Xi}from"./tag-chip-BI9NffVf.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Zi=n((e=>{var t=v();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot}));function Qi(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function $i(e,t,n){let r=e.slice(0);return r[t]=n,r}var ea=class extends Tn{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#p(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,Ne.batch(()=>{let e=this.#i,t=this.#f(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!$e(e,n)});!o&&!s||(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(Qi(e,n).forEach(e=>{e.destroy()}),Qi(n,e).forEach(e=>{e.subscribe(t=>{this.#p(e,t)})})),this.#m()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#f(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){return t.map((n,r)=>{let i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(!this.#a||this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=Be(this.#a,t(e))),this.#a}return e}#f(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new Je(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#p(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=$i(this.#t,n,t),this.#m())}#m(){if(this.hasListeners()){let e=this.#a,t=this.#u(this.#t,this.#l);e!==this.#d(t,this.#r?.combine)&&Ne.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},H=e(l(),1);function ta({queries:e,...t},n){let r=F(n),i=eee(),a=De(),o=H.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:`optimistic`,t}),[e,r,i]);o.forEach(e=>{yn(e),gn(e,a,r.getQueryCache().get(e.queryHash))}),Ae(a);let[s]=H.useState(()=>new ea(r,o,t)),[c,l,u]=s.getOptimisticResult(o,t.combine),d=!i&&t.subscribed!==!1;H.useSyncExternalStore(H.useCallback(e=>d?s.subscribe(Ne.batchCalls(e)):Le,[s,d]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),H.useEffect(()=>{s.setQueries(o,t)},[o,t,s]);let f=c.some((e,t)=>we(o[t],e))?c.flatMap((e,t)=>{let n=o[t];return n&&we(n,e)?tt(n,new Je(r,n),a):[]}):[];if(f.length>0)throw Promise.all(f);let p=c.find((e,t)=>{let n=o[t];return n&&it({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(p?.error)throw p.error;return l(u())}var na=B(`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`}]]),ra=B(`AlarmClock`,[[`circle`,{cx:`12`,cy:`13`,r:`8`,key:`3y4lt7`}],[`path`,{d:`M12 9v4l2 2`,key:`1c63tq`}],[`path`,{d:`M5 3 2 6`,key:`18tl5t`}],[`path`,{d:`m22 6-3-3`,key:`1opdir`}],[`path`,{d:`M6.38 18.7 4 21`,key:`17xu3x`}],[`path`,{d:`M17.64 18.67 20 21`,key:`kv2oe2`}]]),ia=B(`Archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),lee=B(`ArrowDown`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),uee=B(`ArrowUpRight`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),aa=B(`ArrowUp`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),dee=B(`Blocks`,[[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`path`,{d:`M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3`,key:`1fpvtg`}]]),fee=B(`BookOpenText`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M16 12h2`,key:`7q9ll5`}],[`path`,{d:`M16 8h2`,key:`msurwy`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}],[`path`,{d:`M6 12h2`,key:`32wvfc`}],[`path`,{d:`M6 8h2`,key:`30oboj`}]]),pee=B(`Bookmark`,[[`path`,{d:`m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z`,key:`1fy3hk`}]]),oa=B(`Bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),mee=B(`Braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),sa=B(`BrainCircuit`,[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M9 13a4.5 4.5 0 0 0 3-4`,key:`10igwf`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M12 13h4`,key:`1ku699`}],[`path`,{d:`M12 18h6a2 2 0 0 1 2 2v1`,key:`105ag5`}],[`path`,{d:`M12 8h8`,key:`1lhi5i`}],[`path`,{d:`M16 8V5a2 2 0 0 1 2-2`,key:`u6izg6`}],[`circle`,{cx:`16`,cy:`13`,r:`.5`,key:`ry7gng`}],[`circle`,{cx:`18`,cy:`3`,r:`.5`,key:`1aiba7`}],[`circle`,{cx:`20`,cy:`21`,r:`.5`,key:`yhc1fs`}],[`circle`,{cx:`20`,cy:`8`,r:`.5`,key:`1e43v0`}]]),ca=B(`Brain`,[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z`,key:`ep3f8r`}],[`path`,{d:`M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4`,key:`1p4c4q`}],[`path`,{d:`M17.599 6.5a3 3 0 0 0 .399-1.375`,key:`tmeiqw`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M19.938 10.5a4 4 0 0 1 .585.396`,key:`1qfode`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M19.967 17.484A4 4 0 0 1 18 18`,key:`159ez6`}]]),hee=B(`BriefcaseBusiness`,[[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2`,key:`1ksdt3`}],[`path`,{d:`M22 13a18.15 18.15 0 0 1-20 0`,key:`12hx5q`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]),la=B(`CalendarClock`,[[`path`,{d:`M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5`,key:`1osxxc`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M3 10h5`,key:`r794hk`}],[`path`,{d:`M17.5 17.5 16 16.3V14`,key:`akvzfd`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]),ua=B(`CalendarDays`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M16 18h.01`,key:`kzsmim`}]]),gee=B(`ChartNoAxesColumnIncreasing`,[[`line`,{x1:`12`,x2:`12`,y1:`20`,y2:`10`,key:`1vz5eb`}],[`line`,{x1:`18`,x2:`18`,y1:`20`,y2:`4`,key:`cun8e5`}],[`line`,{x1:`6`,x2:`6`,y1:`20`,y2:`16`,key:`hq0ia6`}]]),_ee=B(`ChartNoAxesColumn`,[[`line`,{x1:`18`,x2:`18`,y1:`20`,y2:`10`,key:`1xfpm4`}],[`line`,{x1:`12`,x2:`12`,y1:`20`,y2:`4`,key:`be30l9`}],[`line`,{x1:`6`,x2:`6`,y1:`20`,y2:`14`,key:`1r4le6`}]]),da=B(`ChevronLeft`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),fa=B(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),vee=B(`ChevronsUpDown`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),pa=B(`ChevronsUp`,[[`path`,{d:`m17 11-5-5-5 5`,key:`e8nh98`}],[`path`,{d:`m17 18-5-5-5 5`,key:`2avn1x`}]]),ma=B(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ha=B(`CircleDashed`,[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]),ga=B(`CircleHelp`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),_a=B(`CirclePause`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`10`,x2:`10`,y1:`15`,y2:`9`,key:`c1nkhi`}],[`line`,{x1:`14`,x2:`14`,y1:`15`,y2:`9`,key:`h65svq`}]]),va=B(`CirclePlay`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polygon`,{points:`10 8 16 12 10 16 10 8`,key:`1cimsy`}]]),ya=B(`Clock3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16.5 12`,key:`1aq6pp`}]]),ba=B(`Clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]),xa=B(`Cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),Sa=B(`CodeXml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),Ca=B(`Command`,[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]),wa=B(`Compass`,[[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Ta=B(`Copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Ea=B(`CornerDownRight`,[[`polyline`,{points:`15 10 20 15 15 20`,key:`1q7qjw`}],[`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`,key:`z08zvw`}]]),Da=B(`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`}]]),Oa=B(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]),ka=B(`Earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Aa=B(`Ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),ja=B(`Expand`,[[`path`,{d:`m21 21-6-6m6 6v-4.8m0 4.8h-4.8`,key:`1c15vz`}],[`path`,{d:`M3 16.2V21m0 0h4.8M3 21l6-6`,key:`1fsnz2`}],[`path`,{d:`M21 7.8V3m0 0h-4.8M21 3l-6 6`,key:`hawz9i`}],[`path`,{d:`M3 7.8V3m0 0h4.8M3 3l6 6`,key:`u9ee12`}]]),Ma=B(`Eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Na=B(`FileArchive`,[[`path`,{d:`M10 12v-1`,key:`v7bkov`}],[`path`,{d:`M10 18v-2`,key:`1cjy8d`}],[`path`,{d:`M10 7V6`,key:`dljcrl`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01`,key:`gkbcor`}],[`circle`,{cx:`10`,cy:`20`,r:`2`,key:`1xzdoj`}]]),Pa=B(`FileAudio2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v2`,key:`17k7jt`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`circle`,{cx:`3`,cy:`17`,r:`1`,key:`vo6nti`}],[`path`,{d:`M2 17v-3a4 4 0 0 1 8 0v3`,key:`1ggdre`}],[`circle`,{cx:`9`,cy:`17`,r:`1`,key:`bc1fq4`}]]),Fa=B(`FileCode2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`m5 12-3 3 3 3`,key:`oke12k`}],[`path`,{d:`m9 18 3-3-3-3`,key:`112psh`}]]),Ia=B(`FileImage`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),La=B(`FileJson2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M4 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`fq0c9t`}],[`path`,{d:`M8 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`4gibmv`}]]),Ra=B(`FilePlus2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M3 15h6`,key:`4e2qda`}],[`path`,{d:`M6 12v6`,key:`1u72j0`}]]),za=B(`FileSpreadsheet`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]),Ba=B(`FileVideo2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`rect`,{width:`8`,height:`6`,x:`2`,y:`12`,rx:`1`,key:`1a6c1e`}],[`path`,{d:`m10 15.5 4 2.5v-6l-4 2.5`,key:`t7cp39`}]]),Va=B(`File`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}]]),Ha=B(`Files`,[[`path`,{d:`M20 7h-3a2 2 0 0 1-2-2V2`,key:`x099mo`}],[`path`,{d:`M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z`,key:`18t6ie`}],[`path`,{d:`M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8`,key:`1nja0z`}]]),Ua=B(`FolderKanban`,[[`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`,key:`1fr9dc`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M12 10v2`,key:`hh53o1`}],[`path`,{d:`M16 10v6`,key:`1d6xys`}]]),Wa=B(`FolderOpen`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Ga=B(`FolderPlus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Ka=B(`FolderTree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),qa=B(`FolderUp`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}],[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`m9 13 3-3 3 3`,key:`1pxg3c`}]]),Ja=B(`FolderX`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}],[`path`,{d:`m9.5 10.5 5 5`,key:`ra9qjz`}],[`path`,{d:`m14.5 10.5-5 5`,key:`l2rkpq`}]]),Ya=B(`Folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Xa=B(`Forward`,[[`polyline`,{points:`15 17 20 12 15 7`,key:`1w3sku`}],[`path`,{d:`M4 18v-2a4 4 0 0 1 4-4h12`,key:`jmiej9`}]]),Za=B(`Gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),Qa=B(`GitBranch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),$a=B(`Globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),eo=B(`Grid3x3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),to=B(`HardDrive`,[[`line`,{x1:`22`,x2:`2`,y1:`12`,y2:`12`,key:`1y58io`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}],[`line`,{x1:`6`,x2:`6.01`,y1:`16`,y2:`16`,key:`sgf278`}],[`line`,{x1:`10`,x2:`10.01`,y1:`16`,y2:`16`,key:`1l4acy`}]]),no=B(`Heart`,[[`path`,{d:`M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z`,key:`c3ymky`}]]),ro=B(`House`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`1d0kgt`}]]),io=B(`Image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),ao=B(`Inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),oo=B(`KeyRound`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),so=B(`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`}]]),co=B(`Laptop`,[[`path`,{d:`M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16`,key:`tarvll`}]]),lo=B(`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`}]]),uo=B(`LayoutGrid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),fo=B(`Lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),po=B(`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`}]]),mo=B(`ListCollapse`,[[`path`,{d:`m3 10 2.5-2.5L3 5`,key:`i6eama`}],[`path`,{d:`m3 19 2.5-2.5L3 14`,key:`w2gmor`}],[`path`,{d:`M10 6h11`,key:`c7qv1k`}],[`path`,{d:`M10 12h11`,key:`6m4ad9`}],[`path`,{d:`M10 18h11`,key:`11hvi2`}]]),ho=B(`ListTodo`,[[`rect`,{x:`3`,y:`5`,width:`6`,height:`6`,rx:`1`,key:`1defrl`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`M13 6h8`,key:`15sg57`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 18h8`,key:`oe0vm4`}]]),go=B(`ListTree`,[[`path`,{d:`M21 12h-8`,key:`1bmf0i`}],[`path`,{d:`M21 6H8`,key:`1pqkrb`}],[`path`,{d:`M21 18h-8`,key:`1tm79t`}],[`path`,{d:`M3 6v4c0 1.1.9 2 2 2h3`,key:`1ywdgy`}],[`path`,{d:`M3 10v6c0 1.1.9 2 2 2h3`,key:`2wc746`}]]),_o=B(`LocateFixed`,[[`line`,{x1:`2`,x2:`5`,y1:`12`,y2:`12`,key:`bvdh0s`}],[`line`,{x1:`19`,x2:`22`,y1:`12`,y2:`12`,key:`1tbv5k`}],[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`5`,key:`11lu5j`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`,key:`x3vr5v`}],[`circle`,{cx:`12`,cy:`12`,r:`7`,key:`fim9np`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),vo=B(`LogOut`,[[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}],[`polyline`,{points:`16 17 21 12 16 7`,key:`1gabdz`}],[`line`,{x1:`21`,x2:`9`,y1:`12`,y2:`12`,key:`1uyos4`}]]),yo=B(`Maximize2`,[[`polyline`,{points:`15 3 21 3 21 9`,key:`mznyad`}],[`polyline`,{points:`9 21 3 21 3 15`,key:`1avn1i`}],[`line`,{x1:`21`,x2:`14`,y1:`3`,y2:`10`,key:`ota7mn`}],[`line`,{x1:`3`,x2:`10`,y1:`21`,y2:`14`,key:`1atl0r`}]]),bo=B(`MessageCircle`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}]]),xo=B(`MessageSquarePlus`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}],[`path`,{d:`M12 7v6`,key:`lw1j43`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}]]),So=B(`MessageSquareQuote`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}],[`path`,{d:`M8 12a2 2 0 0 0 2-2V8H8`,key:`1jfesj`}],[`path`,{d:`M14 12a2 2 0 0 0 2-2V8h-2`,key:`1dq9mh`}]]),Co=B(`MessageSquareText`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}],[`path`,{d:`M13 8H7`,key:`14i4kc`}],[`path`,{d:`M17 12H7`,key:`16if0g`}]]),wo=B(`MessageSquare`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}]]),To=B(`MessagesSquare`,[[`path`,{d:`M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z`,key:`p1xzt8`}],[`path`,{d:`M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1`,key:`1cx29u`}]]),Eo=B(`Minimize2`,[[`polyline`,{points:`4 14 10 14 10 20`,key:`11kfnr`}],[`polyline`,{points:`20 10 14 10 14 4`,key:`rlmsce`}],[`line`,{x1:`14`,x2:`21`,y1:`10`,y2:`3`,key:`o5lafz`}],[`line`,{x1:`3`,x2:`10`,y1:`21`,y2:`14`,key:`1atl0r`}]]),Do=B(`Minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Oo=B(`MonitorCog`,[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m15.2 4.9-.9-.4`,key:`12wd2u`}],[`path`,{d:`m15.2 7.1-.9.4`,key:`1r2vl7`}],[`path`,{d:`m16.9 3.2-.4-.9`,key:`3zbo91`}],[`path`,{d:`m16.9 8.8-.4.9`,key:`1qr2dn`}],[`path`,{d:`m19.5 2.3-.4.9`,key:`1rjrkq`}],[`path`,{d:`m19.5 9.7-.4-.9`,key:`heryx5`}],[`path`,{d:`m21.7 4.5-.9.4`,key:`17fqt1`}],[`path`,{d:`m21.7 7.5-.9-.4`,key:`14zyni`}],[`path`,{d:`M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7`,key:`1tnzv8`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}]]),ko=B(`Monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),Ao=B(`Newspaper`,[[`path`,{d:`M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2`,key:`7pis2x`}],[`path`,{d:`M18 14h-8`,key:`sponae`}],[`path`,{d:`M15 18h-5`,key:`95g1m2`}],[`path`,{d:`M10 6h8v4h-8V6Z`,key:`smlsk5`}]]),jo=B(`NotebookText`,[[`path`,{d:`M2 6h4`,key:`aawbzj`}],[`path`,{d:`M2 10h4`,key:`l0bgd4`}],[`path`,{d:`M2 14h4`,key:`1gsvsf`}],[`path`,{d:`M2 18h4`,key:`1bu2t1`}],[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,key:`1nb95v`}],[`path`,{d:`M9.5 8h5`,key:`11mslq`}],[`path`,{d:`M9.5 12H16`,key:`ktog6x`}],[`path`,{d:`M9.5 16H14`,key:`p1seyn`}]]),Mo=B(`PackagePlus`,[[`path`,{d:`M16 16h6`,key:`100bgy`}],[`path`,{d:`M19 13v6`,key:`85cyf1`}],[`path`,{d:`M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14`,key:`e7tb2h`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`12`,key:`a4e8g8`}]]),No=B(`Palette`,[[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`path`,{d:`M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z`,key:`12rzf8`}]]),Po=B(`PanelLeftClose`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),Fo=B(`PanelLeftDashed`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 14v1`,key:`askpd8`}],[`path`,{d:`M9 19v2`,key:`16tejx`}],[`path`,{d:`M9 3v2`,key:`1noubl`}],[`path`,{d:`M9 9v1`,key:`19ebxg`}]]),Io=B(`PanelLeftOpen`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),Lo=B(`PanelLeft`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),Ro=B(`PanelRightClose`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]),zo=B(`Paperclip`,[[`path`,{d:`m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48`,key:`1u3ebp`}]]),Bo=B(`Pause`,[[`rect`,{x:`14`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`zuxfzm`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`1okwgv`}]]),Vo=B(`PenLine`,[[`path`,{d:`M12 20h9`,key:`t2du7b`}],[`path`,{d:`M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z`,key:`1ykcvy`}]]),Ho=B(`Pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Uo=B(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),Wo=B(`Puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),Go=B(`Radar`,[[`path`,{d:`M19.07 4.93A10 10 0 0 0 6.99 3.34`,key:`z3du51`}],[`path`,{d:`M4 6h.01`,key:`oypzma`}],[`path`,{d:`M2.29 9.62A10 10 0 1 0 21.31 8.35`,key:`qzzz0`}],[`path`,{d:`M16.24 7.76A6 6 0 1 0 8.23 16.67`,key:`1yjesh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M17.99 11.66A6 6 0 0 1 15.77 16.67`,key:`1u2y91`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`m13.41 10.59 5.66-5.66`,key:`mhq4k0`}]]),Ko=B(`RefreshCcw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]),qo=B(`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`}]]),Jo=B(`Send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),Yo=B(`Server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),Xo=B(`Settings2`,[[`path`,{d:`M20 7h-9`,key:`3s1dr2`}],[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),Zo=B(`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`}]]),Qo=B(`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`}]]),$o=B(`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`}]]),es=B(`ShieldPlus`,[[`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 12h6`,key:`1c52cq`}],[`path`,{d:`M12 9v6`,key:`199k2o`}]]),ts=B(`Shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),ns=B(`Smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),rs=B(`SquareArrowOutUpRight`,[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]]),is=B(`SquareCheck`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),as=B(`SquarePen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),os=B(`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`}]]),ss=B(`Square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),cs=B(`Star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),ls=B(`Store`,[[`path`,{d:`m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7`,key:`ztvudi`}],[`path`,{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`,key:`1b2hhj`}],[`path`,{d:`M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4`,key:`2ebpfo`}],[`path`,{d:`M2 7h20`,key:`1fcdvo`}],[`path`,{d:`M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7`,key:`6c3vgh`}]]),us=B(`Terminal`,[[`polyline`,{points:`4 17 10 11 4 5`,key:`akl6gq`}],[`line`,{x1:`12`,x2:`20`,y1:`19`,y2:`19`,key:`q2wloq`}]]),ds=B(`TextQuote`,[[`path`,{d:`M17 6H3`,key:`16j9eg`}],[`path`,{d:`M21 12H8`,key:`scolzb`}],[`path`,{d:`M21 18H8`,key:`1wfozv`}],[`path`,{d:`M3 12v6`,key:`fv4c87`}]]),fs=B(`Trash2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]),ps=B(`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`}]]),ms=B(`Unplug`,[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]),hs=B(`Upload`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`17 8 12 3 7 8`,key:`t8dd8p`}],[`line`,{x1:`12`,x2:`12`,y1:`3`,y2:`15`,key:`widbto`}]]),gs=B(`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`}]]),_s=B(`Wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]),vs=B(`Workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),ys=B(`Wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`,key:`cbrjhi`}]]),bs=Zi(),U=i(),xs={active:{dot:`bg-emerald-500`,text:`text-emerald-600`,bg:`bg-emerald-50`},ready:{dot:`bg-emerald-500`,text:`text-emerald-600`,bg:`bg-emerald-50`},inactive:{dot:`bg-gray-300`,text:`text-gray-400`,bg:`bg-gray-100/80`},setup:{dot:`bg-gray-300`,text:`text-gray-400`,bg:`bg-gray-100/80`},warning:{dot:`bg-amber-400`,text:`text-amber-600`,bg:`bg-amber-50`}};function Ss({status:e,label:t,className:n}){let r=xs[e];return(0,U.jsxs)(`div`,{className:u(`inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full px-2 py-0.5`,r.bg,n),children:[(0,U.jsx)(`span`,{className:u(`h-1.5 w-1.5 rounded-full`,r.dot)}),(0,U.jsx)(`span`,{className:u(`text-[11px] font-medium`,r.text),children:t})]})}function Cs(){return Sn({queryKey:Es,queryFn:At,staleTime:5e3,refetchOnWindowFocus:!0})}function ws(e){let{label:t,muted:n,value:r}=e;return(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-4 py-2 text-sm`,children:[(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:t}),(0,U.jsx)(`span`,{className:n?`text-right text-muted-foreground`:`text-right text-foreground`,children:r==null||r===``?`-`:String(r)})]})}function Ts(){let e=P9(),t=Cs(),n=t.data,r=Ps(e=>e.actionLabel),i=(0,H.useMemo)(()=>Bs(n),[n]),a=!!r,o=n?.runtime?.deviceName?.trim()||n?.settings.deviceName?.trim()||b(`remoteDeviceNameAuto`),s=!!(n?.account.loggedIn&&Ns(n)),{hero:c,issueHint:l}=i;return(0,H.useEffect)(()=>{e.remoteAccessManager.syncStatus(n)},[e,n]),t.isLoading&&!n?(0,U.jsx)(on,{title:b(`remotePageTitle`),description:b(`remotePageDescription`),children:(0,U.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:b(`remoteLoading`)})}):(0,U.jsx)(on,{title:b(`remotePageTitle`),description:b(`remotePageDescription`),children:(0,U.jsxs)(`div`,{className:`grid gap-7 xl:grid-cols-[1.2fr_0.8fr]`,children:[(0,U.jsx)(Yt,{title:c.title,description:c.description,actions:(0,U.jsx)(Ss,{status:c.badgeStatus,label:c.badgeLabel}),children:(0,U.jsx)(gt,{children:(0,U.jsxs)(`div`,{className:`space-y-5 p-4`,children:[(0,U.jsxs)(Dn,{tone:`neutral`,children:[(0,U.jsx)(ws,{label:b(`remoteSignedInAccount`),value:n?.account.email}),(0,U.jsx)(ws,{label:b(`remoteDeviceName`),value:o}),(0,U.jsx)(ws,{label:b(`remoteConnectionStatus`),value:c.badgeLabel}),(0,U.jsx)(ws,{label:b(`remoteLastConnectedAt`),value:n?.runtime?.lastConnectedAt?M(n.runtime.lastConnectedAt):`-`,muted:!0})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[i.primaryAction?(0,U.jsxs)(R,{onClick:()=>{if(i.primaryAction?.kind===`reauthorize`){e.remoteAccessManager.reauthorizeRemoteAccess(n);return}if(i.primaryAction?.kind===`repair`){e.remoteAccessManager.repairRemoteAccess(n);return}e.remoteAccessManager.enableRemoteAccess(n)},disabled:a,children:[i.primaryAction.showRefreshIcon?(0,U.jsx)(Ko,{className:`mr-2 h-4 w-4`}):null,r||i.primaryAction.label]}):null,(0,U.jsxs)(R,{variant:`outline`,onClick:()=>void e.accountManager.openNextClawWeb(),disabled:a||!s,children:[(0,U.jsx)(rs,{className:`mr-2 h-4 w-4`}),b(`remoteOpenDeviceList`)]}),n?.settings.enabled?(0,U.jsx)(R,{variant:`outline`,onClick:()=>void e.remoteAccessManager.disableRemoteAccess(n),disabled:a,children:b(`remoteDisable`)}):null]}),i.shouldShowIssueHint&&l?(0,U.jsx)(Dn,{tone:`warning`,title:l.title,description:l.body}):null,(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:b(`remoteOpenWebHint`)})]})})}),(0,U.jsx)(Yt,{title:(0,U.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(co,{className:`h-4 w-4 text-primary`}),b(`remoteDeviceSectionTitle`)]}),description:b(`remoteDeviceSectionDescription`),children:(0,U.jsx)(gt,{children:(0,U.jsxs)(`div`,{className:`space-y-5 p-4`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,U.jsx)(Ss,{status:n?.account.loggedIn?`ready`:`inactive`,label:n?.account.loggedIn?b(`remoteAccountConnected`):b(`remoteAccountNotConnected`)}),(0,U.jsx)(Ss,{status:n?.settings.enabled?`active`:`inactive`,label:n?.settings.enabled?b(`remoteEnabled`):b(`remoteStateDisabled`)}),(0,U.jsx)(Ss,{status:n?.service.running?`active`:`inactive`,label:n?.service.running?b(`remoteServiceRunning`):b(`remoteServiceStopped`)})]}),(0,U.jsxs)(Dn,{tone:`neutral`,children:[(0,U.jsx)(ws,{label:b(`remoteDeviceName`),value:o}),(0,U.jsx)(ws,{label:b(`remoteConnectionStatus`),value:c.badgeLabel}),(0,U.jsx)(ws,{label:b(`remoteLastConnectedAt`),value:n?.runtime?.lastConnectedAt?M(n.runtime.lastConnectedAt):`-`,muted:!0})]}),(0,U.jsx)(Dn,{tone:`neutral`,borderStyle:`dashed`,description:n?.account.loggedIn?b(`remoteOpenWebHint`):b(`remoteStatusNeedsSignInDescription`),className:`text-sm`})]})})})]})})}var Es=[`remote-status`],Ds=`https://platform.nextclaw.io`,Os=`https://nextclaw-platform-console.pages.dev`,ks=async()=>await jt.fetchQuery({queryKey:Es,queryFn:At,staleTime:5e3}),As=async()=>(await jt.invalidateQueries({queryKey:Es}),await ks()),js=(e,t)=>t?.trim()||e?.settings.platformApiBase?.trim()||e?.account.apiBase?.trim()||void 0;function Ms(e){let t=e?.trim();if(!t)return;let n;try{n=new URL(t)}catch{return}if(n.hostname===`platform.nextclaw.io`||n.hostname===`nextclaw-platform-console.pages.dev`)return n.origin;if(n.hostname===`ai-gateway-api.nextclaw.io`)return Ds;if(n.hostname.includes(`nextclaw-provider-gateway-api`)&&n.hostname.endsWith(`.workers.dev`))return Os}var Ns=e=>Ms(e?.account.apiBase)||Ms(e?.settings.platformApiBase)||Ms(e?.platformBase)||Ms(e?.account.platformBase)||void 0,Ps=P(e=>({enabled:!1,deviceName:``,platformApiBase:``,advancedOpen:!1,draftTouched:!1,actionLabel:null,doctor:null,setEnabled:t=>e({enabled:t,draftTouched:!0}),setDeviceName:t=>e({deviceName:t,draftTouched:!0}),setPlatformApiBase:t=>e({platformApiBase:t,draftTouched:!0}),setAdvancedOpen:t=>e({advancedOpen:t}),hydrateDraft:({enabled:t,deviceName:n,platformApiBase:r})=>e({enabled:t,deviceName:n,platformApiBase:r,draftTouched:!1}),beginAction:t=>e({actionLabel:t}),finishAction:()=>e({actionLabel:null}),setDoctor:t=>e({doctor:t})})),Fs=class{constructor(e){this.params=e,this.syncStatus=e=>{if(!e)return;let t=Ps.getState();t.draftTouched||t.actionLabel||this.hydrateDraftFromStatus(e)},this.setEnabled=e=>{Ps.getState().setEnabled(e)},this.setDeviceName=e=>{Ps.getState().setDeviceName(e)},this.setPlatformApiBase=e=>{Ps.getState().setPlatformApiBase(e)},this.setAdvancedOpen=e=>{Ps.getState().setAdvancedOpen(e)},this.enableRemoteAccess=async e=>{let t=e??await As(),n=Ps.getState(),r=await this.ensureRemoteAccount(t,n.platformApiBase);await this.applyEnabledState(!0,r)},this.disableRemoteAccess=async e=>{let t=e??await As();await this.applyEnabledState(!1,t)},this.repairRemoteAccess=async e=>{let t=e??await As(),n=(await this.ensureRemoteAccount(t)).service.running?`restart`:`start`;await this.runManagedAction({actionLabel:b(n===`restart`?`remoteActionRestarting`:`remoteActionStarting`),job:async()=>{await Zt(n);let e=await As();this.hydrateDraftFromStatus(e)},successMessage:b(`remoteServiceRecovered`)})},this.reauthorizeRemoteAccess=async e=>{let t=e??await As(),n=await this.params.accountManager.startBrowserSignInAndWait({status:t,apiBase:Ps.getState().platformApiBase});await this.repairRemoteAccess(n)},this.saveAdvancedSettings=async e=>{let t=e??await As(),n=Ps.getState();await this.runManagedAction({actionLabel:b(`remoteActionSavingAdvanced`),job:async()=>{await vt({enabled:n.enabled,deviceName:n.deviceName.trim(),platformApiBase:n.platformApiBase.trim()});let e=await As();this.hydrateDraftFromStatus(e)},successMessage:t.settings.enabled===n.enabled?b(`remoteSettingsSaved`):b(`remoteAdvancedSaved`)})},this.runDoctor=async()=>{await this.runManagedAction({actionLabel:b(`remoteDoctorRunning`),job:async()=>{let e=await Ht();Ps.getState().setDoctor(e)},successMessage:b(`remoteDoctorCompleted`)})},this.startService=async()=>{await this.runServiceAction(`start`,b(`remoteActionStarting`))},this.restartService=async()=>{await this.runServiceAction(`restart`,b(`remoteActionRestarting`))},this.stopService=async()=>{await this.runServiceAction(`stop`,b(`remoteActionStopping`))},this.applyEnabledState=async(e,t)=>{let n=Ps.getState();await this.runManagedAction({actionLabel:b(e?`remoteActionEnabling`:`remoteActionDisabling`),job:async()=>{await vt({enabled:e,deviceName:n.deviceName.trim(),platformApiBase:n.platformApiBase.trim()});let r=await As();this.hydrateDraftFromStatus(r),e?await Zt(r.service.running?`restart`:`start`):t.service.running&&await Zt(`restart`);let i=await As();this.hydrateDraftFromStatus(i)},successMessage:b(e?`remoteEnabledReady`:`remoteDisabledDone`)})},this.ensureRemoteAccount=async(e,t)=>e.account.loggedIn?e:await this.params.accountManager.ensureSignedIn({apiBase:t,status:e}),this.runServiceAction=async(e,t)=>{await this.runManagedAction({actionLabel:t,job:async()=>{let t=await Zt(e),n=await As();this.hydrateDraftFromStatus(n),L.success(t.message)}})},this.hydrateDraftFromStatus=e=>{Ps.getState().hydrateDraft({enabled:e.settings.enabled,deviceName:e.settings.deviceName,platformApiBase:e.settings.platformApiBase})},this.runManagedAction=async e=>{let{actionLabel:t,job:n,successMessage:r}=e;Ps.getState().beginAction(t);try{await n(),r&&L.success(r)}catch(e){let t=e instanceof Error?e.message:b(`error`);throw L.error(t),e}finally{Ps.getState().finishAction()}}}},Is=[/invalid or expired token/i,/missing bearer token/i,/token expired/i,/token is invalid/i,/run "nextclaw login"/i,/browser sign-in again/i];function Ls(e){return e?.runtime?.lastError?.trim()||``}function Rs(e){let t=b(`remoteStatusIssueDetailGeneric`),n=Ls(e);return n?`${t} (${n})`:t}function zs(e){if(!e?.settings.enabled)return!1;let t=Ls(e);return Is.some(e=>e.test(t))}function Bs(e){return zs(e)?{hero:{badgeStatus:`warning`,badgeLabel:b(`remoteStateReauthorizationRequired`),title:b(`remoteStatusReauthorizationTitle`),description:b(`remoteStatusReauthorizationDescription`)},primaryAction:{kind:`reauthorize`,label:b(`remoteReauthorizeNow`),showRefreshIcon:!1},issueHint:{title:b(`remoteStatusRecoveryTitle`),body:b(`remoteStatusReauthorizationHint`)},shouldShowIssueHint:!0,requiresReauthorization:!0}:e?.account.loggedIn?e.settings.enabled?e.service.running?e.runtime?.state===`connected`?{hero:{badgeStatus:`ready`,badgeLabel:b(`statusReady`),title:b(`remoteStatusReadyTitle`),description:b(`remoteStatusReadyDescription`)},primaryAction:{kind:`repair`,label:b(`remoteReconnectNow`),showRefreshIcon:!0},issueHint:null,shouldShowIssueHint:!1,requiresReauthorization:!1}:e.runtime?.state===`connecting`?{hero:{badgeStatus:`active`,badgeLabel:b(`connecting`),title:b(`remoteStatusConnectingTitle`),description:b(`remoteStatusConnectingDescription`)},primaryAction:{kind:`repair`,label:b(`remoteReconnectNow`),showRefreshIcon:!0},issueHint:null,shouldShowIssueHint:!1,requiresReauthorization:!1}:{hero:{badgeStatus:`warning`,badgeLabel:b(`remoteStateDisconnected`),title:b(`remoteStatusIssueTitle`),description:b(`remoteStatusIssueDescription`)},primaryAction:{kind:`repair`,label:b(`remoteReconnectNow`),showRefreshIcon:!0},issueHint:{title:b(`remoteStatusRecoveryTitle`),body:Rs(e)},shouldShowIssueHint:!!(e.settings.enabled&&e.account.loggedIn),requiresReauthorization:!1}:{hero:{badgeStatus:`warning`,badgeLabel:b(`remoteServiceStopped`),title:b(`remoteStatusNeedsServiceTitle`),description:b(`remoteStatusNeedsServiceDescription`)},primaryAction:{kind:`repair`,label:b(`remoteReconnectNow`),showRefreshIcon:!0},issueHint:{title:b(`remoteStatusRecoveryTitle`),body:b(`remoteStatusIssueDetailServiceStopped`)},shouldShowIssueHint:!0,requiresReauthorization:!1}:{hero:{badgeStatus:`inactive`,badgeLabel:b(`statusInactive`),title:b(`remoteStatusNeedsEnable`),description:b(`remoteStatusNeedsEnableDescription`)},primaryAction:{kind:`enable`,label:b(`remoteEnableNow`),showRefreshIcon:!1},issueHint:null,shouldShowIssueHint:!1,requiresReauthorization:!1}:{hero:{badgeStatus:`setup`,badgeLabel:b(`statusSetup`),title:b(`remoteStatusNeedsSignIn`),description:b(`remoteStatusNeedsSignInDescription`)},primaryAction:{kind:`sign-in-enable`,label:b(`remoteSignInAndEnable`),showRefreshIcon:!1},issueHint:null,shouldShowIssueHint:!1,requiresReauthorization:!1}}var Vs=P(e=>({panelOpen:!1,authSessionId:null,authVerificationUri:null,authExpiresAt:null,authStatusMessage:``,authPollIntervalMs:1500,openPanel:()=>e({panelOpen:!0}),closePanel:()=>e({panelOpen:!1}),beginBrowserAuth:({sessionId:t,verificationUri:n,expiresAt:r,intervalMs:i,statusMessage:a})=>e({panelOpen:!0,authSessionId:t,authVerificationUri:n,authExpiresAt:r,authPollIntervalMs:i,authStatusMessage:a}),updateBrowserAuth:({statusMessage:t,intervalMs:n})=>e(e=>({authStatusMessage:t??e.authStatusMessage,authPollIntervalMs:n??e.authPollIntervalMs})),clearBrowserAuth:()=>e({authSessionId:null,authVerificationUri:null,authExpiresAt:null,authStatusMessage:``,authPollIntervalMs:1500}),setAuthStatusMessage:t=>e({authStatusMessage:t})}));function Hs({label:e,value:t}){return(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-4 py-2 text-sm`,children:[(0,U.jsx)(`span`,{className:`text-gray-500`,children:e}),(0,U.jsx)(`span`,{className:`text-right text-gray-900`,children:t?.trim()||`-`})]})}function Us(e){let{email:t,username:n,role:r,canSubmitUsername:i,savingUsername:a,usernameDraft:o,onUsernameDraftChange:s,onSubmitUsername:c,onOpenDeviceList:l,onLogout:u}=e;return(0,U.jsxs)(`div`,{className:`space-y-4`,children:[(0,U.jsx)(Dn,{tone:`success`,title:b(`accountPanelSignedInTitle`),description:b(`accountPanelSignedInDescription`)}),(0,U.jsxs)(Dn,{tone:`neutral`,children:[(0,U.jsx)(Hs,{label:b(`remoteAccountEmail`),value:t}),(0,U.jsx)(Hs,{label:b(`remoteAccountUsername`),value:n}),(0,U.jsx)(Hs,{label:b(`remoteAccountRole`),value:r})]}),n?(0,U.jsx)(`p`,{className:`text-xs text-gray-500`,children:b(`remoteAccountUsernameLockedHelp`)}):(0,U.jsxs)(Dn,{tone:`warning`,title:b(`remoteAccountUsernameRequiredTitle`),description:b(`remoteAccountUsernameRequiredDescription`),children:[(0,U.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,U.jsx)(dn,{htmlFor:`account-panel-username`,children:b(`remoteAccountUsername`)}),(0,U.jsx)(St,{id:`account-panel-username`,value:o,onChange:e=>s(e.target.value),placeholder:b(`remoteAccountUsernamePlaceholder`),autoCapitalize:`none`,autoCorrect:`off`,spellCheck:!1})]}),(0,U.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-3`,children:(0,U.jsx)(R,{disabled:!i,onClick:()=>void c(),children:b(a?`remoteAccountUsernameSaving`:`remoteAccountUsernameSave`)})})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,U.jsxs)(R,{onClick:()=>void l(),children:[(0,U.jsx)(rs,{className:`mr-2 h-4 w-4`}),b(`remoteOpenDeviceList`)]}),(0,U.jsxs)(R,{variant:`outline`,onClick:()=>void u(),children:[(0,U.jsx)(vo,{className:`mr-2 h-4 w-4`}),b(`remoteLogout`)]})]})]})}function Ws(e){let{authSessionId:t,authExpiresAt:n,authStatusMessage:r,authVerificationUri:i,onStartBrowserSignIn:a,onResumeBrowserSignIn:o}=e;return(0,U.jsxs)(`div`,{className:`space-y-4`,children:[(0,U.jsx)(Dn,{tone:`neutral`,title:b(`accountPanelSignedOutTitle`),description:b(`accountPanelSignedOutDescription`),children:t?(0,U.jsxs)(`div`,{className:`mt-3 border-t border-white/80 pt-3`,children:[(0,U.jsx)(Hs,{label:b(`remoteBrowserAuthSession`),value:t}),(0,U.jsx)(Hs,{label:b(`remoteBrowserAuthExpiresAt`),value:n?M(n):`-`})]}):null}),r?(0,U.jsx)(`p`,{className:`text-sm text-gray-600`,children:r}):null,(0,U.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,U.jsx)(R,{onClick:()=>void a(),children:b(t?`remoteBrowserAuthActionRetry`:`remoteBrowserAuthAction`)}),i?(0,U.jsx)(R,{variant:`outline`,onClick:()=>void o(),children:b(`remoteBrowserAuthResume`)}):null]})]})}function Gs(){let e=A9(),t=Cs(),n=Vs(e=>e.panelOpen),r=Vs(e=>e.authSessionId),i=Vs(e=>e.authVerificationUri),a=Vs(e=>e.authExpiresAt),o=Vs(e=>e.authStatusMessage),s=t.data,[c,l]=(0,H.useState)(``),[u,d]=(0,H.useState)(!1);(0,H.useEffect)(()=>{e.accountManager.syncRemoteStatus(s)},[e,s]);let f=!u&&c.trim().length>0&&!s?.account.username;return(0,U.jsx)(Ur,{open:n,onOpenChange:t=>t?e.accountManager.openAccountPanel():e.accountManager.closeAccountPanel(),children:(0,U.jsxs)(Kr,{className:`max-w-xl`,children:[(0,U.jsxs)(Wr,{children:[(0,U.jsxs)(qr,{className:`flex items-center gap-2`,children:[(0,U.jsx)(oo,{className:`h-5 w-5 text-primary`}),b(`accountPanelTitle`)]}),(0,U.jsx)(Br,{children:b(`accountPanelDescription`)})]}),s?.account.loggedIn?(0,U.jsx)(Us,{email:s.account.email,username:s.account.username,role:s.account.role,canSubmitUsername:f,savingUsername:u,usernameDraft:c,onUsernameDraftChange:l,onSubmitUsername:async()=>{d(!0);try{await e.accountManager.updateUsername(c)}finally{d(!1)}},onOpenDeviceList:()=>e.accountManager.openNextClawWeb(`/account`),onLogout:()=>e.accountManager.logout()}):(0,U.jsx)(Ws,{authSessionId:r,authExpiresAt:a,authStatusMessage:o,authVerificationUri:i,onStartBrowserSignIn:()=>e.accountManager.startBrowserSignIn(),onResumeBrowserSignIn:()=>e.accountManager.resumeBrowserSignIn()})]})})}var Ks=H.forwardRef(({className:e,hover:t=!0,surface:n=`raised`,...r},i)=>(0,U.jsx)(`div`,{ref:i,className:u(`rounded-2xl border bg-card text-card-foreground transition-colors duration-base`,n===`raised`?`border-border shadow-card`:`border-border/75 shadow-none`,t&&n===`raised`&&`hover:border-primary/25 hover:shadow-card-hover`,t&&n===`flat`&&`hover:bg-muted/40`,e),...r}));Ks.displayName=`Card`;var qs=H.forwardRef(({className:e,...t},n)=>(0,U.jsx)(`div`,{ref:n,className:u(`flex flex-col space-y-1.5 p-6`,e),...t}));qs.displayName=`CardHeader`;var Js=H.forwardRef(({className:e,...t},n)=>(0,U.jsx)(`h3`,{ref:n,className:u(`text-[15px] font-semibold leading-tight tracking-tight text-foreground`,e),...t}));Js.displayName=`CardTitle`;var Ys=H.forwardRef(({className:e,...t},n)=>(0,U.jsx)(`p`,{ref:n,className:u(`text-[13px] text-muted-foreground leading-relaxed`,e),...t}));Ys.displayName=`CardDescription`;var Xs=H.forwardRef(({className:e,...t},n)=>(0,U.jsx)(`div`,{ref:n,className:u(`p-6 pt-0`,e),...t}));Xs.displayName=`CardContent`;var Zs=H.forwardRef(({className:e,...t},n)=>(0,U.jsx)(`div`,{ref:n,className:u(`flex items-center justify-between p-6 pt-0`,e),...t}));Zs.displayName=`CardFooter`;function Qs({username:e}){let t=ct(),[n,r]=(0,H.useState)(e??``),[i,a]=(0,H.useState)(``),o=n.trim().length>0&&i.length>0&&!t.isPending;return(0,U.jsx)(`main`,{className:`flex min-h-screen items-center justify-center bg-secondary px-6 py-10`,children:(0,U.jsxs)(Ks,{hover:!1,className:`w-full max-w-md shadow-card-hover`,children:[(0,U.jsxs)(qs,{children:[(0,U.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-gray-500`,children:b(`authBrand`)}),(0,U.jsx)(Js,{className:`text-2xl`,children:b(`authLoginTitle`)}),(0,U.jsx)(Ys,{children:b(`authLoginDescription`)})]}),(0,U.jsx)(Xs,{children:(0,U.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e?.preventDefault(),o&&t.mutate({username:n.trim(),password:i})},children:[(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(`label`,{className:`text-sm font-medium text-gray-800`,children:b(`authUsername`)}),(0,U.jsx)(St,{value:n,onChange:e=>r(e.target.value),placeholder:b(`authUsernamePlaceholder`),autoFocus:!0})]}),(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(`label`,{className:`text-sm font-medium text-gray-800`,children:b(`authPassword`)}),(0,U.jsx)(St,{type:`password`,value:i,onChange:e=>a(e.target.value),placeholder:b(`authPasswordPlaceholder`)})]}),(0,U.jsx)(R,{type:`submit`,className:`w-full`,disabled:!o,children:t.isPending?b(`authLoggingIn`):b(`authLoginAction`)})]})})]})})}var $s=class{constructor(){this.authPollTimerId=null,this.browserSignInCompletion=null,this.openAccountPanel=()=>{Vs.getState().openPanel()},this.closeAccountPanel=()=>{Vs.getState().closePanel()},this.syncRemoteStatus=e=>{e?.account.loggedIn&&(this.clearPollTimer(),this.resolveBrowserSignIn(e),Vs.getState().clearBrowserAuth())},this.ensureSignedIn=async e=>{let t=e?.status??await ks();return t.account.loggedIn?t:(this.openAccountPanel(),await this.startBrowserSignInAndWait({apiBase:e?.apiBase,status:t}))},this.startBrowserSignInAndWait=async e=>{let t=this.createBrowserSignInCompletion();return await this.startBrowserSignIn(e),await t},this.startBrowserSignIn=async e=>{try{let t=e?.apiBase,n=await pn({apiBase:js(e?.status??await ks(),t)});Vs.getState().beginBrowserAuth({sessionId:n.sessionId,verificationUri:n.verificationUri,expiresAt:n.expiresAt,intervalMs:n.intervalMs,statusMessage:b(`remoteBrowserAuthWaiting`)}),(await Ai.openExternalUrl(n.verificationUri)).opened||Vs.getState().setAuthStatusMessage(b(`remoteBrowserAuthPopupBlocked`)),this.scheduleBrowserAuthPoll()}catch(e){let t=e instanceof Error?e.message:b(`remoteBrowserAuthStartFailed`);this.rejectBrowserSignIn(e),L.error(`${b(`remoteBrowserAuthStartFailed`)}: ${t}`)}},this.resumeBrowserSignIn=async()=>{let e=Vs.getState().authVerificationUri;e&&await Ai.openExternalUrl(e)},this.logout=async()=>{try{await Dt(),this.rejectBrowserSignIn(Error(`Signed out before browser sign-in completed.`)),Vs.getState().clearBrowserAuth(),await As(),L.success(b(`remoteLogoutSuccess`))}catch(e){let t=e instanceof Error?e.message:b(`remoteLogoutFailed`);L.error(`${b(`remoteLogoutFailed`)}: ${t}`)}},this.updateUsername=async e=>{try{await xn({username:e.trim()}),await As(),L.success(b(`remoteAccountUsernameSetSuccess`))}catch(e){let t=e instanceof Error?e.message:b(`remoteAccountUsernameSetFailed`);L.error(`${b(`remoteAccountUsernameSetFailed`)}: ${t}`)}},this.openNextClawWeb=async(e=`/`)=>{let t=Ns(await ks());if(!t){L.error(b(`remoteOpenWebUnavailable`));return}let n=new URL(e,`${t.replace(/\/+$/,``)}/`).toString();await Ai.openExternalUrl(n)},this.scheduleBrowserAuthPoll=()=>{this.clearPollTimer();let{authSessionId:e,authPollIntervalMs:t}=Vs.getState();e&&(this.authPollTimerId=window.setTimeout(async()=>{await this.pollBrowserSignIn()},t))},this.pollBrowserSignIn=async()=>{let e=Vs.getState();if(e.authSessionId)try{let t=await ks(),n=await pt({sessionId:e.authSessionId,apiBase:js(t)});if(n.status===`pending`){Vs.getState().updateBrowserAuth({statusMessage:b(`remoteBrowserAuthWaiting`),intervalMs:n.nextPollMs??1500}),this.scheduleBrowserAuthPoll();return}if(n.status===`expired`){this.clearPollTimer(),this.rejectBrowserSignIn(Error(n.message||b(`remoteBrowserAuthExpired`))),Vs.getState().clearBrowserAuth(),L.error(n.message||b(`remoteBrowserAuthExpired`));return}Vs.getState().setAuthStatusMessage(b(`remoteBrowserAuthCompleted`));let r=await As();this.clearPollTimer(),this.resolveBrowserSignIn(r),Vs.getState().clearBrowserAuth(),L.success(b(`remoteLoginSuccess`))}catch(e){this.clearPollTimer(),this.rejectBrowserSignIn(e),Vs.getState().clearBrowserAuth();let t=e instanceof Error?e.message:b(`remoteBrowserAuthPollFailed`);L.error(`${b(`remoteBrowserAuthPollFailed`)}: ${t}`)}},this.clearPollTimer=()=>{this.authPollTimerId!==null&&(window.clearTimeout(this.authPollTimerId),this.authPollTimerId=null)},this.createBrowserSignInCompletion=()=>(this.rejectBrowserSignIn(Error(`Browser sign-in was replaced by a newer request.`)),new Promise((e,t)=>{this.browserSignInCompletion={resolve:e,reject:t}})),this.resolveBrowserSignIn=e=>{let t=this.browserSignInCompletion;t&&(this.browserSignInCompletion=null,t.resolve(e))},this.rejectBrowserSignIn=e=>{let t=this.browserSignInCompletion;t&&(this.browserSignInCompletion=null,t.reject(e instanceof Error?e:Error(String(e))))},this.getBrowserAuthSummary=()=>{let e=Vs.getState();return{sessionId:e.authSessionId,expiresAt:e.authExpiresAt?M(e.authExpiresAt):`-`}}}},ec=`nextclaw.app.viewport-layout`,tc=1;function nc(e){return typeof e!=`number`||!Number.isFinite(e)?`desktop`:e<=767?`mobile`:`desktop`}function rc(){let e=typeof window>`u`?null:window.innerWidth??null;return{mode:nc(e),width:e,isSidebarCollapsed:!1,isMainSidebarAppGroupCollapsed:!1}}function ic(e,t){if(!e||typeof e!=`object`)return null;let n=e[t];return typeof n==`boolean`?n:null}var ac=P()(ji(()=>rc(),{name:ec,version:tc,storage:Mi(()=>window.localStorage),partialize:e=>({isSidebarCollapsed:e.isSidebarCollapsed,isMainSidebarAppGroupCollapsed:e.isMainSidebarAppGroupCollapsed}),merge:(e,t)=>{let n=ic(e,`isSidebarCollapsed`),r=ic(e,`isMainSidebarAppGroupCollapsed`);return{...t,...n===null?{}:{isSidebarCollapsed:n},...r===null?{}:{isMainSidebarAppGroupCollapsed:r}}}})),oc=new class{constructor(){this.consumerCount=0,this.started=!1,this.attach=()=>(this.consumerCount+=1,this.consumerCount===1&&this.start(),()=>{this.consumerCount=Math.max(0,this.consumerCount-1),this.consumerCount===0&&this.stop()}),this.start=()=>{this.started||typeof window>`u`||(this.started=!0,window.addEventListener(`resize`,this.handleViewportChange),window.addEventListener(`orientationchange`,this.handleViewportChange),this.syncFromWindow())},this.stop=()=>{!this.started||typeof window>`u`||(window.removeEventListener(`resize`,this.handleViewportChange),window.removeEventListener(`orientationchange`,this.handleViewportChange),this.started=!1)},this.getSnapshot=()=>ac.getState(),this.setSidebarCollapsed=e=>{ac.setState({isSidebarCollapsed:e})},this.setMainSidebarAppGroupCollapsed=e=>{ac.setState({isMainSidebarAppGroupCollapsed:e})},this.collapseSidebarForDenseRightPanels=e=>{if(!e.isDocBrowserOpen||!e.isDocBrowserDocked||!e.isWorkspacePanelOpen)return;let t=this.getSnapshot();if(t.mode!==`desktop`||t.isSidebarCollapsed)return;let n=typeof t.width==`number`?t.width:typeof window>`u`?null:window.innerWidth;typeof n!=`number`||!Number.isFinite(n)||n>1800||this.setSidebarCollapsed(!0)},this.toggleSidebarCollapsed=()=>{ac.setState(e=>({isSidebarCollapsed:!e.isSidebarCollapsed}))},this.toggleMainSidebarAppGroupCollapsed=()=>{ac.setState(e=>({isMainSidebarAppGroupCollapsed:!e.isMainSidebarAppGroupCollapsed}))},this.resetForTests=()=>{this.consumerCount=0,this.stop(),ac.setState(rc())},this.handleViewportChange=()=>{this.syncFromWindow()},this.syncFromWindow=()=>{if(typeof window>`u`)return;let e=window.innerWidth??null;ac.setState({width:e,mode:nc(e)})}}};function sc({parentSessionLabel:e,onGoToParentSession:t}){if(!e)return null;let n=e.trim();return(0,U.jsx)(`div`,{"data-theme-surface":`header`,className:`bg-background/75 px-4 py-2 backdrop-blur-sm sm:px-5`,children:(0,U.jsxs)(`button`,{type:`button`,onClick:t,className:`inline-flex items-center gap-2 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground`,children:[(0,U.jsx)(Ci,{className:`h-3.5 w-3.5`}),(0,U.jsxs)(`span`,{children:[b(`chatBackToParent`),n?` · ${n}`:``]})]})})}function cc({layoutMode:e,actions:t,leading:n,onBackToList:r,projectBadge:i,sessionTypeBadge:a,shouldShow:o,title:s,titleContent:c}){let l=e===`mobile`;return(0,U.jsxs)(`div`,{"data-testid":`chat-conversation-header`,"data-theme-surface":`header`,className:u(`bg-background/80 backdrop-blur-sm flex items-center justify-between shrink-0 overflow-hidden transition-colors duration-200`,l?`px-3 sm:px-3`:`px-4 sm:px-5`,o?`opacity-100`:`h-0 py-0 opacity-0`,o&&(l?`min-h-12 pb-2 pt-2`:`h-[52px]`)),style:l&&o?{paddingTop:`calc(env(safe-area-inset-top, 0px) + 0.5rem)`}:void 0,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex-1 flex items-center gap-2`,children:[l&&r?(0,U.jsx)(V,{icon:(0,U.jsx)(Ci,{className:`h-4 w-4`}),label:b(`chat`),onClick:r,className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`}):null,n,c??(0,U.jsx)(`span`,{className:`text-sm font-medium text-foreground truncate`,children:s}),a,i]}),t]})}function lc(){let e=F();return(0,H.useCallback)(async t=>{let{invalidateSessionSkills:n=!0,sessionKey:r,patch:i,successMessage:a}=t;try{Ce(e,await Qe(r,i)),n&&await e.invalidateQueries({queryKey:[`ncp-session-skills`,r]}),a!==null&&L.success(a??b(`configSavedApplied`))}catch(e){throw L.error(b(`configSaveFailed`)+`: `+(e instanceof Error?e.message:String(e))),e}},[e])}function uc(){let e=lc();return async t=>{await e({sessionKey:t.sessionKey,patch:{label:t.label},successMessage:b(`configSavedApplied`)})}}function dc(){let e=lc();return async t=>{let{persistToServer:n,projectRoot:r,sessionKey:i}=t,a=b(r?`chatSessionProjectUpdated`:`chatSessionProjectCleared`);if(!n){L.success(a);return}await e({sessionKey:i,patch:{projectRoot:r},successMessage:a})}}function fc({icon:e,label:t,onClick:n,disabled:r=!1,destructive:i=!1}){return(0,U.jsxs)(`button`,{type:`button`,className:u(`flex w-full items-center gap-2 rounded-xl px-3 py-2 text-left text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50`,i?`text-destructive hover:bg-destructive/10`:`text-muted-foreground hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`),onClick:n,disabled:r,children:[(0,U.jsx)(e,{className:`h-4 w-4 shrink-0`}),(0,U.jsx)(`span`,{children:t})]})}var pc={key:`slash`,marker:`/`};function mc(){return`composer-${Math.random().toString(36).slice(2,10)}`}function hc(e=``){return{id:mc(),type:`text`,text:e}}function gc(e){let{data:t,label:n,previewUrl:r,tokenKey:i,tokenKind:a}=e;return{id:mc(),type:`token`,tokenKind:a,tokenKey:i,label:n,previewUrl:r,data:t}}function _c(e){return e.type===`text`?e.text.length:1}function vc(){return[hc(``)]}function yc(e){return[hc(e)]}function bc(e){let t=[];for(let n of e){if(n.type===`text`){if(n.text.length===0)continue;let e=t[t.length-1];if(e?.type===`text`){t[t.length-1]={...e,text:e.text+n.text};continue}}t.push(n)}return t.length===0?vc():t}function xc(e){return e.map(e=>e.type===`text`?e.text:``).join(``)}function Sc(e){return e.filter(e=>e.type===`text`).map(e=>e.text).join(``)}function Cc(e,t){let n=[],r=new Set;for(let i of e)i.type!==`token`||i.tokenKind!==t||r.has(i.tokenKey)||(r.add(i.tokenKey),n.push(i.tokenKey));return n}function wc(e,t,n,r){let i=Math.max(0,n-t),a=Math.max(0,t+e.text.length-r),o=[];return i>0&&o.push({...e,text:e.text.slice(0,i)}),a>0&&o.push({...e,text:e.text.slice(e.text.length-a)}),o}function Tc(e,t,n,r){return t<=n||e>=r}function Ec(e,t,n,r,i){return!n&&r>=i?(e.push(...t),!0):n}function Dc(e,t,n,r,i,a,o){let s=wc(t,n,r,i);s[0]&&e.push(s[0]);let c=o;return c||=(e.push(...a),!0),s[1]&&e.push(s[1]),c}function Oc(e,t,n,r,i,a){return!r&&i<=a?(e.push(...n),!0):(e.push(t),r)}function kc(e,t,n,r){let i=Math.max(0,t),a=Math.max(i,n),o=[],s=0,c=!1;for(let t of e){let e=_c(t),n=s,l=s+e;if(Tc(n,l,i,a)){c=Ec(o,r,c,n,a),o.push(t),s=l;continue}c=t.type===`text`?Dc(o,t,n,i,a,r,c):Oc(o,t,r,c,i,n),s=l}return c||o.push(...r),bc(o)}function Ac(e,t){return bc(e.filter(e=>e.type!==`token`||!t(e)))}function jc(e,t){return t===0||/\s/.test(e[t-1]??``)}function Mc(e,t,n){if(!t||t.start!==t.end)return null;let r=xc(e),i=t.end,a=r.slice(0,i),o=a.lastIndexOf(n.marker);if(o<0||!jc(a,o))return null;let s=a.slice(o+n.marker.length);return/[\s\uFFFC]/.test(s)?null:{key:n.key,marker:n.marker,query:s.trim().toLowerCase(),start:o,end:i}}function Nc(e,t,n=[pc]){let r=null;for(let i of n){let n=Mc(e,t,i);n&&(!r||n.start>r.start)&&(r=n)}return r}function Pc(e,t){let n=Mc(e,t,pc);return n?{query:n.query,start:n.start,end:n.end}:null}var Fc=e=>`[data-item-index="${e}"]`;function Ic(e){let{activeIndex:t,containerRef:n,getItemSelector:r,isEnabled:i,itemCount:a}=e,o=r??Fc;(0,H.useEffect)(()=>{if(!i||a===0)return;let e=n.current;if(!e)return;let r=e.querySelector(o(t));typeof r?.scrollIntoView==`function`&&r.scrollIntoView({block:`nearest`,inline:`nearest`})},[t,n,o,i,a])}function Lc(){let e=(0,H.useRef)(null),[t,n]=(0,H.useState)(null);return(0,H.useEffect)(()=>{let t=e.current;if(!t||typeof ResizeObserver>`u`)return;let r=()=>{n(t.getBoundingClientRect().width)};r();let i=new ResizeObserver(()=>r());return i.observe(t),()=>i.disconnect()},[]),{elementRef:e,width:t}}function W(...e){return h(ie(e))}var Rc=H.forwardRef(({className:e,type:t,...n},r)=>(0,U.jsx)(`input`,{type:t,className:W(`flex h-9 w-full rounded-xl border border-border bg-card px-3.5 py-2 text-sm text-foreground file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground/55 placeholder:font-normal focus:outline-none focus:ring-0 transition-colors disabled:cursor-not-allowed disabled:opacity-50`,e),ref:r,...n}));Rc.displayName=`ChatInput`;var zc=zr,Bc=Rr,Vc=Lr,Hc=H.forwardRef(({className:e,children:t,closeLabel:n,...r},i)=>(0,U.jsxs)(Hr,{children:[(0,U.jsx)(Gr,{className:`fixed inset-0 z-[var(--z-modal-backdrop,10000)] bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),(0,U.jsxs)(Ir,{ref:i,className:W(`fixed left-[50%] top-[50%] z-[var(--z-modal,10050)] grid max-h-[min(42rem,calc(100vh-2rem))] w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 overflow-y-auto rounded-2xl border border-border bg-background p-6 text-foreground shadow-xl outline-none duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]`,e),...r,children:[t,(0,U.jsxs)(Yr,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none`,children:[(0,U.jsx)(ki,{className:`h-4 w-4`}),(0,U.jsx)(`span`,{className:`sr-only`,children:n})]})]})]}));Hc.displayName=Ir.displayName;var Uc=({className:e,...t})=>(0,U.jsx)(`div`,{className:W(`flex flex-col gap-2 text-center sm:text-left`,e),...t}),Wc=`Popover`,[Gc,yee]=rr(Wc,[nr]),Kc=nr(),[qc,Jc]=Gc(Wc),Yc=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Kc(t),c=H.useRef(null),[l,u]=H.useState(!1),[d,f]=$n({prop:r,defaultProp:i??!1,onChange:a,caller:Wc});return(0,U.jsx)(er,{...s,children:(0,U.jsx)(qc,{scope:t,contentId:Xn(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:H.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:H.useCallback(()=>u(!0),[]),onCustomAnchorRemove:H.useCallback(()=>u(!1),[]),modal:o,children:n})})};Yc.displayName=Wc;var Xc=`PopoverAnchor`,Zc=H.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Jc(Xc,n),a=Kc(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return H.useEffect(()=>(o(),()=>s()),[o,s]),(0,U.jsx)(tr,{...a,...r,ref:t})});Zc.displayName=Xc;var Qc=`PopoverTrigger`,$c=H.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Jc(Qc,n),a=Kc(n),o=ir(t,i.triggerRef),s=(0,U.jsx)(Jn.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":ml(i.open),...r,ref:o,onClick:Kn(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,U.jsx)(tr,{asChild:!0,...a,children:s})});$c.displayName=Qc;var el=`PopoverPortal`,[tl,nl]=Gc(el,{forceMount:void 0}),rl=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Jc(el,t);return(0,U.jsx)(tl,{scope:t,forceMount:n,children:(0,U.jsx)(Nr,{present:n||a.open,children:(0,U.jsx)(qn,{asChild:!0,container:i,children:r})})})};rl.displayName=el;var il=`PopoverContent`,al=H.forwardRef((e,t)=>{let n=nl(il,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Jc(il,e.__scopePopover);return(0,U.jsx)(Nr,{present:r||a.open,children:a.modal?(0,U.jsx)(sl,{...i,ref:t}):(0,U.jsx)(cl,{...i,ref:t})})});al.displayName=il;var ol=Yn(`PopoverContent.RemoveScroll`),sl=H.forwardRef((e,t)=>{let n=Jc(il,e.__scopePopover),r=H.useRef(null),i=ir(t,r),a=H.useRef(!1);return H.useEffect(()=>{let e=r.current;if(e)return ur(e)},[]),(0,U.jsx)(sr,{as:ol,allowPinchZoom:!0,children:(0,U.jsx)(ll,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Kn(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Kn(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:Kn(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),cl=H.forwardRef((e,t)=>{let n=Jc(il,e.__scopePopover),r=H.useRef(!1),i=H.useRef(!1);return(0,U.jsx)(ll,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),ll=H.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=Jc(il,n),p=Kc(n);return or(),(0,U.jsx)(cr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,U.jsx)(Qn,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,U.jsx)(Gn,{"data-state":ml(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),ul=`PopoverClose`,dl=H.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Jc(ul,n);return(0,U.jsx)(Jn.button,{type:`button`,...r,ref:t,onClick:Kn(e.onClick,()=>i.onOpenChange(!1))})});dl.displayName=ul;var fl=`PopoverArrow`,pl=H.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Kc(n);return(0,U.jsx)(Zn,{...i,...r,ref:t})});pl.displayName=fl;function ml(e){return e?`open`:`closed`}var hl=Yc,gl=Zc,_l=$c,vl=rl,yl=al,bee=`2rem`;function bl(e){return`min(${e}, max(0px, calc(var(--radix-popover-content-available-height, 100vh) - ${bee})))`}var xee=bl(`24rem`),See=hl,Cee=_l,wee=gl,xl=H.forwardRef(({className:e,sideOffset:t=8,align:n=`start`,collisionPadding:r=12,style:i,...a},o)=>(0,U.jsx)(vl,{children:(0,U.jsx)(yl,{ref:o,sideOffset:t,align:n,collisionPadding:r,className:W(`z-[var(--z-popover,50)] w-72 overflow-x-hidden overflow-y-auto rounded-2xl border border-border bg-popover p-4 text-popover-foreground shadow-lg animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=top]:slide-in-from-bottom-2 data-[side=right]:slide-in-from-left-2`,e),style:{maxHeight:xee,...i},...a})}));xl.displayName=yl.displayName;var Tee=vr,Eee=mr,Dee=pr,Oee=`2rem`;function Sl(e){return`min(${e}, max(0px, calc(var(--radix-select-content-available-height, 100vh) - ${Oee})))`}var kee=Sl(`24rem`),Cl=H.forwardRef(({className:e,children:t,...n},r)=>(0,U.jsxs)(Mr,{ref:r,className:W(`flex h-9 w-full items-center justify-between whitespace-nowrap rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-0 focus:border-border disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1`,e),...n,children:[t,(0,U.jsx)(br,{asChild:!0,children:(0,U.jsx)(ar,{className:`h-4 w-4 opacity-50`})})]}));Cl.displayName=Mr.displayName;var wl=H.forwardRef(({className:e,...t},n)=>(0,U.jsx)(dr,{ref:n,className:W(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,U.jsx)(lr,{className:`h-4 w-4`})}));wl.displayName=dr.displayName;var Tl=H.forwardRef(({className:e,...t},n)=>(0,U.jsx)(_r,{ref:n,className:W(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,U.jsx)(ar,{className:`h-4 w-4`})}));Tl.displayName=_r.displayName;var El=H.forwardRef(({className:e,children:t,collisionPadding:n=12,position:r=`popper`,style:i,viewportClassName:a,...o},s)=>(0,U.jsx)(xr,{children:(0,U.jsxs)(Er,{ref:s,className:W(`relative z-50 flex max-h-96 min-w-[8rem] flex-col overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,r===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),collisionPadding:n,position:r,style:{maxHeight:kee,...i},...o,children:[(0,U.jsx)(wl,{}),(0,U.jsx)(jr,{className:W(`min-h-0 flex-1 overflow-y-auto overscroll-contain p-1`,r===`popper`&&`w-full min-w-[var(--radix-select-trigger-width)]`,a),children:t}),(0,U.jsx)(Tl,{})]})}));El.displayName=Er.displayName;var Dl=H.forwardRef(({className:e,...t},n)=>(0,U.jsx)(wr,{ref:n,className:W(`px-2 py-1 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,e),...t}));Dl.displayName=wr.displayName;var Ol=H.forwardRef(({className:e,children:t,...n},r)=>(0,U.jsxs)(Or,{ref:r,className:W(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`,e),...n,children:[(0,U.jsx)(`span`,{className:`absolute right-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,U.jsx)(hr,{children:(0,U.jsx)(Ar,{className:`h-4 w-4`})})}),(0,U.jsx)(gr,{children:t})]}));Ol.displayName=Or.displayName;var kl=H.forwardRef(({className:e,...t},n)=>(0,U.jsx)(kr,{ref:n,className:W(`-mx-1 my-1 h-px bg-border`,e),...t}));kl.displayName=kr.displayName;var Aee=ii,jee=xi,Mee=ei,Al=H.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,U.jsx)(Si,{children:(0,U.jsx)(yi,{ref:r,sideOffset:t,className:W(`z-[var(--z-tooltip)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n})}));Al.displayName=yi.displayName;var jl={Dialog:zc,DialogContent:Hc,DialogDescription:Vc,DialogHeader:Uc,DialogTitle:Bc,Popover:See,PopoverAnchor:wee,PopoverContent:xl,PopoverTrigger:Cee,Input:Rc,Select:Tee,SelectContent:El,SelectGroup:Eee,SelectItem:Ol,SelectLabel:Dl,SelectSeparator:kl,SelectTrigger:Cl,SelectValue:Dee,Tooltip:jee,TooltipContent:Al,TooltipProvider:Aee,TooltipTrigger:Mee};function Nee({pathPreview:e}){return(0,U.jsxs)(`div`,{className:`rounded-lg border border-gray-200 bg-gray-50/70 px-3 py-2.5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-medium text-gray-600`,children:[(0,U.jsx)(Ya,{"aria-hidden":`true`,className:`h-4 w-4 text-gray-400`}),(0,U.jsx)(`span`,{className:`truncate`,children:e.rootLabel})]}),(0,U.jsx)(`div`,{className:`mt-2`,children:e.segments.map((e,t)=>{let n=e.kind===`directory`?Ya:Va;return(0,U.jsxs)(`div`,{className:`relative flex min-w-0 items-center gap-2 py-1 text-xs text-gray-700`,style:{paddingLeft:`${(t+1)*18}px`},children:[(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`absolute bottom-1/2 top-[-0.25rem] w-px bg-gray-200`,style:{left:`${t*18+7}px`}}),(0,U.jsx)(n,{"aria-hidden":`true`,className:`h-4 w-4 shrink-0 text-gray-400`}),(0,U.jsx)(`span`,{className:`truncate font-medium`,children:e.label})]},`${t}:${e.label}`)})})]})}var Pee=680,Fee=.82,Iee=560,Ml=bl(`24rem`),Lee={back:Ci,"calendar-clock":la,command:Ca,file:Va,files:Ha,folder:Ya,inbox:ao,"list-collapse":mo,"message-square-plus":xo,"panel-app":di,project:Ua,skill:Fr};function Nl(e,t){return!t.sectionKeys||t.sectionKeys.length===0?!0:!!(e.sectionKey&&t.sectionKeys.includes(e.sectionKey))}function Ree(e,t){return e?.length?e.some(e=>e.key===t)?t:e[0].key:null}function zee({icon:e}){let t=Lee[e];return(0,U.jsx)(`span`,{"aria-hidden":`true`,"data-input-surface-icon":e,className:`inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-gray-100 text-gray-500`,children:(0,U.jsx)(t,{className:`h-3.5 w-3.5`})})}function Bee({item:e,texts:t}){return e?(0,U.jsxs)(`div`,{className:`space-y-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.subtitle?(0,U.jsx)(`span`,{className:`inline-flex rounded-full bg-primary/10 px-2 py-0.5 text-[11px] font-semibold text-primary`,children:e.subtitle}):null,(0,U.jsx)(`span`,{className:`text-sm font-semibold text-gray-900`,children:e.title})]}),(0,U.jsx)(`p`,{className:`text-xs leading-5 text-gray-600`,children:e.description}),e.pathPreview?(0,U.jsx)(Nee,{pathPreview:e.pathPreview}):null,(0,U.jsx)(`div`,{className:`space-y-1`,children:e.detailLines.map(e=>(0,U.jsx)(`div`,{className:`min-w-0 break-all rounded-md bg-gray-50 px-2 py-1 text-[11px] leading-5 text-gray-600`,children:e},e))}),(0,U.jsx)(`div`,{className:`pt-1 text-[11px] text-gray-500`,children:e.hintLabel??t.itemHintLabel})]}):(0,U.jsx)(`div`,{className:`text-xs text-gray-500`,children:t.hintLabel})}function Pl(e){let{activeIndex:t,event:n,isOpen:r,items:i,onOpenChange:a,onSelectItem:o,setActiveIndex:s}=e;return r?n.key===`Escape`?(n.preventDefault(),a(!1),!0):i.length===0?!1:n.key===`ArrowDown`?(n.preventDefault(),s(e=>(e+1)%i.length),!0):n.key===`ArrowUp`?(n.preventDefault(),s(e=>(e-1+i.length)%i.length),!0):n.key===`Enter`&&!n.shiftKey||n.key===`Tab`?(n.preventDefault(),o(i[t]),!0):!1:!1}var Fl=(0,H.forwardRef)(function(e,t){let{Popover:n,PopoverAnchor:r,PopoverContent:i}=jl,{elementRef:a,width:o}=Lc(),s=(0,H.useRef)(null),[c,l]=(0,H.useState)({index:0,itemsSignature:``}),{isOpen:u,isLoading:d,filterOptions:f,items:p,notice:m,texts:h,onSelectItem:g,onOpenChange:_,onDetailsPointerDown:v}=e,[y,b]=(0,H.useState)(f?.[0]?.key??null),x=(0,H.useMemo)(()=>Ree(f,y),[y,f]),S=(0,H.useMemo)(()=>f?.find(e=>e.key===x)??null,[f,x]),C=(0,H.useMemo)(()=>f?.map(e=>({...e,count:p.filter(t=>Nl(t,e)).length}))??[],[f,p]),w=(0,H.useMemo)(()=>S?p.filter(e=>Nl(e,S)):p,[S,p]),T=(0,H.useMemo)(()=>w.map(e=>e.key).join(``),[w]),E=(0,H.useMemo)(()=>w.some(e=>!!e.sectionLabel?.trim()),[w]),D=c.itemsSignature===T?c.index:0,O=w.length===0?0:Math.min(D,w.length-1),k=w[O]??null,A=(0,H.useCallback)(e=>{b(e),l({index:0,itemsSignature:``})},[]),j=(0,H.useCallback)(e=>{l(t=>{let n=t.itemsSignature===T?t.index:0;return{index:typeof e==`function`?e(n):e,itemsSignature:T}})},[T]),M=(0,H.useCallback)(e=>{e.selectionBehavior===`navigate`&&l({index:0,itemsSignature:``}),g(e)},[g]),N=(0,H.useMemo)(()=>{if(o)return Math.min(o>Iee?o*Fee:o,Pee)},[o]);return(0,H.useImperativeHandle)(t,()=>({handleKeyDown:e=>Pl({activeIndex:O,event:e,isOpen:u,items:w,onOpenChange:_,onSelectItem:M,setActiveIndex:j})}),[O,u,_,M,j,w]),Ic({containerRef:s,activeIndex:O,itemCount:w.length,isEnabled:u&&!d,getItemSelector:e=>`[data-input-surface-index="${e}"]`}),(0,U.jsxs)(n,{open:u,onOpenChange:_,children:[(0,U.jsx)(r,{asChild:!0,children:(0,U.jsx)(`div`,{ref:a,className:`pointer-events-none absolute bottom-0 left-3 right-3 top-0`})}),(0,U.jsx)(i,{side:`top`,align:`start`,sideOffset:10,className:`z-[70] flex max-w-[calc(100vw-1.5rem)] flex-col overflow-hidden rounded-2xl border border-gray-200 bg-white/95 p-0 shadow-2xl backdrop-blur-md`,onOpenAutoFocus:e=>e.preventDefault(),style:{height:Ml,maxHeight:Ml,width:N?`${N}px`:void 0},children:(0,U.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[minmax(220px,300px)_minmax(0,1fr)]`,children:[(0,U.jsxs)(`div`,{className:`flex min-h-0 flex-col border-r border-gray-200`,children:[!d&&C.length>0?(0,U.jsx)(`div`,{className:`flex shrink-0 gap-0.5 overflow-x-auto px-2 pb-1.5 pt-2`,children:C.map(({count:e,key:t,label:n})=>{let r=t===x;return(0,U.jsxs)(`button`,{type:`button`,"aria-pressed":r,onPointerDown:e=>e.preventDefault(),onClick:()=>A(t),className:`inline-flex h-7 shrink-0 items-center gap-1 rounded-md px-2 text-[11px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 ${r?`bg-gray-100 text-gray-900`:`text-gray-600 hover:bg-gray-100 hover:text-gray-900`}`,children:[(0,U.jsx)(`span`,{children:n}),(0,U.jsx)(`span`,{className:r?`text-gray-500`:`text-gray-400`,children:e})]},t)})}):null,!d&&m?(0,U.jsxs)(`div`,{className:`mx-2 mb-1.5 flex items-start gap-2 rounded-lg border border-red-200 bg-red-50 px-2.5 py-2 text-xs leading-4 text-red-700`,children:[(0,U.jsx)(Vr,{"aria-hidden":`true`,className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,U.jsx)(`span`,{children:m.message})]}):null,(0,U.jsx)(`div`,{ref:s,role:`listbox`,"aria-label":h.sectionLabel,className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto overscroll-contain ${!d&&C.length>0?`px-2 pb-2`:`p-2`}`,children:d?(0,U.jsx)(`div`,{className:`p-2 text-xs text-gray-500`,children:h.loadingLabel}):(0,U.jsxs)(U.Fragment,{children:[E?null:(0,U.jsx)(`div`,{className:`mb-1 px-1.5 text-[11px] font-semibold uppercase tracking-wide text-gray-500`,children:h.sectionLabel}),w.length===0?(0,U.jsx)(`div`,{className:`px-1.5 text-xs text-gray-400`,children:h.emptyLabel}):(0,U.jsx)(`div`,{children:w.map((e,t)=>{let{icon:n,key:r,sectionKey:i,sectionLabel:a,title:o,subtitle:s}=e,c=t===O,l=w[t-1];return(0,U.jsxs)(`div`,{children:[E&&a?.trim()&&l?.sectionKey!==i?(0,U.jsx)(`div`,{className:`px-1.5 pb-1 pt-1.5 text-[11px] font-semibold uppercase tracking-wide text-gray-500`,children:a}):null,(0,U.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":c,"data-input-surface-index":t,onPointerMove:e=>{e.pointerType!==`touch`&&j(t)},onPointerDown:t=>{t.button>0||(t.preventDefault(),M(e))},onClick:t=>{t.detail===0&&M(e)},className:`flex w-full items-center gap-1.5 rounded-md px-1.5 py-1 text-left leading-4 transition-colors ${c?`bg-gray-100 text-gray-900`:`text-gray-700 hover:bg-gray-100`}`,children:[n?(0,U.jsx)(zee,{icon:n}):null,(0,U.jsx)(`span`,{className:`truncate text-xs font-medium`,children:o}),(0,U.jsx)(`span`,{className:`truncate text-xs text-gray-500`,children:s})]})]},r)})})]})})]}),(0,U.jsx)(`div`,{className:`custom-scrollbar min-h-0 min-w-0 select-text overflow-y-auto overscroll-contain p-2.5`,onPointerDown:v,children:(0,U.jsx)(Bee,{item:k,texts:h})})]})})]})});function Il(e){return`${e.key}:${e.marker}:${e.start}`}function Ll(e,t){return t.type===`insert-text`&&e.query===``&&e.end===e.start+e.marker.length}function Rl(e,t,n){if(!t)return null;let r=Il(t);return e===r?e:Ll(t,n)?r:null}function zl(e){let{children:t,inputSurface:n,onInputSurfaceTriggerChange:r,onSelectItem:i,triggerSpecs:a=[pc]}=e,o=(0,H.useRef)(null),s=(0,H.useRef)(!1),c=(0,H.useRef)(null),[l,u]=(0,H.useState)(null),d=!!n&&l!==null,f=(0,H.useCallback)((e,t)=>{c.current=e,u(e),r?.(e?t:null)},[r]),p=(0,H.useCallback)((e,t,n)=>{let r=Nc(e,t,a),i=Rl(c.current,r,n);f(i,i?r:null)},[f,a]),m=(0,H.useCallback)(e=>o.current?.handleKeyDown(e)??!1,[]),h=(0,H.useCallback)(e=>{!e&&!s.current&&f(null,null)},[f]);return(0,U.jsxs)(U.Fragment,{children:[t((0,H.useMemo)(()=>({onInputSurfaceKeyDown:m,onInputSurfaceOpenChange:h,onInputSurfaceSnapshotChange:p}),[m,h,p])),n&&d?(0,U.jsx)(Fl,{ref:o,isOpen:d,isLoading:n.isLoading,filterOptions:n.filterOptions,items:n.items,notice:n.notice,texts:n.texts,onSelectItem:e=>{e.selectionBehavior!==`navigate`&&f(null,null),i(e)},onOpenChange:h,onDetailsPointerDown:()=>{s.current=!0,requestAnimationFrame(()=>{s.current=!1})}},l):null]})}var Bl=Ut(`inline-flex items-center justify-center whitespace-nowrap rounded-full text-sm font-medium transition-all duration-fast focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:pointer-events-none disabled:opacity-50`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary-600 active:bg-primary-700 shadow-sm`,destructive:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,outline:`border border-border bg-card text-muted-foreground hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`,secondary:`bg-muted text-foreground hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`,ghost:`text-muted-foreground hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`,primary:`bg-primary text-primary-foreground hover:bg-primary-600 active:bg-primary-700 shadow-sm`,subtle:`bg-muted text-muted-foreground hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`,"primary-outline":`border border-primary/30 text-primary hover:bg-primary hover:text-primary-foreground`},size:{default:`h-9 px-4 py-2`,sm:`h-8 px-3 text-xs`,lg:`h-11 px-5 text-[14px]`,xl:`h-12 px-6 text-[15px]`,icon:`h-9 w-9`}},defaultVariants:{variant:`default`,size:`default`}}),Vl=H.forwardRef(({className:e,variant:t,size:n,...r},i)=>(0,U.jsx)(`button`,{className:W(Bl({variant:t,size:n,className:e})),ref:i,...r}));Vl.displayName=`ChatButton`;function Hl(){return(0,U.jsx)(`span`,{"aria-hidden":`true`,"data-testid":`chat-stop-icon`,className:`block h-3 w-3 rounded-[2px] bg-foreground shadow-[inset_0_0_0_1px_hsl(var(--border))]`})}function Ul({contextWindow:e}){let{Tooltip:t,TooltipContent:n,TooltipProvider:r,TooltipTrigger:i}=jl,a=Math.max(0,Math.min(1,e.ratio)),o=Math.round(a*360);return(0,U.jsx)(r,{delayDuration:0,children:(0,U.jsxs)(t,{children:[(0,U.jsx)(i,{asChild:!0,children:(0,U.jsxs)(`button`,{type:`button`,className:`relative inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`,"aria-label":e.label,title:e.label,children:[(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`absolute inset-[7px] rounded-full`,style:{background:`conic-gradient(hsl(var(--muted-foreground)) ${o}deg, hsl(var(--border)) 0deg)`}}),(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`absolute inset-[10px] rounded-full bg-card`})]})}),(0,U.jsx)(n,{side:`top`,className:`max-w-[18rem]`,children:(0,U.jsxs)(`div`,{className:`space-y-1.5 text-xs`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-5 font-semibold text-foreground`,children:[(0,U.jsx)(`span`,{children:e.label}),(0,U.jsx)(`span`,{children:e.percentLabel})]}),e.details.map(e=>(0,U.jsxs)(H.Fragment,{children:[e.dividerBefore?(0,U.jsx)(`div`,{"aria-hidden":`true`,className:`my-2 border-t border-border/70`,"data-testid":`context-window-detail-divider`}):null,(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-5 text-muted-foreground`,children:[(0,U.jsx)(`span`,{children:e.label}),(0,U.jsx)(`span`,{className:`font-medium text-foreground`,children:e.value})]})]},e.label))]})})]})})}function Wl({children:e,label:t}){let{Tooltip:n,TooltipContent:r,TooltipProvider:i,TooltipTrigger:a}=jl;return(0,U.jsx)(i,{delayDuration:250,children:(0,U.jsxs)(n,{children:[(0,U.jsx)(a,{asChild:!0,children:(0,U.jsx)(`span`,{className:`inline-flex`,children:e})}),(0,U.jsx)(r,{side:`top`,className:`text-xs`,children:t})]})})}function Gl({isSending:e,canStopGeneration:t,sendDisabled:n,stopDisabled:r,stopHint:i,sendButtonLabel:a,sendIcon:o=`send`,stopButtonLabel:s,contextWindow:c,onSend:l,onStop:u}){return(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[c?(0,U.jsx)(Ul,{contextWindow:c}):null,!e||!n?(0,U.jsx)(Wl,{label:a,children:(0,U.jsx)(Vl,{size:`icon`,className:`h-8 w-8 rounded-full`,"aria-label":a,onClick:()=>void l(),disabled:n,children:o===`continue`?(0,U.jsx)(Uo,{"data-testid":`chat-continue-input-icon`,className:`h-4 w-4`}):(0,U.jsx)(aa,{className:`h-5 w-5`})})}):t?(0,U.jsx)(Wl,{label:s,children:(0,U.jsx)(Vl,{size:`icon`,variant:`outline`,className:`h-8 w-8 rounded-full`,"aria-label":s,onClick:()=>void u(),disabled:r,children:(0,U.jsx)(Hl,{})})}):(0,U.jsx)(Wl,{label:i,children:(0,U.jsx)(Vl,{size:`icon`,variant:`outline`,className:`h-8 w-8 rounded-full`,"aria-label":s,disabled:!0,children:(0,U.jsx)(Hl,{})})})]})}function Kl(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>[e.label,e.key,e.description].filter(e=>typeof e==`string`&&e.trim().length>0).join(` `).toLowerCase().includes(n)):e}var ql=bl(`20rem`),Jl=`flex w-full items-center gap-3 rounded-lg px-2.5 py-2 text-left text-sm text-foreground transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 disabled:cursor-not-allowed disabled:opacity-50`;function Yl(e){let{Input:t}=jl,{onBack:n,picker:r}=e,i=(0,H.useRef)(null),a=(0,H.useId)(),[o,s]=(0,H.useState)(``),[c,l]=(0,H.useState)(0),u=(0,H.useMemo)(()=>new Set(r.selectedKeys),[r.selectedKeys]),d=(0,H.useMemo)(()=>r.groups?.filter(e=>e.options.length>0)??[],[r.groups]),f=(0,H.useMemo)(()=>d.length===0?null:d.map(e=>({...e,options:Kl(e.options,o)})).filter(e=>e.options.length>0),[d,o]),p=(0,H.useMemo)(()=>f===null?Kl(r.options,o):f.flatMap(e=>e.options),[f,r.options,o]),m=p.length===0?0:Math.min(c,p.length-1);Ic({containerRef:i,activeIndex:m,itemCount:p.length,isEnabled:p.length>0,getItemSelector:e=>`[data-skill-index="${e}"]`});let h=e=>{if(u.has(e)){r.onSelectedKeysChange(r.selectedKeys.filter(t=>t!==e));return}r.onSelectedKeysChange([...r.selectedKeys,e])};return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`shrink-0 space-y-1.5 p-2`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:n,className:`inline-flex h-7 items-center gap-1 rounded-md pr-2 text-sm font-medium text-foreground transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40`,children:[(0,U.jsx)(da,{className:`h-4 w-4`}),(0,U.jsx)(`span`,{children:r.title})]}),(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(wi,{className:`pointer-events-none absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted-foreground/60`}),(0,U.jsx)(t,{value:o,onChange:e=>{s(e.target.value),l(0)},onKeyDown:e=>{if(p.length!==0){if(e.key===`ArrowDown`){e.preventDefault(),l(Math.min(m+1,p.length-1));return}if(e.key===`ArrowUp`){e.preventDefault(),l(Math.max(m-1,0));return}if(e.key===`Enter`){e.preventDefault();let t=p[m];t&&h(t.key)}}},placeholder:r.searchPlaceholder,role:`combobox`,"aria-controls":a,"aria-expanded":`true`,"aria-autocomplete":`list`,"aria-activedescendant":p[m]?`${a}-option-${m}`:void 0,className:`h-8 rounded-lg border-0 bg-muted/45 pl-7 text-xs shadow-none`})]})]}),(0,U.jsx)(`div`,{ref:i,id:a,role:`listbox`,"aria-multiselectable":`true`,className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto overscroll-contain px-1.5 pb-1`,children:r.isLoading?(0,U.jsx)(`div`,{className:`p-4 text-xs text-muted-foreground`,children:r.loadingLabel}):p.length===0?(0,U.jsx)(`div`,{className:`p-4 text-center text-xs text-muted-foreground`,children:r.emptyLabel}):(0,U.jsx)(`div`,{children:(()=>{let e=f??[{key:`all-skills`,options:p}],t=0;return e.map(e=>(0,U.jsxs)(`div`,{children:[e.label?(0,U.jsx)(`div`,{className:`px-2 pb-1 pt-2 text-[11px] font-medium text-muted-foreground/80`,children:e.label}):null,e.options.map(e=>{let n=t;t+=1;let r=u.has(e.key),i=n===m;return(0,U.jsxs)(`button`,{type:`button`,id:`${a}-option-${n}`,role:`option`,"aria-selected":r,"aria-label":e.label,"data-skill-index":n,onMouseEnter:()=>l(n),onClick:()=>h(e.key),className:`flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left transition-colors ${i?`bg-[var(--interaction-hover)]`:`hover:bg-[var(--interaction-hover)]`}`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`div`,{className:`truncate text-sm text-foreground`,children:e.label}),(0,U.jsx)(`div`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:e.description||e.key})]}),r?(0,U.jsx)(Ar,{className:`h-4 w-4 shrink-0 text-foreground/70`}):null]},e.key)})]},e.key))})()})}),r.manageHref&&r.manageLabel?(0,U.jsx)(`div`,{className:`shrink-0 px-2 pb-2 pt-1`,children:(0,U.jsxs)(`a`,{href:r.manageHref,className:`inline-flex w-full items-center gap-1.5 rounded-lg px-2 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground`,children:[r.manageLabel,(0,U.jsx)(fe,{className:`h-3 w-3`})]})}):null]})}function Xl(e){let{Popover:t,PopoverContent:n,PopoverTrigger:r,Tooltip:i,TooltipContent:a,TooltipProvider:o,TooltipTrigger:s}=jl,{accessories:c,label:l,picker:u}=e,[d,f]=(0,H.useState)(!1),[p,m]=(0,H.useState)(`actions`);return(0,U.jsxs)(t,{open:d,onOpenChange:e=>{f(e),e||m(`actions`)},children:[(0,U.jsx)(o,{children:(0,U.jsxs)(i,{children:[(0,U.jsx)(s,{asChild:!0,children:(0,U.jsx)(`span`,{className:`inline-flex`,children:(0,U.jsx)(r,{asChild:!0,children:(0,U.jsx)(`button`,{type:`button`,"aria-label":l,className:`relative inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40`,children:(0,U.jsx)(Di,{className:`h-4 w-4`})})})})}),(0,U.jsx)(a,{side:`top`,children:(0,U.jsx)(`p`,{className:`text-xs`,children:l})})]})}),(0,U.jsx)(n,{side:`top`,align:`start`,className:p===`skills`?`flex w-[min(340px,calc(100vw-1rem))] flex-col overflow-hidden rounded-2xl border-border/80 p-0 shadow-md`:`w-[min(220px,calc(100vw-1rem))] rounded-xl border-border/80 p-1.5 shadow-md`,style:{maxHeight:ql},children:p===`actions`?(0,U.jsxs)(U.Fragment,{children:[c.map(e=>(0,U.jsxs)(`button`,{type:`button`,"aria-label":e.label,disabled:e.disabled,onClick:()=>{e.onClick?.(),f(!1)},className:Jl,children:[e.icon===`paperclip`?(0,U.jsx)(zo,{className:`h-4 w-4`}):null,(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label})]},e.key)),u?(0,U.jsxs)(`button`,{type:`button`,onClick:()=>m(`skills`),className:Jl,children:[(0,U.jsx)(Fr,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:u.title}),(0,U.jsx)(fa,{className:`h-4 w-4 shrink-0 text-muted-foreground/60`})]}):null]}):u?(0,U.jsx)(Yl,{picker:u,onBack:()=>m(`actions`)}):null})]})}function Zl(e,t){let n=0;for(let r of t)if(r===e[n]&&(n+=1,n===e.length))return!0;return e.length===0}function Ql(e,t){let n=e.filter(Boolean).join(` `).toLowerCase(),r=n.replace(/[\s/_.-]+/g,``);return t.split(/\s+/).filter(Boolean).every(e=>{let t=e.replace(/[\s/_.-]+/g,``);return n.includes(e)||Zl(t,r)})}function $l(e,t,n){let r=n.trim().toLowerCase();return e.groups.filter(e=>e.options.length>0).filter(e=>t===`all`||e.key===t).map(e=>({...e,options:r?e.options.filter(e=>Ql([e.label,e.value,e.description],r)):e.options})).filter(e=>e.options.length>0)}function eu({discovery:e,onOpen:t}){return(0,U.jsx)(`div`,{className:`shrink-0 border-t border-border/60 px-1.5 py-1`,children:(0,U.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-1.5 rounded-lg px-2 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground`,onClick:t,children:[(0,U.jsx)(Fr,{className:`h-3.5 w-3.5 shrink-0 text-primary`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.summaryLabel}),(0,U.jsx)(`span`,{className:`shrink-0 font-medium text-primary`,children:e.viewLabel})]})})}function tu({discovery:e,open:t,onOpenChange:n,renderOption:r,restoreFocusRef:i}){let{Dialog:a,DialogContent:o,DialogDescription:s,DialogHeader:c,DialogTitle:l,Input:u}=jl,[d,f]=(0,H.useState)(``),[p,m]=(0,H.useState)(`all`),[h,g]=(0,H.useState)(null),[_,v]=(0,H.useState)(()=>new Set),y=(0,H.useMemo)(()=>e.groups.filter(e=>e.options.length>0),[e.groups]),b=p===`all`||y.some(e=>e.key===p)?p:`all`,x=(0,H.useMemo)(()=>$l(e,b,d),[e,d,b]),S=e=>{n(e),e||(f(``),m(`all`),g(null),v(new Set))},C=async t=>{if(!(h||_.has(t))){g(t);try{await e.onSelect(t),v(e=>new Set(e).add(t))}catch{return}finally{g(null)}}};return(0,U.jsx)(a,{open:t,onOpenChange:S,children:(0,U.jsxs)(o,{closeLabel:e.closeLabel,className:`flex h-[calc(100vh-1rem)] max-h-[42rem] w-[calc(100%-1rem)] max-w-2xl flex-col gap-0 overflow-hidden p-0 sm:h-[min(42rem,calc(100vh-2rem))]`,onCloseAutoFocus:e=>{e.preventDefault(),i.current?.focus()},children:[(0,U.jsxs)(c,{className:`shrink-0 gap-1 border-b border-border/70 px-5 pb-4 pt-5 text-left`,children:[(0,U.jsx)(l,{className:`pr-8 text-lg font-semibold text-foreground`,children:e.groupLabel}),(0,U.jsx)(s,{className:`text-sm text-muted-foreground`,children:e.summaryLabel}),(0,U.jsxs)(`div`,{className:`relative pt-3`,children:[(0,U.jsx)(wi,{className:`pointer-events-none absolute left-3 top-[1.375rem] h-4 w-4 text-muted-foreground/60`}),(0,U.jsx)(u,{autoFocus:!0,value:d,onChange:e=>f(e.currentTarget.value),placeholder:e.searchPlaceholder,className:`h-9 rounded-xl border-0 bg-muted/45 pl-9 text-sm shadow-none`})]}),(0,U.jsxs)(`div`,{role:`tablist`,"aria-label":e.groupLabel,className:`custom-scrollbar flex gap-1 overflow-x-auto overscroll-contain pt-2`,children:[(0,U.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":b===`all`,className:`shrink-0 rounded-full px-3 py-1.5 text-xs font-medium transition-colors ${b===`all`?`bg-foreground text-background`:`bg-muted/55 text-muted-foreground hover:bg-muted hover:text-foreground`}`,onClick:()=>m(`all`),children:e.allGroupLabel}),y.map(e=>(0,U.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":b===e.key,className:`shrink-0 rounded-full px-3 py-1.5 text-xs font-medium transition-colors ${b===e.key?`bg-foreground text-background`:`bg-muted/55 text-muted-foreground hover:bg-muted hover:text-foreground`}`,onClick:()=>m(e.key),children:e.label},e.key))]})]}),(0,U.jsxs)(`div`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto overscroll-contain px-3 py-2`,children:[x.length===0?(0,U.jsx)(`p`,{className:`px-3 py-10 text-center text-sm text-muted-foreground`,children:e.searchEmptyLabel}):null,x.map(t=>(0,U.jsxs)(`div`,{children:[b===`all`?(0,U.jsx)(`div`,{className:`px-3 pb-1 pt-3 text-xs font-medium text-muted-foreground`,children:t.label}):null,t.options.map(t=>{let n=_.has(t.value);return(0,U.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-3 rounded-xl px-3 py-2 hover:bg-[var(--interaction-hover)]`,children:[(0,U.jsx)(`div`,{className:`min-w-0 overflow-hidden`,title:t.label,children:r(t)}),(0,U.jsxs)(`button`,{type:`button`,disabled:h!==null||n,className:`inline-flex h-8 min-w-16 shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-lg bg-primary/10 px-3 text-xs font-medium text-primary transition-colors hover:bg-primary/15 disabled:cursor-default disabled:bg-muted disabled:text-muted-foreground`,onClick:()=>void C(t.value),children:[h===t.value?(0,U.jsx)(Ei,{className:`h-3.5 w-3.5 animate-spin`}):null,n?e.addedLabel:e.actionLabel]})]},t.value)})]},t.key))]}),(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-t border-border/70 px-5 py-3`,children:[(0,U.jsx)(`button`,{type:`button`,className:`rounded-lg px-3 py-2 text-xs text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground`,onClick:()=>{e.onDismiss(),S(!1)},children:e.dismissLabel}),(0,U.jsx)(`button`,{type:`button`,className:`rounded-lg bg-foreground px-4 py-2 text-xs font-medium text-background transition-opacity hover:opacity-85`,onClick:()=>S(!1),children:e.doneLabel})]})]})})}function nu({icon:e,className:t=``}){return e===`sparkles`?(0,U.jsx)(Fr,{className:`h-3.5 w-3.5 shrink-0 text-primary ${t}`}):e===`brain`?(0,U.jsx)(ca,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground ${t}`}):null}var ru={model:`min-w-0 max-w-[18rem]`,"session-type":`shrink-0`,thinking:`shrink-0`},iu={model:`w-[min(340px,calc(100vw-1rem))]`,"session-type":`w-[220px]`,thinking:`w-[180px]`},au=bl(`18rem`),ou=Sl(`18rem`);function su(e){return e.key===`model`&&e.selectedLabel&&e.selectedLabel.split(`/`).slice(1).join(`/`).trim()||e.selectedLabel}function cu(e){return e.groups?.filter(e=>e.options.length>0)??(e.options.length>0?[{key:`${e.key}-default`,options:e.options}]:[])}function lu({item:e}){let t=su(e);return e.selectedLabel?(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-left`,children:[(0,U.jsx)(nu,{icon:e.icon,className:e.key===`model`?`hidden [@container_nextclaw-chat-input-bar_(max-width:440px)]:block`:void 0}),(0,U.jsx)(`span`,{className:`nextclaw-chat-toolbar-mobile-label truncate sm:hidden [@container_nextclaw-chat-input-bar_(max-width:440px)]:hidden`,children:t}),(0,U.jsx)(`span`,{className:`nextclaw-chat-toolbar-label hidden truncate sm:inline [@container_nextclaw-chat-input-bar_(max-width:440px)]:hidden`,children:t})]}):e.loading?(0,U.jsx)(`div`,{className:`h-3 w-24 animate-pulse rounded bg-muted`}):(0,U.jsx)(`span`,{className:`truncate`,children:e.placeholder})}function uu({option:e}){return e.description?(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,U.jsx)(`span`,{className:`block truncate text-sm font-normal text-foreground`,children:e.label}),(0,U.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:e.description})]}):(0,U.jsx)(`span`,{className:`block truncate text-sm font-normal text-foreground`,children:e.label})}function du({item:e}){let{Input:t,Popover:n,PopoverContent:r,PopoverTrigger:i,Tooltip:a,TooltipContent:o,TooltipProvider:s,TooltipTrigger:c}=jl,[l,u]=(0,H.useState)(!1),[d,f]=(0,H.useState)(!1),[p,m]=(0,H.useState)(``),h=(0,H.useRef)(null),g=cu(e),_=(0,H.useMemo)(()=>{let e=p.trim().toLowerCase();return e?g.map(t=>({...t,options:t.options.filter(t=>Ql([t.label,t.value,t.description],e))})).filter(e=>e.options.length>0):g},[g,p]),v=g.some(e=>e.options.length>0),y=_.some(e=>e.options.length>0),{discovery:b,optionAction:x}=e,S=new Set(x?.activeValues??[]),C=t=>{if(u(t),t){e.onOpen?.();return}m(``)};return(0,U.jsxs)(n,{open:l,onOpenChange:C,children:[(0,U.jsx)(i,{asChild:!0,children:(0,U.jsxs)(`button`,{ref:h,type:`button`,"aria-label":e.selectedLabel?`${e.placeholder}: ${e.selectedLabel}`:e.placeholder,disabled:e.disabled,className:`nextclaw-chat-toolbar-select-trigger inline-flex h-8 w-auto items-center justify-between rounded-lg border-0 bg-transparent px-2 text-xs font-medium text-muted-foreground shadow-none hover:bg-[var(--interaction-hover)] hover:text-accent-foreground focus:outline-none focus:ring-0 disabled:cursor-not-allowed disabled:opacity-50 sm:px-3 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!basis-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!justify-center [@container_nextclaw-chat-input-bar_(max-width:440px)]:!max-w-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!min-w-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!px-0 ${ru[e.key]??``}`,children:[(0,U.jsx)(lu,{item:e}),(0,U.jsx)(ar,{className:`ml-1 h-3.5 w-3.5 shrink-0 text-muted-foreground/70 [@container_nextclaw-chat-input-bar_(max-width:440px)]:hidden`})]})}),(0,U.jsxs)(r,{className:`flex flex-col overflow-hidden rounded-2xl border-border/80 p-0 shadow-md ${iu[e.key]??``}`,style:{maxHeight:au},children:[(0,U.jsxs)(`div`,{className:`relative shrink-0 px-2 pb-1 pt-1.5`,children:[(0,U.jsx)(wi,{className:`pointer-events-none absolute left-[18px] top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/60`}),(0,U.jsx)(t,{value:p,onChange:e=>m(e.currentTarget.value),placeholder:e.search?.placeholder??e.placeholder,className:`h-7 rounded-lg border-0 bg-muted/45 pl-7 text-xs shadow-none`})]}),(0,U.jsxs)(`div`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[v?null:e.loading?(0,U.jsxs)(`div`,{className:`space-y-2 px-2 py-1`,children:[(0,U.jsx)(`div`,{className:`h-3 w-36 animate-pulse rounded bg-muted`}),(0,U.jsx)(`div`,{className:`h-3 w-28 animate-pulse rounded bg-muted`}),(0,U.jsx)(`div`,{className:`h-3 w-32 animate-pulse rounded bg-muted`})]}):e.emptyLabel?(0,U.jsx)(`div`,{className:`px-2 py-1 text-xs text-muted-foreground`,children:e.emptyLabel}):null,v&&!y?(0,U.jsx)(`div`,{className:`px-2 py-1 text-xs text-muted-foreground`,children:e.search?.emptyLabel??e.emptyLabel}):null,(0,U.jsx)(`div`,{className:`px-1.5 pb-0.5`,children:_.map(t=>(0,U.jsxs)(`div`,{children:[t.label?(0,U.jsx)(`div`,{className:`px-2 pb-0.5 pt-1.5 text-[11px] font-medium text-muted-foreground/80`,children:t.label}):null,t.options.map(t=>{let n=e.value===t.value,r=S.has(t.value),i=r?x?.activeLabel:x?.inactiveLabel;return(0,U.jsxs)(`div`,{className:`group flex items-center gap-1 rounded-lg hover:bg-[var(--interaction-hover)]`,children:[(0,U.jsxs)(`button`,{type:`button`,className:`flex min-w-0 flex-1 items-center gap-1.5 rounded-lg px-2 py-1 text-left leading-4`,onClick:()=>{e.onValueChange(t.value),C(!1)},children:[(0,U.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,U.jsx)(uu,{option:t})}),n?(0,U.jsx)(Ar,{className:`h-4 w-4 shrink-0 text-foreground/70`}):null]}),x&&i?(0,U.jsx)(s,{children:(0,U.jsxs)(a,{children:[(0,U.jsx)(c,{asChild:!0,children:(0,U.jsx)(`button`,{type:`button`,"aria-label":i,"aria-pressed":r,className:`mr-1 inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground/60 transition-[background-color,color,opacity] hover:bg-card hover:text-foreground focus:outline-none focus:ring-1 focus:ring-primary/40 ${r?``:`opacity-0 group-hover:opacity-100 group-focus-within:opacity-100`}`,onClick:e=>{e.stopPropagation(),x.onToggle(t.value,!r)},children:(0,U.jsx)(cs,{className:`h-3.5 w-3.5 ${r?`fill-current text-foreground`:``}`})})}),(0,U.jsx)(o,{side:`left`,children:(0,U.jsx)(`p`,{className:`text-xs`,children:i})})]})}):null]},t.value)})]},t.key))})]}),b?(0,U.jsx)(eu,{discovery:b,onOpen:()=>{C(!1),f(!0)}}):null,e.manageHref&&e.manageLabel?(0,U.jsx)(`div`,{className:`shrink-0 px-1.5 pb-1.5 pt-0.5`,children:(0,U.jsxs)(`a`,{href:e.manageHref,className:`inline-flex w-full items-center gap-1.5 rounded-lg px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground`,children:[e.manageLabel,(0,U.jsx)(fe,{className:`h-3 w-3`})]})}):null]}),b?(0,U.jsx)(tu,{discovery:b,open:d,onOpenChange:f,restoreFocusRef:h,renderOption:e=>(0,U.jsx)(uu,{option:e})}):null]})}function fu({item:e}){if(e.search)return(0,U.jsx)(du,{item:e});let{Select:t,SelectContent:n,SelectGroup:r,SelectItem:i,SelectLabel:a,SelectSeparator:o,SelectTrigger:s,SelectValue:c}=jl,l=cu(e),u=l.some(e=>e.options.length>0);return(0,U.jsxs)(t,{value:e.value,onValueChange:e.onValueChange,disabled:e.disabled,children:[(0,U.jsx)(s,{"aria-label":e.selectedLabel?`${e.placeholder}: ${e.selectedLabel}`:e.placeholder,title:e.selectedLabel,className:`nextclaw-chat-toolbar-select-trigger h-8 w-auto rounded-lg border-0 bg-transparent px-2 text-xs font-medium text-muted-foreground shadow-none hover:bg-[var(--interaction-hover)] hover:text-accent-foreground focus:ring-0 sm:px-3 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!basis-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!justify-center [@container_nextclaw-chat-input-bar_(max-width:440px)]:!max-w-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!min-w-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!px-0 ${ru[e.key]??``}`,children:e.selectedLabel||e.loading?(0,U.jsx)(lu,{item:e}):(0,U.jsx)(c,{placeholder:e.placeholder})}),(0,U.jsxs)(n,{className:iu[e.key]??``,style:{maxHeight:ou},children:[u?null:e.loading?(0,U.jsxs)(`div`,{className:`space-y-2 px-3 py-2`,children:[(0,U.jsx)(`div`,{className:`h-3 w-36 animate-pulse rounded bg-muted`}),(0,U.jsx)(`div`,{className:`h-3 w-28 animate-pulse rounded bg-muted`}),(0,U.jsx)(`div`,{className:`h-3 w-32 animate-pulse rounded bg-muted`})]}):e.emptyLabel?(0,U.jsx)(`div`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:e.emptyLabel}):null,l.map((e,t)=>(0,U.jsxs)(`div`,{children:[t>0?(0,U.jsx)(o,{}):null,(0,U.jsxs)(r,{children:[e.label?(0,U.jsx)(a,{children:e.label}):null,e.options.map(e=>(0,U.jsx)(i,{value:e.value,className:`py-1.5`,children:(0,U.jsx)(uu,{option:e})},e.value))]})]},e.key))]})]})}function pu({actions:e,accessories:t=[],addMenuLabel:n,selects:r,skillPicker:i,trailingSelects:a=[]}){let o=n??i?.title??t[0]?.label;return(0,U.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-2 px-3 pb-3`,children:[(0,U.jsxs)(`div`,{className:`nextclaw-chat-toolbar-leading-controls flex min-w-0 flex-1 flex-wrap items-center gap-1 overflow-hidden`,children:[o?(0,U.jsx)(Xl,{label:o,accessories:t,picker:i}):null,r.map(e=>(0,U.jsx)(fu,{item:e},e.key))]}),(0,U.jsxs)(`div`,{className:`flex shrink-0 items-end gap-1`,children:[a.length>0?(0,U.jsx)(`div`,{className:`nextclaw-chat-toolbar-trailing-selects flex min-w-0 items-center gap-1`,children:a.map(e=>(0,U.jsx)(fu,{item:e},e.key))}):null,(0,U.jsx)(Gl,{...e})]})]})}var mu=(0,H.createContext)(null);function hu(e,t){let n=null;return e!=null&&(n=e[1]),{getTheme:function(){return t??(n==null?null:n.getTheme())}}}function gu(){let e=(0,H.useContext)(mu);return e??function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),e}function G(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function _u(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var vu=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,yu=vu&&`documentMode`in document?document.documentMode:null,bu=vu&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),xu=vu&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Su=!(!vu||!(`InputEvent`in window)||yu)&&`getTargetRanges`in new window.InputEvent(`input`),Cu=vu&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,wu=vu&&/Android/.test(navigator.userAgent),Tu=vu&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!wu,Eu=vu&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Du=vu&&wu&&Eu,Ou=vu&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&bu&&!Eu,ku=0,Au=1,ju=2,Mu=1,Nu=2,Pu=3,Fu=4,Iu=5,Lu=6,Ru=Tu||Cu||Ou?`\xA0`:``,zu=`
|
|
3
3
|
|
|
4
4
|
`,Bu=xu?`\xA0`:Ru,Vu={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Hu={directionless:1,unmergeable:2},Uu={center:2,end:6,justify:4,left:1,right:3,start:5},Wu={[Nu]:`center`,[Lu]:`end`,[Fu]:`justify`,[Mu]:`left`,[Pu]:`right`,[Iu]:`start`},Gu={normal:0,segmented:2,token:1},Ku={[ku]:`normal`,[ju]:`segmented`,[Au]:`token`},qu=`$config`;function Ju(e,t,n,r,i,a){let o=e.getFirstChild();for(;o!==null;){let e=o.__key;o.__parent===t&&(Y(o)&&Ju(o,e,n,r,i,a),n.has(e)||a.delete(e),i.push(e)),o=o.getNextSibling()}}var Yu=!1,Xu=0;function Zu(e){Xu=e.timeStamp}function Qu(e,t,n){let r=e.nodeName===`BR`,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&Uh(e,n)!==void 0}function $u(e,t,n){let r=Mg(wg(n)),i=null,a=null;r!==null&&r.anchorNode===e&&(i=r.anchorOffset,a=r.focusOffset);let o=e.nodeValue;o!==null&&ng(t,o,i,a,!1)}function ed(e,t,n){if(q(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return Ph(t)&&n.isAttached()}function td(e,t,n,r){for(let i=e;i&&!qg(i);i=vg(i)){let e=Uh(i,t);if(e!==void 0){let t=Vh(e,n);if(t)return ch(t)||!Pg(i)?void 0:[i,t]}else if(i===r)return[r,Jh(n)]}}function nd(e,t,n){Yu=!0;let r=performance.now()-Xu>100;try{nh(e,()=>{let i=J()||function(e){return e.getEditorState().read(()=>{let e=J();return e===null?null:e.clone()})}(e),a=new Map,o=e.getRootElement(),s=e._editorState,c=e._blockCursorElement,l=!1,u=``;for(let n=0;n<t.length;n++){let d=t[n],f=d.type,p=d.target,m=td(p,e,s,o);if(!m)continue;let[h,g]=m;if(f===`characterData`)r&&K(g)&&Ph(p)&&ed(i,p,g)&&$u(p,g,e);else if(f===`childList`){l=!0;let t=d.addedNodes;for(let n=0;n<t.length;n++){let r=t[n],i=Hh(r),a=r.parentNode;if(a!=null&&r!==c&&i===null&&!Qu(r,a,e)){if(xu){let e=(Pg(r)?r.innerText:null)||r.nodeValue;e&&(u+=e)}a.removeChild(r)}}let n=d.removedNodes,r=n.length;if(r>0){let t=0;for(let i=0;i<r;i++){let r=n[i];(Qu(r,p,e)||c===r)&&(p.appendChild(r),t++)}r!==t&&a.set(h,g)}}}if(a.size>0)for(let[t,n]of a)n.reconcileObservedMutation(t,e);let d=n.takeRecords();if(d.length>0){for(let t=0;t<d.length;t++){let n=d[t],r=n.addedNodes,i=n.target;for(let t=0;t<r.length;t++){let n=r[t],a=n.parentNode;a==null||n.nodeName!==`BR`||Qu(n,i,e)||a.removeChild(n)}}n.takeRecords()}i!==null&&(l&&Yh(i),xu&&gg(e)&&i.insertRawText(u))})}finally{Yu=!1}}function rd(e){let t=e._observer;t!==null&&nd(e,t.takeRecords(),t)}function id(e){(function(e){Xu===0&&wg(e).addEventListener(`textInput`,Zu,!0)})(e),e._observer=new MutationObserver((t,n)=>{nd(e,t,n)})}var ad=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||fd).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=t.resetOnCopyNode||!1}};function od(e,t){return new ad(e,t)}function sd(e){let t=new Map,n=new Set;for(let r=typeof e==`function`?e:e.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){let{ownNodeConfig:e}=Yg(r);if(e&&e.stateConfigs)for(let r of e.stateConfigs){let e;`stateConfig`in r?(e=r.stateConfig,r.flat&&n.add(e.key)):e=r,t.set(e.key,e)}}return{flatKeys:n,sharedConfigMap:t}}var cd=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;let{sharedConfigMap:a}=this.sharedNodeState;this.size=i===void 0?function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(a,n,r):i}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];t!==void 0&&(n=e.parse(t)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return dd(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(let[i,a]of Object.entries(n)){let n=e.get(i);n?t.has(n)||t.set(n,n.parse(a)):(r||={},r[i]=a)}return r}(n.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;r.has(e)||i&&n in i||(i&&(delete i[n],this.unknownState=dd(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function ld(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new cd(t,ud(t));return t.__state=n,n}function ud(e){return e.__state?e.__state.sharedNodeState:wh(Bg(),e.getType()).sharedNodeState}function dd(e){if(e)for(let t in e)return e}function fd(e){return e}function pd(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function md(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function hd(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function gd(e,t){let n=e.__mode,r=e.__format,i=e.__style,a=t.__mode,o=t.__format,s=t.__style,c=e.__state,l=t.__state;return(n===null||n===a)&&(r===null||r===o)&&(i===null||i===s)&&(e.__state===null||c===l||function(e,t){if(e===t)return!0;let n=new Set;return!(e&&pd(n,e,t)||t&&pd(n,t,e)||e&&md(n,e,t)||t&&md(n,t,e))}(c,l))}function _d(e,t){let n=e.mergeWithSibling(t),r=Um()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function vd(e){let t,n,r=e;if(r.__text!==``||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&K(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==``){if(gd(t,r)){r=_d(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&K(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==``){if(gd(r,n)){r=_d(r,n);break}break}n.remove()}}else r.remove()}function yd(e){return bd(e.anchor),bd(e.focus),e}function bd(e){for(;e.type===`element`;){let t=e.getNode(),n=e.offset,r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),K(r)){e.set(r.__key,i?r.getTextContentSize():0,`text`,!0);break}if(!Y(r))break;e.set(r.__key,i?r.getChildrenSize():0,`element`,!0)}}var xd,Sd,Cd,wd,Td,Ed,Dd,Od,kd,Ad,jd=``,Md=null,Nd=null,Pd=!1,Fd=!1;function Id(e,t){let n=Dd.get(e);if(t!==null){let n=ef(e);n.parentNode===t&&t.removeChild(n)}if(Od.has(e)||Sd._keyToDOMMap.delete(e),Y(n)){let e=Jd(n,Dd);Ld(e,0,e.length-1,null)}n!==void 0&&pg(Ad,Cd,wd,n,`destroyed`)}function Ld(e,t,n,r){for(let i=t;i<=n;++i){let t=e[i];t!==void 0&&Id(t,r)}}function Rd(e,t){e.setProperty(`text-align`,t)}var zd=`40px`;function Bd(e,t){let n=xd.theme.indent;if(typeof n==`string`){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}if(t===0)return void e.style.setProperty(`padding-inline-start`,``);let r=getComputedStyle(Sd._rootElement||e).getPropertyValue(`--lexical-indent-base-value`)||zd;e.style.setProperty(`padding-inline-start`,`calc(${t} * ${r})`)}function Vd(e,t){let n=e.style;t===0?Rd(n,``):t===1?Rd(n,`left`):t===2?Rd(n,`center`):t===3?Rd(n,`right`):t===4?Rd(n,`justify`):t===5?Rd(n,`start`):t===6&&Rd(n,`end`)}function Hd(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(uh(e))return null;let n=e.getParentOrThrow();return uh(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function Ud(e,t){let n=Od.get(e);n===void 0&&G(60);let r=n.createDOM(xd,Sd);if(function(e,t,n){let r=n._keyToDOMMap;(function(e,t,n){let r=`__lexicalKey_${t._key}`;e[r]=n})(t,n,e),r.set(e,t)}(e,r,Sd),K(n)?r.setAttribute(`data-lexical-text`,`true`):ch(n)&&r.setAttribute(`data-lexical-decorator`,`true`),Y(n)){let e=n.__indent,t=n.__size;if(Hd(r,n),e!==0&&Bd(r,e),t!==0){let e=t-1;Wd(Jd(n,Od),n,0,e,n.getDOMSlot(r))}let i=n.__format;i!==0&&Vd(r,i),n.isInline()||Kd(null,n,r)}else{let t=n.getTextContent();if(ch(n)){let t=n.decorate(Sd,xd);t!==null&&Xd(e,t),r.contentEditable=`false`}jd+=t}return t!==null&&t.insertChild(r),pg(Ad,Cd,wd,n,`created`),r}function Wd(e,t,n,r,i){let a=jd;jd=``;let o=n;for(;o<=r;++o){Ud(e[o],i);let t=Od.get(e[o]);t!==null&&K(t)?Md===null&&(Md=t.getFormat(),Nd=t.getStyle()):Y(t)&&o<r&&!t.isInline()&&(jd+=zu)}i.element.__lexicalTextContent=jd,jd=a+jd}function Gd(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return Pp(e)?`line-break`:ch(e)&&e.isInline()?`decorator`:null}return`empty`}return null}function Kd(e,t,n){let r=Gd(e,Dd),i=Gd(t,Od);r!==i&&t.getDOMSlot(n).setManagedLineBreak(i)}function qd(e,t,n){var r;Md=null,Nd=null,function(e,t,n){let r=jd,i=e.__size,a=t.__size;jd=``;let o=n.element;if(i===1&&a===1){let n=e.__first,r=t.__first;if(n===r)Yd(n,o);else{let e=ef(n),t=Ud(r,null);try{o.replaceChild(t,e)}catch(i){if(typeof i==`object`&&i){let a=`${i.toString()} Parent: ${o.tagName}, new child: {tag: ${t.tagName} key: ${r}}, old child: {tag: ${e.tagName}, key: ${n}}.`;throw Error(a)}throw i}Id(n,null)}let i=Od.get(r);K(i)&&Md===null&&(Md=i.getFormat(),Nd=i.getStyle())}else{let r=Jd(e,Dd),s=Jd(t,Od);if(r.length!==i&&G(227),s.length!==a&&G(228),i===0)a!==0&&Wd(s,0,0,a-1,n);else if(a===0){if(i!==0){let e=n.after==null&&n.before==null&&n.element.__lexicalLineBreak==null;Ld(r,0,i-1,e?null:o),e&&(o.textContent=``)}}else (function(e,t,n,r,i,a){let o=r-1,s=i-1,c,l,u=a.getFirstChild(),d=0,f=0;for(;d<=o&&f<=s;){let e=t[d],r=n[f];if(e===r)u=Zd(Yd(r,a.element)),d++,f++;else{if(l===void 0&&(l=Qd(n,f)),c===void 0)c=Qd(t,d);else if(!c.has(e)){d++;continue}if(!l.has(e)){u=Zd(ef(e)),Id(e,a.element),d++,c.delete(e);continue}if(c.has(r)){let e=_g(Sd,r);e!==u&&a.withBefore(u).insertChild(e),u=Zd(Yd(r,a.element)),d++,f++}else Ud(r,a.withBefore(u)),f++}let i=Od.get(r);i!==null&&K(i)?Md===null&&(Md=i.getFormat(),Nd=i.getStyle()):Y(i)&&f<=s&&!i.isInline()&&(jd+=zu)}let p=d>o,m=f>s;if(p&&!m){let e=n[s+1],t=e===void 0?null:Sd.getElementByKey(e);Wd(n,0,f,s,a.withBefore(t))}else m&&!p&&Ld(t,d,o,a.element)})(0,r,s,i,a,n)}o.__lexicalTextContent=jd,jd=r+jd}(e,t,t.getDOMSlot(n)),r=t,Md==null||Md===r.__textFormat||Fd||r.setTextFormat(Md),function(e){Nd==null||Nd===e.__textStyle||Fd||e.setTextStyle(Nd)}(t)}function Jd(e,t){let n=[],r=e.__first;for(;r!==null;){let e=t.get(r);e===void 0&&G(101),n.push(r),r=e.__next}return n}function Yd(e,t){let n=Dd.get(e),r=Od.get(e);n!==void 0&&r!==void 0||G(61);let i=Pd||Ed.has(e)||Td.has(e),a=_g(Sd,e);if(n===r&&!i){let e;if(Y(n)){let t=a.__lexicalTextContent;typeof t==`string`?e=t:(e=n.getTextContent(),a.__lexicalTextContent=e)}else e=n.getTextContent();return jd+=e,a}if(n!==r&&i&&pg(Ad,Cd,wd,r,`updated`),r.updateDOM(n,a,xd)){let n=Ud(e,null);return t===null&&G(62),t.replaceChild(n,a),Id(e,null),n}if(Y(n)){Y(r)||G(334,e);let t=r.__indent;(Pd||t!==n.__indent)&&Bd(a,t);let o=r.__format;if((Pd||o!==n.__format)&&Vd(a,o),i)qd(n,r,a),uh(r)||r.isInline()||Kd(n,r,a);else{let e=a.__lexicalTextContent,t;typeof e==`string`?t=e:(t=n.getTextContent(),a.__lexicalTextContent=t),jd+=t}if((Pd||r.__dir!==n.__dir)&&(Hd(a,r),uh(r)&&!Pd))for(let e of r.getChildren())Y(e)&&Hd(_g(Sd,e.getKey()),e)}else{let t=r.getTextContent();if(ch(r)){let t=r.decorate(Sd,xd);t!==null&&Xd(e,t)}jd+=t}if(!Fd&&uh(r)&&r.__cachedText!==jd){let e=r.getWritable();e.__cachedText=jd,r=e}return a}function Xd(e,t){let n=Sd._pendingDecorators,r=Sd._decorators;if(n===null){if(r[e]===t)return;n=Gh(Sd)}n[e]=t}function Zd(e){let t=e.nextSibling;return t!==null&&t===Sd._blockCursorElement&&(t=t.nextSibling),t}function Qd(e,t){let n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function $d(e,t,n,r,i,a){jd=``,Pd=r===2,Sd=n,xd=n._config,Cd=n._nodes,wd=Sd._listeners.mutation,Td=i,Ed=a,Dd=e._nodeMap,Od=t._nodeMap,Fd=t._readOnly,kd=new Map(n._keyToDOMMap);let o=new Map;return Ad=o,Yd(`root`,null),Sd=void 0,Cd=void 0,Td=void 0,Ed=void 0,Dd=void 0,Od=void 0,xd=void 0,kd=void 0,Ad=void 0,o}function ef(e){let t=kd.get(e);return t===void 0&&G(75,e),t}function tf(e){return{type:e}}var nf=tf(`SELECTION_CHANGE_COMMAND`),rf=tf(`CLICK_COMMAND`),af=tf(`BEFORE_INPUT_COMMAND`),of=tf(`INPUT_COMMAND`),sf=tf(`COMPOSITION_START_COMMAND`),cf=tf(`COMPOSITION_END_COMMAND`),lf=tf(`DELETE_CHARACTER_COMMAND`),uf=tf(`INSERT_LINE_BREAK_COMMAND`),df=tf(`INSERT_PARAGRAPH_COMMAND`),ff=tf(`CONTROLLED_TEXT_INSERTION_COMMAND`),pf=tf(`PASTE_COMMAND`),mf=tf(`REMOVE_TEXT_COMMAND`),hf=tf(`DELETE_WORD_COMMAND`),gf=tf(`DELETE_LINE_COMMAND`),_f=tf(`FORMAT_TEXT_COMMAND`),vf=tf(`UNDO_COMMAND`),yf=tf(`REDO_COMMAND`),bf=tf(`KEYDOWN_COMMAND`),xf=tf(`KEY_ARROW_RIGHT_COMMAND`),Sf=tf(`MOVE_TO_END`),Cf=tf(`KEY_ARROW_LEFT_COMMAND`),wf=tf(`MOVE_TO_START`),Tf=tf(`KEY_ARROW_UP_COMMAND`),Ef=tf(`KEY_ARROW_DOWN_COMMAND`),Df=tf(`KEY_ENTER_COMMAND`),Of=tf(`KEY_SPACE_COMMAND`),kf=tf(`KEY_BACKSPACE_COMMAND`),Af=tf(`KEY_ESCAPE_COMMAND`),jf=tf(`KEY_DELETE_COMMAND`),Mf=tf(`KEY_TAB_COMMAND`),Nf=tf(`DROP_COMMAND`),Pf=tf(`DRAGSTART_COMMAND`),Ff=tf(`DRAGOVER_COMMAND`),If=tf(`DRAGEND_COMMAND`),Lf=tf(`COPY_COMMAND`),Rf=tf(`CUT_COMMAND`),zf=tf(`SELECT_ALL_COMMAND`),Bf=tf(`FOCUS_COMMAND`),Vf=tf(`BLUR_COMMAND`),Hf=tf(`KEY_MODIFIER_COMMAND`),Uf=Object.freeze({}),Wf=[[`keydown`,function(e,t){Gf=e.timeStamp,Kf=e.key,!t.isComposing()&&X(t,bf,e)}],[`pointerdown`,function(e,t){let n=e.target,r=e.pointerType;Fg(n)&&r!==`touch`&&r!==`pen`&&e.button===0&&nh(t,()=>{Eh(n)||(Qf=!0)})}],[`compositionstart`,function(e,t){X(t,sf,e)}],[`compositionend`,function(e,t){xu?ep=!0:Cu||!Tu&&!Ou?X(t,cf,e):(tp=!0,np=e.data)}],[`input`,function(e,t){e.stopPropagation(),nh(t,()=>{t.dispatchCommand(of,e)},{event:e}),Jf=null}],[`click`,function(e,t){nh(t,()=>{let n=J(),r=Mg(wg(t)),i=Sm();if(r){if(q(n)){let t=n.anchor,a=t.getNode();if(t.type===`element`&&t.offset===0&&n.isCollapsed()&&!uh(a)&&qh().getChildrenSize()===1&&a.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i))r.removeAllRanges(),n.dirty=!0;else if(e.detail===3&&!n.isCollapsed()&&a!==n.focus.getNode()){let e=Zg(a,e=>Y(e)&&!e.isInline());Y(e)&&e.select(0)}}else if(e.pointerType===`touch`||e.pointerType===`pen`){let n=r.anchorNode;(Pg(n)||Ph(n))&&Yh(xm(i,r,t,e))}}X(t,rf,e)})}],[`cut`,Uf],[`copy`,Uf],[`dragstart`,Uf],[`dragover`,Uf],[`dragend`,Uf],[`paste`,Uf],[`focus`,Uf],[`blur`,Uf],[`drop`,Uf]];Su&&Wf.push([`beforeinput`,(e,t)=>function(e,t){let n=e.inputType;n===`deleteCompositionText`||xu&&gg(t)||n!==`insertCompositionText`&&X(t,af,e)}(e,t)]);var Gf=0,Kf=null,qf=0,Jf=null,Yf=new WeakMap,Xf=new WeakMap,Zf=!1,Qf=!1,$f=!1,ep=!1,tp=!1,np=``,rp=null,ip=[0,``,0,`root`,0];function ap(e,t,n,r,i){let a=e.anchor,o=e.focus,s=a.getNode(),c=Um(),l=Mg(wg(c)),u=l===null?null:l.anchorNode,d=a.key,f=c.getElementByKey(d),p=n.length;return d!==o.key||!K(s)||(!i&&(!Su||qf<r+50)||s.isDirty()&&p<2||Zh(n))&&a.offset!==o.offset&&!s.isComposing()||Nh(s)||s.isDirty()&&p>1||(i||!Su)&&f!==null&&!s.isComposing()&&u!==Fh(f)||l!==null&&t!==null&&(!t.collapsed||t.startContainer!==l.anchorNode||t.startOffset!==l.anchorOffset)||!s.isComposing()&&(s.getFormat()!==e.format||s.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),i=Mh(t);return n===0?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){let t=e.getPreviousSibling();return(K(t)||Y(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,s)}function op(e,t){return Ph(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function sp(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=e;Zf&&(Zf=!1,op(r,i)&&op(a,o)&&!rp)||nh(t,()=>{if(!n)return void Yh(null);if(!Oh(t,r,a))return;let s=J();if(rp&&q(s)&&s.isCollapsed()){let e=s.anchor,t=rp.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(s=rp.clone(),Yh(s))}if(rp=null,q(s)){let n=s.anchor,r=n.getNode();if(s.isCollapsed()){e.type===`Range`&&e.anchorNode===e.focusNode&&(s.dirty=!0);let i=wg(t).event,a=i?i.timeStamp:performance.now(),[o,c,l,u,d]=ip,f=qh(),p=!1===t.isComposing()&&f.getTextContent()===``;if(a<d+200&&n.offset===l&&n.key===u)cp(s,o,c);else if(n.type===`text`)K(r)||G(141),lp(s,r);else if(n.type===`element`&&!p){Y(r)||G(259);let e=n.getNode();e.isEmpty()?function(e,t){cp(e,t.getTextFormat(),t.getTextStyle())}(s,e):cp(s,s.format,``)}}else{let e=n.key,t=s.focus.key,r=s.getNodes(),a=r.length,c=s.isBackward(),l=c?o:i,u=c?i:o,d=c?t:e,f=c?e:t,p=2047,m=!1;for(let e=0;e<a;e++){let t=r[e],n=t.getTextContentSize();if(K(t)&&n!==0&&!(e===0&&t.__key===d&&l===n||e===a-1&&t.__key===f&&u===0)&&(m=!0,p&=t.getFormat(),p===0))break}s.format=m?p:0}}X(t,nf,void 0)})}function cp(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function lp(e,t){cp(e,t.getFormat(),t.getStyle())}function up(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function dp(e){let t=e.inputType,n=up(e),r=Um(),i=J();if(t===`deleteContentBackward`){if(i===null){let e=Sm();if(!q(e))return!0;Yh(e.clone())}if(q(i)){let t=i.anchor.key===i.focus.key;if(a=e.timeStamp,Kf===`MediaLast`&&a<Gf+30&&r.isComposing()&&t){if(zh(null),Gf=0,setTimeout(()=>{nh(r,()=>{zh(null)})},30),q(i)){let e=i.anchor.getNode();e.markDirty(),K(e)||G(142),lp(i,e)}}else{zh(null),e.preventDefault();let n=i.anchor.getNode(),a=n.getTextContent(),o=n.canInsertTextAfter(),s=i.anchor.offset===0&&i.focus.offset===a.length,c=Du&&t&&!s&&o;if(c&&i.isCollapsed()&&(c=!ch(hg(i.anchor,!0))),!c){X(r,lf,!0);let e=J();Du&&q(e)&&e.isCollapsed()&&(rp=e,setTimeout(()=>rp=null))}}return!0}}var a;if(!q(i))return!0;let o=e.data;Jf!==null&&tg(!1,r,Jf),i.dirty&&Jf===null||!i.isCollapsed()||uh(i.anchor.getNode())||n===null||i.applyDOMRange(n),Jf=null;let s=i.anchor,c=i.focus,l=s.getNode(),u=c.getNode();if(t===`insertText`||t===`insertTranspose`){if(o===`
|
|
@@ -106,4 +106,4 @@ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(
|
|
|
106
106
|
`):e;return(0,U.jsx)(ci,{delayDuration:250,children:(0,U.jsxs)(pi,{children:[(0,U.jsx)(ni,{asChild:!0,children:n?(0,U.jsx)(ge,{href:n.url,external:!0,icon:null,"aria-label":b(`desktopUpdatesVersionReleaseNotesLabel`).replace(`{currentVersion}`,e).replace(`{releaseVersion}`,n.versionLabel),className:u(r,`p-0 text-left`),children:e}):(0,U.jsx)(`span`,{tabIndex:0,"aria-label":e,className:r,children:e})}),(0,U.jsx)(li,{side:`bottom`,className:`max-w-72 whitespace-pre-line text-xs leading-relaxed`,children:i})]})})}function eae({supported:e,busyAction:t,snapshot:n}){if(!e||!n)return null;let r=en(n);return n.status===`downloading`?(0,U.jsx)(x7,{snapshot:n,releaseNotesLink:r}):n.status===`blocked`||n.status===`failed`?(0,U.jsx)(x7,{snapshot:n}):n.status===`downloaded`?(0,U.jsx)(b7,{link:r,children:(0,U.jsx)(`button`,{type:`button`,className:`inline-flex h-5 shrink-0 items-center rounded-full bg-emerald-50 px-2 text-[11px] font-semibold leading-none text-emerald-700 ring-1 ring-emerald-100 transition-colors hover:bg-emerald-100 disabled:opacity-70`,disabled:t===`applying`,onClick:()=>void Re.applyDownloadedUpdate(),children:b(t===`applying`?`desktopUpdatesInlineApplying`:`desktopUpdatesInlineReady`)})}):n.status===`update-available`?(0,U.jsx)(b7,{link:r,children:(0,U.jsx)(`button`,{type:`button`,className:`inline-flex h-5 shrink-0 items-center rounded-full bg-amber-50 px-2 text-[11px] font-semibold leading-none text-amber-700 ring-1 ring-amber-100 transition-colors hover:bg-amber-100 disabled:opacity-70`,disabled:t===`downloading`,onClick:()=>void Re.downloadUpdate(),children:b(t===`downloading`?`desktopUpdatesInlineDownloading`:`desktopUpdatesInlineDownload`)})}):null}function b7({children:e,link:t}){if(!t)return e;let n=b(`desktopUpdatesUpdateReleaseNotesLabel`).replace(`{version}`,t.versionLabel);return(0,U.jsxs)(`span`,{className:`group/update-release-notes relative inline-flex shrink-0`,children:[e,(0,U.jsx)(`span`,{"data-update-release-notes-hover":`true`,className:`invisible pointer-events-none absolute left-1/2 top-full z-[var(--z-tooltip,10150)] -translate-x-1/2 pt-1 opacity-0 transition-opacity group-hover/update-release-notes:visible group-hover/update-release-notes:pointer-events-auto group-hover/update-release-notes:opacity-100 group-focus-within/update-release-notes:visible group-focus-within/update-release-notes:pointer-events-auto group-focus-within/update-release-notes:opacity-100`,children:(0,U.jsx)(ge,{href:t.url,external:!0,icon:null,"aria-label":n,className:`whitespace-nowrap rounded-md border bg-popover px-3 py-1.5 text-left text-xs font-medium text-popover-foreground shadow-md outline-none transition-colors hover:bg-gray-100 focus-visible:ring-2 focus-visible:ring-gray-300`,children:n})})]})}function x7({snapshot:e,releaseNotesLink:t}){if(e.status===`blocked`||e.status===`failed`)return(0,U.jsx)(tae,{snapshot:e});let n=e.status===`downloading`?rae(e):null;return n?(0,U.jsx)(b7,{link:t??null,children:(0,U.jsx)(`span`,{tabIndex:t?0:void 0,className:`inline-flex h-5 shrink-0 items-center rounded-full bg-amber-50 px-2 text-[11px] font-semibold leading-none text-amber-700 ring-1 ring-amber-100 outline-none transition-colors hover:bg-amber-100 focus-visible:ring-2 focus-visible:ring-amber-300`,children:n})}):null}function tae({snapshot:e}){let t=nae(e),n=e.recoveryCommand?.trim()||null,r=e.diagnosticCommand?.trim()?b(`desktopUpdatesDiagnosticCommand`).replace(`{command}`,e.diagnosticCommand.trim()):null,i=e.errorMessage?.trim()||e.blockReason?.trim()||null,a=[t,e.status===`blocked`&&e.blockReason?b(`desktopUpdatesBlockedRootCause.${e.blockReason}`):null,i,n,r].filter(Boolean).join(`
|
|
107
107
|
`);return(0,U.jsx)(ci,{delayDuration:250,children:(0,U.jsxs)(pi,{children:[(0,U.jsx)(ni,{asChild:!0,children:(0,U.jsx)(`span`,{role:`img`,"aria-label":t,tabIndex:0,className:`inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-amber-50 text-[13px] font-bold leading-none text-amber-700 ring-1 ring-amber-100 outline-none focus-visible:ring-2 focus-visible:ring-amber-300`,children:`!`})}),(0,U.jsx)(li,{side:`bottom`,className:`max-w-80 whitespace-pre-line break-words text-xs leading-relaxed`,children:a})]})})}function nae(e){return e.status===`blocked`?b(`desktopUpdatesStatusBlocked`):b(e.failureStage?`desktopUpdatesFailureStage.${e.failureStage}`:`desktopUpdatesStatusFailed`)}function rae(e){let t=e.progress?.percent;return t==null?b(`desktopUpdatesInlineDownloading`):b(`desktopUpdatesInlineDownloadingPercent`).replace(`{percent}`,String(t))}var iae={connected:{dotClass:`bg-emerald-500`},disconnected:{dotClass:`h-2.5 w-2.5 rounded-full border border-gray-400 bg-transparent`},connecting:{dotClass:`text-amber-600`}};function aae({status:e,className:t}){let n=iae[e],r=b(e===`connected`?`connected`:e===`disconnected`?`disconnected`:`connecting`);return(0,U.jsx)(ci,{delayDuration:250,children:(0,U.jsxs)(pi,{children:[(0,U.jsx)(ni,{asChild:!0,children:(0,U.jsx)(`span`,{role:`status`,"aria-label":r,className:u(`inline-flex h-5 w-5 items-center justify-center`,t),children:e===`connecting`?(0,U.jsx)(Ei,{className:u(`h-3 w-3 animate-spin`,n.dotClass)}):(0,U.jsx)(`span`,{className:u(e===`connected`?`h-2 w-2 rounded-full`:``,n.dotClass)})})}),(0,U.jsx)(li,{side:`bottom`,className:`text-xs`,children:r})]})})}var oae=[`default-src 'none'`,`base-uri 'none'`,`connect-src 'none'`,`font-src data:`,`form-action 'none'`,`frame-src 'none'`,`img-src data: blob:`,`media-src data: blob:`,`object-src 'none'`,`script-src 'none'`,`style-src 'unsafe-inline'`].join(`; `);function sae(e){let t=new DOMParser().parseFromString(e,`text/html`);t.querySelectorAll(`base, script`).forEach(e=>e.remove()),t.querySelectorAll(`meta[http-equiv]`).forEach(e=>{let t=e.getAttribute(`http-equiv`)?.toLowerCase();(t===`content-security-policy`||t===`refresh`)&&e.remove()}),t.querySelectorAll(`*`).forEach(e=>{e.getAttributeNames().filter(e=>e.toLowerCase().startsWith(`on`)).forEach(t=>e.removeAttribute(t))}),t.querySelectorAll(`a[href]`).forEach(e=>{let t=e.getAttribute(`href`)?.trim()??``;if(t.toLowerCase().startsWith(`javascript:`)){e.removeAttribute(`href`);return}e.setAttribute(`target`,t.startsWith(`#`)?`_self`:`_blank`),e.setAttribute(`rel`,`noopener noreferrer`)});let n=t.createElement(`meta`);n.setAttribute(`http-equiv`,`Content-Security-Policy`),n.setAttribute(`content`,oae),t.head.prepend(n);let r=t.createElement(`style`);return r.dataset.nextclawInboxDefaults=``,r.textContent=[`:root { color-scheme: light dark; }`,`*, *::before, *::after { box-sizing: border-box; }`,`body { margin: 0; padding: 24px; color: CanvasText; background: Canvas; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif; line-height: 1.6; overflow-wrap: anywhere; }`,`img, svg, video { max-width: 100%; height: auto; }`,`pre { max-width: 100%; overflow: auto; }`].join(`
|
|
108
108
|
`),n.after(r),`<!doctype html>${t.documentElement.outerHTML}`}function cae({content:e,fillHeight:t,title:n}){let r=(0,H.useMemo)(()=>sae(e),[e]);return(0,U.jsx)(`iframe`,{className:u(`w-full rounded-xl bg-background`,t?`h-full min-h-0 border-0`:`h-[min(60vh,680px)] min-h-[360px] border border-border/70`),sandbox:`allow-popups allow-popups-to-escape-sandbox`,srcDoc:r,title:n})}function S7({className:e,content:t,contentType:n,fillHeight:r=!1,title:i}){return(0,U.jsx)(`div`,{className:u(`inbox-delivery-content`,e),children:n===`html`?(0,U.jsx)(cae,{content:t,fillHeight:r,title:i}):(0,U.jsx)(Uj,{text:t,role:`assistant`,texts:{copyCodeLabel:b(`chatCodeCopy`),copiedCodeLabel:b(`chatCodeCopied`)}})})}var lae={readerOpen:!1,activeDeliveryId:null},C7=P(e=>({snapshot:lae,setSnapshot:t=>e(e=>({snapshot:{...e.snapshot,...t}}))})),w7=[`inbox-deliveries`];function T7(e){return{deliveries:e,total:e.length,unreadCount:e.filter(e=>!e.readAt&&!e.archivedAt).length,unpresentedCount:e.filter(e=>!e.presentedAt&&!e.readAt&&!e.archivedAt).length}}var uae=class{constructor(e=jt){this.queryClient=e,this.cleanups=[],this.offerPromise=null,this.started=!1,this.start=()=>{this.started||(this.started=!0,this.cleanups.push(I.eventBus.on(c.inboxDeliveryChanged,this.handleDeliveryChanged)),typeof document<`u`&&(document.addEventListener(`visibilitychange`,this.handleVisibilityChange),this.cleanups.push(()=>document.removeEventListener(`visibilitychange`,this.handleVisibilityChange))),this.offerPendingDelivery())},this.stop=()=>{if(this.started)for(this.started=!1;this.cleanups.length>0;)this.cleanups.pop()?.()},this.closeReader=()=>{C7.getState().setSnapshot({readerOpen:!1})},this.selectInReader=async e=>{let t=await this.updateState(e,`present`);return C7.getState().setSnapshot({activeDeliveryId:t.id,readerOpen:!0}),t},this.markRead=async e=>await this.updateState(e,`read`),this.markUnread=async e=>await this.updateState(e,`mark_unread`),this.archive=async e=>await this.updateState(e,`archive`),this.restore=async e=>await this.updateState(e,`restore`),this.delete=async e=>{let t=await I.inboxDeliveries.delete(e);if(t){this.queryClient.setQueryData(w7,t=>t&&T7(t.deliveries.filter(({id:t})=>t!==e)));let{snapshot:t}=C7.getState();t.activeDeliveryId===e&&C7.getState().setSnapshot({activeDeliveryId:null,readerOpen:!1})}return t},this.prepareChatReference=async e=>{let t=await I.systemObjectReferences.resolve(y(w,e)),n=await this.updateState(e,`read`);return this.closeReader(),{delivery:n,reference:t}},this.updateState=async(e,t)=>{let n=await I.inboxDeliveries.updateState(e,t);return this.replaceCachedDelivery(n),n},this.replaceCachedDelivery=e=>{this.queryClient.setQueryData(w7,t=>t&&T7(t.deliveries.some(({id:t})=>t===e.id)?t.deliveries.map(t=>t.id===e.id?e:t):[e,...t.deliveries]))},this.handleDeliveryChanged=()=>{this.queryClient.invalidateQueries({queryKey:w7}),this.offerPendingDelivery()},this.handleVisibilityChange=()=>{document.visibilityState===`visible`&&this.offerPendingDelivery()},this.offerPendingDelivery=()=>{this.offerPromise||!this.isVisible()||C7.getState().snapshot.readerOpen||(this.offerPromise=this.openOldestPendingDelivery().catch(()=>void 0).finally(()=>{this.offerPromise=null}))},this.openOldestPendingDelivery=async()=>{let e=(await this.queryClient.fetchQuery({queryKey:w7,queryFn:()=>I.inboxDeliveries.list(),staleTime:0})).deliveries.filter(e=>!e.presentedAt&&!e.readAt&&!e.archivedAt),t=e[e.length-1];!t||!this.isVisible()||C7.getState().snapshot.readerOpen||await this.selectInReader(t.id)},this.isVisible=()=>typeof document>`u`||document.visibilityState===`visible`}};function E7(){return Sn({queryKey:w7,queryFn:()=>I.inboxDeliveries.list()})}function D7(){return E7().data?.unreadCount??0}function dae(e,t){return b(`inboxReaderPosition`).replace(`{current}`,String(e)).replace(`{total}`,String(t))}function fae(){let e=(0,H.useRef)(null),t=ce(),{chatDraftIntentManager:n,inboxManager:r}=P9(),{data:i}=E7(),{activeDeliveryId:a,readerOpen:o}=C7(e=>e.snapshot),[s,c]=(0,H.useState)(null),[l,d]=(0,H.useState)(null),f=(i?.deliveries??[]).filter(e=>!e.readAt&&!e.archivedAt),p=f.findIndex(({id:e})=>e===a),m=p>=0?f[p]:null,h=m?.contentType===`html`,g=async(e,t)=>{c(e),d(null);try{await t()}catch{d(b(`inboxActionError`))}finally{c(null)}},_=e=>{let t=f[e];t&&g(`select`,async()=>{await r.selectInReader(t.id)})},v=()=>{m&&g(`open`,async()=>{await r.markRead(m.id),r.closeReader(),t(`/inbox/${encodeURIComponent(m.id)}`)})},y=()=>{m&&g(`continue`,async()=>{let{reference:e}=await r.prepareChatReference(m.id);n.requestSystemObjectReference(e),t(Z7)})},x=()=>{m&&g(`read`,async()=>{await r.markRead(m.id),r.closeReader()})},S=f.length>1?(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 pr-1`,children:[(0,U.jsx)(`span`,{className:`mr-1 text-[11px] tabular-nums text-muted-foreground`,children:dae(p+1,f.length)}),(0,U.jsx)(V,{icon:(0,U.jsx)(da,{className:`h-4 w-4`}),label:b(`inboxPrevious`),disabled:p<=0||s===`select`,onClick:()=>_(p-1)}),(0,U.jsx)(V,{icon:(0,U.jsx)(fa,{className:`h-4 w-4`}),label:b(`inboxNext`),disabled:p>=f.length-1||s===`select`,onClick:()=>_(p+1)})]}):null;return(0,U.jsx)(Ur,{open:o&&!!m,onOpenChange:e=>{e||r.closeReader()},children:(0,U.jsx)(Kr,{className:`flex h-[min(82vh,760px)] w-[calc(100vw-2rem)] max-w-[820px] flex-col gap-0 overflow-hidden rounded-[24px] border-border/70 bg-background p-0 shadow-[0_20px_55px_-22px_rgba(15,23,42,0.32)] max-sm:h-[100dvh] max-sm:max-h-none max-sm:w-screen max-sm:rounded-none max-sm:border-0`,onOpenAutoFocus:t=>{t.preventDefault(),e.current?.focus()},children:m?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`header`,{className:`shrink-0 border-b border-border/50 px-5 py-3 pr-14 sm:px-6`,children:[(0,U.jsxs)(`div`,{className:`flex min-h-7 items-center justify-between gap-3`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-muted/70 text-muted-foreground`,children:(0,U.jsx)(ao,{className:`h-3.5 w-3.5`})}),(0,U.jsx)(qr,{ref:e,tabIndex:-1,title:m.title,className:`min-w-0 truncate text-sm font-medium text-foreground outline-none`,children:m.title}),(0,U.jsx)(`span`,{className:`hidden shrink-0 text-muted-foreground sm:inline`,"aria-hidden":`true`,children:`·`}),(0,U.jsx)(`time`,{className:`hidden shrink-0 text-[11px] tabular-nums text-muted-foreground sm:block`,dateTime:m.createdAt,children:M(m.createdAt)})]}),S]}),(0,U.jsx)(Br,{className:`sr-only`,children:m.summary??b(`inboxNoSummary`)})]}),(0,U.jsx)(`div`,{className:u(`min-h-0 flex-1`,h?`p-3 sm:p-4`:`custom-scrollbar overflow-y-auto px-6 py-5 sm:px-8 sm:py-6`),children:(0,U.jsx)(S7,{className:h?`h-full`:void 0,content:m.content,contentType:m.contentType,fillHeight:h,title:m.title})}),(0,U.jsxs)(`footer`,{className:`shrink-0 border-t border-border/50 bg-background px-5 py-3 sm:px-6`,children:[l?(0,U.jsx)(`p`,{role:`alert`,className:`mb-3 text-sm text-destructive`,children:l}):null,(0,U.jsxs)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col-reverse gap-1 sm:flex-row sm:flex-wrap`,children:[(0,U.jsx)(R,{size:`sm`,variant:`ghost`,onClick:r.closeReader,children:b(`inboxReadLater`)}),(0,U.jsx)(R,{size:`sm`,variant:`outline`,disabled:s!==null,onClick:x,children:b(`inboxMarkRead`)}),(0,U.jsx)(R,{size:`sm`,variant:`ghost`,disabled:s!==null,onClick:v,children:b(`inboxOpenInbox`)})]}),(0,U.jsx)(R,{size:`sm`,disabled:s!==null,onClick:y,children:b(`inboxContinueChat`)})]})]})]}):null})})}function pae(){let{inboxManager:e}=P9();return(0,H.useEffect)(()=>(e.start(),()=>e.stop()),[e]),(0,U.jsx)(fae,{})}function mae(e,t){return t||(e.some(e=>!e.readAt&&!e.archivedAt)?`unread`:`all`)}function O7(e,t){return t===`unread`?e.filter(e=>!e.readAt&&!e.archivedAt):t===`archived`?e.filter(e=>!!e.archivedAt):e.filter(e=>!e.archivedAt)}function k7({selection:e=!1}){return(0,U.jsxs)(`div`,{className:`flex h-full min-h-56 flex-col items-center justify-center px-8 text-center`,children:[(0,U.jsx)(`span`,{className:`mb-4 flex h-12 w-12 items-center justify-center rounded-2xl bg-muted text-muted-foreground`,children:(0,U.jsx)(ao,{className:`h-5 w-5`})}),(0,U.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:b(e?`inboxSelectTitle`:`inboxEmptyTitle`)}),(0,U.jsx)(`p`,{className:`mt-2 max-w-sm text-sm leading-6 text-muted-foreground`,children:b(e?`inboxSelectDescription`:`inboxEmptyDescription`)})]})}function hae({activeDeliveryId:e,deliveries:t,filter:n,onFilterChange:r}){let{onScroll:i,scrollRef:a}=oY({restorationKey:`inbox:list`}),o=[{id:`unread`,label:b(`inboxUnread`),count:O7(t,`unread`).length},{id:`all`,label:b(`inboxAll`),count:O7(t,`all`).length},{id:`archived`,label:b(`inboxArchived`),count:O7(t,`archived`).length}],s=O7(t,n);return(0,U.jsxs)(`aside`,{className:`flex min-h-0 flex-col border-border/60 bg-muted/20 md:border-r`,children:[(0,U.jsx)(`div`,{className:`flex shrink-0 gap-1 border-b border-border/50 px-3 py-2`,children:o.map(e=>(0,U.jsxs)(`button`,{type:`button`,onClick:()=>r(e.id),className:u(`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,n===e.id?`bg-[var(--interaction-selection)] text-foreground`:`text-muted-foreground hover:bg-[var(--interaction-hover)] hover:text-foreground`),children:[e.label,(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`text-[10px] font-normal tabular-nums opacity-60`,children:e.count})]},e.id))}),(0,U.jsx)(`div`,{ref:a,onScroll:i,className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto p-2`,children:s.length>0?(0,U.jsx)(`ul`,{className:`space-y-0.5`,children:s.map(t=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(ue,{to:`/inbox/${encodeURIComponent(t.id)}`,className:u(`block rounded-lg px-2.5 py-2 text-[13px] transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,e===t.id?`bg-[var(--interaction-selection)] text-foreground`:`text-foreground/80 hover:bg-[var(--interaction-hover)] hover:text-foreground`),children:[(0,U.jsx)(`h2`,{className:u(`truncate font-medium leading-5`,!t.readAt&&`font-semibold text-foreground`),children:t.title}),(0,U.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-[11px] leading-4 text-muted-foreground/65`,children:[(0,U.jsx)(`p`,{className:`min-w-0 flex-1 truncate`,children:t.summary??b(`inboxNoSummary`)}),t.readAt?(0,U.jsx)(`time`,{className:`shrink-0 tabular-nums`,dateTime:t.createdAt,children:k(t.createdAt)}):(0,U.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full bg-primary`,"aria-label":b(`inboxUnread`)})]})]})},t.id))}):(0,U.jsx)(k7,{})})]})}function gae({delivery:e,error:t,isMobile:n,pending:r,onArchiveToggle:i,onBack:a,onContinue:o,onDelete:s,onReadToggle:c}){let{onScroll:l,scrollRef:d}=oY({restorationKey:e?`inbox:delivery:${e.id}`:null});if(!e)return(0,U.jsx)(`main`,{className:`flex min-h-0 flex-col`,children:(0,U.jsx)(k7,{selection:!0})});let f=e.contentType===`html`;return(0,U.jsxs)(`main`,{className:`flex min-h-0 flex-col`,children:[(0,U.jsxs)(`div`,{className:`shrink-0 border-b border-border/50 px-5 py-3 sm:px-6`,children:[n?(0,U.jsxs)(`button`,{type:`button`,onClick:a,className:`mb-3 inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground`,children:[(0,U.jsx)(Ci,{className:`h-4 w-4`}),b(`inboxTitle`)]}):null,(0,U.jsxs)(`div`,{className:`flex min-h-7 min-w-0 items-center gap-2`,children:[(0,U.jsx)(`h2`,{title:e.title,className:`min-w-0 truncate text-sm font-medium text-foreground`,children:e.title}),(0,U.jsx)(`span`,{className:`hidden shrink-0 text-muted-foreground sm:inline`,"aria-hidden":`true`,children:`·`}),(0,U.jsx)(`time`,{className:`hidden shrink-0 text-[11px] tabular-nums text-muted-foreground sm:block`,dateTime:e.createdAt,children:M(e.createdAt)})]})]}),(0,U.jsx)(`div`,{className:u(`min-h-0 flex-1`,f?`p-3 sm:p-4`:`custom-scrollbar overflow-y-auto px-5 py-5 sm:px-6 sm:py-6`),ref:d,onScroll:l,children:(0,U.jsx)(`div`,{className:u(`mx-auto max-w-5xl`,f&&`h-full`),children:(0,U.jsx)(S7,{className:f?`h-full`:void 0,content:e.content,contentType:e.contentType,fillHeight:f,title:e.title})})}),(0,U.jsxs)(`div`,{className:`shrink-0 border-t border-border/50 px-5 py-3 sm:px-6`,children:[t?(0,U.jsx)(`p`,{role:`alert`,className:`mb-2 text-sm text-destructive`,children:t}):null,(0,U.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[(0,U.jsx)(R,{size:`sm`,variant:`outline`,disabled:r,onClick:c,children:e.readAt?b(`inboxMarkUnread`):b(`inboxMarkRead`)}),(0,U.jsxs)(R,{size:`sm`,variant:`ghost`,disabled:r,onClick:i,children:[e.archivedAt?(0,U.jsx)(qo,{className:`mr-2 h-4 w-4`}):(0,U.jsx)(ia,{className:`mr-2 h-4 w-4`}),e.archivedAt?b(`inboxRestore`):b(`inboxArchive`)]}),(0,U.jsxs)(R,{size:`sm`,variant:`ghost`,disabled:r,onClick:s,children:[(0,U.jsx)(fs,{className:`mr-2 h-4 w-4`}),b(`inboxDelete`)]})]}),(0,U.jsxs)(R,{size:`sm`,disabled:r,onClick:o,children:[(0,U.jsx)(bo,{className:`mr-2 h-4 w-4`}),b(`inboxContinueChat`)]})]})]})]})}function _ae(){let e=ce(),{deliveryId:t}=le(),{isMobile:n}=k8(),{chatDraftIntentManager:r,inboxManager:i}=P9(),a=E7(),{confirm:o,ConfirmDialog:s}=On(),[c,l]=(0,H.useState)(null),[u,d]=(0,H.useState)(null),[f,p]=(0,H.useState)(null),m=(0,H.useMemo)(()=>a.data?.deliveries??[],[a.data?.deliveries]),h=(0,H.useMemo)(()=>t?m.find(({id:e})=>e===t)??null:null,[m,t]),g=mae(m,c);(0,H.useEffect)(()=>{h&&!h.readAt&&i.markRead(h.id).catch(()=>p(b(`inboxActionError`)))},[h,i]);let _=async(e,t)=>{d(e),p(null);try{await t()}catch{p(b(`inboxActionError`))}finally{d(null)}},v=()=>{h&&_(`continue`,async()=>{let{reference:t}=await i.prepareChatReference(h.id);r.requestSystemObjectReference(t),e(Z7)})},y=async()=>{!h||!await o({title:b(`inboxDeleteTitle`),description:b(`inboxDeleteDescription`),confirmLabel:b(`inboxDeleteConfirm`),variant:`destructive`})||_(`delete`,async()=>{await i.delete(h.id),e(`/inbox`,{replace:!0})})},x=()=>{h&&_(`read`,async()=>{if(h.readAt){await i.markUnread(h.id),e(`/inbox`,{replace:!0});return}await i.markRead(h.id)})},S=()=>{h&&_(`archive`,async()=>{if(h.archivedAt){await i.restore(h.id);return}await i.archive(h.id),e(`/inbox`,{replace:!0})})},C=!n||!h,w=!n||!!h;return(0,U.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-6`,children:[(0,U.jsx)(xt,{headingLevel:1,title:b(`inboxTitle`),className:`px-4 sm:px-0`}),(0,U.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden border-y border-border/60 bg-background sm:rounded-2xl sm:border`,children:a.isError?(0,U.jsx)(`div`,{role:`alert`,className:`p-6 text-sm text-destructive`,children:b(`inboxLoadError`)}):(0,U.jsxs)(`div`,{className:`grid h-full min-h-0 grid-cols-1 md:grid-cols-[300px_minmax(0,1fr)]`,children:[C?(0,U.jsx)(hae,{activeDeliveryId:h?.id??null,deliveries:m,filter:g,onFilterChange:l}):null,w?(0,U.jsx)(gae,{delivery:h,error:f,isMobile:n,pending:u!==null,onArchiveToggle:S,onBack:()=>e(`/inbox`),onContinue:v,onDelete:()=>void y(),onReadToggle:x}):null]})}),(0,U.jsx)(s,{})]})}function vae(e,t){return t.some(t=>t.value===e)?e:t[0]?.value??e}function yae(e){let{groups:t,defaultSessionType:n,sessionTypeOptions:r,renderSessionItem:i,projectCronJobCountByRoot:a}=e,o=eI(),s=aL(e=>e.snapshot.collapsedProjectRoots),[c,l]=(0,H.useState)(null),u=(0,H.useMemo)(()=>vae(n,r),[n,r]),d=r.length>1;return(0,U.jsx)(`div`,{className:`space-y-0.5`,children:t.map(e=>{let t=`${b(`chatSidebarNewTask`)} · ${e.projectName}`,n=s.includes(e.projectRoot),f=b(e.isPinned?`chatSidebarUnpinProject`:`chatSidebarPinProject`);return(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`group/project relative h-8 rounded-lg px-2 text-muted-foreground transition-colors hover:bg-gray-200/60 hover:text-gray-900`,children:[(0,U.jsx)(g7,{title:e.projectName,metrics:[{icon:(0,U.jsx)(Ya,{className:`h-3.5 w-3.5`}),label:b(`chatSidebarContextPath`),value:e.projectRoot},{icon:(0,U.jsx)(Co,{className:`h-3.5 w-3.5`}),label:b(`chatSidebarContextSessions`),value:e.items.length},{icon:(0,U.jsx)(ra,{className:`h-3.5 w-3.5`}),label:b(`chatSidebarContextScheduledTasks`),value:a.get(e.projectRoot)??0}],children:(0,U.jsxs)(`button`,{type:`button`,"aria-expanded":!n,"aria-label":b(n?`chatSidebarExpandProject`:`chatSidebarCollapseProject`),className:`flex h-full w-full min-w-0 items-center gap-1.5 pr-14 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>o.chatSessionListManager.toggleProjectCollapsed(e.projectRoot),children:[(0,U.jsx)(Ya,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`truncate text-[11px] font-medium uppercase tracking-wider`,title:e.projectRoot,children:e.projectName}),n?(0,U.jsx)(fa,{className:`h-3.5 w-3.5 shrink-0 opacity-0 transition-opacity group-hover/project:opacity-100 group-focus-within/project:opacity-100`,"aria-hidden":`true`}):(0,U.jsx)(ar,{className:`h-3.5 w-3.5 shrink-0 opacity-0 transition-opacity group-hover/project:opacity-100 group-focus-within/project:opacity-100`,"aria-hidden":`true`})]})}),(0,U.jsxs)(`div`,{className:`pointer-events-none absolute right-2 top-1/2 flex -translate-y-1/2 items-center opacity-0 transition-opacity group-hover/project:pointer-events-auto group-hover/project:opacity-100 focus-within:pointer-events-auto focus-within:opacity-100`,children:[d?(0,U.jsxs)(CF,{open:c===e.projectRoot,onOpenChange:t=>{l(t?e.projectRoot:null)},children:[(0,U.jsx)(wF,{asChild:!0,children:(0,U.jsx)(V,{icon:(0,U.jsx)(Di,{className:`h-3.5 w-3.5`}),label:t})}),(0,U.jsx)(EF,{align:`end`,className:`w-56 rounded-2xl border border-border bg-popover p-1.5 text-popover-foreground shadow-[0_24px_60px_-28px_rgba(15,23,42,0.38)]`,children:(0,U.jsx)(_7,{options:r,selectedSessionType:u,onSelect:t=>{o.chatSessionListManager.createSession({projectRoot:e.projectRoot,sessionType:t}),l(null)}})})]}):(0,U.jsx)(V,{icon:(0,U.jsx)(Di,{className:`h-3.5 w-3.5`}),label:t,onClick:()=>o.chatSessionListManager.createSession({projectRoot:e.projectRoot,sessionType:u})}),(0,U.jsx)(V,{icon:(0,U.jsx)(Xr,{className:e.isPinned?`h-3.5 w-3.5 fill-current text-foreground`:`h-3.5 w-3.5`}),label:f,tooltipSide:`right`,onClick:()=>o.chatSessionListManager.toggleProjectPinned(e.projectRoot)})]})]}),n?null:(0,U.jsx)(`div`,{className:`mt-0.5 space-y-0.5 pl-2`,children:e.items.map(i)})]},e.projectRoot)})})}function A7({label:e}){return(0,U.jsxs)(`div`,{className:`p-4 text-center`,children:[(0,U.jsx)(Co,{className:`mx-auto mb-2 h-6 w-6 text-muted-foreground/45`}),(0,U.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e})]})}function bae({defaultSessionType:e,groups:t,isLoading:n,isProjectFirstView:r,projectGroups:i,projectCronJobCountByRoot:a,renderSessionItem:o,sessionTypeOptions:s}){return n?(0,U.jsx)(`div`,{className:`p-3 text-xs text-muted-foreground`,children:b(`sessionsLoading`)}):r?i.length===0?(0,U.jsx)(A7,{label:b(`chatSidebarProjectViewEmpty`)}):(0,U.jsx)(yae,{groups:i,projectCronJobCountByRoot:a,defaultSessionType:e,sessionTypeOptions:s,renderSessionItem:o}):t.length===0?(0,U.jsx)(A7,{label:b(`sessionsEmpty`)}):(0,U.jsx)(`div`,{className:`space-y-2`,children:t.map(e=>(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`px-2 pb-1 pt-0.5 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/65`,children:e.label}),(0,U.jsx)(`div`,{className:`space-y-0.5`,children:e.items.map(o)})]},e.label))})}function xae({isOpen:e,onOpenChange:t,currentTheme:n,currentThemeLabel:r,themeOptions:i,onSelectTheme:a,currentLanguage:o,currentLanguageLabel:s,languageOptions:c,onSelectLanguage:l,onOpenDocs:d,onOpenApps:f,collapsed:p=!1}){return(0,U.jsxs)(CF,{open:e,onOpenChange:t,children:[p?(0,U.jsx)(ci,{delayDuration:250,children:(0,U.jsxs)(pi,{children:[(0,U.jsx)(ni,{asChild:!0,children:(0,U.jsx)(wF,{asChild:!0,children:(0,U.jsx)(`button`,{type:`button`,"aria-label":b(`settingsMenu`),className:u(`flex items-center justify-center`,nX,oX),children:(0,U.jsx)(Zo,{className:u(rX,`shrink-0 text-muted-foreground`)})})})}),(0,U.jsx)(li,{side:`right`,className:`text-xs`,children:b(`settingsMenu`)})]})}):(0,U.jsx)(wF,{asChild:!0,children:(0,U.jsxs)(`button`,{type:`button`,"aria-label":b(`settingsMenu`),className:`flex w-full items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-[13px] font-medium text-muted-foreground transition-colors duration-base hover:bg-background/70 hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:[(0,U.jsx)(Zo,{className:`h-4 w-4 shrink-0 text-muted-foreground/70`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 text-left`,children:b(`settings`)})]})}),(0,U.jsxs)(EF,{side:p?`right`:`top`,align:p?`end`:`start`,className:`w-64 p-2`,children:[(0,U.jsxs)(`div`,{className:`space-y-1`,children:[(0,U.jsxs)(pe,{to:`/settings`,onClick:()=>t(!1),className:`flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] font-medium text-foreground transition-colors hover:bg-gray-200/60 hover:text-gray-900`,children:[(0,U.jsx)(Zo,{className:`h-4 w-4 text-muted-foreground/70`}),(0,U.jsx)(`span`,{className:`flex-1 text-left`,children:b(`settings`)})]}),[{key:`docs`,icon:Ti,label:b(`docBrowserHelp`),action:d},{key:`apps`,icon:Zr,label:b(`appsTitle`),action:f}].map(({key:e,icon:n,label:r,action:i})=>(0,U.jsxs)(`button`,{type:`button`,onClick:()=>{i(),t(!1)},className:`flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] font-medium text-foreground transition-colors hover:bg-gray-200/60 hover:text-gray-900`,children:[(0,U.jsx)(n,{className:`h-4 w-4 text-muted-foreground/70`}),(0,U.jsx)(`span`,{className:`flex-1 text-left`,children:r})]},e))]}),(0,U.jsx)(`div`,{className:`my-2 h-px bg-border`}),(0,U.jsx)(j7,{icon:No,label:b(`theme`),options:i,value:n,valueLabel:r,onSelect:a,onCloseMenu:()=>t(!1)}),(0,U.jsx)(j7,{icon:so,label:b(`language`),options:c,value:o,valueLabel:s,onSelect:l,onCloseMenu:()=>t(!1)})]})]})}function j7({icon:e,label:t,options:n,value:r,valueLabel:i,onSelect:a,onCloseMenu:o}){return(0,U.jsxs)(Dr,{value:r,onOpenChange:e=>{e||o()},onValueChange:e=>a(e),children:[(0,U.jsxs)(yr,{"aria-label":t,className:`h-auto w-full rounded-lg border-0 bg-transparent px-3 py-2 text-[13px] font-medium text-foreground shadow-none hover:bg-gray-200/60 hover:text-gray-900 focus:ring-0`,indicator:(0,U.jsx)(fa,{className:`h-4 w-4 text-muted-foreground/70`}),children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,U.jsx)(e,{className:`h-4 w-4 shrink-0 text-muted-foreground/70`}),(0,U.jsx)(`span`,{className:`text-left`,children:t})]}),(0,U.jsx)(`span`,{className:`ml-auto max-w-[96px] truncate text-[13px] text-muted-foreground`,children:i})]}),(0,U.jsx)(Sr,{side:`right`,align:`center`,sideOffset:6,className:`z-[var(--z-tooltip)] min-w-[7rem] rounded-lg`,viewportClassName:`h-auto min-w-[7rem] w-auto`,children:n.map(e=>(0,U.jsx)(Tr,{value:e.value,className:`text-[13px]`,children:e.label},e.value))})]})}var M7=P(()=>({supported:!1,initialized:!1,busyAction:null,snapshot:null})),Sae=new class{constructor(){this.start=async()=>{let e=this.getDesktopApi();if(!e){this.markUnsupported();return}M7.setState({supported:!0,initialized:!1,busyAction:`loading`});try{let t=await e.getPresenceState();M7.setState({supported:!0,initialized:!0,busyAction:null,snapshot:t})}catch(e){M7.setState({supported:!0,initialized:!0,busyAction:null}),L.error(`${b(`runtimePresenceLoadFailed`)}: ${this.getErrorMessage(e)}`)}},this.markUnsupported=()=>{M7.setState({supported:!1,initialized:!0,busyAction:null,snapshot:null})},this.updatePreferences=async e=>{let t=this.getDesktopApi();if(!t)throw Error(b(`runtimePresenceLaunchAtLoginUnavailable`));M7.setState({busyAction:`saving-preferences`});try{let n=await t.updatePresencePreferences(e);return M7.setState({supported:!0,initialized:!0,snapshot:n}),L.success(b(`runtimePresenceSaved`)),n}catch(e){throw L.error(`${b(`runtimePresenceSaveFailed`)}: ${this.getErrorMessage(e)}`),e}finally{M7.setState({busyAction:null})}},this.getDesktopApi=()=>typeof window>`u`?null:window.nextclawDesktop??null,this.getErrorMessage=e=>e instanceof Error?e.message:b(`error`)}},N7=P(()=>({supported:!1,initialized:!1,busyAction:null,snapshot:null}));new class{constructor(){this.unsubscribe=null,this.subscriptionCount=0,this.start=async()=>{this.subscriptionCount+=1;let e=this.getDesktopApi();if(!e){N7.setState({supported:!1,initialized:!0,snapshot:null});return}this.unsubscribe||=e.onUpdateStateChanged(e=>{N7.setState({supported:!0,initialized:!0,snapshot:e})}),N7.setState({supported:!0,initialized:!1});try{let t=await e.getUpdateState();N7.setState({supported:!0,initialized:!0,snapshot:t})}catch(e){N7.setState({supported:!0,initialized:!0}),L.error(`${b(`desktopUpdatesLoadFailed`)}: ${this.getErrorMessage(e)}`)}},this.stop=()=>{this.subscriptionCount=Math.max(0,this.subscriptionCount-1),!(this.subscriptionCount>0)&&(this.unsubscribe?.(),this.unsubscribe=null)},this.checkForUpdates=async()=>{let e;try{e=await this.runSnapshotCommand(`checking`,b(`desktopUpdatesCheckFailed`),async e=>await e.checkForUpdates())}catch{return}if(e.status===`up-to-date`){L.success(b(`desktopUpdatesAlreadyLatest`));return}if(e.status===`update-available`){L.success(b(`desktopUpdatesAvailable`).replace(`{version}`,e.availableVersion??b(`desktopUpdatesUnknownVersion`)));return}if(e.status===`downloaded`){L.success(b(`desktopUpdatesReadyToApply`));return}e.status===`failed`&&e.errorMessage&&L.error(e.errorMessage)},this.downloadUpdate=async()=>{let e;try{e=await this.runSnapshotCommand(`downloading`,b(`desktopUpdatesDownloadFailed`),async e=>await e.downloadUpdate())}catch{return}e.status===`downloaded`&&L.success(b(`desktopUpdatesReadyToApply`))},this.applyDownloadedUpdate=async()=>{try{await this.runSnapshotCommand(`applying`,b(`desktopUpdatesApplyFailed`),async e=>await e.applyDownloadedUpdate())}catch{return}},this.updateChannel=async e=>{if(N7.getState().snapshot?.channel===e)return;let t;try{t=await this.runSnapshotCommand(`switching-channel`,b(`desktopUpdatesChannelChangeFailed`),async t=>await t.updateChannel(e))}catch{return}if(t.status===`update-available`&&t.availableVersion){L.success(b(`desktopUpdatesChannelChangedWithUpdate`).replace(`{channel}`,this.getChannelLabel(e)).replace(`{version}`,t.availableVersion));return}L.success(b(`desktopUpdatesChannelChanged`).replace(`{channel}`,this.getChannelLabel(e)))},this.runSnapshotCommand=async(e,t,n)=>{let r=this.getDesktopApi();if(!r)throw Error(b(`desktopUpdatesDesktopOnlyDescription`));N7.setState({busyAction:e});try{let e=await n(r);return N7.setState({snapshot:e}),e}catch(e){throw L.error(`${t}: ${this.getErrorMessage(e)}`),e}finally{N7.setState({busyAction:null})}},this.getDesktopApi=()=>typeof window>`u`?null:window.nextclawDesktop??null,this.getErrorMessage=e=>e instanceof Error?e.message:b(`error`),this.getChannelLabel=e=>b(e===`beta`?`desktopUpdatesChannelBeta`:`desktopUpdatesChannelStable`)}};function P7(e,t){let n=e.toLowerCase(),r=t.toLowerCase();return n===r||n.startsWith(`${r}/`)}function F7(e){let t=e.toLowerCase();return t===`/chat`||t.startsWith(`/chat/`)||t===`/inbox`||t.startsWith(`/inbox/`)||t===`/skills`||t.startsWith(`/skills/`)||t===`/cron`||t.startsWith(`/cron/`)||t===`/agents`||t.startsWith(`/agents/`)||t.startsWith(`/apps/panel/`)}function I7(e){let t=e.toLowerCase();return t.startsWith(`/chat/`)&&t!==`/chat`}function Cae(e){return[{target:`/chat`,label:e(`chat`),icon:bo},{target:`/inbox`,label:e(`inboxTitle`),icon:ao},{target:`/skills`,label:e(`marketplaceFilterSkills`),icon:sa},{target:`/agents`,label:e(`agentsPageTitle`),icon:oa},{target:`/settings`,label:e(`settings`),icon:Zo}]}function L7(e,t={}){let n=[{target:`/model`,label:e(`model`),icon:Da},{target:`/providers`,label:e(`providers`),icon:Fr},{target:`/channels`,label:e(`channels`),icon:wo},{target:`/extensions`,label:e(`extensions`),icon:Wo},{target:`/appearance`,label:e(`appearance`),icon:No},{target:`/security`,label:e(`security`),icon:ts},{target:`/privacy`,label:e(`privacy`),icon:na},{target:`/desktop-capabilities`,label:e(`desktopCapabilities`),icon:Oo},{target:`/search`,label:e(`searchChannels`),icon:wi},{target:`/updates`,label:e(`updates`),icon:Oa},{target:`/remote`,label:e(`remote`),icon:_s},{target:`/runtime`,label:e(`runtime`),icon:Da},{target:`/secrets`,label:e(`secrets`),icon:oo},{target:`/marketplace/mcp`,label:e(`marketplaceFilterMcp`),icon:ys}];return t.includeDesktopCapabilities===!1?n.filter(e=>e.target!==`/desktop-capabilities`):n}function wae(e,t={}){let n=L7(e,t);return[{label:e(`settingsGroupBasic`),items:n.slice(0,3)},{label:e(`settingsGroupAdvanced`),items:n.slice(3)}]}function Tae(e){let t=e.toLowerCase();return t===`/settings`?!0:L7(e=>e).some(e=>P7(t,e.target))}function Eae(e,t){let n=e.toLowerCase(),r=L7(t);if(I7(n))return{title:t(`chat`),backTarget:`/chat`,backLabel:t(`chat`)};if(n===`/chat`)return{title:t(`chat`),backTarget:null,backLabel:null};if(n===`/inbox`||n.startsWith(`/inbox/`))return{title:t(`inboxTitle`),backTarget:n===`/inbox`?null:`/inbox`,backLabel:t(`inboxTitle`)};if(n===`/skills`||n.startsWith(`/skills/`))return{title:t(`marketplaceFilterSkills`),backTarget:null,backLabel:null};if(n===`/agents`||n.startsWith(`/agents/`))return{title:t(`agentsPageTitle`),backTarget:null,backLabel:null};if(n.startsWith(`/apps/panel/`))return{title:t(`panelAppsTitle`),backTarget:`/chat`,backLabel:t(`chat`)};if(n===`/settings`)return{title:t(`settings`),backTarget:null,backLabel:null};for(let e of r)if(P7(n,e.target))return{title:e.label,backTarget:`/settings`,backLabel:t(`settings`)};return{title:t(`settings`),backTarget:null,backLabel:null}}var Dae=[`feature-controls`];function Oae(){return Sn({queryKey:Dae,queryFn:I.featureControls.get})}var R7=new class{constructor(){this.getStatus=async()=>await I.capabilityAccess.getDesktopStatus(),this.listGrants=async()=>await I.capabilityAccess.listDesktopGrants(),this.grantAccess=async e=>await I.capabilityAccess.grantDesktopAccess(e),this.requestSystemPermission=async()=>await I.capabilityAccess.requestDesktopPermissions(),this.openSystemSettings=async()=>await I.capabilityAccess.openDesktopPermissionSettings(),this.revokeGrant=async e=>await I.capabilityAccess.revokeDesktopAccess(e)}},z7=[`desktop-capability`,`status`],B7=[`desktop-capability`,`grants`];function kae(){return Sn({queryKey:z7,queryFn:R7.getStatus})}function V7(){return Aae(Oae().data)}function Aae(e){return e?.desktopAutomation.available===!0}function jae(){return Sn({queryKey:B7,queryFn:R7.listGrants})}function Mae(){let e=F();return z({mutationFn:R7.requestSystemPermission,onSuccess:async()=>{await e.invalidateQueries({queryKey:z7})}})}function Nae(){return z({mutationFn:R7.openSystemSettings})}function Pae(){let e=F();return z({mutationFn:async e=>await R7.revokeGrant(e),onSuccess:async()=>{await e.invalidateQueries({queryKey:B7})}})}function H7({isCollapsed:e,onToggle:t}){let n=b(e?`sidebarExpand`:`sidebarCollapse`);return(0,U.jsx)(V,{icon:(0,U.jsx)(e?Io:Po,{className:rX}),label:n,className:u(oX,e&&`h-9 w-9 rounded-xl`),onClick:t})}function Fae({isCollapsed:e,onToggle:t}){return(0,U.jsx)(`div`,{className:u(`shrink-0`,e?`px-0 py-1.5`:`px-2 py-2`),children:(0,U.jsxs)(`div`,{className:u(`flex items-center py-1`,e?u(`flex-col px-0`,aX):`gap-2 px-1`),"data-testid":`settings-sidebar-header`,children:[e?(0,U.jsx)(H7,{isCollapsed:e,onToggle:t}):null,(0,U.jsxs)(pe,{to:`/chat`,"aria-label":b(`backToMain`),className:u(`group inline-flex min-w-0 items-center rounded-lg text-[12px] font-medium text-muted-foreground transition-colors hover:bg-gray-200/60 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,e?u(nX,oX,`justify-center p-0`):`gap-1.5 px-1 py-1`),children:[(0,U.jsx)(Ci,{className:u(e?rX:`h-3.5 w-3.5`,`shrink-0 text-muted-foreground/75 group-hover:text-gray-700`)}),(0,U.jsx)(`span`,{className:e?`sr-only`:`truncate`,children:b(`backToMain`)})]}),e?null:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`h-4 w-px shrink-0 bg-border`,"aria-hidden":`true`}),(0,U.jsx)(`h1`,{className:`truncate text-[15px] font-semibold tracking-[-0.01em] text-foreground`,children:b(`settings`)}),(0,U.jsx)(`div`,{className:`ml-auto`,children:(0,U.jsx)(H7,{isCollapsed:e,onToggle:t})})]})]})})}function Iae({isCollapsed:e,sections:t}){let{onScroll:n,scrollRef:r}=oY({restorationKey:`settings-sidebar:navigation`});return(0,U.jsx)(`nav`,{ref:r,onScroll:n,className:u(`custom-scrollbar min-h-0 flex-1 overflow-y-auto`,e?`pr-0`:`pr-1`,PF),children:e?(0,U.jsx)(hX,{isCollapsed:e,items:t.flatMap(e=>e.items),density:`compact`,className:u(iX,`pb-3`)}):(0,U.jsx)(`div`,{className:`space-y-3 pb-3`,children:t.map(t=>(0,U.jsxs)(`section`,{"aria-label":t.label,className:`space-y-1`,children:[(0,U.jsx)(`h2`,{className:`px-3 text-[11px] font-semibold text-muted-foreground/70`,children:t.label}),(0,U.jsx)(hX,{isCollapsed:e,items:t.items,density:`compact`})]},t.label))})})}function Lae(){let e=P9(),t=Hi(),n=Cs(),r=V7(),i=ac(e=>e.isSidebarCollapsed),a=oc.toggleSidebarCollapsed,o=n.data?.account.email?.trim(),s=!!n.data?.account.loggedIn,c=wae(b,{includeDesktopCapabilities:r}),l=i?iX:uX(`compact`);return(0,U.jsxs)(`aside`,{"data-theme-surface":`navigation`,className:u(`shrink-0 flex h-full min-h-0 flex-col overflow-hidden bg-secondary pb-6 transition-[width] duration-200 ease-out`,i?u(eX,tX):`w-[240px] px-4`),"data-sidebar-collapsed":i?`true`:`false`,children:[(0,U.jsx)(Fae,{isCollapsed:i,onToggle:a}),(0,U.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,U.jsx)(Iae,{isCollapsed:i,sections:c}),(0,U.jsxs)(`div`,{className:u(`shrink-0 bg-secondary`,i?`mt-2 flex flex-col items-center pt-2`:`mt-2 pt-3`,l),children:[(0,U.jsx)(gX,{onClick:()=>t.open(void 0,{kind:`docs`,title:b(`docBrowserHelp`)}),icon:Ti,label:b(`docBrowserHelp`),density:`compact`,collapsed:i}),(0,U.jsx)(gX,{onClick:()=>e.accountManager.openAccountPanel(),icon:oo,label:b(`remoteAccountEntryManage`),density:`compact`,trailing:s?o||b(`remoteAccountEntryConnected`):b(`remoteAccountEntryDisconnected`),trailingClassName:`max-w-[92px] truncate text-right`,testId:`settings-sidebar-account-entry`,trailingTestId:`settings-sidebar-account-status`,collapsed:i})]})]})]})}var U7=[{action:`minimize`,label:`Minimize`,icon:Do},{action:`close`,label:`Close`,icon:ki,variant:`danger`}];function Rae({sidebarCollapsed:e=!1}){let t=Bae()?{action:`toggle-maximize`,label:`Restore`,icon:Ta}:{action:`toggle-maximize`,label:`Maximize`,icon:ss};return(0,U.jsxs)(`header`,{"data-theme-surface":`header`,className:`desktop-window-drag relative flex h-[var(--desktop-titlebar-height)] shrink-0 bg-secondary after:absolute after:bottom-0 after:left-[var(--desktop-sidebar-width)] after:right-0 after:border-b after:border-border/80`,"data-testid":`desktop-window-chrome`,children:[(0,U.jsx)(`div`,{className:`desktop-window-no-drag absolute left-0 right-0 top-0 h-1`,"data-testid":`desktop-window-chrome-resize-strip`}),(0,U.jsx)(`div`,{className:u(`desktop-window-drag relative z-10 flex h-full w-[var(--desktop-sidebar-width)] shrink-0 items-center bg-secondary text-secondary-foreground`,e?`justify-center px-0`:`pl-4 pr-3`),"data-testid":`desktop-window-chrome-sidebar`,children:e?(0,U.jsx)(`img`,{src:`/logo.svg`,alt:`NextClaw`,className:`h-6 w-6 shrink-0 object-contain`}):(0,U.jsx)(y7,{className:`flex min-w-0 shrink-0 items-center gap-2.5`,density:`chrome`})}),(0,U.jsx)(`div`,{className:`desktop-window-no-drag absolute right-0 top-0 z-20 flex h-full w-[var(--desktop-caption-safe-right)] items-start justify-end`,"data-testid":`desktop-window-controls`,children:[U7[0],t,U7[1]].map(e=>(0,U.jsx)(zae,{control:e},e.action))})]})}function zae({control:e}){let t=e.icon;return(0,U.jsx)(`button`,{type:`button`,"aria-label":e.label,title:e.label,className:e.variant===`danger`?`desktop-window-no-drag flex h-10 w-[46px] items-center justify-center text-gray-700 transition-colors hover:bg-red-500 hover:text-white`:`desktop-window-no-drag flex h-10 w-[46px] items-center justify-center text-gray-700 transition-colors hover:bg-black/10`,onClick:()=>{window.nextclawDesktop?.controlWindow?.(e.action)},children:(0,U.jsx)(t,{className:`h-3.5 w-3.5`})})}function Bae(){let[e,t]=(0,H.useState)(!1);return(0,H.useEffect)(()=>{let e=!0,n=window.nextclawDesktop;n?.getWindowState?.().then(n=>{e&&t(n.isMaximized)});let r=n?.onWindowStateChanged?.(e=>{t(e.isMaximized)});return()=>{e=!1,r?.()}},[]),e}function W7(){return typeof window>`u`?null:Vae()??window.nextclawDesktop?.platform??null}function G7(){return W7()===`win32`}function Vae(){return null}function K7(){let{pathname:e}=_e(),t=Hi(),n=D7();return(0,U.jsx)(`nav`,{"data-testid":`mobile-bottom-nav`,"aria-label":b(`settings`),className:`shrink-0 border-t border-gray-200/80 bg-white/95 backdrop-blur-sm`,style:{paddingBottom:`calc(env(safe-area-inset-bottom, 0px) + 0.25rem)`},children:(0,U.jsxs)(`ul`,{className:`grid grid-cols-6 gap-1 px-2 pt-1`,children:[Cae(b).map(t=>{let r=t.target===`/settings`?Tae(e):P7(e,t.target);return(0,U.jsx)(`li`,{children:(0,U.jsxs)(ue,{to:t.target,"aria-current":r?`page`:void 0,"data-testid":r?`mobile-nav-active-indicator`:void 0,className:u(`group flex min-h-[2.875rem] flex-col items-center justify-center gap-0.5 rounded-xl px-2 py-1 text-[10px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,r?`bg-gray-100 text-gray-900`:`text-gray-500 hover:bg-gray-50 hover:text-gray-800`),children:[(0,U.jsxs)(`span`,{className:`relative`,children:[(0,U.jsx)(t.icon,{className:u(`h-3.5 w-3.5`,r?`text-gray-900`:`text-gray-400`)}),t.target===`/inbox`&&n>0?(0,U.jsx)(`span`,{className:`absolute -right-1 -top-1 h-1.5 w-1.5 rounded-full bg-primary ring-1 ring-white`}):null]}),(0,U.jsx)(`span`,{className:`max-w-full truncate`,children:t.label})]})},t.target)}),(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,onClick:()=>L1(t),className:`group flex min-h-[2.875rem] w-full flex-col items-center justify-center gap-0.5 rounded-xl px-2 py-1 text-[10px] font-medium text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-800 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:[(0,U.jsx)(Zr,{className:`h-3.5 w-3.5 text-gray-400`}),(0,U.jsx)(`span`,{className:`max-w-full truncate`,children:b(`appsTitle`)})]})})]})})}function q7({leadingInset:e}){let t=ce(),{pathname:n}=_e(),r=Eae(n,b);return(0,U.jsx)(`header`,{"data-testid":`mobile-topbar`,className:`shrink-0 border-b border-gray-200/80 bg-white/95 backdrop-blur-sm`,style:{paddingTop:`calc(env(safe-area-inset-top, 0px) + 0.25rem)`},children:(0,U.jsxs)(`div`,{className:`flex min-h-[2.75rem] items-center gap-2 py-1.5 pl-3 pr-3`,style:{paddingLeft:e?`calc(${e} + 0.75rem)`:void 0},children:[r.backTarget?(0,U.jsx)(`button`,{type:`button`,onClick:()=>t(r.backTarget),className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-gray-200 text-gray-600 transition-colors hover:bg-gray-50 hover:text-gray-900`,"aria-label":r.backLabel??b(`backToMain`),children:(0,U.jsx)(Ci,{className:`h-4 w-4`})}):null,(0,U.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,U.jsx)(`h1`,{className:`truncate text-center text-[15px] font-semibold text-gray-900`,children:r.title})}),r.backTarget?(0,U.jsx)(`div`,{className:`h-8 w-8 shrink-0`,"aria-hidden":`true`}):null]})})}var Hae=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{DocBrowser:e}=await import(`./doc-browser-y3e2_MXe.js`);return{DocBrowser:e}},__vite__mapDeps([25,26,4,27,28,29,30,31,32,33,1,34,35,36,37,38,39]))).DocBrowser}));function Uae({pathname:e,isDocBrowserOpen:t,docBrowserDockControls:n,docBrowserRenderers:r={},docBrowserTabMenuGroups:i,topbarLeadingInset:a,children:o}){let s=F7(e),c=!I7(e),l=!I7(e);return(0,U.jsxs)(`div`,{className:`flex h-[100svh] flex-col bg-background font-sans text-foreground supports-[height:100dvh]:h-[100dvh]`,children:[c?(0,U.jsx)(q7,{leadingInset:a}):null,(0,U.jsx)(`div`,{className:`relative flex-1 min-h-0 overflow-hidden`,children:s?(0,U.jsx)(`div`,{className:`h-full min-h-0 overflow-hidden`,children:o}):(0,U.jsx)(`main`,{className:`h-full overflow-auto px-4 py-4 custom-scrollbar`,children:(0,U.jsx)(`div`,{className:`mx-auto max-w-3xl animate-fade-in`,children:o})})}),l?(0,U.jsx)(K7,{}):null,t?(0,U.jsx)(H.Suspense,{fallback:null,children:(0,U.jsx)(Hae,{customTabRenderers:r,displayMode:`fullscreen`,dockControls:n,getTabMenuGroups:i})}):null]})}function Wae(){let e=L7(b,{includeDesktopCapabilities:V7()});return(0,U.jsx)(`div`,{"data-testid":`mobile-settings-shell`,className:`space-y-3 pb-4`,children:e.map(e=>(0,U.jsxs)(pe,{to:e.target,className:({isActive:e})=>u(`flex items-center gap-3 rounded-2xl border border-gray-200/80 bg-white px-4 py-4 shadow-card transition-colors`,e?`border-gray-300 bg-gray-50`:`hover:border-gray-300 hover:bg-gray-50/70`),children:[(0,U.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl bg-gray-100 text-gray-600`,children:(0,U.jsx)(e.icon,{className:`h-4 w-4`})}),(0,U.jsx)(`div`,{className:`min-w-0`,children:(0,U.jsx)(`p`,{className:`truncate text-sm font-semibold text-gray-900`,children:e.label})})]},e.target))})}function Gae(){let{pathname:e}=_e(),t=ce();return I7(e)?(0,U.jsx)(Z5,{layoutMode:`mobile`,onBackToList:()=>t(`/chat`)}):(0,U.jsx)(Y7,{variant:`mobile`})}var J7=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{DocBrowser:e}=await import(`./doc-browser-y3e2_MXe.js`);return{DocBrowser:e}},__vite__mapDeps([25,26,4,27,28,29,30,31,32,33,1,34,35,36,37,38,39]))).DocBrowser}));function Kae({pathname:e,isMobileLayout:t=!1,isDocBrowserOpen:n,docBrowserMode:r,docBrowserDockControls:i,docBrowserRenderers:a={},docBrowserTabMenuGroups:o,sideDock:s,children:c}){let l=F7(e),d=ac(e=>e.isSidebarCollapsed),f=t&&!I7(e),p=G7(),m=d?`56px`:l?`280px`:`240px`,{onScroll:h,scrollRef:g}=oY({restorationKey:l?null:`settings-page:${e}`});return(0,U.jsxs)(`div`,{"data-theme-surface":`app-shell`,className:u(`h-screen flex flex-col overflow-hidden bg-background font-sans text-foreground`,p?`rounded-[10px]`:null),style:p?{"--desktop-titlebar-height":`40px`,"--desktop-caption-safe-right":`140px`,"--desktop-sidebar-width":m}:void 0,children:[(0,U.jsx)(`div`,{"aria-hidden":`true`,"data-theme-decoration":`island-paper`}),(0,U.jsx)(`svg`,{"aria-hidden":`true`,className:`absolute h-0 w-0`,focusable:`false`,children:(0,U.jsx)(`defs`,{children:(0,U.jsxs)(`filter`,{id:`island-wind-filter`,x:`-8%`,y:`-8%`,width:`116%`,height:`116%`,colorInterpolationFilters:`sRGB`,children:[(0,U.jsx)(`feTurbulence`,{type:`turbulence`,baseFrequency:`0.0025 0.011`,numOctaves:`2`,seed:`7`,result:`island-wind-noise`,children:(0,U.jsx)(`animate`,{attributeName:`baseFrequency`,dur:`8.5s`,values:`0.0025 0.011;0.0038 0.015;0.0028 0.009;0.0025 0.011`,keyTimes:`0;0.38;0.72;1`,calcMode:`spline`,keySplines:`0.42 0 0.25 1;0.45 0 0.2 1;0.4 0 0.3 1`,repeatCount:`indefinite`})}),(0,U.jsx)(`feDisplacementMap`,{in:`SourceGraphic`,in2:`island-wind-noise`,scale:`5`,xChannelSelector:`R`,yChannelSelector:`G`,children:(0,U.jsx)(`animate`,{attributeName:`scale`,dur:`8.5s`,values:`5;17;9;14;5`,keyTimes:`0;0.34;0.58;0.78;1`,calcMode:`spline`,keySplines:`0.42 0 0.25 1;0.45 0 0.2 1;0.4 0 0.3 1;0.42 0 0.3 1`,repeatCount:`indefinite`})})]})})}),(0,U.jsx)(`div`,{"aria-hidden":`true`,"data-theme-decoration":`island-palm`,children:(0,U.jsx)(`span`,{"data-island-palm-part":`frond-wind`})}),p?(0,U.jsx)(Rae,{sidebarCollapsed:d}):null,(0,U.jsxs)(`div`,{className:`relative z-[1] flex min-h-0 flex-1 overflow-hidden`,children:[!l&&(0,U.jsx)(Lae,{}),(0,U.jsxs)(`div`,{className:`flex-1 flex min-w-0 overflow-hidden relative`,children:[(0,U.jsx)(`div`,{className:`flex-1 flex flex-col min-w-0 overflow-hidden`,children:l?(0,U.jsx)(`div`,{className:`flex-1 h-full overflow-hidden`,children:c}):(0,U.jsx)(`main`,{"data-theme-surface":`settings-workspace`,ref:g,onScroll:h,className:`flex-1 overflow-auto p-8 pb-16 custom-scrollbar`,children:(0,U.jsx)(`div`,{className:`mx-auto h-full max-w-6xl animate-fade-in`,children:c})})}),n&&r===`docked`?(0,U.jsx)(H.Suspense,{fallback:null,children:(0,U.jsx)(J7,{customTabRenderers:a,dockControls:i,getTabMenuGroups:o})}):null,s]})]}),f?(0,U.jsx)(K7,{}):null,n&&r===`floating`?(0,U.jsx)(H.Suspense,{fallback:null,children:(0,U.jsx)(J7,{customTabRenderers:a,dockControls:i,getTabMenuGroups:o})}):null]})}var qae=[{target:`/inbox`,label:()=>b(`inboxTitle`),icon:ao},{target:`/cron`,label:()=>b(`chatSidebarScheduledTasks`),icon:ra},{target:`/skills`,label:()=>b(`chatSidebarSkills`),icon:sa},{target:`/agents`,label:()=>b(`agentsPageTitle`),icon:oa}];function Jae({isCollapsed:e}){let t=b(e?`sidebarExpand`:`sidebarCollapse`);return(0,U.jsx)(V,{icon:(0,U.jsx)(e?Io:Po,{className:rX}),label:t,className:u(oX,e&&`h-9 w-9 rounded-xl`),onClick:oc.toggleSidebarCollapsed})}function Yae({connectionStatus:e,isCollapsed:t}){let n=G7(),r=typeof window<`u`&&window.nextclawDesktop?.platform===`darwin`;return(0,U.jsxs)(`div`,{className:u(`flex items-center`,t?`justify-center px-2 py-1.5`:n?`justify-end px-3 py-1.5`:`gap-2 px-4 py-2`,t&&r?`pt-8`:null),children:[t||n?null:(0,U.jsx)(y7,{className:`flex min-w-0 flex-1 items-center gap-2`,suffix:(0,U.jsx)(aae,{status:e})}),(0,U.jsx)(Jae,{isCollapsed:t})]})}function Xae({isCollapsed:e}){let t=D7();return(0,U.jsxs)(`div`,{className:`pb-1`,children:[(0,U.jsx)(`div`,{className:e?`px-0`:`px-3`,children:(0,U.jsx)(`ul`,{className:e?iX:`space-y-0.5`,children:qae.map(n=>(0,U.jsx)(`li`,{className:e?`flex justify-center`:void 0,children:(0,U.jsx)(mX,{to:n.target,label:n.label(),icon:n.icon,density:`compact`,collapsed:e,indicator:n.target===`/inbox`&&t>0,trailing:n.target===`/inbox`&&t>0?t>99?`99+`:t:void 0,className:e?void 0:`rounded-lg px-2.5 py-1.5`})},n.target))})}),(0,U.jsx)(yX,{isCollapsed:e})]})}function Zae({defaultSessionType:e,groups:t,isCollapsed:n,isLoading:r,isProjectFirstView:i,onAddProject:a,onScrollNearEnd:o=()=>void 0,onSelectMode:s,projectGroups:c,projectCronJobCountByRoot:l,renderSessionItem:d,sessionTypeOptions:f}){let{onScroll:p,scrollRef:m}=oY({restorationKey:`chat-sidebar:sessions`,isEnabled:!n});return n?(0,U.jsx)(`div`,{className:`min-h-0 flex-1`,"aria-hidden":`true`}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flex h-8 items-center justify-end gap-1 px-3`,children:[i?(0,U.jsx)(V,{icon:(0,U.jsx)(Ga,{className:`h-3.5 w-3.5`}),label:b(`chatProjectAdd`),tone:`surface`,onClick:a}):null,(0,U.jsx)(wL,{isProjectFirstView:i,onSelectMode:s})]}),(0,U.jsx)(`div`,{ref:m,onScroll:e=>{p(e);let t=e.currentTarget;t.scrollHeight-t.scrollTop-t.clientHeight<600&&o()},className:u(`custom-scrollbar min-h-0 flex-1 overflow-y-auto px-3 pb-4 pt-1`,PF),children:(0,U.jsx)(bae,{isLoading:r,isProjectFirstView:i,groups:t,projectGroups:c,projectCronJobCountByRoot:l,defaultSessionType:e,sessionTypeOptions:f,renderSessionItem:d})})]})}function Qae({currentLanguage:e,currentLanguageLabel:t,currentTheme:n,currentThemeLabel:r,isCollapsed:i,isOpen:a,languageOptions:o,onOpenApps:s,onOpenChange:c,onOpenDocs:l,onSelectLanguage:d,onSelectTheme:f,themeOptions:p}){return(0,U.jsx)(`div`,{className:u(`py-2`,i?u(`flex justify-center`,tX):`px-3`),children:(0,U.jsx)(xae,{isOpen:a,onOpenChange:c,currentTheme:n,currentThemeLabel:r,themeOptions:p,onSelectTheme:f,currentLanguage:e,currentLanguageLabel:t,languageOptions:o,onSelectLanguage:d,onOpenDocs:l,onOpenApps:s,collapsed:i})})}function $ae(e){return b(e===`knowledge-base`?`chatProjectTemplateKnowledgeBase`:`chatProjectTemplateEmpty`)}function eoe({open:e,defaultWorkspacePath:t,templates:n,isCreating:r,isAddingExisting:i,createErrorMessage:a,addExistingErrorMessage:o,onOpenChange:s,onCreate:c,onAddExisting:l}){let[u,d]=(0,H.useState)(`create`),[f,p]=(0,H.useState)(``),[m,h]=(0,H.useState)(``),[g,_]=(0,H.useState)(``),[v,y]=(0,H.useState)(!1),[x,S]=(0,H.useState)(`empty`),C=n.length>0?n.map(e=>e.id):[`empty`],w=f.trim(),T=m.trim(),E=g.trim(),D=r||i,O=D||(u===`create`?!w:!E),k=u===`create`?a:o,A=()=>{d(`create`),p(``),h(``),_(``),S(`empty`),y(!1)},j=()=>{D||(A(),s(!1))};return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ur,{open:e,onOpenChange:e=>{if(e){s(!0);return}j()},children:(0,U.jsxs)(Kr,{className:`sm:max-w-lg`,children:[(0,U.jsxs)(Wr,{children:[(0,U.jsx)(qr,{children:b(`chatProjectAddTitle`)}),(0,U.jsx)(Br,{children:b(`chatProjectAddDescription`)})]}),(0,U.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),!O&&(u===`create`?c({name:w,template:x,rootPath:T||void 0}):l({rootPath:E})).then(A).catch(()=>void 0)},children:[(0,U.jsxs)(KY,{value:u,onValueChange:e=>{D||d(e===`existing`?`existing`:`create`)},children:[(0,U.jsxs)(qY,{className:`grid w-full grid-cols-2`,children:[(0,U.jsx)(JY,{value:`create`,children:b(`chatProjectCreateMode`)}),(0,U.jsx)(JY,{value:`existing`,children:b(`chatProjectExistingMode`)})]}),(0,U.jsxs)(YY,{value:`create`,className:`mt-4 space-y-4`,children:[(0,U.jsx)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:b(`chatProjectCreateModeDescription`)}),(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(dn,{htmlFor:`chat-project-name`,children:b(`chatProjectNameLabel`)}),(0,U.jsx)(St,{id:`chat-project-name`,value:f,onChange:e=>p(e.target.value),placeholder:b(`chatProjectNamePlaceholder`),autoFocus:!0,disabled:D})]}),(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(dn,{htmlFor:`chat-project-template`,children:b(`chatProjectTemplateLabel`)}),(0,U.jsxs)(Dr,{value:x,onValueChange:e=>S(e),disabled:D,children:[(0,U.jsx)(yr,{id:`chat-project-template`,children:(0,U.jsx)(fr,{})}),(0,U.jsx)(Sr,{children:C.map(e=>(0,U.jsx)(Tr,{value:e,children:$ae(e)},e))})]})]}),(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(dn,{htmlFor:`chat-project-create-root-path`,children:b(`chatProjectCreatePathLabel`)}),(0,U.jsxs)(`div`,{className:`flex gap-2`,children:[(0,U.jsx)(St,{id:`chat-project-create-root-path`,value:m,onChange:e=>h(e.target.value),placeholder:b(`chatProjectCreatePathPlaceholder`),disabled:D}),(0,U.jsxs)(R,{type:`button`,variant:`outline`,onClick:()=>y(!0),disabled:D,children:[(0,U.jsx)(Wa,{className:`mr-2 h-4 w-4`}),b(`browse`)]})]}),(0,U.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:b(`chatProjectCreatePathHint`)})]})]}),(0,U.jsxs)(YY,{value:`existing`,className:`mt-4 space-y-4`,children:[(0,U.jsx)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:b(`chatProjectExistingModeDescription`)}),(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(dn,{htmlFor:`chat-project-existing-root-path`,children:b(`chatProjectExistingPathLabel`)}),(0,U.jsxs)(`div`,{className:`flex gap-2`,children:[(0,U.jsx)(St,{id:`chat-project-existing-root-path`,value:g,onChange:e=>_(e.target.value),placeholder:b(`chatProjectExistingPathPlaceholder`),autoFocus:!0,disabled:D}),(0,U.jsxs)(R,{type:`button`,variant:`outline`,onClick:()=>y(!0),disabled:D,children:[(0,U.jsx)(Wa,{className:`mr-2 h-4 w-4`}),b(`browse`)]})]}),(0,U.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:b(`chatProjectExistingPathHint`)})]})]})]}),k?(0,U.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:k}):null,(0,U.jsxs)(Pr,{children:[(0,U.jsx)(R,{type:`button`,variant:`outline`,onClick:j,disabled:D,children:b(`cancel`)}),(0,U.jsx)(R,{type:`submit`,disabled:O,children:b(D?`saving`:u===`create`?`chatProjectCreateAction`:`chatProjectExistingAction`)})]})]})]})}),(0,U.jsx)(GF,{open:v,allowCreateDirectory:u===`create`,currentPath:u===`create`?m:g,defaultWorkspacePath:t,isSaving:!1,onOpenChange:y,onConfirm:e=>{u===`create`?h(e):_(e),y(!1)},title:b(u===`create`?`chatProjectCreatePathPickerTitle`:`chatProjectExistingPathPickerTitle`),description:b(u===`create`?`chatProjectCreatePathPickerDescription`:`chatProjectExistingPathPickerDescription`),pathLabel:b(u===`create`?`chatProjectCreatePathLabel`:`chatProjectExistingPathLabel`),pathPlaceholder:b(u===`create`?`chatProjectCreatePathPlaceholder`:`chatProjectExistingPathPlaceholder`),confirmLabel:b(`selectCurrentDirectory`),hint:b(u===`create`?`chatProjectCreatePathHint`:`chatProjectExistingPathHint`)})]})}function toe(e){let t=L5({all:!0});return(0,H.useMemo)(()=>{let n=new Map(e.flatMap(({session:e})=>{let t=e.projectRoot?.trim();return t?[[e.key,t]]:[]})),r=new Map,i=new Map;for(let e of t.data?.jobs??[]){let t=e.payload.sessionId?.trim();if(!t)continue;r.set(t,(r.get(t)??0)+1);let a=n.get(t);a&&i.set(a,(i.get(a)??0)+1)}return{cronJobCountByProjectRoot:i,cronJobCountBySessionKey:r}},[e,t.data?.jobs])}function noe(e,t,n){let r=aL(e=>e.optimisticReadAtBySessionKey);return(0,H.useEffect)(()=>{(()=>{if(!t)return;let r=e.find(({session:e})=>e.key===t);if(!r||r.runStatus===`running`)return;let{session:i}=r;n(i.key,i.lastMessageAt,i.readAt)})()},[e,n,t]),r}function Y7({variant:e=`desktop`}){let t=e===`mobile`,n=eI(),r=Hi(),i=ac(e=>e.isSidebarCollapsed),[a,o]=(0,H.useState)(!1),[s,c]=(0,H.useState)(!1),[l,d]=(0,H.useState)(!1),f=aL(e=>e.snapshot),p=eR(e=>e.snapshot.sessionTypesQuery?.data??null),m=eR(e=>e.snapshot.configQuery?.data??null),h=Ze(),g=oz(),_=nR(),v=rR(),y=iR(),{allItems:x,hasMore:S,isLoading:C,isLoadingMore:w,items:T,loadMore:E}=gL(),{cronJobCountByProjectRoot:D,cronJobCountBySessionKey:O}=toe(x),{language:k,setLanguage:j}=Wn(),{theme:M,setTheme:N}=h7(),P=b(t7.find(e=>e.value===M)?.labelKey??`themeWork`),ee=A.find(e=>e.value===k)?.label??k,te=(0,H.useMemo)(()=>t7.map(e=>({value:e.value,label:b(e.labelKey)})),[]),ne=(0,H.useMemo)(()=>A.map(e=>({value:e.value,label:e.label})),[]),re=(0,H.useMemo)(()=>new Map((g.data?.agents??[]).map(e=>[e.id,e])),[g.data?.agents]),ie=(0,H.useMemo)(()=>new Set(f.pinnedSessionKeys),[f.pinnedSessionKeys]),ae=(0,H.useMemo)(()=>new Set(f.pinnedProjectRoots),[f.pinnedProjectRoots]),oe=(0,H.useMemo)(()=>vL(T),[T]),se=(0,H.useMemo)(()=>SL(x),[x]),ce=(0,H.useMemo)(()=>bL(oe,ie),[ie,oe]),le=(0,H.useMemo)(()=>xL(oe,ie,ae,_.data?.projects??[]),[ae,ie,_.data?.projects,oe]),ue=(0,H.useMemo)(()=>kL(p?.options??[]),[p?.options]),de=(0,H.useMemo)(()=>EL(p?.defaultType??`native`),[p?.defaultType]),fe=gR({defaultSessionType:de,sessionTypeOptions:ue}),pe=f.listMode===`project-first`,me=!t&&i,he=noe(T,f.selectedSessionKey,n.chatSessionListManager.markSessionRead),{editingSessionKey:ge,draftLabel:_e,savingSessionKey:ve,setDraftLabel:ye,startEditingSessionLabel:be,cancelEditingSessionLabel:F,saveSessionLabel:xe}=Tie(),Se=e=>{k!==e&&(j(e),window.location.reload())},Ce=e=>(0,U.jsx)(Kie,{item:e,selectedSessionKey:f.selectedSessionKey,optimisticReadAtBySessionKey:he,agentsById:re,childSessionsByParentKey:se,cronJobCount:O.get(e.session.key)??0,editingSessionKey:ge,draftLabel:_e,savingSessionKey:ve,sessionTypeOptions:ue,isPinned:ie.has(e.session.key),sessionTitle:CL,onSelectSession:n.chatSessionListManager.selectSession,onStartEditingSessionLabel:be,onDraftLabelChange:ye,onSaveSessionLabel:xe,onCancelEditingSessionLabel:F,onTogglePinned:()=>n.chatSessionListManager.toggleSessionPinned(e.session.key),onDeleteSession:n.chatThreadManager.deleteSession},e.session.key),we=(e,t)=>{n.chatSessionListManager.createSession({projectRoot:typeof t==`string`?t:void 0,sessionType:e})},Te=()=>{v.reset(),y.reset(),c(!0)},Ee=async e=>{await v.mutateAsync(e),c(!1)},De=async e=>{await y.mutateAsync(e),c(!1)};return(0,U.jsxs)(`aside`,{"data-theme-surface":`navigation`,className:u(`flex h-full min-h-0 flex-col bg-secondary transition-[width] duration-200 ease-out`,t?`flex-1 overflow-hidden`:me?u(eX,`shrink-0`):`w-[280px] shrink-0`),"data-sidebar-collapsed":me?`true`:`false`,children:[t?null:(0,U.jsx)(Yae,{connectionStatus:h.connectionStatus,isCollapsed:me}),t?(0,U.jsx)(Yie,{query:f.query,defaultSessionType:fe.selectedSessionType,sessionTypeOptions:ue,selectedNewSessionType:fe.selectedSessionType,selectedNewSessionTypeOption:fe.selectedSessionTypeOption,isCreateMenuOpen:a,onCreateMenuOpenChange:o,onCreateSession:we,onSelectNewSessionType:fe.setSelectedSessionType,onQueryChange:n.chatSessionListManager.setQuery}):(0,U.jsx)(Jie,{query:f.query,defaultSessionType:de,sessionTypeOptions:ue,selectedNewSessionType:fe.selectedSessionType,selectedNewSessionTypeOption:fe.selectedSessionTypeOption,isCreateMenuOpen:a,onCreateMenuOpenChange:o,onCreateSession:we,onSelectNewSessionType:fe.setSelectedSessionType,onQueryChange:n.chatSessionListManager.setQuery,collapsed:me}),t?null:(0,U.jsx)(Xae,{isCollapsed:me}),(0,U.jsx)(Zae,{defaultSessionType:fe.selectedSessionType,groups:ce,isCollapsed:me,isLoading:C,isProjectFirstView:pe,onAddProject:Te,onScrollNearEnd:()=>{S&&!w&&E()},onSelectMode:n.chatSessionListManager.setListMode,projectGroups:le,projectCronJobCountByRoot:D,renderSessionItem:Ce,sessionTypeOptions:ue}),t?null:(0,U.jsx)(Qae,{currentLanguage:k,currentLanguageLabel:ee,currentTheme:M,currentThemeLabel:P,isCollapsed:me,isOpen:l,languageOptions:ne,onOpenApps:()=>L1(r),onOpenChange:d,onOpenDocs:()=>r.open(void 0,{kind:`docs`,title:b(`docBrowserHelp`)}),onSelectLanguage:Se,onSelectTheme:N,themeOptions:te}),(0,U.jsx)(eoe,{open:s,defaultWorkspacePath:pI(m?.agents.defaults.workspace),templates:_.data?.templates??[],isCreating:v.isPending,isAddingExisting:y.isPending,createErrorMessage:v.error?.message,addExistingErrorMessage:y.error?.message,onOpenChange:c,onCreate:Ee,onAddExisting:De})]})}var X7=`sid_`,Z7=`/chat/draft`,roe=Z7.slice(6);function ioe(e){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCharCode(e);return`${X7}${btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/g,``)}`}function aoe(e){if(!e.startsWith(X7))return null;let t=e.slice(4).replace(/-/g,`+`).replace(/_/g,`/`),n=`=`.repeat((4-t.length%4)%4);try{let e=atob(t+n),r=Uint8Array.from(e,e=>e.charCodeAt(0));return new TextDecoder().decode(r)}catch{return null}}function Q7(e){if(!e||e===roe)return null;let t=aoe(e);if(t)return t;try{return decodeURIComponent(e)}catch{return e}}function $7(e){return`/chat/${ioe(e)}`}function e9(e,t){let n=t.trim();return n?e.includes(n)?e.filter(e=>e!==n):[n,...e]:e}var ooe=class{constructor(e){this.uiManager=e,this.syncDraftThreadState=e=>{let t=$.getState().snapshot.workspaceFileTabs.filter(e=>e.parentSessionKey!==null);$.getState().setSnapshot({sessionKey:null,sessionDisplayName:void 0,draftProjectRoot:e,canDeleteSession:!1,parentSessionKey:null,parentSessionLabel:null,workspacePanelParentKey:null,activeWorkspacePanelKind:null,childSessionTabs:[],activeChildSessionKey:null,activeSideChatDraft:null,activeWorkspaceFileKey:null,workspaceFileTabs:t,closedWorkspaceTabEntries:[],workspaceNavigationHistory:[],workspaceNavigationHistoryIndex:0})},this.resolveUpdateValue=(e,t)=>typeof t==`function`?t(e):t,this.shouldPersistReadAt=(e,t,n)=>{let r=aL.getState().optimisticReadAtBySessionKey[e],i=r&&n?r.localeCompare(n)>0?r:n:r??n??void 0;return i?t.localeCompare(i)>0:!0},this.setSelectedAgentId=e=>{let t=aL.getState().snapshot.selectedAgentId,n=this.resolveUpdateValue(t,e);n!==t&&aL.getState().setSnapshot({selectedAgentId:n})},this.syncSelectedSessionAgent=()=>{let e=$.getState().snapshot.agentId?.trim();e&&this.setSelectedAgentId(e)},this.setSelectedSessionKey=e=>{e!==aL.getState().snapshot.selectedSessionKey&&aL.getState().setSnapshot({selectedSessionKey:e})},this.syncRouteSessionSelection=e=>{this.setSelectedSessionKey(e),e&&$.getState().setSnapshot({draftProjectRoot:null})},this.setListMode=e=>{let t=aL.getState().snapshot.listMode,n=this.resolveUpdateValue(t,e);n!==t&&aL.getState().setSnapshot({listMode:n})},this.toggleSessionPinned=e=>{let{pinnedSessionKeys:t}=aL.getState().snapshot;aL.getState().setSnapshot({pinnedSessionKeys:e9(t,e)})},this.toggleProjectPinned=e=>{let{pinnedProjectRoots:t}=aL.getState().snapshot;aL.getState().setSnapshot({pinnedProjectRoots:e9(t,e)})},this.toggleProjectCollapsed=e=>{let{collapsedProjectRoots:t}=aL.getState().snapshot;aL.getState().setSnapshot({collapsedProjectRoots:e9(t,e)})},this.markSessionRead=(e,t,n)=>{let r=e?.trim(),i=t?.trim();!r||!i||this.shouldPersistReadAt(r,i,n)&&(aL.getState().markSessionRead(r,i),Qe(r,{uiReadAt:i}).catch(()=>void 0))},this.markVisibleWorkspaceChildRead=e=>{this.markSessionRead(e.sessionKey,e.runStatus===`running`?null:e.lastMessageAt,e.readAt)},this.createSession=(e={})=>{let{projectRoot:t,prompt:n,sessionType:r}=e,i=EL(r??`native`),a=pI(t),o=n?.trim()||null;this.syncDraftThreadState(a),this.uiManager.navigateTo(Z7,{replace:this.uiManager.isAtChatRoot(),state:{chatDraft:{sessionType:i,projectRoot:a,prompt:o}}})},this.startAgentDraftChat=(e,t,n)=>{let r=e.trim()||`main`;this.createSession({prompt:n,sessionType:t}),this.setSelectedAgentId(r)},this.selectSession=e=>{this.uiManager.goToSession(e)},this.setQuery=e=>{let t=aL.getState().snapshot.query,n=this.resolveUpdateValue(t,e);n!==t&&aL.getState().setSnapshot({query:n})}}},soe=async()=>!1,coe=class{constructor(e){this.docBrowserManager=e,this.state={pathname:``},this.actions={navigate:null,confirm:soe},this.syncState=e=>{this.state={...this.state,...e}},this.bindActions=e=>{this.actions={...this.actions,...e}},this.confirm=async e=>this.actions.confirm(e),this.navigateTo=(e,t)=>{this.actions.navigate&&(this.state.pathname===e&&!t?.replace||(this.actions.navigate(e,t),this.state.pathname=e))},this.goToProviders=()=>{this.navigateTo(`/providers`)},this.isCompactViewport=()=>oc.getSnapshot().mode===`mobile`,this.resolvePanelAppEntry=async e=>{let t=e.trim();if(!t)return null;try{return U1((await I.panelApps.listPanelApps()).entries,t)}catch{return null}},this.showContent=async e=>{let{target:t,title:n}=e;if(t.type===`url`){this.docBrowserManager.open(t.payload.url,{dedupeKey:`browser:${t.payload.url}`,kind:`content`,title:n});return}let{appId:r,params:i,path:a}=t.payload;if(a){this.docBrowserManager.open(a1(r,a),{contentParams:i,title:n});return}let o=await this.resolvePanelAppEntry(r);if(o){this.docBrowserManager.openTarget({...f1(o),contentParams:i},{title:n});return}this.docBrowserManager.open(a1(r),{contentParams:i,title:n})},this.goToChatRoot=e=>{this.navigateTo(`/chat`,e)},this.isAtChatRoot=()=>this.state.pathname===`/chat`||this.state.pathname===`/chat/draft`,this.goToSession=(e,t)=>{this.navigateTo($7(e),t)}}};function t9(e){let t=e=>{if(!e||typeof e!=`object`)return e;let t=e,n=t.error instanceof Error?{name:t.error.name,message:t.error.message}:t.error;return{data:t.data,error:n,status:t.status,fetchStatus:t.fetchStatus,isLoading:t.isLoading,isFetching:t.isFetching,isFetched:t.isFetched,isSuccess:t.isSuccess}};return{configQuery:t(e.configQuery),providersQuery:t(e.providersQuery),providerTemplatesQuery:t(e.providerTemplatesQuery),sessionsQuery:t(e.sessionsQuery),sessionTypesQuery:t(e.sessionTypesQuery),sessionSkillsSessionId:e.sessionSkillsSessionId,sessionSkillsQuery:t(e.sessionSkillsQuery)}}function loe(e,t){return JSON.stringify(t9(e))!==JSON.stringify(t9({...e,...t}))}var uoe=class{constructor(){this.syncSnapshot=e=>{let t=eR.getState();loe(t.snapshot,e)&&t.setSnapshot(e)}}};function doe(){return{sessionKey:null,sessionTypeLabel:null,agentId:null,sessionDisplayName:void 0,draftProjectRoot:null,sessionProjectName:null,canDeleteSession:!1,parentSessionKey:null,parentSessionLabel:null,workspacePanelParentKey:null,activeWorkspacePanelKind:null,childSessionTabs:[],activeChildSessionKey:null,activeSideChatDraft:null,workspaceFileTabs:[],activeWorkspaceFileKey:null,closedWorkspaceTabEntries:[],workspaceNavigationHistory:[],workspaceNavigationHistoryIndex:0}}function n9(e,t,n){return e===t?n:e.startsWith(`${t}/`)||e.startsWith(`${t}\\`)?`${n}${e.slice(t.length)}`:null}function foe(e,t){let n=t.previousPath.trim(),r=t.path.trim();if(!n||!r||n===r)return null;let i=new Map,a=e.workspaceFileTabs.map(e=>{let a=n9(e.path,n,r);if(!a)return e;let o=LR(e,a,e.path===n?t.label:e.label);return i.set(e.key,o.key),o});if(i.size===0)return null;let o=e=>e.kind===`file`&&i.has(e.key)?{kind:`file`,key:i.get(e.key)}:e;return{workspaceFileTabs:a,activeWorkspaceFileKey:e.activeWorkspaceFileKey?i.get(e.activeWorkspaceFileKey)??e.activeWorkspaceFileKey:null,closedWorkspaceTabEntries:e.closedWorkspaceTabEntries.map(o),workspaceNavigationHistory:e.workspaceNavigationHistory.map(o)}}function poe(e,t){let n=t.trim();if(!n)return null;let r=e,i=e.workspaceFileTabs.filter(e=>n9(e.path,n,n)!==null).map(e=>e.key);for(let e of i){let t=HR(r,{kind:`file`,key:e});t&&(r={...r,...t})}return i.length>0?r:null}var moe=class{constructor(e,t,n){this.uiManager=e,this.sessionListManager=t,this.onWorkspacePanelOpened=n,this.handledUiShowContentEventIds=new Set,this.hasSnapshotChanges=e=>{let t=$.getState().snapshot;for(let[n,r]of Object.entries(e))if(!Object.is(t[n],r))return!0;return!1},this.syncSnapshot=e=>{this.hasSnapshotChanges(e)&&$.getState().setSnapshot(e)},this.clearDeletedSessionState=()=>{$.getState().setSnapshot(doe())},this.resolveWorkspaceParentSessionKey=()=>aL.getState().snapshot.selectedSessionKey?.trim()||$.getState().snapshot.sessionKey?.trim()||(aL.getState().snapshot.selectedSessionKey??null),this.activateWorkspaceFileTab=(e,t)=>{let{parentSessionKey:n}=e,{workspaceFileTabs:r}=$.getState().snapshot;this.setWorkspaceSelection({workspacePanelParentKey:n,activeWorkspacePanelKind:`file`,workspaceFileTabs:IR(r,e,t),activeWorkspaceFileKey:e.key,activeChildSessionKey:null,activeSideChatDraft:null},{kind:`file`,key:e.key}),this.ensureWorkspaceParentRoute(n),this.onWorkspacePanelOpened?.()},this.ensureWorkspaceParentRoute=e=>{if(!e)return;let{snapshot:{selectedSessionKey:t}}=aL.getState();t!==e&&this.uiManager.goToSession(e)},this.setWorkspaceSelection=(e,t)=>{let{snapshot:n}=$.getState(),r=oi({entries:n.workspaceNavigationHistory,index:n.workspaceNavigationHistoryIndex},t,zR),i=e.workspacePanelParentKey&&e.workspacePanelParentKey!==n.workspacePanelParentKey?[]:n.closedWorkspaceTabEntries.filter(e=>!zR(e,t));$.getState().setSnapshot({...e,closedWorkspaceTabEntries:i,workspaceNavigationHistory:[...r.entries],workspaceNavigationHistoryIndex:r.index})},this.openWorkspacePage=(e,t)=>{let n=e?.trim()||null;!n&&t!==`project-files`||(this.setWorkspaceSelection({workspacePanelParentKey:n,activeWorkspacePanelKind:t,activeChildSessionKey:null,activeSideChatDraft:null,activeWorkspaceFileKey:null},{kind:t}),this.ensureWorkspaceParentRoute(n),this.onWorkspacePanelOpened?.())},this.openWorkspaceOverview=e=>{this.openWorkspacePage(e,`overview`)},this.toggleWorkspacePanel=e=>{let t=e?.trim()||null,{snapshot:n}=$.getState();if(n.workspacePanelParentKey===t&&n.activeWorkspacePanelKind){this.closeWorkspacePanel();return}if(t){this.openWorkspaceOverview(t);return}this.openProjectFiles(null)},this.setWorkspacePanelWidth=e=>{this.syncSnapshot({workspacePanelWidth:kR(e)})},this.setWorkspaceExplorerWidth=e=>{this.syncSnapshot({workspaceExplorerWidth:AR(e)})},this.renameWorkspacePath=e=>{let t=foe($.getState().snapshot,e);t&&this.syncSnapshot(t)},this.removeWorkspacePath=e=>{let t=poe($.getState().snapshot,e);t&&$.getState().setSnapshot(t)},this.openChildSessions=e=>this.openWorkspacePage(e,`child-sessions`),this.openContinuousAttention=e=>this.openWorkspacePage(e,`continuous-attention`),this.openProjectFiles=e=>this.openWorkspacePage(e,`project-files`),this.materializeRootDraftSession=e=>{let t=e.trim();if(!t||!this.uiManager.isAtChatRoot())return;let n=GR($.getState().snapshot,t);n&&(this.sessionListManager.syncRouteSessionSelection(t),$.getState().setSnapshot(n),this.uiManager.goToSession(t,{replace:!0}))},this.openChildSessionPanel=e=>{let{activeChildSessionKey:t,childSessionTab:n,parentSessionKey:r}=e,i=r.trim();if(!i)return;let a=t?.trim()||null,o={workspacePanelParentKey:i,activeWorkspacePanelKind:`child-session`,activeChildSessionKey:a,activeSideChatDraft:null,activeWorkspaceFileKey:null};a&&n&&(o.childSessionTabs=WR($.getState().snapshot.childSessionTabs,{sessionKey:a,parentSessionKey:i,label:n.label?.trim()||null,agentId:n.agentId?.trim()||null})),a?this.setWorkspaceSelection(o,{kind:`child-session`,key:a}):$.getState().setSnapshot(o),this.ensureWorkspaceParentRoute(i),this.onWorkspacePanelOpened?.()},this.openSideChatDraft=e=>{let t=e?.trim()||this.resolveWorkspaceParentSessionKey()?.trim();if(!t)return;let n=UR(t);this.setWorkspaceSelection({workspacePanelParentKey:t,activeWorkspacePanelKind:`side-chat-draft`,activeChildSessionKey:null,activeSideChatDraft:n,activeWorkspaceFileKey:null},{kind:`side-chat-draft`,key:n.draftKey}),this.ensureWorkspaceParentRoute(t),this.onWorkspacePanelOpened?.()},this.materializeSideChatDraft=e=>{let t=KR({snapshot:$.getState().snapshot,...e});t&&($.getState().setSnapshot(t.patch),this.ensureWorkspaceParentRoute(t.parentSessionKey))},this.openFilePreview=e=>{let t=FR(e,this.resolveWorkspaceParentSessionKey());t&&this.activateWorkspaceFileTab(t)},this.openWorkspaceFileViewer=(e,t)=>{let n=$.getState().snapshot.workspaceFileTabs.find(t=>t.key===e.trim());if(!n||n.viewMode!==`preview`)return;let r=t??PR(n.path,n.previewViewer);if(!r)return;let i=FR({path:n.path,label:n.label??void 0,viewMode:`preview`,previewViewer:r,line:n.line??void 0,column:n.column??void 0,params:n.params??void 0,rawText:n.rawText??void 0,contentUrl:n.contentUrl??void 0,mimeType:n.mimeType??void 0},n.parentSessionKey);i&&this.activateWorkspaceFileTab(i,n.key)},this.openSessionFromToolAction=e=>{if(e.kind!==`open-session`)return;let t=e.sessionId.trim();if(t){if(e.sessionKind===`child`&&!this.uiManager.isCompactViewport()){let n=e.parentSessionId?.trim()||aL.getState().snapshot.selectedSessionKey||null;if(n){this.openChildSessionPanel({parentSessionKey:n,activeChildSessionKey:t,childSessionTab:{label:e.label,agentId:e.agentId}});return}}this.closeWorkspacePanel(),this.uiManager.goToSession(t)}},this.handleToolAction=async e=>{if(e.kind===`show-content`){await this.showContent(e.request);return}this.openSessionFromToolAction(e)},this.handleUiShowContentEvent=async e=>{let t=e.id.trim();!t||this.handledUiShowContentEventIds.has(t)||(this.handledUiShowContentEventIds.add(t),await this.showContent({target:e.target,title:e.title,purpose:e.purpose,placement:e.placement}))},this.showContent=async e=>{if(e.placement!==`inline`){if(e.target.type===`file`){this.openFilePreview({path:e.target.payload.path,label:e.title,viewMode:`preview`,previewViewer:e.target.payload.viewer,line:e.target.payload.line,column:e.target.payload.column,params:e.target.payload.params});return}await this.uiManager.showContent({target:e.target,title:e.title})}},this.syncVisibleWorkspaceSelection=e=>{e?.kind===`child-session`&&this.sessionListManager.markVisibleWorkspaceChildRead(e.tab)},this.selectChildSessionDetail=e=>{let t=e.trim();t&&this.setWorkspaceSelection({activeChildSessionKey:t,activeWorkspaceFileKey:null,activeWorkspacePanelKind:`child-session`,activeSideChatDraft:null},{kind:`child-session`,key:t})},this.selectWorkspaceFile=e=>{let t=e.trim();if(!t)return;let{workspaceFileTabs:n}=$.getState().snapshot;n.some(e=>e.key===t)&&this.setWorkspaceSelection({activeWorkspaceFileKey:t,activeChildSessionKey:null,activeWorkspacePanelKind:`file`,activeSideChatDraft:null},{kind:`file`,key:t})},this.closeWorkspaceTab=e=>{let{snapshot:t}=$.getState(),n=HR(t,e);n&&$.getState().setSnapshot(n)},this.closeWorkspacePanel=()=>{$.getState().setSnapshot({workspacePanelParentKey:null,activeWorkspacePanelKind:null,activeChildSessionKey:null,activeSideChatDraft:null,activeWorkspaceFileKey:null,closedWorkspaceTabEntries:[],workspaceNavigationHistory:[],workspaceNavigationHistoryIndex:0})},this.openSessionCronPanel=e=>{this.openWorkspacePage(e,`cron`)},this.goBackWorkspacePanel=()=>{this.restoreWorkspaceNavigationStep(`back`)},this.goForwardWorkspacePanel=()=>{this.restoreWorkspaceNavigationStep(`forward`)},this.restoreWorkspaceNavigationStep=e=>{let{snapshot:t}=$.getState(),n=si({entries:t.workspaceNavigationHistory,index:t.workspaceNavigationHistoryIndex},e);if(!n)return;let r=VR(n.entry,t);r&&$.getState().setSnapshot({...r,workspaceNavigationHistory:[...n.history.entries],workspaceNavigationHistoryIndex:n.history.index})},this.goToParentSession=()=>{let{parentSessionKey:e,activeSideChatDraft:t,childSessionTabs:n,activeChildSessionKey:r}=$.getState().snapshot,i=n.find(e=>e.sessionKey===r)?.parentSessionKey??null,a=e??t?.parentSessionKey??i;a&&(this.closeWorkspacePanel(),this.uiManager.goToSession(a))},this.deleteSession=async e=>{let{snapshot:{selectedSessionKey:t}}=aL.getState(),n=e?.trim()||t;if(n&&await this.uiManager.confirm({title:b(`chatDeleteSessionConfirm`),variant:`destructive`,confirmLabel:b(`delete`)})){$.getState().setSnapshot({isDeletePending:!0});try{await Ft(n),et(jt,n),jt.removeQueries({queryKey:[`ncp-session-messages`,n]}),L.success(b(`chatDeleteSessionSucceeded`)),n===t&&(this.clearDeletedSessionState(),this.uiManager.goToChatRoot({replace:!0}))}catch(e){let t=e instanceof Error?e.message:String(e);L.error(`${b(`chatDeleteSessionFailed`)}: ${t}`)}finally{$.getState().setSnapshot({isDeletePending:!1})}}}}},hoe=class{constructor(e){this.chatUiManager=new coe(e.docBrowserManager),this.chatSessionListManager=new ooe(this.chatUiManager),this.chatQueryManager=new uoe,this.chatComposerIntentManager=e.chatComposerIntentManager,this.chatThreadManager=new moe(this.chatUiManager,this.chatSessionListManager,e.notifyRightPanelOpened)}},goe=class{constructor(){this.nextId=0,this.pendingIntent=null,this.listeners=new Set,this.requestDraft=e=>{let t=e.trim();if(!t)return;let n={id:this.nextId+1,kind:`prompt`,prompt:t};this.nextId=n.id,this.pendingIntent=n,this.listeners.forEach(e=>e(n))},this.requestSystemObjectReference=e=>{let t={id:this.nextId+1,kind:`system-object-reference`,reference:structuredClone(e)};this.nextId=t.id,this.pendingIntent=t,this.listeners.forEach(e=>e(t))},this.consumePending=()=>{let e=this.pendingIntent;return this.pendingIntent=null,e},this.markConsumed=e=>{this.pendingIntent?.id===e&&(this.pendingIntent=null)},this.subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)})}};function r9(e,t){let n=2166136261;for(let e=0;e<t.length;e+=1)n^=t.charCodeAt(e),n=Math.imul(n,16777619);return`${e}#excerpt-${(n>>>0).toString(36)}`}var _oe=class{constructor(){this.nextId=0,this.pendingIntent=null,this.subscriptions=new Set,this.publish=e=>{let t=this.nextId+1,n=e.targetSessionKey?.trim()||null,r={...e,id:t,targetSessionKey:n};this.nextId=r.id,this.pendingIntent=r,this.subscriptions.forEach(e=>{e.targetSessionKey===r.targetSessionKey&&e.listener(r)})},this.requestFileReference=e=>{let t=e.tokenKey.trim(),n=e.label.trim();!t||!n||this.publish({kind:r,targetSessionKey:e.targetSessionKey?.trim()||null,tokenKey:t,label:n})},this.requestDirectoryReference=e=>{let t=e.tokenKey.trim(),n=e.label.trim();!t||!n||this.publish({kind:p,targetSessionKey:e.targetSessionKey?.trim()||null,tokenKey:t,label:n})},this.requestExcerptReference=e=>{let{endLine:t,excerpt:n,label:r,path:i,startLine:a,targetSessionKey:o}=e,s=i.trim(),c=r.trim(),l=n.trim();!s||!c||!l||this.publish({kind:O,targetSessionKey:o,tokenKey:r9(s,`${s}:${a??`x`}:${t??`x`}:${l}`),path:s,label:c,excerpt:l,startLine:a,endLine:t})},this.requestConversationExcerptReference=e=>{let{targetSessionKey:t,messageId:n,role:r,label:i,excerpt:a}=e,o=n.trim(),s=i.trim(),c=a.trim();!o||!s||!c||this.publish({kind:te,targetSessionKey:t,tokenKey:r9(o,`${o}:${c}`),messageId:o,role:r,label:s,excerpt:c})},this.requestUiResourceReference=e=>{let t=x(e.reference);if(!t)return;let n=t.uri.trim(),r=t.title.trim();this.publish({kind:re,targetSessionKey:e.targetSessionKey,tokenKey:n,label:r,reference:t})},this.consumePending=e=>{if(this.pendingIntent?.targetSessionKey!==e)return null;let t=this.pendingIntent;return this.pendingIntent=null,t},this.markConsumed=e=>{this.pendingIntent?.id===e&&(this.pendingIntent=null)},this.subscribe=(e,t)=>{let n={targetSessionKey:e,listener:t};return this.subscriptions.add(n),()=>{this.subscriptions.delete(n)}}}},i9=120,voe=200;function yoe(e){return[e?.parent_session_id,e?.parentSessionId].some(e=>typeof e==`string`&&e.trim().length>0)}function boe(e){let t=e.replace(/\r\n?/gu,`
|
|
109
|
-
`).replace(/^[ \t]*\[[^\]]+\]:\s+\S+.*$/gmu,` `).replace(/^[ \t]*(?:`{3,}|~{3,})[^\n]*$/gmu,` `).replace(/^[ \t]*\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?[ \t]*$/gmu,` `).replace(/^[ \t]*(?:[-*_][ \t]*){3,}$/gmu,` `).replace(/!\[([^\]]*)\]\([^\n)]+\)/gu,`$1`).replace(/\[([^\]]+)\]\([^\n)]+\)/gu,`$1`).replace(/\[([^\]]+)\]\[[^\]]*\]/gu,`$1`).replace(/<(https?:\/\/[^>\s]+)>/gu,`$1`).replace(/<[^>]+>/gu,` `).replace(/^[ \t]{0,3}#{1,6}[ \t]+/gmu,``).replace(/^[ \t]*>+[ \t]?/gmu,``).replace(/^[ \t]*(?:[-+*]|\d+[.)])[ \t]+/gmu,``).replace(/^[ \t]*\[(?: |x|X)\][ \t]*/gmu,``).replace(/(`+)([^`]*?)\1/gu,`$2`).replace(/(\*\*|__)(?=\S)([\s\S]*?\S)\1/gu,`$2`).replace(/~~(?=\S)([\s\S]*?\S)~~/gu,`$1`).replace(/\*(?=\S)([^*\n]*?\S)\*/gu,`$1`).replace(/\\([\\`*{}[\]()#+.!_>-])/gu,`$1`).replace(/^[ \t]*\|(.+)\|[ \t]*$/gmu,(e,t)=>t.split(`|`).map(e=>e.trim()).filter(Boolean).join(` `)).replace(/\s+/gu,` `).trim(),n=Array.from(t);return n.length<=i9?t:`${n.slice(0,i9-1).join(``)}…`}function xoe(e){return boe(e.parts.filter(e=>e.type===`text`||e.type===`rich-text`).map(e=>e.text).join(` `))}var Soe=class{constructor(e){this.notificationManager=e,this.cleanups=[],this.handledMessageIds=new Set,this.visibleSessionIds=new Set,this.started=!1,this.start=()=>{this.started||(this.started=!0,this.cleanups.push(I.eventBus.on(c.ncpEvent,this.handleNcpEvent)))},this.stop=()=>{if(this.started)for(this.started=!1;this.cleanups.length>0;)this.cleanups.pop()?.()},this.syncVisibleSessions=e=>{this.visibleSessionIds=new Set(e.map(e=>e?.trim()).filter(e=>!!e))},this.handleNcpEvent=e=>{if(e.type!==gK.MessageCompleted)return;let{message:t}=e.payload,n=e.payload.sessionId.trim();if(!n||this.handledMessageIds.has(t.id)||t.role!==`assistant`||t.status!==`final`||lK(t)||(this.rememberHandledMessage(t.id),this.visibleSessionIds.has(n)))return;let r=this.resolveSessionSummary(n),i=CK(t.metadata);if(i&&i.actor!==`human`||!i&&r&&yoe(r.metadata))return;let a=r?nI(KI(r)):b(`chatBackgroundReplyFallbackTitle`),o=xoe(t);this.notificationManager.show({id:`chat-reply:${t.id}`,title:a,description:o||b(`chatBackgroundReplyFallbackPreview`),href:$7(n),ariaLabel:b(`chatBackgroundReplyOpenAriaLabel`).replace(`{title}`,a)})},this.resolveSessionSummary=e=>(eR.getState().snapshot.sessionsQuery?.data?.sessions??[]).find(t=>t.sessionId===e),this.rememberHandledMessage=e=>{if(this.handledMessageIds.add(e),this.handledMessageIds.size<=voe)return;let t=this.handledMessageIds.values().next().value;t&&this.handledMessageIds.delete(t)}}};function a9(){return Sn({queryKey:[`ncp-session-types`],queryFn:Et,staleTime:1e4,retry:!1})}var o9=`relative ml-auto flex min-h-[74px] w-[320px] max-w-[calc(100vw-2rem)] rounded-[20px] border border-border/80 bg-background text-left text-foreground shadow-[0_8px_18px_rgba(0,0,0,0.12),0_2px_5px_rgba(0,0,0,0.06)]`,s9=`flex min-h-[72px] min-w-0 flex-1 items-center gap-3 rounded-[inherit] py-3 pl-[18px] pr-[52px]`;function c9({title:e,description:t,iconSrc:n}){return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-border/80 bg-background p-[3px]`,children:(0,U.jsx)(`img`,{"aria-hidden":`true`,alt:``,src:n??`/logo.svg`,className:`h-full w-full object-contain`})}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`span`,{className:`block truncate text-[15px] font-semibold leading-5 tracking-[-0.01em]`,children:e}),t?(0,U.jsx)(`span`,{className:`mt-0.5 block truncate text-[14px] leading-5 text-muted-foreground`,children:t}):null]})]})}function l9({dismissLabel:e,onDismiss:t}){return(0,U.jsx)(V,{className:`absolute right-2.5 top-2.5 z-10`,icon:(0,U.jsx)(ki,{className:`h-4 w-4`,"aria-hidden":`true`}),label:e,onClick:t,size:`lg`,tooltipSide:`left`})}function Coe({title:e,description:t,href:n,iconSrc:r,ariaLabel:i,dismissLabel:a,onDismiss:o}){let s=i??[e,t].filter(Boolean).join(`: `);return n?(0,U.jsxs)(`div`,{className:o9,children:[(0,U.jsx)(ue,{to:n,"aria-label":s,className:`${s9} focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary/50`,onClick:o,children:(0,U.jsx)(c9,{title:e,description:t,iconSrc:r})}),(0,U.jsx)(l9,{dismissLabel:a,onDismiss:o})]}):(0,U.jsxs)(`div`,{className:o9,children:[(0,U.jsx)(`div`,{role:`status`,"aria-label":s,className:s9,children:(0,U.jsx)(c9,{title:e,description:t,iconSrc:r})}),(0,U.jsx)(l9,{dismissLabel:a,onDismiss:o})]})}var woe=8e3,Toe=class{constructor(){this.show=e=>L.custom(t=>(0,H.createElement)(Coe,{title:e.title,description:e.description,href:e.href,iconSrc:e.iconSrc,ariaLabel:e.ariaLabel,dismissLabel:e.dismissLabel??b(`notificationDismiss`),onDismiss:()=>{L.dismiss(t)}}),{id:e.id,duration:e.durationMs??woe,unstyled:!0}),this.dismiss=e=>{L.dismiss(e)}}},Eoe=`nextclaw://docs`,u9=`github-project`,Doe=`https://github.com/Peiiii/nextclaw`;function d9(){return[{builtIn:!0,icon:{type:`builtin`,name:`apps`},id:`apps`,label:b(`appsTitle`),removable:!1,target:{type:`right-panel-resource`,uri:J$}},{builtIn:!0,icon:{type:`builtin`,name:`docs`},id:`docs`,label:b(`docBrowserHelp`),removable:!1,target:{type:`right-panel-resource`,uri:Eoe}},{builtIn:!0,icon:{type:`builtin`,name:`new-tab`},id:`new-tab`,label:b(`docBrowserHomeTitle`),removable:!1,target:{type:`right-panel-resource`,uri:K$}},{builtIn:!0,icon:{type:`builtin`,name:`github`},id:u9,label:b(`sideDockGitHubProject`),removable:!1,target:{type:`external-url`,url:Doe}}]}var Ooe=[`apps`,`docs`,`github`,`new-tab`,`panel-app`,`service-apps`];function f9(e){return!!e&&typeof e==`object`}function koe(e){return Ooe.includes(e)}function Aoe(e){return!f9(e)||typeof e.type!=`string`?null:e.type===`builtin`&&koe(e.name)?{type:`builtin`,name:e.name}:e.type===`url`&&typeof e.url==`string`&&e.url.trim().length>0?{type:`url`,url:e.url.trim()}:e.type===`text`&&typeof e.value==`string`&&e.value.trim().length>0?{type:`text`,value:e.value.trim()}:null}function joe(e){if(!f9(e)||typeof e.id!=`string`||e.id.trim().length===0||typeof e.label!=`string`||e.label.trim().length===0||typeof e.createdAt!=`string`||e.createdAt.trim().length===0||!f9(e.target)||e.target.type!==`right-panel-resource`||typeof e.target.uri!=`string`||e.target.uri.trim().length===0)return null;let t=Aoe(e.icon);return t?{createdAt:e.createdAt,icon:t,id:e.id.trim(),label:e.label.trim(),target:{type:`right-panel-resource`,uri:e.target.uri.trim()}}:null}function p9(e){if(!Array.isArray(e))return[];let t=new Map;return e.forEach(e=>{let n=joe(e);n&&t.set(n.id,n)}),Array.from(t.values())}function Moe(e,t){return{createdAt:t,icon:e.icon,id:e.id,label:e.label,target:e.target}}function Noe(e){return e.target.type===`right-panel-resource`?e.target.uri:null}function Poe(e){return{builtIn:!1,icon:e.icon,id:e.id,label:e.label,removable:!0,target:e.target}}function m9(e,t){let n=new Set(e.map(e=>e.id)),r=new Set(e.map(Noe).filter(e=>e!==null)),i=t.filter(e=>!n.has(e.id)&&!r.has(e.target.uri)).map(Poe);return[...e,...i]}var Foe=`nextclaw.side-dock.state`,Ioe=1;function h9(e){return!!e&&typeof e==`object`}var g9=P()(ji(e=>({isVisible:!0,pinnedItems:[],setVisible:t=>e({isVisible:t}),setPinnedItems:t=>e({pinnedItems:p9(t)})}),{name:Foe,version:Ioe,storage:Mi(()=>window.localStorage),partialize:e=>({isVisible:e.isVisible,pinnedItems:e.pinnedItems}),merge:(e,t)=>{let n=h9(e)?p9(e.pinnedItems):[],r=h9(e)&&typeof e.isVisible==`boolean`?e.isVisible:!0;return{...t,isVisible:r,pinnedItems:n}}})),Loe={apps:Zr,docs:Ti,github:ti,"new-tab":Di,"panel-app":di,"service-apps":di},Roe=new Set([u9]),zoe=/^\p{Extended_Pictographic}(?:\uFE0F|\uFE0E)?(?:\u200D\p{Extended_Pictographic}(?:\uFE0F|\uFE0E)?)*$/u;function Boe(e){return zoe.test(e.trim())}function Voe({icon:e}){if(e.type===`url`)return(0,U.jsx)(`img`,{src:e.url,alt:``,className:`h-5 w-5 rounded object-cover`});if(e.type===`text`)return Boe(e.value)?(0,U.jsx)(`span`,{className:`flex h-7 w-7 items-center justify-center text-[20px] leading-none`,"aria-hidden":`true`,children:e.value}):(0,U.jsx)(`span`,{className:`max-w-7 truncate text-center text-[13px] font-semibold leading-none`,"aria-hidden":`true`,children:e.value});let t=Loe[e.name];return(0,U.jsx)(t,{className:`h-5 w-5`,"aria-hidden":`true`})}function _9({active:e,item:t,onOpen:n,onUnpin:r}){let{label:i}=t;return(0,U.jsxs)(pi,{children:[(0,U.jsxs)(`div`,{className:`group relative`,children:[(0,U.jsx)(ni,{asChild:!0,children:(0,U.jsx)(`button`,{type:`button`,"aria-label":i,title:i,"data-side-dock-item-id":t.id,onClick:()=>n(t),className:u(`flex h-10 w-10 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors`,`hover:bg-primary/10 hover:text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,e?`bg-primary/10 text-primary`:`bg-transparent`),children:(0,U.jsx)(Voe,{icon:t.icon})})}),t.removable?(0,U.jsx)(`button`,{type:`button`,"aria-label":b(`sideDockUnpinItem`),title:b(`sideDockUnpinItem`),onClick:e=>{e.stopPropagation(),r(t)},className:`absolute -right-1 -top-1 hidden h-4 w-4 items-center justify-center rounded-full bg-background text-muted-foreground shadow-sm ring-1 ring-border/70 transition-colors hover:bg-muted hover:text-foreground group-hover:flex focus-visible:flex focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:(0,U.jsx)(ki,{className:`h-3 w-3`,"aria-hidden":`true`})}):null]}),(0,U.jsx)(li,{side:`left`,children:i})]})}function Hoe({icon:e,label:t,onClick:n}){return(0,U.jsxs)(pi,{children:[(0,U.jsx)(ni,{asChild:!0,children:(0,U.jsx)(`button`,{type:`button`,"aria-label":t,title:t,"data-side-dock-action":`hide`,onClick:n,className:u(`flex h-10 w-10 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors`,`hover:bg-primary/10 hover:text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`),children:(0,U.jsx)(e,{className:`h-5 w-5`,"aria-hidden":`true`})})}),(0,U.jsx)(li,{side:`left`,children:t})]})}function v9(e){return e?.trim()??``}function y9(e){return e.target.type===`right-panel-resource`?e.target.uri:null}function b9(e,t,n,r=!1){if(!t||!n)return!1;let i=v9(y9(e)??void 0);if(!i)return!1;let a=v9(n.resourceUri);return a&&a===i||v9(n.currentUrl)===i?!0:r?!1:e.id===`docs`&&n.kind===`docs`}function Uoe(e,t){if(!t)return!1;let n=v9(t.resourceUri),r=v9(t.currentUrl);return e.some(e=>{let t=v9(y9(e)??void 0);return t===n||t===r})}function x9(e){return Roe.has(e.id)}function Woe({manager:e}){let t=g9(e=>e.pinnedItems),n=g9(e=>e.setVisible),{currentTab:r,isOpen:i}=Hi(),{confirm:a,ConfirmDialog:o}=On(),s=m9(d9(),t),c=s.filter(e=>!x9(e)),l=s.filter(x9),u=Uoe(s,r),d=async()=>{await a({title:b(`sideDockHideConfirmTitle`),description:b(`sideDockHideConfirmDescription`),confirmLabel:b(`sideDockHideConfirmAction`),cancelLabel:b(`cancel`)})&&n(!1)};return(0,U.jsx)(ci,{delayDuration:250,children:(0,U.jsxs)(`aside`,{"data-testid":`side-dock`,"data-theme-surface":`utility-rail`,className:`z-30 flex h-full w-14 shrink-0 flex-col items-center gap-1 border-l border-border/60 bg-background/95 px-2 py-3`,children:[(0,U.jsx)(`div`,{className:`flex w-full flex-col items-center gap-1`,children:c.map(t=>(0,U.jsx)(_9,{active:b9(t,i,r,u),item:t,onOpen:e.openItem,onUnpin:t=>e.unpinItem(t.id)},t.id))}),l.length>0?(0,U.jsxs)(`div`,{"data-testid":`side-dock-utility`,className:`mt-auto flex w-full flex-col items-center gap-1`,children:[l.map(t=>(0,U.jsx)(_9,{active:b9(t,i,r,u),item:t,onOpen:e.openItem,onUnpin:t=>e.unpinItem(t.id)},t.id)),(0,U.jsx)(Hoe,{icon:Ro,label:b(`sideDockHide`),onClick:()=>{d()}})]}):null,(0,U.jsx)(o,{})]})})}var Goe=`pinned`,Koe=new Set([`apps`,`docs`,`github`,`new-tab`,`panel-app`,`service-apps`]);function S9(e){return e.trim()}function qoe(e){let t=0;return Array.from(S9(e)).forEach(e=>{t=t*31+e.charCodeAt(0)>>>0}),`${Goe}-${S9(e).replace(/[^a-zA-Z0-9]+/g,`-`).replace(/^-+|-+$/g,``).toLowerCase()||`resource`}-${t.toString(36)}`}function Joe(e){return e?.type===`builtin`&&Koe.has(e.name)?{type:`builtin`,name:e.name}:e?.type===`url`&&e.url.trim().length>0?{type:`url`,url:e.url.trim()}:e?.type===`text`&&e.value.trim().length>0?{type:`text`,value:e.value.trim()}:null}function Yoe(e){return e.kind===`docs`?`docs`:e.kind===`home`?`new-tab`:e.kind===`apps`?e.resourceUri?.includes(`service-apps`)?`service-apps`:`apps`:e.kind===`panel-app`?`panel-app`:`apps`}var Xoe=class{constructor(e){this.docBrowserManager=e,this.getItems=()=>m9(d9(),g9.getState().pinnedItems),this.openItem=async e=>{if(e.target.type===`right-panel-resource`){this.docBrowserManager.open(e.target.uri,{dockIcon:e.icon,title:e.label});return}e.target.type===`external-url`&&await Ai.openExternalUrl(e.target.url)},this.getDockState=e=>{let t=this.getTabResourceUri(e);if(!t)return{canDock:!1,isDocked:!1,removable:!1};let n=this.findItemByUri(t);return{canDock:!0,isDocked:!!n,removable:n?.removable===!0}},this.pinTab=(e,t=new Date().toISOString())=>{let n=this.getTabResourceUri(e);!e||!n||this.findItemByUri(n)||this.pinItem({builtIn:!1,icon:Joe(e.dockIcon)??{type:`builtin`,name:Yoe(e)},id:qoe(n),label:e.title.trim()||n,removable:!0,target:{type:`right-panel-resource`,uri:n}},t)},this.unpinTab=e=>{let t=this.getTabResourceUri(e),n=t?this.findItemByUri(t):void 0;n?.removable&&this.unpinItem(n.id)},this.pinItem=(e,t=new Date().toISOString())=>{if(!e.removable||e.target.type!==`right-panel-resource`)return;let n=S9(e.target.uri),r={...e,target:{type:`right-panel-resource`,uri:n}};this.setPinnedItems(i=>i.some(t=>t.id===e.id||S9(t.target.uri)===n)?i:[...i,Moe(r,t)])},this.unpinItem=e=>{this.setPinnedItems(t=>t.filter(t=>t.id!==e))},this.reorderPinnedItems=e=>{this.setPinnedItems(t=>{let n=new Map(t.map(e=>[e.id,e])),r=e.map(e=>n.get(e)).filter(e=>e!==void 0),i=new Set(r.map(e=>e.id)),a=t.filter(e=>!i.has(e.id));return[...r,...a]})},this.setPinnedItems=e=>{let{pinnedItems:t,setPinnedItems:n}=g9.getState();n(e(t))},this.getTabResourceUri=e=>{let t=e?.resourceUri??e?.currentUrl,n=t?S9(t):``;return n.length>0?n:null},this.findItemByUri=e=>{let t=S9(e);return this.getItems().find(e=>e.target.type===`right-panel-resource`&&S9(e.target.uri)===t)}}},Zoe=new class{constructor(){this.resolveOpenTarget=e=>{let{activeTab:t,kind:n,url:r}=e,i=n??(r?void 0:t?.kind)??(r&&Ri(r)?`docs`:`home`),a=r?.trim()||(!n&&t&&t.kind!==`docs`?t.currentUrl:i===`home`?`nextclaw://new-tab`:i===`docs`?Wi():`about:blank`),o=i===`docs`?Yi(a,`docs`):a;return{historyPolicy:`managed`,kind:i,title:i===`home`?b(`docBrowserHomeTitle`):zi(o,i,i===`docs`?b(`docBrowserHelp`):`Detail`),url:o}},this.areUrlsEquivalent=(e,t,n,r)=>n===r?n===`docs`?Pi(e)===Pi(t):e===t:!1,this.usesManagedHistory=e=>e.currentUrl!==Ji}};function C9(e,t,n){return{...e,tabs:e.tabs.map(e=>e.id===t?n(e):e)}}function w9(e,t){return C9(e,e.activeTabId,t)}function Qoe(e,t,n){let r=t.resourceUri??t.url,i=n.resourceUri??n.url;return t.tabId===n.tabId&&t.kind===n.kind&&e.areUrlsEquivalent(r,i,t.kind,n.kind)}function T9(e,t){return{kind:t.kind,resourceUri:t.resourceUri??t.url,tabId:e,url:t.url}}function E9(e,t,n){let r=oi({entries:t.activeHistory,index:t.activeHistoryIndex},n,(t,n)=>Qoe(e,t,n));return{...t,activeHistory:[...r.entries],activeHistoryIndex:r.index}}function $oe(e,t,n){for(let r=t.history.length-1;r>=0;--r)if(e.areUrlsEquivalent(t.history[r],n,t.kind,t.kind))return r;return-1}function D9(e,t,n){let r=t.tabs.find(e=>e.id===n.tabId);if(!r)return t;let i=n.resourceUri??n.url,a=e.resolveOpenTarget({activeTab:r,kind:n.kind,url:i}),o=$oe(e,r,a.url),s=n.resourceUri!==void 0&&n.resourceUri===r.resourceUri;return C9({...t,activeTabId:r.id,isOpen:!0},r.id,e=>({...e,currentUrl:a.url,dedupeKey:a.dedupeKey,dockIcon:a.dockIcon??e.dockIcon,historyIndex:o>=0?o:e.historyIndex,kind:a.kind,resourceUri:a.resourceUri??a.url,title:s?e.title:a.title}))}function ese(e,t){return!e.isOpen&&e.tabs.length===1&&t?.kind===`home`&&t.currentUrl===`nextclaw://new-tab`}function O9(e,t,n,r){let{activate:i,dedupeKey:a,newTab:o,title:s}=r??{},c=a?.trim()||n.dedupeKey,l=t.tabs.find(e=>e.id===t.activeTabId)??t.tabs[0],u=c?t.tabs.find(e=>e.dedupeKey===c):void 0;if(u){let a=C9(t,u.id,t=>Vi(e,t,n,r,c)),o=i!==!1,s=o?u.id:t.activeTabId,l={...a,activeTabId:s,isOpen:!0};return o||u.id===t.activeTabId?E9(e,l,T9(u.id,n)):l}if(o||c||!l||l.kind!==n.kind){let i=Ki(n.url,n.kind,s??n.title,c,n.resourceUri??n.url,r?.dockIcon??n.dockIcon,n.contentParams);return ese(t,l)?{...t,isOpen:!0,tabs:[i],activeTabId:i.id,activeHistory:[Ui(i)],activeHistoryIndex:0}:E9(e,{...t,isOpen:!0,tabs:[...t.tabs,i],activeTabId:i.id},Ui(i))}return E9(e,{...w9(t,t=>Vi(e,t,n,r,c)),isOpen:!0},T9(t.activeTabId,n))}function tse(e,t,n,r){let i=t.tabs.find(e=>e.id===t.activeTabId)??t.tabs[0];return O9(e,t,{...e.resolveOpenTarget({activeTab:i,kind:r?.kind,url:n}),contentParams:r?.contentParams},r)}var nse=class{constructor(e=Zoe,t){this.routeResolver=e,this.onRightPanelOpened=t,this.setSnapshot=e=>{Gi.getState().setSnapshot(e)},this.open=(e,t)=>{this.setSnapshot(n=>tse(this.routeResolver,n,e,t)),this.onRightPanelOpened?.()},this.openTarget=(e,t)=>{this.setSnapshot(n=>O9(this.routeResolver,n,e,{...t,dedupeKey:t?.dedupeKey??e.dedupeKey,kind:t?.kind??e.kind,title:t?.title??e.title})),this.onRightPanelOpened?.()},this.reloadByDedupeKeys=e=>{let t=new Set(e);t.size!==0&&this.setSnapshot(e=>({...e,tabs:e.tabs.map(e=>t.has(e.dedupeKey??``)?{...e,navVersion:e.navVersion+1}:e)}))},this.openNewTab=()=>{this.open(void 0,{kind:Li,newTab:!0})},this.close=()=>{this.setSnapshot(e=>({...e,isOpen:!1}))},this.toggleMode=()=>{this.setSnapshot(e=>({...e,mode:e.mode===`floating`?`docked`:`floating`})),this.onRightPanelOpened?.()},this.setDockedWidth=e=>{this.setSnapshot(t=>({...t,dockedWidth:Ii(e)}))},this.navigate=e=>{this.setSnapshot(t=>{if(!t.tabs.length){let e=Ki(Wi(),`docs`,`Docs`);return{...t,tabs:[e],activeTabId:e.id,isOpen:!0}}let n=w9(t,t=>{if(!this.routeResolver.usesManagedHistory(t))return t;let n=this.routeResolver.resolveOpenTarget({activeTab:t,url:e});return this.routeResolver.areUrlsEquivalent(t.currentUrl,n.url,t.kind,n.kind)?t:{...t,currentUrl:n.url,dedupeKey:n.dedupeKey,dockIcon:n.dockIcon,...Bi(t,n.url),kind:n.kind,navVersion:t.navVersion+1,resourceUri:n.resourceUri??n.url,title:n.title}}),r=n.tabs.find(e=>e.id===n.activeTabId);return r?E9(this.routeResolver,n,Ui(r)):n})},this.syncUrl=e=>{this.setSnapshot(t=>{if(!t.tabs.length){let e=Ki(Wi(),`docs`,`Docs`);return{...t,tabs:[e],activeTabId:e.id}}let n=w9(t,t=>{if(!this.routeResolver.usesManagedHistory(t))return t;let n=this.routeResolver.resolveOpenTarget({activeTab:t,kind:t.kind,url:e});return this.routeResolver.areUrlsEquivalent(t.currentUrl,n.url,t.kind,n.kind)?t:{...t,currentUrl:n.url,dedupeKey:n.dedupeKey,dockIcon:n.dockIcon,...Bi(t,n.url),kind:n.kind,resourceUri:n.resourceUri??n.url,title:n.title}}),r=n.tabs.find(e=>e.id===n.activeTabId);return r?E9(this.routeResolver,n,Ui(r)):n})},this.goBack=()=>{this.setSnapshot(e=>{let t=si({entries:e.activeHistory,index:e.activeHistoryIndex},`back`);return t?D9(this.routeResolver,{...e,activeHistory:[...t.history.entries],activeHistoryIndex:t.history.index},t.entry):e})},this.goForward=()=>{this.setSnapshot(e=>{let t=si({entries:e.activeHistory,index:e.activeHistoryIndex},`forward`);return t?D9(this.routeResolver,{...e,activeHistory:[...t.history.entries],activeHistoryIndex:t.history.index},t.entry):e})},this.closeTab=e=>{this.setSnapshot(t=>{if(t.tabs.length<=1)return{...Fi(),isOpen:!1};let n=t.tabs.findIndex(t=>t.id===e);if(n<0)return t;let r=t.tabs.filter(t=>t.id!==e),i=t.activeTabId===e?r[Math.max(0,n-1)]?.id??r[0].id:t.activeTabId,a={...t,tabs:r,activeTabId:i},o=r.find(e=>e.id===i)??r[0],s=vi({entries:a.activeHistory,index:a.activeHistoryIndex},t=>t.tabId!==e,Ui(o)),c={...a,activeHistory:[...s.entries],activeHistoryIndex:s.index};return t.activeTabId===e?E9(this.routeResolver,c,Ui(o)):c})},this.setActiveTab=e=>{this.setSnapshot(t=>{if(!t.tabs.some(t=>t.id===e))return t;let n=t.tabs.find(t=>t.id===e);return n?E9(this.routeResolver,{...t,activeTabId:e,isOpen:!0},Ui(n)):t})}}};function rse(e){return e.activeWorkspacePanelKind!=null}var ise=class{constructor(){this.notificationManager=new Toe,this.inboxManager=new uae,this.chatCompletionNotificationManager=new Soe(this.notificationManager),this.accountManager=new $s,this.rightPanelResourceRouteResolver=new O1,this.notifyRightPanelOpened=()=>{let e=Gi.getState().snapshot,t=$.getState().snapshot;oc.collapseSidebarForDenseRightPanels({isDocBrowserDocked:e.mode===`docked`,isDocBrowserOpen:e.isOpen,isWorkspacePanelOpen:rse(t)})},this.docBrowserManager=new nse(this.rightPanelResourceRouteResolver,this.notifyRightPanelOpened),this.appPackageOperationSettlementManager=new B$(this.docBrowserManager),this.sideDockManager=new Xoe(this.docBrowserManager),this.chatComposerIntentManager=new _oe,this.chatDraftIntentManager=new goe,this.serviceActionAuthorizationManager=new h$,this.panelAppBridgeManager=new V1(this.serviceActionAuthorizationManager),this.remoteAccessManager=new Fs({accountManager:this.accountManager})}},k9=null;function A9(){return k9??=new ise,k9}function j9(){return A9()}var M9=globalThis,N9=M9.__NEXTCLAW_APP_PRESENTER_CONTEXT__??(0,H.createContext)(null);M9.__NEXTCLAW_APP_PRESENTER_CONTEXT__=N9;function ase({children:e}){let t=(0,H.useMemo)(()=>A9(),[]);return(0,U.jsx)(N9.Provider,{value:t,children:e})}function P9(){let e=(0,H.useContext)(N9);if(!e)throw Error(`useAppPresenter must be used inside AppPresenterProvider`);return e}function ose(){let e=P9();return(0,H.useEffect)(()=>(e.chatCompletionNotificationManager.start(),()=>{e.chatCompletionNotificationManager.stop()}),[e.chatCompletionNotificationManager]),null}var sse=`NextClaw`,cse=[{prefix:`/marketplace/mcp`,key:`marketplaceMcpPageTitle`},{prefix:`/marketplace/skills`,key:`marketplaceSkillsPageTitle`},{prefix:`/marketplace`,key:`marketplace`},{prefix:`/skills`,key:`marketplaceSkillsPageTitle`},{prefix:`/cron`,key:`cronPageTitle`},{prefix:`/agents`,key:`agentsPageTitle`},{prefix:`/chat`,key:`chat`},{prefix:`/model`,key:`modelPageTitle`},{prefix:`/search`,key:`searchPageTitle`},{prefix:`/providers`,key:`providersPageTitle`},{prefix:`/channels`,key:`channelsPageTitle`},{prefix:`/runtime`,key:`runtimePageTitle`},{prefix:`/updates`,key:`runtimeUpdatesPageTitle`},{prefix:`/remote`,key:`remotePageTitle`},{prefix:`/security`,key:`authSecurityTitle`},{prefix:`/secrets`,key:`secretsPageTitle`}];function lse(e,t){return e===t||e.startsWith(`${t}/`)}function use(e){let t=e.toLowerCase();for(let{prefix:e,key:n}of cse)if(lse(t,e))return b(n);return b(`settings`)}function dse(e){let t=e.toLowerCase();return t===`localhost`||t.endsWith(`.localhost`)||t===`::1`||t===`[::1]`||t.startsWith(`127.`)}function fse(e){let t=e?.host.trim(),n=e?.hostname.trim(),r=e?.port.trim();return!t||!n?null:dse(n)?r||null:t}function pse(e,t){let n=fse(t);return`${sse}${n?` ${n}`:``} - ${use(e)}`}var F9={...R1,...see};function mse({children:e,sideDockManager:t}){let{isOpen:n,mode:r}=Hi();iee();let{pathname:i}=_e(),a=ce(),o=j9(),{language:s}=Wn(),{isMobile:c}=k8(),l=W7(),u=g9(e=>e.isVisible);g9(e=>e.pinnedItems);let d={getDockState:t.getDockState,pinTab:t.pinTab,unpinTab:t.unpinTab},f=(0,H.useCallback)(e=>{let t=$$(e);if(t)return[{key:`chat`,items:[{key:`add-to-chat`,icon:(0,U.jsx)(xo,{className:`h-4 w-4`}),label:b(`docBrowserAddToChat`),restoreFocus:!1,onSelect:()=>{let e=i===`/chat`||i.startsWith(`/chat/`),n=i===`/chat`?null:Q7(i.slice(6));o.chatComposerIntentManager.requestUiResourceReference({targetSessionKey:e?n:null,reference:t}),e||a(Z7)}}]}]},[a,i,o]);return(0,H.useEffect)(()=>{document.title=pse(i,window.location)},[i,s]),c&&l!==`win32`?(0,U.jsx)(Uae,{pathname:i,isDocBrowserOpen:n,docBrowserDockControls:d,docBrowserRenderers:F9,docBrowserTabMenuGroups:f,topbarLeadingInset:l===`darwin`?`4.75rem`:void 0,children:e}):(0,U.jsx)(Kae,{pathname:i,isMobileLayout:c,isDocBrowserOpen:n,docBrowserMode:r,docBrowserDockControls:d,docBrowserRenderers:F9,docBrowserTabMenuGroups:f,sideDock:u?(0,U.jsx)(Woe,{manager:t}):null,children:e})}function hse({children:e}){let t=j9();return(0,U.jsx)(qi,{manager:t.docBrowserManager,children:(0,U.jsx)(mse,{sideDockManager:t.sideDockManager,children:e})})}function gse(){let{isMobile:e}=k8();return e?(0,U.jsx)(Wae,{}):(0,U.jsx)(he,{to:`/model`,replace:!0})}var I9=new Intl.NumberFormat;function _se({agent:e,defaults:t,runtimeOptions:n,defaultRuntime:r,defaultRuntimeLabel:i,onOpenChange:a,onEdit:o}){if(!e)return null;let s=L9(e.model,t?.model),c=vse({agent:e,defaults:t,runtimeOptions:n,defaultRuntime:r,defaultRuntimeLabel:i}),l=R9(e.contextTokens,t?.contextTokens??2e5),u=R9(e.reservedContextTokens,t?.reservedContextTokens),d=L9(e.thinkingDefault,t?.thinkingDefault??`off`),f=B9(e.runtimeConfig??e.engineConfig,t?.engineConfig),p=B9(e.models,t?.models);return(0,U.jsx)(Ur,{open:e!==null,onOpenChange:a,children:(0,U.jsxs)(Kr,{className:`flex max-h-[calc(100vh-2rem)] flex-col overflow-hidden border-none bg-popover p-0 sm:max-h-[720px] sm:max-w-2xl`,children:[(0,U.jsx)(`div`,{className:`shrink-0 px-5 pb-3 pt-5`,children:(0,U.jsx)(Wr,{className:`text-left`,children:(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,U.jsx)(az,{agentId:e.id,displayName:e.displayName,avatarUrl:e.avatarUrl,className:`h-10 w-10 shrink-0`}),(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(qr,{className:`truncate text-base`,children:e.displayName?.trim()||e.id}),(0,U.jsxs)(Br,{className:`truncate text-xs`,children:[`@`,e.id]})]})]})})}),(0,U.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto overscroll-contain px-5 py-3`,children:[(0,U.jsxs)(H9,{icon:oa,title:b(`agentsDetailsIdentitySection`),children:[(0,U.jsx)(U9,{label:b(`agentsDetailsFieldDisplayName`),value:e.displayName?.trim()||e.id}),(0,U.jsx)(U9,{label:b(`agentsDetailsFieldId`),value:e.id,mono:!0}),(0,U.jsx)(U9,{label:b(`agentsDetailsFieldDescription`),value:e.description?.trim()||b(`agentsDetailsEmptyValue`),wide:!0}),(0,U.jsx)(U9,{label:b(`agentsDetailsFieldWorkspace`),value:e.workspace??b(`agentsDetailsUnsetValue`),mono:!0,wide:!0})]}),(0,U.jsxs)(H9,{icon:Fr,title:b(`agentsDetailsRuntimeSection`),children:[(0,U.jsx)(U9,{label:b(`agentsDetailsFieldModel`),value:s.value,source:s.source}),(0,U.jsx)(U9,{label:b(`agentsDetailsFieldRuntime`),value:c.value,source:c.source}),(0,U.jsx)(U9,{label:b(`agentsDetailsFieldRuntimeConfig`),value:f.value,source:f.source,mono:!0,prewrap:!0})]}),(0,U.jsxs)(H9,{icon:Za,title:b(`agentsDetailsContextSection`),children:[(0,U.jsx)(U9,{label:b(`agentsDetailsFieldContextTokens`),value:l.value,source:l.source}),(0,U.jsx)(U9,{label:b(`agentsDetailsFieldReservedContextTokens`),value:u.value,source:u.source})]}),(0,U.jsxs)(H9,{icon:ca,title:b(`agentsDetailsBehaviorSection`),children:[(0,U.jsx)(U9,{label:b(`agentsDetailsFieldThinkingDefault`),value:d.value,source:d.source}),(0,U.jsx)(U9,{label:b(`agentsDetailsFieldModelOverrides`),value:p.value,source:p.source,mono:!0,prewrap:!0}),(0,U.jsx)(U9,{label:b(`agentsDetailsFieldAvatar`),value:e.avatar??b(`agentsDetailsUnsetValue`),mono:!0})]})]}),(0,U.jsxs)(Pr,{className:`shrink-0 px-5 pb-4 pt-2`,children:[(0,U.jsx)(R,{type:`button`,variant:`ghost`,onClick:()=>a(!1),children:b(`cancel`)}),(0,U.jsxs)(R,{type:`button`,variant:`primary`,className:`px-4`,onClick:()=>o(e),children:[(0,U.jsx)(Ho,{className:`mr-2 h-4 w-4`}),b(`agentsDetailsEditAction`)]})]})]})})}function L9(e,t){let n=e?.trim();return n?{value:n,source:`override`}:{value:t?.trim()||b(`agentsDetailsUnsetValue`),source:`default`}}function R9(e,t){return typeof e==`number`?{value:I9.format(e),source:`override`}:{value:typeof t==`number`?I9.format(t):b(`agentsDetailsUnsetValue`),source:`default`}}function vse(e){let{agent:t,defaults:n,runtimeOptions:r,defaultRuntime:i,defaultRuntimeLabel:a}=e,o=t.runtime?.trim()||t.engine?.trim();if(o)return{value:z9(o,r,a),source:`override`};let s=n?.engine?.trim()||i;return{value:s?z9(s,r,a):a,source:`default`}}function z9(e,t,n){let r=EL(e);return r?t.find(e=>e.value===r)?.label??OL(r):n}function B9(e,t){return V9(e)?{value:JSON.stringify(e,null,2),source:`override`}:{value:V9(t)?JSON.stringify(t,null,2):b(`agentsDetailsUnsetValue`),source:`default`}}function V9(e){return!!(e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length>0)}function H9(e){let{icon:t,title:n,children:r}=e;return(0,U.jsxs)(`section`,{className:`space-y-2 border-t border-border/60 pt-3 first:border-t-0 first:pt-0`,children:[(0,U.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-xs font-semibold leading-5 text-foreground`,children:[(0,U.jsx)(t,{className:`h-3.5 w-3.5 text-muted-foreground`}),n]}),(0,U.jsx)(`dl`,{className:`grid min-w-0 gap-x-6 gap-y-2.5 pl-5 sm:grid-cols-2`,children:r})]})}function U9(e){let{label:t,value:n,source:r,mono:i=!1,prewrap:a=!1,wide:o=!1}=e,s=a&&n.trim().startsWith(`{`),c=i&&(!a||s);return(0,U.jsxs)(`div`,{className:u(`grid min-w-0 grid-cols-[10rem_minmax(0,1fr)] items-baseline gap-x-2`,(o||s)&&`sm:col-span-2`),children:[(0,U.jsx)(`dt`,{className:`flex min-w-0 items-baseline leading-5`,children:(0,U.jsx)(`span`,{className:`whitespace-nowrap text-xs font-medium text-muted-foreground`,children:t})}),(0,U.jsxs)(`dd`,{className:u(`min-w-0 break-words text-xs leading-5 text-foreground`,s?`max-h-28 overflow-auto whitespace-pre-wrap rounded bg-muted/50 px-2 py-1.5 text-left`:``),children:[(0,U.jsx)(`span`,{className:c?`font-mono`:void 0,children:n}),r?(0,U.jsx)(yse,{source:r}):null]})]})}function yse({source:e}){return(0,U.jsxs)(`span`,{className:u(`ml-1 whitespace-nowrap text-xs font-normal leading-5`,e===`override`?`text-blue-500`:`text-muted-foreground`),children:[`(`,b(e===`override`?`agentsDetailsAgentOverride`:`agentsDetailsInheritedDefault`),`)`]})}function bse({form:e,disabled:t=!1,onChange:n}){return(0,U.jsxs)(`details`,{className:`group rounded-2xl border border-border bg-card`,children:[(0,U.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-3 text-sm font-semibold text-foreground [&::-webkit-details-marker]:hidden`,children:[(0,U.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,U.jsx)(Xo,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,U.jsx)(`span`,{className:`truncate`,children:b(`agentsAdvancedConfigToggle`)})]}),(0,U.jsx)(ar,{className:`h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180`})]}),(0,U.jsxs)(`div`,{className:`space-y-4 border-t border-border/60 px-4 py-4`,children:[(0,U.jsx)(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:b(`agentsAdvancedConfigDescription`)}),(0,U.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:(0,U.jsx)(xse,{label:b(`agentsAdvancedContextTokensLabel`),value:e.contextTokens,min:1e3,step:1e3,disabled:t,onChange:e=>n({contextTokens:e})})})]})]})}function xse(e){let{label:t,value:n,min:r,step:i,disabled:a,onChange:o}=e;return(0,U.jsxs)(`label`,{className:`space-y-2 text-sm font-medium text-foreground`,children:[(0,U.jsx)(`span`,{children:t}),(0,U.jsx)(St,{type:`number`,min:r,step:i,value:n,disabled:a,placeholder:b(`agentsAdvancedInheritPlaceholder`),"aria-label":t,onChange:e=>o(e.target.value)})]})}function Sse(e){return{displayName:e.displayName??``,description:e.description??``,avatar:e.avatar??``,model:e.model??``,runtime:e.runtime??e.engine??``,contextTokens:Cse(e.contextTokens)}}function Cse(e){return typeof e==`number`?String(e):``}var wse=xF(`15rem`);function Tse(e){return[...new Set(e.map(e=>e.trim()).filter(Boolean))]}function Ese({id:e,value:t,onChange:n,options:r,disabled:i=!1,placeholder:a,className:o,inputClassName:s,emptyText:c,createText:l,toggleLabel:d,maxItems:f=1/0,onEnter:p}){let[m,h]=(0,H.useState)(!1),g=(0,H.useRef)(null);(0,H.useEffect)(()=>{i&&m&&h(!1)},[i,m]);let _=(0,H.useMemo)(()=>Tse(r),[r]),v=t.trim().toLowerCase(),y=(0,H.useMemo)(()=>{let e=_.map((e,t)=>({option:e,index:t}));v.length>0&&e.sort((e,t)=>{let n=e.option.toLowerCase(),r=t.option.toLowerCase(),i=n===v?0:n.startsWith(v)?1:n.includes(v)?2:3,a=r===v?0:r.startsWith(v)?1:r.includes(v)?2:3;return i===a?e.index-t.index:i-a});let t=e.map(e=>e.option);return Number.isFinite(f)?t.slice(0,Math.max(1,f)):t},[_,v,f]),b=t.trim().length>0&&_.some(e=>e===t.trim()),x=()=>h(!1);return(0,U.jsxs)(CF,{open:m&&!i,onOpenChange:e=>h(!i&&e),children:[(0,U.jsx)(TF,{asChild:!0,children:(0,U.jsxs)(`div`,{ref:g,className:u(`relative`,o),children:[(0,U.jsx)(St,{id:e,value:t,disabled:i,onFocus:()=>{i||h(!0)},onChange:e=>{n(e.target.value),!m&&!i&&h(!0)},onKeyDown:e=>{e.key===`Enter`&&(p&&(e.preventDefault(),p()),x())},placeholder:a,className:u(`pr-10`,s)}),(0,U.jsx)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>h(e=>!e),disabled:i,className:u(`absolute inset-y-0 right-0 inline-flex w-10 items-center justify-center`,i?`cursor-not-allowed text-gray-300`:`text-gray-400 hover:text-gray-600`),"aria-label":d,children:(0,U.jsx)(vee,{className:`h-4 w-4`})})]})}),(0,U.jsx)(EF,{align:`start`,className:`flex w-[var(--radix-popover-trigger-width)] min-w-[12rem] flex-col overflow-hidden rounded-xl border border-gray-200 p-0 shadow-lg`,onInteractOutside:e=>{e.target instanceof Node&&g.current?.contains(e.target)&&e.preventDefault()},onOpenAutoFocus:e=>e.preventDefault(),style:{maxHeight:wse},children:(0,U.jsxs)(`div`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto py-1`,children:[!b&&t.trim().length>0&&(0,U.jsxs)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>{n(t.trim()),x()},className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-gray-50`,children:[(0,U.jsx)(Ar,{className:`h-4 w-4 text-transparent`}),(0,U.jsx)(`span`,{className:`truncate text-gray-700`,children:l.replace(`{value}`,t.trim())})]}),y.map(e=>(0,U.jsxs)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>{n(e),x()},className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-gray-50`,children:[(0,U.jsx)(Ar,{className:u(`h-4 w-4`,e===t.trim()?`text-primary`:`text-transparent`)}),(0,U.jsx)(`span`,{className:`truncate text-gray-700`,children:e})]},e)),y.length===0&&t.trim().length===0&&(0,U.jsx)(`div`,{className:`px-3 py-2 text-sm text-gray-500`,children:c})]})})]})}var Dse=`provider/model`;function W9(e){let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return[...t]}function G9({id:e,value:t,onChange:n,providerCatalog:r,disabled:i=!1,providerPlaceholder:a,modelPlaceholder:o,className:s}){let[c,l]=(0,H.useState)(``),[u,d]=(0,H.useState)(``),f=r.length>0,p=o??Dse,m=(0,H.useMemo)(()=>new Map(r.map(e=>[e.name,e])),[r]),h=m.get(c),g=(0,H.useMemo)(()=>h?.aliases??[],[h]),_=(0,H.useMemo)(()=>W9(h?.models??[]),[h]);return(0,H.useEffect)(()=>{let e=t.trim();if(!f){l(``),d(e);return}if(!e){d(``),l(e=>m.has(e)?e:``);return}let n=o6(e,r)??``,i=m.get(n)?.aliases??[];l(n),d(n?Q3(e,i):e)},[f,r,m,t]),f?(0,U.jsxs)(`div`,{className:s,children:[(0,U.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,U.jsx)(`div`,{className:`sm:w-[38%] sm:min-w-[170px]`,children:(0,U.jsxs)(Dr,{value:c,onValueChange:e=>{let t=W9(m.get(e)?.models??[])[0]??``;if(l(e),d(t),!t){n(``);return}n($3(m.get(e)?.prefix??e,t))},disabled:i,children:[(0,U.jsx)(yr,{className:`h-10 w-full rounded-xl`,children:(0,U.jsx)(fr,{placeholder:a??b(`providersSelectPlaceholder`)})}),(0,U.jsx)(Sr,{children:r.map(e=>(0,U.jsx)(Tr,{value:e.name,children:e.displayName},e.name))})]})}),(0,U.jsx)(`span`,{className:`hidden h-10 items-center justify-center leading-none text-lg font-semibold text-gray-300 sm:inline-flex`,children:`/`}),(0,U.jsx)(Ese,{id:e,value:u,onChange:e=>{if(!h){let t=e.trim();d(t),n(t);return}let t=Q3(e,g);d(t),n(t?$3(h.prefix,t):``)},options:_,disabled:i||!c,placeholder:p,className:`sm:flex-1`,inputClassName:`h-10 rounded-xl`,emptyText:b(`modelPickerNoOptions`),createText:b(`modelPickerUseCustom`),toggleLabel:b(`modelPickerToggleOptions`)},c)]}),(0,U.jsx)(`p`,{className:`mt-2 text-xs text-gray-500`,children:b(`modelInputCustomHint`)})]}):(0,U.jsxs)(`div`,{className:s,children:[(0,U.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 px-4 py-3`,children:[(0,U.jsx)(`p`,{className:`text-sm font-semibold text-amber-950`,children:b(`providersEmptyTitle`)}),(0,U.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-amber-900`,children:b(`providersEmptyDescription`)})]}),(0,U.jsx)(St,{id:e,value:t,disabled:i,onChange:e=>n(e.target.value),placeholder:p,className:`mt-3 h-10 rounded-xl`}),(0,U.jsx)(`p`,{className:`mt-2 text-xs text-gray-500`,children:b(`modelInputCustomHint`)})]})}function Ose(e){let{runtimeOptions:t,currentRuntime:n}=e,r=n.trim();if(!r)return t;let i=EL(r);return t.some(e=>e.value===i)?t:[...t,{value:i,label:OL(i),icon:null,ready:!1,reason:`unavailable`,reasonMessage:null,supportedModels:void 0,recommendedModel:null,cta:null}].sort((e,t)=>e.value===`native`?-1:t.value===`native`?1:e.value.localeCompare(t.value))}function kse({value:e,disabled:t=!1,runtimeOptions:n,defaultRuntime:r,onChange:i}){let a=e.trim()?EL(e):``,o=Ose({runtimeOptions:n,currentRuntime:e}),s=o.find(e=>e.value===a)??null,c=s?.reasonMessage?.trim()||(s?.ready===!1?b(`agentsRuntimeUnavailableHelp`):``);return(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsxs)(Dr,{value:a||r,onValueChange:e=>i(e===r?``:e),disabled:t,children:[(0,U.jsx)(yr,{"aria-label":b(`agentsCardRuntimeLabel`),className:`rounded-xl`,children:(0,U.jsx)(fr,{placeholder:b(`agentsRuntimeSelectPlaceholder`)})}),(0,U.jsx)(Sr,{className:`rounded-xl`,children:o.map(e=>(0,U.jsx)(Tr,{value:e.value,disabled:e.ready===!1&&e.value!==a,className:`rounded-lg`,children:e.label},e.value))})]}),c?(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:c}):null]})}function Ase({agent:e,pending:t,providerCatalog:n,runtimeOptions:r,defaultRuntime:i,onOpenChange:a,onSubmit:o}){return(0,U.jsx)(Ur,{open:e!==null,onOpenChange:a,children:e?(0,U.jsx)(jse,{agent:e,pending:t,providerCatalog:n,runtimeOptions:r,defaultRuntime:i,onOpenChange:a,onSubmit:o},e.id):null})}function jse(e){let{agent:t,pending:n,providerCatalog:r,runtimeOptions:i,defaultRuntime:a,onOpenChange:o,onSubmit:s}=e,[c,l]=(0,H.useState)(Sse(t));return(0,U.jsxs)(Kr,{className:`flex max-h-[calc(100vh-2rem)] flex-col overflow-hidden border-none bg-popover p-0 sm:max-h-[760px] sm:max-w-xl`,children:[(0,U.jsx)(`div`,{className:`shrink-0 border-b border-border px-6 py-6`,children:(0,U.jsxs)(Wr,{className:`text-left`,children:[(0,U.jsx)(qr,{children:b(`agentsEditDialogTitle`)}),(0,U.jsx)(Br,{children:b(`agentsEditDialogDescription`)})]})}),(0,U.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-6 py-6`,children:(0,U.jsxs)(`div`,{className:`space-y-4`,children:[(0,U.jsx)(Dn,{tone:`warning`,title:b(`agentsEditHomeReadonly`),description:b(`agentsEditHomeReadonlyHint`),children:(0,U.jsx)(`div`,{className:`break-all text-sm text-amber-950`,children:t.workspace??`-`})}),(0,U.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,U.jsx)(St,{value:c.displayName,onChange:e=>l(t=>({...t,displayName:e.target.value})),placeholder:b(`agentsFormNamePlaceholder`)}),(0,U.jsx)(Vn,{value:c.description,onChange:e=>l(t=>({...t,description:e.target.value})),placeholder:b(`agentsFormDescriptionPlaceholder`),rows:4,className:`md:col-span-2`}),(0,U.jsx)(St,{value:c.avatar,onChange:e=>l(t=>({...t,avatar:e.target.value})),placeholder:b(`agentsFormAvatarPlaceholder`)}),(0,U.jsx)(G9,{value:c.model,onChange:e=>l(t=>({...t,model:e})),providerCatalog:r,disabled:n,className:`md:col-span-2`}),(0,U.jsx)(kse,{value:c.runtime,onChange:e=>l(t=>({...t,runtime:e})),runtimeOptions:i,defaultRuntime:a,disabled:n})]}),(0,U.jsx)(bse,{form:c,disabled:n,onChange:e=>l(t=>({...t,...e}))})]})}),(0,U.jsxs)(Pr,{className:`shrink-0 border-t border-border px-6 py-5`,children:[(0,U.jsx)(R,{type:`button`,variant:`ghost`,onClick:()=>o(!1),disabled:n,children:b(`cancel`)}),(0,U.jsxs)(R,{type:`button`,variant:`primary`,className:`rounded-2xl px-5`,onClick:()=>s(t.id,c),disabled:n,children:[(0,U.jsx)(Ho,{className:`mr-2 h-4 w-4`}),b(`agentsEditSaveAction`)]})]})]})}var Mse=`请直接创建一个默认示例 Agent,不要问我问题。创建完成后,简单告诉我它能做什么。`;function Nse(e){let t=e.trim();if(!t)return null;let n=Number(t);if(!Number.isFinite(n))throw Error(b(`agentsAdvancedInvalidNumberError`));return Math.trunc(n)}function Pse(e){return{displayName:e.displayName,description:e.description,avatar:e.avatar,model:e.model,...e.runtime.trim()?{runtime:e.runtime.trim()}:{runtime:``},contextTokens:Nse(e.contextTokens)}}function K9(e){let{icon:t,label:n,disabled:r=!1,destructive:i=!1,onClick:a}=e;return(0,U.jsxs)(`button`,{type:`button`,className:u(`flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50`,i?`text-destructive hover:bg-destructive/10`:`text-foreground hover:bg-muted`),onClick:a,disabled:r,children:[(0,U.jsx)(t,{className:`h-4 w-4 shrink-0`}),(0,U.jsx)(`span`,{children:n})]})}function Fse(e){let{agent:t,runtimeOptions:n,defaultRuntimeLabel:r,updatePending:i,deletePending:a,onStartChat:o,onView:s,onEdit:c,onDelete:l}=e,u=t.runtime?.trim()||t.engine?.trim()||``,d=u?n.find(e=>e.value===EL(u))?.label??OL(u):r;return(0,U.jsx)(Ks,{className:`group overflow-hidden border border-border bg-card shadow-none transition-colors duration-200 hover:border-border/80`,children:(0,U.jsxs)(Xs,{className:`relative flex h-full flex-col gap-3 px-3.5 py-3.5`,children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-2.5 pr-16`,children:[(0,U.jsx)(az,{agentId:t.id,displayName:t.displayName,avatarUrl:t.avatarUrl,className:`h-9 w-9 shrink-0`}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,U.jsx)(`div`,{className:`truncate text-sm font-semibold text-foreground`,children:t.displayName?.trim()||t.id}),t.builtIn?(0,U.jsxs)(Xi,{tone:`warning`,className:`h-5 gap-1 border-amber-200 bg-amber-50 px-1.5 text-[10px] text-amber-700`,children:[(0,U.jsx)($o,{className:`h-3 w-3`}),b(`agentsCardBuiltInTag`)]}):null]}),(0,U.jsxs)(`div`,{className:`truncate text-xs text-muted-foreground`,children:[`@`,t.id]})]})]}),(0,U.jsxs)(`div`,{className:`absolute right-2.5 top-2.5 flex items-center gap-1 opacity-100 transition-opacity md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100`,children:[(0,U.jsx)(R,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8 rounded-lg text-muted-foreground hover:text-foreground`,"aria-label":b(`agentsCardStartChat`),title:b(`agentsCardStartChat`),onClick:o,children:(0,U.jsx)(bo,{className:`h-4 w-4`})}),(0,U.jsxs)(CF,{children:[(0,U.jsx)(wF,{asChild:!0,children:(0,U.jsx)(R,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8 rounded-lg text-muted-foreground hover:text-foreground`,"aria-label":b(`chatSessionMoreActions`),title:b(`chatSessionMoreActions`),children:(0,U.jsx)(Aa,{className:`h-4 w-4`})})}),(0,U.jsxs)(EF,{align:`end`,className:`w-44 p-1.5`,children:[(0,U.jsx)(K9,{icon:Ma,label:b(`agentsViewDetailsAction`),onClick:s}),(0,U.jsx)(K9,{icon:Ho,label:b(`agentsEditAction`),onClick:c,disabled:i}),t.builtIn?null:(0,U.jsx)(K9,{icon:fs,label:b(`agentsRemoveAction`),onClick:l,disabled:a,destructive:!0})]})]})]}),(0,U.jsx)(`p`,{className:`line-clamp-2 min-h-10 text-sm leading-5 text-muted-foreground`,children:t.description?.trim()||(t.builtIn?b(`agentsCardBuiltInSummary`):b(`agentsCardCustomSummary`))}),(0,U.jsxs)(`div`,{className:`mt-auto grid gap-2 border-t border-border/60 pt-2 text-xs text-muted-foreground`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,U.jsx)(Fr,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground/60`}),(0,U.jsx)(`span`,{className:`truncate`,children:d})]}),(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,U.jsx)(ro,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground/60`}),(0,U.jsx)(`span`,{className:`truncate`,children:t.workspace??`-`})]})]})]})})}function Ise(){let e=eI(),t=oz(),n=j6(),r=P6(),i=F6(),a=a9(),o=sz(),s=cz(),[c,l]=(0,H.useState)(null),[u,d]=(0,H.useState)(null),f=(0,H.useMemo)(()=>t.data?.agents??[],[t.data?.agents]),p=(0,H.useMemo)(()=>[...f].sort((e,t)=>Number(!!t.builtIn)-Number(!!e.builtIn)||e.id.localeCompare(t.id)),[f]),m=(0,H.useMemo)(()=>c6({config:n.data,providersView:r.data,templatesView:i.data,onlyConfigured:!0}),[n.data,r.data,i.data]),h=(0,H.useMemo)(()=>kL(a.data?.options??[]),[a.data?.options]),g=(0,H.useMemo)(()=>EL(a.data?.defaultType??`native`),[a.data?.defaultType]),_=(0,H.useMemo)(()=>h.find(e=>e.value===g)?.label??OL(g),[g,h]),v=n.data?.agents.defaults,y=e=>{l(e)},x=e=>{d(e)},S=async(e,t)=>{let n;try{n=Pse(t)}catch(e){L.error(e instanceof Error?e.message:b(`agentsAdvancedParseFailed`));return}await o.mutateAsync({agentId:e,data:n}),d(null)},C=t=>{e.chatSessionListManager.startAgentDraftChat(t.id,DL(t,g))},w=()=>{e.chatSessionListManager.startAgentDraftChat(`main`,g,Mse)};return(0,U.jsxs)(Bt,{className:`space-y-6`,children:[(0,U.jsx)(xt,{headingLevel:1,title:b(`agentsHeroEyebrow`),description:b(`agentsHeroDescription`),actions:(0,U.jsxs)(R,{type:`button`,variant:`primary`,className:`h-9 shrink-0 rounded-xl px-4 text-sm font-semibold`,onClick:w,children:[(0,U.jsx)(Di,{className:`mr-2 h-4 w-4`}),b(`agentsCreateButton`)]})}),(0,U.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-3`,children:t.isLoading?(0,U.jsx)(Ks,{className:`md:col-span-2 xl:col-span-3 border-dashed border-border bg-card/70`,children:(0,U.jsx)(Xs,{className:`py-14 text-center text-sm text-muted-foreground`,children:b(`agentsLoading`)})}):p.length===0?(0,U.jsx)(Ks,{className:`md:col-span-2 xl:col-span-3 overflow-hidden border-dashed border-border bg-gradient-subtle`,children:(0,U.jsxs)(Xs,{className:`flex min-h-[240px] flex-col items-center justify-center px-6 py-14 text-center`,children:[(0,U.jsx)(`div`,{className:`mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-card/80 shadow-[0_18px_44px_rgba(0,0,0,0.08)]`,children:(0,U.jsx)(oa,{className:`h-8 w-8 text-warning`})}),(0,U.jsx)(`div`,{className:`text-lg font-semibold text-foreground`,children:b(`agentsEmpty`)}),(0,U.jsx)(`p`,{className:`mt-2 max-w-md text-sm leading-6 text-muted-foreground`,children:b(`agentsEmptyDescription`)}),(0,U.jsxs)(R,{type:`button`,variant:`primary`,className:`mt-5 rounded-2xl px-5`,onClick:w,children:[(0,U.jsx)(Di,{className:`mr-2 h-4 w-4`}),b(`agentsCreateButton`)]})]})}):p.map(e=>(0,U.jsx)(Fse,{agent:e,runtimeOptions:h,defaultRuntimeLabel:_,updatePending:o.isPending,deletePending:s.isPending,onStartChat:()=>C(e),onView:()=>y(e),onEdit:()=>x(e),onDelete:()=>s.mutate({agentId:e.id})},e.id))}),(0,U.jsx)(_se,{agent:c,defaults:v,runtimeOptions:h,defaultRuntime:g,defaultRuntimeLabel:_,onOpenChange:e=>{e||l(null)},onEdit:e=>{l(null),d(e)}}),(0,U.jsx)(Ase,{agent:u,pending:o.isPending,providerCatalog:m,runtimeOptions:h,defaultRuntime:g,onOpenChange:e=>{!e&&!o.isPending&&d(null)},onSubmit:S})]})}var q9=`max-w-[min(1180px,100%)]`;function Lse(e){let{routeSessionKey:t,syncRouteSessionSelection:n}=e;(0,H.useLayoutEffect)(()=>{n(t)},[t,n])}function Rse({view:e,confirmDialog:t}){let{isMobile:n}=k8(),r=oY({restorationKey:`main-page:cron`}),i=oY({restorationKey:`main-page:agents`}),{onScroll:a,scrollRef:o}=r,{onScroll:s,scrollRef:c}=i;return(0,U.jsxs)(`div`,{className:`h-full flex`,children:[n?null:(0,U.jsx)(Y7,{}),e===`chat`?n?(0,U.jsx)(Gae,{}):(0,U.jsx)(Z5,{}):(0,U.jsx)(`section`,{"data-theme-surface":`workspace`,className:`flex-1 min-h-0 overflow-hidden bg-background`,children:e===`inbox`?(0,U.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 w-full flex-col py-4 sm:px-6 sm:py-5 ${q9}`,children:(0,U.jsx)(_ae,{})}):e===`panel-app`?(0,U.jsx)(z1,{}):e===`cron`?(0,U.jsx)(`div`,{ref:o,onScroll:a,className:`h-full overflow-auto custom-scrollbar`,children:(0,U.jsx)(`div`,{className:`mx-auto w-full px-4 py-4 sm:px-6 sm:py-5 ${q9}`,children:(0,U.jsx)(aie,{})})}):e===`agents`?(0,U.jsx)(`div`,{ref:c,onScroll:s,className:`h-full overflow-auto custom-scrollbar`,children:(0,U.jsx)(`div`,{className:`mx-auto w-full px-4 py-4 sm:px-6 sm:py-5 ${q9}`,children:(0,U.jsx)(Ise,{})})}):(0,U.jsx)(`div`,{className:`h-full overflow-hidden`,children:(0,U.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 w-full flex-col px-4 py-4 sm:px-6 sm:py-5 ${q9}`,children:(0,U.jsx)(_Q,{forcedType:`skills`})})})}),t]})}function zse(e){let t=eI(),n=j6(),r=P6(),i=F6(),a=sL({limit:200}),o=a9(),s=e.sessionKey?.trim()||`draft-session`,c=lL({sessionId:s});(0,H.useEffect)(()=>{t.chatQueryManager.syncSnapshot({configQuery:n,providersQuery:r,providerTemplatesQuery:i,sessionsQuery:a,sessionTypesQuery:o,sessionSkillsSessionId:s,sessionSkillsQuery:c})},[n,t.chatQueryManager,r,s,c,a,o,i])}function Bse(){let e=eI();(0,H.useEffect)(()=>I.eventBus.on(c.uiShowContent,t=>{e.chatThreadManager.handleUiShowContentEvent(t)}),[e])}function Vse(){let{sessionId:e}=le(),t=(0,H.useMemo)(()=>Q7(e),[e]);return{routeSessionKey:t,sessionKey:t??void 0}}function Hse(){let e=eI(),{confirm:t,ConfirmDialog:n}=On(),r=_e(),i=ce();return(0,H.useEffect)(()=>{e.chatUiManager.syncState({pathname:r.pathname}),e.chatUiManager.bindActions({navigate:i,confirm:t})},[t,r.pathname,i,e]),(0,U.jsx)(n,{})}function Use({view:e}){let t=P9();return(0,U.jsx)($F,{presenter:(0,H.useMemo)(()=>new hoe(t),[t]),children:(0,U.jsx)(Wse,{view:e})})}function Wse({view:e}){let t=P9(),n=eI(),r=Hse(),{routeSessionKey:i,sessionKey:a}=Vse(),o=$(e=>{let{snapshot:t}=e;return t.workspacePanelParentKey!==(a??null)||t.activeWorkspacePanelKind!==`child-session`?null:t.activeChildSessionKey?.trim()||null});return(0,H.useEffect)(()=>(t.chatCompletionNotificationManager.syncVisibleSessions([a,o]),()=>{t.chatCompletionNotificationManager.syncVisibleSessions([])}),[t.chatCompletionNotificationManager,a,o]),zse({sessionKey:a??null}),Lse({routeSessionKey:i,syncRouteSessionSelection:n.chatSessionListManager.syncRouteSessionSelection}),Bse(),(0,U.jsx)(Rse,{view:e,confirmDialog:r})}function J9({view:e}){return(0,U.jsx)(Use,{view:e})}var Y9=P(e=>({pending:null,present:t=>e({pending:t}),clear:()=>e({pending:null})})),Gse=`desktop.authorization.required`;function Kse(){let e=Y9(e=>e.pending),t=Y9(e=>e.present),n=Y9(e=>e.clear),[r,i]=(0,H.useState)(!1);(0,H.useEffect)(()=>I.eventBus.subscribeAll(e=>{if(e.type!==Gse)return;let n=qse(e.payload);n&&t(n)}),[t]);let a=async()=>{if(!(!e||r)){i(!0);try{await R7.grantAccess(e.request),await jt.invalidateQueries({queryKey:[`desktop-capability`,`grants`]}),n(),L.success(b(`desktopAuthorizationAllowed`))}catch(e){L.error(e instanceof Error?e.message:b(`desktopAuthorizationFailed`))}finally{i(!1)}}};return(0,U.jsx)(Ur,{open:!!e,onOpenChange:e=>{!e&&!r&&n()},children:(0,U.jsxs)(Kr,{className:`[&>:last-child]:hidden`,children:[(0,U.jsxs)(Wr,{children:[(0,U.jsxs)(qr,{className:`flex items-center gap-2`,children:[(0,U.jsx)(Qo,{className:`h-4 w-4 text-amber-600`}),b(`desktopAuthorizationTitle`)]}),(0,U.jsx)(Br,{children:b(`desktopAuthorizationDescription`)})]}),e?(0,U.jsxs)(`div`,{className:`space-y-3 rounded-xl bg-muted/55 p-4 text-sm`,children:[(0,U.jsx)(X9,{label:b(`desktopAuthorizationCaller`),value:Jse(e)}),(0,U.jsx)(X9,{label:b(`desktopAuthorizationApplication`),value:e.applicationId}),(0,U.jsx)(X9,{label:b(`desktopAuthorizationAccess`),value:e.request.access.map(Yse).join(`, `)}),(0,U.jsx)(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:Xse(e.request.access)})]}):null,(0,U.jsxs)(Pr,{className:`gap-2 sm:gap-0`,children:[(0,U.jsx)(R,{type:`button`,variant:`outline`,disabled:r,onClick:n,children:b(`desktopAuthorizationReject`)}),(0,U.jsx)(R,{type:`button`,disabled:r,onClick:()=>void a(),children:b(r?`desktopAuthorizationAllowing`:`desktopAuthorizationAllow`)})]})]})})}function X9({label:e,value:t}){return(0,U.jsxs)(`div`,{className:`grid grid-cols-[5rem_minmax(0,1fr)] gap-3`,children:[(0,U.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:e}),(0,U.jsx)(`div`,{className:`min-w-0 break-words text-xs text-foreground`,children:t})]})}function qse(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e,{request:n}=t;if(!n||typeof n!=`object`||Array.isArray(n))return null;let r=n;return typeof t.applicationId!=`string`||!r.subject||!r.resource||!Array.isArray(r.access)||typeof r.declarationFingerprint!=`string`?null:{applicationId:t.applicationId,request:r}}function Jse(e){let{subject:t}=e.request;return`${t.type===`agent`?b(`desktopCapabilitiesAgent`):b(`desktopCapabilitiesExtension`)} · ${t.id}`}function Yse(e){return e===`ui.read`?b(`desktopAuthorizationRead`):e===`ui.observe`?b(`desktopAuthorizationObserve`):e===`ui.write`?b(`desktopAuthorizationWrite`):e===`screen.capture-window`?b(`desktopAuthorizationScreenCapture`):e===`input.pointer`?b(`desktopAuthorizationPointerInput`):e}function Xse(e){return e.includes(`ui.write`)?b(`desktopAuthorizationWriteRisk`):e.includes(`screen.capture-window`)?b(`desktopAuthorizationScreenCaptureRisk`):e.includes(`input.pointer`)?b(`desktopAuthorizationPointerInputRisk`):b(`desktopAuthorizationReadRisk`)}function Zse(e){let t=e.trim().toLowerCase();return t?!t.startsWith(`skills`):!0}function Qse(e,t){t.startsWith(`mcp`)&&(e?.invalidateQueries({queryKey:[`marketplace-mcp-installed`]}),e?.invalidateQueries({queryKey:[`marketplace-mcp-items`]}),e?.invalidateQueries({queryKey:[`marketplace-mcp-doctor`]}))}function $se(e,t){e&&Zse(t)&&e.invalidateQueries({queryKey:[`config`]}),Qse(e,t)}function Z9(e){let t=e.trim().replace(/\\/g,`/`).replace(/\/+$/g,``);return/^[a-z]:/i.test(t)?t.toLowerCase():t}function ece(e,t){if(!e)return;let n=Z9(t);e.invalidateQueries({predicate:e=>e.queryKey[0]===`server-path-browse`&&typeof e.queryKey[1]==`string`&&Z9(e.queryKey[1])===n})}function tce(e){let t=(0,H.useRef)(!1);(0,H.useEffect)(()=>{let n=I.eventBus.on(c.connectionOpen,()=>{wt.handleConnectionRestored(),Re.refreshAfterRealtimeReconnect(),t.current&&(t.current=!1,e?.invalidateQueries({queryKey:[`ncp-sessions`]}))}),r=I.eventBus.on(c.connectionClose,()=>{wt.handleConnectionInterrupted(null),t.current=!0}),i=I.eventBus.on(c.connectionError,e=>{wt.handleConnectionInterrupted(e?.message??null),t.current=!0}),a=I.eventBus.on(c.configUpdated,({path:t})=>{$se(e,t)}),o=I.eventBus.on(c.serverPathChanged,({directoryPath:t})=>ece(e,t)),s=I.eventBus.on(c.runtimeUpdateSnapshot,e=>{Re.reportSnapshot(e)}),l=I.eventBus.on(c.sessionRunStatus,t=>{vn(e,{type:`session.run-status`,payload:t})}),u=I.eventBus.on(c.sessionSummaryUpsert,t=>{vn(e,{type:`session.summary.upsert`,payload:t})}),d=I.eventBus.on(c.sessionSummaryDelete,t=>{vn(e,{type:`session.summary.delete`,payload:t})}),f=I.eventBus.on(c.error,e=>{console.error(`Realtime transport error:`,e.message)});return()=>{n(),r(),i(),a(),o(),s(),l(),u(),d(),f()}},[e])}var nce={"--width":`320px`},rce=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{ModelConfigPage:e}=await import(`./model-config-page-DAseq1vr.js`);return{ModelConfigPage:e}},__vite__mapDeps([40,4,41,28,32,30,33,1,34,42,38,39,43,44,45]))).ModelConfigPage})),ice=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{AppearanceSettingsPage:e}=await import(`./appearance-settings-page-BLaxNij2.js`);return{AppearanceSettingsPage:e}},__vite__mapDeps([46,4,47,27,28,30,41,48,49,29,37,26,31,32,33,1,34,35,36,38,39,42,50,44]))).AppearanceSettingsPage})),ace=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{SearchConfigPage:e}=await import(`./search-config-page-Bi9J2kYR.js`);return{SearchConfigPage:e}},__vite__mapDeps([51,4,47,27,28,30,41,31,33,1,34,52,43]))).SearchConfigPage})),oce=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{ProvidersConfigPage:e}=await import(`./providers-config-page-zP-J1Asx.js`);return{ProvidersConfigPage:e}},__vite__mapDeps([53,4,47,27,28,30,49,29,41,37,31,42,35,36,52,43,45,34]))).ProvidersConfigPage})),sce=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{ExtensionsConfigPage:e}=await import(`./extensions-Mc3juAVp.js`);return{ExtensionsConfigPage:e}},__vite__mapDeps([54,41,4,28,36,30]))).ExtensionsConfigPage})),cce=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{ChannelsList:e}=await import(`./channels-list-page-eUVEhukh.js`);return{ChannelsList:e}},__vite__mapDeps([55,4,47,27,28,30,41,31,32,33,1,34,42,37,52,50,43,45]))).ChannelsList})),lce=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{RuntimeConfig:e}=await import(`./runtime-config-page-D5KbQ3ue.js`);return{RuntimeConfig:e}},__vite__mapDeps([56,4,47,27,28,30,41,48,49,29,37,26,31,32,33,1,34,35,36,38,39,42,50,44,57,58,43]))).RuntimeConfig})),uce=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{DesktopUpdateConfig:e}=await import(`./desktop-update-config-BWP2Pr4u.js`);return{DesktopUpdateConfig:e}},__vite__mapDeps([59,47,4,27,28,30,41,33,1,34,36,57]))).DesktopUpdateConfig})),dce=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{SecurityConfig:e}=await import(`./security-config-CNdun2s-.js`);return{SecurityConfig:e}},__vite__mapDeps([60,41,4,28]))).SecurityConfig})),fce=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{SecretsConfigPage:e}=await import(`./secrets-config-page-0MP2MSvq.js`);return{SecretsConfigPage:e}},__vite__mapDeps([61,4,47,27,28,30,41,35,58,43]))).SecretsConfigPage})),pce=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{PrivacySettingsPage:e}=await import(`./privacy-settings-page-COFa7LrK.js`);return{PrivacySettingsPage:e}},__vite__mapDeps([62,47,4,27,28,30,41]))).PrivacySettingsPage})),mce=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{DesktopCapabilitiesPage:e}=await import(`./desktop-capabilities-page-FV7xowDx.js`);return{DesktopCapabilitiesPage:e}},__vite__mapDeps([63,41,4,28]))).DesktopCapabilitiesPage})),hce=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{RemoteAccessPage:e}=await import(`./remote-EeKMCoyb.js`);return{RemoteAccessPage:e}},[])).RemoteAccessPage})),gce=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{McpMarketplacePage:e}=await import(`./mcp-marketplace-page-Dj0xiFAV.js`);return{McpMarketplacePage:e}},__vite__mapDeps([64,48,4,47,27,28,30,49,29,41,37,26,31,32,33,1,34,35,36,38,39,42,50,44]))).McpMarketplacePage}));function _ce(){return(0,U.jsx)(`div`,{className:`h-full w-full animate-pulse rounded-2xl border border-border/40 bg-card/40`})}function vce({children:e}){return(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(_ce,{}),children:e})}function Q9(e){return(0,U.jsx)(vce,{children:e})}var yce=[{path:`/chat/skills`,redirectTo:`/skills`},{path:`/chat/cron`,redirectTo:`/cron`},{path:`/chat/agents`,redirectTo:`/agents`},{path:`/chat/:sessionId?`,element:Q9((0,U.jsx)(J9,{view:`chat`}))},{path:`/agents`,element:Q9((0,U.jsx)(J9,{view:`agents`}))},{path:`/skills`,element:Q9((0,U.jsx)(J9,{view:`skills`}))},{path:`/skills/scenes/:scene`,element:Q9((0,U.jsx)(J9,{view:`skills`}))},{path:`/cron`,element:Q9((0,U.jsx)(J9,{view:`cron`}))},{path:`/inbox/:deliveryId?`,element:Q9((0,U.jsx)(J9,{view:`inbox`}))},{path:`/apps/panel/:appId`,element:Q9((0,U.jsx)(J9,{view:`panel-app`}))},{path:`/appearance`,element:Q9((0,U.jsx)(ice,{}))},{path:`/model`,element:Q9((0,U.jsx)(rce,{}))},{path:`/search`,element:Q9((0,U.jsx)(ace,{}))},{path:`/providers`,element:Q9((0,U.jsx)(oce,{}))},{path:`/extensions`,element:Q9((0,U.jsx)(sce,{}))},{path:`/channels`,element:Q9((0,U.jsx)(cce,{}))},{path:`/runtime`,element:Q9((0,U.jsx)(lce,{}))},{path:`/updates`,element:Q9((0,U.jsx)(uce,{}))},{path:`/remote`,element:Q9((0,U.jsx)(hce,{}))},{path:`/security`,element:Q9((0,U.jsx)(dce,{}))},{path:`/privacy`,element:Q9((0,U.jsx)(pce,{}))},{path:`/desktop-capabilities`,element:Q9((0,U.jsx)(mce,{}))},{path:`/secrets`,element:Q9((0,U.jsx)(fce,{}))},{path:`/settings`,element:(0,U.jsx)(gse,{})},{path:`/marketplace/skills`,redirectTo:`/skills`},{path:`/marketplace`,redirectTo:`/skills`},{path:`/marketplace/mcp`,element:Q9((0,U.jsx)(gce,{}))},{path:`/`,redirectTo:`/chat`},{path:`*`,redirectTo:`/chat`}];function bce(e){return`redirectTo`in e?(0,U.jsx)(se,{path:e.path,element:(0,U.jsx)(he,{to:e.redirectTo,replace:!0})},e.path):(0,U.jsx)(se,{path:e.path,element:e.element},e.path)}function xce(){return(0,U.jsx)(de,{children:yce.map(bce)})}function $9(){return tce(jt),ye(),(0,H.useEffect)(()=>(Re.start(),()=>{Re.stop()}),[]),(0,U.jsxs)(ase,{children:[(0,U.jsx)(ose,{}),(0,U.jsx)(pae,{}),(0,U.jsx)(hse,{children:(0,U.jsx)(xce,{})}),(0,U.jsx)(Gs,{}),(0,U.jsx)(f$,{}),(0,U.jsx)(Kse,{})]})}function Sce(){let e=Se(),t=e.isError&&En(e.error);return e.isLoading&&!e.isError||t||e.isError?(0,U.jsx)($9,{}):e.data?.enabled&&!e.data.authenticated?(0,U.jsx)(Qs,{username:e.data.username}):(0,U.jsx)($9,{})}function Cce(){return(0,H.useEffect)(()=>{zie()},[]),(0,U.jsxs)(Lt,{client:jt,children:[(0,U.jsx)(Sce,{}),(0,U.jsx)(Lie,{}),(0,U.jsx)(Ot,{position:`top-right`,richColors:!0,offset:{top:window.nextclawDesktop?.platform===`win32`?56:44,right:72},mobileOffset:window.nextclawDesktop?.platform===`win32`?56:void 0,style:nce})]})}var wce=window.nextclawDesktop?.platform===`win32`?oe:me;(0,bs.createRoot)(document.getElementById(`root`)).render((0,U.jsx)(H.StrictMode,{children:(0,U.jsx)(Hie,{children:(0,U.jsx)(Mn,{children:(0,U.jsx)(wce,{children:(0,U.jsx)(Cce,{})})})})}));export{Xs as $,R6 as A,t6 as B,N6 as C,ao as Ct,K6 as D,fa as Dt,P6 as E,Aa as Et,Z6 as F,qY as G,t0 as H,J3 as I,ML as J,JY as K,c6 as L,V6 as M,X6 as N,W6 as O,na as Ot,B6 as P,Ks as Q,s6 as R,q6 as S,oo as St,F6 as T,Ma as Tt,KY as U,e6 as V,YY as W,EF as X,CF as Y,wF as Z,H6 as _,Zo as _t,Nae as a,Fs as at,Q6 as b,Uo as bt,Sae as c,ks as ct,Iie as d,Ns as dt,Ys as et,t7 as f,Ts as ft,L6 as g,ss as gt,M6 as h,fs as ht,kae as i,zs as it,z6 as j,Y6 as k,M7 as l,As as lt,j6 as m,Ss as mt,g9 as n,Js as nt,Mae as o,Ps as ot,k8 as p,Cs as pt,GL as q,jae as r,Bs as rt,Pae as s,Es as st,G9 as t,qs as tt,h7 as u,js as ut,U6 as v,Xo as vt,I6 as w,$a as wt,J6 as x,wo as xt,G6 as y,Wo as yt,r6 as z};
|
|
109
|
+
`).replace(/^[ \t]*\[[^\]]+\]:\s+\S+.*$/gmu,` `).replace(/^[ \t]*(?:`{3,}|~{3,})[^\n]*$/gmu,` `).replace(/^[ \t]*\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?[ \t]*$/gmu,` `).replace(/^[ \t]*(?:[-*_][ \t]*){3,}$/gmu,` `).replace(/!\[([^\]]*)\]\([^\n)]+\)/gu,`$1`).replace(/\[([^\]]+)\]\([^\n)]+\)/gu,`$1`).replace(/\[([^\]]+)\]\[[^\]]*\]/gu,`$1`).replace(/<(https?:\/\/[^>\s]+)>/gu,`$1`).replace(/<[^>]+>/gu,` `).replace(/^[ \t]{0,3}#{1,6}[ \t]+/gmu,``).replace(/^[ \t]*>+[ \t]?/gmu,``).replace(/^[ \t]*(?:[-+*]|\d+[.)])[ \t]+/gmu,``).replace(/^[ \t]*\[(?: |x|X)\][ \t]*/gmu,``).replace(/(`+)([^`]*?)\1/gu,`$2`).replace(/(\*\*|__)(?=\S)([\s\S]*?\S)\1/gu,`$2`).replace(/~~(?=\S)([\s\S]*?\S)~~/gu,`$1`).replace(/\*(?=\S)([^*\n]*?\S)\*/gu,`$1`).replace(/\\([\\`*{}[\]()#+.!_>-])/gu,`$1`).replace(/^[ \t]*\|(.+)\|[ \t]*$/gmu,(e,t)=>t.split(`|`).map(e=>e.trim()).filter(Boolean).join(` `)).replace(/\s+/gu,` `).trim(),n=Array.from(t);return n.length<=i9?t:`${n.slice(0,i9-1).join(``)}…`}function xoe(e){return boe(e.parts.filter(e=>e.type===`text`||e.type===`rich-text`).map(e=>e.text).join(` `))}var Soe=class{constructor(e){this.notificationManager=e,this.cleanups=[],this.handledMessageIds=new Set,this.visibleSessionIds=new Set,this.started=!1,this.start=()=>{this.started||(this.started=!0,this.cleanups.push(I.eventBus.on(c.ncpEvent,this.handleNcpEvent)))},this.stop=()=>{if(this.started)for(this.started=!1;this.cleanups.length>0;)this.cleanups.pop()?.()},this.syncVisibleSessions=e=>{this.visibleSessionIds=new Set(e.map(e=>e?.trim()).filter(e=>!!e))},this.handleNcpEvent=e=>{if(e.type!==gK.MessageCompleted)return;let{message:t}=e.payload,n=e.payload.sessionId.trim();if(!n||this.handledMessageIds.has(t.id)||t.role!==`assistant`||t.status!==`final`||lK(t)||(this.rememberHandledMessage(t.id),this.visibleSessionIds.has(n)))return;let r=this.resolveSessionSummary(n),i=CK(t.metadata);if(i&&i.actor!==`human`||!i&&r&&yoe(r.metadata))return;let a=r?nI(KI(r)):b(`chatBackgroundReplyFallbackTitle`),o=xoe(t);this.notificationManager.show({id:`chat-reply:${t.id}`,title:a,description:o||b(`chatBackgroundReplyFallbackPreview`),href:$7(n),ariaLabel:b(`chatBackgroundReplyOpenAriaLabel`).replace(`{title}`,a)})},this.resolveSessionSummary=e=>(eR.getState().snapshot.sessionsQuery?.data?.sessions??[]).find(t=>t.sessionId===e),this.rememberHandledMessage=e=>{if(this.handledMessageIds.add(e),this.handledMessageIds.size<=voe)return;let t=this.handledMessageIds.values().next().value;t&&this.handledMessageIds.delete(t)}}};function a9(){return Sn({queryKey:[`ncp-session-types`],queryFn:Et,staleTime:1e4,retry:!1})}var o9=`relative ml-auto flex min-h-[74px] w-[320px] max-w-[calc(100vw-2rem)] rounded-[20px] border border-border/80 bg-background text-left text-foreground shadow-[0_8px_18px_rgba(0,0,0,0.12),0_2px_5px_rgba(0,0,0,0.06)]`,s9=`flex min-h-[72px] min-w-0 flex-1 items-center gap-3 rounded-[inherit] py-3 pl-[18px] pr-[52px]`;function c9({title:e,description:t,iconSrc:n}){return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-border/80 bg-background p-[3px]`,children:(0,U.jsx)(`img`,{"aria-hidden":`true`,alt:``,src:n??`/logo.svg`,className:`h-full w-full object-contain`})}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`span`,{className:`block truncate text-[15px] font-semibold leading-5 tracking-[-0.01em]`,children:e}),t?(0,U.jsx)(`span`,{className:`mt-0.5 block truncate text-[14px] leading-5 text-muted-foreground`,children:t}):null]})]})}function l9({dismissLabel:e,onDismiss:t}){return(0,U.jsx)(V,{className:`absolute right-2.5 top-2.5 z-10`,icon:(0,U.jsx)(ki,{className:`h-4 w-4`,"aria-hidden":`true`}),label:e,onClick:t,size:`lg`,tooltipSide:`left`})}function Coe({title:e,description:t,href:n,iconSrc:r,ariaLabel:i,dismissLabel:a,onDismiss:o}){let s=i??[e,t].filter(Boolean).join(`: `);return n?(0,U.jsxs)(`div`,{className:o9,children:[(0,U.jsx)(ue,{to:n,"aria-label":s,className:`${s9} focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary/50`,onClick:o,children:(0,U.jsx)(c9,{title:e,description:t,iconSrc:r})}),(0,U.jsx)(l9,{dismissLabel:a,onDismiss:o})]}):(0,U.jsxs)(`div`,{className:o9,children:[(0,U.jsx)(`div`,{role:`status`,"aria-label":s,className:s9,children:(0,U.jsx)(c9,{title:e,description:t,iconSrc:r})}),(0,U.jsx)(l9,{dismissLabel:a,onDismiss:o})]})}var woe=8e3,Toe=class{constructor(){this.show=e=>L.custom(t=>(0,H.createElement)(Coe,{title:e.title,description:e.description,href:e.href,iconSrc:e.iconSrc,ariaLabel:e.ariaLabel,dismissLabel:e.dismissLabel??b(`notificationDismiss`),onDismiss:()=>{L.dismiss(t)}}),{id:e.id,duration:e.durationMs??woe,unstyled:!0}),this.dismiss=e=>{L.dismiss(e)}}},Eoe=`nextclaw://docs`,u9=`github-project`,Doe=`https://github.com/Peiiii/nextclaw`;function d9(){return[{builtIn:!0,icon:{type:`builtin`,name:`apps`},id:`apps`,label:b(`appsTitle`),removable:!1,target:{type:`right-panel-resource`,uri:J$}},{builtIn:!0,icon:{type:`builtin`,name:`docs`},id:`docs`,label:b(`docBrowserHelp`),removable:!1,target:{type:`right-panel-resource`,uri:Eoe}},{builtIn:!0,icon:{type:`builtin`,name:`new-tab`},id:`new-tab`,label:b(`docBrowserHomeTitle`),removable:!1,target:{type:`right-panel-resource`,uri:K$}},{builtIn:!0,icon:{type:`builtin`,name:`github`},id:u9,label:b(`sideDockGitHubProject`),removable:!1,target:{type:`external-url`,url:Doe}}]}var Ooe=[`apps`,`docs`,`github`,`new-tab`,`panel-app`,`service-apps`];function f9(e){return!!e&&typeof e==`object`}function koe(e){return Ooe.includes(e)}function Aoe(e){return!f9(e)||typeof e.type!=`string`?null:e.type===`builtin`&&koe(e.name)?{type:`builtin`,name:e.name}:e.type===`url`&&typeof e.url==`string`&&e.url.trim().length>0?{type:`url`,url:e.url.trim()}:e.type===`text`&&typeof e.value==`string`&&e.value.trim().length>0?{type:`text`,value:e.value.trim()}:null}function joe(e){if(!f9(e)||typeof e.id!=`string`||e.id.trim().length===0||typeof e.label!=`string`||e.label.trim().length===0||typeof e.createdAt!=`string`||e.createdAt.trim().length===0||!f9(e.target)||e.target.type!==`right-panel-resource`||typeof e.target.uri!=`string`||e.target.uri.trim().length===0)return null;let t=Aoe(e.icon);return t?{createdAt:e.createdAt,icon:t,id:e.id.trim(),label:e.label.trim(),target:{type:`right-panel-resource`,uri:e.target.uri.trim()}}:null}function p9(e){if(!Array.isArray(e))return[];let t=new Map;return e.forEach(e=>{let n=joe(e);n&&t.set(n.id,n)}),Array.from(t.values())}function Moe(e,t){return{createdAt:t,icon:e.icon,id:e.id,label:e.label,target:e.target}}function Noe(e){return e.target.type===`right-panel-resource`?e.target.uri:null}function Poe(e){return{builtIn:!1,icon:e.icon,id:e.id,label:e.label,removable:!0,target:e.target}}function m9(e,t){let n=new Set(e.map(e=>e.id)),r=new Set(e.map(Noe).filter(e=>e!==null)),i=t.filter(e=>!n.has(e.id)&&!r.has(e.target.uri)).map(Poe);return[...e,...i]}var Foe=`nextclaw.side-dock.state`,Ioe=1;function h9(e){return!!e&&typeof e==`object`}var g9=P()(ji(e=>({isVisible:!0,pinnedItems:[],setVisible:t=>e({isVisible:t}),setPinnedItems:t=>e({pinnedItems:p9(t)})}),{name:Foe,version:Ioe,storage:Mi(()=>window.localStorage),partialize:e=>({isVisible:e.isVisible,pinnedItems:e.pinnedItems}),merge:(e,t)=>{let n=h9(e)?p9(e.pinnedItems):[],r=h9(e)&&typeof e.isVisible==`boolean`?e.isVisible:!0;return{...t,isVisible:r,pinnedItems:n}}})),Loe={apps:Zr,docs:Ti,github:ti,"new-tab":Di,"panel-app":di,"service-apps":di},Roe=new Set([u9]),zoe=/^\p{Extended_Pictographic}(?:\uFE0F|\uFE0E)?(?:\u200D\p{Extended_Pictographic}(?:\uFE0F|\uFE0E)?)*$/u;function Boe(e){return zoe.test(e.trim())}function Voe({icon:e}){if(e.type===`url`)return(0,U.jsx)(`img`,{src:e.url,alt:``,className:`h-5 w-5 rounded object-cover`});if(e.type===`text`)return Boe(e.value)?(0,U.jsx)(`span`,{className:`flex h-7 w-7 items-center justify-center text-[20px] leading-none`,"aria-hidden":`true`,children:e.value}):(0,U.jsx)(`span`,{className:`max-w-7 truncate text-center text-[13px] font-semibold leading-none`,"aria-hidden":`true`,children:e.value});let t=Loe[e.name];return(0,U.jsx)(t,{className:`h-5 w-5`,"aria-hidden":`true`})}function _9({active:e,item:t,onOpen:n,onUnpin:r}){let{label:i}=t;return(0,U.jsxs)(pi,{children:[(0,U.jsxs)(`div`,{className:`group relative`,children:[(0,U.jsx)(ni,{asChild:!0,children:(0,U.jsx)(`button`,{type:`button`,"aria-label":i,title:i,"data-side-dock-item-id":t.id,onClick:()=>n(t),className:u(`flex h-10 w-10 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors`,`hover:bg-primary/10 hover:text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,e?`bg-primary/10 text-primary`:`bg-transparent`),children:(0,U.jsx)(Voe,{icon:t.icon})})}),t.removable?(0,U.jsx)(`button`,{type:`button`,"aria-label":b(`sideDockUnpinItem`),title:b(`sideDockUnpinItem`),onClick:e=>{e.stopPropagation(),r(t)},className:`absolute -right-1 -top-1 hidden h-4 w-4 items-center justify-center rounded-full bg-background text-muted-foreground shadow-sm ring-1 ring-border/70 transition-colors hover:bg-muted hover:text-foreground group-hover:flex focus-visible:flex focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:(0,U.jsx)(ki,{className:`h-3 w-3`,"aria-hidden":`true`})}):null]}),(0,U.jsx)(li,{side:`left`,children:i})]})}function Hoe({icon:e,label:t,onClick:n}){return(0,U.jsxs)(pi,{children:[(0,U.jsx)(ni,{asChild:!0,children:(0,U.jsx)(`button`,{type:`button`,"aria-label":t,title:t,"data-side-dock-action":`hide`,onClick:n,className:u(`flex h-10 w-10 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors`,`hover:bg-primary/10 hover:text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`),children:(0,U.jsx)(e,{className:`h-5 w-5`,"aria-hidden":`true`})})}),(0,U.jsx)(li,{side:`left`,children:t})]})}function v9(e){return e?.trim()??``}function y9(e){return e.target.type===`right-panel-resource`?e.target.uri:null}function b9(e,t,n,r=!1){if(!t||!n)return!1;let i=v9(y9(e)??void 0);if(!i)return!1;let a=v9(n.resourceUri);return a&&a===i||v9(n.currentUrl)===i?!0:r?!1:e.id===`docs`&&n.kind===`docs`}function Uoe(e,t){if(!t)return!1;let n=v9(t.resourceUri),r=v9(t.currentUrl);return e.some(e=>{let t=v9(y9(e)??void 0);return t===n||t===r})}function x9(e){return Roe.has(e.id)}function Woe({manager:e}){let t=g9(e=>e.pinnedItems),n=g9(e=>e.setVisible),{currentTab:r,isOpen:i}=Hi(),{confirm:a,ConfirmDialog:o}=On(),s=m9(d9(),t),c=s.filter(e=>!x9(e)),l=s.filter(x9),u=Uoe(s,r),d=async()=>{await a({title:b(`sideDockHideConfirmTitle`),description:b(`sideDockHideConfirmDescription`),confirmLabel:b(`sideDockHideConfirmAction`),cancelLabel:b(`cancel`)})&&n(!1)};return(0,U.jsx)(ci,{delayDuration:250,children:(0,U.jsxs)(`aside`,{"data-testid":`side-dock`,"data-theme-surface":`utility-rail`,className:`z-30 flex h-full w-14 shrink-0 flex-col items-center gap-1 border-l border-border/60 bg-background/95 px-2 py-3`,children:[(0,U.jsx)(`div`,{className:`flex w-full flex-col items-center gap-1`,children:c.map(t=>(0,U.jsx)(_9,{active:b9(t,i,r,u),item:t,onOpen:e.openItem,onUnpin:t=>e.unpinItem(t.id)},t.id))}),l.length>0?(0,U.jsxs)(`div`,{"data-testid":`side-dock-utility`,className:`mt-auto flex w-full flex-col items-center gap-1`,children:[l.map(t=>(0,U.jsx)(_9,{active:b9(t,i,r,u),item:t,onOpen:e.openItem,onUnpin:t=>e.unpinItem(t.id)},t.id)),(0,U.jsx)(Hoe,{icon:Ro,label:b(`sideDockHide`),onClick:()=>{d()}})]}):null,(0,U.jsx)(o,{})]})})}var Goe=`pinned`,Koe=new Set([`apps`,`docs`,`github`,`new-tab`,`panel-app`,`service-apps`]);function S9(e){return e.trim()}function qoe(e){let t=0;return Array.from(S9(e)).forEach(e=>{t=t*31+e.charCodeAt(0)>>>0}),`${Goe}-${S9(e).replace(/[^a-zA-Z0-9]+/g,`-`).replace(/^-+|-+$/g,``).toLowerCase()||`resource`}-${t.toString(36)}`}function Joe(e){return e?.type===`builtin`&&Koe.has(e.name)?{type:`builtin`,name:e.name}:e?.type===`url`&&e.url.trim().length>0?{type:`url`,url:e.url.trim()}:e?.type===`text`&&e.value.trim().length>0?{type:`text`,value:e.value.trim()}:null}function Yoe(e){return e.kind===`docs`?`docs`:e.kind===`home`?`new-tab`:e.kind===`apps`?e.resourceUri?.includes(`service-apps`)?`service-apps`:`apps`:e.kind===`panel-app`?`panel-app`:`apps`}var Xoe=class{constructor(e){this.docBrowserManager=e,this.getItems=()=>m9(d9(),g9.getState().pinnedItems),this.openItem=async e=>{if(e.target.type===`right-panel-resource`){this.docBrowserManager.open(e.target.uri,{dockIcon:e.icon,title:e.label});return}e.target.type===`external-url`&&await Ai.openExternalUrl(e.target.url)},this.getDockState=e=>{let t=this.getTabResourceUri(e);if(!t)return{canDock:!1,isDocked:!1,removable:!1};let n=this.findItemByUri(t);return{canDock:!0,isDocked:!!n,removable:n?.removable===!0}},this.pinTab=(e,t=new Date().toISOString())=>{let n=this.getTabResourceUri(e);!e||!n||this.findItemByUri(n)||this.pinItem({builtIn:!1,icon:Joe(e.dockIcon)??{type:`builtin`,name:Yoe(e)},id:qoe(n),label:e.title.trim()||n,removable:!0,target:{type:`right-panel-resource`,uri:n}},t)},this.unpinTab=e=>{let t=this.getTabResourceUri(e),n=t?this.findItemByUri(t):void 0;n?.removable&&this.unpinItem(n.id)},this.pinItem=(e,t=new Date().toISOString())=>{if(!e.removable||e.target.type!==`right-panel-resource`)return;let n=S9(e.target.uri),r={...e,target:{type:`right-panel-resource`,uri:n}};this.setPinnedItems(i=>i.some(t=>t.id===e.id||S9(t.target.uri)===n)?i:[...i,Moe(r,t)])},this.unpinItem=e=>{this.setPinnedItems(t=>t.filter(t=>t.id!==e))},this.reorderPinnedItems=e=>{this.setPinnedItems(t=>{let n=new Map(t.map(e=>[e.id,e])),r=e.map(e=>n.get(e)).filter(e=>e!==void 0),i=new Set(r.map(e=>e.id)),a=t.filter(e=>!i.has(e.id));return[...r,...a]})},this.setPinnedItems=e=>{let{pinnedItems:t,setPinnedItems:n}=g9.getState();n(e(t))},this.getTabResourceUri=e=>{let t=e?.resourceUri??e?.currentUrl,n=t?S9(t):``;return n.length>0?n:null},this.findItemByUri=e=>{let t=S9(e);return this.getItems().find(e=>e.target.type===`right-panel-resource`&&S9(e.target.uri)===t)}}},Zoe=new class{constructor(){this.resolveOpenTarget=e=>{let{activeTab:t,kind:n,url:r}=e,i=n??(r?void 0:t?.kind)??(r&&Ri(r)?`docs`:`home`),a=r?.trim()||(!n&&t&&t.kind!==`docs`?t.currentUrl:i===`home`?`nextclaw://new-tab`:i===`docs`?Wi():`about:blank`),o=i===`docs`?Yi(a,`docs`):a;return{historyPolicy:`managed`,kind:i,title:i===`home`?b(`docBrowserHomeTitle`):zi(o,i,i===`docs`?b(`docBrowserHelp`):`Detail`),url:o}},this.areUrlsEquivalent=(e,t,n,r)=>n===r?n===`docs`?Pi(e)===Pi(t):e===t:!1,this.usesManagedHistory=e=>e.currentUrl!==Ji}};function C9(e,t,n){return{...e,tabs:e.tabs.map(e=>e.id===t?n(e):e)}}function w9(e,t){return C9(e,e.activeTabId,t)}function Qoe(e,t,n){let r=t.resourceUri??t.url,i=n.resourceUri??n.url;return t.tabId===n.tabId&&t.kind===n.kind&&e.areUrlsEquivalent(r,i,t.kind,n.kind)}function T9(e,t){return{kind:t.kind,resourceUri:t.resourceUri??t.url,tabId:e,url:t.url}}function E9(e,t,n){let r=oi({entries:t.activeHistory,index:t.activeHistoryIndex},n,(t,n)=>Qoe(e,t,n));return{...t,activeHistory:[...r.entries],activeHistoryIndex:r.index}}function $oe(e,t,n){for(let r=t.history.length-1;r>=0;--r)if(e.areUrlsEquivalent(t.history[r],n,t.kind,t.kind))return r;return-1}function D9(e,t,n){let r=t.tabs.find(e=>e.id===n.tabId);if(!r)return t;let i=n.resourceUri??n.url,a=e.resolveOpenTarget({activeTab:r,kind:n.kind,url:i}),o=$oe(e,r,a.url),s=n.resourceUri!==void 0&&n.resourceUri===r.resourceUri;return C9({...t,activeTabId:r.id,isOpen:!0},r.id,e=>({...e,currentUrl:a.url,dedupeKey:a.dedupeKey,dockIcon:a.dockIcon??e.dockIcon,historyIndex:o>=0?o:e.historyIndex,kind:a.kind,resourceUri:a.resourceUri??a.url,title:s?e.title:a.title}))}function ese(e,t){return!e.isOpen&&e.tabs.length===1&&t?.kind===`home`&&t.currentUrl===`nextclaw://new-tab`}function O9(e,t,n,r){let{activate:i,dedupeKey:a,newTab:o,title:s}=r??{},c=a?.trim()||n.dedupeKey,l=t.tabs.find(e=>e.id===t.activeTabId)??t.tabs[0],u=c?t.tabs.find(e=>e.dedupeKey===c):void 0;if(u){let a=C9(t,u.id,t=>Vi(e,t,n,r,c)),o=i!==!1,s=o?u.id:t.activeTabId,l={...a,activeTabId:s,isOpen:!0};return o||u.id===t.activeTabId?E9(e,l,T9(u.id,n)):l}if(o||c||!l||l.kind!==n.kind){let i=Ki(n.url,n.kind,s??n.title,c,n.resourceUri??n.url,r?.dockIcon??n.dockIcon,n.contentParams);return ese(t,l)?{...t,isOpen:!0,tabs:[i],activeTabId:i.id,activeHistory:[Ui(i)],activeHistoryIndex:0}:E9(e,{...t,isOpen:!0,tabs:[...t.tabs,i],activeTabId:i.id},Ui(i))}return E9(e,{...w9(t,t=>Vi(e,t,n,r,c)),isOpen:!0},T9(t.activeTabId,n))}function tse(e,t,n,r){let i=t.tabs.find(e=>e.id===t.activeTabId)??t.tabs[0];return O9(e,t,{...e.resolveOpenTarget({activeTab:i,kind:r?.kind,url:n}),contentParams:r?.contentParams},r)}var nse=class{constructor(e=Zoe,t){this.routeResolver=e,this.onRightPanelOpened=t,this.setSnapshot=e=>{Gi.getState().setSnapshot(e)},this.open=(e,t)=>{this.setSnapshot(n=>tse(this.routeResolver,n,e,t)),this.onRightPanelOpened?.()},this.openTarget=(e,t)=>{this.setSnapshot(n=>O9(this.routeResolver,n,e,{...t,dedupeKey:t?.dedupeKey??e.dedupeKey,kind:t?.kind??e.kind,title:t?.title??e.title})),this.onRightPanelOpened?.()},this.reloadByDedupeKeys=e=>{let t=new Set(e);t.size!==0&&this.setSnapshot(e=>({...e,tabs:e.tabs.map(e=>t.has(e.dedupeKey??``)?{...e,navVersion:e.navVersion+1}:e)}))},this.openNewTab=()=>{this.open(void 0,{kind:Li,newTab:!0})},this.close=()=>{this.setSnapshot(e=>({...e,isOpen:!1}))},this.toggleMode=()=>{this.setSnapshot(e=>({...e,mode:e.mode===`floating`?`docked`:`floating`})),this.onRightPanelOpened?.()},this.setDockedWidth=e=>{this.setSnapshot(t=>({...t,dockedWidth:Ii(e)}))},this.navigate=e=>{this.setSnapshot(t=>{if(!t.tabs.length){let e=Ki(Wi(),`docs`,`Docs`);return{...t,tabs:[e],activeTabId:e.id,isOpen:!0}}let n=w9(t,t=>{if(!this.routeResolver.usesManagedHistory(t))return t;let n=this.routeResolver.resolveOpenTarget({activeTab:t,url:e});return this.routeResolver.areUrlsEquivalent(t.currentUrl,n.url,t.kind,n.kind)?t:{...t,currentUrl:n.url,dedupeKey:n.dedupeKey,dockIcon:n.dockIcon,...Bi(t,n.url),kind:n.kind,navVersion:t.navVersion+1,resourceUri:n.resourceUri??n.url,title:n.title}}),r=n.tabs.find(e=>e.id===n.activeTabId);return r?E9(this.routeResolver,n,Ui(r)):n})},this.syncUrl=e=>{this.setSnapshot(t=>{if(!t.tabs.length){let e=Ki(Wi(),`docs`,`Docs`);return{...t,tabs:[e],activeTabId:e.id}}let n=w9(t,t=>{if(!this.routeResolver.usesManagedHistory(t))return t;let n=this.routeResolver.resolveOpenTarget({activeTab:t,kind:t.kind,url:e});return this.routeResolver.areUrlsEquivalent(t.currentUrl,n.url,t.kind,n.kind)?t:{...t,currentUrl:n.url,dedupeKey:n.dedupeKey,dockIcon:n.dockIcon,...Bi(t,n.url),kind:n.kind,resourceUri:n.resourceUri??n.url,title:n.title}}),r=n.tabs.find(e=>e.id===n.activeTabId);return r?E9(this.routeResolver,n,Ui(r)):n})},this.goBack=()=>{this.setSnapshot(e=>{let t=si({entries:e.activeHistory,index:e.activeHistoryIndex},`back`);return t?D9(this.routeResolver,{...e,activeHistory:[...t.history.entries],activeHistoryIndex:t.history.index},t.entry):e})},this.goForward=()=>{this.setSnapshot(e=>{let t=si({entries:e.activeHistory,index:e.activeHistoryIndex},`forward`);return t?D9(this.routeResolver,{...e,activeHistory:[...t.history.entries],activeHistoryIndex:t.history.index},t.entry):e})},this.closeTab=e=>{this.setSnapshot(t=>{if(t.tabs.length<=1)return{...Fi(),isOpen:!1};let n=t.tabs.findIndex(t=>t.id===e);if(n<0)return t;let r=t.tabs.filter(t=>t.id!==e),i=t.activeTabId===e?r[Math.max(0,n-1)]?.id??r[0].id:t.activeTabId,a={...t,tabs:r,activeTabId:i},o=r.find(e=>e.id===i)??r[0],s=vi({entries:a.activeHistory,index:a.activeHistoryIndex},t=>t.tabId!==e,Ui(o)),c={...a,activeHistory:[...s.entries],activeHistoryIndex:s.index};return t.activeTabId===e?E9(this.routeResolver,c,Ui(o)):c})},this.setActiveTab=e=>{this.setSnapshot(t=>{if(!t.tabs.some(t=>t.id===e))return t;let n=t.tabs.find(t=>t.id===e);return n?E9(this.routeResolver,{...t,activeTabId:e,isOpen:!0},Ui(n)):t})}}};function rse(e){return e.activeWorkspacePanelKind!=null}var ise=class{constructor(){this.notificationManager=new Toe,this.inboxManager=new uae,this.chatCompletionNotificationManager=new Soe(this.notificationManager),this.accountManager=new $s,this.rightPanelResourceRouteResolver=new O1,this.notifyRightPanelOpened=()=>{let e=Gi.getState().snapshot,t=$.getState().snapshot;oc.collapseSidebarForDenseRightPanels({isDocBrowserDocked:e.mode===`docked`,isDocBrowserOpen:e.isOpen,isWorkspacePanelOpen:rse(t)})},this.docBrowserManager=new nse(this.rightPanelResourceRouteResolver,this.notifyRightPanelOpened),this.appPackageOperationSettlementManager=new B$(this.docBrowserManager),this.sideDockManager=new Xoe(this.docBrowserManager),this.chatComposerIntentManager=new _oe,this.chatDraftIntentManager=new goe,this.serviceActionAuthorizationManager=new h$,this.panelAppBridgeManager=new V1(this.serviceActionAuthorizationManager),this.remoteAccessManager=new Fs({accountManager:this.accountManager})}},k9=null;function A9(){return k9??=new ise,k9}function j9(){return A9()}var M9=globalThis,N9=M9.__NEXTCLAW_APP_PRESENTER_CONTEXT__??(0,H.createContext)(null);M9.__NEXTCLAW_APP_PRESENTER_CONTEXT__=N9;function ase({children:e}){let t=(0,H.useMemo)(()=>A9(),[]);return(0,U.jsx)(N9.Provider,{value:t,children:e})}function P9(){let e=(0,H.useContext)(N9);if(!e)throw Error(`useAppPresenter must be used inside AppPresenterProvider`);return e}function ose(){let e=P9();return(0,H.useEffect)(()=>(e.chatCompletionNotificationManager.start(),()=>{e.chatCompletionNotificationManager.stop()}),[e.chatCompletionNotificationManager]),null}var sse=`NextClaw`,cse=[{prefix:`/marketplace/mcp`,key:`marketplaceMcpPageTitle`},{prefix:`/marketplace/skills`,key:`marketplaceSkillsPageTitle`},{prefix:`/marketplace`,key:`marketplace`},{prefix:`/skills`,key:`marketplaceSkillsPageTitle`},{prefix:`/cron`,key:`cronPageTitle`},{prefix:`/agents`,key:`agentsPageTitle`},{prefix:`/chat`,key:`chat`},{prefix:`/model`,key:`modelPageTitle`},{prefix:`/search`,key:`searchPageTitle`},{prefix:`/providers`,key:`providersPageTitle`},{prefix:`/channels`,key:`channelsPageTitle`},{prefix:`/runtime`,key:`runtimePageTitle`},{prefix:`/updates`,key:`runtimeUpdatesPageTitle`},{prefix:`/remote`,key:`remotePageTitle`},{prefix:`/security`,key:`authSecurityTitle`},{prefix:`/secrets`,key:`secretsPageTitle`}];function lse(e,t){return e===t||e.startsWith(`${t}/`)}function use(e){let t=e.toLowerCase();for(let{prefix:e,key:n}of cse)if(lse(t,e))return b(n);return b(`settings`)}function dse(e){let t=e.toLowerCase();return t===`localhost`||t.endsWith(`.localhost`)||t===`::1`||t===`[::1]`||t.startsWith(`127.`)}function fse(e){let t=e?.host.trim(),n=e?.hostname.trim(),r=e?.port.trim();return!t||!n?null:dse(n)?r||null:t}function pse(e,t){let n=fse(t);return`${sse}${n?` ${n}`:``} - ${use(e)}`}var F9={...R1,...see};function mse({children:e,sideDockManager:t}){let{isOpen:n,mode:r}=Hi();iee();let{pathname:i}=_e(),a=ce(),o=j9(),{language:s}=Wn(),{isMobile:c}=k8(),l=W7(),u=g9(e=>e.isVisible);g9(e=>e.pinnedItems);let d={getDockState:t.getDockState,pinTab:t.pinTab,unpinTab:t.unpinTab},f=(0,H.useCallback)(e=>{let t=$$(e);if(t)return[{key:`chat`,items:[{key:`add-to-chat`,icon:(0,U.jsx)(xo,{className:`h-4 w-4`}),label:b(`docBrowserAddToChat`),restoreFocus:!1,onSelect:()=>{let e=i===`/chat`||i.startsWith(`/chat/`),n=i===`/chat`?null:Q7(i.slice(6));o.chatComposerIntentManager.requestUiResourceReference({targetSessionKey:e?n:null,reference:t}),e||a(Z7)}}]}]},[a,i,o]);return(0,H.useEffect)(()=>{document.title=pse(i,window.location)},[i,s]),c&&l!==`win32`?(0,U.jsx)(Uae,{pathname:i,isDocBrowserOpen:n,docBrowserDockControls:d,docBrowserRenderers:F9,docBrowserTabMenuGroups:f,topbarLeadingInset:l===`darwin`?`4.75rem`:void 0,children:e}):(0,U.jsx)(Kae,{pathname:i,isMobileLayout:c,isDocBrowserOpen:n,docBrowserMode:r,docBrowserDockControls:d,docBrowserRenderers:F9,docBrowserTabMenuGroups:f,sideDock:u?(0,U.jsx)(Woe,{manager:t}):null,children:e})}function hse({children:e}){let t=j9();return(0,U.jsx)(qi,{manager:t.docBrowserManager,children:(0,U.jsx)(mse,{sideDockManager:t.sideDockManager,children:e})})}function gse(){let{isMobile:e}=k8();return e?(0,U.jsx)(Wae,{}):(0,U.jsx)(he,{to:`/model`,replace:!0})}var I9=new Intl.NumberFormat;function _se({agent:e,defaults:t,runtimeOptions:n,defaultRuntime:r,defaultRuntimeLabel:i,onOpenChange:a,onEdit:o}){if(!e)return null;let s=L9(e.model,t?.model),c=vse({agent:e,defaults:t,runtimeOptions:n,defaultRuntime:r,defaultRuntimeLabel:i}),l=R9(e.contextTokens,t?.contextTokens??2e5),u=R9(e.reservedContextTokens,t?.reservedContextTokens),d=L9(e.thinkingDefault,t?.thinkingDefault??`off`),f=B9(e.runtimeConfig??e.engineConfig,t?.engineConfig),p=B9(e.models,t?.models);return(0,U.jsx)(Ur,{open:e!==null,onOpenChange:a,children:(0,U.jsxs)(Kr,{className:`flex max-h-[calc(100vh-2rem)] flex-col overflow-hidden border-none bg-popover p-0 sm:max-h-[720px] sm:max-w-2xl`,children:[(0,U.jsx)(`div`,{className:`shrink-0 px-5 pb-3 pt-5`,children:(0,U.jsx)(Wr,{className:`text-left`,children:(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,U.jsx)(az,{agentId:e.id,displayName:e.displayName,avatarUrl:e.avatarUrl,className:`h-10 w-10 shrink-0`}),(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(qr,{className:`truncate text-base`,children:e.displayName?.trim()||e.id}),(0,U.jsxs)(Br,{className:`truncate text-xs`,children:[`@`,e.id]})]})]})})}),(0,U.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto overscroll-contain px-5 py-3`,children:[(0,U.jsxs)(H9,{icon:oa,title:b(`agentsDetailsIdentitySection`),children:[(0,U.jsx)(U9,{label:b(`agentsDetailsFieldDisplayName`),value:e.displayName?.trim()||e.id}),(0,U.jsx)(U9,{label:b(`agentsDetailsFieldId`),value:e.id,mono:!0}),(0,U.jsx)(U9,{label:b(`agentsDetailsFieldDescription`),value:e.description?.trim()||b(`agentsDetailsEmptyValue`),wide:!0}),(0,U.jsx)(U9,{label:b(`agentsDetailsFieldWorkspace`),value:e.workspace??b(`agentsDetailsUnsetValue`),mono:!0,wide:!0})]}),(0,U.jsxs)(H9,{icon:Fr,title:b(`agentsDetailsRuntimeSection`),children:[(0,U.jsx)(U9,{label:b(`agentsDetailsFieldModel`),value:s.value,source:s.source}),(0,U.jsx)(U9,{label:b(`agentsDetailsFieldRuntime`),value:c.value,source:c.source}),(0,U.jsx)(U9,{label:b(`agentsDetailsFieldRuntimeConfig`),value:f.value,source:f.source,mono:!0,prewrap:!0})]}),(0,U.jsxs)(H9,{icon:Za,title:b(`agentsDetailsContextSection`),children:[(0,U.jsx)(U9,{label:b(`agentsDetailsFieldContextTokens`),value:l.value,source:l.source}),(0,U.jsx)(U9,{label:b(`agentsDetailsFieldReservedContextTokens`),value:u.value,source:u.source})]}),(0,U.jsxs)(H9,{icon:ca,title:b(`agentsDetailsBehaviorSection`),children:[(0,U.jsx)(U9,{label:b(`agentsDetailsFieldThinkingDefault`),value:d.value,source:d.source}),(0,U.jsx)(U9,{label:b(`agentsDetailsFieldModelOverrides`),value:p.value,source:p.source,mono:!0,prewrap:!0}),(0,U.jsx)(U9,{label:b(`agentsDetailsFieldAvatar`),value:e.avatar??b(`agentsDetailsUnsetValue`),mono:!0})]})]}),(0,U.jsxs)(Pr,{className:`shrink-0 px-5 pb-4 pt-2`,children:[(0,U.jsx)(R,{type:`button`,variant:`ghost`,onClick:()=>a(!1),children:b(`cancel`)}),(0,U.jsxs)(R,{type:`button`,variant:`primary`,className:`px-4`,onClick:()=>o(e),children:[(0,U.jsx)(Ho,{className:`mr-2 h-4 w-4`}),b(`agentsDetailsEditAction`)]})]})]})})}function L9(e,t){let n=e?.trim();return n?{value:n,source:`override`}:{value:t?.trim()||b(`agentsDetailsUnsetValue`),source:`default`}}function R9(e,t){return typeof e==`number`?{value:I9.format(e),source:`override`}:{value:typeof t==`number`?I9.format(t):b(`agentsDetailsUnsetValue`),source:`default`}}function vse(e){let{agent:t,defaults:n,runtimeOptions:r,defaultRuntime:i,defaultRuntimeLabel:a}=e,o=t.runtime?.trim()||t.engine?.trim();if(o)return{value:z9(o,r,a),source:`override`};let s=n?.engine?.trim()||i;return{value:s?z9(s,r,a):a,source:`default`}}function z9(e,t,n){let r=EL(e);return r?t.find(e=>e.value===r)?.label??OL(r):n}function B9(e,t){return V9(e)?{value:JSON.stringify(e,null,2),source:`override`}:{value:V9(t)?JSON.stringify(t,null,2):b(`agentsDetailsUnsetValue`),source:`default`}}function V9(e){return!!(e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length>0)}function H9(e){let{icon:t,title:n,children:r}=e;return(0,U.jsxs)(`section`,{className:`space-y-2 border-t border-border/60 pt-3 first:border-t-0 first:pt-0`,children:[(0,U.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-xs font-semibold leading-5 text-foreground`,children:[(0,U.jsx)(t,{className:`h-3.5 w-3.5 text-muted-foreground`}),n]}),(0,U.jsx)(`dl`,{className:`grid min-w-0 gap-x-6 gap-y-2.5 pl-5 sm:grid-cols-2`,children:r})]})}function U9(e){let{label:t,value:n,source:r,mono:i=!1,prewrap:a=!1,wide:o=!1}=e,s=a&&n.trim().startsWith(`{`),c=i&&(!a||s);return(0,U.jsxs)(`div`,{className:u(`grid min-w-0 grid-cols-[10rem_minmax(0,1fr)] items-baseline gap-x-2`,(o||s)&&`sm:col-span-2`),children:[(0,U.jsx)(`dt`,{className:`flex min-w-0 items-baseline leading-5`,children:(0,U.jsx)(`span`,{className:`whitespace-nowrap text-xs font-medium text-muted-foreground`,children:t})}),(0,U.jsxs)(`dd`,{className:u(`min-w-0 break-words text-xs leading-5 text-foreground`,s?`max-h-28 overflow-auto whitespace-pre-wrap rounded bg-muted/50 px-2 py-1.5 text-left`:``),children:[(0,U.jsx)(`span`,{className:c?`font-mono`:void 0,children:n}),r?(0,U.jsx)(yse,{source:r}):null]})]})}function yse({source:e}){return(0,U.jsxs)(`span`,{className:u(`ml-1 whitespace-nowrap text-xs font-normal leading-5`,e===`override`?`text-blue-500`:`text-muted-foreground`),children:[`(`,b(e===`override`?`agentsDetailsAgentOverride`:`agentsDetailsInheritedDefault`),`)`]})}function bse({form:e,disabled:t=!1,onChange:n}){return(0,U.jsxs)(`details`,{className:`group rounded-2xl border border-border bg-card`,children:[(0,U.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-3 text-sm font-semibold text-foreground [&::-webkit-details-marker]:hidden`,children:[(0,U.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,U.jsx)(Xo,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,U.jsx)(`span`,{className:`truncate`,children:b(`agentsAdvancedConfigToggle`)})]}),(0,U.jsx)(ar,{className:`h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180`})]}),(0,U.jsxs)(`div`,{className:`space-y-4 border-t border-border/60 px-4 py-4`,children:[(0,U.jsx)(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:b(`agentsAdvancedConfigDescription`)}),(0,U.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:(0,U.jsx)(xse,{label:b(`agentsAdvancedContextTokensLabel`),value:e.contextTokens,min:1e3,step:1e3,disabled:t,onChange:e=>n({contextTokens:e})})})]})]})}function xse(e){let{label:t,value:n,min:r,step:i,disabled:a,onChange:o}=e;return(0,U.jsxs)(`label`,{className:`space-y-2 text-sm font-medium text-foreground`,children:[(0,U.jsx)(`span`,{children:t}),(0,U.jsx)(St,{type:`number`,min:r,step:i,value:n,disabled:a,placeholder:b(`agentsAdvancedInheritPlaceholder`),"aria-label":t,onChange:e=>o(e.target.value)})]})}function Sse(e){return{displayName:e.displayName??``,description:e.description??``,avatar:e.avatar??``,model:e.model??``,runtime:e.runtime??e.engine??``,contextTokens:Cse(e.contextTokens)}}function Cse(e){return typeof e==`number`?String(e):``}var wse=xF(`15rem`);function Tse(e){return[...new Set(e.map(e=>e.trim()).filter(Boolean))]}function Ese({id:e,value:t,onChange:n,options:r,disabled:i=!1,placeholder:a,className:o,inputClassName:s,emptyText:c,createText:l,toggleLabel:d,maxItems:f=1/0,onEnter:p}){let[m,h]=(0,H.useState)(!1),g=(0,H.useRef)(null);(0,H.useEffect)(()=>{i&&m&&h(!1)},[i,m]);let _=(0,H.useMemo)(()=>Tse(r),[r]),v=t.trim().toLowerCase(),y=(0,H.useMemo)(()=>{let e=_.map((e,t)=>({option:e,index:t}));v.length>0&&e.sort((e,t)=>{let n=e.option.toLowerCase(),r=t.option.toLowerCase(),i=n===v?0:n.startsWith(v)?1:n.includes(v)?2:3,a=r===v?0:r.startsWith(v)?1:r.includes(v)?2:3;return i===a?e.index-t.index:i-a});let t=e.map(e=>e.option);return Number.isFinite(f)?t.slice(0,Math.max(1,f)):t},[_,v,f]),b=t.trim().length>0&&_.some(e=>e===t.trim()),x=()=>h(!1);return(0,U.jsxs)(CF,{open:m&&!i,onOpenChange:e=>h(!i&&e),children:[(0,U.jsx)(TF,{asChild:!0,children:(0,U.jsxs)(`div`,{ref:g,className:u(`relative`,o),children:[(0,U.jsx)(St,{id:e,value:t,disabled:i,onFocus:()=>{i||h(!0)},onChange:e=>{n(e.target.value),!m&&!i&&h(!0)},onKeyDown:e=>{e.key===`Enter`&&(p&&(e.preventDefault(),p()),x())},placeholder:a,className:u(`pr-10`,s)}),(0,U.jsx)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>h(e=>!e),disabled:i,className:u(`absolute inset-y-0 right-0 inline-flex w-10 items-center justify-center`,i?`cursor-not-allowed text-gray-300`:`text-gray-400 hover:text-gray-600`),"aria-label":d,children:(0,U.jsx)(vee,{className:`h-4 w-4`})})]})}),(0,U.jsx)(EF,{align:`start`,className:`flex w-[var(--radix-popover-trigger-width)] min-w-[12rem] flex-col overflow-hidden rounded-xl border border-gray-200 p-0 shadow-lg`,onInteractOutside:e=>{e.target instanceof Node&&g.current?.contains(e.target)&&e.preventDefault()},onOpenAutoFocus:e=>e.preventDefault(),style:{maxHeight:wse},children:(0,U.jsxs)(`div`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto py-1`,children:[!b&&t.trim().length>0&&(0,U.jsxs)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>{n(t.trim()),x()},className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-gray-50`,children:[(0,U.jsx)(Ar,{className:`h-4 w-4 text-transparent`}),(0,U.jsx)(`span`,{className:`truncate text-gray-700`,children:l.replace(`{value}`,t.trim())})]}),y.map(e=>(0,U.jsxs)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>{n(e),x()},className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-gray-50`,children:[(0,U.jsx)(Ar,{className:u(`h-4 w-4`,e===t.trim()?`text-primary`:`text-transparent`)}),(0,U.jsx)(`span`,{className:`truncate text-gray-700`,children:e})]},e)),y.length===0&&t.trim().length===0&&(0,U.jsx)(`div`,{className:`px-3 py-2 text-sm text-gray-500`,children:c})]})})]})}var Dse=`provider/model`;function W9(e){let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return[...t]}function G9({id:e,value:t,onChange:n,providerCatalog:r,disabled:i=!1,providerPlaceholder:a,modelPlaceholder:o,className:s}){let[c,l]=(0,H.useState)(``),[u,d]=(0,H.useState)(``),f=r.length>0,p=o??Dse,m=(0,H.useMemo)(()=>new Map(r.map(e=>[e.name,e])),[r]),h=m.get(c),g=(0,H.useMemo)(()=>h?.aliases??[],[h]),_=(0,H.useMemo)(()=>W9(h?.models??[]),[h]);return(0,H.useEffect)(()=>{let e=t.trim();if(!f){l(``),d(e);return}if(!e){d(``),l(e=>m.has(e)?e:``);return}let n=o6(e,r)??``,i=m.get(n)?.aliases??[];l(n),d(n?Q3(e,i):e)},[f,r,m,t]),f?(0,U.jsxs)(`div`,{className:s,children:[(0,U.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,U.jsx)(`div`,{className:`sm:w-[38%] sm:min-w-[170px]`,children:(0,U.jsxs)(Dr,{value:c,onValueChange:e=>{let t=W9(m.get(e)?.models??[])[0]??``;if(l(e),d(t),!t){n(``);return}n($3(m.get(e)?.prefix??e,t))},disabled:i,children:[(0,U.jsx)(yr,{className:`h-10 w-full rounded-xl`,children:(0,U.jsx)(fr,{placeholder:a??b(`providersSelectPlaceholder`)})}),(0,U.jsx)(Sr,{children:r.map(e=>(0,U.jsx)(Tr,{value:e.name,children:e.displayName},e.name))})]})}),(0,U.jsx)(`span`,{className:`hidden h-10 items-center justify-center leading-none text-lg font-semibold text-gray-300 sm:inline-flex`,children:`/`}),(0,U.jsx)(Ese,{id:e,value:u,onChange:e=>{if(!h){let t=e.trim();d(t),n(t);return}let t=Q3(e,g);d(t),n(t?$3(h.prefix,t):``)},options:_,disabled:i||!c,placeholder:p,className:`sm:flex-1`,inputClassName:`h-10 rounded-xl`,emptyText:b(`modelPickerNoOptions`),createText:b(`modelPickerUseCustom`),toggleLabel:b(`modelPickerToggleOptions`)},c)]}),(0,U.jsx)(`p`,{className:`mt-2 text-xs text-gray-500`,children:b(`modelInputCustomHint`)})]}):(0,U.jsxs)(`div`,{className:s,children:[(0,U.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 px-4 py-3`,children:[(0,U.jsx)(`p`,{className:`text-sm font-semibold text-amber-950`,children:b(`providersEmptyTitle`)}),(0,U.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-amber-900`,children:b(`providersEmptyDescription`)})]}),(0,U.jsx)(St,{id:e,value:t,disabled:i,onChange:e=>n(e.target.value),placeholder:p,className:`mt-3 h-10 rounded-xl`}),(0,U.jsx)(`p`,{className:`mt-2 text-xs text-gray-500`,children:b(`modelInputCustomHint`)})]})}function Ose(e){let{runtimeOptions:t,currentRuntime:n}=e,r=n.trim();if(!r)return t;let i=EL(r);return t.some(e=>e.value===i)?t:[...t,{value:i,label:OL(i),icon:null,ready:!1,reason:`unavailable`,reasonMessage:null,supportedModels:void 0,recommendedModel:null,cta:null}].sort((e,t)=>e.value===`native`?-1:t.value===`native`?1:e.value.localeCompare(t.value))}function kse({value:e,disabled:t=!1,runtimeOptions:n,defaultRuntime:r,onChange:i}){let a=e.trim()?EL(e):``,o=Ose({runtimeOptions:n,currentRuntime:e}),s=o.find(e=>e.value===a)??null,c=s?.reasonMessage?.trim()||(s?.ready===!1?b(`agentsRuntimeUnavailableHelp`):``);return(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsxs)(Dr,{value:a||r,onValueChange:e=>i(e===r?``:e),disabled:t,children:[(0,U.jsx)(yr,{"aria-label":b(`agentsCardRuntimeLabel`),className:`rounded-xl`,children:(0,U.jsx)(fr,{placeholder:b(`agentsRuntimeSelectPlaceholder`)})}),(0,U.jsx)(Sr,{className:`rounded-xl`,children:o.map(e=>(0,U.jsx)(Tr,{value:e.value,disabled:e.ready===!1&&e.value!==a,className:`rounded-lg`,children:e.label},e.value))})]}),c?(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:c}):null]})}function Ase({agent:e,pending:t,providerCatalog:n,runtimeOptions:r,defaultRuntime:i,onOpenChange:a,onSubmit:o}){return(0,U.jsx)(Ur,{open:e!==null,onOpenChange:a,children:e?(0,U.jsx)(jse,{agent:e,pending:t,providerCatalog:n,runtimeOptions:r,defaultRuntime:i,onOpenChange:a,onSubmit:o},e.id):null})}function jse(e){let{agent:t,pending:n,providerCatalog:r,runtimeOptions:i,defaultRuntime:a,onOpenChange:o,onSubmit:s}=e,[c,l]=(0,H.useState)(Sse(t));return(0,U.jsxs)(Kr,{className:`flex max-h-[calc(100vh-2rem)] flex-col overflow-hidden border-none bg-popover p-0 sm:max-h-[760px] sm:max-w-xl`,children:[(0,U.jsx)(`div`,{className:`shrink-0 border-b border-border px-6 py-6`,children:(0,U.jsxs)(Wr,{className:`text-left`,children:[(0,U.jsx)(qr,{children:b(`agentsEditDialogTitle`)}),(0,U.jsx)(Br,{children:b(`agentsEditDialogDescription`)})]})}),(0,U.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-6 py-6`,children:(0,U.jsxs)(`div`,{className:`space-y-4`,children:[(0,U.jsx)(Dn,{tone:`warning`,title:b(`agentsEditHomeReadonly`),description:b(`agentsEditHomeReadonlyHint`),children:(0,U.jsx)(`div`,{className:`break-all text-sm text-amber-950`,children:t.workspace??`-`})}),(0,U.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,U.jsx)(St,{value:c.displayName,onChange:e=>l(t=>({...t,displayName:e.target.value})),placeholder:b(`agentsFormNamePlaceholder`)}),(0,U.jsx)(Vn,{value:c.description,onChange:e=>l(t=>({...t,description:e.target.value})),placeholder:b(`agentsFormDescriptionPlaceholder`),rows:4,className:`md:col-span-2`}),(0,U.jsx)(St,{value:c.avatar,onChange:e=>l(t=>({...t,avatar:e.target.value})),placeholder:b(`agentsFormAvatarPlaceholder`)}),(0,U.jsx)(G9,{value:c.model,onChange:e=>l(t=>({...t,model:e})),providerCatalog:r,disabled:n,className:`md:col-span-2`}),(0,U.jsx)(kse,{value:c.runtime,onChange:e=>l(t=>({...t,runtime:e})),runtimeOptions:i,defaultRuntime:a,disabled:n})]}),(0,U.jsx)(bse,{form:c,disabled:n,onChange:e=>l(t=>({...t,...e}))})]})}),(0,U.jsxs)(Pr,{className:`shrink-0 border-t border-border px-6 py-5`,children:[(0,U.jsx)(R,{type:`button`,variant:`ghost`,onClick:()=>o(!1),disabled:n,children:b(`cancel`)}),(0,U.jsxs)(R,{type:`button`,variant:`primary`,className:`rounded-2xl px-5`,onClick:()=>s(t.id,c),disabled:n,children:[(0,U.jsx)(Ho,{className:`mr-2 h-4 w-4`}),b(`agentsEditSaveAction`)]})]})]})}var Mse=`请直接创建一个默认示例 Agent,不要问我问题。创建完成后,简单告诉我它能做什么。`;function Nse(e){let t=e.trim();if(!t)return null;let n=Number(t);if(!Number.isFinite(n))throw Error(b(`agentsAdvancedInvalidNumberError`));return Math.trunc(n)}function Pse(e){return{displayName:e.displayName,description:e.description,avatar:e.avatar,model:e.model,...e.runtime.trim()?{runtime:e.runtime.trim()}:{runtime:``},contextTokens:Nse(e.contextTokens)}}function K9(e){let{icon:t,label:n,disabled:r=!1,destructive:i=!1,onClick:a}=e;return(0,U.jsxs)(`button`,{type:`button`,className:u(`flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50`,i?`text-destructive hover:bg-destructive/10`:`text-foreground hover:bg-muted`),onClick:a,disabled:r,children:[(0,U.jsx)(t,{className:`h-4 w-4 shrink-0`}),(0,U.jsx)(`span`,{children:n})]})}function Fse(e){let{agent:t,runtimeOptions:n,defaultRuntimeLabel:r,updatePending:i,deletePending:a,onStartChat:o,onView:s,onEdit:c,onDelete:l}=e,u=t.runtime?.trim()||t.engine?.trim()||``,d=u?n.find(e=>e.value===EL(u))?.label??OL(u):r;return(0,U.jsx)(Ks,{className:`group overflow-hidden border border-border bg-card shadow-none transition-colors duration-200 hover:border-border/80`,children:(0,U.jsxs)(Xs,{className:`relative flex h-full flex-col gap-3 px-3.5 py-3.5`,children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-2.5 pr-16`,children:[(0,U.jsx)(az,{agentId:t.id,displayName:t.displayName,avatarUrl:t.avatarUrl,className:`h-9 w-9 shrink-0`}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,U.jsx)(`div`,{className:`truncate text-sm font-semibold text-foreground`,children:t.displayName?.trim()||t.id}),t.builtIn?(0,U.jsxs)(Xi,{tone:`warning`,className:`h-5 gap-1 border-amber-200 bg-amber-50 px-1.5 text-[10px] text-amber-700`,children:[(0,U.jsx)($o,{className:`h-3 w-3`}),b(`agentsCardBuiltInTag`)]}):null]}),(0,U.jsxs)(`div`,{className:`truncate text-xs text-muted-foreground`,children:[`@`,t.id]})]})]}),(0,U.jsxs)(`div`,{className:`absolute right-2.5 top-2.5 flex items-center gap-1 opacity-100 transition-opacity md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100`,children:[(0,U.jsx)(R,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8 rounded-lg text-muted-foreground hover:text-foreground`,"aria-label":b(`agentsCardStartChat`),title:b(`agentsCardStartChat`),onClick:o,children:(0,U.jsx)(bo,{className:`h-4 w-4`})}),(0,U.jsxs)(CF,{children:[(0,U.jsx)(wF,{asChild:!0,children:(0,U.jsx)(R,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8 rounded-lg text-muted-foreground hover:text-foreground`,"aria-label":b(`chatSessionMoreActions`),title:b(`chatSessionMoreActions`),children:(0,U.jsx)(Aa,{className:`h-4 w-4`})})}),(0,U.jsxs)(EF,{align:`end`,className:`w-44 p-1.5`,children:[(0,U.jsx)(K9,{icon:Ma,label:b(`agentsViewDetailsAction`),onClick:s}),(0,U.jsx)(K9,{icon:Ho,label:b(`agentsEditAction`),onClick:c,disabled:i}),t.builtIn?null:(0,U.jsx)(K9,{icon:fs,label:b(`agentsRemoveAction`),onClick:l,disabled:a,destructive:!0})]})]})]}),(0,U.jsx)(`p`,{className:`line-clamp-2 min-h-10 text-sm leading-5 text-muted-foreground`,children:t.description?.trim()||(t.builtIn?b(`agentsCardBuiltInSummary`):b(`agentsCardCustomSummary`))}),(0,U.jsxs)(`div`,{className:`mt-auto grid gap-2 border-t border-border/60 pt-2 text-xs text-muted-foreground`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,U.jsx)(Fr,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground/60`}),(0,U.jsx)(`span`,{className:`truncate`,children:d})]}),(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,U.jsx)(ro,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground/60`}),(0,U.jsx)(`span`,{className:`truncate`,children:t.workspace??`-`})]})]})]})})}function Ise(){let e=eI(),t=oz(),n=j6(),r=P6(),i=F6(),a=a9(),o=sz(),s=cz(),[c,l]=(0,H.useState)(null),[u,d]=(0,H.useState)(null),f=(0,H.useMemo)(()=>t.data?.agents??[],[t.data?.agents]),p=(0,H.useMemo)(()=>[...f].sort((e,t)=>Number(!!t.builtIn)-Number(!!e.builtIn)||e.id.localeCompare(t.id)),[f]),m=(0,H.useMemo)(()=>c6({config:n.data,providersView:r.data,templatesView:i.data,onlyConfigured:!0}),[n.data,r.data,i.data]),h=(0,H.useMemo)(()=>kL(a.data?.options??[]),[a.data?.options]),g=(0,H.useMemo)(()=>EL(a.data?.defaultType??`native`),[a.data?.defaultType]),_=(0,H.useMemo)(()=>h.find(e=>e.value===g)?.label??OL(g),[g,h]),v=n.data?.agents.defaults,y=e=>{l(e)},x=e=>{d(e)},S=async(e,t)=>{let n;try{n=Pse(t)}catch(e){L.error(e instanceof Error?e.message:b(`agentsAdvancedParseFailed`));return}await o.mutateAsync({agentId:e,data:n}),d(null)},C=t=>{e.chatSessionListManager.startAgentDraftChat(t.id,DL(t,g))},w=()=>{e.chatSessionListManager.startAgentDraftChat(`main`,g,Mse)};return(0,U.jsxs)(Bt,{className:`space-y-6`,children:[(0,U.jsx)(xt,{headingLevel:1,title:b(`agentsHeroEyebrow`),description:b(`agentsHeroDescription`),actions:(0,U.jsxs)(R,{type:`button`,variant:`primary`,className:`h-9 shrink-0 rounded-xl px-4 text-sm font-semibold`,onClick:w,children:[(0,U.jsx)(Di,{className:`mr-2 h-4 w-4`}),b(`agentsCreateButton`)]})}),(0,U.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-3`,children:t.isLoading?(0,U.jsx)(Ks,{className:`md:col-span-2 xl:col-span-3 border-dashed border-border bg-card/70`,children:(0,U.jsx)(Xs,{className:`py-14 text-center text-sm text-muted-foreground`,children:b(`agentsLoading`)})}):p.length===0?(0,U.jsx)(Ks,{className:`md:col-span-2 xl:col-span-3 overflow-hidden border-dashed border-border bg-gradient-subtle`,children:(0,U.jsxs)(Xs,{className:`flex min-h-[240px] flex-col items-center justify-center px-6 py-14 text-center`,children:[(0,U.jsx)(`div`,{className:`mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-card/80 shadow-[0_18px_44px_rgba(0,0,0,0.08)]`,children:(0,U.jsx)(oa,{className:`h-8 w-8 text-warning`})}),(0,U.jsx)(`div`,{className:`text-lg font-semibold text-foreground`,children:b(`agentsEmpty`)}),(0,U.jsx)(`p`,{className:`mt-2 max-w-md text-sm leading-6 text-muted-foreground`,children:b(`agentsEmptyDescription`)}),(0,U.jsxs)(R,{type:`button`,variant:`primary`,className:`mt-5 rounded-2xl px-5`,onClick:w,children:[(0,U.jsx)(Di,{className:`mr-2 h-4 w-4`}),b(`agentsCreateButton`)]})]})}):p.map(e=>(0,U.jsx)(Fse,{agent:e,runtimeOptions:h,defaultRuntimeLabel:_,updatePending:o.isPending,deletePending:s.isPending,onStartChat:()=>C(e),onView:()=>y(e),onEdit:()=>x(e),onDelete:()=>s.mutate({agentId:e.id})},e.id))}),(0,U.jsx)(_se,{agent:c,defaults:v,runtimeOptions:h,defaultRuntime:g,defaultRuntimeLabel:_,onOpenChange:e=>{e||l(null)},onEdit:e=>{l(null),d(e)}}),(0,U.jsx)(Ase,{agent:u,pending:o.isPending,providerCatalog:m,runtimeOptions:h,defaultRuntime:g,onOpenChange:e=>{!e&&!o.isPending&&d(null)},onSubmit:S})]})}var q9=`max-w-[min(1180px,100%)]`;function Lse(e){let{routeSessionKey:t,syncRouteSessionSelection:n}=e;(0,H.useLayoutEffect)(()=>{n(t)},[t,n])}function Rse({view:e,confirmDialog:t}){let{isMobile:n}=k8(),r=oY({restorationKey:`main-page:cron`}),i=oY({restorationKey:`main-page:agents`}),{onScroll:a,scrollRef:o}=r,{onScroll:s,scrollRef:c}=i;return(0,U.jsxs)(`div`,{className:`h-full flex`,children:[n?null:(0,U.jsx)(Y7,{}),e===`chat`?n?(0,U.jsx)(Gae,{}):(0,U.jsx)(Z5,{}):(0,U.jsx)(`section`,{"data-theme-surface":`workspace`,className:`flex-1 min-h-0 overflow-hidden bg-background`,children:e===`inbox`?(0,U.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 w-full flex-col py-4 sm:px-6 sm:py-5 ${q9}`,children:(0,U.jsx)(_ae,{})}):e===`panel-app`?(0,U.jsx)(z1,{}):e===`cron`?(0,U.jsx)(`div`,{ref:o,onScroll:a,className:`h-full overflow-auto custom-scrollbar`,children:(0,U.jsx)(`div`,{className:`mx-auto w-full px-4 py-4 sm:px-6 sm:py-5 ${q9}`,children:(0,U.jsx)(aie,{})})}):e===`agents`?(0,U.jsx)(`div`,{ref:c,onScroll:s,className:`h-full overflow-auto custom-scrollbar`,children:(0,U.jsx)(`div`,{className:`mx-auto w-full px-4 py-4 sm:px-6 sm:py-5 ${q9}`,children:(0,U.jsx)(Ise,{})})}):(0,U.jsx)(`div`,{className:`h-full overflow-hidden`,children:(0,U.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 w-full flex-col px-4 py-4 sm:px-6 sm:py-5 ${q9}`,children:(0,U.jsx)(_Q,{forcedType:`skills`})})})}),t]})}function zse(e){let t=eI(),n=j6(),r=P6(),i=F6(),a=sL({limit:200}),o=a9(),s=e.sessionKey?.trim()||`draft-session`,c=lL({sessionId:s});(0,H.useEffect)(()=>{t.chatQueryManager.syncSnapshot({configQuery:n,providersQuery:r,providerTemplatesQuery:i,sessionsQuery:a,sessionTypesQuery:o,sessionSkillsSessionId:s,sessionSkillsQuery:c})},[n,t.chatQueryManager,r,s,c,a,o,i])}function Bse(){let e=eI();(0,H.useEffect)(()=>I.eventBus.on(c.uiShowContent,t=>{e.chatThreadManager.handleUiShowContentEvent(t)}),[e])}function Vse(){let{sessionId:e}=le(),t=(0,H.useMemo)(()=>Q7(e),[e]);return{routeSessionKey:t,sessionKey:t??void 0}}function Hse(){let e=eI(),{confirm:t,ConfirmDialog:n}=On(),r=_e(),i=ce();return(0,H.useEffect)(()=>{e.chatUiManager.syncState({pathname:r.pathname}),e.chatUiManager.bindActions({navigate:i,confirm:t})},[t,r.pathname,i,e]),(0,U.jsx)(n,{})}function Use({view:e}){let t=P9();return(0,U.jsx)($F,{presenter:(0,H.useMemo)(()=>new hoe(t),[t]),children:(0,U.jsx)(Wse,{view:e})})}function Wse({view:e}){let t=P9(),n=eI(),r=Hse(),{routeSessionKey:i,sessionKey:a}=Vse(),o=$(e=>{let{snapshot:t}=e;return t.workspacePanelParentKey!==(a??null)||t.activeWorkspacePanelKind!==`child-session`?null:t.activeChildSessionKey?.trim()||null});return(0,H.useEffect)(()=>(t.chatCompletionNotificationManager.syncVisibleSessions([a,o]),()=>{t.chatCompletionNotificationManager.syncVisibleSessions([])}),[t.chatCompletionNotificationManager,a,o]),zse({sessionKey:a??null}),Lse({routeSessionKey:i,syncRouteSessionSelection:n.chatSessionListManager.syncRouteSessionSelection}),Bse(),(0,U.jsx)(Rse,{view:e,confirmDialog:r})}function J9({view:e}){return(0,U.jsx)(Use,{view:e})}var Y9=P(e=>({pending:null,present:t=>e({pending:t}),clear:()=>e({pending:null})})),Gse=`desktop.authorization.required`;function Kse(){let e=Y9(e=>e.pending),t=Y9(e=>e.present),n=Y9(e=>e.clear),[r,i]=(0,H.useState)(!1);(0,H.useEffect)(()=>I.eventBus.subscribeAll(e=>{if(e.type!==Gse)return;let n=qse(e.payload);n&&t(n)}),[t]);let a=async()=>{if(!(!e||r)){i(!0);try{await R7.grantAccess(e.request),await jt.invalidateQueries({queryKey:[`desktop-capability`,`grants`]}),n(),L.success(b(`desktopAuthorizationAllowed`))}catch(e){L.error(e instanceof Error?e.message:b(`desktopAuthorizationFailed`))}finally{i(!1)}}};return(0,U.jsx)(Ur,{open:!!e,onOpenChange:e=>{!e&&!r&&n()},children:(0,U.jsxs)(Kr,{className:`[&>:last-child]:hidden`,children:[(0,U.jsxs)(Wr,{children:[(0,U.jsxs)(qr,{className:`flex items-center gap-2`,children:[(0,U.jsx)(Qo,{className:`h-4 w-4 text-amber-600`}),b(`desktopAuthorizationTitle`)]}),(0,U.jsx)(Br,{children:b(`desktopAuthorizationDescription`)})]}),e?(0,U.jsxs)(`div`,{className:`space-y-3 rounded-xl bg-muted/55 p-4 text-sm`,children:[(0,U.jsx)(X9,{label:b(`desktopAuthorizationCaller`),value:Jse(e)}),(0,U.jsx)(X9,{label:b(`desktopAuthorizationApplication`),value:e.applicationId}),(0,U.jsx)(X9,{label:b(`desktopAuthorizationAccess`),value:e.request.access.map(Yse).join(`, `)}),(0,U.jsx)(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:Xse(e.request.access)})]}):null,(0,U.jsxs)(Pr,{className:`gap-2 sm:gap-0`,children:[(0,U.jsx)(R,{type:`button`,variant:`outline`,disabled:r,onClick:n,children:b(`desktopAuthorizationReject`)}),(0,U.jsx)(R,{type:`button`,disabled:r,onClick:()=>void a(),children:b(r?`desktopAuthorizationAllowing`:`desktopAuthorizationAllow`)})]})]})})}function X9({label:e,value:t}){return(0,U.jsxs)(`div`,{className:`grid grid-cols-[5rem_minmax(0,1fr)] gap-3`,children:[(0,U.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:e}),(0,U.jsx)(`div`,{className:`min-w-0 break-words text-xs text-foreground`,children:t})]})}function qse(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e,{request:n}=t;if(!n||typeof n!=`object`||Array.isArray(n))return null;let r=n;return typeof t.applicationId!=`string`||!r.subject||!r.resource||!Array.isArray(r.access)||typeof r.declarationFingerprint!=`string`?null:{applicationId:t.applicationId,request:r}}function Jse(e){let{subject:t}=e.request;return`${t.type===`agent`?b(`desktopCapabilitiesAgent`):b(`desktopCapabilitiesExtension`)} · ${t.id}`}function Yse(e){return e===`ui.read`?b(`desktopAuthorizationRead`):e===`ui.observe`?b(`desktopAuthorizationObserve`):e===`ui.write`?b(`desktopAuthorizationWrite`):e===`screen.capture-window`?b(`desktopAuthorizationScreenCapture`):e===`input.pointer`?b(`desktopAuthorizationPointerInput`):e}function Xse(e){return e.includes(`ui.write`)?b(`desktopAuthorizationWriteRisk`):e.includes(`screen.capture-window`)?b(`desktopAuthorizationScreenCaptureRisk`):e.includes(`input.pointer`)?b(`desktopAuthorizationPointerInputRisk`):b(`desktopAuthorizationReadRisk`)}function Zse(e){let t=e.trim().toLowerCase();return t?!t.startsWith(`skills`):!0}function Qse(e,t){t.startsWith(`mcp`)&&(e?.invalidateQueries({queryKey:[`marketplace-mcp-installed`]}),e?.invalidateQueries({queryKey:[`marketplace-mcp-items`]}),e?.invalidateQueries({queryKey:[`marketplace-mcp-doctor`]}))}function $se(e,t){e&&Zse(t)&&e.invalidateQueries({queryKey:[`config`]}),Qse(e,t)}function Z9(e){let t=e.trim().replace(/\\/g,`/`).replace(/\/+$/g,``);return/^[a-z]:/i.test(t)?t.toLowerCase():t}function ece(e,t){if(!e)return;let n=Z9(t);e.invalidateQueries({predicate:e=>e.queryKey[0]===`server-path-browse`&&typeof e.queryKey[1]==`string`&&Z9(e.queryKey[1])===n})}function tce(e){let t=(0,H.useRef)(!1);(0,H.useEffect)(()=>{let n=I.eventBus.on(c.connectionOpen,()=>{wt.handleConnectionRestored(),Re.refreshAfterRealtimeReconnect(),t.current&&(t.current=!1,e?.invalidateQueries({queryKey:[`ncp-sessions`]}))}),r=I.eventBus.on(c.connectionClose,()=>{wt.handleConnectionInterrupted(null),t.current=!0}),i=I.eventBus.on(c.connectionError,e=>{wt.handleConnectionInterrupted(e?.message??null),t.current=!0}),a=I.eventBus.on(c.configUpdated,({path:t})=>{$se(e,t)}),o=I.eventBus.on(c.serverPathChanged,({directoryPath:t})=>ece(e,t)),s=I.eventBus.on(c.runtimeUpdateSnapshot,e=>{Re.reportSnapshot(e)}),l=I.eventBus.on(c.sessionRunStatus,t=>{vn(e,{type:`session.run-status`,payload:t})}),u=I.eventBus.on(c.sessionSummaryUpsert,t=>{vn(e,{type:`session.summary.upsert`,payload:t})}),d=I.eventBus.on(c.sessionSummaryDelete,t=>{vn(e,{type:`session.summary.delete`,payload:t})}),f=I.eventBus.on(c.error,e=>{console.error(`Realtime transport error:`,e.message)});return()=>{n(),r(),i(),a(),o(),s(),l(),u(),d(),f()}},[e])}var nce={"--width":`320px`},rce=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{ModelConfigPage:e}=await import(`./model-config-page-B_w0J2p1.js`);return{ModelConfigPage:e}},__vite__mapDeps([40,4,41,28,32,30,33,1,34,42,38,39,43,44,45]))).ModelConfigPage})),ice=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{AppearanceSettingsPage:e}=await import(`./appearance-settings-page-Bh_65RFw.js`);return{AppearanceSettingsPage:e}},__vite__mapDeps([46,4,47,27,28,30,41,48,49,29,37,26,31,32,33,1,34,35,36,38,39,42,50,44]))).AppearanceSettingsPage})),ace=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{SearchConfigPage:e}=await import(`./search-config-page-C0YgfpcA.js`);return{SearchConfigPage:e}},__vite__mapDeps([51,4,47,27,28,30,41,31,33,1,34,52,43]))).SearchConfigPage})),oce=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{ProvidersConfigPage:e}=await import(`./providers-config-page-ONfW4tjw.js`);return{ProvidersConfigPage:e}},__vite__mapDeps([53,4,47,27,28,30,49,29,41,37,31,42,35,36,52,43,45,34]))).ProvidersConfigPage})),sce=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{ExtensionsConfigPage:e}=await import(`./extensions-C_FUBhUf.js`);return{ExtensionsConfigPage:e}},__vite__mapDeps([54,41,4,28,36,30]))).ExtensionsConfigPage})),cce=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{ChannelsList:e}=await import(`./channels-list-page-Bd3_YlyV.js`);return{ChannelsList:e}},__vite__mapDeps([55,4,47,27,28,30,41,31,32,33,1,34,42,37,52,50,43,45]))).ChannelsList})),lce=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{RuntimeConfig:e}=await import(`./runtime-config-page-CdwKIwZc.js`);return{RuntimeConfig:e}},__vite__mapDeps([56,4,47,27,28,30,41,48,49,29,37,26,31,32,33,1,34,35,36,38,39,42,50,44,57,58,43]))).RuntimeConfig})),uce=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{DesktopUpdateConfig:e}=await import(`./desktop-update-config-DsyKUJbp.js`);return{DesktopUpdateConfig:e}},__vite__mapDeps([59,47,4,27,28,30,41,33,1,34,36,57]))).DesktopUpdateConfig})),dce=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{SecurityConfig:e}=await import(`./security-config-CNdun2s-.js`);return{SecurityConfig:e}},__vite__mapDeps([60,41,4,28]))).SecurityConfig})),fce=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{SecretsConfigPage:e}=await import(`./secrets-config-page-Bb28CTv4.js`);return{SecretsConfigPage:e}},__vite__mapDeps([61,4,47,27,28,30,41,35,58,43]))).SecretsConfigPage})),pce=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{PrivacySettingsPage:e}=await import(`./privacy-settings-page-D3RzjGyz.js`);return{PrivacySettingsPage:e}},__vite__mapDeps([62,47,4,27,28,30,41]))).PrivacySettingsPage})),mce=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{DesktopCapabilitiesPage:e}=await import(`./desktop-capabilities-page-CQxp8NvQ.js`);return{DesktopCapabilitiesPage:e}},__vite__mapDeps([63,41,4,28]))).DesktopCapabilitiesPage})),hce=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{RemoteAccessPage:e}=await import(`./remote-DRh0aAHG.js`);return{RemoteAccessPage:e}},[])).RemoteAccessPage})),gce=(0,H.lazy)(async()=>({default:(await ae(async()=>{let{McpMarketplacePage:e}=await import(`./mcp-marketplace-page-Dj0xiFAV.js`);return{McpMarketplacePage:e}},__vite__mapDeps([64,48,4,47,27,28,30,49,29,41,37,26,31,32,33,1,34,35,36,38,39,42,50,44]))).McpMarketplacePage}));function _ce(){return(0,U.jsx)(`div`,{className:`h-full w-full animate-pulse rounded-2xl border border-border/40 bg-card/40`})}function vce({children:e}){return(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(_ce,{}),children:e})}function Q9(e){return(0,U.jsx)(vce,{children:e})}var yce=[{path:`/chat/skills`,redirectTo:`/skills`},{path:`/chat/cron`,redirectTo:`/cron`},{path:`/chat/agents`,redirectTo:`/agents`},{path:`/chat/:sessionId?`,element:Q9((0,U.jsx)(J9,{view:`chat`}))},{path:`/agents`,element:Q9((0,U.jsx)(J9,{view:`agents`}))},{path:`/skills`,element:Q9((0,U.jsx)(J9,{view:`skills`}))},{path:`/skills/scenes/:scene`,element:Q9((0,U.jsx)(J9,{view:`skills`}))},{path:`/cron`,element:Q9((0,U.jsx)(J9,{view:`cron`}))},{path:`/inbox/:deliveryId?`,element:Q9((0,U.jsx)(J9,{view:`inbox`}))},{path:`/apps/panel/:appId`,element:Q9((0,U.jsx)(J9,{view:`panel-app`}))},{path:`/appearance`,element:Q9((0,U.jsx)(ice,{}))},{path:`/model`,element:Q9((0,U.jsx)(rce,{}))},{path:`/search`,element:Q9((0,U.jsx)(ace,{}))},{path:`/providers`,element:Q9((0,U.jsx)(oce,{}))},{path:`/extensions`,element:Q9((0,U.jsx)(sce,{}))},{path:`/channels`,element:Q9((0,U.jsx)(cce,{}))},{path:`/runtime`,element:Q9((0,U.jsx)(lce,{}))},{path:`/updates`,element:Q9((0,U.jsx)(uce,{}))},{path:`/remote`,element:Q9((0,U.jsx)(hce,{}))},{path:`/security`,element:Q9((0,U.jsx)(dce,{}))},{path:`/privacy`,element:Q9((0,U.jsx)(pce,{}))},{path:`/desktop-capabilities`,element:Q9((0,U.jsx)(mce,{}))},{path:`/secrets`,element:Q9((0,U.jsx)(fce,{}))},{path:`/settings`,element:(0,U.jsx)(gse,{})},{path:`/marketplace/skills`,redirectTo:`/skills`},{path:`/marketplace`,redirectTo:`/skills`},{path:`/marketplace/mcp`,element:Q9((0,U.jsx)(gce,{}))},{path:`/`,redirectTo:`/chat`},{path:`*`,redirectTo:`/chat`}];function bce(e){return`redirectTo`in e?(0,U.jsx)(se,{path:e.path,element:(0,U.jsx)(he,{to:e.redirectTo,replace:!0})},e.path):(0,U.jsx)(se,{path:e.path,element:e.element},e.path)}function xce(){return(0,U.jsx)(de,{children:yce.map(bce)})}function $9(){return tce(jt),ye(),(0,H.useEffect)(()=>(Re.start(),()=>{Re.stop()}),[]),(0,U.jsxs)(ase,{children:[(0,U.jsx)(ose,{}),(0,U.jsx)(pae,{}),(0,U.jsx)(hse,{children:(0,U.jsx)(xce,{})}),(0,U.jsx)(Gs,{}),(0,U.jsx)(f$,{}),(0,U.jsx)(Kse,{})]})}function Sce(){let e=Se(),t=e.isError&&En(e.error);return e.isLoading&&!e.isError||t||e.isError?(0,U.jsx)($9,{}):e.data?.enabled&&!e.data.authenticated?(0,U.jsx)(Qs,{username:e.data.username}):(0,U.jsx)($9,{})}function Cce(){return(0,H.useEffect)(()=>{zie()},[]),(0,U.jsxs)(Lt,{client:jt,children:[(0,U.jsx)(Sce,{}),(0,U.jsx)(Lie,{}),(0,U.jsx)(Ot,{position:`top-right`,richColors:!0,offset:{top:window.nextclawDesktop?.platform===`win32`?56:44,right:72},mobileOffset:window.nextclawDesktop?.platform===`win32`?56:void 0,style:nce})]})}var wce=window.nextclawDesktop?.platform===`win32`?oe:me;(0,bs.createRoot)(document.getElementById(`root`)).render((0,U.jsx)(H.StrictMode,{children:(0,U.jsx)(Hie,{children:(0,U.jsx)(Mn,{children:(0,U.jsx)(wce,{children:(0,U.jsx)(Cce,{})})})})}));export{Xs as $,R6 as A,t6 as B,N6 as C,ao as Ct,K6 as D,fa as Dt,P6 as E,Aa as Et,Z6 as F,qY as G,t0 as H,J3 as I,ML as J,JY as K,c6 as L,V6 as M,X6 as N,W6 as O,na as Ot,B6 as P,Ks as Q,s6 as R,q6 as S,oo as St,F6 as T,Ma as Tt,KY as U,e6 as V,YY as W,EF as X,CF as Y,wF as Z,H6 as _,Zo as _t,Nae as a,Fs as at,Q6 as b,Uo as bt,Sae as c,ks as ct,Iie as d,Ns as dt,Ys as et,t7 as f,Ts as ft,L6 as g,ss as gt,M6 as h,fs as ht,kae as i,zs as it,z6 as j,Y6 as k,M7 as l,As as lt,j6 as m,Ss as mt,g9 as n,Js as nt,Mae as o,Ps as ot,k8 as p,Cs as pt,GL as q,jae as r,Bs as rt,Pae as s,Es as st,G9 as t,qs as tt,h7 as u,js as ut,U6 as v,Xo as vt,I6 as w,$a as wt,J6 as x,wo as xt,G6 as y,Wo as yt,r6 as z};
|