diff --git a/API.md b/API.md index 2e2a9ab..a37ddc6 100644 --- a/API.md +++ b/API.md @@ -6,8 +6,8 @@ - [POST /api/connection](#post-apiconnection) - [GET /api/system](#get-apisystem) - [POST /api/system](#post-apisystem) -- [GET /api/steps](#get-apisteps) -- [POST /api/steps](#post-apisteps) +- [GET /api/steps/values](#get-apistepsvalues) +- [POST /api/steps/values](#post-apistepsvalues) - [GET /api/triggers/time](#get-apitriggerstime) - [POST /api/triggers/time](#post-apitriggerstime) - [GET /api/triggers/motion](#get-apitriggersmotion) @@ -111,7 +111,7 @@ Updates the settings of the WiFi connections. The module will apply the new sett ## POST /api/system -## GET /api/steps +## GET /api/steps/values Returns the current brightness value for each step. The number of items in the array is equal to the number of configured steps. Each value has a range of 0 to 255. @@ -123,7 +123,7 @@ Returns the current brightness value for each step. The number of items in the a ] ``` -## POST /api/steps +## POST /api/steps/values Changes the brightness value for each step. If the number of values in the array is less than the number of configured steps, each subsequent step is considered to be off. diff --git a/WIRING.md b/WIRING.md index 2def5e3..277b080 100644 --- a/WIRING.md +++ b/WIRING.md @@ -1,4 +1,5 @@ ## Bill of materials 1. ESP8266 module (I based mine on a vanilla ESP8266 ESP-12F, but friendlier modules like the Wemos D1 should work as well) -1. PCA9685 16-channel PWM module \ No newline at end of file +1. PCA9685 16-channel PWM module +1. TODO complete this list \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index a153a1f..6d87b68 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -99,9 +99,9 @@ void setup() _dln("Setup :: registering routes"); registerStaticRoutes(&server); + registerAPIRoutes(&server); registerSettingsRoutes(&server); registerFirmwareRoutes(&server); - registerAPIRoutes(&server); _dln("Setup :: starting HTTP server"); server.onNotFound(handleNotFound); diff --git a/src/server/api.cpp b/src/server/api.cpp index 86b3e5b..8b60e62 100644 --- a/src/server/api.cpp +++ b/src/server/api.cpp @@ -16,7 +16,7 @@ #include "../settings/triggers/time.h" -void handleGetSteps(AsyncWebServerRequest *request) +void handleGetStepValues(AsyncWebServerRequest *request) { _dln("API :: get steps"); @@ -35,7 +35,7 @@ void handleGetSteps(AsyncWebServerRequest *request) } -void handlePostSteps(AsyncWebServerRequest *request, uint8_t *data, size_t len, size_t index, size_t total) +void handlePostStepValues(AsyncWebServerRequest *request, uint8_t *data, size_t len, size_t index, size_t total) { _dln("API :: post steps"); @@ -125,8 +125,8 @@ void handlePostMotionTriggers(AsyncWebServerRequest *request, uint8_t *data, siz void registerAPIRoutes(AsyncWebServer* server) { - server->on("/api/steps", HTTP_GET, handleGetSteps); - server->on("/api/steps", HTTP_POST, devNullRequest, devNullFileUpload, handlePostSteps); + server->on("/api/steps/values", HTTP_GET, handleGetStepValues); + server->on("/api/steps/values", HTTP_POST, devNullRequest, devNullFileUpload, handlePostStepValues); server->on("/api/triggers/time", HTTP_GET, handleGetTimeTriggers); server->on("/api/triggers/time", HTTP_POST, devNullRequest, devNullFileUpload, handlePostTimeTriggers); diff --git a/src/server/settings.cpp b/src/server/settings.cpp index 6b11f84..cf3ce35 100644 --- a/src/server/settings.cpp +++ b/src/server/settings.cpp @@ -116,6 +116,35 @@ void handlePostSystem(AsyncWebServerRequest *request, uint8_t *data, size_t len, } +void handleGetSteps(AsyncWebServerRequest *request) +{ + _dln("API :: get steps"); + + AsyncResponseStream *response = request->beginResponseStream("application/json"); + stepsSettings->toJson(*response); + request->send(response); +} + + +void handlePostSteps(AsyncWebServerRequest *request, uint8_t *data, size_t len, size_t index, size_t total) +{ + _dln("API :: post steps"); + + bool changed; + if (stepsSettings->fromJson((char*)data, &changed)) + { + stepsSettings->write(); + + if (changed) + stepsSettingsChanged = true; + + request->send(200); + } + else + request->send(400); +} + + void registerSettingsRoutes(AsyncWebServer* server) { server->on("/api/version", HTTP_GET, handleVersion); @@ -127,4 +156,7 @@ void registerSettingsRoutes(AsyncWebServer* server) server->on("/api/system", HTTP_GET, handleGetSystem); server->on("/api/system", HTTP_POST, devNullRequest, devNullFileUpload, handlePostSystem); + + server->on("/api/steps", HTTP_GET, handleGetSteps); + server->on("/api/steps", HTTP_POST, devNullRequest, devNullFileUpload, handlePostSteps); } \ No newline at end of file diff --git a/web/app.js b/web/app.js index c7e9410..708477c 100644 --- a/web/app.js +++ b/web/app.js @@ -1,6 +1,5 @@ function startApp() { - // TODO support for disable checkboxes Vue.component('check', { template: '
{{ title }}
', props: { @@ -370,7 +369,7 @@ function startApp() loadSteps: function() { var self = this; - return axios.get('/api/steps') + return axios.get('/api/steps/values') .then(function(response) { if (Array.isArray(response.data)) @@ -627,7 +626,7 @@ function startApp() self.disableStepsChanged = false; - axios.post('/api/steps', { + axios.post('/api/steps/values', { transitionTime: 1000, values: steps }) diff --git a/web/dist/bundle.js b/web/dist/bundle.js index 4945cfe..69ef4ed 100644 --- a/web/dist/bundle.js +++ b/web/dist/bundle.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function r(e){var t=new a(e),n=o(a.prototype.request,t);return i.extend(n,a.prototype,t),i.extend(n,t),n}var i=n(2),o=n(3),a=n(5),s=n(6),c=r(s);c.Axios=a,c.create=function(e){return r(i.merge(s,e))},c.Cancel=n(23),c.CancelToken=n(24),c.isCancel=n(20),c.all=function(e){return Promise.all(e)},c.spread=n(25),e.exports=c,e.exports.default=c},function(e,t,n){"use strict";function r(e){return"[object Array]"===l.call(e)}function i(e){return null!==e&&"object"==typeof e}function o(e){return"[object Function]"===l.call(e)}function a(e,t){if(null!==e&&void 0!==e)if("object"!=typeof e&&(e=[e]),r(e))for(var n=0,i=e.length;n=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},o.forEach(["delete","get","head"],function(e){c.headers[e]={}}),o.forEach(["post","put","patch"],function(e){c.headers[e]=o.merge(s)}),e.exports=c},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t){r.forEach(e,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])})}},function(e,t,n){"use strict";var r=n(2),i=n(9),o=n(12),a=n(13),s=n(14),c=n(10),l="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||n(15);e.exports=function(e){return new Promise(function(t,u){var f=e.data,d=e.headers;r.isFormData(f)&&delete d["Content-Type"];var p=new XMLHttpRequest,h="onreadystatechange",v=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in p||s(e.url)||(p=new window.XDomainRequest,h="onload",v=!0,p.onprogress=function(){},p.ontimeout=function(){}),e.auth){var m=e.auth.username||"",g=e.auth.password||"";d.Authorization="Basic "+l(m+":"+g)}if(p.open(e.method.toUpperCase(),o(e.url,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p[h]=function(){if(p&&(4===p.readyState||v)&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in p?a(p.getAllResponseHeaders()):null,r={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:1223===p.status?204:p.status,statusText:1223===p.status?"No Content":p.statusText,headers:n,config:e,request:p};i(t,u,r),p=null}},p.onerror=function(){u(c("Network Error",e,null,p)),p=null},p.ontimeout=function(){u(c("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var y=n(16),b=(e.withCredentials||s(e.url))&&e.xsrfCookieName?y.read(e.xsrfCookieName):void 0;b&&(d[e.xsrfHeaderName]=b)}if("setRequestHeader"in p&&r.forEach(d,function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete d[t]:p.setRequestHeader(t,e)}),e.withCredentials&&(p.withCredentials=!0),e.responseType)try{p.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){p&&(p.abort(),u(e),p=null)}),void 0===f&&(f=null),p.send(f)})}},function(e,t,n){"use strict";var r=n(10);e.exports=function(e,t,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},function(e,t,n){"use strict";var r=n(11);e.exports=function(e,t,n,i,o){var a=new Error(e);return r(a,t,n,i,o)}},function(e,t){"use strict";e.exports=function(e,t,n,r,i){return e.config=t,n&&(e.code=n),e.request=r,e.response=i,e}},function(e,t,n){"use strict";function r(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var i=n(2);e.exports=function(e,t,n){if(!t)return e;var o;if(n)o=n(t);else if(i.isURLSearchParams(t))o=t.toString();else{var a=[];i.forEach(t,function(e,t){null!==e&&void 0!==e&&(i.isArray(e)&&(t+="[]"),i.isArray(e)||(e=[e]),i.forEach(e,function(e){i.isDate(e)?e=e.toISOString():i.isObject(e)&&(e=JSON.stringify(e)),a.push(r(t)+"="+r(e))}))}),o=a.join("&")}return o&&(e+=(-1===e.indexOf("?")?"?":"&")+o),e}},function(e,t,n){"use strict";var r=n(2),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,o,a={};return e?(r.forEach(e.split("\n"),function(e){if(o=e.indexOf(":"),t=r.trim(e.substr(0,o)).toLowerCase(),n=r.trim(e.substr(o+1)),t){if(a[t]&&i.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}}),a):a}},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){function e(e){var t=e;return n&&(i.setAttribute("href",t),t=i.href),i.setAttribute("href",t),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}var t,n=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");return t=e(window.location.href),function(n){var i=r.isString(n)?e(n):n;return i.protocol===t.protocol&&i.host===t.host}}():function(){return!0}},function(e,t){"use strict";function n(){this.message="String contains an invalid character"}var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.prototype=new Error,n.prototype.code=5,n.prototype.name="InvalidCharacterError",e.exports=function(e){for(var t,i,o=String(e),a="",s=0,c=r;o.charAt(0|s)||(c="=",s%1);a+=c.charAt(63&t>>8-s%1*8)){if((i=o.charCodeAt(s+=.75))>255)throw new n;t=t<<8|i}return a}},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,i,o,a){var s=[];s.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(i)&&s.push("path="+i),r.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,n){"use strict";function r(){this.handlers=[]}var i=n(2);r.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},r.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},r.prototype.forEach=function(e){i.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=r},function(e,t,n){"use strict";function r(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var i=n(2),o=n(19),a=n(20),s=n(6),c=n(21),l=n(22);e.exports=function(e){return r(e),e.baseURL&&!c(e.url)&&(e.url=l(e.baseURL,e.url)),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=i.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),i.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||s.adapter)(e).then(function(t){return r(e),t.data=o(t.data,t.headers,e.transformResponse),t},function(t){return a(t)||(r(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t,n){return r.forEach(n,function(n){e=n(e,t)}),e}},function(e,t){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,n){"use strict";function r(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;e(function(e){n.reason||(n.reason=new i(e),t(n.reason))})}var i=n(23);r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var e;return{token:new r(function(t){e=t}),cancel:e}},e.exports=r},function(e,t){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}}])}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Vue=t()}(this,function(){"use strict";function e(e){return void 0===e||null===e}function t(e){return void 0!==e&&null!==e}function n(e){return!0===e}function r(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function i(e){return null!==e&&"object"==typeof e}function o(e){return"[object Object]"===hn.call(e)}function a(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function s(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function c(e){var t=parseFloat(e);return isNaN(t)?e:t}function l(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(n,1)}}function f(e,t){return gn.call(e,t)}function d(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}function p(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n}function h(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function v(e,t){for(var n in t)e[n]=t[n];return e}function m(e){for(var t={},n=0;n0&&(G((c=i(c,(a||"")+"_"+s))[0])&&G(u)&&(f[l]=k(u.text+c[0].text),c.shift()),f.push.apply(f,c)):r(c)?G(u)?f[l]=k(u.text+c):""!==c&&f.push(k(c)):G(c)&&G(u)?f[l]=k(u.text+c.text):(n(o._isVList)&&t(c.tag)&&e(c.key)&&t(a)&&(c.key="__vlist"+a+"_"+s+"__"),f.push(c)));return f}(l):void 0:c===Fr&&(s=function(e){for(var t=0;t=0||n.indexOf(e[i])<0)&&r.push(e[i]);return r}return e}(n[o],r[o],i[o]));return t}(e);r&&v(e.extendOptions,r),(t=e.options=I(n,e.extendOptions)).name&&(t.components[t.name]=e)}}return t}function Ee(e){this._init(e)}function Pe(e){return e&&(e.Ctor.options.name||e.tag)}function De(e,t){return Array.isArray(e)?e.indexOf(t)>-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,!("[object RegExp]"!==hn.call(n))&&e.test(t));var n}function je(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=Pe(a.componentOptions);s&&!t(s)&&Ie(n,o,r,i)}}}function Ie(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,u(n,t)}function Le(e,n){return{staticClass:Fe(e.staticClass,n.staticClass),class:t(e.class)?[e.class,n.class]:n.class}}function Fe(e,t){return e?t?e+" "+t:e:t||""}function Ne(e){return Array.isArray(e)?function(e){for(var n,r="",i=0,o=e.length;i=0&&" "===(b=e.charAt(y));y--);b&&Ti.test(b)||(p=!0)}}else void 0===o?(g=i+1,o=e.slice(0,i).trim()):t();if(void 0===o?o=e.slice(0,i).trim():0!==g&&t(),a)for(i=0;i-1?{exp:e.slice(0,Kr),key:'"'+e.slice(Kr+1)+'"'}:{exp:e,key:null};for(zr=e,Kr=Jr=Gr=0;!st();)ct(qr=at())?lt(qr):91===qr&&function(e){var t=1;for(Jr=Kr;!st();)if(e=at(),ct(e))lt(e);else if(91===e&&t++,93===e&&t--,0===t){Gr=Kr;break}}(qr);return{exp:e.slice(0,Jr),key:e.slice(Jr+1,Gr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function at(){return zr.charCodeAt(++Kr)}function st(){return Kr>=Hr}function ct(e){return 34===e||39===e}function lt(e){for(var t=e;!st()&&(e=at())!==t;);}function ut(e,t,n,r,i){var o,a,s,c,l;t=(l=t)._withTask||(l._withTask=function(){dr=!0;var e=l.apply(null,arguments);return dr=!1,e}),n&&(o=t,a=e,s=r,c=Xr,t=function e(){null!==o.apply(null,arguments)&&ft(a,e,s,c)}),Xr.addEventListener(e,t,Wn?{capture:r,passive:i}:r)}function ft(e,t,n,r){(r||Xr).removeEventListener(e,t._withTask||t,n)}function dt(n,r){if(!e(n.data.on)||!e(r.data.on)){var i=r.data.on||{},o=n.data.on||{};Xr=r.elm,function(e){if(t(e[ki])){var n=Ln?"change":"input";e[n]=[].concat(e[ki],e[n]||[]),delete e[ki]}t(e[Ci])&&(e.change=[].concat(e[Ci],e.change||[]),delete e[Ci])}(i),q(i,o,ut,ft,r.context),Xr=void 0}}function pt(n,r){if(!e(n.data.domProps)||!e(r.data.domProps)){var i,o,a=r.elm,s=n.data.domProps||{},l=r.data.domProps||{};t(l.__ob__)&&(l=r.data.domProps=v({},l));for(i in s)e(l[i])&&(a[i]="");for(i in l){if(o=l[i],"textContent"===i||"innerHTML"===i){if(r.children&&(r.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i){a._value=o;var u=e(o)?"":String(o);d=u,!(f=a).composing&&("OPTION"===f.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(f,d)||function(e,n){var r=e.value,i=e._vModifiers;if(t(i)){if(i.lazy)return!1;if(i.number)return c(r)!==c(n);if(i.trim)return r.trim()!==n.trim()}return r!==n}(f,d))&&(a.value=u)}else a[i]=o}}var f,d}function ht(e){var t=vt(e.style);return e.staticStyle?v(e.staticStyle,t):t}function vt(e){return Array.isArray(e)?m(e):"string"==typeof e?Si(e):e}function mt(n,r){var i=r.data,o=n.data;if(!(e(i.staticStyle)&&e(i.style)&&e(o.staticStyle)&&e(o.style))){var a,s,c=r.elm,l=o.staticStyle,u=o.normalizedStyle||o.style||{},f=l||u,d=vt(r.data.style)||{};r.data.normalizedStyle=t(d.__ob__)?v({},d):d;var p=function(e,t){for(var n,r={},i=e;i.componentInstance;)(i=i.componentInstance._vnode)&&i.data&&(n=ht(i.data))&&v(r,n);(n=ht(e.data))&&v(r,n);for(var o=e;o=o.parent;)o.data&&(n=ht(o.data))&&v(r,n);return r}(r);for(s in f)e(p[s])&&Ei(c,s,"");for(s in p)(a=p[s])!==f[s]&&Ei(c,s,null==a?"":a)}}function gt(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(/\s+/).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function yt(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(/\s+/).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function bt(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&v(t,Ii(e.name||"v")),v(t,e),t}return"string"==typeof e?Ii(e):void 0}}function _t(e){Vi(function(){Vi(e)})}function wt(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),gt(e,t))}function Tt(e,t){e._transitionClasses&&u(e._transitionClasses,t),yt(e,t)}function kt(e,t,n){var r=Ct(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===Fi?Ri:Wi,c=0,l=function(){e.removeEventListener(s,u),n()},u=function(t){t.target===e&&++c>=a&&l()};setTimeout(function(){c0&&(n=Fi,u=a,f=o.length):t===Ni?l>0&&(n=Ni,u=l,f=c.length):f=(n=(u=Math.max(a,l))>0?a>l?Fi:Ni:null)?n===Fi?o.length:c.length:0,{type:n,timeout:u,propCount:f,hasTransform:n===Fi&&Ui.test(r[Mi+"Property"])}}function xt(e,t){for(;e.length1}function Pt(e,t){!0!==t.data.show&&St(t)}function Dt(e,t,n){jt(e,t,n),(Ln||Nn)&&setTimeout(function(){jt(e,t,n)},0)}function jt(e,t,n){var r=t.value,i=e.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=e.options.length;s-1,a.selected!==o&&(a.selected=o);else if(y(Lt(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function It(e,t){return t.every(function(t){return!y(t,e)})}function Lt(e){return"_value"in e?e._value:e.value}function Ft(e){e.target.composing=!0}function Nt(e){e.target.composing&&(e.target.composing=!1,Mt(e.target,"input"))}function Mt(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Rt(e){return!e.componentInstance||e.data&&e.data.transition?e:Rt(e.componentInstance._vnode)}function Bt(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Bt(Y(t.children)):e}function Wt(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[bn(o)]=i[o];return t}function Vt(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}function Ut(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function Ht(e){e.data.newPos=e.elm.getBoundingClientRect()}function zt(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}function qt(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:function(e){for(var t={},n=0,r=e.length;n':'
',So.innerHTML.indexOf(" ")>0}var pn=Object.freeze({}),hn=Object.prototype.toString,vn=l("slot,component",!0),mn=l("key,ref,slot,slot-scope,is"),gn=Object.prototype.hasOwnProperty,yn=/-(\w)/g,bn=d(function(e){return e.replace(yn,function(e,t){return t?t.toUpperCase():""})}),_n=d(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),wn=/\B([A-Z])/g,Tn=d(function(e){return e.replace(wn,"-$1").toLowerCase()}),kn=function(e,t,n){return!1},Cn=function(e){return e},xn="data-server-rendered",An=["component","directive","filter"],Sn=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured"],$n={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:kn,isReservedAttr:kn,isUnknownElement:kn,getTagNamespace:g,parsePlatformTagName:Cn,mustUseProp:kn,_lifecycleHooks:Sn},On=/[^\w.$]/,En="__proto__"in{},Pn="undefined"!=typeof window,Dn="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,jn=Dn&&WXEnvironment.platform.toLowerCase(),In=Pn&&window.navigator.userAgent.toLowerCase(),Ln=In&&/msie|trident/.test(In),Fn=In&&In.indexOf("msie 9.0")>0,Nn=In&&In.indexOf("edge/")>0,Mn=In&&In.indexOf("android")>0||"android"===jn,Rn=In&&/iphone|ipad|ipod|ios/.test(In)||"ios"===jn,Bn=(In&&/chrome\/\d+/.test(In),{}.watch),Wn=!1;if(Pn)try{var Vn={};Object.defineProperty(Vn,"passive",{get:function(){Wn=!0}}),window.addEventListener("test-passive",null,Vn)}catch(e){}var Un,Hn,zn=function(){return void 0===Un&&(Un=!Pn&&"undefined"!=typeof global&&"server"===global.process.env.VUE_ENV),Un},qn=Pn&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,Kn="undefined"!=typeof Symbol&&T(Symbol)&&"undefined"!=typeof Reflect&&T(Reflect.ownKeys);Hn="undefined"!=typeof Set&&T(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var Jn=g,Gn=0,Xn=function(){this.id=Gn++,this.subs=[]};Xn.prototype.addSub=function(e){this.subs.push(e)},Xn.prototype.removeSub=function(e){u(this.subs,e)},Xn.prototype.depend=function(){Xn.target&&Xn.target.addDep(this)},Xn.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;txr&&_r[n].id>e.id;)n--;_r.splice(n+1,0,e)}else _r.push(e);kr||(kr=!0,U(ce))}}(this)},Sr.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||i(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){R(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},Sr.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},Sr.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},Sr.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||u(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var $r={enumerable:!0,configurable:!0,get:g,set:g},Or={lazy:!0};Ce(xe.prototype);var Er,Pr,Dr,jr,Ir={init:function(e,n,r,i){if(!e.componentInstance||e.componentInstance._isDestroyed)(e.componentInstance=(a=e,s={_isComponent:!0,parent:br,_parentVnode:a,_parentElm:r||null,_refElm:i||null},c=a.data.inlineTemplate,t(c)&&(s.render=c.render,s.staticRenderFns=c.staticRenderFns),new a.componentOptions.Ctor(s))).$mount(n?e.elm:void 0,n);else if(e.data.keepAlive){var o=e;Ir.prepatch(o,o)}var a,s,c},prepatch:function(e,t){var n=t.componentOptions;!function(e,t,n,r,i){var o=!!(i||e.$options._renderChildren||r.data.scopedSlots||e.$scopedSlots!==pn);if(e.$options._parentVnode=r,e.$vnode=r,e._vnode&&(e._vnode.parent=r),e.$options._renderChildren=i,e.$attrs=r.data&&r.data.attrs||pn,e.$listeners=n||pn,t&&e.$options.props){ir.shouldConvert=!1;for(var a=e._props,s=e.$options._propKeys||[],c=0;c1?h(n):n;for(var r=h(arguments,1),i=0,o=n.length;iparseInt(this.max)&&Ie(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};Rr=Ee,(Wr={}).get=function(){return $n},Object.defineProperty(Rr,"config",Wr),Rr.util={warn:Jn,extend:v,mergeOptions:I,defineReactive:S},Rr.set=$,Rr.delete=O,Rr.nextTick=U,Rr.options=Object.create(null),An.forEach(function(e){Rr.options[e+"s"]=Object.create(null)}),Rr.options._base=Rr,v(Rr.options.components,Ur),Rr.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=h(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this},Rr.mixin=function(e){return this.options=I(this.options,e),this},function(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,i=e._Ctor||(e._Ctor={});if(i[r])return i[r];var o=e.name||n.options.name,a=function(e){this._init(e)};return(a.prototype=Object.create(n.prototype)).constructor=a,a.cid=t++,a.options=I(n.options,e),a.super=n,a.options.props&&function(e){var t=e.options.props;for(var n in t)le(e.prototype,"_props",n)}(a),a.options.computed&&function(e){var t=e.options.computed;for(var n in t)ue(e.prototype,n,t[n])}(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,An.forEach(function(e){a[e]=n[e]}),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=e,a.sealedOptions=v({},a.options),i[r]=a,a}}(Rr),Br=Rr,An.forEach(function(e){Br[e]=function(t,n){return n?("component"===e&&o(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"==typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}),Object.defineProperty(Ee.prototype,"$isServer",{get:zn}),Object.defineProperty(Ee.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Ee.version="2.5.13";var Hr,zr,qr,Kr,Jr,Gr,Xr,Zr,Yr=l("style,class"),Qr=l("input,textarea,option,select,progress"),ei=function(e,t,n){return"value"===n&&Qr(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},ti=l("contenteditable,draggable,spellcheck"),ni=l("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),ri="http://www.w3.org/1999/xlink",ii=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},oi=function(e){return ii(e)?e.slice(6,e.length):""},ai=function(e){return null==e||!1===e},si={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},ci=l("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),li=l("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),ui=function(e){return ci(e)||li(e)},fi=Object.create(null),di=l("text,number,password,search,email,tel,url"),pi=Object.freeze({createElement:function(e,t){var n=document.createElement(e);return"select"!==e?n:(t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)},createElementNS:function(e,t){return document.createElementNS(si[e],t)},createTextNode:function(e){return document.createTextNode(e)},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,n){e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){e.appendChild(t)},parentNode:function(e){return e.parentNode},nextSibling:function(e){return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},setAttribute:function(e,t,n){e.setAttribute(t,n)}}),hi={create:function(e,t){Be(t)},update:function(e,t){e.data.ref!==t.data.ref&&(Be(e,!0),Be(t))},destroy:function(e){Be(e,!0)}},vi=new Yn("",{},[]),mi=["create","activate","update","remove","destroy"],gi={create:Ue,update:Ue,destroy:function(e){Ue(e,vi)}},yi=Object.create(null),bi=[hi,gi],_i={create:qe,update:qe},wi={create:Je,update:Je},Ti=/[\w).+\-_$\]]/,ki="__r",Ci="__c",xi={create:dt,update:dt},Ai={create:pt,update:pt},Si=d(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}),$i=/^--/,Oi=/\s*!important$/,Ei=function(e,t,n){if($i.test(t))e.style.setProperty(t,n);else if(Oi.test(n))e.style.setProperty(t,n.replace(Oi,""),"important");else{var r=Di(t);if(Array.isArray(n))for(var i=0,o=n.length;ip?h(n,e(i[b+1])?null:i[b+1].elm,i,d,b,o):d>b&&m(0,r,f,p)}(c,d,p,o,s):t(p)?(t(r.text)&&x.setTextContent(c,""),h(c,null,p,0,p.length-1,o)):t(d)?m(0,d,0,d.length-1):t(r.text)&&x.setTextContent(c,""):r.text!==i.text&&x.setTextContent(c,i.text),t(u)&&t(l=u.hook)&&t(l=l.postpatch)&&l(r,i)}}}function b(e,r,i){if(n(i)&&t(e.parent))e.parent.data.pendingInsert=r;else for(var o=0;o-1?fi[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:fi[e]=/HTMLUnknownElement/.test(t.toString())},v(Ee.options.directives,qi),v(Ee.options.components,Xi),Ee.prototype.__patch__=Pn?Hi:g,Ee.prototype.$mount=function(e,t){return e=e&&Pn?Re(e):void 0,r=e,i=t,(n=this).$el=r,n.$options.render||(n.$options.render=er),se(n,"beforeMount"),new Sr(n,function(){n._update(n._render(),i)},g,null,!0),i=!1,null==n.$vnode&&(n._isMounted=!0,se(n,"mounted")),n;var n,r,i},Ee.nextTick(function(){$n.devtools&&qn&&qn.emit("init",Ee)},0);var Zi,Yi=/\{\{((?:.|\n)+?)\}\}/g,Qi=/[-.*+?^${}()|[\]\/\\]/g,eo=d(function(e){var t=e[0].replace(Qi,"\\$&"),n=e[1].replace(Qi,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")}),to={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=rt(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=nt(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}},no={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=rt(e,"style");n&&(e.staticStyle=JSON.stringify(Si(n)));var r=nt(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},ro=l("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),io=l("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),oo=l("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),ao=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,so="[a-zA-Z_][\\w\\-\\.]*",co="((?:"+so+"\\:)?"+so+")",lo=new RegExp("^<"+co),uo=/^\s*(\/?)>/,fo=new RegExp("^<\\/"+co+"[^>]*>"),po=/^]+>/i,ho=/^/g,"$1").replace(//g,"$1")),Lo(d,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});u+=e.length-h.length,e=h,r(d,u-f,u)}else{var v=e.indexOf("<");if(0===v){if(ho.test(e)){var m=e.indexOf("--\x3e");if(m>=0){t.shouldKeepComment&&t.comment(e.substring(4,m)),n(m+3);continue}}if(vo.test(e)){var g=e.indexOf("]>");if(g>=0){n(g+2);continue}}var y=e.match(po);if(y){n(y[0].length);continue}var b=e.match(fo);if(b){var _=u;n(b[0].length),r(b[1],_,u);continue}var w=function(){var t=e.match(lo);if(t){var r,i,o={tagName:t[1],attrs:[],start:u};for(n(t[0].length);!(r=e.match(uo))&&(i=e.match(ao));)n(i[0].length),o.attrs.push(i);if(r)return o.unarySlash=r[1],n(r[0].length),o.end=u,o}}();if(w){!function(e){var n,i,u,f=e.tagName,d=e.unarySlash;s&&("p"===o&&oo(f)&&r(o),l(f)&&o===f&&r(f));for(var p=c(f)||!!d,h=e.attrs.length,v=new Array(h),m=0;m=0){for(k=e.slice(v);!(fo.test(k)||lo.test(k)||ho.test(k)||vo.test(k)||(C=k.indexOf("<",1))<0);)v+=C,k=e.slice(v);T=e.substring(0,v),n(v)}v<0&&(T=e,e=""),t.chars&&T&&t.chars(T)}if(e===i){t.chars&&t.chars(e);break}}r()}(e,{warn:go,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,start:function(e,a,l){var u=i&&i.ns||Co(e);Ln&&"svg"===u&&(a=function(e){for(var t=[],n=0;nc&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var l=Ge(r[1].trim());a.push("_s("+l+")"),s.push({"@binding":l}),c=i+r[0].length}return c1?1:0:1:n?Math.min(n,2):0]?o[t].trim():e}function a(e){return JSON.parse(JSON.stringify(e))}function s(e){for(var n=arguments,r=Object(e),i=1;i=97&&t<=122||t>=65&&t<=90?"ident":t>=49&&t<=57?"number":"else"}function p(e){var t,n,r,i=e.trim();return("0"!==e.charAt(0)||!isNaN(e))&&(r=i,F.test(r)?(n=(t=i).charCodeAt(0))!==t.charCodeAt(t.length-1)||34!==n&&39!==n?t:t.slice(1,-1):"*"+i)}var h,v=Object.prototype.toString,m="[object Object]",g=Object.prototype.hasOwnProperty,y="undefined"!=typeof Intl&&void 0!==Intl.DateTimeFormat,b="undefined"!=typeof Intl&&void 0!==Intl.NumberFormat,_={beforeCreate:function(){var e=this.$options;if(e.i18n=e.i18n||(e.__i18n?{}:null),e.i18n){if(e.i18n instanceof M){if(e.__i18n)try{var t={};e.__i18n.forEach(function(e){t=s(t,JSON.parse(e))}),Object.keys(t).forEach(function(n){e.i18n.mergeLocaleMessage(n,t[n])})}catch(e){}this._i18n=e.i18n,this._i18nWatcher=this._i18n.watchI18nData(),this._i18n.subscribeDataChanging(this),this._subscribing=!0}else if(n(e.i18n)){if(this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof M&&(e.i18n.root=this.$root.$i18n,e.i18n.formatter=this.$root.$i18n.formatter,e.i18n.fallbackLocale=this.$root.$i18n.fallbackLocale,e.i18n.silentTranslationWarn=this.$root.$i18n.silentTranslationWarn),e.__i18n)try{var r={};e.__i18n.forEach(function(e){r=s(r,JSON.parse(e))}),e.i18n.messages=r}catch(e){}this._i18n=new M(e.i18n),this._i18nWatcher=this._i18n.watchI18nData(),this._i18n.subscribeDataChanging(this),this._subscribing=!0,(void 0===e.i18n.sync||e.i18n.sync)&&(this._localeWatcher=this.$i18n.watchLocale())}}else this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof M?(this._i18n=this.$root.$i18n,this._i18n.subscribeDataChanging(this),this._subscribing=!0):e.parent&&e.parent.$i18n&&e.parent.$i18n instanceof M&&(this._i18n=e.parent.$i18n,this._i18n.subscribeDataChanging(this),this._subscribing=!0)},beforeDestroy:function(){this._i18n&&(this._subscribing&&(this._i18n.unsubscribeDataChanging(this),delete this._subscribing),this._i18nWatcher&&(this._i18nWatcher(),delete this._i18nWatcher),this._localeWatcher&&(this._localeWatcher(),delete this._localeWatcher),this._i18n=null)}},w={name:"i18n",functional:!0,props:{tag:{type:String,default:"span"},path:{type:String,required:!0},locale:{type:String},places:{type:[Array,Object]}},render:function(t,n){var r=n.props,i=n.data,o=n.children,a=n.parent.$i18n;if(o=(o||[]).filter(function(e){return e.tag||(e.text=e.text.trim())}),!a)return o;var s=r.path,c=r.locale,l={},u=r.places||{},f=Array.isArray(u)?u.length>0:Object.keys(u).length>0,d=o.every(function(e){if(e.data&&e.data.attrs){var t=e.data.attrs.place;return void 0!==t&&""!==t}});return f&&o.length>0&&!d&&e("If places prop is set, all child elements must have place prop set."),Array.isArray(u)?u.forEach(function(e,t){l[t]=e}):Object.keys(u).forEach(function(e){l[e]=u[e]}),o.forEach(function(e,t){var n=d?""+e.data.attrs.place:""+t;l[n]=e}),t(r.tag,i,a.i(s,c,l))}},T=function(){this._caches=Object.create(null)};T.prototype.interpolate=function(e,n){var r=this._caches[e];return r||(r=function(e){for(var t=[],n=0,r="";n0)f--,u=E,h[x]();else{if(f=0,!1===(n=p(n)))return!1;h[A]()}};null!==u;)if(l++,"\\"!==(t=e[l])||!function(){var t=e[l+1];if(u===P&&"'"===t||u===D&&'"'===t)return l++,r="\\"+t,h[x](),!0}()){if(i=d(t),(o=(s=L[u])[i]||s.else||I)===I)return;if(u=o[0],(a=h[o[1]])&&(r=void 0===(r=o[2])?t:r,!1===a()))return;if(u===j)return c}}(e))&&(this._cache[e]=t),t||[]},N.prototype.getPathValue=function(e,n){if(!t(e))return null;var r,i=this.parsePath(n);if(r=i,Array.isArray(r)&&0===r.length)return null;for(var o=i.length,a=e,s=0;s-1)e.splice(n,1)}}(this._dataListeners,e)},M.prototype.watchI18nData=function(){var e=this;return this._vm.$watch("$data",function(){for(var t=e._dataListeners.length;t--;)h.nextTick(function(){e._dataListeners[t]&&e._dataListeners[t].$forceUpdate()})},{deep:!0})},M.prototype.watchLocale=function(){if(!this._sync||!this._root)return null;var e=this._vm;return this._root.vm.$watch("locale",function(t){e.$set(e,"locale",t),e.$forceUpdate()},{immediate:!0})},R.vm.get=function(){return this._vm},R.messages.get=function(){return a(this._getMessages())},R.dateTimeFormats.get=function(){return a(this._getDateTimeFormats())},R.numberFormats.get=function(){return a(this._getNumberFormats())},R.locale.get=function(){return this._vm.locale},R.locale.set=function(e){this._vm.$set(this._vm,"locale",e)},R.fallbackLocale.get=function(){return this._vm.fallbackLocale},R.fallbackLocale.set=function(e){this._vm.$set(this._vm,"fallbackLocale",e)},R.missing.get=function(){return this._missing},R.missing.set=function(e){this._missing=e},R.formatter.get=function(){return this._formatter},R.formatter.set=function(e){this._formatter=e},R.silentTranslationWarn.get=function(){return this._silentTranslationWarn},R.silentTranslationWarn.set=function(e){this._silentTranslationWarn=e},M.prototype._getMessages=function(){return this._vm.messages},M.prototype._getDateTimeFormats=function(){return this._vm.dateTimeFormats},M.prototype._getNumberFormats=function(){return this._vm.numberFormats},M.prototype._warnDefault=function(e,t,n,i){return r(n)?(this.missing&&this.missing.apply(null,[e,t,i]),t):n},M.prototype._isFallbackRoot=function(e){return!e&&!r(this._root)&&this._fallbackRoot},M.prototype._interpolate=function(e,t,i,o,a,s){if(!t)return null;var c,l=this._path.getPathValue(t,i);if(Array.isArray(l))return l;if(r(l)){if(!n(t))return null;if("string"!=typeof(c=t[i]))return null}else{if("string"!=typeof l)return null;c=l}return c.indexOf("@:")>=0&&(c=this._link(e,t,c,o,a,s)),s?this._render(c,a,s):c},M.prototype._link=function(e,t,n,r,i,o){var a=n,s=a.match(/(@:[\w\-_|.]+)/g);for(var c in s)if(s.hasOwnProperty(c)){var l=s[c],u=l.substr(2),f=this._interpolate(e,t,u,r,"raw"===i?"string":i,"raw"===i?void 0:o);if(this._isFallbackRoot(f)){if(!this._root)throw Error("unexpected error");var d=this._root;f=d._translate(d._getMessages(),d.locale,d.fallbackLocale,u,r,i,o)}a=(f=this._warnDefault(e,u,f,r))?a.replace(l,f):a}return a},M.prototype._render=function(e,t,n){var r=this._formatter.interpolate(e,n);return"string"===t?r.join(""):r},M.prototype._translate=function(e,t,n,i,o,a,s){var c=this._interpolate(t,e[t],i,o,a,s);return r(c)?r(c=this._interpolate(n,e[n],i,o,a,s))?null:c:c},M.prototype._t=function(e,t,n,r){for(var o=[],a=arguments.length-4;a-- >0;)o[a]=arguments[a+4];if(!e)return"";var s,c=i.apply(void 0,o),l=c.locale||t,u=this._translate(n,l,this.fallbackLocale,e,r,"string",c.params);if(this._isFallbackRoot(u)){if(!this._root)throw Error("unexpected error");return(s=this._root).t.apply(s,[e].concat(o))}return this._warnDefault(l,e,u,r)},M.prototype.t=function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return(r=this)._t.apply(r,[e,this.locale,this._getMessages(),null].concat(t));var r},M.prototype._i=function(e,t,n,r,i){var o=this._translate(n,t,this.fallbackLocale,e,r,"raw",i);if(this._isFallbackRoot(o)){if(!this._root)throw Error("unexpected error");return this._root.i(e,t,i)}return this._warnDefault(t,e,o,r)},M.prototype.i=function(e,t,n){return e?("string"!=typeof t&&(t=this.locale),this._i(e,t,this._getMessages(),null,n)):""},M.prototype._tc=function(e,t,n,r,i){for(var a=[],s=arguments.length-5;s-- >0;)a[s]=arguments[s+5];return e?(void 0===i&&(i=1),o((c=this)._t.apply(c,[e,t,n,r].concat(a)),i)):"";var c},M.prototype.tc=function(e,t){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return(i=this)._tc.apply(i,[e,this.locale,this._getMessages(),null,t].concat(n));var i},M.prototype._te=function(e,t,n){for(var r=[],o=arguments.length-3;o-- >0;)r[o]=arguments[o+3];var a=i.apply(void 0,r).locale||t;return this._exist(n[a],e)},M.prototype.te=function(e,t){return this._te(e,this.locale,this._getMessages(),t)},M.prototype.getLocaleMessage=function(e){return a(this._vm.messages[e]||{})},M.prototype.setLocaleMessage=function(e,t){this._vm.messages[e]=t},M.prototype.mergeLocaleMessage=function(e,t){this._vm.messages[e]=h.util.extend(this._vm.messages[e]||{},t)},M.prototype.getDateTimeFormat=function(e){return a(this._vm.dateTimeFormats[e]||{})},M.prototype.setDateTimeFormat=function(e,t){this._vm.dateTimeFormats[e]=t},M.prototype.mergeDateTimeFormat=function(e,t){this._vm.dateTimeFormats[e]=h.util.extend(this._vm.dateTimeFormats[e]||{},t)},M.prototype._localizeDateTime=function(e,t,n,i,o){var a=t,s=i[a];if((r(s)||r(s[o]))&&(s=i[a=n]),r(s)||r(s[o]))return null;var c=s[o],l=a+"__"+o,u=this._dateTimeFormatters[l];return u||(u=this._dateTimeFormatters[l]=new Intl.DateTimeFormat(a,c)),u.format(e)},M.prototype._d=function(e,t,n){if(!n)return new Intl.DateTimeFormat(t).format(e);var r=this._localizeDateTime(e,t,this.fallbackLocale,this._getDateTimeFormats(),n);if(this._isFallbackRoot(r)){if(!this._root)throw Error("unexpected error");return this._root.d(e,n,t)}return r||""},M.prototype.d=function(e){for(var n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];var i=this.locale,o=null;return 1===n.length?"string"==typeof n[0]?o=n[0]:t(n[0])&&(n[0].locale&&(i=n[0].locale),n[0].key&&(o=n[0].key)):2===n.length&&("string"==typeof n[0]&&(o=n[0]),"string"==typeof n[1]&&(i=n[1])),this._d(e,i,o)},M.prototype.getNumberFormat=function(e){return a(this._vm.numberFormats[e]||{})},M.prototype.setNumberFormat=function(e,t){this._vm.numberFormats[e]=t},M.prototype.mergeNumberFormat=function(e,t){this._vm.numberFormats[e]=h.util.extend(this._vm.numberFormats[e]||{},t)},M.prototype._localizeNumber=function(e,t,n,i,o){var a=t,s=i[a];if((r(s)||r(s[o]))&&(s=i[a=n]),r(s)||r(s[o]))return null;var c=s[o],l=a+"__"+o,u=this._numberFormatters[l];return u||(u=this._numberFormatters[l]=new Intl.NumberFormat(a,c)),u.format(e)},M.prototype._n=function(e,t,n){if(!n)return new Intl.NumberFormat(t).format(e);var r=this._localizeNumber(e,t,this.fallbackLocale,this._getNumberFormats(),n);if(this._isFallbackRoot(r)){if(!this._root)throw Error("unexpected error");return this._root.n(e,n,t)}return r||""},M.prototype.n=function(e){for(var n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];var i=this.locale,o=null;return 1===n.length?"string"==typeof n[0]?o=n[0]:t(n[0])&&(n[0].locale&&(i=n[0].locale),n[0].key&&(o=n[0].key)):2===n.length&&("string"==typeof n[0]&&(o=n[0]),"string"==typeof n[1]&&(i=n[1])),this._n(e,i,o)},Object.defineProperties(M.prototype,R),M.availabilities={dateTimeFormat:y,numberFormat:b},M.install=function e(t){var n;(h=t).version&&Number(h.version.split(".")[0]),e.installed=!0,Object.defineProperty(h.prototype,"$i18n",{get:function(){return this._i18n}}),n=h,Object.defineProperty(n.prototype,"$t",{get:function(){var e=this;return function(t){for(var n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];var i=e.$i18n;return i._t.apply(i,[t,i.locale,i._getMessages(),e].concat(n))}}}),Object.defineProperty(n.prototype,"$tc",{get:function(){var e=this;return function(t,n){for(var r=[],i=arguments.length-2;i-- >0;)r[i]=arguments[i+2];var o=e.$i18n;return o._tc.apply(o,[t,o.locale,o._getMessages(),e,n].concat(r))}}}),Object.defineProperty(n.prototype,"$te",{get:function(){var e=this;return function(t,n){var r=e.$i18n;return r._te(t,r.locale,r._getMessages(),n)}}}),Object.defineProperty(n.prototype,"$d",{get:function(){var e=this;return function(t){for(var n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(i=e.$i18n).d.apply(i,[t].concat(n));var i}}}),Object.defineProperty(n.prototype,"$n",{get:function(){var e=this;return function(t){for(var n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(i=e.$i18n).n.apply(i,[t].concat(n));var i}}}),h.mixin(_),h.directive("t",{bind:c,update:l}),h.component(w.name,w);var r=h.config.optionMergeStrategies;r.i18n=r.methods},M.version="7.3.4","undefined"!=typeof window&&window.Vue&&window.Vue.use(M),M});var messages={en:{title:"Stairs",systemID:"System ID",firmwareVersion:"Firmware version: ",copyright:"Copyright © 2017 Mark van Renswoude",loading:"Please wait, loading configuration...",rebootPending:"The system will be rebooted, please refresh this page afterwards",applyButton:"Apply",applyButtonSaving:"Saving...",wifiStatus:{accesspoint:{title:"AP: ",disabled:"Disabled"},stationmode:{title:"WiFi: ",disabled:"Disabled",idle:"Idle",noSSID:"SSID not found",scanCompleted:"Scan completed",connectFailed:"Failed to connect",connectionLost:"Connection lost",disconnected:"Disconnected"}},status:{tabTitle:"Status",title:"Current status",allStepsTrue:"Set intensity for all steps",allStepsFalse:"Set intensity individually"},triggers:{tabTitle:"Triggers",timeTitle:"Time",timeInternet:"Please note that time triggers require an internet connection.",timeNoData:"No time triggers defined yet",timeEnabled:"Enable time triggers",timeTransitionTime:"Transition time in milliseconds",timeAdd:"Add",timeDelete:"Delete",timeTriggerEnabled:"Enabled",timeFixedTime:"Fixed time",timeSunrise:"Sunrise",timeSunset:"Sunset",timeTime:"Time in minutes",timeMonday:"Monday",timeTuesday:"Tuesday",timeWednesday:"Wednesday",timeThursday:"Thursday",timeFriday:"Friday",timeSaturday:"Saturday",timeSunday:"Sunday",motionTitle:"Motion",motionNoData:"No motion triggers defined yet",motionEnabled:"Enable motion triggers",motionEnabledDuringTimeTrigger:"Activate even if a time trigger is already active",motionTransitionTime:"Transition time in milliseconds",motionTriggerEnabled:"Enabled",motionAdd:"Add",motionDelete:"Delete",motionPin:"GPIO pin (active high)",motionDirection:"Sweep animation",motionDirectionNonDirectional:"None (all steps at the same time)",motionDirectionTopDown:"Top down",motionDirectionBottomUp:"Bottom up"},connection:{tabTitle:"Connection",title:"Connection parameters",accesspoint:"Enable access point",accesspointHint:"Allows for a direct connection from your device to this Stairs module for configuration purposes. The Stairs configuration is available on http://192.168.1.4/ when you are connected to it. Turn it off as soon as station mode is configured, as it is not secured in any way. You can always turn this option back on by pushing the access point button until the LED lights up.",stationmode:"Enable station mode",stationmodeHint:"Connect this Stairs module to your own WiFi router. Please enter the SSID, password and further configuration below.",ssid:"SSID",password:"Password",dhcp:"Use DHCP",dhcpHint:"Automatically assigns an IP address to this Stairs module. You probably want to keep this on unless you know what you're doing.",ipaddress:"IP address",subnetmask:"Subnet mask",gateway:"Gateway",hostname:"Hostname",hostnamePlaceholder:"Default: mac address"},system:{tabTitle:"System",ntpTitle:"Time synchronisation (NTP)",pinsTitle:"Hardware pinout",mapsTitle:"Google Maps API",firmwareTitle:"Firmware update",ntpServer:"NTP server",ntpInterval:"Refresh interval (in minutes)",ntpLat:"Latitude",ntpLng:"Longitude",ntpLocation:"Get latitude / longitude from location",ntpLocationSearch:"Search",pinLEDAP:"Access Point status LED pin (+3.3v)",pinLEDSTA:"Station Mode status LED pin (+3.3v)",pinAPButton:"Enable Access Point button pin (active low)",pinPWMDriverSDA:"PCA9685 PWM driver SDA pin (data)",pinPWMDriverSCL:"PCA9685 PWM driver SCL pin (clock)",pwmAddress:"PCA9685 PWM driver I²C address",pwmFrequency:"PCA9685 PWM driver frequency",mapsAPIKey:"Google Maps API key",mapsAPIKeyhint:"Recommended if using time triggers. Used for looking up the current timezone. Will work without an API key, but Google might throttle your request. Register for a free API key at http://console.developers.google.com/ and activate it's use for the Maps API."},error:{loadVersion:"Could not load information about the system",loadConnection:"Could not load connection settings",loadSystem:"Could not load system settings",loadTimeTriggers:"Could not load time trigger settings",loadMotionTriggers:"Could not load motion trigger settings",applyConnection:"Could not save connection settings",applySystem:"Could not save system settings",updateWiFiStatus:"Could not retrieve WiFi status",uploadFirmware:"Error while uploading firmware",updateSteps:"Could not apply new step values",searchLocation:"Could not look up location coordinates",applyTimeTriggers:"Could not save time trigger settings",applyMotionTriggers:"Could not save motion trigger settings"}},nl:{title:"Trap",systemID:"Systeem ID",firmwareVersion:"Firmware versie: ",copyright:"Copyright © 2017 Mark van Renswoude",loading:"Een ogenblik geduld, bezig met laden van configuratie...",rebootPending:"Het systeem wordt opnieuw opgestart, ververse deze pagina nadien",applyButton:"Toepassen",applyButtonSaving:"Bezig met opslaan...",wifiStatus:{accesspoint:{title:"AP: ",disabled:"Uitgeschakeld"},stationmode:{title:"WiFi: ",disabled:"Uitgeschakeld",idle:"Slaapstand",noSSID:"SSID niet gevonden",scanCompleted:"Scan afgerond",connectFailed:"Kan geen verbinding maken",connectionLost:"Verbinding verloren",disconnected:"Niet verbonden"}},status:{tabTitle:"Status",title:"Huidige status",allStepsTrue:"Alle treden dezelfde intensiteit",allStepsFalse:"Treden individueel instellen"},triggers:{tabTitle:"Triggers",timeTitle:"Tijd",timeInternet:"Let op dat voor tijd triggers een internetverbinding vereist is.",timeNoData:"Nog geen tijd triggers geconfigureerd",timeEnabled:"Tijd triggers inschakelen",timeTransitionTime:"Transitie tijd in milliseconden",timeAdd:"Toevoegen",timeDelete:"Verwijderen",timeTriggerEnabled:"Actief",timeFixedTime:"Vaste tijd",timeSunrise:"Zonsopkomst",timeSunset:"Zonsondergang",timeTime:"Tijd in minuten",timeMonday:"Maandag",timeTuesday:"Dinsdag",timeWednesday:"Woensdag",timeThursday:"Donderdag",timeFriday:"Vrijdag",timeSaturday:"Zaterdag",timeSunday:"Zondag",motionTitle:"Beweging",motionNoData:"Nog geen beweging triggers geconfigureerd",motionEnabled:"Beweging triggers inschakelen",motionEnabledDuringTimeTrigger:"Ook inschakelen als er al een tijd trigger actief is",motionTransitionTime:"Transitie tijd in milliseconden",motionTriggerEnabled:"Actief",motionAdd:"Toevoegen",motionDelete:"Verwijderen",motionPin:"GPIO pin (actief hoog)",motionDirection:"Animatie",motionDirectionNonDirectional:"Geen (alle treden gelijktijdig)",motionDirectionTopDown:"Boven naar beneden",motionDirectionBottomUp:"Beneden naar boven"},connection:{tabTitle:"Verbinding",title:"Verbinding configuratie",accesspoint:"Access point inschakelen",accesspointhint:"Maakt het mogelijk om een directe connectie vanaf een apparaat naar deze Trap module te maken om de module te configureren. De Trap module is te benaderen via http://192.168.1.4/ nadat je connectie hebt gemaakt. Schakel deze optie uit na het configureren, aangezien deze niet beveiligd is. Je kunt deze optie ook inschakelen door op de Access point knop te drukken totdat de LED aan gaat.",stationmode:"Verbinding met WiFi maken",stationmodehint:"Verbind deze Trap module aan je eigen WiFi router. Vul hieronder het SSID en wachtwoord in, en configureer eventuel de overige opties.",ssid:"SSID",password:"Wachtwoord",dhcp:"Gebruik DHCP",dhcphint:"Automatisch een IP adres toewijzen aan deze Trap module. Waarschijnlijk wil je deze optie aan laten, tenzij je weet waar je mee bezig bent.",ipaddress:"IP adres",subnetmask:"Subnet masker",gateway:"Gateway",hostname:"Hostnaam",hostnamePlaceholder:"Standaard: mac adres"},system:{tabTitle:"Systeem",ntpTitle:"Tijd synchronisatie (NTP)",pinsTitle:"Hardware aansluitingen",mapsTitle:"Google Maps API",firmwareTitle:"Firmware bijwerken",ntpServer:"NTP server",ntpInterval:"Ververs interval (in minuten)",ntpLat:"Breedtegraad",ntpLng:"Lengtegraad",ntpLocation:"Breedtegraad / lengtegraad ophalen op basis van locatie",ntpLocationSearch:"Zoeken",pinLEDAP:"Access Point status LED pin (+3.3v)",pinLEDSTA:"WiFi status LED pin (+3.3v)",pinAPButton:"Access Point inschakelen knop pin (actief laag)",pinPWMDriverSDA:"PCA9685 PWM driver SDA pin (data)",pinPWMDriverSCL:"PCA9685 PWM driver SCL pin (klok)",pwmAddress:"PCA9685 PWM driver I²C address",pwmFrequency:"PCA9685 PWM driver frequency",mapsAPIKey:"Google Maps API key",mapsAPIKeyhint:"Aangeraden bij gebruik van de tijd triggers. Wordt gebruikt om de huidige tijdzone te bepalen. Werkt ook zonder API key, maar Google beperkt dan sterk de requests. Registreer een gratis API key op http://console.developers.google.com/ en activeer het voor gebruik met de Maps API."},error:{loadVersion:"Kan systeeminformatie niet ophalen",loadConnection:"Kan verbinding instellingen niet ophalen",loadSystem:"Kan systeem instellingen niet ophalen",loadTimeTriggers:"Kan tijd trigger instellingen niet ophalen",loadMotionTriggers:"Kan beweging trigger instellingen niet ophalen",applyConnection:"Kan verbinding instellingen niet opslaan",applySystem:"Kan systeem instellingen niet opslaan",updateWiFiStatus:"Kan WiFi status niet ophalen",uploadFirmware:"Fout tijdens bijwerken van firmware",updateSteps:"Kan trap instellingen niet opslaan",searchLocation:"Kan locatie coordinaten niet bepalen",applyTimeTriggers:"Kan tijd trigger instellingen niet opslaan",applyMotionTriggers:"Kan beweging trigger instellingen niet opslaan"}}};function startApp(){Vue.component("check",{template:'
{{ title }}
',props:{title:String,value:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},methods:{handleClick:function(){this.disabled||(this.value=!this.value,this.$emit("input",this.value))},handleKeyDown:function(e){32==e.keyCode&&(this.handleClick(),e.preventDefault())}}}),Vue.component("radio",{template:'
{{ title }}
',props:{title:String,value:null,id:null,disabled:{type:Boolean,default:!1}},methods:{handleClick:function(){this.disabled||(this.value=this.id,this.$emit("input",this.value))},handleKeyDown:function(e){32==e.keyCode&&(this.handleClick(),e.preventDefault())}}});var e=new VueI18n({locale:navigator.language,fallbackLocale:"en",messages:messages});new Vue({el:"#app",i18n:e,data:{notification:null,loading:!0,saving:!1,savingSteps:!1,loadingIndicator:"|",uploadProgress:!1,activeTab:"status",version:{systemID:"loading...",version:"loading..."},wifiStatus:{ap:{enabled:!1,ip:"0.0.0.0"},station:{enabled:!1,status:0,ip:"0.0.0.0"}},searchingLocation:!1,triggers:{time:{enabled:!1,transitionTime:null,triggers:[]},motion:{enabled:!1,enabledDuringTimeTrigger:!1,transitionTime:null,delay:null,triggers:[]}},connection:{hostname:null,accesspoint:!0,station:!1,ssid:null,password:null,dhcp:!0,ip:null,subnetmask:null,gateway:null},system:{ntpServer:null,ntpInterval:5,lat:null,lng:null,pins:{ledAP:null,ledSTA:null,apButton:null,pwmSDA:null,pwmSCL:null},pwmAddress:null,pwmFrequency:null,mapsAPIKey:""},allSteps:!0,allStepsValue:0,steps:[],location:"",fixedTimes:[],relativeTimes:[]},created:function(){var t=this;t.notificationTimer=null,document.title=e.t("title");var n=window.location.hash.substr(1);n&&(t.activeTab=n),t.startLoadingIndicator(),t.updateWiFiStatus(),t.disableStepsChanged=!1,t.savingStepsTimer=!1;for(var r=[],i=[],o=0;o<1440;o+=15)r.push(o);for(o=-240;o<=240;o+=15)i.push(o);t.fixedTimes=r,t.relativeTimes=i,t.loadVersion().then(function(){t.loadConnection().then(function(){t.loadSystem().then(function(){t.loadTimeTriggers().then(function(){t.loadMotionTriggers().then(function(){t.loadSteps().then(function(){t.stopLoadingIndicator(),t.loading=!1})})})})})})},methods:{showNotification:function(e,t){var n=this;n.notification={message:e,error:t},null!=n.notificationTimer&&clearTimeout(n.notificationTimer),n.notificationTimer=setTimeout(function(){n.notification=null,n.notificationTimer=null},5e3)},hideNotification:function(){this.notification=null,null!=this.notificationTimer&&(clearTimeout(this.notificationTimer),this.notificationTimer=null)},handleAPIError:function(t,n){console.log(n);var r="";r=n.response?"HTTP response code "+n.response.status:n.request?"No response":n.message,this.showNotification(e.t(t)+"\n\n"+r,!0)},loadVersion:function(){var e=this;return axios.get("/api/version").then(function(t){"object"==typeof t.data&&(e.version=t.data)}).catch(e.handleAPIError.bind(e,"error.loadVersion"))},loadConnection:function(){var e=this;return axios.get("/api/connection").then(function(t){"object"==typeof t.data&&(e.connection=t.data)}).catch(e.handleAPIError.bind(e,"error.loadConnection"))},loadSystem:function(){var e=this;return axios.get("/api/system").then(function(t){"object"==typeof t.data&&(e.system=t.data)}).catch(e.handleAPIError.bind(e,"error.loadSystem"))},loadTimeTriggers:function(){var e=this;return axios.get("/api/triggers/time").then(function(t){if("object"==typeof t.data){var n={enabled:t.data.enabled||!1,transitionTime:t.data.transitionTime||0,triggers:[]};if(Array.isArray(t.data.triggers))for(var r=0;r0?0:i.time||0,relativeTime:i.triggerType>0?i.time||0:0,monday:(1&i.daysOfWeek)>0,tuesday:(2&i.daysOfWeek)>0,wednesday:(4&i.daysOfWeek)>0,thursday:(8&i.daysOfWeek)>0,friday:(16&i.daysOfWeek)>0,saturday:(32&i.daysOfWeek)>0,sunday:(64&i.daysOfWeek)>0})}e.triggers.time=n}}).catch(e.handleAPIError.bind(e,"error.loadTimeTriggers"))},loadMotionTriggers:function(){var e=this;return axios.get("/api/triggers/motion").then(function(t){"object"==typeof t.data&&(e.triggers.motion=t.data)}).catch(e.handleAPIError.bind(e,"error.loadMotionTriggers"))},loadSteps:function(){var e=this;return axios.get("/api/steps").then(function(t){if(Array.isArray(t.data)){for(var n=!0,r=!1,i=0,o=[],a=0;a0){var n=t.data.results[0].geometry.location;e.system.lat=n.lat,e.system.lng=n.lng}}).catch(e.handleAPIError.bind(e,"error.searchLocation")).then(function(){e.searchingLocation=!1}))},applyTimeTriggers:function(){var e=this;if(!e.saving){e.saving=!0;for(var t={enabled:e.triggers.time.enabled,transitionTime:e.triggers.time.transitionTime,triggers:[]},n=0;n0?r.relativeTime:r.fixedTime,daysOfWeek:(r.monday?1:0)|(r.tuesday?2:0)|(r.wednesday?4:0)|(r.thursday?8:0)|(r.friday?16:0)|(r.saturday?32:0)|(r.sunday?64:0)})}axios.post("/api/triggers/time",t).then(function(e){}).catch(e.handleAPIError.bind(e,"error.applyTimeTriggers")).then(function(){e.saving=!1})}},addTimeTrigger:function(){this.triggers.time.triggers.push({brightness:0,triggerType:0,enabled:!0,fixedTime:540,relativeTime:0,monday:!0,tuesday:!0,wednesday:!0,thursday:!0,friday:!0,saturday:!0,sunday:!0})},deleteTimeTrigger:function(e){this.triggers.time.triggers.splice(e,1)},applyMotionTriggers:function(){var e=this;e.saving||(e.saving=!0,axios.post("/api/triggers/motion",e.triggers.motion).then(function(e){}).catch(e.handleAPIError.bind(e,"error.applyMotionTriggers")).then(function(){e.saving=!1}))},addMotionTrigger:function(){this.triggers.motion.triggers.push({brightness:0,enabled:!0,pin:2,direction:0})},deleteMotionTrigger:function(e){this.triggers.motion.triggers.splice(e,1)},getDisplayTime:function(e,t){var n="";t&&e>=0&&(n+="+");var r=Math.floor(e/60),i=Math.abs(e)%60;return n+=r+":",i<10&&(n+="0"),n+=i}},watch:{allSteps:{handler:function(){this.stepsChanged()},sync:!0},allStepsValue:{handler:function(){this.stepsChanged()},sync:!0},steps:{handler:function(){this.stepsChanged()},deep:!0,sync:!0},activeTab:function(e){window.location.hash="#"+e}}})} \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function r(e){var t=new a(e),n=o(a.prototype.request,t);return i.extend(n,a.prototype,t),i.extend(n,t),n}var i=n(2),o=n(3),a=n(5),s=n(6),c=r(s);c.Axios=a,c.create=function(e){return r(i.merge(s,e))},c.Cancel=n(23),c.CancelToken=n(24),c.isCancel=n(20),c.all=function(e){return Promise.all(e)},c.spread=n(25),e.exports=c,e.exports.default=c},function(e,t,n){"use strict";function r(e){return"[object Array]"===l.call(e)}function i(e){return null!==e&&"object"==typeof e}function o(e){return"[object Function]"===l.call(e)}function a(e,t){if(null!==e&&void 0!==e)if("object"!=typeof e&&(e=[e]),r(e))for(var n=0,i=e.length;n=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},o.forEach(["delete","get","head"],function(e){c.headers[e]={}}),o.forEach(["post","put","patch"],function(e){c.headers[e]=o.merge(s)}),e.exports=c},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t){r.forEach(e,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])})}},function(e,t,n){"use strict";var r=n(2),i=n(9),o=n(12),a=n(13),s=n(14),c=n(10),l="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||n(15);e.exports=function(e){return new Promise(function(t,u){var f=e.data,d=e.headers;r.isFormData(f)&&delete d["Content-Type"];var p=new XMLHttpRequest,h="onreadystatechange",v=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in p||s(e.url)||(p=new window.XDomainRequest,h="onload",v=!0,p.onprogress=function(){},p.ontimeout=function(){}),e.auth){var m=e.auth.username||"",g=e.auth.password||"";d.Authorization="Basic "+l(m+":"+g)}if(p.open(e.method.toUpperCase(),o(e.url,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p[h]=function(){if(p&&(4===p.readyState||v)&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in p?a(p.getAllResponseHeaders()):null,r={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:1223===p.status?204:p.status,statusText:1223===p.status?"No Content":p.statusText,headers:n,config:e,request:p};i(t,u,r),p=null}},p.onerror=function(){u(c("Network Error",e,null,p)),p=null},p.ontimeout=function(){u(c("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var y=n(16),b=(e.withCredentials||s(e.url))&&e.xsrfCookieName?y.read(e.xsrfCookieName):void 0;b&&(d[e.xsrfHeaderName]=b)}if("setRequestHeader"in p&&r.forEach(d,function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete d[t]:p.setRequestHeader(t,e)}),e.withCredentials&&(p.withCredentials=!0),e.responseType)try{p.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){p&&(p.abort(),u(e),p=null)}),void 0===f&&(f=null),p.send(f)})}},function(e,t,n){"use strict";var r=n(10);e.exports=function(e,t,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},function(e,t,n){"use strict";var r=n(11);e.exports=function(e,t,n,i,o){var a=new Error(e);return r(a,t,n,i,o)}},function(e,t){"use strict";e.exports=function(e,t,n,r,i){return e.config=t,n&&(e.code=n),e.request=r,e.response=i,e}},function(e,t,n){"use strict";function r(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var i=n(2);e.exports=function(e,t,n){if(!t)return e;var o;if(n)o=n(t);else if(i.isURLSearchParams(t))o=t.toString();else{var a=[];i.forEach(t,function(e,t){null!==e&&void 0!==e&&(i.isArray(e)&&(t+="[]"),i.isArray(e)||(e=[e]),i.forEach(e,function(e){i.isDate(e)?e=e.toISOString():i.isObject(e)&&(e=JSON.stringify(e)),a.push(r(t)+"="+r(e))}))}),o=a.join("&")}return o&&(e+=(-1===e.indexOf("?")?"?":"&")+o),e}},function(e,t,n){"use strict";var r=n(2),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,o,a={};return e?(r.forEach(e.split("\n"),function(e){if(o=e.indexOf(":"),t=r.trim(e.substr(0,o)).toLowerCase(),n=r.trim(e.substr(o+1)),t){if(a[t]&&i.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}}),a):a}},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){function e(e){var t=e;return n&&(i.setAttribute("href",t),t=i.href),i.setAttribute("href",t),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}var t,n=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");return t=e(window.location.href),function(n){var i=r.isString(n)?e(n):n;return i.protocol===t.protocol&&i.host===t.host}}():function(){return!0}},function(e,t){"use strict";function n(){this.message="String contains an invalid character"}var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.prototype=new Error,n.prototype.code=5,n.prototype.name="InvalidCharacterError",e.exports=function(e){for(var t,i,o=String(e),a="",s=0,c=r;o.charAt(0|s)||(c="=",s%1);a+=c.charAt(63&t>>8-s%1*8)){if((i=o.charCodeAt(s+=.75))>255)throw new n;t=t<<8|i}return a}},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,i,o,a){var s=[];s.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(i)&&s.push("path="+i),r.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,n){"use strict";function r(){this.handlers=[]}var i=n(2);r.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},r.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},r.prototype.forEach=function(e){i.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=r},function(e,t,n){"use strict";function r(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var i=n(2),o=n(19),a=n(20),s=n(6),c=n(21),l=n(22);e.exports=function(e){return r(e),e.baseURL&&!c(e.url)&&(e.url=l(e.baseURL,e.url)),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=i.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),i.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||s.adapter)(e).then(function(t){return r(e),t.data=o(t.data,t.headers,e.transformResponse),t},function(t){return a(t)||(r(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t,n){return r.forEach(n,function(n){e=n(e,t)}),e}},function(e,t){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,n){"use strict";function r(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;e(function(e){n.reason||(n.reason=new i(e),t(n.reason))})}var i=n(23);r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var e;return{token:new r(function(t){e=t}),cancel:e}},e.exports=r},function(e,t){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}}])}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Vue=t()}(this,function(){"use strict";function e(e){return void 0===e||null===e}function t(e){return void 0!==e&&null!==e}function n(e){return!0===e}function r(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function i(e){return null!==e&&"object"==typeof e}function o(e){return"[object Object]"===hn.call(e)}function a(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function s(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function c(e){var t=parseFloat(e);return isNaN(t)?e:t}function l(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(n,1)}}function f(e,t){return gn.call(e,t)}function d(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}function p(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n}function h(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function v(e,t){for(var n in t)e[n]=t[n];return e}function m(e){for(var t={},n=0;n0&&(G((c=i(c,(a||"")+"_"+s))[0])&&G(u)&&(f[l]=k(u.text+c[0].text),c.shift()),f.push.apply(f,c)):r(c)?G(u)?f[l]=k(u.text+c):""!==c&&f.push(k(c)):G(c)&&G(u)?f[l]=k(u.text+c.text):(n(o._isVList)&&t(c.tag)&&e(c.key)&&t(a)&&(c.key="__vlist"+a+"_"+s+"__"),f.push(c)));return f}(l):void 0:c===Fr&&(s=function(e){for(var t=0;t=0||n.indexOf(e[i])<0)&&r.push(e[i]);return r}return e}(n[o],r[o],i[o]));return t}(e);r&&v(e.extendOptions,r),(t=e.options=I(n,e.extendOptions)).name&&(t.components[t.name]=e)}}return t}function Ee(e){this._init(e)}function Pe(e){return e&&(e.Ctor.options.name||e.tag)}function De(e,t){return Array.isArray(e)?e.indexOf(t)>-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,!("[object RegExp]"!==hn.call(n))&&e.test(t));var n}function je(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=Pe(a.componentOptions);s&&!t(s)&&Ie(n,o,r,i)}}}function Ie(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,u(n,t)}function Le(e,n){return{staticClass:Fe(e.staticClass,n.staticClass),class:t(e.class)?[e.class,n.class]:n.class}}function Fe(e,t){return e?t?e+" "+t:e:t||""}function Ne(e){return Array.isArray(e)?function(e){for(var n,r="",i=0,o=e.length;i=0&&" "===(b=e.charAt(y));y--);b&&Ti.test(b)||(p=!0)}}else void 0===o?(g=i+1,o=e.slice(0,i).trim()):t();if(void 0===o?o=e.slice(0,i).trim():0!==g&&t(),a)for(i=0;i-1?{exp:e.slice(0,Kr),key:'"'+e.slice(Kr+1)+'"'}:{exp:e,key:null};for(zr=e,Kr=Jr=Gr=0;!st();)ct(qr=at())?lt(qr):91===qr&&function(e){var t=1;for(Jr=Kr;!st();)if(e=at(),ct(e))lt(e);else if(91===e&&t++,93===e&&t--,0===t){Gr=Kr;break}}(qr);return{exp:e.slice(0,Jr),key:e.slice(Jr+1,Gr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function at(){return zr.charCodeAt(++Kr)}function st(){return Kr>=Hr}function ct(e){return 34===e||39===e}function lt(e){for(var t=e;!st()&&(e=at())!==t;);}function ut(e,t,n,r,i){var o,a,s,c,l;t=(l=t)._withTask||(l._withTask=function(){dr=!0;var e=l.apply(null,arguments);return dr=!1,e}),n&&(o=t,a=e,s=r,c=Xr,t=function e(){null!==o.apply(null,arguments)&&ft(a,e,s,c)}),Xr.addEventListener(e,t,Wn?{capture:r,passive:i}:r)}function ft(e,t,n,r){(r||Xr).removeEventListener(e,t._withTask||t,n)}function dt(n,r){if(!e(n.data.on)||!e(r.data.on)){var i=r.data.on||{},o=n.data.on||{};Xr=r.elm,function(e){if(t(e[ki])){var n=Ln?"change":"input";e[n]=[].concat(e[ki],e[n]||[]),delete e[ki]}t(e[Ci])&&(e.change=[].concat(e[Ci],e.change||[]),delete e[Ci])}(i),q(i,o,ut,ft,r.context),Xr=void 0}}function pt(n,r){if(!e(n.data.domProps)||!e(r.data.domProps)){var i,o,a=r.elm,s=n.data.domProps||{},l=r.data.domProps||{};t(l.__ob__)&&(l=r.data.domProps=v({},l));for(i in s)e(l[i])&&(a[i]="");for(i in l){if(o=l[i],"textContent"===i||"innerHTML"===i){if(r.children&&(r.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i){a._value=o;var u=e(o)?"":String(o);d=u,!(f=a).composing&&("OPTION"===f.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(f,d)||function(e,n){var r=e.value,i=e._vModifiers;if(t(i)){if(i.lazy)return!1;if(i.number)return c(r)!==c(n);if(i.trim)return r.trim()!==n.trim()}return r!==n}(f,d))&&(a.value=u)}else a[i]=o}}var f,d}function ht(e){var t=vt(e.style);return e.staticStyle?v(e.staticStyle,t):t}function vt(e){return Array.isArray(e)?m(e):"string"==typeof e?Si(e):e}function mt(n,r){var i=r.data,o=n.data;if(!(e(i.staticStyle)&&e(i.style)&&e(o.staticStyle)&&e(o.style))){var a,s,c=r.elm,l=o.staticStyle,u=o.normalizedStyle||o.style||{},f=l||u,d=vt(r.data.style)||{};r.data.normalizedStyle=t(d.__ob__)?v({},d):d;var p=function(e,t){for(var n,r={},i=e;i.componentInstance;)(i=i.componentInstance._vnode)&&i.data&&(n=ht(i.data))&&v(r,n);(n=ht(e.data))&&v(r,n);for(var o=e;o=o.parent;)o.data&&(n=ht(o.data))&&v(r,n);return r}(r);for(s in f)e(p[s])&&Ei(c,s,"");for(s in p)(a=p[s])!==f[s]&&Ei(c,s,null==a?"":a)}}function gt(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(/\s+/).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function yt(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(/\s+/).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function bt(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&v(t,Ii(e.name||"v")),v(t,e),t}return"string"==typeof e?Ii(e):void 0}}function _t(e){Vi(function(){Vi(e)})}function wt(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),gt(e,t))}function Tt(e,t){e._transitionClasses&&u(e._transitionClasses,t),yt(e,t)}function kt(e,t,n){var r=Ct(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===Fi?Ri:Wi,c=0,l=function(){e.removeEventListener(s,u),n()},u=function(t){t.target===e&&++c>=a&&l()};setTimeout(function(){c0&&(n=Fi,u=a,f=o.length):t===Ni?l>0&&(n=Ni,u=l,f=c.length):f=(n=(u=Math.max(a,l))>0?a>l?Fi:Ni:null)?n===Fi?o.length:c.length:0,{type:n,timeout:u,propCount:f,hasTransform:n===Fi&&Ui.test(r[Mi+"Property"])}}function xt(e,t){for(;e.length1}function Pt(e,t){!0!==t.data.show&&St(t)}function Dt(e,t,n){jt(e,t,n),(Ln||Nn)&&setTimeout(function(){jt(e,t,n)},0)}function jt(e,t,n){var r=t.value,i=e.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=e.options.length;s-1,a.selected!==o&&(a.selected=o);else if(y(Lt(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function It(e,t){return t.every(function(t){return!y(t,e)})}function Lt(e){return"_value"in e?e._value:e.value}function Ft(e){e.target.composing=!0}function Nt(e){e.target.composing&&(e.target.composing=!1,Mt(e.target,"input"))}function Mt(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Rt(e){return!e.componentInstance||e.data&&e.data.transition?e:Rt(e.componentInstance._vnode)}function Bt(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Bt(Y(t.children)):e}function Wt(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[bn(o)]=i[o];return t}function Vt(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}function Ut(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function Ht(e){e.data.newPos=e.elm.getBoundingClientRect()}function zt(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}function qt(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:function(e){for(var t={},n=0,r=e.length;n':'
',So.innerHTML.indexOf(" ")>0}var pn=Object.freeze({}),hn=Object.prototype.toString,vn=l("slot,component",!0),mn=l("key,ref,slot,slot-scope,is"),gn=Object.prototype.hasOwnProperty,yn=/-(\w)/g,bn=d(function(e){return e.replace(yn,function(e,t){return t?t.toUpperCase():""})}),_n=d(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),wn=/\B([A-Z])/g,Tn=d(function(e){return e.replace(wn,"-$1").toLowerCase()}),kn=function(e,t,n){return!1},Cn=function(e){return e},xn="data-server-rendered",An=["component","directive","filter"],Sn=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured"],$n={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:kn,isReservedAttr:kn,isUnknownElement:kn,getTagNamespace:g,parsePlatformTagName:Cn,mustUseProp:kn,_lifecycleHooks:Sn},On=/[^\w.$]/,En="__proto__"in{},Pn="undefined"!=typeof window,Dn="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,jn=Dn&&WXEnvironment.platform.toLowerCase(),In=Pn&&window.navigator.userAgent.toLowerCase(),Ln=In&&/msie|trident/.test(In),Fn=In&&In.indexOf("msie 9.0")>0,Nn=In&&In.indexOf("edge/")>0,Mn=In&&In.indexOf("android")>0||"android"===jn,Rn=In&&/iphone|ipad|ipod|ios/.test(In)||"ios"===jn,Bn=(In&&/chrome\/\d+/.test(In),{}.watch),Wn=!1;if(Pn)try{var Vn={};Object.defineProperty(Vn,"passive",{get:function(){Wn=!0}}),window.addEventListener("test-passive",null,Vn)}catch(e){}var Un,Hn,zn=function(){return void 0===Un&&(Un=!Pn&&"undefined"!=typeof global&&"server"===global.process.env.VUE_ENV),Un},qn=Pn&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,Kn="undefined"!=typeof Symbol&&T(Symbol)&&"undefined"!=typeof Reflect&&T(Reflect.ownKeys);Hn="undefined"!=typeof Set&&T(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var Jn=g,Gn=0,Xn=function(){this.id=Gn++,this.subs=[]};Xn.prototype.addSub=function(e){this.subs.push(e)},Xn.prototype.removeSub=function(e){u(this.subs,e)},Xn.prototype.depend=function(){Xn.target&&Xn.target.addDep(this)},Xn.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;txr&&_r[n].id>e.id;)n--;_r.splice(n+1,0,e)}else _r.push(e);kr||(kr=!0,U(ce))}}(this)},Sr.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||i(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){R(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},Sr.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},Sr.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},Sr.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||u(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var $r={enumerable:!0,configurable:!0,get:g,set:g},Or={lazy:!0};Ce(xe.prototype);var Er,Pr,Dr,jr,Ir={init:function(e,n,r,i){if(!e.componentInstance||e.componentInstance._isDestroyed)(e.componentInstance=(a=e,s={_isComponent:!0,parent:br,_parentVnode:a,_parentElm:r||null,_refElm:i||null},c=a.data.inlineTemplate,t(c)&&(s.render=c.render,s.staticRenderFns=c.staticRenderFns),new a.componentOptions.Ctor(s))).$mount(n?e.elm:void 0,n);else if(e.data.keepAlive){var o=e;Ir.prepatch(o,o)}var a,s,c},prepatch:function(e,t){var n=t.componentOptions;!function(e,t,n,r,i){var o=!!(i||e.$options._renderChildren||r.data.scopedSlots||e.$scopedSlots!==pn);if(e.$options._parentVnode=r,e.$vnode=r,e._vnode&&(e._vnode.parent=r),e.$options._renderChildren=i,e.$attrs=r.data&&r.data.attrs||pn,e.$listeners=n||pn,t&&e.$options.props){ir.shouldConvert=!1;for(var a=e._props,s=e.$options._propKeys||[],c=0;c1?h(n):n;for(var r=h(arguments,1),i=0,o=n.length;iparseInt(this.max)&&Ie(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};Rr=Ee,(Wr={}).get=function(){return $n},Object.defineProperty(Rr,"config",Wr),Rr.util={warn:Jn,extend:v,mergeOptions:I,defineReactive:S},Rr.set=$,Rr.delete=O,Rr.nextTick=U,Rr.options=Object.create(null),An.forEach(function(e){Rr.options[e+"s"]=Object.create(null)}),Rr.options._base=Rr,v(Rr.options.components,Ur),Rr.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=h(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this},Rr.mixin=function(e){return this.options=I(this.options,e),this},function(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,i=e._Ctor||(e._Ctor={});if(i[r])return i[r];var o=e.name||n.options.name,a=function(e){this._init(e)};return(a.prototype=Object.create(n.prototype)).constructor=a,a.cid=t++,a.options=I(n.options,e),a.super=n,a.options.props&&function(e){var t=e.options.props;for(var n in t)le(e.prototype,"_props",n)}(a),a.options.computed&&function(e){var t=e.options.computed;for(var n in t)ue(e.prototype,n,t[n])}(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,An.forEach(function(e){a[e]=n[e]}),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=e,a.sealedOptions=v({},a.options),i[r]=a,a}}(Rr),Br=Rr,An.forEach(function(e){Br[e]=function(t,n){return n?("component"===e&&o(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"==typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}),Object.defineProperty(Ee.prototype,"$isServer",{get:zn}),Object.defineProperty(Ee.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Ee.version="2.5.13";var Hr,zr,qr,Kr,Jr,Gr,Xr,Zr,Yr=l("style,class"),Qr=l("input,textarea,option,select,progress"),ei=function(e,t,n){return"value"===n&&Qr(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},ti=l("contenteditable,draggable,spellcheck"),ni=l("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),ri="http://www.w3.org/1999/xlink",ii=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},oi=function(e){return ii(e)?e.slice(6,e.length):""},ai=function(e){return null==e||!1===e},si={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},ci=l("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),li=l("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),ui=function(e){return ci(e)||li(e)},fi=Object.create(null),di=l("text,number,password,search,email,tel,url"),pi=Object.freeze({createElement:function(e,t){var n=document.createElement(e);return"select"!==e?n:(t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)},createElementNS:function(e,t){return document.createElementNS(si[e],t)},createTextNode:function(e){return document.createTextNode(e)},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,n){e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){e.appendChild(t)},parentNode:function(e){return e.parentNode},nextSibling:function(e){return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},setAttribute:function(e,t,n){e.setAttribute(t,n)}}),hi={create:function(e,t){Be(t)},update:function(e,t){e.data.ref!==t.data.ref&&(Be(e,!0),Be(t))},destroy:function(e){Be(e,!0)}},vi=new Yn("",{},[]),mi=["create","activate","update","remove","destroy"],gi={create:Ue,update:Ue,destroy:function(e){Ue(e,vi)}},yi=Object.create(null),bi=[hi,gi],_i={create:qe,update:qe},wi={create:Je,update:Je},Ti=/[\w).+\-_$\]]/,ki="__r",Ci="__c",xi={create:dt,update:dt},Ai={create:pt,update:pt},Si=d(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}),$i=/^--/,Oi=/\s*!important$/,Ei=function(e,t,n){if($i.test(t))e.style.setProperty(t,n);else if(Oi.test(n))e.style.setProperty(t,n.replace(Oi,""),"important");else{var r=Di(t);if(Array.isArray(n))for(var i=0,o=n.length;ip?h(n,e(i[b+1])?null:i[b+1].elm,i,d,b,o):d>b&&m(0,r,f,p)}(c,d,p,o,s):t(p)?(t(r.text)&&x.setTextContent(c,""),h(c,null,p,0,p.length-1,o)):t(d)?m(0,d,0,d.length-1):t(r.text)&&x.setTextContent(c,""):r.text!==i.text&&x.setTextContent(c,i.text),t(u)&&t(l=u.hook)&&t(l=l.postpatch)&&l(r,i)}}}function b(e,r,i){if(n(i)&&t(e.parent))e.parent.data.pendingInsert=r;else for(var o=0;o-1?fi[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:fi[e]=/HTMLUnknownElement/.test(t.toString())},v(Ee.options.directives,qi),v(Ee.options.components,Xi),Ee.prototype.__patch__=Pn?Hi:g,Ee.prototype.$mount=function(e,t){return e=e&&Pn?Re(e):void 0,r=e,i=t,(n=this).$el=r,n.$options.render||(n.$options.render=er),se(n,"beforeMount"),new Sr(n,function(){n._update(n._render(),i)},g,null,!0),i=!1,null==n.$vnode&&(n._isMounted=!0,se(n,"mounted")),n;var n,r,i},Ee.nextTick(function(){$n.devtools&&qn&&qn.emit("init",Ee)},0);var Zi,Yi=/\{\{((?:.|\n)+?)\}\}/g,Qi=/[-.*+?^${}()|[\]\/\\]/g,eo=d(function(e){var t=e[0].replace(Qi,"\\$&"),n=e[1].replace(Qi,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")}),to={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=rt(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=nt(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}},no={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=rt(e,"style");n&&(e.staticStyle=JSON.stringify(Si(n)));var r=nt(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},ro=l("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),io=l("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),oo=l("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),ao=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,so="[a-zA-Z_][\\w\\-\\.]*",co="((?:"+so+"\\:)?"+so+")",lo=new RegExp("^<"+co),uo=/^\s*(\/?)>/,fo=new RegExp("^<\\/"+co+"[^>]*>"),po=/^]+>/i,ho=/^/g,"$1").replace(//g,"$1")),Lo(d,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});u+=e.length-h.length,e=h,r(d,u-f,u)}else{var v=e.indexOf("<");if(0===v){if(ho.test(e)){var m=e.indexOf("--\x3e");if(m>=0){t.shouldKeepComment&&t.comment(e.substring(4,m)),n(m+3);continue}}if(vo.test(e)){var g=e.indexOf("]>");if(g>=0){n(g+2);continue}}var y=e.match(po);if(y){n(y[0].length);continue}var b=e.match(fo);if(b){var _=u;n(b[0].length),r(b[1],_,u);continue}var w=function(){var t=e.match(lo);if(t){var r,i,o={tagName:t[1],attrs:[],start:u};for(n(t[0].length);!(r=e.match(uo))&&(i=e.match(ao));)n(i[0].length),o.attrs.push(i);if(r)return o.unarySlash=r[1],n(r[0].length),o.end=u,o}}();if(w){!function(e){var n,i,u,f=e.tagName,d=e.unarySlash;s&&("p"===o&&oo(f)&&r(o),l(f)&&o===f&&r(f));for(var p=c(f)||!!d,h=e.attrs.length,v=new Array(h),m=0;m=0){for(k=e.slice(v);!(fo.test(k)||lo.test(k)||ho.test(k)||vo.test(k)||(C=k.indexOf("<",1))<0);)v+=C,k=e.slice(v);T=e.substring(0,v),n(v)}v<0&&(T=e,e=""),t.chars&&T&&t.chars(T)}if(e===i){t.chars&&t.chars(e);break}}r()}(e,{warn:go,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,start:function(e,a,l){var u=i&&i.ns||Co(e);Ln&&"svg"===u&&(a=function(e){for(var t=[],n=0;nc&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var l=Ge(r[1].trim());a.push("_s("+l+")"),s.push({"@binding":l}),c=i+r[0].length}return c1?1:0:1:n?Math.min(n,2):0]?o[t].trim():e}function a(e){return JSON.parse(JSON.stringify(e))}function s(e){for(var n=arguments,r=Object(e),i=1;i=97&&t<=122||t>=65&&t<=90?"ident":t>=49&&t<=57?"number":"else"}function p(e){var t,n,r,i=e.trim();return("0"!==e.charAt(0)||!isNaN(e))&&(r=i,F.test(r)?(n=(t=i).charCodeAt(0))!==t.charCodeAt(t.length-1)||34!==n&&39!==n?t:t.slice(1,-1):"*"+i)}var h,v=Object.prototype.toString,m="[object Object]",g=Object.prototype.hasOwnProperty,y="undefined"!=typeof Intl&&void 0!==Intl.DateTimeFormat,b="undefined"!=typeof Intl&&void 0!==Intl.NumberFormat,_={beforeCreate:function(){var e=this.$options;if(e.i18n=e.i18n||(e.__i18n?{}:null),e.i18n){if(e.i18n instanceof M){if(e.__i18n)try{var t={};e.__i18n.forEach(function(e){t=s(t,JSON.parse(e))}),Object.keys(t).forEach(function(n){e.i18n.mergeLocaleMessage(n,t[n])})}catch(e){}this._i18n=e.i18n,this._i18nWatcher=this._i18n.watchI18nData(),this._i18n.subscribeDataChanging(this),this._subscribing=!0}else if(n(e.i18n)){if(this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof M&&(e.i18n.root=this.$root.$i18n,e.i18n.formatter=this.$root.$i18n.formatter,e.i18n.fallbackLocale=this.$root.$i18n.fallbackLocale,e.i18n.silentTranslationWarn=this.$root.$i18n.silentTranslationWarn),e.__i18n)try{var r={};e.__i18n.forEach(function(e){r=s(r,JSON.parse(e))}),e.i18n.messages=r}catch(e){}this._i18n=new M(e.i18n),this._i18nWatcher=this._i18n.watchI18nData(),this._i18n.subscribeDataChanging(this),this._subscribing=!0,(void 0===e.i18n.sync||e.i18n.sync)&&(this._localeWatcher=this.$i18n.watchLocale())}}else this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof M?(this._i18n=this.$root.$i18n,this._i18n.subscribeDataChanging(this),this._subscribing=!0):e.parent&&e.parent.$i18n&&e.parent.$i18n instanceof M&&(this._i18n=e.parent.$i18n,this._i18n.subscribeDataChanging(this),this._subscribing=!0)},beforeDestroy:function(){this._i18n&&(this._subscribing&&(this._i18n.unsubscribeDataChanging(this),delete this._subscribing),this._i18nWatcher&&(this._i18nWatcher(),delete this._i18nWatcher),this._localeWatcher&&(this._localeWatcher(),delete this._localeWatcher),this._i18n=null)}},w={name:"i18n",functional:!0,props:{tag:{type:String,default:"span"},path:{type:String,required:!0},locale:{type:String},places:{type:[Array,Object]}},render:function(t,n){var r=n.props,i=n.data,o=n.children,a=n.parent.$i18n;if(o=(o||[]).filter(function(e){return e.tag||(e.text=e.text.trim())}),!a)return o;var s=r.path,c=r.locale,l={},u=r.places||{},f=Array.isArray(u)?u.length>0:Object.keys(u).length>0,d=o.every(function(e){if(e.data&&e.data.attrs){var t=e.data.attrs.place;return void 0!==t&&""!==t}});return f&&o.length>0&&!d&&e("If places prop is set, all child elements must have place prop set."),Array.isArray(u)?u.forEach(function(e,t){l[t]=e}):Object.keys(u).forEach(function(e){l[e]=u[e]}),o.forEach(function(e,t){var n=d?""+e.data.attrs.place:""+t;l[n]=e}),t(r.tag,i,a.i(s,c,l))}},T=function(){this._caches=Object.create(null)};T.prototype.interpolate=function(e,n){var r=this._caches[e];return r||(r=function(e){for(var t=[],n=0,r="";n0)f--,u=E,h[x]();else{if(f=0,!1===(n=p(n)))return!1;h[A]()}};null!==u;)if(l++,"\\"!==(t=e[l])||!function(){var t=e[l+1];if(u===P&&"'"===t||u===D&&'"'===t)return l++,r="\\"+t,h[x](),!0}()){if(i=d(t),(o=(s=L[u])[i]||s.else||I)===I)return;if(u=o[0],(a=h[o[1]])&&(r=void 0===(r=o[2])?t:r,!1===a()))return;if(u===j)return c}}(e))&&(this._cache[e]=t),t||[]},N.prototype.getPathValue=function(e,n){if(!t(e))return null;var r,i=this.parsePath(n);if(r=i,Array.isArray(r)&&0===r.length)return null;for(var o=i.length,a=e,s=0;s-1)e.splice(n,1)}}(this._dataListeners,e)},M.prototype.watchI18nData=function(){var e=this;return this._vm.$watch("$data",function(){for(var t=e._dataListeners.length;t--;)h.nextTick(function(){e._dataListeners[t]&&e._dataListeners[t].$forceUpdate()})},{deep:!0})},M.prototype.watchLocale=function(){if(!this._sync||!this._root)return null;var e=this._vm;return this._root.vm.$watch("locale",function(t){e.$set(e,"locale",t),e.$forceUpdate()},{immediate:!0})},R.vm.get=function(){return this._vm},R.messages.get=function(){return a(this._getMessages())},R.dateTimeFormats.get=function(){return a(this._getDateTimeFormats())},R.numberFormats.get=function(){return a(this._getNumberFormats())},R.locale.get=function(){return this._vm.locale},R.locale.set=function(e){this._vm.$set(this._vm,"locale",e)},R.fallbackLocale.get=function(){return this._vm.fallbackLocale},R.fallbackLocale.set=function(e){this._vm.$set(this._vm,"fallbackLocale",e)},R.missing.get=function(){return this._missing},R.missing.set=function(e){this._missing=e},R.formatter.get=function(){return this._formatter},R.formatter.set=function(e){this._formatter=e},R.silentTranslationWarn.get=function(){return this._silentTranslationWarn},R.silentTranslationWarn.set=function(e){this._silentTranslationWarn=e},M.prototype._getMessages=function(){return this._vm.messages},M.prototype._getDateTimeFormats=function(){return this._vm.dateTimeFormats},M.prototype._getNumberFormats=function(){return this._vm.numberFormats},M.prototype._warnDefault=function(e,t,n,i){return r(n)?(this.missing&&this.missing.apply(null,[e,t,i]),t):n},M.prototype._isFallbackRoot=function(e){return!e&&!r(this._root)&&this._fallbackRoot},M.prototype._interpolate=function(e,t,i,o,a,s){if(!t)return null;var c,l=this._path.getPathValue(t,i);if(Array.isArray(l))return l;if(r(l)){if(!n(t))return null;if("string"!=typeof(c=t[i]))return null}else{if("string"!=typeof l)return null;c=l}return c.indexOf("@:")>=0&&(c=this._link(e,t,c,o,a,s)),s?this._render(c,a,s):c},M.prototype._link=function(e,t,n,r,i,o){var a=n,s=a.match(/(@:[\w\-_|.]+)/g);for(var c in s)if(s.hasOwnProperty(c)){var l=s[c],u=l.substr(2),f=this._interpolate(e,t,u,r,"raw"===i?"string":i,"raw"===i?void 0:o);if(this._isFallbackRoot(f)){if(!this._root)throw Error("unexpected error");var d=this._root;f=d._translate(d._getMessages(),d.locale,d.fallbackLocale,u,r,i,o)}a=(f=this._warnDefault(e,u,f,r))?a.replace(l,f):a}return a},M.prototype._render=function(e,t,n){var r=this._formatter.interpolate(e,n);return"string"===t?r.join(""):r},M.prototype._translate=function(e,t,n,i,o,a,s){var c=this._interpolate(t,e[t],i,o,a,s);return r(c)?r(c=this._interpolate(n,e[n],i,o,a,s))?null:c:c},M.prototype._t=function(e,t,n,r){for(var o=[],a=arguments.length-4;a-- >0;)o[a]=arguments[a+4];if(!e)return"";var s,c=i.apply(void 0,o),l=c.locale||t,u=this._translate(n,l,this.fallbackLocale,e,r,"string",c.params);if(this._isFallbackRoot(u)){if(!this._root)throw Error("unexpected error");return(s=this._root).t.apply(s,[e].concat(o))}return this._warnDefault(l,e,u,r)},M.prototype.t=function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return(r=this)._t.apply(r,[e,this.locale,this._getMessages(),null].concat(t));var r},M.prototype._i=function(e,t,n,r,i){var o=this._translate(n,t,this.fallbackLocale,e,r,"raw",i);if(this._isFallbackRoot(o)){if(!this._root)throw Error("unexpected error");return this._root.i(e,t,i)}return this._warnDefault(t,e,o,r)},M.prototype.i=function(e,t,n){return e?("string"!=typeof t&&(t=this.locale),this._i(e,t,this._getMessages(),null,n)):""},M.prototype._tc=function(e,t,n,r,i){for(var a=[],s=arguments.length-5;s-- >0;)a[s]=arguments[s+5];return e?(void 0===i&&(i=1),o((c=this)._t.apply(c,[e,t,n,r].concat(a)),i)):"";var c},M.prototype.tc=function(e,t){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return(i=this)._tc.apply(i,[e,this.locale,this._getMessages(),null,t].concat(n));var i},M.prototype._te=function(e,t,n){for(var r=[],o=arguments.length-3;o-- >0;)r[o]=arguments[o+3];var a=i.apply(void 0,r).locale||t;return this._exist(n[a],e)},M.prototype.te=function(e,t){return this._te(e,this.locale,this._getMessages(),t)},M.prototype.getLocaleMessage=function(e){return a(this._vm.messages[e]||{})},M.prototype.setLocaleMessage=function(e,t){this._vm.messages[e]=t},M.prototype.mergeLocaleMessage=function(e,t){this._vm.messages[e]=h.util.extend(this._vm.messages[e]||{},t)},M.prototype.getDateTimeFormat=function(e){return a(this._vm.dateTimeFormats[e]||{})},M.prototype.setDateTimeFormat=function(e,t){this._vm.dateTimeFormats[e]=t},M.prototype.mergeDateTimeFormat=function(e,t){this._vm.dateTimeFormats[e]=h.util.extend(this._vm.dateTimeFormats[e]||{},t)},M.prototype._localizeDateTime=function(e,t,n,i,o){var a=t,s=i[a];if((r(s)||r(s[o]))&&(s=i[a=n]),r(s)||r(s[o]))return null;var c=s[o],l=a+"__"+o,u=this._dateTimeFormatters[l];return u||(u=this._dateTimeFormatters[l]=new Intl.DateTimeFormat(a,c)),u.format(e)},M.prototype._d=function(e,t,n){if(!n)return new Intl.DateTimeFormat(t).format(e);var r=this._localizeDateTime(e,t,this.fallbackLocale,this._getDateTimeFormats(),n);if(this._isFallbackRoot(r)){if(!this._root)throw Error("unexpected error");return this._root.d(e,n,t)}return r||""},M.prototype.d=function(e){for(var n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];var i=this.locale,o=null;return 1===n.length?"string"==typeof n[0]?o=n[0]:t(n[0])&&(n[0].locale&&(i=n[0].locale),n[0].key&&(o=n[0].key)):2===n.length&&("string"==typeof n[0]&&(o=n[0]),"string"==typeof n[1]&&(i=n[1])),this._d(e,i,o)},M.prototype.getNumberFormat=function(e){return a(this._vm.numberFormats[e]||{})},M.prototype.setNumberFormat=function(e,t){this._vm.numberFormats[e]=t},M.prototype.mergeNumberFormat=function(e,t){this._vm.numberFormats[e]=h.util.extend(this._vm.numberFormats[e]||{},t)},M.prototype._localizeNumber=function(e,t,n,i,o){var a=t,s=i[a];if((r(s)||r(s[o]))&&(s=i[a=n]),r(s)||r(s[o]))return null;var c=s[o],l=a+"__"+o,u=this._numberFormatters[l];return u||(u=this._numberFormatters[l]=new Intl.NumberFormat(a,c)),u.format(e)},M.prototype._n=function(e,t,n){if(!n)return new Intl.NumberFormat(t).format(e);var r=this._localizeNumber(e,t,this.fallbackLocale,this._getNumberFormats(),n);if(this._isFallbackRoot(r)){if(!this._root)throw Error("unexpected error");return this._root.n(e,n,t)}return r||""},M.prototype.n=function(e){for(var n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];var i=this.locale,o=null;return 1===n.length?"string"==typeof n[0]?o=n[0]:t(n[0])&&(n[0].locale&&(i=n[0].locale),n[0].key&&(o=n[0].key)):2===n.length&&("string"==typeof n[0]&&(o=n[0]),"string"==typeof n[1]&&(i=n[1])),this._n(e,i,o)},Object.defineProperties(M.prototype,R),M.availabilities={dateTimeFormat:y,numberFormat:b},M.install=function e(t){var n;(h=t).version&&Number(h.version.split(".")[0]),e.installed=!0,Object.defineProperty(h.prototype,"$i18n",{get:function(){return this._i18n}}),n=h,Object.defineProperty(n.prototype,"$t",{get:function(){var e=this;return function(t){for(var n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];var i=e.$i18n;return i._t.apply(i,[t,i.locale,i._getMessages(),e].concat(n))}}}),Object.defineProperty(n.prototype,"$tc",{get:function(){var e=this;return function(t,n){for(var r=[],i=arguments.length-2;i-- >0;)r[i]=arguments[i+2];var o=e.$i18n;return o._tc.apply(o,[t,o.locale,o._getMessages(),e,n].concat(r))}}}),Object.defineProperty(n.prototype,"$te",{get:function(){var e=this;return function(t,n){var r=e.$i18n;return r._te(t,r.locale,r._getMessages(),n)}}}),Object.defineProperty(n.prototype,"$d",{get:function(){var e=this;return function(t){for(var n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(i=e.$i18n).d.apply(i,[t].concat(n));var i}}}),Object.defineProperty(n.prototype,"$n",{get:function(){var e=this;return function(t){for(var n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(i=e.$i18n).n.apply(i,[t].concat(n));var i}}}),h.mixin(_),h.directive("t",{bind:c,update:l}),h.component(w.name,w);var r=h.config.optionMergeStrategies;r.i18n=r.methods},M.version="7.3.4","undefined"!=typeof window&&window.Vue&&window.Vue.use(M),M});var messages={en:{title:"Stairs",systemID:"System ID",firmwareVersion:"Firmware version: ",copyright:"Copyright © 2017 Mark van Renswoude",loading:"Please wait, loading configuration...",rebootPending:"The system will be rebooted, please refresh this page afterwards",applyButton:"Apply",applyButtonSaving:"Saving...",wifiStatus:{accesspoint:{title:"AP: ",disabled:"Disabled"},stationmode:{title:"WiFi: ",disabled:"Disabled",idle:"Idle",noSSID:"SSID not found",scanCompleted:"Scan completed",connectFailed:"Failed to connect",connectionLost:"Connection lost",disconnected:"Disconnected"}},status:{tabTitle:"Status",title:"Current status",allStepsTrue:"Set intensity for all steps",allStepsFalse:"Set intensity individually"},triggers:{tabTitle:"Triggers",timeTitle:"Time",timeInternet:"Please note that time triggers require an internet connection.",timeNoData:"No time triggers defined yet",timeEnabled:"Enable time triggers",timeTransitionTime:"Transition time in milliseconds",timeAdd:"Add",timeDelete:"Delete",timeTriggerEnabled:"Enabled",timeFixedTime:"Fixed time",timeSunrise:"Sunrise",timeSunset:"Sunset",timeTime:"Time in minutes",timeMonday:"Monday",timeTuesday:"Tuesday",timeWednesday:"Wednesday",timeThursday:"Thursday",timeFriday:"Friday",timeSaturday:"Saturday",timeSunday:"Sunday",motionTitle:"Motion",motionNoData:"No motion triggers defined yet",motionEnabled:"Enable motion triggers",motionEnabledDuringTimeTrigger:"Activate even if a time trigger is already active",motionTransitionTime:"Transition time in milliseconds",motionTriggerEnabled:"Enabled",motionAdd:"Add",motionDelete:"Delete",motionPin:"GPIO pin (active high)",motionDirection:"Sweep animation",motionDirectionNonDirectional:"None (all steps at the same time)",motionDirectionTopDown:"Top down",motionDirectionBottomUp:"Bottom up"},connection:{tabTitle:"Connection",title:"Connection parameters",accesspoint:"Enable access point",accesspointHint:"Allows for a direct connection from your device to this Stairs module for configuration purposes. The Stairs configuration is available on http://192.168.1.4/ when you are connected to it. Turn it off as soon as station mode is configured, as it is not secured in any way. You can always turn this option back on by pushing the access point button until the LED lights up.",stationmode:"Enable station mode",stationmodeHint:"Connect this Stairs module to your own WiFi router. Please enter the SSID, password and further configuration below.",ssid:"SSID",password:"Password",dhcp:"Use DHCP",dhcpHint:"Automatically assigns an IP address to this Stairs module. You probably want to keep this on unless you know what you're doing.",ipaddress:"IP address",subnetmask:"Subnet mask",gateway:"Gateway",hostname:"Hostname",hostnamePlaceholder:"Default: mac address"},system:{tabTitle:"System",ntpTitle:"Time synchronisation (NTP)",pinsTitle:"Hardware pinout",mapsTitle:"Google Maps API",firmwareTitle:"Firmware update",ntpServer:"NTP server",ntpInterval:"Refresh interval (in minutes)",ntpLat:"Latitude",ntpLng:"Longitude",ntpLocation:"Get latitude / longitude from location",ntpLocationSearch:"Search",pinLEDAP:"Access Point status LED pin (+3.3v)",pinLEDSTA:"Station Mode status LED pin (+3.3v)",pinAPButton:"Enable Access Point button pin (active low)",pinPWMDriverSDA:"PCA9685 PWM driver SDA pin (data)",pinPWMDriverSCL:"PCA9685 PWM driver SCL pin (clock)",pwmAddress:"PCA9685 PWM driver I²C address",pwmFrequency:"PCA9685 PWM driver frequency",mapsAPIKey:"Google Maps API key",mapsAPIKeyhint:"Recommended if using time triggers. Used for looking up the current timezone. Will work without an API key, but Google might throttle your request. Register for a free API key at http://console.developers.google.com/ and activate it's use for the Maps API."},error:{loadVersion:"Could not load information about the system",loadConnection:"Could not load connection settings",loadSystem:"Could not load system settings",loadTimeTriggers:"Could not load time trigger settings",loadMotionTriggers:"Could not load motion trigger settings",applyConnection:"Could not save connection settings",applySystem:"Could not save system settings",updateWiFiStatus:"Could not retrieve WiFi status",uploadFirmware:"Error while uploading firmware",updateSteps:"Could not apply new step values",searchLocation:"Could not look up location coordinates",applyTimeTriggers:"Could not save time trigger settings",applyMotionTriggers:"Could not save motion trigger settings"}},nl:{title:"Trap",systemID:"Systeem ID",firmwareVersion:"Firmware versie: ",copyright:"Copyright © 2017 Mark van Renswoude",loading:"Een ogenblik geduld, bezig met laden van configuratie...",rebootPending:"Het systeem wordt opnieuw opgestart, ververse deze pagina nadien",applyButton:"Toepassen",applyButtonSaving:"Bezig met opslaan...",wifiStatus:{accesspoint:{title:"AP: ",disabled:"Uitgeschakeld"},stationmode:{title:"WiFi: ",disabled:"Uitgeschakeld",idle:"Slaapstand",noSSID:"SSID niet gevonden",scanCompleted:"Scan afgerond",connectFailed:"Kan geen verbinding maken",connectionLost:"Verbinding verloren",disconnected:"Niet verbonden"}},status:{tabTitle:"Status",title:"Huidige status",allStepsTrue:"Alle treden dezelfde intensiteit",allStepsFalse:"Treden individueel instellen"},triggers:{tabTitle:"Triggers",timeTitle:"Tijd",timeInternet:"Let op dat voor tijd triggers een internetverbinding vereist is.",timeNoData:"Nog geen tijd triggers geconfigureerd",timeEnabled:"Tijd triggers inschakelen",timeTransitionTime:"Transitie tijd in milliseconden",timeAdd:"Toevoegen",timeDelete:"Verwijderen",timeTriggerEnabled:"Actief",timeFixedTime:"Vaste tijd",timeSunrise:"Zonsopkomst",timeSunset:"Zonsondergang",timeTime:"Tijd in minuten",timeMonday:"Maandag",timeTuesday:"Dinsdag",timeWednesday:"Woensdag",timeThursday:"Donderdag",timeFriday:"Vrijdag",timeSaturday:"Zaterdag",timeSunday:"Zondag",motionTitle:"Beweging",motionNoData:"Nog geen beweging triggers geconfigureerd",motionEnabled:"Beweging triggers inschakelen",motionEnabledDuringTimeTrigger:"Ook inschakelen als er al een tijd trigger actief is",motionTransitionTime:"Transitie tijd in milliseconden",motionTriggerEnabled:"Actief",motionAdd:"Toevoegen",motionDelete:"Verwijderen",motionPin:"GPIO pin (actief hoog)",motionDirection:"Animatie",motionDirectionNonDirectional:"Geen (alle treden gelijktijdig)",motionDirectionTopDown:"Boven naar beneden",motionDirectionBottomUp:"Beneden naar boven"},connection:{tabTitle:"Verbinding",title:"Verbinding configuratie",accesspoint:"Access point inschakelen",accesspointhint:"Maakt het mogelijk om een directe connectie vanaf een apparaat naar deze Trap module te maken om de module te configureren. De Trap module is te benaderen via http://192.168.1.4/ nadat je connectie hebt gemaakt. Schakel deze optie uit na het configureren, aangezien deze niet beveiligd is. Je kunt deze optie ook inschakelen door op de Access point knop te drukken totdat de LED aan gaat.",stationmode:"Verbinding met WiFi maken",stationmodehint:"Verbind deze Trap module aan je eigen WiFi router. Vul hieronder het SSID en wachtwoord in, en configureer eventuel de overige opties.",ssid:"SSID",password:"Wachtwoord",dhcp:"Gebruik DHCP",dhcphint:"Automatisch een IP adres toewijzen aan deze Trap module. Waarschijnlijk wil je deze optie aan laten, tenzij je weet waar je mee bezig bent.",ipaddress:"IP adres",subnetmask:"Subnet masker",gateway:"Gateway",hostname:"Hostnaam",hostnamePlaceholder:"Standaard: mac adres"},system:{tabTitle:"Systeem",ntpTitle:"Tijd synchronisatie (NTP)",pinsTitle:"Hardware aansluitingen",mapsTitle:"Google Maps API",firmwareTitle:"Firmware bijwerken",ntpServer:"NTP server",ntpInterval:"Ververs interval (in minuten)",ntpLat:"Breedtegraad",ntpLng:"Lengtegraad",ntpLocation:"Breedtegraad / lengtegraad ophalen op basis van locatie",ntpLocationSearch:"Zoeken",pinLEDAP:"Access Point status LED pin (+3.3v)",pinLEDSTA:"WiFi status LED pin (+3.3v)",pinAPButton:"Access Point inschakelen knop pin (actief laag)",pinPWMDriverSDA:"PCA9685 PWM driver SDA pin (data)",pinPWMDriverSCL:"PCA9685 PWM driver SCL pin (klok)",pwmAddress:"PCA9685 PWM driver I²C address",pwmFrequency:"PCA9685 PWM driver frequency",mapsAPIKey:"Google Maps API key",mapsAPIKeyhint:"Aangeraden bij gebruik van de tijd triggers. Wordt gebruikt om de huidige tijdzone te bepalen. Werkt ook zonder API key, maar Google beperkt dan sterk de requests. Registreer een gratis API key op http://console.developers.google.com/ en activeer het voor gebruik met de Maps API."},error:{loadVersion:"Kan systeeminformatie niet ophalen",loadConnection:"Kan verbinding instellingen niet ophalen",loadSystem:"Kan systeem instellingen niet ophalen",loadTimeTriggers:"Kan tijd trigger instellingen niet ophalen",loadMotionTriggers:"Kan beweging trigger instellingen niet ophalen",applyConnection:"Kan verbinding instellingen niet opslaan",applySystem:"Kan systeem instellingen niet opslaan",updateWiFiStatus:"Kan WiFi status niet ophalen",uploadFirmware:"Fout tijdens bijwerken van firmware",updateSteps:"Kan trap instellingen niet opslaan",searchLocation:"Kan locatie coordinaten niet bepalen",applyTimeTriggers:"Kan tijd trigger instellingen niet opslaan",applyMotionTriggers:"Kan beweging trigger instellingen niet opslaan"}}};function startApp(){Vue.component("check",{template:'
{{ title }}
',props:{title:String,value:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},methods:{handleClick:function(){this.disabled||(this.value=!this.value,this.$emit("input",this.value))},handleKeyDown:function(e){32==e.keyCode&&(this.handleClick(),e.preventDefault())}}}),Vue.component("radio",{template:'
{{ title }}
',props:{title:String,value:null,id:null,disabled:{type:Boolean,default:!1}},methods:{handleClick:function(){this.disabled||(this.value=this.id,this.$emit("input",this.value))},handleKeyDown:function(e){32==e.keyCode&&(this.handleClick(),e.preventDefault())}}});var e=new VueI18n({locale:navigator.language,fallbackLocale:"en",messages:messages});new Vue({el:"#app",i18n:e,data:{notification:null,loading:!0,saving:!1,savingSteps:!1,loadingIndicator:"|",uploadProgress:!1,activeTab:"status",version:{systemID:"loading...",version:"loading..."},wifiStatus:{ap:{enabled:!1,ip:"0.0.0.0"},station:{enabled:!1,status:0,ip:"0.0.0.0"}},searchingLocation:!1,triggers:{time:{enabled:!1,transitionTime:null,triggers:[]},motion:{enabled:!1,enabledDuringTimeTrigger:!1,transitionTime:null,delay:null,triggers:[]}},connection:{hostname:null,accesspoint:!0,station:!1,ssid:null,password:null,dhcp:!0,ip:null,subnetmask:null,gateway:null},system:{ntpServer:null,ntpInterval:5,lat:null,lng:null,pins:{ledAP:null,ledSTA:null,apButton:null,pwmSDA:null,pwmSCL:null},pwmAddress:null,pwmFrequency:null,mapsAPIKey:""},allSteps:!0,allStepsValue:0,steps:[],location:"",fixedTimes:[],relativeTimes:[]},created:function(){var t=this;t.notificationTimer=null,document.title=e.t("title");var n=window.location.hash.substr(1);n&&(t.activeTab=n),t.startLoadingIndicator(),t.updateWiFiStatus(),t.disableStepsChanged=!1,t.savingStepsTimer=!1;for(var r=[],i=[],o=0;o<1440;o+=15)r.push(o);for(o=-240;o<=240;o+=15)i.push(o);t.fixedTimes=r,t.relativeTimes=i,t.loadVersion().then(function(){t.loadConnection().then(function(){t.loadSystem().then(function(){t.loadTimeTriggers().then(function(){t.loadMotionTriggers().then(function(){t.loadSteps().then(function(){t.stopLoadingIndicator(),t.loading=!1})})})})})})},methods:{showNotification:function(e,t){var n=this;n.notification={message:e,error:t},null!=n.notificationTimer&&clearTimeout(n.notificationTimer),n.notificationTimer=setTimeout(function(){n.notification=null,n.notificationTimer=null},5e3)},hideNotification:function(){this.notification=null,null!=this.notificationTimer&&(clearTimeout(this.notificationTimer),this.notificationTimer=null)},handleAPIError:function(t,n){console.log(n);var r="";r=n.response?"HTTP response code "+n.response.status:n.request?"No response":n.message,this.showNotification(e.t(t)+"\n\n"+r,!0)},loadVersion:function(){var e=this;return axios.get("/api/version").then(function(t){"object"==typeof t.data&&(e.version=t.data)}).catch(e.handleAPIError.bind(e,"error.loadVersion"))},loadConnection:function(){var e=this;return axios.get("/api/connection").then(function(t){"object"==typeof t.data&&(e.connection=t.data)}).catch(e.handleAPIError.bind(e,"error.loadConnection"))},loadSystem:function(){var e=this;return axios.get("/api/system").then(function(t){"object"==typeof t.data&&(e.system=t.data)}).catch(e.handleAPIError.bind(e,"error.loadSystem"))},loadTimeTriggers:function(){var e=this;return axios.get("/api/triggers/time").then(function(t){if("object"==typeof t.data){var n={enabled:t.data.enabled||!1,transitionTime:t.data.transitionTime||0,triggers:[]};if(Array.isArray(t.data.triggers))for(var r=0;r0?0:i.time||0,relativeTime:i.triggerType>0?i.time||0:0,monday:(1&i.daysOfWeek)>0,tuesday:(2&i.daysOfWeek)>0,wednesday:(4&i.daysOfWeek)>0,thursday:(8&i.daysOfWeek)>0,friday:(16&i.daysOfWeek)>0,saturday:(32&i.daysOfWeek)>0,sunday:(64&i.daysOfWeek)>0})}e.triggers.time=n}}).catch(e.handleAPIError.bind(e,"error.loadTimeTriggers"))},loadMotionTriggers:function(){var e=this;return axios.get("/api/triggers/motion").then(function(t){"object"==typeof t.data&&(e.triggers.motion=t.data)}).catch(e.handleAPIError.bind(e,"error.loadMotionTriggers"))},loadSteps:function(){var e=this;return axios.get("/api/steps/values").then(function(t){if(Array.isArray(t.data)){for(var n=!0,r=!1,i=0,o=[],a=0;a0){var n=t.data.results[0].geometry.location;e.system.lat=n.lat,e.system.lng=n.lng}}).catch(e.handleAPIError.bind(e,"error.searchLocation")).then(function(){e.searchingLocation=!1}))},applyTimeTriggers:function(){var e=this;if(!e.saving){e.saving=!0;for(var t={enabled:e.triggers.time.enabled,transitionTime:e.triggers.time.transitionTime,triggers:[]},n=0;n0?r.relativeTime:r.fixedTime,daysOfWeek:(r.monday?1:0)|(r.tuesday?2:0)|(r.wednesday?4:0)|(r.thursday?8:0)|(r.friday?16:0)|(r.saturday?32:0)|(r.sunday?64:0)})}axios.post("/api/triggers/time",t).then(function(e){}).catch(e.handleAPIError.bind(e,"error.applyTimeTriggers")).then(function(){e.saving=!1})}},addTimeTrigger:function(){this.triggers.time.triggers.push({brightness:0,triggerType:0,enabled:!0,fixedTime:540,relativeTime:0,monday:!0,tuesday:!0,wednesday:!0,thursday:!0,friday:!0,saturday:!0,sunday:!0})},deleteTimeTrigger:function(e){this.triggers.time.triggers.splice(e,1)},applyMotionTriggers:function(){var e=this;e.saving||(e.saving=!0,axios.post("/api/triggers/motion",e.triggers.motion).then(function(e){}).catch(e.handleAPIError.bind(e,"error.applyMotionTriggers")).then(function(){e.saving=!1}))},addMotionTrigger:function(){this.triggers.motion.triggers.push({brightness:0,enabled:!0,pin:2,direction:0})},deleteMotionTrigger:function(e){this.triggers.motion.triggers.splice(e,1)},getDisplayTime:function(e,t){var n="";t&&e>=0&&(n+="+");var r=Math.floor(e/60),i=Math.abs(e)%60;return n+=r+":",i<10&&(n+="0"),n+=i}},watch:{allSteps:{handler:function(){this.stepsChanged()},sync:!0},allStepsValue:{handler:function(){this.stepsChanged()},sync:!0},steps:{handler:function(){this.stepsChanged()},deep:!0,sync:!0},activeTab:function(e){window.location.hash="#"+e}}})} \ No newline at end of file diff --git a/web/index.html b/web/index.html index f9811a8..389fcd6 100644 --- a/web/index.html +++ b/web/index.html @@ -53,18 +53,6 @@
- -
{{ Math.floor(allStepsValue / 255 * 100) }}% @@ -271,7 +259,7 @@ System tab --> -
+

{{ $t('system.firmwareTitle') }}

@@ -285,7 +273,7 @@
-
+

{{ $t('system.ntpTitle') }}

@@ -359,7 +347,6 @@