cogpit 2.7.4 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +5524 -3838
- package/dist/web/assets/CommandPaletteHost-fa5vgo7-.js +1 -0
- package/dist/web/assets/ConfigBrowser-CXvr5BFb.js +1 -0
- package/dist/web/assets/HighlightedEditor-DWc-xoSc.js +2 -0
- package/dist/web/assets/{KeyboardShortcutsDialog-DQuepxQo.js → KeyboardShortcutsDialog-C1of2PBc.js} +1 -1
- package/dist/web/assets/{MobileFileChanges-B6rggNR6.js → MobileFileChanges-BAEIKapA.js} +1 -1
- package/dist/web/assets/PluginsDialog-BgnTB0-z.js +1 -0
- package/dist/web/assets/PreviewPanel-DgbgRibz.js +1 -0
- package/dist/web/assets/ProjectFilesPanel-BGpyS_aw.js +4 -0
- package/dist/web/assets/ProjectSwitcherModal-CEypvUNm.js +1 -0
- package/dist/web/assets/{TerminalOutput-CUmbXM9h.js → TerminalOutput-Dq6QP83Y.js} +13 -13
- package/dist/web/assets/ThemeSelectorModal-DeYABHF9.js +1 -0
- package/dist/web/assets/WorkflowsPanel-CNxUSC9Q.js +1 -0
- package/dist/web/assets/WorktreePanel-DJYEUobs.js +1 -0
- package/dist/web/assets/edition-ui-CFlDe2_U.js +2 -0
- package/dist/web/assets/index-Bm91RnFy.js +1 -0
- package/dist/web/assets/index-Ch-IpPaH.js +1 -0
- package/dist/web/assets/index-DVp2Xjmx.js +1 -0
- package/dist/web/assets/{index-BA1eUNuR.js → index-DYugSKH5.js} +4 -4
- package/dist/web/assets/index-DsnL-sXV.js +472 -0
- package/dist/web/assets/index-TCQKag8a.css +1 -0
- package/dist/web/assets/password-BV9mqUzz.js +1 -0
- package/dist/web/assets/{session-parser.worker-CnA52U1J.js → session-parser.worker-CXlsiJzz.js} +24 -24
- package/dist/web/assets/{vendor-ui-ZKZkD5k3.js → vendor-ui-Br3ZTAXZ.js} +237 -167
- package/dist/web/index.html +6 -6
- package/dist/web/theme-bootstrap.js +1 -25
- package/package.json +1 -1
- package/dist/web/assets/CommandPaletteHost-ByD_7YRK.js +0 -1
- package/dist/web/assets/ConfigBrowser-vXK8JNMg.js +0 -1
- package/dist/web/assets/HighlightedEditor-BwET41dr.js +0 -2
- package/dist/web/assets/PluginsDialog-DTF9NnK7.js +0 -1
- package/dist/web/assets/PreviewPanel-BaXxki5D.js +0 -1
- package/dist/web/assets/ProjectFilesPanel-CO6Znhgi.js +0 -4
- package/dist/web/assets/ProjectSwitcherModal-Chi-U3vv.js +0 -1
- package/dist/web/assets/TerminalOutput-6GBZ9nXN.css +0 -32
- package/dist/web/assets/ThemeSelectorModal-B2m42_1f.js +0 -1
- package/dist/web/assets/WorkflowsPanel-CiYzHaQg.js +0 -1
- package/dist/web/assets/WorktreePanel-CldMZY3n.js +0 -1
- package/dist/web/assets/index-C-0I_ZqI.js +0 -1
- package/dist/web/assets/index-C6wvrmo0.js +0 -221
- package/dist/web/assets/index-CYN2JttE.js +0 -1
- package/dist/web/assets/index-DYWsIgvZ.css +0 -1
- package/dist/web/assets/index-QH_v3Ygj.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,c as ye,j as s}from"./vendor-react-gGw_S5I_.js";import{w as Me,bP as Pe,b2 as $e,bQ as Ve,bR as Ft,_ as Re,av as xt,z as pt,G as gt,y as bt,H as He,B as Z,E as wt,bS as yt,b1 as Be,n as Mt,I as Pt,W as $t,m as zt,br as jt,bs as St,bq as kt,a4 as vt,a5 as Kt,bT as Ut,bU as Yt,bV as Ht,l as qe,bW as Gt,i as Ct,j as Nt,k as Et,aY as Qe,X as Xt,V as Ze,U as Wt,bX as Tt,aF as Dt,h as _t,D as At,aa as Jt,ab as Vt,ac as qt,ad as Qt,ae as Zt,af as es,ag as ts,ah as ss,ai as ns,am as Rt,bM as et,$ as tt,bY as ls}from"./index-C6wvrmo0.js";import{a5 as rs,o as as,J as Xe,A as os,h as We,ay as is,X as Fe,Q as It,az as cs,aA as us,c as ds,aB as Lt,a3 as fs,aC as ms,P as hs,aD as xs,j as st,N as Ot,aE as ps}from"./vendor-ui-ZKZkD5k3.js";import"./vendor-shiki-DOn6sF-i.js";import"./vendor-markdown-BE1gYnO9.js";const Le="/api/browser",gs=5e3,bs="all";function ze(n,e=""){return`${Le}/sessions/${encodeURIComponent(n)}${e}`}function Ke(n){return{headers:{"content-type":"application/json"},body:JSON.stringify(n)}}function Ue(n,e){return n instanceof Error&&n.message?n.message:e}function ws(n){const[e,t]=r.useState(null),[l,a]=r.useState(null),u=r.useRef(!1),d=r.useRef(0),f=r.useRef(!1);r.useEffect(()=>(u.current=!0,()=>{u.current=!1}),[]);const x=r.useCallback(async()=>{const c=++d.current;f.current=!0;try{const i=await Me(Pe(Le)),h=i.ok?await i.json():null;if(!u.current||c!==d.current)return;h?(t(m=>JSON.stringify(m)===JSON.stringify(h)?m:h),a(null)):a(await $e(i,`Could not read the browser list (${i.status})`))}catch(i){u.current&&c===d.current&&a(Ue(i,"Could not read the browser list"))}finally{c===d.current&&(f.current=!1)}},[]);r.useEffect(()=>{if(!n)return;x();const c=setInterval(()=>{f.current||x()},gs);return()=>clearInterval(c)},[n,x]);const b=r.useCallback(async(c,i,h)=>{let m;try{m=await Me(Pe(c),i)}catch(N){return{ok:!1,error:Ue(N,h)}}if(!m.ok)return{ok:!1,error:await $e(m,h)};const S=await Ve(m);return x(),{ok:!0,data:S}},[x]),y=r.useCallback(async(c,i,h)=>{const m=await b(c,i,h);return m.ok?{ok:!0}:m},[b]),k=r.useCallback((c,i)=>y(`${Le}/sessions`,{method:"POST",...Ke({name:c,note:i})},`Could not create ${c}`),[y]),_=r.useCallback(c=>y(ze(c),{method:"DELETE"},`Could not delete ${c}`),[y]),p=r.useCallback(c=>y(ze(c,"/stop"),{method:"POST"},`Could not stop ${c}`),[y]),C=r.useCallback((c,i)=>y(ze(c),{method:"PATCH",...Ke({archived:i})},`Could not ${i?"archive":"restore"} ${c}`),[y]),j=r.useCallback(async()=>{const c="Could not read where the browser skill is installed";let i;try{i=await Me(Pe(`${Le}/skill`))}catch(m){return{ok:!1,error:Ue(m,c)}}if(!i.ok)return{ok:!1,error:await $e(i,c)};const h=await Ve(i);return Array.isArray(h==null?void 0:h.targets)?{ok:!0,targets:h.targets}:{ok:!1,error:c}},[]),g=r.useCallback(async c=>{const i="Could not install the browser skill",h=await b(`${Le}/skill/install`,{method:"POST",...Ke({target:c})},i);if(!h.ok)return h;const{paths:m}=h.data??{};return Array.isArray(m)&&m.every(S=>typeof S=="string")?{ok:!0,paths:m}:{ok:!1,error:i}},[b]);return{status:e,error:l,create:k,remove:_,stop:p,setArchived:C,readSkillTargets:j,installSkill:g}}const Ye=4;new TextEncoder;const ys=new TextDecoder;function js(n){if(n.byteLength<Ye)throw new Error("Frame truncated before header length");const e=new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0),t=Ye+e;if(n.byteLength<t)throw new Error("Frame truncated inside header");return{header:Ss(ys.decode(n.subarray(Ye,t))),jpeg:n.subarray(t)}}function Ss(n){let e;try{e=JSON.parse(n)}catch{throw new Error("Frame header is not valid JSON")}if(typeof e!="object"||e===null)throw new Error("Frame header is not an object");const{deviceWidth:t,deviceHeight:l,pageScaleFactor:a,offsetTop:u,scrollOffsetX:d,scrollOffsetY:f,targetId:x,ts:b}=e;if(typeof t!="number"||typeof l!="number"||typeof a!="number"||typeof u!="number"||typeof d!="number"||typeof f!="number"||typeof x!="string"||typeof b!="number")throw new Error("Frame header is missing fields");return{deviceWidth:t,deviceHeight:l,pageScaleFactor:a,offsetTop:u,scrollOffsetX:d,scrollOffsetY:f,targetId:x,ts:b}}const nt=500,ks=5e3,lt=[];function vs(n){const e=window.location.protocol==="https:"?"wss:":"ws:",t=Ft();return`${e}//${window.location.host}${t}/__browser?session=${encodeURIComponent(n)}`}function Cs(n){try{return JSON.parse(n)}catch{return null}}function Ns(n,e){return n.state===e.state&&n.session===e.session&&n.message===e.message}function Es(n,e){return n.targetId===e.targetId&&n.url===e.url&&n.title===e.title&&n.canGoBack===e.canGoBack&&n.canGoForward===e.canGoForward}function Ts(n,e){return n.length===e.length&&n.every((t,l)=>t.targetId===e[l].targetId&&t.url===e[l].url&&t.title===e[l].title)}function Ge(n){n&&n.bitmap.close()}function Ds(n,e){const t=ye.c(16),[l,a]=r.useState("idle"),[u,d]=r.useState(null),[f,x]=r.useState(null),[b,y]=r.useState(lt),[k,_]=r.useState(null),[p,C]=r.useState(null),[j,g]=r.useState(null),[c,i]=r.useState(null),h=r.useRef(null),m=r.useRef(null),S=r.useRef(null),N=r.useRef(e);let v,B;t[0]!==e?(v=()=>{N.current=e},B=[e],t[0]=e,t[1]=v,t[2]=B):(v=t[1],B=t[2]),r.useEffect(v,B);let E,P;t[3]!==n?(E=()=>{if(d(null),x(null),y(lt),_(null),i(null),C(null),g(null),n===null){a("idle");return}const F=n,T={alive:!0,issued:0,applied:0};let w=nt;const V=function(z,D){if(!T.alive||D<=T.applied){Ge(z);return}T.applied=D,m.current=z,C(z),g(Date.now())},L=function(z){let D,G;try{const q=js(new Uint8Array(z));D=q.header,G=new Blob([q.jpeg],{type:"image/jpeg"})}catch{return}const K=T.issued=T.issued+1;createImageBitmap(G).then(q=>V({bitmap:q,header:D},K),_s)},Q=function(z){var G;const D=Cs(z);if(D)e:switch(D.type){case"status":{d(K=>K&&Ns(K,D)?K:D),i(null);break e}case"page":{x(K=>K&&Es(K,D)?K:D);break e}case"tabs":{y(K=>Ts(K,D.tabs)?K:D.tabs),_(D.followed);break e}case"error":{i(D.message);break e}case"clipboard":(G=N.current)==null||G.call(N,D.text)}};function O(){if(!T.alive)return;const X=h.current;if(X&&X.readyState!==WebSocket.CLOSED)return;a("connecting");const z=new WebSocket(vs(F));z.binaryType="arraybuffer",h.current=z,z.onopen=()=>{if(!T.alive){z.close();return}w=nt,a("connected")},z.onmessage=D=>{T.alive&&(typeof D.data=="string"?Q(D.data):D.data instanceof ArrayBuffer&&L(D.data))},z.onclose=()=>{if(!T.alive)return;h.current=null,a("disconnected");const D=w;w=Math.min(w*2,ks),S.current=setTimeout(O,D)}}return O(),()=>{T.alive=!1,S.current&&(clearTimeout(S.current),S.current=null);const X=h.current;h.current=null,X&&(X.onclose=null,X.close()),Ge(m.current),m.current=null}},P=[n],t[3]=n,t[4]=E,t[5]=P):(E=t[4],P=t[5]),r.useEffect(E,P);let R;t[6]===Symbol.for("react.memo_cache_sentinel")?(R=F=>{const T=h.current;T&&T.readyState===WebSocket.OPEN&&T.send(JSON.stringify(F))},t[6]=R):R=t[6];const $=R;let Y;return t[7]!==c||t[8]!==k||t[9]!==p||t[10]!==j||t[11]!==f||t[12]!==u||t[13]!==l||t[14]!==b?(Y={status:l,state:u,page:f,tabs:b,followed:k,frame:p,lastFrameAt:j,error:c,send:$},t[7]=c,t[8]=k,t[9]=p,t[10]=j,t[11]=f,t[12]=u,t[13]=l,t[14]=b,t[15]=Y):Y=t[15],Y}function _s(){}const As=6e3;function Rs(n){const e=ye.c(16),{activity:t}=n,[l,a]=r.useState(!0),u=t?`${t.toolCallId}:${t.done}`:null;let d,f;if(e[0]!==u?(d=()=>{if(u===null)return;a(!0);const g=setTimeout(()=>a(!1),As);return()=>clearTimeout(g)},f=[u],e[0]=u,e[1]=d,e[2]=f):(d=e[1],f=e[2]),r.useEffect(d,f),!t)return null;const x=l?"opacity-100":"opacity-0";let b;e[3]!==x?(b=Re("pointer-events-none absolute inset-x-0 bottom-0 flex justify-center px-2 pb-6 pt-8","bg-gradient-to-t from-transparent via-background/70 to-transparent","transition-opacity duration-700 motion-reduce:transition-none",x),e[3]=x,e[4]=b):b=e[4];let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(rs,{"aria-hidden":!0,className:"size-3.5 shrink-0 text-muted-foreground"}),e[5]=y):y=e[5];let k;e[6]!==t.command?(k=s.jsx("code",{className:"min-w-0 truncate font-mono text-[11px]",children:t.command}),e[6]=t.command,e[7]=k):k=e[7];const _=t.done?"ran":"running";let p;e[8]!==_?(p=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:_}),e[8]=_,e[9]=p):p=e[9];let C;e[10]!==k||e[11]!==p?(C=s.jsxs("div",{className:"flex min-w-0 items-center gap-2 rounded-full bg-background/85 px-3 py-1 text-xs shadow-xs backdrop-blur-sm",children:[y,k,p]}),e[10]=k,e[11]=p,e[12]=C):C=e[12];let j;return e[13]!==b||e[14]!==C?(j=s.jsx("div",{className:b,children:C}),e[13]=b,e[14]=C,e[15]=j):j=e[15],j}const rt="npm i -g agent-browser && agent-browser install",Is=1500;function Ls(n){const e=ye.c(20),{onOpenSkill:t}=n,[l,a]=r.useState(!1),u=r.useRef(null);let d,f;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>()=>{u.current&&clearTimeout(u.current)},f=[],e[0]=d,e[1]=f):(d=e[0],f=e[1]),r.useEffect(d,f);let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=async function(){await xt(rt)&&(a(!0),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>a(!1),Is))},e[2]=x):x=e[2];const b=x;let y,k;e[3]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(pt,{variant:"icon",children:s.jsx(as,{})}),k=s.jsx(gt,{children:"Nothing to show yet"}),e[3]=y,e[4]=k):(y=e[3],k=e[4]);let _;e[5]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(bt,{children:[y,k,s.jsxs(He,{children:["This panel streams a real browser the agent drives. That takes the"," ",s.jsx("code",{className:"font-mono",children:"agent-browser"})," command, which is not on this machine yet."]})]}),e[5]=_):_=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs",children:rt}),e[6]=p):p=e[6];const C=l?"Copied":"Copy install command";let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=()=>void b(),e[7]=j):j=e[7];let g;e[8]!==l?(g=l?s.jsx(Xe,{"data-icon":"inline-start",className:"text-emerald-500"}):s.jsx(os,{"data-icon":"inline-start"}),e[8]=l,e[9]=g):g=e[9];let c;e[10]!==g||e[11]!==C?(c=s.jsxs("div",{className:"flex w-full items-center gap-1.5 rounded-md border bg-muted/40 py-1 pl-2.5 pr-1 text-left",children:[p,s.jsx(Z,{variant:"ghost",size:"icon-xs","aria-label":C,onClick:j,children:g})]}),e[10]=g,e[11]=C,e[12]=c):c=e[12];let i;e[13]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(We,{"data-icon":"inline-start"}),e[13]=i):i=e[13];let h;e[14]!==t?(h=s.jsxs(Z,{variant:"outline",size:"sm",onClick:t,children:[i,"Install the agent skill…"]}),e[14]=t,e[15]=h):h=e[15];let m;e[16]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(He,{className:"text-xs",children:"The skill teaches the agent when to use a named browser and how this panel follows along. Installing writes it into your home directory, so it is never done for you."}),e[16]=m):m=e[16];let S;return e[17]!==c||e[18]!==h?(S=s.jsxs(wt,{className:"size-full",children:[_,s.jsxs(yt,{children:[c,h,m]})]}),e[17]=c,e[18]=h,e[19]=S):S=e[19],S}function Os(n){const e=ye.c(23),{name:t,lastUrl:l,onOpen:a}=n,[u,d]=r.useState(null),f=u??l??"";let x;e[0]!==a||e[1]!==f?(x=function(N){N.preventDefault();const v=f.trim();v&&a(v)},e[0]=a,e[1]=f,e[2]=x):x=e[2];const b=x;let y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(pt,{variant:"icon",children:s.jsx(is,{})}),e[3]=y):y=e[3];let k;e[4]!==t?(k=s.jsxs(gt,{children:[t," isn’t running"]}),e[4]=t,e[5]=k):k=e[5];let _;e[6]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(He,{children:"The agent opens it by itself the moment it browses. You can also open a page here and watch from the start."}),e[6]=_):_=e[6];let p;e[7]!==k?(p=s.jsxs(bt,{children:[y,k,_]}),e[7]=k,e[8]=p):p=e[8];let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=S=>d(S.target.value),e[9]=C):C=e[9];let j;e[10]!==f?(j=s.jsx(Be,{"aria-label":"Page to open",className:"h-8 text-sm",placeholder:"example.com",spellCheck:!1,autoComplete:"off",value:f,onChange:C}),e[10]=f,e[11]=j):j=e[11];let g;e[12]!==f?(g=f.trim(),e[12]=f,e[13]=g):g=e[13];const c=!g;let i;e[14]!==c?(i=s.jsx(Z,{type:"submit",size:"sm",disabled:c,children:"Open"}),e[14]=c,e[15]=i):i=e[15];let h;e[16]!==b||e[17]!==i||e[18]!==j?(h=s.jsx(yt,{children:s.jsxs("form",{className:"flex w-full items-center gap-2",onSubmit:b,children:[j,i]})}),e[16]=b,e[17]=i,e[18]=j,e[19]=h):h=e[19];let m;return e[20]!==h||e[21]!==p?(m=s.jsxs(wt,{className:"size-full",children:[p,h]}),e[20]=h,e[21]=p,e[22]=m):m=e[22],m}function at(n){if(n.url==="about:blank"&&(!n.title.trim()||n.title==="about:blank"))return"New tab";if(n.title.trim())return n.title.trim();try{return new URL(n.url).hostname||n.url}catch{return n.url}}const Bs={live:{label:"LIVE",hint:"Streaming the page as it changes",tone:"text-emerald-600 dark:text-emerald-400",dot:"bg-emerald-500"},idle:{label:"IDLE",hint:"The page has not changed for a few seconds",tone:"text-muted-foreground",dot:"ring-1 ring-muted-foreground/50 ring-inset"},offline:{label:"OFFLINE",hint:"The connection dropped — this is the last frame that arrived",tone:"text-amber-600 dark:text-amber-400",dot:"bg-amber-500"}};function Fs(n){const e=ye.c(17),{status:t}=n,l=Bs[t];let a;e[0]!==l.tone?(a=Re("ml-1 flex shrink-0 cursor-default items-center gap-1 text-[10px] font-medium tracking-wide",l.tone),e[0]=l.tone,e[1]=a):a=e[1];let u;e[2]!==a?(u=s.jsx("span",{className:a}),e[2]=a,e[3]=u):u=e[3];let d;e[4]!==l.dot?(d=Re("size-1.5 rounded-full",l.dot),e[4]=l.dot,e[5]=d):d=e[5];let f;e[6]!==d?(f=s.jsx("span",{"aria-hidden":"true",className:d}),e[6]=d,e[7]=f):f=e[7];let x;e[8]!==l.label||e[9]!==u||e[10]!==f?(x=s.jsxs(jt,{render:u,children:[f,l.label]}),e[8]=l.label,e[9]=u,e[10]=f,e[11]=x):x=e[11];let b;e[12]!==l.hint?(b=s.jsx(St,{children:l.hint}),e[12]=l.hint,e[13]=b):b=e[13];let y;return e[14]!==x||e[15]!==b?(y=s.jsxs(kt,{children:[x,b]}),e[14]=x,e[15]=b,e[16]=y):y=e[16],y}const Ms=r.memo(function(e){const t=ye.c(49),{page:l,tabs:a,followed:u,status:d,onNavigate:f,onBack:x,onForward:b,onReload:y,onFollow:k,onCloseTab:_}=e,[p,C]=r.useState(null),j=(l==null?void 0:l.url)??"";let g;t[0]!==p||t[1]!==j||t[2]!==f?(g=function(J){J.preventDefault();const te=(p??j).trim();C(null),te&&f(te)},t[0]=p,t[1]=j,t[2]=f,t[3]=g):g=t[3];const c=g;let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=function(J){J.key==="Escape"&&(J.preventDefault(),C(null),J.currentTarget.blur())},t[4]=i):i=t[4];const h=i,m=!(l!=null&&l.canGoBack);let S;t[5]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(It,{"data-icon":"inline-start"}),t[5]=S):S=t[5];let N;t[6]!==x||t[7]!==m?(N=s.jsx(Z,{variant:"ghost",size:"icon-sm","aria-label":"Back",disabled:m,onClick:x,children:S}),t[6]=x,t[7]=m,t[8]=N):N=t[8];const v=!(l!=null&&l.canGoForward);let B;t[9]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(cs,{"data-icon":"inline-start"}),t[9]=B):B=t[9];let E;t[10]!==b||t[11]!==v?(E=s.jsx(Z,{variant:"ghost",size:"icon-sm","aria-label":"Forward",disabled:v,onClick:b,children:B}),t[10]=b,t[11]=v,t[12]=E):E=t[12];const P=!l;let R;t[13]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(us,{"data-icon":"inline-start"}),t[13]=R):R=t[13];let $;t[14]!==y||t[15]!==P?($=s.jsx(Z,{variant:"ghost",size:"icon-sm","aria-label":"Reload",disabled:P,onClick:y,children:R}),t[14]=y,t[15]=P,t[16]=$):$=t[16];const Y=p??j;let F;t[17]===Symbol.for("react.memo_cache_sentinel")?(F=W=>C(W.target.value),t[17]=F):F=t[17];let T;t[18]===Symbol.for("react.memo_cache_sentinel")?(T=()=>C(null),t[18]=T):T=t[18];let w;t[19]!==Y?(w=s.jsx(Mt,{"aria-label":"Page URL",className:"text-xs",placeholder:"Enter a URL",spellCheck:!1,autoComplete:"off",value:Y,onChange:F,onFocus:Ps,onBlur:T,onKeyDown:h}),t[19]=Y,t[20]=w):w=t[20];const V=!j;let L;t[21]!==j?(L=()=>window.open(j,"_blank","noopener,noreferrer"),t[21]=j,t[22]=L):L=t[22];let Q;t[23]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx(ds,{"data-icon":"inline-start"}),t[23]=Q):Q=t[23];let O;t[24]!==V||t[25]!==L?(O=s.jsx(Pt,{align:"inline-end",children:s.jsx($t,{size:"icon-xs","aria-label":"Open in your browser",disabled:V,onClick:L,children:Q})}),t[24]=V,t[25]=L,t[26]=O):O=t[26];let X;t[27]!==w||t[28]!==O?(X=s.jsxs(zt,{className:"h-7",children:[w,O]}),t[27]=w,t[28]=O,t[29]=X):X=t[29];let z;t[30]!==c||t[31]!==X?(z=s.jsx("form",{className:"ml-1 min-w-0 flex-1",onSubmit:c,children:X}),t[30]=c,t[31]=X,t[32]=z):z=t[32];let D;t[33]!==d?(D=d&&s.jsx(Fs,{status:d}),t[33]=d,t[34]=D):D=t[34];let G;t[35]!==$||t[36]!==z||t[37]!==D||t[38]!==N||t[39]!==E?(G=s.jsxs("div",{className:"flex items-center gap-0.5",children:[N,E,$,z,D]}),t[35]=$,t[36]=z,t[37]=D,t[38]=N,t[39]=E,t[40]=G):G=t[40];let K;t[41]!==u||t[42]!==_||t[43]!==k||t[44]!==a?(K=a.length>0&&s.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-0.5",children:a.map(W=>s.jsxs("div",{className:Re("flex max-w-48 shrink-0 items-center rounded-md",W.targetId===u&&"bg-secondary"),children:[s.jsx(Z,{size:"xs",variant:"ghost",className:"min-w-0 shrink rounded-r-none","aria-current":W.targetId===u?"page":void 0,title:W.title||W.url,onClick:()=>k(W.targetId),onMouseDown:$s,onAuxClick:J=>{J.button===1&&(J.preventDefault(),_(W.targetId))},children:s.jsx("span",{className:"truncate",children:at(W)})}),s.jsx(Z,{size:"icon-xs",variant:"ghost",className:"rounded-l-none","aria-label":`Close tab: ${at(W)}`,title:"Close tab",onClick:()=>_(W.targetId),children:s.jsx(Fe,{"data-icon":"inline-start"})})]},W.targetId))}),t[41]=u,t[42]=_,t[43]=k,t[44]=a,t[45]=K):K=t[45];let q;return t[46]!==G||t[47]!==K?(q=s.jsxs("div",{className:"flex shrink-0 flex-col gap-1 border-b px-2 py-1.5",children:[G,K]}),t[46]=G,t[47]=K,t[48]=q):q=t[48],q});function Ps(n){return n.target.select()}function $s(n){n.button===1&&n.preventDefault()}function zs(n){if(!n||!Number.isFinite(Date.parse(n)))return null;if(Date.now()-Date.parse(n)>=10080*60*1e3)return new Date(n).toLocaleDateString();const e=Kt(n);return e==="now"?"just now":`${e} ago`}function Bt(n){const e=ye.c(4),{running:t}=n,l=t?"bg-emerald-500":"ring-1 ring-muted-foreground/50 ring-inset";let a;e[0]!==l?(a=Re("size-2 shrink-0 rounded-full",l),e[0]=l,e[1]=a):a=e[1];let u;return e[2]!==a?(u=s.jsx("span",{"aria-hidden":!0,className:a}),e[2]=a,e[3]=u):u=e[3],u}function Ks(n){const e=ye.c(91),{sessions:t,selected:l,currentSessionId:a,busy:u,onSelect:d,onSetArchived:f,children:x}=n,[b,y]=r.useState(!1),[k,_]=r.useState(""),[p,C]=r.useState(!1),j=r.useRef(null);let g;if(e[0]!==l||e[1]!==t){let J;e[3]!==l?(J=te=>te.name===l,e[3]=l,e[4]=J):J=e[4],g=t.find(J),e[0]=l,e[1]=t,e[2]=g}else g=e[2];const c=g;let i,h,m,S,N,v,B,E,P,R,$,Y,F,T,w,V,L;if(e[5]!==u||e[6]!==a||e[7]!==d||e[8]!==f||e[9]!==b||e[10]!==k||e[11]!==l||e[12]!==(c==null?void 0:c.running)||e[13]!==t||e[14]!==p){const J=k.trim().toLowerCase();let te;e[32]!==l?(te=H=>!!H.archived&&!H.isDefault&&!H.running&&H.name!==l,e[32]=l,e[33]=te):te=e[33];const ge=te,ce=H=>`${H.name} ${H.note??""}`.toLowerCase().includes(J),he=t.filter(H=>!ge(H)&&ce(H)).sort(Ys);m=t.filter(ge);const ue=m.filter(ce);L=p&&!J?[]:he,V=p||J?ue:[];let de;e[34]===Symbol.for("react.memo_cache_sentinel")?(de=function(){y(!1)},e[34]=de):de=e[34],S=de;const fe=async function(le){le.archived&&!(await f(le.name,!1)).ok||(d(le.name),S())},Se=async function(le){var xe;(await f(le,!0)).ok&&((xe=j.current)==null||xe.focus())};h=Ut,N=b,e[35]===Symbol.for("react.memo_cache_sentinel")?(v=H=>{y(H),H&&(_(""),C(!1))},e[35]=v):v=e[35];let ae;e[36]===Symbol.for("react.memo_cache_sentinel")?(ae=s.jsx(Z,{variant:"ghost",size:"xs","aria-label":"Switch browser",className:"max-w-40"}),e[36]=ae):ae=e[36];const me=(c==null?void 0:c.running)??!1;let oe;e[37]!==me?(oe=s.jsx(Bt,{running:me}),e[37]=me,e[38]=oe):oe=e[38];let re;e[39]!==l?(re=s.jsx("span",{className:"truncate",children:l}),e[39]=l,e[40]=re):re=e[40];let I;e[41]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(fs,{"data-icon":"inline-end",className:"opacity-60"}),e[41]=I):I=e[41],e[42]!==oe||e[43]!==re?(B=s.jsxs(Yt,{render:ae,children:[oe,re,I]}),e[42]=oe,e[43]=re,e[44]=B):B=e[44],i=Ht,$="Browsers",Y=j,F="flex max-h-[min(32rem,var(--available-height))] w-80 max-w-[calc(100vw-1rem)] flex-col overflow-hidden";const ee=p&&!J?"Archived browsers":"Browsers";let se;e[45]!==ee?(se=s.jsx("span",{className:"text-sm font-medium",children:ee}),e[45]=ee,e[46]=se):se=e[46];let je;e[47]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx(Z,{variant:"ghost",size:"icon-xs","aria-label":"Close browser picker",onClick:S,children:s.jsx(Fe,{"data-icon":"inline-start"})}),e[47]=je):je=e[47];let be;e[48]!==se?(be=s.jsxs("div",{className:"flex items-center justify-between pl-1",children:[se,je]}),e[48]=se,e[49]=be):be=e[49];let ie;e[50]===Symbol.for("react.memo_cache_sentinel")?(ie=H=>_(H.target.value),e[50]=ie):ie=e[50];let we;e[51]!==k?(we=s.jsx(Be,{ref:j,"aria-label":"Search browsers",placeholder:"Search browsers…",value:k,onChange:ie}),e[51]=k,e[52]=we):we=e[52],e[53]!==be||e[54]!==we?(T=s.jsxs("div",{className:"flex shrink-0 flex-col gap-2 p-2",children:[be,we]}),e[53]=be,e[54]=we,e[55]=T):T=e[55],e[56]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(qe,{}),e[56]=w):w=e[56],E="min-h-0 max-h-72 overflow-y-auto overscroll-contain p-1",P="Browser list",R=[{label:"Recent browsers",sessions:L,archived:!1},{label:"Archived browsers",sessions:V,archived:!0}].filter(Us).map(H=>s.jsxs("div",{children:[H.archived&&!!J&&s.jsx("p",{className:"px-2 py-1 text-xs text-muted-foreground",children:"Archived"}),s.jsx("ul",{"aria-label":H.label,children:H.sessions.map(le=>s.jsx(Hs,{session:le,archived:H.archived,selected:l,currentSessionId:a,busy:u,onPick:fe,onArchive:Se},le.name))})]},H.label)),e[5]=u,e[6]=a,e[7]=d,e[8]=f,e[9]=b,e[10]=k,e[11]=l,e[12]=c==null?void 0:c.running,e[13]=t,e[14]=p,e[15]=i,e[16]=h,e[17]=m,e[18]=S,e[19]=N,e[20]=v,e[21]=B,e[22]=E,e[23]=P,e[24]=R,e[25]=$,e[26]=Y,e[27]=F,e[28]=T,e[29]=w,e[30]=V,e[31]=L}else i=e[15],h=e[16],m=e[17],S=e[18],N=e[19],v=e[20],B=e[21],E=e[22],P=e[23],R=e[24],$=e[25],Y=e[26],F=e[27],T=e[28],w=e[29],V=e[30],L=e[31];let Q;e[57]!==V||e[58]!==L.length?(Q=L.length===0&&V.length===0&&s.jsx("p",{role:"status",className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"No browsers found."}),e[57]=V,e[58]=L.length,e[59]=Q):Q=e[59];let O;e[60]!==Q||e[61]!==E||e[62]!==P||e[63]!==R?(O=s.jsxs("div",{className:E,"aria-label":P,children:[R,Q]}),e[60]=Q,e[61]=E,e[62]=P,e[63]=R,e[64]=O):O=e[64];let X;e[65]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsx(qe,{}),e[65]=X):X=e[65];let z;e[66]!==m.length||e[67]!==p?(z=(m.length>0||p)&&s.jsxs(Z,{variant:"ghost",size:"sm",className:"w-full justify-start","aria-expanded":p,onClick:()=>{C(!p),_("")},children:[p?s.jsx(It,{"data-icon":"inline-start"}):s.jsx(Lt,{"data-icon":"inline-start"}),p?"Back to recent":"Archived",!p&&s.jsx(vt,{variant:"secondary",children:m.length})]}),e[66]=m.length,e[67]=p,e[68]=z):z=e[68];let D;e[69]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx("p",{className:"px-1 pb-1 text-xs text-muted-foreground",children:"Stopped browsers archive after 24h of inactivity. Saved logins are kept."}),e[69]=D):D=e[69];let G;e[70]!==x||e[71]!==S?(G=x(S),e[70]=x,e[71]=S,e[72]=G):G=e[72];let K;e[73]!==z||e[74]!==G?(K=s.jsxs("div",{className:"flex shrink-0 flex-col gap-1 p-2",children:[z,D,G]}),e[73]=z,e[74]=G,e[75]=K):K=e[75];let q;e[76]!==i||e[77]!==O||e[78]!==K||e[79]!==$||e[80]!==Y||e[81]!==F||e[82]!==T||e[83]!==w?(q=s.jsxs(i,{"aria-label":$,initialFocus:Y,className:F,children:[T,w,O,X,K]}),e[76]=i,e[77]=O,e[78]=K,e[79]=$,e[80]=Y,e[81]=F,e[82]=T,e[83]=w,e[84]=q):q=e[84];let W;return e[85]!==h||e[86]!==N||e[87]!==v||e[88]!==B||e[89]!==q?(W=s.jsxs(h,{open:N,onOpenChange:v,children:[B,q]}),e[85]=h,e[86]=N,e[87]=v,e[88]=B,e[89]=q,e[90]=W):W=e[90],W}function Us(n){return n.sessions.length>0}function Ys(n,e){return Number(e.isDefault)-Number(n.isDefault)||Number(e.running)-Number(n.running)}function Hs(n){const e=ye.c(49),{session:t,archived:l,selected:a,currentSessionId:u,busy:d,onPick:f,onArchive:x}=n;let b;e[0]!==t.lastUsedAt?(b=zs(t.lastUsedAt),e[0]=t.lastUsedAt,e[1]=b):b=e[1];const y=b,k=t.running&&t.driverSessionId!==null&&t.driverSessionId!==u,_=`${l?"Restore and switch to":"Switch to"} ${t.name}`,p=t.name===a?"true":void 0;let C;e[2]!==f||e[3]!==t?(C=()=>void f(t),e[2]=f,e[3]=t,e[4]=C):C=e[4];let j;e[5]!==t.running?(j=s.jsx(Bt,{running:t.running}),e[5]=t.running,e[6]=j):j=e[6];let g;e[7]!==t.name?(g=s.jsx("span",{className:"truncate",children:t.name}),e[7]=t.name,e[8]=g):g=e[8];const c=t.running?"running":"stopped";let i;e[9]!==c?(i=s.jsx("span",{className:"sr-only",children:c}),e[9]=c,e[10]=i):i=e[10];let h;e[11]!==t.isDefault?(h=t.isDefault&&s.jsx(vt,{variant:"secondary",children:"Default"}),e[11]=t.isDefault,e[12]=h):h=e[12];let m;e[13]!==y?(m=y&&s.jsx("span",{className:"ml-auto shrink-0 text-xs font-normal text-muted-foreground",children:y}),e[13]=y,e[14]=m):m=e[14];let S;e[15]!==m||e[16]!==g||e[17]!==i||e[18]!==h?(S=s.jsxs("span",{className:"flex w-full min-w-0 items-center gap-1.5",children:[g,i,h,m]}),e[15]=m,e[16]=g,e[17]=i,e[18]=h,e[19]=S):S=e[19];let N;e[20]!==k?(N=k&&s.jsx("span",{className:"max-w-full truncate text-xs font-normal text-muted-foreground",children:"driven by another session"}),e[20]=k,e[21]=N):N=e[21];let v;e[22]!==S||e[23]!==N?(v=s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col items-start gap-0.5",children:[S,N]}),e[22]=S,e[23]=N,e[24]=v):v=e[24];let B;e[25]!==a||e[26]!==t.name?(B=t.name===a&&s.jsx(Xe,{"data-icon":"inline-end"}),e[25]=a,e[26]=t.name,e[27]=B):B=e[27];let E;e[28]!==l?(E=l&&s.jsx(ms,{"data-icon":"inline-end"}),e[28]=l,e[29]=E):E=e[29];let P;e[30]!==d||e[31]!==v||e[32]!==B||e[33]!==E||e[34]!==_||e[35]!==p||e[36]!==C||e[37]!==j?(P=s.jsxs(Z,{variant:"ghost",className:"h-auto min-h-10 min-w-0 flex-1 justify-start px-2 py-2","aria-label":_,"aria-current":p,disabled:d,onClick:C,children:[j,v,B,E]}),e[30]=d,e[31]=v,e[32]=B,e[33]=E,e[34]=_,e[35]=p,e[36]=C,e[37]=j,e[38]=P):P=e[38];let R;e[39]!==l||e[40]!==d||e[41]!==x||e[42]!==t.isDefault||e[43]!==t.name||e[44]!==t.running?(R=!l&&!t.isDefault&&!t.running&&s.jsx(Z,{variant:"ghost",size:"icon-sm","aria-label":`Archive ${t.name}`,title:`Archive ${t.name}`,disabled:d,onClick:()=>void x(t.name),children:s.jsx(Lt,{"data-icon":"inline-start"})}),e[39]=l,e[40]=d,e[41]=x,e[42]=t.isDefault,e[43]=t.name,e[44]=t.running,e[45]=R):R=e[45];let $;return e[46]!==P||e[47]!==R?($=s.jsxs("li",{className:"group flex items-center gap-1 rounded-md",children:[P,R]}),e[46]=P,e[47]=R,e[48]=$):$=e[48],$}const Oe="default",Gs=/^[a-z0-9][a-z0-9_-]{0,39}$/,Xs="Lowercase letters, numbers, - and _, starting with a letter or number (40 max).",Ws=r.memo(function(e){const t=ye.c(100),{sessions:l,selected:a,currentSessionId:u,followAgent:d,busy:f,onSelect:x,onToggleFollow:b,onOpenSkill:y,onCreate:k,onRemove:_,onStop:p,onSetArchived:C,onShowDefault:j,onClose:g}=e,c=f===void 0?!1:f,i=r.useId(),h=r.useId(),[m,S]=r.useState(!1),[N,v]=r.useState(""),[B,E]=r.useState(""),[P,R]=r.useState(null),[$,Y]=r.useState(!1),[F,T]=r.useState(null),w=a===Oe;let V;t[0]!==a||t[1]!==l?(V=l.find(ne=>ne.name===a)??null,t[0]=a,t[1]=l,t[2]=V):V=t[2];const L=V;let Q,O;t[3]!==N?(O=N.trim(),Q=O.length>0&&!Gs.test(O),t[3]=N,t[4]=Q,t[5]=O):(Q=t[4],O=t[5]);const X=Q,z=X?Xs:P,D=O.length>0&&!X&&!$;let G;t[6]===Symbol.for("react.memo_cache_sentinel")?(G=function(){v(""),E(""),R(null),Y(!1),S(!0)},t[6]=G):G=t[6];const K=G;let q;t[7]!==D||t[8]!==B||t[9]!==k||t[10]!==x||t[11]!==O?(q=async function(){if(!D)return;Y(!0);const Je=await k(O,B.trim());if(Y(!1),!Je.ok){R(Je.error);return}S(!1),x(O)},t[7]=D,t[8]=B,t[9]=k,t[10]=x,t[11]=O,t[12]=q):q=t[12];const W=q,J=!w&&"border-amber-500/40 bg-amber-500/10";let te;t[13]!==J?(te=Re("@container/browser-bar flex h-10 shrink-0 items-center gap-2 border-b px-2",J),t[13]=J,t[14]=te):te=t[14];let ge;t[15]!==c||t[16]!==w||t[17]!==y||t[18]!==p||t[19]!==a||t[20]!==(L==null?void 0:L.running)?(ge=ne=>s.jsxs(s.Fragment,{children:[s.jsxs(Z,{variant:"outline",size:"sm",disabled:c,onClick:()=>{ne(),K()},children:[s.jsx(hs,{"data-icon":"inline-start"}),"New browser…"]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxs(Z,{variant:"ghost",size:"xs",onClick:()=>{ne(),y()},children:[s.jsx(We,{"data-icon":"inline-start"}),"Agent skill…"]}),!w&&s.jsxs(s.Fragment,{children:[s.jsxs(Z,{variant:"ghost",size:"xs",disabled:c||!(L!=null&&L.running),onClick:()=>{ne(),p(a)},children:[s.jsx(xs,{"data-icon":"inline-start"}),"Stop"]}),s.jsxs(Z,{variant:"ghost",size:"xs",disabled:c,onClick:()=>{ne(),T(a)},children:[s.jsx(st,{"data-icon":"inline-start"}),"Delete…"]})]})]})]}),t[15]=c,t[16]=w,t[17]=y,t[18]=p,t[19]=a,t[20]=L==null?void 0:L.running,t[21]=ge):ge=t[21];let ce;t[22]!==c||t[23]!==u||t[24]!==x||t[25]!==C||t[26]!==a||t[27]!==l||t[28]!==ge?(ce=s.jsx(Ks,{sessions:l,selected:a,currentSessionId:u,busy:c,onSelect:x,onSetArchived:C,children:ge}),t[22]=c,t[23]=u,t[24]=x,t[25]=C,t[26]=a,t[27]=l,t[28]=ge,t[29]=ce):ce=t[29];let he;t[30]===Symbol.for("react.memo_cache_sentinel")?(he=s.jsx("span",{className:"flex-1"}),t[30]=he):he=t[30];let ue;t[31]!==w||t[32]!==j?(ue=!w&&s.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[s.jsxs("span",{role:"status",className:"flex min-w-0 items-center gap-1.5 text-xs font-medium text-amber-700 dark:text-amber-300",children:[s.jsx(Ot,{"aria-hidden":!0,className:"size-3.5 shrink-0"}),s.jsx("span",{className:"sr-only @sm/browser-bar:not-sr-only @sm/browser-bar:whitespace-nowrap",children:"Not the default browser"})]}),s.jsx(Z,{variant:"outline",size:"xs",onClick:j,children:"Show default"})]}),t[31]=w,t[32]=j,t[33]=ue):ue=t[33];let de;t[34]!==b?(de=ne=>b(ne),t[34]=b,t[35]=de):de=t[35];let fe;t[36]!==d||t[37]!==de?(fe=s.jsx(Gt,{size:"sm","aria-label":"Follow agent",pressed:d,onPressedChange:de,className:"text-muted-foreground data-pressed:text-foreground"}),t[36]=d,t[37]=de,t[38]=fe):fe=t[38];let Se,ae;t[39]===Symbol.for("react.memo_cache_sentinel")?(Se=s.jsx(ps,{"data-icon":"inline-start"}),ae=s.jsx("span",{className:"hidden @md/browser-bar:inline",children:"Follow"}),t[39]=Se,t[40]=ae):(Se=t[39],ae=t[40]);let me;t[41]!==fe?(me=s.jsxs(jt,{render:fe,children:[Se,ae]}),t[41]=fe,t[42]=me):me=t[42];let oe;t[43]===Symbol.for("react.memo_cache_sentinel")?(oe=s.jsx(St,{children:"Switch to whichever browser this session’s agent uses"}),t[43]=oe):oe=t[43];let re;t[44]!==me?(re=s.jsxs(kt,{children:[me,oe]}),t[44]=me,t[45]=re):re=t[45];let I;t[46]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(Fe,{"data-icon":"inline-start"}),t[46]=I):I=t[46];let ee;t[47]!==g?(ee=s.jsx(Z,{variant:"ghost",size:"icon-sm","aria-label":"Close browser panel",onClick:g,children:I}),t[47]=g,t[48]=ee):ee=t[48];let se;t[49]!==W?(se=ne=>{ne.preventDefault(),W()},t[49]=W,t[50]=se):se=t[50];let je;t[51]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsxs(Ct,{children:[s.jsx(Nt,{children:"New browser"}),s.jsx(Et,{children:"A named browser keeps its own cookies and logins, and stays out of the default one."})]}),t[51]=je):je=t[51];const be=!!z;let ie;t[52]!==i?(ie=s.jsx(Qe,{htmlFor:i,children:"Name"}),t[52]=i,t[53]=ie):ie=t[53];const we=!!z;let H;t[54]===Symbol.for("react.memo_cache_sentinel")?(H=ne=>{v(ne.target.value),R(null)},t[54]=H):H=t[54];let le;t[55]!==i||t[56]!==N||t[57]!==we?(le=s.jsx(Be,{id:i,autoFocus:!0,autoComplete:"off",spellCheck:!1,placeholder:"shop","aria-invalid":we,value:N,onChange:H}),t[55]=i,t[56]=N,t[57]=we,t[58]=le):le=t[58];let Ne;t[59]!==z?(Ne=s.jsx(Xt,{children:z}),t[59]=z,t[60]=Ne):Ne=t[60];let xe;t[61]!==be||t[62]!==ie||t[63]!==le||t[64]!==Ne?(xe=s.jsxs(Ze,{"data-invalid":be,children:[ie,le,Ne]}),t[61]=be,t[62]=ie,t[63]=le,t[64]=Ne,t[65]=xe):xe=t[65];let _e;t[66]===Symbol.for("react.memo_cache_sentinel")?(_e=s.jsx("span",{className:"text-muted-foreground/60",children:"(optional)"}),t[66]=_e):_e=t[66];let ke;t[67]!==h?(ke=s.jsxs(Qe,{htmlFor:h,children:["Note ",_e]}),t[67]=h,t[68]=ke):ke=t[68];let Ee;t[69]===Symbol.for("react.memo_cache_sentinel")?(Ee=ne=>E(ne.target.value),t[69]=Ee):Ee=t[69];let ve;t[70]!==B||t[71]!==h?(ve=s.jsx(Be,{id:h,autoComplete:"off",placeholder:"What this browser is signed in to",value:B,onChange:Ee}),t[70]=B,t[71]=h,t[72]=ve):ve=t[72];let Te;t[73]!==ke||t[74]!==ve?(Te=s.jsxs(Ze,{children:[ke,ve]}),t[73]=ke,t[74]=ve,t[75]=Te):Te=t[75];let M;t[76]!==xe||t[77]!==Te?(M=s.jsxs(Wt,{className:"gap-4",children:[xe,Te]}),t[76]=xe,t[77]=Te,t[78]=M):M=t[78];let o;t[79]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Tt,{render:s.jsx(Z,{type:"button",variant:"outline"}),children:"Cancel"}),t[79]=o):o=t[79];const A=!D;let U;t[80]!==A?(U=s.jsxs(Dt,{children:[o,s.jsx(Z,{type:"submit",disabled:A,children:"Create browser"})]}),t[80]=A,t[81]=U):U=t[81];let pe;t[82]!==se||t[83]!==M||t[84]!==U?(pe=s.jsx(_t,{className:"sm:max-w-sm",children:s.jsxs("form",{className:"flex flex-col gap-4",onSubmit:se,children:[je,M,U]})}),t[82]=se,t[83]=M,t[84]=U,t[85]=pe):pe=t[85];let Ce;t[86]!==m||t[87]!==pe?(Ce=s.jsx(At,{open:m,onOpenChange:S,children:pe}),t[86]=m,t[87]=pe,t[88]=Ce):Ce=t[88];let De;t[89]!==F||t[90]!==_?(De=F!==null&&s.jsx(Jt,{open:!0,onOpenChange:ne=>{ne||T(null)},children:s.jsxs(Vt,{size:"sm",children:[s.jsxs(qt,{children:[s.jsx(Qt,{className:"bg-destructive/10 text-destructive",children:s.jsx(st,{})}),s.jsxs(Zt,{children:["Delete ",F,"?"]}),s.jsx(es,{children:"Its profile goes with it, so everything signed in there is signed out. Other browsers are untouched."})]}),s.jsxs(ts,{children:[s.jsx(ss,{size:"sm",children:"Cancel"}),s.jsx(ns,{variant:"destructive",size:"sm",onClick:()=>{_(F),T(null)},children:"Delete browser"})]})]})}),t[89]=F,t[90]=_,t[91]=De):De=t[91];let Ae;return t[92]!==ue||t[93]!==re||t[94]!==ee||t[95]!==Ce||t[96]!==De||t[97]!==te||t[98]!==ce?(Ae=s.jsxs("div",{className:te,children:[ce,he,ue,re,ee,Ce,De]}),t[92]=ue,t[93]=re,t[94]=ee,t[95]=Ce,t[96]=De,t[97]=te,t[98]=ce,t[99]=Ae):Ae=t[99],Ae});function Js(n){const e=ye.c(36),{open:t,onOpenChange:l,readTargets:a,install:u}=n,[d,f]=r.useState(null),[x,b]=r.useState(null),[y,k]=r.useState(null);let _;e[0]!==a?(_=async()=>{const w=await a();w.ok?(f(w.targets),b(null)):b(w.error)},e[0]=a,e[1]=_):_=e[1];const p=_;let C,j;e[2]!==p||e[3]!==t?(C=()=>{t&&(b(null),p())},j=[t,p],e[2]=p,e[3]=t,e[4]=C,e[5]=j):(C=e[4],j=e[5]),r.useEffect(C,j);let g;e[6]!==u||e[7]!==p?(g=async function(V){k(V);const L=await u(V);k(null),L.ok?await p():b(L.error)},e[6]=u,e[7]=p,e[8]=g):g=e[8];const c=g;let i;e[9]!==d?(i=(d==null?void 0:d.some(Vs))??!1,e[9]=d,e[10]=i):i=e[10];const h=i;let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Nt,{children:"Agent skill"}),e[11]=m):m=e[11];let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsxs(Ct,{children:[m,s.jsxs(Et,{children:["The skill teaches an agent how Cogpit’s browsers work: when to use a named one, when to keep to a throwaway, and that this panel is watching. Install it for agents you run outside Cogpit — it writes a"," ",s.jsx("code",{className:"font-mono",children:"SKILL.md"})," into that CLI’s configuration directory in your home folder."]})]}),e[12]=S):S=e[12];let N;e[13]!==x?(N=x&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:x}),e[13]=x,e[14]=N):N=e[14];let v;e[15]!==y||e[16]!==c||e[17]!==d?(v=d===null?s.jsxs("div",{role:"status",className:"flex items-center gap-2 py-4 text-sm text-muted-foreground",children:[s.jsx(Rt,{}),"Reading where it is installed…"]}):s.jsx("ul",{className:"flex flex-col gap-2",children:d.map(w=>s.jsxs("li",{className:"flex items-center gap-3 rounded-md border p-2.5",children:[s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[s.jsx("span",{className:"truncate text-sm font-medium",children:w.label}),s.jsx("span",{className:"truncate font-mono text-xs text-muted-foreground",children:w.configRoot}),w.automatic&&s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:"Already automatic in the sessions Cogpit starts"})]}),w.installed?s.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Xe,{"aria-hidden":!0,className:"size-3.5 text-emerald-500"}),"Installed"]}):s.jsx(Z,{size:"xs",variant:"outline","aria-label":`Install for ${w.label}`,disabled:y!==null,onClick:()=>void c(w.kind),children:"Install"})]},w.kind))}),e[15]=y,e[16]=c,e[17]=d,e[18]=v):v=e[18];const B=!h||y!==null;let E;e[19]!==c?(E=()=>void c(bs),e[19]=c,e[20]=E):E=e[20];let P;e[21]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(We,{"data-icon":"inline-start"}),e[21]=P):P=e[21];let R;e[22]!==B||e[23]!==E?(R=s.jsxs(Z,{variant:"outline",disabled:B,onClick:E,children:[P,"Install for all"]}),e[22]=B,e[23]=E,e[24]=R):R=e[24];let $;e[25]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(Tt,{render:s.jsx(Z,{type:"button"}),children:"Done"}),e[25]=$):$=e[25];let Y;e[26]!==R?(Y=s.jsxs(Dt,{children:[R,$]}),e[26]=R,e[27]=Y):Y=e[27];let F;e[28]!==Y||e[29]!==N||e[30]!==v?(F=s.jsxs(_t,{className:"sm:max-w-md",children:[S,N,v,Y]}),e[28]=Y,e[29]=N,e[30]=v,e[31]=F):F=e[31];let T;return e[32]!==l||e[33]!==t||e[34]!==F?(T=s.jsx(At,{open:t,onOpenChange:l,children:F}),e[32]=l,e[33]=t,e[34]=F,e[35]=T):T=e[35],T}function Vs(n){return!n.installed}const qs={x:0,y:0,width:0,height:0,scale:0};function Qs(n,e){if(n.width<=0||n.height<=0||e.width<=0||e.height<=0)return qs;const t=Math.min(1,n.width/e.width,n.height/e.height),l=e.width*t,a=e.height*t;return{x:Math.round((n.width-l)/2),y:Math.round((n.height-a)/2),width:l,height:a,scale:t}}function ot(n,e,t,l,a={}){if(l.scale<=0||l.width<=0||l.height<=0)return null;const u=n-t.left-l.x,d=e-t.top-l.y;return!(u>=0&&d>=0&&u<=l.width&&d<=l.height)&&!a.clamp?null:{x:it(u/l.scale,l.width/l.scale),y:it(d/l.scale,l.height/l.scale)}}function it(n,e){return Math.min(Math.max(n,0),e)}const Zs=1,en=2,tn=4,sn=8;function Ie(n){return(n.altKey?Zs:0)|(n.ctrlKey?en:0)|(n.metaKey?tn:0)|(n.shiftKey?sn:0)}const nn=["left","middle","right"];function ct(n){return nn[n]??"left"}const ln=150,ut=2,rn=500,dt=5,an=1,on=2,cn=16,un="Keyboard captured · Esc to release",dn=new Set(["F5","F11","F12"]),fn=new Set(["i","j","c"]);function ft(n){return dn.has(n.key)||n.metaKey?!0:n.ctrlKey&&n.shiftKey&&fn.has(n.key.toLowerCase())}function mn(n){if(!(n.ctrlKey||n.metaKey))return n.key.length===1?n.key:n.key==="Enter"?"\r":void 0}function mt(n,e,t){return e===an?n*cn:e===on?n*t:n}function hn(n,e,t){try{n.drawImage(e,t.x,t.y,t.width,t.height)}catch{}}function xn(n){const e=ye.c(85),{frame:t,send:l,onSizeChange:a,className:u}=n,d=r.useRef(null),f=r.useRef(null),x=r.useRef(null),b=r.useRef(null),y=r.useRef(!1);let k;e[0]===Symbol.for("react.memo_cache_sentinel")?(k={count:0,at:0,x:0,y:0,button:-1},e[0]=k):k=e[0];const _=r.useRef(k);let p;e[1]===Symbol.for("react.memo_cache_sentinel")?(p=new Map,e[1]=p):p=e[1];const C=r.useRef(p);let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j={width:0,height:0,dpr:1},e[2]=j):j=e[2];const[g,c]=r.useState(j),[i,h]=r.useState(!1),m=t?t.header.deviceWidth:0,S=t?t.header.deviceHeight:0;let N;e[3]!==S||e[4]!==m||e[5]!==g?(N=Qs(g,{width:m,height:S}),e[3]=S,e[4]=m,e[5]=g,e[6]=N):N=e[6];const v=N,B=r.useRef(a);let E,P;e[7]!==a?(E=()=>{B.current=a},P=[a],e[7]=a,e[8]=E,e[9]=P):(E=e[8],P=e[9]),r.useEffect(E,P);let R,$;e[10]===Symbol.for("react.memo_cache_sentinel")?(R=()=>{const M=d.current;if(!M)return;let o=null;const A=()=>{const pe=M.getBoundingClientRect(),Ce=Math.round(pe.width),De=Math.round(pe.height),Ae=window.devicePixelRatio||1;c(ne=>ne.width===Ce&&ne.height===De&&ne.dpr===Ae?ne:{width:Ce,height:De,dpr:Ae}),o&&clearTimeout(o),o=setTimeout(()=>{o=null,Ce>0&&De>0&&B.current(Ce,De,Ae)},ln)};A();const U=new ResizeObserver(A);return U.observe(M),()=>{U.disconnect(),o&&clearTimeout(o)}},$=[],e[10]=R,e[11]=$):(R=e[10],$=e[11]),r.useEffect(R,$);let Y,F;e[12]!==v||e[13]!==t||e[14]!==g?(F=()=>{const M=f.current,o=M==null?void 0:M.getContext("2d");if(!M||!o)return;const A=Math.round(g.width*g.dpr),U=Math.round(g.height*g.dpr);M.width!==A&&(M.width=A),M.height!==U&&(M.height=U),o.setTransform(g.dpr,0,0,g.dpr,0,0),o.clearRect(0,0,g.width,g.height),!(!t||v.width<=0||v.height<=0)&&hn(o,t.bitmap,v)},Y=[t,v,g],e[12]=v,e[13]=t,e[14]=g,e[15]=Y,e[16]=F):(Y=e[15],F=e[16]),r.useEffect(F,Y);let T,w;e[17]!==t?(T=()=>()=>Ge(t),w=[t],e[17]=t,e[18]=T,e[19]=w):(T=e[18],w=e[19]),r.useEffect(T,w);let V;e[20]!==v?(V=function(o,A,U){const pe=f.current;return pe?ot(o,A,pe.getBoundingClientRect(),v,{clamp:U}):null},e[20]=v,e[21]=V):V=e[21];const L=V;let Q;e[22]!==l?(Q=function(o,A,U,pe,Ce){l({type:"mouse",event:o,x:A.x,y:A.y,button:U,clickCount:pe,modifiers:Ce})},e[22]=l,e[23]=Q):Q=e[23];const O=Q;let X;e[24]===Symbol.for("react.memo_cache_sentinel")?(X=function(o){const A=_.current,U=Date.now(),pe=o.button===A.button&&U-A.at<rn&&Math.abs(o.clientX-A.x)<=dt&&Math.abs(o.clientY-A.y)<=dt;return _.current={count:pe?A.count+1:1,at:U,x:o.clientX,y:o.clientY,button:o.button},_.current.count},e[24]=X):X=e[24];const z=X;let D;e[25]!==L||e[26]!==O?(D=function(){const o=x.current;if(x.current=null,!o)return;const A=L(o.clientX,o.clientY,y.current);A&&O("move",A,"none",0,o.modifiers)},e[25]=L,e[26]=O,e[27]=D):D=e[27];const G=D;let K;e[28]!==G?(K=function(){b.current!==null&&(cancelAnimationFrame(b.current),b.current=null),G()},e[28]=G,e[29]=K):K=e[29];const q=K;let W;e[30]!==L||e[31]!==O?(W=function(o){if(o.currentTarget.focus(),o.button===ut)return;const A=L(o.clientX,o.clientY,!1);A&&(o.currentTarget.setPointerCapture(o.pointerId),y.current=!0,O("down",A,ct(o.button),z(o),Ie(o)))},e[30]=L,e[31]=O,e[32]=W):W=e[32];const J=W;let te;e[33]!==G?(te=function(o){x.current={clientX:o.clientX,clientY:o.clientY,modifiers:Ie(o)},b.current===null&&(b.current=requestAnimationFrame(()=>{b.current=null,G()}))},e[33]=G,e[34]=te):te=e[34];const ge=te;let ce;e[35]!==q||e[36]!==L||e[37]!==O?(ce=function(o){q();const A=y.current;if(y.current=!1,o.currentTarget.hasPointerCapture(o.pointerId)&&o.currentTarget.releasePointerCapture(o.pointerId),o.button===ut)return;const U=L(o.clientX,o.clientY,A);U&&O("up",U,ct(o.button),_.current.count,Ie(o))},e[35]=q,e[36]=L,e[37]=O,e[38]=ce):ce=e[38];const he=ce;let ue;e[39]!==L||e[40]!==O?(ue=function(o){o.preventDefault();const A=L(o.clientX,o.clientY,!1);if(!A)return;const U=Ie(o);O("down",A,"right",1,U),O("up",A,"right",1,U)},e[39]=L,e[40]=O,e[41]=ue):ue=e[41];const de=ue;let fe;e[42]!==l?(fe=function(o){if(o.key==="Escape"){o.currentTarget.blur();return}ft(o)||o.preventDefault();const A={type:"key",event:"down",key:o.key,code:o.code,modifiers:Ie(o)},U=mn(o);U!==void 0&&(A.text=U),C.current.set(o.code,o.key),l(A)},e[42]=l,e[43]=fe):fe=e[43];const Se=fe;let ae;e[44]!==l?(ae=function(o){o.key!=="Escape"&&(ft(o)||o.preventDefault(),C.current.delete(o.code),l({type:"key",event:"up",key:o.key,code:o.code,modifiers:Ie(o)}))},e[44]=l,e[45]=ae):ae=e[45];const me=ae;let oe,re;e[46]!==S||e[47]!==m||e[48]!==v||e[49]!==l?(oe=()=>{const M=f.current;if(!M)return;const o=A=>{A.preventDefault();const U=ot(A.clientX,A.clientY,M.getBoundingClientRect(),v);U&&l({type:"wheel",x:U.x,y:U.y,deltaX:mt(A.deltaX,A.deltaMode,m),deltaY:mt(A.deltaY,A.deltaMode,S),modifiers:Ie(A)})};return M.addEventListener("wheel",o,{passive:!1}),()=>M.removeEventListener("wheel",o)},re=[l,v,m,S],e[46]=S,e[47]=m,e[48]=v,e[49]=l,e[50]=oe,e[51]=re):(oe=e[50],re=e[51]),r.useEffect(oe,re);let I,ee;e[52]!==i||e[53]!==l?(I=()=>{if(!i)return;const M=o=>{var U;const A=(U=o.clipboardData)==null?void 0:U.getData("text/plain");A&&(o.preventDefault(),l({type:"paste",text:A}))};return document.addEventListener("paste",M),()=>document.removeEventListener("paste",M)},ee=[i,l],e[52]=i,e[53]=l,e[54]=I,e[55]=ee):(I=e[54],ee=e[55]),r.useEffect(I,ee);let se,je;e[56]===Symbol.for("react.memo_cache_sentinel")?(se=()=>()=>{b.current!==null&&cancelAnimationFrame(b.current)},je=[],e[56]=se,e[57]=je):(se=e[56],je=e[57]),r.useEffect(se,je);let be;e[58]!==l?(be=()=>{for(const[M,o]of C.current)l({type:"key",event:"up",key:o,code:M,modifiers:0});C.current.clear()},e[58]=l,e[59]=be):be=e[59];const ie=be;let we,H;e[60]!==ie?(we=()=>ie,H=[ie],e[60]=ie,e[61]=we,e[62]=H):(we=e[61],H=e[62]),r.useEffect(we,H);let le;e[63]!==u?(le=Re("relative min-h-0 min-w-0 overflow-hidden bg-muted/30",u),e[63]=u,e[64]=le):le=e[64];const Ne=i&&"ring-2 ring-ring ring-inset";let xe;e[65]!==Ne?(xe=Re("block size-full cursor-default touch-none select-none outline-none",Ne),e[65]=Ne,e[66]=xe):xe=e[66];let _e;e[67]===Symbol.for("react.memo_cache_sentinel")?(_e=()=>h(!0),e[67]=_e):_e=e[67];let ke;e[68]!==ie?(ke=()=>{h(!1),ie()},e[68]=ie,e[69]=ke):ke=e[69];let Ee;e[70]!==de||e[71]!==Se||e[72]!==me||e[73]!==J||e[74]!==ge||e[75]!==he||e[76]!==xe||e[77]!==ke?(Ee=s.jsx("canvas",{ref:f,role:"application","aria-label":"Browser viewport",tabIndex:0,className:xe,onFocus:_e,onBlur:ke,onPointerDown:J,onPointerMove:ge,onPointerUp:he,onPointerCancel:he,onContextMenu:de,onKeyDown:Se,onKeyUp:me}),e[70]=de,e[71]=Se,e[72]=me,e[73]=J,e[74]=ge,e[75]=he,e[76]=xe,e[77]=ke,e[78]=Ee):Ee=e[78];let ve;e[79]!==i?(ve=i&&s.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-2 flex justify-center",children:s.jsx("span",{className:"rounded-full bg-background/80 px-2 py-0.5 text-[10px] text-muted-foreground shadow-xs backdrop-blur-sm",children:un})}),e[79]=i,e[80]=ve):ve=e[80];let Te;return e[81]!==le||e[82]!==Ee||e[83]!==ve?(Te=s.jsxs("div",{ref:d,className:le,children:[Ee,ve]}),e[81]=le,e[82]=Ee,e[83]=ve,e[84]=Te):Te=e[84],Te}const pn="browser-panel-session",gn="browser-panel-follow",bn=1e4,ht=3e3,wn=[];function Dn({context:n,active:e,closePanel:t}){var oe,re;const[l,a]=et(tt(pn),Oe),[u,d]=et(tt(gn),!0),[f,x]=r.useState(!1),[b,y]=r.useState(null),[k,_]=r.useState(null),[p,C]=r.useState(!1),j=r.useRef(0),{status:g,error:c,create:i,remove:h,stop:m,setArchived:S,readSkillTargets:N,installSkill:v}=ws(e),B=r.useCallback(I=>void xt(I),[]),E=Ds(e?l:null,B),P=(g==null?void 0:g.sessions)??wn,R=r.useMemo(()=>ls(n.session),[n.session]),$=(R==null?void 0:R.session)??null,Y=P.some(I=>I.name===$&&!I.archived);r.useEffect(()=>{!u||$===null||$===l||!Y||Date.now()-j.current<bn||a($)},[u,$,Y,l,a]);const F=r.useCallback(I=>{j.current=Date.now(),a(I)},[a]),T=r.useCallback(async I=>{x(!0);try{const ee=await I();return y(ee.ok?null:ee.error),ee}finally{x(!1)}},[]),{send:w}=E,V=r.useCallback((I,ee,se)=>{w({type:"viewport",width:I,height:ee,dpr:se})},[w]),L=r.useCallback(I=>{I&&(j.current=0),d(I)},[d]),Q=r.useCallback(()=>F(Oe),[F]),O=r.useCallback(()=>C(!0),[]),X=r.useCallback(I=>{F(Oe),T(()=>h(I))},[F,T,h]),z=r.useCallback(I=>void T(()=>m(I)),[T,m]),D=r.useCallback(async(I,ee)=>{const se=await T(()=>S(I,ee));return se.ok&&ee&&I===l&&F(Oe),se},[T,S,l,F]),G=r.useCallback(I=>w({type:"navigate",url:I}),[w]),K=r.useCallback(()=>w({type:"back"}),[w]),q=r.useCallback(()=>w({type:"forward"}),[w]),W=r.useCallback(()=>w({type:"reload"}),[w]),J=r.useCallback(I=>w({type:"follow",targetId:I}),[w]),te=r.useCallback(I=>w({type:"close-tab",targetId:I}),[w]),ge=yn(E.lastFrameAt),ce=((oe=E.state)==null?void 0:oe.state)??null,he=(g==null?void 0:g.installed)===!1||ce==="not-installed",ue=!he&&ce==="live",de=!he&&ce==="stopped",fe=P.find(I=>I.name===l)??null,Se=ue&&(E.status==="disconnected"||E.status==="connecting"),ae=E.error??b??c,me=ae!==null&&ae!==k?ae:null;return s.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[s.jsx(Ws,{sessions:P,selected:l,currentSessionId:((re=n.session)==null?void 0:re.sessionId)??null,followAgent:u,busy:f,onSelect:F,onToggleFollow:L,onOpenSkill:O,onCreate:i,onRemove:X,onStop:z,onSetArchived:D,onShowDefault:Q,onClose:t}),ue&&s.jsx(Ms,{page:E.page,tabs:E.tabs,followed:E.followed,status:Se?"offline":ge,onNavigate:G,onBack:K,onForward:q,onReload:W,onFollow:J,onCloseTab:te}),me&&s.jsx(kn,{message:me,onDismiss:()=>{y(null),_(ae)}}),s.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[he&&s.jsx(Ls,{onOpenSkill:O}),de&&s.jsx(Os,{name:l,lastUrl:(fe==null?void 0:fe.lastUrl)??null,onOpen:I=>w({type:"launch",url:I})}),ue&&s.jsxs(s.Fragment,{children:[s.jsx(xn,{className:"flex-1",frame:E.frame,send:w,onSizeChange:V}),Se&&s.jsx(Sn,{}),s.jsx(Rs,{activity:R&&R.session===l?R:null})]}),!he&&!de&&!ue&&s.jsxs("div",{role:"status",className:"flex flex-1 items-center justify-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Rt,{}),"Connecting to ",l,"…"]})]}),s.jsx(Js,{open:p,onOpenChange:C,readTargets:N,install:v})]})}function yn(n){const e=ye.c(5),[,t]=r.useState(0);let l;e[0]!==t||e[1]!==n?(l=()=>{if(n===null)return;const u=n+ht-Date.now();if(u<=0)return;const d=setTimeout(()=>t(jn),u);return()=>clearTimeout(d)},e[0]=t,e[1]=n,e[2]=l):l=e[2];let a;return e[3]!==n?(a=[n],e[3]=n,e[4]=a):a=e[4],r.useEffect(l,a),n===null?"idle":Date.now()-n<ht?"live":"idle"}function jn(n){return n+1}function Sn(){const n=ye.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 flex justify-center p-2",children:s.jsx("span",{role:"status",className:"rounded-full bg-background/85 px-2.5 py-0.5 text-[11px] text-muted-foreground shadow-xs backdrop-blur-sm",children:"Reconnecting…"})}),n[0]=e):e=n[0],e}function kn(n){const e=ye.c(9),{message:t,onDismiss:l}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Ot,{"aria-hidden":!0,className:"size-3.5 shrink-0"}),e[0]=a):a=e[0];let u;e[1]!==t?(u=s.jsx("span",{className:"min-w-0 flex-1 truncate",children:t}),e[1]=t,e[2]=u):u=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Fe,{"data-icon":"inline-start"}),e[3]=d):d=e[3];let f;e[4]!==l?(f=s.jsx(Z,{variant:"ghost",size:"icon-xs","aria-label":"Dismiss",onClick:l,children:d}),e[4]=l,e[5]=f):f=e[5];let x;return e[6]!==u||e[7]!==f?(x=s.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-destructive/30 bg-destructive/10 px-2 py-1 text-xs text-destructive",children:[a,u,f]}),e[6]=u,e[7]=f,e[8]=x):x=e[8],x}export{Dn as BrowserPanel};
|