@lacneu/atrium 0.43.0 → 0.43.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/assets/AccessTab-94MtF5lT.js +1 -0
  2. package/dist/assets/{AdvancedFilter-UZD1c3U9.js → AdvancedFilter-BnA7f0yX.js} +1 -1
  3. package/dist/assets/AgentFilesTab-sjdoEmO4.js +3 -0
  4. package/dist/assets/AnomaliesTab-DbH8S6fZ.js +1 -0
  5. package/dist/assets/AuditTab-B4enDRkk.js +1 -0
  6. package/dist/assets/BridgeTab-DqV2JfAL.js +1 -0
  7. package/dist/assets/ChatDefaultsTab-VjBCgiMX.js +1 -0
  8. package/dist/assets/DataTableShell-BwOKMopJ.js +1 -0
  9. package/dist/assets/{DetailChips-J-KcpPRO.js → DetailChips-B7PRsQ8X.js} +1 -1
  10. package/dist/assets/FeedbacksTab-WbanMd0X.js +1 -0
  11. package/dist/assets/{FieldLabel-DYhOcc_e.js → FieldLabel-D6e92lXR.js} +1 -1
  12. package/dist/assets/FilesTab-BRT-LD5j.js +1 -0
  13. package/dist/assets/{FilterBar-CzpwZuGf.js → FilterBar-Z4TZZeJs.js} +1 -1
  14. package/dist/assets/GroupsTab-BDmYIdOy.js +1 -0
  15. package/dist/assets/InstancesTab-Bion8hoW.js +1 -0
  16. package/dist/assets/IntegrationsTab-C1rqnuOD.js +1 -0
  17. package/dist/assets/KpiTab-DXJRXni-.js +1 -0
  18. package/dist/assets/PreferencesTab-U9LNPEoY.js +1 -0
  19. package/dist/assets/PromptInjectionsTab-Qkodd11k.js +4 -0
  20. package/dist/assets/RolesTab-B9DClwCJ.js +1 -0
  21. package/dist/assets/ServiceAccountsTab-CZnWRSm3.js +1 -0
  22. package/dist/assets/SubAgentReportsTab-Dk4U8jt3.js +1 -0
  23. package/dist/assets/ThemeShowroom-C5FSV0-b.js +1 -0
  24. package/dist/assets/{TimeRangePicker-XUfGR5S2.js → TimeRangePicker-CcUEMoXD.js} +1 -1
  25. package/dist/assets/TracesTab-9U3IirNk.js +1 -0
  26. package/dist/assets/UsersTab-AzjFhn2N.js +1 -0
  27. package/dist/assets/VoiceTab-BYE2xI7l.js +1 -0
  28. package/dist/assets/{button-CvJAYeHx.js → button-B9CsHmrJ.js} +1 -1
  29. package/dist/assets/{card-1aYDgnwU.js → card-CMDVfuXr.js} +1 -1
  30. package/dist/assets/chevrons-up-down-C13y3ij3.js +1 -0
  31. package/dist/assets/{compatView-BHy79k8P.js → compatView-BU4Wp3dH.js} +1 -1
  32. package/dist/assets/dispatchErrorInfo-dqUyKO3V.js +1 -0
  33. package/dist/assets/{dist-Bcr-KIFN.js → dist-B7IaMcdm.js} +5 -5
  34. package/dist/assets/{dist-CEDhHgbc.js → dist-CulxjFIv.js} +1 -1
  35. package/dist/assets/{dist-BvTSSv91.js → dist-D87j9TcT.js} +1 -1
  36. package/dist/assets/{dist-CX03UY-q.js → dist-UNwILdG2.js} +1 -1
  37. package/dist/assets/{highlighted-body-OFNGDK62-EleSp1r2.js → highlighted-body-OFNGDK62-VCSqL6Ck.js} +1 -1
  38. package/dist/assets/{index--Drh_B6c.js → index-DYfClpT4.js} +25 -25
  39. package/dist/assets/mermaid-GHXKKRXX-BVRnJa6t.js +1 -0
  40. package/dist/assets/roleDescriptions-ow1wfNQF.js +1 -0
  41. package/dist/assets/{table-CrooMP5e.js → table-r4XuUszk.js} +1 -1
  42. package/dist/assets/{tabs-DMDS7i26.js → tabs-K6MF5os_.js} +1 -1
  43. package/dist/assets/x-CJSI-sn5.js +1 -0
  44. package/dist/index.html +7 -7
  45. package/package.json +1 -1
  46. package/dist/assets/AccessTab-BmNF0xWT.js +0 -1
  47. package/dist/assets/AgentFilesTab-Iqk_KofY.js +0 -3
  48. package/dist/assets/AnomaliesTab-xDgaxiGt.js +0 -1
  49. package/dist/assets/AuditTab-C1YqkRR1.js +0 -1
  50. package/dist/assets/BridgeTab-mLReg09f.js +0 -1
  51. package/dist/assets/ChatDefaultsTab-DJu8Eoyy.js +0 -1
  52. package/dist/assets/DataTableShell-c6bvewGu.js +0 -1
  53. package/dist/assets/FeedbacksTab-CzAvDpW2.js +0 -1
  54. package/dist/assets/FilesTab-BnodMPSK.js +0 -1
  55. package/dist/assets/GroupsTab-C9Sz4tdf.js +0 -1
  56. package/dist/assets/InstancesTab-OTDf7MYw.js +0 -1
  57. package/dist/assets/IntegrationsTab-DC9WLLvC.js +0 -1
  58. package/dist/assets/KpiTab-DIdsAXH_.js +0 -1
  59. package/dist/assets/PreferencesTab-Yy4nWGBM.js +0 -1
  60. package/dist/assets/PromptInjectionsTab-CILSRtdl.js +0 -4
  61. package/dist/assets/RolesTab-BQNU-vsJ.js +0 -1
  62. package/dist/assets/ServiceAccountsTab-De0P-S_F.js +0 -1
  63. package/dist/assets/SubAgentReportsTab-GFSfR2RF.js +0 -1
  64. package/dist/assets/ThemeShowroom-sg8sZwIW.js +0 -1
  65. package/dist/assets/TracesTab-DE3TeHRG.js +0 -1
  66. package/dist/assets/UsersTab-CwAl49kr.js +0 -1
  67. package/dist/assets/VoiceTab-Djb19TZI.js +0 -1
  68. package/dist/assets/chevrons-up-down-BEdda7QD.js +0 -1
  69. package/dist/assets/dispatchErrorInfo-AjCvuCVv.js +0 -1
  70. package/dist/assets/mermaid-GHXKKRXX-kZO9jf6G.js +0 -1
  71. package/dist/assets/roleDescriptions-DBwd5h4i.js +0 -1
  72. package/dist/assets/x-BVy5P5am.js +0 -1
