@camstack/addon-admin-ui 1.2.654 → 1.2.655

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 (98) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/assets/{Addons-DQgD_v95.js → Addons-DyJCfk3K.js} +1 -1
  3. package/dist/assets/{AdminPage-CK-MkPlu.js → AdminPage-aLHp47jf.js} +1 -1
  4. package/dist/assets/{AdminSectionedPage-OhQI2qXm.js → AdminSectionedPage-DC99_NYO.js} +1 -1
  5. package/dist/assets/{AiProfiles-Djyyj23M.js → AiProfiles-7TjJU7gH.js} +1 -1
  6. package/dist/assets/{BootstrapSettingsForm-DKhGcnmJ.js → BootstrapSettingsForm-DujO7xd3.js} +1 -1
  7. package/dist/assets/Build-5EPZNJc_.js +40 -0
  8. package/dist/assets/{Calendars-j1BCsAq6.js → Calendars-B21A2j3J.js} +1 -1
  9. package/dist/assets/{CameraGrids-OnERcK30.js → CameraGrids-CXNpT_B8.js} +1 -1
  10. package/dist/assets/{Cluster-CgLlyPaD.js → Cluster-DpgPRLih.js} +1 -1
  11. package/dist/assets/CompositionBlockEditor-GDw9wpyC.js +2 -0
  12. package/dist/assets/{CompositionEditorPage-Cmw79l07.js → CompositionEditorPage-D4mYMm-K.js} +1 -1
  13. package/dist/assets/{Data-m0300B8d.js → Data-BTlEa5yB.js} +1 -1
  14. package/dist/assets/DeviceDetail-CNtpEA24.js +2 -0
  15. package/dist/assets/{Devices-DSam6qvr.js → Devices-DcZIXngR.js} +1 -1
  16. package/dist/assets/{EmbedDevicePage-Cl1Kgkk_.js → EmbedDevicePage-NUKM9Y94.js} +1 -1
  17. package/dist/assets/{EmbedPlayerPage-DsTHw1Kb.js → EmbedPlayerPage-CzDEkeN3.js} +1 -1
  18. package/dist/assets/{History-CkFf0U-x.js → History-Co3N1ECB.js} +1 -1
  19. package/dist/assets/{Identity-4ET53nEl.js → Identity-Cb_y_j4v.js} +1 -1
  20. package/dist/assets/{InstancesTable-GFnxaz8g.js → InstancesTable-DZHp204O.js} +1 -1
  21. package/dist/assets/{IntegrationDetail-CjK9pgiF.js → IntegrationDetail-oeZTeQnA.js} +1 -1
  22. package/dist/assets/{IntegrationWizard-DYsJKt8F.js → IntegrationWizard-BZ2-i83L.js} +1 -1
  23. package/dist/assets/{Integrations-CZyvmitI.js → Integrations-B0sKe_MX.js} +1 -1
  24. package/dist/assets/{Integrations-Bvh7023p.js → Integrations-D9FcrJXz.js} +1 -1
  25. package/dist/assets/{Library-DPIx7qxk.js → Library-BqYimbZR.js} +1 -1
  26. package/dist/assets/{Locations-SMSlu8LX.js → Locations-9q72GJxA.js} +1 -1
  27. package/dist/assets/{Logs-CTmPbz9A.js → Logs-DyUEl7-W.js} +1 -1
  28. package/dist/assets/{MaskShapeCanvas-Ca2DbsYa.js → MaskShapeCanvas-D4W6rB-U.js} +1 -1
  29. package/dist/assets/{MotionZonesSettings-8hC3v_-y.js → MotionZonesSettings-CI3yCbis.js} +1 -1
  30. package/dist/assets/{MyAccess-C2AUJs9o.js → MyAccess-CCWVg8X1.js} +1 -1
  31. package/dist/assets/{Network-C9Qk_IUD.js → Network-ChHr4jPK.js} +1 -1
  32. package/dist/assets/{NodeAddonsSettingsPanel-C8WWXhDN.js → NodeAddonsSettingsPanel-DyAkVlR3.js} +2 -2
  33. package/dist/assets/Notifications-CxxZDBll.js +1 -0
  34. package/dist/assets/{Pipeline-D9MKELnZ.js → Pipeline-Bsh224Sd.js} +1 -1
  35. package/dist/assets/{PrivacyMaskSettings-CXeCHxqT.js → PrivacyMaskSettings-C4UU_fXQ.js} +1 -1
  36. package/dist/assets/{Recordings-DUcSFOaR.js → Recordings-DEvP3Bfl.js} +1 -1
  37. package/dist/assets/{RemoteGrid-DN94_B3Z.js → RemoteGrid-Bsj2x0GN.js} +1 -1
  38. package/dist/assets/{ScanSubnetEditor-CPEt25Mk.js → ScanSubnetEditor-83bxeuIV.js} +1 -1
  39. package/dist/assets/{SceneMonitorEditor-COY1fmSc.js → SceneMonitorEditor-OVXtamOi.js} +1 -1
  40. package/dist/assets/{SessionsList-CIvnpq6T.js → SessionsList-DPfHCju_.js} +1 -1
  41. package/dist/assets/{Showroom-BY6ET01S.js → Showroom-JytwI7ts.js} +1 -1
  42. package/dist/assets/{StorageLocationsTable-DUzHqFdY.js → StorageLocationsTable-D0-iwXJt.js} +1 -1
  43. package/dist/assets/{System-o4YL_E1y.js → System-CfB4TfTX.js} +1 -1
  44. package/dist/assets/{Templates-Db5XZbLd.js → Templates-Cu0Zx0WB.js} +1 -1
  45. package/dist/assets/{Terminal-BqQdTFoW.js → Terminal-D2wG4YSv.js} +1 -1
  46. package/dist/assets/{TrainingProviders-BNK55Stf.js → TrainingProviders-BKBWflor.js} +1 -1
  47. package/dist/assets/{Viewer-prFahoJ4.js → Viewer-rKCQt8Pi.js} +1 -1
  48. package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-uMRky5qp.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-rv5WZowx.js} +1 -1
  49. package/dist/assets/{action-draft-CRqBDk2Z.js → action-draft-BpL552GS.js} +1 -1
  50. package/dist/assets/{ai-page.helpers-maEFMpek.js → ai-page.helpers-DLFlpj3G.js} +1 -1
  51. package/dist/assets/{assignment-candidates-CV89DgoD.js → assignment-candidates-BK42JAzD.js} +1 -1
  52. package/dist/assets/{authed-media-C1aAE5s_.js → authed-media-CdfUt51r.js} +1 -1
  53. package/dist/assets/{board-model-D0jdm48D.js → board-model-BACBh92I.js} +1 -1
  54. package/dist/assets/client-BD4NsqEN.js +1115 -0
  55. package/dist/assets/{command-vocab-DkNXUg4Q.js → command-vocab-B_sqDpAc.js} +1 -1
  56. package/dist/assets/{create-composition-CHCu4Z4K.js → create-composition-CtkD_L5c.js} +1 -1
  57. package/dist/assets/device-detail-DNqKt0La.js +1 -0
  58. package/dist/assets/{device-integration-icon-C1x0kvP3.js → device-integration-icon-BLg5i-Lj.js} +1 -1
  59. package/dist/assets/device-picker-model-Du6UAsiy.js +1 -0
  60. package/dist/assets/dist-BK12oHz3.js +1115 -0
  61. package/dist/assets/{dist-D6T4RfRg.js → dist-BonRqxy_.js} +1 -1
  62. package/dist/assets/{format-oZ7KZtah.js → format-DRt7qFMH.js} +1 -1
  63. package/dist/assets/{hostInit-BML2LnRL.js → hostInit-Bgo3XaDt.js} +1 -1
  64. package/dist/assets/i18n-EpyjWJGh.js +1 -0
  65. package/dist/assets/{icons-CGidwIaF.js → icons-BiHuBwzY.js} +1 -1
  66. package/dist/assets/{index-DAjN0K_c.js → index-C_D8eRsf.js} +3 -3
  67. package/dist/assets/{linked-devices-model-CcWs3olU.js → linked-devices-model-4oBb-ZIa.js} +1 -1
  68. package/dist/assets/{mf-entry-bootstrap-0-29d74208.js → mf-entry-bootstrap-0-b3c36c58.js} +2 -2
  69. package/dist/assets/mount-Du6UAsiy.js +1 -0
  70. package/dist/assets/{notification-rule-status-Cm6fEOJj.js → notification-rule-status-jGDjCnq5.js} +1 -1
  71. package/dist/assets/{player-overlays-C90g2D8G.js → player-overlays-Bs9A8fez.js} +1 -1
  72. package/dist/assets/remoteEntry-BFByx-0h.js +1 -0
  73. package/dist/assets/src-CNcEcLrI.js +263 -0
  74. package/dist/assets/{step-inspector-model-asfGndKZ.js → step-inspector-model-CQ4ZhPOo.js} +1 -1
  75. package/dist/assets/{use-scenes-feed-BXvQ_0on.js → use-scenes-feed-DZp1AHrK.js} +1 -1
  76. package/dist/assets/{use-stationary-objects-lg2p95kD.js → use-stationary-objects-B_EMLFx7.js} +1 -1
  77. package/dist/assets/{useAdminDeviceRemoval-dJ5nhVNy.js → useAdminDeviceRemoval-BGavriCa.js} +1 -1
  78. package/dist/assets/useEventInvalidation-Du6UAsiy.js +1 -0
  79. package/dist/assets/{useNodeUrlSelection-qXaxaGxG.js → useNodeUrlSelection-DnHxOtlP.js} +1 -1
  80. package/dist/assets/useTemplateSave-CT5IvdL4.js +1 -0
  81. package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-DJ50nHy2.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-922VMW57.js} +2 -2
  82. package/dist/index.html +7 -7
  83. package/dist/server/addon.js +65 -10
  84. package/package.json +2 -2
  85. package/dist/assets/Build-Cf3MOxUN.js +0 -40
  86. package/dist/assets/CompositionBlockEditor-BEMdmU_i.js +0 -2
  87. package/dist/assets/DeviceDetail-DiMmIGM8.js +0 -2
  88. package/dist/assets/Notifications-DArKD3gT.js +0 -1
  89. package/dist/assets/client-B4n8NMWW.js +0 -1115
  90. package/dist/assets/device-detail-BCUJLFIL.js +0 -1
  91. package/dist/assets/device-picker-model-DRcQHVyk.js +0 -1
  92. package/dist/assets/dist-D_CJWYmG.js +0 -1115
  93. package/dist/assets/i18n-DfJLU041.js +0 -1
  94. package/dist/assets/mount-DRcQHVyk.js +0 -1
  95. package/dist/assets/remoteEntry-CfgZ7Hz2.js +0 -1
  96. package/dist/assets/src-8V-UKpNs.js +0 -263
  97. package/dist/assets/useEventInvalidation-DRcQHVyk.js +0 -1
  98. package/dist/assets/useTemplateSave-DHubKBD-.js +0 -1
