platypush/platypush/backend/http/webapp/dist/static/js/chunk-6c9a679d.32394b9f.js

2 lines
14 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6c9a679d"],{"0a57":function(e,t,n){"use strict";(function(t){var n,i;(function(){var e=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame,a=t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||t.msCancelAnimationFrame;e&&a?(n=function(t){var n={value:null};function i(){n.value=e(i),t()}return i(),n},i=function(e){a(e.value)}):(n=setInterval,i=clearInterval)})();var a=500,r=.08,o=2*Math.PI,s=2/Math.sqrt(2);function c(e,t,n,i){e.beginPath(),e.arc(t,n,i,0,o,!1),e.fill()}function h(e,t,n,i,a){e.beginPath(),e.moveTo(t,n),e.lineTo(i,a),e.stroke()}function l(e,t,n,i,a,r,s,h){var l=Math.cos(t*o),u=Math.sin(t*o);h-=s,c(e,n-u*a,i+l*r+.5*h,s+(1-.5*l)*h)}function u(e,t,n,i,a,r,o,s){var c;for(c=5;c--;)l(e,t+c/5,n,i,a,r,o,s)}function d(e,t,n,i,a,r,o){t/=3e4;var s=.21*a,c=.12*a,h=.24*a,l=.28*a;e.fillStyle=o,u(e,t,n,i,s,c,h,l),e.globalCompositeOperation="destination-out",u(e,t,n,i,s,c,h-r,l-r),e.globalCompositeOperation="source-over"}function f(e,t,n,i,a,r,s){t/=12e4;var c,l,u,d,f=.25*a-.5*r,v=.32*a+.5*r,g=.5*a-.5*r;for(e.strokeStyle=s,e.lineWidth=r,e.lineCap="round",e.lineJoin="round",e.beginPath(),e.arc(n,i,f,0,o,!1),e.stroke(),c=8;c--;)l=(t+c/8)*o,u=Math.cos(l),d=Math.sin(l),h(e,n+u*v,i+d*v,n+u*g,i+d*g)}function v(e,t,n,i,a,r,c){t/=15e3;var h=.29*a-.5*r,l=.05*a,u=Math.cos(t*o),d=u*o/-16;e.strokeStyle=c,e.lineWidth=r,e.lineCap="round",e.lineJoin="round",n+=u*l,e.beginPath(),e.arc(n,i,h,d+o/8,d+7*o/8,!1),e.arc(n+Math.cos(d)*h*s,i+Math.sin(d)*h*s,h,d+5*o/8,d+3*o/8,!0),e.closePath(),e.stroke()}function g(e,t,n,i,a,r,s){t/=1350;var c,h,l,u,d=.16*a,f=11*o/12,v=7*o/12;for(e.fillStyle=s,c=4;c--;)h=(t+c/4)%1,l=n+(c-1.5)/1.5*(1===c||2===c?-1:1)*d,u=i+h*h*a,e.beginPath(),e.moveTo(l,u-1.5*r),e.arc(l,u,.75*r,f,v,!1),e.fill()}function p(e,t,n,i,a,r,o){t/=750;var s,c,l,u,d=.1875*a;for(e.strokeStyle=o,e.lineWidth=.5*r,e.lineCap="round",e.lineJoin="round",s=4;s--;)c=(t+s/4)%1,l=Math.floor(n+(s-1.5)/1.5*(1===s||2===s?-1:1)*d)+.5,u=i+c*a,h(e,l,u-1.5*r,l,u+1.5*r)}function m(e,t,n,i,a,r,s){t/=3e3;var c,l,u,d,f=.16*a,v=.75*r,g=t*o*.7,p=Math.cos(g)*v,m=Math.sin(g)*v,w=g+o/3,b=Math.cos(w)*v,y=Math.sin(w)*v,M=g+2*o/3,C=Math.cos(M)*v,O=Math.sin(M)*v;for(e.strokeStyle=s,e.lineWidth=.5*r,e.lineCap="round",e.lineJoin="round",c=4;c--;)l=(t+c/4)%1,u=n+Math.sin((l+c/4)*o)*f,d=i+l*a,h(e,u-p,d-m,u+p,d+m),h(e,u-b,d-y,u+b,d+y),h(e,u-C,d-O,u+C,d+O)}function w(e,t,n,i,a,r,o){t/=3e4;var s=.21*a,c=.06*a,h=.21*a,l=.28*a;e.fillStyle=o,u(e,t,n,i,s,c,h,l),e.globalCompositeOperation="destination-out",u(e,t,n,i,s,c,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,i,a,r,s){var c=a/8,h=c/3,l=2*h,u=t%1*o,d=Math.cos(u),f=Math.sin(u);e.fillStyle=s,e.strokeStyle=s,e.lineWidth=r,e.lineCap="round",e.lineJoin="round",e.beginPath(),e.arc(n,i,c,u,u+Math.PI,!1),e.arc(n-h*d,i-h*f,l,u+Math.PI,u,!1),e.arc(n+l*d,i+l*f,h,u+Math.PI,u,!0),e.globalCompositeOperation="destination-out",e.fill(),e.globalCompositeOperation="source-over",e.stroke()}function C(e,t,n,i,a,r,o,s,c){t/=2500;var h,l,u,d,f=b[o],v=(t+o-y[o].start)%s,g=(t+o-y[o].end)%s,p=(t+o)%s;if(e.strokeStyle=c,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)*a,i+(f[h-1]*(1-v)+f[h+1]*v)*a),g<1){for(g*=f.length/2-1,l=Math.floor(g),g-=l,l*=2,l+=2,d=h;d!==l;d+=2)e.lineTo(n+f[d]*a,i+f[d+1]*a);e.lineTo(n+(f[l-2]*(1-g)+f[l]*g)*a,i+(f[l-1]*(1-g)+f[l+1]*g)*a)}else for(d=h;d!==f.length;d+=2)e.lineTo(n+f[d]*a,i+f[d+1]*a);e.stroke()}else if(g<1){for(e.beginPath(),g*=f.length/2-1,l=Math.floor(g),g-=l,l*=2,l+=2,e.moveTo(n+f[0]*a,i+f[1]*a),d=2;d!==l;d+=2)e.lineTo(n+f[d]*a,i+f[d+1]*a);e.lineTo(n+(f[l-2]*(1-g)+f[l]*g)*a,i+(f[l-1]*(1-g)+f[l+1]*g)*a),e.stroke()}p<1&&(p*=f.length/2-1,u=Math.floor(p),p-=u,u*=2,u+=2,M(e,t,n+(f[u-2]*(1-p)+f[u]*p)*a,i+(f[u-1]*(1-p)+f[u+1]*p)*a,a,r,c))}var O=function(e){this.list=[],this.interval=null,this.color=e&&e.color?e.color:"black",this.resizeClear=!(!e||!e.resizeClear)};O.CLEAR_DAY=function(e,t,n){var i=e.canvas.width,a=e.canvas.height,o=Math.min(i,a);f(e,t,.5*i,.5*a,o,o*r,n)},O.CLEAR_NIGHT=function(e,t,n){var i=e.canvas.width,a=e.canvas.height,o=Math.min(i,a);v(e,t,.5*i,.5*a,o,o*r,n)},O.PARTLY_CLOUDY_DAY=function(e,t,n){var i=e.canvas.width,a=e.canvas.height,o=Math.min(i,a);f(e,t,.625*i,.375*a,.75*o,o*r,n),d(e,t,.375*i,.625*a,.75*o,o*r,n)},O.PARTLY_CLOUDY_NIGHT=function(e,t,n){var i=e.canvas.width,a=e.canvas.height,o=Math.min(i,a);v(e,t,.667*i,.375*a,.75*o,o*r,n),d(e,t,.375*i,.625*a,.75*o,o*r,n)},O.CLOUDY=function(e,t,n){var i=e.canvas.width,a=e.canvas.height,o=Math.min(i,a);d(e,t,.5*i,.5*a,o,o*r,n)},O.RAIN=function(e,t,n){var i=e.canvas.width,a=e.canvas.height,o=Math.min(i,a);g(e,t,.5*i,.37*a,.9*o,o*r,n),d(e,t,.5*i,.37*a,.9*o,o*r,n)},O.SLEET=function(e,t,n){var i=e.canvas.width,a=e.canvas.height,o=Math.min(i,a);p(e,t,.5*i,.37*a,.9*o,o*r,n),d(e,t,.5*i,.37*a,.9*o,o*r,n)},O.SNOW=function(e,t,n){var i=e.canvas.width,a=e.canvas.height,o=Math.min(i,a);m(e,t,.5*i,.37*a,.9*o,o*r,n),d(e,t,.5*i,.37*a,.9*o,o*r,n)},O.WIND=function(e,t,n){var i=e.canvas.width,a=e.canvas.height,o=Math.min(i,a);C(e,t,.5*i,.5*a,o,o*r,0,2,n),C(e,t,.5*i,.5*a,o,o*r,1,2,n)},O.FOG=function(e,t,n){var i=e.canvas.width,a=e.canvas.height,s=Math.min(i,a),c=s*r;w(e,t,.5*i,.32*a,.75*s,c,n),t/=5e3;var l=Math.cos(t*o)*s*.02,u=Math.cos((t+.25)*o)*s*.02,d=Math.cos((t+.5)*o)*s*.02,f=Math.cos((t+.75)*o)*s*.02,v=.936*a,g=Math.floor(v-.5*c)+.5,p=Math.floor(v-2.5*c)+.5;e.strokeStyle=n,e.lineWidth=c,e.lineCap="round",e.lineJoin="round",h(e,l+.2*i+.5*c,g,u+.8*i-.5*c,g),h(e,d+.2*i+.5*c,p,f+.8*i-.5*c,p)},O.prototype={_determineDrawingFunction:function(e){return"string"===typeof e&&(e=O[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,a)))},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],a);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&&(i(this.interval),this.interval=null)}},e.exports=O}).call(this,n("c8ba"))},"2f42":function(e,t,n){},5319:function(e,t,n){"use strict";var i=n("d784"),a=n("825a"),r=n("7b0b"),o=n("50c4"),s=n("a691"),c=n("1d80"),h=n("8aa5"),l=n("14c3"),u=Math.max,d=Math.min,f=Math.floor,v=/\$([$&'`]|\d\d?|<[^>]*>)/g,g=/\$([$&'`]|\d\d?)/g,p=function(e){return void 0===e?e:String(e)};i("replace",2,(function(e,t,n,i){var m=i.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,w=i.REPLACE_KEEPS_$0,b=m?"$":"$0";return[function(n,i){var a=c(this),r=void 0==n?void 0:n[e];return void 0!==r?r.call(n,a,i):t.call(String(a),n,i)},function(e,i){if(!m&&w||"string"===typeof i&&-1===i.indexOf(b)){var r=n(t,e,this,i);if(r.done)return r.value}var c=a(e),f=String(this),v="function"===typeof i;v||(i=String(i));var g=c.global;if(g){var M=c.unicode;c.lastIndex=0}var C=[];while(1){var O=l(c,f);if(null===O)break;if(C.push(O),!g)break;var S=String(O[0]);""===S&&(c.lastIndex=h(f,o(c.lastIndex),M))}for(var k="",I=0,P=0;P<C.length;P++){O=C[P];for(var j=String(O[0]),_=u(d(s(O.index),f.length),0),A=[],T=1;T<O.length;T++)A.push(p(O[T]));var E=O.groups;if(v){var x=[j].concat(A,_,f);void 0!==E&&x.push(E);var z=String(i.apply(void 0,x))}else z=y(j,f,_,A,E,i);_>=I&&(k+=f.slice(I,_)+z,I=_+j.length)}return k+f.slice(I)}];function y(e,n,i,a,o,s){var c=i+e.length,h=a.length,l=g;return void 0!==o&&(o=r(o),l=v),t.call(s,l,(function(t,r){var s;switch(r.charAt(0)){case"$":return"$";case"&":return e;case"`":return n.slice(0,i);case"'":return n.slice(c);case"<":s=o[r.slice(1,-1)];break;default:var l=+r;if(0===l)return t;if(l>h){var u=f(l/10);return 0===u?t:u<=h?void 0===a[u-1]?r.charAt(1):a[u-1]+r.charAt(1):t}s=a[l-1]}return void 0===s?"":s}))}}))},"5b43":function(e,t,n){"use strict";n.r(t);n("99af");var i=n("7a23"),a=Object(i["K"])("data-v-bc8e796e");Object(i["u"])("data-v-bc8e796e");var r={class:"weather"},o={key:1},s={key:2,class:"temperature"};Object(i["s"])();var c=a((function(e,t,n,a,c,h){var l,u=Object(i["z"])("Loading"),d=Object(i["z"])("skycons");return Object(i["r"])(),Object(i["e"])("div",r,[e.loading?(Object(i["r"])(),Object(i["e"])(u,{key:0})):(Object(i["r"])(),Object(i["e"])("h1",o,[h._showIcon&&e.weatherIcon&&"weather.darksky"===e.weatherPlugin?(Object(i["r"])(),Object(i["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(i["r"])(),Object(i["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(i["f"])("",!0),h._showTemperature&&e.weather?(Object(i["r"])(),Object(i["e"])("span",s,Object(i["C"])(Math.round(parseFloat(e.weather.temperature))+"°"),1)):Object(i["f"])("",!0)])),h._showSummary&&e.weather&&e.weather.summary?(Object(i["r"])(),Object(i["e"])("div",{key:2,class:"summary",textContent:Object(i["C"])(e.weather.summary)},null,8,["textContent"])):Object(i["f"])("",!0)])})),h=(n("a9e3"),n("b680"),n("b85c")),l=n("5530"),u=(n("96cf"),n("1da1")),d=n("3e54");function f(e,t,n,a,r,o){return Object(i["r"])(),Object(i["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"),g=n.n(v);function p(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 g.a({color:this.color});e.set(this.$el,g.a[this.icon]),this.paused||e.play(),this.$emit("load",p(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(i){t.e(i)}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=c,M.__scopeId="data-v-bc8e796e";t["default"]=M},"6fc2":function(e,t,n){"use strict";n("2f42")}}]);
//# sourceMappingURL=chunk-6c9a679d.32394b9f.js.map