@camstack/addon-admin-ui 1.2.708 → 1.2.709

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/assets/{AccessSection-CmL_Onb2.js → AccessSection-DsqpMtPJ.js} +1 -1
  3. package/dist/assets/{Addons-DWymb9Vl.js → Addons-Cz2K9oJ8.js} +3 -3
  4. package/dist/assets/{AdminPage-Q8iyQ6l8.js → AdminPage-Bl53zoyw.js} +1 -1
  5. package/dist/assets/{AdminSectionedPage-BD_fZFRe.js → AdminSectionedPage-EAetNMH-.js} +1 -1
  6. package/dist/assets/{AiProfiles-BIxZ2_6q.js → AiProfiles-ChTO_Ydh.js} +2 -2
  7. package/dist/assets/{Archive-C6_m1wEE.js → Archive-CCM5CLiw.js} +1 -1
  8. package/dist/assets/{BootstrapSettingsForm-CaT3bTFg.js → BootstrapSettingsForm-zFXKMvht.js} +1 -1
  9. package/dist/assets/{Build-DvKE6nTb.js → Build-BUn8veoa.js} +4 -4
  10. package/dist/assets/{Calendars-DHzAhyJ7.js → Calendars-DnX6EFmJ.js} +1 -1
  11. package/dist/assets/{Cluster-DbxqzICC.js → Cluster-BVy2twli.js} +1 -1
  12. package/dist/assets/{CompositionBlockEditor-Bgx8eHTM.js → CompositionBlockEditor-BdhVBszZ.js} +2 -2
  13. package/dist/assets/{CompositionEditorPage-B9gDFYDb.js → CompositionEditorPage-CSNZejAP.js} +1 -1
  14. package/dist/assets/{Data-CcpaQCFA.js → Data-BmUkcx8m.js} +2 -2
  15. package/dist/assets/{DeviceDetail-NBocrvbT.js → DeviceDetail-CI9pWEZx.js} +1 -1
  16. package/dist/assets/{Devices-D8DTAwFv.js → Devices-B4eWRgrT.js} +1 -1
  17. package/dist/assets/{EmbedDevicePage-CPQdBTEQ.js → EmbedDevicePage-CAoaEQ1B.js} +1 -1
  18. package/dist/assets/{EmbedPlayerPage-B5_-KzBH.js → EmbedPlayerPage-DN98Q6U8.js} +1 -1
  19. package/dist/assets/{History-ft50TIgH.js → History-DwFdQQ0F.js} +1 -1
  20. package/dist/assets/{Identity-D0tXeMJI.js → Identity-B69kRPPY.js} +1 -1
  21. package/dist/assets/InstancesTable-HNpVzE7s.js +1 -0
  22. package/dist/assets/IntegrationDetail-BQjAxMD0.js +1 -0
  23. package/dist/assets/Integrations-CxAO3rmA.js +1 -0
  24. package/dist/assets/{Integrations-CZBdHxHR.js → Integrations-ZaHklJZz.js} +2 -2
  25. package/dist/assets/{Library-_igcImHQ.js → Library-CmkZkIyb.js} +1 -1
  26. package/dist/assets/{Locations-BXSHCcGW.js → Locations-BtA7tzTS.js} +2 -2
  27. package/dist/assets/{Logs-BFhMej4c.js → Logs-DcUmYZxQ.js} +1 -1
  28. package/dist/assets/{MaskShapeCanvas-DJAQ2y3P.js → MaskShapeCanvas-BN6ufTmt.js} +1 -1
  29. package/dist/assets/{MotionZonesSettings-CwHYVPtN.js → MotionZonesSettings-DsM7FPZE.js} +1 -1
  30. package/dist/assets/{MyAccess-d4Dxkbs9.js → MyAccess-36quXrzY.js} +1 -1
  31. package/dist/assets/{Network-CZWNHZbt.js → Network-BQNbI68p.js} +1 -1
  32. package/dist/assets/{NewExportModal-Djoe8Y50.js → NewExportModal-DDvQiW17.js} +1 -1
  33. package/dist/assets/{NodeAddonsSettingsPanel-B9ozPPw1.js → NodeAddonsSettingsPanel-D1XKr-t3.js} +1 -1
  34. package/dist/assets/{Notifications-BvvHJsaT.js → Notifications-drh-_18M.js} +1 -1
  35. package/dist/assets/{PanelContent-BvMFsT5L.js → PanelContent-X6Ywa9XD.js} +1 -1
  36. package/dist/assets/{Pipeline-BOw5x-8P.js → Pipeline-CRNttd3s.js} +1 -1
  37. package/dist/assets/{PrivacyMaskSettings-hArLTspd.js → PrivacyMaskSettings-m809AVSj.js} +1 -1
  38. package/dist/assets/{SceneMonitorEditor-BQ4Ow_Zr.js → SceneMonitorEditor-BRoTpS7V.js} +1 -1
  39. package/dist/assets/{SessionsList-Dd_M6VZ_.js → SessionsList-BTFEy3vR.js} +1 -1
  40. package/dist/assets/{Showroom-BV_20igh.js → Showroom-COU-VFZB.js} +1 -1
  41. package/dist/assets/{StorageLocationsTable-BlY2ZuRD.js → StorageLocationsTable-C32VlQPn.js} +1 -1
  42. package/dist/assets/{System-kmtCUnQG.js → System-wwGQgV2N.js} +2 -2
  43. package/dist/assets/{TemplateEditorDialog-qiaEmHIC.js → TemplateEditorDialog-Do8_Tkqa.js} +1 -1
  44. package/dist/assets/{Terminal-CCvtDRX3.js → Terminal-l-QGE8OW.js} +1 -1
  45. package/dist/assets/{TrainingProviders-QpCAaIRs.js → TrainingProviders-OLJbQPF7.js} +1 -1
  46. package/dist/assets/{Viewer-DZ8d24s6.js → Viewer-BHhyWOaP.js} +1 -1
  47. package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-CU5UJUMr.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-GVnTVa9B.js} +1 -1
  48. package/dist/assets/{action-draft-B7-vMM4C.js → action-draft-xWZeLJBc.js} +1 -1
  49. package/dist/assets/{ai-page.helpers-CH98Xnez.js → ai-page.helpers-PZj63Lqj.js} +1 -1
  50. package/dist/assets/{assignment-candidates-CMfCAjbD.js → assignment-candidates-DgKn7QW8.js} +1 -1
  51. package/dist/assets/{authed-media-mKoUB7Wx.js → authed-media-BXbglKGb.js} +1 -1
  52. package/dist/assets/{board-model-D0VuBTSN.js → board-model-Deno4GUf.js} +1 -1
  53. package/dist/assets/{camera-block-model-1_LIwub0.js → camera-block-model-BmK3dL9c.js} +1 -1
  54. package/dist/assets/client-D93RkunP.js +1125 -0
  55. package/dist/assets/{command-vocab-CRRlGeAg.js → command-vocab-DGcpiUvY.js} +1 -1
  56. package/dist/assets/{device-integration-icon-evTdq6FJ.js → device-integration-icon-Ca748TOC.js} +1 -1
  57. package/dist/assets/device-picker-model-5TmG1RTl.js +1 -0
  58. package/dist/assets/dist-ClyHN0ce.js +1125 -0
  59. package/dist/assets/{dist-BBOm1A6D.js → dist-SwLD2DK1.js} +1 -1
  60. package/dist/assets/{format-B9MC39Sk.js → format-CzUOyOqz.js} +1 -1
  61. package/dist/assets/{hostInit-B1RT7r2L.js → hostInit-Bn0he4-M.js} +1 -1
  62. package/dist/assets/i18n-CEeel4Y-.js +1 -0
  63. package/dist/assets/{icons-BIPkMWld.js → icons-C4C8iPI_.js} +1 -1
  64. package/dist/assets/index-BFuQYqWe.css +2 -0
  65. package/dist/assets/{index-D3mVWYUM.js → index-L2D_wmX_.js} +4 -4
  66. package/dist/assets/{linked-devices-model-CKiEiEUw.js → linked-devices-model-B5-OUbTR.js} +1 -1
  67. package/dist/assets/{mf-entry-bootstrap-0-2bdfde26.js → mf-entry-bootstrap-0-d1cd0ee2.js} +2 -2
  68. package/dist/assets/mount-5TmG1RTl.js +1 -0
  69. package/dist/assets/{notification-rule-status-B6U4GFtq.js → notification-rule-status-Dced0U_-.js} +1 -1
  70. package/dist/assets/{player-overlays-D1NExXj2.js → player-overlays-hLBmOC8C.js} +1 -1
  71. package/dist/assets/remoteEntry-BvFnmcAe.js +1 -0
  72. package/dist/assets/src-DBaqc0p7.js +279 -0
  73. package/dist/assets/{sso-popup-C96ZvJqF.js → sso-popup-B1dVbyW9.js} +1 -1
  74. package/dist/assets/{step-inspector-model-9ly-JWp5.js → step-inspector-model-DvIFo0NZ.js} +1 -1
  75. package/dist/assets/{use-scenes-feed-czWy_ho6.js → use-scenes-feed-YtLOCajT.js} +1 -1
  76. package/dist/assets/{useAdminDeviceRemoval-QjQBZ6tM.js → useAdminDeviceRemoval-D8Gqm3dV.js} +1 -1
  77. package/dist/assets/useEventInvalidation-5TmG1RTl.js +1 -0
  78. package/dist/assets/{useNodeUrlSelection-DHio5p0q.js → useNodeUrlSelection-KMQXX7NA.js} +1 -1
  79. package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-J9oLjMJ0.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BECtRrgF.js} +2 -2
  80. package/dist/index.html +9 -9
  81. package/dist/server/addon.js +370 -23
  82. package/package.json +2 -2
  83. package/dist/assets/InstancesTable-BECFInNU.js +0 -1
  84. package/dist/assets/IntegrationDetail-HyHJN95v.js +0 -1
  85. package/dist/assets/Integrations-9Im6toi_.js +0 -1
  86. package/dist/assets/client-BN2LRjot.js +0 -1125
  87. package/dist/assets/device-picker-model-CZRDLeqa.js +0 -1
  88. package/dist/assets/dist-C4JNZdd3.js +0 -1125
  89. package/dist/assets/i18n-D0ym_MsQ.js +0 -1
  90. package/dist/assets/index-BeEV7XaB.css +0 -2
  91. package/dist/assets/mount-CZRDLeqa.js +0 -1
  92. package/dist/assets/remoteEntry-B-bcpFgG.js +0 -1
  93. package/dist/assets/src-6lZ5_wSy.js +0 -279
  94. package/dist/assets/useEventInvalidation-CZRDLeqa.js +0 -1
