platypush/platypush/backend/http/webapp/dist/static/js/chunk-1b24f8bf.da3d43c1.js

2 lines
14 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1b24f8bf"],{"0a57":function(e,t,n){"use strict";(function(t){var n,a;(function(){var e=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame,i=t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||t.msCancelAnimationFrame;e&&i?(n=function(t){var n={value:null};function a(){n.value=e(a),t()}return a(),n},a=function(e){i(e.value)}):(n=setInterval,a=clearInterval)})();var i=500,r=.08,o=2*Math.PI,c=2/Math.sqrt(2);function s(e,t,n,a){e.beginPath(),e.arc(t,n,a,0,o,!1),e.fill()}function h(e,t,n,a,i){e.beginPath(),e.moveTo(t,n),e.lineTo(a,i),e.stroke()}function l(e,t,n,a,i,r,c,h){var l=Math.cos(t*o),u=Math.sin(t*o);h-=c,s(e,n-u*i,a+l*r+.5*h,c+(1-.5*l)*h)}function u(e,t,n,a,i,r,o,c){var s;for(s=5;s--;)l(e,t+s/5,n,a,i,r,o,c)}function d(e,t,n,a,i,r,o){t/=3e4;var c=.21*i,s=.12*i,h=.24*i,l=.28*i;e.fillStyle=o,u(e,t,n,a,c,s,h,l),e.globalCompositeOperation="destination-out",u(e,t,n,a,c,s,h-r,l-r),e.globalCompositeOperation="source-over"}function f(e,t,n,a,i,r,c){t/=12e4;var s,l,u,d,f=.25*i-.5*r,v=.32*i+.5*r,p=.5*i-.5*r;for(e.strokeStyle=c,e.lineWidth=r,e.lineCap="round",e.lineJoin="round",e.beginPath(),e.arc(n,a,f,0,o,!1),e.stroke(),s=8;s--;)l=(t+s/8)*o,u=Math.cos(l),d=Math.sin(l),h(e,n+u*v,a+d*v,n+u*p,a+d*p)}function v(e,t,n,a,i,r,s){t/=15e3;var h=.29*i-.5*r,l=.05*i,u=Math.cos(t*o),d=u*o/-16;e.strokeStyle=s,e.lineWidth=r,e.lineCap="round",e.lineJoin="round",n+=u*l,e.beginPath(),e.arc(n,a,h,d+o/8,d+7*o/8,!1),e.arc(n+Math.cos(d)*h*c,a+Math.sin(d)*h*c,h,d+5*o/8,d+3*o/8,!0),e.closePath(),e.stroke()}function p(e,t,n,a,i,r,c){t/=1350;var s,h,l,u,d=.16*i,f=11*o/12,v=7*o/12;for(e.fillStyle=c,s=4;s--;)h=(t+s/4)%1,l=n+(s-1.5)/1.5*(1===s||2===s?-1:1)*d,u=a+h*h*i,e.beginPath(),e.moveTo(l,u-1.5*r),e.arc(l,u,.75*r,f,v,!1),e.fill()}function g(e,t,n,a,i,r,o){t/=750;var c,s,l,u,d=.1875*i;for(e.strokeStyle=o,e.lineWidth=.5*r,e.lineCap="round",e.lineJoin="round",c=4;c--;)s=(t+c/4)%1,l=Math.floor(n+(c-1.5)/1.5*(1===c||2===c?-1:1)*d)+.5,u=a+s*i,h(e,l,u-1.5*r,l,u+1.5*r)}function m(e,t,n,a,i,r,c){t/=3e3;var s,l,u,d,f=.16*i,v=.75*r,p=t*o*.7,g=Math.cos(p)*v,m=Math.sin(p)*v,w=p+o/3,b=Math.cos(w)*v,y=Math.sin(w)*v,M=p+2*o/3,O=Math.cos(M)*v,C=Math.sin(M)*v;for(e.strokeStyle=c,e.lineWidth=.5*r,e.lineCap="round",e.lineJoin="round",s=4;s--;)l=(t+s/4)%1,u=n+Math.sin((l+s/4)*o)*f,d=a+l*i,h(e,u-g,d-m,u+g,d+m),h(e,u-b,d-y,u+b,d+y),h(e,u-O,d-C,u+O,d+C)}function w(e,t,n,a,i,r,o){t/=3e4;var c=.21*i,s=.06*i,h=.21*i,l=.28*i;e.fillStyle=o,u(e,t,n,a,c,s,h,l),e.globalCompositeOperation="destination-out",u(e,t,n,a,c,s,h-r,l-r),e.globalCompositeOperation="source-over"}var b=[[-.75,-.18,-.7219,-.1527,-.6971,-.1225,-.6739,-.091,-.6516,-.0588,-.6298,-.0262,-.6083,.0065,-.5868,.0396,-.5643,.0731,-.5372,.1041,-.5033,.1259,-.4662,.1406,-.4275,.1493,-.3881,.153,-.3487,.1526,-.3095,.1488,-.2708,.1421,-.2319,.1342,-.1943,.1217,-.16,.1025,-.129,.0785,-.1012,.0509,-.0764,.0206,-.0547,-.012,-.0378,-.0472,-.0324,-.0857,-.0389,-.1241,-.0546,-.1599,-.0814,-.1876,-.1193,-.1964,-.1582,-.1935,-.1931,-.1769,-.2157,-.1453,-.229,-.1085,-.2327,-.0697,-.224,-.0317,-.2064,.0033,-.1853,.0362,-.1613,.0672,-.135,.0961,-.1051,.1213,-.0706,.1397,-.0332,.1512,.0053,.158,.0442,.1624,.0833,.1636,.1224,.1615,.1613,.1565,.1999,.15,.2378,.1402,.2749,.1279,.3118,.1147,.3487,.1015,.3858,.0892,.4236,.0787,.4621,.0715,.5012,.0702,.5398,.0766,.5768,.089,.6123,.1055,.6466,.1244,.6805,.144,.7147,.163,.75,.18],[-.75,0,-.7033,.0195,-.6569,.0399,-.6104,.06,-.5634,.0789,-.5155,.0954,-.4667,.1089,-.4174,.1206,-.3676,.1299,-.3174,.1365,-.2669,.1398,-.2162,.1391,-.1658,.1347,-.1157,.1271,-.0661,.1169,-.017,.1046,.0316,.0903,.0791,.0728,.1259,.0534,.1723,.0331,.2188,.0129,.2656,-.0064,.3122,-.0263,.3586,-.0466,.4052,-.0665,.4525,-.0847,.5007,-.1002,.5497,-.113,.5991,-.124,.6491,-.1325,.6994,-.138,.75,-.14]],y=[{start:.36,end:.11},{start:.56,end:.16}];function M(e,t,n,a,i,r,c){var s=i/8,h=s/3,l=2*h,u=t%1*o,d=Math.cos(u),f=Math.sin(u);e.fillStyle=c,e.strokeStyle=c,e.lineWidth=r,e.lineCap="round",e.lineJoin="round",e.beginPath(),e.arc(n,a,s,u,u+Math.PI,!1),e.arc(n-h*d,a-h*f,l,u+Math.PI,u,!1),e.arc(n+l*d,a+l*f,h,u+Math.PI,u,!0),e.globalCompositeOperation="destination-out",e.fill(),e.globalCompositeOperation="source-over",e.stroke()}function O(e,t,n,a,i,r,o,c,s){t/=2500;var h,l,u,d,f=b[o],v=(t+o-y[o].start)%c,p=(t+o-y[o].end)%c,g=(t+o)%c;if(e.strokeStyle=s,e.lineWidth=r,e.lineCap="round",e.lineJoin="round",v<1){if(e.beginPath(),v*=f.length/2-1,h=Math.floor(v),v-=h,h*=2,h+=2,e.moveTo(n+(f[h-2]*(1-v)+f[h]*v)*i,a+(f[h-1]*(1-v)+f[h+1]*v)*i),p<1){for(p*=f.length/2-1,l=Math.floor(p),p-=l,l*=2,l+=2,d=h;d!==l;d+=2)e.lineTo(n+f[d]*i,a+f[d+1]*i);e.lineTo(n+(f[l-2]*(1-p)+f[l]*p)*i,a+(f[l-1]*(1-p)+f[l+1]*p)*i)}else for(d=h;d!==f.length;d+=2)e.lineTo(n+f[d]*i,a+f[d+1]*i);e.stroke()}else if(p<1){for(e.beginPath(),p*=f.length/2-1,l=Math.floor(p),p-=l,l*=2,l+=2,e.moveTo(n+f[0]*i,a+f[1]*i),d=2;d!==l;d+=2)e.lineTo(n+f[d]*i,a+f[d+1]*i);e.lineTo(n+(f[l-2]*(1-p)+f[l]*p)*i,a+(f[l-1]*(1-p)+f[l+1]*p)*i),e.stroke()}g<1&&(g*=f.length/2-1,u=Math.floor(g),g-=u,u*=2,u+=2,M(e,t,n+(f[u-2]*(1-g)+f[u]*g)*i,a+(f[u-1]*(1-g)+f[u+1]*g)*i,i,r,s))}var C=function(e){this.list=[],this.interval=null,this.color=e&&e.color?e.color:"black",this.resizeClear=!(!e||!e.resizeClear)};C.CLEAR_DAY=function(e,t,n){var a=e.canvas.width,i=e.canvas.height,o=Math.min(a,i);f(e,t,.5*a,.5*i,o,o*r,n)},C.CLEAR_NIGHT=function(e,t,n){var a=e.canvas.width,i=e.canvas.height,o=Math.min(a,i);v(e,t,.5*a,.5*i,o,o*r,n)},C.PARTLY_CLOUDY_DAY=function(e,t,n){var a=e.canvas.width,i=e.canvas.height,o=Math.min(a,i);f(e,t,.625*a,.375*i,.75*o,o*r,n),d(e,t,.375*a,.625*i,.75*o,o*r,n)},C.PARTLY_CLOUDY_NIGHT=function(e,t,n){var a=e.canvas.width,i=e.canvas.height,o=Math.min(a,i);v(e,t,.667*a,.375*i,.75*o,o*r,n),d(e,t,.375*a,.625*i,.75*o,o*r,n)},C.CLOUDY=function(e,t,n){var a=e.canvas.width,i=e.canvas.height,o=Math.min(a,i);d(e,t,.5*a,.5*i,o,o*r,n)},C.RAIN=function(e,t,n){var a=e.canvas.width,i=e.canvas.height,o=Math.min(a,i);p(e,t,.5*a,.37*i,.9*o,o*r,n),d(e,t,.5*a,.37*i,.9*o,o*r,n)},C.SLEET=function(e,t,n){var a=e.canvas.width,i=e.canvas.height,o=Math.min(a,i);g(e,t,.5*a,.37*i,.9*o,o*r,n),d(e,t,.5*a,.37*i,.9*o,o*r,n)},C.SNOW=function(e,t,n){var a=e.canvas.width,i=e.canvas.height,o=Math.min(a,i);m(e,t,.5*a,.37*i,.9*o,o*r,n),d(e,t,.5*a,.37*i,.9*o,o*r,n)},C.WIND=function(e,t,n){var a=e.canvas.width,i=e.canvas.height,o=Math.min(a,i);O(e,t,.5*a,.5*i,o,o*r,0,2,n),O(e,t,.5*a,.5*i,o,o*r,1,2,n)},C.FOG=function(e,t,n){var a=e.canvas.width,i=e.canvas.height,c=Math.min(a,i),s=c*r;w(e,t,.5*a,.32*i,.75*c,s,n),t/=5e3;var l=Math.cos(t*o)*c*.02,u=Math.cos((t+.25)*o)*c*.02,d=Math.cos((t+.5)*o)*c*.02,f=Math.cos((t+.75)*o)*c*.02,v=.936*i,p=Math.floor(v-.5*s)+.5,g=Math.floor(v-2.5*s)+.5;e.strokeStyle=n,e.lineWidth=s,e.lineCap="round",e.lineJoin="round",h(e,l+.2*a+.5*s,p,u+.8*a-.5*s,p),h(e,d+.2*a+.5*s,g,f+.8*a-.5*s,g)},C.prototype={_determineDrawingFunction:function(e){return"string"===typeof e&&(e=C[e.toUpperCase().replace(/-/g,"_")]||null),e},add:function(e,t){var n;"string"===typeof e&&(e=document.getElementById(e)),null!==e&&void 0!==e&&(t=this._determineDrawingFunction(t),"function"===typeof t&&(n={element:e,context:e.getContext("2d"),drawing:t},this.list.push(n),this.draw(n,i)))},set:function(e,t){var n;for("string"===typeof e&&(e=document.getElementById(e)),n=this.list.length;n--;)if(this.list[n].element===e)return this.list[n].drawing=this._determineDrawingFunction(t),void this.draw(this.list[n],i);this.add(e,t)},remove:function(e){var t;for("string"===typeof e&&(e=document.getElementById(e)),t=this.list.length;t--;)if(this.list[t].element===e)return void this.list.splice(t,1)},draw:function(e,t){var n=e.context.canvas;this.resizeClear?n.width=n.width:e.context.clearRect(0,0,n.width,n.height),e.drawing(e.context,t,this.color)},play:function(){var e=this;this.pause(),this.interval=n((function(){var t,n=Date.now();for(t=e.list.length;t--;)e.draw(e.list[t],n)}),1e3/60)},pause:function(){this.interval&&(a(this.interval),this.interval=null)}},e.exports=C}).call(this,n("c8ba"))},"0cb2":function(e,t,n){var a=n("7b0b"),i=Math.floor,r="".replace,o=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,c=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,n,s,h,l){var u=n+e.length,d=s.length,f=c;return void 0!==h&&(h=a(h),f=o),r.call(l,f,(function(a,r){var o;switch(r.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(u);case"<":o=h[r.slice(1,-1)];break;default:var c=+r;if(0===c)return a;if(c>d){var l=i(c/10);return 0===l?a:l<=d?void 0===s[l-1]?r.charAt(1):s[l-1]+r.charAt(1):a}o=s[c-1]}return void 0===o?"":o}))}},"2f42":function(e,t,n){},5319:function(e,t,n){"use strict";var a=n("d784"),i=n("d039"),r=n("825a"),o=n("50c4"),c=n("a691"),s=n("1d80"),h=n("8aa5"),l=n("0cb2"),u=n("14c3"),d=n("b622"),f=d("replace"),v=Math.max,p=Math.min,g=function(e){return void 0===e?e:String(e)},m=function(){return"$0"==="a".replace(/./,"$0")}(),w=function(){return!!/./[f]&&""===/./[f]("a","$0")}(),b=!i((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}));a("replace",(function(e,t,n){var a=w?"$":"$0";return[function(e,n){var a=s(this),i=void 0==e?void 0:e[f];return void 0!==i?i.call(e,a,n):t.call(String(a),e,n)},function(e,i){if("string"===typeof i&&-1===i.indexOf(a)&&-1===i.indexOf("$<")){var s=n(t,this,e,i);if(s.done)return s.value}var d=r(this),f=String(e),m="function"===typeof i;m||(i=String(i));var w=d.global;if(w){var b=d.unicode;d.lastIndex=0}var y=[];while(1){var M=u(d,f);if(null===M)break;if(y.push(M),!w)break;var O=String(M[0]);""===O&&(d.lastIndex=h(f,o(d.lastIndex),b))}for(var C="",k=0,S=0;S<y.length;S++){M=y[S];for(var I=String(M[0]),j=v(p(c(M.index),f.length),0),P=[],_=1;_<M.length;_++)P.push(g(M[_]));var x=M.groups;if(m){var A=[I].concat(P,j,f);void 0!==x&&A.push(x);var T=String(i.apply(void 0,A))}else T=l(I,f,j,P,x,i);j>=k&&(C+=f.slice(k,j)+T,k=j+I.length)}return C+f.slice(k)}]}),!b||!m||w)},"5b43":function(e,t,n){"use strict";n.r(t);n("99af");var a=n("7a23"),i=Object(a["K"])("data-v-bc8e796e");Object(a["u"])("data-v-bc8e796e");var r={class:"weather"},o={key:1},c={key:2,class:"temperature"};Object(a["s"])();var s=i((function(e,t,n,i,s,h){var l,u=Object(a["z"])("Loading"),d=Object(a["z"])("skycons");return Object(a["r"])(),Object(a["e"])("div",r,[e.loading?(Object(a["r"])(),Object(a["e"])(u,{key:0})):(Object(a["r"])(),Object(a["e"])("h1",o,[h._showIcon&&e.weatherIcon&&"weather.darksky"===e.weatherPlugin?(Object(a["r"])(),Object(a["e"])(d,{key:0,condition:e.weatherIcon,paused:!n.animate,size:n.iconSize,color:n.iconColor},null,8,["condition","paused","size","color"])):h._showIcon&&e.weatherIcon&&"weather.openweathermap"===e.weatherPlugin?(Object(a["r"])(),Object(a["e"])("img",{key:1,src:"/icons/openweathermap/".concat(n.iconColor||"dark","/").concat(e.weatherIcon,".png"),alt:null===(l=e.weather)||void 0===l?void 0:l.summary,width:1.5*n.iconSize,height:1.5*n.iconSize,class:"owm-icon"},null,8,["src","alt","width","height"])):Object(a["f"])("",!0),h._showTemperature&&e.weather?(Object(a["r"])(),Object(a["e"])("span",c,Object(a["C"])(Math.round(parseFloat(e.weather.temperature))+"°"),1)):Object(a["f"])("",!0)])),h._showSummary&&e.weather&&e.weather.summary?(Object(a["r"])(),Object(a["e"])("div",{key:2,class:"summary",textContent:Object(a["C"])(e.weather.summary)},null,8,["textContent"])):Object(a["f"])("",!0)])})),h=n("b85c"),l=n("5530"),u=n("1da1"),d=(n("96cf"),n("a9e3"),n("b680"),n("3e54"));function f(e,t,n,i,r,o){return Object(a["r"])(),Object(a["e"])("canvas",{width:o.width,height:o.height,"data-condition":n.condition},null,8,["width","height","data-condition"])}n("ac1f"),n("5319");var v=n("0a57"),p=n.n(v);function g(e){var t={};return t.paused=!e.interval,t.play=function(){e.play(),t.paused=!1},t.pause=function(){e.pause(),t.paused=!0},t}var m={props:{condition:{type:String,required:!0},size:{type:[Number,String],default:64},color:{type:String,default:"black"},paused:{type:Boolean,default:!1}},computed:{width:function(){return""+this.size},height:function(){return""+this.size},icon:function(){return this.condition.toUpperCase().replace(/[\s.-]/g,"_")}},mounted:function(){var e=new p.a({color:this.color});e.set(this.$el,p.a[this.icon]),this.paused||e.play(),this.$emit("load",g(e))}};m.render=f;var w=m,b=w,y=n("3a5e"),M={name:"Weather",mixins:[d["a"]],components:{Loading:y["a"],Skycons:b},props:{animate:{required:!1,default:!0},iconSize:{type:Number,required:!1,default:50},iconColor:{type:String,required:!1},showIcon:{required:!1,default:!0},showSummary:{required:!1,default:!0},showTemperature:{required:!1,default:!0},refreshSeconds:{type:Number,required:!1,default:900}},data:function(){return{weather:void 0,weatherIcon:void 0,weatherPlugin:void 0,loading:!1,weatherPlugins:["weather.openweathermap","weather.darksky"]}},computed:{_showSummary:function(){return this.parseBoolean(this.showSummary)},_showIcon:function(){return this.parseBoolean(this.showIcon)},_showTemperature:function(){return this.parseBoolean(this.showTemperature)}},methods:{refresh:function(){var e=this;return Object(u["a"])(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,t.prev=1,t.next=4,e.request("".concat(e.weatherPlugin,".get_current_weather"));case 4:n=t.sent,e.onWeatherChange(n);case 6:return t.prev=6,e.loading=!1,t.finish(6);case 9:case"end":return t.stop()}}),t,null,[[1,,6,9]])})))()},onWeatherChange:function(e){this.weather||(this.weather={}),this.weather=Object(l["a"])(Object(l["a"])({},this.weather),e),this.weatherIcon=this.weather.icon},initWeatherPlugin:function(){var e,t=Object(h["a"])(this.weatherPlugins);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(this.$root.config[n]){this.weatherPlugin=n,console.debug("Initialized weather UI - plugin: ".concat(n));break}}}catch(a){t.e(a)}finally{t.f()}this.weatherPlugin||console.warn("No weather plugins configured. Compatible plugins: ".concat(this.weatherPlugins))}},mounted:function(){this.initWeatherPlugin(),this.refresh(),this.subscribe(this.onWeatherChange,null,"platypush.message.event.weather.NewWeatherConditionEvent"),setInterval(this.refresh,parseInt((1e3*this.refreshSeconds).toFixed(0)))}};n("6fc2");M.render=s,M.__scopeId="data-v-bc8e796e";t["default"]=M},"6fc2":function(e,t,n){"use strict";n("2f42")}}]);
//# sourceMappingURL=chunk-1b24f8bf.da3d43c1.js.map