@lacneu/atrium 0.97.0 → 0.98.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AccessTab-CHD9OGB2.js → AccessTab-CRwVD6bj.js} +1 -1
- package/dist/assets/{AdvancedFilter-DtBAnHBl.js → AdvancedFilter-Dnyuc-Bv.js} +1 -1
- package/dist/assets/AgentFilesTab-CPNOuN7W.js +3 -0
- package/dist/assets/AnomaliesTab-LNX-bDmU.js +1 -0
- package/dist/assets/AuditTab-Bo5FFLse.js +1 -0
- package/dist/assets/BridgeTab-5DckBVxB.js +1 -0
- package/dist/assets/ChatDefaultsTab-CI7bnli7.js +1 -0
- package/dist/assets/{DataTableShell-D-TTxNiz.js → DataTableShell-Dekyfrzb.js} +1 -1
- package/dist/assets/DeletedChatsTab-CBrccWUL.js +1 -0
- package/dist/assets/{DetailChips-BG1A-DBR.js → DetailChips-Kz4cbymu.js} +1 -1
- package/dist/assets/FeedbacksTab-nr2NGnOq.js +1 -0
- package/dist/assets/{FieldLabel-CYivkNb7.js → FieldLabel-Dug2NEx7.js} +1 -1
- package/dist/assets/FilesTab-DQI3Qs6I.js +1 -0
- package/dist/assets/{FilterBar-BcbgCjju.js → FilterBar-Ct8JGeev.js} +1 -1
- package/dist/assets/{GroupsTab-Bu6exndB.js → GroupsTab-FMHdOf15.js} +1 -1
- package/dist/assets/InstancesTab-1l_YlKBp.js +1 -0
- package/dist/assets/{IntegrationsTab-DkNTP0Rq.js → IntegrationsTab-qHBzXhyJ.js} +1 -1
- package/dist/assets/KpiTab-Pi-1zup5.js +1 -0
- package/dist/assets/PreferencesTab-DHQv8afQ.js +1 -0
- package/dist/assets/ProjectPage-B9VswV7G.js +1 -0
- package/dist/assets/PromptInjectionsTab-Bm9tmvcD.js +4 -0
- package/dist/assets/RolesTab-D0xnbubk.js +1 -0
- package/dist/assets/ScheduledTab-D0CdWK0x.js +1 -0
- package/dist/assets/ServiceAccountsTab-BLbO_-PK.js +1 -0
- package/dist/assets/{SubAgentReportsTab-f79L5P5H.js → SubAgentReportsTab-CeMPpWp2.js} +1 -1
- package/dist/assets/ThemeShowroom-BJf2qNsA.js +1 -0
- package/dist/assets/{TimeRangePicker-spgMK1lW.js → TimeRangePicker-1vrUmBZJ.js} +1 -1
- package/dist/assets/{TimezoneCombobox-A-0jP4K0.js → TimezoneCombobox-Bs8PmRcr.js} +1 -1
- package/dist/assets/TracesTab-CQNXeU8n.js +1 -0
- package/dist/assets/{TrashTab-DvQVUDCO.js → TrashTab-CanoobNv.js} +1 -1
- package/dist/assets/UsersTab-SU4FWI5C.js +1 -0
- package/dist/assets/{VoiceTab--hK27XzX.js → VoiceTab-C2JssfrM.js} +1 -1
- package/dist/assets/{api-B8SYK4Qy.js → api-BEXV-QDx.js} +5 -5
- package/dist/assets/{button-CXjFGJbj.js → button-BI4NYd7l.js} +1 -1
- package/dist/assets/{card-RKiqrSX4.js → card-CUy80Snk.js} +1 -1
- package/dist/assets/chevrons-up-down-BBnIDUVh.js +1 -0
- package/dist/assets/{compatView-DTsAloUX.js → compatView-C6vyLpqy.js} +1 -1
- package/dist/assets/{dispatchErrorInfo-CPqs6Yse.js → dispatchErrorInfo-U1f-h1hb.js} +1 -1
- package/dist/assets/{dist-Bt7EMDhU.js → dist-BgUgjwlI.js} +1 -1
- package/dist/assets/{dist-CtzGb_ur.js → dist-Yi0k4JhM.js} +1 -1
- package/dist/assets/{dist-7qJAgXuT.js → dist-ibS6mHJS.js} +1 -1
- package/dist/assets/{dist-DV2cg11u.js → dist-xED7lptS.js} +1 -1
- package/dist/assets/{highlighted-body-OFNGDK62-D7hrEPuh.js → highlighted-body-OFNGDK62-DKzMKZqC.js} +1 -1
- package/dist/assets/index-04n15OUt.css +1 -0
- package/dist/assets/index-CND0zLpO.js +448 -0
- package/dist/assets/{list-77P9EclZ.js → list-CMpIlPcq.js} +1 -1
- package/dist/assets/mermaid-GHXKKRXX-U8_Ynrg_.js +1 -0
- package/dist/assets/{pdf-d0093JRQ.js → pdf-B2fugRCF.js} +1 -1
- package/dist/assets/roleDescriptions-BUL4ira1.js +1 -0
- package/dist/assets/{table-BpXDMEP0.js → table-CvUcBPgp.js} +1 -1
- package/dist/assets/trashPage-CtRjTgEJ.js +1 -0
- package/dist/assets/{use_paginated_query-DXjegJvG.js → use_paginated_query-CWrNoLih.js} +1 -1
- package/dist/assets/x-ijoBrBAS.js +1 -0
- package/dist/index.html +9 -9
- package/package.json +1 -1
- package/dist/assets/AgentFilesTab-Dv3deQ0j.js +0 -3
- package/dist/assets/AnomaliesTab-DhbNorRL.js +0 -1
- package/dist/assets/AuditTab-CyAOp6ce.js +0 -1
- package/dist/assets/BridgeTab-BUWF4UrP.js +0 -1
- package/dist/assets/ChatDefaultsTab-DiPPZqHr.js +0 -1
- package/dist/assets/DeletedChatsTab-BdBsLuP7.js +0 -1
- package/dist/assets/FeedbacksTab-Dgzk0NDh.js +0 -1
- package/dist/assets/FilesTab-B0bwkp5L.js +0 -1
- package/dist/assets/InstancesTab-DG5eRqcF.js +0 -1
- package/dist/assets/KpiTab-DxUA3rWG.js +0 -1
- package/dist/assets/PreferencesTab-CvrFdw7V.js +0 -1
- package/dist/assets/ProjectPage-IHPI3vtI.js +0 -1
- package/dist/assets/PromptInjectionsTab-WqUP6pCA.js +0 -4
- package/dist/assets/RolesTab-CW-SViZn.js +0 -1
- package/dist/assets/ScheduledTab-xhuLTCC1.js +0 -1
- package/dist/assets/ServiceAccountsTab-CPgJugHH.js +0 -1
- package/dist/assets/ThemeShowroom-DCvO9d1X.js +0 -1
- package/dist/assets/TracesTab-LLYV5o4G.js +0 -1
- package/dist/assets/UsersTab-jG9dMte6.js +0 -1
- package/dist/assets/chevrons-up-down-C5nDK8w5.js +0 -1
- package/dist/assets/index-CJlTinIx.css +0 -1
- package/dist/assets/index-DDEtFVdr.js +0 -448
- package/dist/assets/mermaid-GHXKKRXX-CaN0vriA.js +0 -1
- package/dist/assets/roleDescriptions-Cr2PVmkf.js +0 -1
- package/dist/assets/trashPage-LA_ooyZZ.js +0 -1
- package/dist/assets/x-Cqa-YMkZ.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$H as r,$U as i,AU as ee,BU as te,CU as ne,DU as re,EU as ie,FU as ae,GU as oe,HU as se,IU as ce,JU as le,KU as ue,LU as de,MU as fe,NU as pe,OU as me,PU as he,QH as a,QU as ge,RU as _e,SU as ve,TU as ye,UU as be,VU as xe,WU as Se,XU as Ce,YU as we,ZH as o,ZU as Te,_U as Ee,_W as De,aU as Oe,aW as ke,bU as Ae,cU as s,cW as je,dU as c,dW as l,eU as u,eW as Me,fU as d,fW as f,gU as p,gW as Ne,hU as m,hW as Pe,iU as h,iW as Fe,jU as Ie,kU as Le,lU as g,lW as Re,lX as _,mU as v,mW as ze,nU as y,nW as Be,oU as b,oW as Ve,pU as x,pW as He,qU as Ue,rU as S,rW as We,sU as C,sW as Ge,sX as Ke,t as w,tU as T,tW as qe,uU as E,uW as Je,uX as D,vU as O,wU as Ye,xU as Xe,yU as k,zU as Ze}from"./api-B8SYK4Qy.js";import{r as Qe}from"./dist-7qJAgXuT.js";import{t as A}from"./button-CXjFGJbj.js";import{$t as j,At as M,Ct as N,Dt as P,Et as F,Jt as I,Ot as L,St as R,Tt as z,Yt as $e,b as et,bt as B,ct as tt,dr as nt,fr as rt,kt as V,lr as H,rr as U,sr as it,vt as W,wt as G,xt as K,yt as q}from"./index-DDEtFVdr.js";import{t as at}from"./FilterBar-BcbgCjju.js";import{t as ot}from"./DataTableShell-D-TTxNiz.js";import{t as st}from"./roleDescriptions-Cr2PVmkf.js";var J=t(e(),1),Y=n(),ct=[{value:`never`,label:()=>S(),days:null},{value:`30`,label:()=>y(),days:30},{value:`90`,label:()=>T(),days:90}],X=720*60*60*1e3,Z=`__all__`,Q={name:``,roleKey:``,description:``};function $(){let e=rt({from:`/settings/serviceAccounts`}),t=nt({from:`/settings/serviceAccounts`}),n=e.q??``,r=e.status??Z,[a,o]=(0,J.useState)(Z),Ee=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),Oe=e=>void t({search:t=>({...t,status:e===Z?void 0:e})}),Ae=D(w.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:a===Z?void 0:a,disabled:r===Z?void 0:r===`disabled`}}),s=D(w.apiKeys.listKeys,{}),c=D(w.apiKeys.listRoles,{}),u=_(w.apiKeys.createServiceAccount),d=_(w.apiKeys.updateServiceAccount),p=_(w.apiKeys.deleteServiceAccount),m=Ke(w.apiKeys.mintApiKey),h=_(w.apiKeys.revokeApiKey),g=tt(),v=$e(),y=n!==``||a!==Z||r!==Z;function b(){o(Z),t({search:{},replace:!0})}let[x,S]=(0,J.useState)(!1),[C,T]=(0,J.useState)(Q),[E,O]=(0,J.useState)(null),[k,M]=(0,J.useState)(new Set),[N,P]=(0,J.useState)(null),F=(0,J.useRef)(!1),[L,z]=(0,J.useState)(new Set),[V,H]=(0,J.useState)({}),[U,G]=(0,J.useState)(null),X=(0,J.useMemo)(()=>{let e=new Map;for(let t of s??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[s]);function $(e){M(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function dt(){try{E?(await d({serviceAccountId:E,name:C.name,roleKey:C.roleKey,description:C.description}),v.success(ae())):await u({name:C.name,roleKey:C.roleKey,description:C.description||void 0}),T(Q),O(null),S(!1)}catch(e){v.error(E?ce():de(),e)}}function ft(e){T({name:e.name,roleKey:e.roleKey,description:e.description??``}),O(e._id),S(!0)}async function pt(e){if(F.current)return;F.current=!0;let t=V[e._id]??`never`,n=ct.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;P(e._id);try{let t=await m({serviceAccountId:e._id,expiresAt:r});G({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){v.error(he(),e)}finally{F.current=!1,P(null)}}async function mt(e){if(await g({title:pe(),description:(0,Y.jsxs)(Y.Fragment,{children:[fe(),` `,(0,Y.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,Ie(),` `,(0,Y.jsx)(`strong`,{children:ee()}),` `,Le()]}),confirmWord:e.name,confirmLabel:me(),destructive:!0}))try{await p({serviceAccountId:e._id}),v.success(re(),e.name)}catch(e){v.error(ie(),e)}}async function ht(e){if(await g({title:ye(),description:(0,Y.jsxs)(Y.Fragment,{children:[Ye(),` `,(0,Y.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,ne()]}),confirmLabel:ve(),destructive:!0})&&!L.has(e._id)){z(t=>new Set(t).add(e._id));try{await h({keyId:e._id})}catch(e){v.error(Xe(),e)}finally{z(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:De()}),(0,Y.jsxs)(at,{q:n,onQChange:Ee,searchPlaceholder:Ne(),onReset:b,canReset:y,children:[(0,Y.jsxs)(W,{value:a,onValueChange:o,children:[(0,Y.jsx)(K,{size:`sm`,className:`w-40`,children:(0,Y.jsx)(R,{placeholder:Pe()})}),(0,Y.jsxs)(q,{children:[(0,Y.jsx)(B,{value:Z,children:ze()}),(c??[]).map(e=>(0,Y.jsx)(B,{value:e.key,children:e.key},e._id))]})]}),(0,Y.jsxs)(W,{value:r,onValueChange:Oe,children:[(0,Y.jsx)(K,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(R,{})}),(0,Y.jsxs)(q,{children:[(0,Y.jsx)(B,{value:Z,children:He()}),(0,Y.jsx)(B,{value:`active`,children:f()}),(0,Y.jsx)(B,{value:`disabled`,children:l()})]})]})]}),(0,Y.jsx)(ot,{title:Je(),rows:Ae,addLabel:Re(),onAdd:()=>{T(Q),O(null),S(!0)},emptyHint:je(),isExpanded:e=>k.has(e._id),renderExpanded:e=>(0,Y.jsx)(lt,{account:e,keys:X.get(e._id)??[],onRevoke:ht,revoking:L}),rowActions:e=>[...(e.managedBy??null)===null?[{label:Fe(),onSelect:()=>ft(e)},{label:Ge(),onSelect:()=>void pt(e)}]:[],{label:k.has(e._id)?Ve():ke(),onSelect:()=>$(e._id)},...(e.managedBy??null)===null?[{label:We(),variant:`destructive`,onSelect:()=>void mt(e)}]:[]],columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(A,{variant:`ghost`,size:`icon-sm`,"aria-label":k.has(e._id)?Be():qe(),onClick:()=>$(e._id),children:k.has(e._id)?(0,Y.jsx)(Qe,{}):(0,Y.jsx)(it,{})})},{header:Me(),sort:e=>e.name,cell:e=>(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Y.jsx)(`span`,{children:e.name}),e.description?(0,Y.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:i(),sort:e=>e.roleKey,cell:e=>(0,Y.jsx)(I,{variant:`secondary`,children:e.roleKey})},{header:ge(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,Y.jsx)(I,{variant:`destructive`,children:l()}):(0,Y.jsx)(I,{variant:`outline`,children:f()})},{header:Te(),cell:e=>(0,Y.jsxs)(W,{value:V[e._id]??`never`,onValueChange:t=>H(n=>({...n,[e._id]:t})),children:[(0,Y.jsx)(K,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(R,{})}),(0,Y.jsx)(q,{children:ct.map(e=>(0,Y.jsx)(B,{value:e.value,children:e.label()},e.value))})]})},{header:Ce(),sort:e=>(X.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(X.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,Y.jsx)(`span`,{className:`oc-sa__keycount`,children:N===e._id?we():le({count:t})})}}]}),(0,Y.jsx)(et,{open:x,onOpenChange:e=>{S(e),e||O(null)},title:E?Ue():Se(),description:E?ue():be(),canSubmit:!!(C.name&&C.roleKey),onSubmit:dt,submitLabel:E?oe():se(),children:(0,Y.jsxs)(`div`,{className:`oc-form`,children:[(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:xe()}),(0,Y.jsx)(j,{value:C.name,onChange:e=>T({...C,name:e.target.value})})]}),(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:te()}),(0,Y.jsxs)(W,{value:C.roleKey||void 0,onValueChange:e=>T({...C,roleKey:e}),children:[(0,Y.jsx)(K,{className:`w-full`,children:(0,Y.jsx)(R,{placeholder:Ze()})}),(0,Y.jsx)(q,{children:(c??[]).map(e=>(0,Y.jsxs)(B,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(c??[]).find(e=>e.key===C.roleKey),t=e?st(e):null;return t?(0,Y.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:_e()}),(0,Y.jsx)(j,{value:C.description,onChange:e=>T({...C,description:e.target.value})})]})]})}),(0,Y.jsx)(ut,{minted:U,onClose:()=>G(null)})]})}function lt({account:e,keys:t,onRevoke:n,revoking:r}){return(0,Y.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,Y.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[Ae(),` `,(0,Y.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:k()}):(0,Y.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`th`,{children:O()}),(0,Y.jsx)(`th`,{children:Ee()}),(0,Y.jsx)(`th`,{children:p()}),(0,Y.jsx)(`th`,{children:m()}),(0,Y.jsx)(`th`,{children:v()}),(0,Y.jsx)(`th`,{children:x()}),(0,Y.jsx)(`th`,{})]})}),(0,Y.jsx)(`tbody`,{children:t.map(t=>(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`td`,{children:(0,Y.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,Y.jsx)(`td`,{children:(0,Y.jsx)(I,{variant:`secondary`,children:e.roleKey})}),(0,Y.jsx)(`td`,{children:M(t.createdAt)}),(0,Y.jsx)(`td`,{className:dt(t.lastUsedAt)?`oc-sa__stale`:``,children:ft(t.lastUsedAt)}),(0,Y.jsx)(`td`,{children:pt(t.expiresAt)}),(0,Y.jsx)(`td`,{children:mt(t)}),(0,Y.jsx)(`td`,{className:`text-right`,children:!t.disabled&&(e.managedBy??null)===null?(0,Y.jsx)(A,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?d():c()}):null})]},t._id))})]})]})}function ut({minted:e,onClose:t}){let[n,r]=(0,J.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,Y.jsx)(N,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,Y.jsxs)(G,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,Y.jsxs)(P,{children:[(0,Y.jsx)(L,{children:E()}),(0,Y.jsx)(z,{children:g({name:e.accountName})})]}),(0,Y.jsx)(`div`,{className:`oc-sa__minted-warning`,children:s()}),(0,Y.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Y.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,Y.jsxs)(A,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":C(),children:[n?(0,Y.jsx)(H,{}):(0,Y.jsx)(U,{}),n?b():Oe()]})]}),(0,Y.jsx)(F,{children:(0,Y.jsx)(A,{onClick:()=>{r(!1),t()},children:h()})})]}):null})}function dt(e){return e===null?!1:Date.now()-e>X}function ft(e){return e===null?u():M(e)}function pt(e){return e===null?`—`:V(e)}function mt(e){return e.disabled?(0,Y.jsx)(I,{variant:`destructive`,children:r()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,Y.jsx)(I,{variant:`outline`,children:a()}):(0,Y.jsx)(I,{variant:`outline`,children:o()})}export{$ as ServiceAccountsTab};
|
|
@@ -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 a,CG as o,CK as s,DG as c,EG as l,EK as u,FG as d,GG as f,Gp as p,HG as m,IG as h,JG as g,KG as _,Kp as v,LG as ee,MG as y,NG as te,OG as ne,PG as re,QG as ie,QY as ae,RG as oe,SG as se,SK as ce,TG as le,TK as ue,UG as b,Up as de,VG as fe,WG as pe,Wp as me,XG as he,XY as ge,YG as _e,ZG as ve,ZY as ye,_G as be,_K as xe,aG as Se,aK as Ce,bG as we,bK as Te,cG as x,cK as Ee,dG as De,dK as Oe,eK as ke,fG as S,fK as Ae,gG as je,gK as C,hG as Me,hK as Ne,iG as Pe,iK as Fe,jG as Ie,kG as Le,lG as Re,lK as ze,lX as w,mG as Be,mK as Ve,nK as He,oG as Ue,oK as We,pG as Ge,pK as Ke,qG as qe,r as Je,rK as Ye,sG as Xe,sK as Ze,sX as Qe,t as T,tK as $e,uG as et,uK as tt,uX as E,vG as nt,vK as rt,wG as D,wK as it,xG as at,xK as ot,yG as st,yK as ct,zG as lt}from"./api-B8SYK4Qy.js";import{t as O}from"./x-Cqa-YMkZ.js";import{t as k}from"./button-CXjFGJbj.js";import{$t as A,Jt as j,Mt as M,On as N,St as P,an as ut,bt as F,dt,en as ft,ft as I,in as L,lr as R,nn as z,nr as pt,rn as mt,tn as ht,tr as B,ut as gt,vt as V,xt as H,yt as U}from"./index-DDEtFVdr.js";import{t as _t}from"./localePickerView-C2RmOS86.js";import{a as vt,i as yt,n as bt,o as xt,r as St,t as Ct}from"./card-RKiqrSX4.js";import{a as wt,i as W,n as Tt,o as G,r as K,t as Et}from"./table-BpXDMEP0.js";import{t as Dt}from"./TimeRangePicker-spgMK1lW.js";import{t as Ot}from"./FilterBar-BcbgCjju.js";import{t as kt}from"./AdvancedFilter-DtBAnHBl.js";var q=t(e(),1),At=.1,jt=[248,248,248],Mt=[24,24,24];function Nt(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 Pt(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 J(e,t,n){return Pt(e,t,n)>=At}function Ft(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 It(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 Lt=12*1024*1024,Rt=480,zt=160,Bt=.92;async function Vt(e,t={}){if(!e.type.startsWith(`image/`))throw Error(c());if(e.size>Lt)throw Error(l());let{source:n,width:r,height:i,cleanup:a}=await Ht(e);try{let a=e.type===`image/svg+xml`,s=Math.min(Rt/r,zt/i,a?1/0:1),c=Math.max(1,Math.round(r*s)),l=Math.max(1,Math.round(i*s)),u=document.createElement(`canvas`);u.width=c,u.height=l;let d=u.getContext(`2d`);if(!d)throw Error(D());d.imageSmoothingEnabled=!0,d.imageSmoothingQuality=`high`,d.drawImage(n,0,0,c,l);let f=Nt(d.getImageData(0,0,c,l).data,c,l)??{x:0,y:0,width:c,height:l},p=document.createElement(`canvas`);p.width=f.width,p.height=f.height;let m=p.getContext(`2d`);if(!m)throw Error(D());if(m.drawImage(u,f.x,f.y,f.width,f.height,0,0,f.width,f.height),t.variantFor){let e=m.getImageData(0,0,f.width,f.height);J(e.data,f.width,f.height)?Ft(e.data,t.variantFor===`dark`?jt:Mt):It(e.data),m.putImageData(e,0,0)}let h=J(m.getImageData(0,0,f.width,f.height).data,f.width,f.height),g=await Y(p,`image/webp`,Bt)??await Y(p,`image/png`);if(!g)throw Error(o());return{blob:g,hasAlpha:h}}finally{a()}}async function Ht(e){if(e.type===`image/svg+xml`)return Ut(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 Ut(e)}async function Ut(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(le())),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`?ae():e===`dark`?ye():ge()}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:Je(`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)(R,{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)(k,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":v(),title:v(),children:(0,X.jsx)(pt,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=E(T.charts.listMyCharts),r=w(T.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:rt()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:xe()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:C(),subtitle:Ne(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?Ve():n.via===`owner`?Ke():Ae({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:Oe()}):null]})}function Qt(){let e=w(T.charts.importChart),[t,n]=(0,q.useState)(``),[r,i]=(0,q.useState)(``),[a,o]=(0,q.useState)(null),[s,c]=(0,q.useState)(!1),[l,u]=(0,q.useState)(!1);async function d(e){let t=e.target.files?.[0];if(e.target.value=``,t){o(null),c(!1);try{i(await t.text())}catch{o(b())}}}async function p(){if(o(null),c(!1),t.trim()===``){o(fe());return}let a;try{a=JSON.parse(r)}catch{o(b());return}u(!0);try{await e({name:t.trim(),tokens:a}),c(!0),n(``),i(``)}catch(e){o(e instanceof Error?e.message:String(e))}finally{u(!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:ve()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:he()})]}),(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:_e()}),(0,X.jsx)(A,{value:t,onChange:e=>n(e.target.value),placeholder:g(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:qe()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:_(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(N,{className:`size-4`}),f(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void d(e)})]})}),(0,X.jsx)(k,{size:`sm`,disabled:l,onClick:()=>void p(),children:pe()})]}),a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null,s?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:m()}):null]})]})}function $t({chart:e}){let t=Qe(T.charts.setChartLogo),n=w(T.charts.removeChartLogo),[r,a]=(0,q.useState)(!1),[o,s]=(0,q.useState)(null),c=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function l(n,r,i){if(e.chartId!==void 0){s(null),a(!0);try{let{blob:a,hasAlpha:o}=await Vt(r,i?{variantFor:i}:{}),s=await a.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}}async function u(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await l(e,n)}async function f(t){if(e.chartId!==void 0){s(null),a(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}}async function p(e){let t=c(e===`light`?`dark`:`light`);if(t){s(null),a(!0);try{await l(e,await(await fetch(t)).blob(),e)}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}}function m({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`?re():te()}),(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)(k,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(N,{className:`size-4`}),t?Ie():y(),(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)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void p(e),children:Le()}):null,t?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void f(e),children:i()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:d()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(m,{mode:`light`}),(0,X.jsx)(m,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ne()}):null,o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})}function en({chart:e}){let t=E(T.me.getMe,{host:I}),n=w(T.charts.addChartDomain),r=w(T.charts.removeChartDomain),[i,a]=(0,q.useState)(``),[o,s]=(0,q.useState)(null),[c,l]=(0,q.useState)(!1);if(t?.role!==`admin`)return null;let u=e.domains??[];async function d(){let t=i.trim();if(t!==``){s(null),l(!0);try{await n({chartKey:e.key,domain:t}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{l(!1)}}}async function f(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:se()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:u.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:nt()}):u.map(e=>(0,X.jsxs)(j,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":be({domain:e}),onClick:()=>void f(e),children:(0,X.jsx)(O,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{value:i,onChange:e=>a(e.target.value),placeholder:we(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&d()}}),(0,X.jsx)(k,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void d(),children:st()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:at()}),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=w(T.charts.updateChart),n=w(T.charts.deleteChart),[r,i]=(0,q.useState)(!1),[a,o]=(0,q.useState)(e.name),[s,c]=(0,q.useState)(()=>$(e.tokens)),[l,u]=(0,q.useState)(e.tokens.bpm??0),[d,f]=(0,q.useState)(null),[m,g]=(0,q.useState)(!1);function _(){o(e.name),c($(e.tokens)),u(e.tokens.bpm??0),f(null),i(!0)}async function v(){if(e.chartId===void 0)return;f(null);let n;try{n=JSON.parse(s)}catch{f(b());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;l>0?e.bpm=l:delete e.bpm}g(!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{g(!1)}}async function y(){if(e.chartId!==void 0&&window.confirm(S()))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)(k,{variant:`outline`,size:`sm`,onClick:_,children:ee()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void y(),children:h()})]})})]}),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:Be()}),(0,X.jsx)(A,{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:p()}),(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":p()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:l===0?me():`${l} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:de()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:Ge()}),(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)(k,{size:`sm`,disabled:m,onClick:()=>void v(),children:je()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:Me()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function nn(){let e=E(T.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:a()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:lt()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:oe()}):(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=w(T.charts.addChartToGroupPool),i=w(T.charts.removeChartFromGroupPool),a=e.restrictedToGroups,o=e.poolGroups,s=new Set((o??[]).map(e=>e.groupId)),c=t.filter(e=>!s.has(e._id));async function l(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function u(t){try{await i({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)(j,{variant:a?`secondary`:`outline`,className:`oc-chart-avail__state`,children:a?Ye():e.kind===`custom`&&e.scope===`personal`?x():Fe()}),e.isGlobalDefault?(0,X.jsx)(j,{variant:`default`,children:He()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:ke()}),(o??[]).map(e=>(0,X.jsxs)(j,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":ie({group:e.name}),onClick:()=>void u(e.groupId),children:(0,X.jsx)(O,{className:`size-3`})})]},e.groupId)),c.length>0?(0,X.jsxs)(V,{value:``,onValueChange:e=>void l(e),children:[(0,X.jsx)(H,{size:`sm`,className:`w-56`,children:(0,X.jsx)(P,{placeholder:r()})}),(0,X.jsx)(U,{children:c.map(e=>(0,X.jsx)(F,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:$e()}):null]})]})}function an({chart:e}){let t=w(T.charts.promoteChartToCommon),n=w(T.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(S()))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)(j,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?Xe():x()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Re({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(k,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:Ue()}):null,(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:Se()})]})]})}function on({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=w(T.admin.setDefaultThemeMode),i=w(T.admin.setDefaultLocale),a=w(T.charts.setDefaultChart),o=E(T.charts.listChartsAdmin),c=E(T.groups.listGroups,{}),l=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:Te()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ct()})]}),(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:tt()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ze()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void a({name:null}),children:C()}),dt.map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key)),(o??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({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:Ee()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ze()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).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:We()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ce()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).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:De()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:et()})]}),(()=>{let e=(o??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Pe()}):(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:u()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ue()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(k,{variant:l===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:it()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:s()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:_t().map(e=>(0,X.jsx)(k,{variant:d===e.value?`default`:`outline`,size:`sm`,onClick:()=>void i({locale:e.value}),children:e.label},e.value))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ce()})]})]})}function sn(){let e=E(T.me.getMe,{host:I}),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,q.useState)(!0),[n,r]=(0,q.useState)(`per-user`),[i,a]=(0,q.useState)(``),[o,s]=(0,q.useState)(Z),[c,l]=(0,q.useState)(Z),[u,d]=(0,q.useState)(Gt),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(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:ot()}),(0,X.jsxs)(Q,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{children:`Default`}),(0,X.jsx)(k,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(k,{variant:`outline`,children:`Outline`}),(0,X.jsx)(k,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(k,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(k,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{size:`sm`,children:`Small`}),(0,X.jsx)(k,{children:`Default`}),(0,X.jsx)(k,{size:`lg`,children:`Large`}),(0,X.jsx)(k,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(B,{})}),(0,X.jsx)(k,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)(Q,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{children:`Default`}),(0,X.jsx)(j,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(j,{variant:`outline`,children:`Outline`}),(0,X.jsx)(j,{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)(A,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(V,{value:n,onValueChange:r,children:[(0,X.jsx)(H,{className:`w-56`,children:(0,X.jsx)(P,{placeholder:`Select…`})}),(0,X.jsxs)(U,{children:[(0,X.jsx)(F,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(F,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(M,{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)(Ot,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(V,{value:o,onValueChange:s,children:[(0,X.jsx)(H,{size:`sm`,children:(0,X.jsx)(P,{})}),(0,X.jsxs)(U,{children:[(0,X.jsx)(F,{value:Z,children:`Toutes directions`}),(0,X.jsx)(F,{value:`inbound`,children:`inbound`}),(0,X.jsx)(F,{value:`outbound`,children:`outbound`}),(0,X.jsx)(F,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(V,{value:c,onValueChange:l,children:[(0,X.jsx)(H,{size:`sm`,children:(0,X.jsx)(P,{})}),(0,X.jsxs)(U,{children:[(0,X.jsx)(F,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(F,{value:`info`,children:`info`}),(0,X.jsx)(F,{value:`warn`,children:`warn`}),(0,X.jsx)(F,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(kt,{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)(Dt,{value:u,onChange:d})]})]})}),(0,X.jsx)(Q,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(ft,{children:[(0,X.jsx)(ut,{asChild:!0,children:(0,X.jsx)(k,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(B,{})})}),(0,X.jsxs)(ht,{align:`start`,children:[(0,X.jsx)(mt,{children:`Actions`}),(0,X.jsx)(L,{}),(0,X.jsx)(z,{children:`Edit`}),(0,X.jsx)(z,{children:`Duplicate`}),(0,X.jsx)(L,{}),(0,X.jsx)(z,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)(Q,{title:`Card`,children:(0,X.jsxs)(Ct,{className:`w-80`,children:[(0,X.jsxs)(vt,{children:[(0,X.jsx)(xt,{children:`Instance`}),(0,X.jsx)(St,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(bt,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(yt,{className:`gap-2`,children:[(0,X.jsx)(k,{size:`sm`,children:`Save`}),(0,X.jsx)(k,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,X.jsx)(Q,{title:`Table`,children:(0,X.jsxs)(Et,{children:[(0,X.jsx)(wt,{children:(0,X.jsxs)(G,{children:[(0,X.jsx)(W,{className:`w-8`,children:(0,X.jsx)(M,{"aria-label":`select all`})}),(0,X.jsx)(W,{children:`Name`}),(0,X.jsx)(W,{children:`Mode`}),(0,X.jsx)(W,{className:`text-right`,children:`Status`}),(0,X.jsx)(W,{className:`w-8`})]})}),(0,X.jsx)(Tt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(G,{children:[(0,X.jsx)(K,{children:(0,X.jsx)(M,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(K,{className:`font-medium`,children:e.n}),(0,X.jsx)(K,{children:(0,X.jsx)(j,{variant:`secondary`,children:e.m})}),(0,X.jsx)(K,{className:`text-right`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,X.jsx)(R,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(K,{children:(0,X.jsx)(k,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(B,{})})})]},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{$A as r,$R as i,AR as a,BA as o,CR as s,Cu as c,DR as l,E as u,ER as d,FR as f,GA as p,GR as m,HA as h,HR as g,IR as _,JA as v,JR as y,KA as b,KR as x,MR as S,NR as ee,OR as C,PR as te,QA as ne,QR as w,RA as re,SR as ie,TR as ae,Tu as oe,UA as se,UR as T,VA as ce,VR as E,WA as le,WR as D,XA as ue,XR as O,YA as de,YR as k,ZA as fe,ZR as A,_j as pe,aj as me,az as j,bj as he,cj as M,cz as ge,dj as _e,dz as ve,ej as ye,ez as be,fj as xe,gj as Se,hj as Ce,ij as we,iz as Te,jR as Ee,kR as De,lX as N,lj as Oe,lz as ke,mj as Ae,nj as je,nz as Me,oj as Ne,oz as Pe,pj as Fe,qA as Ie,qR as Le,rj as Re,rz as ze,sj as Be,sz as Ve,t as P,tj as He,tz as Ue,uX as F,uj as We,uz as Ge,vj as Ke,wR as qe,wu as Je,xj as Ye,yj as Xe,zA as Ze}from"./api-B8SYK4Qy.js";import{t as Qe}from"./x-Cqa-YMkZ.js";import{t as I}from"./button-CXjFGJbj.js";import{$n as $e,At as L,Ct as et,Dt as tt,Jt as R,Ot as nt,St as z,Tt as rt,U as it,Yn as at,a as ot,at as B,bt as V,dr as st,er as ct,fr as lt,ft as ut,i as dt,it as ft,jt as pt,lr as mt,o as ht,ot as gt,rr as _t,s as vt,st as H,vt as U,wt as yt,xt as W,yt as G}from"./index-DDEtFVdr.js";import{n as bt}from"./TimeRangePicker-spgMK1lW.js";import{t as K}from"./FilterBar-BcbgCjju.js";import{t as xt}from"./AdvancedFilter-DtBAnHBl.js";import{t as St}from"./DataTableShell-D-TTxNiz.js";var Ct=u(`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`?x():n===`agent`?`${m()} - ${r}`:e}function Tt(){let e=F(P.me.getMe,{host:ut})?.role===`admin`,t=F(P.deliveryTiming.getDeliveryStatus,{}),n=N(P.deliveryTiming.startDeliveryRecord),r=N(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 items-start justify-between gap-4`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h3`,{className:`text-sm font-semibold`,children:ve()}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Ge()})]}),e?(0,J.jsx)(I,{variant:c?`destructive`:`default`,size:`sm`,disabled:o||t===void 0,onClick:()=>void l(),children:c?ge():ke()}):null]}),c?(0,J.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,J.jsx)(R,{variant:`secondary`,children:Ve()}),t?.startedAt?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:Pe({time:pt(t.startedAt)})}):null]}):null,(0,J.jsx)(`div`,{children:(0,J.jsx)(I,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?ze():Te()})}),i?(0,J.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=F(P.deliveryTiming.listDeliverySessions,{}),n=N(P.deliveryTiming.deleteDeliverySessions),[r,a]=(0,q.useState)(``),[o,c]=(0,q.useState)(`all`),[l,u]=(0,q.useState)(Y),[d,f]=(0,q.useState)(null),{from:p,to:m}=bt(l),h=l.to===`now`?1/0:m,_=r.trim()!==``||o!==`all`||l!==Y,v=()=>{a(``),c(`all`),u(Y)},b=(0,q.useMemo)(()=>{if(t===void 0)return;let e=r.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(o===`all`||(o===`active`?t.active:!t.active))&&t.startedAt>=p&&t.startedAt<=h).map(e=>({...e,_id:e.sessionId}))},[t,r,o,p,h]),x=e=>{let t=new Set((b??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),d!==null&&r.includes(d)&&f(null))};return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(K,{q:r,onQChange:a,searchPlaceholder:Ue(),timeRange:l,onTimeRangeChange:u,onReset:v,canReset:_,children:(0,J.jsxs)(U,{value:o,onValueChange:e=>c(e),children:[(0,J.jsx)(W,{size:`sm`,className:`w-36`,children:(0,J.jsx)(z,{})}),(0,J.jsxs)(G,{children:[(0,J.jsx)(V,{value:`all`,children:be()}),(0,J.jsx)(V,{value:`active`,children:i()}),(0,J.jsx)(V,{value:`stopped`,children:w()})]})]})}),(0,J.jsx)(St,{title:Me(),rows:b,emptyHint:s(),columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(I,{variant:`ghost`,size:`icon`,"aria-label":d===e.sessionId?T():D(),onClick:()=>f(t=>t===e.sessionId?null:e.sessionId),children:d===e.sessionId?(0,J.jsx)(ct,{size:15,"aria-hidden":!0}):(0,J.jsx)($e,{size:15,"aria-hidden":!0})})},{header:A(),sort:e=>e.startedAt,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:L(e.startedAt)})},{header:O(),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:L(e.stoppedAt)})},{header:k(),sort:e=>e.count,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:X(e.count)})},{header:y(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:Le(),sort:e=>e.active,cell:e=>e.active?(0,J.jsx)(R,{variant:`secondary`,children:i()}):(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:w()})}],rowActions:e?e=>[{label:g(),variant:`destructive`,onSelect:()=>x([e.sessionId])}]:void 0,bulkActions:e?[{label:g(),variant:`destructive`,onSelect:e=>x(e)}]:void 0,isExpanded:e=>e.sessionId===d,renderExpanded:e=>(0,J.jsx)(Dt,{sessionId:e.sessionId})})]})}function Dt({sessionId:e}){let t=F(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:E()});if(e.count===0||e.segments===null)return(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:j()});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,` `,ie()]}),(0,J.jsxs)(I,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,J.jsx)(mt,{size:13,"aria-hidden":!0}):(0,J.jsx)(_t,{size:13,"aria-hidden":!0}),t?qe():ae()]})]}),(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:te()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:ee()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:S()})]})}),(0,J.jsxs)(`tbody`,{children:[i(Ee(),r.bridge),i(a(),r.A),i(De(),r.C)]})]}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:C()}),e.truncated?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:d()}):null,(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:l()})]})}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:oe()},{value:`principalType`,label:Je()},{value:`direction`,label:`direction`},{value:`roleKey`,label:c()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function Ft(){let e=lt({from:`/settings/traces`}),t=st({from:`/settings/traces`}),n=e.limit,i=e.kind,a=e.statusClass??Q,o=e.principalType??Q,s=e.direction??Q,c=e.roleKey??Q,l=e.q??``,u=e.correlationId,d=dt(e.from,e.to),m=(0,q.useMemo)(()=>vt(e.adv),[e.adv]),{from:g,to:y}=bt(d),[x,S]=(0,q.useState)(null),[ee,C]=(0,q.useState)(null),te=e=>void t({search:t=>({...t,limit:e})}),w=e=>void t({search:t=>({...t,kind:e})}),re=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),ie=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),ae=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),oe=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),T=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),E=e=>void t({search:t=>({...t,...ht(e)})}),D=e=>void t({search:t=>({...t,adv:ot(e)}),replace:!0}),O=F(P.observability.listEvents,{limit:n}),k=F(P.observability.listEvents,{limit:n,kind:i===Z?void 0:i,...u?{correlationId:u}:{},filter:{q:l||void 0,from:g,to:y,statusClass:a===Q?void 0:a,principalType:o===Q?void 0:o,direction:s===Q?void 0:s,roleKey:c===Q?void 0:c,advanced:m.length>0?m:void 0}}),A=(0,q.useMemo)(()=>{let e=new Set;for(let t of O??[])e.add(t.kind);return[...e].sort()},[O]),j=(0,q.useMemo)(()=>{let e=new Set;for(let t of O??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[O]),ge=l!==``||a!==Q||o!==Q||s!==Q||c!==Q||m.length>0||d.kind!==`relative`||d.from!==Nt.from;function ve(){t({search:{limit:100,kind:`all`},replace:!0})}let be=x?O?.filter(e=>e.correlationId===x):k,Te=e.section,Ee=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,J.jsxs)(ft,{value:Te,onValueChange:e=>Ee(e),children:[(0,J.jsxs)(gt,{className:`w-full`,children:[(0,J.jsxs)(H,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(at,{size:13,"aria-hidden":!0}),_()]}),(0,J.jsxs)(H,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(Ct,{size:13,"aria-hidden":!0}),f()]})]}),(0,J.jsx)(B,{value:`latency`,children:(0,J.jsx)(Tt,{})}),(0,J.jsxs)(B,{value:`events`,className:`flex flex-col gap-3`,children:[(0,J.jsxs)(`p`,{className:`oc-admin__hint`,children:[Ye(),(0,J.jsx)(`strong`,{children:he()}),Xe(),` `,(0,J.jsx)(`span`,{className:`oc-filter__window`,children:Ke()})]}),(0,J.jsxs)(K,{q:l,onQChange:re,searchPlaceholder:pe(),timeRange:d,onTimeRangeChange:E,onReset:ve,canReset:ge,children:[(0,J.jsxs)(U,{value:a,onValueChange:ie,children:[(0,J.jsx)(W,{size:`sm`,className:`w-32`,children:(0,J.jsx)(z,{placeholder:Se()})}),(0,J.jsxs)(G,{children:[(0,J.jsx)(V,{value:Q,children:Ce()}),At.map(e=>(0,J.jsx)(V,{value:e,children:e},e))]})]}),(0,J.jsxs)(U,{value:o,onValueChange:ae,children:[(0,J.jsx)(W,{size:`sm`,className:`w-32`,children:(0,J.jsx)(z,{placeholder:Ae()})}),(0,J.jsxs)(G,{children:[(0,J.jsx)(V,{value:Q,children:Fe()}),jt.map(e=>(0,J.jsx)(V,{value:e,children:e},e))]})]}),(0,J.jsxs)(U,{value:s,onValueChange:oe,children:[(0,J.jsx)(W,{size:`sm`,className:`w-32`,children:(0,J.jsx)(z,{placeholder:xe()})}),(0,J.jsxs)(G,{children:[(0,J.jsx)(V,{value:Q,children:_e()}),Mt.map(e=>(0,J.jsx)(V,{value:e,children:e},e))]})]}),(0,J.jsxs)(U,{value:c,onValueChange:T,children:[(0,J.jsx)(W,{size:`sm`,className:`w-36`,children:(0,J.jsx)(z,{placeholder:We()})}),(0,J.jsxs)(G,{children:[(0,J.jsx)(V,{value:Q,children:Oe()}),j.map(e=>(0,J.jsx)(V,{value:e,children:e},e))]})]}),(0,J.jsx)(`input`,{list:`oc-trace-kinds`,className:`oc-input oc-input--sm w-44`,value:i===Z?``:i,placeholder:M(),"aria-label":M(),onChange:e=>{let t=e.target.value.trim();w(t===``?Z:t)}}),(0,J.jsx)(`datalist`,{id:`oc-trace-kinds`,children:A.map(e=>(0,J.jsx)(`option`,{value:e},e))}),(0,J.jsxs)(U,{value:String(n),onValueChange:e=>te(Number(e)),children:[(0,J.jsx)(W,{size:`sm`,className:`w-28`,children:(0,J.jsx)(z,{})}),(0,J.jsx)(G,{children:kt.map(e=>(0,J.jsx)(V,{value:String(e),children:Be({count:e})},e))})]})]}),(0,J.jsx)(xt,{fields:Pt,seed:m,onChange:D}),x?(0,J.jsx)(`div`,{className:`oc-traces__followline`,children:(0,J.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>S(null),title:Ne(),children:[(0,J.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[me(),(0,J.jsx)(`code`,{children:$(x)})]}),(0,J.jsx)(Qe,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,J.jsx)(`span`,{className:`sr-only`,children:we()})]})}):null,(0,J.jsx)(St,{title:Re(),rows:be,emptyHint:x?je():He(),columns:[{header:ye(),sort:e=>e.at,cell:e=>(0,J.jsx)(`span`,{className:`oc-traces__time`,children:L(e.at)})},{header:r(),sort:e=>e.kind,cell:e=>(0,J.jsx)(R,{variant:`secondary`,children:e.kind})},{header:ne(),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":fe(),children:`✓`})}},{header:ue(),sort:e=>e.direction,cell:e=>e.direction?(0,J.jsx)(R,{variant:`outline`,children:e.direction}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:de(),sort:e=>e.principalType,cell:e=>(0,J.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,J.jsx)(R,{variant:`outline`,children:e.principalType}),e.principalId?(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:v(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,J.jsx)(R,{variant:`secondary`,children:e.roleKey}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Ie(),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:b(),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:p(),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:se(),onClick:()=>S(e.correlationId),children:$(e.correlationId)}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:h(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,J.jsx)(I,{variant:`outline`,size:`sm`,onClick:()=>C(e),children:ce()}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,J.jsx)(Rt,{row:ee,onClose:()=>C(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)(et,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,J.jsxs)(yt,{className:`max-w-lg`,children:[(0,J.jsxs)(tt,{children:[(0,J.jsxs)(nt,{className:`oc-traces__meta-title`,children:[o(),` `,(0,J.jsx)(`code`,{children:e.kind}),(0,J.jsx)(R,{variant:`outline`,children:Ze()})]}),(0,J.jsx)(rt,{children:re()})]}),(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{$F as r,$k as i,EF as a,GF as o,JF as s,Jk as c,KF as l,QF as u,Qk as d,XF as f,Xk as p,YF as m,Yk as h,ZF as ee,Zk as g,_I as _,_b as v,aA as y,aI as te,cI as ne,dI as re,eA as b,eI as ie,fI as ae,gI as oe,gb as x,hI as se,hb as S,iA as C,iI as ce,lI as le,lX as w,mI as ue,nA as T,nI as de,oI as fe,pI as pe,qF as me,qk as E,rA as D,rI as he,sI as ge,t as O,tA as k,tI as _e,uI as ve,uX as A,vI as j,yI as M}from"./api-B8SYK4Qy.js";import{t as N}from"./button-CXjFGJbj.js";import{Ct as P,Dt as F,J as I,Jt as L,Mt as R,Ot as ye,Pn as z,St as B,Tt as be,Yt as V,an as xe,bt as H,c as U,ct as Se,dr as Ce,en as we,fr as Te,ft as Ee,jn as W,l as De,lt as Oe,nn as ke,rn as Ae,tn as je,u as G,vt as K,wt as Me,xt as q,yt as J}from"./index-DDEtFVdr.js";import{t as Ne}from"./FilterBar-BcbgCjju.js";import{t as Pe}from"./DataTableShell-D-TTxNiz.js";import{t as Fe}from"./DetailChips-BG1A-DBR.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}))],f=new Map;for(let e of u){let t=f.get(e.instanceName)??[];t.push(e),f.set(e.instanceName,t)}return(0,X.jsx)(P,{open:n,onOpenChange:r,children:(0,X.jsxs)(Me,{className:`oc-access`,children:[(0,X.jsxs)(F,{children:[(0,X.jsx)(ye,{children:y({user:t})}),(0,X.jsx)(be,{children:C()})]}),i?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?D():T()}):null,(0,X.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:k()}):u.length===0?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:d()}):[...f.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 s=w(O.agents.assignAgent),l=w(O.agents.removeAgent),u=w(O.agents.setDefaultAgent),d=V();if(!e)return null;async function f(n,r){try{r?await l({profileId:e,instanceName:t,agentId:n}):await s({profileId:e,instanceName:t,agentId:n})}catch(e){d.error(b(),I(e))}}async function m(n){try{await u({profileId:e,instanceName:t,agentId:n})}catch(e){d.error(i(),I(e))}}return(0,X.jsxs)(`div`,{className:`oc-access__group`,children:[(0,X.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,X.jsx)(z,{size:13,"aria-hidden":!0}),(0,X.jsx)(`span`,{children:t}),(0,X.jsx)(L,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=a.has(n),i=o===n,s=e.state===`deleted`,l=!e.enabled;return(0,X.jsxs)(`div`,{className:`oc-access__row${l?` is-disabled`:``}`,children:[(0,X.jsx)(R,{checked:r,disabled:(s||l)&&!r,onCheckedChange:()=>void f(e.agentId,r),"aria-label":g({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,s?(0,X.jsx)(L,{variant:`outline`,className:`oc-access__gone`,children:p()}):null,e.outOfPool?(0,X.jsx)(L,{variant:`outline`,className:`oc-access__gone`,children:h()}):null,r?i?(0,X.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":c(),title:c(),children:(0,X.jsx)(W,{size:14,fill:`currentColor`})}):(0,X.jsx)(N,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":E(),title:E(),disabled:l,onClick:()=>void m(e.agentId),children:(0,X.jsx)(W,{size:14})}):null]},e.agentId)})]})}var Q=`__all__`;function $(e){switch(e){case`pending`:return S();case`user`:return x();case`admin`:return v();default:return e}}function Le({granted:e,onToggle:t}){let n=new Set(e),r=U.filter(e=>n.has(G[e])).length;return(0,X.jsxs)(we,{children:[(0,X.jsx)(xe,{asChild:!0,children:(0,X.jsx)(N,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?M():j({count:r})})}),(0,X.jsxs)(je,{align:`start`,className:`w-52`,children:[(0,X.jsx)(Ae,{children:_()}),U.map(e=>{let r=G[e];return(0,X.jsxs)(ke,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,X.jsx)(R,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,X.jsx)(`span`,{children:De[e]()})]},e)})]})]})}function Re(){let e=Te({from:`/settings/users`}),t=Ce({from:`/settings/users`}),n=e.q??``,i=e.role??Q,c=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),d=e=>void t({search:t=>({...t,role:e===Q?void 0:e})}),p=A(O.admin.listUsers,{filter:{q:n||void 0,role:i===Q?void 0:i},withAgents:!0}),h=A(O.me.getMe,{host:Ee}),g=w(O.admin.setRole),_=w(O.admin.setUserPermissions),v=w(O.admin.startImpersonation),y=w(O.admin.deleteUser),b=w(O.admin.setUserName),x=Se(),S=Oe(),C=V(),[T,E]=(0,Y.useState)(null),D=(0,Y.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of p??[])e.add(t.role);return[...e]},[p]),k=n!==``||i!==Q;function j(){t({search:{},replace:!0})}async function M(e){try{await g(e)}catch(e){C.error(oe(),e)}}async function N(e){try{await _(e)}catch(e){C.error(se(),e)}}async function P(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await x({title:ne(),description:ge({user:t}),confirmWord:fe(),confirmLabel:te(),destructive:!0}))try{await y({profileId:e._id}),C.success(he({user:t}))}catch(e){C.error(ce(),e)}}async function F(e){let t=e.email||e.name||e.userId.slice(0,8),n=await S({title:_e(),label:ie({user:t}),placeholder:r(),defaultValue:e.name??``,confirmLabel:a()});if(n!==null)try{await b({profileId:e._id,name:n}),C.success(u())}catch(e){C.error(ee(),e)}}return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Ne,{q:n,onQChange:c,searchPlaceholder:ue(),onReset:j,canReset:k,children:(0,X.jsxs)(K,{value:i,onValueChange:d,children:[(0,X.jsx)(q,{size:`sm`,className:`w-36`,children:(0,X.jsx)(B,{})}),(0,X.jsxs)(J,{children:[(0,X.jsx)(H,{value:Q,children:pe()}),D.map(e=>(0,X.jsx)(H,{value:e,children:$(e)},e))]})]})}),(0,X.jsx)(Pe,{title:ae(),rows:p,emptyHint:re(),rowActions:e=>{let t=[{label:o(),onSelect:()=>E({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:de(),onSelect:()=>void F(e)}];return e.userId!==h?.userId&&t.push({label:ve(),onSelect:()=>void v({profileId:e._id})},{label:le(),variant:`destructive`,onSelect:()=>void P(e)}),t},columns:[{header:f(),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:m(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,X.jsxs)(K,{value:e.role,onValueChange:t=>void M({profileId:e._id,role:t}),children:[(0,X.jsx)(q,{size:`sm`,className:`w-28`,children:(0,X.jsx)(B,{})}),(0,X.jsxs)(J,{children:[(0,X.jsx)(H,{value:`pending`,children:$(`pending`)}),(0,X.jsx)(H,{value:`user`,children:$(`user`)}),(0,X.jsx)(H,{value:`admin`,children:$(`admin`)})]})]})},{header:s(),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:me()}):(0,X.jsx)(Le,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),N({profileId:e._id,permissions:[...n]})}})},{header:l(),cell:e=>(0,X.jsx)(Fe,{icon:(0,X.jsx)(z,{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:T?.profileId??null,userLabel:T?.label??``,open:T!==null,onOpenChange:e=>{e||E(null)}})]})}export{Re as UsersTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{E as e}from"./api-B8SYK4Qy.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};
|