@@ -1 +1 @@
1
- import{Qs as e,ta as t}from"./client-BN2LRjot.js";import{t as n}from"./i18n-D0ym_MsQ.js";import{t as r}from"./assignment-candidates-CMfCAjbD.js";function i(n,r){let i=t[n];return i.hostDeviceTypes.some(e=>e===r)?`host`:i.descriptor.sourceCaps===`any`&&r!==e.Container?`guest`:null}function a(e){return e.slot===`linked-devices`}function o(e){if(e.status===`error`)return{kind:`unknown`,reason:e.error?.message??n.t(`helpers.customize.requestFailed`)};if(e.status===`pending`||e.data===void 0)return{kind:`pending`};for(let t of e.data)if(t.state===`ok`&&t.slot===`linked-devices`&&a(t.value))return{kind:`present`,slot:t,value:t.value};let t=e.data.find(e=>e.state===`unreachable`);return t!==void 0&&t.state===`unreachable`?{kind:`unknown`,reason:t.reason}:{kind:`absent`}}function s(e,t){let n=t.trackedDeviceIds??[],r=e=>t=>({deviceId:t.deviceId,name:t.name,health:t.health,implied:e,tracked:n.includes(t.deviceId)});return[...e.sources.map(r(!1)),...(e.impliedSources??[]).map(r(!0))]}function c(e,t){let n=new Set([...e.sources,...e.impliedSources??[]].map(e=>e.deviceId));return(t.trackedDeviceIds??[]).filter(e=>!n.has(e))}function l(e,t){return{...e,deviceIds:[...e.deviceIds,...t.filter(t=>!e.deviceIds.includes(t))]}}function u(e,t){return{...e,deviceIds:e.deviceIds.filter(e=>e!==t),...e.trackedDeviceIds===void 0?{}:{trackedDeviceIds:e.trackedDeviceIds.filter(e=>e!==t)}}}function d(e,t,n){let r=e.trackedDeviceIds??[],i=n?[...r.filter(e=>e!==t),t]:r.filter(e=>e!==t);return{...e,trackedDeviceIds:i}}function f(e,t,n){return e.flatMap(e=>{let i=t.get(e.deviceId);return n.has(e.deviceId)||i===void 0?[]:[{deviceId:e.deviceId,ref:{addonId:i.addonId,stableId:i.stableId},name:e.parentName===null?e.name:`${e.parentName} · ${e.name}`,detail:r(i.integration,e.location),meta:e.type,caps:[],value:null}]})}function p(e,t,n){return n?l(e,[t]):u(e,t)}function m(e,t,n){if(t.deviceIds.includes(n))return{linked:!0,implied:!1};let r=(e.impliedSources??[]).some(e=>e.deviceId===n);return{linked:r,implied:r}}export{c as a,l as c,m as i,d as l,s as n,i as o,o as r,p as s,f as t,u};
1
+ import{Qs as e,ta as t}from"./client-D93RkunP.js";import{t as n}from"./i18n-CEeel4Y-.js";import{t as r}from"./assignment-candidates-DgKn7QW8.js";function i(n,r){let i=t[n];return i.hostDeviceTypes.some(e=>e===r)?`host`:i.descriptor.sourceCaps===`any`&&r!==e.Container?`guest`:null}function a(e){return e.slot===`linked-devices`}function o(e){if(e.status===`error`)return{kind:`unknown`,reason:e.error?.message??n.t(`helpers.customize.requestFailed`)};if(e.status===`pending`||e.data===void 0)return{kind:`pending`};for(let t of e.data)if(t.state===`ok`&&t.slot===`linked-devices`&&a(t.value))return{kind:`present`,slot:t,value:t.value};let t=e.data.find(e=>e.state===`unreachable`);return t!==void 0&&t.state===`unreachable`?{kind:`unknown`,reason:t.reason}:{kind:`absent`}}function s(e,t){let n=t.trackedDeviceIds??[],r=e=>t=>({deviceId:t.deviceId,name:t.name,health:t.health,implied:e,tracked:n.includes(t.deviceId)});return[...e.sources.map(r(!1)),...(e.impliedSources??[]).map(r(!0))]}function c(e,t){let n=new Set([...e.sources,...e.impliedSources??[]].map(e=>e.deviceId));return(t.trackedDeviceIds??[]).filter(e=>!n.has(e))}function l(e,t){return{...e,deviceIds:[...e.deviceIds,...t.filter(t=>!e.deviceIds.includes(t))]}}function u(e,t){return{...e,deviceIds:e.deviceIds.filter(e=>e!==t),...e.trackedDeviceIds===void 0?{}:{trackedDeviceIds:e.trackedDeviceIds.filter(e=>e!==t)}}}function d(e,t,n){let r=e.trackedDeviceIds??[],i=n?[...r.filter(e=>e!==t),t]:r.filter(e=>e!==t);return{...e,trackedDeviceIds:i}}function f(e,t,n){return e.flatMap(e=>{let i=t.get(e.deviceId);return n.has(e.deviceId)||i===void 0?[]:[{deviceId:e.deviceId,ref:{addonId:i.addonId,stableId:i.stableId},name:e.parentName===null?e.name:`${e.parentName} · ${e.name}`,detail:r(i.integration,e.location),meta:e.type,caps:[],value:null}]})}function p(e,t,n){return n?l(e,[t]):u(e,t)}function m(e,t,n){if(t.deviceIds.includes(n))return{linked:!0,implied:!1};let r=(e.impliedSources??[]).some(e=>e.deviceId===n);return{linked:r,implied:r}}export{c as a,l as c,m as i,d as l,s as n,i as o,o as r,p as s,f as t,u};
@@ -12,8 +12,8 @@ const __mfImport = (src) =>
12
12
 
