@lacneu/atrium 0.78.0 → 0.79.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 (74) hide show
  1. package/dist/assets/{AccessTab-YOPTfk-I.js → AccessTab-DSCmt7Ip.js} +1 -1
  2. package/dist/assets/{AdvancedFilter-Bm1TIX9k.js → AdvancedFilter-BvCkEFAZ.js} +1 -1
  3. package/dist/assets/AgentFilesTab-7dQdZX29.js +3 -0
  4. package/dist/assets/AnomaliesTab-BPLGANvs.js +1 -0
  5. package/dist/assets/AuditTab-ZU79MUgB.js +1 -0
  6. package/dist/assets/BridgeTab-M7-UtjGl.js +1 -0
  7. package/dist/assets/ChatDefaultsTab-Bc4D68Q0.js +1 -0
  8. package/dist/assets/{DataTableShell-DWXPn72S.js → DataTableShell-BXwJXDDv.js} +1 -1
  9. package/dist/assets/{DetailChips-D6mdBUOT.js → DetailChips-hviX2Put.js} +1 -1
  10. package/dist/assets/FeedbacksTab-HMOpevVO.js +1 -0
  11. package/dist/assets/{FieldLabel-Bww3UDFn.js → FieldLabel-CsECtSIN.js} +1 -1
  12. package/dist/assets/FilesTab-F959A6FE.js +1 -0
  13. package/dist/assets/{FilterBar-FHDxb3k3.js → FilterBar-C2wwMC41.js} +1 -1
  14. package/dist/assets/{GroupsTab-BA8yKOnN.js → GroupsTab-Bpy_p66G.js} +1 -1
  15. package/dist/assets/InstancesTab-D5KStG8o.js +1 -0
  16. package/dist/assets/IntegrationsTab-BoxKq2le.js +1 -0
  17. package/dist/assets/KpiTab-GDPz44HL.js +1 -0
  18. package/dist/assets/PreferencesTab-CXDLshWS.js +1 -0
  19. package/dist/assets/ProjectPage-BySFxvDE.js +1 -0
  20. package/dist/assets/PromptInjectionsTab-IBU9kZO1.js +4 -0
  21. package/dist/assets/RolesTab-r-i-en_a.js +1 -0
  22. package/dist/assets/ScheduledTab-DISMK0AZ.js +1 -0
  23. package/dist/assets/ServiceAccountsTab-LgiLgXie.js +1 -0
  24. package/dist/assets/{SubAgentReportsTab-jYVPpy6r.js → SubAgentReportsTab-BAhJQyxi.js} +1 -1
  25. package/dist/assets/ThemeShowroom-Drifg0bA.js +1 -0
  26. package/dist/assets/{TimeRangePicker-BlRNLd96.js → TimeRangePicker-DI6G5EOI.js} +1 -1
  27. package/dist/assets/{TimezoneCombobox-UX7uQX62.js → TimezoneCombobox-D3wze8FF.js} +1 -1
  28. package/dist/assets/TracesTab-DX1DB4b1.js +1 -0
  29. package/dist/assets/UsersTab-B92gFHQx.js +1 -0
  30. package/dist/assets/VoiceTab-pnfk1eHp.js +1 -0
  31. package/dist/assets/{api-Cpjr7qvl.js → api-C_wXCqXM.js} +5 -5
  32. package/dist/assets/{button-CbwCr9Pi.js → button-998QRevY.js} +1 -1
  33. package/dist/assets/{card-DpbKWI5H.js → card-Dz033eRk.js} +1 -1
  34. package/dist/assets/chevrons-up-down-DhZp1N6H.js +1 -0
  35. package/dist/assets/{compatView-BHtlzKRR.js → compatView-B1iUgVcK.js} +1 -1
  36. package/dist/assets/dispatchErrorInfo-50WccPSD.js +1 -0
  37. package/dist/assets/{dist-BbeTdjCM.js → dist-DmLwIO1L.js} +1 -1
  38. package/dist/assets/{dist-WboiKquG.js → dist-DrgGBzL-.js} +1 -1
  39. package/dist/assets/{highlighted-body-OFNGDK62-B8scDgZo.js → highlighted-body-OFNGDK62-BFWtYQr6.js} +1 -1
  40. package/dist/assets/{index-Bc3aF-kJ.js → index-DDMBZveR.js} +46 -46
  41. package/dist/assets/{list-CIbMtiOp.js → list-CHvGbTF2.js} +1 -1
  42. package/dist/assets/mermaid-GHXKKRXX-BCPYwCCi.js +1 -0
  43. package/dist/assets/{pdf-DKBRfoBb.js → pdf-DwPPPJmz.js} +1 -1
  44. package/dist/assets/roleDescriptions-z3-Vqqal.js +1 -0
  45. package/dist/assets/{table-CeTqDEfs.js → table-uPHY2-YP.js} +1 -1
  46. package/dist/assets/{tabs-DHs6yOVA.js → tabs-Cyif3k8O.js} +1 -1
  47. package/dist/assets/x-Dr9YP2a4.js +1 -0
  48. package/dist/index.html +6 -6
  49. package/package.json +1 -1
  50. package/dist/assets/AgentFilesTab-DRQkurXm.js +0 -3
  51. package/dist/assets/AnomaliesTab-Dq2dqog2.js +0 -1
  52. package/dist/assets/AuditTab-Cntt5whu.js +0 -1
  53. package/dist/assets/BridgeTab-DzV-2POL.js +0 -1
  54. package/dist/assets/ChatDefaultsTab-C0sMC9lx.js +0 -1
  55. package/dist/assets/FeedbacksTab-CbdS0wvF.js +0 -1
  56. package/dist/assets/FilesTab-gqJalvPX.js +0 -1
  57. package/dist/assets/InstancesTab-sdopggdY.js +0 -1
  58. package/dist/assets/IntegrationsTab-BFpswDLB.js +0 -1
  59. package/dist/assets/KpiTab-DwKThxZR.js +0 -1
  60. package/dist/assets/PreferencesTab-C3J_i-eF.js +0 -1
  61. package/dist/assets/ProjectPage-Dk_aI-j5.js +0 -1
  62. package/dist/assets/PromptInjectionsTab-B_mdD-DZ.js +0 -4
  63. package/dist/assets/RolesTab-AEwrbrY4.js +0 -1
  64. package/dist/assets/ScheduledTab-1EVZpEec.js +0 -1
  65. package/dist/assets/ServiceAccountsTab-CGQ1lSPD.js +0 -1
  66. package/dist/assets/ThemeShowroom-Ce00J53a.js +0 -1
  67. package/dist/assets/TracesTab-h8arGKis.js +0 -1
  68. package/dist/assets/UsersTab-CuY3xwoe.js +0 -1
  69. package/dist/assets/VoiceTab-D-J9M4a1.js +0 -1
  70. package/dist/assets/chevrons-up-down-Chp_XyRp.js +0 -1
  71. package/dist/assets/dispatchErrorInfo-EQWxZ8Ki.js +0 -1
  72. package/dist/assets/mermaid-GHXKKRXX-BcADHOv7.js +0 -1
  73. package/dist/assets/roleDescriptions-CF4LmoIL.js +0 -1
  74. package/dist/assets/x-Dqrt5OdW.js +0 -1
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$F as r,$P as i,AF as a,BF as o,BP as s,CF as c,Cz as l,DF as u,EF as d,FF as f,FP as p,Fz as m,GF as h,GP as g,Gs as ee,HF as _,HP as te,IF as v,IP as y,Iz as b,JF as ne,JP as re,KF as ie,KP as ae,Ks as x,LF as oe,LP as se,MF as ce,MP as le,NF as ue,NP as de,Nz as fe,OF as pe,PF as me,PP as he,QF as ge,QP as S,RF as _e,RP as ve,SF as ye,TF as be,Tz as xe,UF as Se,UP as Ce,VF as we,VP as Te,WF as C,WP as Ee,Ws as De,XF as Oe,XP as ke,YF as Ae,YP as je,ZF as Me,ZP as Ne,_F as w,aF as Pe,bF as Fe,cF as Ie,dF as Le,eF as Re,eI as ze,fF as Be,gF as Ve,hF as He,iF as Ue,jF as We,kF as Ge,lF as Ke,mF as qe,nF as Je,oF as Ye,pF as Xe,qF as Ze,qP as Qe,qs as T,r as $e,rF as et,sF as tt,t as E,tF as nt,uF as rt,vF as it,wF as at,wz as ot,xF as st,yF as ct,zF as lt,zP as ut}from"./api-Cpjr7qvl.js";import{t as D}from"./x-Dqrt5OdW.js";import{t as O}from"./button-CbwCr9Pi.js";import{$ as k,Et as A,Ft as dt,G as ft,Hn as j,It as M,K as pt,Lt as mt,Mt as ht,Nn as N,Nt as gt,Pn as _t,Pt as P,Q as F,X as I,Z as L,cn as R,et as z,jt as B,q as V,ut as H}from"./index-Bc3aF-kJ.js";import{t as vt}from"./localePickerView-C2RmOS86.js";import{a as yt,i as bt,n as xt,o as St,r as Ct,t as wt}from"./card-DpbKWI5H.js";import{a as Tt,i as U,n as Et,o as W,r as G,t as Dt}from"./table-CeTqDEfs.js";import{t as Ot}from"./TimeRangePicker-BlRNLd96.js";import{t as kt}from"./FilterBar-FHDxb3k3.js";import{t as At}from"./AdvancedFilter-Bm1TIX9k.js";var K=t(e(),1),jt=.1,Mt=[248,248,248],Nt=[24,24,24];function Pt(e,t,n){let r=t,i=n,a=-1,o=-1;for(let s=0;s<n;s++)for(let n=0;n<t;n++)e[(s*t+n)*4+3]>8&&(n<r&&(r=n),n>a&&(a=n),s<i&&(i=s),s>o&&(o=s));return a<0?null:{x:r,y:i,width:a-r+1,height:o-i+1}}function Ft(e,t,n){let r=t*n;if(r===0)return 0;let i=0;for(let t=3;t<e.length;t+=4)e[t]<=8&&i++;return i/r}function q(e,t,n){return Ft(e,t,n)>=jt}function It(e,t){for(let n=0;n<e.length;n+=4)e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2]}function Lt(e){for(let t=0;t<e.length;t+=4)e[t]=255-e[t],e[t+1]=255-e[t+1],e[t+2]=255-e[t+2]}var Rt=12*1024*1024,zt=480,Bt=160,Vt=.92;async function Ht(e,t={}){if(!e.type.startsWith(`image/`))throw Error(nt());if(e.size>Rt)throw Error(Re());let{source:n,width:r,height:i,cleanup:a}=await Ut(e);try{let a=e.type===`image/svg+xml`,o=Math.min(zt/r,Bt/i,a?1/0:1),s=Math.max(1,Math.round(r*o)),c=Math.max(1,Math.round(i*o)),l=document.createElement(`canvas`);l.width=s,l.height=c;let u=l.getContext(`2d`);if(!u)throw Error(S());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=Pt(u.getImageData(0,0,s,c).data,s,c)??{x:0,y:0,width:s,height:c},f=document.createElement(`canvas`);f.width=d.width,f.height=d.height;let p=f.getContext(`2d`);if(!p)throw Error(S());if(p.drawImage(l,d.x,d.y,d.width,d.height,0,0,d.width,d.height),t.variantFor){let e=p.getImageData(0,0,d.width,d.height);q(e.data,d.width,d.height)?It(e.data,t.variantFor===`dark`?Mt:Nt):Lt(e.data),p.putImageData(e,0,0)}let m=q(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await Y(f,`image/webp`,Vt)??await Y(f,`image/png`);if(!h)throw Error(Ne());return{blob:h,hasAlpha:m}}finally{a()}}async function Ut(e){if(e.type===`image/svg+xml`)return J(e);if(typeof createImageBitmap==`function`)try{let t=await createImageBitmap(e);return{source:t,width:t.width,height:t.height,cleanup:()=>t.close()}}catch{}return J(e)}async function J(e){let t=URL.createObjectURL(e);try{let e=new Image;return e.decoding=`async`,await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=()=>r(Error(i())),e.src=t}),{source:e,width:e.naturalWidth||300,height:e.naturalHeight||150,cleanup:()=>URL.revokeObjectURL(t)}}catch(e){throw URL.revokeObjectURL(t),e}}function Y(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var X=n();function Wt(e,t){let n=e.trim().replace(/[^A-Za-z0-9_.-]+/g,`-`).replace(/^-+|-+$/g,``)||`chart`,r=new Blob([JSON.stringify(t,null,2)],{type:`application/json`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`${n}.chart.json`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}var Z=`__all__`,Gt={kind:`relative`,from:`now-24h`,to:`now`},Kt=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function Q({title:e,description:t,children:n}){return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,X.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function qt(e){return e===`light`?xe():e===`dark`?ot():l()}var Jt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Yt({tokens:e,mode:t}){let n=e.colors[t];return(0,X.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Jt.map(e=>{let t=n[e];return(0,X.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Xt({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:o}){return(0,X.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,X.jsxs)(`button`,{type:`button`,className:$e(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,X.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,X.jsx)(j,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,X.jsx)(Yt,{tokens:r,mode:i}):(0,X.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,X.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,X.jsx)(O,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":T(),title:T(),children:(0,X.jsx)(_t,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=b(E.charts.listMyCharts),r=m(E.charts.setMyChart);async function i(e){try{await r({name:e})}catch{}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:ie()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:h()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:C(),subtitle:Se(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?_():n.via===`owner`?we():o({group:n.via.group});return(0,X.jsx)(Xt,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void i(n.key),onExport:()=>Wt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:lt()}):null]})}function Qt(){let e=m(E.charts.importChart),[t,n]=(0,K.useState)(``),[r,i]=(0,K.useState)(``),[a,o]=(0,K.useState)(null),[s,l]=(0,K.useState)(!1),[u,d]=(0,K.useState)(!1);async function f(e){let t=e.target.files?.[0];if(e.target.value=``,t){o(null),l(!1);try{i(await t.text())}catch{o(w())}}}async function p(){if(o(null),l(!1),t.trim()===``){o(He());return}let a;try{a=JSON.parse(r)}catch{o(w());return}d(!0);try{await e({name:t.trim(),tokens:a}),l(!0),n(``),i(``)}catch(e){o(e instanceof Error?e.message:String(e))}finally{d(!1)}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:be()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:at()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:c()}),(0,X.jsx)(B,{value:t,onChange:e=>n(e.target.value),placeholder:ye(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:st()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:Fe(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(O,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(R,{className:`size-4`}),ct(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void f(e)})]})}),(0,X.jsx)(O,{size:`sm`,disabled:u,onClick:()=>void p(),children:it()})]}),a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null,s?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:Ve()}):null]})]})}function $t({chart:e}){let t=fe(E.charts.setChartLogo),n=m(E.charts.removeChartLogo),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(null),s=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function c(n,r,a){if(e.chartId!==void 0){o(null),i(!0);try{let{blob:i,hasAlpha:o}=await Ht(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function l(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await c(e,n)}async function u(t){if(e.chartId!==void 0){o(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function d(e){let t=s(e===`light`?`dark`:`light`);if(t){o(null),i(!0);try{await c(e,await(await fetch(t)).blob(),e)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function f({mode:e}){let t=s(e),n=s(e===`light`?`dark`:`light`);return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?Ie():tt()}),(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,X.jsx)(`img`,{src:t,alt:``}):null}),(0,X.jsx)(O,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(R,{className:`size-4`}),t?Pe():Ye(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void l(e,t)})]})}),!t&&n?(0,X.jsx)(O,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:et()}):null,t?(0,X.jsx)(O,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void u(e),children:Ue()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Ke()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(f,{mode:`light`}),(0,X.jsx)(f,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Je()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function en({chart:e}){let t=b(E.me.getMe,{host:V}),n=m(E.charts.addChartDomain),r=m(E.charts.removeChartDomain),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(!1);if(t?.role!==`admin`)return null;let u=e.domains??[];async function d(){let t=i.trim();if(t!==``){s(null),l(!0);try{await n({chartKey:e.key,domain:t}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{l(!1)}}}async function f(t){s(null);try{await r({chartKey:e.key,domain:t})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:ke()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:u.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ae()}):u.map(e=>(0,X.jsxs)(A,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":g({domain:e}),onClick:()=>void f(e),children:(0,X.jsx)(D,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(B,{value:i,onChange:e=>a(e.target.value),placeholder:re(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&d()}}),(0,X.jsx)(O,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void d(),children:Qe()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:je()}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function $(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function tn({chart:e}){let t=m(E.charts.updateChart),n=m(E.charts.deleteChart),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(e.name),[c,l]=(0,K.useState)(()=>$(e.tokens)),[u,d]=(0,K.useState)(e.tokens.bpm??0),[f,p]=(0,K.useState)(null),[h,g]=(0,K.useState)(!1);function _(){o(e.name),l($(e.tokens)),d(e.tokens.bpm??0),p(null),i(!0)}async function v(){if(e.chartId===void 0)return;p(null);let n;try{n=JSON.parse(c)}catch{p(w());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){p(e instanceof Error?e.message:String(e))}finally{g(!1)}}async function y(){if(e.chartId!==void 0&&window.confirm(s()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(O,{variant:`outline`,size:`sm`,onClick:_,children:Le()}),(0,X.jsx)(O,{variant:`ghost`,size:`sm`,onClick:()=>void y(),children:rt()})]})})]}),r?(0,X.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:te()}),(0,X.jsx)(B,{value:a,onChange:e=>o(e.target.value),maxLength:60})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:x()}),(0,X.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,X.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:u,onChange:e=>d(Number(e.target.value)),"aria-label":x()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:u===0?ee():`${u} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:De()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:Te()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:c,onChange:e=>l(e.target.value),rows:10,spellCheck:!1})]}),f?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:f}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(O,{size:`sm`,disabled:h,onClick:()=>void v(),children:Ee()}),(0,X.jsx)(O,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:Ce()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function nn(){let e=b(E.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:qe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Xe()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Be()}):(0,X.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,X.jsx)(tn,{chart:e},e.key))})]})}function rn({chart:e,groups:t}){let n=m(E.charts.addChartToGroupPool),r=m(E.charts.removeChartFromGroupPool),i=e.restrictedToGroups,o=e.poolGroups,s=new Set((o??[]).map(e=>e.groupId)),c=t.filter(e=>!s.has(e._id));async function l(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function f(t){try{await r({groupId:t,chartKey:e.key})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(A,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?We():e.kind===`custom`&&e.scope===`personal`?y():ce()}),e.isGlobalDefault?(0,X.jsx)(A,{variant:`default`,children:a()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:pe()}),(o??[]).map(e=>(0,X.jsxs)(A,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":d({group:e.name}),onClick:()=>void f(e.groupId),children:(0,X.jsx)(D,{className:`size-3`})})]},e.groupId)),c.length>0?(0,X.jsxs)(I,{value:``,onValueChange:e=>void l(e),children:[(0,X.jsx)(k,{size:`sm`,className:`w-56`,children:(0,X.jsx)(z,{placeholder:u()})}),(0,X.jsx)(L,{children:c.map(e=>(0,X.jsx)(F,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ge()}):null]})]})}function an({chart:e}){let t=m(E.charts.promoteChartToCommon),n=m(E.charts.deleteChart);async function r(){if(e.chartId!==void 0)try{await t({chartId:e.chartId})}catch{}}async function i(){if(e.chartId!==void 0&&window.confirm(s()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(A,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?p():y()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:se({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(O,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:he()}):null,(0,X.jsx)(O,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:de()})]})]})}function on({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let i=m(E.admin.setDefaultThemeMode),a=m(E.admin.setDefaultLocale),o=m(E.charts.setDefaultChart),s=b(E.charts.listChartsAdmin),c=b(E.groups.listGroups,{}),l=e??`system`,u=t??`fr`;return(0,X.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:ne()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ze()})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:_e()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:oe()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(O,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void o({name:null}),children:C()}),pt.map(e=>(0,X.jsx)(O,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({name:e.key}),children:e.name},e.key)),(s??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(O,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({name:e.key}),children:e.name},e.key))]})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:v()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:f()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(rn,{chart:e,groups:c??[]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:me()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ue()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,X.jsx)(en,{chart:e})]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:ut()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ve()})]}),(()=>{let e=(s??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:le()}):(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,X.jsx)(an,{chart:e},e.key))})})()]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:ze()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:r()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(O,{variant:l===e?`default`:`outline`,size:`sm`,onClick:()=>void i({mode:e}),children:qt(e)},e))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:ge()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Me()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:vt().map(e=>(0,X.jsx)(O,{variant:u===e.value?`default`:`outline`,size:`sm`,onClick:()=>void a({locale:e.value}),children:e.label},e.value))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Oe()})]})]})}function sn(){let e=b(E.me.getMe,{host:V}),t=ft(e?.resolvedThemeMode);return(0,X.jsxs)(`div`,{className:`oc-appearance`,children:[(0,X.jsx)(Zt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,X.jsx)(Qt,{}),(0,X.jsx)(nn,{}),e?.role===`admin`?(0,X.jsx)(on,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function cn(){let[e,t]=(0,K.useState)(!0),[n,r]=(0,K.useState)(`per-user`),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(Z),[c,l]=(0,K.useState)(Z),[u,d]=(0,K.useState)(Gt),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(Gt)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(sn,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:Ae()}),(0,X.jsxs)(Q,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(O,{children:`Default`}),(0,X.jsx)(O,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(O,{variant:`outline`,children:`Outline`}),(0,X.jsx)(O,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(O,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(O,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(O,{size:`sm`,children:`Small`}),(0,X.jsx)(O,{children:`Default`}),(0,X.jsx)(O,{size:`lg`,children:`Large`}),(0,X.jsx)(O,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(N,{})}),(0,X.jsx)(O,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)(Q,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{children:`Default`}),(0,X.jsx)(A,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(A,{variant:`outline`,children:`Outline`}),(0,X.jsx)(A,{variant:`destructive`,children:`Destructive`})]})}),(0,X.jsx)(Q,{title:`Inputs & selection`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(B,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(I,{value:n,onValueChange:r,children:[(0,X.jsx)(k,{className:`w-56`,children:(0,X.jsx)(z,{placeholder:`Select…`})}),(0,X.jsxs)(L,{children:[(0,X.jsx)(F,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(F,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(H,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,X.jsx)(Q,{title:`Filtres & plage temporelle`,description:`Barre réutilisable (recherche debouncée + selects rapides à largeur auto + plage façon Grafana) et constructeur de filtre avancé. Câblée dans Users, Groups, Comptes de service, Traces, Anomalies, Audit et KPI.`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsxs)(kt,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(I,{value:o,onValueChange:s,children:[(0,X.jsx)(k,{size:`sm`,children:(0,X.jsx)(z,{})}),(0,X.jsxs)(L,{children:[(0,X.jsx)(F,{value:Z,children:`Toutes directions`}),(0,X.jsx)(F,{value:`inbound`,children:`inbound`}),(0,X.jsx)(F,{value:`outbound`,children:`outbound`}),(0,X.jsx)(F,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(I,{value:c,onValueChange:l,children:[(0,X.jsx)(k,{size:`sm`,children:(0,X.jsx)(z,{})}),(0,X.jsxs)(L,{children:[(0,X.jsx)(F,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(F,{value:`info`,children:`info`}),(0,X.jsx)(F,{value:`warn`,children:`warn`}),(0,X.jsx)(F,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(At,{fields:Kt,onChange:()=>{}}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,X.jsx)(Ot,{value:u,onChange:d})]})]})}),(0,X.jsx)(Q,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(ht,{children:[(0,X.jsx)(mt,{asChild:!0,children:(0,X.jsx)(O,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(N,{})})}),(0,X.jsxs)(gt,{align:`start`,children:[(0,X.jsx)(dt,{children:`Actions`}),(0,X.jsx)(M,{}),(0,X.jsx)(P,{children:`Edit`}),(0,X.jsx)(P,{children:`Duplicate`}),(0,X.jsx)(M,{}),(0,X.jsx)(P,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)(Q,{title:`Card`,children:(0,X.jsxs)(wt,{className:`w-80`,children:[(0,X.jsxs)(yt,{children:[(0,X.jsx)(St,{children:`Instance`}),(0,X.jsx)(Ct,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(xt,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(bt,{className:`gap-2`,children:[(0,X.jsx)(O,{size:`sm`,children:`Save`}),(0,X.jsx)(O,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,X.jsx)(Q,{title:`Table`,children:(0,X.jsxs)(Dt,{children:[(0,X.jsx)(Tt,{children:(0,X.jsxs)(W,{children:[(0,X.jsx)(U,{className:`w-8`,children:(0,X.jsx)(H,{"aria-label":`select all`})}),(0,X.jsx)(U,{children:`Name`}),(0,X.jsx)(U,{children:`Mode`}),(0,X.jsx)(U,{className:`text-right`,children:`Status`}),(0,X.jsx)(U,{className:`w-8`})]})}),(0,X.jsx)(Et,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(W,{children:[(0,X.jsx)(G,{children:(0,X.jsx)(H,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(G,{className:`font-medium`,children:e.n}),(0,X.jsx)(G,{children:(0,X.jsx)(A,{variant:`secondary`,children:e.m})}),(0,X.jsx)(G,{className:`text-right`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,X.jsx)(j,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(G,{children:(0,X.jsx)(O,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(N,{})})})]},e.n))})]})}),(0,X.jsx)(Q,{title:`App fragments`,description:`Chat-specific components`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,X.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,X.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,X.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,X.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,X.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,X.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,X.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,X.jsx)(`span`,{className:`oc-run-status__dot`}),(0,X.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{cn as ThemeShowroom};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$x as r,AS as i,Ak as a,Bk as o,CS as s,D as c,DS as l,Di as u,Dk as d,ES as f,Ei as p,Ek as m,Fk as h,Fz as g,Gk as _,Hk as v,Ik as y,Iz as b,Jk as x,Kk as S,Lk as C,MS as w,Mk as ee,Nk as te,OS as T,Oi as ne,Ok as re,Pk as ie,Qx as ae,Rk as oe,SS as se,TS as ce,Tk as le,Uk as ue,Vk as de,Wk as E,Xx as D,Yk as O,Yx as k,Zx as A,_S as fe,_k as j,aS as pe,bS as me,bk as he,cS as ge,ck as M,dS as _e,dk as N,eS as ve,fS as ye,fk as P,gS as be,gk as xe,hS as Se,hk as Ce,iS as we,jS as Te,jk as Ee,kS as De,kk as Oe,lS as ke,lk as Ae,mS as je,mk as Me,nS as Ne,oS as Pe,ok as Fe,pS as Ie,pk as Le,qk as Re,rS as ze,sS as Be,sk as Ve,t as F,tS as He,uS as Ue,uk as We,vS as Ge,vk as Ke,wS as qe,xS as Je,yS as I,yk as Ye,zk as Xe}from"./api-Cpjr7qvl.js";import{t as Ze}from"./x-Dqrt5OdW.js";import{i as L,n as R,r as Qe,t as $e}from"./tabs-DHs6yOVA.js";import{t as z}from"./button-CbwCr9Pi.js";import{$ as B,Dn as et,Et as V,Fn as tt,Gn as nt,H as rt,Hn as it,Mn as at,Q as H,Wn as ot,X as U,Z as W,a as st,at as ct,ct as G,et as K,i as lt,jn as ut,lt as dt,nt as ft,o as pt,ot as mt,q as ht,rt as gt,s as _t,tt as vt}from"./index-Bc3aF-kJ.js";import{n as yt}from"./TimeRangePicker-BlRNLd96.js";import{t as bt}from"./FilterBar-FHDxb3k3.js";import{t as xt}from"./AdvancedFilter-Bm1TIX9k.js";import{t as St}from"./DataTableShell-DWXPn72S.js";var Ct=c(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),q=t(e(),1),J=n(),Y={kind:`relative`,from:`now-520w`,to:`now`},X=e=>e===null?`-`:String(Math.round(e));function wt(e){let t=e.indexOf(`:`);if(t<0)return e;let n=e.slice(0,t),r=e.slice(t+1);return n===`admin`?a():n===`agent`?`${Oe()} - ${r}`:e}function Tt(){let e=b(F.me.getMe,{host:ht})?.role===`admin`,t=b(F.deliveryTiming.getDeliveryStatus,{}),n=g(F.deliveryTiming.startDeliveryRecord),r=g(F.deliveryTiming.stopDeliveryRecord),[i,a]=(0,q.useState)(!1),[o,s]=(0,q.useState)(!1),c=t?.recording??!1,l=async()=>{s(!0);try{c?await r({}):await n({})}finally{s(!1)}};return(0,J.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h3`,{className:`text-sm font-semibold`,children:O()}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:x()})]}),e?(0,J.jsx)(z,{variant:c?`destructive`:`default`,size:`sm`,disabled:o||t===void 0,onClick:()=>void l(),children:c?S():Re()}):null]}),c?(0,J.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,J.jsx)(V,{variant:`secondary`,children:_()}),t?.startedAt?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:E({time:dt(t.startedAt)})}):null]}):null,(0,J.jsx)(`div`,{children:(0,J.jsx)(z,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?de():v()})}),i?(0,J.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=b(F.deliveryTiming.listDeliverySessions,{}),n=g(F.deliveryTiming.deleteDeliverySessions),[r,i]=(0,q.useState)(``),[a,s]=(0,q.useState)(`all`),[c,l]=(0,q.useState)(Y),[u,f]=(0,q.useState)(null),{from:p,to:_}=yt(c),v=c.to===`now`?1/0:_,x=r.trim()!==``||a!==`all`||c!==Y,S=()=>{i(``),s(`all`),l(Y)},w=(0,q.useMemo)(()=>{if(t===void 0)return;let e=r.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(a===`all`||(a===`active`?t.active:!t.active))&&t.startedAt>=p&&t.startedAt<=v).map(e=>({...e,_id:e.sessionId}))},[t,r,a,p,v]),T=e=>{let t=new Set((w??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),u!==null&&r.includes(u)&&f(null))};return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(bt,{q:r,onQChange:i,searchPlaceholder:Xe(),timeRange:c,onTimeRangeChange:l,onReset:S,canReset:x,children:(0,J.jsxs)(U,{value:a,onValueChange:e=>s(e),children:[(0,J.jsx)(B,{size:`sm`,className:`w-36`,children:(0,J.jsx)(K,{})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(H,{value:`all`,children:oe()}),(0,J.jsx)(H,{value:`active`,children:C()}),(0,J.jsx)(H,{value:`stopped`,children:y()})]})]})}),(0,J.jsx)(St,{title:o(),rows:w,emptyHint:Ve(),columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(z,{variant:`ghost`,size:`icon`,"aria-label":u===e.sessionId?d():re(),onClick:()=>f(t=>t===e.sessionId?null:e.sessionId),children:u===e.sessionId?(0,J.jsx)(at,{size:15,"aria-hidden":!0}):(0,J.jsx)(ut,{size:15,"aria-hidden":!0})})},{header:h(),sort:e=>e.startedAt,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:G(e.startedAt)})},{header:ie(),sort:e=>e.stoppedAt,cell:e=>e.stoppedAt===null?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,J.jsx)(`span`,{className:`tabular-nums`,children:G(e.stoppedAt)})},{header:te(),sort:e=>e.count,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:X(e.count)})},{header:ee(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:Ee(),sort:e=>e.active,cell:e=>e.active?(0,J.jsx)(V,{variant:`secondary`,children:C()}):(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:y()})}],rowActions:e?e=>[{label:m(),variant:`destructive`,onSelect:()=>T([e.sessionId])}]:void 0,bulkActions:e?[{label:m(),variant:`destructive`,onSelect:e=>T(e)}]:void 0,isExpanded:e=>e.sessionId===u,renderExpanded:e=>(0,J.jsx)(Dt,{sessionId:e.sessionId})})]})}function Dt({sessionId:e}){let t=b(F.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,q.useState)(!1);return(0,J.jsx)(Ot,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(rt(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function Ot({report:e,copied:t,onCopy:n}){if(!e)return(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:le()});if(e.count===0||e.segments===null)return(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:ue()});let r=e.segments,i=(e,t)=>(0,J.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,J.jsx)(`td`,{className:`py-1`,children:e}),(0,J.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:t.count}),(0,J.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[X(t.p50),` / `,X(t.p95),` / `,X(t.max)]})]});return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` `,Fe()]}),(0,J.jsxs)(z,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,J.jsx)(it,{size:13,"aria-hidden":!0}):(0,J.jsx)(tt,{size:13,"aria-hidden":!0}),t?M():Ae()]})]}),(0,J.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{className:`text-left text-muted-foreground`,children:[(0,J.jsx)(`th`,{className:`py-1 font-medium`,children:Ke()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:j()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:xe()})]})}),(0,J.jsxs)(`tbody`,{children:[i(Ce(),r.bridge),i(Me(),r.A),i(Le(),r.C)]})]}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:P()}),e.truncated?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:We()}):null,(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:N()})]})}var kt=[50,100,200,500],Z=`all`,Q=`__all__`,At=[`2xx`,`4xx`,`5xx`],jt=[`user`,`service`,`system`],Mt=[`inbound`,`outbound`,`internal`],Nt={kind:`relative`,from:`now-30d`,to:`now`},Pt=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:ne()},{value:`principalType`,label:u()},{value:`direction`,label:`direction`},{value:`roleKey`,label:p()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function Ft(){let e=nt({from:`/settings/traces`}),t=ot({from:`/settings/traces`}),n=e.limit,a=e.kind,o=e.statusClass??Q,c=e.principalType??Q,u=e.direction??Q,d=e.roleKey??Q,p=e.q??``,m=e.correlationId,h=lt(e.from,e.to),g=(0,q.useMemo)(()=>_t(e.adv),[e.adv]),{from:_,to:v}=yt(h),[y,x]=(0,q.useState)(null),[S,C]=(0,q.useState)(null),ee=e=>void t({search:t=>({...t,limit:e})}),te=e=>void t({search:t=>({...t,kind:e})}),ne=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),re=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),ie=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),oe=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),le=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),ue=e=>void t({search:t=>({...t,...pt(e)})}),de=e=>void t({search:t=>({...t,adv:st(e)}),replace:!0}),E=b(F.observability.listEvents,{limit:n}),D=b(F.observability.listEvents,{limit:n,kind:a===Z?void 0:a,...m?{correlationId:m}:{},filter:{q:p||void 0,from:_,to:v,statusClass:o===Q?void 0:o,principalType:c===Q?void 0:c,direction:u===Q?void 0:u,roleKey:d===Q?void 0:d,advanced:g.length>0?g:void 0}}),O=(0,q.useMemo)(()=>{let e=new Set;for(let t of E??[])e.add(t.kind);return[...e].sort()},[E]),k=(0,q.useMemo)(()=>{let e=new Set;for(let t of E??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[E]),A=p!==``||o!==Q||c!==Q||u!==Q||d!==Q||g.length>0||h.kind!==`relative`||h.from!==Nt.from;function j(){t({search:{limit:100,kind:`all`},replace:!0})}let M=y?E?.filter(e=>e.correlationId===y):D,N=e.section,P=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,J.jsxs)($e,{value:N,onValueChange:e=>P(e),children:[(0,J.jsxs)(Qe,{className:`w-full`,children:[(0,J.jsxs)(L,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(et,{size:13,"aria-hidden":!0}),he()]}),(0,J.jsxs)(L,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(Ct,{size:13,"aria-hidden":!0}),Ye()]})]}),(0,J.jsx)(R,{value:`latency`,children:(0,J.jsx)(Tt,{})}),(0,J.jsxs)(R,{value:`events`,className:`flex flex-col gap-3`,children:[(0,J.jsxs)(`p`,{className:`oc-admin__hint`,children:[w(),(0,J.jsx)(`strong`,{children:Te()}),i(),` `,(0,J.jsx)(`span`,{className:`oc-filter__window`,children:De()})]}),(0,J.jsxs)(bt,{q:p,onQChange:ne,searchPlaceholder:T(),timeRange:h,onTimeRangeChange:ue,onReset:j,canReset:A,children:[(0,J.jsxs)(U,{value:o,onValueChange:re,children:[(0,J.jsx)(B,{size:`sm`,className:`w-32`,children:(0,J.jsx)(K,{placeholder:l()})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(H,{value:Q,children:f()}),At.map(e=>(0,J.jsx)(H,{value:e,children:e},e))]})]}),(0,J.jsxs)(U,{value:c,onValueChange:ie,children:[(0,J.jsx)(B,{size:`sm`,className:`w-32`,children:(0,J.jsx)(K,{placeholder:ce()})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(H,{value:Q,children:qe()}),jt.map(e=>(0,J.jsx)(H,{value:e,children:e},e))]})]}),(0,J.jsxs)(U,{value:u,onValueChange:oe,children:[(0,J.jsx)(B,{size:`sm`,className:`w-32`,children:(0,J.jsx)(K,{placeholder:s()})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(H,{value:Q,children:se()}),Mt.map(e=>(0,J.jsx)(H,{value:e,children:e},e))]})]}),(0,J.jsxs)(U,{value:d,onValueChange:le,children:[(0,J.jsx)(B,{size:`sm`,className:`w-36`,children:(0,J.jsx)(K,{placeholder:Je()})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(H,{value:Q,children:me()}),k.map(e=>(0,J.jsx)(H,{value:e,children:e},e))]})]}),(0,J.jsx)(`input`,{list:`oc-trace-kinds`,className:`oc-input oc-input--sm w-44`,value:a===Z?``:a,placeholder:I(),"aria-label":I(),onChange:e=>{let t=e.target.value.trim();te(t===``?Z:t)}}),(0,J.jsx)(`datalist`,{id:`oc-trace-kinds`,children:O.map(e=>(0,J.jsx)(`option`,{value:e},e))}),(0,J.jsxs)(U,{value:String(n),onValueChange:e=>ee(Number(e)),children:[(0,J.jsx)(B,{size:`sm`,className:`w-28`,children:(0,J.jsx)(K,{})}),(0,J.jsx)(W,{children:kt.map(e=>(0,J.jsx)(H,{value:String(e),children:Ge({count:e})},e))})]})]}),(0,J.jsx)(xt,{fields:Pt,seed:g,onChange:de}),y?(0,J.jsx)(`div`,{className:`oc-traces__followline`,children:(0,J.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>x(null),title:fe(),children:[(0,J.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[be(),(0,J.jsx)(`code`,{children:$(y)})]}),(0,J.jsx)(Ze,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,J.jsx)(`span`,{className:`sr-only`,children:Se()})]})}):null,(0,J.jsx)(St,{title:je(),rows:M,emptyHint:y?Ie():ye(),columns:[{header:_e(),sort:e=>e.at,cell:e=>(0,J.jsx)(`span`,{className:`oc-traces__time`,children:G(e.at)})},{header:Ue(),sort:e=>e.kind,cell:e=>(0,J.jsx)(V,{variant:`secondary`,children:e.kind})},{header:ke(),sort:e=>Lt(e)??null,cell:e=>{let t=Lt(e);return t?(0,J.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,J.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":ge(),children:`✓`})}},{header:Be(),sort:e=>e.direction,cell:e=>e.direction?(0,J.jsx)(V,{variant:`outline`,children:e.direction}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Pe(),sort:e=>e.principalType,cell:e=>(0,J.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,J.jsx)(V,{variant:`outline`,children:e.principalType}),e.principalId?(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:pe(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,J.jsx)(V,{variant:`secondary`,children:e.roleKey}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:we(),sort:e=>e.route,cell:e=>e.route?(0,J.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,J.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:ze(),sort:e=>e.status,cell:e=>e.status===null?(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,J.jsx)(`span`,{className:`oc-traces__status ${It(e.status)}`,children:e.status})},{header:Ne(),sort:e=>e.latencyMs,cell:e=>e.latencyMs===null?(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,J.jsxs)(`span`,{className:`oc-traces__mono`,children:[e.latencyMs,` ms`]})},{header:He(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,J.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:ve(),onClick:()=>x(e.correlationId),children:$(e.correlationId)}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:r(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,J.jsx)(z,{variant:`outline`,size:`sm`,onClick:()=>C(e),children:ae()}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,J.jsx)(Rt,{row:S,onClose:()=>C(null)})]})]})}function It(e){return e>=500?`oc-traces__status--5xx`:e>=400?`oc-traces__status--4xx`:e>=200&&e<300?`oc-traces__status--2xx`:`oc-traces__status--other`}function $(e){return e.length>8?e.slice(0,8):e}function Lt(e){if(typeof e.status==`number`&&e.status>=400)return String(e.status);if(!e.meta)return null;try{let t=JSON.parse(e.meta);if(e.kind===`openclaw.dispatch`&&t.dispatchStatus===`failed`)return t.errorCode??`failed`;if(e.kind===`assistant.stream`&&t.phase===`finalize`&&(t.streamStatus===`error`||t.streamStatus===`aborted`))return t.streamStatus;if(e.kind===`openclaw.ingest.denied`)return`denied`}catch{}return null}function Rt({row:e,onClose:t}){let n=(0,q.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,J.jsx)(vt,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,J.jsxs)(ft,{className:`max-w-lg`,children:[(0,J.jsxs)(ct,{children:[(0,J.jsxs)(mt,{className:`oc-traces__meta-title`,children:[A(),` `,(0,J.jsx)(`code`,{children:e.kind}),(0,J.jsx)(V,{variant:`outline`,children:D()})]}),(0,J.jsx)(gt,{children:k()})]}),(0,J.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{Ft as TracesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$E as r,AE as i,CD as a,Fz as o,Iz as s,QE as c,SD as l,XE as u,YE as d,ZE as f,_D as ee,_x as p,aD as te,bD as ne,bx as m,cD as re,dD as ie,dx as h,eD as ae,ep as g,fD as oe,fx as _,gD as se,gx as v,hD as ce,hx as y,iD as b,lD as le,lx as x,mD as ue,mx as S,nD as C,np as w,oD as T,pD as E,px as D,rD as de,sD as fe,t as O,tD as pe,tp as k,uD as me,ux as A,vD as he,vx as j,xD as M,xx as N,yD as ge,yx as P}from"./api-Cpjr7qvl.js";import{t as F}from"./button-CbwCr9Pi.js";import{$ as I,Dt as L,Et as R,Ft as z,Gn as _e,Lt as ve,Mt as ye,Nt as be,Pt as xe,Q as B,U as Se,W as Ce,Wn as we,X as V,Z as H,at as Te,c as U,dn as W,et as G,fn as K,l as Ee,nt as De,ot as Oe,q as ke,rt as Ae,tt as je,u as q,ut as J}from"./index-Bc3aF-kJ.js";import{t as Me}from"./FilterBar-FHDxb3k3.js";import{t as Ne}from"./DataTableShell-DWXPn72S.js";import{t as Pe}from"./DetailChips-D6mdBUOT.js";var Y=t(e(),1),X=n();function Z({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=s(O.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),a=s(O.agents.listUserAgents,n&&e?{profileId:e}:`skip`),o=new Set((a??[]).map(e=>`${e.instanceName}/${e.agentId}`)),c=(a??[]).find(e=>e.isDefault)??null,l=c?`${c.instanceName}/${c.agentId}`:null,u=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),d=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(a??[]).filter(e=>!u.has(`${e.instanceName}/${e.agentId}`)).map(e=>({instanceName:e.instanceName,agentId:e.agentId,displayName:e.displayName,emoji:e.emoji,model:e.model,kind:e.kind,enabled:e.enabled,state:e.state,outOfPool:!0}))],f=new Map;for(let e of d){let t=f.get(e.instanceName)??[];t.push(e),f.set(e.instanceName,t)}return(0,X.jsx)(je,{open:n,onOpenChange:r,children:(0,X.jsxs)(De,{className:`oc-access`,children:[(0,X.jsxs)(Te,{children:[(0,X.jsx)(Oe,{children:N({user:t})}),(0,X.jsx)(Ae,{children:m()})]}),i?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?P():j()}):null,(0,X.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:p()}):d.length===0?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:S()}):[...f.entries()].map(([t,n])=>(0,X.jsx)(Fe,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:o,defaultKey:l},t))})]})})}function Fe({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:a}){let s=o(O.agents.assignAgent),c=o(O.agents.removeAgent),l=o(O.agents.setDefaultAgent),u=L();if(!e)return null;async function d(n,r){try{r?await c({profileId:e,instanceName:t,agentId:n}):await s({profileId:e,instanceName:t,agentId:n})}catch(e){u.error(v(),e)}}async function f(n){try{await l({profileId:e,instanceName:t,agentId:n})}catch(e){u.error(y(),e)}}return(0,X.jsxs)(`div`,{className:`oc-access__group`,children:[(0,X.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,X.jsx)(K,{size:13,"aria-hidden":!0}),(0,X.jsx)(`span`,{children:t}),(0,X.jsx)(R,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=i.has(n),o=a===n,s=e.state===`deleted`,c=!e.enabled;return(0,X.jsxs)(`div`,{className:`oc-access__row${c?` is-disabled`:``}`,children:[(0,X.jsx)(J,{checked:r,disabled:(s||c)&&!r,onCheckedChange:()=>void d(e.agentId,r),"aria-label":D({name:e.displayName??e.agentId})}),(0,X.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,X.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,s?(0,X.jsx)(R,{variant:`outline`,className:`oc-access__gone`,children:_()}):null,e.outOfPool?(0,X.jsx)(R,{variant:`outline`,className:`oc-access__gone`,children:h()}):null,r?o?(0,X.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":A(),title:A(),children:(0,X.jsx)(W,{size:14,fill:`currentColor`})}):(0,X.jsx)(F,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":x(),title:x(),disabled:c,onClick:()=>void f(e.agentId),children:(0,X.jsx)(W,{size:14})}):null]},e.agentId)})]})}var Q=`__all__`;function $(e){switch(e){case`pending`:return g();case`user`:return k();case`admin`:return w();default:return e}}function Ie({granted:e,onToggle:t}){let n=new Set(e),r=U.filter(e=>n.has(q[e])).length;return(0,X.jsxs)(ye,{children:[(0,X.jsx)(ve,{asChild:!0,children:(0,X.jsx)(F,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?a():l({count:r})})}),(0,X.jsxs)(be,{align:`start`,className:`w-52`,children:[(0,X.jsx)(z,{children:M()}),U.map(e=>{let r=q[e];return(0,X.jsxs)(xe,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,X.jsx)(J,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,X.jsx)(`span`,{children:Ee[e]()})]},e)})]})]})}function Le(){let e=_e({from:`/settings/users`}),t=we({from:`/settings/users`}),n=e.q??``,a=e.role??Q,l=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),p=e=>void t({search:t=>({...t,role:e===Q?void 0:e})}),m=s(O.admin.listUsers,{filter:{q:n||void 0,role:a===Q?void 0:a},withAgents:!0}),h=s(O.me.getMe,{host:ke}),g=o(O.admin.setRole),_=o(O.admin.setUserPermissions),v=o(O.admin.startImpersonation),y=o(O.admin.deleteUser),x=o(O.admin.setUserName),S=Se(),w=Ce(),D=L(),[k,A]=(0,Y.useState)(null),j=(0,Y.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of m??[])e.add(t.role);return[...e]},[m]),M=n!==``||a!==Q;function N(){t({search:{},replace:!0})}async function P(e){try{await g(e)}catch(e){D.error(ne(),e)}}async function F(e){try{await _(e)}catch(e){D.error(ge(),e)}}async function R(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await S({title:oe(),description:ie({user:t}),confirmWord:me(),confirmLabel:le(),destructive:!0}))try{await y({profileId:e._id}),D.success(fe({user:t}))}catch(e){D.error(re(),e)}}async function z(e){let t=e.email||e.name||e.userId.slice(0,8),n=await w({title:te(),label:b({user:t}),placeholder:de(),defaultValue:e.name??``,confirmLabel:i()});if(n!==null)try{await x({profileId:e._id,name:n}),D.success(C())}catch(e){D.error(pe(),e)}}return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Me,{q:n,onQChange:l,searchPlaceholder:he(),onReset:N,canReset:M,children:(0,X.jsxs)(V,{value:a,onValueChange:p,children:[(0,X.jsx)(I,{size:`sm`,className:`w-36`,children:(0,X.jsx)(G,{})}),(0,X.jsxs)(H,{children:[(0,X.jsx)(B,{value:Q,children:ee()}),j.map(e=>(0,X.jsx)(B,{value:e,children:$(e)},e))]})]})}),(0,X.jsx)(Ne,{title:se(),rows:m,emptyHint:ce(),rowActions:e=>{let t=[{label:d(),onSelect:()=>A({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:T(),onSelect:()=>void z(e)}];return e.userId!==h?.userId&&t.push({label:ue(),onSelect:()=>void v({profileId:e._id})},{label:E(),variant:`destructive`,onSelect:()=>void R(e)}),t},columns:[{header:ae(),cell:e=>{let t=e.email||e.name||e.canonical||e.userId.slice(0,8),n=e.email&&e.name&&e.name!==e.email?e.name:null;return(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[(0,X.jsx)(`span`,{children:t}),n?(0,X.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}):null]})},sort:e=>e.email||e.name||e.canonical||e.userId},{header:r(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,X.jsxs)(V,{value:e.role,onValueChange:t=>void P({profileId:e._id,role:t}),children:[(0,X.jsx)(I,{size:`sm`,className:`w-28`,children:(0,X.jsx)(G,{})}),(0,X.jsxs)(H,{children:[(0,X.jsx)(B,{value:`pending`,children:$(`pending`)}),(0,X.jsx)(B,{value:`user`,children:$(`user`)}),(0,X.jsx)(B,{value:`admin`,children:$(`admin`)})]})]})},{header:c(),sort:e=>e.role===`admin`?9999:e.extraPermissions?.length??0,cell:e=>e.role===`admin`?(0,X.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:f()}):(0,X.jsx)(Ie,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),F({profileId:e._id,permissions:[...n]})}})},{header:u(),cell:e=>(0,X.jsx)(Pe,{icon:(0,X.jsx)(K,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,X.jsx)(Z,{profileId:k?.profileId??null,userLabel:k?.label??``,open:k!==null,onOpenChange:e=>{e||A(null)}})]})}export{Le as UsersTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{An as r,Ar as i,Br as a,Cn as o,Cr as s,DO as c,Dn as l,Dr as u,Dz as d,Er as f,Fr as p,Fz as m,Gr as h,Gu as ee,Hr as g,Ir as _,Iz as v,Kr as te,Lr as ne,Mr as re,Nr as y,Nz as ie,On as ae,Or as b,Pr as x,Rn as S,Rr as C,Sn as w,Tr as T,Ur as E,Uu as oe,Vr as D,Wr as se,_n as ce,gn as le,in as ue,jn as de,jr as fe,kn as pe,kr as O,kz as me,mf as k,qr as A,t as j,vn as M,wn as N,wr as P,xn as F,yn as I,zr as L}from"./api-Cpjr7qvl.js";import{i as R,n as z,r as he,t as ge}from"./tabs-DHs6yOVA.js";import{t as B}from"./button-CbwCr9Pi.js";import{$ as V,$t as H,Et as U,Gn as _e,Q as W,Sn as ve,Un as ye,Wn as be,X as G,Z as K,an as xe,en as Se,et as q,in as J,nn as Ce,q as we,rn as Y,sn as Te,tn as Ee,ut as X}from"./index-Bc3aF-kJ.js";/* empty css */var Z=t(e(),1),Q=n(),De=[[`auto`,()=>a()],[`fr-FR`,()=>de()],[`en-US`,()=>r()],[`en-GB`,()=>pe()],[`de-DE`,()=>ae()],[`es-ES`,()=>l()]],Oe=[[`0.75`,()=>C()],[`1`,()=>ne()],[`1.25`,()=>_()],[`1.5`,()=>p()]],$=0;function ke({instance:e}){let t=m(j.admin.upsertInstanceConfig),n=e.config??{},r={enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0},[a,o]=(0,Z.useState)(r),[s,c]=(0,Z.useState)(`idle`),[l,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)(!1),p=ie(j.voice.gatewayTtsPreview);(0,Z.useEffect)(()=>{o({enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0}),c(`idle`)},[e._id]);let h=a.enabled!==r.enabled||a.engine!==r.engine||a.lang!==r.lang||a.rate!==r.rate||a.autoRead!==r.autoRead;async function _(){c(`saving`);try{let n={...e.config??{}};n.voiceEnabled=a.enabled,a.engine===`gateway`?n.voiceEngine=`gateway`:delete n.voiceEngine,a.lang===`auto`?delete n.voiceLang:n.voiceLang=a.lang;let r=Number.parseFloat(a.rate);!Number.isFinite(r)||r===1?delete n.voiceRate:n.voiceRate=r,a.autoRead?n.voiceAutoRead=!0:delete n.voiceAutoRead,await t({instanceId:e._id,config:n}),c(`idle`)}catch{c(`error`)}}return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:e.name}),(0,Q.jsx)(U,{variant:`secondary`,children:e.kind===`hermes`?`Hermes`:`OpenClaw`})]}),(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(X,{checked:a.enabled,onCheckedChange:e=>o({...a,enabled:e===!0}),"aria-label":g()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:g()})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:I()}),(0,Q.jsxs)(G,{value:a.engine,onValueChange:e=>o({...a,engine:e}),disabled:!a.enabled,children:[(0,Q.jsx)(V,{size:`sm`,"aria-label":I(),children:(0,Q.jsx)(q,{})}),(0,Q.jsxs)(K,{children:[(0,Q.jsx)(W,{value:`browser`,children:M()}),e.kind===`hermes`?null:(0,Q.jsx)(W,{value:`gateway`,children:ce()})]})]})]}),a.engine===`gateway`?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:le()}):null,a.engine===`gateway`?null:(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:D()}),(0,Q.jsxs)(G,{value:a.lang,onValueChange:e=>o({...a,lang:e}),disabled:!a.enabled,children:[(0,Q.jsx)(V,{size:`sm`,"aria-label":D(),children:(0,Q.jsx)(q,{})}),(0,Q.jsx)(K,{children:De.map(([e,t])=>(0,Q.jsx)(W,{value:e,children:t()},e))})]})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:L()}),(0,Q.jsxs)(G,{value:a.rate,onValueChange:e=>o({...a,rate:e}),disabled:!a.enabled,children:[(0,Q.jsx)(V,{size:`sm`,"aria-label":L(),children:(0,Q.jsx)(q,{})}),(0,Q.jsx)(K,{children:Oe.map(([e,t])=>(0,Q.jsx)(W,{value:e,children:t()},e))})]})]}),a.engine===`gateway`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(X,{checked:a.autoRead,onCheckedChange:e=>o({...a,autoRead:e===!0}),disabled:!a.enabled,"aria-label":x()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:x()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:y()})]}),(0,Q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,Q.jsx)(B,{size:`sm`,disabled:!h||s===`saving`,onClick:()=>void _(),children:s===`saving`?k():ee()}),(0,Q.jsx)(B,{variant:`outline`,size:`sm`,disabled:!a.enabled||l,onClick:()=>{let t=Number.parseFloat(a.rate)||1,n=++$;if(f(!1),J(),Y(),a.engine!==`gateway`){Ce(i(),{lang:Ee(a.lang,me()),rate:t});return}u(!0),p({instanceName:e.name,text:i()}).then(({mime:e,audioBase64:r})=>{n===$&&Se(r,e,{rate:t})}).catch(()=>{n===$&&f(!0)}).finally(()=>u(!1))},children:l?k():re()}),(0,Q.jsx)(B,{variant:`ghost`,size:`sm`,onClick:()=>{$++,u(!1),J(),Y()},children:fe()})]}),s===`error`||d?(0,Q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:d?ue():oe()}):null]})}function Ae({stt:e}){let t=v(j.me.getMe,{host:we}),n=m(j.admin.setFeatureEnabled),r=t?.ui?.featuresEnabled?.voiceInput===!0,i=t?.role===`admin`;return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:b()}),(0,Q.jsx)(U,{variant:e?`secondary`:`outline`,children:e?P():s()}),(0,Q.jsx)(U,{variant:r?`secondary`:`destructive`,children:r?o():w()})]}),i?(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(X,{checked:r,onCheckedChange:e=>void n({key:`voiceInput`,enabled:e===!0}),"aria-label":N()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:N()})]}):null,(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:u()})]})}function je(){let e=v(j.admin.listInstances,{}),t=(0,Z.useMemo)(()=>xe(),[]),n=(0,Z.useMemo)(()=>H(),[]),{section:r}=_e({from:`/settings/voice`}),i=be({from:`/settings/voice`});return(0,Q.jsxs)(`div`,{className:`oc-admin__tab oc-voice`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:A()}),(0,Q.jsxs)(`div`,{className:`oc-voice__support`,children:[(0,Q.jsx)(U,{variant:t?`secondary`:`destructive`,children:t?te():h()}),(0,Q.jsx)(U,{variant:n?`secondary`:`destructive`,children:n?se():E()})]}),(0,Q.jsxs)(ge,{value:r,onValueChange:e=>void i({search:{section:e},replace:!0}),children:[(0,Q.jsxs)(he,{className:`w-full`,children:[(0,Q.jsxs)(R,{value:`readaloud`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Te,{size:13,"aria-hidden":!0}),F()]}),(0,Q.jsxs)(R,{value:`dictation`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(ve,{size:13,"aria-hidden":!0}),b()]}),(0,Q.jsxs)(R,{value:`talk`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(ye,{size:13,"aria-hidden":!0}),f()]})]}),(0,Q.jsx)(z,{value:`readaloud`,children:e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:d()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:O()}):e.map(e=>(0,Q.jsx)(ke,{instance:e},e._id))}),(0,Q.jsx)(z,{value:`dictation`,children:(0,Q.jsx)(Ae,{stt:n})}),(0,Q.jsxs)(z,{value:`talk`,children:[(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsx)(`header`,{className:`oc-voice__cardhead`,children:(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:f()})}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:T()})]}),e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:d()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:O()}):e.map(e=>(0,Q.jsx)(Me,{instance:e},e._id))]})]})]})}function Me({instance:e}){let t=m(j.admin.upsertInstanceConfig),n=e.config??{},r=n.talkEnabled===!0,i=e.kind===`hermes`;return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:e.name}),(0,Q.jsx)(U,{variant:`secondary`,children:i?`Hermes`:`OpenClaw`})]}),i?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:S()}):(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(X,{checked:r,onCheckedChange:r=>{let i={...n};r===!0?i.talkEnabled=!0:delete i.talkEnabled,t({instanceId:e._id,config:i})},"aria-label":c()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:c()})]})]})}export{je as VoiceTab};
@@ -1 +0,0 @@
1
- import{D as e}from"./api-Cpjr7qvl.js";var t=e(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]);export{t};
@@ -1 +0,0 @@
1
- import{$m as e,Bm as t,Gm as n,Hm as r,Jm as i,Km as a,Qm as o,Um as s,Vm as c,Wm as l,Xm as u,Ym as d,Zm as f,_h as p,ah as m,ch as h,dh as g,eh as _,fh as v,gh as y,hh as b,ih as x,lh as S,mh as C,nh as w,oh as T,ph as E,qm as D,rh as O,sh as k,th as A,uh as j,vh as M,vt as N,yt as P}from"./api-Cpjr7qvl.js";var F={AGENT_NOT_FOUND:()=>({label:M(),hint:p()}),AUTH_TOKEN_MISMATCH:()=>({label:y(),hint:b()}),DEVICE_SIGNING_FAILED:()=>({label:C(),hint:E()}),SESSION_SCOPE_DENIED:()=>({label:v(),hint:g()}),GATEWAY_TIMEOUT:()=>({label:j(),hint:S()}),GATEWAY_DISCONNECTED:()=>({label:h(),hint:k()}),GATEWAY_RESTARTING:()=>({label:T(),hint:m()}),CONNECTION_SATURATED:()=>({label:x(),hint:O()}),DISPATCH_STALLED:()=>({label:P(),hint:N()}),ATTACHMENT_TOO_LARGE:()=>({label:_(),hint:e()}),ATTACHMENT_REJECTED:()=>({label:o(),hint:f()}),BRIDGE_UNREACHABLE:()=>({label:w(),hint:A()}),INVALID_REQUEST:()=>({label:u(),hint:d()}),NOT_CONFIGURED:()=>({label:i(),hint:D()}),UNROUTED:()=>({label:a(),hint:n()}),UPSTREAM_ERROR:()=>({label:l(),hint:s()}),UNKNOWN:()=>({label:r(),hint:c()})};function I(e){return e?F[e]?.()??{label:e,hint:t()}:F.UNKNOWN()}export{I as t};
@@ -1 +0,0 @@
1
- import{mt as e}from"./index-Bc3aF-kJ.js";export{e as Mermaid};
@@ -1 +0,0 @@
1
- import{dw as e,fw as t,hw as n,mw as r,pw as i}from"./api-Cpjr7qvl.js";var a={pending:n,user:r,admin:i,observer:t,agent:e};function o(e){if(e.builtin){let t=a[e.key];if(t)return t()}return e.description}export{o as t};
@@ -1 +0,0 @@
1
- import{D as e}from"./api-Cpjr7qvl.js";var t=e(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};