@xenon-device-management/xenon 1.21.2 → 1.21.4

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 (88) hide show
  1. package/lib/package.json +1 -1
  2. package/lib/public/assets/{ApiKeyGate-Dv3OKptc.js → ApiKeyGate-sMlA83d8.js} +1 -1
  3. package/lib/public/assets/{BugReportButton-D_b9KHNb.js → BugReportButton-SGMRPU0S.js} +1 -1
  4. package/lib/public/assets/{DeviceMosaicView-BUufFwuy.js → DeviceMosaicView-BamwsLlZ.js} +1 -1
  5. package/lib/public/assets/{EmptyState-DYoZGxzF.js → EmptyState-ClUD0Vld.js} +1 -1
  6. package/lib/public/assets/{FieldGroup-B_XuPehm.js → FieldGroup-CuCZ8BNX.js} +1 -1
  7. package/lib/public/assets/{Modal-BZlSzyZw.js → Modal-UoT1ee9F.js} +1 -1
  8. package/lib/public/assets/{SegmentedControl-D_Nsf47y.js → SegmentedControl-DFbTO8Rd.js} +1 -1
  9. package/lib/public/assets/{SettingCard-ZbR8DaHC.js → SettingCard-DWUR3fDP.js} +1 -1
  10. package/lib/public/assets/{Table-ldjg_e2f.js → Table-MzcW-imA.js} +1 -1
  11. package/lib/public/assets/{activity-u-0Ik7tY.js → activity-CwEbgyzs.js} +1 -1
  12. package/lib/public/assets/{ai-settings-on9OKu0W.js → ai-settings-ObuMpZvr.js} +1 -1
  13. package/lib/public/assets/{api-keys-C28q8da2.js → api-keys-zL4Cqch_.js} +1 -1
  14. package/lib/public/assets/{apps-DgamwtEX.js → apps-BRFn6eGu.js} +3 -3
  15. package/lib/public/assets/apps-DJMD5JOy.css +1 -0
  16. package/lib/public/assets/{arrow-left-ehBRmCNn.js → arrow-left-C4EtSfxV.js} +1 -1
  17. package/lib/public/assets/{arrow-right-C326Fze7.js → arrow-right-BZOsPzCM.js} +1 -1
  18. package/lib/public/assets/{arrow-up-right-B1fIJB3F.js → arrow-up-right-CQRsDsic.js} +1 -1
  19. package/lib/public/assets/{auth-shell-CR4Yurjj.js → auth-shell-BMSqR1nV.js} +2 -2
  20. package/lib/public/assets/{builds-page-Dz-23vWZ.js → builds-page-BzxMlYw9.js} +1 -1
  21. package/lib/public/assets/{button-DTHTbm66.js → button-DnKYpdU4.js} +1 -1
  22. package/lib/public/assets/{calendar-xSvnZTc1.js → calendar-aV4AVHaS.js} +1 -1
  23. package/lib/public/assets/{check-DLl5QnWP.js → check-BPLHaAKw.js} +1 -1
  24. package/lib/public/assets/{chevron-right-DNwKxbTv.js → chevron-right-1KzpGm-7.js} +1 -1
  25. package/lib/public/assets/{circle-check-BUmpiwAe.js → circle-check-t8Jl8LXT.js} +1 -1
  26. package/lib/public/assets/{circle-x-C5T-Rh9v.js → circle-x-NYAOBQue.js} +1 -1
  27. package/lib/public/assets/{clock-BqlHiTAP.js → clock-pxkEQVMz.js} +1 -1
  28. package/lib/public/assets/{copy-BLyHAmgm.js → copy-DHh97c2p.js} +1 -1
  29. package/lib/public/assets/device-explorer-BViMoA1z.js +265 -0
  30. package/lib/public/assets/device-explorer-CCbOXiB6.css +1 -0
  31. package/lib/public/assets/{download-BVTiAIU5.js → download-COSAREQK.js} +1 -1
  32. package/lib/public/assets/{forgot-password-CduOraUB.js → forgot-password-BHX4LiOD.js} +1 -1
  33. package/lib/public/assets/{funnel-CuI8IToX.js → funnel-SufEHnWn.js} +1 -1
  34. package/lib/public/assets/{index-COp2dqp8.js → index-C9oFTvnK.js} +2 -2
  35. package/lib/public/assets/{input-Bn0KOFhW.js → input-mjF8rl_B.js} +1 -1
  36. package/lib/public/assets/{layers-xDm1noNV.js → layers-DHdrNsSo.js} +1 -1
  37. package/lib/public/assets/{lock-BP7MGEhj.js → lock-CvF4fCd-.js} +1 -1
  38. package/lib/public/assets/{login-D2Sz6dHH.js → login-Cl-0JssM.js} +1 -1
  39. package/lib/public/assets/{maintenance-settings-4doZpFuw.js → maintenance-settings-6S5_JmIE.js} +1 -1
  40. package/lib/public/assets/{mouse-pointer-2-GL4QUBCc.js → mouse-pointer-2-DF_AjwQn.js} +1 -1
  41. package/lib/public/assets/{network-DKxm8IB3.js → network-CoVEigKi.js} +1 -1
  42. package/lib/public/assets/overview-Wi-Nw4NN.js +1 -0
  43. package/lib/public/assets/{page-header-5o7AL-Si.js → page-header-CFA0PGbZ.js} +1 -1
  44. package/lib/public/assets/{plus-ajEIVTxm.js → plus-BG0mAYNZ.js} +1 -1
  45. package/lib/public/assets/{profile-page-Dr7ii2DH.js → profile-page-D7kSjVC_.js} +2 -2
  46. package/lib/public/assets/{reset-password-Dawc9wUh.js → reset-password-Dh6xmXgO.js} +1 -1
  47. package/lib/public/assets/{runbook-page-CN2Fh5sY.js → runbook-page-jC5E1XYy.js} +1 -1
  48. package/lib/public/assets/{select-BqXgtuxg.js → select-C-oZr2R0.js} +1 -1
  49. package/lib/public/assets/{selector-detail-page-DUhDzmFK.js → selector-detail-page-CMVMd6Yp.js} +1 -1
  50. package/lib/public/assets/{selector-health-C5m0E0Dp.js → selector-health-9Z-nDz2m.js} +1 -1
  51. package/lib/public/assets/{selector-health-page-CE5_77df.js → selector-health-page-e9tAgek_.js} +1 -1
  52. package/lib/public/assets/{session-detail-page-6xOmL0NK.js → session-detail-page-CHVjjjPj.js} +1 -1
  53. package/lib/public/assets/{settings-d62EcGPv.js → settings-Civlvc4t.js} +1 -1
  54. package/lib/public/assets/{status-pill-outline-5wXMsnEB.js → status-pill-outline-BHQH6ORF.js} +1 -1
  55. package/lib/public/assets/{tablet-CuqUA1KS.js → tablet-CxcSmARH.js} +1 -1
  56. package/lib/public/assets/{teams-DxgM4ciR.js → teams-saQrULbE.js} +1 -1
  57. package/lib/public/assets/{trash-2-HuAOeX9q.js → trash-2-D1mEbpqi.js} +1 -1
  58. package/lib/public/assets/{upload-Dalp13bU.js → upload-C0fB1Ecv.js} +1 -1
  59. package/lib/public/assets/{use-password-reset-mode-CDASAMyx.js → use-password-reset-mode-CNabwNnQ.js} +1 -1
  60. package/lib/public/assets/{users-aZ-G0mfB.js → users-25j6GSXg.js} +1 -1
  61. package/lib/public/assets/{users-hIVolIgm.js → users-_9TxSOzm.js} +1 -1
  62. package/lib/public/assets/{webhook-settings-Bfqps60Z.js → webhook-settings-BWFfjUuB.js} +1 -1
  63. package/lib/public/assets/{zap-DQD0Ahbz.js → zap-CCkxgMnZ.js} +1 -1
  64. package/lib/public/index.html +1 -1
  65. package/lib/src/services/ProcessRegistry.js +27 -34
  66. package/lib/test/helpers/artifact-store.js +32 -0
  67. package/lib/test/unit/DeviceModel.spec.js +10 -7
  68. package/lib/test/unit/IOSDeviceManager.spec.js +12 -10
  69. package/lib/test/unit/ProcessRegistry.test.js +43 -0
  70. package/lib/test/unit/RemoteIOs.spec.js +13 -11
  71. package/lib/test/unit/ResilioTreeHealingProvider.test.js +1 -0
  72. package/lib/test/unit/apps-download.spec.js +7 -5
  73. package/lib/test/unit/bug-report/route.spec.js +13 -1
  74. package/lib/test/unit/build-export.spec.js +1 -0
  75. package/lib/test/unit/config.spec.js +1 -0
  76. package/lib/test/unit/findAndLockDevice-leasemerge.spec.js +6 -4
  77. package/lib/test/unit/plugin.spec.js +1 -0
  78. package/lib/test/unit/proof-bundle.spec.js +3 -0
  79. package/lib/test/unit/rateLimitMiddleware.test.js +3 -1
  80. package/lib/test/unit/recording-instrumentation.spec.js +36 -27
  81. package/lib/test/unit/recording-orchestrator.spec.js +9 -14
  82. package/lib/test/unit/recording-source-ended.spec.js +3 -8
  83. package/lib/tsconfig.tsbuildinfo +1 -1
  84. package/package.json +1 -1
  85. package/lib/public/assets/apps-lzi4Ooq8.css +0 -1
  86. package/lib/public/assets/device-explorer-CZL1HtSH.js +0 -265
  87. package/lib/public/assets/device-explorer-C_84uNMS.css +0 -1
  88. package/lib/public/assets/overview-D1Okkk6f.js +0 -1
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xenon-device-management/xenon",
3
- "version": "1.21.2",
3
+ "version": "1.21.4",
4
4
  "description": "Xenon - Intelligent Mobile Infrastructure. A self-healing device orchestration platform for Appium.",
5
5
  "main": "./lib/src/index.js",
