@lacneu/atrium 0.23.0 → 0.24.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 (69) hide show
  1. package/dist/assets/{AccessTab-D0FPRjwL.js → AccessTab-C890hq5h.js} +1 -1
  2. package/dist/assets/{AdvancedFilter-CtaYuy-W.js → AdvancedFilter-CF-6iZ4n.js} +1 -1
  3. package/dist/assets/AgentFilesTab-CYPdprgr.js +3 -0
  4. package/dist/assets/AnomaliesTab-CyYNzlSa.js +1 -0
  5. package/dist/assets/{AuditTab-CeHLEJ6L.js → AuditTab-eP2YLweC.js} +1 -1
  6. package/dist/assets/BridgeTab-CxVMeTWv.js +1 -0
  7. package/dist/assets/ChatDefaultsTab-BRqmAbXD.js +1 -0
  8. package/dist/assets/{DataTableShell-VIRQvS8e.js → DataTableShell-CA2F4JBD.js} +1 -1
  9. package/dist/assets/{DetailChips-YKc12Z-i.js → DetailChips-ChqqjGS2.js} +1 -1
  10. package/dist/assets/FeedbacksTab-C35UfjDU.js +1 -0
  11. package/dist/assets/{FieldLabel-BYZOkwDx.js → FieldLabel-CFiEH-0H.js} +1 -1
  12. package/dist/assets/FilesTab-DOL9P-5e.js +1 -0
  13. package/dist/assets/{FilterBar-DWv8wqqC.js → FilterBar-C-tLvndJ.js} +1 -1
  14. package/dist/assets/GroupsTab-_F5n0N-2.js +1 -0
  15. package/dist/assets/InstancesTab-B-NOKfsw.js +1 -0
  16. package/dist/assets/IntegrationsTab-yKO4UTOa.js +1 -0
  17. package/dist/assets/KpiTab-DPObMI_y.js +1 -0
  18. package/dist/assets/PreferencesTab-D1oeBbbG.js +1 -0
  19. package/dist/assets/PromptInjectionsTab-C_dafosY.js +3 -0
  20. package/dist/assets/RolesTab-C_9Nb447.js +1 -0
  21. package/dist/assets/ServiceAccountsTab-C6nYKdVo.js +1 -0
  22. package/dist/assets/{SubAgentReportsTab-24-Vy2sZ.js → SubAgentReportsTab-Bdubf3uF.js} +1 -1
  23. package/dist/assets/ThemeShowroom-DMnP1ImP.js +1 -0
  24. package/dist/assets/{TimeRangePicker-CPM9eoXo.js → TimeRangePicker-BdGF5YWf.js} +1 -1
  25. package/dist/assets/TracesTab-CuRwel3I.js +1 -0
  26. package/dist/assets/UsersTab-CaHRinV0.js +1 -0
  27. package/dist/assets/{button-9c1aLUeO.js → button-D7l3zA0T.js} +1 -1
  28. package/dist/assets/{card-DNbBWwxH.js → card-CR5hsEyC.js} +1 -1
  29. package/dist/assets/chevrons-up-down-BR24sFGo.js +1 -0
  30. package/dist/assets/{compatView-DI9WOWM-.js → compatView-D_dF0iXT.js} +1 -1
  31. package/dist/assets/{dispatchErrorInfo-DO5jqFw-.js → dispatchErrorInfo-cz6Aj_cE.js} +1 -1
  32. package/dist/assets/dist-DFdPjeR4.js +5 -0
  33. package/dist/assets/{dist-DsBcH2-2.js → dist-DeR8iMiX.js} +1 -1
  34. package/dist/assets/{dist-DM5LkQcA.js → dist-DkiDhiBf.js} +1 -1
  35. package/dist/assets/dist-lx0tRP9j.js +1 -0
  36. package/dist/assets/{highlighted-body-OFNGDK62-BVpyilpM.js → highlighted-body-OFNGDK62-C_jXXhbf.js} +1 -1
  37. package/dist/assets/index-C8EIxIiw.js +227 -0
  38. package/dist/assets/{index-CZJySt8-.css → index-DbRDkkXU.css} +1 -1
  39. package/dist/assets/mermaid-GHXKKRXX-FtWV0fED.js +1 -0
  40. package/dist/assets/roleDescriptions-DT7sihsx.js +1 -0
  41. package/dist/assets/{table-C2kpo1_K.js → table-coKQxM7M.js} +1 -1
  42. package/dist/assets/{tabs-D7vYdFs6.js → tabs-8RyO3-oV.js} +1 -1
  43. package/dist/assets/x-CrtqI3eZ.js +1 -0
  44. package/dist/index.html +8 -8
  45. package/package.json +1 -1
  46. package/dist/assets/AgentFilesTab-BnrDFGg2.js +0 -3
  47. package/dist/assets/AnomaliesTab-DbJTYrA3.js +0 -1
  48. package/dist/assets/BridgeTab-DNaXjHu5.js +0 -1
  49. package/dist/assets/ChatDefaultsTab-BhhumrcM.js +0 -1
  50. package/dist/assets/FeedbacksTab-BLyfs_L4.js +0 -1
  51. package/dist/assets/FilesTab-DYGvOehC.js +0 -1
  52. package/dist/assets/GroupsTab-BOkc2jks.js +0 -1
  53. package/dist/assets/InstancesTab-WCkAX_gl.js +0 -1
  54. package/dist/assets/IntegrationsTab-Bwd59JJJ.js +0 -1
  55. package/dist/assets/KpiTab-flOR56nE.js +0 -1
  56. package/dist/assets/PreferencesTab-Ddm8m8BL.js +0 -1
  57. package/dist/assets/PromptInjectionsTab-CuooI8Zy.js +0 -3
  58. package/dist/assets/RolesTab-BnF_qq0d.js +0 -1
  59. package/dist/assets/ServiceAccountsTab-DAeKxzUx.js +0 -1
  60. package/dist/assets/ThemeShowroom-CaoO1IiG.js +0 -1
  61. package/dist/assets/TracesTab-C9cfYiBZ.js +0 -1
  62. package/dist/assets/UsersTab-CtD0iELd.js +0 -1
  63. package/dist/assets/chevrons-up-down-D_kGoxSO.js +0 -1
  64. package/dist/assets/dist-BMI7wyIc.js +0 -1
  65. package/dist/assets/dist-bcnGL3nu.js +0 -5
  66. package/dist/assets/index-DsOZBPOX.js +0 -227
  67. package/dist/assets/mermaid-GHXKKRXX-Bf3eJ2-p.js +0 -1
  68. package/dist/assets/roleDescriptions-eZmrq1l0.js +0 -1
  69. package/dist/assets/x-CyUGhZ48.js +0 -1
