1import{Z as w,a as m,wT as y,hT as I,hG as g}from"./index-bYydl4Tx.js";import{u as h}from"./useEventFlows-CsW6a6hN.js";import{a as v}from"./useUsers-BU2hPspt.js";try{let e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="111bb300-3b8d-4045-b224-7d8ae9b6e93e",e._sentryDebugIdIdentifier="sentry-dbid-111bb300-3b8d-4045-b224-7d8ae9b6e93e")}catch{}function E(e,t){const n=e??t;return typeof n=="string"&&n.toUpperCase()==="ALARM"}function D(e,t){if(!e?.length||!t)return;const n=t.toLowerCase();return e.find(o=>o.eventFlowMetadata?.precondition?.fieldPath==="subtype"&&String(o.eventFlowMetadata?.precondition?.value).toLowerCase()===n)}function T(e,t){if(!e?.length||!t||t===y)return;const n=t.toUpperCase();return e.find(o=>o.eventFlowMetadata?.precondition?.fieldPath===I&&String(o.eventFlowMetadata?.precondition?.value).toUpperCase()===n)}function M({eventFlows:e,verificationEventFlowId:t,currentNodeId:n,monitoringMode:o,routeEventFlowId:r,eventSubtype:i,eventCategory:s}){if(!e?.length)return;if(n){const d=e.find(u=>u.id===t);if(d)return d}const f=E(s,i)?T(e,o):void 0;if(f)return f;if(r)return e.find(d=>d.id===r)??e[0];if(i)return D(e,i)??e[0]}function B({eventSubtype:e,eventCategory:t,monitoringMode:n,currentNodeId:o,verificationEventFlowId:r}={}){const i=w(),{workflows:s,isLoading:f}=h(),d=s&&s.length>0,u=i.state,b=u?.fromTab??"open",c=m.useMemo(()=>M({eventFlows:s,verificationEventFlowId:r,currentNodeId:o,monitoringMode:n,routeEventFlowId:u?.eventFlowId,eventSubtype:e,eventCategory:t}),[s,r,o,n,u?.eventFlowId,e,t]);return{eventFlow:c,workflowId:c?.id,workflowName:c?.name,hasEventFlows:d,isLoading:f,returnTab:b}}function F(e){const{users:t}=v({enabled:!!e});return m.useMemo(()=>!e||!t?void 0:t.find(o=>o.email?.toLowerCase()===e.toLowerCase())?.name||void 0,[e,t])}function O(e,t,n,o,r){return`${e}/cameras/${t}/alarm.m3u8?stream=${n}&start=${o}&jwt=${r}`}function $(e,t,n,o="",r){return{...n,...e,videoUrl:o,thumbnail:r,streams:n?.streams||e.streams,id:e.chId,cameraId:e.id,deviceId:t.locationId,siteId:t.siteId}}function _(e){const t=new Set;for(const n of g(e))n.cameraId!=null&&t.add(n.cameraId);return t}function C(e,t,n){const o=_(n),r=e.filter(i=>{const s=t(i);return s!=null&&o.has(s)});return r.length>0?r:e}function U(e,t){return C(e,n=>n.cameraId,t)}function a(e){return typeof e=="object"&&e!==null?e:void 0}function l(e){const t=a(e?.data)?.updatedBy;return typeof t=="string"&&t!==""?t:void 0}function p(e){if(typeof e!="number"&&typeof e!="string")return;const t=new Date(e);return Number.isNaN(t.getTime())?void 0:t}function V(e){const t=a(e);if(!t)return{};const n=a(t.node_data),o=a(n?.current),r=a(n?.previous),i=l(o)?o:r;return{closedByEmail:l(i),closedAt:p(a(i?.data)?.updatedTime)??p(t.modifiedAt)}}function k(e,t){if(e)return t?`${t} - ${e}`:e}export{F as a,O as b,k as c,D as d,C as e,U as f,V as g,E as i,$ as t,B as u}; 2//# sourceMappingURL=verificationClosure-DnoEfOvk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.