1?p+"Tage ":p>0?p+"Tag ":"";h+=l>0?l+"h ":"",h+=u>0?u+"min":"",r=e[s].replace("%a",h)}if(/%n/.test(e[s])&&n){/%n.[0-9]/.test(e[s])||(e[s]=e[s].replace("%n","%n.0"));var d=/%n../.exec(e[s]),m=d[0].replace("%n.","");r=e[s].replace(d[0],parseFloat(t.slice(n.index)).toFixed(m))}if(/%i/.test(e[s])&&n){var f=parseFloat(e[s].split("%i")[1]);if("isNaN"!=f){var v=f.toString().split(".")[1]||"",g=v.length,b=parseFloat(t.slice(n.index))+f;r=e[s].replace("%i"+f,b.toFixed(g))}}r=r.replace(/:/g,":"),a.push(r)}return a}},{key:"handleVals",value:function(e,t){var n=[];if("string"===typeof t){var a=("::"+t).split(":");n=this.replaceVals(a,"")}if("object"===Object(ie["a"])(e)&&"object"===Object(ie["a"])(t)&&t.length>0){var s,r=Object(ae["a"])(t);try{for(r.s();!(s=r.n()).done;){var i=s.value,o=i.split(":");if(o.length>2){var c=/\./.test(o[0])?o[0].split("."):["Readings",o[0],"Value"],p=this.getEl.apply(this,[e].concat(Object(se["a"])(c)))||this.getEl(e,"Readings",o[0],"Value");if(p){var l=!1,u=parseFloat(o[1]);if(isNaN(u))RegExp(o[1]?o[1]:".").test(p)&&(l=!0);else{var h=/-?[0-9]/.exec(p);-1!=h.index&&parseFloat(p.slice(h.index))>=u&&(l=!0)}if(l){n=this.replaceVals(o,p);break}}}}}catch(d){r.e(d)}finally{r.f()}}return n}},{key:"handleTemplate",value:function(e){var t=this.getEl(e,"Options","setup","show"),n=this.getEl(e,"Options","setup","status","bar"),a=this.getEl(e,"Options","setup","status","error"),s=this.getEl(e,"Options","setup","info");if(t){var r=this.handleVals(e,t);e.Options.show="false"!==r[0],r[1]&&(e.Options.setup.size=r[1]),r[2]&&(e.Options.sortby=r[2])}if(n){var i=this.getEl(e,"Options","setup","status","min")||0,o=this.getEl(e,"Options","setup","status","max")||100,c=this.handleVals(e,n),p=100/(o-i),l=(c[0]||"0"-i)*p;e.Options.status.level=c[2]?100-l:l,e.Options.status.color=c[1]||"success"}if(a){var u=this.handleVals(e,a);u.length>0?(e.Options.status.level=u[0]||"100",e.Options.status.color=u[1]||"error",e.Options.status.error=u[2]||"Fehler",e.Options.status.isActive=!1):e.Options.status.isActive=!0}if(s){var h=this.handleVals(e,s.left1),d=this.handleVals(e,s.left2),m=this.handleVals(e,s.mid1),f=this.handleVals(e,s.mid2),v=this.handleVals(e,s.right1),g=this.handleVals(e,s.right2);e.Options.info.left1IconColor=h[2]||"",e.Options.info.left1Icon=h[1]||"",e.Options.info.left1Text=h[0]||"",e.Options.info.left2IconColor=d[2]||"",e.Options.info.left2Icon=d[1]||"",e.Options.info.left2Text=d[0]||"",e.Options.info.mid1IconColor=m[2]||"",e.Options.info.mid1Icon=m[1]||"",e.Options.info.mid1Text=m[0]||"",e.Options.info.mid2IconColor=f[2]||"",e.Options.info.mid2Icon=f[1]||"",e.Options.info.mid2Text=f[0]||"",e.Options.info.right1IconColor=v[2]||"",e.Options.info.right1Icon=v[1]||"",e.Options.info.right1Text=v[0]||"",e.Options.info.right2IconColor=g[2]||"",e.Options.info.right2Icon=g[1]||"",e.Options.info.right2Text=g[0]||""}}},{key:"handleData",value:function(e){var t=JSON.parse(e),n=null;if(!t[2].match("0){var i=this.handleData(r);if(i){var o,c=0,p=Object(ae["a"])(this.app.data.deviceList);try{for(p.s();!(o=p.n()).done;){var l=o.value,u=this.app.data.deviceList[c],h=Object.assign({},u);if(l.Name===i.Name&&("Readings"===i.devicePart&&this.getEl(h,"Readings",i.param,i.paramPart)&&(h.Readings[i.param][i.paramPart]=i.value),"Attributes"===i.devicePart&&this.getEl(h,"Attributes",i.param)&&(h.Attributes[i.param]=i.value),this.handleTemplate(h),this.app.data.deviceList.splice(c,1,h),this.app.data.deviceList.sort((function(e,t){return e.Options.sortby>t.Options.sortby?1:t.Options.sortby>e.Options.sortby?-1:0}))),"Connected"in l)for(var d=0,m=0,f=Object.values(l.Connected);mt.Options.sortby?1:t.Options.sortby>e.Options.sortby?-1:0}))}d++}c++}}catch(b){p.e(b)}finally{p.f()}}}}}catch(b){s.e(b)}finally{s.f()}}},{key:"connOpen",value:function(){var e=Object(re["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.app.session.connect=!0,this.app.session.restartCnt=0,this.log({lvl:2,msg:"Connection with FHEM is opened.",meta:this.app.connection}),e.next=5,this.request({},"csrf");case 5:this.app.session.csrf=e.sent,this.log({lvl:2,msg:"Crsf-Token received.",meta:{token:this.app.session.csrf}}),this.loadStructure();case 8:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"connClose",value:function(){var e=Object(re["a"])(regeneratorRuntime.mark((function e(t){var n,a,s=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:this.app.session.connect=!1,this.app.session.csrf=null,this.app.session.ready=!1,this.app.conn=null,this.app.session.restart||(n=0==this.app.session.restartCnt?1:3e3,this.app.session.restart=!0,setTimeout((function(){s.app.session.restart=!1,s.app.session.restartCnt++,s.connStart()}),n),a={info:"Connection ("+this.app.connection.type+") "+(t?"failed.":"was closed."),errCode:t||""},this.log({lvl:2,msg:"Connection with FHEM was closed. Try to Reconnect in "+n/1e3+" seconds...",meta:a}),this.loading=!1);case 5:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"connStart",value:function(){var e=Object(re["a"])(regeneratorRuntime.mark((function e(){var t,n,a=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t=[{param:"inform",value:"type=status;filter=.*;fmt=JSON"},{param:"XHR",value:"1"}],n=this.createURL(t),"websocket"===this.app.connection.type?(this.app.conn=new WebSocket(n.replace(/^http/i,"ws")),this.app.conn.onopen=function(){return a.connOpen()},this.app.conn.onmessage=function(e){return a.doUpdate(e)},this.app.conn.onclose=function(){return a.connClose()},this.app.conn.onerror=function(e){return a.connClose(e)}):(this.app.conn=new XMLHttpRequest,this.app.conn.open("GET",n,!0),this.app.conn.onreadystatechange=function(){200===a.app.conn.status&&2===a.app.conn.readyState&&a.connOpen(),200===a.app.conn.status&&3===a.app.conn.readyState&&a.doUpdate()},this.app.conn.onerror=function(e){return a.connClose(e)},this.app.conn.send());case 3:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"setClock",value:function(){var e=new Date;this.app.appBar.clock=e.toLocaleString(this.app.options.lang,{hour:"2-digit",minute:"2-digit"}),this.app.options.mobileHeader||(this.app.appBar.header=e.toLocaleString(this.app.options.lang,{weekday:"long",year:"numeric",month:"long",day:"numeric"}))}},{key:"init",value:function(){var e=Object(re["a"])(regeneratorRuntime.mark((function e(t,n){var a=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.log({lvl:2,msg:"Starting FHEMApp..."}),this.loading=!0,e.next=4,this.readConfig("./cfg/config.json");case 4:this.connStart(),t&&this.app.theme&&(-1!=this.app.theme.dark&&Object.assign(t.framework.theme,{dark:this.app.theme.dark}),this.app.theme.themes.light&&Object.assign(t.framework.theme.themes.light,this.app.theme.themes.light),this.app.theme.themes.dark&&Object.assign(t.framework.theme.themes.dark,this.app.theme.themes.dark)),n&&this.app.options.lang&&(n.locale=this.app.options.lang),this.setClock(),setInterval((function(){return a.setClock()}),this.app.options.clockInterval);case 9:case"end":return e.stop()}}),e,this)})));function t(t,n){return e.apply(this,arguments)}return t}()}]),n}(he.a),me={install:function(e,t,n){e.prototype.$fhem=new de,e.prototype.$fhem.init(t,n)}};a["a"].use(me,Z,ne),a["a"].use(Y.a),a["a"].component("apexchart",Y.a),a["a"].config.productionTip=!1,new a["a"]({vuetify:Z,router:q,i18n:ne,render:function(e){return e(H)}}).$mount("#app")},"6ce2":function(e){e.exports=JSON.parse('{"app":{"navigation":{"home":"Home","group":"Gruppen","room":"Bereiche","dashboard":"Dashboard","system":"System"},"dates":{"from":"von","to":"bis"}},"templates":{"sysmon":{"updateBtn":["prüfe Updates...","system aktuell","update","update läuft.."],"restartBtn":"neustart","updateDialog":{"header":"FHEM Update","text":"Update wurde erfolgreich beendet. FHEM sollte neu gestartet werden.","restartBtn":"jetzt neustarten"}}}}')},9224:function(e){e.exports=JSON.parse('{"name":"fhemapp","version":"3.26.1","private":true,"author":"jemu75","scripts":{"serve":"vue-cli-service serve","build":"vue-cli-service build","lint":"vue-cli-service lint","i18n:report":"vue-cli-service i18n:report --src \\"./src/**/*.?(js|vue)\\" --locales \\"./src/locales/**/*.json\\""},"dependencies":{"apexcharts":"^3.27.3","core-js":"^3.16.2","typeface-roboto":"^1.1.13","vue":"^2.6.14","vue-apexcharts":"^1.6.2","vue-i18n":"^8.25.0","vue-json-pretty":"^1.8.1","vue-router":"^3.5.2","vuetify":"^2.5.8"},"devDependencies":{"@mdi/font":"^5.9.55","@vue/cli-plugin-babel":"^4.5.13","@vue/cli-plugin-eslint":"^4.5.13","@vue/cli-plugin-router":"^4.5.13","@vue/cli-service":"^4.5.13","babel-eslint":"^10.1.0","eslint":"^6.7.2","eslint-plugin-vue":"^6.2.2","sass":"^1.38.0","sass-loader":"^8.0.0","vue-cli-plugin-i18n":"^2.1.3","vue-cli-plugin-vuetify":"~2.0.9","vue-template-compiler":"^2.6.14","vuetify-loader":"^1.7.2"},"bugs":{"url":"https://github.com/jemu75/fhemApp/issues"},"homepage":"https://github.com/jemu75/fhemApp#readme","license":"MIT","repository":{"type":"git","url":"git+https://github.com/jemu75/fhemApp.git"}}')},c274:function(e,t,n){e.exports=n.p+"img/FHEM_Logo.2d0f7a38.png"},edd4:function(e){e.exports=JSON.parse('{"app":{"navigation":{"home":"Home","group":"Groups","room":"Area","dashboard":"Dashboard","system":"System"},"dates":{"from":"From","to":"To"}},"templates":{"sysmon":{"updateBtn":["check updates...","up to date","update","update running..."],"restartBtn":"restart","updateDialog":{"header":"FHEM Update","text":"Update was successful finished. FHEM should be restarted now.","restartBtn":"restart now"}}}}')}});
\ No newline at end of file