6
6
  "exports": {
@@ -1 +1 @@
1
- import{r as n,j as e,o as h}from"./index-COp2dqp8.js";function y({children:c}){const[i,s]=n.useState(null),[o,l]=n.useState(""),[a,r]=n.useState(null);if(n.useEffect(()=>{fetch("/xenon/api/health").then(()=>fetch("/xenon/api/sessions",{credentials:"include"})).then(t=>s(t.status!==401)).catch(()=>s(!1))},[]),i===null)return e.jsx("div",{style:{padding:40},children:"Loading…"});if(i)return e.jsx(e.Fragment,{children:c});async function u(t){t.preventDefault(),r(null);const d=await fetch("/xenon/api/auth/dashboard-session",{method:"POST",headers:{"Content-Type":"application/json",...h},credentials:"include",body:JSON.stringify({apiKey:o.trim()})});if(d.ok)s(!0);else{const p=await d.json().catch(()=>({}));r(p.error||"Invalid key")}}return e.jsxs("div",{style:{maxWidth:420,margin:"120px auto",padding:24},children:[e.jsx("h2",{children:"Sign in to Xenon"}),e.jsxs("p",{children:["Paste an API key. First-time setup: the bootstrap key is in"," ",e.jsx("code",{children:"~/.cache/xenon/bootstrap-key.txt"})," on the server."]}),e.jsxs("form",{onSubmit:u,children:[e.jsx("input",{type:"password",value:o,onChange:t=>l(t.target.value),placeholder:"API key",style:{width:"100%",padding:8,boxSizing:"border-box"},autoFocus:!0}),e.jsx("button",{type:"submit",style:{marginTop:12,padding:"8px 16px"},children:"Continue"})]}),a&&e.jsx("p",{style:{color:"crimson",marginTop:12},children:a})]})}export{y as ApiKeyGate};
1
+ import{r as n,j as e,o as h}from"./index-C9oFTvnK.js";function y({children:c}){const[i,s]=n.useState(null),[o,l]=n.useState(""),[a,r]=n.useState(null);if(n.useEffect(()=>{fetch("/xenon/api/health").then(()=>fetch("/xenon/api/sessions",{credentials:"include"})).then(t=>s(t.status!==401)).catch(()=>s(!1))},[]),i===null)return e.jsx("div",{style:{padding:40},children:"Loading…"});if(i)return e.jsx(e.Fragment,{children:c});async function u(t){t.preventDefault(),r(null);const d=await fetch("/xenon/api/auth/dashboard-session",{method:"POST",headers:{"Content-Type":"application/json",...h},credentials:"include",body:JSON.stringify({apiKey:o.trim()})});if(d.ok)s(!0);else{const p=await d.json().catch(()=>({}));r(p.error||"Invalid key")}}return e.jsxs("div",{style:{maxWidth:420,margin:"120px auto",padding:24},children:[e.jsx("h2",{children:"Sign in to Xenon"}),e.jsxs("p",{children:["Paste an API key. First-time setup: the bootstrap key is in"," ",e.jsx("code",{children:"~/.cache/xenon/bootstrap-key.txt"})," on the server."]}),e.jsxs("form",{onSubmit:u,children:[e.jsx("input",{type:"password",value:o,onChange:t=>l(t.target.value),placeholder:"API key",style:{width:"100%",padding:8,boxSizing:"border-box"},autoFocus:!0}),e.jsx("button",{type:"submit",style:{marginTop:12,padding:"8px 16px"},children:"Continue"})]}),a&&e.jsx("p",{style:{color:"crimson",marginTop:12},children:a})]})}export{y as ApiKeyGate};
@@ -1,4 +1,4 @@
1
- import{c as m,j as o,r as f,x as g,f as b}from"./index-COp2dqp8.js";/**
1
+ import{c as m,j as o,r as f,x as g,f as b}from"./index-C9oFTvnK.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,2 +1,2 @@
1
- import{r as u,j as r,X as D,T as Se,W as je}from"./index-COp2dqp8.js";import{p as Te}from"./labels-C21SA4JG.js";import{A as K,I as Ce}from"./keycodes-bIEJfQzr.js";import{a as Ae}from"./page-header-5o7AL-Si.js";function Ie(e,t){return e!=="auto"?e:t<=1?"1":t===2?"2x1":t<=4?"2x2":"3x2"}const ke={selected:new Set,layout:"2x2",tiles:[],groupId:null,compositeEnabled:!1,downloadableVideoCount:0,recordingPhase:"idle",recording:!1,startedAt:null,annotateMode:!1,shape:"RECT",color:"#ff3333",overlayAnnotations:{},errorBanner:null,banner:null};function De(e,t){var n;switch(t.type){case"SET_LAYOUT":return{...e,layout:t.layout};case"TOGGLE_SELECTED":{const o=new Set(e.selected);return o.has(t.udid)?o.delete(t.udid):o.add(t.udid),{...e,selected:o}}case"CLEAR_SELECTED":return{...e,selected:new Set};case"SET_TILES":return{...e,tiles:t.tiles};case"ADD_TILE":return e.tiles.some(o=>o.udid===t.tile.udid)?e:{...e,tiles:[...e.tiles,t.tile]};case"PATCH_TILE_DIMS":{let o=!1;const i=e.tiles.map(f=>f.udid!==t.udid||f.screenWidth&&f.screenHeight?f:(o=!0,{...f,screenWidth:t.screenWidth,screenHeight:t.screenHeight,aspect:f.aspect??t.aspect}));return o?{...e,tiles:i}:e}case"REMOVE_TILE":return e.recordingPhase!=="idle"?e:{...e,tiles:e.tiles.filter(o=>o.udid!==t.udid)};case"BIND_RECORDING_IDS":{const o=e.tiles.map(i=>({...i,recordingId:t.map[i.udid]??i.recordingId}));return{...e,tiles:o}}case"SET_RECORDING_PHASE":{const o=t.phase;return{...e,recordingPhase:o,recording:o==="recording"||o==="stopping"}}case"START_RECORDING":{const o=e.tiles.map(i=>({...i,recordingId:t.tileIds[i.udid]??i.recordingId}));return{...e,groupId:t.groupId,compositeEnabled:t.compositeEnabled===!0,downloadableVideoCount:0,recordingPhase:"recording",recording:!0,annotateMode:!0,startedAt:t.startedAt,overlayAnnotations:{},tiles:o}}case"STOP_RECORDING":{const o=e.tiles.map(i=>({...i,recordingId:void 0}));return{...e,recording:!1,recordingPhase:"idle",annotateMode:!1,overlayAnnotations:{},downloadableVideoCount:t.downloadableVideoCount??e.downloadableVideoCount,compositeEnabled:t.compositeEnabled!==void 0?t.compositeEnabled:e.compositeEnabled,tiles:o}}case"SET_ANNOTATE_MODE":return{...e,annotateMode:t.enabled};case"SET_SHAPE":return{...e,shape:t.shape};case"SET_COLOR":return{...e,color:t.color};case"SET_OVERLAY_ANNOTATIONS":return{...e,overlayAnnotations:{...e.overlayAnnotations,[t.recordingId]:t.annotations}};case"CLEAR_OVERLAY_ANNOTATIONS":return{...e,overlayAnnotations:{}};case"SET_ERROR_BANNER":return{...e,errorBanner:t.message,banner:t.message?{tone:"error",message:t.message}:null};case"SET_BANNER":return{...e,banner:t.banner,errorBanner:((n=t.banner)==null?void 0:n.tone)==="error"?t.banner.message:null};default:return e}}const le=u.createContext(null);function _e(){const e=u.useContext(le);if(!e)throw new Error("useMosaic must be used inside <MosaicContext.Provider>");return e}function Me(){return u.useReducer(De,ke)}function $e(e){const t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/3600),o=Math.floor(t%3600/60),i=t%60;return n>0?`${n}:${String(o).padStart(2,"0")}:${String(i).padStart(2,"0")}`:`${o}:${String(i).padStart(2,"0")}`}function Pe(e){switch(e){case"automation":return"In automation";case"manual_other":return"Manual control by another user";case"manual_self":return"In your mosaic";case"recording_other_group":return"Recording in another group";default:return e?"Busy":null}}const re=[{id:"ios",label:"iOS",match:e=>e==="ios"},{id:"android",label:"Android",match:e=>e==="android"},{id:"tvos",label:"tvOS",match:e=>e==="tvos"},{id:"androidtv",label:"Android TV",match:e=>e==="androidtv"||e==="android-tv"},{id:"other",label:"Other",match:()=>!0}];function Oe(e){return Te(e)}function Le({devices:e,inMosaic:t,onToggle:n}){const[o,i]=u.useState(""),[f,g]=u.useState({}),S=u.useMemo(()=>{const h=o.trim().toLowerCase();return h?e.filter(y=>y.udid.toLowerCase().includes(h)||(y.name??"").toLowerCase().includes(h)||(y.platform??"").toLowerCase().includes(h)):e},[e,o]),v=u.useMemo(()=>{const h=re.map(c=>({id:c.id,label:c.label,rows:[]})),y=c=>h.find((j,w)=>re[w].match(c))??h[h.length-1];for(const c of S)y((c.platform??"").toLowerCase()).rows.push(c);return h.filter(c=>c.rows.length>0)},[S]);return e.length===0?r.jsx("div",{className:"text-xs text-[var(--text-dim)] p-3",children:"No devices online."}):r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsxs("div",{className:"relative",children:[r.jsx("span",{"aria-hidden":!0,className:"absolute left-2 top-1/2 -translate-y-1/2 text-[var(--text-dim)] text-xs",children:"⌕"}),r.jsx("input",{type:"text",value:o,placeholder:"Filter devices...",onChange:h=>i(h.target.value),className:"w-full pl-7 pr-2 py-1.5 text-xs rounded border border-[var(--border)] bg-transparent placeholder:text-[var(--text-dim)] focus:outline-none focus:border-[var(--color-info)]"})]}),v.map(h=>{const y=f[h.id];return r.jsxs("section",{className:"flex flex-col gap-1",children:[r.jsxs("button",{type:"button",onClick:()=>g(c=>({...c,[h.id]:!c[h.id]})),className:"flex items-center justify-between w-full text-[11px] text-[var(--text-dim)] hover:text-[rgb(var(--rgb-fg))] px-1 py-0.5",children:[r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{"aria-hidden":!0,className:`inline-block transition-transform ${y?"-rotate-90":"rotate-0"}`,children:"▾"}),h.label]}),r.jsx("span",{children:h.rows.length})]}),!y&&r.jsx("ul",{className:"flex flex-col gap-1 text-sm",children:h.rows.map(c=>{const j=c.busyReason==="manual_self",w=t.has(c.udid),m=!!c.busy&&!j&&!w||!!c.offline,b=c.offline?"Offline":Pe(c.busyReason),T=!m;return r.jsx("li",{children:r.jsxs("button",{type:"button",disabled:m,draggable:!m,onDragStart:s=>{s.dataTransfer.effectAllowed="copy",s.dataTransfer.setData("application/x-xenon-udid",c.udid),s.dataTransfer.setData("text/plain",c.udid)},onClick:()=>n(c.udid),className:`w-full flex items-center gap-2 px-2 py-1.5 rounded text-left border transition-colors ${m?"opacity-60 cursor-not-allowed border-transparent":w?"border-[rgb(var(--rgb-accent)/0.4)] bg-[rgb(var(--rgb-accent)/0.05)] hover:bg-[rgb(var(--rgb-accent)/0.1)]":"border-transparent hover:border-[var(--border)] hover:bg-[var(--surface-2)]"}`,title:m?`${b} — release first`:w?"Click to remove from mosaic (or drag to a cell)":"Click to add to mosaic (or drag to a cell)",children:[r.jsx("span",{"aria-hidden":!0,className:`inline-flex items-center justify-center w-4 h-4 text-xs ${w?"text-[var(--color-accent-soft)]":"text-[var(--text-dim)]"}`,children:w?"●":"○"}),r.jsx("span",{"aria-hidden":!0,className:`inline-block w-1.5 h-1.5 rounded-full ${c.offline?"bg-zinc-600":T?"bg-[var(--color-success)]":"bg-yellow-500"}`}),r.jsx("span",{className:"font-medium flex-1 truncate text-[13px]",children:c.name??c.udid}),c.platform&&r.jsx("span",{className:"text-[11px] px-1.5 py-0.5 rounded bg-[var(--surface-2)] text-[var(--text-dim)]",children:Oe(c.platform)})]})},c.udid)})})]},h.id)}),o&&v.length===0&&r.jsxs("div",{className:"text-xs text-[var(--text-dim)] px-1 py-2",children:['No devices match "',o,'".']}),r.jsxs("div",{className:"text-[10px] text-[var(--text-dim)] px-1 pt-2 flex items-center gap-3",children:[r.jsxs("span",{className:"inline-flex items-center gap-1",children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--color-success)] inline-block"})," available"]}),r.jsxs("span",{className:"inline-flex items-center gap-1",children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-yellow-500 inline-block"})," in use"]}),r.jsxs("span",{className:"inline-flex items-center gap-1",children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-zinc-600 inline-block"})," offline"]})]})]})}const Be=[{id:"1",label:"1",icon:r.jsx(Ye,{})},{id:"2x1",label:"2×1",icon:r.jsx(We,{})},{id:"2x2",label:"2×2",icon:r.jsx(Fe,{})},{id:"3x2",label:"3×2",icon:r.jsx(Xe,{})},{id:"auto",label:"Auto",icon:r.jsx(Ve,{})}];function Ue({value:e,onChange:t}){return r.jsx("div",{role:"tablist",className:"inline-flex border border-[var(--border)] rounded-md overflow-hidden text-xs bg-[rgb(var(--rgb-white)/0.02)]",children:Be.map(n=>{const o=e===n.id;return r.jsxs("button",{role:"tab","aria-selected":o,onClick:()=>t(n.id),className:`flex items-center gap-1.5 px-2.5 py-1.5 border-r border-[var(--border)] last:border-r-0 transition-colors ${o?"bg-[var(--surface-2)] text-[rgb(var(--rgb-fg))]":"text-[var(--text-dim)] hover:bg-[var(--surface-2)] hover:text-[rgb(var(--rgb-fg))]"}`,title:`Layout: ${n.label}`,children:[r.jsx("span",{className:"w-3.5 h-3.5 inline-flex items-center justify-center",children:n.icon}),r.jsx("span",{children:n.label})]},n.id)})})}function P(e){return r.jsx("rect",{rx:1.2,ry:1.2,fill:"currentColor",...e})}function Ye(){return r.jsx("svg",{viewBox:"0 0 14 14",className:"w-3.5 h-3.5",children:P({x:2,y:2,width:10,height:10})})}function We(){return r.jsxs("svg",{viewBox:"0 0 14 14",className:"w-3.5 h-3.5",children:[P({x:1.5,y:3,width:5,height:8}),P({x:7.5,y:3,width:5,height:8})]})}function Fe(){return r.jsxs("svg",{viewBox:"0 0 14 14",className:"w-3.5 h-3.5",children:[P({x:1.5,y:1.5,width:5,height:5}),P({x:7.5,y:1.5,width:5,height:5}),P({x:1.5,y:7.5,width:5,height:5}),P({x:7.5,y:7.5,width:5,height:5})]})}function Xe(){return r.jsxs("svg",{viewBox:"0 0 14 14",className:"w-3.5 h-3.5",children:[P({x:1,y:1.5,width:3.3,height:5}),P({x:5.35,y:1.5,width:3.3,height:5}),P({x:9.7,y:1.5,width:3.3,height:5}),P({x:1,y:7.5,width:3.3,height:5}),P({x:5.35,y:7.5,width:3.3,height:5}),P({x:9.7,y:7.5,width:3.3,height:5})]})}function Ve(){return r.jsxs("svg",{viewBox:"0 0 14 14",className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",children:[r.jsx("rect",{x:"2",y:"2",width:"10",height:"10",rx:"1.5"}),r.jsx("circle",{cx:"7",cy:"7",r:"1.5",fill:"currentColor",stroke:"none"})]})}function ne(e,t){const n=(e||"#ff3333").trim();if(/^#[0-9a-fA-F]{6}$/.test(n)){const o=parseInt(n.slice(1,3),16),i=parseInt(n.slice(3,5),16),f=parseInt(n.slice(5,7),16);return`rgba(${o},${i},${f},${t})`}return n}function oe(e,t,n,o){const i=o.geometry,f=o.color||"#ff3333",g=Math.max(4,Math.round(Math.min(t,n)*.008));if(e.lineCap="round",e.lineJoin="round",o.shape==="CIRCLE"){const c=(i.x??0)*t,j=(i.y??0)*n,w=Math.max(2,(i.w??0)*t),m=Math.max(2,(i.h??0)*n);e.beginPath(),e.ellipse(c,j,w,m,0,0,Math.PI*2),e.fillStyle=ne(f,.22),e.fill(),e.lineWidth=g+2,e.strokeStyle="rgba(0,0,0,0.55)",e.stroke(),e.beginPath(),e.ellipse(c,j,w,m,0,0,Math.PI*2),e.lineWidth=g,e.strokeStyle=f,e.stroke();return}if(o.shape==="ARROW"){const c=(i.x??0)*t,j=(i.y??0)*n,w=c+(i.w??0)*t,m=j+(i.h??0)*n;e.lineWidth=g+2,e.strokeStyle="rgba(0,0,0,0.55)",e.beginPath(),e.moveTo(c,j),e.lineTo(w,m),e.stroke(),e.lineWidth=g,e.strokeStyle=f,e.beginPath(),e.moveTo(c,j),e.lineTo(w,m),e.stroke();const b=Math.atan2(m-j,w-c),T=Math.max(14,g*3);e.fillStyle=f,e.beginPath(),e.moveTo(w,m),e.lineTo(w-T*Math.cos(b-.4),m-T*Math.sin(b-.4)),e.lineTo(w-T*Math.cos(b+.4),m-T*Math.sin(b+.4)),e.closePath(),e.fill();return}if(o.shape==="TEXT"&&o.text){const c=Math.max(16,Math.round(Math.min(t,n)*.035));e.font=`bold ${c}px sans-serif`,e.lineWidth=3,e.strokeStyle="rgba(0,0,0,0.65)",e.strokeText(o.text,(i.x??0)*t,(i.y??0)*n),e.fillStyle=f,e.fillText(o.text,(i.x??0)*t,(i.y??0)*n);return}const S=(i.x??0)*t,v=(i.y??0)*n,h=Math.max(2,(i.w??0)*t),y=Math.max(2,(i.h??0)*n);e.fillStyle=ne(f,.22),e.fillRect(S,v,h,y),e.lineWidth=g+2,e.strokeStyle="rgba(0,0,0,0.55)",e.strokeRect(S,v,h,y),e.lineWidth=g,e.strokeStyle=f,e.strokeRect(S,v,h,y)}function se(e,t,n,o,i){if(o<=0||i<=0)return null;if(e==="CIRCLE"){const h=Math.hypot(n.curX-n.startX,n.curY-n.startY);return h<=4?null:{shape:e,color:t,geometry:{x:n.startX/o,y:n.startY/i,w:h/o,h:h/i}}}if(e==="ARROW"){const h=n.curX-n.startX,y=n.curY-n.startY;return Math.hypot(h,y)<=6?null:{shape:e,color:t,geometry:{x:n.startX/o,y:n.startY/i,w:h/o,h:y/i}}}const f=Math.min(n.startX,n.curX)/o,g=Math.min(n.startY,n.curY)/i,S=Math.abs(n.curX-n.startX)/o,v=Math.abs(n.curY-n.startY)/i;return S<=.005||v<=.005?null:{shape:e,color:t,geometry:{x:f,y:g,w:S,h:v}}}function He({enabled:e,shape:t,color:n,onCommit:o,committed:i,onCommittedChange:f}){const g=u.useRef(null),[S,v]=u.useState(null),[h,y]=u.useState([]),c=i??h,j=u.useRef(c),w=u.useRef(S),m=u.useRef(t),b=u.useRef(n),T=u.useRef(e);j.current=c,w.current=S,m.current=t,b.current=n,T.current=e;const s=u.useCallback(a=>{const p=a(j.current);j.current=p,f?f(p):y(p)},[f]),d=u.useCallback(()=>{const a=g.current;if(!a)return;const p=a.getContext("2d");if(!p)return;p.clearRect(0,0,a.width,a.height);for(const M of j.current)oe(p,a.width,a.height,M);const C=w.current;if(C){const M=se(m.current,b.current,C,a.width,a.height);M&&oe(p,a.width,a.height,M)}},[]);u.useEffect(()=>{const a=g.current;if(!a)return;const p=()=>{const M=Math.max(1,Math.round(a.clientWidth)),B=Math.max(1,Math.round(a.clientHeight));(a.width!==M||a.height!==B)&&(a.width=M,a.height=B),d()};p();const C=new ResizeObserver(p);return C.observe(a),()=>C.disconnect()},[d]),u.useEffect(()=>{d()},[S,c,d]),u.useEffect(()=>{var p;if(e)return;v(null);const a=g.current;if(a&&a.hasPointerCapture)try{for(let C=0;C<8;C++)(p=a.hasPointerCapture)!=null&&p.call(a,C)&&a.releasePointerCapture(C)}catch{}},[e]);const E=a=>{const C=g.current.getBoundingClientRect();return{px:a.clientX-C.left,py:a.clientY-C.top,w:C.width,h:C.height}},I=a=>{const p=w.current;if(!p||!T.current){v(null);return}const C=g.current;if(!C||C.width<=0){v(null);return}const M=E(a),B=se(m.current,b.current,{...p,curX:M.px,curY:M.py},M.w,M.h);B&&(s(U=>[...U,B]),o(B)),v(null)},A=a=>{if(!e||a.button!==0)return;a.preventDefault(),a.currentTarget.setPointerCapture(a.pointerId);const p=E(a);v({startX:p.px,startY:p.py,curX:p.px,curY:p.py})},R=a=>{if(!w.current)return;const p=E(a);v(C=>C&&{...C,curX:p.px,curY:p.py})},x=a=>{try{a.currentTarget.releasePointerCapture(a.pointerId)}catch{}I(a)};return r.jsx("canvas",{ref:g,style:{position:"absolute",inset:0,pointerEvents:e?"auto":"none",cursor:e?"crosshair":"default",zIndex:e?40:25},onPointerDown:A,onPointerMove:R,onPointerUp:x,onPointerCancel:x})}const Ge=3,Ke=45e3,ie=[2e3,5e3,1e4];function ze(e){const t=Math.max(0,Math.min(e,ie.length-1));return ie[t]}function Je(e){return e<Ge}function ae(e){const t=(e.lastError||"").toLowerCase();return/did not find test app|not installed|webdriveragentrunner|applicationverification/.test(t)?"WebDriverAgent is not installed on this device. Install and trust WDA, then retry.":/unsupported ios version|manualpairingtunnelstart/.test(t)?"This device’s iOS version is not supported for live streaming on this host.":/econnrefused|econnreset|connection reset|tunnel/.test(t)?"Lost the connection to the device tunnel. Reconnect the device, then retry.":e.lastError&&e.lastError.trim()?e.lastError.trim():"We couldn’t start the live stream for this device."}function qe(e){for(let t=0;t+4<e.length;t++){const n=e[t]===0&&e[t+1]===0&&e[t+2]===0&&e[t+3]===1,o=e[t]===0&&e[t+1]===0&&e[t+2]===1;if(!n&&!o)continue;const i=t+(n?4:3);if((e[i]&31)===7){const f=g=>g.toString(16).padStart(2,"0");return`avc1.${f(e[i+1])}${f(e[i+2])}${f(e[i+3])}`}}return"avc1.42e01e"}const Ze=({wsUrl:e,onFatal:t,onReady:n,className:o})=>{const i=u.useRef(null),f=u.useRef(t);f.current=t;const g=u.useRef(n);return g.current=n,u.useEffect(()=>{var T;const S=window,v=i.current;if(typeof S.VideoDecoder>"u"||!v){(T=f.current)==null||T.call(f);return}const h=v.getContext("2d");let y=!1,c=!1,j=!0,w=0;const m=new S.VideoDecoder({output:s=>{var d;if(y){s.close();return}v.width!==s.displayWidth&&(v.width=s.displayWidth,v.height=s.displayHeight),h==null||h.drawImage(s,0,0),s.close(),j&&(j=!1,(d=g.current)==null||d.call(g))},error:()=>{var s;return(s=f.current)==null?void 0:s.call(f)}}),b=new WebSocket(e);return b.binaryType="arraybuffer",b.onerror=()=>{var s;return(s=f.current)==null?void 0:s.call(f)},b.onclose=()=>{var s;y||(s=f.current)==null||s.call(f)},b.onmessage=s=>{var A;const d=s.data,E=new DataView(d).getUint8(0),I=new Uint8Array(d,1);if(E===0){if(c)return;try{m.configure({codec:qe(I),optimizeForLatency:!0}),c=!0}catch{(A=f.current)==null||A.call(f)}return}if(!(!c||m.state!=="configured"))try{m.decode(new S.EncodedVideoChunk({type:E===1?"key":"delta",timestamp:w,data:I})),w+=11111}catch{}},()=>{y=!0;try{b.close()}catch{}try{m.state!=="closed"&&m.close()}catch{}}},[e]),r.jsx("canvas",{ref:i,className:o,style:{width:"100%",height:"100%",objectFit:"contain",display:"block"}})};function Qe(e,t,n){return(e==="android"||e==="androidtv"||e==="android-tv")&&t==="h264"&&n?"h264":"mjpeg"}const et=10,tt=500;function rt({udid:e,name:t,recordingId:n,annotateMode:o,shape:i,color:f,aspect:g="9 / 16",screenWidth:S,screenHeight:v,platform:h,onAnnotation:y,overlayAnnotations:c,onOverlayAnnotationsChange:j,onRemove:w}){const[m,b]=u.useState("connecting"),[T,s]=u.useState(0),[d,E]=u.useState(null),I=u.useRef(0),A=u.useRef(null),[R,x]=u.useState(""),[a,p]=u.useState([]),[C,M]=u.useState(!1),B=u.useRef(null),U=u.useRef(null),W=h==="android"||h==="androidtv"||h==="android-tv",he=h==="ios"||h==="tvos";u.useEffect(()=>{let l=!1;if(n){E(null),b("connecting"),s(Date.now()),D.startStream(e).catch(()=>{});return}const N=typeof window.VideoDecoder<"u";return(async()=>{try{const _=encodeURIComponent(e),O=await fetch(`/xenon/api/control/${_}/stream/status`);if(!O.ok)return;const k=await O.json();if(Qe(h||"",k==null?void 0:k.type,N)!=="h264"||!(k!=null&&k.h264Path))return;const L=await fetch(`/xenon/api/control/${_}/stream/ticket`,{method:"POST"});if(!L.ok)return;const{ticket:$}=await L.json();if(l||!$)return;const H=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}${k.h264Path}?ticket=${encodeURIComponent($)}`;E(H)}catch{}})(),()=>{l=!0}},[e,h,n]);const V=!o&&!!S&&!!v,Q=(l,N,_)=>{const O=S,k=v,L=Math.min(1,Math.max(0,(l-_.left)/_.width)),$=Math.min(1,Math.max(0,(N-_.top)/_.height));return{x:Math.round(L*O),y:Math.round($*k)}},pe=(l,N,_)=>{const O=Date.now()+Math.random(),k=l-_.left,L=N-_.top;p($=>[...$,{id:O,x:k,y:L}]),window.setTimeout(()=>{p($=>$.filter(X=>X.id!==O))},500)},me=l=>{if(!V||m==="unavailable"||l.button!==0)return;const N=l.currentTarget;N.setPointerCapture(l.pointerId),U.current={startX:l.clientX,startY:l.clientY,startTime:Date.now(),rect:N.getBoundingClientRect()},pe(l.clientX,l.clientY,U.current.rect),N.focus()},ge=async l=>{var H,te;const N=U.current;if(U.current=null,!N||!V)return;try{l.currentTarget.releasePointerCapture(l.pointerId)}catch{}const _=l.clientX-N.startX,O=l.clientY-N.startY,k=Math.hypot(_,O),L=Date.now()-N.startTime,$=Q(N.startX,N.startY,N.rect),X=k<et;try{if(X&&L<tt)await D.tap(e,$.x,$.y);else if(X)await((te=(H=D).touchAndHold)==null?void 0:te.call(H,e,$.x,$.y,L));else{const G=Q(l.clientX,l.clientY,N.rect);await D.swipe(e,$.x,$.y,G.x,G.y)}}catch(G){console.error(`[DeviceTile] gesture failed for ${e}`,G)}},be=()=>{U.current=null},xe=async l=>{if(!V||m==="unavailable"||l.metaKey||l.ctrlKey||l.altKey)return;const N=l.key;try{if(N.length===1){l.preventDefault(),await D.typeText(e,N);return}if(N==="Backspace"){l.preventDefault(),W?await D.pressKey(e,67):await D.typeText(e,"\b");return}if(N==="Enter"){l.preventDefault(),W?await D.pressKey(e,66):await D.typeText(e,`
1
+ import{r as u,j as r,X as D,T as Se,W as je}from"./index-C9oFTvnK.js";import{p as Te}from"./labels-C21SA4JG.js";import{A as K,I as Ce}from"./keycodes-bIEJfQzr.js";import{a as Ae}from"./page-header-CFA0PGbZ.js";function Ie(e,t){return e!=="auto"?e:t<=1?"1":t===2?"2x1":t<=4?"2x2":"3x2"}const ke={selected:new Set,layout:"2x2",tiles:[],groupId:null,compositeEnabled:!1,downloadableVideoCount:0,recordingPhase:"idle",recording:!1,startedAt:null,annotateMode:!1,shape:"RECT",color:"#ff3333",overlayAnnotations:{},errorBanner:null,banner:null};function De(e,t){var n;switch(t.type){case"SET_LAYOUT":return{...e,layout:t.layout};case"TOGGLE_SELECTED":{const o=new Set(e.selected);return o.has(t.udid)?o.delete(t.udid):o.add(t.udid),{...e,selected:o}}case"CLEAR_SELECTED":return{...e,selected:new Set};case"SET_TILES":return{...e,tiles:t.tiles};case"ADD_TILE":return e.tiles.some(o=>o.udid===t.tile.udid)?e:{...e,tiles:[...e.tiles,t.tile]};case"PATCH_TILE_DIMS":{let o=!1;const i=e.tiles.map(f=>f.udid!==t.udid||f.screenWidth&&f.screenHeight?f:(o=!0,{...f,screenWidth:t.screenWidth,screenHeight:t.screenHeight,aspect:f.aspect??t.aspect}));return o?{...e,tiles:i}:e}case"REMOVE_TILE":return e.recordingPhase!=="idle"?e:{...e,tiles:e.tiles.filter(o=>o.udid!==t.udid)};case"BIND_RECORDING_IDS":{const o=e.tiles.map(i=>({...i,recordingId:t.map[i.udid]??i.recordingId}));return{...e,tiles:o}}case"SET_RECORDING_PHASE":{const o=t.phase;return{...e,recordingPhase:o,recording:o==="recording"||o==="stopping"}}case"START_RECORDING":{const o=e.tiles.map(i=>({...i,recordingId:t.tileIds[i.udid]??i.recordingId}));return{...e,groupId:t.groupId,compositeEnabled:t.compositeEnabled===!0,downloadableVideoCount:0,recordingPhase:"recording",recording:!0,annotateMode:!0,startedAt:t.startedAt,overlayAnnotations:{},tiles:o}}case"STOP_RECORDING":{const o=e.tiles.map(i=>({...i,recordingId:void 0}));return{...e,recording:!1,recordingPhase:"idle",annotateMode:!1,overlayAnnotations:{},downloadableVideoCount:t.downloadableVideoCount??e.downloadableVideoCount,compositeEnabled:t.compositeEnabled!==void 0?t.compositeEnabled:e.compositeEnabled,tiles:o}}case"SET_ANNOTATE_MODE":return{...e,annotateMode:t.enabled};case"SET_SHAPE":return{...e,shape:t.shape};case"SET_COLOR":return{...e,color:t.color};case"SET_OVERLAY_ANNOTATIONS":return{...e,overlayAnnotations:{...e.overlayAnnotations,[t.recordingId]:t.annotations}};case"CLEAR_OVERLAY_ANNOTATIONS":return{...e,overlayAnnotations:{}};case"SET_ERROR_BANNER":return{...e,errorBanner:t.message,banner:t.message?{tone:"error",message:t.message}:null};case"SET_BANNER":return{...e,banner:t.banner,errorBanner:((n=t.banner)==null?void 0:n.tone)==="error"?t.banner.message:null};default:return e}}const le=u.createContext(null);function _e(){const e=u.useContext(le);if(!e)throw new Error("useMosaic must be used inside <MosaicContext.Provider>");return e}function Me(){return u.useReducer(De,ke)}function $e(e){const t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/3600),o=Math.floor(t%3600/60),i=t%60;return n>0?`${n}:${String(o).padStart(2,"0")}:${String(i).padStart(2,"0")}`:`${o}:${String(i).padStart(2,"0")}`}function Pe(e){switch(e){case"automation":return"In automation";case"manual_other":return"Manual control by another user";case"manual_self":return"In your mosaic";case"recording_other_group":return"Recording in another group";default:return e?"Busy":null}}const re=[{id:"ios",label:"iOS",match:e=>e==="ios"},{id:"android",label:"Android",match:e=>e==="android"},{id:"tvos",label:"tvOS",match:e=>e==="tvos"},{id:"androidtv",label:"Android TV",match:e=>e==="androidtv"||e==="android-tv"},{id:"other",label:"Other",match:()=>!0}];function Oe(e){return Te(e)}function Le({devices:e,inMosaic:t,onToggle:n}){const[o,i]=u.useState(""),[f,g]=u.useState({}),S=u.useMemo(()=>{const h=o.trim().toLowerCase();return h?e.filter(y=>y.udid.toLowerCase().includes(h)||(y.name??"").toLowerCase().includes(h)||(y.platform??"").toLowerCase().includes(h)):e},[e,o]),v=u.useMemo(()=>{const h=re.map(c=>({id:c.id,label:c.label,rows:[]})),y=c=>h.find((j,w)=>re[w].match(c))??h[h.length-1];for(const c of S)y((c.platform??"").toLowerCase()).rows.push(c);return h.filter(c=>c.rows.length>0)},[S]);return e.length===0?r.jsx("div",{className:"text-xs text-[var(--text-dim)] p-3",children:"No devices online."}):r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsxs("div",{className:"relative",children:[r.jsx("span",{"aria-hidden":!0,className:"absolute left-2 top-1/2 -translate-y-1/2 text-[var(--text-dim)] text-xs",children:"⌕"}),r.jsx("input",{type:"text",value:o,placeholder:"Filter devices...",onChange:h=>i(h.target.value),className:"w-full pl-7 pr-2 py-1.5 text-xs rounded border border-[var(--border)] bg-transparent placeholder:text-[var(--text-dim)] focus:outline-none focus:border-[var(--color-info)]"})]}),v.map(h=>{const y=f[h.id];return r.jsxs("section",{className:"flex flex-col gap-1",children:[r.jsxs("button",{type:"button",onClick:()=>g(c=>({...c,[h.id]:!c[h.id]})),className:"flex items-center justify-between w-full text-[11px] text-[var(--text-dim)] hover:text-[rgb(var(--rgb-fg))] px-1 py-0.5",children:[r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{"aria-hidden":!0,className:`inline-block transition-transform ${y?"-rotate-90":"rotate-0"}`,children:"▾"}),h.label]}),r.jsx("span",{children:h.rows.length})]}),!y&&r.jsx("ul",{className:"flex flex-col gap-1 text-sm",children:h.rows.map(c=>{const j=c.busyReason==="manual_self",w=t.has(c.udid),m=!!c.busy&&!j&&!w||!!c.offline,b=c.offline?"Offline":Pe(c.busyReason),T=!m;return r.jsx("li",{children:r.jsxs("button",{type:"button",disabled:m,draggable:!m,onDragStart:s=>{s.dataTransfer.effectAllowed="copy",s.dataTransfer.setData("application/x-xenon-udid",c.udid),s.dataTransfer.setData("text/plain",c.udid)},onClick:()=>n(c.udid),className:`w-full flex items-center gap-2 px-2 py-1.5 rounded text-left border transition-colors ${m?"opacity-60 cursor-not-allowed border-transparent":w?"border-[rgb(var(--rgb-accent)/0.4)] bg-[rgb(var(--rgb-accent)/0.05)] hover:bg-[rgb(var(--rgb-accent)/0.1)]":"border-transparent hover:border-[var(--border)] hover:bg-[var(--surface-2)]"}`,title:m?`${b} — release first`:w?"Click to remove from mosaic (or drag to a cell)":"Click to add to mosaic (or drag to a cell)",children:[r.jsx("span",{"aria-hidden":!0,className:`inline-flex items-center justify-center w-4 h-4 text-xs ${w?"text-[var(--color-accent-soft)]":"text-[var(--text-dim)]"}`,children:w?"●":"○"}),r.jsx("span",{"aria-hidden":!0,className:`inline-block w-1.5 h-1.5 rounded-full ${c.offline?"bg-zinc-600":T?"bg-[var(--color-success)]":"bg-yellow-500"}`}),r.jsx("span",{className:"font-medium flex-1 truncate text-[13px]",children:c.name??c.udid}),c.platform&&r.jsx("span",{className:"text-[11px] px-1.5 py-0.5 rounded bg-[var(--surface-2)] text-[var(--text-dim)]",children:Oe(c.platform)})]})},c.udid)})})]},h.id)}),o&&v.length===0&&r.jsxs("div",{className:"text-xs text-[var(--text-dim)] px-1 py-2",children:['No devices match "',o,'".']}),r.jsxs("div",{className:"text-[10px] text-[var(--text-dim)] px-1 pt-2 flex items-center gap-3",children:[r.jsxs("span",{className:"inline-flex items-center gap-1",children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--color-success)] inline-block"})," available"]}),r.jsxs("span",{className:"inline-flex items-center gap-1",children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-yellow-500 inline-block"})," in use"]}),r.jsxs("span",{className:"inline-flex items-center gap-1",children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-zinc-600 inline-block"})," offline"]})]})]})}const Be=[{id:"1",label:"1",icon:r.jsx(Ye,{})},{id:"2x1",label:"2×1",icon:r.jsx(We,{})},{id:"2x2",label:"2×2",icon:r.jsx(Fe,{})},{id:"3x2",label:"3×2",icon:r.jsx(Xe,{})},{id:"auto",label:"Auto",icon:r.jsx(Ve,{})}];function Ue({value:e,onChange:t}){return r.jsx("div",{role:"tablist",className:"inline-flex border border-[var(--border)] rounded-md overflow-hidden text-xs bg-[rgb(var(--rgb-white)/0.02)]",children:Be.map(n=>{const o=e===n.id;return r.jsxs("button",{role:"tab","aria-selected":o,onClick:()=>t(n.id),className:`flex items-center gap-1.5 px-2.5 py-1.5 border-r border-[var(--border)] last:border-r-0 transition-colors ${o?"bg-[var(--surface-2)] text-[rgb(var(--rgb-fg))]":"text-[var(--text-dim)] hover:bg-[var(--surface-2)] hover:text-[rgb(var(--rgb-fg))]"}`,title:`Layout: ${n.label}`,children:[r.jsx("span",{className:"w-3.5 h-3.5 inline-flex items-center justify-center",children:n.icon}),r.jsx("span",{children:n.label})]},n.id)})})}function P(e){return r.jsx("rect",{rx:1.2,ry:1.2,fill:"currentColor",...e})}function Ye(){return r.jsx("svg",{viewBox:"0 0 14 14",className:"w-3.5 h-3.5",children:P({x:2,y:2,width:10,height:10})})}function We(){return r.jsxs("svg",{viewBox:"0 0 14 14",className:"w-3.5 h-3.5",children:[P({x:1.5,y:3,width:5,height:8}),P({x:7.5,y:3,width:5,height:8})]})}function Fe(){return r.jsxs("svg",{viewBox:"0 0 14 14",className:"w-3.5 h-3.5",children:[P({x:1.5,y:1.5,width:5,height:5}),P({x:7.5,y:1.5,width:5,height:5}),P({x:1.5,y:7.5,width:5,height:5}),P({x:7.5,y:7.5,width:5,height:5})]})}function Xe(){return r.jsxs("svg",{viewBox:"0 0 14 14",className:"w-3.5 h-3.5",children:[P({x:1,y:1.5,width:3.3,height:5}),P({x:5.35,y:1.5,width:3.3,height:5}),P({x:9.7,y:1.5,width:3.3,height:5}),P({x:1,y:7.5,width:3.3,height:5}),P({x:5.35,y:7.5,width:3.3,height:5}),P({x:9.7,y:7.5,width:3.3,height:5})]})}function Ve(){return r.jsxs("svg",{viewBox:"0 0 14 14",className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",children:[r.jsx("rect",{x:"2",y:"2",width:"10",height:"10",rx:"1.5"}),r.jsx("circle",{cx:"7",cy:"7",r:"1.5",fill:"currentColor",stroke:"none"})]})}function ne(e,t){const n=(e||"#ff3333").trim();if(/^#[0-9a-fA-F]{6}$/.test(n)){const o=parseInt(n.slice(1,3),16),i=parseInt(n.slice(3,5),16),f=parseInt(n.slice(5,7),16);return`rgba(${o},${i},${f},${t})`}return n}function oe(e,t,n,o){const i=o.geometry,f=o.color||"#ff3333",g=Math.max(4,Math.round(Math.min(t,n)*.008));if(e.lineCap="round",e.lineJoin="round",o.shape==="CIRCLE"){const c=(i.x??0)*t,j=(i.y??0)*n,w=Math.max(2,(i.w??0)*t),m=Math.max(2,(i.h??0)*n);e.beginPath(),e.ellipse(c,j,w,m,0,0,Math.PI*2),e.fillStyle=ne(f,.22),e.fill(),e.lineWidth=g+2,e.strokeStyle="rgba(0,0,0,0.55)",e.stroke(),e.beginPath(),e.ellipse(c,j,w,m,0,0,Math.PI*2),e.lineWidth=g,e.strokeStyle=f,e.stroke();return}if(o.shape==="ARROW"){const c=(i.x??0)*t,j=(i.y??0)*n,w=c+(i.w??0)*t,m=j+(i.h??0)*n;e.lineWidth=g+2,e.strokeStyle="rgba(0,0,0,0.55)",e.beginPath(),e.moveTo(c,j),e.lineTo(w,m),e.stroke(),e.lineWidth=g,e.strokeStyle=f,e.beginPath(),e.moveTo(c,j),e.lineTo(w,m),e.stroke();const b=Math.atan2(m-j,w-c),T=Math.max(14,g*3);e.fillStyle=f,e.beginPath(),e.moveTo(w,m),e.lineTo(w-T*Math.cos(b-.4),m-T*Math.sin(b-.4)),e.lineTo(w-T*Math.cos(b+.4),m-T*Math.sin(b+.4)),e.closePath(),e.fill();return}if(o.shape==="TEXT"&&o.text){const c=Math.max(16,Math.round(Math.min(t,n)*.035));e.font=`bold ${c}px sans-serif`,e.lineWidth=3,e.strokeStyle="rgba(0,0,0,0.65)",e.strokeText(o.text,(i.x??0)*t,(i.y??0)*n),e.fillStyle=f,e.fillText(o.text,(i.x??0)*t,(i.y??0)*n);return}const S=(i.x??0)*t,v=(i.y??0)*n,h=Math.max(2,(i.w??0)*t),y=Math.max(2,(i.h??0)*n);e.fillStyle=ne(f,.22),e.fillRect(S,v,h,y),e.lineWidth=g+2,e.strokeStyle="rgba(0,0,0,0.55)",e.strokeRect(S,v,h,y),e.lineWidth=g,e.strokeStyle=f,e.strokeRect(S,v,h,y)}function se(e,t,n,o,i){if(o<=0||i<=0)return null;if(e==="CIRCLE"){const h=Math.hypot(n.curX-n.startX,n.curY-n.startY);return h<=4?null:{shape:e,color:t,geometry:{x:n.startX/o,y:n.startY/i,w:h/o,h:h/i}}}if(e==="ARROW"){const h=n.curX-n.startX,y=n.curY-n.startY;return Math.hypot(h,y)<=6?null:{shape:e,color:t,geometry:{x:n.startX/o,y:n.startY/i,w:h/o,h:y/i}}}const f=Math.min(n.startX,n.curX)/o,g=Math.min(n.startY,n.curY)/i,S=Math.abs(n.curX-n.startX)/o,v=Math.abs(n.curY-n.startY)/i;return S<=.005||v<=.005?null:{shape:e,color:t,geometry:{x:f,y:g,w:S,h:v}}}function He({enabled:e,shape:t,color:n,onCommit:o,committed:i,onCommittedChange:f}){const g=u.useRef(null),[S,v]=u.useState(null),[h,y]=u.useState([]),c=i??h,j=u.useRef(c),w=u.useRef(S),m=u.useRef(t),b=u.useRef(n),T=u.useRef(e);j.current=c,w.current=S,m.current=t,b.current=n,T.current=e;const s=u.useCallback(a=>{const p=a(j.current);j.current=p,f?f(p):y(p)},[f]),d=u.useCallback(()=>{const a=g.current;if(!a)return;const p=a.getContext("2d");if(!p)return;p.clearRect(0,0,a.width,a.height);for(const M of j.current)oe(p,a.width,a.height,M);const C=w.current;if(C){const M=se(m.current,b.current,C,a.width,a.height);M&&oe(p,a.width,a.height,M)}},[]);u.useEffect(()=>{const a=g.current;if(!a)return;const p=()=>{const M=Math.max(1,Math.round(a.clientWidth)),B=Math.max(1,Math.round(a.clientHeight));(a.width!==M||a.height!==B)&&(a.width=M,a.height=B),d()};p();const C=new ResizeObserver(p);return C.observe(a),()=>C.disconnect()},[d]),u.useEffect(()=>{d()},[S,c,d]),u.useEffect(()=>{var p;if(e)return;v(null);const a=g.current;if(a&&a.hasPointerCapture)try{for(let C=0;C<8;C++)(p=a.hasPointerCapture)!=null&&p.call(a,C)&&a.releasePointerCapture(C)}catch{}},[e]);const E=a=>{const C=g.current.getBoundingClientRect();return{px:a.clientX-C.left,py:a.clientY-C.top,w:C.width,h:C.height}},I=a=>{const p=w.current;if(!p||!T.current){v(null);return}const C=g.current;if(!C||C.width<=0){v(null);return}const M=E(a),B=se(m.current,b.current,{...p,curX:M.px,curY:M.py},M.w,M.h);B&&(s(U=>[...U,B]),o(B)),v(null)},A=a=>{if(!e||a.button!==0)return;a.preventDefault(),a.currentTarget.setPointerCapture(a.pointerId);const p=E(a);v({startX:p.px,startY:p.py,curX:p.px,curY:p.py})},R=a=>{if(!w.current)return;const p=E(a);v(C=>C&&{...C,curX:p.px,curY:p.py})},x=a=>{try{a.currentTarget.releasePointerCapture(a.pointerId)}catch{}I(a)};return r.jsx("canvas",{ref:g,style:{position:"absolute",inset:0,pointerEvents:e?"auto":"none",cursor:e?"crosshair":"default",zIndex:e?40:25},onPointerDown:A,onPointerMove:R,onPointerUp:x,onPointerCancel:x})}const Ge=3,Ke=45e3,ie=[2e3,5e3,1e4];function ze(e){const t=Math.max(0,Math.min(e,ie.length-1));return ie[t]}function Je(e){return e<Ge}function ae(e){const t=(e.lastError||"").toLowerCase();return/did not find test app|not installed|webdriveragentrunner|applicationverification/.test(t)?"WebDriverAgent is not installed on this device. Install and trust WDA, then retry.":/unsupported ios version|manualpairingtunnelstart/.test(t)?"This device’s iOS version is not supported for live streaming on this host.":/econnrefused|econnreset|connection reset|tunnel/.test(t)?"Lost the connection to the device tunnel. Reconnect the device, then retry.":e.lastError&&e.lastError.trim()?e.lastError.trim():"We couldn’t start the live stream for this device."}function qe(e){for(let t=0;t+4<e.length;t++){const n=e[t]===0&&e[t+1]===0&&e[t+2]===0&&e[t+3]===1,o=e[t]===0&&e[t+1]===0&&e[t+2]===1;if(!n&&!o)continue;const i=t+(n?4:3);if((e[i]&31)===7){const f=g=>g.toString(16).padStart(2,"0");return`avc1.${f(e[i+1])}${f(e[i+2])}${f(e[i+3])}`}}return"avc1.42e01e"}const Ze=({wsUrl:e,onFatal:t,onReady:n,className:o})=>{const i=u.useRef(null),f=u.useRef(t);f.current=t;const g=u.useRef(n);return g.current=n,u.useEffect(()=>{var T;const S=window,v=i.current;if(typeof S.VideoDecoder>"u"||!v){(T=f.current)==null||T.call(f);return}const h=v.getContext("2d");let y=!1,c=!1,j=!0,w=0;const m=new S.VideoDecoder({output:s=>{var d;if(y){s.close();return}v.width!==s.displayWidth&&(v.width=s.displayWidth,v.height=s.displayHeight),h==null||h.drawImage(s,0,0),s.close(),j&&(j=!1,(d=g.current)==null||d.call(g))},error:()=>{var s;return(s=f.current)==null?void 0:s.call(f)}}),b=new WebSocket(e);return b.binaryType="arraybuffer",b.onerror=()=>{var s;return(s=f.current)==null?void 0:s.call(f)},b.onclose=()=>{var s;y||(s=f.current)==null||s.call(f)},b.onmessage=s=>{var A;const d=s.data,E=new DataView(d).getUint8(0),I=new Uint8Array(d,1);if(E===0){if(c)return;try{m.configure({codec:qe(I),optimizeForLatency:!0}),c=!0}catch{(A=f.current)==null||A.call(f)}return}if(!(!c||m.state!=="configured"))try{m.decode(new S.EncodedVideoChunk({type:E===1?"key":"delta",timestamp:w,data:I})),w+=11111}catch{}},()=>{y=!0;try{b.close()}catch{}try{m.state!=="closed"&&m.close()}catch{}}},[e]),r.jsx("canvas",{ref:i,className:o,style:{width:"100%",height:"100%",objectFit:"contain",display:"block"}})};function Qe(e,t,n){return(e==="android"||e==="androidtv"||e==="android-tv")&&t==="h264"&&n?"h264":"mjpeg"}const et=10,tt=500;function rt({udid:e,name:t,recordingId:n,annotateMode:o,shape:i,color:f,aspect:g="9 / 16",screenWidth:S,screenHeight:v,platform:h,onAnnotation:y,overlayAnnotations:c,onOverlayAnnotationsChange:j,onRemove:w}){const[m,b]=u.useState("connecting"),[T,s]=u.useState(0),[d,E]=u.useState(null),I=u.useRef(0),A=u.useRef(null),[R,x]=u.useState(""),[a,p]=u.useState([]),[C,M]=u.useState(!1),B=u.useRef(null),U=u.useRef(null),W=h==="android"||h==="androidtv"||h==="android-tv",he=h==="ios"||h==="tvos";u.useEffect(()=>{let l=!1;if(n){E(null),b("connecting"),s(Date.now()),D.startStream(e).catch(()=>{});return}const N=typeof window.VideoDecoder<"u";return(async()=>{try{const _=encodeURIComponent(e),O=await fetch(`/xenon/api/control/${_}/stream/status`);if(!O.ok)return;const k=await O.json();if(Qe(h||"",k==null?void 0:k.type,N)!=="h264"||!(k!=null&&k.h264Path))return;const L=await fetch(`/xenon/api/control/${_}/stream/ticket`,{method:"POST"});if(!L.ok)return;const{ticket:$}=await L.json();if(l||!$)return;const H=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}${k.h264Path}?ticket=${encodeURIComponent($)}`;E(H)}catch{}})(),()=>{l=!0}},[e,h,n]);const V=!o&&!!S&&!!v,Q=(l,N,_)=>{const O=S,k=v,L=Math.min(1,Math.max(0,(l-_.left)/_.width)),$=Math.min(1,Math.max(0,(N-_.top)/_.height));return{x:Math.round(L*O),y:Math.round($*k)}},pe=(l,N,_)=>{const O=Date.now()+Math.random(),k=l-_.left,L=N-_.top;p($=>[...$,{id:O,x:k,y:L}]),window.setTimeout(()=>{p($=>$.filter(X=>X.id!==O))},500)},me=l=>{if(!V||m==="unavailable"||l.button!==0)return;const N=l.currentTarget;N.setPointerCapture(l.pointerId),U.current={startX:l.clientX,startY:l.clientY,startTime:Date.now(),rect:N.getBoundingClientRect()},pe(l.clientX,l.clientY,U.current.rect),N.focus()},ge=async l=>{var H,te;const N=U.current;if(U.current=null,!N||!V)return;try{l.currentTarget.releasePointerCapture(l.pointerId)}catch{}const _=l.clientX-N.startX,O=l.clientY-N.startY,k=Math.hypot(_,O),L=Date.now()-N.startTime,$=Q(N.startX,N.startY,N.rect),X=k<et;try{if(X&&L<tt)await D.tap(e,$.x,$.y);else if(X)await((te=(H=D).touchAndHold)==null?void 0:te.call(H,e,$.x,$.y,L));else{const G=Q(l.clientX,l.clientY,N.rect);await D.swipe(e,$.x,$.y,G.x,G.y)}}catch(G){console.error(`[DeviceTile] gesture failed for ${e}`,G)}},be=()=>{U.current=null},xe=async l=>{if(!V||m==="unavailable"||l.metaKey||l.ctrlKey||l.altKey)return;const N=l.key;try{if(N.length===1){l.preventDefault(),await D.typeText(e,N);return}if(N==="Backspace"){l.preventDefault(),W?await D.pressKey(e,67):await D.typeText(e,"\b");return}if(N==="Enter"){l.preventDefault(),W?await D.pressKey(e,66):await D.typeText(e,`
2
2
  `);return}if(N==="Tab"){l.preventDefault(),await D.typeText(e," ");return}N==="Escape"&&W&&(l.preventDefault(),await D.pressKey(e,K.BACK))}catch(_){console.error(`[DeviceTile] keystroke "${N}" failed for ${e}`,_)}},ye=()=>D.pressKey(e,W?K.HOME:Ce.HOME).catch(l=>console.error(`[DeviceTile] home failed for ${e}`,l)),ve=()=>D.pressKey(e,K.BACK).catch(l=>console.error(`[DeviceTile] back failed for ${e}`,l)),we=()=>D.pressKey(e,K.APP_SWITCH).catch(l=>console.error(`[DeviceTile] app-switch failed for ${e}`,l)),Ee=async()=>{try{const l=await D.getScreenshot(e),N=(l==null?void 0:l.screenshot)??(l==null?void 0:l.value)??l;if(!N)return;const _=await fetch(`data:image/png;base64,${N}`).then(L=>L.blob()),O=URL.createObjectURL(_),k=document.createElement("a");k.href=O,k.download=`${t||e}-${Date.now()}.png`,document.body.appendChild(k),k.click(),k.remove(),setTimeout(()=>URL.revokeObjectURL(O),1e3)}catch(l){console.error(`[DeviceTile] screenshot failed for ${e}`,l)}};u.useEffect(()=>{console.log(`[DeviceTile] Rendering ${e} in state: ${m}`)},[e,m]);const Ne=`/xenon/api/control/${encodeURIComponent(e)}/stream?t=${T}`,ee=u.useCallback(async()=>{try{const l=await fetch(`/xenon/api/control/${encodeURIComponent(e)}/stream/status`);if(!l.ok)throw new Error(String(l.status));const N=await l.json();x(ae({lastError:N==null?void 0:N.lastError,status:N==null?void 0:N.status}))}catch{x(ae({}))}},[e]),J=u.useCallback(()=>{const l=I.current;Je(l)?(I.current=l+1,A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{b("connecting"),s(Date.now())},ze(l))):(b("unavailable"),ee())},[ee]);u.useEffect(()=>{if(m!=="connecting")return;const l=setTimeout(J,Ke);return()=>clearTimeout(l)},[m,T,J]),u.useEffect(()=>()=>{A.current&&clearTimeout(A.current)},[]);const Re=()=>{A.current&&clearTimeout(A.current),I.current=0,x(""),b("connecting"),s(Date.now())},F=!!n,q=t||e.slice(0,16)+"…";return r.jsxs("div",{className:"flex items-stretch justify-center w-full h-full min-h-0 min-w-0 gap-2",children:[r.jsxs("div",{className:"relative bg-[var(--black)] rounded-lg overflow-hidden border border-[var(--border)] group max-h-full max-w-full self-center",style:{aspectRatio:g,height:"100%"},children:[m==="connecting"&&r.jsxs("div",{className:"flex flex-col items-center justify-center bg-neutral-900/80 text-neutral-400 absolute inset-0 z-20 pointer-events-none",children:[r.jsx("div",{className:"relative flex items-center justify-center",children:r.jsx("div",{className:"w-12 h-12 border-4 border-neutral-800 border-t-neutral-400 rounded-full animate-spin"})}),r.jsx("div",{className:"mt-4 font-bold text-neutral-200",children:"Starting Stream…"}),r.jsx("div",{className:"text-[10px] mt-1 text-neutral-500 opacity-60 font-mono",children:e}),r.jsx("div",{className:"text-[10px] mt-4 text-neutral-400 bg-white/5 px-2 py-1 rounded",children:"Waiting for device connection..."})]}),m==="unavailable"&&r.jsx("div",{className:"flex items-center justify-center bg-black text-neutral-400 absolute inset-0 z-20",children:r.jsxs("div",{className:"text-center p-6",children:[r.jsx("div",{className:"text-5xl mb-4 opacity-20",children:"📵"}),r.jsx("div",{className:"font-bold text-white text-lg",children:"Connection Failed"}),r.jsx("p",{className:"text-xs mt-2 text-neutral-500 leading-relaxed max-w-[240px] mx-auto",children:R||"We couldn’t start the live stream for this device."}),r.jsx("button",{className:"mt-6 text-sm font-semibold px-6 py-2.5 rounded-full bg-red-600 hover:bg-red-500 text-white transition-all active:scale-95",onClick:Re,children:"Retry connection"})]})}),d?r.jsx(Ze,{wsUrl:d,className:"absolute inset-0 w-full h-full object-contain bg-black select-none pointer-events-none",onReady:()=>b("live"),onFatal:()=>{console.warn(`[DeviceTile] H.264 fatal for ${e}; falling back to MJPEG`),E(null),b("connecting"),s(Date.now())}}):r.jsx("img",{src:Ne,alt:q,className:"absolute inset-0 w-full h-full object-contain bg-black select-none pointer-events-none",draggable:!1,style:{opacity:m==="live"?1:0,transition:"opacity 0.3s ease-in-out"},onLoad:()=>{console.log(`[DeviceTile] Image LOADED for ${e}`),I.current=0,A.current&&clearTimeout(A.current),b("live")},onError:l=>{console.error(`[DeviceTile] Image ERROR for ${e}`,l),J()}},T),V&&m!=="unavailable"&&r.jsx("div",{ref:B,className:`absolute inset-0 z-[35] touch-none outline-none ${C?"ring-2 ring-[rgb(var(--rgb-accent)/0.6)] ring-inset rounded-lg":""}`,tabIndex:0,onPointerDown:me,onPointerUp:ge,onPointerCancel:be,onKeyDown:xe,onFocus:()=>M(!0),onBlur:()=>M(!1)}),r.jsx("div",{className:"absolute inset-0 z-20 pointer-events-none overflow-hidden",children:a.map(l=>r.jsx("span",{className:"absolute block w-10 h-10 rounded-full border-2 border-[var(--color-accent-soft)] animate-ping",style:{left:l.x-20,top:l.y-20}},l.id))}),F&&r.jsx(He,{enabled:o,shape:i,color:f,committed:c,onCommittedChange:j,onCommit:l=>y(n,l)}),F&&o&&m==="live"&&r.jsx("div",{className:"absolute bottom-3 left-3 right-3 z-30 pointer-events-none",children:r.jsx("div",{className:"px-2 py-1 rounded bg-black/70 text-[10px] text-amber-100 border border-amber-500/40 text-center",children:"Annotate on — drag on the preview. Shapes stay on screen and appear in Download video from that moment. Toggle Annotate off to tap the device."})}),F&&r.jsx("div",{className:"absolute top-3 left-3 z-30 pointer-events-none",children:r.jsx("span",{className:"px-2 py-0.5 rounded-sm bg-red-600 text-white text-[9px] font-black shadow-lg",children:"REC"})}),r.jsxs("div",{className:"absolute top-3 left-3 z-30 flex flex-col gap-1.5 pointer-events-none opacity-0 group-hover:opacity-100 transition-opacity duration-150",children:[m==="live"&&r.jsx("span",{className:"px-2 py-0.5 rounded-sm bg-[var(--color-success)] text-[var(--color-on-success)] text-[11px] font-semibold shadow-lg w-fit",children:"Live"}),r.jsx("span",{className:"px-2 py-1 rounded bg-black/80 text-white text-[11px] font-medium backdrop-blur-md border border-white/10 shadow-xl truncate max-w-[180px]",children:q})]})]}),r.jsx(nt,{streamState:m,recording:F,isIOS:he,isAndroid:W,platform:h,onClose:!F&&w?()=>w(e):void 0,sendHome:ye,sendBack:ve,sendAppSwitch:we,captureScreenshot:Ee,displayName:q})]})}function nt({streamState:e,recording:t,isIOS:n,isAndroid:o,platform:i,onClose:f,sendHome:g,sendBack:S,sendAppSwitch:v,captureScreenshot:h,displayName:y}){const c=e==="live";return!f&&!c?null:r.jsxs("div",{className:"self-stretch w-9 flex flex-col items-center justify-between gap-1 py-2 rounded-lg bg-black/40 border border-white/10 backdrop-blur-md text-white",children:[r.jsx("div",{className:"flex flex-col items-center gap-1",children:f&&r.jsx("button",{type:"button","aria-label":`Remove ${y} from mosaic`,title:"Remove from mosaic",onClick:f,className:"w-7 h-7 flex items-center justify-center rounded-md hover:bg-red-600/70 transition-colors text-base leading-none",children:"×"})}),c&&r.jsxs("div",{className:"flex flex-col items-center gap-1.5 my-auto",children:[(o||n)&&r.jsx("button",{type:"button",title:`Home${i?` (${i})`:""}`,onClick:g,className:"w-7 h-7 flex items-center justify-center rounded-md hover:bg-white/15 transition-colors text-sm",children:"⌂"}),o&&r.jsx("button",{type:"button",title:"Back",onClick:S,className:"w-7 h-7 flex items-center justify-center rounded-md hover:bg-white/15 transition-colors text-sm",children:"‹"}),o&&r.jsx("button",{type:"button",title:"Recent apps",onClick:v,className:"w-7 h-7 flex items-center justify-center rounded-md hover:bg-white/15 transition-colors text-sm",children:"▢"})]}),c&&r.jsx("div",{className:"flex flex-col items-center gap-1",children:r.jsx("button",{type:"button",title:"Screenshot",onClick:h,className:"w-7 h-7 flex items-center justify-center rounded-md hover:bg-white/15 transition-colors text-sm",children:"⎙"})})]})}const ot={1:"1fr","2x1":"1fr 1fr","2x2":"1fr 1fr","3x2":"1fr 1fr 1fr"},st={1:"1fr","2x1":"1fr","2x2":"1fr 1fr","3x2":"1fr 1fr"},it={1:1,"2x1":2,"2x2":4,"3x2":6};function at({layout:e,tiles:t,annotateMode:n,shape:o,color:i,onAnnotation:f,overlayAnnotationsByRecording:g,onOverlayAnnotationsChange:S,onRemove:v,onDropDevice:h}){const y=Ie(e,t.length),c=it[y];t.length;const j=t.length,w=e==="auto"?Math.max(j,1):c,m=Math.max(0,w-j);return r.jsxs("div",{style:{display:"grid",gap:8,gridTemplateColumns:ot[y],gridTemplateRows:st[y]},className:"h-full",children:[t.map(b=>r.jsx(rt,{udid:b.udid,name:b.name,mjpegPort:b.mjpegPort,recordingId:b.recordingId,aspect:b.aspect,screenWidth:b.screenWidth,screenHeight:b.screenHeight,platform:b.platform,annotateMode:n,shape:o,color:i,overlayAnnotations:b.recordingId?g==null?void 0:g[b.recordingId]:void 0,onOverlayAnnotationsChange:b.recordingId&&S?T=>S(b.recordingId,T):void 0,onAnnotation:f,onRemove:v},b.udid)),Array.from({length:m},(b,T)=>r.jsx(ct,{onDropDevice:h},`empty-${T}`))]})}function ct({onDropDevice:e}){const[t,n]=u.useState(!1);return r.jsxs("div",{onDragOver:o=>{e&&(o.preventDefault(),o.dataTransfer.dropEffect="copy",t||n(!0))},onDragLeave:()=>n(!1),onDrop:o=>{if(n(!1),!e)return;o.preventDefault();const i=o.dataTransfer.getData("application/x-xenon-udid")||o.dataTransfer.getData("text/plain");i&&e(i)},className:`flex flex-col items-center justify-center gap-2 rounded-lg border border-dashed transition-colors ${t?"border-[rgb(var(--rgb-accent)/0.6)] bg-[rgb(var(--rgb-accent)/0.05)]":"border-[var(--border)] bg-[rgb(var(--rgb-white)/0.02)]"} text-[var(--text-dim)] min-h-[120px]`,children:[r.jsx("div",{"aria-hidden":"true",className:`w-8 h-8 rounded-full flex items-center justify-center text-xl ${t?"bg-[rgb(var(--rgb-accent)/0.15)] text-[var(--color-accent-soft)]":"bg-[rgb(var(--rgb-fg)/0.05)] text-[rgb(var(--rgb-fg)/0.6)]"}`,children:"+"}),r.jsx("div",{className:"text-xs font-medium",children:"Drag device here"}),r.jsx("div",{className:"text-[10px] opacity-70",children:"or click one in the panel"})]})}const Y="/xenon/api/recordings";class de extends Error{constructor(t){super(t.message??t.error),this.body=t}}async function z(e,t){const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:t?JSON.stringify(t):void 0});if(n.status===409)throw new de(await n.json());if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.json()}function lt(e,t){return z(Y,{udids:e,...t})}function dt(e){return z(`${Y}/${encodeURIComponent(e)}/stop`)}function ue(e,t,n,o,i){return z(`${Y}/${encodeURIComponent(e)}/bookmark`,{recordingId:t,timecodeMs:n,label:o,note:i})}function ut(e,t){return z(`${Y}/${encodeURIComponent(e)}/annotation`,t)}function ft(e){return`${Y}/${encodeURIComponent(e)}/videos.zip`}function ht(e,t){return`${Y}/${encodeURIComponent(e)}/video.mp4`}function pt(e){return`${Y}/${encodeURIComponent(e)}/composite.mp4`}function mt(e,t){return t==="starting"?"Starting…":e<=0?"Record":e===1?"● Record":`● Record ${e} devices`}function gt({selectedUdids:e}){const{state:t,dispatch:n}=_e(),[o,i]=u.useState(()=>Date.now());u.useEffect(()=>{if(t.recordingPhase!=="recording"&&t.recordingPhase!=="stopping")return;i(Date.now());const R=window.setInterval(()=>i(Date.now()),250);return()=>window.clearInterval(R)},[t.recordingPhase]);const f=t.startedAt&&(t.recordingPhase==="recording"||t.recordingPhase==="stopping")?o-t.startedAt:0,g=t.recordingPhase==="starting"||t.recordingPhase==="stopping",S=t.recordingPhase==="idle"&&e.length>0&&!g,h=(t.recordingPhase==="recording"||t.recording&&t.tiles.some(R=>!!R.recordingId))&&!g,y=h,c=!!t.groupId&&t.recordingPhase==="idle",j=e.length>1||t.downloadableVideoCount>1,w=c&&t.compositeEnabled,m=c&&!t.compositeEnabled&&(t.downloadableVideoCount===1||t.downloadableVideoCount===0&&e.length<=1),b=async()=>{var R;if(S){n({type:"SET_RECORDING_PHASE",phase:"starting"}),n({type:"SET_BANNER",banner:null});try{const x=await lt(e);if(!((R=x.recordings)!=null&&R.length)){n({type:"SET_RECORDING_PHASE",phase:"idle"}),n({type:"SET_BANNER",banner:{tone:"error",message:"Recording did not start. Check that live preview is working, then try again."}});return}const a={};for(const C of x.recordings)a[C.udid]=C.id;const p=e.length-x.recordings.length;n({type:"START_RECORDING",groupId:x.groupId,startedAt:Date.now(),tileIds:a,compositeEnabled:x.compositeEnabled===!0}),p>0?n({type:"SET_BANNER",banner:{tone:"error",message:`Recording started on ${x.recordings.length} of ${e.length} devices (${p} failed).`}}):n({type:"SET_BANNER",banner:null})}catch(x){if(n({type:"SET_RECORDING_PHASE",phase:"idle"}),x instanceof de)if(x.body.error==="device_busy"){const a=(x.body.busyDevices??[]).map(p=>`${p.udid} (${p.reason})`).join(", ");n({type:"SET_BANNER",banner:{tone:"error",message:`Cannot start — these devices are busy: ${a}`}})}else n({type:"SET_BANNER",banner:{tone:"error",message:`Server-wide recording cap reached (${x.body.active}/${x.body.limit}).`}});else n({type:"SET_BANNER",banner:{tone:"error",message:`Recording failed: ${x.message}`}})}}},T=async()=>{if(!(!t.groupId||t.recordingPhase!=="recording")){n({type:"SET_RECORDING_PHASE",phase:"stopping"});try{const R=await dt(t.groupId),x=(R.recordings??[]).filter(p=>p.status==="STOPPED"&&(p.sizeBytes??0)>=1024),a=(R.recordings??[]).filter(p=>p.status!=="STOPPED");n({type:"STOP_RECORDING",downloadableVideoCount:x.length,compositeEnabled:t.compositeEnabled}),x.length===0?n({type:"SET_BANNER",banner:{tone:"error",message:a.length>0?`Recording failed on ${a.length} device(s). Nothing to download.`:"Recording stopped but no playable video was produced."}}):a.length>0?n({type:"SET_BANNER",banner:{tone:"info",message:`${x.length} video(s) ready · ${a.length} failed. Use Download below.`}}):n({type:"SET_BANNER",banner:{tone:"info",message:x.length===1?"Video ready — download below.":`${x.length} videos ready — download below.`}})}catch(R){n({type:"STOP_RECORDING"}),n({type:"SET_BANNER",banner:{tone:"error",message:`Stop failed: ${R.message}`}})}}},s=async()=>{var p;if(!t.groupId||t.recordingPhase!=="recording")return;const R=window.prompt("Bookmark label?");if(!R)return;const x=t.startedAt?Date.now()-t.startedAt:0,a=(p=t.tiles.find(C=>C.recordingId))==null?void 0:p.recordingId;if(a)try{await ue(t.groupId,a,x,R)}catch(C){n({type:"SET_BANNER",banner:{tone:"error",message:`Bookmark failed: ${C.message}`}})}},d=()=>{y&&n({type:"SET_ANNOTATE_MODE",enabled:!t.annotateMode})},E=()=>{y&&n({type:"CLEAR_OVERLAY_ANNOTATIONS"})},I=Object.values(t.overlayAnnotations).some(R=>((R==null?void 0:R.length)??0)>0),A=[{id:"RECT",label:"Rect"},{id:"CIRCLE",label:"Circle"},{id:"ARROW",label:"Arrow"},{id:"FREEHAND",label:"Draw"}];return r.jsxs("div",{className:"flex items-center gap-2 flex-wrap justify-end",children:[(t.recordingPhase==="recording"||t.recordingPhase==="stopping")&&r.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded text-xs font-mono tabular-nums bg-[rgb(var(--rgb-red-600)/0.2)] text-[var(--red-200)] border border-[rgb(var(--rgb-red)/0.4)]",title:"Recording elapsed time",children:[r.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-[var(--red)] animate-pulse"}),"REC ",$e(f),t.recordingPhase==="stopping"?" · Stopping…":""]}),r.jsx("button",{type:"button",onClick:b,disabled:!S,title:e.length===0?"Add a device to the mosaic first":"Record every device currently in the mosaic",className:"px-3 py-1.5 text-sm rounded bg-[var(--red-600)] text-white disabled:opacity-40 disabled:cursor-not-allowed light:disabled:bg-transparent light:disabled:text-[var(--text)] light:disabled:ring-1 light:disabled:ring-inset light:disabled:ring-[color:var(--border)]",children:mt(e.length,t.recordingPhase)}),r.jsx("button",{type:"button",onClick:T,disabled:!h,className:"px-3 py-1.5 text-sm rounded border border-[var(--border)] disabled:opacity-40 disabled:cursor-not-allowed",children:t.recordingPhase==="stopping"?"Stopping…":"⏹ Stop"}),r.jsx("button",{type:"button",onClick:s,disabled:!h,className:"px-3 py-1.5 text-sm rounded border border-[var(--border)] disabled:opacity-40 disabled:cursor-not-allowed",children:"🔖 Bookmark"}),r.jsx("button",{type:"button",onClick:d,disabled:!y,title:y?t.annotateMode?"Exit annotate mode (tap/swipe resumes)":"Draw on the live screen — saved with the recording":"Start recording to annotate",className:`px-3 py-1.5 text-sm rounded border ${t.annotateMode?"bg-[var(--color-info)] text-white border-transparent":"border-[var(--border)]"} disabled:opacity-40 disabled:cursor-not-allowed`,children:"✎ Annotate"}),t.annotateMode&&y&&r.jsxs("div",{className:"flex items-center gap-1 ml-1 pl-2 border-l border-[var(--border)]",children:[A.map(R=>r.jsx("button",{type:"button",onClick:()=>n({type:"SET_SHAPE",shape:R.id}),className:`px-2 py-1 text-xs rounded border ${t.shape===R.id?"bg-[var(--surface-2)] border-[var(--color-info)] text-[rgb(var(--rgb-fg))]":"border-[var(--border)] opacity-80 hover:opacity-100"}`,children:R.label},R.id)),r.jsx("input",{type:"color",value:t.color,onChange:R=>n({type:"SET_COLOR",color:R.target.value}),title:"Annotation color",className:"w-7 h-7 rounded border border-[var(--border)] bg-transparent cursor-pointer"})]}),y&&I&&r.jsx("button",{type:"button",onClick:E,title:"Clear drawn annotations from the live preview",className:"px-2 py-1.5 text-sm rounded border border-[var(--border)] hover:bg-[var(--surface-2)]",children:"Clear marks"}),c&&m&&r.jsx("a",{href:ht(t.groupId),className:"ml-1 px-3 py-1.5 text-sm rounded border border-[var(--border)] hover:bg-[var(--surface-2)]",download:!0,children:"⤓ Download video"}),c&&!m&&r.jsxs("a",{href:ft(t.groupId),className:"ml-1 px-3 py-1.5 text-sm rounded border border-[var(--border)] hover:bg-[var(--surface-2)]",download:`videos-${t.groupId}.zip`,title:"ZIP of mp4 files only (no JSON extras)",children:["⤓ Download ",j?"videos":"video"]}),w&&r.jsx("a",{href:pt(t.groupId),className:"px-3 py-1.5 text-sm rounded border border-[var(--border)] hover:bg-[var(--surface-2)]",download:`side-by-side-${t.groupId}.mp4`,title:"All devices in one side-by-side video",children:"⤓ Side-by-side"})]})}function bt({remainingSec:e,onContinue:t,onReleaseNow:n}){return r.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"idle-warning-title",className:"fixed inset-0 z-40 bg-black/60 flex items-center justify-center",children:r.jsxs("div",{className:"bg-[var(--bg)] border border-[var(--border)] rounded-lg w-full max-w-md p-6",children:[r.jsx("h3",{id:"idle-warning-title",className:"text-base font-semibold mb-2",children:"Are you still there?"}),r.jsxs("p",{className:"text-sm text-[var(--text-dim)] mb-4",children:["Your devices will be released in"," ",r.jsxs("span",{className:"text-[var(--text)] font-mono font-semibold",children:[e,"s"]})," due to inactivity. Click ",r.jsx("strong",{children:"Continue Session"})," to keep them locked."]}),r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsx("button",{type:"button",onClick:n,className:"h-9 px-3 rounded-md border border-[var(--border)] text-sm text-[var(--text-dim)] hover:text-[var(--text)]",children:"Release now"}),r.jsx("button",{type:"button",autoFocus:!0,onClick:t,className:"h-9 px-4 rounded-md bg-[var(--color-accent)] text-[var(--color-on-accent)] text-sm font-medium",children:"Continue session"})]})]})})}function fe(e,t,n){return!n||!e?!1:e===`manual_${n}_${t}`}function xt(e,t){return e.busy?fe(e.session_id,e.udid,t):!1}const ce=["mousemove","mousedown","keydown","touchstart","wheel"];function yt({idleAfterMs:e,warningSec:t,onWarning:n,onTimeout:o,enabled:i}){const[f,g]=u.useState(!1),[S,v]=u.useState(null),h=u.useRef(null),y=u.useRef(null),c=u.useRef(!1),j=u.useRef(n),w=u.useRef(o);j.current=n,w.current=o;function m(){h.current&&(clearTimeout(h.current),h.current=null),y.current&&(clearInterval(y.current),y.current=null)}function b(){c.current=!0,g(!0),v(t),j.current(t);let d=t;y.current=setInterval(()=>{d-=1,d<=0?(m(),c.current=!1,g(!1),v(null),w.current()):v(d)},1e3)}function T(){m(),c.current=!1,g(!1),v(null);const d=e-t*1e3;h.current=setTimeout(b,Math.max(0,d))}function s(){i&&T()}return u.useEffect(()=>{if(!i){m(),c.current=!1,g(!1),v(null);return}function d(){c.current||T()}return ce.forEach(E=>window.addEventListener(E,d,{passive:!0})),T(),()=>{ce.forEach(E=>window.removeEventListener(E,d)),m()}},[i,e,t]),{warning:f,remainingSec:S,reset:s}}const vt=5*60*1e3,wt=30;function Z(e){if(!e)return"9 / 16";const t=Number(e.screenWidth),n=Number(e.screenHeight);if(Number.isFinite(t)&&Number.isFinite(n)&&t>0&&n>0)return`${t} / ${n}`;const o=(e.platform||"").toLowerCase();return o==="tvos"||o==="androidtv"||o==="android-tv"?"16 / 9":"9 / 16"}function Et(e,t){if(e.busy)return e.session_id?e.session_id.startsWith("manual_")?fe(e.session_id,e.udid,t)?"manual_self":"manual_other":"automation":"unknown"}function Nt(e,t){return{udid:e.udid,name:e.name,platform:e.platform,busy:e.busy,busyReason:Et(e,t),mjpegServerPort:e.mjpegServerPort,offline:!!e.offline}}function Ct(){const[e,t]=Me(),[n,o]=u.useState([]),[i,f]=u.useState(0),[g,S]=u.useState(null),v=u.useRef(!1);u.useEffect(()=>{let s=!1;return fetch("/xenon/api/auth/me",{credentials:"include"}).then(d=>d.ok?d.json():null).then(d=>{!s&&(d!=null&&d.userId)&&S(d.userId)}).catch(()=>{}),()=>{s=!0}},[]),u.useEffect(()=>{let s=!1;const d=async()=>{try{const I=await D.getDevices();s||o(Array.isArray(I)?I:[])}catch{}};d();const E=window.setInterval(d,5e3);return()=>{s=!0,window.clearInterval(E)}},[i]),u.useEffect(()=>{let s=!1;if(!(!g||v.current))return v.current=!0,(async()=>{try{const d=await D.getDevices(),E=(Array.isArray(d)?d:[]).filter(x=>xt(x,g));if(E.length===0)return;const A=(await Promise.all(E.map(async x=>{try{const a=await fetch(`/xenon/api/control/${encodeURIComponent(x.udid)}/stream/status`);if(!a.ok)return null;const p=await a.json();return(p==null?void 0:p.status)==="running"?x:null}catch{return null}}))).filter(x=>x!==null);if(s||A.length===0)return;const R=A.map(x=>{const a=Number(x.screenWidth),p=Number(x.screenHeight);return{udid:x.udid,name:x.name,mjpegPort:0,aspect:Z(x),screenWidth:Number.isFinite(a)&&a>0?a:void 0,screenHeight:Number.isFinite(p)&&p>0?p:void 0,platform:x.platform}});t({type:"SET_TILES",tiles:R})}catch{}})(),()=>{s=!0}},[g,t]),u.useEffect(()=>{for(const s of e.tiles){if(s.screenWidth&&s.screenHeight)continue;const d=n.find(A=>A.udid===s.udid);if(!d)continue;const E=Number(d.screenWidth),I=Number(d.screenHeight);Number.isFinite(E)&&E>0&&Number.isFinite(I)&&I>0&&t({type:"PATCH_TILE_DIMS",udid:s.udid,screenWidth:E,screenHeight:I,aspect:Z(d)})}},[n,e.tiles,t]),u.useEffect(()=>{const s=async d=>{var x,a;if(d.key!=="b"&&d.key!=="B")return;const E=(x=d.target)==null?void 0:x.tagName;if(E==="INPUT"||E==="TEXTAREA"||E==="SELECT"||!e.recording||!e.groupId)return;const I=window.prompt("Bookmark label?");if(!I)return;const A=e.startedAt?Date.now()-e.startedAt:0,R=(a=e.tiles.find(p=>p.recordingId))==null?void 0:a.recordingId;if(R)try{await ue(e.groupId,R,A,I)}catch(p){t({type:"SET_ERROR_BANNER",message:`Bookmark failed: ${p.message}`})}};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e.recording,e.groupId,e.startedAt,e.tiles,t]);const h=u.useMemo(()=>new Set(e.tiles.map(s=>s.udid)),[e.tiles]),y=u.useMemo(()=>n.map(s=>Nt(s,g)),[n,g]),c=s=>{const d=Number(s.screenWidth),E=Number(s.screenHeight);return{udid:s.udid,name:s.name,mjpegPort:0,aspect:Z(s),screenWidth:Number.isFinite(d)&&d>0?d:void 0,screenHeight:Number.isFinite(E)&&E>0?E:void 0,platform:s.platform}},j=async s=>{if(e.tiles.some(A=>A.udid===s)){await w(s);return}if(e.recording){t({type:"SET_ERROR_BANNER",message:"Stop recording before changing the mosaic layout."});return}const E=n.find(A=>A.udid===s);if(!E)return;t({type:"ADD_TILE",tile:c(E)});const I=await D.startStream(s).catch(()=>null);je(I)&&t({type:"REMOVE_TILE",udid:s})},w=async s=>{t({type:"REMOVE_TILE",udid:s});try{await fetch(`/xenon/api/control/${encodeURIComponent(s)}/stream/stop`,{method:"POST"})}catch{}f(d=>d+1)},m=async(s,d)=>{if(e.groupId)try{await ut(e.groupId,{recordingId:s,timecodeMs:e.startedAt?Date.now()-e.startedAt:0,shape:d.shape,geometry:JSON.stringify(d.geometry),color:d.color,text:d.text})}catch(E){t({type:"SET_ERROR_BANNER",message:`Annotation failed: ${E.message}`})}},b=()=>{for(const s of e.tiles){const d=`/xenon/api/control/${encodeURIComponent(s.udid)}/stream/stop`;try{navigator.sendBeacon?navigator.sendBeacon(d):fetch(d,{method:"POST",keepalive:!0}).catch(()=>{})}catch{}}e.tiles.forEach(s=>t({type:"REMOVE_TILE",udid:s.udid}))},T=yt({idleAfterMs:vt,warningSec:wt,enabled:e.tiles.length>0,onWarning:()=>{},onTimeout:()=>{b()}});return r.jsxs(le.Provider,{value:{state:e,dispatch:t},children:[r.jsxs("div",{className:"flex flex-col h-full p-4 gap-3",children:[r.jsxs("header",{className:"flex items-center justify-between gap-3",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(Ae,{icon:Se,children:"Live devices"}),r.jsx(Ue,{value:e.layout,onChange:s=>t({type:"SET_LAYOUT",layout:s})})]}),r.jsx(gt,{selectedUdids:e.tiles.map(s=>s.udid)})]}),e.banner&&r.jsxs("div",{role:"alert",className:`text-sm rounded border px-3 py-2 flex items-center gap-2 ${e.banner.tone==="error"?"border-[rgb(var(--rgb-red)/0.4)] bg-[rgb(var(--rgb-red)/0.1)] text-[var(--red-100)]":"border-[rgb(var(--rgb-success)/0.4)] bg-[rgb(var(--rgb-success)/0.1)] text-[var(--text)]"}`,children:[r.jsx("span",{className:"flex-1",children:e.banner.message}),r.jsx("button",{type:"button",className:"text-xs opacity-80 hover:opacity-100",onClick:()=>t({type:"SET_BANNER",banner:null}),children:"Dismiss"})]}),r.jsxs("div",{className:"grid grid-cols-[260px_1fr] gap-3 flex-1 min-h-0",children:[r.jsxs("aside",{className:"flex flex-col gap-2 border border-[var(--border)] rounded p-3 overflow-y-auto min-h-0",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-xs text-[var(--text-dim)]",children:"Devices"}),r.jsx("button",{className:"text-xs underline opacity-70 hover:opacity-100",onClick:()=>f(s=>s+1),children:"Refresh"})]}),r.jsx(Le,{devices:y,inMosaic:h,onToggle:j}),r.jsx("p",{className:"mt-2 text-[11px] text-[var(--text-dim)] leading-relaxed",children:"Click a device to add it to the mosaic. Record captures every device in the mosaic. After Stop, download the video (mp4) — not a proof bundle."})]}),r.jsx("main",{className:"border border-[var(--border)] rounded p-2 overflow-y-auto h-full min-h-0",children:r.jsx(at,{layout:e.layout,tiles:e.tiles,annotateMode:e.annotateMode,shape:e.shape,color:e.color,overlayAnnotationsByRecording:e.overlayAnnotations,onOverlayAnnotationsChange:(s,d)=>t({type:"SET_OVERLAY_ANNOTATIONS",recordingId:s,annotations:d}),onAnnotation:m,onRemove:w,onDropDevice:j})})]})]}),T.warning&&T.remainingSec!==null&&r.jsx(bt,{remainingSec:T.remainingSec,onContinue:T.reset,onReleaseNow:b})]})}export{Ct as default};
@@ -1 +1 @@
1
- import{j as s}from"./index-COp2dqp8.js";const i=({icon:e,title:m,description:t,action:a})=>s.jsxs("div",{className:"empty-state",children:[e&&s.jsx("div",{className:"empty-state-icon",children:e}),s.jsx("div",{className:"empty-state-title",children:m}),t&&s.jsx("div",{className:"empty-state-desc",children:t}),a&&s.jsx("div",{className:"empty-state-action",children:a})]});export{i as E};
1
+ import{j as s}from"./index-C9oFTvnK.js";const i=({icon:e,title:m,description:t,action:a})=>s.jsxs("div",{className:"empty-state",children:[e&&s.jsx("div",{className:"empty-state-icon",children:e}),s.jsx("div",{className:"empty-state-title",children:m}),t&&s.jsx("div",{className:"empty-state-desc",children:t}),a&&s.jsx("div",{className:"empty-state-action",children:a})]});export{i as E};
@@ -1 +1 @@
1
- import{j as s}from"./index-COp2dqp8.js";const r=({label:e,description:l,children:c,error:a,htmlFor:d})=>s.jsxs("div",{className:"fg",children:[s.jsx("label",{className:"fg-label",htmlFor:d,children:e}),l&&s.jsx("div",{className:"fg-desc",children:l}),s.jsx("div",{className:"fg-control",children:c}),a&&s.jsx("div",{className:"fg-error",children:a})]});export{r as F};
1
+ import{j as s}from"./index-C9oFTvnK.js";const r=({label:e,description:l,children:c,error:a,htmlFor:d})=>s.jsxs("div",{className:"fg",children:[s.jsx("label",{className:"fg-label",htmlFor:d,children:e}),l&&s.jsx("div",{className:"fg-desc",children:l}),s.jsx("div",{className:"fg-control",children:c}),a&&s.jsx("div",{className:"fg-error",children:a})]});export{r as F};
@@ -1,4 +1,4 @@
1
- import{r as i,j as h,t as at,R as xe,v as it,y as st}from"./index-COp2dqp8.js";function me(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function De(...e){return t=>{let n=!1;const r=e.map(o=>{const a=me(o,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o<r.length;o++){const a=r[o];typeof a=="function"?a():me(e[o],null)}}}}function I(...e){return i.useCallback(De(...e),e)}function Oe(e){const t=ct(e),n=i.forwardRef((r,o)=>{const{children:a,...c}=r,s=i.Children.toArray(a),d=s.find(lt);if(d){const u=d.props.children,f=s.map(v=>v===d?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:v);return h.jsx(t,{...c,ref:o,children:i.isValidElement(u)?i.cloneElement(u,void 0,f):null})}return h.jsx(t,{...c,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}function ct(e){const t=i.forwardRef((n,r)=>{const{children:o,...a}=n;if(i.isValidElement(o)){const c=ft(o),s=dt(a,o.props);return o.type!==i.Fragment&&(s.ref=r?De(r,c):c),i.cloneElement(o,s)}return i.Children.count(o)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ut=Symbol("radix.slottable");function lt(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ut}function dt(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...s)=>{const d=a(...s);return o(...s),d}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function ft(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var vt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],D=vt.reduce((e,t)=>{const n=Oe(`Primitive.${t}`),r=i.forwardRef((o,a)=>{const{asChild:c,...s}=o,d=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(d,{...s,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function mt(e,t){e&&at.flushSync(()=>e.dispatchEvent(t))}function ht(e,t){const n=i.createContext(t),r=a=>{const{children:c,...s}=a,d=i.useMemo(()=>s,Object.values(s));return h.jsx(n.Provider,{value:d,children:c})};r.displayName=e+"Provider";function o(a){const c=i.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,o]}function pt(e,t=[]){let n=[];function r(a,c){const s=i.createContext(c),d=n.length;n=[...n,c];const u=v=>{var y;const{scope:m,children:g,...w}=v,l=((y=m==null?void 0:m[e])==null?void 0:y[d])||s,p=i.useMemo(()=>w,Object.values(w));return h.jsx(l.Provider,{value:p,children:g})};u.displayName=a+"Provider";function f(v,m){var l;const g=((l=m==null?void 0:m[e])==null?void 0:l[d])||s,w=i.useContext(g);if(w)return w;if(c!==void 0)return c;throw new Error(`\`${v}\` must be used within \`${a}\``)}return[u,f]}const o=()=>{const a=n.map(c=>i.createContext(c));return function(s){const d=(s==null?void 0:s[e])||a;return i.useMemo(()=>({[`__scope${e}`]:{...s,[e]:d}}),[s,d])}};return o.scopeName=e,[r,gt(o,...t)]}function gt(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const c=r.reduce((s,{useScope:d,scopeName:u})=>{const v=d(a)[`__scope${u}`];return{...s,...v}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function B(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var U=globalThis!=null&&globalThis.document?i.useLayoutEffect:()=>{};function A(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function yt(e,t=globalThis==null?void 0:globalThis.document){const n=B(e);i.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Et="DismissableLayer",ce="dismissableLayer.update",bt="dismissableLayer.pointerDownOutside",Ct="dismissableLayer.focusOutside",he,Ae=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Te=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:c,onDismiss:s,...d}=e,u=i.useContext(Ae),[f,v]=i.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=i.useState({}),w=I(t,E=>v(E)),l=Array.from(u.layers),[p]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=l.indexOf(p),b=f?l.indexOf(f):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,R=Rt(E=>{const T=E.target,L=[...u.branches].some(W=>W.contains(T));!S||L||(o==null||o(E),c==null||c(E),E.defaultPrevented||s==null||s())},m),N=Nt(E=>{const T=E.target;[...u.branches].some(W=>W.contains(T))||(a==null||a(E),c==null||c(E),E.defaultPrevented||s==null||s())},m);return yt(E=>{b===u.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&s&&(E.preventDefault(),s()))},m),i.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(he=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),pe(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=he)}},[f,m,n,u]),i.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),pe())},[f,u]),i.useEffect(()=>{const E=()=>g({});return document.addEventListener(ce,E),()=>document.removeEventListener(ce,E)},[]),h.jsx(D.div,{...d,ref:w,style:{pointerEvents:C?S?"auto":"none":void 0,...e.style},onFocusCapture:A(e.onFocusCapture,N.onFocusCapture),onBlurCapture:A(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:A(e.onPointerDownCapture,R.onPointerDownCapture)})});Te.displayName=Et;var St="DismissableLayerBranch",wt=i.forwardRef((e,t)=>{const n=i.useContext(Ae),r=i.useRef(null),o=I(t,r);return i.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),h.jsx(D.div,{...e,ref:o})});wt.displayName=St;function Rt(e,t=globalThis==null?void 0:globalThis.document){const n=B(e),r=i.useRef(!1),o=i.useRef(()=>{});return i.useEffect(()=>{const a=s=>{if(s.target&&!r.current){let d=function(){Me(bt,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}else t.removeEventListener("click",o.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Nt(e,t=globalThis==null?void 0:globalThis.document){const n=B(e),r=i.useRef(!1);return i.useEffect(()=>{const o=a=>{a.target&&!r.current&&Me(Ct,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function pe(){const e=new CustomEvent(ce);document.dispatchEvent(e)}function Me(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?mt(o,a):o.dispatchEvent(a)}var Pt=xe[" useId ".trim().toString()]||(()=>{}),xt=0;function ee(e){const[t,n]=i.useState(Pt());return U(()=>{n(r=>r??String(xt++))},[e]),e||(t?`radix-${t}`:"")}var Dt=xe[" useInsertionEffect ".trim().toString()]||U;function Ot({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,c]=At({defaultProp:t,onChange:n}),s=e!==void 0,d=s?e:o;{const f=i.useRef(e!==void 0);i.useEffect(()=>{const v=f.current;v!==s&&console.warn(`${r} is changing from ${v?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=s},[s,r])}const u=i.useCallback(f=>{var v;if(s){const m=Tt(f)?f(e):f;m!==e&&((v=c.current)==null||v.call(c,m))}else a(f)},[s,e,a,c]);return[d,u]}function At({defaultProp:e,onChange:t}){const[n,r]=i.useState(e),o=i.useRef(n),a=i.useRef(t);return Dt(()=>{a.current=t},[t]),i.useEffect(()=>{var c;o.current!==n&&((c=a.current)==null||c.call(a,n),o.current=n)},[n,o]),[n,r,a]}function Tt(e){return typeof e=="function"}var te="focusScope.autoFocusOnMount",ne="focusScope.autoFocusOnUnmount",ge={bubbles:!1,cancelable:!0},Mt="FocusScope",Ie=i.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...c}=e,[s,d]=i.useState(null),u=B(o),f=B(a),v=i.useRef(null),m=I(t,l=>d(l)),g=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(r){let l=function(C){if(g.paused||!s)return;const S=C.target;s.contains(S)?v.current=S:O(v.current,{select:!0})},p=function(C){if(g.paused||!s)return;const S=C.relatedTarget;S!==null&&(s.contains(S)||O(v.current,{select:!0}))},y=function(C){if(document.activeElement===document.body)for(const R of C)R.removedNodes.length>0&&O(s)};document.addEventListener("focusin",l),document.addEventListener("focusout",p);const b=new MutationObserver(y);return s&&b.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",l),document.removeEventListener("focusout",p),b.disconnect()}}},[r,s,g.paused]),i.useEffect(()=>{if(s){Ee.add(g);const l=document.activeElement;if(!s.contains(l)){const y=new CustomEvent(te,ge);s.addEventListener(te,u),s.dispatchEvent(y),y.defaultPrevented||(It(jt(Le(s)),{select:!0}),document.activeElement===l&&O(s))}return()=>{s.removeEventListener(te,u),setTimeout(()=>{const y=new CustomEvent(ne,ge);s.addEventListener(ne,f),s.dispatchEvent(y),y.defaultPrevented||O(l??document.body,{select:!0}),s.removeEventListener(ne,f),Ee.remove(g)},0)}}},[s,u,f,g]);const w=i.useCallback(l=>{if(!n&&!r||g.paused)return;const p=l.key==="Tab"&&!l.altKey&&!l.ctrlKey&&!l.metaKey,y=document.activeElement;if(p&&y){const b=l.currentTarget,[C,S]=Lt(b);C&&S?!l.shiftKey&&y===S?(l.preventDefault(),n&&O(C,{select:!0})):l.shiftKey&&y===C&&(l.preventDefault(),n&&O(S,{select:!0})):y===b&&l.preventDefault()}},[n,r,g.paused]);return h.jsx(D.div,{tabIndex:-1,...c,ref:m,onKeyDown:w})});Ie.displayName=Mt;function It(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(O(r,{select:t}),document.activeElement!==n)return}function Lt(e){const t=Le(e),n=ye(t,e),r=ye(t.reverse(),e);return[n,r]}function Le(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ye(e,t){for(const n of e)if(!_t(n,{upTo:t}))return n}function _t(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Ft(e){return e instanceof HTMLInputElement&&"select"in e}function O(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ft(e)&&t&&e.select()}}var Ee=kt();function kt(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=be(e,t),e.unshift(t)},remove(t){var n;e=be(e,t),(n=e[0])==null||n.resume()}}}function be(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function jt(e){return e.filter(t=>t.tagName!=="A")}var Wt="Portal",_e=i.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,a]=i.useState(!1);U(()=>a(!0),[]);const c=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return c?it.createPortal(h.jsx(D.div,{...r,ref:t}),c):null});_e.displayName=Wt;function Bt(e,t){return i.useReducer((n,r)=>t[n][r]??n,e)}var q=e=>{const{present:t,children:n}=e,r=Ut(t),o=typeof n=="function"?n({present:r.isPresent}):i.Children.only(n),a=I(r.ref,$t(o));return typeof n=="function"||r.isPresent?i.cloneElement(o,{ref:a}):null};q.displayName="Presence";function Ut(e){const[t,n]=i.useState(),r=i.useRef(null),o=i.useRef(e),a=i.useRef("none"),c=e?"mounted":"unmounted",[s,d]=Bt(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const u=V(r.current);a.current=s==="mounted"?u:"none"},[s]),U(()=>{const u=r.current,f=o.current;if(f!==e){const m=a.current,g=V(u);e?d("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?d("UNMOUNT"):d(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),U(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,v=g=>{const l=V(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&l&&(d("ANIMATION_END"),!o.current)){const p=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=p)})}},m=g=>{g.target===t&&(a.current=V(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:i.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function V(e){return(e==null?void 0:e.animationName)||"none"}function $t(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var re=0;function Vt(){i.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ce()),document.body.insertAdjacentElement("beforeend",e[1]??Ce()),re++,()=>{re===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),re--}},[])}function Ce(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var x=function(){return x=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},x.apply(this,arguments)};function Fe(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Kt(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,a;r<o;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var H="right-scroll-bar-position",z="width-before-scroll-bar",Gt="with-scroll-bars-hidden",Xt="--removed-body-scroll-bar-size";function oe(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Yt(e,t){var n=i.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Ht=typeof window<"u"?i.useLayoutEffect:i.useEffect,Se=new WeakMap;function zt(e,t){var n=Yt(null,function(r){return e.forEach(function(o){return oe(o,r)})});return Ht(function(){var r=Se.get(n);if(r){var o=new Set(r),a=new Set(e),c=n.current;o.forEach(function(s){a.has(s)||oe(s,null)}),a.forEach(function(s){o.has(s)||oe(s,c)})}Se.set(n,e)},[e]),n}function Zt(e){return e}function qt(e,t){t===void 0&&(t=Zt);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var c=t(a,r);return n.push(c),function(){n=n.filter(function(s){return s!==c})}},assignSyncMedium:function(a){for(r=!0;n.length;){var c=n;n=[],c.forEach(a)}n={push:function(s){return a(s)},filter:function(){return n}}},assignMedium:function(a){r=!0;var c=[];if(n.length){var s=n;n=[],s.forEach(a),c=n}var d=function(){var f=c;c=[],f.forEach(a)},u=function(){return Promise.resolve().then(d)};u(),n={push:function(f){c.push(f),u()},filter:function(f){return c=c.filter(f),n}}}};return o}function Qt(e){e===void 0&&(e={});var t=qt(null);return t.options=x({async:!0,ssr:!1},e),t}var ke=function(e){var t=e.sideCar,n=Fe(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return i.createElement(r,x({},n))};ke.isSideCarExport=!0;function Jt(e,t){return e.useMedium(t),ke}var je=Qt(),ae=function(){},Q=i.forwardRef(function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:ae,onWheelCapture:ae,onTouchMoveCapture:ae}),o=r[0],a=r[1],c=e.forwardProps,s=e.children,d=e.className,u=e.removeScrollBar,f=e.enabled,v=e.shards,m=e.sideCar,g=e.noRelative,w=e.noIsolation,l=e.inert,p=e.allowPinchZoom,y=e.as,b=y===void 0?"div":y,C=e.gapMode,S=Fe(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=m,N=zt([n,t]),E=x(x({},S),o);return i.createElement(i.Fragment,null,f&&i.createElement(R,{sideCar:je,removeScrollBar:u,shards:v,noRelative:g,noIsolation:w,inert:l,setCallbacks:a,allowPinchZoom:!!p,lockRef:n,gapMode:C}),c?i.cloneElement(i.Children.only(s),x(x({},E),{ref:N})):i.createElement(b,x({},E,{className:d,ref:N}),s))});Q.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Q.classNames={fullWidth:z,zeroRight:H};var en=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function tn(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=en();return t&&e.setAttribute("nonce",t),e}function nn(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function rn(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var on=function(){var e=0,t=null;return{add:function(n){e==0&&(t=tn())&&(nn(t,n),rn(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},an=function(){var e=on();return function(t,n){i.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},We=function(){var e=an(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},sn={left:0,top:0,right:0,gap:0},ie=function(e){return parseInt(e||"",10)||0},cn=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ie(n),ie(r),ie(o)]},un=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return sn;var t=cn(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ln=We(),j="data-scroll-locked",dn=function(e,t,n,r){var o=e.left,a=e.top,c=e.right,s=e.gap;return n===void 0&&(n="margin"),`
1
+ import{r as i,j as h,t as at,R as xe,v as it,y as st}from"./index-C9oFTvnK.js";function me(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function De(...e){return t=>{let n=!1;const r=e.map(o=>{const a=me(o,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o<r.length;o++){const a=r[o];typeof a=="function"?a():me(e[o],null)}}}}function I(...e){return i.useCallback(De(...e),e)}function Oe(e){const t=ct(e),n=i.forwardRef((r,o)=>{const{children:a,...c}=r,s=i.Children.toArray(a),d=s.find(lt);if(d){const u=d.props.children,f=s.map(v=>v===d?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:v);return h.jsx(t,{...c,ref:o,children:i.isValidElement(u)?i.cloneElement(u,void 0,f):null})}return h.jsx(t,{...c,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}function ct(e){const t=i.forwardRef((n,r)=>{const{children:o,...a}=n;if(i.isValidElement(o)){const c=ft(o),s=dt(a,o.props);return o.type!==i.Fragment&&(s.ref=r?De(r,c):c),i.cloneElement(o,s)}return i.Children.count(o)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ut=Symbol("radix.slottable");function lt(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ut}function dt(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...s)=>{const d=a(...s);return o(...s),d}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function ft(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var vt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],D=vt.reduce((e,t)=>{const n=Oe(`Primitive.${t}`),r=i.forwardRef((o,a)=>{const{asChild:c,...s}=o,d=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(d,{...s,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function mt(e,t){e&&at.flushSync(()=>e.dispatchEvent(t))}function ht(e,t){const n=i.createContext(t),r=a=>{const{children:c,...s}=a,d=i.useMemo(()=>s,Object.values(s));return h.jsx(n.Provider,{value:d,children:c})};r.displayName=e+"Provider";function o(a){const c=i.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,o]}function pt(e,t=[]){let n=[];function r(a,c){const s=i.createContext(c),d=n.length;n=[...n,c];const u=v=>{var y;const{scope:m,children:g,...w}=v,l=((y=m==null?void 0:m[e])==null?void 0:y[d])||s,p=i.useMemo(()=>w,Object.values(w));return h.jsx(l.Provider,{value:p,children:g})};u.displayName=a+"Provider";function f(v,m){var l;const g=((l=m==null?void 0:m[e])==null?void 0:l[d])||s,w=i.useContext(g);if(w)return w;if(c!==void 0)return c;throw new Error(`\`${v}\` must be used within \`${a}\``)}return[u,f]}const o=()=>{const a=n.map(c=>i.createContext(c));return function(s){const d=(s==null?void 0:s[e])||a;return i.useMemo(()=>({[`__scope${e}`]:{...s,[e]:d}}),[s,d])}};return o.scopeName=e,[r,gt(o,...t)]}function gt(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const c=r.reduce((s,{useScope:d,scopeName:u})=>{const v=d(a)[`__scope${u}`];return{...s,...v}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function B(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var U=globalThis!=null&&globalThis.document?i.useLayoutEffect:()=>{};function A(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function yt(e,t=globalThis==null?void 0:globalThis.document){const n=B(e);i.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Et="DismissableLayer",ce="dismissableLayer.update",bt="dismissableLayer.pointerDownOutside",Ct="dismissableLayer.focusOutside",he,Ae=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Te=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:c,onDismiss:s,...d}=e,u=i.useContext(Ae),[f,v]=i.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=i.useState({}),w=I(t,E=>v(E)),l=Array.from(u.layers),[p]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=l.indexOf(p),b=f?l.indexOf(f):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,R=Rt(E=>{const T=E.target,L=[...u.branches].some(W=>W.contains(T));!S||L||(o==null||o(E),c==null||c(E),E.defaultPrevented||s==null||s())},m),N=Nt(E=>{const T=E.target;[...u.branches].some(W=>W.contains(T))||(a==null||a(E),c==null||c(E),E.defaultPrevented||s==null||s())},m);return yt(E=>{b===u.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&s&&(E.preventDefault(),s()))},m),i.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(he=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),pe(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=he)}},[f,m,n,u]),i.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),pe())},[f,u]),i.useEffect(()=>{const E=()=>g({});return document.addEventListener(ce,E),()=>document.removeEventListener(ce,E)},[]),h.jsx(D.div,{...d,ref:w,style:{pointerEvents:C?S?"auto":"none":void 0,...e.style},onFocusCapture:A(e.onFocusCapture,N.onFocusCapture),onBlurCapture:A(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:A(e.onPointerDownCapture,R.onPointerDownCapture)})});Te.displayName=Et;var St="DismissableLayerBranch",wt=i.forwardRef((e,t)=>{const n=i.useContext(Ae),r=i.useRef(null),o=I(t,r);return i.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),h.jsx(D.div,{...e,ref:o})});wt.displayName=St;function Rt(e,t=globalThis==null?void 0:globalThis.document){const n=B(e),r=i.useRef(!1),o=i.useRef(()=>{});return i.useEffect(()=>{const a=s=>{if(s.target&&!r.current){let d=function(){Me(bt,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}else t.removeEventListener("click",o.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Nt(e,t=globalThis==null?void 0:globalThis.document){const n=B(e),r=i.useRef(!1);return i.useEffect(()=>{const o=a=>{a.target&&!r.current&&Me(Ct,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function pe(){const e=new CustomEvent(ce);document.dispatchEvent(e)}function Me(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?mt(o,a):o.dispatchEvent(a)}var Pt=xe[" useId ".trim().toString()]||(()=>{}),xt=0;function ee(e){const[t,n]=i.useState(Pt());return U(()=>{n(r=>r??String(xt++))},[e]),e||(t?`radix-${t}`:"")}var Dt=xe[" useInsertionEffect ".trim().toString()]||U;function Ot({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,c]=At({defaultProp:t,onChange:n}),s=e!==void 0,d=s?e:o;{const f=i.useRef(e!==void 0);i.useEffect(()=>{const v=f.current;v!==s&&console.warn(`${r} is changing from ${v?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=s},[s,r])}const u=i.useCallback(f=>{var v;if(s){const m=Tt(f)?f(e):f;m!==e&&((v=c.current)==null||v.call(c,m))}else a(f)},[s,e,a,c]);return[d,u]}function At({defaultProp:e,onChange:t}){const[n,r]=i.useState(e),o=i.useRef(n),a=i.useRef(t);return Dt(()=>{a.current=t},[t]),i.useEffect(()=>{var c;o.current!==n&&((c=a.current)==null||c.call(a,n),o.current=n)},[n,o]),[n,r,a]}function Tt(e){return typeof e=="function"}var te="focusScope.autoFocusOnMount",ne="focusScope.autoFocusOnUnmount",ge={bubbles:!1,cancelable:!0},Mt="FocusScope",Ie=i.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...c}=e,[s,d]=i.useState(null),u=B(o),f=B(a),v=i.useRef(null),m=I(t,l=>d(l)),g=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(r){let l=function(C){if(g.paused||!s)return;const S=C.target;s.contains(S)?v.current=S:O(v.current,{select:!0})},p=function(C){if(g.paused||!s)return;const S=C.relatedTarget;S!==null&&(s.contains(S)||O(v.current,{select:!0}))},y=function(C){if(document.activeElement===document.body)for(const R of C)R.removedNodes.length>0&&O(s)};document.addEventListener("focusin",l),document.addEventListener("focusout",p);const b=new MutationObserver(y);return s&&b.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",l),document.removeEventListener("focusout",p),b.disconnect()}}},[r,s,g.paused]),i.useEffect(()=>{if(s){Ee.add(g);const l=document.activeElement;if(!s.contains(l)){const y=new CustomEvent(te,ge);s.addEventListener(te,u),s.dispatchEvent(y),y.defaultPrevented||(It(jt(Le(s)),{select:!0}),document.activeElement===l&&O(s))}return()=>{s.removeEventListener(te,u),setTimeout(()=>{const y=new CustomEvent(ne,ge);s.addEventListener(ne,f),s.dispatchEvent(y),y.defaultPrevented||O(l??document.body,{select:!0}),s.removeEventListener(ne,f),Ee.remove(g)},0)}}},[s,u,f,g]);const w=i.useCallback(l=>{if(!n&&!r||g.paused)return;const p=l.key==="Tab"&&!l.altKey&&!l.ctrlKey&&!l.metaKey,y=document.activeElement;if(p&&y){const b=l.currentTarget,[C,S]=Lt(b);C&&S?!l.shiftKey&&y===S?(l.preventDefault(),n&&O(C,{select:!0})):l.shiftKey&&y===C&&(l.preventDefault(),n&&O(S,{select:!0})):y===b&&l.preventDefault()}},[n,r,g.paused]);return h.jsx(D.div,{tabIndex:-1,...c,ref:m,onKeyDown:w})});Ie.displayName=Mt;function It(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(O(r,{select:t}),document.activeElement!==n)return}function Lt(e){const t=Le(e),n=ye(t,e),r=ye(t.reverse(),e);return[n,r]}function Le(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ye(e,t){for(const n of e)if(!_t(n,{upTo:t}))return n}function _t(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Ft(e){return e instanceof HTMLInputElement&&"select"in e}function O(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ft(e)&&t&&e.select()}}var Ee=kt();function kt(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=be(e,t),e.unshift(t)},remove(t){var n;e=be(e,t),(n=e[0])==null||n.resume()}}}function be(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function jt(e){return e.filter(t=>t.tagName!=="A")}var Wt="Portal",_e=i.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,a]=i.useState(!1);U(()=>a(!0),[]);const c=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return c?it.createPortal(h.jsx(D.div,{...r,ref:t}),c):null});_e.displayName=Wt;function Bt(e,t){return i.useReducer((n,r)=>t[n][r]??n,e)}var q=e=>{const{present:t,children:n}=e,r=Ut(t),o=typeof n=="function"?n({present:r.isPresent}):i.Children.only(n),a=I(r.ref,$t(o));return typeof n=="function"||r.isPresent?i.cloneElement(o,{ref:a}):null};q.displayName="Presence";function Ut(e){const[t,n]=i.useState(),r=i.useRef(null),o=i.useRef(e),a=i.useRef("none"),c=e?"mounted":"unmounted",[s,d]=Bt(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const u=V(r.current);a.current=s==="mounted"?u:"none"},[s]),U(()=>{const u=r.current,f=o.current;if(f!==e){const m=a.current,g=V(u);e?d("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?d("UNMOUNT"):d(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),U(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,v=g=>{const l=V(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&l&&(d("ANIMATION_END"),!o.current)){const p=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=p)})}},m=g=>{g.target===t&&(a.current=V(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:i.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function V(e){return(e==null?void 0:e.animationName)||"none"}function $t(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var re=0;function Vt(){i.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ce()),document.body.insertAdjacentElement("beforeend",e[1]??Ce()),re++,()=>{re===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),re--}},[])}function Ce(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var x=function(){return x=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},x.apply(this,arguments)};function Fe(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Kt(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,a;r<o;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var H="right-scroll-bar-position",z="width-before-scroll-bar",Gt="with-scroll-bars-hidden",Xt="--removed-body-scroll-bar-size";function oe(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Yt(e,t){var n=i.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Ht=typeof window<"u"?i.useLayoutEffect:i.useEffect,Se=new WeakMap;function zt(e,t){var n=Yt(null,function(r){return e.forEach(function(o){return oe(o,r)})});return Ht(function(){var r=Se.get(n);if(r){var o=new Set(r),a=new Set(e),c=n.current;o.forEach(function(s){a.has(s)||oe(s,null)}),a.forEach(function(s){o.has(s)||oe(s,c)})}Se.set(n,e)},[e]),n}function Zt(e){return e}function qt(e,t){t===void 0&&(t=Zt);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var c=t(a,r);return n.push(c),function(){n=n.filter(function(s){return s!==c})}},assignSyncMedium:function(a){for(r=!0;n.length;){var c=n;n=[],c.forEach(a)}n={push:function(s){return a(s)},filter:function(){return n}}},assignMedium:function(a){r=!0;var c=[];if(n.length){var s=n;n=[],s.forEach(a),c=n}var d=function(){var f=c;c=[],f.forEach(a)},u=function(){return Promise.resolve().then(d)};u(),n={push:function(f){c.push(f),u()},filter:function(f){return c=c.filter(f),n}}}};return o}function Qt(e){e===void 0&&(e={});var t=qt(null);return t.options=x({async:!0,ssr:!1},e),t}var ke=function(e){var t=e.sideCar,n=Fe(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return i.createElement(r,x({},n))};ke.isSideCarExport=!0;function Jt(e,t){return e.useMedium(t),ke}var je=Qt(),ae=function(){},Q=i.forwardRef(function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:ae,onWheelCapture:ae,onTouchMoveCapture:ae}),o=r[0],a=r[1],c=e.forwardProps,s=e.children,d=e.className,u=e.removeScrollBar,f=e.enabled,v=e.shards,m=e.sideCar,g=e.noRelative,w=e.noIsolation,l=e.inert,p=e.allowPinchZoom,y=e.as,b=y===void 0?"div":y,C=e.gapMode,S=Fe(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=m,N=zt([n,t]),E=x(x({},S),o);return i.createElement(i.Fragment,null,f&&i.createElement(R,{sideCar:je,removeScrollBar:u,shards:v,noRelative:g,noIsolation:w,inert:l,setCallbacks:a,allowPinchZoom:!!p,lockRef:n,gapMode:C}),c?i.cloneElement(i.Children.only(s),x(x({},E),{ref:N})):i.createElement(b,x({},E,{className:d,ref:N}),s))});Q.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Q.classNames={fullWidth:z,zeroRight:H};var en=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function tn(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=en();return t&&e.setAttribute("nonce",t),e}function nn(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function rn(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var on=function(){var e=0,t=null;return{add:function(n){e==0&&(t=tn())&&(nn(t,n),rn(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},an=function(){var e=on();return function(t,n){i.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},We=function(){var e=an(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},sn={left:0,top:0,right:0,gap:0},ie=function(e){return parseInt(e||"",10)||0},cn=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ie(n),ie(r),ie(o)]},un=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return sn;var t=cn(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ln=We(),j="data-scroll-locked",dn=function(e,t,n,r){var o=e.left,a=e.top,c=e.right,s=e.gap;return n===void 0&&(n="margin"),`
2
2
  .`.concat(Gt,` {
3
3
  overflow: hidden `).concat(r,`;
4
4
  padding-right: `).concat(s,"px ").concat(r,`;
@@ -1 +1 @@
1
- import{j as t}from"./index-COp2dqp8.js";function r({segments:a,value:n,onChange:l,size:s="md"}){return t.jsx("div",{className:`seg seg-${s}`,role:"tablist",children:a.map(e=>t.jsxs("button",{role:"tab","aria-selected":e.value===n,className:`seg-btn${e.value===n?" seg-btn-active":""}`,onClick:()=>l(e.value),type:"button",children:[t.jsx("span",{children:e.label}),typeof e.count=="number"&&t.jsx("span",{className:"seg-count",children:e.count})]},e.value))})}export{r as S};
1
+ import{j as t}from"./index-C9oFTvnK.js";function r({segments:a,value:n,onChange:l,size:s="md"}){return t.jsx("div",{className:`seg seg-${s}`,role:"tablist",children:a.map(e=>t.jsxs("button",{role:"tab","aria-selected":e.value===n,className:`seg-btn${e.value===n?" seg-btn-active":""}`,onClick:()=>l(e.value),type:"button",children:[t.jsx("span",{children:e.label}),typeof e.count=="number"&&t.jsx("span",{className:"seg-count",children:e.count})]},e.value))})}export{r as S};
@@ -1,4 +1,4 @@
1
- import{c as n,j as s,D as h}from"./index-COp2dqp8.js";import{B as r}from"./button-DTHTbm66.js";/**
1
+ import{c as n,j as s,D as h}from"./index-C9oFTvnK.js";import{B as r}from"./button-DnKYpdU4.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{j as t}from"./index-COp2dqp8.js";const x=({className:s,...a})=>t.jsx("table",{className:`tbl${s?" "+s:""}`,...a}),j=s=>t.jsx("thead",{...s}),c=s=>t.jsx("tbody",{...s}),e=s=>t.jsx("tr",{...s}),n=s=>t.jsx("th",{...s}),T=s=>t.jsx("td",{...s});export{x as T,j as a,e as b,n as c,c as d,T as e};
1
+ import{j as t}from"./index-C9oFTvnK.js";const x=({className:s,...a})=>t.jsx("table",{className:`tbl${s?" "+s:""}`,...a}),j=s=>t.jsx("thead",{...s}),c=s=>t.jsx("tbody",{...s}),e=s=>t.jsx("tr",{...s}),n=s=>t.jsx("th",{...s}),T=s=>t.jsx("td",{...s});export{x as T,j as a,e as b,n as c,c as d,T as e};
@@ -1,4 +1,4 @@
1
- import{c as t}from"./index-COp2dqp8.js";/**
1
+ import{c as t}from"./index-C9oFTvnK.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as p,x as z,r as c,X as m,j as e,S as k,D as N,N as I,O as $}from"./index-COp2dqp8.js";/* empty css */import{S,A as F}from"./SettingCard-ZbR8DaHC.js";import{P as B}from"./page-header-5o7AL-Si.js";import{L as T}from"./lock-BP7MGEhj.js";import{C as b}from"./circle-check-BUmpiwAe.js";import{A as D}from"./activity-u-0Ik7tY.js";import"./button-DTHTbm66.js";import"./utils-CDN07tui.js";/**
1
+ import{c as p,x as z,r as c,X as m,j as e,S as k,D as N,N as I,O as $}from"./index-C9oFTvnK.js";/* empty css */import{S,A as F}from"./SettingCard-DWUR3fDP.js";import{P as B}from"./page-header-CFA0PGbZ.js";import{L as T}from"./lock-CvF4fCd-.js";import{C as b}from"./circle-check-t8Jl8LXT.js";import{A as D}from"./activity-CwEbgyzs.js";import"./button-DnKYpdU4.js";import"./utils-CDN07tui.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{x as le,r as t,j as e,D as $,P as g,A as oe}from"./index-COp2dqp8.js";/* empty css */import{a as L}from"./time-B8FIgwPE.js";import{T as ce,a as de,b as z,c as l,d as me,e as o}from"./Table-ldjg_e2f.js";import{F as m}from"./FieldGroup-B_XuPehm.js";import{P as O}from"./page-header-5o7AL-Si.js";import{M as B}from"./Modal-BZlSzyZw.js";import{B as u}from"./button-DTHTbm66.js";import{I as H}from"./input-Bn0KOFhW.js";import{S as M}from"./select-BqXgtuxg.js";import{P as v}from"./plus-ajEIVTxm.js";import{T as pe}from"./trash-2-HuAOeX9q.js";import{C as he}from"./check-DLl5QnWP.js";import{C as xe}from"./copy-BLyHAmgm.js";import"./utils-CDN07tui.js";const U=["read","sessions","devices","admin"],W={"7d":"7 days","30d":"30 days","90d":"90 days","1y":"1 year",never:"No expiry"},ue={"7d":7,"30d":30,"90d":90,"1y":365};function Y(i){return i==="never"?null:new Date(Date.now()+ue[i]*864e5).toISOString()}function q(i){if(!i)return"Never";const n=Date.now()-new Date(i).getTime();return n<6e4?"Just now":n<36e5?`${Math.floor(n/6e4)}m ago`:n<864e5?`${Math.floor(n/36e5)}h ago`:`${Math.floor(n/864e5)}d ago`}const Pe=()=>{const{toast:i}=le(),[n,w]=t.useState([]),[b,J]=t.useState([]),[X,N]=t.useState(!0),[G,k]=t.useState(!1),[Q,d]=t.useState(!1),[r,y]=t.useState(null),[C,S]=t.useState(null),[T,_]=t.useState(!1),[p,A]=t.useState(""),[j,I]=t.useState({read:!0,sessions:!0,devices:!1,admin:!1}),[R,P]=t.useState(300),[E,D]=t.useState(""),[h,F]=t.useState("30d"),[x,K]=t.useState(!1),V=s=>{var a;return s?((a=b.find(c=>c.id===s))==null?void 0:a.name)||s.slice(0,8):"Shared"},f=async()=>{N(!0);try{const[s,a]=await Promise.all([fetch("/xenon/api/apikeys",{credentials:"include"}),fetch("/xenon/api/teams",{credentials:"include"})]);if(s.status===403){k(!0),w([]);return}if(!s.ok)throw new Error(`HTTP ${s.status}`);w(await s.json()),a.ok&&J(await a.json()),k(!1)}catch(s){i(`Failed to load API keys: ${s.message}`,"error")}finally{N(!1)}};t.useEffect(()=>{f()},[]);const Z=()=>{A(""),I({read:!0,sessions:!0,devices:!1,admin:!1}),P(300),D(""),F("30d")},ee=async()=>{const s=U.filter(a=>j[a]);if(!p.trim()){i("Key name is required","error");return}if(s.length===0){i("Select at least one scope","error");return}K(!0);try{const a=await fetch("/xenon/api/apikeys",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:p.trim(),scopes:s,rateLimit:R,teamId:E||null,expiresAt:Y(h)})});if(!a.ok)throw new Error(`HTTP ${a.status}`);const c=await a.json();d(!1),Z(),y({name:p.trim(),raw:c.key}),await f()}catch(a){i(`Create failed: ${a.message}`,"error")}finally{K(!1)}},se=async s=>{S(s);try{const a=await fetch(`/xenon/api/apikeys/${s}`,{method:"DELETE",credentials:"include"});if(!a.ok)throw new Error(`HTTP ${a.status}`);i("Key revoked","success"),await f()}catch(a){i(`Revoke failed: ${a.message}`,"error")}finally{S(null)}},ae=async s=>{try{await navigator.clipboard.writeText(s),_(!0),setTimeout(()=>_(!1),1500)}catch{i("Copy failed — select the text manually","error")}};if(X)return e.jsxs("div",{className:"settings-loading",children:[e.jsx($,{className:"animate-spin",size:32}),e.jsx("span",{children:"Loading API keys…"})]});if(G)return e.jsx("div",{className:"settings-container",children:e.jsx(O,{icon:g,title:"API keys",subtitle:e.jsxs(e.Fragment,{children:["Your key lacks the ",e.jsx("code",{children:"admin"})," scope. Ask an administrator to issue an admin key so you can manage access for other users."]})})});const te=n.length,ie=n.filter(s=>s.scopes.includes("admin")).length,ne=n.filter(s=>s.lastUsedAt&&Date.now()-new Date(s.lastUsedAt).getTime()<864e5).length;return e.jsxs("div",{className:"settings-container",children:[e.jsx(O,{icon:g,title:"API keys",subtitle:e.jsxs(e.Fragment,{children:["Issue scoped credentials for humans (dashboard login) and machines (CI, WebDriver clients via ",e.jsx("code",{children:"xenon:accessKey"}),"). Keys are shown only once at creation — copy the value before closing the dialog."]}),action:e.jsxs("button",{type:"button",className:"page-header-action",onClick:()=>d(!0),children:[e.jsx(v,{size:16}),e.jsx("span",{children:"Create new key"})]})}),e.jsxs("div",{className:"settings-content",children:[n.length>0&&e.jsxs("div",{className:"stat-strip",children:[e.jsxs("div",{className:"stat-strip__cell",children:[e.jsx("div",{className:"stat-strip__value",children:te}),e.jsx("div",{className:"stat-strip__label",children:"Total keys"})]}),e.jsxs("div",{className:"stat-strip__cell",children:[e.jsx("div",{className:"stat-strip__value stat-strip__value--accent",children:ie}),e.jsx("div",{className:"stat-strip__label",children:"Admin scope"})]}),e.jsxs("div",{className:"stat-strip__cell",children:[e.jsx("div",{className:"stat-strip__value",children:ne}),e.jsx("div",{className:"stat-strip__label",children:"Active in last 24h"})]})]}),n.length===0?e.jsxs("div",{className:"empty-state",children:[e.jsx("div",{className:"empty-state__icon",children:e.jsx(g,{size:28})}),e.jsx("h3",{className:"empty-state__title",children:"No API keys yet"}),e.jsx("p",{className:"empty-state__copy",children:"Issue your first key to authenticate WebDriver clients or CI pipelines. Keys are shown only once at creation — copy the value before closing the dialog."}),e.jsxs("button",{type:"button",className:"page-header-action empty-state__action",onClick:()=>d(!0),children:[e.jsx(v,{size:16}),e.jsx("span",{children:"Create your first key"})]})]}):e.jsx("div",{className:"data-card",children:e.jsxs(ce,{children:[e.jsx(de,{children:e.jsxs(z,{children:[e.jsx(l,{children:"Name"}),e.jsx(l,{children:"Team"}),e.jsx(l,{children:"Scopes"}),e.jsx(l,{children:"Rate limit"}),e.jsx(l,{children:"Last used"}),e.jsx(l,{children:"Created"}),e.jsx(l,{children:"Expires"}),e.jsx(l,{style:{textAlign:"right"},children:"Actions"})]})}),e.jsx(me,{children:n.map(s=>e.jsxs(z,{children:[e.jsxs(o,{children:[e.jsx("strong",{children:s.name}),e.jsx("div",{className:"row-meta-mono",children:s.id.slice(0,8)})]}),e.jsx(o,{children:e.jsx("span",{className:`pill-chip ${s.teamId?"pill-chip--team":"pill-chip--shared"}`,children:V(s.teamId)})}),e.jsx(o,{children:e.jsx("div",{className:"scope-chips",children:s.scopes.split(",").map(a=>{const c=a.trim(),re=c==="admin";return e.jsx("span",{className:`pill-chip ${re?"pill-chip--admin":"pill-chip--scope"}`,children:c},a)})})}),e.jsxs(o,{className:"row-mono",children:[s.rateLimit,"/min"]}),e.jsx(o,{className:"row-mono",children:q(s.lastUsedAt)}),e.jsx(o,{className:"row-mono",children:q(s.createdAt)}),e.jsx(o,{className:"row-mono",children:s.expiresAt?new Date(s.expiresAt).getTime()<=Date.now()?e.jsx("span",{style:{color:"var(--red)"},children:"expired"}):L(s.expiresAt):"Never"}),e.jsx(o,{style:{textAlign:"right"},children:e.jsxs("button",{type:"button",className:"row-action row-action--danger",disabled:C===s.id,onClick:()=>{window.confirm(`Revoke "${s.name}"? Any client using this key will immediately fail.`)&&se(s.id)},children:[e.jsx(pe,{size:13}),C===s.id?"Revoking…":"Revoke"]})})]},s.id))})]})})]}),e.jsx(B,{open:Q,title:"Create API key",width:520,onClose:()=>d(!1),footer:e.jsxs(e.Fragment,{children:[e.jsx(u,{variant:"secondary",onClick:()=>d(!1),disabled:x,children:"Cancel"}),e.jsxs(u,{variant:"primary",onClick:ee,disabled:x,children:[x?e.jsx($,{className:"animate-spin",size:18}):e.jsx(v,{size:18}),x?"Creating…":"Create key"]})]}),children:e.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.jsx(m,{label:"Name",htmlFor:"apikey-name",children:e.jsx(H,{id:"apikey-name",type:"text",value:p,onChange:s=>A(s.target.value),placeholder:"alice-laptop, ci-main, etc.",className:"w-full",autoFocus:!0})}),e.jsx(m,{label:"Scopes",description:e.jsxs(e.Fragment,{children:[e.jsx("code",{children:"admin"})," grants full access including API-key management."," ",e.jsx("code",{children:"sessions"})," is required for WebDriver ",e.jsx("code",{children:"xenon:accessKey"}),"."]}),children:e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:U.map(s=>e.jsxs("label",{style:ye,children:[e.jsx("input",{type:"checkbox",checked:j[s],onChange:a=>I({...j,[s]:a.target.checked})}),e.jsx("span",{children:s})]},s))})}),e.jsx(m,{label:"Rate limit (requests/min)",htmlFor:"apikey-ratelimit",children:e.jsx(H,{id:"apikey-ratelimit",type:"number",min:10,step:10,value:R,onChange:s=>P(parseInt(s.target.value)||300),className:"w-full"})}),e.jsx(m,{label:"Default team",description:e.jsxs(e.Fragment,{children:["Keys without a team can only reach shared-pool devices. Admins can override at session time via ",e.jsx("code",{children:"xenon:team"}),"."]}),htmlFor:"apikey-team",children:e.jsxs(M,{id:"apikey-team",value:E,onChange:s=>D(s.target.value),className:"w-full",children:[e.jsx("option",{value:"",children:"No team (shared pool only)"}),b.map(s=>e.jsx("option",{value:s.id,children:s.name},s.id))]})}),e.jsx(m,{label:"Expires after",description:h==="never"?"Key never expires. Rotate manually when needed.":`Key will stop working on ${L(Y(h))}.`,htmlFor:"apikey-expiry",children:e.jsx(M,{id:"apikey-expiry",value:h,onChange:s=>F(s.target.value),className:"w-full",children:Object.keys(W).map(s=>e.jsx("option",{value:s,children:W[s]},s))})})]})}),e.jsx(B,{open:!!r,title:r?`Key created: ${r.name}`:"",width:560,onClose:()=>y(null),closeOnOverlayClick:!1,footer:e.jsxs(e.Fragment,{children:[e.jsxs(u,{variant:"primary",onClick:()=>r&&ae(r.raw),disabled:!r,children:[T?e.jsx(he,{size:18}):e.jsx(xe,{size:18}),T?"Copied":"Copy to clipboard"]}),e.jsx(u,{variant:"secondary",onClick:()=>y(null),children:"I've saved it"})]}),children:r&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsxs("div",{style:{background:"var(--status-busy-bg)",border:"1px solid var(--status-busy-border)",borderRadius:6,padding:12,display:"flex",gap:8,alignItems:"flex-start"},children:[e.jsx(oe,{size:18,style:{flexShrink:0,marginTop:2}}),e.jsxs("div",{children:[e.jsx("strong",{children:"This key will not be shown again."})," Copy it now and store it in your password manager, CI secret store, or client config."]})]}),e.jsx("div",{style:{fontFamily:"monospace",padding:12,background:"rgb(var(--rgb-black) / 0.3)",borderRadius:6,wordBreak:"break-all",fontSize:"0.9em"},children:r.raw})]})})]})},ye={display:"flex",alignItems:"center",gap:6,padding:"6px 12px",background:"rgb(var(--rgb-white) / 0.04)",borderRadius:6,cursor:"pointer",fontFamily:"monospace",fontSize:"0.9em"};export{Pe as ApiKeys};
1
+ import{x as le,r as t,j as e,D as $,P as g,A as oe}from"./index-C9oFTvnK.js";/* empty css */import{a as L}from"./time-B8FIgwPE.js";import{T as ce,a as de,b as z,c as l,d as me,e as o}from"./Table-MzcW-imA.js";import{F as m}from"./FieldGroup-CuCZ8BNX.js";import{P as O}from"./page-header-CFA0PGbZ.js";import{M as B}from"./Modal-UoT1ee9F.js";import{B as u}from"./button-DnKYpdU4.js";import{I as H}from"./input-mjF8rl_B.js";import{S as M}from"./select-C-oZr2R0.js";import{P as v}from"./plus-BG0mAYNZ.js";import{T as pe}from"./trash-2-D1mEbpqi.js";import{C as he}from"./check-BPLHaAKw.js";import{C as xe}from"./copy-DHh97c2p.js";import"./utils-CDN07tui.js";const U=["read","sessions","devices","admin"],W={"7d":"7 days","30d":"30 days","90d":"90 days","1y":"1 year",never:"No expiry"},ue={"7d":7,"30d":30,"90d":90,"1y":365};function Y(i){return i==="never"?null:new Date(Date.now()+ue[i]*864e5).toISOString()}function q(i){if(!i)return"Never";const n=Date.now()-new Date(i).getTime();return n<6e4?"Just now":n<36e5?`${Math.floor(n/6e4)}m ago`:n<864e5?`${Math.floor(n/36e5)}h ago`:`${Math.floor(n/864e5)}d ago`}const Pe=()=>{const{toast:i}=le(),[n,w]=t.useState([]),[b,J]=t.useState([]),[X,N]=t.useState(!0),[G,k]=t.useState(!1),[Q,d]=t.useState(!1),[r,y]=t.useState(null),[C,S]=t.useState(null),[T,_]=t.useState(!1),[p,A]=t.useState(""),[j,I]=t.useState({read:!0,sessions:!0,devices:!1,admin:!1}),[R,P]=t.useState(300),[E,D]=t.useState(""),[h,F]=t.useState("30d"),[x,K]=t.useState(!1),V=s=>{var a;return s?((a=b.find(c=>c.id===s))==null?void 0:a.name)||s.slice(0,8):"Shared"},f=async()=>{N(!0);try{const[s,a]=await Promise.all([fetch("/xenon/api/apikeys",{credentials:"include"}),fetch("/xenon/api/teams",{credentials:"include"})]);if(s.status===403){k(!0),w([]);return}if(!s.ok)throw new Error(`HTTP ${s.status}`);w(await s.json()),a.ok&&J(await a.json()),k(!1)}catch(s){i(`Failed to load API keys: ${s.message}`,"error")}finally{N(!1)}};t.useEffect(()=>{f()},[]);const Z=()=>{A(""),I({read:!0,sessions:!0,devices:!1,admin:!1}),P(300),D(""),F("30d")},ee=async()=>{const s=U.filter(a=>j[a]);if(!p.trim()){i("Key name is required","error");return}if(s.length===0){i("Select at least one scope","error");return}K(!0);try{const a=await fetch("/xenon/api/apikeys",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:p.trim(),scopes:s,rateLimit:R,teamId:E||null,expiresAt:Y(h)})});if(!a.ok)throw new Error(`HTTP ${a.status}`);const c=await a.json();d(!1),Z(),y({name:p.trim(),raw:c.key}),await f()}catch(a){i(`Create failed: ${a.message}`,"error")}finally{K(!1)}},se=async s=>{S(s);try{const a=await fetch(`/xenon/api/apikeys/${s}`,{method:"DELETE",credentials:"include"});if(!a.ok)throw new Error(`HTTP ${a.status}`);i("Key revoked","success"),await f()}catch(a){i(`Revoke failed: ${a.message}`,"error")}finally{S(null)}},ae=async s=>{try{await navigator.clipboard.writeText(s),_(!0),setTimeout(()=>_(!1),1500)}catch{i("Copy failed — select the text manually","error")}};if(X)return e.jsxs("div",{className:"settings-loading",children:[e.jsx($,{className:"animate-spin",size:32}),e.jsx("span",{children:"Loading API keys…"})]});if(G)return e.jsx("div",{className:"settings-container",children:e.jsx(O,{icon:g,title:"API keys",subtitle:e.jsxs(e.Fragment,{children:["Your key lacks the ",e.jsx("code",{children:"admin"})," scope. Ask an administrator to issue an admin key so you can manage access for other users."]})})});const te=n.length,ie=n.filter(s=>s.scopes.includes("admin")).length,ne=n.filter(s=>s.lastUsedAt&&Date.now()-new Date(s.lastUsedAt).getTime()<864e5).length;return e.jsxs("div",{className:"settings-container",children:[e.jsx(O,{icon:g,title:"API keys",subtitle:e.jsxs(e.Fragment,{children:["Issue scoped credentials for humans (dashboard login) and machines (CI, WebDriver clients via ",e.jsx("code",{children:"xenon:accessKey"}),"). Keys are shown only once at creation — copy the value before closing the dialog."]}),action:e.jsxs("button",{type:"button",className:"page-header-action",onClick:()=>d(!0),children:[e.jsx(v,{size:16}),e.jsx("span",{children:"Create new key"})]})}),e.jsxs("div",{className:"settings-content",children:[n.length>0&&e.jsxs("div",{className:"stat-strip",children:[e.jsxs("div",{className:"stat-strip__cell",children:[e.jsx("div",{className:"stat-strip__value",children:te}),e.jsx("div",{className:"stat-strip__label",children:"Total keys"})]}),e.jsxs("div",{className:"stat-strip__cell",children:[e.jsx("div",{className:"stat-strip__value stat-strip__value--accent",children:ie}),e.jsx("div",{className:"stat-strip__label",children:"Admin scope"})]}),e.jsxs("div",{className:"stat-strip__cell",children:[e.jsx("div",{className:"stat-strip__value",children:ne}),e.jsx("div",{className:"stat-strip__label",children:"Active in last 24h"})]})]}),n.length===0?e.jsxs("div",{className:"empty-state",children:[e.jsx("div",{className:"empty-state__icon",children:e.jsx(g,{size:28})}),e.jsx("h3",{className:"empty-state__title",children:"No API keys yet"}),e.jsx("p",{className:"empty-state__copy",children:"Issue your first key to authenticate WebDriver clients or CI pipelines. Keys are shown only once at creation — copy the value before closing the dialog."}),e.jsxs("button",{type:"button",className:"page-header-action empty-state__action",onClick:()=>d(!0),children:[e.jsx(v,{size:16}),e.jsx("span",{children:"Create your first key"})]})]}):e.jsx("div",{className:"data-card",children:e.jsxs(ce,{children:[e.jsx(de,{children:e.jsxs(z,{children:[e.jsx(l,{children:"Name"}),e.jsx(l,{children:"Team"}),e.jsx(l,{children:"Scopes"}),e.jsx(l,{children:"Rate limit"}),e.jsx(l,{children:"Last used"}),e.jsx(l,{children:"Created"}),e.jsx(l,{children:"Expires"}),e.jsx(l,{style:{textAlign:"right"},children:"Actions"})]})}),e.jsx(me,{children:n.map(s=>e.jsxs(z,{children:[e.jsxs(o,{children:[e.jsx("strong",{children:s.name}),e.jsx("div",{className:"row-meta-mono",children:s.id.slice(0,8)})]}),e.jsx(o,{children:e.jsx("span",{className:`pill-chip ${s.teamId?"pill-chip--team":"pill-chip--shared"}`,children:V(s.teamId)})}),e.jsx(o,{children:e.jsx("div",{className:"scope-chips",children:s.scopes.split(",").map(a=>{const c=a.trim(),re=c==="admin";return e.jsx("span",{className:`pill-chip ${re?"pill-chip--admin":"pill-chip--scope"}`,children:c},a)})})}),e.jsxs(o,{className:"row-mono",children:[s.rateLimit,"/min"]}),e.jsx(o,{className:"row-mono",children:q(s.lastUsedAt)}),e.jsx(o,{className:"row-mono",children:q(s.createdAt)}),e.jsx(o,{className:"row-mono",children:s.expiresAt?new Date(s.expiresAt).getTime()<=Date.now()?e.jsx("span",{style:{color:"var(--red)"},children:"expired"}):L(s.expiresAt):"Never"}),e.jsx(o,{style:{textAlign:"right"},children:e.jsxs("button",{type:"button",className:"row-action row-action--danger",disabled:C===s.id,onClick:()=>{window.confirm(`Revoke "${s.name}"? Any client using this key will immediately fail.`)&&se(s.id)},children:[e.jsx(pe,{size:13}),C===s.id?"Revoking…":"Revoke"]})})]},s.id))})]})})]}),e.jsx(B,{open:Q,title:"Create API key",width:520,onClose:()=>d(!1),footer:e.jsxs(e.Fragment,{children:[e.jsx(u,{variant:"secondary",onClick:()=>d(!1),disabled:x,children:"Cancel"}),e.jsxs(u,{variant:"primary",onClick:ee,disabled:x,children:[x?e.jsx($,{className:"animate-spin",size:18}):e.jsx(v,{size:18}),x?"Creating…":"Create key"]})]}),children:e.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.jsx(m,{label:"Name",htmlFor:"apikey-name",children:e.jsx(H,{id:"apikey-name",type:"text",value:p,onChange:s=>A(s.target.value),placeholder:"alice-laptop, ci-main, etc.",className:"w-full",autoFocus:!0})}),e.jsx(m,{label:"Scopes",description:e.jsxs(e.Fragment,{children:[e.jsx("code",{children:"admin"})," grants full access including API-key management."," ",e.jsx("code",{children:"sessions"})," is required for WebDriver ",e.jsx("code",{children:"xenon:accessKey"}),"."]}),children:e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:U.map(s=>e.jsxs("label",{style:ye,children:[e.jsx("input",{type:"checkbox",checked:j[s],onChange:a=>I({...j,[s]:a.target.checked})}),e.jsx("span",{children:s})]},s))})}),e.jsx(m,{label:"Rate limit (requests/min)",htmlFor:"apikey-ratelimit",children:e.jsx(H,{id:"apikey-ratelimit",type:"number",min:10,step:10,value:R,onChange:s=>P(parseInt(s.target.value)||300),className:"w-full"})}),e.jsx(m,{label:"Default team",description:e.jsxs(e.Fragment,{children:["Keys without a team can only reach shared-pool devices. Admins can override at session time via ",e.jsx("code",{children:"xenon:team"}),"."]}),htmlFor:"apikey-team",children:e.jsxs(M,{id:"apikey-team",value:E,onChange:s=>D(s.target.value),className:"w-full",children:[e.jsx("option",{value:"",children:"No team (shared pool only)"}),b.map(s=>e.jsx("option",{value:s.id,children:s.name},s.id))]})}),e.jsx(m,{label:"Expires after",description:h==="never"?"Key never expires. Rotate manually when needed.":`Key will stop working on ${L(Y(h))}.`,htmlFor:"apikey-expiry",children:e.jsx(M,{id:"apikey-expiry",value:h,onChange:s=>F(s.target.value),className:"w-full",children:Object.keys(W).map(s=>e.jsx("option",{value:s,children:W[s]},s))})})]})}),e.jsx(B,{open:!!r,title:r?`Key created: ${r.name}`:"",width:560,onClose:()=>y(null),closeOnOverlayClick:!1,footer:e.jsxs(e.Fragment,{children:[e.jsxs(u,{variant:"primary",onClick:()=>r&&ae(r.raw),disabled:!r,children:[T?e.jsx(he,{size:18}):e.jsx(xe,{size:18}),T?"Copied":"Copy to clipboard"]}),e.jsx(u,{variant:"secondary",onClick:()=>y(null),children:"I've saved it"})]}),children:r&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsxs("div",{style:{background:"var(--status-busy-bg)",border:"1px solid var(--status-busy-border)",borderRadius:6,padding:12,display:"flex",gap:8,alignItems:"flex-start"},children:[e.jsx(oe,{size:18,style:{flexShrink:0,marginTop:2}}),e.jsxs("div",{children:[e.jsx("strong",{children:"This key will not be shown again."})," Copy it now and store it in your password manager, CI secret store, or client config."]})]}),e.jsx("div",{style:{fontFamily:"monospace",padding:12,background:"rgb(var(--rgb-black) / 0.3)",borderRadius:6,wordBreak:"break-all",fontSize:"0.9em"},children:r.raw})]})})]})},ye={display:"flex",alignItems:"center",gap:6,padding:"6px 12px",background:"rgb(var(--rgb-white) / 0.04)",borderRadius:6,cursor:"pointer",fontFamily:"monospace",fontSize:"0.9em"};export{Pe as ApiKeys};
@@ -1,9 +1,9 @@
1
- import{c as x,j as e,x as H,r,X as o,G as X,q as $,z as K,D as Z,y as J}from"./index-COp2dqp8.js";import{f as Q}from"./time-B8FIgwPE.js";import{c as ee,B as b}from"./button-DTHTbm66.js";import{c as se}from"./utils-CDN07tui.js";import{P as ae}from"./page-header-5o7AL-Si.js";import{S as te}from"./select-BqXgtuxg.js";import{U as re,T as E}from"./upload-Dalp13bU.js";import{C as ie}from"./check-DLl5QnWP.js";import{C as ce}from"./copy-BLyHAmgm.js";import{Z as ne}from"./zap-DQD0Ahbz.js";import{D as le}from"./download-BVTiAIU5.js";import{T as oe}from"./trash-2-HuAOeX9q.js";/**
1
+ import{c as x,j as e,x as H,r,X as o,G as X,q as I,z as K,D as Z,y as J}from"./index-C9oFTvnK.js";import{f as Q}from"./time-B8FIgwPE.js";import{c as ee,B as w}from"./button-DnKYpdU4.js";import{c as se}from"./utils-CDN07tui.js";import{P as ae}from"./page-header-CFA0PGbZ.js";import{S as te}from"./select-C-oZr2R0.js";import{U as re,T as $}from"./upload-C0fB1Ecv.js";import{C as ie}from"./check-BPLHaAKw.js";import{C as ce}from"./copy-DHh97c2p.js";import{Z as ne}from"./zap-CCkxgMnZ.js";import{D as le}from"./download-COSAREQK.js";import{T as oe}from"./trash-2-D1mEbpqi.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const de=[["path",{d:"M12 6.528V3a1 1 0 0 1 1-1h0",key:"11qiee"}],["path",{d:"M18.237 21A15 15 0 0 0 22 11a6 6 0 0 0-10-4.472A6 6 0 0 0 2 11a15.1 15.1 0 0 0 3.763 10 3 3 0 0 0 3.648.648 5.5 5.5 0 0 1 5.178 0A3 3 0 0 0 18.237 21",key:"110c12"}]],R=x("apple",de);/**
6
+ */const de=[["path",{d:"M12 6.528V3a1 1 0 0 1 1-1h0",key:"11qiee"}],["path",{d:"M18.237 21A15 15 0 0 0 22 11a6 6 0 0 0-10-4.472A6 6 0 0 0 2 11a15.1 15.1 0 0 0 3.763 10 3 3 0 0 0 3.648.648 5.5 5.5 0 0 1 5.178 0A3 3 0 0 0 18.237 21",key:"110c12"}]],E=x("apple",de);/**
7
7
  * @license lucide-react v0.555.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
@@ -18,4 +18,4 @@ import{c as x,j as e,x as H,r,X as o,G as X,q as $,z as K,D as Z,y as J}from"./i
18
18
  *
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
21
- */const ue=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],F=x("rocket",ue),ve=ee("badge-base",{variants:{variant:{default:"badge-variant-default",success:"badge-variant-success",warning:"badge-variant-warning",error:"badge-variant-error",outline:"badge-variant-outline",secondary:"badge-variant-secondary"}},defaultVariants:{variant:"default"}});function _({className:n,variant:u,...c}){return e.jsx("div",{className:se(ve({variant:u}),n),...c})}const De=()=>{const{toast:n,removeToast:u}=H(),[c,k]=r.useState([]),[L,U]=r.useState([]),[l,w]=r.useState(!1),[v,C]=r.useState(""),[A,z]=r.useState(!1),[B,S]=r.useState(null),[d,D]=r.useState({android:!0,ios:!0}),[f,G]=r.useState("desc"),[m,y]=r.useState(null),[j,g]=r.useState(""),T=r.useRef(null),p=r.useCallback(async()=>{w(!0);try{const s=await o.getApps();k(Array.isArray(s)?s:[])}catch(s){console.error("Failed to fetch apps",s)}finally{w(!1)}},[]),N=r.useCallback(async()=>{try{const s=await o.getDevices();U(Array.isArray(s)?s:[])}catch(s){console.error("Failed to fetch devices",s)}},[]);r.useEffect(()=>{p(),N();const s=setInterval(N,1e4);return()=>clearInterval(s)},[p,N]);const M=async s=>{var a;const t=(a=s.target.files)==null?void 0:a[0];if(t){z(!0);try{await o.uploadApp(t),await p()}catch(i){console.error("Upload failed",i)}finally{z(!1),s.target&&(s.target.value="")}}},O=async(s,t)=>{if(window.confirm(`Permanently remove artifact "${t}"?`))try{await o.deleteApp(s),k(a=>a.filter(i=>i.id!==s))}catch(a){console.error("Delete failed",a)}},P=(s,t)=>{navigator.clipboard.writeText(s),S(`${t}-${s}`),setTimeout(()=>S(null),2e3)},V=async(s,t)=>{const a=n(`Deploying app to ${t}...`,"loading",0);try{const i=await o.installRepositoryApp(t,s);i.success?(n("App deployed successfully","success"),y(null),g("")):n(`Deployment failed: ${i.error}`,"error")}catch(i){n(`Execution Error: ${i.message}`,"error")}finally{u(a)}},h=c.filter(s=>{const t=s.name.toLowerCase().includes(v.toLowerCase())||s.packageName&&s.packageName.toLowerCase().includes(v.toLowerCase()),a=d.android&&s.platform==="android"||d.ios&&s.platform==="ios";return t&&a}).sort((s,t)=>{const a=new Date(s.createdAt).getTime(),i=new Date(t.createdAt).getTime();return f==="desc"?i-a:a-i}),q=s=>{if(!s)return"0 B";const t=1024,a=Math.floor(Math.log(s)/Math.log(t));return parseFloat((s/Math.pow(t,a)).toFixed(1))+" "+["B","KB","MB","GB"][a]},W=s=>Q(s),I=s=>{D(t=>({...t,[s]:!t[s]}))},Y=s=>{const t=s.toLowerCase();return t.includes("wda-signed")||t.includes("wda-resign")||t.includes("webdriveragent")};return e.jsxs("div",{className:"apps-container device-explorer-container",children:[e.jsx("div",{className:"scanline",style:{position:"absolute",inset:0,pointerEvents:"none",opacity:.05,zIndex:1001}}),e.jsx(ae,{icon:X,title:"Apps",subtitle:"Signed builds available for installation across your device fleet."}),e.jsxs("div",{className:"device-explorer-header-container",children:[e.jsxs("div",{className:"device-explorer-header-left-container",children:[e.jsx("div",{className:"device-explorer-header-entry",children:e.jsxs("div",{className:"device-explorer-header-value",children:[e.jsxs("button",{className:`device-explorer-header__platform-btn ${d.android&&"selected"}`,onClick:()=>I("android"),children:[e.jsx($,{size:18,color:"currentColor"})," Android"]}),e.jsxs("button",{className:`device-explorer-header__platform-btn ${d.ios&&"selected"}`,onClick:()=>I("ios"),children:[e.jsx(R,{size:18,color:"currentColor"})," iOS"]})]})}),e.jsx("div",{className:"device-explorer-header-entry",children:e.jsx("div",{className:"device-explorer-header-value",children:e.jsxs("div",{className:"device-explorer-search-wrapper",children:[e.jsx(K,{size:16,color:"#94a3b8",className:"device-explorer-search-icon"}),e.jsx("input",{type:"text",className:"device-explorer-header-text-filter",placeholder:"Filter by bundle or name...",value:v,onChange:s=>C(s.target.value)})]})})}),e.jsx("div",{className:"device-explorer-header-filter-count",children:e.jsxs(_,{variant:"secondary",children:[e.jsx("span",{className:"font-bold",children:h.length})," of"," ",e.jsx("span",{className:"font-bold",children:c.length})," ",c.length===1?"artifact":"artifacts"]})})]}),e.jsxs("div",{className:"device-explorer-header-right-container",children:[e.jsx("button",{className:"icon-btn-secondary sort-btn",onClick:()=>G(s=>s==="desc"?"asc":"desc"),title:f==="desc"?"Newest First":"Oldest First",children:f==="desc"?e.jsx(pe,{size:18}):e.jsx(xe,{size:18})}),e.jsxs(b,{size:"sm",variant:"secondary",onClick:()=>p(),disabled:l,children:[e.jsx(Z,{size:14,className:`mr-1 ${l&&"animate-spin"}`}),"Refresh"]}),e.jsx("input",{ref:T,type:"file",accept:".apk,.ipa",onChange:M,hidden:!0}),e.jsxs(b,{size:"sm",variant:"primary",onClick:()=>{var s;return(s=T.current)==null?void 0:s.click()},disabled:A,children:[e.jsx(re,{size:14,className:"mr-1"}),"Upload app"]})]})]}),e.jsx("main",{className:"apps-registry-content",children:l&&c.length===0?e.jsxs("div",{className:"empty-data-vignette",children:[e.jsx("div",{className:"processing-loader"}),e.jsx("p",{className:"text-muted text-xs font-bold tracking-widest",children:"SYNCING REGISTRY..."})]}):e.jsxs(e.Fragment,{children:[h.length>0&&e.jsxs("div",{className:"registry-table-header",children:[e.jsx("div",{children:"Artifact bundle"}),e.jsx("div",{children:"Version"}),e.jsx("div",{children:"Size"}),e.jsx("div",{children:"Registry date"}),e.jsx("div",{style:{textAlign:"right"},children:"Management"})]}),e.jsx("div",{className:"registry-list",children:h.map(s=>{const t=L.filter(a=>a.platform===s.platform&&!a.busy&&!a.offline);return e.jsxs("div",{className:`artifact-row ${s.platform}`,children:[e.jsxs("div",{className:"col-app-info",children:[e.jsx("div",{className:"app-platform-badge",children:s.platform==="android"?e.jsx($,{size:18}):e.jsx(R,{size:18})}),e.jsxs("div",{className:"app-text-block",children:[e.jsxs("div",{className:"app-display-name",title:s.name,children:[s.name,Y(s.name)&&e.jsx(_,{variant:"outline",className:"ml-2 text-[10px] h-4 py-0 border-primary text-primary",children:"WDA"})]}),e.jsxs("div",{className:"app-package-id",children:[e.jsx("code",{children:s.packageName||"internal.bundle"}),s.packageName&&e.jsx("div",{className:"copy-hint",title:`Copy ${s.packageName}`,onClick:()=>P(s.packageName,"pkg"),children:B===`pkg-${s.packageName}`?e.jsx(ie,{size:10,className:"text-primary"}):e.jsx(ce,{size:10})})]})]})]}),e.jsx("div",{className:"col-version",children:s.version||"v1.0.0"}),e.jsx("div",{className:"col-size",children:q(s.size)}),e.jsx("div",{className:"col-timestamp",children:W(s.createdAt)}),e.jsxs("div",{className:"col-actions",children:[e.jsx("button",{className:`instant-deploy-trigger ${m===s.id&&"active"}`,onClick:()=>{m===s.id?(y(null),g("")):y(s.id)},children:m===s.id?e.jsxs(e.Fragment,{children:[e.jsx(J,{size:12})," CANCEL"]}):e.jsxs(e.Fragment,{children:[e.jsx(ne,{size:12})," Deploy"]})}),m===s.id&&e.jsx("div",{className:"deployment-flyout",children:t.length>0?e.jsxs("div",{className:"deploy-actions-group",children:[e.jsxs(te,{selectSize:"sm",className:"min-w-[280px]",autoFocus:!0,value:j,onChange:a=>g(a.target.value),children:[e.jsx("option",{value:"",children:"SELECT TARGET..."}),t.map(a=>e.jsxs("option",{value:a.udid,children:[a.name," (",a.udid,")"]},a.udid))]}),e.jsx("button",{className:"confirm-deploy-btn",disabled:!j,onClick:()=>V(s.id,j),title:"Confirm deployment",children:e.jsx(F,{size:14})})]}):e.jsx("div",{className:"target-device-select empty",children:"NO TARGETS"})}),e.jsx("button",{className:"utility-icon-btn",onClick:()=>window.open(`/xenon/api/apps/${s.id}/download`,"_blank"),children:e.jsx(le,{size:14})}),e.jsx("button",{className:"utility-icon-btn danger",onClick:()=>O(s.id,s.name),children:e.jsx(oe,{size:14})})]})]},s.id)})}),h.length===0&&c.length>0&&!l&&e.jsxs("div",{className:"empty-registry-technical",children:[e.jsx("div",{className:"empty-icon-container",children:e.jsx(E,{size:48,className:"text-primary opacity-40"})}),e.jsx("h2",{className:"empty-title brand-font",children:"No matching artifacts"}),e.jsxs("p",{className:"empty-description",children:[c.length," ",c.length===1?"artifact is":"artifacts are"," registered, but none match the current filter."]}),e.jsx("div",{className:"empty-actions",children:e.jsx(b,{size:"sm",variant:"default",onClick:()=>{C(""),D({android:!0,ios:!0})},children:"Clear filters"})})]}),c.length===0&&!l&&e.jsxs("div",{className:"empty-registry-technical",children:[e.jsx("div",{className:"empty-icon-container",children:e.jsx(E,{size:48,className:"text-primary opacity-40 animate-pulse"})}),e.jsx("h2",{className:"empty-title brand-font",children:"No apps yet"}),e.jsxs("p",{className:"empty-description",children:["Upload ",e.jsx("code",{className:"text-primary",children:".apk"})," or"," ",e.jsx("code",{className:"text-primary",children:".ipa"})," artifacts to enable versioned installs across your device fleet."]}),e.jsx("div",{className:"empty-actions",children:e.jsxs("label",{className:"upload-trigger-massive",children:[e.jsx("input",{type:"file",accept:".apk,.ipa",onChange:M,style:{display:"none"}}),e.jsxs("div",{className:"massive-upload-content",children:[e.jsx(F,{size:24,className:"mb-2"}),e.jsx("span",{children:"Upload your first app"})]})]})})]})]})}),A&&e.jsx("div",{className:"upload-overlay-technical",children:e.jsxs("div",{className:"upload-card-technical",children:[e.jsx("div",{className:"processing-loader"}),e.jsx("h2",{className:"brand-font",style:{fontSize:"20px",marginBottom:"8px"},children:"Artifact ingestion"}),e.jsx("p",{className:"text-muted text-xs",children:"VERIFYING CHECKSUM & DEPLOYING TO REGISTRY..."})]})})]})};export{De as default};
21
+ */const ue=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],R=x("rocket",ue),ve=ee("badge-base",{variants:{variant:{default:"badge-variant-default",success:"badge-variant-success",warning:"badge-variant-warning",error:"badge-variant-error",outline:"badge-variant-outline",secondary:"badge-variant-secondary"}},defaultVariants:{variant:"default"}});function F({className:n,variant:u,...c}){return e.jsx("div",{className:se(ve({variant:u}),n),...c})}const De=()=>{const{toast:n,removeToast:u}=H(),[c,C]=r.useState([]),[_,L]=r.useState([]),[l,A]=r.useState(!1),[v,z]=r.useState(""),[f,S]=r.useState(!1),[U,D]=r.useState(null),[d,T]=r.useState({android:!0,ios:!0}),[y,B]=r.useState("desc"),[m,j]=r.useState(null),[g,N]=r.useState(""),b=r.useRef(null),p=r.useCallback(async()=>{A(!0);try{const s=await o.getApps();C(Array.isArray(s)?s:[])}catch(s){console.error("Failed to fetch apps",s)}finally{A(!1)}},[]),k=r.useCallback(async()=>{try{const s=await o.getDevices();L(Array.isArray(s)?s:[])}catch(s){console.error("Failed to fetch devices",s)}},[]);r.useEffect(()=>{p(),k();const s=setInterval(k,1e4);return()=>clearInterval(s)},[p,k]);const G=async s=>{var a;const t=(a=s.target.files)==null?void 0:a[0];if(t){S(!0);try{await o.uploadApp(t),await p()}catch(i){console.error("Upload failed",i)}finally{S(!1),s.target&&(s.target.value="")}}},O=async(s,t)=>{if(window.confirm(`Permanently remove artifact "${t}"?`))try{await o.deleteApp(s),C(a=>a.filter(i=>i.id!==s))}catch(a){console.error("Delete failed",a)}},P=(s,t)=>{navigator.clipboard.writeText(s),D(`${t}-${s}`),setTimeout(()=>D(null),2e3)},V=async(s,t)=>{const a=n(`Deploying app to ${t}...`,"loading",0);try{const i=await o.installRepositoryApp(t,s);i.success?(n("App deployed successfully","success"),j(null),N("")):n(`Deployment failed: ${i.error}`,"error")}catch(i){n(`Execution Error: ${i.message}`,"error")}finally{u(a)}},h=c.filter(s=>{const t=s.name.toLowerCase().includes(v.toLowerCase())||s.packageName&&s.packageName.toLowerCase().includes(v.toLowerCase()),a=d.android&&s.platform==="android"||d.ios&&s.platform==="ios";return t&&a}).sort((s,t)=>{const a=new Date(s.createdAt).getTime(),i=new Date(t.createdAt).getTime();return y==="desc"?i-a:a-i}),q=s=>{if(!s)return"0 B";const t=1024,a=Math.floor(Math.log(s)/Math.log(t));return parseFloat((s/Math.pow(t,a)).toFixed(1))+" "+["B","KB","MB","GB"][a]},W=s=>Q(s),M=s=>{T(t=>({...t,[s]:!t[s]}))},Y=s=>{const t=s.toLowerCase();return t.includes("wda-signed")||t.includes("wda-resign")||t.includes("webdriveragent")};return e.jsxs("div",{className:"apps-container device-explorer-container",children:[e.jsx("div",{className:"scanline",style:{position:"absolute",inset:0,pointerEvents:"none",opacity:.05,zIndex:1001}}),e.jsx(ae,{icon:X,title:"Apps",subtitle:"Signed builds available for installation across your device fleet."}),e.jsxs("div",{className:"device-explorer-header-container",children:[e.jsxs("div",{className:"device-explorer-header-left-container",children:[e.jsx("div",{className:"device-explorer-header-entry",children:e.jsxs("div",{className:"device-explorer-header-value",children:[e.jsxs("button",{className:`device-explorer-header__platform-btn ${d.android&&"selected"}`,onClick:()=>M("android"),children:[e.jsx(I,{size:18,color:"currentColor"})," Android"]}),e.jsxs("button",{className:`device-explorer-header__platform-btn ${d.ios&&"selected"}`,onClick:()=>M("ios"),children:[e.jsx(E,{size:18,color:"currentColor"})," iOS"]})]})}),e.jsx("div",{className:"device-explorer-header-entry",children:e.jsx("div",{className:"device-explorer-header-value",children:e.jsxs("div",{className:"device-explorer-search-wrapper",children:[e.jsx(K,{size:16,color:"#94a3b8",className:"device-explorer-search-icon"}),e.jsx("input",{type:"text",className:"device-explorer-header-text-filter",placeholder:"Filter by bundle or name...",value:v,onChange:s=>z(s.target.value)})]})})}),e.jsx("div",{className:"device-explorer-header-filter-count",children:e.jsxs(F,{variant:"secondary",children:[e.jsx("span",{className:"font-bold",children:h.length})," of"," ",e.jsx("span",{className:"font-bold",children:c.length})," ",c.length===1?"artifact":"artifacts"]})})]}),e.jsxs("div",{className:"device-explorer-header-right-container",children:[e.jsx("button",{className:"icon-btn-secondary sort-btn",onClick:()=>B(s=>s==="desc"?"asc":"desc"),title:y==="desc"?"Newest First":"Oldest First",children:y==="desc"?e.jsx(pe,{size:18}):e.jsx(xe,{size:18})}),e.jsxs(w,{size:"sm",variant:"secondary",onClick:()=>p(),disabled:l,children:[e.jsx(Z,{size:14,className:`mr-1 ${l&&"animate-spin"}`}),"Refresh"]}),e.jsx("input",{ref:b,type:"file",accept:".apk,.ipa",onChange:G,hidden:!0}),e.jsxs(w,{size:"sm",variant:"primary",onClick:()=>{var s;return(s=b.current)==null?void 0:s.click()},disabled:f,children:[e.jsx(re,{size:14,className:"mr-1"}),"Upload app"]})]})]}),e.jsx("main",{className:"apps-registry-content",children:l&&c.length===0?e.jsxs("div",{className:"empty-data-vignette",children:[e.jsx("div",{className:"processing-loader"}),e.jsx("p",{className:"text-muted text-xs font-bold tracking-widest",children:"SYNCING REGISTRY..."})]}):e.jsxs(e.Fragment,{children:[h.length>0&&e.jsxs("div",{className:"registry-table-header",children:[e.jsx("div",{children:"Artifact bundle"}),e.jsx("div",{children:"Version"}),e.jsx("div",{children:"Size"}),e.jsx("div",{children:"Registry date"}),e.jsx("div",{style:{textAlign:"right"},children:"Management"})]}),e.jsx("div",{className:"registry-list",children:h.map(s=>{const t=_.filter(a=>a.platform===s.platform&&!a.busy&&!a.offline);return e.jsxs("div",{className:`artifact-row ${s.platform}`,children:[e.jsxs("div",{className:"col-app-info",children:[e.jsx("div",{className:"app-platform-badge",children:s.platform==="android"?e.jsx(I,{size:18}):e.jsx(E,{size:18})}),e.jsxs("div",{className:"app-text-block",children:[e.jsxs("div",{className:"app-display-name",title:s.name,children:[s.name,Y(s.name)&&e.jsx(F,{variant:"outline",className:"ml-2 text-[10px] h-4 py-0 border-primary text-primary",children:"WDA"})]}),e.jsxs("div",{className:"app-package-id",children:[e.jsx("code",{children:s.packageName||"internal.bundle"}),s.packageName&&e.jsx("div",{className:"copy-hint",title:`Copy ${s.packageName}`,onClick:()=>P(s.packageName,"pkg"),children:U===`pkg-${s.packageName}`?e.jsx(ie,{size:10,className:"text-primary"}):e.jsx(ce,{size:10})})]})]})]}),e.jsx("div",{className:"col-version",children:s.version||"v1.0.0"}),e.jsx("div",{className:"col-size",children:q(s.size)}),e.jsx("div",{className:"col-timestamp",children:W(s.createdAt)}),e.jsxs("div",{className:"col-actions",children:[e.jsx("button",{className:`instant-deploy-trigger ${m===s.id&&"active"}`,onClick:()=>{m===s.id?(j(null),N("")):j(s.id)},children:m===s.id?e.jsxs(e.Fragment,{children:[e.jsx(J,{size:12})," CANCEL"]}):e.jsxs(e.Fragment,{children:[e.jsx(ne,{size:12})," Deploy"]})}),m===s.id&&e.jsx("div",{className:"deployment-flyout",children:t.length>0?e.jsxs("div",{className:"deploy-actions-group",children:[e.jsxs(te,{selectSize:"sm",className:"min-w-[280px]",autoFocus:!0,value:g,onChange:a=>N(a.target.value),children:[e.jsx("option",{value:"",children:"SELECT TARGET..."}),t.map(a=>e.jsxs("option",{value:a.udid,children:[a.name," (",a.udid,")"]},a.udid))]}),e.jsx("button",{className:"confirm-deploy-btn",disabled:!g,onClick:()=>V(s.id,g),title:"Confirm deployment",children:e.jsx(R,{size:14})})]}):e.jsx("div",{className:"target-device-select empty",children:"NO TARGETS"})}),e.jsx("button",{className:"utility-icon-btn",onClick:()=>window.open(`/xenon/api/apps/${s.id}/download`,"_blank"),children:e.jsx(le,{size:14})}),e.jsx("button",{className:"utility-icon-btn danger",onClick:()=>O(s.id,s.name),children:e.jsx(oe,{size:14})})]})]},s.id)})}),h.length===0&&c.length>0&&!l&&e.jsxs("div",{className:"empty-registry-technical",children:[e.jsx("div",{className:"empty-icon-container",children:e.jsx($,{size:48,className:"text-primary opacity-40"})}),e.jsx("h2",{className:"empty-title brand-font",children:"No matching artifacts"}),e.jsxs("p",{className:"empty-description",children:[c.length," ",c.length===1?"artifact is":"artifacts are"," registered, but none match the current filter."]}),e.jsx("div",{className:"empty-actions",children:e.jsx(w,{size:"sm",variant:"default",onClick:()=>{z(""),T({android:!0,ios:!0})},children:"Clear filters"})})]}),c.length===0&&!l&&e.jsxs("div",{className:"empty-registry-technical",children:[e.jsx("div",{className:"empty-icon-container",children:e.jsx($,{size:48,className:"text-primary opacity-40 animate-pulse"})}),e.jsx("h2",{className:"empty-title brand-font",children:"No apps yet"}),e.jsxs("p",{className:"empty-description",children:["Upload ",e.jsx("code",{className:"text-primary",children:".apk"})," or"," ",e.jsx("code",{className:"text-primary",children:".ipa"})," artifacts to enable versioned installs across your device fleet."]}),e.jsx("div",{className:"empty-actions",children:e.jsx("button",{type:"button",className:"upload-trigger-massive",onClick:()=>{var s;return(s=b.current)==null?void 0:s.click()},disabled:f,children:e.jsxs("span",{className:"massive-upload-content",children:[e.jsx(R,{size:24,className:"mb-2"}),e.jsx("span",{children:"Upload your first app"})]})})})]})]})}),f&&e.jsx("div",{className:"upload-overlay-technical",children:e.jsxs("div",{className:"upload-card-technical",children:[e.jsx("div",{className:"processing-loader"}),e.jsx("h2",{className:"brand-font",style:{fontSize:"20px",marginBottom:"8px"},children:"Artifact ingestion"}),e.jsx("p",{className:"text-muted text-xs",children:"VERIFYING CHECKSUM & DEPLOYING TO REGISTRY..."})]})})]})};export{De as default};
@@ -0,0 +1 @@
1
+ .apps-container{display:flex;flex-direction:column;height:100%;width:100%}.apps-registry-content{flex:1;overflow-y:auto;padding:var(--space-4) 24px;background:var(--bg)}.registry-table-header{display:grid;grid-template-columns:3fr 1fr 1fr 1.5fr 1.5fr;padding:12px 24px;border-bottom:2px solid var(--border);color:var(--text-dim);font-size:11px;font-weight:700;background:rgb(var(--rgb-well) / calc(.2 * var(--well-k)))}.registry-list{display:flex;flex-direction:column}.artifact-row{display:grid;grid-template-columns:3fr 1fr 1fr 1.5fr 1.5fr;align-items:center;padding:12px 24px;background:rgb(var(--rgb-well) / calc(.1 * var(--well-k)));border-bottom:1px solid var(--border);transition:all .2s ease;position:relative}.artifact-row:hover{background:rgb(var(--rgb-fg) / .02)}.artifact-row.active{background:rgb(var(--rgb-accent) / .05);border-left:3px solid var(--color-accent)}.col-app-info{display:flex;align-items:center;gap:16px;min-width:0}.app-platform-badge{width:32px;height:32px;background:rgb(var(--rgb-well) / calc(.4 * var(--well-k)));border:1px solid var(--border);border-radius:6px;display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--text-dim)}.artifact-row.android .app-platform-badge{color:var(--color-accent);border-color:rgb(var(--rgb-accent) / .2)}.artifact-row.ios .app-platform-badge{color:var(--text);border-color:var(--border)}.app-text-block{display:flex;flex-direction:column;min-width:0}.app-display-name{font-size:13px;font-weight:700;color:var(--text);font-family:Outfit,sans-serif;margin-bottom:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.app-package-id{font-family:JetBrains Mono,monospace;font-size:11px;color:var(--text-dim);opacity:.8;display:flex;align-items:center;gap:6px}.col-version{font-family:JetBrains Mono,monospace;font-size:11px;color:var(--color-accent);font-weight:600}.col-size{font-family:JetBrains Mono,monospace;font-size:11px;color:var(--text-muted)}.col-timestamp{font-size:11px;color:var(--text-dim)}.col-actions{display:flex;align-items:center;justify-content:flex-end;gap:12px}.instant-deploy-trigger{height:28px;background:rgb(var(--rgb-accent) / .05);border:1px solid var(--color-accent);border-radius:6px;padding:0 12px;display:flex;align-items:center;gap:8px;color:var(--color-accent);font-size:11px;font-weight:700;transition:all .2s;cursor:pointer}.instant-deploy-trigger:hover:not(:disabled){background:var(--color-accent);color:var(--bg);box-shadow:none}.utility-icon-btn{width:28px;height:28px;background:rgb(var(--rgb-well) / calc(.3 * var(--well-k)));border:1px solid var(--border);border-radius:6px;display:flex;align-items:center;justify-content:center;color:var(--text-dim);transition:all .2s}.utility-icon-btn:hover{border-color:var(--border);color:var(--text)}.utility-icon-btn.danger:hover{color:var(--status-error-fg)}.device-explorer-header-container{display:flex;justify-content:space-between;align-items:center;padding:12px 24px;background:#0f0f1a66;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border-bottom:1px solid var(--border);z-index:15;gap:16px;flex-wrap:wrap}.device-explorer-header-left-container{display:flex;align-items:center;gap:24px;flex:1;min-width:0;flex-wrap:wrap}.device-explorer-header-right-container{display:flex;align-items:center;gap:12px}.device-explorer-header-filter-count{margin-left:8px}@media (max-width: 900px){.device-explorer-header-container{flex-direction:column;align-items:stretch;padding:12px 16px}.device-explorer-header-left-container{flex-direction:column;align-items:stretch;gap:12px}.device-explorer-header-left-container>*{width:100%;min-width:0}.device-explorer-header-right-container{justify-content:flex-end;flex-wrap:wrap}}.icon-btn-secondary{width:32px;height:32px;background:rgb(var(--rgb-fg) / .03);border:1px solid var(--border);border-radius:6px;display:flex;align-items:center;justify-content:center;color:var(--text-dim);cursor:pointer;transition:all .2s ease}.icon-btn-secondary:hover{background:rgb(var(--rgb-fg) / .08);color:var(--text);border-color:var(--border)}.deployment-flyout{position:absolute;top:50%;padding:6px;right:180px;transform:translateY(-50%);background:var(--surface);border:1px solid var(--color-accent);border-radius:8px;box-shadow:0 10px 40px rgb(var(--rgb-black) / calc(.6 * var(--shadow-k)));z-index:110;display:flex;gap:4px;animation:slideInRight .2s cubic-bezier(.16,1,.3,1)}@keyframes slideInRight{0%{opacity:0;transform:translateY(-50%) translate(10px)}to{opacity:1;transform:translateY(-50%) translate(0)}}.target-device-select{height:32px;background:rgb(var(--rgb-well) / calc(.25 * var(--well-k)));border:1px solid var(--border);border-radius:6px;color:var(--text);font-size:11px;font-weight:600;padding:0 12px;min-width:280px;outline:none;cursor:pointer;transition:all .2s ease;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 8px center}.target-device-select:hover{border-color:var(--color-accent);background-color:rgb(var(--rgb-well) / calc(.4 * var(--well-k)))}.target-device-select option{background:var(--surface);color:var(--text);padding:8px}.target-device-select.empty{display:flex;align-items:center;justify-content:center;padding:0 20px;height:32px;font-style:italic;opacity:.5;font-size:11px}.deploy-actions-group{display:flex;align-items:center;gap:6px}.confirm-deploy-btn{width:32px;height:32px;background:var(--color-accent);border:none;border-radius:6px;display:flex;align-items:center;justify-content:center;color:var(--color-on-accent);cursor:pointer;transition:all .2s cubic-bezier(.4,0,.2,1)}.confirm-deploy-btn:hover:not(:disabled){background:var(--color-accent-strong);transform:scale(1.05);box-shadow:none}.confirm-deploy-btn:disabled{background:rgb(var(--rgb-fg) / .1);color:rgb(var(--rgb-fg) / .2);cursor:not-allowed}.upload-overlay-technical{position:fixed;top:0;right:0;bottom:0;left:0;background:#020617d9;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);z-index:2000;display:flex;align-items:center;justify-content:center}.upload-card-technical{width:420px;background:var(--surface);border:1px solid var(--border);border-radius:16px;padding:40px;text-align:center;box-shadow:0 30px 60px rgb(var(--rgb-black) / calc(.6 * var(--shadow-k)))}.processing-loader{width:40px;height:40px;border:2px solid rgb(var(--rgb-accent) / .1);border-top-color:var(--color-accent);border-radius:50%;margin:0 auto 20px;animation:spin 1s linear infinite}.empty-registry-technical{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:100px 20px;text-align:center;max-width:600px;margin:0 auto}.empty-icon-container{width:100px;height:100px;background:radial-gradient(circle,rgb(var(--rgb-blue) / .1) 0%,transparent 70%);display:flex;align-items:center;justify-content:center;border-radius:50%;margin-bottom:24px}.empty-title{font-size:28px;font-weight:800;color:var(--text);margin-bottom:16px;letter-spacing:-.02em}.empty-description{font-size:14px;line-height:1.6;color:var(--text-muted);margin-bottom:40px}.empty-description code{background:rgb(var(--rgb-blue) / .1);padding:2px 6px;border-radius:4px;font-weight:600}.upload-trigger-massive{cursor:pointer;display:block;border-radius:8px}.upload-trigger-massive:focus-visible{outline:2px solid var(--color-focus-ring);outline-offset:4px}.massive-upload-content{display:flex;flex-direction:column;align-items:center;padding:30px 60px;background:var(--surface);border:1px solid var(--color-accent);box-shadow:none;border-radius:8px;color:var(--color-accent);font-weight:700;font-size:16px;transition:all .3s cubic-bezier(.4,0,.2,1);box-shadow:0 0 0 transparent}.massive-upload-content:hover{background:rgb(var(--rgb-blue) / .05);transform:translateY(-4px);box-shadow:none;border-style:solid}.massive-upload-content svg{transition:transform .3s ease}.massive-upload-content:hover svg{transform:translateY(-4px) scale(1.1)}.copy-hint{cursor:pointer;opacity:.4;transition:opacity .2s}.copy-hint:hover{opacity:1}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (min-width: 1401px){.apps-registry-content{padding:0 24px 24px}}.device-explorer-container{display:flex;flex-direction:column;width:100%;gap:var(--space-4)}.device-explorer-header-entry{display:flex;flex-direction:column;gap:4px;min-width:0}.device-explorer-header-value{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.device-explorer-header-value>.device-explorer-header__platform-btn+.device-explorer-header__platform-btn{margin-left:4px}.device-explorer-header__platform-btn{display:flex;align-items:center;gap:6px;padding:6px 12px;border-radius:6px;background:rgb(var(--rgb-well) / calc(.4 * var(--well-k)));border:1px solid var(--border);color:var(--text-muted);font-size:12px;font-weight:600;cursor:pointer;transition:all .2s ease}.device-explorer-header__platform-btn:hover{background:rgb(var(--rgb-fg) / .03);color:var(--text);border-color:var(--border)}.device-explorer-header__platform-btn.selected{background:rgb(var(--rgb-accent) / .05);color:var(--color-accent);border-color:rgb(var(--rgb-accent) / .3);box-shadow:none}.device-explorer-search-wrapper{position:relative;width:320px}.device-explorer-search-icon{position:absolute;left:12px;top:50%;transform:translateY(-50%);pointer-events:none;opacity:.5}.device-explorer-header-text-filter{width:100%;height:32px;padding:0 12px 0 36px;border-radius:6px;border:1px solid var(--border);background:rgb(var(--rgb-well) / calc(.4 * var(--well-k)));font-family:JetBrains Mono,monospace;font-size:12px;color:var(--text);transition:all .2s ease}.device-explorer-header-text-filter:focus{outline:none;border-color:var(--color-accent);background:rgb(var(--rgb-well) / calc(.6 * var(--well-k)));box-shadow:none}.device-explorer-header-text-filter::placeholder{color:var(--text-dim);font-size:11px}:root[data-theme=light] .device-explorer-header-container{background:rgb(var(--rgb-white) / .7)}.badge-base{display:inline-flex;align-items:center;gap:6px;border-radius:6px;border:1px solid transparent;padding:2px 8px;font-size:11px;font-weight:800;transition:all .2s ease;white-space:nowrap}.badge-variant-default{background:rgb(var(--rgb-well) / calc(.3 * var(--well-k)));color:var(--text-dim);border-color:var(--border)}.badge-variant-success{background:rgb(var(--rgb-success) / .05);color:var(--color-success);border-color:rgb(var(--rgb-success) / .2)}.badge-variant-warning{background:#ffc1070d;color:#ffc107;border-color:#ffc10733}.badge-variant-error{background:rgb(var(--rgb-red-alt) / .05);color:var(--red-alt);border-color:rgb(var(--rgb-red-alt) / .2)}.badge-variant-secondary{background:var(--surface);color:var(--text);border-color:var(--border)}.badge-variant-outline{background:transparent;color:var(--text-dim);border:1px solid var(--border)}.badge-variant-outline:hover{color:var(--text);border-color:var(--text-muted)}:root[data-theme=light] .badge-variant-warning{background:rgb(var(--rgb-amber) / .08);color:var(--amber);border-color:rgb(var(--rgb-amber) / .3)}
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-COp2dqp8.js";/**
1
+ import{c as o}from"./index-C9oFTvnK.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-COp2dqp8.js";/**
1
+ import{c as o}from"./index-C9oFTvnK.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-COp2dqp8.js";/**
1
+ import{c as o}from"./index-C9oFTvnK.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.