@lacneu/atrium 0.46.0 → 0.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/assets/AccessTab-DMtobe3Y.js +1 -0
  2. package/dist/assets/{AdvancedFilter-BwM0tgcf.js → AdvancedFilter-B6lCXnk_.js} +1 -1
  3. package/dist/assets/AgentFilesTab-DgC5PVEh.js +3 -0
  4. package/dist/assets/AnomaliesTab-D_NGV0y1.js +1 -0
  5. package/dist/assets/AuditTab-Rr5xuXKd.js +1 -0
  6. package/dist/assets/BridgeTab-Cg51jMGo.js +1 -0
  7. package/dist/assets/ChatDefaultsTab-3cQQbcJp.js +1 -0
  8. package/dist/assets/{DataTableShell-q5ZC3kNL.js → DataTableShell-Bzopt4OT.js} +1 -1
  9. package/dist/assets/{DetailChips-BI5FFFCD.js → DetailChips-PKnLEOOY.js} +1 -1
  10. package/dist/assets/FeedbacksTab-Bvdu_42J.js +1 -0
  11. package/dist/assets/{FieldLabel--ykPvwgz.js → FieldLabel-RnB1EBjO.js} +1 -1
  12. package/dist/assets/FilesTab-Dizy2z9U.js +1 -0
  13. package/dist/assets/{FilterBar-Bjp3W3-O.js → FilterBar-Dy10_IPZ.js} +1 -1
  14. package/dist/assets/GroupsTab-DfguxlfH.js +1 -0
  15. package/dist/assets/InstancesTab-CTlgjqaF.js +1 -0
  16. package/dist/assets/IntegrationsTab-DDj4VHj-.js +1 -0
  17. package/dist/assets/{KpiTab-D6fmcfqo.js → KpiTab-CxrZ8A9u.js} +1 -1
  18. package/dist/assets/PreferencesTab-4GLPWMHl.js +1 -0
  19. package/dist/assets/PromptInjectionsTab-dPl70NdT.js +4 -0
  20. package/dist/assets/RolesTab-CmIvQLbD.js +1 -0
  21. package/dist/assets/ServiceAccountsTab-kzUegapD.js +1 -0
  22. package/dist/assets/SubAgentReportsTab-DDkU2OZ0.js +1 -0
  23. package/dist/assets/ThemeShowroom-ClrciIxw.js +1 -0
  24. package/dist/assets/TimeRangePicker-CZSYqXhd.js +1 -0
  25. package/dist/assets/TracesTab-CYp5UZUL.js +1 -0
  26. package/dist/assets/UsersTab-CeGA0ymg.js +1 -0
  27. package/dist/assets/VoiceTab-DfO3ivrS.js +1 -0
  28. package/dist/assets/{button-BZ2ghM2f.js → button-D5AXX04a.js} +1 -1
  29. package/dist/assets/{card-CDvtHf5l.js → card-DYY__lMj.js} +1 -1
  30. package/dist/assets/chevrons-up-down-C-bHailH.js +1 -0
  31. package/dist/assets/{compatView-e2VbQwBf.js → compatView-DWV4JVj_.js} +1 -1
  32. package/dist/assets/dispatchErrorInfo-BtpDRwp-.js +1 -0
  33. package/dist/assets/dist-CGzSsL4i.js +44 -0
  34. package/dist/assets/{dist-C6Yu7C_m.js → dist-Cy-5Eo9H.js} +1 -1
  35. package/dist/assets/{dist-C6Q7qHg4.js → dist-DVwJLFHG.js} +1 -1
  36. package/dist/assets/{dist-Dp0-U7Ca.js → dist-fE9pwpr-.js} +1 -1
  37. package/dist/assets/{highlighted-body-OFNGDK62-BAwLXCoD.js → highlighted-body-OFNGDK62-BAuJrSyk.js} +1 -1
  38. package/dist/assets/index-B0Kloary.js +233 -0
  39. package/dist/assets/{index-BdrBbL7i.css → index-CaPvOhvq.css} +1 -1
  40. package/dist/assets/mermaid-GHXKKRXX-DqdnANNu.js +1 -0
  41. package/dist/assets/{pdf-CalEjQAS.js → pdf-Di4Z0VhC.js} +1 -1
  42. package/dist/assets/roleDescriptions-BXezQ4Y4.js +1 -0
  43. package/dist/assets/{table-IXupQ5w1.js → table-BDhz0ajJ.js} +1 -1
  44. package/dist/assets/{tabs-e0oOoEId.js → tabs-Cd17i-th.js} +1 -1
  45. package/dist/assets/x-CQuunpf5.js +1 -0
  46. package/dist/index.html +8 -8
  47. package/package.json +1 -1
  48. package/dist/assets/AccessTab-CnqowIoW.js +0 -1
  49. package/dist/assets/AgentFilesTab-DDg4ICzb.js +0 -3
  50. package/dist/assets/AnomaliesTab-CGcJ3wmF.js +0 -1
  51. package/dist/assets/AuditTab-zCOZM2TR.js +0 -1
  52. package/dist/assets/BridgeTab-CNu53hNw.js +0 -1
  53. package/dist/assets/ChatDefaultsTab-B46jHJ28.js +0 -1
  54. package/dist/assets/FeedbacksTab-CBcmw16u.js +0 -1
  55. package/dist/assets/FilesTab-D3HsZ9ry.js +0 -1
  56. package/dist/assets/GroupsTab-VfM-4Ecl.js +0 -1
  57. package/dist/assets/InstancesTab-F3IfZLE3.js +0 -1
  58. package/dist/assets/IntegrationsTab-DJxr_XK1.js +0 -1
  59. package/dist/assets/PreferencesTab-B41aNAtO.js +0 -1
  60. package/dist/assets/PromptInjectionsTab-C5r10hCQ.js +0 -4
  61. package/dist/assets/RolesTab-CYEWa_KN.js +0 -1
  62. package/dist/assets/ServiceAccountsTab-BszQMvl9.js +0 -1
  63. package/dist/assets/SubAgentReportsTab-thWzL8aO.js +0 -1
  64. package/dist/assets/ThemeShowroom-DpP1Qhwh.js +0 -1
  65. package/dist/assets/TimeRangePicker-DyTyIIGL.js +0 -1
  66. package/dist/assets/TracesTab-DeyNQxGK.js +0 -1
  67. package/dist/assets/UsersTab-BLqkvz9t.js +0 -1
  68. package/dist/assets/VoiceTab-Bd-wwhq_.js +0 -1
  69. package/dist/assets/chevrons-up-down-DVUxe1j7.js +0 -1
  70. package/dist/assets/dispatchErrorInfo-DDqhw8fE.js +0 -1
  71. package/dist/assets/dist-CQKky_Rh.js +0 -44
  72. package/dist/assets/index-BuqxeAUW.js +0 -233
  73. package/dist/assets/mermaid-GHXKKRXX-ruH5qf7k.js +0 -1
  74. package/dist/assets/roleDescriptions-Bkj7WtCA.js +0 -1
  75. package/dist/assets/x-Do-PZuRM.js +0 -1
@@ -0,0 +1 @@
1
+ import{Dy as e,Ey as t,Oy as n,Ty as r,ky as i}from"./dist-CGzSsL4i.js";var a={pending:i,user:n,admin:e,observer:t,agent:r};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-CQKky_Rh.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-CGzSsL4i.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-CQKky_Rh.js";import{t as d}from"./dist-C6Yu7C_m.js";import{Dt as f,Et as p,Ot as m}from"./index-BuqxeAUW.js";var h=t(e(),1),g=n(),_=`Tabs`,[v,y]=a(_,[m]),b=m(),[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)(f,{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)(p,{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};
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-CGzSsL4i.js";import{t as d}from"./dist-Cy-5Eo9H.js";import{Dt as f,Et as p,Ot as m}from"./index-B0Kloary.js";var h=t(e(),1),g=n(),_=`Tabs`,[v,y]=a(_,[m]),b=m(),[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)(f,{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)(p,{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-CGzSsL4i.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
@@ -53,15 +53,15 @@
53
53
  document.documentElement.dataset.motion = "static";
54
54
  })();
55
55
  </script>
56
- <script type="module" crossorigin src="/assets/index-BuqxeAUW.js"></script>
56
+ <script type="module" crossorigin src="/assets/index-B0Kloary.js"></script>
57
57
  <link rel="modulepreload" crossorigin href="/assets/bundle-mjs-C73ZY4La.js">
58
- <link rel="modulepreload" crossorigin href="/assets/dist-CQKky_Rh.js">
59
- <link rel="modulepreload" crossorigin href="/assets/dist-C6Yu7C_m.js">
60
- <link rel="modulepreload" crossorigin href="/assets/dist-C6Q7qHg4.js">
61
- <link rel="modulepreload" crossorigin href="/assets/dist-Dp0-U7Ca.js">
62
- <link rel="modulepreload" crossorigin href="/assets/x-Do-PZuRM.js">
63
- <link rel="modulepreload" crossorigin href="/assets/button-BZ2ghM2f.js">
64
- <link rel="stylesheet" crossorigin href="/assets/index-BdrBbL7i.css">
58
+ <link rel="modulepreload" crossorigin href="/assets/dist-CGzSsL4i.js">
59
+ <link rel="modulepreload" crossorigin href="/assets/dist-Cy-5Eo9H.js">
60
+ <link rel="modulepreload" crossorigin href="/assets/dist-DVwJLFHG.js">
61
+ <link rel="modulepreload" crossorigin href="/assets/dist-fE9pwpr-.js">
62
+ <link rel="modulepreload" crossorigin href="/assets/x-CQuunpf5.js">
63
+ <link rel="modulepreload" crossorigin href="/assets/button-D5AXX04a.js">
64
+ <link rel="stylesheet" crossorigin href="/assets/index-CaPvOhvq.css">
65
65
  </head>
66
66
  <body>