@@ -1 +1 @@
1
- import{Fi as e,ds as t}from"./client-B4n8NMWW.js";import{t as n}from"./i18n-DfJLU041.js";import{t as r}from"./assignment-candidates-CV89DgoD.js";function i(n,r){let i=e[n];return i.hostDeviceTypes.some(e=>e===r)?`host`:i.descriptor.sourceCaps===`any`&&r!==t.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{Ai as e,ps as t}from"./client-BD4NsqEN.js";import{t as n}from"./i18n-EpyjWJGh.js";import{t as r}from"./assignment-candidates-BK42JAzD.js";function i(n,r){let i=e[n];return i.hostDeviceTypes.some(e=>e===r)?`host`:i.descriptor.sourceCaps===`any`&&r!==t.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-BML2LnRL.js");
15
+ const __mfHostInit = await __mfImport("./hostInit-Bgo3XaDt.js");
16
16
  await __mfHostInit.__tla;
17
17
  const { initHost } = __mfHostInit;
18
18
  await initHost();
19
- })().then(() => __mfImport("./index-DAjN0K_c.js"));
19
+ })().then(() => __mfImport("./index-C_D8eRsf.js"));
@@ -0,0 +1 @@
1
+ import"./src-CNcEcLrI.js";
@@ -1 +1 @@
1
- import{t as e}from"./i18n-DfJLU041.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-EpyjWJGh.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};