@@ -1 +1 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Cu as r,Du as i,Eu as a,Ou as o,Su as s,Tu as c,_u as l,bu as u,ku as d,vu as f,wu as p,xu as m,yu as h}from"./dist-DsBcH2-2.js";import{t as g}from"./button-9c1aLUeO.js";import{Ot as _,Z as v,ct as y,lt as b,st as x,ut as S,vt as C}from"./index-DsOZBPOX.js";var w=t(e(),1),T={s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5};function E(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=T[r[2]];return!Number.isFinite(i)||a===void 0?null:t-i*a}function D(e,t=Date.now()){return e.kind===`absolute`?{from:e.from,to:e.to}:{from:E(e.from,t)??t-T.h,to:E(e.to,t)??t}}var O=[{label:d(),from:`now-5m`},{label:o(),from:`now-15m`},{label:i(),from:`now-30m`},{label:a(),from:`now-1h`},{label:c(),from:`now-3h`},{label:p(),from:`now-6h`},{label:r(),from:`now-12h`},{label:s(),from:`now-24h`},{label:m(),from:`now-2d`},{label:u(),from:`now-7d`},{label:h(),from:`now-30d`},{label:f(),from:`now-90d`},{label:l(),from:`now-520w`}];function k(e){return new Date(e).toLocaleString(`fr-FR`,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}function A(e){if(e.kind===`relative`){let t=O.find(t=>t.from===e.from&&e.to===`now`);return t?t.label:`${e.from} → ${e.to}`}return`${k(e.from)} → ${k(e.to)}`}function j(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 M(e){if(e===``)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function N(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:t!==``&&Number.isFinite(Number(t))?Number(t):e}var P=n();function F(e){let[t,n]=(0,w.useState)(0);return(0,w.useEffect)(()=>{if(e.kind!==`relative`)return;let t=window.setInterval(()=>n(e=>e+1),3e4);return()=>window.clearInterval(t)},[e.kind]),(0,w.useMemo)(()=>{let{from:t,to:n}=D(e);return e.kind===`absolute`?{from:t,to:n}:{from:I(t),to:I(n)}},[e,t])}function I(e){return Math.floor(e/6e4)*6e4}function L({value:e,onChange:t}){let[n,r]=(0,w.useState)(!1),[i,a]=(0,w.useState)(``),o=D(e),[s,c]=(0,w.useState)(()=>j(o.from)),[l,u]=(0,w.useState)(()=>j(o.to));function d(t){if(t){let t=D(e);c(j(t.from)),u(j(t.to)),a(``)}r(t)}function f(e){t({kind:`relative`,from:e,to:`now`}),r(!1)}function p(){let e=M(s),n=M(l);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),r(!1))}let m=(0,w.useMemo)(()=>{let e=i.trim().toLowerCase();return e===``?O:O.filter(t=>t.label.toLowerCase().includes(e)||t.from.toLowerCase().includes(e))},[i]),h=M(s)!==null&&M(l)!==null;return(0,P.jsxs)(b,{open:n,onOpenChange:d,children:[(0,P.jsx)(S,{asChild:!0,children:(0,P.jsxs)(g,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,P.jsx)(_,{}),A(e)]})}),(0,P.jsx)(y,{children:(0,P.jsx)(x,{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,P.jsxs)(`div`,{className:`oc-timerange__cols`,children:[(0,P.jsxs)(`div`,{className:`oc-timerange__absolute`,children:[(0,P.jsx)(`div`,{className:`oc-timerange__section-title`,children:`Plage absolue`}),(0,P.jsxs)(`label`,{className:`oc-field`,children:[(0,P.jsx)(`span`,{className:`oc-field__label`,children:`De`}),(0,P.jsx)(v,{type:`datetime-local`,value:s,onChange:e=>c(e.target.value)})]}),(0,P.jsxs)(`label`,{className:`oc-field`,children:[(0,P.jsx)(`span`,{className:`oc-field__label`,children:`À`}),(0,P.jsx)(v,{type:`datetime-local`,value:l,onChange:e=>u(e.target.value)})]}),(0,P.jsx)(g,{size:`sm`,className:`oc-timerange__apply`,disabled:!h,onClick:p,children:`Appliquer`})]}),(0,P.jsxs)(`div`,{className:`oc-timerange__relative`,children:[(0,P.jsxs)(`div`,{className:`oc-timerange__search`,children:[(0,P.jsx)(C,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,P.jsx)(v,{value:i,onChange:e=>a(e.target.value),placeholder:`Rechercher une plage`,"aria-label":`Rechercher une plage relative`})]}),(0,P.jsx)(`ul`,{className:`oc-timerange__list`,children:m.length===0?(0,P.jsx)(`li`,{className:`oc-timerange__empty`,children:`Aucune plage.`}):m.map(t=>(0,P.jsx)(`li`,{children:(0,P.jsx)(`button`,{type:`button`,className:`oc-timerange__option`+(e.kind===`relative`&&e.from===t.from&&e.to===`now`?` is-active`:``),onClick:()=>f(t.from),children:t.label})},t.from))})]})]})})})]})}export{F as n,N as r,L as t};
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Cu as r,Du as i,Eu as a,Ou as o,Su as s,Tu as c,_u as l,bu as u,ku as d,vu as f,wu as p,xu as m,yu as h}from"./dist-DeR8iMiX.js";import{t as g}from"./button-D7l3zA0T.js";import{Ot as _,Z as v,ct as y,lt as b,st as x,ut as S,vt as C}from"./index-C8EIxIiw.js";var w=t(e(),1),T={s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5};function E(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=T[r[2]];return!Number.isFinite(i)||a===void 0?null:t-i*a}function D(e,t=Date.now()){return e.kind===`absolute`?{from:e.from,to:e.to}:{from:E(e.from,t)??t-T.h,to:E(e.to,t)??t}}var O=[{label:d(),from:`now-5m`},{label:o(),from:`now-15m`},{label:i(),from:`now-30m`},{label:a(),from:`now-1h`},{label:c(),from:`now-3h`},{label:p(),from:`now-6h`},{label:r(),from:`now-12h`},{label:s(),from:`now-24h`},{label:m(),from:`now-2d`},{label:u(),from:`now-7d`},{label:h(),from:`now-30d`},{label:f(),from:`now-90d`},{label:l(),from:`now-520w`}];function k(e){return new Date(e).toLocaleString(`fr-FR`,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}function A(e){if(e.kind===`relative`){let t=O.find(t=>t.from===e.from&&e.to===`now`);return t?t.label:`${e.from} → ${e.to}`}return`${k(e.from)} → ${k(e.to)}`}function j(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 M(e){if(e===``)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function N(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:t!==``&&Number.isFinite(Number(t))?Number(t):e}var P=n();function F(e){let[t,n]=(0,w.useState)(0);return(0,w.useEffect)(()=>{if(e.kind!==`relative`)return;let t=window.setInterval(()=>n(e=>e+1),3e4);return()=>window.clearInterval(t)},[e.kind]),(0,w.useMemo)(()=>{let{from:t,to:n}=D(e);return e.kind===`absolute`?{from:t,to:n}:{from:I(t),to:I(n)}},[e,t])}function I(e){return Math.floor(e/6e4)*6e4}function L({value:e,onChange:t}){let[n,r]=(0,w.useState)(!1),[i,a]=(0,w.useState)(``),o=D(e),[s,c]=(0,w.useState)(()=>j(o.from)),[l,u]=(0,w.useState)(()=>j(o.to));function d(t){if(t){let t=D(e);c(j(t.from)),u(j(t.to)),a(``)}r(t)}function f(e){t({kind:`relative`,from:e,to:`now`}),r(!1)}function p(){let e=M(s),n=M(l);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),r(!1))}let m=(0,w.useMemo)(()=>{let e=i.trim().toLowerCase();return e===``?O:O.filter(t=>t.label.toLowerCase().includes(e)||t.from.toLowerCase().includes(e))},[i]),h=M(s)!==null&&M(l)!==null;return(0,P.jsxs)(b,{open:n,onOpenChange:d,children:[(0,P.jsx)(S,{asChild:!0,children:(0,P.jsxs)(g,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,P.jsx)(_,{}),A(e)]})}),(0,P.jsx)(y,{children:(0,P.jsx)(x,{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,P.jsxs)(`div`,{className:`oc-timerange__cols`,children:[(0,P.jsxs)(`div`,{className:`oc-timerange__absolute`,children:[(0,P.jsx)(`div`,{className:`oc-timerange__section-title`,children:`Plage absolue`}),(0,P.jsxs)(`label`,{className:`oc-field`,children:[(0,P.jsx)(`span`,{className:`oc-field__label`,children:`De`}),(0,P.jsx)(v,{type:`datetime-local`,value:s,onChange:e=>c(e.target.value)})]}),(0,P.jsxs)(`label`,{className:`oc-field`,children:[(0,P.jsx)(`span`,{className:`oc-field__label`,children:`À`}),(0,P.jsx)(v,{type:`datetime-local`,value:l,onChange:e=>u(e.target.value)})]}),(0,P.jsx)(g,{size:`sm`,className:`oc-timerange__apply`,disabled:!h,onClick:p,children:`Appliquer`})]}),(0,P.jsxs)(`div`,{className:`oc-timerange__relative`,children:[(0,P.jsxs)(`div`,{className:`oc-timerange__search`,children:[(0,P.jsx)(C,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,P.jsx)(v,{value:i,onChange:e=>a(e.target.value),placeholder:`Rechercher une plage`,"aria-label":`Rechercher une plage relative`})]}),(0,P.jsx)(`ul`,{className:`oc-timerange__list`,children:m.length===0?(0,P.jsx)(`li`,{className:`oc-timerange__empty`,children:`Aucune plage.`}):m.map(t=>(0,P.jsx)(`li`,{children:(0,P.jsx)(`button`,{type:`button`,className:`oc-timerange__option`+(e.kind===`relative`&&e.from===t.from&&e.to===`now`?` is-active`:``),onClick:()=>f(t.from),children:t.label})},t.from))})]})]})})})]})}export{F as n,N as r,L as t};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$b as r,$f as i,Ab as a,Ap as o,Bb as s,Cp as c,Dp as l,Ep as u,Fb as d,Hb as f,Ib as p,Jb as m,Jf as h,Lb as g,Mb as _,Nb as v,Ob as y,Op as ee,Pb as b,Qb as te,Qf as ne,Rb as x,Sp as re,TO as S,Tp as ie,Vb as ae,Xb as C,Xf as oe,Yb as w,Yf as T,Zb as E,Zf as se,_p as ce,_x as le,ap as ue,ax as D,bp as de,cp as fe,cx as pe,dp as me,dx as he,ep as ge,ex as _e,fp as ve,fx as O,gp as ye,gx as be,hp as xe,hx as k,ip as Se,ix as A,jb as j,jp as Ce,kb as M,kp as we,lp as Te,lx as N,mp as Ee,mx as P,np as De,nx as F,op as Oe,ox as ke,pp as Ae,px as je,qb as Me,qf as Ne,rp as Pe,rx as Fe,sp as Ie,sx as Le,tp as Re,tx as ze,up as Be,ux as Ve,vO as I,vp as He,wO as L,wp as Ue,xp as We,yO as R,yp as Ge,zb as Ke}from"./dist-DeR8iMiX.js";import{n as qe}from"./dist-DkiDhiBf.js";import{t as Je}from"./x-CrtqI3eZ.js";import{i as z,n as B,r as Ye,t as Xe}from"./tabs-8RyO3-oV.js";import{t as V}from"./button-D7l3zA0T.js";import{$ as Ze,C as H,Ct as Qe,Dt as $e,Mt as et,Q as tt,S as U,X as W,a as nt,b as G,et as rt,i as it,jt as at,k as ot,nt as st,o as ct,ot as lt,r as ut,rt as dt,wt as ft,x as K,y as q}from"./index-C8EIxIiw.js";import{n as pt}from"./TimeRangePicker-BdGF5YWf.js";import{t as mt}from"./FilterBar-C-tLvndJ.js";import{t as ht}from"./AdvancedFilter-CF-6iZ4n.js";import{t as gt}from"./DataTableShell-CA2F4JBD.js";var _t=R(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),vt=R(`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`}]]),J=t(e(),1),Y=n(),X={kind:`relative`,from:`now-520w`,to:`now`},Z=e=>e===null?`-`:String(Math.round(e));function yt(e){let t=e.indexOf(`:`);if(t<0)return e;let n=e.slice(0,t),r=e.slice(t+1);return n===`admin`?te():n===`agent`?`${E()} - ${r}`:e}function bt(){let e=S(I.me.getMe,{host:lt})?.role===`admin`,t=S(I.deliveryTiming.getDeliveryStatus,{}),n=L(I.deliveryTiming.startDeliveryRecord),r=L(I.deliveryTiming.stopDeliveryRecord),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(!1),c=t?.recording??!1,l=async()=>{s(!0);try{c?await r({}):await n({})}finally{s(!1)}};return(0,Y.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h3`,{className:`text-sm font-semibold`,children:le()}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:be()})]}),e?(0,Y.jsx)(V,{variant:c?`destructive`:`default`,size:`sm`,disabled:o||t===void 0,onClick:()=>void l(),children:c?P():k()}):null]}),c?(0,Y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,Y.jsx)(W,{variant:`secondary`,children:je()}),t?.startedAt?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:O({time:new Date(t.startedAt).toLocaleTimeString()})}):null]}):null,(0,Y.jsx)(`div`,{children:(0,Y.jsx)(V,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?N():Ve()})}),i?(0,Y.jsx)(xt,{isAdmin:e}):null]})}function xt({isAdmin:e}){let t=S(I.deliveryTiming.listDeliverySessions,{}),n=L(I.deliveryTiming.deleteDeliverySessions),[i,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(`all`),[c,l]=(0,J.useState)(X),[u,d]=(0,J.useState)(null),{from:f,to:p}=pt(c),h=c.to===`now`?1/0:p,g=i.trim()!==``||o!==`all`||c!==X,_=()=>{a(``),s(`all`),l(X)},v=(0,J.useMemo)(()=>{if(t===void 0)return;let e=i.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(o===`all`||(o===`active`?t.active:!t.active))&&t.startedAt>=f&&t.startedAt<=h).map(e=>({...e,_id:e.sessionId}))},[t,i,o,f,h]),y=e=>{let t=new Set((v??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),u!==null&&r.includes(u)&&d(null))};return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(mt,{q:i,onQChange:a,searchPlaceholder:Le(),timeRange:c,onTimeRangeChange:l,onReset:_,canReset:g,children:(0,Y.jsxs)(q,{value:o,onValueChange:e=>s(e),children:[(0,Y.jsx)(U,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(H,{})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(K,{value:`all`,children:ke()}),(0,Y.jsx)(K,{value:`active`,children:D()}),(0,Y.jsx)(K,{value:`stopped`,children:A()})]})]})}),(0,Y.jsx)(gt,{title:pe(),rows:v,emptyHint:M(),columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(V,{variant:`ghost`,size:`icon`,"aria-label":u===e.sessionId?w():C(),onClick:()=>d(t=>t===e.sessionId?null:e.sessionId),children:u===e.sessionId?(0,Y.jsx)(_t,{size:15,"aria-hidden":!0}):(0,Y.jsx)(ft,{size:15,"aria-hidden":!0})})},{header:Fe(),sort:e=>e.startedAt,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:new Date(e.startedAt).toLocaleString()})},{header:F(),sort:e=>e.stoppedAt,cell:e=>e.stoppedAt===null?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,Y.jsx)(`span`,{className:`tabular-nums`,children:new Date(e.stoppedAt).toLocaleString()})},{header:ze(),sort:e=>e.count,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:Z(e.count)})},{header:_e(),sort:e=>e.startedBy,cell:e=>yt(e.startedBy)},{header:r(),sort:e=>e.active,cell:e=>e.active?(0,Y.jsx)(W,{variant:`secondary`,children:D()}):(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:A()})}],rowActions:e?e=>[{label:m(),variant:`destructive`,onSelect:()=>y([e.sessionId])}]:void 0,bulkActions:e?[{label:m(),variant:`destructive`,onSelect:e=>y(e)}]:void 0,isExpanded:e=>e.sessionId===u,renderExpanded:e=>(0,Y.jsx)(St,{sessionId:e.sessionId})})]})}function St({sessionId:e}){let t=S(I.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(Ct,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(ot(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function Ct({report:e,copied:t,onCopy:n}){if(!e)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:Me()});if(e.count===0||e.segments===null)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:he()});let r=e.segments,i=(e,t)=>(0,Y.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,Y.jsx)(`td`,{className:`py-1`,children:e}),(0,Y.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:t.count}),(0,Y.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[Z(t.p50),` / `,Z(t.p95),` / `,Z(t.max)]})]});return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` `,y()]}),(0,Y.jsxs)(V,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,Y.jsx)(qe,{size:13,"aria-hidden":!0}):(0,Y.jsx)($e,{size:13,"aria-hidden":!0}),t?a():j()]})]}),(0,Y.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{className:`text-left text-muted-foreground`,children:[(0,Y.jsx)(`th`,{className:`py-1 font-medium`,children:s()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:Ke()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:x()})]})}),(0,Y.jsxs)(`tbody`,{children:[i(g(),r.bridge),i(p(),r.A),i(d(),r.C)]})]}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:b()}),e.truncated?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:_()}):null,(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:v()})]})}var wt=[50,100,200,500],Tt=`all`,Q=`__all__`,Et=[`2xx`,`4xx`,`5xx`],Dt=[`user`,`service`,`system`],Ot=[`inbound`,`outbound`,`internal`],kt={kind:`relative`,from:`now-30d`,to:`now`},At=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:`latence (ms)`},{value:`principalType`,label:`principal`},{value:`direction`,label:`direction`},{value:`roleKey`,label:`rôle`},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function jt(){let e=et({from:`/settings/traces`}),t=at({from:`/settings/traces`}),n=e.limit,r=e.kind,a=e.statusClass??Q,s=e.principalType??Q,d=e.direction??Q,p=e.roleKey??Q,m=e.q??``,h=ut(e.from,e.to),g=(0,J.useMemo)(()=>ct(e.adv),[e.adv]),{from:_,to:v}=pt(h),[y,b]=(0,J.useState)(null),[te,x]=(0,J.useState)(null),C=e=>void t({search:t=>({...t,limit:e})}),w=e=>void t({search:t=>({...t,kind:e})}),T=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),E=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),le=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),D=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),pe=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),he=e=>void t({search:t=>({...t,...nt(e)})}),_e=e=>void t({search:t=>({...t,adv:it(e)}),replace:!0}),O=S(I.observability.listEvents,{limit:n}),be=S(I.observability.listEvents,{limit:n,kind:r===Tt?void 0:r,filter:{q:m||void 0,from:_,to:v,statusClass:a===Q?void 0:a,principalType:s===Q?void 0:s,direction:d===Q?void 0:d,roleKey:p===Q?void 0:p,advanced:g.length>0?g:void 0}}),k=(0,J.useMemo)(()=>{let e=new Set;for(let t of O??[])e.add(t.kind);return[...e].sort()},[O]),A=(0,J.useMemo)(()=>{let e=new Set;for(let t of O??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[O]),j=m!==``||a!==Q||s!==Q||d!==Q||p!==Q||g.length>0||h.kind!==`relative`||h.from!==kt.from;function M(){t({search:{limit:100,kind:`all`},replace:!0})}let N=y?O?.filter(e=>e.correlationId===y):be,[P,F]=(0,J.useState)(`events`);return(0,Y.jsxs)(Xe,{value:P,onValueChange:e=>F(e),children:[(0,Y.jsxs)(Ye,{className:`w-full`,children:[(0,Y.jsxs)(z,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(Qe,{size:13,"aria-hidden":!0}),f()]}),(0,Y.jsxs)(z,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(vt,{size:13,"aria-hidden":!0}),ae()]})]}),(0,Y.jsx)(B,{value:`latency`,children:(0,Y.jsx)(bt,{})}),(0,Y.jsxs)(B,{value:`events`,className:`flex flex-col gap-3`,children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[Ce(),(0,Y.jsx)(`strong`,{children:o()}),we(),` `,(0,Y.jsx)(`span`,{className:`oc-filter__window`,children:ee()})]}),(0,Y.jsxs)(mt,{q:m,onQChange:T,searchPlaceholder:l(),timeRange:h,onTimeRangeChange:he,onReset:M,canReset:j,children:[(0,Y.jsxs)(q,{value:a,onValueChange:E,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(H,{placeholder:u()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(K,{value:Q,children:ie()}),Et.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:s,onValueChange:le,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(H,{placeholder:Ue()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(K,{value:Q,children:c()}),Dt.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:d,onValueChange:D,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(H,{placeholder:re()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(K,{value:Q,children:We()}),Ot.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:p,onValueChange:pe,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(H,{placeholder:de()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(K,{value:Q,children:Ge()}),A.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:r,onValueChange:w,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-44`,children:(0,Y.jsx)(H,{placeholder:He()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(K,{value:Tt,children:ce()}),k.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:String(n),onValueChange:e=>C(Number(e)),children:[(0,Y.jsx)(U,{size:`sm`,className:`w-28`,children:(0,Y.jsx)(H,{})}),(0,Y.jsx)(G,{children:wt.map(e=>(0,Y.jsx)(K,{value:String(e),children:ye({count:e})},e))})]})]}),(0,Y.jsx)(ht,{fields:At,seed:g,onChange:_e}),y?(0,Y.jsx)(`div`,{className:`oc-traces__followline`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>b(null),title:xe(),children:[(0,Y.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[Ee(),(0,Y.jsx)(`code`,{children:$(y)})]}),(0,Y.jsx)(Je,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`sr-only`,children:Ae()})]})}):null,(0,Y.jsx)(gt,{title:ve(),rows:N,emptyHint:y?me():Be(),columns:[{header:Te(),sort:e=>e.at,cell:e=>(0,Y.jsx)(`span`,{className:`oc-traces__time`,children:new Date(e.at).toLocaleString(`fr-FR`)})},{header:fe(),sort:e=>e.kind,cell:e=>(0,Y.jsx)(W,{variant:`secondary`,children:e.kind})},{header:Ie(),sort:e=>Nt(e)??null,cell:e=>{let t=Nt(e);return t?(0,Y.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,Y.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":Oe(),children:`✓`})}},{header:ue(),sort:e=>e.direction,cell:e=>e.direction?(0,Y.jsx)(W,{variant:`outline`,children:e.direction}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Se(),sort:e=>e.principalType,cell:e=>(0,Y.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,Y.jsx)(W,{variant:`outline`,children:e.principalType}),e.principalId?(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:Pe(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,Y.jsx)(W,{variant:`secondary`,children:e.roleKey}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:De(),sort:e=>e.route,cell:e=>e.route?(0,Y.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,Y.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Re(),sort:e=>e.status,cell:e=>e.status===null?(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,Y.jsx)(`span`,{className:`oc-traces__status ${Mt(e.status)}`,children:e.status})},{header:ge(),sort:e=>e.latencyMs,cell:e=>e.latencyMs===null?(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,Y.jsxs)(`span`,{className:`oc-traces__mono`,children:[e.latencyMs,` ms`]})},{header:i(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,Y.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:ne(),onClick:()=>b(e.correlationId),children:$(e.correlationId)}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:se(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,Y.jsx)(V,{variant:`outline`,size:`sm`,onClick:()=>x(e),children:oe()}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,Y.jsx)(Pt,{row:te,onClose:()=>x(null)})]})]})}function Mt(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 Nt(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 Pt({row:e,onClose:t}){let n=(0,J.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,Y.jsx)(tt,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,Y.jsxs)(Ze,{className:`max-w-lg`,children:[(0,Y.jsxs)(st,{children:[(0,Y.jsxs)(dt,{className:`oc-traces__meta-title`,children:[T(),` `,(0,Y.jsx)(`code`,{children:e.kind}),(0,Y.jsx)(W,{variant:`outline`,children:h()})]}),(0,Y.jsx)(rt,{children:Ne()})]}),(0,Y.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{jt as TracesTab};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$_ as r,B_ as i,G_ as a,H_ as o,J_ as s,K_ as c,Q_ as l,R_ as u,TO as d,U_ as f,V_ as ee,W_ as te,X_ as ne,Y_ as re,Z_ as ie,_f as p,av as ae,cf as m,cv as oe,df as h,dv as g,ev as se,ff as _,fv as v,gf as y,hf as b,iv as ce,lf as x,lv as le,mf as S,nv as C,ov as ue,pf as w,q_ as de,rv as fe,sf as T,sv as E,tv as pe,uf as D,uv as O,vO as k,vf as A,wO as j,y_ as me,yf as M,z_ as he}from"./dist-DeR8iMiX.js";import{t as N}from"./button-D7l3zA0T.js";import{$ as P,A as F,C as I,G as L,K as R,M as ge,Mt as _e,Q as z,S as B,W as V,X as H,Y as ve,_ as U,_t as W,b as G,d as K,et as ye,f as be,gt as q,j as xe,jt as Se,nt as Ce,ot as we,p as J,q as Te,rt as Ee,x as Y,y as X}from"./index-C8EIxIiw.js";import{t as De}from"./FilterBar-C-tLvndJ.js";import{t as Oe}from"./DataTableShell-CA2F4JBD.js";import{t as ke}from"./DetailChips-ChqqjGS2.js";var Z=t(e(),1),Q=n();function Ae({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=d(k.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),a=d(k.agents.listUserAgents,n&&e?{profileId:e}:`skip`),o=new Set((a??[]).map(e=>`${e.instanceName}/${e.agentId}`)),s=(a??[]).find(e=>e.isDefault)??null,c=s?`${s.instanceName}/${s.agentId}`:null,l=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),u=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(a??[]).filter(e=>!l.has(`${e.instanceName}/${e.agentId}`)).map(e=>({instanceName:e.instanceName,agentId:e.agentId,displayName:e.displayName,emoji:e.emoji,model:e.model,kind:e.kind,state:e.state,outOfPool:!0}))],f=new Map;for(let e of u){let t=f.get(e.instanceName)??[];t.push(e),f.set(e.instanceName,t)}return(0,Q.jsx)(z,{open:n,onOpenChange:r,children:(0,Q.jsxs)(P,{className:`oc-access`,children:[(0,Q.jsxs)(Ce,{children:[(0,Q.jsx)(Ee,{children:M({user:t})}),(0,Q.jsx)(ye,{children:A()})]}),i?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?p():y()}):null,(0,Q.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:b()}):u.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:_()}):[...f.entries()].map(([t,n])=>(0,Q.jsx)(je,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:o,defaultKey:c},t))})]})})}function je({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:a}){let o=j(k.agents.assignAgent),s=j(k.agents.removeAgent),c=j(k.agents.setDefaultAgent),l=F();if(!e)return null;async function u(n,r){try{r?await s({profileId:e,instanceName:t,agentId:n}):await o({profileId:e,instanceName:t,agentId:n})}catch(e){l.error(S(),e)}}async function d(n){try{await c({profileId:e,instanceName:t,agentId:n})}catch(e){l.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)(W,{size:13,"aria-hidden":!0}),(0,Q.jsx)(`span`,{children:t}),(0,Q.jsx)(H,{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`;return(0,Q.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Q.jsx)(U,{checked:r,disabled:s&&!r,onCheckedChange:()=>void u(e.agentId,r),"aria-label":h({name:e.displayName??e.agentId})}),(0,Q.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Q.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,s?(0,Q.jsx)(H,{variant:`outline`,className:`oc-access__gone`,children:D()}):null,e.outOfPool?(0,Q.jsx)(H,{variant:`outline`,className:`oc-access__gone`,children:x()}):null,r?o?(0,Q.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":m(),title:m(),children:(0,Q.jsx)(q,{size:14,fill:`currentColor`})}):(0,Q.jsx)(N,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":T(),title:T(),onClick:()=>void d(e.agentId),children:(0,Q.jsx)(q,{size:14})}):null]},e.agentId)})]})}var $=`__all__`;function Me({granted:e,onToggle:t}){let n=new Set(e),r=K.filter(e=>n.has(J[e])).length;return(0,Q.jsxs)(V,{children:[(0,Q.jsx)(ve,{asChild:!0,children:(0,Q.jsx)(N,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?v():g({count:r})})}),(0,Q.jsxs)(L,{align:`start`,className:`w-52`,children:[(0,Q.jsx)(Te,{children:O()}),K.map(e=>{let r=J[e];return(0,Q.jsxs)(R,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Q.jsx)(U,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Q.jsx)(`span`,{children:be[e]??e})]},e)})]})]})}function Ne(){let e=_e({from:`/settings/users`}),t=Se({from:`/settings/users`}),n=e.q??``,p=e.role??$,m=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),h=e=>void t({search:t=>({...t,role:e===$?void 0:e})}),g=d(k.admin.listUsers,{filter:{q:n||void 0,role:p===$?void 0:p},withAgents:!0}),_=d(k.me.getMe,{host:we}),v=j(k.admin.setRole),y=j(k.admin.setUserPermissions),b=j(k.admin.startImpersonation),x=j(k.admin.deleteUser),S=j(k.admin.setUserName),w=xe(),T=ge(),D=F(),[O,A]=(0,Z.useState)(null),M=(0,Z.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of g??[])e.add(t.role);return[...e]},[g]),N=n!==``||p!==$;function P(){t({search:{},replace:!0})}async function L(e){try{await v(e)}catch(e){D.error(le(),e)}}async function R(e){try{await y(e)}catch(e){D.error(oe(),e)}}async function z(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await w({title:pe(),description:se({user:t}),confirmWord:r(),confirmLabel:l(),destructive:!0}))try{await x({profileId:e._id}),D.success(ne({user:t}))}catch(e){D.error(ie(),e)}}async function V(e){let t=e.email||e.name||e.userId.slice(0,8),n=await T({title:s(),label:de({user:t}),placeholder:c(),defaultValue:e.name??``,confirmLabel:me()});if(n!==null)try{await S({profileId:e._id,name:n}),D.success(a())}catch(e){D.error(te(),e)}}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(De,{q:n,onQChange:m,searchPlaceholder:E(),onReset:P,canReset:N,children:(0,Q.jsxs)(X,{value:p,onValueChange:h,children:[(0,Q.jsx)(B,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(I,{})}),(0,Q.jsxs)(G,{children:[(0,Q.jsx)(Y,{value:$,children:ue()}),M.map(e=>(0,Q.jsx)(Y,{value:e,children:e},e))]})]})}),(0,Q.jsx)(Oe,{title:ae(),rows:g,emptyHint:ce(),rowActions:e=>{let t=[{label:u(),onSelect:()=>A({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:re(),onSelect:()=>void V(e)}];return e.userId!==_?.userId&&t.push({label:fe(),onSelect:()=>void b({profileId:e._id})},{label:C(),variant:`destructive`,onSelect:()=>void z(e)}),t},columns:[{header:f(),cell:e=>{let t=e.email||e.name||e.canonical||e.userId.slice(0,8),n=e.email&&e.name&&e.name!==e.email?e.name:null;return(0,Q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Q.jsx)(`span`,{children:t}),n?(0,Q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}):null]})},sort:e=>e.email||e.name||e.canonical||e.userId},{header:o(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Q.jsxs)(X,{value:e.role,onValueChange:t=>void L({profileId:e._id,role:t}),children:[(0,Q.jsx)(B,{size:`sm`,className:`w-28`,children:(0,Q.jsx)(I,{})}),(0,Q.jsxs)(G,{children:[(0,Q.jsx)(Y,{value:`pending`,children:`pending`}),(0,Q.jsx)(Y,{value:`user`,children:`user`}),(0,Q.jsx)(Y,{value:`admin`,children:`admin`})]})]})},{header:ee(),sort:e=>e.role===`admin`?9999:e.extraPermissions?.length??0,cell:e=>e.role===`admin`?(0,Q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:i()}):(0,Q.jsx)(Me,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),R({profileId:e._id,permissions:[...n]})}})},{header:he(),cell:e=>(0,Q.jsx)(ke,{icon:(0,Q.jsx)(W,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,Q.jsx)(Ae,{profileId:O?.profileId??null,userLabel:O?.label??``,open:O!==null,onOpenChange:e=>{e||A(null)}})]})}export{Ne as UsersTab};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n,sO as r,t as i}from"./dist-DsBcH2-2.js";e();var a=t(),o=i(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function s({className:e,variant:t=`default`,size:i=`default`,asChild:s=!1,...c}){return(0,a.jsx)(s?r:`button`,{"data-slot":`button`,"data-variant":t,"data-size":i,className:n(o({variant:t,size:i,className:e})),...c})}export{o as n,s as t};
1
+ import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n,pO as r,t as i}from"./dist-DeR8iMiX.js";e();var a=t(),o=i(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function s({className:e,variant:t=`default`,size:i=`default`,asChild:s=!1,...c}){return(0,a.jsx)(s?r:`button`,{"data-slot":`button`,"data-variant":t,"data-size":i,className:n(o({variant:t,size:i,className:e})),...c})}export{o as n,s as t};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n}from"./dist-DsBcH2-2.js";e();var r=t();function i({className:e,size:t=`default`,...i}){return(0,r.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:n(`group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...i})}function a({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-header`,className:n(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...t})}function o({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-title`,className:n(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function s({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-description`,className:n(`text-sm text-muted-foreground`,e),...t})}function c({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-content`,className:n(`px-4 group-data-[size=sm]/card:px-3`,e),...t})}function l({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-footer`,className:n(`flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3`,e),...t})}export{a,l as i,c as n,o,s as r,i as t};
1
+ import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n}from"./dist-DeR8iMiX.js";e();var r=t();function i({className:e,size:t=`default`,...i}){return(0,r.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:n(`group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...i})}function a({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-header`,className:n(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...t})}function o({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-title`,className:n(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function s({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-description`,className:n(`text-sm text-muted-foreground`,e),...t})}function c({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-content`,className:n(`px-4 group-data-[size=sm]/card:px-3`,e),...t})}function l({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-footer`,className:n(`flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3`,e),...t})}export{a,l as i,c as n,o,s as r,i as t};
@@ -0,0 +1 @@
1
+ import{yO as e}from"./dist-DeR8iMiX.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 +1 @@
1
- import{Cr as e,Pr as t,Tr as n,br as r,wr as i,xr as a}from"./dist-DsBcH2-2.js";var o=e=>typeof e==`string`?e:null;function s(e){return/^\d+\.\d+\.\d+$/.test(e)?e.split(`.`).map(e=>Number.parseInt(e,10)):null}function c(e,t){let n=s(e),r=s(t);if(n===null||r===null)return null;for(let e=0;e<3;e++){let t=n[e]-r[e];if(t!==0)return t}return 0}function l(e,t){if(e===null||t===null)return!1;let n=c(t,e.min);return n!==null&&n>=0}function u(e,t){let n={range:null,validatedVersions:[]};if(typeof e!=`object`||!e)return n;let r=e.providers;if(typeof r!=`object`||!r)return n;let i=r[t];if(typeof i!=`object`||!i)return n;let a=i,s=null;if(typeof a.supportedRange==`object`&&a.supportedRange!==null){let e=a.supportedRange,t=o(e.min),n=o(e.maxValidated);t!==null&&n!==null&&(s={min:t,maxValidated:n})}let c=Array.isArray(a.validatedVersions)?a.validatedVersions.filter(e=>typeof e==`string`):[];return{range:s,validatedVersions:c}}function d(e,t,n){if(e===null)return`unknown`;let{range:r}=u(n,t);return l(r,e)?r!==null&&(c(e,r.maxValidated)??0)>0?`beyond`:`supported`:`unknown`}function f(t){return t===`supported`?n():t===`beyond`?i():e()}function p(e){return e??t()}function m(e){return e===null?r():a({version:e})}function h(e,t){if(typeof e!=`object`||!e)return!1;let n=e.providers;return typeof n!=`object`||!n?!1:t in n}export{p as a,m as i,h as n,c as o,f as r,u as s,d as t};
1
+ import{Cr as e,Pr as t,Tr as n,br as r,wr as i,xr as a}from"./dist-DeR8iMiX.js";var o=e=>typeof e==`string`?e:null;function s(e){return/^\d+\.\d+\.\d+$/.test(e)?e.split(`.`).map(e=>Number.parseInt(e,10)):null}function c(e,t){let n=s(e),r=s(t);if(n===null||r===null)return null;for(let e=0;e<3;e++){let t=n[e]-r[e];if(t!==0)return t}return 0}function l(e,t){if(e===null||t===null)return!1;let n=c(t,e.min);return n!==null&&n>=0}function u(e,t){let n={range:null,validatedVersions:[]};if(typeof e!=`object`||!e)return n;let r=e.providers;if(typeof r!=`object`||!r)return n;let i=r[t];if(typeof i!=`object`||!i)return n;let a=i,s=null;if(typeof a.supportedRange==`object`&&a.supportedRange!==null){let e=a.supportedRange,t=o(e.min),n=o(e.maxValidated);t!==null&&n!==null&&(s={min:t,maxValidated:n})}let c=Array.isArray(a.validatedVersions)?a.validatedVersions.filter(e=>typeof e==`string`):[];return{range:s,validatedVersions:c}}function d(e,t,n){if(e===null)return`unknown`;let{range:r}=u(n,t);return l(r,e)?r!==null&&(c(e,r.maxValidated)??0)>0?`beyond`:`supported`:`unknown`}function f(t){return t===`supported`?n():t===`beyond`?i():e()}function p(e){return e??t()}function m(e){return e===null?r():a({version:e})}function h(e,t){if(typeof e!=`object`||!e)return!1;let n=e.providers;return typeof n!=`object`||!n?!1:t in n}export{p as a,m as i,h as n,c as o,f as r,u as s,d as t};
@@ -1 +1 @@
1
- import{$s as e,Bs as t,Gs as n,Hs as r,Is as i,Js as a,Ks as o,Ls as s,Qs as c,Rs as l,Us as u,Vs as d,Ws as f,Xs as p,Ys as m,Zs as h,ac as g,cc as _,ec as v,ic as y,lc as b,nc as x,oc as S,qs as C,rc as w,sc as T,tc as E,uc as D,zs as O}from"./dist-DsBcH2-2.js";var k={AGENT_NOT_FOUND:()=>({label:D(),hint:b()}),AUTH_TOKEN_MISMATCH:()=>({label:_(),hint:T()}),DEVICE_SIGNING_FAILED:()=>({label:S(),hint:g()}),SESSION_SCOPE_DENIED:()=>({label:y(),hint:w()}),GATEWAY_TIMEOUT:()=>({label:x(),hint:E()}),GATEWAY_DISCONNECTED:()=>({label:v(),hint:e()}),ATTACHMENT_TOO_LARGE:()=>({label:p(),hint:m()}),ATTACHMENT_REJECTED:()=>({label:a(),hint:C()}),BRIDGE_UNREACHABLE:()=>({label:c(),hint:h()}),INVALID_REQUEST:()=>({label:o(),hint:n()}),NOT_CONFIGURED:()=>({label:f(),hint:u()}),UNROUTED:()=>({label:r(),hint:d()}),UPSTREAM_ERROR:()=>({label:t(),hint:O()}),UNKNOWN:()=>({label:l(),hint:s()})};function A(e){return e?k[e]?.()??{label:e,hint:i()}:k.UNKNOWN()}export{A as t};
1
+ import{$s as e,Bs as t,Gs as n,Hs as r,Is as i,Js as a,Ks as o,Ls as s,Qs as c,Rs as l,Us as u,Vs as d,Ws as f,Xs as p,Ys as m,Zs as h,ac as g,cc as _,ec as v,ic as y,lc as b,nc as x,oc as S,qs as C,rc as w,sc as T,tc as E,uc as D,zs as O}from"./dist-DeR8iMiX.js";var k={AGENT_NOT_FOUND:()=>({label:D(),hint:b()}),AUTH_TOKEN_MISMATCH:()=>({label:_(),hint:T()}),DEVICE_SIGNING_FAILED:()=>({label:S(),hint:g()}),SESSION_SCOPE_DENIED:()=>({label:y(),hint:w()}),GATEWAY_TIMEOUT:()=>({label:x(),hint:E()}),GATEWAY_DISCONNECTED:()=>({label:v(),hint:e()}),ATTACHMENT_TOO_LARGE:()=>({label:p(),hint:m()}),ATTACHMENT_REJECTED:()=>({label:a(),hint:C()}),BRIDGE_UNREACHABLE:()=>({label:c(),hint:h()}),INVALID_REQUEST:()=>({label:o(),hint:n()}),NOT_CONFIGURED:()=>({label:f(),hint:u()}),UNROUTED:()=>({label:r(),hint:d()}),UPSTREAM_ERROR:()=>({label:t(),hint:O()}),UNKNOWN:()=>({label:l(),hint:s()})};function A(e){return e?k[e]?.()??{label:e,hint:i()}:k.UNKNOWN()}export{A as t};
@@ -0,0 +1,5 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$D as r,QD as i,XD as a,ZD as o,_O as s,dO as c,eO as l,iO as u,mO as d,nO as f,oO as p,rO as m,sO as ee,tO as h,uO as g}from"./dist-DeR8iMiX.js";var _=t(e(),1),v=n(),y=`Dialog`,[b,x]=ee(y),[S,C]=b(y),w=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=_.useRef(null),c=_.useRef(null),[l,d]=u({prop:r,defaultProp:i??!1,onChange:a,caller:y});return(0,v.jsx)(S,{scope:t,triggerRef:s,contentRef:c,contentId:f(),titleId:f(),descriptionId:f(),open:l,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(e=>!e),[d]),modal:o,children:n})};w.displayName=y;var T=`DialogTrigger`,E=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=C(T,n),a=s(t,i.triggerRef);return(0,v.jsx)(c.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":K(i.open),...r,ref:a,onClick:g(e.onClick,i.onOpenToggle)})});E.displayName=T;var D=`DialogPortal`,[O,k]=b(D,{forceMount:void 0}),A=e=>{let{__scopeDialog:t,forceMount:n,children:i,container:a}=e,o=C(D,t);return(0,v.jsx)(O,{scope:t,forceMount:n,children:_.Children.map(i,e=>(0,v.jsx)(m,{present:n||o.open,children:(0,v.jsx)(r,{asChild:!0,container:a,children:e})}))})};A.displayName=D;var j=`DialogOverlay`,M=_.forwardRef((e,t)=>{let n=k(j,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=C(j,e.__scopeDialog);return a.modal?(0,v.jsx)(m,{present:r||a.open,children:(0,v.jsx)(P,{...i,ref:t})}):null});M.displayName=j;var N=d(`DialogOverlay.RemoveScroll`),P=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=C(j,n);return(0,v.jsx)(o,{as:N,allowPinchZoom:!0,shards:[i.contentRef],children:(0,v.jsx)(c.div,{"data-state":K(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),F=`DialogContent`,I=_.forwardRef((e,t)=>{let n=k(F,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=C(F,e.__scopeDialog);return(0,v.jsx)(m,{present:r||a.open,children:a.modal?(0,v.jsx)(L,{...i,ref:t}):(0,v.jsx)(R,{...i,ref:t})})});I.displayName=F;var L=_.forwardRef((e,t)=>{let n=C(F,e.__scopeDialog),r=_.useRef(null),i=s(t,n.contentRef,r);return _.useEffect(()=>{let e=r.current;if(e)return a(e)},[]),(0,v.jsx)(z,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:g(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:g(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:g(e.onFocusOutside,e=>e.preventDefault())})}),R=_.forwardRef((e,t)=>{let n=C(F,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return(0,v.jsx)(z,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),z=_.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,...c}=e,u=C(F,n),d=_.useRef(null),f=s(t,d);return i(),(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(l,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:(0,v.jsx)(h,{role:`dialog`,id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":K(u.open),...c,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(X,{titleId:u.titleId}),(0,v.jsx)(Q,{contentRef:d,descriptionId:u.descriptionId})]})]})}),B=`DialogTitle`,V=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=C(B,n);return(0,v.jsx)(c.h2,{id:i.titleId,...r,ref:t})});V.displayName=B;var H=`DialogDescription`,U=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=C(H,n);return(0,v.jsx)(c.p,{id:i.descriptionId,...r,ref:t})});U.displayName=H;var W=`DialogClose`,G=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=C(W,n);return(0,v.jsx)(c.button,{type:`button`,...r,ref:t,onClick:g(e.onClick,()=>i.onOpenChange(!1))})});G.displayName=W;function K(e){return e?`open`:`closed`}var q=`DialogTitleWarning`,[J,Y]=p(q,{contentName:F,titleName:B,docsSlug:`dialog`}),X=({titleId:e})=>{let t=Y(q),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
2
+
3
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
4
+
5
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return _.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Z=`DialogDescriptionWarning`,Q=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Y(Z).contentName}}.`;return _.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},te=w,$=E,ne=A,re=M,ie=I,ae=V,oe=U,se=G;export{ne as a,$ as c,re as i,J as l,ie as n,te as o,oe as r,ae as s,se as t,x as u};