UNPKG

homebridge-camera-ui

Version:
1 lines 101 kB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["settings"],{"05ec":function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"w-100 h-100"},[e.loading?a("div",{staticClass:"d-flex flex-wrap justify-content-center align-content-center position-absolute-fullsize"},[a("b-spinner",{staticClass:"text-color-primary"})],1):e._e(),e.loading?a("transition-group",{attrs:{name:"fade",mode:"out-in"}}):a("transition-group",{attrs:{name:"fade",mode:"out-in"}},[a("div",{key:"loaded",staticClass:"d-flex flex-wrap justify-content-between"},[e.checkLevel("settings:general:edit")?a("div",{staticClass:"col-12 z-index-1 mb-5",attrs:{"data-aos":"fade-up","data-aos-duration":"1000"}},[a("h5",[e._v(e._s(e.$t("general")))]),a("div",{staticClass:"mt-4"},[a("div",{staticClass:"settings-box container"},[a("div",{staticClass:"row"},[a("div",{staticClass:"col-8 d-flex flex-wrap align-content-center"},[e._v(e._s(e.$t("at_home")))]),a("div",{staticClass:"col-4 d-flex flex-wrap align-content-center justify-content-end"},[a("toggle-button",{attrs:{color:"var(--primary-color) !important",height:30,sync:!0},model:{value:e.general.atHome,callback:function(t){e.$set(e.general,"atHome",t)},expression:"general.atHome"}})],1)]),a("hr"),a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 d-flex flex-wrap align-content-center"},[e._v(e._s(e.$t("exclude")))]),a("div",{staticClass:"col-12 d-flex flex-wrap align-content-center justify-content-end mt-3"},[a("multiselect",{attrs:{options:e.cameras.map((function(e){return e.name})),searchable:!1,"close-on-select":!1,"show-labels":!1,placeholder:e.$t("select"),multiple:!0,limit:2},model:{value:e.general.exclude,callback:function(t){e.$set(e.general,"exclude",t)},expression:"general.exclude"}},[a("template",{slot:"noOptions"},[a("strong",[e._v(e._s(e.$t("empty")))])])],2)],1)])])])]):e._e(),!e.uiConfig||e.uiConfig&&"auto"===e.uiConfig.theme?a("div",{staticClass:"col-12 mb-5",attrs:{"data-aos":"fade-up","data-aos-duration":"1000"}},[a("h5",[e._v(e._s(e.$t("themes")))]),a("div",{staticClass:"mt-4"},[a("div",{staticClass:"settings-box container"},[e.supportMatchMedia?a("div",{staticClass:"row"},[a("div",{staticClass:"col-8 d-flex flex-wrap align-content-center"},[e._v(e._s(e.$t("auto_darkmode")))]),a("div",{staticClass:"col-4 d-flex flex-wrap align-content-center justify-content-end"},[a("toggle-button",{staticClass:"auto-darkmode-toggle",attrs:{color:"var(--primary-color) !important",height:30,sync:!0},on:{input:e.switchAutoDarkmode},model:{value:e.autoDarkmode,callback:function(t){e.autoDarkmode=t},expression:"autoDarkmode"}})],1)]):e._e(),e.supportMatchMedia?a("hr"):e._e(),e.supportMatchMedia&&!e.autoDarkmode?a("div",{staticClass:"row"},[a("div",{staticClass:"col-8 d-flex flex-wrap align-content-center"},[e._v(e._s(e.$t("darkmode")))]),a("div",{staticClass:"col-4 d-flex flex-wrap align-content-center justify-content-end"},[a("toggle-button",{staticClass:"darkmode-toggle",attrs:{color:"var(--primary-color) !important",height:30,sync:!0},on:{input:e.switchDarkmode},model:{value:e.darkmode,callback:function(t){e.darkmode=t},expression:"darkmode"}})],1)]):e._e(),e.supportMatchMedia&&!e.autoDarkmode?a("hr"):e._e(),a("div",{staticClass:"row"},[a("div",{staticClass:"col-4 d-flex flex-wrap align-content-center"},[e._v(e._s(e.$t("themes")))]),a("div",{staticClass:"col-8 text-right"},[a("input",{staticClass:"theme-switches switch-pink",attrs:{id:"switch-pink",type:"radio",name:"theme-group"},on:{input:function(t){return e.switchTheme("pink")}}}),a("label",{staticClass:"m-0",attrs:{for:"switch-pink"}}),a("input",{staticClass:"theme-switches switch-purple",attrs:{id:"switch-purple",type:"radio",name:"theme-group"},on:{input:function(t){return e.switchTheme("purple")}}}),a("label",{staticClass:"m-0",attrs:{for:"switch-purple"}}),a("input",{staticClass:"theme-switches switch-blue",attrs:{id:"switch-blue",type:"radio",name:"theme-group"},on:{input:function(t){return e.switchTheme("blue")}}}),a("label",{staticClass:"m-0",attrs:{for:"switch-blue"}}),a("input",{staticClass:"theme-switches switch-blgray",attrs:{id:"switch-blgray",type:"radio",name:"theme-group"},on:{input:function(t){return e.switchTheme("blgray")}}}),a("label",{staticClass:"m-0",attrs:{for:"switch-blgray"}}),a("input",{staticClass:"theme-switches switch-brown",attrs:{id:"switch-brown",type:"radio",name:"theme-group"},on:{input:function(t){return e.switchTheme("brown")}}}),a("label",{staticClass:"m-0",attrs:{for:"switch-brown"}}),a("input",{staticClass:"theme-switches switch-orange",attrs:{id:"switch-orange",type:"radio",name:"theme-group"},on:{input:function(t){return e.switchTheme("orange")}}}),a("label",{staticClass:"m-0",attrs:{for:"switch-orange"}}),a("input",{staticClass:"theme-switches switch-green",attrs:{id:"switch-green",type:"radio",name:"theme-group"},on:{input:function(t){return e.switchTheme("green")}}}),a("label",{staticClass:"m-0",attrs:{for:"switch-green"}}),a("input",{staticClass:"theme-switches switch-gray",attrs:{id:"switch-gray",type:"radio",name:"theme-group"},on:{input:function(t){return e.switchTheme("gray")}}}),a("label",{staticClass:"m-0",attrs:{for:"switch-gray"}})])])])])]):e._e(),e.checkLevel("settings:general:edit")?a("div",{staticClass:"col-12",attrs:{"data-aos":"fade-up","data-aos-duration":"1000"}},[a("h5",[e._v(e._s(e.$t("rooms")))]),a("div",{staticClass:"mt-4"},[a("div",{staticClass:"settings-box container"},[a("div",{staticClass:"row"},[a("div",{staticClass:"col-10 d-flex flex-wrap align-content-center"},[a("b-form-input",{attrs:{type:"text",placeholder:e.$t("room_name"),state:e.roomState,lazy:""},model:{value:e.form.newRoom,callback:function(t){e.$set(e.form,"newRoom",t)},expression:"form.newRoom"}})],1),a("div",{staticClass:"col d-flex flex-wrap align-content-center justify-content-end align-content-center pl-0"},[a("b-link",{staticClass:"text-success"},[a("b-icon",{attrs:{icon:"plus-circle-fill"},on:{click:function(t){return e.addRoom()}}})],1)],1)]),a("hr"),e._l(e.general.rooms,(function(t,n){return a("div",{key:t,attrs:{"data-aos":"fade-up","data-aos-duration":"1000"}},[a("div",{staticClass:"row"},[a("div",{staticClass:"col-10"},[a("span",{staticClass:"fs-6"},[e._v(e._s("Standard"===t?e.$t("standard"):t))])]),a("div",{staticClass:"col d-flex flex-wrap align-content-center justify-content-end align-content-center pl-0"},[a("b-link",{staticClass:"text-color-danger"},["Standard"!==t?a("b-icon",{attrs:{icon:"x-circle-fill"},on:{click:function(a){return e.removeRoom(t,n)}}}):e._e()],1)],1)]),a("hr")])}))],2)])]):e._e()])])],1)},s=[],r=a("b85c"),i=a("1da1"),o=(a("96cf"),a("d3b7"),a("caad"),a("2532"),a("ac1f"),a("1276"),a("99af"),a("0759")),c=a("7386"),l=a("8e5f"),u=a.n(l),d=(a("e607"),a("f206")),f=a("20b6"),m=function(e){return new Promise((function(t){return setTimeout(t,e)}))},h={name:"SettingsGeneral",components:{BIcon:o["a"],BIconPlusCircleFill:c["q"],BIconXCircleFill:c["s"],Multiselect:u.a,ToggleButton:d["ToggleButton"]},data:function(){return{autoDarkmode:!1,cameras:[],darkmode:!1,form:{newRoom:""},general:{exclude:[],rooms:[]},generalTimer:null,loading:!0,supportMatchMedia:!1}},computed:{roomState:function(){var e=this.form.newRoom.length>0?!this.general.rooms.includes(this.form.newRoom):null;return e},uiConfig:function(){return this.$store.state.config.ui}},watch:{general:{handler:function(e){var t=this;return Object(i["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:t.loading||(t.generalTimer&&(clearTimeout(t.generalTimer),t.generalTimer=null),t.generalTimer=setTimeout(Object(i["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,Object(f["a"])("general",e);case 3:a.next=8;break;case 5:a.prev=5,a.t0=a["catch"](0),t.$toast.error(a.t0.message);case 8:case"end":return a.stop()}}),a,null,[[0,5]])}))),1500));case 1:case"end":return a.stop()}}),a)})))()},deep:!0}},mounted:function(){var e=this;return Object(i["a"])(regeneratorRuntime.mark((function t(){var a,n,s,r,i,o,c,l,u,d,h;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(t.prev=0,!e.checkLevel("settings:general:access")){t.next=6;break}return t.next=4,Object(f["b"])("general");case 4:a=t.sent,e.general=a.data;case 6:if(!e.checkLevel("settings:cameras:access")){t.next=11;break}return t.next=9,Object(f["b"])("cameras");case 9:n=t.sent,e.cameras=n.data;case 11:return e.supportMatchMedia=window.matchMedia,e.loading=!1,t.next=15,m(300);case 15:s=document.querySelector(".switch-pink"),r=document.querySelector(".switch-purple"),i=document.querySelector(".switch-blue"),o=document.querySelector(".switch-blgray"),c=document.querySelector(".switch-brown"),l=document.querySelector(".switch-orange"),u=document.querySelector(".switch-green"),d=document.querySelector(".switch-gray"),h=localStorage.getItem("theme-color")?localStorage.getItem("theme-color"):s?s.click():"pink",e.autoDarkmode="auto"===localStorage.getItem("darkmode"),e.darkmode="dark"===localStorage.getItem("theme"),"pink"===h&&s?s.checked=!0:"purple"===h&&r?r.checked=!0:"blue"===h&&i?i.checked=!0:"blgray"===h&&o?o.checked=!0:"brown"===h&&c?c.checked=!0:"orange"===h&&l?l.checked=!0:"green"===h&&u?u.checked=!0:"gray"===h&&d&&(d.checked=!0),t.next=32;break;case 29:t.prev=29,t.t0=t["catch"](0),e.$toast.error(t.t0.message);case 32:case"end":return t.stop()}}),t,null,[[0,29]])})))()},methods:{addRoom:function(){this.roomState?(this.general.rooms.push(this.form.newRoom),this.$toast.success(this.$t("successfully_created"))):null===this.roomState?this.$toast.error(this.$t("no_roomname_defined")):this.$toast.error(this.$t("room_already_exists"))},matchMediaListener:function(e){var t="auto"===localStorage.getItem("darkmode");t&&(e.matches?(localStorage.setItem("theme","dark"),document.documentElement.setAttribute("data-theme","dark")):(localStorage.setItem("theme","light"),document.documentElement.setAttribute("data-theme","light")))},removeRoom:function(e,t){this.$toast.success(this.$t("successfully_removed")),this.$delete(this.general.rooms,t)},switchAutoDarkmode:function(e){if(localStorage.setItem("darkmode",e?"auto":"manual"),e)window.matchMedia("(prefers-color-scheme: dark)").matches?(localStorage.setItem("theme","dark"),document.documentElement.setAttribute("data-theme","dark")):(localStorage.setItem("theme","light"),document.documentElement.setAttribute("data-theme","light")),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",this.matchMediaListener);else{var t=localStorage.getItem("theme")||"light";document.documentElement.setAttribute("data-theme",t),this.darkmode="dark"===t,window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",this.matchMediaListener)}},switchDarkmode:function(e){document.documentElement.dataset.theme=e?"dark":"light",localStorage.setItem("theme",e?"dark":"light")},switchTheme:function(e){document.documentElement.dataset.themeColor=e,localStorage.setItem("theme-color",e);var t,n=document.querySelectorAll(".theme-img"),s=Object(r["a"])(n);try{for(s.s();!(t=s.n()).done;){var i=t.value,o=i.src;o=o.split("/"),o=o[o.length-1].split(".png")[0].split(".")[0].split("@")[0],i.src=a("b967")("./".concat(o,"@").concat(e,".png"))}}catch(c){s.e(c)}finally{s.f()}}}},p=h,v=(a("c8b9"),a("2877")),g=Object(v["a"])(p,n,s,!1,null,"73af89ea",null);t["default"]=g.exports},"0d3b":function(e,t,a){var n=a("d039"),s=a("b622"),r=a("c430"),i=s("iterator");e.exports=!n((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,a="";return e.pathname="c%20d",t.forEach((function(e,n){t["delete"]("b"),a+=n+e})),r&&!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[i]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==a||"x"!==new URL("http://x",void 0).host}))},"25eb":function(e,t,a){var n=a("23e7"),s=a("c20d");n({target:"Number",stat:!0,forced:Number.parseInt!=s},{parseInt:s})},"2b3d":function(e,t,a){"use strict";a("3ca3");var n,s=a("23e7"),r=a("83ab"),i=a("0d3b"),o=a("da84"),c=a("37e8"),l=a("6eeb"),u=a("19aa"),d=a("5135"),f=a("60da"),m=a("4df4"),h=a("6547").codeAt,p=a("5fb2"),v=a("d44e"),g=a("9861"),b=a("69f3"),w=o.URL,x=g.URLSearchParams,y=g.getState,k=b.set,_=b.getterFor("URL"),C=Math.floor,$=Math.pow,S="Invalid authority",j="Invalid scheme",R="Invalid host",L="Invalid port",O=/[A-Za-z]/,T=/[\d+-.A-Za-z]/,U=/\d/,B=/^(0x|0X)/,E=/^[0-7]+$/,I=/^\d+$/,A=/^[\dA-Fa-f]+$/,q=/[\0\t\n\r #%/:?@[\\]]/,N=/[\0\t\n\r #/:?@[\\]]/,P=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,M=/[\t\n\r]/g,z=function(e,t){var a,n,s;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return R;if(a=X(t.slice(1,-1)),!a)return R;e.host=a}else if(V(e)){if(t=p(t),q.test(t))return R;if(a=D(t),null===a)return R;e.host=a}else{if(N.test(t))return R;for(a="",n=m(t),s=0;s<n.length;s++)a+=G(n[s],H);e.host=a}},D=function(e){var t,a,n,s,r,i,o,c=e.split(".");if(c.length&&""==c[c.length-1]&&c.pop(),t=c.length,t>4)return e;for(a=[],n=0;n<t;n++){if(s=c[n],""==s)return e;if(r=10,s.length>1&&"0"==s.charAt(0)&&(r=B.test(s)?16:8,s=s.slice(8==r?1:2)),""===s)i=0;else{if(!(10==r?I:8==r?E:A).test(s))return e;i=parseInt(s,r)}a.push(i)}for(n=0;n<t;n++)if(i=a[n],n==t-1){if(i>=$(256,5-t))return null}else if(i>255)return null;for(o=a.pop(),n=0;n<a.length;n++)o+=a[n]*$(256,3-n);return o},X=function(e){var t,a,n,s,r,i,o,c=[0,0,0,0,0,0,0,0],l=0,u=null,d=0,f=function(){return e.charAt(d)};if(":"==f()){if(":"!=e.charAt(1))return;d+=2,l++,u=l}while(f()){if(8==l)return;if(":"!=f()){t=a=0;while(a<4&&A.test(f()))t=16*t+parseInt(f(),16),d++,a++;if("."==f()){if(0==a)return;if(d-=a,l>6)return;n=0;while(f()){if(s=null,n>0){if(!("."==f()&&n<4))return;d++}if(!U.test(f()))return;while(U.test(f())){if(r=parseInt(f(),10),null===s)s=r;else{if(0==s)return;s=10*s+r}if(s>255)return;d++}c[l]=256*c[l]+s,n++,2!=n&&4!=n||l++}if(4!=n)return;break}if(":"==f()){if(d++,!f())return}else if(f())return;c[l++]=t}else{if(null!==u)return;d++,l++,u=l}}if(null!==u){i=l-u,l=7;while(0!=l&&i>0)o=c[l],c[l--]=c[u+i-1],c[u+--i]=o}else if(8!=l)return;return c},Y=function(e){for(var t=null,a=1,n=null,s=0,r=0;r<8;r++)0!==e[r]?(s>a&&(t=n,a=s),n=null,s=0):(null===n&&(n=r),++s);return s>a&&(t=n,a=s),t},F=function(e){var t,a,n,s;if("number"==typeof e){for(t=[],a=0;a<4;a++)t.unshift(e%256),e=C(e/256);return t.join(".")}if("object"==typeof e){for(t="",n=Y(e),a=0;a<8;a++)s&&0===e[a]||(s&&(s=!1),n===a?(t+=a?":":"::",s=!0):(t+=e[a].toString(16),a<7&&(t+=":")));return"["+t+"]"}return e},H={},J=f({},H,{" ":1,'"':1,"<":1,">":1,"`":1}),W=f({},J,{"#":1,"?":1,"{":1,"}":1}),K=f({},W,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),G=function(e,t){var a=h(e,0);return a>32&&a<127&&!d(t,e)?e:encodeURIComponent(e)},Q={ftp:21,file:null,http:80,https:443,ws:80,wss:443},V=function(e){return d(Q,e.scheme)},Z=function(e){return""!=e.username||""!=e.password},ee=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},te=function(e,t){var a;return 2==e.length&&O.test(e.charAt(0))&&(":"==(a=e.charAt(1))||!t&&"|"==a)},ae=function(e){var t;return e.length>1&&te(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},ne=function(e){var t=e.path,a=t.length;!a||"file"==e.scheme&&1==a&&te(t[0],!0)||t.pop()},se=function(e){return"."===e||"%2e"===e.toLowerCase()},re=function(e){return e=e.toLowerCase(),".."===e||"%2e."===e||".%2e"===e||"%2e%2e"===e},ie={},oe={},ce={},le={},ue={},de={},fe={},me={},he={},pe={},ve={},ge={},be={},we={},xe={},ye={},ke={},_e={},Ce={},$e={},Se={},je=function(e,t,a,s){var r,i,o,c,l=a||ie,u=0,f="",h=!1,p=!1,v=!1;a||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(P,"")),t=t.replace(M,""),r=m(t);while(u<=r.length){switch(i=r[u],l){case ie:if(!i||!O.test(i)){if(a)return j;l=ce;continue}f+=i.toLowerCase(),l=oe;break;case oe:if(i&&(T.test(i)||"+"==i||"-"==i||"."==i))f+=i.toLowerCase();else{if(":"!=i){if(a)return j;f="",l=ce,u=0;continue}if(a&&(V(e)!=d(Q,f)||"file"==f&&(Z(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=f,a)return void(V(e)&&Q[e.scheme]==e.port&&(e.port=null));f="","file"==e.scheme?l=we:V(e)&&s&&s.scheme==e.scheme?l=le:V(e)?l=me:"/"==r[u+1]?(l=ue,u++):(e.cannotBeABaseURL=!0,e.path.push(""),l=Ce)}break;case ce:if(!s||s.cannotBeABaseURL&&"#"!=i)return j;if(s.cannotBeABaseURL&&"#"==i){e.scheme=s.scheme,e.path=s.path.slice(),e.query=s.query,e.fragment="",e.cannotBeABaseURL=!0,l=Se;break}l="file"==s.scheme?we:de;continue;case le:if("/"!=i||"/"!=r[u+1]){l=de;continue}l=he,u++;break;case ue:if("/"==i){l=pe;break}l=_e;continue;case de:if(e.scheme=s.scheme,i==n)e.username=s.username,e.password=s.password,e.host=s.host,e.port=s.port,e.path=s.path.slice(),e.query=s.query;else if("/"==i||"\\"==i&&V(e))l=fe;else if("?"==i)e.username=s.username,e.password=s.password,e.host=s.host,e.port=s.port,e.path=s.path.slice(),e.query="",l=$e;else{if("#"!=i){e.username=s.username,e.password=s.password,e.host=s.host,e.port=s.port,e.path=s.path.slice(),e.path.pop(),l=_e;continue}e.username=s.username,e.password=s.password,e.host=s.host,e.port=s.port,e.path=s.path.slice(),e.query=s.query,e.fragment="",l=Se}break;case fe:if(!V(e)||"/"!=i&&"\\"!=i){if("/"!=i){e.username=s.username,e.password=s.password,e.host=s.host,e.port=s.port,l=_e;continue}l=pe}else l=he;break;case me:if(l=he,"/"!=i||"/"!=f.charAt(u+1))continue;u++;break;case he:if("/"!=i&&"\\"!=i){l=pe;continue}break;case pe:if("@"==i){h&&(f="%40"+f),h=!0,o=m(f);for(var g=0;g<o.length;g++){var b=o[g];if(":"!=b||v){var w=G(b,K);v?e.password+=w:e.username+=w}else v=!0}f=""}else if(i==n||"/"==i||"?"==i||"#"==i||"\\"==i&&V(e)){if(h&&""==f)return S;u-=m(f).length+1,f="",l=ve}else f+=i;break;case ve:case ge:if(a&&"file"==e.scheme){l=ye;continue}if(":"!=i||p){if(i==n||"/"==i||"?"==i||"#"==i||"\\"==i&&V(e)){if(V(e)&&""==f)return R;if(a&&""==f&&(Z(e)||null!==e.port))return;if(c=z(e,f),c)return c;if(f="",l=ke,a)return;continue}"["==i?p=!0:"]"==i&&(p=!1),f+=i}else{if(""==f)return R;if(c=z(e,f),c)return c;if(f="",l=be,a==ge)return}break;case be:if(!U.test(i)){if(i==n||"/"==i||"?"==i||"#"==i||"\\"==i&&V(e)||a){if(""!=f){var x=parseInt(f,10);if(x>65535)return L;e.port=V(e)&&x===Q[e.scheme]?null:x,f=""}if(a)return;l=ke;continue}return L}f+=i;break;case we:if(e.scheme="file","/"==i||"\\"==i)l=xe;else{if(!s||"file"!=s.scheme){l=_e;continue}if(i==n)e.host=s.host,e.path=s.path.slice(),e.query=s.query;else if("?"==i)e.host=s.host,e.path=s.path.slice(),e.query="",l=$e;else{if("#"!=i){ae(r.slice(u).join(""))||(e.host=s.host,e.path=s.path.slice(),ne(e)),l=_e;continue}e.host=s.host,e.path=s.path.slice(),e.query=s.query,e.fragment="",l=Se}}break;case xe:if("/"==i||"\\"==i){l=ye;break}s&&"file"==s.scheme&&!ae(r.slice(u).join(""))&&(te(s.path[0],!0)?e.path.push(s.path[0]):e.host=s.host),l=_e;continue;case ye:if(i==n||"/"==i||"\\"==i||"?"==i||"#"==i){if(!a&&te(f))l=_e;else if(""==f){if(e.host="",a)return;l=ke}else{if(c=z(e,f),c)return c;if("localhost"==e.host&&(e.host=""),a)return;f="",l=ke}continue}f+=i;break;case ke:if(V(e)){if(l=_e,"/"!=i&&"\\"!=i)continue}else if(a||"?"!=i)if(a||"#"!=i){if(i!=n&&(l=_e,"/"!=i))continue}else e.fragment="",l=Se;else e.query="",l=$e;break;case _e:if(i==n||"/"==i||"\\"==i&&V(e)||!a&&("?"==i||"#"==i)){if(re(f)?(ne(e),"/"==i||"\\"==i&&V(e)||e.path.push("")):se(f)?"/"==i||"\\"==i&&V(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&te(f)&&(e.host&&(e.host=""),f=f.charAt(0)+":"),e.path.push(f)),f="","file"==e.scheme&&(i==n||"?"==i||"#"==i))while(e.path.length>1&&""===e.path[0])e.path.shift();"?"==i?(e.query="",l=$e):"#"==i&&(e.fragment="",l=Se)}else f+=G(i,W);break;case Ce:"?"==i?(e.query="",l=$e):"#"==i?(e.fragment="",l=Se):i!=n&&(e.path[0]+=G(i,H));break;case $e:a||"#"!=i?i!=n&&("'"==i&&V(e)?e.query+="%27":e.query+="#"==i?"%23":G(i,H)):(e.fragment="",l=Se);break;case Se:i!=n&&(e.fragment+=G(i,J));break}u++}},Re=function(e){var t,a,n=u(this,Re,"URL"),s=arguments.length>1?arguments[1]:void 0,i=String(e),o=k(n,{type:"URL"});if(void 0!==s)if(s instanceof Re)t=_(s);else if(a=je(t={},String(s)),a)throw TypeError(a);if(a=je(o,i,null,t),a)throw TypeError(a);var c=o.searchParams=new x,l=y(c);l.updateSearchParams(o.query),l.updateURL=function(){o.query=String(c)||null},r||(n.href=Oe.call(n),n.origin=Te.call(n),n.protocol=Ue.call(n),n.username=Be.call(n),n.password=Ee.call(n),n.host=Ie.call(n),n.hostname=Ae.call(n),n.port=qe.call(n),n.pathname=Ne.call(n),n.search=Pe.call(n),n.searchParams=Me.call(n),n.hash=ze.call(n))},Le=Re.prototype,Oe=function(){var e=_(this),t=e.scheme,a=e.username,n=e.password,s=e.host,r=e.port,i=e.path,o=e.query,c=e.fragment,l=t+":";return null!==s?(l+="//",Z(e)&&(l+=a+(n?":"+n:"")+"@"),l+=F(s),null!==r&&(l+=":"+r)):"file"==t&&(l+="//"),l+=e.cannotBeABaseURL?i[0]:i.length?"/"+i.join("/"):"",null!==o&&(l+="?"+o),null!==c&&(l+="#"+c),l},Te=function(){var e=_(this),t=e.scheme,a=e.port;if("blob"==t)try{return new Re(t.path[0]).origin}catch(n){return"null"}return"file"!=t&&V(e)?t+"://"+F(e.host)+(null!==a?":"+a:""):"null"},Ue=function(){return _(this).scheme+":"},Be=function(){return _(this).username},Ee=function(){return _(this).password},Ie=function(){var e=_(this),t=e.host,a=e.port;return null===t?"":null===a?F(t):F(t)+":"+a},Ae=function(){var e=_(this).host;return null===e?"":F(e)},qe=function(){var e=_(this).port;return null===e?"":String(e)},Ne=function(){var e=_(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},Pe=function(){var e=_(this).query;return e?"?"+e:""},Me=function(){return _(this).searchParams},ze=function(){var e=_(this).fragment;return e?"#"+e:""},De=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(r&&c(Le,{href:De(Oe,(function(e){var t=_(this),a=String(e),n=je(t,a);if(n)throw TypeError(n);y(t.searchParams).updateSearchParams(t.query)})),origin:De(Te),protocol:De(Ue,(function(e){var t=_(this);je(t,String(e)+":",ie)})),username:De(Be,(function(e){var t=_(this),a=m(String(e));if(!ee(t)){t.username="";for(var n=0;n<a.length;n++)t.username+=G(a[n],K)}})),password:De(Ee,(function(e){var t=_(this),a=m(String(e));if(!ee(t)){t.password="";for(var n=0;n<a.length;n++)t.password+=G(a[n],K)}})),host:De(Ie,(function(e){var t=_(this);t.cannotBeABaseURL||je(t,String(e),ve)})),hostname:De(Ae,(function(e){var t=_(this);t.cannotBeABaseURL||je(t,String(e),ge)})),port:De(qe,(function(e){var t=_(this);ee(t)||(e=String(e),""==e?t.port=null:je(t,e,be))})),pathname:De(Ne,(function(e){var t=_(this);t.cannotBeABaseURL||(t.path=[],je(t,e+"",ke))})),search:De(Pe,(function(e){var t=_(this);e=String(e),""==e?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",je(t,e,$e)),y(t.searchParams).updateSearchParams(t.query)})),searchParams:De(Me),hash:De(ze,(function(e){var t=_(this);e=String(e),""!=e?("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",je(t,e,Se)):t.fragment=null}))}),l(Le,"toJSON",(function(){return Oe.call(this)}),{enumerable:!0}),l(Le,"toString",(function(){return Oe.call(this)}),{enumerable:!0}),w){var Xe=w.createObjectURL,Ye=w.revokeObjectURL;Xe&&l(Re,"createObjectURL",(function(e){return Xe.apply(w,arguments)})),Ye&&l(Re,"revokeObjectURL",(function(e){return Ye.apply(w,arguments)}))}v(Re,"URL"),s({global:!0,forced:!i,sham:!r},{URL:Re})},"2b82":function(e,t,a){"use strict";a("5896")},"2d00d":function(e,t,a){"use strict";a("40d8")},"2ed7":function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"w-100 h-100"},[e.loading?a("div",{staticClass:"d-flex flex-wrap justify-content-center align-content-center position-absolute-fullsize"},[a("b-spinner",{staticClass:"text-color-primary"})],1):e._e(),e.loading?a("transition-group",{attrs:{name:"fade",mode:"out-in"}}):a("transition-group",{attrs:{name:"fade",mode:"out-in"}},[a("div",{key:"loaded",staticClass:"d-flex flex-wrap justify-content-between"},[e.checkLevel(["settings:cameras:edit"])?a("div",{staticClass:"col-12",attrs:{"data-aos":"fade-up","data-aos-duration":"1000"}},[a("h5",[e._v(e._s(e.$t("aws")))]),a("div",{staticClass:"mt-4"},[a("div",{staticClass:"settings-box container"},[a("div",{staticClass:"row"},[a("div",{staticClass:"col-7 d-flex flex-wrap align-content-center"},[e._v(e._s(e.$t("active")))]),a("div",{staticClass:"col-5 d-flex flex-wrap align-content-center justify-content-end"},[a("toggle-button",{attrs:{color:"var(--primary-color) !important",height:30,sync:!0,"aria-expanded":e.aws.active?"true":"false","aria-controls":"aws"},model:{value:e.aws.active,callback:function(t){e.$set(e.aws,"active",t)},expression:"aws.active"}})],1)]),a("b-collapse",{attrs:{id:"aws"},model:{value:e.aws.active,callback:function(t){e.$set(e.aws,"active",t)},expression:"aws.active"}},[a("hr"),a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 d-flex flex-wrap align-content-center"},[e._v(e._s(e.$t("aws_access_key_id")))]),a("div",{staticClass:"col-12 d-flex flex-wrap align-content-center justify-content-end mt-3"},[a("b-form-input",{attrs:{type:"text",placeholder:e.$t("aws_access_key_id")},model:{value:e.aws.accessKeyId,callback:function(t){e.$set(e.aws,"accessKeyId",t)},expression:"aws.accessKeyId"}})],1)]),a("hr"),a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 d-flex flex-wrap align-content-center"},[e._v(e._s(e.$t("aws_secret_access_key")))]),a("div",{staticClass:"col-12 d-flex flex-wrap align-content-center justify-content-end mt-3"},[a("b-form-input",{attrs:{type:"text",placeholder:e.$t("aws_secret_access_key")},model:{value:e.aws.secretAccessKey,callback:function(t){e.$set(e.aws,"secretAccessKey",t)},expression:"aws.secretAccessKey"}})],1)]),a("hr"),a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 d-flex flex-wrap align-content-center"},[e._v(e._s(e.$t("aws_region")))]),a("div",{staticClass:"col-12 d-flex flex-wrap align-content-center justify-content-end mt-3"},[a("b-form-input",{attrs:{type:"text",placeholder:e.$t("aws_region")},model:{value:e.aws.region,callback:function(t){e.$set(e.aws,"region",t)},expression:"aws.region"}})],1)]),a("hr"),a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 d-flex flex-wrap align-content-center"},[e._v(e._s(e.$t("aws_contingent_total")))]),a("div",{staticClass:"col-12 d-flex flex-wrap align-content-center justify-content-end mt-3"},[a("b-form-input",{attrs:{type:"number",min:0,max:1e4,placeholder:e.$t("aws_contingent_total")},model:{value:e.aws.contingent_total,callback:function(t){e.$set(e.aws,"contingent_total",t)},expression:"aws.contingent_total"}})],1)]),a("hr"),a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 d-flex flex-wrap align-content-center"},[e._v(e._s(e.$t("aws_contingent_left")))]),a("div",{staticClass:"col-12 d-flex flex-wrap align-content-center justify-content-end mt-3"},[a("b-form-input",{staticStyle:{background:"var(--third-bg-color) !important"},attrs:{type:"number",disabled:!0},model:{value:e.aws.contingent_left,callback:function(t){e.$set(e.aws,"contingent_left",t)},expression:"aws.contingent_left"}})],1)]),a("hr"),a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 d-flex flex-wrap align-content-center"},[e._v(e._s(e.$t("aws_last_rekognition")))]),a("div",{staticClass:"col-12 d-flex flex-wrap align-content-center justify-content-end mt-3"},[a("b-form-input",{staticStyle:{background:"var(--third-bg-color) !important"},attrs:{type:"text",disabled:!0},model:{value:e.aws.last_rekognition,callback:function(t){e.$set(e.aws,"last_rekognition",t)},expression:"aws.last_rekognition"}})],1)])])],1)])]):e._e(),e.cameras.length&&e.checkLevel("settings:cameras:edit")?a("div",{staticClass:"col-12 mt-5",attrs:{"data-aos":"fade-up","data-aos-duration":"1000"}},[a("h5",[e._v(e._s(e.$t("cameras")))]),e._l(e.cameras,(function(t){return a("div",{key:t.name,staticClass:"mb-5 mt-4",attrs:{"data-aos":"fade-up","data-aos-duration":"1000"}},[a("div",{staticClass:"settings-box-header"},[e._v(e._s(t.name))]),a("div",{staticClass:"settings-box container no-radius-top"},[a("div",{staticClass:"row"},[a("div",{staticClass:"col-12"},[a("label",{staticClass:"fs-6"},[e._v(e._s(e.$t("room")))]),a("b-form-select",{attrs:{options:e.general.rooms},model:{value:t.room,callback:function(a){e.$set(t,"room",a)},expression:"camera.room"}}),a("hr"),a("label",{staticClass:"fs-6"},[e._v(e._s(e.$t("video_resolution")))]),a("b-form-select",{attrs:{options:["256x144","426x240","480x360","640x480","1280x720","1920x1080"]},model:{value:t.resolution,callback:function(a){e.$set(t,"resolution",a)},expression:"camera.resolution"}}),a("hr")],1),a("div",{staticClass:"col-8 d-flex flex-wrap align-content-center"},[e._v(e._s(e.$t("audio")))]),a("div",{staticClass:"col-4 d-flex flex-wrap align-content-center justify-content-end"},[a("toggle-button",{attrs:{color:"var(--primary-color) !important",height:30,sync:!0},model:{value:t.audio,callback:function(a){e.$set(t,"audio",a)},expression:"camera.audio"}})],1),e.aws.active?a("div",{staticClass:"row w-100 m-0 p-0"},[a("div",{staticClass:"col-12"},[a("hr")]),a("div",{staticClass:"col-8 d-flex flex-wrap align-content-center"},[e._v(e._s(e.$t("rekognition")))]),a("div",{staticClass:"col-4 d-flex flex-wrap align-content-center justify-content-end"},[a("toggle-button",{attrs:{color:"var(--primary-color) !important",height:30,sync:!0},model:{value:t.rekognition.active,callback:function(a){e.$set(t.rekognition,"active",a)},expression:"camera.rekognition.active"}})],1),a("div",{staticClass:"col-12"},[a("hr")]),a("div",{staticClass:"col-12"},[a("label",{staticClass:"fs-6"},[e._v(e._s(e.$t("confidence")+" %"))]),a("b-form-input",{attrs:{type:"number",min:0,max:100,placeholder:e.$t("confidence")+" %"},model:{value:t.rekognition.confidence,callback:function(a){e.$set(t.rekognition,"confidence",a)},expression:"camera.rekognition.confidence"}}),a("hr"),a("label",{staticClass:"fs-6"},[e._v(e._s(e.$t("labels")))]),a("b-form-input",{attrs:{type:"text",placeholder:e.$t("labels")},model:{value:t.rekognition.labels,callback:function(a){e.$set(t.rekognition,"labels",a)},expression:"camera.rekognition.labels"}}),a("hr")],1)]):e._e()])])])}))],2):a("div",{staticClass:"col-12 d-flex justify-content-center"},[a("span",{staticClass:"text-muted"},[e._v(e._s(e.$t("no_cameras")))])])])])],1)},s=[],r=a("1da1"),i=(a("d81d"),a("d3b7"),a("25f0"),a("96cf"),a("f206")),o=a("20b6"),c={name:"SettingsCameras",components:{ToggleButton:i["ToggleButton"]},data:function(){return{aws:{},awsTimer:null,cameras:[],camerasTimer:null,form:{snapshotTimer:10},general:{exclude:[],rooms:[]},loading:!0}},watch:{aws:{handler:function(e){var t=this;return Object(r["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:t.loading||(t.awsTimer&&(clearTimeout(t.awsTimer),t.awsTimer=null),t.awsTimer=setTimeout(Object(r["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,Object(o["a"])("aws",e);case 3:a.next=8;break;case 5:a.prev=5,a.t0=a["catch"](0),t.$toast.error(a.t0.message);case 8:case"end":return a.stop()}}),a,null,[[0,5]])}))),1500));case 1:case"end":return a.stop()}}),a)})))()},deep:!0},cameras:{handler:function(e){var t=this;return Object(r["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:t.loading||(t.camerasTimer&&(clearTimeout(t.camerasTimer),t.timer=null),t.camerasTimer=setTimeout(Object(r["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,Object(o["a"])("cameras",e,"?stopStream=true");case 3:a.next=8;break;case 5:a.prev=5,a.t0=a["catch"](0),t.$toast.error(a.t0.message);case 8:case"end":return a.stop()}}),a,null,[[0,5]])}))),1500));case 1:case"end":return a.stop()}}),a)})))()},deep:!0}},created:function(){var e=this;return Object(r["a"])(regeneratorRuntime.mark((function t(){var a,n,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(t.prev=0,!e.checkLevel("settings:general:access")){t.next=6;break}return t.next=4,Object(o["b"])("general");case 4:a=t.sent,e.general=a.data;case 6:if(!e.checkLevel("settings:cameras:access")){t.next=15;break}return t.next=9,Object(o["b"])("cameras");case 9:return n=t.sent,e.cameras=n.data.map((function(e){return e.rekognition.labels=e.rekognition.labels.toString(),e})),t.next=13,Object(o["b"])("aws");case 13:s=t.sent,e.aws=s.data;case 15:e.loading=!1,t.next=21;break;case 18:t.prev=18,t.t0=t["catch"](0),e.$toast.error(t.t0.message);case 21:case"end":return t.stop()}}),t,null,[[0,18]])})))()}},l=c,u=(a("75bc"),a("2877")),d=Object(u["a"])(l,n,s,!1,null,"544b0be1",null);t["default"]=d.exports},"3cb8":function(e,t,a){},"3fad":function(e,t,a){"use strict";a("dea7")},"40d8":function(e,t,a){},4440:function(e,t,a){},5896:function(e,t,a){},"5fb2":function(e,t,a){"use strict";var n=2147483647,s=36,r=1,i=26,o=38,c=700,l=72,u=128,d="-",f=/[^\0-\u007E]/,m=/[.\u3002\uFF0E\uFF61]/g,h="Overflow: input needs wider integers to process",p=s-r,v=Math.floor,g=String.fromCharCode,b=function(e){var t=[],a=0,n=e.length;while(a<n){var s=e.charCodeAt(a++);if(s>=55296&&s<=56319&&a<n){var r=e.charCodeAt(a++);56320==(64512&r)?t.push(((1023&s)<<10)+(1023&r)+65536):(t.push(s),a--)}else t.push(s)}return t},w=function(e){return e+22+75*(e<26)},x=function(e,t,a){var n=0;for(e=a?v(e/c):e>>1,e+=v(e/t);e>p*i>>1;n+=s)e=v(e/p);return v(n+(p+1)*e/(e+o))},y=function(e){var t=[];e=b(e);var a,o,c=e.length,f=u,m=0,p=l;for(a=0;a<e.length;a++)o=e[a],o<128&&t.push(g(o));var y=t.length,k=y;y&&t.push(d);while(k<c){var _=n;for(a=0;a<e.length;a++)o=e[a],o>=f&&o<_&&(_=o);var C=k+1;if(_-f>v((n-m)/C))throw RangeError(h);for(m+=(_-f)*C,f=_,a=0;a<e.length;a++){if(o=e[a],o<f&&++m>n)throw RangeError(h);if(o==f){for(var $=m,S=s;;S+=s){var j=S<=p?r:S>=p+i?i:S-p;if($<j)break;var R=$-j,L=s-j;t.push(g(w(j+R%L))),$=v(R/L)}t.push(g(w($))),p=x(m,C,k==y),m=0,++k}}++m,++f}return t.join("")};e.exports=function(e){var t,a,n=[],s=e.toLowerCase().replace(m,".").split(".");for(t=0;t<s.length;t++)a=s[t],n.push(f.test(a)?"xn--"+y(a):a);return n.join(".")}},"75bc":function(e,t,a){"use strict";a("ba4a")},"7e6b":function(e,t,a){"use strict";a("3cb8")},9129:function(e,t,a){var n=a("23e7");n({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},9501:function(e,t,a){},9861:function(e,t,a){"use strict";a("e260");var n=a("23e7"),s=a("d066"),r=a("0d3b"),i=a("6eeb"),o=a("e2cc"),c=a("d44e"),l=a("9ed3"),u=a("69f3"),d=a("19aa"),f=a("5135"),m=a("0366"),h=a("f5df"),p=a("825a"),v=a("861d"),g=a("7c73"),b=a("5c6c"),w=a("9a1f"),x=a("35a1"),y=a("b622"),k=s("fetch"),_=s("Headers"),C=y("iterator"),$="URLSearchParams",S=$+"Iterator",j=u.set,R=u.getterFor($),L=u.getterFor(S),O=/\+/g,T=Array(4),U=function(e){return T[e-1]||(T[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},B=function(e){try{return decodeURIComponent(e)}catch(t){return e}},E=function(e){var t=e.replace(O," "),a=4;try{return decodeURIComponent(t)}catch(n){while(a)t=t.replace(U(a--),B);return t}},I=/[!'()~]|%20/g,A={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},q=function(e){return A[e]},N=function(e){return encodeURIComponent(e).replace(I,q)},P=function(e,t){if(t){var a,n,s=t.split("&"),r=0;while(r<s.length)a=s[r++],a.length&&(n=a.split("="),e.push({key:E(n.shift()),value:E(n.join("="))}))}},M=function(e){this.entries.length=0,P(this.entries,e)},z=function(e,t){if(e<t)throw TypeError("Not enough arguments")},D=l((function(e,t){j(this,{type:S,iterator:w(R(e).entries),kind:t})}),"Iterator",(function(){var e=L(this),t=e.kind,a=e.iterator.next(),n=a.value;return a.done||(a.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),a})),X=function(){d(this,X,$);var e,t,a,n,s,r,i,o,c,l=arguments.length>0?arguments[0]:void 0,u=this,m=[];if(j(u,{type:$,entries:m,updateURL:function(){},updateSearchParams:M}),void 0!==l)if(v(l))if(e=x(l),"function"===typeof e){t=e.call(l),a=t.next;while(!(n=a.call(t)).done){if(s=w(p(n.value)),r=s.next,(i=r.call(s)).done||(o=r.call(s)).done||!r.call(s).done)throw TypeError("Expected sequence with length 2");m.push({key:i.value+"",value:o.value+""})}}else for(c in l)f(l,c)&&m.push({key:c,value:l[c]+""});else P(m,"string"===typeof l?"?"===l.charAt(0)?l.slice(1):l:l+"")},Y=X.prototype;o(Y,{append:function(e,t){z(arguments.length,2);var a=R(this);a.entries.push({key:e+"",value:t+""}),a.updateURL()},delete:function(e){z(arguments.length,1);var t=R(this),a=t.entries,n=e+"",s=0;while(s<a.length)a[s].key===n?a.splice(s,1):s++;t.updateURL()},get:function(e){z(arguments.length,1);for(var t=R(this).entries,a=e+"",n=0;n<t.length;n++)if(t[n].key===a)return t[n].value;return null},getAll:function(e){z(arguments.length,1);for(var t=R(this).entries,a=e+"",n=[],s=0;s<t.length;s++)t[s].key===a&&n.push(t[s].value);return n},has:function(e){z(arguments.length,1);var t=R(this).entries,a=e+"",n=0;while(n<t.length)if(t[n++].key===a)return!0;return!1},set:function(e,t){z(arguments.length,1);for(var a,n=R(this),s=n.entries,r=!1,i=e+"",o=t+"",c=0;c<s.length;c++)a=s[c],a.key===i&&(r?s.splice(c--,1):(r=!0,a.value=o));r||s.push({key:i,value:o}),n.updateURL()},sort:function(){var e,t,a,n=R(this),s=n.entries,r=s.slice();for(s.length=0,a=0;a<r.length;a++){for(e=r[a],t=0;t<a;t++)if(s[t].key>e.key){s.splice(t,0,e);break}t===a&&s.push(e)}n.updateURL()},forEach:function(e){var t,a=R(this).entries,n=m(e,arguments.length>1?arguments[1]:void 0,3),s=0;while(s<a.length)t=a[s++],n(t.value,t.key,this)},keys:function(){return new D(this,"keys")},values:function(){return new D(this,"values")},entries:function(){return new D(this,"entries")}},{enumerable:!0}),i(Y,C,Y.entries),i(Y,"toString",(function(){var e,t=R(this).entries,a=[],n=0;while(n<t.length)e=t[n++],a.push(N(e.key)+"="+N(e.value));return a.join("&")}),{enumerable:!0}),c(X,$),n({global:!0,forced:!r},{URLSearchParams:X}),r||"function"!=typeof k||"function"!=typeof _||n({global:!0,enumerable:!0,forced:!0},{fetch:function(e){var t,a,n,s=[e];return arguments.length>1&&(t=arguments[1],v(t)&&(a=t.body,h(a)===$&&(n=t.headers?new _(t.headers):new _,n.has("content-type")||n.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=g(t,{body:b(0,String(a)),headers:b(0,n)}))),s.push(t)),k.apply(this,s)}}),e.exports={URLSearchParams:X,getState:R}},"98b7":function(e,t,a){"use strict";a("d5f6")},"9a1f":function(e,t,a){var n=a("825a"),s=a("35a1");e.exports=function(e){var t=s(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return n(t.call(e))}},ba4a:function(e,t,a){},c20d:function(e,t,a){var n=a("da84"),s=a("58a8").trim,r=a("5899"),i=n.parseInt,o=/^[+-]?0[Xx]/,c=8!==i(r+"08")||22!==i(r+"0x16");e.exports=c?function(e,t){var a=s(String(e));return i(a,t>>>0||(o.test(a)?16:10))}:i},c37e:function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"w-100 h-100"},[e.loading?a("div",{staticClass:"d-flex flex-wrap justify-content-center align-content-center position-absolute-fullsize"},[a("b-spinner",{staticClass:"text-color-primary"})],1):e._e(),e.loading?a("transition-group",{attrs:{name:"fade",mode:"out-in"}}):a("transition-group",{attrs:{name:"fade",mode:"out-in"}},[e.currentUser?a("div",{key:"loaded",staticClass:"d-flex flex-wrap justify-content-between"},[a("div",{staticClass:"col-12 col-md mb-5",attrs:{"data-aos":"fade-up","data-aos-duration":"1000"}},[a("div",{staticClass:"settings-box d-flex flex-wrap justify-content-center align-content-center container"},[a("div",{staticClass:"image-upload"},[a("label",{attrs:{for:"file-input"}},[a("b-card-img-lazy",{staticClass:"profile-avatar",attrs:{src:"no_img.png"!==e.currentUser.photo?"/files/"+e.currentUser.photo:"@/assets/img/no_user.png",alt:"Avatar",width:"8rem",height:"8rem"},nativeOn:{error:function(t){return e.handleErrorImg(t)}}})],1),a("input",{attrs:{id:"file-input",type:"file",name:"photo",placeholder:"Photo",required:"",accept:"image/png,image/jpeg"},on:{change:e.changeProfileImg}})]),a("div",{staticClass:"w-100 my-2"}),a("h5",{staticClass:"font-weight-bold lh-1"},[e._v(e._s(e.currentUser.username))]),a("div",{staticClass:"w-100"}),a("span",{staticClass:"text-muted fs-7 lh-1 m-0"},[e._v(e._s(e.currentUser.permissionLevel.includes("admin")?e.$t("master"):e.$t("user")))])]),e.checkLevel("admin")?a("div",{directives:[{name:"b-modal",rawName:"v-b-modal.modal-reset",modifiers:{"modal-reset":!0}}],staticClass:"btn btn-danger mt-2 w-100 p-2 mt-3"},[e._v(e._s(e.$t("reset")))]):e._e(),e.checkLevel("admin")?a("div",{staticClass:"settings-box container mt-5"},[a("h3",{staticClass:"lh-1 font-weight-bold"},[e._v(e._s(e.$t("backup")))]),a("div",{staticClass:"w-100"}),a("span",{staticClass:"lh-1 text-muted fs-6"},[e._v(e._s(e.$t("backup_and_restore")))]),a("hr",{staticClass:"mb-4"}),a("b-form-file",{ref:"file-input-backup",attrs:{id:"backup-file",placeholder:e.$t("backup"),"browse-text":e.$t("browse"),"drop-placeholder":e.$t("drop_files_here"),size:"sm",accept:".gz"}}),a("div",{staticClass:"w-100 my-2"}),a("div",{staticClass:"btn btn-success mt-2 w-100 p-2 mt-3",on:{click:e.restoreBackup}},[a("span",{directives:[{name:"show",rawName:"v-show",value:e.uploadBackupSpinner,expression:"uploadBackupSpinner"}],staticClass:"text-white mr-2"},[a("b-spinner",{attrs:{small:"",type:"grow"}})],1),e._v(e._s(e.$t("backup_restore")))]),a("div",{staticClass:"btn btn-danger mt-2 w-100 p-2 mt-3",on:{click:e.downloadBackup}},[a("span",{directives:[{name:"show",rawName:"v-show",value:e.downloadBackupSpinner,expression:"downloadBackupSpinner"}],staticClass:"text-white mr-2"},[a("b-spinner",{attrs:{small:"",type:"grow"}})],1),e._v(e._s(e.$t("backup_download")))])],1):e._e(),a("b-modal",{ref:"reset-modal",attrs:{id:"modal-reset",centered:"","no-close-on-backdrop":"","no-close-on-esc":"",title:e.$t("reset_confirm"),"cancel-title":e.$t("cancel"),"ok-title":e.$t("reset"),"ok-variant":"danger"},on:{ok:e.reset}},[a("b-overlay",{attrs:{variant:"transparent",show:e.resetLoading,rounded:"sm"}},[a("p",{staticClass:"my-4"},[e._v(e._s(e.$t("reset_confirm_text")))])])],1)],1),a("div",{staticClass:"col-12 col-md-8",attrs:{"data-aos":"fade-up","data-aos-duration":"1000"}},[a("div",{staticClass:"settings-box container"},[a("h3",{staticClass:"lh-1 font-weight-bold"},[e._v(e._s(e.$t("account")))]),a("div",{staticClass:"w-100"}),a("span",{staticClass:"lh-1 text-muted fs-6"},[e._v(e._s(e.$t("general_information")))]),a("hr",{staticClass:"mb-4"}),a("label",{staticClass:"fs-6"},[e._v(e._s(e.$t("username")))]),a("b-form-input",{staticClass:"admin-username",attrs:{type:"text",value:e.currentUser.username,placeholder:e.$t("username")}}),a("div",{staticClass:"w-100 my-3"}),a("label",{staticClass:"fs-6"},[e._v(e._s(e.$t("new_password")))]),a("b-form-input",{staticClass:"admin-newpw",attrs:{type:"text",placeholder:"********"}}),a("div",{staticClass:"w-100 my-3"}),a("label",{staticClass:"fs-6"},[e._v(e._s(e.$t("new_password_verify")))]),a("b-form-input",{staticClass:"admin-newpw-verify",attrs:{type:"text",placeholder:"********"}}),a("div",{staticClass:"w-100 my-3"}),a("label",{staticClass:"fs-6"},[e._v(e._s(e.$t("signout_after")))]),a("b-form-select",{staticClass:"admin-sessiontimer",attrs:{value:e.currentUser.sessionTimer/3600>25?e.$t("never"):e.currentUser.sessionTimer/3600,options:e.sessionTimerSelect}}),a("div",{staticClass:"btn btn-success mt-4 w-100",on:{click:e.changeAdmin}},[e._v(e._s(e.$t("apply")))])],1),e.currentUser.permissionLevel.includes("admin")?a("div",{staticClass:"settings-box container mt-5"},[a("h3",{staticClass:"lh-1 font-weight-bold"},[e._v(e._s(e.$t("user")))]),a("div",{staticClass:"w-100"}),a("span",{staticClass:"lh-1 text-muted fs-6"},[e._v(e._s(e.$t("registered_user")))]),a("hr",{staticClass:"mb-4"}),a("h5",[e._v(e._s(e.$t("add_new_user")))]),a("div",{staticClass:"w-100 my-4"}),a("label",{staticClass:"fs-6"},[e._v(e._s(e.$t("username")))]),a("b-form-input",{attrs:{type:"text",placeholder:e.$t("username"),state:e.newUserNameState,lazy:""},model:{value:e.form.newUser.username,callback:function(t){e.$set(e.form.newUser,"username",t)},expression:"form.newUser.username"}}),a("div",{staticClass:"w-100 my-3"}),a("label",{staticClass:"fs-6"},[e._v(e._s(e.$t("password")))]),a("b-form-input",{attrs:{type:"text",placeholder:"********",state:e.newUserPasswordState,lazy:""},model:{value:e.form.newUser.password,callback:function(t){e.$set(e.form.newUser,"password",t)},expression:"form.newUser.password"}}),a("div",{staticClass:"w-100 my-3"}),a("label",{staticClass:"fs-6"},[e._v(e._s(e.$t("permissions")))]),a("multiselect",{attrs:{options:e.permissions,searchable:!1,"close-on-select":!1,"show-labels":!1,placeholder:e.$t("select"),multiple:!0,limit:2,"group-values":"permissionLevel","group-label":"catagory","group-select":!0,tabindex:99,openDirection:"top"},model:{value:e.form.newUser.permissionLevel,callback:function(t){e.$set(e.form.newUser,"permissionLevel",t)},expression:"form.newUser.permissionLevel"}}),a("div",{staticClass:"btn btn-success mt-4 w-100",on:{click:function(t){return e.addUser()}}},[e._v(e._s(e.$t("add")))]),a("hr"),a("h5",[e._v(e._s(e.$t("registered_user")))]),e.users.length>1?a("div",{staticClass:"z-index-2"},e._l(e.users,(function(t,n){return a("div",{attrs:{"data-aos":"fade-up","data-aos-duration":"1000"}},[t.permissionLevel.includes("admin")?e._e():a("div",{staticClass:"mt-4"},[a("label",{staticClass:"fs-6"},[e._v(e._s(e.$t("username")))]),a("b-form-input",{staticClass:"users",attrs:{type:"text",placeholder:e.$t("username"),value:t.username}}),a("div",{staticClass:"w-100 my-3"}),a("label",{staticClass:"fs-6"},[e._v(e._s(e.$t("permissions")))]),a("multiselect",{attrs:{options:e.permissions,searchable:!1,"close-on-select":!1,"show-labels":!1,placeholder:e.$t("select"),multiple:!0,limit:2,"allow-empty":!1,"group-values":"permissionLevel","group-label":"catagory","group-select":!0,openDirection:"top"},model:{value:t.permissionLevel,callback:function(a){e.$set(t,"permissionLevel",a)},expression:"user.permissionLevel"}}),a("div",{staticClass:"row"},[a("div",{staticClass:"col"},[a("div",{staticClass:"btn btn-danger mt-4 w-100",on:{click:function(a){return e.removeUser(t,n)}}},[e._v(e._s(e.$t("remove")))])]),a("div",{staticClass:"col"},[a("div",{staticClass:"btn btn-success mt-4 w-100",on:{click:function(a){return e.changeUser(t,n)}}},[e._v(e._s(e.$t("apply")))])])]),a("hr")],1)])})),0):a("div",[a("p",{staticClass:"mt-5 text-center"},[e._v(e._s(e.$t("no_registered_user")))])])],1):e._e()])]):e._e()])],1)},s=[],r=a("b85c"),i=a("1da1"),o=(a("96cf"),a("d3b7"),a("99af"),a("9129"),a("a9e3"),a("25eb"),a("b0c0"),a("3ca3"),a("ddb0"),a("2b3d"),a("ac1f"),a("1276"),a("0759")),c=a("7386"),l=a("8e5f"),u=a.n(l),d=(a("e607"),a("365ce")),f="/backup",m="download",h="restore",p=function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,d["a"].get("".concat(f,"/").concat(m),{params:{localStorage:t},responseType:"arraybuffer"});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),v=function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,d["a"].post("".concat(f,"/").concat(h),t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),g=a("20b6"),b="/users",w=function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,d["a"].post(b,t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),x=function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(t,a){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,d["a"].patch("".concat(b,"/").concat(t),a);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),y=function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,d["a"].get("".concat(b).concat(t||""));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),k=function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,d["a"].delete("".concat(b,"/").concat(t));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),_=function(e){return new Promise((function(t){return setTimeout(t,e)}))},C={name:"SettingsProfile",components:{BIcon:o["a"],BIconXCircleFill:c["s"],Multiselect:u.a},data:function(){return{form:{avatar:null,newUser:{username:"",password:"",permissionLevel:[]}},permissions:[{catagory:this.$t("base"),permissionLevel:["cameras:access","camview:access","dashboard:access","notifications:access","recordings:access","settings:access","settings:cameras:access","settings:camview:access","settings:dashboard:access","settings:general:access","settings:profile:access"]},{catagory:this.$t("admin"),permissionLevel:["backup:download","backup:restore","cameras:access","cameras:edit","camview:access","dashboard:access","notifications:acc