@lacneu/atrium 0.101.2 → 0.101.4
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-JmFp20Kp.js +1 -0
- package/dist/assets/AdminSettings-B8n1yLsD.js +1 -0
- package/dist/assets/AdvancedFilter-Bb66m5kb.js +1 -0
- package/dist/assets/AgentFilesTab-C3CUT4Ep.js +3 -0
- package/dist/assets/AnomaliesTab-BQ2Bu98W.js +1 -0
- package/dist/assets/AuditTab-BV-XydO_.js +1 -0
- package/dist/assets/BridgeTab-rIDUCrXq.js +1 -0
- package/dist/assets/ChatDefaultsTab-D0d9yEow.js +1 -0
- package/dist/assets/ConfirmDialog-BXcki0Ee.js +1 -0
- package/dist/assets/DataTableShell-DRFFBx_j.js +1 -0
- package/dist/assets/DeletedChatsTab-COYSFkNf.js +1 -0
- package/dist/assets/DetailChips-Cv1sxdhU.js +1 -0
- package/dist/assets/EntitySheet-B2B48bss.js +1 -0
- package/dist/assets/FeedbacksTab-6URuFdfg.js +1 -0
- package/dist/assets/FieldLabel-DkgrHevY.js +1 -0
- package/dist/assets/FilesTab-esMtHJXt.js +1 -0
- package/dist/assets/FilterBar-DTVwlDpF.js +1 -0
- package/dist/assets/GroupsTab-Io16XZHz.js +1 -0
- package/dist/assets/InstancesTab-BlSeuPrH.js +1 -0
- package/dist/assets/IntegrationsTab-DMY6VTUC.js +1 -0
- package/dist/assets/KnobRow-BsOT2O6U.js +1 -0
- package/dist/assets/KpiTab-KPPcgUxA.js +1 -0
- package/dist/assets/PreferencesTab-DJ9p401L.js +1 -0
- package/dist/assets/ProjectPage-BxEF71jN.js +1 -0
- package/dist/assets/PromptInjectionsTab-CvFC141N.js +4 -0
- package/dist/assets/RolesTab-DU0g4d-R.js +1 -0
- package/dist/assets/ScheduledTab-B6gWc0HN.js +1 -0
- package/dist/assets/ServiceAccountsTab-Dmb_LH0V.js +1 -0
- package/dist/assets/SubAgentReportsTab-D9rclslo.js +1 -0
- package/dist/assets/ThemeShowroom-N4qzUtlq.js +1 -0
- package/dist/assets/TimeRangePicker-D3PJq1H8.js +1 -0
- package/dist/assets/TimezoneCombobox-CPTpWNQm.js +1 -0
- package/dist/assets/TracesTab-DiAkOmei.js +1 -0
- package/dist/assets/TrashTab-BMSJ7ANC.js +1 -0
- package/dist/assets/UsersTab-BQaLsUCK.js +1 -0
- package/dist/assets/VoiceTab-BSh-05Ze.js +1 -0
- package/dist/assets/alert-dialog-BoEv1f8g.js +7 -0
- package/dist/assets/api-DSJJn0d7.js +44 -0
- package/dist/assets/appHost-CH3EGcJw.js +1 -0
- package/dist/assets/badge-C4po8DQ1.js +1 -0
- package/dist/assets/{button-BbEZKLza.js → button-Dio0PVrp.js} +1 -1
- package/dist/assets/capabilities-BTqhMVxR.js +1 -0
- package/dist/assets/{card-Du7JykLJ.js → card-CerX9wDn.js} +1 -1
- package/dist/assets/check-DmQzfrws.js +1 -0
- package/dist/assets/checkbox-CsI4ggnp.js +1 -0
- package/dist/assets/chevron-left-DQ9FCoo_.js +1 -0
- package/dist/assets/chevron-right-C_b_y922.js +1 -0
- package/dist/assets/chevron-up-Dsqj2Oaj.js +1 -0
- package/dist/assets/chevrons-up-down-Pva00Np5.js +1 -0
- package/dist/assets/chunk-BO2N2NFS-UUurW2hP.js +131 -0
- package/dist/assets/{compatView-BDU79WFh.js → compatView--1YlftIc.js} +1 -1
- package/dist/assets/convexApi-CyScjgcq.js +1 -0
- package/dist/assets/copy-BaUCUMp2.js +1 -0
- package/dist/assets/cronDescribe-CAuRX7uW.js +1 -0
- package/dist/assets/deliveryRecorder-C7NQZrrH.js +2 -0
- package/dist/assets/dialog-BfrsWZiD.js +1 -0
- package/dist/assets/dispatchErrorInfo-Bb7JyJFO.js +1 -0
- package/dist/assets/dist-ChrIV8UV.js +1 -0
- package/dist/assets/{dist-l5bFdBkH.js → dist-CkbybbG7.js} +1 -1
- package/dist/assets/dist-ClkJChBn.js +1 -0
- package/dist/assets/dist-Cw3aN_jM.js +1 -0
- package/dist/assets/{dist-DkeZNw3H.js → dist-D-RIDSJc.js} +1 -1
- package/dist/assets/dist-D7doQlva.js +1 -0
- package/dist/assets/dist-DDCmobc1.js +1 -0
- package/dist/assets/download-DWgC7zCa.js +1 -0
- package/dist/assets/dropdown-menu-DHMOOlaP.js +1 -0
- package/dist/assets/eye-B-ipuYEd.js +1 -0
- package/dist/assets/fileMetaView-Ci5C4w9Q.js +1 -0
- package/dist/assets/format-DGKgJf2p.js +1 -0
- package/dist/assets/groupManageView-BMBqgRhV.js +1 -0
- package/dist/assets/highlighted-body-OFNGDK62-DlR3zOuW.js +1 -0
- package/dist/assets/index-C9C2o76d.css +1 -0
- package/dist/assets/index-QmAXy0ZO.js +158 -0
- package/dist/assets/input-BSpTsBA6.js +1 -0
- package/dist/assets/{list-Bhy47ogH.js → list-eSch39T9.js} +1 -1
- package/dist/assets/loader-circle-BNhIFGdg.js +1 -0
- package/dist/assets/lock-0lxfSnTE.js +1 -0
- package/dist/assets/mermaid-GHXKKRXX-NX_-ekHq.js +1 -0
- package/dist/assets/pdf-EQHMWEbX.js +54 -0
- package/dist/assets/pencil-aUWxuLhy.js +1 -0
- package/dist/assets/plus-Djbdyc2E.js +1 -0
- package/dist/assets/popover-DBaIbsBr.js +1 -0
- package/dist/assets/preload-helper-Czpn1I53.js +1 -0
- package/dist/assets/roleDescriptions-x3mUxTcX.js +1 -0
- package/dist/assets/rotate-ccw-BD-9XzMC.js +1 -0
- package/dist/assets/search-BK6bzZNi.js +1 -0
- package/dist/assets/searchSchemas-CS2ZgsHC.js +64 -0
- package/dist/assets/select-qM3ZfTHx.js +1 -0
- package/dist/assets/server-DLnWqkX-.js +1 -0
- package/dist/assets/speech-CrNma2Ue.js +1 -0
- package/dist/assets/star-CM6J2w_J.js +1 -0
- package/dist/assets/{table-BrECCZpB.js → table-D2SJC960.js} +1 -1
- package/dist/assets/tabs-mZfLmn2f.js +1 -0
- package/dist/assets/toast-xNFwDnUy.js +1 -0
- package/dist/assets/tooltip-v_AyOWn6.js +87 -0
- package/dist/assets/trash-2-B4WSfc7G.js +1 -0
- package/dist/assets/trashPage-WtAhGCt7.js +1 -0
- package/dist/assets/trashView-Ct0Xw-a9.js +1 -0
- package/dist/assets/triangle-alert-BkDa-x8g.js +1 -0
- package/dist/assets/usageView-C9Y6E0Zu.js +1 -0
- package/dist/assets/useChart-CKFEN42T.js +1 -0
- package/dist/assets/useFontScale-ByBFat3y.js +1 -0
- package/dist/assets/useNavigate-D3GIoxyW.js +1 -0
- package/dist/assets/useStartNewChat-BszDHUjD.js +5 -0
- package/dist/assets/useStartNewChat-DgQf_3y0.css +1 -0
- package/dist/assets/{use_paginated_query-C842MAhU.js → use_paginated_query-CQj09xXv.js} +1 -1
- package/dist/assets/users-BJqaWlH1.js +1 -0
- package/dist/assets/x-CK8d5DC1.js +1 -0
- package/dist/index.html +64 -9
- package/package.json +2 -2
- package/dist/assets/AccessTab-CgoSHwRq.js +0 -1
- package/dist/assets/AdvancedFilter-05ypZDMe.js +0 -1
- package/dist/assets/AgentFilesTab-DHL8Lt63.js +0 -3
- package/dist/assets/AnomaliesTab-QCxh3MK3.js +0 -1
- package/dist/assets/AuditTab-ZSJKAmT-.js +0 -1
- package/dist/assets/BridgeTab-BJEkCzek.js +0 -1
- package/dist/assets/ChatDefaultsTab-CMbP2VpD.js +0 -1
- package/dist/assets/DataTableShell-BUYroEsA.js +0 -1
- package/dist/assets/DeletedChatsTab-DP3F_9Es.js +0 -1
- package/dist/assets/DetailChips-Zknkp3Iu.js +0 -1
- package/dist/assets/FeedbacksTab-DVZNIYyH.js +0 -1
- package/dist/assets/FieldLabel-BP6EBGVI.js +0 -1
- package/dist/assets/FilesTab-COkrJcj5.js +0 -1
- package/dist/assets/FilterBar-BrdWP0oO.js +0 -1
- package/dist/assets/GroupsTab-Bq7pFctp.js +0 -1
- package/dist/assets/InstancesTab-DMYsJ9Eh.js +0 -1
- package/dist/assets/IntegrationsTab-BTLLarPk.js +0 -1
- package/dist/assets/KpiTab-CgNFLZ4K.js +0 -1
- package/dist/assets/PreferencesTab-BnBhz2n4.js +0 -1
- package/dist/assets/ProjectPage-CUsvZaGD.js +0 -1
- package/dist/assets/PromptInjectionsTab-B5AV0diL.js +0 -4
- package/dist/assets/RolesTab-yEfSrKGO.js +0 -1
- package/dist/assets/ScheduledTab-Bfsl1JLw.js +0 -1
- package/dist/assets/ServiceAccountsTab-c3kMpEBz.js +0 -1
- package/dist/assets/SubAgentReportsTab-CBEyyvZD.js +0 -1
- package/dist/assets/ThemeShowroom-D_KOxmeA.js +0 -1
- package/dist/assets/TimeRangePicker-BcvPW9JK.js +0 -1
- package/dist/assets/TimezoneCombobox-Djj8VaFK.js +0 -1
- package/dist/assets/TracesTab-BBUTNwmq.js +0 -1
- package/dist/assets/TrashTab-NsT89bEO.js +0 -1
- package/dist/assets/UsersTab-Dyf8X1a7.js +0 -1
- package/dist/assets/VoiceTab-CakW8mBV.js +0 -1
- package/dist/assets/api-Ca1H8N44.js +0 -44
- package/dist/assets/chevrons-up-down-DCwhEy5H.js +0 -1
- package/dist/assets/dispatchErrorInfo-CoXI4U8X.js +0 -1
- package/dist/assets/dist-Bfmsr8JO.js +0 -1
- package/dist/assets/dist-DuDAYkx5.js +0 -1
- package/dist/assets/highlighted-body-OFNGDK62-B8sH7UMy.js +0 -1
- package/dist/assets/index-DEccjMsV.css +0 -1
- package/dist/assets/index-Wii4FZxb.js +0 -447
- package/dist/assets/mermaid-GHXKKRXX-qTTPfzhk.js +0 -1
- package/dist/assets/pdf-Dxeqzi2x.js +0 -54
- package/dist/assets/roleDescriptions-DUp1v5cq.js +0 -1
- package/dist/assets/trashPage-svjv-CK6.js +0 -1
- package/dist/assets/x-BvlIg0Y4.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$D as r,$E as i,AD as a,BD as o,BX as s,CD as c,DD as l,E as u,ED as d,FD as f,ID as p,KC as m,KD as h,Ko as ee,LD as g,MD as _,OD as te,PD as v,QD as y,QE as ne,RD as b,SD as re,TD as x,UD as ie,WD as ae,XD as oe,XE as se,XX as S,YD as ce,YX as C,ZE as le,_D as ue,aD as w,aO as de,bD as fe,dD as pe,eD as me,fD as T,gD as he,gE as ge,iO as _e,jD as ve,kD as E,mD as D,nD as O,pD as ye,qo as be,rD as k,rO as xe,sD as Se,t as A,tD as j,vD as M,wD as Ce,xD as we,yD as Te}from"./api-DSJJn0d7.js";import{n as Ee,t as N}from"./useNavigate-D3GIoxyW.js";import{A as De,B as Oe,C as P,D as ke,E as F,F as Ae,G as je,H as Me,I,J as Ne,K as L,R as Pe,S as R,T as Fe,U as Ie,V as Le,W as z,_ as Re,a as B,f as V,h as ze,i as Be,j as Ve,m as He,n as H,o as U,p as W,r as Ue,s as G,t as We,u as Ge,w as Ke,x as qe,y as Je,z as Ye}from"./useStartNewChat-BszDHUjD.js";import{r as Xe}from"./dist-ClkJChBn.js";import{t as Ze}from"./chevron-right-C_b_y922.js";import{c as Qe,g as $e,i as et,n as tt,r as K,s as nt,t as rt}from"./dropdown-menu-DHMOOlaP.js";import{n as it,t as at}from"./eye-B-ipuYEd.js";import{t as ot}from"./list-eSch39T9.js";import{t as st}from"./pencil-aUWxuLhy.js";import{t as ct}from"./trash-2-B4WSfc7G.js";import{t as q}from"./button-Dio0PVrp.js";import{t as lt}from"./input-BSpTsBA6.js";import"./convexApi-CyScjgcq.js";import{r as ut}from"./toast-xNFwDnUy.js";import{n as dt,r as ft}from"./ConfirmDialog-BXcki0Ee.js";import{t as pt}from"./EntitySheet-B2B48bss.js";import{r as mt,t as ht}from"./trashView-Ct0Xw-a9.js";var gt=u(`columns-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),_t=u(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),vt=u(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),J=u(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),Y=t(e(),1),X=n();function yt({className:e}){return(0,X.jsx)(Qe,{asChild:!0,children:(0,X.jsx)(q,{variant:`ghost`,size:`icon-xs`,"aria-label":k(),className:e,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:(0,X.jsx)($e,{})})})}function Z({folderId:e,name:t,color:n,currentParentId:r,className:a,onOpen:s}){let c=C(A.projects.renameProject),l=C(A.projects.setProjectColor),u=C(A.projects.moveProject),d=C(A.projects.deleteProject),f=C(A.projects.createProject),p=dt(),m=mt(),h=ft(),[ee,g]=(0,Y.useState)(!1),[_,te]=(0,Y.useState)(t),[v,y]=(0,Y.useState)(!1),[b,re]=(0,Y.useState)(!1),x=S(A.projects.projectTreeCount,b?{projectId:e}:`skip`);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(rt,{onOpenChange:e=>e&&re(!0),children:[(0,X.jsx)(yt,{className:a}),(0,X.jsxs)(tt,{align:`end`,className:`w-48`,onClick:e=>e.stopPropagation(),children:[(0,X.jsxs)(K,{onSelect:()=>s(),children:[(0,X.jsx)(L,{}),` `,o()]}),(0,X.jsxs)(K,{onSelect:()=>{te(t),g(!0)},children:[(0,X.jsx)(st,{}),` `,O()]}),(0,X.jsxs)(K,{onSelect:()=>{requestAnimationFrame(async()=>{let t=await h({title:ve(),label:de(),placeholder:_e(),confirmLabel:xe()});t&&await f({name:t,parentId:e})})},children:[(0,X.jsx)(je,{}),` `,ve()]}),(0,X.jsxs)(K,{onSelect:()=>y(!0),children:[(0,X.jsx)(_t,{}),` `,ye()]}),(0,X.jsx)(et,{children:i()}),(0,X.jsxs)(`div`,{className:`oc-colorgrid`,onClick:e=>e.stopPropagation(),children:[(0,X.jsx)(`button`,{className:`oc-colorgrid__none`,onClick:()=>void l({projectId:e,color:null}),"aria-label":ne(),children:`✕`}),Be.map(t=>(0,X.jsx)(`button`,{className:`oc-colorgrid__dot`+(n===t.value?` is-selected`:``),style:{background:t.hue},"aria-label":t.value,onClick:()=>void l({projectId:e,color:t.value})},t.value))]}),(0,X.jsx)(nt,{}),(0,X.jsxs)(K,{variant:`destructive`,onSelect:()=>{requestAnimationFrame(async()=>{let n=x?.folders??0,r=x?.chats??0;await p({title:ie({name:t}),description:ht({folders:n,chats:r,days:m}),confirmWord:w(),confirmLabel:ae(),destructive:!0})&&await d({projectId:e})})},children:[(0,X.jsx)(ct,{}),` `,w()]})]})]}),(0,X.jsx)(pt,{open:ee,onOpenChange:g,title:ce(),canSubmit:_.trim().length>0,onSubmit:async()=>{await c({projectId:e,name:_.trim()}),g(!1)},submitLabel:O(),children:(0,X.jsx)(lt,{value:_,onChange:e=>te(e.target.value),autoFocus:!0})}),v?(0,X.jsx)(Ue,{open:v,onOpenChange:y,title:pe(),movingFolderId:e,currentId:r,onPick:t=>void u({projectId:e,parentId:t})}):null]})}function Q({chat:e,currentFolderId:t,className:n}){let r=C(A.chats.pinChat),i=C(A.chats.deleteChat),a=C(A.chats.renameChat),o=C(A.chats.setChatSidebar),s=C(A.chats.moveChatToProject),c=dt(),l=mt(),[u,d]=(0,Y.useState)(!1),[f,p]=(0,Y.useState)(e.title??``),[m,h]=(0,Y.useState)(!1);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(rt,{children:[(0,X.jsx)(yt,{className:n}),(0,X.jsxs)(tt,{align:`end`,className:`w-52`,onClick:e=>e.stopPropagation(),children:[(0,X.jsxs)(K,{onSelect:()=>{p(e.title??``),d(!0)},children:[(0,X.jsx)(st,{}),` `,O()]}),(0,X.jsxs)(K,{onSelect:()=>void r({chatId:e._id,pinned:!e.pinned}),children:[e.pinned?(0,X.jsx)(Ye,{}):(0,X.jsx)(Oe,{}),e.pinned?j():me()]}),(0,X.jsxs)(K,{onSelect:()=>h(!0),children:[(0,X.jsx)(_t,{}),` `,D()]}),e.pinned&&e.inSidebar?null:(0,X.jsxs)(K,{onSelect:()=>void o({chatId:e._id,hidden:e.inSidebar}),children:[e.inSidebar?(0,X.jsx)(Le,{}):(0,X.jsx)(J,{}),e.inSidebar?g():b()]}),(0,X.jsx)(nt,{}),(0,X.jsxs)(K,{variant:`destructive`,onSelect:()=>{requestAnimationFrame(async()=>{await c({title:le(),description:se({days:l}),confirmLabel:w(),destructive:!0})&&await i({chatId:e._id})})},children:[(0,X.jsx)(ct,{}),` `,w()]})]})]}),(0,X.jsx)(pt,{open:u,onOpenChange:d,title:ge(),canSubmit:f.trim().length>0,onSubmit:async()=>{await a({chatId:e._id,title:f.trim()}),d(!1)},submitLabel:O(),children:(0,X.jsx)(lt,{value:f,onChange:e=>p(e.target.value),autoFocus:!0})}),m?(0,X.jsx)(Ue,{open:m,onOpenChange:h,title:T(),currentId:t,onPick:t=>void s({chatId:e._id,projectId:t})}):null]})}function bt(e,t){let n=t.trim().toLowerCase();return n===``?e:e.filter(e=>(e.title??``).toLowerCase().includes(n))}function xt(e,t,n,r,i){let a=e.map(t),o=a.indexOf(i);if(o<0)return null;let s=a.indexOf(r);if(s>=0){let t=[...e],[r]=t.splice(s,1);t.splice(o,0,r);let i=t[o-1],a=t[o+1];return{prevKey:i===void 0?null:n(i),nextKey:a===void 0?null:n(a)}}let c=e[o-1];return{prevKey:c===void 0?null:n(c),nextKey:n(e[o])}}function St(e,t){let n=new Map(t.map(e=>[e.chatId,e.lastSeenAt])),r=new Set;for(let t of e){let e=n.get(t._id);e!==void 0&&t.lastAssistantAt!==null&&t.lastAssistantAt>e&&r.add(t._id)}return r}var Ct=`oc.projpage.view`;function wt(){let e=localStorage.getItem(Ct);return e===`cards`||e===`list`?e:`columns`}var $=e=>`into:${e}`,Tt=e=>`col:${e??`null`}`,Et=e=>`crumb:${e}`;function Dt(e){if(e.startsWith(`into:`))return e.slice(5);if(e.startsWith(`crumb:`))return e.slice(6);if(e.startsWith(`col:`)){let t=e.slice(4);return t===`null`?null:t}}function Ot(){let{projectId:e}=Ne({from:`/project/$projectId`}),t=N(),n=S(A.projects.projectPage,{projectId:e});return(0,X.jsx)(`div`,{className:`oc-projpage`,children:n===void 0?(0,X.jsx)(`p`,{className:`oc-projpage__hint`,children:s()}):n===null?(0,X.jsxs)(`div`,{className:`oc-projpage__notfound`,children:[(0,X.jsx)(`h2`,{children:Te()}),(0,X.jsx)(`p`,{className:`oc-projpage__hint`,children:M()}),(0,X.jsx)(q,{variant:`outline`,onClick:()=>void t({to:`/`}),children:ue()})]}):(0,X.jsx)(kt,{page:n})})}function kt({page:e}){let t=N(),n=dt(),a=mt(),o=ft(),s=ut(),u=C(A.projects.renameProject),h=C(A.projects.setProjectColor),g=C(A.projects.deleteProject),y=C(A.projects.createProject),b=C(A.projects.moveProject),x=C(A.projects.setProjectSidebar),se=C(A.chats.moveChatToProject),le=C(A.chats.reorderChat),ue=C(A.projects.reorderProject),me=S(A.projects.projectTreeCount,{projectId:e.project._id}),[T,ge]=(0,Y.useState)(wt),E=e=>{localStorage.setItem(Ct,e),ge(e)},D=S(A.projects.folderColumns,T===`columns`?{projectId:e.project._id}:`skip`),k=S(A.projects.projectTreeList,T===`list`?{projectId:e.project._id}:`skip`),{c:j}=Ee({from:`/project/$projectId`}),M=S(A.projects.listProjects,{}),Ce=S(A.chatReads.myBusyChats,{}),Te=(0,Y.useMemo)(()=>new Set(Ce??[]),[Ce]),{byChat:Oe}=Pe(Ce??null),P=S(A.chatReads.myChatReads,{}),F=(0,Y.useMemo)(()=>St(e.chats,P??[]),[e.chats,P]),{startNewChat:I,picker:Ne}=We(e=>void t({to:`/chat/$chatId`,params:{chatId:e}})),[L,Le]=(0,Y.useState)(``),[B,V]=(0,Y.useState)(!1),[H,Ye]=(0,Y.useState)(e.project.name),[Xe,Ze]=(0,Y.useState)(!1),[J,yt]=(0,Y.useState)(``);(0,Y.useEffect)(()=>{let e=setTimeout(()=>yt(L.trim()),180);return()=>clearTimeout(e)},[L]);let Z=S(A.search.searchConversations,J.length>=2?{query:J,projectId:e.project._id}:`skip`),Q=Fe(Ke(Re,{activationConstraint:{distance:4}}),Ke(Je,{activationConstraint:{delay:250,tolerance:8}})),$=(0,Y.useRef)(!1),Tt=()=>{$.current=!0,setTimeout(()=>{$.current=!1},0)},[Et,Ot]=(0,Y.useState)(null),kt=t=>{if(t.startsWith(`chat:`)){let n=t.slice(5),i=e.chats.find(e=>e._id===n),a=D?.columns.flatMap(e=>e.chats).find(e=>e._id===n);return{kind:`chat`,label:(i??a)?.title||r()}}if(t.startsWith(`folder:`)){let e=t.slice(7);return{kind:`folder`,label:(M??[]).find(t=>t._id===e)?.name??``}}return null},Mt=e=>Ot(kt(String(e.active.id))),Pt=(0,Y.useCallback)(e=>{let t=String(e.active.id).startsWith(`folder:`),n=t=>({...e,droppableContainers:e.droppableContainers.filter(e=>String(e.id).startsWith(t))}),r=R(n(`into:`));if(r.length>0){if(!t)return r;let n=r[0],i=e.droppableRects.get(n.id),a=e.pointerCoordinates?.y;if(i&&a!=null){let e=i.height*.3;if(a>i.top+e&&a<i.top+i.height-e)return r}}let i=R(n(t?`folder:`:`chat:`));if(i.length>0)return i;let a=R(n(`crumb:`));if(a.length>0)return a;let o=R(n(`col:`));return o.length>0?o:qe(n(t?`folder:`:`chat:`))},[]),It=t=>{if(T===`columns`){for(let e of D?.columns??[])if(e.chats.some(e=>e._id===t))return{list:e.chats,folderId:e.folderId};return null}if(T===`list`){let e=k?.chats.find(e=>e._id===t);return e?{list:k.chats.filter(t=>t.folderId===e.folderId),folderId:e.folderId}:null}return e.chats.some(e=>e._id===t)?{list:e.chats,folderId:e.project._id}:null},Lt=t=>{if(T===`columns`){for(let e of D?.columns??[])if(e.folders.some(e=>e._id===t))return{list:e.folders,parentId:e.folderId};return null}if(T===`list`){let e=k?.folders.find(e=>e._id===t);if(!e||!k)return null;let n=e.parentId??k.rootId;return{list:Ve(k.folders,e.parentId),parentId:n}}return e.children.some(e=>e._id===t)?{list:e.children,parentId:e.project._id}:null},zt=async e=>{Ot(null),Tt();let{active:t,over:n}=e;if(!n)return;let r=String(n.id),i=String(t.id),a=i.startsWith(`chat:`);try{let e=Dt(r);if(e!==void 0){if(a){let t=i.slice(5);await se({chatId:t,projectId:e})}else{let t=i.slice(7);if(t===e)return;if(!De(M??[],t,e)){s.error(_());return}await b({projectId:t,parentId:e})}return}if(a&&r.startsWith(`chat:`)){let e=i.slice(5),t=r.slice(5);if(e===t)return;let n=It(t);if(!n)return;n.list.some(t=>t._id===e)||await se({chatId:e,projectId:n.folderId});let a=xt(n.list,e=>e._id,e=>e.sortKey,e,t);a&&await le({chatId:e,...a});return}if(!a&&r.startsWith(`folder:`)){let e=i.slice(7),t=r.slice(7);if(e===t)return;let n=Lt(t);if(!n)return;if(!n.list.some(t=>t._id===e)){if(!De(M??[],e,n.parentId)){s.error(_());return}await b({projectId:e,parentId:n.parentId})}let a=xt(n.list,e=>e._id,e=>e.sortKey,e,t);a&&await ue({projectId:e,...a});return}}catch{s.error(_())}},[,Bt]=(0,Y.useState)(0);(0,Y.useEffect)(()=>{let e=window.setInterval(()=>Bt(e=>e+1),6e4);return()=>window.clearInterval(e)},[]);let Vt=Date.now(),Ht=U(e.project),Ut=bt(e.chats,L),Wt=e.breadcrumb.slice(0,-1),Gt=e=>()=>{$.current||e()};return(0,X.jsx)(Ae.Provider,{value:Oe,children:(0,X.jsxs)(He,{sensors:Q,collisionDetection:Pt,onDragStart:Mt,onDragEnd:zt,children:[(0,X.jsxs)(`div`,{className:`oc-projpage__body`,style:{"--proj-hue":Ht},children:[(0,X.jsxs)(`nav`,{className:`oc-projpage__crumbs`,"aria-label":he(),children:[Wt.map(e=>(0,X.jsxs)(`span`,{className:`oc-projpage__crumb`,children:[(0,X.jsx)(At,{folderId:e._id,children:(0,X.jsx)(`button`,{type:`button`,className:`oc-projpage__crumblink`,onClick:Gt(()=>void t({to:`/project/$projectId`,params:{projectId:e._id}})),children:e.name})}),(0,X.jsx)(`span`,{className:`oc-projpage__crumbsep`,"aria-hidden":!0,children:`›`})]},e._id)),(0,X.jsx)(`span`,{className:`oc-projpage__crumbcur`,children:e.project.name})]}),(0,X.jsxs)(`header`,{className:`oc-projpage__head`,children:[(0,X.jsx)(`span`,{className:`oc-projpage__dot`,"aria-hidden":!0}),(0,X.jsx)(`h1`,{className:`oc-projpage__title`,children:e.project.name}),e.project.sidebarHidden?(0,X.jsxs)(q,{variant:`ghost`,size:`sm`,className:`oc-projpage__hiddenbadge`,title:be(),onClick:()=>{x({projectId:e.project._id,hidden:!1})},children:[(0,X.jsx)(it,{"aria-hidden":!0}),(0,X.jsx)(`span`,{children:ee()}),(0,X.jsx)(at,{"aria-hidden":!0})]}):null,(0,X.jsxs)(`div`,{className:`oc-projpage__actions`,children:[(0,X.jsxs)(`div`,{className:`oc-projpage__viewtoggle`,role:`group`,"aria-label":p(),children:[(0,X.jsx)(q,{variant:T===`cards`?`secondary`:`ghost`,size:`icon-sm`,"aria-label":p(),title:p(),"aria-pressed":T===`cards`,onClick:()=>E(`cards`),children:(0,X.jsx)(vt,{})}),(0,X.jsx)(q,{variant:T===`columns`?`secondary`:`ghost`,size:`icon-sm`,"aria-label":f(),title:f(),"aria-pressed":T===`columns`,onClick:()=>E(`columns`),children:(0,X.jsx)(gt,{})}),(0,X.jsx)(q,{variant:T===`list`?`secondary`:`ghost`,size:`icon-sm`,"aria-label":v(),title:v(),"aria-pressed":T===`list`,onClick:()=>E(`list`),children:(0,X.jsx)(ot,{})})]}),(0,X.jsxs)(q,{variant:`outline`,size:`sm`,onClick:()=>void I({projectId:e.project._id}),children:[(0,X.jsx)(Ie,{}),d()]}),(0,X.jsxs)(q,{variant:`outline`,size:`sm`,onClick:async()=>{let t=await o({title:ve(),label:de(),placeholder:_e(),confirmLabel:xe()});t&&await y({name:t,parentId:e.project._id})},children:[(0,X.jsx)(je,{}),ve()]}),(0,X.jsxs)(rt,{children:[(0,X.jsx)(Qe,{asChild:!0,children:(0,X.jsx)(q,{variant:`ghost`,size:`icon-sm`,"aria-label":oe(),children:(0,X.jsx)($e,{})})}),(0,X.jsxs)(tt,{align:`end`,className:`w-48`,children:[(0,X.jsxs)(K,{onSelect:()=>{Ye(e.project.name),V(!0)},children:[(0,X.jsx)(st,{}),` `,O()]}),(0,X.jsxs)(K,{onSelect:()=>Ze(!0),children:[(0,X.jsx)(_t,{}),` `,ye()]}),(0,X.jsx)(et,{children:i()}),(0,X.jsxs)(`div`,{className:`oc-colorgrid`,children:[(0,X.jsx)(`button`,{className:`oc-colorgrid__none`,onClick:()=>void h({projectId:e.project._id,color:null}),"aria-label":ne(),children:`✕`}),Be.map(t=>(0,X.jsx)(`button`,{className:`oc-colorgrid__dot`+(e.project.color===t.value?` is-selected`:``),style:{background:t.hue},"aria-label":t.value,onClick:()=>void h({projectId:e.project._id,color:t.value})},t.value))]}),(0,X.jsx)(nt,{}),(0,X.jsxs)(K,{variant:`destructive`,onSelect:()=>{let r=e.project.parentId;requestAnimationFrame(async()=>{let i=me?.folders??0,o=me?.chats??0;await n({title:ie({name:e.project.name}),description:ht({folders:i,chats:o,days:a}),confirmWord:w(),confirmLabel:ae(),destructive:!0})&&(await g({projectId:e.project._id}),t(r===null?{to:`/`}:{to:`/project/$projectId`,params:{projectId:r}}))})},children:[(0,X.jsx)(ct,{}),` `,w()]})]})]})]})]}),T===`columns`?(0,X.jsx)(Rt,{data:D,currentId:e.project._id,busyIds:Te,suppressClick:$,locateChatId:j??null}):T===`list`?(0,X.jsx)(Ft,{data:k,busyIds:Te,suppressClick:$,locateChatId:j??null}):(0,X.jsxs)(X.Fragment,{children:[e.children.length>0?(0,X.jsxs)(`section`,{className:`oc-projpage__section`,children:[(0,X.jsx)(`h2`,{className:`oc-projpage__subtitle`,children:te()}),(0,X.jsx)(`div`,{className:`oc-projpage__cards`,children:(0,X.jsx)(G,{items:e.children.map(e=>`folder:${e._id}`),strategy:Ge,children:e.children.map(t=>(0,X.jsx)(jt,{child:t,parentId:e.project._id,now:Vt,suppressClick:$},t._id))})})]}):null,(0,X.jsxs)(`section`,{className:`oc-projpage__section`,children:[(0,X.jsxs)(`div`,{className:`oc-projpage__convhead`,children:[(0,X.jsx)(`h2`,{className:`oc-projpage__subtitle`,children:l()}),e.chats.length>0?(0,X.jsx)(lt,{value:L,onChange:e=>Le(e.target.value),placeholder:c(),className:`oc-projpage__filter`}):null]}),e.chats.length===0?(0,X.jsx)(`p`,{className:`oc-projpage__hint`,children:e.children.length===0?we():fe()}):Ut.length===0&&(Z??[]).length===0?(0,X.jsx)(`p`,{className:`oc-projpage__hint`,children:re({term:L.trim()})}):(0,X.jsx)(`ul`,{className:`oc-projpage__chats`,children:(0,X.jsx)(G,{items:Ut.map(e=>`chat:${e._id}`),strategy:W,children:Ut.map(t=>(0,X.jsx)(Nt,{chat:t,currentFolderId:e.project._id,now:Vt,busy:Te.has(t._id),unread:F.has(t._id),locate:t._id===j,suppressClick:$},t._id))})})]}),J.length>=2&&Z!==void 0?(0,X.jsxs)(`section`,{className:`oc-projpage__section`,children:[(0,X.jsx)(`h2`,{className:`oc-projpage__subtitle`,children:Se()}),Z.length===0?(0,X.jsx)(`p`,{className:`oc-projpage__hint`,children:re({term:J})}):(0,X.jsx)(`ul`,{className:`oc-projpage__chats`,children:Z.map(e=>(0,X.jsx)(`li`,{className:`oc-projpage__chatrow`,children:(0,X.jsxs)(`button`,{type:`button`,className:`oc-projpage__chatbtn`,onClick:()=>{e.messageId&&J&&ke(e.messageId,J),t({to:`/chat/$chatId`,params:{chatId:e.chatId},...e.messageId?{search:{m:e.messageId}}:{}})},children:[(0,X.jsx)(Me,{size:13,"aria-hidden":!0,className:`oc-projpage__hitico`}),(0,X.jsxs)(`span`,{className:`oc-projpage__hitbody`,children:[(0,X.jsx)(`span`,{className:`oc-projpage__chattitle`,children:e.title||m()}),e.projectPath&&e.projectPath.length>1?(0,X.jsx)(`span`,{className:`oc-projpage__hitpath`,children:e.projectPath.join(` › `)}):null,e.snippet?(0,X.jsx)(`span`,{className:`oc-projpage__hitsnippet`,children:e.snippet}):null]})]})},`${e.chatId}:${e.messageId??`t`}`))})]}):null]}),(0,X.jsx)(pt,{open:B,onOpenChange:V,title:ce(),canSubmit:H.trim().length>0,onSubmit:async()=>{await u({projectId:e.project._id,name:H.trim()}),V(!1)},submitLabel:O(),children:(0,X.jsx)(lt,{value:H,onChange:e=>Ye(e.target.value),autoFocus:!0})}),Xe?(0,X.jsx)(Ue,{open:Xe,onOpenChange:Ze,title:pe(),movingFolderId:e.project._id,currentId:e.project.parentId,onPick:t=>void b({projectId:e.project._id,parentId:t})}):null,Ne]}),(0,X.jsx)(ze,{children:Et?(0,X.jsxs)(`div`,{className:`oc-projpage__dragghost`,children:[Et.kind===`folder`?(0,X.jsx)(z,{size:13,"aria-hidden":!0}):(0,X.jsx)(Me,{size:13,"aria-hidden":!0}),(0,X.jsx)(`span`,{children:Et.label})]}):null})]})})}function At({folderId:e,children:t}){let{setNodeRef:n,isOver:r}=P({id:Et(e)});return(0,X.jsx)(`span`,{ref:n,className:r?`oc-projpage__cdrop is-over`:`oc-projpage__cdrop`,children:t})}function jt({child:e,parentId:t,now:n,suppressClick:r}){let i=N(),a=V({id:`folder:${e._id}`}),o=P({id:$(e._id)});return(0,X.jsxs)(`div`,{ref:e=>{a.setNodeRef(e),o.setNodeRef(e)},className:`oc-projpage__card`+(o.isOver?` is-over`:``)+(a.isDragging?` is-dragging`:``),style:{"--proj-hue":U(e),transform:F.Transform.toString(a.transform),transition:a.transition},onClick:()=>{r.current||i({to:`/project/$projectId`,params:{projectId:e._id}})},onKeyDown:t=>{t.key===`Enter`&&i({to:`/project/$projectId`,params:{projectId:e._id}})},...a.listeners,...a.attributes,role:`link`,tabIndex:0,children:[(0,X.jsxs)(`span`,{className:`oc-projpage__cardhead`,children:[(0,X.jsx)(z,{size:15,"aria-hidden":!0,className:`oc-projpage__cardico`}),(0,X.jsx)(`span`,{className:`oc-projpage__cardname`,children:e.name}),(0,X.jsx)(Z,{folderId:e._id,name:e.name,color:e.color,currentParentId:t,className:`oc-projpage__cardmenu`,onOpen:()=>void i({to:`/project/$projectId`,params:{projectId:e._id}})})]}),(0,X.jsxs)(`span`,{className:`oc-projpage__cardmeta`,children:[e.folderCount>0?x({count:e.folderCount})+` · `:``,Ce({count:e.recursiveChatCount})]}),e.lastActivityAt===null?null:(0,X.jsx)(`span`,{className:`oc-projpage__cardage`,children:H(e.lastActivityAt,n)})]})}function Mt({chat:e}){let t=C(A.chats.setChatSidebar),n=e.inSidebar?g():b();return(0,X.jsx)(q,{variant:`ghost`,size:`icon-xs`,"aria-label":n,title:n,className:`oc-projpage__barbtn`+(e.inSidebar?` is-on`:``),disabled:e.pinned&&e.inSidebar,onClick:n=>{n.stopPropagation(),t({chatId:e._id,hidden:e.inSidebar})},children:e.inSidebar?(0,X.jsx)(Le,{}):(0,X.jsx)(J,{})})}function Nt({chat:e,currentFolderId:t,now:n,busy:i,unread:a,locate:o,suppressClick:s}){let c=(0,Y.useContext)(Ae).get(e._id),l=N(),u=B(e.color),d=V({id:`chat:${e._id}`}),f=Pt(o);return(0,X.jsxs)(`li`,{ref:e=>{d.setNodeRef(e),f.current=e},className:`oc-projpage__chatrow`+(d.isDragging?` is-dragging`:``)+(o?` is-locate`:``),style:{transform:F.Transform.toString(d.transform),transition:d.transition},children:[(0,X.jsxs)(`button`,{type:`button`,className:`oc-projpage__chatbtn`,onClick:()=>{s.current||l({to:`/chat/$chatId`,params:{chatId:e._id}})},...d.listeners,...d.attributes,children:[u?(0,X.jsx)(`span`,{className:`oc-chatitem__dot`,style:{background:u}}):(0,X.jsx)(`span`,{className:`oc-chatitem__dot oc-chatitem__dot--empty`}),(0,X.jsx)(`span`,{className:`oc-projpage__chattitle`,children:e.title||r()}),e.pinned?(0,X.jsx)(Oe,{size:12,"aria-hidden":!0,className:`oc-projpage__chatpin`}):null,(0,X.jsx)(`span`,{className:`oc-projpage__chatage`,children:H(e.updatedAt,n)}),i?(0,X.jsx)(`span`,{className:I(c,y()).className,title:I(c,y()).label,"aria-label":I(c,y()).label}):null,a&&!i?(0,X.jsx)(`span`,{className:`oc-chatitem__unread`,title:h(),"aria-label":h()}):null]}),(0,X.jsx)(Mt,{chat:e}),(0,X.jsx)(Q,{chat:e,currentFolderId:t,className:`oc-projpage__chatmenu`})]})}function Pt(e){let t=(0,Y.useRef)(null);return(0,Y.useEffect)(()=>{e&&t.current&&t.current.scrollIntoView({block:`center`})},[e]),t}function Ft({data:e,busyIds:t,suppressClick:n,locateChatId:r}){let[i,a]=(0,Y.useState)(new Set),o=(0,Y.useMemo)(()=>{let t=new Map;for(let n of e?.chats??[]){let e=t.get(n.folderId);e===void 0?t.set(n.folderId,[n]):e.push(n)}return t},[e]);if(e===void 0)return(0,X.jsx)(`p`,{className:`oc-projpage__hint`,children:s()});if(e===null)return null;let c=e=>a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),l=(a,s)=>{let u=o.get(a??e.rootId)??[],d=Ve(e.folders,a);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(G,{items:u.map(e=>`chat:${e._id}`),strategy:W,children:u.map(e=>(0,X.jsx)(Lt,{chat:e,depth:s,busy:t.has(e._id),locate:e._id===r,suppressClick:n},e._id))}),(0,X.jsx)(G,{items:d.map(e=>`folder:${e._id}`),strategy:W,children:d.map(t=>(0,X.jsx)(It,{folder:t,parentId:a??e.rootId,depth:s,folded:i.has(t._id),onToggle:()=>c(t._id),suppressClick:n,children:i.has(t._id)?null:l(t._id,s+1)},t._id))})]})};return(0,X.jsx)(`div`,{className:`oc-projpage__tree`,children:(o.get(e.rootId)??[]).length===0&&Ve(e.folders,null).length===0?(0,X.jsx)(`p`,{className:`oc-projpage__hint`,children:we()}):l(null,0)})}function It({folder:e,parentId:t,depth:n,folded:r,onToggle:i,suppressClick:o,children:s}){let c=N(),l=V({id:`folder:${e._id}`}),u=P({id:$(e._id)});return(0,X.jsxs)(`div`,{className:`oc-projpage__treegroup`,children:[(0,X.jsxs)(`div`,{ref:e=>{l.setNodeRef(e),u.setNodeRef(e)},className:`oc-projpage__treerow oc-projpage__treerow--folder`+(u.isOver?` is-over`:``)+(l.isDragging?` is-dragging`:``),style:{"--tree-depth":n,"--proj-hue":U(e),transform:F.Transform.toString(l.transform),transition:l.transition},...l.listeners,...l.attributes,role:`button`,tabIndex:0,onClick:()=>{o.current||c({to:`/project/$projectId`,params:{projectId:e._id}})},onKeyDown:t=>{t.key===`Enter`&&c({to:`/project/$projectId`,params:{projectId:e._id}})},children:[(0,X.jsx)(`button`,{type:`button`,className:`oc-projpage__treechev`,"aria-label":r?a():E(),"aria-expanded":!r,onClick:e=>{e.stopPropagation(),!o.current&&i()},onMouseDown:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation(),children:r?(0,X.jsx)(Ze,{size:13}):(0,X.jsx)(Xe,{size:13})}),(0,X.jsx)(z,{size:13,"aria-hidden":!0,className:`oc-projpage__colico`}),(0,X.jsx)(`span`,{className:`oc-projpage__colname`,children:e.name}),(0,X.jsx)(Z,{folderId:e._id,name:e.name,color:e.color,currentParentId:t,className:`oc-projpage__treemenu`,onOpen:()=>void c({to:`/project/$projectId`,params:{projectId:e._id}})})]}),s]})}function Lt({chat:e,depth:t,busy:n,locate:i,suppressClick:a}){let o=(0,Y.useContext)(Ae).get(e._id),s=N(),c=V({id:`chat:${e._id}`}),l=Pt(i),u=B(e.color);return(0,X.jsxs)(`div`,{ref:e=>{c.setNodeRef(e),l.current=e},className:`oc-projpage__treerow oc-projpage__treerow--chat`+(c.isDragging?` is-dragging`:``)+(i?` is-locate`:``),style:{"--tree-depth":t,transform:F.Transform.toString(c.transform),transition:c.transition},children:[(0,X.jsxs)(`button`,{type:`button`,className:`oc-projpage__colchatbtn`,onClick:()=>{a.current||s({to:`/chat/$chatId`,params:{chatId:e._id}})},...c.listeners,...c.attributes,children:[u?(0,X.jsx)(`span`,{className:`oc-chatitem__dot`,style:{background:u}}):(0,X.jsx)(`span`,{className:`oc-chatitem__dot oc-chatitem__dot--empty`}),(0,X.jsx)(`span`,{className:`oc-projpage__colname`,children:e.title||r()}),n?(0,X.jsx)(`span`,{className:I(o,``).className,"aria-hidden":!0}):null]}),(0,X.jsx)(Q,{chat:e,currentFolderId:e.folderId,className:`oc-projpage__treemenu`}),(0,X.jsx)(Mt,{chat:e})]})}function Rt({data:e,currentId:t,busyIds:n,suppressClick:r,locateChatId:i}){let a=(0,Y.useRef)(null);return(0,Y.useEffect)(()=>{let e=a.current;e&&(e.scrollLeft=e.scrollWidth)},[e?.columns.length??0,t]),e===void 0?(0,X.jsx)(`p`,{className:`oc-projpage__hint`,children:s()}):(0,X.jsx)(`div`,{className:`oc-projpage__cols`,ref:a,children:e.columns.map((a,o)=>(0,X.jsx)(zt,{col:a,isLast:o===e.columns.length-1,currentId:t,busyIds:n,suppressClick:r,locateChatId:i},a.folderId??`root`))})}function zt({col:e,isLast:t,currentId:n,busyIds:r,suppressClick:i,locateChatId:a}){let o=N(),s=P({id:Tt(e.folderId)});return(0,X.jsxs)(`div`,{ref:s.setNodeRef,className:`oc-projpage__col`+(s.isOver?` is-over`:``)+(t?` is-last`:``),children:[(0,X.jsx)(G,{items:e.folders.map(e=>`folder:${e._id}`),strategy:W,children:e.folders.map(t=>(0,X.jsx)(Bt,{folder:t,parentId:e.folderId,isCurrent:t._id===n,suppressClick:i,onOpen:()=>void o({to:`/project/$projectId`,params:{projectId:t._id}})},t._id))}),(0,X.jsx)(G,{items:e.chats.map(e=>`chat:${e._id}`),strategy:W,children:e.chats.map(t=>(0,X.jsx)(Vt,{chat:t,folderId:e.folderId,busy:r.has(t._id),locate:t._id===a,suppressClick:i,onOpen:()=>void o({to:`/chat/$chatId`,params:{chatId:t._id}})},t._id))}),e.folders.length===0&&e.chats.length===0?(0,X.jsx)(`p`,{className:`oc-projpage__colempty`,children:fe()}):null]})}function Bt({folder:e,parentId:t,isCurrent:n,suppressClick:r,onOpen:i}){let a=V({id:`folder:${e._id}`}),o=P({id:$(e._id)});return(0,X.jsxs)(`div`,{ref:e=>{a.setNodeRef(e),o.setNodeRef(e)},className:`oc-projpage__colentry oc-projpage__colentry--folder`+(e.selected||n?` is-selected`:``)+(o.isOver?` is-over`:``)+(a.isDragging?` is-dragging`:``),style:{"--proj-hue":U(e),transform:F.Transform.toString(a.transform),transition:a.transition},onClick:()=>{r.current||i()},onKeyDown:e=>{e.key===`Enter`&&e.target===e.currentTarget&&i()},...a.listeners,...a.attributes,role:`button`,tabIndex:0,children:[(0,X.jsx)(z,{size:13,"aria-hidden":!0,className:`oc-projpage__colico`}),(0,X.jsx)(`span`,{className:`oc-projpage__colname`,children:e.name}),(0,X.jsx)(`span`,{className:`oc-projpage__colchev`,"aria-hidden":!0,children:`›`}),(0,X.jsx)(Z,{folderId:e._id,name:e.name,color:e.color,currentParentId:t,className:`oc-projpage__colmenu`,onOpen:i})]})}function Vt({chat:e,folderId:t,busy:n,locate:i,suppressClick:a,onOpen:o}){let s=(0,Y.useContext)(Ae).get(e._id),c=V({id:`chat:${e._id}`}),l=Pt(i),u=B(e.color);return(0,X.jsxs)(`div`,{ref:e=>{c.setNodeRef(e),l.current=e},className:`oc-projpage__colentry oc-projpage__colentry--chat`+(c.isDragging?` is-dragging`:``)+(i?` is-locate`:``),style:{transform:F.Transform.toString(c.transform),transition:c.transition},children:[(0,X.jsxs)(`button`,{type:`button`,className:`oc-projpage__colchatbtn`,onClick:()=>{a.current||o()},...c.listeners,...c.attributes,children:[u?(0,X.jsx)(`span`,{className:`oc-chatitem__dot`,style:{background:u}}):(0,X.jsx)(`span`,{className:`oc-chatitem__dot oc-chatitem__dot--empty`}),(0,X.jsx)(`span`,{className:`oc-projpage__colname`,children:e.title||r()}),n?(0,X.jsx)(`span`,{className:I(s,``).className,"aria-hidden":!0}):null]}),(0,X.jsx)(Q,{chat:e,currentFolderId:t,className:`oc-projpage__colmenu oc-projpage__colmenu--chat`}),(0,X.jsx)(Mt,{chat:e})]})}export{Ot as ProjectPage};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$k as r,CA as i,Cf as a,Du as o,Ou as s,Qk as c,SA as l,Sf as u,Uo as d,XX as f,Xk as p,YX as m,Zk as h,aA as g,cA as _,dA as v,df as y,eA as b,fA as x,ff as ee,fm as te,gm as S,hA as C,hm as w,iA as T,ku as E,lA as D,mA as ne,mf as re,mm as ie,nA as ae,oA as oe,pA as se,pf as ce,pm as O,rA as k,sA as A,t as j,tA as M,uA as N,uf as P,wf as F,xf as I}from"./api-DSJJn0d7.js";import{i as L,n as R,r as z,t as B}from"./FieldLabel-DkgrHevY.js";import{t as V}from"./checkbox-CsI4ggnp.js";import{a as H,c as le,o as U,s as W}from"./tooltip-v_AyOWn6.js";import{a as G,i as K,n as q,r as J,t as Y}from"./select-qM3ZfTHx.js";import{t as X}from"./button-Dio0PVrp.js";import{r as ue}from"./toast-xNFwDnUy.js";import{t as de}from"./appHost-CH3EGcJw.js";import{r as Z,t as fe}from"./locales-CPjguROj.js";import{t as pe}from"./localePickerView-C2RmOS86.js";/* empty css */var Q=t(e(),1),$=n(),me={media_delivery:{label:N,help:D},documentary_fetch:{label:_,help:A},inbound_files:{label:oe,help:g},history_summary:{label:S,help:w},file_curation:{label:F,help:re},quote_reply:{label:a,help:u}},he={outboundDir:`/home/node/.openclaw/media/outbound`,references:`- gdrive/1a2b3c4d5e6f7890abcd
|
|
2
|
+
- gdrive/0f9e8d7c6b5a4321dcba`,files:`- /home/node/.openclaw/media/inbound/rapport.pdf (124800 o, application/pdf)`,previous_summary:`Projet Alpha : budget 40 000 EUR ; choix du serveur en cours.`,new_messages:`Utilisateur : Compare OVH et Scaleway.
|
|
3
|
+
Assistant : Comparaison en cours.`,max_chars:`6000`,file_name:`MEMORY.md`,budget_chars:`20000`,feedback:`Trop de suppressions dans la section des liens, garde-les.`,content:`# Memory index
|
|
4
|
+
- [Fait 1](fait-1.md) - note du projet`,excerpt:`Le classement propose trois dossiers : Clients, Fournisseurs, Interne.`},ge={outboundDir:c,references:h,files:p,previous_summary:ie,new_messages:O,max_chars:te,file_name:ce,budget_chars:ee,feedback:y,content:P,excerpt:I};function _e(){let e=f(j.admin.listInstances,{}),[t,n]=(0,Q.useState)(null);if(e===void 0)return(0,$.jsx)(`div`,{className:`oc-settings__tab-loading`,"aria-busy":`true`});if(e.length===0)return(0,$.jsx)(`div`,{className:`oc-injtab`,children:(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:k()})});let r=e.find(e=>e._id===t)??e[0];return(0,$.jsxs)(`div`,{className:`oc-injtab`,children:[(0,$.jsxs)(`div`,{className:`oc-injtab__head`,children:[(0,$.jsx)(R,{label:C(),help:ne()}),(0,$.jsxs)(`label`,{className:`oc-injtab__picker`,children:[(0,$.jsx)(`span`,{children:T()}),(0,$.jsxs)(Y,{value:r._id,onValueChange:e=>n(e),children:[(0,$.jsx)(K,{size:`sm`,className:`min-w-44`,children:(0,$.jsx)(G,{})}),(0,$.jsx)(q,{children:e.map(e=>(0,$.jsx)(J,{value:e._id,children:e.displayName??e.name},e._id))})]})]})]}),(0,$.jsx)(ve,{instance:r},r._id)]})}function ve({instance:e}){let t=m(j.admin.upsertInstanceConfig),n=ue(),r=f(j.me.getMe,{host:de}),a=e.config??{},c=Z(e.config?.contentLocale,r?.defaultLocale??void 0),[u,d]=(0,Q.useState)(()=>L(a,c));(0,Q.useEffect)(()=>{d(L(a,c))},[c,e._id]);let[p,h]=(0,Q.useState)(!1),g=u.promptInjections,_=(e,t)=>d({...u,promptInjections:{...g,[e]:{...g[e],...t}}});async function v(){h(!0);try{await t({instanceId:e._id,config:z(u,a,c)})}catch(e){n.error(l(),e)}finally{h(!1)}}async function y(r){let i={...e.config??{}};r==="default"?delete i.contentLocale:i.contentLocale=r;try{await t({instanceId:e._id,config:i})}catch(e){n.error(l(),e)}}let b=e.config?.contentLocale??`default`,x=fe[Z(void 0,r?.defaultLocale??void 0)];return(0,$.jsxs)(`div`,{className:`oc-injtab__body`,children:[(0,$.jsxs)(`div`,{className:`oc-injtab__content-locale`,children:[(0,$.jsx)(`span`,{children:E()}),(0,$.jsxs)(Y,{value:b,onValueChange:e=>void y(e),children:[(0,$.jsx)(K,{size:`sm`,className:`min-w-44`,children:(0,$.jsx)(G,{})}),(0,$.jsxs)(q,{children:[(0,$.jsx)(J,{value:`default`,children:o({locale:x})}),pe().map(e=>(0,$.jsx)(J,{value:e.value,children:e.label},e.value))]})]}),(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:s()})]}),U.map(e=>(0,$.jsx)(ye,{injKey:e,def:H[e],i18n:me[e],row:g[e]??{enabled:!0,template:H[e].defaultTemplate[c]},contentLocale:c,onChange:t=>_(e,t)},e)),(0,$.jsx)(`div`,{className:`oc-injtab__actions`,children:(0,$.jsx)(X,{size:`sm`,onClick:()=>void v(),disabled:p,children:i()})})]})}function ye({injKey:e,def:t,i18n:n,row:i,contentLocale:a,onChange:o}){let[s,c]=(0,Q.useState)(!1),l=i.template.trim()!==t.defaultTemplate[a],u=t.togglable&&!i.enabled,f=Object.fromEntries(t.placeholders.map(e=>[e,he[e]??`{${e}}`])),p=W(e,i,a),m=p?le(p,f):``;return(0,$.jsxs)(`section`,{className:`oc-injcard`,children:[(0,$.jsxs)(`div`,{className:`oc-injcard__head`,children:[t.togglable?(0,$.jsxs)(`label`,{className:`oc-field--row`,children:[(0,$.jsx)(V,{checked:i.enabled,onCheckedChange:e=>o({enabled:e===!0})}),(0,$.jsx)(R,{label:n.label(),help:n.help()})]}):(0,$.jsx)(R,{label:n.label(),help:n.help()}),l&&(0,$.jsx)(`span`,{className:`oc-injection__badge`,children:x()})]}),(0,$.jsx)(`textarea`,{className:`oc-injcard__text`,value:i.template,disabled:u,rows:8,spellCheck:!1,onChange:e=>o({template:e.target.value})}),(0,$.jsxs)(`div`,{className:`oc-injection__foot`,children:[(0,$.jsxs)(`div`,{className:`oc-injcard__phs`,children:[(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:v()}),t.placeholders.map(e=>(0,$.jsxs)(`span`,{className:`oc-injcard__ph-chip`,children:[(0,$.jsx)(`code`,{children:`{${e}}`}),(0,$.jsx)(B,{text:(ge[e]??(()=>e))()})]},e))]}),(0,$.jsxs)(`div`,{className:`oc-injcard__btns`,children:[(0,$.jsx)(X,{variant:`ghost`,size:`sm`,onClick:()=>c(e=>!e),children:s?M():ae()}),l&&(0,$.jsx)(X,{variant:`ghost`,size:`sm`,onClick:()=>o({template:t.defaultTemplate[a]}),children:se()})]})]}),s&&(0,$.jsx)(`div`,{className:`oc-injcard__preview`,children:m?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`pre`,{className:`oc-injcard__previewtext`,children:m}),(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:b()}),t.pluralDefaultTemplate!==void 0&&!u?(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:d()}):null]}):(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:r()})})]})}export{_e as PromptInjectionsTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$N as r,AN as ee,FN as te,GN as i,IN as a,JN as ne,Jf as o,KN as s,LN as re,MN as c,NN as ie,PN as ae,QN as l,UN as u,WN as d,XN as f,XX as p,YN as m,YX as h,ZN as g,_P as _,aP as v,cP as y,dP as b,eP as oe,fP as x,gP as S,hP as C,iP as w,jN as T,kN as E,lP as D,mP as O,nP as k,oP as A,pP as j,qN as M,rP as N,sP as P,t as F,tP as I,uP as L,vP as R,yP as z}from"./api-DSJJn0d7.js";import{t as B}from"./lock-0lxfSnTE.js";import{t as V}from"./checkbox-CsI4ggnp.js";import{t as H}from"./button-Dio0PVrp.js";import{t as U}from"./input-BSpTsBA6.js";import"./convexApi-CyScjgcq.js";import{r as W}from"./toast-xNFwDnUy.js";import{t as G}from"./badge-C4po8DQ1.js";import{n as K}from"./ConfirmDialog-BXcki0Ee.js";import{t as q}from"./EntitySheet-B2B48bss.js";import{t as J}from"./roleDescriptions-x3mUxTcX.js";var Y=t(e(),1),X=n(),Z=[{group:()=>z(),keys:[{key:`traces.read`,label:()=>O()},{key:`traces.read.content`,label:()=>j(),phi:!0},{key:`traces.write`,label:()=>x()}]},{group:()=>R(),keys:[{key:`kpi.read`,label:()=>O()},{key:`kpi.write`,label:()=>x()}]},{group:()=>_(),keys:[{key:`openclaw.query`,label:()=>b()},{key:`anomalies.read`,label:()=>L()},{key:`anomalies.report`,label:()=>D()}]},{group:()=>S(),keys:[{key:`chats.read`,label:()=>O()},{key:`selfheal`,label:()=>P()},{key:`media.repair`,label:()=>A()},{key:`feedback.respond`,label:()=>o()}]},{group:()=>C(),keys:[{key:`admin.manage`,label:()=>y()}]}],se=Z.flatMap(e=>e.keys.map(e=>e.key));function Q(e){return e.includes(`*`)}var $={key:``,name:``,description:``};function ce(){let e=p(F.apiKeys.listRoles,{}),t=h(F.apiKeys.createRole),n=h(F.apiKeys.ensureRolesSeeded),o=h(F.apiKeys.updateRolePermissions).withOptimisticUpdate((e,{roleId:t,permissions:n})=>{let r=e.getQuery(F.apiKeys.listRoles,{});r&&e.setQuery(F.apiKeys.listRoles,{},r.map(e=>e._id===t?{...e,permissions:n}:e))}),_=K(),y=W(),[b,x]=(0,Y.useState)(!1),[S,C]=(0,Y.useState)($),[D,O]=(0,Y.useState)(new Set);(0,Y.useEffect)(()=>{n({}).catch(e=>{y.error(w(),e)})},[n,y]);let A=e??[];async function j(e,t){if(Q(e.permissions))return;if(e.builtin){await _({title:N({name:e.name}),description:k(),confirmLabel:I()});return}if(D.has(e._id))return;let n=e.permissions.includes(t)?e.permissions.filter(e=>e!==t):[...e.permissions,t];O(t=>new Set(t).add(e._id));try{await o({roleId:e._id,permissions:n})}catch(e){y.error(oe(),e)}finally{O(t=>{let n=new Set(t);return n.delete(e._id),n})}}async function P(){try{await t({key:S.key,name:S.name,description:S.description||void 0,permissions:[]}),C($),x(!1)}catch(e){y.error(r(),e)}}let L=e===void 0,R=!L&&A.length===0;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`oc-admin__hint`,children:[l(),` `,(0,X.jsx)(`code`,{children:`admin`}),` `,g(),` `,(0,X.jsx)(`code`,{children:`traces.read.content`}),` `,f()]}),(0,X.jsxs)(`div`,{className:`oc-dt`,children:[(0,X.jsxs)(`div`,{className:`oc-dt__bar`,children:[(0,X.jsx)(`h2`,{className:`oc-dt__title`,children:m()}),(0,X.jsx)(`div`,{className:`oc-dt__bar-actions`,children:(0,X.jsx)(H,{size:`sm`,onClick:()=>{C($),x(!0)},children:ne()})})]}),L?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:M()}):R?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:s()}):(0,X.jsx)(`div`,{className:`oc-matrix__scroll`,children:(0,X.jsxs)(`table`,{className:`oc-matrix`,children:[(0,X.jsxs)(`thead`,{children:[(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`th`,{className:`oc-matrix__corner`,rowSpan:2,children:i()}),Z.map(e=>(0,X.jsx)(`th`,{className:`oc-matrix__group`,colSpan:e.keys.length,children:e.group()},e.group()))]}),(0,X.jsx)(`tr`,{children:Z.flatMap(e=>e.keys.map(e=>(0,X.jsxs)(`th`,{className:`oc-matrix__perm`,title:e.phi?v({key:e.key}):e.key,children:[e.label(),e.phi?(0,X.jsx)(`span`,{className:`oc-matrix__phi`,children:` ⚠`}):null]},e.key)))})]}),(0,X.jsx)(`tbody`,{children:A.map(e=>{let t=Q(e.permissions),n=D.has(e._id);return(0,X.jsxs)(`tr`,{children:[(0,X.jsxs)(`th`,{className:`oc-matrix__rolecell`,children:[(0,X.jsxs)(`div`,{className:`oc-matrix__rolename`,children:[(0,X.jsx)(`span`,{children:e.name}),(0,X.jsx)(`code`,{className:`oc-matrix__rolekey`,children:e.key}),e.builtin?(0,X.jsxs)(G,{variant:`outline`,className:`gap-1`,children:[(0,X.jsx)(B,{}),` `,d()]}):(0,X.jsx)(G,{variant:`secondary`,children:u()})]}),J(e)?(0,X.jsx)(`p`,{className:`oc-matrix__roledesc`,children:J(e)}):null]}),se.map(r=>(0,X.jsx)(`td`,{className:`oc-matrix__cell`,children:(0,X.jsx)(V,{checked:t||e.permissions.includes(r),disabled:t||n,"aria-label":`${e.key} · ${r}`,title:t?re():n?a():r,onCheckedChange:()=>void j(e,r)})},r))]},e.key)})})]})})]}),(0,X.jsx)(q,{open:b,onOpenChange:x,title:te(),description:ae(),canSubmit:!!(S.key&&S.name),onSubmit:P,submitLabel:ie(),children:(0,X.jsxs)(`div`,{className:`oc-form`,children:[(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:c()}),(0,X.jsx)(U,{value:S.key,placeholder:T(),onChange:e=>C({...S,key:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:ee()}),(0,X.jsx)(U,{value:S.name,onChange:e=>C({...S,name:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:E()}),(0,X.jsx)(U,{value:S.description,onChange:e=>C({...S,description:e.target.value})})]})]})})]})}export{ce as RolesTab};
|
|
@@ -0,0 +1 @@
|
|
|
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,BJ as o,BX as s,CJ as c,CY as l,Cq as u,Dq as ee,E as d,EJ as f,Eq as p,FJ as te,Fq as m,HJ as ne,HX as h,IJ as re,Iq as ie,LJ as g,Lq as ae,MJ as oe,Mq as se,NJ as ce,Nq as le,Oq as ue,PJ as de,Pq as fe,Qq as pe,Rq as me,SJ as he,SY as ge,Sq as _e,Tq as ve,UJ as ye,VJ as be,WJ as xe,XX as Se,Xq as _,Yq as Ce,Zq as we,_J as Te,_Y as Ee,aJ as v,bJ as De,bY as Oe,cJ as ke,dY as Ae,eJ as je,fY as Me,gJ as Ne,gY as Pe,gq as Fe,hJ as Ie,hY as Le,iJ as Re,jJ as ze,jq as Be,kJ as Ve,kq as He,lJ as Ue,lY as We,mY as Ge,nJ as Ke,oJ as y,pY as qe,qX as b,rJ as Je,sJ as Ye,t as x,tJ as S,uJ as Xe,uY as Ze,vJ as Qe,vY as $e,wJ as et,wY as tt,wq as nt,xJ as rt,xY as it,yJ as at,yY as ot,zJ as st,zq as ct}from"./api-DSJJn0d7.js";import{t as C}from"./chevron-left-DQ9FCoo_.js";import{t as w}from"./chevron-right-C_b_y922.js";import{t as lt}from"./list-eSch39T9.js";import{t as ut}from"./loader-circle-BNhIFGdg.js";import{a as dt,i as ft,n as pt,r as mt,t as ht}from"./cronDescribe-CAuRX7uW.js";import{t as gt}from"./pencil-aUWxuLhy.js";import{t as _t}from"./rotate-ccw-BD-9XzMC.js";import{t as vt}from"./trash-2-B4WSfc7G.js";import{a as T,i as E,n as D,r as O,t as k}from"./select-qM3ZfTHx.js";import{a as yt,c as bt,i as xt,n as St,o as Ct,r as wt,s as Tt,t as Et}from"./alert-dialog-BoEv1f8g.js";import{n as A,r as j,t as M}from"./popover-DBaIbsBr.js";import{t as N}from"./button-Dio0PVrp.js";import{t as Dt}from"./input-BSpTsBA6.js";import"./convexApi-CyScjgcq.js";import{r as Ot}from"./toast-xNFwDnUy.js";import{t as P}from"./badge-C4po8DQ1.js";import{a as kt,i as At,n as jt,o as Mt,r as Nt,t as Pt}from"./dialog-BfrsWZiD.js";import{t as Ft}from"./appHost-CH3EGcJw.js";import{a as It,i as F,n as Lt,o as Rt,r as I,t as zt}from"./table-D2SJC960.js";import{t as Bt}from"./FilterBar-DTVwlDpF.js";/* empty css */import{a as Vt,c as L,i as R,l as Ht,n as Ut,o as z,r as Wt,s as Gt,t as Kt,u as B}from"./TimezoneCombobox-CPTpWNQm.js";var qt=d(`calendar-days`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M16 18h.01`,key:`kzsmim`}]]),Jt=d(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),V=t(e(),1),H=n();function U(e){try{let t=new Intl.DateTimeFormat(e,{weekday:`narrow`});return Array.from({length:7},(e,n)=>t.format(new Date(2024,0,1+n)))}catch{return[`M`,`T`,`W`,`T`,`F`,`S`,`S`]}}function Yt({value:e,onChange:t}){let n=Ht(e),r=(0,V.useMemo)(()=>new Date,[]),[i,a]=(0,V.useState)(()=>({year:n?.year??r.getFullYear(),month:n?.month??r.getMonth()})),[o,s]=(0,V.useState)(!1),c=(0,V.useMemo)(()=>U(h()),[]),l=(0,V.useMemo)(()=>new Intl.DateTimeFormat(h(),{month:`long`,year:`numeric`}),[]),u=(0,V.useMemo)(()=>new Intl.DateTimeFormat(h(),{dateStyle:`medium`,timeStyle:`short`}),[]),ee=L(i.year,i.month),d=n?.hour??9,f=n?.minute??0,p=(e,n,r,i,a)=>t(B(e,n,r,i,a)),te=(e,t,n)=>{a({year:e,month:t}),p(e,t,n,d,f)},m=e=>{let t=new Date(i.year,i.month+e,1);a({year:t.getFullYear(),month:t.getMonth()})},ne=n===null?Ue():u.format(new Date(n.year,n.month,n.day,n.hour,n.minute));return(0,H.jsxs)(M,{modal:!0,open:o,onOpenChange:s,children:[(0,H.jsx)(j,{asChild:!0,children:(0,H.jsxs)(`button`,{type:`button`,className:`oc-dtp__trigger`,"aria-label":Xe(),children:[(0,H.jsx)(qt,{size:14,"aria-hidden":!0,className:`oc-dtp__icon`}),(0,H.jsx)(`span`,{className:n===null?`oc-dtp__placeholder`:void 0,children:ne})]})}),(0,H.jsxs)(A,{align:`start`,className:`oc-dtp__pop`,children:[(0,H.jsxs)(`div`,{className:`oc-dtp__head`,children:[(0,H.jsx)(`button`,{type:`button`,className:`oc-dtp__nav`,"aria-label":ke(),onClick:()=>m(-1),children:(0,H.jsx)(C,{size:15,"aria-hidden":!0})}),(0,H.jsx)(`span`,{className:`oc-dtp__month`,children:l.format(new Date(i.year,i.month,1))}),(0,H.jsx)(`button`,{type:`button`,className:`oc-dtp__nav`,"aria-label":Ye(),onClick:()=>m(1),children:(0,H.jsx)(w,{size:15,"aria-hidden":!0})})]}),(0,H.jsxs)(`div`,{className:`oc-dtp__grid`,children:[c.map((e,t)=>(0,H.jsx)(`span`,{className:`oc-dtp__wd`,children:e},t)),ee.map((e,t)=>{let i=n!==null&&n.year===e.year&&n.month===e.month&&n.day===e.day,a=r.getFullYear()===e.year&&r.getMonth()===e.month&&r.getDate()===e.day;return(0,H.jsx)(`button`,{type:`button`,className:`oc-dtp__day`+(e.inMonth?``:` oc-dtp__day--out`)+(i?` oc-dtp__day--sel`:``)+(a&&!i?` oc-dtp__day--today`:``),onClick:()=>te(e.year,e.month,e.day),children:e.day},t)})]}),(0,H.jsxs)(`div`,{className:`oc-dtp__time`,children:[(0,H.jsxs)(k,{value:String(d),onValueChange:e=>p(i.year,i.month,n?.day??r.getDate(),Number(e),f),children:[(0,H.jsx)(E,{size:`sm`,"aria-label":y(),children:(0,H.jsx)(T,{})}),(0,H.jsx)(D,{className:`oc-dtp__timeopts`,children:Array.from({length:24},(e,t)=>(0,H.jsx)(O,{value:String(t),children:String(t).padStart(2,`0`)},t))})]}),(0,H.jsx)(`span`,{className:`oc-dtp__colon`,children:`:`}),(0,H.jsxs)(k,{value:String(f),onValueChange:e=>p(i.year,i.month,n?.day??r.getDate(),d,Number(e)),children:[(0,H.jsx)(E,{size:`sm`,"aria-label":v(),children:(0,H.jsx)(T,{})}),(0,H.jsx)(D,{className:`oc-dtp__timeopts`,children:Array.from({length:60},(e,t)=>(0,H.jsx)(O,{value:String(t),children:String(t).padStart(2,`0`)},t))})]})]})]})]})}function W(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`}function Xt(e,t,n){let r=e=>String(e).padStart(2,`0`);return`${e}-${r(t+1)}-${r(n)}`}function Zt(e){let t=new Map;for(let n of e){let e=W(n.atMs),r=t.get(e);r===void 0?t.set(e,[n]):r.push(n)}for(let e of t.values())e.sort((e,t)=>e.atMs-t.atMs);return t}function Qt(e,t,n){let r=new Map,i=new Date(t,n+1,0).getDate();for(let a=1;a<=i;a++){let i=e.get(Xt(t,n,a));i!==void 0&&i.length>0&&r.set(a,i.length)}return r}function $t(e){try{let t=new Intl.DateTimeFormat(e,{weekday:`narrow`});return Array.from({length:7},(e,n)=>t.format(new Date(2024,0,1+n)))}catch{return[`M`,`T`,`W`,`T`,`F`,`S`,`S`]}}function en(e,t){let n=(new Date(e,t,1).getDay()+6)%7,r=new Date(e,t,1-n),i=new Date(r.getFullYear(),r.getMonth(),r.getDate()+42);return{startMs:r.getTime(),endMs:i.getTime()}}function tn(e){return{startMs:new Date(e,0,1).getTime(),endMs:new Date(e+1,0,1).getTime()}}var G=3;function nn({events:e,mode:t,cursor:n,onModeChange:i,onCursorChange:a,onEventClick:o,footnote:s}){let c=h(),l=(0,V.useMemo)(()=>Zt(e),[e]),u=(0,V.useMemo)(()=>$t(c),[c]),ee=(0,V.useMemo)(()=>new Intl.DateTimeFormat(c,{month:`long`,year:`numeric`}),[c]),d=(0,V.useMemo)(()=>new Intl.DateTimeFormat(c,{month:`long`}),[c]),f=(0,V.useMemo)(()=>new Intl.DateTimeFormat(c,{hour:`2-digit`,minute:`2-digit`}),[c]),p=new Date,te=e=>{if(t===`year`){a({year:n.year+e,month:n.month});return}let r=new Date(n.year,n.month+e,1);a({year:r.getFullYear(),month:r.getMonth()})},m=t===`year`?String(n.year):ee.format(new Date(n.year,n.month,1));return(0,H.jsxs)(`div`,{className:`oc-cal`,children:[(0,H.jsxs)(`div`,{className:`oc-cal__head`,children:[(0,H.jsxs)(`div`,{className:`oc-cal__nav`,children:[(0,H.jsx)(N,{variant:`ghost`,size:`icon-sm`,"aria-label":pe(),onClick:()=>te(-1),children:(0,H.jsx)(C,{})}),(0,H.jsx)(N,{variant:`ghost`,size:`icon-sm`,"aria-label":we(),onClick:()=>te(1),children:(0,H.jsx)(w,{})}),(0,H.jsx)(N,{variant:`ghost`,size:`sm`,onClick:()=>a({year:p.getFullYear(),month:p.getMonth()}),children:r()})]}),(0,H.jsx)(`span`,{className:`oc-cal__title`,children:m}),(0,H.jsxs)(`div`,{className:`oc-cal__modes`,role:`group`,children:[(0,H.jsx)(N,{variant:t===`month`?`secondary`:`ghost`,size:`sm`,"aria-pressed":t===`month`,onClick:()=>i(`month`),children:S()}),(0,H.jsx)(N,{variant:t===`year`?`secondary`:`ghost`,size:`sm`,"aria-pressed":t===`year`,onClick:()=>i(`year`),children:je()})]})]}),t===`month`?(0,H.jsx)(rn,{cursor:n,byDay:l,weekdays:u,timeFmt:f,now:p,onEventClick:o}):(0,H.jsx)(an,{year:n.year,byDay:l,monthShortFmt:d,now:p,onOpenMonth:e=>{a({year:n.year,month:e}),i(`month`)}}),s?(0,H.jsx)(`p`,{className:`oc-cal__footnote`,children:s}):null]})}function rn({cursor:e,byDay:t,weekdays:n,timeFmt:r,now:i,onEventClick:a}){let o=L(e.year,e.month);return(0,H.jsxs)(`div`,{className:`oc-cal__month`,children:[n.map((e,t)=>(0,H.jsx)(`span`,{className:`oc-cal__wd`,children:e},t)),o.map((e,n)=>{let o=t.get(Xt(e.year,e.month,e.day))??[],s=i.getFullYear()===e.year&&i.getMonth()===e.month&&i.getDate()===e.day;return(0,H.jsxs)(`div`,{className:`oc-cal__day`+(e.inMonth?``:` oc-cal__day--out`)+(s?` oc-cal__day--today`:``),children:[(0,H.jsx)(`span`,{className:`oc-cal__daynum`,children:e.day}),o.slice(0,G).map(e=>(0,H.jsxs)(`button`,{type:`button`,className:`oc-cal__event`+(e.muted?` oc-cal__event--muted`:``)+(e.exact?` oc-cal__event--exact`:``),style:e.color?{"--cal-ev":e.color}:void 0,title:`${r.format(e.atMs)} ${e.title}`,onClick:a?()=>a(e):void 0,children:[(0,H.jsx)(`span`,{className:`oc-cal__evdot`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`oc-cal__evtime`,children:r.format(e.atMs)}),(0,H.jsx)(`span`,{className:`oc-cal__evtitle`,children:e.title})]},e.id)),o.length>G?(0,H.jsx)(`span`,{className:`oc-cal__more`,children:_({count:o.length-G})}):null]},n)})]})}function an({year:e,byDay:t,monthShortFmt:n,now:r,onOpenMonth:i}){return(0,H.jsx)(`div`,{className:`oc-cal__year`,children:Array.from({length:12},(a,o)=>{let s=Qt(t,e,o),c=L(e,o);return(0,H.jsxs)(`button`,{type:`button`,className:`oc-cal__mini`,onClick:()=>i(o),children:[(0,H.jsx)(`span`,{className:`oc-cal__mininame`,children:n.format(new Date(e,o,1))}),(0,H.jsx)(`span`,{className:`oc-cal__minigrid`,"aria-hidden":!0,children:c.map((e,t)=>{let n=e.inMonth?s.get(e.day)??0:0,i=e.inMonth&&r.getFullYear()===e.year&&r.getMonth()===e.month&&r.getDate()===e.day;return(0,H.jsx)(`span`,{className:`oc-cal__minidot`+(e.inMonth?``:` is-out`)+(n===1?` has-one`:``)+(n>1?` has-many`:``)+(i?` is-today`:``)},t)})})]},o)})})}var on={h:36e5,min:6e4,s:1e3,ms:1};function sn(e){if(e===null)return null;let t=e.trim(),n=/^every\s+(\d+(?:\.\d+)?)(h|min|s|ms)$/.exec(t);if(n!==null){let e=Number(n[1])*on[n[2]];return Number.isFinite(e)&&e>0?{kind:`every`,everyMs:e}:null}let r=/^(?:cron\s+)?([\d*,/-]+(?:\s+[\d*,/-]+){4})(?:\s*\(([^)]+)\))?$/.exec(t);if(r!==null)return{kind:`cron`,expr:r[1],tz:r[2]??null};let i=Date.parse(t);return Number.isFinite(i)?{kind:`at`,atMs:i}:null}function K(e,t,n){let r=new Set;for(let i of e.split(`,`)){let e=i,a=1,o=/^(.+)\/(\d{1,3})$/.exec(i);if(o!==null&&(e=o[1],a=Number(o[2]),a<1))return null;let s,c;if(e===`*`)s=t,c=n;else{let r=/^(\d{1,3})(?:-(\d{1,3}))?$/.exec(e);if(r===null||(s=Number(r[1]),c=r[2]===void 0?s:Number(r[2]),r[2]===void 0&&o!==null&&(c=n),s<t||c>n||s>c))return null}for(let e=s;e<=c;e+=a)r.add(e)}return r.size>0?[...r].sort((e,t)=>e-t):null}function q(e){let t=e.trim().split(/\s+/);if(t.length!==5)return null;let n=K(t[0],0,59),r=K(t[1],0,23),i=K(t[2],1,31),a=K(t[3],1,12),o=K(t[4],0,7);if(!n||!r||!i||!a||!o)return null;let s=new Set(o.map(e=>e%7));return{minutes:n,hours:r,dom:new Set(i),months:new Set(a),dow:s,domRestricted:t[2]!==`*`,dowRestricted:t[4]!==`*`}}var cn=new Map;function J(e){let t=cn.get(e);if(t!==void 0)return t;let n=null;try{n=new Intl.DateTimeFormat(`en-US`,{timeZone:e,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}catch{n=null}return cn.set(e,n),n}function Y(e,t){if(t!==null){let n=J(t);if(n!==null){let t={};for(let r of n.formatToParts(e))r.type!==`literal`&&(t[r.type]=Number(r.value));return{y:t.year,mo:t.month-1,d:t.day,h:t.hour===24?0:t.hour,mi:t.minute}}}let n=new Date(e);return{y:n.getFullYear(),mo:n.getMonth(),d:n.getDate(),h:n.getHours(),mi:n.getMinutes()}}function X(e,t,n,r,i,a){if(a===null||J(a)===null)return new Date(e,t,n,r,i).getTime();let o=Date.UTC(e,t,n,r,i),s=e=>{let t=Y(e,a);return Date.UTC(t.y,t.mo,t.d,t.h,t.mi)-e},c=s(o),l=o-c,u=s(l);return u!==c&&(l=o-u),l}function Z(e,t,n,r){let i=new Map,a=(e,t)=>{e<n||e>=r||i.set(e,t||(i.get(e)??!1))};if(e?.kind===`at`)a(e.atMs,!0);else if(e?.kind===`every`){if(t!==null){let i=e.everyMs,o=Math.ceil((n-t)/i);for(let e=t+o*i,n=0;e<r&&n<400;e+=i,n++)a(e,e===t)}}else if(e?.kind===`cron`){let t=q(e.expr);if(t!==null&&t.hours.length*t.minutes.length<=400){let i=0,o=n-864e5;for(;o<r+864e5&&i<400;){let s=Y(o,e.tz);if(t.months.has(s.mo+1)){let o=new Date(Date.UTC(s.y,s.mo,s.d)).getUTCDay(),c=t.dom.has(s.d),l=t.dow.has(o);if(t.domRestricted&&t.dowRestricted?c||l:c&&l)for(let o of t.hours)for(let c of t.minutes){if(i>=400)break;let t=X(s.y,s.mo,s.d,o,c,e.tz);t>=n&&t<r&&(a(t,!1),i++)}}o=X(s.y,s.mo,s.d,12,0,e.tz)+864e5}}}return t!==null&&a(t,!0),[...i.entries()].map(([e,t])=>({atMs:e,exact:t})).sort((e,t)=>e.atMs-t.atMs).slice(0,400)}var Q=`crons`;function ln(e,t){return`${e}\u0000${t}`}function un(e,t,n){let r=[],i=new Map;for(let a of e){let{job:e}=a;if(e.id===null)continue;let o=ln(a.instanceName,e.id);i.set(o,a);let s=z(e)!==`active`,c=Z(s?null:sn(e.schedule),e.nextRunAtMs,t,n);for(let t of c)r.push({id:`${o}:${t.atMs}`,sourceId:Q,itemId:o,atMs:t.atMs,title:e.name??e.id,muted:s,exact:t.exact})}return{events:r,byItemId:i}}var $={minutes:6e4,hours:36e5,days:864e5};function dn(e){return e?.data?.code??`unknown`}function fn({status:e}){switch(Gt(e)){case`ok`:return(0,H.jsx)(P,{variant:`secondary`,children:c()});case`error`:return(0,H.jsx)(P,{variant:`destructive`,children:rt()});case`running`:return(0,H.jsx)(P,{variant:`outline`,children:De()});case`other`:return(0,H.jsx)(P,{variant:`outline`,children:e});case`none`:return(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}}function pn(){let e=b(x.scheduled.listMyCrons),t=b(x.scheduled.getCronDetail),n=b(x.scheduled.listCronRuns),r=b(x.scheduled.updateCron),d=b(x.scheduled.removeCron),pe=b(x.scheduled.runCronNow),_=Ot(),we=Se(x.me.getMe,{host:Ft})?.timezone,[v,ke]=(0,V.useState)(null),[je,Ue]=(0,V.useState)(!1),[y,Ye]=(0,V.useState)(!1),[S,Xe]=(0,V.useState)(null),[C,w]=(0,V.useState)(null),[A,j]=(0,V.useState)(null),[M,L]=(0,V.useState)(null),[Ht,Gt]=(0,V.useState)(!1),[B,U]=(0,V.useState)(Ut),[W,Xt]=(0,V.useState)(()=>new URLSearchParams(window.location.search).get(`job`)===null&&localStorage.getItem(`oc.sched.view`)===`calendar`?`calendar`:`list`),Zt=e=>{localStorage.setItem(`oc.sched.view`,e),Xt(e)},[Qt,$t]=(0,V.useState)(`month`),[G,rn]=(0,V.useState)(()=>{let e=new Date;return{year:e.getFullYear(),month:e.getMonth()}}),an=(0,V.useMemo)(()=>{let e=[];for(let t of v??[]){if(!t.supported||t.error!==null)continue;let n=t.kind===`openclaw`&&t.manageSupported;for(let r of t.jobs)Vt(r,B)&&e.push({instanceName:t.instanceName,canEdit:n,job:r})}return e},[v,B]),on=(0,V.useMemo)(()=>Qt===`year`?tn(G.year):en(G.year,G.month),[Qt,G]),sn=(0,V.useMemo)(()=>un(an,on.startMs,on.endMs),[an,on]),K=e=>{let t=sn.byItemId.get(e.itemId);t===void 0||!t.canEdit||t.job.id===null||pn(t.instanceName,t.job)},q=(0,V.useCallback)(async()=>{Ue(!0),Ye(!1);try{ke(await e({}))}catch{Ye(!0)}finally{Ue(!1)}},[e]);(0,V.useEffect)(()=>{q()},[q]);let cn=(0,V.useMemo)(()=>new URLSearchParams(window.location.search).get(`job`),[]),J=(0,V.useRef)(null);(0,V.useEffect)(()=>{v!==null&&J.current!==null&&J.current.scrollIntoView({block:`center`})},[v]);let Y=(0,V.useMemo)(()=>new Intl.DateTimeFormat(h(),{dateStyle:`medium`,timeStyle:`short`}),[]),X=async(e,t,n)=>{Xe(e);try{await t(),_.success(n),await q()}catch(e){_.toast({variant:`error`,title:g({code:dn(e)})})}finally{Xe(null)}},Z=(0,V.useRef)(0),Q=(0,V.useRef)(0),ln=async(e,t)=>{if(t.id===null)return;let r=++Z.current;j({name:t.name??t.id,entries:null});try{let i=await n({instanceName:e,jobId:t.id,limit:20});if(r!==Z.current)return;j({name:t.name??t.id,entries:i})}catch(e){if(r!==Z.current)return;j(null),_.toast({variant:`error`,title:g({code:dn(e)})})}},pn=async(e,n)=>{if(n.id===null)return;let r=++Q.current;L({instanceName:e,jobId:n.id,loading:!0,name:n.name??``,scheduleKind:`cron`,cronExpr:``,tz:``,everyValue:`1`,everyUnit:`hours`,at:``,message:``,hasMessage:!1,scheduleDirty:!1,messageDirty:!1,nameDirty:!1});try{let i=(await t({instanceName:e,jobId:n.id})).job,a=i.scheduleKind===`every`||i.scheduleKind===`at`?i.scheduleKind:`cron`,o=``;if(a===`at`&&i.scheduleExpr!==null){let e=Date.parse(i.scheduleExpr);Number.isFinite(e)&&(o=new Date(e-new Date(e).getTimezoneOffset()*6e4).toISOString().slice(0,16))}let s=`1`,c=`hours`;if(a===`every`&&i.scheduleExpr!==null){let e=Number(i.scheduleExpr);Number.isFinite(e)&&e>0&&(e%$.days===0?(s=String(e/$.days),c=`days`):e%$.hours===0?(s=String(e/$.hours),c=`hours`):(s=String(Math.max(1,Math.round(e/$.minutes))),c=`minutes`))}if(r!==Q.current)return;L(e=>e===null||e.jobId!==n.id?e:{...e,loading:!1,name:i.name??e.name,scheduleKind:a,cronExpr:a===`cron`?i.scheduleExpr??``:``,tz:i.tz??``,everyValue:s,everyUnit:c,at:o,message:i.message??``,hasMessage:i.message!==null&&!i.messageTruncated})}catch(e){if(r!==Q.current)return;L(null),_.toast({variant:`error`,title:g({code:dn(e)})})}},mn=async()=>{if(M===null)return;let e={};if(M.nameDirty&&M.name.trim()===``||M.messageDirty&&M.hasMessage&&M.message.trim()===``){_.toast({variant:`error`,title:_e()});return}if(M.nameDirty&&M.name.trim()!==``&&(e.name=M.name.trim()),M.scheduleDirty){if(M.scheduleKind===`cron`&&M.cronExpr.trim()!==``)e.schedule={kind:`cron`,expr:M.cronExpr.trim(),...M.tz.trim()===``?{}:{tz:M.tz.trim()}};else if(M.scheduleKind===`every`){let t=Number(M.everyValue);Number.isFinite(t)&&t>=1&&(e.schedule={kind:`every`,everyMs:Math.round(t*$[M.everyUnit])})}else if(M.scheduleKind===`at`&&M.at!==``){let t=Date.parse(M.at);Number.isFinite(t)&&(e.schedule={kind:`at`,at:new Date(t).toISOString()})}}if(M.scheduleDirty&&e.schedule===void 0){_.toast({variant:`error`,title:u()});return}if(M.messageDirty&&M.hasMessage&&M.message.trim()!==``&&(e.message=M.message.trim()),Object.keys(e).length===0){L(null);return}let t=Q.current;Gt(!0);try{await r({instanceName:M.instanceName,jobId:M.jobId,patch:e}),_.success(ie()),t===Q.current&&L(null),await q()}catch(e){_.toast({variant:`error`,title:g({code:dn(e)})})}finally{Gt(!1)}},hn=v?.reduce((e,t)=>e+t.jobs.length,0)??0;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:8,marginBottom:12},children:[(0,H.jsx)(`p`,{className:`oc-admin__hint`,style:{flex:1,margin:0},children:tt()}),(0,H.jsxs)(`div`,{className:`oc-sched__viewtoggle`,role:`group`,"aria-label":Re(),children:[(0,H.jsx)(N,{variant:W===`list`?`secondary`:`ghost`,size:`icon-sm`,"aria-label":Je(),title:Je(),"aria-pressed":W===`list`,onClick:()=>Zt(`list`),children:(0,H.jsx)(lt,{})}),(0,H.jsx)(N,{variant:W===`calendar`?`secondary`:`ghost`,size:`icon-sm`,"aria-label":Ke(),title:Ke(),"aria-pressed":W===`calendar`,onClick:()=>Zt(`calendar`),children:(0,H.jsx)(qt,{})})]}),(0,H.jsxs)(N,{variant:`ghost`,size:`sm`,onClick:()=>void q(),disabled:je,style:{display:`inline-flex`,alignItems:`center`,gap:4},children:[(0,H.jsx)(_t,{size:14,"aria-hidden":!0}),l()]})]}),v!==null&&hn>0?(0,H.jsxs)(Bt,{q:B.q,onQChange:e=>U(t=>({...t,q:e})),searchPlaceholder:Qe(),onReset:()=>U(Ut),canReset:Wt(B),children:[(0,H.jsxs)(k,{value:B.state,onValueChange:e=>U(t=>({...t,state:e})),children:[(0,H.jsx)(E,{size:`sm`,className:`w-40`,children:(0,H.jsx)(T,{})}),(0,H.jsxs)(D,{children:[(0,H.jsx)(O,{value:`all`,children:Te()}),(0,H.jsx)(O,{value:`active`,children:Ze()}),(0,H.jsx)(O,{value:`paused`,children:Ae()}),(0,H.jsx)(O,{value:`auto-disabled`,children:We()})]})]}),(0,H.jsxs)(k,{value:B.result,onValueChange:e=>U(t=>({...t,result:e})),children:[(0,H.jsx)(E,{size:`sm`,className:`w-40`,children:(0,H.jsx)(T,{})}),(0,H.jsxs)(D,{children:[(0,H.jsx)(O,{value:`all`,children:Ne()}),(0,H.jsx)(O,{value:`ok`,children:c()}),(0,H.jsx)(O,{value:`error`,children:rt()}),(0,H.jsx)(O,{value:`running`,children:De()}),(0,H.jsx)(O,{value:`none`,children:at()})]})]})]}):null,v===null?(0,H.jsx)(`p`,{className:`oc-admin__hint`,"aria-busy":je,children:y?ge():s()}):W===`calendar`?(0,H.jsxs)(H.Fragment,{children:[y?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:ge()}):null,v.length===0?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:it()}):(0,H.jsx)(nn,{events:sn.events,mode:Qt,cursor:G,onModeChange:$t,onCursorChange:rn,onEventClick:K,footnote:Ce()})]}):(0,H.jsxs)(H.Fragment,{children:[y?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:ge()}):null,v.length===0?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:it()}):null,v.map(e=>{let t=e.jobs.filter(e=>Vt(e,B)),n=Wt(B)&&e.jobs.length>0&&t.length===0;return(0,H.jsxs)(`section`,{style:{marginBottom:20},children:[v.length>1||e.error||!e.supported?(0,H.jsxs)(`h3`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:`0.85rem`,fontWeight:600,margin:`0 0 6px`},children:[e.instanceName,(0,H.jsx)(P,{variant:`outline`,children:e.kind})]}):null,e.supported?e.error?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:ot({code:e.error})}):e.jobs.length===0?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:$e()}):n?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:Ie()}):(0,H.jsxs)(zt,{children:[(0,H.jsx)(It,{children:(0,H.jsxs)(Rt,{children:[(0,H.jsx)(F,{children:Ee()}),(0,H.jsx)(F,{children:Pe()}),(0,H.jsx)(F,{children:Le()}),(0,H.jsx)(F,{children:Ge()}),(0,H.jsx)(F,{children:qe()}),(0,H.jsx)(F,{children:et()}),(0,H.jsx)(F,{children:ct()})]})}),(0,H.jsx)(Lt,{children:t.map((t,n)=>{let i=`${e.instanceName}:${t.id??n}`,a=S===i,s=e.manageSupported,c=e.kind===`openclaw`&&s;return(0,H.jsxs)(Rt,{ref:t.id!==null&&t.id===cn?J:void 0,"data-state":t.id!==null&&t.id===cn?`selected`:void 0,children:[(0,H.jsx)(I,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:t.name??void 0,children:t.name??Me()}),(0,H.jsx)(I,{children:(0,H.jsx)(P,{variant:`secondary`,children:t.agentId})}),(0,H.jsxs)(I,{className:`whitespace-nowrap`,children:[(0,H.jsx)(`span`,{style:{fontFamily:`var(--font-mono, monospace)`},children:t.schedule??`—`}),(()=>{let e=ht(t.schedule),n=e===null?null:pt(e);return n===null?null:(0,H.jsx)(`span`,{className:`text-muted-foreground`,style:{display:`block`,fontSize:`0.78rem`},children:n})})()]}),(0,H.jsx)(I,{className:`whitespace-nowrap text-muted-foreground`,children:t.nextRunAtMs===null?`—`:Y.format(t.nextRunAtMs)}),(0,H.jsx)(I,{children:z(t)===`auto-disabled`?(0,H.jsx)(P,{variant:`destructive`,title:`${t.autoDisabledReason??``}${t.autoDisabledAtMs===null?``:` · ${Y.format(t.autoDisabledAtMs)}`}`,children:We()}):z(t)===`active`?(0,H.jsx)(P,{variant:`secondary`,children:Ze()}):z(t)===`paused`?(0,H.jsx)(P,{variant:`outline`,children:Ae()}):(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}),(0,H.jsxs)(I,{children:[(0,H.jsx)(fn,{status:t.lastRunStatus}),t.lastDelivered===!1?(0,H.jsx)(P,{variant:`destructive`,title:t.lastDeliveryError??xe(),children:he()}):null]}),(0,H.jsx)(I,{className:`whitespace-nowrap`,children:t.id===null?(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}):a?(0,H.jsx)(ut,{size:14,className:`oc-actrow__spin`,"aria-hidden":!0}):(0,H.jsxs)(`span`,{className:`oc-cronactions`,children:[c?(0,H.jsx)(N,{variant:`ghost`,size:`icon-sm`,title:ne(),"aria-label":ne(),disabled:S!==null,onClick:()=>void X(i,async()=>{let n=await pe({instanceName:e.instanceName,jobId:t.id});if(n.ran!==!0&&n.runId===null)throw{data:{code:n.reason??`run_not_started`}}},re()),children:(0,H.jsx)(mt,{size:14,"aria-hidden":!0})}):null,c&&t.enabled!==null?(0,H.jsx)(N,{variant:`ghost`,size:`icon-sm`,title:R(t)===`pause`?be():o(),"aria-label":R(t)===`pause`?be():o(),disabled:S!==null,onClick:()=>void X(i,()=>r({instanceName:e.instanceName,jobId:t.id,patch:{enabled:R(t)===`resume`}}),R(t)===`pause`?te():de()),children:R(t)===`pause`?(0,H.jsx)(dt,{size:14,"aria-hidden":!0}):(0,H.jsx)(ft,{size:14,"aria-hidden":!0})}):null,c?(0,H.jsx)(N,{variant:`ghost`,size:`icon-sm`,title:me(),"aria-label":me(),disabled:S!==null,onClick:()=>void pn(e.instanceName,t),children:(0,H.jsx)(gt,{size:14,"aria-hidden":!0})}):null,c?(0,H.jsx)(N,{variant:`ghost`,size:`icon-sm`,title:ae(),"aria-label":ae(),disabled:S!==null,onClick:()=>void ln(e.instanceName,t),children:(0,H.jsx)(Jt,{size:14,"aria-hidden":!0})}):null,s?(0,H.jsx)(N,{variant:`ghost`,size:`icon-sm`,title:st(),"aria-label":st(),disabled:S!==null,onClick:()=>w({instanceName:e.instanceName,jobId:t.id,name:t.name??t.id}),children:(0,H.jsx)(vt,{size:14,"aria-hidden":!0})}):null]})})]},t.id??`${e.instanceName}-${n}`)})})]}):(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:Oe()})]},e.instanceName)}),hn>0?(0,H.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:4},children:Fe()}):null]}),(0,H.jsx)(Et,{open:C!==null,onOpenChange:e=>{e||w(null)},children:(0,H.jsxs)(xt,{children:[(0,H.jsxs)(Tt,{children:[(0,H.jsx)(bt,{children:oe()}),(0,H.jsx)(yt,{children:ze({name:C?.name??``})})]}),(0,H.jsxs)(Ct,{children:[(0,H.jsx)(wt,{children:i()}),(0,H.jsx)(St,{onClick:()=>{let e=C;w(null),e!==null&&X(`${e.instanceName}:${e.jobId}`,()=>d({instanceName:e.instanceName,jobId:e.jobId}),ce())},children:Ve()})]})]})}),(0,H.jsx)(Pt,{open:A!==null,onOpenChange:e=>{e||(Z.current++,j(null))},children:(0,H.jsxs)(jt,{style:{maxWidth:640},children:[(0,H.jsx)(kt,{children:(0,H.jsx)(Mt,{children:m({name:A?.name??``})})}),A?.entries===null?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:s()}):A!==null&&A.entries.length===0?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:fe()}):A===null?null:(0,H.jsx)(`div`,{className:`oc-cronpanel__runs`,style:{maxHeight:420,overflowY:`auto`},children:A.entries.map((e,t)=>(0,H.jsxs)(`div`,{className:`oc-cronpanel__run`,children:[(0,H.jsxs)(`div`,{className:`oc-cronpanel__run-head`,children:[(0,H.jsx)(fn,{status:e.status}),(0,H.jsx)(`span`,{children:typeof(e.runAtMs??e.ts)==`number`?Y.format(e.runAtMs??e.ts):`—`}),typeof e.durationMs==`number`?(0,H.jsxs)(`span`,{className:`oc-cronpanel__run-dur`,children:[Math.round(e.durationMs/1e3),`s`]}):null]}),e.summary===null?null:(0,H.jsx)(`div`,{className:`oc-cronpanel__run-summary`,children:e.summary}),e.error===null?null:(0,H.jsx)(`div`,{className:`oc-cronpanel__run-error`,children:e.error}),e.delivered===!1?(0,H.jsxs)(`div`,{className:`oc-cronpanel__run-undelivered`,children:[f({channel:e.deliveryChannel??`—`}),e.deliveryError===null?null:(0,H.jsx)(`span`,{className:`oc-cronpanel__plain`,children:e.deliveryError})]}):null]},t))})]})}),(0,H.jsx)(Pt,{open:M!==null,onOpenChange:e=>{e||(Q.current++,L(null))},children:(0,H.jsxs)(jt,{className:`oc-cronedit`,children:[(0,H.jsxs)(kt,{children:[(0,H.jsx)(Mt,{children:le()}),(0,H.jsx)(Nt,{children:se()})]}),M===null?null:M.loading?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:s()}):(0,H.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,H.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,H.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:Ee()}),(0,H.jsx)(Dt,{value:M.name,maxLength:200,onChange:e=>L({...M,name:e.target.value,nameDirty:!0})})]}),(0,H.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,H.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:Be()}),(0,H.jsxs)(k,{value:M.scheduleKind,onValueChange:e=>L({...M,scheduleKind:e,scheduleDirty:!0}),children:[(0,H.jsx)(E,{children:(0,H.jsx)(T,{})}),(0,H.jsxs)(D,{children:[(0,H.jsx)(O,{value:`cron`,children:a()}),(0,H.jsx)(O,{value:`every`,children:He()}),(0,H.jsx)(O,{value:`at`,children:ue()})]})]}),M.scheduleKind===`cron`?(0,H.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,H.jsx)(Dt,{value:M.cronExpr,onChange:e=>L({...M,cronExpr:e.target.value,scheduleDirty:!0}),placeholder:`30 9 * * *`,style:{fontFamily:`var(--font-mono, monospace)`}}),(0,H.jsx)(Kt,{value:M.tz,onChange:e=>L({...M,tz:e,scheduleDirty:!0}),fallbackTz:we??void 0})]}):M.scheduleKind===`every`?(0,H.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,H.jsx)(Dt,{type:`number`,min:1,value:M.everyValue,onChange:e=>L({...M,everyValue:e.target.value,scheduleDirty:!0}),style:{maxWidth:120}}),(0,H.jsxs)(k,{value:M.everyUnit,onValueChange:e=>L({...M,everyUnit:e,scheduleDirty:!0}),children:[(0,H.jsx)(E,{style:{maxWidth:160},children:(0,H.jsx)(T,{})}),(0,H.jsxs)(D,{children:[(0,H.jsx)(O,{value:`minutes`,children:ee()}),(0,H.jsx)(O,{value:`hours`,children:p()}),(0,H.jsx)(O,{value:`days`,children:ve()})]})]})]}):(0,H.jsx)(Yt,{value:M.at,onChange:e=>L({...M,at:e,scheduleDirty:!0})})]}),M.hasMessage?(0,H.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,H.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:ye()}),(0,H.jsx)(`textarea`,{className:`oc-cronedit__textarea`,rows:4,value:M.message,onChange:e=>L({...M,message:e.target.value,messageDirty:!0})})]}):null]}),(0,H.jsxs)(At,{children:[(0,H.jsx)(N,{variant:`ghost`,onClick:()=>L(null),children:i()}),(0,H.jsxs)(N,{onClick:()=>void mn(),disabled:M===null||M.loading||Ht,children:[Ht?(0,H.jsx)(ut,{size:14,className:`oc-actrow__spin`,"aria-hidden":!0}):null,nt()]})]})]})})]})}export{pn as ScheduledTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$U as r,$W as i,AW as ee,BU as a,BW as te,CW as ne,DW as re,EW as ie,FW as ae,GU as o,GW as oe,HU as se,HW as ce,IW as le,JU as ue,JW as de,KU as fe,KW as pe,LU as s,LW as me,MW as he,NW as ge,OW as _e,PW as ve,QU as c,QW as l,RU as u,RW as ye,SW as be,TW as xe,UU as d,UW as Se,VU as f,VW as Ce,WU as p,WW as we,XU as m,XW as Te,XX as h,YU as g,YW as Ee,YX as _,ZU as v,ZW as y,_W as De,aW as b,bW as Oe,cW as ke,dW as Ae,eG as je,eW as x,fW as Me,gW as Ne,hW as Pe,iW as S,jW as Fe,kW as Ie,lW as Le,mW as Re,nG as ze,nW as C,oW as w,pW as Be,qU as T,qW as Ve,qX as He,rG as Ue,rW as E,sW as We,t as D,tG as Ge,tW as O,uW as Ke,vW as qe,wW as Je,xW as Ye,yW as Xe,zU as k,zW as Ze}from"./api-DSJJn0d7.js";import{n as Qe,t as $e}from"./useNavigate-D3GIoxyW.js";import{t as A}from"./check-DmQzfrws.js";import{r as et}from"./dist-ClkJChBn.js";import{t as tt}from"./chevron-right-C_b_y922.js";import{t as j}from"./copy-BaUCUMp2.js";import{a as M,i as N,n as P,r as F,t as I}from"./select-qM3ZfTHx.js";import{t as L}from"./button-Dio0PVrp.js";import{t as R}from"./input-BSpTsBA6.js";import"./convexApi-CyScjgcq.js";import{r as nt}from"./toast-xNFwDnUy.js";import{t as z}from"./badge-C4po8DQ1.js";import{n as B,t as V}from"./format-DGKgJf2p.js";import{a as H,i as U,n as W,o as G,r as K,t as q}from"./dialog-BfrsWZiD.js";import{n as rt}from"./ConfirmDialog-BXcki0Ee.js";import{t as it}from"./EntitySheet-B2B48bss.js";import{t as at}from"./FilterBar-DTVwlDpF.js";import{t as ot}from"./DataTableShell-DRFFBx_j.js";import{t as st}from"./roleDescriptions-x3mUxTcX.js";var J=t(e(),1),Y=n(),ct=[{value:`never`,label:()=>d(),days:null},{value:`30`,label:()=>se(),days:30},{value:`90`,label:()=>f(),days:90}],X=720*60*60*1e3,Z=`__all__`,Q={name:``,roleKey:``,description:``};function $(){let e=Qe({from:`/settings/serviceAccounts`}),t=$e({from:`/settings/serviceAccounts`}),n=e.q??``,r=e.status??Z,[a,o]=(0,J.useState)(Z),se=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),ue=e=>void t({search:t=>({...t,status:e===Z?void 0:e})}),fe=h(D.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:a===Z?void 0:a,disabled:r===Z?void 0:r===`disabled`}}),s=h(D.apiKeys.listKeys,{}),c=h(D.apiKeys.listRoles,{}),u=_(D.apiKeys.createServiceAccount),d=_(D.apiKeys.updateServiceAccount),f=_(D.apiKeys.deleteServiceAccount),p=He(D.apiKeys.mintApiKey),m=_(D.apiKeys.revokeApiKey),g=rt(),v=nt(),b=n!==``||a!==Z||r!==Z;function x(){o(Z),t({search:{},replace:!0})}let[S,C]=(0,J.useState)(!1),[w,T]=(0,J.useState)(Q),[E,O]=(0,J.useState)(null),[k,A]=(0,J.useState)(new Set),[j,B]=(0,J.useState)(null),V=(0,J.useRef)(!1),[H,U]=(0,J.useState)(new Set),[W,G]=(0,J.useState)({}),[K,q]=(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){A(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:w.name,roleKey:w.roleKey,description:w.description}),v.success(Ye())):await u({name:w.name,roleKey:w.roleKey,description:w.description||void 0}),T(Q),O(null),C(!1)}catch(e){v.error(E?be():ne(),e)}}function ft(e){T({name:e.name,roleKey:e.roleKey,description:e.description??``}),O(e._id),C(!0)}async function pt(e){if(V.current)return;V.current=!0;let t=W[e._id]??`never`,n=ct.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;B(e._id);try{let t=await p({serviceAccountId:e._id,expiresAt:r});q({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){v.error(Oe(),e)}finally{V.current=!1,B(null)}}async function mt(e){if(await g({title:Xe(),description:(0,Y.jsxs)(Y.Fragment,{children:[qe(),` `,(0,Y.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,De(),` `,(0,Y.jsx)(`strong`,{children:Ne()}),` `,Pe()]}),confirmWord:e.name,confirmLabel:Re(),destructive:!0}))try{await f({serviceAccountId:e._id}),v.success(Be(),e.name)}catch(e){v.error(Me(),e)}}async function ht(e){if(await g({title:Ae(),description:(0,Y.jsxs)(Y.Fragment,{children:[Ke(),` `,(0,Y.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,Le()]}),confirmLabel:ke(),destructive:!0})&&!H.has(e._id)){U(t=>new Set(t).add(e._id));try{await m({keyId:e._id})}catch(e){v.error(We(),e)}finally{U(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:Ue()}),(0,Y.jsxs)(at,{q:n,onQChange:se,searchPlaceholder:ze(),onReset:x,canReset:b,children:[(0,Y.jsxs)(I,{value:a,onValueChange:o,children:[(0,Y.jsx)(N,{size:`sm`,className:`w-40`,children:(0,Y.jsx)(M,{placeholder:Ge()})}),(0,Y.jsxs)(P,{children:[(0,Y.jsx)(F,{value:Z,children:je()}),(c??[]).map(e=>(0,Y.jsx)(F,{value:e.key,children:e.key},e._id))]})]}),(0,Y.jsxs)(I,{value:r,onValueChange:ue,children:[(0,Y.jsx)(N,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(M,{})}),(0,Y.jsxs)(P,{children:[(0,Y.jsx)(F,{value:Z,children:i()}),(0,Y.jsx)(F,{value:`active`,children:l()}),(0,Y.jsx)(F,{value:`disabled`,children:y()})]})]})]}),(0,Y.jsx)(ot,{title:Te(),rows:fe,addLabel:Ee(),onAdd:()=>{T(Q),O(null),C(!0)},emptyHint:de(),isExpanded:e=>k.has(e._id),renderExpanded:e=>(0,Y.jsx)(lt,{account:e,keys:X.get(e._id)??[],onRevoke:ht,revoking:H}),rowActions:e=>[...(e.managedBy??null)===null?[{label:we(),onSelect:()=>ft(e)},{label:Ve(),onSelect:()=>void pt(e)}]:[],{label:k.has(e._id)?pe():oe(),onSelect:()=>$(e._id)},...(e.managedBy??null)===null?[{label:Se(),variant:`destructive`,onSelect:()=>void mt(e)}]:[]],columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(L,{variant:`ghost`,size:`icon-sm`,"aria-label":k.has(e._id)?ce():Ce(),onClick:()=>$(e._id),children:k.has(e._id)?(0,Y.jsx)(et,{}):(0,Y.jsx)(tt,{})})},{header:te(),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:Ze(),sort:e=>e.roleKey,cell:e=>(0,Y.jsx)(z,{variant:`secondary`,children:e.roleKey})},{header:ye(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,Y.jsx)(z,{variant:`destructive`,children:y()}):(0,Y.jsx)(z,{variant:`outline`,children:l()})},{header:me(),cell:e=>(0,Y.jsxs)(I,{value:W[e._id]??`never`,onValueChange:t=>G(n=>({...n,[e._id]:t})),children:[(0,Y.jsx)(N,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(M,{})}),(0,Y.jsx)(P,{children:ct.map(e=>(0,Y.jsx)(F,{value:e.value,children:e.label()},e.value))})]})},{header:le(),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:j===e._id?ae():ve({count:t})})}}]}),(0,Y.jsx)(it,{open:S,onOpenChange:e=>{C(e),e||O(null)},title:E?ge():ee(),description:E?he():Ie(),canSubmit:!!(w.name&&w.roleKey),onSubmit:dt,submitLabel:E?Fe():_e(),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:re()}),(0,Y.jsx)(R,{value:w.name,onChange:e=>T({...w,name:e.target.value})})]}),(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:ie()}),(0,Y.jsxs)(I,{value:w.roleKey||void 0,onValueChange:e=>T({...w,roleKey:e}),children:[(0,Y.jsx)(N,{className:`w-full`,children:(0,Y.jsx)(M,{placeholder:xe()})}),(0,Y.jsx)(P,{children:(c??[]).map(e=>(0,Y.jsxs)(F,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(c??[]).find(e=>e.key===w.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:Je()}),(0,Y.jsx)(R,{value:w.description,onChange:e=>T({...w,description:e.target.value})})]})]})}),(0,Y.jsx)(ut,{minted:K,onClose:()=>q(null)})]})}function lt({account:e,keys:t,onRevoke:n,revoking:i}){return(0,Y.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,Y.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[w(),` `,(0,Y.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:b()}):(0,Y.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`th`,{children:S()}),(0,Y.jsx)(`th`,{children:E()}),(0,Y.jsx)(`th`,{children:C()}),(0,Y.jsx)(`th`,{children:O()}),(0,Y.jsx)(`th`,{children:x()}),(0,Y.jsx)(`th`,{children:r()}),(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)(z,{variant:`secondary`,children:e.roleKey})}),(0,Y.jsx)(`td`,{children:B(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)(L,{variant:`destructive`,size:`sm`,disabled:i.has(t._id),onClick:()=>n(t),children:i.has(t._id)?c():v()}):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)(q,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,Y.jsxs)(W,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,Y.jsxs)(H,{children:[(0,Y.jsx)(G,{children:m()}),(0,Y.jsx)(K,{children:g({name:e.accountName})})]}),(0,Y.jsx)(`div`,{className:`oc-sa__minted-warning`,children:ue()}),(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)(L,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":T(),children:[n?(0,Y.jsx)(A,{}):(0,Y.jsx)(j,{}),n?fe():o()]})]}),(0,Y.jsx)(U,{children:(0,Y.jsx)(L,{onClick:()=>{r(!1),t()},children:p()})})]}):null})}function dt(e){return e!==null&&Date.now()-e>X}function ft(e){return e===null?a():B(e)}function pt(e){return e===null?`—`:V(e)}function mt(e){return e.disabled?(0,Y.jsx)(z,{variant:`destructive`,children:k()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,Y.jsx)(z,{variant:`outline`,children:u()}):(0,Y.jsx)(z,{variant:`outline`,children:s()})}export{$ as ServiceAccountsTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$m as r,Am as i,Bm as a,Cm as o,Dm as s,Em as c,Fm as l,Gm as u,Hm as d,Im as f,Jm as p,Km as m,Lm as h,Mm as g,Nm as _,Om as v,Pm as y,Qm as b,Rm as x,Sm as S,Tm as C,Um as w,Vm as T,Wm as E,XX as D,Xm as O,YX as k,Ym as A,Zm as j,ah as M,eh as N,ih as P,jm as F,km as I,nh as ee,qm as L,rh as R,t as z,th as B,wm as V,xm as H,zm as U}from"./api-DSJJn0d7.js";import{t as W}from"./button-Dio0PVrp.js";import"./convexApi-CyScjgcq.js";import{n as G}from"./format-DGKgJf2p.js";import{n as K}from"./ConfirmDialog-BXcki0Ee.js";import{t as q}from"./DataTableShell-DRFFBx_j.js";var J=t(e(),1),Y=n(),X={hung:()=>d(),wrong_result:()=>T(),error:()=>a(),other:()=>U()},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=k(z.subAgentReports.respondToReport),[r,a]=(0,J.useState)(e.thread),[o,u]=(0,J.useState)(``),[d,p]=(0,J.useState)(!1);async function m(){let t=o.trim();if(!(!t||d)){p(!0);try{await n({reportId:e._id,text:t}),a(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),u(``)}finally{p(!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),` · `,x({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:h()}),(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:f()}),r.length>0?(0,Y.jsx)(`div`,{className:`oc-fbadmin__thread`,children:r.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`?l():y()}),(0,Y.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Y.jsx)(`p`,{className:`oc-fbadmin__meta`,children:_()}),(0,Y.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:g(),value:o,maxLength:2e3,rows:3,onChange:e=>u(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 m(),disabled:!o.trim()||d,children:d?i():F()})})]}),(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[I({count:t.children.length}),t.childrenTruncated?` ${v()}`:``,t.textTruncated?` ${s()}`:``]}),(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?` · ${c()}`:``]}),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:C()}),(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:V()}),(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=D(z.subAgentReports.listForAdmin,{}),t=k(z.subAgentReports.readReport),n=k(z.subAgentReports.deleteReport),i=K(),[a,s]=(0,J.useState)(null),[c,l]=(0,J.useState)({});async function d(e){if(a===e._id){s(null);return}if(!c[e._id]){let n=await t({reportId:e._id});l(t=>({...t,[e._id]:n}))}s(e._id)}async function f(e){await i({title:o(),description:S(),confirmLabel:H(),destructive:!0})&&(await n({reportId:e._id}),a===e._id&&s(null))}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[R(),` `,(0,Y.jsx)(`strong`,{children:ee()}),` `,B()]}),(0,Y.jsx)(q,{title:M(),rows:e,emptyHint:P(),isExpanded:e=>a===e._id&&!!c[e._id],renderExpanded:e=>c[e._id]?(0,Y.jsx)($,{data:c[e._id]}):null,columns:[{header:N(),cell:e=>G(e.at),sort:e=>e.at},{header:r(),cell:e=>Z(e.category),sort:e=>Z(e.category)},{header:b(),cell:e=>`${e.failedCount}/${e.totalCount}`,sort:e=>e.failedCount},{header:j(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${p({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:O(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:A(),cell:e=>e.answered?(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:L()}):(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill`,children:m()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:a===e._id?E():u(),onSelect:()=>void d(e)},{label:w(),onSelect:()=>void f(e),variant:`destructive`}]})]})}export{te as SubAgentReportsTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$G as r,$K as i,AK as a,BK as o,CK as s,DK as c,EK as l,FK as u,GG as d,GK as f,HK as p,IK as m,IX as h,JG as g,JK as ee,KG as _,KK as v,LK as te,LX as ne,MK as re,NK as ie,OK as ae,PK as oe,QG as y,QK as se,RK as ce,RX as le,SK as ue,TK as de,UK as fe,VK as pe,WG as me,WK as he,XG as ge,XK as _e,XX as b,YG as ve,YK as ye,YX as x,ZG as be,ZK as xe,_K as Se,_m as Ce,aK as we,aq as Te,bK as Ee,bm as S,cK as De,cq as Oe,dK as ke,dq as Ae,eK as je,eq as Me,fK as Ne,fq as Pe,gK as Fe,hK as Ie,iK as Le,iq as Re,jK as ze,kK as C,lK as Be,lq as Ve,mK as He,nK as Ue,nq as w,oK as We,oq as Ge,pK as Ke,qG as qe,qK as Je,qX as Ye,r as Xe,rK as Ze,rq as Qe,sK as $e,sq as et,t as T,tK as tt,tq as nt,uK as E,uq as rt,vK as it,vm as at,wK as ot,xK as st,yK as ct,ym as D,zK as lt}from"./api-DSJJn0d7.js";import{t as O}from"./check-DmQzfrws.js";import{c as ut,g as k,i as dt,n as ft,r as A,s as j,t as pt}from"./dropdown-menu-DHMOOlaP.js";import{t as mt}from"./download-DWgC7zCa.js";import{t as M}from"./checkbox-CsI4ggnp.js";import{i as N,n as ht,r as gt}from"./useChart-CKFEN42T.js";import{t as P}from"./x-CK8d5DC1.js";import{a as F,i as I,n as L,r as R,t as z}from"./select-qM3ZfTHx.js";import{t as B}from"./button-Dio0PVrp.js";import{t as V}from"./input-BSpTsBA6.js";import"./convexApi-CyScjgcq.js";import{t as H}from"./badge-C4po8DQ1.js";import{t as U}from"./appHost-CH3EGcJw.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-CerX9wDn.js";import{a as wt,i as W,n as Tt,o as G,r as K,t as Et}from"./table-D2SJC960.js";import{t as Dt}from"./TimeRangePicker-D3PJq1H8.js";import{t as Ot}from"./FilterBar-DTVwlDpF.js";import{t as kt}from"./AdvancedFilter-Bb66m5kb.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(Ke());if(e.size>Lt)throw Error(Ne());let{source:n,width:r,height:i,cleanup:a}=await Ht(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Rt/r,zt/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(E());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=Nt(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(E());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);J(e.data,d.width,d.height)?Ft(e.data,t.variantFor===`dark`?jt:Mt):It(e.data),p.putImageData(e,0,0)}let m=J(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await Y(f,`image/webp`,Bt)??await Y(f,`image/png`);if(!h)throw Error(Be());return{blob:h,hasAlpha:m}}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(ke())),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`?le():e===`dark`?ne():h()}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:Xe(`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)(O,{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)(B,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":S(),title:S(),children:(0,X.jsx)(mt,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=b(T.charts.listMyCharts),r=x(T.charts.setMyChart);async function a(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:Re()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Qe()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:w(),subtitle:nt(),tokens:null,mode:t,onSelect:()=>void a(null)}),(n??[]).map(n=>{let r=n.via===`common`?Me():n.via===`owner`?i():se({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 a(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:xe()}):null]})}function Qt(){let e=x(T.charts.importChart),[t,n]=(0,q.useState)(``),[r,i]=(0,q.useState)(``),[o,s]=(0,q.useState)(null),[l,d]=(0,q.useState)(!1),[f,p]=(0,q.useState)(!1);async function h(e){let t=e.target.files?.[0];if(e.target.value=``,t){s(null),d(!1);try{let e=await t.text();i(e)}catch{s(C())}}}async function g(){if(s(null),d(!1),t.trim()===``){s(c());return}let a;try{a=JSON.parse(r)}catch{s(C());return}p(!0);try{await e({name:t.trim(),tokens:a}),d(!0),n(``),i(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{p(!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:te()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:m()})]}),(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:u()}),(0,X.jsx)(V,{value:t,onChange:e=>n(e.target.value),placeholder:oe(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:ie()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:re(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(B,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(N,{className:`size-4`}),ze(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void h(e)})]})}),(0,X.jsx)(B,{size:`sm`,disabled:f,onClick:()=>void g(),children:a()})]}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null,l?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:ae()}):null]})]})}function $t({chart:e}){let t=Ye(T.charts.setChartLogo),n=x(T.charts.removeChartLogo),[r,i]=(0,q.useState)(!1),[a,o]=(0,q.useState)(null),s=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function c(n,r,a){if(e.chartId!==void 0){o(null),i(!0);try{let{blob:i,hasAlpha:o}=await Vt(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function l(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await c(e,n)}async function u(t){if(e.chartId!==void 0){o(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function d(e){let t=s(e===`light`?`dark`:`light`);if(t){o(null),i(!0);try{await c(e,await(await fetch(t)).blob(),e)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function f({mode:e}){let t=s(e),n=s(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`?Ee():ct()}),(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)(B,{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?Se():it(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void l(e,t)})]})}),!t&&n?(0,X.jsx)(B,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:Ie()}):null,t?(0,X.jsx)(B,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void u(e),children:Fe()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:st()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(f,{mode:`light`}),(0,X.jsx)(f,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:He()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function en({chart:e}){let t=b(T.me.getMe,{host:U}),n=x(T.charts.addChartDomain),r=x(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:De()}),(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:Le()}):u.map(e=>(0,X.jsxs)(H,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Ze({domain:e}),onClick:()=>void f(e),children:(0,X.jsx)(P,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(V,{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)(B,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void d(),children:we()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:$e()}),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=x(T.charts.updateChart),n=x(T.charts.deleteChart),[i,a]=(0,q.useState)(!1),[o,c]=(0,q.useState)(e.name),[l,u]=(0,q.useState)(()=>$(e.tokens)),[d,f]=(0,q.useState)(e.tokens.bpm??0),[p,m]=(0,q.useState)(null),[h,g]=(0,q.useState)(!1);function ee(){c(e.name),u($(e.tokens)),f(e.tokens.bpm??0),m(null),a(!0)}async function _(){if(e.chartId===void 0)return;m(null);let n;try{n=JSON.parse(l)}catch{m(C());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;d>0?e.bpm=d:delete e.bpm}g(!0);try{await t({chartId:e.chartId,name:o.trim(),tokens:n}),a(!1)}catch(e){m(e instanceof Error?e.message:String(e))}finally{g(!1)}}async function v(){if(e.chartId!==void 0&&window.confirm(y()))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:i?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(B,{variant:`outline`,size:`sm`,onClick:ee,children:s()}),(0,X.jsx)(B,{variant:`ghost`,size:`sm`,onClick:()=>void v(),children:ue()})]})})]}),i?(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:je()}),(0,X.jsx)(V,{value:o,onChange:e=>c(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:D()}),(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:d,onChange:e=>f(Number(e.target.value)),"aria-label":D()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:d===0?at():`${d} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ce()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:r()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:l,onChange:e=>u(e.target.value),rows:10,spellCheck:!1})]}),p?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:p}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(B,{size:`sm`,disabled:h,onClick:()=>void _(),children:Ue()}),(0,X.jsx)(B,{variant:`ghost`,size:`sm`,onClick:()=>a(!1),children:tt()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function nn(){let e=b(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:l()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:de()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ot()}):(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=x(T.charts.addChartToGroupPool),r=x(T.charts.removeChartFromGroupPool),i=e.restrictedToGroups,a=e.poolGroups,s=new Set((a??[]).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 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)(H,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?fe():e.kind===`custom`&&e.scope===`personal`?g():he()}),e.isGlobalDefault?(0,X.jsx)(H,{variant:`default`,children:p()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:o()}),(a??[]).map(e=>(0,X.jsxs)(H,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":ce({group:e.name}),onClick:()=>void u(e.groupId),children:(0,X.jsx)(P,{className:`size-3`})})]},e.groupId)),c.length>0?(0,X.jsxs)(z,{value:``,onValueChange:e=>void l(e),children:[(0,X.jsx)(I,{size:`sm`,className:`w-56`,children:(0,X.jsx)(F,{placeholder:lt()})}),(0,X.jsx)(L,{children:c.map(e=>(0,X.jsx)(R,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:pe()}):null]})]})}function an({chart:e}){let t=x(T.charts.promoteChartToCommon),n=x(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(y()))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)(H,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?qe():g()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ve({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:_()}):null,(0,X.jsx)(B,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:d()})]})]})}function on({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=x(T.admin.setDefaultThemeMode),i=x(T.admin.setDefaultLocale),a=x(T.charts.setDefaultChart),o=b(T.charts.listChartsAdmin),s=b(T.groups.listGroups,{}),c=e??`system`,l=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:Ge()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Te()})]}),(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:_e()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ye()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(B,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void a({name:null}),children:w()}),gt.map(e=>(0,X.jsx)(B,{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)(B,{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:Je()})]}),(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:s??[]},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:v()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:f()})]}),(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:be()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ge()})]}),(()=>{let e=(o??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:me()}):(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:Pe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ae()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(B,{variant:c===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:rt()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ve()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:_t().map(e=>(0,X.jsx)(B,{variant:l===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:Oe()})]})]})}function sn(){let e=b(T.me.getMe,{host:U}),t=ht(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:et()}),(0,X.jsxs)(Q,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(B,{children:`Default`}),(0,X.jsx)(B,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(B,{variant:`outline`,children:`Outline`}),(0,X.jsx)(B,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(B,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(B,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(B,{size:`sm`,children:`Small`}),(0,X.jsx)(B,{children:`Default`}),(0,X.jsx)(B,{size:`lg`,children:`Large`}),(0,X.jsx)(B,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(k,{})}),(0,X.jsx)(B,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)(Q,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(H,{children:`Default`}),(0,X.jsx)(H,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(H,{variant:`outline`,children:`Outline`}),(0,X.jsx)(H,{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)(V,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(z,{value:n,onValueChange:r,children:[(0,X.jsx)(I,{className:`w-56`,children:(0,X.jsx)(F,{placeholder:`Select…`})}),(0,X.jsxs)(L,{children:[(0,X.jsx)(R,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(R,{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)(z,{value:o,onValueChange:s,children:[(0,X.jsx)(I,{size:`sm`,children:(0,X.jsx)(F,{})}),(0,X.jsxs)(L,{children:[(0,X.jsx)(R,{value:Z,children:`Toutes directions`}),(0,X.jsx)(R,{value:`inbound`,children:`inbound`}),(0,X.jsx)(R,{value:`outbound`,children:`outbound`}),(0,X.jsx)(R,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(z,{value:c,onValueChange:l,children:[(0,X.jsx)(I,{size:`sm`,children:(0,X.jsx)(F,{})}),(0,X.jsxs)(L,{children:[(0,X.jsx)(R,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(R,{value:`info`,children:`info`}),(0,X.jsx)(R,{value:`warn`,children:`warn`}),(0,X.jsx)(R,{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)(pt,{children:[(0,X.jsx)(ut,{asChild:!0,children:(0,X.jsx)(B,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(k,{})})}),(0,X.jsxs)(ft,{align:`start`,children:[(0,X.jsx)(dt,{children:`Actions`}),(0,X.jsx)(j,{}),(0,X.jsx)(A,{children:`Edit`}),(0,X.jsx)(A,{children:`Duplicate`}),(0,X.jsx)(j,{}),(0,X.jsx)(A,{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)(B,{size:`sm`,children:`Save`}),(0,X.jsx)(B,{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)(H,{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)(O,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(K,{children:(0,X.jsx)(B,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(k,{})})})]},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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$d as r,BO as i,GO as a,HO as o,JO as s,KO as c,LO as l,Qd as u,RO as d,UO as f,VO as p,WO as m,Xd as h,YO as g,Zd as _,ef as v,nf as y,qO as b,tf as x,zO as S}from"./api-DSJJn0d7.js";import{n as C,t as w}from"./search-BK6bzZNi.js";import{i as T,n as E,r as D,t as O}from"./dist-ChrIV8UV.js";import{t as k}from"./button-Dio0PVrp.js";import{t as A}from"./input-BSpTsBA6.js";import{n as j}from"./format-DGKgJf2p.js";var M=t(e(),1),N={s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5};function P(e,t){let n=e.trim();if(n===`now`)return t;let r=/^now-(\d+)([smhdw])$/.exec(n);if(r===null)return null;let i=Number(r[1]),a=N[r[2]];return!Number.isFinite(i)||a===void 0?null:t-i*a}function F(e,t=Date.now()){return e.kind===`absolute`?{from:e.from,to:e.to}:{from:P(e.from,t)??t-N.h,to:P(e.to,t)??t}}var I=[{label:g(),from:`now-5m`},{label:s(),from:`now-15m`},{label:b(),from:`now-30m`},{label:c(),from:`now-1h`},{label:a(),from:`now-3h`},{label:m(),from:`now-6h`},{label:f(),from:`now-12h`},{label:o(),from:`now-24h`},{label:p(),from:`now-2d`},{label:i(),from:`now-7d`},{label:S(),from:`now-30d`},{label:d(),from:`now-90d`},{label:l(),from:`now-520w`}];function L(e){return j(e,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}function R(e){if(e.kind===`relative`){let t=I.find(t=>t.from===e.from&&e.to===`now`);return t?t.label:`${e.from} → ${e.to}`}return`${L(e.from)} → ${L(e.to)}`}function z(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function B(e){if(e===``)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function V(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:t!==``&&Number.isFinite(Number(t))?Number(t):e}var H=n();function U(e){let[t,n]=(0,M.useState)(0);return(0,M.useEffect)(()=>{if(e.kind!==`relative`)return;let t=window.setInterval(()=>n(e=>e+1),3e4);return()=>window.clearInterval(t)},[e.kind]),(0,M.useMemo)(()=>{let{from:t,to:n}=F(e);return e.kind===`absolute`?{from:t,to:n}:{from:W(t),to:W(n)}},[e,t])}function W(e){return Math.floor(e/6e4)*6e4}function G({value:e,onChange:t}){let[n,i]=(0,M.useState)(!1),[a,o]=(0,M.useState)(``),s=F(e),[c,l]=(0,M.useState)(()=>z(s.from)),[d,f]=(0,M.useState)(()=>z(s.to));function p(t){if(t){let t=F(e);l(z(t.from)),f(z(t.to)),o(``)}i(t)}function m(e){t({kind:`relative`,from:e,to:`now`}),i(!1)}function g(){let e=B(c),n=B(d);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),i(!1))}let b=(0,M.useMemo)(()=>{let e=a.trim().toLowerCase();return e===``?I:I.filter(t=>t.label.toLowerCase().includes(e)||t.from.toLowerCase().includes(e))},[a]),S=B(c)!==null&&B(d)!==null;return(0,H.jsxs)(D,{open:n,onOpenChange:p,children:[(0,H.jsx)(T,{asChild:!0,children:(0,H.jsxs)(k,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,H.jsx)(C,{}),R(e)]})}),(0,H.jsx)(E,{children:(0,H.jsx)(O,{align:`end`,sideOffset:6,className:`oc-timerange__panel oc-overlay-layer rounded-lg border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,children:(0,H.jsxs)(`div`,{className:`oc-timerange__cols`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__absolute`,children:[(0,H.jsx)(`div`,{className:`oc-timerange__section-title`,children:y()}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:x()}),(0,H.jsx)(A,{type:`datetime-local`,value:c,onChange:e=>l(e.target.value)})]}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:v()}),(0,H.jsx)(A,{type:`datetime-local`,value:d,onChange:e=>f(e.target.value)})]}),(0,H.jsx)(k,{size:`sm`,className:`oc-timerange__apply`,disabled:!S,onClick:g,children:r()})]}),(0,H.jsxs)(`div`,{className:`oc-timerange__relative`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__search`,children:[(0,H.jsx)(w,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,H.jsx)(A,{value:a,onChange:e=>o(e.target.value),placeholder:u(),"aria-label":_()})]}),(0,H.jsx)(`ul`,{className:`oc-timerange__list`,children:b.length===0?(0,H.jsx)(`li`,{className:`oc-timerange__empty`,children:h()}):b.map(t=>(0,H.jsx)(`li`,{children:(0,H.jsx)(`button`,{type:`button`,className:`oc-timerange__option`+(e.kind===`relative`&&e.from===t.from&&e.to===`now`?` is-active`:``),onClick:()=>m(t.from),children:t.label})},t.from))})]})]})})})]})}export{U as n,V as r,G as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{dJ as r,fJ as i,mJ as a,pJ as o}from"./api-DSJJn0d7.js";import{t as s}from"./check-DmQzfrws.js";import{t as c}from"./chevrons-up-down-Pva00Np5.js";import{n as l,r as u,t as d}from"./popover-DBaIbsBr.js";import{t as f}from"./input-BSpTsBA6.js";/* empty css */var p=t(e(),1);function m(e){if(e==null||e===``)return`none`;let t=e.trim().toLowerCase();return t===`ok`||t===`success`||t===`completed`?`ok`:t===`error`||t===`failed`||t===`failure`?`error`:t===`running`||t===`in_progress`||t===`pending`?`running`:`other`}function h(e){return e===!0?`active`:e===!1?`paused`:`unknown`}function g(e){return typeof e.autoDisabledReason==`string`&&e.autoDisabledReason!==``?`auto-disabled`:h(e.enabled)}function _(e){return g(e)===`active`?`pause`:`resume`}var v={q:``,state:`all`,result:`all`};function y(e){return e.q.trim()!==``||e.state!==`all`||e.result!==`all`}function b(e,t){let n=t.q.trim().toLowerCase();return!(n!==``&&!`${e.name??``} ${e.agentId}`.toLowerCase().includes(n)||t.state!==`all`&&g(e)!==t.state||t.result!==`all`&&m(e.lastRunStatus)!==t.result)}function x(){try{let e=Intl.supportedValuesOf;return typeof e==`function`?e(`timeZone`):[]}catch{return[]}}function S(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone??``}catch{return``}}function C(e,t,n=50,r){let i=e=>e.toLowerCase().replace(/[_/]+/g,` `),a=i(t.trim()),o=(a===``?e:e.filter(e=>i(e).includes(a))).slice(0,n);return r&&r!==``&&!o.includes(r)?[r,...o].slice(0,n):o}function w(e,t){let n=(new Date(e,t,1).getDay()+6)%7,r=new Date(e,t,1-n),i=[];for(let e=0;e<42;e++){let n=new Date(r.getFullYear(),r.getMonth(),r.getDate()+e);i.push({year:n.getFullYear(),month:n.getMonth(),day:n.getDate(),inMonth:n.getMonth()===t})}return i}function T(e,t,n,r,i){let a=(e,t=2)=>String(e).padStart(t,`0`);return`${a(e,4)}-${a(t+1)}-${a(n)}T${a(r)}:${a(i)}`}function E(e){let t=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})$/.exec(e);if(t===null)return null;let[,n,r,i,a,o]=t;return{year:Number(n),month:Number(r)-1,day:Number(i),hour:Number(a),minute:Number(o)}}var D=n();function O({value:e,onChange:t,className:n,fallbackTz:m}){let h=(0,p.useMemo)(()=>x(),[]),[g,_]=(0,p.useState)(!1),[v,y]=(0,p.useState)(``);if(h.length===0)return(0,D.jsx)(f,{value:e,onChange:e=>t(e.target.value),placeholder:m||S()||`America/Toronto`,className:n});let b=C(h,v,h.length,e||void 0),w=e===``?m||S()||r():e;return(0,D.jsxs)(d,{modal:!0,open:g,onOpenChange:e=>{_(e),e||y(``)},children:[(0,D.jsx)(u,{asChild:!0,children:(0,D.jsxs)(`button`,{type:`button`,className:`oc-tzcombo__trigger${n?` ${n}`:``}`,"aria-label":a(),children:[(0,D.jsx)(`span`,{className:`oc-tzcombo__value`,children:w}),(0,D.jsx)(c,{size:14,"aria-hidden":!0,className:`oc-tzcombo__chev`})]})}),(0,D.jsxs)(l,{align:`start`,className:`oc-tzcombo__pop p-0`,children:[(0,D.jsx)(f,{autoFocus:!0,value:v,onChange:e=>y(e.target.value),placeholder:o(),className:`oc-tzcombo__search`}),(0,D.jsx)(`div`,{className:`oc-tzcombo__list`,role:`listbox`,children:b.length===0?(0,D.jsx)(`p`,{className:`oc-tzcombo__empty`,children:i()}):b.map(n=>(0,D.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":n===e,className:`oc-tzcombo__opt`,onClick:()=>{t(n),_(!1),y(``)},children:[(0,D.jsx)(s,{size:13,"aria-hidden":!0,className:`oc-tzcombo__check`,style:{opacity:+(n===e)}}),(0,D.jsx)(`span`,{children:n})]},n))})]})]})}export{b as a,w as c,_ as i,E as l,v as n,g as o,y as r,m as s,O as t,T as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$j as r,Aj as i,Az as a,Bj as o,Bz as s,Cj as c,Dj as l,Dz as u,E as d,Ej as f,Ez as p,Fj as m,Fz as h,Gj as g,Gu as _,Gz as v,Hj as y,Hz as b,Ij as x,Iz as S,Jj as ee,Jz as C,Kj as te,Ku as w,Kz as T,Lj as ne,Lz as E,Mj as re,Mz as ie,Nj as ae,Nz as oe,Oj as se,Oz as D,Pj as ce,Pz as O,Qj as le,Rj as ue,Rz as de,Sj as fe,Tj as pe,Tz as k,Uj as me,Uz as A,Vj as he,Vz as j,Wj as ge,Wz as M,XX as N,Xj as _e,YX as P,Yj as ve,Yz as ye,Zj as be,_z as xe,aM as Se,bz as Ce,cz as we,dz as Te,eM as Ee,fz as De,gz as Oe,hz as F,iM as ke,jj as Ae,jz as je,kj as Me,kz as Ne,lz as Pe,mz as Fe,nM as Ie,oz as Le,pz as Re,qj as ze,qu as Be,qz as Ve,rM as He,sz as Ue,t as I,tM as We,uz as Ge,vz as Ke,wj as qe,yz as Je,zj as Ye,zz as Xe}from"./api-DSJJn0d7.js";import{n as Ze,t as Qe}from"./useNavigate-D3GIoxyW.js";import{t as $e}from"./check-DmQzfrws.js";import{t as et}from"./copy-BaUCUMp2.js";import{n as tt,t as nt}from"./eye-B-ipuYEd.js";import{o as rt,r as it}from"./deliveryRecorder-C7NQZrrH.js";import{t as at}from"./x-CK8d5DC1.js";import{a as L,i as R,n as z,r as B,t as V}from"./select-qM3ZfTHx.js";import{i as H,n as U,r as ot,t as st}from"./tabs-mZfLmn2f.js";import{t as W}from"./button-Dio0PVrp.js";import"./convexApi-CyScjgcq.js";import{t as G}from"./badge-C4po8DQ1.js";import{a as ct,n as K}from"./format-DGKgJf2p.js";import{a as lt,n as ut,o as dt,r as ft,t as pt}from"./dialog-BfrsWZiD.js";import{c as mt,o as ht,s as gt,u as _t}from"./searchSchemas-CS2ZgsHC.js";import{t as vt}from"./appHost-CH3EGcJw.js";import{n as yt}from"./TimeRangePicker-D3PJq1H8.js";import{t as bt}from"./FilterBar-DTVwlDpF.js";import{t as xt}from"./AdvancedFilter-Bb66m5kb.js";import{t as St}from"./DataTableShell-DRFFBx_j.js";var Ct=d(`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`?a():n===`agent`?`${Ne()} - ${r}`:e}function Tt(){let e=N(I.me.getMe,{host:vt})?.role===`admin`,t=N(I.deliveryTiming.getDeliveryStatus,{}),n=P(I.deliveryTiming.startDeliveryRecord),r=P(I.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:ye()}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:C()})]}),e?(0,J.jsx)(W,{variant:c?`destructive`:`default`,size:`sm`,disabled:o||t===void 0,onClick:()=>void l(),children:c?T():Ve()}):null]}),c?(0,J.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,J.jsx)(G,{variant:`secondary`,children:v()}),t?.startedAt?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:M({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?j():b()})}),i?(0,J.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=N(I.deliveryTiming.listDeliverySessions,{}),n=P(I.deliveryTiming.deleteDeliverySessions),[r,i]=(0,q.useState)(``),[a,o]=(0,q.useState)(`all`),[c,l]=(0,q.useState)(Y),[d,f]=(0,q.useState)(null),{from:m,to:g}=yt(c),_=c.to===`now`?1/0:g,v=r.trim()!==``||a!==`all`||c!==Y,y=()=>{i(``),o(`all`),l(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))&&(a===`all`||(a===`active`?t.active:!t.active))&&t.startedAt>=m&&t.startedAt<=_).map(e=>({...e,_id:e.sessionId}))},[t,r,a,m,_]),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)(bt,{q:r,onQChange:i,searchPlaceholder:Xe(),timeRange:c,onTimeRangeChange:l,onReset:y,canReset:v,children:(0,J.jsxs)(V,{value:a,onValueChange:e=>o(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:de()}),(0,J.jsx)(B,{value:`active`,children:E()}),(0,J.jsx)(B,{value:`stopped`,children:S()})]})]})}),(0,J.jsx)(St,{title:s(),rows:b,emptyHint:Ue(),columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(W,{variant:`ghost`,size:`icon`,"aria-label":d===e.sessionId?u():D(),onClick:()=>f(t=>t===e.sessionId?null:e.sessionId),children:d===e.sessionId?(0,J.jsx)(tt,{size:15,"aria-hidden":!0}):(0,J.jsx)(nt,{size:15,"aria-hidden":!0})})},{header:h(),sort:e=>e.startedAt,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:K(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:K(e.stoppedAt)})},{header:oe(),sort:e=>e.count,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:X(e.count)})},{header:ie(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:je(),sort:e=>e.active,cell:e=>e.active?(0,J.jsx)(G,{variant:`secondary`,children:E()}):(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:S()})}],rowActions:e?e=>[{label:p(),variant:`destructive`,onSelect:()=>x([e.sessionId])}]:void 0,bulkActions:e?[{label:p(),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=N(I.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:k()});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,` `,Le()]}),(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?we():Pe()]})]}),(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:Ke()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:xe()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:Oe()})]})}),(0,J.jsxs)(`tbody`,{children:[i(F(),r.bridge),i(Fe(),r.A),i(Re(),r.C)]})]}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:De()}),e.truncated?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Ge()}):null,(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Te()})]})}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:Be()},{value:`principalType`,label:w()},{value:`direction`,label:`direction`},{value:`roleKey`,label:_()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function Ft(){let e=Ze({from:`/settings/traces`}),t=Qe({from:`/settings/traces`}),n=e.limit,a=e.kind,s=e.statusClass??Q,c=e.principalType??Q,u=e.direction??Q,d=e.roleKey??Q,p=e.q??``,h=e.correlationId,_=ht(e.from,e.to),v=(0,q.useMemo)(()=>_t(e.adv),[e.adv]),{from:b,to:S}=yt(_),[C,w]=(0,q.useState)(null),[T,E]=(0,q.useState)(null),ie=e=>void t({search:t=>({...t,limit:e})}),oe=e=>void t({search:t=>({...t,kind:e})}),D=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),O=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),de=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),fe=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),k=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),A=e=>void t({search:t=>({...t,...mt(e)})}),j=e=>void t({search:t=>({...t,adv:gt(e)}),replace:!0}),M=N(I.observability.listEvents,{limit:n}),P=N(I.observability.listEvents,{limit:n,kind:a===Z?void 0:a,...h?{correlationId:h}:{},filter:{q:p||void 0,from:b,to:S,statusClass:s===Q?void 0:s,principalType:c===Q?void 0:c,direction:u===Q?void 0:u,roleKey:d===Q?void 0:d,advanced:v.length>0?v:void 0}}),ye=(0,q.useMemo)(()=>{let e=new Set;for(let t of M??[])e.add(t.kind);return[...e].sort()},[M]),xe=(0,q.useMemo)(()=>{let e=new Set;for(let t of M??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[M]),we=p!==``||s!==Q||c!==Q||u!==Q||d!==Q||v.length>0||_.kind!==`relative`||_.from!==Nt.from;function Te(){t({search:{limit:100,kind:`all`},replace:!0})}let De=C?M?.filter(e=>e.correlationId===C):P,Oe=e.section,F=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,J.jsxs)(st,{value:Oe,onValueChange:e=>F(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}),Ce()]}),(0,J.jsxs)(H,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(Ct,{size:13,"aria-hidden":!0}),Je()]})]}),(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:[Se(),(0,J.jsx)(`strong`,{children:ke()}),He(),` `,(0,J.jsx)(`span`,{className:`oc-filter__window`,children:Ie()})]}),(0,J.jsxs)(bt,{q:p,onQChange:D,searchPlaceholder:We(),timeRange:_,onTimeRangeChange:A,onReset:Te,canReset:we,children:[(0,J.jsxs)(V,{value:s,onValueChange:O,children:[(0,J.jsx)(R,{size:`sm`,className:`w-32`,children:(0,J.jsx)(L,{placeholder:Ee()})}),(0,J.jsxs)(z,{children:[(0,J.jsx)(B,{value:Q,children:r()}),At.map(e=>(0,J.jsx)(B,{value:e,children:e},e))]})]}),(0,J.jsxs)(V,{value:c,onValueChange:de,children:[(0,J.jsx)(R,{size:`sm`,className:`w-32`,children:(0,J.jsx)(L,{placeholder:le()})}),(0,J.jsxs)(z,{children:[(0,J.jsx)(B,{value:Q,children:be()}),jt.map(e=>(0,J.jsx)(B,{value:e,children:e},e))]})]}),(0,J.jsxs)(V,{value:u,onValueChange:fe,children:[(0,J.jsx)(R,{size:`sm`,className:`w-32`,children:(0,J.jsx)(L,{placeholder:_e()})}),(0,J.jsxs)(z,{children:[(0,J.jsx)(B,{value:Q,children:ve()}),Mt.map(e=>(0,J.jsx)(B,{value:e,children:e},e))]})]}),(0,J.jsxs)(V,{value:d,onValueChange:k,children:[(0,J.jsx)(R,{size:`sm`,className:`w-36`,children:(0,J.jsx)(L,{placeholder:ee()})}),(0,J.jsxs)(z,{children:[(0,J.jsx)(B,{value:Q,children:ze()}),xe.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:a===Z?``:a,placeholder:te(),"aria-label":te(),onChange:e=>{let t=e.target.value.trim();oe(t===``?Z:t)}}),(0,J.jsx)(`datalist`,{id:`oc-trace-kinds`,children:ye.map(e=>(0,J.jsx)(`option`,{value:e},e))}),(0,J.jsxs)(V,{value:String(n),onValueChange:e=>ie(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:g({count:e})},e))})]})]}),(0,J.jsx)(xt,{fields:Pt,seed:v,onChange:j}),C?(0,J.jsx)(`div`,{className:`oc-traces__followline`,children:(0,J.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>w(null),title:ge(),children:[(0,J.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[me(),(0,J.jsx)(`code`,{children:$(C)})]}),(0,J.jsx)(at,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,J.jsx)(`span`,{className:`sr-only`,children:y()})]})}):null,(0,J.jsx)(St,{title:he(),rows:De,emptyHint:C?o():Ye(),columns:[{header:ue(),sort:e=>e.at,cell:e=>(0,J.jsx)(`span`,{className:`oc-traces__time`,children:K(e.at)})},{header:ne(),sort:e=>e.kind,cell:e=>(0,J.jsx)(G,{variant:`secondary`,children:e.kind})},{header:x(),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":m(),children:`✓`})}},{header:ce(),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:ae(),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:re(),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:Ae(),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:i(),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:Me(),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:se(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,J.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:l(),onClick:()=>w(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:()=>E(e),children:pe()}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,J.jsx)(Rt,{row:T,onClose:()=>E(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:[qe(),` `,(0,J.jsx)(`code`,{children:e.kind}),(0,J.jsx)(G,{variant:`outline`,children:c()})]}),(0,J.jsx)(ft,{children:fe()})]}),(0,J.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{Ft as TracesTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{AE as r,CE as i,DE as a,E as o,EE as s,HX as c,IE as l,LE as u,ME as d,NE as f,OE as p,SE as m,TE as h,XX as g,YX as _,_E as v,bE as y,jE as b,kE as x,t as S,vE as C,wE as w,xE as T,xj as E,yE as D}from"./api-DSJJn0d7.js";import{t as O}from"./use_paginated_query-CQj09xXv.js";import{t as k}from"./trash-2-B4WSfc7G.js";import{t as A}from"./button-Dio0PVrp.js";import"./convexApi-CyScjgcq.js";import{r as j}from"./toast-xNFwDnUy.js";import{n as M}from"./format-DGKgJf2p.js";import{n as N}from"./ConfirmDialog-BXcki0Ee.js";import{r as P}from"./fileMetaView-Ci5C4w9Q.js";import{r as F}from"./trashView-Ct0Xw-a9.js";import{n as I,t as L}from"./trashPage-WtAhGCt7.js";var R=o(`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=g(S.blobSweep.listBlobSweeps,{}),t=g(S.blobQuarantine.quarantineSettings,{}),n=_(S.blobSweep.startBlobSweep),o=N(),{toast:l}=j(),[u,O]=(0,z.useState)(!1),F=c(),I=e=>P(e,F),L=B(e??[],Date.now()),H=L.report,U=async e=>{O(!0);try{await e()}catch(e){l({title:v(),description:e.message,variant:`error`})}finally{O(!1)}},W=()=>U(()=>n({mode:`dryRun`})),G=async()=>{H!==null&&await o({title:T({count:H.orphans.count}),description:y({size:I(H.orphans.bytes)}),confirmLabel:m(),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:f()}),(0,V.jsxs)(`div`,{className:`oc-trash__actions`,children:[(0,V.jsxs)(A,{variant:`outline`,size:`sm`,disabled:u||L.running!==null,onClick:()=>void W(),children:[(0,V.jsx)(R,{}),` `,b()]}),(0,V.jsxs)(A,{variant:`ghost`,size:`sm`,className:`text-destructive`,disabled:u||L.applyBlock!==null,onClick:()=>void G(),children:[(0,V.jsx)(k,{}),` `,m()]})]})]}),(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:d({days:H?.minAgeDays??7,quarantine:t?.days??7})}),e===void 0?(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:E()}):null,L.running===null?null:(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:r({scanned:L.running.blobsScanned})}),e!==void 0&&H===null&&L.running===null?(0,V.jsx)(`p`,{className:`oc-trash__empty`,children:x()}):null,H===null?null:(0,V.jsxs)(`div`,{className:`oc-trash__hint`,children:[(0,V.jsx)(`p`,{children:p({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:a({count:H.byOrigin.upload?.count??0,size:I(H.byOrigin.upload?.bytes??0)})}),(0,V.jsx)(`li`,{children:s({count:H.byOrigin.unregistered?.count??0,size:I(H.byOrigin.unregistered?.bytes??0)})})]}),H.importing>0?(0,V.jsx)(`p`,{children:h({count:H.importing})}):null,H.mirrorMissing>0?(0,V.jsx)(`p`,{className:`text-destructive`,children:w({count:H.mirrorMissing})}):null,L.applyBlock===`expired`?(0,V.jsx)(`p`,{children:i()}):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(S.trash.adminListTrash,{},{initialNumItems:50}),r=F(),i=_(S.trash.adminRestoreChat),a=_(S.trash.adminPurgeChat);return(0,V.jsxs)(`div`,{className:`oc-trash__body`,children:[(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:u({days:r})}),t===`LoadingFirstPage`?(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:E()}):e.length===0?(0,V.jsx)(`p`,{className:`oc-trash__empty`,children:l()}):(0,V.jsx)(L,{items:e,onRestore:e=>i({chatId:e}),onPurge:e=>a({chatId:e})}),(0,V.jsx)(I,{status:t,loadMore:n}),(0,V.jsx)(H,{})]})}export{U as TrashTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$I as r,AI as i,BA as a,BI as o,FA as s,FI as c,GI as l,HA as u,HI as d,IA as f,II as p,JI as m,KI as ee,LA as h,LI as te,MA as g,MI as ne,NA as _,NI as re,PA as v,PI as ie,QI as ae,Qb as y,RA as b,RI as oe,UA as x,UI as se,VA as S,VI as ce,WI as le,XI as ue,XX as C,Xb as w,YI as de,YX as T,ZI as fe,Zb as E,eL as pe,jA as D,jI as me,kI as he,nL as O,qI as ge,rL as k,t as A,tL as j,uI as _e,zA as M,zI as ve}from"./api-DSJJn0d7.js";import{n as ye,t as be}from"./useNavigate-D3GIoxyW.js";import{c as N,i as P,n as F,r as xe,t as Se}from"./dropdown-menu-DHMOOlaP.js";import{t as I}from"./checkbox-CsI4ggnp.js";import{t as L}from"./server-DLnWqkX-.js";import{t as R}from"./star-CM6J2w_J.js";import{a as z,i as B,n as V,r as H,t as U}from"./select-qM3ZfTHx.js";import{t as W}from"./button-Dio0PVrp.js";import"./convexApi-CyScjgcq.js";import{r as G}from"./toast-xNFwDnUy.js";import{t as K}from"./badge-C4po8DQ1.js";import{a as Ce,n as we,o as Te,r as Ee,t as De}from"./dialog-BfrsWZiD.js";import{t as Oe}from"./appHost-CH3EGcJw.js";import{n as ke,r as Ae}from"./ConfirmDialog-BXcki0Ee.js";import{a as q}from"./groupManageView-BMBqgRhV.js";import{a as je,o as J,t as Y}from"./AdminSettings-B8n1yLsD.js";import{t as Me}from"./FilterBar-DTVwlDpF.js";import{t as Ne}from"./DataTableShell-DRFFBx_j.js";import{t as Pe}from"./DetailChips-Cv1sxdhU.js";var X=t(e(),1),Z=n();function Fe({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=C(A.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),o=C(A.agents.listUserAgents,n&&e?{profileId:e}:`skip`),s=new Set((o??[]).map(e=>`${e.instanceName}/${e.agentId}`)),c=(o??[]).find(e=>e.isDefault)??null,l=c?`${c.instanceName}/${c.agentId}`:null,d=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),p=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(o??[]).filter(e=>!d.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}))],m=new Map;for(let e of p){let t=m.get(e.instanceName)??[];t.push(e),m.set(e.instanceName,t)}return(0,Z.jsx)(De,{open:n,onOpenChange:r,children:(0,Z.jsxs)(we,{className:`oc-access`,children:[(0,Z.jsxs)(Ce,{children:[(0,Z.jsx)(Te,{children:x({user:t})}),(0,Z.jsx)(Ee,{children:u()})]}),i?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?S():a()}):null,(0,Z.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:M()}):p.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:f()}):[...m.entries()].map(([t,n])=>(0,Z.jsx)(Ie,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:s,defaultKey:l},t))})]})})}function Ie({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:a}){let o=T(A.agents.assignAgent),c=T(A.agents.removeAgent),l=T(A.agents.setDefaultAgent),u=G();if(!e)return null;async function d(n,r){try{r?await c({profileId:e,instanceName:t,agentId:n}):await o({profileId:e,instanceName:t,agentId:n})}catch(e){u.error(b(),q(e))}}async function f(n){try{await l({profileId:e,instanceName:t,agentId:n})}catch(e){u.error(h(),q(e))}}return(0,Z.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Z.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Z.jsx)(L,{size:13,"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:t}),(0,Z.jsx)(K,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=i.has(n),o=a===n,c=e.state===`deleted`,l=!e.enabled;return(0,Z.jsxs)(`div`,{className:`oc-access__row${l?` is-disabled`:``}`,children:[(0,Z.jsx)(I,{checked:r,disabled:(c||l)&&!r,onCheckedChange:()=>void d(e.agentId,r),"aria-label":s({name:e.displayName??e.agentId})}),(0,Z.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Z.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,c?(0,Z.jsx)(K,{variant:`outline`,className:`oc-access__gone`,children:v()}):null,e.outOfPool?(0,Z.jsx)(K,{variant:`outline`,className:`oc-access__gone`,children:_()}):null,r?o?(0,Z.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":g(),title:g(),children:(0,Z.jsx)(R,{size:14,fill:`currentColor`})}):(0,Z.jsx)(W,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":D(),title:D(),disabled:l,onClick:()=>void f(e.agentId),children:(0,Z.jsx)(R,{size:14})}):null]},e.agentId)})]})}var Q=`__all__`;function $(e){switch(e){case`pending`:return w();case`user`:return E();case`admin`:return y();default:return e}}function Le({granted:e,onToggle:t}){let n=new Set(e),r=Y.filter(e=>n.has(J[e])).length;return(0,Z.jsxs)(Se,{children:[(0,Z.jsx)(N,{asChild:!0,children:(0,Z.jsx)(W,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?k():O({count:r})})}),(0,Z.jsxs)(F,{align:`start`,className:`w-52`,children:[(0,Z.jsx)(P,{children:j()}),Y.map(e=>{let r=J[e];return(0,Z.jsxs)(xe,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Z.jsx)(I,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Z.jsx)(`span`,{children:je[e]()})]},e)})]})]})}function Re(){let e=ye({from:`/settings/users`}),t=be({from:`/settings/users`}),n=e.q??``,a=e.role??Q,s=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),u=e=>void t({search:t=>({...t,role:e===Q?void 0:e})}),f=C(A.admin.listUsers,{filter:{q:n||void 0,role:a===Q?void 0:a},withAgents:!0}),h=C(A.me.getMe,{host:Oe}),g=T(A.admin.setRole),_=T(A.admin.setUserPermissions),v=T(A.admin.startImpersonation),y=T(A.admin.deleteUser),b=T(A.admin.setUserName),x=ke(),S=Ae(),w=G(),[E,D]=(0,X.useState)(null),O=(0,X.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of f??[])e.add(t.role);return[...e]},[f]),k=n!==``||a!==Q;function j(){t({search:{},replace:!0})}async function M(e){try{await g(e)}catch(e){w.error(pe(),e)}}async function N(e){try{await _(e)}catch(e){w.error(r(),e)}}async function P(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await x({title:ee(),description:l({user:t}),confirmWord:le(),confirmLabel:se(),destructive:!0}))try{await y({profileId:e._id}),w.success(ce({user:t}))}catch(e){w.error(d(),e)}}async function F(e){let t=e.email||e.name||e.userId.slice(0,8),n=await S({title:ve(),label:oe({user:t}),placeholder:te(),defaultValue:e.name??``,confirmLabel:_e()});if(n!==null)try{await b({profileId:e._id,name:n}),w.success(p())}catch(e){w.error(c(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Me,{q:n,onQChange:s,searchPlaceholder:ae(),onReset:j,canReset:k,children:(0,Z.jsxs)(U,{value:a,onValueChange:u,children:[(0,Z.jsx)(B,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(z,{})}),(0,Z.jsxs)(V,{children:[(0,Z.jsx)(H,{value:Q,children:fe()}),O.map(e=>(0,Z.jsx)(H,{value:e,children:$(e)},e))]})]})}),(0,Z.jsx)(Ne,{title:ue(),rows:f,emptyHint:de(),rowActions:e=>{let t=[{label:he(),onSelect:()=>D({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:o(),onSelect:()=>void F(e)}];return e.userId!==h?.userId&&t.push({label:m(),onSelect:()=>void v({profileId:e._id})},{label:ge(),variant:`destructive`,onSelect:()=>void P(e)}),t},columns:[{header:ie(),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,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`span`,{children:t}),n?(0,Z.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}):null]})},sort:e=>e.email||e.name||e.canonical||e.userId},{header:re(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Z.jsxs)(U,{value:e.role,onValueChange:t=>void M({profileId:e._id,role:t}),children:[(0,Z.jsx)(B,{size:`sm`,className:`w-28`,children:(0,Z.jsx)(z,{})}),(0,Z.jsxs)(V,{children:[(0,Z.jsx)(H,{value:`pending`,children:$(`pending`)}),(0,Z.jsx)(H,{value:`user`,children:$(`user`)}),(0,Z.jsx)(H,{value:`admin`,children:$(`admin`)})]})]})},{header:ne(),sort:e=>e.role===`admin`?9999:e.extraPermissions?.length??0,cell:e=>e.role===`admin`?(0,Z.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:me()}):(0,Z.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:i(),cell:e=>(0,Z.jsx)(Pe,{icon:(0,Z.jsx)(L,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,Z.jsx)(Fe,{profileId:E?.profileId??null,userLabel:E?.label??``,open:E!==null,onOpenChange:e=>{e||D(null)}})]})}export{Re as UsersTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$l as r,Ac as i,BX as a,Fc as o,Gc as s,Gl as c,HX as ee,Hc as l,Hl as u,Ic as d,Jl as f,Kl as p,Lc as m,M_ as h,Mc as te,Nc as g,P_ as ne,Qc as _,Ql as v,Rc as y,Uc as re,Ul as ie,Vc as ae,Vl as oe,Wc as se,Wl as b,XX as x,Xl as ce,YX as S,Yl as le,Zl as ue,au as C,cu as de,du as w,eu as T,iu as fe,jc as pe,lu as me,nu as he,ou as E,qX as ge,ql as D,ru as O,ry as k,sR as A,su as j,t as M,tu as N,uu as P,vc as F}from"./api-DSJJn0d7.js";import{n as I,t as L}from"./useNavigate-D3GIoxyW.js";import{d as _e,f as ve,i as ye,l as R,n as be,o as z,r as xe,s as B,t as Se,u as Ce}from"./speech-CrNma2Ue.js";import{t as V}from"./checkbox-CsI4ggnp.js";import{a as H,i as U,n as W,r as G,t as K}from"./select-qM3ZfTHx.js";import{i as q,n as J,r as we,t as Te}from"./tabs-mZfLmn2f.js";import{t as Y}from"./button-Dio0PVrp.js";import"./convexApi-CyScjgcq.js";import{t as X}from"./badge-C4po8DQ1.js";import{t as Ee}from"./appHost-CH3EGcJw.js";/* empty css */var Z=t(e(),1),Q=n(),De=[[`auto`,()=>fe()],[`fr-FR`,()=>s()],[`en-US`,()=>se()],[`en-GB`,()=>re()],[`de-DE`,()=>l()],[`es-ES`,()=>ae()]],Oe=[[`0.75`,()=>he()],[`1`,()=>N()],[`1.25`,()=>T()],[`1.5`,()=>r()]],$=0;function ke({instance:e}){let t=S(M.admin.upsertInstanceConfig),n=e.config??{},r={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)(r),[s,c]=(0,Z.useState)(`idle`),[l,u]=(0,Z.useState)(!1),[d,p]=(0,Z.useState)(!1),m=ge(M.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 _=a.enabled!==r.enabled||a.engine!==r.engine||a.lang!==r.lang||a.rate!==r.rate||a.autoRead!==r.autoRead;async function y(){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)(X,{variant:`secondary`,children:e.kind===`hermes`?`Hermes`:`OpenClaw`})]}),(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(V,{checked:a.enabled,onCheckedChange:e=>o({...a,enabled:e===!0}),"aria-label":E()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:E()})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:g()}),(0,Q.jsxs)(K,{value:a.engine,onValueChange:e=>o({...a,engine:e}),disabled:!a.enabled,children:[(0,Q.jsx)(U,{size:`sm`,"aria-label":g(),children:(0,Q.jsx)(H,{})}),(0,Q.jsxs)(W,{children:[(0,Q.jsx)(G,{value:`browser`,children:te()}),e.kind===`hermes`?null:(0,Q.jsx)(G,{value:`gateway`,children:pe()})]})]})]}),a.engine===`gateway`?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:i()}):null,a.engine===`gateway`?null:(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:C()}),(0,Q.jsxs)(K,{value:a.lang,onValueChange:e=>o({...a,lang:e}),disabled:!a.enabled,children:[(0,Q.jsx)(U,{size:`sm`,"aria-label":C(),children:(0,Q.jsx)(H,{})}),(0,Q.jsx)(W,{children:De.map(([e,t])=>(0,Q.jsx)(G,{value:e,children:t()},e))})]})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:O()}),(0,Q.jsxs)(K,{value:a.rate,onValueChange:e=>o({...a,rate:e}),disabled:!a.enabled,children:[(0,Q.jsx)(U,{size:`sm`,"aria-label":O(),children:(0,Q.jsx)(H,{})}),(0,Q.jsx)(W,{children:Oe.map(([e,t])=>(0,Q.jsx)(G,{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)(V,{checked:a.autoRead,onCheckedChange:e=>o({...a,autoRead:e===!0}),disabled:!a.enabled,"aria-label":v()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:v()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ue()})]}),(0,Q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,Q.jsx)(Y,{size:`sm`,disabled:!_||s===`saving`,onClick:()=>void y(),children:s===`saving`?k():ne()}),(0,Q.jsx)(Y,{variant:`outline`,size:`sm`,disabled:!a.enabled||l,onClick:()=>{let t=Number.parseFloat(a.rate)||1,n=++$;if(p(!1),B(),z(),a.engine!==`gateway`){ye(f(),{lang:xe(a.lang,ee()),rate:t});return}u(!0),m({instanceName:e.name,text:f()}).then(({mime:e,audioBase64:r})=>{n===$&&be(r,e,{rate:t})}).catch(()=>{n===$&&p(!0)}).finally(()=>u(!1))},children:l?k():ce()}),(0,Q.jsx)(Y,{variant:`ghost`,size:`sm`,onClick:()=>{$++,u(!1),B(),z()},children:le()})]}),s===`error`||d?(0,Q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:d?F():h()}):null]})}function Ae({stt:e}){let t=x(M.me.getMe,{host:Ee}),n=S(M.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:p()}),(0,Q.jsx)(X,{variant:e?`secondary`:`outline`,children:e?u():oe()}),(0,Q.jsx)(X,{variant:r?`secondary`:`destructive`,children:r?m():d()})]}),i?(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(V,{checked:r,onCheckedChange:e=>void n({key:`voiceInput`,enabled:e===!0}),"aria-label":y()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:y()})]}):null,(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:c()})]})}function je(){let e=x(M.admin.listInstances,{}),t=(0,Z.useMemo)(()=>R(),[]),n=(0,Z.useMemo)(()=>Se(),[]),{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:w()}),(0,Q.jsxs)(`div`,{className:`oc-voice__support`,children:[(0,Q.jsx)(X,{variant:t?`secondary`:`destructive`,children:t?P():me()}),(0,Q.jsx)(X,{variant:n?`secondary`:`destructive`,children:n?de():j()})]}),(0,Q.jsxs)(Te,{value:r,onValueChange:e=>void i({search:{section:e},replace:!0}),children:[(0,Q.jsxs)(we,{className:`w-full`,children:[(0,Q.jsxs)(q,{value:`readaloud`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Ce,{size:13,"aria-hidden":!0}),o()]}),(0,Q.jsxs)(q,{value:`dictation`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(_e,{size:13,"aria-hidden":!0}),p()]}),(0,Q.jsxs)(q,{value:`talk`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(ve,{size:13,"aria-hidden":!0}),b()]})]}),(0,Q.jsx)(J,{value:`readaloud`,children:e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:D()}):e.map(e=>(0,Q.jsx)(ke,{instance:e},e._id))}),(0,Q.jsx)(J,{value:`dictation`,children:(0,Q.jsx)(Ae,{stt:n})}),(0,Q.jsxs)(J,{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:b()})}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ie()})]}),e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:D()}):e.map(e=>(0,Q.jsx)(Me,{instance:e},e._id))]})]})]})}function Me({instance:e}){let t=S(M.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)(X,{variant:`secondary`,children:i?`Hermes`:`OpenClaw`})]}),i?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:_()}):(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(V,{checked:r,onCheckedChange:r=>{let i={...n};r===!0?i.talkEnabled=!0:delete i.talkEnabled,t({instanceId:e._id,config:i})},"aria-label":A()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:A()})]})]})}export{je as VoiceTab};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{C as r,T as i,h as a,r as o,v as s}from"./api-DSJJn0d7.js";import{a as c,c as l,i as u,l as d,n as f,o as p,r as ee,s as m,t as h,u as g}from"./dist-CkbybbG7.js";import{n as _}from"./button-Dio0PVrp.js";var v=t(e(),1),y=n(),b=`AlertDialog`,[x,te]=a(b,[g]),S=g(),C=e=>{let{__scopeAlertDialog:t,...n}=e,r=S(t);return(0,y.jsx)(p,{...r,...n,modal:!0})};C.displayName=b;var w=`AlertDialogTrigger`,T=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=S(n);return(0,y.jsx)(l,{...i,...r,ref:t})});T.displayName=w;var E=`AlertDialogPortal`,D=e=>{let{__scopeAlertDialog:t,...n}=e,r=S(t);return(0,y.jsx)(c,{...r,...n})};D.displayName=E;var O=`AlertDialogOverlay`,k=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=S(n);return(0,y.jsx)(u,{...i,...r,ref:t})});k.displayName=O;var A=`AlertDialogContent`,[j,M]=x(A),N=r(`AlertDialogContent`),P=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...a}=e,o=S(n),c=v.useRef(null),l=i(t,c),u=v.useRef(null);return(0,y.jsx)(d,{contentName:A,titleName:F,docsSlug:`alert-dialog`,children:(0,y.jsx)(j,{scope:n,cancelRef:u,children:(0,y.jsxs)(f,{role:`alertdialog`,...o,...a,ref:l,onOpenAutoFocus:s(a.onOpenAutoFocus,e=>{e.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,y.jsx)(N,{children:r}),(0,y.jsx)(U,{contentRef:c})]})})})});P.displayName=A;var F=`AlertDialogTitle`,I=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=S(n);return(0,y.jsx)(m,{...i,...r,ref:t})});I.displayName=F;var L=`AlertDialogDescription`,R=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=S(n);return(0,y.jsx)(ee,{...i,...r,ref:t})});R.displayName=L;var z=`AlertDialogAction`,B=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=S(n);return(0,y.jsx)(h,{...i,...r,ref:t})});B.displayName=z;var V=`AlertDialogCancel`,H=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=M(V,n),o=S(n),s=i(t,a);return(0,y.jsx)(h,{...o,...r,ref:s})});H.displayName=V;var U=({contentRef:e})=>{let t=`\`${A}\` requires a description for the component to be accessible for screen reader users.
|
|
2
|
+
|
|
3
|
+
You can add a description to the \`${A}\` by passing a \`${L}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
4
|
+
|
|
5
|
+
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${A}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
6
|
+
|
|
7
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return v.useEffect(()=>{document.getElementById(e.current?.getAttribute(`aria-describedby`))||console.warn(t)},[t,e]),null},W=C,ne=D,G=k,K=P,q=B,J=H,Y=I,X=R;function Z({...e}){return(0,y.jsx)(W,{"data-slot":`alert-dialog`,...e})}function Q({...e}){return(0,y.jsx)(ne,{"data-slot":`alert-dialog-portal`,...e})}function $({className:e,...t}){return(0,y.jsx)(G,{"data-slot":`alert-dialog-overlay`,className:o(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function re({className:e,...t}){return(0,y.jsxs)(Q,{children:[(0,y.jsx)($,{}),(0,y.jsx)(K,{"data-slot":`alert-dialog-content`,className:o(`fixed top-1/2 left-1/2 z-50 grid w-[calc(100%-2rem)] max-w-md -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl border border-border bg-popover bg-clip-padding p-5 text-sm text-popover-foreground shadow-lg duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...t})]})}function ie({className:e,...t}){return(0,y.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:o(`flex flex-col gap-1.5`,e),...t})}function ae({className:e,...t}){return(0,y.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:o(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function oe({className:e,...t}){return(0,y.jsx)(Y,{"data-slot":`alert-dialog-title`,className:o(`text-base font-medium text-foreground`,e),...t})}function se({className:e,...t}){return(0,y.jsx)(X,{"data-slot":`alert-dialog-description`,className:o(`text-sm text-muted-foreground`,e),...t})}function ce({className:e,...t}){return(0,y.jsx)(q,{className:o(_(),e),...t})}function le({className:e,...t}){return(0,y.jsx)(J,{className:o(_({variant:`outline`}),e),...t})}export{se as a,oe as c,re as i,ce as n,ae as o,le as r,ie as s,Z as t};
|