PageSourceSearch

https://cctvconnect.com/static/js/52.c5056dd0.chunk.js

js cctvconnect.com collected 2026-10-02 00:18:08 UTC 45,336 bytes, 2 lines download raw bytes

1(this.webpackJsonpwebapp=this.webpackJsonpwebapp||[]).push([[52],{1216:function(e,t,n){"use strict";n.r(t);var a,l,r,i,c=n(3),o=n(1),s=n.n(o),d=n(8),b=n.n(d),u=n(440),j=n(39),p=n(4),O=n(19),m=n(35),h=n(21),g=n(229),f=n(115),x=n(114),v=n(13),y=n(521),w=n(457),A=n(6),C=n(7);const k=C.c.div(a||(a=Object(A.a)(["\n    position: relative;\n    width: 100%;\n    height: 100%;\n    min-height: 0;\n    overflow: auto;\n"])));k.displayName="VirtualisedCardListContainer";const E=C.c.div(l||(l=Object(A.a)(["\n    position: relative;\n    width: 100%;\n    min-height: 100%;\n"])));E.displayName="VirtualisedCardListInner";const M=C.c.div.attrs((e=>{let{$itemHeight:t,$itemWidth:n,$left:a,$top:l}=e;return{style:{height:t,width:n,left:a,top:l}}}))(r||(r=Object(A.a)(["\n    position: absolute;\n"])));M.displayName="VirtualisedCardListItem";const S=C.c.div.attrs((e=>{let{$footerHeight:t,$itemWidth:n,$left:a,$top:l}=e;return{style:{height:t,width:n,left:a,top:l}}}))(i||(i=Object(A.a)(["\n    position: absolute;\n    display: flex;\n    align-items: center;\n    justify-content: center;
1\n"])));S.displayName="VirtualisedCardListFooter";var _=n(2);const I=3,R=120,N=e=>"undefined"!==typeof window&&window.innerWidth<=e,D=Object(o.memo)((e=>{let{items:t,renderItem:n,getItemKey:a,recycleItems:l=!1,desktopItemHeight:r,mobileItemHeight:i,desktopItemGap:c=0,mobileItemGap:s,desktopPadding:d=0,mobilePadding:u,mobileBreakpoint:j=640,overscan:p=I,onReachEnd:O,reachEndOffset:m=R,footer:h,footerHeight:g=0,className:f,"data-testid":x}=e;const v=Object(o.useRef)(null),[y,A]=Object(o.useState)(N(j)),[C,D]=Object(o.useState)([0,-1]),L=y&&"number"===typeof i?i:r,T=y&&"number"===typeof s?s:c,U=y&&"number"===typeof u?u:d,P=L+T,B=t.length>0?t.length*P-T:0,$=B+g+2*U,F=Object(o.useMemo)((()=>(e=>e>0?"calc(100% - ".concat(2*e,"px)"):"100%")(U)),[U]);Object(o.useEffect)((()=>{const e=()=>{A((e=>{const t=N(j);return e===t?e:t}))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[j]);const W=Object(o.useCallback)((()=>{const e=v.current;if(!e)return;if(0===t.length)return void D((e=>{let[t,n]=e;return 0===t&&-1===n?[t,n]:[0,-1]}));const{scrollTop:n,clientHeight:a,scrollHeight:l}=e,r=b.a.clamp(Math.floor(n/P)-p,0,t.length-1),i=b.a.clamp(Math.ceil((n+a)/P)+p-1,0,t.length-1);D((e=>{let[t,n]=e;return t===r&&n===i?[t,n]:[r,i]})),O&&n+a>=l-m&&O()}),[t.length,O,p,m,P]);Object(o.useLayoutEffect)((()=>{const e=v.current;if(!e)return;W();const t=Object(w.a)(W);return e.addEventListener("scroll",t),window.addEventListener("resize",t),()=>{e.removeEventListener("scroll",t),window.removeEventListener("resize",t)}}),[W]),Object(o.useEffect)((()=>{W()}),[g,B,U,W]);const[H,V]=C,G=V>=H?t.slice(H,V+1):[];return Object(_.jsx)(k,{ref:v,className:f,"data-testid":x,children:Object(_.jsxs)(E,{style:{height:$},children:[G.map(((e,t)=>{const r=H+t;return Object(_.jsx)(M,{$itemHeight:L,$itemWidth:F,$left:U,$top:U+r*P,children:n(e,r)},l?t:a(e,r))})),h&&g>0&&Object(_.jsx)(S,{$footerHeight:g,$itemWidth:F,$left:U,$top:U+B,children:h})]})})}));D.defaultProps={getItemKey:(e,t)=>{var n;return null!==(n=null===e||void 0===e?void 0:e.key)&&void 0!==n?n:t},recycleItems:!1,mobileItemHeight:void 0,desktopItemGap:0,mobileItemGap:void 0,desktopPadding:0,mobilePadding:void 0,mobileBreakpoint:640,overscan:I,onReachEnd:void 0,reachEndOffset:R,footer:null,footerHeight:0,className:void 0,"data-testid":void 0};var L,T,U,P,B,$,F,W,H,V,G,z,K,Y,q,Z,X,J,Q,ee,te,ne,ae=D,le=n(522),re=n(418),ie=n(5),ce=n(162);const oe={width:34,height:34,borderRadius:10},se="transparent",de="transparent",be=Object(c.a)(Object(c.a)({},oe),{},{color:Object(ie.v)(100)}),ue={critical:{background:"rgba(236, 33, 68, 0.14)",color:ie.u},warning:{background:"rgba(255, 165, 70, 0.18)",color:ie.a},info:{background:"rgba(52, 103, 211, 0.14)",color:"#4da3ff"}},je=C.c.div(L||(L=Object(A.a)(["\n    width: 100%;\n    height: 100%;\n    border: 1px solid rgba(12, 31, 51, 0.12);\n    outline: 1px solid rgba(255, 255, 255, 0.12);\n    outline-offset: -1px;\n    border-radius: 14px;\n    background: rgba(255, 255, 255, 0.08);\n    box-shadow: 0 6px 18px rgba(12, 31, 51, 0.06);\n    padding: 12px 20px;\n    display: flex;\n    flex-direction: column;\n    gap: 16px;\n    box-sizing: border-box;\n    overflow: hidden;\n    text-align: left;\n    cursor: ",";\n    opacity: ",";\n    transition: border-color 0.2s ease, background-color 0.2s ease,\n        box-shadow 0.2s ease;\n\n    @media (hover: hover) {\n        &:hover {\n            border-color: ",";\n            background: ",";\n            box-shadow: ",";\n        }\n    }\n\n    &:focus-visible {\n        outline: 2px solid rgba(77, 163, 255, 0.45);\n        outline-offset: 2px;\n    }\n\n    @media (max-width: 640px) {\n        padding: 8px 14px 6px;\n        gap: 6px;\n    }\n"])),(e=>{let{$disabled:t}=e;return t?"default":"pointer"}),(e=>{let{$dimmed:t}=e;return t?.5:1}),(e=>{let{$disabled:t}=e;return t?"rgba(12, 31, 51, 0.12)":"rgba(12, 31, 51, 0.2)"}),(e=>{let{$disabled:t}=e;return t?"rgba(255, 255, 255, 0.08)":"rgba(255, 255, 255, 0.12)"}),(e=>{let{$disabled:t}=e;return t?"0 6px 18px rgba(12, 31, 51, 0.06)":"0 10px 24px rgba(12, 31, 51, 0.1)"})),pe=C.c.div(T||(T=Object(A.a)(["\n    display: flex;
1\n    align-items: center;\n    justify-content: space-between;\n    gap: 14px;\n    width: 100%;\n    flex: 1;\n"]))),Oe=C.c.div(U||(U=Object(A.a)(["\n    display: flex;\n    align-items: center;\n    gap: 14px;\n    min-width: 0;\n    flex: 1;\n\n    @media (max-width: 640px) {\n        gap: 10px;\n        align-items: center;\n    }\n"]))),me=C.c.div(P||(P=Object(A.a)(["\n    position: relative;\n    width: 124px;\n    min-width: 124px;\n    height: 70px;\n    aspect-ratio: 124 / 70;\n    overflow: hidden;\n    background: rgba(255, 255, 255, 0.06);\n    border-radius: 10px;\n\n    img {\n        display: block;\n        width: 124px;\n        height: 70px;\n        object-fit: cover;\n    }\n\n    @media (max-width: 640px) {\n        width: 104px;\n        min-width: 104px;\n        height: auto;\n\n        img {\n            width: 100%;\n            height: 100%;\n        }\n    }\n"]))),he=C.c.div(B||(B=Object(A.a)(["\n    width: 100%;\n    height: 100%;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    padding: 12px;\n    text-align: center;\n    font-size: 12px;\n    line-height: 1.4;\n    color: ",";\n    background: linear-gradient(\n        135deg,\n        rgba(12, 31, 51, 0.65),\n        rgba(31, 58, 88, 0.4)\n    );\n\n    @media (max-width: 640px) {\n        font-size: 11px;\n    }\n"])),Object(ie.v)(100)),ge=C.c.div($||($=Object(A.a)(["\n    min-width: 0;\n    flex: 1;\n    display: flex;\n    flex-direction: column;\n    gap: 8px;\n    font-weight: 100;\n\n    @media (max-width: 640px) {\n        gap: 2px;\n    }\n"]))),fe=C.c.div(F||(F=Object(A.a)(["\n    display: flex;\n    align-items: flex-start;\n    justify-content: space-between;\n    gap: 12px;\n    min-width: 0;\n\n    @media (max-width: 640px) {\n        gap: 6px;\n        margin-bottom: -1px;\n    }\n"]))),xe=C.c.div(W||(W=Object(A.a)(["\n    min-width: 0;\n    flex: 1;\n"]))),ve=C.c.div(H||(H=Object(A.a)(["\n    display: flex;\n    align-items: flex-start;\n    justify-content: flex-end;\n    flex: 0 0 auto;\n\n    @media (min-width: 641px) {\n        display: none;\n    }\n"]))),ye=C.c.div(V||(V=Object(A.a)(["\n    display: inline-flex;\n    align-items: center;\n    gap: 8px;\n    flex-wrap: wrap;\n\n    @media (max-width: 640px) {\n        display: none;\n    }\n"]))),we=C.c.span(G||(G=Object(A.a)(["\n    display: none;\n\n    @media (max-width: 640px) {\n        display: inline-flex;\n    }\n"]))),Ae=C.c.div(z||(z=Object(A.a)(["\n    display: flex;\n    flex-wrap: wrap;\n    align-items: center;\n    gap: 8px;\n    min-width: 0;\n    color: ",";\n\n    @media (max-width: 640px) {\n        gap: 5px;\n    }\n"])),Object(ie.v)(100)),Ce=C.c.span(K||(K=Object(A.a)(["\n    display: block;\n    min-width: 0;\n    font-size: 16px;\n    font-weight: 600;\n    line-height: 1.35;\n    color: ",";\n    white-space: nowrap;\n    overflow: hidden;\n    text-overflow: ellipsis;\n\n    @media (max-width: 640px) {\n        font-size: 15px;\n        line-height: 1.25;\n    }\n"])),Object(ie.v)(100)),ke=C.c.span(Y||(Y=Object(A.a)(["\n    display: block;\n    flex: 1 1 0%;\n    font-size: 14px;\n    font-weight: 100;\n    line-height: 1.45;\n    color: ",";\n    min-width: 0;\n    max-width: 100%;\n    white-space: nowrap;\n    overflow: hidden;\n    text-overflow: ellipsis;\n\n    @media (max-width: 640px) {\n        font-size: 14px;\n        line-height: 1.3;\n    }\n"])),Object(ie.v)(100)),Ee=C.c.span(q||(q=Object(A.a)(["\n    display: inline-flex;\n    align-items: center;\n    min-height: 24px;\n    padding: 4px 10px;\n    border-radius: 999px;\n    font-size: 11px;\n    font-weight: 100;\n    letter-spacing: 0.04em;\n    text-transform: uppercase;\n    background: ",";\n    color: ",";\n    white-space: nowrap;\n\n    @media (max-width: 640px) {\n        min-height: 20px;\n        padding: 3px 8px;\n        font-size: 11px;\n    }\n"])),(e=>{let{$background:t}=e;return t}),(e=>{let{$color:t}=e;return t})),Me=C.c.span(Z||(Z=Object(A.a)(["\n    display: inline-flex;\n    align-items: center;\n    min-height: 24px;\n    padding: 4px 10px;\n    border-radius: 999px;\n    font-size: 12px;\n    font-weight: 100;\n    background: rgba(255, 255, 255, 0.1);\n    color: ",";\n    white-space: nowrap;\n\n    @media (max-width: 640px) {\n        min-height: 20px;\n        padding: 3px 8px;\n        font-size: 11px;\n    }\n"])),Object(ie.v)(100)),Se=C.c.div(X||(X=Object(A.a)(["\n    display: flex;
1\n    align-items: center;\n    gap: 6px;\n    flex-shrink: 0;\n\n    @media (max-width: 640px) {\n        display: none;\n    }\n"]))),_e=C.c.div(J||(J=Object(A.a)(["\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    padding-right: 4px;\n\n    @media (max-width: 900px) {\n        padding-right: 0;\n    }\n"]))),Ie=C.c.div(Q||(Q=Object(A.a)(["\n    display: none;\n\n    @media (max-width: 640px) {\n        display: flex;\n        align-items: center;\n        justify-content: space-between;\n        gap: 8px;\n        width: 100%;\n        padding-top: 2px;\n        border-top: 1px solid rgba(255, 255, 255, 0.08);\n    }\n"]))),Re=C.c.div(ee||(ee=Object(A.a)(["\n    display: flex;\n    align-items: center;\n    justify-content: flex-end;\n    gap: 6px;\n    flex: 1 1 auto;\n\n    @media (max-width: 640px) {\n        gap: 8px;\n    }\n"]))),Ne=Object(C.b)(te||(te=Object(A.a)(["\n    .cls-1 {\n        stroke: currentColor !important;\n    }\n"]))),De=(C.c.div(ne||(ne=Object(A.a)(["\n    width: 18px;\n    height: 18px;\n    color: ",";\n    opacity: 1;\n\n    ","\n"])),Object(ie.v)(100),Ne),e=>e.enabled===ce.e.Enabled),Le=e=>e.recipients.find((e=>e.subject_uid===Object(v.t)())),Te=e=>0===e||Boolean(e&&e>0&&Math.floor(Date.now()/1e3)<e);var Ue=n(116),Pe=n(186),Be=n(479),$e=n(185),Fe=n(73),We=n(72);const He=s.a.memo((e=>{let{alert:t,enabled:n,loading:a,canManageAlerts:l,stopRowClick:r,handleEnabledChange:i,t:o}=e;const[s,d]=Object(Fe.a)();return Object(_.jsxs)(_.Fragment,{children:[Object(_.jsx)("span",{ref:d.ref,onMouseEnter:d.onMouseEnter,onMouseLeave:d.onMouseLeave,onFocus:d.onFocus,onBlur:d.onBlur,children:Object(_.jsx)($e.a,{variant:"switch",value:n,disabled:!l||a,onClick:r,onKeyDown:r,onKeyUp:r,onChange:e=>{e.stopPropagation(),i(t,e.target.checked)},checkboxProps:{"aria-label":n?Object(re.f)(o,"alerts.DISABLE_ALERT_WITH_NAME","Disable alert ".concat(t.name),{name:t.name}):Object(re.f)(o,"alerts.ENABLE_ALERT_WITH_NAME","Enable alert ".concat(t.name),{name:t.name}),onKeyDown:r,onKeyUp:r}})}),Object(_.jsx)(We.a,Object(c.a)(Object(c.a)({},s),{},{children:Object(re.f)(o,"alerts.DISABLE_ENABLE_ALERT_FOR_ALL","Disable/enable alert for all")}))]})}));He.displayName="AlertEnabledToggle";var Ve=He,Ge=n(295),ze=n(184),Ke=n(239),Ye=n(846);const qe=s.a.memo((e=>{let{alert:t,camera:n,uidd:a,fetchImage:l}=e;const{t:r}=Object(Ge.a)(),i=null===n||void 0===n?void 0:n.img,s=Object(o.useCallback)((()=>{a&&l(a)}),[l,a]),d=(null===n||void 0===n?void 0:n.name)?"".concat(n.name," thumbnail"):"".concat(t.name," ").concat(Object(re.f)(r,"alerts.THUMBNAIL","thumbnail")),u=(e=>{var t;const{type:n,config:a}=e,l=null===a||void 0===a||null===(t=a.geometry)||void 0===t?void 0:t.coords;return l&&0!==l.length?Object(c.a)({type:n===ce.f.LINE_CROSSING?"line":"polygon",coordinates:l.map((e=>{let[t,n]=e;return[t/100,n/100]}))},n===ce.f.LINE_CROSSING&&"direction"in a.geometry&&!b.a.isNil(a.geometry.direction)?{direction:a.geometry.direction}:{}):null})(t),j=Object(re.f)(r,"alerts.NO_CAMERA_THUMBNAIL","No camera thumbnail"),p=!a||"error"===i,{retryContainerRef:O}=Object(Ye.a)({imageSrc:i,retryKey:a,onRetry:s});return Object(_.jsxs)(me,{"aria-hidden":"true",ref:O,children:[Object(_.jsx)(ze.a,{width:124,height:70,src:i,alt:d,loadImage:a?s:void 0,timeout:250,placeholder:Object(_.jsx)(he,{children:p?j:null}),imageObjectFit:"cover"}),i&&"error"!==i&&u&&Object(_.jsx)(Ke.a,{shapeSearch:u,disableFilters:!0,directionArrowHeadScale:2,fixedAspectRatio:1.7714285714285714})]})}));qe.displayName="AlertThumbnail";var Ze,Xe,Je,Qe,et=qe;function tt(){return(tt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(null,arguments)}function nt(e,t){let{title:n,titleId:a}=e,l=function(e,t){if(null==e)return{};var n,a,l=function(e,t){if(null==e)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.includes(a))continue;n[a]=e[a]}return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}(e,["title","titleId"]);return o.createElement("svg",tt({id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",ref:t,"aria-labelledby":a},l),n?o.createElement("title",{id:a},n):null,Ze||(Ze=o.createElement("defs",null,o.createElement("style",null,".cls-1{fill:none;stroke:#fff;stroke-linecap:round;stroke-linejoin:round;stroke-width:5px;}
1"))),Xe||(Xe=o.createElement("path",{className:"cls-1",d:"M82.97,79.47H17.97c-2.3,0-3.61-2.64-2.22-4.47l5.01-6.59c2.03-2.67,3.13-5.92,3.13-9.27v-17.3c0-14.68,11.9-26.58,26.58-26.58h0c14.68,0,26.58,11.9,26.58,26.58v17.3c0,3.35,1.1,6.61,3.13,9.27l5.01,6.59c1.4,1.83.09,4.47-2.22,4.47Z"})),Je||(Je=o.createElement("path",{className:"cls-1",d:"M56.99,89.48c0,3.57-2.94,6.52-6.52,6.52s-6.52-2.94-6.52-6.52"})),Qe||(Qe=o.createElement("line",{className:"cls-1",x1:50.47,y1:14.34,x2:50.47,y2:4.06})))}const at=o.forwardRef(nt);var lt,rt,it,ct,ot;n.p;function st(){return(st=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(null,arguments)}function dt(e,t){let{title:n,titleId:a}=e,l=function(e,t){if(null==e)return{};var n,a,l=function(e,t){if(null==e)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.includes(a))continue;n[a]=e[a]}return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}(e,["title","titleId"]);return o.createElement("svg",st({id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",ref:t,"aria-labelledby":a},l),n?o.createElement("title",{id:a},n):null,lt||(lt=o.createElement("defs",null,o.createElement("style",null,".cls-1{fill:none;stroke:#fff;stroke-linecap:round;stroke-linejoin:round;stroke-width:5px;}"))),rt||(rt=o.createElement("path",{className:"cls-1",d:"M82.97,79.47H17.97c-2.3,0-3.61-2.64-2.22-4.47l5.01-6.59c2.03-2.67,3.13-5.92,3.13-9.27v-17.3c0-14.68,11.9-26.58,26.58-26.58h0c14.68,0,26.58,11.9,26.58,26.58v17.3c0,3.35,1.1,6.61,3.13,9.27l5.01,6.59c1.4,1.83.09,4.47-2.22,4.47Z"})),it||(it=o.createElement("path",{className:"cls-1",d:"M56.99,89.48c0,3.57-2.94,6.52-6.52,6.52s-6.52-2.94-6.52-6.52"})),ct||(ct=o.createElement("line",{className:"cls-1",x1:50.47,y1:14.34,x2:50.47,y2:4.06})),ot||(ot=o.createElement("line",{className:"cls-1",x1:17.67,y1:90.06,x2:83,y2:17.39})))}const bt=o.forwardRef(dt);n.p;var ut,jt,pt,Ot,mt,ht=n(48),gt=n(252),ft=n(71),xt=n(70),vt=n(675);const yt={color:Object(ie.v)(100),opacity:1},wt=()=>Date.now()+288e5,At=Object(c.a)(Object(c.a)({},{border:"1px solid rgba(12, 31, 51, 0.12)",boxShadow:"0 20px 40px rgba(12, 31, 51, 0.18)",overflow:"hidden"}),{},{background:"#f6f9fc",color:"#0b2239",padding:"8px 0"}),Ct={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"4px 16px 10px",fontSize:18,fontWeight:600},kt={border:"none",background:"transparent",color:"currentColor",padding:0,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center"},Et={width:14,height:14,flexShrink:0,color:"#486581"},Mt=C.c.button(ut||(ut=Object(A.a)(["\n    width: 100%;\n    border: none;\n    background: transparent;\n    color: inherit;\n    display: flex;\n    align-items: center;\n    gap: 10px;\n    padding: 12px 16px;\n    font-size: 15px;\n    font-weight: 100;\n    cursor: pointer;\n    text-align: left;\n    transition: background-color 0.15s ease;\n\n    @media (hover: hover) {\n        &:hover:not(:disabled) {\n            background: rgba(72, 101, 129, 0.12);\n        }\n    }\n\n    &:focus-visible {\n        background: rgba(72, 101, 129, 0.16);\n        outline: none;\n    }\n\n    &:disabled {\n        cursor: not-allowed;\n    }\n"]))),St=Object(C.b)(jt||(jt=Object(A.a)(["\n    .cls-1 {\n        stroke: currentColor !important;\n    }\n"]))),_t=Object(C.c)(bt)(pt||(pt=Object(A.a)(["\n    width: 18px;\n    height: 18px;\n    color: ",";\n    opacity: 1;\n\n    ","\n"])),Object(ie.v)(100),St),It=Object(C.c)(at)(Ot||(Ot=Object(A.a)(["\n    width: 18px;\n    height: 18px;\n    color: ",";\n    opacity: 1;\n\n    ","\n"])),Object(ie.v)(100),St),Rt=Object(C.c)(bt)(mt||(mt=Object(A.a)(["\n    color: #486581;\n\n    ","\n"])),St),Nt=ft.c,Dt=s.a.memo((e=>{var t;let{alert:n,setAlertMuteState:a,t:l,iconButtonProps:r}=e;const[i,s]=Object(xt.a)({placement:"bottom-end",fixedPositioning:!0,clickOnly:!0,keepOpenOn
1MouseMove:!0,arrow:!1,offset:[0,8]}),[d,u]=Object(o.useState)(wt()),[j,g]=Object(o.useState)(!1),[v,w,A]=Object(x.a)(),C=Le(n),k=Te(null===C||void 0===C?void 0:C.mute_until),E=Object(o.useCallback)(((e,t)=>{const n=l(e);return n===e?t:n}),[l]),M=k&&!b.a.isNil(null===C||void 0===C?void 0:C.mute_until)?0===(null===C||void 0===C?void 0:C.mute_until)?Object(re.f)(l,"alerts.mute.ALWAYS_MUTED","Always muted"):Object(re.f)(l,"alerts.mute.MUTED_UNTIL","Muted until ".concat(new Date(1e3*C.mute_until).toLocaleString()),{value:new Date(1e3*C.mute_until).toLocaleString()}):null;Object(o.useEffect)((()=>{i.open||v.show||u(wt())}),[v.show,i.open]);const S=Object(o.useCallback)((()=>{i.closePopup(),A()}),[A,i]),I=Object(o.useCallback)((async e=>{g(!0);try{await Object(y.e)(n.object_uid,n.object_deviceid,n.id,e),a(n.id,e),S()}catch(t){console.error(t)}finally{g(!1)}}),[n.id,n.object_deviceid,n.object_uid,S,a]),R=Object(o.useCallback)((e=>{if(e.stopPropagation(),k)return S(),void I(null);s.onClick(e)}),[I,S,k,s]),N=Object(o.useCallback)((()=>{i.closePopup(),w()}),[w,i]),D=Object(_.jsxs)(O.c,{column:!0,gap:12,style:{padding:"0 16px 16px"},children:[Object(_.jsx)(gt.a,{value:d,onChange:u,min:new Date,max:new Date(Date.now()+63072e6)}),Object(_.jsxs)(O.c,{row:!0,gap:10,justifyContent:"center",children:[Object(_.jsx)(m.a,{variant:"secondary-grey",onClick:()=>{v.show&&A()},stopPropagation:!0,children:l(p.a.forms.CANCEL)}),Object(_.jsx)(m.a,{loading:j,onClick:()=>I(Math.floor(d/1e3)),stopPropagation:!0,children:l(p.a.forms.CONFIRM)})]})]});return Object(_.jsxs)(_.Fragment,{children:[Object(_.jsx)("span",{ref:s.ref,children:Object(_.jsx)(Ue.a,Object(c.a)(Object(c.a)({description:k?Object(re.f)(l,"alerts.UNMUTE_ALERT","".concat(M,". Unmute alert")):Object(re.f)(l,"alerts.MUTE_ALERT_FOR_ME","Mute alert for me"),onClick:R,loading:j,stopPropagation:!0},r),{},{children:k?Object(_.jsx)(_t,{style:yt}):Object(_.jsx)(It,{})}))}),Object(_.jsx)(Nt,Object(c.a)(Object(c.a)({},i),{},{width:180,onClick:e=>e.stopPropagation(),style:Object(c.a)(Object(c.a)({},null!==(t=i.style)&&void 0!==t?t:{}),At),children:Object(_.jsxs)("div",{children:[Object(_.jsxs)("div",{style:Ct,children:[Object(_.jsx)(h.a,{bold:!0,children:E(p.a.alerts.MUTE_ALERT,"Mute")}),Object(_.jsx)("button",{type:"button","aria-label":l(p.a.actions.CLOSE),onClick:S,style:kt,children:Object(_.jsx)(ht.a,{style:{width:12,height:12}})})]}),[{key:"always",label:E(p.a.alerts.mute.ALWAYS,"Always"),icon:Object(_.jsx)(Rt,{style:Et}),onClick:()=>I(0)},{key:"1day",label:E(p.a.alerts.mute.ONE_DAY,"1 day"),icon:Object(_.jsx)(vt.d,{style:Et}),onClick:()=>I(Math.floor((Date.now()+864e5)/1e3))},{key:"1week",label:E(p.a.alerts.mute.ONE_WEEK,"1 week"),icon:Object(_.jsx)(vt.d,{style:Et}),onClick:()=>I(Math.floor((Date.now()+6048e5)/1e3))},{key:"custom",label:E(p.a.alerts.mute.CUSTOM,"Custom"),icon:Object(_.jsx)(vt.c,{style:Et}),onClick:N}].map((e=>Object(_.jsxs)(Mt,{type:"button",onClick:e.onClick,disabled:j,style:{opacity:j?.6:1,borderTop:"always"===e.key?"1p
1x solid rgba(72, 101, 129, 0.12)":"none",borderBottom:"1px solid rgba(72, 101, 129, 0.12)"},children:[e.icon,Object(_.jsx)("span",{children:e.label})]},e.key)))]})})),Object(_.jsx)(f.c,Object(c.a)(Object(c.a)({},v),{},{heading:l(p.a.alerts.MUTE_UNTIL),"aria-label":l(p.a.alerts.MUTE_UNTIL),style:{width:"min(360px, calc(100vw - 24px))"},children:D}))]})}));Dt.displayName="MuteAlertButton";var Lt=Dt;const Tt=s.a.memo((e=>{var t,n;let{alert:a,disabled:l,canManageAlerts:r,canMuteAlert:i,loading:o,camera:s,fetchImage:d,stopRowClick:b,handleRowClick:u,handleRowKeyDown:j,handleEnabledChange:p,handleDeleteButtonClick:O,setAlertMuteState:m,t:h}=e;const g=De(a),f="".concat(a.object_uid,".").concat(a.object_deviceid),x=((e,t)=>{const n=e.severity;return n===ce.d.Critical||"critical"===n?Object(c.a)(Object(c.a)({},ue.critical),{},{label:Object(re.d)(t,n)}):n===ce.d.Warning||"warning"===n?Object(c.a)(Object(c.a)({},ue.warning),{},{label:Object(re.d)(t,n)}):Object(c.a)(Object(c.a)({},ue.info),{},{label:Object(re.d)(t,n)})})(a,h),v=Le(a),y=null===v||void 0===v?void 0:v.mute_until,w=((e,t)=>{if(!Te(e)||null==e)return null;if(0===e)return Object(re.f)(t,"alerts.MUTED","Muted");const n=e-Math.floor(Date.now()/1e3);if(n<=0)return null;const a=n/3600,l=a/24;if(l>=6.5&&l<=7.5)return Object(re.f)(t,"alerts.mute.BADGE_ONE_WEEK","Muted 1W");if(l>=.75&&l<=1.5)return Object(re.f)(t,"alerts.mute.BADGE_ONE_DAY","Muted 1D");if(l>=1)return Object(re.f)(t,"alerts.mute.BADGE_X_DAYS","Muted ".concat(Math.ceil(l),"D"),{count:Math.ceil(l)});if(a>=1)return Object(re.f)(t,"alerts.mute.BADGE_X_HOURS","Muted ".concat(Math.ceil(a),"H"),{count:Math.ceil(a)});const r=Math.max(1,Math.ceil(n/60));return Object(re.f)(t,"alerts.mute.BADGE_X_MINUTES","Muted ".concat(r,"M"),{count:r})})(y,h),A=((e,t)=>{if(!Te(e)||null==e)return null;if(0===e)return Object(re.f)(t,"alerts.mute.UNTIL_TURNED_OFF","Until turned off");const n=new Date(1e3*e),a=n.toLocaleDateString(void 0,{month:"short",day:"numeric"}),l=n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1});return Object(re.f)(t,"alerts.mute.UNTIL_DATE_TIME","Until ".concat(a," ").concat(l),{date:a,time:l})})(y,h);return Object(_.jsxs)(je,{role:l?void 0:"button",tabIndex:l?-1:0,"aria-disabled":l,"aria-label":l?Object(re.f)(h,"alerts.ALERT_WITH_NAME","".concat(a.name," alert"),{name:a.name}):r?Object(re.f)(h,"alerts.EDIT_ALERT_WITH_NAME","Edit alert ".concat(a.name),{name:a.name}):Object(re.f)(h,"alerts.VIEW_ALERT_WITH_NAME","View alert ".concat(a.name),{name:a.name}),$disabled:l,$dimmed:!g,onClick:()=>u({alert:a,disabled:l}),onKeyDown:e=>j(e,a,l),children:[Object(_.jsxs)(pe,{children:[Object(_.jsxs)(Oe,{children:[Object(_.jsx)(et,{alert:a,camera:s,uidd:f,fetchImage:d}),Object(_.jsxs)(ge,{children:[Object(_.jsxs)(fe,{children:[Object(_.jsx)(xe,{children:Object(_.jsxs)(Ae,{children:[Object(_.jsx)(Ce,{children:a.name}),Object(_.jsxs)(ye,{children:[Object(_.jsx)(Ee,{$background:x.background,$color:x.color,children:x.label}),Object(_.jsx)(Ee,{$background:"rgba(255, 255, 255, 0.1)",$color:Object(ie.v)(100),children:Object(re.e)(h,a.type)})]})]})}),Object(_.jsx)(ve,{children:Object(_.jsx)(Ee,{$background:x.background,$color:x.color,children:x.label})})]}),Object(_.jsx)(Ae,{$muted:!0,children:Object(_.jsx)(ke,{children:Object(Be.j)(s)})}),Object(_.jsxs)(Ae,{$muted:!0,children:[Object(_.jsx)(Me,{children:Object(re.c)(h,null!==(t=null===(n=a.recipients)||void 0===n?void 0:n.length)&&void 0!==t?t:0)}),Object(_.jsx)(we,{children:Object(_.jsx)(Ee,{$background:"rgba(255, 255, 255, 0.1)",$color:Object(ie.v)(100),children:Object(re.e)(h,a.type)})}),w&&Object(_.jsx)(Ee,{$background:"rgba(236, 33, 68, 0.16)",$color:Object(ie.v)(100),children:w}),A&&Object(_.jsx)(ke,{children:A})]})]})]}),Object(_.jsxs)(Se,{onClick:b,onKeyDown:b,onKeyUp:b,children:[r&&Object(_.jsx)(_e,{children:Object(_.jsx)(Ve,{alert:a,enabled:g,loading:o,canManageAlerts:r,stopRowClick:b,handleEnabledChange:p,t:h})}),i&&v&&Object(_.jsx)(Lt,{alert:a,setAlertMuteState:m,t:h}),r&&Object(_.jsx)(Ue.a,{description:Object(re.f)(h,"alerts.DELETE_ALERT","Delete alert"),onClick:e=>O(e,a),stopPropagation:!0,children:Object(_.jsx)(Pe.a,{})})]})]}),(r||i&&v)&&Object(_.jsxs)(Ie,{onClick:b,onKeyDown:b,onKeyUp:b,children:[r?Object(_.jsx)(_e,{children:Object(_.jsx)(Ve,{alert:a,enabled:g,loading:o,canManageAlerts:r,stopRowClick:b,handleEnabledChange:p,t:h})}):Object(_.jsx)("div",{}),Object(_.jsxs)(Re,{children:[i&&v&&Object(_.jsx)(Lt,{alert:a,setAlertMuteState:m,t:h,iconButtonProps:{defaultBackgroun
1dColour:se,backgroundColour:de,style:oe}}),r&&Object(_.jsx)(Ue.a,{description:Object(re.f)(h,"alerts.DELETE_ALERT","Delete alert"),onClick:e=>O(e,a),stopPropagation:!0,defaultBackgroundColour:se,backgroundColour:de,style:be,children:Object(_.jsx)(Pe.a,{})})]})]})]},a.id)}));Tt.displayName="AlertRuleCard";var Ut=Tt;const Pt=s.a.memo((e=>{let{alerts:t,canManageAlerts:n,canManageAlertRule:a,canMuteAlertRule:l,canOpenAlertRule:r,availableUserData:i,cameras:s,onAlertClick:d,onDeleteClick:b,setAlerts:u,t:j}=e;const[p,O]=Object(o.useState)([]),[m,g]=Object(o.useState)(s),[w,A]=Object(o.useState)(null),[C,k,E]=Object(x.a)(),M=Object(o.useCallback)((e=>{e.stopPropagation()}),[]),S=Object(o.useCallback)((()=>{E(),A(null)}),[E]);Object(o.useEffect)((()=>{g((e=>{const t={};return Object.keys(s).forEach((n=>{var a,l;t[n]=Object(c.a)(Object(c.a)({},s[n]),{},{img:(null===e||void 0===e||null===(a=e[n])||void 0===a?void 0:a.img)||(null===(l=s[n])||void 0===l?void 0:l.img)})})),t}))}),[s]);const I=Object(o.useCallback)((e=>{g(e)}),[]),[R]=Object(le.f)(m,I),N=Object(o.useCallback)((e=>a?a(e):n),[a,n]),D=Object(o.useCallback)((e=>!l||l(e)),[l]),L=Object(o.useCallback)((e=>r?r(e):N(e)),[r,N]),T=Object(o.useCallback)(((e,t)=>{u((n=>n?n.map((n=>n.id===e?Object(c.a)(Object(c.a)({},n),{},{enabled:t}):n)):null))}),[u]),U=Object(o.useMemo)((()=>t.map((e=>{const t=N(e);return{key:e.id,alert:e,canManageAlert:t,canMuteAlert:D(e),disabled:!L(e)}}))),[t,N,D,L]),P=Object(o.useCallback)(((e,t)=>{u((n=>n?n.map((n=>n.id===e?Object(c.a)(Object(c.a)({},n),{},{recipients:n.recipients.map((e=>e.subject_uid===Object(v.t)()?Object(c.a)(Object(c.a)({},e),{},{mute_until:t}):e))}):n)):null))}),[u]),B=Object(o.useCallback)((async(e,t)=>{const n=t?1:0,a=De(e)?1:0;O((t=>t.includes(e.id)?t:[...t,e.id])),T(e.id,n);try{await Object(y.g)(e.object_uid,e.object_deviceid,e.id,n)}catch(l){console.error(l),T(e.id,a)}finally{O((t=>t.filter((t=>t!==e.id))))}}),[T]),$=Object(o.useCallback)((e=>{let{alert:t,disabled:n}=e;n||d(t.id)}),[d]),F=Object(o.useCallback)(((e,t,n)=>{n||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),d(t.id))}),[d]),W=Object(o.useCallback)(((e,t)=>{e.stopPropagation(),A(t),k()}),[k]),H=Object(o.useCallback)((async e=>{if(w)try{await b(w.id,w.subject_uid),S()}catch(t){console.error(t)}finally{e()}else e()}),[w,S,b]);return Object(_.jsxs)(_.Fragment,{children:[Object(_.jsx)(ae,{items:U,"data-testid":"alert-rules-list",getItemKey:e=>{let{alert:t}=e;return t.id},desktopItemHeight:112,mobileItemHeight:116,desktopItemGap:14,mobileItemGap:10,renderItem:e=>{let{alert:t,canManageAlert:n,canMuteAlert:a,disabled:l}=e;const r=p.includes(t.id),i="".concat(t.object_uid,".").concat(t.object_deviceid);return Object(_.jsx)(Ut,{alert:t,disabled:l,canManageAlerts:n,canMuteAlert:a,loading:r,camera:m[i],fetchImage:R,stopRowClick:M,handleRowClick:$,handleRowKeyDown:F,handleEnabledChange:B,handleDeleteButtonClick:W,setAlertMuteState:P,t:j})}}),Object(_.jsx)(f.c,Object(c.a)(Object(c.a)({},C),{},{heading:Object(re.f)(j,"alerts.DELETE_ALERT","Delete alert"),"aria-label":Object(re.f)(j,"alerts.DELETE_ALERT","Delete alert"),buttons:[{asyncAction:H,text:Object(re.f)(j,"alerts.DELETE_ALERT","Delete alert")},{variant:"secondary-grey",onClick:S,text:Object(re.f)(j,"forms.CANCEL","Cancel")}],children:Object(_.jsxs)("p",{children:[Object(re.f)(j,"alerts.DELETE_ALERT_CONFIRMATION_PREFIX","Are you sure you want to delete")," ",Object(_.jsx)(h.a,{bold:!0,children:null===w||void 0===w?void 0:w.name}),"?"]})}))]})}));Pt.displayName="AlertRulesTable";var Bt=Pt,$t=n(411),Ft=n(464),Wt=n(843),Ht=n(389),Vt=n(17),Gt=n(847);const zt=["sites","owner","tags"];var Kt=e=>{let{accountSelector:t,filtersProps:n,filtersValues:a,variant:l="mobile",t:r}=e;const{accentColour:i,accentColour2:s,whiteOverAccent:d,isVideoloft:b}=Object(Vt.a)(),u=Object(o.useMemo)((()=>{const e=Object.keys(n.filters).filter((e=>"select"===n.filters[e].type||"multiselect"===n.filters[e].type));return[...zt.filter((t=>e.includes(t))),...e.filter((e=>!zt.includes(e)))]}),[n.filters]);if(0===u.length&&!t)return null;const j=u.every((e=>{return t=a[e],!(Array.isArray(t)?t.length>0:Boolean(t));var t})),O="desktop"===l?Ft.ub:Ft.lb,h="mobile"===l?{minWidth:"max-content",flexWrap:"nowrap"}:void 0,g="mobile"===l&&u.length>0;return Object(_.jsxs)(O,{children:[g&&Object(_.jsx)(m.a,{variant:"hover",$noArrow:!0,onClick:n.onClearAll,style:{background:j?null!==s&&void 0!==s?s:i:void 0,transition:"none",minWidth:"max-content",color:j?d||b?"inherit":"#000":void 0},children:r(p.a.cameras.ALL_CAMERAS)}),t,u.length>0&&Object(_.jsx)(Ht.a,Object(c.a)(Object(c.a)({},n),{},{filters:Object.fromEntries(u.map((e=>[e,n.filters[e]]))),onClearAll:"desktop"===l?n.onClearAll:void 0,desktopBottomPanelBreakpoint:Gt.a,mobileBreakpoint:void 0,style:h}))]})},Yt=n(848),qt=n(215),Zt=n(20),Xt=n(230),Jt=n(30),Qt=n(844),en=n(673),tn=n(563),nn=n(845);var an=e=>{var t,n;let{bootstrapData:a,organisations:l,ownerOptions:r=l,t:i,temporarySelectedCameraIds:s,userSelectorProps:d,setMobileHeaderAction:u}=e;const j=Object(v.t)(),O=Boolean(null===s||void 0===s?void 0:s.length),m=null!==(t=null===d||void 0===d?void 0:d.selectedUserId)&&void 0!==t?t:Object(v.t)(),h="alerts-rules-mobile",g=Object(o.useMemo)((()=>r.map((e=>{let{id:t}=e;return t}))),[r]),[f,w]=Object(o.useState)(null),A=Object(o.useMemo)((()=>f?b.a.uniq(f.filter((e=>Object(en.c)(e,l))).map(tn.a)):null),[f,l]),{cameras:C,camerasWithSites:k,cameraNavigatorProps:E,cameraNavigatorReady:M,selectedCameras:S,sites:_,statuses:I,userCameras:R}=Object(Qt.a)(l,m,{initialCameras:null===a||void 0===a?void 0:a.cameras,maintainSelectedCamerasInQueryString:!1,navigatorCameraIds:A,temporarySelectedCameraIds:s}),[N,D]=Object(o.useState)(null),[L,T]=Object(o.useState)(null),[U,P]=Object(x.a)(),B=Object(o.useCallback)((e=>Object(en.a)(e,l)),[l]),$=Object(o.useCallback)((e=>!Object(en.d)(e.object_uid,l)),[l]),F=Object(o.useCallback)((e=>Object(qt.j)(j)||B(e)),[B,j]),{availableAlertUsers:W,availableAlertUsersByOwnerId:H,selectedUserAlerts:V,selectedUserAlertsError:G}=Object(nn.a)({camerasReady:Boolean(C),organisations:l,ownerIds:g,userCameras:R}),z=Object(o.useMemo)((()=>
1{if(!k)return{};const e=new Set(R),t=new Set(g);return Object.fromEntries(Object.entries(k).filter((n=>{let[a,l]=n;return e.has(a)&&t.has(l.owner)})))}),[k,g,R]),K=Object(o.useMemo)((()=>{const e={};return Object.entries(z).forEach((t=>{var n;let[a,r]=t;Object(en.d)(r.owner,l)||Object(Xt.a)(r.analyticsEnabled,r.analyticsScheme)&&(e[r.owner]=Object(c.a)(Object(c.a)({},null!==(n=e[r.owner])&&void 0!==n?n:{}),{},{[a]:r}))})),e}),[l,z]),Y=Object(o.useMemo)((()=>r.filter((e=>{var t;let{id:n}=e;return Object.keys(null!==(t=K[n])&&void 0!==t?t:{}).length>0}))),[K,r]),q=Object(o.useMemo)((()=>Object.keys(z).length>0),[z]),Z=Object(o.useMemo)((()=>Object.values(z).some((e=>Object(Xt.a)(e.analyticsEnabled,e.analyticsScheme)))),[z]),X=Object(o.useMemo)((()=>Object.values(z).some((e=>Object(en.d)(e.owner,l)&&Object(Xt.a)(e.analyticsEnabled,e.analyticsScheme)))),[l,z]),J=Object(o.useMemo)((()=>Y.length>0),[Y]);Object(o.useEffect)((()=>{w(V)}),[V]);const Q=Object(o.useCallback)((async e=>{const t=null===f||void 0===f?void 0:f.find((t=>t.id===e));t&&B(t)&&(await Object(y.b)(t.object_uid,t.object_deviceid,e),w((t=>t?t.filter((t=>t.id!==e)):null)))}),[f,B]),ee=Object(o.useCallback)((e=>{const t=null===f||void 0===f?void 0:f.find((t=>t.id===e));t&&F(t)&&(D(e),P())}),[f,F,P]),te=Object(o.useCallback)((e=>{(null==e||K[e]&&!Object(en.d)(e,l))&&(T(e),D(null))}),[K,l]),ne=Object(o.useCallback)((()=>{J&&(T(null),D(null),P())}),[J,P]),ae=Object(o.useCallback)((()=>{D(null),T(null),U.closeModal()}),[U]),re=E.selectCameras;Object(o.useEffect)((()=>(u(J?()=>ne:null),()=>{u(null)})),[J,ne,u]);const ie=Object(o.useCallback)((e=>{const t=Object(tn.a)(e);S.includes(t)||re([t]),D(null),T(null),w((t=>(null===t||void 0===t?void 0:t.find((t=>t.id===e.id)))?t.map((t=>t.id===e.id?e:t)):[...null!==t&&void 0!==t?t:[],e]))}),[re,S]),ce=Object(o.useMemo)((()=>k?N?k:Object.values(K).reduce(((e,t)=>Object(c.a)(Object(c.a)({},e),t)),{}):{}),[N,k,K]),oe=Object(o.useMemo)((()=>null===f||void 0===f?void 0:f.find((e=>e.id===N))),[N,f]),se=null!==(n=null===oe||void 0===oe?void 0:oe.object_uid)&&void 0!==n?n:L,de=Object(o.useMemo)((()=>{var e;return se?null!==(e=H[se])&&void 0!==e?e:[]:W}),[W,se,H]),be=Object(o.useMemo)((()=>null==N&&null==se||null!=se&&Object(en.b)(se,l)),[se,N,l]),ue=Object(o.useMemo)((()=>Object.values(null!==k&&void 0!==k?k:{}).filter((e=>null===A||void 0===A?void 0:A.includes(e.uidd)))),[k,A]),je=Object(o.useMemo)((()=>{if(!S)return ue;const e=new Set(S);return ue.filter((t=>e.has(t.uidd)))}),[ue,S]),pe=Object(o.useMemo)((()=>new Set(ue.map((e=>e.cloudAdapterId)).filter(Boolean))),[ue]),Oe=Object(o.useMemo)((()=>b.a.uniq(ue.map((e=>{var t;return null===(t=e.owner)||void 0===t?void 0:t.toString()})).filter(Boolean))),[ue]),me=Object(o.useMemo)((()=>b.a.chain(ue).map((e=>{var t;return null!==(t=e.tags)&&void 0!==t?t:[]})).flatten().compact().uniq().sort(Jt.a).value()),[ue]),he=Object(o.useMemo)((()=>{var e;return null!==(e=b.a.chain(ue).map((e=>({cloudAdapterId:e.cloudAdapterId,siteName:e.siteName}))).filter((e=>{let{cloudAdapterId:t}=e;return"string"===typeof t&&t.length>0})).uniqBy((e=>{let{cloudAdapterId:t}=e;return t})).groupBy((e=>{let{siteName:t,cloudAdapterId:n}=e;return(null===t||void 0===t?void 0:t.trim())||n})).map(((e,t)=>({siteName:t,cloudIds:e.map((e=>{let{cloudAdapterId:t}=e;return t})).filter(Boolean)}))).sort(((e,t)=>
1Object(Jt.a)(e.siteName,t.siteName))).value())&&void 0!==e?e:[]}),[ue]),ge=Object(o.useMemo)((()=>{const e=new Set(he.flatMap((e=>{let{cloudIds:t=[]}=e;return t})));return b.a.chain(he).flatMap((e=>{let{siteName:t,cloudIds:n=[]}=e;return(null===t||void 0===t?void 0:t.trim())?[{key:n.join(","),label:t,cloudIds:n}]:n.map((e=>({key:e,label:e,cloudIds:[e]})))})).concat(Array.from(pe).filter((e=>Boolean(e))).filter((t=>!e.has(t))).map((e=>({key:e,label:e,cloudIds:[e]})))).uniqBy("key").sort(((e,t)=>Object(Jt.a)(e.label,t.label))).value()}),[pe,he]),fe=Object(o.useMemo)((()=>({sites:{title:i(p.a.sites.SITES),type:"multiselect",initialValue:()=>{if(O)return[];const e=Object(Zt.m)(j,h,"sites");return Array.isArray(e)?e.map((e=>e.toString())):"string"===typeof e?[e]:[]},hidden:0===ge.length,options:ge.map((e=>{let{key:t,label:n}=e;return{key:t,label:n}})),onChange:e=>{const t=Array.isArray(e)?e.map((e=>e.toString())):[];O||Object(Zt.F)(j,h,"sites",t)},onClear:()=>{O||Object(Zt.F)(j,h,"sites",[])},doesItemMatch:(e,t)=>e.some((e=>{var n;return e.split(",").filter(Boolean).includes(null!==(n=t.cloudAdapterId)&&void 0!==n?n:"")})),hideOptionsWithZeroCount:!0},owner:{title:i(p.a.cameras.OWNER),type:"multiselect",initialValue:()=>{if(O)return[];const e=Object(Zt.m)(j,h,"owner");return Array.isArray(e)?e:"string"===typeof e?[e]:[]},hidden:Oe.length<=1,options:l.filter((e=>{let{id:t}=e;return Oe.includes(t.toString())})).map((e=>{let{id:t,name:n}=e;return{key:t.toString(),label:null!==n&&void 0!==n?n:t.toString()}})).sort(((e,t)=>{let{label:n}=e,{label:a}=t;return Object(Jt.a)(n,a)})),onChange:e=>{const t=Array.isArray(e)?e:[];O||Object(Zt.F)(j,h,"owner",t)},onClear:()=>{O||Object(Zt.F)(j,h,"owner",[])},doesItemMatch:(e,t)=>{var n;return e.includes(null===(n=t.owner)||void 0===n?void 0:n.toString())},hideOptionsWithZeroCount:!0},tags:{title:i(p.a.cameras.tags.TAGS),type:"multiselect",initialValue:()=>{if(O)return[];const e=Object(Zt.m)(j,h,"tags");return Array.isArray(e)?e.map((e=>e.toString())):"string"===typeof e?[e]:[]},hidden:0===me.length,options:me.map((e=>({key:e,label:e}))),onChange:e=>{const t=Array.isArray(e)?e.map((e=>e.toString())):[];O||Object(Zt.F)(j,h,"tags",t)},onClear:()=>{O||Object(Zt.F)(j,h,"tags",[])},doesItemMatch:(e,t)=>{var n;return null===(n=t.tags)||void 0===n?void 0:n.some((t=>e.includes(t)))},hideOptionsWithZeroCount:!0}})),[Oe,me,j,h,ge,l,i,O]),[xe,ve,ye]=Object(le.g)(fe,{onClearAll:()=>{O||Object(Zt.i)(j,h)}},je),we=ve,Ae=E.mobileWebView&&Object.keys(we.filters).length>0,Ce=Object(o.useMemo)((()=>{if(!f)return null;const e=new Set(null!==S&&void 0!==S?S:[]),t=new Set((null!==ye&&void 0!==ye?ye:[]).map((e=>e.uidd)));return f.filter((n=>{const a="".concat(n.object_uid,".").concat(n.object_deviceid);return e.has(a)&&t.has(a)&&Object(en.c)(n,l)}))}),[f,ye,l,S]);return{additionalUserData:W,alertRulesLoadError:G,alertIdSelectedForEdit:N,alerts:f,alertsFormModalProps:U,cameraNavigatorProps:E,cameraNavigatorReady:M,cameras:C,camerasWithSites:k,canManageAlertFormRecipients:be,canManageAlertRuleForCurrentUser:B,canMuteAlertRuleForCurrentUser:$,canOpenAlertRuleForCurrentUser:F,canCreateSelectedUserAlerts:J,filteredAlerts:Ce,handleAlertClick:ee,handleAlertSaved:ie,handleDeleteAlert:Q,handleAlertFormClose:ae,handleNewAlertClick:ne,handleNewAlertOwnerSelect:te,hasOwnedAlertCameras:q,hasReadOnlyDemoAlertCameras:X,hasSmartMotionEnabledCameras:Z,mobileSelectionFilterValues:xe,mobileSelectionFiltersProps:we,modalAvailableUserData:de,modalCameras:ce,navigatorCameraIds:A,newAlertOwnerId:L,newAlertOwnerOptions:Y,selectedCameras:S,setAlerts:w,showMobileSelectionFilters:Ae,sites:_,statuses:I,userCameras:R}};const ln={display:"flex",alignItems:"center",gap:10},rn={width:12,height:12},cn={width:"100%",paddingTop:4},on={display:"flex",alignItems:"center",flexWrap:"wrap",gap:12},sn=Object(o.lazy)((()=>n.e(50).then(n.bind(null,1214)))),dn=e=>{let{onClick:t,t:n}=e;return Object(_.jsxs)(m.a,{style:ln,onClick:t,children:[Object(_.jsx)(g.a,{style:rn}),Object(_.jsx)(h.a,{children:n(p.a.alerts.NEW_ALERT)})]})};t.default=e=>{let{bootstrapData:t,organisations:n,cameraGroups:a,installAllowed:l,ownerOptions:r,t:i,temporarySelectedCameraIds:s,setMobileHeaderAction:d}=e;const{additionalUserData:m,alertRulesLoadError:g,alertIdSelectedForEdit:f,alerts:x,alertsFormModalProps:v,cameraNavigatorProps:y,cameraNavigatorReady:w,cameras:A,camerasWithSites:C,canManageAlertFormRecipients:k,canManageAlertRuleForCurrentUser:E,canMuteAlertRuleForCurrentUser:M,canOpenAlertRuleForCurrentUser:S,canCreateSelectedUserAlerts:I,filteredAlerts:R,handleAlertClick:N,handleAlertSaved:D,handleAlertFormClose:L,handleDeleteAlert:T,handleNewAlertClick:U,handleNewAlertOwnerSelect:P,hasOwnedAlertCameras:B,hasReadOnlyDemoAlertCameras:$,hasSmartMotionEnabledCameras:F,mobileSelectionFilterValues:W,mobileSelectionFiltersProps:H,modalAvailableUserData:V,modalCameras:G,navigatorCameraIds:z,newAlertOwnerOptions:K,selectedCameras:Y,setAlerts:q,showMobileSelectionFilters:Z,sites:X,statuses:J,userCameras:Q}=an({bootstrapData:t,organisations:n,ownerOptions:r,t:i,temporarySelectedCameraIds:s,setMobileHeaderAction:d});if(!A||!X||!J||!x||!w||!R)return Object(_.jsx)(j.a,{});if(b.a.isEmpty(A))return Object(_.jsx)(u.a,{installAllowed:l,organisations:n});
1const ee=x.find((e=>e.id===f)),te=null==f?"new-alert":"edit-".concat(f),ne=null==f?Boolean(I):Boolean(ee&&E(ee)),ae=n.some((e=>{let{cameras:t}=e;return t})),le=(null!==z&&void 0!==z?z:[]).length>0,ie=le&&0===Y.length,ce=Q.length>0&&B&&!F,oe=y.mobileWebView&&Z,se=Object(_.jsxs)($t.a,Object(c.a)(Object(c.a)({},y),{},{hideNavigatorOnMobileWebView:!0,toolbar:!y.mobileWebView,children:[!y.mobileWebView&&Object(_.jsx)($t.a.Toolbar,{children:Object(_.jsx)(O.c,{column:!0,gap:20,style:cn,children:Object(_.jsxs)(Ft.i,{children:[Object(_.jsxs)(Ft.h,{children:[Object(_.jsx)(Kt,{filtersProps:H,filtersValues:W,t:i,variant:"desktop"}),Object(_.jsx)(h.a,{light:!0,children:Object(re.f)(i,1===R.length?"alerts.RULES_CONFIGURED":"alerts.RULES_CONFIGURED_plural",1===R.length?"1 rule configured":"".concat(R.length," rules configured"),{count:R.length})})]}),I&&Object(_.jsxs)("div",{style:on,children:[Object(_.jsx)(Yt.a,{t:i,tone:"dark"}),Object(_.jsx)(dn,{onClick:U,t:i})]})]})})}),Object(_.jsx)($t.a.Content,{children:Object(_.jsxs)(Ft.mb,{children:[R.length>
10?Object(_.jsx)(Bt,{availableUserData:m,alerts:R,canManageAlerts:!1,canManageAlertRule:E,canMuteAlertRule:M,canOpenAlertRule:S,cameras:C,onAlertClick:N,onDeleteClick:T,setAlerts:q,t:i}):g?Object(_.jsx)(Ft.j,{children:i(p.a.errors.ERROR_GENERIC)}):ie?Object(_.jsx)(Ft.j,{children:Object(_.jsx)(h.a,{light:!0,children:Object(re.f)(i,"alerts.NO_CAMERAS_SELECTED","There are no cameras selected")})}):ce?Object(_.jsx)(Ft.j,{children:Object(_.jsx)(h.a,{light:!0,children:Object(re.f)(i,"alerts.NO_SMART_MOTION_CAMERAS","There are no cameras with Smart Motion enabled.")})}):$&&!I?Object(_.jsx)(Ft.j,{children:Object(_.jsx)(h.a,{light:!0,children:Object(re.f)(i,"alerts.DEMO_ACCOUNT_READ_ONLY","Alert rules for demo accounts are read-only.")})}):Q.length>0&&!le?Object(_.jsx)(Ft.j,{children:Object(_.jsx)(h.a,{light:!0,children:Object(re.f)(i,"alerts.NO_ALERT_RULES_SET_UP","No alerts yet. Create an alert rule to start receiving notifications")})}):Q.length>0?Object(_.jsx)(Ft.j,{children:Object(re.f)(i,"alerts.NO_ALERTS","There are no alert rules matching the specified filters")}):ae?Object(_.jsx)(Ft.j,{children:Object(re.f)(i,"alerts.NO_ALERT_CAMERA_ACCESS","You don't have permission to view or manage alerts for this user's cameras.")}):Object(_.jsx)(Wt.a,{}),v.show&&Object(_.jsx)(o.Suspense,{fallback:Object(_.jsx)(j.a,{}),children:Object(_.jsx)(sn,{canManageAlerts:ne,canManageRecipients:k,cameras:G,cameraGroups:a,ownerOptions:K,usersWithAccess:V,initialAlert:ee,onSelectedCameraOwnerChange:P,modalProps:Object(c.a)(Object(c.a)({},v),{},{closeModal:L,closeOnBackdropClick:!y.mobileWebView}),onAlertSaved:D},te)})]})})]}));return oe?Object(_.jsxs)(Ft.ob,{children:[Object(_.jsx)(Kt,{filtersProps:H,filtersValues:W,t:i}),se]}):se}},847:function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return l}));const a=640,l="https://assetcdn.manything.com/portal-materials/app.videoloft.com/Videoloft_SmartMotionAlerts_Setup_Guide.pdf"},848:function(e,t,n){"use strict";var a,l=n(6),r=n(7),i=n(35),c=n(87),o=n(4),s=n(5),d=n(172),b=n(277),u=n(847),j=n(418),p=n(2);const O=Object(r.c)(i.a)(a||(a=Object(l.a)(["\n    display: inline-flex;\n    align-items: center;\n    gap: 8px;\n    min-height: 40px;\n    min-width: auto;\n    padding: 8px 18px;\n    border: 1px solid\n        ",";\n    border-radius: 35px;\n    background: transparent;\n    font-size: 16px;\n    font-weight: 100;\n    line-height: 1;\n    white-space: nowrap;\n\n    && {\n        color: ",";\n    }\n\n    &:hover {\n        border-color: ",";\n        background: ",";\n    }\n\n    &:focus-visible {\n        outline: 2px solid\n            ",";\n        outline-offset: 2px;\n    }\n\n    svg {\n        width: 14px;\n        height: 14px;\n        flex: 0 0 14px;\n    }\n"])),(e=>{let{$tone:t}=e;return"dark"===t?Object(s.v)(62):Object(s.s)(18)}),(e=>{let{$tone:t}=e;return"dark"===t?Object(s.v)():Object(s.s)()}),(e=>{let{$tone:t}=e;return"dark"===t?Object(s.v)(86):Object(s.s)(32)}),(e=>{let{$tone:t}=e;return"dark"===t?Object(s.v)(8):Object(s.s)(4)}),(e=>{let{$tone:t}=e;return"dark"===t?Object(s.v)(85):Object(s.s)(42)}));t.a=e=>{let{className:t,t:n,tone:a="light"}=e;const l=Object(c.b)(),r=Object(j.f)(n,o.a.alerts.SETUP_GUIDE,"Setup guide");return Object(d.b)(l)?Object(p.jsxs)(O,{$tone:a,"aria-label":r,className:t,link:u.b,rel:"noopener noreferrer",target:"_blank",variant:"secondary-white",children:[Object(p.jsx)(b.a,{"aria-hidden":"true",focusable:"false"}),r]}):null}}}]);
2//# sourceMappingURL=52.c5056dd0.chunk.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.