67
67
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lacneu/atrium",
3
- "version": "0.46.0",
3
+ "version": "0.48.0",
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{$u as r,E as i,Gj as a,Gu as o,Ij as s,Ju as c,Ku as l,Qu as u,Uu as d,Wu as f,Xu as p,Yu as m,Zu as h,ed as g,nd as _,qu as v,rd as y,td as b}from"./dist-CQKky_Rh.js";import{C as x,S,b as C,ct as w,w as T,x as E}from"./index-BuqxeAUW.js";var D=t(e(),1);function O(e){return e===`user`?v():e===`all`?l():o({group:e.group})}function k(e){return e===`common`?f():e===`owner`?d():o({group:e.group})}var A=n();function j(e){return e.name||e.email||e.userId.slice(0,8)}function M(){let e=a(i.admin.listUsers,{}),[t,n]=(0,D.useState)(``),o=a(i.introspect.introspectUser,t?{userId:t}:`skip`);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:y()}),(0,A.jsxs)(C,{value:t,onValueChange:n,children:[(0,A.jsx)(x,{size:`sm`,"aria-label":_(),children:(0,A.jsx)(T,{placeholder:_()})}),(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:b()}):o===void 0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:s()}):(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:g()}),(0,A.jsxs)(`div`,{className:`oc-introspect__id`,children:[(0,A.jsx)(`strong`,{children:o.user.label}),(0,A.jsx)(w,{variant:`secondary`,children:o.role})]})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:r()}),o.groups.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:m()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:o.groups.map(e=>(0,A.jsx)(w,{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:u()}),o.agents.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:m()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:o.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)(w,{variant:`default`,children:c()}):null,(0,A.jsx)(w,{variant:`outline`,children:O(e.via)}),(0,A.jsx)(w,{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:h()}),o.charts.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:m()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:o.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)(w,{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:p()}),o.permissions.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:m()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:o.permissions.map(e=>(0,A.jsx)(w,{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{Ac as r,Ar as i,Cc as a,Cr as o,Dc as s,Dr as c,E as l,Ec as u,Er as d,Fc as f,Fr as p,Gj as m,Hj as h,Ic as g,Ij as _,Ir as v,Lc as y,Lr as b,Mc as x,Mr as S,Nc as C,Nr as w,Oc as T,Or as E,Pc as D,Pr as O,Rc as ee,Rj as k,Rr as A,Sc as j,Sr as M,TE as N,Tc as P,Tr as F,Wj as I,_c as L,bc as R,br as z,cr as te,dc as ne,dr as re,fc as ie,fr as ae,gc as B,hc as V,jc as oe,jr as H,kc as se,kr as U,lc as ce,lr as le,mc as W,or as G,pc as ue,sr as de,uc as fe,ur as pe,vc as me,wc as he,wr as ge,xc as _e,xl as K,xr as ve,yc as ye,yl as be,yr as xe,zr as Se}from"./dist-CQKky_Rh.js";import{t as q}from"./button-BZ2ghM2f.js";import{At as J,C as Ce,G as we,H as Te,J as Ee,K as De,Q as Oe,S as ke,X as Ae,Y as je,Z as Me,b as Ne,ct as Pe,dt as Fe,ft as Ie,ht as Le,mt as Re,q as ze,ut as Be,w as Ve,x as He,xt as Ue,y as We}from"./index-BuqxeAUW.js";import{n as Ge,t as Ke}from"./curation-CQksaIbm.js";import{i as qe}from"./compatView-e2VbQwBf.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=m(l.me.getMe,{host:Ue}),t=e?.role===`admin`,n=(e?.permissions??[]).includes(`bridge.read`),i=m(l.admin.listInstances,e!==void 0&&t?{}:`skip`),[a,o]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{!t||!i||i.length===0||(!a||!i.some(e=>e.name===a))&&o(i[0].name)},[t,i,a]);let c=m(l.agents.listAgentsForInstance,t&&a?{instanceName:a}:`skip`),d=m(l.agents.listMyAgents,e!==void 0&&!t?{}:`skip`),b=(0,Y.useMemo)(()=>{if(e!==void 0){if(t)return a===null||c===void 0?i!==void 0&&i.length===0?[]:void 0:c.agents.map(e=>({instanceName:a,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}));if(d!==void 0)return d.map(e=>({instanceName:e.instanceName,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}))}},[e,t,a,c,i,d]),[S,w]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{!b||b.length===0||(!S||!b.some(e=>$(e)===S))&&w($(b[0]))},[b,S]);let E=b?.find(e=>$(e)===S)??null,A=h(l.agentFiles.listAgentFiles),[j,M]=(0,Y.useState)({status:`idle`}),N=E?.instanceName??null,P=E?.agentId??null,F=m(l.compat.forInstance,n&&N!==null?{instanceName:N}:`skip`),I=n&&N!==null?We(F,`agentFiles`):null,L=I===null?!1:I===`loading`?null:I.blocked,R=(0,Y.useCallback)(async()=>{if(!(N===null||P===null)){M({status:`loading`});try{M({status:`done`,files:(await A({instanceName:N,agentId:P})).files})}catch{M({status:`error`})}}},[A,N,P]);(0,Y.useEffect)(()=>{L===!1&&R()},[R,L]);let[z,te]=(0,Y.useState)(null),ne=m(l.agentFileCuration.listCurations,t&&N!==null&&P!==null?{instanceName:N,agentId:P}:`skip`),re=m(l.agentFileCuration.curationSettings,t&&N!==null?{instanceName:N}:`skip`),ie=h(l.agentFileCuration.requestCuration),[ae,B]=(0,Y.useState)(null),[V,H]=(0,Y.useState)(null),{toast:U}=Te(),ce=(0,Y.useMemo)(()=>{let e=new Map;for(let t of ne??[])e.has(t.name)||e.set(t.name,t);return e},[ne]),le=(0,Y.useCallback)(async e=>{if(!(N===null||P===null)){B(e);try{let t=await ie({instanceName:N,agentId:P,name:e,trigger:`manual`});t.ok?U({title:v(),variant:`success`}):U({title:p({reason:t.reason??`unknown`}),variant:`error`})}catch{U({title:O(),variant:`error`})}finally{B(null)}}},[ie,N,P,U]),W=k(),G=(0,Y.useMemo)(()=>new Intl.NumberFormat(W,{maximumFractionDigits:0}),[W]);return e===void 0||b===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:_()}):(0,Q.jsxs)(`div`,{className:`oc-afiles`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ee()}),(0,Q.jsxs)(`div`,{className:`oc-afiles__picker`,children:[t&&(i?.length??0)>1?(0,Q.jsxs)(Ne,{value:a??``,onValueChange:e=>o(e),children:[(0,Q.jsx)(Ce,{size:`sm`,"aria-label":y(),children:(0,Q.jsx)(Ve,{})}),(0,Q.jsx)(He,{children:(i??[]).map(e=>(0,Q.jsx)(ke,{value:e.name,children:e.name},e.name))})]}):null,b.length>0?(0,Q.jsxs)(Ne,{value:S??``,onValueChange:e=>w(e),children:[(0,Q.jsx)(Ce,{size:`sm`,"aria-label":g(),children:(0,Q.jsx)(Ve,{})}),(0,Q.jsx)(He,{children:b.map(e=>(0,Q.jsx)(ke,{value:$(e),children:e.label},$(e)))})]}):(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:f()})]}),E===null?null:I===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:_()}):I!==null&&I.blocked?(0,Q.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,Q.jsx)(J,{size:14,"aria-hidden":!0}),` `,qe(I.gatewayVersion,I.provider)]}):j.status===`loading`||j.status===`idle`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:_()}):j.status===`error`?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[C(),` `,(0,Q.jsx)(q,{variant:`outline`,size:`sm`,onClick:()=>void R(),children:be()})]}):j.files.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:D()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`oc-afiles__list`,children:j.files.map(e=>{let n=Ye(e.size),i=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)(Pe,{variant:`outline`,children:x()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`oc-afiles__size`,children:oe({size:Z(e.size,W)})}),(0,Q.jsx)(`span`,{className:`oc-afiles__gauge${i?` 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:r({pct:G.format(n)})}),i?(0,Q.jsx)(J,{size:14,className:`oc-afiles__warn`,"aria-label":se()}):(0,Q.jsx)(`span`,{className:`oc-afiles__warn-slot`,"aria-hidden":!0})]}),(0,Q.jsx)(q,{variant:`outline`,size:`sm`,className:`oc-afiles__open`,onClick:()=>te(e),children:t?s():u()}),t&&!e.missing?(0,Q.jsx)(nt,{curatable:Ke.includes(e.name),size:e.size??0,budget:re?.budgetChars??null,enabled:re?.enabled??!1,curation:ce.get(e.name)??null,inFlight:ae===e.name,onCurate:()=>void le(e.name),onReview:e=>H(e)}):null]},e.name)})}),(0,Q.jsx)(`p`,{className:`oc-afiles__budget`,children:T({used:Z(Ze(j.files),W),total:Z(Je,W),pct:G.format(Xe(Ze(j.files)))})})]}),z&&E?(0,Q.jsx)(rt,{instanceName:E.instanceName,agentId:E.agentId,name:z.name,isAdmin:t,onClose:()=>te(null),onSaved:()=>void R()}):null,V?(0,Q.jsx)(it,{curationId:V,onClose:()=>H(null),onApplied:()=>{H(null),R()}}):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)(q,{variant:`default`,size:`sm`,className:`oc-afiles__curate`,onClick:()=>s(i._id),children:A()}):a||i?.status===`dispatched`||i?.status===`applying`?(0,Q.jsx)(Pe,{variant:`outline`,className:`oc-afiles__curate-status`,children:b()}):e&&r&&n!==null&&Ge(t,n)?(0,Q.jsx)(q,{variant:`outline`,size:`sm`,className:`oc-afiles__curate`,onClick:o,children:Se()}):null}function rt({instanceName:e,agentId:t,name:n,isAdmin:r,onClose:i,onSaved:o}){let s=h(l.agentFiles.getAgentFile),c=h(l.agentFiles.setAgentFile),u=Te(),[d,f]=(0,Y.useState)(null),[p,m]=(0,Y.useState)(!1),[g,v]=(0,Y.useState)(``),[y,b]=(0,Y.useState)(!1),[x,S]=(0,Y.useState)(!1),[C,w]=(0,Y.useState)(!1),[T,E]=(0,Y.useState)(!1),D=(0,Y.useCallback)(async r=>{m(!1);try{let i=await s({instanceName:e,agentId:t,name:n});f({content:i.content,updatedAtMs:i.updatedAtMs}),r||v(i.content),w(!1)}catch{m(!0)}},[s,e,t,n]);(0,Y.useEffect)(()=>{D(!1)},[D]);async function O(){if(d!==null){S(!0),E(!1);try{await c({instanceName:e,agentId:t,name:n,content:g,baseUpdatedAtMs:d.updatedAtMs??void 0}),u.success(ye({name:n})),o(),await D(!1)}catch(e){et(e)?w(!0):E(!0)}finally{S(!1)}}}let ee=d!==null&&g!==d.content,A=(0,Y.useMemo)(()=>d===null?null:$e(d.content,g),[d,g]),M=g.length>X,F=k(),I=(0,Y.useMemo)(()=>new Intl.NumberFormat(F),[F]);return(0,Q.jsx)(Be,{open:!0,onOpenChange:e=>!e&&i(),children:(0,Q.jsxs)(Fe,{className:`oc-afiles__editor`,children:[(0,Q.jsxs)(Re,{children:[(0,Q.jsx)(Le,{children:P({name:n})}),(0,Q.jsxs)(Ie,{children:[he({agent:t,instance:e}),r?null:(0,Q.jsxs)(Q.Fragment,{children:[` · `,a()]})]})]}),p?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[L(),` `,(0,Q.jsx)(q,{variant:`outline`,size:`sm`,onClick:()=>void D(!1),children:be()})]}):d===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:_()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`textarea`,{className:`oc-afiles__source`,value:g,readOnly:!r,spellCheck:!1,onChange:e=>v(e.target.value),"aria-label":P({name:n})}),(0,Q.jsx)(`p`,{className:`oc-afiles__hint`,children:j()}),C?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[B(),` `,(0,Q.jsx)(q,{variant:`outline`,size:`sm`,onClick:()=>void D(!0),children:V()})]}):null,T?(0,Q.jsx)(`p`,{className:`oc-afiles__error`,role:`alert`,children:me()}):null,(0,Q.jsxs)(`div`,{className:`oc-afiles__editor-foot`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__count${M?` is-over`:``}`,children:_e({count:I.format(g.length),max:I.format(X)})}),r?(0,Q.jsx)(q,{size:`sm`,disabled:!ee||x||C,onClick:()=>b(!0),children:x?K():R()}):null]})]}),(0,Q.jsx)(we,{open:y,onOpenChange:b,children:(0,Q.jsxs)(Ee,{children:[(0,Q.jsxs)(Me,{children:[(0,Q.jsx)(Oe,{children:W({name:n})}),(0,Q.jsx)(je,{children:ue({agent:t})})]}),A?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__diff-counts`,children:ie({added:A.added,removed:A.removed})}),A.sampleAdded.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:ne()}),A.sampleAdded.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-add`,children:e||` `},t))]}):null,A.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:fe()}),A.sampleRemoved.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-del`,children:e||` `},t))]}):null]}):null,(0,Q.jsxs)(Ae,{children:[(0,Q.jsx)(ze,{children:N()}),(0,Q.jsx)(De,{onClick:()=>void O(),children:ce()})]})]})})]})})}function it({curationId:e,onClose:t,onApplied:n}){let r=m(l.agentFileCuration.getProposal,{curationId:e}),a=h(l.agentFileCuration.approveCuration),s=I(l.agentFileCuration.rejectCuration),{toast:u}=Te(),[f,p]=(0,Y.useState)(null),[g,v]=(0,Y.useState)(!1),[y,b]=(0,Y.useState)(``),x=k(),C=(0,Y.useMemo)(()=>r?$e(r.beforeContent,r.proposedContent):null,[r]);async function T(){p(`approve`);try{let t=await a({curationId:e});t.ok?(u({title:w(),variant:`success`}),n()):u({title:t.reason===`conflict`?H():i({reason:t.reason??`unknown`}),variant:`error`})}catch{u({title:O(),variant:`error`})}finally{p(null)}}async function D(n){p(`reject`);try{let r=y.trim();(await s({curationId:e,...r?{comment:r}:{},relaunch:n})).ok?u({title:n?de():S(),variant:`success`}):u({title:c(),variant:`error`}),t()}catch{u({title:O(),variant:`error`})}finally{p(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)(Re,{children:[(0,Q.jsx)(Le,{children:r?U({name:r.name}):_()}),(0,Q.jsx)(Ie,{children:E()})]}),r===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:_()}):r===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:c()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`p`,{className:`oc-afiles__review-sizes`,children:[d({before:Z(r.beforeSize,x),after:Z(r.proposedSize,x)}),r.overBudget?(0,Q.jsxs)(Q.Fragment,{children:[` `,(0,Q.jsx)(J,{size:13,"aria-hidden":!0}),` `,F()]}):null]}),C?(0,Q.jsx)(`p`,{className:`oc-afiles__review-diff`,children:ge({added:C.added,removed:C.removed})}):null,r.feedback?(0,Q.jsx)(`p`,{className:`oc-afiles__review-feedback`,children:G({feedback:r.feedback})}):null,C&&C.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__review-removed`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:xe()}),(0,Q.jsx)(`ul`,{children:C.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:z()}),(0,Q.jsx)(`pre`,{className:`oc-afiles__review-pre`,children:r.beforeContent})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:o()}),(0,Q.jsx)(`pre`,{className:`oc-afiles__review-pre`,children:r.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:ae()}),(0,Q.jsx)(`textarea`,{id:`curation-reject-comment`,className:`oc-afiles__reject-textarea`,rows:3,placeholder:re(),value:y,onChange:e=>b(e.target.value)}),(0,Q.jsxs)(`div`,{className:`oc-afiles__review-actions`,children:[(0,Q.jsx)(q,{variant:`ghost`,onClick:()=>v(!1),disabled:f!==null,children:pe()}),(0,Q.jsx)(q,{variant:`outline`,onClick:()=>void D(!1),disabled:f!==null,children:f===`reject`?K():le()}),(0,Q.jsx)(q,{variant:`default`,onClick:()=>void D(!0),disabled:f!==null,children:f===`reject`?K():te()})]})]}):(0,Q.jsxs)(`div`,{className:`oc-afiles__review-actions`,children:[(0,Q.jsx)(q,{variant:`outline`,onClick:()=>v(!0),disabled:f!==null||r==null,children:M()}),(0,Q.jsx)(q,{variant:`default`,onClick:()=>void T(),disabled:f!==null||r==null,children:f===`approve`?K():ve()})]})]})})}export{tt as AgentFilesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$v as r,Av as i,Bv as ee,Dv as a,E as o,Ev as s,Fv as te,Gj as c,Gv as ne,Hv as re,Iv as ie,Jv as l,Kv as u,Lv as d,Mv as f,Nv as p,Ov as m,Pv as ae,Qv as oe,Rv as se,Tv as h,Uv as g,Vv as _,Wj as ce,Wv as le,Xv as ue,Yv as de,Zv as fe,ay as pe,cy as me,dy as v,ey as he,fy as y,iy as ge,jv as b,kv as x,ly as S,ny as C,oy as w,qv as T,ry as E,sy as D,ty as O,uy as k,wv as A,zv as j}from"./dist-CQKky_Rh.js";import{C as M,H as N,S as P,U as F,Xt as I,Yt as L,a as _e,b as R,ct as z,j as ve,r as ye,w as B,x as V,xt as be}from"./index-BuqxeAUW.js";import{n as xe}from"./TimeRangePicker-DyTyIIGL.js";import{t as Se}from"./FilterBar-Bjp3W3-O.js";import{t as Ce}from"./DataTableShell-q5ZC3kNL.js";import{t as H}from"./dispatchErrorInfo-DDqhw8fE.js";var U=t(e(),1),W=n(),G=`__all__`,we=[{value:`open`},{value:`acknowledged`},{value:`resolved`}];function Te(e){return e===`open`?y():e===`acknowledged`?v():k()}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=L({from:`/settings/anomalies`}),n=e.q??``,a=e.status===K?G:e.status,s=e.severity??G,h=e.kind??G,[v,y]=(0,U.useState)(G),k=ye(e.from,e.to),{from:A,to:H}=xe(k),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=F(),X=N(),Z=ce(o.anomalies.resolveAnomaly),Le=(c(o.me.getMe,{host:be})?.permissions??[]).includes(`admin.manage`),Q=c(o.anomalies.listAnomalies,{limit:ke,filter:{q:n||void 0,from:A,to:H,anomalyStatus:a===G?void 0:a,severity:s===G?void 0:s,source:v===G?void 0:v,kind:h===G?void 0:h}}),$=(0,U.useMemo)(()=>{let e=new Set;for(let t of Q??[])e.add(t.kind);return[...e].sort()},[Q]),Re=n!==``||a!==`open`||s!==G||v!==G||h!==G||k.kind!==`relative`||k.from!==Oe.from;function ze(){y(G),t({search:{status:`open`},replace:!0})}async function Be(e){if(await Ie({title:S(),description:(0,W.jsxs)(W.Fragment,{children:[me(),` `,(0,W.jsx)(`span`,{className:`font-mono`,children:e.kind}),` `,D(),` `,(0,W.jsx)(`strong`,{children:w()}),`.`,` `,pe()]}),confirmLabel:ge()}))try{await Z({anomalyId:e._id,status:`resolved`}),X.success(E(),e.kind)}catch(e){X.error(C(),e)}}async function Ve(e){try{await Z({anomalyId:e._id,status:`acknowledged`}),X.success(O(),e.kind)}catch(e){X.error(he(),e)}}return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`p`,{className:`oc-admin__hint`,children:[r(),` `,(0,W.jsx)(`strong`,{children:oe()}),` `,fe(),` `,(0,W.jsx)(`strong`,{children:ue()}),` `,de(),` `,(0,W.jsx)(`strong`,{children:l()}),` `,T(),` `,(0,W.jsx)(`span`,{className:`oc-filter__window`,children:u()})]}),(0,W.jsxs)(Se,{q:n,onQChange:q,searchPlaceholder:ne(),timeRange:k,onTimeRangeChange:Fe,onReset:ze,canReset:Re,children:[(0,W.jsxs)(R,{value:a,onValueChange:J,children:[(0,W.jsx)(M,{size:`sm`,className:`w-36`,children:(0,W.jsx)(B,{})}),(0,W.jsxs)(V,{children:[(0,W.jsx)(P,{value:G,children:le()}),we.map(e=>(0,W.jsx)(P,{value:e.value,children:Te(e.value)},e.value))]})]}),(0,W.jsxs)(R,{value:s,onValueChange:Y,children:[(0,W.jsx)(M,{size:`sm`,className:`w-36`,children:(0,W.jsx)(B,{placeholder:g()})}),(0,W.jsxs)(V,{children:[(0,W.jsx)(P,{value:G,children:re()}),Ee.map(e=>(0,W.jsx)(P,{value:e,children:e},e))]})]}),(0,W.jsxs)(R,{value:v,onValueChange:y,children:[(0,W.jsx)(M,{size:`sm`,className:`w-32`,children:(0,W.jsx)(B,{placeholder:_()})}),(0,W.jsxs)(V,{children:[(0,W.jsx)(P,{value:G,children:ee()}),De.map(e=>(0,W.jsx)(P,{value:e,children:e},e))]})]}),(0,W.jsxs)(R,{value:h,onValueChange:Pe,children:[(0,W.jsx)(M,{size:`sm`,className:`w-36`,children:(0,W.jsx)(B,{placeholder:j()})}),(0,W.jsxs)(V,{children:[(0,W.jsx)(P,{value:G,children:se()}),$.map(e=>(0,W.jsx)(P,{value:e,children:e},e))]})]})]}),(0,W.jsx)(Ce,{title:d(),rows:Q,emptyHint:a===`open`?ie():te(),rowActions:e=>Le&&e.status===`open`?[{label:ae(),onSelect:()=>void Be(e)},{label:p(),onSelect:()=>void Ve(e)}]:[],columns:[{header:f(),cell:e=>(0,W.jsx)(`span`,{className:`oc-traces__time`,children:ve(e.at)}),sort:e=>e.at},{header:j(),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:b(),cell:e=>(0,W.jsx)(Me,{status:e.status}),sort:e=>e.status===`resolved`?2:+(e.status===`acknowledged`)},{header:_(),cell:e=>(0,W.jsx)(z,{variant:`outline`,children:e.source}),sort:e=>e.source},{header:i(),cell:e=>(0,W.jsx)(`span`,{className:`oc-anomaly__msg`,children:e.message}),sort:e=>e.message},{header:x(),cell:e=>(0,W.jsx)(Ae,{row:e}),sort:e=>e.evidence??null},{header:m(),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=L();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:[`↗ `,a()]}):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:[`↗ `,a()]}):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)(z,{variant:`destructive`,children:s()}):e===`acknowledged`?(0,W.jsx)(z,{variant:`secondary`,children:h()}):(0,W.jsx)(z,{variant:`outline`,children:A()})}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{E as r,Gj as i,Sn as a,_b as o,_n as s,ab as c,bn as l,cb as u,db as d,fb as f,gb as p,hb as m,ib as h,lb as g,mb as _,ob as v,pb as y,rb as b,sb as x,ub as S,vn as C,xn as w,yn as T}from"./dist-CQKky_Rh.js";import{C as E,S as D,Xt as O,Yt as k,a as A,b as j,i as M,j as N,o as P,r as F,t as I,w as L,x as R}from"./index-BuqxeAUW.js";import{n as ee}from"./TimeRangePicker-DyTyIIGL.js";import{t as z}from"./FilterBar-Bjp3W3-O.js";import{t as B}from"./AdvancedFilter-BwM0tgcf.js";import{t as V}from"./DataTableShell-q5ZC3kNL.js";var H=t(e(),1),U=n(),W={kind:`relative`,from:I,to:`now`},G=`__all__`,K=[{value:`action`,label:a()},{value:`realLabel`,label:w()},{value:`targetLabel`,label:l()},{value:`impersonated`,label:T()},{value:`resource`,label:C()},{value:`resourceId`,label:s()}];function q(){let e=O({from:`/settings/audit`}),t=k({from:`/settings/audit`}),n=e.q??``,a=e.action??G,s=e.impersonated??G,l=e.resource??G,C=F(e.from,e.to),w=(0,H.useMemo)(()=>P(e.adv),[e.adv]),{from:T,to:I}=ee(C),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,...A(e)})}),Q=e=>void t({search:t=>({...t,adv:M(e)}),replace:!0}),$=i(r.admin.listAudit,{filter:{q:n||void 0,from:T,to:I,action:a===G?void 0:a,resource:l===G?void 0:l,impersonated:s===G?void 0:s===`yes`,advanced:w.length>0?w: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!==``||a!==G||s!==G||l!==G||w.length>0||C.kind!==`relative`||C.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:[o(),` `,(0,U.jsx)(`span`,{className:`oc-filter__window`,children:p()})]}),(0,U.jsxs)(z,{q:n,onQChange:q,searchPlaceholder:m(),timeRange:C,onTimeRangeChange:Z,onReset:ie,canReset:re,children:[(0,U.jsxs)(j,{value:a,onValueChange:J,children:[(0,U.jsx)(E,{size:`sm`,className:`w-40`,children:(0,U.jsx)(L,{placeholder:_()})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(D,{value:G,children:y()}),te.map(e=>(0,U.jsx)(D,{value:e,children:e},e))]})]}),(0,U.jsxs)(j,{value:s,onValueChange:Y,children:[(0,U.jsx)(E,{size:`sm`,className:`w-40`,children:(0,U.jsx)(L,{})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(D,{value:G,children:f()}),(0,U.jsx)(D,{value:`yes`,children:d()}),(0,U.jsx)(D,{value:`no`,children:S()})]})]}),(0,U.jsxs)(j,{value:l,onValueChange:X,children:[(0,U.jsx)(E,{size:`sm`,className:`w-40`,children:(0,U.jsx)(L,{placeholder:g()})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(D,{value:G,children:u()}),ne.map(e=>(0,U.jsx)(D,{value:e,children:e},e))]})]})]}),(0,U.jsx)(B,{fields:K,seed:w,onChange:Q}),(0,U.jsx)(V,{title:x(),rows:$,emptyHint:v(),columns:[{header:c(),cell:e=>N(e.at),sort:e=>e.at},{header:_(),cell:e=>e.action,sort:e=>e.action},{header:h(),cell:e=>e.realLabel,sort:e=>e.realLabel},{header:b(),cell:e=>e.targetLabel??`—`,sort:e=>e.targetLabel??null},{header:g(),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{$m as r,Ah as i,Bh as a,Bs as o,Bt as s,Ch as c,D as l,Dh as u,E as d,Eh as f,Fh as p,Gj as m,Gs as h,Hh as ee,Hj as te,Hs as g,Ht as _,Ih as ne,Is as v,Jm as y,Js as b,Ks as x,Kt as S,Lh as re,Mh as ie,Nh as ae,Oh as oe,Ph as se,Qm as ce,Qs as le,Rh as ue,Sg as de,Sh as fe,Tg as pe,Th as me,Uh as he,Us as ge,Ut as _e,Vh as ve,Vs as ye,Vt as be,Wj as xe,Ws as Se,Xm as C,Xs as Ce,Ym as w,Ys as we,Zm as Te,Zs as Ee,_g as De,_h as Oe,ah as ke,bg as Ae,bh as je,ch as T,dg as Me,dh as Ne,eh as Pe,fg as Fe,fh as Ie,gg as Le,gh as Re,hg as ze,hh as Be,ih as Ve,jh as He,kh as Ue,lh as We,mh as Ge,nh as Ke,oh as qe,ph as Je,qs as Ye,rh as Xe,sh as Ze,th as Qe,uh as $e,vg as et,vh as tt,wg as nt,wh as rt,xg as it,xh as at,yg as ot,yh as st,zh as ct,zt as lt}from"./dist-CQKky_Rh.js";import{i as E,r as ut}from"./dist-C6Yu7C_m.js";import{t as dt}from"./chevrons-up-down-DVUxe1j7.js";import{i as ft,n as D,o as pt,r as mt,s as ht}from"./FieldLabel--ykPvwgz.js";import{i as gt,n as _t,r as vt,t as yt}from"./tabs-e0oOoEId.js";import{t as bt}from"./button-BZ2ghM2f.js";import{$ as xt,At as O,C as k,H as St,Kt as A,M as j,Nt as Ct,S as M,Xt as wt,Yt as Tt,b as N,ct as P,dt as Et,et as Dt,ft as Ot,ht as kt,j as F,lt as I,m as At,mt as jt,p as Mt,qt as L,tt as Nt,ut as Pt,w as R,x as z,xt as Ft,zt as It}from"./index-BuqxeAUW.js";import{r as Lt}from"./locales-CPjguROj.js";import{a as B,i as V,n as H,o as U,r as W,t as Rt}from"./table-IXupQ5w1.js";import{t as zt}from"./FilterBar-Bjp3W3-O.js";import{a as Bt,n as Vt,o as Ht,r as Ut,s as Wt,t as Gt}from"./compatView-e2VbQwBf.js";import{t as G}from"./dispatchErrorInfo-DDqhw8fE.js";var Kt=l(`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`}]]),qt=l(`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`}]]),K=t(e(),1);function Jt(e){return e.filter(e=>e.state===`error`)}function Yt(e){return e.reachable&&Jt(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 Ht(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)=>Ht(e,t)??Z(e,t))}var Q=n();function un({connections:e,displayByInstance:t}){let[n,i]=(0,K.useState)(en),[a,o]=(0,K.useState)(null),s=(0,K.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+(e.downstreamRejectCount??0),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]),c=(0,K.useMemo)(()=>sn(s),[s]),l=(0,K.useMemo)(()=>cn(s),[s]),u=(0,K.useMemo)(()=>ln(s),[s]),d=(0,K.useMemo)(()=>on(nn(s,n),a),[s,n,a]);function f(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:Ie()}):(0,Q.jsxs)(`div`,{className:`oc-conn`,children:[(0,Q.jsxs)(zt,{q:n.q,onQChange:e=>i(t=>({...t,q:e})),searchPlaceholder:We(),onReset:()=>i(en),canReset:tn(n),children:[(0,Q.jsxs)(N,{value:n.state,onValueChange:e=>i(t=>({...t,state:e})),children:[(0,Q.jsx)(k,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(R,{placeholder:Ze()})}),(0,Q.jsxs)(z,{children:[(0,Q.jsx)(M,{value:Y,children:T()}),c.map(e=>(0,Q.jsx)(M,{value:e,children:fn(e)},e))]})]}),(0,Q.jsxs)(N,{value:n.instance,onValueChange:e=>i(t=>({...t,instance:e})),children:[(0,Q.jsx)(k,{size:`sm`,className:`w-40`,children:(0,Q.jsx)(R,{placeholder:qe()})}),(0,Q.jsxs)(z,{children:[(0,Q.jsx)(M,{value:Y,children:T()}),l.map(e=>(0,Q.jsx)(M,{value:e.name,children:e.label},e.name))]})]}),(0,Q.jsxs)(N,{value:n.version,onValueChange:e=>i(t=>({...t,version:e})),children:[(0,Q.jsx)(k,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(R,{placeholder:ke()})}),(0,Q.jsxs)(z,{children:[(0,Q.jsx)(M,{value:Y,children:T()}),u.map(e=>(0,Q.jsx)(M,{value:e,children:e},e))]})]})]}),d.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Ve()}):(0,Q.jsxs)(Rt,{className:`oc-conn__table`,children:[(0,Q.jsx)(B,{children:(0,Q.jsxs)(U,{children:[(0,Q.jsx)($,{label:Xe(),sortKey:`target`,sort:a,onSort:f}),(0,Q.jsx)($,{label:Ke(),sortKey:`state`,sort:a,onSort:f}),(0,Q.jsx)($,{label:Qe(),sortKey:`instance`,sort:a,onSort:f}),(0,Q.jsx)($,{label:Pe(),sortKey:`host`,sort:a,onSort:f}),(0,Q.jsx)($,{label:r(),sortKey:`version`,sort:a,onSort:f}),(0,Q.jsx)(V,{children:ce()}),(0,Q.jsx)($,{label:Te(),sortKey:`lastOk`,sort:a,onSort:f})]})}),(0,Q.jsx)(H,{children:d.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)(V,{"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)(ut,{size:13,"aria-hidden":!0}):(0,Q.jsx)(E,{size:13,"aria-hidden":!0}):(0,Q.jsx)(dt,{size:13,"aria-hidden":!0,className:`oc-conn__sort-idle`})]})})}function dn({r:e}){let t=Xt(e)?G(e.lastErrorCode):null,n=Zt(e)?G(e.lastDownstreamRejectCode):null;return(0,Q.jsxs)(K.Fragment,{children:[(0,Q.jsxs)(U,{className:`oc-conn__row oc-conn__row--${e.state}`,children:[(0,Q.jsx)(W,{children:(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.targetLabel})}),(0,Q.jsx)(W,{children:(0,Q.jsx)(pn,{state:e.state})}),(0,Q.jsx)(W,{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)(W,{children:(0,Q.jsx)(`span`,{className:`oc-bridge-target__host`,children:e.gatewayHost})}),(0,Q.jsx)(W,{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)(W,{children:(0,Q.jsx)(`span`,{className:`oc-conn__stats`,children:Ne({ok:e.okCount,errors:e.errorCount,attempts:e.attempts})})}),(0,Q.jsx)(W,{children:e.lastOkAt?(0,Q.jsx)(`span`,{className:`oc-traces__mono`,children:j(e.lastOkAt)}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})})]}),t||n?(0,Q.jsx)(U,{className:`oc-conn__detail-row`,children:(0,Q.jsxs)(W,{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?` · ${j(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:[$e({label:n.label}),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastDownstreamRejectCode}),e.lastDownstreamRejectAt?` · ${j(e.lastDownstreamRejectAt)}`:``]}):null]})}):null]})}function fn(e){return e===`connected`?C():e===`error`?w():y()}function pn({state:e}){return e===`connected`?(0,Q.jsx)(P,{variant:`secondary`,children:C()}):e===`error`?(0,Q.jsx)(P,{variant:`destructive`,children:w()}):(0,Q.jsx)(P,{variant:`outline`,children:y()})}function mn(){return m(d.bridgeHealth.getBridgeHealth,{})}function hn(){let e=mn(),t=m(d.compat.getBridgeCompat,{}),n=m(d.me.getMe,{host:Ft})?.role===`admin`,r=m(d.admin.listInstances,n?{}:`skip`),i=m(d.agents.usageForInstances,n?{}:`skip`),a=Tt(),o=()=>void a({to:`/settings/anomalies`,search:{status:`open`}}),c=$t(e?e.targets:[],t?t.targets:[],r??[]),{section:l}=wt({from:`/settings/bridge`}),u=Tt({from:`/settings/bridge`}),f=t?.compat??null,p=t===void 0?`loading`:t===null?`nodata`:`ready`,h=f!==null&&Vt(f,`hermes`)&&!c.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:Ue()}),i&&i.length>0?(0,Q.jsxs)(`section`,{className:`oc-bridge__usage`,children:[(0,Q.jsx)(`h3`,{className:`oc-bridge__usage-title`,children:oe()}),(0,Q.jsxs)(Rt,{children:[(0,Q.jsx)(B,{children:(0,Q.jsxs)(U,{children:[(0,Q.jsx)(V,{children:_e()}),(0,Q.jsx)(V,{children:_()}),(0,Q.jsx)(V,{children:be()}),(0,Q.jsx)(V,{children:s()}),(0,Q.jsx)(V,{children:lt()})]})}),(0,Q.jsx)(H,{children:i.flatMap(e=>{let t=At(e.usage,Date.now());return t?t.windows.map((t,n)=>(0,Q.jsxs)(U,{children:[(0,Q.jsx)(W,{className:`font-medium`,children:n===0?e.instanceName:``}),(0,Q.jsx)(W,{children:t.provider}),(0,Q.jsx)(W,{children:t.label}),(0,Q.jsx)(W,{children:(0,Q.jsxs)(P,{variant:t.percentLeft<=10?`destructive`:t.percentLeft<=25?`outline`:`secondary`,children:[t.percentLeft,`%`]})}),(0,Q.jsx)(W,{className:`text-muted-foreground`,children:t.resetText??`—`})]},`${e.instanceName}:${t.provider}:${t.label}`)):[]})})]})]}):null,c.length>0?(0,Q.jsxs)(yt,{value:c.some(e=>e.key===l)?l:c[0]?.key??`openclaw`,onValueChange:e=>void u({search:{section:e},replace:!0}),children:[(0,Q.jsx)(vt,{className:`w-full`,children:c.map(e=>(0,Q.jsxs)(gt,{value:e.key,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Ct,{size:13,"aria-hidden":!0}),J(e.key)]},e.key))}),c.map(e=>(0,Q.jsx)(_t,{value:e.key,children:(0,Q.jsx)(_n,{providerKey:e.key,connections:e.connections,instances:e.instances,manifest:f,compatStatus:p,compatReachable:t?.reachable??!0,protocol:e.key===`openclaw`?t?.protocol??null:null})},e.key))]}):null,h?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:v()}):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:Bt(t.bridgeVersion)}),i?(0,Q.jsxs)(Q.Fragment,{children:[` `,(0,Q.jsxs)(`code`,{className:`oc-traces__mono`,title:Ce(),children:[`(`,i,`)`]})]}):null,r?(0,Q.jsxs)(`strong`,{className:`oc-bridge-card__mismatch`,children:[` `,we({build:t.buildVersion??`?`})]}):null,` · `,b(),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:t.protocolVersion===null?Ye():String(t.protocolVersion)})]}):null;if(e===void 0)return(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:at()});if(e===null)return(0,Q.jsx)(`div`,{className:`oc-bridge-card oc-bridge-card--idle`,children:je()});let o=Jt(e.targets),s=!e.reachable,c=Yt(e),l=c?`ok`:`error`,u=F(e.checkedAt),d=e.startedAt==null?null:F(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)(qt,{size:22}):(0,Q.jsx)(O,{size:22})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__body`,children:[(0,Q.jsx)(`div`,{className:`oc-bridge-card__title`,children:c?st():s?tt():Oe({count:o.length})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__meta`,children:[(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(Kt,{size:12,"aria-hidden":!0}),` `,Re({time:u})]}),d?(0,Q.jsx)(`span`,{children:Be({time:d})}):null,a]}),s?(0,Q.jsx)(`p`,{className:`oc-bridge-card__hint`,children:G(e.lastError===`not_configured`?`NOT_CONFIGURED`:`BRIDGE_UNREACHABLE`).hint}):null]}),(0,Q.jsx)(`button`,{type:`button`,className:`oc-bridgebar__drill`,onClick:n,children:Ge()})]})}function _n({providerKey:e,connections:t,instances:n,manifest:r,compatStatus:i,compatReachable:a,protocol:o}){let s=r?Wt(r,e):null,c=new Map;for(let e of n)c.set(e.name,e.displayName??e.name);let l=[],u=new Set;for(let n of t){if(!n.instanceName||u.has(n.instanceName))continue;u.add(n.instanceName);let t=n.gatewayVersion??null;l.push({instanceName:n.instanceName,displayName:c.get(n.instanceName)??n.instanceName,version:t,state:Gt(t,e,r)})}let d=l.map(e=>e.state),f=d.includes(`beyond`)?`beyond`:d.length>0&&d.every(e=>e===`supported`)?`supported`:null,[p,m]=(0,K.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)(Ct,{size:15,"aria-hidden":!0,className:`oc-bridge-provider__icon`}),(0,Q.jsx)(`span`,{className:`oc-bridge-provider__name`,children:J(e)}),f?(0,Q.jsx)(P,{variant:f===`beyond`?`destructive`:`secondary`,children:Ut(f)}):null]}),(0,Q.jsx)(`h4`,{className:`oc-bridge-provider__sub`,children:le()}),(0,Q.jsx)(yn,{providerName:J(e),support:s,compatStatus:i,compatReachable:a,manifest:r,instanceRows:l}),o?(0,Q.jsx)(vn,{protocol:o}):null,(0,Q.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":p,onClick:()=>m(e=>!e),children:[p?(0,Q.jsx)(E,{size:13,"aria-hidden":!0}):(0,Q.jsx)(L,{size:13,"aria-hidden":!0}),Je({count:t.length})]}),p?(0,Q.jsx)(un,{connections:t,displayByInstance:c}):null]})}function vn({protocol:e}){let[t,n]=(0,K.useState)(!1),r=e.coverage,i=e.drift??[];return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`h4`,{className:`oc-bridge-provider__sub`,children:[u(),i.length>0?(0,Q.jsx)(P,{variant:`destructive`,children:me({count:i.length})}):(0,Q.jsx)(P,{variant:`secondary`,children:f()})]}),(0,Q.jsxs)(`p`,{className:`oc-admin__hint`,children:[rt({version:e.vendoredVersion}),r?` · `+c({handled:r.handled,ignored:r.ignored,gaps:r.gaps}):null]}),i.length>0?(0,Q.jsx)(`ul`,{className:`oc-bridge-protocol__list`,role:`list`,children:i.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)(E,{size:13,"aria-hidden":!0}):(0,Q.jsx)(L,{size:13,"aria-hidden":!0}),fe({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:at()}):t===`nodata`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Ee()}):(0,Q.jsxs)(`div`,{className:`oc-compat`,children:[n?null:(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:x()}),r===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:h()}):(0,Q.jsxs)(`div`,{className:`oc-compat__support`,children:[(0,Q.jsx)(`span`,{className:`oc-compat__label`,children:S({provider:a})}),e&&e.range!==null?(0,Q.jsx)(`span`,{children:Se({min:e.range.min,max:e.range.maxValidated})}):(0,Q.jsx)(`span`,{children:Ye()}),e?(0,Q.jsx)(Cn,{versions:e.validatedVersions}):null]}),i.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:o()}):(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:Bt(e.version)}),(0,Q.jsx)(P,{variant:e.state===`supported`?`secondary`:e.state===`beyond`?`destructive`:`outline`,children:Ut(e.state)})]},e.instanceName))})]})}function bn({instance:e,onClose:t}){return(0,Q.jsx)(Pt,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Q.jsxs)(Et,{className:`oc-bridge-config-dialog`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Q.jsxs)(jt,{children:[(0,Q.jsx)(kt,{children:pe({instance:e.displayName??e.name})}),(0,Q.jsx)(Ot,{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)(O,{"aria-hidden":!0}),(0,Q.jsxs)(`span`,{children:[e,` — `,t.ok?ae():t.detail]})]}):(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--skip`,children:[e,` — `,ie()]}):null}function Sn({instance:e,onClose:t}){let n=xe(d.admin.upsertInstanceConfig),r=te(d.bridge.validateMediaPaths),o=St(),s=Lt(e.config?.contentLocale,void 0),[c,l]=(0,K.useState)(()=>ft(e.config??{},s)),[u,f]=(0,K.useState)(!1),[m,h]=(0,K.useState)(!1),[g,_]=(0,K.useState)(null),v=c.inboundMediaMode===`shared-fs`,y=c.mediaMode===`shared-fs`,b=v||y;async function x(){h(!0),_(null);try{_(await r({instanceName:e.name,inboundMediaMode:c.inboundMediaMode,mediaMode:c.mediaMode}))}catch(e){o.error(re(),e)}finally{h(!1)}}async function S(){f(!0);try{let r=e.config??{};await n({instanceId:e._id,config:mt(c,r,s)}),t()}catch(e){o.error(De(),e)}finally{f(!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)(D,{label:de(),help:Le()}),(0,Q.jsxs)(N,{value:c.mediaMode,onValueChange:e=>l({...c,mediaMode:e}),children:[(0,Q.jsx)(k,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(R,{})}),(0,Q.jsx)(z,{children:ht.map(e=>(0,Q.jsx)(M,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(D,{label:it(),help:ze()}),(0,Q.jsxs)(N,{value:c.inboundMediaMode,onValueChange:e=>l({...c,inboundMediaMode:e}),children:[(0,Q.jsx)(k,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(R,{})}),(0,Q.jsx)(z,{children:pt.map(e=>(0,Q.jsx)(M,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(D,{label:Ae(),help:Fe()}),(0,Q.jsx)(I,{type:`number`,min:1,max:4096,className:`w-full`,value:c.mediaMaxMb,onChange:e=>l({...c,mediaMaxMb:Math.trunc(Number(e.target.value)||0)})})]})]}),b&&(0,Q.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[v&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(D,{label:he(),help:ee()}),(0,Q.jsx)(I,{className:`w-full`,spellCheck:!1,value:c.inboundAgentMount,onChange:e=>l({...c,inboundAgentMount:e.target.value})})]}),y&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(D,{label:ve(),help:a()}),(0,Q.jsx)(I,{className:`w-full`,spellCheck:!1,value:c.outboundAgentMount,onChange:e=>l({...c,outboundAgentMount:e.target.value})})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Q.jsx)(Mt,{checked:c.rehydration,onCheckedChange:e=>l({...c,rehydration:e===!0})}),(0,Q.jsx)(D,{label:ot(),help:Me()})]}),b&&g!==null&&(0,Q.jsx)(`div`,{className:`oc-bridge-config__check`,children:g.reachable?!g.inbound&&!g.outbound?(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(O,{"aria-hidden":!0}),i({reason:g.reason??`?`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(xn,{label:p(),result:g.inbound}),(0,Q.jsx)(xn,{label:se(),result:g.outbound}),(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ne()})]}):(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(O,{"aria-hidden":!0}),He()]})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-config__actions`,children:[b&&(0,Q.jsxs)(bt,{variant:`outline`,size:`sm`,onClick:()=>void x(),disabled:m,children:[m?(0,Q.jsx)(It,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,m?ue():ct()]}),(0,Q.jsx)(bt,{size:`sm`,onClick:()=>void S(),disabled:u,children:et()})]})]})})}function Cn({versions:e}){if(e.length===0)return null;let t=[...e].reverse();return(0,Q.jsxs)(xt,{children:[(0,Q.jsx)(Nt,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,className:`oc-compat__versions-btn`,children:[e.length===1?ge():g({count:e.length}),(0,Q.jsx)(E,{size:13,"aria-hidden":!0})]})}),(0,Q.jsxs)(Dt,{className:`oc-compat__versions-pop`,align:`start`,children:[(0,Q.jsx)(`p`,{className:`oc-compat__versions-title`,children:ye()}),(0,Q.jsx)(`div`,{className:`oc-compat__versions-list`,children:t.map(e=>(0,Q.jsx)(P,{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{$s as r,Ai as i,Cg as a,Di as o,E as s,Ei as c,Gj as l,Gt as u,Hj as d,Ij as f,Lc as p,Mi as m,Ni as h,Oi as g,Ti as _,Wj as v,ac as y,ec as b,hl as x,ic as S,ji as C,ki as w,ml as T,nc as E,oc as D,rc as O,sc as k,tc as A,wi as j,xl as M,yl as N}from"./dist-CQKky_Rh.js";import{t as P}from"./button-BZ2ghM2f.js";import{At as F,C as I,S as L,b as R,d as z,f as B,lt as V,p as H,w as U,x as W,y as G}from"./index-BuqxeAUW.js";import{i as K}from"./compatView-e2VbQwBf.js";/* empty css */var q=t(e(),1),J=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function Y(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 X=n();function Z({instance:e}){let t=v(s.admin.upsertInstanceConfig),n=l(s.agents.listAgentsForInstance,{instanceName:e.name}),a=typeof e.config?.converterAgentId==`string`?e.config.converterAgentId:``,[o,c]=(0,q.useState)(a),[u,d]=(0,q.useState)(`idle`);(0,q.useEffect)(()=>{c(a),d(`idle`)},[e._id,a]);let f=`__none__`,p=o!==a;async function m(){d(`saving`);try{let n={...e.config??{}};o===``||o===f?delete n.converterAgentId:n.converterAgentId=o,await t({instanceId:e._id,config:n}),d(`done`)}catch{d(`error`)}}let h=n?.agents??[];return(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:i()}),(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:w()}),(0,X.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,X.jsxs)(R,{value:o===``?f:o,onValueChange:e=>c(e===f?``:e),children:[(0,X.jsx)(I,{className:`oc-cdefaults__select`,"aria-label":i(),children:(0,X.jsx)(U,{placeholder:g()})}),(0,X.jsxs)(W,{children:[(0,X.jsx)(L,{value:f,children:g()}),h.map(e=>(0,X.jsx)(L,{value:e.agentId,children:e.displayName?`${e.displayName} (${e.agentId})`:e.agentId},e.agentId))]})]}),(0,X.jsx)(P,{size:`sm`,disabled:!p||u===`saving`,onClick:()=>void m(),children:u===`saving`?M():A()})]}),u===`done`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:b()}):null,u===`error`?(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:r()}):null]})}function Q({instance:e}){let t=v(s.admin.upsertInstanceConfig),n=e.config?.curationEnabled===!0,i=typeof e.config?.curationBudgetChars==`number`?e.config.curationBudgetChars:null,[a,l]=(0,q.useState)(n),[u,d]=(0,q.useState)(i===null?``:String(i)),[f,p]=(0,q.useState)(`idle`);(0,q.useEffect)(()=>{l(n),d(i===null?``:String(i)),p(`idle`)},[e._id,n,i]);let m=u.trim(),h=m===``?null:/^\d+$/.test(m)?Number.parseInt(m,10):NaN,g=!a||h===null||Number.isInteger(h)&&h>=4e3&&h<=6e4,y=a!==n||(h??null)!==i;async function x(){p(`saving`);try{let n={...e.config??{}};n.curationEnabled=a,!a||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,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,X.jsx)(H,{checked:a,onCheckedChange:e=>l(e===!0),"aria-label":C()}),(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:C()})]}),(0,X.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,X.jsx)(V,{type:`number`,min:4e3,max:6e4,step:1e3,placeholder:`20000`,value:u,onChange:e=>d(e.target.value),className:`oc-cdefaults__number`,"aria-invalid":!g,"aria-label":o(),disabled:!a}),(0,X.jsx)(P,{size:`sm`,disabled:!y||!g||f===`saving`,onClick:()=>void x(),children:f===`saving`?M():A()})]}),g?null:(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:c()}),f===`done`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:b()}):null,f===`error`?(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:r()}):null,(0,X.jsx)(`p`,{className:`oc-cdefaults__help`,children:_()})]})}function $({instance:e}){let t=v(s.admin.upsertInstanceConfig),n=typeof e.config?.summarizeThresholdChars==`number`?e.config.summarizeThresholdChars:null,[i,a]=(0,q.useState)(n===null?``:String(n)),[o,c]=(0,q.useState)(`idle`);(0,q.useEffect)(()=>{a(n===null?``:String(n)),c(`idle`)},[e._id,n]);let l=i.trim(),u=l===``?null:/^\d+$/.test(l)?Number.parseInt(l,10):NaN,d=u===null||Number.isInteger(u)&&u>=1e3&&u<=2e5,f=(u??null)!==n;async function p(){c(`saving`);try{let n={...e.config??{}};u===null?delete n.summarizeThresholdChars:n.summarizeThresholdChars=u,await t({instanceId:e._id,config:n}),c(`done`)}catch{c(`error`)}}return(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:h()}),(0,X.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,X.jsx)(V,{type:`number`,min:1e3,max:2e5,step:1e3,placeholder:`8000`,value:i,onChange:e=>a(e.target.value),className:`oc-cdefaults__number`,"aria-invalid":!d}),(0,X.jsx)(P,{size:`sm`,disabled:!f||!d||o===`saving`,onClick:()=>void p(),children:o===`saving`?M():A()})]}),d?null:(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:j()}),o===`done`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:b()}):null,o===`error`?(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:r()}):null,(0,X.jsx)(`p`,{className:`oc-cdefaults__help`,children:m()})]})}function ee(){let e=d(s.agentFiles.getChatDefaults),[t,n]=(0,q.useState)({status:`loading`}),r=l(s.admin.listInstances,{}),[i,o]=(0,q.useState)(null);(0,q.useEffect)(()=>{!r||r.length===0||(!i||!r.some(e=>e.name===i))&&o(r[0].name)},[r,i]);let c=(r?.length??0)>1,m=r!==void 0&&r.length===0,h=l(s.compat.forInstance,i?{instanceName:i}:`skip`),g=i?G(h,`configDefaults`):`loading`,_=g===`loading`?null:g.blocked,v=(0,q.useMemo)(()=>c&&i?{instanceName:i}:{},[c,i]),b=(0,q.useRef)(0),C=(0,q.useCallback)(async()=>{let t=++b.current;n({status:`loading`});try{let r=Y(await e(v));if(b.current!==t)return;n({status:`done`,current:r})}catch{if(b.current!==t)return;n({status:`error`})}},[e,v]);(0,q.useEffect)(()=>{_===!1&&(c&&!i||C())},[C,_,c,i]);let w=t.status===`done`?t.current:null,A=(0,q.useMemo)(()=>J.map(e=>({id:e,label:B(e)})),[]),j=(0,q.useMemo)(()=>[{id:`fast`,label:x()},{id:`standard`,label:T()}],[]);return(0,X.jsxs)(`div`,{className:`oc-cdefaults`,children:[(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:k()}),c&&i?(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:p()}),(0,X.jsxs)(R,{value:i,onValueChange:e=>o(e),children:[(0,X.jsx)(I,{size:`sm`,"aria-label":p(),children:(0,X.jsx)(U,{})}),(0,X.jsx)(W,{children:(r??[]).map(e=>(0,X.jsx)(L,{value:e.name,children:e.name},e.name))})]})]}):null,m?(0,X.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:a()}):g===`loading`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:f()}):g.blocked?(0,X.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,X.jsx)(F,{size:14,"aria-hidden":!0}),` `,K(g.gatewayVersion,g.provider)]}):t.status===`loading`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:f()}):t.status===`error`?(0,X.jsxs)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:[E(),` `,(0,X.jsx)(P,{variant:`outline`,size:`sm`,onClick:()=>void C(),children:N()})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:D()}),(0,X.jsx)(z,{options:A,value:w?.thinkingDefault??null,onChange:()=>{},disabled:!0}),(0,X.jsx)(`p`,{className:`oc-cdefaults__help`,children:y()})]}),(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:S()}),(0,X.jsx)(z,{options:j,value:w===null||w.fastModeDefault===null?null:w.fastModeDefault?`fast`:`standard`,onChange:()=>{},disabled:!0}),(0,X.jsx)(`p`,{className:`oc-cdefaults__help`,children:O()})]}),(0,X.jsx)(`p`,{className:`oc-cdefaults__note`,children:u()})]}),(()=>{let e=r?.find(e=>e.name===(i??r[0]?.name));return e?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($,{instance:e}),(0,X.jsx)(Q,{instance:e}),(0,X.jsx)(Z,{instance:e})]}):null})()]})}export{ee as ChatDefaultsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$S as r,AC as i,BS as a,CC as o,DC as s,E as c,EC as l,FS as u,GS as d,Gj as f,Gr as p,HS as m,IS as ee,JS as te,KS as h,LS as g,MC as _,MS as ne,NC as v,NS as re,OC as ie,PS as y,QS as b,RS as x,SC as S,TC as C,US as w,Ur as T,VS as E,WS as D,Wj as O,XS as k,YS as A,ZS as j,_C as M,aC as N,bC as P,cC as F,dC as I,eC as L,fC as R,gC as z,hC as B,iC as V,jC as H,kC as ae,lC as U,mC as W,nC as G,oC as K,pC as q,qS as J,rC as oe,sC as se,tC as ce,uC as le,vC as ue,wC as de,xC as fe,yC as pe,zS as me}from"./dist-CQKky_Rh.js";import{t as he}from"./button-BZ2ghM2f.js";import{U as ge,j as _e}from"./index-BuqxeAUW.js";import{t as Y}from"./DataTableShell-q5ZC3kNL.js";var X=t(e(),1),Z=n(),ve={altered_words:()=>v(),incorrect:()=>_(),incoherence:()=>H(),formatting:()=>i(),latency:()=>ae(),api_error:()=>ie(),other:()=>s()},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:C()}):e===!1?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:de()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:`—`}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:l()})}function ye({data:e,closeReason:t}){let n=e.snapshot,r=O(c.feedback.respondToFeedback),[i,a]=(0,X.useState)(e.thread),[s,l]=(0,X.useState)(``),[u,d]=(0,X.useState)(!1);async function f(){let t=s.trim();if(!(!t||u)){d(!0);try{await r({feedbackId:e._id,text:t}),a(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),l(``)}finally{d(!1)}}}let m=[];try{m=n.contextJson?JSON.parse(n.contextJson):[]}catch{m=[]}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?` · ${o()}`:``,n.openclawModel?` · ${n.openclawModel}`:``,n.openclawRuntime?` (${n.openclawRuntime})`:``]})]}),e.comment?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:S()}),(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:x()}),(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:fe()}),i.length>0?(0,Z.jsx)(`div`,{className:`oc-fbadmin__thread`,children:i.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`?P():e.authorRole===`agent`?e.authorLabel??p():pe()}),(0,Z.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Z.jsx)(`p`,{className:`oc-fbadmin__meta`,children:ue()}),(0,Z.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:M(),value:s,maxLength:2e3,rows:3,onChange:e=>l(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 f(),disabled:!s.trim()||u,children:u?z():B()})})]}),(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:W()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.messageText||q()})]}),n.clientInfo?.sourceWasOpen&&n.displayedText!==void 0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:R()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.displayedText||q()})]}):null,n.promptText?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:I()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.promptText})]}):null,m.length>0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:le({count:n.contextCount??m.length,truncated:n.contextTruncated?U():``})}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:m.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:F()}),(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:se()}),(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:K()}),(0,Z.jsxs)(`p`,{className:`oc-fbadmin__env`,children:[[n.clientInfo?.language,n.clientInfo?.timezone,n.clientInfo?.theme?N({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:[V(),` `,n.clientInfo.plugins.join(`, `),(0,Z.jsxs)(`span`,{className:`oc-fbadmin__note`,children:[` `,oe()]})]}):null,n.clientInfo?.userAgent?(0,Z.jsx)(`span`,{className:`oc-fbadmin__ua`,children:n.clientInfo.userAgent}):null]})]})]})}function be(){let e=f(c.feedback.listForAdmin,{}),t=O(c.feedback.readSnapshot),n=O(c.feedback.deleteFeedback),i=ge(),[o,s]=(0,X.useState)(null),[l,p]=(0,X.useState)({});async function _(e){if(o===e._id){s(null);return}if(!l[e._id]){let n=await t({feedbackId:e._id});p(t=>({...t,[e._id]:n}))}s(e._id)}async function v(e){await i({title:y(),description:re(),confirmLabel:ne(),destructive:!0})&&(await n({feedbackId:e._id}),o===e._id&&s(null))}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[G(),` `,(0,Z.jsx)(`strong`,{children:ce()}),` `,L()]}),(0,Z.jsx)(Y,{title:r(),rows:e,emptyHint:b(),isExpanded:e=>o===e._id&&!!l[e._id],renderExpanded:e=>l[e._id]?(0,Z.jsx)(ye,{data:l[e._id],closeReason:e.userCloseReason}):null,columns:[{header:j(),cell:e=>_e(e.at),sort:e=>e.at},{header:k(),cell:e=>Q(e.category),sort:e=>Q(e.category)},{header:A(),cell:e=>e.messageRole===`user`?te():J(),sort:e=>e.messageRole},{header:h(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${d({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:D(),cell:e=>(0,Z.jsx)($,{matches:e.displayedMatchesStored,sourceWasOpen:e.sourceWasOpen}),sort:e=>e.displayedMatchesStored===!1?0:e.displayedMatchesStored===!0?1:2},{header:w(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:m(),cell:e=>e.userClosedAt==null?e.resolvedAt==null?e.answered?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:E()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:a()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,title:e.resolvedBy??void 0,children:T()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-closed`,children:me()}),sort:e=>e.userClosedAt==null?e.resolvedAt==null?+!!e.answered:2:3}],rowActions:e=>[{label:o===e._id?g():ee(),onSelect:()=>void _(e)},{label:u(),onSelect:()=>void v(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{$A as r,BA as ee,E as i,FA as te,GA as ne,Gj as re,HA as ie,IA as ae,Ij as oe,JA as a,Jr as o,KA as s,LA as c,QA as l,RA as se,Rj as ce,TE as le,UA as u,VA as ue,WA as de,Wj as fe,XA as pe,YA as me,Yr as d,ZA as he,aj as f,cj as ge,dj as _e,ej as p,fj as m,gj as ve,hj as ye,ij as h,lj as be,mj as xe,nj as g,oj as Se,pj as _,qA as v,rj as y,sj as b,tj as x,uj as S,zA as C}from"./dist-CQKky_Rh.js";import{t as w}from"./button-BZ2ghM2f.js";import{C as T,Ft as E,G as D,H as O,Ht as k,J as A,K as j,Q as Ce,S as M,Ut as N,X as we,Y as Te,Z as Ee,b as P,ct as F,it as I,jt as De,nt as Oe,p as ke,q as Ae,rt as je,st as Me,w as L,x as R}from"./index-BuqxeAUW.js";import{a as Ne,i as z,n as Pe,o as B,r as V,t as Fe}from"./table-IXupQ5w1.js";var H=t(e(),1),U=n(),W=`all`;function G(e){switch(e){case`image`:return f();case`audio`:return h();case`video`:return y();case`pdf`:return g();case`document`:return x();case`archive`:return p();default:return r()}}function K(){let[e,t]=(0,H.useState)(W),[n,r]=(0,H.useState)(W),[f,p]=(0,H.useState)(W),[h,g]=(0,H.useState)(W),[y,x]=(0,H.useState)(!1),[K,q]=(0,H.useState)(null),J=fe(i.files.softDelete),Y=O();function Ie(){t(W),r(W),p(W),g(W)}async function Le(){let e=K;if(q(null),e)try{await J({fileId:e.id}),Y.success(ie())}catch(e){Y.error(ue(),e)}}let X=re(i.files.listMine,{direction:e===W?void 0:e,chatId:n===W?void 0:n,instanceName:f===W?void 0:f,category:h===W?void 0:h,includeAutoGenerated:y||void 0}),Re=(0,H.useMemo)(()=>new Intl.DateTimeFormat(ce(),{dateStyle:`medium`,timeStyle:`short`}),[]);if(X===void 0)return(0,U.jsx)(`p`,{className:`oc-admin__hint`,children:oe()});let{files:Z,facets:Q,truncated:ze,cap:Be}=X,$=e!==W||n!==W||f!==W||h!==W;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`p`,{className:`oc-admin__hint`,children:ve()}),(0,U.jsxs)(`div`,{className:`oc-files__filters`,style:{display:`flex`,flexWrap:`wrap`,gap:8,margin:`12px 0`},children:[(0,U.jsxs)(P,{value:e,onValueChange:t,children:[(0,U.jsx)(T,{size:`sm`,"aria-label":ye(),children:(0,U.jsx)(L,{})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(M,{value:W,children:xe()}),(0,U.jsx)(M,{value:`inbound`,children:_()}),(0,U.jsx)(M,{value:`outbound`,children:m()})]})]}),(0,U.jsxs)(P,{value:n,onValueChange:r,children:[(0,U.jsx)(T,{size:`sm`,"aria-label":_e(),children:(0,U.jsx)(L,{})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(M,{value:W,children:S()}),Q.chats.map(e=>(0,U.jsx)(M,{value:e.id,children:e.title},e.id))]})]}),Q.multiProvider?(0,U.jsxs)(P,{value:f,onValueChange:p,children:[(0,U.jsx)(T,{size:`sm`,"aria-label":be(),children:(0,U.jsx)(L,{})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(M,{value:W,children:ge()}),Q.instances.map(e=>(0,U.jsx)(M,{value:e,children:e},e))]})]}):null,(0,U.jsxs)(P,{value:h,onValueChange:g,children:[(0,U.jsx)(T,{size:`sm`,"aria-label":b(),children:(0,U.jsx)(L,{})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(M,{value:W,children:Se()}),Q.categories.map(e=>(0,U.jsx)(M,{value:e,children:G(e)},e))]})]}),(0,U.jsxs)(`label`,{className:`oc-files__autogen`,children:[(0,U.jsx)(ke,{checked:y,onCheckedChange:e=>x(e===!0),"aria-label":d()}),(0,U.jsx)(`span`,{children:d()})]}),$?(0,U.jsxs)(w,{variant:`ghost`,size:`sm`,onClick:Ie,style:{display:`inline-flex`,alignItems:`center`,gap:4,marginLeft:`auto`},children:[(0,U.jsx)(E,{size:14,"aria-hidden":!0}),ne()]}):null]}),Z.length===0?(0,U.jsx)(`p`,{className:`oc-admin__hint`,children:$?ae():c()}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(Fe,{children:[(0,U.jsx)(Ne,{children:(0,U.jsxs)(B,{children:[(0,U.jsx)(z,{children:l()}),(0,U.jsx)(z,{children:he()}),(0,U.jsx)(z,{children:pe()}),(0,U.jsx)(z,{children:me()}),(0,U.jsx)(z,{children:a()}),(0,U.jsx)(z,{className:`text-right`,children:v()})]})}),(0,U.jsx)(Pe,{children:Z.map(e=>(0,U.jsxs)(B,{children:[(0,U.jsxs)(V,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:e.filename,children:[e.filename,e.origin===`pasted`?(0,U.jsx)(F,{variant:`outline`,style:{marginLeft:6},children:o()}):null]}),(0,U.jsx)(V,{title:e.mimeType,children:G(e.category)}),(0,U.jsx)(V,{children:(0,U.jsx)(F,{variant:`secondary`,children:e.direction===`inbound`?_():m()})}),(0,U.jsx)(V,{style:{maxWidth:220,overflow:`hidden`,textOverflow:`ellipsis`},title:e.chatTitle,children:e.chatTitle}),(0,U.jsx)(V,{className:`whitespace-nowrap text-muted-foreground`,children:Re.format(e.createdAt)}),(0,U.jsx)(V,{className:`text-right`,children:(0,U.jsxs)(Oe,{children:[(0,U.jsx)(Me,{asChild:!0,children:(0,U.jsx)(w,{variant:`ghost`,size:`icon`,"aria-label":de(),children:(0,U.jsx)(k,{size:16})})}),(0,U.jsxs)(je,{align:`end`,children:[e.url?(0,U.jsx)(I,{asChild:!0,children:(0,U.jsxs)(`a`,{href:e.url,download:e.filename,target:`_blank`,rel:`noopener noreferrer`,children:[(0,U.jsx)(N,{size:14}),s()]})}):(0,U.jsxs)(I,{disabled:!0,children:[(0,U.jsx)(N,{size:14}),se()]}),(0,U.jsxs)(I,{variant:`destructive`,onSelect:()=>q({id:e._id,filename:e.filename}),children:[(0,U.jsx)(De,{size:14}),u()]})]})]})})]},e._id))})]}),ze?(0,U.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:8},children:te({cap:Be})}):null]}),(0,U.jsx)(D,{open:K!==null,onOpenChange:e=>!e&&q(null),children:(0,U.jsxs)(A,{children:[(0,U.jsxs)(Ee,{children:[(0,U.jsx)(Ce,{children:ee()}),(0,U.jsx)(Te,{children:C()})]}),(0,U.jsxs)(we,{children:[(0,U.jsx)(Ae,{children:le()}),(0,U.jsx)(j,{onClick:()=>void Le(),children:u()})]})]})})]})}export{K 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,Au as i,Bl as a,Bu as o,Cu as s,D as c,Du as l,E as u,Eu as d,Fl as f,Fu as p,Gj as m,Gl as h,Hl as g,Hu as _,Il as v,Iu as y,Jl as b,Kl as x,Ll as S,Lu as C,Mu as ee,Nl as w,Nu as T,Ou as te,Pl as E,Pu as ne,Ql as D,Rl as O,Ru as k,Su as A,Tu as re,Ul as j,Vl as M,Vu as ie,Wj as N,Wl as P,Xl as F,Yl as ae,Zl as oe,_u as I,au as se,bu as ce,cu as le,du as ue,eu as de,fu as fe,gu as pe,hu as me,iu as L,ju as he,ku as ge,lu as _e,mu as ve,nu as ye,ou as be,pu as R,ql as xe,ru as Se,su as Ce,tu as we,uu as Te,vu as Ee,wu as De,xu as Oe,yu as ke,zl as z,zu as Ae}from"./dist-CQKky_Rh.js";import{t as je}from"./x-Do-PZuRM.js";import{i as B,n as V,r as Me,t as Ne}from"./tabs-e0oOoEId.js";import{t as H}from"./button-BZ2ghM2f.js";import{C as Pe,H as U,Jt as Fe,Mt as W,Nt as G,S as Ie,U as Le,b as Re,ct as K,dt as ze,ft as Be,ht as Ve,lt as q,mt as He,p as J,qt as Ue,u as We,ut as Ge,w as Ke,x as qe,xt as Je}from"./index-BuqxeAUW.js";import{t as Ye}from"./FilterBar-Bjp3W3-O.js";import{t as Xe}from"./DataTableShell-q5ZC3kNL.js";import{t as Y}from"./DetailChips-BI5FFFCD.js";var Ze=c(`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=c(`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=c(`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 le();case`pending`:return Ce();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=m(u.groups.listGroups,{}),t=m(u.me.getMe,{host:Je})?.role===`admin`,n=N(u.groups.createGroup),r=N(u.groups.updateGroup),a=N(u.groups.deleteGroup),c=Le(),h=U(),[g,b]=(0,Z.useState)(!1),[x,S]=(0,Z.useState)(null),[w,E]=(0,Z.useState)($),[D,O]=(0,Z.useState)(null),[j,M]=(0,Z.useState)(``),P=(0,Z.useMemo)(()=>{if(!e)return e;let t=j.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,j]);function F(){S(null),E($),b(!0)}function ae(e){S(e),E({name:e.name,description:e.description??``}),b(!0)}async function oe(){try{x?await r({groupId:x._id,name:w.name,description:w.description}):await n({name:w.name,description:w.description||void 0}),E($),S(null),b(!1)}catch(e){h.error(v(),e)}}async function I(e){if(await c({title:s({name:e.name}),description:A(),confirmWord:e.name,confirmLabel:Oe(),cancelLabel:ge(),destructive:!0}))try{await a({groupId:e._id})}catch(e){h.error(f(),e)}}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ie()}),(0,Q.jsx)(Ye,{q:j,onQChange:M,onReset:()=>M(``),canReset:j!==``,searchPlaceholder:ne()}),(0,Q.jsx)(Xe,{title:_(),rows:P,addLabel:o(),onAdd:t?F:void 0,emptyHint:Ae(),columns:[{header:k(),cell:e=>e.name,sort:e=>e.name},{header:C(),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:y(),cell:e=>(0,Q.jsx)(Y,{icon:(0,Q.jsx)(G,{size:12,"aria-hidden":!0}),total:e.agentCount,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount},{header:p(),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)(W,{size:11,fill:`currentColor`,"aria-hidden":!0}):null,highlight:e.isDefault}))}),sort:e=>e.chartCount}],rowActions:e=>[{label:T(),onSelect:()=>O({groupId:e._id,name:e.name})},...t?[{label:ee(),onSelect:()=>ae(e)},{label:he(),variant:`destructive`,onSelect:()=>void I(e)}]:[]]}),(0,Q.jsx)(We,{open:g,onOpenChange:b,title:x?l():te(),description:d(),canSubmit:!!w.name.trim(),onSubmit:oe,submitLabel:i(),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:re()}),(0,Q.jsx)(q,{value:w.name,onChange:e=>E({...w,name:e.target.value})})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(`span`,{className:`oc-field__label`,children:De()}),(0,Q.jsx)(q,{value:w.description,onChange:e=>E({...w,description:e.target.value})})]})]})}),(0,Q.jsx)(ct,{groupId:D?.groupId??null,groupName:D?.name??``,open:D!==null,onOpenChange:e=>{e||O(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)(Fe,{size:14,"aria-hidden":!0}),fe()]}),(0,Q.jsxs)(`span`,{className:`oc-access__pageinfo`,"aria-label":Te({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:[ue(),(0,Q.jsx)(Ue,{size:14,"aria-hidden":!0})]})]})}function ct({groupId:e,groupName:t,open:n,onOpenChange:r}){let i=m(u.groups.getGroup,n&&e?{groupId:e}:`skip`),o=m(u.groups.listAssignableInstances,n?{}:`skip`),s=m(u.groups.listAssignableUsers,n?{}:`skip`),c=N(u.groups.addMember),l=N(u.groups.removeMember),d=N(u.groups.bulkSetMembers),f=N(u.groups.setGroupManager),p=U(),[h,g]=(0,Z.useState)(``),[_,v]=(0,Z.useState)(``),[y,b]=(0,Z.useState)(`members`),[x,S]=(0,Z.useState)(1),[C,ee]=(0,Z.useState)(new Set),w=(0,Z.useRef)(null),T=(0,Z.useMemo)(()=>new Set((i?.members??[]).map(e=>e.userId)),[i]),te=(0,Z.useMemo)(()=>new Set((i?.members??[]).filter(e=>e.manager).map(e=>e.userId)),[i]),ne=i?.viewerIsAdmin===!0,D=(0,Z.useMemo)(()=>new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),[i]);(0,Z.useEffect)(()=>{g(``),v(``),b(`members`),S(1),w.current=null},[n,e]),(0,Z.useEffect)(()=>{S(1)},[h]),(0,Z.useEffect)(()=>{n&&i&&e&&w.current!==e&&(w.current=e,ee(new Set((i.members??[]).map(e=>e.userId))))},[n,i,e]);let k=(0,Z.useMemo)(()=>s?$e(s,h,C):[],[s,h,C]);async function A(t,n){if(e)try{n?await l({groupId:e,userId:t}):await c({groupId:e,userId:t})}catch(e){p.error(E(),e)}}async function re(t,n){if(e)try{await f({groupId:e,userId:t,manager:!n})}catch(e){p.error(O(),e)}}let j=rt(k,e=>T.has(e.userId)),ie=k.filter(e=>T.has(e.userId)).length,P=it(k,x,ot);async function F(){if(!e||k.length===0)return;let t=k.map(e=>e.userId);try{await d({groupId:e,userIds:t,member:j!==`all`})}catch(e){p.error(E(),e)}}return(0,Q.jsx)(Ge,{open:n,onOpenChange:r,children:(0,Q.jsxs)(ze,{className:`oc-access`,children:[(0,Q.jsxs)(He,{children:[(0,Q.jsx)(Ve,{children:ce({name:t})}),(0,Q.jsx)(Be,{children:ke()})]}),(0,Q.jsxs)(Ne,{value:y,onValueChange:b,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}),Ee(),i?(0,Q.jsx)(K,{variant:`secondary`,className:`oc-access__tabcount`,children:T.size}):null]}),(0,Q.jsxs)(B,{value:`agents`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(G,{size:13,"aria-hidden":!0}),pe(),i?(0,Q.jsx)(K,{variant:`secondary`,className:`oc-access__tabcount`,children:D.size}):null]}),(0,Q.jsxs)(B,{value:`charts`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Ze,{size:13,"aria-hidden":!0}),ae(),i?(0,Q.jsx)(K,{variant:`secondary`,className:`oc-access__tabcount`,children:i.chartCount}):null]})]}),(0,Q.jsx)(V,{value:`members`,children:s===void 0||i===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:L()}):s.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:ye()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(q,{value:h,onChange:e=>g(e.target.value),placeholder:I(),className:`oc-access__search`}),k.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:ve()}):(0,Q.jsxs)(Q.Fragment,{children:[k.length>1?(0,Q.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,Q.jsx)(J,{checked:j===`all`?!0:j===`some`?`indeterminate`:!1,onCheckedChange:()=>void F(),"aria-label":R()}),(0,Q.jsx)(`span`,{className:`oc-access__label`,children:R()}),(0,Q.jsxs)(K,{variant:`outline`,className:`oc-access__count`,children:[ie,` / `,k.length]})]}):null,(0,Q.jsx)(`div`,{className:`oc-access__list`,children:P.pageItems.map(e=>{let t=T.has(e.userId),n=tt(e),r=te.has(e.userId);return(0,Q.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Q.jsx)(J,{checked:t,onCheckedChange:()=>void A(e.userId,t),"aria-label":be({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)(K,{variant:`outline`,className:`oc-access__role`,children:nt(e.role)}),(0,Q.jsx)(`span`,{className:`oc-access__mgrslot`,children:t&&ne?(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?z():a(),title:r?z():a(),onClick:()=>void re(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":M(),title:M(),children:(0,Q.jsx)(X,{size:15,"aria-hidden":!0})}):null})]},e._id)})}),(0,Q.jsx)(st,{page:P.page,pageCount:P.pageCount,onPage:S})]})]})}),(0,Q.jsx)(V,{value:`agents`,children:o===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:L()}):o.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:we()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(q,{value:_,onChange:e=>v(e.target.value),placeholder:me(),className:`oc-access__search`}),(0,Q.jsx)(`div`,{className:`oc-access__list`,children:o.map(t=>(0,Q.jsx)(lt,{groupId:e,instanceName:t.name,kind:t.kind??`openclaw`,assigned:D,query:_},`${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:i,query:a}){let o=m(u.groups.listAssignableAgents,{instanceName:t}),s=N(u.groups.assignAgentToGroup),c=N(u.groups.removeAgentFromGroup),l=N(u.groups.bulkSetGroupAgents),d=U(),[f,p]=(0,Z.useState)(1);if((0,Z.useEffect)(()=>{p(1)},[a]),!e)return null;let h=et(o?.agents??[],a),g=o?.discovery&&!o.discovery.lastPollOk;if(a.trim()&&h.length===0)return null;let _=h.filter(e=>e.presentInLastOk!==!1&&e.enabled!==!1),v=rt(_,e=>i.has(`${t}/${e.agentId}`)),y=it(h,f,ot);async function b(n,r){try{r?await c({groupId:e,instanceName:t,agentId:n}):await s({groupId:e,instanceName:t,agentId:n})}catch(e){d.error(w(),e)}}async function x(){if(_.length===0)return;let n=_.map(e=>e.agentId);try{await l({groupId:e,instanceName:t,agentIds:n,assigned:v!==`all`})}catch(e){d.error(w(),e)}}return(0,Q.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Q.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Q.jsx)(G,{size:13,"aria-hidden":!0}),(0,Q.jsx)(`span`,{children:t}),(0,Q.jsx)(K,{variant:`outline`,className:`oc-access__kind`,children:n}),g?(0,Q.jsx)(K,{variant:`outline`,className:`oc-access__stale`,children:D()}):null]}),o===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:Se()}):h.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:g?r():de()}):(0,Q.jsxs)(Q.Fragment,{children:[_.length>1?(0,Q.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,Q.jsx)(J,{checked:v===`all`?!0:v===`some`?`indeterminate`:!1,onCheckedChange:()=>void x(),"aria-label":R()}),(0,Q.jsx)(`span`,{className:`oc-access__label`,children:R()})]}):null,y.pageItems.map(e=>{let n=`${t}/${e.agentId}`,r=i.has(n),a=e.presentInLastOk===!1,o=!e.enabled;return(0,Q.jsxs)(`div`,{className:`oc-access__row${o?` is-disabled`:``}`,children:[(0,Q.jsx)(J,{checked:r,disabled:(a||o)&&!r,onCheckedChange:()=>void b(e.agentId,r),"aria-label":se({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":F(),title:F(),children:(0,Q.jsx)(W,{size:14,fill:`currentColor`})}):null,a?(0,Q.jsx)(K,{variant:`outline`,className:`oc-access__gone`,children:oe()}):null]},e.agentId)}),(0,Q.jsx)(st,{page:y.page,pageCount:y.pageCount,onPage:p})]})]})}function ut({groupId:e}){let t=m(u.charts.listGroupChartSelection,e?{groupId:e}:`skip`),n=N(u.charts.assignChartToGroup),r=N(u.charts.removeChartFromGroup),i=N(u.charts.setGroupDefaultChart),a=N(u.charts.addChartToGroupPool),o=N(u.charts.removeChartFromGroupPool),s=U();if(!e)return null;if(t===void 0)return(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:L()});let{pool:c,addable:l,canManagePool:d}=t;if(c.length===0&&!d)return(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:b()});async function f(t,i){try{i?await r({groupId:e,chartKey:t}):await n({groupId:e,chartKey:t})}catch(e){s.error(S(),e)}}async function p(t){try{await i({groupId:e,chartKey:t})}catch(e){s.error(S(),e)}}async function _(t){try{await a({groupId:e,chartKey:t})}catch(e){s.error(S(),e)}}async function v(t){try{await o({groupId:e,chartKey:t})}catch(e){s.error(S(),e)}}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`oc-access__list`,children:c.map(e=>(0,Q.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Q.jsx)(J,{checked:e.selected,onCheckedChange:()=>void f(e.chartKey,e.selected),"aria-label":P({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":j(),title:j(),children:(0,Q.jsx)(W,{size:14,fill:`currentColor`})}):(0,Q.jsx)(H,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void p(e.chartKey),children:g()}):null,d?(0,Q.jsx)(H,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":h({name:e.name}),title:h({name:e.name}),onClick:()=>void v(e.chartKey),children:(0,Q.jsx)(je,{size:14,"aria-hidden":!0})}):null]},e.chartKey))}),d?l.length>0?(0,Q.jsxs)(Re,{value:``,onValueChange:e=>void _(e),children:[(0,Q.jsx)(Pe,{size:`sm`,className:`oc-access__search`,children:(0,Q.jsx)(Ke,{placeholder:x()})}),(0,Q.jsx)(qe,{children:l.map(e=>(0,Q.jsx)(Ie,{value:e.chartKey,children:e.name},e.chartKey))})]}):c.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:xe()}):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,$x as i,Ab as a,Ax as o,Bb as s,Bx as c,Cb as l,Cx as u,Db as d,Dx as f,E as p,Eb as m,Ex as h,Fb as g,Fx as _,Gb as v,Gj as y,Gx as b,Hb as x,Hj as S,Hx as ee,Ib as C,Ix as w,Jb as T,Ji as E,Jt as te,Jx as ne,Kb as re,Kx as ie,Lb as ae,Lx as oe,Mb as se,Mx as ce,Nb as le,Nx as ue,Ob as de,Ox as fe,Pb as pe,Px as me,Qb as he,Qx as ge,Rb as _e,Rx as ve,Sb as ye,Sx as be,Tb as xe,Tx as Se,Ub as Ce,Ux as we,Vb as Te,Vx as Ee,Wb as De,Wj as D,Wx as Oe,Xb as ke,Xi as Ae,Xt as je,Xx as Me,Yb as Ne,Yi as Pe,Yt as Fe,Yx as Ie,Zb as Le,Zi as Re,Zx as ze,_D as O,_x as Be,ax as Ve,bb as He,bx as k,cx as Ue,dx as We,eS as Ge,ex as Ke,fx as qe,gx as Je,hx as Ye,iS as Xe,ix as Ze,jb as Qe,jx as $e,kb as et,kx as tt,lx as nt,mg as rt,mx as A,nS as it,nx as at,ox as ot,pg as st,px as ct,qb as lt,qx as ut,rS as dt,rx as ft,sx as pt,tS as mt,tx as ht,ux as j,vD as M,vb as gt,vx as _t,wb as vt,wx as yt,xb as bt,xx as N,yb as P,yx as xt,zb as F,zx as St}from"./dist-CQKky_Rh.js";import{a as Ct,c as wt}from"./FieldLabel--ykPvwgz.js";import{t as I}from"./button-BZ2ghM2f.js";import{$ as Tt,C as L,H as R,S as z,U as Et,b as B,ct as V,dt as H,et as Dt,ft as U,ht as W,lt as G,mt as K,p as Ot,tt as kt,u as At,ut as jt,w as q,x as J}from"./index-BuqxeAUW.js";import{t as Mt}from"./DataTableShell-q5ZC3kNL.js";import{InstanceConfigDialog as Nt}from"./BridgeTab-CNu53hNw.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:Ct},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=y(p.admin.listInstances,{}),t=y(p.agents.listAllInstanceAgents,{}),n=D(p.admin.upsertInstance),r=D(p.admin.deleteInstance),a=R(),[s,l]=(0,Y.useState)(!1),[u,d]=(0,Y.useState)(Q),[m,h]=(0,Y.useState)(null),[g,v]=(0,Y.useState)(null),[x,S]=(0,Y.useState)(null),[C,T]=(0,Y.useState)(null);async function E(){try{await n({instanceId:C??void 0,name:u.name,gatewayUrl:u.gatewayUrl,bridgeUrl:u.bridgeUrl||void 0,displayName:u.displayName||void 0,kind:u.kind,transport:u.kind===`hermes`?u.transport:void 0,gatewayVersion:u.gatewayVersion||void 0,gatewayHttpUrl:u.gatewayHttpUrl||void 0,streamTransport:u.streamTransport}),d(Q),T(null),l(!1)}catch(e){a.error(it(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[mt(),(0,Z.jsx)(`strong`,{children:Ge()}),i()]}),(0,Z.jsx)(Mt,{title:ge(),rows:e,addLabel:ze(),onAdd:()=>{T(null),d(Q),l(!0)},emptyHint:Me(),columns:[{header:Ie(),cell:e=>e.name,sort:e=>e.name},{header:ne(),cell:e=>(0,Z.jsx)(V,{variant:`outline`,children:e.kind??`openclaw`}),sort:e=>e.kind??`openclaw`},{header:ut(),cell:e=>e.gatewayUrl,sort:e=>e.gatewayUrl},{header:ie(),cell:e=>e.displayName??`—`,sort:e=>e.displayName??null},{header:Xe(),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)(V,{variant:r(e.agentId)?`default`:`outline`,title:r(e.agentId)?P():void 0,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]},e.agentId))})}}],rowActions:e=>[{label:ee(),onSelect:()=>{T(e._id),d(Rt(e)),l(!0)}},{label:dt(),onSelect:()=>h(e.name)},{label:f(),onSelect:()=>S(e)},{label:b(),onSelect:()=>v(e)},{label:Oe(),variant:`destructive`,onSelect:()=>void r({instanceId:e._id})}],bulkActions:[{label:Oe(),variant:`destructive`,onSelect:e=>e.forEach(e=>void r({instanceId:e}))}]}),(0,Z.jsx)(At,{open:s,onOpenChange:l,title:C?Ee():we(),description:St(),canSubmit:!!(u.name&&u.gatewayUrl),onSubmit:E,submitLabel:ve(),children:(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsxs)($,{label:oe(),children:[(0,Z.jsx)(G,{value:u.name,disabled:C!==null,onChange:e=>d({...u,name:e.target.value})}),C?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:c()}):null]}),(0,Z.jsx)($,{label:w(),children:(0,Z.jsxs)(B,{value:u.kind,onValueChange:e=>d({...u,kind:e}),children:[(0,Z.jsx)(L,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(q,{})}),(0,Z.jsxs)(J,{children:[(0,Z.jsx)(z,{value:`openclaw`,children:`OpenClaw`}),(0,Z.jsx)(z,{value:`hermes`,children:`Hermes`})]})]})}),u.kind===`hermes`?(0,Z.jsx)($,{label:je(),children:(0,Z.jsxs)(B,{value:u.transport,onValueChange:e=>d({...u,transport:e}),children:[(0,Z.jsx)(L,{size:`sm`,className:`w-56`,children:(0,Z.jsx)(q,{})}),(0,Z.jsxs)(J,{children:[(0,Z.jsx)(z,{value:`ws`,children:Fe()}),(0,Z.jsx)(z,{value:`rest`,children:te()})]})]})}):null,(0,Z.jsx)($,{label:_(),children:(0,Z.jsx)(G,{value:u.gatewayUrl,onChange:e=>d({...u,gatewayUrl:e.target.value})})}),(0,Z.jsx)($,{label:me(),children:(0,Z.jsx)(G,{value:u.bridgeUrl,placeholder:ue(),onChange:e=>d({...u,bridgeUrl:e.target.value})})}),(0,Z.jsx)($,{label:ce(),children:(0,Z.jsx)(G,{value:u.displayName,onChange:e=>d({...u,displayName:e.target.value})})}),(0,Z.jsxs)($,{label:rt(),children:[(0,Z.jsxs)(B,{value:u.streamTransport,onValueChange:e=>d({...u,streamTransport:e}),children:[(0,Z.jsx)(L,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(q,{})}),(0,Z.jsx)(J,{children:wt.map(e=>(0,Z.jsx)(z,{value:e,children:e},e))})]}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:st()})]}),(0,Z.jsx)($,{label:$e(),children:(0,Z.jsx)(G,{value:u.gatewayVersion,placeholder:o(),onChange:e=>d({...u,gatewayVersion:e.target.value})})}),(0,Z.jsx)($,{label:tt(),children:(0,Z.jsx)(G,{value:u.gatewayHttpUrl,placeholder:fe(),onChange:e=>d({...u,gatewayHttpUrl:e.target.value})})})]})}),(0,Z.jsx)(Yt,{instanceName:m,open:m!==null,onOpenChange:e=>{e||h(null)}}),g?(0,Z.jsx)(Nt,{instance:g,onClose:()=>v(null)},g._id):null,x?(0,Z.jsx)(Bt,{instance:x,onClose:()=>S(null)},x._id):null]})}function Bt({instance:e,onClose:t}){let n=y(p.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)(jt,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(H,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(K,{children:[(0,Z.jsx)(W,{children:h({instance:e.displayName??e.name})}),(0,Z.jsx)(U,{children:Se()})]}),(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=S(p.instanceSync.forceInstanceSync),n=R(),[i,a]=(0,Y.useState)(!1);async function o(){if(!i){a(!0);try{switch((await t({instanceId:e._id})).status){case`synced`:n.success(Ve());break;case`no_agents`:n.success(ft());break;case`no_bridge_url`:n.error(at());break;case`deploy_misconfigured`:n.error(ht());break;case`unauthorized`:n.error(r());break;case`not_served`:n.error(he());break;default:n.error(Ke());break}}catch(e){n.error(Ze(),e)}finally{a(!1)}}}return(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Le()}),(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(I,{size:`sm`,variant:`outline`,onClick:()=>void o(),disabled:i,children:i?ot():pt()})})]})}function Ht({instance:e}){let t=y(p.bridgeAuth.listBridgeAuthStatus,{}),n=S(p.bridgeAuth.mintBridgeSecret),r=D(p.bridgeAuth.revokeBridgeSecret),i=R(),[a,o]=(0,Y.useState)(!1),[s,c]=(0,Y.useState)(null),[l,u]=(0,Y.useState)(!1),d=(t??[]).find(t=>t.instanceId===e._id),f=d!==void 0;async function m(){if(!a){o(!0);try{c((await n({instanceId:e._id})).plaintext),u(!1)}catch(e){i.error(De(),e)}finally{o(!1)}}}async function h(){if(!a){o(!0);try{await r({instanceId:e._id}),c(null),i.success(v())}catch(e){i.error(De(),e)}finally{o(!1)}}}async function g(){if(s)try{await navigator.clipboard.writeText(s),u(!0)}catch{}}return(0,Z.jsxs)($,{label:ke(),children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Ne()}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(V,{variant:f?`outline`:`secondary`,children:f?`${N()} · ${d.prefix}…${d.lastFour}`:k()}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(I,{size:`sm`,onClick:()=>void m(),disabled:a,children:f?lt():T()}),f?(0,Z.jsx)(I,{size:`sm`,variant:`destructive`,onClick:()=>void h(),disabled:a,children:re()}):null]})]}),s?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`oc-sa__minted-warning`,children:Ce()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:s}),(0,Z.jsx)(I,{variant:`outline`,size:`sm`,onClick:()=>void g(),children:l?M():O()})]}),(0,Z.jsx)(I,{size:`sm`,variant:`ghost`,onClick:()=>{c(null),u(!1)},children:x()})]}):null]})}function Ut({instanceId:e,field:t,updatedAt:n}){let r=S(p.instanceSecrets.setInstanceSecret),i=D(p.instanceSecrets.clearInstanceSecret),a=S(p.deviceIdentity.generateDeviceIdentity),o=R(),[s,c]=(0,Y.useState)(``),[l,d]=(0,Y.useState)(!1),[f,m]=(0,Y.useState)(null),[h,g]=(0,Y.useState)(!1),_=n!==null,v=t===`deviceIdentity`,y=t===`token`?yt():t===`deviceIdentity`?u():be();async function b(){if(!(!s.trim()||l)){d(!0);try{await r({instanceId:e,field:t,plaintext:s}),c(``),m(null),g(!1),o.success(Ye())}catch(e){o.error(A(),e)}finally{d(!1)}}}async function ee(){if(!l){d(!0);try{await i({instanceId:e,field:t}),m(null),g(!1),o.success(ct())}catch(e){o.error(A(),e)}finally{d(!1)}}}async function C(){if(!l){d(!0);try{m(await a({instanceId:e})),g(!1),o.success(j())}catch(e){o.error(Ue(),e)}finally{d(!1)}}}let w=f?`openclaw devices approve ${f.id}`:``;async function T(){if(w)try{await navigator.clipboard.writeText(w),g(!0)}catch{}}return(0,Z.jsxs)($,{label:y,children:[v?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:We()}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(V,{variant:_?`outline`:`secondary`,children:_?N():k()}),(0,Z.jsx)(G,{type:`password`,autoComplete:`off`,className:`flex-1 min-w-32`,value:s,placeholder:_?_t():xt(),onChange:e=>c(e.target.value)}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(I,{size:`sm`,onClick:()=>void b(),disabled:l||s.trim().length===0,children:Be()}),v?(0,Z.jsx)(I,{size:`sm`,variant:`outline`,onClick:()=>void C(),disabled:l,children:qe()}):null,_?(0,Z.jsx)(I,{size:`sm`,variant:`destructive`,onClick:()=>void ee(),disabled:l,children:Je()}):null]})]}),f?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:j()}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:nt()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:w}),(0,Z.jsx)(I,{variant:`outline`,size:`sm`,onClick:()=>void T(),children:h?M():O()})]}),(0,Z.jsx)(I,{size:`sm`,variant:`ghost`,onClick:()=>{m(null),g(!1)},children:x()})]}):null]})}var Wt={conversational:pe,documentary:se,summarizer:Re,curator:Pe},Gt={conversational:le,documentary:Qe,summarizer:Ae,curator:E},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:_e()}),t.map(e=>(0,Z.jsx)(V,{variant:`secondary`,className:`oc-agenttype__chip`,title:qt(e),children:Kt(e)},e)),(0,Z.jsxs)(Tt,{children:[(0,Z.jsx)(kt,{asChild:!0,children:(0,Z.jsx)(I,{type:`button`,variant:`outline`,size:`sm`,className:`h-7`,children:ae()})}),(0,Z.jsxs)(Dt,{align:`start`,className:`oc-agenttypes-pop`,children:[(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__title`,children:C()}),(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__hint`,children:g()}),(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)(Ot,{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=y(p.agents.listAgentsForInstance,t&&e?{instanceName:e}:`skip`),i=D(p.agents.setAgentEnabled).withOptimisticUpdate((e,{instanceName:t,agentId:n,enabled:r})=>{let i=e.getQuery(p.agents.listAgentsForInstance,{instanceName:t});i&&e.setQuery(p.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,enabled:r}:e)})}),o=D(p.agents.setInstanceDefaultAgent).withOptimisticUpdate((e,{instanceName:t,agentId:n})=>{let r=e.getQuery(p.agents.listAgentsForInstance,{instanceName:t});r&&e.setQuery(p.agents.listAgentsForInstance,{instanceName:t},{...r,defaultAgentId:n})}),c=D(p.agents.setAgentTypes).withOptimisticUpdate((e,{instanceName:t,agentId:n,types:r})=>{let i=e.getQuery(p.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=It(r);e.setQuery(p.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,types:a}:e)})}),u=D(p.agents.removeInstanceAgent),f=Et(),h=R();async function g(t,n){if(e)try{await i({instanceName:e,agentId:t,enabled:n})}catch(e){h.error(F(),e)}}async function _(t){if(e)try{await o({instanceName:e,agentId:t})}catch(e){h.error(F(),e)}}async function v(t,n,r){if(!e)return;let i=r.includes(n)?r.filter(e=>e!==n):[...r,n];try{await c({instanceName:e,agentId:t,types:i})}catch(e){h.error(F(),e)}}async function b(t,n){if(e&&await f({title:de({name:n}),description:d(),confirmLabel:m(),destructive:!0}))try{await u({instanceName:e,agentId:t}),h.success(xe())}catch(e){h.error(F(),e)}}return(0,Z.jsx)(jt,{open:t,onOpenChange:n,children:(0,Z.jsxs)(H,{className:`oc-access`,children:[(0,Z.jsxs)(K,{children:[(0,Z.jsx)(W,{children:Te({name:e??``})}),(0,Z.jsx)(U,{children:s()})]}),r===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:vt()}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`oc-access__poll`,children:r.discovery===null?l():r.discovery.lastPollOk?ye():bt({error:r.discovery.error??`?`})}),r.agents.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:He()}):(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,o=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)(Ot,{checked:e.enabled,disabled:t,"aria-label":i,onCheckedChange:t=>void g(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)(V,{variant:`outline`,className:`oc-access__gone`,children:gt()}),(0,Z.jsx)(I,{size:`sm`,variant:`ghost`,className:`h-7 text-destructive`,onClick:()=>void b(e.agentId,i),children:et()})]}):n?(0,Z.jsx)(V,{variant:`default`,children:P()}):(0,Z.jsx)(I,{size:`sm`,variant:`outline`,className:`h-7`,disabled:!e.enabled,onClick:()=>void _(e.agentId),children:a()})]}),e.enabled?(0,Z.jsx)(Jt,{agentId:e.agentId,types:o,onToggle:t=>void v(e.agentId,t,o)}):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{BC as r,E as i,FC as a,GC as o,Gj as s,HC as c,Hj as l,IC as u,KC as d,LC as f,PC as p,RC as m,UC as h,VC as g,WC as _,Wj as v,_o as y,do as b,fo as x,go as S,ho as C,mo as w,po as T,qC as E,uo as D,vo as O,zC as k}from"./dist-CQKky_Rh.js";import{t as A}from"./button-BZ2ghM2f.js";import{ct as j,lt as M,p as N}from"./index-BuqxeAUW.js";var P=t(e(),1),F=n();function I(){let e=s(i.integrations.status.status,{}),t=v(i.admin.setIntegrationConfig),[n,l]=(0,P.useState)(null);if((0,P.useEffect)(()=>{e&&n===null&&l(e.config)},[e,n]),!e||!n)return(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:E()});let b=n,x=(e,t,n)=>l({...b,[e]:{...b[e],[t]:n}}),C=(e,n)=>void t({[e]:n});return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`p`,{className:`oc-admin__hint`,children:[d(),` `,(0,F.jsx)(`strong`,{children:o()}),` `,_()]}),(0,F.jsxs)(L,{title:`Langfuse`,status:e.langfuse.configured?e.langfuse.enabled?(0,F.jsx)(j,{variant:`secondary`,children:h()}):(0,F.jsx)(j,{variant:`outline`,children:c()}):(0,F.jsx)(j,{variant:`outline`,children:g()}),note:r(),children:[(0,F.jsx)(R,{label:m(),children:(0,F.jsx)(M,{value:b.langfuse.host??``,placeholder:e.langfuse.effectiveHost,onChange:e=>x(`langfuse`,`host`,e.target.value),onBlur:()=>C(`langfuse`,{host:b.langfuse.host??``})})}),(0,F.jsx)(z,{label:p(),checked:b.langfuse.enabled??!0,onChange:e=>{x(`langfuse`,`enabled`,e),C(`langfuse`,{enabled:e})}})]}),(0,F.jsxs)(L,{title:`Opik`,status:e.opik.configured?e.opik.enabled?(0,F.jsx)(j,{variant:`secondary`,children:h()}):(0,F.jsx)(j,{variant:`outline`,children:c()}):(0,F.jsx)(j,{variant:`outline`,children:g()}),note:k(),children:[(0,F.jsx)(R,{label:f(),children:(0,F.jsx)(M,{value:b.opik.baseUrl??``,placeholder:e.opik.effectiveBaseUrl,onChange:e=>x(`opik`,`baseUrl`,e.target.value),onBlur:()=>C(`opik`,{baseUrl:b.opik.baseUrl??``})})}),(0,F.jsx)(R,{label:u(),children:(0,F.jsx)(M,{value:b.opik.workspace??``,placeholder:e.opik.effectiveWorkspace||a(),onChange:e=>x(`opik`,`workspace`,e.target.value),onBlur:()=>C(`opik`,{workspace:b.opik.workspace??``})})}),(0,F.jsx)(z,{label:p(),checked:b.opik.enabled??!0,onChange:e=>{x(`opik`,`enabled`,e),C(`opik`,{enabled:e})}})]}),(0,F.jsxs)(L,{title:`OpenTelemetry (OTLP)`,status:e.otlp.configured?e.otlp.enabled?(0,F.jsx)(j,{variant:`secondary`,children:h()}):(0,F.jsx)(j,{variant:`outline`,children:c()}):(0,F.jsx)(j,{variant:`outline`,children:O()}),note:y(),children:[(0,F.jsx)(R,{label:S(),children:(0,F.jsx)(M,{value:b.otlp.endpoint??``,placeholder:e.otlp.effectiveEndpoint||`https://otlp.example.com/v1/traces`,onChange:e=>x(`otlp`,`endpoint`,e.target.value),onBlur:()=>C(`otlp`,{endpoint:b.otlp.endpoint??``})})}),(0,F.jsx)(B,{headersSet:e.otlp.headersSet}),(0,F.jsx)(z,{label:p(),checked:b.otlp.enabled??!0,onChange:e=>{x(`otlp`,`enabled`,e),C(`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=l(i.integrations.otlpSecret.setOtlpHeaders),n=v(i.integrations.otlpSecret.clearOtlpHeaders),[r,a]=(0,P.useState)(``),[o,s]=(0,P.useState)(null),[c,u]=(0,P.useState)(!1),d=async()=>{u(!0),s(null);try{await t({headersJson:r}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{u(!1)}};return(0,F.jsxs)(R,{label:C(),children:[(0,F.jsx)(M,{value:r,placeholder:e?w():T(),onChange:e=>a(e.target.value)}),(0,F.jsxs)(`div`,{className:`oc-int__otlp-headers-actions`,children:[(0,F.jsx)(A,{size:`sm`,disabled:c||r.trim().length===0,onClick:()=>void d(),children:x()}),e?(0,F.jsx)(A,{variant:`ghost`,size:`sm`,disabled:c,onClick:()=>void n({}),children:b()}):null]}),o?(0,F.jsx)(`p`,{className:`oc-int__otlp-headers-error`,children:o}):null,(0,F.jsx)(`p`,{className:`oc-uipa__note`,children:D()})]})}export{I as IntegrationsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$O as r,A as i,AO as a,BO as o,Cj as s,Dj as c,E as l,Ej as u,F as d,FO as f,G as p,GO as m,Gj as h,HO as ee,I as te,IO as ne,Ij as re,JO as ie,KO as ae,L as oe,LO as g,M as se,MO as _,N as v,NO as y,Oj as ce,P as le,PO as ue,QO as de,RO as fe,Rx as pe,Sj as me,Tj as b,UO as x,VO as S,WO as C,Wj as w,X as T,XO as E,YO as D,Z as O,ZO as k,ak as A,bj as j,ck as M,ek as N,ik as P,j as F,jO as I,jj as L,lk as R,n as z,nk as he,ok as ge,qO as _e,rk as ve,sk as ye,tk as be,uk as xe,vj as Se,wj as B,xj as Ce,yj as we,zO as V}from"./dist-CQKky_Rh.js";import{t as H}from"./button-BZ2ghM2f.js";import{C as Te,H as Ee,N as De,S as U,b as Oe,bt as ke,ct as W,lt as G,p as K,vt as Ae,w as je,x as Me,xt as q,yt as Ne}from"./index-BuqxeAUW.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:z(`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:z(`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:()=>xe()},{id:`composer`,label:()=>R()},{id:`sidebar`,label:()=>M()},{id:`other`,label:()=>ye()}],Z={showSource:{category:`messages`,label:()=>ge(),help:()=>A()},showReport:{category:`messages`,label:()=>P(),help:()=>ve()},copyAssistant:{category:`messages`,label:()=>he()},copyUser:{category:`messages`,label:()=>be()},showDelete:{category:`messages`,label:()=>N()},showTools:{category:`messages`,label:()=>r(),help:()=>de()},voiceInput:{category:`composer`,label:()=>k(),help:()=>E()},showUsage:{category:`composer`,label:()=>D(),help:()=>ie()},autoReadAloud:{category:`composer`,label:()=>O(),help:()=>T()},showChatAge:{category:`sidebar`,label:()=>_e(),help:()=>ae()},showChatProvider:{category:`sidebar`,label:()=>m(),help:()=>C()}};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:()=>ue()};function We({prefKey:e,ui:t}){let n=w(l.admin.setUiPrefDefault),r=w(l.admin.setFeatureEnabled),i=He(e),o=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:fe()}),(0,Y.jsxs)(Oe,{value:Be(t.defaults[e]),onValueChange:t=>void n({key:e,value:Ve(t)}),children:[(0,Y.jsx)(Te,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(je,{})}),(0,Y.jsxs)(Me,{children:[(0,Y.jsx)(U,{value:`on`,children:_()}),(0,Y.jsx)(U,{value:`off`,children:I()}),(0,Y.jsx)(U,{value:`inherit`,children:a()})]})]}),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":g()}),g()]}):null]}),o?(0,Y.jsx)(`span`,{className:`oc-prefs__gov-help`,children:o}):null]})}function Ge({current:e,enabled:t}){let n=w(l.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=Ne(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:[oe(),e?(0,Y.jsx)(W,{variant:`secondary`,children:ke(e,Ae())}):null]}),(0,Y.jsx)(`span`,{className:`oc-prefs__help`,children:o?le():r?d():te()})]}),(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:i()}):null,(0,Y.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,disabled:!t,"aria-pressed":r,onClick:()=>a(e=>!e),children:r?F():e?se():v()})]})]})}function Ke(){let[e,t]=(0,J.useState)(``),[n,r]=(0,J.useState)(!1),i=h(l.me.getMe,{host:q}),a=i?.ui,s=$(i?.role)&&n,c=w(l.me.setUiPref).withOptimisticUpdate(De),u=(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":V()}),V()]}):null,s?(0,Y.jsxs)(`div`,{className:`oc-prefs__gov-head`,children:[(0,Y.jsx)(`p`,{children:ne()}),(0,Y.jsx)(`p`,{children:f()}),(0,Y.jsx)(`p`,{children:y()})]}):null,(0,Y.jsx)(G,{value:e,onChange:e=>t(e.target.value),placeholder:x(),"aria-label":x(),className:`mb-2`}),u.length===0?(0,Y.jsx)(`div`,{className:`oc-prefs__empty`,children:ee()}):(0,Y.jsx)(`div`,{className:`oc-prefs`,children:u.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],l=a.effective[e],u=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:S()}):u?(0,Y.jsx)(W,{variant:`secondary`,children:p()}):null]}),r?(0,Y.jsx)(`span`,{className:`oc-prefs__help`,children:r}):null]}),(0,Y.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[!i&&u?(0,Y.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void c({key:e,value:null}),children:o()}):null,(0,Y.jsx)(Fe,{checked:l,disabled:i,onCheckedChange:t=>void c({key:e,value:t}),"aria-label":n})]}),s?(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:re()})}function qe(){let e=h(l.me.getMe,{host:q}),t=w(l.me.setLocale),n=w(l.me.setMyName),r=Ee(),i=e?.locale??`default`,a=e?.name??``,[o,d]=(0,J.useState)(null),f=o??a,p=f.trim()!==a.trim();async function m(){try{await n({name:f}),d(null),r.success(B())}catch(e){r.error(s(),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:ce()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:c()})]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(G,{className:`max-w-xs`,value:f,maxLength:120,placeholder:u(),onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`&&p&&(e.preventDefault(),m())}}),(0,Y.jsx)(H,{size:`sm`,disabled:!p,onClick:()=>void m(),children:pe()})]}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:b()})]}),(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:me()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:Ce()})]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[Pe().map(e=>(0,Y.jsx)(H,{variant:i===e.value?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:e.value}),children:e.label},e.value)),(0,Y.jsx)(H,{variant:i==="default"?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:null}),children:L()})]}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:j()})]}),(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:we()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:Se()})]}),(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{$h as r,$i as i,$t as a,E as o,Gh as s,Gj as c,Jh as l,Kh as u,Qh as d,Qi as f,Qt as p,Wj as m,Xh as h,Yh as g,Zh as _,Zt as ee,_g as v,_r as y,ag as b,cg as x,ea as S,eg as C,gr as te,hr as w,ig as T,lg as E,mr as ne,na as re,ng as ie,og as ae,pr as D,qh as O,rg as k,sg as A,ta as j,tg as M,ug as N,vg as P,vr as F}from"./dist-CQKky_Rh.js";import{d as I,f as L,i as R,l as z,n as B,r as V,t as H,u as U}from"./FieldLabel--ykPvwgz.js";import{t as W}from"./button-BZ2ghM2f.js";import{C as G,H as K,S as q,b as J,p as oe,w as Y,x as X,xt as se}from"./index-BuqxeAUW.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:b,help:T},documentary_fetch:{label:k,help:ie},inbound_files:{label:M,help:C},history_summary:{label:re,help:j},file_curation:{label:F,help:y}},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:O,references:u,files:s,previous_summary:S,new_messages:i,max_chars:f,file_name:te,budget_chars:w,feedback:ne,content:D};function pe(){let e=c(o.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:d()})});let i=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)(B,{label:N(),help:E()}),(0,$.jsxs)(`label`,{className:`oc-injtab__picker`,children:[(0,$.jsx)(`span`,{children:r()}),(0,$.jsxs)(J,{value:i._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)(q,{value:e._id,children:e.displayName??e.name},e._id))})]})]})]}),(0,$.jsx)(me,{instance:i},i._id)]})}function me({instance:e}){let t=m(o.admin.upsertInstanceConfig),n=K(),r=c(o.me.getMe,{host:se}),i=e.config??{},s=Z(e.config?.contentLocale,r?.defaultLocale??void 0),[l,u]=(0,Q.useState)(()=>R(i,s));(0,Q.useEffect)(()=>{u(R(i,s))},[s,e._id]);let[d,f]=(0,Q.useState)(!1),h=l.promptInjections,g=(e,t)=>u({...l,promptInjections:{...h,[e]:{...h[e],...t}}});async function _(){f(!0);try{await t({instanceId:e._id,config:V(l,i,s)})}catch(e){n.error(v(),e)}finally{f(!1)}}async function y(r){let i={...e.config??{}};r==="default"?delete i.contentLocale:i.contentLocale=r;try{await t({instanceId:e._id,config:i})}catch(e){n.error(v(),e)}}let b=e.config?.contentLocale??`default`,x=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:a()}),(0,$.jsxs)(J,{value:b,onValueChange:e=>void y(e),children:[(0,$.jsx)(G,{size:`sm`,className:`min-w-44`,children:(0,$.jsx)(Y,{})}),(0,$.jsxs)(X,{children:[(0,$.jsx)(q,{value:`default`,children:ee({locale:x})}),le().map(e=>(0,$.jsx)(q,{value:e.value,children:e.label},e.value))]})]}),(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:p()})]}),U.map(e=>(0,$.jsx)(he,{injKey:e,def:z[e],i18n:ue[e],row:h[e]??{enabled:!0,template:z[e].defaultTemplate[s]},contentLocale:s,onChange:t=>g(e,t)},e)),(0,$.jsx)(`div`,{className:`oc-injtab__actions`,children:(0,$.jsx)(W,{size:`sm`,onClick:()=>void _(),disabled:d,children:P()})})]})}function he({injKey:e,def:t,i18n:n,row:r,contentLocale:i,onChange:a}){let[o,s]=(0,Q.useState)(!1),c=r.template.trim()!==t.defaultTemplate[i],u=t.togglable&&!r.enabled,d=Object.fromEntries(t.placeholders.map(e=>[e,de[e]??`{${e}}`])),f=I(e,r,i),p=f?L(f,d):``;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)(oe,{checked:r.enabled,onCheckedChange:e=>a({enabled:e===!0})}),(0,$.jsx)(B,{label:n.label(),help:n.help()})]}):(0,$.jsx)(B,{label:n.label(),help:n.help()}),c&&(0,$.jsx)(`span`,{className:`oc-injection__badge`,children:A()})]}),(0,$.jsx)(`textarea`,{className:`oc-injcard__text`,value:r.template,disabled:u,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:ae()}),t.placeholders.map(e=>(0,$.jsxs)(`span`,{className:`oc-injcard__ph-chip`,children:[(0,$.jsx)(`code`,{children:`{${e}}`}),(0,$.jsx)(H,{text:(fe[e]??(()=>e))()})]},e))]}),(0,$.jsxs)(`div`,{className:`oc-injcard__btns`,children:[(0,$.jsx)(W,{variant:`ghost`,size:`sm`,onClick:()=>s(e=>!e),children:o?h():_()}),c&&(0,$.jsx)(W,{variant:`ghost`,size:`sm`,onClick:()=>a({template:t.defaultTemplate[i]}),children:x()})]})]}),o&&(0,$.jsx)(`div`,{className:`oc-injcard__preview`,children:p?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`pre`,{className:`oc-injcard__previewtext`,children:p}),(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:g()})]}):(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:l()})})]})}export{pe as PromptInjectionsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$y as r,Ay as ee,By as i,Dy as a,E as o,Fy as te,Gj as s,Gy as c,Hr as l,Hy as u,Iy as ne,Jy as d,Ky as f,Ly as re,My as p,Ny as m,Oy as h,Py as g,Qy as _,Ry as v,Uy as y,Vy as ie,Wj as b,Wy as x,Xy as S,Yy as C,Zy as w,_y as T,by as E,eb as D,gy as O,hy as k,jy as A,ky as j,my as M,nb as N,py as P,qy as F,tb as I,vy as L,xy as R,yy as ae,zy as z}from"./dist-CQKky_Rh.js";import{t as B}from"./button-BZ2ghM2f.js";import{H as V,Rt as H,U,ct as W,lt as G,p as K,u as q}from"./index-BuqxeAUW.js";import{t as J}from"./roleDescriptions-Bkj7WtCA.js";var Y=t(e(),1),X=n(),Z=[{group:()=>N(),keys:[{key:`traces.read`,label:()=>w()},{key:`traces.read.content`,label:()=>S(),phi:!0},{key:`traces.write`,label:()=>C()}]},{group:()=>I(),keys:[{key:`kpi.read`,label:()=>w()},{key:`kpi.write`,label:()=>C()}]},{group:()=>D(),keys:[{key:`openclaw.query`,label:()=>d()},{key:`anomalies.read`,label:()=>F()},{key:`anomalies.report`,label:()=>f()}]},{group:()=>r(),keys:[{key:`chats.read`,label:()=>w()},{key:`selfheal`,label:()=>x()},{key:`feedback.respond`,label:()=>l()}]},{group:()=>_(),keys:[{key:`admin.manage`,label:()=>c()}]}],oe=Z.flatMap(e=>e.keys.map(e=>e.key));function Q(e){return e.includes(`*`)}var $={key:``,name:``,description:``};function se(){let e=s(o.apiKeys.listRoles,{}),t=b(o.apiKeys.createRole),n=b(o.apiKeys.ensureRolesSeeded),r=b(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))}),c=U(),l=V(),[d,f]=(0,Y.useState)(!1),[_,x]=(0,Y.useState)($),[S,C]=(0,Y.useState)(new Set);(0,Y.useEffect)(()=>{n({}).catch(e=>{l.error(u(),e)})},[n,l]);let w=e??[];async function D(e,t){if(Q(e.permissions)||S.has(e._id))return;let n=e.permissions.includes(t)?e.permissions.filter(e=>e!==t):[...e.permissions,t];if(!(e.builtin&&!await c({title:ie({name:e.name}),description:i(),confirmLabel:z()}))){C(t=>new Set(t).add(e._id));try{await r({roleId:e._id,permissions:n})}catch(e){l.error(v(),e)}finally{C(t=>{let n=new Set(t);return n.delete(e._id),n})}}}async function N(){try{await t({key:_.key,name:_.name,description:_.description||void 0,permissions:[]}),x($),f(!1)}catch(e){l.error(re(),e)}}let F=e===void 0,I=!F&&w.length===0;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`oc-admin__hint`,children:[ne(),` `,(0,X.jsx)(`code`,{children:`admin`}),` `,te(),` `,(0,X.jsx)(`code`,{children:`traces.read.content`}),` `,g()]}),(0,X.jsxs)(`div`,{className:`oc-dt`,children:[(0,X.jsxs)(`div`,{className:`oc-dt__bar`,children:[(0,X.jsx)(`h2`,{className:`oc-dt__title`,children:m()}),(0,X.jsx)(`div`,{className:`oc-dt__bar-actions`,children:(0,X.jsx)(B,{size:`sm`,onClick:()=>{x($),f(!0)},children:p()})})]}),F?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:A()}):I?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:ee()}):(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:j()}),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:w.map(e=>{let t=Q(e.permissions),n=S.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)(W,{variant:`outline`,className:`gap-1`,children:[(0,X.jsx)(H,{}),` `,h()]}):(0,X.jsx)(W,{variant:`secondary`,children:a()})]}),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)(K,{checked:t||e.permissions.includes(r),disabled:t||n,"aria-label":`${e.key} · ${r}`,title:t?R():n?E():r,onCheckedChange:()=>void D(e,r)})},r))]},e.key)})})]})})]}),(0,X.jsx)(q,{open:d,onOpenChange:f,title:ae(),description:L(),canSubmit:!!(_.key&&_.name),onSubmit:N,submitLabel:T(),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:O()}),(0,X.jsx)(G,{value:_.key,placeholder:k(),onChange:e=>x({..._,key:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:M()}),(0,X.jsx)(G,{value:_.name,onChange:e=>x({..._,name:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:P()}),(0,X.jsx)(G,{value:_.description,onChange:e=>x({..._,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,AD as i,BD as ee,CD as a,CO as te,DD as o,DO as ne,E as s,ED as re,EO as ie,FD as ae,GD as oe,Gj as c,HD as se,Hj as ce,ID as le,JD as ue,KD as de,LD as fe,MD as l,ND as pe,OD as u,OO as me,PD as he,QD as ge,RD as _e,SD as d,SO as ve,TD as f,TO as ye,UD as be,VD as xe,WD as Se,Wj as p,XD as Ce,YD as we,ZD as Te,_D as m,_O as Ee,aO as De,bD as h,bO as Oe,cO as ke,dD as g,dO as Ae,eO as je,fD as _,fO as Me,gD as v,gO as Ne,hD as y,hO as Pe,iO as Fe,jD as b,kD as x,kO as Ie,lD as S,lO as Le,mD as C,mO as Re,nO as ze,oO as Be,pD as w,pO as Ve,qD as He,rO as Ue,sO as We,tO as Ge,uD as T,uO as Ke,vD as E,vO as qe,wD as D,wO as O,xD as k,xO as Je,yD as A,yO as Ye,zD as Xe}from"./dist-CQKky_Rh.js";import{n as j}from"./dist-Dp0-U7Ca.js";import{i as Ze}from"./dist-C6Yu7C_m.js";import{t as M}from"./button-BZ2ghM2f.js";import{A as N,C as P,H as Qe,S as F,U as $e,Wt as I,Xt as et,Yt as tt,b as L,ct as R,dt as z,ft as B,ht as V,j as H,lt as nt,mt as rt,pt as it,qt as at,u as ot,ut as U,w as W,x as G}from"./index-BuqxeAUW.js";import{t as st}from"./FilterBar-Bjp3W3-O.js";import{t as ct}from"./DataTableShell-q5ZC3kNL.js";import{t as lt}from"./roleDescriptions-Bkj7WtCA.js";var K=t(e(),1),q=n(),J=[{value:`never`,label:()=>y(),days:null},{value:`30`,label:()=>C(),days:30},{value:`90`,label:()=>w(),days:90}],Y=720*60*60*1e3,X=`__all__`,Z={name:``,roleKey:``,description:``};function Q(){let e=et({from:`/settings/serviceAccounts`}),t=tt({from:`/settings/serviceAccounts`}),n=e.q??``,i=e.status??X,[a,o]=(0,K.useState)(X),re=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),l=e=>void t({search:t=>({...t,status:e===X?void 0:e})}),u=c(s.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:a===X?void 0:a,disabled:i===X?void 0:i===`disabled`}}),d=c(s.apiKeys.listKeys,{}),f=c(s.apiKeys.listRoles,{}),m=p(s.apiKeys.createServiceAccount),h=p(s.apiKeys.updateServiceAccount),g=p(s.apiKeys.deleteServiceAccount),_=ce(s.apiKeys.mintApiKey),v=p(s.apiKeys.revokeApiKey),y=$e(),b=Qe(),x=n!==``||a!==X||i!==X;function S(){o(X),t({search:{},replace:!0})}let[C,w]=(0,K.useState)(!1),[T,E]=(0,K.useState)(Z),[D,k]=(0,K.useState)(null),[A,j]=(0,K.useState)(new Set),[N,I]=(0,K.useState)(null),z=(0,K.useRef)(!1),[B,V]=(0,K.useState)(new Set),[H,rt]=(0,K.useState)({}),[it,U]=(0,K.useState)(null),Y=(0,K.useMemo)(()=>{let e=new Map;for(let t of d??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[d]);function Q(e){j(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function ft(){try{D?(await h({serviceAccountId:D,name:T.name,roleKey:T.roleKey,description:T.description}),b.success(He())):await m({name:T.name,roleKey:T.roleKey,description:T.description||void 0}),E(Z),k(null),w(!1)}catch(e){b.error(D?ue():we(),e)}}function pt(e){E({name:e.name,roleKey:e.roleKey,description:e.description??``}),k(e._id),w(!0)}async function mt(e){if(z.current)return;z.current=!0;let t=H[e._id]??`never`,n=J.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;I(e._id);try{let t=await _({serviceAccountId:e._id,expiresAt:r});U({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){b.error(de(),e)}finally{z.current=!1,I(null)}}async function $(e){if(await y({title:oe(),description:(0,q.jsxs)(q.Fragment,{children:[Se(),` `,(0,q.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,be(),` `,(0,q.jsx)(`strong`,{children:se()}),` `,xe()]}),confirmWord:e.name,confirmLabel:ee(),destructive:!0}))try{await g({serviceAccountId:e._id}),b.success(Xe(),e.name)}catch(e){b.error(_e(),e)}}async function ht(e){if(await y({title:fe(),description:(0,q.jsxs)(q.Fragment,{children:[le(),` `,(0,q.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,ae()]}),confirmLabel:he(),destructive:!0})&&!B.has(e._id)){V(t=>new Set(t).add(e._id));try{await v({keyId:e._id})}catch(e){b.error(pe(),e)}finally{V(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`oc-admin__hint`,children:Ie()}),(0,q.jsxs)(st,{q:n,onQChange:re,searchPlaceholder:me(),onReset:S,canReset:x,children:[(0,q.jsxs)(L,{value:a,onValueChange:o,children:[(0,q.jsx)(P,{size:`sm`,className:`w-40`,children:(0,q.jsx)(W,{placeholder:ne()})}),(0,q.jsxs)(G,{children:[(0,q.jsx)(F,{value:X,children:ie()}),(f??[]).map(e=>(0,q.jsx)(F,{value:e.key,children:e.key},e._id))]})]}),(0,q.jsxs)(L,{value:i,onValueChange:l,children:[(0,q.jsx)(P,{size:`sm`,className:`w-36`,children:(0,q.jsx)(W,{})}),(0,q.jsxs)(G,{children:[(0,q.jsx)(F,{value:X,children:ye()}),(0,q.jsx)(F,{value:`active`,children:O()}),(0,q.jsx)(F,{value:`disabled`,children:te()})]})]})]}),(0,q.jsx)(ct,{title:ve(),rows:u,addLabel:Je(),onAdd:()=>{E(Z),k(null),w(!0)},emptyHint:Oe(),isExpanded:e=>A.has(e._id),renderExpanded:e=>(0,q.jsx)(ut,{account:e,keys:Y.get(e._id)??[],onRevoke:ht,revoking:B}),rowActions:e=>[{label:Ne(),onSelect:()=>pt(e)},{label:Ye(),onSelect:()=>void mt(e)},{label:A.has(e._id)?qe():Ee(),onSelect:()=>Q(e._id)},{label:Pe(),variant:`destructive`,onSelect:()=>void $(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,q.jsx)(M,{variant:`ghost`,size:`icon-sm`,"aria-label":A.has(e._id)?Re():Ve(),onClick:()=>Q(e._id),children:A.has(e._id)?(0,q.jsx)(Ze,{}):(0,q.jsx)(at,{})})},{header:Me(),sort:e=>e.name,cell:e=>(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`span`,{children:e.name}),e.description?(0,q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:Ae(),sort:e=>e.roleKey,cell:e=>(0,q.jsx)(R,{variant:`secondary`,children:e.roleKey})},{header:Ke(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,q.jsx)(R,{variant:`destructive`,children:te()}):(0,q.jsx)(R,{variant:`outline`,children:O()})},{header:Le(),cell:e=>(0,q.jsxs)(L,{value:H[e._id]??`never`,onValueChange:t=>rt(n=>({...n,[e._id]:t})),children:[(0,q.jsx)(P,{size:`sm`,className:`w-32`,children:(0,q.jsx)(W,{})}),(0,q.jsx)(G,{children:J.map(e=>(0,q.jsx)(F,{value:e.value,children:e.label()},e.value))})]})},{header:ke(),sort:e=>(Y.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(Y.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,q.jsx)(`span`,{className:`oc-sa__keycount`,children:N===e._id?We():Be({count:t})})}}]}),(0,q.jsx)(ot,{open:C,onOpenChange:e=>{w(e),e||k(null)},title:D?De():ze(),description:D?Fe():Ge(),canSubmit:!!(T.name&&T.roleKey),onSubmit:ft,submitLabel:D?Ue():je(),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:r()}),(0,q.jsx)(nt,{value:T.name,onChange:e=>E({...T,name:e.target.value})})]}),(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:ge()}),(0,q.jsxs)(L,{value:T.roleKey||void 0,onValueChange:e=>E({...T,roleKey:e}),children:[(0,q.jsx)(P,{className:`w-full`,children:(0,q.jsx)(W,{placeholder:Te()})}),(0,q.jsx)(G,{children:(f??[]).map(e=>(0,q.jsxs)(F,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(f??[]).find(e=>e.key===T.roleKey),t=e?lt(e):null;return t?(0,q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:Ce()}),(0,q.jsx)(nt,{value:T.description,onChange:e=>E({...T,description:e.target.value})})]})]})}),(0,q.jsx)(dt,{minted:it,onClose:()=>U(null)})]})}function ut({account:e,keys:t,onRevoke:n,revoking:r}){return(0,q.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,q.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[l(),` `,(0,q.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,q.jsx)(`p`,{className:`oc-admin__hint`,children:b()}):(0,q.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,q.jsx)(`thead`,{children:(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`th`,{children:i()}),(0,q.jsx)(`th`,{children:x()}),(0,q.jsx)(`th`,{children:u()}),(0,q.jsx)(`th`,{children:o()}),(0,q.jsx)(`th`,{children:re()}),(0,q.jsx)(`th`,{children:f()}),(0,q.jsx)(`th`,{})]})}),(0,q.jsx)(`tbody`,{children:t.map(t=>(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`td`,{children:(0,q.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,q.jsx)(`td`,{children:(0,q.jsx)(R,{variant:`secondary`,children:e.roleKey})}),(0,q.jsx)(`td`,{children:H(t.createdAt)}),(0,q.jsx)(`td`,{className:ft(t.lastUsedAt)?`oc-sa__stale`:``,children:pt(t.lastUsedAt)}),(0,q.jsx)(`td`,{children:mt(t.expiresAt)}),(0,q.jsx)(`td`,{children:$(t)}),(0,q.jsx)(`td`,{className:`text-right`,children:t.disabled?null:(0,q.jsx)(M,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?D():a()})})]},t._id))})]})]})}function dt({minted:e,onClose:t}){let[n,r]=(0,K.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,q.jsx)(U,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,q.jsxs)(z,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,q.jsxs)(rt,{children:[(0,q.jsx)(V,{children:d()}),(0,q.jsx)(B,{children:k({name:e.accountName})})]}),(0,q.jsx)(`div`,{className:`oc-sa__minted-warning`,children:h()}),(0,q.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,q.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,q.jsxs)(M,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":A(),children:[n?(0,q.jsx)(j,{}):(0,q.jsx)(I,{}),n?E():m()]})]}),(0,q.jsx)(it,{children:(0,q.jsx)(M,{onClick:()=>{r(!1),t()},children:v()})})]}):null})}function ft(e){return e===null?!1:Date.now()-e>Y}function pt(e){return e===null?_():H(e)}function mt(e){return e===null?`—`:N(e)}function $(e){return e.disabled?(0,q.jsx)(R,{variant:`destructive`,children:g()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,q.jsx)(R,{variant:`outline`,children:T()}):(0,q.jsx)(R,{variant:`outline`,children:S()})}export{Q as ServiceAccountsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Aa as r,Ba as i,Ca as a,Da as o,E as s,Ea as c,Fa as l,Ga as u,Gj as d,Ha as f,Ia as p,La as m,Ma as h,Na as g,Oa as _,Pa as v,Ra as y,Sa as b,Ta as x,Ua as S,Va as C,Wa as w,Wj as T,_a as E,ba as D,ca as O,da as k,fa as A,ga as j,ha as M,ja as N,ka as P,la as F,ma as I,pa as ee,sa as L,ua as R,va as z,wa as B,xa as V,ya as H,za as U}from"./dist-CQKky_Rh.js";import{t as W}from"./button-BZ2ghM2f.js";import{U as G,j as K}from"./index-BuqxeAUW.js";import{t as q}from"./DataTableShell-q5ZC3kNL.js";var J=t(e(),1),Y=n(),X={hung:()=>_(),wrong_result:()=>o(),error:()=>c(),other:()=>x()},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=T(s.subAgentReports.respondToReport),[r,i]=(0,J.useState)(e.thread),[o,c]=(0,J.useState)(``),[l,u]=(0,J.useState)(!1);async function d(){let t=o.trim();if(!(!t||l)){u(!0);try{await n({reportId:e._id,text:t}),i(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),c(``)}finally{u(!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),` · `,B({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:a()}),(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:b()}),r.length>0?(0,Y.jsx)(`div`,{className:`oc-fbadmin__thread`,children:r.map((e,t)=>(0,Y.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,Y.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?V():D()}),(0,Y.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Y.jsx)(`p`,{className:`oc-fbadmin__meta`,children:H()}),(0,Y.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:z(),value:o,maxLength:2e3,rows:3,onChange:e=>c(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 d(),disabled:!o.trim()||l,children:l?j():E()})})]}),(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[M({count:t.children.length}),t.childrenTruncated?` ${I()}`:``,t.textTruncated?` ${ee()}`:``]}),(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?` · ${A()}`:``]}),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:k()}),(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:R()}),(0,Y.jsx)(`p`,{className:`oc-fbadmin__env`,children:[t.parentStatus?`status: ${t.parentStatus}`:null,t.parentErrorCode?`code: ${t.parentErrorCode}`:null,t.parentRunId?`run ${t.parentRunId.slice(0,12)}…`:null,e.correlationId?`corr ${e.correlationId.slice(0,16)}…`:null,t.openclawProvider].filter(Boolean).join(` · `)||`—`})]})]})}function te(){let e=d(s.subAgentReports.listForAdmin,{}),t=T(s.subAgentReports.readReport),n=T(s.subAgentReports.deleteReport),a=G(),[o,c]=(0,J.useState)(null),[_,b]=(0,J.useState)({});async function x(e){if(o===e._id){c(null);return}if(!_[e._id]){let n=await t({reportId:e._id});b(t=>({...t,[e._id]:n}))}c(e._id)}async function E(e){await a({title:F(),description:O(),confirmLabel:L(),destructive:!0})&&(await n({reportId:e._id}),o===e._id&&c(null))}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[S(),` `,(0,Y.jsx)(`strong`,{children:f()}),` `,C()]}),(0,Y.jsx)(q,{title:u(),rows:e,emptyHint:w(),isExpanded:e=>o===e._id&&!!_[e._id],renderExpanded:e=>_[e._id]?(0,Y.jsx)($,{data:_[e._id]}):null,columns:[{header:i(),cell:e=>K(e.at),sort:e=>e.at},{header:U(),cell:e=>Z(e.category),sort:e=>Z(e.category)},{header:y(),cell:e=>`${e.failedCount}/${e.totalCount}`,sort:e=>e.failedCount},{header:m(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${v({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:p(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:l(),cell:e=>e.answered?(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:g()}):(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill`,children:h()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:o===e._id?r():N(),onSelect:()=>void x(e)},{label:P(),onSelect:()=>void E(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{$k as r,AA as i,Ak as a,Bk as o,CA as s,Ck as c,D as l,DA as u,Dk as d,E as f,EA as p,Ek as m,Fk as h,Gj as g,Gk as _,Hj as v,Hk as y,Ik as ee,Jk as te,Kk as ne,Lk as re,MA as ie,Mj as ae,Mk as oe,NA as se,Nj as ce,Nk as le,OA as ue,Ok as de,Pj as fe,Pk as pe,Qk as me,Rk as he,SA as ge,Sk as _e,TA as ve,Tk as ye,Uk as be,Vk as xe,Wj as b,Wk as Se,Xk as x,Yk as Ce,Zk as we,_A as Te,_k as Ee,aA as De,aa as S,bA as Oe,bk as ke,cA as Ae,dA as je,dk as Me,eA as Ne,fA as Pe,fk as Fe,gA as Ie,gk as Le,hA as Re,hk as C,iA as ze,ia as Be,jA as Ve,jk as He,kA as Ue,kk as We,lA as Ge,mA as Ke,mk as qe,n as Je,nA as Ye,oA as Xe,oa as w,pA as Ze,pk as Qe,qk as $e,rA as et,ra as tt,sA as nt,tA as rt,uA as it,vA as at,vk as ot,wA as st,wk as ct,xA as lt,xk as ut,yA as dt,yk as T,zk as ft}from"./dist-CQKky_Rh.js";import{n as E}from"./dist-Dp0-U7Ca.js";import{t as D}from"./x-Do-PZuRM.js";import{t as O}from"./button-BZ2ghM2f.js";import{C as k,Ht as A,S as j,Ut as pt,_t as mt,at as ht,b as M,ct as N,gt,it as P,lt as F,nt as _t,ot as I,p as L,rt as vt,st as yt,w as R,x as z,xt as B}from"./index-BuqxeAUW.js";import{t as bt}from"./localePickerView-C2RmOS86.js";import{a as xt,i as St,n as Ct,o as wt,r as Tt,t as Et}from"./card-CDvtHf5l.js";import{a as Dt,i as V,n as Ot,o as H,r as U,t as kt}from"./table-IXupQ5w1.js";import{t as At}from"./TimeRangePicker-DyTyIIGL.js";import{t as jt}from"./FilterBar-Bjp3W3-O.js";import{t as Mt}from"./AdvancedFilter-BwM0tgcf.js";var W=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`}]]),G=t(e(),1),Nt=.1,Pt=[248,248,248],Ft=[24,24,24];function It(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 Lt(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 K(e,t,n){return Lt(e,t,n)>=Nt}function Rt(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 zt(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 Bt=12*1024*1024,Vt=480,Ht=160,Ut=.92;async function Wt(e,t={}){if(!e.type.startsWith(`image/`))throw Error(pe());if(e.size>Bt)throw Error(le());let{source:n,width:r,height:i,cleanup:o}=await Gt(e);try{let o=e.type===`image/svg+xml`,s=Math.min(Vt/r,Ht/i,o?1/0:1),c=Math.max(1,Math.round(r*s)),l=Math.max(1,Math.round(i*s)),u=document.createElement(`canvas`);u.width=c,u.height=l;let d=u.getContext(`2d`);if(!d)throw Error(He());d.imageSmoothingEnabled=!0,d.imageSmoothingQuality=`high`,d.drawImage(n,0,0,c,l);let f=It(d.getImageData(0,0,c,l).data,c,l)??{x:0,y:0,width:c,height:l},p=document.createElement(`canvas`);p.width=f.width,p.height=f.height;let m=p.getContext(`2d`);if(!m)throw Error(He());if(m.drawImage(u,f.x,f.y,f.width,f.height,0,0,f.width,f.height),t.variantFor){let e=m.getImageData(0,0,f.width,f.height);K(e.data,f.width,f.height)?Rt(e.data,t.variantFor===`dark`?Pt:Ft):zt(e.data),m.putImageData(e,0,0)}let h=K(m.getImageData(0,0,f.width,f.height).data,f.width,f.height),g=await J(p,`image/webp`,Ut)??await J(p,`image/png`);if(!g)throw Error(a());return{blob:g,hasAlpha:h}}finally{o()}}async function Gt(e){if(e.type===`image/svg+xml`)return q(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 q(e)}async function q(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(oe())),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 J(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var Y=n();function Kt(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 X=`__all__`,Z={kind:`relative`,from:`now-24h`,to:`now`},qt=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function Q({title:e,description:t,children:n}){return(0,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:e}),t?(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,Y.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function Jt(e){return e===`light`?fe():e===`dark`?ce():ae()}var Yt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Xt({tokens:e,mode:t}){let n=e.colors[t];return(0,Y.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Yt.map(e=>{let t=n[e];return(0,Y.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function $({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:o}){return(0,Y.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,Y.jsxs)(`button`,{type:`button`,className:Je(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,Y.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,Y.jsx)(E,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,Y.jsx)(Xt,{tokens:r,mode:i}):(0,Y.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,Y.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,Y.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,Y.jsx)(O,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":w(),title:w(),children:(0,Y.jsx)(pt,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=g(f.charts.listMyCharts),r=b(f.charts.setMyChart);async function i(e){try{await r({name:e})}catch{}}return(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:st()})]}),(0,Y.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,Y.jsx)($,{selected:e===null,title:s(),subtitle:ge(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?lt():n.via===`owner`?Oe():dt({group:n.via.group});return(0,Y.jsx)($,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void i(n.key),onExport:()=>Kt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:at()}):null]})}function Qt(){let e=b(f.charts.importChart),[t,n]=(0,G.useState)(``),[i,a]=(0,G.useState)(``),[o,s]=(0,G.useState)(null),[c,l]=(0,G.useState)(!1),[u,d]=(0,G.useState)(!1);async function p(e){let t=e.target.files?.[0];if(e.target.value=``,t){s(null),l(!1);try{a(await t.text())}catch{s(x())}}}async function m(){if(s(null),l(!1),t.trim()===``){s(te());return}let r;try{r=JSON.parse(i)}catch{s(x());return}d(!0);try{await e({name:t.trim(),tokens:r}),l(!0),n(``),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{d(!1)}}return(0,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:ze()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:et()})]}),(0,Y.jsxs)(`div`,{className:`oc-chart-import`,children:[(0,Y.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-import__label`,children:Ye()}),(0,Y.jsx)(F,{value:t,onChange:e=>n(e.target.value),placeholder:rt(),maxLength:60})]}),(0,Y.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-import__label`,children:Ne()}),(0,Y.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:i,onChange:e=>a(e.target.value),placeholder:r(),rows:8,spellCheck:!1})]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(O,{variant:`outline`,size:`sm`,asChild:!0,children:(0,Y.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,Y.jsx)(W,{className:`size-4`}),me(),(0,Y.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void p(e)})]})}),(0,Y.jsx)(O,{size:`sm`,disabled:u,onClick:()=>void m(),children:we()})]}),o?(0,Y.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null,c?(0,Y.jsx)(`p`,{className:`oc-chart-import__ok`,children:Ce()}):null]})]})}function $t({chart:e}){let t=v(f.charts.setChartLogo),n=b(f.charts.removeChartLogo),[r,i]=(0,G.useState)(!1),[a,s]=(0,G.useState)(null),c=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function l(n,r,a){if(e.chartId!==void 0){s(null),i(!0);try{let{blob:i,hasAlpha:o}=await Wt(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){s(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function u(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await l(e,n)}async function d(t){if(e.chartId!==void 0){s(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){s(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function p(e){let t=c(e===`light`?`dark`:`light`);if(t){s(null),i(!0);try{await l(e,await(await fetch(t)).blob(),e)}catch(e){s(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function m({mode:e}){let t=c(e),n=c(e===`light`?`dark`:`light`);return(0,Y.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?xe():o()}),(0,Y.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,Y.jsx)(`img`,{src:t,alt:``}):null}),(0,Y.jsx)(O,{variant:`outline`,size:`sm`,asChild:!0,children:(0,Y.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,Y.jsx)(W,{className:`size-4`}),t?he():ft(),(0,Y.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void u(e,t)})]})}),!t&&n?(0,Y.jsx)(O,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void p(e),children:ee()}):null,t?(0,Y.jsx)(O,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:re()}):null]})}return(0,Y.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:y()}),(0,Y.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,Y.jsx)(m,{mode:`light`}),(0,Y.jsx)(m,{mode:`dark`})]}),r?(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:h()}):null,a?(0,Y.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function en({chart:e}){let t=g(f.me.getMe,{host:B}),n=b(f.charts.addChartDomain),r=b(f.charts.removeChartDomain),[i,a]=(0,G.useState)(``),[o,s]=(0,G.useState)(null),[c,l]=(0,G.useState)(!1);if(t?.role!==`admin`)return null;let u=e.domains??[];async function p(){let t=i.trim();if(t!==``){s(null),l(!0);try{await n({chartKey:e.key,domain:t}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{l(!1)}}}async function h(t){s(null);try{await r({chartKey:e.key,domain:t})}catch{}}return(0,Y.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:We()}),(0,Y.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,Y.jsx)(`div`,{className:`oc-chart-avail__groups`,children:u.length===0?(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:ye()}):u.map(e=>(0,Y.jsxs)(N,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,Y.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":ct({domain:e}),onClick:()=>void h(e),children:(0,Y.jsx)(D,{className:`size-3`})})]},e))}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(F,{value:i,onChange:e=>a(e.target.value),placeholder:d(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&p()}}),(0,Y.jsx)(O,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void p(),children:m()})]}),(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:de()}),o?(0,Y.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function tn(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function nn({chart:e}){let t=b(f.charts.updateChart),n=b(f.charts.deleteChart),[r,i]=(0,G.useState)(!1),[a,o]=(0,G.useState)(e.name),[s,l]=(0,G.useState)(()=>tn(e.tokens)),[u,d]=(0,G.useState)(e.tokens.bpm??0),[p,m]=(0,G.useState)(null),[h,g]=(0,G.useState)(!1);function _(){o(e.name),l(tn(e.tokens)),d(e.tokens.bpm??0),m(null),i(!0)}async function v(){if(e.chartId===void 0)return;m(null);let n;try{n=JSON.parse(s)}catch{m(x());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;u>0?e.bpm=u:delete e.bpm}g(!0);try{await t({chartId:e.chartId,name:a.trim(),tokens:n}),i(!1)}catch(e){m(e instanceof Error?e.message:String(e))}finally{g(!1)}}async function y(){if(e.chartId!==void 0&&window.confirm(T()))try{await n({chartId:e.chartId})}catch{}}return(0,Y.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,Y.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,Y.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(O,{variant:`outline`,size:`sm`,onClick:_,children:Se()}),(0,Y.jsx)(O,{variant:`ghost`,size:`sm`,onClick:()=>void y(),children:be()})]})})]}),r?(0,Y.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,Y.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-import__label`,children:ut()}),(0,Y.jsx)(F,{value:a,onChange:e=>o(e.target.value),maxLength:60})]}),(0,Y.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-import__label`,children:S()}),(0,Y.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,Y.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:u,onChange:e=>d(Number(e.target.value)),"aria-label":S()}),(0,Y.jsx)(`span`,{className:`oc-chart-bpm__value`,children:u===0?Be():`${u} BPM`})]}),(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:tt()})]}),(0,Y.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-import__label`,children:ke()}),(0,Y.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:s,onChange:e=>l(e.target.value),rows:10,spellCheck:!1})]}),p?(0,Y.jsx)(`p`,{className:`oc-chart-import__error`,children:p}):null,(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(O,{size:`sm`,disabled:h,onClick:()=>void v(),children:c()}),(0,Y.jsx)(O,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:_e()})]})]}):null,(0,Y.jsx)($t,{chart:e}),(0,Y.jsx)(en,{chart:e})]})}function rn(){let e=g(f.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(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:$e()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:ne()})]}),e!==void 0&&t.length===0?(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:_()}):(0,Y.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,Y.jsx)(nn,{chart:e},e.key))})]})}function an({chart:e,groups:t}){let n=b(f.charts.addChartToGroupPool),r=b(f.charts.removeChartFromGroupPool),i=e.restrictedToGroups,a=e.poolGroups,o=new Set((a??[]).map(e=>e.groupId)),s=t.filter(e=>!o.has(e._id));async function c(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function l(t){try{await r({groupId:t,chartKey:e.key})}catch{}}return(0,Y.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,Y.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,Y.jsx)(N,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?it():e.kind===`custom`&&e.scope===`personal`?C():je()}),e.isGlobalDefault?(0,Y.jsx)(N,{variant:`default`,children:Ge()}):null]}),(0,Y.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:nt()}),(a??[]).map(e=>(0,Y.jsxs)(N,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,Y.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":De({group:e.name}),onClick:()=>void l(e.groupId),children:(0,Y.jsx)(D,{className:`size-3`})})]},e.groupId)),s.length>0?(0,Y.jsxs)(M,{value:``,onValueChange:e=>void c(e),children:[(0,Y.jsx)(k,{size:`sm`,className:`w-56`,children:(0,Y.jsx)(R,{placeholder:Xe()})}),(0,Y.jsx)(z,{children:s.map(e=>(0,Y.jsx)(j,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:Ae()}):null]})]})}function on({chart:e}){let t=b(f.charts.promoteChartToCommon),n=b(f.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(T()))try{await n({chartId:e.chartId})}catch{}}return(0,Y.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,Y.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,Y.jsx)(N,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?qe():C()}),e.ownerLabel?(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:Le({owner:e.ownerLabel})}):null]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,Y.jsx)(O,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:Qe()}):null,(0,Y.jsx)(O,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:Fe()})]})]})}function sn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=b(f.admin.setDefaultThemeMode),a=b(f.admin.setDefaultLocale),o=b(f.charts.setDefaultChart),c=g(f.charts.listChartsAdmin),l=g(f.groups.listGroups,{}),d=e??`system`,m=t??`fr`;return(0,Y.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:u()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:p()})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:Te()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:Ie()})]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(O,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void o({name:null}),children:s()}),mt.map(e=>(0,Y.jsx)(O,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({name:e.key}),children:e.name},e.key)),(c??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,Y.jsx)(O,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({name:e.key}),children:e.name},e.key))]})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:Re()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:Ke()})]}),(0,Y.jsx)(`div`,{className:`oc-chart-avail-list`,children:(c??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,Y.jsx)(an,{chart:e,groups:l??[]},e.key))})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:Ze()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:Pe()})]}),(0,Y.jsx)(`div`,{className:`oc-chart-avail-list`,children:(c??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,Y.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,Y.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,Y.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,Y.jsx)(en,{chart:e})]},e.key))})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:ot()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:Ee()})]}),(()=>{let e=(c??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:Me()}):(0,Y.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,Y.jsx)(on,{chart:e},e.key))})})()]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:se()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:ie()})]}),(0,Y.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,Y.jsx)(O,{variant:d===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:Jt(e)},e))})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:Ve()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:i()})]}),(0,Y.jsx)(`div`,{className:`oc-show__row`,children:bt().map(e=>(0,Y.jsx)(O,{variant:m===e.value?`default`:`outline`,size:`sm`,onClick:()=>void a({locale:e.value}),children:e.label},e.value))}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:Ue()})]})]})}function cn(){let e=g(f.me.getMe,{host:B}),t=gt(e?.resolvedThemeMode);return(0,Y.jsxs)(`div`,{className:`oc-appearance`,children:[(0,Y.jsx)(Zt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,Y.jsx)(Qt,{}),(0,Y.jsx)(rn,{}),e?.role===`admin`?(0,Y.jsx)(sn,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function ln(){let[e,t]=(0,G.useState)(!0),[n,r]=(0,G.useState)(`per-user`),[i,a]=(0,G.useState)(``),[o,s]=(0,G.useState)(X),[c,l]=(0,G.useState)(X),[u,d]=(0,G.useState)(Z),f=i!==``||o!==X||c!==X;function p(){a(``),s(X),l(X),d(Z)}return(0,Y.jsxs)(`div`,{className:`oc-show`,children:[(0,Y.jsx)(cn,{}),(0,Y.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,Y.jsx)(`summary`,{className:`oc-show__title`,children:ue()}),(0,Y.jsxs)(Q,{title:`Buttons`,description:`Variants`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(O,{children:`Default`}),(0,Y.jsx)(O,{variant:`secondary`,children:`Secondary`}),(0,Y.jsx)(O,{variant:`outline`,children:`Outline`}),(0,Y.jsx)(O,{variant:`ghost`,children:`Ghost`}),(0,Y.jsx)(O,{variant:`destructive`,children:`Destructive`}),(0,Y.jsx)(O,{variant:`link`,children:`Link`})]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(O,{size:`sm`,children:`Small`}),(0,Y.jsx)(O,{children:`Default`}),(0,Y.jsx)(O,{size:`lg`,children:`Large`}),(0,Y.jsx)(O,{size:`icon`,"aria-label":`more`,children:(0,Y.jsx)(A,{})}),(0,Y.jsx)(O,{disabled:!0,children:`Disabled`})]})]}),(0,Y.jsx)(Q,{title:`Badges`,children:(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(N,{children:`Default`}),(0,Y.jsx)(N,{variant:`secondary`,children:`Secondary`}),(0,Y.jsx)(N,{variant:`outline`,children:`Outline`}),(0,Y.jsx)(N,{variant:`destructive`,children:`Destructive`})]})}),(0,Y.jsx)(Q,{title:`Inputs & selection`,children:(0,Y.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,Y.jsx)(F,{placeholder:`Text input…`}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsxs)(M,{value:n,onValueChange:r,children:[(0,Y.jsx)(k,{className:`w-56`,children:(0,Y.jsx)(R,{placeholder:`Select…`})}),(0,Y.jsxs)(z,{children:[(0,Y.jsx)(j,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,Y.jsx)(j,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,Y.jsxs)(`label`,{className:`oc-show__check`,children:[(0,Y.jsx)(L,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,Y.jsx)(Q,{title:`Filtres & plage temporelle`,description:`Barre réutilisable (recherche debouncée + selects rapides à largeur auto + plage façon Grafana) et constructeur de filtre avancé. Câblée dans Users, Groups, Comptes de service, Traces, Anomalies, Audit et KPI.`,children:(0,Y.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,Y.jsxs)(jt,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,Y.jsxs)(M,{value:o,onValueChange:s,children:[(0,Y.jsx)(k,{size:`sm`,children:(0,Y.jsx)(R,{})}),(0,Y.jsxs)(z,{children:[(0,Y.jsx)(j,{value:X,children:`Toutes directions`}),(0,Y.jsx)(j,{value:`inbound`,children:`inbound`}),(0,Y.jsx)(j,{value:`outbound`,children:`outbound`}),(0,Y.jsx)(j,{value:`internal`,children:`internal`})]})]}),(0,Y.jsxs)(M,{value:c,onValueChange:l,children:[(0,Y.jsx)(k,{size:`sm`,children:(0,Y.jsx)(R,{})}),(0,Y.jsxs)(z,{children:[(0,Y.jsx)(j,{value:X,children:`Toutes sévérités`}),(0,Y.jsx)(j,{value:`info`,children:`info`}),(0,Y.jsx)(j,{value:`warn`,children:`warn`}),(0,Y.jsx)(j,{value:`critical`,children:`critical`})]})]})]}),(0,Y.jsx)(Mt,{fields:qt,onChange:()=>{}}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,Y.jsx)(At,{value:u,onChange:d})]})]})}),(0,Y.jsx)(Q,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,Y.jsxs)(_t,{children:[(0,Y.jsx)(yt,{asChild:!0,children:(0,Y.jsx)(O,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,Y.jsx)(A,{})})}),(0,Y.jsxs)(vt,{align:`start`,children:[(0,Y.jsx)(ht,{children:`Actions`}),(0,Y.jsx)(I,{}),(0,Y.jsx)(P,{children:`Edit`}),(0,Y.jsx)(P,{children:`Duplicate`}),(0,Y.jsx)(I,{}),(0,Y.jsx)(P,{variant:`destructive`,children:`Delete`})]})]})}),(0,Y.jsx)(Q,{title:`Card`,children:(0,Y.jsxs)(Et,{className:`w-80`,children:[(0,Y.jsxs)(xt,{children:[(0,Y.jsx)(wt,{children:`Instance`}),(0,Y.jsx)(Tt,{children:`Non-secret metadata only.`})]}),(0,Y.jsx)(Ct,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,Y.jsxs)(St,{className:`gap-2`,children:[(0,Y.jsx)(O,{size:`sm`,children:`Save`}),(0,Y.jsx)(O,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,Y.jsx)(Q,{title:`Table`,children:(0,Y.jsxs)(kt,{children:[(0,Y.jsx)(Dt,{children:(0,Y.jsxs)(H,{children:[(0,Y.jsx)(V,{className:`w-8`,children:(0,Y.jsx)(L,{"aria-label":`select all`})}),(0,Y.jsx)(V,{children:`Name`}),(0,Y.jsx)(V,{children:`Mode`}),(0,Y.jsx)(V,{className:`text-right`,children:`Status`}),(0,Y.jsx)(V,{className:`w-8`})]})}),(0,Y.jsx)(Ot,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,Y.jsxs)(H,{children:[(0,Y.jsx)(U,{children:(0,Y.jsx)(L,{"aria-label":`select ${e.n}`})}),(0,Y.jsx)(U,{className:`font-medium`,children:e.n}),(0,Y.jsx)(U,{children:(0,Y.jsx)(N,{variant:`secondary`,children:e.m})}),(0,Y.jsx)(U,{className:`text-right`,children:(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,Y.jsx)(E,{className:`size-3.5`}),` `,e.s]})}),(0,Y.jsx)(U,{children:(0,Y.jsx)(O,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,Y.jsx)(A,{})})})]},e.n))})]})}),(0,Y.jsx)(Q,{title:`App fragments`,description:`Chat-specific components`,children:(0,Y.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,Y.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,Y.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,Y.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,Y.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,Y.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,Y.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,Y.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,Y.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,Y.jsx)(`span`,{className:`oc-run-status__dot`}),(0,Y.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{ln as ThemeShowroom};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$n as r,Bm as i,Fm as a,Gm as o,Hm as s,Im as c,Km as l,Lm as u,Rm as d,Um as f,Vm as p,Wm as m,ar as h,er as g,ir as _,nr as v,qm as y,rr as b,tr as x,zm as S}from"./dist-CQKky_Rh.js";import{t as C}from"./button-BZ2ghM2f.js";import{Ct as w,Gt as T,Pt as E,St as D,Tt as O,j as k,lt as A,wt as j}from"./index-BuqxeAUW.js";var M=t(e(),1),N={s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5};function P(e,t){let n=e.trim();if(n===`now`)return t;let r=/^now-(\d+)([smhdw])$/.exec(n);if(r===null)return null;let i=Number(r[1]),a=N[r[2]];return!Number.isFinite(i)||a===void 0?null:t-i*a}function F(e,t=Date.now()){return e.kind===`absolute`?{from:e.from,to:e.to}:{from:P(e.from,t)??t-N.h,to:P(e.to,t)??t}}var I=[{label:y(),from:`now-5m`},{label:l(),from:`now-15m`},{label:o(),from:`now-30m`},{label:m(),from:`now-1h`},{label:f(),from:`now-3h`},{label:s(),from:`now-6h`},{label:p(),from:`now-12h`},{label:i(),from:`now-24h`},{label:S(),from:`now-2d`},{label:d(),from:`now-7d`},{label:u(),from:`now-30d`},{label:c(),from:`now-90d`},{label:a(),from:`now-520w`}];function L(e){return k(e,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}function R(e){if(e.kind===`relative`){let t=I.find(t=>t.from===e.from&&e.to===`now`);return t?t.label:`${e.from} → ${e.to}`}return`${L(e.from)} → ${L(e.to)}`}function z(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function B(e){if(e===``)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function V(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:t!==``&&Number.isFinite(Number(t))?Number(t):e}var H=n();function U(e){let[t,n]=(0,M.useState)(0);return(0,M.useEffect)(()=>{if(e.kind!==`relative`)return;let t=window.setInterval(()=>n(e=>e+1),3e4);return()=>window.clearInterval(t)},[e.kind]),(0,M.useMemo)(()=>{let{from:t,to:n}=F(e);return e.kind===`absolute`?{from:t,to:n}:{from:W(t),to:W(n)}},[e,t])}function W(e){return Math.floor(e/6e4)*6e4}function G({value:e,onChange:t}){let[n,i]=(0,M.useState)(!1),[a,o]=(0,M.useState)(``),s=F(e),[c,l]=(0,M.useState)(()=>z(s.from)),[u,d]=(0,M.useState)(()=>z(s.to));function f(t){if(t){let t=F(e);l(z(t.from)),d(z(t.to)),o(``)}i(t)}function p(e){t({kind:`relative`,from:e,to:`now`}),i(!1)}function m(){let e=B(c),n=B(u);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),i(!1))}let y=(0,M.useMemo)(()=>{let e=a.trim().toLowerCase();return e===``?I:I.filter(t=>t.label.toLowerCase().includes(e)||t.from.toLowerCase().includes(e))},[a]),S=B(c)!==null&&B(u)!==null;return(0,H.jsxs)(j,{open:n,onOpenChange:f,children:[(0,H.jsx)(O,{asChild:!0,children:(0,H.jsxs)(C,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,H.jsx)(T,{}),R(e)]})}),(0,H.jsx)(w,{children:(0,H.jsx)(D,{align:`end`,sideOffset:6,className:`oc-timerange__panel z-50 rounded-lg border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,children:(0,H.jsxs)(`div`,{className:`oc-timerange__cols`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__absolute`,children:[(0,H.jsx)(`div`,{className:`oc-timerange__section-title`,children:h()}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:_()}),(0,H.jsx)(A,{type:`datetime-local`,value:c,onChange:e=>l(e.target.value)})]}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:b()}),(0,H.jsx)(A,{type:`datetime-local`,value:u,onChange:e=>d(e.target.value)})]}),(0,H.jsx)(C,{size:`sm`,className:`oc-timerange__apply`,disabled:!S,onClick:m,children:v()})]}),(0,H.jsxs)(`div`,{className:`oc-timerange__relative`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__search`,children:[(0,H.jsx)(E,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,H.jsx)(A,{value:a,onChange:e=>o(e.target.value),placeholder:x(),"aria-label":g()})]}),(0,H.jsx)(`ul`,{className:`oc-timerange__list`,children:y.length===0?(0,H.jsx)(`li`,{className:`oc-timerange__empty`,children:r()}):y.map(t=>(0,H.jsx)(`li`,{children:(0,H.jsx)(`button`,{type:`button`,className:`oc-timerange__option`+(e.kind===`relative`&&e.from===t.from&&e.to===`now`?` is-active`:``),onClick:()=>p(t.from),children:t.label})},t.from))})]})]})})})]})}export{U as n,V as r,G as t};