@lacneu/atrium 0.10.15 → 0.10.16

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 (61) hide show
  1. package/dist/assets/{AccessTab-BtJ0YziJ.js → AccessTab-C2TDcMit.js} +1 -1
  2. package/dist/assets/{AdvancedFilter-B7F-AiE3.js → AdvancedFilter-DrUoj1oY.js} +1 -1
  3. package/dist/assets/AgentFilesTab-BrBVC0WC.js +3 -0
  4. package/dist/assets/AnomaliesTab-_Jt6y2Sy.js +1 -0
  5. package/dist/assets/AuditTab-C-6Oxrdo.js +1 -0
  6. package/dist/assets/BridgeTab-BhxIgO6W.js +1 -0
  7. package/dist/assets/{ChatDefaultsTab-Du6UayC8.js → ChatDefaultsTab-C9JLQe-F.js} +1 -1
  8. package/dist/assets/{DataTableShell-lk84lOrM.js → DataTableShell-BY48g0WO.js} +1 -1
  9. package/dist/assets/{DetailChips-BEavm_Ac.js → DetailChips-B_6c_-iY.js} +1 -1
  10. package/dist/assets/{FeedbacksTab-C7XVC3Yw.js → FeedbacksTab-28fA354v.js} +1 -1
  11. package/dist/assets/{FieldLabel-CGyzgDBW.js → FieldLabel-BrnlMFJq.js} +2 -2
  12. package/dist/assets/FilesTab-Bt_1sxvl.js +1 -0
  13. package/dist/assets/{FilterBar-DFcZPoFt.js → FilterBar-Cn4lFaY4.js} +1 -1
  14. package/dist/assets/GroupsTab-DNcRR1QL.js +1 -0
  15. package/dist/assets/InstancesTab-CJtDMRcA.js +1 -0
  16. package/dist/assets/{IntegrationsTab-Cwfkq3we.js → IntegrationsTab-CwPWnqkr.js} +1 -1
  17. package/dist/assets/{KpiTab-xPvR9FM_.js → KpiTab-ChPoG2S2.js} +1 -1
  18. package/dist/assets/PreferencesTab-DD8qntSU.js +1 -0
  19. package/dist/assets/{PromptInjectionsTab-EjIpGvU6.js → PromptInjectionsTab-XzEme_aG.js} +2 -2
  20. package/dist/assets/RolesTab-D1aBj2un.js +1 -0
  21. package/dist/assets/ServiceAccountsTab-D30Lhilu.js +1 -0
  22. package/dist/assets/ThemeShowroom-BrXPZ7CL.js +1 -0
  23. package/dist/assets/{TimeRangePicker-BiwaqlSJ.js → TimeRangePicker-BCumk2bf.js} +1 -1
  24. package/dist/assets/TracesTab-DW9c-271.js +1 -0
  25. package/dist/assets/{UsersTab-BnfJCCZi.js → UsersTab-1qfp9sce.js} +1 -1
  26. package/dist/assets/{button-CjrF4jCF.js → button-ClzO6iiY.js} +1 -1
  27. package/dist/assets/{card-Bv3IToK_.js → card-B4hdn0Qh.js} +1 -1
  28. package/dist/assets/chevrons-up-down-B3gRA_gV.js +1 -0
  29. package/dist/assets/{compatView-BfukCKG8.js → compatView-BLkCb0a4.js} +1 -1
  30. package/dist/assets/{dispatchErrorInfo-B8Zuv2Mz.js → dispatchErrorInfo-eTOwTxQJ.js} +1 -1
  31. package/dist/assets/dist-CEGGJ9VY.js +1 -0
  32. package/dist/assets/{dist-DQy6UNW9.js → dist-CfgJ5RDI.js} +1 -1
  33. package/dist/assets/{dist-Ztske_3A.js → dist-D2UVxg3M.js} +1 -1
  34. package/dist/assets/dist-Ygn7c4YX.js +5 -0
  35. package/dist/assets/{highlighted-body-OFNGDK62-DScb7Jhp.js → highlighted-body-OFNGDK62-CwnBPq8J.js} +1 -1
  36. package/dist/assets/index-BsbX_-dh.js +221 -0
  37. package/dist/assets/mermaid-GHXKKRXX-BtlnP6HU.js +1 -0
  38. package/dist/assets/roleDescriptions-Bjw3U0di.js +1 -0
  39. package/dist/assets/{table-uMxWWF9Z.js → table-BYj7Kdzy.js} +1 -1
  40. package/dist/assets/x-TUhW74Oi.js +1 -0
  41. package/dist/index.html +7 -7
  42. package/package.json +1 -1
  43. package/dist/assets/AgentFilesTab-BDiTdf2o.js +0 -3
  44. package/dist/assets/AnomaliesTab-D9_olGON.js +0 -1
  45. package/dist/assets/AuditTab-DXvZQmFV.js +0 -1
  46. package/dist/assets/BridgeTab-BDuniuOs.js +0 -1
  47. package/dist/assets/FilesTab-oHDctIIE.js +0 -1
  48. package/dist/assets/GroupsTab-Dr-tZ0OB.js +0 -1
  49. package/dist/assets/InstancesTab-nfr3JEEX.js +0 -1
  50. package/dist/assets/PreferencesTab-BfYRXVKJ.js +0 -1
  51. package/dist/assets/RolesTab-ByMxMpI5.js +0 -1
  52. package/dist/assets/ServiceAccountsTab-FKu4_5yB.js +0 -1
  53. package/dist/assets/ThemeShowroom-CaQHQZFb.js +0 -1
  54. package/dist/assets/TracesTab-DxuzyseF.js +0 -1
  55. package/dist/assets/chevrons-up-down-B_Xo1k1h.js +0 -1
  56. package/dist/assets/dist-B7_ufbgZ.js +0 -1
  57. package/dist/assets/dist-KXhBVgxk.js +0 -5
  58. package/dist/assets/index-nY1Cemm1.js +0 -221
  59. package/dist/assets/mermaid-GHXKKRXX-CaUAsyRa.js +0 -1
  60. package/dist/assets/roleDescriptions-EkLHQ7dr.js +0 -1
  61. package/dist/assets/x-12vni2tJ.js +0 -1
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$x as r,AS as i,Ax as a,Bx as o,CS as s,Cx as c,DS as l,Dx as u,ES as d,Ex as f,Fx as p,Gx as m,Hx as h,Ix as g,Jx as ee,Kx as te,Lx as ne,MC as re,Mx as ie,NC as ae,Nx as oe,OS as se,Ox as _,Px as ce,Qx as le,Rx as ue,SS as de,Sx as fe,TS as pe,Tx as me,Ux as he,Vx as ge,Wx as _e,Xx as ve,Yx as ye,Zx as be,_S as xe,_x as Se,aS as Ce,bS as v,bx as we,cS as Te,cw as y,cx as Ee,dS as De,dx as Oe,eS as ke,fS as Ae,fw as je,fx as b,gC as Me,gS as Ne,gx as x,hC as Pe,hS as Fe,hw as S,hx as Ie,iS as Le,jC as Re,jx as ze,kS as Be,kx as Ve,lS as He,lw as Ue,lx as We,mS as Ge,mw as C,mx as Ke,n as qe,nS as Je,oS as Ye,pS as Xe,px as Ze,qx as w,rS as Qe,sS as $e,tS as et,uS as tt,ux as nt,vS as rt,vx as it,wS as at,wx as ot,xS as st,xx as ct,yS as lt,yx as ut,zx as dt}from"./dist-CfgJ5RDI.js";import{n as T}from"./dist-D2UVxg3M.js";import{t as ft}from"./TimeRangePicker-BCumk2bf.js";import{t as E}from"./x-TUhW74Oi.js";import{t as D}from"./button-ClzO6iiY.js";import{$ as pt,C as O,Ct as k,J as A,O as j,Q as mt,S as M,at as ht,b as N,et as P,it as gt,m as F,nt as I,ot as L,rt as _t,tt as vt,x as R,y as z}from"./index-BsbX_-dh.js";import{a as yt,i as bt,n as xt,o as St,r as Ct,t as wt}from"./card-B4hdn0Qh.js";import{a as Tt,i as B,n as Et,o as V,r as H,t as Dt}from"./table-BYj7Kdzy.js";import{t as Ot}from"./FilterBar-Cn4lFaY4.js";import{t as kt}from"./AdvancedFilter-DrUoj1oY.js";var U=Ue(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),W=t(e(),1),At=.1,jt=[248,248,248],Mt=[24,24,24];function Nt(e,t,n){let r=t,i=n,a=-1,o=-1;for(let s=0;s<n;s++)for(let n=0;n<t;n++)e[(s*t+n)*4+3]>8&&(n<r&&(r=n),n>a&&(a=n),s<i&&(i=s),s>o&&(o=s));return a<0?null:{x:r,y:i,width:a-r+1,height:o-i+1}}function Pt(e,t,n){let r=t*n;if(r===0)return 0;let i=0;for(let t=3;t<e.length;t+=4)e[t]<=8&&i++;return i/r}function G(e,t,n){return Pt(e,t,n)>=At}function Ft(e,t){for(let n=0;n<e.length;n+=4)e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2]}function It(e){for(let t=0;t<e.length;t+=4)e[t]=255-e[t],e[t+1]=255-e[t+1],e[t+2]=255-e[t+2]}var Lt=12*1024*1024,Rt=480,zt=160,Bt=.92;async function Vt(e,t={}){if(!e.type.startsWith(`image/`))throw Error(ze());if(e.size>Lt)throw Error(a());let{source:n,width:r,height:i,cleanup:o}=await Ht(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Rt/r,zt/i,a?1/0:1),s=Math.max(1,Math.round(r*o)),c=Math.max(1,Math.round(i*o)),l=document.createElement(`canvas`);l.width=s,l.height=c;let d=l.getContext(`2d`);if(!d)throw Error(_());d.imageSmoothingEnabled=!0,d.imageSmoothingQuality=`high`,d.drawImage(n,0,0,s,c);let f=Nt(d.getImageData(0,0,s,c).data,s,c)??{x:0,y:0,width:s,height:c},p=document.createElement(`canvas`);p.width=f.width,p.height=f.height;let m=p.getContext(`2d`);if(!m)throw Error(_());if(m.drawImage(l,f.x,f.y,f.width,f.height,0,0,f.width,f.height),t.variantFor){let e=m.getImageData(0,0,f.width,f.height);G(e.data,f.width,f.height)?Ft(e.data,t.variantFor===`dark`?jt:Mt):It(e.data),m.putImageData(e,0,0)}let h=G(m.getImageData(0,0,f.width,f.height).data,f.width,f.height),g=await q(p,`image/webp`,Bt)??await q(p,`image/png`);if(!g)throw Error(u());return{blob:g,hasAlpha:h}}finally{o()}}async function Ht(e){if(e.type===`image/svg+xml`)return K(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 K(e)}async function K(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(Ve())),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 q(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var J=n(),Y=`__all__`,X={kind:`relative`,from:`now-24h`,to:`now`},Ut=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function Z({title:e,description:t,children:n}){return(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,J.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,J.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function Wt(e){return e===`light`?ae():e===`dark`?re():Re()}var Gt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Kt({tokens:e,mode:t}){let n=e.colors[t];return(0,J.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Gt.map(e=>{let t=n[e];return(0,J.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Q({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a}){return(0,J.jsxs)(`button`,{type:`button`,className:qe(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,J.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,J.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,J.jsx)(T,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,J.jsx)(Kt,{tokens:r,mode:i}):(0,J.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,J.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,J.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]})}function qt({selectedKey:e,resolvedMode:t}){let n=S(y.charts.listMyCharts),r=C(y.charts.setMyChart);async function i(e){try{await r({name:e})}catch{}}return(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h2`,{className:`oc-show__title`,children:de()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:st()})]}),(0,J.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,J.jsx)(Q,{selected:e===null,title:v(),subtitle:lt(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?rt():n.via===`owner`?xe():Ne({group:n.via.group});return(0,J.jsx)(Q,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void i(n.key)},n.key)})]}),n!==void 0&&n.length===0?(0,J.jsx)(`p`,{className:`oc-show__desc`,children:Fe()}):null]})}function Jt(){let e=C(y.charts.importChart),[t,n]=(0,W.useState)(``),[i,a]=(0,W.useState)(``),[o,s]=(0,W.useState)(null),[c,l]=(0,W.useState)(!1),[u,d]=(0,W.useState)(!1);async function f(e){let t=e.target.files?.[0];if(e.target.value=``,t){s(null),l(!1);try{a(await t.text())}catch{s(w())}}}async function p(){if(s(null),l(!1),t.trim()===``){s(m());return}let r;try{r=JSON.parse(i)}catch{s(w());return}d(!0);try{await e({name:t.trim(),tokens:r}),l(!0),n(``),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{d(!1)}}return(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h2`,{className:`oc-show__title`,children:et()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:ke()})]}),(0,J.jsxs)(`div`,{className:`oc-chart-import`,children:[(0,J.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,J.jsx)(`span`,{className:`oc-chart-import__label`,children:r()}),(0,J.jsx)(A,{value:t,onChange:e=>n(e.target.value),placeholder:le(),maxLength:60})]}),(0,J.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,J.jsx)(`span`,{className:`oc-chart-import__label`,children:be()}),(0,J.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:i,onChange:e=>a(e.target.value),placeholder:ve(),rows:8,spellCheck:!1})]}),(0,J.jsxs)(`div`,{className:`oc-show__row`,children:[(0,J.jsx)(D,{variant:`outline`,size:`sm`,asChild:!0,children:(0,J.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,J.jsx)(U,{className:`size-4`}),ye(),(0,J.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void f(e)})]})}),(0,J.jsx)(D,{size:`sm`,disabled:u,onClick:()=>void p(),children:ee()})]}),o?(0,J.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null,c?(0,J.jsx)(`p`,{className:`oc-chart-import__ok`,children:te()}):null]})]})}function Yt({chart:e}){let t=je(y.charts.setChartLogo),n=C(y.charts.removeChartLogo),[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(null),s=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function c(n,r,a){if(e.chartId!==void 0){o(null),i(!0);try{let{blob:i,hasAlpha:o}=await Vt(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function l(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await c(e,n)}async function u(t){if(e.chartId!==void 0){o(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function d(e){let t=s(e===`light`?`dark`:`light`);if(t){o(null),i(!0);try{await c(e,await(await fetch(t)).blob(),e)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function f({mode:e}){let t=s(e),n=s(e===`light`?`dark`:`light`);return(0,J.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,J.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?ue():ne()}),(0,J.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,J.jsx)(`img`,{src:t,alt:``}):null}),(0,J.jsx)(D,{variant:`outline`,size:`sm`,asChild:!0,children:(0,J.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,J.jsx)(U,{className:`size-4`}),t?p():g(),(0,J.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void l(e,t)})]})}),!t&&n?(0,J.jsx)(D,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:oe()}):null,t?(0,J.jsx)(D,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void u(e),children:ce()}):null]})}return(0,J.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,J.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:dt()}),(0,J.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,J.jsx)(f,{mode:`light`}),(0,J.jsx)(f,{mode:`dark`})]}),r?(0,J.jsx)(`span`,{className:`oc-show__desc`,children:ie()}):null,a?(0,J.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function $({chart:e}){let t=S(y.me.getMe,{host:L}),n=C(y.charts.addChartDomain),r=C(y.charts.removeChartDomain),[i,a]=(0,W.useState)(``),[o,s]=(0,W.useState)(null),[l,u]=(0,W.useState)(!1);if(t?.role!==`admin`)return null;let d=e.domains??[];async function p(){let t=i.trim();if(t!==``){s(null),u(!0);try{await n({chartKey:e.key,domain:t}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{u(!1)}}}async function m(t){s(null);try{await r({chartKey:e.key,domain:t})}catch{}}return(0,J.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,J.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:f()}),(0,J.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,J.jsx)(`div`,{className:`oc-chart-avail__groups`,children:d.length===0?(0,J.jsx)(`span`,{className:`oc-show__desc`,children:fe()}):d.map(e=>(0,J.jsxs)(F,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,J.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":ct({domain:e}),onClick:()=>void m(e),children:(0,J.jsx)(E,{className:`size-3`})})]},e))}),(0,J.jsxs)(`div`,{className:`oc-show__row`,children:[(0,J.jsx)(A,{value:i,onChange:e=>a(e.target.value),placeholder:ot(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&p()}}),(0,J.jsx)(D,{variant:`outline`,size:`sm`,disabled:l,onClick:()=>void p(),children:c()})]}),(0,J.jsx)(`span`,{className:`oc-show__desc`,children:me()}),o?(0,J.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function Xt({chart:e}){let t=C(y.charts.updateChart),n=C(y.charts.deleteChart),[r,i]=(0,W.useState)(!1),[a,s]=(0,W.useState)(e.name),[c,l]=(0,W.useState)(()=>JSON.stringify(e.tokens,null,2)),[u,d]=(0,W.useState)(null),[f,p]=(0,W.useState)(!1);function m(){s(e.name),l(JSON.stringify(e.tokens,null,2)),d(null),i(!0)}async function h(){if(e.chartId===void 0)return;d(null);let n;try{n=JSON.parse(c)}catch{d(w());return}p(!0);try{await t({chartId:e.chartId,name:a.trim(),tokens:n}),i(!1)}catch(e){d(e instanceof Error?e.message:String(e))}finally{p(!1)}}async function g(){if(e.chartId!==void 0&&window.confirm(x()))try{await n({chartId:e.chartId})}catch{}}return(0,J.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,J.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,J.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,J.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(D,{variant:`outline`,size:`sm`,onClick:m,children:ge()}),(0,J.jsx)(D,{variant:`ghost`,size:`sm`,onClick:()=>void g(),children:o()})]})})]}),r?(0,J.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,J.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,J.jsx)(`span`,{className:`oc-chart-import__label`,children:it()}),(0,J.jsx)(A,{value:a,onChange:e=>s(e.target.value),maxLength:60})]}),(0,J.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,J.jsx)(`span`,{className:`oc-chart-import__label`,children:Se()}),(0,J.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:c,onChange:e=>l(e.target.value),rows:10,spellCheck:!1})]}),u?(0,J.jsx)(`p`,{className:`oc-chart-import__error`,children:u}):null,(0,J.jsxs)(`div`,{className:`oc-show__row`,children:[(0,J.jsx)(D,{size:`sm`,disabled:f,onClick:()=>void h(),children:we()}),(0,J.jsx)(D,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:ut()})]})]}):null,(0,J.jsx)(Yt,{chart:e}),(0,J.jsx)($,{chart:e})]})}function Zt(){let e=S(y.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h2`,{className:`oc-show__title`,children:_e()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:he()})]}),e!==void 0&&t.length===0?(0,J.jsx)(`p`,{className:`oc-show__desc`,children:h()}):(0,J.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,J.jsx)(Xt,{chart:e},e.key))})]})}function Qt({chart:e,groups:t}){let n=C(y.charts.addChartToGroupPool),r=C(y.charts.removeChartFromGroupPool),i=e.restrictedToGroups,a=e.poolGroups,o=new Set((a??[]).map(e=>e.groupId)),s=t.filter(e=>!o.has(e._id));async function c(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function l(t){try{await r({groupId:t,chartKey:e.key})}catch{}}return(0,J.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,J.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,J.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,J.jsx)(F,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?$e():e.kind===`custom`&&e.scope===`personal`?b():Te()}),e.isGlobalDefault?(0,J.jsx)(F,{variant:`default`,children:Ye()}):null]}),(0,J.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,J.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Le()}),(a??[]).map(e=>(0,J.jsxs)(F,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,J.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Je({group:e.name}),onClick:()=>void l(e.groupId),children:(0,J.jsx)(E,{className:`size-3`})})]},e.groupId)),s.length>0?(0,J.jsxs)(z,{value:``,onValueChange:e=>void c(e),children:[(0,J.jsx)(M,{size:`sm`,className:`w-56`,children:(0,J.jsx)(O,{placeholder:Qe()})}),(0,J.jsx)(N,{children:s.map(e=>(0,J.jsx)(R,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,J.jsx)(`span`,{className:`oc-show__desc`,children:Ce()}):null]})]})}function $t({chart:e}){let t=C(y.charts.promoteChartToCommon),n=C(y.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(x()))try{await n({chartId:e.chartId})}catch{}}return(0,J.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,J.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,J.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,J.jsx)(F,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?Oe():b()}),e.ownerLabel?(0,J.jsx)(`span`,{className:`oc-show__desc`,children:Ze({owner:e.ownerLabel})}):null]}),(0,J.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,J.jsx)(D,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:nt()}):null,(0,J.jsx)(D,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:We()})]})]})}function en({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=C(y.admin.setDefaultThemeMode),a=C(y.admin.setDefaultLocale),o=C(y.charts.setDefaultChart),c=S(y.charts.listChartsAdmin),u=S(y.groups.listGroups,{}),f=e??`system`,p=t??`fr`;return(0,J.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h2`,{className:`oc-show__title`,children:at()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:s()})]}),(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h3`,{className:`oc-show__title`,children:Ge()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:Xe()})]}),(0,J.jsxs)(`div`,{className:`oc-show__row`,children:[(0,J.jsx)(D,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void o({name:null}),children:v()}),ht.map(e=>(0,J.jsx)(D,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({name:e.key}),children:e.name},e.key)),(c??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,J.jsx)(D,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({name:e.key}),children:e.name},e.key))]})]}),(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h3`,{className:`oc-show__title`,children:Ae()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:De()})]}),(0,J.jsx)(`div`,{className:`oc-chart-avail-list`,children:(c??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,J.jsx)(Qt,{chart:e,groups:u??[]},e.key))})]}),(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h3`,{className:`oc-show__title`,children:tt()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:He()})]}),(0,J.jsx)(`div`,{className:`oc-chart-avail-list`,children:(c??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,J.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,J.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,J.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,J.jsx)($,{chart:e})]},e.key))})]}),(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h3`,{className:`oc-show__title`,children:Ie()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:Ke()})]}),(()=>{let e=(c??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,J.jsx)(`p`,{className:`oc-show__desc`,children:Ee()}):(0,J.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,J.jsx)($t,{chart:e},e.key))})})()]}),(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h3`,{className:`oc-show__title`,children:i()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:Be()})]}),(0,J.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,J.jsx)(D,{variant:f===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:Wt(e)},e))})]}),(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h3`,{className:`oc-show__title`,children:se()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:l()})]}),(0,J.jsx)(`div`,{className:`oc-show__row`,children:[`fr`,`en`].map(e=>(0,J.jsx)(D,{variant:p===e?`default`:`outline`,size:`sm`,onClick:()=>void a({locale:e}),children:e===`fr`?Me():Pe()},e))}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:d()})]})]})}function tn(){let e=S(y.me.getMe,{host:L}),t=gt(e?.resolvedThemeMode);return(0,J.jsxs)(`div`,{className:`oc-appearance`,children:[(0,J.jsx)(qt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,J.jsx)(Jt,{}),(0,J.jsx)(Zt,{}),e?.role===`admin`?(0,J.jsx)(en,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function nn(){let[e,t]=(0,W.useState)(!0),[n,r]=(0,W.useState)(`per-user`),[i,a]=(0,W.useState)(``),[o,s]=(0,W.useState)(Y),[c,l]=(0,W.useState)(Y),[u,d]=(0,W.useState)(X),f=i!==``||o!==Y||c!==Y;function p(){a(``),s(Y),l(Y),d(X)}return(0,J.jsxs)(`div`,{className:`oc-show`,children:[(0,J.jsx)(tn,{}),(0,J.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,J.jsx)(`summary`,{className:`oc-show__title`,children:pe()}),(0,J.jsxs)(Z,{title:`Buttons`,description:`Variants`,children:[(0,J.jsxs)(`div`,{className:`oc-show__row`,children:[(0,J.jsx)(D,{children:`Default`}),(0,J.jsx)(D,{variant:`secondary`,children:`Secondary`}),(0,J.jsx)(D,{variant:`outline`,children:`Outline`}),(0,J.jsx)(D,{variant:`ghost`,children:`Ghost`}),(0,J.jsx)(D,{variant:`destructive`,children:`Destructive`}),(0,J.jsx)(D,{variant:`link`,children:`Link`})]}),(0,J.jsxs)(`div`,{className:`oc-show__row`,children:[(0,J.jsx)(D,{size:`sm`,children:`Small`}),(0,J.jsx)(D,{children:`Default`}),(0,J.jsx)(D,{size:`lg`,children:`Large`}),(0,J.jsx)(D,{size:`icon`,"aria-label":`more`,children:(0,J.jsx)(k,{})}),(0,J.jsx)(D,{disabled:!0,children:`Disabled`})]})]}),(0,J.jsx)(Z,{title:`Badges`,children:(0,J.jsxs)(`div`,{className:`oc-show__row`,children:[(0,J.jsx)(F,{children:`Default`}),(0,J.jsx)(F,{variant:`secondary`,children:`Secondary`}),(0,J.jsx)(F,{variant:`outline`,children:`Outline`}),(0,J.jsx)(F,{variant:`destructive`,children:`Destructive`})]})}),(0,J.jsx)(Z,{title:`Inputs & selection`,children:(0,J.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,J.jsx)(A,{placeholder:`Text input…`}),(0,J.jsxs)(`div`,{className:`oc-show__row`,children:[(0,J.jsxs)(z,{value:n,onValueChange:r,children:[(0,J.jsx)(M,{className:`w-56`,children:(0,J.jsx)(O,{placeholder:`Select…`})}),(0,J.jsxs)(N,{children:[(0,J.jsx)(R,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,J.jsx)(R,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,J.jsxs)(`label`,{className:`oc-show__check`,children:[(0,J.jsx)(j,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,J.jsx)(Z,{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,J.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,J.jsxs)(Ot,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,J.jsxs)(z,{value:o,onValueChange:s,children:[(0,J.jsx)(M,{size:`sm`,children:(0,J.jsx)(O,{})}),(0,J.jsxs)(N,{children:[(0,J.jsx)(R,{value:Y,children:`Toutes directions`}),(0,J.jsx)(R,{value:`inbound`,children:`inbound`}),(0,J.jsx)(R,{value:`outbound`,children:`outbound`}),(0,J.jsx)(R,{value:`internal`,children:`internal`})]})]}),(0,J.jsxs)(z,{value:c,onValueChange:l,children:[(0,J.jsx)(M,{size:`sm`,children:(0,J.jsx)(O,{})}),(0,J.jsxs)(N,{children:[(0,J.jsx)(R,{value:Y,children:`Toutes sévérités`}),(0,J.jsx)(R,{value:`info`,children:`info`}),(0,J.jsx)(R,{value:`warn`,children:`warn`}),(0,J.jsx)(R,{value:`critical`,children:`critical`})]})]})]}),(0,J.jsx)(kt,{fields:Ut,onChange:()=>{}}),(0,J.jsxs)(`div`,{className:`oc-show__row`,children:[(0,J.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,J.jsx)(ft,{value:u,onChange:d})]})]})}),(0,J.jsx)(Z,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,J.jsxs)(mt,{children:[(0,J.jsx)(_t,{asChild:!0,children:(0,J.jsx)(D,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,J.jsx)(k,{})})}),(0,J.jsxs)(pt,{align:`start`,children:[(0,J.jsx)(vt,{children:`Actions`}),(0,J.jsx)(I,{}),(0,J.jsx)(P,{children:`Edit`}),(0,J.jsx)(P,{children:`Duplicate`}),(0,J.jsx)(I,{}),(0,J.jsx)(P,{variant:`destructive`,children:`Delete`})]})]})}),(0,J.jsx)(Z,{title:`Card`,children:(0,J.jsxs)(wt,{className:`w-80`,children:[(0,J.jsxs)(yt,{children:[(0,J.jsx)(St,{children:`Instance`}),(0,J.jsx)(Ct,{children:`Non-secret metadata only.`})]}),(0,J.jsx)(xt,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,J.jsxs)(bt,{className:`gap-2`,children:[(0,J.jsx)(D,{size:`sm`,children:`Save`}),(0,J.jsx)(D,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,J.jsx)(Z,{title:`Table`,children:(0,J.jsxs)(Dt,{children:[(0,J.jsx)(Tt,{children:(0,J.jsxs)(V,{children:[(0,J.jsx)(B,{className:`w-8`,children:(0,J.jsx)(j,{"aria-label":`select all`})}),(0,J.jsx)(B,{children:`Name`}),(0,J.jsx)(B,{children:`Mode`}),(0,J.jsx)(B,{className:`text-right`,children:`Status`}),(0,J.jsx)(B,{className:`w-8`})]})}),(0,J.jsx)(Et,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,J.jsxs)(V,{children:[(0,J.jsx)(H,{children:(0,J.jsx)(j,{"aria-label":`select ${e.n}`})}),(0,J.jsx)(H,{className:`font-medium`,children:e.n}),(0,J.jsx)(H,{children:(0,J.jsx)(F,{variant:`secondary`,children:e.m})}),(0,J.jsx)(H,{className:`text-right`,children:(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,J.jsx)(T,{className:`size-3.5`}),` `,e.s]})}),(0,J.jsx)(H,{children:(0,J.jsx)(D,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,J.jsx)(k,{})})})]},e.n))})]})}),(0,J.jsx)(Z,{title:`App fragments`,description:`Chat-specific components`,children:(0,J.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,J.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,J.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,J.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,J.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,J.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,J.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,J.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,J.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,J.jsx)(`span`,{className:`oc-run-status__dot`}),(0,J.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{nn as ThemeShowroom};
@@ -1 +1 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$o as r,Go as i,Jo as a,Ko as o,Qo as s,Xo as c,Yo as l,Zo as u,cw as d,es as f,ns as p,qo as m,ts as h}from"./dist-DQy6UNW9.js";import{t as g}from"./button-CjrF4jCF.js";import{J as _,ct as v,lt as y,st as b,ut as x,vt as S}from"./index-nY1Cemm1.js";var C=d(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),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:p(),from:`now-5m`},{label:h(),from:`now-15m`},{label:f(),from:`now-30m`},{label:r(),from:`now-1h`},{label:s(),from:`now-3h`},{label:u(),from:`now-6h`},{label:c(),from:`now-12h`},{label:l(),from:`now-24h`},{label:a(),from:`now-2d`},{label:m(),from:`now-7d`},{label:o(),from:`now-30d`},{label:i(),from:`now-90d`}];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)(y,{open:n,onOpenChange:d,children:[(0,P.jsx)(x,{asChild:!0,children:(0,P.jsxs)(g,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,P.jsx)(C,{}),A(e)]})}),(0,P.jsx)(v,{children:(0,P.jsx)(b,{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)(_,{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)(_,{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)(S,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,P.jsx)(_,{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{$o as r,Go as i,Jo as a,Ko as o,Qo as s,Xo as c,Yo as l,Zo as u,es as d,lw as f,ns as p,qo as m,ts as h}from"./dist-CfgJ5RDI.js";import{t as g}from"./button-ClzO6iiY.js";import{J as _,ct as v,lt as y,st as b,ut as x,vt as S}from"./index-BsbX_-dh.js";var C=f(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),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:p(),from:`now-5m`},{label:h(),from:`now-15m`},{label:d(),from:`now-30m`},{label:r(),from:`now-1h`},{label:s(),from:`now-3h`},{label:u(),from:`now-6h`},{label:c(),from:`now-12h`},{label:l(),from:`now-24h`},{label:a(),from:`now-2d`},{label:m(),from:`now-7d`},{label:o(),from:`now-30d`},{label:i(),from:`now-90d`}];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)(y,{open:n,onOpenChange:d,children:[(0,P.jsx)(x,{asChild:!0,children:(0,P.jsxs)(g,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,P.jsx)(C,{}),A(e)]})}),(0,P.jsx)(v,{children:(0,P.jsx)(b,{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)(_,{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)(_,{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)(S,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,P.jsx)(_,{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{$g as r,Al as i,Bg as a,Bl as o,Cl as s,Dl as c,El as l,Fl as u,Gg as d,Gl as f,Hg as p,Hl as ee,Il as m,Jg as h,Jl as g,Kg as _,Kl as v,Ll as te,Ml as ne,Nl as re,Ol as ie,Pl as ae,Qg as y,Rl as oe,Sl as se,Tl as ce,Ug as b,Ul as le,Vg as ue,Vl as de,Wg as fe,Wl as pe,Xg as x,Xl as me,Yg as S,Yl as he,Zg as ge,_l as _e,a_ as C,bl as ve,c_ as w,cw as T,e_ as E,fl as D,gl as ye,hl as be,hw as O,i_ as k,jl as xe,kl as Se,l_ as A,ml as j,mw as M,n_ as N,o_ as P,pl as F,qg as I,ql as Ce,r_ as L,s_ as R,t_ as z,u_ as we,vl as Te,wl as Ee,xl as De,yl as Oe,zl as ke}from"./dist-CfgJ5RDI.js";import{n as Ae}from"./dist-D2UVxg3M.js";import{n as je}from"./TimeRangePicker-BCumk2bf.js";import{t as Me}from"./x-TUhW74Oi.js";import{t as B}from"./button-ClzO6iiY.js";import{A as Ne,C as V,F as Pe,I as Fe,Ot as Ie,P as Le,R as Re,S as H,Tt as ze,a as Be,b as U,i as Ve,kt as He,m as W,o as Ue,ot as We,r as Ge,x as G,y as K,z as Ke}from"./index-BsbX_-dh.js";import{t as qe}from"./FilterBar-Cn4lFaY4.js";import{t as Je}from"./AdvancedFilter-DrUoj1oY.js";import{t as Ye}from"./DataTableShell-BY48g0WO.js";var q=t(e(),1),J=n(),Y=e=>e===null?`—`:String(Math.round(e));function Xe(){let e=O(T.me.getMe,{host:We})?.role===`admin`,t=O(T.deliveryTiming.getDeliveryStatus,{}),n=M(T.deliveryTiming.startDeliveryRecord),r=M(T.deliveryTiming.stopDeliveryRecord),i=M(T.deliveryTiming.deleteDeliverySessions),[a,o]=(0,q.useState)(!1),[s,c]=(0,q.useState)(null),[l,u]=(0,q.useState)(new Set),[f,p]=(0,q.useState)(!1),[ee,m]=(0,q.useState)(!1),h=O(T.deliveryTiming.listDeliverySessions,a?{}:`skip`),g=O(T.deliveryTiming.getDeliveryReport,a?{sessionId:s??void 0}:`skip`),_=t?.recording??!1,v=async()=>{p(!0);try{_?await r({}):await n({})}finally{p(!1)}},te=()=>{g&&navigator.clipboard?.writeText(Ne(g)).then(()=>{m(!0),window.setTimeout(()=>m(!1),1200)}).catch(()=>{})},ne=e=>u(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),re=async()=>{let e=[...l];if(e.length!==0){p(!0);try{await i({sessionIds:e}),s!==null&&l.has(s)&&c(null),u(new Set)}finally{p(!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:we()}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:A()})]}),e?(0,J.jsx)(B,{variant:_?`destructive`:`default`,size:`sm`,disabled:f||t===void 0,onClick:()=>void v(),children:_?R():w()}):null]}),_?(0,J.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,J.jsx)(W,{variant:`secondary`,children:P()}),t?.startedAt?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:C({time:new Date(t.startedAt).toLocaleTimeString()})}):null]}):null,(0,J.jsx)(`div`,{children:(0,J.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>o(e=>!e),children:a?L():k()})}),a?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Ze,{sessions:h,selected:s,checked:l,isAdmin:e,onSelect:c,onToggleCheck:ne}),e&&l.size>0?(0,J.jsx)(`div`,{children:(0,J.jsx)(B,{variant:`destructive`,size:`sm`,disabled:f,onClick:()=>void re(),children:d({n:l.size})})}):null,(0,J.jsx)(Qe,{report:g,copied:ee,onCopy:te})]}):null]})}function Ze({sessions:e,selected:t,checked:n,isAdmin:r,onSelect:i,onToggleCheck:a}){return e?e.length===0?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:fe()}):(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:b()}),(0,J.jsx)(`ul`,{className:`flex flex-col`,children:e.map(e=>{let o=t===e.sessionId,s=new Date(e.startedAt).toLocaleString();return(0,J.jsxs)(`li`,{className:`flex items-center gap-2 border-t border-border py-1 text-sm first:border-t-0`,children:[r?(0,J.jsx)(`input`,{type:`checkbox`,"aria-label":`${p()} — ${s}`,checked:n.has(e.sessionId),onChange:()=>a(e.sessionId)}):null,(0,J.jsx)(`button`,{type:`button`,"aria-pressed":o,className:`flex-1 truncate text-left ${o?`font-medium`:`text-muted-foreground`}`,onClick:()=>i(o?null:e.sessionId),children:s}),e.active?(0,J.jsx)(W,{variant:`secondary`,children:ue()}):null]},e.sessionId)})})]}):null}function Qe({report:e,copied:t,onCopy:n}){if(!e)return null;if(e.count===0||e.segments===null)return(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:N()});let i=e.segments,o=(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:[Y(t.p50),` / `,Y(t.p95),` / `,Y(t.max)]})]});return(0,J.jsxs)(J.Fragment,{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,` `,a()]}),(0,J.jsxs)(B,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,J.jsx)(Ae,{size:13,"aria-hidden":!0}):(0,J.jsx)(ze,{size:13,"aria-hidden":!0}),t?_():I()]})]}),(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:z()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:E()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:r()})]})}),(0,J.jsxs)(`tbody`,{children:[o(y(),i.A),o(ge(),i.B),o(x(),i.C)]})]}),e.truncated?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:h()}):null,(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:S()})]})}var $e=[50,100,200,500],X=`all`,Z=`__all__`,et=[`2xx`,`4xx`,`5xx`],tt=[`user`,`service`,`system`],nt=[`inbound`,`outbound`,`internal`],rt={kind:`relative`,from:`now-30d`,to:`now`},it=[{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 at(){let e=He({from:`/settings/traces`}),t=Ie({from:`/settings/traces`}),n=e.limit,r=e.kind,a=e.statusClass??Z,d=e.principalType??Z,p=e.direction??Z,h=e.roleKey??Z,_=e.q??``,y=Ge(e.from,e.to),b=(0,q.useMemo)(()=>Ue(e.adv),[e.adv]),{from:ue,to:fe}=je(y),[x,S]=(0,q.useState)(null),[ge,C]=(0,q.useState)(null),w=e=>void t({search:t=>({...t,limit:e})}),E=e=>void t({search:t=>({...t,kind:e})}),D=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),k=e=>void t({search:t=>({...t,statusClass:e===Z?void 0:e})}),A=e=>void t({search:t=>({...t,principalType:e===Z?void 0:e})}),j=e=>void t({search:t=>({...t,direction:e===Z?void 0:e})}),M=e=>void t({search:t=>({...t,roleKey:e===Z?void 0:e})}),N=e=>void t({search:t=>({...t,...Be(e)})}),P=e=>void t({search:t=>({...t,adv:Ve(e)}),replace:!0}),F=O(T.observability.listEvents,{limit:n}),I=O(T.observability.listEvents,{limit:n,kind:r===X?void 0:r,filter:{q:_||void 0,from:ue,to:fe,statusClass:a===Z?void 0:a,principalType:d===Z?void 0:d,direction:p===Z?void 0:p,roleKey:h===Z?void 0:h,advanced:b.length>0?b:void 0}}),L=(0,q.useMemo)(()=>{let e=new Set;for(let t of F??[])e.add(t.kind);return[...e].sort()},[F]),R=(0,q.useMemo)(()=>{let e=new Set;for(let t of F??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[F]),z=_!==``||a!==Z||d!==Z||p!==Z||h!==Z||b.length>0||y.kind!==`relative`||y.from!==rt.from;function we(){t({search:{limit:100,kind:`all`},replace:!0})}let Ae=x?F?.filter(e=>e.correlationId===x):I;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Xe,{}),(0,J.jsxs)(`p`,{className:`oc-admin__hint`,children:[me(),(0,J.jsx)(`strong`,{children:he()}),g(),` `,(0,J.jsx)(`span`,{className:`oc-filter__window`,children:Ce()})]}),(0,J.jsxs)(qe,{q:_,onQChange:D,searchPlaceholder:v(),timeRange:y,onTimeRangeChange:N,onReset:we,canReset:z,children:[(0,J.jsxs)(K,{value:a,onValueChange:k,children:[(0,J.jsx)(H,{size:`sm`,className:`w-32`,children:(0,J.jsx)(V,{placeholder:f()})}),(0,J.jsxs)(U,{children:[(0,J.jsx)(G,{value:Z,children:pe()}),et.map(e=>(0,J.jsx)(G,{value:e,children:e},e))]})]}),(0,J.jsxs)(K,{value:d,onValueChange:A,children:[(0,J.jsx)(H,{size:`sm`,className:`w-32`,children:(0,J.jsx)(V,{placeholder:le()})}),(0,J.jsxs)(U,{children:[(0,J.jsx)(G,{value:Z,children:ee()}),tt.map(e=>(0,J.jsx)(G,{value:e,children:e},e))]})]}),(0,J.jsxs)(K,{value:p,onValueChange:j,children:[(0,J.jsx)(H,{size:`sm`,className:`w-32`,children:(0,J.jsx)(V,{placeholder:de()})}),(0,J.jsxs)(U,{children:[(0,J.jsx)(G,{value:Z,children:o()}),nt.map(e=>(0,J.jsx)(G,{value:e,children:e},e))]})]}),(0,J.jsxs)(K,{value:h,onValueChange:M,children:[(0,J.jsx)(H,{size:`sm`,className:`w-36`,children:(0,J.jsx)(V,{placeholder:ke()})}),(0,J.jsxs)(U,{children:[(0,J.jsx)(G,{value:Z,children:oe()}),R.map(e=>(0,J.jsx)(G,{value:e,children:e},e))]})]}),(0,J.jsxs)(K,{value:r,onValueChange:E,children:[(0,J.jsx)(H,{size:`sm`,className:`w-44`,children:(0,J.jsx)(V,{placeholder:te()})}),(0,J.jsxs)(U,{children:[(0,J.jsx)(G,{value:X,children:m()}),L.map(e=>(0,J.jsx)(G,{value:e,children:e},e))]})]}),(0,J.jsxs)(K,{value:String(n),onValueChange:e=>w(Number(e)),children:[(0,J.jsx)(H,{size:`sm`,className:`w-28`,children:(0,J.jsx)(V,{})}),(0,J.jsx)(U,{children:$e.map(e=>(0,J.jsx)(G,{value:String(e),children:u({count:e})},e))})]})]}),(0,J.jsx)(Je,{fields:it,seed:b,onChange:P}),x?(0,J.jsx)(`div`,{className:`oc-traces__followline`,children:(0,J.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>S(null),title:ae(),children:[(0,J.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[re(),(0,J.jsx)(`code`,{children:Q(x)})]}),(0,J.jsx)(Me,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,J.jsx)(`span`,{className:`sr-only`,children:ne()})]})}):null,(0,J.jsx)(Ye,{title:xe(),rows:Ae,emptyHint:x?i():Se(),columns:[{header:ie(),sort:e=>e.at,cell:e=>(0,J.jsx)(`span`,{className:`oc-traces__time`,children:new Date(e.at).toLocaleString(`fr-FR`)})},{header:c(),sort:e=>e.kind,cell:e=>(0,J.jsx)(W,{variant:`secondary`,children:e.kind})},{header:l(),sort:e=>$(e)??null,cell:e=>{let t=$(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":ce(),children:`✓`})}},{header:Ee(),sort:e=>e.direction,cell:e=>e.direction?(0,J.jsx)(W,{variant:`outline`,children:e.direction}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:s(),sort:e=>e.principalType,cell:e=>(0,J.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,J.jsx)(W,{variant:`outline`,children:e.principalType}),e.principalId?(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:Q(e.principalId)}):null]})},{header:se(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,J.jsx)(W,{variant:`secondary`,children:e.roleKey}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:De(),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:ve(),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 ${ot(e.status)}`,children:e.status})},{header:Oe(),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:Te(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,J.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:_e(),onClick:()=>S(e.correlationId),children:Q(e.correlationId)}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:ye(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,J.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>C(e),children:be()}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,J.jsx)(st,{row:ge,onClose:()=>C(null)})]})}function ot(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 Q(e){return e.length>8?e.slice(0,8):e}function $(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 st({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)(Le,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,J.jsxs)(Pe,{className:`max-w-lg`,children:[(0,J.jsxs)(Re,{children:[(0,J.jsxs)(Ke,{className:`oc-traces__meta-title`,children:[j(),` `,(0,J.jsx)(`code`,{children:e.kind}),(0,J.jsx)(W,{variant:`outline`,children:F()})]}),(0,J.jsx)(Fe,{children:D()})]}),(0,J.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{at as TracesTab};
@@ -1 +1 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ac as r,Am as i,Cm as a,Dc as o,Dm as s,Em as c,Fc as l,Ic as u,Lc as d,Mc as f,Nc as p,Oc as m,Om as h,Pc as g,Rc as _,Rp as v,Sm as y,Tm as ee,_m as te,am as b,bm as x,cm as ne,dm as re,fm as ie,gm as ae,hm as oe,im as se,jc as S,jm as C,kc as w,km as T,lm as E,mm as D,mw as O,om as ce,pm as le,pw as k,rm as ue,sm as de,sw as A,um as fe,vm as pe,wm as me,xm as he,ym as ge,zc as j}from"./dist-DQy6UNW9.js";import{t as M}from"./button-CjrF4jCF.js";import{$ as N,C as P,F,I,M as L,N as _e,O as R,Ot as z,P as B,Q as ve,R as ye,S as V,_t as H,b as U,d as W,et as be,f as xe,gt as G,j as K,kt as Se,m as q,ot as Ce,p as J,rt as we,tt as Te,x as Y,y as X,z as Ee}from"./index-nY1Cemm1.js";import{t as De}from"./FilterBar-DFcZPoFt.js";import{t as Oe}from"./DataTableShell-lk84lOrM.js";import{t as ke}from"./DetailChips-BEavm_Ac.js";var Z=t(e(),1),Q=n();function Ae({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=O(A.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),a=O(A.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,p=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),m=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(a??[]).filter(e=>!p.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}))],h=new Map;for(let e of m){let t=h.get(e.instanceName)??[];t.push(e),h.set(e.instanceName,t)}return(0,Q.jsx)(B,{open:n,onOpenChange:r,children:(0,Q.jsxs)(F,{className:`oc-access`,children:[(0,Q.jsxs)(ye,{children:[(0,Q.jsx)(Ee,{children:j({user:t})}),(0,Q.jsx)(I,{children:_()})]}),i?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?d():u()}):null,(0,Q.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:l()}):m.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:f()}):[...h.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:i,assigned:a,defaultKey:s}){let c=k(A.agents.assignAgent),l=k(A.agents.removeAgent),u=k(A.agents.setDefaultAgent),d=K();if(!e)return null;async function f(n,r){try{r?await l({profileId:e,instanceName:t,agentId:n}):await c({profileId:e,instanceName:t,agentId:n})}catch(e){d.error(g(),e)}}async function h(n){try{await u({profileId:e,instanceName:t,agentId:n})}catch(e){d.error(p(),e)}}return(0,Q.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Q.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Q.jsx)(H,{size:13,"aria-hidden":!0}),(0,Q.jsx)(`span`,{children:t}),(0,Q.jsx)(q,{variant:`outline`,className:`oc-access__kind`,children:n})]}),i.map(e=>{let n=`${t}/${e.agentId}`,i=a.has(n),c=s===n,l=e.state===`deleted`;return(0,Q.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Q.jsx)(R,{checked:i,disabled:l&&!i,onCheckedChange:()=>void f(e.agentId,i),"aria-label":S({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,l?(0,Q.jsx)(q,{variant:`outline`,className:`oc-access__gone`,children:r()}):null,e.outOfPool?(0,Q.jsx)(q,{variant:`outline`,className:`oc-access__gone`,children:w()}):null,i?c?(0,Q.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":m(),title:m(),children:(0,Q.jsx)(G,{size:14,fill:`currentColor`})}):(0,Q.jsx)(M,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":o(),title:o(),onClick:()=>void h(e.agentId),children:(0,Q.jsx)(G,{size:14})}):null]},e.agentId)})]})}var $=`__all__`;function Me({granted:e,onToggle:t}){let n=new Set(e),r=W.filter(e=>n.has(J[e])).length;return(0,Q.jsxs)(ve,{children:[(0,Q.jsx)(we,{asChild:!0,children:(0,Q.jsx)(M,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?C():i({count:r})})}),(0,Q.jsxs)(N,{align:`start`,className:`w-52`,children:[(0,Q.jsx)(Te,{children:T()}),W.map(e=>{let r=J[e];return(0,Q.jsxs)(be,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Q.jsx)(R,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Q.jsx)(`span`,{children:xe[e]??e})]},e)})]})]})}function Ne(){let e=Se({from:`/settings/users`}),t=z({from:`/settings/users`}),n=e.q??``,r=e.role??$,i=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),o=e=>void t({search:t=>({...t,role:e===$?void 0:e})}),l=O(A.admin.listUsers,{filter:{q:n||void 0,role:r===$?void 0:r},withAgents:!0}),u=O(A.me.getMe,{host:Ce}),d=k(A.admin.setRole),f=k(A.admin.setUserPermissions),p=k(A.admin.startImpersonation),m=k(A.admin.deleteUser),g=k(A.admin.setUserName),_=L(),S=_e(),C=K(),[w,T]=(0,Z.useState)(null),j=(0,Z.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of l??[])e.add(t.role);return[...e]},[l]),M=n!==``||r!==$;function N(){t({search:{},replace:!0})}async function F(e){try{await d(e)}catch(e){C.error(h(),e)}}async function I(e){try{await f(e)}catch(e){C.error(s(),e)}}async function R(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await _({title:x(),description:ge({user:t}),confirmWord:pe(),confirmLabel:te(),destructive:!0}))try{await m({profileId:e._id}),C.success(oe({user:t}))}catch(e){C.error(ae(),e)}}async function B(e){let t=e.email||e.name||e.userId.slice(0,8),n=await S({title:le(),label:ie({user:t}),placeholder:re(),defaultValue:e.name??``,confirmLabel:v()});if(n!==null)try{await g({profileId:e._id,name:n}),C.success(fe())}catch(e){C.error(E(),e)}}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(De,{q:n,onQChange:i,searchPlaceholder:c(),onReset:N,canReset:M,children:(0,Q.jsxs)(X,{value:r,onValueChange:o,children:[(0,Q.jsx)(V,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(P,{})}),(0,Q.jsxs)(U,{children:[(0,Q.jsx)(Y,{value:$,children:ee()}),j.map(e=>(0,Q.jsx)(Y,{value:e,children:e},e))]})]})}),(0,Q.jsx)(Oe,{title:me(),rows:l,emptyHint:a(),rowActions:e=>{let t=[{label:ue(),onSelect:()=>T({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:D(),onSelect:()=>void B(e)}];return e.userId!==u?.userId&&t.push({label:y(),onSelect:()=>void p({profileId:e._id})},{label:he(),variant:`destructive`,onSelect:()=>void R(e)}),t},columns:[{header:ne(),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:de(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Q.jsxs)(X,{value:e.role,onValueChange:t=>void F({profileId:e._id,role:t}),children:[(0,Q.jsx)(V,{size:`sm`,className:`w-28`,children:(0,Q.jsx)(P,{})}),(0,Q.jsxs)(U,{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:ce(),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:b()}):(0,Q.jsx)(Me,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),I({profileId:e._id,permissions:[...n]})}})},{header:se(),cell:e=>(0,Q.jsx)(ke,{icon:(0,Q.jsx)(H,{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:w?.profileId??null,userLabel:w?.label??``,open:w!==null,onOpenChange:e=>{e||T(null)}})]})}export{Ne as UsersTab};
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ac as r,Am as i,Cm as a,Dc as o,Dm as s,Em as c,Fc as l,Ic as u,Lc as d,Mc as f,Nc as p,Oc as m,Om as h,Pc as g,Rc as _,Rp as v,Sm as y,Tm as b,_m as ee,am as x,bm as S,cm as te,cw as C,dm as ne,fm as re,gm as ie,hm as ae,hw as w,im as T,jc as E,jm as D,kc as O,km as k,lm as oe,mm as se,mw as A,om as ce,pm as le,rm as ue,sm as de,um as fe,vm as pe,wm as me,xm as he,ym as ge,zc as j}from"./dist-CfgJ5RDI.js";import{t as M}from"./button-ClzO6iiY.js";import{$ as N,C as P,F,I,M as L,N as _e,O as R,Ot as z,P as B,Q as ve,R as ye,S as V,_t as H,b as U,d as W,et as be,f as xe,gt as G,j as K,kt as Se,m as q,ot as Ce,p as J,rt as we,tt as Te,x as Y,y as X,z as Ee}from"./index-BsbX_-dh.js";import{t as De}from"./FilterBar-Cn4lFaY4.js";import{t as Oe}from"./DataTableShell-BY48g0WO.js";import{t as ke}from"./DetailChips-B_6c_-iY.js";var Z=t(e(),1),Q=n();function Ae({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=w(C.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),a=w(C.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,p=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),m=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(a??[]).filter(e=>!p.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}))],h=new Map;for(let e of m){let t=h.get(e.instanceName)??[];t.push(e),h.set(e.instanceName,t)}return(0,Q.jsx)(B,{open:n,onOpenChange:r,children:(0,Q.jsxs)(F,{className:`oc-access`,children:[(0,Q.jsxs)(ye,{children:[(0,Q.jsx)(Ee,{children:j({user:t})}),(0,Q.jsx)(I,{children:_()})]}),i?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?d():u()}):null,(0,Q.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:l()}):m.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:f()}):[...h.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:i,assigned:a,defaultKey:s}){let c=A(C.agents.assignAgent),l=A(C.agents.removeAgent),u=A(C.agents.setDefaultAgent),d=K();if(!e)return null;async function f(n,r){try{r?await l({profileId:e,instanceName:t,agentId:n}):await c({profileId:e,instanceName:t,agentId:n})}catch(e){d.error(g(),e)}}async function h(n){try{await u({profileId:e,instanceName:t,agentId:n})}catch(e){d.error(p(),e)}}return(0,Q.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Q.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Q.jsx)(H,{size:13,"aria-hidden":!0}),(0,Q.jsx)(`span`,{children:t}),(0,Q.jsx)(q,{variant:`outline`,className:`oc-access__kind`,children:n})]}),i.map(e=>{let n=`${t}/${e.agentId}`,i=a.has(n),c=s===n,l=e.state===`deleted`;return(0,Q.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Q.jsx)(R,{checked:i,disabled:l&&!i,onCheckedChange:()=>void f(e.agentId,i),"aria-label":E({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,l?(0,Q.jsx)(q,{variant:`outline`,className:`oc-access__gone`,children:r()}):null,e.outOfPool?(0,Q.jsx)(q,{variant:`outline`,className:`oc-access__gone`,children:O()}):null,i?c?(0,Q.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":m(),title:m(),children:(0,Q.jsx)(G,{size:14,fill:`currentColor`})}):(0,Q.jsx)(M,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":o(),title:o(),onClick:()=>void h(e.agentId),children:(0,Q.jsx)(G,{size:14})}):null]},e.agentId)})]})}var $=`__all__`;function Me({granted:e,onToggle:t}){let n=new Set(e),r=W.filter(e=>n.has(J[e])).length;return(0,Q.jsxs)(ve,{children:[(0,Q.jsx)(we,{asChild:!0,children:(0,Q.jsx)(M,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?D():i({count:r})})}),(0,Q.jsxs)(N,{align:`start`,className:`w-52`,children:[(0,Q.jsx)(Te,{children:k()}),W.map(e=>{let r=J[e];return(0,Q.jsxs)(be,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Q.jsx)(R,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Q.jsx)(`span`,{children:xe[e]??e})]},e)})]})]})}function Ne(){let e=Se({from:`/settings/users`}),t=z({from:`/settings/users`}),n=e.q??``,r=e.role??$,i=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),o=e=>void t({search:t=>({...t,role:e===$?void 0:e})}),l=w(C.admin.listUsers,{filter:{q:n||void 0,role:r===$?void 0:r},withAgents:!0}),u=w(C.me.getMe,{host:Ce}),d=A(C.admin.setRole),f=A(C.admin.setUserPermissions),p=A(C.admin.startImpersonation),m=A(C.admin.deleteUser),g=A(C.admin.setUserName),_=L(),E=_e(),D=K(),[O,k]=(0,Z.useState)(null),j=(0,Z.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of l??[])e.add(t.role);return[...e]},[l]),M=n!==``||r!==$;function N(){t({search:{},replace:!0})}async function F(e){try{await d(e)}catch(e){D.error(h(),e)}}async function I(e){try{await f(e)}catch(e){D.error(s(),e)}}async function R(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await _({title:S(),description:ge({user:t}),confirmWord:pe(),confirmLabel:ee(),destructive:!0}))try{await m({profileId:e._id}),D.success(ae({user:t}))}catch(e){D.error(ie(),e)}}async function B(e){let t=e.email||e.name||e.userId.slice(0,8),n=await E({title:le(),label:re({user:t}),placeholder:ne(),defaultValue:e.name??``,confirmLabel:v()});if(n!==null)try{await g({profileId:e._id,name:n}),D.success(fe())}catch(e){D.error(oe(),e)}}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(De,{q:n,onQChange:i,searchPlaceholder:c(),onReset:N,canReset:M,children:(0,Q.jsxs)(X,{value:r,onValueChange:o,children:[(0,Q.jsx)(V,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(P,{})}),(0,Q.jsxs)(U,{children:[(0,Q.jsx)(Y,{value:$,children:b()}),j.map(e=>(0,Q.jsx)(Y,{value:e,children:e},e))]})]})}),(0,Q.jsx)(Oe,{title:me(),rows:l,emptyHint:a(),rowActions:e=>{let t=[{label:ue(),onSelect:()=>k({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:se(),onSelect:()=>void B(e)}];return e.userId!==u?.userId&&t.push({label:y(),onSelect:()=>void p({profileId:e._id})},{label:he(),variant:`destructive`,onSelect:()=>void R(e)}),t},columns:[{header:te(),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:de(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Q.jsxs)(X,{value:e.role,onValueChange:t=>void F({profileId:e._id,role:t}),children:[(0,Q.jsx)(V,{size:`sm`,className:`w-28`,children:(0,Q.jsx)(P,{})}),(0,Q.jsxs)(U,{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:ce(),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:x()}):(0,Q.jsx)(Me,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),I({profileId:e._id,permissions:[...n]})}})},{header:T(),cell:e=>(0,Q.jsx)(ke,{icon:(0,Q.jsx)(H,{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||k(null)}})]})}export{Ne as UsersTab};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n,nw as r,t as i}from"./dist-DQy6UNW9.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,rw as r,t as i}from"./dist-CfgJ5RDI.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-DQy6UNW9.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-CfgJ5RDI.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{lw as e}from"./dist-CfgJ5RDI.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{_ as e,c as t,i as n,o as r,r as i,s as a}from"./dist-DQy6UNW9.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(e){return e===`supported`?t():e===`beyond`?a():r()}function p(t){return t??e()}function m(e){return e===null?i():n({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{_ as e,c as t,i as n,o as r,r as i,s as a}from"./dist-CfgJ5RDI.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(e){return e===`supported`?t():e===`beyond`?a():r()}function p(t){return t??e()}function m(e){return e===null?i():n({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{Ai as e,Bi as t,Ci as n,Di as r,Ei as i,Fi as a,Hi as o,Ii as s,Li as c,Mi as l,Ni as u,Oi as d,Pi as f,Ri as p,Si as m,Ti as h,Ui as g,Vi as _,_i as v,bi as y,gi as b,hi as x,ji as S,ki as C,vi as w,wi as T,xi as E,yi as D,zi as O}from"./dist-DQy6UNW9.js";var k={AGENT_NOT_FOUND:()=>({label:g(),hint:o()}),AUTH_TOKEN_MISMATCH:()=>({label:_(),hint:t()}),DEVICE_SIGNING_FAILED:()=>({label:O(),hint:p()}),SESSION_SCOPE_DENIED:()=>({label:c(),hint:s()}),GATEWAY_TIMEOUT:()=>({label:a(),hint:f()}),GATEWAY_DISCONNECTED:()=>({label:u(),hint:l()}),ATTACHMENT_TOO_LARGE:()=>({label:C(),hint:d()}),ATTACHMENT_REJECTED:()=>({label:r(),hint:i()}),BRIDGE_UNREACHABLE:()=>({label:S(),hint:e()}),INVALID_REQUEST:()=>({label:h(),hint:T()}),NOT_CONFIGURED:()=>({label:n(),hint:m()}),UNROUTED:()=>({label:E(),hint:y()}),UPSTREAM_ERROR:()=>({label:D(),hint:w()}),UNKNOWN:()=>({label:v(),hint:b()})};function A(e){return e?k[e]?.()??{label:e,hint:x()}:k.UNKNOWN()}export{A as t};
1
+ import{Ai as e,Bi as t,Ci as n,Di as r,Ei as i,Fi as a,Hi as o,Ii as s,Li as c,Mi as l,Ni as u,Oi as d,Pi as f,Ri as p,Si as m,Ti as h,Ui as g,Vi as _,_i as v,bi as y,gi as b,hi as x,ji as S,ki as C,vi as w,wi as T,xi as E,yi as D,zi as O}from"./dist-CfgJ5RDI.js";var k={AGENT_NOT_FOUND:()=>({label:g(),hint:o()}),AUTH_TOKEN_MISMATCH:()=>({label:_(),hint:t()}),DEVICE_SIGNING_FAILED:()=>({label:O(),hint:p()}),SESSION_SCOPE_DENIED:()=>({label:c(),hint:s()}),GATEWAY_TIMEOUT:()=>({label:a(),hint:f()}),GATEWAY_DISCONNECTED:()=>({label:u(),hint:l()}),ATTACHMENT_TOO_LARGE:()=>({label:C(),hint:d()}),ATTACHMENT_REJECTED:()=>({label:r(),hint:i()}),BRIDGE_UNREACHABLE:()=>({label:S(),hint:e()}),INVALID_REQUEST:()=>({label:h(),hint:T()}),NOT_CONFIGURED:()=>({label:n(),hint:m()}),UNROUTED:()=>({label:E(),hint:y()}),UPSTREAM_ERROR:()=>({label:D(),hint:w()}),UNKNOWN:()=>({label:v(),hint:b()})};function A(e){return e?k[e]?.()??{label:e,hint:x()}:k.UNKNOWN()}export{A as t};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{ZC as r,iw as i,lw as a,sw as o}from"./dist-CfgJ5RDI.js";var s=a(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),c=a(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),l=t(e(),1),u=n();function d(e){let t=e+`CollectionProvider`,[n,a]=r(t),[s,c]=n(t,{collectionRef:{current:null},itemMap:new Map}),d=e=>{let{scope:t,children:n}=e,r=l.useRef(null),i=l.useRef(new Map).current;return(0,u.jsx)(s,{scope:t,itemMap:i,collectionRef:r,children:n})};d.displayName=t;let f=e+`CollectionSlot`,p=i(f),m=l.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,u.jsx)(p,{ref:o(t,c(f,n).collectionRef),children:r})});m.displayName=f;let h=e+`CollectionItemSlot`,g=`data-radix-collection-item`,_=i(h),v=l.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,a=l.useRef(null),s=o(t,a),d=c(h,n);return l.useEffect(()=>(d.itemMap.set(a,{ref:a,...i}),()=>void d.itemMap.delete(a))),(0,u.jsx)(_,{[g]:``,ref:s,children:r})});v.displayName=h;function y(t){let n=c(e+`CollectionConsumer`,t);return l.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${g}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:d,Slot:m,ItemSlot:v},y,a]}var f=l.createContext(void 0);function p(e){let t=l.useContext(f);return e||t||`ltr`}export{s as i,d as n,c as r,p as t};