@camstack/addon-admin-ui 1.2.166 → 1.2.168
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-CE_BZcbG.js → AddonCollectionPage-Bq1BZDbI.js} +1 -1
- package/dist/assets/{Addons-D8Q3FEoH.js → Addons-BGGsoGOA.js} +1 -1
- package/dist/assets/{AdminTabs-CagIM2z5.js → AdminTabs-CP8s-xwD.js} +1 -1
- package/dist/assets/{AiProfiles-BXQBsWYJ.js → AiProfiles-CLg0JvOt.js} +1 -1
- package/dist/assets/{BrokerForm-C-Lt2xkt.js → BrokerForm-OAq0B61g.js} +1 -1
- package/dist/assets/{Build-CF7q3F-f.js → Build-D9zSW4UB.js} +1 -1
- package/dist/assets/{Capabilities-StWIaP4h.js → Capabilities-DzD-O01_.js} +1 -1
- package/dist/assets/{CapabilityBadges-Bh8vc99t.js → CapabilityBadges-OFEks7tj.js} +1 -1
- package/dist/assets/{Cluster-DuHxL1Qr.js → Cluster-5P5fvxqc.js} +1 -1
- package/dist/assets/{Data-YKk9aXJB.js → Data-7dVT38Kt.js} +1 -1
- package/dist/assets/{DetectionIntelligence-9PSI-Lvm.js → DetectionIntelligence-BnmyQSh3.js} +1 -1
- package/dist/assets/{DeviceAggregateSection-D3sF6-ak.js → DeviceAggregateSection-CcU8lz-n.js} +1 -1
- package/dist/assets/{DeviceDetail-BGPhCJh9.js → DeviceDetail-BYx3AwSC.js} +1 -1
- package/dist/assets/{Devices-tFn8Sqeb.js → Devices-BatZyq9B.js} +1 -1
- package/dist/assets/{EmbedPlayerPage-VP3eJcwO.js → EmbedPlayerPage-B9BQnkt_.js} +1 -1
- package/dist/assets/{Events-0poHi3OG.js → Events-Cg2w7Z73.js} +1 -1
- package/dist/assets/{FormBuilder-TGOU9JwR.js → FormBuilder-Cok9Ggwo.js} +1 -1
- package/dist/assets/{Identity-Sa3ZWQCV.js → Identity-eUScgjjW.js} +1 -1
- package/dist/assets/{IntegrationDetail-CiOWIAWT.js → IntegrationDetail-CXkStOjj.js} +1 -1
- package/dist/assets/{Integrations-DfyHVFFp.js → Integrations-C4C2GotZ.js} +1 -1
- package/dist/assets/{Integrations-C-BfO7Wt.js → Integrations-CRhWDVyt.js} +1 -1
- package/dist/assets/{Locations-DzV0d8BK.js → Locations-j0-nR3Fy.js} +1 -1
- package/dist/assets/{Logs-Cyx9MALh.js → Logs-1b2wtMIP.js} +1 -1
- package/dist/assets/{MotionZonesSettings-npBn9Mze.js → MotionZonesSettings-Dj8sh_Mh.js} +1 -1
- package/dist/assets/{MyAccess-DlUIDP7u.js → MyAccess-D0cAUoLS.js} +1 -1
- package/dist/assets/{Network-0a0saBiZ.js → Network-DxLntEOc.js} +1 -1
- package/dist/assets/{NodeAddonsSettingsPanel-CEfNTlo4.js → NodeAddonsSettingsPanel-D120MZAG.js} +1 -1
- package/dist/assets/{NodeInferenceDevices-D0DfWrXe.js → NodeInferenceDevices-DXPbWU2j.js} +1 -1
- package/dist/assets/{Notifications-BXfqueER.js → Notifications-CvO8QFj0.js} +1 -1
- package/dist/assets/{Pipeline-DydVMzLu.js → Pipeline-TCZqOIpn.js} +1 -1
- package/dist/assets/{Plates-dDUnBPzO.js → Plates-DrBihP9I.js} +1 -1
- package/dist/assets/PrivacyMaskSettings-DBwYQNQl.js +1 -0
- package/dist/assets/{ProviderIcon-DaTbyMo5.js → ProviderIcon-DsvO_i4v.js} +1 -1
- package/dist/assets/{Recordings-D-h11NYP.js → Recordings-D4dIK-GM.js} +1 -1
- package/dist/assets/{ScanNetworkModal-zCE4N2H-.js → ScanNetworkModal-BpRTGxHZ.js} +1 -1
- package/dist/assets/{SceneMonitorEditor-ByLKw6fz.js → SceneMonitorEditor-C_V9C8OP.js} +1 -1
- package/dist/assets/{Scenes--u3mgZdv.js → Scenes-p9MPTcdv.js} +1 -1
- package/dist/assets/{Settings-DN1drMdc.js → Settings-DfqqpKzH.js} +1 -1
- package/dist/assets/{Showroom-W8VQlXIZ.js → Showroom-qnQMoYty.js} +1 -1
- package/dist/assets/{StorageLocationsPanel-CXoAw1hq.js → StorageLocationsPanel-DUAjHG9E.js} +1 -1
- package/dist/assets/{Terminal-DkjkGMIw.js → Terminal-DqUxL7ym.js} +1 -1
- package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-Bqw7mV8_.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DKYqOaz2.js} +1 -1
- package/dist/assets/{authed-media-SLZCiKMi.js → authed-media-Cvs7l9rz.js} +1 -1
- package/dist/assets/{bell-off-BpPJaZ7X.js → bell-off-CDNdnZ19.js} +1 -1
- package/dist/assets/{bell-ring-DARbLB4h.js → bell-ring-DUqe0kvT.js} +1 -1
- package/dist/assets/{boxes-C2rgoGs2.js → boxes-Dk28bZrK.js} +1 -1
- package/dist/assets/circle-check-big-BoAN0Pqi.js +1 -0
- package/dist/assets/circle-dot-7Ot7Hk1p.js +1 -0
- package/dist/assets/circle-slash-C-e40toi.js +1 -0
- package/dist/assets/{circle-x-Cxi6Nm5L.js → circle-x-CR4ad_rL.js} +1 -1
- package/dist/assets/clock-DwkKgcTZ.js +1 -0
- package/dist/assets/{copy-DeOaCIlN.js → copy-DR8R2_HR.js} +1 -1
- package/dist/assets/{debounced-invalidate-D9Kml2Y9.js → debounced-invalidate-BW0isPZ1.js} +1 -1
- package/dist/assets/{dist-D8PUO1kP.js → dist-Cw2ieLbS.js} +1 -1
- package/dist/assets/{dist-De6ClW3j.js → dist-NfRpOqkA.js} +1 -1
- package/dist/assets/{download-4WJB-QBb.js → download-CPGYFNbo.js} +1 -1
- package/dist/assets/{face-bbox-BNod6JHe.js → face-bbox-292APeBO.js} +1 -1
- package/dist/assets/{flame-DhEyqo8s.js → flame-Cs9ylxDs.js} +1 -1
- package/dist/assets/{format-size-B6MtNIiP.js → format-size-CAEr-F_e.js} +1 -1
- package/dist/assets/{hard-drive-Na_LM9K7.js → hard-drive-E7g9cBQS.js} +1 -1
- package/dist/assets/{hostInit-CfGtLjUo.js → hostInit-CZPsA9-3.js} +1 -1
- package/dist/assets/{index-BwjTfOBU.js → index-CG76NtTM.js} +3 -3
- package/dist/assets/{key-round-2o4xNVS4.js → key-round-CCvvsAXv.js} +1 -1
- package/dist/assets/{layers-MxrxWTbg.js → layers-Yn7zbw1b.js} +1 -1
- package/dist/assets/{location-owned-usage-DqzRZJGp.js → location-owned-usage-v9yH0_Uz.js} +1 -1
- package/dist/assets/{mf-entry-bootstrap-0-43b25d19.js → mf-entry-bootstrap-0-03979c96.js} +2 -2
- package/dist/assets/{pencil-Bc3jYeFV.js → pencil-BHUkVqws.js} +1 -1
- package/dist/assets/play-ZkBt6fCi.js +1 -0
- package/dist/assets/{player-overlays-D_-vllLD.js → player-overlays-BpDQQutT.js} +1 -1
- package/dist/assets/plus-B_s-mxBM.js +1 -0
- package/dist/assets/power-DZPpdhIY.js +1 -0
- package/dist/assets/{radio-DptquX8g.js → radio-tEvnz1YW.js} +1 -1
- package/dist/assets/{refresh-cw-Cy62BC2I.js → refresh-cw-BGLHgQjL.js} +1 -1
- package/dist/assets/remoteEntry-7VRsdXIk.js +1 -0
- package/dist/assets/rotate-ccw-5xNQStDV.js +1 -0
- package/dist/assets/rotate-cw-DKJX5UTY.js +1 -0
- package/dist/assets/{send-BYLONVIb.js → send-CtFLaK0p.js} +1 -1
- package/dist/assets/{server-BMylo2fp.js → server-CnMC4dNi.js} +1 -1
- package/dist/assets/{shield-5fA2eNdV.js → shield-DQwxYnJd.js} +1 -1
- package/dist/assets/{shield-alert-vfUKaSKT.js → shield-alert-Dx2eIRFq.js} +1 -1
- package/dist/assets/square-D82yd7G6.js +1 -0
- package/dist/assets/{square-check-big-gk2mX0tw.js → square-check-big-BzavY7zY.js} +1 -1
- package/dist/assets/src-C2j9sEfa.js +349 -0
- package/dist/assets/{src-DZG_rKJY.js → src-C7ah6wxj.js} +3 -3
- package/dist/assets/{undo-2-DLC4ttyv.js → undo-2-By8IwmwV.js} +1 -1
- package/dist/assets/{use-scenes-feed-B5Pq5LC0.js → use-scenes-feed-wCDqoLJr.js} +1 -1
- package/dist/assets/useEventInvalidation-CjMIICCC.js +1 -0
- package/dist/assets/{useNodeUrlSelection-CvITCXpc.js → useNodeUrlSelection-DQcugosE.js} +1 -1
- package/dist/assets/user-round-Ccl_m9QC.js +1 -0
- package/dist/assets/{video-CvWXCreO.js → video-BTNCj0ya.js} +1 -1
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-CIfiYwR0.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-D3L7eEpM.js} +2 -2
- package/dist/assets/{wifi-CoTlrnNC.js → wifi-KoON0qN2.js} +1 -1
- package/dist/assets/{zap-R3d0vt_S.js → zap-CsEPgdEy.js} +1 -1
- package/dist/index.html +5 -5
- package/dist/server/addon.js +58 -9
- package/package.json +1 -1
- package/dist/assets/PrivacyMaskSettings-Dua5o_me.js +0 -1
- package/dist/assets/circle-check-big-O-mwvjPf.js +0 -1
- package/dist/assets/circle-dot-DIf0HuwN.js +0 -1
- package/dist/assets/circle-slash-CD04MWmb.js +0 -1
- package/dist/assets/clock-BBrUPTf_.js +0 -1
- package/dist/assets/play-L3GIIGxD.js +0 -1
- package/dist/assets/plus-D3W76_2c.js +0 -1
- package/dist/assets/power-pJocdsSm.js +0 -1
- package/dist/assets/remoteEntry-coyqHJS7.js +0 -1
- package/dist/assets/rotate-ccw-rPsuIovh.js +0 -1
- package/dist/assets/rotate-cw-rLIREkNv.js +0 -1
- package/dist/assets/square-Dfmmwmd4.js +0 -1
- package/dist/assets/src-V3GtY-be.js +0 -349
- package/dist/assets/useEventInvalidation-AlXalbX8.js +0 -1
- package/dist/assets/user-round-DYezYbAb.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as e}from"./index-
|
|
1
|
+
import{J as e}from"./index-CG76NtTM.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-CG76NtTM.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};
|
|
@@ -1 +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-D_-vllLD.js";import{Qo as l,g as u,sn as d,us as f,wn as p}from"./src-DZG_rKJY.js";import{jt as m}from"./src-V3GtY-be.js";import{n as h,t as g}from"./format-size-B6MtNIiP.js";import{t as _}from"./pencil-Bc3jYeFV.js";import{t as v}from"./plus-D3W76_2c.js";import{t as y}from"./power-pJocdsSm.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-BwjTfOBU.js";import{t as ee}from"./FormBuilder-TGOU9JwR.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=t===null||t<=0?0:t,c=Math.min(s,a),l=s>a,u=a-c,d=n.ownedBytes,f=d==null||!Number.isFinite(d)||d<0?null:Math.min(d,o),p=o-(f??0),m=q({usedBytes:f??o,availableBytes:a,totalBytes:r}),h=m===null?J(o/r):m.fraction,_=m===null?ge(h):m.severity,v=f===null?null:m===null?J(f/r):m.recordingsFraction,y=n.cap??null,b=y===null?null:J((c+y.bytes)/r),x=y!==null&&f!==null&&f>y.bytes,S={total:g(r),freeTotal:g(a),freeTotalPercent:X(a/r),used:g(p),usedPercent:X(p/r),free:g(u),freePercent:X(u/r),reserve:s===0?null:`${g(s)} kept free`,owned:f===null||v===null?null:`${g(f)} of recordings (${X(v)})`,cap:y===null?null:y.reason===`drain`?`${g(y.bytes)} drain target (managed by CamStack)`:`${g(y.bytes)} cap (managed by CamStack)`},C=[`${S.freeTotal} free of ${S.total} (${S.freeTotalPercent} free)`,S.owned===null?null:`CamStack holds ${S.owned}`,S.reserve===null?null:l?`${S.reserve} — less free than that right now, the oldest data here is being deleted`:S.reserve,S.cap===null?null:x?`${S.cap} — already below what is stored here, the oldest is being deleted`:S.cap].filter(e=>e!==null).join(` · `),w=[];return c>0&&w.push({segment:`reserve`,label:`Kept free`,value:g(s),alarming:l}),S.owned!==null&&w.push({segment:`owned`,label:`CamStack`,value:S.owned,alarming:!1}),w.push({segment:`used`,label:f===null?`Used`:`Other data`,value:`${S.used} (${S.usedPercent})`,alarming:_===`critical`}),w.push({segment:`free`,label:`Free`,value:`${S.free} (${S.freePercent})`,alarming:l}),y!==null&&w.push({segment:`cap`,label:y.reason===`drain`?`Drain target`:`Cap`,value:`${g(y.bytes)} · managed by CamStack`,alarming:x}),{kind:`known`,severity:_,legend:w,segments:{reservePercent:Y(c/r),ownedPercent:f===null?null:Y(f/r),usedPercent:Y(p/r),freePercent:Y(u/r),capPercent:b===null?null:Y(b)},labels:S,reserveExceedsFree:l,capBelowOwned:x,summary:C}}var xe={ok:`bg-primary`,warn:`bg-amber-500`,critical:`bg-danger`},Z={reserve:`bg-danger/40`,owned:`bg-foreground/50`,free:`bg-border`,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 flex h-2 w-full max-w-md overflow-hidden rounded-full bg-border`,children:[a.segments.reservePercent>0&&o(`div`,{className:Z.reserve,style:{width:`${String(a.segments.reservePercent)}%`}}),a.segments.ownedPercent!==null&&o(`div`,{className:Z.owned,style:{width:`${String(a.segments.ownedPercent)}%`}}),o(`div`,{className:xe[a.severity],style:{width:`${String(a.segments.usedPercent)}%`}}),o(`div`,{className:Z.free,style:{width:`${String(a.segments.freePercent)}%`}}),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)}%`}})]}),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,open:t,onToggle:r}){let i=z(e),a=ze[e];return n(`button`,{type:`button`,"aria-expanded":t,"aria-label":`Location state`,onClick:r,title:i.consequence,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium border ${Be[e]}`,children:[o(a,{className:`h-3 w-3`}),i.label,o(E,{className:`h-3 w-3 ${t?`rotate-180`:``}`})]})}function He({mode:e,blockedReasons:t,onSelect:r,onDismiss:i}){return s(()=>{let e=e=>{e.key===`Escape`&&i()};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[i]),n(`div`,{className:`w-full basis-full rounded-lg border border-border bg-background p-1`,role:`group`,"aria-label":`Location state choices`,children:[n(`div`,{className:`flex items-center justify-between px-2 py-1`,children:[o(`span`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Location state`}),o(`button`,{type:`button`,"aria-label":`Close location state choices`,onClick:i,className:`text-foreground-subtle hover:text-foreground`,children:o(w,{className:`h-3 w-3`})})]}),R.map(a=>{let s=t[a.mode],c=s!==``,l=ze[a.mode],u=a.mode===e;return n(`button`,{type:`button`,role:`radio`,"aria-checked":u,"aria-label":a.label,disabled:c,onClick:()=>{c||(i(),u||r(a.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`}),a.label,u&&o(`span`,{className:`text-[9px] uppercase text-primary`,children:`current`})]}),o(`span`,{className:`text-[10px] leading-snug text-foreground-subtle`,children:a.consequence}),c&&o(`span`,{className:`text-[10px] leading-snug text-warning`,children:s})]},a.mode)})]})}var Ue=`Remaining not reported yet`,We=`Estimated empty time not available yet`;function Ge(e,t){let n=new Date(e);if(Number.isNaN(n.getTime()))return We;let r=n.toLocaleString();return e<=t?`Estimated empty by now (${r})`:`Estimated empty ${r}`}function Ke(e,t){let n=e.remainingBytes,r=n!==null&&Number.isFinite(n)&&n>=0?n:null,i=r===0;return{remainingLabel:r===null?Ue:i?`Empty — nothing left on this location`:`${g(r)} left to move off`,etaLabel:i?`Drain finished`:e.estimatedEmptyAtMs===null?We:Ge(e.estimatedEmptyAtMs,t),complete:i}}t();function qe(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 Je={remainingBytes:null,estimatedEmptyAtMs:null};function Ye({location:e,onEdit:t,onDelete:r,onSetMode:i,blockedReasons:s,canDelete:c,siblings:l=[],drain:u,ownedBytes:d}){let[f,p]=a(!1),m=qe(e.config),h=I(e),g=h===`drain`?Ke(u??Je,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}),m&&o(`div`,{className:`text-[10px] text-foreground-subtle truncate font-mono`,children:m}),o(Ce,{location:e,ownedBytes:d??null}),g!==null&&n(`div`,{className:`text-[10px] text-warning`,children:[`Draining · `,g.remainingLabel,` · `,g.etaLabel]})]})]}),n(`div`,{className:`flex flex-wrap items-center gap-1 shrink-0`,children:[o(Le,{location:e,siblings:l}),o(Ve,{mode:h,open:f,onToggle:()=>{p(e=>!e)}}),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`]}),c&&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`})})]}),f&&o(He,{mode:h,blockedReasons:s,onSelect:t=>i(e,t),onDismiss:()=>{p(!1)}})]})}t();function Xe({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(Ye,{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 Ze=[`recordings`,`recordingsLow`];function Qe(e){return e.locationIds!==void 0&&e.locationIds.length>0?e.locationIds:e.locationId===null?[]:[e.locationId]}function $e(e,t){if(t===void 0||!Ze.includes(e.type))return null;let n=t.find(t=>Qe(t).includes(e.id));return n===void 0||!Number.isFinite(n.usedBytes)||n.usedBytes<0?null:n.usedBytes}function et(e,t){let n=new Map;for(let r of e){let e=$e(r,t);e!==null&&n.set(r.id,e)}return n}export{me as a,B as c,ve as i,F as l,Xe as n,ne as o,q as r,z as s,et as t,D as u};
|
|
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-BpDQQutT.js";import{Qo as l,g as u,sn as d,us as f,wn as p}from"./src-C7ah6wxj.js";import{jt as m}from"./src-C2j9sEfa.js";import{n as h,t as g}from"./format-size-CAEr-F_e.js";import{t as _}from"./pencil-BHUkVqws.js";import{t as v}from"./plus-B_s-mxBM.js";import{t as y}from"./power-DZPpdhIY.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-CG76NtTM.js";import{t as ee}from"./FormBuilder-Cok9Ggwo.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=t===null||t<=0?0:t,c=Math.min(s,a),l=s>a,u=a-c,d=n.ownedBytes,f=d==null||!Number.isFinite(d)||d<0?null:Math.min(d,o),p=o-(f??0),m=q({usedBytes:f??o,availableBytes:a,totalBytes:r}),h=m===null?J(o/r):m.fraction,_=m===null?ge(h):m.severity,v=f===null?null:m===null?J(f/r):m.recordingsFraction,y=n.cap??null,b=y===null?null:J((c+y.bytes)/r),x=y!==null&&f!==null&&f>y.bytes,S={total:g(r),freeTotal:g(a),freeTotalPercent:X(a/r),used:g(p),usedPercent:X(p/r),free:g(u),freePercent:X(u/r),reserve:s===0?null:`${g(s)} kept free`,owned:f===null||v===null?null:`${g(f)} of recordings (${X(v)})`,cap:y===null?null:y.reason===`drain`?`${g(y.bytes)} drain target (managed by CamStack)`:`${g(y.bytes)} cap (managed by CamStack)`},C=[`${S.freeTotal} free of ${S.total} (${S.freeTotalPercent} free)`,S.owned===null?null:`CamStack holds ${S.owned}`,S.reserve===null?null:l?`${S.reserve} — less free than that right now, the oldest data here is being deleted`:S.reserve,S.cap===null?null:x?`${S.cap} — already below what is stored here, the oldest is being deleted`:S.cap].filter(e=>e!==null).join(` · `),w=[];return c>0&&w.push({segment:`reserve`,label:`Kept free`,value:g(s),alarming:l}),S.owned!==null&&w.push({segment:`owned`,label:`CamStack`,value:S.owned,alarming:!1}),w.push({segment:`used`,label:f===null?`Used`:`Other data`,value:`${S.used} (${S.usedPercent})`,alarming:_===`critical`}),w.push({segment:`free`,label:`Free`,value:`${S.free} (${S.freePercent})`,alarming:l}),y!==null&&w.push({segment:`cap`,label:y.reason===`drain`?`Drain target`:`Cap`,value:`${g(y.bytes)} · managed by CamStack`,alarming:x}),{kind:`known`,severity:_,legend:w,segments:{reservePercent:Y(c/r),ownedPercent:f===null?null:Y(f/r),usedPercent:Y(p/r),freePercent:Y(u/r),capPercent:b===null?null:Y(b)},labels:S,reserveExceedsFree:l,capBelowOwned:x,summary:C}}var xe={ok:`bg-primary`,warn:`bg-amber-500`,critical:`bg-danger`},Z={reserve:`bg-danger/40`,owned:`bg-foreground/50`,free:`bg-border`,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 flex h-2 w-full max-w-md overflow-hidden rounded-full bg-border`,children:[a.segments.reservePercent>0&&o(`div`,{className:Z.reserve,style:{width:`${String(a.segments.reservePercent)}%`}}),a.segments.ownedPercent!==null&&o(`div`,{className:Z.owned,style:{width:`${String(a.segments.ownedPercent)}%`}}),o(`div`,{className:xe[a.severity],style:{width:`${String(a.segments.usedPercent)}%`}}),o(`div`,{className:Z.free,style:{width:`${String(a.segments.freePercent)}%`}}),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)}%`}})]}),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,open:t,onToggle:r}){let i=z(e),a=ze[e];return n(`button`,{type:`button`,"aria-expanded":t,"aria-label":`Location state`,onClick:r,title:i.consequence,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium border ${Be[e]}`,children:[o(a,{className:`h-3 w-3`}),i.label,o(E,{className:`h-3 w-3 ${t?`rotate-180`:``}`})]})}function He({mode:e,blockedReasons:t,onSelect:r,onDismiss:i}){return s(()=>{let e=e=>{e.key===`Escape`&&i()};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[i]),n(`div`,{className:`w-full basis-full rounded-lg border border-border bg-background p-1`,role:`group`,"aria-label":`Location state choices`,children:[n(`div`,{className:`flex items-center justify-between px-2 py-1`,children:[o(`span`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Location state`}),o(`button`,{type:`button`,"aria-label":`Close location state choices`,onClick:i,className:`text-foreground-subtle hover:text-foreground`,children:o(w,{className:`h-3 w-3`})})]}),R.map(a=>{let s=t[a.mode],c=s!==``,l=ze[a.mode],u=a.mode===e;return n(`button`,{type:`button`,role:`radio`,"aria-checked":u,"aria-label":a.label,disabled:c,onClick:()=>{c||(i(),u||r(a.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`}),a.label,u&&o(`span`,{className:`text-[9px] uppercase text-primary`,children:`current`})]}),o(`span`,{className:`text-[10px] leading-snug text-foreground-subtle`,children:a.consequence}),c&&o(`span`,{className:`text-[10px] leading-snug text-warning`,children:s})]},a.mode)})]})}var Ue=`Remaining not reported yet`,We=`Estimated empty time not available yet`;function Ge(e,t){let n=new Date(e);if(Number.isNaN(n.getTime()))return We;let r=n.toLocaleString();return e<=t?`Estimated empty by now (${r})`:`Estimated empty ${r}`}function Ke(e,t){let n=e.remainingBytes,r=n!==null&&Number.isFinite(n)&&n>=0?n:null,i=r===0;return{remainingLabel:r===null?Ue:i?`Empty — nothing left on this location`:`${g(r)} left to move off`,etaLabel:i?`Drain finished`:e.estimatedEmptyAtMs===null?We:Ge(e.estimatedEmptyAtMs,t),complete:i}}t();function qe(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 Je={remainingBytes:null,estimatedEmptyAtMs:null};function Ye({location:e,onEdit:t,onDelete:r,onSetMode:i,blockedReasons:s,canDelete:c,siblings:l=[],drain:u,ownedBytes:d}){let[f,p]=a(!1),m=qe(e.config),h=I(e),g=h===`drain`?Ke(u??Je,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}),m&&o(`div`,{className:`text-[10px] text-foreground-subtle truncate font-mono`,children:m}),o(Ce,{location:e,ownedBytes:d??null}),g!==null&&n(`div`,{className:`text-[10px] text-warning`,children:[`Draining · `,g.remainingLabel,` · `,g.etaLabel]})]})]}),n(`div`,{className:`flex flex-wrap items-center gap-1 shrink-0`,children:[o(Le,{location:e,siblings:l}),o(Ve,{mode:h,open:f,onToggle:()=>{p(e=>!e)}}),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`]}),c&&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`})})]}),f&&o(He,{mode:h,blockedReasons:s,onSelect:t=>i(e,t),onDismiss:()=>{p(!1)}})]})}t();function Xe({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(Ye,{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 Ze=[`recordings`,`recordingsLow`];function Qe(e){return e.locationIds!==void 0&&e.locationIds.length>0?e.locationIds:e.locationId===null?[]:[e.locationId]}function $e(e,t){if(t===void 0||!Ze.includes(e.type))return null;let n=t.find(t=>Qe(t).includes(e.id));return n===void 0||!Number.isFinite(n.usedBytes)||n.usedBytes<0?null:n.usedBytes}function et(e,t){let n=new Map;for(let r of e){let e=$e(r,t);e!==null&&n.set(r.id,e)}return n}export{me as a,B as c,ve as i,F as l,Xe as n,ne as o,q as r,z as s,et as t,D as u};
|
|
@@ -12,8 +12,8 @@ const __mfImport = (src) =>
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
(async () => {
|
|
15
|
-
const __mfHostInit = await __mfImport("./hostInit-
|
|
15
|
+
const __mfHostInit = await __mfImport("./hostInit-CZPsA9-3.js");
|
|
16
16
|
await __mfHostInit.__tla;
|
|
17
17
|
const { initHost } = __mfHostInit;
|
|
18
18
|
await initHost();
|
|
19
|
-
})().then(() => __mfImport("./index-
|
|
19
|
+
})().then(() => __mfImport("./index-CG76NtTM.js"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as e}from"./index-
|
|
1
|
+
import{J as e}from"./index-CG76NtTM.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-CG76NtTM.js";var t=e(`play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as e,I as t,J as n,L as r,O as i,Q as a,S as o,W as s,b as c,k as l,q as u,x as d,z as f}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 p}from"./src-V3GtY-be.js";a();var m=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),h=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),g=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),_=e=>{let t=g(e);return t.charAt(0).toUpperCase()+t.slice(1)},v={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},ee=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},y=l(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a=``,children:o,iconNode:s,...c},l)=>i(`svg`,{ref:l,...v,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:m(`lucide`,a),...!o&&!ee(c)&&{"aria-hidden":`true`},...c},[...s.map(([e,t])=>i(e,t)),...Array.isArray(o)?o:[o]]));a();var b=(e,t)=>{let n=l(({className:n,...r},a)=>i(y,{ref:a,iconNode:t,className:m(`lucide-${h(_(e))}`,`lucide-${e}`,n),...r}));return n.displayName=_(e),n},x=b(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),S=b(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),C=b(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),te=b(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),ne=b(`image-off`,[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]),re=b(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),ie=b(`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`}]]),w=b(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),ae=b(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]);a();function T(t,n){if(typeof globalThis>`u`)return e(n);let r=globalThis.__camstackSharedContexts,i=r??new Map;r||(globalThis.__camstackSharedContexts=i);let a=i.get(t);if(a)return a;let o=e(n);return i.set(t,o),o}a();var E=T(`camstack:system`,null);function D({system:e,children:t}){return d(E.Provider,{value:e,children:t})}function O(){let e=r(E);if(!e)throw Error(`useSystem(): no <SystemProvider> in tree`);return e}function k(){return r(E)}var oe=`camstack-mount`,se=/^\/(?:[A-Za-z0-9_\-.]+\/)*$/,A=null;function j(e){if(e==null||e===``)return null;let t=e.endsWith(`/`)?e:`${e}/`;return!se.test(t)||t.includes(`/../`)||t.includes(`/./`)?null:t}function ce(){if(typeof document>`u`)return`/`;let e=j(document.querySelector(`meta[name="${oe}"]`)?.getAttribute(`content`));if(e!==null)return e;if(document.querySelector(`base[href]`)!==null)try{let e=new URL(document.baseURI);if(e.origin===window.location.origin){let t=j(e.pathname);if(t!==null)return t}}catch{}return`/`}function M(){return A===null&&(A=ce()),A}function N(){return M().replace(/\/$/,``)}function P(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith(`//`)}function F(e){if(P(e))return e;let t=M(),n=e.replace(/^\/+/,``);return t!==`/`&&(e===N()||e.startsWith(t))?e:`${t}${n}`}function I(){return`${typeof window<`u`?window.location.origin:``}${N()}`}function L(e){return P(e)?e:`${I()}${F(e).slice(N().length)}`}function R(e){return L(e).replace(/^http/,`ws`)}function z(){A=null}a();function B({title:e,icon:t,headerRight:n,collapsible:r=!1,defaultOpen:i=!0,bodyClassName:a=`p-3`,children:s}){let[l,f]=u(i),p=!r||l,m=o(c,{children:[o(`span`,{className:`flex items-center gap-2 text-xs font-semibold uppercase tracking-wider text-foreground`,children:[t,e]}),r?d(l?S:C,{className:`h-3.5 w-3.5 text-foreground-subtle`}):n]}),h=`px-4 py-2 flex items-center justify-between ${p?`border-b border-border`:``}`;return o(`div`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:[r?d(`button`,{type:`button`,onClick:()=>f(e=>!e),className:`w-full text-left ${h}`,children:m}):d(`div`,{className:h,children:m}),p?d(`div`,{className:a,children:s}):null]})}function V({label:e,icon:t,children:n,footer:r}){return o(`div`,{className:`rounded-md border border-border/60 bg-background/40 px-3 py-2`,children:[o(`div`,{className:`mb-1 flex items-center gap-1.5 text-[11px] uppercase tracking-wider text-foreground-subtle`,children:[t,e]}),d(`div`,{className:`text-sm font-medium text-foreground`,children:n}),r?d(`div`,{className:`mt-0.5 text-[10px] text-foreground-subtle`,children:r}):null]})}a();var H=`capability.binding-changed`;function U(e,t){let[n,r]=u(null);return f(()=>{if(t===null){r(null);return}let n=!1,i=async()=>{try{let i=await e.deviceManager.getBindings.query({deviceId:t});n||r(i)}catch{n||r(e=>e)}};i();let a=e.live?.onEvent.subscribe({category:H},{onData:e=>{let n=e.data?.source;if(!n){i();return}n.type===`device`&&n.id===t&&i()}});return()=>{n=!0,a?.unsubscribe()}},[e,t]),s(()=>n?p(e,n):null,[e,n])}function W(e){let r=t(t=>e?e.subscribe(()=>t()):()=>void 0,[e]),i=t(()=>e?.value,[e]);return n(r,i,i)}function G(e,t,n){let r=U(e,t);return W(r?n(r.state):void 0)}function le(e){if(typeof e!=`object`||!e)return null;let t=Reflect.get(e,`data`);if(typeof t==`object`&&t){let e=Reflect.get(t,`capRouteReason`);if(typeof e==`string`)return e}return null}function ue(e){let t=le(e);return t===null?(e instanceof Error?e.message:String(e)).includes(`provider not available`):t===`no-provider`||t===`node-offline`}var K=[`day`,`ir`],de={day:`Daylight`,ir:`Night (IR)`,night:`Night`,dawn:`Dawn`,dusk:`Dusk`};function q(e){return de[e]??e}function fe(e){let t=new Set(e.coveredConditions),n=K.map(e=>`${q(e)} ${t.has(e)?`✓`:`✗`}`),r=[...t].filter(e=>!K.some(t=>t===e));for(let e of r)n.push(`${q(e)} ✓`);let i=K.filter(e=>!t.has(e));if(i.length===0)return n.join(` · `);if(t.size===0)return`${n.join(` · `)} — nothing captured yet, so this scene is not watching.`;let a=i.map(e=>q(e).toLowerCase()).join(` and `);return e.onUncoveredCondition===`judge-anyway`?`${n.join(` · `)} — ${a} judged against the references you do have.`:`${n.join(` · `)} — optional; checks in ${a} are skipped.`}function pe(e){if(e.suspendedCondition===null)return null;let t=q(e.suspendedCondition).toLowerCase();return`Paused — nothing was captured in ${t}, so checks are on hold until the light changes back. Capture ${t} if you want it watched around the clock.`}var me={"no-reference-for-condition":`can’t tell — nothing has been captured for this scene yet. Press “Capture daylight” to photograph what normal looks like.`,"view-shifted":`can’t tell — the camera view has moved since the reference was captured. Re-capture it.`,"no-vision-profile":`can’t tell — the vision model is unreachable, so the change is on hold.`,"encoder-model-changed":`can’t tell — the embedding model changed, so the stored references are unreadable. Re-capture them.`,"no-snapshot":`can’t tell — this camera did not return a frame.`};function he(e,t){if(e.states.length===0)return`Not armed yet — capture the initial state to start watching.`;if(e.verdict===`unknown`)return e.unavailable===null?`can’t tell right now.`:me[e.unavailable];let n=e.verdict===`diverged`?e.divergedAt:e.armedAt,r=n===null?``:` for ${Y(Math.max(0,t-n))}`;if(e.latched)return e.verdict===`diverged`?`CHANGED${r} — press Reset when you have dealt with it.`:`Back to normal, but still flagged as changed${r}. Press Reset to clear it.`;let i=pe(e);return i===null?e.verdict===`diverged`?`CHANGED${r}`:`Normal${r}`:i}function ge(e){return e.states.length===0?{text:`Not armed`,tone:`unknown`}:e.latched?{text:`Changed`,tone:`alarm`}:e.suspendedCondition===null?e.verdict===`unknown`?{text:`Can’t tell`,tone:`unknown`}:e.verdict===`diverged`?{text:`Changed`,tone:`alarm`}:{text:`Normal`,tone:`ok`}:{text:`Paused`,tone:`unknown`}}var J=.4;function _e(e){return e.width*e.height>J}function Y(e){let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m`;let r=Math.floor(n/60);return r<48?`${r}h`:`${Math.floor(r/24)}d`}var ve=`rounded-lg border border-border bg-surface overflow-hidden`,ye=`border-b border-border px-3 sm:px-4 py-1.5 sm:py-2`,X=`p-2 sm:p-3 lg:p-4`,be=`space-y-3 sm:space-y-4`,xe=`gap-2 sm:gap-3`,Se=`px-3 sm:px-4 py-1.5 sm:py-2`,Ce=`grid grid-cols-2 sm:grid-cols-2 lg:grid-cols-4`,we=`grid grid-cols-1 lg:grid-cols-2`,Te=`flex flex-col-reverse md:flex-row`,Ee=`w-full md:w-44 lg:w-52 md:flex-shrink-0 border-b md:border-b-0 md:border-l border-border`,De=`sm`,Oe=`flex min-w-0 flex-col gap-0.5 py-1.5 sm:flex-row sm:items-center`,ke=`min-w-0 text-[11px] leading-tight text-foreground-subtle sm:w-32 sm:shrink-0 sm:pr-2`,Ae=`flex w-full min-w-0 items-center gap-1 sm:flex-1`,je=`min-w-0 break-all text-xs text-foreground sm:truncate`,Me=`text-[10px] sm:text-[11px] font-semibold text-foreground uppercase tracking-wider`,Ne=`text-[11px] sm:text-xs text-foreground`,Pe=`text-[10px] text-foreground-subtle`,Fe=`text-[11px] sm:text-xs font-medium text-foreground`,Ie=`text-base sm:text-lg font-semibold leading-tight text-foreground`,Le=`inline-flex items-center justify-center gap-1 rounded border border-border bg-surface px-1.5 py-0.5 sm:px-2 sm:py-1 text-[10px] sm:text-[11px] font-medium text-foreground hover:bg-surface-hover transition-colors disabled:opacity-40`,Re=`inline-flex items-center justify-center gap-1 rounded border border-primary/40 bg-primary/15 px-1.5 py-0.5 sm:px-2 sm:py-1 text-[10px] sm:text-[11px] font-medium text-primary hover:bg-primary/25 transition-colors disabled:opacity-40`,ze=`inline-flex items-center justify-center gap-1 rounded border border-danger/40 bg-danger/10 px-1.5 py-0.5 sm:px-2 sm:py-1 text-[10px] sm:text-[11px] font-medium text-danger hover:bg-danger/20 transition-colors disabled:opacity-40`,Be=`inline-flex items-center justify-center gap-1 rounded border border-warning/40 bg-warning/10 px-1.5 py-0.5 sm:px-2 sm:py-1 text-[10px] sm:text-[11px] font-medium text-warning hover:bg-warning/20 transition-colors disabled:opacity-40`,Ve=`w-full rounded border border-border bg-background px-1.5 py-0.5 sm:px-2 sm:py-1 text-[11px] sm:text-xs text-foreground focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none`,He=`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium transition-colors`,Ue=`border-primary/50 bg-primary/15 text-primary`,We=`border-border bg-surface text-foreground-subtle hover:bg-surface-hover`;a();var Z=`/addon/snapshot/media`;function Ge(e,n={}){let{width:r,baseUrl:i}=n,[a,o]=u(0);return{src:s(()=>{if(e===null||e<=0)return null;let t=i===void 0?N():i.replace(/\/+$/,``),n=new URLSearchParams;r!==void 0&&Number.isInteger(r)&&r>0&&n.set(`w`,String(r)),a>0&&(n.set(`force`,`1`),n.set(`r`,String(a)));let o=n.toString();return`${t}${Z}/${String(e)}.jpg${o.length>0?`?${o}`:``}`},[e,r,i,a]),loading:!1,refresh:t(()=>{o(e=>e+1)},[])}}a();var Q=T(`camstack:player-overlays-state`,null),$=T(`camstack:player-overlays-actions`,null);function Ke({children:e}){let[n,r]=u(()=>new Map),[i,a]=u(()=>new Map),o=t(e=>{r(t=>{let n=new Map(t);return n.set(e.id,e),n})},[]),c=t(e=>{r(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),l=t(e=>{a(t=>{let n=new Map(t);return n.set(e.id,e),n})},[]),f=t(e=>{a(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),p=s(()=>({layers:n,buttons:i}),[n,i]),m=s(()=>({setLayer:o,removeLayer:c,setButton:l,removeButton:f}),[o,c,l,f]);return d(Q.Provider,{value:p,children:d($.Provider,{value:m,children:e})})}function qe(){let e=r(Q);return s(()=>e?[...e.layers.values()].toSorted((e,t)=>e.order-t.order):[],[e])}function Je(){let e=r(Q);return s(()=>e?[...e.buttons.values()].toSorted((e,t)=>e.order-t.order):[],[e])}function Ye(e){let t=r($);f(()=>{if(!(!t||!e))return t.setLayer(e),()=>t.removeLayer(e.id)},[t,e])}function Xe(e){let t=r($);f(()=>{if(!(!t||!e))return t.setButton(e),()=>t.removeButton(e.id)},[t,e])}export{R as $,be as A,Y as B,Oe as C,je as D,Ae as E,Fe as F,U as G,he as H,J as I,V as J,G as K,K as L,Pe as M,Ie as N,Te as O,Me as P,L as Q,ge as R,ye as S,De as T,q as U,_e as V,ue as W,I as X,B as Y,F as Z,Ce as _,Je as a,O as at,X as b,Le as c,w as ct,Be as d,ne as dt,M as et,Ue as f,te as ft,we as g,b as gt,xe as h,x as ht,Xe as i,k as it,Ne as j,Ee as k,ze as l,ie as lt,We as m,S as mt,Ye as n,N as nt,Z as o,T as ot,He as p,C as pt,W as q,qe as r,D as rt,Ge as s,ae as st,Ke as t,z as tt,Re as u,re as ut,Ve as v,ke as w,ve as x,Se as y,fe as z};
|
|
1
|
+
import{D as e,I as t,J as n,L as r,O as i,Q as a,S as o,W as s,b as c,k as l,q as u,x as d,z as f}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 p}from"./src-C2j9sEfa.js";a();var m=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),h=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),g=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),_=e=>{let t=g(e);return t.charAt(0).toUpperCase()+t.slice(1)},v={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},ee=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},y=l(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a=``,children:o,iconNode:s,...c},l)=>i(`svg`,{ref:l,...v,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:m(`lucide`,a),...!o&&!ee(c)&&{"aria-hidden":`true`},...c},[...s.map(([e,t])=>i(e,t)),...Array.isArray(o)?o:[o]]));a();var b=(e,t)=>{let n=l(({className:n,...r},a)=>i(y,{ref:a,iconNode:t,className:m(`lucide-${h(_(e))}`,`lucide-${e}`,n),...r}));return n.displayName=_(e),n},x=b(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),S=b(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),C=b(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),te=b(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),ne=b(`image-off`,[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]),re=b(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),ie=b(`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`}]]),w=b(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),ae=b(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]);a();function T(t,n){if(typeof globalThis>`u`)return e(n);let r=globalThis.__camstackSharedContexts,i=r??new Map;r||(globalThis.__camstackSharedContexts=i);let a=i.get(t);if(a)return a;let o=e(n);return i.set(t,o),o}a();var E=T(`camstack:system`,null);function D({system:e,children:t}){return d(E.Provider,{value:e,children:t})}function O(){let e=r(E);if(!e)throw Error(`useSystem(): no <SystemProvider> in tree`);return e}function k(){return r(E)}var oe=`camstack-mount`,se=/^\/(?:[A-Za-z0-9_\-.]+\/)*$/,A=null;function j(e){if(e==null||e===``)return null;let t=e.endsWith(`/`)?e:`${e}/`;return!se.test(t)||t.includes(`/../`)||t.includes(`/./`)?null:t}function ce(){if(typeof document>`u`)return`/`;let e=j(document.querySelector(`meta[name="${oe}"]`)?.getAttribute(`content`));if(e!==null)return e;if(document.querySelector(`base[href]`)!==null)try{let e=new URL(document.baseURI);if(e.origin===window.location.origin){let t=j(e.pathname);if(t!==null)return t}}catch{}return`/`}function M(){return A===null&&(A=ce()),A}function N(){return M().replace(/\/$/,``)}function P(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith(`//`)}function F(e){if(P(e))return e;let t=M(),n=e.replace(/^\/+/,``);return t!==`/`&&(e===N()||e.startsWith(t))?e:`${t}${n}`}function I(){return`${typeof window<`u`?window.location.origin:``}${N()}`}function L(e){return P(e)?e:`${I()}${F(e).slice(N().length)}`}function R(e){return L(e).replace(/^http/,`ws`)}function z(){A=null}a();function B({title:e,icon:t,headerRight:n,collapsible:r=!1,defaultOpen:i=!0,bodyClassName:a=`p-3`,children:s}){let[l,f]=u(i),p=!r||l,m=o(c,{children:[o(`span`,{className:`flex items-center gap-2 text-xs font-semibold uppercase tracking-wider text-foreground`,children:[t,e]}),r?d(l?S:C,{className:`h-3.5 w-3.5 text-foreground-subtle`}):n]}),h=`px-4 py-2 flex items-center justify-between ${p?`border-b border-border`:``}`;return o(`div`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:[r?d(`button`,{type:`button`,onClick:()=>f(e=>!e),className:`w-full text-left ${h}`,children:m}):d(`div`,{className:h,children:m}),p?d(`div`,{className:a,children:s}):null]})}function V({label:e,icon:t,children:n,footer:r}){return o(`div`,{className:`rounded-md border border-border/60 bg-background/40 px-3 py-2`,children:[o(`div`,{className:`mb-1 flex items-center gap-1.5 text-[11px] uppercase tracking-wider text-foreground-subtle`,children:[t,e]}),d(`div`,{className:`text-sm font-medium text-foreground`,children:n}),r?d(`div`,{className:`mt-0.5 text-[10px] text-foreground-subtle`,children:r}):null]})}a();var H=`capability.binding-changed`;function U(e,t){let[n,r]=u(null);return f(()=>{if(t===null){r(null);return}let n=!1,i=async()=>{try{let i=await e.deviceManager.getBindings.query({deviceId:t});n||r(i)}catch{n||r(e=>e)}};i();let a=e.live?.onEvent.subscribe({category:H},{onData:e=>{let n=e.data?.source;if(!n){i();return}n.type===`device`&&n.id===t&&i()}});return()=>{n=!0,a?.unsubscribe()}},[e,t]),s(()=>n?p(e,n):null,[e,n])}function W(e){let r=t(t=>e?e.subscribe(()=>t()):()=>void 0,[e]),i=t(()=>e?.value,[e]);return n(r,i,i)}function G(e,t,n){let r=U(e,t);return W(r?n(r.state):void 0)}function le(e){if(typeof e!=`object`||!e)return null;let t=Reflect.get(e,`data`);if(typeof t==`object`&&t){let e=Reflect.get(t,`capRouteReason`);if(typeof e==`string`)return e}return null}function ue(e){let t=le(e);return t===null?(e instanceof Error?e.message:String(e)).includes(`provider not available`):t===`no-provider`||t===`node-offline`}var K=[`day`,`ir`],de={day:`Daylight`,ir:`Night (IR)`,night:`Night`,dawn:`Dawn`,dusk:`Dusk`};function q(e){return de[e]??e}function fe(e){let t=new Set(e.coveredConditions),n=K.map(e=>`${q(e)} ${t.has(e)?`✓`:`✗`}`),r=[...t].filter(e=>!K.some(t=>t===e));for(let e of r)n.push(`${q(e)} ✓`);let i=K.filter(e=>!t.has(e));if(i.length===0)return n.join(` · `);if(t.size===0)return`${n.join(` · `)} — nothing captured yet, so this scene is not watching.`;let a=i.map(e=>q(e).toLowerCase()).join(` and `);return e.onUncoveredCondition===`judge-anyway`?`${n.join(` · `)} — ${a} judged against the references you do have.`:`${n.join(` · `)} — optional; checks in ${a} are skipped.`}function pe(e){if(e.suspendedCondition===null)return null;let t=q(e.suspendedCondition).toLowerCase();return`Paused — nothing was captured in ${t}, so checks are on hold until the light changes back. Capture ${t} if you want it watched around the clock.`}var me={"no-reference-for-condition":`can’t tell — nothing has been captured for this scene yet. Press “Capture daylight” to photograph what normal looks like.`,"view-shifted":`can’t tell — the camera view has moved since the reference was captured. Re-capture it.`,"no-vision-profile":`can’t tell — the vision model is unreachable, so the change is on hold.`,"encoder-model-changed":`can’t tell — the embedding model changed, so the stored references are unreadable. Re-capture them.`,"no-snapshot":`can’t tell — this camera did not return a frame.`};function he(e,t){if(e.states.length===0)return`Not armed yet — capture the initial state to start watching.`;if(e.verdict===`unknown`)return e.unavailable===null?`can’t tell right now.`:me[e.unavailable];let n=e.verdict===`diverged`?e.divergedAt:e.armedAt,r=n===null?``:` for ${Y(Math.max(0,t-n))}`;if(e.latched)return e.verdict===`diverged`?`CHANGED${r} — press Reset when you have dealt with it.`:`Back to normal, but still flagged as changed${r}. Press Reset to clear it.`;let i=pe(e);return i===null?e.verdict===`diverged`?`CHANGED${r}`:`Normal${r}`:i}function ge(e){return e.states.length===0?{text:`Not armed`,tone:`unknown`}:e.latched?{text:`Changed`,tone:`alarm`}:e.suspendedCondition===null?e.verdict===`unknown`?{text:`Can’t tell`,tone:`unknown`}:e.verdict===`diverged`?{text:`Changed`,tone:`alarm`}:{text:`Normal`,tone:`ok`}:{text:`Paused`,tone:`unknown`}}var J=.4;function _e(e){return e.width*e.height>J}function Y(e){let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m`;let r=Math.floor(n/60);return r<48?`${r}h`:`${Math.floor(r/24)}d`}var ve=`rounded-lg border border-border bg-surface overflow-hidden`,ye=`border-b border-border px-3 sm:px-4 py-1.5 sm:py-2`,X=`p-2 sm:p-3 lg:p-4`,be=`space-y-3 sm:space-y-4`,xe=`gap-2 sm:gap-3`,Se=`px-3 sm:px-4 py-1.5 sm:py-2`,Ce=`grid grid-cols-2 sm:grid-cols-2 lg:grid-cols-4`,we=`grid grid-cols-1 lg:grid-cols-2`,Te=`flex flex-col-reverse md:flex-row`,Ee=`w-full md:w-44 lg:w-52 md:flex-shrink-0 border-b md:border-b-0 md:border-l border-border`,De=`sm`,Oe=`flex min-w-0 flex-col gap-0.5 py-1.5 sm:flex-row sm:items-center`,ke=`min-w-0 text-[11px] leading-tight text-foreground-subtle sm:w-32 sm:shrink-0 sm:pr-2`,Ae=`flex w-full min-w-0 items-center gap-1 sm:flex-1`,je=`min-w-0 break-all text-xs text-foreground sm:truncate`,Me=`text-[10px] sm:text-[11px] font-semibold text-foreground uppercase tracking-wider`,Ne=`text-[11px] sm:text-xs text-foreground`,Pe=`text-[10px] text-foreground-subtle`,Fe=`text-[11px] sm:text-xs font-medium text-foreground`,Ie=`text-base sm:text-lg font-semibold leading-tight text-foreground`,Le=`inline-flex items-center justify-center gap-1 rounded border border-border bg-surface px-1.5 py-0.5 sm:px-2 sm:py-1 text-[10px] sm:text-[11px] font-medium text-foreground hover:bg-surface-hover transition-colors disabled:opacity-40`,Re=`inline-flex items-center justify-center gap-1 rounded border border-primary/40 bg-primary/15 px-1.5 py-0.5 sm:px-2 sm:py-1 text-[10px] sm:text-[11px] font-medium text-primary hover:bg-primary/25 transition-colors disabled:opacity-40`,ze=`inline-flex items-center justify-center gap-1 rounded border border-danger/40 bg-danger/10 px-1.5 py-0.5 sm:px-2 sm:py-1 text-[10px] sm:text-[11px] font-medium text-danger hover:bg-danger/20 transition-colors disabled:opacity-40`,Be=`inline-flex items-center justify-center gap-1 rounded border border-warning/40 bg-warning/10 px-1.5 py-0.5 sm:px-2 sm:py-1 text-[10px] sm:text-[11px] font-medium text-warning hover:bg-warning/20 transition-colors disabled:opacity-40`,Ve=`w-full rounded border border-border bg-background px-1.5 py-0.5 sm:px-2 sm:py-1 text-[11px] sm:text-xs text-foreground focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none`,He=`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium transition-colors`,Ue=`border-primary/50 bg-primary/15 text-primary`,We=`border-border bg-surface text-foreground-subtle hover:bg-surface-hover`;a();var Z=`/addon/snapshot/media`;function Ge(e,n={}){let{width:r,baseUrl:i}=n,[a,o]=u(0);return{src:s(()=>{if(e===null||e<=0)return null;let t=i===void 0?N():i.replace(/\/+$/,``),n=new URLSearchParams;r!==void 0&&Number.isInteger(r)&&r>0&&n.set(`w`,String(r)),a>0&&(n.set(`force`,`1`),n.set(`r`,String(a)));let o=n.toString();return`${t}${Z}/${String(e)}.jpg${o.length>0?`?${o}`:``}`},[e,r,i,a]),loading:!1,refresh:t(()=>{o(e=>e+1)},[])}}a();var Q=T(`camstack:player-overlays-state`,null),$=T(`camstack:player-overlays-actions`,null);function Ke({children:e}){let[n,r]=u(()=>new Map),[i,a]=u(()=>new Map),o=t(e=>{r(t=>{let n=new Map(t);return n.set(e.id,e),n})},[]),c=t(e=>{r(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),l=t(e=>{a(t=>{let n=new Map(t);return n.set(e.id,e),n})},[]),f=t(e=>{a(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),p=s(()=>({layers:n,buttons:i}),[n,i]),m=s(()=>({setLayer:o,removeLayer:c,setButton:l,removeButton:f}),[o,c,l,f]);return d(Q.Provider,{value:p,children:d($.Provider,{value:m,children:e})})}function qe(){let e=r(Q);return s(()=>e?[...e.layers.values()].toSorted((e,t)=>e.order-t.order):[],[e])}function Je(){let e=r(Q);return s(()=>e?[...e.buttons.values()].toSorted((e,t)=>e.order-t.order):[],[e])}function Ye(e){let t=r($);f(()=>{if(!(!t||!e))return t.setLayer(e),()=>t.removeLayer(e.id)},[t,e])}function Xe(e){let t=r($);f(()=>{if(!(!t||!e))return t.setButton(e),()=>t.removeButton(e.id)},[t,e])}export{R as $,be as A,Y as B,Oe as C,je as D,Ae as E,Fe as F,U as G,he as H,J as I,V as J,G as K,K as L,Pe as M,Ie as N,Te as O,Me as P,L as Q,ge as R,ye as S,De as T,q as U,_e as V,ue as W,I as X,B as Y,F as Z,Ce as _,Je as a,O as at,X as b,Le as c,w as ct,Be as d,ne as dt,M as et,Ue as f,te as ft,we as g,b as gt,xe as h,x as ht,Xe as i,k as it,Ne as j,Ee as k,ze as l,ie as lt,We as m,S as mt,Ye as n,N as nt,Z as o,T as ot,He as p,C as pt,W as q,qe as r,D as rt,Ge as s,ae as st,Ke as t,z as tt,Re as u,re as ut,Ve as v,ke as w,ve as x,Se as y,fe as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{J as e}from"./index-CG76NtTM.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-CG76NtTM.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-CG76NtTM.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-CG76NtTM.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{n as e,t}from"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-D3L7eEpM.js";export{t as get,e as init};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{J as e}from"./index-CG76NtTM.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-CG76NtTM.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-CG76NtTM.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-CG76NtTM.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-CG76NtTM.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as e}from"./index-
|
|
1
|
+
import{J as e}from"./index-CG76NtTM.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{J as e}from"./index-CG76NtTM.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-CG76NtTM.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};
|