13
13
 
14
14
  (async () => {
15
- const __mfHostInit = await __mfImport("./hostInit-B1RT7r2L.js");
15
+ const __mfHostInit = await __mfImport("./hostInit-Bn0he4-M.js");
16
16
  await __mfHostInit.__tla;
17
17
  const { initHost } = __mfHostInit;
18
18
  await initHost();
19
- })().then(() => __mfImport("./index-D3mVWYUM.js"));
19
+ })().then(() => __mfImport("./index-L2D_wmX_.js"));
@@ -0,0 +1 @@
1
+ import"./src-DBaqc0p7.js";
@@ -1 +1 @@
1
- import{t as e}from"./i18n-D0ym_MsQ.js";var t=`pipeline-analytics`,n=`nc.getRuleStatus`,r=`nc.testRule`;function i(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function a(e,t){let n=e[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function o(e,t){let n=e[t];return typeof n==`string`&&n.length>0?n:void 0}function s(e){if(!i(e))return;let t=o(e,`id`),n=o(e,`downloadPath`),r=a(e,`capturedAt`);if(!(t===void 0||n===void 0||r===void 0))return{id:t,mediaType:o(e,`mediaType`)??`video`,sizeBytes:a(e,`sizeBytes`)??0,capturedAt:r,downloadPath:n}}function c(e){if(!i(e))return;let t=a(e,`startMs`),n=a(e,`endMs`);if(!(t===void 0||n===void 0))return{startMs:t,endMs:n}}function l(e){if(!i(e))return null;let t=a(e,`deviceId`);if(t===void 0)return null;let n=a(e,`lastGeneratedAt`),r=s(e.lastArtifact),o=e.rendering,c=i(o)?{startedAt:a(o,`startedAt`)??0,windowStartMs:a(o,`windowStartMs`)??0,windowEndMs:a(o,`windowEndMs`)??0}:void 0;return{deviceId:t,...n===void 0?{}:{lastGeneratedAt:n},...r===void 0?{}:{lastArtifact:r},...c===void 0?{}:{rendering:c}}}function u(e){if(!i(e))return null;let t=a(e,`deviceId`),n=o(e,`windowKey`),r=a(e,`openedAt`),s=a(e,`closesAt`),c=a(e,`members`),l=a(e,`pending`);return t===void 0||n===void 0||r===void 0||s===void 0||c===void 0||l===void 0?null:{deviceId:t,windowKey:n,openedAt:r,closesAt:s,members:c,pending:l}}function d(e){if(!i(e))return null;let t=o(e,`kind`);if(t===`none`)return{kind:`none`,reason:o(e,`reason`)??``};if(t===`occupancy`){let t=a(e,`deviceId`),n=a(e,`threshold`),r=a(e,`sustainSeconds`);if(t===void 0||n===void 0||r===void 0)return null;let i=o(e,`unavailable`),s=i===`no-snapshot`||i===`zone-absent`?i:void 0,c=a(e,`count`),l=a(e,`observedAt`),u=a(e,`since`),d=o(e,`scope`),f=o(e,`className`),p=o(e,`warning`);return{kind:`occupancy`,deviceId:t,threshold:n,sustainSeconds:r,...d===void 0?{}:{scope:d},...f===void 0?{}:{className:f},...c===void 0?{}:{count:c},...typeof e.occupied==`boolean`?{occupied:e.occupied}:{},...l===void 0?{}:{observedAt:l},...u===void 0?{}:{since:u},...s===void 0?{}:{unavailable:s},...p===void 0?{}:{warning:p}}}if(t===`grouped`){let t=a(e,`groupingSec`);if(t===void 0)return null;if(e.openWindows===null){let n=o(e,`reason`);return{kind:`grouped`,groupingSec:t,openWindows:null,...n===void 0?{}:{reason:n}}}if(!Array.isArray(e.openWindows))return null;let n=[];for(let t of e.openWindows){let e=u(t);if(e===null)return null;n.push(e)}return{kind:`grouped`,groupingSec:t,openWindows:n}}if(t===`timelapse`){let t=Array.isArray(e.devices)?e.devices:[],n=[];for(let e of t){let t=l(e);t!==null&&n.push(t)}let r=c(e.lastWindow),o=e.nextWindow,s=i(o)?{startMs:a(o,`startMs`)??0,endMs:a(o,`endMs`)??null}:void 0;return{kind:`timelapse`,devices:n,...r===void 0?{}:{lastWindow:r},...s===void 0?{}:{nextWindow:s},settleMs:a(e,`settleMs`)??0}}return null}function f(t){let n=Math.max(0,Math.floor(t/6e4));if(n<1)return e.t(`helpers.notificationRuleStatus.lessThanMinute`);if(n<60)return e.t(`helpers.notificationRuleStatus.durMin`,{count:n});let r=Math.floor(n/60),i=n%60;if(r<24)return i===0?e.t(`helpers.notificationRuleStatus.durH`,{count:r}):e.t(`helpers.notificationRuleStatus.durHMin`,{hours:r,minutes:i});let a=Math.floor(r/24),o=r%24;return o===0?e.t(`helpers.notificationRuleStatus.durD`,{count:a}):e.t(`helpers.notificationRuleStatus.durDH`,{days:a,hours:o})}function p(t){if(t<1024)return`${String(t)} B`;let n=t/1024;if(n<1024)return e.t(`helpers.notificationRuleStatus.sizeKb`,{value:n.toFixed(0)});let r=n/1024;return r<1024?e.t(`helpers.notificationRuleStatus.sizeMb`,{value:r.toFixed(1)}):e.t(`helpers.notificationRuleStatus.sizeGb`,{value:(r/1024).toFixed(2)})}function m(e,t){let n=e.scope??`the whole frame`,r=e.className??`objects`;if(e.unavailable!==void 0){let t=e.unavailable===`no-snapshot`?`no live count for this camera yet — the condition fails closed until one arrives`:`“${n}” is not in this camera’s current snapshot — the condition fails closed (deleted zone?)`;return e.warning===void 0?t:`${e.warning} · ${t}`}let i=[`Now: ${String(e.count??0)}/${String(e.threshold)} ${r} in ${n}`,e.occupied===!0?`condition TRUE`:`condition false`];e.since!==void 0&&i.push(`for ${f(Math.max(0,t-e.since))}`),i.push(`holds ${String(e.sustainSeconds)} s before firing`);let a=i.join(` · `);return e.warning===void 0?a:`${e.warning} · ${a}`}function h(t,n,r){if(t.rendering!==void 0)return e.t(`helpers.notificationRuleStatus.tlRendering`,{camera:n,duration:f(Math.max(0,r-t.rendering.startedAt)),from:new Date(t.rendering.windowStartMs).toLocaleString(),to:new Date(t.rendering.windowEndMs).toLocaleString()});if(t.lastGeneratedAt===void 0)return e.t(`helpers.notificationRuleStatus.tlNever`,{camera:n});let i=new Date(t.lastGeneratedAt).toLocaleString(),a=t.lastArtifact;return a===void 0?e.t(`helpers.notificationRuleStatus.tlGone`,{camera:n,when:i}):e.t(`helpers.notificationRuleStatus.tlLast`,{camera:n,when:i,size:p(a.sizeBytes)})}function g(e){return{windows:e.length,waiting:e.reduce((e,t)=>e+t.pending,0)}}export{f as a,h as c,g as i,n,m as o,r,d as s,t};
1
+ import{t as e}from"./i18n-CEeel4Y-.js";var t=`pipeline-analytics`,n=`nc.getRuleStatus`,r=`nc.testRule`;function i(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function a(e,t){let n=e[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function o(e,t){let n=e[t];return typeof n==`string`&&n.length>0?n:void 0}function s(e){if(!i(e))return;let t=o(e,`id`),n=o(e,`downloadPath`),r=a(e,`capturedAt`);if(!(t===void 0||n===void 0||r===void 0))return{id:t,mediaType:o(e,`mediaType`)??`video`,sizeBytes:a(e,`sizeBytes`)??0,capturedAt:r,downloadPath:n}}function c(e){if(!i(e))return;let t=a(e,`startMs`),n=a(e,`endMs`);if(!(t===void 0||n===void 0))return{startMs:t,endMs:n}}function l(e){if(!i(e))return null;let t=a(e,`deviceId`);if(t===void 0)return null;let n=a(e,`lastGeneratedAt`),r=s(e.lastArtifact),o=e.rendering,c=i(o)?{startedAt:a(o,`startedAt`)??0,windowStartMs:a(o,`windowStartMs`)??0,windowEndMs:a(o,`windowEndMs`)??0}:void 0;return{deviceId:t,...n===void 0?{}:{lastGeneratedAt:n},...r===void 0?{}:{lastArtifact:r},...c===void 0?{}:{rendering:c}}}function u(e){if(!i(e))return null;let t=a(e,`deviceId`),n=o(e,`windowKey`),r=a(e,`openedAt`),s=a(e,`closesAt`),c=a(e,`members`),l=a(e,`pending`);return t===void 0||n===void 0||r===void 0||s===void 0||c===void 0||l===void 0?null:{deviceId:t,windowKey:n,openedAt:r,closesAt:s,members:c,pending:l}}function d(e){if(!i(e))return null;let t=o(e,`kind`);if(t===`none`)return{kind:`none`,reason:o(e,`reason`)??``};if(t===`occupancy`){let t=a(e,`deviceId`),n=a(e,`threshold`),r=a(e,`sustainSeconds`);if(t===void 0||n===void 0||r===void 0)return null;let i=o(e,`unavailable`),s=i===`no-snapshot`||i===`zone-absent`?i:void 0,c=a(e,`count`),l=a(e,`observedAt`),u=a(e,`since`),d=o(e,`scope`),f=o(e,`className`),p=o(e,`warning`);return{kind:`occupancy`,deviceId:t,threshold:n,sustainSeconds:r,...d===void 0?{}:{scope:d},...f===void 0?{}:{className:f},...c===void 0?{}:{count:c},...typeof e.occupied==`boolean`?{occupied:e.occupied}:{},...l===void 0?{}:{observedAt:l},...u===void 0?{}:{since:u},...s===void 0?{}:{unavailable:s},...p===void 0?{}:{warning:p}}}if(t===`grouped`){let t=a(e,`groupingSec`);if(t===void 0)return null;if(e.openWindows===null){let n=o(e,`reason`);return{kind:`grouped`,groupingSec:t,openWindows:null,...n===void 0?{}:{reason:n}}}if(!Array.isArray(e.openWindows))return null;let n=[];for(let t of e.openWindows){let e=u(t);if(e===null)return null;n.push(e)}return{kind:`grouped`,groupingSec:t,openWindows:n}}if(t===`timelapse`){let t=Array.isArray(e.devices)?e.devices:[],n=[];for(let e of t){let t=l(e);t!==null&&n.push(t)}let r=c(e.lastWindow),o=e.nextWindow,s=i(o)?{startMs:a(o,`startMs`)??0,endMs:a(o,`endMs`)??null}:void 0;return{kind:`timelapse`,devices:n,...r===void 0?{}:{lastWindow:r},...s===void 0?{}:{nextWindow:s},settleMs:a(e,`settleMs`)??0}}return null}function f(t){let n=Math.max(0,Math.floor(t/6e4));if(n<1)return e.t(`helpers.notificationRuleStatus.lessThanMinute`);if(n<60)return e.t(`helpers.notificationRuleStatus.durMin`,{count:n});let r=Math.floor(n/60),i=n%60;if(r<24)return i===0?e.t(`helpers.notificationRuleStatus.durH`,{count:r}):e.t(`helpers.notificationRuleStatus.durHMin`,{hours:r,minutes:i});let a=Math.floor(r/24),o=r%24;return o===0?e.t(`helpers.notificationRuleStatus.durD`,{count:a}):e.t(`helpers.notificationRuleStatus.durDH`,{days:a,hours:o})}function p(t){if(t<1024)return`${String(t)} B`;let n=t/1024;if(n<1024)return e.t(`helpers.notificationRuleStatus.sizeKb`,{value:n.toFixed(0)});let r=n/1024;return r<1024?e.t(`helpers.notificationRuleStatus.sizeMb`,{value:r.toFixed(1)}):e.t(`helpers.notificationRuleStatus.sizeGb`,{value:(r/1024).toFixed(2)})}function m(e,t){let n=e.scope??`the whole frame`,r=e.className??`objects`;if(e.unavailable!==void 0){let t=e.unavailable===`no-snapshot`?`no live count for this camera yet — the condition fails closed until one arrives`:`“${n}” is not in this camera’s current snapshot — the condition fails closed (deleted zone?)`;return e.warning===void 0?t:`${e.warning} · ${t}`}let i=[`Now: ${String(e.count??0)}/${String(e.threshold)} ${r} in ${n}`,e.occupied===!0?`condition TRUE`:`condition false`];e.since!==void 0&&i.push(`for ${f(Math.max(0,t-e.since))}`),i.push(`holds ${String(e.sustainSeconds)} s before firing`);let a=i.join(` · `);return e.warning===void 0?a:`${e.warning} · ${a}`}function h(t,n,r){if(t.rendering!==void 0)return e.t(`helpers.notificationRuleStatus.tlRendering`,{camera:n,duration:f(Math.max(0,r-t.rendering.startedAt)),from:new Date(t.rendering.windowStartMs).toLocaleString(),to:new Date(t.rendering.windowEndMs).toLocaleString()});if(t.lastGeneratedAt===void 0)return e.t(`helpers.notificationRuleStatus.tlNever`,{camera:n});let i=new Date(t.lastGeneratedAt).toLocaleString(),a=t.lastArtifact;return a===void 0?e.t(`helpers.notificationRuleStatus.tlGone`,{camera:n,when:i}):e.t(`helpers.notificationRuleStatus.tlLast`,{camera:n,when:i,size:p(a.sizeBytes)})}function g(e){return{windows:e.length,waiting:e.reduce((e,t)=>e+t.pending,0)}}export{f as a,h as c,g as i,n,m as o,r,d as s,t};