platypush/platypush/backend/http/webapp/dist/static/js/app.cadba6f7.js

2 lines
80 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(function(){var e={5250:function(e,t,n){"use strict";n.d(t,{$:function(){return i}});var s=n(9652);const i=(0,s.Z)();i.publishEntity=e=>{i.emit("entity-update",e)},i.onEntity=e=>{i.on("entity-update",e)},i.publishNotification=e=>{i.emit("notification-create",e)},i.onNotification=e=>{i.on("notification-create",e)}},3188:function(e,t,n){"use strict";var s=n(9963),i=n(6252);function o(e,t,n,s,o,a){const l=(0,i.up)("Events"),r=(0,i.up)("Notifications"),c=(0,i.up)("VoiceAssistant"),d=(0,i.up)("Pushbullet"),u=(0,i.up)("Ntfy"),h=(0,i.up)("ConfirmDialog"),p=(0,i.up)("router-view");return(0,i.wg)(),(0,i.iD)(i.HY,null,[a.hasWebsocket?((0,i.wg)(),(0,i.j4)(l,{key:0,ref:"events"},null,512)):(0,i.kq)("",!0),(0,i.Wm)(r,{ref:"notifications"},null,512),a.hasAssistant?((0,i.wg)(),(0,i.j4)(c,{key:1,ref:"voice-assistant"},null,512)):(0,i.kq)("",!0),a.hasPushbullet?((0,i.wg)(),(0,i.j4)(d,{key:2,ref:"pushbullet"},null,512)):(0,i.kq)("",!0),a.hasNtfy?((0,i.wg)(),(0,i.j4)(u,{key:3,ref:"ntfy"},null,512)):(0,i.kq)("",!0),(0,i.Wm)(h,{ref:"pwaDialog",onInput:a.installPWA},{default:(0,i.w5)((()=>[(0,i.Uk)(" Would you like to install this application locally? ")])),_:1},8,["onInput"]),(0,i.Wm)(p)],64)}var a=n(6936);const l={class:"notifications"};function r(e,t,n,s,o,a){const r=(0,i.up)("Notification");return(0,i.wg)(),(0,i.iD)("div",l,[((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(e.notifications,((e,t,n)=>((0,i.wg)(),(0,i.j4)(r,{key:n,id:t,text:e.text,html:e.html,title:e.title,link:e.link,image:e.image,warning:e.warning,error:e.error,onClicked:a.destroy},null,8,["id","text","html","title","link","image","warning","error","onClicked"])))),128))])}var c=n(3577);const d=["textContent"],u={class:"body"},h={key:0,class:"image col-3"},p={class:"row"},f=["src"],m={key:3,class:"fa fa-exclamation"},g={key:4,class:"fa fa-times"},b=["textContent"],y=["innerHTML"],w=["textContent"],v=["innerHTML"];function k(e,t,n,s,o,a){return(0,i.wg)(),(0,i.iD)("div",{class:(0,c.C_)(["notification fade-in",{warning:n.warning,error:n.error}]),onClick:t[0]||(t[0]=(...e)=>a.clicked&&a.clicked(...e))},[n.title?((0,i.wg)(),(0,i.iD)("div",{key:0,class:"title",textContent:(0,c.zw)(n.title)},null,8,d)):(0,i.kq)("",!0),(0,i._)("div",u,[n.image||n.warning||n.error?((0,i.wg)(),(0,i.iD)("div",h,[(0,i._)("div",p,[n.image&&n.image.src?((0,i.wg)(),(0,i.iD)("img",{key:0,src:n.image.src,alt:""},null,8,f)):n.image&&n.image.icon?((0,i.wg)(),(0,i.iD)("i",{key:1,class:(0,c.C_)(["fa","fa-"+n.image.icon]),style:(0,c.j5)(n.image.color?"--color: "+n.image.color:"")},null,6)):n.image&&n.image.iconClass?((0,i.wg)(),(0,i.iD)("i",{key:2,class:(0,c.C_)(n.image.iconClass),style:(0,c.j5)(n.image.color?"--color: "+n.image.color:"")},null,6)):n.warning?((0,i.wg)(),(0,i.iD)("i",m)):n.error?((0,i.wg)(),(0,i.iD)("i",g)):(0,i.kq)("",!0)])])):(0,i.kq)("",!0),n.text&&n.image?((0,i.wg)(),(0,i.iD)("div",{key:1,class:"text col-9",textContent:(0,c.zw)(n.text)},null,8,b)):(0,i.kq)("",!0),n.html&&n.image?((0,i.wg)(),(0,i.iD)("div",{key:2,class:"text col-9",innerHTML:n.html},null,8,y)):(0,i.kq)("",!0),n.text&&!n.image?((0,i.wg)(),(0,i.iD)("div",{key:3,class:"text row horizontal-center",textContent:(0,c.zw)(n.text)},null,8,w)):(0,i.kq)("",!0),n.html&&!n.image?((0,i.wg)(),(0,i.iD)("div",{key:4,class:"text row horizontal-center",innerHTML:n.html},null,8,v)):(0,i.kq)("",!0)])],2)}var _={name:"Notification",props:["id","text","html","title","image","link","error","warning"],methods:{clicked(){this.link&&window.open(this.link,"_blank"),this.$emit("clicked",this.id)}}},x=n(3744);const C=(0,x.Z)(_,[["render",k],["__scopeId","data-v-7646705e"]]);var D=C,I={name:"Notifications",components:{Notification:D},props:{duration:{type:Number,default:1e4}},data:function(){return{index:0,notifications:{},timeouts:{}}},methods:{create:function(e){const t=this.index++;this.notifications[t]=e,null==e.duration&&(e.duration=this.duration);const n=e.duration?parseInt(e.duration):0;n&&(this.timeouts[t]=setTimeout(this.destroy.bind(null,t),n))},destroy:function(e){delete this.notifications[e],delete this.timeouts[e]}}};const T=(0,x.Z)(I,[["render",r],["__scopeId","data-v-6dc8bebc"]]);var $=T,S=n(8637);function q(e,t,n,s,o,a){return(0,i.wg)(),(0,i.iD)("div")}n(7658);var U=n(5250),E={name:"Events",data(){return{ws:null,initialized:!1,pending:!1,opened:!1,timeout:null,reconnectMsecs:1e3,minReconnectMsecs:1e3,maxReconnectMsecs:3e4,handlers:{},handlerNameToEventTypes:{}}},methods:{onWebsocketTimeout(){console.log("Websocket reconnection timed out, retrying"),this.reconnectMsecs=Math.min(2*this.reconnectMsecs,this.maxReconnectMsecs),this.pending=!1,this.ws&&this.ws.close(),this.onClose()},onMessage(e){const t=[];if(e=e.data,"string"===typeof e)try{e=JSON.parse(e)}catch(n){console.warn("Received invalid non-JSON event"),console.warn(e)}if(console.debug(e),"event"===e.type){null in this.handlers&&t.push(this.handlers[null]),e.args.type in this.handlers&&t.push(...Object.values(this.handlers[e.args.type]));for(let n of t)n&&(n instanceof Array?n=n[0]:n instanceof Object&&!(n instanceof Function)&&(n=Object.values(n)[0]),n(e.args))}},onOpen(){this.opened&&(console.log("There's already an opened websocket connection, closing the newly opened one"),this.ws&&(this.ws.onclose=()=>{},this.ws.close())),console.log("Websocket connection successful"),this.opened=!0,this.reconnectMsecs=this.minReconnectMsecs,this.pending&&(this.pending=!1),this.timeout&&(clearTimeout(this.timeout),this.timeout=void 0)},onError(e){console.error("Websocket error"),console.error(e)},onClose(e){e&&console.log(`Websocket closed - code: ${e.code} - reason: ${e.reason}. Retrying in ${this.reconnectMsecs/1e3}s`),this.opened=!1,this.pending||(this.pending=!0,this.init())},init(){try{const e="https:"===location.protocol?"wss":"ws",t=`${e}://${location.host}/ws/events`;this.ws=new WebSocket(t)}catch(e){return console.error("Websocket initialization error"),void console.error(e)}this.pending=!0,this.timeout=setTimeout(this.onWebsocketTimeout,this.reconnectMsecs),this.ws.onmessage=this.onMessage,this.ws.onopen=this.onOpen,this.ws.onerror=this.onError,this.ws.onclose=this.onClose,this.initialized=!0},subscribe(e){const t=e.handler,n=e.events.length?e.events:[null],s=e.handlerName;for(const i of n)i in this.handlers||(this.handlers[i]={}),s in this.handlerNameToEventTypes||(this.handlerNameToEventTypes[s]=n),this.handlers[i][s]=t;return()=>{this.unsubscribe(s)}},unsubscribe(e){const t=this.handlerNameToEventTypes[e];if(t){for(const n of t)this.handlers[n]?.[e]&&(delete this.handlers[n][e],Object.keys(this.handlers[n]).length||delete this.handlers[n]);delete this.handlerNameToEventTypes[e]}}},created(){U.$.on("subscribe",this.subscribe),U.$.on("unsubscribe",this.unsubscribe),this.$watch("opened",(e=>{U.$.emit(e?"connect":"disconnect")})),this.init()}};const M=(0,x.Z)(E,[["render",q]]);var P=M;const j={class:"assistant-modal"},O={class:"icon"},Z={key:0,class:"fa fa-bell"},N={key:1,class:"fa fa-volume-up"},W={key:2,class:"fa fa-comment-dots"},R={key:3,class:"fa fa-microphone"},z={class:"text"},A={key:0,class:"listening"},L=(0,i._)("span",null,"Assistant listening",-1),F=[L],B={key:1,class:"speech-recognized"},H=["textContent"],V={key:2,class:"responding"},Y=["textContent"];function K(e,t,n,s,o,a){const l=(0,i.up)("Modal");return(0,i.wg)(),(0,i.iD)("div",j,[(0,i.Wm)(l,{ref:"assistantModal"},{default:(0,i.w5)((()=>[(0,i._)("div",O,[o.state.alerting?((0,i.wg)(),(0,i.iD)("i",Z)):o.state.responding?((0,i.wg)(),(0,i.iD)("i",N)):o.state.speechRecognized?((0,i.wg)(),(0,i.iD)("i",W)):((0,i.wg)(),(0,i.iD)("i",R))]),(0,i._)("div",z,[o.state.listening?((0,i.wg)(),(0,i.iD)("div",A,F)):o.state.speechRecognized?((0,i.wg)(),(0,i.iD)("div",B,[(0,i._)("span",{textContent:(0,c.zw)(o.phrase)},null,8,H)])):o.state.responding?((0,i.wg)(),(0,i.iD)("div",V,[(0,i._)("span",{textContent:(0,c.zw)(o.responseText)},null,8,Y)])):(0,i.kq)("",!0)])])),_:1},512)])}var J=n(9417),G={name:"VoiceAssistant",components:{Modal:J.Z},mixins:[S.Z],data(){return{responseText:"",phrase:"",hideTimeout:void 0,state:{listening:!1,speechRecognized:!1,responding:!1,alerting:!1}}},methods:{reset(){this.state.listening=!1,this.state.speechRecognized=!1,this.state.responding=!1,this.state.alerting=!1,this.phrase="",this.responseText=""},conversationStart(){this.reset(),this.state.listening=!0,this.$refs.assistantModal.show(),this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=void 0)},conversationEnd(){const e=this;this.hideTimeout=setTimeout((()=>{this.reset(),e.$refs.assistantModal.close(),e.hideTimeout=void 0}),4e3)},speechRecognized(e){this.reset(),this.state.speechRecognized=!0,this.phrase=e.phrase,this.$refs.assistantModal.show()},response(e){this.reset(),this.state.responding=!0,this.responseText=e.response_text,this.$refs.assistantModal.show()},alertOn(){this.reset(),this.state.alerting=!0,this.$refs.assistantModal.show()},alertOff(){this.reset(),this.state.alerting=!1,this.$refs.assistantModal.close()},registerHandlers(){this.subscribe(this.conversationStart,null,"platypush.message.event.assistant.ConversationStartEvent"),this.subscribe(this.alertOn,null,"platypush.message.event.assistant.AlertStartedEvent"),this.subscribe(this.alertOff,null,"platypush.message.event.assistant.AlertEndEvent"),this.subscribe(this.speechRecognized,null,"platypush.message.event.assistant.SpeechRecognizedEvent"),this.subscribe(this.response,null,"platypush.message.event.assistant.ResponseEvent"),this.subscribe(this.conversationEnd,null,"platypush.message.event.assistant.ConversationEndEvent","platypush.message.event.assistant.NoResponseEvent","platypush.message.event.assistant.ConversationTimeoutEvent")}},mounted(){this.registerHandlers()}};const X=(0,x.Z)(G,[["render",K]]);var Q=X;function ee(e,t,n,s,o,a){return(0,i.wg)(),(0,i.iD)("div")}var te={name:"Ntfy",mixins:[S.Z],methods:{onMessage(e){this.notify({title:e.title,text:e.message,image:{icon:"bell"}})}},mounted(){this.subscribe(this.onMessage,null,"platypush.message.event.ntfy.NotificationEvent")}};const ne=(0,x.Z)(te,[["render",ee]]);var se=ne;function ie(e,t,n,s,o,a){return(0,i.wg)(),(0,i.iD)("div")}var oe={name:"Pushbullet",mixins:[S.Z],methods:{onMessage(e){"mirror"===e.push_type&&this.notify({title:e.title,text:e.body,image:{src:e.icon?"data:image/png;base64, "+e.icon:void 0,icon:e.icon?void 0:"bell"}})}},mounted(){this.subscribe(this.onMessage,null,"platypush.message.event.pushbullet.PushbulletEvent")}};const ae=(0,x.Z)(oe,[["render",ie]]);var le=ae,re={name:"App",mixins:[S.Z],components:{ConfirmDialog:a.Z,Pushbullet:le,Ntfy:se,Notifications:$,Events:P,VoiceAssistant:Q},data(){return{config:{},userAuthenticated:!1,pwaInstallEvent:null}},computed:{hasWebsocket(){return this.userAuthenticated&&"backend.http"in this.config},hasAssistant(){return this.hasWebsocket},hasPushbullet(){return this.hasWebsocket&&("pushbullet"in this.config||"backend.pushbullet"in this.config)},hasNtfy(){return this.hasWebsocket&&"ntfy"in this.config}},methods:{onNotification(e){this.$refs.notifications.create(e)},async initConfig(){this.config=await this.request("config.get",{},6e4,!1),this.userAuthenticated=!0},installPWA(){this.pwaInstallEvent&&this.pwaInstallEvent.prompt(),this.$refs.pwaDialog.close()}},created(){this.initConfig()},beforeMount(){this.getCookie("pwa-dialog-shown")?.length||window.addEventListener("beforeinstallprompt",(e=>{e.preventDefault(),this.pwaInstallEvent=e,this.$refs.pwaDialog.show(),this.setCookie("pwa-dialog-shown","1",{expires:new Date((new Date).getTime()+31536e6)})}))},mounted(){U.$.onNotification(this.onNotification)}};const ce=(0,x.Z)(re,[["render",o]]);var de=ce,ue=n(2201);function he(e,t,n,s,o,a){const l=(0,i.up)("Loading"),r=(0,i.up)("Widget"),d=(0,i.up)("Row");return(0,i.wg)(),(0,i.iD)(i.HY,null,[o.loading?((0,i.wg)(),(0,i.j4)(l,{key:0})):(0,i.kq)("",!0),(0,i._)("div",{id:"dashboard",class:(0,c.C_)(["col-12",a.classes]),style:(0,c.j5)(o.style)},[((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(o.rows,((e,t)=>((0,i.wg)(),(0,i.j4)(d,{key:t,class:(0,c.C_)(e.class),style:(0,c.j5)(e.style)},{default:(0,i.w5)((()=>[((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(e.widgets,((e,t)=>((0,i.wg)(),(0,i.j4)(i.Ob,{key:t},[(0,i.Wm)(r,{style:(0,c.j5)(e.style),class:(0,c.C_)(e.class)},{default:(0,i.w5)((()=>[((0,i.wg)(),(0,i.j4)((0,i.LL)(e.component),(0,c.vs)((0,i.F4)(a.getWidgetProps(e))),null,16))])),_:2},1032,["style","class"])],1024)))),128))])),_:2},1032,["class","style"])))),128))],6)],64)}var pe=n(2262),fe=n(6791);function me(e,t,n,s,o,a){return(0,i.wg)(),(0,i.iD)("div",{class:(0,c.C_)(["row",a.classes]),style:(0,c.j5)(n.style)},[(0,i.WI)(e.$slots,"default",{},void 0,!0)],6)}var ge={name:"Row",props:{class:{type:String,required:!1,default:""},style:{type:String,required:!1,default:""}},computed:{classes(){return this.class}}};const be=(0,x.Z)(ge,[["render",me],["__scopeId","data-v-1b4663f2"]]);var ye=be;function we(e,t,n,s,o,a){return(0,i.wg)(),(0,i.iD)("div",{style:(0,c.j5)(n.style),class:(0,c.C_)(a.classes)},[(0,i.WI)(e.$slots,"default",{},void 0,!0)],6)}var ve={name:"Widget",props:{style:{type:String,required:!1,default:""},class:{type:String,required:!1,default:""}},computed:{classes(){return(this.class?.length?this.class.split(" "):["col-3"]).concat(["widget","column"])}}};const ke=(0,x.Z)(ve,[["render",we],["__scopeId","data-v-5df52982"]]);var _e=ke,xe={name:"Dashboard",mixins:[S.Z],components:{Widget:_e,Loading:fe.Z,Row:ye},props:{refreshSeconds:{type:Number,required:!1,default:0}},data(){return{rows:[],loading:!1,style:void 0,class:void 0}},computed:{classes(){return this.class}},methods:{getWidgetProps(e){const t={...e.props};return t.class&&delete t.class,t},parseTemplate(e,t){const s=(new DOMParser).parseFromString(t,"text/xml").childNodes[0],o=this;this.style=s.attributes.style?.nodeValue,this.class=s.attributes.class?.nodeValue,this.rows=[...s.getElementsByTagName("Row")].map((e=>({style:e.attributes.style?.nodeValue,class:e.attributes.class?.nodeValue,widgets:[...e.children].map((e=>{const t=(0,pe.XI)((0,i.RC)((()=>n(6725)(`./${e.nodeName}/Index`)))),s=e.attributes.style?.nodeValue,a=e.attributes.class?.nodeValue,l=[...e.attributes].reduce(((e,t)=>("style"!==t.nodeName&&(e[t.nodeName]=t.nodeValue),e)),{content:e.innerHTML}),r={component:t,style:s,class:a,props:l||{}};return o.$options.components[e.nodeName]=t,r}))}))),this.loading=!1},async refreshDashboard(){this.loading=!0,this.widgets=[];const e=this.$route.params.name,t=await this.request("config.get_dashboard",{name:e});t||this.notifyError(`Dashboard ${e} not found`),this.parseTemplate(e,t)}},mounted(){if(this.refreshDashboard(),this.refreshSeconds){const e=this;setInterval((()=>{e.refreshDashboard()}),parseInt((1e3*this.refreshSeconds).toFixed(0)))}}};const Ce=(0,x.Z)(xe,[["render",he],["__scopeId","data-v-54e0248a"]]);var De=Ce;function Ie(e,t,n,s,o,a){return(0,i.wg)(),(0,i.iD)("h1",null,"Object not found")}var Te={name:"NotFound"};const $e=(0,x.Z)(Te,[["render",Ie]]);var Se=$e;const qe=e=>((0,i.dD)("data-v-af0b14d0"),e=e(),(0,i.Cn)(),e),Ue={class:"login-container"},Ee={class:"login",method:"POST"},Me=(0,i.uE)('<div class="header" data-v-af0b14d0><span class="logo" data-v-af0b14d0><img src="/logo.svg" alt="logo" data-v-af0b14d0></span><span class="text" data-v-af0b14d0>Platypush</span></div><div class="row" data-v-af0b14d0><label data-v-af0b14d0><input type="text" name="username" placeholder="Username" data-v-af0b14d0></label></div><div class="row" data-v-af0b14d0><label data-v-af0b14d0><input type="password" name="password" placeholder="Password" data-v-af0b14d0></label></div>',3),Pe={key:0,class:"row"},je=qe((()=>(0,i._)("label",null,[(0,i._)("input",{type:"password",name:"confirm_password",placeholder:"Confirm password"})],-1))),Oe=[je],Ze={class:"row buttons"},Ne=["value"],We=qe((()=>(0,i._)("div",{class:"row pull-right"},[(0,i._)("label",{class:"checkbox"},[(0,i._)("input",{type:"checkbox",name:"remember"}),(0,i.Uk)("  Keep me logged in on this device   ")])],-1)));function Re(e,t,n,s,o,a){return(0,i.wg)(),(0,i.iD)("div",Ue,[(0,i._)("form",Ee,[Me,a._register?((0,i.wg)(),(0,i.iD)("div",Pe,Oe)):(0,i.kq)("",!0),(0,i._)("div",Ze,[(0,i._)("input",{type:"submit",class:"btn btn-primary",value:a._register?"Register":"Login"},null,8,Ne)]),We])])}var ze={name:"Login",mixins:[S.Z],props:{register:{type:Boolean,required:!1,default:!1}},computed:{_register(){return this.parseBoolean(this.register)}}};const Ae=(0,x.Z)(ze,[["render",Re],["__scopeId","data-v-af0b14d0"]]);var Le=Ae;function Fe(e,t,n,s,o,a){const l=(0,i.up)("Login");return(0,i.wg)(),(0,i.j4)(l,{register:!0})}var Be={name:"Register",mixins:[Le],components:{Login:Le},props:{register:{type:Boolean,required:!1,default:!0}}};const He=(0,x.Z)(Be,[["render",Fe]]);var Ve=He;const Ye={key:2,class:"canvas"},Ke={class:"panel"},Je={key:3,class:"canvas"},Ge={class:"panel"},Xe={key:4,class:"canvas"};function Qe(e,t,n,s,o,a){const l=(0,i.up)("Loading"),r=(0,i.up)("Nav"),d=(0,i.up)("Settings"),u=(0,i.up)("Extensions");return(0,i.wg)(),(0,i.iD)("main",null,[o.loading?((0,i.wg)(),(0,i.j4)(l,{key:0})):((0,i.wg)(),(0,i.j4)(r,{key:1,panels:o.components,"selected-panel":o.selectedPanel,"selected-config-panel":o.selectedConfigPanel,hostname:o.hostname,onSelect:t[0]||(t[0]=e=>o.selectedPanel=e),onSelectConfig:t[1]||(t[1]=e=>o.selectedConfigPanel=e)},null,8,["panels","selected-panel","selected-config-panel","hostname"])),"settings"===o.selectedPanel?((0,i.wg)(),(0,i.iD)("div",Ye,[(0,i._)("div",Ke,[(0,i.Wm)(d,{"selected-panel":o.selectedConfigPanel},null,8,["selected-panel"])])])):"extensions"===o.selectedPanel?((0,i.wg)(),(0,i.iD)("div",Je,[(0,i._)("div",Ge,[(0,i.Wm)(u)])])):((0,i.wg)(),(0,i.iD)("div",Xe,[((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(o.components,((e,t)=>((0,i.wg)(),(0,i.iD)("div",{class:(0,c.C_)(["panel",{hidden:t!==o.selectedPanel}]),key:t},[t===o.selectedPanel?((0,i.wg)(),(0,i.j4)((0,i.LL)(e.component),{key:0,config:e.config,"plugin-name":t},null,8,["config","plugin-name"])):(0,i.kq)("",!0)],2)))),128))]))])}const et=e=>((0,i.dD)("data-v-9e364322"),e=e(),(0,i.Cn)(),e),tt=et((()=>(0,i._)("i",{class:"fas fa-bars"},null,-1))),nt=["textContent"],st=["title"],it={key:0,class:"plugins"},ot={href:"/#"},at=et((()=>(0,i._)("i",{class:"fas fa-home"},null,-1))),lt={key:0,class:"name"},rt=["title","onClick"],ct={href:"/#settings"},dt={class:"icon"},ut=["src"],ht={key:2,class:"fas fa-puzzle-piece"},pt=["textContent"],ft={key:1,class:"plugins"},mt=["title","onClick"],gt=["href"],bt={class:"icon"},yt=["src"],wt={key:2,class:"fas fa-puzzle-piece"},vt=["textContent"],kt={class:"footer"},_t={href:"/#extensions"},xt=et((()=>(0,i._)("span",{class:"icon"},[(0,i._)("i",{class:"fa fa-puzzle-piece"})],-1))),Ct={key:0,class:"name"},Dt={href:"/#settings"},It=et((()=>(0,i._)("span",{class:"icon"},[(0,i._)("i",{class:"fa fa-cog"})],-1))),Tt={key:0,class:"name"},$t={href:"/logout"},St=et((()=>(0,i._)("span",{class:"icon"},[(0,i._)("i",{class:"fas fa-sign-out-alt"})],-1))),qt={key:0,class:"name"};function Ut(e,t,n,s,o,a){return(0,i.wg)(),(0,i.iD)("nav",{class:(0,c.C_)({collapsed:o.collapsed})},[(0,i._)("div",{class:"toggler",onClick:t[0]||(t[0]=e=>o.collapsed=!o.collapsed)},[tt,n.hostname?((0,i.wg)(),(0,i.iD)("span",{key:0,class:"hostname",textContent:(0,c.zw)(n.hostname)},null,8,nt)):(0,i.kq)("",!0),(0,i._)("i",{class:(0,c.C_)(["icon status fas fa-circle",{ok:o.connected,error:!o.connected}]),title:o.connected?"Connected":"Disconnected"},null,10,st)]),"settings"===n.selectedPanel?((0,i.wg)(),(0,i.iD)("ul",it,[(0,i._)("li",{class:"entry",title:"Home",onClick:t[1]||(t[1]=e=>a.onItemClick("entities"))},[(0,i._)("a",ot,[at,o.collapsed?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("span",lt,"Home"))])]),((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(o.configSections,((t,s)=>((0,i.wg)(),(0,i.iD)("li",{key:s,class:(0,c.C_)(["entry",{selected:s===n.selectedConfigPanel}]),title:t.name,onClick:t=>e.$emit("select-config",s)},[(0,i._)("a",ct,[(0,i._)("span",dt,[t.icon?.["class"]?((0,i.wg)(),(0,i.iD)("i",{key:0,class:(0,c.C_)(t.icon["class"])},null,2)):t.icon?.imgUrl?((0,i.wg)(),(0,i.iD)("img",{key:1,src:t.icon?.imgUrl,alt:"name"},null,8,ut)):((0,i.wg)(),(0,i.iD)("i",ht))]),o.collapsed?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("span",{key:0,class:"name",textContent:(0,c.zw)(t.name)},null,8,pt))])],10,rt)))),128))])):((0,i.wg)(),(0,i.iD)("ul",ft,[((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(a.panelNames,(e=>((0,i.wg)(),(0,i.iD)("li",{key:e,class:(0,c.C_)(["entry",{selected:e===n.selectedPanel}]),title:e,onClick:t=>a.onItemClick(e)},[(0,i._)("a",{href:`/#${e}`},[(0,i._)("span",bt,[o.icons[e]?.class?((0,i.wg)(),(0,i.iD)("i",{key:0,class:(0,c.C_)(o.icons[e].class)},null,2)):o.icons[e]?.imgUrl?((0,i.wg)(),(0,i.iD)("img",{key:1,src:o.icons[e].imgUrl,alt:"name"},null,8,yt)):((0,i.wg)(),(0,i.iD)("i",wt))]),o.collapsed?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("span",{key:0,class:"name",textContent:(0,c.zw)(a.displayName(e))},null,8,vt))],8,gt)],10,mt)))),128))])),(0,i._)("ul",kt,[(0,i._)("li",{class:(0,c.C_)({selected:"extensions"===n.selectedPanel}),title:"Extensions",onClick:t[2]||(t[2]=e=>a.onItemClick("extensions"))},[(0,i._)("a",_t,[xt,o.collapsed?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("span",Ct,"Extensions"))])],2),(0,i._)("li",{class:(0,c.C_)({selected:"settings"===n.selectedPanel}),title:"Settings",onClick:t[3]||(t[3]=e=>a.onItemClick("settings"))},[(0,i._)("a",Dt,[It,o.collapsed?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("span",Tt,"Settings"))])],2),(0,i._)("li",{title:"Logout",onClick:t[4]||(t[4]=e=>a.onItemClick("logout"))},[(0,i._)("a",$t,[St,o.collapsed?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("span",qt,"Logout"))])])])],2)}var Et=n(1359),Mt=JSON.parse('{"users":{"name":"Users","icon":{"class":"fas fa-user"}},"tokens":{"name":"Tokens","icon":{"class":"fas fa-key"}},"application":{"name":"Application","icon":{"class":"fas fa-gears"}}}'),Pt={name:"Nav",emits:["select","select-config"],mixins:[S.Z],props:{panels:{type:Object,required:!0},selectedPanel:{type:String},selectedConfigPanel:{type:String},hostname:{type:String}},computed:{panelNames(){const e=(e,n)=>{const s=t.indexOf(n);return s>=0&&(e=[n].concat(e.slice(0,s).concat(e.slice(s+1)))),e};let t=Object.keys(this.panels).sort();return t=e(t,"execute"),t=e(t,"entities"),t},collapsedDefault(){return!(!this.isMobile()&&!this.isTablet())}},methods:{onItemClick(e){this.$emit("select",e),this.collapsed=!!this.isMobile()||this.collapsedDefault},displayName(e){return"entities"===e?"Home":"execute"===e?"Execute":e},setConnected(e){return()=>{this.connected=e}}},data(){return{collapsed:!0,connected:!1,icons:Et,host:null,configSections:Mt}},mounted(){this.collapsed=this.collapsedDefault,U.$.on("connect",this.setConnected(!0)),U.$.on("disconnect",this.setConnected(!1))}};const jt=(0,x.Z)(Pt,[["render",Ut],["__scopeId","data-v-9e364322"]]);var Ot=jt,Zt=n(7092),Nt=n(3136),Wt={name:"Panel",mixins:[S.Z],components:{Extensions:Zt["default"],Settings:Nt["default"],Nav:Ot,Loading:fe.Z},data(){return{loading:!1,plugins:{},backends:{},procedures:{},components:{},hostname:void 0,selectedPanel:void 0,selectedConfigPanel:"users"}},methods:{initSelectedPanel(){const e=this.$route.hash.match("#?([a-zA-Z0-9.]+)[?]?(.*)"),t=e?e[1]:"entities";t?.length&&(this.selectedPanel=t)},initPanels(){const e=this;this.components={},Object.entries(this.plugins).forEach((async([t,s])=>{const o=t.split(".").map((e=>e[0].toUpperCase()+e.slice(1))).join("");let a=null;try{a=await n(3379)(`./${o}/Index`)}catch(r){return}const l=(0,pe.XI)((0,i.RC)((async()=>a)));e.$options.components[t]=l,e.components[t]={component:l,pluginName:t,config:s}}))},async parseConfig(){[this.plugins,this.backends,this.procedures,this.hostname]=await Promise.all([this.request("config.get_plugins"),this.request("config.get_backends"),this.request("config.get_procedures"),this.request("config.get_device_id")]),this.initializeDefaultViews()},initializeDefaultViews(){this.plugins.entities={},this.plugins.execute={}}},async mounted(){this.loading=!0;try{await this.parseConfig(),this.initPanels(),this.initSelectedPanel(),this.$watch("$route.hash",this.initSelectedPanel)}finally{this.loading=!1}}};const Rt=(0,x.Z)(Wt,[["render",Qe],["__scopeId","data-v-563b4477"]]);var zt=Rt;const At={key:1,class:"canvas"};function Lt(e,t,n,s,o,a){const l=(0,i.up)("Loading");return(0,i.wg)(),(0,i.iD)("main",null,[o.loading?((0,i.wg)(),(0,i.j4)(l,{key:0})):((0,i.wg)(),(0,i.iD)("div",At,[((0,i.wg)(),(0,i.j4)((0,i.LL)(o.component),{config:o.config,"plugin-name":a.pluginName},null,8,["config","plugin-name"]))]))])}var Ft={name:"Panel",mixins:[S.Z],components:{Settings:Nt["default"],Nav:Ot,Loading:fe.Z},data(){return{loading:!1,config:{},plugins:{},backends:{},procedures:{},component:void 0,hostname:void 0,selectedPanel:void 0}},computed:{pluginName(){return this.$route.params.plugin}},methods:{async initPanel(){const e=this.pluginName.split(".").map((e=>e[0].toUpperCase()+e.slice(1))).join("");let t=null;try{t=await n(3379)(`./${e}/Index`)}catch(s){return console.error(s),void this.notify({error:!0,title:`Cannot load plugin ${this.pluginName}`,text:s.toString()})}this.component=(0,pe.XI)((0,i.RC)((async()=>t))),this.$options.components[e]=this.component},async initConfig(){const e=await this.request("config.get");this.config=e[this.pluginName]||{},this.hostname=await this.request("config.get_device_id")}},async mounted(){this.loading=!0;try{await this.initConfig(),await this.initPanel()}finally{this.loading=!1}}};const Bt=(0,x.Z)(Ft,[["render",Lt],["__scopeId","data-v-e339182c"]]);var Ht=Bt;const Vt=[{path:"/",name:"Panel",component:zt},{path:"/dashboard/:name",name:"Dashboard",component:De},{path:"/plugin/:plugin",name:"Plugin",component:Ht},{path:"/login",name:"Login",component:Le},{path:"/register",name:"Register",component:Ve},{path:"/:catchAll(.*)",component:Se}],Yt=(0,ue.p7)({history:(0,ue.PO)(),routes:Vt});var Kt=Yt,Jt=n(5205);(0,Jt.z)("/service-worker.js",{ready(){console.log("App is being served from cache by a service worker.\nFor more details, visit https://goo.gl/AFskqB")},registered(){console.log("Service worker has been registered.")},cached(){console.log("Content has been cached for offline use.")},updatefound(){console.log("New content is downloading.")},updated(){console.log("New content is available; please refresh.")},offline(){console.log("No internet connection found. App is running in offline mode.")},error(e){console.error("Error during service worker registration:",e)}});const Gt=(0,s.ri)(de);Gt.config.globalProperties._config=window.config,Gt.use(Kt).mount("#app")},8637:function(e,t,n){"use strict";n.d(t,{Z:function(){return z}});var s=n(9669),i=n.n(s),o={name:"Api",methods:{execute(e,t=6e4,n=!0){const s={};return"target"in e&&e["target"]||(e["target"]="localhost"),"type"in e&&e["type"]||(e["type"]="request"),t&&(s.timeout=t),new Promise(((t,o)=>{i().post("/execute",e,s).then((e=>{if(e=e.data.response,e.errors?.length){const t=e.errors?.[0]||e;this.notify({text:t,error:!0}),o(t)}else t(e.output)})).catch((e=>{412===e?.response?.data?.code&&window.location.href.indexOf("/register")<0?window.location.href="/register?redirect="+window.location.href:401===e?.response?.data?.code&&window.location.href.indexOf("/login")<0?window.location.href="/login?redirect="+window.location.href:(console.log(e),n&&this.notify({text:e,error:!0}),o(e))}))}))},request(e,t={},n=6e4,s=!0){return this.execute({type:"request",action:e,args:t},n,s)}}};const a=o;var l=a,r={name:"Clipboard",methods:{async copyToClipboard(e){await navigator.clipboard.writeText(e),this.notify({text:"Copied to the clipboard",image:{icon:"clipboard"}})}}};const c=r;var d=c,u={name:"Cookies",methods:{getCookies(){return document.cookie.split(/;\s*/).reduce(((e,t)=>{const[n,s]=t.split("=");return e[n]=s,e}),{})},getCookie(e){return this.getCookies()[e]},setCookie(e,t,n){document.cookie=`${e}=${t}; path=${n?.path||"/"}`+(n?.expires?`; expires=${n?.expires.toISOString()}`:"")},deleteCookie(e){document.cookie=`${e}=; expires=1970-01-01T00:00:00Z`}}};const h=u;var p=h,f={name:"DateTime",methods:{formatDate(e,t=!1){return"string"===typeof e&&(e=new Date(Date.parse(e))),e.toDateString().substring(0,t?15:10)},formatTime(e,t=!0){return"string"===typeof e&&(e=new Date(Date.parse(e))),e.toTimeString().substring(0,t?8:5)},formatDateTime(e,t=!1,n=!0){return"string"===typeof e&&(e=new Date(Date.parse(e))),`${this.formatDate(e,t)}, ${this.formatTime(e,n)}`}}};const m=f;var g=m,b=(n(2801),n(5250)),y={name:"Events",computed:{_eventsReady(){return this.$root.$refs.events?.initialized}},methods:{subscribe(e,t,...n){const s=()=>{b.$.emit("subscribe",{events:n,handler:e,handlerName:t||this.generateId()})};if(this._eventsReady)return void s();const i=this,o=this.$watch((()=>i._eventsReady),(e=>{e&&(s(),o())}));return o},unsubscribe(e){b.$.emit("unsubscribe",e)},generateId(){return btoa([...Array(11).keys()].map((()=>String.fromCharCode(Math.round(255*Math.random())))))}}};const w=y;var v=w,k={name:"Extensions",methods:{pluginDisplayName(e){const t=e.split(".");return t.forEach(((e,n)=>{t[n]=e.charAt(0).toUpperCase()+e.slice(1)})),t.length>1&&(t[0]=`[${t[0]}]`),t.join(" ")}}};const _=k;var x=_,C={name:"Notification",methods:{notify(e){b.$.publishNotification(e)},notifyWarning(e){this.notify({text:e,warning:!0})},notifyError(e){throw this.notify({text:e,error:!0}),e}}};const D=C;var I=D,T={name:"Screen",methods:{isMobile(){return window.matchMedia("only screen and (max-width: 768px)").matches},isTablet(){return!this.isMobile()&&window.matchMedia("only screen and (max-width: 1023px)").matches},isDesktop(){return window.matchMedia("only screen and (min-width: 1024px)").matches}}};const $=T;var S=$,q={name:"Text",methods:{capitalize(e){return e?.length?e.charAt(0).toUpperCase()+e.slice(1):e},prettify(e){return e.split("_").map((e=>this.capitalize(e))).join(" ")},indent(e,t=2){return e.split("\n").map((e=>`${" ".repeat(t)}${e}`)).join("\n")}}};const U=q;var E=U,M=(n(7658),{name:"Types",methods:{parseBoolean(e){return"string"===typeof e?(e=e.toLowerCase(),"true"===e||"false"!==e&&!!parseInt(e)):!!e},convertSize(e){"string"===typeof e&&(e=parseInt(e));let t=null;const n=["B","KB","MB","GB","TB"];return n.forEach(((s,i)=>{e<=1024&&null==t?t=s:e>1024&&(i===n.length-1?t=s:e/=1024)})),`${e.toFixed(2)} ${t}`},convertTime(e){const t={},n=[];if(e=parseFloat(e),t.d=Math.round(e/86400),t.h=Math.round(e/3600-24*t.d),t.m=Math.round(e/60-(24*t.d+60*t.h)),t.s=Math.round(e-(24*t.d+3600*t.h+60*t.m),1),parseInt(t.d)){let e=t.d+" day";t.d>1&&(e+="s"),n.push(e)}if(parseInt(t.h)){let e=t.h+" hour";t.h>1&&(e+="s"),n.push(e)}if(parseInt(t.m)){let e=t.m+" minute";t.m>1&&(e+="s"),n.push(e)}let s=t.s+" second";return t.s>1&&(s+="s"),n.push(s),n.join(" ")},objectsEqual(e,t){if("object"!==typeof e||"object"!==typeof t)return!1;if(null==e||null==t)return null==e&&null==t;for(const n of Object.keys(e||{}))switch(typeof e[n]){case"object":if(!this.objectsEqual(e[n],t[n]))return!1;break;case"function":if(e[n].toString()!=t[n]?.toString())return!1;break;default:if(e[n]!=t[n])return!1;break}for(const n of Object.keys(t||{}))if(null==e[n]&&null!=t[n])return!1;return!0}}});const P=M;var j=P,O={name:"Url",methods:{parseUrlFragment(){return window.location.href.replace(/.*#(\w+)[?;]?.*/,"$1")},getUrlArgs(){return window.location.href.replace(/.*#/,"").replace(/.*\?/,"").split(/[&;]/).reduce(((e,t)=>{const n=t.split("=");return e[n[0]]=n[1],e}),{})},setUrlArgs(e){window.location.href=`/#${this.parseUrlFragment()}?${this.fragmentFromArgs(e)}`},fragmentFromArgs(e){return Object.entries(e).map((([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`)).join("&")}}};const Z=O;var N=Z,W={name:"Utils",mixins:[l,d,p,g,v,I,x,S,E,j,N]};const R=W;var z=R},6791:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var s=n(6252);const i={class:"loading"},o={class:"icon"};function a(e,t){return(0,s.wg)(),(0,s.iD)("div",i,[(0,s._)("div",o,[((0,s.wg)(),(0,s.iD)(s.HY,null,(0,s.Ko)(4,(e=>(0,s._)("div",{key:e}))),64))])])}var l=n(3744);const r={},c=(0,l.Z)(r,[["render",a],["__scopeId","data-v-4d9c871b"]]);var d=c},9417:function(e,t,n){"use strict";n.d(t,{Z:function(){return g}});var s=n(6252),i=n(3577);const o=e=>((0,s.dD)("data-v-18f9fdba"),e=e(),(0,s.Cn)(),e),a=["id"],l={key:0,class:"header"},r=["textContent"],c=o((()=>(0,s._)("i",{class:"fas fa-xmark"},null,-1))),d=[c],u={class:"body"};function h(e,t,n,o,c,h){return(0,s.wg)(),(0,s.iD)("div",{class:(0,i.C_)(["modal-container fade-in",{hidden:!c.isVisible}]),id:n.id,style:(0,i.j5)({"--z-index":h.zIndex}),onClick:t[3]||(t[3]=(...e)=>h.close&&h.close(...e))},[(0,s._)("div",{class:(0,i.C_)(["modal",e.$attrs.class])},[(0,s._)("div",{class:"content",style:(0,i.j5)({"--width":n.width,"--height":n.height}),onClick:t[2]||(t[2]=e=>e.stopPropagation())},[n.title?((0,s.wg)(),(0,s.iD)("div",l,[n.title?((0,s.wg)(),(0,s.iD)("div",{key:0,class:"title",textContent:(0,i.zw)(n.title)},null,8,r)):(0,s.kq)("",!0),(0,s._)("button",{title:"Close",alt:"Close",onClick:t[0]||(t[0]=(...e)=>h.close&&h.close(...e))},d)])):(0,s.kq)("",!0),(0,s._)("div",u,[(0,s.WI)(e.$slots,"default",{onModalClose:t[1]||(t[1]=(...e)=>h.close&&h.close(...e))},void 0,!0)])],4)],2)],14,a)}n(7658);var p={name:"Modal",emits:["close","open"],props:{id:{type:String},title:{type:String},width:{type:[Number,String]},height:{type:[Number,String]},visible:{type:Boolean,default:!1},timeout:{type:[Number,String]},level:{type:Number,default:1}},data(){return{timeoutId:void 0,prevVisible:this.visible,isVisible:this.visible}},computed:{zIndex(){return 500+this.level}},methods:{close(){this.prevVisible=this.isVisible,this.isVisible=!1},hide(){this.close()},show(){this.prevVisible=this.isVisible,this.isVisible=!0},toggle(){this.isVisible?this.close():this.show()},onKeyUp(e){e.stopPropagation(),"Escape"===e.key&&this.close()}},mounted(){const e=this,t=t=>{t?e.$emit("open"):e.$emit("close"),e.isVisible=t};document.body.addEventListener("keyup",this.onKeyUp),this.$watch((()=>this.visible),t),this.$watch((()=>this.isVisible),t)},unmounted(){document.body.removeEventListener("keyup",this.onKeyUp)},updated(){if(this.prevVisible=this.isVisible,this.isVisible){let e=parseInt(getComputedStyle(this.$el).zIndex),t=[];for(const n of document.querySelectorAll(".modal-container:not(.hidden)")){const s=parseInt(getComputedStyle(n).zIndex);s>e?(e=s,t=[n]):s===e&&t.push(n)}(t.indexOf(this.$el)<0||t.length>1)&&(this.$el.style.zIndex=e+1)}if(this.isVisible&&this.timeout&&!this.timeoutId){const e=e=>()=>{e.close(),e.timeoutId=void 0};this.timeoutId=setTimeout(e(this),0+this.timeout)}}},f=n(3744);const m=(0,f.Z)(p,[["render",h],["__scopeId","data-v-18f9fdba"]]);var g=m},6936:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var s=n(6252),i=n(9963),o=n(3577);const a=e=>((0,s.dD)("data-v-db648f4c"),e=e(),(0,s.Cn)(),e),l={class:"dialog-content"},r=a((()=>(0,s._)("i",{class:"fas fa-check"},null,-1))),c=a((()=>(0,s._)("i",{class:"fas fa-xmark"},null,-1)));function d(e,t,n,a,d,u){const h=(0,s.up)("Modal");return(0,s.wg)(),(0,s.j4)(h,{ref:"modal",title:n.title},{default:(0,s.w5)((()=>[(0,s._)("div",l,[(0,s.WI)(e.$slots,"default",{},void 0,!0)]),(0,s._)("form",{class:"buttons",onSubmit:t[4]||(t[4]=(0,i.iM)(((...e)=>u.onConfirm&&u.onConfirm(...e)),["prevent"]))},[(0,s._)("button",{type:"submit",class:"ok-btn",onClick:t[0]||(t[0]=(...e)=>u.onConfirm&&u.onConfirm(...e)),onTouch:t[1]||(t[1]=(...e)=>u.onConfirm&&u.onConfirm(...e))},[r,(0,s.Uk)("   "+(0,o.zw)(n.confirmText),1)],32),(0,s._)("button",{type:"button",class:"cancel-btn",onClick:t[2]||(t[2]=(...e)=>u.close&&u.close(...e)),onTouch:t[3]||(t[3]=(...e)=>u.close&&u.close(...e))},[c,(0,s.Uk)("   "+(0,o.zw)(n.cancelText),1)],32)],32)])),_:3},8,["title"])}var u=n(9417),h={emits:["input","click","touch"],components:{Modal:u.Z},props:{title:{type:String},confirmText:{type:String,default:"OK"},cancelText:{type:String,default:"Cancel"}},methods:{onConfirm(){this.$emit("input"),this.close()},show(){this.$refs.modal.show()},close(){this.$refs.modal.hide()}}},p=n(3744);const f=(0,p.Z)(h,[["render",d],["__scopeId","data-v-db648f4c"]]);var m=f},7261:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var s=n(6252),i=n(9963),o=n(3577);const a={class:"dropdown-container",ref:"container"},l=["title"],r=["textContent"],c=["id"];function d(e,t,n,d,u,h){return(0,s.wg)(),(0,s.iD)("div",a,[(0,s._)("button",{title:n.title,ref:"button",onClick:t[0]||(t[0]=(0,i.iM)((e=>h.toggle(e)),["stop"]))},[n.iconClass?((0,s.wg)(),(0,s.iD)("i",{key:0,class:(0,o.C_)(["icon",n.iconClass])},null,2)):(0,s.kq)("",!0),n.text?((0,s.wg)(),(0,s.iD)("span",{key:1,class:"text",textContent:(0,o.zw)(n.text)},null,8,r)):(0,s.kq)("",!0)],8,l),(0,s._)("div",{class:(0,o.C_)(["dropdown fade-in",{hidden:!u.visible}]),id:n.id,ref:"dropdown"},[(0,s.WI)(e.$slots,"default",{},void 0,!0)],10,c)],512)}var u={name:"Dropdown",emits:["click"],props:{id:{type:String},items:{type:Array,default:()=>[]},iconClass:{default:"fa fa-ellipsis-h"},text:{type:String},title:{type:String},keepOpenOnItemClick:{type:Boolean,default:!1}},data(){return{visible:!1}},methods:{documentClickHndl(e){if(!this.visible)return;let t=e.target;while(t){if(!this.$refs.dropdown)break;if(t===this.$refs.dropdown.element)return;t=t.parentElement}this.close()},close(){this.visible=!1,document.removeEventListener("click",this.documentClickHndl)},open(){document.addEventListener("click",this.documentClickHndl),this.visible=!0,setTimeout((()=>{const e=this.$refs.dropdown;e.style.left=0,e.style.top=parseFloat(getComputedStyle(this.$refs.button).height)+"px",e.getBoundingClientRect().left>window.innerWidth/2&&(e.style.left=-e.clientWidth+parseFloat(getComputedStyle(this.$refs.button).width)+"px"),e.getBoundingClientRect().top>window.innerHeight/2&&(e.style.top=-e.clientHeight+parseFloat(getComputedStyle(this.$refs.button).height)+"px")}),10)},toggle(e){e.stopPropagation(),this.$emit("click"),this.visible?this.close():this.open()},onKeyUp(e){e.stopPropagation(),"Escape"===e.key&&this.close()}},mounted(){document.body.addEventListener("keyup",this.onKeyUp)},unmounted(){document.body.removeEventListener("keyup",this.onKeyUp)}},h=n(3744);const p=(0,h.Z)(u,[["render",d],["__scopeId","data-v-5b964c03"]]);var f=p},1189:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var s=n(6252),i=n(3577);const o={key:0,class:"col-2 icon"},a=["textContent"];function l(e,t,n,l,r,c){const d=(0,s.up)("Icon");return(0,s.wg)(),(0,s.iD)("div",{class:(0,i.C_)(["row item",n.itemClass]),onClick:t[0]||(t[0]=(...e)=>c.clicked&&c.clicked(...e))},[n.iconClass?.length||n.iconUrl?.length?((0,s.wg)(),(0,s.iD)("div",o,[(0,s.Wm)(d,{class:(0,i.C_)(n.iconClass),url:n.iconUrl},null,8,["class","url"])])):(0,s.kq)("",!0),(0,s._)("div",{class:(0,i.C_)(["text",{"col-10":null!=n.iconClass}]),textContent:(0,i.zw)(n.text)},null,10,a)],2)}var r=n(657),c={name:"DropdownItem",components:{Icon:r.Z},props:{iconClass:{type:String},iconUrl:{type:String},text:{type:String},disabled:{type:Boolean,default:!1},itemClass:{}},methods:{clicked(e){if(this.disabled)return!1;this.$parent.$emit("click",e),this.$parent.keepOpenOnItemClick||(this.$parent.visible=!1)}}},d=n(3744);const u=(0,d.Z)(c,[["render",l],["__scopeId","data-v-29ddda9f"]]);var h=u},657:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var s=n(6252),i=n(3577);const o={class:"icon-container"},a=["src","alt"];function l(e,t,n,l,r,c){return(0,s.wg)(),(0,s.iD)("div",o,[n.url?.length?((0,s.wg)(),(0,s.iD)("img",{key:0,class:"icon",src:n.url,alt:n.alt},null,8,a)):c.className?.length?((0,s.wg)(),(0,s.iD)("i",{key:1,class:(0,i.C_)(["icon",c.className]),style:(0,i.j5)({color:n.color})},null,6)):(0,s.kq)("",!0)])}var r={props:{class:{type:String},url:{type:String},color:{type:String,default:""},alt:{type:String,default:""}},computed:{className(){return this.class}}},c=n(3744);const d=(0,c.Z)(r,[["render",l],["__scopeId","data-v-706a3bd1"]]);var u=d},2717:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var s=n(6252);const i=e=>((0,s.dD)("data-v-2edff8b7"),e=e(),(0,s.Cn)(),e),o={class:"restart-btn-container"},a=i((()=>(0,s._)("i",{class:"fas fa-redo-alt"},null,-1)));function l(e,t,n,i,l,r){const c=(0,s.up)("ConfirmDialog");return(0,s.wg)(),(0,s.iD)("div",o,[(0,s.Wm)(c,{ref:"modal",onInput:r.restart},{default:(0,s.w5)((()=>[(0,s.Uk)(" Are you sure that you want to restart the application? ")])),_:1},8,["onInput"]),(0,s._)("button",{class:"btn btn-default restart-btn",onClick:t[0]||(t[0]=(...e)=>r.showDialog&&r.showDialog(...e)),onTouch:t[1]||(t[1]=(...e)=>r.showDialog&&r.showDialog(...e))},[a,(0,s.Uk)("   Restart Application ")],32)])}var r=n(6936),c=n(8637),d={name:"RestartButton",components:{ConfirmDialog:r.Z},mixins:[c.Z],methods:{showDialog(){this.$refs.modal.show()},async restart(){await this.request("application.restart")}}},u=n(3744);const h=(0,u.Z)(d,[["render",l],["__scopeId","data-v-2edff8b7"]]);var p=h},8615:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var s=n(6252),i=n(3577);const o={key:0,class:"icon"};function a(e,t,n,a,l,r){const c=(0,s.up)("Icon");return(0,s.wg)(),(0,s.iD)("div",{class:(0,i.C_)(["tab",n.selected?"selected":""]),onClick:t[0]||(t[0]=t=>e.$emit("input"))},[n.iconClass?.length||n.iconUrl?.length?((0,s.wg)(),(0,s.iD)("span",o,[(0,s.Wm)(c,{class:(0,i.C_)(n.iconClass),url:n.iconUrl},null,8,["class","url"])])):(0,s.kq)("",!0),(0,s.Uk)("   "),(0,s.WI)(e.$slots,"default",{},void 0,!0)],2)}var l=n(657),r={name:"Tab",components:{Icon:l.Z},emits:["input"],props:{selected:{type:Boolean,default:!1},iconClass:{type:String},iconUrl:{type:String}}},c=n(3744);const d=(0,c.Z)(r,[["render",a],["__scopeId","data-v-9dc3b3b6"]]);var u=d},3176:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var s=n(6252);const i={class:"tabs"};function o(e,t,n,o,a,l){return(0,s.wg)(),(0,s.iD)("div",i,[(0,s.WI)(e.$slots,"default",{},void 0,!0)])}var a={name:"Tabs"},l=n(3744);const r=(0,l.Z)(a,[["render",o],["__scopeId","data-v-f4300bb0"]]);var c=r},7092:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return Me}});var s=n(6252),i=n(9963),o=n(3577);const a={class:"row plugin extensions-container"},l={class:"filter-container"},r=["disabled"],c={class:"items"},d={key:0,class:"extension"},u=["data-name","onClick"],h={class:"name"},p={key:0,class:"enabled icon",title:"Enabled"},f={key:0,class:"enabled icon fas fa-circle-check"},m={key:0,class:"extension-body-container until tablet"},g={key:0,class:"extension-body-container from desktop"};function b(e,t,n,b,y,w){const v=(0,s.up)("Loading"),k=(0,s.up)("Extension");return(0,s.wg)(),(0,s.iD)("div",a,[y.loading?((0,s.wg)(),(0,s.j4)(v,{key:0})):(0,s.kq)("",!0),(0,s._)("header",null,[(0,s._)("div",l,[(0,s.wy)((0,s._)("input",{type:"text",ref:"filter",placeholder:"Extension name","onUpdate:modelValue":t[0]||(t[0]=e=>y.filter=e),disabled:y.loading},null,8,r),[[i.nr,y.filter]])])]),(0,s._)("main",null,[(0,s._)("div",c,[((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(w.extensionNames,(e=>((0,s.wg)(),(0,s.iD)("div",{class:"extension-container",key:e},[w.matchesFilter(e)?((0,s.wg)(),(0,s.iD)("div",d,[(0,s._)("div",{class:(0,o.C_)(["item",{selected:e===y.selectedExtension}]),"data-name":e,onClick:t=>w.onClick(e,!1)},[(0,s._)("span",h,(0,o.zw)(w.extensions[e].name),1),w.enabledExtensions[e]?((0,s.wg)(),(0,s.iD)("span",p,[w.enabledExtensions[e]?((0,s.wg)(),(0,s.iD)("i",f)):(0,s.kq)("",!0)])):(0,s.kq)("",!0)],10,u),y.selectedExtension&&e===y.selectedExtension?((0,s.wg)(),(0,s.iD)("div",m,[(0,s.Wm)(k,{extension:w.extensions[y.selectedExtension],config:w.enabledExtensions[y.selectedExtension],"config-file":y.configFile},null,8,["extension","config","config-file"])])):(0,s.kq)("",!0)])):(0,s.kq)("",!0)])))),128))]),y.selectedExtension?((0,s.wg)(),(0,s.iD)("div",g,[(0,s.Wm)(k,{extension:w.extensions[y.selectedExtension],config:w.enabledExtensions[y.selectedExtension],"config-file":y.configFile},null,8,["extension","config","config-file"])])):(0,s.kq)("",!0)])])}var y=n(6791),w=n(8637);const v=e=>((0,s.dD)("data-v-3fa6b036"),e=e(),(0,s.Cn)(),e),k={class:"extension"},_=v((()=>(0,s._)("span",{class:"from tablet"},"Documentation",-1))),x=v((()=>(0,s._)("span",{class:"from tablet"},"Install",-1))),C=v((()=>(0,s._)("span",{class:"from tablet"},"Configuration",-1))),D={class:"extension-body"};function I(e,t,n,i,o,a){const l=(0,s.up)("Tab"),r=(0,s.up)("Tabs"),c=(0,s.up)("Doc"),d=(0,s.up)("Config"),u=(0,s.up)("Install");return(0,s.wg)(),(0,s.iD)("div",k,[(0,s._)("header",null,[(0,s.Wm)(r,null,{default:(0,s.w5)((()=>[(0,s.Wm)(l,{selected:"doc"===o.selectedTab,"icon-class":"fas fa-book",onInput:t[0]||(t[0]=e=>o.selectedTab="doc")},{default:(0,s.w5)((()=>[_])),_:1},8,["selected"]),(0,s.Wm)(l,{selected:"install"===o.selectedTab,"icon-class":"fas fa-download",onInput:t[1]||(t[1]=e=>o.selectedTab="install")},{default:(0,s.w5)((()=>[x])),_:1},8,["selected"]),(0,s.Wm)(l,{selected:"config"===o.selectedTab,"icon-class":"fas fa-square-check",onInput:t[2]||(t[2]=e=>o.selectedTab="config")},{default:(0,s.w5)((()=>[C])),_:1},8,["selected"])])),_:1})]),(0,s._)("div",D,["doc"===o.selectedTab?((0,s.wg)(),(0,s.j4)(c,{key:0,extension:n.extension},null,8,["extension"])):"config"===o.selectedTab?((0,s.wg)(),(0,s.j4)(d,{key:1,extension:n.extension,config:n.config,"config-file":n.configFile},null,8,["extension","config","config-file"])):"install"===o.selectedTab?((0,s.wg)(),(0,s.j4)(u,{key:2,extension:n.extension},null,8,["extension"])):(0,s.kq)("",!0)])])}var T=n(8615),$=n(3176);const S={key:0,class:"config-container current"},q=["innerHTML"],U=["innerHTML"];function E(e,t,n,i,a,l){const r=(0,s.up)("CopyButton");return(0,s.wg)(),(0,s.iD)(s.HY,null,[l.highlightedCurrentConfig?((0,s.wg)(),(0,s.iD)("div",S,[(0,s.Wm)(r,{text:a.curYamlConfig},null,8,["text"]),(0,s._)("pre",null,[(0,s._)("code",{class:"config-snippet",innerHTML:l.highlightedCurrentConfig},null,8,q)])])):(0,s.kq)("",!0),(0,s._)("div",{class:(0,o.C_)(["config-container snippet",{fullscreen:!l.highlightedCurrentConfig}])},[(0,s.Wm)(r,{text:n.extension.config_snippet},null,8,["text"]),(0,s._)("pre",null,[(0,s._)("code",{class:"config-snippet",innerHTML:l.highlightedConfigSnippet},null,8,U)])],2)],64)}n(8783),n(3465);var M=n(637);const P=e=>((0,s.dD)("data-v-6be1edc1"),e=e(),(0,s.Cn)(),e),j=P((()=>(0,s._)("i",{class:"fas fa-clipboard"},null,-1))),O=[j];function Z(e,t,n,i,o,a){return(0,s.wg)(),(0,s.iD)("button",{class:"copy-button",ref:"copyButton",title:"Copy to clipboard",onClick:t[0]||(t[0]=(...e)=>a.copy&&a.copy(...e)),onInput:t[1]||(t[1]=(...e)=>a.copy&&a.copy(...e))},O,544)}var N={name:"CopyButton",emits:["input","click"],mixins:[w.Z],props:{text:{type:String}},methods:{async copy(e){this.text?.length&&await this.copyToClipboard(this.text),this.$emit(e.type,e)}}},W=n(3744);const R=(0,W.Z)(N,[["render",Z],["__scopeId","data-v-6be1edc1"]]);var z=R,A={name:"Extension",mixins:[w.Z],components:{CopyButton:z},props:{extension:{type:Object,required:!0},config:{type:Object},configFile:{type:String}},data(){return{curYamlConfig:null}},computed:{highlightedConfigSnippet(){return M.Z.highlight("yaml",`# Configuration template. You can add it to ${this.configFile}\n`+this.extension.config_snippet).value.trim()},highlightedCurrentConfig(){return this.curYamlConfig?M.Z.highlight("yaml","# Currently loaded configuration\n"+this.curYamlConfig).value.trim():null}},methods:{async loadCurrentConfig(){this.config?this.curYamlConfig=await this.request("utils.to_yaml",{obj:{[this.extension.name]:this.config}}):this.curYamlConfig=null}},mounted(){this.loadCurrentConfig(),this.$watch("config",this.loadCurrentConfig)}};const L=(0,W.Z)(A,[["render",E],["__scopeId","data-v-f988670a"]]);var F=L;const B=e=>((0,s.dD)("data-v-5aac2322"),e=e(),(0,s.Cn)(),e),H={class:"doc"},V=["href"],Y=B((()=>(0,s._)("i",{class:"icon fas fa-book"},null,-1))),K=["innerHTML"],J={key:0,class:"actions"},G=B((()=>(0,s._)("h3",null,[(0,s._)("i",{class:"icon fas fa-play"}),(0,s.Uk)("   Actions ")],-1))),X=["href"],Q={key:1,class:"events"},ee=B((()=>(0,s._)("h3",null,[(0,s._)("i",{class:"icon fas fa-flag"}),(0,s.Uk)("   Events ")],-1))),te=["href"];function ne(e,t,n,i,a,l){return(0,s.wg)(),(0,s.iD)("section",H,[(0,s._)("header",null,[(0,s._)("h2",null,[(0,s._)("a",{class:"title",href:n.extension.doc_url,target:"_blank"},[Y,(0,s.Uk)(" "+(0,o.zw)(n.extension.name),1)],8,V)])]),a.doc?((0,s.wg)(),(0,s.iD)("article",{key:0,onClick:t[0]||(t[0]=(...e)=>l.onDocClick&&l.onDocClick(...e))},[(0,s._)("div",{class:"doc-content",innerHTML:a.doc},null,8,K),Object.keys(n.extension.actions||{}).length>0?((0,s.wg)(),(0,s.iD)("div",J,[G,(0,s._)("ul",null,[((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(l.actionNames,(e=>((0,s.wg)(),(0,s.iD)("li",{class:"action",key:e},[(0,s._)("a",{href:`/#execute?action=${n.extension.name}.${e}`},(0,o.zw)(n.extension.name)+"."+(0,o.zw)(e),9,X)])))),128))])])):(0,s.kq)("",!0),Object.keys(n.extension.events||{}).length>0?((0,s.wg)(),(0,s.iD)("div",Q,[ee,(0,s._)("ul",null,[((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(l.eventNames,(e=>((0,s.wg)(),(0,s.iD)("li",{class:"event",key:e},[(0,s._)("a",{href:n.extension.events[e].doc_url,target:"_blank"},(0,o.zw)(e),9,te)])))),128))])])):(0,s.kq)("",!0)])):(0,s.kq)("",!0)])}var se=n(5250),ie={name:"Doc",mixins:[w.Z],props:{extension:{type:Object,required:!0}},data(){return{doc:null,localPageRegex:new RegExp("^/?#.*$")}},computed:{actionNames(){return Object.keys(this.extension.actions).sort()},eventNames(){return Object.keys(this.extension.events).sort()}},methods:{async parseDoc(){return this.extension.doc?.length?await this.request("utils.rst_to_html",{text:this.extension.doc}):null},refreshDoc(){this.parseDoc().then((e=>this.doc=e))},onDocClick(e){if("a"!==e.target.tagName.toLowerCase())return!0;e.preventDefault();const t=e.target.getAttribute("href");if(!t)return!0;if(t.match(this.localPageRegex))return window.location.href=t,!0;const n=t.match(/^https:\/\/docs\.platypush\.tech\/platypush\/(plugins|backend)\/([\w.]+)\.html#?.*$/);if(!n)return e.preventDefault(),window.open(t,"_blank"),!0;let[s,i]=n.slice(1);"backend"===s&&(i=`backend.${i}`),se.$.emit("update:extension",i),e.preventDefault()}},mounted(){this.refreshDoc(),this.$watch("extension.doc",this.refreshDoc)}};const oe=(0,W.Z)(ie,[["render",ne],["__scopeId","data-v-5aac2322"]]);var ae=oe;const le=e=>((0,s.dD)("data-v-7e5a8bae"),e=e(),(0,s.Cn)(),e),re={class:"install-container"},ce={class:"top"},de=le((()=>(0,s._)("header",null,[(0,s._)("h2",null,"Dependencies")],-1))),ue={class:"body"},he={class:"container install-cmd-container"},pe=["innerHTML"],fe={key:0,class:"buttons install-btn"},me=["disabled"],ge=le((()=>(0,s._)("i",{class:"fas fa-download"},null,-1))),be={key:0,class:"bottom"},ye=le((()=>(0,s._)("header",null,[(0,s._)("h2",null,"Output")],-1))),we={class:"body"},ve={class:"container install-output",ref:"installOutput"},ke=["textContent"],_e={key:0,class:"loading-container"};function xe(e,t,n,i,a,l){const r=(0,s.up)("CopyButton"),c=(0,s.up)("RestartButton"),d=(0,s.up)("Loading");return(0,s.wg)(),(0,s.iD)("div",re,[(0,s._)("section",ce,[de,(0,s._)("div",ue,[(0,s._)("div",he,[(0,s.Wm)(r,{text:l.installCmd},null,8,["text"]),(0,s._)("pre",null,[(0,s._)("code",{innerHTML:l.highlightedInstallCmd},null,8,pe)])]),l.installCmd?.length?((0,s.wg)(),(0,s.iD)("div",fe,[a.installDone?((0,s.wg)(),(0,s.j4)(c,{key:0})):(0,s.kq)("",!0),(0,s._)("button",{type:"button",class:"btn btn-default",disabled:a.installRunning,onClick:t[0]||(t[0]=(...e)=>l.installExtension&&l.installExtension(...e))},[ge,(0,s.Uk)(" Install ")],8,me)])):(0,s.kq)("",!0)])]),a.installRunning||a.installOutput?((0,s.wg)(),(0,s.iD)("section",be,[ye,(0,s._)("div",we,[(0,s._)("div",ve,[(0,s.Wm)(r,{text:a.installOutput},null,8,["text"]),(0,s._)("pre",null,[(0,s._)("code",{textContent:(0,o.zw)(a.installOutput)},null,8,ke),a.installRunning?((0,s.wg)(),(0,s.iD)("div",_e,[(0,s.Uk)("\n "),(0,s.Wm)(d),(0,s.Uk)("\n ")])):(0,s.kq)("",!0)])],512)])])):(0,s.kq)("",!0)])}var Ce=n(2717),De={name:"Install",mixins:[w.Z],emit:["install-start","install-end"],components:{CopyButton:z,Loading:y.Z,RestartButton:Ce.Z},props:{extension:{type:Object,required:!0}},data(){return{installRunning:!1,installDone:!1,installOutput:null,pendingCommands:0,error:null}},computed:{installCmd(){const e=this.extension.deps.install_cmd.join("\n").trim();return e?.length?e:null},highlightedInstallCmd(){return this.installCmd?M.Z.highlight("bash",this.extension.deps.install_cmd.map((e=>`$ ${e}`)).join("\n").trim()).value:"# No extra installation steps required"}},methods:{wsProcess(e){try{const t="https:"===window.location.protocol?"wss":"ws",n=`${t}://${location.host}${e}`,s=new WebSocket(n);s.onmessage=this.onMessage,s.onerror=this.onError,s.onclose=this.onClose}catch(t){this.notify({error:!0,title:"Websocket initialization error",text:t.toString()}),console.error("Websocket initialization error"),console.error(t),this.error=t,this.installRunning=!1}},onMessage(e){this.installOutput||(this.installOutput=""),this.installOutput+=e.data},onClose(){this.installRunning=!1,this.$emit("install-end",this.extension),this.error||(this.installDone=!0),this.notify({title:"Extension installed",html:`Extension <b>${this.extension.name}</b> installed successfully`,image:{iconClass:"fas fa-check"}})},onError(e){this.notify({error:!0,title:"Websocket error",text:e.toString()}),console.error("Websocket error"),console.error(e),this.error=e,this.installRunning=!1},installExtension(){this.error=null,this.installRunning=!0,this.installOutput="",this.$emit("install-start",this.extension);const e=(this.extension.deps.install_cmd||[]).join(";\n");this.request("shell.exec",{cmd:e,ws:!0}).then((e=>{this.wsProcess(e.ws_path)})).catch((e=>{this.error=e,this.installRunning=!1,this.$emit("install-end",this.extension)}))}},mounted(){this.$watch("installOutput",(()=>{this.$nextTick((()=>{this.$refs.installOutput.focus(),this.$refs.installOutput.scrollTop=this.$refs.installOutput.scrollHeight}))}))}};const Ie=(0,W.Z)(De,[["render",xe],["__scopeId","data-v-7e5a8bae"]]);var Te=Ie,$e={name:"Extension",components:{Config:F,Doc:ae,Install:Te,Tab:T.Z,Tabs:$.Z},props:{extension:{type:Object,required:!0},config:{type:Object},configFile:{type:String}},data(){return{selectedTab:"doc"}}};const Se=(0,W.Z)($e,[["render",I],["__scopeId","data-v-3fa6b036"]]);var qe=Se,Ue={name:"Extensions",mixins:[w.Z],components:{Extension:qe,Loading:y.Z},data(){return{loading:!1,plugins:{},backends:{},enabledPlugins:{},enabledBackends:{},filter:"",selectedExtension:null,configFile:null,config:{}}},computed:{extensions(){const e={};return Object.entries(this.plugins).forEach((([t,n])=>{e[t]={...n,name:t}})),Object.entries(this.backends).forEach((([t,n])=>{t=`backend.${t}`,e[t]={...n,name:t}})),e},enabledExtensions(){return[this.enabledPlugins,this.enabledBackends].reduce(((e,t)=>(Object.entries(t).forEach((([t,n])=>{e[t]=n})),e)),{})},extensionNames(){return Object.keys(this.extensions).sort()}},methods:{onClick(e,t=!0,n=!0){this.selectedExtension===e?this.selectedExtension=null:this.onInput(e,t,n)},onInput(e,t=!0,n=!0){t&&(this.filter=e);const s=e?.toLowerCase()?.trim();if(s?.length&&this.extensions[s]){this.selectedExtension=s,n&&this.setUrlArgs({extension:s});const e=this.$el.querySelector(`.extensions-container .item[data-name="${s}"]`);e&&e.scrollIntoView({behavior:"smooth"})}else this.selectedExtension=null,n&&this.setUrlArgs({})},matchesFilter(e){return!this.filter||e.includes(this.filter.toLowerCase())},async loadExtensions(){this.loading=!0;let[e,t]=[[],[]];try{[this.plugins,this.backends,e,t,this.config]=await Promise.all([this.request("inspect.get_all_plugins"),this.request("inspect.get_all_backends"),this.request("inspect.get_enabled_plugins"),this.request("inspect.get_enabled_backends"),this.request("inspect.get_config")])}finally{this.loading=!1}this.enabledPlugins=e.reduce(((e,t)=>(e[t]=this.config[t]||{},e)),{}),this.enabledBackends=t.reduce(((e,t)=>(t=`backend.${t}`,e[t]=this.config[t]||{},e)),{}),this.loadExtensionFromUrl(),this.$watch("$route.hash",(()=>this.loadExtensionFromUrl()))},async loadConfigFile(){this.configFile=await this.request("config.get_config_file")},loadExtensionFromUrl(){const e=this.getUrlArgs().extension;e&&this.$nextTick((()=>this.onInput(e,!1,!1)))}},mounted(){this.loadConfigFile(),this.loadExtensions(),se.$.on("update:extension",(e=>this.onInput(e,!1))),this.$nextTick((()=>this.$refs.filter.focus()))}};const Ee=(0,W.Z)(Ue,[["render",b],["__scopeId","data-v-456a0caf"]]);var Me=Ee},3136:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return Ie}});var s=n(6252);const i={class:"settings-container"};function o(e,t,n,o,a,l){const r=(0,s.up)("Application"),c=(0,s.up)("Users"),d=(0,s.up)("Token");return(0,s.wg)(),(0,s.iD)("div",i,[(0,s._)("main",null,["application"===n.selectedPanel?((0,s.wg)(),(0,s.j4)(r,{key:0})):(0,s.kq)("",!0),"users"===n.selectedPanel&&a.currentUser?((0,s.wg)(),(0,s.j4)(c,{key:1,"session-token":a.sessionToken,"current-user":a.currentUser},null,8,["session-token","current-user"])):"tokens"===n.selectedPanel&&a.currentUser?((0,s.wg)(),(0,s.j4)(d,{key:2,"session-token":a.sessionToken,"current-user":a.currentUser},null,8,["session-token","current-user"])):(0,s.kq)("",!0)])])}const a={class:"app-container"},l={class:"btn-container"},r={class:"btn-container"};function c(e,t,n,i,o,c){const d=(0,s.up)("RestartButton"),u=(0,s.up)("StopButton");return(0,s.wg)(),(0,s.iD)("div",a,[(0,s._)("div",l,[(0,s.Wm)(d)]),(0,s._)("div",r,[(0,s.Wm)(u)])])}var d=n(2717);const u=e=>((0,s.dD)("data-v-1eab04fa"),e=e(),(0,s.Cn)(),e),h={class:"stop-btn-container"},p=u((()=>(0,s._)("br",null,null,-1))),f=u((()=>(0,s._)("br",null,null,-1))),m=u((()=>(0,s._)("span",{class:"text-danger"}," This will stop the application and you will not be able to restart it through the Web interface! ",-1))),g=u((()=>(0,s._)("i",{class:"fas fa-stop"},null,-1)));function b(e,t,n,i,o,a){const l=(0,s.up)("ConfirmDialog");return(0,s.wg)(),(0,s.iD)("div",h,[(0,s.Wm)(l,{ref:"modal",onInput:a.stop},{default:(0,s.w5)((()=>[(0,s.Uk)(" Are you sure that you want to stop the application? "),p,f,m])),_:1},8,["onInput"]),(0,s._)("button",{class:"btn btn-default stop-btn",onClick:t[0]||(t[0]=(...e)=>a.showDialog&&a.showDialog(...e)),onTouch:t[1]||(t[1]=(...e)=>a.showDialog&&a.showDialog(...e))},[g,(0,s.Uk)("   Stop Application ")],32)])}var y=n(6936),w=n(8637),v={name:"StopButton",components:{ConfirmDialog:y.Z},mixins:[w.Z],methods:{showDialog(){this.$refs.modal.show()},async stop(){await this.request("application.stop")}}},k=n(3744);const _=(0,k.Z)(v,[["render",b],["__scopeId","data-v-1eab04fa"]]);var x=_,C={name:"Application",components:{RestartButton:d.Z,StopButton:x}};const D=(0,k.Z)(C,[["render",c],["__scopeId","data-v-40365cea"]]);var I=D,T=n(3577),$=n(9963);const S={class:"token-container"},q={class:"token-container"},U=(0,s._)("label",null,[(0,s.Uk)(" This is your generated token. Treat it carefully and do not share it with untrusted parties."),(0,s._)("br"),(0,s.Uk)(" Also, make sure to save it - it WILL NOT be displayed again. ")],-1),E=["textContent"],M={class:"token-container"},P=(0,s._)("label",null," This is your current session token. It will be invalidated once you log out of the current session. ",-1),j=["textContent"],O={class:"body"},Z=(0,s.uE)('<div class="description"><p> Platypush provides two types of tokens: <ul><li><b>JWT tokens</b> are bearer-only, and they contain encrypted authentication information.<br> They can be used as permanent or time-based tokens to authenticate with the Platypush API. </li><li><b>Session tokens</b> are randomly generated tokens stored on the application database. A session token generated in this session will expire when you log out of it. </li></ul></p><p>Generate a JWT authentication token that can be used for API calls to the <code>/execute</code> endpoint.</p><br><p>You can include the token in your requests in any of the following ways:</p><ul><li>Specify it on the <code>Authorization: Bearer</code> header;</li><li>Specify it on the <code>X-Token</code> header;</li><li> Specify it as a URL parameter: <code>http://site:8008/execute?token=...</code> for a JWT token and <code>...?session_token=...</code> for a session token; </li><li>Specify it on the body of your JSON request: <code>{&quot;type&quot;:&quot;request&quot;, &quot;action&quot;, &quot;...&quot;, &quot;token&quot;:&quot;...&quot;}</code> for a JWT token, or <code>&quot;session_token&quot;</code> for a session token. </li></ul><p>Confirm your credentials in order to generate a new JWT token.</p><p><i>Show session token</i> will instead show the token cookie associated to the current session. </p></div>',1),N={class:"form-container"},W=(0,s._)("span",null,"Username",-1),R=["value"],z=(0,s._)("label",null,[(0,s._)("span",null,"Confirm password"),(0,s._)("span",null,[(0,s._)("input",{type:"password",name:"password"})])],-1),A=(0,s._)("label",null,[(0,s._)("span",null,"Token validity in days"),(0,s._)("span",null,[(0,s._)("input",{type:"text",name:"validityDays"})]),(0,s._)("span",{class:"note"},[(0,s.Uk)(" Decimal values are also supported - e.g. "),(0,s._)("i",null,"0.5"),(0,s.Uk)(" means half a day (12 hours). An empty or zero value means that the token has no expiry date. ")])],-1),L=(0,s._)("label",null,[(0,s._)("input",{type:"submit",class:"btn btn-primary",value:"Generate JWT token"})],-1);function F(e,t,n,i,o,a){const l=(0,s.up)("Loading"),r=(0,s.up)("Modal");return(0,s.wg)(),(0,s.iD)("div",S,[o.loading?((0,s.wg)(),(0,s.j4)(l,{key:0})):(0,s.kq)("",!0),(0,s.Wm)(r,{ref:"tokenModal"},{default:(0,s.w5)((()=>[(0,s._)("div",q,[U,(0,s._)("textarea",{class:"token",textContent:(0,T.zw)(o.token),onFocus:t[0]||(t[0]=(...e)=>a.onTokenSelect&&a.onTokenSelect(...e))},null,40,E)])])),_:1},512),(0,s.Wm)(r,{ref:"sessionTokenModal"},{default:(0,s.w5)((()=>[(0,s._)("div",M,[P,(0,s._)("textarea",{class:"token",textContent:(0,T.zw)(n.sessionToken),onFocus:t[1]||(t[1]=(...e)=>a.onTokenSelect&&a.onTokenSelect(...e))},null,40,j)])])),_:1},512),(0,s._)("div",O,[Z,(0,s._)("div",N,[(0,s._)("form",{onSubmit:t[3]||(t[3]=(0,$.iM)(((...e)=>a.generateToken&&a.generateToken(...e)),["prevent"])),ref:"generateTokenForm"},[(0,s._)("label",null,[W,(0,s._)("span",null,[(0,s._)("input",{type:"text",name:"username",value:n.currentUser.username,disabled:""},null,8,R)])]),z,A,L,(0,s._)("label",null,[(0,s._)("input",{type:"button",class:"btn btn-default",value:"Show session token",onClick:t[2]||(t[2]=(0,$.iM)((t=>e.$refs.sessionTokenModal.show()),["stop"]))})])],544)])])])}var B=n(9669),H=n.n(B),V=n(6791),Y=n(9417),K={name:"Token",components:{Modal:Y.Z,Loading:V.Z},mixins:[w.Z],props:{currentUser:{type:Object,required:!0},sessionToken:{type:String,required:!0}},data(){return{loading:!1,token:null}},methods:{async generateToken(e){const t=this.currentUser.username,n=e.target.password.value;let s=e.target.validityDays?.length?parseInt(e.target.validityDays.value):0;s||(s=null),this.loading=!0;try{this.token=(await H().post("/auth",{username:t,password:n,expiry_days:s})).data.token,this.token?.length&&this.$refs.tokenModal.show()}catch(i){console.error(i.toString()),this.notify({text:i.toString(),error:!0})}finally{this.loading=!1}},onTokenSelect(e){e.target.select(),document.execCommand("copy"),this.notify({text:"Token copied to clipboard",image:{iconClass:"fa fa-check"}})}}};const J=(0,k.Z)(K,[["render",F]]);var G=J;const X=["disabled"],Q=["disabled"],ee=["disabled"],te=["disabled"],ne=["value"],se=["disabled"],ie=["disabled"],oe=["disabled"],ae=["disabled"],le={class:"body"},re={class:"users-list"},ce=["onClick"],de=["textContent"],ue={class:"actions pull-right col-4"};function he(e,t,n,i,o,a){const l=(0,s.up)("Loading"),r=(0,s.up)("Modal"),c=(0,s.up)("DropdownItem"),d=(0,s.up)("Dropdown"),u=(0,s.up)("FloatingButton"),h=(0,s.up)("ConfirmDialog");return(0,s.wg)(),(0,s.iD)(s.HY,null,[o.loading?((0,s.wg)(),(0,s.j4)(l,{key:0})):(0,s.kq)("",!0),(0,s.Wm)(r,{ref:"addUserModal",title:"Add User"},{default:(0,s.w5)((()=>[(0,s._)("form",{action:"#",method:"POST",ref:"addUserForm",onSubmit:t[0]||(t[0]=(...e)=>a.createUser&&a.createUser(...e))},[(0,s._)("label",null,[(0,s._)("input",{type:"text",name:"username",placeholder:"Username",disabled:o.commandRunning},null,8,X)]),(0,s._)("label",null,[(0,s._)("input",{type:"password",name:"password",placeholder:"Password",disabled:o.commandRunning},null,8,Q)]),(0,s._)("label",null,[(0,s._)("input",{type:"password",name:"confirm_password",placeholder:"Confirm password",disabled:o.commandRunning},null,8,ee)]),(0,s._)("label",null,[(0,s._)("input",{type:"submit",class:"btn btn-primary",value:"Create User",disabled:o.commandRunning},null,8,te)])],544)])),_:1},512),(0,s.Wm)(r,{ref:"changePasswordModal",title:"Change Password"},{default:(0,s.w5)((()=>[(0,s._)("form",{action:"#",method:"POST",ref:"changePasswordForm",onSubmit:t[1]||(t[1]=(...e)=>a.changePassword&&a.changePassword(...e))},[(0,s._)("label",null,[(0,s._)("input",{type:"text",name:"username",placeholder:"Username",value:o.selectedUser,disabled:"disabled"},null,8,ne)]),(0,s._)("label",null,[(0,s._)("input",{type:"password",name:"password",placeholder:"Current password",disabled:o.commandRunning},null,8,se)]),(0,s._)("label",null,[(0,s._)("input",{type:"password",name:"new_password",placeholder:"New password",disabled:o.commandRunning},null,8,ie)]),(0,s._)("label",null,[(0,s._)("input",{type:"password",name:"confirm_new_password",placeholder:"Confirm new password",disabled:o.commandRunning},null,8,oe)]),(0,s._)("label",null,[(0,s._)("input",{type:"submit",class:"btn btn-primary",value:"Change Password",disabled:o.commandRunning},null,8,ae)])],544)])),_:1},512),(0,s._)("div",le,[(0,s._)("ul",re,[((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(o.users,(n=>((0,s.wg)(),(0,s.iD)("li",{key:n.user_id,class:"item user",onClick:e=>o.selectedUser=n.username},[(0,s._)("div",{class:"name col-8",textContent:(0,T.zw)(n.username)},null,8,de),(0,s._)("div",ue,[(0,s.Wm)(d,{title:"User Actions","icon-class":"fa fa-ellipsis"},{default:(0,s.w5)((()=>[(0,s.Wm)(c,{text:"Change Password",disabled:o.commandRunning,"icon-class":"fa fa-key",onClick:e=>a.showChangePasswordModal(n)},null,8,["disabled","onClick"]),(0,s.Wm)(c,{text:"Delete User",disabled:o.commandRunning,"icon-class":"fa fa-trash",onClick:t[2]||(t[2]=t=>e.$refs.deleteUserDialog.show())},null,8,["disabled"])])),_:2},1024)])],8,ce)))),128))]),(0,s.Wm)(u,{"icon-class":"fa fa-plus",text:"Add User",onClick:a.showAddUserModal},null,8,["onClick"]),(0,s.Wm)(h,{ref:"deleteUserDialog",onInput:t[3]||(t[3]=e=>a.deleteUser(o.selectedUser))},{default:(0,s.w5)((()=>[(0,s.Uk)(" Are you sure that you want to remove the user "+(0,T.zw)(o.selectedUser)+"? ",1)])),_:1},512)])],64)}var pe=n(7261),fe=n(1189);const me=["title"];function ge(e,t,n,i,o,a){const l=(0,s.up)("Icon");return(0,s.wg)(),(0,s.iD)("div",{class:(0,T.C_)(["floating-btn",a.className])},[(0,s._)("button",{type:"button",class:"btn btn-primary",title:n.title,onClick:t[0]||(t[0]=t=>e.$emit("click",t))},[(0,s.Wm)(l,{class:(0,T.C_)(n.iconClass),url:n.iconUrl},null,8,["class","url"])],8,me)],2)}var be=n(657),ye={name:"FloatingButton",components:{Icon:be.Z},emits:["click"],props:{iconClass:{type:String},iconUrl:{type:String},class:{type:String},title:{type:String}},computed:{className(){return this.class}}};const we=(0,k.Z)(ye,[["render",ge],["__scopeId","data-v-133e57f8"]]);var ve=we,ke={name:"Users",components:{ConfirmDialog:y.Z,Dropdown:pe.Z,DropdownItem:fe.Z,FloatingButton:ve,Loading:V.Z,Modal:Y.Z},mixins:[w.Z],props:{sessionToken:{type:String,required:!0},currentUser:{type:Object,required:!0}},data(){return{users:[],commandRunning:!1,loading:!1,selectedUser:null}},methods:{async refresh(){this.loading=!0;try{this.users=await this.request("user.get_users")}finally{this.loading=!1}},async createUser(e){e.preventDefault();const t=[...this.$refs.addUserForm.querySelectorAll("input[name]")].reduce(((e,t)=>(e[t.name]=t.value,e)),{});if(t.password===t.confirm_password){this.commandRunning=!0;try{await this.request("user.create_user",{username:t.username,password:t.password,session_token:this.sessionToken})}finally{this.commandRunning=!1}this.notify({text:"User "+t.username+" created",image:{iconClass:"fas fa-check"}}),this.$refs.addUserModal.close(),await this.refresh()}else this.notify({title:"Unable to create user",text:"Please check that the passwords match",error:!0,image:{iconClass:"fas fa-times"}})},async changePassword(e){e.preventDefault();const t=[...this.$refs.changePasswordForm.querySelectorAll("input[name]")].reduce(((e,t)=>(e[t.name]=t.value,e)),{});if(t.new_password!==t.confirm_new_password)return void this.notify({title:"Unable to update password",text:"Please check that the passwords match",error:!0,image:{iconClass:"fas fa-times"}});this.commandRunning=!0;let n=!1;try{n=await this.request("user.update_password",{username:t.username,old_password:t.password,new_password:t.new_password})}finally{this.commandRunning=!1}n?(this.$refs.changePasswordModal.close(),this.notify({text:"Password successfully updated",image:{iconClass:"fas fa-check"}})):this.notify({title:"Unable to update password",text:"The current password is incorrect",error:!0,image:{iconClass:"fas fa-times"}})},async deleteUser(e){this.commandRunning=!0;try{await this.request("user.delete_user",{username:e,session_token:this.sessionToken})}finally{this.commandRunning=!1}this.notify({text:`User ${e} removed`,image:{iconClass:"fas fa-check"}}),this.selectedUser=null,await this.refresh()},showAddUserModal(){this.$refs.addUserModal.show(),this.$nextTick((()=>{this.$refs.addUserForm.reset(),this.$refs.addUserForm.username.focus()}))},showChangePasswordModal(e){this.$refs.changePasswordModal.show(),this.$nextTick((()=>{this.$refs.changePasswordForm.password.focus(),this.selectedUser=e.username}))}},mounted(){this.refresh()}};const _e=(0,k.Z)(ke,[["render",he],["__scopeId","data-v-510035f2"]]);var xe=_e,Ce={name:"Settings",components:{Application:I,Users:xe,Token:G},mixins:[w.Z],props:{selectedPanel:{type:String}},data(){return{currentUser:null,sessionToken:null}},methods:{async refresh(){this.sessionToken=this.getCookies()["session_token"],this.currentUser=await this.request("user.get_user_by_session",{session_token:this.sessionToken})}},mounted(){this.refresh()}};const De=(0,k.Z)(Ce,[["render",o]]);var Ie=De},3379:function(e,t,n){var s={"./Camera/Index":[5324,8039,5324],"./CameraAndroidIpcam/Index":[5794,5794],"./CameraCv/Index":[6148,8039,6148],"./CameraFfmpeg/Index":[9334,8039,9334],"./CameraGstreamer/Index":[813,8039,813],"./CameraIrMlx90640/Index":[7381,8039,7381],"./CameraPi/Index":[5214,8039,8895],"./Entities/Index":[377,4558],"./Execute/Index":[7673,7673],"./Extensions/Index":[7092],"./Light/Index":[7184,2471,5040,7184],"./LightHue/Index":[2976,2471,5040,7184,2976],"./Media/Index":[1880,2471,3694,6079,1880],"./MediaMplayer/Index":[3518,2471,3694,6079,1880,3518],"./MediaMpv/Index":[4765,2471,3694,6079,1880,4765],"./MediaOmxplayer/Index":[7819,2471,3694,6079,1880,7819],"./MediaVlc/Index":[2614,2471,3694,6079,1880,2614],"./Music/Index":[2986,2471,3694,2986],"./MusicMpd/Index":[1309,2471,3694,2986,1309],"./MusicSnapcast/Index":[6215,2471,5040,6215],"./MusicSpotify/Index":[2068,2471,3694,2986,2068],"./Rtorrent/Index":[2183,6079,7968,2183],"./Settings/Index":[3136],"./Sound/Index":[746,746],"./Torrent/Index":[8784,6079,7968,8784],"./Tts/Index":[3732,8069,3732],"./TtsGoogle/Index":[7605,8069,2853],"./TvSamsungWs/Index":[4589,4589],"./ZigbeeMqtt/Index":[1259,2471,5040,1259],"./Zwave/Index":[2732,2471,5040,7880,2732],"./ZwaveMqtt/Index":[1088,2471,5040,7880,1088]};function i(e){if(!n.o(s,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=s[e],i=t[0];return Promise.all(t.slice(1).map(n.e)).then((function(){return n(i)}))}i.keys=function(){return Object.keys(s)},i.id=3379,e.exports=i},6725:function(e,t,n){var s={"./Calendar/Index":[5638,5638],"./Camera/Index":[446,446],"./Component/Index":[1449,2471,5040,1449],"./DateTime/Index":[4619,1391,4619],"./DateTimeWeather/Index":[9962,3594,1391,9962],"./ImageCarousel/Index":[306,3594,1391,306],"./Music/Index":[311,311],"./Plugin/Index":[8179,8179],"./RssNews/Index":[6523,6523],"./Weather/Index":[3594,3594]};function i(e){if(!n.o(s,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=s[e],i=t[0];return Promise.all(t.slice(1).map(n.e)).then((function(){return n(i)}))}i.keys=function(){return Object.keys(s)},i.id=6725,e.exports=i},1359:function(e){"use strict";e.exports=JSON.parse('{"arduino":{"class":"fas fa-microchip"},"bluetooth":{"class":"fab fa-bluetooth"},"camera.android.ipcam":{"class":"fab fa-android"},"camera.cv":{"class":"fas fa-camera"},"camera.ffmpeg":{"class":"fas fa-camera"},"camera.gstreamer":{"class":"fas fa-camera"},"camera.ir.mlx90640":{"class":"fas fa-sun"},"camera.pi":{"class":"fas fa-camera"},"entities":{"class":"fa fa-home"},"execute":{"class":"fa fa-play"},"extensions":{"class":"fas fa-puzzle-piece"},"light.hue":{"class":"fas fa-lightbulb"},"linode":{"class":"fas fa-cloud"},"media.jellyfin":{"imgUrl":"/icons/jellyfin.svg"},"media.kodi":{"imgUrl":"/icons/kodi.svg"},"media.omxplayer":{"class":"fa fa-film"},"media.mplayer":{"class":"fa fa-film"},"media.mpv":{"class":"fa fa-film"},"media.plex":{"imgUrl":"/icons/plex.svg"},"media.vlc":{"class":"fa fa-film"},"music.mpd":{"class":"fas fa-music"},"music.snapcast":{"class":"fa fa-volume-up"},"music.spotify":{"class":"fab fa-spotify"},"torrent":{"class":"fa fa-magnet"},"rtorrent":{"class":"fa fa-magnet"},"sensor.bme280":{"class":"fas fa-microchip"},"sensor.dht":{"class":"fas fa-microchip"},"sensor.envirophat":{"class":"fas fa-microchip"},"sensor.ltr559":{"class":"fas fa-microchip"},"sensor.mcp3008":{"class":"fas fa-microchip"},"sensor.pmw3901":{"class":"fas fa-microchip"},"sensor.vl53l1x":{"class":"fas fa-microchip"},"serial":{"class":"fab fa-usb"},"smartthings":{"imgUrl":"/icons/smartthings.png"},"switches":{"class":"fas fa-toggle-on"},"switch.switchbot":{"class":"fas fa-toggle-on"},"switch.tplink":{"class":"fas fa-toggle-on"},"switchbot":{"class":"fas fa-toggle-on"},"sound":{"class":"fa fa-microphone"},"system":{"class":"fas fa-microchip"},"tts":{"class":"far fa-comment"},"tts.google":{"class":"fas fa-comment"},"tv.samsung.ws":{"class":"fas fa-tv"},"variable":{"class":"fas fa-square-root-variable"},"zigbee.mqtt":{"imgUrl":"/icons/zigbee.svg"},"zwave":{"imgUrl":"/icons/z-wave.png"},"zwave.mqtt":{"imgUrl":"/icons/z-wave.png"}}')}},t={};function n(s){var i=t[s];if(void 0!==i)return i.exports;var o=t[s]={exports:{}};return e[s].call(o.exports,o,o.exports,n),o.exports}n.m=e,function(){var e=[];n.O=function(t,s,i,o){if(!s){var a=1/0;for(d=0;d<e.length;d++){s=e[d][0],i=e[d][1],o=e[d][2];for(var l=!0,r=0;r<s.length;r++)(!1&o||a>=o)&&Object.keys(n.O).every((function(e){return n.O[e](s[r])}))?s.splice(r--,1):(l=!1,o<a&&(a=o));if(l){e.splice(d--,1);var c=i();void 0!==c&&(t=c)}}return t}o=o||0;for(var d=e.length;d>0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[s,i,o]}}(),function(){n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,{a:t}),t}}(),function(){var e,t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__};n.t=function(s,i){if(1&i&&(s=this(s)),8&i)return s;if("object"===typeof s&&s){if(4&i&&s.__esModule)return s;if(16&i&&"function"===typeof s.then)return s}var o=Object.create(null);n.r(o);var a={};e=e||[null,t({}),t([]),t(t)];for(var l=2&i&&s;"object"==typeof l&&!~e.indexOf(l);l=t(l))Object.getOwnPropertyNames(l).forEach((function(e){a[e]=function(){return s[e]}}));return a["default"]=function(){return s},n.d(o,a),o}}(),function(){n.d=function(e,t){for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})}}(),function(){n.f={},n.e=function(e){return Promise.all(Object.keys(n.f).reduce((function(t,s){return n.f[s](e,t),t}),[]))}}(),function(){n.u=function(e){return"static/js/"+e+"."+{65:"ae7df477",169:"ebdd7044",306:"65920e65",311:"f32aa7b9",446:"453dede2",729:"1b92c9f7",746:"d8626378",813:"1233574d",984:"ae424e7e",1088:"811c36c9",1259:"8f7841ac",1309:"cacee3b4",1391:"a76844c2",1449:"a86588b4",1880:"4857825d",2068:"1e2b0aef",2183:"0851f006",2217:"6b927594",2460:"567e73f6",2471:"da49c64a",2614:"2ff0e60d",2732:"a3a54d65",2853:"7e8d1c01",2893:"519a1554",2976:"bbbc8952",2986:"1b52d857",3368:"cb04738a",3369:"c099f8d0",3518:"39ec56c6",3559:"df95d103",3594:"16b738d2",3694:"9ca4ff97",3732:"c52fd2ec",3798:"fcfdd0e0",3826:"cc264dd1",3835:"11129165",4558:"3693df36",4589:"f7212e88",4619:"2b7e4216",4765:"2dd16216",5040:"f02b705d",5207:"7f241e21",5324:"f88d40e4",5329:"444a9cf1",5638:"7b12f2d2",5794:"9859b34c",6079:"b020e16c",6148:"671128aa",6215:"d25b80c1",6324:"c3f621ef",6362:"95da0eb4",6523:"bef9dd6e",6561:"fc5ef77b",7184:"eba2f522",7381:"3cf1c534",7523:"367c2045",7590:"6cda174b",7673:"2a807543",7819:"c2a2e948",7880:"86d9a9db",7968:"a0ff4311",8039:"951792f1",8069:"51c1e8b1",8179:"7d8455aa",8391:"119357c7",8621:"0aa03df1",8769:"5ea5c0cb",8784:"458e26a1",8825:"b660e217",8895:"b0fc9568",9334:"218a8dd3",9962:"8fc631e7"}[e]+".js"}}(),function(){n.miniCssF=function(e){return"static/css/"+e+"."+{65:"65fe087a",169:"18c97596",306:"919e2cb6",311:"ce3daf0e",446:"ac7021e0",729:"d9e08bd0",746:"36a26270",984:"7571e216",1259:"28135e7d",1391:"cb558276",1449:"64ebf9cc",1880:"d35c9ea0",2217:"664973a5",2460:"c44d2954",2471:"750151be",2893:"7780abf3",2976:"5cb4fa57",2986:"3d6a6efd",3368:"771f452b",3369:"56bab933",3559:"5e597f7f",3594:"eefea329",3694:"ae679692",3798:"6a1b7cf0",3826:"fbeeb43c",3835:"fbe4d9b1",4558:"a091c93e",4589:"e78ef44e",5040:"a5bd22c4",5207:"d95cde39",5329:"32a328a7",5638:"089f217d",5794:"82cc8a21",6079:"bfe15119",6215:"a48cbf18",6324:"157a52a9",6523:"d4d5365a",6561:"f0cece07",7184:"e666172f",7523:"a18b735e",7590:"727bfece",7673:"ce56995a",7880:"5e6febf3",7968:"1d0824b1",8039:"eeeae3a7",8069:"5ef4c270",8179:"2fdb982c",8391:"3ecab78d",8621:"a58665a4",8769:"294a7607",8825:"d5cc7895",9962:"68c87814"}[e]+".css"}}(),function(){n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){var e={},t="platypush:";n.l=function(s,i,o,a){if(e[s])e[s].push(i);else{var l,r;if(void 0!==o)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==s||u.getAttribute("data-webpack")==t+o){l=u;break}}l||(r=!0,l=document.createElement("script"),l.charset="utf-8",l.timeout=120,n.nc&&l.setAttribute("nonce",n.nc),l.setAttribute("data-webpack",t+o),l.src=s),e[s]=[i];var h=function(t,n){l.onerror=l.onload=null,clearTimeout(p);var i=e[s];if(delete e[s],l.parentNode&&l.parentNode.removeChild(l),i&&i.forEach((function(e){return e(n)})),t)return t(n)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=h.bind(null,l.onerror),l.onload=h.bind(null,l.onload),r&&document.head.appendChild(l)}}}(),function(){n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}}(),function(){n.p="/"}(),function(){if("undefined"!==typeof document){var e=function(e,t,n,s,i){var o=document.createElement("link");o.rel="stylesheet",o.type="text/css";var a=function(n){if(o.onerror=o.onload=null,"load"===n.type)s();else{var a=n&&("load"===n.type?"missing":n.type),l=n&&n.target&&n.target.href||t,r=new Error("Loading CSS chunk "+e+" failed.\n("+l+")");r.code="CSS_CHUNK_LOAD_FAILED",r.type=a,r.request=l,o.parentNode&&o.parentNode.removeChild(o),i(r)}};return o.onerror=o.onload=a,o.href=t,n?n.parentNode.insertBefore(o,n.nextSibling):document.head.appendChild(o),o},t=function(e,t){for(var n=document.getElementsByTagName("link"),s=0;s<n.length;s++){var i=n[s],o=i.getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(o===e||o===t))return i}var a=document.getElementsByTagName("style");for(s=0;s<a.length;s++){i=a[s],o=i.getAttribute("data-href");if(o===e||o===t)return i}},s=function(s){return new Promise((function(i,o){var a=n.miniCssF(s),l=n.p+a;if(t(a,l))return i();e(s,l,null,i,o)}))},i={2143:0};n.f.miniCss=function(e,t){var n={65:1,169:1,306:1,311:1,446:1,729:1,746:1,984:1,1259:1,1391:1,1449:1,1880:1,2217:1,2460:1,2471:1,2893:1,2976:1,2986:1,3368:1,3369:1,3559:1,3594:1,3694:1,3798:1,3826:1,3835:1,4558:1,4589:1,5040:1,5207:1,5329:1,5638:1,5794:1,6079:1,6215:1,6324:1,6523:1,6561:1,7184:1,7523:1,7590:1,7673:1,7880:1,7968:1,8039:1,8069:1,8179:1,8391:1,8621:1,8769:1,8825:1,9962:1};i[e]?t.push(i[e]):0!==i[e]&&n[e]&&t.push(i[e]=s(e).then((function(){i[e]=0}),(function(t){throw delete i[e],t})))}}}(),function(){var e={2143:0};n.f.j=function(t,s){var i=n.o(e,t)?e[t]:void 0;if(0!==i)if(i)s.push(i[2]);else if(/^(80[36]9|(139|247|656)1|3826|5040|6079)$/.test(t))e[t]=0;else{var o=new Promise((function(n,s){i=e[t]=[n,s]}));s.push(i[2]=o);var a=n.p+n.u(t),l=new Error,r=function(s){if(n.o(e,t)&&(i=e[t],0!==i&&(e[t]=void 0),i)){var o=s&&("load"===s.type?"missing":s.type),a=s&&s.target&&s.target.src;l.message="Loading chunk "+t+" failed.\n("+o+": "+a+")",l.name="ChunkLoadError",l.type=o,l.request=a,i[1](l)}};n.l(a,r,"chunk-"+t,t)}},n.O.j=function(t){return 0===e[t]};var t=function(t,s){var i,o,a=s[0],l=s[1],r=s[2],c=0;if(a.some((function(t){return 0!==e[t]}))){for(i in l)n.o(l,i)&&(n.m[i]=l[i]);if(r)var d=r(n)}for(t&&t(s);c<a.length;c++)o=a[c],n.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return n.O(d)},s=self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[];s.forEach(t.bind(null,0)),s.push=t.bind(null,s.push.bind(s))}();var s=n.O(void 0,[4998],(function(){return n(3188)}));s=n.O(s)})();
//# sourceMappingURL=app.cadba6f7.js.map