@lacneu/atrium 0.104.0 → 0.104.2
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/assets/AccessTab-D8xdWzT5.js +1 -0
- package/dist/assets/{AdminSettings-BdVeeUB1.js → AdminSettings-CtNcFhMz.js} +1 -1
- package/dist/assets/{AdvancedFilter-B4QfxxEB.js → AdvancedFilter-Cod8SSd6.js} +1 -1
- package/dist/assets/AgentFilesTab-Dfkkm3Fw.js +3 -0
- package/dist/assets/AnomaliesTab-DlZ5M2UC.js +1 -0
- package/dist/assets/AuditTab-Dh6gO6j5.js +1 -0
- package/dist/assets/BridgeTab-Bnu9R5N4.js +1 -0
- package/dist/assets/ChatDefaultsTab-CxmayDqi.js +1 -0
- package/dist/assets/{ConfirmDialog-BmOX8o6F.js → ConfirmDialog-B7k0wvSi.js} +1 -1
- package/dist/assets/{DataTableShell-BTk71L7O.js → DataTableShell-DvtkASQG.js} +1 -1
- package/dist/assets/DeletedChatsTab-CnaK-AH0.js +1 -0
- package/dist/assets/{DetailChips-BU-SQfjj.js → DetailChips-DDAtgnjA.js} +1 -1
- package/dist/assets/EntitySheet-DRzkWKlH.js +1 -0
- package/dist/assets/FeedbacksTab-D4LKaB_2.js +1 -0
- package/dist/assets/{FieldLabel-Wb5bwK7r.js → FieldLabel-imj_Z0rZ.js} +1 -1
- package/dist/assets/FilesTab-D3XWSI2t.js +1 -0
- package/dist/assets/{FilterBar-D2w0wWnm.js → FilterBar-DCCuFxDn.js} +1 -1
- package/dist/assets/GroupsTab-DbayDYbZ.js +1 -0
- package/dist/assets/InstancesTab-031fn2Jt.js +1 -0
- package/dist/assets/IntegrationsTab-1whhDsmk.js +1 -0
- package/dist/assets/KnobRow-D6kXWvVI.js +1 -0
- package/dist/assets/KpiTab-2Vk6EtCf.js +1 -0
- package/dist/assets/PreferencesTab-B5h49bYq.js +1 -0
- package/dist/assets/ProjectPage-BNKL-iOz.js +1 -0
- package/dist/assets/PromptInjectionsTab-Bmn1iSpB.js +4 -0
- package/dist/assets/RolesTab-DHxLatAl.js +1 -0
- package/dist/assets/ScheduledTab-NHSyQ677.js +1 -0
- package/dist/assets/ServiceAccountsTab-CKV8crhK.js +1 -0
- package/dist/assets/SubAgentReportsTab-BWfXOTck.js +1 -0
- package/dist/assets/ThemeShowroom-Do9I3hrR.js +1 -0
- package/dist/assets/{TimeRangePicker-BvcqBpnq.js → TimeRangePicker-BZtw1JkM.js} +1 -1
- package/dist/assets/{TimezoneCombobox-BUC66FuM.js → TimezoneCombobox-CeRN4N3z.js} +1 -1
- package/dist/assets/TracesTab-BNWFPad2.js +1 -0
- package/dist/assets/TrashTab-D5irFeF0.js +1 -0
- package/dist/assets/UsersTab-CHs3CRev.js +1 -0
- package/dist/assets/VoiceTab-DRvjgMdZ.js +1 -0
- package/dist/assets/{alert-dialog-BwvaE8oD.js → alert-dialog-BcJMHbhI.js} +1 -1
- package/dist/assets/{api-jG5Fwsg4.js → api-CWqdeSbN.js} +5 -5
- package/dist/assets/{badge-CSm2xaYH.js → badge-ChMMFtuW.js} +1 -1
- package/dist/assets/{button-sV7hIR3f.js → button-C_rIPtCv.js} +1 -1
- package/dist/assets/{card-i1bbFYFv.js → card-BV8NO76j.js} +1 -1
- package/dist/assets/check-DdmANHSb.js +1 -0
- package/dist/assets/{checkbox-U99HMqP3.js → checkbox-DPxJTQjc.js} +1 -1
- package/dist/assets/chevron-left-ByEQraEh.js +1 -0
- package/dist/assets/chevron-right-DMqzlhWH.js +1 -0
- package/dist/assets/chevron-up-B3KYmtzo.js +1 -0
- package/dist/assets/chevrons-up-down-CITEfz7_.js +1 -0
- package/dist/assets/{compatView-Cqu0P9sx.js → compatView-Cz5KNXa-.js} +1 -1
- package/dist/assets/convexApi-G20_TNBS.js +1 -0
- package/dist/assets/{copy-BIRdG3Nl.js → copy-DbstFM9Q.js} +1 -1
- package/dist/assets/{cronDescribe-D9eP5CDy.js → cronDescribe-CkiSvbCK.js} +1 -1
- package/dist/assets/{deliveryRecorder-DEtCAEff.js → deliveryRecorder-B_kVKMkR.js} +1 -1
- package/dist/assets/{dialog-Bpoyy7pR.js → dialog-CPAskUwF.js} +1 -1
- package/dist/assets/dispatchErrorInfo-7H2cJGwt.js +1 -0
- package/dist/assets/{dist-D7Oplune.js → dist-BjZo0sql.js} +1 -1
- package/dist/assets/{dist-ChYvHRlL.js → dist-Bu9sqVcp.js} +1 -1
- package/dist/assets/{dist-t45SSvfU.js → dist-CYh9BuQS.js} +1 -1
- package/dist/assets/{dist-Bxf4XoMW.js → dist-CzmY6YrA.js} +1 -1
- package/dist/assets/{dist-B9q2nlqC.js → dist-Uf18yR_a.js} +1 -1
- package/dist/assets/{download-DQYw1N-_.js → download-BaebAe6Z.js} +1 -1
- package/dist/assets/{dropdown-menu-yCbwljS-.js → dropdown-menu-BVKVjups.js} +1 -1
- package/dist/assets/{eye-CZuTJsZX.js → eye-LggiM6Z5.js} +1 -1
- package/dist/assets/{format-BQaxlN43.js → format-AQELUhPa.js} +1 -1
- package/dist/assets/{groupManageView-BcbLXWZ4.js → groupManageView-DC3eSLA1.js} +1 -1
- package/dist/assets/index-2h5cvmc2.css +1 -0
- package/dist/assets/index-CzYLP7A2.js +158 -0
- package/dist/assets/{input-DReDYsos.js → input-CSZu-bVE.js} +1 -1
- package/dist/assets/{list-kKcfLqpz.js → list-obbqPBzD.js} +1 -1
- package/dist/assets/loader-circle-BqKiW3X9.js +1 -0
- package/dist/assets/{lock-DJQnxN_w.js → lock-BlVhOk85.js} +1 -1
- package/dist/assets/{pencil-C_IJUeJn.js → pencil-K7SBkvHL.js} +1 -1
- package/dist/assets/plus-DTL4K-j9.js +1 -0
- package/dist/assets/{popover-BcL-AsC2.js → popover-C-Y_Yoco.js} +1 -1
- package/dist/assets/roleDescriptions-DHny6e80.js +1 -0
- package/dist/assets/rotate-ccw-CvefWwHW.js +1 -0
- package/dist/assets/{search-CGco_tlI.js → search-Dz6sLH0-.js} +1 -1
- package/dist/assets/{select-DGKgMOlh.js → select-CjcMQhwm.js} +1 -1
- package/dist/assets/{server-ClLFUY_D.js → server-DcInl3Nh.js} +1 -1
- package/dist/assets/{speech-DO_eJ8Aq.js → speech-ehUcmGCg.js} +1 -1
- package/dist/assets/{star-B6yMf_Hc.js → star-5ysDlx3k.js} +1 -1
- package/dist/assets/{switch-D-QGMGm7.js → switch--NPD3Vp0.js} +1 -1
- package/dist/assets/{table-CIrFKiPM.js → table-rRR3TpMc.js} +1 -1
- package/dist/assets/{tabs-BWfAdnjK.js → tabs-B8emuY1B.js} +1 -1
- package/dist/assets/toast-C_YfUacM.js +1 -0
- package/dist/assets/{tooltip-CobtYK4c.js → tooltip-Ct0TGxtk.js} +1 -1
- package/dist/assets/{trash-2-UxV-pTWt.js → trash-2-xhtrhYsd.js} +1 -1
- package/dist/assets/trashPage-3suR6eIy.js +1 -0
- package/dist/assets/trashView-CwUC01r_.js +1 -0
- package/dist/assets/{triangle-alert-BMryltpr.js → triangle-alert-DoL9TI6v.js} +1 -1
- package/dist/assets/{usageView-CKi8uUZb.js → usageView-BuRtXekW.js} +1 -1
- package/dist/assets/{useChart-BE4pYQJh.js → useChart-bV4rotdu.js} +1 -1
- package/dist/assets/{useFontScale-DCa0acMC.js → useFontScale-DiSkEM6I.js} +1 -1
- package/dist/assets/{useStartNewChat-BatYRWH7.js → useStartNewChat-8wVLrYnZ.js} +2 -2
- package/dist/assets/{use_paginated_query-imV3AXlW.js → use_paginated_query-CebdO_HQ.js} +1 -1
- package/dist/assets/{users-CBI99oGw.js → users-CRbE186D.js} +1 -1
- package/dist/assets/x-CcIT4ync.js +1 -0
- package/dist/index.html +54 -54
- package/package.json +1 -1
- package/dist/assets/AccessTab-Bk4_F0iH.js +0 -1
- package/dist/assets/AgentFilesTab-Dlm2lBii.js +0 -3
- package/dist/assets/AnomaliesTab-D_QuI8BU.js +0 -1
- package/dist/assets/AuditTab-DOfKzC0D.js +0 -1
- package/dist/assets/BridgeTab-OC_GNU22.js +0 -1
- package/dist/assets/ChatDefaultsTab-BeTKiTFl.js +0 -1
- package/dist/assets/DeletedChatsTab-BCD6pwBJ.js +0 -1
- package/dist/assets/EntitySheet-BXEY6TCb.js +0 -1
- package/dist/assets/FeedbacksTab-Ch0Og-WD.js +0 -1
- package/dist/assets/FilesTab-C6xs9TIo.js +0 -1
- package/dist/assets/GroupsTab-Dktghl12.js +0 -1
- package/dist/assets/InstancesTab-B_jY-L5V.js +0 -1
- package/dist/assets/IntegrationsTab-CA10qkLR.js +0 -1
- package/dist/assets/KnobRow-DsPgcIxU.js +0 -1
- package/dist/assets/KpiTab-DN2VV-KL.js +0 -1
- package/dist/assets/PreferencesTab-DCUtb7jt.js +0 -1
- package/dist/assets/ProjectPage-CZbKzufX.js +0 -1
- package/dist/assets/PromptInjectionsTab-D-qkRO-x.js +0 -4
- package/dist/assets/RolesTab-B-kY1GSh.js +0 -1
- package/dist/assets/ScheduledTab-C3lqr_Wn.js +0 -1
- package/dist/assets/ServiceAccountsTab-4Tcuxr0L.js +0 -1
- package/dist/assets/SubAgentReportsTab-BvaMpkUp.js +0 -1
- package/dist/assets/ThemeShowroom-BNUhcoUx.js +0 -1
- package/dist/assets/TracesTab-CmHSn4oj.js +0 -1
- package/dist/assets/TrashTab-CCNS2Ybn.js +0 -1
- package/dist/assets/UsersTab-B-H2pRkF.js +0 -1
- package/dist/assets/VoiceTab-C4f9SFZl.js +0 -1
- package/dist/assets/check-MG02lA-U.js +0 -1
- package/dist/assets/chevron-left-cmPkj5_M.js +0 -1
- package/dist/assets/chevron-right-DbysoSJS.js +0 -1
- package/dist/assets/chevron-up-DQBDpk9Z.js +0 -1
- package/dist/assets/chevrons-up-down-3woN2nFd.js +0 -1
- package/dist/assets/convexApi-DeaVGrsr.js +0 -1
- package/dist/assets/dispatchErrorInfo-DBq1hdag.js +0 -1
- package/dist/assets/index-CHdY282S.css +0 -1
- package/dist/assets/index-CVhaNoJz.js +0 -158
- package/dist/assets/loader-circle-_HV4tchJ.js +0 -1
- package/dist/assets/plus-A35Qzur2.js +0 -1
- package/dist/assets/roleDescriptions-D-rhX1-Q.js +0 -1
- package/dist/assets/rotate-ccw-XgdDTtI8.js +0 -1
- package/dist/assets/toast-daONdZpX.js +0 -1
- package/dist/assets/trashPage-CFUn9bkp.js +0 -1
- package/dist/assets/trashView-CrjCfgVT.js +0 -1
- package/dist/assets/x-TiVTngrx.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$G as r,AG as i,BG as ee,CG as a,DG as te,EG as ne,FG as re,GG as ie,HG as ae,IG as oe,JG as se,KG as ce,LG as le,MG as ue,NG as de,OG as fe,PG as pe,QG as me,RG as he,SG as o,SK as ge,TG as s,UG as _e,VG as ve,WG as ye,XG as be,YG as xe,ZG as Se,_G as c,_K as Ce,_Q as l,aG as we,aK as Te,bG as Ee,bK as De,cG as u,cK as Oe,dG as d,dK as ke,eK as Ae,fG as f,fK as je,gG as p,gK as m,hG as h,hK as Me,hQ as Ne,iG as g,iK as Pe,jG as Fe,kG as Ie,lG as _,lK as Le,mG as v,mK as Re,nG as y,nK as ze,oG as b,oK as Be,pG as x,pK as Ve,qG as He,rG as S,rK as Ue,sG as C,sK as We,t as w,tK as Ge,uG as T,uK as Ke,vG as E,vK as qe,vQ as D,wG as O,xG as k,xK as Je,yG as A,yK as Ye,zG as Xe}from"./api-jG5Fwsg4.js";import{n as Ze,t as Qe}from"./useNavigate-D3GIoxyW.js";import{t as j}from"./check-MG02lA-U.js";import{r as $e}from"./dist-Bxf4XoMW.js";import{t as et}from"./chevron-right-DbysoSJS.js";import{t as M}from"./copy-BIRdG3Nl.js";import{a as N,i as P,n as F,r as I,t as L}from"./select-DGKgMOlh.js";import{t as R}from"./button-sV7hIR3f.js";import{t as z}from"./input-DReDYsos.js";import"./convexApi-DeaVGrsr.js";import{r as tt}from"./toast-daONdZpX.js";import{t as B}from"./badge-CSm2xaYH.js";import{n as V,t as H}from"./format-BQaxlN43.js";import{a as U,i as W,n as G,o as nt,r as rt,t as K}from"./dialog-Bpoyy7pR.js";import{n as it}from"./ConfirmDialog-BmOX8o6F.js";import{t as at}from"./EntitySheet-BXEY6TCb.js";import{t as ot}from"./FilterBar-D2w0wWnm.js";import{t as st}from"./DataTableShell-BTk71L7O.js";import{t as ct}from"./roleDescriptions-D-rhX1-Q.js";var q=t(e(),1),J=n(),lt=[{value:`never`,label:()=>u(),days:null},{value:`30`,label:()=>C(),days:30},{value:`90`,label:()=>b(),days:90}],Y=720*60*60*1e3,X=`__all__`,Z={name:``,roleKey:``,description:``};function Q(){let e=Ze({from:`/settings/serviceAccounts`}),t=Qe({from:`/settings/serviceAccounts`}),n=e.q??``,a=e.status??X,[o,s]=(0,q.useState)(X),c=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),we=e=>void t({search:t=>({...t,status:e===X?void 0:e})}),Ee=D(w.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:o===X?void 0:o,disabled:a===X?void 0:a===`disabled`}}),u=D(w.apiKeys.listKeys,{}),d=D(w.apiKeys.listRoles,{}),f=l(w.apiKeys.createServiceAccount),p=l(w.apiKeys.updateServiceAccount),h=l(w.apiKeys.deleteServiceAccount),g=Ne(w.apiKeys.mintApiKey),_=l(w.apiKeys.revokeApiKey),v=it(),y=tt(),b=n!==``||o!==X||a!==X;function x(){s(X),t({search:{},replace:!0})}let[S,C]=(0,q.useState)(!1),[T,E]=(0,q.useState)(Z),[O,k]=(0,q.useState)(null),[A,j]=(0,q.useState)(new Set),[M,V]=(0,q.useState)(null),H=(0,q.useRef)(!1),[U,W]=(0,q.useState)(new Set),[G,nt]=(0,q.useState)({}),[rt,K]=(0,q.useState)(null),Y=(0,q.useMemo)(()=>{let e=new Map;for(let t of u??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[u]);function Q(e){j(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function ft(){try{O?(await p({serviceAccountId:O,name:T.name,roleKey:T.roleKey,description:T.description}),y.success(ee())):await f({name:T.name,roleKey:T.roleKey,description:T.description||void 0}),E(Z),k(null),C(!1)}catch(e){y.error(O?ve():ae(),e)}}function pt(e){E({name:e.name,roleKey:e.roleKey,description:e.description??``}),k(e._id),C(!0)}async function mt(e){if(H.current)return;H.current=!0;let t=G[e._id]??`never`,n=lt.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;V(e._id);try{let t=await g({serviceAccountId:e._id,expiresAt:r});K({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){y.error(Xe(),e)}finally{H.current=!1,V(null)}}async function $(e){if(await v({title:he(),description:(0,J.jsxs)(J.Fragment,{children:[le(),` `,(0,J.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,oe(),` `,(0,J.jsx)(`strong`,{children:re()}),` `,pe()]}),confirmWord:e.name,confirmLabel:de(),destructive:!0}))try{await h({serviceAccountId:e._id}),y.success(ue(),e.name)}catch(e){y.error(Fe(),e)}}async function ht(e){if(await v({title:i(),description:(0,J.jsxs)(J.Fragment,{children:[Ie(),` `,(0,J.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,fe()]}),confirmLabel:te(),destructive:!0})&&!U.has(e._id)){W(t=>new Set(t).add(e._id));try{await _({keyId:e._id})}catch(e){y.error(ne(),e)}finally{W(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:ge()}),(0,J.jsxs)(ot,{q:n,onQChange:c,searchPlaceholder:Je(),onReset:x,canReset:b,children:[(0,J.jsxs)(L,{value:o,onValueChange:s,children:[(0,J.jsx)(P,{size:`sm`,className:`w-40`,children:(0,J.jsx)(N,{placeholder:De()})}),(0,J.jsxs)(F,{children:[(0,J.jsx)(I,{value:X,children:Ye()}),(d??[]).map(e=>(0,J.jsx)(I,{value:e.key,children:e.key},e._id))]})]}),(0,J.jsxs)(L,{value:a,onValueChange:we,children:[(0,J.jsx)(P,{size:`sm`,className:`w-36`,children:(0,J.jsx)(N,{})}),(0,J.jsxs)(F,{children:[(0,J.jsx)(I,{value:X,children:qe()}),(0,J.jsx)(I,{value:`active`,children:Ce()}),(0,J.jsx)(I,{value:`disabled`,children:m()})]})]})]}),(0,J.jsx)(st,{title:Me(),rows:Ee,addLabel:Re(),onAdd:()=>{E(Z),k(null),C(!0)},emptyHint:Ve(),isExpanded:e=>A.has(e._id),renderExpanded:e=>(0,J.jsx)(ut,{account:e,keys:Y.get(e._id)??[],onRevoke:ht,revoking:U}),rowActions:e=>[...(e.managedBy??null)===null?[{label:Le(),onSelect:()=>pt(e)},{label:je(),onSelect:()=>void mt(e)}]:[],{label:A.has(e._id)?ke():Ke(),onSelect:()=>Q(e._id)},...(e.managedBy??null)===null?[{label:Oe(),variant:`destructive`,onSelect:()=>void $(e)}]:[]],columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(R,{variant:`ghost`,size:`icon-sm`,"aria-label":A.has(e._id)?We():Be(),onClick:()=>Q(e._id),children:A.has(e._id)?(0,J.jsx)($e,{}):(0,J.jsx)(et,{})})},{header:Te(),sort:e=>e.name,cell:e=>(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(`span`,{children:e.name}),e.description?(0,J.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:Pe(),sort:e=>e.roleKey,cell:e=>(0,J.jsx)(B,{variant:`secondary`,children:e.roleKey})},{header:Ue(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,J.jsx)(B,{variant:`destructive`,children:m()}):(0,J.jsx)(B,{variant:`outline`,children:Ce()})},{header:ze(),cell:e=>(0,J.jsxs)(L,{value:G[e._id]??`never`,onValueChange:t=>nt(n=>({...n,[e._id]:t})),children:[(0,J.jsx)(P,{size:`sm`,className:`w-32`,children:(0,J.jsx)(N,{})}),(0,J.jsx)(F,{children:lt.map(e=>(0,J.jsx)(I,{value:e.value,children:e.label()},e.value))})]})},{header:Ge(),sort:e=>(Y.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(Y.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,J.jsx)(`span`,{className:`oc-sa__keycount`,children:M===e._id?Ae():r({count:t})})}}]}),(0,J.jsx)(at,{open:S,onOpenChange:e=>{C(e),e||k(null)},title:O?me():xe(),description:O?Se():se(),canSubmit:!!(T.name&&T.roleKey),onSubmit:ft,submitLabel:O?be():He(),children:(0,J.jsxs)(`div`,{className:`oc-form`,children:[(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:ce()}),(0,J.jsx)(z,{value:T.name,onChange:e=>E({...T,name:e.target.value})})]}),(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:ie()}),(0,J.jsxs)(L,{value:T.roleKey||void 0,onValueChange:e=>E({...T,roleKey:e}),children:[(0,J.jsx)(P,{className:`w-full`,children:(0,J.jsx)(N,{placeholder:ye()})}),(0,J.jsx)(F,{children:(d??[]).map(e=>(0,J.jsxs)(I,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(d??[]).find(e=>e.key===T.roleKey),t=e?ct(e):null;return t?(0,J.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:_e()}),(0,J.jsx)(z,{value:T.description,onChange:e=>E({...T,description:e.target.value})})]})]})}),(0,J.jsx)(dt,{minted:rt,onClose:()=>K(null)})]})}function ut({account:e,keys:t,onRevoke:n,revoking:r}){return(0,J.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,J.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[s(),` `,(0,J.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:O()}):(0,J.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`th`,{children:a()}),(0,J.jsx)(`th`,{children:o()}),(0,J.jsx)(`th`,{children:k()}),(0,J.jsx)(`th`,{children:Ee()}),(0,J.jsx)(`th`,{children:A()}),(0,J.jsx)(`th`,{children:E()}),(0,J.jsx)(`th`,{})]})}),(0,J.jsx)(`tbody`,{children:t.map(t=>(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`td`,{children:(0,J.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,J.jsx)(`td`,{children:(0,J.jsx)(B,{variant:`secondary`,children:e.roleKey})}),(0,J.jsx)(`td`,{children:V(t.createdAt)}),(0,J.jsx)(`td`,{className:ft(t.lastUsedAt)?`oc-sa__stale`:``,children:pt(t.lastUsedAt)}),(0,J.jsx)(`td`,{children:mt(t.expiresAt)}),(0,J.jsx)(`td`,{children:$(t)}),(0,J.jsx)(`td`,{className:`text-right`,children:!t.disabled&&(e.managedBy??null)===null?(0,J.jsx)(R,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?c():p()}):null})]},t._id))})]})]})}function dt({minted:e,onClose:t}){let[n,r]=(0,q.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,J.jsx)(K,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,J.jsxs)(G,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,J.jsxs)(U,{children:[(0,J.jsx)(nt,{children:h()}),(0,J.jsx)(rt,{children:v({name:e.accountName})})]}),(0,J.jsx)(`div`,{className:`oc-sa__minted-warning`,children:x()}),(0,J.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,J.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,J.jsxs)(R,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":f(),children:[n?(0,J.jsx)(j,{}):(0,J.jsx)(M,{}),n?d():T()]})]}),(0,J.jsx)(W,{children:(0,J.jsx)(R,{onClick:()=>{r(!1),t()},children:_()})})]}):null})}function ft(e){return e!==null&&Date.now()-e>Y}function pt(e){return e===null?we():V(e)}function mt(e){return e===null?`—`:H(e)}function $(e){return e.disabled?(0,J.jsx)(B,{variant:`destructive`,children:g()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,J.jsx)(B,{variant:`outline`,children:S()}):(0,J.jsx)(B,{variant:`outline`,children:y()})}export{Q as ServiceAccountsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$h as r,Bh as i,Gh as a,Hh as o,Ih as s,Jh as c,Kh as l,Lh as u,Qh as d,Rh as f,Uh as p,Vh as m,Wh as h,Xh as g,Yh as _,Zh as v,_Q as y,_g as b,ag as x,bg as S,cg as C,dg as w,eg as T,fg as E,gg as D,hg as O,ig as k,lg as A,mg as j,ng as M,og as N,pg as P,qh as F,rg as I,sg as L,t as R,tg as ee,ug as z,vQ as B,vg as V,yg as H,zh as U}from"./api-jG5Fwsg4.js";import{t as W}from"./button-sV7hIR3f.js";import"./convexApi-DeaVGrsr.js";import{n as G}from"./format-BQaxlN43.js";import{n as K}from"./ConfirmDialog-BmOX8o6F.js";import{t as q}from"./DataTableShell-BTk71L7O.js";var J=t(e(),1),Y=n(),X={hung:()=>I(),wrong_result:()=>M(),error:()=>ee(),other:()=>T()},Z=e=>(e&&X[e]?.())??e??`—`;function Q(e){let t=e.slice(e.lastIndexOf(`:`)+1)||e;return t.length>12?`${t.slice(0,12)}…`:t}function $({data:e}){let t=e.snapshot,n=y(R.subAgentReports.respondToReport),[s,u]=(0,J.useState)(e.thread),[f,b]=(0,J.useState)(``),[x,S]=(0,J.useState)(!1);async function C(){let t=f.trim();if(!(!t||x)){S(!0);try{await n({reportId:e._id,text:t}),u(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),b(``)}finally{S(!1)}}}return(0,Y.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,Y.jsx)(`div`,{className:`oc-fbadmin__row`,children:(0,Y.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[Z(e.category),` · `,r({failed:t.failedCount,total:t.totalCount}),t.openclawModel?` · ${t.openclawModel}`:``,t.openclawRuntime?` (${t.openclawRuntime})`:``]})}),e.comment?(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:d()}),(0,Y.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:v()}),s.length>0?(0,Y.jsx)(`div`,{className:`oc-fbadmin__thread`,children:s.map((e,t)=>(0,Y.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,Y.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?g():_()}),(0,Y.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Y.jsx)(`p`,{className:`oc-fbadmin__meta`,children:c()}),(0,Y.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:F(),value:f,maxLength:2e3,rows:3,onChange:e=>b(e.target.value.slice(0,2e3))}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,Y.jsx)(W,{size:`sm`,onClick:()=>void C(),disabled:!f.trim()||x,children:x?a():l()})})]}),(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[h({count:t.children.length}),t.childrenTruncated?` ${p()}`:``,t.textTruncated?` ${o()}`:``]}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:t.children.map((e,n)=>(0,Y.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,Y.jsxs)(`span`,{className:`oc-fbadmin__ctx-role`,children:[(e.taskName?.trim()||Q(e.childSessionKey))+` · ${e.status}`,e.phase?` · ${e.phase}`:``,e.childSessionKey===t.flaggedChildSessionKey?` · ${m()}`:``]}),e.errorMessage?(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.errorMessage}):null,e.resultText?(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.resultText}):null]},n))})]}),t.parentText?(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:i()}),(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:t.parentText})]}):null,(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:U()}),(0,Y.jsx)(`p`,{className:`oc-fbadmin__env`,children:[t.parentStatus?`status: ${t.parentStatus}`:null,t.parentErrorCode?`code: ${t.parentErrorCode}`:null,t.parentRunId?`run ${t.parentRunId.slice(0,12)}…`:null,e.correlationId?`corr ${e.correlationId.slice(0,16)}…`:null,t.openclawProvider].filter(Boolean).join(` · `)||`—`})]})]})}function te(){let e=B(R.subAgentReports.listForAdmin,{}),t=y(R.subAgentReports.readReport),n=y(R.subAgentReports.deleteReport),r=K(),[i,a]=(0,J.useState)(null),[o,c]=(0,J.useState)({});async function l(e){if(i===e._id){a(null);return}if(!o[e._id]){let n=await t({reportId:e._id});c(t=>({...t,[e._id]:n}))}a(e._id)}async function d(e){await r({title:f(),description:u(),confirmLabel:s(),destructive:!0})&&(await n({reportId:e._id}),i===e._id&&a(null))}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[V(),` `,(0,Y.jsx)(`strong`,{children:b()}),` `,D()]}),(0,Y.jsx)(q,{title:S(),rows:e,emptyHint:H(),isExpanded:e=>i===e._id&&!!o[e._id],renderExpanded:e=>o[e._id]?(0,Y.jsx)($,{data:o[e._id]}):null,columns:[{header:O(),cell:e=>G(e.at),sort:e=>e.at},{header:j(),cell:e=>Z(e.category),sort:e=>Z(e.category)},{header:P(),cell:e=>`${e.failedCount}/${e.totalCount}`,sort:e=>e.failedCount},{header:E(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${A({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:w(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:z(),cell:e=>e.answered?(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:C()}):(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill`,children:L()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:i===e._id?x():N(),onSelect:()=>void l(e)},{label:k(),onSelect:()=>void d(e),variant:`destructive`}]})]})}export{te as SubAgentReportsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$q as r,AJ as i,Aq as a,Bq as o,CJ as s,Cq as c,DJ as l,Dq as u,EJ as d,Eq as f,Fh as p,Fq as m,Gq as h,Hq as ee,Iq as g,Jq as _,Kq as v,Lq as te,Mh as ne,Mq as re,Nh as ie,Nq as ae,OJ as oe,Oq as se,Ph as y,Pq as ce,Qq as le,Rq as ue,SJ as de,Sq as fe,TJ as pe,Tq as me,Uq as he,Vq as ge,Wq as _e,Xq as ve,Yq as ye,Zq as be,_J as xe,_Q as b,_q as x,aJ as Se,aQ as Ce,bJ as we,bq as Te,cJ as Ee,dJ as De,dq as Oe,eJ as ke,fJ as Ae,fq as je,gJ as Me,gq as Ne,hJ as Pe,hQ as Fe,hq as Ie,iJ as Le,iQ as Re,jJ as ze,jq as Be,kJ as Ve,kq as S,lJ as He,lq as Ue,mJ as We,mq as Ge,nJ as Ke,o as qe,oJ as Je,pJ as Ye,pq as C,qq as Xe,rJ as Ze,rQ as Qe,sJ as $e,t as w,tJ as et,uJ as tt,uq as nt,vJ as rt,vQ as T,vq as it,wJ as at,wq as ot,xJ as E,xq as st,yJ as ct,yq as lt,zq as ut}from"./api-jG5Fwsg4.js";import{t as D}from"./check-MG02lA-U.js";import{c as dt,g as O,i as ft,n as pt,r as k,s as A,t as mt}from"./dropdown-menu-yCbwljS-.js";import{t as ht}from"./download-DQYw1N-_.js";import{t as j}from"./checkbox-U99HMqP3.js";import{i as M,n as gt,r as _t}from"./useChart-BE4pYQJh.js";import{t as N}from"./x-TiVTngrx.js";import{a as P,i as F,n as I,r as L,t as R}from"./select-DGKgMOlh.js";import{t as z}from"./button-sV7hIR3f.js";import{t as B}from"./input-DReDYsos.js";import"./convexApi-DeaVGrsr.js";import{t as V}from"./badge-CSm2xaYH.js";import{t as H}from"./appHost-CH3EGcJw.js";import{t as vt}from"./localePickerView-C2RmOS86.js";import{a as yt,i as bt,n as xt,o as St,r as Ct,t as wt}from"./card-i1bbFYFv.js";import{a as Tt,i as U,n as Et,o as W,r as G,t as Dt}from"./table-CIrFKiPM.js";import{t as Ot}from"./TimeRangePicker-BvcqBpnq.js";import{t as kt}from"./FilterBar-D2w0wWnm.js";import{t as At}from"./AdvancedFilter-B4QfxxEB.js";var K=t(e(),1),jt=.1,Mt=[248,248,248],Nt=[24,24,24];function Pt(e,t,n){let r=t,i=n,a=-1,o=-1;for(let s=0;s<n;s++)for(let n=0;n<t;n++)e[(s*t+n)*4+3]>8&&(n<r&&(r=n),n>a&&(a=n),s<i&&(i=s),s>o&&(o=s));return a<0?null:{x:r,y:i,width:a-r+1,height:o-i+1}}function Ft(e,t,n){let r=t*n;if(r===0)return 0;let i=0;for(let t=3;t<e.length;t+=4)e[t]<=8&&i++;return i/r}function q(e,t,n){return Ft(e,t,n)>=jt}function It(e,t){for(let n=0;n<e.length;n+=4)e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2]}function Lt(e){for(let t=0;t<e.length;t+=4)e[t]=255-e[t],e[t+1]=255-e[t+1],e[t+2]=255-e[t+2]}var Rt=12*1024*1024,zt=480,Bt=160,Vt=.92;async function Ht(e,t={}){if(!e.type.startsWith(`image/`))throw Error(re());if(e.size>Rt)throw Error(Be());let{source:n,width:r,height:i,cleanup:a}=await Ut(e);try{let a=e.type===`image/svg+xml`,o=Math.min(zt/r,Bt/i,a?1/0:1),s=Math.max(1,Math.round(r*o)),c=Math.max(1,Math.round(i*o)),l=document.createElement(`canvas`);l.width=s,l.height=c;let u=l.getContext(`2d`);if(!u)throw Error(S());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=Pt(u.getImageData(0,0,s,c).data,s,c)??{x:0,y:0,width:s,height:c},f=document.createElement(`canvas`);f.width=d.width,f.height=d.height;let p=f.getContext(`2d`);if(!p)throw Error(S());if(p.drawImage(l,d.x,d.y,d.width,d.height,0,0,d.width,d.height),t.variantFor){let e=p.getImageData(0,0,d.width,d.height);q(e.data,d.width,d.height)?It(e.data,t.variantFor===`dark`?Mt:Nt):Lt(e.data),p.putImageData(e,0,0)}let m=q(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await Y(f,`image/webp`,Vt)??await Y(f,`image/png`);if(!h)throw Error(se());return{blob:h,hasAlpha:m}}finally{a()}}async function Ut(e){if(e.type===`image/svg+xml`)return J(e);if(typeof createImageBitmap==`function`)try{let t=await createImageBitmap(e);return{source:t,width:t.width,height:t.height,cleanup:()=>t.close()}}catch{}return J(e)}async function J(e){let t=URL.createObjectURL(e);try{let e=new Image;return e.decoding=`async`,await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=()=>r(Error(a())),e.src=t}),{source:e,width:e.naturalWidth||300,height:e.naturalHeight||150,cleanup:()=>URL.revokeObjectURL(t)}}catch(e){throw URL.revokeObjectURL(t),e}}function Y(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var X=n();function Wt(e,t){let n=e.trim().replace(/[^A-Za-z0-9_.-]+/g,`-`).replace(/^-+|-+$/g,``)||`chart`,r=new Blob([JSON.stringify(t,null,2)],{type:`application/json`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`${n}.chart.json`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}var Z=`__all__`,Gt={kind:`relative`,from:`now-24h`,to:`now`},Kt=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function Q({title:e,description:t,children:n}){return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,X.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function qt(e){return e===`light`?Ce():e===`dark`?Re():Qe()}var Jt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Yt({tokens:e,mode:t}){let n=e.colors[t];return(0,X.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Jt.map(e=>{let t=n[e];return(0,X.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Xt({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:o}){return(0,X.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,X.jsxs)(`button`,{type:`button`,className:qe(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,X.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,X.jsx)(D,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,X.jsx)(Yt,{tokens:r,mode:i}):(0,X.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,X.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,X.jsx)(z,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":p(),title:p(),children:(0,X.jsx)(ht,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=T(w.charts.listMyCharts),r=b(w.charts.setMyChart);async function i(e){try{await r({name:e})}catch{}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:s()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:de()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:E(),subtitle:we(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?ct():n.via===`owner`?rt():xe({group:n.via.group});return(0,X.jsx)(Xt,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void i(n.key),onExport:()=>Wt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Me()}):null]})}function Qt(){let e=b(w.charts.importChart),[t,n]=(0,K.useState)(``),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(!1),[u,d]=(0,K.useState)(!1);async function f(e){let t=e.target.files?.[0];if(e.target.value=``,t){s(null),l(!1);try{let e=await t.text();a(e)}catch{s(_())}}}async function p(){if(s(null),l(!1),t.trim()===``){s(v());return}let r;try{r=JSON.parse(i)}catch{s(_());return}d(!0);try{await e({name:t.trim(),tokens:r}),l(!0),n(``),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{d(!1)}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:Ke()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:et()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:ke()}),(0,X.jsx)(B,{value:t,onChange:e=>n(e.target.value),placeholder:r(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:le()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:i,onChange:e=>a(e.target.value),placeholder:be(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(z,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(M,{className:`size-4`}),ve(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void f(e)})]})}),(0,X.jsx)(z,{size:`sm`,disabled:u,onClick:()=>void p(),children:ye()})]}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null,c?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:Xe()}):null]})]})}function $t({chart:e}){let t=Fe(w.charts.setChartLogo),n=b(w.charts.removeChartLogo),[r,i]=(0,K.useState)(!1),[a,s]=(0,K.useState)(null),c=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function l(n,r,a){if(e.chartId!==void 0){s(null),i(!0);try{let{blob:i,hasAlpha:o}=await Ht(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){s(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function u(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await l(e,n)}async function d(t){if(e.chartId!==void 0){s(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){s(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function f(e){let t=c(e===`light`?`dark`:`light`);if(t){s(null),i(!0);try{await l(e,await(await fetch(t)).blob(),e)}catch(e){s(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function p({mode:e}){let t=c(e),n=c(e===`light`?`dark`:`light`);return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?ut():ue()}),(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,X.jsx)(`img`,{src:t,alt:``}):null}),(0,X.jsx)(z,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(M,{className:`size-4`}),t?g():te(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void u(e,t)})]})}),!t&&n?(0,X.jsx)(z,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void f(e),children:ce()}):null,t?(0,X.jsx)(z,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:m()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:o()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(p,{mode:`light`}),(0,X.jsx)(p,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ae()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function en({chart:e}){let t=T(w.me.getMe,{host:H}),n=b(w.charts.addChartDomain),r=b(w.charts.removeChartDomain),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(null),[l,d]=(0,K.useState)(!1);if(t?.role!==`admin`)return null;let p=e.domains??[];async function m(){let t=i.trim();if(t!==``){s(null),d(!0);try{await n({chartKey:e.key,domain:t}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{d(!1)}}}async function h(t){s(null);try{await r({chartKey:e.key,domain:t})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:u()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:p.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:c()}):p.map(e=>(0,X.jsxs)(V,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":fe({domain:e}),onClick:()=>void h(e),children:(0,X.jsx)(N,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(B,{value:i,onChange:e=>a(e.target.value),placeholder:me(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&m()}}),(0,X.jsx)(z,{variant:`outline`,size:`sm`,disabled:l,onClick:()=>void m(),children:ot()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:f()}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function $(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function tn({chart:e}){let t=b(w.charts.updateChart),n=b(w.charts.deleteChart),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(e.name),[s,c]=(0,K.useState)(()=>$(e.tokens)),[l,u]=(0,K.useState)(e.tokens.bpm??0),[d,f]=(0,K.useState)(null),[p,m]=(0,K.useState)(!1);function h(){o(e.name),c($(e.tokens)),u(e.tokens.bpm??0),f(null),i(!0)}async function g(){if(e.chartId===void 0)return;f(null);let n;try{n=JSON.parse(s)}catch{f(_());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;l>0?e.bpm=l:delete e.bpm}m(!0);try{await t({chartId:e.chartId,name:a.trim(),tokens:n}),i(!1)}catch(e){f(e instanceof Error?e.message:String(e))}finally{m(!1)}}async function v(){if(e.chartId!==void 0&&window.confirm(x()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(z,{variant:`outline`,size:`sm`,onClick:h,children:ee()}),(0,X.jsx)(z,{variant:`ghost`,size:`sm`,onClick:()=>void v(),children:ge()})]})})]}),r?(0,X.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:lt()}),(0,X.jsx)(B,{value:a,onChange:e=>o(e.target.value),maxLength:60})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:y()}),(0,X.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,X.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:l,onChange:e=>u(Number(e.target.value)),"aria-label":y()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:l===0?ie():`${l} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ne()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:it()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:s,onChange:e=>c(e.target.value),rows:10,spellCheck:!1})]}),d?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:d}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(z,{size:`sm`,disabled:p,onClick:()=>void g(),children:st()}),(0,X.jsx)(z,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:Te()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function nn(){let e=T(w.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:h()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:_e()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:he()}):(0,X.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,X.jsx)(tn,{chart:e},e.key))})]})}function rn({chart:e,groups:t}){let n=b(w.charts.addChartToGroupPool),r=b(w.charts.removeChartFromGroupPool),i=e.restrictedToGroups,a=e.poolGroups,o=new Set((a??[]).map(e=>e.groupId)),s=t.filter(e=>!o.has(e._id));async function c(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function l(t){try{await r({groupId:t,chartKey:e.key})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(V,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?Ee():e.kind===`custom`&&e.scope===`personal`?C():He()}),e.isGlobalDefault?(0,X.jsx)(V,{variant:`default`,children:$e()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Se()}),(a??[]).map(e=>(0,X.jsxs)(V,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Ze({group:e.name}),onClick:()=>void l(e.groupId),children:(0,X.jsx)(N,{className:`size-3`})})]},e.groupId)),s.length>0?(0,X.jsxs)(R,{value:``,onValueChange:e=>void c(e),children:[(0,X.jsx)(F,{size:`sm`,className:`w-56`,children:(0,X.jsx)(P,{placeholder:Le()})}),(0,X.jsx)(I,{children:s.map(e=>(0,X.jsx)(L,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Je()}):null]})]})}function an({chart:e}){let t=b(w.charts.promoteChartToCommon),n=b(w.charts.deleteChart);async function r(){if(e.chartId!==void 0)try{await t({chartId:e.chartId})}catch{}}async function i(){if(e.chartId!==void 0&&window.confirm(x()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(V,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?je():C()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ge({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(z,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:Oe()}):null,(0,X.jsx)(z,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:nt()})]})]})}function on({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=b(w.admin.setDefaultThemeMode),a=b(w.admin.setDefaultLocale),o=b(w.charts.setDefaultChart),s=T(w.charts.listChartsAdmin),c=T(w.groups.listGroups,{}),u=e??`system`,d=t??`fr`;return(0,X.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:pe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:at()})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Pe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:We()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(z,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void o({name:null}),children:E()}),_t.map(e=>(0,X.jsx)(z,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({name:e.key}),children:e.name},e.key)),(s??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(z,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({name:e.key}),children:e.name},e.key))]})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Ye()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ae()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(rn,{chart:e,groups:c??[]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:De()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:tt()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,X.jsx)(en,{chart:e})]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Ne()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ie()})]}),(()=>{let e=(s??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ue()}):(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,X.jsx)(an,{chart:e},e.key))})})()]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:ze()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:i()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(z,{variant:u===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:qt(e)},e))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Ve()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:oe()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:vt().map(e=>(0,X.jsx)(z,{variant:d===e.value?`default`:`outline`,size:`sm`,onClick:()=>void a({locale:e.value}),children:e.label},e.value))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:l()})]})]})}function sn(){let e=T(w.me.getMe,{host:H}),t=gt(e?.resolvedThemeMode);return(0,X.jsxs)(`div`,{className:`oc-appearance`,children:[(0,X.jsx)(Zt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,X.jsx)(Qt,{}),(0,X.jsx)(nn,{}),e?.role===`admin`?(0,X.jsx)(on,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function cn(){let[e,t]=(0,K.useState)(!0),[n,r]=(0,K.useState)(`per-user`),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(Z),[c,l]=(0,K.useState)(Z),[u,f]=(0,K.useState)(Gt),p=i!==``||o!==Z||c!==Z;function m(){a(``),s(Z),l(Z),f(Gt)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(sn,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:d()}),(0,X.jsxs)(Q,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(z,{children:`Default`}),(0,X.jsx)(z,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(z,{variant:`outline`,children:`Outline`}),(0,X.jsx)(z,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(z,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(z,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(z,{size:`sm`,children:`Small`}),(0,X.jsx)(z,{children:`Default`}),(0,X.jsx)(z,{size:`lg`,children:`Large`}),(0,X.jsx)(z,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(O,{})}),(0,X.jsx)(z,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)(Q,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(V,{children:`Default`}),(0,X.jsx)(V,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(V,{variant:`outline`,children:`Outline`}),(0,X.jsx)(V,{variant:`destructive`,children:`Destructive`})]})}),(0,X.jsx)(Q,{title:`Inputs & selection`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(B,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(R,{value:n,onValueChange:r,children:[(0,X.jsx)(F,{className:`w-56`,children:(0,X.jsx)(P,{placeholder:`Select…`})}),(0,X.jsxs)(I,{children:[(0,X.jsx)(L,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(L,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(j,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,X.jsx)(Q,{title:`Filtres & plage temporelle`,description:`Barre réutilisable (recherche debouncée + selects rapides à largeur auto + plage façon Grafana) et constructeur de filtre avancé. Câblée dans Users, Groups, Comptes de service, Traces, Anomalies, Audit et KPI.`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsxs)(kt,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:f,onReset:m,canReset:p,children:[(0,X.jsxs)(R,{value:o,onValueChange:s,children:[(0,X.jsx)(F,{size:`sm`,children:(0,X.jsx)(P,{})}),(0,X.jsxs)(I,{children:[(0,X.jsx)(L,{value:Z,children:`Toutes directions`}),(0,X.jsx)(L,{value:`inbound`,children:`inbound`}),(0,X.jsx)(L,{value:`outbound`,children:`outbound`}),(0,X.jsx)(L,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(R,{value:c,onValueChange:l,children:[(0,X.jsx)(F,{size:`sm`,children:(0,X.jsx)(P,{})}),(0,X.jsxs)(I,{children:[(0,X.jsx)(L,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(L,{value:`info`,children:`info`}),(0,X.jsx)(L,{value:`warn`,children:`warn`}),(0,X.jsx)(L,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(At,{fields:Kt,onChange:()=>{}}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,X.jsx)(Ot,{value:u,onChange:f})]})]})}),(0,X.jsx)(Q,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(mt,{children:[(0,X.jsx)(dt,{asChild:!0,children:(0,X.jsx)(z,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(O,{})})}),(0,X.jsxs)(pt,{align:`start`,children:[(0,X.jsx)(ft,{children:`Actions`}),(0,X.jsx)(A,{}),(0,X.jsx)(k,{children:`Edit`}),(0,X.jsx)(k,{children:`Duplicate`}),(0,X.jsx)(A,{}),(0,X.jsx)(k,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)(Q,{title:`Card`,children:(0,X.jsxs)(wt,{className:`w-full max-w-80`,children:[(0,X.jsxs)(yt,{children:[(0,X.jsx)(St,{children:`Instance`}),(0,X.jsx)(Ct,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(xt,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(bt,{className:`gap-2`,children:[(0,X.jsx)(z,{size:`sm`,children:`Save`}),(0,X.jsx)(z,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,X.jsx)(Q,{title:`Table`,children:(0,X.jsxs)(Dt,{children:[(0,X.jsx)(Tt,{children:(0,X.jsxs)(W,{children:[(0,X.jsx)(U,{className:`w-8`,children:(0,X.jsx)(j,{"aria-label":`select all`})}),(0,X.jsx)(U,{children:`Name`}),(0,X.jsx)(U,{children:`Mode`}),(0,X.jsx)(U,{className:`text-right`,children:`Status`}),(0,X.jsx)(U,{className:`w-8`})]})}),(0,X.jsx)(Et,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(W,{children:[(0,X.jsx)(G,{children:(0,X.jsx)(j,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(G,{className:`font-medium`,children:e.n}),(0,X.jsx)(G,{children:(0,X.jsx)(V,{variant:`secondary`,children:e.m})}),(0,X.jsx)(G,{className:`text-right`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,X.jsx)(D,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(G,{children:(0,X.jsx)(z,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(O,{})})})]},e.n))})]})}),(0,X.jsx)(Q,{title:`App fragments`,description:`Chat-specific components`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,X.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,X.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,X.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,X.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,X.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,X.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,X.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,X.jsx)(`span`,{className:`oc-run-status__dot`}),(0,X.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{cn as ThemeShowroom};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$B as r,$M as i,AB as a,Bd as o,CN as s,DB as c,EB as l,FB as u,GB as d,GM as f,HM as p,IB as m,JB as h,JM as g,KB as _,KM as ee,LB as v,MB as y,NB as b,OB as x,PB as S,QB as C,QM as te,RB as ne,Rd as w,SN as re,TB as T,UM as E,VM as D,WB as ie,WM as ae,XB as oe,XM as se,YB as ce,YM as le,ZB as O,ZM as ue,_N as de,_Q as k,aN as fe,aV as pe,bN as me,cN as he,cV as A,dN as j,dV as M,eN as ge,eV as N,fN as _e,fV as ve,gN as ye,hN as be,iN as xe,iV as Se,jB as Ce,k as we,kB as Te,lN as Ee,lV as De,mN as Oe,mV as ke,nN as Ae,nV as je,oN as Me,oV as Ne,pN as Pe,pV as Fe,qB as Ie,qM as Le,rN as Re,rV as ze,sN as Be,sV as Ve,t as P,tN as He,tV as F,uN as Ue,uV as We,vN as Ge,vQ as I,wN as Ke,xN as qe,yN as Je,zB as Ye,zd as Xe}from"./api-jG5Fwsg4.js";import{n as Ze,t as Qe}from"./useNavigate-D3GIoxyW.js";import{t as $e}from"./check-MG02lA-U.js";import{t as et}from"./copy-BIRdG3Nl.js";import{n as tt,t as nt}from"./eye-CZuTJsZX.js";import{o as rt,r as it}from"./deliveryRecorder-DEtCAEff.js";import{t as at}from"./x-TiVTngrx.js";import{a as L,i as R,n as z,r as B,t as V}from"./select-DGKgMOlh.js";import{i as H,n as U,r as ot,t as st}from"./tabs-BWfAdnjK.js";import{t as W}from"./button-sV7hIR3f.js";import"./convexApi-DeaVGrsr.js";import{t as G}from"./badge-CSm2xaYH.js";import{a as ct,n as K}from"./format-BQaxlN43.js";import{a as lt,n as ut,o as dt,r as ft,t as pt}from"./dialog-Bpoyy7pR.js";import{c as mt,o as ht,s as gt,u as _t}from"./searchSchemas-Dm-Qg010.js";import{t as vt}from"./appHost-CH3EGcJw.js";import{n as yt}from"./TimeRangePicker-BvcqBpnq.js";import{t as bt}from"./FilterBar-D2w0wWnm.js";import{t as xt}from"./AdvancedFilter-B4QfxxEB.js";import{t as St}from"./DataTableShell-BTk71L7O.js";var Ct=we(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),q=t(e(),1),J=n(),Y={kind:`relative`,from:`now-520w`,to:`now`},X=e=>e===null?`-`:String(Math.round(e));function wt(e){let t=e.indexOf(`:`);if(t<0)return e;let n=e.slice(0,t),r=e.slice(t+1);return n===`admin`?ce():n===`agent`?`${h()} - ${r}`:e}function Tt(){let e=I(P.me.getMe,{host:vt})?.role===`admin`,t=I(P.deliveryTiming.getDeliveryStatus,{}),n=k(P.deliveryTiming.startDeliveryRecord),r=k(P.deliveryTiming.stopDeliveryRecord),[i,a]=(0,q.useState)(!1),[o,s]=(0,q.useState)(!1),c=t?.recording??!1,l=async()=>{s(!0);try{c?await r({}):await n({})}finally{s(!1)}};return(0,J.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsx)(`h3`,{className:`text-sm font-semibold`,children:ke()}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Fe()})]}),e?(0,J.jsx)(W,{variant:c?`destructive`:`default`,size:`sm`,disabled:o||t===void 0,onClick:()=>void l(),children:c?M():ve()}):null]}),c?(0,J.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,J.jsx)(G,{variant:`secondary`,children:We()}),t?.startedAt?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:De({time:ct(t.startedAt)})}):null]}):null,(0,J.jsx)(`div`,{children:(0,J.jsx)(W,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?Ne():Ve()})}),i?(0,J.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=I(P.deliveryTiming.listDeliverySessions,{}),n=k(P.deliveryTiming.deleteDeliverySessions),[i,a]=(0,q.useState)(``),[o,s]=(0,q.useState)(`all`),[c,u]=(0,q.useState)(Y),[f,p]=(0,q.useState)(null),{from:m,to:h}=yt(c),g=c.to===`now`?1/0:h,ee=i.trim()!==``||o!==`all`||c!==Y,v=()=>{a(``),s(`all`),u(Y)},y=(0,q.useMemo)(()=>{if(t===void 0)return;let e=i.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(o===`all`||(o===`active`?t.active:!t.active))&&t.startedAt>=m&&t.startedAt<=g).map(e=>({...e,_id:e.sessionId}))},[t,i,o,m,g]),b=e=>{let t=new Set((y??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),f!==null&&r.includes(f)&&p(null))};return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(bt,{q:i,onQChange:a,searchPlaceholder:Se(),timeRange:c,onTimeRangeChange:u,onReset:v,canReset:ee,children:(0,J.jsxs)(V,{value:o,onValueChange:e=>s(e),children:[(0,J.jsx)(R,{size:`sm`,className:`w-36`,children:(0,J.jsx)(L,{})}),(0,J.jsxs)(z,{children:[(0,J.jsx)(B,{value:`all`,children:ze()}),(0,J.jsx)(B,{value:`active`,children:je()}),(0,J.jsx)(B,{value:`stopped`,children:F()})]})]})}),(0,J.jsx)(St,{title:pe(),rows:y,emptyHint:l(),columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(W,{variant:`ghost`,size:`icon`,"aria-label":f===e.sessionId?_():Ie(),onClick:()=>p(t=>t===e.sessionId?null:e.sessionId),children:f===e.sessionId?(0,J.jsx)(tt,{size:15,"aria-hidden":!0}):(0,J.jsx)(nt,{size:15,"aria-hidden":!0})})},{header:N(),sort:e=>e.startedAt,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:K(e.startedAt)})},{header:r(),sort:e=>e.stoppedAt,cell:e=>e.stoppedAt===null?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,J.jsx)(`span`,{className:`tabular-nums`,children:K(e.stoppedAt)})},{header:C(),sort:e=>e.count,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:X(e.count)})},{header:O(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:oe(),sort:e=>e.active,cell:e=>e.active?(0,J.jsx)(G,{variant:`secondary`,children:je()}):(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:F()})}],rowActions:e?e=>[{label:d(),variant:`destructive`,onSelect:()=>b([e.sessionId])}]:void 0,bulkActions:e?[{label:d(),variant:`destructive`,onSelect:e=>b(e)}]:void 0,isExpanded:e=>e.sessionId===f,renderExpanded:e=>(0,J.jsx)(Dt,{sessionId:e.sessionId})})]})}function Dt({sessionId:e}){let t=I(P.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,q.useState)(!1);return(0,J.jsx)(Ot,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(it(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function Ot({report:e,copied:t,onCopy:n}){if(!e)return(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:ie()});if(e.count===0||e.segments===null)return(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:A()});let r=e.segments,i=(e,t)=>(0,J.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,J.jsx)(`td`,{className:`py-1`,children:e}),(0,J.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:t.count}),(0,J.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[X(t.p50),` / `,X(t.p95),` / `,X(t.max)]})]});return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` `,T()]}),(0,J.jsxs)(W,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,J.jsx)($e,{size:13,"aria-hidden":!0}):(0,J.jsx)(et,{size:13,"aria-hidden":!0}),t?c():x()]})]}),(0,J.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{className:`text-left text-muted-foreground`,children:[(0,J.jsx)(`th`,{className:`py-1 font-medium`,children:v()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:m()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:u()})]})}),(0,J.jsxs)(`tbody`,{children:[i(S(),r.bridge),i(b(),r.A),i(y(),r.C)]})]}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Ce()}),e.truncated?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Te()}):null,(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:a()})]})}var kt=[50,100,200,500],Z=`all`,Q=`__all__`,At=[`2xx`,`4xx`,`5xx`],jt=[`user`,`service`,`system`],Mt=[`inbound`,`outbound`,`internal`],Nt={kind:`relative`,from:`now-30d`,to:`now`},Pt=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:o()},{value:`principalType`,label:Xe()},{value:`direction`,label:`direction`},{value:`roleKey`,label:w()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function Ft(){let e=Ze({from:`/settings/traces`}),t=Qe({from:`/settings/traces`}),n=e.limit,r=e.kind,a=e.statusClass??Q,o=e.principalType??Q,c=e.direction??Q,l=e.roleKey??Q,u=e.q??``,d=e.correlationId,p=ht(e.from,e.to),m=(0,q.useMemo)(()=>_t(e.adv),[e.adv]),{from:h,to:_}=yt(p),[v,y]=(0,q.useState)(null),[b,x]=(0,q.useState)(null),S=e=>void t({search:t=>({...t,limit:e})}),C=e=>void t({search:t=>({...t,kind:e})}),w=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),T=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),E=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),D=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),ie=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),oe=e=>void t({search:t=>({...t,...mt(e)})}),ce=e=>void t({search:t=>({...t,adv:gt(e)}),replace:!0}),O=I(P.observability.listEvents,{limit:n}),k=I(P.observability.listEvents,{limit:n,kind:r===Z?void 0:r,...d?{correlationId:d}:{},filter:{q:u||void 0,from:h,to:_,statusClass:a===Q?void 0:a,principalType:o===Q?void 0:o,direction:c===Q?void 0:c,roleKey:l===Q?void 0:l,advanced:m.length>0?m:void 0}}),pe=(0,q.useMemo)(()=>{let e=new Set;for(let t of O??[])e.add(t.kind);return[...e].sort()},[O]),A=(0,q.useMemo)(()=>{let e=new Set;for(let t of O??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[O]),M=u!==``||a!==Q||o!==Q||c!==Q||l!==Q||m.length>0||p.kind!==`relative`||p.from!==Nt.from;function N(){t({search:{limit:100,kind:`all`},replace:!0})}let ve=v?O?.filter(e=>e.correlationId===v):k,Se=e.section,Ce=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,J.jsxs)(st,{value:Se,onValueChange:e=>Ce(e),children:[(0,J.jsxs)(ot,{className:`w-full`,children:[(0,J.jsxs)(H,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(rt,{size:13,"aria-hidden":!0}),Ye()]}),(0,J.jsxs)(H,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(Ct,{size:13,"aria-hidden":!0}),ne()]})]}),(0,J.jsx)(U,{value:`latency`,children:(0,J.jsx)(Tt,{})}),(0,J.jsxs)(U,{value:`events`,className:`flex flex-col gap-3`,children:[(0,J.jsxs)(`p`,{className:`oc-admin__hint`,children:[Ke(),(0,J.jsx)(`strong`,{children:s()}),re(),` `,(0,J.jsx)(`span`,{className:`oc-filter__window`,children:qe()})]}),(0,J.jsxs)(bt,{q:u,onQChange:w,searchPlaceholder:me(),timeRange:p,onTimeRangeChange:oe,onReset:N,canReset:M,children:[(0,J.jsxs)(V,{value:a,onValueChange:T,children:[(0,J.jsx)(R,{size:`sm`,className:`w-32`,children:(0,J.jsx)(L,{placeholder:Je()})}),(0,J.jsxs)(z,{children:[(0,J.jsx)(B,{value:Q,children:Ge()}),At.map(e=>(0,J.jsx)(B,{value:e,children:e},e))]})]}),(0,J.jsxs)(V,{value:o,onValueChange:E,children:[(0,J.jsx)(R,{size:`sm`,className:`w-32`,children:(0,J.jsx)(L,{placeholder:de()})}),(0,J.jsxs)(z,{children:[(0,J.jsx)(B,{value:Q,children:ye()}),jt.map(e=>(0,J.jsx)(B,{value:e,children:e},e))]})]}),(0,J.jsxs)(V,{value:c,onValueChange:D,children:[(0,J.jsx)(R,{size:`sm`,className:`w-32`,children:(0,J.jsx)(L,{placeholder:be()})}),(0,J.jsxs)(z,{children:[(0,J.jsx)(B,{value:Q,children:Oe()}),Mt.map(e=>(0,J.jsx)(B,{value:e,children:e},e))]})]}),(0,J.jsxs)(V,{value:l,onValueChange:ie,children:[(0,J.jsx)(R,{size:`sm`,className:`w-36`,children:(0,J.jsx)(L,{placeholder:Pe()})}),(0,J.jsxs)(z,{children:[(0,J.jsx)(B,{value:Q,children:_e()}),A.map(e=>(0,J.jsx)(B,{value:e,children:e},e))]})]}),(0,J.jsx)(`input`,{list:`oc-trace-kinds`,className:`oc-input oc-input--sm w-44`,value:r===Z?``:r,placeholder:j(),"aria-label":j(),onChange:e=>{let t=e.target.value.trim();C(t===``?Z:t)}}),(0,J.jsx)(`datalist`,{id:`oc-trace-kinds`,children:pe.map(e=>(0,J.jsx)(`option`,{value:e},e))}),(0,J.jsxs)(V,{value:String(n),onValueChange:e=>S(Number(e)),children:[(0,J.jsx)(R,{size:`sm`,className:`w-28`,children:(0,J.jsx)(L,{})}),(0,J.jsx)(z,{children:kt.map(e=>(0,J.jsx)(B,{value:String(e),children:Ue({count:e})},e))})]})]}),(0,J.jsx)(xt,{fields:Pt,seed:m,onChange:ce}),v?(0,J.jsx)(`div`,{className:`oc-traces__followline`,children:(0,J.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>y(null),title:Ee(),children:[(0,J.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[he(),(0,J.jsx)(`code`,{children:$(v)})]}),(0,J.jsx)(at,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,J.jsx)(`span`,{className:`sr-only`,children:Be()})]})}):null,(0,J.jsx)(St,{title:Me(),rows:ve,emptyHint:v?fe():xe(),columns:[{header:Re(),sort:e=>e.at,cell:e=>(0,J.jsx)(`span`,{className:`oc-traces__time`,children:K(e.at)})},{header:Ae(),sort:e=>e.kind,cell:e=>(0,J.jsx)(G,{variant:`secondary`,children:e.kind})},{header:He(),sort:e=>Lt(e)??null,cell:e=>{let t=Lt(e);return t?(0,J.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,J.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":ge(),children:`✓`})}},{header:i(),sort:e=>e.direction,cell:e=>e.direction?(0,J.jsx)(G,{variant:`outline`,children:e.direction}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:te(),sort:e=>e.principalType,cell:e=>(0,J.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,J.jsx)(G,{variant:`outline`,children:e.principalType}),e.principalId?(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:ue(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,J.jsx)(G,{variant:`secondary`,children:e.roleKey}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:se(),sort:e=>e.route,cell:e=>e.route?(0,J.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,J.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:le(),sort:e=>e.status,cell:e=>e.status===null?(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,J.jsx)(`span`,{className:`oc-traces__status ${It(e.status)}`,children:e.status})},{header:g(),sort:e=>e.latencyMs,cell:e=>e.latencyMs===null?(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,J.jsxs)(`span`,{className:`oc-traces__mono`,children:[e.latencyMs,` ms`]})},{header:Le(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,J.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:ee(),onClick:()=>y(e.correlationId),children:$(e.correlationId)}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:f(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,J.jsx)(W,{variant:`outline`,size:`sm`,onClick:()=>x(e),children:ae()}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,J.jsx)(Rt,{row:b,onClose:()=>x(null)})]})]})}function It(e){return e>=500?`oc-traces__status--5xx`:e>=400?`oc-traces__status--4xx`:e>=200&&e<300?`oc-traces__status--2xx`:`oc-traces__status--other`}function $(e){return e.length>8?e.slice(0,8):e}function Lt(e){if(typeof e.status==`number`&&e.status>=400)return String(e.status);if(!e.meta)return null;try{let t=JSON.parse(e.meta);if(e.kind===`openclaw.dispatch`&&t.dispatchStatus===`failed`)return t.errorCode??`failed`;if(e.kind===`assistant.stream`&&t.phase===`finalize`&&(t.streamStatus===`error`||t.streamStatus===`aborted`))return t.streamStatus;if(e.kind===`openclaw.ingest.denied`)return`denied`}catch{}return null}function Rt({row:e,onClose:t}){let n=(0,q.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,J.jsx)(pt,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,J.jsxs)(ut,{className:`max-w-lg`,children:[(0,J.jsxs)(lt,{children:[(0,J.jsxs)(dt,{className:`oc-traces__meta-title`,children:[E(),` `,(0,J.jsx)(`code`,{children:e.kind}),(0,J.jsx)(G,{variant:`outline`,children:p()})]}),(0,J.jsx)(ft,{children:D()})]}),(0,J.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{Ft as TracesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{BD as r,BM as i,FD as a,GD as o,HD as s,ID as c,JD as l,KD as u,LD as d,RD as f,UD as p,VD as m,WD as h,XD as g,YD as _,ZD as v,_Q as y,eO as b,k as x,qD as S,t as C,tO as w,uQ as T,vQ as E,zD as D}from"./api-jG5Fwsg4.js";import{t as O}from"./use_paginated_query-imV3AXlW.js";import{t as k}from"./trash-2-UxV-pTWt.js";import{t as A}from"./button-sV7hIR3f.js";import"./convexApi-DeaVGrsr.js";import{r as j}from"./toast-daONdZpX.js";import{n as M}from"./format-BQaxlN43.js";import{n as N}from"./ConfirmDialog-BmOX8o6F.js";import{r as P}from"./fileMetaView-Ci5C4w9Q.js";import{r as F}from"./trashView-CrjCfgVT.js";import{n as I,t as L}from"./trashPage-CFUn9bkp.js";var R=x(`scan-search`,[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`m16 16-1.9-1.9`,key:`1dq9hf`}]]),z=t(e(),1);function B(e,t){let n=e.find(e=>e.status===`running`&&!e.stale)??null,r=e.find(e=>e.mode===`dryRun`&&e.status===`done`)??null,i=e.find(e=>e.mode===`apply`&&(e.status===`done`||e.status===`refused`)&&(r===null||e.startedAt>r.startedAt))??null,a=null;return n===null?r===null||i!==null?a=`no_report`:r.applicableUntil===null||r.applicableUntil<=t?a=`expired`:r.mirrorMissing>0?a=`mirror`:r.orphans.count===0&&(a=`nothing`):a=`running`,{running:n,report:r,lastApply:i,applyBlock:a}}var V=n();function H(){let e=E(C.blobSweep.listBlobSweeps,{}),t=E(C.blobQuarantine.quarantineSettings,{}),n=y(C.blobSweep.startBlobSweep),b=N(),{toast:x}=j(),[w,O]=(0,z.useState)(!1),F=T(),I=e=>P(e,F),L=B(e??[],Date.now()),H=L.report,U=async e=>{O(!0);try{await e()}catch(e){x({title:a(),description:e.message,variant:`error`})}finally{O(!1)}},W=()=>U(()=>n({mode:`dryRun`})),G=async()=>{H!==null&&await b({title:D({count:H.orphans.count}),description:f({size:I(H.orphans.bytes)}),confirmLabel:r(),destructive:!0})&&await U(()=>n({mode:`apply`,confirms:H._id}))};return(0,V.jsxs)(`section`,{className:`oc-trash__body`,"aria-labelledby":`oc-blobsweep-title`,children:[(0,V.jsxs)(`div`,{className:`oc-trash__head`,children:[(0,V.jsx)(`h3`,{id:`oc-blobsweep-title`,className:`oc-trash__heading`,children:v()}),(0,V.jsxs)(`div`,{className:`oc-trash__actions`,children:[(0,V.jsxs)(A,{variant:`outline`,size:`sm`,disabled:w||L.running!==null,onClick:()=>void W(),children:[(0,V.jsx)(R,{}),` `,_()]}),(0,V.jsxs)(A,{variant:`ghost`,size:`sm`,className:`h-auto min-h-8 shrink whitespace-normal text-left text-destructive`,disabled:w||L.applyBlock!==null,onClick:()=>void G(),children:[(0,V.jsx)(k,{}),` `,r()]})]})]}),(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:g({days:H?.minAgeDays??7,quarantine:t?.days??7})}),e===void 0?(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:i()}):null,L.running===null?null:(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:l({scanned:L.running.blobsScanned})}),e!==void 0&&H===null&&L.running===null?(0,V.jsx)(`p`,{className:`oc-trash__empty`,children:S()}):null,H===null?null:(0,V.jsxs)(`div`,{className:`oc-trash__hint`,children:[(0,V.jsx)(`p`,{children:u({date:M(H.finishedAt??H.startedAt),count:H.orphans.count,size:I(H.orphans.bytes),scanned:H.blobsScanned})}),(0,V.jsxs)(`ul`,{children:[(0,V.jsx)(`li`,{children:o({count:H.byOrigin.upload?.count??0,size:I(H.byOrigin.upload?.bytes??0)})}),(0,V.jsx)(`li`,{children:h({count:H.byOrigin.unregistered?.count??0,size:I(H.byOrigin.unregistered?.bytes??0)})})]}),H.importing>0?(0,V.jsx)(`p`,{children:p({count:H.importing})}):null,H.mirrorMissing>0?(0,V.jsx)(`p`,{className:`text-destructive`,children:s({count:H.mirrorMissing})}):null,L.applyBlock===`expired`?(0,V.jsx)(`p`,{children:m()}):null]}),L.lastApply===null?null:(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:L.lastApply.status===`refused`?c({date:M(L.lastApply.finishedAt??L.lastApply.startedAt)}):d({date:M(L.lastApply.finishedAt??L.lastApply.startedAt),count:L.lastApply.deleted.count,size:I(L.lastApply.deleted.bytes)})})]})}function U(){let{results:e,status:t,loadMore:n}=O(C.trash.adminListTrash,{},{initialNumItems:50}),r=F(),a=y(C.trash.adminRestoreChat),o=y(C.trash.adminPurgeChat);return(0,V.jsxs)(`div`,{className:`oc-trash__body`,children:[(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:w({days:r})}),t===`LoadingFirstPage`?(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:i()}):e.length===0?(0,V.jsx)(`p`,{className:`oc-trash__empty`,children:b()}):(0,V.jsx)(L,{items:e,onRestore:e=>a({chatId:e}),onPurge:e=>o({chatId:e})}),(0,V.jsx)(I,{status:t,loadMore:n}),(0,V.jsx)(H,{})]})}export{U as TrashTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$L as r,$j as i,JL as a,QL as o,Qj as s,SR as c,XL as l,Xj as u,YL as d,Yj as f,ZL as p,Zj as m,_Q as h,_R as g,aM as _,aR as ee,bR as v,cR as te,dR as ne,dS as y,eM as b,eR as re,fR as ie,fS as x,gR as ae,hR as oe,iM as S,iR as se,kL as ce,lR as le,mR as ue,nM as C,nR as de,oM as w,oR as fe,pR as pe,pS as T,rM as E,rR as me,sM as D,sR as he,t as O,tM as k,tR as ge,uR as _e,vQ as A,vR as ve,xR as j,yR as ye}from"./api-jG5Fwsg4.js";import{n as be,t as xe}from"./useNavigate-D3GIoxyW.js";import{c as M,i as N,n as P,r as Se,t as Ce}from"./dropdown-menu-yCbwljS-.js";import{t as F}from"./checkbox-U99HMqP3.js";import{t as I}from"./server-ClLFUY_D.js";import{t as L}from"./star-B6yMf_Hc.js";import{a as R,i as z,n as B,r as V,t as H}from"./select-DGKgMOlh.js";import{t as U}from"./button-sV7hIR3f.js";import"./convexApi-DeaVGrsr.js";import{r as W}from"./toast-daONdZpX.js";import{t as G}from"./badge-CSm2xaYH.js";import{a as we,n as Te,o as Ee,r as De,t as Oe}from"./dialog-Bpoyy7pR.js";import{t as ke}from"./appHost-CH3EGcJw.js";import{n as Ae,r as je}from"./ConfirmDialog-BmOX8o6F.js";import{a as K}from"./groupManageView-BcbLXWZ4.js";import{a as Me,o as q,t as J}from"./AdminSettings-BdVeeUB1.js";import{t as Ne}from"./FilterBar-D2w0wWnm.js";import{t as Pe}from"./DataTableShell-BTk71L7O.js";import{t as Fe}from"./DetailChips-BU-SQfjj.js";var Y=t(e(),1),X=n();function Z({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=A(O.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),a=A(O.agents.listUserAgents,n&&e?{profileId:e}:`skip`),o=new Set((a??[]).map(e=>`${e.instanceName}/${e.agentId}`)),s=(a??[]).find(e=>e.isDefault)??null,c=s?`${s.instanceName}/${s.agentId}`:null,l=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),u=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(a??[]).filter(e=>!l.has(`${e.instanceName}/${e.agentId}`)).map(e=>({instanceName:e.instanceName,agentId:e.agentId,displayName:e.displayName,emoji:e.emoji,model:e.model,kind:e.kind,enabled:e.enabled,state:e.state,outOfPool:!0}))],d=new Map;for(let e of u){let t=d.get(e.instanceName)??[];t.push(e),d.set(e.instanceName,t)}return(0,X.jsx)(Oe,{open:n,onOpenChange:r,children:(0,X.jsxs)(Te,{className:`oc-access`,children:[(0,X.jsxs)(we,{children:[(0,X.jsx)(Ee,{children:D({user:t})}),(0,X.jsx)(De,{children:w()})]}),i?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?_():S()}):null,(0,X.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:E()}):u.length===0?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:b()}):[...d.entries()].map(([t,n])=>(0,X.jsx)(Ie,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:o,defaultKey:c},t))})]})})}function Ie({profileId:e,instanceName:t,kind:n,agents:r,assigned:a,defaultKey:o}){let c=h(O.agents.assignAgent),l=h(O.agents.removeAgent),d=h(O.agents.setDefaultAgent),p=W();if(!e)return null;async function g(n,r){try{r?await l({profileId:e,instanceName:t,agentId:n}):await c({profileId:e,instanceName:t,agentId:n})}catch(e){p.error(C(),K(e))}}async function _(n){try{await d({profileId:e,instanceName:t,agentId:n})}catch(e){p.error(k(),K(e))}}return(0,X.jsxs)(`div`,{className:`oc-access__group`,children:[(0,X.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,X.jsx)(I,{size:13,"aria-hidden":!0}),(0,X.jsx)(`span`,{children:t}),(0,X.jsx)(G,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=a.has(n),c=o===n,l=e.state===`deleted`,d=!e.enabled;return(0,X.jsxs)(`div`,{className:`oc-access__row oc-reveal-host${d?` is-disabled`:``}`,children:[(0,X.jsx)(F,{checked:r,disabled:(l||d)&&!r,onCheckedChange:()=>void g(e.agentId,r),"aria-label":i({name:e.displayName??e.agentId})}),(0,X.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,X.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,l?(0,X.jsx)(G,{variant:`outline`,className:`oc-access__gone`,children:s()}):null,e.outOfPool?(0,X.jsx)(G,{variant:`outline`,className:`oc-access__gone`,children:m()}):null,r?c?(0,X.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":u(),title:u(),children:(0,X.jsx)(L,{size:14,fill:`currentColor`})}):(0,X.jsx)(U,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault oc-reveal oc-hit`,"aria-label":f(),title:f(),disabled:d,onClick:()=>void _(e.agentId),children:(0,X.jsx)(L,{size:14})}):null]},e.agentId)})]})}var Q=`__all__`;function $(e){switch(e){case`pending`:return y();case`user`:return x();case`admin`:return T();default:return e}}function Le({granted:e,onToggle:t}){let n=new Set(e),r=J.filter(e=>n.has(q[e])).length;return(0,X.jsxs)(Ce,{children:[(0,X.jsx)(M,{asChild:!0,children:(0,X.jsx)(U,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?c():j({count:r})})}),(0,X.jsxs)(P,{align:`start`,className:`w-52`,children:[(0,X.jsx)(N,{children:v()}),J.map(e=>{let r=q[e];return(0,X.jsxs)(Se,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,X.jsx)(F,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,X.jsx)(`span`,{children:Me[e]()})]},e)})]})]})}function Re(){let e=be({from:`/settings/users`}),t=xe({from:`/settings/users`}),n=e.q??``,i=e.role??Q,s=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),c=e=>void t({search:t=>({...t,role:e===Q?void 0:e})}),u=A(O.admin.listUsers,{filter:{q:n||void 0,role:i===Q?void 0:i},withAgents:!0}),f=A(O.me.getMe,{host:ke}),m=h(O.admin.setRole),_=h(O.admin.setUserPermissions),v=h(O.admin.startImpersonation),y=h(O.admin.deleteUser),b=h(O.admin.setUserName),x=Ae(),S=je(),C=W(),[w,T]=(0,Y.useState)(null),E=(0,Y.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of u??[])e.add(t.role);return[...e]},[u]),D=n!==``||i!==Q;function k(){t({search:{},replace:!0})}async function j(e){try{await m(e)}catch(e){C.error(ye(),e)}}async function M(e){try{await _(e)}catch(e){C.error(ve(),e)}}async function N(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await x({title:ne(),description:_e({user:t}),confirmWord:le(),confirmLabel:te(),destructive:!0}))try{await y({profileId:e._id}),C.success(fe({user:t}))}catch(e){C.error(he(),e)}}async function P(e){let t=e.email||e.name||e.userId.slice(0,8),n=await S({title:se(),label:me({user:t}),placeholder:de(),defaultValue:e.name??``,confirmLabel:ce()});if(n!==null)try{await b({profileId:e._id,name:n}),C.success(ge())}catch(e){C.error(re(),e)}}return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Ne,{q:n,onQChange:s,searchPlaceholder:g(),onReset:k,canReset:D,children:(0,X.jsxs)(H,{value:i,onValueChange:c,children:[(0,X.jsx)(z,{size:`sm`,className:`w-36`,children:(0,X.jsx)(R,{})}),(0,X.jsxs)(B,{children:[(0,X.jsx)(V,{value:Q,children:ae()}),E.map(e=>(0,X.jsx)(V,{value:e,children:$(e)},e))]})]})}),(0,X.jsx)(Pe,{title:oe(),rows:u,emptyHint:ue(),rowActions:e=>{let t=[{label:a(),onSelect:()=>T({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:ee(),onSelect:()=>void P(e)}];return e.userId!==f?.userId&&t.push({label:pe(),onSelect:()=>void v({profileId:e._id})},{label:ie(),variant:`destructive`,onSelect:()=>void N(e)}),t},columns:[{header:r(),cell:e=>{let t=e.email||e.name||e.canonical||e.userId.slice(0,8),n=e.email&&e.name&&e.name!==e.email?e.name:null;return(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[(0,X.jsx)(`span`,{children:t}),n?(0,X.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}):null]})},sort:e=>e.email||e.name||e.canonical||e.userId},{header:o(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,X.jsxs)(H,{value:e.role,onValueChange:t=>void j({profileId:e._id,role:t}),children:[(0,X.jsx)(z,{size:`sm`,className:`w-28`,children:(0,X.jsx)(R,{})}),(0,X.jsxs)(B,{children:[(0,X.jsx)(V,{value:`pending`,children:$(`pending`)}),(0,X.jsx)(V,{value:`user`,children:$(`user`)}),(0,X.jsx)(V,{value:`admin`,children:$(`admin`)})]})]})},{header:p(),sort:e=>e.role===`admin`?9999:e.extraPermissions?.length??0,cell:e=>e.role===`admin`?(0,X.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:l()}):(0,X.jsx)(Le,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),M({profileId:e._id,permissions:[...n]})}})},{header:d(),cell:e=>(0,X.jsx)(Fe,{icon:(0,X.jsx)(I,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,X.jsx)(Z,{profileId:w?.profileId??null,userLabel:w?.label??``,open:w!==null,onOpenChange:e=>{e||T(null)}})]})}export{Re as UsersTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$u as r,Al as i,Bu as a,Cl as o,El as s,Ez as c,Fu as l,Gu as u,Hu as d,Iu as f,Ju as p,Ku as m,Lu as h,Ml as g,Nl as _,Pu as v,Qu as y,Ru as ee,Tl as te,Uu as ne,Vl as b,Vu as x,Wu as S,Xu as C,Yu as re,Yv as ie,Zu as ae,_Q as w,bl as oe,ed as se,hQ as ce,id as le,jl as ue,kl as de,nd as fe,ol as pe,qu as me,qv as he,rd as ge,sQ as T,t as E,td as D,uQ as O,vQ as k,vb as A,vl as j,wl as M,xl as N,yl as P,zu as F}from"./api-jG5Fwsg4.js";import{n as I,t as L}from"./useNavigate-D3GIoxyW.js";import{a as _e,c as R,d as ve,f as ye,i as be,l as z,m as xe,o as Se,p as Ce,r as we}from"./speech-DO_eJ8Aq.js";import{t as B}from"./checkbox-U99HMqP3.js";import{a as V,i as H,n as U,r as W,t as G}from"./select-DGKgMOlh.js";import{i as K,n as q,r as Te,t as Ee}from"./tabs-BWfAdnjK.js";import{t as J}from"./button-sV7hIR3f.js";import"./convexApi-DeaVGrsr.js";import{t as Y}from"./badge-CSm2xaYH.js";import{t as X}from"./appHost-CH3EGcJw.js";/* empty css */var Z=t(e(),1),Q=n(),De=[[`auto`,()=>ae()],[`fr-FR`,()=>_()],[`en-US`,()=>g()],[`en-GB`,()=>ue()],[`de-DE`,()=>i()],[`es-ES`,()=>de()]],Oe=[[`0.75`,()=>re()],[`1`,()=>p()],[`1.25`,()=>me()],[`1.5`,()=>m()]],$=0;function ke({instance:e}){let t=w(E.admin.upsertInstanceConfig),n=e.config??{},i={enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0},[a,o]=(0,Z.useState)(i),[s,c]=(0,Z.useState)(`idle`),[l,f]=(0,Z.useState)(!1),[p,m]=(0,Z.useState)(!1),h=ce(E.voice.gatewayTtsPreview);(0,Z.useEffect)(()=>{o({enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0}),c(`idle`)},[e._id]);let g=a.enabled!==i.enabled||a.engine!==i.engine||a.lang!==i.lang||a.rate!==i.rate||a.autoRead!==i.autoRead;async function _(){c(`saving`);try{let n={...e.config??{}};n.voiceEnabled=a.enabled,a.engine===`gateway`?n.voiceEngine=`gateway`:delete n.voiceEngine,a.lang===`auto`?delete n.voiceLang:n.voiceLang=a.lang;let r=Number.parseFloat(a.rate);!Number.isFinite(r)||r===1?delete n.voiceRate:n.voiceRate=r,a.autoRead?n.voiceAutoRead=!0:delete n.voiceAutoRead,await t({instanceId:e._id,config:n}),c(`idle`)}catch{c(`error`)}}return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:e.name}),(0,Q.jsx)(Y,{variant:`secondary`,children:e.kind===`hermes`?`Hermes`:`OpenClaw`})]}),(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(B,{checked:a.enabled,onCheckedChange:e=>o({...a,enabled:e===!0}),"aria-label":r()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:r()})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:N()}),(0,Q.jsxs)(G,{value:a.engine,onValueChange:e=>o({...a,engine:e}),disabled:!a.enabled,children:[(0,Q.jsx)(H,{size:`sm`,"aria-label":N(),children:(0,Q.jsx)(V,{})}),(0,Q.jsxs)(U,{children:[(0,Q.jsx)(W,{value:`browser`,children:oe()}),e.kind===`hermes`?null:(0,Q.jsx)(W,{value:`gateway`,children:P()})]})]})]}),a.engine===`gateway`?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:j()}):null,a.engine===`gateway`?null:(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:y()}),(0,Q.jsxs)(G,{value:a.lang,onValueChange:e=>o({...a,lang:e}),disabled:!a.enabled,children:[(0,Q.jsx)(H,{size:`sm`,"aria-label":y(),children:(0,Q.jsx)(V,{})}),(0,Q.jsx)(U,{children:De.map(([e,t])=>(0,Q.jsx)(W,{value:e,children:t()},e))})]})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:C()}),(0,Q.jsxs)(G,{value:a.rate,onValueChange:e=>o({...a,rate:e}),disabled:!a.enabled,children:[(0,Q.jsx)(H,{size:`sm`,"aria-label":C(),children:(0,Q.jsx)(V,{})}),(0,Q.jsx)(U,{children:Oe.map(([e,t])=>(0,Q.jsx)(W,{value:e,children:t()},e))})]})]}),a.engine===`gateway`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(B,{checked:a.autoRead,onCheckedChange:e=>o({...a,autoRead:e===!0}),disabled:!a.enabled,"aria-label":u()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:u()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:S()})]}),(0,Q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,Q.jsx)(J,{size:`sm`,disabled:!g||s===`saving`,onClick:()=>void _(),children:s===`saving`?A():ie()}),(0,Q.jsx)(J,{variant:`outline`,size:`sm`,disabled:!a.enabled||l,onClick:()=>{let t=Number.parseFloat(a.rate)||1,n=++$;if(m(!1),z(),R(),a.engine!==`gateway`){Se(x(),{lang:_e(a.lang,O()),rate:t});return}f(!0),h({instanceName:e.name,text:x()}).then(({mime:e,audioBase64:r})=>{n===$&&be(r,e,{rate:t})}).catch(()=>{n===$&&m(!0)}).finally(()=>f(!1))},children:l?A():ne()}),(0,Q.jsx)(J,{variant:`ghost`,size:`sm`,onClick:()=>{$++,f(!1),z(),R()},children:d()})]}),s===`error`||p?(0,Q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:p?pe():he()}):null]})}function Ae({stt:e}){let t=k(E.me.getMe,{host:X}),n=w(E.admin.setFeatureEnabled),r=t?.ui?.featuresEnabled?.voiceInput===!0,i=t?.role===`admin`;return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:F()}),(0,Q.jsx)(Y,{variant:e?`secondary`:`outline`,children:e?l():v()}),(0,Q.jsx)(Y,{variant:r?`secondary`:`destructive`,children:r?te():M()})]}),i?(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(B,{checked:r,onCheckedChange:e=>void n({key:`voiceInput`,enabled:e===!0}),"aria-label":s()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:s()})]}):null,(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ee()})]})}function je(){let e=k(E.admin.listInstances,{}),t=(0,Z.useMemo)(()=>ve(),[]),n=(0,Z.useMemo)(()=>we(),[]),{section:r}=I({from:`/settings/voice`}),i=L({from:`/settings/voice`});return(0,Q.jsxs)(`div`,{className:`oc-admin__tab oc-voice`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:le()}),(0,Q.jsxs)(`div`,{className:`oc-voice__support`,children:[(0,Q.jsx)(Y,{variant:t?`secondary`:`destructive`,className:`h-auto shrink whitespace-normal text-left`,children:t?ge():fe()}),(0,Q.jsx)(Y,{variant:n?`secondary`:`destructive`,className:`h-auto shrink whitespace-normal text-left`,children:n?D():se()})]}),(0,Q.jsxs)(Ee,{value:r,onValueChange:e=>void i({search:{section:e},replace:!0}),children:[(0,Q.jsxs)(Te,{className:`w-full`,children:[(0,Q.jsxs)(K,{value:`readaloud`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(ye,{size:13,"aria-hidden":!0}),o()]}),(0,Q.jsxs)(K,{value:`dictation`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Ce,{size:13,"aria-hidden":!0}),F()]}),(0,Q.jsxs)(K,{value:`talk`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(xe,{size:13,"aria-hidden":!0}),h()]})]}),(0,Q.jsx)(q,{value:`readaloud`,children:e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:T()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):e.map(e=>(0,Q.jsx)(ke,{instance:e},e._id))}),(0,Q.jsx)(q,{value:`dictation`,children:(0,Q.jsx)(Ae,{stt:n})}),(0,Q.jsxs)(q,{value:`talk`,children:[(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsx)(`header`,{className:`oc-voice__cardhead`,children:(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:h()})}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:f()})]}),e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:T()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):e.map(e=>(0,Q.jsx)(Me,{instance:e},e._id))]})]})]})}function Me({instance:e}){let t=w(E.admin.upsertInstanceConfig),n=e.config??{},r=n.talkEnabled===!0,i=e.kind===`hermes`;return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:e.name}),(0,Q.jsx)(Y,{variant:`secondary`,children:i?`Hermes`:`OpenClaw`})]}),i?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:b()}):(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(B,{checked:r,onCheckedChange:r=>{let i={...n};r===!0?i.talkEnabled=!0:delete i.talkEnabled,t({instanceId:e._id,config:i})},"aria-label":c()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:c()})]})]})}export{je as VoiceTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as e}from"./api-jG5Fwsg4.js";var t=e(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as e}from"./api-jG5Fwsg4.js";var t=e(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as e}from"./api-jG5Fwsg4.js";var t=e(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as e}from"./api-jG5Fwsg4.js";var t=e(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as e}from"./api-jG5Fwsg4.js";var t=e(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./api-jG5Fwsg4.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$C as e,$o as t,Aw as n,Bo as ee,Cw as r,Dw as i,Ew as a,Fw as o,Go as s,Ho as c,Iw as l,Ko as u,Lw as d,Mw as f,Nw as p,Ow as m,Pw as h,QC as g,Qo as _,Rw as v,Sw as y,Tw as b,Uo as x,Xo as S,Yo as C,ZC as w,Zo as T,_w as E,aw as D,bc as O,bw as k,cw as A,dw as te,es as j,ew as M,fw as N,gw as P,hw as F,iw as I,jw as L,kw as R,lw as z,mw as B,ns as V,nw as H,ow as U,pw as W,rw as G,sw as K,ts as q,tw as J,uw as Y,vw as X,ww as Z,xw as Q,yc as ne,yw as re,zo as ie,zw as ae}from"./api-jG5Fwsg4.js";var $={AGENT_NOT_FOUND:()=>({label:ae(),hint:v()}),AUTH_TOKEN_MISMATCH:()=>({label:d(),hint:l()}),DEVICE_SIGNING_FAILED:()=>({label:o(),hint:h()}),SESSION_SCOPE_DENIED:()=>({label:p(),hint:f()}),GATEWAY_TIMEOUT:()=>({label:L(),hint:n()}),GATEWAY_DISCONNECTED:()=>({label:R(),hint:m()}),GATEWAY_RESTARTING:()=>({label:i(),hint:a()}),GATEWAY_STOPPING:()=>({label:b(),hint:Z()}),CONNECTION_SATURATED:()=>({label:r(),hint:y()}),DISPATCH_STALLED:()=>({label:O(),hint:ne()}),ATTACHMENT_TOO_LARGE:()=>({label:re(),hint:X()}),ATTACHMENT_REJECTED:()=>({label:E(),hint:P()}),BRIDGE_UNREACHABLE:()=>({label:Q(),hint:k()}),INVALID_REQUEST:()=>({label:F(),hint:B()}),chat_request_conflict:()=>({label:W(),hint:N()}),NOT_CONFIGURED:()=>({label:te(),hint:Y()}),UNROUTED:()=>({label:z(),hint:A()}),message_too_large:()=>({label:ee(),hint:ie()}),gateway_media_unavailable:()=>({label:_(),hint:T()}),subagent_reply_pending:()=>({label:x(),hint:c()}),attachment_name_too_long:()=>({label:u(),hint:s()}),attachment_path_refused:()=>({label:V(),hint:q()}),attachment_staging_failed:()=>({label:j(),hint:t()}),attachment_cleanup_unconfirmed:()=>({label:S(),hint:C()}),provider_auth_revoked:e=>({label:D(),hint:I({agentId:e.agentId??`<agentId>`,provider:e.provider??`<provider>`})}),provider_permission_denied:e=>({label:G(),hint:H({agentId:e.agentId??`<agentId>`,provider:e.provider??`<provider>`})}),provider_auth_failed:e=>({label:J(),hint:M({agentId:e.agentId??`<agentId>`,provider:e.provider??`<provider>`})}),UPSTREAM_ERROR:()=>({label:K(),hint:U()}),UNKNOWN:()=>({label:e(),hint:g()})};function oe(e,t={}){return e?$[e]?.(t)??{label:e,hint:w()}:$.UNKNOWN(t)}export{oe as t};
|