@@ -0,0 +1 @@
1
+ import{O as e}from"./index-DYfClpT4.js";export{e as Mermaid};
@@ -0,0 +1 @@
1
+ import{ey as e,iy as t,ny as n,ry as r,ty as i}from"./dist-B7IaMcdm.js";var a={pending:t,user:r,admin:n,observer:i,agent:e};function o(e){if(e.builtin){let t=a[e.key];if(t)return t()}return e.description}export{o as t};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n}from"./dist-Bcr-KIFN.js";e();var r=t();function i({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,r.jsx)(`table`,{"data-slot":`table`,className:n(`w-full caption-bottom text-sm`,e),...t})})}function a({className:e,...t}){return(0,r.jsx)(`thead`,{"data-slot":`table-header`,className:n(`[&_tr]:border-b`,e),...t})}function o({className:e,...t}){return(0,r.jsx)(`tbody`,{"data-slot":`table-body`,className:n(`[&_tr:last-child]:border-0`,e),...t})}function s({className:e,...t}){return(0,r.jsx)(`tr`,{"data-slot":`table-row`,className:n(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function c({className:e,...t}){return(0,r.jsx)(`th`,{"data-slot":`table-head`,className:n(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,e),...t})}function l({className:e,...t}){return(0,r.jsx)(`td`,{"data-slot":`table-cell`,className:n(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,e),...t})}export{a,c as i,o as n,s as o,l as r,i as t};
1
+ import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n}from"./dist-B7IaMcdm.js";e();var r=t();function i({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,r.jsx)(`table`,{"data-slot":`table`,className:n(`w-full caption-bottom text-sm`,e),...t})})}function a({className:e,...t}){return(0,r.jsx)(`thead`,{"data-slot":`table-header`,className:n(`[&_tr]:border-b`,e),...t})}function o({className:e,...t}){return(0,r.jsx)(`tbody`,{"data-slot":`table-body`,className:n(`[&_tr:last-child]:border-0`,e),...t})}function s({className:e,...t}){return(0,r.jsx)(`tr`,{"data-slot":`table-row`,className:n(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function c({className:e,...t}){return(0,r.jsx)(`th`,{"data-slot":`table-head`,className:n(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,e),...t})}function l({className:e,...t}){return(0,r.jsx)(`td`,{"data-slot":`table-cell`,className:n(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,e),...t})}export{a,c as i,o as n,s as o,l as r,i as t};
@@ -1 +1 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{d as r,f as i,h as a,n as o,t as s,u as c,v as l,y as u}from"./dist-Bcr-KIFN.js";import{t as d}from"./dist-BvTSSv91.js";import{Ct as f,Tt as p,wt as m}from"./index--Drh_B6c.js";var h=t(e(),1),g=n(),_=`Tabs`,[v,y]=a(_,[p]),b=p(),[x,S]=v(_),C=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:a,defaultValue:o,orientation:s=`horizontal`,dir:l,activationMode:f=`automatic`,...p}=e,m=d(l),[h,v]=i({prop:r,onChange:a,defaultProp:o??``,caller:_});return(0,g.jsx)(x,{scope:n,baseId:c(),value:h,onValueChange:v,orientation:s,dir:m,activationMode:f,children:(0,g.jsx)(u.div,{dir:m,"data-orientation":s,...p,ref:t})})});C.displayName=_;var w=`TabsList`,T=h.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=S(w,n),o=b(n);return(0,g.jsx)(m,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,g.jsx)(u.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});T.displayName=w;var E=`TabsTrigger`,D=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=S(E,n),s=b(n),c=A(o.baseId,r),d=j(o.baseId,r),p=r===o.value;return(0,g.jsx)(f,{asChild:!0,...s,focusable:!i,active:p,children:(0,g.jsx)(u.button,{type:`button`,role:`tab`,"aria-selected":p,"aria-controls":d,"data-state":p?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:l(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:l(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:l(e.onFocus,()=>{let e=o.activationMode!==`manual`;!p&&!i&&e&&o.onValueChange(r)})})})});D.displayName=E;var O=`TabsContent`,k=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:i,forceMount:a,children:o,...s}=e,c=S(O,n),l=A(c.baseId,i),d=j(c.baseId,i),f=i===c.value,p=h.useRef(f);return h.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,g.jsx)(r,{present:a||f,children:({present:n})=>(0,g.jsx)(u.div,{"data-state":f?`active`:`inactive`,"data-orientation":c.orientation,role:`tabpanel`,"aria-labelledby":l,hidden:!n,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:n&&o})})});k.displayName=O;function A(e,t){return`${e}-trigger-${t}`}function j(e,t){return`${e}-content-${t}`}var M=C,N=T,P=D,F=k;function I({className:e,orientation:t=`horizontal`,...n}){return(0,g.jsx)(M,{"data-slot":`tabs`,"data-orientation":t,className:o(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var L=s(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function R({className:e,variant:t=`default`,...n}){return(0,g.jsx)(N,{"data-slot":`tabs-list`,"data-variant":t,className:o(L({variant:t}),e),...n})}function z({className:e,...t}){return(0,g.jsx)(P,{"data-slot":`tabs-trigger`,className:o(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function B({className:e,...t}){return(0,g.jsx)(F,{"data-slot":`tabs-content`,className:o(`flex-1 text-sm outline-none`,e),...t})}export{z as i,B as n,R as r,I as t};
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{d as r,f as i,h as a,n as o,t as s,u as c,v as l,y as u}from"./dist-B7IaMcdm.js";import{t as d}from"./dist-D87j9TcT.js";import{Dt as f,Et as p,Tt as m}from"./index-DYfClpT4.js";var h=t(e(),1),g=n(),_=`Tabs`,[v,y]=a(_,[f]),b=f(),[x,S]=v(_),C=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:a,defaultValue:o,orientation:s=`horizontal`,dir:l,activationMode:f=`automatic`,...p}=e,m=d(l),[h,v]=i({prop:r,onChange:a,defaultProp:o??``,caller:_});return(0,g.jsx)(x,{scope:n,baseId:c(),value:h,onValueChange:v,orientation:s,dir:m,activationMode:f,children:(0,g.jsx)(u.div,{dir:m,"data-orientation":s,...p,ref:t})})});C.displayName=_;var w=`TabsList`,T=h.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=S(w,n),o=b(n);return(0,g.jsx)(p,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,g.jsx)(u.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});T.displayName=w;var E=`TabsTrigger`,D=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=S(E,n),s=b(n),c=A(o.baseId,r),d=j(o.baseId,r),f=r===o.value;return(0,g.jsx)(m,{asChild:!0,...s,focusable:!i,active:f,children:(0,g.jsx)(u.button,{type:`button`,role:`tab`,"aria-selected":f,"aria-controls":d,"data-state":f?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:l(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:l(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:l(e.onFocus,()=>{let e=o.activationMode!==`manual`;!f&&!i&&e&&o.onValueChange(r)})})})});D.displayName=E;var O=`TabsContent`,k=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:i,forceMount:a,children:o,...s}=e,c=S(O,n),l=A(c.baseId,i),d=j(c.baseId,i),f=i===c.value,p=h.useRef(f);return h.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,g.jsx)(r,{present:a||f,children:({present:n})=>(0,g.jsx)(u.div,{"data-state":f?`active`:`inactive`,"data-orientation":c.orientation,role:`tabpanel`,"aria-labelledby":l,hidden:!n,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:n&&o})})});k.displayName=O;function A(e,t){return`${e}-trigger-${t}`}function j(e,t){return`${e}-content-${t}`}var M=C,N=T,P=D,F=k;function I({className:e,orientation:t=`horizontal`,...n}){return(0,g.jsx)(M,{"data-slot":`tabs`,"data-orientation":t,className:o(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var L=s(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function R({className:e,variant:t=`default`,...n}){return(0,g.jsx)(N,{"data-slot":`tabs-list`,"data-variant":t,className:o(L({variant:t}),e),...n})}function z({className:e,...t}){return(0,g.jsx)(P,{"data-slot":`tabs-trigger`,className:o(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function B({className:e,...t}){return(0,g.jsx)(F,{"data-slot":`tabs-content`,className:o(`flex-1 text-sm outline-none`,e),...t})}export{z as i,B as n,R as r,I as t};
@@ -0,0 +1 @@
1
+ import{D as e}from"./dist-B7IaMcdm.js";var t=e(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};
package/dist/index.html CHANGED
@@ -42,14 +42,14 @@
42
42
  document.documentElement.dataset.ambiance = a === "off" ? "off" : "on";
43
43
  })();
44
44
  </script>
45
- <script type="module" crossorigin src="/assets/index--Drh_B6c.js"></script>
45
+ <script type="module" crossorigin src="/assets/index-DYfClpT4.js"></script>
46
46
  <link rel="modulepreload" crossorigin href="/assets/bundle-mjs-C73ZY4La.js">
47
- <link rel="modulepreload" crossorigin href="/assets/dist-Bcr-KIFN.js">
48
- <link rel="modulepreload" crossorigin href="/assets/dist-BvTSSv91.js">
49
- <link rel="modulepreload" crossorigin href="/assets/dist-CEDhHgbc.js">
50
- <link rel="modulepreload" crossorigin href="/assets/dist-CX03UY-q.js">
51
- <link rel="modulepreload" crossorigin href="/assets/x-BVy5P5am.js">
52
- <link rel="modulepreload" crossorigin href="/assets/button-CvJAYeHx.js">
47
+ <link rel="modulepreload" crossorigin href="/assets/dist-B7IaMcdm.js">
48
+ <link rel="modulepreload" crossorigin href="/assets/dist-D87j9TcT.js">
49
+ <link rel="modulepreload" crossorigin href="/assets/dist-CulxjFIv.js">
50
+ <link rel="modulepreload" crossorigin href="/assets/dist-UNwILdG2.js">
51
+ <link rel="modulepreload" crossorigin href="/assets/x-CJSI-sn5.js">
52
+ <link rel="modulepreload" crossorigin href="/assets/button-B9CsHmrJ.js">
53
53
  <link rel="stylesheet" crossorigin href="/assets/index-B4voP0zS.css">
54
54
  </head>
55
55
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lacneu/atrium",
3
- "version": "0.43.0",
3
+ "version": "0.43.2",
4
4
  "description": "Atrium — public, self-hostable, Convex-backed web chat UI for AI agent gateways (OpenClaw today, Hermes next). Ships an origin-agnostic static bundle (Convex URL injected at runtime via /config.json).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Au as r,Cu as i,Du as a,E as o,Eu as s,Fu as c,Mu as l,Nu as u,Ou as d,Pu as f,Su as p,Tu as m,bj as h,dj as g,ju as _,ku as v,wu as y,xu as b}from"./dist-Bcr-KIFN.js";import{C as x,S,at as C,b as w,w as T,x as E}from"./index--Drh_B6c.js";var D=t(e(),1);function O(e){return e===`user`?m():e===`all`?y():i({group:e.group})}function k(e){return e===`common`?p():e===`owner`?b():i({group:e.group})}var A=n();function j(e){return e.name||e.email||e.userId.slice(0,8)}function M(){let e=h(o.admin.listUsers,{}),[t,n]=(0,D.useState)(``),i=h(o.introspect.introspectUser,t?{userId:t}:`skip`);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:c()}),(0,A.jsxs)(w,{value:t,onValueChange:n,children:[(0,A.jsx)(x,{size:`sm`,"aria-label":f(),children:(0,A.jsx)(T,{placeholder:f()})}),(0,A.jsx)(E,{children:(e??[]).map(e=>(0,A.jsx)(S,{value:e.userId,children:j(e)},e._id))})]}),t===``?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):i===void 0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:g()}):(0,A.jsxs)(`div`,{className:`oc-introspect`,children:[(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:l()}),(0,A.jsxs)(`div`,{className:`oc-introspect__id`,children:[(0,A.jsx)(`strong`,{children:i.user.label}),(0,A.jsx)(C,{variant:`secondary`,children:i.role})]})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:_()}),i.groups.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:i.groups.map(e=>(0,A.jsx)(C,{variant:`secondary`,children:e.name},e.groupId))})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:r()}),i.agents.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:i.agents.map(e=>(0,A.jsxs)(`li`,{className:`oc-introspect__row`,children:[(0,A.jsx)(`span`,{className:`oc-introspect__name`,children:e.displayName||e.agentId}),e.isDefault?(0,A.jsx)(C,{variant:`default`,children:s()}):null,(0,A.jsx)(C,{variant:`outline`,children:O(e.via)}),(0,A.jsx)(C,{variant:`secondary`,children:e.state})]},`${e.instanceName} ${e.agentId}`))})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:v()}),i.charts.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:i.charts.map(e=>(0,A.jsxs)(`li`,{className:`oc-introspect__row`,children:[(0,A.jsx)(`span`,{className:`oc-introspect__name`,children:e.name}),(0,A.jsx)(C,{variant:`outline`,children:k(e.via)})]},e.key))})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:d()}),i.permissions.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:i.permissions.map(e=>(0,A.jsx)(C,{variant:`secondary`,children:e},e))})]})]})]})}export{M as AccessTab};
@@ -1,3 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$c as r,$s as i,E as a,Gn as o,Gs as s,Hn as c,Hs as l,Jn as u,Js as d,Kn as f,Ks as p,Qs as m,Un as h,Us as g,Vs as _,Wn as ee,Ws as v,Xs as y,Ys as b,Zc as x,Zs as S,_j as C,_r as w,ac as te,ar as T,bj as E,br as D,cc as ne,cr as O,dc as k,dj as A,dr as j,eE as re,ec as M,fc as N,fr as P,gc as F,gr as I,hc as ie,hr as L,ic as ae,ir as R,lc as z,lr as B,mc as V,mr as H,nc as U,nr as W,oc as oe,or as se,pc as ce,pj as G,pr as le,qn as ue,qs as de,rc as fe,rr as pe,sc as me,sr as he,tc as ge,tr as _e,uc as ve,ur as ye,vr as be,xr as xe,yj as Se,yr as Ce}from"./dist-Bcr-KIFN.js";import{t as K}from"./button-CvJAYeHx.js";import{C as we,Dt as q,G as Te,H as Ee,J as De,K as Oe,S as ke,U as Ae,W as je,Y as Me,at as Ne,b as Pe,ct as Fe,dt as Ie,ft as Le,lt as Re,q as ze,st as Be,vt as Ve,w as He,x as Ue,y as We,z as J}from"./index--Drh_B6c.js";import{n as Ge,t as Ke}from"./curation-CQksaIbm.js";import{i as qe}from"./compatView-BHy79k8P.js";/* empty css */var Y=t(e(),1),X=2e4,Je=6e4;function Ye(e){return typeof e!=`number`||e<=0?0:Math.round(e/X*100)}function Xe(e){return e<=0?0:Math.round(e/Je*100)}function Z(e,t){let n=(typeof e==`number`&&e>0?e:0)/1e3;return new Intl.NumberFormat(t,{minimumFractionDigits:1,maximumFractionDigits:1}).format(n)}function Ze(e){return e.reduce((e,t)=>e+(typeof t.size==`number`&&t.size>0?t.size:0),0)}var Qe=3;function $e(e,t){let n=new Map;for(let t of e.split(`
2
- `))n.set(t,(n.get(t)??0)+1);for(let e of t.split(`
3
- `))n.set(e,(n.get(e)??0)-1);let r=0,i=0,a=[],o=[];for(let[e,t]of n)t<0?(r+=-t,a.length<Qe&&a.push(e)):t>0&&(i+=t,o.length<Qe&&o.push(e));return{added:r,removed:i,sampleAdded:a,sampleRemoved:o}}function et(e){return e instanceof Error?e.message.includes(`conflict:`):String(e).includes(`conflict:`)}var Q=n(),$=e=>`${e.instanceName}::${e.agentId}`;function tt(){let e=E(a.me.getMe,{host:Ve}),t=e?.role===`admin`,n=(e?.permissions??[]).includes(`bridge.read`),r=E(a.admin.listInstances,e!==void 0&&t?{}:`skip`),[i,o]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{!t||!r||r.length===0||(!i||!r.some(e=>e.name===i))&&o(r[0].name)},[t,r,i]);let s=E(a.agents.listAgentsForInstance,t&&i?{instanceName:i}:`skip`),c=E(a.agents.listMyAgents,e!==void 0&&!t?{}:`skip`),l=(0,Y.useMemo)(()=>{if(e!==void 0){if(t)return i===null||s===void 0?r!==void 0&&r.length===0?[]:void 0:s.agents.map(e=>({instanceName:i,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}));if(c!==void 0)return c.map(e=>({instanceName:e.instanceName,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}))}},[e,t,i,s,r,c]),[u,d]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{!l||l.length===0||(!u||!l.some(e=>$(e)===u))&&d($(l[0]))},[l,u]);let f=l?.find(e=>$(e)===u)??null,p=C(a.agentFiles.listAgentFiles),[m,h]=(0,Y.useState)({status:`idle`}),g=f?.instanceName??null,_=f?.agentId??null,ee=E(a.compat.forInstance,n&&g!==null?{instanceName:g}:`skip`),v=n&&g!==null?We(ee,`agentFiles`):null,y=v===null?!1:v===`loading`?null:v.blocked,b=(0,Y.useCallback)(async()=>{if(!(g===null||_===null)){h({status:`loading`});try{h({status:`done`,files:(await p({instanceName:g,agentId:_})).files})}catch{h({status:`error`})}}},[p,g,_]);(0,Y.useEffect)(()=>{y===!1&&b()},[b,y]);let[S,T]=(0,Y.useState)(null),D=E(a.agentFileCuration.listCurations,t&&g!==null&&_!==null?{instanceName:g,agentId:_}:`skip`),O=E(a.agentFileCuration.curationSettings,t&&g!==null?{instanceName:g}:`skip`),j=C(a.agentFileCuration.requestCuration),[re,M]=(0,Y.useState)(null),[P,L]=(0,Y.useState)(null),{toast:R}=J(),B=(0,Y.useMemo)(()=>{let e=new Map;for(let t of D??[])e.has(t.name)||e.set(t.name,t);return e},[D]),H=(0,Y.useCallback)(async e=>{if(!(g===null||_===null)){M(e);try{let t=await j({instanceName:g,agentId:_,name:e,trigger:`manual`});t.ok?R({title:be(),variant:`success`}):R({title:w({reason:t.reason??`unknown`}),variant:`error`})}catch{R({title:I(),variant:`error`})}finally{M(null)}}},[j,g,_,R]),U=G(),W=(0,Y.useMemo)(()=>new Intl.NumberFormat(U,{maximumFractionDigits:0}),[U]);return e===void 0||l===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:A()}):(0,Q.jsxs)(`div`,{className:`oc-afiles`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:F()}),(0,Q.jsxs)(`div`,{className:`oc-afiles__picker`,children:[t&&(r?.length??0)>1?(0,Q.jsxs)(Pe,{value:i??``,onValueChange:e=>o(e),children:[(0,Q.jsx)(we,{size:`sm`,"aria-label":ie(),children:(0,Q.jsx)(He,{})}),(0,Q.jsx)(Ue,{children:(r??[]).map(e=>(0,Q.jsx)(ke,{value:e.name,children:e.name},e.name))})]}):null,l.length>0?(0,Q.jsxs)(Pe,{value:u??``,onValueChange:e=>d(e),children:[(0,Q.jsx)(we,{size:`sm`,"aria-label":V(),children:(0,Q.jsx)(He,{})}),(0,Q.jsx)(Ue,{children:l.map(e=>(0,Q.jsx)(ke,{value:$(e),children:e.label},$(e)))})]}):(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ce()})]}),f===null?null:v===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:A()}):v!==null&&v.blocked?(0,Q.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,Q.jsx)(q,{size:14,"aria-hidden":!0}),` `,qe(v.gatewayVersion,v.provider)]}):m.status===`loading`||m.status===`idle`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:A()}):m.status===`error`?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[k(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void b(),children:x()})]}):m.files.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:N()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`oc-afiles__list`,children:m.files.map(e=>{let n=Ye(e.size),r=n>=80;return(0,Q.jsxs)(`div`,{className:`oc-afiles__row`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__name`,title:e.name,children:e.name}),e.missing?(0,Q.jsx)(Ne,{variant:`outline`,children:ve()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`oc-afiles__size`,children:z({size:Z(e.size,U)})}),(0,Q.jsx)(`span`,{className:`oc-afiles__gauge${r?` is-warn`:``}`,"aria-hidden":!0,children:(0,Q.jsx)(`span`,{className:`oc-afiles__gauge-fill`,style:{width:`${Math.min(n,100)}%`}})}),(0,Q.jsx)(`span`,{className:`oc-afiles__pct`,children:ne({pct:W.format(n)})}),r?(0,Q.jsx)(q,{size:14,className:`oc-afiles__warn`,"aria-label":me()}):(0,Q.jsx)(`span`,{className:`oc-afiles__warn-slot`,"aria-hidden":!0})]}),(0,Q.jsx)(K,{variant:`outline`,size:`sm`,className:`oc-afiles__open`,onClick:()=>T(e),children:t?te():ae()}),t&&!e.missing?(0,Q.jsx)(nt,{curatable:Ke.includes(e.name),size:e.size??0,budget:O?.budgetChars??null,enabled:O?.enabled??!1,curation:B.get(e.name)??null,inFlight:re===e.name,onCurate:()=>void H(e.name),onReview:e=>L(e)}):null]},e.name)})}),(0,Q.jsx)(`p`,{className:`oc-afiles__budget`,children:oe({used:Z(Ze(m.files),U),total:Z(Je,U),pct:W.format(Xe(Ze(m.files)))})})]}),S&&f?(0,Q.jsx)(rt,{instanceName:f.instanceName,agentId:f.agentId,name:S.name,isAdmin:t,onClose:()=>T(null),onSaved:()=>void b()}):null,P?(0,Q.jsx)(it,{curationId:P,onClose:()=>L(null),onApplied:()=>{L(null),b()}}):null]})}function nt({curatable:e,size:t,budget:n,enabled:r,curation:i,inFlight:a,onCurate:o,onReview:s}){return i?.status===`proposed`?(0,Q.jsx)(K,{variant:`default`,size:`sm`,className:`oc-afiles__curate`,onClick:()=>s(i._id),children:D()}):a||i?.status===`dispatched`||i?.status===`applying`?(0,Q.jsx)(Ne,{variant:`outline`,className:`oc-afiles__curate-status`,children:Ce()}):e&&r&&n!==null&&Ge(t,n)?(0,Q.jsx)(K,{variant:`outline`,size:`sm`,className:`oc-afiles__curate`,onClick:o,children:xe()}):null}function rt({instanceName:e,agentId:t,name:n,isAdmin:o,onClose:c,onSaved:u}){let f=C(a.agentFiles.getAgentFile),h=C(a.agentFiles.setAgentFile),ee=J(),[w,te]=(0,Y.useState)(null),[T,E]=(0,Y.useState)(!1),[D,ne]=(0,Y.useState)(``),[O,k]=(0,Y.useState)(!1),[j,N]=(0,Y.useState)(!1),[P,F]=(0,Y.useState)(!1),[I,ie]=(0,Y.useState)(!1),L=(0,Y.useCallback)(async r=>{E(!1);try{let i=await f({instanceName:e,agentId:t,name:n});te({content:i.content,updatedAtMs:i.updatedAtMs}),r||ne(i.content),F(!1)}catch{E(!0)}},[f,e,t,n]);(0,Y.useEffect)(()=>{L(!1)},[L]);async function ae(){if(w!==null){N(!0),ie(!1);try{await h({instanceName:e,agentId:t,name:n,content:D,baseUpdatedAtMs:w.updatedAtMs??void 0}),ee.success(S({name:n})),u(),await L(!1)}catch(e){et(e)?F(!0):ie(!0)}finally{N(!1)}}}let R=w!==null&&D!==w.content,z=(0,Y.useMemo)(()=>w===null?null:$e(w.content,D),[w,D]),B=D.length>X,V=G(),H=(0,Y.useMemo)(()=>new Intl.NumberFormat(V),[V]);return(0,Q.jsx)(Be,{open:!0,onOpenChange:e=>!e&&c(),children:(0,Q.jsxs)(Fe,{className:`oc-afiles__editor`,children:[(0,Q.jsxs)(Ie,{children:[(0,Q.jsx)(Le,{children:fe({name:n})}),(0,Q.jsxs)(Re,{children:[U({agent:t,instance:e}),o?null:(0,Q.jsxs)(Q.Fragment,{children:[` · `,ge()]})]})]}),T?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[b(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void L(!1),children:x()})]}):w===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:A()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`textarea`,{className:`oc-afiles__source`,value:D,readOnly:!o,spellCheck:!1,onChange:e=>ne(e.target.value),"aria-label":fe({name:n})}),(0,Q.jsx)(`p`,{className:`oc-afiles__hint`,children:M()}),P?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[d(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void L(!0),children:de()})]}):null,I?(0,Q.jsx)(`p`,{className:`oc-afiles__error`,role:`alert`,children:y()}):null,(0,Q.jsxs)(`div`,{className:`oc-afiles__editor-foot`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__count${B?` is-over`:``}`,children:i({count:H.format(D.length),max:H.format(X)})}),o?(0,Q.jsx)(K,{size:`sm`,disabled:!R||j||P,onClick:()=>k(!0),children:j?r():m()}):null]})]}),(0,Q.jsx)(Ee,{open:O,onOpenChange:k,children:(0,Q.jsxs)(Te,{children:[(0,Q.jsxs)(De,{children:[(0,Q.jsx)(Me,{children:p({name:n})}),(0,Q.jsx)(Oe,{children:s({agent:t})})]}),z?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__diff-counts`,children:v({added:z.added,removed:z.removed})}),z.sampleAdded.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:g()}),z.sampleAdded.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-add`,children:e||` `},t))]}):null,z.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:l()}),z.sampleRemoved.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-del`,children:e||` `},t))]}):null]}):null,(0,Q.jsxs)(ze,{children:[(0,Q.jsx)(je,{children:re()}),(0,Q.jsx)(Ae,{onClick:()=>void ae(),children:_()})]})]})})]})})}function it({curationId:e,onClose:t,onApplied:n}){let i=E(a.agentFileCuration.getProposal,{curationId:e}),s=C(a.agentFileCuration.approveCuration),l=Se(a.agentFileCuration.rejectCuration),{toast:d}=J(),[p,m]=(0,Y.useState)(null),[g,_]=(0,Y.useState)(!1),[v,y]=(0,Y.useState)(``),b=G(),x=(0,Y.useMemo)(()=>i?$e(i.beforeContent,i.proposedContent):null,[i]);async function S(){m(`approve`);try{let t=await s({curationId:e});t.ok?(d({title:L(),variant:`success`}),n()):d({title:t.reason===`conflict`?le():P({reason:t.reason??`unknown`}),variant:`error`})}catch{d({title:I(),variant:`error`})}finally{m(null)}}async function w(n){m(`reject`);try{let r=v.trim();(await l({curationId:e,...r?{comment:r}:{},relaunch:n})).ok?d({title:n?h():H(),variant:`success`}):d({title:B(),variant:`error`}),t()}catch{d({title:I(),variant:`error`})}finally{m(null)}}return(0,Q.jsx)(Be,{open:!0,onOpenChange:e=>e?void 0:t(),children:(0,Q.jsxs)(Fe,{className:`oc-afiles__review`,children:[(0,Q.jsxs)(Ie,{children:[(0,Q.jsx)(Le,{children:i?j({name:i.name}):A()}),(0,Q.jsx)(Re,{children:ye()})]}),i===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:A()}):i===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:B()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`p`,{className:`oc-afiles__review-sizes`,children:[O({before:Z(i.beforeSize,b),after:Z(i.proposedSize,b)}),i.overBudget?(0,Q.jsxs)(Q.Fragment,{children:[` `,(0,Q.jsx)(q,{size:13,"aria-hidden":!0}),` `,he()]}):null]}),x?(0,Q.jsx)(`p`,{className:`oc-afiles__review-diff`,children:se({added:x.added,removed:x.removed})}):null,i.feedback?(0,Q.jsx)(`p`,{className:`oc-afiles__review-feedback`,children:c({feedback:i.feedback})}):null,x&&x.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__review-removed`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:_e()}),(0,Q.jsx)(`ul`,{children:x.sampleRemoved.map((e,t)=>(0,Q.jsx)(`li`,{children:e||`\xA0`},t))})]}):null,(0,Q.jsxs)(`div`,{className:`oc-afiles__review-panes oc-afiles__review-panes--2`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:W()}),(0,Q.jsx)(`pre`,{className:`oc-afiles__review-pre`,children:i.beforeContent})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:T()}),(0,Q.jsx)(`pre`,{className:`oc-afiles__review-pre`,children:i.proposedContent})]})]})]}),g?(0,Q.jsxs)(`div`,{className:`oc-afiles__reject-form`,children:[(0,Q.jsx)(`label`,{className:`oc-afiles__review-label`,htmlFor:`curation-reject-comment`,children:u()}),(0,Q.jsx)(`textarea`,{id:`curation-reject-comment`,className:`oc-afiles__reject-textarea`,rows:3,placeholder:ue(),value:v,onChange:e=>y(e.target.value)}),(0,Q.jsxs)(`div`,{className:`oc-afiles__review-actions`,children:[(0,Q.jsx)(K,{variant:`ghost`,onClick:()=>_(!1),disabled:p!==null,children:f()}),(0,Q.jsx)(K,{variant:`outline`,onClick:()=>void w(!1),disabled:p!==null,children:p===`reject`?r():o()}),(0,Q.jsx)(K,{variant:`default`,onClick:()=>void w(!0),disabled:p!==null,children:p===`reject`?r():ee()})]})]}):(0,Q.jsxs)(`div`,{className:`oc-afiles__review-actions`,children:[(0,Q.jsx)(K,{variant:`outline`,onClick:()=>_(!0),disabled:p!==null||i==null,children:R()}),(0,Q.jsx)(K,{variant:`default`,onClick:()=>void S(),disabled:p!==null||i==null,children:p===`approve`?r():pe()})]})]})})}export{tt as AgentFilesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Av as r,Bv as i,Cv as ee,Dv as te,E as a,Ev as ne,Fv as re,Hv as o,Iv as ie,Lv as ae,Mv as oe,Nv as s,Ov as c,Pv as l,Rv as u,Sv as d,Tv as f,Uv as p,Vv as m,_v as se,av as ce,bj as h,bv as g,cv as le,dv as ue,fv as de,gv as _,hv as fe,iv as v,jv as pe,kv as me,lv as he,mv as ge,nv as y,ov as b,pv as x,rv as S,sv as C,tv as w,uv as T,vv as E,wv as D,xv as O,yj as k,yv as A,zv as j}from"./dist-Bcr-KIFN.js";import{A as M,B as N,C as P,Gt as F,Kt as I,S as L,a as _e,at as R,b as z,r as ve,vt as ye,w as B,x as V,z as be}from"./index--Drh_B6c.js";import{n as xe}from"./TimeRangePicker-XUfGR5S2.js";import{t as Se}from"./FilterBar-CzpwZuGf.js";import{t as Ce}from"./DataTableShell-c6bvewGu.js";import{t as H}from"./dispatchErrorInfo-AjCvuCVv.js";var U=t(e(),1),W=n(),G=`__all__`,we=[{value:`open`},{value:`acknowledged`},{value:`resolved`}];function Te(e){return e===`open`?p():e===`acknowledged`?o():m()}var Ee=[`info`,`warn`,`critical`],De=[`detector`,`agent`,`user`],Oe={kind:`relative`,from:`now-30d`,to:`now`},ke=200,K=`all`;function q(){let e=I({from:`/settings/anomalies`}),t=F({from:`/settings/anomalies`}),n=e.q??``,o=e.status===K?G:e.status,p=e.severity??G,m=e.kind??G,[v,y]=(0,U.useState)(G),S=ve(e.from,e.to),{from:w,to:H}=xe(S),q=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),J=e=>void t({search:t=>({...t,status:e===G?K:e})}),Y=e=>void t({search:t=>({...t,severity:e===G?void 0:e})}),Pe=e=>void t({search:t=>({...t,kind:e===G?void 0:e})}),Fe=e=>void t({search:t=>({...t,..._e(e)})}),Ie=N(),X=be(),Z=k(a.anomalies.resolveAnomaly),Le=(h(a.me.getMe,{host:ye})?.permissions??[]).includes(`admin.manage`),Q=h(a.anomalies.listAnomalies,{limit:ke,filter:{q:n||void 0,from:w,to:H,anomalyStatus:o===G?void 0:o,severity:p===G?void 0:p,source:v===G?void 0:v,kind:m===G?void 0:m}}),$=(0,U.useMemo)(()=>{let e=new Set;for(let t of Q??[])e.add(t.kind);return[...e].sort()},[Q]),Re=n!==``||o!==`open`||p!==G||v!==G||m!==G||S.kind!==`relative`||S.from!==Oe.from;function ze(){y(G),t({search:{status:`open`},replace:!0})}async function Be(e){if(await Ie({title:i(),description:(0,W.jsxs)(W.Fragment,{children:[j(),` `,(0,W.jsx)(`span`,{className:`font-mono`,children:e.kind}),` `,u(),` `,(0,W.jsx)(`strong`,{children:ae()}),`.`,` `,ie()]}),confirmLabel:re()}))try{await Z({anomalyId:e._id,status:`resolved`}),X.success(l(),e.kind)}catch(e){X.error(s(),e)}}async function Ve(e){try{await Z({anomalyId:e._id,status:`acknowledged`}),X.success(oe(),e.kind)}catch(e){X.error(pe(),e)}}return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`p`,{className:`oc-admin__hint`,children:[r(),` `,(0,W.jsx)(`strong`,{children:me()}),` `,c(),` `,(0,W.jsx)(`strong`,{children:te()}),` `,ne(),` `,(0,W.jsx)(`strong`,{children:f()}),` `,D(),` `,(0,W.jsx)(`span`,{className:`oc-filter__window`,children:ee()})]}),(0,W.jsxs)(Se,{q:n,onQChange:q,searchPlaceholder:d(),timeRange:S,onTimeRangeChange:Fe,onReset:ze,canReset:Re,children:[(0,W.jsxs)(z,{value:o,onValueChange:J,children:[(0,W.jsx)(P,{size:`sm`,className:`w-36`,children:(0,W.jsx)(B,{})}),(0,W.jsxs)(V,{children:[(0,W.jsx)(L,{value:G,children:O()}),we.map(e=>(0,W.jsx)(L,{value:e.value,children:Te(e.value)},e.value))]})]}),(0,W.jsxs)(z,{value:p,onValueChange:Y,children:[(0,W.jsx)(P,{size:`sm`,className:`w-36`,children:(0,W.jsx)(B,{placeholder:g()})}),(0,W.jsxs)(V,{children:[(0,W.jsx)(L,{value:G,children:A()}),Ee.map(e=>(0,W.jsx)(L,{value:e,children:e},e))]})]}),(0,W.jsxs)(z,{value:v,onValueChange:y,children:[(0,W.jsx)(P,{size:`sm`,className:`w-32`,children:(0,W.jsx)(B,{placeholder:E()})}),(0,W.jsxs)(V,{children:[(0,W.jsx)(L,{value:G,children:se()}),De.map(e=>(0,W.jsx)(L,{value:e,children:e},e))]})]}),(0,W.jsxs)(z,{value:m,onValueChange:Pe,children:[(0,W.jsx)(P,{size:`sm`,className:`w-36`,children:(0,W.jsx)(B,{placeholder:_()})}),(0,W.jsxs)(V,{children:[(0,W.jsx)(L,{value:G,children:fe()}),$.map(e=>(0,W.jsx)(L,{value:e,children:e},e))]})]})]}),(0,W.jsx)(Ce,{title:ge(),rows:Q,emptyHint:o===`open`?x():de(),rowActions:e=>Le&&e.status===`open`?[{label:ue(),onSelect:()=>void Be(e)},{label:T(),onSelect:()=>void Ve(e)}]:[],columns:[{header:he(),cell:e=>(0,W.jsx)(`span`,{className:`oc-traces__time`,children:M(e.at)}),sort:e=>e.at},{header:_(),cell:e=>(0,W.jsx)(`code`,{className:`oc-traces__mono`,children:e.kind}),sort:e=>e.kind},{header:g(),cell:e=>(0,W.jsx)(je,{severity:e.severity}),sort:e=>e.severity===`critical`?2:+(e.severity===`warn`)},{header:le(),cell:e=>(0,W.jsx)(Me,{status:e.status}),sort:e=>e.status===`resolved`?2:+(e.status===`acknowledged`)},{header:E(),cell:e=>(0,W.jsx)(R,{variant:`outline`,children:e.source}),sort:e=>e.source},{header:C(),cell:e=>(0,W.jsx)(`span`,{className:`oc-anomaly__msg`,children:e.message}),sort:e=>e.message},{header:b(),cell:e=>(0,W.jsx)(Ae,{row:e}),sort:e=>e.evidence??null},{header:ce(),cell:e=>e.correlationId?(0,W.jsx)(`code`,{className:`oc-traces__mono`,children:Ne(e.correlationId)}):(0,W.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}),sort:e=>e.correlationId}]})]})}function J(e){if(e.kind!==`openclaw.dispatch_failures`||!e.evidence)return{};try{let t=JSON.parse(e.evidence);return{dominantCode:t.dominantCode,sampleCorrelationId:t.sampleCorrelationId}}catch{return{}}}function Y(e){if(e.kind!==`subagent.failure`||!e.evidence)return{};try{let t=JSON.parse(e.evidence);return{failedCount:t.failedCount,totalCount:t.totalCount,errorCategories:t.errorCategories}}catch{return{}}}function Ae({row:e}){let t=F();if(e.kind===`subagent.failure`){let n=Y(e);return(0,W.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,W.jsx)(`div`,{className:`oc-anomaly__cause-head`,children:[...new Set(n.errorCategories??[])].map(e=>(0,W.jsx)(`code`,{className:`oc-traces__mono`,children:e},e))}),e.correlationId?(0,W.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:e.correlationId,limit:100}}),children:[`↗ `,v()]}):null]})}let n=J(e);if(!n.dominantCode)return(0,W.jsx)(`span`,{className:`oc-traces__muted`,children:`—`});let r=H(n.dominantCode),i=n.sampleCorrelationId;return(0,W.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,W.jsxs)(`div`,{className:`oc-anomaly__cause-head`,children:[(0,W.jsx)(`span`,{className:`oc-anomaly__cause-label`,children:r.label}),(0,W.jsx)(`code`,{className:`oc-traces__mono`,children:n.dominantCode})]}),(0,W.jsx)(`p`,{className:`oc-anomaly__cause-hint`,children:r.hint}),i?(0,W.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:i,limit:100}}),children:[`↗ `,v()]}):null]})}function je({severity:e}){return(0,W.jsx)(`span`,{className:`oc-anomaly__sev oc-anomaly__sev--${e}`,children:e})}function Me({status:e}){return e===`open`?(0,W.jsx)(R,{variant:`destructive`,children:S()}):e===`acknowledged`?(0,W.jsx)(R,{variant:`secondary`,children:y()}):(0,W.jsx)(R,{variant:`outline`,children:w()})}function Ne(e){return e.length>8?e.slice(0,8):e}export{q as AnomaliesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{By as r,E as i,Fy as a,Gy as o,Hy as s,Iy as c,Jy as l,Ky as u,Ly as d,Py as f,Ry as p,Uy as m,Vy as h,Wy as g,_n as _,bj as v,bn as y,gn as b,hn as x,qy as S,vn as C,yn as w,zy as T}from"./dist-Bcr-KIFN.js";import{A as E,C as D,Gt as O,Kt as k,S as A,a as j,b as M,i as N,o as P,r as F,t as I,w as L,x as R}from"./index--Drh_B6c.js";import{n as ee}from"./TimeRangePicker-XUfGR5S2.js";import{t as z}from"./FilterBar-CzpwZuGf.js";import{t as B}from"./AdvancedFilter-UZD1c3U9.js";import{t as V}from"./DataTableShell-c6bvewGu.js";var H=t(e(),1),U=n(),W={kind:`relative`,from:I,to:`now`},G=`__all__`,K=[{value:`action`,label:y()},{value:`realLabel`,label:w()},{value:`targetLabel`,label:C()},{value:`impersonated`,label:_()},{value:`resource`,label:b()},{value:`resourceId`,label:x()}];function q(){let e=k({from:`/settings/audit`}),t=O({from:`/settings/audit`}),n=e.q??``,_=e.action??G,y=e.impersonated??G,b=e.resource??G,x=F(e.from,e.to),C=(0,H.useMemo)(()=>P(e.adv),[e.adv]),{from:w,to:I}=ee(x),q=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),J=e=>void t({search:t=>({...t,action:e===G?void 0:e})}),Y=e=>void t({search:t=>({...t,impersonated:e===G?void 0:e})}),X=e=>void t({search:t=>({...t,resource:e===G?void 0:e})}),Z=e=>void t({search:t=>({...t,...j(e)})}),Q=e=>void t({search:t=>({...t,adv:N(e)}),replace:!0}),$=v(i.admin.listAudit,{filter:{q:n||void 0,from:w,to:I,action:_===G?void 0:_,resource:b===G?void 0:b,impersonated:y===G?void 0:y===`yes`,advanced:C.length>0?C:void 0}}),te=(0,H.useMemo)(()=>{let e=new Set;for(let t of $??[])e.add(t.action);return[...e].sort()},[$]),ne=(0,H.useMemo)(()=>{let e=new Set;for(let t of $??[])t.resource&&e.add(t.resource);return[...e].sort()},[$]),re=n!==``||_!==G||y!==G||b!==G||C.length>0||x.kind!==`relative`||x.from!==W.from;function ie(){t({search:{},replace:!0})}return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`oc-admin__hint`,children:[l(),` `,(0,U.jsx)(`span`,{className:`oc-filter__window`,children:S()})]}),(0,U.jsxs)(z,{q:n,onQChange:q,searchPlaceholder:u(),timeRange:x,onTimeRangeChange:Z,onReset:ie,canReset:re,children:[(0,U.jsxs)(M,{value:_,onValueChange:J,children:[(0,U.jsx)(D,{size:`sm`,className:`w-40`,children:(0,U.jsx)(L,{placeholder:o()})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(A,{value:G,children:g()}),te.map(e=>(0,U.jsx)(A,{value:e,children:e},e))]})]}),(0,U.jsxs)(M,{value:y,onValueChange:Y,children:[(0,U.jsx)(D,{size:`sm`,className:`w-40`,children:(0,U.jsx)(L,{})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(A,{value:G,children:m()}),(0,U.jsx)(A,{value:`yes`,children:s()}),(0,U.jsx)(A,{value:`no`,children:h()})]})]}),(0,U.jsxs)(M,{value:b,onValueChange:X,children:[(0,U.jsx)(D,{size:`sm`,className:`w-40`,children:(0,U.jsx)(L,{placeholder:r()})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(A,{value:G,children:T()}),ne.map(e=>(0,U.jsx)(A,{value:e,children:e},e))]})]})]}),(0,U.jsx)(B,{fields:K,seed:C,onChange:Q}),(0,U.jsx)(V,{title:p(),rows:$,emptyHint:d(),columns:[{header:c(),cell:e=>E(e.at),sort:e=>e.at},{header:o(),cell:e=>e.action,sort:e=>e.action},{header:a(),cell:e=>e.realLabel,sort:e=>e.realLabel},{header:f(),cell:e=>e.targetLabel??`—`,sort:e=>e.targetLabel??null},{header:r(),cell:e=>e.resource?e.resource+(e.resourceId?` · ${e.resourceId.slice(0,8)}`:``):`—`,sort:e=>e.resource??null}]})]})}export{q as AuditTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$h as r,$m as i,Am as a,As as o,Bm as s,Bt as c,Cs as l,D as u,Dm as d,Ds as f,E as p,Em as m,Es as h,Fm as g,Gm as _,Hh as ee,Hm as v,Im as y,Jh as te,Jm as ne,Kh as re,Km as ie,Lm as ae,Lt as oe,Mm as se,Nm as ce,Om as le,Os as ue,Pm as de,Qh as fe,Qm as pe,Rm as me,Rt as he,Ss as ge,Tm as _e,Ts as b,Uh as ve,Um as ye,Vm as be,Vt as xe,Wm as Se,Wt as Ce,Xh as we,Xm as Te,Yh as Ee,Ym as De,Zh as Oe,Zm as ke,_h as Ae,_j as je,ah as Me,bh as Ne,bj as x,bs as Pe,ch as Fe,dh as Ie,eh as Le,fh as Re,gh as ze,hh as Be,ih as Ve,jm as He,km as Ue,ks as We,lh as Ge,mh as Ke,ms as qe,ng as Je,nh as Ye,oh as Xe,ph as Ze,qh as Qe,qm as $e,rh as et,sh as tt,tg as nt,th as rt,uh as it,vh as at,vs as ot,ws as st,xs as ct,yh as lt,yj as ut,ys as dt,zm as S,zt as ft}from"./dist-Bcr-KIFN.js";import{i as C,r as pt}from"./dist-BvTSSv91.js";import{t as mt}from"./chevrons-up-down-BEdda7QD.js";import{i as ht,n as w,o as gt,r as _t,s as vt}from"./FieldLabel-DYhOcc_e.js";import{i as yt,n as bt,r as xt,t as St}from"./tabs-DMDS7i26.js";import{t as Ct}from"./button-CvJAYeHx.js";import{A as wt,At as T,C as E,Dt as D,Gt as O,It as Tt,Kt as Et,Q as Dt,S as k,Ut as A,Wt as Ot,X as kt,Z as At,at as j,b as M,ct as jt,dt as Mt,ft as Nt,j as N,lt as Pt,m as Ft,ot as P,p as It,st as Lt,vt as Rt,w as F,x as I,z as zt}from"./index--Drh_B6c.js";import{r as Bt}from"./locales-CPjguROj.js";import{a as Vt,i as L,n as Ht,o as R,r as z,t as B}from"./table-CrooMP5e.js";import{t as Ut}from"./FilterBar-CzpwZuGf.js";import{a as V,n as Wt,o as H,r as U,s as Gt,t as Kt}from"./compatView-BHy79k8P.js";import{t as W}from"./dispatchErrorInfo-AjCvuCVv.js";var qt=u(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Jt=u(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),G=t(e(),1);function K(e){return e.filter(e=>e.state===`error`)}function Yt(e){return e.reachable&&K(e.targets).length===0}function Xt(e){return e.state===`error`&&e.lastErrorCode!==null}function Zt(e){return!!e.lastDownstreamRejectCode}function q(e){return e.kind??`openclaw`}function Qt(e){return[...e].sort((e,t)=>e===`openclaw`?-1:t===`openclaw`?1:e.localeCompare(t))}function $t(e,t,n){let r=new Map;for(let e of t)e.instanceName&&r.set(e.instanceName,e.provider);for(let e of n)r.set(e.name,q(e));let i=e=>(e.instanceName?r.get(e.instanceName):void 0)??`openclaw`,a=new Set;for(let e of n)a.add(q(e));for(let e of t)a.add(e.provider);for(let t of e)a.add(i(t));return Qt(a).map(r=>({key:r,connections:e.filter(e=>i(e)===r),compatTargets:t.filter(e=>e.provider===r),instances:n.filter(e=>q(e)===r)}))}function J(e){return e===`openclaw`?`OpenClaw`:e===`hermes`?`Hermes`:e.charAt(0).toUpperCase()+e.slice(1)}var Y=`__all__`,en={q:``,state:Y,instance:Y,version:Y},X={connected:0,error:1,idle:2};function tn(e){return e.q.trim()!==``||e.state!==`__all__`||e.instance!==`__all__`||e.version!==`__all__`}function nn(e,t){let n=t.q.trim().toLowerCase();return e.filter(e=>!(n&&!`${e.targetLabel} ${e.gatewayHost}`.toLowerCase().includes(n)||t.state!==`__all__`&&e.state!==t.state||t.instance!==`__all__`&&(e.instanceName??``)!==t.instance||t.version!==`__all__`&&(e.gatewayVersion??``)!==t.version))}function Z(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`})}function rn(e,t){return e===`version`?t.gatewayVersion===null:e===`lastOk`?t.lastOkAt===null:!1}function an(e,t,n){switch(e){case`state`:return(X[t.state]??99)-(X[n.state]??99);case`instance`:return Z(t.instanceLabel??t.instanceName??``,n.instanceLabel??n.instanceName??``);case`host`:return Z(t.gatewayHost,n.gatewayHost);case`version`:{let e=t.gatewayVersion,r=n.gatewayVersion;return H(e,r)??Z(e,r)}case`lastOk`:return t.lastOkAt-n.lastOkAt;default:return Z(t.targetLabel,n.targetLabel)}}function on(e,t){if(!t)return e;let n=t.dir===`asc`?1:-1;return[...e].sort((e,r)=>{let i=rn(t.key,e),a=rn(t.key,r);return i&&a?0:i?1:a?-1:n*an(t.key,e,r)})}function sn(e){let t=new Set;for(let n of e)t.add(n.state);return[...t].sort((e,t)=>(X[e]??99)-(X[t]??99))}function cn(e){let t=new Map;for(let n of e)n.instanceName!==null&&(t.has(n.instanceName)||t.set(n.instanceName,n.instanceLabel??n.instanceName));return[...t.entries()].map(([e,t])=>({name:e,label:t})).sort((e,t)=>Z(e.label,t.label))}function ln(e){let t=new Set;for(let n of e)n.gatewayVersion!==null&&t.add(n.gatewayVersion);return[...t].sort((e,t)=>H(e,t)??Z(e,t))}var Q=n();function un({connections:e,displayByInstance:t}){let[n,r]=(0,G.useState)(en),[i,o]=(0,G.useState)(null),c=(0,G.useMemo)(()=>e.map((e,n)=>({_id:`${e.key}:${e.canonical}/${e.agentId}:${n}`,targetLabel:`${e.canonical}/${e.agentId}`,state:e.state,instanceName:e.instanceName??null,instanceLabel:e.instanceName?t.get(e.instanceName)??e.instanceName:null,gatewayHost:e.gatewayHost,gatewayVersion:e.gatewayVersion??null,okCount:e.okCount,errorCount:e.errorCount,attempts:e.attempts,lastOkAt:e.lastOkAt??null,lastErrorCode:e.lastErrorCode??null,lastErrorAt:e.lastErrorAt??null,lastDownstreamRejectCode:e.lastDownstreamRejectCode??null,lastDownstreamRejectAt:e.lastDownstreamRejectAt??null})),[e,t]),l=(0,G.useMemo)(()=>sn(c),[c]),u=(0,G.useMemo)(()=>cn(c),[c]),d=(0,G.useMemo)(()=>ln(c),[c]),f=(0,G.useMemo)(()=>on(nn(c,n),i),[c,n,i]);function p(e){o(t=>t?.key===e?t.dir===`asc`?{key:e,dir:`desc`}:null:{key:e,dir:`asc`})}return e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ye()}):(0,Q.jsxs)(`div`,{className:`oc-conn`,children:[(0,Q.jsxs)(Ut,{q:n.q,onQChange:e=>r(t=>({...t,q:e})),searchPlaceholder:s(),onReset:()=>r(en),canReset:tn(n),children:[(0,Q.jsxs)(M,{value:n.state,onValueChange:e=>r(t=>({...t,state:e})),children:[(0,Q.jsx)(E,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(F,{placeholder:me()})}),(0,Q.jsxs)(I,{children:[(0,Q.jsx)(k,{value:Y,children:S()}),l.map(e=>(0,Q.jsx)(k,{value:e,children:fn(e)},e))]})]}),(0,Q.jsxs)(M,{value:n.instance,onValueChange:e=>r(t=>({...t,instance:e})),children:[(0,Q.jsx)(E,{size:`sm`,className:`w-40`,children:(0,Q.jsx)(F,{placeholder:ae()})}),(0,Q.jsxs)(I,{children:[(0,Q.jsx)(k,{value:Y,children:S()}),u.map(e=>(0,Q.jsx)(k,{value:e.name,children:e.label},e.name))]})]}),(0,Q.jsxs)(M,{value:n.version,onValueChange:e=>r(t=>({...t,version:e})),children:[(0,Q.jsx)(E,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(F,{placeholder:y()})}),(0,Q.jsxs)(I,{children:[(0,Q.jsx)(k,{value:Y,children:S()}),d.map(e=>(0,Q.jsx)(k,{value:e,children:e},e))]})]})]}),f.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:g()}):(0,Q.jsxs)(B,{className:`oc-conn__table`,children:[(0,Q.jsx)(Vt,{children:(0,Q.jsxs)(R,{children:[(0,Q.jsx)($,{label:de(),sortKey:`target`,sort:i,onSort:p}),(0,Q.jsx)($,{label:ce(),sortKey:`state`,sort:i,onSort:p}),(0,Q.jsx)($,{label:se(),sortKey:`instance`,sort:i,onSort:p}),(0,Q.jsx)($,{label:He(),sortKey:`host`,sort:i,onSort:p}),(0,Q.jsx)($,{label:a(),sortKey:`version`,sort:i,onSort:p}),(0,Q.jsx)(L,{children:Ue()}),(0,Q.jsx)($,{label:le(),sortKey:`lastOk`,sort:i,onSort:p})]})}),(0,Q.jsx)(Ht,{children:f.map(e=>(0,Q.jsx)(dn,{r:e},e._id))})]})]})}function $({label:e,sortKey:t,sort:n,onSort:r}){let i=n?.key===t,a=i?n.dir:null;return(0,Q.jsx)(L,{"aria-sort":i?a===`asc`?`ascending`:`descending`:`none`,children:(0,Q.jsxs)(`button`,{type:`button`,className:`oc-conn__sort`,onClick:()=>r(t),children:[e,i?a===`asc`?(0,Q.jsx)(pt,{size:13,"aria-hidden":!0}):(0,Q.jsx)(C,{size:13,"aria-hidden":!0}):(0,Q.jsx)(mt,{size:13,"aria-hidden":!0,className:`oc-conn__sort-idle`})]})})}function dn({r:e}){let t=Xt(e)?W(e.lastErrorCode):null,n=Zt(e)?W(e.lastDownstreamRejectCode):null;return(0,Q.jsxs)(G.Fragment,{children:[(0,Q.jsxs)(R,{className:`oc-conn__row oc-conn__row--${e.state}`,children:[(0,Q.jsx)(z,{children:(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.targetLabel})}),(0,Q.jsx)(z,{children:(0,Q.jsx)(pn,{state:e.state})}),(0,Q.jsx)(z,{children:e.instanceLabel?(0,Q.jsx)(`span`,{className:`oc-bridge-target__instance`,children:e.instanceLabel}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Q.jsx)(z,{children:(0,Q.jsx)(`span`,{className:`oc-bridge-target__host`,children:e.gatewayHost})}),(0,Q.jsx)(z,{children:e.gatewayVersion?(0,Q.jsx)(`span`,{className:`oc-bridge-target__version`,children:e.gatewayVersion}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Q.jsx)(z,{children:(0,Q.jsx)(`span`,{className:`oc-conn__stats`,children:v({ok:e.okCount,errors:e.errorCount,attempts:e.attempts})})}),(0,Q.jsx)(z,{children:e.lastOkAt?(0,Q.jsx)(`span`,{className:`oc-traces__mono`,children:N(e.lastOkAt)}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})})]}),t||n?(0,Q.jsx)(R,{className:`oc-conn__detail-row`,children:(0,Q.jsxs)(z,{colSpan:7,className:`oc-conn__detail-cell`,children:[t?(0,Q.jsxs)(`div`,{className:`oc-bridge-target__error`,children:[(0,Q.jsx)(`strong`,{children:t.label}),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastErrorCode}),e.lastErrorAt?` · ${N(e.lastErrorAt)}`:``,(0,Q.jsx)(`p`,{className:`oc-bridge-card__hint`,children:t.hint})]}):null,n?(0,Q.jsxs)(`div`,{className:`oc-bridge-target__downstream`,children:[be({label:n.label}),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastDownstreamRejectCode}),e.lastDownstreamRejectAt?` · ${N(e.lastDownstreamRejectAt)}`:``]}):null]})}):null]})}function fn(e){return e===`connected`?d():e===`error`?m():_e()}function pn({state:e}){return e===`connected`?(0,Q.jsx)(j,{variant:`secondary`,children:d()}):e===`error`?(0,Q.jsx)(j,{variant:`destructive`,children:m()}):(0,Q.jsx)(j,{variant:`outline`,children:_e()})}function mn(){return x(p.bridgeHealth.getBridgeHealth,{})}function hn(){let e=mn(),t=x(p.compat.getBridgeCompat,{}),n=x(p.me.getMe,{host:Rt})?.role===`admin`,r=x(p.admin.listInstances,n?{}:`skip`),i=x(p.agents.usageForInstances,n?{}:`skip`),a=O(),o=()=>void a({to:`/settings/anomalies`,search:{status:`open`}}),s=$t(e?e.targets:[],t?t.targets:[],r??[]),{section:l}=Et({from:`/settings/bridge`}),u=O({from:`/settings/bridge`}),d=t?.compat??null,f=t===void 0?`loading`:t===null?`nodata`:`ready`,m=d!==null&&Wt(d,`hermes`)&&!s.some(e=>e.key===`hermes`);return(0,Q.jsxs)(`div`,{className:`oc-bridge`,children:[(0,Q.jsx)(gn,{health:e,compat:t,onSeeAnomalies:o}),(0,Q.jsx)(`p`,{className:`oc-admin__hint oc-bridge__caption`,children:Xe()}),i&&i.length>0?(0,Q.jsxs)(`section`,{className:`oc-bridge__usage`,children:[(0,Q.jsx)(`h3`,{className:`oc-bridge__usage-title`,children:Me()}),(0,Q.jsxs)(B,{children:[(0,Q.jsx)(Vt,{children:(0,Q.jsxs)(R,{children:[(0,Q.jsx)(L,{children:xe()}),(0,Q.jsx)(L,{children:c()}),(0,Q.jsx)(L,{children:ft()}),(0,Q.jsx)(L,{children:he()}),(0,Q.jsx)(L,{children:oe()})]})}),(0,Q.jsx)(Ht,{children:i.flatMap(e=>{let t=Ft(e.usage,Date.now());return t?t.windows.map((t,n)=>(0,Q.jsxs)(R,{children:[(0,Q.jsx)(z,{className:`font-medium`,children:n===0?e.instanceName:``}),(0,Q.jsx)(z,{children:t.provider}),(0,Q.jsx)(z,{children:t.label}),(0,Q.jsx)(z,{children:(0,Q.jsxs)(j,{variant:t.percentLeft<=10?`destructive`:t.percentLeft<=25?`outline`:`secondary`,children:[t.percentLeft,`%`]})}),(0,Q.jsx)(z,{className:`text-muted-foreground`,children:t.resetText??`—`})]},`${e.instanceName}:${t.provider}:${t.label}`)):[]})})]})]}):null,s.length>0?(0,Q.jsxs)(St,{value:s.some(e=>e.key===l)?l:s[0]?.key??`openclaw`,onValueChange:e=>void u({search:{section:e},replace:!0}),children:[(0,Q.jsx)(xt,{className:`w-full`,children:s.map(e=>(0,Q.jsxs)(yt,{value:e.key,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(T,{size:13,"aria-hidden":!0}),J(e.key)]},e.key))}),s.map(e=>(0,Q.jsx)(bt,{value:e.key,children:(0,Q.jsx)(_n,{providerKey:e.key,connections:e.connections,instances:e.instances,manifest:d,compatStatus:f,compatReachable:t?.reachable??!0,protocol:e.key===`openclaw`?t?.protocol??null:null})},e.key))]}):null,m?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:qe()}):null]})}function gn({health:e,compat:t,onSeeAnomalies:n}){let r=t!=null&&t.buildVersion!=null&&t.bridgeVersion!=null&&t.buildVersion!==t.bridgeVersion,i=t?.buildRevision&&t.buildRevision!==`unknown`?t.buildRevision.slice(0,7):null,a=t&&t!==null?(0,Q.jsxs)(`span`,{className:`oc-bridge-card__ver`,children:[(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:V(t.bridgeVersion)}),i?(0,Q.jsxs)(Q.Fragment,{children:[` `,(0,Q.jsxs)(`code`,{className:`oc-traces__mono`,title:ue(),children:[`(`,i,`)`]})]}):null,r?(0,Q.jsxs)(`strong`,{className:`oc-bridge-card__mismatch`,children:[` `,f({build:t.buildVersion??`?`})]}):null,` · `,h(),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:t.protocolVersion===null?b():String(t.protocolVersion)})]}):null;if(e===void 0)return(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:pe()});if(e===null)return(0,Q.jsx)(`div`,{className:`oc-bridge-card oc-bridge-card--idle`,children:ke()});let o=K(e.targets),s=!e.reachable,c=Yt(e),l=c?`ok`:`error`,u=wt(e.checkedAt),d=e.startedAt==null?null:wt(e.startedAt);return(0,Q.jsxs)(`div`,{className:`oc-bridge-card oc-bridge-card--${l}`,children:[(0,Q.jsx)(`div`,{className:`oc-bridge-card__icon`,"aria-hidden":!0,children:c?(0,Q.jsx)(A,{size:22}):s?(0,Q.jsx)(Jt,{size:22}):(0,Q.jsx)(D,{size:22})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__body`,children:[(0,Q.jsx)(`div`,{className:`oc-bridge-card__title`,children:c?Te():s?De():ne({count:o.length})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__meta`,children:[(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(qt,{size:12,"aria-hidden":!0}),` `,$e({time:u})]}),d?(0,Q.jsx)(`span`,{children:ie({time:d})}):null,a]}),s?(0,Q.jsx)(`p`,{className:`oc-bridge-card__hint`,children:W(e.lastError===`not_configured`?`NOT_CONFIGURED`:`BRIDGE_UNREACHABLE`).hint}):null]}),(0,Q.jsx)(`button`,{type:`button`,className:`oc-bridgebar__drill`,onClick:n,children:_()})]})}function _n({providerKey:e,connections:t,instances:n,manifest:r,compatStatus:i,compatReachable:a,protocol:s}){let c=r?Gt(r,e):null,l=new Map;for(let e of n)l.set(e.name,e.displayName??e.name);let u=[],d=new Set;for(let n of t){if(!n.instanceName||d.has(n.instanceName))continue;d.add(n.instanceName);let t=n.gatewayVersion??null;u.push({instanceName:n.instanceName,displayName:l.get(n.instanceName)??n.instanceName,version:t,state:Kt(t,e,r)})}let f=u.map(e=>e.state),p=f.includes(`beyond`)?`beyond`:f.length>0&&f.every(e=>e===`supported`)?`supported`:null,[m,h]=(0,G.useState)(!1);return(0,Q.jsxs)(`section`,{className:`oc-bridge-provider`,children:[(0,Q.jsxs)(`header`,{className:`oc-bridge-provider__head`,children:[(0,Q.jsx)(T,{size:15,"aria-hidden":!0,className:`oc-bridge-provider__icon`}),(0,Q.jsx)(`span`,{className:`oc-bridge-provider__name`,children:J(e)}),p?(0,Q.jsx)(j,{variant:p===`beyond`?`destructive`:`secondary`,children:U(p)}):null]}),(0,Q.jsx)(`h4`,{className:`oc-bridge-provider__sub`,children:o()}),(0,Q.jsx)(yn,{providerName:J(e),support:c,compatStatus:i,compatReachable:a,manifest:r,instanceRows:u}),s?(0,Q.jsx)(vn,{protocol:s}):null,(0,Q.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":m,onClick:()=>h(e=>!e),children:[m?(0,Q.jsx)(C,{size:13,"aria-hidden":!0}):(0,Q.jsx)(Ot,{size:13,"aria-hidden":!0}),Se({count:t.length})]}),m?(0,Q.jsx)(un,{connections:t,displayByInstance:l}):null]})}function vn({protocol:e}){let[t,n]=(0,G.useState)(!1),r=e.coverage,a=e.drift??[];return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`h4`,{className:`oc-bridge-provider__sub`,children:[Ve(),a.length>0?(0,Q.jsx)(j,{variant:`destructive`,children:Ye({count:a.length})}):(0,Q.jsx)(j,{variant:`secondary`,children:et()})]}),(0,Q.jsxs)(`p`,{className:`oc-admin__hint`,children:[rt({version:e.vendoredVersion}),r?` · `+Le({handled:r.handled,ignored:r.ignored,gaps:r.gaps}):null]}),a.length>0?(0,Q.jsx)(`ul`,{className:`oc-bridge-protocol__list`,role:`list`,children:a.map(e=>(0,Q.jsxs)(`li`,{children:[(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.shape}),` × `,e.count]},e.shape))}):null,r&&r.gapList.length>0?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[t?(0,Q.jsx)(C,{size:13,"aria-hidden":!0}):(0,Q.jsx)(Ot,{size:13,"aria-hidden":!0}),i({count:r.gapList.length})]}),t?(0,Q.jsx)(`ul`,{className:`oc-bridge-protocol__list`,role:`list`,children:r.gapList.map(e=>(0,Q.jsx)(`li`,{children:(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e})},e))}):null]}):null]})}function yn({support:e,compatStatus:t,compatReachable:n,manifest:r,instanceRows:i,providerName:a}){return t===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:pe()}):t===`nodata`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:We()}):(0,Q.jsxs)(`div`,{className:`oc-compat`,children:[n?null:(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:st()}),r===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):(0,Q.jsxs)(`div`,{className:`oc-compat__support`,children:[(0,Q.jsx)(`span`,{className:`oc-compat__label`,children:Ce({provider:a})}),e&&e.range!==null?(0,Q.jsx)(`span`,{children:ge({min:e.range.min,max:e.range.maxValidated})}):(0,Q.jsx)(`span`,{children:b()}),e?(0,Q.jsx)(Cn,{versions:e.validatedVersions}):null]}),i.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ot()}):(0,Q.jsx)(`div`,{className:`oc-compat__targets`,children:i.map(e=>(0,Q.jsxs)(`div`,{className:`oc-compat__target`,children:[(0,Q.jsx)(`span`,{className:`oc-compat__instance`,children:e.displayName}),(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:V(e.version)}),(0,Q.jsx)(j,{variant:e.state===`supported`?`secondary`:e.state===`beyond`?`destructive`:`outline`,children:U(e.state)})]},e.instanceName))})]})}function bn({instance:e,onClose:t}){return(0,Q.jsx)(Lt,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Q.jsxs)(jt,{className:`oc-bridge-config-dialog`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Q.jsxs)(Mt,{children:[(0,Q.jsx)(Nt,{children:Je({instance:e.displayName??e.name})}),(0,Q.jsx)(Pt,{children:nt()})]}),(0,Q.jsx)(Sn,{instance:e,onClose:t})]})})}function xn({label:e,result:t}){return t?t.checked?(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row `+(t.ok?`oc-bridge-config__check-row--ok`:`oc-bridge-config__check-row--err`),children:[t.ok?(0,Q.jsx)(A,{"aria-hidden":!0}):(0,Q.jsx)(D,{"aria-hidden":!0}),(0,Q.jsxs)(`span`,{children:[e,` — `,t.ok?it():t.detail]})]}):(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--skip`,children:[e,` — `,Ge()]}):null}function Sn({instance:e,onClose:t}){let n=ut(p.admin.upsertInstanceConfig),i=je(p.bridge.validateMediaPaths),a=zt(),o=Bt(e.config?.contentLocale,void 0),[s,c]=(0,G.useState)(()=>ht(e.config??{},o)),[l,u]=(0,G.useState)(!1),[d,f]=(0,G.useState)(!1),[m,h]=(0,G.useState)(null),g=s.inboundMediaMode===`shared-fs`,_=s.mediaMode===`shared-fs`,v=g||_;async function y(){f(!0),h(null);try{h(await i({instanceName:e.name,inboundMediaMode:s.inboundMediaMode,mediaMode:s.mediaMode}))}catch(e){a.error(Ke(),e)}finally{f(!1)}}async function ne(){u(!0);try{let r=e.config??{};await n({instanceId:e._id,config:_t(s,r,o)}),t()}catch(e){a.error(te(),e)}finally{u(!1)}}return(0,Q.jsx)(`div`,{className:`oc-bridge-config`,children:(0,Q.jsxs)(`div`,{className:`oc-bridge-config__form`,children:[(0,Q.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(w,{label:r(),help:Qe()}),(0,Q.jsxs)(M,{value:s.mediaMode,onValueChange:e=>c({...s,mediaMode:e}),children:[(0,Q.jsx)(E,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(F,{})}),(0,Q.jsx)(I,{children:vt.map(e=>(0,Q.jsx)(k,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(w,{label:fe(),help:re()}),(0,Q.jsxs)(M,{value:s.inboundMediaMode,onValueChange:e=>c({...s,inboundMediaMode:e}),children:[(0,Q.jsx)(E,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(F,{})}),(0,Q.jsx)(I,{children:gt.map(e=>(0,Q.jsx)(k,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(w,{label:Oe(),help:ve()}),(0,Q.jsx)(P,{type:`number`,min:1,max:4096,className:`w-full`,value:s.mediaMaxMb,onChange:e=>c({...s,mediaMaxMb:Math.trunc(Number(e.target.value)||0)})})]})]}),v&&(0,Q.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[g&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(w,{label:Ne(),help:lt()}),(0,Q.jsx)(P,{className:`w-full`,spellCheck:!1,value:s.inboundAgentMount,onChange:e=>c({...s,inboundAgentMount:e.target.value})})]}),_&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(w,{label:at(),help:Ae()}),(0,Q.jsx)(P,{className:`w-full`,spellCheck:!1,value:s.outboundAgentMount,onChange:e=>c({...s,outboundAgentMount:e.target.value})})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Q.jsx)(It,{checked:s.rehydration,onCheckedChange:e=>c({...s,rehydration:e===!0})}),(0,Q.jsx)(w,{label:we(),help:ee()})]}),v&&m!==null&&(0,Q.jsx)(`div`,{className:`oc-bridge-config__check`,children:m.reachable?!m.inbound&&!m.outbound?(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(D,{"aria-hidden":!0}),tt({reason:m.reason??`?`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(xn,{label:Re(),result:m.inbound}),(0,Q.jsx)(xn,{label:Ie(),result:m.outbound}),(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Ze()})]}):(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(D,{"aria-hidden":!0}),Fe()]})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-config__actions`,children:[v&&(0,Q.jsxs)(Ct,{variant:`outline`,size:`sm`,onClick:()=>void y(),disabled:d,children:[d?(0,Q.jsx)(Tt,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,d?Be():ze()]}),(0,Q.jsx)(Ct,{size:`sm`,onClick:()=>void ne(),disabled:l,children:Ee()})]})]})})}function Cn({versions:e}){if(e.length===0)return null;let t=[...e].reverse();return(0,Q.jsxs)(kt,{children:[(0,Q.jsx)(Dt,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,className:`oc-compat__versions-btn`,children:[e.length===1?ct():Pe({count:e.length}),(0,Q.jsx)(C,{size:13,"aria-hidden":!0})]})}),(0,Q.jsxs)(At,{className:`oc-compat__versions-pop`,align:`start`,children:[(0,Q.jsx)(`p`,{className:`oc-compat__versions-title`,children:dt()}),(0,Q.jsx)(`div`,{className:`oc-compat__versions-list`,children:t.map(e=>(0,Q.jsx)(j,{variant:`secondary`,children:e},e))})]})]})}export{hn as BridgeTab,bn as InstanceConfigDialog};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$c as r,E as i,Fs as a,Is as o,Kc as s,Ls as c,Ms as l,Ns as u,Ps as d,Rs as f,Ut as p,Zc as m,_j as h,bj as g,ci as _,di as v,dj as y,eg as b,fi as x,hc as S,js as C,li as w,oi as T,qc as E,si as D,ui as O,yj as k,zs as A}from"./dist-Bcr-KIFN.js";import{t as j}from"./button-CvJAYeHx.js";import{C as M,Dt as N,S as P,b as F,d as I,f as L,ot as R,p as z,w as B,x as V,y as H}from"./index--Drh_B6c.js";import{i as U}from"./compatView-BHy79k8P.js";/* empty css */var W=t(e(),1),G=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function K(e){let t=typeof e==`object`&&e?e:{},n=t.defaults!==null&&typeof t.defaults==`object`?t.defaults:{},r=n.thinkingDefault??t.thinkingDefault,i=n.fastModeDefault??t.fastModeDefault;return{thinkingDefault:typeof r==`string`?r:null,fastModeDefault:typeof i==`boolean`?i:null}}var q=n();function J({instance:e}){let t=k(i.admin.upsertInstanceConfig),n=e.config?.curationEnabled===!0,a=typeof e.config?.curationBudgetChars==`number`?e.config.curationBudgetChars:null,[o,s]=(0,W.useState)(n),[c,d]=(0,W.useState)(a===null?``:String(a)),[f,p]=(0,W.useState)(`idle`);(0,W.useEffect)(()=>{s(n),d(a===null?``:String(a)),p(`idle`)},[e._id,n,a]);let m=c.trim(),h=m===``?null:/^\d+$/.test(m)?Number.parseInt(m,10):NaN,g=!o||h===null||Number.isInteger(h)&&h>=4e3&&h<=6e4,v=o!==n||(h??null)!==a;async function y(){p(`saving`);try{let n={...e.config??{}};n.curationEnabled=o,!o||h===null||Number.isNaN(h)?delete n.curationBudgetChars:n.curationBudgetChars=h,await t({instanceId:e._id,config:n}),p(`done`)}catch{p(`error`)}}return(0,q.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,q.jsx)(z,{checked:o,onCheckedChange:e=>s(e===!0),"aria-label":O()}),(0,q.jsx)(`span`,{className:`oc-cdefaults__label`,children:O()})]}),(0,q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,q.jsx)(R,{type:`number`,min:4e3,max:6e4,step:1e3,placeholder:`20000`,value:c,onChange:e=>d(e.target.value),className:`oc-cdefaults__number`,"aria-invalid":!g,"aria-label":w(),disabled:!o}),(0,q.jsx)(j,{size:`sm`,disabled:!v||!g||f===`saving`,onClick:()=>void y(),children:f===`saving`?r():u()})]}),g?null:(0,q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:_()}),f===`done`?(0,q.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:l()}):null,f===`error`?(0,q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:C()}):null,(0,q.jsx)(`p`,{className:`oc-cdefaults__help`,children:D()})]})}function Y({instance:e}){let t=k(i.admin.upsertInstanceConfig),n=typeof e.config?.summarizeThresholdChars==`number`?e.config.summarizeThresholdChars:null,[a,o]=(0,W.useState)(n===null?``:String(n)),[s,c]=(0,W.useState)(`idle`);(0,W.useEffect)(()=>{o(n===null?``:String(n)),c(`idle`)},[e._id,n]);let d=a.trim(),f=d===``?null:/^\d+$/.test(d)?Number.parseInt(d,10):NaN,p=f===null||Number.isInteger(f)&&f>=1e3&&f<=2e5,m=(f??null)!==n;async function h(){c(`saving`);try{let n={...e.config??{}};f===null?delete n.summarizeThresholdChars:n.summarizeThresholdChars=f,await t({instanceId:e._id,config:n}),c(`done`)}catch{c(`error`)}}return(0,q.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,q.jsx)(`span`,{className:`oc-cdefaults__label`,children:x()}),(0,q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,q.jsx)(R,{type:`number`,min:1e3,max:2e5,step:1e3,placeholder:`8000`,value:a,onChange:e=>o(e.target.value),className:`oc-cdefaults__number`,"aria-invalid":!p}),(0,q.jsx)(j,{size:`sm`,disabled:!m||!p||s===`saving`,onClick:()=>void h(),children:s===`saving`?r():u()})]}),p?null:(0,q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:T()}),s===`done`?(0,q.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:l()}):null,s===`error`?(0,q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:C()}):null,(0,q.jsx)(`p`,{className:`oc-cdefaults__help`,children:v()})]})}function X(){let e=h(i.agentFiles.getChatDefaults),[t,n]=(0,W.useState)({status:`loading`}),r=g(i.admin.listInstances,{}),[l,u]=(0,W.useState)(null);(0,W.useEffect)(()=>{!r||r.length===0||(!l||!r.some(e=>e.name===l))&&u(r[0].name)},[r,l]);let _=(r?.length??0)>1,v=r!==void 0&&r.length===0,x=g(i.compat.forInstance,l?{instanceName:l}:`skip`),C=l?H(x,`configDefaults`):`loading`,w=C===`loading`?null:C.blocked,T=(0,W.useMemo)(()=>_&&l?{instanceName:l}:{},[_,l]),D=(0,W.useRef)(0),O=(0,W.useCallback)(async()=>{let t=++D.current;n({status:`loading`});try{let r=K(await e(T));if(D.current!==t)return;n({status:`done`,current:r})}catch{if(D.current!==t)return;n({status:`error`})}},[e,T]);(0,W.useEffect)(()=>{w===!1&&(_&&!l||O())},[O,w,_,l]);let k=t.status===`done`?t.current:null,R=(0,W.useMemo)(()=>G.map(e=>({id:e,label:L(e)})),[]),z=(0,W.useMemo)(()=>[{id:`fast`,label:E()},{id:`standard`,label:s()}],[]);return(0,q.jsxs)(`div`,{className:`oc-cdefaults`,children:[(0,q.jsx)(`p`,{className:`oc-admin__hint`,children:A()}),_&&l?(0,q.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,q.jsx)(`span`,{className:`oc-cdefaults__label`,children:S()}),(0,q.jsxs)(F,{value:l,onValueChange:e=>u(e),children:[(0,q.jsx)(M,{size:`sm`,"aria-label":S(),children:(0,q.jsx)(B,{})}),(0,q.jsx)(V,{children:(r??[]).map(e=>(0,q.jsx)(P,{value:e.name,children:e.name},e.name))})]})]}):null,v?(0,q.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:b()}):C===`loading`?(0,q.jsx)(`p`,{className:`oc-admin__hint`,children:y()}):C.blocked?(0,q.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,q.jsx)(N,{size:14,"aria-hidden":!0}),` `,U(C.gatewayVersion,C.provider)]}):t.status===`loading`?(0,q.jsx)(`p`,{className:`oc-admin__hint`,children:y()}):t.status===`error`?(0,q.jsxs)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:[d(),` `,(0,q.jsx)(j,{variant:`outline`,size:`sm`,onClick:()=>void O(),children:m()})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,q.jsx)(`span`,{className:`oc-cdefaults__label`,children:f()}),(0,q.jsx)(I,{options:R,value:k?.thinkingDefault??null,onChange:()=>{},disabled:!0}),(0,q.jsx)(`p`,{className:`oc-cdefaults__help`,children:c()})]}),(0,q.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,q.jsx)(`span`,{className:`oc-cdefaults__label`,children:o()}),(0,q.jsx)(I,{options:z,value:k===null||k.fastModeDefault===null?null:k.fastModeDefault?`fast`:`standard`,onChange:()=>{},disabled:!0}),(0,q.jsx)(`p`,{className:`oc-cdefaults__help`,children:a()})]}),(0,q.jsx)(`p`,{className:`oc-cdefaults__note`,children:p()})]}),(()=>{let e=r?.find(e=>e.name===(l??r[0]?.name));return e?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Y,{instance:e}),(0,q.jsx)(J,{instance:e})]}):null})()]})}export{X as ChatDefaultsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$d as r,Qd as i,ef as a,if as o,nf as s,rf as c,tf as l}from"./dist-Bcr-KIFN.js";import{i as u,r as d}from"./dist-BvTSSv91.js";import{t as f}from"./chevrons-up-down-BEdda7QD.js";import{t as p}from"./button-CvJAYeHx.js";import{$ as m,Nt as h,Ot as g,et as _,it as v,p as y,rt as b,tt as x,zt as S}from"./index--Drh_B6c.js";import{a as C,i as w,n as T,o as E,r as D,t as O}from"./table-CrooMP5e.js";var k=t(e(),1);function A(e,t){return typeof e==`number`&&typeof t==`number`?e-t:typeof e==`boolean`&&typeof t==`boolean`?!!e-+!!t:String(e).localeCompare(String(t),void 0,{numeric:!0,sensitivity:`base`})}function j(e,t,n){return[...e].sort((e,r)=>{let i=t(e),a=t(r),o=i==null,s=a==null;if(o||s)return o&&s?0:o?1:-1;let c=A(i,a);return n===`asc`?c:-c})}var M=n();function N({title:e,rows:t,columns:n,rowActions:A,onAdd:N,addLabel:P=o(),bulkActions:F,emptyHint:I=c(),isExpanded:L,renderExpanded:R}){let[z,B]=(0,k.useState)(new Set),[V,H]=(0,k.useState)(null),U=t??[],W=V?n[V.index]:void 0,G=V&&W?.sort?j(U,W.sort,V.dir):U;function K(e){H(t=>!t||t.index!==e?{index:e,dir:`asc`}:t.dir===`asc`?{index:e,dir:`desc`}:null)}let q=+!!F+n.length+ +!!A,J=U.length>0&&z.size===U.length,Y=z.size>0&&!J;function X(){B(J?new Set:new Set(U.map(e=>e._id)))}function Z(e){B(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return(0,M.jsxs)(`div`,{className:`oc-dt`,children:[(0,M.jsxs)(`div`,{className:`oc-dt__bar`,children:[(0,M.jsx)(`h2`,{className:`oc-dt__title`,children:e}),(0,M.jsxs)(`div`,{className:`oc-dt__bar-actions`,children:[z.size>0&&F?F.map(e=>(0,M.jsxs)(p,{size:`sm`,variant:e.variant===`destructive`?`destructive`:`outline`,onClick:()=>{e.onSelect([...z]),B(new Set)},children:[e.variant===`destructive`?(0,M.jsx)(g,{}):null,e.label,` (`,z.size,`)`]},e.label)):null,N?(0,M.jsxs)(p,{size:`sm`,onClick:N,children:[(0,M.jsx)(h,{}),` `,P]}):null]})]}),t===void 0?(0,M.jsx)(`p`,{className:`oc-admin__hint`,children:s()}):U.length===0?(0,M.jsx)(`p`,{className:`oc-admin__hint`,children:I}):(0,M.jsxs)(O,{children:[(0,M.jsx)(C,{children:(0,M.jsxs)(E,{children:[F?(0,M.jsx)(w,{className:`w-8`,children:(0,M.jsx)(y,{"aria-label":l(),checked:J?!0:Y?`indeterminate`:!1,onCheckedChange:X})}):null,n.map((e,t)=>{let n=V?.index===t;return e.sort?(0,M.jsx)(w,{className:e.className,"aria-sort":n?V.dir===`asc`?`ascending`:`descending`:`none`,children:(0,M.jsxs)(`button`,{type:`button`,className:`oc-dt__sort`,onClick:()=>K(t),"aria-label":i({column:e.header}),children:[e.header,n?V.dir===`asc`?(0,M.jsx)(d,{className:`oc-dt__sort-icon`,"aria-hidden":!0}):(0,M.jsx)(u,{className:`oc-dt__sort-icon`,"aria-hidden":!0}):(0,M.jsx)(f,{className:`oc-dt__sort-icon oc-dt__sort-icon--idle`,"aria-hidden":!0})]})},e.header):(0,M.jsx)(w,{className:e.className,children:e.header},e.header)}),A?(0,M.jsx)(w,{className:`w-8`}):null]})}),(0,M.jsx)(T,{children:G.map(e=>{let t=A?.(e)??[],i=L?.(e)??!1;return(0,M.jsxs)(k.Fragment,{children:[(0,M.jsxs)(E,{className:`group/row`,children:[F?(0,M.jsx)(D,{children:(0,M.jsx)(y,{"aria-label":a(),checked:z.has(e._id),onCheckedChange:()=>Z(e._id)})}):null,n.map(t=>(0,M.jsx)(D,{className:t.className,children:t.cell(e)},t.header)),A?(0,M.jsx)(D,{children:t.length>0?(0,M.jsxs)(m,{children:[(0,M.jsx)(v,{asChild:!0,children:(0,M.jsx)(p,{variant:`ghost`,size:`icon-sm`,"aria-label":r(),className:`opacity-0 transition-opacity group-hover/row:opacity-100 group-focus-within/row:opacity-100 aria-expanded:opacity-100`,children:(0,M.jsx)(S,{})})}),(0,M.jsx)(_,{align:`end`,children:t.map((t,n)=>(0,M.jsxs)(`div`,{children:[t.variant===`destructive`&&n>0?(0,M.jsx)(b,{}):null,(0,M.jsx)(x,{variant:t.variant,onSelect:()=>t.onSelect(e),children:t.label})]},t.label))})]}):null}):null]}),i&&R?(0,M.jsx)(E,{className:`oc-dt__expansion`,children:(0,M.jsx)(D,{colSpan:q,className:`oc-dt__expansion-cell`,children:R(e)})}):null]},e._id)})})]})]})}export{N as t};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$S as r,AS as i,BS as a,CS as o,DS as s,Dr as c,E as l,ES as u,FS as d,GS as f,HS as p,IS as m,JS as ee,KS as te,LS as h,MS as g,NS as _,OS as v,PS as ne,QS as re,RS as ie,SS as y,TS as b,Tr as ae,US as x,VS as S,WS as C,XS as w,YS as T,ZS as E,_S as D,aC as O,bS as k,bj as A,cC as j,dS as M,eC as N,fS as P,gS as F,hS as I,iC as L,jS as R,kS as z,lC as B,lS as V,mS as H,nC as U,oC as W,pS as oe,qS as G,rC as K,sC as q,tC as se,uC as ce,uS as le,vS as ue,wS as de,xS as fe,yS as pe,yj as J,zS as me}from"./dist-Bcr-KIFN.js";import{t as he}from"./button-CvJAYeHx.js";import{A as ge,B as _e}from"./index--Drh_B6c.js";import{t as Y}from"./DataTableShell-c6bvewGu.js";var X=t(e(),1),Z=n(),ve={altered_words:()=>ce(),incorrect:()=>B(),incoherence:()=>j(),formatting:()=>q(),latency:()=>W(),api_error:()=>O(),other:()=>L()},Q=e=>ve[e]?.()??e;function $({matches:e,sourceWasOpen:t}){return t?e===!0?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:U()}):e===!1?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:se()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:`—`}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:K()})}function ye({data:e,closeReason:t}){let n=e.snapshot,i=J(l.feedback.respondToFeedback),[o,s]=(0,X.useState)(e.thread),[u,g]=(0,X.useState)(``),[_,v]=(0,X.useState)(!1);async function y(){let t=u.trim();if(!(!t||_)){v(!0);try{await i({feedbackId:e._id,text:t}),s(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),g(``)}finally{v(!1)}}}let b=[];try{b=n.contextJson?JSON.parse(n.contextJson):[]}catch{b=[]}return(0,Z.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,Z.jsxs)(`div`,{className:`oc-fbadmin__row`,children:[(0,Z.jsx)($,{matches:n.displayedMatchesStored,sourceWasOpen:n.clientInfo?.sourceWasOpen??!1}),(0,Z.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[Q(e.category),` · `,n.messageRole,n.isRegeneration?` · ${N()}`:``,n.openclawModel?` · ${n.openclawModel}`:``,n.openclawRuntime?` (${n.openclawRuntime})`:``]})]}),e.comment?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:r()}),(0,Z.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,t?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:I()}),(0,Z.jsx)(`p`,{className:`oc-fbadmin__comment`,children:t})]}):null,(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:re()}),o.length>0?(0,Z.jsx)(`div`,{className:`oc-fbadmin__thread`,children:o.map((e,t)=>(0,Z.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,Z.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?E():e.authorRole===`agent`?e.authorLabel??c():w()}),(0,Z.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Z.jsx)(`p`,{className:`oc-fbadmin__meta`,children:T()}),(0,Z.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:ee(),value:u,maxLength:2e3,rows:3,onChange:e=>g(e.target.value.slice(0,2e3))}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,Z.jsx)(he,{size:`sm`,onClick:()=>void y(),disabled:!u.trim()||_,children:_?G():te()})})]}),(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:f()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.messageText||C()})]}),n.clientInfo?.sourceWasOpen&&n.displayedText!==void 0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:x()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.displayedText||C()})]}):null,n.promptText?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:p()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.promptText})]}):null,b.length>0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:S({count:n.contextCount??b.length,truncated:n.contextTruncated?a():``})}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:b.map((e,t)=>(0,Z.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,Z.jsx)(`span`,{className:`oc-fbadmin__ctx-role`,children:e.role}),(0,Z.jsx)(`span`,{className:`oc-fbadmin__ctx-text`,children:e.text})]},t))})]}):null,n.outboxAvailable?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:me()}),(0,Z.jsxs)(`pre`,{className:`oc-msg__source-pre`,children:[n.outboxText??``,n.outboxStatus?`\n[status: ${n.outboxStatus}]`:``]})]}):null,n.clientInfo?.extensionsDetected&&n.clientInfo.extensionsDetected.length>0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:ie()}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__row`,children:n.clientInfo.extensionsDetected.map(e=>(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:e},e))})]}):null,(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:h()}),(0,Z.jsxs)(`p`,{className:`oc-fbadmin__env`,children:[[n.clientInfo?.language,n.clientInfo?.timezone,n.clientInfo?.theme?m({theme:n.clientInfo.theme}):null,n.runId?`run ${n.runId.slice(0,12)}…`:null].filter(Boolean).join(` · `)||`—`,n.clientInfo?.plugins&&n.clientInfo.plugins.length>0?(0,Z.jsxs)(`span`,{className:`oc-fbadmin__plugins`,children:[d(),` `,n.clientInfo.plugins.join(`, `),(0,Z.jsxs)(`span`,{className:`oc-fbadmin__note`,children:[` `,ne()]})]}):null,n.clientInfo?.userAgent?(0,Z.jsx)(`span`,{className:`oc-fbadmin__ua`,children:n.clientInfo.userAgent}):null]})]})]})}function be(){let e=A(l.feedback.listForAdmin,{}),t=J(l.feedback.readSnapshot),n=J(l.feedback.deleteFeedback),r=_e(),[a,c]=(0,X.useState)(null),[d,f]=(0,X.useState)({});async function p(e){if(a===e._id){c(null);return}if(!d[e._id]){let n=await t({feedbackId:e._id});f(t=>({...t,[e._id]:n}))}c(e._id)}async function m(e){await r({title:M(),description:le(),confirmLabel:V(),destructive:!0})&&(await n({feedbackId:e._id}),a===e._id&&c(null))}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[_(),` `,(0,Z.jsx)(`strong`,{children:g()}),` `,R()]}),(0,Z.jsx)(Y,{title:i(),rows:e,emptyHint:z(),isExpanded:e=>a===e._id&&!!d[e._id],renderExpanded:e=>d[e._id]?(0,Z.jsx)(ye,{data:d[e._id],closeReason:e.userCloseReason}):null,columns:[{header:v(),cell:e=>ge(e.at),sort:e=>e.at},{header:s(),cell:e=>Q(e.category),sort:e=>Q(e.category)},{header:u(),cell:e=>e.messageRole===`user`?b():de(),sort:e=>e.messageRole},{header:o(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${y({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:fe(),cell:e=>(0,Z.jsx)($,{matches:e.displayedMatchesStored,sourceWasOpen:e.sourceWasOpen}),sort:e=>e.displayedMatchesStored===!1?0:e.displayedMatchesStored===!0?1:2},{header:k(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:pe(),cell:e=>e.userClosedAt==null?e.resolvedAt==null?e.answered?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:ue()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:D()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,title:e.resolvedBy??void 0,children:ae()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-closed`,children:F()}),sort:e=>e.userClosedAt==null?e.resolvedAt==null?+!!e.answered:2:3}],rowActions:e=>[{label:a===e._id?H():oe(),onSelect:()=>void p(e)},{label:P(),onSelect:()=>void m(e),variant:`destructive`}]})]})}export{be as FeedbacksTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{AA as r,Ar as i,BA as ee,CA as a,DA as o,E as s,EA as c,FA as te,GA as ne,HA as l,IA as re,LA as u,MA as d,NA as f,OA as p,PA as m,RA as ie,SA as ae,TA as oe,UA as se,VA as h,WA as ce,_A as le,bA as ue,bj as de,dA as fe,dj as pe,eE as me,fA as he,gA as ge,hA as _e,jA as g,jr as _,kA as v,mA as ve,pA as ye,pj as be,uA as y,vA as b,wA as x,xA as S,yA as C,yj as w,zA as T}from"./dist-Bcr-KIFN.js";import{t as E}from"./button-CvJAYeHx.js";import{$ as D,Bt as O,C as k,G as A,H as j,J as M,K as N,Mt as xe,Ot as Se,S as P,U as Ce,W as we,Y as Te,at as F,b as I,et as Ee,it as De,p as Oe,q as ke,tt as L,w as R,x as z,z as Ae,zt as je}from"./index--Drh_B6c.js";import{a as Me,i as B,n as Ne,o as V,r as H,t as Pe}from"./table-CrooMP5e.js";var U=t(e(),1),W=n(),G=`all`;function K(e){switch(e){case`image`:return m();case`audio`:return f();case`video`:return d();case`pdf`:return g();case`document`:return r();case`archive`:return v();default:return p()}}function q(){let[e,t]=(0,U.useState)(G),[n,r]=(0,U.useState)(G),[d,f]=(0,U.useState)(G),[p,m]=(0,U.useState)(G),[g,v]=(0,U.useState)(!1),[q,J]=(0,U.useState)(null),Fe=w(s.files.softDelete),Y=Ae();function Ie(){t(G),r(G),f(G),m(G)}async function Le(){let e=q;if(J(null),e)try{await Fe({fileId:e.id}),Y.success(le())}catch(e){Y.error(ge(),e)}}let X=de(s.files.listMine,{direction:e===G?void 0:e,chatId:n===G?void 0:n,instanceName:d===G?void 0:d,category:p===G?void 0:p,includeAutoGenerated:g||void 0}),Re=(0,U.useMemo)(()=>new Intl.DateTimeFormat(be(),{dateStyle:`medium`,timeStyle:`short`}),[]);if(X===void 0)return(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:pe()});let{files:Z,facets:Q,truncated:ze,cap:Be}=X,$=e!==G||n!==G||d!==G||p!==G;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:ne()}),(0,W.jsxs)(`div`,{className:`oc-files__filters`,style:{display:`flex`,flexWrap:`wrap`,gap:8,margin:`12px 0`},children:[(0,W.jsxs)(I,{value:e,onValueChange:t,children:[(0,W.jsx)(k,{size:`sm`,"aria-label":ce(),children:(0,W.jsx)(R,{})}),(0,W.jsxs)(z,{children:[(0,W.jsx)(P,{value:G,children:se()}),(0,W.jsx)(P,{value:`inbound`,children:l()}),(0,W.jsx)(P,{value:`outbound`,children:h()})]})]}),(0,W.jsxs)(I,{value:n,onValueChange:r,children:[(0,W.jsx)(k,{size:`sm`,"aria-label":ee(),children:(0,W.jsx)(R,{})}),(0,W.jsxs)(z,{children:[(0,W.jsx)(P,{value:G,children:T()}),Q.chats.map(e=>(0,W.jsx)(P,{value:e.id,children:e.title},e.id))]})]}),Q.multiProvider?(0,W.jsxs)(I,{value:d,onValueChange:f,children:[(0,W.jsx)(k,{size:`sm`,"aria-label":ie(),children:(0,W.jsx)(R,{})}),(0,W.jsxs)(z,{children:[(0,W.jsx)(P,{value:G,children:u()}),Q.instances.map(e=>(0,W.jsx)(P,{value:e,children:e},e))]})]}):null,(0,W.jsxs)(I,{value:p,onValueChange:m,children:[(0,W.jsx)(k,{size:`sm`,"aria-label":re(),children:(0,W.jsx)(R,{})}),(0,W.jsxs)(z,{children:[(0,W.jsx)(P,{value:G,children:te()}),Q.categories.map(e=>(0,W.jsx)(P,{value:e,children:K(e)},e))]})]}),(0,W.jsxs)(`label`,{className:`oc-files__autogen`,children:[(0,W.jsx)(Oe,{checked:g,onCheckedChange:e=>v(e===!0),"aria-label":_()}),(0,W.jsx)(`span`,{children:_()})]}),$?(0,W.jsxs)(E,{variant:`ghost`,size:`sm`,onClick:Ie,style:{display:`inline-flex`,alignItems:`center`,gap:4,marginLeft:`auto`},children:[(0,W.jsx)(xe,{size:14,"aria-hidden":!0}),ue()]}):null]}),Z.length===0?(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:$?fe():he()}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(Pe,{children:[(0,W.jsx)(Me,{children:(0,W.jsxs)(V,{children:[(0,W.jsx)(B,{children:o()}),(0,W.jsx)(B,{children:c()}),(0,W.jsx)(B,{children:oe()}),(0,W.jsx)(B,{children:x()}),(0,W.jsx)(B,{children:a()}),(0,W.jsx)(B,{className:`text-right`,children:ae()})]})}),(0,W.jsx)(Ne,{children:Z.map(e=>(0,W.jsxs)(V,{children:[(0,W.jsxs)(H,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:e.filename,children:[e.filename,e.origin===`pasted`?(0,W.jsx)(F,{variant:`outline`,style:{marginLeft:6},children:i()}):null]}),(0,W.jsx)(H,{title:e.mimeType,children:K(e.category)}),(0,W.jsx)(H,{children:(0,W.jsx)(F,{variant:`secondary`,children:e.direction===`inbound`?l():h()})}),(0,W.jsx)(H,{style:{maxWidth:220,overflow:`hidden`,textOverflow:`ellipsis`},title:e.chatTitle,children:e.chatTitle}),(0,W.jsx)(H,{className:`whitespace-nowrap text-muted-foreground`,children:Re.format(e.createdAt)}),(0,W.jsx)(H,{className:`text-right`,children:(0,W.jsxs)(D,{children:[(0,W.jsx)(De,{asChild:!0,children:(0,W.jsx)(E,{variant:`ghost`,size:`icon`,"aria-label":C(),children:(0,W.jsx)(je,{size:16})})}),(0,W.jsxs)(Ee,{align:`end`,children:[e.url?(0,W.jsx)(L,{asChild:!0,children:(0,W.jsxs)(`a`,{href:e.url,download:e.filename,target:`_blank`,rel:`noopener noreferrer`,children:[(0,W.jsx)(O,{size:14}),S()]})}):(0,W.jsxs)(L,{disabled:!0,children:[(0,W.jsx)(O,{size:14}),ye()]}),(0,W.jsxs)(L,{variant:`destructive`,onSelect:()=>J({id:e._id,filename:e.filename}),children:[(0,W.jsx)(Se,{size:14}),b()]})]})]})})]},e._id))})]}),ze?(0,W.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:8},children:y({cap:Be})}):null]}),(0,W.jsx)(j,{open:q!==null,onOpenChange:e=>!e&&J(null),children:(0,W.jsxs)(A,{children:[(0,W.jsxs)(M,{children:[(0,W.jsx)(Te,{children:_e()}),(0,W.jsx)(N,{children:ve()})]}),(0,W.jsxs)(ke,{children:[(0,W.jsx)(we,{children:me()}),(0,W.jsx)(Ce,{onClick:()=>void Le(),children:b()})]})]})})]})}export{q as FilesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$l as r,Al as i,Bl as a,Cl as o,D as s,Dl as c,E as l,El as u,Fl as d,Gl as f,Hl as p,Il as m,Jl as h,Kl as g,Ll as _,Ml as v,Nl as y,Ol as b,Pl as x,Ql as S,Rl as C,Sl as w,Tl as T,Ul as ee,Vl as E,Wl as te,Xl as ne,Yl as re,Zl as ie,_l as ae,_u as D,au as O,bj as k,bl as oe,bu as A,cu as j,dl as M,du as se,eu as N,fl as P,fu as F,gl as ce,gu as le,hl as I,hu as L,iu as ue,jl as R,kl as de,lu as fe,ml as pe,mu as me,nu as he,ou as ge,pl as _e,pu as ve,ql as ye,ru as be,su as xe,tu as Se,uu as Ce,vl as we,vu as Te,wl as Ee,xl as De,yj as z,yl as Oe,yu as ke,zl as Ae}from"./dist-Bcr-KIFN.js";import{t as je}from"./x-BVy5P5am.js";import{i as B,n as V,r as Me,t as Ne}from"./tabs-DMDS7i26.js";import{t as H}from"./button-CvJAYeHx.js";import{At as U,B as Pe,C as Fe,S as Ie,Wt as Le,at as W,b as Re,ct as ze,dt as Be,ft as Ve,kt as G,lt as He,ot as K,p as q,st as Ue,u as We,vt as Ge,w as Ke,x as qe,z as J}from"./index--Drh_B6c.js";import{t as Je}from"./FilterBar-CzpwZuGf.js";import{t as Ye}from"./DataTableShell-c6bvewGu.js";import{t as Y}from"./DetailChips-J-KcpPRO.js";var Xe=s(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Ze=s(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),X=s(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Qe=s(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Z=t(e(),1);function $e(e,t,n){let r=t.trim().toLowerCase();return[...r?e.filter(e=>[e.email,e.name,e.canonical].some(e=>e!=null&&e.toLowerCase().includes(r))):e.slice()].sort((e,t)=>!n.has(e.userId)-+!n.has(t.userId))}function et(e,t){let n=e.filter(e=>e.source===`discovered`),r=t.trim().toLowerCase();return r?n.filter(e=>(e.displayName??e.agentId).toLowerCase().includes(r)||e.agentId.toLowerCase().includes(r)):n}function tt(e){let t=e.name?.trim()??``,n=e.email?.trim()??``,r=e.canonical?.trim()||`u-${e.userId.slice(0,8)}`;return t?{primary:t,secondary:n||`@${r}`}:n?{primary:n,secondary:null}:{primary:`@${r}`,secondary:null}}function nt(e){switch(e){case`admin`:return E();case`user`:return a();case`pending`:return Ae();default:return e}}function rt(e,t){if(e.length===0)return`none`;let n=0;for(let r of e)t(r)&&n++;return n===0?`none`:n===e.length?`all`:`some`}function it(e,t,n){let r=Math.max(1,Math.ceil(e.length/n)),i=Math.min(Math.max(1,Math.floor(t)),r),a=(i-1)*n;return{pageItems:e.slice(a,a+n),page:i,pageCount:r}}var Q=n(),$={name:``,description:``};function at(){let e=k(l.groups.listGroups,{}),t=k(l.me.getMe,{host:Ge})?.role===`admin`,n=z(l.groups.createGroup),i=z(l.groups.updateGroup),a=z(l.groups.deleteGroup),o=Pe(),s=J(),[c,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)(null),[p,m]=(0,Z.useState)($),[h,g]=(0,Z.useState)(null),[_,v]=(0,Z.useState)(``),y=(0,Z.useMemo)(()=>{if(!e)return e;let t=_.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||(e.description??``).toLowerCase().includes(t)||e.members.some(e=>e.label.toLowerCase().includes(t))||e.agents.some(e=>e.toLowerCase().includes(t))||e.charts.some(e=>e.name.toLowerCase().includes(t))):e},[e,_]);function b(){f(null),m($),u(!0)}function x(e){f(e),m({name:e.name,description:e.description??``}),u(!0)}async function S(){try{d?await i({groupId:d._id,name:p.name,description:p.description}):await n({name:p.name,description:p.description||void 0}),m($),f(null),u(!1)}catch(e){s.error(pe(),e)}}async function C(e){if(await o({title:Se({name:e.name}),description:N(),confirmWord:e.name,confirmLabel:r(),cancelLabel:xe(),destructive:!0}))try{await a({groupId:e._id})}catch(e){s.error(_e(),e)}}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ke()}),(0,Q.jsx)(Je,{q:_,onQChange:v,onReset:()=>v(``),canReset:_!==``,searchPlaceholder:F()}),(0,Q.jsx)(Ye,{title:A(),rows:y,addLabel:Te(),onAdd:t?b:void 0,emptyHint:D(),columns:[{header:le(),cell:e=>e.name,sort:e=>e.name},{header:L(),cell:e=>(0,Q.jsx)(Y,{icon:(0,Q.jsx)(Qe,{size:12,"aria-hidden":!0}),total:e.memberCount,items:e.members.map(e=>({label:e.label,marker:e.manager?(0,Q.jsx)(X,{size:11,"aria-hidden":!0}):null,highlight:e.manager}))}),sort:e=>e.memberCount},{header:me(),cell:e=>(0,Q.jsx)(Y,{icon:(0,Q.jsx)(U,{size:12,"aria-hidden":!0}),total:e.agentCount,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount},{header:ve(),cell:e=>(0,Q.jsx)(Y,{icon:(0,Q.jsx)(Ze,{size:12,"aria-hidden":!0}),total:e.chartCount,items:e.charts.map(e=>({label:e.name,marker:e.isDefault?(0,Q.jsx)(G,{size:11,fill:`currentColor`,"aria-hidden":!0}):null,highlight:e.isDefault}))}),sort:e=>e.chartCount}],rowActions:e=>[{label:se(),onSelect:()=>g({groupId:e._id,name:e.name})},...t?[{label:Ce(),onSelect:()=>x(e)},{label:fe(),variant:`destructive`,onSelect:()=>void C(e)}]:[]]}),(0,Q.jsx)(We,{open:c,onOpenChange:u,title:d?O():ge(),description:ue(),canSubmit:!!p.name.trim(),onSubmit:S,submitLabel:j(),children:(0,Q.jsxs)(`div`,{className:`oc-form`,children:[(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(`span`,{className:`oc-field__label`,children:be()}),(0,Q.jsx)(K,{value:p.name,onChange:e=>m({...p,name:e.target.value})})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(`span`,{className:`oc-field__label`,children:he()}),(0,Q.jsx)(K,{value:p.description,onChange:e=>m({...p,description:e.target.value})})]})]})}),(0,Q.jsx)(ct,{groupId:h?.groupId??null,groupName:h?.name??``,open:h!==null,onOpenChange:e=>{e||g(null)}})]})}var ot=8;function st({page:e,pageCount:t,onPage:n}){return t<=1?null:(0,Q.jsxs)(`div`,{className:`oc-access__pager`,children:[(0,Q.jsxs)(H,{type:`button`,variant:`ghost`,size:`sm`,disabled:e<=1,onClick:()=>n(e-1),children:[(0,Q.jsx)(Xe,{size:14,"aria-hidden":!0}),te()]}),(0,Q.jsxs)(`span`,{className:`oc-access__pageinfo`,"aria-label":p({page:e,pages:t}),children:[e,` / `,t]}),(0,Q.jsxs)(H,{type:`button`,variant:`ghost`,size:`sm`,disabled:e>=t,onClick:()=>n(e+1),children:[ee(),(0,Q.jsx)(Le,{size:14,"aria-hidden":!0})]})]})}function ct({groupId:e,groupName:t,open:n,onOpenChange:r}){let i=k(l.groups.getGroup,n&&e?{groupId:e}:`skip`),a=k(l.groups.listAssignableInstances,n?{}:`skip`),o=k(l.groups.listAssignableUsers,n?{}:`skip`),s=z(l.groups.addMember),u=z(l.groups.removeMember),d=z(l.groups.bulkSetMembers),p=z(l.groups.setGroupManager),_=J(),[v,b]=(0,Z.useState)(``),[w,T]=(0,Z.useState)(``),[ee,E]=(0,Z.useState)(`members`),[te,D]=(0,Z.useState)(1),[O,oe]=(0,Z.useState)(new Set),A=(0,Z.useRef)(null),j=(0,Z.useMemo)(()=>new Set((i?.members??[]).map(e=>e.userId)),[i]),M=(0,Z.useMemo)(()=>new Set((i?.members??[]).filter(e=>e.manager).map(e=>e.userId)),[i]),se=i?.viewerIsAdmin===!0,N=(0,Z.useMemo)(()=>new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),[i]);(0,Z.useEffect)(()=>{b(``),T(``),E(`members`),D(1),A.current=null},[n,e]),(0,Z.useEffect)(()=>{D(1)},[v]),(0,Z.useEffect)(()=>{n&&i&&e&&A.current!==e&&(A.current=e,oe(new Set((i.members??[]).map(e=>e.userId))))},[n,i,e]);let F=(0,Z.useMemo)(()=>o?$e(o,v,O):[],[o,v,O]);async function le(t,n){if(e)try{n?await u({groupId:e,userId:t}):await s({groupId:e,userId:t})}catch(e){_.error(P(),e)}}async function I(t,n){if(e)try{await p({groupId:e,userId:t,manager:!n})}catch(e){_.error(ce(),e)}}let L=rt(F,e=>j.has(e.userId)),ue=F.filter(e=>j.has(e.userId)).length,R=it(F,te,ot);async function de(){if(!e||F.length===0)return;let t=F.map(e=>e.userId);try{await d({groupId:e,userIds:t,member:L!==`all`})}catch(e){_.error(P(),e)}}return(0,Q.jsx)(Ue,{open:n,onOpenChange:r,children:(0,Q.jsxs)(ze,{className:`oc-access`,children:[(0,Q.jsxs)(Be,{children:[(0,Q.jsx)(Ve,{children:S({name:t})}),(0,Q.jsx)(He,{children:ie()})]}),(0,Q.jsxs)(Ne,{value:ee,onValueChange:E,className:`oc-access__tabs`,children:[(0,Q.jsxs)(Me,{className:`w-full`,children:[(0,Q.jsxs)(B,{value:`members`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Qe,{size:13,"aria-hidden":!0}),ne(),i?(0,Q.jsx)(W,{variant:`secondary`,className:`oc-access__tabcount`,children:j.size}):null]}),(0,Q.jsxs)(B,{value:`agents`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(U,{size:13,"aria-hidden":!0}),h(),i?(0,Q.jsx)(W,{variant:`secondary`,className:`oc-access__tabcount`,children:N.size}):null]}),(0,Q.jsxs)(B,{value:`charts`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Ze,{size:13,"aria-hidden":!0}),c(),i?(0,Q.jsx)(W,{variant:`secondary`,className:`oc-access__tabcount`,children:i.chartCount}):null]})]}),(0,Q.jsx)(V,{value:`members`,children:o===void 0||i===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:m()}):o.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:x()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(K,{value:v,onChange:e=>b(e.target.value),placeholder:re(),className:`oc-access__search`}),F.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:g()}):(0,Q.jsxs)(Q.Fragment,{children:[F.length>1?(0,Q.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,Q.jsx)(q,{checked:L===`all`?!0:L===`some`?`indeterminate`:!1,onCheckedChange:()=>void de(),"aria-label":f()}),(0,Q.jsx)(`span`,{className:`oc-access__label`,children:f()}),(0,Q.jsxs)(W,{variant:`outline`,className:`oc-access__count`,children:[ue,` / `,F.length]})]}):null,(0,Q.jsx)(`div`,{className:`oc-access__list`,children:R.pageItems.map(e=>{let t=j.has(e.userId),n=tt(e),r=M.has(e.userId);return(0,Q.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Q.jsx)(q,{checked:t,onCheckedChange:()=>void le(e.userId,t),"aria-label":C({user:n.primary})}),(0,Q.jsxs)(`span`,{className:`oc-access__who`,children:[(0,Q.jsx)(`span`,{className:`oc-access__label`,title:n.primary,children:n.primary}),n.secondary?(0,Q.jsx)(`span`,{className:`oc-access__sub`,title:n.secondary,children:n.secondary}):null]}),(0,Q.jsx)(W,{variant:`outline`,className:`oc-access__role`,children:nt(e.role)}),(0,Q.jsx)(`span`,{className:`oc-access__mgrslot`,children:t&&se?(0,Q.jsx)(H,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 oc-access__mgr${r?` oc-access__mgr--on`:``}`,"aria-pressed":r,"aria-label":r?ae():we(),title:r?ae():we(),onClick:()=>void I(e.userId,r),children:(0,Q.jsx)(X,{size:15,"aria-hidden":!0})}):t&&r?(0,Q.jsx)(`span`,{className:`oc-access__mgr oc-access__mgr--on`,role:`img`,"aria-label":Oe(),title:Oe(),children:(0,Q.jsx)(X,{size:15,"aria-hidden":!0})}):null})]},e._id)})}),(0,Q.jsx)(st,{page:R.page,pageCount:R.pageCount,onPage:D})]})]})}),(0,Q.jsx)(V,{value:`agents`,children:a===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:m()}):a.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:y()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(K,{value:w,onChange:e=>T(e.target.value),placeholder:ye(),className:`oc-access__search`}),(0,Q.jsx)(`div`,{className:`oc-access__list`,children:a.map(t=>(0,Q.jsx)(lt,{groupId:e,instanceName:t.name,kind:t.kind??`openclaw`,assigned:N,query:w},`${e}-${t._id}`))})]})}),(0,Q.jsx)(V,{value:`charts`,children:(0,Q.jsx)(ut,{groupId:e})})]})]})})}function lt({groupId:e,instanceName:t,kind:n,assigned:r,query:a}){let o=k(l.groups.listAssignableAgents,{instanceName:t}),s=z(l.groups.assignAgentToGroup),c=z(l.groups.removeAgentFromGroup),u=z(l.groups.bulkSetGroupAgents),p=J(),[m,h]=(0,Z.useState)(1);if((0,Z.useEffect)(()=>{h(1)},[a]),!e)return null;let g=et(o?.agents??[],a),y=o?.discovery&&!o.discovery.lastPollOk;if(a.trim()&&g.length===0)return null;let x=g.filter(e=>e.presentInLastOk!==!1),S=rt(x,e=>r.has(`${t}/${e.agentId}`)),C=it(g,m,ot);async function w(n,r){try{r?await c({groupId:e,instanceName:t,agentId:n}):await s({groupId:e,instanceName:t,agentId:n})}catch(e){p.error(M(),e)}}async function T(){if(x.length===0)return;let n=x.map(e=>e.agentId);try{await u({groupId:e,instanceName:t,agentIds:n,assigned:S!==`all`})}catch(e){p.error(M(),e)}}return(0,Q.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Q.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Q.jsx)(U,{size:13,"aria-hidden":!0}),(0,Q.jsx)(`span`,{children:t}),(0,Q.jsx)(W,{variant:`outline`,className:`oc-access__kind`,children:n}),y?(0,Q.jsx)(W,{variant:`outline`,className:`oc-access__stale`,children:i()}):null]}),o===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:d()}):g.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:y?R():v()}):(0,Q.jsxs)(Q.Fragment,{children:[x.length>1?(0,Q.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,Q.jsx)(q,{checked:S===`all`?!0:S===`some`?`indeterminate`:!1,onCheckedChange:()=>void T(),"aria-label":f()}),(0,Q.jsx)(`span`,{className:`oc-access__label`,children:f()})]}):null,C.pageItems.map(e=>{let n=`${t}/${e.agentId}`,i=r.has(n),a=e.presentInLastOk===!1;return(0,Q.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Q.jsx)(q,{checked:i,disabled:a&&!i,onCheckedChange:()=>void w(e.agentId,i),"aria-label":_({name:e.displayName??e.agentId})}),(0,Q.jsxs)(`span`,{className:`oc-access__label`,title:e.displayName??e.agentId,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Q.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,e.isDefaultOnInstance?(0,Q.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":b(),title:b(),children:(0,Q.jsx)(G,{size:14,fill:`currentColor`})}):null,a?(0,Q.jsx)(W,{variant:`outline`,className:`oc-access__gone`,children:de()}):null]},e.agentId)}),(0,Q.jsx)(st,{page:C.page,pageCount:C.pageCount,onPage:h})]})]})}function ut({groupId:e}){let t=k(l.charts.listGroupChartSelection,e?{groupId:e}:`skip`),n=z(l.charts.assignChartToGroup),r=z(l.charts.removeChartFromGroup),i=z(l.charts.setGroupDefaultChart),a=z(l.charts.addChartToGroupPool),s=z(l.charts.removeChartFromGroupPool),c=J();if(!e)return null;if(t===void 0)return(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:m()});let{pool:d,addable:f,canManagePool:p}=t;if(d.length===0&&!p)return(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:u()});async function h(t,i){try{i?await r({groupId:e,chartKey:t}):await n({groupId:e,chartKey:t})}catch(e){c.error(I(),e)}}async function g(t){try{await i({groupId:e,chartKey:t})}catch(e){c.error(I(),e)}}async function _(t){try{await a({groupId:e,chartKey:t})}catch(e){c.error(I(),e)}}async function v(t){try{await s({groupId:e,chartKey:t})}catch(e){c.error(I(),e)}}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`oc-access__list`,children:d.map(e=>(0,Q.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Q.jsx)(q,{checked:e.selected,onCheckedChange:()=>void h(e.chartKey,e.selected),"aria-label":w({name:e.name})}),(0,Q.jsx)(`span`,{className:`oc-access__label`,title:e.name,children:e.name}),e.selected?e.isDefault?(0,Q.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":De(),title:De(),children:(0,Q.jsx)(G,{size:14,fill:`currentColor`})}):(0,Q.jsx)(H,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void g(e.chartKey),children:oe()}):null,p?(0,Q.jsx)(H,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":o({name:e.name}),title:o({name:e.name}),onClick:()=>void v(e.chartKey),children:(0,Q.jsx)(je,{size:14,"aria-hidden":!0})}):null]},e.chartKey))}),p?f.length>0?(0,Q.jsxs)(Re,{value:``,onValueChange:e=>void _(e),children:[(0,Q.jsx)(Fe,{size:`sm`,className:`oc-access__search`,children:(0,Q.jsx)(Ke,{placeholder:Ee()})}),(0,Q.jsx)(qe,{children:f.map(e=>(0,Q.jsx)(Ie,{value:e.chartKey,children:e.name},e.chartKey))})]}):d.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:T()}):null:null]})}export{at as GroupsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$b as r,$y as i,Ab as a,Ai as o,Ax as s,Bb as c,Cb as l,Cx as u,Db as d,Di as f,Dx as p,E as m,Eb as h,Ex as g,Fb as _,Fx as v,Gb as y,Gh as b,Hb as x,Ib as S,Jb as C,Jt as w,KE as T,Kb as ee,Kt as te,Lb as ne,Mb as E,Mx as re,Nb as ie,Nx as ae,Ob as oe,Oi as se,Ox as ce,Pb as le,Px as ue,Qb as D,Qy as de,Rb as fe,Sb as pe,Sx as me,Tb as he,Tx as ge,Ub as _e,Vb as O,Wb as ve,Wh as ye,Xb as be,Xy as k,Yb as xe,Yy as Se,Zb as Ce,Zy as we,_b as Te,_j as A,_x as Ee,ab as De,ax as Oe,bb as ke,bj as j,bx as Ae,cb as je,cx as Me,db as Ne,dx as Pe,eb as Fe,ex as Ie,fb as Le,fx as Re,gb as M,gx as ze,hb as Be,hx as Ve,ib as He,ix as Ue,jb as We,jx as Ge,kb as Ke,ki as qe,kx as Je,lb as Ye,lx as Xe,mb as Ze,mx as Qe,nb as $e,nx as et,ob as tt,ox as nt,pb as rt,px as it,qE as at,qb as ot,qt as st,rb as ct,rx as lt,sb as ut,sx as dt,tb as ft,tx as pt,ub as mt,ux as ht,vb as gt,vx as _t,wb as vt,wx as yt,xb as N,xx as P,yb as F,yj as I,yx as bt,zb as xt}from"./dist-Bcr-KIFN.js";import{a as St,c as Ct}from"./FieldLabel-DYhOcc_e.js";import{t as L}from"./button-CvJAYeHx.js";import{B as wt,C as R,Q as Tt,S as z,X as Et,Z as Dt,at as B,b as V,ct as H,dt as U,ft as W,lt as Ot,ot as G,p as kt,st as At,u as jt,w as K,x as q,z as J}from"./index--Drh_B6c.js";import{t as Mt}from"./DataTableShell-c6bvewGu.js";import{InstanceConfigDialog as Nt}from"./BridgeTab-mLReg09f.js";var Y=t(e(),1),X=[`conversational`,`documentary`,`summarizer`,`curator`],Pt=new Set(X),Ft=`conversational`;function It(e){let t=new Set((e??[]).filter(e=>Pt.has(e)));return t.size===0?[Ft]:X.filter(e=>t.has(e))}var Z=n(),Q={name:``,gatewayUrl:``,bridgeUrl:``,displayName:``,kind:`openclaw`,transport:`ws`,gatewayVersion:``,gatewayHttpUrl:``,streamTransport:St},Lt={openclaw:[`token`,`deviceIdentity`],hermes:[`apiKey`]};function Rt(e){return{name:e.name,gatewayUrl:e.gatewayUrl,bridgeUrl:e.bridgeUrl??``,displayName:e.displayName??``,kind:e.kind??`openclaw`,transport:e.transport??`ws`,gatewayVersion:e.gatewayVersion??``,gatewayHttpUrl:e.gatewayHttpUrl??``,streamTransport:e.streamTransport??`reactive`}}function zt(){let e=j(m.admin.listInstances,{}),t=j(m.agents.listAllInstanceAgents,{}),n=I(m.admin.upsertInstance),r=I(m.admin.deleteInstance),i=J(),[a,o]=(0,Y.useState)(!1),[c,l]=(0,Y.useState)(Q),[d,f]=(0,Y.useState)(null),[h,_]=(0,Y.useState)(null),[y,x]=(0,Y.useState)(null),[S,C]=(0,Y.useState)(null);async function T(){try{await n({instanceId:S??void 0,name:c.name,gatewayUrl:c.gatewayUrl,bridgeUrl:c.bridgeUrl||void 0,displayName:c.displayName||void 0,kind:c.kind,transport:c.kind===`hermes`?c.transport:void 0,gatewayVersion:c.gatewayVersion||void 0,gatewayHttpUrl:c.gatewayHttpUrl||void 0,streamTransport:c.streamTransport}),l(Q),C(null),o(!1)}catch(e){i.error(ae(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[re(),(0,Z.jsx)(`strong`,{children:Ge()}),s()]}),(0,Z.jsx)(Mt,{title:Je(),rows:e,addLabel:ce(),onAdd:()=>{C(null),l(Q),o(!0)},emptyHint:p(),columns:[{header:g(),cell:e=>e.name,sort:e=>e.name},{header:ge(),cell:e=>(0,Z.jsx)(B,{variant:`outline`,children:e.kind??`openclaw`}),sort:e=>e.kind??`openclaw`},{header:yt(),cell:e=>e.gatewayUrl,sort:e=>e.gatewayUrl},{header:u(),cell:e=>e.displayName??`—`,sort:e=>e.displayName??null},{header:v(),cell:e=>{let n=(t?.[e.name]??[]).filter(e=>e.presentInLastOk!==!1&&e.enabled);if(n.length===0)return(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`—`});let r=t=>e.defaultAgentId===t;return(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:[...n].sort((e,t)=>Number(r(t.agentId))-Number(r(e.agentId))).map(e=>(0,Z.jsxs)(B,{variant:r(e.agentId)?`default`:`outline`,title:r(e.agentId)?k():void 0,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]},e.agentId))})}}],rowActions:e=>[{label:bt(),onSelect:()=>{C(e._id),l(Rt(e)),o(!0)}},{label:ue(),onSelect:()=>f(e.name)},{label:Ue(),onSelect:()=>x(e)},{label:me(),onSelect:()=>_(e)},{label:P(),variant:`destructive`,onSelect:()=>void r({instanceId:e._id})}],bulkActions:[{label:P(),variant:`destructive`,onSelect:e=>e.forEach(e=>void r({instanceId:e}))}]}),(0,Z.jsx)(jt,{open:a,onOpenChange:o,title:S?_t():Ae(),description:ze(),canSubmit:!!(c.name&&c.gatewayUrl),onSubmit:T,submitLabel:Ve(),children:(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsxs)($,{label:Qe(),children:[(0,Z.jsx)(G,{value:c.name,disabled:S!==null,onChange:e=>l({...c,name:e.target.value})}),S?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:Ee()}):null]}),(0,Z.jsx)($,{label:it(),children:(0,Z.jsxs)(V,{value:c.kind,onValueChange:e=>l({...c,kind:e}),children:[(0,Z.jsx)(R,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(K,{})}),(0,Z.jsxs)(q,{children:[(0,Z.jsx)(z,{value:`openclaw`,children:`OpenClaw`}),(0,Z.jsx)(z,{value:`hermes`,children:`Hermes`})]})]})}),c.kind===`hermes`?(0,Z.jsx)($,{label:w(),children:(0,Z.jsxs)(V,{value:c.transport,onValueChange:e=>l({...c,transport:e}),children:[(0,Z.jsx)(R,{size:`sm`,className:`w-56`,children:(0,Z.jsx)(K,{})}),(0,Z.jsxs)(q,{children:[(0,Z.jsx)(z,{value:`ws`,children:st()}),(0,Z.jsx)(z,{value:`rest`,children:te()})]})]})}):null,(0,Z.jsx)($,{label:Re(),children:(0,Z.jsx)(G,{value:c.gatewayUrl,onChange:e=>l({...c,gatewayUrl:e.target.value})})}),(0,Z.jsx)($,{label:Pe(),children:(0,Z.jsx)(G,{value:c.bridgeUrl,placeholder:ht(),onChange:e=>l({...c,bridgeUrl:e.target.value})})}),(0,Z.jsx)($,{label:Xe(),children:(0,Z.jsx)(G,{value:c.displayName,onChange:e=>l({...c,displayName:e.target.value})})}),(0,Z.jsxs)($,{label:b(),children:[(0,Z.jsxs)(V,{value:c.streamTransport,onValueChange:e=>l({...c,streamTransport:e}),children:[(0,Z.jsx)(R,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(K,{})}),(0,Z.jsx)(q,{children:Ct.map(e=>(0,Z.jsx)(z,{value:e,children:e},e))})]}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:ye()})]}),(0,Z.jsx)($,{label:Me(),children:(0,Z.jsx)(G,{value:c.gatewayVersion,placeholder:dt(),onChange:e=>l({...c,gatewayVersion:e.target.value})})}),(0,Z.jsx)($,{label:nt(),children:(0,Z.jsx)(G,{value:c.gatewayHttpUrl,placeholder:Oe(),onChange:e=>l({...c,gatewayHttpUrl:e.target.value})})})]})}),(0,Z.jsx)(Yt,{instanceName:d,open:d!==null,onOpenChange:e=>{e||f(null)}}),h?(0,Z.jsx)(Nt,{instance:h,onClose:()=>_(null)},h._id):null,y?(0,Z.jsx)(Bt,{instance:y,onClose:()=>x(null)},y._id):null]})}function Bt({instance:e,onClose:t}){let n=j(m.instanceSecrets.listInstanceSecretStatus,{}),r=Lt[e.kind??`openclaw`],i=(0,Y.useMemo)(()=>{let t={};for(let r of n??[])r.instanceId===e._id&&(t[r.field]=r.updatedAt);return t},[n,e._id]);return(0,Z.jsx)(At,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(H,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(U,{children:[(0,Z.jsx)(W,{children:lt({instance:e.displayName??e.name})}),(0,Z.jsx)(Ot,{children:et()})]}),(0,Z.jsx)(`div`,{className:`oc-form`,children:r.map(t=>(0,Z.jsx)(Ut,{instanceId:e._id,field:t,updatedAt:i[t]??null},t))}),(0,Z.jsx)(`div`,{className:`oc-bridgesecret`,children:(0,Z.jsx)(Ht,{instance:e})}),(0,Z.jsx)(Vt,{instance:e})]})})}function Vt({instance:e}){let t=A(m.instanceSync.forceInstanceSync),n=J(),[r,i]=(0,Y.useState)(!1);async function o(){if(!r){i(!0);try{switch((await t({instanceId:e._id})).status){case`synced`:n.success(S());break;case`no_agents`:n.success(le());break;case`no_bridge_url`:n.error(ie());break;case`deploy_misconfigured`:n.error(E());break;case`unauthorized`:n.error(a());break;case`not_served`:n.error(Ke());break;default:n.error(We());break}}catch(e){n.error(_(),e)}finally{i(!1)}}}return(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:oe()}),(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(L,{size:`sm`,variant:`outline`,onClick:()=>void o(),disabled:r,children:r?ne():fe()})})]})}function Ht({instance:e}){let t=j(m.bridgeAuth.listBridgeAuthStatus,{}),n=A(m.bridgeAuth.mintBridgeSecret),r=I(m.bridgeAuth.revokeBridgeSecret),i=J(),[a,o]=(0,Y.useState)(!1),[s,c]=(0,Y.useState)(null),[u,f]=(0,Y.useState)(!1),p=(t??[]).find(t=>t.instanceId===e._id),g=p!==void 0;async function _(){if(!a){o(!0);try{c((await n({instanceId:e._id})).plaintext),f(!1)}catch(e){i.error(N(),e)}finally{o(!1)}}}async function v(){if(!a){o(!0);try{await r({instanceId:e._id}),c(null),i.success(pe())}catch(e){i.error(N(),e)}finally{o(!1)}}}async function y(){if(s)try{await navigator.clipboard.writeText(s),f(!0)}catch{}}return(0,Z.jsxs)($,{label:d(),children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:h()}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(B,{variant:g?`outline`:`secondary`,children:g?`${D()} · ${p.prefix}…${p.lastFour}`:Ce()}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(L,{size:`sm`,onClick:()=>void _(),disabled:a,children:g?vt():he()}),g?(0,Z.jsx)(L,{size:`sm`,variant:`destructive`,onClick:()=>void v(),disabled:a,children:l()}):null]})]}),s?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`oc-sa__minted-warning`,children:ke()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:s}),(0,Z.jsx)(L,{variant:`outline`,size:`sm`,onClick:()=>void y(),children:u?at():T()})]}),(0,Z.jsx)(L,{size:`sm`,variant:`ghost`,onClick:()=>{c(null),f(!1)},children:F()})]}):null]})}function Ut({instanceId:e,field:t,updatedAt:n}){let i=A(m.instanceSecrets.setInstanceSecret),a=I(m.instanceSecrets.clearInstanceSecret),o=A(m.deviceIdentity.generateDeviceIdentity),s=J(),[l,u]=(0,Y.useState)(``),[d,f]=(0,Y.useState)(!1),[p,h]=(0,Y.useState)(null),[g,_]=(0,Y.useState)(!1),v=n!==null,b=t===`deviceIdentity`,S=t===`token`?pt():t===`deviceIdentity`?Ie():r();async function w(){if(!(!l.trim()||d)){f(!0);try{await i({instanceId:e,field:t,plaintext:l}),u(``),h(null),_(!1),s.success(ee())}catch(e){s.error(y(),e)}finally{f(!1)}}}async function te(){if(!d){f(!0);try{await a({instanceId:e,field:t}),h(null),_(!1),s.success(ve())}catch(e){s.error(y(),e)}finally{f(!1)}}}async function ne(){if(!d){f(!0);try{h(await o({instanceId:e})),_(!1),s.success(O())}catch(e){s.error(xt(),e)}finally{f(!1)}}}let E=p?`openclaw devices approve ${p.id}`:``;async function re(){if(E)try{await navigator.clipboard.writeText(E),_(!0)}catch{}}return(0,Z.jsxs)($,{label:S,children:[b?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:x()}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(B,{variant:v?`outline`:`secondary`,children:v?D():Ce()}),(0,Z.jsx)(G,{type:`password`,autoComplete:`off`,className:`flex-1 min-w-32`,value:l,placeholder:v?xe():be(),onChange:e=>u(e.target.value)}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(L,{size:`sm`,onClick:()=>void w(),disabled:d||l.trim().length===0,children:C()}),b?(0,Z.jsx)(L,{size:`sm`,variant:`outline`,onClick:()=>void ne(),disabled:d,children:_e()}):null,v?(0,Z.jsx)(L,{size:`sm`,variant:`destructive`,onClick:()=>void te(),disabled:d,children:ot()}):null]})]}),p?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:O()}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:c()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:E}),(0,Z.jsx)(L,{variant:`outline`,size:`sm`,onClick:()=>void re(),children:g?at():T()})]}),(0,Z.jsx)(L,{size:`sm`,variant:`ghost`,onClick:()=>{h(null),_(!1)},children:F()})]}):null]})}var Wt={conversational:Ne,documentary:Ye,summarizer:o,curator:se},Gt={conversational:mt,documentary:je,summarizer:qe,curator:f},Kt=e=>(Wt[e]??(()=>e))(),qt=e=>(Gt[e]??(()=>``))();function Jt({agentId:e,types:t,onToggle:n}){return(0,Z.jsxs)(`div`,{className:`oc-agentcard__types`,children:[(0,Z.jsx)(`span`,{className:`oc-agentcard__types-label`,children:Be()}),t.map(e=>(0,Z.jsx)(B,{variant:`secondary`,className:`oc-agenttype__chip`,title:qt(e),children:Kt(e)},e)),(0,Z.jsxs)(Et,{children:[(0,Z.jsx)(Tt,{asChild:!0,children:(0,Z.jsx)(L,{type:`button`,variant:`outline`,size:`sm`,className:`h-7`,children:Ze()})}),(0,Z.jsxs)(Dt,{align:`start`,className:`oc-agenttypes-pop`,children:[(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__title`,children:rt()}),(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__hint`,children:Le()}),(0,Z.jsx)(`div`,{className:`oc-agenttypes-pop__list`,children:X.map(r=>{let i=`agtype-${e}-${r}`;return(0,Z.jsxs)(`div`,{className:`oc-agenttypes-pop__item`,children:[(0,Z.jsx)(kt,{id:i,checked:t.includes(r),onCheckedChange:()=>n(r)}),(0,Z.jsxs)(`label`,{htmlFor:i,className:`oc-agenttypes-pop__text`,children:[(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__name`,children:Kt(r)}),(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__desc`,children:qt(r)})]})]},r)})})]})]})]})}function Yt({instanceName:e,open:t,onOpenChange:n}){let r=j(m.agents.listAgentsForInstance,t&&e?{instanceName:e}:`skip`),a=I(m.agents.setAgentEnabled).withOptimisticUpdate((e,{instanceName:t,agentId:n,enabled:r})=>{let i=e.getQuery(m.agents.listAgentsForInstance,{instanceName:t});i&&e.setQuery(m.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,enabled:r}:e)})}),o=I(m.agents.setInstanceDefaultAgent).withOptimisticUpdate((e,{instanceName:t,agentId:n})=>{let r=e.getQuery(m.agents.listAgentsForInstance,{instanceName:t});r&&e.setQuery(m.agents.listAgentsForInstance,{instanceName:t},{...r,defaultAgentId:n})}),s=I(m.agents.setAgentTypes).withOptimisticUpdate((e,{instanceName:t,agentId:n,types:r})=>{let i=e.getQuery(m.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=It(r);e.setQuery(m.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,types:a}:e)})}),c=I(m.agents.removeInstanceAgent),l=wt(),u=J();async function d(t,n){if(e)try{await a({instanceName:e,agentId:t,enabled:n})}catch(e){u.error(M(),e)}}async function f(t){if(e)try{await o({instanceName:e,agentId:t})}catch(e){u.error(M(),e)}}async function p(t,n,r){if(!e)return;let i=r.includes(n)?r.filter(e=>e!==n):[...r,n];try{await s({instanceName:e,agentId:t,types:i})}catch(e){u.error(M(),e)}}async function h(t,n){if(e&&await l({title:De({name:n}),description:He(),confirmLabel:ct(),destructive:!0}))try{await c({instanceName:e,agentId:t}),u.success($e())}catch(e){u.error(M(),e)}}return(0,Z.jsx)(At,{open:t,onOpenChange:n,children:(0,Z.jsxs)(H,{className:`oc-access`,children:[(0,Z.jsxs)(U,{children:[(0,Z.jsx)(W,{children:gt({name:e??``})}),(0,Z.jsx)(Ot,{children:Te()})]}),r===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:ft()}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`oc-access__poll`,children:r.discovery===null?Fe():r.discovery.lastPollOk?i():de({error:r.discovery.error??`?`})}),r.agents.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:we()}):(0,Z.jsx)(`div`,{className:`oc-access__list`,children:r.agents.map(e=>{let t=e.presentInLastOk===!1,n=r.defaultAgentId===e.agentId,i=e.displayName??e.agentId,a=e.types??[];return(0,Z.jsxs)(`div`,{className:`oc-agentcard`+(e.enabled?``:` oc-agentcard--off`),children:[(0,Z.jsxs)(`div`,{className:`oc-agentcard__head`,children:[(0,Z.jsx)(kt,{checked:e.enabled,disabled:t,"aria-label":i,onCheckedChange:t=>void d(e.agentId,t===!0)}),(0,Z.jsxs)(`span`,{className:`oc-agentcard__name`,title:i,children:[e.emoji?`${e.emoji} `:``,i]}),e.model?(0,Z.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,t?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(B,{variant:`outline`,className:`oc-access__gone`,children:Se()}),(0,Z.jsx)(L,{size:`sm`,variant:`ghost`,className:`h-7 text-destructive`,onClick:()=>void h(e.agentId,i),children:tt()})]}):n?(0,Z.jsx)(B,{variant:`default`,children:k()}):(0,Z.jsx)(L,{size:`sm`,variant:`outline`,className:`h-7`,disabled:!e.enabled,onClick:()=>void f(e.agentId),children:ut()})]}),e.enabled?(0,Z.jsx)(Jt,{agentId:e.agentId,types:a,onToggle:t=>void p(e.agentId,t,a)}):null]},e.agentId)})})]})]})})}function $({label:e,children:t}){return(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(`span`,{className:`oc-field__label`,children:e}),t]})}export{zt as InstancesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{CC as r,E as i,Ga as a,Ja as o,Ka as s,SC as c,Ua as l,Wa as u,Xa as d,Ya as f,Za as p,_C as m,_j as h,bC as g,bj as _,dC as v,fC as y,gC as b,hC as x,mC as S,pC as C,qa as w,vC as T,wC as E,xC as D,yC as O,yj as k}from"./dist-Bcr-KIFN.js";import{t as A}from"./button-CvJAYeHx.js";import{at as j,ot as M,p as N}from"./index--Drh_B6c.js";var P=t(e(),1),F=n();function I(){let e=_(i.integrations.status.status,{}),t=k(i.admin.setIntegrationConfig),[n,a]=(0,P.useState)(null);if((0,P.useEffect)(()=>{e&&n===null&&a(e.config)},[e,n]),!e||!n)return(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:E()});let o=n,s=(e,t,n)=>a({...o,[e]:{...o[e],[t]:n}}),l=(e,n)=>void t({[e]:n});return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`p`,{className:`oc-admin__hint`,children:[r(),` `,(0,F.jsx)(`strong`,{children:c()}),` `,D()]}),(0,F.jsxs)(L,{title:`Langfuse`,status:e.langfuse.configured?e.langfuse.enabled?(0,F.jsx)(j,{variant:`secondary`,children:g()}):(0,F.jsx)(j,{variant:`outline`,children:O()}):(0,F.jsx)(j,{variant:`outline`,children:T()}),note:m(),children:[(0,F.jsx)(R,{label:x(),children:(0,F.jsx)(M,{value:o.langfuse.host??``,placeholder:e.langfuse.effectiveHost,onChange:e=>s(`langfuse`,`host`,e.target.value),onBlur:()=>l(`langfuse`,{host:o.langfuse.host??``})})}),(0,F.jsx)(z,{label:v(),checked:o.langfuse.enabled??!0,onChange:e=>{s(`langfuse`,`enabled`,e),l(`langfuse`,{enabled:e})}})]}),(0,F.jsxs)(L,{title:`Opik`,status:e.opik.configured?e.opik.enabled?(0,F.jsx)(j,{variant:`secondary`,children:g()}):(0,F.jsx)(j,{variant:`outline`,children:O()}):(0,F.jsx)(j,{variant:`outline`,children:T()}),note:b(),children:[(0,F.jsx)(R,{label:S(),children:(0,F.jsx)(M,{value:o.opik.baseUrl??``,placeholder:e.opik.effectiveBaseUrl,onChange:e=>s(`opik`,`baseUrl`,e.target.value),onBlur:()=>l(`opik`,{baseUrl:o.opik.baseUrl??``})})}),(0,F.jsx)(R,{label:C(),children:(0,F.jsx)(M,{value:o.opik.workspace??``,placeholder:e.opik.effectiveWorkspace||y(),onChange:e=>s(`opik`,`workspace`,e.target.value),onBlur:()=>l(`opik`,{workspace:o.opik.workspace??``})})}),(0,F.jsx)(z,{label:v(),checked:o.opik.enabled??!0,onChange:e=>{s(`opik`,`enabled`,e),l(`opik`,{enabled:e})}})]}),(0,F.jsxs)(L,{title:`OpenTelemetry (OTLP)`,status:e.otlp.configured?e.otlp.enabled?(0,F.jsx)(j,{variant:`secondary`,children:g()}):(0,F.jsx)(j,{variant:`outline`,children:O()}):(0,F.jsx)(j,{variant:`outline`,children:p()}),note:d(),children:[(0,F.jsx)(R,{label:f(),children:(0,F.jsx)(M,{value:o.otlp.endpoint??``,placeholder:e.otlp.effectiveEndpoint||`https://otlp.example.com/v1/traces`,onChange:e=>s(`otlp`,`endpoint`,e.target.value),onBlur:()=>l(`otlp`,{endpoint:o.otlp.endpoint??``})})}),(0,F.jsx)(B,{headersSet:e.otlp.headersSet}),(0,F.jsx)(z,{label:v(),checked:o.otlp.enabled??!0,onChange:e=>{s(`otlp`,`enabled`,e),l(`otlp`,{enabled:e})}})]})]})}function L({title:e,status:t,note:n,children:r}){return(0,F.jsxs)(`section`,{className:`oc-int__section`,children:[(0,F.jsxs)(`div`,{className:`oc-int__section-head`,children:[(0,F.jsx)(`h3`,{className:`oc-uipa__h`,children:e}),t]}),n?(0,F.jsx)(`p`,{className:`oc-uipa__note`,children:n}):null,(0,F.jsx)(`div`,{className:`oc-int__fields`,children:r})]})}function R({label:e,children:t}){return(0,F.jsxs)(`label`,{className:`oc-int__field`,children:[(0,F.jsx)(`span`,{className:`oc-int__field-label`,children:e}),t]})}function z({label:e,checked:t,onChange:n}){return(0,F.jsxs)(`label`,{className:`oc-int__toggle`,children:[(0,F.jsx)(N,{checked:t,onCheckedChange:e=>n(e===!0)}),(0,F.jsx)(`span`,{children:e})]})}function B({headersSet:e}){let t=h(i.integrations.otlpSecret.setOtlpHeaders),n=k(i.integrations.otlpSecret.clearOtlpHeaders),[r,c]=(0,P.useState)(``),[d,f]=(0,P.useState)(null),[p,m]=(0,P.useState)(!1),g=async()=>{m(!0),f(null);try{await t({headersJson:r}),c(``)}catch(e){f(e instanceof Error?e.message:String(e))}finally{m(!1)}};return(0,F.jsxs)(R,{label:o(),children:[(0,F.jsx)(M,{value:r,placeholder:e?w():s(),onChange:e=>c(e.target.value)}),(0,F.jsxs)(`div`,{className:`oc-int__otlp-headers-actions`,children:[(0,F.jsx)(A,{size:`sm`,disabled:p||r.trim().length===0,onClick:()=>void g(),children:a()}),e?(0,F.jsx)(A,{variant:`ghost`,size:`sm`,disabled:p,onClick:()=>void n({}),children:u()}):null]}),d?(0,F.jsx)(`p`,{className:`oc-int__otlp-headers-error`,children:d}):null,(0,F.jsx)(`p`,{className:`oc-uipa__note`,children:l()})]})}export{I as IntegrationsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$p as r,E as i,Mw as a,Qp as o,XC as s,ZC as c,am as l,aw as u,bj as d,cm as f,dm as p,em as m,im as h,iw as g,lm as _,nm as v,om as y,ow as b,rm as x,sm as S,sw as C,tm as w,um as T}from"./dist-Bcr-KIFN.js";import{Gt as E,Kt as D,a as ee,n as te,r as ne,vt as re}from"./index--Drh_B6c.js";import{a as O,n as k,o as A,r as j,t as M}from"./card-1aYDgnwU.js";import{n as N,t as P}from"./TimeRangePicker-XUfGR5S2.js";var F=t(e(),1),I=n(),L=15,R=e=>String(Math.round(e));function z(){let e=d(i.me.getMe,{host:re})?.permissions?.includes(`traces.read`)??!1,t=d(i.deliveryTiming.listDeliverySessions,e?{}:`skip`),n=(0,F.useMemo)(()=>t?t.filter(e=>!e.active&&e.rollup!==null&&e.rollup.cP50!==null&&e.rollup.aP50!==null).slice(0,L).reverse().map(e=>({startedAt:e.startedAt,cP50:e.rollup?.cP50,aP50:e.rollup?.aP50})):[],[t]);return t===void 0?null:(0,I.jsxs)(`section`,{className:`oc-kpi__group`,children:[(0,I.jsx)(`h2`,{className:`oc-kpi__group-title`,children:a()}),(0,I.jsxs)(M,{children:[(0,I.jsxs)(O,{children:[(0,I.jsx)(A,{children:C()}),(0,I.jsx)(j,{children:u()})]}),(0,I.jsx)(k,{children:n.length<2?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:g()}):(0,I.jsx)(B,{series:n})})]})]})}function B({series:e}){let t=e.map(e=>e.cP50),n=e.map(e=>e.aP50),r=Math.max(1,...t,...n),i=t=>6+t*468/(e.length-1),a=e=>74-e*68/r,o=e=>e.map((e,t)=>`${t===0?`M`:`L`}${i(t).toFixed(1)},${a(e).toFixed(1)}`).join(` `),l=e[e.length-1];return(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsxs)(`div`,{className:`flex gap-3 text-xs text-muted-foreground`,children:[(0,I.jsxs)(`span`,{style:{color:`var(--primary)`},children:[s(),` p50 `,R(l.cP50),` `,b()]}),(0,I.jsxs)(`span`,{children:[c(),` p50 `,R(l.aP50),` `,b()]})]}),(0,I.jsxs)(`svg`,{viewBox:`0 0 480 80`,className:`h-20 w-full`,preserveAspectRatio:`none`,role:`img`,"aria-label":C(),children:[(0,I.jsx)(`path`,{d:o(n),fill:`none`,style:{stroke:`var(--muted-foreground)`},strokeWidth:1.5}),(0,I.jsx)(`path`,{d:o(t),fill:`none`,style:{stroke:`var(--primary)`},strokeWidth:1.5})]})]})}var V=[{metric:`api.calls`,label:p(),unit:`/h`,group:`API`,isError:!1},{metric:`api.errors`,label:T(),unit:`/h`,group:`API`,isError:!0},{metric:`api.latency.avg_ms`,label:_(),unit:`ms`,group:`API`,isError:!1},{metric:`openclaw.ingest`,label:f(),unit:`/h`,group:`OpenClaw`,isError:!1},{metric:`chat.send`,label:S(),unit:`/h`,group:`Chat`,isError:!1},{metric:`assistant.stream.errors`,label:y(),unit:`/h`,group:`Assistant`,isError:!0}],H=V.length,U=[`API`,`OpenClaw`,`Chat`,`Assistant`],W=1e3,G=36e5;function K(e,t){let n=Math.max(1,Math.ceil((t-e)/G)),r=Math.min(n*H,W);return{rowLimit:r,buckets:Math.max(1,Math.floor(r/H))}}function q(){let e=D({from:`/settings/kpi`}),t=E({from:`/settings/kpi`}),n=ne(e.from,e.to,te,`now`),r=e=>void t({search:t=>({...t,...ee(e)})}),{from:a,to:o}=N(n),{rowLimit:s,buckets:c}=K(a,o),u=d(i.kpi.listKpis,{limit:s,filter:{from:a,to:o}}),f=(0,F.useMemo)(()=>{let e=new Map;for(let t of u??[]){let n=e.get(t.metric)??[];n.push({bucket:t.bucket,value:t.value}),e.set(t.metric,n)}for(let[t,n]of e)n.sort((e,t)=>e.bucket<t.bucket?-1:+(e.bucket>t.bucket)),n.length>c&&e.set(t,n.slice(n.length-c));return e},[u,c]),p=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{className:`oc-admin__hint`,children:[l(),` `,(0,I.jsx)(`span`,{className:`oc-filter__window`,children:h()})]}),(0,I.jsx)(J,{value:n,onChange:r})]});return u===void 0?(0,I.jsxs)(I.Fragment,{children:[p,(0,I.jsx)(z,{}),(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:x()})]}):u.length===0?(0,I.jsxs)(I.Fragment,{children:[p,(0,I.jsx)(z,{}),(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:v()})]}):(0,I.jsxs)(I.Fragment,{children:[p,(0,I.jsx)(z,{}),U.map(e=>{let t=V.filter(t=>t.group===e);return t.some(e=>(f.get(e.metric)??[]).length>0)?(0,I.jsxs)(`section`,{className:`oc-kpi__group`,children:[(0,I.jsx)(`h2`,{className:`oc-kpi__group-title`,children:e}),(0,I.jsx)(`div`,{className:`oc-kpi__grid`,children:t.map(e=>(0,I.jsx)(Y,{config:e,series:f.get(e.metric)??[]},e.metric))})]},e):null})]})}function J({value:e,onChange:t}){return(0,I.jsx)(`div`,{className:`oc-kpi__toolbar`,children:(0,I.jsx)(P,{value:e,onChange:t})})}function Y({config:e,series:t}){let n=t.length>0?t[t.length-1]:null,i=n?n.value:0;return(0,I.jsxs)(M,{size:`sm`,className:`oc-kpi__card`,children:[(0,I.jsxs)(O,{children:[(0,I.jsx)(A,{className:`oc-kpi__card-title`,children:e.label}),(0,I.jsx)(j,{className:`oc-kpi__card-metric`,children:(0,I.jsx)(`code`,{children:e.metric})})]}),(0,I.jsxs)(k,{className:`oc-kpi__card-body`,children:[(0,I.jsxs)(`div`,{className:`oc-kpi__value-row`,children:[(0,I.jsx)(`span`,{className:`oc-kpi__value`+(e.isError&&i>0?` oc-kpi__value--error`:``),children:Q(i)}),(0,I.jsx)(`span`,{className:`oc-kpi__unit`,children:e.unit})]}),(0,I.jsx)(ae,{series:t,isError:e.isError,unit:e.unit}),(0,I.jsxs)(`div`,{className:`oc-kpi__axis`,children:[n?(0,I.jsx)(`span`,{className:`oc-kpi__axis-latest`,children:w({value:$(n.bucket)})}):(0,I.jsx)(`span`,{className:`oc-kpi__muted`,children:m()}),(0,I.jsx)(`span`,{className:`oc-kpi__muted`,children:r({count:t.length})})]})]})]})}var X=240,Z=48,ie=1;function ae({series:e,isError:t,unit:n}){if(e.length===0)return(0,I.jsx)(`div`,{className:`oc-kpi__chart oc-kpi__chart--empty`,"aria-hidden":!0});let r=e.reduce((e,t)=>t.value>e?t.value:e,0),i=X/e.length,a=Math.max(i-ie,1);return(0,I.jsx)(`svg`,{className:`oc-kpi__chart`,viewBox:`0 0 ${X} ${Z}`,preserveAspectRatio:`none`,role:`img`,"aria-label":o({max:Q(r),unit:n}),children:e.map((e,o)=>{let s=r>0?e.value/r*(Z-1):0,c=o*i,l=Z-s;return(0,I.jsx)(`rect`,{className:`oc-kpi__bar`+(t&&e.value>0?` oc-kpi__bar--error`:``),x:c,y:l,width:a,height:s,children:(0,I.jsxs)(`title`,{children:[$(e.bucket),` · `,Q(e.value),` `,n]})},e.bucket)})})}function Q(e){return Number.isFinite(e)?Math.abs(e)>=1e3?(e/1e3).toFixed(e%1e3==0?0:1)+`k`:String(e):`0`}function $(e){let t=new Date(`${e}:00:00Z`);return Number.isNaN(t.getTime())?e:`${String(t.getUTCDate()).padStart(2,`0`)}/${String(t.getUTCMonth()+1).padStart(2,`0`)} ${String(t.getUTCHours()).padStart(2,`0`)}h`}export{q as KpiTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$A as r,A as i,AO as a,CO as o,DO as s,E as c,EO as l,F as u,FO as d,IO as f,J as ee,JA as te,LO as ne,M as re,MO as ie,N as ae,NO as oe,O as se,OO as ce,P as le,PO as p,QA as m,RO as h,SO as g,TO as ue,U as de,XA as fe,Y as pe,YA as me,ZA as he,_O as _,aO as v,bO as y,bj as b,cO as x,dO as S,dj as C,ej as w,fO as T,gO as E,hO as D,hx as O,j as k,jO as A,k as j,kO as M,lO as N,mO as P,n as F,nj as I,oO as L,oj as R,pO as ge,qA as _e,rj as ve,sO as ye,tj as be,uO as xe,vO as z,wO as Se,xO as Ce,yO as we,yj as B,zO as Te}from"./dist-Bcr-KIFN.js";import{t as V}from"./button-CvJAYeHx.js";import{C as H,M as Ee,S as U,_t as De,at as W,b as Oe,gt as ke,ht as Ae,ot as G,p as K,vt as q,w as je,x as Me,z as Ne}from"./index--Drh_B6c.js";import{t as Pe}from"./localePickerView-C2RmOS86.js";var J=t(e(),1),Y=n();function Fe({className:e,checked:t,onCheckedChange:n,disabled:r,...i}){return(0,Y.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":t,"data-state":t?`checked`:`unchecked`,disabled:r,onClick:()=>n(!t),className:F(`peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent transition-colors outline-none`,`focus-visible:ring-2 focus-visible:ring-ring/50`,`disabled:cursor-not-allowed disabled:opacity-50`,t?`bg-primary`:`bg-input`,e),...i,children:(0,Y.jsx)(`span`,{className:F(`pointer-events-none block size-4 rounded-full bg-background shadow transition-transform`,t?`translate-x-[18px]`:`translate-x-[2px]`)})})}var X=[{id:`messages`,label:()=>Te()},{id:`composer`,label:()=>h()},{id:`sidebar`,label:()=>ne()},{id:`other`,label:()=>f()}],Z={showSource:{category:`messages`,label:()=>d(),help:()=>p()},showReport:{category:`messages`,label:()=>oe(),help:()=>ie()},copyAssistant:{category:`messages`,label:()=>A()},copyUser:{category:`messages`,label:()=>a()},showDelete:{category:`messages`,label:()=>M()},showTools:{category:`messages`,label:()=>ce(),help:()=>s()},voiceInput:{category:`composer`,label:()=>l(),help:()=>ue()},showUsage:{category:`composer`,label:()=>Se(),help:()=>o()},autoReadAloud:{category:`composer`,label:()=>pe(),help:()=>ee()},showChatAge:{category:`sidebar`,label:()=>g(),help:()=>Ce()},showChatProvider:{category:`sidebar`,label:()=>y(),help:()=>we()}};function Q(e){return e.toLowerCase().normalize(`NFD`).replace(/\p{Diacritic}/gu,``)}function Ie(e,t){let n=Q(t.trim()),r=new Map(X.map(e=>[e.id,e.label()])),i=new Map(X.map(e=>[e.id,[]]));for(let t of e){let e=Z[t],a=e?.category??`other`;n&&!Q(`${e?e.label():t} ${e?.help?e.help():``} ${t} ${r.get(a)??``}`).includes(n)||i.get(a).push(t)}return X.map(e=>({id:e.id,label:r.get(e.id),keys:i.get(e.id)})).filter(e=>e.keys.length>0)}var Le=[`showSource`,`showReport`,`copyAssistant`,`copyUser`,`showDelete`,`showTools`,`voiceInput`,`showChatAge`,`showChatProvider`,`showUsage`,`autoReadAloud`],Re={voiceInput:`voiceInput`};function ze(e){return Le.includes(e)}function $(e){return e===`admin`}function Be(e){return e===!0?`on`:e===!1?`off`:`inherit`}function Ve(e){return e===`on`?!0:e===`off`?!1:null}function He(e){return ze(e)?Re[e]:void 0}var Ue={voiceInput:()=>N()};function We({prefKey:e,ui:t}){let n=B(c.admin.setUiPrefDefault),r=B(c.admin.setFeatureEnabled),i=He(e),a=i?Ue[e]?.():void 0;return(0,Y.jsxs)(`div`,{className:`oc-prefs__gov`,children:[(0,Y.jsxs)(`div`,{className:`oc-prefs__gov-row`,children:[(0,Y.jsx)(`span`,{className:`oc-prefs__gov-label`,children:ge()}),(0,Y.jsxs)(Oe,{value:Be(t.defaults[e]),onValueChange:t=>void n({key:e,value:Ve(t)}),children:[(0,Y.jsx)(H,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(je,{})}),(0,Y.jsxs)(Me,{children:[(0,Y.jsx)(U,{value:`on`,children:ye()}),(0,Y.jsx)(U,{value:`off`,children:L()}),(0,Y.jsx)(U,{value:`inherit`,children:v()})]})]}),i?(0,Y.jsxs)(`span`,{className:`oc-prefs__gov-gate`,children:[(0,Y.jsx)(K,{checked:t.featuresEnabled[i]===!0,onCheckedChange:e=>void r({key:i,enabled:e===!0}),"aria-label":T()}),T()]}):null]}),a?(0,Y.jsx)(`span`,{className:`oc-prefs__gov-help`,children:a}):null]})}function Ge({current:e,enabled:t}){let n=B(c.me.setDictationShortcut),[r,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(!1);return(0,J.useEffect)(()=>{if(!r)return;let e=e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){a(!1);return}let t=ke(e);if(t===null){[`Shift`,`Control`,`Meta`,`Alt`].includes(e.key)||(s(!0),window.setTimeout(()=>s(!1),1800));return}a(!1),n({shortcut:t})};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[r,n]),(0,Y.jsxs)(`div`,{className:`oc-prefs__row${t?``:` is-locked`}`,children:[(0,Y.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,Y.jsxs)(`span`,{className:`oc-prefs__label`,children:[u(),e?(0,Y.jsx)(W,{variant:`secondary`,children:De(e,Ae())}):null]}),(0,Y.jsx)(`span`,{className:`oc-prefs__help`,children:o?re():r?ae():le()})]}),(0,Y.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[e&&!r?(0,Y.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void n({shortcut:null}),children:se()}):null,(0,Y.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,disabled:!t,"aria-pressed":r,onClick:()=>a(e=>!e),children:r?j():e?i():k()})]})]})}function Ke(){let[e,t]=(0,J.useState)(``),[n,r]=(0,J.useState)(!1),i=b(c.me.getMe,{host:q}),a=i?.ui,o=$(i?.role)&&n,s=B(c.me.setUiPref).withOptimisticUpdate(Ee),l=(0,J.useMemo)(()=>a?Ie(Object.keys(a.effective),e):[],[a,e]);return a?(0,Y.jsxs)(`div`,{className:`oc-prefs-panel`,children:[$(i?.role)?(0,Y.jsxs)(`label`,{className:`oc-prefs__gov-toggle`,children:[(0,Y.jsx)(K,{checked:n,onCheckedChange:e=>r(e===!0),"aria-label":P()}),P()]}):null,o?(0,Y.jsxs)(`div`,{className:`oc-prefs__gov-head`,children:[(0,Y.jsx)(`p`,{children:S()}),(0,Y.jsx)(`p`,{children:xe()}),(0,Y.jsx)(`p`,{children:x()})]}):null,(0,Y.jsx)(G,{value:e,onChange:e=>t(e.target.value),placeholder:z(),"aria-label":z(),className:`mb-2`}),l.length===0?(0,Y.jsx)(`div`,{className:`oc-prefs__empty`,children:_()}):(0,Y.jsx)(`div`,{className:`oc-prefs`,children:l.map(e=>(0,Y.jsxs)(`section`,{className:`oc-prefs__card`,children:[(0,Y.jsx)(`h4`,{className:`oc-prefs__cat`,children:e.label}),e.keys.map(e=>{let t=Z[e],n=t?t.label():e,r=t?.help?.(),i=a.locked[e],c=a.effective[e],l=a.userOverrides[e]!==void 0;return(0,Y.jsxs)(`div`,{className:`oc-prefs__row${i?` is-locked`:``}`,children:[(0,Y.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,Y.jsxs)(`span`,{className:`oc-prefs__label`,children:[n,i?(0,Y.jsx)(W,{variant:`outline`,children:E()}):l?(0,Y.jsx)(W,{variant:`secondary`,children:de()}):null]}),r?(0,Y.jsx)(`span`,{className:`oc-prefs__help`,children:r}):null]}),(0,Y.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[!i&&l?(0,Y.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void s({key:e,value:null}),children:D()}):null,(0,Y.jsx)(Fe,{checked:c,disabled:i,onCheckedChange:t=>void s({key:e,value:t}),"aria-label":n})]}),o?(0,Y.jsx)(We,{prefKey:e,ui:a}):null]},e)})]},e.id))}),(0,Y.jsx)(Ge,{current:i?.dictationShortcut??null,enabled:a.effective.voiceInput===!0})]}):(0,Y.jsx)(`div`,{className:`oc-prefs__empty`,children:C()})}function qe(){let e=b(c.me.getMe,{host:q}),t=B(c.me.setLocale),n=B(c.me.setMyName),i=Ne(),a=e?.locale??`default`,o=e?.name??``,[s,l]=(0,J.useState)(null),u=s??o,d=u.trim()!==o.trim();async function f(){try{await n({name:u}),l(null),i.success(r())}catch(e){i.error(m(),e)}}return(0,Y.jsxs)(`div`,{className:`oc-appearance`,children:[(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:ve()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:I()})]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(G,{className:`max-w-xs`,value:u,maxLength:120,placeholder:be(),onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`&&d&&(e.preventDefault(),f())}}),(0,Y.jsx)(V,{size:`sm`,disabled:!d,onClick:()=>void f(),children:O()})]}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:w()})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:he()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:fe()})]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[Pe().map(e=>(0,Y.jsx)(V,{variant:a===e.value?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:e.value}),children:e.label},e.value)),(0,Y.jsx)(V,{variant:a==="default"?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:null}),children:R()})]}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:me()})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:te()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:_e()})]}),(0,Y.jsx)(Ke,{})]})]})}export{qe as PreferencesTab};
@@ -1,4 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$n as r,Ah as i,Bh as a,Ch as o,Dh as s,E as c,Eh as l,Fh as u,Fi as d,Ih as f,Jh as p,Lh as m,Mh as h,Mi as g,Nh as _,Ni as v,Oh as ee,Ph as te,Pi as y,Qn as b,Rh as x,Sh as S,Th as C,Vh as w,Xn as T,Xt as E,Yh as D,Yn as ne,Yt as re,Zn as ie,Zt as O,bj as k,er as A,jh as j,ji as M,kh as N,wh as P,yj as F,zh as I}from"./dist-Bcr-KIFN.js";import{d as L,f as R,i as z,l as B,n as V,r as H,t as ae,u as U}from"./FieldLabel-DYhOcc_e.js";import{t as W}from"./button-CvJAYeHx.js";import{C as G,S as K,b as q,p as J,vt as oe,w as Y,x as X,z as se}from"./index--Drh_B6c.js";import{r as Z,t as ce}from"./locales-CPjguROj.js";import{t as le}from"./localePickerView-C2RmOS86.js";/* empty css */var Q=t(e(),1),$=n(),ue={media_delivery:{label:f,help:u},documentary_fetch:{label:te,help:_},inbound_files:{label:h,help:j},history_summary:{label:d,help:y},file_curation:{label:A,help:r}},de={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`},fe={outboundDir:P,references:o,files:S,previous_summary:v,new_messages:g,max_chars:M,file_name:b,budget_chars:ie,feedback:T,content:ne};function pe(){let e=k(c.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:N()})});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)(V,{label:w(),help:a()}),(0,$.jsxs)(`label`,{className:`oc-injtab__picker`,children:[(0,$.jsx)(`span`,{children:i()}),(0,$.jsxs)(q,{value:r._id,onValueChange:e=>n(e),children:[(0,$.jsx)(G,{size:`sm`,className:`min-w-44`,children:(0,$.jsx)(Y,{})}),(0,$.jsx)(X,{children:e.map(e=>(0,$.jsx)(K,{value:e._id,children:e.displayName??e.name},e._id))})]})]})]}),(0,$.jsx)(me,{instance:r},r._id)]})}function me({instance:e}){let t=F(c.admin.upsertInstanceConfig),n=se(),r=k(c.me.getMe,{host:oe}),i=e.config??{},a=Z(e.config?.contentLocale,r?.defaultLocale??void 0),[o,s]=(0,Q.useState)(()=>z(i,a));(0,Q.useEffect)(()=>{s(z(i,a))},[a,e._id]);let[l,u]=(0,Q.useState)(!1),d=o.promptInjections,f=(e,t)=>s({...o,promptInjections:{...d,[e]:{...d[e],...t}}});async function m(){u(!0);try{await t({instanceId:e._id,config:H(o,i,a)})}catch(e){n.error(p(),e)}finally{u(!1)}}async function h(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(p(),e)}}let g=e.config?.contentLocale??`default`,_=ce[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:O()}),(0,$.jsxs)(q,{value:g,onValueChange:e=>void h(e),children:[(0,$.jsx)(G,{size:`sm`,className:`min-w-44`,children:(0,$.jsx)(Y,{})}),(0,$.jsxs)(X,{children:[(0,$.jsx)(K,{value:`default`,children:re({locale:_})}),le().map(e=>(0,$.jsx)(K,{value:e.value,children:e.label},e.value))]})]}),(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:E()})]}),U.map(e=>(0,$.jsx)(he,{injKey:e,def:B[e],i18n:ue[e],row:d[e]??{enabled:!0,template:B[e].defaultTemplate[a]},contentLocale:a,onChange:t=>f(e,t)},e)),(0,$.jsx)(`div`,{className:`oc-injtab__actions`,children:(0,$.jsx)(W,{size:`sm`,onClick:()=>void m(),disabled:l,children:D()})})]})}function he({injKey:e,def:t,i18n:n,row:r,contentLocale:i,onChange:a}){let[o,c]=(0,Q.useState)(!1),u=r.template.trim()!==t.defaultTemplate[i],d=t.togglable&&!r.enabled,f=Object.fromEntries(t.placeholders.map(e=>[e,de[e]??`{${e}}`])),p=L(e,r,i),h=p?R(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)(J,{checked:r.enabled,onCheckedChange:e=>a({enabled:e===!0})}),(0,$.jsx)(V,{label:n.label(),help:n.help()})]}):(0,$.jsx)(V,{label:n.label(),help:n.help()}),u&&(0,$.jsx)(`span`,{className:`oc-injection__badge`,children:x()})]}),(0,$.jsx)(`textarea`,{className:`oc-injcard__text`,value:r.template,disabled:d,rows:8,spellCheck:!1,onChange:e=>a({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:m()}),t.placeholders.map(e=>(0,$.jsxs)(`span`,{className:`oc-injcard__ph-chip`,children:[(0,$.jsx)(`code`,{children:`{${e}}`}),(0,$.jsx)(ae,{text:(fe[e]??(()=>e))()})]},e))]}),(0,$.jsxs)(`div`,{className:`oc-injcard__btns`,children:[(0,$.jsx)(W,{variant:`ghost`,size:`sm`,onClick:()=>c(e=>!e),children:o?s():ee()}),u&&(0,$.jsx)(W,{variant:`ghost`,size:`sm`,onClick:()=>a({template:t.defaultTemplate[i]}),children:I()})]})]}),o&&(0,$.jsx)(`div`,{className:`oc-injcard__preview`,children:h?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`pre`,{className:`oc-injcard__previewtext`,children:h}),(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:l()})]}):(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:C()})})]})}export{pe as PromptInjectionsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ay as r,Cy as i,Dy as a,E as o,Ey as s,Gv as c,Jv as l,Kv as u,My as d,Ny as f,Oy as p,Qv as ee,Sy as m,Ty as h,Wv as te,Xv as g,Yv as ne,Zv as re,_y as ie,ay as _,bj as v,by as y,cy as b,dy as x,fy as S,gy as ae,hy as C,iy as w,jy as T,ky as E,ly as D,my as O,oy as k,py as A,qv as j,sy as M,uy as N,vy as P,wr as F,wy as I,xy as L,yj as R,yy as z}from"./dist-Bcr-KIFN.js";import{t as B}from"./button-CvJAYeHx.js";import{B as V,Ft as H,at as U,ot as W,p as G,u as K,z as q}from"./index--Drh_B6c.js";import{t as J}from"./roleDescriptions-DBwd5h4i.js";var Y=t(e(),1),X=n(),Z=[{group:()=>f(),keys:[{key:`traces.read`,label:()=>p()},{key:`traces.read.content`,label:()=>a(),phi:!0},{key:`traces.write`,label:()=>s()}]},{group:()=>d(),keys:[{key:`kpi.read`,label:()=>p()},{key:`kpi.write`,label:()=>s()}]},{group:()=>T(),keys:[{key:`openclaw.query`,label:()=>h()},{key:`anomalies.read`,label:()=>I()},{key:`anomalies.report`,label:()=>i()}]},{group:()=>r(),keys:[{key:`chats.read`,label:()=>p()},{key:`selfheal`,label:()=>L()},{key:`feedback.respond`,label:()=>F()}]},{group:()=>E(),keys:[{key:`admin.manage`,label:()=>m()}]}],oe=Z.flatMap(e=>e.keys.map(e=>e.key));function Q(e){return e.includes(`*`)}var $={key:``,name:``,description:``};function se(){let e=v(o.apiKeys.listRoles,{}),t=R(o.apiKeys.createRole),n=R(o.apiKeys.ensureRolesSeeded),r=R(o.apiKeys.updateRolePermissions).withOptimisticUpdate((e,{roleId:t,permissions:n})=>{let r=e.getQuery(o.apiKeys.listRoles,{});r&&e.setQuery(o.apiKeys.listRoles,{},r.map(e=>e._id===t?{...e,permissions:n}:e))}),i=V(),a=q(),[s,d]=(0,Y.useState)(!1),[f,p]=(0,Y.useState)($),[m,h]=(0,Y.useState)(new Set);(0,Y.useEffect)(()=>{n({}).catch(e=>{a.error(z(),e)})},[n,a]);let T=e??[];async function E(e,t){if(Q(e.permissions)||m.has(e._id))return;let n=e.permissions.includes(t)?e.permissions.filter(e=>e!==t):[...e.permissions,t];if(!(e.builtin&&!await i({title:P({name:e.name}),description:ie(),confirmLabel:ae()}))){h(t=>new Set(t).add(e._id));try{await r({roleId:e._id,permissions:n})}catch(e){a.error(C(),e)}finally{h(t=>{let n=new Set(t);return n.delete(e._id),n})}}}async function F(){try{await t({key:f.key,name:f.name,description:f.description||void 0,permissions:[]}),p($),d(!1)}catch(e){a.error(O(),e)}}let I=e===void 0,L=!I&&T.length===0;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`oc-admin__hint`,children:[A(),` `,(0,X.jsx)(`code`,{children:`admin`}),` `,S(),` `,(0,X.jsx)(`code`,{children:`traces.read.content`}),` `,x()]}),(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:N()}),(0,X.jsx)(`div`,{className:`oc-dt__bar-actions`,children:(0,X.jsx)(B,{size:`sm`,onClick:()=>{p($),d(!0)},children:D()})})]}),I?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:b()}):L?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:M()}):(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:k()}),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?y({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:T.map(e=>{let t=Q(e.permissions),n=m.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)(U,{variant:`outline`,className:`gap-1`,children:[(0,X.jsx)(H,{}),` `,_()]}):(0,X.jsx)(U,{variant:`secondary`,children:w()})]}),J(e)?(0,X.jsx)(`p`,{className:`oc-matrix__roledesc`,children:J(e)}):null]}),oe.map(r=>(0,X.jsx)(`td`,{className:`oc-matrix__cell`,children:(0,X.jsx)(G,{checked:t||e.permissions.includes(r),disabled:t||n,"aria-label":`${e.key} · ${r}`,title:t?ee():n?re():r,onCheckedChange:()=>void E(e,r)})},r))]},e.key)})})]})})]}),(0,X.jsx)(K,{open:s,onOpenChange:d,title:g(),description:ne(),canSubmit:!!(f.key&&f.name),onSubmit:F,submitLabel:l(),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:j()}),(0,X.jsx)(W,{value:f.key,placeholder:u(),onChange:e=>p({...f,key:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:c()}),(0,X.jsx)(W,{value:f.name,onChange:e=>p({...f,name:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:te()}),(0,X.jsx)(W,{value:f.description,onChange:e=>p({...f,description:e.target.value})})]})]})})]})}export{se as RolesTab};
@@ -1 +0,0 @@
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 ee,BD as te,BE as a,CD as ne,DD as re,E as o,ED as ie,FD as ae,GD as oe,GE as s,HD as se,HE as c,ID as ce,JD as le,JE as l,KD as ue,KE as u,LD as de,MD as fe,ND as pe,OD as me,PD as he,QD as d,QE as f,RD as ge,RE as p,SD as _e,TD as ve,UD as ye,UE as m,VD as be,VE as xe,WD as Se,WE as Ce,XD as we,XE as Te,YD as Ee,YE as h,ZD as De,ZE as g,_D as Oe,_j as ke,aD as _,bD as Ae,bj as v,cD as je,dD as Me,eD as y,eO as Ne,fD as Pe,gD as Fe,hD as Ie,iD as b,iO as Le,jD as Re,kD as ze,lD as Be,mD as Ve,nD as x,nO as He,oD as S,pD as Ue,qD as We,qE as C,rD as w,rO as Ge,sD as T,tD as E,tO as Ke,uD as qe,vD as Je,wD as Ye,xD as Xe,yD as Ze,yj as D,zD as Qe,zE as O}from"./dist-Bcr-KIFN.js";import{n as k}from"./dist-CX03UY-q.js";import{i as $e}from"./dist-BvTSSv91.js";import{t as A}from"./button-CvJAYeHx.js";import{A as j,B as et,C as M,Gt as tt,Kt as nt,S as N,Vt as P,Wt as rt,at as F,b as I,ct as L,dt as R,ft as z,k as B,lt as V,ot as H,st as U,u as it,ut as W,w as G,x as K,z as at}from"./index--Drh_B6c.js";import{t as ot}from"./FilterBar-CzpwZuGf.js";import{t as st}from"./DataTableShell-c6bvewGu.js";import{t as ct}from"./roleDescriptions-DBwd5h4i.js";var q=t(e(),1),J=n(),Y=[{value:`never`,label:()=>Ce(),days:null},{value:`30`,label:()=>m(),days:30},{value:`90`,label:()=>c(),days:90}],X=720*60*60*1e3,Z=`__all__`,Q={name:``,roleKey:``,description:``};function $(){let e=nt({from:`/settings/serviceAccounts`}),t=tt({from:`/settings/serviceAccounts`}),n=e.q??``,i=e.status??Z,[a,s]=(0,q.useState)(Z),c=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),l=e=>void t({search:t=>({...t,status:e===Z?void 0:e})}),u=v(o.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:a===Z?void 0:a,disabled:i===Z?void 0:i===`disabled`}}),f=v(o.apiKeys.listKeys,{}),p=v(o.apiKeys.listRoles,{}),m=D(o.apiKeys.createServiceAccount),xe=D(o.apiKeys.updateServiceAccount),Ce=D(o.apiKeys.deleteServiceAccount),Te=ke(o.apiKeys.mintApiKey),h=D(o.apiKeys.revokeApiKey),g=et(),_=at(),y=n!==``||a!==Z||i!==Z;function b(){s(Z),t({search:{},replace:!0})}let[x,S]=(0,q.useState)(!1),[C,w]=(0,q.useState)(Q),[T,E]=(0,q.useState)(null),[O,k]=(0,q.useState)(new Set),[j,P]=(0,q.useState)(null),L=(0,q.useRef)(!1),[R,z]=(0,q.useState)(new Set),[B,V]=(0,q.useState)({}),[U,W]=(0,q.useState)(null),X=(0,q.useMemo)(()=>{let e=new Map;for(let t of f??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[f]);function $(e){k(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function dt(){try{T?(await xe({serviceAccountId:T,name:C.name,roleKey:C.roleKey,description:C.description}),_.success(_e())):await m({name:C.name,roleKey:C.roleKey,description:C.description||void 0}),w(Q),E(null),S(!1)}catch(e){_.error(T?ne():Ye(),e)}}function ft(e){w({name:e.name,roleKey:e.roleKey,description:e.description??``}),E(e._id),S(!0)}async function pt(e){if(L.current)return;L.current=!0;let t=B[e._id]??`never`,n=Y.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;P(e._id);try{let t=await Te({serviceAccountId:e._id,expiresAt:r});W({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){_.error(Xe(),e)}finally{L.current=!1,P(null)}}async function mt(e){if(await g({title:Ae(),description:(0,J.jsxs)(J.Fragment,{children:[Ze(),` `,(0,J.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,Je(),` `,(0,J.jsx)(`strong`,{children:Oe()}),` `,Fe()]}),confirmWord:e.name,confirmLabel:Ie(),destructive:!0}))try{await Ce({serviceAccountId:e._id}),_.success(Ve(),e.name)}catch(e){_.error(Ue(),e)}}async function ht(e){if(await g({title:Pe(),description:(0,J.jsxs)(J.Fragment,{children:[Me(),` `,(0,J.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,qe()]}),confirmLabel:Be(),destructive:!0})&&!R.has(e._id)){z(t=>new Set(t).add(e._id));try{await h({keyId:e._id})}catch(e){_.error(je(),e)}finally{z(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Le()}),(0,J.jsxs)(ot,{q:n,onQChange:c,searchPlaceholder:Ge(),onReset:b,canReset:y,children:[(0,J.jsxs)(I,{value:a,onValueChange:s,children:[(0,J.jsx)(M,{size:`sm`,className:`w-40`,children:(0,J.jsx)(G,{placeholder:He()})}),(0,J.jsxs)(K,{children:[(0,J.jsx)(N,{value:Z,children:Ke()}),(p??[]).map(e=>(0,J.jsx)(N,{value:e.key,children:e.key},e._id))]})]}),(0,J.jsxs)(I,{value:i,onValueChange:l,children:[(0,J.jsx)(M,{size:`sm`,className:`w-36`,children:(0,J.jsx)(G,{})}),(0,J.jsxs)(K,{children:[(0,J.jsx)(N,{value:Z,children:Ne()}),(0,J.jsx)(N,{value:`active`,children:r()}),(0,J.jsx)(N,{value:`disabled`,children:d()})]})]})]}),(0,J.jsx)(st,{title:De(),rows:u,addLabel:we(),onAdd:()=>{w(Q),E(null),S(!0)},emptyHint:Ee(),isExpanded:e=>O.has(e._id),renderExpanded:e=>(0,J.jsx)(lt,{account:e,keys:X.get(e._id)??[],onRevoke:ht,revoking:R}),rowActions:e=>[{label:oe(),onSelect:()=>ft(e)},{label:le(),onSelect:()=>void pt(e)},{label:O.has(e._id)?We():ue(),onSelect:()=>$(e._id)},{label:Se(),variant:`destructive`,onSelect:()=>void mt(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(A,{variant:`ghost`,size:`icon-sm`,"aria-label":O.has(e._id)?ye():se(),onClick:()=>$(e._id),children:O.has(e._id)?(0,J.jsx)($e,{}):(0,J.jsx)(rt,{})})},{header:be(),sort:e=>e.name,cell:e=>(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(`span`,{children:e.name}),e.description?(0,J.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:te(),sort:e=>e.roleKey,cell:e=>(0,J.jsx)(F,{variant:`secondary`,children:e.roleKey})},{header:Qe(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,J.jsx)(F,{variant:`destructive`,children:d()}):(0,J.jsx)(F,{variant:`outline`,children:r()})},{header:ge(),cell:e=>(0,J.jsxs)(I,{value:B[e._id]??`never`,onValueChange:t=>V(n=>({...n,[e._id]:t})),children:[(0,J.jsx)(M,{size:`sm`,className:`w-32`,children:(0,J.jsx)(G,{})}),(0,J.jsx)(K,{children:Y.map(e=>(0,J.jsx)(N,{value:e.value,children:e.label()},e.value))})]})},{header:de(),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,J.jsx)(`span`,{className:`oc-sa__keycount`,children:j===e._id?ce():ae({count:t})})}}]}),(0,J.jsx)(it,{open:x,onOpenChange:e=>{S(e),e||E(null)},title:T?he():Re(),description:T?pe():ee(),canSubmit:!!(C.name&&C.roleKey),onSubmit:dt,submitLabel:T?fe():ze(),children:(0,J.jsxs)(`div`,{className:`oc-form`,children:[(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:me()}),(0,J.jsx)(H,{value:C.name,onChange:e=>w({...C,name:e.target.value})})]}),(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:re()}),(0,J.jsxs)(I,{value:C.roleKey||void 0,onValueChange:e=>w({...C,roleKey:e}),children:[(0,J.jsx)(M,{className:`w-full`,children:(0,J.jsx)(G,{placeholder:ie()})}),(0,J.jsx)(K,{children:(p??[]).map(e=>(0,J.jsxs)(N,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(p??[]).find(e=>e.key===C.roleKey),t=e?ct(e):null;return t?(0,J.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:ve()}),(0,J.jsx)(H,{value:C.description,onChange:e=>w({...C,description:e.target.value})})]})]})}),(0,J.jsx)(ut,{minted:U,onClose:()=>W(null)})]})}function lt({account:e,keys:t,onRevoke:n,revoking:r}){return(0,J.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,J.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[T(),` `,(0,J.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:S()}):(0,J.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`th`,{children:_()}),(0,J.jsx)(`th`,{children:b()}),(0,J.jsx)(`th`,{children:w()}),(0,J.jsx)(`th`,{children:x()}),(0,J.jsx)(`th`,{children:E()}),(0,J.jsx)(`th`,{children:y()}),(0,J.jsx)(`th`,{})]})}),(0,J.jsx)(`tbody`,{children:t.map(t=>(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`td`,{children:(0,J.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,J.jsx)(`td`,{children:(0,J.jsx)(F,{variant:`secondary`,children:e.roleKey})}),(0,J.jsx)(`td`,{children:j(t.createdAt)}),(0,J.jsx)(`td`,{className:dt(t.lastUsedAt)?`oc-sa__stale`:``,children:ft(t.lastUsedAt)}),(0,J.jsx)(`td`,{children:pt(t.expiresAt)}),(0,J.jsx)(`td`,{children:mt(t)}),(0,J.jsx)(`td`,{className:`text-right`,children:t.disabled?null:(0,J.jsx)(A,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?i():f()})})]},t._id))})]})]})}function ut({minted:e,onClose:t}){let[n,r]=(0,q.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,J.jsx)(U,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,J.jsxs)(L,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,J.jsxs)(R,{children:[(0,J.jsx)(z,{children:g()}),(0,J.jsx)(V,{children:Te({name:e.accountName})})]}),(0,J.jsx)(`div`,{className:`oc-sa__minted-warning`,children:h()}),(0,J.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,J.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,J.jsxs)(A,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":l(),children:[n?(0,J.jsx)(k,{}):(0,J.jsx)(P,{}),n?C():u()]})]}),(0,J.jsx)(W,{children:(0,J.jsx)(A,{onClick:()=>{r(!1),t()},children:s()})})]}):null})}function dt(e){return e===null?!1:Date.now()-e>X}function ft(e){return e===null?xe():j(e)}function pt(e){return e===null?`—`:B(e)}function mt(e){return e.disabled?(0,J.jsx)(F,{variant:`destructive`,children:a()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,J.jsx)(F,{variant:`outline`,children:O()}):(0,J.jsx)(F,{variant:`outline`,children:p()})}export{$ as ServiceAccountsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$i as r,Bi as i,Ca as a,E as o,Gi as s,Hi as c,Ji as l,Ki as u,Qi as d,Sa as f,Ui as p,Vi as m,Wi as h,Xi as g,Yi as _,Zi as v,_a as y,aa as b,ba as x,bj as S,ca as C,da as w,ea as T,fa as E,ga as D,ha as O,ia as k,la as A,ma as j,na as M,oa as N,pa as P,qi as F,ra as I,sa as L,ta as R,ua as ee,va as z,wa as B,xa as V,ya as H,yj as U}from"./dist-Bcr-KIFN.js";import{t as W}from"./button-CvJAYeHx.js";import{A as G,B as K}from"./index--Drh_B6c.js";import{t as q}from"./DataTableShell-c6bvewGu.js";var J=t(e(),1),Y=n(),X={hung:()=>L(),wrong_result:()=>N(),error:()=>b(),other:()=>k()},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=U(o.subAgentReports.respondToReport),[i,a]=(0,J.useState)(e.thread),[c,f]=(0,J.useState)(``),[m,y]=(0,J.useState)(!1);async function b(){let t=c.trim();if(!(!t||m)){y(!0);try{await n({reportId:e._id,text:t}),a(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),f(``)}finally{y(!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),` · `,I({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:M()}),(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:R()}),i.length>0?(0,Y.jsx)(`div`,{className:`oc-fbadmin__thread`,children:i.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`?T():r()}),(0,Y.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Y.jsx)(`p`,{className:`oc-fbadmin__meta`,children:d()}),(0,Y.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:v(),value:c,maxLength:2e3,rows:3,onChange:e=>f(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 b(),disabled:!c.trim()||m,children:m?_():g()})})]}),(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[l({count:t.children.length}),t.childrenTruncated?` ${F()}`:``,t.textTruncated?` ${u()}`:``]}),(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?` · ${s()}`:``]}),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:h()}),(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:p()}),(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=S(o.subAgentReports.listForAdmin,{}),t=U(o.subAgentReports.readReport),n=U(o.subAgentReports.deleteReport),r=K(),[s,l]=(0,J.useState)(null),[u,d]=(0,J.useState)({});async function p(e){if(s===e._id){l(null);return}if(!u[e._id]){let n=await t({reportId:e._id});d(t=>({...t,[e._id]:n}))}l(e._id)}async function h(e){await r({title:c(),description:m(),confirmLabel:i(),destructive:!0})&&(await n({reportId:e._id}),s===e._id&&l(null))}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[f(),` `,(0,Y.jsx)(`strong`,{children:V()}),` `,x()]}),(0,Y.jsx)(q,{title:B(),rows:e,emptyHint:a(),isExpanded:e=>s===e._id&&!!u[e._id],renderExpanded:e=>u[e._id]?(0,Y.jsx)($,{data:u[e._id]}):null,columns:[{header:H(),cell:e=>G(e.at),sort:e=>e.at},{header:z(),cell:e=>Z(e.category),sort:e=>Z(e.category)},{header:y(),cell:e=>`${e.failedCount}/${e.totalCount}`,sort:e=>e.failedCount},{header:D(),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:j(),cell:e=>e.answered?(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:E()}):(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill`,children:w()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:s===e._id?A():ee(),onSelect:()=>void p(e)},{label:C(),onSelect:()=>void h(e),variant:`destructive`}]})]})}export{te as SubAgentReportsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$O as r,$k as i,Ak as a,BO as o,Bk as s,Ck as c,D as l,Dk as u,E as d,Ek as f,Fk as p,GO as m,Gk as h,HO as g,Hk as _,Ii as ee,Ik as v,JO as y,Jk as te,KO as ne,Kk as re,Li as ie,Lk as ae,Mk as oe,Nk as se,Ok as ce,Pk as le,QO as ue,Qk as b,Ri as x,Rk as de,Sk as fe,Tk as S,UO as pe,Uk as me,VO as he,Vk as ge,WO as C,Wk as _e,XO as ve,Xk as ye,YO as be,Yk as xe,ZO as Se,Zk as Ce,_j as we,_k as Te,aA as Ee,ak as De,bj as w,bk as Oe,cA as ke,cj as Ae,ck as je,dk as Me,eA as Ne,ek as Pe,fk as Fe,gk as Ie,hk as Le,iA as Re,ik as ze,jk as Be,kk as Ve,lj as He,lk as Ue,mk as We,n as Ge,nA as Ke,nk as qe,oA as Je,ok as T,pk as Ye,qO as Xe,qk as Ze,rA as Qe,rk as $e,sA as et,sj as tt,sk as nt,tA as rt,tk as it,uk as at,vk as ot,wk as st,xk as ct,yj as E,yk as lt,zi as D,zk as ut}from"./dist-Bcr-KIFN.js";import{n as O}from"./dist-CX03UY-q.js";import{t as k}from"./x-BVy5P5am.js";import{t as A}from"./button-CvJAYeHx.js";import{$ as dt,Bt as ft,C as j,S as M,at as N,b as P,et as pt,it as mt,mt as ht,nt as gt,ot as F,p as I,pt as _t,rt as L,tt as R,vt,w as z,x as B,zt as V}from"./index--Drh_B6c.js";import{t as yt}from"./localePickerView-C2RmOS86.js";import{a as bt,i as xt,n as St,o as Ct,r as wt,t as Tt}from"./card-1aYDgnwU.js";import{a as Et,i as H,n as Dt,o as U,r as W,t as Ot}from"./table-CrooMP5e.js";import{t as kt}from"./TimeRangePicker-XUfGR5S2.js";import{t as At}from"./FilterBar-CzpwZuGf.js";import{t as jt}from"./AdvancedFilter-UZD1c3U9.js";var G=l(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),K=t(e(),1),Mt=.1,Nt=[248,248,248],Pt=[24,24,24];function Ft(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 It(e,t,n){let r=t*n;if(r===0)return 0;let i=0;for(let t=3;t<e.length;t+=4)e[t]<=8&&i++;return i/r}function q(e,t,n){return It(e,t,n)>=Mt}function Lt(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 Rt(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 zt=12*1024*1024,Bt=480,Vt=160,Ht=.92;async function Ut(e,t={}){if(!e.type.startsWith(`image/`))throw Error(Ue());if(e.size>zt)throw Error(je());let{source:n,width:r,height:i,cleanup:a}=await Wt(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Bt/r,Vt/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(T());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=Ft(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(T());if(p.drawImage(l,d.x,d.y,d.width,d.height,0,0,d.width,d.height),t.variantFor){let e=p.getImageData(0,0,d.width,d.height);q(e.data,d.width,d.height)?Lt(e.data,t.variantFor===`dark`?Nt:Pt):Rt(e.data),p.putImageData(e,0,0)}let m=q(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await Y(f,`image/webp`,Ht)??await Y(f,`image/png`);if(!h)throw Error(De());return{blob:h,hasAlpha:m}}finally{a()}}async function Wt(e){if(e.type===`image/svg+xml`)return J(e);if(typeof createImageBitmap==`function`)try{let t=await createImageBitmap(e);return{source:t,width:t.width,height:t.height,cleanup:()=>t.close()}}catch{}return J(e)}async function J(e){let t=URL.createObjectURL(e);try{let e=new Image;return e.decoding=`async`,await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=()=>r(Error(nt())),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 Gt(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__`,Q={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 $({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`?He():e===`dark`?Ae():tt()}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:Ge(`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)(A,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":D(),title:D(),children:(0,X.jsx)(ft,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=w(d.charts.listMyCharts),r=E(d.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:Ne()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:i()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:b(),subtitle:Ce(),tokens:null,mode:t,onSelect:()=>void a(null)}),(n??[]).map(n=>{let r=n.via===`common`?ye():n.via===`owner`?xe():te({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:()=>Gt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ze()}):null]})}function Qt(){let e=E(d.charts.importChart),[t,n]=(0,K.useState)(``),[r,i]=(0,K.useState)(``),[o,s]=(0,K.useState)(null),[l,p]=(0,K.useState)(!1),[m,h]=(0,K.useState)(!1);async function g(e){let t=e.target.files?.[0];if(e.target.value=``,t){s(null),p(!1);try{i(await t.text())}catch{s(S())}}}async function _(){if(s(null),p(!1),t.trim()===``){s(c());return}let a;try{a=JSON.parse(r)}catch{s(S());return}h(!0);try{await e({name:t.trim(),tokens:a}),p(!0),n(``),i(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{h(!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:se()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:oe()})]}),(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:Be()}),(0,X.jsx)(F,{value:t,onChange:e=>n(e.target.value),placeholder:a(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:Ve()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:ce(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(G,{className:`size-4`}),u(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void g(e)})]})}),(0,X.jsx)(A,{size:`sm`,disabled:m,onClick:()=>void _(),children:f()})]}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null,l?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:st()}):null]})]})}function $t({chart:e}){let t=we(d.charts.setChartLogo),n=E(d.charts.removeChartLogo),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.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 Ut(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 f(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 p({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`?Ie():Le()}),(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)(A,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(G,{className:`size-4`}),t?Ye():We(),(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)(A,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void f(e),children:Me()}):null,t?(0,X.jsx)(A,{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:Te()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(p,{mode:`light`}),(0,X.jsx)(p,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:at()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function en({chart:e}){let t=w(d.me.getMe,{host:vt}),n=E(d.charts.addChartDomain),i=E(d.charts.removeChartDomain),[a,o]=(0,K.useState)(``),[s,c]=(0,K.useState)(null),[l,u]=(0,K.useState)(!1);if(t?.role!==`admin`)return null;let f=e.domains??[];async function p(){let t=a.trim();if(t!==``){c(null),u(!0);try{await n({chartKey:e.key,domain:t}),o(``)}catch(e){c(e instanceof Error?e.message:String(e))}finally{u(!1)}}}async function m(t){c(null);try{await i({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:ze()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:f.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Pe()}):f.map(e=>(0,X.jsxs)(N,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":r({domain:e}),onClick:()=>void m(e),children:(0,X.jsx)(k,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(F,{value:a,onChange:e=>o(e.target.value),placeholder:qe(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&p()}}),(0,X.jsx)(A,{variant:`outline`,size:`sm`,disabled:l,onClick:()=>void p(),children:it()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:$e()}),s?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:s}):null]})]})}function tn(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function nn({chart:e}){let t=E(d.charts.updateChart),n=E(d.charts.deleteChart),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(e.name),[s,c]=(0,K.useState)(()=>tn(e.tokens)),[l,u]=(0,K.useState)(e.tokens.bpm??0),[f,p]=(0,K.useState)(null),[m,h]=(0,K.useState)(!1);function g(){o(e.name),c(tn(e.tokens)),u(e.tokens.bpm??0),p(null),i(!0)}async function _(){if(e.chartId===void 0)return;p(null);let n;try{n=JSON.parse(s)}catch{p(S());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;l>0?e.bpm=l:delete e.bpm}h(!0);try{await t({chartId:e.chartId,name:a.trim(),tokens:n}),i(!1)}catch(e){p(e instanceof Error?e.message:String(e))}finally{h(!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:r?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(A,{variant:`outline`,size:`sm`,onClick:g,children:lt()}),(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>void v(),children:ot()})]})})]}),r?(0,X.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:ve()}),(0,X.jsx)(F,{value:a,onChange:e=>o(e.target.value),maxLength:60})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:x()}),(0,X.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,X.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:l,onChange:e=>u(Number(e.target.value)),"aria-label":x()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:l===0?ie():`${l} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ee()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:be()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:s,onChange:e=>c(e.target.value),rows:10,spellCheck:!1})]}),f?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:f}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{size:`sm`,disabled:m,onClick:()=>void _(),children:ue()}),(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:Se()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function rn(){let e=w(d.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:fe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ct()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Oe()}):(0,X.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,X.jsx)(nn,{chart:e},e.key))})]})}function an({chart:e,groups:t}){let n=E(d.charts.addChartToGroupPool),r=E(d.charts.removeChartFromGroupPool),i=e.restrictedToGroups,a=e.poolGroups,o=new Set((a??[]).map(e=>e.groupId)),c=t.filter(e=>!o.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)(N,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?ut():e.kind===`custom`&&e.scope===`personal`?C():s()}),e.isGlobalDefault?(0,X.jsx)(N,{variant:`default`,children:de()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:v()}),(a??[]).map(e=>(0,X.jsxs)(N,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":le({group:e.name}),onClick:()=>void u(e.groupId),children:(0,X.jsx)(k,{className:`size-3`})})]},e.groupId)),c.length>0?(0,X.jsxs)(P,{value:``,onValueChange:e=>void l(e),children:[(0,X.jsx)(j,{size:`sm`,className:`w-56`,children:(0,X.jsx)(z,{placeholder:p()})}),(0,X.jsx)(B,{children:c.map(e=>(0,X.jsx)(M,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ae()}):null]})]})}function on({chart:e}){let t=E(d.charts.promoteChartToCommon),n=E(d.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)(N,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?pe():C()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:m({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(A,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:g()}):null,(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:he()})]})]})}function sn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=E(d.admin.setDefaultThemeMode),i=E(d.admin.setDefaultLocale),a=E(d.charts.setDefaultChart),s=w(d.charts.listChartsAdmin),c=w(d.groups.listGroups,{}),l=e??`system`,u=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:Ke()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:rt()})]}),(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:re()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:h()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void a({name:null}),children:b()}),ht.map(e=>(0,X.jsx)(A,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key)),(s??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(A,{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:_e()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:me()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(an,{chart:e,groups:c??[]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:_()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ge()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,X.jsx)(en,{chart:e})]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Xe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ne()})]}),(()=>{let e=(s??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:o()}):(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,X.jsx)(on,{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:ke()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:et()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(A,{variant:l===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:qt(e)},e))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Je()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ee()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:yt().map(e=>(0,X.jsx)(A,{variant:u===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:Re()})]})]})}function cn(){let e=w(d.me.getMe,{host:vt}),t=_t(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)(rn,{}),e?.role===`admin`?(0,X.jsx)(sn,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function ln(){let[e,t]=(0,K.useState)(!0),[n,r]=(0,K.useState)(`per-user`),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(Z),[c,l]=(0,K.useState)(Z),[u,d]=(0,K.useState)(Q),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(Q)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(cn,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:Qe()}),(0,X.jsxs)($,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{children:`Default`}),(0,X.jsx)(A,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(A,{variant:`outline`,children:`Outline`}),(0,X.jsx)(A,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(A,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(A,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{size:`sm`,children:`Small`}),(0,X.jsx)(A,{children:`Default`}),(0,X.jsx)(A,{size:`lg`,children:`Large`}),(0,X.jsx)(A,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(V,{})}),(0,X.jsx)(A,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)($,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(N,{children:`Default`}),(0,X.jsx)(N,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(N,{variant:`outline`,children:`Outline`}),(0,X.jsx)(N,{variant:`destructive`,children:`Destructive`})]})}),(0,X.jsx)($,{title:`Inputs & selection`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(F,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(P,{value:n,onValueChange:r,children:[(0,X.jsx)(j,{className:`w-56`,children:(0,X.jsx)(z,{placeholder:`Select…`})}),(0,X.jsxs)(B,{children:[(0,X.jsx)(M,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(M,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(I,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,X.jsx)($,{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)(At,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(P,{value:o,onValueChange:s,children:[(0,X.jsx)(j,{size:`sm`,children:(0,X.jsx)(z,{})}),(0,X.jsxs)(B,{children:[(0,X.jsx)(M,{value:Z,children:`Toutes directions`}),(0,X.jsx)(M,{value:`inbound`,children:`inbound`}),(0,X.jsx)(M,{value:`outbound`,children:`outbound`}),(0,X.jsx)(M,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(P,{value:c,onValueChange:l,children:[(0,X.jsx)(j,{size:`sm`,children:(0,X.jsx)(z,{})}),(0,X.jsxs)(B,{children:[(0,X.jsx)(M,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(M,{value:`info`,children:`info`}),(0,X.jsx)(M,{value:`warn`,children:`warn`}),(0,X.jsx)(M,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(jt,{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)(kt,{value:u,onChange:d})]})]})}),(0,X.jsx)($,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(dt,{children:[(0,X.jsx)(mt,{asChild:!0,children:(0,X.jsx)(A,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(V,{})})}),(0,X.jsxs)(pt,{align:`start`,children:[(0,X.jsx)(gt,{children:`Actions`}),(0,X.jsx)(L,{}),(0,X.jsx)(R,{children:`Edit`}),(0,X.jsx)(R,{children:`Duplicate`}),(0,X.jsx)(L,{}),(0,X.jsx)(R,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)($,{title:`Card`,children:(0,X.jsxs)(Tt,{className:`w-80`,children:[(0,X.jsxs)(bt,{children:[(0,X.jsx)(Ct,{children:`Instance`}),(0,X.jsx)(wt,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(St,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(xt,{className:`gap-2`,children:[(0,X.jsx)(A,{size:`sm`,children:`Save`}),(0,X.jsx)(A,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,X.jsx)($,{title:`Table`,children:(0,X.jsxs)(Ot,{children:[(0,X.jsx)(Et,{children:(0,X.jsxs)(U,{children:[(0,X.jsx)(H,{className:`w-8`,children:(0,X.jsx)(I,{"aria-label":`select all`})}),(0,X.jsx)(H,{children:`Name`}),(0,X.jsx)(H,{children:`Mode`}),(0,X.jsx)(H,{className:`text-right`,children:`Status`}),(0,X.jsx)(H,{className:`w-8`})]})}),(0,X.jsx)(Dt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(U,{children:[(0,X.jsx)(W,{children:(0,X.jsx)(I,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(W,{className:`font-medium`,children:e.n}),(0,X.jsx)(W,{children:(0,X.jsx)(N,{variant:`secondary`,children:e.m})}),(0,X.jsx)(W,{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)(W,{children:(0,X.jsx)(A,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(V,{})})})]},e.n))})]})}),(0,X.jsx)($,{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{ln as ThemeShowroom};