import{r as a,u as c,j as e,C as f}from"./index-CgQG7qql.js";function h(){const[i,r]=a.useState(!1),s=c(t=>t.pendingPermissions.size),l=c(t=>t.sessionStatus),d=c(t=>t.cliConnected),u=c(t=>t.connectionStatus);a.useEffect(()=>{s>0&&r(!0)},[s]);const x=a.useCallback(()=>r(!1),[]),b=a.useCallback(()=>r(!0),[]),n=l==="running"||l==="compacting",o=u==="connected"&&d;return i?e.jsxs("div",{className:`fixed bottom-6 right-6 w-[420px] h-[620px] z-50
                    border border-cc-primary/20 rounded-2xl overflow-hidden
                    shadow-[0_0_40px_rgba(249,115,22,0.15)] ring-1 ring-white/5
                    before:absolute before:inset-0 before:bg-cc-surface/80 before:backdrop-blur-2xl before:-z-10
                    animate-[fadeSlideIn_0.2s_ease-out] flex flex-col`,children:[e.jsxs("div",{className:"relative z-10 flex items-center justify-between px-4 py-2.5 border-b border-cc-border/40",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(m,{isConnected:o,isWorking:n}),e.jsx("span",{className:"text-xs text-cc-muted font-body",children:o?n?"Working…":"Ready":"Disconnected"})]}),e.jsx("button",{onClick:x,className:`w-6 h-6 rounded-full bg-cc-surface/60 border border-white/10
                       flex items-center justify-center text-cc-muted
                       hover:text-cc-fg hover:border-cc-primary/30 transition-all text-xs`,children:"✕"})]}),e.jsx("div",{className:"relative z-10 flex-1 min-h-0",children:e.jsx(f,{})})]}):e.jsxs("button",{onClick:b,className:`fixed bottom-6 right-6 z-50 w-14 h-14 rounded-full
                 bg-cc-surface border-2
                 flex items-center justify-center
                 hover:shadow-[0_0_30px_rgba(249,115,22,0.3)]
                 transition-all duration-300 cursor-pointer group`,style:{borderColor:n?"rgba(251,191,36,0.5)":o?"rgba(249,115,22,0.4)":"rgba(161,161,170,0.3)",boxShadow:n?"0 0 24px rgba(251,191,36,0.25)":"0 0 20px rgba(249,115,22,0.15)"},children:[n&&e.jsx("div",{className:"absolute inset-0 rounded-full border-2 border-amber-400/50 animate-ping"}),e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:`w-6 h-6 transition-colors ${o?"text-cc-primary group-hover:text-cc-primary-hover":"text-cc-muted"}`,children:e.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),s>0&&e.jsx("div",{className:`absolute -top-1 -right-1 w-5 h-5 rounded-full bg-amber-500
                      text-[10px] font-bold text-black flex items-center justify-center
                      animate-pulse`,children:s})]})}function m({isConnected:i,isWorking:r}){const s=i?r?"bg-amber-400":"bg-emerald-400":"bg-red-500/80";return e.jsxs("span",{className:"relative flex h-2.5 w-2.5",children:[r&&e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-amber-400 opacity-75"}),e.jsx("span",{className:`relative inline-flex rounded-full h-2.5 w-2.5 ${s}`})]})}export{h as default};
