adam-agent-server 1.11.0 → 1.12.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/package.json +1 -1
- package/web/dist/assets/{Button-CYDgoTTo.js → Button-VPwTNGpF.js} +1 -1
- package/web/dist/assets/{Card-DDGXsHus.js → Card-C2N6k4gh.js} +1 -1
- package/web/dist/assets/{ChannelDetail-Bb8P8It_.js → ChannelDetail-DktmpO0A.js} +1 -1
- package/web/dist/assets/{Channels-8j28oydE.js → Channels-ozCXdZMq.js} +2 -2
- package/web/dist/assets/{Chat-BZwLDoYO.js → Chat-CggvtidD.js} +1 -1
- package/web/dist/assets/{Dashboard-Cv0AtO-o.js → Dashboard-z37ZVhzH.js} +1 -1
- package/web/dist/assets/{EmptyState-EuQHAv5Y.js → EmptyState-CWS9PJND.js} +1 -1
- package/web/dist/assets/{EnvVarEditor-r-l-u4V7.js → EnvVarEditor-D0kGIBcl.js} +1 -1
- package/web/dist/assets/{EventDefDetail-asUFrbQE.js → EventDefDetail-BiXTA6LF.js} +1 -1
- package/web/dist/assets/Events-C4P3jjZd.js +1 -0
- package/web/dist/assets/{Evolution-DIqYOSb8.js → Evolution-C884p_CE.js} +1 -1
- package/web/dist/assets/{FeatureRequests-BxPqLR1x.js → FeatureRequests-Ck0WQnXX.js} +1 -1
- package/web/dist/assets/{GoalDetail-Bkvgg6uI.js → GoalDetail-DJOyf7By.js} +1 -1
- package/web/dist/assets/Goals-CDZWDuXR.js +1 -0
- package/web/dist/assets/{Logs-DnaaHV0Y.js → Logs-6r7fnBn7.js} +1 -1
- package/web/dist/assets/{Memories-Dq9S-Tsi.js → Memories-CvPaqv5r.js} +1 -1
- package/web/dist/assets/{Mistakes-D5lW31Co.js → Mistakes-aUhkqHDC.js} +1 -1
- package/web/dist/assets/{NotFound-gJVrOtER.js → NotFound-R6tIzhL0.js} +1 -1
- package/web/dist/assets/{PageHeader-CugYeCci.js → PageHeader-D9lLjo0N.js} +1 -1
- package/web/dist/assets/Plugins-CtwoMUoj.js +1 -0
- package/web/dist/assets/RoleDetail-B32225ae.js +33 -0
- package/web/dist/assets/{Roles-EBUueS_P.js → Roles-CGYsxuq8.js} +1 -1
- package/web/dist/assets/{SectionHeader-DihC0CnO.js → SectionHeader-BB3H3F_P.js} +1 -1
- package/web/dist/assets/Settings-D2jrO8-G.js +1 -0
- package/web/dist/assets/{Strategies-3IV9eueQ.js → Strategies-DUps-2I9.js} +1 -1
- package/web/dist/assets/Switch-B_R_EX9s.js +1 -0
- package/web/dist/assets/{Table-Cf6m8zLu.js → Table-D4lT5uHx.js} +1 -1
- package/web/dist/assets/Tabs-CwzWpI-7.js +1 -0
- package/web/dist/assets/{TaskDetail-BmXaH3sx.js → TaskDetail-DKminIM_.js} +1 -1
- package/web/dist/assets/Work-uD_6IieV.js +1 -0
- package/web/dist/assets/es2015-DCW7LI8d.js +41 -0
- package/web/dist/assets/index-6f2jcj0h.css +2 -0
- package/web/dist/assets/index-Bl-2p6d8.js +12 -0
- package/web/dist/assets/{useIsMobileLayout-2GbB90oO.js → useIsMobileLayout-D6Tz5o5h.js} +1 -1
- package/web/dist/assets/usePluginsWithUsage-CSQr03vZ.js +1 -0
- package/web/dist/assets/{vendor-icons-PF9RcPJx.js → vendor-icons-jzPiR6xl.js} +1 -1
- package/web/dist/assets/{vendor-react-Cxy4EVtR.js → vendor-react-CIkiuNDu.js} +1 -1
- package/web/dist/assets/{vendor-state-aQJ7d4tA.js → vendor-state-CEOsUh-T.js} +1 -1
- package/web/dist/index.html +7 -7
- package/web/dist/assets/AlertDialog-DhA65f_0.js +0 -51
- package/web/dist/assets/Events-DtkHL-r2.js +0 -1
- package/web/dist/assets/Goals-CkKJDCiU.js +0 -1
- package/web/dist/assets/Plugins-CoRmK2UG.js +0 -1
- package/web/dist/assets/RoleDetail-BHJA_PAn.js +0 -33
- package/web/dist/assets/Settings-DZHAGazz.js +0 -1
- package/web/dist/assets/Switch-B3w5KMMc.js +0 -1
- package/web/dist/assets/Work-CvQrOKtL.js +0 -1
- package/web/dist/assets/index-BsKlGx3x.js +0 -2
- package/web/dist/assets/index-EqsPGp9a.css +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{lt as t}from"./vendor-icons-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{lt as t}from"./vendor-icons-jzPiR6xl.js";import{t as n}from"./vendor-react-CIkiuNDu.js";import{t as r}from"./Button-VPwTNGpF.js";import{o as i,u as a}from"./api-D-UzHSDq.js";import{t as o}from"./index-Bl-2p6d8.js";import{t as s}from"./Card-C2N6k4gh.js";import{t as c}from"./SectionHeader-BB3H3F_P.js";import{t as l}from"./EmptyState-CWS9PJND.js";var u=e(t(),1),d=n(),f={new:`muted`,acknowledged:`success`,dismissed:`secondary`};function p(e){let t=Date.now()-e;if(Math.floor(t/6e4)<1)return`just now`;let n=Math.floor(t/36e5);return n<24?`${n}h ago`:`${Math.floor(t/864e5)}d ago`}function m(e){return new Date(e).toLocaleString()}function h(){let[e,t]=(0,u.useState)([]),[n,h]=(0,u.useState)(!0),[g,_]=(0,u.useState)(`all`),[v,y]=(0,u.useState)(null),[b,x]=(0,u.useState)(null),S=(0,u.useCallback)(async()=>{h(!0);try{t(await i(g===`all`?void 0:g))}catch{t([])}finally{h(!1)}},[g]);(0,u.useEffect)(()=>{S()},[S]);let C=async(e,t)=>{x(e);try{await a(e,t),await S()}finally{x(null)}};return(0,d.jsxs)(`div`,{className:`space-y-5`,children:[(0,d.jsx)(c,{title:`Mistake Patterns`,description:`Cross-role failure patterns extracted from audit data.`,compact:!0,action:(0,d.jsx)(r,{variant:`ghost`,size:`sm`,onClick:()=>void S(),children:`Refresh`})}),(0,d.jsx)(`div`,{className:`flex gap-2`,children:[`all`,`new`,`acknowledged`,`dismissed`].map(e=>(0,d.jsx)(`button`,{type:`button`,onClick:()=>_(e),className:`rounded px-3 py-1.5 text-xs font-medium transition-colors ${g===e?`bg-[var(--app-accent)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-muted)] hover:text-[var(--app-text)]`}`,children:e===`all`?`All`:e.charAt(0).toUpperCase()+e.slice(1)},e))}),n?(0,d.jsx)(s,{children:(0,d.jsx)(`p`,{className:`text-sm text-[var(--app-text-muted)]`,children:`Loading...`})}):e.length===0?(0,d.jsx)(s,{children:(0,d.jsx)(l,{title:`No mistake patterns`,description:`Run the Mistake Digest template to aggregate failure signals from audit data.`})}):(0,d.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>(0,d.jsxs)(s,{padding:!1,children:[(0,d.jsx)(`div`,{className:`p-4 cursor-pointer hover:bg-black/[0.02]`,onClick:()=>y(v===e.id?null:e.id),role:`button`,tabIndex:0,onKeyDown:t=>{t.key===`Enter`&&y(v===e.id?null:e.id)},children:(0,d.jsx)(`div`,{className:`flex items-start justify-between gap-3`,children:(0,d.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,d.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,d.jsx)(o,{variant:f[e.status],children:e.status}),(0,d.jsx)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:p(e.lastSeen)}),(0,d.jsx)(`span`,{className:`rounded border border-[var(--app-border)] px-1.5 py-0.5 text-[10px] text-[var(--app-text-muted)] font-mono`,children:e.dimensionType})]}),(0,d.jsx)(`p`,{className:`text-sm font-medium text-[var(--app-text)]`,children:e.dimensionValue}),(0,d.jsxs)(`p`,{className:`text-xs text-[var(--app-text-muted)]`,children:[e.count,` occurrence`,e.count===1?``:`s`,` across `,e.roleIds.length,` role`,e.roleIds.length===1?``:`s`]})]})})}),v===e.id&&(0,d.jsxs)(`div`,{className:`border-t border-[var(--app-border)] p-4 space-y-3`,children:[(0,d.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`p`,{className:`text-xs font-medium text-[var(--app-text-subtle)] uppercase tracking-[0.14em] mb-1`,children:`Dimension`}),(0,d.jsx)(`p`,{className:`text-sm text-[var(--app-text)] font-mono`,children:e.dimensionType})]}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`p`,{className:`text-xs font-medium text-[var(--app-text-subtle)] uppercase tracking-[0.14em] mb-1`,children:`Dimension Value`}),(0,d.jsx)(`p`,{className:`text-sm text-[var(--app-text)] font-mono break-all`,children:e.dimensionValue})]}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`p`,{className:`text-xs font-medium text-[var(--app-text-subtle)] uppercase tracking-[0.14em] mb-1`,children:`Affected Roles`}),(0,d.jsx)(`p`,{className:`text-sm text-[var(--app-text)]`,children:e.roleIds.length>0?e.roleIds.join(`, `):`—`})]}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`p`,{className:`text-xs font-medium text-[var(--app-text-subtle)] uppercase tracking-[0.14em] mb-1`,children:`Evidence Items`}),(0,d.jsx)(`p`,{className:`text-sm text-[var(--app-text)]`,children:e.sampleEvidenceIds.length>0?(0,d.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[e.sampleEvidenceIds.slice(0,5).map(e=>(0,d.jsxs)(`span`,{className:`text-xs`,children:[(0,d.jsx)(`span`,{className:`rounded border border-[var(--app-border)] px-1 py-0.5 text-[10px] font-mono`,children:e.source}),` `,e.id]},e.id)),e.sampleEvidenceIds.length>5&&(0,d.jsxs)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`+`,e.sampleEvidenceIds.length-5,` more`]})]}):`—`})]})]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-4 pt-1`,children:[(0,d.jsxs)(`p`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`First seen: `,m(e.firstSeen)]}),(0,d.jsxs)(`p`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`Last seen: `,m(e.lastSeen)]})]}),(0,d.jsx)(`div`,{className:`flex gap-2 pt-1`,children:[`new`,`acknowledged`,`dismissed`].map(t=>(0,d.jsx)(r,{variant:e.status===t?`default`:`ghost`,size:`sm`,disabled:b===e.id||e.status===t,onClick:n=>{n.stopPropagation(),C(e.id,t)},children:t.charAt(0).toUpperCase()+t.slice(1)},t))})]})]},e.id))})]})}export{h as Mistakes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-icons-
|
|
1
|
+
import"./vendor-icons-jzPiR6xl.js";import{r as e,t}from"./vendor-react-CIkiuNDu.js";var n=t();function r(){return(0,n.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-4 text-[var(--app-text-muted)]`,children:[(0,n.jsx)(`span`,{className:`text-6xl font-bold text-[var(--app-text-subtle)]`,children:`404`}),(0,n.jsx)(`p`,{className:`text-lg`,children:`Page not found`}),(0,n.jsx)(e,{to:`/`,className:`text-[var(--app-accent)] hover:text-[var(--app-accent)] underline`,children:`Back to Dashboard`})]})}export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./vendor-react-
|
|
1
|
+
import{t as e}from"./vendor-react-CIkiuNDu.js";import{n as t}from"./dist-CgGno8kE.js";var n=e();function r({title:e,description:r,eyebrow:i,metrics:a,actions:o,compact:s=!1,className:c}){return(0,n.jsx)(`section`,{className:t(`surface-panel-elevated rounded-xl`,s?`px-4 py-4 lg:px-5 lg:py-5`:`px-5 py-5 lg:px-6 lg:py-6`,c),children:(0,n.jsxs)(`div`,{className:t(`flex flex-col lg:flex-row lg:justify-between`,s?`gap-3 lg:items-start`:`gap-4 lg:items-end`),children:[(0,n.jsxs)(`div`,{className:t(s?`space-y-1.5`:`space-y-2`),children:[i?(0,n.jsx)(`p`,{className:`text-kicker`,children:i}):null,(0,n.jsxs)(`div`,{className:t(s?`space-y-0.5`:`space-y-1`),children:[(0,n.jsx)(`h1`,{className:`text-title`,children:e}),r?(0,n.jsx)(`p`,{className:t(`max-w-2xl text-sm text-[var(--app-text-muted)]`,s?`leading-5`:`leading-6`),children:r}):null]}),a&&a.length>0?(0,n.jsx)(`div`,{className:t(`flex flex-wrap gap-x-4 gap-y-2 pt-1`,s?`pt-0.5`:`pt-1`),children:a.map(e=>(0,n.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,n.jsx)(`span`,{className:`block text-[10px] uppercase tracking-[0.18em] text-[var(--app-text-subtle)]`,children:e.label}),(0,n.jsx)(`span`,{className:`text-sm font-medium text-[var(--app-text)]`,children:e.value})]},e.label))}):null]}),o?(0,n.jsx)(`div`,{className:`flex w-full flex-wrap items-center gap-2 lg:w-auto lg:justify-end`,children:o}):null]})})}export{r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{G as t,K as n,M as r,R as i,S as a,X as o,et as s,g as c,lt as l,n as u,nt as d,rt as f,tt as p,x as ee,y as m}from"./vendor-icons-jzPiR6xl.js";import{t as te}from"./vendor-react-CIkiuNDu.js";import{n as h}from"./dist-CgGno8kE.js";import{_ as g,a as ne,c as _,d as v,f as y,i as re,m as b,n as ie,o as x,p as S,r as C,s as w,t as ae,u as oe,v as T}from"./es2015-DCW7LI8d.js";import{i as E,r as D,t as O}from"./Button-VPwTNGpF.js";import{t as k}from"./api-D-UzHSDq.js";import{S as A,_ as se,b as ce,g as j,h as M,m as le,p as N,t as P,v as ue,x as F,y as de}from"./index-Bl-2p6d8.js";import{t as I}from"./Card-C2N6k4gh.js";import{t as fe}from"./PageHeader-D9lLjo0N.js";import{t as pe}from"./SectionHeader-BB3H3F_P.js";import{a as me}from"./format-BUYXZqDw.js";import{t as he}from"./EmptyState-CWS9PJND.js";import{t as L}from"./ui-CerQw0jA.js";import{a as ge,i as R,n as _e,o as z,r as B,t as ve}from"./Table-D4lT5uHx.js";import{n as ye,r as be,t as xe}from"./usePluginsWithUsage-CSQr03vZ.js";import{a as Se,c as Ce,i as we,l as Te,n as Ee,o as De,r as Oe,s as ke,t as Ae}from"./Tabs-CwzWpI-7.js";var V=e(l(),1),H=te();function je(){let[e,t]=(0,V.useState)(!1),[n,r]=(0,V.useState)([]),i=(0,V.useCallback)(async()=>{try{r((await k(`/plugins/stats?limit=20`)).stats)}catch{r([])}},[]);return(0,H.jsxs)(I,{children:[(0,H.jsxs)(`button`,{className:`flex w-full items-center gap-2 text-sm font-semibold text-[var(--app-text)]`,onClick:()=>{!e&&n.length===0&&i(),t(e=>!e)},children:[(0,H.jsx)(f,{size:L.sm,className:`text-[var(--app-text-muted)]`}),`Usage Stats`,e?(0,H.jsx)(p,{size:L.xs,className:`ml-auto`}):(0,H.jsx)(s,{size:L.xs,className:`ml-auto`})]}),e?(0,H.jsx)(`div`,{className:`mt-3`,children:n.length===0?(0,H.jsx)(`p`,{className:`py-2 text-center text-xs text-[var(--app-text-subtle)]`,children:`No usage data yet`}):(0,H.jsxs)(ve,{children:[(0,H.jsx)(ge,{children:(0,H.jsxs)(z,{children:[(0,H.jsx)(R,{children:`Plugin`}),(0,H.jsx)(R,{children:`Usage Count`}),(0,H.jsx)(R,{children:`Last Used`})]})}),(0,H.jsx)(_e,{children:n.map(e=>(0,H.jsxs)(z,{children:[(0,H.jsx)(B,{className:`text-xs font-medium text-[var(--app-text)]`,children:e.pluginName}),(0,H.jsx)(B,{className:`font-mono text-xs text-[var(--app-text-muted)]`,children:e.usageCount}),(0,H.jsx)(B,{className:`text-xs text-[var(--app-text-muted)]`,children:e.lastUsed?me(e.lastUsed):`—`})]},e.pluginPath))})]})}):null]})}var Me=[`Enter`,` `],Ne=[`ArrowDown`,`PageUp`,`Home`],Pe=[`ArrowUp`,`PageDown`,`End`],Fe=[...Ne,...Pe],Ie={ltr:[...Me,`ArrowRight`],rtl:[...Me,`ArrowLeft`]},Le={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},U=`Menu`,[W,Re,ze]=Te(U),[G,Be]=g(U,[ze,A,ke]),K=A(),Ve=ke(),[He,q]=G(U),[Ue,J]=G(U),We=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=K(t),[c,l]=V.useState(null),u=V.useRef(!1),d=v(a),f=Ce(i);return V.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,H.jsx)(F,{...s,children:(0,H.jsx)(He,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,H.jsx)(Ue,{scope:t,onClose:V.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};We.displayName=U;var Ge=`MenuAnchor`,Ke=V.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=K(n);return(0,H.jsx)(ue,{...i,...r,ref:t})});Ke.displayName=Ge;var qe=`MenuPortal`,[Je,Ye]=G(qe,{forceMount:void 0}),Xe=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=q(qe,t);return(0,H.jsx)(Je,{scope:t,forceMount:n,children:(0,H.jsx)(x,{present:n||a.open,children:(0,H.jsx)(w,{asChild:!0,container:i,children:r})})})};Xe.displayName=qe;var Y=`MenuContent`,[Ze,Qe]=G(Y),$e=V.forwardRef((e,t)=>{let n=Ye(Y,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=q(Y,e.__scopeMenu),o=J(Y,e.__scopeMenu);return(0,H.jsx)(W.Provider,{scope:e.__scopeMenu,children:(0,H.jsx)(x,{present:r||a.open,children:(0,H.jsx)(W.Slot,{scope:e.__scopeMenu,children:o.modal?(0,H.jsx)(et,{...i,ref:t}):(0,H.jsx)(tt,{...i,ref:t})})})})}),et=V.forwardRef((e,t)=>{let n=q(Y,e.__scopeMenu),r=V.useRef(null),i=E(t,r);return V.useEffect(()=>{let e=r.current;if(e)return ae(e)},[]),(0,H.jsx)(rt,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:T(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),tt=V.forwardRef((e,t)=>{let n=q(Y,e.__scopeMenu);return(0,H.jsx)(rt,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),nt=b(`MenuContent.ScrollLock`),rt=V.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:ee,...m}=e,te=q(Y,n),h=J(Y,n),g=K(n),ne=Ve(n),_=Re(n),[v,y]=V.useState(null),b=V.useRef(null),x=E(t,b,te.onContentChange),S=V.useRef(0),w=V.useRef(``),ae=V.useRef(0),D=V.useRef(null),O=V.useRef(`right`),k=V.useRef(0),A=ee?ie:V.Fragment,se=ee?{as:nt,allowPinchZoom:!0}:void 0,j=e=>{let t=w.current+e,n=_().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Bt(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){w.current=t,window.clearTimeout(S.current),t!==``&&(S.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};V.useEffect(()=>()=>window.clearTimeout(S.current),[]),C();let M=V.useCallback(e=>O.current===D.current?.side&&Ht(e,D.current?.area),[]);return(0,H.jsx)(Ze,{scope:n,searchRef:w,onItemEnter:V.useCallback(e=>{M(e)&&e.preventDefault()},[M]),onItemLeave:V.useCallback(e=>{M(e)||(b.current?.focus(),y(null))},[M]),onTriggerLeave:V.useCallback(e=>{M(e)&&e.preventDefault()},[M]),pointerGraceTimerRef:ae,onPointerGraceIntentChange:V.useCallback(e=>{D.current=e},[]),children:(0,H.jsx)(A,{...se,children:(0,H.jsx)(re,{asChild:!0,trapped:i,onMountAutoFocus:T(a,e=>{e.preventDefault(),b.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,H.jsx)(oe,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,H.jsx)(De,{asChild:!0,...ne,dir:h.dir,orientation:`vertical`,loop:r,currentTabStopId:v,onCurrentTabStopIdChange:y,onEntryFocus:T(c,e=>{h.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,H.jsx)(ce,{role:`menu`,"aria-orientation":`vertical`,"data-state":Ft(te.open),"data-radix-menu-content":``,dir:h.dir,...g,...m,ref:x,style:{outline:`none`,...m.style},onKeyDown:T(m.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&j(e.key));let i=b.current;if(e.target!==i||!Fe.includes(e.key))return;e.preventDefault();let a=_().filter(e=>!e.disabled).map(e=>e.ref.current);Pe.includes(e.key)&&a.reverse(),Rt(a)}),onBlur:T(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(S.current),w.current=``)}),onPointerMove:T(e.onPointerMove,Z(e=>{let t=e.target,n=k.current!==e.clientX;e.currentTarget.contains(t)&&n&&(O.current=e.clientX>k.current?`right`:`left`,k.current=e.clientX)}))})})})})})})});$e.displayName=Y;var it=`MenuGroup`,at=V.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,H.jsx)(y.div,{role:`group`,...r,ref:t})});at.displayName=it;var ot=`MenuLabel`,st=V.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,H.jsx)(y.div,{...r,ref:t})});st.displayName=ot;var ct=`MenuItem`,lt=`menu.itemSelect`,ut=V.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=V.useRef(null),o=J(ct,e.__scopeMenu),s=Qe(ct,e.__scopeMenu),c=E(t,a),l=V.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(lt,{bubbles:!0,cancelable:!0});e.addEventListener(lt,e=>r?.(e),{once:!0}),S(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,H.jsx)(dt,{...i,ref:c,disabled:n,onClick:T(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:T(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:T(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||Me.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});ut.displayName=ct;var dt=V.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Qe(ct,n),s=Ve(n),c=V.useRef(null),l=E(t,c),[u,d]=V.useState(!1),[f,p]=V.useState(``);return V.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,H.jsx)(W.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,H.jsx)(Se,{asChild:!0,...s,focusable:!r,children:(0,H.jsx)(y.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:T(e.onPointerMove,Z(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:T(e.onPointerLeave,Z(e=>o.onItemLeave(e))),onFocus:T(e.onFocus,()=>d(!0)),onBlur:T(e.onBlur,()=>d(!1))})})})}),ft=`MenuCheckboxItem`,pt=V.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,H.jsx)(xt,{scope:e.__scopeMenu,checked:n,children:(0,H.jsx)(ut,{role:`menuitemcheckbox`,"aria-checked":It(n)?`mixed`:n,...i,ref:t,"data-state":Lt(n),onSelect:T(i.onSelect,()=>r?.(It(n)?!0:!n),{checkForDefaultPrevented:!1})})})});pt.displayName=ft;var mt=`MenuRadioGroup`,[ht,gt]=G(mt,{value:void 0,onValueChange:()=>{}}),_t=V.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=v(r);return(0,H.jsx)(ht,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,H.jsx)(at,{...i,ref:t})})});_t.displayName=mt;var vt=`MenuRadioItem`,yt=V.forwardRef((e,t)=>{let{value:n,...r}=e,i=gt(vt,e.__scopeMenu),a=n===i.value;return(0,H.jsx)(xt,{scope:e.__scopeMenu,checked:a,children:(0,H.jsx)(ut,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":Lt(a),onSelect:T(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});yt.displayName=vt;var bt=`MenuItemIndicator`,[xt,St]=G(bt,{checked:!1}),Ct=V.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=St(bt,n);return(0,H.jsx)(x,{present:r||It(a.checked)||a.checked===!0,children:(0,H.jsx)(y.span,{...i,ref:t,"data-state":Lt(a.checked)})})});Ct.displayName=bt;var wt=`MenuSeparator`,Tt=V.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,H.jsx)(y.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});Tt.displayName=wt;var Et=`MenuArrow`,Dt=V.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=K(n);return(0,H.jsx)(de,{...i,...r,ref:t})});Dt.displayName=Et;var Ot=`MenuSub`,[kt,At]=G(Ot),jt=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=q(Ot,t),o=K(t),[s,c]=V.useState(null),[l,u]=V.useState(null),d=v(i);return V.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,H.jsx)(F,{...o,children:(0,H.jsx)(He,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,H.jsx)(kt,{scope:t,contentId:_(),triggerId:_(),trigger:s,onTriggerChange:c,children:n})})})};jt.displayName=Ot;var X=`MenuSubTrigger`,Mt=V.forwardRef((e,t)=>{let n=q(X,e.__scopeMenu),r=J(X,e.__scopeMenu),i=At(X,e.__scopeMenu),a=Qe(X,e.__scopeMenu),o=V.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=V.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return V.useEffect(()=>u,[u]),V.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,H.jsx)(Ke,{asChild:!0,...l,children:(0,H.jsx)(dt,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":Ft(n.open),...e,ref:D(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:T(e.onPointerMove,Z(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:T(e.onPointerLeave,Z(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:T(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||Ie[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Mt.displayName=X;var Nt=`MenuSubContent`,Pt=V.forwardRef((e,t)=>{let n=Ye(Y,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=q(Y,e.__scopeMenu),o=J(Y,e.__scopeMenu),s=At(Nt,e.__scopeMenu),c=V.useRef(null),l=E(t,c);return(0,H.jsx)(W.Provider,{scope:e.__scopeMenu,children:(0,H.jsx)(x,{present:r||a.open,children:(0,H.jsx)(W.Slot,{scope:e.__scopeMenu,children:(0,H.jsx)(rt,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:T(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:T(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:T(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Le[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});Pt.displayName=Nt;function Ft(e){return e?`open`:`closed`}function It(e){return e===`indeterminate`}function Lt(e){return It(e)?`indeterminate`:e?`checked`:`unchecked`}function Rt(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function zt(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Bt(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=zt(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Vt(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Ht(e,t){return t?Vt({x:e.clientX,y:e.clientY},t):!1}function Z(e){return t=>t.pointerType===`mouse`?e(t):void 0}var Ut=We,Wt=Ke,Gt=Xe,Kt=$e,qt=at,Jt=st,Yt=ut,Xt=pt,Zt=_t,Qt=yt,$t=Ct,en=Tt,tn=Dt,nn=Mt,rn=Pt,an=`DropdownMenu`,[on,sn]=g(an,[Be]),Q=Be(),[cn,ln]=on(an),un=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Q(t),l=V.useRef(null),[u,d]=ne({prop:i,defaultProp:a??!1,onChange:o,caller:an});return(0,H.jsx)(cn,{scope:t,triggerId:_(),triggerRef:l,contentId:_(),open:u,onOpenChange:d,onOpenToggle:V.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,H.jsx)(Ut,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};un.displayName=an;var dn=`DropdownMenuTrigger`,fn=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=ln(dn,n),o=Q(n);return(0,H.jsx)(Wt,{asChild:!0,...o,children:(0,H.jsx)(y.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:D(t,a.triggerRef),onPointerDown:T(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:T(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});fn.displayName=dn;var pn=`DropdownMenuPortal`,mn=e=>{let{__scopeDropdownMenu:t,...n}=e,r=Q(t);return(0,H.jsx)(Gt,{...r,...n})};mn.displayName=pn;var hn=`DropdownMenuContent`,gn=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ln(hn,n),a=Q(n),o=V.useRef(!1);return(0,H.jsx)(Kt,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:T(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:T(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});gn.displayName=hn;var _n=`DropdownMenuGroup`,vn=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,H.jsx)(qt,{...i,...r,ref:t})});vn.displayName=_n;var yn=`DropdownMenuLabel`,bn=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,H.jsx)(Jt,{...i,...r,ref:t})});bn.displayName=yn;var xn=`DropdownMenuItem`,Sn=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,H.jsx)(Yt,{...i,...r,ref:t})});Sn.displayName=xn;var Cn=`DropdownMenuCheckboxItem`,wn=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,H.jsx)(Xt,{...i,...r,ref:t})});wn.displayName=Cn;var Tn=`DropdownMenuRadioGroup`,En=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,H.jsx)(Zt,{...i,...r,ref:t})});En.displayName=Tn;var Dn=`DropdownMenuRadioItem`,On=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,H.jsx)(Qt,{...i,...r,ref:t})});On.displayName=Dn;var kn=`DropdownMenuItemIndicator`,An=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,H.jsx)($t,{...i,...r,ref:t})});An.displayName=kn;var jn=`DropdownMenuSeparator`,Mn=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,H.jsx)(en,{...i,...r,ref:t})});Mn.displayName=jn;var Nn=`DropdownMenuArrow`,Pn=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,H.jsx)(tn,{...i,...r,ref:t})});Pn.displayName=Nn;var Fn=`DropdownMenuSubTrigger`,In=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,H.jsx)(nn,{...i,...r,ref:t})});In.displayName=Fn;var Ln=`DropdownMenuSubContent`,Rn=V.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,H.jsx)(rn,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Rn.displayName=Ln;var zn=un,Bn=fn,Vn=mn,Hn=gn,Un=bn,Wn=Sn,Gn=wn,Kn=On,qn=An,Jn=Mn,Yn=In,Xn=Rn,Zn=zn,Qn=Bn,$n=V.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,H.jsxs)(Yn,{ref:i,className:h(`flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-[var(--app-panel-elevated)] data-[state=open]:bg-[var(--app-panel-elevated)] [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,t&&`pl-8`,e),...r,children:[n,(0,H.jsx)(s,{className:`ml-auto`})]}));$n.displayName=Yn.displayName;var er=V.forwardRef(({className:e,...t},n)=>(0,H.jsx)(Xn,{ref:n,className:h(`z-50 min-w-[8rem] overflow-hidden rounded-md border border-[var(--app-border)] bg-[var(--app-panel)] p-1 text-[var(--app-text)] shadow-lg 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`,e),...t}));er.displayName=Xn.displayName;var tr=V.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,H.jsx)(Vn,{children:(0,H.jsx)(Hn,{ref:r,sideOffset:t,className:h(`z-50 min-w-[8rem] overflow-hidden rounded-md border border-[var(--app-border)] bg-[var(--app-panel)] p-1 text-[var(--app-text)] 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`,e),...n})}));tr.displayName=Hn.displayName;var $=V.forwardRef(({className:e,inset:t,...n},r)=>(0,H.jsx)(Wn,{ref:r,className:h(`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-[var(--app-panel-elevated)] focus:text-[var(--app-text)] data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,t&&`pl-8`,e),...n}));$.displayName=Wn.displayName;var nr=V.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,H.jsxs)(Gn,{ref:i,className:h(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-[var(--app-panel-elevated)] focus:text-[var(--app-text)] data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),checked:n,...r,children:[(0,H.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,H.jsx)(qn,{children:(0,H.jsx)(d,{className:`h-4 w-4`})})}),t]}));nr.displayName=Gn.displayName;var rr=V.forwardRef(({className:e,children:t,...n},r)=>(0,H.jsxs)(Kn,{ref:r,className:h(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-[var(--app-panel-elevated)] focus:text-[var(--app-text)] data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,H.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,H.jsx)(qn,{children:(0,H.jsx)(o,{className:`h-2 w-2 fill-current`})})}),t]}));rr.displayName=Kn.displayName;var ir=V.forwardRef(({className:e,inset:t,...n},r)=>(0,H.jsx)(Un,{ref:r,className:h(`px-2 py-1.5 text-sm font-semibold text-[var(--app-text)]`,t&&`pl-8`,e),...n}));ir.displayName=Un.displayName;var ar=V.forwardRef(({className:e,...t},n)=>(0,H.jsx)(Jn,{ref:n,className:h(`-mx-1 my-1 h-px bg-[var(--app-panel-elevated)]`,e),...t}));ar.displayName=Jn.displayName;var or=({className:e,...t})=>(0,H.jsx)(`span`,{className:h(`ml-auto text-xs tracking-widest text-[var(--app-text-subtle)]`,e),...t});or.displayName=`DropdownMenuShortcut`;function sr({plugin:e}){let t=e.manifest;if(!t)return null;let n=[];return t.skills.length>0&&n.push({label:`Skill(${t.skills.length})`,variant:`info`}),t.agents.length>0&&n.push({label:`Agent(${t.agents.length})`,variant:`success`}),t.mcpServers.length>0&&n.push({label:`MCP(${t.mcpServers.length})`,variant:`warning`}),t.hooks.length>0&&n.push({label:`Hook(${t.hooks.length})`,variant:`default`}),t.lspServers.length>0&&n.push({label:`LSP(${t.lspServers.length})`,variant:`default`}),n.length===0?null:(0,H.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:n.map(e=>(0,H.jsx)(P,{variant:e.variant,children:e.label},e.label))})}function cr({plugin:e,roles:n,onInstallToRole:i,onToggleGlobal:a,onUninstallUser:o,projectOperatingKey:s,userOperatingId:c}){let l=c===e.id;return(0,H.jsxs)(Zn,{modal:!1,children:[(0,H.jsx)(Qn,{asChild:!0,children:(0,H.jsx)(O,{variant:`ghost`,size:`sm`,className:`h-7 w-7 px-0`,"aria-label":`Manage ${e.name}`,children:l?(0,H.jsx)(r,{size:L.xs,className:`animate-spin`}):(0,H.jsx)(t,{size:L.sm})})}),(0,H.jsxs)(tr,{align:`end`,className:`min-w-[200px]`,children:[n.length>0?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(ir,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Add to Role`}),n.map(t=>{let n=e.usedByRoles.some(e=>e.roleId===t.id),a=s===`${e.id}:${t.workspacePath}`;return(0,H.jsxs)($,{disabled:a||n,onSelect:()=>{i(e.id,t.workspacePath)},children:[(0,H.jsx)(`span`,{className:`flex-1`,children:t.name}),a?(0,H.jsx)(r,{size:L.xs,className:`animate-spin`}):n?(0,H.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)]`,children:`installed`}):null]},t.id)}),(0,H.jsx)(ar,{})]}):null,(0,H.jsx)($,{disabled:l,onSelect:()=>{a(e.id,!e.globalEnabled)},children:e.globalEnabled?`Disable`:`Enable`}),(0,H.jsx)($,{disabled:l,className:`text-[var(--app-danger)] focus:text-[var(--app-danger)]`,onSelect:()=>{o(e.id)},children:`Uninstall`})]})]})}function lr({plugin:e,roles:t,expandedContent:n,onInstallToRole:r,onToggleGlobal:i,onUninstallUser:a,projectOperatingKey:o,userOperatingId:c}){let[l,u]=(0,V.useState)(!1),d=e.usedByRoles.map(e=>`${e.roleName} (v${e.version})`).join(`, `)||`No Roles`;return(0,H.jsxs)(`div`,{className:`rounded border border-[var(--app-border)] px-3 py-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,H.jsx)(`button`,{className:`mt-0.5 text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`,onClick:()=>u(e=>!e),"aria-label":l?`Collapse ${e.name}`:`Expand ${e.name}`,children:l?(0,H.jsx)(p,{size:L.xs}):(0,H.jsx)(s,{size:L.xs})}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-sm font-medium text-[var(--app-text)]`,children:e.name}),(0,H.jsxs)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:[`v`,e.version]}),e.marketplace?(0,H.jsx)(P,{variant:`muted`,className:`text-[10px]`,children:e.marketplace}):null,(0,H.jsx)(j,{delayDuration:150,children:(0,H.jsxs)(le,{children:[(0,H.jsx)(se,{asChild:!0,children:(0,H.jsxs)(`button`,{className:`text-xs text-[var(--app-text-muted)] hover:text-[var(--app-text)]`,title:d,children:[e.usedByRoles.length,` `,e.usedByRoles.length===1?`Role`:`Roles`]})}),(0,H.jsx)(M,{children:d})]})})]}),(0,H.jsx)(sr,{plugin:e})]}),(0,H.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,H.jsx)(P,{variant:e.globalEnabled?`success`:`destructive`,children:e.globalEnabled?`User On`:`User Off`}),(0,H.jsx)(cr,{plugin:e,roles:t,onInstallToRole:r,onToggleGlobal:i,onUninstallUser:a,projectOperatingKey:o,userOperatingId:c})]})]}),l?(0,H.jsx)(`div`,{className:`mt-4 rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:n}):null]})}function ur({label:e,value:t}){return(0,H.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 px-3 py-2`,children:[(0,H.jsx)(`p`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:e}),(0,H.jsx)(`p`,{className:`mt-1 text-sm font-medium text-[var(--app-text)]`,children:t})]})}function dr({plugin:e}){return e.manifest?(0,H.jsxs)(`div`,{className:`space-y-4 text-xs`,children:[e.manifest.description?(0,H.jsx)(`p`,{className:`text-[var(--app-text-muted)]`,children:e.manifest.description}):null,(0,H.jsxs)(`div`,{className:`grid gap-2 md:grid-cols-4`,children:[(0,H.jsx)(ur,{label:`Version`,value:e.version?`v${e.version}`:`—`}),(0,H.jsx)(ur,{label:`Scope`,value:e.scope}),(0,H.jsx)(ur,{label:`Capability Count`,value:e.manifest.skills.length+e.manifest.agents.length+e.manifest.mcpServers.length+e.manifest.hooks.length+e.manifest.lspServers.length}),(0,H.jsx)(ur,{label:`Activation`,value:e.globalEnabled?`User On`:`User Off`})]}),(0,H.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 px-3 py-2`,children:[(0,H.jsx)(`p`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Install Path`}),(0,H.jsx)(`p`,{className:`mt-1 truncate font-mono text-[11px] text-[var(--app-text-muted)]`,title:e.installPath,children:e.installPath})]}),(0,H.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[e.manifest.skills.length>0?(0,H.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,H.jsx)(`div`,{className:`mb-2 font-semibold text-[var(--app-text)]`,children:`Skills`}),e.manifest.skills.map(e=>(0,H.jsxs)(`div`,{className:`inline-flex items-baseline gap-1 text-[var(--app-text-muted)]`,children:[(0,H.jsx)(`span`,{className:`text-[var(--app-text)]`,children:e.name}),e.description?(0,H.jsxs)(`span`,{className:`text-[var(--app-text-subtle)]`,children:[`; `,e.description]}):null]},e.name))]}):null,e.manifest.agents.length>0?(0,H.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,H.jsx)(`div`,{className:`mb-2 font-semibold text-[var(--app-text)]`,children:`Agents`}),e.manifest.agents.map(e=>(0,H.jsxs)(`div`,{className:`inline-flex items-baseline gap-1 text-[var(--app-text-muted)]`,children:[(0,H.jsx)(`span`,{className:`text-[var(--app-text)]`,children:e.name}),e.description?(0,H.jsxs)(`span`,{className:`text-[var(--app-text-subtle)]`,children:[`; `,e.description]}):null]},e.name))]}):null,e.manifest.mcpServers.length>0?(0,H.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,H.jsx)(`div`,{className:`mb-2 font-semibold text-[var(--app-text)]`,children:`MCP Servers`}),e.manifest.mcpServers.map(e=>(0,H.jsx)(`div`,{className:`text-[var(--app-text-muted)]`,children:e},e))]}):null,e.manifest.hooks.length>0?(0,H.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,H.jsx)(`div`,{className:`mb-2 font-semibold text-[var(--app-text)]`,children:`Hooks`}),e.manifest.hooks.map(e=>(0,H.jsx)(`div`,{className:`text-[var(--app-text-muted)]`,children:e},e))]}):null,e.manifest.lspServers.length>0?(0,H.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,H.jsx)(`div`,{className:`mb-2 font-semibold text-[var(--app-text)]`,children:`LSP Servers`}),e.manifest.lspServers.map(e=>(0,H.jsx)(`div`,{className:`text-[var(--app-text-muted)]`,children:e},e))]}):null]})]}):(0,H.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`Loading manifest...`})}function fr(){let{userScope:e,projectScope:t,loading:o,error:s,refresh:l,rawPlugins:d,roles:f}=xe(),[te,h]=(0,V.useState)(`installed`),[g,ne]=(0,V.useState)([]),[_,v]=(0,V.useState)([]),[y,re]=(0,V.useState)(new Set),[b,ie]=(0,V.useState)(!1),[x,S]=(0,V.useState)(null),[C,w]=(0,V.useState)(``),[ae,oe]=(0,V.useState)(!1),[T,E]=(0,V.useState)(``),[D,A]=(0,V.useState)(null),[se,ce]=(0,V.useState)(null),{operatingKey:j,installToRole:M,uninstallFromRole:le,updateRoleVersion:ue}=ye(l),F=(0,V.useCallback)(async()=>{ie(!0),S(null);try{let[e,t]=await Promise.all([k(`/plugins/marketplace`).catch(()=>({available:[],installed:[]})),k(`/plugins/marketplaces`)]);v(e.available),re(new Set(e.installed.map(e=>e.id))),ne(t.sources)}catch(e){S(e instanceof Error?e.message:`Failed to load marketplace`)}finally{ie(!1)}},[]);(0,V.useEffect)(()=>{F()},[F]);let de=(0,V.useCallback)(async(e,t)=>{A(e);try{await k(`/plugins/${encodeURIComponent(e)}/${t?`enable`:`disable`}`,{method:`POST`}),N.success(`${e} ${t?`enabled`:`disabled`} globally`)}catch(e){N.error(e instanceof Error?e.message:`Failed to ${t?`enable`:`disable`} plugin`)}finally{await l(),A(null)}},[l]),me=(0,V.useCallback)(async e=>{A(e);try{await k(`/plugins/uninstall/${encodeURIComponent(e)}`,{method:`POST`}),N.success(`Plugin uninstalled`)}catch(e){N.error(e instanceof Error?e.message:`Uninstall failed`)}finally{await Promise.all([l(),F()]),A(null)}},[F,l]),Se=(0,V.useCallback)(async()=>{let e=T.trim();if(e)try{await k(`/plugins/marketplaces`,{method:`POST`,body:JSON.stringify({url:e})}),N.success(`Marketplace added`),E(``),oe(!1),await F()}catch(e){N.error(e instanceof Error?e.message:`Failed to add marketplace`)}},[F,T]),Ce=(0,V.useCallback)(async(e,t=`user`,n)=>{ce(e);try{await k(`/plugins/install/${encodeURIComponent(e)}`,{method:`POST`,body:JSON.stringify({scope:t,cwd:n})});let r=t===`project`&&n?`${e.split(`@`)[0]} for ${n.split(`/`).pop()}`:e.split(`@`)[0];N.success(`Installed ${r}`)}catch(e){N.error(e instanceof Error?e.message:`Install failed`)}finally{await Promise.all([l(),F()]),ce(null)}},[F,l]),Te=C?_.filter(e=>e.name.toLowerCase().includes(C.toLowerCase())||e.description.toLowerCase().includes(C.toLowerCase())):_,De=d.filter(e=>e.scope===`project`).length;return(0,H.jsxs)(`div`,{className:`space-y-5`,children:[(0,H.jsx)(fe,{eyebrow:`Capabilities`,title:`Plugins`,compact:!0,description:`Installed capabilities, scope, and activation.`,metrics:[{label:`Total`,value:d.length},{label:`Project Scope`,value:De},{label:`Catalog`,value:_.length}],actions:(0,H.jsx)(O,{variant:`ghost`,size:`sm`,onClick:()=>void Promise.all([l(),F()]),children:(0,H.jsx)(m,{size:L.sm})})}),(0,H.jsx)(pe,{title:`Plugin Library`,compact:!0,description:`Installed plugins and marketplace discovery live in separate tabs.`}),(0,H.jsxs)(Ae,{value:te,onValueChange:e=>h(e),children:[(0,H.jsxs)(Oe,{children:[(0,H.jsxs)(we,{value:`installed`,children:[`Installed (`,e.length,`)`]}),(0,H.jsxs)(we,{value:`marketplace`,children:[`Marketplace (`,_.length,`)`]})]}),(0,H.jsx)(Ee,{value:`installed`,className:`space-y-5`,children:o?(0,H.jsx)(I,{children:(0,H.jsx)(`div`,{className:`py-8 text-center text-sm text-[var(--app-text-subtle)]`,children:`Loading...`})}):s?(0,H.jsx)(I,{children:(0,H.jsx)(`div`,{className:`py-8 text-center text-sm text-[var(--app-danger)]`,children:s})}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`section`,{className:`space-y-3`,children:[(0,H.jsx)(pe,{title:`User scope`,compact:!0,description:`Global defaults. Available to all Roles unless overridden.`}),e.length===0?(0,H.jsx)(I,{children:(0,H.jsx)(he,{icon:(0,H.jsx)(ee,{size:L.hero}),title:`No user-scope plugins`,description:`Install a plugin once here to make it available as the default for every Role.`,className:`py-8`})}):(0,H.jsx)(`div`,{className:`space-y-3`,children:e.map(e=>(0,H.jsx)(lr,{plugin:e,roles:f,expandedContent:(0,H.jsx)(dr,{plugin:e}),onInstallToRole:M,onToggleGlobal:de,onUninstallUser:me,projectOperatingKey:j,userOperatingId:D},e.id))})]}),(0,H.jsxs)(`section`,{className:`space-y-3`,children:[(0,H.jsx)(pe,{title:`Project scope`,compact:!0,description:`Role-specific overrides. Only plugins that differ from user scope are shown here.`}),(0,H.jsx)(be,{groups:t,layout:`full`,onUninstall:le,onUpdate:ue,operatingKey:j})]}),(0,H.jsx)(je,{})]})}),(0,H.jsxs)(Ee,{value:`marketplace`,className:`space-y-4`,children:[(0,H.jsxs)(I,{children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(i,{size:L.sm,className:`flex-shrink-0 text-[var(--app-text-muted)]`}),g.map(e=>(0,H.jsx)(P,{variant:`muted`,className:`text-xs`,children:e.name},e.name)),(0,H.jsxs)(`span`,{className:`ml-auto flex items-center gap-2`,children:[b?(0,H.jsx)(r,{size:L.xs,className:`animate-spin text-[var(--app-text-subtle)]`}):null,(0,H.jsxs)(O,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>oe(e=>!e),children:[ae?(0,H.jsx)(u,{size:L.xs}):(0,H.jsx)(a,{size:L.xs}),`Source`]})]})]}),ae?(0,H.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,H.jsx)(`input`,{className:`flex-1 rounded border border-[var(--app-border)] bg-[var(--app-panel)] px-2 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,value:T,onChange:e=>E(e.target.value),placeholder:`https://github.com/org/marketplace-repo`,onKeyDown:e=>{e.key===`Enter`&&Se()}}),(0,H.jsx)(O,{size:`sm`,onClick:()=>void Se(),disabled:!T.trim(),children:`Add`})]}):null]}),(0,H.jsx)(I,{children:(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(c,{size:L.sm,className:`absolute left-2.5 top-2 text-[var(--app-text-subtle)]`}),(0,H.jsx)(`input`,{className:`w-full rounded border border-[var(--app-border)] bg-[var(--app-panel)] py-1.5 pl-8 pr-3 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none`,value:C,onChange:e=>w(e.target.value),placeholder:`Search available plugins...`})]})}),b?(0,H.jsx)(I,{children:(0,H.jsx)(`p`,{className:`py-8 text-center text-xs text-[var(--app-text-subtle)]`,children:`Loading marketplace...`})}):x?(0,H.jsx)(I,{children:(0,H.jsx)(`p`,{className:`py-8 text-center text-xs text-[var(--app-danger)]`,children:x})}):Te.length===0?(0,H.jsx)(I,{children:(0,H.jsx)(`p`,{className:`py-8 text-center text-xs text-[var(--app-text-subtle)]`,children:C?`No plugins match your search`:`No marketplace plugins available`})}):(0,H.jsx)(I,{padding:!1,children:(0,H.jsxs)(ve,{children:[(0,H.jsx)(ge,{children:(0,H.jsxs)(z,{children:[(0,H.jsx)(R,{children:`Name`}),(0,H.jsx)(R,{children:`Description`}),(0,H.jsx)(R,{children:`Source`}),(0,H.jsx)(R,{children:`Action`})]})}),(0,H.jsx)(_e,{children:Te.map(e=>{let t=y.has(e.pluginId),i=se===e.pluginId;return(0,H.jsxs)(z,{children:[(0,H.jsx)(B,{className:`text-xs font-medium text-[var(--app-text)]`,children:e.name}),(0,H.jsx)(B,{className:`max-w-[300px] truncate text-xs text-[var(--app-text-muted)]`,title:e.description,children:e.description}),(0,H.jsx)(B,{children:(0,H.jsx)(P,{variant:`muted`,className:`text-[10px]`,children:e.marketplaceName})}),(0,H.jsx)(B,{children:t?(0,H.jsx)(P,{variant:`success`,className:`text-[10px]`,children:`Installed`}):(0,H.jsxs)(Zn,{modal:!1,children:[(0,H.jsx)(Qn,{asChild:!0,children:(0,H.jsx)(O,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,disabled:i,children:i?(0,H.jsx)(r,{size:L.xs,className:`animate-spin`}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(n,{size:L.xs}),`Install`,(0,H.jsx)(p,{size:L.xs})]})})}),(0,H.jsxs)(tr,{align:`end`,className:`min-w-[200px]`,children:[(0,H.jsx)($,{disabled:i,onSelect:()=>{Ce(e.pluginId)},children:`Install globally (User scope)`}),f.length>0?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(ar,{}),f.map(t=>(0,H.jsxs)($,{disabled:i,onSelect:()=>{Ce(e.pluginId,`project`,t.workspacePath)},children:[`Install to `,t.name]},t.id))]}):null]})]})})]},e.pluginId)})})]})})]})]})]})}export{fr as Plugins};
|