@camstack/addon-admin-ui 1.2.162 → 1.2.163
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.
- package/dist/assets/{AddonCollectionPage-CVXlT82P.js → AddonCollectionPage-BS7Dz27s.js} +1 -1
- package/dist/assets/{Addons-X-B5Zu2Z.js → Addons-C1Xl01yI.js} +1 -1
- package/dist/assets/{AdminTabs-C0HjPryL.js → AdminTabs-B1ahCroj.js} +1 -1
- package/dist/assets/{AiProfiles-zZCUJWMi.js → AiProfiles-CgNqwply.js} +1 -1
- package/dist/assets/{BrokerForm-ChQ7nWwo.js → BrokerForm-CXT-1grT.js} +1 -1
- package/dist/assets/{Build-CaN90jcN.js → Build-CF_5wvIB.js} +1 -1
- package/dist/assets/{Capabilities-DpB1PQHe.js → Capabilities-ky21T3-L.js} +1 -1
- package/dist/assets/{CapabilityBadges-CqryAsPv.js → CapabilityBadges-B6R-69B1.js} +1 -1
- package/dist/assets/{Cluster-G1IfcoJk.js → Cluster-BS1Pnvb5.js} +1 -1
- package/dist/assets/{Data-Dra2xNmy.js → Data-C1vtiQWy.js} +1 -1
- package/dist/assets/{DetectionIntelligence-gsiXBqeF.js → DetectionIntelligence-gw8JM_s7.js} +1 -1
- package/dist/assets/{DeviceAggregateSection-PsTImQRG.js → DeviceAggregateSection-Cgg9yXVV.js} +1 -1
- package/dist/assets/{DeviceDetail-BNn-DJaZ.js → DeviceDetail-KVft8pGO.js} +1 -1
- package/dist/assets/{Devices-CkM919eI.js → Devices-BR9yImkx.js} +1 -1
- package/dist/assets/{Events-DMjWkg6Y.js → Events-D7f8th0T.js} +1 -1
- package/dist/assets/{FormBuilder-DJIpbrRD.js → FormBuilder-BCY0VVTw.js} +1 -1
- package/dist/assets/{Identity-DkPcvpZI.js → Identity-CJ3VB4gp.js} +1 -1
- package/dist/assets/{IntegrationDetail-G0gylND2.js → IntegrationDetail-DSdJARhO.js} +1 -1
- package/dist/assets/{Integrations-Ba5QY_Db.js → Integrations-BLmlzNdT.js} +1 -1
- package/dist/assets/{Integrations-BY26xGGN.js → Integrations-BsF0VAxX.js} +1 -1
- package/dist/assets/{Locations-DcShvv_B.js → Locations-Bx-lUAgN.js} +1 -1
- package/dist/assets/{Logs-Dt1oL6Ne.js → Logs-D_5kXML8.js} +1 -1
- package/dist/assets/{MyAccess-hUgOahul.js → MyAccess-BIeRspcV.js} +1 -1
- package/dist/assets/{Network-BM5gHwHa.js → Network-BB_hWlpG.js} +1 -1
- package/dist/assets/{NodeAddonsSettingsPanel-BRjADPFj.js → NodeAddonsSettingsPanel-BHdHgghr.js} +1 -1
- package/dist/assets/{NodeInferenceDevices-D_m9EVBM.js → NodeInferenceDevices-Cjs79AqN.js} +1 -1
- package/dist/assets/{Notifications-DnSdyvR7.js → Notifications-Bj4WZFS1.js} +1 -1
- package/dist/assets/{Pipeline-CrcPBAPW.js → Pipeline-C_4co0Qy.js} +1 -1
- package/dist/assets/{Plates-baKb84ax.js → Plates-DM2w0FFA.js} +1 -1
- package/dist/assets/{ProviderIcon-7SEkSc3x.js → ProviderIcon-SlSAmo8K.js} +1 -1
- package/dist/assets/{Recordings-BAaEaUyH.js → Recordings-Cew5tVKL.js} +1 -1
- package/dist/assets/{ScanNetworkModal-DIAg8SvS.js → ScanNetworkModal-C4kWKpKg.js} +1 -1
- package/dist/assets/{Scenes-D-53XCVS.js → Scenes-CNOt2T2f.js} +1 -1
- package/dist/assets/{Settings-8HFz7_4b.js → Settings-CeHQraq8.js} +1 -1
- package/dist/assets/{Showroom-D2TZzhhG.js → Showroom-BtLOmXtB.js} +1 -1
- package/dist/assets/{StorageLocationsPanel-CSZxqVc1.js → StorageLocationsPanel-CcoxHvRg.js} +1 -1
- package/dist/assets/{Terminal-C5lOIWKi.js → Terminal-BgvkGYxK.js} +1 -1
- package/dist/assets/{authed-media-oFtTLnSo.js → authed-media-BAedevEe.js} +1 -1
- package/dist/assets/{bell-off-Bu58tCSe.js → bell-off-C8mLnRXC.js} +1 -1
- package/dist/assets/{bell-ring-D6CNMR5a.js → bell-ring-c5zfrv54.js} +1 -1
- package/dist/assets/{boxes-B_wKqNak.js → boxes-DwPF0OOw.js} +1 -1
- package/dist/assets/circle-check-big-N9Wdm89D.js +1 -0
- package/dist/assets/circle-dot-B3IVynlA.js +1 -0
- package/dist/assets/circle-slash-BMk1jZJL.js +1 -0
- package/dist/assets/{circle-x-OgmRm7RF.js → circle-x-mnKeyuxu.js} +1 -1
- package/dist/assets/clock-CcW1dzbK.js +1 -0
- package/dist/assets/{copy-BMx8D0jk.js → copy-BJljNCIj.js} +1 -1
- package/dist/assets/{debounced-invalidate-BQa0chBJ.js → debounced-invalidate-Bd0jUg5v.js} +1 -1
- package/dist/assets/{download-COB_8ZN4.js → download-DKWtbX3y.js} +1 -1
- package/dist/assets/{face-bbox-DxJxdnuR.js → face-bbox-CE9WFY08.js} +1 -1
- package/dist/assets/{flame-D_G_k09K.js → flame-DlEW2_5F.js} +1 -1
- package/dist/assets/{format-size-BwFaHYTC.js → format-size-XZHqlvrA.js} +1 -1
- package/dist/assets/{hard-drive-BRJV12KE.js → hard-drive-BGe0Xa2S.js} +1 -1
- package/dist/assets/{index-CjToGvfD.js → index-BPlvNRqQ.js} +2 -2
- package/dist/assets/{index-D6yBCo4s.css → index-DdPyS5cO.css} +1 -1
- package/dist/assets/{key-round-B-_5LjK2.js → key-round-BEi5hYjS.js} +1 -1
- package/dist/assets/{layers-CZ0fbzZD.js → layers-DN9gU-Qy.js} +1 -1
- package/dist/assets/location-owned-usage-CYLy2ZTx.js +1 -0
- package/dist/assets/{mf-entry-bootstrap-0-6fedd28a.js → mf-entry-bootstrap-0-8757f514.js} +1 -1
- package/dist/assets/{pencil-BryYtd6q.js → pencil-BaS0Brv_.js} +1 -1
- package/dist/assets/play-DwGiWNTU.js +1 -0
- package/dist/assets/plus-C0eRBTtX.js +1 -0
- package/dist/assets/power-55ym5RXA.js +1 -0
- package/dist/assets/{radio-CcuCrj-b.js → radio-C2QTpgVI.js} +1 -1
- package/dist/assets/{refresh-cw-DkloUlI-.js → refresh-cw-CzirCoAP.js} +1 -1
- package/dist/assets/rotate-ccw-CwE6-YbM.js +1 -0
- package/dist/assets/rotate-cw-PVuE1uG_.js +1 -0
- package/dist/assets/{send-CBoAcNiU.js → send-Sj6WWxa6.js} +1 -1
- package/dist/assets/{server-BFmcuET7.js → server-Bqrer35G.js} +1 -1
- package/dist/assets/{shield-alert-bLad91WY.js → shield-alert-CPZ-U5et.js} +1 -1
- package/dist/assets/{shield-WbkYgVY-.js → shield-vxLd9qbA.js} +1 -1
- package/dist/assets/square-BTAghn1-.js +1 -0
- package/dist/assets/{square-check-big-C9DzkTZR.js → square-check-big-8D7-wd7B.js} +1 -1
- package/dist/assets/{undo-2-BMAMnn0a.js → undo-2-DWI4xJra.js} +1 -1
- package/dist/assets/{useNodeUrlSelection-DkHWKBE3.js → useNodeUrlSelection-CrCodD7B.js} +1 -1
- package/dist/assets/user-round-BZ3OsbHY.js +1 -0
- package/dist/assets/{video-B10L6wHL.js → video-CPH2Cntr.js} +1 -1
- package/dist/assets/{wifi-BHPJu4tt.js → wifi-Bt5dfVlv.js} +1 -1
- package/dist/assets/{zap-BWD6AZU5.js → zap-SdZKZWs7.js} +1 -1
- package/dist/index.html +3 -3
- package/dist/server/addon.js +1 -1
- package/package.json +1 -1
- package/dist/assets/circle-check-big-kUlsgsiK.js +0 -1
- package/dist/assets/circle-dot-CaOYafyJ.js +0 -1
- package/dist/assets/circle-slash-ITbPTgVV.js +0 -1
- package/dist/assets/clock-B5FIt0QG.js +0 -1
- package/dist/assets/location-owned-usage-WHFlA8Qw.js +0 -1
- package/dist/assets/play-Cn0mIBXd.js +0 -1
- package/dist/assets/plus-BpcUYF3u.js +0 -1
- package/dist/assets/power-D1NeCw53.js +0 -1
- package/dist/assets/rotate-ccw-C-WlJpHp.js +0 -1
- package/dist/assets/rotate-cw-BydDIZ0I.js +0 -1
- package/dist/assets/square-C95bY7Mh.js +0 -1
- package/dist/assets/user-round-QQ8oqzin.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as e}from"./index-
|
|
1
|
+
import{J as e}from"./index-BPlvNRqQ.js";var t=e(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as e}from"./index-
|
|
1
|
+
import{J as e}from"./index-BPlvNRqQ.js";var t=e(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as e,Q as t,S as n,W as r,o as i,q as a,x as o,z as s}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js";import{at as c}from"./player-overlays-jCIm4d2Z.js";import{Qo as l,g as u,sn as d,us as f,wn as p}from"./src-BurbTgHr.js";import{jt as m}from"./src-DSOXw8KA.js";import{n as h,t as g}from"./format-size-XZHqlvrA.js";import{t as _}from"./pencil-BaS0Brv_.js";import{t as v}from"./plus-C0eRBTtX.js";import{t as y}from"./power-55ym5RXA.js";import{J as b,L as x,j as S,o as C,r as w,w as T,z as E}from"./index-BPlvNRqQ.js";import{t as ee}from"./FormBuilder-BCY0VVTw.js";var D=b(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),O=b(`eraser`,[[`path`,{d:`m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21`,key:`182aya`}],[`path`,{d:`M22 21H7`,key:`t4ddhn`}],[`path`,{d:`m5 11 9 9`,key:`1mo9qw`}]]);t();function k(e){let t=e.trim().toLowerCase();return t.length===0?``:t.replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)}function A(e,t){let n=k(t);return`${e}:${n.length>0?n:`default`}`}var j=new Set([`proc`,`sys`,`dev`,`run`,`boot`,`lost+found`,`snap`,`bin`,`sbin`,`lib`,`lib32`,`lib64`,`libx32`,`usr`,`etc`,`var`,`opt`,`tmp`,`srv`,`root`,`System`,`Library`,`Applications`,`cores`,`private`]),M=[`recordings`,`data`,`mnt`,`media`,`Volumes`];function N(e){let t=M.findIndex(t=>t===`recordings`?e.startsWith(t):e===t);return t===-1?M.length:t}function P(e){return e.filter(e=>!e.name.startsWith(`.`)&&!j.has(e.name)).toSorted((e,t)=>{let n=N(e.name)-N(t.name);return n===0?e.name.localeCompare(t.name):n}).map(e=>e.path)}function te({nodeId:t,value:r,onChange:i}){let l=c().trpcClient,[u,d]=a([]),[f,p]=a(r),[m,h]=a(null),[g,_]=a(null),[v,y]=a(``),b=e(async(e,n)=>{_(null);try{let r=await l.filesystemBrowse.browse.query({nodeId:t,path:e});h(r),p(r.path),n&&i(r.path)}catch(e){_(e instanceof Error?e.message:`browse failed`)}},[l,t,i]);s(()=>{p(r),(async()=>{let e=await l.filesystemBrowse.browse.query({nodeId:t,path:`/`}).then(e=>e).catch(()=>null);if(e){d(P(e.entries)),await b(r.startsWith(`/`)?r:`/`,!1);return}try{let e=await l.filesystemBrowse.listAllowedRoots.query({nodeId:t});d(e),await b(r&&e.some(e=>r.startsWith(e))?r:e[0]??``,!1)}catch(e){d([]),h(null),_(e instanceof Error&&/not available on node/i.test(e.message)?`This node can't be browsed remotely. Enter the path manually.`:e instanceof Error?e.message:`browse unavailable`)}})()},[t]);let x=async()=>{if(!(!v.trim()||!m)){_(null);try{let e=`${m.path.replace(/\/+$/,``)}/${v.trim()}`;await l.filesystemBrowse.createDir.mutate({nodeId:t,path:e}),y(``),await b(m.path,!0)}catch(e){_(e instanceof Error?e.message:`create failed`)}}},S=e=>`${(e/1e9).toFixed(1)} GB`;return n(`div`,{className:`space-y-2 rounded border border-border p-2`,children:[o(`div`,{className:`flex flex-wrap gap-1`,children:u.map(e=>o(`button`,{onClick:()=>void b(e,!0),className:`rounded border border-border px-2 py-0.5 text-[10px] font-mono hover:border-primary/40`,children:e},e))}),o(`input`,{value:f,onChange:e=>{p(e.target.value),i(e.target.value)},placeholder:`/absolute/path`,className:`w-full rounded border border-border bg-background px-2 py-1 text-[11px] font-mono`}),m&&n(`div`,{className:`text-[10px] text-foreground-subtle`,children:[S(m.freeBytes),` free / `,S(m.totalBytes)]}),o(`div`,{className:`max-h-40 space-y-0.5 overflow-y-auto`,children:m?.entries.map(e=>n(`button`,{onClick:()=>void b(e.path,!0),className:`block w-full truncate rounded px-2 py-1 text-left text-xs hover:bg-primary/5`,children:[`📁 `,e.name]},e.path))}),n(`div`,{className:`flex gap-1`,children:[o(`input`,{value:v,onChange:e=>y(e.target.value),placeholder:`new folder`,className:`flex-1 rounded border border-border bg-background px-2 py-1 text-xs`}),o(`button`,{onClick:()=>void x(),className:`rounded border border-border px-2 py-1 text-xs hover:border-primary/40`,children:`Create`})]}),g&&o(`div`,{className:`text-[10px] text-red-400`,children:g})]})}t();function F({initialType:e,onClose:t,onCreated:s}){let d=i(),p=c().trpcClient,[m,h]=a(`picker`),[g,_]=a(e),[v,y]=a(null),[b,S]=a({}),[C,E]=a(``),[D,O]=a(null),[k,j]=a(!1),[M,N]=a(`hub`),[P,F]=a(null),[I,L]=a(!1),R=e=>S(t=>({...t,basePath:e})),z=typeof b.basePath==`string`?b.basePath:``,B=l(),V=r(()=>{let e=B.data;return Array.isArray(e)?e:[]},[B.data]),H=B.isLoading,U=f({onSuccess:()=>{d.invalidateQueries({queryKey:[[`storage`,`listLocations`]]}),s()}}),W=r(()=>D!==null&&D.length>0?D:A(g,C),[g,C,D]),G=async()=>{if(v){L(!0),F(null);try{F(await(e=>p.storage.testConfig.query(e))({providerId:v.providerId,config:b}))}catch(e){F({ok:!1,error:e instanceof Error?e.message:String(e)})}finally{L(!1)}}};return o(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm`,onClick:t,children:n(`div`,{className:`w-full max-w-md rounded-xl border border-border bg-surface shadow-2xl`,onClick:e=>e.stopPropagation(),children:[n(`div`,{className:`flex items-start justify-between border-b border-border px-4 py-3`,children:[n(`div`,{className:`space-y-0.5`,children:[o(`h2`,{className:`text-sm font-semibold text-foreground`,children:{picker:`Add Location — Pick provider`,config:`Add Location — ${v?.displayName??``}`,naming:`Add Location — Name`}[m]}),n(`p`,{className:`text-xs text-foreground-subtle`,children:[`Type: `,o(`span`,{className:`font-mono`,children:g})]})]}),o(`button`,{onClick:t,className:`text-foreground-subtle hover:text-foreground`,children:o(w,{className:`h-4 w-4`})})]}),m===`picker`&&n(`div`,{className:`p-4 space-y-2`,children:[H&&o(`div`,{className:`text-xs text-foreground-subtle animate-pulse`,children:`Loading providers…`}),!H&&V.length===0&&n(`div`,{className:`rounded border border-border bg-background px-3 py-4 text-center text-xs text-foreground-subtle`,children:[`No storage-provider supports type "`,g,`". Install a compatible addon (e.g.`,` `,o(`code`,{className:`font-mono`,children:`remote-storage`}),`) to enable it.`]}),V.map(e=>n(`button`,{onClick:()=>{y(e),h(`config`)},className:`flex w-full items-center gap-3 rounded-lg border border-border bg-background p-3 text-left hover:border-primary/40 hover:bg-primary/5 transition-colors`,children:[n(`div`,{className:`flex-1 min-w-0`,children:[o(`p`,{className:`text-xs font-semibold text-foreground`,children:e.displayName}),o(`p`,{className:`text-[10px] text-foreground-subtle font-mono mt-0.5 truncate`,children:e.providerId})]}),o(x,{className:`h-4 w-4 text-foreground-subtle flex-shrink-0`})]},e.providerId))]}),m===`config`&&v&&n(`div`,{className:`p-4 space-y-3 max-h-[60vh] overflow-y-auto`,children:[o(ee,{schema:v.configSchema,values:b,onChange:S}),v.nodeLocal&&n(`div`,{className:`space-y-2`,children:[o(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Node`}),o(u,{selectedNodeId:M,onSelect:N,alwaysShow:!0}),o(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Path`}),o(te,{nodeId:M,value:z,onChange:R})]}),P&&o(`div`,{className:`rounded border px-3 py-2 text-[11px] ${P.ok?`border-success/30 bg-success/5 text-success`:`border-danger/30 bg-danger/5 text-danger`}`,children:P.ok?`Connection OK.`:`Test failed: ${P.error??`unknown error`}`}),n(`div`,{className:`flex items-center justify-between pt-1`,children:[o(`button`,{onClick:()=>h(`picker`),className:`rounded px-3 py-1.5 text-xs text-foreground-subtle border border-border hover:text-foreground`,children:`Back`}),n(`div`,{className:`flex items-center gap-2`,children:[o(`button`,{onClick:()=>{G()},disabled:I,className:`rounded border border-border px-3 py-1.5 text-xs text-foreground hover:bg-primary/10 disabled:opacity-50`,children:I?`Testing…`:`Test connection`}),o(`button`,{onClick:()=>h(`naming`),className:`rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90`,children:`Next`})]})]})]}),m===`naming`&&v&&n(`div`,{className:`p-4 space-y-3`,children:[n(`div`,{className:`space-y-1`,children:[o(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Display name`}),o(`input`,{type:`text`,value:C,onChange:e=>E(e.target.value),placeholder:`${g} on ${v.displayName}`,className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`})]}),n(`div`,{className:`space-y-1`,children:[n(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:[`Id`,` `,o(`span`,{className:`lowercase tracking-normal text-foreground-subtle`,children:`— auto-derived; override if needed`})]}),o(`input`,{type:`text`,value:W,onChange:e=>O(e.target.value),placeholder:A(g,C),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground font-mono focus:outline-none focus:ring-1 focus:ring-primary`}),n(`p`,{className:`text-[10px] text-foreground-subtle`,children:[`Format: `,o(`code`,{className:`font-mono`,children:`<type>:<slug>`}),`. Lowercase letters, digits, and hyphens only.`]})]}),n(`label`,{className:`flex items-start gap-2 rounded border border-border bg-background px-3 py-2 cursor-pointer hover:bg-primary/5`,children:[o(`input`,{type:`checkbox`,checked:k,onChange:e=>j(e.target.checked),className:`accent-primary mt-0.5`}),n(`div`,{className:`space-y-0.5`,children:[o(`div`,{className:`text-xs font-medium text-foreground`,children:`Enable immediately`}),o(`div`,{className:`text-[10px] text-foreground-subtle`,children:`A disabled location receives no writes until enabled — reads and age-based retention still work, nothing new lands here. Leave this off to register the disk now and start using it later.`})]})]}),U.isError&&o(`div`,{className:`rounded border border-danger/30 bg-danger/5 text-danger px-3 py-2 text-[11px]`,children:U.error instanceof Error?U.error.message:String(U.error)}),n(`div`,{className:`flex items-center justify-between pt-1`,children:[o(`button`,{onClick:()=>h(`config`),className:`rounded px-3 py-1.5 text-xs text-foreground-subtle border border-border hover:text-foreground`,children:`Back`}),n(`div`,{className:`flex items-center gap-2`,children:[o(`button`,{onClick:()=>{_(e),y(null),S({}),E(``),O(null),j(!1),F(null),h(`picker`)},className:`rounded px-3 py-1.5 text-xs text-foreground-subtle border border-border hover:text-foreground`,children:`Reset`}),n(`button`,{onClick:()=>{v&&U.mutate({id:W,type:g,displayName:C.trim(),providerId:v.providerId,config:b,enabled:k,nodeId:v.nodeLocal?M:void 0})},disabled:U.isPending||C.trim().length===0,className:`inline-flex items-center gap-1.5 rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50`,children:[U.isPending?o(T,{className:`h-3.5 w-3.5 animate-spin`}):null,U.isPending?`Saving…`:`Save`]})]})]})]})]})})}function I(e){return m(e)}function L(e){return e===`active`}var R=[{mode:`active`,label:`Active`,consequence:`New data is written here, and the oldest is deleted when the disk fills up.`,requiresConfirmation:!1},{mode:`readonly`,label:`Read-only`,consequence:`Nothing new is written and nothing is ever deleted. A frozen archive that stays on the timeline.`,requiresConfirmation:!1},{mode:`drain`,label:`Drain`,consequence:`Nothing new is written. The oldest data here is deleted, a little at a time, until this location is empty.`,requiresConfirmation:!1},{mode:`disabled`,label:`Disabled`,consequence:`Nothing is written and nothing is read: the footage stored here disappears from the timeline until you turn it back on. Nothing is deleted.`,requiresConfirmation:!0}];function z(e){return R.find(t=>t.mode===e)??R[0]}function B(e){return z(e).requiresConfirmation}var V=`Blocked: this is the last location of its type still accepting writes — new data would have nowhere to go.`;function H(e,t,n){return L(n)||!L(I(e))||t.some(t=>t.id!==e.id&&L(I(t)))?{blocked:!1,reason:``}:{blocked:!0,reason:V}}function U(e,t){return{active:H(e,t,`active`).reason,readonly:H(e,t,`readonly`).reason,drain:H(e,t,`drain`).reason,disabled:H(e,t,`disabled`).reason}}function W(e,t,n){return!(n===`single`||t.length<=1||L(I(e))&&t.filter(e=>L(I(e))).length<=1)}function G(e){return e===`active`?{enabled:!0,readOnly:!1}:e===`readonly`?{enabled:!1,readOnly:!1}:{enabled:!1,readOnly:!0}}function ne(e,t){let n={...t.config??e.config};t.mode!==void 0&&(G(t.mode).readOnly?n.readOnly=!0:delete n.readOnly);let r={id:e.id,type:e.type,displayName:t.displayName??e.displayName,providerId:e.providerId,config:n,isSystem:e.isSystem},i=t.nodeId??e.nodeId,a=i===void 0?r:{...r,nodeId:i};return t.mode===void 0?e.enabled===void 0?a:{...a,enabled:e.enabled}:{...a,mode:t.mode,enabled:G(t.mode).enabled}}var re=1024**3;function K(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function ie(e){let t=K(e.minFreeGb);if(t!==null)return{unit:`gb`,value:t};let n=K(e.minFreePercent);return n===null?{unit:`percent`,value:null}:{unit:`percent`,value:n}}function ae(e,t){return K(e[t===`gb`?`minFreeGb`:`minFreePercent`])}function oe(e,t){let n={...e};return delete n.minFreePercent,delete n.minFreeGb,t.value===null?n:t.unit===`gb`?{...n,minFreeGb:t.value}:{...n,minFreePercent:t.value}}function se(e,t){let n=e.trim();if(n===``)return null;let r=Number(n);return Number.isFinite(r)?t===`percent`?Math.min(100,Math.max(0,r)):Math.max(0,r):null}function ce(e,t,n=10){if(e.unit===`gb`&&e.value!==null)return e.value*re;let r=e.value??n;return t===null||t<=0?null:t*Math.min(100,Math.max(0,r))/100}function le(e){return e===`gb`?`GB to keep free`:`% of the volume to keep free`}function ue(e,t=10){return`CamStack keeps ${e.value===null?`${String(t)}% of the volume (the default)`:e.unit===`gb`?`${String(e.value)} GB`:`${String(e.value)}% of the volume`} free on this disk. As it fills up, the OLDEST data stored here is deleted to hold that much free space; if it cannot be held any more, new data goes to another location of the same type instead of filling the disk. Leave the value empty for the default (${String(t)}%).`}function de(e){return K(e.maxUsedGb)}function fe(e,t){let n=K(e.maxUsedGb);return n===null||n<0?null:{bytes:n*re,reason:t===`drain`?`drain`:`legacy`}}t();function pe({config:e,defaultPercent:t=10,onChange:r}){let[i,s]=a(()=>ie(e).unit),c=ae(e,i),l={unit:i,value:c},u=de(e),d=t=>{s(t),r(oe(e,{unit:t,value:null}))},f=t=>{r(oe(e,{unit:i,value:se(t,i)}))};return n(`div`,{className:`space-y-1`,children:[o(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Protected free space`}),n(`div`,{className:`flex items-center gap-2`,children:[n(`select`,{"aria-label":`Protection unit`,value:i,onChange:e=>{d(e.target.value===`gb`?`gb`:`percent`)},className:`rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`,children:[o(`option`,{value:`percent`,children:`% of the volume`}),o(`option`,{value:`gb`,children:`GB of free space`})]}),o(`input`,{type:`number`,"aria-label":le(i),min:0,max:i===`percent`?100:void 0,value:c===null?``:c,placeholder:i===`percent`?String(t):`default`,onChange:e=>{f(e.target.value)},className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`})]}),o(`p`,{className:`text-[10px] text-foreground-subtle`,children:ue(l,t)}),u!==null&&n(`p`,{className:`text-[10px] text-foreground-subtle italic`,children:[`This location also stores a maximum used size of `,u,` GB. That limit is managed by the system now and is no longer editable here; it is kept as it is.`]})]})}t();function me({location:e,onClose:t,onSaved:s}){let d=i(),p=c().trpcClient,[m,h]=a({...e.config}),[g,_]=a(e.displayName),[v,y]=a(null),[b,x]=a(!1),S=l(),C=r(()=>{let t=S.data;return Array.isArray(t)?t.find(t=>t.providerId===e.providerId)??null:null},[S.data,e.providerId]),E=f({onSuccess:()=>{d.invalidateQueries({queryKey:[[`storage`,`listLocations`]]}),s()}}),D=C?.shouldSaveDiskSpace===!0,O=C?.nodeLocal===!0,[k,A]=a(typeof e.nodeId==`string`?e.nodeId:`hub`),j=typeof m.basePath==`string`?m.basePath:``,M=e=>h(t=>({...t,basePath:e})),N=C?.minFreePercent??10,P=async()=>{x(!0),y(null);try{y(await(e=>p.storage.testConfig.query(e))({providerId:e.providerId,locationId:e.id,config:m}))}catch(e){y({ok:!1,error:e instanceof Error?e.message:String(e)})}finally{x(!1)}};return o(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm`,onClick:t,children:n(`div`,{className:`w-full max-w-md rounded-xl border border-border bg-surface shadow-2xl`,onClick:e=>e.stopPropagation(),children:[n(`div`,{className:`flex items-start justify-between border-b border-border px-4 py-3`,children:[n(`div`,{className:`space-y-0.5`,children:[n(`h2`,{className:`text-sm font-semibold text-foreground`,children:[`Edit `,e.displayName]}),n(`p`,{className:`text-xs text-foreground-subtle`,children:[o(`span`,{className:`font-mono`,children:e.id}),` ·`,` `,C?.displayName??e.providerId]})]}),o(`button`,{onClick:t,className:`text-foreground-subtle hover:text-foreground`,children:o(w,{className:`h-4 w-4`})})]}),n(`div`,{className:`p-4 space-y-3 max-h-[60vh] overflow-y-auto`,children:[n(`div`,{className:`space-y-1`,children:[o(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Display name`}),o(`input`,{type:`text`,value:g,onChange:e=>_(e.target.value),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`})]}),C&&o(ee,{schema:C.configSchema,values:m,onChange:h}),O&&n(`div`,{className:`space-y-2`,children:[o(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Node`}),o(u,{selectedNodeId:k,onSelect:A,alwaysShow:!0}),o(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Path`}),o(te,{nodeId:k,value:j,onChange:M})]}),D&&o(pe,{config:m,defaultPercent:N,onChange:h}),!C&&!S.isLoading&&n(`div`,{className:`rounded border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-[11px] text-amber-700 dark:text-amber-300`,children:[`Provider `,o(`code`,{className:`font-mono`,children:e.providerId}),` is no longer registered. Field schema unavailable; raw config is preserved on save.`]}),v&&o(`div`,{className:`rounded border px-3 py-2 text-[11px] ${v.ok?`border-success/30 bg-success/5 text-success`:`border-danger/30 bg-danger/5 text-danger`}`,children:v.ok?`Connection OK.`:`Test failed: ${v.error??`unknown error`}`}),E.isError&&o(`div`,{className:`rounded border border-danger/30 bg-danger/5 text-danger px-3 py-2 text-[11px]`,children:E.error instanceof Error?E.error.message:String(E.error)})]}),n(`div`,{className:`flex items-center justify-between gap-2 border-t border-border px-4 py-3`,children:[o(`button`,{onClick:t,className:`rounded px-3 py-1.5 text-xs text-foreground-subtle border border-border hover:text-foreground`,children:`Cancel`}),n(`div`,{className:`flex items-center gap-2`,children:[o(`button`,{onClick:()=>{P()},disabled:b||!C,className:`rounded border border-border px-3 py-1.5 text-xs text-foreground hover:bg-primary/10 disabled:opacity-50`,children:b?`Testing…`:`Test connection`}),n(`button`,{onClick:()=>{E.mutate(ne(e,{displayName:g.trim(),config:m,nodeId:O?k:e.nodeId}))},disabled:E.isPending||g.trim().length===0,className:`inline-flex items-center gap-1.5 rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50`,children:[E.isPending?o(T,{className:`h-3.5 w-3.5 animate-spin`}):null,E.isPending?`Saving…`:`Save`]})]})]})]})})}var he=[`ok`,`warn`,`critical`];function ge(e){return e>=.95?`critical`:e>=.85?`warn`:`ok`}function _e(e){return Math.min(1,Math.max(0,e))}function q(e){let{availableBytes:t,totalBytes:n}=e;if(n===null||n<=0||t===null)return null;let r=_e((n-t)/n);return{fraction:r,severity:ge(r),recordingsFraction:_e(e.usedBytes/n),freeBytes:t,totalBytes:n}}function ve(e){if(e.length===0)return null;let t=0,n=0,r=0,i=0,a=null;for(let o of e){let e=q(o);if(e===null){n+=1;continue}t+=1,r+=e.totalBytes,i+=e.freeBytes,(a===null||he.indexOf(e.severity)>he.indexOf(a))&&(a=e.severity)}return{knownVolumes:t,unknownVolumes:n,totalBytes:r,freeBytes:i,severity:a}}var ye=`Capacity unknown — this volume did not report its size.`;function J(e){return Math.min(1,Math.max(0,e))}function Y(e){return Math.round(J(e)*1e3)/10}function X(e){return`${String(Math.round(J(e)*100))}%`}function be(e,t,n={}){let{totalBytes:r,availableBytes:i}=e;if(r===null||r<=0||i===null)return{kind:`unknown`,summary:ye};let a=Math.min(Math.max(i,0),r),o=r-a,s=n.ownedBytes,c=s==null||!Number.isFinite(s)||s<0?null:s,l=q({usedBytes:c??o,availableBytes:a,totalBytes:r}),u=l===null?J(o/r):l.fraction,d=l===null?ge(u):l.severity,f=c===null?null:l===null?J(c/r):l.recordingsFraction,p=1-u,m=t===null||t<=0?0:t,h=J(m/r),_=m>a,v=n.cap??null,y=v===null?null:J(v.bytes/r),b=v!==null&&c!==null&&c>v.bytes,x={used:g(o),usedPercent:X(u),free:g(a),freePercent:X(p),total:g(r),reserve:m===0?null:`${g(m)} kept free`,owned:c===null||f===null?null:`${g(c)} of recordings (${X(f)})`,cap:v===null?null:v.reason===`drain`?`${g(v.bytes)} drain target (managed by CamStack)`:`${g(v.bytes)} cap (managed by CamStack)`},S=[`${x.free} free of ${x.total} (${x.freePercent} free)`,x.owned===null?null:`CamStack holds ${x.owned}`,x.reserve===null?null:_?`${x.reserve} — less free than that right now, the oldest data here is being deleted`:x.reserve,x.cap===null?null:b?`${x.cap} — already below what is stored here, the oldest is being deleted`:x.cap].filter(e=>e!==null).join(` · `),C=[{segment:`used`,label:`Used`,value:`${x.used} (${x.usedPercent})`,alarming:d===`critical`}];return x.owned!==null&&C.push({segment:`owned`,label:`CamStack`,value:x.owned,alarming:!1}),C.push({segment:`free`,label:`Free`,value:`${x.free} (${x.freePercent})`,alarming:!1}),x.reserve!==null&&C.push({segment:`reserve`,label:`Kept free`,value:g(m),alarming:_}),v!==null&&C.push({segment:`cap`,label:v.reason===`drain`?`Drain target`:`Cap`,value:`${g(v.bytes)} · managed by CamStack`,alarming:b}),{kind:`known`,severity:d,legend:C,segments:{usedPercent:Y(u),freePercent:Y(p),reservePercent:Y(h),ownedPercent:f===null?null:Y(f),capPercent:y===null?null:Y(y)},labels:x,reserveExceedsFree:_,capBelowOwned:b,summary:S}}var xe={ok:`bg-primary`,warn:`bg-amber-500`,critical:`bg-danger`},Z={owned:`bg-foreground/50`,free:`bg-border`,reserve:`bg-danger/40`,cap:`bg-foreground`};function Se(e,t){return e===`used`?xe[t]:Z[e]}function Ce({location:e,ownedBytes:t}){let r=e.capacity??null,i=ce(ie(e.config),r?.totalBytes??null),a=be({totalBytes:r?.totalBytes??null,availableBytes:r?.availableBytes??null},i,{ownedBytes:t??null,cap:fe(e.config,I(e))});return a.kind===`unknown`?o(`div`,{className:`text-[10px] text-foreground-subtle italic`,title:a.summary,children:`Capacity unknown`}):n(`div`,{className:`mt-1 space-y-1`,title:a.summary,children:[n(`div`,{className:`relative h-2 w-full max-w-md overflow-hidden rounded-full bg-border`,children:[o(`div`,{className:`absolute inset-y-0 left-0 ${xe[a.severity]}`,style:{width:`${String(a.segments.usedPercent)}%`}}),a.segments.ownedPercent!==null&&o(`div`,{className:`absolute inset-y-0 left-0 ${Z.owned}`,style:{width:`${String(a.segments.ownedPercent)}%`}}),a.segments.capPercent!==null&&o(`div`,{className:`absolute inset-y-0 w-px ${a.capBelowOwned?`bg-danger`:Z.cap}`,style:{left:`${String(a.segments.capPercent)}%`}}),a.segments.reservePercent>0&&o(`div`,{className:`absolute inset-y-0 right-0 border-l border-danger ${a.reserveExceedsFree?`bg-danger/60`:Z.reserve}`,style:{width:`${String(a.segments.reservePercent)}%`}})]}),o(`ul`,{className:`flex flex-wrap items-center gap-x-3 gap-y-0.5`,children:a.legend.map(e=>n(`li`,{className:`flex items-center gap-1`,children:[o(`span`,{"aria-hidden":`true`,className:`inline-block h-2 w-2 shrink-0 rounded-sm ${Se(e.segment,a.severity)}`}),n(`span`,{className:`text-[10px] tabular-nums ${e.alarming?`text-danger`:`text-foreground-subtle`}`,children:[e.label,` `,e.value]})]},e.segment))})]})}var we={eventMedia:[`events`],recordingsLow:[`low`],recordings:[`high`,`mid`]},Te={eventMedia:`pipeline-analytics`,recordingsLow:`recorder`,recordings:`recorder`},Ee=`storage.discardLocation`,De=`storage.discardLocationStatus`,Oe=`storage.discardLocationCancel`;function ke(e){return we[e]??null}function Ae(e){return Te[e]??null}function je(e){return!L(I(e))}function Me(e,t){return ke(e.type)===null||!je(e)?!1:t.some(t=>t.id!==e.id&&L(I(t)))}var Ne=new Set([`idle`,`scanning`,`wiping-fs`,`wiping-db`,`cascading`,`complete`,`cancelled`,`error`]);function Q(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function $(e){return typeof e==`string`?e:null}function Pe(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.running!=`boolean`)return null;let n=t.phase;if(typeof n!=`string`||!Ne.has(n))return null;let r=Q(t.camerasTotal),i=Q(t.camerasDone),a=Q(t.foldersRemoved),o=Q(t.dbRowsDeleted),s=Q(t.ownersCascaded);return r===null||i===null||a===null||o===null||s===null?null:{running:t.running,locationId:$(t.locationId),jobId:$(t.jobId),phase:n,camerasTotal:r,camerasDone:i,foldersRemoved:a,dbRowsDeleted:o,ownersCascaded:s,detail:$(t.detail)??``,startedAtMs:Q(t.startedAtMs),finishedAtMs:Q(t.finishedAtMs),error:$(t.error)}}function Fe(e){if(e.phase===`complete`)return 100;if(e.phase===`cancelled`||e.phase===`error`||e.phase===`idle`)return e.camerasTotal>0?Math.min(99,Math.round(e.camerasDone/e.camerasTotal*100)):0;if(e.camerasTotal>0){let t=e.camerasDone/e.camerasTotal*85;return e.phase===`wiping-db`?Math.min(95,Math.round(t+8)):e.phase===`cascading`?Math.min(99,Math.round(t+12)):Math.min(85,Math.round(t))}return e.phase===`scanning`?2:5}t();var Ie=2e3;function Le({location:e,siblings:t}){return Me(e,t)?o(Re,{location:e}):null}function Re({location:e}){let t=d(),r=p(),i=Ae(e.type),[c,l]=a(null),[u,f]=a(null),[m,h]=a(!1);if(s(()=>{if(i===null)return;let e=!1,t=async()=>{try{let t=await r.mutateAsync({addonId:i,action:De,input:{}});if(e)return;l(Pe(t))}catch{}};t();let n=setInterval(()=>void t(),Ie);return()=>{e=!0,clearInterval(n)}},[i,e.id]),i===null)return null;let g=c!==null&&c.locationId===e.id,_=g&&c.running,v=g&&c.phase!==`idle`,y=async()=>{if(await t({title:`Discard leftovers on "${e.displayName}"?`,message:`Permanently deletes leftover files and records on this location. Other locations are not affected. This cannot be undone and may take hours.`,confirmLabel:`Discard leftovers`,variant:`danger`})){f(null),h(!0);try{await r.mutateAsync({addonId:i,action:Ee,input:{locationId:e.id}}),l(Pe(await r.mutateAsync({addonId:i,action:De,input:{}})))}catch(e){f(e instanceof Error?e.message:String(e))}finally{h(!1)}}},b=async()=>{try{await r.mutateAsync({addonId:i,action:Oe,input:{}})}catch(e){f(e instanceof Error?e.message:String(e))}};return n(`div`,{className:`flex flex-col gap-1 min-w-[9rem] max-w-[16rem]`,children:[_?n(`button`,{type:`button`,onClick:()=>void b(),className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-danger border border-danger/40 hover:bg-danger/10`,children:[o(w,{className:`h-3 w-3`}),`Cancel`]}):n(`button`,{type:`button`,onClick:()=>void y(),disabled:m,title:`Permanently delete leftover files on this location. Other locations are not affected.`,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-danger border border-danger/40 hover:bg-danger/10 disabled:opacity-50`,children:[m?o(T,{className:`h-3 w-3 animate-spin`}):o(O,{className:`h-3 w-3`}),`Discard leftovers`]}),v&&c!==null&&n(`div`,{className:`space-y-0.5`,children:[o(`div`,{className:`h-1 rounded bg-border overflow-hidden`,children:o(`div`,{className:`h-full bg-primary transition-[width] duration-300`,style:{width:`${Fe(c)}%`}})}),n(`p`,{className:`text-[10px] text-foreground-subtle leading-tight`,children:[c.phase,c.camerasTotal>0?` · ${c.camerasDone}/${c.camerasTotal} cam`:``,c.dbRowsDeleted>0?` · ${c.dbRowsDeleted} rows`:``,c.detail?` · ${c.detail}`:``]})]}),(u||g&&c?.error)&&o(`p`,{className:`text-[10px] text-danger leading-tight`,children:u??c?.error})]})}t();var ze={active:y,readonly:D,drain:h,disabled:S},Be={active:`border-success/30 text-success hover:bg-success/10`,readonly:`border-border text-foreground-subtle hover:text-foreground hover:bg-primary/10`,drain:`border-warning/40 text-warning hover:bg-warning/10`,disabled:`border-danger/40 text-danger hover:bg-danger/10`};function Ve({mode:e,blockedReasons:t,onSelect:r}){let[i,s]=a(!1),c=z(e),l=ze[e];return n(`span`,{className:`relative inline-flex`,children:[n(`button`,{type:`button`,"aria-haspopup":`menu`,"aria-expanded":i,"aria-label":`Location state`,onClick:()=>s(e=>!e),title:c.consequence,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium border ${Be[e]}`,children:[o(l,{className:`h-3 w-3`}),c.label,o(E,{className:`h-3 w-3`})]}),i&&o(`span`,{role:`menu`,"aria-label":`Location state choices`,className:`absolute right-0 top-full z-20 mt-1 w-80 rounded-lg border border-border bg-surface p-1 shadow-xl`,children:R.map(i=>{let a=t[i.mode],c=a!==``,l=ze[i.mode],u=i.mode===e;return n(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":u,"aria-label":i.label,disabled:c,onClick:()=>{c||(s(!1),u||r(i.mode))},className:`flex w-full flex-col items-start gap-0.5 rounded px-2 py-1.5 text-left ${c?`cursor-not-allowed opacity-60`:u?`bg-primary/10`:`hover:bg-primary/5`}`,children:[n(`span`,{className:`flex items-center gap-1.5 text-[11px] font-medium text-foreground`,children:[o(l,{className:`h-3 w-3`}),i.label,u&&o(`span`,{className:`text-[9px] uppercase text-primary`,children:`current`})]}),o(`span`,{className:`text-[10px] leading-snug text-foreground-subtle`,children:i.consequence}),c&&o(`span`,{className:`text-[10px] leading-snug text-warning`,children:a})]},i.mode)})})]})}var He=`Remaining not reported yet`,Ue=`Estimated empty time not available yet`;function We(e,t){let n=new Date(e);if(Number.isNaN(n.getTime()))return Ue;let r=n.toLocaleString();return e<=t?`Estimated empty by now (${r})`:`Estimated empty ${r}`}function Ge(e,t){let n=e.remainingBytes,r=n!==null&&Number.isFinite(n)&&n>=0?n:null,i=r===0;return{remainingLabel:r===null?He:i?`Empty — nothing left on this location`:`${g(r)} left to move off`,etaLabel:i?`Drain finished`:e.estimatedEmptyAtMs===null?Ue:We(e.estimatedEmptyAtMs,t),complete:i}}function Ke(e){let t=e.basePath;if(typeof t==`string`&&t.length>0)return t;let n=Object.keys(e);return n.length===0?``:n.join(`, `)}var qe={remainingBytes:null,estimatedEmptyAtMs:null};function Je({location:e,onEdit:t,onDelete:r,onSetMode:i,blockedReasons:a,canDelete:s,siblings:c=[],drain:l,ownedBytes:u}){let d=Ke(e.config),f=I(e),p=f===`drain`?Ge(l??qe,Date.now()):null;return n(`div`,{className:`flex flex-wrap items-start gap-x-3 gap-y-2 px-3 py-2 border-t border-border first:border-t-0 hover:bg-primary/5`,children:[n(`div`,{className:`flex items-start gap-2 min-w-0 flex-1 basis-72`,children:[o(`span`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle bg-background border border-border rounded px-1.5 py-0.5 font-mono`,children:e.providerId}),n(`div`,{className:`min-w-0 flex-1`,children:[o(`div`,{className:`text-xs font-medium text-foreground truncate`,children:e.displayName}),d&&o(`div`,{className:`text-[10px] text-foreground-subtle truncate font-mono`,children:d}),o(Ce,{location:e,ownedBytes:u??null}),p!==null&&n(`div`,{className:`text-[10px] text-warning`,children:[`Draining · `,p.remainingLabel,` · `,p.etaLabel]})]})]}),n(`div`,{className:`flex flex-wrap items-center gap-1 shrink-0`,children:[o(Le,{location:e,siblings:c}),o(Ve,{mode:f,blockedReasons:a,onSelect:t=>i(e,t)}),n(`button`,{onClick:()=>t(e),className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-foreground-subtle border border-border hover:text-foreground hover:bg-primary/10`,children:[o(_,{className:`h-3 w-3`}),`Edit`]}),s&&o(`button`,{onClick:()=>r(e),className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-danger hover:bg-danger/10`,title:`Delete location`,children:o(C,{className:`h-3 w-3`})})]})]})}t();function Ye({type:e,displayName:t,description:i,cardinality:a,locations:s,onAdd:c,onEdit:l,onDelete:u,onSetMode:d,ownedBytesById:f}){let p=r(()=>{let e=[...s];return e.sort((e,t)=>{let n=L(I(e));return n===L(I(t))?e.displayName.localeCompare(t.displayName):n?-1:1}),e},[s]);return n(`div`,{className:`rounded-lg border border-border bg-surface`,children:[n(`div`,{className:`flex items-start justify-between border-b border-border px-3 py-2`,children:[n(`div`,{className:`space-y-0.5`,children:[n(`div`,{className:`flex items-center gap-2`,children:[o(`span`,{className:`text-sm font-semibold text-foreground capitalize`,children:t}),o(`span`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle bg-background border border-border rounded px-1.5 py-0.5 font-mono`,children:e})]}),i&&o(`p`,{className:`text-[11px] text-foreground-subtle`,children:i}),a===`single`&&o(`p`,{className:`text-[10px] text-foreground-subtle italic`,children:`Single — one location per type. Edit the existing entry; it can't be split.`})]}),a===`multi`&&n(`button`,{onClick:()=>c(e),className:`inline-flex items-center gap-1 rounded bg-primary px-2 py-1 text-[11px] font-medium text-primary-foreground hover:bg-primary/90`,children:[o(v,{className:`h-3 w-3`}),`Add`]})]}),p.length===0?o(`div`,{className:`px-3 py-4 text-center text-[11px] text-foreground-subtle italic`,children:a===`multi`?`No location registered. Click "Add" to register one.`:`No location registered yet — should be auto-seeded at next boot.`}):o(`div`,{children:p.map(e=>o(Je,{location:e,cardinality:a,canDelete:W(e,p,a),onEdit:l,onDelete:u,onSetMode:d,blockedReasons:U(e,p),ownedBytes:f?.get(e.id)??null,siblings:p},e.id))})]})}var Xe=[`recordings`,`recordingsLow`];function Ze(e){return e.locationIds!==void 0&&e.locationIds.length>0?e.locationIds:e.locationId===null?[]:[e.locationId]}function Qe(e,t){if(t===void 0||!Xe.includes(e.type))return null;let n=t.find(t=>Ze(t).includes(e.id));return n===void 0||!Number.isFinite(n.usedBytes)||n.usedBytes<0?null:n.usedBytes}function $e(e,t){let n=new Map;for(let r of e){let e=Qe(r,t);e!==null&&n.set(r.id,e)}return n}export{me as a,B as c,ve as i,F as l,Ye as n,ne as o,q as r,z as s,$e as t,D as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as e}from"./index-
|
|
1
|
+
import{J as e}from"./index-BPlvNRqQ.js";var t=e(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{J as e}from"./index-BPlvNRqQ.js";var t=e(`play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{J as e}from"./index-BPlvNRqQ.js";var t=e(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{J as e}from"./index-BPlvNRqQ.js";var t=e(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as e}from"./index-
|
|
1
|
+
import{J as e}from"./index-BPlvNRqQ.js";var t=e(`radio`,[[`path`,{d:`M4.9 19.1C1 15.2 1 8.8 4.9 4.9`,key:`1vaf9d`}],[`path`,{d:`M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5`,key:`u1ii0m`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5`,key:`1j5fej`}],[`path`,{d:`M19.1 4.9C23 8.8 23 15.1 19.1 19`,key:`10b0cb`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as e}from"./index-
|
|
1
|
+
import{J as e}from"./index-BPlvNRqQ.js";var t=e(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{J as e}from"./index-BPlvNRqQ.js";var t=e(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{J as e}from"./index-BPlvNRqQ.js";var t=e(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as e}from"./index-
|
|
1
|
+
import{J as e}from"./index-BPlvNRqQ.js";var t=e(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),n=e(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]);export{t as n,n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as e}from"./index-
|
|
1
|
+
import{J as e}from"./index-BPlvNRqQ.js";var t=e(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as e}from"./index-
|
|
1
|
+
import{J as e}from"./index-BPlvNRqQ.js";var t=e(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as e}from"./index-
|
|
1
|
+
import{J as e}from"./index-BPlvNRqQ.js";var t=e(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{J as e}from"./index-BPlvNRqQ.js";var t=e(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as e}from"./index-
|
|
1
|
+
import{J as e}from"./index-BPlvNRqQ.js";var t=e(`square-check-big`,[[`path`,{d:`M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5`,key:`1uzm8b`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as e}from"./index-
|
|
1
|
+
import{J as e}from"./index-BPlvNRqQ.js";var t=e(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as e,Q as t,S as n,W as r,x as i}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js";import{Q as a,a as o}from"./index-
|
|
1
|
+
import{I as e,Q as t,S as n,W as r,x as i}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js";import{Q as a,a as o}from"./index-BPlvNRqQ.js";function s({staleNodeId:e,shownNodeName:t}){return e===null?null:n(`div`,{role:`status`,className:`flex items-start gap-2 rounded-md border border-warning/30 bg-warning/5 px-3 py-2 text-[11px] text-foreground-subtle`,children:[i(o,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-warning`}),n(`span`,{children:[`This link named node `,i(`span`,{className:`font-medium text-foreground`,children:e}),`, which is not in this cluster. Showing`,` `,i(`span`,{className:`font-medium text-foreground`,children:t}),` instead.`]})]})}t();var c=`node`;function l(e){return[...e].toSorted((e,t)=>e.isHub===t.isHub?e.isOnline===t.isOnline?e.name.localeCompare(t.name):e.isOnline?-1:1:e.isHub?-1:1)}function u(e,t){let n=l(e),r=n[0]??null;if(r===null)return{node:null,outcome:`empty`,staleNodeId:null};if(t===null||t.length===0)return{node:r,outcome:`default`,staleNodeId:null};let i=n.find(e=>e.id===t);return i===void 0?{node:r,outcome:`stale`,staleNodeId:t}:{node:i,outcome:`requested`,staleNodeId:null}}function d(t){let[n,i]=a(),o=n.get(c);return{selection:r(()=>u(t,o),[t,o]),selectNode:e(e=>{let t=new URLSearchParams(n);t.set(c,e),i(t,{replace:!0})},[n,i]),requestedNodeId:o}}export{l as n,s as r,d as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{J as e}from"./index-BPlvNRqQ.js";var t=e(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as e}from"./index-
|
|
1
|
+
import{J as e}from"./index-BPlvNRqQ.js";var t=e(`mic`,[[`path`,{d:`M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z`,key:`131961`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`,key:`x3vr5v`}]]),n=e(`video`,[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]);export{t as n,n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as e}from"./index-
|
|
1
|
+
import{J as e}from"./index-BPlvNRqQ.js";var t=e(`wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as e}from"./index-
|
|
1
|
+
import{J as e}from"./index-BPlvNRqQ.js";var t=e(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]);export{t};
|
package/dist/index.html
CHANGED
|
@@ -99,13 +99,13 @@
|
|
|
99
99
|
})
|
|
100
100
|
})()
|
|
101
101
|
</script>
|
|
102
|
-
<script type="module" crossorigin src="./assets/mf-entry-bootstrap-0-
|
|
102
|
+
<script type="module" crossorigin src="./assets/mf-entry-bootstrap-0-8757f514.js"></script>
|
|
103
103
|
<link rel="modulepreload" crossorigin href="./assets/__vite-browser-external-B6qJ4svC.js">
|
|
104
104
|
<link rel="modulepreload" crossorigin href="./assets/src-DSOXw8KA.js">
|
|
105
105
|
<link rel="modulepreload" crossorigin href="./assets/player-overlays-jCIm4d2Z.js">
|
|
106
106
|
<link rel="modulepreload" crossorigin href="./assets/src-BurbTgHr.js">
|
|
107
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
108
|
-
<link rel="modulepreload" crossorigin href="./assets/hostInit-DBSKfSb9.js"><link rel="modulepreload" crossorigin href="./assets/index-
|
|
107
|
+
<link rel="stylesheet" crossorigin href="./assets/index-DdPyS5cO.css">
|
|
108
|
+
<link rel="modulepreload" crossorigin href="./assets/hostInit-DBSKfSb9.js"><link rel="modulepreload" crossorigin href="./assets/index-BPlvNRqQ.js"><link rel="modulepreload" crossorigin href="./assets/remoteEntry-CetTBajg.js"><link rel="modulepreload" crossorigin href="./assets/_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-BIxwxeXV.js"><link rel="modulepreload" crossorigin href="./assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js"><link rel="modulepreload" crossorigin href="./assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_client__loadShare__.js-8kv6pj9W.js"><link rel="modulepreload" crossorigin href="./assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.js-DX7sYWrs.js"><link rel="modulepreload" crossorigin href="./assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.js-BsvPG3BX.js"><link rel="modulepreload" crossorigin href="./assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-DtoGixA1.js"></head>
|
|
109
109
|
<body>
|
|
110
110
|
<div id="root"></div>
|
|
111
111
|
<!-- Lock the app shell at 1x zoom. iOS Safari ignores `user-scalable=no`
|
package/dist/server/addon.js
CHANGED
|
@@ -38097,7 +38097,7 @@ var AdminUIAddon = class extends BaseAddon {
|
|
|
38097
38097
|
capability: adminUiCapability,
|
|
38098
38098
|
provider: {
|
|
38099
38099
|
getStaticDir: async () => ({ staticDir: resolveAdminUiDistDir() }),
|
|
38100
|
-
getVersion: async () => ({ version: "1.2.
|
|
38100
|
+
getVersion: async () => ({ version: "1.2.163" })
|
|
38101
38101
|
}
|
|
38102
38102
|
}];
|
|
38103
38103
|
}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{J as e}from"./index-CjToGvfD.js";var t=e(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{J as e}from"./index-CjToGvfD.js";var t=e(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{J as e}from"./index-CjToGvfD.js";var t=e(`circle-slash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{J as e}from"./index-CjToGvfD.js";var t=e(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as e,Q as t,S as n,W as r,o as i,q as a,x as o,z as s}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js";import{at as c}from"./player-overlays-jCIm4d2Z.js";import{Qo as l,g as u,sn as d,us as f,wn as p}from"./src-BurbTgHr.js";import{jt as m}from"./src-DSOXw8KA.js";import{n as h,t as g}from"./format-size-BwFaHYTC.js";import{t as _}from"./pencil-BryYtd6q.js";import{t as v}from"./plus-BpcUYF3u.js";import{t as y}from"./power-D1NeCw53.js";import{J as b,L as x,j as S,o as C,r as w,w as T,z as E}from"./index-CjToGvfD.js";import{t as D}from"./FormBuilder-DJIpbrRD.js";var O=b(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),k=b(`eraser`,[[`path`,{d:`m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21`,key:`182aya`}],[`path`,{d:`M22 21H7`,key:`t4ddhn`}],[`path`,{d:`m5 11 9 9`,key:`1mo9qw`}]]);t();function A(e){let t=e.trim().toLowerCase();return t.length===0?``:t.replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)}function j(e,t){let n=A(t);return`${e}:${n.length>0?n:`default`}`}var M=new Set([`proc`,`sys`,`dev`,`run`,`boot`,`lost+found`,`snap`,`bin`,`sbin`,`lib`,`lib32`,`lib64`,`libx32`,`usr`,`etc`,`var`,`opt`,`tmp`,`srv`,`root`,`System`,`Library`,`Applications`,`cores`,`private`]),N=[`recordings`,`data`,`mnt`,`media`,`Volumes`];function P(e){let t=N.findIndex(t=>t===`recordings`?e.startsWith(t):e===t);return t===-1?N.length:t}function F(e){return e.filter(e=>!e.name.startsWith(`.`)&&!M.has(e.name)).toSorted((e,t)=>{let n=P(e.name)-P(t.name);return n===0?e.name.localeCompare(t.name):n}).map(e=>e.path)}function I({nodeId:t,value:r,onChange:i}){let l=c().trpcClient,[u,d]=a([]),[f,p]=a(r),[m,h]=a(null),[g,_]=a(null),[v,y]=a(``),b=e(async(e,n)=>{_(null);try{let r=await l.filesystemBrowse.browse.query({nodeId:t,path:e});h(r),p(r.path),n&&i(r.path)}catch(e){_(e instanceof Error?e.message:`browse failed`)}},[l,t,i]);s(()=>{p(r),(async()=>{let e=await l.filesystemBrowse.browse.query({nodeId:t,path:`/`}).then(e=>e).catch(()=>null);if(e){d(F(e.entries)),await b(r.startsWith(`/`)?r:`/`,!1);return}try{let e=await l.filesystemBrowse.listAllowedRoots.query({nodeId:t});d(e),await b(r&&e.some(e=>r.startsWith(e))?r:e[0]??``,!1)}catch(e){d([]),h(null),_(e instanceof Error&&/not available on node/i.test(e.message)?`This node can't be browsed remotely. Enter the path manually.`:e instanceof Error?e.message:`browse unavailable`)}})()},[t]);let x=async()=>{if(!(!v.trim()||!m)){_(null);try{let e=`${m.path.replace(/\/+$/,``)}/${v.trim()}`;await l.filesystemBrowse.createDir.mutate({nodeId:t,path:e}),y(``),await b(m.path,!0)}catch(e){_(e instanceof Error?e.message:`create failed`)}}},S=e=>`${(e/1e9).toFixed(1)} GB`;return n(`div`,{className:`space-y-2 rounded border border-border p-2`,children:[o(`div`,{className:`flex flex-wrap gap-1`,children:u.map(e=>o(`button`,{onClick:()=>void b(e,!0),className:`rounded border border-border px-2 py-0.5 text-[10px] font-mono hover:border-primary/40`,children:e},e))}),o(`input`,{value:f,onChange:e=>{p(e.target.value),i(e.target.value)},placeholder:`/absolute/path`,className:`w-full rounded border border-border bg-background px-2 py-1 text-[11px] font-mono`}),m&&n(`div`,{className:`text-[10px] text-foreground-subtle`,children:[S(m.freeBytes),` free / `,S(m.totalBytes)]}),o(`div`,{className:`max-h-40 space-y-0.5 overflow-y-auto`,children:m?.entries.map(e=>n(`button`,{onClick:()=>void b(e.path,!0),className:`block w-full truncate rounded px-2 py-1 text-left text-xs hover:bg-primary/5`,children:[`📁 `,e.name]},e.path))}),n(`div`,{className:`flex gap-1`,children:[o(`input`,{value:v,onChange:e=>y(e.target.value),placeholder:`new folder`,className:`flex-1 rounded border border-border bg-background px-2 py-1 text-xs`}),o(`button`,{onClick:()=>void x(),className:`rounded border border-border px-2 py-1 text-xs hover:border-primary/40`,children:`Create`})]}),g&&o(`div`,{className:`text-[10px] text-red-400`,children:g})]})}t();function L({initialType:e,onClose:t,onCreated:s}){let d=i(),p=c().trpcClient,[m,h]=a(`picker`),[g,_]=a(e),[v,y]=a(null),[b,S]=a({}),[C,E]=a(``),[O,k]=a(null),[A,M]=a(!1),[N,P]=a(`hub`),[F,L]=a(null),[R,z]=a(!1),B=e=>S(t=>({...t,basePath:e})),V=typeof b.basePath==`string`?b.basePath:``,H=l(),U=r(()=>{let e=H.data;return Array.isArray(e)?e:[]},[H.data]),W=H.isLoading,G=f({onSuccess:()=>{d.invalidateQueries({queryKey:[[`storage`,`listLocations`]]}),s()}}),K=r(()=>O!==null&&O.length>0?O:j(g,C),[g,C,O]),q=async()=>{if(v){z(!0),L(null);try{L(await(e=>p.storage.testConfig.query(e))({providerId:v.providerId,config:b}))}catch(e){L({ok:!1,error:e instanceof Error?e.message:String(e)})}finally{z(!1)}}};return o(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm`,onClick:t,children:n(`div`,{className:`w-full max-w-md rounded-xl border border-border bg-surface shadow-2xl`,onClick:e=>e.stopPropagation(),children:[n(`div`,{className:`flex items-start justify-between border-b border-border px-4 py-3`,children:[n(`div`,{className:`space-y-0.5`,children:[o(`h2`,{className:`text-sm font-semibold text-foreground`,children:{picker:`Add Location — Pick provider`,config:`Add Location — ${v?.displayName??``}`,naming:`Add Location — Name`}[m]}),n(`p`,{className:`text-xs text-foreground-subtle`,children:[`Type: `,o(`span`,{className:`font-mono`,children:g})]})]}),o(`button`,{onClick:t,className:`text-foreground-subtle hover:text-foreground`,children:o(w,{className:`h-4 w-4`})})]}),m===`picker`&&n(`div`,{className:`p-4 space-y-2`,children:[W&&o(`div`,{className:`text-xs text-foreground-subtle animate-pulse`,children:`Loading providers…`}),!W&&U.length===0&&n(`div`,{className:`rounded border border-border bg-background px-3 py-4 text-center text-xs text-foreground-subtle`,children:[`No storage-provider supports type "`,g,`". Install a compatible addon (e.g.`,` `,o(`code`,{className:`font-mono`,children:`remote-storage`}),`) to enable it.`]}),U.map(e=>n(`button`,{onClick:()=>{y(e),h(`config`)},className:`flex w-full items-center gap-3 rounded-lg border border-border bg-background p-3 text-left hover:border-primary/40 hover:bg-primary/5 transition-colors`,children:[n(`div`,{className:`flex-1 min-w-0`,children:[o(`p`,{className:`text-xs font-semibold text-foreground`,children:e.displayName}),o(`p`,{className:`text-[10px] text-foreground-subtle font-mono mt-0.5 truncate`,children:e.providerId})]}),o(x,{className:`h-4 w-4 text-foreground-subtle flex-shrink-0`})]},e.providerId))]}),m===`config`&&v&&n(`div`,{className:`p-4 space-y-3 max-h-[60vh] overflow-y-auto`,children:[o(D,{schema:v.configSchema,values:b,onChange:S}),v.nodeLocal&&n(`div`,{className:`space-y-2`,children:[o(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Node`}),o(u,{selectedNodeId:N,onSelect:P,alwaysShow:!0}),o(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Path`}),o(I,{nodeId:N,value:V,onChange:B})]}),F&&o(`div`,{className:`rounded border px-3 py-2 text-[11px] ${F.ok?`border-success/30 bg-success/5 text-success`:`border-danger/30 bg-danger/5 text-danger`}`,children:F.ok?`Connection OK.`:`Test failed: ${F.error??`unknown error`}`}),n(`div`,{className:`flex items-center justify-between pt-1`,children:[o(`button`,{onClick:()=>h(`picker`),className:`rounded px-3 py-1.5 text-xs text-foreground-subtle border border-border hover:text-foreground`,children:`Back`}),n(`div`,{className:`flex items-center gap-2`,children:[o(`button`,{onClick:()=>{q()},disabled:R,className:`rounded border border-border px-3 py-1.5 text-xs text-foreground hover:bg-primary/10 disabled:opacity-50`,children:R?`Testing…`:`Test connection`}),o(`button`,{onClick:()=>h(`naming`),className:`rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90`,children:`Next`})]})]})]}),m===`naming`&&v&&n(`div`,{className:`p-4 space-y-3`,children:[n(`div`,{className:`space-y-1`,children:[o(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Display name`}),o(`input`,{type:`text`,value:C,onChange:e=>E(e.target.value),placeholder:`${g} on ${v.displayName}`,className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`})]}),n(`div`,{className:`space-y-1`,children:[n(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:[`Id`,` `,o(`span`,{className:`lowercase tracking-normal text-foreground-subtle`,children:`— auto-derived; override if needed`})]}),o(`input`,{type:`text`,value:K,onChange:e=>k(e.target.value),placeholder:j(g,C),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground font-mono focus:outline-none focus:ring-1 focus:ring-primary`}),n(`p`,{className:`text-[10px] text-foreground-subtle`,children:[`Format: `,o(`code`,{className:`font-mono`,children:`<type>:<slug>`}),`. Lowercase letters, digits, and hyphens only.`]})]}),n(`label`,{className:`flex items-start gap-2 rounded border border-border bg-background px-3 py-2 cursor-pointer hover:bg-primary/5`,children:[o(`input`,{type:`checkbox`,checked:A,onChange:e=>M(e.target.checked),className:`accent-primary mt-0.5`}),n(`div`,{className:`space-y-0.5`,children:[o(`div`,{className:`text-xs font-medium text-foreground`,children:`Enable immediately`}),o(`div`,{className:`text-[10px] text-foreground-subtle`,children:`A disabled location receives no writes until enabled — reads and age-based retention still work, nothing new lands here. Leave this off to register the disk now and start using it later.`})]})]}),G.isError&&o(`div`,{className:`rounded border border-danger/30 bg-danger/5 text-danger px-3 py-2 text-[11px]`,children:G.error instanceof Error?G.error.message:String(G.error)}),n(`div`,{className:`flex items-center justify-between pt-1`,children:[o(`button`,{onClick:()=>h(`config`),className:`rounded px-3 py-1.5 text-xs text-foreground-subtle border border-border hover:text-foreground`,children:`Back`}),n(`div`,{className:`flex items-center gap-2`,children:[o(`button`,{onClick:()=>{_(e),y(null),S({}),E(``),k(null),M(!1),L(null),h(`picker`)},className:`rounded px-3 py-1.5 text-xs text-foreground-subtle border border-border hover:text-foreground`,children:`Reset`}),n(`button`,{onClick:()=>{v&&G.mutate({id:K,type:g,displayName:C.trim(),providerId:v.providerId,config:b,enabled:A,nodeId:v.nodeLocal?N:void 0})},disabled:G.isPending||C.trim().length===0,className:`inline-flex items-center gap-1.5 rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50`,children:[G.isPending?o(T,{className:`h-3.5 w-3.5 animate-spin`}):null,G.isPending?`Saving…`:`Save`]})]})]})]})]})})}function R(e){return m(e)}function z(e){return e===`active`}var B=[{mode:`active`,label:`Active`,consequence:`New data is written here, and the oldest is deleted when the disk fills up.`,requiresConfirmation:!1},{mode:`readonly`,label:`Read-only`,consequence:`Nothing new is written and nothing is ever deleted. A frozen archive that stays on the timeline.`,requiresConfirmation:!1},{mode:`drain`,label:`Drain`,consequence:`Nothing new is written. The oldest data here is deleted, a little at a time, until this location is empty.`,requiresConfirmation:!1},{mode:`disabled`,label:`Disabled`,consequence:`Nothing is written and nothing is read: the footage stored here disappears from the timeline until you turn it back on. Nothing is deleted.`,requiresConfirmation:!0}];function V(e){return B.find(t=>t.mode===e)??B[0]}function H(e){return V(e).requiresConfirmation}var U=`Blocked: this is the last location of its type still accepting writes — new data would have nowhere to go.`;function W(e,t,n){return z(n)||!z(R(e))||t.some(t=>t.id!==e.id&&z(R(t)))?{blocked:!1,reason:``}:{blocked:!0,reason:U}}function G(e,t){return{active:W(e,t,`active`).reason,readonly:W(e,t,`readonly`).reason,drain:W(e,t,`drain`).reason,disabled:W(e,t,`disabled`).reason}}function K(e,t,n){return!(n===`single`||t.length<=1||z(R(e))&&t.filter(e=>z(R(e))).length<=1)}function q(e){return e===`active`?{enabled:!0,readOnly:!1}:e===`readonly`?{enabled:!1,readOnly:!1}:{enabled:!1,readOnly:!0}}function ee(e,t){let n={...t.config??e.config};t.mode!==void 0&&(q(t.mode).readOnly?n.readOnly=!0:delete n.readOnly);let r={id:e.id,type:e.type,displayName:t.displayName??e.displayName,providerId:e.providerId,config:n,isSystem:e.isSystem},i=t.nodeId??e.nodeId,a=i===void 0?r:{...r,nodeId:i};return t.mode===void 0?e.enabled===void 0?a:{...a,enabled:e.enabled}:{...a,mode:t.mode,enabled:q(t.mode).enabled}}var te=1024**3;function J(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function ne(e){let t=J(e.minFreeGb);if(t!==null)return{unit:`gb`,value:t};let n=J(e.minFreePercent);return n===null?{unit:`percent`,value:null}:{unit:`percent`,value:n}}function re(e,t){let n={...e};return delete n.minFreePercent,delete n.minFreeGb,t.value===null?n:t.unit===`gb`?{...n,minFreeGb:t.value}:{...n,minFreePercent:t.value}}function ie(e,t){let n=e.trim();if(n===``)return null;let r=Number(n);return Number.isFinite(r)?t===`percent`?Math.min(100,Math.max(0,r)):Math.max(0,r):null}function ae(e,t,n=10){if(e.unit===`gb`&&e.value!==null)return e.value*te;let r=e.value??n;return t===null||t<=0?null:t*Math.min(100,Math.max(0,r))/100}function oe(e){return e===`gb`?`GB to keep free`:`% of the volume to keep free`}function se(e,t=10){return`CamStack keeps ${e.value===null?`${String(t)}% of the volume (the default)`:e.unit===`gb`?`${String(e.value)} GB`:`${String(e.value)}% of the volume`} free on this disk. As it fills up, the OLDEST data stored here is deleted to hold that much free space; if it cannot be held any more, new data goes to another location of the same type instead of filling the disk. Leave the value empty for the default (${String(t)}%).`}function ce(e){return J(e.maxUsedGb)}function le(e,t){let n=J(e.maxUsedGb);return n===null||n<0?null:{bytes:n*te,reason:t===`drain`?`drain`:`legacy`}}t();function ue({location:e,onClose:t,onSaved:s}){let d=i(),p=c().trpcClient,[m,h]=a({...e.config}),[g,_]=a(e.displayName),[v,y]=a(null),[b,x]=a(!1),S=l(),C=r(()=>{let t=S.data;return Array.isArray(t)?t.find(t=>t.providerId===e.providerId)??null:null},[S.data,e.providerId]),E=f({onSuccess:()=>{d.invalidateQueries({queryKey:[[`storage`,`listLocations`]]}),s()}}),O=C?.shouldSaveDiskSpace===!0,k=C?.nodeLocal===!0,[A,j]=a(typeof e.nodeId==`string`?e.nodeId:`hub`),M=typeof m.basePath==`string`?m.basePath:``,N=e=>h(t=>({...t,basePath:e})),P=ne(m),F=C?.minFreePercent??10,L=e=>{h(t=>re(t,e))},R=e=>{L({unit:e,value:null})},z=e=>{L({unit:P.unit,value:ie(e,P.unit)})},B=ce(m),V=async()=>{x(!0),y(null);try{y(await(e=>p.storage.testConfig.query(e))({providerId:e.providerId,locationId:e.id,config:m}))}catch(e){y({ok:!1,error:e instanceof Error?e.message:String(e)})}finally{x(!1)}};return o(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm`,onClick:t,children:n(`div`,{className:`w-full max-w-md rounded-xl border border-border bg-surface shadow-2xl`,onClick:e=>e.stopPropagation(),children:[n(`div`,{className:`flex items-start justify-between border-b border-border px-4 py-3`,children:[n(`div`,{className:`space-y-0.5`,children:[n(`h2`,{className:`text-sm font-semibold text-foreground`,children:[`Edit `,e.displayName]}),n(`p`,{className:`text-xs text-foreground-subtle`,children:[o(`span`,{className:`font-mono`,children:e.id}),` ·`,` `,C?.displayName??e.providerId]})]}),o(`button`,{onClick:t,className:`text-foreground-subtle hover:text-foreground`,children:o(w,{className:`h-4 w-4`})})]}),n(`div`,{className:`p-4 space-y-3 max-h-[60vh] overflow-y-auto`,children:[n(`div`,{className:`space-y-1`,children:[o(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Display name`}),o(`input`,{type:`text`,value:g,onChange:e=>_(e.target.value),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`})]}),C&&o(D,{schema:C.configSchema,values:m,onChange:h}),k&&n(`div`,{className:`space-y-2`,children:[o(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Node`}),o(u,{selectedNodeId:A,onSelect:j,alwaysShow:!0}),o(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Path`}),o(I,{nodeId:A,value:M,onChange:N})]}),O&&n(`div`,{className:`space-y-1`,children:[o(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Protected free space`}),n(`div`,{className:`flex items-center gap-2`,children:[n(`select`,{"aria-label":`Protection unit`,value:P.unit,onChange:e=>{R(e.target.value===`gb`?`gb`:`percent`)},className:`rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`,children:[o(`option`,{value:`percent`,children:`% of the volume`}),o(`option`,{value:`gb`,children:`GB of free space`})]}),o(`input`,{type:`number`,"aria-label":oe(P.unit),min:0,max:P.unit===`percent`?100:void 0,value:P.value===null?``:P.value,placeholder:P.unit===`percent`?String(F):`default`,onChange:e=>{z(e.target.value)},className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`})]}),o(`p`,{className:`text-[10px] text-foreground-subtle`,children:se(P,F)}),B!==null&&n(`p`,{className:`text-[10px] text-foreground-subtle italic`,children:[`This location also stores a maximum used size of `,B,` GB. That limit is managed by the system now and is no longer editable here; it is kept as it is.`]})]}),!C&&!S.isLoading&&n(`div`,{className:`rounded border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-[11px] text-amber-700 dark:text-amber-300`,children:[`Provider `,o(`code`,{className:`font-mono`,children:e.providerId}),` is no longer registered. Field schema unavailable; raw config is preserved on save.`]}),v&&o(`div`,{className:`rounded border px-3 py-2 text-[11px] ${v.ok?`border-success/30 bg-success/5 text-success`:`border-danger/30 bg-danger/5 text-danger`}`,children:v.ok?`Connection OK.`:`Test failed: ${v.error??`unknown error`}`}),E.isError&&o(`div`,{className:`rounded border border-danger/30 bg-danger/5 text-danger px-3 py-2 text-[11px]`,children:E.error instanceof Error?E.error.message:String(E.error)})]}),n(`div`,{className:`flex items-center justify-between gap-2 border-t border-border px-4 py-3`,children:[o(`button`,{onClick:t,className:`rounded px-3 py-1.5 text-xs text-foreground-subtle border border-border hover:text-foreground`,children:`Cancel`}),n(`div`,{className:`flex items-center gap-2`,children:[o(`button`,{onClick:()=>{V()},disabled:b||!C,className:`rounded border border-border px-3 py-1.5 text-xs text-foreground hover:bg-primary/10 disabled:opacity-50`,children:b?`Testing…`:`Test connection`}),n(`button`,{onClick:()=>{E.mutate(ee(e,{displayName:g.trim(),config:m,nodeId:k?A:e.nodeId}))},disabled:E.isPending||g.trim().length===0,className:`inline-flex items-center gap-1.5 rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50`,children:[E.isPending?o(T,{className:`h-3.5 w-3.5 animate-spin`}):null,E.isPending?`Saving…`:`Save`]})]})]})]})})}var de=[`ok`,`warn`,`critical`];function fe(e){return e>=.95?`critical`:e>=.85?`warn`:`ok`}function pe(e){return Math.min(1,Math.max(0,e))}function Y(e){let{availableBytes:t,totalBytes:n}=e;if(n===null||n<=0||t===null)return null;let r=pe((n-t)/n);return{fraction:r,severity:fe(r),recordingsFraction:pe(e.usedBytes/n),freeBytes:t,totalBytes:n}}function me(e){if(e.length===0)return null;let t=0,n=0,r=0,i=0,a=null;for(let o of e){let e=Y(o);if(e===null){n+=1;continue}t+=1,r+=e.totalBytes,i+=e.freeBytes,(a===null||de.indexOf(e.severity)>de.indexOf(a))&&(a=e.severity)}return{knownVolumes:t,unknownVolumes:n,totalBytes:r,freeBytes:i,severity:a}}var he=`Capacity unknown — this volume did not report its size.`;function X(e){return Math.min(1,Math.max(0,e))}function Z(e){return Math.round(X(e)*1e3)/10}function ge(e){return`${String(Math.round(X(e)*100))}%`}function _e(e,t,n={}){let{totalBytes:r,availableBytes:i}=e;if(r===null||r<=0||i===null)return{kind:`unknown`,summary:he};let a=Math.min(Math.max(i,0),r),o=r-a,s=n.ownedBytes,c=s==null||!Number.isFinite(s)||s<0?null:s,l=Y({usedBytes:c??o,availableBytes:a,totalBytes:r}),u=l===null?X(o/r):l.fraction,d=l===null?fe(u):l.severity,f=c===null?null:l===null?X(c/r):l.recordingsFraction,p=1-u,m=t===null||t<=0?0:t,h=X(m/r),_=m>a,v=n.cap??null,y=v===null?null:X(v.bytes/r),b=v!==null&&c!==null&&c>v.bytes,x={free:g(a),freePercent:ge(p),total:g(r),reserve:m===0?null:`${g(m)} kept free`,owned:c===null||f===null?null:`${g(c)} of recordings (${ge(f)})`,cap:v===null?null:v.reason===`drain`?`${g(v.bytes)} drain target (managed by CamStack)`:`${g(v.bytes)} cap (managed by CamStack)`},S=[`${x.free} free of ${x.total} (${x.freePercent} free)`,x.owned===null?null:`CamStack holds ${x.owned}`,x.reserve===null?null:_?`${x.reserve} — less free than that right now, the oldest data here is being deleted`:x.reserve,x.cap===null?null:b?`${x.cap} — already below what is stored here, the oldest is being deleted`:x.cap].filter(e=>e!==null).join(` · `);return{kind:`known`,severity:d,segments:{usedPercent:Z(u),freePercent:Z(p),reservePercent:Z(h),ownedPercent:f===null?null:Z(f),capPercent:y===null?null:Z(y)},labels:x,reserveExceedsFree:_,capBelowOwned:b,summary:S}}var ve={ok:`bg-primary`,warn:`bg-amber-500`,critical:`bg-danger`},ye={ok:`text-foreground-subtle`,warn:`text-amber-500`,critical:`text-danger`};function be({location:e,ownedBytes:t}){let r=e.capacity??null,i=ae(ne(e.config),r?.totalBytes??null),a=_e({totalBytes:r?.totalBytes??null,availableBytes:r?.availableBytes??null},i,{ownedBytes:t??null,cap:le(e.config,R(e))});return a.kind===`unknown`?o(`span`,{className:`text-[10px] text-foreground-subtle italic`,title:a.summary,children:`Capacity unknown`}):n(`span`,{className:`flex items-center gap-2 min-w-0`,title:a.summary,children:[n(`span`,{className:`relative h-1.5 w-28 shrink-0 overflow-hidden rounded-full bg-border`,children:[o(`span`,{className:`absolute inset-y-0 left-0 ${ve[a.severity]}`,style:{width:`${String(a.segments.usedPercent)}%`}}),a.segments.ownedPercent!==null&&o(`span`,{className:`absolute inset-y-0 left-0 bg-foreground/50`,style:{width:`${String(a.segments.ownedPercent)}%`}}),a.segments.capPercent!==null&&o(`span`,{className:`absolute inset-y-0 w-px ${a.capBelowOwned?`bg-danger`:`bg-foreground`}`,style:{left:`${String(a.segments.capPercent)}%`}}),a.segments.reservePercent>0&&o(`span`,{className:`absolute inset-y-0 right-0 border-l border-danger ${a.reserveExceedsFree?`bg-danger/60`:`bg-danger/25`}`,style:{width:`${String(a.segments.reservePercent)}%`}})]}),n(`span`,{className:`text-[10px] tabular-nums ${ye[a.severity]}`,children:[a.labels.free,` free (`,a.labels.freePercent,`) of `,a.labels.total]}),a.labels.owned!==null&&n(`span`,{className:`text-[10px] tabular-nums text-foreground-subtle`,children:[`· CamStack `,a.labels.owned]}),a.labels.cap!==null&&n(`span`,{className:`text-[10px] tabular-nums ${a.capBelowOwned?`text-danger`:`text-foreground-subtle`}`,children:[`· `,a.labels.cap]}),a.labels.reserve!==null&&n(`span`,{className:`text-[10px] tabular-nums ${a.reserveExceedsFree?`text-danger`:`text-foreground-subtle`}`,children:[`· `,a.labels.reserve]})]})}var xe={eventMedia:[`events`],recordingsLow:[`low`],recordings:[`high`,`mid`]},Se={eventMedia:`pipeline-analytics`,recordingsLow:`recorder`,recordings:`recorder`},Ce=`storage.discardLocation`,we=`storage.discardLocationStatus`,Te=`storage.discardLocationCancel`;function Ee(e){return xe[e]??null}function De(e){return Se[e]??null}function Oe(e){return!z(R(e))}function ke(e,t){return Ee(e.type)===null||!Oe(e)?!1:t.some(t=>t.id!==e.id&&z(R(t)))}var Ae=new Set([`idle`,`scanning`,`wiping-fs`,`wiping-db`,`cascading`,`complete`,`cancelled`,`error`]);function Q(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function $(e){return typeof e==`string`?e:null}function je(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.running!=`boolean`)return null;let n=t.phase;if(typeof n!=`string`||!Ae.has(n))return null;let r=Q(t.camerasTotal),i=Q(t.camerasDone),a=Q(t.foldersRemoved),o=Q(t.dbRowsDeleted),s=Q(t.ownersCascaded);return r===null||i===null||a===null||o===null||s===null?null:{running:t.running,locationId:$(t.locationId),jobId:$(t.jobId),phase:n,camerasTotal:r,camerasDone:i,foldersRemoved:a,dbRowsDeleted:o,ownersCascaded:s,detail:$(t.detail)??``,startedAtMs:Q(t.startedAtMs),finishedAtMs:Q(t.finishedAtMs),error:$(t.error)}}function Me(e){if(e.phase===`complete`)return 100;if(e.phase===`cancelled`||e.phase===`error`||e.phase===`idle`)return e.camerasTotal>0?Math.min(99,Math.round(e.camerasDone/e.camerasTotal*100)):0;if(e.camerasTotal>0){let t=e.camerasDone/e.camerasTotal*85;return e.phase===`wiping-db`?Math.min(95,Math.round(t+8)):e.phase===`cascading`?Math.min(99,Math.round(t+12)):Math.min(85,Math.round(t))}return e.phase===`scanning`?2:5}t();var Ne=2e3;function Pe({location:e,siblings:t}){return ke(e,t)?o(Fe,{location:e}):null}function Fe({location:e}){let t=d(),r=p(),i=De(e.type),[c,l]=a(null),[u,f]=a(null),[m,h]=a(!1);if(s(()=>{if(i===null)return;let e=!1,t=async()=>{try{let t=await r.mutateAsync({addonId:i,action:we,input:{}});if(e)return;l(je(t))}catch{}};t();let n=setInterval(()=>void t(),Ne);return()=>{e=!0,clearInterval(n)}},[i,e.id]),i===null)return null;let g=c!==null&&c.locationId===e.id,_=g&&c.running,v=g&&c.phase!==`idle`,y=async()=>{if(await t({title:`Discard leftovers on "${e.displayName}"?`,message:`Permanently deletes leftover files and records on this location. Other locations are not affected. This cannot be undone and may take hours.`,confirmLabel:`Discard leftovers`,variant:`danger`})){f(null),h(!0);try{await r.mutateAsync({addonId:i,action:Ce,input:{locationId:e.id}}),l(je(await r.mutateAsync({addonId:i,action:we,input:{}})))}catch(e){f(e instanceof Error?e.message:String(e))}finally{h(!1)}}},b=async()=>{try{await r.mutateAsync({addonId:i,action:Te,input:{}})}catch(e){f(e instanceof Error?e.message:String(e))}};return n(`div`,{className:`flex flex-col gap-1 min-w-[9rem] max-w-[16rem]`,children:[_?n(`button`,{type:`button`,onClick:()=>void b(),className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-danger border border-danger/40 hover:bg-danger/10`,children:[o(w,{className:`h-3 w-3`}),`Cancel`]}):n(`button`,{type:`button`,onClick:()=>void y(),disabled:m,title:`Permanently delete leftover files on this location. Other locations are not affected.`,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-danger border border-danger/40 hover:bg-danger/10 disabled:opacity-50`,children:[m?o(T,{className:`h-3 w-3 animate-spin`}):o(k,{className:`h-3 w-3`}),`Discard leftovers`]}),v&&c!==null&&n(`div`,{className:`space-y-0.5`,children:[o(`div`,{className:`h-1 rounded bg-border overflow-hidden`,children:o(`div`,{className:`h-full bg-primary transition-[width] duration-300`,style:{width:`${Me(c)}%`}})}),n(`p`,{className:`text-[10px] text-foreground-subtle leading-tight`,children:[c.phase,c.camerasTotal>0?` · ${c.camerasDone}/${c.camerasTotal} cam`:``,c.dbRowsDeleted>0?` · ${c.dbRowsDeleted} rows`:``,c.detail?` · ${c.detail}`:``]})]}),(u||g&&c?.error)&&o(`p`,{className:`text-[10px] text-danger leading-tight`,children:u??c?.error})]})}t();var Ie={active:y,readonly:O,drain:h,disabled:S},Le={active:`border-success/30 text-success hover:bg-success/10`,readonly:`border-border text-foreground-subtle hover:text-foreground hover:bg-primary/10`,drain:`border-warning/40 text-warning hover:bg-warning/10`,disabled:`border-danger/40 text-danger hover:bg-danger/10`};function Re({mode:e,blockedReasons:t,onSelect:r}){let[i,s]=a(!1),c=V(e),l=Ie[e];return n(`span`,{className:`relative inline-flex`,children:[n(`button`,{type:`button`,"aria-haspopup":`menu`,"aria-expanded":i,"aria-label":`Location state`,onClick:()=>s(e=>!e),title:c.consequence,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium border ${Le[e]}`,children:[o(l,{className:`h-3 w-3`}),c.label,o(E,{className:`h-3 w-3`})]}),i&&o(`span`,{role:`menu`,"aria-label":`Location state choices`,className:`absolute right-0 top-full z-20 mt-1 w-80 rounded-lg border border-border bg-surface p-1 shadow-xl`,children:B.map(i=>{let a=t[i.mode],c=a!==``,l=Ie[i.mode],u=i.mode===e;return n(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":u,"aria-label":i.label,disabled:c,onClick:()=>{c||(s(!1),u||r(i.mode))},className:`flex w-full flex-col items-start gap-0.5 rounded px-2 py-1.5 text-left ${c?`cursor-not-allowed opacity-60`:u?`bg-primary/10`:`hover:bg-primary/5`}`,children:[n(`span`,{className:`flex items-center gap-1.5 text-[11px] font-medium text-foreground`,children:[o(l,{className:`h-3 w-3`}),i.label,u&&o(`span`,{className:`text-[9px] uppercase text-primary`,children:`current`})]}),o(`span`,{className:`text-[10px] leading-snug text-foreground-subtle`,children:i.consequence}),c&&o(`span`,{className:`text-[10px] leading-snug text-warning`,children:a})]},i.mode)})})]})}var ze=`Remaining not reported yet`,Be=`Estimated empty time not available yet`;function Ve(e,t){let n=new Date(e);if(Number.isNaN(n.getTime()))return Be;let r=n.toLocaleString();return e<=t?`Estimated empty by now (${r})`:`Estimated empty ${r}`}function He(e,t){let n=e.remainingBytes,r=n!==null&&Number.isFinite(n)&&n>=0?n:null,i=r===0;return{remainingLabel:r===null?ze:i?`Empty — nothing left on this location`:`${g(r)} left to move off`,etaLabel:i?`Drain finished`:e.estimatedEmptyAtMs===null?Be:Ve(e.estimatedEmptyAtMs,t),complete:i}}function Ue(e){let t=e.basePath;if(typeof t==`string`&&t.length>0)return t;let n=Object.keys(e);return n.length===0?``:n.join(`, `)}var We={remainingBytes:null,estimatedEmptyAtMs:null};function Ge({location:e,onEdit:t,onDelete:r,onSetMode:i,blockedReasons:a,canDelete:s,siblings:c=[],drain:l,ownedBytes:u}){let d=Ue(e.config),f=R(e),p=f===`drain`?He(l??We,Date.now()):null;return n(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2 px-3 py-2 border-t border-border first:border-t-0 hover:bg-primary/5`,children:[n(`div`,{className:`flex flex-wrap items-center gap-2 min-w-0 flex-1 basis-64`,children:[o(`span`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle bg-background border border-border rounded px-1.5 py-0.5 font-mono`,children:e.providerId}),n(`div`,{className:`min-w-0`,children:[o(`div`,{className:`text-xs font-medium text-foreground truncate`,children:e.displayName}),n(`div`,{className:`flex flex-wrap items-center gap-x-2`,children:[d&&o(`span`,{className:`text-[10px] text-foreground-subtle truncate font-mono`,children:d}),o(be,{location:e,ownedBytes:u??null})]}),p!==null&&n(`div`,{className:`text-[10px] text-warning`,children:[`Draining · `,p.remainingLabel,` · `,p.etaLabel]})]})]}),n(`div`,{className:`flex flex-wrap items-center gap-1 shrink-0`,children:[o(Pe,{location:e,siblings:c}),o(Re,{mode:f,blockedReasons:a,onSelect:t=>i(e,t)}),n(`button`,{onClick:()=>t(e),className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-foreground-subtle border border-border hover:text-foreground hover:bg-primary/10`,children:[o(_,{className:`h-3 w-3`}),`Edit`]}),s&&o(`button`,{onClick:()=>r(e),className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-danger hover:bg-danger/10`,title:`Delete location`,children:o(C,{className:`h-3 w-3`})})]})]})}t();function Ke({type:e,displayName:t,description:i,cardinality:a,locations:s,onAdd:c,onEdit:l,onDelete:u,onSetMode:d,ownedBytesById:f}){let p=r(()=>{let e=[...s];return e.sort((e,t)=>{let n=z(R(e));return n===z(R(t))?e.displayName.localeCompare(t.displayName):n?-1:1}),e},[s]);return n(`div`,{className:`rounded-lg border border-border bg-surface`,children:[n(`div`,{className:`flex items-start justify-between border-b border-border px-3 py-2`,children:[n(`div`,{className:`space-y-0.5`,children:[n(`div`,{className:`flex items-center gap-2`,children:[o(`span`,{className:`text-sm font-semibold text-foreground capitalize`,children:t}),o(`span`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle bg-background border border-border rounded px-1.5 py-0.5 font-mono`,children:e})]}),i&&o(`p`,{className:`text-[11px] text-foreground-subtle`,children:i}),a===`single`&&o(`p`,{className:`text-[10px] text-foreground-subtle italic`,children:`Single — one location per type. Edit the existing entry; it can't be split.`})]}),a===`multi`&&n(`button`,{onClick:()=>c(e),className:`inline-flex items-center gap-1 rounded bg-primary px-2 py-1 text-[11px] font-medium text-primary-foreground hover:bg-primary/90`,children:[o(v,{className:`h-3 w-3`}),`Add`]})]}),p.length===0?o(`div`,{className:`px-3 py-4 text-center text-[11px] text-foreground-subtle italic`,children:a===`multi`?`No location registered. Click "Add" to register one.`:`No location registered yet — should be auto-seeded at next boot.`}):o(`div`,{children:p.map(e=>o(Ge,{location:e,cardinality:a,canDelete:K(e,p,a),onEdit:l,onDelete:u,onSetMode:d,blockedReasons:G(e,p),ownedBytes:f?.get(e.id)??null,siblings:p},e.id))})]})}var qe=[`recordings`,`recordingsLow`];function Je(e){return e.locationIds!==void 0&&e.locationIds.length>0?e.locationIds:e.locationId===null?[]:[e.locationId]}function Ye(e,t){if(t===void 0||!qe.includes(e.type))return null;let n=t.find(t=>Je(t).includes(e.id));return n===void 0||!Number.isFinite(n.usedBytes)||n.usedBytes<0?null:n.usedBytes}function Xe(e,t){let n=new Map;for(let r of e){let e=Ye(r,t);e!==null&&n.set(r.id,e)}return n}export{ue as a,H as c,me as i,L as l,Ke as n,ee as o,Y as r,V as s,Xe as t,O as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{J as e}from"./index-CjToGvfD.js";var t=e(`play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{J as e}from"./index-CjToGvfD.js";var t=e(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{J as e}from"./index-CjToGvfD.js";var t=e(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{J as e}from"./index-CjToGvfD.js";var t=e(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{J as e}from"./index-CjToGvfD.js";var t=e(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{J as e}from"./index-CjToGvfD.js";var t=e(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{J as e}from"./index-CjToGvfD.js";var t=e(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]);export{t};
|