diff --git a/homeassistant/components/frontend/__init__.py b/homeassistant/components/frontend/__init__.py
index 7dbe56f1fa4a8ca4bd1095eb79dd665bc040bf30..29f6ef577e5c2b2afb0fd7332fa37b48702ee534 100644
--- a/homeassistant/components/frontend/__init__.py
+++ b/homeassistant/components/frontend/__init__.py
@@ -361,7 +361,8 @@ class IndexView(HomeAssistantView):
             core_url=core_url, ui_url=ui_url,
             compatibility_url=compatibility_url, no_auth=no_auth,
             icons_url=icons_url, icons=FINGERPRINTS['mdi.html'],
-            panel_url=panel_url, panels=hass.data[DATA_PANELS])
+            panel_url=panel_url, panels=hass.data[DATA_PANELS],
+            dev_mode=request.app[KEY_DEVELOPMENT])
 
         return web.Response(text=resp, content_type='text/html')
 
diff --git a/homeassistant/components/frontend/templates/index.html b/homeassistant/components/frontend/templates/index.html
index f385d89c9aa4779b6e8011769a9d878f6513c32b..6420bb797391b52a39f200dffeea8c6e44a71b2f 100644
--- a/homeassistant/components/frontend/templates/index.html
+++ b/homeassistant/components/frontend/templates/index.html
@@ -89,6 +89,9 @@
       }
     </script>
     <script src='{{ core_url }}'></script>
+    {% if not dev_mode %}
+    <script src='/static/custom-elements-es5-adapter.js'></script>
+    {% endif %}
     <link rel='import' href='{{ ui_url }}' onerror='initError()'>
     {% if panel_url -%}
       <link rel='import' href='{{ panel_url }}' onerror='initError()' async>
@@ -103,7 +106,7 @@
         var e = document.createElement('script');
         e.async = true;
         e.onerror = initError;
-        e.src = '/static/webcomponents-lite.min.js';
+        e.src = '/static/webcomponents-lite.js';
         document.head.appendChild(e);
       }
     </script>
diff --git a/homeassistant/components/frontend/version.py b/homeassistant/components/frontend/version.py
index f1a06e67034198a8cc80f84d22a61da25d46b8f3..52bb5d9c1b52e9f0bd0db0f5cb484250fd91bdf8 100644
--- a/homeassistant/components/frontend/version.py
+++ b/homeassistant/components/frontend/version.py
@@ -3,15 +3,15 @@
 FINGERPRINTS = {
     "compatibility.js": "1686167ff210e001f063f5c606b2e74b",
     "core.js": "2a7d01e45187c7d4635da05065b5e54e",
-    "frontend.html": "e4dcb1409ba0a62be183a7f0a057b7c0",
+    "frontend.html": "da3a65fd69361319864767a3ce0b4b9d",
     "mdi.html": "e91f61a039ed0a9936e7ee5360da3870",
     "micromarkdown-js.html": "93b5ec4016f0bba585521cf4d18dec1a",
-    "panels/ha-panel-automation.html": "88e18b827b67027641f92e5dd099ca8c",
-    "panels/ha-panel-config.html": "1ff806daf588a2836260d9f600bc7caf",
+    "panels/ha-panel-automation.html": "6c3a3345b63f3a36d32f43cff3e10c53",
+    "panels/ha-panel-config.html": "59ca4cda820260616e9de5324edf6d05",
     "panels/ha-panel-dev-event.html": "d409e7ab537d9fe629126d122345279c",
     "panels/ha-panel-dev-info.html": "b0e55eb657fd75f21aba2426ac0cedc0",
     "panels/ha-panel-dev-mqtt.html": "94b222b013a98583842de3e72d5888c6",
-    "panels/ha-panel-dev-service.html": "a260b4ef948bbac503451f139c7f9e98",
+    "panels/ha-panel-dev-service.html": "61b164e0c0964782a539cba7008bb716",
     "panels/ha-panel-dev-state.html": "7948d3dba058f31517d880df8ed0e857",
     "panels/ha-panel-dev-template.html": "f47b6910d8e4880e22cc508ca452f9b6",
     "panels/ha-panel-hassio.html": "b46e7619f3c355f872d5370741d89f6a",
@@ -19,7 +19,7 @@ FINGERPRINTS = {
     "panels/ha-panel-iframe.html": "56930204d6e067a3d600cf030f4b34c8",
     "panels/ha-panel-kiosk.html": "b40aa5cb52dd7675bea744afcf9eebf8",
     "panels/ha-panel-logbook.html": "771afdcf48dc7e308b0282417d2e02d8",
-    "panels/ha-panel-map.html": "bbf9f28f3a9058e360867b79b1309eaa",
+    "panels/ha-panel-map.html": "c2544fff3eedb487d44105cf94b335ec",
     "panels/ha-panel-shopping-list.html": "d8cfd0ecdb3aa6214c0f6908c34c7141",
     "panels/ha-panel-zwave.html": "48a71bd864f1f047ff74322be6430f00"
 }
diff --git a/homeassistant/components/frontend/www_static/custom-elements-es5-adapter.js b/homeassistant/components/frontend/www_static/custom-elements-es5-adapter.js
new file mode 100644
index 0000000000000000000000000000000000000000..4bcb525b4755cb56a78201f40961835ddd9c0395
--- /dev/null
+++ b/homeassistant/components/frontend/www_static/custom-elements-es5-adapter.js
@@ -0,0 +1,16 @@
+(function () {
+'use strict';
+
+(()=>{'use strict';if(!window.customElements)return;const a=window.HTMLElement,b=window.customElements.define,c=window.customElements.get,d=new Map,e=new Map;let f=!1,g=!1;window.HTMLElement=function(){if(!f){const a=d.get(this.constructor),b=c.call(window.customElements,a);g=!0;const e=new b;return e}f=!1;},window.HTMLElement.prototype=a.prototype;Object.defineProperty(window,'customElements',{value:window.customElements,configurable:!0,writable:!0}),Object.defineProperty(window.customElements,'define',{value:(c,h)=>{const i=h.prototype,j=class extends a{constructor(){super(),Object.setPrototypeOf(this,i),g||(f=!0,h.call(this)),g=!1;}},k=j.prototype;j.observedAttributes=h.observedAttributes,k.connectedCallback=i.connectedCallback,k.disconnectedCallback=i.disconnectedCallback,k.attributeChangedCallback=i.attributeChangedCallback,k.adoptedCallback=i.adoptedCallback,d.set(h,c),e.set(c,h),b.call(window.customElements,c,j);},configurable:!0,writable:!0}),Object.defineProperty(window.customElements,'get',{value:(a)=>e.get(a),configurable:!0,writable:!0});})();
+
+/**
+@license
+Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
+This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
+Code distributed by Google as part of the polymer project is also
+subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
+*/
+
+}());
diff --git a/homeassistant/components/frontend/www_static/custom-elements-es5-adapter.js.gz b/homeassistant/components/frontend/www_static/custom-elements-es5-adapter.js.gz
new file mode 100644
index 0000000000000000000000000000000000000000..42759b325adb4bd156681e24d05261608cc01083
Binary files /dev/null and b/homeassistant/components/frontend/www_static/custom-elements-es5-adapter.js.gz differ
diff --git a/homeassistant/components/frontend/www_static/frontend.html b/homeassistant/components/frontend/www_static/frontend.html
index 2eb05d6e132c7d277fc77e8ec1f98e3dbab64f12..3680508143846fae96512c39fe6c4a96b2adf759 100644
--- a/homeassistant/components/frontend/www_static/frontend.html
+++ b/homeassistant/components/frontend/www_static/frontend.html
@@ -1,4 +1,4 @@
-<html><head></head><body><div hidden="" by-polymer-bundler=""><script>!function(){function e(){document.body.removeAttribute("unresolved")}window.WebComponents?addEventListener("WebComponentsReady",e):"interactive"===document.readyState||"complete"===document.readyState?e():addEventListener("DOMContentLoaded",e)}(),window.Polymer={Settings:function(){var e=window.Polymer||{};if(!e.noUrlSettings)for(var t,r=location.search.slice(1).split("&"),i=0;i<r.length&&(t=r[i]);i++)(t=t.split("="))[0]&&(e[t[0]]=t[1]||!0);return e.wantShadow="shadow"===e.dom,e.hasShadow=Boolean(Element.prototype.createShadowRoot),e.nativeShadow=e.hasShadow&&!window.ShadowDOMPolyfill,e.useShadow=e.wantShadow&&e.hasShadow,e.hasNativeImports=Boolean("import"in document.createElement("link")),e.useNativeImports=e.hasNativeImports,e.useNativeCustomElements=!window.CustomElements||window.CustomElements.useNative,e.useNativeShadow=e.useShadow&&e.nativeShadow,e.usePolyfillProto=!e.useNativeCustomElements&&!Object.__proto__,e.hasNativeCSSProperties=!navigator.userAgent.match("AppleWebKit/601")&&window.CSS&&CSS.supports&&CSS.supports("box-shadow","0 0 0 var(--foo)"),e.useNativeCSSProperties=e.hasNativeCSSProperties&&e.lazyRegister&&e.useNativeCSSProperties,e.isIE=navigator.userAgent.match("Trident"),e}()},function(){var e=window.Polymer;window.Polymer=function(e){"function"==typeof e&&(e=e.prototype),e||(e={});var r=(e=t(e))===e.constructor.prototype?e.constructor:null,i={prototype:e};e.extends&&(i.extends=e.extends),Polymer.telemetry._registrate(e);var o=document.registerElement(e.is,i);return r||o};var t=function(e){var t=Polymer.Base;return e.extends&&(t=Polymer.Base._getExtendedPrototype(e.extends)),(e=Polymer.Base.chainObject(e,t)).registerCallback(),e};if(e)for(var r in e)Polymer[r]=e[r];Polymer.Class=function(e){return e.factoryImpl||(e.factoryImpl=function(){}),t(e).constructor}}(),Polymer.telemetry={registrations:[],_regLog:function(e){console.log("["+e.is+"]: registered")},_registrate:function(e){this.registrations.push(e),Polymer.log&&this._regLog(e)},dumpRegistrations:function(){this.registrations.forEach(this._regLog)}},Object.defineProperty(window,"currentImport",{enumerable:!0,configurable:!0,get:function(){return(document._currentScript||document.currentScript||{}).ownerDocument}}),Polymer.RenderStatus={_ready:!1,_callbacks:[],whenReady:function(e){this._ready?e():this._callbacks.push(e)},_makeReady:function(){var e=this;this._ready=!0;for(var t=0;t<this._callbacks.length;t++)e._callbacks[t]();this._callbacks=[]},_catchFirstRender:function(){requestAnimationFrame(function(){Polymer.RenderStatus._makeReady()})},_afterNextRenderQueue:[],_waitingNextRender:!1,afterNextRender:function(e,t,r){this._watchNextRender(),this._afterNextRenderQueue.push([e,t,r])},hasRendered:function(){return this._ready},_watchNextRender:function(){if(!this._waitingNextRender){this._waitingNextRender=!0;var e=function(){Polymer.RenderStatus._flushNextRender()};this._ready?requestAnimationFrame(e):this.whenReady(e)}},_flushNextRender:function(){var e=this;setTimeout(function(){e._flushRenderCallbacks(e._afterNextRenderQueue),e._afterNextRenderQueue=[],e._waitingNextRender=!1})},_flushRenderCallbacks:function(e){for(var t,r=0;r<e.length;r++)(t=e[r])[1].apply(t[0],t[2]||Polymer.nar)}},window.HTMLImports?HTMLImports.whenReady(function(){Polymer.RenderStatus._catchFirstRender()}):Polymer.RenderStatus._catchFirstRender(),Polymer.ImportStatus=Polymer.RenderStatus,Polymer.ImportStatus.whenLoaded=Polymer.ImportStatus.whenReady,function(){"use strict";var e=Polymer.Settings;Polymer.Base={__isPolymerInstance__:!0,_addFeature:function(e){this.mixin(this,e)},registerCallback:function(){var t=this;if("max"===e.lazyRegister)this.beforeRegister&&this.beforeRegister();else{this._desugarBehaviors();for(var r,i=0;i<this.behaviors.length;i++)(r=t.behaviors[i]).beforeRegister&&r.beforeRegister.call(t);this.beforeRegister&&this.beforeRegister()}this._registerFeatures(),e.lazyRegister||this.ensureRegisterFinished()},createdCallback:function(){if(e.disableUpgradeEnabled){if(this.hasAttribute("disable-upgrade"))return this._propertySetter=t,this._configValue=null,void(this.__data__={});this.__hasInitialized=!0}this.__initialize()},__initialize:function(){var e=this;this.__hasRegisterFinished||this._ensureRegisterFinished(this.__proto__),Polymer.telemetry.instanceCount++,this.root=this;for(var t,r=0;r<this.behaviors.length;r++)(t=e.behaviors[r]).created&&t.created.call(e);this.created&&this.created(),this._initFeatures()},ensureRegisterFinished:function(){this._ensureRegisterFinished(this)},_ensureRegisterFinished:function(t){if(t.__hasRegisterFinished!==t.is||!t.is){if("max"===e.lazyRegister){t._desugarBehaviors();for(var r,i=0;i<t.behaviors.length;i++)(r=t.behaviors[i]).beforeRegister&&r.beforeRegister.call(t)}t.__hasRegisterFinished=t.is,t._finishRegisterFeatures&&t._finishRegisterFeatures();for(var o,a=0;a<t.behaviors.length;a++)(o=t.behaviors[a]).registered&&o.registered.call(t);t.registered&&t.registered(),e.usePolyfillProto&&t!==this&&t.extend(this,t)}},attachedCallback:function(){var e=this;Polymer.RenderStatus.whenReady(function(){e.isAttached=!0;for(var t,r=0;r<e.behaviors.length;r++)(t=e.behaviors[r]).attached&&t.attached.call(e);e.attached&&e.attached()})},detachedCallback:function(){var e=this;Polymer.RenderStatus.whenReady(function(){e.isAttached=!1;for(var t,r=0;r<e.behaviors.length;r++)(t=e.behaviors[r]).detached&&t.detached.call(e);e.detached&&e.detached()})},attributeChangedCallback:function(e,t,r){var i=this;this._attributeChangedImpl(e);for(var o,a=0;a<this.behaviors.length;a++)(o=i.behaviors[a]).attributeChanged&&o.attributeChanged.call(i,e,t,r);this.attributeChanged&&this.attributeChanged(e,t,r)},_attributeChangedImpl:function(e){this._setAttributeToProperty(this,e)},extend:function(e,t){var r=this;if(e&&t)for(var i,o=Object.getOwnPropertyNames(t),a=0;a<o.length&&(i=o[a]);a++)r.copyOwnProperty(i,t,e);return e||t},mixin:function(e,t){for(var r in t)e[r]=t[r];return e},copyOwnProperty:function(e,t,r){var i=Object.getOwnPropertyDescriptor(t,e);i&&Object.defineProperty(r,e,i)},_logger:function(e,t){switch(1===t.length&&Array.isArray(t[0])&&(t=t[0]),e){case"log":case"warn":case"error":console[e].apply(console,t)}},_log:function(){var e=Array.prototype.slice.call(arguments,0);this._logger("log",e)},_warn:function(){var e=Array.prototype.slice.call(arguments,0);this._logger("warn",e)},_error:function(){var e=Array.prototype.slice.call(arguments,0);this._logger("error",e)},_logf:function(){return this._logPrefix.concat(this.is).concat(Array.prototype.slice.call(arguments,0))}},Polymer.Base._logPrefix=window.chrome&&!/edge/i.test(navigator.userAgent)||/firefox/i.test(navigator.userAgent)?["%c[%s::%s]:","font-weight: bold; background-color:#EEEE00;"]:["[%s::%s]:"],Polymer.Base.chainObject=function(e,t){return e&&t&&e!==t&&(Object.__proto__||(e=Polymer.Base.extend(Object.create(t),e)),e.__proto__=t),e},Polymer.Base=Polymer.Base.chainObject(Polymer.Base,HTMLElement.prototype),Polymer.BaseDescriptors={};var t;if(e.disableUpgradeEnabled){t=function(e,t){this.__data__[e]=t};var r=Polymer.Base.attributeChangedCallback;Polymer.Base.attributeChangedCallback=function(e,t,i){this.__hasInitialized||"disable-upgrade"!==e||(this.__hasInitialized=!0,this._propertySetter=Polymer.Bind._modelApi._propertySetter,this._configValue=Polymer.Base._configValue,this.__initialize()),r.call(this,e,t,i)}}window.CustomElements?Polymer.instanceof=CustomElements.instanceof:Polymer.instanceof=function(e,t){return e instanceof t},Polymer.isInstance=function(e){return Boolean(e&&e.__isPolymerInstance__)},Polymer.telemetry.instanceCount=0}(),function(){function e(){if(a)for(var e,t=document._currentScript||document.currentScript,r=(t&&t.ownerDocument||document).querySelectorAll("dom-module"),i=r.length-1;i>=0&&(e=r[i]);i--){if(e.__upgraded__)return;CustomElements.upgrade(e)}}var t={},r={},i=function(e){return t[e]||r[e.toLowerCase()]},o=function(){return document.createElement("dom-module")};o.prototype=Object.create(HTMLElement.prototype),Polymer.Base.mixin(o.prototype,{createdCallback:function(){this.register()},register:function(e){(e=e||this.id||this.getAttribute("name")||this.getAttribute("is"))&&(this.id=e,t[e]=this,r[e.toLowerCase()]=this)},import:function(t,r){if(t){var o=i(t);return o||(e(),o=i(t)),o&&r&&(o=o.querySelector(r)),o}}}),Object.defineProperty(o.prototype,"constructor",{value:o,configurable:!0,writable:!0});var a=window.CustomElements&&!CustomElements.useNative;document.registerElement("dom-module",o)}(),Polymer.Base._addFeature({_prepIs:function(){if(!this.is){var e=(document._currentScript||document.currentScript).parentNode;if("dom-module"===e.localName){var t=e.id||e.getAttribute("name")||e.getAttribute("is");this.is=t}}this.is&&(this.is=this.is.toLowerCase())}}),Polymer.Base._addFeature({behaviors:[],_desugarBehaviors:function(){this.behaviors.length&&(this.behaviors=this._desugarSomeBehaviors(this.behaviors))},_desugarSomeBehaviors:function(e){for(var t=this,r=[],i=(e=this._flattenBehaviorsList(e)).length-1;i>=0;i--){var o=e[i];-1===r.indexOf(o)&&(t._mixinBehavior(o),r.unshift(o))}return r},_flattenBehaviorsList:function(e){for(var t=this,r=[],i=0;i<e.length;i++){var o=e[i];o instanceof Array?r=r.concat(t._flattenBehaviorsList(o)):o?r.push(o):t._warn(t._logf("_flattenBehaviorsList","behavior is null, check for missing or 404 import"))}return r},_mixinBehavior:function(e){for(var t,r=this,i=Object.getOwnPropertyNames(e),o=e._noAccessors,a=0;a<i.length&&(t=i[a]);a++)Polymer.Base._behaviorProperties[t]||r.hasOwnProperty(t)||(o?r[t]=e[t]:r.copyOwnProperty(t,e,r))},_prepBehaviors:function(){this._prepFlattenedBehaviors(this.behaviors)},_prepFlattenedBehaviors:function(e){for(var t=this,r=0,i=e.length;r<i;r++)t._prepBehavior(e[r]);this._prepBehavior(this)},_marshalBehaviors:function(){for(var e=this,t=0;t<this.behaviors.length;t++)e._marshalBehavior(e.behaviors[t]);this._marshalBehavior(this)}}),Polymer.Base._behaviorProperties={hostAttributes:!0,beforeRegister:!0,registered:!0,properties:!0,observers:!0,listeners:!0,created:!0,attached:!0,detached:!0,attributeChanged:!0,ready:!0,_noAccessors:!0},Polymer.Base._addFeature({_getExtendedPrototype:function(e){return this._getExtendedNativePrototype(e)},_nativePrototypes:{},_getExtendedNativePrototype:function(e){var t=this._nativePrototypes[e];if(!t){t=Object.create(this.getNativePrototype(e));for(var r,i=Object.getOwnPropertyNames(Polymer.Base),o=0;o<i.length&&(r=i[o]);o++)Polymer.BaseDescriptors[r]||(t[r]=Polymer.Base[r]);Object.defineProperties(t,Polymer.BaseDescriptors),this._nativePrototypes[e]=t}return t},getNativePrototype:function(e){return Object.getPrototypeOf(document.createElement(e))}}),Polymer.Base._addFeature({_prepConstructor:function(){this._factoryArgs=this.extends?[this.extends,this.is]:[this.is];var e=function(){return this._factory(arguments)};this.hasOwnProperty("extends")&&(e.extends=this.extends),Object.defineProperty(this,"constructor",{value:e,writable:!0,configurable:!0}),e.prototype=this},_factory:function(e){var t=document.createElement.apply(document,this._factoryArgs);return this.factoryImpl&&this.factoryImpl.apply(t,e),t}}),Polymer.nob=Object.create(null),Polymer.Base._addFeature({getPropertyInfo:function(e){var t=this,r=this._getPropertyInfo(e,this.properties);if(!r)for(var i=0;i<this.behaviors.length;i++)if(r=t._getPropertyInfo(e,t.behaviors[i].properties))return r;return r||Polymer.nob},_getPropertyInfo:function(e,t){var r=t&&t[e];return"function"==typeof r&&(r=t[e]={type:r}),r&&(r.defined=!0),r},_prepPropertyInfo:function(){var e=this;this._propertyInfo={};for(var t=0;t<this.behaviors.length;t++)e._addPropertyInfo(e._propertyInfo,e.behaviors[t].properties);this._addPropertyInfo(this._propertyInfo,this.properties),this._addPropertyInfo(this._propertyInfo,this._propertyEffects)},_addPropertyInfo:function(e,t){if(t){var r,i;for(var o in t)r=e[o],i=t[o],("_"!==o[0]||i.readOnly)&&(e[o]?(r.type||(r.type=i.type),r.readOnly||(r.readOnly=i.readOnly)):e[o]={type:"function"==typeof i?i:i.type,readOnly:i.readOnly,attribute:Polymer.CaseMap.camelToDashCase(o)})}}}),function(){var e={configurable:!0,writable:!0,enumerable:!0,value:{}};Polymer.BaseDescriptors.properties=e,Object.defineProperty(Polymer.Base,"properties",e)}(),Polymer.CaseMap={_caseMap:{},_rx:{dashToCamel:/-[a-z]/g,camelToDash:/([A-Z])/g},dashToCamelCase:function(e){return this._caseMap[e]||(this._caseMap[e]=e.indexOf("-")<0?e:e.replace(this._rx.dashToCamel,function(e){return e[1].toUpperCase()}))},camelToDashCase:function(e){return this._caseMap[e]||(this._caseMap[e]=e.replace(this._rx.camelToDash,"-$1").toLowerCase())}},Polymer.Base._addFeature({_addHostAttributes:function(e){this._aggregatedAttributes||(this._aggregatedAttributes={}),e&&this.mixin(this._aggregatedAttributes,e)},_marshalHostAttributes:function(){this._aggregatedAttributes&&this._applyAttributes(this,this._aggregatedAttributes)},_applyAttributes:function(e,t){var r=this;for(var i in t)if(!r.hasAttribute(i)&&"class"!==i){var o=t[i];r.serializeValueToAttribute(o,i,r)}},_marshalAttributes:function(){this._takeAttributesToModel(this)},_takeAttributesToModel:function(e){var t=this;if(this.hasAttributes())for(var r in this._propertyInfo){var i=t._propertyInfo[r];t.hasAttribute(i.attribute)&&t._setAttributeToProperty(e,i.attribute,r,i)}},_setAttributeToProperty:function(e,t,r,i){if(!this._serializing&&(r=r||Polymer.CaseMap.dashToCamelCase(t),(i=i||this._propertyInfo&&this._propertyInfo[r])&&!i.readOnly)){var o=this.getAttribute(t);e[r]=this.deserialize(o,i.type)}},_serializing:!1,reflectPropertyToAttribute:function(e,t,r){this._serializing=!0,r=void 0===r?this[e]:r,this.serializeValueToAttribute(r,t||Polymer.CaseMap.camelToDashCase(e)),this._serializing=!1},serializeValueToAttribute:function(e,t,r){var i=this.serialize(e);r=r||this,void 0===i?r.removeAttribute(t):r.setAttribute(t,i)},deserialize:function(e,t){switch(t){case Number:e=Number(e);break;case Boolean:e=null!=e;break;case Object:try{e=JSON.parse(e)}catch(e){}break;case Array:try{e=JSON.parse(e)}catch(t){e=null,console.warn("Polymer::Attributes: couldn`t decode Array as JSON")}break;case Date:e=new Date(e);break;case String:}return e},serialize:function(e){switch(typeof e){case"boolean":return e?"":void 0;case"object":if(e instanceof Date)return e.toString();if(e)try{return JSON.stringify(e)}catch(e){return""}default:return null!=e?e:void 0}}}),Polymer.version="1.9.3",Polymer.Base._addFeature({_registerFeatures:function(){this._prepIs(),this._prepBehaviors(),this._prepConstructor(),this._prepPropertyInfo()},_prepBehavior:function(e){this._addHostAttributes(e.hostAttributes)},_marshalBehavior:function(e){},_initFeatures:function(){this._marshalHostAttributes(),this._marshalBehaviors()}});</script><script>!function(){function e(e,o){return e.replace(s,function(e,i,n,r){return i+"'"+t(n.replace(/["']/g,""),o)+"'"+r})}function t(e,t){if(e&&a.test(e))return e;var i=o(t);return i.href=e,i.href||e}function o(e){return e.body.__urlResolver||(e.body.__urlResolver=e.createElement("a"))}function i(e){return e.substring(0,e.lastIndexOf("/")+1)}var n,r,s=/(url\()([^)]*)(\))/g,d={"*":["href","src","style","url"],form:["action"]},a=/(^\/)|(^#)|(^[\w-\d]*:)/,l=/\{\{|\[\[/;Polymer.ResolveUrl={resolveCss:e,resolveAttrs:function(o,i){for(var n in d)for(var r,s,a,h=d[n],u=0,c=h.length;u<c&&(r=h[u]);u++)"*"!==n&&o.localName!==n||(a=(s=o.attributes[r])&&s.value)&&a.search(l)<0&&(s.value="style"===r?e(a,i):t(a,i))},resolveUrl:function(e,o){return n||(n=document.implementation.createHTMLDocument("temp"),r=n.createElement("base"),n.head.appendChild(r)),r.href=o,t(e,n)},pathFromUrl:i},Polymer.rootPath=Polymer.Settings.rootPath||i(document.baseURI||window.location.href)}(),Polymer.Base._addFeature({_prepTemplate:function(){var e;if(void 0===this._template&&(e=Polymer.DomModule.import(this.is),this._template=e&&e.querySelector("template")),e){var t=e.getAttribute("assetpath")||"",o=Polymer.ResolveUrl.resolveUrl(t,e.ownerDocument.baseURI);this._importPath=Polymer.ResolveUrl.pathFromUrl(o)}else this._importPath="";this._template&&this._template.hasAttribute("is")&&this._warn(this._logf("_prepTemplate","top-level Polymer template must not be a type-extension, found",this._template,"Move inside simple <template>.")),this._template&&!this._template.content&&window.HTMLTemplateElement&&HTMLTemplateElement.decorate&&HTMLTemplateElement.decorate(this._template)},_stampTemplate:function(){this._template&&(this.root=this.instanceTemplate(this._template))},instanceTemplate:function(e){return document.importNode(e._content||e.content,!0)}}),function(){var e=Polymer.Base.attachedCallback,t=Polymer.Base.detachedCallback;Polymer.Base._addFeature({_hostStack:[],ready:function(){},_registerHost:function(e){this.dataHost=e=e||Polymer.Base._hostStack[Polymer.Base._hostStack.length-1],e&&e._clients&&e._clients.push(this),this._clients=null,this._clientsReadied=!1},_beginHosting:function(){Polymer.Base._hostStack.push(this),this._clients||(this._clients=[])},_endHosting:function(){Polymer.Base._hostStack.pop()},_tryReady:function(){this._readied=!1,this._canReady()&&this._ready()},_canReady:function(){return!this.dataHost||this.dataHost._clientsReadied},_ready:function(){this._beforeClientsReady(),this._template&&(this._setupRoot(),this._readyClients()),this._clientsReadied=!0,this._clients=null,this._afterClientsReady(),this._readySelf()},_readyClients:function(){this._beginDistribute();var e=this._clients;if(e)for(var t,o=0,i=e.length;o<i&&(t=e[o]);o++)t._ready();this._finishDistribute()},_readySelf:function(){for(var e,t=this,o=0;o<this.behaviors.length;o++)(e=t.behaviors[o]).ready&&e.ready.call(t);this.ready&&this.ready(),this._readied=!0,this._attachedPending&&(this._attachedPending=!1,this.attachedCallback())},_beforeClientsReady:function(){},_afterClientsReady:function(){},_beforeAttached:function(){},attachedCallback:function(){this._readied?(this._beforeAttached(),e.call(this)):this._attachedPending=!0},detachedCallback:function(){this._readied?t.call(this):this._attachedPending=!1}})}(),Polymer.ArraySplice=function(){function e(e,t,o){return{index:e,removed:t,addedCount:o}}function t(){}return t.prototype={calcEditDistances:function(e,t,o,i,n,r){for(var s=this,d=r-n+1,a=o-t+1,l=new Array(d),h=0;h<d;h++)l[h]=new Array(a),l[h][0]=h;for(var u=0;u<a;u++)l[0][u]=u;for(h=1;h<d;h++)for(u=1;u<a;u++)if(s.equals(e[t+u-1],i[n+h-1]))l[h][u]=l[h-1][u-1];else{var c=l[h-1][u]+1,_=l[h][u-1]+1;l[h][u]=c<_?c:_}return l},spliceOperationsFromEditDistances:function(e){for(var t=e.length-1,o=e[0].length-1,i=e[t][o],n=[];t>0||o>0;)if(0!=t)if(0!=o){var r,s=e[t-1][o-1],d=e[t-1][o],a=e[t][o-1];(r=d<a?d<s?d:s:a<s?a:s)==s?(s==i?n.push(0):(n.push(1),i=s),t--,o--):r==d?(n.push(3),t--,i=d):(n.push(2),o--,i=a)}else n.push(3),t--;else n.push(2),o--;return n.reverse(),n},calcSplices:function(t,o,i,n,r,s){var d=0,a=0,l=Math.min(i-o,s-r);if(0==o&&0==r&&(d=this.sharedPrefix(t,n,l)),i==t.length&&s==n.length&&(a=this.sharedSuffix(t,n,l-d)),o+=d,r+=d,i-=a,s-=a,i-o==0&&s-r==0)return[];if(o==i){for(var h=e(o,[],0);r<s;)h.removed.push(n[r++]);return[h]}if(r==s)return[e(o,[],i-o)];var u=this.spliceOperationsFromEditDistances(this.calcEditDistances(t,o,i,n,r,s));h=void 0;for(var c=[],_=o,f=r,m=0;m<u.length;m++)switch(u[m]){case 0:h&&(c.push(h),h=void 0),_++,f++;break;case 1:h||(h=e(_,[],0)),h.addedCount++,_++,h.removed.push(n[f]),f++;break;case 2:h||(h=e(_,[],0)),h.addedCount++,_++;break;case 3:h||(h=e(_,[],0)),h.removed.push(n[f]),f++}return h&&c.push(h),c},sharedPrefix:function(e,t,o){for(var i=this,n=0;n<o;n++)if(!i.equals(e[n],t[n]))return n;return o},sharedSuffix:function(e,t,o){for(var i=e.length,n=t.length,r=0;r<o&&this.equals(e[--i],t[--n]);)r++;return r},calculateSplices:function(e,t){return this.calcSplices(e,0,e.length,t,0,t.length)},equals:function(e,t){return e===t}},new t}(),Polymer.domInnerHTML=function(){function e(e){switch(e){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";case" ":return"&nbsp;"}}function t(t){return t.replace(s,e)}function o(t){return t.replace(d,e)}function i(e){for(var t={},o=0;o<e.length;o++)t[e[o]]=!0;return t}function n(e,i,n){switch(e.nodeType){case Node.ELEMENT_NODE:for(var s,d=e.localName,h="<"+d,u=e.attributes,c=0;s=u[c];c++)h+=" "+s.name+'="'+t(s.value)+'"';return h+=">",a[d]?h:h+r(e,n)+"</"+d+">";case Node.TEXT_NODE:var _=e.data;return i&&l[i.localName]?_:o(_);case Node.COMMENT_NODE:return"\x3c!--"+e.data+"--\x3e";default:throw console.error(e),new Error("not implemented")}}function r(e,t){e instanceof HTMLTemplateElement&&(e=e.content);for(var o,i="",r=Polymer.dom(e).childNodes,s=0,d=r.length;s<d&&(o=r[s]);s++)i+=n(o,e,t);return i}var s=/[&\u00A0"]/g,d=/[&\u00A0<>]/g,a=i(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),l=i(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]);return{getInnerHTML:r}}(),function(){"use strict";var e=Element.prototype.insertBefore,t=Element.prototype.appendChild,o=Element.prototype.removeChild;Polymer.TreeApi={arrayCopyChildNodes:function(e){for(var t=[],o=0,i=e.firstChild;i;i=i.nextSibling)t[o++]=i;return t},arrayCopyChildren:function(e){for(var t=[],o=0,i=e.firstElementChild;i;i=i.nextElementSibling)t[o++]=i;return t},arrayCopy:function(e){for(var t=e.length,o=new Array(t),i=0;i<t;i++)o[i]=e[i];return o}},Polymer.TreeApi.Logical={hasParentNode:function(e){return Boolean(e.__dom&&e.__dom.parentNode)},hasChildNodes:function(e){return Boolean(e.__dom&&void 0!==e.__dom.childNodes)},getChildNodes:function(e){return this.hasChildNodes(e)?this._getChildNodes(e):e.childNodes},_getChildNodes:function(e){if(!e.__dom.childNodes){e.__dom.childNodes=[];for(var t=e.__dom.firstChild;t;t=t.__dom.nextSibling)e.__dom.childNodes.push(t)}return e.__dom.childNodes},getParentNode:function(e){return e.__dom&&void 0!==e.__dom.parentNode?e.__dom.parentNode:e.parentNode},getFirstChild:function(e){return e.__dom&&void 0!==e.__dom.firstChild?e.__dom.firstChild:e.firstChild},getLastChild:function(e){return e.__dom&&void 0!==e.__dom.lastChild?e.__dom.lastChild:e.lastChild},getNextSibling:function(e){return e.__dom&&void 0!==e.__dom.nextSibling?e.__dom.nextSibling:e.nextSibling},getPreviousSibling:function(e){return e.__dom&&void 0!==e.__dom.previousSibling?e.__dom.previousSibling:e.previousSibling},getFirstElementChild:function(e){return e.__dom&&void 0!==e.__dom.firstChild?this._getFirstElementChild(e):e.firstElementChild},_getFirstElementChild:function(e){for(var t=e.__dom.firstChild;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.__dom.nextSibling;return t},getLastElementChild:function(e){return e.__dom&&void 0!==e.__dom.lastChild?this._getLastElementChild(e):e.lastElementChild},_getLastElementChild:function(e){for(var t=e.__dom.lastChild;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.__dom.previousSibling;return t},getNextElementSibling:function(e){return e.__dom&&void 0!==e.__dom.nextSibling?this._getNextElementSibling(e):e.nextElementSibling},_getNextElementSibling:function(e){for(var t=e.__dom.nextSibling;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.__dom.nextSibling;return t},getPreviousElementSibling:function(e){return e.__dom&&void 0!==e.__dom.previousSibling?this._getPreviousElementSibling(e):e.previousElementSibling},_getPreviousElementSibling:function(e){for(var t=e.__dom.previousSibling;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.__dom.previousSibling;return t},saveChildNodes:function(e){if(!this.hasChildNodes(e)){e.__dom=e.__dom||{},e.__dom.firstChild=e.firstChild,e.__dom.lastChild=e.lastChild,e.__dom.childNodes=[];for(var t=e.firstChild;t;t=t.nextSibling)t.__dom=t.__dom||{},t.__dom.parentNode=e,e.__dom.childNodes.push(t),t.__dom.nextSibling=t.nextSibling,t.__dom.previousSibling=t.previousSibling}},recordInsertBefore:function(e,t,o){var i=this;if(t.__dom.childNodes=null,e.nodeType===Node.DOCUMENT_FRAGMENT_NODE)for(var n=e.firstChild;n;n=n.nextSibling)i._linkNode(n,t,o);else this._linkNode(e,t,o)},_linkNode:function(e,t,o){e.__dom=e.__dom||{},t.__dom=t.__dom||{},o&&(o.__dom=o.__dom||{}),e.__dom.previousSibling=o?o.__dom.previousSibling:t.__dom.lastChild,e.__dom.previousSibling&&(e.__dom.previousSibling.__dom.nextSibling=e),e.__dom.nextSibling=o||null,e.__dom.nextSibling&&(e.__dom.nextSibling.__dom.previousSibling=e),e.__dom.parentNode=t,o?o===t.__dom.firstChild&&(t.__dom.firstChild=e):(t.__dom.lastChild=e,t.__dom.firstChild||(t.__dom.firstChild=e)),t.__dom.childNodes=null},recordRemoveChild:function(e,t){e.__dom=e.__dom||{},t.__dom=t.__dom||{},e===t.__dom.firstChild&&(t.__dom.firstChild=e.__dom.nextSibling),e===t.__dom.lastChild&&(t.__dom.lastChild=e.__dom.previousSibling);var o=e.__dom.previousSibling,i=e.__dom.nextSibling;o&&(o.__dom.nextSibling=i),i&&(i.__dom.previousSibling=o),e.__dom.parentNode=e.__dom.previousSibling=e.__dom.nextSibling=void 0,t.__dom.childNodes=null}},Polymer.TreeApi.Composed={getChildNodes:function(e){return Polymer.TreeApi.arrayCopyChildNodes(e)},getParentNode:function(e){return e.parentNode},clearChildNodes:function(e){e.textContent=""},insertBefore:function(t,o,i){return e.call(t,o,i||null)},appendChild:function(e,o){return t.call(e,o)},removeChild:function(e,t){return o.call(e,t)}}}(),Polymer.DomApi=function(){"use strict";var e=Polymer.Settings,t=Polymer.TreeApi,o=function(e){this.node=i?o.wrap(e):e},i=e.hasShadow&&!e.nativeShadow;o.wrap=window.wrap?window.wrap:function(e){return e},o.prototype={flush:function(){Polymer.dom.flush()},deepContains:function(e){if(this.node.contains(e))return!0;for(var t=e,o=e.ownerDocument;t&&t!==o&&t!==this.node;)t=Polymer.dom(t).parentNode||t.host;return t===this.node},queryDistributedElements:function(e){for(var t,i=this.getEffectiveChildNodes(),n=[],r=0,s=i.length;r<s&&(t=i[r]);r++)t.nodeType===Node.ELEMENT_NODE&&o.matchesSelector.call(t,e)&&n.push(t);return n},getEffectiveChildNodes:function(){for(var e,t=[],o=this.childNodes,i=0,s=o.length;i<s&&(e=o[i]);i++)if(e.localName===n)for(var d=r(e).getDistributedNodes(),a=0;a<d.length;a++)t.push(d[a]);else t.push(e);return t},observeNodes:function(e){if(e)return this.observer||(this.observer=this.node.localName===n?new o.DistributedNodesObserver(this):new o.EffectiveNodesObserver(this)),this.observer.addListener(e)},unobserveNodes:function(e){this.observer&&this.observer.removeListener(e)},notifyObserver:function(){this.observer&&this.observer.notify()},_query:function(e,o,i){o=o||this.node;var n=[];return this._queryElements(t.Logical.getChildNodes(o),e,i,n),n},_queryElements:function(e,t,o,i){for(var n,r=this,s=0,d=e.length;s<d&&(n=e[s]);s++)if(n.nodeType===Node.ELEMENT_NODE&&r._queryElement(n,t,o,i))return!0},_queryElement:function(e,o,i,n){var r=o(e);if(r&&n.push(e),i&&i(r))return r;this._queryElements(t.Logical.getChildNodes(e),o,i,n)}};var n=o.CONTENT="content",r=o.factory=function(e){return(e=e||document).__domApi||(e.__domApi=new o.ctor(e)),e.__domApi};o.hasApi=function(e){return Boolean(e.__domApi)},o.ctor=o,Polymer.dom=function(e,t){return e instanceof Event?Polymer.EventApi.factory(e):o.factory(e,t)};var s=Element.prototype;return o.matchesSelector=s.matches||s.matchesSelector||s.mozMatchesSelector||s.msMatchesSelector||s.oMatchesSelector||s.webkitMatchesSelector,o}(),function(){"use strict";var e=Polymer.Settings,t=Polymer.DomApi,o=t.factory,i=Polymer.TreeApi,n=Polymer.domInnerHTML.getInnerHTML,r=t.CONTENT;if(!e.useShadow){var s=Element.prototype.cloneNode,d=Document.prototype.importNode;Polymer.Base.mixin(t.prototype,{_lazyDistribute:function(e){e.shadyRoot&&e.shadyRoot._distributionClean&&(e.shadyRoot._distributionClean=!1,Polymer.dom.addDebouncer(e.debounce("_distribute",e._distributeContent)))},appendChild:function(e){return this.insertBefore(e)},insertBefore:function(e,n){if(n&&i.Logical.getParentNode(n)!==this.node)throw Error("The ref_node to be inserted before is not a child of this node");if(e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){var s=i.Logical.getParentNode(e);s?(t.hasApi(s)&&o(s).notifyObserver(),this._removeNode(e)):this._removeOwnerShadyRoot(e)}if(!this._addNode(e,n)){n&&(n=n.localName===r?this._firstComposedNode(n):n);var d=this.node._isShadyRoot?this.node.host:this.node;n?i.Composed.insertBefore(d,e,n):i.Composed.appendChild(d,e)}return this.notifyObserver(),e},_addNode:function(e,t){var o=this.getOwnerRoot();if(o){var n=this._maybeAddInsertionPoint(e,this.node);o._invalidInsertionPoints||(o._invalidInsertionPoints=n),this._addNodeToHost(o.host,e)}i.Logical.hasChildNodes(this.node)&&i.Logical.recordInsertBefore(e,this.node,t);var r=this._maybeDistribute(e)||this.node.shadyRoot;if(r)if(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE)for(;e.firstChild;)i.Composed.removeChild(e,e.firstChild);else{var s=i.Composed.getParentNode(e);s&&i.Composed.removeChild(s,e)}return r},removeChild:function(e){if(i.Logical.getParentNode(e)!==this.node)throw Error("The node to be removed is not a child of this node: "+e);if(!this._removeNode(e)){var t=this.node._isShadyRoot?this.node.host:this.node;t===i.Composed.getParentNode(e)&&i.Composed.removeChild(t,e)}return this.notifyObserver(),e},_removeNode:function(e){var t,n=i.Logical.hasParentNode(e)&&i.Logical.getParentNode(e),r=this._ownerShadyRootForNode(e);return n&&(t=o(e)._maybeDistributeParent(),i.Logical.recordRemoveChild(e,n),r&&this._removeDistributedChildren(r,e)&&(r._invalidInsertionPoints=!0,this._lazyDistribute(r.host))),this._removeOwnerShadyRoot(e),r&&this._removeNodeFromHost(r.host,e),t},replaceChild:function(e,t){return this.insertBefore(e,t),this.removeChild(t),e},_hasCachedOwnerRoot:function(e){return Boolean(void 0!==e._ownerShadyRoot)},getOwnerRoot:function(){return this._ownerShadyRootForNode(this.node)},_ownerShadyRootForNode:function(e){if(e){var t=e._ownerShadyRoot;if(void 0===t){if(e._isShadyRoot)t=e;else{var o=i.Logical.getParentNode(e);t=o?o._isShadyRoot?o:this._ownerShadyRootForNode(o):null}(t||document.documentElement.contains(e))&&(e._ownerShadyRoot=t)}return t}},_maybeDistribute:function(e){var t=e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&!e.__noContent&&o(e).querySelector(r),n=t&&i.Logical.getParentNode(t).nodeType!==Node.DOCUMENT_FRAGMENT_NODE,s=t||e.localName===r;if(s){var d=this.getOwnerRoot();d&&this._lazyDistribute(d.host)}var a=this._nodeNeedsDistribution(this.node);return a&&this._lazyDistribute(this.node),a||s&&!n},_maybeAddInsertionPoint:function(e,t){var n,s=this;if(e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE||e.__noContent)e.localName===r&&(i.Logical.saveChildNodes(t),i.Logical.saveChildNodes(e),n=!0);else for(var d,a,l,h=o(e).querySelectorAll(r),u=0;u<h.length&&(d=h[u]);u++)(a=i.Logical.getParentNode(d))===e&&(a=t),l=s._maybeAddInsertionPoint(d,a),n=n||l;return n},_updateInsertionPoints:function(e){for(var t,n=e.shadyRoot._insertionPoints=o(e.shadyRoot).querySelectorAll(r),s=0;s<n.length;s++)t=n[s],i.Logical.saveChildNodes(t),i.Logical.saveChildNodes(i.Logical.getParentNode(t))},_nodeNeedsDistribution:function(e){return e&&e.shadyRoot&&t.hasInsertionPoint(e.shadyRoot)},_addNodeToHost:function(e,t){e._elementAdd&&e._elementAdd(t)},_removeNodeFromHost:function(e,t){e._elementRemove&&e._elementRemove(t)},_removeDistributedChildren:function(e,t){for(var n,r=this,s=e._insertionPoints,d=0;d<s.length;d++){var a=s[d];if(r._contains(t,a))for(var l=o(a).getDistributedNodes(),h=0;h<l.length;h++){n=!0;var u=l[h],c=i.Composed.getParentNode(u);c&&i.Composed.removeChild(c,u)}}return n},_contains:function(e,t){for(;t;){if(t==e)return!0;t=i.Logical.getParentNode(t)}},_removeOwnerShadyRoot:function(e){var t=this;if(this._hasCachedOwnerRoot(e))for(var o,n=i.Logical.getChildNodes(e),r=0,s=n.length;r<s&&(o=n[r]);r++)t._removeOwnerShadyRoot(o);e._ownerShadyRoot=void 0},_firstComposedNode:function(e){for(var t,i,n=o(e).getDistributedNodes(),r=0,s=n.length;r<s&&(t=n[r]);r++)if((i=o(t).getDestinationInsertionPoints())[i.length-1]===e)return t},querySelector:function(e){return this._query(function(o){return t.matchesSelector.call(o,e)},this.node,function(e){return Boolean(e)})[0]||null},querySelectorAll:function(e){return this._query(function(o){return t.matchesSelector.call(o,e)},this.node)},getDestinationInsertionPoints:function(){return this.node._destinationInsertionPoints||[]},getDistributedNodes:function(){return this.node._distributedNodes||[]},_clear:function(){for(var e=this;this.childNodes.length;)e.removeChild(e.childNodes[0])},setAttribute:function(e,t){this.node.setAttribute(e,t),this._maybeDistributeParent()},removeAttribute:function(e){this.node.removeAttribute(e),this._maybeDistributeParent()},_maybeDistributeParent:function(){if(this._nodeNeedsDistribution(this.parentNode))return this._lazyDistribute(this.parentNode),!0},cloneNode:function(e){var t=s.call(this.node,!1);if(e)for(var i,n=this.childNodes,r=o(t),d=0;d<n.length;d++)i=o(n[d]).cloneNode(!0),r.appendChild(i);return t},importNode:function(e,t){var n=this.node instanceof Document?this.node:this.node.ownerDocument,r=d.call(n,e,!1);if(t)for(var s,a=i.Logical.getChildNodes(e),l=o(r),h=0;h<a.length;h++)s=o(n).importNode(a[h],!0),l.appendChild(s);return r},_getComposedInnerHTML:function(){return n(this.node,!0)}}),Object.defineProperties(t.prototype,{activeElement:{get:function(){var e=document.activeElement;if(!e)return null;var t=!!this.node._isShadyRoot;if(this.node!==document){if(!t)return null;if(this.node.host===e||!this.node.host.contains(e))return null}for(var i=o(e).getOwnerRoot();i&&i!==this.node;)e=i.host,i=o(e).getOwnerRoot();return this.node===document?i?null:e:i===this.node?e:null},configurable:!0},childNodes:{get:function(){var e=i.Logical.getChildNodes(this.node);return Array.isArray(e)?e:i.arrayCopyChildNodes(this.node)},configurable:!0},children:{get:function(){return i.Logical.hasChildNodes(this.node)?Array.prototype.filter.call(this.childNodes,function(e){return e.nodeType===Node.ELEMENT_NODE}):i.arrayCopyChildren(this.node)},configurable:!0},parentNode:{get:function(){return i.Logical.getParentNode(this.node)},configurable:!0},firstChild:{get:function(){return i.Logical.getFirstChild(this.node)},configurable:!0},lastChild:{get:function(){return i.Logical.getLastChild(this.node)},configurable:!0},nextSibling:{get:function(){return i.Logical.getNextSibling(this.node)},configurable:!0},previousSibling:{get:function(){return i.Logical.getPreviousSibling(this.node)},configurable:!0},firstElementChild:{get:function(){return i.Logical.getFirstElementChild(this.node)},configurable:!0},lastElementChild:{get:function(){return i.Logical.getLastElementChild(this.node)},configurable:!0},nextElementSibling:{get:function(){return i.Logical.getNextElementSibling(this.node)},configurable:!0},previousElementSibling:{get:function(){return i.Logical.getPreviousElementSibling(this.node)},configurable:!0},textContent:{get:function(){var e=this.node.nodeType;if(e===Node.TEXT_NODE||e===Node.COMMENT_NODE)return this.node.textContent;for(var t,o=[],i=0,n=this.childNodes;t=n[i];i++)t.nodeType!==Node.COMMENT_NODE&&o.push(t.textContent);return o.join("")},set:function(e){var t=this.node.nodeType;t===Node.TEXT_NODE||t===Node.COMMENT_NODE?this.node.textContent=e:(this._clear(),e&&this.appendChild(document.createTextNode(e)))},configurable:!0},innerHTML:{get:function(){var e=this.node.nodeType;return e===Node.TEXT_NODE||e===Node.COMMENT_NODE?null:n(this.node)},set:function(e){var t=this,o=this.node.nodeType;if(o!==Node.TEXT_NODE||o!==Node.COMMENT_NODE){this._clear();var n=document.createElement("div");n.innerHTML=e;for(var r=i.arrayCopyChildNodes(n),s=0;s<r.length;s++)t.appendChild(r[s])}},configurable:!0}}),t.hasInsertionPoint=function(e){return Boolean(e&&e._insertionPoints.length)}}}(),function(){"use strict";var e=Polymer.Settings,t=Polymer.TreeApi,o=Polymer.DomApi;if(e.useShadow){Polymer.Base.mixin(o.prototype,{querySelectorAll:function(e){return t.arrayCopy(this.node.querySelectorAll(e))},getOwnerRoot:function(){for(var e=this.node;e;){if(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host)return e;e=e.parentNode}},importNode:function(e,t){return(this.node instanceof Document?this.node:this.node.ownerDocument).importNode(e,t)},getDestinationInsertionPoints:function(){var e=this.node.getDestinationInsertionPoints&&this.node.getDestinationInsertionPoints();return e?t.arrayCopy(e):[]},getDistributedNodes:function(){var e=this.node.getDistributedNodes&&this.node.getDistributedNodes();return e?t.arrayCopy(e):[]}}),Object.defineProperties(o.prototype,{activeElement:{get:function(){var e=o.wrap(this.node),t=e.activeElement;return e.contains(t)?t:null},configurable:!0},childNodes:{get:function(){return t.arrayCopyChildNodes(this.node)},configurable:!0},children:{get:function(){return t.arrayCopyChildren(this.node)},configurable:!0},textContent:{get:function(){return this.node.textContent},set:function(e){return this.node.textContent=e},configurable:!0},innerHTML:{get:function(){return this.node.innerHTML},set:function(e){return this.node.innerHTML=e},configurable:!0}});var i=function(e){o.prototype[e]=function(){return this.node[e].apply(this.node,arguments)}};!function(e){for(var t=0;t<e.length;t++)i(e[t])}(["cloneNode","appendChild","insertBefore","removeChild","replaceChild","setAttribute","removeAttribute","querySelector"]);var n=function(e){Object.defineProperty(o.prototype,e,{get:function(){return this.node[e]},configurable:!0})};!function(e){for(var t=0;t<e.length;t++)n(e[t])}(["parentNode","firstChild","lastChild","nextSibling","previousSibling","firstElementChild","lastElementChild","nextElementSibling","previousElementSibling"])}}(),Polymer.Base.mixin(Polymer.dom,{_flushGuard:0,_FLUSH_MAX:100,_needsTakeRecords:!Polymer.Settings.useNativeCustomElements,_debouncers:[],_staticFlushList:[],_finishDebouncer:null,flush:function(){var e=this;for(this._flushGuard=0,this._prepareFlush();this._debouncers.length&&this._flushGuard<this._FLUSH_MAX;){for(;this._debouncers.length;)e._debouncers.shift().complete();e._finishDebouncer&&e._finishDebouncer.complete(),e._prepareFlush(),e._flushGuard++}this._flushGuard>=this._FLUSH_MAX&&console.warn("Polymer.dom.flush aborted. Flush may not be complete.")},_prepareFlush:function(){var e=this;this._needsTakeRecords&&CustomElements.takeRecords();for(var t=0;t<this._staticFlushList.length;t++)e._staticFlushList[t]()},addStaticFlush:function(e){this._staticFlushList.push(e)},removeStaticFlush:function(e){var t=this._staticFlushList.indexOf(e);t>=0&&this._staticFlushList.splice(t,1)},addDebouncer:function(e){this._debouncers.push(e),this._finishDebouncer=Polymer.Debounce(this._finishDebouncer,this._finishFlush)},_finishFlush:function(){Polymer.dom._debouncers=[]}}),Polymer.EventApi=function(){"use strict";var e=Polymer.DomApi.ctor,t=Polymer.Settings;e.Event=function(e){this.event=e},t.useShadow?e.Event.prototype={get rootTarget(){return this.event.path[0]},get localTarget(){return this.event.target},get path(){var e=this.event.path;return Array.isArray(e)||(e=Array.prototype.slice.call(e)),e}}:e.Event.prototype={get rootTarget(){return this.event.target},get localTarget(){for(var e=this.event.currentTarget,t=e&&Polymer.dom(e).getOwnerRoot(),o=this.path,i=0;i<o.length;i++)if(Polymer.dom(o[i]).getOwnerRoot()===t)return o[i]},get path(){if(!this.event._path){for(var e=[],t=this.rootTarget;t;){e.push(t);var o=Polymer.dom(t).getDestinationInsertionPoints();if(o.length){for(var i=0;i<o.length-1;i++)e.push(o[i]);t=o[o.length-1]}else t=Polymer.dom(t).parentNode||t.host}e.push(window),this.event._path=e}return this.event._path}};return{factory:function(t){return t.__eventApi||(t.__eventApi=new e.Event(t)),t.__eventApi}}}(),function(){"use strict";var e=Polymer.DomApi.ctor,t=Polymer.Settings.useShadow;Object.defineProperty(e.prototype,"classList",{get:function(){return this._classList||(this._classList=new e.ClassList(this)),this._classList},configurable:!0}),e.ClassList=function(e){this.domApi=e,this.node=e.node},e.ClassList.prototype={add:function(){this.node.classList.add.apply(this.node.classList,arguments),this._distributeParent()},remove:function(){this.node.classList.remove.apply(this.node.classList,arguments),this._distributeParent()},toggle:function(){this.node.classList.toggle.apply(this.node.classList,arguments),this._distributeParent()},_distributeParent:function(){t||this.domApi._maybeDistributeParent()},contains:function(){return this.node.classList.contains.apply(this.node.classList,arguments)}}}(),function(){"use strict";var e=Polymer.DomApi.ctor,t=Polymer.Settings;if(e.EffectiveNodesObserver=function(e){this.domApi=e,this.node=this.domApi.node,this._listeners=[]},e.EffectiveNodesObserver.prototype={addListener:function(e){this._isSetup||(this._setup(),this._isSetup=!0);var t={fn:e,_nodes:[]};return this._listeners.push(t),this._scheduleNotify(),t},removeListener:function(e){var t=this._listeners.indexOf(e);t>=0&&(this._listeners.splice(t,1),e._nodes=[]),this._hasListeners()||(this._cleanup(),this._isSetup=!1)},_setup:function(){this._observeContentElements(this.domApi.childNodes)},_cleanup:function(){this._unobserveContentElements(this.domApi.childNodes)},_hasListeners:function(){return Boolean(this._listeners.length)},_scheduleNotify:function(){this._debouncer&&this._debouncer.stop(),this._debouncer=Polymer.Debounce(this._debouncer,this._notify),this._debouncer.context=this,Polymer.dom.addDebouncer(this._debouncer)},notify:function(){this._hasListeners()&&this._scheduleNotify()},_notify:function(){this._beforeCallListeners(),this._callListeners()},_beforeCallListeners:function(){this._updateContentElements()},_updateContentElements:function(){this._observeContentElements(this.domApi.childNodes)},_observeContentElements:function(e){for(var t,o=this,i=0;i<e.length&&(t=e[i]);i++)o._isContent(t)&&(t.__observeNodesMap=t.__observeNodesMap||new WeakMap,t.__observeNodesMap.has(o)||t.__observeNodesMap.set(o,o._observeContent(t)))},_observeContent:function(e){var t=this,o=Polymer.dom(e).observeNodes(function(){t._scheduleNotify()});return o._avoidChangeCalculation=!0,o},_unobserveContentElements:function(e){for(var t,o,i=this,n=0;n<e.length&&(t=e[n]);n++)i._isContent(t)&&(o=t.__observeNodesMap.get(i))&&(Polymer.dom(t).unobserveNodes(o),t.__observeNodesMap.delete(i))},_isContent:function(e){return"content"===e.localName},_callListeners:function(){for(var e,t=this,o=this._listeners,i=this._getEffectiveNodes(),n=0;n<o.length&&(e=o[n]);n++){var r=t._generateListenerInfo(e,i);(r||e._alwaysNotify)&&t._callListener(e,r)}},_getEffectiveNodes:function(){return this.domApi.getEffectiveChildNodes()},_generateListenerInfo:function(e,t){if(e._avoidChangeCalculation)return!0;for(var o,i=e._nodes,n={target:this.node,addedNodes:[],removedNodes:[]},r=Polymer.ArraySplice.calculateSplices(t,i),s=0;s<r.length&&(o=r[s]);s++)for(var d,a=0;a<o.removed.length&&(d=o.removed[a]);a++)n.removedNodes.push(d);for(s=0,o;s<r.length&&(o=r[s]);s++)for(a=o.index;a<o.index+o.addedCount;a++)n.addedNodes.push(t[a]);return e._nodes=t,n.addedNodes.length||n.removedNodes.length?n:void 0},_callListener:function(e,t){return e.fn.call(this.node,t)},enableShadowAttributeTracking:function(){}},t.useShadow){var o=e.EffectiveNodesObserver.prototype._setup,i=e.EffectiveNodesObserver.prototype._cleanup;Polymer.Base.mixin(e.EffectiveNodesObserver.prototype,{_setup:function(){if(!this._observer){var e=this;this._mutationHandler=function(t){t&&t.length&&e._scheduleNotify()},this._observer=new MutationObserver(this._mutationHandler),this._boundFlush=function(){e._flush()},Polymer.dom.addStaticFlush(this._boundFlush),this._observer.observe(this.node,{childList:!0})}o.call(this)},_cleanup:function(){this._observer.disconnect(),this._observer=null,this._mutationHandler=null,Polymer.dom.removeStaticFlush(this._boundFlush),i.call(this)},_flush:function(){this._observer&&this._mutationHandler(this._observer.takeRecords())},enableShadowAttributeTracking:function(){if(this._observer){this._makeContentListenersAlwaysNotify(),this._observer.disconnect(),this._observer.observe(this.node,{childList:!0,attributes:!0,subtree:!0});var e=this.domApi.getOwnerRoot(),t=e&&e.host;t&&Polymer.dom(t).observer&&Polymer.dom(t).observer.enableShadowAttributeTracking()}},_makeContentListenersAlwaysNotify:function(){for(var e,t=this,o=0;o<this._listeners.length;o++)(e=t._listeners[o])._alwaysNotify=e._isContentListener}})}}(),function(){"use strict";var e=Polymer.DomApi.ctor,t=Polymer.Settings;e.DistributedNodesObserver=function(t){e.EffectiveNodesObserver.call(this,t)},e.DistributedNodesObserver.prototype=Object.create(e.EffectiveNodesObserver.prototype),Polymer.Base.mixin(e.DistributedNodesObserver.prototype,{_setup:function(){},_cleanup:function(){},_beforeCallListeners:function(){},_getEffectiveNodes:function(){return this.domApi.getDistributedNodes()}}),t.useShadow&&Polymer.Base.mixin(e.DistributedNodesObserver.prototype,{_setup:function(){if(!this._observer){var e=this.domApi.getOwnerRoot(),t=e&&e.host;if(t){var o=this;this._observer=Polymer.dom(t).observeNodes(function(){o._scheduleNotify()}),this._observer._isContentListener=!0,this._hasAttrSelect()&&Polymer.dom(t).observer.enableShadowAttributeTracking()}}},_hasAttrSelect:function(){var e=this.node.getAttribute("select");return e&&e.match(/[[.]+/)},_cleanup:function(){var e=this.domApi.getOwnerRoot(),t=e&&e.host;t&&Polymer.dom(t).unobserveNodes(this._observer),this._observer=null}})}(),function(){function e(e,t){t._distributedNodes.push(e);var o=e._destinationInsertionPoints;o?o.push(t):e._destinationInsertionPoints=[t]}function t(e){var t=e._distributedNodes;if(t)for(var o=0;o<t.length;o++){var i=t[o]._destinationInsertionPoints;i&&i.splice(i.indexOf(e)+1,i.length)}}function o(e,t){var o=u.Logical.getParentNode(e);o&&o.shadyRoot&&h.hasInsertionPoint(o.shadyRoot)&&o.shadyRoot._distributionClean&&(o.shadyRoot._distributionClean=!1,t.shadyRoot._dirtyRoots.push(o))}function i(e,t){var o=t._destinationInsertionPoints;return o&&o[o.length-1]===e}function n(e){return"content"==e.localName}function r(e){for(;e&&s(e);)e=e.domHost;return e}function s(e){for(var t,o=u.Logical.getChildNodes(e),i=0;i<o.length;i++)if((t=o[i]).localName&&"content"===t.localName)return e.domHost}function d(e){for(var t,o=0;o<e._insertionPoints.length;o++)t=e._insertionPoints[o],h.hasApi(t)&&Polymer.dom(t).notifyObserver()}function a(e){h.hasApi(e)&&Polymer.dom(e).notifyObserver()}function l(e){if(_&&e)for(var t=0;t<e.length;t++)CustomElements.upgrade(e[t])}var h=Polymer.DomApi,u=Polymer.TreeApi;Polymer.Base._addFeature({_prepShady:function(){this._useContent=this._useContent||Boolean(this._template)},_setupShady:function(){this.shadyRoot=null,this.__domApi||(this.__domApi=null),this.__dom||(this.__dom=null),this._ownerShadyRoot||(this._ownerShadyRoot=void 0)},_poolContent:function(){this._useContent&&u.Logical.saveChildNodes(this)},_setupRoot:function(){this._useContent&&(this._createLocalRoot(),this.dataHost||l(u.Logical.getChildNodes(this)))},_createLocalRoot:function(){this.shadyRoot=this.root,this.shadyRoot._distributionClean=!1,this.shadyRoot._hasDistributed=!1,this.shadyRoot._isShadyRoot=!0,this.shadyRoot._dirtyRoots=[];var e=this.shadyRoot._insertionPoints=!this._notes||this._notes._hasContent?this.shadyRoot.querySelectorAll("content"):[];u.Logical.saveChildNodes(this.shadyRoot);for(var t,o=0;o<e.length;o++)t=e[o],u.Logical.saveChildNodes(t),u.Logical.saveChildNodes(t.parentNode);this.shadyRoot.host=this},distributeContent:function(e){if(this.shadyRoot){this.shadyRoot._invalidInsertionPoints=this.shadyRoot._invalidInsertionPoints||e;var t=r(this);Polymer.dom(this)._lazyDistribute(t)}},_distributeContent:function(){this._useContent&&!this.shadyRoot._distributionClean&&(this.shadyRoot._invalidInsertionPoints&&(Polymer.dom(this)._updateInsertionPoints(this),this.shadyRoot._invalidInsertionPoints=!1),this._beginDistribute(),this._distributeDirtyRoots(),this._finishDistribute())},_beginDistribute:function(){this._useContent&&h.hasInsertionPoint(this.shadyRoot)&&(this._resetDistribution(),this._distributePool(this.shadyRoot,this._collectPool()))},_distributeDirtyRoots:function(){for(var e,t=this.shadyRoot._dirtyRoots,o=0,i=t.length;o<i&&(e=t[o]);o++)e._distributeContent();this.shadyRoot._dirtyRoots=[]},_finishDistribute:function(){if(this._useContent){if(this.shadyRoot._distributionClean=!0,h.hasInsertionPoint(this.shadyRoot))this._composeTree(),d(this.shadyRoot);else if(this.shadyRoot._hasDistributed){var e=this._composeNode(this);this._updateChildNodes(this,e)}else u.Composed.clearChildNodes(this),this.appendChild(this.shadyRoot);this.shadyRoot._hasDistributed||a(this),this.shadyRoot._hasDistributed=!0}},elementMatches:function(e,t){return t=t||this,h.matchesSelector.call(t,e)},_resetDistribution:function(){for(var e=u.Logical.getChildNodes(this),o=0;o<e.length;o++){var i=e[o];i._destinationInsertionPoints&&(i._destinationInsertionPoints=void 0),n(i)&&t(i)}for(var r=this.shadyRoot._insertionPoints,s=0;s<r.length;s++)r[s]._distributedNodes=[]},_collectPool:function(){for(var e=[],t=u.Logical.getChildNodes(this),o=0;o<t.length;o++){var i=t[o];n(i)?e.push.apply(e,i._distributedNodes):e.push(i)}return e},_distributePool:function(e,t){for(var i,n=this,r=e._insertionPoints,s=0,d=r.length;s<d&&(i=r[s]);s++)n._distributeInsertionPoint(i,t),o(i,n)},_distributeInsertionPoint:function(t,o){for(var i,n=this,r=!1,s=0,d=o.length;s<d;s++)(i=o[s])&&n._matchesContentSelect(i,t)&&(e(i,t),o[s]=void 0,r=!0);if(!r)for(var a=u.Logical.getChildNodes(t),l=0;l<a.length;l++)e(a[l],t)},_composeTree:function(){var e=this;this._updateChildNodes(this,this._composeNode(this));for(var t,o,i=this.shadyRoot._insertionPoints,n=0,r=i.length;n<r&&(t=i[n]);n++)(o=u.Logical.getParentNode(t))._useContent||o===e||o===e.shadyRoot||e._updateChildNodes(o,e._composeNode(o))},_composeNode:function(e){for(var t=[],o=u.Logical.getChildNodes(e.shadyRoot||e),r=0;r<o.length;r++){var s=o[r];if(n(s))for(var d=s._distributedNodes,a=0;a<d.length;a++){var l=d[a];i(s,l)&&t.push(l)}else t.push(s)}return t},_updateChildNodes:function(e,t){for(var o=u.Composed.getChildNodes(e),i=Polymer.ArraySplice.calculateSplices(t,o),n=0,r=0;n<i.length&&(a=i[n]);n++){for(var s,d=0;d<a.removed.length&&(s=a.removed[d]);d++)u.Composed.getParentNode(s)===e&&u.Composed.removeChild(e,s),o.splice(a.index+r,1);r-=a.addedCount}for(var a,l,n=0;n<i.length&&(a=i[n]);n++)for(l=o[a.index],d=a.index,s;d<a.index+a.addedCount;d++)s=t[d],u.Composed.insertBefore(e,s,l),o.splice(d,0,s)},_matchesContentSelect:function(e,t){var o=t.getAttribute("select");return!o||(!(o=o.trim())||e instanceof Element&&(!!/^(:not\()?[*.#[a-zA-Z_|]/.test(o)&&this.elementMatches(o,e)))},_elementAdd:function(){},_elementRemove:function(){}});var c={get:function(){var e=Polymer.dom(this).getOwnerRoot();return e&&e.host},configurable:!0};Object.defineProperty(Polymer.Base,"domHost",c),Polymer.BaseDescriptors.domHost=c;var _=window.CustomElements&&!CustomElements.useNative}(),Polymer.Settings.useShadow&&Polymer.Base._addFeature({_poolContent:function(){},_beginDistribute:function(){},distributeContent:function(){},_distributeContent:function(){},_finishDistribute:function(){},_createLocalRoot:function(){this.createShadowRoot(),this.shadowRoot.appendChild(this.root),this.root=this.shadowRoot}}),Polymer.Async={_currVal:0,_lastVal:0,_callbacks:[],_twiddleContent:0,_twiddle:document.createTextNode(""),run:function(e,t){return t>0?~setTimeout(e,t):(this._twiddle.textContent=this._twiddleContent++,this._callbacks.push(e),this._currVal++)},cancel:function(e){if(e<0)clearTimeout(~e);else{var t=e-this._lastVal;if(t>=0){if(!this._callbacks[t])throw"invalid async handle: "+e;this._callbacks[t]=null}}},_atEndOfMicrotask:function(){for(var e=this,t=this._callbacks.length,o=0;o<t;o++){var i=e._callbacks[o];if(i)try{i()}catch(t){throw o++,e._callbacks.splice(0,o),e._lastVal+=o,e._twiddle.textContent=e._twiddleContent++,t}}this._callbacks.splice(0,t),this._lastVal+=t}},new window.MutationObserver(function(){Polymer.Async._atEndOfMicrotask()}).observe(Polymer.Async._twiddle,{characterData:!0}),Polymer.Debounce=function(){var e=Polymer.Async,t=function(e){this.context=e;var t=this;this.boundComplete=function(){t.complete()}};return t.prototype={go:function(t,o){var i;this.finish=function(){e.cancel(i)},i=e.run(this.boundComplete,o),this.callback=t},stop:function(){this.finish&&(this.finish(),this.finish=null,this.callback=null)},complete:function(){if(this.finish){var e=this.callback;this.stop(),e.call(this.context)}}},function(e,o,i){return e?e.stop():e=new t(this),e.go(o,i),e}}(),Polymer.Base._addFeature({_setupDebouncers:function(){this._debouncers={}},debounce:function(e,t,o){return this._debouncers[e]=Polymer.Debounce.call(this,this._debouncers[e],t,o)},isDebouncerActive:function(e){var t=this._debouncers[e];return!(!t||!t.finish)},flushDebouncer:function(e){var t=this._debouncers[e];t&&t.complete()},cancelDebouncer:function(e){var t=this._debouncers[e];t&&t.stop()}}),Polymer.DomModule=document.createElement("dom-module"),Polymer.Base._addFeature({_registerFeatures:function(){this._prepIs(),this._prepBehaviors(),this._prepConstructor(),this._prepTemplate(),this._prepShady(),this._prepPropertyInfo()},_prepBehavior:function(e){this._addHostAttributes(e.hostAttributes)},_initFeatures:function(){this._registerHost(),this._template&&(this._poolContent(),this._beginHosting(),this._stampTemplate(),this._endHosting()),this._marshalHostAttributes(),this._setupDebouncers(),this._marshalBehaviors(),this._tryReady()},_marshalBehavior:function(e){}});</script><script>!function(){Polymer.nar=[];var e=Polymer.Settings.disableUpgradeEnabled;Polymer.Annotations={parseAnnotations:function(e,t){var n=[],r=e._content||e.content;return this._parseNodeAnnotations(r,n,t||e.hasAttribute("strip-whitespace")),n},_parseNodeAnnotations:function(e,t,n){return e.nodeType===Node.TEXT_NODE?this._parseTextNodeAnnotation(e,t):this._parseElementAnnotations(e,t,n)},_bindingRegex:new RegExp("(\\[\\[|{{)\\s*(?:(!)\\s*)?((?:[a-zA-Z_$][\\w.:$\\-*]*)\\s*(?:\\(\\s*(?:(?:(?:(?:[a-zA-Z_$][\\w.:$\\-*]*)|(?:[-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?)|(?:(?:'(?:[^'\\\\]|\\\\.)*')|(?:\"(?:[^\"\\\\]|\\\\.)*\"))\\s*)(?:,\\s*(?:(?:[a-zA-Z_$][\\w.:$\\-*]*)|(?:[-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?)|(?:(?:'(?:[^'\\\\]|\\\\.)*')|(?:\"(?:[^\"\\\\]|\\\\.)*\"))\\s*))*)?)\\)\\s*)?)(?:]]|}})","g"),_parseBindings:function(e){for(var t,n=this._bindingRegex,r=[],s=0;null!==(t=n.exec(e));){t.index>s&&r.push({literal:e.slice(s,t.index)});var i,o,a,l=t[1][0],c=Boolean(t[2]),h=t[3].trim();"{"==l&&(a=h.indexOf("::"))>0&&(o=h.substring(a+2),h=h.substring(0,a),i=!0),r.push({compoundIndex:r.length,value:h,mode:l,negate:c,event:o,customEvent:i}),s=n.lastIndex}if(s&&s<e.length){var u=e.substring(s);u&&r.push({literal:u})}if(r.length)return r},_literalFromParts:function(e){for(var t="",n=0;n<e.length;n++)t+=e[n].literal||"";return t},_parseTextNodeAnnotation:function(e,t){var n=this._parseBindings(e.textContent);if(n){e.textContent=this._literalFromParts(n)||" ";var r={bindings:[{kind:"text",name:"textContent",parts:n,isCompound:1!==n.length}]};return t.push(r),r}},_parseElementAnnotations:function(e,t,n){var r={bindings:[],events:[]};return"content"===e.localName&&(t._hasContent=!0),this._parseChildNodesAnnotations(e,r,t,n),e.attributes&&(this._parseNodeAttributeAnnotations(e,r,t),this.prepElement&&this.prepElement(e)),(r.bindings.length||r.events.length||r.id)&&t.push(r),r},_parseChildNodesAnnotations:function(e,t,n,r){var s=this;if(e.firstChild)for(var i=e.firstChild,o=0;i;){var a=i.nextSibling;if("template"!==i.localName||i.hasAttribute("preserve-content")||s._parseTemplate(i,o,n,t,r),"slot"==i.localName&&(i=s._replaceSlotWithContent(i)),i.nodeType===Node.TEXT_NODE){for(var l=a;l&&l.nodeType===Node.TEXT_NODE;)i.textContent+=l.textContent,a=l.nextSibling,e.removeChild(l),l=a;r&&!i.textContent.trim()&&(e.removeChild(i),o--)}if(i.parentNode){var c=s._parseNodeAnnotations(i,n,r);c&&(c.parent=t,c.index=o)}i=a,o++}},_replaceSlotWithContent:function(e){for(var t=e.ownerDocument.createElement("content");e.firstChild;)t.appendChild(e.firstChild);for(var n=e.attributes,r=0;r<n.length;r++){var s=n[r];t.setAttribute(s.name,s.value)}var i=e.getAttribute("name");return i&&t.setAttribute("select","[slot='"+i+"']"),e.parentNode.replaceChild(t,e),t},_parseTemplate:function(e,t,n,r,s){var i=document.createDocumentFragment();i._notes=this.parseAnnotations(e,s),i.appendChild(e.content),n.push({bindings:Polymer.nar,events:Polymer.nar,templateContent:i,parent:r,index:t})},_parseNodeAttributeAnnotations:function(e,t){for(var n,r=this,s=Array.prototype.slice.call(e.attributes),i=s.length-1;n=s[i];i--){var o,a=n.name,l=n.value;"on-"===a.slice(0,3)?(e.removeAttribute(a),t.events.push({name:a.slice(3),value:l})):(o=r._parseNodeAttributeAnnotation(e,a,l))?t.bindings.push(o):"id"===a&&(t.id=l)}},_parseNodeAttributeAnnotation:function(t,n,r){var s=this._parseBindings(r);if(s){var i=n,o="property";"$"==n[n.length-1]&&(n=n.slice(0,-1),o="attribute");var a=this._literalFromParts(s);a&&"attribute"==o&&t.setAttribute(n,a),"input"===t.localName&&"value"===i&&t.setAttribute(i,""),e&&"disable-upgrade$"===i&&t.setAttribute(n,""),t.removeAttribute(i);var l=Polymer.CaseMap.dashToCamelCase(n);return"property"===o&&(n=l),{kind:o,name:n,propertyName:l,parts:s,literal:a,isCompound:1!==s.length}}},findAnnotatedNode:function(e,t){var n=t.parent&&Polymer.Annotations.findAnnotatedNode(e,t.parent);if(!n)return e;for(var r=n.firstChild,s=0;r;r=r.nextSibling)if(t.index===s++)return r}}}(),Polymer.Path={root:function(e){var t=e.indexOf(".");return-1===t?e:e.slice(0,t)},isDeep:function(e){return-1!==e.indexOf(".")},isAncestor:function(e,t){return 0===e.indexOf(t+".")},isDescendant:function(e,t){return 0===t.indexOf(e+".")},translate:function(e,t,n){return t+n.slice(e.length)},matches:function(e,t,n){return e===n||this.isAncestor(e,n)||Boolean(t)&&this.isDescendant(e,n)}},Polymer.Base._addFeature({_prepAnnotations:function(){if(this._template){var e=this;Polymer.Annotations.prepElement=function(t){e._prepElement(t)},this._template._content&&this._template._content._notes?this._notes=this._template._content._notes:(this._notes=Polymer.Annotations.parseAnnotations(this._template),this._processAnnotations(this._notes)),Polymer.Annotations.prepElement=null}else this._notes=[]},_processAnnotations:function(e){for(var t=this,n=0;n<e.length;n++){for(var r=e[n],s=0;s<r.bindings.length;s++)for(var i=r.bindings[s],o=0;o<i.parts.length;o++){var a=i.parts[o];if(!a.literal){var l=t._parseMethod(a.value);l?a.signature=l:a.model=Polymer.Path.root(a.value)}}if(r.templateContent){t._processAnnotations(r.templateContent._notes);var c=r.templateContent._parentProps=t._discoverTemplateParentProps(r.templateContent._notes),h=[];for(var u in c){var f="_parent_"+u;h.push({index:r.index,kind:"property",name:f,propertyName:f,parts:[{mode:"{",model:u,value:u}]})}r.bindings=r.bindings.concat(h)}}},_discoverTemplateParentProps:function(e){for(var t,n={},r=0;r<e.length&&(t=e[r]);r++){for(var s,i=0,o=t.bindings;i<o.length&&(s=o[i]);i++)for(var a,l=0,c=s.parts;l<c.length&&(a=c[l]);l++)if(a.signature){for(var h=a.signature.args,u=0;u<h.length;u++){var f=h[u].model;f&&(n[f]=!0)}a.signature.dynamicFn&&(n[a.signature.method]=!0)}else a.model&&(n[a.model]=!0);if(t.templateContent){var p=t.templateContent._parentProps;Polymer.Base.mixin(n,p)}}return n},_prepElement:function(e){Polymer.ResolveUrl.resolveAttrs(e,this._template.ownerDocument)},_findAnnotatedNode:Polymer.Annotations.findAnnotatedNode,_marshalAnnotationReferences:function(){this._template&&(this._marshalIdNodes(),this._marshalAnnotatedNodes(),this._marshalAnnotatedListeners())},_configureAnnotationReferences:function(){for(var e=this,t=this._notes,n=this._nodes,r=0;r<t.length;r++){var s=t[r],i=n[r];e._configureTemplateContent(s,i),e._configureCompoundBindings(s,i)}},_configureTemplateContent:function(e,t){e.templateContent&&(t._content=e.templateContent)},_configureCompoundBindings:function(e,t){for(var n=e.bindings,r=0;r<n.length;r++){var s=n[r];if(s.isCompound){for(var i=t.__compoundStorage__||(t.__compoundStorage__={}),o=s.parts,a=new Array(o.length),l=0;l<o.length;l++)a[l]=o[l].literal;var c=s.name;i[c]=a,s.literal&&"property"==s.kind&&(t._configValue?t._configValue(c,s.literal):t[c]=s.literal)}}},_marshalIdNodes:function(){var e=this;this.$={};for(var t,n=0,r=this._notes.length;n<r&&(t=this._notes[n]);n++)t.id&&(e.$[t.id]=e._findAnnotatedNode(e.root,t))},_marshalAnnotatedNodes:function(){var e=this;if(this._notes&&this._notes.length){for(var t=new Array(this._notes.length),n=0;n<this._notes.length;n++)t[n]=e._findAnnotatedNode(e.root,e._notes[n]);this._nodes=t}},_marshalAnnotatedListeners:function(){for(var e,t=this,n=0,r=this._notes.length;n<r&&(e=this._notes[n]);n++)if(e.events&&e.events.length)for(var s,i=t._findAnnotatedNode(t.root,e),o=0,a=e.events;o<a.length&&(s=a[o]);o++)t.listen(i,s.name,s.value)}}),Polymer.Base._addFeature({listeners:{},_listenListeners:function(e){var t,n,r,s=this;for(r in e)r.indexOf(".")<0?(t=s,n=r):(n=r.split("."),t=s.$[n[0]],n=n[1]),s.listen(t,n,e[r])},listen:function(e,t,n){var r=this._recallEventHandler(this,t,e,n);r||(r=this._createEventHandler(e,t,n)),r._listening||(this._listen(e,t,r),r._listening=!0)},_boundListenerKey:function(e,t){return e+":"+t},_recordEventHandler:function(e,t,n,r,s){var i=e.__boundListeners;i||(i=e.__boundListeners=new WeakMap);var o=i.get(n);o||(o={},Polymer.Settings.isIE&&n==window||i.set(n,o)),o[this._boundListenerKey(t,r)]=s},_recallEventHandler:function(e,t,n,r){var s=e.__boundListeners;if(s){var i=s.get(n);if(i)return i[this._boundListenerKey(t,r)]}},_createEventHandler:function(e,t,n){var r=this,s=function(e){r[n]?r[n](e,e.detail):r._warn(r._logf("_createEventHandler","listener method `"+n+"` not defined"))};return s._listening=!1,this._recordEventHandler(r,t,e,n,s),s},unlisten:function(e,t,n){var r=this._recallEventHandler(this,t,e,n);r&&(this._unlisten(e,t,r),r._listening=!1)},_listen:function(e,t,n){e.addEventListener(t,n)},_unlisten:function(e,t,n){e.removeEventListener(t,n)}}),function(){"use strict";function e(e){for(var t,n=d?["click"]:u,r=0;r<n.length;r++)t=n[r],e?document.addEventListener(t,m,!0):document.removeEventListener(t,m,!0)}function t(e){var t=e.type;if(-1===u.indexOf(t))return!1;if("mousemove"===t){var n=void 0===e.buttons?1:e.buttons;return e instanceof window.MouseEvent&&!p&&(n=f[e.which]||0),Boolean(1&n)}return 0===(void 0===e.button?0:e.button)}function n(e){if("click"===e.type){if(0===e.detail)return!0;var t=v.findOriginalTarget(e).getBoundingClientRect(),n=e.pageX,r=e.pageY;return!(n>=t.left&&n<=t.right&&r>=t.top&&r<=t.bottom)}return!1}function r(e){for(var t,n=Polymer.dom(e).path,r="auto",s=0;s<n.length;s++)if((t=n[s])[c]){r=t[c];break}return r}function s(e,t,n){e.movefn=t,e.upfn=n,document.addEventListener("mousemove",t),document.addEventListener("mouseup",n)}function i(e){document.removeEventListener("mousemove",e.movefn),document.removeEventListener("mouseup",e.upfn),e.movefn=null,e.upfn=null}var o=Polymer.DomApi.wrap,a="string"==typeof document.head.style.touchAction,l="__polymerGesturesHandled",c="__polymerGesturesTouchAction",h=2500,u=["mousedown","mousemove","mouseup","click"],f=[0,1,4,2],p=function(){try{return 1===new MouseEvent("test",{buttons:1}).buttons}catch(e){return!1}}(),_=!1;!function(){try{var e=Object.defineProperty({},"passive",{get:function(){_=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}}();var d=navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/),m=function(e){var t=e.sourceCapabilities;if((!t||t.firesTouchEvents)&&(e[l]={skip:!0},"click"===e.type)){for(var n=Polymer.dom(e).path,r=0;r<n.length;r++)if(n[r]===y.mouse.target)return;e.preventDefault(),e.stopPropagation()}},y={mouse:{target:null,mouseIgnoreJob:null},touch:{x:0,y:0,id:-1,scrollDecided:!1}};document.addEventListener("touchend",function(t){y.mouse.mouseIgnoreJob||e(!0);y.mouse.target=Polymer.dom(t).rootTarget,y.mouse.mouseIgnoreJob=Polymer.Debounce(y.mouse.mouseIgnoreJob,function(){e(),y.mouse.target=null,y.mouse.mouseIgnoreJob=null},h)},!!_&&{passive:!0});var v={gestures:{},recognizers:[],deepTargetFind:function(e,t){for(var n=document.elementFromPoint(e,t),r=n;r&&r.shadowRoot;)(r=r.shadowRoot.elementFromPoint(e,t))&&(n=r);return n},findOriginalTarget:function(e){return e.path?e.path[0]:e.target},handleNative:function(e){var t,n=e.type,r=o(e.currentTarget).__polymerGestures;if(r){var s=r[n];if(s){if(!e[l]&&(e[l]={},"touch"===n.slice(0,5))){var i=e.changedTouches[0];if("touchstart"===n&&1===e.touches.length&&(y.touch.id=i.identifier),y.touch.id!==i.identifier)return;a||"touchstart"!==n&&"touchmove"!==n||v.handleTouchAction(e)}if(!(t=e[l]).skip){for(var c,h=v.recognizers,u=0;u<h.length;u++)s[(c=h[u]).name]&&!t[c.name]&&c.flow&&c.flow.start.indexOf(e.type)>-1&&c.reset&&c.reset();for(u=0,c;u<h.length;u++)s[(c=h[u]).name]&&!t[c.name]&&(t[c.name]=!0,c[n](e))}}}},handleTouchAction:function(e){var t=e.changedTouches[0],n=e.type;if("touchstart"===n)y.touch.x=t.clientX,y.touch.y=t.clientY,y.touch.scrollDecided=!1;else if("touchmove"===n){if(y.touch.scrollDecided)return;y.touch.scrollDecided=!0;var s=r(e),i=!1,o=Math.abs(y.touch.x-t.clientX),a=Math.abs(y.touch.y-t.clientY);e.cancelable&&("none"===s?i=!0:"pan-x"===s?i=a>o:"pan-y"===s&&(i=o>a)),i?e.preventDefault():v.prevent("track")}},add:function(e,t,n){var r=this;e=o(e);var s=this.gestures[t],i=s.deps,a=s.name,l=e.__polymerGestures;l||(e.__polymerGestures=l={});for(var c,h,f=0;f<i.length;f++)c=i[f],d&&u.indexOf(c)>-1&&"click"!==c||((h=l[c])||(l[c]=h={_count:0}),0===h._count&&e.addEventListener(c,r.handleNative),h[a]=(h[a]||0)+1,h._count=(h._count||0)+1);e.addEventListener(t,n),s.touchAction&&this.setTouchAction(e,s.touchAction)},remove:function(e,t,n){var r=this;e=o(e);var s=this.gestures[t],i=s.deps,a=s.name,l=e.__polymerGestures;if(l)for(var c,h,u=0;u<i.length;u++)(h=l[c=i[u]])&&h[a]&&(h[a]=(h[a]||1)-1,h._count=(h._count||1)-1,0===h._count&&e.removeEventListener(c,r.handleNative));e.removeEventListener(t,n)},register:function(e){var t=this;this.recognizers.push(e);for(var n=0;n<e.emits.length;n++)t.gestures[e.emits[n]]=e},findRecognizerByEvent:function(e){for(var t,n=this,r=0;r<this.recognizers.length;r++){t=n.recognizers[r];for(var s=0;s<t.emits.length;s++)if(t.emits[s]===e)return t}return null},setTouchAction:function(e,t){a&&(e.style.touchAction=t),e[c]=t},fire:function(e,t,n){if(Polymer.Base.fire(t,n,{node:e,bubbles:!0,cancelable:!0}).defaultPrevented){var r=n.preventer||n.sourceEvent;r&&r.preventDefault&&r.preventDefault()}},prevent:function(e){var t=this.findRecognizerByEvent(e);t.info&&(t.info.prevent=!0)},resetMouseCanceller:function(){y.mouse.mouseIgnoreJob&&y.mouse.mouseIgnoreJob.complete()}};v.register({name:"downup",deps:["mousedown","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["down","up"],info:{movefn:null,upfn:null},reset:function(){i(this.info)},mousedown:function(e){if(t(e)){var n=v.findOriginalTarget(e),r=this;s(this.info,function(e){t(e)||(r.fire("up",n,e),i(r.info))},function(e){t(e)&&r.fire("up",n,e),i(r.info)}),this.fire("down",n,e)}},touchstart:function(e){this.fire("down",v.findOriginalTarget(e),e.changedTouches[0],e)},touchend:function(e){this.fire("up",v.findOriginalTarget(e),e.changedTouches[0],e)},fire:function(e,t,n,r){v.fire(t,e,{x:n.clientX,y:n.clientY,sourceEvent:n,preventer:r,prevent:function(e){return v.prevent(e)}})}}),v.register({name:"track",touchAction:"none",deps:["mousedown","touchstart","touchmove","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["track"],info:{x:0,y:0,state:"start",started:!1,moves:[],addMove:function(e){this.moves.length>2&&this.moves.shift(),this.moves.push(e)},movefn:null,upfn:null,prevent:!1},reset:function(){this.info.state="start",this.info.started=!1,this.info.moves=[],this.info.x=0,this.info.y=0,this.info.prevent=!1,i(this.info)},hasMovedEnough:function(e,t){if(this.info.prevent)return!1;if(this.info.started)return!0;var n=Math.abs(this.info.x-e),r=Math.abs(this.info.y-t);return n>=5||r>=5},mousedown:function(e){if(t(e)){var n=v.findOriginalTarget(e),r=this,o=function(e){var s=e.clientX,o=e.clientY;r.hasMovedEnough(s,o)&&(r.info.state=r.info.started?"mouseup"===e.type?"end":"track":"start","start"===r.info.state&&v.prevent("tap"),r.info.addMove({x:s,y:o}),t(e)||(r.info.state="end",i(r.info)),r.fire(n,e),r.info.started=!0)};s(this.info,o,function(e){r.info.started&&o(e),i(r.info)}),this.info.x=e.clientX,this.info.y=e.clientY}},touchstart:function(e){var t=e.changedTouches[0];this.info.x=t.clientX,this.info.y=t.clientY},touchmove:function(e){var t=v.findOriginalTarget(e),n=e.changedTouches[0],r=n.clientX,s=n.clientY;this.hasMovedEnough(r,s)&&("start"===this.info.state&&v.prevent("tap"),this.info.addMove({x:r,y:s}),this.fire(t,n),this.info.state="track",this.info.started=!0)},touchend:function(e){var t=v.findOriginalTarget(e),n=e.changedTouches[0];this.info.started&&(this.info.state="end",this.info.addMove({x:n.clientX,y:n.clientY}),this.fire(t,n,e))},fire:function(e,t,n){var r,s=this.info.moves[this.info.moves.length-2],i=this.info.moves[this.info.moves.length-1],o=i.x-this.info.x,a=i.y-this.info.y,l=0;return s&&(r=i.x-s.x,l=i.y-s.y),v.fire(e,"track",{state:this.info.state,x:t.clientX,y:t.clientY,dx:o,dy:a,ddx:r,ddy:l,sourceEvent:t,preventer:n,hover:function(){return v.deepTargetFind(t.clientX,t.clientY)}})}}),v.register({name:"tap",deps:["mousedown","click","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["click","touchend"]},emits:["tap"],info:{x:NaN,y:NaN,prevent:!1},reset:function(){this.info.x=NaN,this.info.y=NaN,this.info.prevent=!1},save:function(e){this.info.x=e.clientX,this.info.y=e.clientY},mousedown:function(e){t(e)&&this.save(e)},click:function(e){t(e)&&this.forward(e)},touchstart:function(e){this.save(e.changedTouches[0],e)},touchend:function(e){this.forward(e.changedTouches[0],e)},forward:function(e,t){var r=Math.abs(e.clientX-this.info.x),s=Math.abs(e.clientY-this.info.y),i=v.findOriginalTarget(e);(isNaN(r)||isNaN(s)||r<=25&&s<=25||n(e))&&(this.info.prevent||v.fire(i,"tap",{x:e.clientX,y:e.clientY,sourceEvent:e,preventer:t}))}});var g={x:"pan-x",y:"pan-y",none:"none",all:"auto"};Polymer.Base._addFeature({_setupGestures:function(){this.__polymerGestures=null},_listen:function(e,t,n){v.gestures[t]?v.add(e,t,n):e.addEventListener(t,n)},_unlisten:function(e,t,n){v.gestures[t]?v.remove(e,t,n):e.removeEventListener(t,n)},setScrollDirection:function(e,t){t=t||this,v.setTouchAction(t,g[e]||"auto")}}),Polymer.Gestures=v}(),function(){"use strict";if(Polymer.Base._addFeature({$$:function(e){return Polymer.dom(this.root).querySelector(e)},toggleClass:function(e,t,n){n=n||this,1==arguments.length&&(t=!n.classList.contains(e)),t?Polymer.dom(n).classList.add(e):Polymer.dom(n).classList.remove(e)},toggleAttribute:function(e,t,n){n=n||this,1==arguments.length&&(t=!n.hasAttribute(e)),t?Polymer.dom(n).setAttribute(e,""):Polymer.dom(n).removeAttribute(e)},classFollows:function(e,t,n){n&&Polymer.dom(n).classList.remove(e),t&&Polymer.dom(t).classList.add(e)},attributeFollows:function(e,t,n){n&&Polymer.dom(n).removeAttribute(e),t&&Polymer.dom(t).setAttribute(e,"")},getEffectiveChildNodes:function(){return Polymer.dom(this).getEffectiveChildNodes()},getEffectiveChildren:function(){return Polymer.dom(this).getEffectiveChildNodes().filter(function(e){return e.nodeType===Node.ELEMENT_NODE})},getEffectiveTextContent:function(){for(var e,t=this.getEffectiveChildNodes(),n=[],r=0;e=t[r];r++)e.nodeType!==Node.COMMENT_NODE&&n.push(Polymer.dom(e).textContent);return n.join("")},queryEffectiveChildren:function(e){var t=Polymer.dom(this).queryDistributedElements(e);return t&&t[0]},queryAllEffectiveChildren:function(e){return Polymer.dom(this).queryDistributedElements(e)},getContentChildNodes:function(e){var t=Polymer.dom(this.root).querySelector(e||"content");return t?Polymer.dom(t).getDistributedNodes():[]},getContentChildren:function(e){return this.getContentChildNodes(e).filter(function(e){return e.nodeType===Node.ELEMENT_NODE})},fire:function(e,t,n){var r=(n=n||Polymer.nob).node||this;t=null===t||void 0===t?{}:t;var s=void 0===n.bubbles||n.bubbles,i=Boolean(n.cancelable),o=n._useCache,a=this._getEvent(e,s,i,o);return a.detail=t,o&&(this.__eventCache[e]=null),r.dispatchEvent(a),o&&(this.__eventCache[e]=a),a},__eventCache:{},_getEvent:function(e,t,n,r){var s=r&&this.__eventCache[e];return s&&s.bubbles==t&&s.cancelable==n||(s=new Event(e,{bubbles:Boolean(t),cancelable:n})),s},async:function(e,t){var n=this;return Polymer.Async.run(function(){e.call(n)},t)},cancelAsync:function(e){Polymer.Async.cancel(e)},arrayDelete:function(e,t){var n;if(Array.isArray(e)){if((n=e.indexOf(t))>=0)return e.splice(n,1)}else if((n=this._get(e).indexOf(t))>=0)return this.splice(e,n,1)},transform:function(e,t){(t=t||this).style.webkitTransform=e,t.style.transform=e},translate3d:function(e,t,n,r){r=r||this,this.transform("translate3d("+e+","+t+","+n+")",r)},importHref:function(e,t,n,r){var s=document.createElement("link");s.rel="import",s.href=e;var i=Polymer.Base.importHref.imported=Polymer.Base.importHref.imported||{},o=i[s.href],a=o||s,l=this,c=function(e){return e.target.__firedLoad=!0,e.target.removeEventListener("load",c),e.target.removeEventListener("error",h),t.call(l,e)},h=function(e){return e.target.__firedError=!0,e.target.removeEventListener("load",c),e.target.removeEventListener("error",h),n.call(l,e)};return t&&a.addEventListener("load",c),n&&a.addEventListener("error",h),o?(o.__firedLoad&&o.dispatchEvent(new Event("load")),o.__firedError&&o.dispatchEvent(new Event("error"))):(i[s.href]=s,(r=Boolean(r))&&s.setAttribute("async",""),document.head.appendChild(s)),a},create:function(e,t){var n=document.createElement(e);if(t)for(var r in t)n[r]=t[r];return n},isLightDescendant:function(e){return this!==e&&this.contains(e)&&Polymer.dom(this).getOwnerRoot()===Polymer.dom(e).getOwnerRoot()},isLocalDescendant:function(e){return this.root===Polymer.dom(e).getOwnerRoot()}}),!Polymer.Settings.useNativeCustomElements){var e=Polymer.Base.importHref;Polymer.Base.importHref=function(t,n,r,s){CustomElements.ready=!1;return e.call(this,t,function(e){if(CustomElements.upgradeDocumentTree(document),CustomElements.ready=!0,n)return n.call(this,e)},r,s)}}}(),Polymer.Bind={prepareModel:function(e){Polymer.Base.mixin(e,this._modelApi)},_modelApi:{_notifyChange:function(e,t,n){n=void 0===n?this[e]:n,t=t||Polymer.CaseMap.camelToDashCase(e)+"-changed",this.fire(t,{value:n},{bubbles:!1,cancelable:!1,_useCache:Polymer.Settings.eventDataCache||!Polymer.Settings.isIE})},_propertySetter:function(e,t,n,r){var s=this.__data__[e];return s===t||s!==s&&t!==t||(this.__data__[e]=t,"object"==typeof t&&this._clearPath(e),this._propertyChanged&&this._propertyChanged(e,t,s),n&&this._effectEffects(e,t,n,s,r)),s},__setProperty:function(e,t,n,r){var s=(r=r||this)._propertyEffects&&r._propertyEffects[e];s?r._propertySetter(e,t,s,n):r[e]!==t&&(r[e]=t)},_effectEffects:function(e,t,n,r,s){for(var i,o=this,a=0,l=n.length;a<l&&(i=n[a]);a++)i.fn.call(o,e,o[e],i.effect,r,s)},_clearPath:function(e){var t=this;for(var n in this.__data__)Polymer.Path.isDescendant(e,n)&&(t.__data__[n]=void 0)}},ensurePropertyEffects:function(e,t){e._propertyEffects||(e._propertyEffects={});var n=e._propertyEffects[t];return n||(n=e._propertyEffects[t]=[]),n},addPropertyEffect:function(e,t,n,r){var s=this.ensurePropertyEffects(e,t),i={kind:n,effect:r,fn:Polymer.Bind["_"+n+"Effect"]};return s.push(i),i},createBindings:function(e){var t=this,n=e._propertyEffects;if(n)for(var r in n){var s=n[r];s.sort(t._sortPropertyEffects),t._createAccessors(e,r,s)}},_sortPropertyEffects:function(){var e={compute:0,annotation:1,annotatedComputation:2,reflect:3,notify:4,observer:5,complexObserver:6,function:7};return function(t,n){return e[t.kind]-e[n.kind]}}(),_createAccessors:function(e,t,n){var r={get:function(){return this.__data__[t]}},s=function(e){this._propertySetter(t,e,n)},i=e.getPropertyInfo&&e.getPropertyInfo(t);i&&i.readOnly?i.computed||(e["_set"+this.upper(t)]=s):r.set=s,Object.defineProperty(e,t,r)},upper:function(e){return e[0].toUpperCase()+e.substring(1)},_addAnnotatedListener:function(e,t,n,r,s,i){e._bindListeners||(e._bindListeners=[]);var o=this._notedListenerFactory(n,r,Polymer.Path.isDeep(r),i),a=s||Polymer.CaseMap.camelToDashCase(n)+"-changed";e._bindListeners.push({index:t,property:n,path:r,changedFn:o,event:a})},_isEventBogus:function(e,t){return e.path&&e.path[0]!==t},_notedListenerFactory:function(e,t,n,r){return function(s,i,o){if(o){var a=Polymer.Path.translate(e,t,o);this._notifyPath(a,i)}else i=s[e],r&&(i=!i),n?this.__data__[t]!=i&&this.set(t,i):this[t]=i}},prepareInstance:function(e){e.__data__=Object.create(null)},setupBindListeners:function(e){for(var t,n=this,r=e._bindListeners,s=0,i=r.length;s<i&&(t=r[s]);s++){var o=e._nodes[t.index];n._addNotifyListener(o,e,t.event,t.changedFn)}},_addNotifyListener:function(e,t,n,r){e.addEventListener(n,function(e){return t._notifyListener(r,e)})}},Polymer.Base.mixin(Polymer.Bind,{_shouldAddListener:function(e){return e.name&&"attribute"!=e.kind&&"text"!=e.kind&&!e.isCompound&&"{"===e.parts[0].mode},_annotationEffect:function(e,t,n){e!=n.value&&(t=this._get(n.value),this.__data__[n.value]=t),this._applyEffectValue(n,t)},_reflectEffect:function(e,t,n){this.reflectPropertyToAttribute(e,n.attribute,t)},_notifyEffect:function(e,t,n,r,s){s||this._notifyChange(e,n.event,t)},_functionEffect:function(e,t,n,r,s){n.call(this,e,t,r,s)},_observerEffect:function(e,t,n,r){var s=this[n.method];s?s.call(this,t,r):this._warn(this._logf("_observerEffect","observer method `"+n.method+"` not defined"))},_complexObserverEffect:function(e,t,n){var r=this[n.method];if(r){var s=Polymer.Bind._marshalArgs(this.__data__,n,e,t);s&&r.apply(this,s)}else n.dynamicFn||this._warn(this._logf("_complexObserverEffect","observer method `"+n.method+"` not defined"))},_computeEffect:function(e,t,n){var r=this[n.method];if(r){var s=Polymer.Bind._marshalArgs(this.__data__,n,e,t);if(s){var i=r.apply(this,s);this.__setProperty(n.name,i)}}else n.dynamicFn||this._warn(this._logf("_computeEffect","compute method `"+n.method+"` not defined"))},_annotatedComputationEffect:function(e,t,n){var r=this._rootDataHost||this,s=r[n.method];if(s){var i=Polymer.Bind._marshalArgs(this.__data__,n,e,t);if(i){var o=s.apply(r,i);this._applyEffectValue(n,o)}}else n.dynamicFn||r._warn(r._logf("_annotatedComputationEffect","compute method `"+n.method+"` not defined"))},_marshalArgs:function(e,t,n,r){for(var s=[],i=t.args,o=i.length>1||t.dynamicFn,a=0,l=i.length;a<l;a++){var c,h=i[a],u=h.name;if(h.literal?c=h.value:n===u?c=r:void 0===(c=e[u])&&h.structured&&(c=Polymer.Base._get(u,e)),o&&void 0===c)return;if(h.wildcard){var f=Polymer.Path.isAncestor(n,u);s[a]={path:f?n:u,value:f?r:c,base:c}}else s[a]=c}return s}}),Polymer.Base._addFeature({_addPropertyEffect:function(e,t,n){var r=Polymer.Bind.addPropertyEffect(this,e,t,n);r.pathFn=this["_"+r.kind+"PathEffect"]},_prepEffects:function(){Polymer.Bind.prepareModel(this),this._addAnnotationEffects(this._notes)},_prepBindings:function(){Polymer.Bind.createBindings(this)},_addPropertyEffects:function(e){var t=this;if(e)for(var n in e){var r=e[n];if(r.observer&&t._addObserverEffect(n,r.observer),r.computed&&(r.readOnly=!0,t._addComputedEffect(n,r.computed)),r.notify&&t._addPropertyEffect(n,"notify",{event:Polymer.CaseMap.camelToDashCase(n)+"-changed"}),r.reflectToAttribute){var s=Polymer.CaseMap.camelToDashCase(n);"-"===s[0]?t._warn(t._logf("_addPropertyEffects","Property "+n+" cannot be reflected to attribute "+s+' because "-" is not a valid starting attribute name. Use a lowercase first letter for the property instead.')):t._addPropertyEffect(n,"reflect",{attribute:s})}r.readOnly&&Polymer.Bind.ensurePropertyEffects(t,n)}},_addComputedEffect:function(e,t){for(var n,r=this,s=this._parseMethod(t),i=s.dynamicFn,o=0;o<s.args.length&&(n=s.args[o]);o++)r._addPropertyEffect(n.model,"compute",{method:s.method,args:s.args,trigger:n,name:e,dynamicFn:i});i&&this._addPropertyEffect(s.method,"compute",{method:s.method,args:s.args,trigger:null,name:e,dynamicFn:i})},_addObserverEffect:function(e,t){this._addPropertyEffect(e,"observer",{method:t,property:e})},_addComplexObserverEffects:function(e){var t=this;if(e)for(var n,r=0;r<e.length&&(n=e[r]);r++)t._addComplexObserverEffect(n)},_addComplexObserverEffect:function(e){var t=this,n=this._parseMethod(e);if(!n)throw new Error("Malformed observer expression '"+e+"'");for(var r,s=n.dynamicFn,i=0;i<n.args.length&&(r=n.args[i]);i++)t._addPropertyEffect(r.model,"complexObserver",{method:n.method,args:n.args,trigger:r,dynamicFn:s});s&&this._addPropertyEffect(n.method,"complexObserver",{method:n.method,args:n.args,trigger:null,dynamicFn:s})},_addAnnotationEffects:function(e){for(var t,n=this,r=0;r<e.length&&(t=e[r]);r++)for(var s,i=t.bindings,o=0;o<i.length&&(s=i[o]);o++)n._addAnnotationEffect(s,r)},_addAnnotationEffect:function(e,t){var n=this;Polymer.Bind._shouldAddListener(e)&&Polymer.Bind._addAnnotatedListener(this,t,e.name,e.parts[0].value,e.parts[0].event,e.parts[0].negate);for(var r=0;r<e.parts.length;r++){var s=e.parts[r];s.signature?n._addAnnotatedComputationEffect(e,s,t):s.literal||("attribute"===e.kind&&"-"===e.name[0]?n._warn(n._logf("_addAnnotationEffect","Cannot set attribute "+e.name+' because "-" is not a valid attribute starting character')):n._addPropertyEffect(s.model,"annotation",{kind:e.kind,index:t,name:e.name,propertyName:e.propertyName,value:s.value,isCompound:e.isCompound,compoundIndex:s.compoundIndex,event:s.event,customEvent:s.customEvent,negate:s.negate}))}},_addAnnotatedComputationEffect:function(e,t,n){var r=this,s=t.signature;if(s.static)this.__addAnnotatedComputationEffect("__static__",n,e,t,null);else{for(var i,o=0;o<s.args.length&&(i=s.args[o]);o++)i.literal||r.__addAnnotatedComputationEffect(i.model,n,e,t,i);s.dynamicFn&&this.__addAnnotatedComputationEffect(s.method,n,e,t,null)}},__addAnnotatedComputationEffect:function(e,t,n,r,s){this._addPropertyEffect(e,"annotatedComputation",{index:t,isCompound:n.isCompound,compoundIndex:r.compoundIndex,kind:n.kind,name:n.name,negate:r.negate,method:r.signature.method,args:r.signature.args,trigger:s,dynamicFn:r.signature.dynamicFn})},_parseMethod:function(e){var t=e.match(/([^\s]+?)\(([\s\S]*)\)/);if(t){var n={method:t[1],static:!0};if(this.getPropertyInfo(n.method)!==Polymer.nob&&(n.static=!1,n.dynamicFn=!0),t[2].trim()){var r=t[2].replace(/\\,/g,"&comma;").split(",");return this._parseArgs(r,n)}return n.args=Polymer.nar,n}},_parseArgs:function(e,t){return t.args=e.map(function(e){var n=this._parseArg(e);return n.literal||(t.static=!1),n},this),t},_parseArg:function(e){var t=e.trim().replace(/&comma;/g,",").replace(/\\(.)/g,"$1"),n={name:t},r=t[0];switch("-"===r&&(r=t[1]),r>="0"&&r<="9"&&(r="#"),r){case"'":case'"':n.value=t.slice(1,-1),n.literal=!0;break;case"#":n.value=Number(t),n.literal=!0}return n.literal||(n.model=Polymer.Path.root(t),n.structured=Polymer.Path.isDeep(t),n.structured&&(n.wildcard=".*"==t.slice(-2),n.wildcard&&(n.name=t.slice(0,-2)))),n},_marshalInstanceEffects:function(){Polymer.Bind.prepareInstance(this),this._bindListeners&&Polymer.Bind.setupBindListeners(this)},_applyEffectValue:function(e,t){var n=this._nodes[e.index],r=e.name;if(t=this._computeFinalAnnotationValue(n,r,t,e),"attribute"==e.kind)this.serializeValueToAttribute(t,r,n);else{var s=n._propertyInfo&&n._propertyInfo[r];if(s&&s.readOnly)return;this.__setProperty(r,t,Polymer.Settings.suppressBindingNotifications,n)}},_computeFinalAnnotationValue:function(e,t,n,r){if(r.negate&&(n=!n),r.isCompound){var s=e.__compoundStorage__[t];s[r.compoundIndex]=n,n=s.join("")}return"attribute"!==r.kind&&("className"===t&&(n=this._scopeElementClass(e,n)),("textContent"===t||"input"==e.localName&&"value"==t)&&(n=void 0==n?"":n)),n},_executeStaticEffects:function(){this._propertyEffects&&this._propertyEffects.__static__&&this._effectEffects("__static__",null,this._propertyEffects.__static__)}}),function(){var e=Polymer.Settings.usePolyfillProto,t=Boolean(Object.getOwnPropertyDescriptor(document.documentElement,"properties"));Polymer.Base._addFeature({_setupConfigure:function(e){var t=this;if(this._config={},this._handlers=[],this._aboveConfig=null,e)for(var n in e)void 0!==e[n]&&(t._config[n]=e[n])},_marshalAttributes:function(){this._takeAttributesToModel(this._config)},_attributeChangedImpl:function(e){var t=this._clientsReadied?this:this._config;this._setAttributeToProperty(t,e)},_configValue:function(e,t){var n=this._propertyInfo[e];n&&n.readOnly||(this._config[e]=t)},_beforeClientsReady:function(){this._configure()},_configure:function(){var e=this;this._configureAnnotationReferences(),this._configureInstanceProperties(),this._aboveConfig=this.mixin({},this._config);for(var n={},r=0;r<this.behaviors.length;r++)e._configureProperties(e.behaviors[r].properties,n);this._configureProperties(t?this.__proto__.properties:this.properties,n),this.mixin(n,this._aboveConfig),this._config=n,this._clients&&this._clients.length&&this._distributeConfig(this._config)},_configureInstanceProperties:function(){var t=this;for(var n in this._propertyEffects)!e&&t.hasOwnProperty(n)&&(t._configValue(n,t[n]),delete t[n])},_configureProperties:function(e,t){var n=this;for(var r in e){var s=e[r];if(void 0!==s.value){var i=s.value;"function"==typeof i&&(i=i.call(n,n._config)),t[r]=i}}},_distributeConfig:function(e){var t=this,n=this._propertyEffects;if(n)for(var r in e){var s=n[r];if(s)for(var i,o=0,a=s.length;o<a&&(i=s[o]);o++)if("annotation"===i.kind){var l=t._nodes[i.effect.index],c=i.effect.propertyName,h="attribute"==i.effect.kind,u=l._propertyEffects&&l._propertyEffects[c];if(l._configValue&&(u||!h)){var f=r===i.effect.value?e[r]:t._get(i.effect.value,e);f=t._computeFinalAnnotationValue(l,c,f,i.effect),h&&(f=l.deserialize(t.serialize(f),l._propertyInfo[c].type)),l._configValue(c,f)}}}},_afterClientsReady:function(){this.importPath=this._importPath,this.rootPath=Polymer.rootPath,this._executeStaticEffects(),this._applyConfig(this._config,this._aboveConfig),this._flushHandlers()},_applyConfig:function(e,t){var n=this;for(var r in e)void 0===n[r]&&n.__setProperty(r,e[r],r in t)},_notifyListener:function(e,t){if(!Polymer.Bind._isEventBogus(t,t.target)){var n,r;if(t.detail&&(n=t.detail.value,r=t.detail.path),this._clientsReadied)return e.call(this,t.target,n,r);this._queueHandler([e,t.target,n,r])}},_queueHandler:function(e){this._handlers.push(e)},_flushHandlers:function(){for(var e,t=this,n=this._handlers,r=0,s=n.length;r<s&&(e=n[r]);r++)e[0].call(t,e[1],e[2],e[3]);this._handlers=[]}})}(),function(){"use strict";var e=Polymer.Path;Polymer.Base._addFeature({notifyPath:function(e,t,n){var r={},s=this._get(e,this,r);1===arguments.length&&(t=s),r.path&&this._notifyPath(r.path,t,n)},_notifyPath:function(e,t,n){var r=this._propertySetter(e,t);if(r!==t&&(r===r||t===t))return this._pathEffector(e,t),n||this._notifyPathUp(e,t),!0},_getPathParts:function(e){if(Array.isArray(e)){for(var t=[],n=0;n<e.length;n++)for(var r=e[n].toString().split("."),s=0;s<r.length;s++)t.push(r[s]);return t}return e.toString().split(".")},set:function(e,t,n){var r,s=n||this,i=this._getPathParts(e),o=i[i.length-1];if(i.length>1){for(var a=0;a<i.length-1;a++){var l=i[a];if(r&&"#"==l[0]?s=Polymer.Collection.get(r).getItem(l):(s=s[l],r&&parseInt(l,10)==l&&(i[a]=Polymer.Collection.get(r).getKey(s))),!s)return;r=Array.isArray(s)?s:null}if(r){var c,h,u=Polymer.Collection.get(r);"#"==o[0]?(h=o,c=u.getItem(h),o=r.indexOf(c),u.setItem(h,t)):parseInt(o,10)==o&&(c=s[o],h=u.getKey(c),i[a]=h,u.setItem(h,t))}s[o]=t,n||this._notifyPath(i.join("."),t)}else s[e]=t},get:function(e,t){return this._get(e,t)},_get:function(e,t,n){for(var r,s=t||this,i=this._getPathParts(e),o=0;o<i.length;o++){if(!s)return;var a=i[o];r&&"#"==a[0]?s=Polymer.Collection.get(r).getItem(a):(s=s[a],n&&r&&parseInt(a,10)==a&&(i[o]=Polymer.Collection.get(r).getKey(s))),r=Array.isArray(s)?s:null}return n&&(n.path=i.join(".")),s},_pathEffector:function(t,n){var r=this,s=e.root(t),i=this._propertyEffects&&this._propertyEffects[s];if(i)for(var o,a=0;a<i.length&&(o=i[a]);a++){var l=o.pathFn;l&&l.call(r,t,n,o.effect)}this._boundPaths&&this._notifyBoundPaths(t,n)},_annotationPathEffect:function(t,n,r){if(e.matches(r.value,!1,t))Polymer.Bind._annotationEffect.call(this,t,n,r);else if(!r.negate&&e.isDescendant(r.value,t)){var s=this._nodes[r.index];if(s&&s._notifyPath){var i=e.translate(r.value,r.name,t);s._notifyPath(i,n,!0)}}},_complexObserverPathEffect:function(t,n,r){e.matches(r.trigger.name,r.trigger.wildcard,t)&&Polymer.Bind._complexObserverEffect.call(this,t,n,r)},_computePathEffect:function(t,n,r){e.matches(r.trigger.name,r.trigger.wildcard,t)&&Polymer.Bind._computeEffect.call(this,t,n,r)},_annotatedComputationPathEffect:function(t,n,r){e.matches(r.trigger.name,r.trigger.wildcard,t)&&Polymer.Bind._annotatedComputationEffect.call(this,t,n,r)},linkPaths:function(e,t){this._boundPaths=this._boundPaths||{},t?this._boundPaths[e]=t:this.unlinkPaths(e)},unlinkPaths:function(e){this._boundPaths&&delete this._boundPaths[e]},_notifyBoundPaths:function(t,n){var r=this;for(var s in this._boundPaths){var i=r._boundPaths[s];e.isDescendant(s,t)?r._notifyPath(e.translate(s,i,t),n):e.isDescendant(i,t)&&r._notifyPath(e.translate(i,s,t),n)}},_notifyPathUp:function(t,n){var r=e.root(t),s=Polymer.CaseMap.camelToDashCase(r)+this._EVENT_CHANGED;this.fire(s,{path:t,value:n},{bubbles:!1,_useCache:Polymer.Settings.eventDataCache||!Polymer.Settings.isIE})},_EVENT_CHANGED:"-changed",notifySplices:function(e,t){var n={},r=this._get(e,this,n);this._notifySplices(r,n.path,t)},_notifySplices:function(e,t,n){var r={keySplices:Polymer.Collection.applySplices(e,n),indexSplices:n},s=t+".splices";this._notifyPath(s,r),this._notifyPath(t+".length",e.length),this.__data__[s]={keySplices:null,indexSplices:null}},_notifySplice:function(e,t,n,r,s){this._notifySplices(e,t,[{index:n,addedCount:r,removed:s,object:e,type:"splice"}])},push:function(e){var t={},n=this._get(e,this,t),r=Array.prototype.slice.call(arguments,1),s=n.length,i=n.push.apply(n,r);return r.length&&this._notifySplice(n,t.path,s,r.length,[]),i},pop:function(e){var t={},n=this._get(e,this,t),r=Boolean(n.length),s=Array.prototype.slice.call(arguments,1),i=n.pop.apply(n,s);return r&&this._notifySplice(n,t.path,n.length,0,[i]),i},splice:function(e,t){var n={},r=this._get(e,this,n);(t=t<0?r.length-Math.floor(-t):Math.floor(t))||(t=0);var s=Array.prototype.slice.call(arguments,1),i=r.splice.apply(r,s),o=Math.max(s.length-2,0);return(o||i.length)&&this._notifySplice(r,n.path,t,o,i),i},shift:function(e){var t={},n=this._get(e,this,t),r=Boolean(n.length),s=Array.prototype.slice.call(arguments,1),i=n.shift.apply(n,s);return r&&this._notifySplice(n,t.path,0,0,[i]),i},unshift:function(e){var t={},n=this._get(e,this,t),r=Array.prototype.slice.call(arguments,1),s=n.unshift.apply(n,r);return r.length&&this._notifySplice(n,t.path,0,r.length,[]),s},prepareModelNotifyPath:function(e){this.mixin(e,{fire:Polymer.Base.fire,_getEvent:Polymer.Base._getEvent,__eventCache:Polymer.Base.__eventCache,notifyPath:Polymer.Base.notifyPath,_get:Polymer.Base._get,_EVENT_CHANGED:Polymer.Base._EVENT_CHANGED,_notifyPath:Polymer.Base._notifyPath,_notifyPathUp:Polymer.Base._notifyPathUp,_pathEffector:Polymer.Base._pathEffector,_annotationPathEffect:Polymer.Base._annotationPathEffect,_complexObserverPathEffect:Polymer.Base._complexObserverPathEffect,_annotatedComputationPathEffect:Polymer.Base._annotatedComputationPathEffect,_computePathEffect:Polymer.Base._computePathEffect,_notifyBoundPaths:Polymer.Base._notifyBoundPaths,_getPathParts:Polymer.Base._getPathParts})}})}(),Polymer.Base._addFeature({resolveUrl:function(e){return Polymer.ResolveUrl.resolveUrl(e,this._importPath)}}),Polymer.CssParse={parse:function(e){return e=this._clean(e),this._parseCss(this._lex(e),e)},_clean:function(e){return e.replace(this._rx.comments,"").replace(this._rx.port,"")},_lex:function(e){for(var t=this,n={start:0,end:e.length},r=n,s=0,i=e.length;s<i;s++)switch(e[s]){case t.OPEN_BRACE:r.rules||(r.rules=[]);var o=r;r={start:s+1,parent:o,previous:o.rules[o.rules.length-1]},o.rules.push(r);break;case t.CLOSE_BRACE:r.end=s+1,r=r.parent||n}return n},_parseCss:function(e,t){var n=this,r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var s=e.previous?e.previous.end:e.parent.start;r=t.substring(s,e.start-1),r=(r=(r=this._expandUnicodeEscapes(r)).replace(this._rx.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var i=e.parsedSelector=e.selector=r.trim();e.atRule=0===i.indexOf(this.AT_START),e.atRule?0===i.indexOf(this.MEDIA_START)?e.type=this.types.MEDIA_RULE:i.match(this._rx.keyframesRule)&&(e.type=this.types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(this._rx.multipleSpaces).pop()):0===i.indexOf(this.VAR_START)?e.type=this.types.MIXIN_RULE:e.type=this.types.STYLE_RULE}var o=e.rules;if(o)for(var a,l=0,c=o.length;l<c&&(a=o[l]);l++)n._parseCss(a,t);return e},_expandUnicodeEscapes:function(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e})},stringify:function(e,t,n){var r=this;n=n||"";var s="";if(e.cssText||e.rules){var i=e.rules;if(i&&!this._hasMixinRules(i))for(var o,a=0,l=i.length;a<l&&(o=i[a]);a++)s=r.stringify(o,t,s);else(s=(s=t?e.cssText:this.removeCustomProps(e.cssText)).trim())&&(s="  "+s+"\n")}return s&&(e.selector&&(n+=e.selector+" "+this.OPEN_BRACE+"\n"),n+=s,e.selector&&(n+=this.CLOSE_BRACE+"\n\n")),n},_hasMixinRules:function(e){return 0===e[0].selector.indexOf(this.VAR_START)},removeCustomProps:function(e){return e=this.removeCustomPropAssignment(e),this.removeCustomPropApply(e)},removeCustomPropAssignment:function(e){return e.replace(this._rx.customProp,"").replace(this._rx.mixinProp,"")},removeCustomPropApply:function(e){return e.replace(this._rx.mixinApply,"").replace(this._rx.varApply,"")},types:{STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE:"{",CLOSE_BRACE:"}",_rx:{comments:/\/\*[^*]*\*+([^\/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START:"--",MEDIA_START:"@media",AT_START:"@"},Polymer.StyleUtil=function(){var e=Polymer.Settings;return{NATIVE_VARIABLES:Polymer.Settings.useNativeCSSProperties,MODULE_STYLES_SELECTOR:"style, link[rel=import][type~=css], template",INCLUDE_ATTR:"include",toCssText:function(e,t){return"string"==typeof e&&(e=this.parser.parse(e)),t&&this.forEachRule(e,t),this.parser.stringify(e,this.NATIVE_VARIABLES)},forRulesInStyles:function(e,t,n){var r=this;if(e)for(var s,i=0,o=e.length;i<o&&(s=e[i]);i++)r.forEachRuleInStyle(s,t,n)},forActiveRulesInStyles:function(e,t,n){var r=this;if(e)for(var s,i=0,o=e.length;i<o&&(s=e[i]);i++)r.forEachRuleInStyle(s,t,n,!0)},rulesForStyle:function(e){return!e.__cssRules&&e.textContent&&(e.__cssRules=this.parser.parse(e.textContent)),e.__cssRules},isKeyframesSelector:function(e){return e.parent&&e.parent.type===this.ruleTypes.KEYFRAMES_RULE},forEachRuleInStyle:function(e,t,n,r){var s,i,o=this.rulesForStyle(e);t&&(s=function(n){t(n,e)}),n&&(i=function(t){n(t,e)}),this.forEachRule(o,s,i,r)},forEachRule:function(e,t,n,r){var s=this;if(e){var i=!1;if(r&&e.type===this.ruleTypes.MEDIA_RULE){var o=e.selector.match(this.rx.MEDIA_MATCH);o&&(window.matchMedia(o[1]).matches||(i=!0))}e.type===this.ruleTypes.STYLE_RULE?t(e):n&&e.type===this.ruleTypes.KEYFRAMES_RULE?n(e):e.type===this.ruleTypes.MIXIN_RULE&&(i=!0);var a=e.rules;if(a&&!i)for(var l,c=0,h=a.length;c<h&&(l=a[c]);c++)s.forEachRule(l,t,n,r)}},applyCss:function(e,t,n,r){var s=this.createScopeStyle(e,t);return this.applyStyle(s,n,r)},applyStyle:function(e,t,n){t=t||document.head;var r=n&&n.nextSibling||t.firstChild;return this.__lastHeadApplyNode=e,t.insertBefore(e,r)},createScopeStyle:function(e,t){var n=document.createElement("style");return t&&n.setAttribute("scope",t),n.textContent=e,n},__lastHeadApplyNode:null,applyStylePlaceHolder:function(e){var t=document.createComment(" Shady DOM styles for "+e+" "),n=this.__lastHeadApplyNode?this.__lastHeadApplyNode.nextSibling:null,r=document.head;return r.insertBefore(t,n||r.firstChild),this.__lastHeadApplyNode=t,t},cssFromModules:function(e,t){for(var n=this,r=e.trim().split(" "),s="",i=0;i<r.length;i++)s+=n.cssFromModule(r[i],t);return s},cssFromModule:function(e,t){var n=Polymer.DomModule.import(e);return n&&!n._cssText&&(n._cssText=this.cssFromElement(n)),!n&&t&&console.warn("Could not find style data in module named",e),n&&n._cssText||""},cssFromElement:function(e){for(var t,n=this,r="",s=e.content||e,i=Polymer.TreeApi.arrayCopy(s.querySelectorAll(this.MODULE_STYLES_SELECTOR)),o=0;o<i.length;o++)if("template"===(t=i[o]).localName)t.hasAttribute("preserve-content")||(r+=n.cssFromElement(t));else if("style"===t.localName){var a=t.getAttribute(n.INCLUDE_ATTR);a&&(r+=n.cssFromModules(a,!0)),(t=t.__appliedElement||t).parentNode.removeChild(t),r+=n.resolveCss(t.textContent,e.ownerDocument)}else t.import&&t.import.body&&(r+=n.resolveCss(t.import.body.textContent,t.import));return r},styleIncludesToTemplate:function(e){for(var t,n=this,r=e.content.querySelectorAll("style[include]"),s=0;s<r.length;s++)(t=r[s]).parentNode.insertBefore(n._includesToFragment(t.getAttribute("include")),t)},_includesToFragment:function(e){for(var t=this,n=e.trim().split(" "),r=document.createDocumentFragment(),s=0;s<n.length;s++){var i=Polymer.DomModule.import(n[s],"template");i&&t._addStylesToFragment(r,i.content)}return r},_addStylesToFragment:function(e,t){for(var n,r=this,s=t.querySelectorAll("style"),i=0;i<s.length;i++){var o=(n=s[i]).getAttribute("include");o&&e.appendChild(r._includesToFragment(o)),n.textContent&&e.appendChild(n.cloneNode(!0))}},isTargetedBuild:function(t){return e.useNativeShadow?"shadow"===t:"shady"===t},cssBuildTypeForModule:function(e){var t=Polymer.DomModule.import(e);if(t)return this.getCssBuildType(t)},getCssBuildType:function(e){return e.getAttribute("css-build")},_findMatchingParen:function(e,t){for(var n=0,r=t,s=e.length;r<s;r++)switch(e[r]){case"(":n++;break;case")":if(0==--n)return r}return-1},processVariableAndFallback:function(e,t){var n=e.indexOf("var(");if(-1===n)return t(e,"","","");var r=this._findMatchingParen(e,n+3),s=e.substring(n+4,r),i=e.substring(0,n),o=this.processVariableAndFallback(e.substring(r+1),t),a=s.indexOf(",");return-1===a?t(i,s.trim(),"",o):t(i,s.substring(0,a).trim(),s.substring(a+1).trim(),o)},rx:{VAR_ASSIGN:/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:([^;{]*)|{([^}]*)})(?:(?=[;\s}])|$)/gi,MIXIN_MATCH:/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi,VAR_CONSUMED:/(--[\w-]+)\s*([:,;)]|$)/gi,ANIMATION_MATCH:/(animation\s*:)|(animation-name\s*:)/,MEDIA_MATCH:/@media[^(]*(\([^)]*\))/,IS_VAR:/^--/,BRACKETED:/\{[^}]*\}/g,HOST_PREFIX:"(?:^|[^.#[:])",HOST_SUFFIX:"($|[.:[\\s>+~])"},resolveCss:Polymer.ResolveUrl.resolveCss,parser:Polymer.CssParse,ruleTypes:Polymer.CssParse.types}}(),Polymer.StyleTransformer=function(){var e=Polymer.StyleUtil,t=Polymer.Settings,n={dom:function(e,t,n,r){this._transformDom(e,t||"",n,r)},_transformDom:function(e,t,n,r){var s=this;e.setAttribute&&this.element(e,t,n,r);for(var i=Polymer.dom(e).childNodes,o=0;o<i.length;o++)s._transformDom(i[o],t,n,r)},element:function(e,t,n,s){if(n)s?e.removeAttribute(r):e.setAttribute(r,t);else if(t)if(e.classList)s?(e.classList.remove(r),e.classList.remove(t)):(e.classList.add(r),e.classList.add(t));else if(e.getAttribute){var i=e.getAttribute(g);s?i&&e.setAttribute(g,i.replace(r,"").replace(t,"")):e.setAttribute(g,(i?i+" ":"")+r+" "+t)}},elementStyles:function(n,r){var s,i=this,o=n._styles,a="",l=n.__cssBuild,h=t.useNativeShadow||"shady"===l;if(h){var u=this;s=function(e){e.selector=u._slottedToContent(e.selector),e.selector=e.selector.replace(c,":host > *"),r&&r(e)}}for(var f,p=0,_=o.length;p<_&&(f=o[p]);p++){var d=e.rulesForStyle(f);a+=h?e.toCssText(d,s):i.css(d,n.is,n.extends,r,n._scopeCssViaAttr)+"\n\n"}return a.trim()},css:function(t,n,r,s,i){var o=this._calcHostScope(n,r);n=this._calcElementScope(n,i);var a=this;return e.toCssText(t,function(e){e.isScoped||(a.rule(e,n,o),e.isScoped=!0),s&&s(e,n,o)})},_calcElementScope:function(e,t){return e?t?m+e+y:d+e:""},_calcHostScope:function(e,t){return t?"[is="+e+"]":e},rule:function(e,t,n){this._transformRule(e,this._transformComplexSelector,t,n)},_transformRule:function(e,t,n,r){e.selector=e.transformedSelector=this._transformRuleCss(e,t,n,r)},_transformRuleCss:function(t,n,r,s){var o=this,a=t.selector.split(i);if(!e.isKeyframesSelector(t))for(var l,c=0,h=a.length;c<h&&(l=a[c]);c++)a[c]=n.call(o,l,r,s);return a.join(i)},_transformComplexSelector:function(e,t,n){var r=!1,s=!1,a=this;return e=e.trim(),e=this._slottedToContent(e),e=e.replace(c,":host > *"),e=e.replace(P,l+" $1"),e=e.replace(o,function(e,i,o){if(r)o=o.replace(_," ");else{var l=a._transformCompoundSelector(o,i,t,n);r=r||l.stop,s=s||l.hostContext,i=l.combinator,o=l.value}return i+o}),s&&(e=e.replace(f,function(e,t,r,s){return t+r+" "+n+s+i+" "+t+n+r+s})),e},_transformCompoundSelector:function(e,t,n,r){var s=e.search(_),i=!1;e.indexOf(u)>=0?i=!0:e.indexOf(l)>=0?e=this._transformHostSelector(e,r):0!==s&&(e=n?this._transformSimpleSelector(e,n):e),e.indexOf(p)>=0&&(t="");var o;return s>=0&&(e=e.replace(_," "),o=!0),{value:e,combinator:t,stop:o,hostContext:i}},_transformSimpleSelector:function(e,t){var n=e.split(v);return n[0]+=t,n.join(v)},_transformHostSelector:function(e,t){var n=e.match(h),r=n&&n[2].trim()||"";return r?r[0].match(a)?e.replace(h,function(e,n,r){return t+r}):r.split(a)[0]===t?r:S:e.replace(l,t)},documentRule:function(e){e.selector=e.parsedSelector,this.normalizeRootSelector(e),t.useNativeShadow||this._transformRule(e,this._transformDocumentSelector)},normalizeRootSelector:function(e){e.selector=e.selector.replace(c,"html");var t=e.selector.split(i);t=t.filter(function(e){return!e.match(C)}),e.selector=t.join(i)},_transformDocumentSelector:function(e){return e.match(_)?this._transformComplexSelector(e,s):this._transformSimpleSelector(e.trim(),s)},_slottedToContent:function(e){return e.replace(E,p+"> $1")},SCOPE_NAME:"style-scope"},r=n.SCOPE_NAME,s=":not(["+r+"]):not(."+r+")",i=",",o=/(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=\[])+)/g,a=/[[.:#*]/,l=":host",c=":root",h=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,u=":host-context",f=/(.*)(?::host-context)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))(.*)/,p="::content",_=/::content|::shadow|\/deep\//,d=".",m="["+r+"~=",y="]",v=":",g="class",P=new RegExp("^("+p+")"),S="should_not_match",E=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/g,C=/:host(?:\s*>\s*\*)?/;return n}(),Polymer.StyleExtends=function(){var e=Polymer.StyleUtil;return{hasExtends:function(e){return Boolean(e.match(this.rx.EXTEND))},transform:function(t){var n=e.rulesForStyle(t),r=this;return e.forEachRule(n,function(e){if(r._mapRuleOntoParent(e),e.parent)for(var t;t=r.rx.EXTEND.exec(e.cssText);){var n=t[1],s=r._findExtendor(n,e);s&&r._extendRule(e,s)}e.cssText=e.cssText.replace(r.rx.EXTEND,"")}),e.toCssText(n,function(e){e.selector.match(r.rx.STRIP)&&(e.cssText="")},!0)},_mapRuleOntoParent:function(e){if(e.parent){for(var t=e.parent.map||(e.parent.map={}),n=e.selector.split(","),r=0;r<n.length;r++)t[n[r].trim()]=e;return t}},_findExtendor:function(e,t){return t.parent&&t.parent.map&&t.parent.map[e]||this._findExtendor(e,t.parent)},_extendRule:function(e,t){e.parent!==t.parent&&this._cloneAndAddRuleToParent(t,e.parent),e.extends=e.extends||[],e.extends.push(t),t.selector=t.selector.replace(this.rx.STRIP,""),t.selector=(t.selector&&t.selector+",\n")+e.selector,t.extends&&t.extends.forEach(function(t){this._extendRule(e,t)},this)},_cloneAndAddRuleToParent:function(e,t){(e=Object.create(e)).parent=t,e.extends&&(e.extends=e.extends.slice()),t.rules.push(e)},rx:{EXTEND:/@extends\(([^)]*)\)\s*?;/gim,STRIP:/%[^,]*$/}}}(),Polymer.ApplyShim=function(){"use strict";function e(e,t){e=e.trim(),m[e]={properties:t,dependants:{}}}function t(e){return e=e.trim(),m[e]}function n(e,t){var n=_.exec(t);return n&&(t=n[1]?y._getInitialValueForProperty(e):"apply-shim-inherit"),t}function r(e){for(var t,r,s,i,o=e.split(";"),a={},l=0;l<o.length;l++)(s=o[l])&&(i=s.split(":")).length>1&&(r=n(t=i[0].trim(),i.slice(1).join(":")),a[t]=r);return a}function s(e){var t=y.__currentElementProto,n=t&&t.is;for(var r in e.dependants)r!==n&&(e.dependants[r].__applyShimInvalid=!0)}function i(n,i,o,a){if(o&&c.processVariableAndFallback(o,function(e,n){n&&t(n)&&(a="@apply "+n+";")}),!a)return n;var h=l(a),u=n.slice(0,n.indexOf("--")),f=r(h),p=f,_=t(i),m=_&&_.properties;m?(p=Object.create(m),p=Polymer.Base.mixin(p,f)):e(i,p);var y,v,g=[],P=!1;for(y in p)void 0===(v=f[y])&&(v="initial"),!m||y in m||(P=!0),g.push(i+d+y+": "+v);return P&&s(_),_&&(_.properties=p),o&&(u=n+";"+u),u+g.join("; ")+";"}function o(e,t,n){return"var("+t+",var("+n+"))"}function a(n,r){var s=[],i=t(n=n.replace(p,""));if(i||(e(n,{}),i=t(n)),i){var o=y.__currentElementProto;o&&(i.dependants[o.is]=o);var a,l,c;for(a in i.properties)c=r&&r[a],l=[a,": var(",n,d,a],c&&l.push(",",c),l.push(")"),s.push(l.join(""))}return s.join("; ")}function l(e){for(var t;t=h.exec(e);){var n=t[0],s=t[1],i=t.index,o=i+n.indexOf("@apply"),l=i+n.length,c=e.slice(0,o),u=e.slice(l),f=a(s,r(c));e=[c,f,u].join(""),h.lastIndex=i+f.length}return e}var c=Polymer.StyleUtil,h=c.rx.MIXIN_MATCH,u=c.rx.VAR_ASSIGN,f=/var\(\s*(--[^,]*),\s*(--[^)]*)\)/g,p=/;\s*/m,_=/^\s*(initial)|(inherit)\s*$/,d="_-_",m={},y={_measureElement:null,_map:m,_separator:d,transform:function(e,t){this.__currentElementProto=t,c.forRulesInStyles(e,this._boundFindDefinitions),c.forRulesInStyles(e,this._boundFindApplications),t&&(t.__applyShimInvalid=!1),this.__currentElementProto=null},_findDefinitions:function(e){var t=e.parsedCssText;t=(t=t.replace(f,o)).replace(u,i),e.cssText=t,":root"===e.selector&&(e.selector=":host > *")},_findApplications:function(e){e.cssText=l(e.cssText)},transformRule:function(e){this._findDefinitions(e),this._findApplications(e)},_getInitialValueForProperty:function(e){return this._measureElement||(this._measureElement=document.createElement("meta"),this._measureElement.style.all="initial",document.head.appendChild(this._measureElement)),window.getComputedStyle(this._measureElement).getPropertyValue(e)}};return y._boundTransformRule=y.transformRule.bind(y),y._boundFindDefinitions=y._findDefinitions.bind(y),y._boundFindApplications=y._findApplications.bind(y),y}(),function(){var e=Polymer.Base._prepElement,t=Polymer.Settings.useNativeShadow,n=Polymer.StyleUtil,r=Polymer.StyleTransformer,s=Polymer.StyleExtends,i=Polymer.ApplyShim,o=Polymer.Settings;Polymer.Base._addFeature({_prepElement:function(t){this._encapsulateStyle&&"shady"!==this.__cssBuild&&r.element(t,this.is,this._scopeCssViaAttr),e.call(this,t)},_prepStyles:function(){void 0===this._encapsulateStyle&&(this._encapsulateStyle=!t),t||(this._scopeStyle=n.applyStylePlaceHolder(this.is)),this.__cssBuild=n.cssBuildTypeForModule(this.is)},_prepShimStyles:function(){if(this._template){var e=n.isTargetedBuild(this.__cssBuild);if(o.useNativeCSSProperties&&"shadow"===this.__cssBuild&&e)return void(o.preserveStyleIncludes&&n.styleIncludesToTemplate(this._template));this._styles=this._styles||this._collectStyles(),o.useNativeCSSProperties&&!this.__cssBuild&&i.transform(this._styles,this);var s=o.useNativeCSSProperties&&e?this._styles.length&&this._styles[0].textContent.trim():r.elementStyles(this);this._prepStyleProperties(),!this._needsStyleProperties()&&s&&n.applyCss(s,this.is,t?this._template.content:null,this._scopeStyle)}else this._styles=[]},_collectStyles:function(){var e=[],t="",r=this.styleModules;if(r)for(var i,o=0,a=r.length;o<a&&(i=r[o]);o++)t+=n.cssFromModule(i);t+=n.cssFromModule(this.is);var l=this._template&&this._template.parentNode;if(!this._template||l&&l.id.toLowerCase()===this.is||(t+=n.cssFromElement(this._template)),t){var c=document.createElement("style");c.textContent=t,s.hasExtends(c.textContent)&&(t=s.transform(c)),e.push(c)}return e},_elementAdd:function(e){this._encapsulateStyle&&(e.__styleScoped?e.__styleScoped=!1:r.dom(e,this.is,this._scopeCssViaAttr))},_elementRemove:function(e){this._encapsulateStyle&&r.dom(e,this.is,this._scopeCssViaAttr,!0)},scopeSubtree:function(e,n){if(!t){var r=this,s=function(e){if(e.nodeType===Node.ELEMENT_NODE){var t=e.getAttribute("class");e.setAttribute("class",r._scopeElementClass(e,t));for(var n,s=e.querySelectorAll("*"),i=0;i<s.length&&(n=s[i]);i++)t=n.getAttribute("class"),n.setAttribute("class",r._scopeElementClass(n,t))}};if(s(e),n){var i=new MutationObserver(function(e){for(var t,n=0;n<e.length&&(t=e[n]);n++)if(t.addedNodes)for(var r=0;r<t.addedNodes.length;r++)s(t.addedNodes[r])});return i.observe(e,{childList:!0,subtree:!0}),i}}}})}(),Polymer.StyleProperties=function(){"use strict";function e(e,t){var n=parseInt(e/32),r=1<<e%32;t[n]=(t[n]||0)|r}var t=Polymer.DomApi.matchesSelector,n=Polymer.StyleUtil,r=Polymer.StyleTransformer,s=navigator.userAgent.match("Trident"),i=Polymer.Settings;return{decorateStyles:function(e,t){var s=this,i={},o=[],a=0,l=r._calcHostScope(t.is,t.extends);n.forRulesInStyles(e,function(e,r){s.decorateRule(e),e.index=a++,s.whenHostOrRootRule(t,e,r,function(r){if(e.parent.type===n.ruleTypes.MEDIA_RULE&&(t.__notStyleScopeCacheable=!0),r.isHost){var s=r.selector.split(" ").some(function(e){return 0===e.indexOf(l)&&e.length!==l.length});t.__notStyleScopeCacheable=t.__notStyleScopeCacheable||s}}),s.collectPropertiesInCssText(e.propertyInfo.cssText,i)},function(e){o.push(e)}),e._keyframes=o;var c=[];for(var h in i)c.push(h);return c},decorateRule:function(e){if(e.propertyInfo)return e.propertyInfo;var t={},n={};return this.collectProperties(e,n)&&(t.properties=n,e.rules=null),t.cssText=this.collectCssText(e),e.propertyInfo=t,t},collectProperties:function(e,t){var n=e.propertyInfo;if(!n){for(var r,s,i,o=this.rx.VAR_ASSIGN,a=e.parsedCssText;r=o.exec(a);)"inherit"!==(s=(r[2]||r[3]).trim())&&(t[r[1].trim()]=s),i=!0;return i}if(n.properties)return Polymer.Base.mixin(t,n.properties),!0},collectCssText:function(e){return this.collectConsumingCssText(e.parsedCssText)},collectConsumingCssText:function(e){return e.replace(this.rx.BRACKETED,"").replace(this.rx.VAR_ASSIGN,"")},collectPropertiesInCssText:function(e,t){for(var n;n=this.rx.VAR_CONSUMED.exec(e);){var r=n[1];":"!==n[2]&&(t[r]=!0)}},reify:function(e){for(var t,n=this,r=Object.getOwnPropertyNames(e),s=0;s<r.length;s++)e[t=r[s]]=n.valueForProperty(e[t],e)},valueForProperty:function(e,t){if(e)if(e.indexOf(";")>=0)e=this.valueForProperties(e,t);else{var r=this;e=n.processVariableAndFallback(e,function(e,n,s,i){var o=r.valueForProperty(t[n],t);return o&&"initial"!==o?"apply-shim-inherit"===o&&(o="inherit"):o=r.valueForProperty(t[s]||s,t)||s,e+(o||"")+i})}return e&&e.trim()||""},valueForProperties:function(e,t){for(var n,r,s=this,i=e.split(";"),o=0;o<i.length;o++)if(n=i[o]){if(s.rx.MIXIN_MATCH.lastIndex=0,r=s.rx.MIXIN_MATCH.exec(n))n=s.valueForProperty(t[r[1]],t);else{var a=n.indexOf(":");if(-1!==a){var l=n.substring(a);l=l.trim(),l=s.valueForProperty(l,t)||l,n=n.substring(0,a)+l}}i[o]=n&&n.lastIndexOf(";")===n.length-1?n.slice(0,-1):n||""}return i.join(";")},applyProperties:function(e,t){var n="";e.propertyInfo||this.decorateRule(e),e.propertyInfo.cssText&&(n=this.valueForProperties(e.propertyInfo.cssText,t)),e.cssText=n},applyKeyframeTransforms:function(e,t){var n=e.cssText,r=e.cssText;if(null==e.hasAnimations&&(e.hasAnimations=this.rx.ANIMATION_MATCH.test(n)),e.hasAnimations){if(null==e.keyframeNamesToTransform){e.keyframeNamesToTransform=[];for(var s in t)n!==(r=(0,t[s])(n))&&(n=r,e.keyframeNamesToTransform.push(s))}else{for(var i=0;i<e.keyframeNamesToTransform.length;++i)n=(0,t[e.keyframeNamesToTransform[i]])(n);r=n}}e.cssText=r},propertyDataFromStyles:function(r,s){var i={},o=this,a=[];return n.forActiveRulesInStyles(r,function(n){n.propertyInfo||o.decorateRule(n);var r=n.transformedSelector||n.parsedSelector;s&&n.propertyInfo.properties&&r&&t.call(s,r)&&(o.collectProperties(n,i),e(n.index,a))}),{properties:i,key:a}},_rootSelector:/:root|:host\s*>\s*\*/,_checkRoot:function(e,t){return Boolean(t.match(this._rootSelector))||"html"===e&&t.indexOf("html")>-1},whenHostOrRootRule:function(e,t,n,s){if(t.propertyInfo||self.decorateRule(t),t.propertyInfo.properties){var o=e.is?r._calcHostScope(e.is,e.extends):"html",a=t.parsedSelector,l=this._checkRoot(o,a),c=!l&&0===a.indexOf(":host");if("shady"===(e.__cssBuild||n.__cssBuild)&&(c=!(l=a===o+" > *."+o||a.indexOf("html")>-1)&&0===a.indexOf(o)),l||c){var h=o;c&&(i.useNativeShadow&&!t.transformedSelector&&(t.transformedSelector=r._transformRuleCss(t,r._transformComplexSelector,e.is,o)),h=t.transformedSelector||t.parsedSelector),l&&"html"===o&&(h=t.transformedSelector||t.parsedSelector),s({selector:h,isHost:c,isRoot:l})}}},hostAndRootPropertiesForScope:function(e){var r={},s={},i=this;return n.forActiveRulesInStyles(e._styles,function(n,o){i.whenHostOrRootRule(e,n,o,function(o){var a=e._element||e;t.call(a,o.selector)&&(o.isHost?i.collectProperties(n,r):i.collectProperties(n,s))})}),{rootProps:s,hostProps:r}},transformStyles:function(e,t,n){var s=this,o=r._calcHostScope(e.is,e.extends),a=e.extends?"\\"+o.slice(0,-1)+"\\]":o,l=new RegExp(this.rx.HOST_PREFIX+a+this.rx.HOST_SUFFIX),c=this._elementKeyframeTransforms(e,n);return r.elementStyles(e,function(r){s.applyProperties(r,t),i.useNativeShadow||Polymer.StyleUtil.isKeyframesSelector(r)||!r.cssText||(s.applyKeyframeTransforms(r,c),s._scopeSelector(r,l,o,e._scopeCssViaAttr,n))})},_elementKeyframeTransforms:function(e,t){var n=this,r=e._styles._keyframes,s={};if(!i.useNativeShadow&&r)for(var o=0,a=r[o];o<r.length;a=r[++o])n._scopeKeyframes(a,t),s[a.keyframesName]=n._keyframesRuleTransformer(a);return s},_keyframesRuleTransformer:function(e){return function(t){return t.replace(e.keyframesNameRx,e.transformedKeyframesName)}},_scopeKeyframes:function(e,t){e.keyframesNameRx=new RegExp(e.keyframesName,"g"),e.transformedKeyframesName=e.keyframesName+"-"+t,e.transformedSelector=e.transformedSelector||e.selector,e.selector=e.transformedSelector.replace(e.keyframesName,e.transformedKeyframesName)},_scopeSelector:function(e,t,n,s,i){e.transformedSelector=e.transformedSelector||e.selector;for(var o,a=e.transformedSelector,l=s?"["+r.SCOPE_NAME+"~="+i+"]":"."+i,c=a.split(","),h=0,u=c.length;h<u&&(o=c[h]);h++)c[h]=o.match(t)?o.replace(n,l):l+" "+o;e.selector=c.join(",")},applyElementScopeSelector:function(e,t,n,s){var i=s?e.getAttribute(r.SCOPE_NAME):e.getAttribute("class")||"",o=n?i.replace(n,t):(i?i+" ":"")+this.XSCOPE_NAME+" "+t;i!==o&&(s?e.setAttribute(r.SCOPE_NAME,o):e.setAttribute("class",o))},applyElementStyle:function(e,t,r,o){var a=o?o.textContent||"":this.transformStyles(e,t,r),l=e._customStyle;return l&&!i.useNativeShadow&&l!==o&&(l._useCount--,l._useCount<=0&&l.parentNode&&l.parentNode.removeChild(l)),i.useNativeShadow?e._customStyle?(e._customStyle.textContent=a,o=e._customStyle):a&&(o=n.applyCss(a,r,e.root,e._scopeStyle)):o?o.parentNode||(s&&a.indexOf("@media")>-1&&(o.textContent=a),n.applyStyle(o,null,e._scopeStyle)):a&&(o=n.applyCss(a,r,null,e._scopeStyle)),o&&(o._useCount=o._useCount||0,e._customStyle!=o&&o._useCount++,e._customStyle=o),o},mixinCustomStyle:function(e,t){var n;for(var r in t)((n=t[r])||0===n)&&(e[r]=n)},updateNativeStyleProperties:function(e,t){var n=e.__customStyleProperties;if(n)for(var r=0;r<n.length;r++)e.style.removeProperty(n[r]);var s=[];for(var i in t)null!==t[i]&&(e.style.setProperty(i,t[i]),s.push(i));e.__customStyleProperties=s},rx:n.rx,XSCOPE_NAME:"x-scope"}}(),Polymer.StyleCache=function(){this.cache={}},Polymer.StyleCache.prototype={MAX:100,store:function(e,t,n,r){t.keyValues=n,t.styles=r;var s=this.cache[e]=this.cache[e]||[];s.push(t),s.length>this.MAX&&s.shift()},retrieve:function(e,t,n){var r=this,s=this.cache[e];if(s)for(var i,o=s.length-1;o>=0;o--)if(i=s[o],n===i.styles&&r._objectsEqual(t,i.keyValues))return i},clear:function(){this.cache={}},_objectsEqual:function(e,t){var n,r,s=this;for(var i in e)if(n=e[i],r=t[i],!("object"==typeof n&&n?s._objectsStrictlyEqual(n,r):n===r))return!1;return!Array.isArray(e)||e.length===t.length},_objectsStrictlyEqual:function(e,t){return this._objectsEqual(e,t)&&this._objectsEqual(t,e)}},Polymer.StyleDefaults=function(){var e=Polymer.StyleProperties,t=Polymer.StyleCache,n=Polymer.Settings.useNativeCSSProperties;return{_styles:[],_properties:null,customStyle:{},_styleCache:new t,_element:Polymer.DomApi.wrap(document.documentElement),addStyle:function(e){this._styles.push(e),this._properties=null},get _styleProperties(){return this._properties||(e.decorateStyles(this._styles,this),this._styles._scopeStyleProperties=null,this._properties=e.hostAndRootPropertiesForScope(this).rootProps,e.mixinCustomStyle(this._properties,this.customStyle),e.reify(this._properties)),this._properties},hasStyleProperties:function(){return Boolean(this._properties)},_needsStyleProperties:function(){},_computeStyleProperties:function(){return this._styleProperties},updateStyles:function(t){var r=this;this._properties=null,t&&Polymer.Base.mixin(this.customStyle,t),this._styleCache.clear();for(var s,i=0;i<this._styles.length;i++)(s=(s=r._styles[i]).__importElement||s)._apply();n&&e.updateNativeStyleProperties(document.documentElement,this.customStyle)}}}(),function(){"use strict";var e=Polymer.Base.serializeValueToAttribute,t=Polymer.StyleProperties,n=Polymer.StyleTransformer,r=Polymer.StyleDefaults,s=Polymer.Settings.useNativeShadow,i=Polymer.Settings.useNativeCSSProperties;Polymer.Base._addFeature({_prepStyleProperties:function(){i||(this._ownStylePropertyNames=this._styles&&this._styles.length?t.decorateStyles(this._styles,this):null)},customStyle:null,getComputedStyleValue:function(e){return i||this._styleProperties||this._computeStyleProperties(),!i&&this._styleProperties&&this._styleProperties[e]||getComputedStyle(this).getPropertyValue(e)},_setupStyleProperties:function(){this.customStyle={},this._styleCache=null,this._styleProperties=null,this._scopeSelector=null,this._ownStyleProperties=null,this._customStyle=null},_needsStyleProperties:function(){return Boolean(!i&&this._ownStylePropertyNames&&this._ownStylePropertyNames.length)},_validateApplyShim:function(){if(this.__applyShimInvalid){Polymer.ApplyShim.transform(this._styles,this.__proto__);var e=n.elementStyles(this);if(s){var t=this._template.content.querySelector("style");t&&(t.textContent=e)}else{var r=this._scopeStyle&&this._scopeStyle.nextSibling;r&&(r.textContent=e)}}},_beforeAttached:function(){this._scopeSelector&&!this.__stylePropertiesInvalid||!this._needsStyleProperties()||(this.__stylePropertiesInvalid=!1,this._updateStyleProperties())},_findStyleHost:function(){for(var e,t=this;e=Polymer.dom(t).getOwnerRoot();){if(Polymer.isInstance(e.host))return e.host;t=e.host}return r},_updateStyleProperties:function(){var e,n=this._findStyleHost();n._styleProperties||n._computeStyleProperties(),n._styleCache||(n._styleCache=new Polymer.StyleCache);var r=t.propertyDataFromStyles(n._styles,this),i=!this.__notStyleScopeCacheable;i&&(r.key.customStyle=this.customStyle,e=n._styleCache.retrieve(this.is,r.key,this._styles));var a=Boolean(e);a?this._styleProperties=e._styleProperties:this._computeStyleProperties(r.properties),this._computeOwnStyleProperties(),a||(e=o.retrieve(this.is,this._ownStyleProperties,this._styles));var l=Boolean(e)&&!a,c=this._applyStyleProperties(e);a||(e={style:c=c&&s?c.cloneNode(!0):c,_scopeSelector:this._scopeSelector,_styleProperties:this._styleProperties},i&&(r.key.customStyle={},this.mixin(r.key.customStyle,this.customStyle),n._styleCache.store(this.is,e,r.key,this._styles)),l||o.store(this.is,Object.create(e),this._ownStyleProperties,this._styles))},_computeStyleProperties:function(e){var n=this._findStyleHost();n._styleProperties||n._computeStyleProperties();var r=Object.create(n._styleProperties),s=t.hostAndRootPropertiesForScope(this);this.mixin(r,s.hostProps),e=e||t.propertyDataFromStyles(n._styles,this).properties,this.mixin(r,e),this.mixin(r,s.rootProps),t.mixinCustomStyle(r,this.customStyle),t.reify(r),this._styleProperties=r},_computeOwnStyleProperties:function(){for(var e,t=this,n={},r=0;r<this._ownStylePropertyNames.length;r++)n[e=t._ownStylePropertyNames[r]]=t._styleProperties[e];this._ownStyleProperties=n},_scopeCount:0,_applyStyleProperties:function(e){var n=this._scopeSelector;this._scopeSelector=e?e._scopeSelector:this.is+"-"+this.__proto__._scopeCount++;var r=t.applyElementStyle(this,this._styleProperties,this._scopeSelector,e&&e.style);return s||t.applyElementScopeSelector(this,this._scopeSelector,n,this._scopeCssViaAttr),r},serializeValueToAttribute:function(t,n,r){if(r=r||this,"class"===n&&!s){var i=r===this?this.domHost||this.dataHost:this;i&&(t=i._scopeElementClass(r,t))}r=this.shadyRoot&&this.shadyRoot._hasDistributed?Polymer.dom(r):r,e.call(this,t,n,r)},_scopeElementClass:function(e,t){return s||this._scopeCssViaAttr||(t=(t?t+" ":"")+a+" "+this.is+(e._scopeSelector?" "+l+" "+e._scopeSelector:"")),t},updateStyles:function(e){e&&this.mixin(this.customStyle,e),i?t.updateNativeStyleProperties(this,this.customStyle):(this.isAttached?this._needsStyleProperties()?this._updateStyleProperties():this._styleProperties=null:this.__stylePropertiesInvalid=!0,this._styleCache&&this._styleCache.clear(),this._updateRootStyles())},_updateRootStyles:function(e){e=e||this.root;for(var t,n=Polymer.dom(e)._query(function(e){return e.shadyRoot||e.shadowRoot}),r=0,s=n.length;r<s&&(t=n[r]);r++)t.updateStyles&&t.updateStyles()}}),Polymer.updateStyles=function(e){r.updateStyles(e),Polymer.Base._updateRootStyles(document)};var o=new Polymer.StyleCache;Polymer.customStyleCache=o;var a=n.SCOPE_NAME,l=t.XSCOPE_NAME}(),Polymer.Base._addFeature({_registerFeatures:function(){this._prepIs(),this.factoryImpl&&this._prepConstructor(),this._prepStyles()},_finishRegisterFeatures:function(){this._prepTemplate(),this._prepShimStyles(),this._prepAnnotations(),this._prepEffects(),this._prepBehaviors(),this._prepPropertyInfo(),this._prepBindings(),this._prepShady()},_prepBehavior:function(e){this._addPropertyEffects(e.properties),this._addComplexObserverEffects(e.observers),this._addHostAttributes(e.hostAttributes)},_initFeatures:function(){this._setupGestures(),this._setupConfigure(this.__data__),this._setupStyleProperties(),this._setupDebouncers(),this._setupShady(),this._registerHost(),this._template&&(this._validateApplyShim(),this._poolContent(),this._beginHosting(),this._stampTemplate(),this._endHosting(),this._marshalAnnotationReferences()),this._marshalInstanceEffects(),this._marshalBehaviors(),this._marshalHostAttributes(),this._marshalAttributes(),this._tryReady()},_marshalBehavior:function(e){e.listeners&&this._listenListeners(e.listeners)}}),function(){var e,t=Polymer.StyleProperties,n=Polymer.StyleUtil,r=Polymer.CssParse,s=Polymer.StyleDefaults,i=Polymer.StyleTransformer,o=Polymer.ApplyShim,a=Polymer.Debounce,l=Polymer.Settings;Polymer({is:"custom-style",extends:"style",_template:null,properties:{include:String},ready:function(){this.__appliedElement=this.__appliedElement||this,this.__cssBuild=n.getCssBuildType(this),this.__appliedElement!==this&&(this.__appliedElement.__cssBuild=this.__cssBuild),this._tryApply()},attached:function(){this._tryApply()},_tryApply:function(){if(!this._appliesToDocument&&this.parentNode&&"dom-module"!==this.parentNode.localName){this._appliesToDocument=!0;var e=this.__appliedElement;if(l.useNativeCSSProperties||(this.__needsUpdateStyles=s.hasStyleProperties(),s.addStyle(e)),e.textContent||this.include)this._apply(!0);else{var t=this,n=new MutationObserver(function(){n.disconnect(),t._apply(!0)});n.observe(e,{childList:!0})}}},_updateStyles:function(){Polymer.updateStyles()},_apply:function(e){var t=this.__appliedElement;if(this.include&&(t.textContent=n.cssFromModules(this.include,!0)+t.textContent),t.textContent){var r=this.__cssBuild,s=n.isTargetedBuild(r);if(!l.useNativeCSSProperties||!s){var a=n.rulesForStyle(t);if(s||(n.forEachRule(a,function(e){i.documentRule(e)}),l.useNativeCSSProperties&&!r&&o.transform([t])),l.useNativeCSSProperties)t.textContent=n.toCssText(a);else{var c=this,h=function(){c._flushCustomProperties()};e?Polymer.RenderStatus.whenReady(h):h()}}}},_flushCustomProperties:function(){this.__needsUpdateStyles?(this.__needsUpdateStyles=!1,e=a(e,this._updateStyles)):this._applyCustomProperties()},_applyCustomProperties:function(){var e=this.__appliedElement;this._computeStyleProperties();var s=this._styleProperties,i=n.rulesForStyle(e);i&&(e.textContent=n.toCssText(i,function(e){var n=e.cssText=e.parsedCssText;e.propertyInfo&&e.propertyInfo.cssText&&(n=r.removeCustomPropAssignment(n),e.cssText=t.valueForProperties(n,s))}))}})}(),Polymer.Templatizer={properties:{__hideTemplateChildren__:{observer:"_showHideChildren"}},_instanceProps:Polymer.nob,_parentPropPrefix:"_parent_",templatize:function(e){if(this._templatized=e,e._content||(e._content=e.content),e._content._ctor)return this.ctor=e._content._ctor,void this._prepParentProperties(this.ctor.prototype,e);var t=Object.create(Polymer.Base);this._customPrepAnnotations(t,e),this._prepParentProperties(t,e),t._prepEffects(),this._customPrepEffects(t),t._prepBehaviors(),t._prepPropertyInfo(),t._prepBindings(),t._notifyPathUp=this._notifyPathUpImpl,t._scopeElementClass=this._scopeElementClassImpl,t.listen=this._listenImpl,t._showHideChildren=this._showHideChildrenImpl,t.__setPropertyOrig=this.__setProperty,t.__setProperty=this.__setPropertyImpl;var n=this._constructorImpl,r=function(e,t){n.call(this,e,t)};r.prototype=t,t.constructor=r,e._content._ctor=r,this.ctor=r},_getRootDataHost:function(){return this.dataHost&&this.dataHost._rootDataHost||this.dataHost},_showHideChildrenImpl:function(e){for(var t=this._children,n=0;n<t.length;n++){var r=t[n];Boolean(e)!=Boolean(r.__hideTemplateChildren__)&&(r.nodeType===Node.TEXT_NODE?e?(r.__polymerTextContent__=r.textContent,r.textContent=""):r.textContent=r.__polymerTextContent__:r.style&&(e?(r.__polymerDisplay__=r.style.display,r.style.display="none"):r.style.display=r.__polymerDisplay__)),r.__hideTemplateChildren__=e}},__setPropertyImpl:function(e,t,n,r){r&&r.__hideTemplateChildren__&&"textContent"==e&&(e="__polymerTextContent__"),this.__setPropertyOrig(e,t,n,r)},_debounceTemplate:function(e){Polymer.dom.addDebouncer(this.debounce("_debounceTemplate",e))},_flushTemplates:function(){Polymer.dom.flush()},_customPrepEffects:function(e){var t=this,n=e._parentProps;for(var r in n)e._addPropertyEffect(r,"function",t._createHostPropEffector(r));for(r in this._instanceProps)e._addPropertyEffect(r,"function",t._createInstancePropEffector(r))},_customPrepAnnotations:function(e,t){e._template=t;var n=t._content;if(!n._notes){var r=e._rootDataHost;r&&(Polymer.Annotations.prepElement=function(){r._prepElement()}),n._notes=Polymer.Annotations.parseAnnotations(t),Polymer.Annotations.prepElement=null,this._processAnnotations(n._notes)}e._notes=n._notes,e._parentProps=n._parentProps},_prepParentProperties:function(e,t){var n=this,r=this._parentProps=e._parentProps;if(this._forwardParentProp&&r){var s,i=e._parentPropProto;if(!i){for(s in this._instanceProps)delete r[s];i=e._parentPropProto=Object.create(null),t!=this&&(Polymer.Bind.prepareModel(i),Polymer.Base.prepareModelNotifyPath(i));for(s in r){var o=n._parentPropPrefix+s,a=[{kind:"function",effect:n._createForwardPropEffector(s),fn:Polymer.Bind._functionEffect},{kind:"notify",fn:Polymer.Bind._notifyEffect,effect:{event:Polymer.CaseMap.camelToDashCase(o)+"-changed"}}];i._propertyEffects=i._propertyEffects||{},i._propertyEffects[o]=a,Polymer.Bind._createAccessors(i,o,a)}}var l=this;t!=this&&(Polymer.Bind.prepareInstance(t),t._forwardParentProp=function(e,t){l._forwardParentProp(e,t)}),this._extendTemplate(t,i),t._pathEffector=function(e,t,n){return l._pathEffectorImpl(e,t,n)}}},_createForwardPropEffector:function(e){return function(t,n){this._forwardParentProp(e,n)}},_createHostPropEffector:function(e){var t=this._parentPropPrefix;return function(n,r){this.dataHost._templatized[t+e]=r}},_createInstancePropEffector:function(e){return function(t,n,r,s){s||this.dataHost._forwardInstanceProp(this,e,n)}},_extendTemplate:function(e,t){var n=Object.getOwnPropertyNames(t);t._propertySetter&&(e._propertySetter=t._propertySetter);for(var r,s=0;s<n.length&&(r=n[s]);s++){var i=e[r];if(i&&"_propertyEffects"==r){var o=Polymer.Base.mixin({},i);e._propertyEffects=Polymer.Base.mixin(o,t._propertyEffects)}else{var a=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,a),void 0!==i&&e._propertySetter(r,i)}}},_showHideChildren:function(e){},_forwardInstancePath:function(e,t,n){},_forwardInstanceProp:function(e,t,n){},_notifyPathUpImpl:function(e,t){var n=this.dataHost,r=Polymer.Path.root(e);n._forwardInstancePath.call(n,this,e,t),r in n._parentProps&&n._templatized._notifyPath(n._parentPropPrefix+e,t)},_pathEffectorImpl:function(e,t,n){if(this._forwardParentPath&&0===e.indexOf(this._parentPropPrefix)){var r=e.substring(this._parentPropPrefix.length);Polymer.Path.root(r)in this._parentProps&&this._forwardParentPath(r,t)}Polymer.Base._pathEffector.call(this._templatized,e,t,n)},_constructorImpl:function(e,t){var n=this;this._rootDataHost=t._getRootDataHost(),this._setupConfigure(e),this._registerHost(t),this._beginHosting(),this.root=this.instanceTemplate(this._template),this.root.__noContent=!this._notes._hasContent,this.root.__styleScoped=!0,this._endHosting(),this._marshalAnnotatedNodes(),this._marshalInstanceEffects(),this._marshalAnnotatedListeners();for(var r=[],s=this.root.firstChild;s;s=s.nextSibling)r.push(s),s._templateInstance=n;this._children=r,t.__hideTemplateChildren__&&this._showHideChildren(!0),this._tryReady()},_listenImpl:function(e,t,n){var r=this,s=this._rootDataHost,i=s._createEventHandler(e,t,n);s._listen(e,t,function(e){e.model=r,i(e)})},_scopeElementClassImpl:function(e,t){var n=this._rootDataHost;return n?n._scopeElementClass(e,t):t},stamp:function(e){var t=this;if(e=e||{},this._parentProps){var n=this._templatized;for(var r in this._parentProps)void 0===e[r]&&(e[r]=n[t._parentPropPrefix+r])}return new this.ctor(e,this)},modelForElement:function(e){for(var t,n=this;e;)if(t=e._templateInstance){if(t.dataHost==n)return t;e=t.dataHost}else e=e.parentNode}},Polymer({is:"dom-template",extends:"template",_template:null,behaviors:[Polymer.Templatizer],ready:function(){this.templatize(this)}}),Polymer._collections=new WeakMap,Polymer.Collection=function(e){Polymer._collections.set(e,this),this.userArray=e,this.store=e.slice(),this.initMap()},Polymer.Collection.prototype={constructor:Polymer.Collection,initMap:function(){for(var e=this.omap=new WeakMap,t=this.pmap={},n=this.store,r=0;r<n.length;r++){var s=n[r];s&&"object"==typeof s?e.set(s,r):t[s]=r}},add:function(e){var t=this.store.push(e)-1;return e&&"object"==typeof e?this.omap.set(e,t):this.pmap[e]=t,"#"+t},removeKey:function(e){(e=this._parseKey(e))&&(this._removeFromMap(this.store[e]),delete this.store[e])},_removeFromMap:function(e){e&&"object"==typeof e?this.omap.delete(e):delete this.pmap[e]},remove:function(e){var t=this.getKey(e);return this.removeKey(t),t},getKey:function(e){var t;if(void 0!=(t=e&&"object"==typeof e?this.omap.get(e):this.pmap[e]))return"#"+t},getKeys:function(){return Object.keys(this.store).map(function(e){return"#"+e})},_parseKey:function(e){if(e&&"#"==e[0])return e.slice(1)},setItem:function(e,t){if(e=this._parseKey(e)){var n=this.store[e];n&&this._removeFromMap(n),t&&"object"==typeof t?this.omap.set(t,e):this.pmap[t]=e,this.store[e]=t}},getItem:function(e){if(e=this._parseKey(e))return this.store[e]},getItems:function(){var e=[],t=this.store;for(var n in t)e.push(t[n]);return e},_applySplices:function(e){for(var t,n,r=this,s={},i=0;i<e.length&&(n=e[i]);i++){n.addedKeys=[];for(var o=0;o<n.removed.length;o++)s[t=r.getKey(n.removed[o])]=s[t]?null:-1;for(o=0;o<n.addedCount;o++){var a=r.userArray[n.index+o];s[t=void 0===(t=r.getKey(a))?r.add(a):t]=s[t]?null:1,n.addedKeys.push(t)}}var l=[],c=[];for(t in s)s[t]<0&&(r.removeKey(t),l.push(t)),s[t]>0&&c.push(t);return[{removed:l,added:c}]}},Polymer.Collection.get=function(e){return Polymer._collections.get(e)||new Polymer.Collection(e)},Polymer.Collection.applySplices=function(e,t){var n=Polymer._collections.get(e);return n?n._applySplices(t):null},Polymer({is:"dom-repeat",extends:"template",_template:null,properties:{items:{type:Array},as:{type:String,value:"item"},indexAs:{type:String,value:"index"},sort:{type:Function,observer:"_sortChanged"},filter:{type:Function,observer:"_filterChanged"},observe:{type:String,observer:"_observeChanged"},delay:Number,renderedItemCount:{type:Number,notify:!Polymer.Settings.suppressTemplateNotifications,readOnly:!0},initialCount:{type:Number,observer:"_initializeChunking"},targetFramerate:{type:Number,value:20},notifyDomChange:{type:Boolean},_targetFrameTime:{type:Number,computed:"_computeFrameTime(targetFramerate)"}},behaviors:[Polymer.Templatizer],observers:["_itemsChanged(items.*)"],created:function(){this._instances=[],this._pool=[],this._limit=1/0;var e=this;this._boundRenderChunk=function(){e._renderChunk()}},detached:function(){var e=this;this.__isDetached=!0;for(var t=0;t<this._instances.length;t++)e._detachInstance(t)},attached:function(){var e=this;if(this.__isDetached){this.__isDetached=!1;var t,n=Polymer.dom(this).parentNode;n.localName==this.is?(t=n,n=Polymer.dom(n).parentNode):t=this;for(var r=Polymer.dom(n),s=0;s<this._instances.length;s++)e._attachInstance(s,r,t)}},ready:function(){this._instanceProps={__key__:!0},this._instanceProps[this.as]=!0,this._instanceProps[this.indexAs]=!0,this.ctor||this.templatize(this)},_sortChanged:function(e){var t=this._getRootDataHost();this._sortFn=e&&("function"==typeof e?e:function(){return t[e].apply(t,arguments)}),this._needFullRefresh=!0,this.items&&this._debounceTemplate(this._render)},_filterChanged:function(e){var t=this._getRootDataHost();this._filterFn=e&&("function"==typeof e?e:function(){return t[e].apply(t,arguments)}),this._needFullRefresh=!0,this.items&&this._debounceTemplate(this._render)},_computeFrameTime:function(e){return Math.ceil(1e3/e)},_initializeChunking:function(){this.initialCount&&(this._limit=this.initialCount,this._chunkCount=this.initialCount,this._lastChunkTime=performance.now())},_tryRenderChunk:function(){this.items&&this._limit<this.items.length&&this.debounce("renderChunk",this._requestRenderChunk)},_requestRenderChunk:function(){requestAnimationFrame(this._boundRenderChunk)},_renderChunk:function(){var e=performance.now(),t=this._targetFrameTime/(e-this._lastChunkTime);this._chunkCount=Math.round(this._chunkCount*t)||1,this._limit+=this._chunkCount,this._lastChunkTime=e,this._debounceTemplate(this._render)},_observeChanged:function(){this._observePaths=this.observe&&this.observe.replace(".*",".").split(" ")},_itemsChanged:function(e){if("items"==e.path)Array.isArray(this.items)?this.collection=Polymer.Collection.get(this.items):this.items?this._error(this._logf("dom-repeat","expected array for `items`, found",this.items)):this.collection=null,this._keySplices=[],this._indexSplices=[],this._needFullRefresh=!0,this._initializeChunking(),this._debounceTemplate(this._render);else if("items.splices"==e.path)this._keySplices=this._keySplices.concat(e.value.keySplices),this._indexSplices=this._indexSplices.concat(e.value.indexSplices),this._debounceTemplate(this._render);else{var t=e.path.slice(6);this._forwardItemPath(t,e.value),this._checkObservedPaths(t)}},_checkObservedPaths:function(e){var t=this;if(this._observePaths){e=e.substring(e.indexOf(".")+1);for(var n=this._observePaths,r=0;r<n.length;r++)if(0===e.indexOf(n[r]))return t._needFullRefresh=!0,void(t.delay?t.debounce("render",t._render,t.delay):t._debounceTemplate(t._render))}},render:function(){this._needFullRefresh=!0,this._debounceTemplate(this._render),this._flushTemplates()},_render:function(){var e=this;this._needFullRefresh?(this._applyFullRefresh(),this._needFullRefresh=!1):this._keySplices.length&&(this._sortFn?this._applySplicesUserSort(this._keySplices):this._filterFn?this._applyFullRefresh():this._applySplicesArrayOrder(this._indexSplices)),this._keySplices=[],this._indexSplices=[];for(var t=this._keyToInstIdx={},n=this._instances.length-1;n>=0;n--){var r=e._instances[n];r.isPlaceholder&&n<e._limit?r=e._insertInstance(n,r.__key__):!r.isPlaceholder&&n>=e._limit&&(r=e._downgradeInstance(n,r.__key__)),t[r.__key__]=n,r.isPlaceholder||r.__setProperty(e.indexAs,n,!0)}this._pool.length=0,this._setRenderedItemCount(this._instances.length),Polymer.Settings.suppressTemplateNotifications&&!this.notifyDomChange||this.fire("dom-change"),this._tryRenderChunk()},_applyFullRefresh:function(){var e,t=this,n=this.collection;if(this._sortFn)e=n?n.getKeys():[];else{e=[];var r=this.items;if(r)for(var s=0;s<r.length;s++)e.push(n.getKey(r[s]))}var i=this;for(this._filterFn&&(e=e.filter(function(e){return i._filterFn(n.getItem(e))})),this._sortFn&&e.sort(function(e,t){return i._sortFn(n.getItem(e),n.getItem(t))}),s=0;s<e.length;s++){var o=e[s],a=t._instances[s];a?(a.__key__=o,!a.isPlaceholder&&s<t._limit&&a.__setProperty(t.as,n.getItem(o),!0)):s<t._limit?t._insertInstance(s,o):t._insertPlaceholder(s,o)}for(var l=this._instances.length-1;l>=s;l--)t._detachAndRemoveInstance(l)},_numericSort:function(e,t){return e-t},_applySplicesUserSort:function(e){for(var t,n,r=this,s=this.collection,i={},o=0;o<e.length&&(n=e[o]);o++){for(var a=0;a<n.removed.length;a++)i[t=n.removed[a]]=i[t]?null:-1;for(a=0;a<n.added.length;a++)i[t=n.added[a]]=i[t]?null:1}var l=[],c=[];for(t in i)-1===i[t]&&l.push(r._keyToInstIdx[t]),1===i[t]&&c.push(t);if(l.length)for(l.sort(this._numericSort),o=l.length-1;o>=0;o--){var h=l[o];void 0!==h&&r._detachAndRemoveInstance(h)}var u=this;if(c.length){this._filterFn&&(c=c.filter(function(e){return u._filterFn(s.getItem(e))})),c.sort(function(e,t){return u._sortFn(s.getItem(e),s.getItem(t))});var f=0;for(o=0;o<c.length;o++)f=r._insertRowUserSort(f,c[o])}},_insertRowUserSort:function(e,t){for(var n=this,r=this.collection,s=r.getItem(t),i=this._instances.length-1,o=-1;e<=i;){var a=e+i>>1,l=n._instances[a].__key__,c=n._sortFn(r.getItem(l),s);if(c<0)e=a+1;else{if(!(c>0)){o=a;break}i=a-1}}return o<0&&(o=i+1),this._insertPlaceholder(o,t),o},_applySplicesArrayOrder:function(e){for(var t,n=this,r=0;r<e.length&&(t=e[r]);r++){for(var s=0;s<t.removed.length;s++)n._detachAndRemoveInstance(t.index);for(s=0;s<t.addedKeys.length;s++)n._insertPlaceholder(t.index+s,t.addedKeys[s])}},_detachInstance:function(e){var t=this._instances[e];if(!t.isPlaceholder){for(var n=0;n<t._children.length;n++){var r=t._children[n];Polymer.dom(t.root).appendChild(r)}return t}},_attachInstance:function(e,t,n){var r=this._instances[e];r.isPlaceholder||t.insertBefore(r.root,n)},_detachAndRemoveInstance:function(e){var t=this._detachInstance(e);t&&this._pool.push(t),this._instances.splice(e,1)},_insertPlaceholder:function(e,t){this._instances.splice(e,0,{isPlaceholder:!0,__key__:t})},_stampInstance:function(e,t){var n={__key__:t};return n[this.as]=this.collection.getItem(t),n[this.indexAs]=e,this.stamp(n)},_insertInstance:function(e,t){var n=this._pool.pop();n?(n.__setProperty(this.as,this.collection.getItem(t),!0),n.__setProperty("__key__",t,!0)):n=this._stampInstance(e,t);var r=this._instances[e+1],s=r&&!r.isPlaceholder?r._children[0]:this,i=Polymer.dom(this).parentNode;return i.localName==this.is&&(s==this&&(s=i),i=Polymer.dom(i).parentNode),Polymer.dom(i).insertBefore(n.root,s),this._instances[e]=n,n},_downgradeInstance:function(e,t){var n=this._detachInstance(e);return n&&this._pool.push(n),n={isPlaceholder:!0,__key__:t},this._instances[e]=n,n},_showHideChildren:function(e){for(var t=this,n=0;n<this._instances.length;n++)t._instances[n].isPlaceholder||t._instances[n]._showHideChildren(e)},_forwardInstanceProp:function(e,t,n){if(t==this.as){var r;r=this._sortFn||this._filterFn?this.items.indexOf(this.collection.getItem(e.__key__)):e[this.indexAs],this.set("items."+r,n)}},_forwardInstancePath:function(e,t,n){0===t.indexOf(this.as+".")&&this._notifyPath("items."+e.__key__+"."+t.slice(this.as.length+1),n)},_forwardParentProp:function(e,t){for(var n,r=this._instances,s=0;s<r.length&&(n=r[s]);s++)n.isPlaceholder||n.__setProperty(e,t,!0)},_forwardParentPath:function(e,t){for(var n,r=this._instances,s=0;s<r.length&&(n=r[s]);s++)n.isPlaceholder||n._notifyPath(e,t,!0)},_forwardItemPath:function(e,t){if(this._keyToInstIdx){var n=e.indexOf("."),r=e.substring(0,n<0?e.length:n),s=this._keyToInstIdx[r],i=this._instances[s];i&&!i.isPlaceholder&&(n>=0?(e=this.as+"."+e.substring(n+1),i._notifyPath(e,t,!0)):i.__setProperty(this.as,t,!0))}},itemForElement:function(e){var t=this.modelForElement(e);return t&&t[this.as]},keyForElement:function(e){var t=this.modelForElement(e);return t&&t.__key__},indexForElement:function(e){var t=this.modelForElement(e);return t&&t[this.indexAs]}}),Polymer({is:"array-selector",_template:null,properties:{items:{type:Array,observer:"clearSelection"},multi:{type:Boolean,value:!1,observer:"clearSelection"},selected:{type:Object,notify:!0},selectedItem:{type:Object,notify:!0},toggle:{type:Boolean,value:!1}},clearSelection:function(){var e=this;if(Array.isArray(this.selected))for(var t=0;t<this.selected.length;t++)e.unlinkPaths("selected."+t);else this.unlinkPaths("selected"),this.unlinkPaths("selectedItem");this.multi?this.selected&&!this.selected.length||(this.selected=[],this._selectedColl=Polymer.Collection.get(this.selected)):(this.selected=null,this._selectedColl=null),this.selectedItem=null},isSelected:function(e){return this.multi?void 0!==this._selectedColl.getKey(e):this.selected==e},deselect:function(e){if(this.multi){if(this.isSelected(e)){var t=this._selectedColl.getKey(e);this.arrayDelete("selected",e),this.unlinkPaths("selected."+t)}}else this.selected=null,this.selectedItem=null,this.unlinkPaths("selected"),this.unlinkPaths("selectedItem")},select:function(e){var t=Polymer.Collection.get(this.items).getKey(e);if(this.multi)if(this.isSelected(e))this.toggle&&this.deselect(e);else{this.push("selected",e);var n=this._selectedColl.getKey(e);this.linkPaths("selected."+n,"items."+t)}else this.toggle&&e==this.selected?this.deselect():(this.selected=e,this.selectedItem=e,this.linkPaths("selected","items."+t),this.linkPaths("selectedItem","items."+t))}}),Polymer({is:"dom-if",extends:"template",_template:null,properties:{if:{type:Boolean,value:!1,observer:"_queueRender"},restamp:{type:Boolean,value:!1,observer:"_queueRender"},notifyDomChange:{type:Boolean}},behaviors:[Polymer.Templatizer],_queueRender:function(){this._debounceTemplate(this._render)},detached:function(){var e=this.parentNode;e&&e.localName==this.is&&(e=Polymer.dom(e).parentNode),e&&(e.nodeType!=Node.DOCUMENT_FRAGMENT_NODE||Polymer.Settings.hasShadow&&e instanceof ShadowRoot)||this._teardownInstance()},attached:function(){this.if&&this.ctor&&this.async(this._ensureInstance)},render:function(){this._flushTemplates()},_render:function(){this.if?(this.ctor||this.templatize(this),this._ensureInstance(),this._showHideChildren()):this.restamp&&this._teardownInstance(),!this.restamp&&this._instance&&this._showHideChildren(),this.if!=this._lastIf&&(Polymer.Settings.suppressTemplateNotifications&&!this.notifyDomChange||this.fire("dom-change"),this._lastIf=this.if)},_ensureInstance:function(){var e,t=Polymer.dom(this).parentNode;if(t&&t.localName==this.is?(e=t,t=Polymer.dom(t).parentNode):e=this,t)if(this._instance){var n=this._instance._children;if(n&&n.length&&Polymer.dom(e).previousSibling!==n[n.length-1])for(var r,s=0;s<n.length&&(r=n[s]);s++)Polymer.dom(t).insertBefore(r,e)}else{this._instance=this.stamp();var i=this._instance.root;Polymer.dom(t).insertBefore(i,e)}},_teardownInstance:function(){if(this._instance){var e=this._instance._children;if(e&&e.length)for(var t,n=Polymer.dom(Polymer.dom(e[0]).parentNode),r=0;r<e.length&&(t=e[r]);r++)n.removeChild(t);this._instance=null}},_showHideChildren:function(){var e=this.__hideTemplateChildren__||!this.if;this._instance&&this._instance._showHideChildren(e)},_forwardParentProp:function(e,t){this._instance&&this._instance.__setProperty(e,t,!0)},_forwardParentPath:function(e,t){this._instance&&this._instance._notifyPath(e,t,!0)}}),Polymer({is:"dom-bind",properties:{notifyDomChange:{type:Boolean}},extends:"template",_template:null,created:function(){var e=this;Polymer.RenderStatus.whenReady(function(){"loading"==document.readyState?document.addEventListener("DOMContentLoaded",function(){e._markImportsReady()}):e._markImportsReady()})},_ensureReady:function(){this._readied||this._readySelf()},_markImportsReady:function(){this._importsReady=!0,this._ensureReady()},_registerFeatures:function(){this._prepConstructor()},_insertChildren:function(){var e,t=Polymer.dom(this).parentNode;t.localName==this.is?(e=t,t=Polymer.dom(t).parentNode):e=this,Polymer.dom(t).insertBefore(this.root,e)},_removeChildren:function(){var e=this;if(this._children)for(var t=0;t<this._children.length;t++)e.root.appendChild(e._children[t])},_initFeatures:function(){},_scopeElementClass:function(e,t){return this.dataHost?this.dataHost._scopeElementClass(e,t):t},_configureInstanceProperties:function(){},_prepConfigure:function(){var e=this,t={};for(var n in this._propertyEffects)t[n]=e[n];var r=this._setupConfigure;this._setupConfigure=function(){r.call(this,t)}},attached:function(){this._importsReady&&this.render()},detached:function(){this._removeChildren()},render:function(){this._ensureReady(),this._children||(this._template=this,this._prepAnnotations(),this._prepEffects(),this._prepBehaviors(),this._prepConfigure(),this._prepBindings(),this._prepPropertyInfo(),Polymer.Base._initFeatures.call(this),this._children=Polymer.TreeApi.arrayCopyChildNodes(this.root)),this._insertChildren(),Polymer.Settings.suppressTemplateNotifications&&!this.notifyDomChange||this.fire("dom-change")}});</script><script>Polymer.PaperSpinnerBehavior={properties:{active:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"__activeChanged"},alt:{type:String,value:"loading",observer:"__altChanged"},__coolingDown:{type:Boolean,value:!1}},__computeContainerClasses:function(e,t){return[e||t?"active":"",t?"cooldown":""].join(" ")},__activeChanged:function(e,t){this.__setAriaHidden(!e),this.__coolingDown=!e&&t},__altChanged:function(e){"loading"===e?this.alt=this.getAttribute("aria-label")||e:(this.__setAriaHidden(""===e),this.setAttribute("aria-label",e))},__setAriaHidden:function(e){e?this.setAttribute("aria-hidden","true"):this.removeAttribute("aria-hidden")},__reset:function(){this.active=!1,this.__coolingDown=!1}};</script><dom-module id="paper-spinner-styles" assetpath="../bower_components/paper-spinner/"><template><style>:host{display:inline-block;position:relative;width:28px;height:28px;--paper-spinner-container-rotation-duration:1568ms;--paper-spinner-expand-contract-duration:1333ms;--paper-spinner-full-cycle-duration:5332ms;--paper-spinner-cooldown-duration:400ms;}#spinnerContainer{width:100%;height:100%;direction:ltr;}#spinnerContainer.active{-webkit-animation:container-rotate var(--paper-spinner-container-rotation-duration) linear infinite;animation:container-rotate var(--paper-spinner-container-rotation-duration) linear infinite;}@-webkit-keyframes container-rotate{to{-webkit-transform:rotate(360deg);}}@keyframes container-rotate{to{transform:rotate(360deg);}}.spinner-layer{position:absolute;width:100%;height:100%;opacity:0;white-space:nowrap;border-color:var(--paper-spinner-color, var(--google-blue-500));}.layer-1{border-color:var(--paper-spinner-layer-1-color, var(--google-blue-500));}.layer-2{border-color:var(--paper-spinner-layer-2-color, var(--google-red-500));}.layer-3{border-color:var(--paper-spinner-layer-3-color, var(--google-yellow-500));}.layer-4{border-color:var(--paper-spinner-layer-4-color, var(--google-green-500));}.active .spinner-layer{-webkit-animation-name:fill-unfill-rotate;-webkit-animation-duration:var(--paper-spinner-full-cycle-duration);-webkit-animation-timing-function:cubic-bezier(0.4, 0.0, 0.2, 1);-webkit-animation-iteration-count:infinite;animation-name:fill-unfill-rotate;animation-duration:var(--paper-spinner-full-cycle-duration);animation-timing-function:cubic-bezier(0.4, 0.0, 0.2, 1);animation-iteration-count:infinite;opacity:1;}.active .spinner-layer.layer-1{-webkit-animation-name:fill-unfill-rotate, layer-1-fade-in-out;animation-name:fill-unfill-rotate, layer-1-fade-in-out;}.active .spinner-layer.layer-2{-webkit-animation-name:fill-unfill-rotate, layer-2-fade-in-out;animation-name:fill-unfill-rotate, layer-2-fade-in-out;}.active .spinner-layer.layer-3{-webkit-animation-name:fill-unfill-rotate, layer-3-fade-in-out;animation-name:fill-unfill-rotate, layer-3-fade-in-out;}.active .spinner-layer.layer-4{-webkit-animation-name:fill-unfill-rotate, layer-4-fade-in-out;animation-name:fill-unfill-rotate, layer-4-fade-in-out;}@-webkit-keyframes fill-unfill-rotate{12.5%{-webkit-transform:rotate(135deg);}25%{-webkit-transform:rotate(270deg);}37.5%{-webkit-transform:rotate(405deg);}50%{-webkit-transform:rotate(540deg);}62.5%{-webkit-transform:rotate(675deg);}75%{-webkit-transform:rotate(810deg);}87.5%{-webkit-transform:rotate(945deg);}to{-webkit-transform:rotate(1080deg);}}@keyframes fill-unfill-rotate{12.5%{transform:rotate(135deg);}25%{transform:rotate(270deg);}37.5%{transform:rotate(405deg);}50%{transform:rotate(540deg);}62.5%{transform:rotate(675deg);}75%{transform:rotate(810deg);}87.5%{transform:rotate(945deg);}to{transform:rotate(1080deg);}}@-webkit-keyframes layer-1-fade-in-out{0%{opacity:1;}25%{opacity:1;}26%{opacity:0;}89%{opacity:0;}90%{opacity:1;}to{opacity:1;}}@keyframes layer-1-fade-in-out{0%{opacity:1;}25%{opacity:1;}26%{opacity:0;}89%{opacity:0;}90%{opacity:1;}to{opacity:1;}}@-webkit-keyframes layer-2-fade-in-out{0%{opacity:0;}15%{opacity:0;}25%{opacity:1;}50%{opacity:1;}51%{opacity:0;}to{opacity:0;}}@keyframes layer-2-fade-in-out{0%{opacity:0;}15%{opacity:0;}25%{opacity:1;}50%{opacity:1;}51%{opacity:0;}to{opacity:0;}}@-webkit-keyframes layer-3-fade-in-out{0%{opacity:0;}40%{opacity:0;}50%{opacity:1;}75%{opacity:1;}76%{opacity:0;}to{opacity:0;}}@keyframes layer-3-fade-in-out{0%{opacity:0;}40%{opacity:0;}50%{opacity:1;}75%{opacity:1;}76%{opacity:0;}to{opacity:0;}}@-webkit-keyframes layer-4-fade-in-out{0%{opacity:0;}65%{opacity:0;}75%{opacity:1;}90%{opacity:1;}to{opacity:0;}}@keyframes layer-4-fade-in-out{0%{opacity:0;}65%{opacity:0;}75%{opacity:1;}90%{opacity:1;}to{opacity:0;}}.circle-clipper{display:inline-block;position:relative;width:50%;height:100%;overflow:hidden;border-color:inherit;}.spinner-layer::after{left:45%;width:10%;border-top-style:solid;}.spinner-layer::after,
+<html><head></head><body><div hidden="" by-polymer-bundler=""><script>(function(){"use strict";function t(){this.end=this.start=0,this.rules=this.parent=this.previous=null,this.cssText=this.parsedCssText="",this.atRule=!1,this.type=0,this.parsedSelector=this.selector=this.keyframesName=""}function e(e){var r=n,i=e=e.replace(N,"").replace(j,""),o=new t;o.start=0,o.end=i.length;for(var s=o,a=0,l=i.length;a<l;a++)if("{"===i[a]){s.rules||(s.rules=[]);var u=s,p=u.rules[u.rules.length-1]||null;(s=new t).start=a+1,s.parent=u,s.previous=p,u.rules.push(s)}else"}"===i[a]&&(s.end=a+1,s=s.parent||o);return r(o,e)}function n(t,e){var i=e.substring(t.start,t.end-1);if(t.parsedCssText=t.cssText=i.trim(),t.parent&&(i=e.substring(t.previous?t.previous.end:t.parent.start,t.start-1),i=r(i),i=i.replace(M," "),i=i.substring(i.lastIndexOf(";")+1),i=t.parsedSelector=t.selector=i.trim(),t.atRule=!i.indexOf("@"),t.atRule?i.indexOf("@media")?i.match(E)&&(t.type=O,t.keyframesName=t.selector.split(M).pop()):t.type=R:t.type=i.indexOf("--")?T:A),i=t.rules)for(var o,s=0,a=i.length;s<a&&(o=i[s]);s++)n(o,e);return t}function r(t){return t.replace(/\\([0-9a-f]{1,6})\s/gi,function(t,e){for(e=6-(t=e).length;e--;)t="0"+t;return"\\"+t})}function i(t,e,n){n=void 0===n?"":n;var r="";if(t.cssText||t.rules){var o,s=t.rules;if((o=s)&&(o=s[0],o=!(o&&o.selector&&0===o.selector.indexOf("--"))),o){o=0;for(var a,l=s.length;o<l&&(a=s[o]);o++)r=i(a,e,r)}else e?e=t.cssText:(e=t.cssText,e=e.replace(I,"").replace(k,""),e=e.replace(q,"").replace(P,"")),(r=e.trim())&&(r="  "+r+"\n")}return r&&(t.selector&&(n+=t.selector+" {\n"),n+=r,t.selector&&(n+="}\n\n")),n}function o(t){(t=V[t])&&(t._applyShimCurrentVersion=t._applyShimCurrentVersion||0,t._applyShimValidatingVersion=t._applyShimValidatingVersion||0,t._applyShimNextVersion=(t._applyShimNextVersion||0)+1)}function s(t){return t._applyShimCurrentVersion===t._applyShimNextVersion}function a(t){t._applyShimValidatingVersion=t._applyShimNextVersion,t.a||(t.a=!0,$.then(function(){t._applyShimCurrentVersion=t._applyShimNextVersion,t.a=!1}))}function l(t){_=(!t||!t.shimcssproperties)&&(L||!(navigator.userAgent.match("AppleWebKit/601")||!window.CSS||!CSS.supports||!CSS.supports("box-shadow","0 0 0 var(--foo)")))}function u(t){return t?("string"==typeof t&&(t=e(t)),i(t,H)):""}function p(t){return!t.__cssRules&&t.textContent&&(t.__cssRules=e(t.textContent)),t.__cssRules||null}function c(t,e,n,r){if(t){var i=!1,o=t.type;if(r&&o===R){var s=t.selector.match(F);s&&(window.matchMedia(s[1]).matches||(i=!0))}if(o===T?e(t):n&&o===O?n(t):o===A&&(i=!0),(t=t.rules)&&!i)for(var a,i=0,o=t.length;i<o&&(a=t[i]);i++)c(a,e,n,r)}}function f(t,e){var n=t.indexOf("var(");if(-1===n)return e(t,"","","");t:{for(var r=0,i=n+3,o=t.length;i<o;i++)if("("===t[i])r++;else if(")"===t[i]&&!--r)break t;i=-1}return r=t.substring(n+4,i),n=t.substring(0,n),t=f(t.substring(i+1),e),-1===(i=r.indexOf(","))?e(n,r.trim(),"",t):e(n,r.substring(0,i).trim(),r.substring(i+1).trim(),t)}function h(){this.a={}}function d(){this.b=this.c=null,this.a=new h}function y(t,e){return e=e.replace(D,function(e,n,r,i){return g(t,e,n,r,i)}),m(t,e)}function m(t,e){for(var n;n=W.exec(e);){var r=n[0],i=n[1];n=n.index;var o=e.slice(0,n+r.indexOf("@apply"));e=e.slice(n+r.length);var s=S(t,o),r=void 0,a=t,i=i.replace(K,""),l=[],u=a.a.get(i);if(u||(a.a.set(i,{}),u=a.a.get(i)),u)for(r in a.c&&(u.i[a.c]=!0),u.h)u=[r,": var(",i,"_-_",r],(a=s&&s[r])&&u.push(",",a),u.push(")"),l.push(u.join(""));e=""+o+(r=l.join("; "))+e,W.lastIndex=n+r.length}return e}function S(t,e){e=e.split(";");for(var n,r,i,o={},s=0;s<e.length;s++)if((n=e[s])&&1<(i=n.split(":")).length){var a=t;r=n=i[0].trim(),i=i.slice(1).join(":");var l=U.exec(i);l&&(l[1]?(a.b||(a.b=document.createElement("meta"),a.b.setAttribute("apply-shim-measure",""),a.b.style.all="initial",document.head.appendChild(a.b)),r=window.getComputedStyle(a.b).getPropertyValue(r)):r="apply-shim-inherit",i=r),r=i,o[n]=r}return o}function v(t,e){if(z)for(var n in e.i)n!==t.c&&z(n)}function g(t,e,n,r,i){if(r&&f(r,function(e,n){n&&t.a.get(n)&&(i="@apply "+n+";")}),!i)return e;var o=m(t,i),s=e.slice(0,e.indexOf("--")),a=o=S(t,o),l=t.a.get(n),u=l&&l.h;u?a=Object.assign(Object.create(u),o):t.a.set(n,a);var p,c=[],h=!1;for(p in a){var d=o[p];void 0===d&&(d="initial"),!u||p in u||(h=!0),c.push(n+"_-_"+p+": "+d)}return h&&v(t,l),l&&(l.h=a),r&&(s=e+";"+s),""+s+c.join("; ")+";"}function w(t){requestAnimationFrame(function(){J?J(t):(G||(G=new Promise(function(t){B=t}),"complete"===document.readyState?B():document.addEventListener("readystatechange",function(){"complete"===document.readyState&&B()})),G.then(function(){t&&t()}))})}function C(){var t=this;this.a=null,w(function(){x(t)}),Q.invalidCallback=o}function x(t){t.a||(t.a=window.ShadyCSS.CustomStyleInterface,t.a&&(t.a.transformCallback=function(t){Q.f(t)},t.a.validateCallback=function(){requestAnimationFrame(function(){t.a.enqueued&&b(t)})}))}function b(t){if(x(t),t.a){var e=t.a.processStyles();if(t.a.enqueued){for(var n=0;n<e.length;n++){var r=t.a.getStyleForCustomStyle(e[n]);r&&Q.f(r)}t.a.enqueued=!1}}}var _,V={},T=1,O=7,R=4,A=1e3,N=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,j=/@import[^;]*;/gim,I=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,k=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,q=/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,P=/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,E=/^@[^\s]*keyframes/,M=/\s+/g,$=Promise.resolve(),D=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi,W=/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi,F=/@media\s(.*)/,L=!(window.ShadyDOM&&window.ShadyDOM.inUse);window.ShadyCSS&&void 0!==window.ShadyCSS.nativeCss?_=window.ShadyCSS.nativeCss:window.ShadyCSS?(l(window.ShadyCSS),window.ShadyCSS=void 0):l(window.WebComponents&&window.WebComponents.flags);var H=_,K=/;\s*/m,U=/^\s*(initial)|(inherit)\s*$/;h.prototype.set=function(t,e){t=t.trim(),this.a[t]={h:e,i:{}}},h.prototype.get=function(t){return t=t.trim(),this.a[t]||null};var z=null;d.prototype.o=function(t){return t=W.test(t)||D.test(t),W.lastIndex=0,D.lastIndex=0,t},d.prototype.m=function(t,e){var n=null;return(t=t.content.querySelector("style"))&&(n=this.j(t,e)),n},d.prototype.j=function(t,e){e=void 0===e?"":e;var n=p(t);return this.l(n,e),t.textContent=u(n),n},d.prototype.f=function(t){var e=this,n=p(t);return c(n,function(t){":root"===t.selector&&(t.selector="html"),e.g(t)}),t.textContent=u(n),n},d.prototype.l=function(t,e){var n=this;this.c=e,c(t,function(t){n.g(t)}),this.c=null},d.prototype.g=function(t){t.cssText=y(this,t.parsedCssText),":root"===t.selector&&(t.selector=":host > *")},d.prototype.detectMixin=d.prototype.o,d.prototype.transformStyle=d.prototype.j,d.prototype.transformCustomStyle=d.prototype.f,d.prototype.transformRules=d.prototype.l,d.prototype.transformRule=d.prototype.g,d.prototype.transformTemplate=d.prototype.m,d.prototype._separator="_-_",Object.defineProperty(d.prototype,"invalidCallback",{get:function(){return z},set:function(t){z=t}});var B,G=null,J=window.HTMLImports&&window.HTMLImports.whenReady||null,Q=new d;if(C.prototype.prepareTemplate=function(t,e){x(this),V[e]=t,e=Q.m(t,e),t._styleAst=e},C.prototype.styleSubtree=function(t,e){if(x(this),e)for(var n in e)null===n?t.style.removeProperty(n):t.style.setProperty(n,e[n]);if(t.shadowRoot)for(this.styleElement(t),t=t.shadowRoot.children||t.shadowRoot.childNodes,e=0;e<t.length;e++)this.styleSubtree(t[e]);else for(t=t.children||t.childNodes,e=0;e<t.length;e++)this.styleSubtree(t[e])},C.prototype.styleElement=function(t){x(this);var e,n=t.localName;e=n?-1<n.indexOf("-")?n:t.getAttribute&&t.getAttribute("is")||"":t.is,(n=V[e])&&!s(n)&&((s(n)||n._applyShimValidatingVersion!==n._applyShimNextVersion)&&(this.prepareTemplate(n,e),a(n)),(t=t.shadowRoot)&&(t=t.querySelector("style"))&&(t.__cssRules=n._styleAst,t.textContent=u(n._styleAst)))},C.prototype.styleDocument=function(t){x(this),this.styleSubtree(document.body,t)},!window.ShadyCSS||!window.ShadyCSS.ScopingShim){var X=new C,Y=window.ShadyCSS&&window.ShadyCSS.CustomStyleInterface;window.ShadyCSS={prepareTemplate:function(t,e){b(X),X.prepareTemplate(t,e)},styleSubtree:function(t,e){b(X),X.styleSubtree(t,e)},styleElement:function(t){b(X),X.styleElement(t)},styleDocument:function(t){b(X),X.styleDocument(t)},getComputedStyleValue:function(t,e){return(t=window.getComputedStyle(t).getPropertyValue(e))?t.trim():""},nativeCss:H,nativeShadow:L},Y&&(window.ShadyCSS.CustomStyleInterface=Y)}window.ShadyCSS.ApplyShim=Q}).call(this);</script><script>!function(){"use strict";var o=window.Polymer;window.Polymer=function(o){return window.Polymer._polymerFn(o)},o&&Object.assign(Polymer,o),window.Polymer._polymerFn=function(o){throw new Error("Load polymer.html to use the Polymer() function.")},window.Polymer.version="2.0.1",window.JSCompiler_renameProperty=function(o,r){return o}}();</script><script>!function(){"use strict";function e(e,r){if(e&&t.test(e))return e;if(void 0===n){n=!1;try{var o=new URL("b","http://a");o.pathname="c%20d",n="http://a/c%20d"===o.href}catch(e){}}return r||(r=document.baseURI||window.location.href),n?new URL(e,r).href:(a||((a=document.implementation.createHTMLDocument("temp")).base=a.createElement("base"),a.head.appendChild(a.base),a.anchor=a.createElement("a"),a.body.appendChild(a.anchor)),a.base.href=r,a.anchor.href=e,a.anchor.href||e)}var r=/(url\()([^)]*)(\))/g,t=/(^\/)|(^#)|(^[\w-\d]*:)/,n=void 0,a=void 0;Polymer.ResolveUrl={resolveCss:function(t,n){return t.replace(r,function(r,t,a,o){return t+"'"+e(a.replace(/["']/g,""),n)+"'"+o})},resolveUrl:e,pathFromUrl:function(e){return e.substring(0,e.lastIndexOf("/")+1)}}}();</script><script>!function(){"use strict";var o=Polymer.Settings||{};o.useShadow=!window.ShadyDOM,o.useNativeCSSProperties=Boolean(!window.ShadyCSS||window.ShadyCSS.nativeCss),o.useNativeCustomElements=!window.customElements.polyfillWrapFlushCallback,Polymer.Settings=o;var e=Polymer.rootPath||Polymer.ResolveUrl.pathFromUrl(document.baseURI||window.location.href);Polymer.rootPath=e,Polymer.setRootPath=function(o){Polymer.rootPath=o}}();</script><script>!function(){"use strict";function i(){}var n=0;i.prototype.__mixinApplications,i.prototype.__mixinSet,Polymer.dedupingMixin=function(i){var t=i.__mixinApplications;t||(t=new WeakMap,i.__mixinApplications=t);var e=n++;return function(n){var r=n.__mixinSet;if(r&&r[e])return n;var _=t,a=_.get(n);a||(a=i(n),_.set(n,a));var o=Object.create(a.__mixinSet||r||null);return o[e]=!0,a.__mixinSet=o,a}}}();</script><script>!function(){"use strict";var e={},a=/-[a-z]/g,r=/([A-Z])/g,n={dashToCamelCase:function(r){return e[r]||(e[r]=r.indexOf("-")<0?r:r.replace(a,function(e){return e[1].toUpperCase()}))},camelToDashCase:function(a){return e[a]||(e[a]=a.replace(r,"-$1").toLowerCase())}};Polymer.CaseMap=n}();</script><script>!function(){"use strict";function e(e){return Polymer.DomModule?Polymer.DomModule.import(e):null}var t={cssFromModules:function(e){for(var t=e.trim().split(" "),r="",o=0;o<t.length;o++)r+=this.cssFromModule(t[o]);return r},cssFromModule:function(t){var r=e(t);if(r&&void 0===r._cssText){var o="",s=r.querySelector("template");s&&(o+=this.cssFromTemplate(s,r.assetpath)),o+=this.cssFromModuleImports(t),r._cssText=o||null}return r||console.warn("Could not find style data in module named",t),r&&r._cssText||""},cssFromTemplate:function(e,t){for(var r="",o=e.content.querySelectorAll("style"),s=0;s<o.length;s++){var l=o[s],n=l.getAttribute("include");n&&(r+=this.cssFromModules(n)),l.parentNode.removeChild(l),r+=t?Polymer.ResolveUrl.resolveCss(l.textContent,t):l.textContent}return r},cssFromModuleImports:function(t){var r="",o=e(t);if(!o)return r;for(var s=o.querySelectorAll("link[rel=import][type~=css]"),l=0;l<s.length;l++){var n=s[l];if(n.import){var u=n.import,m=u.body?u.body:u;r+=Polymer.ResolveUrl.resolveCss(m.textContent,u.baseURI)}}return r}};Polymer.StyleGather=t}();</script><script>function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}();!function(){"use strict";function e(e){return r[e]||o[e.toLowerCase()]}function t(e){e.querySelector("style")&&console.warn("dom-module %s has style outside template",e.id)}var r={},o={},n=function(n){function s(){return _classCallCheck(this,s),_possibleConstructorReturn(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return _inherits(s,HTMLElement),_createClass(s,[{key:"attributeChangedCallback",value:function(e,t,r){t!==r&&this.register()}},{key:"register",value:function(e){(e=e||this.id)&&(this.id=e,r[e]=this,o[e.toLowerCase()]=this,t(this))}},{key:"assetpath",get:function(){if(!this.__assetpath){var e=window.HTMLImports&&HTMLImports.importForElement?HTMLImports.importForElement(this)||document:this.ownerDocument,t=Polymer.ResolveUrl.resolveUrl(this.getAttribute("assetpath")||"",e.baseURI);this.__assetpath=Polymer.ResolveUrl.pathFromUrl(t)}return this.__assetpath}}],[{key:"import",value:function(t,r){if(t){var o=e(t);return o&&r?o.querySelector(r):o}return null}},{key:"observedAttributes",get:function(){return["id"]}}]),s}();n.prototype.modules=r,customElements.define("dom-module",n),Polymer.DomModule=n}();</script><script>!function(){"use strict";var t={isPath:function(t){return t.indexOf(".")>=0},root:function(t){var n=t.indexOf(".");return-1===n?t:t.slice(0,n)},isAncestor:function(t,n){return 0===t.indexOf(n+".")},isDescendant:function(t,n){return 0===n.indexOf(t+".")},translate:function(t,n,r){return n+r.slice(t.length)},matches:function(t,n){return t===n||this.isAncestor(t,n)||this.isDescendant(t,n)},normalize:function(t){if(Array.isArray(t)){for(var n=[],r=0;r<t.length;r++)for(var i=t[r].toString().split("."),e=0;e<i.length;e++)n.push(i[e]);return n.join(".")}return t},split:function(t){return Array.isArray(t)?this.normalize(t).split("."):t.toString().split(".")},get:function(t,n,r){for(var i=t,e=this.split(n),s=0;s<e.length;s++){if(!i)return;i=i[e[s]]}return r&&(r.path=e.join(".")),i},set:function(t,n,r){var i=t,e=this.split(n),s=e[e.length-1];if(e.length>1){for(var o=0;o<e.length-1;o++)if(!(i=i[e[o]]))return;i[s]=r}else i[n]=r;return e.join(".")}};t.isDeep=t.isPath,Polymer.Path=t}();</script><script>!function(){"use strict";var n=0,e=0,i=[],t=0,o=document.createTextNode("");new window.MutationObserver(function(){for(var n=i.length,t=0;t<n;t++){var o=i[t];if(o)try{o()}catch(n){setTimeout(function(){throw n})}}i.splice(0,n),e+=n}).observe(o,{characterData:!0}),Polymer.Async={timeOut:{after:function(n){return{run:function(e){return setTimeout(e,n)},cancel:window.clearTimeout.bind(window)}},run:window.setTimeout.bind(window),cancel:window.clearTimeout.bind(window)},animationFrame:{run:window.requestAnimationFrame.bind(window),cancel:window.cancelAnimationFrame.bind(window)},idlePeriod:{run:function(n){return window.requestIdleCallback?window.requestIdleCallback(n):window.setTimeout(n,16)},cancel:function(n){window.cancelIdleCallback?window.cancelIdleCallback(n):window.clearTimeout(n)}},microTask:{run:function(e){return o.textContent=t++,i.push(e),n++},cancel:function(n){var t=n-e;if(t>=0){if(!i[t])throw new Error("invalid async handle: "+n);i[t]=null}}}}}();</script><script>function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_createClass=function(){function t(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,a,i){return a&&t(e.prototype,a),i&&t(e,i),e}}();!function(){"use strict";function t(t,e){if(!i[e]){var a=t[e];void 0!==a&&(t.__data?t._setPendingProperty(e,a):(t.__dataProto?t.hasOwnProperty(JSCompiler_renameProperty("__dataProto",t))||(t.__dataProto=Object.create(t.__dataProto)):t.__dataProto={},t.__dataProto[e]=a))}}for(var e=Polymer.CaseMap,a=Polymer.Async.microTask,i={},r=HTMLElement.prototype;r;){for(var n=Object.getOwnPropertyNames(r),s=0;s<n.length;s++)i[n[s]]=!0;r=Object.getPrototypeOf(r)}Polymer.PropertyAccessors=Polymer.dedupingMixin(function(i){return function(r){function n(){_classCallCheck(this,n);var t=_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));return t.__serializing,t.__dataCounter,t.__dataEnabled,t.__dataReady,t.__dataInvalid,t.__data,t.__dataPending,t.__dataOld,t.__dataProto,t.__dataHasAccessor,t.__dataInstanceProps,t._initializeProperties(),t}return _inherits(n,i),_createClass(n,null,[{key:"createPropertiesForAttributes",value:function(){for(var t=this.observedAttributes,a=0;a<t.length;a++)this.prototype._createPropertyAccessor(e.dashToCamelCase(t[a]))}}]),_createClass(n,[{key:"attributeChangedCallback",value:function(t,e,a){e!==a&&this._attributeToProperty(t,a)}},{key:"_initializeProperties",value:function(){this.__serializing=!1,this.__dataCounter=0,this.__dataEnabled=!1,this.__dataReady=!1,this.__dataInvalid=!1,this.__data={},this.__dataPending=null,this.__dataOld=null,this.__dataProto&&(this._initializeProtoProperties(this.__dataProto),this.__dataProto=null);for(var t in this.__dataHasAccessor)this.hasOwnProperty(t)&&(this.__dataInstanceProps=this.__dataInstanceProps||{},this.__dataInstanceProps[t]=this[t],delete this[t])}},{key:"_initializeProtoProperties",value:function(t){for(var e in t)this._setProperty(e,t[e])}},{key:"_initializeInstanceProperties",value:function(t){Object.assign(this,t)}},{key:"_ensureAttribute",value:function(t,e){this.hasAttribute(t)||this._valueToNodeAttribute(this,e,t)}},{key:"_attributeToProperty",value:function(t,a,i){this.__serializing||(this[e.dashToCamelCase(t)]=this._deserializeValue(a,i))}},{key:"_propertyToAttribute",value:function(t,a,i){this.__serializing=!0,i=arguments.length<3?this[t]:i,this._valueToNodeAttribute(this,i,a||e.camelToDashCase(t)),this.__serializing=!1}},{key:"_valueToNodeAttribute",value:function(t,e,a){var i=this._serializeValue(e);void 0===i?t.removeAttribute(a):t.setAttribute(a,i)}},{key:"_serializeValue",value:function(t){switch(void 0===t?"undefined":_typeof(t)){case"boolean":return t?"":void 0;case"object":if(t instanceof Date)return t.toString();if(t)try{return JSON.stringify(t)}catch(t){return""}default:return null!=t?t.toString():void 0}}},{key:"_deserializeValue",value:function(t,e){var a=void 0;switch(e){case Number:a=Number(t);break;case Boolean:a=null!==t;break;case Object:try{a=JSON.parse(t)}catch(t){}break;case Array:try{a=JSON.parse(t)}catch(e){a=null,console.warn("Polymer::Attributes: couldn't decode Array as JSON: "+t)}break;case Date:a=new Date(t);break;case String:default:a=t}return a}},{key:"_createPropertyAccessor",value:function(e,a){this.hasOwnProperty("__dataHasAccessor")||(this.__dataHasAccessor=Object.assign({},this.__dataHasAccessor)),this.__dataHasAccessor[e]||(this.__dataHasAccessor[e]=!0,t(this,e),Object.defineProperty(this,e,{get:function(){return this.__data[e]},set:a?function(){}:function(t){this._setProperty(e,t)}}))}},{key:"_hasAccessor",value:function(t){return this.__dataHasAccessor&&this.__dataHasAccessor[t]}},{key:"_setProperty",value:function(t,e){this._setPendingProperty(t,e)&&this._invalidateProperties()}},{key:"_setPendingProperty",value:function(t,e){var a=this.__data[t],i=this._shouldPropertyChange(t,e,a);return i&&(this.__dataPending||(this.__dataPending={},this.__dataOld={}),!this.__dataOld||t in this.__dataOld||(this.__dataOld[t]=a),this.__data[t]=e,this.__dataPending[t]=e),i}},{key:"_isPropertyPending",value:function(t){return Boolean(this.__dataPending&&t in this.__dataPending)}},{key:"_invalidateProperties",value:function(){var t=this;!this.__dataInvalid&&this.__dataReady&&(this.__dataInvalid=!0,a.run(function(){t.__dataInvalid&&(t.__dataInvalid=!1,t._flushProperties())}))}},{key:"_enableProperties",value:function(){this.__dataEnabled||(this.__dataEnabled=!0,this.__dataInstanceProps&&(this._initializeInstanceProperties(this.__dataInstanceProps),this.__dataInstanceProps=null),this.ready())}},{key:"_flushProperties",value:function(){if(this.__dataPending&&this.__dataOld){var t=this.__dataPending;this.__dataPending=null,this.__dataCounter++,this._propertiesChanged(this.__data,t,this.__dataOld),this.__dataCounter--}}},{key:"ready",value:function(){this.__dataReady=!0,this._flushProperties()}},{key:"_propertiesChanged",value:function(t,e,a){}},{key:"_shouldPropertyChange",value:function(t,e,a){return a!==e&&(a===a||e===e)}}]),n}()})}();</script><script>function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var _createClass=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();!function(){"use strict";function e(e){var t=e.getAttribute("is");if(t&&i[t]){var n=e;for(n.removeAttribute("is"),e=n.ownerDocument.createElement(t),n.parentNode.replaceChild(e,n),e.appendChild(n);n.attributes.length;)e.setAttribute(n.attributes[0].name,n.attributes[0].value),n.removeAttribute(n.attributes[0].name)}return e}function t(e,n){var r=n.parentInfo&&t(e,n.parentInfo);if(!r)return e;for(var o=r.firstChild,a=0;o;o=o.nextSibling)if(n.parentIndex===a++)return o}function n(e,t,n,r){r.id&&(t[r.id]=n)}function r(e,t,n){if(n.events&&n.events.length)for(var r,o=0,a=n.events;o<a.length&&(r=a[o]);o++)e._addMethodEventListenerToNode(t,r.name,r.value,e)}function o(e,t,n){n.templateInfo&&(t._templateInfo=n.templateInfo)}function a(e,t,n){e=e._methodHost||e;return function(t){e[n]?e[n](t,t.detail):console.warn("listener method `"+n+"` not defined")}}var i={"dom-if":!0,"dom-repeat":!0};Polymer.TemplateStamp=Polymer.dedupingMixin(function(i){return function(s){function l(){return _classCallCheck(this,l),_possibleConstructorReturn(this,(l.__proto__||Object.getPrototypeOf(l)).apply(this,arguments))}return _inherits(l,i),_createClass(l,[{key:"_stampTemplate",value:function(e){e&&!e.content&&window.HTMLTemplateElement&&HTMLTemplateElement.decorate&&HTMLTemplateElement.decorate(e);var a=this.constructor._parseTemplate(e),i=a.nodeInfoList,s=a.content||e.content,l=document.importNode(s,!0);l.__noInsertionPoint=!a.hasInsertionPoint;var u=l.nodeList=new Array(i.length);l.$={};for(var p,c=0,f=i.length;c<f&&(p=i[c]);c++){var d=u[c]=t(l,p);n(0,l.$,d,p),o(0,d,p),r(this,d,p)}return l}},{key:"_addMethodEventListenerToNode",value:function(e,t,n,r){var o=a(r=r||e,0,n);return this._addEventListenerToNode(e,t,o),o}},{key:"_addEventListenerToNode",value:function(e,t,n){e.addEventListener(t,n)}},{key:"_removeEventListenerFromNode",value:function(e,t,n){e.removeEventListener(t,n)}}],[{key:"_parseTemplate",value:function(e,t){if(!e._templateInfo){var n=e._templateInfo={};n.nodeInfoList=[],n.stripWhiteSpace=t&&t.stripWhiteSpace||e.hasAttribute("strip-whitespace"),this._parseTemplateContent(e,n,{parent:null})}return e._templateInfo}},{key:"_parseTemplateContent",value:function(e,t,n){return this._parseTemplateNode(e.content,t,n)}},{key:"_parseTemplateNode",value:function(e,t,n){var r=void 0,o=e;return"template"!=o.localName||o.hasAttribute("preserve-content")?"slot"===o.localName&&(t.hasInsertionPoint=!0):r=this._parseTemplateNestedTemplate(o,t,n)||r,o.firstChild&&(r=this._parseTemplateChildNodes(o,t,n)||r),o.hasAttributes&&o.hasAttributes()&&(r=this._parseTemplateNodeAttributes(o,t,n)||r),r}},{key:"_parseTemplateChildNodes",value:function(t,n,r){for(var o,a=t.firstChild,i=0;a;a=o){if("template"==a.localName&&(a=e(a)),o=a.nextSibling,a.nodeType===Node.TEXT_NODE){for(var s=o;s&&s.nodeType===Node.TEXT_NODE;)a.textContent+=s.textContent,o=s.nextSibling,t.removeChild(s),s=o;if(n.stripWhiteSpace&&!a.textContent.trim()){t.removeChild(a);continue}}var l={parentIndex:i,parentInfo:r};this._parseTemplateNode(a,n,l)&&(l.infoIndex=n.nodeInfoList.push(l)-1),a.parentNode&&i++}}},{key:"_parseTemplateNestedTemplate",value:function(e,t,n){var r=this._parseTemplate(e,t);return(r.content=e.content.ownerDocument.createDocumentFragment()).appendChild(e.content),n.templateInfo=r,!0}},{key:"_parseTemplateNodeAttributes",value:function(e,t,n){for(var r,o=!1,a=Array.from(e.attributes),i=a.length-1;r=a[i];i--)o=this._parseTemplateNodeAttribute(e,t,n,r.name,r.value)||o;return o}},{key:"_parseTemplateNodeAttribute",value:function(e,t,n,r,o){return"on-"===r.slice(0,3)?(e.removeAttribute(r),n.events=n.events||[],n.events.push({name:r.slice(3),value:o}),!0):"id"===r&&(n.id=o,!0)}},{key:"_contentForTemplate",value:function(e){var t=e._templateInfo;return t&&t.content||e.content}}]),l}()})}();</script><script>function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var _createClass=function(){function t(t,e){for(var a=0;a<e.length;a++){var r=e[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,a,r){return a&&t(e.prototype,a),r&&t(e,r),e}}(),_get=function t(e,a,r){null===e&&(e=Function.prototype);var n=Object.getOwnPropertyDescriptor(e,a);if(void 0===n){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,a,r)}if("value"in n)return n.value;var o=n.get;if(void 0!==o)return o.call(r)},_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(){"use strict";function t(t,e){var a=t[e];if(a){if(!t.hasOwnProperty(e)){a=t[e]=Object.create(t[e]);for(var r in a)for(var n=a[r],i=a[r]=Array(n.length),o=0;o<n.length;o++)i[o]=n[o]}}else a=t[e]={};return a}function e(t,e,r,n,i,o){if(e){var s=!1,l=D++;for(var _ in r)a(t,e,l,_,r,n,i,o)&&(s=!0);return s}return!1}function a(t,e,a,n,i,o,s,l){var _=!1,h=e[s?Polymer.Path.root(n):n];if(h)for(var u,d=0,f=h.length;d<f&&(u=h[d]);d++)u.info&&u.info.lastRun===a||s&&!r(n,u.trigger)||(u.info&&(u.info.lastRun=a),u.fn(t,n,i,o,u.info,s,l),_=!0);return _}function r(t,e){if(e){var a=e.name;return a==t||e.structured&&Polymer.Path.isAncestor(a,t)||e.wildcard&&Polymer.Path.isDescendant(a,t)}return!0}function n(t,e,a,r,n){var i=t[n.methodName],o=n.property;i?i.call(t,t.__data[o],r[o]):n.dynamicFn||console.warn("observer method `"+n.methodName+"` not defined")}function i(t,e,r,n,i){var s=t[H.NOTIFY],l=void 0,_=D++;for(var h in e)e[h]&&(s&&a(t,s,_,h,r,n,i)?l=!0:i&&o(t,h,r)&&(l=!0));var u=void 0;l&&(u=t.__dataHost)&&u._invalidateProperties&&u._invalidateProperties()}function o(t,e,a){var r=Polymer.Path.root(e);return r!==e&&(s(t,Polymer.CaseMap.camelToDashCase(r)+"-changed",a[e],e),!0)}function s(t,e,a,r){var n={value:a,queueProperty:!0};r&&(n.path=r),t.dispatchEvent(new CustomEvent(e,{detail:n}))}function l(t,e,a,r,n,i){var o=(i?Polymer.Path.root(e):e)!=e?e:null,l=o?Polymer.Path.get(t,o):t.__data[e];o&&void 0===l&&(l=a[e]),s(t,n.eventName,l,o)}function _(t,e,a,r,n){var i=void 0,o=t.detail,s=o&&o.path;s?(r=Polymer.Path.translate(a,r,s),i=o&&o.value):i=t.target[a],i=n?!i:i,e[H.READ_ONLY]&&e[H.READ_ONLY][r]||!e._setPendingPropertyOrPath(r,i,!0,Boolean(s))||o&&o.queueProperty||e._invalidateProperties()}function h(t,e,a,r,n){var i=t.__data[e];Polymer.sanitizeDOMValue&&(i=Polymer.sanitizeDOMValue(i,n.attrName,"attribute",t)),t._propertyToAttribute(e,n.attrName,i)}function u(t,a,r,n){var i=t[H.COMPUTE];if(i)for(var o=a;e(t,i,o,r,n);)Object.assign(r,t.__dataOld),Object.assign(a,t.__dataPending),o=t.__dataPending,t.__dataPending=null}function d(t,e,a,r,n){var i=k(t,e,a,r,n),o=n.methodInfo;t.__dataHasAccessor&&t.__dataHasAccessor[o]?t._setPendingProperty(o,i,!0):t[o]=i}function f(t,e,a){var r=t.__dataLinkedPaths;if(r){var n=void 0;for(var i in r){var o=r[i];Polymer.Path.isDescendant(i,e)?(n=Polymer.Path.translate(i,o,e),t._setPendingPropertyOrPath(n,a,!0,!0)):Polymer.Path.isDescendant(o,e)&&(n=Polymer.Path.translate(o,i,e),t._setPendingPropertyOrPath(n,a,!0,!0))}}}function p(t,e,a,r,n,i,o){a.bindings=a.bindings||[];var s={kind:r,target:n,parts:i,literal:o,isCompound:1!==i.length};if(a.bindings.push(s),g(s)){var l=s.parts[0],_=l.event,h=l.negate;s.listenerEvent=_||w.camelToDashCase(n)+"-changed",s.listenerNegate=h}for(var u=e.nodeInfoList.length,d=0;d<s.parts.length;d++){var f=s.parts[d];f.compoundIndex=d,c(t,e,s,f,u)}}function c(t,e,a,r,n){if(!r.literal)if("attribute"===a.kind&&"-"===a.target[0])console.warn("Cannot set attribute "+a.target+' because "-" is not a valid attribute starting character');else for(var i=r.dependencies,o={index:n,binding:a,part:r,evaluator:t},s=0;s<i.length;s++){var l=i[s];"string"==typeof l&&((l=A(l)).wildcard=!0),t._addTemplatePropertyEffect(e,l.rootProperty,{fn:y,info:o,trigger:l})}}function y(t,e,a,r,n,i,o){var s=o[n.index],l=n.binding,_=n.part;if(i&&_.source&&e.length>_.source.length&&"property"==l.kind&&!l.isCompound&&s.__dataHasAccessor&&s.__dataHasAccessor[l.target]){var h=a[e];e=Polymer.Path.translate(_.source,l.target,e),s._setPendingPropertyOrPath(e,h,!1,!0)&&t._enqueueClient(s)}else P(t,s,l,_,n.evaluator._evaluateBinding(t,_,e,a,r,i))}function P(t,e,a,r,n){if(n=v(e,n,a,r),Polymer.sanitizeDOMValue&&(n=Polymer.sanitizeDOMValue(n,a.target,a.kind,e)),"attribute"==a.kind)t._valueToNodeAttribute(e,n,a.target);else{var i=a.target;e.__dataHasAccessor&&e.__dataHasAccessor[i]?e[H.READ_ONLY]&&e[H.READ_ONLY][i]||e._setPendingProperty(i,n)&&t._enqueueClient(e):t._setUnmanagedPropertyToNode(e,i,n)}}function v(t,e,a,r){if(a.isCompound){var n=t.__dataCompoundStorage[a.target];n[r.compoundIndex]=e,e=n.join("")}return"attribute"!==a.kind&&("textContent"===a.target||"input"==t.localName&&"value"==a.target)&&(e=void 0==e?"":e),e}function g(t){return Boolean(t.target)&&"attribute"!=t.kind&&"text"!=t.kind&&!t.isCompound&&"{"===t.parts[0].mode}function m(t,e){var a=e.nodeList,r=e.nodeInfoList;if(r.length)for(var n=0;n<r.length;n++){var i=r[n],o=a[n],s=i.bindings;if(s)for(var l=0;l<s.length;l++){var _=s[l];O(o,_),b(o,t,_)}o.__dataHost=t}}function O(t,e){if(e.isCompound){for(var a=t.__dataCompoundStorage||(t.__dataCompoundStorage={}),r=e.parts,n=new Array(r.length),i=0;i<r.length;i++)n[i]=r[i].literal;var o=e.target;a[o]=n,e.literal&&"property"==e.kind&&(t[o]=e.literal)}}function b(t,e,a){if(a.listenerEvent){var r=a.parts[0];t.addEventListener(a.listenerEvent,function(t){_(t,e,a.target,r.source,r.negate)})}}function E(t,e,a,r,n,i){i=e.static||i&&("object"!==(void 0===i?"undefined":_typeof(i))||i[e.methodName]);for(var o,s={methodName:e.methodName,args:e.args,methodInfo:n,dynamicFn:i},l=0;l<e.args.length&&(o=e.args[l]);l++)o.literal||t._addPropertyEffect(o.rootProperty,a,{fn:r,info:s,trigger:o});i&&t._addPropertyEffect(e.methodName,a,{fn:r,info:s})}function k(t,e,a,r,n){var i=t._methodHost||t,o=i[n.methodName];if(o){var s=R(t.__data,n.args,e,a);return o.apply(i,s)}n.dynamicFn||console.warn("method `"+n.methodName+"` not defined")}function C(t){for(var e="",a=0;a<t.length;a++)e+=t[a].literal||"";return e}function T(t){var e=t.match(/([^\s]+?)\(([\s\S]*)\)/);if(e){var a={methodName:e[1],static:!0,args:S};return e[2].trim()?N(e[2].replace(/\\,/g,"&comma;").split(","),a):a}return null}function N(t,e){return e.args=t.map(function(t){var a=A(t);return a.literal||(e.static=!1),a},this),e}function A(t){var e=t.trim().replace(/&comma;/g,",").replace(/\\(.)/g,"$1"),a={name:e,value:"",literal:!1},r=e[0];switch("-"===r&&(r=e[1]),r>="0"&&r<="9"&&(r="#"),r){case"'":case'"':a.value=e.slice(1,-1),a.literal=!0;break;case"#":a.value=Number(e),a.literal=!0}return a.literal||(a.rootProperty=Polymer.Path.root(e),a.structured=Polymer.Path.isPath(e),a.structured&&(a.wildcard=".*"==e.slice(-2),a.wildcard&&(a.name=e.slice(0,-2)))),a}function R(t,e,a,r){for(var n=[],i=0,o=e.length;i<o;i++){var s=e[i],l=s.name,_=void 0;if(s.literal?_=s.value:s.structured?void 0===(_=Polymer.Path.get(t,l))&&(_=r[l]):_=t[l],s.wildcard){var h=0===l.indexOf(a+"."),u=0===a.indexOf(l)&&!h;n[i]={path:u?a:l,value:u?r[a]:_,base:_}}else n[i]=_}return n}function I(t,e,a,r){var n=a+".splices";t.notifyPath(n,{indexSplices:r}),t.notifyPath(a+".length",e.length),t.__data[n]={indexSplices:null}}function L(t,e,a,r,n,i){I(t,e,a,[{index:r,addedCount:n,removed:i,object:e,type:"splice"}])}function x(t){return t[0].toUpperCase()+t.substring(1)}var w=Polymer.CaseMap,D=0,H={COMPUTE:"__computeEffects",REFLECT:"__reflectEffects",NOTIFY:"__notifyEffects",PROPAGATE:"__propagateEffects",OBSERVE:"__observeEffects",READ_ONLY:"__readOnly"},j=void 0,S=[],F=new RegExp("(\\[\\[|{{)\\s*(?:(!)\\s*)?((?:[a-zA-Z_$][\\w.:$\\-*]*)\\s*(?:\\(\\s*(?:(?:(?:((?:[a-zA-Z_$][\\w.:$\\-*]*)|(?:[-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?)|(?:(?:'(?:[^'\\\\]|\\\\.)*')|(?:\"(?:[^\"\\\\]|\\\\.)*\")))\\s*)(?:,\\s*(?:((?:[a-zA-Z_$][\\w.:$\\-*]*)|(?:[-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?)|(?:(?:'(?:[^'\\\\]|\\\\.)*')|(?:\"(?:[^\"\\\\]|\\\\.)*\")))\\s*))*)?)\\)\\s*)?)(?:]]|}})","g");Polymer.PropertyEffects=Polymer.dedupingMixin(function(a){var r=Polymer.TemplateStamp(Polymer.PropertyAccessors(a)),o=function(a){function o(){_classCallCheck(this,o);var t=_possibleConstructorReturn(this,(o.__proto__||Object.getPrototypeOf(o)).call(this));return t.__dataClientsReady,t.__dataPendingClients,t.__dataToNotify,t.__dataLinkedPaths,t.__dataHasPaths,t.__dataCompoundStorage,t.__dataHost,t.__dataTemp,t.__dataClientsInitialized,t.__data,t.__dataPending,t.__dataOld,t.__computeEffects,t.__reflectEffects,t.__notifyEffects,t.__propagateEffects,t.__observeEffects,t.__readOnly,t.__dataCounter,t.__templateInfo,t}return _inherits(o,r),_createClass(o,[{key:"_initializeProperties",value:function(){_get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"_initializeProperties",this).call(this),Y.registerHost(this),this.__dataClientsReady=!1,this.__dataPendingClients=null,this.__dataToNotify=null,this.__dataLinkedPaths=null,this.__dataHasPaths=!1,this.__dataCompoundStorage=this.__dataCompoundStorage||null,this.__dataHost=this.__dataHost||null,this.__dataTemp={},this.__dataClientsInitialized=!1}},{key:"_initializeProtoProperties",value:function(t){this.__data=Object.create(t),this.__dataPending=Object.create(t),this.__dataOld={}}},{key:"_initializeInstanceProperties",value:function(t){var e=this[H.READ_ONLY];for(var a in t)e&&e[a]||(this.__dataPending=this.__dataPending||{},this.__dataOld=this.__dataOld||{},this.__data[a]=this.__dataPending[a]=t[a])}},{key:"_addPropertyEffect",value:function(e,a,r){this._createPropertyAccessor(e,a==H.READ_ONLY);var n=t(this,a)[e];n||(n=this[a][e]=[]),n.push(r)}},{key:"_removePropertyEffect",value:function(e,a,r){var n=t(this,a)[e],i=n.indexOf(r);i>=0&&n.splice(i,1)}},{key:"_hasPropertyEffect",value:function(t,e){var a=this[e];return Boolean(a&&a[t])}},{key:"_hasReadOnlyEffect",value:function(t){return this._hasPropertyEffect(t,H.READ_ONLY)}},{key:"_hasNotifyEffect",value:function(t){return this._hasPropertyEffect(t,H.NOTIFY)}},{key:"_hasReflectEffect",value:function(t){return this._hasPropertyEffect(t,H.REFLECT)}},{key:"_hasComputedEffect",value:function(t){return this._hasPropertyEffect(t,H.COMPUTE)}},{key:"_setPendingPropertyOrPath",value:function(t,e,a,r){if(r||Polymer.Path.root(Array.isArray(t)?t[0]:t)!==t){if(!r){var n=Polymer.Path.get(this,t);if(!(t=Polymer.Path.set(this,t,e))||!_get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"_shouldPropertyChange",this).call(this,t,e,n))return!1}if(this.__dataHasPaths=!0,this._setPendingProperty(t,e,a))return f(this,t,e),!0}else{if(this.__dataHasAccessor&&this.__dataHasAccessor[t])return this._setPendingProperty(t,e,a);this[t]=e}return!1}},{key:"_setUnmanagedPropertyToNode",value:function(t,e,a){a===t[e]&&"object"!=(void 0===a?"undefined":_typeof(a))||(t[e]=a)}},{key:"_setPendingProperty",value:function(t,e,a){var r=this.__dataHasPaths&&Polymer.Path.isPath(t),n=r?this.__dataTemp:this.__data;return!!this._shouldPropertyChange(t,e,n[t])&&(this.__dataPending||(this.__dataPending={},this.__dataOld={}),t in this.__dataOld||(this.__dataOld[t]=this.__data[t]),r?this.__dataTemp[t]=e:this.__data[t]=e,this.__dataPending[t]=e,(r||this[H.NOTIFY]&&this[H.NOTIFY][t])&&(this.__dataToNotify=this.__dataToNotify||{},this.__dataToNotify[t]=a),!0)}},{key:"_setProperty",value:function(t,e){this._setPendingProperty(t,e,!0)&&this._invalidateProperties()}},{key:"_invalidateProperties",value:function(){this.__dataReady&&this._flushProperties()}},{key:"_enqueueClient",value:function(t){this.__dataPendingClients=this.__dataPendingClients||[],t!==this&&this.__dataPendingClients.push(t)}},{key:"_flushClients",value:function(){this.__dataClientsReady?this.__enableOrFlushClients():(this.__dataClientsReady=!0,this._readyClients(),this.__dataReady=!0)}},{key:"__enableOrFlushClients",value:function(){var t=this.__dataPendingClients;if(t){this.__dataPendingClients=null;for(var e=0;e<t.length;e++){var a=t[e];a.__dataEnabled?a.__dataPending&&a._flushProperties():a._enableProperties()}}}},{key:"_readyClients",value:function(){this.__enableOrFlushClients()}},{key:"setProperties",value:function(t,e){for(var a in t)!e&&this[H.READ_ONLY]&&this[H.READ_ONLY][a]||this._setPendingPropertyOrPath(a,t[a],!0);this._invalidateProperties()}},{key:"ready",value:function(){this._flushProperties(),this.__dataClientsReady||this._flushClients(),this.__dataPending&&this._flushProperties()}},{key:"_propertiesChanged",value:function(t,a,r){var n=this.__dataHasPaths;this.__dataHasPaths=!1,u(this,a,r,n);var o=this.__dataToNotify;this.__dataToNotify=null,this._propagatePropertyChanges(a,r,n),this._flushClients(),e(this,this[H.REFLECT],a,r,n),e(this,this[H.OBSERVE],a,r,n),o&&i(this,o,a,r,n),1==this.__dataCounter&&(this.__dataTemp={})}},{key:"_propagatePropertyChanges",value:function(t,a,r){this[H.PROPAGATE]&&e(this,this[H.PROPAGATE],t,a,r);for(var n=this.__templateInfo;n;)e(this,n.propertyEffects,t,a,r,n.nodeList),n=n.nextTemplateInfo}},{key:"linkPaths",value:function(t,e){t=Polymer.Path.normalize(t),e=Polymer.Path.normalize(e),this.__dataLinkedPaths=this.__dataLinkedPaths||{},this.__dataLinkedPaths[t]=e}},{key:"unlinkPaths",value:function(t){t=Polymer.Path.normalize(t),this.__dataLinkedPaths&&delete this.__dataLinkedPaths[t]}},{key:"notifySplices",value:function(t,e){var a={path:""};I(this,Polymer.Path.get(this,t,a),a.path,e)}},{key:"get",value:function(t,e){return Polymer.Path.get(e||this,t)}},{key:"set",value:function(t,e,a){a?Polymer.Path.set(a,t,e):this[H.READ_ONLY]&&this[H.READ_ONLY][t]||this._setPendingPropertyOrPath(t,e,!0)&&this._invalidateProperties()}},{key:"push",value:function(t){for(var e={path:""},a=Polymer.Path.get(this,t,e),r=a.length,n=arguments.length,i=Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];var s=a.push.apply(a,i);return i.length&&L(this,a,e.path,r,i.length,[]),s}},{key:"pop",value:function(t){var e={path:""},a=Polymer.Path.get(this,t,e),r=Boolean(a.length),n=a.pop();return r&&L(this,a,e.path,a.length,0,[n]),n}},{key:"splice",value:function(t,e,a){var r={path:""},n=Polymer.Path.get(this,t,r);(e=e<0?n.length-Math.floor(-e):Math.floor(e))||(e=0);for(var i=arguments.length,o=Array(i>3?i-3:0),s=3;s<i;s++)o[s-3]=arguments[s];var l=n.splice.apply(n,[e,a].concat(o));return(o.length||l.length)&&L(this,n,r.path,e,o.length,l),l}},{key:"shift",value:function(t){var e={path:""},a=Polymer.Path.get(this,t,e),r=Boolean(a.length),n=a.shift();return r&&L(this,a,e.path,0,0,[n]),n}},{key:"unshift",value:function(t){for(var e={path:""},a=Polymer.Path.get(this,t,e),r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];var o=a.unshift.apply(a,n);return n.length&&L(this,a,e.path,0,n.length,[]),o}},{key:"notifyPath",value:function(t,e){var a=void 0;if(1==arguments.length){var r={path:""};e=Polymer.Path.get(this,t,r),a=r.path}else a=Array.isArray(t)?Polymer.Path.normalize(t):t;this._setPendingPropertyOrPath(a,e,!0,!0)&&this._invalidateProperties()}},{key:"_createReadOnlyProperty",value:function(t,e){this._addPropertyEffect(t,H.READ_ONLY),e&&(this["_set"+x(t)]=function(e){this._setProperty(t,e)})}},{key:"_createPropertyObserver",value:function(t,e,a){var r={property:t,methodName:e,dynamicFn:Boolean(a)};this._addPropertyEffect(t,H.OBSERVE,{fn:n,info:r,trigger:{name:t}}),a&&this._addPropertyEffect(e,H.OBSERVE,{fn:n,info:r,trigger:{name:e}})}},{key:"_createMethodObserver",value:function(t,e){var a=T(t);if(!a)throw new Error("Malformed observer expression '"+t+"'");E(this,a,H.OBSERVE,k,null,e)}},{key:"_createNotifyingProperty",value:function(t){this._addPropertyEffect(t,H.NOTIFY,{fn:l,info:{eventName:w.camelToDashCase(t)+"-changed",property:t}})}},{key:"_createReflectedProperty",value:function(t){var e=w.camelToDashCase(t);"-"===e[0]?console.warn("Property "+t+" cannot be reflected to attribute "+e+' because "-" is not a valid starting attribute name. Use a lowercase first letter for the property thisead.'):this._addPropertyEffect(t,H.REFLECT,{fn:h,info:{attrName:e}})}},{key:"_createComputedProperty",value:function(t,e,a){var r=T(e);if(!r)throw new Error("Malformed computed expression '"+e+"'");E(this,r,H.COMPUTE,d,t,a)}},{key:"_bindTemplate",value:function(t,e){var a=this.constructor._parseTemplate(t),r=this.__templateInfo==a;if(!r)for(var n in a.propertyEffects)this._createPropertyAccessor(n);if(e&&(a=Object.create(a),a.wasPreBound=r,!r&&this.__templateInfo)){var i=this.__templateInfoLast||this.__templateInfo;return this.__templateInfoLast=i.nextTemplateInfo=a,a.previousTemplateInfo=i,a}return this.__templateInfo=a}},{key:"_stampTemplate",value:function(t){Y.beginHosting(this);var a=_get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"_stampTemplate",this).call(this,t);Y.endHosting(this);var r=this._bindTemplate(t,!0);if(r.nodeList=a.nodeList,!r.wasPreBound)for(var n=r.childNodes=[],i=a.firstChild;i;i=i.nextSibling)n.push(i);return a.templateInfo=r,m(this,r),this.__dataReady&&e(this,r.propertyEffects,this.__data,null,!1,r.nodeList),a}},{key:"_removeBoundDom",value:function(t){var e=t.templateInfo;e.previousTemplateInfo&&(e.previousTemplateInfo.nextTemplateInfo=e.nextTemplateInfo),e.nextTemplateInfo&&(e.nextTemplateInfo.previousTemplateInfo=e.previousTemplateInfo),this.__templateInfoLast==e&&(this.__templateInfoLast=e.previousTemplateInfo),e.previousTemplateInfo=e.nextTemplateInfo=null;for(var a=e.childNodes,r=0;r<a.length;r++){var n=a[r];n.parentNode.removeChild(n)}}},{key:"PROPERTY_EFFECT_TYPES",get:function(){return H}}],[{key:"addPropertyEffect",value:function(t,e,a){this.prototype._addPropertyEffect(t,e,a)}},{key:"createPropertyObserver",value:function(t,e,a){this.prototype._createPropertyObserver(t,e,a)}},{key:"createMethodObserver",value:function(t,e){this.prototype._createMethodObserver(t,e)}},{key:"createNotifyingProperty",value:function(t){this.prototype._createNotifyingProperty(t)}},{key:"createReadOnlyProperty",value:function(t,e){this.prototype._createReadOnlyProperty(t,e)}},{key:"createReflectedProperty",value:function(t){this.prototype._createReflectedProperty(t)}},{key:"createComputedProperty",value:function(t,e,a){this.prototype._createComputedProperty(t,e,a)}},{key:"bindTemplate",value:function(t){return this.prototype._bindTemplate(t)}},{key:"_addTemplatePropertyEffect",value:function(t,e,a){(t.hostProps=t.hostProps||{})[e]=!0;var r=t.propertyEffects=t.propertyEffects||{};(r[e]=r[e]||[]).push(a)}},{key:"_parseTemplateNode",value:function(t,e,a){var r=_get(o.__proto__||Object.getPrototypeOf(o),"_parseTemplateNode",this).call(this,t,e,a);if(t.nodeType===Node.TEXT_NODE){var n=this._parseBindings(t.textContent,e);n&&(t.textContent=C(n)||" ",p(this,e,a,"text","textContent",n),r=!0)}return r}},{key:"_parseTemplateNodeAttribute",value:function(t,e,a,r,n){var i=this._parseBindings(n,e);if(i){var s=r,l="property";"$"==r[r.length-1]&&(r=r.slice(0,-1),l="attribute");var _=C(i);return _&&"attribute"==l&&t.setAttribute(r,_),"input"===t.localName&&"value"===s&&t.setAttribute(s,""),t.removeAttribute(s),"property"===l&&(r=Polymer.CaseMap.dashToCamelCase(r)),p(this,e,a,l,r,i,_),!0}return _get(o.__proto__||Object.getPrototypeOf(o),"_parseTemplateNodeAttribute",this).call(this,t,e,a,r,n)}},{key:"_parseTemplateNestedTemplate",value:function(t,e,a){var r=_get(o.__proto__||Object.getPrototypeOf(o),"_parseTemplateNestedTemplate",this).call(this,t,e,a),n=a.templateInfo.hostProps;for(var i in n)p(this,e,a,"property","_host_"+i,[{mode:"{",source:i,dependencies:[i]}]);return r}},{key:"_parseBindings",value:function(t,e){for(var a=[],r=0,n=void 0;null!==(n=F.exec(t));){n.index>r&&a.push({literal:t.slice(r,n.index)});var i=n[1][0],o=Boolean(n[2]),s=n[3].trim(),l=!1,_="",h=-1;"{"==i&&(h=s.indexOf("::"))>0&&(_=s.substring(h+2),s=s.substring(0,h),l=!0);var u=T(s),d=[];if(u){for(var f=u.args,p=u.methodName,c=0;c<f.length;c++){var y=f[c];y.literal||d.push(y)}var P=e.dynamicFns;(P&&P[p]||u.static)&&(d.push(p),u.dynamicFn=!0)}else d.push(s);a.push({source:s,mode:i,negate:o,customEvent:l,signature:u,dependencies:d,event:_}),r=F.lastIndex}if(r&&r<t.length){var v=t.substring(r);v&&a.push({literal:v})}return a.length?a:null}},{key:"_evaluateBinding",value:function(t,e,a,r,n,i){var o=void 0;return o=e.signature?k(t,a,r,0,e.signature):a!=e.source?Polymer.Path.get(t,e.source):i&&Polymer.Path.isPath(a)?Polymer.Path.get(t,a):t.__data[a],e.negate&&(o=!o),o}}]),o}();return j=o,o});var Y={stack:[],registerHost:function(t){this.stack.length&&this.stack[this.stack.length-1]._enqueueClient(t)},beginHosting:function(t){this.stack.push(t)},endHosting:function(t){var e=this.stack.length;e&&this.stack[e-1]==t&&this.stack.pop()}}}();</script><script>function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),_get=function e(t,r,o){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,r);if(void 0===i){var n=Object.getPrototypeOf(t);return null===n?void 0:e(n,r,o)}if("value"in i)return i.value;var s=i.get;if(void 0!==s)return s.call(o)};!function(){"use strict";Polymer.ElementMixin=Polymer.dedupingMixin(function(e){function t(e){return e.hasOwnProperty(JSCompiler_renameProperty("__ownProperties",e))||(e.__ownProperties=e.hasOwnProperty(JSCompiler_renameProperty("properties",e))?e.properties:{}),e.__ownProperties}function r(e){return e.hasOwnProperty(JSCompiler_renameProperty("__ownObservers",e))||(e.__ownObservers=e.hasOwnProperty(JSCompiler_renameProperty("observers",e))?e.observers:[]),e.__ownObservers}function o(e,t){for(var r in t){var o=t[r];"function"==typeof o&&(o={type:o}),e[r]=o}return e}function i(e){if(!e.hasOwnProperty(JSCompiler_renameProperty("__classProperties",e))){e.__classProperties=o({},t(e));var r=Object.getPrototypeOf(e.prototype).constructor;r.prototype instanceof f&&(e.__classProperties=Object.assign(Object.create(i(r)),e.__classProperties))}return e.__classProperties}function n(e){if(!e.hasOwnProperty(JSCompiler_renameProperty("__classPropertyDefaults",e))){e.__classPropertyDefaults=null;var t=i(e);for(var r in t){var o=t[r];"value"in o&&(e.__classPropertyDefaults=e.__classPropertyDefaults||{},e.__classPropertyDefaults[r]=o)}}return e.__classPropertyDefaults}function s(e){return e.hasOwnProperty(JSCompiler_renameProperty("__finalized",e))}function a(e){var t=e.prototype,r=Object.getPrototypeOf(t).constructor;r.prototype instanceof f&&r.finalize(),l(e)}function l(e){e.__finalized=!0;var o=e.prototype;e.hasOwnProperty(JSCompiler_renameProperty("is",e))&&e.is&&Polymer.telemetry.register(o);var i=t(e);i&&p(o,i);var n=r(e);n&&c(o,n,i);var s=e.template;if(s){if("string"==typeof s){var a=document.createElement("template");a.innerHTML=s,s=a}else s=s.cloneNode(!0);o._template=s}}function p(e,t){for(var r in t)y(e,r,t[r],t)}function c(e,t,r){for(var o=0;o<t.length;o++)e._createMethodObserver(t[o],r)}function y(e,t,r,o){r.computed&&(r.readOnly=!0),r.computed&&!e._hasReadOnlyEffect(t)&&e._createComputedProperty(t,r.computed,o),r.readOnly&&!e._hasReadOnlyEffect(t)&&e._createReadOnlyProperty(t,!r.computed),r.reflectToAttribute&&!e._hasReflectEffect(t)&&e._createReflectedProperty(t),r.notify&&!e._hasNotifyEffect(t)&&e._createNotifyingProperty(t),r.observer&&e._createPropertyObserver(t,r.observer,o[r.observer])}function h(e,t,r,o,i){var n=Polymer.StyleGather.cssFromTemplate(t,r)+Polymer.StyleGather.cssFromModuleImports(o);if(n){var s=document.createElement("style");s.textContent=n,t.content.insertBefore(s,t.content.firstChild)}window.ShadyCSS&&window.ShadyCSS.prepareTemplate(t,o,i),e._bindTemplate(t)}var u=Polymer.PropertyEffects(e),_=Polymer.CaseMap,f=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,u),_createClass(t,[{key:"_initializeProperties",value:function(){Polymer.telemetry.instanceCount++,this.constructor.finalize();var e=this.constructor.importPath;if(this._template&&!this._template.__polymerFinalized){this._template.__polymerFinalized=!0;var r=e?Polymer.ResolveUrl.resolveUrl(e):"";h(this.__proto__,this._template,r,this.localName)}_get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initializeProperties",this).call(this),this.rootPath=Polymer.rootPath,this.importPath=e;var o=n(this.constructor);if(o)for(var i in o){var s=o[i];if(!this.hasOwnProperty(i)){var a="function"==typeof s.value?s.value.call(this):s.value;this._hasAccessor(i)?this._setPendingProperty(i,a,!0):this[i]=a}}}},{key:"connectedCallback",value:function(){window.ShadyCSS&&this._template&&window.ShadyCSS.styleElement(this),this._enableProperties()}},{key:"disconnectedCallback",value:function(){}},{key:"ready",value:function(){this._template&&(this.root=this._stampTemplate(this._template),this.$=this.root.$),_get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"ready",this).call(this)}},{key:"_readyClients",value:function(){this._template&&(this.root=this._attachDom(this.root)),_get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_readyClients",this).call(this)}},{key:"_attachDom",value:function(e){if(this.attachShadow)return e?(this.shadowRoot||this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(e),this.shadowRoot):null;throw new Error("ShadowDOM not available. Polymer.Element can create dom as children instead of in ShadowDOM by setting `this.root = this;` before `ready`.")}},{key:"attributeChangedCallback",value:function(e,t,r){if(t!==r){var o=_.dashToCamelCase(e),n=i(this.constructor)[o].type;this._hasReadOnlyEffect(o)||this._attributeToProperty(e,r,n)}}},{key:"updateStyles",value:function(e){window.ShadyCSS&&window.ShadyCSS.styleSubtree(this,e)}},{key:"resolveUrl",value:function(e,t){return!t&&this.importPath&&(t=Polymer.ResolveUrl.resolveUrl(this.importPath)),Polymer.ResolveUrl.resolveUrl(e,t)}}],[{key:"finalize",value:function(){s(this)||a(this)}},{key:"_parseTemplateContent",value:function(e,r,o){return r.dynamicFns=r.dynamicFns||i(this),_get(t.__proto__||Object.getPrototypeOf(t),"_parseTemplateContent",this).call(this,e,r,o)}},{key:"observedAttributes",get:function(){if(!this.hasOwnProperty(JSCompiler_renameProperty("__observedAttributes",this))){var e=[],t=i(this);for(var r in t)e.push(Polymer.CaseMap.camelToDashCase(r));this.__observedAttributes=e}return this.__observedAttributes}},{key:"template",get:function(){return this.hasOwnProperty(JSCompiler_renameProperty("_template",this))||(this._template=Polymer.DomModule&&Polymer.DomModule.import(this.is,"template")||Object.getPrototypeOf(this.prototype).constructor.template),this._template}},{key:"importPath",get:function(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_importPath",this))){var e=Polymer.DomModule&&Polymer.DomModule.import(this.is);this._importPath=e?e.assetpath:Object.getPrototypeOf(this.prototype).constructor.importPath}return this._importPath}}]),t}();return f}),Polymer.telemetry={instanceCount:0,registrations:[],_regLog:function(e){console.log("["+e.is+"]: registered")},register:function(e){this.registrations.push(e),Polymer.log&&this._regLog(e)},dumpRegistrations:function(){this.registrations.forEach(this._regLog)}},Polymer.updateStyles=function(e){window.ShadyCSS&&window.ShadyCSS.styleDocument(e)}}();</script><script>function _classCallCheck(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function e(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(n,t,i){return t&&e(n.prototype,t),i&&e(n,i),n}}();!function(){"use strict";var e=function(){function e(){_classCallCheck(this,e),this._asyncModule=null,this._callback=null,this._timer=null}return _createClass(e,[{key:"setConfig",value:function(e,n){var t=this;this._asyncModule=e,this._callback=n,this._timer=this._asyncModule.run(function(){t._timer=null,t._callback()})}},{key:"cancel",value:function(){this.isActive()&&(this._asyncModule.cancel(this._timer),this._timer=null)}},{key:"flush",value:function(){this.isActive()&&(this.cancel(),this._callback())}},{key:"isActive",value:function(){return null!=this._timer}}],[{key:"debounce",value:function(n,t,i){return n instanceof e?n.cancel():n=new e,n.setConfig(t,i),n}}]),e}();Polymer.Debouncer=e}();</script><script>!function(){"use strict";function e(e){for(var t,n=l?["click"]:f,o=0;o<n.length;o++)t=n[o],e?document.addEventListener(t,p,!0):document.removeEventListener(t,p,!0)}function t(e){var t=e.type;if(-1===f.indexOf(t))return!1;if("mousemove"===t){var n=void 0===e.buttons?1:e.buttons;return e instanceof window.MouseEvent&&!d&&(n=h[e.which]||0),Boolean(1&n)}return 0===(void 0===e.button?0:e.button)}function n(e){if("click"===e.type){if(0===e.detail)return!0;var t=y._findOriginalTarget(e);if(!t.nodeType||t.nodeType!==Node.ELEMENT_NODE)return!0;var n=t.getBoundingClientRect(),o=e.pageX,i=e.pageY;return!(o>=n.left&&o<=n.right&&i>=n.top&&i<=n.bottom)}return!1}function o(e){var t="auto",n=e.composedPath&&e.composedPath();if(n)for(var o,i=0;i<n.length;i++)if((o=n[i])[c]){t=o[c];break}return t}function i(e,t,n){e.movefn=t,e.upfn=n,document.addEventListener("mousemove",t),document.addEventListener("mouseup",n)}function r(e){document.removeEventListener("mousemove",e.movefn),document.removeEventListener("mouseup",e.upfn),e.movefn=null,e.upfn=null}var s="string"==typeof document.head.style.touchAction,u="__polymerGesturesHandled",c="__polymerGesturesTouchAction",a=2500,f=["mousedown","mousemove","mouseup","click"],h=[0,1,4,2],d=function(){try{return 1===new MouseEvent("test",{buttons:1}).buttons}catch(e){return!1}}(),v=!1;!function(){try{var e=Object.defineProperty({},"passive",{get:function(){v=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}}();var l=navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/),m=function(){};m.prototype.reset=function(){},m.prototype.mousedown,m.prototype.mousemove,m.prototype.mouseup,m.prototype.touchstart,m.prototype.touchmove,m.prototype.touchend,m.prototype.click;var p=function(e){var t=e.sourceCapabilities;if((!t||t.firesTouchEvents)&&(e[u]={skip:!0},"click"===e.type)){var n=e.composedPath&&e.composedPath();if(n)for(var o=0;o<n.length;o++)if(n[o]===g.mouse.target)return;e.preventDefault(),e.stopPropagation()}},g={mouse:{target:null,mouseIgnoreJob:null},touch:{x:0,y:0,id:-1,scrollDecided:!1}};document.addEventListener("touchend",function(t){g.mouse.mouseIgnoreJob||e(!0);g.mouse.target=t.composedPath()[0],g.mouse.mouseIgnoreJob=Polymer.Debouncer.debounce(g.mouse.mouseIgnoreJob,Polymer.Async.timeOut.after(a),function(){e(),g.mouse.target=null,g.mouse.mouseIgnoreJob=null})},!!v&&{passive:!0});var y={gestures:{},recognizers:[],deepTargetFind:function(e,t){for(var n=document.elementFromPoint(e,t),o=n;o&&o.shadowRoot&&!window.ShadyDOM;){var i=o;if(o=o.shadowRoot.elementFromPoint(e,t),i===o)break;o&&(n=o)}return n},_findOriginalTarget:function(e){return e.composedPath?e.composedPath()[0]:e.target},_handleNative:function(e){var t=void 0,n=e.type,o=e.currentTarget.__polymerGestures;if(o){var i=o[n];if(i){if(!e[u]&&(e[u]={},"touch"===n.slice(0,5))){var r=(e=e).changedTouches[0];if("touchstart"===n&&1===e.touches.length&&(g.touch.id=r.identifier),g.touch.id!==r.identifier)return;s||"touchstart"!==n&&"touchmove"!==n||y._handleTouchAction(e)}if(!(t=e[u]).skip){for(var c,a=y.recognizers,f=0;f<a.length;f++)i[(c=a[f]).name]&&!t[c.name]&&c.flow&&c.flow.start.indexOf(e.type)>-1&&c.reset&&c.reset();for(var h,d=0;d<a.length;d++)i[(h=a[d]).name]&&!t[h.name]&&(t[h.name]=!0,h[n](e))}}}},_handleTouchAction:function(e){var t=e.changedTouches[0],n=e.type;if("touchstart"===n)g.touch.x=t.clientX,g.touch.y=t.clientY,g.touch.scrollDecided=!1;else if("touchmove"===n){if(g.touch.scrollDecided)return;g.touch.scrollDecided=!0;var i=o(e),r=!1,s=Math.abs(g.touch.x-t.clientX),u=Math.abs(g.touch.y-t.clientY);e.cancelable&&("none"===i?r=!0:"pan-x"===i?r=u>s:"pan-y"===i&&(r=s>u)),r?e.preventDefault():y.prevent("track")}},addListener:function(e,t,n){return!!this.gestures[t]&&(this._add(e,t,n),!0)},removeListener:function(e,t,n){return!!this.gestures[t]&&(this._remove(e,t,n),!0)},_add:function(e,t,n){var o=this.gestures[t],i=o.deps,r=o.name,s=e.__polymerGestures;s||(e.__polymerGestures=s={});for(var u,c,a=0;a<i.length;a++)u=i[a],l&&f.indexOf(u)>-1&&"click"!==u||((c=s[u])||(s[u]=c={_count:0}),0===c._count&&e.addEventListener(u,this._handleNative),c[r]=(c[r]||0)+1,c._count=(c._count||0)+1);e.addEventListener(t,n),o.touchAction&&this.setTouchAction(e,o.touchAction)},_remove:function(e,t,n){var o=this.gestures[t],i=o.deps,r=o.name,s=e.__polymerGestures;if(s)for(var u,c,a=0;a<i.length;a++)(c=s[u=i[a]])&&c[r]&&(c[r]=(c[r]||1)-1,c._count=(c._count||1)-1,0===c._count&&e.removeEventListener(u,this._handleNative));e.removeEventListener(t,n)},register:function(e){this.recognizers.push(e);for(var t=0;t<e.emits.length;t++)this.gestures[e.emits[t]]=e},_findRecognizerByEvent:function(e){for(var t,n=0;n<this.recognizers.length;n++){t=this.recognizers[n];for(var o=0;o<t.emits.length;o++)if(t.emits[o]===e)return t}return null},setTouchAction:function(e,t){s&&(e.style.touchAction=t),e[c]=t},_fire:function(e,t,n){var o=new Event(t,{bubbles:!0,cancelable:!0,composed:!0});if(o.detail=n,e.dispatchEvent(o),o.defaultPrevented){var i=n.preventer||n.sourceEvent;i&&i.preventDefault&&i.preventDefault()}},prevent:function(e){var t=this._findRecognizerByEvent(e);t.info&&(t.info.prevent=!0)},resetMouseCanceller:function(){g.mouse.mouseIgnoreJob&&g.mouse.mouseIgnoreJob.flush()}};y.register({name:"downup",deps:["mousedown","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["down","up"],info:{movefn:null,upfn:null},reset:function(){r(this.info)},mousedown:function(e){if(t(e)){var n=y._findOriginalTarget(e),o=this;i(this.info,function(e){t(e)||(o._fire("up",n,e),r(o.info))},function(e){t(e)&&o._fire("up",n,e),r(o.info)}),this._fire("down",n,e)}},touchstart:function(e){this._fire("down",y._findOriginalTarget(e),e.changedTouches[0],e)},touchend:function(e){this._fire("up",y._findOriginalTarget(e),e.changedTouches[0],e)},_fire:function(e,t,n,o){y._fire(t,e,{x:n.clientX,y:n.clientY,sourceEvent:n,preventer:o,prevent:function(e){return y.prevent(e)}})}}),y.register({name:"track",touchAction:"none",deps:["mousedown","touchstart","touchmove","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["track"],info:{x:0,y:0,state:"start",started:!1,moves:[],addMove:function(e){this.moves.length>2&&this.moves.shift(),this.moves.push(e)},movefn:null,upfn:null,prevent:!1},reset:function(){this.info.state="start",this.info.started=!1,this.info.moves=[],this.info.x=0,this.info.y=0,this.info.prevent=!1,r(this.info)},hasMovedEnough:function(e,t){if(this.info.prevent)return!1;if(this.info.started)return!0;var n=Math.abs(this.info.x-e),o=Math.abs(this.info.y-t);return n>=5||o>=5},mousedown:function(e){if(t(e)){var n=y._findOriginalTarget(e),o=this,s=function(e){var i=e.clientX,s=e.clientY;o.hasMovedEnough(i,s)&&(o.info.state=o.info.started?"mouseup"===e.type?"end":"track":"start","start"===o.info.state&&y.prevent("tap"),o.info.addMove({x:i,y:s}),t(e)||(o.info.state="end",r(o.info)),o._fire(n,e),o.info.started=!0)};i(this.info,s,function(e){o.info.started&&s(e),r(o.info)}),this.info.x=e.clientX,this.info.y=e.clientY}},touchstart:function(e){var t=e.changedTouches[0];this.info.x=t.clientX,this.info.y=t.clientY},touchmove:function(e){var t=y._findOriginalTarget(e),n=e.changedTouches[0],o=n.clientX,i=n.clientY;this.hasMovedEnough(o,i)&&("start"===this.info.state&&y.prevent("tap"),this.info.addMove({x:o,y:i}),this._fire(t,n),this.info.state="track",this.info.started=!0)},touchend:function(e){var t=y._findOriginalTarget(e),n=e.changedTouches[0];this.info.started&&(this.info.state="end",this.info.addMove({x:n.clientX,y:n.clientY}),this._fire(t,n,e))},_fire:function(e,t){var n=this.info.moves[this.info.moves.length-2],o=this.info.moves[this.info.moves.length-1],i=o.x-this.info.x,r=o.y-this.info.y,s=void 0,u=0;n&&(s=o.x-n.x,u=o.y-n.y),y._fire(e,"track",{state:this.info.state,x:t.clientX,y:t.clientY,dx:i,dy:r,ddx:s,ddy:u,sourceEvent:t,hover:function(){return y.deepTargetFind(t.clientX,t.clientY)}})}}),y.register({name:"tap",deps:["mousedown","click","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["click","touchend"]},emits:["tap"],info:{x:NaN,y:NaN,prevent:!1},reset:function(){this.info.x=NaN,this.info.y=NaN,this.info.prevent=!1},save:function(e){this.info.x=e.clientX,this.info.y=e.clientY},mousedown:function(e){t(e)&&this.save(e)},click:function(e){t(e)&&this.forward(e)},touchstart:function(e){this.save(e.changedTouches[0],e)},touchend:function(e){this.forward(e.changedTouches[0],e)},forward:function(e,t){var o=Math.abs(e.clientX-this.info.x),i=Math.abs(e.clientY-this.info.y),r=y._findOriginalTarget(e);(isNaN(o)||isNaN(i)||o<=25&&i<=25||n(e))&&(this.info.prevent||y._fire(r,"tap",{x:e.clientX,y:e.clientY,sourceEvent:e,preventer:t}))}}),y.findOriginalTarget=y._findOriginalTarget,y.add=y.addListener,y.remove=y.removeListener,Polymer.Gestures=y}();</script><script>function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),_get=function e(t,r,o){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,r);if(void 0===n){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,r,o)}if("value"in n)return n.value;var u=n.get;if(void 0!==u)return u.call(o)};!function(){"use strict";var e=Polymer.Gestures;Polymer.GestureEventListeners=Polymer.dedupingMixin(function(t){return function(r){function o(){return _classCallCheck(this,o),_possibleConstructorReturn(this,(o.__proto__||Object.getPrototypeOf(o)).apply(this,arguments))}return _inherits(o,t),_createClass(o,[{key:"_addEventListenerToNode",value:function(t,r,n){e.addListener(t,r,n)||_get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"_addEventListenerToNode",this).call(this,t,r,n)}},{key:"_removeEventListenerFromNode",value:function(t,r,n){e.removeListener(t,r,n)||_get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"_removeEventListenerFromNode",this).call(this,t,r,n)}}]),o}()})}();</script><script>!function(){"use strict";function e(e){window.HTMLImports?HTMLImports.whenReady(e):e()}Polymer.importHref=function(t,n,r,o){var d=document.head.querySelector('link[href="'+t+'"][import-href]');d||((d=document.createElement("link")).rel="import",d.href=t,d.setAttribute("import-href","")),o&&d.setAttribute("async","");var i=function(){d.removeEventListener("load",a),d.removeEventListener("error",c)},a=function(t){i(),d.__dynamicImportLoaded=!0,n&&e(function(){n(t)})},c=function(t){i(),d.parentNode&&d.parentNode.removeChild(d),r&&e(function(){r(t)})};return d.addEventListener("load",a),d.addEventListener("error",c),null==d.parentNode?document.head.appendChild(d):d.__dynamicImportLoaded&&d.dispatchEvent(new Event("load")),d}}();</script><script>!function(){"use strict";function t(){f=!0,requestAnimationFrame(function(){f=!1,n(u),setTimeout(function(){e(i)})})}function n(t){for(;t.length;)o(t.shift())}function e(t){for(var n=0,e=t.length;n<e;n++)o(t.shift())}function o(t){var n=t[0],e=t[1],o=t[2];try{e.apply(n,o)}catch(t){setTimeout(function(){throw t})}}var f=!1,u=[],i=[];Polymer.RenderStatus={beforeNextRender:function(n,e,o){f||t(),u.push([n,e,o])},afterNextRender:function(n,e,o){f||t(),i.push([n,e,o])},flush:function(){for(;u.length||i.length;)n(u),n(i);f=!1}}}();</script><script>!function(){"use strict";function e(){document.body.removeAttribute("unresolved")}window.WebComponents?window.addEventListener("WebComponentsReady",e):"interactive"===document.readyState||"complete"===document.readyState?e():window.addEventListener("DOMContentLoaded",e)}();</script><script>!function(){"use strict";function r(r,e,n){return{index:r,removed:e,addedCount:n}}function e(r,e,n,t,u,o){for(var i=o-u+1,f=n-e+1,s=new Array(i),h=0;h<i;h++)s[h]=new Array(f),s[h][0]=h;for(var v=0;v<f;v++)s[0][v]=v;for(var c=1;c<i;c++)for(var d=1;d<f;d++)if(a(r[e+d-1],t[u+c-1]))s[c][d]=s[c-1][d-1];else{var l=s[c-1][d]+1,p=s[c][d-1]+1;s[c][d]=l<p?l:p}return s}function n(r){for(var e=r.length-1,n=r[0].length-1,t=r[e][n],u=[];e>0||n>0;)if(0!=e)if(0!=n){var o=r[e-1][n-1],a=r[e-1][n],v=r[e][n-1],c=void 0;(c=a<v?a<o?a:o:v<o?v:o)==o?(o==t?u.push(i):(u.push(f),t=o),e--,n--):c==a?(u.push(h),e--,t=a):(u.push(s),n--,t=v)}else u.push(h),e--;else u.push(s),n--;return u.reverse(),u}function t(t,a,v,c,d,l){var p=0,g=0,m=void 0,y=Math.min(v-a,l-d);if(0==a&&0==d&&(p=u(t,c,y)),v==t.length&&l==c.length&&(g=o(t,c,y-p)),a+=p,d+=p,v-=g,l-=g,v-a==0&&l-d==0)return[];if(a==v){for(m=r(a,[],0);d<l;)m.removed.push(c[d++]);return[m]}if(d==l)return[r(a,[],v-a)];var b=n(e(t,a,v,c,d,l));m=void 0;for(var k=[],w=a,A=d,C=0;C<b.length;C++)switch(b[C]){case i:m&&(k.push(m),m=void 0),w++,A++;break;case f:m||(m=r(w,[],0)),m.addedCount++,w++,m.removed.push(c[A]),A++;break;case s:m||(m=r(w,[],0)),m.addedCount++,w++;break;case h:m||(m=r(w,[],0)),m.removed.push(c[A]),A++}return m&&k.push(m),k}function u(r,e,n){for(var t=0;t<n;t++)if(!a(r[t],e[t]))return t;return n}function o(r,e,n){for(var t=r.length,u=e.length,o=0;o<n&&a(r[--t],e[--u]);)o++;return o}function a(r,e){return r===e}var i=0,f=1,s=2,h=3;Polymer.ArraySplice={calculateSplices:function(r,e){return t(r,0,r.length,e,0,e.length)}}}();</script><script>function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function e(e,t){for(var s=0;s<t.length;s++){var n=t[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,s,n){return s&&e(t.prototype,s),n&&e(t,n),t}}();!function(){"use strict";function e(e){return"slot"===e.localName}var t=function(){function t(e,s){var n=this;_classCallCheck(this,t),this._shadyChildrenObserver=null,this._nativeChildrenObserver=null,this._connected=!1,this._target=e,this.callback=s,this._effectiveNodes=[],this._observer=null,this._scheduled=!1,this._boundSchedule=function(){n._schedule()},this.connect(),this._schedule()}return _createClass(t,null,[{key:"getFlattenedNodes",value:function(t){return e(t)?t.assignedNodes({flatten:!0}):Array.from(t.childNodes).map(function(t){return e(t)?t.assignedNodes({flatten:!0}):[t]}).reduce(function(e,t){return e.concat(t)},[])}}]),_createClass(t,[{key:"connect",value:function(){var t=this;e(this._target)?this._listenSlots([this._target]):(this._listenSlots(this._target.children),window.ShadyDOM?this._shadyChildrenObserver=ShadyDOM.observeChildren(this._target,function(e){t._processMutations(e)}):(this._nativeChildrenObserver=new MutationObserver(function(e){t._processMutations(e)}),this._nativeChildrenObserver.observe(this._target,{childList:!0}))),this._connected=!0}},{key:"disconnect",value:function(){e(this._target)?this._unlistenSlots([this._target]):(this._unlistenSlots(this._target.children),window.ShadyDOM&&this._shadyChildrenObserver?(ShadyDOM.unobserveChildren(this._shadyChildrenObserver),this._shadyChildrenObserver=null):this._nativeChildrenObserver&&(this._nativeChildrenObserver.disconnect(),this._nativeChildrenObserver=null)),this._connected=!1}},{key:"_schedule",value:function(){var e=this;this._scheduled||(this._scheduled=!0,Polymer.Async.microTask.run(function(){return e.flush()}))}},{key:"_processMutations",value:function(e){this._processSlotMutations(e),this.flush()}},{key:"_processSlotMutations",value:function(e){if(e)for(var t=0;t<e.length;t++){var s=e[t];s.addedNodes&&this._listenSlots(s.addedNodes),s.removedNodes&&this._unlistenSlots(s.removedNodes)}}},{key:"flush",value:function(){if(!this._connected)return!1;window.ShadyDOM&&ShadyDOM.flush(),this._nativeChildrenObserver?this._processSlotMutations(this._nativeChildrenObserver.takeRecords()):this._shadyChildrenObserver&&this._processSlotMutations(this._shadyChildrenObserver.takeRecords()),this._scheduled=!1;for(var e,t={target:this._target,addedNodes:[],removedNodes:[]},s=this.constructor.getFlattenedNodes(this._target),n=Polymer.ArraySplice.calculateSplices(s,this._effectiveNodes),r=0;r<n.length&&(e=n[r]);r++)for(var i,o=0;o<e.removed.length&&(i=e.removed[o]);o++)t.removedNodes.push(i);for(var h,l=0;l<n.length&&(h=n[l]);l++)for(var a=h.index;a<h.index+h.addedCount;a++)t.addedNodes.push(s[a]);this._effectiveNodes=s;var d=!1;return(t.addedNodes.length||t.removedNodes.length)&&(d=!0,this.callback.call(this._target,t)),d}},{key:"_listenSlots",value:function(t){for(var s=0;s<t.length;s++){var n=t[s];e(n)&&n.addEventListener("slotchange",this._boundSchedule)}}},{key:"_unlistenSlots",value:function(t){for(var s=0;s<t.length;s++){var n=t[s];e(n)&&n.removeEventListener("slotchange",this._boundSchedule)}}}]),t}();Polymer.FlattenedNodesObserver=t}();</script><script>!function(){"use strict";function n(){for(var n=Boolean(o.length);o.length;)try{o.shift().flush()}catch(n){setTimeout(function(){throw n})}return n}var o=[];Polymer.enqueueDebouncer=function(n){o.push(n)},Polymer.flush=function(){var o=void 0,i=void 0;do{o=window.ShadyDOM&&ShadyDOM.flush(),window.ShadyCSS&&window.ShadyCSS.ScopingShim&&window.ShadyCSS.ScopingShim.flush(),i=n()}while(o||i)}}();</script><script>function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}();!function(){"use strict";var e=Element.prototype,t=e.matches||e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector,n=function(e,n){return t.call(e,n)},o=function(){function e(t){_classCallCheck(this,e),this.node=t}return _createClass(e,[{key:"observeNodes",value:function(e){return new Polymer.FlattenedNodesObserver(this.node,e)}},{key:"unobserveNodes",value:function(e){e.disconnect()}},{key:"notifyObserver",value:function(){}},{key:"deepContains",value:function(e){if(this.node.contains(e))return!0;for(var t=e,n=e.ownerDocument;t&&t!==n&&t!==this.node;)t=t.parentNode||t.host;return t===this.node}},{key:"getOwnerRoot",value:function(){return this.node.getRootNode()}},{key:"getDistributedNodes",value:function(){return"slot"===this.node.localName?this.node.assignedNodes({flatten:!0}):[]}},{key:"getDestinationInsertionPoints",value:function(){for(var e=[],t=this.node.assignedSlot;t;)e.push(t),t=t.assignedSlot;return e}},{key:"importNode",value:function(e,t){return(this.node instanceof Document?this.node:this.node.ownerDocument).importNode(e,t)}},{key:"getEffectiveChildNodes",value:function(){return Polymer.FlattenedNodesObserver.getFlattenedNodes(this.node)}},{key:"queryDistributedElements",value:function(e){for(var t,o=this.getEffectiveChildNodes(),r=[],i=0,s=o.length;i<s&&(t=o[i]);i++)t.nodeType===Node.ELEMENT_NODE&&n(t,e)&&r.push(t);return r}},{key:"activeElement",get:function(){var e=this.node;return void 0!==e._activeElement?e._activeElement:e.activeElement}}]),e}();!function(e,t){for(var n=0;n<t.length;n++)!function(n){var o=t[n];e[o]=function(){return this.node[o].apply(this.node,arguments)}}(n)}(o.prototype,["cloneNode","appendChild","insertBefore","removeChild","replaceChild","setAttribute","removeAttribute","querySelector","querySelectorAll"]),function(e,t){for(var n=0;n<t.length;n++)!function(n){var o=t[n];Object.defineProperty(e,o,{get:function(){return this.node[o]},configurable:!0})}(n)}(o.prototype,["parentNode","firstChild","lastChild","nextSibling","previousSibling","firstElementChild","lastElementChild","nextElementSibling","previousElementSibling","childNodes","children","classList"]),function(e,t){for(var n=0;n<t.length;n++)!function(n){var o=t[n];Object.defineProperty(e,o,{get:function(){return this.node[o]},set:function(e){this.node[o]=e},configurable:!0})}(n)}(o.prototype,["textContent","innerHTML"]);var r=function(){function e(t){_classCallCheck(this,e),this.event=t}return _createClass(e,[{key:"rootTarget",get:function(){return this.event.composedPath()[0]}},{key:"localTarget",get:function(){return this.event.target}},{key:"path",get:function(){return this.event.composedPath()}}]),e}();Polymer.DomApi=o,Polymer.dom=function(e){if(!(e=e||document).__domApi){var t=void 0;t=e instanceof Event?new r(e):new o(e),e.__domApi=t}return e.__domApi},Polymer.dom.matchesSelector=n,Polymer.dom.flush=Polymer.flush,Polymer.dom.addDebouncer=Polymer.enqueueDebouncer}();</script><script>function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),_get=function e(t,r,n){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,r);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,r,n)}if("value"in o)return o.value;var u=o.get;if(void 0!==u)return u.call(n)};!function(){"use strict";var e=window.ShadyCSS;Polymer.LegacyElementMixin=Polymer.dedupingMixin(function(t){var r=Polymer.GestureEventListeners(Polymer.ElementMixin(t)),n={x:"pan-x",y:"pan-y",none:"none",all:"auto"},o=function(t){function o(){_classCallCheck(this,o);var e=_possibleConstructorReturn(this,(o.__proto__||Object.getPrototypeOf(o)).call(this));return e.root=e,e.created(),e}return _inherits(o,r),_createClass(o,[{key:"created",value:function(){}},{key:"connectedCallback",value:function(){_get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"connectedCallback",this).call(this),this.isAttached=!0,this.attached()}},{key:"attached",value:function(){}},{key:"disconnectedCallback",value:function(){_get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"disconnectedCallback",this).call(this),this.isAttached=!1,this.detached()}},{key:"detached",value:function(){}},{key:"attributeChangedCallback",value:function(e,t,r){t!==r&&(_get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"attributeChangedCallback",this).call(this,e,t,r),this.attributeChanged(e,t,r))}},{key:"attributeChanged",value:function(e,t,r){}},{key:"_initializeProperties",value:function(){var e=Object.getPrototypeOf(this);e.hasOwnProperty("__hasRegisterFinished")||(e.__hasRegisterFinished=!0,this._registered()),_get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"_initializeProperties",this).call(this)}},{key:"_registered",value:function(){}},{key:"ready",value:function(){this._ensureAttributes(),this._applyListeners(),_get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"ready",this).call(this)}},{key:"_ensureAttributes",value:function(){}},{key:"_applyListeners",value:function(){}},{key:"serialize",value:function(e){return this._serializeValue(e)}},{key:"deserialize",value:function(e,t){return this._deserializeValue(e,t)}},{key:"reflectPropertyToAttribute",value:function(e,t,r){this._propertyToAttribute(e,t,r)}},{key:"serializeValueToAttribute",value:function(e,t,r){this._valueToNodeAttribute(r||this,e,t)}},{key:"extend",value:function(e,t){if(!e||!t)return e||t;for(var r,n=Object.getOwnPropertyNames(t),o=0;o<n.length&&(r=n[o]);o++){var i=Object.getOwnPropertyDescriptor(t,r);i&&Object.defineProperty(e,r,i)}return e}},{key:"mixin",value:function(e,t){for(var r in t)e[r]=t[r];return e}},{key:"chainObject",value:function(e,t){return e&&t&&e!==t&&(e.__proto__=t),e}},{key:"instanceTemplate",value:function(e){var t=this.constructor._contentForTemplate(e);return document.importNode(t,!0)}},{key:"fire",value:function(e,t,r){r=r||{},t=null===t||void 0===t?{}:t;var n=new Event(e,{bubbles:void 0===r.bubbles||r.bubbles,cancelable:Boolean(r.cancelable),composed:void 0===r.composed||r.composed});return n.detail=t,(r.node||this).dispatchEvent(n),n}},{key:"listen",value:function(e,t,r){e=e||this;var n=this.__boundListeners||(this.__boundListeners=new WeakMap),o=n.get(e);o||(o={},n.set(e,o));var i=t+r;o[i]||(o[i]=this._addMethodEventListenerToNode(e,t,r,this))}},{key:"unlisten",value:function(e,t,r){e=e||this;var n=this.__boundListeners&&this.__boundListeners.get(e),o=t+r,i=n&&n[o];i&&(this._removeEventListenerFromNode(e,t,i),n[o]=null)}},{key:"setScrollDirection",value:function(e,t){Polymer.Gestures.setTouchAction(t||this,n[e]||"auto")}},{key:"$$",value:function(e){return this.root.querySelector(e)}},{key:"distributeContent",value:function(){window.ShadyDOM&&this.shadowRoot&&ShadyDOM.flush()}},{key:"getEffectiveChildNodes",value:function(){return Polymer.dom(this).getEffectiveChildNodes()}},{key:"queryDistributedElements",value:function(e){return Polymer.dom(this).queryDistributedElements(e)}},{key:"getEffectiveChildren",value:function(){return this.getEffectiveChildNodes().filter(function(e){return e.nodeType===Node.ELEMENT_NODE})}},{key:"getEffectiveTextContent",value:function(){for(var e,t=this.getEffectiveChildNodes(),r=[],n=0;e=t[n];n++)e.nodeType!==Node.COMMENT_NODE&&r.push(e.textContent);return r.join("")}},{key:"queryEffectiveChildren",value:function(e){var t=this.queryDistributedElements(e);return t&&t[0]}},{key:"queryAllEffectiveChildren",value:function(e){return this.queryDistributedElements(e)}},{key:"getContentChildNodes",value:function(e){var t=this.root.querySelector(e||"slot");return t?Polymer.dom(t).getDistributedNodes():[]}},{key:"getContentChildren",value:function(e){return this.getContentChildNodes(e).filter(function(e){return e.nodeType===Node.ELEMENT_NODE})}},{key:"isLightDescendant",value:function(e){return this!==e&&this.contains(e)&&this.getRootNode()===e.getRootNode()}},{key:"isLocalDescendant",value:function(e){return this.root===e.getRootNode()}},{key:"scopeSubtree",value:function(e,t){}},{key:"getComputedStyleValue",value:function(t){return e.getComputedStyleValue(this,t)}},{key:"debounce",value:function(e,t,r){return this._debouncers=this._debouncers||{},this._debouncers[e]=Polymer.Debouncer.debounce(this._debouncers[e],r>0?Polymer.Async.timeOut.after(r):Polymer.Async.microTask,t.bind(this))}},{key:"isDebouncerActive",value:function(e){this._debouncers=this._debouncers||{};var t=this._debouncers[e];return!(!t||!t.isActive())}},{key:"flushDebouncer",value:function(e){this._debouncers=this._debouncers||{};var t=this._debouncers[e];t&&t.flush()}},{key:"cancelDebouncer",value:function(e){this._debouncers=this._debouncers||{};var t=this._debouncers[e];t&&t.cancel()}},{key:"async",value:function(e,t){return t>0?Polymer.Async.timeOut.run(e.bind(this),t):~Polymer.Async.microTask.run(e.bind(this))}},{key:"cancelAsync",value:function(e){e<0?Polymer.Async.microTask.cancel(~e):Polymer.Async.timeOut.cancel(e)}},{key:"create",value:function(e,t){var r=document.createElement(e);if(t)if(r.setProperties)r.setProperties(t);else for(var n in t)r[n]=t[n];return r}},{key:"importHref",value:function(e,t,r,n){var o=t?t.bind(this):null,i=r?r.bind(this):null;return Polymer.importHref(e,o,i,n)}},{key:"elementMatches",value:function(e,t){return Polymer.dom.matchesSelector(t||this,e)}},{key:"toggleAttribute",value:function(e,t,r){r=r||this,1==arguments.length&&(t=!r.hasAttribute(e)),t?r.setAttribute(e,""):r.removeAttribute(e)}},{key:"toggleClass",value:function(e,t,r){r=r||this,1==arguments.length&&(t=!r.classList.contains(e)),t?r.classList.add(e):r.classList.remove(e)}},{key:"transform",value:function(e,t){(t=t||this).style.webkitTransform=e,t.style.transform=e}},{key:"translate3d",value:function(e,t,r,n){n=n||this,this.transform("translate3d("+e+","+t+","+r+")",n)}},{key:"arrayDelete",value:function(e,t){var r=void 0;if(Array.isArray(e)){if((r=e.indexOf(t))>=0)return e.splice(r,1)}else if((r=Polymer.Path.get(this,e).indexOf(t))>=0)return this.splice(e,r,1);return null}},{key:"_logger",value:function(e,t){var r;switch(Array.isArray(t)&&1===t.length&&(t=t[0]),e){case"log":case"warn":case"error":(r=console)[e].apply(r,_toConsumableArray(t))}}},{key:"_log",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];this._logger("log",t)}},{key:"_warn",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];this._logger("warn",t)}},{key:"_error",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];this._logger("error",t)}},{key:"_logf",value:function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return["[%s::%s]",this.is,e].concat(r)}},{key:"domHost",get:function(){var e=this.getRootNode();return e instanceof DocumentFragment?e.host:e}}]),o}();return o.prototype.is="",o})}();</script><script>function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var _createClass=function(){function t(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),_get=function t(e,r,o){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,r);if(void 0===i){var n=Object.getPrototypeOf(e);return null===n?void 0:t(n,r,o)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(o)};!function(){"use strict";function t(t,o){if(!t)return o;o=Polymer.LegacyElementMixin(o),Array.isArray(t)||(t=[t]);var i=o.prototype.behaviors;return t=r(t,null,i),o=e(t,o),i&&(t=i.concat(t)),o.prototype.behaviors=t,o}function e(t,r){for(var i=0;i<t.length;i++){var n=t[i];n&&(r=Array.isArray(n)?e(n,r):o(n,r))}return r}function r(t,e,o){e=e||[];for(var i=t.length-1;i>=0;i--){var n=t[i];n?Array.isArray(n)?r(n,e):e.indexOf(n)<0&&(!o||o.indexOf(n)<0)&&e.unshift(n):console.warn("behavior is null, check for missing or 404 import")}return e}function o(t,e){var r=function(r){function o(){return _classCallCheck(this,o),_possibleConstructorReturn(this,(o.__proto__||Object.getPrototypeOf(o)).apply(this,arguments))}return _inherits(o,e),_createClass(o,[{key:"created",value:function(){_get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"created",this).call(this),t.created&&t.created.call(this)}},{key:"_registered",value:function(){_get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"_registered",this).call(this),t.beforeRegister&&t.beforeRegister.call(Object.getPrototypeOf(this)),t.registered&&t.registered.call(Object.getPrototypeOf(this))}},{key:"_applyListeners",value:function(){if(_get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"_applyListeners",this).call(this),t.listeners)for(var e in t.listeners)this._addMethodEventListenerToNode(this,e,t.listeners[e])}},{key:"_ensureAttributes",value:function(){if(t.hostAttributes)for(var e in t.hostAttributes)this._ensureAttribute(e,t.hostAttributes[e]);_get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"_ensureAttributes",this).call(this)}},{key:"ready",value:function(){_get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"ready",this).call(this),t.ready&&t.ready.call(this)}},{key:"attached",value:function(){_get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"attached",this).call(this),t.attached&&t.attached.call(this)}},{key:"detached",value:function(){_get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"detached",this).call(this),t.detached&&t.detached.call(this)}},{key:"attributeChanged",value:function(e,r,i){_get(o.prototype.__proto__||Object.getPrototypeOf(o.prototype),"attributeChanged",this).call(this,e,r,i),t.attributeChanged&&t.attributeChanged.call(this,e,r,i)}}],[{key:"properties",get:function(){return t.properties}},{key:"observers",get:function(){return t.observers}},{key:"template",get:function(){return t._template||Polymer.DomModule&&Polymer.DomModule.import(this.is,"template")||e.template||this.prototype._template||null}}]),o}();r.generatedFrom=t;for(var o in t)if(!(o in i)){var n=Object.getOwnPropertyDescriptor(t,o);n&&Object.defineProperty(r.prototype,o,n)}return r}var i={attached:!0,detached:!0,ready:!0,created:!0,beforeRegister:!0,registered:!0,attributeChanged:!0,behaviors:!0};Polymer.Class=function(e){e||console.warn("Polymer.Class requires `info` argument");var r=o(e,e.behaviors?t(e.behaviors,HTMLElement):Polymer.LegacyElementMixin(HTMLElement));return r.is=e.is,r},Polymer.mixinBehaviors=t}();</script><script>!function(){"use strict";window.Polymer._polymerFn=function(n){var e=void 0;return e="function"==typeof n?n:Polymer.Class(n),customElements.define(e.is,e),e}}();</script><script>function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var _createClass=function(){function t(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,o,n){return o&&t(e.prototype,o),n&&t(e,n),e}}(),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(){"use strict";function t(t,e,o,n,r){var u=void 0;r&&(u="object"===(void 0===o?"undefined":_typeof(o))&&null!==o)&&(n=t.__dataTemp[e]);var a=n!==o&&(n===n||o===o);return u&&a&&(t.__dataTemp[e]=o),a}Polymer.MutableData=Polymer.dedupingMixin(function(e){var o=function(o){function n(){return _classCallCheck(this,n),_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return _inherits(n,e),_createClass(n,[{key:"_shouldPropertyChange",value:function(e,o,n){return t(this,e,o,n,!0)}}]),n}();return o.prototype.mutableData=!1,o}),Polymer.OptionalMutableData=Polymer.dedupingMixin(function(e){return function(o){function n(){return _classCallCheck(this,n),_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return _inherits(n,e),_createClass(n,[{key:"_shouldPropertyChange",value:function(e,o,n){return t(this,e,o,n,this.mutableData)}}],[{key:"properties",get:function(){return{mutableData:Boolean}}}]),n}()}),Polymer.MutableData._mutablePropertyChange=t}();</script><script>function _possibleConstructorReturn(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function t(t,e){for(var o=0;o<e.length;o++){var r=e[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,o,r){return o&&t(e.prototype,o),r&&t(e,r),e}}(),_get=function t(e,o,r){null===e&&(e=Function.prototype);var n=Object.getOwnPropertyDescriptor(e,o);if(void 0===n){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,o,r)}if("value"in n)return n.value;var i=n.get;if(void 0!==i)return i.call(r)};!function(){"use strict";function t(){return p}function e(t,e){p=t,Object.setPrototypeOf(t,e.prototype),new e,p=null}function o(t){var e=t.__dataHost;return e&&e._methodHost||e}function r(t,e,o){var r=o.mutableData?d:f,n=function(t){function e(){return _classCallCheck(this,e),_possibleConstructorReturn(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return _inherits(e,r),e}();return n.prototype.__templatizeOptions=o,n.prototype._bindTemplate(t),i(n,t,e,o),n}function n(t,o,r){var n=r.forwardHostProp;if(n){var i=o.templatizeTemplateClass;if(!i){var _=r.mutableData?c:l;i=o.templatizeTemplateClass=function(t){function e(){return _classCallCheck(this,e),_possibleConstructorReturn(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return _inherits(e,_),e}();var s=o.hostProps;for(var p in s)i.prototype._addPropertyEffect("_host_"+p,i.prototype.PROPERTY_EFFECT_TYPES.PROPAGATE,{fn:a(p,n)}),i.prototype._createNotifyingProperty("_host_"+p)}e(t,i),t.__dataProto&&Object.assign(t.__data,t.__dataProto),t.__dataTemp={},t.__dataPending=null,t.__dataOld=null,t._enableProperties()}}function a(t,e){return function(t,o,r){e.call(t.__templatizeOwner,o.substring("_host_".length),r[o])}}function i(t,e,o,r){var n=o.hostProps||{};for(var a in r.instanceProps){delete n[a];var i=r.notifyInstanceProp;i&&t.prototype._addPropertyEffect(a,t.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:_(a,i)})}if(r.forwardHostProp&&e.__dataHost)for(var p in n)t.prototype._addPropertyEffect(p,t.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:s()})}function _(t,e){return function(t,o,r){e.call(t.__templatizeOwner,t,o,r[o])}}function s(){return function(t,e,o){t.__dataHost._setPendingPropertyOrPath("_host_"+e,o[e],!0,!0)}}var p=null;t.prototype=Object.create(HTMLTemplateElement.prototype,{constructor:{value:t,writable:!0}});var l=Polymer.PropertyEffects(t),c=Polymer.MutableData(l),u=Polymer.PropertyEffects(function(){function t(){_classCallCheck(this,t)}return t}()),f=function(t){function e(t){_classCallCheck(this,e);var o=_possibleConstructorReturn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));o._configureProperties(t),o.root=o._stampTemplate(o.__dataHost);for(var r=o.children=[],n=o.root.firstChild;n;n=n.nextSibling)r.push(n),n.__templatizeInstance=o;o.__templatizeOwner.__hideTemplateChildren__&&o._showHideChildren(!0);var a=o.__templatizeOptions;return(t&&a.instanceProps||!a.instanceProps)&&o._enableProperties(),o}return _inherits(e,u),_createClass(e,[{key:"_configureProperties",value:function(t){var e=this.__templatizeOptions;if(t)for(var o in e.instanceProps)o in t&&this._setPendingProperty(o,t[o]);for(var r in this.__hostProps)this._setPendingProperty(r,this.__dataHost["_host_"+r])}},{key:"forwardHostProp",value:function(t,e){this._setPendingPropertyOrPath(t,e,!1,!0)&&this.__dataHost._enqueueClient(this)}},{key:"_addEventListenerToNode",value:function(t,e,o){var r=this;if(this._methodHost&&this.__templatizeOptions.parentModel)this._methodHost._addEventListenerToNode(t,e,function(t){t.model=r,o(t)});else{var n=this.__dataHost.__dataHost;n&&n._addEventListenerToNode(t,e,o)}}},{key:"_showHideChildren",value:function(t){for(var e=this.children,o=0;o<e.length;o++){var r=e[o];Boolean(t)!=Boolean(r.__hideTemplateChildren__)&&(r.nodeType===Node.TEXT_NODE?t?(r.__polymerTextContent__=r.textContent,r.textContent=""):r.textContent=r.__polymerTextContent__:r.style&&(t?(r.__polymerDisplay__=r.style.display,r.style.display="none"):r.style.display=r.__polymerDisplay__)),r.__hideTemplateChildren__=t,r._showHideChildren&&r._showHideChildren(t)}}},{key:"_setUnmanagedPropertyToNode",value:function(t,o,r){t.__hideTemplateChildren__&&t.nodeType==Node.TEXT_NODE&&"textContent"==o?t.__polymerTextContent__=r:_get(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_setUnmanagedPropertyToNode",this).call(this,t,o,r)}},{key:"parentModel",get:function(){var t=this.__parentModel;if(!t){var e=void 0;t=this;do{t=t.__dataHost.__dataHost}while((e=t.__templatizeOptions)&&!e.parentModel);this.__parentModel=t}return t}}]),e}();f.prototype.__dataHost,f.prototype.__templatizeOptions,f.prototype._methodHost,f.prototype.__templatizeOwner,f.prototype.__hostProps;var d=Polymer.MutableData(f),h={templatize:function(t,e,a){if(a=a||{},t.__templatizeOwner)throw new Error("A <template> can only be templatized once");t.__templatizeOwner=e;var i=e.constructor._parseTemplate(t),_=i.templatizeInstanceClass;_||(_=r(t,i,a),i.templatizeInstanceClass=_),n(t,i,a);var s=function(t){function e(){return _classCallCheck(this,e),_possibleConstructorReturn(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return _inherits(e,_),e}();return s.prototype._methodHost=o(t),s.prototype.__dataHost=t,s.prototype.__templatizeOwner=e,s.prototype.__hostProps=i.hostProps,s},modelForElement:function(t,e){for(var o=void 0;e;)if(o=e.__templatizeInstance){if(o.__dataHost==t)return o;e=o.__dataHost}else e=e.parentNode;return null}};Polymer.Templatize=h,Polymer.TemplateInstanceBase=f}();</script><script>!function(){"use strict";Polymer.TemplateInstanceBase;var t={templatize:function(t,e){this._templatizerTemplate=t,this.ctor=Polymer.Templatize.templatize(t,this,{mutableData:Boolean(e),parentModel:this._parentModel,instanceProps:this._instanceProps,forwardHostProp:this._forwardHostPropV2,notifyInstanceProp:this._notifyInstancePropV2})},stamp:function(t){return new this.ctor(t)},modelForElement:function(t){return Polymer.Templatize.modelForElement(this._templatizerTemplate,t)}};Polymer.Templatizer=t}();</script><script>function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();!function(){"use strict";var e=Polymer.GestureEventListeners(Polymer.OptionalMutableData(Polymer.PropertyEffects(HTMLElement))),t=function(t){function r(){_classCallCheck(this,r);var e=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return e.root=null,e.$=null,e.__children=null,e}return _inherits(r,e),_createClass(r,null,[{key:"observedAttributes",get:function(){return["mutable-data"]}}]),_createClass(r,[{key:"attributeChangedCallback",value:function(){this.mutableData=!0}},{key:"connectedCallback",value:function(){this.render()}},{key:"disconnectedCallback",value:function(){this.__removeChildren()}},{key:"__insertChildren",value:function(){this.parentNode.insertBefore(this.root,this)}},{key:"__removeChildren",value:function(){if(this.__children)for(var e=0;e<this.__children.length;e++)this.root.appendChild(this.__children[e])}},{key:"render",value:function(){var e=this,t=void 0;if(!this.__children){if(!(t=t||this.querySelector("template"))){var r=new MutationObserver(function(){if(!(t=e.querySelector("template")))throw new Error("dom-bind requires a <template> child");r.disconnect(),e.render()});return void r.observe(this,{childList:!0})}this.root=this._stampTemplate(t),this.$=this.root.$,this.__children=[];for(var n=this.root.firstChild;n;n=n.nextSibling)this.__children[this.__children.length]=n;this._enableProperties()}this.__insertChildren(),this.dispatchEvent(new CustomEvent("dom-change",{bubbles:!0,composed:!0}))}}]),r}();customElements.define("dom-bind",t)}();</script><script>!function(){"use strict";var e=Polymer.ElementMixin(HTMLElement);Polymer.Element=e}();</script><script>function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var _get=function e(t,n,i){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var s=Object.getPrototypeOf(t);return null===s?void 0:e(s,n,i)}if("value"in r)return r.value;var o=r.get;if(void 0!==o)return o.call(i)},_createClass=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();!function(){"use strict";Polymer.TemplateInstanceBase;var e=Polymer.OptionalMutableData(Polymer.Element),t=function(t){function n(){_classCallCheck(this,n);var e=_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));return e.__instances=[],e.__limit=1/0,e.__pool=[],e.__renderDebouncer=null,e.__itemsIdxToInstIdx={},e.__chunkCount=null,e.__lastChunkTime=null,e.__sortFn=null,e.__filterFn=null,e.__observePaths=null,e.__ctor=null,e.__isDetached=!0,e.template=null,e}return _inherits(n,e),_createClass(n,null,[{key:"is",get:function(){return"dom-repeat"}},{key:"template",get:function(){return null}},{key:"properties",get:function(){return{items:{type:Array},as:{type:String,value:"item"},indexAs:{type:String,value:"index"},itemsIndexAs:{type:String,value:"itemsIndex"},sort:{type:Function,observer:"__sortChanged"},filter:{type:Function,observer:"__filterChanged"},observe:{type:String,observer:"__observeChanged"},delay:Number,renderedItemCount:{type:Number,notify:!0,readOnly:!0},initialCount:{type:Number,observer:"__initializeChunking"},targetFramerate:{type:Number,value:20},_targetFrameTime:{type:Number,computed:"__computeFrameTime(targetFramerate)"}}}},{key:"observers",get:function(){return["__itemsChanged(items.*)"]}}]),_createClass(n,[{key:"disconnectedCallback",value:function(){_get(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"disconnectedCallback",this).call(this),this.__isDetached=!0;for(var e=0;e<this.__instances.length;e++)this.__detachInstance(e)}},{key:"connectedCallback",value:function(){if(_get(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"connectedCallback",this).call(this),this.__isDetached){this.__isDetached=!1;for(var e=this.parentNode,t=0;t<this.__instances.length;t++)this.__attachInstance(t,e)}}},{key:"__ensureTemplatized",value:function(){var e=this;if(!this.__ctor){var t=this.template=this.querySelector("template");if(!t){var n=new MutationObserver(function(){if(!e.querySelector("template"))throw new Error("dom-repeat requires a <template> child");n.disconnect(),e.__render()});return n.observe(this,{childList:!0}),!1}var i={};i[this.as]=!0,i[this.indexAs]=!0,i[this.itemsIndexAs]=!0,this.__ctor=Polymer.Templatize.templatize(t,this,{mutableData:this.mutableData,parentModel:!0,instanceProps:i,forwardHostProp:function(e,t){for(var n,i=this.__instances,r=0;r<i.length&&(n=i[r]);r++)n.forwardHostProp(e,t)},notifyInstanceProp:function(e,t,n){if(Polymer.Path.matches(this.as,t)){var i=e[this.itemsIndexAs];t==this.as&&(this.items[i]=n);var r=Polymer.Path.translate(this.as,"items."+i,t);this.notifyPath(r,n)}}})}return!0}},{key:"__getMethodHost",value:function(){return this.__dataHost._methodHost||this.__dataHost}},{key:"__sortChanged",value:function(e){var t=this.__getMethodHost();this.__sortFn=e&&("function"==typeof e?e:function(){return t[e].apply(t,arguments)}),this.items&&this.__debounceRender(this.__render)}},{key:"__filterChanged",value:function(e){var t=this.__getMethodHost();this.__filterFn=e&&("function"==typeof e?e:function(){return t[e].apply(t,arguments)}),this.items&&this.__debounceRender(this.__render)}},{key:"__computeFrameTime",value:function(e){return Math.ceil(1e3/e)}},{key:"__initializeChunking",value:function(){this.initialCount&&(this.__limit=this.initialCount,this.__chunkCount=this.initialCount,this.__lastChunkTime=performance.now())}},{key:"__tryRenderChunk",value:function(){this.items&&this.__limit<this.items.length&&this.__debounceRender(this.__requestRenderChunk)}},{key:"__requestRenderChunk",value:function(){var e=this;requestAnimationFrame(function(){return e.__renderChunk()})}},{key:"__renderChunk",value:function(){var e=performance.now(),t=this._targetFrameTime/(e-this.__lastChunkTime);this.__chunkCount=Math.round(this.__chunkCount*t)||1,this.__limit+=this.__chunkCount,this.__lastChunkTime=e,this.__debounceRender(this.__render)}},{key:"__observeChanged",value:function(){this.__observePaths=this.observe&&this.observe.replace(".*",".").split(" ")}},{key:"__itemsChanged",value:function(e){this.items&&!Array.isArray(this.items)&&console.warn("dom-repeat expected array for `items`, found",this.items),this.__handleItemPath(e.path,e.value)||(this.__initializeChunking(),this.__debounceRender(this.__render))}},{key:"__handleObservedPaths",value:function(e){if(this.__observePaths){e=e.substring(e.indexOf(".")+1);for(var t=this.__observePaths,n=0;n<t.length;n++)if(0===e.indexOf(t[n]))return this.__debounceRender(this.__render,this.delay),!0}}},{key:"__debounceRender",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.__renderDebouncer=Polymer.Debouncer.debounce(this.__renderDebouncer,t>0?Polymer.Async.timeOut.after(t):Polymer.Async.microTask,e.bind(this)),Polymer.enqueueDebouncer(this.__renderDebouncer)}},{key:"render",value:function(){this.__debounceRender(this.__render),Polymer.flush()}},{key:"__render",value:function(){this.__ensureTemplatized()&&(this.__applyFullRefresh(),this.__pool.length=0,this._setRenderedItemCount(this.__instances.length),this.dispatchEvent(new CustomEvent("dom-change",{bubbles:!0,composed:!0})),this.__tryRenderChunk())}},{key:"__applyFullRefresh",value:function(){for(var e=this,t=this.items||[],n=new Array(t.length),i=0;i<t.length;i++)n[i]=i;this.__filterFn&&(n=n.filter(function(n,i,r){return e.__filterFn(t[n],i,r)})),this.__sortFn&&n.sort(function(n,i){return e.__sortFn(t[n],t[i])});for(var r=this.__itemsIdxToInstIdx={},s=0,o=Math.min(n.length,this.__limit);s<o;s++){var a=this.__instances[s],_=n[s],h=t[_];r[_]=s,a&&s<this.__limit?(a._setPendingProperty(this.as,h),a._setPendingProperty(this.indexAs,s),a._setPendingProperty(this.itemsIndexAs,_),a._flushProperties()):this.__insertInstance(h,s,_)}for(var u=this.__instances.length-1;u>=s;u--)this.__detachAndRemoveInstance(u)}},{key:"__detachInstance",value:function(e){for(var t=this.__instances[e],n=0;n<t.children.length;n++){var i=t.children[n];t.root.appendChild(i)}return t}},{key:"__attachInstance",value:function(e,t){var n=this.__instances[e];t.insertBefore(n.root,this)}},{key:"__detachAndRemoveInstance",value:function(e){var t=this.__detachInstance(e);t&&this.__pool.push(t),this.__instances.splice(e,1)}},{key:"__stampInstance",value:function(e,t,n){var i={};return i[this.as]=e,i[this.indexAs]=t,i[this.itemsIndexAs]=n,new this.__ctor(i)}},{key:"__insertInstance",value:function(e,t,n){var i=this.__pool.pop();i?(i._setPendingProperty(this.as,e),i._setPendingProperty(this.indexAs,t),i._setPendingProperty(this.itemsIndexAs,n),i._flushProperties()):i=this.__stampInstance(e,t,n);var r=this.__instances[t+1],s=r?r.children[0]:this;return this.parentNode.insertBefore(i.root,s),this.__instances[t]=i,i}},{key:"_showHideChildren",value:function(e){for(var t=0;t<this.__instances.length;t++)this.__instances[t]._showHideChildren(e)}},{key:"__handleItemPath",value:function(e,t){var n=e.slice(6),i=n.indexOf("."),r=i<0?n:n.substring(0,i);if(r==parseInt(r,10)){var s=i<0?"":n.substring(i+1);this.__handleObservedPaths(s);var o=this.__itemsIdxToInstIdx[r],a=this.__instances[o];if(a){var _=this.as+(s?"."+s:"");a._setPendingPropertyOrPath(_,t,!1,!0),a._flushProperties()}return!0}}},{key:"itemForElement",value:function(e){var t=this.modelForElement(e);return t&&t[this.as]}},{key:"indexForElement",value:function(e){var t=this.modelForElement(e);return t&&t[this.indexAs]}},{key:"modelForElement",value:function(e){return Polymer.Templatize.modelForElement(this.template,e)}}]),n}();customElements.define(t.is,t),Polymer.DomRepeat=t}();</script><script>function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var _get=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var s=i.get;if(void 0!==s)return s.call(r)},_createClass=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();!function(){"use strict";var e=function(e){function t(){_classCallCheck(this,t);var e=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.__renderDebouncer=null,e.__invalidProps=null,e.__instance=null,e._lastIf=!1,e.__ctor=null,e}return _inherits(t,Polymer.Element),_createClass(t,null,[{key:"is",get:function(){return"dom-if"}},{key:"template",get:function(){return null}},{key:"properties",get:function(){return{if:{type:Boolean,observer:"__debounceRender"},restamp:{type:Boolean,observer:"__debounceRender"}}}}]),_createClass(t,[{key:"__debounceRender",value:function(){var e=this;this.__renderDebouncer=Polymer.Debouncer.debounce(this.__renderDebouncer,Polymer.Async.microTask,function(){return e.__render()}),Polymer.enqueueDebouncer(this.__renderDebouncer)}},{key:"disconnectedCallback",value:function(){_get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"disconnectedCallback",this).call(this),this.parentNode&&(this.parentNode.nodeType!=Node.DOCUMENT_FRAGMENT_NODE||this.parentNode.host)||this.__teardownInstance()}},{key:"connectedCallback",value:function(){_get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"connectedCallback",this).call(this),this.if&&this.__debounceRender()}},{key:"render",value:function(){Polymer.flush()}},{key:"__render",value:function(){if(this.if){if(!this.__ensureInstance())return;this._showHideChildren()}else this.restamp&&this.__teardownInstance();!this.restamp&&this.__instance&&this._showHideChildren(),this.if!=this._lastIf&&(this.dispatchEvent(new CustomEvent("dom-change",{bubbles:!0,composed:!0})),this._lastIf=this.if)}},{key:"__ensureInstance",value:function(){var e=this,t=this.parentNode;if(t){if(!this.__ctor){var n=this.querySelector("template");if(!n){var r=new MutationObserver(function(){if(!e.querySelector("template"))throw new Error("dom-if requires a <template> child");r.disconnect(),e.__render()});return r.observe(this,{childList:!0}),!1}this.__ctor=Polymer.Templatize.templatize(n,this,{mutableData:!0,forwardHostProp:function(e,t){this.__instance&&(this.if?this.__instance.forwardHostProp(e,t):(this.__invalidProps=this.__invalidProps||Object.create(null),this.__invalidProps[Polymer.Path.root(e)]=!0))}})}if(this.__instance){this.__syncHostProperties();var i=this.__instance.children;if(i&&i.length&&this.previousSibling!==i[i.length-1])for(var o,s=0;s<i.length&&(o=i[s]);s++)t.insertBefore(o,this)}else this.__instance=new this.__ctor,t.insertBefore(this.__instance.root,this)}return!0}},{key:"__syncHostProperties",value:function(){var e=this.__invalidProps;if(e){for(var t in e)this.__instance._setPendingProperty(t,this.__dataHost[t]);this.__invalidProps=null,this.__instance._flushProperties()}}},{key:"__teardownInstance",value:function(){if(this.__instance){var e=this.__instance.children;if(e&&e.length)for(var t,n=e[0].parentNode,r=0;r<e.length&&(t=e[r]);r++)n.removeChild(t);this.__instance=null,this.__invalidProps=null}}},{key:"_showHideChildren",value:function(){var e=this.__hideTemplateChildren__||!this.if;this.__instance&&this.__instance._showHideChildren(e)}}]),t}();customElements.define(e.is,e),Polymer.DomIf=e}();</script><script>function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var _createClass=function(){function e(e,t){for(var s=0;s<t.length;s++){var i=t[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,s,i){return s&&e(t.prototype,s),i&&e(t,i),t}}();!function(){"use strict";var e=Polymer.dedupingMixin(function(e){var t=Polymer.ElementMixin(e);return function(e){function s(){_classCallCheck(this,s);var e=_possibleConstructorReturn(this,(s.__proto__||Object.getPrototypeOf(s)).call(this));return e.__lastItems=null,e.__lastMulti=null,e.__selectedMap=null,e}return _inherits(s,t),_createClass(s,null,[{key:"properties",get:function(){return{items:{type:Array},multi:{type:Boolean,value:!1},selected:{type:Object,notify:!0},selectedItem:{type:Object,notify:!0},toggle:{type:Boolean,value:!1}}}},{key:"observers",get:function(){return["__updateSelection(multi, items.*)"]}}]),_createClass(s,[{key:"__updateSelection",value:function(e,t){var s=t.path;if("items"==s){var i=t.base||[],l=this.__lastItems;if(e!==this.__lastMulti&&this.clearSelection(),l){var n=Polymer.ArraySplice.calculateSplices(i,l);this.__applySplices(n)}this.__lastItems=i,this.__lastMulti=e}else if("items.splices"==t.path)this.__applySplices(t.value.indexSplices);else{var r=s.slice("items.".length),a=parseInt(r,10);r.indexOf(".")<0&&r==a&&this.__deselectChangedIdx(a)}}},{key:"__applySplices",value:function(e){for(var t=this,s=this.__selectedMap,i=0;i<e.length;i++)!function(i){var l=e[i];s.forEach(function(e,t){e<l.index||(e>=l.index+l.removed.length?s.set(t,e+l.addedCount-l.removed.length):s.set(t,-1))});for(var n=0;n<l.addedCount;n++){var r=l.index+n;s.has(t.items[r])&&s.set(t.items[r],r)}}(i);this.__updateLinks();var l=0;s.forEach(function(e,i){e<0?(t.multi?t.splice("selected",l,1):t.selected=t.selectedItem=null,s.delete(i)):l++})}},{key:"__updateLinks",value:function(){var e=this;if(this.__dataLinkedPaths={},this.multi){var t=0;this.__selectedMap.forEach(function(s){s>=0&&e.linkPaths("items."+s,"selected."+t++)})}else this.__selectedMap.forEach(function(t){e.linkPaths("selected","items."+t),e.linkPaths("selectedItem","items."+t)})}},{key:"clearSelection",value:function(){this.__dataLinkedPaths={},this.__selectedMap=new Map,this.selected=this.multi?[]:null,this.selectedItem=null}},{key:"isSelected",value:function(e){return this.__selectedMap.has(e)}},{key:"isIndexSelected",value:function(e){return this.isSelected(this.items[e])}},{key:"__deselectChangedIdx",value:function(e){var t=this,s=this.__selectedIndexForItemIndex(e);if(s>=0){var i=0;this.__selectedMap.forEach(function(e,l){s==i++&&t.deselect(l)})}}},{key:"__selectedIndexForItemIndex",value:function(e){var t=this.__dataLinkedPaths["items."+e];if(t)return parseInt(t.slice("selected.".length),10)}},{key:"deselect",value:function(e){var t=this.__selectedMap.get(e);if(t>=0){this.__selectedMap.delete(e);var s=void 0;this.multi&&(s=this.__selectedIndexForItemIndex(t)),this.__updateLinks(),this.multi?this.splice("selected",s,1):this.selected=this.selectedItem=null}}},{key:"deselectIndex",value:function(e){this.deselect(this.items[e])}},{key:"select",value:function(e){this.selectIndex(this.items.indexOf(e))}},{key:"selectIndex",value:function(e){var t=this.items[e];this.isSelected(t)?this.toggle&&this.deselectIndex(e):(this.multi||this.__selectedMap.clear(),this.__selectedMap.set(t,e),this.__updateLinks(),this.multi?this.push("selected",t):this.selected=this.selectedItem=t)}}]),s}()});Polymer.ArraySelectorMixin=e;var t=e(Polymer.Element),s=function(e){function s(){return _classCallCheck(this,s),_possibleConstructorReturn(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return _inherits(s,t),_createClass(s,null,[{key:"is",get:function(){return"array-selector"}}]),s}();customElements.define(s.is,s),Polymer.ArraySelector=s}();</script><script>(function(){"use strict";function t(t){i=(!t||!t.shimcssproperties)&&(S||!(navigator.userAgent.match("AppleWebKit/601")||!window.CSS||!CSS.supports||!CSS.supports("box-shadow","0 0 0 var(--foo)")))}function e(t,e){for(var n in e)null===n?t.style.removeProperty(n):t.style.setProperty(n,e[n])}function n(){var t=l;requestAnimationFrame(function(){u?u(t):(d||(d=new Promise(function(t){r=t}),"complete"===document.readyState?r():document.addEventListener("readystatechange",function(){"complete"===document.readyState&&r()})),d.then(function(){t&&t()}))})}function o(){this.customStyles=[],this.enqueued=!1}function a(t){!t.enqueued&&l&&(t.enqueued=!0,n())}var i,S=!(window.ShadyDOM&&window.ShadyDOM.inUse);window.ShadyCSS&&void 0!==window.ShadyCSS.nativeCss?i=window.ShadyCSS.nativeCss:window.ShadyCSS?(t(window.ShadyCSS),window.ShadyCSS=void 0):t(window.WebComponents&&window.WebComponents.flags);var r,s=i,d=null,u=window.HTMLImports&&window.HTMLImports.whenReady||null,y=null,l=null;o.prototype.c=function(t){t.__seenByShadyCSS||(t.__seenByShadyCSS=!0,this.customStyles.push(t),a(this))},o.prototype.b=function(t){if(t.__shadyCSSCachedStyle)return t.__shadyCSSCachedStyle;return t.getStyle?t.getStyle():t},o.prototype.a=function(){for(var t=this.customStyles,e=0;e<t.length;e++){var n=t[e];if(!n.__shadyCSSCachedStyle){var o=this.b(n);o&&(o=o.__appliedElement||o,y&&y(o),n.__shadyCSSCachedStyle=o)}}return t},o.prototype.addCustomStyle=o.prototype.c,o.prototype.getStyleForCustomStyle=o.prototype.b,o.prototype.processStyles=o.prototype.a,Object.defineProperties(o.prototype,{transformCallback:{get:function(){return y},set:function(t){y=t}},validateCallback:{get:function(){return l},set:function(t){var e=!1;l||(e=!0),l=t,e&&a(this)}}});var c=new o;window.ShadyCSS||(window.ShadyCSS={prepareTemplate:function(){},styleSubtree:function(t,n){c.a(),e(t,n)},styleElement:function(){c.a()},styleDocument:function(t){c.a(),e(document.body,t)},getComputedStyleValue:function(t,e){return(t=window.getComputedStyle(t).getPropertyValue(e))?t.trim():""},nativeCss:s,nativeShadow:S}),window.ShadyCSS.CustomStyleInterface=c}).call(this);</script><script>function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();!function(){"use strict";var e=window.ShadyCSS.CustomStyleInterface,t=function(t){function r(){_classCallCheck(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return t._style=null,e.addCustomStyle(t),t}return _inherits(r,HTMLElement),_createClass(r,[{key:"getStyle",value:function(){if(this._style)return this._style;var e=this.querySelector("style");if(!e)return null;this._style=e;var t=e.getAttribute("include");return t&&(e.removeAttribute("include"),e.textContent=Polymer.StyleGather.cssFromModules(t)+e.textContent),this._style}}]),r}();window.customElements.define("custom-style",t),Polymer.CustomStyle=t}();</script><script>!function(){"use strict";var t=void 0;t=Polymer.MutableData._mutablePropertyChange,Polymer.MutableDataBehavior={_shouldPropertyChange:function(a,e,r){return t(this,a,e,r,!0)}},Polymer.OptionalMutableDataBehavior={properties:{mutableData:Boolean},_shouldPropertyChange:function(a,e,r){return t(this,a,e,r,this.mutableData)}}}();</script><script>Polymer.Base=Polymer.LegacyElementMixin(HTMLElement).prototype;</script><script>Polymer.PaperSpinnerBehavior={properties:{active:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"__activeChanged"},alt:{type:String,value:"loading",observer:"__altChanged"},__coolingDown:{type:Boolean,value:!1}},__computeContainerClasses:function(e,t){return[e||t?"active":"",t?"cooldown":""].join(" ")},__activeChanged:function(e,t){this.__setAriaHidden(!e),this.__coolingDown=!e&&t},__altChanged:function(e){"loading"===e?this.alt=this.getAttribute("aria-label")||e:(this.__setAriaHidden(""===e),this.setAttribute("aria-label",e))},__setAriaHidden:function(e){e?this.setAttribute("aria-hidden","true"):this.removeAttribute("aria-hidden")},__reset:function(){this.active=!1,this.__coolingDown=!1}};</script><dom-module id="paper-spinner-styles" assetpath="../bower_components/paper-spinner/"><template><style>:host{display:inline-block;position:relative;width:28px;height:28px;--paper-spinner-container-rotation-duration:1568ms;--paper-spinner-expand-contract-duration:1333ms;--paper-spinner-full-cycle-duration:5332ms;--paper-spinner-cooldown-duration:400ms;}#spinnerContainer{width:100%;height:100%;direction:ltr;}#spinnerContainer.active{-webkit-animation:container-rotate var(--paper-spinner-container-rotation-duration) linear infinite;animation:container-rotate var(--paper-spinner-container-rotation-duration) linear infinite;}@-webkit-keyframes container-rotate{to{-webkit-transform:rotate(360deg);}}@keyframes container-rotate{to{transform:rotate(360deg);}}.spinner-layer{position:absolute;width:100%;height:100%;opacity:0;white-space:nowrap;border-color:var(--paper-spinner-color, var(--google-blue-500));}.layer-1{border-color:var(--paper-spinner-layer-1-color, var(--google-blue-500));}.layer-2{border-color:var(--paper-spinner-layer-2-color, var(--google-red-500));}.layer-3{border-color:var(--paper-spinner-layer-3-color, var(--google-yellow-500));}.layer-4{border-color:var(--paper-spinner-layer-4-color, var(--google-green-500));}.active .spinner-layer{-webkit-animation-name:fill-unfill-rotate;-webkit-animation-duration:var(--paper-spinner-full-cycle-duration);-webkit-animation-timing-function:cubic-bezier(0.4, 0.0, 0.2, 1);-webkit-animation-iteration-count:infinite;animation-name:fill-unfill-rotate;animation-duration:var(--paper-spinner-full-cycle-duration);animation-timing-function:cubic-bezier(0.4, 0.0, 0.2, 1);animation-iteration-count:infinite;opacity:1;}.active .spinner-layer.layer-1{-webkit-animation-name:fill-unfill-rotate, layer-1-fade-in-out;animation-name:fill-unfill-rotate, layer-1-fade-in-out;}.active .spinner-layer.layer-2{-webkit-animation-name:fill-unfill-rotate, layer-2-fade-in-out;animation-name:fill-unfill-rotate, layer-2-fade-in-out;}.active .spinner-layer.layer-3{-webkit-animation-name:fill-unfill-rotate, layer-3-fade-in-out;animation-name:fill-unfill-rotate, layer-3-fade-in-out;}.active .spinner-layer.layer-4{-webkit-animation-name:fill-unfill-rotate, layer-4-fade-in-out;animation-name:fill-unfill-rotate, layer-4-fade-in-out;}@-webkit-keyframes fill-unfill-rotate{12.5%{-webkit-transform:rotate(135deg);}25%{-webkit-transform:rotate(270deg);}37.5%{-webkit-transform:rotate(405deg);}50%{-webkit-transform:rotate(540deg);}62.5%{-webkit-transform:rotate(675deg);}75%{-webkit-transform:rotate(810deg);}87.5%{-webkit-transform:rotate(945deg);}to{-webkit-transform:rotate(1080deg);}}@keyframes fill-unfill-rotate{12.5%{transform:rotate(135deg);}25%{transform:rotate(270deg);}37.5%{transform:rotate(405deg);}50%{transform:rotate(540deg);}62.5%{transform:rotate(675deg);}75%{transform:rotate(810deg);}87.5%{transform:rotate(945deg);}to{transform:rotate(1080deg);}}@-webkit-keyframes layer-1-fade-in-out{0%{opacity:1;}25%{opacity:1;}26%{opacity:0;}89%{opacity:0;}90%{opacity:1;}to{opacity:1;}}@keyframes layer-1-fade-in-out{0%{opacity:1;}25%{opacity:1;}26%{opacity:0;}89%{opacity:0;}90%{opacity:1;}to{opacity:1;}}@-webkit-keyframes layer-2-fade-in-out{0%{opacity:0;}15%{opacity:0;}25%{opacity:1;}50%{opacity:1;}51%{opacity:0;}to{opacity:0;}}@keyframes layer-2-fade-in-out{0%{opacity:0;}15%{opacity:0;}25%{opacity:1;}50%{opacity:1;}51%{opacity:0;}to{opacity:0;}}@-webkit-keyframes layer-3-fade-in-out{0%{opacity:0;}40%{opacity:0;}50%{opacity:1;}75%{opacity:1;}76%{opacity:0;}to{opacity:0;}}@keyframes layer-3-fade-in-out{0%{opacity:0;}40%{opacity:0;}50%{opacity:1;}75%{opacity:1;}76%{opacity:0;}to{opacity:0;}}@-webkit-keyframes layer-4-fade-in-out{0%{opacity:0;}65%{opacity:0;}75%{opacity:1;}90%{opacity:1;}to{opacity:0;}}@keyframes layer-4-fade-in-out{0%{opacity:0;}65%{opacity:0;}75%{opacity:1;}90%{opacity:1;}to{opacity:0;}}.circle-clipper{display:inline-block;position:relative;width:50%;height:100%;overflow:hidden;border-color:inherit;}.spinner-layer::after{left:45%;width:10%;border-top-style:solid;}.spinner-layer::after,
       .circle-clipper::after{content:'';box-sizing:border-box;position:absolute;top:0;border-width:var(--paper-spinner-stroke-width, 3px);border-color:inherit;border-radius:50%;}.circle-clipper::after{bottom:0;width:200%;border-style:solid;border-bottom-color:transparent !important;}.circle-clipper.left::after{left:0;border-right-color:transparent !important;-webkit-transform:rotate(129deg);transform:rotate(129deg);}.circle-clipper.right::after{left:-100%;border-left-color:transparent !important;-webkit-transform:rotate(-129deg);transform:rotate(-129deg);}.active .gap-patch::after,
       .active .circle-clipper::after{-webkit-animation-duration:var(--paper-spinner-expand-contract-duration);-webkit-animation-timing-function:cubic-bezier(0.4, 0.0, 0.2, 1);-webkit-animation-iteration-count:infinite;animation-duration:var(--paper-spinner-expand-contract-duration);animation-timing-function:cubic-bezier(0.4, 0.0, 0.2, 1);animation-iteration-count:infinite;}.active .circle-clipper.left::after{-webkit-animation-name:left-spin;animation-name:left-spin;}.active .circle-clipper.right::after{-webkit-animation-name:right-spin;animation-name:right-spin;}@-webkit-keyframes left-spin{0%{-webkit-transform:rotate(130deg);}50%{-webkit-transform:rotate(-5deg);}to{-webkit-transform:rotate(130deg);}}@keyframes left-spin{0%{transform:rotate(130deg);}50%{transform:rotate(-5deg);}to{transform:rotate(130deg);}}@-webkit-keyframes right-spin{0%{-webkit-transform:rotate(-130deg);}50%{-webkit-transform:rotate(5deg);}to{-webkit-transform:rotate(-130deg);}}@keyframes right-spin{0%{transform:rotate(-130deg);}50%{transform:rotate(5deg);}to{transform:rotate(-130deg);}}#spinnerContainer.cooldown{-webkit-animation:container-rotate var(--paper-spinner-container-rotation-duration) linear infinite, fade-out var(--paper-spinner-cooldown-duration) cubic-bezier(0.4, 0.0, 0.2, 1);animation:container-rotate var(--paper-spinner-container-rotation-duration) linear infinite, fade-out var(--paper-spinner-cooldown-duration) cubic-bezier(0.4, 0.0, 0.2, 1);}@-webkit-keyframes fade-out{0%{opacity:1;}to{opacity:0;}}@keyframes fade-out{0%{opacity:1;}to{opacity:0;}}</style></template></dom-module><dom-module id="paper-spinner" assetpath="../bower_components/paper-spinner/"><template strip-whitespace=""><style include="paper-spinner-styles"></style><div id="spinnerContainer" class-name="[[__computeContainerClasses(active, __coolingDown)]]" on-animationend="__reset" on-webkit-animation-end="__reset"><div class="spinner-layer layer-1"><div class="circle-clipper left"></div><div class="circle-clipper right"></div></div><div class="spinner-layer layer-2"><div class="circle-clipper left"></div><div class="circle-clipper right"></div></div><div class="spinner-layer layer-3"><div class="circle-clipper left"></div><div class="circle-clipper right"></div></div><div class="spinner-layer layer-4"><div class="circle-clipper left"></div><div class="circle-clipper right"></div></div></div></template><script>Polymer({is:"paper-spinner",behaviors:[Polymer.PaperSpinnerBehavior]});</script></dom-module><style>@font-face{font-family:"Roboto";src:url("/static/fonts/roboto/Roboto-Thin.ttf") format("truetype");font-weight:100;font-style:normal;}@font-face{font-family:"Roboto";src:url("/static/fonts/roboto/Roboto-ThinItalic.ttf") format("truetype");font-weight:100;font-style:italic;}@font-face{font-family:"Roboto";src:url("/static/fonts/roboto/Roboto-Light.ttf") format("truetype");font-weight:300;font-style:normal;}@font-face{font-family:"Roboto";src:url("/static/fonts/roboto/Roboto-LightItalic.ttf") format("truetype");font-weight:300;font-style:italic;}@font-face{font-family:"Roboto";src:url("/static/fonts/roboto/Roboto-Regular.ttf") format("truetype");font-weight:400;font-style:normal;}@font-face{font-family:"Roboto";src:url("/static/fonts/roboto/Roboto-Italic.ttf") format("truetype");font-weight:400;font-style:italic;}@font-face{font-family:"Roboto";src:url("/static/fonts/roboto/Roboto-Medium.ttf") format("truetype");font-weight:500;font-style:normal;}@font-face{font-family:"Roboto";src:url("/static/fonts/roboto/Roboto-MediumItalic.ttf") format("truetype");font-weight:500;font-style:italic;}@font-face{font-family:"Roboto";src:url("/static/fonts/roboto/Roboto-Bold.ttf") format("truetype");font-weight:700;font-style:normal;}@font-face{font-family:"Roboto";src:url("/static/fonts/roboto/Roboto-BoldItalic.ttf") format("truetype");font-weight:700;font-style:italic;}@font-face{font-family:"Roboto";src:url("/static/fonts/roboto/Roboto-Black.ttf") format("truetype");font-weight:900;font-style:normal;}@font-face{font-family:"Roboto";src:url("/static/fonts/roboto/Roboto-BlackItalic.ttf") format("truetype");font-weight:900;font-style:italic;}@font-face{font-family:"Roboto Mono";src:url("/static/fonts/robotomono/RobotoMono-Thin.ttf") format("truetype");font-weight:100;font-style:normal;}@font-face{font-family:"Roboto Mono";src:url("/static/fonts/robotomono/RobotoMono-ThinItalic.ttf") format("truetype");font-weight:100;font-style:italic;}@font-face{font-family:"Roboto Mono";src:url("/static/fonts/robotomono/RobotoMono-Light.ttf") format("truetype");font-weight:300;font-style:normal;}@font-face{font-family:"Roboto Mono";src:url("/static/fonts/robotomono/RobotoMono-LightItalic.ttf") format("truetype");font-weight:300;font-style:italic;}@font-face{font-family:"Roboto Mono";src:url("/static/fonts/robotomono/RobotoMono-Regular.ttf") format("truetype");font-weight:400;font-style:normal;}@font-face{font-family:"Roboto Mono";src:url("/static/fonts/robotomono/RobotoMono-Italic.ttf") format("truetype");font-weight:400;font-style:italic;}@font-face{font-family:"Roboto Mono";src:url("/static/fonts/robotomono/RobotoMono-Medium.ttf") format("truetype");font-weight:500;font-style:normal;}@font-face{font-family:"Roboto Mono";src:url("/static/fonts/robotomono/RobotoMono-MediumItalic.ttf") format("truetype");font-weight:500;font-style:italic;}@font-face{font-family:"Roboto Mono";src:url("/static/fonts/robotomono/RobotoMono-Bold.ttf") format("truetype");font-weight:700;font-style:normal;}@font-face{font-family:"Roboto Mono";src:url("/static/fonts/robotomono/RobotoMono-BoldItalic.ttf") format("truetype");font-weight:700;font-style:italic;}</style><custom-style><style is="custom-style">html{--paper-font-common-base:{font-family:'Roboto', 'Noto', sans-serif;-webkit-font-smoothing:antialiased;};--paper-font-common-code:{font-family:'Roboto Mono', 'Consolas', 'Menlo', monospace;-webkit-font-smoothing:antialiased;};--paper-font-common-expensive-kerning:{text-rendering:optimizeLegibility;};--paper-font-common-nowrap:{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;};--paper-font-display4:{@apply --paper-font-common-base;@apply --paper-font-common-nowrap;font-size:112px;font-weight:300;letter-spacing:-.044em;line-height:120px;};--paper-font-display3:{@apply --paper-font-common-base;@apply --paper-font-common-nowrap;font-size:56px;font-weight:400;letter-spacing:-.026em;line-height:60px;};--paper-font-display2:{@apply --paper-font-common-base;font-size:45px;font-weight:400;letter-spacing:-.018em;line-height:48px;};--paper-font-display1:{@apply --paper-font-common-base;font-size:34px;font-weight:400;letter-spacing:-.01em;line-height:40px;};--paper-font-headline:{@apply --paper-font-common-base;font-size:24px;font-weight:400;letter-spacing:-.012em;line-height:32px;};--paper-font-title:{@apply --paper-font-common-base;@apply --paper-font-common-nowrap;font-size:20px;font-weight:500;line-height:28px;};--paper-font-subhead:{@apply --paper-font-common-base;font-size:16px;font-weight:400;line-height:24px;};--paper-font-body2:{@apply --paper-font-common-base;font-size:14px;font-weight:500;line-height:24px;};--paper-font-body1:{@apply --paper-font-common-base;font-size:14px;font-weight:400;line-height:20px;};--paper-font-caption:{@apply --paper-font-common-base;@apply --paper-font-common-nowrap;font-size:12px;font-weight:400;letter-spacing:0.011em;line-height:20px;};--paper-font-menu:{@apply --paper-font-common-base;@apply --paper-font-common-nowrap;font-size:13px;font-weight:500;line-height:24px;};--paper-font-button:{@apply --paper-font-common-base;@apply --paper-font-common-nowrap;font-size:14px;font-weight:500;letter-spacing:0.018em;line-height:24px;text-transform:uppercase;};--paper-font-code2:{@apply --paper-font-common-code;font-size:14px;font-weight:700;line-height:20px;};--paper-font-code1:{@apply --paper-font-common-code;font-size:14px;font-weight:500;line-height:20px;};}</style></custom-style><dom-module id="iron-flex" assetpath="../bower_components/iron-flex-layout/"><template><style>.layout.horizontal,
       .layout.vertical{display:-ms-flexbox;display:-webkit-flex;display:flex;}.layout.inline{display:-ms-inline-flexbox;display:-webkit-inline-flex;display:inline-flex;}.layout.horizontal{-ms-flex-direction:row;-webkit-flex-direction:row;flex-direction:row;}.layout.vertical{-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column;}.layout.wrap{-ms-flex-wrap:wrap;-webkit-flex-wrap:wrap;flex-wrap:wrap;}.layout.no-wrap{-ms-flex-wrap:nowrap;-webkit-flex-wrap:nowrap;flex-wrap:nowrap;}.layout.center,
@@ -10,14 +10,14 @@
       .flex-1{-ms-flex:1 1 0.000000001px;-webkit-flex:1;flex:1;-webkit-flex-basis:0.000000001px;flex-basis:0.000000001px;}.flex-2{-ms-flex:2;-webkit-flex:2;flex:2;}.flex-3{-ms-flex:3;-webkit-flex:3;flex:3;}.flex-4{-ms-flex:4;-webkit-flex:4;flex:4;}.flex-5{-ms-flex:5;-webkit-flex:5;flex:5;}.flex-6{-ms-flex:6;-webkit-flex:6;flex:6;}.flex-7{-ms-flex:7;-webkit-flex:7;flex:7;}.flex-8{-ms-flex:8;-webkit-flex:8;flex:8;}.flex-9{-ms-flex:9;-webkit-flex:9;flex:9;}.flex-10{-ms-flex:10;-webkit-flex:10;flex:10;}.flex-11{-ms-flex:11;-webkit-flex:11;flex:11;}.flex-12{-ms-flex:12;-webkit-flex:12;flex:12;}</style></template></dom-module><dom-module id="iron-positioning" assetpath="../bower_components/iron-flex-layout/"><template><style>.block{display:block;}[hidden]{display:none !important;}.invisible{visibility:hidden !important;}.relative{position:relative;}.fit{position:absolute;top:0;right:0;bottom:0;left:0;}body.fullbleed{margin:0;height:100vh;}.scroll{-webkit-overflow-scrolling:touch;overflow:auto;}.fixed-bottom,
       .fixed-left,
       .fixed-right,
-      .fixed-top{position:fixed;}.fixed-top{top:0;left:0;right:0;}.fixed-right{top:0;right:0;bottom:0;}.fixed-bottom{right:0;bottom:0;left:0;}.fixed-left{top:0;bottom:0;left:0;}</style></template></dom-module><script>!function(t,e){var i={},n={},r={};!function(t,e){function i(){this._delay=0,this._endDelay=0,this._fill="none",this._iterationStart=0,this._iterations=1,this._duration=0,this._playbackRate=1,this._direction="normal",this._easing="linear",this._easingFunction=v}function n(){return t.isDeprecated("Invalid timing inputs","2016-03-02","TypeError exceptions will be thrown instead.",!0)}function r(e,n,r){var a=new i;return n&&(a.fill="both",a.duration="auto"),"number"!=typeof e||isNaN(e)?void 0!==e&&Object.getOwnPropertyNames(e).forEach(function(i){if("auto"!=e[i]){if(("number"==typeof a[i]||"duration"==i)&&("number"!=typeof e[i]||isNaN(e[i])))return;if("fill"==i&&-1==_.indexOf(e[i]))return;if("direction"==i&&-1==g.indexOf(e[i]))return;if("playbackRate"==i&&1!==e[i]&&t.isDeprecated("AnimationEffectTiming.playbackRate","2014-11-28","Use Animation.playbackRate instead."))return;a[i]=e[i]}}):a.duration=e,a}function a(t,e,i,n){return t<0||t>1||i<0||i>1?v:function(r){function a(t,e,i){return 3*t*(1-i)*(1-i)*i+3*e*(1-i)*i*i+i*i*i}if(r<=0){var o=0;return t>0?o=e/t:!e&&i>0&&(o=n/i),o*r}if(r>=1){var s=0;return i<1?s=(n-1)/(i-1):1==i&&t<1&&(s=(e-1)/(t-1)),1+s*(r-1)}for(var u=0,c=1;u<c;){var f=(u+c)/2,l=a(t,i,f);if(Math.abs(r-l)<1e-5)return a(e,n,f);l<r?u=f:c=f}return a(e,n,f)}}function o(t,e){return function(i){if(i>=1)return 1;var n=1/t;return(i+=e*n)-i%n}}function s(t){x||(x=document.createElement("div").style),x.animationTimingFunction="",x.animationTimingFunction=t;var e=x.animationTimingFunction;if(""==e&&n())throw new TypeError(t+" is not a valid value for easing");return e}function u(t){if("linear"==t)return v;var e=A.exec(t);if(e)return a.apply(this,e.slice(1).map(Number));var i=P.exec(t);return i?o(Number(i[1]),{start:y,middle:b,end:T}[i[2]]):w[t]||v}function c(t){return 0===t.duration||0===t.iterations?0:t.duration*t.iterations}function f(t,e,i){if(null==e)return R;var n=i.delay+t+i.endDelay;return e<Math.min(i.delay,n)?k:e>=Math.min(i.delay+t,n)?N:S}function l(t,e,i,n,r){switch(n){case k:return"backwards"==e||"both"==e?0:null;case S:return i-r;case N:return"forwards"==e||"both"==e?t:null;case R:return null}}function h(t,e,i,n,r){var a=r;return 0===t?e!==k&&(a+=i):a+=n/t,a}function m(t,e,i,n,r,a){var o=t===1/0?e%1:t%1;return 0!==o||i!==N||0===n||0===r&&0!==a||(o=1),o}function d(t,e,i,n){return t===N&&e===1/0?1/0:1===i?Math.floor(n)-1:Math.floor(n)}function p(t,e,i){var n=t;if("normal"!==t&&"reverse"!==t){var r=e;"alternate-reverse"===t&&(r+=1),n="normal",r!==1/0&&r%2!=0&&(n="reverse")}return"normal"===n?i:1-i}var _="backwards|forwards|both|none".split("|"),g="reverse|alternate|alternate-reverse".split("|"),v=function(t){return t};i.prototype={_setMember:function(e,i){this["_"+e]=i,this._effect&&(this._effect._timingInput[e]=i,this._effect._timing=t.normalizeTimingInput(this._effect._timingInput),this._effect.activeDuration=t.calculateActiveDuration(this._effect._timing),this._effect._animation&&this._effect._animation._rebuildUnderlyingAnimation())},get playbackRate(){return this._playbackRate},set delay(t){this._setMember("delay",t)},get delay(){return this._delay},set endDelay(t){this._setMember("endDelay",t)},get endDelay(){return this._endDelay},set fill(t){this._setMember("fill",t)},get fill(){return this._fill},set iterationStart(t){if((isNaN(t)||t<0)&&n())throw new TypeError("iterationStart must be a non-negative number, received: "+timing.iterationStart);this._setMember("iterationStart",t)},get iterationStart(){return this._iterationStart},set duration(t){if("auto"!=t&&(isNaN(t)||t<0)&&n())throw new TypeError("duration must be non-negative or auto, received: "+t);this._setMember("duration",t)},get duration(){return this._duration},set direction(t){this._setMember("direction",t)},get direction(){return this._direction},set easing(t){this._easingFunction=u(s(t)),this._setMember("easing",t)},get easing(){return this._easing},set iterations(t){if((isNaN(t)||t<0)&&n())throw new TypeError("iterations must be non-negative, received: "+t);this._setMember("iterations",t)},get iterations(){return this._iterations}};var y=1,b=.5,T=0,w={ease:a(.25,.1,.25,1),"ease-in":a(.42,0,1,1),"ease-out":a(0,0,.58,1),"ease-in-out":a(.42,0,.58,1),"step-start":o(1,y),"step-middle":o(1,b),"step-end":o(1,T)},x=null,E="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",A=new RegExp("cubic-bezier\\("+E+","+E+","+E+","+E+"\\)"),P=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/,R=0,k=1,N=2,S=3;t.cloneTimingInput=function(t){if("number"==typeof t)return t;var e={};for(var i in t)e[i]=t[i];return e},t.makeTiming=r,t.numericTimingToObject=function(t){return"number"==typeof t&&(t=isNaN(t)?{duration:0}:{duration:t}),t},t.normalizeTimingInput=function(e,i){return e=t.numericTimingToObject(e),r(e,i)},t.calculateActiveDuration=function(t){return Math.abs(c(t)/t.playbackRate)},t.calculateIterationProgress=function(t,e,i){var n=f(t,e,i),r=l(t,i.fill,e,n,i.delay);if(null===r)return null;var a=h(i.duration,n,i.iterations,r,i.iterationStart),o=m(a,i.iterationStart,n,i.iterations,r,i.duration),s=d(n,i.iterations,o,a),u=p(i.direction,s,o);return i._easingFunction(u)},t.calculatePhase=f,t.normalizeEasing=s,t.parseEasingFunction=u}(i),function(t,e){function i(t,e){return t in c?c[t][e]||e:e}function n(t){return"display"===t||0===t.lastIndexOf("animation",0)||0===t.lastIndexOf("transition",0)}function r(t,e,r){if(!n(t)){var a=o[t];if(a){s.style[t]=e;for(var u in a){var c=a[u],f=s.style[c];r[c]=i(c,f)}}else r[t]=i(t,e)}}function a(t){var e=[];for(var i in t)if(!(i in["easing","offset","composite"])){var n=t[i];Array.isArray(n)||(n=[n]);for(var r,a=n.length,o=0;o<a;o++)r={},r.offset="offset"in t?t.offset:1==a?1:o/(a-1),"easing"in t&&(r.easing=t.easing),"composite"in t&&(r.composite=t.composite),r[i]=n[o],e.push(r)}return e.sort(function(t,e){return t.offset-e.offset}),e}var o={background:["backgroundImage","backgroundPosition","backgroundSize","backgroundRepeat","backgroundAttachment","backgroundOrigin","backgroundClip","backgroundColor"],border:["borderTopColor","borderTopStyle","borderTopWidth","borderRightColor","borderRightStyle","borderRightWidth","borderBottomColor","borderBottomStyle","borderBottomWidth","borderLeftColor","borderLeftStyle","borderLeftWidth"],borderBottom:["borderBottomWidth","borderBottomStyle","borderBottomColor"],borderColor:["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"],borderLeft:["borderLeftWidth","borderLeftStyle","borderLeftColor"],borderRadius:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],borderRight:["borderRightWidth","borderRightStyle","borderRightColor"],borderTop:["borderTopWidth","borderTopStyle","borderTopColor"],borderWidth:["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],flex:["flexGrow","flexShrink","flexBasis"],font:["fontFamily","fontSize","fontStyle","fontVariant","fontWeight","lineHeight"],margin:["marginTop","marginRight","marginBottom","marginLeft"],outline:["outlineColor","outlineStyle","outlineWidth"],padding:["paddingTop","paddingRight","paddingBottom","paddingLeft"]},s=document.createElementNS("http://www.w3.org/1999/xhtml","div"),u={thin:"1px",medium:"3px",thick:"5px"},c={borderBottomWidth:u,borderLeftWidth:u,borderRightWidth:u,borderTopWidth:u,fontSize:{"xx-small":"60%","x-small":"75%",small:"89%",medium:"100%",large:"120%","x-large":"150%","xx-large":"200%"},fontWeight:{normal:"400",bold:"700"},outlineWidth:u,textShadow:{none:"0px 0px 0px transparent"},boxShadow:{none:"0px 0px 0px 0px transparent"}};t.convertToArrayForm=a,t.normalizeKeyframes=function(e){if(null==e)return[];window.Symbol&&Symbol.iterator&&Array.prototype.from&&e[Symbol.iterator]&&(e=Array.from(e)),Array.isArray(e)||(e=a(e));for(var i=e.map(function(e){var i={};for(var n in e){var a=e[n];if("offset"==n){if(null!=a){if(a=Number(a),!isFinite(a))throw new TypeError("Keyframe offsets must be numbers.");if(a<0||a>1)throw new TypeError("Keyframe offsets must be between 0 and 1.")}}else if("composite"==n){if("add"==a||"accumulate"==a)throw{type:DOMException.NOT_SUPPORTED_ERR,name:"NotSupportedError",message:"add compositing is not supported"};if("replace"!=a)throw new TypeError("Invalid composite mode "+a+".")}else a="easing"==n?t.normalizeEasing(a):""+a;r(n,a,i)}return void 0==i.offset&&(i.offset=null),void 0==i.easing&&(i.easing="linear"),i}),n=!0,o=-1/0,s=0;s<i.length;s++){var u=i[s].offset;if(null!=u){if(u<o)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");o=u}else n=!1}return i=i.filter(function(t){return t.offset>=0&&t.offset<=1}),n||function(){var t=i.length;null==i[t-1].offset&&(i[t-1].offset=1),t>1&&null==i[0].offset&&(i[0].offset=0);for(var e=0,n=i[0].offset,r=1;r<t;r++){var a=i[r].offset;if(null!=a){for(var o=1;o<r-e;o++)i[e+o].offset=n+(a-n)*o/(r-e);e=r,n=a}}}(),i}}(i),function(t){var e={};t.isDeprecated=function(t,i,n,r){var a=r?"are":"is",o=new Date,s=new Date(i);return s.setMonth(s.getMonth()+3),!(o<s&&(t in e||console.warn("Web Animations: "+t+" "+a+" deprecated and will stop working on "+s.toDateString()+". "+n),e[t]=!0,1))},t.deprecated=function(e,i,n,r){var a=r?"are":"is";if(t.isDeprecated(e,i,n,r))throw new Error(e+" "+a+" no longer supported. "+n)}}(i),function(){if(document.documentElement.animate){var t=document.documentElement.animate([],0),e=!0;if(t&&(e=!1,"play|currentTime|pause|reverse|playbackRate|cancel|finish|startTime|playState".split("|").forEach(function(i){void 0===t[i]&&(e=!0)})),!e)return}!function(t,e,i){function n(t){for(var e={},i=0;i<t.length;i++)for(var n in t[i])if("offset"!=n&&"easing"!=n&&"composite"!=n){var r={offset:t[i].offset,easing:t[i].easing,value:t[i][n]};e[n]=e[n]||[],e[n].push(r)}for(var a in e){var o=e[a];if(0!=o[0].offset||1!=o[o.length-1].offset)throw{type:DOMException.NOT_SUPPORTED_ERR,name:"NotSupportedError",message:"Partial keyframes are not supported"}}return e}function r(i){var n=[];for(var r in i)for(var a=i[r],o=0;o<a.length-1;o++){var s=o,u=o+1,c=a[s].offset,f=a[u].offset,l=c,h=f;0==o&&(l=-1/0,0==f&&(u=s)),o==a.length-2&&(h=1/0,1==c&&(s=u)),n.push({applyFrom:l,applyTo:h,startOffset:a[s].offset,endOffset:a[u].offset,easingFunction:t.parseEasingFunction(a[s].easing),property:r,interpolation:e.propertyInterpolation(r,a[s].value,a[u].value)})}return n.sort(function(t,e){return t.startOffset-e.startOffset}),n}e.convertEffectInput=function(i){var a=n(t.normalizeKeyframes(i)),o=r(a);return function(t,i){if(null!=i)o.filter(function(t){return i>=t.applyFrom&&i<t.applyTo}).forEach(function(n){var r=i-n.startOffset,a=n.endOffset-n.startOffset,o=0==a?0:n.easingFunction(r/a);e.apply(t,n.property,n.interpolation(o))});else for(var n in a)"offset"!=n&&"easing"!=n&&"composite"!=n&&e.clear(t,n)}}}(i,n),function(t,e,i){function n(t){return t.replace(/-(.)/g,function(t,e){return e.toUpperCase()})}function r(t,e,i){a[i]=a[i]||[],a[i].push([t,e])}var a={};e.addPropertiesHandler=function(t,e,i){for(var a=0;a<i.length;a++)r(t,e,n(i[a]))};var o={backgroundColor:"transparent",backgroundPosition:"0% 0%",borderBottomColor:"currentColor",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",borderBottomWidth:"3px",borderLeftColor:"currentColor",borderLeftWidth:"3px",borderRightColor:"currentColor",borderRightWidth:"3px",borderSpacing:"2px",borderTopColor:"currentColor",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderTopWidth:"3px",bottom:"auto",clip:"rect(0px, 0px, 0px, 0px)",color:"black",fontSize:"100%",fontWeight:"400",height:"auto",left:"auto",letterSpacing:"normal",lineHeight:"120%",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",marginTop:"0px",maxHeight:"none",maxWidth:"none",minHeight:"0px",minWidth:"0px",opacity:"1.0",outlineColor:"invert",outlineOffset:"0px",outlineWidth:"3px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",paddingTop:"0px",right:"auto",strokeDasharray:"none",strokeDashoffset:"0px",textIndent:"0px",textShadow:"0px 0px 0px transparent",top:"auto",transform:"",verticalAlign:"0px",visibility:"visible",width:"auto",wordSpacing:"normal",zIndex:"auto"};e.propertyInterpolation=function(i,r,s){var u=i;/-/.test(i)&&!t.isDeprecated("Hyphenated property names","2016-03-22","Use camelCase instead.",!0)&&(u=n(i)),"initial"!=r&&"initial"!=s||("initial"==r&&(r=o[u]),"initial"==s&&(s=o[u]));for(var c=r==s?[]:a[u],f=0;c&&f<c.length;f++){var l=c[f][0](r),h=c[f][0](s);if(void 0!==l&&void 0!==h){var m=c[f][1](l,h);if(m){var d=e.Interpolation.apply(null,m);return function(t){return 0==t?r:1==t?s:d(t)}}}}return e.Interpolation(!1,!0,function(t){return t?s:r})}}(i,n),function(t,e,i){function n(e){var i=t.calculateActiveDuration(e),n=function(n){return t.calculateIterationProgress(i,n,e)};return n._totalDuration=e.delay+i+e.endDelay,n}e.KeyframeEffect=function(i,r,a,o){var s,u=n(t.normalizeTimingInput(a)),c=e.convertEffectInput(r),f=function(){c(i,s)};return f._update=function(t){return null!==(s=u(t))},f._clear=function(){c(i,null)},f._hasSameTarget=function(t){return i===t},f._target=i,f._totalDuration=u._totalDuration,f._id=o,f}}(i,n),function(t,e){t.apply=function(e,i,n){e.style[t.propertyName(i)]=n},t.clear=function(e,i){e.style[t.propertyName(i)]=""}}(n),function(t){window.Element.prototype.animate=function(e,i){var n="";return i&&i.id&&(n=i.id),t.timeline._play(t.KeyframeEffect(this,e,i,n))}}(n),function(t,e){function i(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e)return n<.5?t:e;if(t.length==e.length){for(var r=[],a=0;a<t.length;a++)r.push(i(t[a],e[a],n));return r}throw"Mismatched interpolation arguments "+t+":"+e}n.Interpolation=function(t,e,n){return function(r){return n(i(t,e,r))}}}(),function(t,e,i){t.sequenceNumber=0;var n=function(t,e,i){this.target=t,this.currentTime=e,this.timelineTime=i,this.type="finish",this.bubbles=!1,this.cancelable=!1,this.currentTarget=t,this.defaultPrevented=!1,this.eventPhase=Event.AT_TARGET,this.timeStamp=Date.now()};e.Animation=function(e){this.id="",e&&e._id&&(this.id=e._id),this._sequenceNumber=t.sequenceNumber++,this._currentTime=0,this._startTime=null,this._paused=!1,this._playbackRate=1,this._inTimeline=!0,this._finishedFlag=!0,this.onfinish=null,this._finishHandlers=[],this._effect=e,this._inEffect=this._effect._update(0),this._idle=!0,this._currentTimePending=!1},e.Animation.prototype={_ensureAlive:function(){this.playbackRate<0&&0===this.currentTime?this._inEffect=this._effect._update(-1):this._inEffect=this._effect._update(this.currentTime),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,e.timeline._animations.push(this))},_tickCurrentTime:function(t,e){t!=this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this._ensureAlive())},get currentTime(){return this._idle||this._currentTimePending?null:this._currentTime},set currentTime(t){t=+t,isNaN(t)||(e.restart(),this._paused||null==this._startTime||(this._startTime=this._timeline.currentTime-t/this._playbackRate),this._currentTimePending=!1,this._currentTime!=t&&(this._idle&&(this._idle=!1,this._paused=!0),this._tickCurrentTime(t,!0),e.applyDirtiedAnimation(this)))},get startTime(){return this._startTime},set startTime(t){t=+t,isNaN(t)||this._paused||this._idle||(this._startTime=t,this._tickCurrentTime((this._timeline.currentTime-this._startTime)*this.playbackRate),e.applyDirtiedAnimation(this))},get playbackRate(){return this._playbackRate},set playbackRate(t){if(t!=this._playbackRate){var i=this.currentTime;this._playbackRate=t,this._startTime=null,"paused"!=this.playState&&"idle"!=this.playState&&(this._finishedFlag=!1,this._idle=!1,this._ensureAlive(),e.applyDirtiedAnimation(this)),null!=i&&(this.currentTime=i)}},get _isFinished(){return!this._idle&&(this._playbackRate>0&&this._currentTime>=this._totalDuration||this._playbackRate<0&&this._currentTime<=0)},get _totalDuration(){return this._effect._totalDuration},get playState(){return this._idle?"idle":null==this._startTime&&!this._paused&&0!=this.playbackRate||this._currentTimePending?"pending":this._paused?"paused":this._isFinished?"finished":"running"},_rewind:function(){if(this._playbackRate>=0)this._currentTime=0;else{if(!(this._totalDuration<1/0))throw new DOMException("Unable to rewind negative playback rate animation with infinite duration","InvalidStateError");this._currentTime=this._totalDuration}},play:function(){this._paused=!1,(this._isFinished||this._idle)&&(this._rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this._ensureAlive(),e.applyDirtiedAnimation(this)},pause:function(){this._isFinished||this._paused||this._idle?this._idle&&(this._rewind(),this._idle=!1):this._currentTimePending=!0,this._startTime=null,this._paused=!0},finish:function(){this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this._currentTimePending=!1,e.applyDirtiedAnimation(this))},cancel:function(){this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._isFinished=!0,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this._effect._update(null),e.applyDirtiedAnimation(this))},reverse:function(){this.playbackRate*=-1,this.play()},addEventListener:function(t,e){"function"==typeof e&&"finish"==t&&this._finishHandlers.push(e)},removeEventListener:function(t,e){if("finish"==t){var i=this._finishHandlers.indexOf(e);i>=0&&this._finishHandlers.splice(i,1)}},_fireEvents:function(t){if(this._isFinished){if(!this._finishedFlag){var e=new n(this,this._currentTime,t),i=this._finishHandlers.concat(this.onfinish?[this.onfinish]:[]);setTimeout(function(){i.forEach(function(t){t.call(e.target,e)})},0),this._finishedFlag=!0}}else this._finishedFlag=!1},_tick:function(t,e){this._idle||this._paused||(null==this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this._tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this._currentTimePending=!1,this._fireEvents(t))},get _needsTick(){return this.playState in{pending:1,running:1}||!this._finishedFlag},_targetAnimations:function(){var t=this._effect._target;return t._activeAnimations||(t._activeAnimations=[]),t._activeAnimations},_markTarget:function(){var t=this._targetAnimations();-1===t.indexOf(this)&&t.push(this)},_unmarkTarget:function(){var t=this._targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)}}}(i,n),function(t,e,i){function n(t){var e=c;c=[],t<_.currentTime&&(t=_.currentTime),_._animations.sort(r),_._animations=s(t,!0,_._animations)[0],e.forEach(function(e){e[1](t)}),o(),l=void 0}function r(t,e){return t._sequenceNumber-e._sequenceNumber}function a(){this._animations=[],this.currentTime=window.performance&&performance.now?performance.now():0}function o(){d.forEach(function(t){t()}),d.length=0}function s(t,i,n){p=!0,m=!1,e.timeline.currentTime=t,h=!1;var r=[],a=[],o=[],s=[];return n.forEach(function(e){e._tick(t,i),e._inEffect?(a.push(e._effect),e._markTarget()):(r.push(e._effect),e._unmarkTarget()),e._needsTick&&(h=!0);var n=e._inEffect||e._needsTick;e._inTimeline=n,n?o.push(e):s.push(e)}),d.push.apply(d,r),d.push.apply(d,a),h&&requestAnimationFrame(function(){}),p=!1,[o,s]}var u=window.requestAnimationFrame,c=[],f=0;window.requestAnimationFrame=function(t){var e=f++;return 0==c.length&&u(n),c.push([e,t]),e},window.cancelAnimationFrame=function(t){c.forEach(function(e){e[0]==t&&(e[1]=function(){})})},a.prototype={_play:function(i){i._timing=t.normalizeTimingInput(i.timing);var n=new e.Animation(i);return n._idle=!1,n._timeline=this,this._animations.push(n),e.restart(),e.applyDirtiedAnimation(n),n}};var l=void 0,h=!1,m=!1;e.restart=function(){return h||(h=!0,requestAnimationFrame(function(){}),m=!0),m},e.applyDirtiedAnimation=function(t){if(!p){t._markTarget();var i=t._targetAnimations();i.sort(r),s(e.timeline.currentTime,!1,i.slice())[1].forEach(function(t){var e=_._animations.indexOf(t);-1!==e&&_._animations.splice(e,1)}),o()}};var d=[],p=!1,_=new a;e.timeline=_}(i,n),function(t){function e(t,e){var i=t.exec(e);if(i)return i=t.ignoreCase?i[0].toLowerCase():i[0],[i,e.substr(i.length)]}function i(t,e){var i=t(e=e.replace(/^\s*/,""));if(i)return[i[0],i[1].replace(/^\s*/,"")]}function n(t,e){for(var i=t,n=e;i&&n;)i>n?i%=n:n%=i;return i=t*e/(i+n)}function r(t,e,i,r,a){for(var o=[],s=[],u=[],c=n(r.length,a.length),f=0;f<c;f++){var l=e(r[f%r.length],a[f%a.length]);if(!l)return;o.push(l[0]),s.push(l[1]),u.push(l[2])}return[o,s,function(e){var n=e.map(function(t,e){return u[e](t)}).join(i);return t?t(n):n}]}t.consumeToken=e,t.consumeTrimmed=i,t.consumeRepeated=function(t,n,r){t=i.bind(null,t);for(var a=[];;){var o=t(r);if(!o)return[a,r];if(a.push(o[0]),r=o[1],!(o=e(n,r))||""==o[1])return[a,r];r=o[1]}},t.consumeParenthesised=function(t,e){for(var i=0,n=0;n<e.length&&(!/\s|,/.test(e[n])||0!=i);n++)if("("==e[n])i++;else if(")"==e[n]&&(0==--i&&n++,i<=0))break;var r=t(e.substr(0,n));return void 0==r?void 0:[r,e.substr(n)]},t.ignore=function(t){return function(e){var i=t(e);return i&&(i[0]=void 0),i}},t.optional=function(t,e){return function(i){return t(i)||[e,i]}},t.consumeList=function(e,i){for(var n=[],r=0;r<e.length;r++){var a=t.consumeTrimmed(e[r],i);if(!a||""==a[0])return;void 0!==a[0]&&n.push(a[0]),i=a[1]}if(""==i)return n},t.mergeNestedRepeated=r.bind(null,null),t.mergeWrappedNestedRepeated=r,t.mergeList=function(t,e,i){for(var n=[],r=[],a=[],o=0,s=0;s<i.length;s++)if("function"==typeof i[s]){var u=i[s](t[o],e[o++]);n.push(u[0]),r.push(u[1]),a.push(u[2])}else!function(t){n.push(!1),r.push(!1),a.push(function(){return i[t]})}(s);return[n,r,function(t){for(var e="",i=0;i<t.length;i++)e+=a[i](t[i]);return e}]}}(n),function(t){function e(e){var i={inset:!1,lengths:[],color:null},n=t.consumeRepeated(function(e){var n=t.consumeToken(/^inset/i,e);return n?(i.inset=!0,n):(n=t.consumeLengthOrPercent(e))?(i.lengths.push(n[0]),n):(n=t.consumeColor(e))?(i.color=n[0],n):void 0},/^/,e);if(n&&n[0].length)return[i,n[1]]}var i=function(e,i,n,r){function a(t){return{inset:t,color:[0,0,0,0],lengths:[{px:0},{px:0},{px:0},{px:0}]}}for(var o=[],s=[],u=0;u<n.length||u<r.length;u++){var c=n[u]||a(r[u].inset),f=r[u]||a(n[u].inset);o.push(c),s.push(f)}return t.mergeNestedRepeated(e,i,o,s)}.bind(null,function(e,i){for(;e.lengths.length<Math.max(e.lengths.length,i.lengths.length);)e.lengths.push({px:0});for(;i.lengths.length<Math.max(e.lengths.length,i.lengths.length);)i.lengths.push({px:0});if(e.inset==i.inset&&!!e.color==!!i.color){for(var n,r=[],a=[[],0],o=[[],0],s=0;s<e.lengths.length;s++){var u=t.mergeDimensions(e.lengths[s],i.lengths[s],2==s);a[0].push(u[0]),o[0].push(u[1]),r.push(u[2])}if(e.color&&i.color){var c=t.mergeColors(e.color,i.color);a[1]=c[0],o[1]=c[1],n=c[2]}return[a,o,function(t){for(var i=e.inset?"inset ":" ",a=0;a<r.length;a++)i+=r[a](t[0][a])+" ";return n&&(i+=n(t[1])),i}]}},", ");t.addPropertiesHandler(function(i){var n=t.consumeRepeated(e,/^,/,i);if(n&&""==n[1])return n[0]},i,["box-shadow","text-shadow"])}(n),function(t,e){function i(t){return t.toFixed(3).replace(/0+$/,"").replace(/\.$/,"")}function n(t,e,i){return Math.min(e,Math.max(t,i))}function r(t){if(/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t))return Number(t)}function a(t,e){return function(r,a){return[r,a,function(r){return i(n(t,e,r))}]}}function o(t){var e=t.trim().split(/\s*[\s,]\s*/);if(0!==e.length){for(var i=[],n=0;n<e.length;n++){var a=r(e[n]);if(void 0===a)return;i.push(a)}return i}}t.clamp=n,t.addPropertiesHandler(o,function(t,e){if(t.length==e.length)return[t,e,function(t){return t.map(i).join(" ")}]},["stroke-dasharray"]),t.addPropertiesHandler(r,a(0,1/0),["border-image-width","line-height"]),t.addPropertiesHandler(r,a(0,1),["opacity","shape-image-threshold"]),t.addPropertiesHandler(r,function(t,e){if(0!=t)return a(0,1/0)(t,e)},["flex-grow","flex-shrink"]),t.addPropertiesHandler(r,function(t,e){return[t,e,function(t){return Math.round(n(1,1/0,t))}]},["orphans","widows"]),t.addPropertiesHandler(r,function(t,e){return[t,e,Math.round]},["z-index"]),t.parseNumber=r,t.parseNumberList=o,t.mergeNumbers=function(t,e){return[t,e,i]},t.numberToString=i}(n),function(t,e){n.addPropertiesHandler(String,function(t,e){if("visible"==t||"visible"==e)return[0,1,function(i){return i<=0?t:i>=1?e:"visible"}]},["visibility"])}(),function(t,e){function i(t){t=t.trim(),a.fillStyle="#000",a.fillStyle=t;var e=a.fillStyle;if(a.fillStyle="#fff",a.fillStyle=t,e==a.fillStyle){a.fillRect(0,0,1,1);var i=a.getImageData(0,0,1,1).data;a.clearRect(0,0,1,1);var n=i[3]/255;return[i[0]*n,i[1]*n,i[2]*n,n]}}function n(e,i){return[e,i,function(e){if(e[3])for(var i=0;i<3;i++)e[i]=Math.round(function(t){return Math.max(0,Math.min(255,t))}(e[i]/e[3]));return e[3]=t.numberToString(t.clamp(0,1,e[3])),"rgba("+e.join(",")+")"}]}var r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");r.width=r.height=1;var a=r.getContext("2d");t.addPropertiesHandler(i,n,["background-color","border-bottom-color","border-left-color","border-right-color","border-top-color","color","fill","flood-color","lighting-color","outline-color","stop-color","stroke","text-decoration-color"]),t.consumeColor=t.consumeParenthesised.bind(null,i),t.mergeColors=n}(n),function(t,e){function i(t){function e(){var e=s.exec(t);o=e?e[0]:void 0}function i(){var t=Number(o);return e(),t}function n(){if("("!==o)return i();e();var t=a();return")"!==o?NaN:(e(),t)}function r(){for(var t=n();"*"===o||"/"===o;){var i=o;e();var r=n();"*"===i?t*=r:t/=r}return t}function a(){for(var t=r();"+"===o||"-"===o;){var i=o;e();var n=r();"+"===i?t+=n:t-=n}return t}var o,s=/([\+\-\w\.]+|[\(\)\*\/])/g;return e(),a()}function n(t,e){if("0"==(e=e.trim().toLowerCase())&&"px".search(t)>=0)return{px:0};if(/^[^(]*$|^calc/.test(e)){var n={};e=(e=e.replace(/calc\(/g,"(")).replace(t,function(t){return n[t]=null,"U"+t});for(var r="U("+t.source+")",a=e.replace(/[-+]?(\d*\.)?\d+([Ee][-+]?\d+)?/g,"N").replace(new RegExp("N"+r,"g"),"D").replace(/\s[+-]\s/g,"O").replace(/\s/g,""),o=[/N\*(D)/g,/(N|D)[*\/]N/g,/(N|D)O\1/g,/\((N|D)\)/g],s=0;s<o.length;)o[s].test(a)?(a=a.replace(o[s],"$1"),s=0):s++;if("D"==a){for(var u in n){var c=i(e.replace(new RegExp("U"+u,"g"),"").replace(new RegExp(r,"g"),"*0"));if(!isFinite(c))return;n[u]=c}return n}}}function r(t,e){return a(t,e,!0)}function a(e,i,n){var r,a=[];for(r in e)a.push(r);for(r in i)a.indexOf(r)<0&&a.push(r);return e=a.map(function(t){return e[t]||0}),i=a.map(function(t){return i[t]||0}),[e,i,function(e){var i=e.map(function(i,r){return 1==e.length&&n&&(i=Math.max(i,0)),t.numberToString(i)+a[r]}).join(" + ");return e.length>1?"calc("+i+")":i}]}var o="px|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc",s=n.bind(null,new RegExp(o,"g")),u=n.bind(null,new RegExp(o+"|%","g")),c=n.bind(null,/deg|rad|grad|turn/g);t.parseLength=s,t.parseLengthOrPercent=u,t.consumeLengthOrPercent=t.consumeParenthesised.bind(null,u),t.parseAngle=c,t.mergeDimensions=a;var f=t.consumeParenthesised.bind(null,s),l=t.consumeRepeated.bind(void 0,f,/^/),h=t.consumeRepeated.bind(void 0,l,/^,/);t.consumeSizePairList=h;var m=t.mergeNestedRepeated.bind(void 0,r," "),d=t.mergeNestedRepeated.bind(void 0,m,",");t.mergeNonNegativeSizePair=m,t.addPropertiesHandler(function(t){var e=h(t);if(e&&""==e[1])return e[0]},d,["background-size"]),t.addPropertiesHandler(u,r,["border-bottom-width","border-image-width","border-left-width","border-right-width","border-top-width","flex-basis","font-size","height","line-height","max-height","max-width","outline-width","width"]),t.addPropertiesHandler(u,a,["border-bottom-left-radius","border-bottom-right-radius","border-top-left-radius","border-top-right-radius","bottom","left","letter-spacing","margin-bottom","margin-left","margin-right","margin-top","min-height","min-width","outline-offset","padding-bottom","padding-left","padding-right","padding-top","perspective","right","shape-margin","stroke-dashoffset","text-indent","top","vertical-align","word-spacing"])}(n),function(t,e){function i(e){return t.consumeLengthOrPercent(e)||t.consumeToken(/^auto/,e)}function n(e){var n=t.consumeList([t.ignore(t.consumeToken.bind(null,/^rect/)),t.ignore(t.consumeToken.bind(null,/^\(/)),t.consumeRepeated.bind(null,i,/^,/),t.ignore(t.consumeToken.bind(null,/^\)/))],e);if(n&&4==n[0].length)return n[0]}var r=t.mergeWrappedNestedRepeated.bind(null,function(t){return"rect("+t+")"},function(e,i){return"auto"==e||"auto"==i?[!0,!1,function(n){var r=n?e:i;if("auto"==r)return"auto";var a=t.mergeDimensions(r,r);return a[2](a[0])}]:t.mergeDimensions(e,i)},", ");t.parseBox=n,t.mergeBoxes=r,t.addPropertiesHandler(n,r,["clip"])}(n),function(t,e){function i(t){return function(e){var i=0;return t.map(function(t){return t===c?e[i++]:t})}}function n(t){return t}function r(e){if("none"==(e=e.toLowerCase().trim()))return[];for(var i,n=/\s*(\w+)\(([^)]*)\)/g,r=[],a=0;i=n.exec(e);){if(i.index!=a)return;a=i.index+i[0].length;var o=i[1],s=h[o];if(!s)return;var u=i[2].split(","),c=s[0];if(c.length<u.length)return;for(var m=[],d=0;d<c.length;d++){var p,_=u[d],g=c[d];if(void 0===(p=_?{A:function(e){return"0"==e.trim()?l:t.parseAngle(e)},N:t.parseNumber,T:t.parseLengthOrPercent,L:t.parseLength}[g.toUpperCase()](_):{a:l,n:m[0],t:f}[g]))return;m.push(p)}if(r.push({t:o,d:m}),n.lastIndex==e.length)return r}}function a(t){return t.toFixed(6).replace(".000000","")}function o(e,i){if(e.decompositionPair!==i){e.decompositionPair=i;var n=t.makeMatrixDecomposition(e)}if(i.decompositionPair!==e){i.decompositionPair=e;var r=t.makeMatrixDecomposition(i)}return null==n[0]||null==r[0]?[[!1],[!0],function(t){return t?i[0].d:e[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(e){var i=t.quat(n[0][3],r[0][3],e[5]);return t.composeMatrix(e[0],e[1],e[2],i,e[4]).map(a).join(",")}])}function s(t){return t.replace(/[xy]/,"")}function u(t){return t.replace(/(x|y|z|3d)?$/,"3d")}var c=null,f={px:0},l={deg:0},h={matrix:["NNNNNN",[c,c,0,0,c,c,0,0,0,0,1,0,c,c,0,1],n],matrix3d:["NNNNNNNNNNNNNNNN",n],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",i([c,c,1]),n],scalex:["N",i([c,1,1]),i([c,1])],scaley:["N",i([1,c,1]),i([1,c])],scalez:["N",i([1,1,c])],scale3d:["NNN",n],skew:["Aa",null,n],skewx:["A",null,i([c,l])],skewy:["A",null,i([l,c])],translate:["Tt",i([c,c,f]),n],translatex:["T",i([c,f,f]),i([c,f])],translatey:["T",i([f,c,f]),i([f,c])],translatez:["L",i([f,f,c])],translate3d:["TTL",n]};t.addPropertiesHandler(r,function(e,i){var n=t.makeMatrixDecomposition&&!0,r=!1;if(!e.length||!i.length)for(e.length||(r=!0,e=i,i=[]),p=0;p<e.length;p++){var a=e[p].t,c=e[p].d,f="scale"==a.substr(0,5)?1:0;i.push({t:a,d:c.map(function(t){if("number"==typeof t)return f;var e={};for(var i in t)e[i]=f;return e})})}var l=[],m=[],d=[];if(e.length!=i.length){if(!n)return;l=[(P=o(e,i))[0]],m=[P[1]],d=[["matrix",[P[2]]]]}else for(var p=0;p<e.length;p++){var _=e[p].t,g=i[p].t,v=e[p].d,y=i[p].d,b=h[_],T=h[g];if(function(t,e){return"perspective"==t&&"perspective"==e||("matrix"==t||"matrix3d"==t)&&("matrix"==e||"matrix3d"==e)}(_,g)){if(!n)return;P=o([e[p]],[i[p]]),l.push(P[0]),m.push(P[1]),d.push(["matrix",[P[2]]])}else{if(_==g)a=_;else if(b[2]&&T[2]&&s(_)==s(g))a=s(_),v=b[2](v),y=T[2](y);else{if(!b[1]||!T[1]||u(_)!=u(g)){if(!n)return;l=[(P=o(e,i))[0]],m=[P[1]],d=[["matrix",[P[2]]]];break}a=u(_),v=b[1](v),y=T[1](y)}for(var w=[],x=[],E=[],A=0;A<v.length;A++){var P=("number"==typeof v[A]?t.mergeNumbers:t.mergeDimensions)(v[A],y[A]);w[A]=P[0],x[A]=P[1],E.push(P[2])}l.push(w),m.push(x),d.push([a,E])}}if(r){var R=l;l=m,m=R}return[l,m,function(t){return t.map(function(t,e){var i=t.map(function(t,i){return d[e][1][i](t)}).join(",");return"matrix"==d[e][0]&&16==i.split(",").length&&(d[e][0]="matrix3d"),d[e][0]+"("+i+")"}).join(" ")}]},["transform"]),t.transformToSvgMatrix=function(e){var i=t.transformListToMatrix(r(e));return"matrix("+a(i[0])+" "+a(i[1])+" "+a(i[4])+" "+a(i[5])+" "+a(i[12])+" "+a(i[13])+")"}}(n),function(t,e){function i(t,e){e.concat([t]).forEach(function(e){e in document.documentElement.style&&(n[t]=e),r[e]=t})}var n={},r={};i("transform",["webkitTransform","msTransform"]),i("transformOrigin",["webkitTransformOrigin"]),i("perspective",["webkitPerspective"]),i("perspectiveOrigin",["webkitPerspectiveOrigin"]),t.propertyName=function(t){return n[t]||t},t.unprefixedPropertyName=function(t){return r[t]||t}}(n)}(),function(){if(void 0===document.createElement("div").animate([]).oncancel){if(window.performance&&performance.now)t=function(){return performance.now()};else var t=function(){return Date.now()};var e=function(t,e,i){this.target=t,this.currentTime=e,this.timelineTime=i,this.type="cancel",this.bubbles=!1,this.cancelable=!1,this.currentTarget=t,this.defaultPrevented=!1,this.eventPhase=Event.AT_TARGET,this.timeStamp=Date.now()},i=window.Element.prototype.animate;window.Element.prototype.animate=function(n,r){var a=i.call(this,n,r);a._cancelHandlers=[],a.oncancel=null;var o=a.cancel;a.cancel=function(){o.call(this);var i=new e(this,null,t()),n=this._cancelHandlers.concat(this.oncancel?[this.oncancel]:[]);setTimeout(function(){n.forEach(function(t){t.call(i.target,i)})},0)};var s=a.addEventListener;a.addEventListener=function(t,e){"function"==typeof e&&"cancel"==t?this._cancelHandlers.push(e):s.call(this,t,e)};var u=a.removeEventListener;return a.removeEventListener=function(t,e){if("cancel"==t){var i=this._cancelHandlers.indexOf(e);i>=0&&this._cancelHandlers.splice(i,1)}else u.call(this,t,e)},a}}}(),function(t){var e=document.documentElement,i=null,n=!1;try{var r="0"==getComputedStyle(e).getPropertyValue("opacity")?"1":"0";(i=e.animate({opacity:[r,r]},{duration:1})).currentTime=0,n=getComputedStyle(e).getPropertyValue("opacity")==r}catch(t){}finally{i&&i.cancel()}if(!n){var a=window.Element.prototype.animate;window.Element.prototype.animate=function(e,i){return window.Symbol&&Symbol.iterator&&Array.prototype.from&&e[Symbol.iterator]&&(e=Array.from(e)),Array.isArray(e)||null===e||(e=t.convertToArrayForm(e)),a.call(this,e,i)}}}(i),function(t,e,i){function n(t){var i=e.timeline;i.currentTime=t,i._discardAnimations(),0==i._animations.length?a=!1:requestAnimationFrame(n)}var r=window.requestAnimationFrame;window.requestAnimationFrame=function(t){return r(function(i){e.timeline._updateAnimationsPromises(),t(i),e.timeline._updateAnimationsPromises()})},e.AnimationTimeline=function(){this._animations=[],this.currentTime=void 0},e.AnimationTimeline.prototype={getAnimations:function(){return this._discardAnimations(),this._animations.slice()},_updateAnimationsPromises:function(){e.animationsWithPromises=e.animationsWithPromises.filter(function(t){return t._updatePromises()})},_discardAnimations:function(){this._updateAnimationsPromises(),this._animations=this._animations.filter(function(t){return"finished"!=t.playState&&"idle"!=t.playState})},_play:function(t){var i=new e.Animation(t,this);return this._animations.push(i),e.restartWebAnimationsNextTick(),i._updatePromises(),i._animation.play(),i._updatePromises(),i},play:function(t){return t&&t.remove(),this._play(t)}};var a=!1;e.restartWebAnimationsNextTick=function(){a||(a=!0,requestAnimationFrame(n))};var o=new e.AnimationTimeline;e.timeline=o;try{Object.defineProperty(window.document,"timeline",{configurable:!0,get:function(){return o}})}catch(t){}try{window.document.timeline=o}catch(t){}}(0,r),function(t,e,i){e.animationsWithPromises=[],e.Animation=function(e,i){if(this.id="",e&&e._id&&(this.id=e._id),this.effect=e,e&&(e._animation=this),!i)throw new Error("Animation with null timeline is not supported");this._timeline=i,this._sequenceNumber=t.sequenceNumber++,this._holdTime=0,this._paused=!1,this._isGroup=!1,this._animation=null,this._childAnimations=[],this._callback=null,this._oldPlayState="idle",this._rebuildUnderlyingAnimation(),this._animation.cancel(),this._updatePromises()},e.Animation.prototype={_updatePromises:function(){var t=this._oldPlayState,e=this.playState;return this._readyPromise&&e!==t&&("idle"==e?(this._rejectReadyPromise(),this._readyPromise=void 0):"pending"==t?this._resolveReadyPromise():"pending"==e&&(this._readyPromise=void 0)),this._finishedPromise&&e!==t&&("idle"==e?(this._rejectFinishedPromise(),this._finishedPromise=void 0):"finished"==e?this._resolveFinishedPromise():"finished"==t&&(this._finishedPromise=void 0)),this._oldPlayState=this.playState,this._readyPromise||this._finishedPromise},_rebuildUnderlyingAnimation:function(){this._updatePromises();var t,i,n,r,a=!!this._animation;a&&(t=this.playbackRate,i=this._paused,n=this.startTime,r=this.currentTime,this._animation.cancel(),this._animation._wrapper=null,this._animation=null),(!this.effect||this.effect instanceof window.KeyframeEffect)&&(this._animation=e.newUnderlyingAnimationForKeyframeEffect(this.effect),e.bindAnimationForKeyframeEffect(this)),(this.effect instanceof window.SequenceEffect||this.effect instanceof window.GroupEffect)&&(this._animation=e.newUnderlyingAnimationForGroup(this.effect),e.bindAnimationForGroup(this)),this.effect&&this.effect._onsample&&e.bindAnimationForCustomEffect(this),a&&(1!=t&&(this.playbackRate=t),null!==n?this.startTime=n:null!==r?this.currentTime=r:null!==this._holdTime&&(this.currentTime=this._holdTime),i&&this.pause()),this._updatePromises()},_updateChildren:function(){if(this.effect&&"idle"!=this.playState){var t=this.effect._timing.delay;this._childAnimations.forEach(function(i){this._arrangeChildren(i,t),this.effect instanceof window.SequenceEffect&&(t+=e.groupChildDuration(i.effect))}.bind(this))}},_setExternalAnimation:function(t){var e=this;if(this.effect&&this._isGroup)for(var i=0;i<this.effect.children.length;i++)e.effect.children[i]._animation=t,e._childAnimations[i]._setExternalAnimation(t)},_constructChildAnimations:function(){if(this.effect&&this._isGroup){var t=this.effect._timing.delay;this._removeChildAnimations(),this.effect.children.forEach(function(i){var n=e.timeline._play(i);this._childAnimations.push(n),n.playbackRate=this.playbackRate,this._paused&&n.pause(),i._animation=this.effect._animation,this._arrangeChildren(n,t),this.effect instanceof window.SequenceEffect&&(t+=e.groupChildDuration(i))}.bind(this))}},_arrangeChildren:function(t,e){null===this.startTime?t.currentTime=this.currentTime-e/this.playbackRate:t.startTime!==this.startTime+e/this.playbackRate&&(t.startTime=this.startTime+e/this.playbackRate)},get timeline(){return this._timeline},get playState(){return this._animation?this._animation.playState:"idle"},get finished(){return window.Promise?(this._finishedPromise||(-1==e.animationsWithPromises.indexOf(this)&&e.animationsWithPromises.push(this),this._finishedPromise=new Promise(function(t,e){this._resolveFinishedPromise=function(){t(this)},this._rejectFinishedPromise=function(){e({type:DOMException.ABORT_ERR,name:"AbortError"})}}.bind(this)),"finished"==this.playState&&this._resolveFinishedPromise()),this._finishedPromise):(console.warn("Animation Promises require JavaScript Promise constructor"),null)},get ready(){return window.Promise?(this._readyPromise||(-1==e.animationsWithPromises.indexOf(this)&&e.animationsWithPromises.push(this),this._readyPromise=new Promise(function(t,e){this._resolveReadyPromise=function(){t(this)},this._rejectReadyPromise=function(){e({type:DOMException.ABORT_ERR,name:"AbortError"})}}.bind(this)),"pending"!==this.playState&&this._resolveReadyPromise()),this._readyPromise):(console.warn("Animation Promises require JavaScript Promise constructor"),null)},get onfinish(){return this._animation.onfinish},set onfinish(t){this._animation.onfinish="function"==typeof t?function(e){e.target=this,t.call(this,e)}.bind(this):t},get oncancel(){return this._animation.oncancel},set oncancel(t){this._animation.oncancel="function"==typeof t?function(e){e.target=this,t.call(this,e)}.bind(this):t},get currentTime(){this._updatePromises();var t=this._animation.currentTime;return this._updatePromises(),t},set currentTime(t){this._updatePromises(),this._animation.currentTime=isFinite(t)?t:Math.sign(t)*Number.MAX_VALUE,this._register(),this._forEachChild(function(e,i){e.currentTime=t-i}),this._updatePromises()},get startTime(){return this._animation.startTime},set startTime(t){this._updatePromises(),this._animation.startTime=isFinite(t)?t:Math.sign(t)*Number.MAX_VALUE,this._register(),this._forEachChild(function(e,i){e.startTime=t+i}),this._updatePromises()},get playbackRate(){return this._animation.playbackRate},set playbackRate(t){this._updatePromises();var e=this.currentTime;this._animation.playbackRate=t,this._forEachChild(function(e){e.playbackRate=t}),null!==e&&(this.currentTime=e),this._updatePromises()},play:function(){this._updatePromises(),this._paused=!1,this._animation.play(),-1==this._timeline._animations.indexOf(this)&&this._timeline._animations.push(this),this._register(),e.awaitStartTime(this),this._forEachChild(function(t){var e=t.currentTime;t.play(),t.currentTime=e}),this._updatePromises()},pause:function(){this._updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._animation.pause(),this._register(),this._forEachChild(function(t){t.pause()}),this._paused=!0,this._updatePromises()},finish:function(){this._updatePromises(),this._animation.finish(),this._register(),this._updatePromises()},cancel:function(){this._updatePromises(),this._animation.cancel(),this._register(),this._removeChildAnimations(),this._updatePromises()},reverse:function(){this._updatePromises();var t=this.currentTime;this._animation.reverse(),this._forEachChild(function(t){t.reverse()}),null!==t&&(this.currentTime=t),this._updatePromises()},addEventListener:function(t,e){var i=e;"function"==typeof e&&(i=function(t){t.target=this,e.call(this,t)}.bind(this),e._wrapper=i),this._animation.addEventListener(t,i)},removeEventListener:function(t,e){this._animation.removeEventListener(t,e&&e._wrapper||e)},_removeChildAnimations:function(){for(var t=this;this._childAnimations.length;)t._childAnimations.pop().cancel()},_forEachChild:function(e){var i=0;if(this.effect.children&&this._childAnimations.length<this.effect.children.length&&this._constructChildAnimations(),this._childAnimations.forEach(function(t){e.call(this,t,i),this.effect instanceof window.SequenceEffect&&(i+=t.effect.activeDuration)}.bind(this)),"pending"!=this.playState){var n=this.effect._timing,r=this.currentTime;null!==r&&(r=t.calculateIterationProgress(t.calculateActiveDuration(n),r,n)),(null==r||isNaN(r))&&this._removeChildAnimations()}}},window.Animation=e.Animation}(i,r),function(t,e,i){function n(e){this._frames=t.normalizeKeyframes(e)}function r(){for(var t=!1;u.length;)u.shift()._updateChildren(),t=!0;return t}var a=function(t){if(t._animation=void 0,t instanceof window.SequenceEffect||t instanceof window.GroupEffect)for(var e=0;e<t.children.length;e++)a(t.children[e])};e.removeMulti=function(t){for(var e=[],i=0;i<t.length;i++){var n=t[i];n._parent?(-1==e.indexOf(n._parent)&&e.push(n._parent),n._parent.children.splice(n._parent.children.indexOf(n),1),n._parent=null,a(n)):n._animation&&n._animation.effect==n&&(n._animation.cancel(),n._animation.effect=new KeyframeEffect(null,[]),n._animation._callback&&(n._animation._callback._animation=null),n._animation._rebuildUnderlyingAnimation(),a(n))}for(i=0;i<e.length;i++)e[i]._rebuild()},e.KeyframeEffect=function(e,i,r,a){return this.target=e,this._parent=null,r=t.numericTimingToObject(r),this._timingInput=t.cloneTimingInput(r),this._timing=t.normalizeTimingInput(r),this.timing=t.makeTiming(r,!1,this),this.timing._effect=this,"function"==typeof i?(t.deprecated("Custom KeyframeEffect","2015-06-22","Use KeyframeEffect.onsample instead."),this._normalizedKeyframes=i):this._normalizedKeyframes=new n(i),this._keyframes=i,this.activeDuration=t.calculateActiveDuration(this._timing),this._id=a,this},e.KeyframeEffect.prototype={getFrames:function(){return"function"==typeof this._normalizedKeyframes?this._normalizedKeyframes:this._normalizedKeyframes._frames},set onsample(t){if("function"==typeof this.getFrames())throw new Error("Setting onsample on custom effect KeyframeEffect is not supported.");this._onsample=t,this._animation&&this._animation._rebuildUnderlyingAnimation()},get parent(){return this._parent},clone:function(){if("function"==typeof this.getFrames())throw new Error("Cloning custom effects is not supported.");var e=new KeyframeEffect(this.target,[],t.cloneTimingInput(this._timingInput),this._id);return e._normalizedKeyframes=this._normalizedKeyframes,e._keyframes=this._keyframes,e},remove:function(){e.removeMulti([this])}};var o=Element.prototype.animate;Element.prototype.animate=function(t,i){var n="";return i&&i.id&&(n=i.id),e.timeline._play(new e.KeyframeEffect(this,t,i,n))};var s=document.createElementNS("http://www.w3.org/1999/xhtml","div");e.newUnderlyingAnimationForKeyframeEffect=function(t){if(t){e=t.target||s;"function"==typeof(i=t._keyframes)&&(i=[]),(n=t._timingInput).id=t._id}else var e=s,i=[],n=0;return o.apply(e,[i,n])},e.bindAnimationForKeyframeEffect=function(t){t.effect&&"function"==typeof t.effect._normalizedKeyframes&&e.bindAnimationForCustomEffect(t)};var u=[];e.awaitStartTime=function(t){null===t.startTime&&t._isGroup&&(0==u.length&&requestAnimationFrame(r),u.push(t))};var c=window.getComputedStyle;Object.defineProperty(window,"getComputedStyle",{configurable:!0,enumerable:!0,value:function(){e.timeline._updateAnimationsPromises();var t=c.apply(this,arguments);return r()&&(t=c.apply(this,arguments)),e.timeline._updateAnimationsPromises(),t}}),window.KeyframeEffect=e.KeyframeEffect,window.Element.prototype.getAnimations=function(){return document.timeline.getAnimations().filter(function(t){return null!==t.effect&&t.effect.target==this}.bind(this))}}(i,r),function(t,e,i){function n(t){t._registered||(t._registered=!0,o.push(t),s||(s=!0,requestAnimationFrame(r)))}function r(t){var e=o;o=[],e.sort(function(t,e){return t._sequenceNumber-e._sequenceNumber}),e=e.filter(function(t){t();var e=t._animation?t._animation.playState:"idle";return"running"!=e&&"pending"!=e&&(t._registered=!1),t._registered}),o.push.apply(o,e),o.length?(s=!0,requestAnimationFrame(r)):s=!1}var a=(document.createElementNS("http://www.w3.org/1999/xhtml","div"),0);e.bindAnimationForCustomEffect=function(e){var i,r=e.effect.target,o="function"==typeof e.effect.getFrames();i=o?e.effect.getFrames():e.effect._onsample;var s=e.effect.timing,u=null;s=t.normalizeTimingInput(s);var c=function(){var n=c._animation?c._animation.currentTime:null;null!==n&&(n=t.calculateIterationProgress(t.calculateActiveDuration(s),n,s),isNaN(n)&&(n=null)),n!==u&&(o?i(n,r,e.effect):i(n,e.effect,e.effect._animation)),u=n};c._animation=e,c._registered=!1,c._sequenceNumber=a++,e._callback=c,n(c)};var o=[],s=!1;e.Animation.prototype._register=function(){this._callback&&n(this._callback)}}(i,r),function(t,e,i){function n(t){return t._timing.delay+t.activeDuration+t._timing.endDelay}function r(e,i,n){this._id=n,this._parent=null,this.children=e||[],this._reparent(this.children),i=t.numericTimingToObject(i),this._timingInput=t.cloneTimingInput(i),this._timing=t.normalizeTimingInput(i,!0),this.timing=t.makeTiming(i,!0,this),this.timing._effect=this,"auto"===this._timing.duration&&(this._timing.duration=this.activeDuration)}window.SequenceEffect=function(){r.apply(this,arguments)},window.GroupEffect=function(){r.apply(this,arguments)},r.prototype={_isAncestor:function(t){for(var e=this;null!==e;){if(e==t)return!0;e=e._parent}return!1},_rebuild:function(){for(var t=this;t;)"auto"===t.timing.duration&&(t._timing.duration=t.activeDuration),t=t._parent;this._animation&&this._animation._rebuildUnderlyingAnimation()},_reparent:function(t){var i=this;e.removeMulti(t);for(var n=0;n<t.length;n++)t[n]._parent=i},_putChild:function(t,e){for(var i=this,n=e?"Cannot append an ancestor or self":"Cannot prepend an ancestor or self",r=0;r<t.length;r++)if(i._isAncestor(t[r]))throw{type:DOMException.HIERARCHY_REQUEST_ERR,name:"HierarchyRequestError",message:n};for(r=0;r<t.length;r++)e?i.children.push(t[r]):i.children.unshift(t[r]);this._reparent(t),this._rebuild()},append:function(){this._putChild(arguments,!0)},prepend:function(){this._putChild(arguments,!1)},get parent(){return this._parent},get firstChild(){return this.children.length?this.children[0]:null},get lastChild(){return this.children.length?this.children[this.children.length-1]:null},clone:function(){for(var e=this,i=t.cloneTimingInput(this._timingInput),n=[],r=0;r<this.children.length;r++)n.push(e.children[r].clone());return this instanceof GroupEffect?new GroupEffect(n,i):new SequenceEffect(n,i)},remove:function(){e.removeMulti([this])}},window.SequenceEffect.prototype=Object.create(r.prototype),Object.defineProperty(window.SequenceEffect.prototype,"activeDuration",{get:function(){var t=0;return this.children.forEach(function(e){t+=n(e)}),Math.max(t,0)}}),window.GroupEffect.prototype=Object.create(r.prototype),Object.defineProperty(window.GroupEffect.prototype,"activeDuration",{get:function(){var t=0;return this.children.forEach(function(e){t=Math.max(t,n(e))}),t}}),e.newUnderlyingAnimationForGroup=function(i){var n,r=null,a=new KeyframeEffect(null,[],i._timing,i._id);return a.onsample=function(e){var i=n._wrapper;if(i&&"pending"!=i.playState&&i.effect)return null==e?void i._removeChildAnimations():0==e&&i.playbackRate<0&&(r||(r=t.normalizeTimingInput(i.effect.timing)),e=t.calculateIterationProgress(t.calculateActiveDuration(r),-1,r),isNaN(e)||null==e)?(i._forEachChild(function(t){t.currentTime=-1}),void i._removeChildAnimations()):void 0},n=e.timeline._play(a)},e.bindAnimationForGroup=function(t){t._animation._wrapper=t,t._isGroup=!0,e.awaitStartTime(t),t._constructChildAnimations(),t._setExternalAnimation(t)},e.groupChildDuration=n}(i,r),e.true=t}({},function(){return this}());</script><script>!function(n){"use strict";function t(n,t){for(var e=[],r=0,u=n.length;r<u;r++)e.push(n[r].substr(0,t));return e}function e(n){return function(t,e,r){var u=r[n].indexOf(e.charAt(0).toUpperCase()+e.substr(1).toLowerCase());~u&&(t.month=u)}}function r(n,t){for(n=String(n),t=t||2;n.length<t;)n="0"+n;return n}var u={},o=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,a=/\d\d?/,i=/\d{3}/,s=/\d{4}/,m=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,d=/\[([^]*?)\]/gm,c=function(){},f=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h=["January","February","March","April","May","June","July","August","September","October","November","December"],l=t(h,3),M=t(f,3);u.i18n={dayNamesShort:M,dayNames:f,monthNamesShort:l,monthNames:h,amPm:["am","pm"],DoFn:function(n){return n+["th","st","nd","rd"][n%10>3?0:(n-n%10!=10)*n%10]}};var g={D:function(n){return n.getDate()},DD:function(n){return r(n.getDate())},Do:function(n,t){return t.DoFn(n.getDate())},d:function(n){return n.getDay()},dd:function(n){return r(n.getDay())},ddd:function(n,t){return t.dayNamesShort[n.getDay()]},dddd:function(n,t){return t.dayNames[n.getDay()]},M:function(n){return n.getMonth()+1},MM:function(n){return r(n.getMonth()+1)},MMM:function(n,t){return t.monthNamesShort[n.getMonth()]},MMMM:function(n,t){return t.monthNames[n.getMonth()]},YY:function(n){return String(n.getFullYear()).substr(2)},YYYY:function(n){return n.getFullYear()},h:function(n){return n.getHours()%12||12},hh:function(n){return r(n.getHours()%12||12)},H:function(n){return n.getHours()},HH:function(n){return r(n.getHours())},m:function(n){return n.getMinutes()},mm:function(n){return r(n.getMinutes())},s:function(n){return n.getSeconds()},ss:function(n){return r(n.getSeconds())},S:function(n){return Math.round(n.getMilliseconds()/100)},SS:function(n){return r(Math.round(n.getMilliseconds()/10),2)},SSS:function(n){return r(n.getMilliseconds(),3)},a:function(n,t){return n.getHours()<12?t.amPm[0]:t.amPm[1]},A:function(n,t){return n.getHours()<12?t.amPm[0].toUpperCase():t.amPm[1].toUpperCase()},ZZ:function(n){var t=n.getTimezoneOffset();return(t>0?"-":"+")+r(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)}},D={D:[a,function(n,t){n.day=t}],Do:[new RegExp(a.source+m.source),function(n,t){n.day=parseInt(t,10)}],M:[a,function(n,t){n.month=t-1}],YY:[a,function(n,t){var e=+(""+(new Date).getFullYear()).substr(0,2);n.year=""+(t>68?e-1:e)+t}],h:[a,function(n,t){n.hour=t}],m:[a,function(n,t){n.minute=t}],s:[a,function(n,t){n.second=t}],YYYY:[s,function(n,t){n.year=t}],S:[/\d/,function(n,t){n.millisecond=100*t}],SS:[/\d{2}/,function(n,t){n.millisecond=10*t}],SSS:[i,function(n,t){n.millisecond=t}],d:[a,c],ddd:[m,c],MMM:[m,e("monthNamesShort")],MMMM:[m,e("monthNames")],a:[m,function(n,t,e){var r=t.toLowerCase();r===e.amPm[0]?n.isPm=!1:r===e.amPm[1]&&(n.isPm=!0)}],ZZ:[/[\+\-]\d\d:?\d\d/,function(n,t){var e,r=(t+"").match(/([\+\-]|\d\d)/gi);r&&(e=60*r[1]+parseInt(r[2],10),n.timezoneOffset="+"===r[0]?e:-e)}]};D.dd=D.d,D.dddd=D.ddd,D.DD=D.D,D.mm=D.m,D.hh=D.H=D.HH=D.h,D.MM=D.M,D.ss=D.s,D.A=D.a,u.masks={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},u.format=function(n,t,e){var r=e||u.i18n;if("number"==typeof n&&(n=new Date(n)),"[object Date]"!==Object.prototype.toString.call(n)||isNaN(n.getTime()))throw new Error("Invalid Date in fecha.format");var a=[];return t=(t=u.masks[t]||t||u.masks.default).replace(d,function(n,t){return a.push(t),"??"}),(t=t.replace(o,function(t){return t in g?g[t](n,r):t.slice(1,t.length-1)})).replace(/\?\?/g,function(){return a.shift()})},u.parse=function(n,t,e){var r=e||u.i18n;if("string"!=typeof t)throw new Error("Invalid format in fecha.parse");if(t=u.masks[t]||t,n.length>1e3)return!1;var a=!0,i={};if(t.replace(o,function(t){if(D[t]){var e=D[t],u=n.search(e[0]);~u?n.replace(e[0],function(t){return e[1](i,t,r),n=n.substr(u+t.length),t}):a=!1}return D[t]?"":t.slice(1,t.length-1)}),!a)return!1;var s=new Date;!0===i.isPm&&null!=i.hour&&12!=+i.hour?i.hour=+i.hour+12:!1===i.isPm&&12==+i.hour&&(i.hour=0);var m;return null!=i.timezoneOffset?(i.minute=+(i.minute||0)-+i.timezoneOffset,m=new Date(Date.UTC(i.year||s.getFullYear(),i.month||0,i.day||1,i.hour||0,i.minute||0,i.second||0,i.millisecond||0))):m=new Date(i.year||s.getFullYear(),i.month||0,i.day||1,i.hour||0,i.minute||0,i.second||0,i.millisecond||0),m},"undefined"!=typeof module&&module.exports?module.exports=u:"function"==typeof define&&define.amd?define(function(){return u}):n.fecha=u}(this);</script><script>function toLocaleStringSupportsOptions(){try{(new Date).toLocaleString("i")}catch(e){return"RangeError"===e.name}return!1}function toLocaleDateStringSupportsOptions(){try{(new Date).toLocaleDateString("i")}catch(e){return"RangeError"===e.name}return!1}function toLocaleTimeStringSupportsOptions(){try{(new Date).toLocaleTimeString("i")}catch(e){return"RangeError"===e.name}return!1}window.hassUtil=window.hassUtil||{},window.hassUtil.DEFAULT_ICON="mdi:bookmark",window.hassUtil.OFF_STATES=["off","closed","unlocked"],window.hassUtil.DOMAINS_WITH_CARD=["climate","cover","configurator","input_select","input_slider","media_player","scene","script","weblink"],window.hassUtil.DOMAINS_WITH_MORE_INFO=["alarm_control_panel","automation","camera","climate","configurator","cover","fan","group","light","lock","media_player","script","sun","updater","vacuum"],window.hassUtil.DOMAINS_WITH_NO_HISTORY=["camera","configurator","scene"],window.hassUtil.HIDE_MORE_INFO=["input_select","scene","script","input_slider"],window.hassUtil.LOGIC_STATE_ATTRIBUTES=["entity_picture","friendly_name","icon","unit_of_measurement","emulated_hue","emulated_hue_name","haaska_hidden","haaska_name","homebridge_hidden","homebridge_name","supported_features","attribution","custom_ui_state_card","device_class"],window.hassUtil.LANGUAGE=navigator.languages?navigator.languages[0]:navigator.language||navigator.userLanguage,window.hassUtil.attributeClassNames=function(e,t){return e?t.map(function(t){return t in e.attributes?"has-"+t:""}).join(" "):""},window.hassUtil.featureClassNames=function(e,t){if(!e||!e.attributes.supported_features)return"";var i=e.attributes.supported_features;return Object.keys(t).map(function(e){return 0!=(i&e)?t[e]:""}).join(" ")},window.hassUtil.canToggleState=function(e,t){var i=window.hassUtil.computeDomain(t);return"group"===i?"on"===t.state||"off"===t.state:window.hassUtil.canToggleDomain(e,i)},window.hassUtil.canToggleDomain=function(e,t){var i,a=e.config.services[t];return i="lock"===t?"lock":"cover"===t?"open_cover":"turn_on",a&&i in a},window.hassUtil.dynamicContentUpdater=function(e,t,i){var a,n=Polymer.dom(e);n.lastChild&&n.lastChild.tagName===t?a=n.lastChild:(n.lastChild&&n.removeChild(n.lastChild),a=document.createElement(t)),Object.keys(i).forEach(function(e){a[e]=i[e]}),null===a.parentNode&&n.appendChild(a)},window.fecha.masks.haDateTime=window.fecha.masks.shortTime+" "+window.fecha.masks.mediumDate,toLocaleStringSupportsOptions()?window.hassUtil.formatDateTime=function(e){return e.toLocaleString(window.hassUtil.LANGUAGE,{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"})}:window.hassUtil.formatDateTime=function(e){return window.fecha.format(e,"haDateTime")},toLocaleDateStringSupportsOptions()?window.hassUtil.formatDate=function(e){return e.toLocaleDateString(window.hassUtil.LANGUAGE,{year:"numeric",month:"long",day:"numeric"})}:window.hassUtil.formatDate=function(e){return window.fecha.format(e,"mediumDate")},toLocaleTimeStringSupportsOptions()?window.hassUtil.formatTime=function(e){return e.toLocaleTimeString(window.hassUtil.LANGUAGE,{hour:"numeric",minute:"2-digit"})}:window.hassUtil.formatTime=function(e){return window.fecha.format(e,"shortTime")},window.hassUtil.relativeTime=function(e){var t,i=Math.abs(new Date-e)/1e3,a=new Date>e?"%s ago":"in %s",n=window.hassUtil.relativeTime.tests;for(t=0;t<n.length;t+=2){if(i<n[t])return i=Math.floor(i),a.replace("%s",1===i?"1 "+n[t+1]:i+" "+n[t+1]+"s");i/=n[t]}return i=Math.floor(i),a.replace("%s",1===i?"1 week":i+" weeks")},window.hassUtil.relativeTime.tests=[60,"second",60,"minute",24,"hour",7,"day"],window.hassUtil.stateCardType=function(e,t){if("unavailable"===t.state)return"display";var i=window.hassUtil.computeDomain(t);return-1!==window.hassUtil.DOMAINS_WITH_CARD.indexOf(i)?i:window.hassUtil.canToggleState(e,t)&&"hidden"!==t.attributes.control?"toggle":"display"},window.hassUtil.stateMoreInfoType=function(e){var t=window.hassUtil.computeDomain(e);return-1!==window.hassUtil.DOMAINS_WITH_MORE_INFO.indexOf(t)?t:-1!==window.hassUtil.HIDE_MORE_INFO.indexOf(t)?"hidden":"default"},window.hassUtil.domainIcon=function(e,t){switch(e){case"alarm_control_panel":return t&&"disarmed"===t?"mdi:bell-outline":"mdi:bell";case"automation":return"mdi:playlist-play";case"binary_sensor":return t&&"off"===t?"mdi:radiobox-blank":"mdi:checkbox-marked-circle";case"calendar":return"mdi:calendar";case"camera":return"mdi:video";case"climate":return"mdi:nest-thermostat";case"configurator":return"mdi:settings";case"conversation":return"mdi:text-to-speech";case"cover":return t&&"open"===t?"mdi:window-open":"mdi:window-closed";case"device_tracker":return"mdi:account";case"fan":return"mdi:fan";case"group":return"mdi:google-circles-communities";case"homeassistant":return"mdi:home";case"image_processing":return"mdi:image-filter-frames";case"input_boolean":return"mdi:drawing";case"input_select":return"mdi:format-list-bulleted";case"input_slider":return"mdi:ray-vertex";case"light":return"mdi:lightbulb";case"lock":return t&&"unlocked"===t?"mdi:lock-open":"mdi:lock";case"media_player":return t&&"off"!==t&&"idle"!==t?"mdi:cast-connected":"mdi:cast";case"notify":return"mdi:comment-alert";case"proximity":return"mdi:apple-safari";case"remote":return"mdi:remote";case"scene":return"mdi:google-pages";case"script":return"mdi:file-document";case"sensor":return"mdi:eye";case"simple_alarm":return"mdi:bell";case"sun":return"mdi:white-balance-sunny";case"switch":return"mdi:flash";case"updater":return"mdi:cloud-upload";case"weblink":return"mdi:open-in-new";case"zwave":if(t){if(-1!==t.indexOf("Dead"))return"mdi:emoticon-dead";if(-1!==t.indexOf("Sleeping"))return"mdi:sleep"}return"mdi:nfc";default:return console.warn("Unable to find icon for domain "+e+" ("+t+")"),window.hassUtil.DEFAULT_ICON}},window.hassUtil.binarySensorIcon=function(e){var t=e.state&&"off"===e.state;switch(e.attributes.device_class){case"connectivity":return t?"mdi:server-network-off":"mdi:server-network";case"light":return t?"mdi:brightness-5":"mdi:brightness-7";case"moisture":return t?"mdi:water-off":"mdi:water";case"motion":return t?"mdi:walk":"mdi:run";case"occupancy":return t?"mdi:home":"mdi:home-outline";case"opening":return t?"mdi:crop-square":"mdi:exit-to-app";case"sound":return t?"mdi:music-note-off":"mdi:music-note";case"vibration":return t?"mdi:crop-portrait":"mdi:vibrate";case"gas":case"power":case"safety":case"smoke":return t?"mdi:verified":"mdi:alert";default:return t?"mdi:radiobox-blank":"mdi:checkbox-marked-circle"}},window.hassUtil.coverIcon=function(e){var t=e.state&&"open"===e.state;switch(e.attributes.device_class){case"garage":return t?"mdi:garage-open":"mdi:garage";default:return t?"mdi:window-open":"mdi:window-closed"}},window.hassUtil.stateIcon=function(e){if(!e)return window.hassUtil.DEFAULT_ICON;if(e.attributes.icon)return e.attributes.icon;var t=e.attributes.unit_of_measurement,i=window.hassUtil.computeDomain(e);if(t&&"sensor"===i){if("°C"===t||"°F"===t)return"mdi:thermometer";if("Mice"===t)return"mdi:mouse-variant"}else{if("binary_sensor"===i)return window.hassUtil.binarySensorIcon(e);if("cover"===i)return window.hassUtil.coverIcon(e)}return window.hassUtil.domainIcon(i,e.state)},window.hassUtil.computeDomain=function(e){return e._domain||(e._domain=window.HAWS.extractDomain(e.entity_id)),e._domain},window.hassUtil.computeStateName=function(e){return void 0===e._entityDisplay&&(e._entityDisplay=e.attributes.friendly_name||window.HAWS.extractObjectId(e.entity_id).replace(/_/g," ")),e._entityDisplay},window.hassUtil.sortByName=function(e,t){var i=window.hassUtil.computeStateName(e),a=window.hassUtil.computeStateName(t);return i<a?-1:i>a?1:0},window.hassUtil.computeStateState=function(e){if(!e._stateDisplay&&(e._stateDisplay=e.state.replace(/_/g," "),e.attributes.unit_of_measurement&&(e._stateDisplay+=" "+e.attributes.unit_of_measurement),"binary_sensor"===window.hassUtil.computeDomain(e)))switch(e.attributes.device_class){case"moisture":e._stateDisplay="off"===e._stateDisplay?"dry":"wet";break;case"gas":case"motion":case"occupancy":case"smoke":case"sound":case"vibration":e._stateDisplay="off"===e._stateDisplay?"clear":"detected";break;case"opening":e._stateDisplay="off"===e._stateDisplay?"closed":"open";break;case"safety":e._stateDisplay="off"===e._stateDisplay?"safe":"unsafe"}return e._stateDisplay},window.hassUtil.isComponentLoaded=function(e,t){return e&&-1!==e.config.core.components.indexOf(t)},window.hassUtil.computeLocationName=function(e){return e&&e.config.core.location_name},window.hassUtil.applyThemesOnElement=function(e,t,i){e._themes||(e._themes={});var a=t.default_theme;if(("default"===i||i&&t.themes[i])&&(a=i),"default"!==a){var n=t.themes[a],r=Object.assign({},e._themes);Object.keys(n).forEach(function(t){var i="--"+t;e._themes[i]="",r[i]=n[t]}),e.updateStyles(r)}else e.updateStyles(e._themes)};</script><script>!function(){var t=["dockedSidebar"];Polymer({is:"ha-pref-storage",properties:{hass:{type:Object},storage:{type:Object,value:window.localStorage||{}}},storeState:function(){var e=this;if(this.hass)try{for(var r=0;r<t.length;r++){var a=t[r];e.storage[a]=JSON.stringify(e.hass[a])}}catch(t){}},getStoredState:function(){for(var e=this,r={},a=0;a<t.length;a++){var s=t[a];s in e.storage&&(r[s]=JSON.parse(e.storage[s]))}return r}})}();</script><script>window.hassCallApi=function(e,t,s,o,a){var r=e+"/api/"+o;if(window.HASS_DEMO){var n;switch(o.split("/",1)[0]){case"bootstrap":n=window.hassDemoData.bootstrap;break;case"logbook":n=window.hassDemoData.logbook;break;case"history":n=window.hassDemoData.stateHistory;break;default:n=!1}return new Promise(function(e,t){n?e(n):t("Request not allowed in demo mode.")})}return new Promise(function(e,o){var n=new XMLHttpRequest;n.open(s,r,!0),t.authToken&&n.setRequestHeader("X-HA-access",t.authToken),n.onload=function(){var t=n.responseText;if("application/json"===n.getResponseHeader("content-type"))try{t=JSON.parse(n.responseText)}catch(e){return void o({error:"Unable to parse JSON response",status_code:n.status,body:t})}n.status>199&&n.status<300?e(t):o({error:"Response error: "+n.status,status_code:n.status,body:t})},n.onerror=function(){o({error:"Request error",status_code:n.status,body:n.responseText})},a?(n.setRequestHeader("Content-Type","application/json;charset=UTF-8"),n.send(JSON.stringify(a))):n.send()})};</script><custom-style><style is="custom-style">html{--primary-text-color:var(--light-theme-text-color);--primary-background-color:var(--light-theme-background-color);--secondary-text-color:var(--light-theme-secondary-color);--disabled-text-color:var(--light-theme-disabled-color);--divider-color:var(--light-theme-divider-color);--error-color:var(--paper-deep-orange-a700);--primary-color:var(--paper-indigo-500);--light-primary-color:var(--paper-indigo-100);--dark-primary-color:var(--paper-indigo-700);--accent-color:var(--paper-pink-a200);--light-accent-color:var(--paper-pink-a100);--dark-accent-color:var(--paper-pink-a400);--light-theme-background-color:#ffffff;--light-theme-base-color:#000000;--light-theme-text-color:var(--paper-grey-900);--light-theme-secondary-color:#737373;--light-theme-disabled-color:#9b9b9b;--light-theme-divider-color:#dbdbdb;--dark-theme-background-color:var(--paper-grey-900);--dark-theme-base-color:#ffffff;--dark-theme-text-color:#ffffff;--dark-theme-secondary-color:#bcbcbc;--dark-theme-disabled-color:#646464;--dark-theme-divider-color:#3c3c3c;--text-primary-color:var(--dark-theme-text-color);--default-primary-color:var(--primary-color);}</style></custom-style><script>!function(){function e(e){this.type=e&&e.type||"default",this.key=e&&e.key,"value"in e&&(this.value=e.value)}e.types={},e.prototype={get value(){var t=this.type,y=this.key;if(t&&y)return e.types[t]&&e.types[t][y]},set value(t){var y=this.type,i=this.key;y&&i&&(y=e.types[y]=e.types[y]||{},null==t?delete y[i]:y[i]=t)},get list(){if(this.type)return Object.keys(e.types[this.type]).map(function(e){return t[this.type][e]},this)},byKey:function(e){return this.key=e,this.value}},Polymer.IronMeta=e;var t=Polymer.IronMeta.types;Polymer({is:"iron-meta",properties:{type:{type:String,value:"default"},key:{type:String},value:{type:String,notify:!0},self:{type:Boolean,observer:"_selfChanged"},__meta:{type:Boolean,computed:"__computeMeta(type, key, value)"}},hostAttributes:{hidden:!0},__computeMeta:function(e,t,y){var i=new Polymer.IronMeta({type:e,key:t});return void 0!==y&&y!==i.value?i.value=y:this.value!==i.value&&(this.value=i.value),i},get list(){return this.__meta&&this.__meta.list},_selfChanged:function(e){e&&(this.value=this)},byKey:function(e){return new Polymer.IronMeta({type:this.type,key:e}).value}})}();</script><script>Polymer.IronValidatableBehaviorMeta=null,Polymer.IronValidatableBehavior={properties:{validator:{type:String},invalid:{notify:!0,reflectToAttribute:!0,type:Boolean,value:!1,observer:"_invalidChanged"}},registered:function(){Polymer.IronValidatableBehaviorMeta=new Polymer.IronMeta({type:"validator"})},_invalidChanged:function(){this.invalid?this.setAttribute("aria-invalid","true"):this.removeAttribute("aria-invalid")},get _validator(){return Polymer.IronValidatableBehaviorMeta&&Polymer.IronValidatableBehaviorMeta.byKey(this.validator)},hasValidator:function(){return null!=this._validator},validate:function(i){return void 0===i&&void 0!==this.value?this.invalid=!this._getValidity(this.value):this.invalid=!this._getValidity(i),!this.invalid},_getValidity:function(i){return!this.hasValidator()||this._validator.validate(i)}};</script><script>Polymer.IronFormElementBehavior={properties:{name:{type:String},value:{notify:!0,type:String},required:{type:Boolean,value:!1},_parentForm:{type:Object}},attached:Polymer.Element?null:function(){this.fire("iron-form-element-register")},detached:Polymer.Element?null:function(){this._parentForm&&this._parentForm.fire("iron-form-element-unregister",{target:this})}};</script><script>Polymer.IronCheckedElementBehaviorImpl={properties:{checked:{type:Boolean,value:!1,reflectToAttribute:!0,notify:!0,observer:"_checkedChanged"},toggles:{type:Boolean,value:!0,reflectToAttribute:!0},value:{type:String,value:"on",observer:"_valueChanged"}},observers:["_requiredChanged(required)"],created:function(){this._hasIronCheckedElementBehavior=!0},_getValidity:function(e){return this.disabled||!this.required||this.checked},_requiredChanged:function(){this.required?this.setAttribute("aria-required","true"):this.removeAttribute("aria-required")},_checkedChanged:function(){this.active=this.checked,this.fire("iron-change")},_valueChanged:function(){void 0!==this.value&&null!==this.value||(this.value="on")}},Polymer.IronCheckedElementBehavior=[Polymer.IronFormElementBehavior,Polymer.IronValidatableBehavior,Polymer.IronCheckedElementBehaviorImpl];</script><script>!function(){"use strict";function e(e,t){var n="";if(e){var i=e.toLowerCase();" "===i||v.test(i)?n="space":f.test(i)?n="esc":1==i.length?t&&!u.test(i)||(n=i):n=h.test(i)?i.replace("arrow",""):"multiply"==i?"*":i}return n}function t(e){var t="";return e&&(e in o?t=o[e]:c.test(e)?(e=parseInt(e.replace("U+","0x"),16),t=String.fromCharCode(e).toLowerCase()):t=e.toLowerCase()),t}function n(e){var t="";return Number(e)&&(t=e>=65&&e<=90?String.fromCharCode(32+e):e>=112&&e<=123?"f"+(e-112):e>=48&&e<=57?String(e-48):e>=96&&e<=105?String(e-96):d[e]),t}function i(i,r){return i.key?e(i.key,r):i.detail&&i.detail.key?e(i.detail.key,r):t(i.keyIdentifier)||n(i.keyCode)||""}function r(e,t){return i(t,e.hasModifiers)===e.key&&(!e.hasModifiers||!!t.shiftKey==!!e.shiftKey&&!!t.ctrlKey==!!e.ctrlKey&&!!t.altKey==!!e.altKey&&!!t.metaKey==!!e.metaKey)}function s(e){return 1===e.length?{combo:e,key:e,event:"keydown"}:e.split("+").reduce(function(e,t){var n=t.split(":"),i=n[0],r=n[1];return i in y?(e[y[i]]=!0,e.hasModifiers=!0):(e.key=i,e.event=r||"keydown"),e},{combo:e.split(":").shift()})}function a(e){return e.trim().split(" ").map(function(e){return s(e)})}var o={"U+0008":"backspace","U+0009":"tab","U+001B":"esc","U+0020":"space","U+007F":"del"},d={8:"backspace",9:"tab",13:"enter",27:"esc",33:"pageup",34:"pagedown",35:"end",36:"home",32:"space",37:"left",38:"up",39:"right",40:"down",46:"del",106:"*"},y={shift:"shiftKey",ctrl:"ctrlKey",alt:"altKey",meta:"metaKey"},u=/[a-z0-9*]/,c=/U\+/,h=/^arrow/,v=/^space(bar)?/,f=/^escape$/;Polymer.IronA11yKeysBehavior={properties:{keyEventTarget:{type:Object,value:function(){return this}},stopKeyboardEventPropagation:{type:Boolean,value:!1},_boundKeyHandlers:{type:Array,value:function(){return[]}},_imperativeKeyBindings:{type:Object,value:function(){return{}}}},observers:["_resetKeyEventListeners(keyEventTarget, _boundKeyHandlers)"],keyBindings:{},registered:function(){this._prepKeyBindings()},attached:function(){this._listenKeyEventListeners()},detached:function(){this._unlistenKeyEventListeners()},addOwnKeyBinding:function(e,t){this._imperativeKeyBindings[e]=t,this._prepKeyBindings(),this._resetKeyEventListeners()},removeOwnKeyBindings:function(){this._imperativeKeyBindings={},this._prepKeyBindings(),this._resetKeyEventListeners()},keyboardEventMatchesKeys:function(e,t){for(var n=a(t),i=0;i<n.length;++i)if(r(n[i],e))return!0;return!1},_collectKeyBindings:function(){var e=this.behaviors.map(function(e){return e.keyBindings});return-1===e.indexOf(this.keyBindings)&&e.push(this.keyBindings),e},_prepKeyBindings:function(){var e=this;this._keyBindings={},this._collectKeyBindings().forEach(function(e){var t=this;for(var n in e)t._addKeyBinding(n,e[n])},this);for(var t in this._imperativeKeyBindings)e._addKeyBinding(t,e._imperativeKeyBindings[t]);for(var n in this._keyBindings)e._keyBindings[n].sort(function(e,t){var n=e[0].hasModifiers;return n===t[0].hasModifiers?0:n?-1:1})},_addKeyBinding:function(e,t){a(e).forEach(function(e){this._keyBindings[e.event]=this._keyBindings[e.event]||[],this._keyBindings[e.event].push([e,t])},this)},_resetKeyEventListeners:function(){this._unlistenKeyEventListeners(),this.isAttached&&this._listenKeyEventListeners()},_listenKeyEventListeners:function(){this.keyEventTarget&&Object.keys(this._keyBindings).forEach(function(e){var t=this._keyBindings[e],n=this._onKeyBindingEvent.bind(this,t);this._boundKeyHandlers.push([this.keyEventTarget,e,n]),this.keyEventTarget.addEventListener(e,n)},this)},_unlistenKeyEventListeners:function(){for(var e,t,n,i,r=this;this._boundKeyHandlers.length;)t=(e=r._boundKeyHandlers.pop())[0],n=e[1],i=e[2],t.removeEventListener(n,i)},_onKeyBindingEvent:function(e,t){var n=this;if(this.stopKeyboardEventPropagation&&t.stopPropagation(),!t.defaultPrevented)for(var i=0;i<e.length;i++){var s=e[i][0],a=e[i][1];if(r(s,t)&&(n._triggerKeyHandler(s,a,t),t.defaultPrevented))return}},_triggerKeyHandler:function(e,t,n){var i=Object.create(e);i.keyboardEvent=n;var r=new CustomEvent(e.event,{detail:i,cancelable:!0});this[t].call(this,r),r.defaultPrevented&&n.preventDefault()}}}();</script><script>Polymer.IronControlState={properties:{focused:{type:Boolean,value:!1,notify:!0,readOnly:!0,reflectToAttribute:!0},disabled:{type:Boolean,value:!1,notify:!0,observer:"_disabledChanged",reflectToAttribute:!0},_oldTabIndex:{type:Number},_boundFocusBlurHandler:{type:Function,value:function(){return this._focusBlurHandler.bind(this)}},__handleEventRetargeting:{type:Boolean,value:function(){return!this.shadowRoot&&!Polymer.Element}}},observers:["_changedControlState(focused, disabled)"],ready:function(){this.addEventListener("focus",this._boundFocusBlurHandler,!0),this.addEventListener("blur",this._boundFocusBlurHandler,!0)},_focusBlurHandler:function(e){if(Polymer.Element)this._setFocused("focus"===e.type);else if(e.target===this)this._setFocused("focus"===e.type);else if(this.__handleEventRetargeting){var t=Polymer.dom(e).localTarget;this.isLightDescendant(t)||this.fire(e.type,{sourceEvent:e},{node:this,bubbles:e.bubbles,cancelable:e.cancelable})}},_disabledChanged:function(e,t){this.setAttribute("aria-disabled",e?"true":"false"),this.style.pointerEvents=e?"none":"",e?(this._oldTabIndex=this.tabIndex,this._setFocused(!1),this.tabIndex=-1,this.blur()):void 0!==this._oldTabIndex&&(this.tabIndex=this._oldTabIndex)},_changedControlState:function(){this._controlStateChanged&&this._controlStateChanged()}};</script><script>Polymer.IronButtonStateImpl={properties:{pressed:{type:Boolean,readOnly:!0,value:!1,reflectToAttribute:!0,observer:"_pressedChanged"},toggles:{type:Boolean,value:!1,reflectToAttribute:!0},active:{type:Boolean,value:!1,notify:!0,reflectToAttribute:!0},pointerDown:{type:Boolean,readOnly:!0,value:!1},receivedFocusFromKeyboard:{type:Boolean,readOnly:!0},ariaActiveAttribute:{type:String,value:"aria-pressed",observer:"_ariaActiveAttributeChanged"}},listeners:{down:"_downHandler",up:"_upHandler",tap:"_tapHandler"},observers:["_focusChanged(focused)","_activeChanged(active, ariaActiveAttribute)"],keyBindings:{"enter:keydown":"_asyncClick","space:keydown":"_spaceKeyDownHandler","space:keyup":"_spaceKeyUpHandler"},_mouseEventRe:/^mouse/,_tapHandler:function(){this.toggles?this._userActivate(!this.active):this.active=!1},_focusChanged:function(e){this._detectKeyboardFocus(e),e||this._setPressed(!1)},_detectKeyboardFocus:function(e){this._setReceivedFocusFromKeyboard(!this.pointerDown&&e)},_userActivate:function(e){this.active!==e&&(this.active=e,this.fire("change"))},_downHandler:function(e){this._setPointerDown(!0),this._setPressed(!0),this._setReceivedFocusFromKeyboard(!1)},_upHandler:function(){this._setPointerDown(!1),this._setPressed(!1)},_spaceKeyDownHandler:function(e){var t=e.detail.keyboardEvent,i=Polymer.dom(t).localTarget;this.isLightDescendant(i)||(t.preventDefault(),t.stopImmediatePropagation(),this._setPressed(!0))},_spaceKeyUpHandler:function(e){var t=e.detail.keyboardEvent,i=Polymer.dom(t).localTarget;this.isLightDescendant(i)||(this.pressed&&this._asyncClick(),this._setPressed(!1))},_asyncClick:function(){this.async(function(){this.click()},1)},_pressedChanged:function(e){this._changedButtonState()},_ariaActiveAttributeChanged:function(e,t){t&&t!=e&&this.hasAttribute(t)&&this.removeAttribute(t)},_activeChanged:function(e,t){this.toggles?this.setAttribute(this.ariaActiveAttribute,e?"true":"false"):this.removeAttribute(this.ariaActiveAttribute),this._changedButtonState()},_controlStateChanged:function(){this.disabled?this._setPressed(!1):this._changedButtonState()},_changedButtonState:function(){this._buttonStateChanged&&this._buttonStateChanged()}},Polymer.IronButtonState=[Polymer.IronA11yKeysBehavior,Polymer.IronButtonStateImpl];</script><dom-module id="paper-ripple" assetpath="../bower_components/paper-ripple/"><template><style>:host{display:block;position:absolute;border-radius:inherit;overflow:hidden;top:0;left:0;right:0;bottom:0;pointer-events:none;}:host([animating]){-webkit-transform:translate(0, 0);transform:translate3d(0, 0, 0);}#background,
+      .fixed-top{position:fixed;}.fixed-top{top:0;left:0;right:0;}.fixed-right{top:0;right:0;bottom:0;}.fixed-bottom{right:0;bottom:0;left:0;}.fixed-left{top:0;bottom:0;left:0;}</style></template></dom-module><script>!function(t,e){var i={},n={},r={};!function(t,e){function i(){this._delay=0,this._endDelay=0,this._fill="none",this._iterationStart=0,this._iterations=1,this._duration=0,this._playbackRate=1,this._direction="normal",this._easing="linear",this._easingFunction=v}function n(){return t.isDeprecated("Invalid timing inputs","2016-03-02","TypeError exceptions will be thrown instead.",!0)}function r(e,n,r){var a=new i;return n&&(a.fill="both",a.duration="auto"),"number"!=typeof e||isNaN(e)?void 0!==e&&Object.getOwnPropertyNames(e).forEach(function(i){if("auto"!=e[i]){if(("number"==typeof a[i]||"duration"==i)&&("number"!=typeof e[i]||isNaN(e[i])))return;if("fill"==i&&-1==_.indexOf(e[i]))return;if("direction"==i&&-1==g.indexOf(e[i]))return;if("playbackRate"==i&&1!==e[i]&&t.isDeprecated("AnimationEffectTiming.playbackRate","2014-11-28","Use Animation.playbackRate instead."))return;a[i]=e[i]}}):a.duration=e,a}function a(t,e,i,n){return t<0||t>1||i<0||i>1?v:function(r){function a(t,e,i){return 3*t*(1-i)*(1-i)*i+3*e*(1-i)*i*i+i*i*i}if(r<=0){var o=0;return t>0?o=e/t:!e&&i>0&&(o=n/i),o*r}if(r>=1){var s=0;return i<1?s=(n-1)/(i-1):1==i&&t<1&&(s=(e-1)/(t-1)),1+s*(r-1)}for(var u=0,c=1;u<c;){var f=(u+c)/2,l=a(t,i,f);if(Math.abs(r-l)<1e-5)return a(e,n,f);l<r?u=f:c=f}return a(e,n,f)}}function o(t,e){return function(i){if(i>=1)return 1;var n=1/t;return(i+=e*n)-i%n}}function s(t){x||(x=document.createElement("div").style),x.animationTimingFunction="",x.animationTimingFunction=t;var e=x.animationTimingFunction;if(""==e&&n())throw new TypeError(t+" is not a valid value for easing");return e}function u(t){if("linear"==t)return v;var e=A.exec(t);if(e)return a.apply(this,e.slice(1).map(Number));var i=P.exec(t);return i?o(Number(i[1]),{start:y,middle:b,end:T}[i[2]]):w[t]||v}function c(t){return 0===t.duration||0===t.iterations?0:t.duration*t.iterations}function f(t,e,i){if(null==e)return R;var n=i.delay+t+i.endDelay;return e<Math.min(i.delay,n)?k:e>=Math.min(i.delay+t,n)?N:S}function l(t,e,i,n,r){switch(n){case k:return"backwards"==e||"both"==e?0:null;case S:return i-r;case N:return"forwards"==e||"both"==e?t:null;case R:return null}}function h(t,e,i,n,r){var a=r;return 0===t?e!==k&&(a+=i):a+=n/t,a}function m(t,e,i,n,r,a){var o=t===1/0?e%1:t%1;return 0!==o||i!==N||0===n||0===r&&0!==a||(o=1),o}function d(t,e,i,n){return t===N&&e===1/0?1/0:1===i?Math.floor(n)-1:Math.floor(n)}function p(t,e,i){var n=t;if("normal"!==t&&"reverse"!==t){var r=e;"alternate-reverse"===t&&(r+=1),n="normal",r!==1/0&&r%2!=0&&(n="reverse")}return"normal"===n?i:1-i}var _="backwards|forwards|both|none".split("|"),g="reverse|alternate|alternate-reverse".split("|"),v=function(t){return t};i.prototype={_setMember:function(e,i){this["_"+e]=i,this._effect&&(this._effect._timingInput[e]=i,this._effect._timing=t.normalizeTimingInput(this._effect._timingInput),this._effect.activeDuration=t.calculateActiveDuration(this._effect._timing),this._effect._animation&&this._effect._animation._rebuildUnderlyingAnimation())},get playbackRate(){return this._playbackRate},set delay(t){this._setMember("delay",t)},get delay(){return this._delay},set endDelay(t){this._setMember("endDelay",t)},get endDelay(){return this._endDelay},set fill(t){this._setMember("fill",t)},get fill(){return this._fill},set iterationStart(t){if((isNaN(t)||t<0)&&n())throw new TypeError("iterationStart must be a non-negative number, received: "+timing.iterationStart);this._setMember("iterationStart",t)},get iterationStart(){return this._iterationStart},set duration(t){if("auto"!=t&&(isNaN(t)||t<0)&&n())throw new TypeError("duration must be non-negative or auto, received: "+t);this._setMember("duration",t)},get duration(){return this._duration},set direction(t){this._setMember("direction",t)},get direction(){return this._direction},set easing(t){this._easingFunction=u(s(t)),this._setMember("easing",t)},get easing(){return this._easing},set iterations(t){if((isNaN(t)||t<0)&&n())throw new TypeError("iterations must be non-negative, received: "+t);this._setMember("iterations",t)},get iterations(){return this._iterations}};var y=1,b=.5,T=0,w={ease:a(.25,.1,.25,1),"ease-in":a(.42,0,1,1),"ease-out":a(0,0,.58,1),"ease-in-out":a(.42,0,.58,1),"step-start":o(1,y),"step-middle":o(1,b),"step-end":o(1,T)},x=null,E="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",A=new RegExp("cubic-bezier\\("+E+","+E+","+E+","+E+"\\)"),P=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/,R=0,k=1,N=2,S=3;t.cloneTimingInput=function(t){if("number"==typeof t)return t;var e={};for(var i in t)e[i]=t[i];return e},t.makeTiming=r,t.numericTimingToObject=function(t){return"number"==typeof t&&(t=isNaN(t)?{duration:0}:{duration:t}),t},t.normalizeTimingInput=function(e,i){return e=t.numericTimingToObject(e),r(e,i)},t.calculateActiveDuration=function(t){return Math.abs(c(t)/t.playbackRate)},t.calculateIterationProgress=function(t,e,i){var n=f(t,e,i),r=l(t,i.fill,e,n,i.delay);if(null===r)return null;var a=h(i.duration,n,i.iterations,r,i.iterationStart),o=m(a,i.iterationStart,n,i.iterations,r,i.duration),s=d(n,i.iterations,o,a),u=p(i.direction,s,o);return i._easingFunction(u)},t.calculatePhase=f,t.normalizeEasing=s,t.parseEasingFunction=u}(i),function(t,e){function i(t,e){return t in c?c[t][e]||e:e}function n(t){return"display"===t||0===t.lastIndexOf("animation",0)||0===t.lastIndexOf("transition",0)}function r(t,e,r){if(!n(t)){var a=o[t];if(a){s.style[t]=e;for(var u in a){var c=a[u],f=s.style[c];r[c]=i(c,f)}}else r[t]=i(t,e)}}function a(t){var e=[];for(var i in t)if(!(i in["easing","offset","composite"])){var n=t[i];Array.isArray(n)||(n=[n]);for(var r,a=n.length,o=0;o<a;o++)(r={}).offset="offset"in t?t.offset:1==a?1:o/(a-1),"easing"in t&&(r.easing=t.easing),"composite"in t&&(r.composite=t.composite),r[i]=n[o],e.push(r)}return e.sort(function(t,e){return t.offset-e.offset}),e}var o={background:["backgroundImage","backgroundPosition","backgroundSize","backgroundRepeat","backgroundAttachment","backgroundOrigin","backgroundClip","backgroundColor"],border:["borderTopColor","borderTopStyle","borderTopWidth","borderRightColor","borderRightStyle","borderRightWidth","borderBottomColor","borderBottomStyle","borderBottomWidth","borderLeftColor","borderLeftStyle","borderLeftWidth"],borderBottom:["borderBottomWidth","borderBottomStyle","borderBottomColor"],borderColor:["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"],borderLeft:["borderLeftWidth","borderLeftStyle","borderLeftColor"],borderRadius:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],borderRight:["borderRightWidth","borderRightStyle","borderRightColor"],borderTop:["borderTopWidth","borderTopStyle","borderTopColor"],borderWidth:["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],flex:["flexGrow","flexShrink","flexBasis"],font:["fontFamily","fontSize","fontStyle","fontVariant","fontWeight","lineHeight"],margin:["marginTop","marginRight","marginBottom","marginLeft"],outline:["outlineColor","outlineStyle","outlineWidth"],padding:["paddingTop","paddingRight","paddingBottom","paddingLeft"]},s=document.createElementNS("http://www.w3.org/1999/xhtml","div"),u={thin:"1px",medium:"3px",thick:"5px"},c={borderBottomWidth:u,borderLeftWidth:u,borderRightWidth:u,borderTopWidth:u,fontSize:{"xx-small":"60%","x-small":"75%",small:"89%",medium:"100%",large:"120%","x-large":"150%","xx-large":"200%"},fontWeight:{normal:"400",bold:"700"},outlineWidth:u,textShadow:{none:"0px 0px 0px transparent"},boxShadow:{none:"0px 0px 0px 0px transparent"}};t.convertToArrayForm=a,t.normalizeKeyframes=function(e){if(null==e)return[];window.Symbol&&Symbol.iterator&&Array.prototype.from&&e[Symbol.iterator]&&(e=Array.from(e)),Array.isArray(e)||(e=a(e));for(var i=e.map(function(e){var i={};for(var n in e){var a=e[n];if("offset"==n){if(null!=a){if(a=Number(a),!isFinite(a))throw new TypeError("Keyframe offsets must be numbers.");if(a<0||a>1)throw new TypeError("Keyframe offsets must be between 0 and 1.")}}else if("composite"==n){if("add"==a||"accumulate"==a)throw{type:DOMException.NOT_SUPPORTED_ERR,name:"NotSupportedError",message:"add compositing is not supported"};if("replace"!=a)throw new TypeError("Invalid composite mode "+a+".")}else a="easing"==n?t.normalizeEasing(a):""+a;r(n,a,i)}return void 0==i.offset&&(i.offset=null),void 0==i.easing&&(i.easing="linear"),i}),n=!0,o=-1/0,s=0;s<i.length;s++){var u=i[s].offset;if(null!=u){if(u<o)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");o=u}else n=!1}return i=i.filter(function(t){return t.offset>=0&&t.offset<=1}),n||function(){var t=i.length;null==i[t-1].offset&&(i[t-1].offset=1),t>1&&null==i[0].offset&&(i[0].offset=0);for(var e=0,n=i[0].offset,r=1;r<t;r++){var a=i[r].offset;if(null!=a){for(var o=1;o<r-e;o++)i[e+o].offset=n+(a-n)*o/(r-e);e=r,n=a}}}(),i}}(i),function(t){var e={};t.isDeprecated=function(t,i,n,r){var a=r?"are":"is",o=new Date,s=new Date(i);return s.setMonth(s.getMonth()+3),!(o<s&&(t in e||console.warn("Web Animations: "+t+" "+a+" deprecated and will stop working on "+s.toDateString()+". "+n),e[t]=!0,1))},t.deprecated=function(e,i,n,r){var a=r?"are":"is";if(t.isDeprecated(e,i,n,r))throw new Error(e+" "+a+" no longer supported. "+n)}}(i),function(){if(document.documentElement.animate){var t=document.documentElement.animate([],0),e=!0;if(t&&(e=!1,"play|currentTime|pause|reverse|playbackRate|cancel|finish|startTime|playState".split("|").forEach(function(i){void 0===t[i]&&(e=!0)})),!e)return}!function(t,e,i){function n(t){for(var e={},i=0;i<t.length;i++)for(var n in t[i])if("offset"!=n&&"easing"!=n&&"composite"!=n){var r={offset:t[i].offset,easing:t[i].easing,value:t[i][n]};e[n]=e[n]||[],e[n].push(r)}for(var a in e){var o=e[a];if(0!=o[0].offset||1!=o[o.length-1].offset)throw{type:DOMException.NOT_SUPPORTED_ERR,name:"NotSupportedError",message:"Partial keyframes are not supported"}}return e}function r(i){var n=[];for(var r in i)for(var a=i[r],o=0;o<a.length-1;o++){var s=o,u=o+1,c=a[s].offset,f=a[u].offset,l=c,h=f;0==o&&(l=-1/0,0==f&&(u=s)),o==a.length-2&&(h=1/0,1==c&&(s=u)),n.push({applyFrom:l,applyTo:h,startOffset:a[s].offset,endOffset:a[u].offset,easingFunction:t.parseEasingFunction(a[s].easing),property:r,interpolation:e.propertyInterpolation(r,a[s].value,a[u].value)})}return n.sort(function(t,e){return t.startOffset-e.startOffset}),n}e.convertEffectInput=function(i){var a=n(t.normalizeKeyframes(i)),o=r(a);return function(t,i){if(null!=i)o.filter(function(t){return i>=t.applyFrom&&i<t.applyTo}).forEach(function(n){var r=i-n.startOffset,a=n.endOffset-n.startOffset,o=0==a?0:n.easingFunction(r/a);e.apply(t,n.property,n.interpolation(o))});else for(var n in a)"offset"!=n&&"easing"!=n&&"composite"!=n&&e.clear(t,n)}}}(i,n),function(t,e,i){function n(t){return t.replace(/-(.)/g,function(t,e){return e.toUpperCase()})}function r(t,e,i){a[i]=a[i]||[],a[i].push([t,e])}var a={};e.addPropertiesHandler=function(t,e,i){for(var a=0;a<i.length;a++)r(t,e,n(i[a]))};var o={backgroundColor:"transparent",backgroundPosition:"0% 0%",borderBottomColor:"currentColor",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",borderBottomWidth:"3px",borderLeftColor:"currentColor",borderLeftWidth:"3px",borderRightColor:"currentColor",borderRightWidth:"3px",borderSpacing:"2px",borderTopColor:"currentColor",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderTopWidth:"3px",bottom:"auto",clip:"rect(0px, 0px, 0px, 0px)",color:"black",fontSize:"100%",fontWeight:"400",height:"auto",left:"auto",letterSpacing:"normal",lineHeight:"120%",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",marginTop:"0px",maxHeight:"none",maxWidth:"none",minHeight:"0px",minWidth:"0px",opacity:"1.0",outlineColor:"invert",outlineOffset:"0px",outlineWidth:"3px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",paddingTop:"0px",right:"auto",strokeDasharray:"none",strokeDashoffset:"0px",textIndent:"0px",textShadow:"0px 0px 0px transparent",top:"auto",transform:"",verticalAlign:"0px",visibility:"visible",width:"auto",wordSpacing:"normal",zIndex:"auto"};e.propertyInterpolation=function(i,r,s){var u=i;/-/.test(i)&&!t.isDeprecated("Hyphenated property names","2016-03-22","Use camelCase instead.",!0)&&(u=n(i)),"initial"!=r&&"initial"!=s||("initial"==r&&(r=o[u]),"initial"==s&&(s=o[u]));for(var c=r==s?[]:a[u],f=0;c&&f<c.length;f++){var l=c[f][0](r),h=c[f][0](s);if(void 0!==l&&void 0!==h){var m=c[f][1](l,h);if(m){var d=e.Interpolation.apply(null,m);return function(t){return 0==t?r:1==t?s:d(t)}}}}return e.Interpolation(!1,!0,function(t){return t?s:r})}}(i,n),function(t,e,i){function n(e){var i=t.calculateActiveDuration(e),n=function(n){return t.calculateIterationProgress(i,n,e)};return n._totalDuration=e.delay+i+e.endDelay,n}e.KeyframeEffect=function(i,r,a,o){var s,u=n(t.normalizeTimingInput(a)),c=e.convertEffectInput(r),f=function(){c(i,s)};return f._update=function(t){return null!==(s=u(t))},f._clear=function(){c(i,null)},f._hasSameTarget=function(t){return i===t},f._target=i,f._totalDuration=u._totalDuration,f._id=o,f}}(i,n),function(t,e){t.apply=function(e,i,n){e.style[t.propertyName(i)]=n},t.clear=function(e,i){e.style[t.propertyName(i)]=""}}(n),function(t){window.Element.prototype.animate=function(e,i){var n="";return i&&i.id&&(n=i.id),t.timeline._play(t.KeyframeEffect(this,e,i,n))}}(n),function(t,e){function i(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e)return n<.5?t:e;if(t.length==e.length){for(var r=[],a=0;a<t.length;a++)r.push(i(t[a],e[a],n));return r}throw"Mismatched interpolation arguments "+t+":"+e}n.Interpolation=function(t,e,n){return function(r){return n(i(t,e,r))}}}(),function(t,e,i){t.sequenceNumber=0;var n=function(t,e,i){this.target=t,this.currentTime=e,this.timelineTime=i,this.type="finish",this.bubbles=!1,this.cancelable=!1,this.currentTarget=t,this.defaultPrevented=!1,this.eventPhase=Event.AT_TARGET,this.timeStamp=Date.now()};e.Animation=function(e){this.id="",e&&e._id&&(this.id=e._id),this._sequenceNumber=t.sequenceNumber++,this._currentTime=0,this._startTime=null,this._paused=!1,this._playbackRate=1,this._inTimeline=!0,this._finishedFlag=!0,this.onfinish=null,this._finishHandlers=[],this._effect=e,this._inEffect=this._effect._update(0),this._idle=!0,this._currentTimePending=!1},e.Animation.prototype={_ensureAlive:function(){this.playbackRate<0&&0===this.currentTime?this._inEffect=this._effect._update(-1):this._inEffect=this._effect._update(this.currentTime),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,e.timeline._animations.push(this))},_tickCurrentTime:function(t,e){t!=this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this._ensureAlive())},get currentTime(){return this._idle||this._currentTimePending?null:this._currentTime},set currentTime(t){t=+t,isNaN(t)||(e.restart(),this._paused||null==this._startTime||(this._startTime=this._timeline.currentTime-t/this._playbackRate),this._currentTimePending=!1,this._currentTime!=t&&(this._idle&&(this._idle=!1,this._paused=!0),this._tickCurrentTime(t,!0),e.applyDirtiedAnimation(this)))},get startTime(){return this._startTime},set startTime(t){t=+t,isNaN(t)||this._paused||this._idle||(this._startTime=t,this._tickCurrentTime((this._timeline.currentTime-this._startTime)*this.playbackRate),e.applyDirtiedAnimation(this))},get playbackRate(){return this._playbackRate},set playbackRate(t){if(t!=this._playbackRate){var i=this.currentTime;this._playbackRate=t,this._startTime=null,"paused"!=this.playState&&"idle"!=this.playState&&(this._finishedFlag=!1,this._idle=!1,this._ensureAlive(),e.applyDirtiedAnimation(this)),null!=i&&(this.currentTime=i)}},get _isFinished(){return!this._idle&&(this._playbackRate>0&&this._currentTime>=this._totalDuration||this._playbackRate<0&&this._currentTime<=0)},get _totalDuration(){return this._effect._totalDuration},get playState(){return this._idle?"idle":null==this._startTime&&!this._paused&&0!=this.playbackRate||this._currentTimePending?"pending":this._paused?"paused":this._isFinished?"finished":"running"},_rewind:function(){if(this._playbackRate>=0)this._currentTime=0;else{if(!(this._totalDuration<1/0))throw new DOMException("Unable to rewind negative playback rate animation with infinite duration","InvalidStateError");this._currentTime=this._totalDuration}},play:function(){this._paused=!1,(this._isFinished||this._idle)&&(this._rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this._ensureAlive(),e.applyDirtiedAnimation(this)},pause:function(){this._isFinished||this._paused||this._idle?this._idle&&(this._rewind(),this._idle=!1):this._currentTimePending=!0,this._startTime=null,this._paused=!0},finish:function(){this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this._currentTimePending=!1,e.applyDirtiedAnimation(this))},cancel:function(){this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._isFinished=!0,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this._effect._update(null),e.applyDirtiedAnimation(this))},reverse:function(){this.playbackRate*=-1,this.play()},addEventListener:function(t,e){"function"==typeof e&&"finish"==t&&this._finishHandlers.push(e)},removeEventListener:function(t,e){if("finish"==t){var i=this._finishHandlers.indexOf(e);i>=0&&this._finishHandlers.splice(i,1)}},_fireEvents:function(t){if(this._isFinished){if(!this._finishedFlag){var e=new n(this,this._currentTime,t),i=this._finishHandlers.concat(this.onfinish?[this.onfinish]:[]);setTimeout(function(){i.forEach(function(t){t.call(e.target,e)})},0),this._finishedFlag=!0}}else this._finishedFlag=!1},_tick:function(t,e){this._idle||this._paused||(null==this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this._tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this._currentTimePending=!1,this._fireEvents(t))},get _needsTick(){return this.playState in{pending:1,running:1}||!this._finishedFlag},_targetAnimations:function(){var t=this._effect._target;return t._activeAnimations||(t._activeAnimations=[]),t._activeAnimations},_markTarget:function(){var t=this._targetAnimations();-1===t.indexOf(this)&&t.push(this)},_unmarkTarget:function(){var t=this._targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)}}}(i,n),function(t,e,i){function n(t){var e=c;c=[],t<_.currentTime&&(t=_.currentTime),_._animations.sort(r),_._animations=s(t,!0,_._animations)[0],e.forEach(function(e){e[1](t)}),o(),l=void 0}function r(t,e){return t._sequenceNumber-e._sequenceNumber}function a(){this._animations=[],this.currentTime=window.performance&&performance.now?performance.now():0}function o(){d.forEach(function(t){t()}),d.length=0}function s(t,i,n){p=!0,m=!1,e.timeline.currentTime=t,h=!1;var r=[],a=[],o=[],s=[];return n.forEach(function(e){e._tick(t,i),e._inEffect?(a.push(e._effect),e._markTarget()):(r.push(e._effect),e._unmarkTarget()),e._needsTick&&(h=!0);var n=e._inEffect||e._needsTick;e._inTimeline=n,n?o.push(e):s.push(e)}),d.push.apply(d,r),d.push.apply(d,a),h&&requestAnimationFrame(function(){}),p=!1,[o,s]}var u=window.requestAnimationFrame,c=[],f=0;window.requestAnimationFrame=function(t){var e=f++;return 0==c.length&&u(n),c.push([e,t]),e},window.cancelAnimationFrame=function(t){c.forEach(function(e){e[0]==t&&(e[1]=function(){})})},a.prototype={_play:function(i){i._timing=t.normalizeTimingInput(i.timing);var n=new e.Animation(i);return n._idle=!1,n._timeline=this,this._animations.push(n),e.restart(),e.applyDirtiedAnimation(n),n}};var l=void 0,h=!1,m=!1;e.restart=function(){return h||(h=!0,requestAnimationFrame(function(){}),m=!0),m},e.applyDirtiedAnimation=function(t){if(!p){t._markTarget();var i=t._targetAnimations();i.sort(r),s(e.timeline.currentTime,!1,i.slice())[1].forEach(function(t){var e=_._animations.indexOf(t);-1!==e&&_._animations.splice(e,1)}),o()}};var d=[],p=!1,_=new a;e.timeline=_}(i,n),function(t){function e(t,e){var i=t.exec(e);if(i)return i=t.ignoreCase?i[0].toLowerCase():i[0],[i,e.substr(i.length)]}function i(t,e){var i=t(e=e.replace(/^\s*/,""));if(i)return[i[0],i[1].replace(/^\s*/,"")]}function n(t,e){for(var i=t,n=e;i&&n;)i>n?i%=n:n%=i;return i=t*e/(i+n)}function r(t,e,i,r,a){for(var o=[],s=[],u=[],c=n(r.length,a.length),f=0;f<c;f++){var l=e(r[f%r.length],a[f%a.length]);if(!l)return;o.push(l[0]),s.push(l[1]),u.push(l[2])}return[o,s,function(e){var n=e.map(function(t,e){return u[e](t)}).join(i);return t?t(n):n}]}t.consumeToken=e,t.consumeTrimmed=i,t.consumeRepeated=function(t,n,r){t=i.bind(null,t);for(var a=[];;){var o=t(r);if(!o)return[a,r];if(a.push(o[0]),r=o[1],!(o=e(n,r))||""==o[1])return[a,r];r=o[1]}},t.consumeParenthesised=function(t,e){for(var i=0,n=0;n<e.length&&(!/\s|,/.test(e[n])||0!=i);n++)if("("==e[n])i++;else if(")"==e[n]&&(0==--i&&n++,i<=0))break;var r=t(e.substr(0,n));return void 0==r?void 0:[r,e.substr(n)]},t.ignore=function(t){return function(e){var i=t(e);return i&&(i[0]=void 0),i}},t.optional=function(t,e){return function(i){return t(i)||[e,i]}},t.consumeList=function(e,i){for(var n=[],r=0;r<e.length;r++){var a=t.consumeTrimmed(e[r],i);if(!a||""==a[0])return;void 0!==a[0]&&n.push(a[0]),i=a[1]}if(""==i)return n},t.mergeNestedRepeated=r.bind(null,null),t.mergeWrappedNestedRepeated=r,t.mergeList=function(t,e,i){for(var n=[],r=[],a=[],o=0,s=0;s<i.length;s++)if("function"==typeof i[s]){var u=i[s](t[o],e[o++]);n.push(u[0]),r.push(u[1]),a.push(u[2])}else!function(t){n.push(!1),r.push(!1),a.push(function(){return i[t]})}(s);return[n,r,function(t){for(var e="",i=0;i<t.length;i++)e+=a[i](t[i]);return e}]}}(n),function(t){function e(e){var i={inset:!1,lengths:[],color:null},n=t.consumeRepeated(function(e){var n=t.consumeToken(/^inset/i,e);return n?(i.inset=!0,n):(n=t.consumeLengthOrPercent(e))?(i.lengths.push(n[0]),n):(n=t.consumeColor(e))?(i.color=n[0],n):void 0},/^/,e);if(n&&n[0].length)return[i,n[1]]}var i=function(e,i,n,r){function a(t){return{inset:t,color:[0,0,0,0],lengths:[{px:0},{px:0},{px:0},{px:0}]}}for(var o=[],s=[],u=0;u<n.length||u<r.length;u++){var c=n[u]||a(r[u].inset),f=r[u]||a(n[u].inset);o.push(c),s.push(f)}return t.mergeNestedRepeated(e,i,o,s)}.bind(null,function(e,i){for(;e.lengths.length<Math.max(e.lengths.length,i.lengths.length);)e.lengths.push({px:0});for(;i.lengths.length<Math.max(e.lengths.length,i.lengths.length);)i.lengths.push({px:0});if(e.inset==i.inset&&!!e.color==!!i.color){for(var n,r=[],a=[[],0],o=[[],0],s=0;s<e.lengths.length;s++){var u=t.mergeDimensions(e.lengths[s],i.lengths[s],2==s);a[0].push(u[0]),o[0].push(u[1]),r.push(u[2])}if(e.color&&i.color){var c=t.mergeColors(e.color,i.color);a[1]=c[0],o[1]=c[1],n=c[2]}return[a,o,function(t){for(var i=e.inset?"inset ":" ",a=0;a<r.length;a++)i+=r[a](t[0][a])+" ";return n&&(i+=n(t[1])),i}]}},", ");t.addPropertiesHandler(function(i){var n=t.consumeRepeated(e,/^,/,i);if(n&&""==n[1])return n[0]},i,["box-shadow","text-shadow"])}(n),function(t,e){function i(t){return t.toFixed(3).replace(/0+$/,"").replace(/\.$/,"")}function n(t,e,i){return Math.min(e,Math.max(t,i))}function r(t){if(/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t))return Number(t)}function a(t,e){return function(r,a){return[r,a,function(r){return i(n(t,e,r))}]}}function o(t){var e=t.trim().split(/\s*[\s,]\s*/);if(0!==e.length){for(var i=[],n=0;n<e.length;n++){var a=r(e[n]);if(void 0===a)return;i.push(a)}return i}}t.clamp=n,t.addPropertiesHandler(o,function(t,e){if(t.length==e.length)return[t,e,function(t){return t.map(i).join(" ")}]},["stroke-dasharray"]),t.addPropertiesHandler(r,a(0,1/0),["border-image-width","line-height"]),t.addPropertiesHandler(r,a(0,1),["opacity","shape-image-threshold"]),t.addPropertiesHandler(r,function(t,e){if(0!=t)return a(0,1/0)(t,e)},["flex-grow","flex-shrink"]),t.addPropertiesHandler(r,function(t,e){return[t,e,function(t){return Math.round(n(1,1/0,t))}]},["orphans","widows"]),t.addPropertiesHandler(r,function(t,e){return[t,e,Math.round]},["z-index"]),t.parseNumber=r,t.parseNumberList=o,t.mergeNumbers=function(t,e){return[t,e,i]},t.numberToString=i}(n),function(t,e){n.addPropertiesHandler(String,function(t,e){if("visible"==t||"visible"==e)return[0,1,function(i){return i<=0?t:i>=1?e:"visible"}]},["visibility"])}(),function(t,e){function i(t){t=t.trim(),a.fillStyle="#000",a.fillStyle=t;var e=a.fillStyle;if(a.fillStyle="#fff",a.fillStyle=t,e==a.fillStyle){a.fillRect(0,0,1,1);var i=a.getImageData(0,0,1,1).data;a.clearRect(0,0,1,1);var n=i[3]/255;return[i[0]*n,i[1]*n,i[2]*n,n]}}function n(e,i){return[e,i,function(e){if(e[3])for(var i=0;i<3;i++)e[i]=Math.round(function(t){return Math.max(0,Math.min(255,t))}(e[i]/e[3]));return e[3]=t.numberToString(t.clamp(0,1,e[3])),"rgba("+e.join(",")+")"}]}var r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");r.width=r.height=1;var a=r.getContext("2d");t.addPropertiesHandler(i,n,["background-color","border-bottom-color","border-left-color","border-right-color","border-top-color","color","fill","flood-color","lighting-color","outline-color","stop-color","stroke","text-decoration-color"]),t.consumeColor=t.consumeParenthesised.bind(null,i),t.mergeColors=n}(n),function(t,e){function i(t){function e(){var e=s.exec(t);o=e?e[0]:void 0}function i(){var t=Number(o);return e(),t}function n(){if("("!==o)return i();e();var t=a();return")"!==o?NaN:(e(),t)}function r(){for(var t=n();"*"===o||"/"===o;){var i=o;e();var r=n();"*"===i?t*=r:t/=r}return t}function a(){for(var t=r();"+"===o||"-"===o;){var i=o;e();var n=r();"+"===i?t+=n:t-=n}return t}var o,s=/([\+\-\w\.]+|[\(\)\*\/])/g;return e(),a()}function n(t,e){if("0"==(e=e.trim().toLowerCase())&&"px".search(t)>=0)return{px:0};if(/^[^(]*$|^calc/.test(e)){var n={};e=(e=e.replace(/calc\(/g,"(")).replace(t,function(t){return n[t]=null,"U"+t});for(var r="U("+t.source+")",a=e.replace(/[-+]?(\d*\.)?\d+([Ee][-+]?\d+)?/g,"N").replace(new RegExp("N"+r,"g"),"D").replace(/\s[+-]\s/g,"O").replace(/\s/g,""),o=[/N\*(D)/g,/(N|D)[*\/]N/g,/(N|D)O\1/g,/\((N|D)\)/g],s=0;s<o.length;)o[s].test(a)?(a=a.replace(o[s],"$1"),s=0):s++;if("D"==a){for(var u in n){var c=i(e.replace(new RegExp("U"+u,"g"),"").replace(new RegExp(r,"g"),"*0"));if(!isFinite(c))return;n[u]=c}return n}}}function r(t,e){return a(t,e,!0)}function a(e,i,n){var r,a=[];for(r in e)a.push(r);for(r in i)a.indexOf(r)<0&&a.push(r);return e=a.map(function(t){return e[t]||0}),i=a.map(function(t){return i[t]||0}),[e,i,function(e){var i=e.map(function(i,r){return 1==e.length&&n&&(i=Math.max(i,0)),t.numberToString(i)+a[r]}).join(" + ");return e.length>1?"calc("+i+")":i}]}var o="px|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc",s=n.bind(null,new RegExp(o,"g")),u=n.bind(null,new RegExp(o+"|%","g")),c=n.bind(null,/deg|rad|grad|turn/g);t.parseLength=s,t.parseLengthOrPercent=u,t.consumeLengthOrPercent=t.consumeParenthesised.bind(null,u),t.parseAngle=c,t.mergeDimensions=a;var f=t.consumeParenthesised.bind(null,s),l=t.consumeRepeated.bind(void 0,f,/^/),h=t.consumeRepeated.bind(void 0,l,/^,/);t.consumeSizePairList=h;var m=t.mergeNestedRepeated.bind(void 0,r," "),d=t.mergeNestedRepeated.bind(void 0,m,",");t.mergeNonNegativeSizePair=m,t.addPropertiesHandler(function(t){var e=h(t);if(e&&""==e[1])return e[0]},d,["background-size"]),t.addPropertiesHandler(u,r,["border-bottom-width","border-image-width","border-left-width","border-right-width","border-top-width","flex-basis","font-size","height","line-height","max-height","max-width","outline-width","width"]),t.addPropertiesHandler(u,a,["border-bottom-left-radius","border-bottom-right-radius","border-top-left-radius","border-top-right-radius","bottom","left","letter-spacing","margin-bottom","margin-left","margin-right","margin-top","min-height","min-width","outline-offset","padding-bottom","padding-left","padding-right","padding-top","perspective","right","shape-margin","stroke-dashoffset","text-indent","top","vertical-align","word-spacing"])}(n),function(t,e){function i(e){return t.consumeLengthOrPercent(e)||t.consumeToken(/^auto/,e)}function n(e){var n=t.consumeList([t.ignore(t.consumeToken.bind(null,/^rect/)),t.ignore(t.consumeToken.bind(null,/^\(/)),t.consumeRepeated.bind(null,i,/^,/),t.ignore(t.consumeToken.bind(null,/^\)/))],e);if(n&&4==n[0].length)return n[0]}var r=t.mergeWrappedNestedRepeated.bind(null,function(t){return"rect("+t+")"},function(e,i){return"auto"==e||"auto"==i?[!0,!1,function(n){var r=n?e:i;if("auto"==r)return"auto";var a=t.mergeDimensions(r,r);return a[2](a[0])}]:t.mergeDimensions(e,i)},", ");t.parseBox=n,t.mergeBoxes=r,t.addPropertiesHandler(n,r,["clip"])}(n),function(t,e){function i(t){return function(e){var i=0;return t.map(function(t){return t===c?e[i++]:t})}}function n(t){return t}function r(e){if("none"==(e=e.toLowerCase().trim()))return[];for(var i,n=/\s*(\w+)\(([^)]*)\)/g,r=[],a=0;i=n.exec(e);){if(i.index!=a)return;a=i.index+i[0].length;var o=i[1],s=h[o];if(!s)return;var u=i[2].split(","),c=s[0];if(c.length<u.length)return;for(var m=[],d=0;d<c.length;d++){var p,_=u[d],g=c[d];if(void 0===(p=_?{A:function(e){return"0"==e.trim()?l:t.parseAngle(e)},N:t.parseNumber,T:t.parseLengthOrPercent,L:t.parseLength}[g.toUpperCase()](_):{a:l,n:m[0],t:f}[g]))return;m.push(p)}if(r.push({t:o,d:m}),n.lastIndex==e.length)return r}}function a(t){return t.toFixed(6).replace(".000000","")}function o(e,i){if(e.decompositionPair!==i){e.decompositionPair=i;var n=t.makeMatrixDecomposition(e)}if(i.decompositionPair!==e){i.decompositionPair=e;var r=t.makeMatrixDecomposition(i)}return null==n[0]||null==r[0]?[[!1],[!0],function(t){return t?i[0].d:e[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(e){var i=t.quat(n[0][3],r[0][3],e[5]);return t.composeMatrix(e[0],e[1],e[2],i,e[4]).map(a).join(",")}])}function s(t){return t.replace(/[xy]/,"")}function u(t){return t.replace(/(x|y|z|3d)?$/,"3d")}var c=null,f={px:0},l={deg:0},h={matrix:["NNNNNN",[c,c,0,0,c,c,0,0,0,0,1,0,c,c,0,1],n],matrix3d:["NNNNNNNNNNNNNNNN",n],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",i([c,c,1]),n],scalex:["N",i([c,1,1]),i([c,1])],scaley:["N",i([1,c,1]),i([1,c])],scalez:["N",i([1,1,c])],scale3d:["NNN",n],skew:["Aa",null,n],skewx:["A",null,i([c,l])],skewy:["A",null,i([l,c])],translate:["Tt",i([c,c,f]),n],translatex:["T",i([c,f,f]),i([c,f])],translatey:["T",i([f,c,f]),i([f,c])],translatez:["L",i([f,f,c])],translate3d:["TTL",n]};t.addPropertiesHandler(r,function(e,i){var n=t.makeMatrixDecomposition&&!0,r=!1;if(!e.length||!i.length)for(e.length||(r=!0,e=i,i=[]),p=0;p<e.length;p++){var a=e[p].t,c=e[p].d,f="scale"==a.substr(0,5)?1:0;i.push({t:a,d:c.map(function(t){if("number"==typeof t)return f;var e={};for(var i in t)e[i]=f;return e})})}var l=[],m=[],d=[];if(e.length!=i.length){if(!n)return;l=[(P=o(e,i))[0]],m=[P[1]],d=[["matrix",[P[2]]]]}else for(var p=0;p<e.length;p++){var _=e[p].t,g=i[p].t,v=e[p].d,y=i[p].d,b=h[_],T=h[g];if(function(t,e){return"perspective"==t&&"perspective"==e||("matrix"==t||"matrix3d"==t)&&("matrix"==e||"matrix3d"==e)}(_,g)){if(!n)return;P=o([e[p]],[i[p]]),l.push(P[0]),m.push(P[1]),d.push(["matrix",[P[2]]])}else{if(_==g)a=_;else if(b[2]&&T[2]&&s(_)==s(g))a=s(_),v=b[2](v),y=T[2](y);else{if(!b[1]||!T[1]||u(_)!=u(g)){if(!n)return;l=[(P=o(e,i))[0]],m=[P[1]],d=[["matrix",[P[2]]]];break}a=u(_),v=b[1](v),y=T[1](y)}for(var w=[],x=[],E=[],A=0;A<v.length;A++){var P=("number"==typeof v[A]?t.mergeNumbers:t.mergeDimensions)(v[A],y[A]);w[A]=P[0],x[A]=P[1],E.push(P[2])}l.push(w),m.push(x),d.push([a,E])}}if(r){var R=l;l=m,m=R}return[l,m,function(t){return t.map(function(t,e){var i=t.map(function(t,i){return d[e][1][i](t)}).join(",");return"matrix"==d[e][0]&&16==i.split(",").length&&(d[e][0]="matrix3d"),d[e][0]+"("+i+")"}).join(" ")}]},["transform"]),t.transformToSvgMatrix=function(e){var i=t.transformListToMatrix(r(e));return"matrix("+a(i[0])+" "+a(i[1])+" "+a(i[4])+" "+a(i[5])+" "+a(i[12])+" "+a(i[13])+")"}}(n),function(t,e){function i(t,e){e.concat([t]).forEach(function(e){e in document.documentElement.style&&(n[t]=e),r[e]=t})}var n={},r={};i("transform",["webkitTransform","msTransform"]),i("transformOrigin",["webkitTransformOrigin"]),i("perspective",["webkitPerspective"]),i("perspectiveOrigin",["webkitPerspectiveOrigin"]),t.propertyName=function(t){return n[t]||t},t.unprefixedPropertyName=function(t){return r[t]||t}}(n)}(),function(){if(void 0===document.createElement("div").animate([]).oncancel){if(window.performance&&performance.now)t=function(){return performance.now()};else var t=function(){return Date.now()};var e=function(t,e,i){this.target=t,this.currentTime=e,this.timelineTime=i,this.type="cancel",this.bubbles=!1,this.cancelable=!1,this.currentTarget=t,this.defaultPrevented=!1,this.eventPhase=Event.AT_TARGET,this.timeStamp=Date.now()},i=window.Element.prototype.animate;window.Element.prototype.animate=function(n,r){var a=i.call(this,n,r);a._cancelHandlers=[],a.oncancel=null;var o=a.cancel;a.cancel=function(){o.call(this);var i=new e(this,null,t()),n=this._cancelHandlers.concat(this.oncancel?[this.oncancel]:[]);setTimeout(function(){n.forEach(function(t){t.call(i.target,i)})},0)};var s=a.addEventListener;a.addEventListener=function(t,e){"function"==typeof e&&"cancel"==t?this._cancelHandlers.push(e):s.call(this,t,e)};var u=a.removeEventListener;return a.removeEventListener=function(t,e){if("cancel"==t){var i=this._cancelHandlers.indexOf(e);i>=0&&this._cancelHandlers.splice(i,1)}else u.call(this,t,e)},a}}}(),function(t){var e=document.documentElement,i=null,n=!1;try{var r="0"==getComputedStyle(e).getPropertyValue("opacity")?"1":"0";(i=e.animate({opacity:[r,r]},{duration:1})).currentTime=0,n=getComputedStyle(e).getPropertyValue("opacity")==r}catch(t){}finally{i&&i.cancel()}if(!n){var a=window.Element.prototype.animate;window.Element.prototype.animate=function(e,i){return window.Symbol&&Symbol.iterator&&Array.prototype.from&&e[Symbol.iterator]&&(e=Array.from(e)),Array.isArray(e)||null===e||(e=t.convertToArrayForm(e)),a.call(this,e,i)}}}(i),function(t,e,i){function n(t){var i=e.timeline;i.currentTime=t,i._discardAnimations(),0==i._animations.length?a=!1:requestAnimationFrame(n)}var r=window.requestAnimationFrame;window.requestAnimationFrame=function(t){return r(function(i){e.timeline._updateAnimationsPromises(),t(i),e.timeline._updateAnimationsPromises()})},e.AnimationTimeline=function(){this._animations=[],this.currentTime=void 0},e.AnimationTimeline.prototype={getAnimations:function(){return this._discardAnimations(),this._animations.slice()},_updateAnimationsPromises:function(){e.animationsWithPromises=e.animationsWithPromises.filter(function(t){return t._updatePromises()})},_discardAnimations:function(){this._updateAnimationsPromises(),this._animations=this._animations.filter(function(t){return"finished"!=t.playState&&"idle"!=t.playState})},_play:function(t){var i=new e.Animation(t,this);return this._animations.push(i),e.restartWebAnimationsNextTick(),i._updatePromises(),i._animation.play(),i._updatePromises(),i},play:function(t){return t&&t.remove(),this._play(t)}};var a=!1;e.restartWebAnimationsNextTick=function(){a||(a=!0,requestAnimationFrame(n))};var o=new e.AnimationTimeline;e.timeline=o;try{Object.defineProperty(window.document,"timeline",{configurable:!0,get:function(){return o}})}catch(t){}try{window.document.timeline=o}catch(t){}}(0,r),function(t,e,i){e.animationsWithPromises=[],e.Animation=function(e,i){if(this.id="",e&&e._id&&(this.id=e._id),this.effect=e,e&&(e._animation=this),!i)throw new Error("Animation with null timeline is not supported");this._timeline=i,this._sequenceNumber=t.sequenceNumber++,this._holdTime=0,this._paused=!1,this._isGroup=!1,this._animation=null,this._childAnimations=[],this._callback=null,this._oldPlayState="idle",this._rebuildUnderlyingAnimation(),this._animation.cancel(),this._updatePromises()},e.Animation.prototype={_updatePromises:function(){var t=this._oldPlayState,e=this.playState;return this._readyPromise&&e!==t&&("idle"==e?(this._rejectReadyPromise(),this._readyPromise=void 0):"pending"==t?this._resolveReadyPromise():"pending"==e&&(this._readyPromise=void 0)),this._finishedPromise&&e!==t&&("idle"==e?(this._rejectFinishedPromise(),this._finishedPromise=void 0):"finished"==e?this._resolveFinishedPromise():"finished"==t&&(this._finishedPromise=void 0)),this._oldPlayState=this.playState,this._readyPromise||this._finishedPromise},_rebuildUnderlyingAnimation:function(){this._updatePromises();var t,i,n,r,a=!!this._animation;a&&(t=this.playbackRate,i=this._paused,n=this.startTime,r=this.currentTime,this._animation.cancel(),this._animation._wrapper=null,this._animation=null),(!this.effect||this.effect instanceof window.KeyframeEffect)&&(this._animation=e.newUnderlyingAnimationForKeyframeEffect(this.effect),e.bindAnimationForKeyframeEffect(this)),(this.effect instanceof window.SequenceEffect||this.effect instanceof window.GroupEffect)&&(this._animation=e.newUnderlyingAnimationForGroup(this.effect),e.bindAnimationForGroup(this)),this.effect&&this.effect._onsample&&e.bindAnimationForCustomEffect(this),a&&(1!=t&&(this.playbackRate=t),null!==n?this.startTime=n:null!==r?this.currentTime=r:null!==this._holdTime&&(this.currentTime=this._holdTime),i&&this.pause()),this._updatePromises()},_updateChildren:function(){if(this.effect&&"idle"!=this.playState){var t=this.effect._timing.delay;this._childAnimations.forEach(function(i){this._arrangeChildren(i,t),this.effect instanceof window.SequenceEffect&&(t+=e.groupChildDuration(i.effect))}.bind(this))}},_setExternalAnimation:function(t){if(this.effect&&this._isGroup)for(var e=0;e<this.effect.children.length;e++)this.effect.children[e]._animation=t,this._childAnimations[e]._setExternalAnimation(t)},_constructChildAnimations:function(){if(this.effect&&this._isGroup){var t=this.effect._timing.delay;this._removeChildAnimations(),this.effect.children.forEach(function(i){var n=e.timeline._play(i);this._childAnimations.push(n),n.playbackRate=this.playbackRate,this._paused&&n.pause(),i._animation=this.effect._animation,this._arrangeChildren(n,t),this.effect instanceof window.SequenceEffect&&(t+=e.groupChildDuration(i))}.bind(this))}},_arrangeChildren:function(t,e){null===this.startTime?t.currentTime=this.currentTime-e/this.playbackRate:t.startTime!==this.startTime+e/this.playbackRate&&(t.startTime=this.startTime+e/this.playbackRate)},get timeline(){return this._timeline},get playState(){return this._animation?this._animation.playState:"idle"},get finished(){return window.Promise?(this._finishedPromise||(-1==e.animationsWithPromises.indexOf(this)&&e.animationsWithPromises.push(this),this._finishedPromise=new Promise(function(t,e){this._resolveFinishedPromise=function(){t(this)},this._rejectFinishedPromise=function(){e({type:DOMException.ABORT_ERR,name:"AbortError"})}}.bind(this)),"finished"==this.playState&&this._resolveFinishedPromise()),this._finishedPromise):(console.warn("Animation Promises require JavaScript Promise constructor"),null)},get ready(){return window.Promise?(this._readyPromise||(-1==e.animationsWithPromises.indexOf(this)&&e.animationsWithPromises.push(this),this._readyPromise=new Promise(function(t,e){this._resolveReadyPromise=function(){t(this)},this._rejectReadyPromise=function(){e({type:DOMException.ABORT_ERR,name:"AbortError"})}}.bind(this)),"pending"!==this.playState&&this._resolveReadyPromise()),this._readyPromise):(console.warn("Animation Promises require JavaScript Promise constructor"),null)},get onfinish(){return this._animation.onfinish},set onfinish(t){this._animation.onfinish="function"==typeof t?function(e){e.target=this,t.call(this,e)}.bind(this):t},get oncancel(){return this._animation.oncancel},set oncancel(t){this._animation.oncancel="function"==typeof t?function(e){e.target=this,t.call(this,e)}.bind(this):t},get currentTime(){this._updatePromises();var t=this._animation.currentTime;return this._updatePromises(),t},set currentTime(t){this._updatePromises(),this._animation.currentTime=isFinite(t)?t:Math.sign(t)*Number.MAX_VALUE,this._register(),this._forEachChild(function(e,i){e.currentTime=t-i}),this._updatePromises()},get startTime(){return this._animation.startTime},set startTime(t){this._updatePromises(),this._animation.startTime=isFinite(t)?t:Math.sign(t)*Number.MAX_VALUE,this._register(),this._forEachChild(function(e,i){e.startTime=t+i}),this._updatePromises()},get playbackRate(){return this._animation.playbackRate},set playbackRate(t){this._updatePromises();var e=this.currentTime;this._animation.playbackRate=t,this._forEachChild(function(e){e.playbackRate=t}),null!==e&&(this.currentTime=e),this._updatePromises()},play:function(){this._updatePromises(),this._paused=!1,this._animation.play(),-1==this._timeline._animations.indexOf(this)&&this._timeline._animations.push(this),this._register(),e.awaitStartTime(this),this._forEachChild(function(t){var e=t.currentTime;t.play(),t.currentTime=e}),this._updatePromises()},pause:function(){this._updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._animation.pause(),this._register(),this._forEachChild(function(t){t.pause()}),this._paused=!0,this._updatePromises()},finish:function(){this._updatePromises(),this._animation.finish(),this._register(),this._updatePromises()},cancel:function(){this._updatePromises(),this._animation.cancel(),this._register(),this._removeChildAnimations(),this._updatePromises()},reverse:function(){this._updatePromises();var t=this.currentTime;this._animation.reverse(),this._forEachChild(function(t){t.reverse()}),null!==t&&(this.currentTime=t),this._updatePromises()},addEventListener:function(t,e){var i=e;"function"==typeof e&&(i=function(t){t.target=this,e.call(this,t)}.bind(this),e._wrapper=i),this._animation.addEventListener(t,i)},removeEventListener:function(t,e){this._animation.removeEventListener(t,e&&e._wrapper||e)},_removeChildAnimations:function(){for(;this._childAnimations.length;)this._childAnimations.pop().cancel()},_forEachChild:function(e){var i=0;if(this.effect.children&&this._childAnimations.length<this.effect.children.length&&this._constructChildAnimations(),this._childAnimations.forEach(function(t){e.call(this,t,i),this.effect instanceof window.SequenceEffect&&(i+=t.effect.activeDuration)}.bind(this)),"pending"!=this.playState){var n=this.effect._timing,r=this.currentTime;null!==r&&(r=t.calculateIterationProgress(t.calculateActiveDuration(n),r,n)),(null==r||isNaN(r))&&this._removeChildAnimations()}}},window.Animation=e.Animation}(i,r),function(t,e,i){function n(e){this._frames=t.normalizeKeyframes(e)}function r(){for(var t=!1;u.length;)u.shift()._updateChildren(),t=!0;return t}var a=function t(e){if(e._animation=void 0,e instanceof window.SequenceEffect||e instanceof window.GroupEffect)for(var i=0;i<e.children.length;i++)t(e.children[i])};e.removeMulti=function(t){for(var e=[],i=0;i<t.length;i++){var n=t[i];n._parent?(-1==e.indexOf(n._parent)&&e.push(n._parent),n._parent.children.splice(n._parent.children.indexOf(n),1),n._parent=null,a(n)):n._animation&&n._animation.effect==n&&(n._animation.cancel(),n._animation.effect=new KeyframeEffect(null,[]),n._animation._callback&&(n._animation._callback._animation=null),n._animation._rebuildUnderlyingAnimation(),a(n))}for(i=0;i<e.length;i++)e[i]._rebuild()},e.KeyframeEffect=function(e,i,r,a){return this.target=e,this._parent=null,r=t.numericTimingToObject(r),this._timingInput=t.cloneTimingInput(r),this._timing=t.normalizeTimingInput(r),this.timing=t.makeTiming(r,!1,this),this.timing._effect=this,"function"==typeof i?(t.deprecated("Custom KeyframeEffect","2015-06-22","Use KeyframeEffect.onsample instead."),this._normalizedKeyframes=i):this._normalizedKeyframes=new n(i),this._keyframes=i,this.activeDuration=t.calculateActiveDuration(this._timing),this._id=a,this},e.KeyframeEffect.prototype={getFrames:function(){return"function"==typeof this._normalizedKeyframes?this._normalizedKeyframes:this._normalizedKeyframes._frames},set onsample(t){if("function"==typeof this.getFrames())throw new Error("Setting onsample on custom effect KeyframeEffect is not supported.");this._onsample=t,this._animation&&this._animation._rebuildUnderlyingAnimation()},get parent(){return this._parent},clone:function(){if("function"==typeof this.getFrames())throw new Error("Cloning custom effects is not supported.");var e=new KeyframeEffect(this.target,[],t.cloneTimingInput(this._timingInput),this._id);return e._normalizedKeyframes=this._normalizedKeyframes,e._keyframes=this._keyframes,e},remove:function(){e.removeMulti([this])}};var o=Element.prototype.animate;Element.prototype.animate=function(t,i){var n="";return i&&i.id&&(n=i.id),e.timeline._play(new e.KeyframeEffect(this,t,i,n))};var s=document.createElementNS("http://www.w3.org/1999/xhtml","div");e.newUnderlyingAnimationForKeyframeEffect=function(t){if(t){e=t.target||s;"function"==typeof(i=t._keyframes)&&(i=[]),(n=t._timingInput).id=t._id}else var e=s,i=[],n=0;return o.apply(e,[i,n])},e.bindAnimationForKeyframeEffect=function(t){t.effect&&"function"==typeof t.effect._normalizedKeyframes&&e.bindAnimationForCustomEffect(t)};var u=[];e.awaitStartTime=function(t){null===t.startTime&&t._isGroup&&(0==u.length&&requestAnimationFrame(r),u.push(t))};var c=window.getComputedStyle;Object.defineProperty(window,"getComputedStyle",{configurable:!0,enumerable:!0,value:function(){e.timeline._updateAnimationsPromises();var t=c.apply(this,arguments);return r()&&(t=c.apply(this,arguments)),e.timeline._updateAnimationsPromises(),t}}),window.KeyframeEffect=e.KeyframeEffect,window.Element.prototype.getAnimations=function(){return document.timeline.getAnimations().filter(function(t){return null!==t.effect&&t.effect.target==this}.bind(this))}}(i,r),function(t,e,i){function n(t){t._registered||(t._registered=!0,o.push(t),s||(s=!0,requestAnimationFrame(r)))}function r(t){var e=o;o=[],e.sort(function(t,e){return t._sequenceNumber-e._sequenceNumber}),e=e.filter(function(t){t();var e=t._animation?t._animation.playState:"idle";return"running"!=e&&"pending"!=e&&(t._registered=!1),t._registered}),o.push.apply(o,e),o.length?(s=!0,requestAnimationFrame(r)):s=!1}var a=(document.createElementNS("http://www.w3.org/1999/xhtml","div"),0);e.bindAnimationForCustomEffect=function(e){var i,r=e.effect.target,o="function"==typeof e.effect.getFrames();i=o?e.effect.getFrames():e.effect._onsample;var s=e.effect.timing,u=null;s=t.normalizeTimingInput(s);var c=function n(){var a=n._animation?n._animation.currentTime:null;null!==a&&(a=t.calculateIterationProgress(t.calculateActiveDuration(s),a,s),isNaN(a)&&(a=null)),a!==u&&(o?i(a,r,e.effect):i(a,e.effect,e.effect._animation)),u=a};c._animation=e,c._registered=!1,c._sequenceNumber=a++,e._callback=c,n(c)};var o=[],s=!1;e.Animation.prototype._register=function(){this._callback&&n(this._callback)}}(i,r),function(t,e,i){function n(t){return t._timing.delay+t.activeDuration+t._timing.endDelay}function r(e,i,n){this._id=n,this._parent=null,this.children=e||[],this._reparent(this.children),i=t.numericTimingToObject(i),this._timingInput=t.cloneTimingInput(i),this._timing=t.normalizeTimingInput(i,!0),this.timing=t.makeTiming(i,!0,this),this.timing._effect=this,"auto"===this._timing.duration&&(this._timing.duration=this.activeDuration)}window.SequenceEffect=function(){r.apply(this,arguments)},window.GroupEffect=function(){r.apply(this,arguments)},r.prototype={_isAncestor:function(t){for(var e=this;null!==e;){if(e==t)return!0;e=e._parent}return!1},_rebuild:function(){for(var t=this;t;)"auto"===t.timing.duration&&(t._timing.duration=t.activeDuration),t=t._parent;this._animation&&this._animation._rebuildUnderlyingAnimation()},_reparent:function(t){e.removeMulti(t);for(var i=0;i<t.length;i++)t[i]._parent=this},_putChild:function(t,e){for(var i=e?"Cannot append an ancestor or self":"Cannot prepend an ancestor or self",n=0;n<t.length;n++)if(this._isAncestor(t[n]))throw{type:DOMException.HIERARCHY_REQUEST_ERR,name:"HierarchyRequestError",message:i};for(n=0;n<t.length;n++)e?this.children.push(t[n]):this.children.unshift(t[n]);this._reparent(t),this._rebuild()},append:function(){this._putChild(arguments,!0)},prepend:function(){this._putChild(arguments,!1)},get parent(){return this._parent},get firstChild(){return this.children.length?this.children[0]:null},get lastChild(){return this.children.length?this.children[this.children.length-1]:null},clone:function(){for(var e=t.cloneTimingInput(this._timingInput),i=[],n=0;n<this.children.length;n++)i.push(this.children[n].clone());return this instanceof GroupEffect?new GroupEffect(i,e):new SequenceEffect(i,e)},remove:function(){e.removeMulti([this])}},window.SequenceEffect.prototype=Object.create(r.prototype),Object.defineProperty(window.SequenceEffect.prototype,"activeDuration",{get:function(){var t=0;return this.children.forEach(function(e){t+=n(e)}),Math.max(t,0)}}),window.GroupEffect.prototype=Object.create(r.prototype),Object.defineProperty(window.GroupEffect.prototype,"activeDuration",{get:function(){var t=0;return this.children.forEach(function(e){t=Math.max(t,n(e))}),t}}),e.newUnderlyingAnimationForGroup=function(i){var n,r=null,a=new KeyframeEffect(null,[],i._timing,i._id);return a.onsample=function(e){var i=n._wrapper;if(i&&"pending"!=i.playState&&i.effect)return null==e?void i._removeChildAnimations():0==e&&i.playbackRate<0&&(r||(r=t.normalizeTimingInput(i.effect.timing)),e=t.calculateIterationProgress(t.calculateActiveDuration(r),-1,r),isNaN(e)||null==e)?(i._forEachChild(function(t){t.currentTime=-1}),void i._removeChildAnimations()):void 0},n=e.timeline._play(a)},e.bindAnimationForGroup=function(t){t._animation._wrapper=t,t._isGroup=!0,e.awaitStartTime(t),t._constructChildAnimations(),t._setExternalAnimation(t)},e.groupChildDuration=n}(i,r),e.true=t}({},function(){return this}());</script><script>!function(n){"use strict";function t(n,t){for(var e=[],r=0,u=n.length;r<u;r++)e.push(n[r].substr(0,t));return e}function e(n){return function(t,e,r){var u=r[n].indexOf(e.charAt(0).toUpperCase()+e.substr(1).toLowerCase());~u&&(t.month=u)}}function r(n,t){for(n=String(n),t=t||2;n.length<t;)n="0"+n;return n}var u={},o=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,a=/\d\d?/,i=/\d{3}/,s=/\d{4}/,m=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,d=/\[([^]*?)\]/gm,c=function(){},f=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h=["January","February","March","April","May","June","July","August","September","October","November","December"],l=t(h,3),M=t(f,3);u.i18n={dayNamesShort:M,dayNames:f,monthNamesShort:l,monthNames:h,amPm:["am","pm"],DoFn:function(n){return n+["th","st","nd","rd"][n%10>3?0:(n-n%10!=10)*n%10]}};var g={D:function(n){return n.getDate()},DD:function(n){return r(n.getDate())},Do:function(n,t){return t.DoFn(n.getDate())},d:function(n){return n.getDay()},dd:function(n){return r(n.getDay())},ddd:function(n,t){return t.dayNamesShort[n.getDay()]},dddd:function(n,t){return t.dayNames[n.getDay()]},M:function(n){return n.getMonth()+1},MM:function(n){return r(n.getMonth()+1)},MMM:function(n,t){return t.monthNamesShort[n.getMonth()]},MMMM:function(n,t){return t.monthNames[n.getMonth()]},YY:function(n){return String(n.getFullYear()).substr(2)},YYYY:function(n){return n.getFullYear()},h:function(n){return n.getHours()%12||12},hh:function(n){return r(n.getHours()%12||12)},H:function(n){return n.getHours()},HH:function(n){return r(n.getHours())},m:function(n){return n.getMinutes()},mm:function(n){return r(n.getMinutes())},s:function(n){return n.getSeconds()},ss:function(n){return r(n.getSeconds())},S:function(n){return Math.round(n.getMilliseconds()/100)},SS:function(n){return r(Math.round(n.getMilliseconds()/10),2)},SSS:function(n){return r(n.getMilliseconds(),3)},a:function(n,t){return n.getHours()<12?t.amPm[0]:t.amPm[1]},A:function(n,t){return n.getHours()<12?t.amPm[0].toUpperCase():t.amPm[1].toUpperCase()},ZZ:function(n){var t=n.getTimezoneOffset();return(t>0?"-":"+")+r(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)}},D={D:[a,function(n,t){n.day=t}],Do:[new RegExp(a.source+m.source),function(n,t){n.day=parseInt(t,10)}],M:[a,function(n,t){n.month=t-1}],YY:[a,function(n,t){var e=+(""+(new Date).getFullYear()).substr(0,2);n.year=""+(t>68?e-1:e)+t}],h:[a,function(n,t){n.hour=t}],m:[a,function(n,t){n.minute=t}],s:[a,function(n,t){n.second=t}],YYYY:[s,function(n,t){n.year=t}],S:[/\d/,function(n,t){n.millisecond=100*t}],SS:[/\d{2}/,function(n,t){n.millisecond=10*t}],SSS:[i,function(n,t){n.millisecond=t}],d:[a,c],ddd:[m,c],MMM:[m,e("monthNamesShort")],MMMM:[m,e("monthNames")],a:[m,function(n,t,e){var r=t.toLowerCase();r===e.amPm[0]?n.isPm=!1:r===e.amPm[1]&&(n.isPm=!0)}],ZZ:[/[\+\-]\d\d:?\d\d/,function(n,t){var e,r=(t+"").match(/([\+\-]|\d\d)/gi);r&&(e=60*r[1]+parseInt(r[2],10),n.timezoneOffset="+"===r[0]?e:-e)}]};D.dd=D.d,D.dddd=D.ddd,D.DD=D.D,D.mm=D.m,D.hh=D.H=D.HH=D.h,D.MM=D.M,D.ss=D.s,D.A=D.a,u.masks={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},u.format=function(n,t,e){var r=e||u.i18n;if("number"==typeof n&&(n=new Date(n)),"[object Date]"!==Object.prototype.toString.call(n)||isNaN(n.getTime()))throw new Error("Invalid Date in fecha.format");var a=[];return t=(t=u.masks[t]||t||u.masks.default).replace(d,function(n,t){return a.push(t),"??"}),(t=t.replace(o,function(t){return t in g?g[t](n,r):t.slice(1,t.length-1)})).replace(/\?\?/g,function(){return a.shift()})},u.parse=function(n,t,e){var r=e||u.i18n;if("string"!=typeof t)throw new Error("Invalid format in fecha.parse");if(t=u.masks[t]||t,n.length>1e3)return!1;var a=!0,i={};if(t.replace(o,function(t){if(D[t]){var e=D[t],u=n.search(e[0]);~u?n.replace(e[0],function(t){return e[1](i,t,r),n=n.substr(u+t.length),t}):a=!1}return D[t]?"":t.slice(1,t.length-1)}),!a)return!1;var s=new Date;!0===i.isPm&&null!=i.hour&&12!=+i.hour?i.hour=+i.hour+12:!1===i.isPm&&12==+i.hour&&(i.hour=0);var m;return null!=i.timezoneOffset?(i.minute=+(i.minute||0)-+i.timezoneOffset,m=new Date(Date.UTC(i.year||s.getFullYear(),i.month||0,i.day||1,i.hour||0,i.minute||0,i.second||0,i.millisecond||0))):m=new Date(i.year||s.getFullYear(),i.month||0,i.day||1,i.hour||0,i.minute||0,i.second||0,i.millisecond||0),m},"undefined"!=typeof module&&module.exports?module.exports=u:"function"==typeof define&&define.amd?define(function(){return u}):n.fecha=u}(this);</script><script>function toLocaleStringSupportsOptions(){try{(new Date).toLocaleString("i")}catch(e){return"RangeError"===e.name}return!1}function toLocaleDateStringSupportsOptions(){try{(new Date).toLocaleDateString("i")}catch(e){return"RangeError"===e.name}return!1}function toLocaleTimeStringSupportsOptions(){try{(new Date).toLocaleTimeString("i")}catch(e){return"RangeError"===e.name}return!1}window.hassUtil=window.hassUtil||{},window.hassUtil.DEFAULT_ICON="mdi:bookmark",window.hassUtil.OFF_STATES=["off","closed","unlocked"],window.hassUtil.DOMAINS_WITH_CARD=["climate","cover","configurator","input_select","input_slider","media_player","scene","script","weblink"],window.hassUtil.DOMAINS_WITH_MORE_INFO=["alarm_control_panel","automation","camera","climate","configurator","cover","fan","group","light","lock","media_player","script","sun","updater","vacuum"],window.hassUtil.DOMAINS_WITH_NO_HISTORY=["camera","configurator","scene"],window.hassUtil.HIDE_MORE_INFO=["input_select","scene","script","input_slider"],window.hassUtil.LOGIC_STATE_ATTRIBUTES=["entity_picture","friendly_name","icon","unit_of_measurement","emulated_hue","emulated_hue_name","haaska_hidden","haaska_name","homebridge_hidden","homebridge_name","supported_features","attribution","custom_ui_state_card","device_class"],window.hassUtil.LANGUAGE=navigator.languages?navigator.languages[0]:navigator.language||navigator.userLanguage,window.hassUtil.attributeClassNames=function(e,t){return e?t.map(function(t){return t in e.attributes?"has-"+t:""}).join(" "):""},window.hassUtil.featureClassNames=function(e,t){if(!e||!e.attributes.supported_features)return"";var i=e.attributes.supported_features;return Object.keys(t).map(function(e){return 0!=(i&e)?t[e]:""}).join(" ")},window.hassUtil.canToggleState=function(e,t){var i=window.hassUtil.computeDomain(t);return"group"===i?"on"===t.state||"off"===t.state:window.hassUtil.canToggleDomain(e,i)},window.hassUtil.canToggleDomain=function(e,t){var i,a=e.config.services[t];return i="lock"===t?"lock":"cover"===t?"open_cover":"turn_on",a&&i in a},window.hassUtil.dynamicContentUpdater=function(e,t,i){var a,n=Polymer.dom(e);n.lastChild&&n.lastChild.tagName===t?a=n.lastChild:(n.lastChild&&n.removeChild(n.lastChild),a=document.createElement(t)),Object.keys(i).forEach(function(e){a[e]=i[e]}),null===a.parentNode&&n.appendChild(a)},window.fecha.masks.haDateTime=window.fecha.masks.shortTime+" "+window.fecha.masks.mediumDate,toLocaleStringSupportsOptions()?window.hassUtil.formatDateTime=function(e){return e.toLocaleString(window.hassUtil.LANGUAGE,{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"})}:window.hassUtil.formatDateTime=function(e){return window.fecha.format(e,"haDateTime")},toLocaleDateStringSupportsOptions()?window.hassUtil.formatDate=function(e){return e.toLocaleDateString(window.hassUtil.LANGUAGE,{year:"numeric",month:"long",day:"numeric"})}:window.hassUtil.formatDate=function(e){return window.fecha.format(e,"mediumDate")},toLocaleTimeStringSupportsOptions()?window.hassUtil.formatTime=function(e){return e.toLocaleTimeString(window.hassUtil.LANGUAGE,{hour:"numeric",minute:"2-digit"})}:window.hassUtil.formatTime=function(e){return window.fecha.format(e,"shortTime")},window.hassUtil.relativeTime=function(e){var t,i=Math.abs(new Date-e)/1e3,a=new Date>e?"%s ago":"in %s",n=window.hassUtil.relativeTime.tests;for(t=0;t<n.length;t+=2){if(i<n[t])return i=Math.floor(i),a.replace("%s",1===i?"1 "+n[t+1]:i+" "+n[t+1]+"s");i/=n[t]}return i=Math.floor(i),a.replace("%s",1===i?"1 week":i+" weeks")},window.hassUtil.relativeTime.tests=[60,"second",60,"minute",24,"hour",7,"day"],window.hassUtil.stateCardType=function(e,t){if("unavailable"===t.state)return"display";var i=window.hassUtil.computeDomain(t);return-1!==window.hassUtil.DOMAINS_WITH_CARD.indexOf(i)?i:window.hassUtil.canToggleState(e,t)&&"hidden"!==t.attributes.control?"toggle":"display"},window.hassUtil.stateMoreInfoType=function(e){var t=window.hassUtil.computeDomain(e);return-1!==window.hassUtil.DOMAINS_WITH_MORE_INFO.indexOf(t)?t:-1!==window.hassUtil.HIDE_MORE_INFO.indexOf(t)?"hidden":"default"},window.hassUtil.domainIcon=function(e,t){switch(e){case"alarm_control_panel":return t&&"disarmed"===t?"mdi:bell-outline":"mdi:bell";case"automation":return"mdi:playlist-play";case"binary_sensor":return t&&"off"===t?"mdi:radiobox-blank":"mdi:checkbox-marked-circle";case"calendar":return"mdi:calendar";case"camera":return"mdi:video";case"climate":return"mdi:nest-thermostat";case"configurator":return"mdi:settings";case"conversation":return"mdi:text-to-speech";case"cover":return t&&"open"===t?"mdi:window-open":"mdi:window-closed";case"device_tracker":return"mdi:account";case"fan":return"mdi:fan";case"group":return"mdi:google-circles-communities";case"homeassistant":return"mdi:home";case"image_processing":return"mdi:image-filter-frames";case"input_boolean":return"mdi:drawing";case"input_select":return"mdi:format-list-bulleted";case"input_slider":return"mdi:ray-vertex";case"light":return"mdi:lightbulb";case"lock":return t&&"unlocked"===t?"mdi:lock-open":"mdi:lock";case"media_player":return t&&"off"!==t&&"idle"!==t?"mdi:cast-connected":"mdi:cast";case"notify":return"mdi:comment-alert";case"proximity":return"mdi:apple-safari";case"remote":return"mdi:remote";case"scene":return"mdi:google-pages";case"script":return"mdi:file-document";case"sensor":return"mdi:eye";case"simple_alarm":return"mdi:bell";case"sun":return"mdi:white-balance-sunny";case"switch":return"mdi:flash";case"updater":return"mdi:cloud-upload";case"weblink":return"mdi:open-in-new";case"zwave":if(t){if(-1!==t.indexOf("Dead"))return"mdi:emoticon-dead";if(-1!==t.indexOf("Sleeping"))return"mdi:sleep"}return"mdi:nfc";default:return console.warn("Unable to find icon for domain "+e+" ("+t+")"),window.hassUtil.DEFAULT_ICON}},window.hassUtil.binarySensorIcon=function(e){var t=e.state&&"off"===e.state;switch(e.attributes.device_class){case"connectivity":return t?"mdi:server-network-off":"mdi:server-network";case"light":return t?"mdi:brightness-5":"mdi:brightness-7";case"moisture":return t?"mdi:water-off":"mdi:water";case"motion":return t?"mdi:walk":"mdi:run";case"occupancy":return t?"mdi:home":"mdi:home-outline";case"opening":return t?"mdi:crop-square":"mdi:exit-to-app";case"sound":return t?"mdi:music-note-off":"mdi:music-note";case"vibration":return t?"mdi:crop-portrait":"mdi:vibrate";case"gas":case"power":case"safety":case"smoke":return t?"mdi:verified":"mdi:alert";default:return t?"mdi:radiobox-blank":"mdi:checkbox-marked-circle"}},window.hassUtil.coverIcon=function(e){var t=e.state&&"open"===e.state;switch(e.attributes.device_class){case"garage":return t?"mdi:garage-open":"mdi:garage";default:return t?"mdi:window-open":"mdi:window-closed"}},window.hassUtil.stateIcon=function(e){if(!e)return window.hassUtil.DEFAULT_ICON;if(e.attributes.icon)return e.attributes.icon;var t=e.attributes.unit_of_measurement,i=window.hassUtil.computeDomain(e);if(t&&"sensor"===i){if("°C"===t||"°F"===t)return"mdi:thermometer";if("Mice"===t)return"mdi:mouse-variant"}else{if("binary_sensor"===i)return window.hassUtil.binarySensorIcon(e);if("cover"===i)return window.hassUtil.coverIcon(e)}return window.hassUtil.domainIcon(i,e.state)},window.hassUtil.computeDomain=function(e){return e._domain||(e._domain=window.HAWS.extractDomain(e.entity_id)),e._domain},window.hassUtil.computeStateName=function(e){return void 0===e._entityDisplay&&(e._entityDisplay=e.attributes.friendly_name||window.HAWS.extractObjectId(e.entity_id).replace(/_/g," ")),e._entityDisplay},window.hassUtil.sortByName=function(e,t){var i=window.hassUtil.computeStateName(e),a=window.hassUtil.computeStateName(t);return i<a?-1:i>a?1:0},window.hassUtil.computeStateState=function(e){if(!e._stateDisplay&&(e._stateDisplay=e.state.replace(/_/g," "),e.attributes.unit_of_measurement&&(e._stateDisplay+=" "+e.attributes.unit_of_measurement),"binary_sensor"===window.hassUtil.computeDomain(e)))switch(e.attributes.device_class){case"moisture":e._stateDisplay="off"===e._stateDisplay?"dry":"wet";break;case"gas":case"motion":case"occupancy":case"smoke":case"sound":case"vibration":e._stateDisplay="off"===e._stateDisplay?"clear":"detected";break;case"opening":e._stateDisplay="off"===e._stateDisplay?"closed":"open";break;case"safety":e._stateDisplay="off"===e._stateDisplay?"safe":"unsafe"}return e._stateDisplay},window.hassUtil.isComponentLoaded=function(e,t){return e&&-1!==e.config.core.components.indexOf(t)},window.hassUtil.computeLocationName=function(e){return e&&e.config.core.location_name},window.hassUtil.applyThemesOnElement=function(e,t,i){e._themes||(e._themes={});var a=t.default_theme;if(("default"===i||i&&t.themes[i])&&(a=i),"default"!==a){var n=t.themes[a],r=Object.assign({},e._themes);Object.keys(n).forEach(function(t){var i="--"+t;e._themes[i]="",r[i]=n[t]}),e.updateStyles(r)}else e.updateStyles(e._themes)};</script><script>!function(){var t=["dockedSidebar"];Polymer({is:"ha-pref-storage",properties:{hass:{type:Object},storage:{type:Object,value:window.localStorage||{}}},storeState:function(){if(this.hass)try{for(var e=0;e<t.length;e++){var r=t[e];this.storage[r]=JSON.stringify(this.hass[r])}}catch(t){}},getStoredState:function(){for(var e={},r=0;r<t.length;r++){var a=t[r];a in this.storage&&(e[a]=JSON.parse(this.storage[a]))}return e}})}();</script><script>window.hassCallApi=function(e,t,s,o,a){var r=e+"/api/"+o;if(window.HASS_DEMO){var n;switch(o.split("/",1)[0]){case"bootstrap":n=window.hassDemoData.bootstrap;break;case"logbook":n=window.hassDemoData.logbook;break;case"history":n=window.hassDemoData.stateHistory;break;default:n=!1}return new Promise(function(e,t){n?e(n):t("Request not allowed in demo mode.")})}return new Promise(function(e,o){var n=new XMLHttpRequest;n.open(s,r,!0),t.authToken&&n.setRequestHeader("X-HA-access",t.authToken),n.onload=function(){var t=n.responseText;if("application/json"===n.getResponseHeader("content-type"))try{t=JSON.parse(n.responseText)}catch(e){return void o({error:"Unable to parse JSON response",status_code:n.status,body:t})}n.status>199&&n.status<300?e(t):o({error:"Response error: "+n.status,status_code:n.status,body:t})},n.onerror=function(){o({error:"Request error",status_code:n.status,body:n.responseText})},a?(n.setRequestHeader("Content-Type","application/json;charset=UTF-8"),n.send(JSON.stringify(a))):n.send()})};</script><custom-style><style is="custom-style">html{--primary-text-color:var(--light-theme-text-color);--primary-background-color:var(--light-theme-background-color);--secondary-text-color:var(--light-theme-secondary-color);--disabled-text-color:var(--light-theme-disabled-color);--divider-color:var(--light-theme-divider-color);--error-color:var(--paper-deep-orange-a700);--primary-color:var(--paper-indigo-500);--light-primary-color:var(--paper-indigo-100);--dark-primary-color:var(--paper-indigo-700);--accent-color:var(--paper-pink-a200);--light-accent-color:var(--paper-pink-a100);--dark-accent-color:var(--paper-pink-a400);--light-theme-background-color:#ffffff;--light-theme-base-color:#000000;--light-theme-text-color:var(--paper-grey-900);--light-theme-secondary-color:#737373;--light-theme-disabled-color:#9b9b9b;--light-theme-divider-color:#dbdbdb;--dark-theme-background-color:var(--paper-grey-900);--dark-theme-base-color:#ffffff;--dark-theme-text-color:#ffffff;--dark-theme-secondary-color:#bcbcbc;--dark-theme-disabled-color:#646464;--dark-theme-divider-color:#3c3c3c;--text-primary-color:var(--dark-theme-text-color);--default-primary-color:var(--primary-color);}</style></custom-style><script>!function(){function e(e){this.type=e&&e.type||"default",this.key=e&&e.key,"value"in e&&(this.value=e.value)}e.types={},e.prototype={get value(){var t=this.type,y=this.key;if(t&&y)return e.types[t]&&e.types[t][y]},set value(t){var y=this.type,i=this.key;y&&i&&(y=e.types[y]=e.types[y]||{},null==t?delete y[i]:y[i]=t)},get list(){if(this.type)return Object.keys(e.types[this.type]).map(function(e){return t[this.type][e]},this)},byKey:function(e){return this.key=e,this.value}},Polymer.IronMeta=e;var t=Polymer.IronMeta.types;Polymer({is:"iron-meta",properties:{type:{type:String,value:"default"},key:{type:String},value:{type:String,notify:!0},self:{type:Boolean,observer:"_selfChanged"},__meta:{type:Boolean,computed:"__computeMeta(type, key, value)"}},hostAttributes:{hidden:!0},__computeMeta:function(e,t,y){var i=new Polymer.IronMeta({type:e,key:t});return void 0!==y&&y!==i.value?i.value=y:this.value!==i.value&&(this.value=i.value),i},get list(){return this.__meta&&this.__meta.list},_selfChanged:function(e){e&&(this.value=this)},byKey:function(e){return new Polymer.IronMeta({type:this.type,key:e}).value}})}();</script><script>Polymer.IronValidatableBehaviorMeta=null,Polymer.IronValidatableBehavior={properties:{validator:{type:String},invalid:{notify:!0,reflectToAttribute:!0,type:Boolean,value:!1,observer:"_invalidChanged"}},registered:function(){Polymer.IronValidatableBehaviorMeta=new Polymer.IronMeta({type:"validator"})},_invalidChanged:function(){this.invalid?this.setAttribute("aria-invalid","true"):this.removeAttribute("aria-invalid")},get _validator(){return Polymer.IronValidatableBehaviorMeta&&Polymer.IronValidatableBehaviorMeta.byKey(this.validator)},hasValidator:function(){return null!=this._validator},validate:function(i){return void 0===i&&void 0!==this.value?this.invalid=!this._getValidity(this.value):this.invalid=!this._getValidity(i),!this.invalid},_getValidity:function(i){return!this.hasValidator()||this._validator.validate(i)}};</script><script>Polymer.IronFormElementBehavior={properties:{name:{type:String},value:{notify:!0,type:String},required:{type:Boolean,value:!1},_parentForm:{type:Object}},attached:Polymer.Element?null:function(){this.fire("iron-form-element-register")},detached:Polymer.Element?null:function(){this._parentForm&&this._parentForm.fire("iron-form-element-unregister",{target:this})}};</script><script>Polymer.IronCheckedElementBehaviorImpl={properties:{checked:{type:Boolean,value:!1,reflectToAttribute:!0,notify:!0,observer:"_checkedChanged"},toggles:{type:Boolean,value:!0,reflectToAttribute:!0},value:{type:String,value:"on",observer:"_valueChanged"}},observers:["_requiredChanged(required)"],created:function(){this._hasIronCheckedElementBehavior=!0},_getValidity:function(e){return this.disabled||!this.required||this.checked},_requiredChanged:function(){this.required?this.setAttribute("aria-required","true"):this.removeAttribute("aria-required")},_checkedChanged:function(){this.active=this.checked,this.fire("iron-change")},_valueChanged:function(){void 0!==this.value&&null!==this.value||(this.value="on")}},Polymer.IronCheckedElementBehavior=[Polymer.IronFormElementBehavior,Polymer.IronValidatableBehavior,Polymer.IronCheckedElementBehaviorImpl];</script><script>!function(){"use strict";function e(e,t){var n="";if(e){var i=e.toLowerCase();" "===i||v.test(i)?n="space":f.test(i)?n="esc":1==i.length?t&&!u.test(i)||(n=i):n=c.test(i)?i.replace("arrow",""):"multiply"==i?"*":i}return n}function t(e){var t="";return e&&(e in o?t=o[e]:h.test(e)?(e=parseInt(e.replace("U+","0x"),16),t=String.fromCharCode(e).toLowerCase()):t=e.toLowerCase()),t}function n(e){var t="";return Number(e)&&(t=e>=65&&e<=90?String.fromCharCode(32+e):e>=112&&e<=123?"f"+(e-112):e>=48&&e<=57?String(e-48):e>=96&&e<=105?String(e-96):d[e]),t}function i(i,r){return i.key?e(i.key,r):i.detail&&i.detail.key?e(i.detail.key,r):t(i.keyIdentifier)||n(i.keyCode)||""}function r(e,t){return i(t,e.hasModifiers)===e.key&&(!e.hasModifiers||!!t.shiftKey==!!e.shiftKey&&!!t.ctrlKey==!!e.ctrlKey&&!!t.altKey==!!e.altKey&&!!t.metaKey==!!e.metaKey)}function s(e){return 1===e.length?{combo:e,key:e,event:"keydown"}:e.split("+").reduce(function(e,t){var n=t.split(":"),i=n[0],r=n[1];return i in y?(e[y[i]]=!0,e.hasModifiers=!0):(e.key=i,e.event=r||"keydown"),e},{combo:e.split(":").shift()})}function a(e){return e.trim().split(" ").map(function(e){return s(e)})}var o={"U+0008":"backspace","U+0009":"tab","U+001B":"esc","U+0020":"space","U+007F":"del"},d={8:"backspace",9:"tab",13:"enter",27:"esc",33:"pageup",34:"pagedown",35:"end",36:"home",32:"space",37:"left",38:"up",39:"right",40:"down",46:"del",106:"*"},y={shift:"shiftKey",ctrl:"ctrlKey",alt:"altKey",meta:"metaKey"},u=/[a-z0-9*]/,h=/U\+/,c=/^arrow/,v=/^space(bar)?/,f=/^escape$/;Polymer.IronA11yKeysBehavior={properties:{keyEventTarget:{type:Object,value:function(){return this}},stopKeyboardEventPropagation:{type:Boolean,value:!1},_boundKeyHandlers:{type:Array,value:function(){return[]}},_imperativeKeyBindings:{type:Object,value:function(){return{}}}},observers:["_resetKeyEventListeners(keyEventTarget, _boundKeyHandlers)"],keyBindings:{},registered:function(){this._prepKeyBindings()},attached:function(){this._listenKeyEventListeners()},detached:function(){this._unlistenKeyEventListeners()},addOwnKeyBinding:function(e,t){this._imperativeKeyBindings[e]=t,this._prepKeyBindings(),this._resetKeyEventListeners()},removeOwnKeyBindings:function(){this._imperativeKeyBindings={},this._prepKeyBindings(),this._resetKeyEventListeners()},keyboardEventMatchesKeys:function(e,t){for(var n=a(t),i=0;i<n.length;++i)if(r(n[i],e))return!0;return!1},_collectKeyBindings:function(){var e=this.behaviors.map(function(e){return e.keyBindings});return-1===e.indexOf(this.keyBindings)&&e.push(this.keyBindings),e},_prepKeyBindings:function(){this._keyBindings={},this._collectKeyBindings().forEach(function(e){for(var t in e)this._addKeyBinding(t,e[t])},this);for(var e in this._imperativeKeyBindings)this._addKeyBinding(e,this._imperativeKeyBindings[e]);for(var t in this._keyBindings)this._keyBindings[t].sort(function(e,t){var n=e[0].hasModifiers;return n===t[0].hasModifiers?0:n?-1:1})},_addKeyBinding:function(e,t){a(e).forEach(function(e){this._keyBindings[e.event]=this._keyBindings[e.event]||[],this._keyBindings[e.event].push([e,t])},this)},_resetKeyEventListeners:function(){this._unlistenKeyEventListeners(),this.isAttached&&this._listenKeyEventListeners()},_listenKeyEventListeners:function(){this.keyEventTarget&&Object.keys(this._keyBindings).forEach(function(e){var t=this._keyBindings[e],n=this._onKeyBindingEvent.bind(this,t);this._boundKeyHandlers.push([this.keyEventTarget,e,n]),this.keyEventTarget.addEventListener(e,n)},this)},_unlistenKeyEventListeners:function(){for(var e,t,n,i;this._boundKeyHandlers.length;)t=(e=this._boundKeyHandlers.pop())[0],n=e[1],i=e[2],t.removeEventListener(n,i)},_onKeyBindingEvent:function(e,t){if(this.stopKeyboardEventPropagation&&t.stopPropagation(),!t.defaultPrevented)for(var n=0;n<e.length;n++){var i=e[n][0],s=e[n][1];if(r(i,t)&&(this._triggerKeyHandler(i,s,t),t.defaultPrevented))return}},_triggerKeyHandler:function(e,t,n){var i=Object.create(e);i.keyboardEvent=n;var r=new CustomEvent(e.event,{detail:i,cancelable:!0});this[t].call(this,r),r.defaultPrevented&&n.preventDefault()}}}();</script><script>Polymer.IronControlState={properties:{focused:{type:Boolean,value:!1,notify:!0,readOnly:!0,reflectToAttribute:!0},disabled:{type:Boolean,value:!1,notify:!0,observer:"_disabledChanged",reflectToAttribute:!0},_oldTabIndex:{type:Number},_boundFocusBlurHandler:{type:Function,value:function(){return this._focusBlurHandler.bind(this)}},__handleEventRetargeting:{type:Boolean,value:function(){return!this.shadowRoot&&!Polymer.Element}}},observers:["_changedControlState(focused, disabled)"],ready:function(){this.addEventListener("focus",this._boundFocusBlurHandler,!0),this.addEventListener("blur",this._boundFocusBlurHandler,!0)},_focusBlurHandler:function(e){if(Polymer.Element)this._setFocused("focus"===e.type);else if(e.target===this)this._setFocused("focus"===e.type);else if(this.__handleEventRetargeting){var t=Polymer.dom(e).localTarget;this.isLightDescendant(t)||this.fire(e.type,{sourceEvent:e},{node:this,bubbles:e.bubbles,cancelable:e.cancelable})}},_disabledChanged:function(e,t){this.setAttribute("aria-disabled",e?"true":"false"),this.style.pointerEvents=e?"none":"",e?(this._oldTabIndex=this.tabIndex,this._setFocused(!1),this.tabIndex=-1,this.blur()):void 0!==this._oldTabIndex&&(this.tabIndex=this._oldTabIndex)},_changedControlState:function(){this._controlStateChanged&&this._controlStateChanged()}};</script><script>Polymer.IronButtonStateImpl={properties:{pressed:{type:Boolean,readOnly:!0,value:!1,reflectToAttribute:!0,observer:"_pressedChanged"},toggles:{type:Boolean,value:!1,reflectToAttribute:!0},active:{type:Boolean,value:!1,notify:!0,reflectToAttribute:!0},pointerDown:{type:Boolean,readOnly:!0,value:!1},receivedFocusFromKeyboard:{type:Boolean,readOnly:!0},ariaActiveAttribute:{type:String,value:"aria-pressed",observer:"_ariaActiveAttributeChanged"}},listeners:{down:"_downHandler",up:"_upHandler",tap:"_tapHandler"},observers:["_focusChanged(focused)","_activeChanged(active, ariaActiveAttribute)"],keyBindings:{"enter:keydown":"_asyncClick","space:keydown":"_spaceKeyDownHandler","space:keyup":"_spaceKeyUpHandler"},_mouseEventRe:/^mouse/,_tapHandler:function(){this.toggles?this._userActivate(!this.active):this.active=!1},_focusChanged:function(e){this._detectKeyboardFocus(e),e||this._setPressed(!1)},_detectKeyboardFocus:function(e){this._setReceivedFocusFromKeyboard(!this.pointerDown&&e)},_userActivate:function(e){this.active!==e&&(this.active=e,this.fire("change"))},_downHandler:function(e){this._setPointerDown(!0),this._setPressed(!0),this._setReceivedFocusFromKeyboard(!1)},_upHandler:function(){this._setPointerDown(!1),this._setPressed(!1)},_spaceKeyDownHandler:function(e){var t=e.detail.keyboardEvent,i=Polymer.dom(t).localTarget;this.isLightDescendant(i)||(t.preventDefault(),t.stopImmediatePropagation(),this._setPressed(!0))},_spaceKeyUpHandler:function(e){var t=e.detail.keyboardEvent,i=Polymer.dom(t).localTarget;this.isLightDescendant(i)||(this.pressed&&this._asyncClick(),this._setPressed(!1))},_asyncClick:function(){this.async(function(){this.click()},1)},_pressedChanged:function(e){this._changedButtonState()},_ariaActiveAttributeChanged:function(e,t){t&&t!=e&&this.hasAttribute(t)&&this.removeAttribute(t)},_activeChanged:function(e,t){this.toggles?this.setAttribute(this.ariaActiveAttribute,e?"true":"false"):this.removeAttribute(this.ariaActiveAttribute),this._changedButtonState()},_controlStateChanged:function(){this.disabled?this._setPressed(!1):this._changedButtonState()},_changedButtonState:function(){this._buttonStateChanged&&this._buttonStateChanged()}},Polymer.IronButtonState=[Polymer.IronA11yKeysBehavior,Polymer.IronButtonStateImpl];</script><dom-module id="paper-ripple" assetpath="../bower_components/paper-ripple/"><template><style>:host{display:block;position:absolute;border-radius:inherit;overflow:hidden;top:0;left:0;right:0;bottom:0;pointer-events:none;}:host([animating]){-webkit-transform:translate(0, 0);transform:translate3d(0, 0, 0);}#background,
       #waves,
       .wave-container,
       .wave{pointer-events:none;position:absolute;top:0;left:0;width:100%;height:100%;}#background,
       .wave{opacity:0;}#waves,
       .wave{overflow:hidden;}.wave-container,
       .wave{border-radius:50%;}:host(.circle) #background,
-      :host(.circle) #waves{border-radius:50%;}:host(.circle) .wave-container{overflow:hidden;}</style><div id="background"></div><div id="waves"></div></template></dom-module><script>!function(){"use strict";function t(t){this.element=t,this.width=this.boundingRect.width,this.height=this.boundingRect.height,this.size=Math.max(this.width,this.height)}function i(t){this.element=t,this.color=window.getComputedStyle(t).color,this.wave=document.createElement("div"),this.waveContainer=document.createElement("div"),this.wave.style.backgroundColor=this.color,this.wave.classList.add("wave"),this.waveContainer.classList.add("wave-container"),Polymer.dom(this.waveContainer).appendChild(this.wave),this.resetInteractionState()}var e={distance:function(t,i,e,n){var s=t-e,a=i-n;return Math.sqrt(s*s+a*a)},now:window.performance&&window.performance.now?window.performance.now.bind(window.performance):Date.now};t.prototype={get boundingRect(){return this.element.getBoundingClientRect()},furthestCornerDistanceFrom:function(t,i){var n=e.distance(t,i,0,0),s=e.distance(t,i,this.width,0),a=e.distance(t,i,0,this.height),o=e.distance(t,i,this.width,this.height);return Math.max(n,s,a,o)}},i.MAX_RADIUS=300,i.prototype={get recenters(){return this.element.recenters},get center(){return this.element.center},get mouseDownElapsed(){var t;return this.mouseDownStart?(t=e.now()-this.mouseDownStart,this.mouseUpStart&&(t-=this.mouseUpElapsed),t):0},get mouseUpElapsed(){return this.mouseUpStart?e.now()-this.mouseUpStart:0},get mouseDownElapsedSeconds(){return this.mouseDownElapsed/1e3},get mouseUpElapsedSeconds(){return this.mouseUpElapsed/1e3},get mouseInteractionSeconds(){return this.mouseDownElapsedSeconds+this.mouseUpElapsedSeconds},get initialOpacity(){return this.element.initialOpacity},get opacityDecayVelocity(){return this.element.opacityDecayVelocity},get radius(){var t=this.containerMetrics.width*this.containerMetrics.width,e=this.containerMetrics.height*this.containerMetrics.height,n=1.1*Math.min(Math.sqrt(t+e),i.MAX_RADIUS)+5,s=1.1-n/i.MAX_RADIUS*.2,a=this.mouseInteractionSeconds/s,o=n*(1-Math.pow(80,-a));return Math.abs(o)},get opacity(){return this.mouseUpStart?Math.max(0,this.initialOpacity-this.mouseUpElapsedSeconds*this.opacityDecayVelocity):this.initialOpacity},get outerOpacity(){var t=.3*this.mouseUpElapsedSeconds,i=this.opacity;return Math.max(0,Math.min(t,i))},get isOpacityFullyDecayed(){return this.opacity<.01&&this.radius>=Math.min(this.maxRadius,i.MAX_RADIUS)},get isRestingAtMaxRadius(){return this.opacity>=this.initialOpacity&&this.radius>=Math.min(this.maxRadius,i.MAX_RADIUS)},get isAnimationComplete(){return this.mouseUpStart?this.isOpacityFullyDecayed:this.isRestingAtMaxRadius},get translationFraction(){return Math.min(1,this.radius/this.containerMetrics.size*2/Math.sqrt(2))},get xNow(){return this.xEnd?this.xStart+this.translationFraction*(this.xEnd-this.xStart):this.xStart},get yNow(){return this.yEnd?this.yStart+this.translationFraction*(this.yEnd-this.yStart):this.yStart},get isMouseDown(){return this.mouseDownStart&&!this.mouseUpStart},resetInteractionState:function(){this.maxRadius=0,this.mouseDownStart=0,this.mouseUpStart=0,this.xStart=0,this.yStart=0,this.xEnd=0,this.yEnd=0,this.slideDistance=0,this.containerMetrics=new t(this.element)},draw:function(){var t,i,e;this.wave.style.opacity=this.opacity,t=this.radius/(this.containerMetrics.size/2),i=this.xNow-this.containerMetrics.width/2,e=this.yNow-this.containerMetrics.height/2,this.waveContainer.style.webkitTransform="translate("+i+"px, "+e+"px)",this.waveContainer.style.transform="translate3d("+i+"px, "+e+"px, 0)",this.wave.style.webkitTransform="scale("+t+","+t+")",this.wave.style.transform="scale3d("+t+","+t+",1)"},downAction:function(t){var i=this.containerMetrics.width/2,n=this.containerMetrics.height/2;this.resetInteractionState(),this.mouseDownStart=e.now(),this.center?(this.xStart=i,this.yStart=n,this.slideDistance=e.distance(this.xStart,this.yStart,this.xEnd,this.yEnd)):(this.xStart=t?t.detail.x-this.containerMetrics.boundingRect.left:this.containerMetrics.width/2,this.yStart=t?t.detail.y-this.containerMetrics.boundingRect.top:this.containerMetrics.height/2),this.recenters&&(this.xEnd=i,this.yEnd=n,this.slideDistance=e.distance(this.xStart,this.yStart,this.xEnd,this.yEnd)),this.maxRadius=this.containerMetrics.furthestCornerDistanceFrom(this.xStart,this.yStart),this.waveContainer.style.top=(this.containerMetrics.height-this.containerMetrics.size)/2+"px",this.waveContainer.style.left=(this.containerMetrics.width-this.containerMetrics.size)/2+"px",this.waveContainer.style.width=this.containerMetrics.size+"px",this.waveContainer.style.height=this.containerMetrics.size+"px"},upAction:function(t){this.isMouseDown&&(this.mouseUpStart=e.now())},remove:function(){Polymer.dom(this.waveContainer.parentNode).removeChild(this.waveContainer)}},Polymer({is:"paper-ripple",behaviors:[Polymer.IronA11yKeysBehavior],properties:{initialOpacity:{type:Number,value:.25},opacityDecayVelocity:{type:Number,value:.8},recenters:{type:Boolean,value:!1},center:{type:Boolean,value:!1},ripples:{type:Array,value:function(){return[]}},animating:{type:Boolean,readOnly:!0,reflectToAttribute:!0,value:!1},holdDown:{type:Boolean,value:!1,observer:"_holdDownChanged"},noink:{type:Boolean,value:!1},_animating:{type:Boolean},_boundAnimate:{type:Function,value:function(){return this.animate.bind(this)}}},get target(){return this.keyEventTarget},keyBindings:{"enter:keydown":"_onEnterKeydown","space:keydown":"_onSpaceKeydown","space:keyup":"_onSpaceKeyup"},attached:function(){11==this.parentNode.nodeType?this.keyEventTarget=Polymer.dom(this).getOwnerRoot().host:this.keyEventTarget=this.parentNode;var t=this.keyEventTarget;this.listen(t,"up","uiUpAction"),this.listen(t,"down","uiDownAction")},detached:function(){this.unlisten(this.keyEventTarget,"up","uiUpAction"),this.unlisten(this.keyEventTarget,"down","uiDownAction"),this.keyEventTarget=null},get shouldKeepAnimating(){for(var t=this,i=0;i<this.ripples.length;++i)if(!t.ripples[i].isAnimationComplete)return!0;return!1},simulatedRipple:function(){this.downAction(null),this.async(function(){this.upAction()},1)},uiDownAction:function(t){this.noink||this.downAction(t)},downAction:function(t){this.holdDown&&this.ripples.length>0||(this.addRipple().downAction(t),this._animating||(this._animating=!0,this.animate()))},uiUpAction:function(t){this.noink||this.upAction(t)},upAction:function(t){this.holdDown||(this.ripples.forEach(function(i){i.upAction(t)}),this._animating=!0,this.animate())},onAnimationComplete:function(){this._animating=!1,this.$.background.style.backgroundColor=null,this.fire("transitionend")},addRipple:function(){var t=new i(this);return Polymer.dom(this.$.waves).appendChild(t.waveContainer),this.$.background.style.backgroundColor=t.color,this.ripples.push(t),this._setAnimating(!0),t},removeRipple:function(t){var i=this.ripples.indexOf(t);i<0||(this.ripples.splice(i,1),t.remove(),this.ripples.length||this._setAnimating(!1))},animate:function(){var t=this;if(this._animating){var i,e;for(i=0;i<this.ripples.length;++i)(e=t.ripples[i]).draw(),t.$.background.style.opacity=e.outerOpacity,e.isOpacityFullyDecayed&&!e.isRestingAtMaxRadius&&t.removeRipple(e);this.shouldKeepAnimating||0!==this.ripples.length?window.requestAnimationFrame(this._boundAnimate):this.onAnimationComplete()}},_onEnterKeydown:function(){this.uiDownAction(),this.async(this.uiUpAction,1)},_onSpaceKeydown:function(){this.uiDownAction()},_onSpaceKeyup:function(){this.uiUpAction()},_holdDownChanged:function(t,i){void 0!==i&&(t?this.downAction():this.upAction())}})}();</script><script>Polymer.PaperRippleBehavior={properties:{noink:{type:Boolean,observer:"_noinkChanged"},_rippleContainer:{type:Object}},_buttonStateChanged:function(){this.focused&&this.ensureRipple()},_downHandler:function(e){Polymer.IronButtonStateImpl._downHandler.call(this,e),this.pressed&&this.ensureRipple(e)},ensureRipple:function(e){if(!this.hasRipple()){this._ripple=this._createRipple(),this._ripple.noink=this.noink;var i=this._rippleContainer||this.root;if(i&&Polymer.dom(i).appendChild(this._ripple),e){var n=Polymer.dom(this._rippleContainer||this),t=Polymer.dom(e).rootTarget;n.deepContains(t)&&this._ripple.uiDownAction(e)}}},getRipple:function(){return this.ensureRipple(),this._ripple},hasRipple:function(){return Boolean(this._ripple)},_createRipple:function(){return document.createElement("paper-ripple")},_noinkChanged:function(e){this.hasRipple()&&(this._ripple.noink=e)}};</script><script>Polymer.PaperInkyFocusBehaviorImpl={observers:["_focusedChanged(receivedFocusFromKeyboard)"],_focusedChanged:function(e){e&&this.ensureRipple(),this.hasRipple()&&(this._ripple.holdDown=e)},_createRipple:function(){var e=Polymer.PaperRippleBehavior._createRipple();return e.id="ink",e.setAttribute("center",""),e.classList.add("circle"),e}},Polymer.PaperInkyFocusBehavior=[Polymer.IronButtonState,Polymer.IronControlState,Polymer.PaperRippleBehavior,Polymer.PaperInkyFocusBehaviorImpl];</script><script>Polymer.PaperCheckedElementBehaviorImpl={_checkedChanged:function(){Polymer.IronCheckedElementBehaviorImpl._checkedChanged.call(this),this.hasRipple()&&(this.checked?this._ripple.setAttribute("checked",""):this._ripple.removeAttribute("checked"))},_buttonStateChanged:function(){Polymer.PaperRippleBehavior._buttonStateChanged.call(this),this.disabled||this.isAttached&&(this.checked=this.active)}},Polymer.PaperCheckedElementBehavior=[Polymer.PaperInkyFocusBehavior,Polymer.IronCheckedElementBehavior,Polymer.PaperCheckedElementBehaviorImpl];</script><dom-module id="paper-checkbox" assetpath="../bower_components/paper-checkbox/"><template strip-whitespace=""><style>:host{display:inline-block;white-space:nowrap;cursor:pointer;--calculated-paper-checkbox-size:var(--paper-checkbox-size, 18px);--calculated-paper-checkbox-ink-size:var(--paper-checkbox-ink-size, -1px);@apply --paper-font-common-base;line-height:0;-webkit-tap-highlight-color:transparent;}:host([hidden]){display:none !important;}:host(:focus){outline:none;}.hidden{display:none;}#checkboxContainer{display:inline-block;position:relative;width:var(--calculated-paper-checkbox-size);height:var(--calculated-paper-checkbox-size);min-width:var(--calculated-paper-checkbox-size);margin:var(--paper-checkbox-margin, initial);vertical-align:var(--paper-checkbox-vertical-align, middle);background-color:var(--paper-checkbox-unchecked-background-color, transparent);}#ink{position:absolute;top:calc(0px - (var(--calculated-paper-checkbox-ink-size) - var(--calculated-paper-checkbox-size)) / 2);left:calc(0px - (var(--calculated-paper-checkbox-ink-size) - var(--calculated-paper-checkbox-size)) / 2);width:var(--calculated-paper-checkbox-ink-size);height:var(--calculated-paper-checkbox-ink-size);color:var(--paper-checkbox-unchecked-ink-color, var(--primary-text-color));opacity:0.6;pointer-events:none;}:host-context([dir="rtl"]) #ink{right:calc(0px - (var(--calculated-paper-checkbox-ink-size) - var(--calculated-paper-checkbox-size)) / 2);left:auto;}#ink[checked]{color:var(--paper-checkbox-checked-ink-color, var(--primary-color));}#checkbox{position:relative;box-sizing:border-box;height:100%;border:solid 2px;border-color:var(--paper-checkbox-unchecked-color, var(--primary-text-color));border-radius:2px;pointer-events:none;-webkit-transition:background-color 140ms, border-color 140ms;transition:background-color 140ms, border-color 140ms;}#checkbox.checked #checkmark{-webkit-animation:checkmark-expand 140ms ease-out forwards;animation:checkmark-expand 140ms ease-out forwards;}@-webkit-keyframes checkmark-expand{0%{-webkit-transform:scale(0, 0) rotate(45deg);}100%{-webkit-transform:scale(1, 1) rotate(45deg);}}@keyframes checkmark-expand{0%{transform:scale(0, 0) rotate(45deg);}100%{transform:scale(1, 1) rotate(45deg);}}#checkbox.checked{background-color:var(--paper-checkbox-checked-color, var(--primary-color));border-color:var(--paper-checkbox-checked-color, var(--primary-color));}#checkmark{position:absolute;width:36%;height:70%;border-style:solid;border-top:none;border-left:none;border-right-width:calc(2/15 * var(--calculated-paper-checkbox-size));border-bottom-width:calc(2/15 * var(--calculated-paper-checkbox-size));border-color:var(--paper-checkbox-checkmark-color, white);-webkit-transform-origin:97% 86%;transform-origin:97% 86%;box-sizing:content-box;}:host-context([dir="rtl"]) #checkmark{-webkit-transform-origin:50% 14%;transform-origin:50% 14%;}#checkboxLabel{position:relative;display:inline-block;vertical-align:middle;padding-left:var(--paper-checkbox-label-spacing, 8px);white-space:normal;line-height:normal;color:var(--paper-checkbox-label-color, var(--primary-text-color));@apply --paper-checkbox-label;}:host([checked]) #checkboxLabel{color:var(--paper-checkbox-label-checked-color, var(--paper-checkbox-label-color, var(--primary-text-color)));@apply --paper-checkbox-label-checked;}:host-context([dir="rtl"]) #checkboxLabel{padding-right:var(--paper-checkbox-label-spacing, 8px);padding-left:0;}#checkboxLabel[hidden]{display:none;}:host([disabled]) #checkbox{opacity:0.5;border-color:var(--paper-checkbox-unchecked-color, var(--primary-text-color));}:host([disabled][checked]) #checkbox{background-color:var(--paper-checkbox-unchecked-color, var(--primary-text-color));opacity:0.5;}:host([disabled]) #checkboxLabel{opacity:0.65;}#checkbox.invalid:not(.checked){border-color:var(--paper-checkbox-error-color, var(--error-color));}</style><div id="checkboxContainer"><div id="checkbox" class$="[[_computeCheckboxClass(checked, invalid)]]"><div id="checkmark" class$="[[_computeCheckmarkClass(checked)]]"></div></div></div><div id="checkboxLabel"><slot></slot></div></template><script>Polymer({is:"paper-checkbox",behaviors:[Polymer.PaperCheckedElementBehavior],hostAttributes:{role:"checkbox","aria-checked":!1,tabindex:0},properties:{ariaActiveAttribute:{type:String,value:"aria-checked"}},attached:function(){Polymer.RenderStatus.afterNextRender(this,function(){if("-1px"===this.getComputedStyleValue("--calculated-paper-checkbox-ink-size").trim()){var e=this.getComputedStyleValue("--calculated-paper-checkbox-size").trim(),t=e.match(/[A-Za-z]+$/)[0]||"px",a=parseFloat(e,10),r=8/3*a;"px"===t&&(r=Math.floor(r))%2!=a%2&&r++,this.updateStyles({"--paper-checkbox-ink-size":r+t})}})},_computeCheckboxClass:function(e,t){var a="";return e&&(a+="checked "),t&&(a+="invalid"),a},_computeCheckmarkClass:function(e){return e?"":"hidden"},_createRipple:function(){return this._rippleContainer=this.$.checkboxContainer,Polymer.PaperInkyFocusBehaviorImpl._createRipple.call(this)}});</script></dom-module><custom-style><style is="custom-style">html{--layout:{display:-ms-flexbox;display:-webkit-flex;display:flex;};--layout-inline:{display:-ms-inline-flexbox;display:-webkit-inline-flex;display:inline-flex;};--layout-horizontal:{@apply --layout;-ms-flex-direction:row;-webkit-flex-direction:row;flex-direction:row;};--layout-horizontal-reverse:{@apply --layout;-ms-flex-direction:row-reverse;-webkit-flex-direction:row-reverse;flex-direction:row-reverse;};--layout-vertical:{@apply --layout;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column;};--layout-vertical-reverse:{@apply --layout;-ms-flex-direction:column-reverse;-webkit-flex-direction:column-reverse;flex-direction:column-reverse;};--layout-wrap:{-ms-flex-wrap:wrap;-webkit-flex-wrap:wrap;flex-wrap:wrap;};--layout-wrap-reverse:{-ms-flex-wrap:wrap-reverse;-webkit-flex-wrap:wrap-reverse;flex-wrap:wrap-reverse;};--layout-flex-auto:{-ms-flex:1 1 auto;-webkit-flex:1 1 auto;flex:1 1 auto;};--layout-flex-none:{-ms-flex:none;-webkit-flex:none;flex:none;};--layout-flex:{-ms-flex:1 1 0.000000001px;-webkit-flex:1;flex:1;-webkit-flex-basis:0.000000001px;flex-basis:0.000000001px;};--layout-flex-2:{-ms-flex:2;-webkit-flex:2;flex:2;};--layout-flex-3:{-ms-flex:3;-webkit-flex:3;flex:3;};--layout-flex-4:{-ms-flex:4;-webkit-flex:4;flex:4;};--layout-flex-5:{-ms-flex:5;-webkit-flex:5;flex:5;};--layout-flex-6:{-ms-flex:6;-webkit-flex:6;flex:6;};--layout-flex-7:{-ms-flex:7;-webkit-flex:7;flex:7;};--layout-flex-8:{-ms-flex:8;-webkit-flex:8;flex:8;};--layout-flex-9:{-ms-flex:9;-webkit-flex:9;flex:9;};--layout-flex-10:{-ms-flex:10;-webkit-flex:10;flex:10;};--layout-flex-11:{-ms-flex:11;-webkit-flex:11;flex:11;};--layout-flex-12:{-ms-flex:12;-webkit-flex:12;flex:12;};--layout-start:{-ms-flex-align:start;-webkit-align-items:flex-start;align-items:flex-start;};--layout-center:{-ms-flex-align:center;-webkit-align-items:center;align-items:center;};--layout-end:{-ms-flex-align:end;-webkit-align-items:flex-end;align-items:flex-end;};--layout-baseline:{-ms-flex-align:baseline;-webkit-align-items:baseline;align-items:baseline;};--layout-start-justified:{-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;};--layout-center-justified:{-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;};--layout-end-justified:{-ms-flex-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end;};--layout-around-justified:{-ms-flex-pack:distribute;-webkit-justify-content:space-around;justify-content:space-around;};--layout-justified:{-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;};--layout-center-center:{@apply --layout-center;@apply --layout-center-justified;};--layout-self-start:{-ms-align-self:flex-start;-webkit-align-self:flex-start;align-self:flex-start;};--layout-self-center:{-ms-align-self:center;-webkit-align-self:center;align-self:center;};--layout-self-end:{-ms-align-self:flex-end;-webkit-align-self:flex-end;align-self:flex-end;};--layout-self-stretch:{-ms-align-self:stretch;-webkit-align-self:stretch;align-self:stretch;};--layout-self-baseline:{-ms-align-self:baseline;-webkit-align-self:baseline;align-self:baseline;};--layout-start-aligned:{-ms-flex-line-pack:start;-ms-align-content:flex-start;-webkit-align-content:flex-start;align-content:flex-start;};--layout-end-aligned:{-ms-flex-line-pack:end;-ms-align-content:flex-end;-webkit-align-content:flex-end;align-content:flex-end;};--layout-center-aligned:{-ms-flex-line-pack:center;-ms-align-content:center;-webkit-align-content:center;align-content:center;};--layout-between-aligned:{-ms-flex-line-pack:justify;-ms-align-content:space-between;-webkit-align-content:space-between;align-content:space-between;};--layout-around-aligned:{-ms-flex-line-pack:distribute;-ms-align-content:space-around;-webkit-align-content:space-around;align-content:space-around;};--layout-block:{display:block;};--layout-invisible:{visibility:hidden !important;};--layout-relative:{position:relative;};--layout-fit:{position:absolute;top:0;right:0;bottom:0;left:0;};--layout-scroll:{-webkit-overflow-scrolling:touch;overflow:auto;};--layout-fullbleed:{margin:0;height:100vh;};--layout-fixed-top:{position:fixed;top:0;left:0;right:0;};--layout-fixed-right:{position:fixed;top:0;right:0;bottom:0;};--layout-fixed-bottom:{position:fixed;right:0;bottom:0;left:0;};--layout-fixed-left:{position:fixed;top:0;bottom:0;left:0;};}</style></custom-style><script>Polymer.PaperButtonBehaviorImpl={properties:{elevation:{type:Number,reflectToAttribute:!0,readOnly:!0}},observers:["_calculateElevation(focused, disabled, active, pressed, receivedFocusFromKeyboard)","_computeKeyboardClass(receivedFocusFromKeyboard)"],hostAttributes:{role:"button",tabindex:"0",animated:!0},_calculateElevation:function(){var e=1;this.disabled?e=0:this.active||this.pressed?e=4:this.receivedFocusFromKeyboard&&(e=3),this._setElevation(e)},_computeKeyboardClass:function(e){this.toggleClass("keyboard-focus",e)},_spaceKeyDownHandler:function(e){Polymer.IronButtonStateImpl._spaceKeyDownHandler.call(this,e),this.hasRipple()&&this.getRipple().ripples.length<1&&this._ripple.uiDownAction()},_spaceKeyUpHandler:function(e){Polymer.IronButtonStateImpl._spaceKeyUpHandler.call(this,e),this.hasRipple()&&this._ripple.uiUpAction()}},Polymer.PaperButtonBehavior=[Polymer.IronButtonState,Polymer.IronControlState,Polymer.PaperRippleBehavior,Polymer.PaperButtonBehaviorImpl];</script><custom-style><style is="custom-style">html{--shadow-transition:{transition:box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);};--shadow-none:{box-shadow:none;};--shadow-elevation-2dp:{box-shadow:0 2px 2px 0 rgba(0, 0, 0, 0.14),
+      :host(.circle) #waves{border-radius:50%;}:host(.circle) .wave-container{overflow:hidden;}</style><div id="background"></div><div id="waves"></div></template></dom-module><script>!function(){"use strict";function t(t){this.element=t,this.width=this.boundingRect.width,this.height=this.boundingRect.height,this.size=Math.max(this.width,this.height)}function i(t){this.element=t,this.color=window.getComputedStyle(t).color,this.wave=document.createElement("div"),this.waveContainer=document.createElement("div"),this.wave.style.backgroundColor=this.color,this.wave.classList.add("wave"),this.waveContainer.classList.add("wave-container"),Polymer.dom(this.waveContainer).appendChild(this.wave),this.resetInteractionState()}var e={distance:function(t,i,e,n){var s=t-e,a=i-n;return Math.sqrt(s*s+a*a)},now:window.performance&&window.performance.now?window.performance.now.bind(window.performance):Date.now};t.prototype={get boundingRect(){return this.element.getBoundingClientRect()},furthestCornerDistanceFrom:function(t,i){var n=e.distance(t,i,0,0),s=e.distance(t,i,this.width,0),a=e.distance(t,i,0,this.height),o=e.distance(t,i,this.width,this.height);return Math.max(n,s,a,o)}},i.MAX_RADIUS=300,i.prototype={get recenters(){return this.element.recenters},get center(){return this.element.center},get mouseDownElapsed(){var t;return this.mouseDownStart?(t=e.now()-this.mouseDownStart,this.mouseUpStart&&(t-=this.mouseUpElapsed),t):0},get mouseUpElapsed(){return this.mouseUpStart?e.now()-this.mouseUpStart:0},get mouseDownElapsedSeconds(){return this.mouseDownElapsed/1e3},get mouseUpElapsedSeconds(){return this.mouseUpElapsed/1e3},get mouseInteractionSeconds(){return this.mouseDownElapsedSeconds+this.mouseUpElapsedSeconds},get initialOpacity(){return this.element.initialOpacity},get opacityDecayVelocity(){return this.element.opacityDecayVelocity},get radius(){var t=this.containerMetrics.width*this.containerMetrics.width,e=this.containerMetrics.height*this.containerMetrics.height,n=1.1*Math.min(Math.sqrt(t+e),i.MAX_RADIUS)+5,s=1.1-n/i.MAX_RADIUS*.2,a=this.mouseInteractionSeconds/s,o=n*(1-Math.pow(80,-a));return Math.abs(o)},get opacity(){return this.mouseUpStart?Math.max(0,this.initialOpacity-this.mouseUpElapsedSeconds*this.opacityDecayVelocity):this.initialOpacity},get outerOpacity(){var t=.3*this.mouseUpElapsedSeconds,i=this.opacity;return Math.max(0,Math.min(t,i))},get isOpacityFullyDecayed(){return this.opacity<.01&&this.radius>=Math.min(this.maxRadius,i.MAX_RADIUS)},get isRestingAtMaxRadius(){return this.opacity>=this.initialOpacity&&this.radius>=Math.min(this.maxRadius,i.MAX_RADIUS)},get isAnimationComplete(){return this.mouseUpStart?this.isOpacityFullyDecayed:this.isRestingAtMaxRadius},get translationFraction(){return Math.min(1,this.radius/this.containerMetrics.size*2/Math.sqrt(2))},get xNow(){return this.xEnd?this.xStart+this.translationFraction*(this.xEnd-this.xStart):this.xStart},get yNow(){return this.yEnd?this.yStart+this.translationFraction*(this.yEnd-this.yStart):this.yStart},get isMouseDown(){return this.mouseDownStart&&!this.mouseUpStart},resetInteractionState:function(){this.maxRadius=0,this.mouseDownStart=0,this.mouseUpStart=0,this.xStart=0,this.yStart=0,this.xEnd=0,this.yEnd=0,this.slideDistance=0,this.containerMetrics=new t(this.element)},draw:function(){var t,i,e;this.wave.style.opacity=this.opacity,t=this.radius/(this.containerMetrics.size/2),i=this.xNow-this.containerMetrics.width/2,e=this.yNow-this.containerMetrics.height/2,this.waveContainer.style.webkitTransform="translate("+i+"px, "+e+"px)",this.waveContainer.style.transform="translate3d("+i+"px, "+e+"px, 0)",this.wave.style.webkitTransform="scale("+t+","+t+")",this.wave.style.transform="scale3d("+t+","+t+",1)"},downAction:function(t){var i=this.containerMetrics.width/2,n=this.containerMetrics.height/2;this.resetInteractionState(),this.mouseDownStart=e.now(),this.center?(this.xStart=i,this.yStart=n,this.slideDistance=e.distance(this.xStart,this.yStart,this.xEnd,this.yEnd)):(this.xStart=t?t.detail.x-this.containerMetrics.boundingRect.left:this.containerMetrics.width/2,this.yStart=t?t.detail.y-this.containerMetrics.boundingRect.top:this.containerMetrics.height/2),this.recenters&&(this.xEnd=i,this.yEnd=n,this.slideDistance=e.distance(this.xStart,this.yStart,this.xEnd,this.yEnd)),this.maxRadius=this.containerMetrics.furthestCornerDistanceFrom(this.xStart,this.yStart),this.waveContainer.style.top=(this.containerMetrics.height-this.containerMetrics.size)/2+"px",this.waveContainer.style.left=(this.containerMetrics.width-this.containerMetrics.size)/2+"px",this.waveContainer.style.width=this.containerMetrics.size+"px",this.waveContainer.style.height=this.containerMetrics.size+"px"},upAction:function(t){this.isMouseDown&&(this.mouseUpStart=e.now())},remove:function(){Polymer.dom(this.waveContainer.parentNode).removeChild(this.waveContainer)}},Polymer({is:"paper-ripple",behaviors:[Polymer.IronA11yKeysBehavior],properties:{initialOpacity:{type:Number,value:.25},opacityDecayVelocity:{type:Number,value:.8},recenters:{type:Boolean,value:!1},center:{type:Boolean,value:!1},ripples:{type:Array,value:function(){return[]}},animating:{type:Boolean,readOnly:!0,reflectToAttribute:!0,value:!1},holdDown:{type:Boolean,value:!1,observer:"_holdDownChanged"},noink:{type:Boolean,value:!1},_animating:{type:Boolean},_boundAnimate:{type:Function,value:function(){return this.animate.bind(this)}}},get target(){return this.keyEventTarget},keyBindings:{"enter:keydown":"_onEnterKeydown","space:keydown":"_onSpaceKeydown","space:keyup":"_onSpaceKeyup"},attached:function(){11==this.parentNode.nodeType?this.keyEventTarget=Polymer.dom(this).getOwnerRoot().host:this.keyEventTarget=this.parentNode;var t=this.keyEventTarget;this.listen(t,"up","uiUpAction"),this.listen(t,"down","uiDownAction")},detached:function(){this.unlisten(this.keyEventTarget,"up","uiUpAction"),this.unlisten(this.keyEventTarget,"down","uiDownAction"),this.keyEventTarget=null},get shouldKeepAnimating(){for(var t=0;t<this.ripples.length;++t)if(!this.ripples[t].isAnimationComplete)return!0;return!1},simulatedRipple:function(){this.downAction(null),this.async(function(){this.upAction()},1)},uiDownAction:function(t){this.noink||this.downAction(t)},downAction:function(t){this.holdDown&&this.ripples.length>0||(this.addRipple().downAction(t),this._animating||(this._animating=!0,this.animate()))},uiUpAction:function(t){this.noink||this.upAction(t)},upAction:function(t){this.holdDown||(this.ripples.forEach(function(i){i.upAction(t)}),this._animating=!0,this.animate())},onAnimationComplete:function(){this._animating=!1,this.$.background.style.backgroundColor=null,this.fire("transitionend")},addRipple:function(){var t=new i(this);return Polymer.dom(this.$.waves).appendChild(t.waveContainer),this.$.background.style.backgroundColor=t.color,this.ripples.push(t),this._setAnimating(!0),t},removeRipple:function(t){var i=this.ripples.indexOf(t);i<0||(this.ripples.splice(i,1),t.remove(),this.ripples.length||this._setAnimating(!1))},animate:function(){if(this._animating){var t,i;for(t=0;t<this.ripples.length;++t)(i=this.ripples[t]).draw(),this.$.background.style.opacity=i.outerOpacity,i.isOpacityFullyDecayed&&!i.isRestingAtMaxRadius&&this.removeRipple(i);this.shouldKeepAnimating||0!==this.ripples.length?window.requestAnimationFrame(this._boundAnimate):this.onAnimationComplete()}},_onEnterKeydown:function(){this.uiDownAction(),this.async(this.uiUpAction,1)},_onSpaceKeydown:function(){this.uiDownAction()},_onSpaceKeyup:function(){this.uiUpAction()},_holdDownChanged:function(t,i){void 0!==i&&(t?this.downAction():this.upAction())}})}();</script><script>Polymer.PaperRippleBehavior={properties:{noink:{type:Boolean,observer:"_noinkChanged"},_rippleContainer:{type:Object}},_buttonStateChanged:function(){this.focused&&this.ensureRipple()},_downHandler:function(e){Polymer.IronButtonStateImpl._downHandler.call(this,e),this.pressed&&this.ensureRipple(e)},ensureRipple:function(e){if(!this.hasRipple()){this._ripple=this._createRipple(),this._ripple.noink=this.noink;var i=this._rippleContainer||this.root;if(i&&Polymer.dom(i).appendChild(this._ripple),e){var n=Polymer.dom(this._rippleContainer||this),t=Polymer.dom(e).rootTarget;n.deepContains(t)&&this._ripple.uiDownAction(e)}}},getRipple:function(){return this.ensureRipple(),this._ripple},hasRipple:function(){return Boolean(this._ripple)},_createRipple:function(){return document.createElement("paper-ripple")},_noinkChanged:function(e){this.hasRipple()&&(this._ripple.noink=e)}};</script><script>Polymer.PaperInkyFocusBehaviorImpl={observers:["_focusedChanged(receivedFocusFromKeyboard)"],_focusedChanged:function(e){e&&this.ensureRipple(),this.hasRipple()&&(this._ripple.holdDown=e)},_createRipple:function(){var e=Polymer.PaperRippleBehavior._createRipple();return e.id="ink",e.setAttribute("center",""),e.classList.add("circle"),e}},Polymer.PaperInkyFocusBehavior=[Polymer.IronButtonState,Polymer.IronControlState,Polymer.PaperRippleBehavior,Polymer.PaperInkyFocusBehaviorImpl];</script><script>Polymer.PaperCheckedElementBehaviorImpl={_checkedChanged:function(){Polymer.IronCheckedElementBehaviorImpl._checkedChanged.call(this),this.hasRipple()&&(this.checked?this._ripple.setAttribute("checked",""):this._ripple.removeAttribute("checked"))},_buttonStateChanged:function(){Polymer.PaperRippleBehavior._buttonStateChanged.call(this),this.disabled||this.isAttached&&(this.checked=this.active)}},Polymer.PaperCheckedElementBehavior=[Polymer.PaperInkyFocusBehavior,Polymer.IronCheckedElementBehavior,Polymer.PaperCheckedElementBehaviorImpl];</script><dom-module id="paper-checkbox" assetpath="../bower_components/paper-checkbox/"><template strip-whitespace=""><style>:host{display:inline-block;white-space:nowrap;cursor:pointer;--calculated-paper-checkbox-size:var(--paper-checkbox-size, 18px);--calculated-paper-checkbox-ink-size:var(--paper-checkbox-ink-size, -1px);@apply --paper-font-common-base;line-height:0;-webkit-tap-highlight-color:transparent;}:host([hidden]){display:none !important;}:host(:focus){outline:none;}.hidden{display:none;}#checkboxContainer{display:inline-block;position:relative;width:var(--calculated-paper-checkbox-size);height:var(--calculated-paper-checkbox-size);min-width:var(--calculated-paper-checkbox-size);margin:var(--paper-checkbox-margin, initial);vertical-align:var(--paper-checkbox-vertical-align, middle);background-color:var(--paper-checkbox-unchecked-background-color, transparent);}#ink{position:absolute;top:calc(0px - (var(--calculated-paper-checkbox-ink-size) - var(--calculated-paper-checkbox-size)) / 2);left:calc(0px - (var(--calculated-paper-checkbox-ink-size) - var(--calculated-paper-checkbox-size)) / 2);width:var(--calculated-paper-checkbox-ink-size);height:var(--calculated-paper-checkbox-ink-size);color:var(--paper-checkbox-unchecked-ink-color, var(--primary-text-color));opacity:0.6;pointer-events:none;}:host-context([dir="rtl"]) #ink{right:calc(0px - (var(--calculated-paper-checkbox-ink-size) - var(--calculated-paper-checkbox-size)) / 2);left:auto;}#ink[checked]{color:var(--paper-checkbox-checked-ink-color, var(--primary-color));}#checkbox{position:relative;box-sizing:border-box;height:100%;border:solid 2px;border-color:var(--paper-checkbox-unchecked-color, var(--primary-text-color));border-radius:2px;pointer-events:none;-webkit-transition:background-color 140ms, border-color 140ms;transition:background-color 140ms, border-color 140ms;}#checkbox.checked #checkmark{-webkit-animation:checkmark-expand 140ms ease-out forwards;animation:checkmark-expand 140ms ease-out forwards;}@-webkit-keyframes checkmark-expand{0%{-webkit-transform:scale(0, 0) rotate(45deg);}100%{-webkit-transform:scale(1, 1) rotate(45deg);}}@keyframes checkmark-expand{0%{transform:scale(0, 0) rotate(45deg);}100%{transform:scale(1, 1) rotate(45deg);}}#checkbox.checked{background-color:var(--paper-checkbox-checked-color, var(--primary-color));border-color:var(--paper-checkbox-checked-color, var(--primary-color));}#checkmark{position:absolute;width:36%;height:70%;border-style:solid;border-top:none;border-left:none;border-right-width:calc(2/15 * var(--calculated-paper-checkbox-size));border-bottom-width:calc(2/15 * var(--calculated-paper-checkbox-size));border-color:var(--paper-checkbox-checkmark-color, white);-webkit-transform-origin:97% 86%;transform-origin:97% 86%;box-sizing:content-box;}:host-context([dir="rtl"]) #checkmark{-webkit-transform-origin:50% 14%;transform-origin:50% 14%;}#checkboxLabel{position:relative;display:inline-block;vertical-align:middle;padding-left:var(--paper-checkbox-label-spacing, 8px);white-space:normal;line-height:normal;color:var(--paper-checkbox-label-color, var(--primary-text-color));@apply --paper-checkbox-label;}:host([checked]) #checkboxLabel{color:var(--paper-checkbox-label-checked-color, var(--paper-checkbox-label-color, var(--primary-text-color)));@apply --paper-checkbox-label-checked;}:host-context([dir="rtl"]) #checkboxLabel{padding-right:var(--paper-checkbox-label-spacing, 8px);padding-left:0;}#checkboxLabel[hidden]{display:none;}:host([disabled]) #checkbox{opacity:0.5;border-color:var(--paper-checkbox-unchecked-color, var(--primary-text-color));}:host([disabled][checked]) #checkbox{background-color:var(--paper-checkbox-unchecked-color, var(--primary-text-color));opacity:0.5;}:host([disabled]) #checkboxLabel{opacity:0.65;}#checkbox.invalid:not(.checked){border-color:var(--paper-checkbox-error-color, var(--error-color));}</style><div id="checkboxContainer"><div id="checkbox" class$="[[_computeCheckboxClass(checked, invalid)]]"><div id="checkmark" class$="[[_computeCheckmarkClass(checked)]]"></div></div></div><div id="checkboxLabel"><slot></slot></div></template><script>Polymer({is:"paper-checkbox",behaviors:[Polymer.PaperCheckedElementBehavior],hostAttributes:{role:"checkbox","aria-checked":!1,tabindex:0},properties:{ariaActiveAttribute:{type:String,value:"aria-checked"}},attached:function(){Polymer.RenderStatus.afterNextRender(this,function(){if("-1px"===this.getComputedStyleValue("--calculated-paper-checkbox-ink-size").trim()){var e=this.getComputedStyleValue("--calculated-paper-checkbox-size").trim(),t=e.match(/[A-Za-z]+$/)[0]||"px",a=parseFloat(e,10),r=8/3*a;"px"===t&&(r=Math.floor(r))%2!=a%2&&r++,this.updateStyles({"--paper-checkbox-ink-size":r+t})}})},_computeCheckboxClass:function(e,t){var a="";return e&&(a+="checked "),t&&(a+="invalid"),a},_computeCheckmarkClass:function(e){return e?"":"hidden"},_createRipple:function(){return this._rippleContainer=this.$.checkboxContainer,Polymer.PaperInkyFocusBehaviorImpl._createRipple.call(this)}});</script></dom-module><custom-style><style is="custom-style">html{--layout:{display:-ms-flexbox;display:-webkit-flex;display:flex;};--layout-inline:{display:-ms-inline-flexbox;display:-webkit-inline-flex;display:inline-flex;};--layout-horizontal:{@apply --layout;-ms-flex-direction:row;-webkit-flex-direction:row;flex-direction:row;};--layout-horizontal-reverse:{@apply --layout;-ms-flex-direction:row-reverse;-webkit-flex-direction:row-reverse;flex-direction:row-reverse;};--layout-vertical:{@apply --layout;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column;};--layout-vertical-reverse:{@apply --layout;-ms-flex-direction:column-reverse;-webkit-flex-direction:column-reverse;flex-direction:column-reverse;};--layout-wrap:{-ms-flex-wrap:wrap;-webkit-flex-wrap:wrap;flex-wrap:wrap;};--layout-wrap-reverse:{-ms-flex-wrap:wrap-reverse;-webkit-flex-wrap:wrap-reverse;flex-wrap:wrap-reverse;};--layout-flex-auto:{-ms-flex:1 1 auto;-webkit-flex:1 1 auto;flex:1 1 auto;};--layout-flex-none:{-ms-flex:none;-webkit-flex:none;flex:none;};--layout-flex:{-ms-flex:1 1 0.000000001px;-webkit-flex:1;flex:1;-webkit-flex-basis:0.000000001px;flex-basis:0.000000001px;};--layout-flex-2:{-ms-flex:2;-webkit-flex:2;flex:2;};--layout-flex-3:{-ms-flex:3;-webkit-flex:3;flex:3;};--layout-flex-4:{-ms-flex:4;-webkit-flex:4;flex:4;};--layout-flex-5:{-ms-flex:5;-webkit-flex:5;flex:5;};--layout-flex-6:{-ms-flex:6;-webkit-flex:6;flex:6;};--layout-flex-7:{-ms-flex:7;-webkit-flex:7;flex:7;};--layout-flex-8:{-ms-flex:8;-webkit-flex:8;flex:8;};--layout-flex-9:{-ms-flex:9;-webkit-flex:9;flex:9;};--layout-flex-10:{-ms-flex:10;-webkit-flex:10;flex:10;};--layout-flex-11:{-ms-flex:11;-webkit-flex:11;flex:11;};--layout-flex-12:{-ms-flex:12;-webkit-flex:12;flex:12;};--layout-start:{-ms-flex-align:start;-webkit-align-items:flex-start;align-items:flex-start;};--layout-center:{-ms-flex-align:center;-webkit-align-items:center;align-items:center;};--layout-end:{-ms-flex-align:end;-webkit-align-items:flex-end;align-items:flex-end;};--layout-baseline:{-ms-flex-align:baseline;-webkit-align-items:baseline;align-items:baseline;};--layout-start-justified:{-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;};--layout-center-justified:{-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;};--layout-end-justified:{-ms-flex-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end;};--layout-around-justified:{-ms-flex-pack:distribute;-webkit-justify-content:space-around;justify-content:space-around;};--layout-justified:{-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;};--layout-center-center:{@apply --layout-center;@apply --layout-center-justified;};--layout-self-start:{-ms-align-self:flex-start;-webkit-align-self:flex-start;align-self:flex-start;};--layout-self-center:{-ms-align-self:center;-webkit-align-self:center;align-self:center;};--layout-self-end:{-ms-align-self:flex-end;-webkit-align-self:flex-end;align-self:flex-end;};--layout-self-stretch:{-ms-align-self:stretch;-webkit-align-self:stretch;align-self:stretch;};--layout-self-baseline:{-ms-align-self:baseline;-webkit-align-self:baseline;align-self:baseline;};--layout-start-aligned:{-ms-flex-line-pack:start;-ms-align-content:flex-start;-webkit-align-content:flex-start;align-content:flex-start;};--layout-end-aligned:{-ms-flex-line-pack:end;-ms-align-content:flex-end;-webkit-align-content:flex-end;align-content:flex-end;};--layout-center-aligned:{-ms-flex-line-pack:center;-ms-align-content:center;-webkit-align-content:center;align-content:center;};--layout-between-aligned:{-ms-flex-line-pack:justify;-ms-align-content:space-between;-webkit-align-content:space-between;align-content:space-between;};--layout-around-aligned:{-ms-flex-line-pack:distribute;-ms-align-content:space-around;-webkit-align-content:space-around;align-content:space-around;};--layout-block:{display:block;};--layout-invisible:{visibility:hidden !important;};--layout-relative:{position:relative;};--layout-fit:{position:absolute;top:0;right:0;bottom:0;left:0;};--layout-scroll:{-webkit-overflow-scrolling:touch;overflow:auto;};--layout-fullbleed:{margin:0;height:100vh;};--layout-fixed-top:{position:fixed;top:0;left:0;right:0;};--layout-fixed-right:{position:fixed;top:0;right:0;bottom:0;};--layout-fixed-bottom:{position:fixed;right:0;bottom:0;left:0;};--layout-fixed-left:{position:fixed;top:0;bottom:0;left:0;};}</style></custom-style><script>Polymer.PaperButtonBehaviorImpl={properties:{elevation:{type:Number,reflectToAttribute:!0,readOnly:!0}},observers:["_calculateElevation(focused, disabled, active, pressed, receivedFocusFromKeyboard)","_computeKeyboardClass(receivedFocusFromKeyboard)"],hostAttributes:{role:"button",tabindex:"0",animated:!0},_calculateElevation:function(){var e=1;this.disabled?e=0:this.active||this.pressed?e=4:this.receivedFocusFromKeyboard&&(e=3),this._setElevation(e)},_computeKeyboardClass:function(e){this.toggleClass("keyboard-focus",e)},_spaceKeyDownHandler:function(e){Polymer.IronButtonStateImpl._spaceKeyDownHandler.call(this,e),this.hasRipple()&&this.getRipple().ripples.length<1&&this._ripple.uiDownAction()},_spaceKeyUpHandler:function(e){Polymer.IronButtonStateImpl._spaceKeyUpHandler.call(this,e),this.hasRipple()&&this._ripple.uiUpAction()}},Polymer.PaperButtonBehavior=[Polymer.IronButtonState,Polymer.IronControlState,Polymer.PaperRippleBehavior,Polymer.PaperButtonBehaviorImpl];</script><custom-style><style is="custom-style">html{--shadow-transition:{transition:box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);};--shadow-none:{box-shadow:none;};--shadow-elevation-2dp:{box-shadow:0 2px 2px 0 rgba(0, 0, 0, 0.14),
                     0 1px 5px 0 rgba(0, 0, 0, 0.12),
                     0 3px 1px -2px rgba(0, 0, 0, 0.2);};--shadow-elevation-3dp:{box-shadow:0 3px 4px 0 rgba(0, 0, 0, 0.14),
                     0 1px 8px 0 rgba(0, 0, 0, 0.12),
@@ -33,7 +33,7 @@
                     0  6px 30px 5px rgba(0, 0, 0, 0.12),
                     0  8px 10px -5px rgba(0, 0, 0, 0.4);};--shadow-elevation-24dp:{box-shadow:0 24px 38px 3px rgba(0, 0, 0, 0.14),
                     0 9px 46px 8px rgba(0, 0, 0, 0.12),
-                    0 11px 15px -7px rgba(0, 0, 0, 0.4);};}</style></custom-style><dom-module id="paper-material-styles" assetpath="../bower_components/paper-styles/element-styles/"><template><style>:host, html{--paper-material:{display:block;position:relative;};--paper-material-elevation-1:{@apply --shadow-elevation-2dp;};--paper-material-elevation-2:{@apply --shadow-elevation-4dp;};--paper-material-elevation-3:{@apply --shadow-elevation-6dp;};--paper-material-elevation-4:{@apply --shadow-elevation-8dp;};--paper-material-elevation-5:{@apply --shadow-elevation-16dp;};}:host(.paper-material), .paper-material{@apply --paper-material;}:host(.paper-material[elevation="1"]), .paper-material[elevation="1"]{@apply --paper-material-elevation-1;}:host(.paper-material[elevation="2"]), .paper-material[elevation="2"]{@apply --paper-material-elevation-2;}:host(.paper-material[elevation="3"]), .paper-material[elevation="3"]{@apply --paper-material-elevation-3;}:host(.paper-material[elevation="4"]), .paper-material[elevation="4"]{@apply --paper-material-elevation-4;}:host(.paper-material[elevation="5"]), .paper-material[elevation="5"]{@apply --paper-material-elevation-5;}</style></template></dom-module><dom-module id="paper-button" assetpath="../bower_components/paper-button/"><template strip-whitespace=""><style include="paper-material-styles">:host{@apply --layout-inline;@apply --layout-center-center;position:relative;box-sizing:border-box;min-width:5.14em;margin:0 0.29em;background:transparent;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);-webkit-tap-highlight-color:transparent;font:inherit;text-transform:uppercase;outline-width:0;border-radius:3px;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none;cursor:pointer;z-index:0;padding:0.7em 0.57em;@apply --paper-font-common-base;@apply --paper-button;}:host([elevation="1"]){@apply --paper-material-elevation-1;}:host([elevation="2"]){@apply --paper-material-elevation-2;}:host([elevation="3"]){@apply --paper-material-elevation-3;}:host([elevation="4"]){@apply --paper-material-elevation-4;}:host([elevation="5"]){@apply --paper-material-elevation-5;}:host([hidden]){display:none !important;}:host([raised].keyboard-focus){font-weight:bold;@apply --paper-button-raised-keyboard-focus;}:host(:not([raised]).keyboard-focus){font-weight:bold;@apply --paper-button-flat-keyboard-focus;}:host([disabled]){background:#eaeaea;color:#a8a8a8;cursor:auto;pointer-events:none;@apply --paper-button-disabled;}:host([animated]){@apply --shadow-transition;}paper-ripple{color:var(--paper-button-ink-color);}</style><slot></slot></template><script>Polymer({is:"paper-button",behaviors:[Polymer.PaperButtonBehavior],properties:{raised:{type:Boolean,reflectToAttribute:!0,value:!1,observer:"_calculateElevation"}},_calculateElevation:function(){this.raised?Polymer.PaperButtonBehaviorImpl._calculateElevation.apply(this):this._setElevation(0)}});</script></dom-module><dom-module id="iron-a11y-announcer" assetpath="../bower_components/iron-a11y-announcer/"><template><style>:host{display:inline-block;position:fixed;clip:rect(0px,0px,0px,0px);}</style><div aria-live$="[[mode]]">[[_text]]</div></template><script>!function(){"use strict";Polymer.IronA11yAnnouncer=Polymer({is:"iron-a11y-announcer",properties:{mode:{type:String,value:"polite"},_text:{type:String,value:""}},created:function(){Polymer.IronA11yAnnouncer.instance||(Polymer.IronA11yAnnouncer.instance=this),document.body.addEventListener("iron-announce",this._onIronAnnounce.bind(this))},announce:function(n){this._text="",this.async(function(){this._text=n},100)},_onIronAnnounce:function(n){n.detail&&n.detail.text&&this.announce(n.detail.text)}}),Polymer.IronA11yAnnouncer.instance=null,Polymer.IronA11yAnnouncer.requestAvailability=function(){Polymer.IronA11yAnnouncer.instance||(Polymer.IronA11yAnnouncer.instance=document.createElement("iron-a11y-announcer")),document.body.appendChild(Polymer.IronA11yAnnouncer.instance)}}();</script></dom-module><dom-module id="iron-input" assetpath="../bower_components/iron-input/"><template><style>:host{display:inline-block;}</style><slot id="content"></slot></template><script>Polymer({is:"iron-input",behaviors:[Polymer.IronValidatableBehavior],properties:{bindValue:{type:String},value:{computed:"_computeValue(bindValue)"},allowedPattern:{type:String},autoValidate:{type:Boolean,value:!1}},observers:["_bindValueChanged(bindValue, _inputElement)"],listeners:{input:"_onInput",keypress:"_onKeypress"},created:function(){Polymer.IronA11yAnnouncer.requestAvailability(),this._previousValidInput="",this._patternAlreadyChecked=!1},attached:function(){this._observer=Polymer.dom(this).observeNodes(function(e){this._initSlottedInput()}.bind(this))},detached:function(){this._observer&&(Polymer.dom(this).unobserveNodes(this._observer),this._observer=null)},get inputElement(){return this._inputElement},_initSlottedInput:function(){this._inputElement=this.getEffectiveChildren()[0],this.inputElement&&this.inputElement.value&&(this.bindValue=this.inputElement.value),this.fire("iron-input-ready")},get _patternRegExp(){var e;if(this.allowedPattern)e=new RegExp(this.allowedPattern);else switch(this.type){case"number":e=/[0-9.,e-]/}return e},_bindValueChanged:function(e,t){t&&(void 0===e?t.value=null:e!==t.value&&(this.inputElement.value=e),this.autoValidate&&this.validate(),this.fire("bind-value-changed",{value:e}))},_onInput:function(){this.allowedPattern&&!this._patternAlreadyChecked&&(this._checkPatternValidity()||(this._announceInvalidCharacter("Invalid string of characters not entered."),this.inputElement.value=this._previousValidInput)),this.bindValue=this._previousValidInput=this.inputElement.value,this._patternAlreadyChecked=!1},_isPrintable:function(e){var t=8==e.keyCode||9==e.keyCode||13==e.keyCode||27==e.keyCode,i=19==e.keyCode||20==e.keyCode||45==e.keyCode||46==e.keyCode||144==e.keyCode||145==e.keyCode||e.keyCode>32&&e.keyCode<41||e.keyCode>111&&e.keyCode<124;return!(t||0==e.charCode&&i)},_onKeypress:function(e){if(this.allowedPattern||"number"===this.type){var t=this._patternRegExp;if(t&&!(e.metaKey||e.ctrlKey||e.altKey)){this._patternAlreadyChecked=!0;var i=String.fromCharCode(e.charCode);this._isPrintable(e)&&!t.test(i)&&(e.preventDefault(),this._announceInvalidCharacter("Invalid character "+i+" not entered."))}}},_checkPatternValidity:function(){var e=this,t=this._patternRegExp;if(!t)return!0;for(var i=0;i<this.inputElement.value.length;i++)if(!t.test(e.inputElement.value[i]))return!1;return!0},validate:function(){if(!this.inputElement)return this.invalid=!1,!0;var e=this.inputElement.checkValidity();return e&&(this.required&&""===this.bindValue?e=!1:this.hasValidator()&&(e=Polymer.IronValidatableBehavior.validate.call(this,this.bindValue))),this.invalid=!e,this.fire("iron-input-validate"),e},_announceInvalidCharacter:function(e){this.fire("iron-announce",{text:e})},_computeValue:function(e){return e}});</script></dom-module><script>Polymer.PaperInputHelper={},Polymer.PaperInputHelper.NextLabelID=1,Polymer.PaperInputHelper.NextAddonID=1,Polymer.PaperInputBehaviorImpl={properties:{label:{type:String},value:{notify:!0,type:String},disabled:{type:Boolean,value:!1},invalid:{type:Boolean,value:!1,notify:!0},allowedPattern:{type:String},type:{type:String},list:{type:String},pattern:{type:String},required:{type:Boolean,value:!1},errorMessage:{type:String},charCounter:{type:Boolean,value:!1},noLabelFloat:{type:Boolean,value:!1},alwaysFloatLabel:{type:Boolean,value:!1},autoValidate:{type:Boolean,value:!1},validator:{type:String},autocomplete:{type:String,value:"off"},autofocus:{type:Boolean,observer:"_autofocusChanged"},inputmode:{type:String},minlength:{type:Number},maxlength:{type:Number},min:{type:String},max:{type:String},step:{type:String},name:{type:String},placeholder:{type:String,value:""},readonly:{type:Boolean,value:!1},size:{type:Number},autocapitalize:{type:String,value:"none"},autocorrect:{type:String,value:"off"},autosave:{type:String},results:{type:Number},accept:{type:String},multiple:{type:Boolean},_ariaDescribedBy:{type:String,value:""},_ariaLabelledBy:{type:String,value:""}},listeners:{"addon-attached":"_onAddonAttached"},keyBindings:{"shift+tab:keydown":"_onShiftTabDown"},hostAttributes:{tabindex:0},get inputElement(){return this.$.input},get _focusableElement(){return this.inputElement},created:function(){this._typesThatHaveText=["date","datetime","datetime-local","month","time","week","file"]},attached:function(){this._updateAriaLabelledBy(),!Polymer.Element&&this.inputElement&&-1!==this._typesThatHaveText.indexOf(this.inputElement.type)&&(this.alwaysFloatLabel=!0)},_appendStringWithSpace:function(e,t){return e=e?e+" "+t:t},_onAddonAttached:function(e){var t=Polymer.dom(e).rootTarget;if(t.id)this._ariaDescribedBy=this._appendStringWithSpace(this._ariaDescribedBy,t.id);else{var a="paper-input-add-on-"+Polymer.PaperInputHelper.NextAddonID++;t.id=a,this._ariaDescribedBy=this._appendStringWithSpace(this._ariaDescribedBy,a)}},validate:function(){return this.inputElement.validate()},_focusBlurHandler:function(e){Polymer.IronControlState._focusBlurHandler.call(this,e),this.focused&&!this._shiftTabPressed&&this._focusableElement&&this._focusableElement.focus()},_onShiftTabDown:function(e){var t=this.getAttribute("tabindex");this._shiftTabPressed=!0,this.setAttribute("tabindex","-1"),this.async(function(){this.setAttribute("tabindex",t),this._shiftTabPressed=!1},1)},_handleAutoValidate:function(){this.autoValidate&&this.validate()},updateValueAndPreserveCaret:function(e){try{var t=this.inputElement.selectionStart;this.value=e,this.inputElement.selectionStart=t,this.inputElement.selectionEnd=t}catch(t){this.value=e}},_computeAlwaysFloatLabel:function(e,t){return t||e},_updateAriaLabelledBy:function(){var e=Polymer.dom(this.root).querySelector("label");if(e){var t;e.id?t=e.id:(t="paper-input-label-"+Polymer.PaperInputHelper.NextLabelID++,e.id=t),this._ariaLabelledBy=t}else this._ariaLabelledBy=""},_onChange:function(e){this.shadowRoot&&this.fire(e.type,{sourceEvent:e},{node:this,bubbles:e.bubbles,cancelable:e.cancelable})},_autofocusChanged:function(){if(this.autofocus&&this._focusableElement){var e=document.activeElement;e instanceof HTMLElement&&e!==document.body&&e!==document.documentElement||this._focusableElement.focus()}}},Polymer.PaperInputBehavior=[Polymer.IronControlState,Polymer.IronA11yKeysBehavior,Polymer.PaperInputBehaviorImpl];</script><script>Polymer.PaperInputAddonBehavior={attached:function(){Polymer.dom.flush(),this.fire("addon-attached")},update:function(t){}};</script><dom-module id="paper-input-char-counter" assetpath="../bower_components/paper-input/"><template><style>:host{display:inline-block;float:right;@apply --paper-font-caption;@apply --paper-input-char-counter;}:host([hidden]){display:none !important;}:host-context([dir="rtl"]){float:left;}</style><span>[[_charCounterStr]]</span></template></dom-module><script>Polymer({is:"paper-input-char-counter",behaviors:[Polymer.PaperInputAddonBehavior],properties:{_charCounterStr:{type:String,value:"0"}},update:function(t){if(t.inputElement){t.value=t.value||"";var e=t.value.toString().length.toString();t.inputElement.hasAttribute("maxlength")&&(e+="/"+t.inputElement.getAttribute("maxlength")),this._charCounterStr=e}}});</script><dom-module id="paper-input-container" assetpath="../bower_components/paper-input/"><template><style>:host{display:block;padding:8px 0;--paper-input-container-shared-input-style:{position:relative;outline:none;box-shadow:none;padding:0;width:100%;max-width:100%;background:transparent;border:none;color:var(--paper-input-container-input-color, var(--primary-text-color));-webkit-appearance:none;text-align:inherit;vertical-align:bottom;@apply --paper-font-subhead;};@apply --paper-input-container;}:host([inline]){display:inline-block;}:host([disabled]){pointer-events:none;opacity:0.33;@apply --paper-input-container-disabled;}:host([hidden]){display:none !important;}[hidden]{display:none !important;}.floated-label-placeholder{@apply --paper-font-caption;}.underline{height:2px;position:relative;}.focused-line{@apply --layout-fit;border-bottom:2px solid var(--paper-input-container-focus-color, var(--primary-color));-webkit-transform-origin:center center;transform-origin:center center;-webkit-transform:scale3d(0,1,1);transform:scale3d(0,1,1);@apply --paper-input-container-underline-focus;}.underline.is-highlighted .focused-line{-webkit-transform:none;transform:none;-webkit-transition:-webkit-transform 0.25s;transition:transform 0.25s;@apply --paper-transition-easing;}.underline.is-invalid .focused-line{border-color:var(--paper-input-container-invalid-color, var(--error-color));-webkit-transform:none;transform:none;-webkit-transition:-webkit-transform 0.25s;transition:transform 0.25s;@apply --paper-transition-easing;}.unfocused-line{@apply --layout-fit;border-bottom:1px solid var(--paper-input-container-color, var(--secondary-text-color));@apply --paper-input-container-underline;}:host([disabled]) .unfocused-line{border-bottom:1px dashed;border-color:var(--paper-input-container-color, var(--secondary-text-color));@apply --paper-input-container-underline-disabled;}.input-wrapper{@apply --layout-horizontal;@apply --layout-center;position:relative;}.input-content{@apply --layout-flex-auto;@apply --layout-relative;max-width:100%;}.input-content ::slotted(label),
+                    0 11px 15px -7px rgba(0, 0, 0, 0.4);};}</style></custom-style><dom-module id="paper-material-styles" assetpath="../bower_components/paper-styles/element-styles/"><template><style>:host, html{--paper-material:{display:block;position:relative;};--paper-material-elevation-1:{@apply --shadow-elevation-2dp;};--paper-material-elevation-2:{@apply --shadow-elevation-4dp;};--paper-material-elevation-3:{@apply --shadow-elevation-6dp;};--paper-material-elevation-4:{@apply --shadow-elevation-8dp;};--paper-material-elevation-5:{@apply --shadow-elevation-16dp;};}:host(.paper-material), .paper-material{@apply --paper-material;}:host(.paper-material[elevation="1"]), .paper-material[elevation="1"]{@apply --paper-material-elevation-1;}:host(.paper-material[elevation="2"]), .paper-material[elevation="2"]{@apply --paper-material-elevation-2;}:host(.paper-material[elevation="3"]), .paper-material[elevation="3"]{@apply --paper-material-elevation-3;}:host(.paper-material[elevation="4"]), .paper-material[elevation="4"]{@apply --paper-material-elevation-4;}:host(.paper-material[elevation="5"]), .paper-material[elevation="5"]{@apply --paper-material-elevation-5;}</style></template></dom-module><dom-module id="paper-button" assetpath="../bower_components/paper-button/"><template strip-whitespace=""><style include="paper-material-styles">:host{@apply --layout-inline;@apply --layout-center-center;position:relative;box-sizing:border-box;min-width:5.14em;margin:0 0.29em;background:transparent;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);-webkit-tap-highlight-color:transparent;font:inherit;text-transform:uppercase;outline-width:0;border-radius:3px;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none;cursor:pointer;z-index:0;padding:0.7em 0.57em;@apply --paper-font-common-base;@apply --paper-button;}:host([elevation="1"]){@apply --paper-material-elevation-1;}:host([elevation="2"]){@apply --paper-material-elevation-2;}:host([elevation="3"]){@apply --paper-material-elevation-3;}:host([elevation="4"]){@apply --paper-material-elevation-4;}:host([elevation="5"]){@apply --paper-material-elevation-5;}:host([hidden]){display:none !important;}:host([raised].keyboard-focus){font-weight:bold;@apply --paper-button-raised-keyboard-focus;}:host(:not([raised]).keyboard-focus){font-weight:bold;@apply --paper-button-flat-keyboard-focus;}:host([disabled]){background:#eaeaea;color:#a8a8a8;cursor:auto;pointer-events:none;@apply --paper-button-disabled;}:host([animated]){@apply --shadow-transition;}paper-ripple{color:var(--paper-button-ink-color);}</style><slot></slot></template><script>Polymer({is:"paper-button",behaviors:[Polymer.PaperButtonBehavior],properties:{raised:{type:Boolean,reflectToAttribute:!0,value:!1,observer:"_calculateElevation"}},_calculateElevation:function(){this.raised?Polymer.PaperButtonBehaviorImpl._calculateElevation.apply(this):this._setElevation(0)}});</script></dom-module><dom-module id="iron-a11y-announcer" assetpath="../bower_components/iron-a11y-announcer/"><template><style>:host{display:inline-block;position:fixed;clip:rect(0px,0px,0px,0px);}</style><div aria-live$="[[mode]]">[[_text]]</div></template><script>!function(){"use strict";Polymer.IronA11yAnnouncer=Polymer({is:"iron-a11y-announcer",properties:{mode:{type:String,value:"polite"},_text:{type:String,value:""}},created:function(){Polymer.IronA11yAnnouncer.instance||(Polymer.IronA11yAnnouncer.instance=this),document.body.addEventListener("iron-announce",this._onIronAnnounce.bind(this))},announce:function(n){this._text="",this.async(function(){this._text=n},100)},_onIronAnnounce:function(n){n.detail&&n.detail.text&&this.announce(n.detail.text)}}),Polymer.IronA11yAnnouncer.instance=null,Polymer.IronA11yAnnouncer.requestAvailability=function(){Polymer.IronA11yAnnouncer.instance||(Polymer.IronA11yAnnouncer.instance=document.createElement("iron-a11y-announcer")),document.body.appendChild(Polymer.IronA11yAnnouncer.instance)}}();</script></dom-module><dom-module id="iron-input" assetpath="../bower_components/iron-input/"><template><style>:host{display:inline-block;}</style><slot id="content"></slot></template><script>Polymer({is:"iron-input",behaviors:[Polymer.IronValidatableBehavior],properties:{bindValue:{type:String},value:{computed:"_computeValue(bindValue)"},allowedPattern:{type:String},autoValidate:{type:Boolean,value:!1}},observers:["_bindValueChanged(bindValue, _inputElement)"],listeners:{input:"_onInput",keypress:"_onKeypress"},created:function(){Polymer.IronA11yAnnouncer.requestAvailability(),this._previousValidInput="",this._patternAlreadyChecked=!1},attached:function(){this._observer=Polymer.dom(this).observeNodes(function(e){this._initSlottedInput()}.bind(this))},detached:function(){this._observer&&(Polymer.dom(this).unobserveNodes(this._observer),this._observer=null)},get inputElement(){return this._inputElement},_initSlottedInput:function(){this._inputElement=this.getEffectiveChildren()[0],this.inputElement&&this.inputElement.value&&(this.bindValue=this.inputElement.value),this.fire("iron-input-ready")},get _patternRegExp(){var e;if(this.allowedPattern)e=new RegExp(this.allowedPattern);else switch(this.type){case"number":e=/[0-9.,e-]/}return e},_bindValueChanged:function(e,t){t&&(void 0===e?t.value=null:e!==t.value&&(this.inputElement.value=e),this.autoValidate&&this.validate(),this.fire("bind-value-changed",{value:e}))},_onInput:function(){this.allowedPattern&&!this._patternAlreadyChecked&&(this._checkPatternValidity()||(this._announceInvalidCharacter("Invalid string of characters not entered."),this.inputElement.value=this._previousValidInput)),this.bindValue=this._previousValidInput=this.inputElement.value,this._patternAlreadyChecked=!1},_isPrintable:function(e){var t=8==e.keyCode||9==e.keyCode||13==e.keyCode||27==e.keyCode,i=19==e.keyCode||20==e.keyCode||45==e.keyCode||46==e.keyCode||144==e.keyCode||145==e.keyCode||e.keyCode>32&&e.keyCode<41||e.keyCode>111&&e.keyCode<124;return!(t||0==e.charCode&&i)},_onKeypress:function(e){if(this.allowedPattern||"number"===this.type){var t=this._patternRegExp;if(t&&!(e.metaKey||e.ctrlKey||e.altKey)){this._patternAlreadyChecked=!0;var i=String.fromCharCode(e.charCode);this._isPrintable(e)&&!t.test(i)&&(e.preventDefault(),this._announceInvalidCharacter("Invalid character "+i+" not entered."))}}},_checkPatternValidity:function(){var e=this._patternRegExp;if(!e)return!0;for(var t=0;t<this.inputElement.value.length;t++)if(!e.test(this.inputElement.value[t]))return!1;return!0},validate:function(){if(!this.inputElement)return this.invalid=!1,!0;var e=this.inputElement.checkValidity();return e&&(this.required&&""===this.bindValue?e=!1:this.hasValidator()&&(e=Polymer.IronValidatableBehavior.validate.call(this,this.bindValue))),this.invalid=!e,this.fire("iron-input-validate"),e},_announceInvalidCharacter:function(e){this.fire("iron-announce",{text:e})},_computeValue:function(e){return e}});</script></dom-module><script>Polymer.PaperInputHelper={},Polymer.PaperInputHelper.NextLabelID=1,Polymer.PaperInputHelper.NextAddonID=1,Polymer.PaperInputBehaviorImpl={properties:{label:{type:String},value:{notify:!0,type:String},disabled:{type:Boolean,value:!1},invalid:{type:Boolean,value:!1,notify:!0},allowedPattern:{type:String},type:{type:String},list:{type:String},pattern:{type:String},required:{type:Boolean,value:!1},errorMessage:{type:String},charCounter:{type:Boolean,value:!1},noLabelFloat:{type:Boolean,value:!1},alwaysFloatLabel:{type:Boolean,value:!1},autoValidate:{type:Boolean,value:!1},validator:{type:String},autocomplete:{type:String,value:"off"},autofocus:{type:Boolean,observer:"_autofocusChanged"},inputmode:{type:String},minlength:{type:Number},maxlength:{type:Number},min:{type:String},max:{type:String},step:{type:String},name:{type:String},placeholder:{type:String,value:""},readonly:{type:Boolean,value:!1},size:{type:Number},autocapitalize:{type:String,value:"none"},autocorrect:{type:String,value:"off"},autosave:{type:String},results:{type:Number},accept:{type:String},multiple:{type:Boolean},_ariaDescribedBy:{type:String,value:""},_ariaLabelledBy:{type:String,value:""}},listeners:{"addon-attached":"_onAddonAttached"},keyBindings:{"shift+tab:keydown":"_onShiftTabDown"},hostAttributes:{tabindex:0},get inputElement(){return this.$.input},get _focusableElement(){return this.inputElement},created:function(){this._typesThatHaveText=["date","datetime","datetime-local","month","time","week","file"]},attached:function(){this._updateAriaLabelledBy(),!Polymer.Element&&this.inputElement&&-1!==this._typesThatHaveText.indexOf(this.inputElement.type)&&(this.alwaysFloatLabel=!0)},_appendStringWithSpace:function(e,t){return e=e?e+" "+t:t},_onAddonAttached:function(e){var t=Polymer.dom(e).rootTarget;if(t.id)this._ariaDescribedBy=this._appendStringWithSpace(this._ariaDescribedBy,t.id);else{var a="paper-input-add-on-"+Polymer.PaperInputHelper.NextAddonID++;t.id=a,this._ariaDescribedBy=this._appendStringWithSpace(this._ariaDescribedBy,a)}},validate:function(){return this.inputElement.validate()},_focusBlurHandler:function(e){Polymer.IronControlState._focusBlurHandler.call(this,e),this.focused&&!this._shiftTabPressed&&this._focusableElement&&this._focusableElement.focus()},_onShiftTabDown:function(e){var t=this.getAttribute("tabindex");this._shiftTabPressed=!0,this.setAttribute("tabindex","-1"),this.async(function(){this.setAttribute("tabindex",t),this._shiftTabPressed=!1},1)},_handleAutoValidate:function(){this.autoValidate&&this.validate()},updateValueAndPreserveCaret:function(e){try{var t=this.inputElement.selectionStart;this.value=e,this.inputElement.selectionStart=t,this.inputElement.selectionEnd=t}catch(t){this.value=e}},_computeAlwaysFloatLabel:function(e,t){return t||e},_updateAriaLabelledBy:function(){var e=Polymer.dom(this.root).querySelector("label");if(e){var t;e.id?t=e.id:(t="paper-input-label-"+Polymer.PaperInputHelper.NextLabelID++,e.id=t),this._ariaLabelledBy=t}else this._ariaLabelledBy=""},_onChange:function(e){this.shadowRoot&&this.fire(e.type,{sourceEvent:e},{node:this,bubbles:e.bubbles,cancelable:e.cancelable})},_autofocusChanged:function(){if(this.autofocus&&this._focusableElement){var e=document.activeElement;e instanceof HTMLElement&&e!==document.body&&e!==document.documentElement||this._focusableElement.focus()}}},Polymer.PaperInputBehavior=[Polymer.IronControlState,Polymer.IronA11yKeysBehavior,Polymer.PaperInputBehaviorImpl];</script><script>Polymer.PaperInputAddonBehavior={attached:function(){Polymer.dom.flush(),this.fire("addon-attached")},update:function(t){}};</script><dom-module id="paper-input-char-counter" assetpath="../bower_components/paper-input/"><template><style>:host{display:inline-block;float:right;@apply --paper-font-caption;@apply --paper-input-char-counter;}:host([hidden]){display:none !important;}:host-context([dir="rtl"]){float:left;}</style><span>[[_charCounterStr]]</span></template></dom-module><script>Polymer({is:"paper-input-char-counter",behaviors:[Polymer.PaperInputAddonBehavior],properties:{_charCounterStr:{type:String,value:"0"}},update:function(t){if(t.inputElement){t.value=t.value||"";var e=t.value.toString().length.toString();t.inputElement.hasAttribute("maxlength")&&(e+="/"+t.inputElement.getAttribute("maxlength")),this._charCounterStr=e}}});</script><dom-module id="paper-input-container" assetpath="../bower_components/paper-input/"><template><style>:host{display:block;padding:8px 0;--paper-input-container-shared-input-style:{position:relative;outline:none;box-shadow:none;padding:0;width:100%;max-width:100%;background:transparent;border:none;color:var(--paper-input-container-input-color, var(--primary-text-color));-webkit-appearance:none;text-align:inherit;vertical-align:bottom;@apply --paper-font-subhead;};@apply --paper-input-container;}:host([inline]){display:inline-block;}:host([disabled]){pointer-events:none;opacity:0.33;@apply --paper-input-container-disabled;}:host([hidden]){display:none !important;}[hidden]{display:none !important;}.floated-label-placeholder{@apply --paper-font-caption;}.underline{height:2px;position:relative;}.focused-line{@apply --layout-fit;border-bottom:2px solid var(--paper-input-container-focus-color, var(--primary-color));-webkit-transform-origin:center center;transform-origin:center center;-webkit-transform:scale3d(0,1,1);transform:scale3d(0,1,1);@apply --paper-input-container-underline-focus;}.underline.is-highlighted .focused-line{-webkit-transform:none;transform:none;-webkit-transition:-webkit-transform 0.25s;transition:transform 0.25s;@apply --paper-transition-easing;}.underline.is-invalid .focused-line{border-color:var(--paper-input-container-invalid-color, var(--error-color));-webkit-transform:none;transform:none;-webkit-transition:-webkit-transform 0.25s;transition:transform 0.25s;@apply --paper-transition-easing;}.unfocused-line{@apply --layout-fit;border-bottom:1px solid var(--paper-input-container-color, var(--secondary-text-color));@apply --paper-input-container-underline;}:host([disabled]) .unfocused-line{border-bottom:1px dashed;border-color:var(--paper-input-container-color, var(--secondary-text-color));@apply --paper-input-container-underline-disabled;}.input-wrapper{@apply --layout-horizontal;@apply --layout-center;position:relative;}.input-content{@apply --layout-flex-auto;@apply --layout-relative;max-width:100%;}.input-content ::slotted(label),
       .input-content ::slotted(.paper-input-label){position:absolute;top:0;right:0;left:0;width:100%;font:inherit;color:var(--paper-input-container-color, var(--secondary-text-color));-webkit-transition:-webkit-transform 0.25s, width 0.25s;transition:transform 0.25s, width 0.25s;-webkit-transform-origin:left top;transform-origin:left top;@apply --paper-font-common-nowrap;@apply --paper-font-subhead;@apply --paper-input-container-label;@apply --paper-transition-easing;}.input-content.label-is-floating ::slotted(label),
       .input-content.label-is-floating ::slotted(.paper-input-label){-webkit-transform:translateY(-75%) scale(0.75);transform:translateY(-75%) scale(0.75);width:133%;@apply --paper-input-container-label-floating;}:host-context([dir="rtl"]) .input-content.label-is-floating ::slotted(label),
       :host-context([dir="rtl"]) .input-content.label-is-floating ::slotted(.paper-input-label){width:100%;-webkit-transform-origin:right top;transform-origin:right top;}.input-content.label-is-highlighted ::slotted(label),
@@ -50,11 +50,11 @@
       .input-content.is-invalid ::slotted(textarea),
       .input-content.is-invalid ::slotted(iron-autogrow-textarea),
       .input-content.is-invalid ::slotted(.paper-input-input){@apply --paper-input-container-input-invalid;}.prefix ::slotted(*){display:inline-block;@apply --paper-font-subhead;@apply --layout-flex-none;@apply --paper-input-prefix;}.suffix ::slotted(*){display:inline-block;@apply --paper-font-subhead;@apply --layout-flex-none;@apply --paper-input-suffix;}.input-content ::slotted(input){min-width:0;}.input-content ::slotted(textarea){resize:none;}.add-on-content{position:relative;}.add-on-content.is-invalid ::slotted(*){color:var(--paper-input-container-invalid-color, var(--error-color));}.add-on-content.is-highlighted ::slotted(*){color:var(--paper-input-container-focus-color, var(--primary-color));}</style><div class="floated-label-placeholder" aria-hidden="true" hidden="[[noLabelFloat]]">&nbsp;</div><div class="input-wrapper"><span class="prefix"><slot name="prefix"></slot></span><div class$="[[_computeInputContentClass(noLabelFloat,alwaysFloatLabel,focused,invalid,_inputHasContent)]]" id="labelAndInputContainer"><slot name="label"></slot><slot name="input"></slot></div><span class="suffix"><slot name="suffix"></slot></span></div><div class$="[[_computeUnderlineClass(focused,invalid)]]"><div class="unfocused-line"></div><div class="focused-line"></div></div><div class$="[[_computeAddOnContentClass(focused,invalid)]]"><slot name="add-on"></slot></div></template></dom-module><script>Polymer({is:"paper-input-container",properties:{noLabelFloat:{type:Boolean,value:!1},alwaysFloatLabel:{type:Boolean,value:!1},attrForValue:{type:String,value:"bind-value"},autoValidate:{type:Boolean,value:!1},invalid:{observer:"_invalidChanged",type:Boolean,value:!1},focused:{readOnly:!0,type:Boolean,value:!1,notify:!0},_addons:{type:Array},_inputHasContent:{type:Boolean,value:!1},_inputSelector:{type:String,value:"input,iron-input,textarea,.paper-input-input"},_boundOnFocus:{type:Function,value:function(){return this._onFocus.bind(this)}},_boundOnBlur:{type:Function,value:function(){return this._onBlur.bind(this)}},_boundOnInput:{type:Function,value:function(){return this._onInput.bind(this)}},_boundValueChanged:{type:Function,value:function(){return this._onValueChanged.bind(this)}}},listeners:{"addon-attached":"_onAddonAttached","iron-input-validate":"_onIronInputValidate"},get _valueChangedEvent(){return this.attrForValue+"-changed"},get _propertyForValue(){return Polymer.CaseMap.dashToCamelCase(this.attrForValue)},get _inputElement(){return Polymer.dom(this).querySelector(this._inputSelector)},get _inputElementValue(){return this._inputElement[this._propertyForValue]||this._inputElement.value},ready:function(){this._addons||(this._addons=[]),this.addEventListener("focus",this._boundOnFocus,!0),this.addEventListener("blur",this._boundOnBlur,!0)},attached:function(){this.attrForValue?this._inputElement.addEventListener(this._valueChangedEvent,this._boundValueChanged):this.addEventListener("input",this._onInput),this._inputElementValue&&""!=this._inputElementValue?this._handleValueAndAutoValidate(this._inputElement):this._handleValue(this._inputElement)},_onAddonAttached:function(t){this._addons||(this._addons=[]);var n=t.target;-1===this._addons.indexOf(n)&&(this._addons.push(n),this.isAttached&&this._handleValue(this._inputElement))},_onFocus:function(){this._setFocused(!0)},_onBlur:function(){this._setFocused(!1),this._handleValueAndAutoValidate(this._inputElement)},_onInput:function(t){this._handleValueAndAutoValidate(t.target)},_onValueChanged:function(t){void 0!==t.target.value&&this._handleValueAndAutoValidate(t.target)},_handleValue:function(t){var n=this._inputElementValue;n||0===n||"number"===t.type&&!t.checkValidity()?this._inputHasContent=!0:this._inputHasContent=!1,this.updateAddons({inputElement:t,value:n,invalid:this.invalid})},_handleValueAndAutoValidate:function(t){if(this.autoValidate&&t){var n;n=t.validate?t.validate(this._inputElementValue):t.checkValidity(),this.invalid=!n}this._handleValue(t)},_onIronInputValidate:function(t){this.invalid=this._inputElement.invalid},_invalidChanged:function(){this._addons&&this.updateAddons({invalid:this.invalid})},updateAddons:function(t){for(var n,e=0;n=this._addons[e];e++)n.update(t)},_computeInputContentClass:function(t,n,e,i,a){var u="input-content";if(t)a&&(u+=" label-is-hidden"),i&&(u+=" is-invalid");else{var l=this.querySelector("label");n||a?(u+=" label-is-floating",this.$.labelAndInputContainer.style.position="static",i?u+=" is-invalid":e&&(u+=" label-is-highlighted")):(l&&(this.$.labelAndInputContainer.style.position="relative"),i&&(u+=" is-invalid"))}return e&&(u+=" focused"),u},_computeUnderlineClass:function(t,n){var e="underline";return n?e+=" is-invalid":t&&(e+=" is-highlighted"),e},_computeAddOnContentClass:function(t,n){var e="add-on-content";return n?e+=" is-invalid":t&&(e+=" is-highlighted"),e}});</script><dom-module id="paper-input-error" assetpath="../bower_components/paper-input/"><template><style>:host{display:inline-block;visibility:hidden;color:var(--paper-input-container-invalid-color, var(--error-color));@apply --paper-font-caption;@apply --paper-input-error;position:absolute;left:0;right:0;}:host([invalid]){visibility:visible;}</style><slot></slot></template></dom-module><script>Polymer({is:"paper-input-error",behaviors:[Polymer.PaperInputAddonBehavior],properties:{invalid:{readOnly:!0,reflectToAttribute:!0,type:Boolean}},update:function(e){this._setInvalid(e.invalid)}});</script><dom-module id="paper-input" assetpath="../bower_components/paper-input/"><template><style>:host{display:block;}:host([focused]){outline:none;}:host([hidden]){display:none !important;}input{position:relative;outline:none;box-shadow:none;padding:0;width:100%;max-width:100%;background:transparent;border:none;color:var(--paper-input-container-input-color, var(--primary-text-color));-webkit-appearance:none;text-align:inherit;vertical-align:bottom;min-width:0;@apply --paper-font-subhead;@apply --paper-input-container-input;}input::-webkit-outer-spin-button,
-      input::-webkit-inner-spin-button{@apply --paper-input-container-input-webkit-spinner;}input::-webkit-clear-button{@apply --paper-input-container-input-webkit-clear;}input::-webkit-input-placeholder{color:var(--paper-input-container-color, var(--secondary-text-color));}input:-moz-placeholder{color:var(--paper-input-container-color, var(--secondary-text-color));}input::-moz-placeholder{color:var(--paper-input-container-color, var(--secondary-text-color));}input::-ms-clear{@apply --paper-input-container-ms-clear;}input:-ms-input-placeholder{color:var(--paper-input-container-color, var(--secondary-text-color));}label{pointer-events:none;}</style><paper-input-container id="container" no-label-float="[[noLabelFloat]]" always-float-label="[[_computeAlwaysFloatLabel(alwaysFloatLabel,placeholder)]]" auto-validate$="[[autoValidate]]" disabled$="[[disabled]]" invalid="[[invalid]]"><slot name="prefix" slot="prefix"></slot><label hidden$="[[!label]]" aria-hidden="true" for="input" slot="label">[[label]]</label><span id="template-placeholder"></span><slot name="suffix" slot="suffix"></slot><template is="dom-if" if="[[errorMessage]]"><paper-input-error aria-live="assertive" slot="add-on">[[errorMessage]]</paper-input-error></template><template is="dom-if" if="[[charCounter]]"><paper-input-char-counter slot="add-on"></paper-input-char-counter></template></paper-input-container></template><template id="v0"><input is="iron-input" id="input" slot="input" aria-labelledby$="[[_ariaLabelledBy]]" aria-describedby$="[[_ariaDescribedBy]]" disabled$="[[disabled]]" title$="[[title]]" bind-value="{{value}}" invalid="{{invalid}}" prevent-invalid-input="[[preventInvalidInput]]" allowed-pattern="[[allowedPattern]]" validator="[[validator]]" type$="[[type]]" pattern$="[[pattern]]" required$="[[required]]" autocomplete$="[[autocomplete]]" autofocus$="[[autofocus]]" inputmode$="[[inputmode]]" minlength$="[[minlength]]" maxlength$="[[maxlength]]" min$="[[min]]" max$="[[max]]" step$="[[step]]" name$="[[name]]" placeholder$="[[placeholder]]" readonly$="[[readonly]]" list$="[[list]]" size$="[[size]]" autocapitalize$="[[autocapitalize]]" autocorrect$="[[autocorrect]]" on-change="_onChange" tabindex$="[[tabIndex]]" autosave$="[[autosave]]" results$="[[results]]" accept$="[[accept]]" multiple$="[[multiple]]"></template><template id="v1"><iron-input bind-value="{{value}}" id="input" slot="input" maxlength$="[[maxlength]]" allowed-pattern="[[allowedPattern]]" invalid="{{invalid}}" validator="[[validator]]"><input id="nativeInput" aria-labelledby$="[[_ariaLabelledBy]]" aria-describedby$="[[_ariaDescribedBy]]" disabled$="[[disabled]]" title$="[[title]]" type$="[[type]]" pattern$="[[pattern]]" required$="[[required]]" autocomplete$="[[autocomplete]]" autofocus$="[[autofocus]]" inputmode$="[[inputmode]]" minlength$="[[minlength]]" maxlength$="[[maxlength]]" min$="[[min]]" max$="[[max]]" step$="[[step]]" name$="[[name]]" placeholder$="[[placeholder]]" readonly$="[[readonly]]" list$="[[list]]" size$="[[size]]" autocapitalize$="[[autocapitalize]]" autocorrect$="[[autocorrect]]" on-change="_onChange" tabindex$="[[tabIndex]]" autosave$="[[autosave]]" results$="[[results]]" accept$="[[accept]]" multiple$="[[multiple]]"></iron-input></template></dom-module><script>Polymer({is:"paper-input",behaviors:[Polymer.PaperInputBehavior,Polymer.IronFormElementBehavior],beforeRegister:function(){var e="function"==typeof document.createElement("iron-input")._initSlottedInput?"v1":"v0",t=Polymer.DomModule.import("paper-input","template"),n=Polymer.DomModule.import("paper-input","template#"+e),i=t.content.querySelector("#template-placeholder");i&&i.parentNode.replaceChild(n.content,i)},get _focusableElement(){return Polymer.Element?this.inputElement._inputElement:this.inputElement},listeners:{"iron-input-ready":"_onIronInputReady"},_onIronInputReady:function(){this.inputElement&&-1!==this._typesThatHaveText.indexOf(this.$.nativeInput.type)&&(this.alwaysFloatLabel=!0),this.inputElement.bindValue&&this.$.container._handleValueAndAutoValidate(this.inputElement)}});</script><dom-module id="login-form" assetpath="layouts/"><template><style is="custom-style" include="iron-flex iron-positioning"></style><style>:host{white-space:nowrap;}paper-input{display:block;margin-bottom:16px;}paper-checkbox{margin-right:8px;}paper-button{margin-left:72px;}.interact{height:125px;}#validatebox{margin-top:16px;text-align:center;}.validatemessage{margin-top:10px;}</style><div class="layout vertical center center-center fit"><img src="/static/icons/favicon-192x192.png" height="192"> <a href="#" id="hideKeyboardOnFocus"></a><div class="interact"><div id="loginform" hidden$="[[showSpinner]]"><paper-input id="passwordInput" label="Password" type="password" invalid="[[errorMessage]]" error-message="[[errorMessage]]" value="{{password}}"></paper-input><div class="layout horizontal center"><paper-checkbox for="" id="rememberLogin">Remember</paper-checkbox><paper-button id="loginButton">Log In</paper-button></div></div><div id="validatebox" hidden$="[[!showSpinner]]"><paper-spinner active="true"></paper-spinner><br><div class="validatemessage">[[computeLoadingMsg(isValidating)]]</div></div></div></div></template></dom-module><script>Polymer({is:"login-form",properties:{hass:{type:Object},connectionPromise:{type:Object,notify:!0,observer:"handleConnectionPromiseChanged"},errorMessage:{type:String,value:""},isValidating:{type:Boolean,observer:"isValidatingChanged",value:!1},showLoading:{type:Boolean,value:!1},showSpinner:{type:Boolean,computed:"computeShowSpinner(showLoading, isValidating)"},password:{type:String,value:""}},listeners:{keydown:"passwordKeyDown","loginButton.tap":"validatePassword"},attached:function(){window.removeInitMsg()},computeLoadingMsg:function(n){return n?"Connecting":"Loading data"},computeShowSpinner:function(n,e){return n||e},isValidatingChanged:function(n){n||this.async(function(){this.$.passwordInput.inputElement.inputElement&&this.$.passwordInput.inputElement.inputElement.focus()}.bind(this),10)},passwordKeyDown:function(n){13===n.keyCode?(this.validatePassword(),n.preventDefault()):this.errorMessage&&(this.errorMessage="")},validatePassword:function(){var n=this.password;this.$.hideKeyboardOnFocus.focus(),this.connectionPromise=window.createHassConnection(n),this.$.rememberLogin.checked&&this.connectionPromise.then(function(){localStorage.authToken=n})},handleConnectionPromiseChanged:function(n){if(n){var e=this;this.isValidating=!0,this.connectionPromise.then(function(){e.isValidating=!1,e.password=""},function(n){e.isValidating=!1,n===window.HAWS.ERR_CANNOT_CONNECT?e.errorMessage="Unable to connect":n===window.HAWS.ERR_INVALID_AUTH?e.errorMessage="Invalid password":e.errorMessage="Unknown error: "+n})}}});</script><script>Polymer({is:"iron-media-query",properties:{queryMatches:{type:Boolean,value:!1,readOnly:!0,notify:!0},query:{type:String,observer:"queryChanged"},full:{type:Boolean,value:!1},_boundMQHandler:{value:function(){return this.queryHandler.bind(this)}},_mq:{value:null}},attached:function(){this.style.display="none",this.queryChanged()},detached:function(){this._remove()},_add:function(){this._mq&&this._mq.addListener(this._boundMQHandler)},_remove:function(){this._mq&&this._mq.removeListener(this._boundMQHandler),this._mq=null},queryChanged:function(){this._remove();var e=this.query;e&&(this.full||"("===e[0]||(e="("+e+")"),this._mq=window.matchMedia(e),this._add(),this.queryHandler(this._mq))},queryHandler:function(e){this._setQueryMatches(e.matches)}});</script><script>Polymer.IronSelection=function(e){this.selection=[],this.selectCallback=e},Polymer.IronSelection.prototype={get:function(){return this.multi?this.selection.slice():this.selection[0]},clear:function(e){this.selection.slice().forEach(function(t){(!e||e.indexOf(t)<0)&&this.setItemSelected(t,!1)},this)},isSelected:function(e){return this.selection.indexOf(e)>=0},setItemSelected:function(e,t){if(null!=e&&t!==this.isSelected(e)){if(t)this.selection.push(e);else{var i=this.selection.indexOf(e);i>=0&&this.selection.splice(i,1)}this.selectCallback&&this.selectCallback(e,t)}},select:function(e){this.multi?this.toggle(e):this.get()!==e&&(this.setItemSelected(this.get(),!1),this.setItemSelected(e,!0))},toggle:function(e){this.setItemSelected(e,!this.isSelected(e))}};</script><script>Polymer.IronSelectableBehavior={properties:{attrForSelected:{type:String,value:null},selected:{type:String,notify:!0},selectedItem:{type:Object,readOnly:!0,notify:!0},activateEvent:{type:String,value:"tap",observer:"_activateEventChanged"},selectable:String,selectedClass:{type:String,value:"iron-selected"},selectedAttribute:{type:String,value:null},fallbackSelection:{type:String,value:null},items:{type:Array,readOnly:!0,notify:!0,value:function(){return[]}},_excludedLocalNames:{type:Object,value:function(){return{template:1,"dom-bind":1,"dom-if":1,"dom-repeat":1}}}},observers:["_updateAttrForSelected(attrForSelected)","_updateSelected(selected)","_checkFallback(fallbackSelection)"],created:function(){this._bindFilterItem=this._filterItem.bind(this),this._selection=new Polymer.IronSelection(this._applySelection.bind(this))},attached:function(){this._observer=this._observeItems(this),this._addListener(this.activateEvent)},detached:function(){this._observer&&Polymer.dom(this).unobserveNodes(this._observer),this._removeListener(this.activateEvent)},indexOf:function(e){return this.items.indexOf(e)},select:function(e){this.selected=e},selectPrevious:function(){var e=this.items.length,t=(Number(this._valueToIndex(this.selected))-1+e)%e;this.selected=this._indexToValue(t)},selectNext:function(){var e=(Number(this._valueToIndex(this.selected))+1)%this.items.length;this.selected=this._indexToValue(e)},selectIndex:function(e){this.select(this._indexToValue(e))},forceSynchronousItemUpdate:function(){this._observer&&"function"==typeof this._observer.flush?this._observer.flush():this._updateItems()},get _shouldUpdateSelection(){return null!=this.selected},_checkFallback:function(){this._updateSelected()},_addListener:function(e){this.listen(this,e,"_activateHandler")},_removeListener:function(e){this.unlisten(this,e,"_activateHandler")},_activateEventChanged:function(e,t){this._removeListener(t),this._addListener(e)},_updateItems:function(){var e=Polymer.dom(this).queryDistributedElements(this.selectable||"*");e=Array.prototype.filter.call(e,this._bindFilterItem),this._setItems(e)},_updateAttrForSelected:function(){this.selectedItem&&(this.selected=this._valueForItem(this.selectedItem))},_updateSelected:function(){this._selectSelected(this.selected)},_selectSelected:function(e){if(this.items){var t=this._valueToItem(this.selected);t?this._selection.select(t):this._selection.clear(),this.fallbackSelection&&this.items.length&&void 0===this._selection.get()&&(this.selected=this.fallbackSelection)}},_filterItem:function(e){return!this._excludedLocalNames[e.localName]},_valueToItem:function(e){return null==e?null:this.items[this._valueToIndex(e)]},_valueToIndex:function(e){var t=this;if(!this.attrForSelected)return Number(e);for(var i,s=0;i=this.items[s];s++)if(t._valueForItem(i)==e)return s},_indexToValue:function(e){if(!this.attrForSelected)return e;var t=this.items[e];return t?this._valueForItem(t):void 0},_valueForItem:function(e){if(!e)return null;var t=e[Polymer.CaseMap.dashToCamelCase(this.attrForSelected)];return void 0!=t?t:e.getAttribute(this.attrForSelected)},_applySelection:function(e,t){this.selectedClass&&this.toggleClass(this.selectedClass,t,e),this.selectedAttribute&&this.toggleAttribute(this.selectedAttribute,t,e),this._selectionChange(),this.fire("iron-"+(t?"select":"deselect"),{item:e})},_selectionChange:function(){this._setSelectedItem(this._selection.get())},_observeItems:function(e){return Polymer.dom(e).observeNodes(function(e){this._updateItems(),this._updateSelected(),this.fire("iron-items-changed",e,{bubbles:!1,cancelable:!1})})},_activateHandler:function(e){for(var t=this,i=e.target,s=this.items;i&&i!=this;){var l=s.indexOf(i);if(l>=0){var n=t._indexToValue(l);return void t._itemActivate(n,i)}i=i.parentNode}},_itemActivate:function(e,t){this.fire("iron-activate",{selected:e,item:t},{cancelable:!0}).defaultPrevented||this.select(e)}};</script><script>Polymer.IronMultiSelectableBehaviorImpl={properties:{multi:{type:Boolean,value:!1,observer:"multiChanged"},selectedValues:{type:Array,notify:!0,value:function(){return[]}},selectedItems:{type:Array,readOnly:!0,notify:!0,value:function(){return[]}}},observers:["_updateSelected(selectedValues.splices)"],select:function(e){this.multi?this._toggleSelected(e):this.selected=e},multiChanged:function(e){this._selection.multi=e,this._updateSelected()},get _shouldUpdateSelection(){return null!=this.selected||null!=this.selectedValues&&this.selectedValues.length},_updateAttrForSelected:function(){this.multi?this.selectedItems&&this.selectedItems.length>0&&(this.selectedValues=this.selectedItems.map(function(e){return this._indexToValue(this.indexOf(e))},this).filter(function(e){return null!=e},this)):Polymer.IronSelectableBehavior._updateAttrForSelected.apply(this)},_updateSelected:function(){this.multi?this._selectMulti(this.selectedValues):this._selectSelected(this.selected)},_selectMulti:function(e){var t=this;e=e||[];var l=(this._valuesToItems(e)||[]).filter(function(e){return null!==e&&void 0!==e});this._selection.clear(l);for(var s=0;s<l.length;s++)t._selection.setItemSelected(l[s],!0);this.fallbackSelection&&!this._selection.get().length&&this._valueToItem(this.fallbackSelection)&&this.select(this.fallbackSelection)},_selectionChange:function(){var e=this._selection.get();this.multi?(this._setSelectedItems(e),this._setSelectedItem(e.length?e[0]:null)):null!==e&&void 0!==e?(this._setSelectedItems([e]),this._setSelectedItem(e)):(this._setSelectedItems([]),this._setSelectedItem(null))},_toggleSelected:function(e){var t=this.selectedValues.indexOf(e);t<0?this.push("selectedValues",e):this.splice("selectedValues",t,1)},_valuesToItems:function(e){return null==e?null:e.map(function(e){return this._valueToItem(e)},this)}},Polymer.IronMultiSelectableBehavior=[Polymer.IronSelectableBehavior,Polymer.IronMultiSelectableBehaviorImpl];</script><script>Polymer({is:"iron-selector",behaviors:[Polymer.IronMultiSelectableBehavior]});</script><script>Polymer.IronResizableBehavior={properties:{_parentResizable:{type:Object,observer:"_parentResizableChanged"},_notifyingDescendant:{type:Boolean,value:!1}},listeners:{"iron-request-resize-notifications":"_onIronRequestResizeNotifications"},created:function(){this._interestedResizables=[],this._boundNotifyResize=this.notifyResize.bind(this)},attached:function(){this._requestResizeNotifications()},detached:function(){this._parentResizable?this._parentResizable.stopResizeNotificationsFor(this):window.removeEventListener("resize",this._boundNotifyResize),this._parentResizable=null},notifyResize:function(){this.isAttached&&(this._interestedResizables.forEach(function(e){this.resizerShouldNotify(e)&&this._notifyDescendant(e)},this),this._fireResize())},assignParentResizable:function(e){this._parentResizable=e},stopResizeNotificationsFor:function(e){var i=this._interestedResizables.indexOf(e);i>-1&&(this._interestedResizables.splice(i,1),this.unlisten(e,"iron-resize","_onDescendantIronResize"))},resizerShouldNotify:function(e){return!0},_onDescendantIronResize:function(e){this._notifyingDescendant?e.stopPropagation():Polymer.Settings.useShadow||this._fireResize()},_fireResize:function(){this.fire("iron-resize",null,{node:this,bubbles:!1})},_onIronRequestResizeNotifications:function(e){var i=Polymer.dom(e).rootTarget;i!==this&&(-1===this._interestedResizables.indexOf(i)&&(this._interestedResizables.push(i),this.listen(i,"iron-resize","_onDescendantIronResize")),i.assignParentResizable(this),this._notifyDescendant(i),e.stopPropagation())},_parentResizableChanged:function(e){e&&window.removeEventListener("resize",this._boundNotifyResize)},_notifyDescendant:function(e){this.isAttached&&(this._notifyingDescendant=!0,e.notifyResize(),this._notifyingDescendant=!1)},_requestResizeNotifications:function(){if(this.isAttached)if("loading"===document.readyState){var e=this._requestResizeNotifications.bind(this);document.addEventListener("readystatechange",function i(){document.removeEventListener("readystatechange",i),e()})}else this.fire("iron-request-resize-notifications",null,{node:this,bubbles:!0,cancelable:!0}),this._parentResizable||(window.addEventListener("resize",this._boundNotifyResize),this.notifyResize())}};</script><dom-module id="paper-drawer-panel" assetpath="../bower_components/paper-drawer-panel/"><template><style>:host{display:block;position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;}#drawer{position:absolute;top:0;left:0;height:100%;background-color:white;-moz-box-sizing:border-box;box-sizing:border-box;@apply --paper-drawer-panel-drawer-container;}.transition-drawer{transition:-webkit-transform ease-in-out 0.3s, width ease-in-out 0.3s, visibility 0.3s;transition:transform ease-in-out 0.3s, width ease-in-out 0.3s, visibility 0.3s;}.left-drawer > #drawer{@apply --paper-drawer-panel-left-drawer-container;}.right-drawer > #drawer{left:auto;right:0;@apply --paper-drawer-panel-right-drawer-container;}#main{position:absolute;top:0;right:0;bottom:0;@apply --paper-drawer-panel-main-container;}.transition > #main{transition:left ease-in-out 0.3s, padding ease-in-out 0.3s;}.right-drawer > #main{left:0;}.right-drawer.transition > #main{transition:right ease-in-out 0.3s, padding ease-in-out 0.3s;}#main > ::slotted(*){height:100%;}#drawer > ::slotted(*){height:100%;}#scrim{position:absolute;top:0;right:0;bottom:0;left:0;visibility:hidden;opacity:0;transition:opacity ease-in-out 0.38s, visibility ease-in-out 0.38s;background-color:rgba(0, 0, 0, 0.3);@apply --paper-drawer-panel-scrim;}.narrow-layout > #drawer{will-change:transform;}.narrow-layout > #drawer.iron-selected{box-shadow:2px 2px 4px rgba(0, 0, 0, 0.15);}.right-drawer.narrow-layout > #drawer.iron-selected{box-shadow:-2px 2px 4px rgba(0, 0, 0, 0.15);}.narrow-layout > #drawer > ::slotted(*){border:0;}.left-drawer.narrow-layout > #drawer:not(.iron-selected){visibility:hidden;-webkit-transform:translateX(-100%);transform:translateX(-100%);}.right-drawer.narrow-layout > #drawer:not(.iron-selected){left:auto;visibility:hidden;-webkit-transform:translateX(100%);transform:translateX(100%);}.left-drawer.dragging > #drawer:not(.iron-selected),
+      input::-webkit-inner-spin-button{@apply --paper-input-container-input-webkit-spinner;}input::-webkit-clear-button{@apply --paper-input-container-input-webkit-clear;}input::-webkit-input-placeholder{color:var(--paper-input-container-color, var(--secondary-text-color));}input:-moz-placeholder{color:var(--paper-input-container-color, var(--secondary-text-color));}input::-moz-placeholder{color:var(--paper-input-container-color, var(--secondary-text-color));}input::-ms-clear{@apply --paper-input-container-ms-clear;}input:-ms-input-placeholder{color:var(--paper-input-container-color, var(--secondary-text-color));}label{pointer-events:none;}</style><paper-input-container id="container" no-label-float="[[noLabelFloat]]" always-float-label="[[_computeAlwaysFloatLabel(alwaysFloatLabel,placeholder)]]" auto-validate$="[[autoValidate]]" disabled$="[[disabled]]" invalid="[[invalid]]"><slot name="prefix" slot="prefix"></slot><label hidden$="[[!label]]" aria-hidden="true" for="input" slot="label">[[label]]</label><span id="template-placeholder"></span><slot name="suffix" slot="suffix"></slot><template is="dom-if" if="[[errorMessage]]"><paper-input-error aria-live="assertive" slot="add-on">[[errorMessage]]</paper-input-error></template><template is="dom-if" if="[[charCounter]]"><paper-input-char-counter slot="add-on"></paper-input-char-counter></template></paper-input-container></template><template id="v0"><input is="iron-input" id="input" slot="input" aria-labelledby$="[[_ariaLabelledBy]]" aria-describedby$="[[_ariaDescribedBy]]" disabled$="[[disabled]]" title$="[[title]]" bind-value="{{value}}" invalid="{{invalid}}" prevent-invalid-input="[[preventInvalidInput]]" allowed-pattern="[[allowedPattern]]" validator="[[validator]]" type$="[[type]]" pattern$="[[pattern]]" required$="[[required]]" autocomplete$="[[autocomplete]]" autofocus$="[[autofocus]]" inputmode$="[[inputmode]]" minlength$="[[minlength]]" maxlength$="[[maxlength]]" min$="[[min]]" max$="[[max]]" step$="[[step]]" name$="[[name]]" placeholder$="[[placeholder]]" readonly$="[[readonly]]" list$="[[list]]" size$="[[size]]" autocapitalize$="[[autocapitalize]]" autocorrect$="[[autocorrect]]" on-change="_onChange" tabindex$="[[tabIndex]]" autosave$="[[autosave]]" results$="[[results]]" accept$="[[accept]]" multiple$="[[multiple]]"></template><template id="v1"><iron-input bind-value="{{value}}" id="input" slot="input" maxlength$="[[maxlength]]" allowed-pattern="[[allowedPattern]]" invalid="{{invalid}}" validator="[[validator]]"><input id="nativeInput" aria-labelledby$="[[_ariaLabelledBy]]" aria-describedby$="[[_ariaDescribedBy]]" disabled$="[[disabled]]" title$="[[title]]" type$="[[type]]" pattern$="[[pattern]]" required$="[[required]]" autocomplete$="[[autocomplete]]" autofocus$="[[autofocus]]" inputmode$="[[inputmode]]" minlength$="[[minlength]]" maxlength$="[[maxlength]]" min$="[[min]]" max$="[[max]]" step$="[[step]]" name$="[[name]]" placeholder$="[[placeholder]]" readonly$="[[readonly]]" list$="[[list]]" size$="[[size]]" autocapitalize$="[[autocapitalize]]" autocorrect$="[[autocorrect]]" on-change="_onChange" tabindex$="[[tabIndex]]" autosave$="[[autosave]]" results$="[[results]]" accept$="[[accept]]" multiple$="[[multiple]]"></iron-input></template></dom-module><script>Polymer({is:"paper-input",behaviors:[Polymer.PaperInputBehavior,Polymer.IronFormElementBehavior],beforeRegister:function(){var e="function"==typeof document.createElement("iron-input")._initSlottedInput?"v1":"v0",t=Polymer.DomModule.import("paper-input","template"),n=Polymer.DomModule.import("paper-input","template#"+e),i=t.content.querySelector("#template-placeholder");i&&i.parentNode.replaceChild(n.content,i)},get _focusableElement(){return Polymer.Element?this.inputElement._inputElement:this.inputElement},listeners:{"iron-input-ready":"_onIronInputReady"},_onIronInputReady:function(){this.inputElement&&-1!==this._typesThatHaveText.indexOf(this.$.nativeInput.type)&&(this.alwaysFloatLabel=!0),this.inputElement.bindValue&&this.$.container._handleValueAndAutoValidate(this.inputElement)}});</script><dom-module id="login-form" assetpath="layouts/"><template><style is="custom-style" include="iron-flex iron-positioning"></style><style>:host{white-space:nowrap;}paper-input{display:block;margin-bottom:16px;}paper-checkbox{margin-right:8px;}paper-button{margin-left:72px;}.interact{height:125px;}#validatebox{margin-top:16px;text-align:center;}.validatemessage{margin-top:10px;}</style><div class="layout vertical center center-center fit"><img src="/static/icons/favicon-192x192.png" height="192"> <a href="#" id="hideKeyboardOnFocus"></a><div class="interact"><div id="loginform" hidden$="[[showSpinner]]"><paper-input id="passwordInput" label="Password" type="password" invalid="[[errorMessage]]" error-message="[[errorMessage]]" value="{{password}}"></paper-input><div class="layout horizontal center"><paper-checkbox for="" id="rememberLogin">Remember</paper-checkbox><paper-button id="loginButton">Log In</paper-button></div></div><div id="validatebox" hidden$="[[!showSpinner]]"><paper-spinner active="true"></paper-spinner><br><div class="validatemessage">[[computeLoadingMsg(isValidating)]]</div></div></div></div></template></dom-module><script>Polymer({is:"login-form",properties:{hass:{type:Object},connectionPromise:{type:Object,notify:!0,observer:"handleConnectionPromiseChanged"},errorMessage:{type:String,value:""},isValidating:{type:Boolean,observer:"isValidatingChanged",value:!1},showLoading:{type:Boolean,value:!1},showSpinner:{type:Boolean,computed:"computeShowSpinner(showLoading, isValidating)"},password:{type:String,value:""}},listeners:{keydown:"passwordKeyDown","loginButton.tap":"validatePassword"},attached:function(){window.removeInitMsg()},computeLoadingMsg:function(n){return n?"Connecting":"Loading data"},computeShowSpinner:function(n,e){return n||e},isValidatingChanged:function(n){n||this.async(function(){this.$.passwordInput.inputElement.inputElement&&this.$.passwordInput.inputElement.inputElement.focus()}.bind(this),10)},passwordKeyDown:function(n){13===n.keyCode?(this.validatePassword(),n.preventDefault()):this.errorMessage&&(this.errorMessage="")},validatePassword:function(){var n=this.password;this.$.hideKeyboardOnFocus.focus(),this.connectionPromise=window.createHassConnection(n),this.$.rememberLogin.checked&&this.connectionPromise.then(function(){localStorage.authToken=n})},handleConnectionPromiseChanged:function(n){if(n){var e=this;this.isValidating=!0,this.connectionPromise.then(function(){e.isValidating=!1,e.password=""},function(n){e.isValidating=!1,n===window.HAWS.ERR_CANNOT_CONNECT?e.errorMessage="Unable to connect":n===window.HAWS.ERR_INVALID_AUTH?e.errorMessage="Invalid password":e.errorMessage="Unknown error: "+n})}}});</script><script>Polymer({is:"iron-media-query",properties:{queryMatches:{type:Boolean,value:!1,readOnly:!0,notify:!0},query:{type:String,observer:"queryChanged"},full:{type:Boolean,value:!1},_boundMQHandler:{value:function(){return this.queryHandler.bind(this)}},_mq:{value:null}},attached:function(){this.style.display="none",this.queryChanged()},detached:function(){this._remove()},_add:function(){this._mq&&this._mq.addListener(this._boundMQHandler)},_remove:function(){this._mq&&this._mq.removeListener(this._boundMQHandler),this._mq=null},queryChanged:function(){this._remove();var e=this.query;e&&(this.full||"("===e[0]||(e="("+e+")"),this._mq=window.matchMedia(e),this._add(),this.queryHandler(this._mq))},queryHandler:function(e){this._setQueryMatches(e.matches)}});</script><script>Polymer.IronSelection=function(e){this.selection=[],this.selectCallback=e},Polymer.IronSelection.prototype={get:function(){return this.multi?this.selection.slice():this.selection[0]},clear:function(e){this.selection.slice().forEach(function(t){(!e||e.indexOf(t)<0)&&this.setItemSelected(t,!1)},this)},isSelected:function(e){return this.selection.indexOf(e)>=0},setItemSelected:function(e,t){if(null!=e&&t!==this.isSelected(e)){if(t)this.selection.push(e);else{var i=this.selection.indexOf(e);i>=0&&this.selection.splice(i,1)}this.selectCallback&&this.selectCallback(e,t)}},select:function(e){this.multi?this.toggle(e):this.get()!==e&&(this.setItemSelected(this.get(),!1),this.setItemSelected(e,!0))},toggle:function(e){this.setItemSelected(e,!this.isSelected(e))}};</script><script>Polymer.IronSelectableBehavior={properties:{attrForSelected:{type:String,value:null},selected:{type:String,notify:!0},selectedItem:{type:Object,readOnly:!0,notify:!0},activateEvent:{type:String,value:"tap",observer:"_activateEventChanged"},selectable:String,selectedClass:{type:String,value:"iron-selected"},selectedAttribute:{type:String,value:null},fallbackSelection:{type:String,value:null},items:{type:Array,readOnly:!0,notify:!0,value:function(){return[]}},_excludedLocalNames:{type:Object,value:function(){return{template:1,"dom-bind":1,"dom-if":1,"dom-repeat":1}}}},observers:["_updateAttrForSelected(attrForSelected)","_updateSelected(selected)","_checkFallback(fallbackSelection)"],created:function(){this._bindFilterItem=this._filterItem.bind(this),this._selection=new Polymer.IronSelection(this._applySelection.bind(this))},attached:function(){this._observer=this._observeItems(this),this._addListener(this.activateEvent)},detached:function(){this._observer&&Polymer.dom(this).unobserveNodes(this._observer),this._removeListener(this.activateEvent)},indexOf:function(e){return this.items.indexOf(e)},select:function(e){this.selected=e},selectPrevious:function(){var e=this.items.length,t=(Number(this._valueToIndex(this.selected))-1+e)%e;this.selected=this._indexToValue(t)},selectNext:function(){var e=(Number(this._valueToIndex(this.selected))+1)%this.items.length;this.selected=this._indexToValue(e)},selectIndex:function(e){this.select(this._indexToValue(e))},forceSynchronousItemUpdate:function(){this._observer&&"function"==typeof this._observer.flush?this._observer.flush():this._updateItems()},get _shouldUpdateSelection(){return null!=this.selected},_checkFallback:function(){this._updateSelected()},_addListener:function(e){this.listen(this,e,"_activateHandler")},_removeListener:function(e){this.unlisten(this,e,"_activateHandler")},_activateEventChanged:function(e,t){this._removeListener(t),this._addListener(e)},_updateItems:function(){var e=Polymer.dom(this).queryDistributedElements(this.selectable||"*");e=Array.prototype.filter.call(e,this._bindFilterItem),this._setItems(e)},_updateAttrForSelected:function(){this.selectedItem&&(this.selected=this._valueForItem(this.selectedItem))},_updateSelected:function(){this._selectSelected(this.selected)},_selectSelected:function(e){if(this.items){var t=this._valueToItem(this.selected);t?this._selection.select(t):this._selection.clear(),this.fallbackSelection&&this.items.length&&void 0===this._selection.get()&&(this.selected=this.fallbackSelection)}},_filterItem:function(e){return!this._excludedLocalNames[e.localName]},_valueToItem:function(e){return null==e?null:this.items[this._valueToIndex(e)]},_valueToIndex:function(e){if(!this.attrForSelected)return Number(e);for(var t,i=0;t=this.items[i];i++)if(this._valueForItem(t)==e)return i},_indexToValue:function(e){if(!this.attrForSelected)return e;var t=this.items[e];return t?this._valueForItem(t):void 0},_valueForItem:function(e){if(!e)return null;var t=e[Polymer.CaseMap.dashToCamelCase(this.attrForSelected)];return void 0!=t?t:e.getAttribute(this.attrForSelected)},_applySelection:function(e,t){this.selectedClass&&this.toggleClass(this.selectedClass,t,e),this.selectedAttribute&&this.toggleAttribute(this.selectedAttribute,t,e),this._selectionChange(),this.fire("iron-"+(t?"select":"deselect"),{item:e})},_selectionChange:function(){this._setSelectedItem(this._selection.get())},_observeItems:function(e){return Polymer.dom(e).observeNodes(function(e){this._updateItems(),this._updateSelected(),this.fire("iron-items-changed",e,{bubbles:!1,cancelable:!1})})},_activateHandler:function(e){for(var t=e.target,i=this.items;t&&t!=this;){var s=i.indexOf(t);if(s>=0){var l=this._indexToValue(s);return void this._itemActivate(l,t)}t=t.parentNode}},_itemActivate:function(e,t){this.fire("iron-activate",{selected:e,item:t},{cancelable:!0}).defaultPrevented||this.select(e)}};</script><script>Polymer.IronMultiSelectableBehaviorImpl={properties:{multi:{type:Boolean,value:!1,observer:"multiChanged"},selectedValues:{type:Array,notify:!0,value:function(){return[]}},selectedItems:{type:Array,readOnly:!0,notify:!0,value:function(){return[]}}},observers:["_updateSelected(selectedValues.splices)"],select:function(e){this.multi?this._toggleSelected(e):this.selected=e},multiChanged:function(e){this._selection.multi=e,this._updateSelected()},get _shouldUpdateSelection(){return null!=this.selected||null!=this.selectedValues&&this.selectedValues.length},_updateAttrForSelected:function(){this.multi?this.selectedItems&&this.selectedItems.length>0&&(this.selectedValues=this.selectedItems.map(function(e){return this._indexToValue(this.indexOf(e))},this).filter(function(e){return null!=e},this)):Polymer.IronSelectableBehavior._updateAttrForSelected.apply(this)},_updateSelected:function(){this.multi?this._selectMulti(this.selectedValues):this._selectSelected(this.selected)},_selectMulti:function(e){e=e||[];var t=(this._valuesToItems(e)||[]).filter(function(e){return null!==e&&void 0!==e});this._selection.clear(t);for(var l=0;l<t.length;l++)this._selection.setItemSelected(t[l],!0);this.fallbackSelection&&!this._selection.get().length&&this._valueToItem(this.fallbackSelection)&&this.select(this.fallbackSelection)},_selectionChange:function(){var e=this._selection.get();this.multi?(this._setSelectedItems(e),this._setSelectedItem(e.length?e[0]:null)):null!==e&&void 0!==e?(this._setSelectedItems([e]),this._setSelectedItem(e)):(this._setSelectedItems([]),this._setSelectedItem(null))},_toggleSelected:function(e){var t=this.selectedValues.indexOf(e);t<0?this.push("selectedValues",e):this.splice("selectedValues",t,1)},_valuesToItems:function(e){return null==e?null:e.map(function(e){return this._valueToItem(e)},this)}},Polymer.IronMultiSelectableBehavior=[Polymer.IronSelectableBehavior,Polymer.IronMultiSelectableBehaviorImpl];</script><script>Polymer({is:"iron-selector",behaviors:[Polymer.IronMultiSelectableBehavior]});</script><script>Polymer.IronResizableBehavior={properties:{_parentResizable:{type:Object,observer:"_parentResizableChanged"},_notifyingDescendant:{type:Boolean,value:!1}},listeners:{"iron-request-resize-notifications":"_onIronRequestResizeNotifications"},created:function(){this._interestedResizables=[],this._boundNotifyResize=this.notifyResize.bind(this)},attached:function(){this._requestResizeNotifications()},detached:function(){this._parentResizable?this._parentResizable.stopResizeNotificationsFor(this):window.removeEventListener("resize",this._boundNotifyResize),this._parentResizable=null},notifyResize:function(){this.isAttached&&(this._interestedResizables.forEach(function(e){this.resizerShouldNotify(e)&&this._notifyDescendant(e)},this),this._fireResize())},assignParentResizable:function(e){this._parentResizable=e},stopResizeNotificationsFor:function(e){var i=this._interestedResizables.indexOf(e);i>-1&&(this._interestedResizables.splice(i,1),this.unlisten(e,"iron-resize","_onDescendantIronResize"))},resizerShouldNotify:function(e){return!0},_onDescendantIronResize:function(e){this._notifyingDescendant?e.stopPropagation():Polymer.Settings.useShadow||this._fireResize()},_fireResize:function(){this.fire("iron-resize",null,{node:this,bubbles:!1})},_onIronRequestResizeNotifications:function(e){var i=Polymer.dom(e).rootTarget;i!==this&&(-1===this._interestedResizables.indexOf(i)&&(this._interestedResizables.push(i),this.listen(i,"iron-resize","_onDescendantIronResize")),i.assignParentResizable(this),this._notifyDescendant(i),e.stopPropagation())},_parentResizableChanged:function(e){e&&window.removeEventListener("resize",this._boundNotifyResize)},_notifyDescendant:function(e){this.isAttached&&(this._notifyingDescendant=!0,e.notifyResize(),this._notifyingDescendant=!1)},_requestResizeNotifications:function(){if(this.isAttached)if("loading"===document.readyState){var e=this._requestResizeNotifications.bind(this);document.addEventListener("readystatechange",function i(){document.removeEventListener("readystatechange",i),e()})}else this.fire("iron-request-resize-notifications",null,{node:this,bubbles:!0,cancelable:!0}),this._parentResizable||(window.addEventListener("resize",this._boundNotifyResize),this.notifyResize())}};</script><dom-module id="paper-drawer-panel" assetpath="../bower_components/paper-drawer-panel/"><template><style>:host{display:block;position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;}#drawer{position:absolute;top:0;left:0;height:100%;background-color:white;-moz-box-sizing:border-box;box-sizing:border-box;@apply --paper-drawer-panel-drawer-container;}.transition-drawer{transition:-webkit-transform ease-in-out 0.3s, width ease-in-out 0.3s, visibility 0.3s;transition:transform ease-in-out 0.3s, width ease-in-out 0.3s, visibility 0.3s;}.left-drawer > #drawer{@apply --paper-drawer-panel-left-drawer-container;}.right-drawer > #drawer{left:auto;right:0;@apply --paper-drawer-panel-right-drawer-container;}#main{position:absolute;top:0;right:0;bottom:0;@apply --paper-drawer-panel-main-container;}.transition > #main{transition:left ease-in-out 0.3s, padding ease-in-out 0.3s;}.right-drawer > #main{left:0;}.right-drawer.transition > #main{transition:right ease-in-out 0.3s, padding ease-in-out 0.3s;}#main > ::slotted(*){height:100%;}#drawer > ::slotted(*){height:100%;}#scrim{position:absolute;top:0;right:0;bottom:0;left:0;visibility:hidden;opacity:0;transition:opacity ease-in-out 0.38s, visibility ease-in-out 0.38s;background-color:rgba(0, 0, 0, 0.3);@apply --paper-drawer-panel-scrim;}.narrow-layout > #drawer{will-change:transform;}.narrow-layout > #drawer.iron-selected{box-shadow:2px 2px 4px rgba(0, 0, 0, 0.15);}.right-drawer.narrow-layout > #drawer.iron-selected{box-shadow:-2px 2px 4px rgba(0, 0, 0, 0.15);}.narrow-layout > #drawer > ::slotted(*){border:0;}.left-drawer.narrow-layout > #drawer:not(.iron-selected){visibility:hidden;-webkit-transform:translateX(-100%);transform:translateX(-100%);}.right-drawer.narrow-layout > #drawer:not(.iron-selected){left:auto;visibility:hidden;-webkit-transform:translateX(100%);transform:translateX(100%);}.left-drawer.dragging > #drawer:not(.iron-selected),
       .left-drawer.peeking > #drawer:not(.iron-selected),
       .right-drawer.dragging > #drawer:not(.iron-selected),
       .right-drawer.peeking > #drawer:not(.iron-selected){visibility:visible;}.narrow-layout > #main{padding:0;}.right-drawer.narrow-layout > #main{left:0;right:0;}.narrow-layout > #main:not(.iron-selected) > #scrim,
-      .dragging > #main > #scrim{visibility:visible;opacity:var(--paper-drawer-panel-scrim-opacity, 1);}.narrow-layout > #main > *{margin:0;min-height:100%;left:0;right:0;-moz-box-sizing:border-box;box-sizing:border-box;}</style><iron-media-query id="mq" on-query-matches-changed="_onQueryMatchesChanged" query="[[_computeMediaQuery(forceNarrow, responsiveWidth)]]"></iron-media-query><iron-selector attr-for-selected="id" class$="[[_computeIronSelectorClass(narrow, _transition, dragging, rightDrawer, peeking)]]" on-transitionend="_onTransitionEnd" activate-event="" selected="[[selected]]"><div id="main" style$="[[_computeMainStyle(narrow, rightDrawer, drawerWidth)]]"><slot name="main"></slot><div id="scrim" on-tap="closeDrawer"></div></div><div id="drawer" style$="[[_computeDrawerStyle(drawerWidth)]]"><slot id="drawerSlot" name="drawer"></slot></div></iron-selector></template><script>!function(){"use strict";function e(e){var t=[];for(var i in e)e.hasOwnProperty(i)&&e[i]&&t.push(i);return t.join(" ")}var t=null;Polymer({is:"paper-drawer-panel",behaviors:[Polymer.IronResizableBehavior],properties:{defaultSelected:{type:String,value:"main"},disableEdgeSwipe:{type:Boolean,value:!1},disableSwipe:{type:Boolean,value:!1},dragging:{type:Boolean,value:!1,readOnly:!0,notify:!0},drawerWidth:{type:String,value:"256px"},edgeSwipeSensitivity:{type:Number,value:30},forceNarrow:{type:Boolean,value:!1},hasTransform:{type:Boolean,value:function(){return"transform"in this.style}},hasWillChange:{type:Boolean,value:function(){return"willChange"in this.style}},narrow:{reflectToAttribute:!0,type:Boolean,value:!1,readOnly:!0,notify:!0},peeking:{type:Boolean,value:!1,readOnly:!0,notify:!0},responsiveWidth:{type:String,value:"768px"},rightDrawer:{type:Boolean,value:!1},selected:{reflectToAttribute:!0,notify:!0,type:String,value:null},drawerFocusSelector:{type:String,value:'a[href]:not([tabindex="-1"]),area[href]:not([tabindex="-1"]),input:not([disabled]):not([tabindex="-1"]),select:not([disabled]):not([tabindex="-1"]),textarea:not([disabled]):not([tabindex="-1"]),button:not([disabled]):not([tabindex="-1"]),iframe:not([tabindex="-1"]),[tabindex]:not([tabindex="-1"]),[contentEditable=true]:not([tabindex="-1"])'},_transition:{type:Boolean,value:!1}},listeners:{tap:"_onTap",track:"_onTrack",down:"_downHandler",up:"_upHandler"},observers:["_forceNarrowChanged(forceNarrow, defaultSelected)","_toggleFocusListener(selected)"],ready:function(){this._transition=!0,this._boundFocusListener=this._didFocus.bind(this),console.warn(this.is,"is deprecated. Please use app-layout instead!")},togglePanel:function(){this._isMainSelected()?this.openDrawer():this.closeDrawer()},openDrawer:function(){requestAnimationFrame(function(){this.toggleClass("transition-drawer",!0,this.$.drawer),this.selected="drawer"}.bind(this))},closeDrawer:function(){requestAnimationFrame(function(){this.toggleClass("transition-drawer",!0,this.$.drawer),this.selected="main"}.bind(this))},_onTransitionEnd:function(e){if(Polymer.dom(e).localTarget===this.$.drawer&&("left"!==e.propertyName&&"right"!==e.propertyName||this.notifyResize(),"transform"===e.propertyName&&(requestAnimationFrame(function(){this.toggleClass("transition-drawer",!1,this.$.drawer)}.bind(this)),"drawer"===this.selected))){var t=this._getAutoFocusedNode();t&&t.focus()}},_computeIronSelectorClass:function(t,i,r,n,a){return e({dragging:r,"narrow-layout":t,"right-drawer":n,"left-drawer":!n,transition:i,peeking:a})},_computeDrawerStyle:function(e){return"width:"+e+";"},_computeMainStyle:function(e,t,i){var r="";return r+="left:"+(e||t?"0":i)+";",t&&(r+="right:"+(e?"":i)+";"),r},_computeMediaQuery:function(e,t){return e?"":"(max-width: "+t+")"},_computeSwipeOverlayHidden:function(e,t){return!e||t},_onTrack:function(e){if(!t||this===t)switch(e.detail.state){case"start":this._trackStart(e);break;case"track":this._trackX(e);break;case"end":this._trackEnd(e)}},_responsiveChange:function(e){this._setNarrow(e),this.selected=this.narrow?this.defaultSelected:null,this.setScrollDirection(this._swipeAllowed()?"y":"all"),this.fire("paper-responsive-change",{narrow:this.narrow})},_onQueryMatchesChanged:function(e){this._responsiveChange(e.detail.value)},_forceNarrowChanged:function(){this._responsiveChange(this.forceNarrow||this.$.mq.queryMatches)},_swipeAllowed:function(){return this.narrow&&!this.disableSwipe},_isMainSelected:function(){return"main"===this.selected},_startEdgePeek:function(){this.width=this.$.drawer.offsetWidth,this._moveDrawer(this._translateXForDeltaX(this.rightDrawer?-this.edgeSwipeSensitivity:this.edgeSwipeSensitivity)),this._setPeeking(!0)},_stopEdgePeek:function(){this.peeking&&(this._setPeeking(!1),this._moveDrawer(null))},_downHandler:function(e){!this.dragging&&this._isMainSelected()&&this._isEdgeTouch(e)&&!t&&(this._startEdgePeek(),e.preventDefault(),t=this)},_upHandler:function(){this._stopEdgePeek(),t=null},_onTap:function(e){var t=Polymer.dom(e).localTarget;t&&this.drawerToggleAttribute&&t.hasAttribute(this.drawerToggleAttribute)&&this.togglePanel()},_isEdgeTouch:function(e){var t=e.detail.x;return!this.disableEdgeSwipe&&this._swipeAllowed()&&(this.rightDrawer?t>=this.offsetWidth-this.edgeSwipeSensitivity:t<=this.edgeSwipeSensitivity)},_trackStart:function(e){this._swipeAllowed()&&(t=this,this._setDragging(!0),this._isMainSelected()&&this._setDragging(this.peeking||this._isEdgeTouch(e)),this.dragging&&(this.width=this.$.drawer.offsetWidth,this._transition=!1))},_translateXForDeltaX:function(e){var t=this._isMainSelected();return this.rightDrawer?Math.max(0,t?this.width+e:e):Math.min(0,t?e-this.width:e)},_trackX:function(e){if(this.dragging){var t=e.detail.dx;if(this.peeking){if(Math.abs(t)<=this.edgeSwipeSensitivity)return;this._setPeeking(!1)}this._moveDrawer(this._translateXForDeltaX(t))}},_trackEnd:function(e){if(this.dragging){var i=e.detail.dx>0;this._setDragging(!1),this._transition=!0,t=null,this._moveDrawer(null),this.rightDrawer?this[i?"closeDrawer":"openDrawer"]():this[i?"openDrawer":"closeDrawer"]()}},_transformForTranslateX:function(e){return null===e?"":this.hasWillChange?"translateX("+e+"px)":"translate3d("+e+"px, 0, 0)"},_moveDrawer:function(e){this.transform(this._transformForTranslateX(e),this.$.drawer)},_getDrawerSlot:function(){return Polymer.dom(this.$.drawerSlot).getDistributedNodes()[0]},_getAutoFocusedNode:function(){return this.drawerFocusSelector?Polymer.dom(this._getDrawerSlot()).querySelector(this.drawerFocusSelector):null},_toggleFocusListener:function(e){"drawer"===e?this.addEventListener("focus",this._boundFocusListener,!0):this.removeEventListener("focus",this._boundFocusListener,!0)},_didFocus:function(e){var t=this._getAutoFocusedNode();if(t){var i=Polymer.dom(e).path,r=(i[0],this._getDrawerSlot());-1!==i.indexOf(r)||(e.stopPropagation(),t.focus())}},_isDrawerClosed:function(e,t){return!e||"drawer"!==t}})}();</script></dom-module><dom-module id="iron-pages" assetpath="../bower_components/iron-pages/"><template><style>:host{display:block;}:host > ::slotted(:not(.iron-selected)){display:none !important;}</style><slot></slot></template><script>Polymer({is:"iron-pages",behaviors:[Polymer.IronResizableBehavior,Polymer.IronSelectableBehavior],properties:{activateEvent:{type:String,value:null}},observers:["_selectedPageChanged(selected)"],_selectedPageChanged:function(e,a){this.async(this.notifyResize)}});</script></dom-module><script>!function(){"use strict";Polymer({is:"app-route",properties:{route:{type:Object,notify:!0},pattern:{type:String},data:{type:Object,value:function(){return{}},notify:!0},queryParams:{type:Object,value:function(){return{}},notify:!0},tail:{type:Object,value:function(){return{path:null,prefix:null,__queryParams:null}},notify:!0},active:{type:Boolean,notify:!0,readOnly:!0},_queryParamsUpdating:{type:Boolean,value:!1},_matched:{type:String,value:""}},observers:["__tryToMatch(route.path, pattern)","__updatePathOnDataChange(data.*)","__tailPathChanged(tail.path)","__routeQueryParamsChanged(route.__queryParams)","__tailQueryParamsChanged(tail.__queryParams)","__queryParamsChanged(queryParams.*)"],created:function(){this.linkPaths("route.__queryParams","tail.__queryParams"),this.linkPaths("tail.__queryParams","route.__queryParams")},__routeQueryParamsChanged:function(t){var a=this;if(t&&this.tail){if(this.tail.__queryParams!==t&&this.set("tail.__queryParams",t),!this.active||this._queryParamsUpdating)return;var i={},e=!1;for(var r in t)i[r]=t[r],!e&&a.queryParams&&t[r]===a.queryParams[r]||(e=!0);for(var r in this.queryParams)if(e||!(r in t)){e=!0;break}if(!e)return;this._queryParamsUpdating=!0,this.set("queryParams",i),this._queryParamsUpdating=!1}},__tailQueryParamsChanged:function(t){t&&this.route&&this.route.__queryParams!=t&&this.set("route.__queryParams",t)},__queryParamsChanged:function(t){this.active&&!this._queryParamsUpdating&&this.set("route.__"+t.path,t.value)},__resetProperties:function(){this._setActive(!1),this._matched=null},__tryToMatch:function(){var t=this;if(this.route){var a=this.route.path,i=this.pattern;if(i)if(a){for(var e=a.split("/"),r=i.split("/"),s=[],h={},n=0;n<r.length;n++){var u=r[n];if(!u&&""!==u)break;var _=e.shift();if(!_&&""!==_)return void t.__resetProperties();if(s.push(_),":"==u.charAt(0))h[u.slice(1)]=_;else if(u!==_)return void t.__resetProperties()}this._matched=s.join("/");var o={};this.active||(o.active=!0);var l=this.route.prefix+this._matched,p=e.join("/");e.length>0&&(p="/"+p),this.tail&&this.tail.prefix===l&&this.tail.path===p||(o.tail={prefix:l,path:p,__queryParams:this.route.__queryParams}),o.data=h,this._dataInUrl={};for(var f in h)t._dataInUrl[f]=h[f];this.setProperties?(this.active||this._setActive(!0),this.setProperties(o)):this.__setMulti(o)}else this.__resetProperties()}},__tailPathChanged:function(t){if(this.active){var a=t,i=this._matched;a&&("/"!==a.charAt(0)&&(a="/"+a),i+=a),this.set("route.path",i)}},__updatePathOnDataChange:function(){if(this.route&&this.active){var t=this.__getLink({});t!==this.__getLink(this._dataInUrl)&&this.set("route.path",t)}},__getLink:function(t){var a=this,i={tail:null};for(var e in this.data)i[e]=a.data[e];for(var e in t)i[e]=t[e];var r=this.pattern.split("/").map(function(t){return":"==t[0]&&(t=i[t.slice(1)]),t},this);return i.tail&&i.tail.path&&(r.length>0&&"/"===i.tail.path.charAt(0)?r.push(i.tail.path.slice(1)):r.push(i.tail.path)),r.join("/")},__setMulti:function(t){var a=this;for(var i in t)a._propertySetter(i,t[i]);void 0!==t.data&&(this._pathEffector("data",this.data),this._notifyChange("data")),void 0!==t.active&&(this._pathEffector("active",this.active),this._notifyChange("active")),void 0!==t.tail&&(this._pathEffector("tail",this.tail),this._notifyChange("tail"))}})}();</script><script>!function(){"use strict";function e(e,a){if(void 0===t){t=!1;try{var h=new URL("b","http://a");h.pathname="c%20d",t="http://a/c%20d"===h.href,t=t&&"http://www.google.com/?foo%20bar"===new URL("http://www.google.com/?foo bar").href}catch(e){}}return t?new URL(e,a):(n||(n=document.implementation.createHTMLDocument("url"),i=n.createElement("base"),n.head.appendChild(i),o=n.createElement("a")),i.href=a,o.href=e.replace(/ /g,"%20"),o)}var t,n,i,o;Polymer({is:"iron-location",properties:{path:{type:String,notify:!0,value:function(){return window.decodeURIComponent(window.location.pathname)}},query:{type:String,notify:!0,value:function(){return window.location.search.slice(1)}},hash:{type:String,notify:!0,value:function(){return window.decodeURIComponent(window.location.hash.slice(1))}},dwellTime:{type:Number,value:2e3},urlSpaceRegex:{type:String,value:""},_urlSpaceRegExp:{computed:"_makeRegExp(urlSpaceRegex)"},_lastChangedAt:{type:Number},_initialized:{type:Boolean,value:!1}},hostAttributes:{hidden:!0},observers:["_updateUrl(path, query, hash)"],attached:function(){this.listen(window,"hashchange","_hashChanged"),this.listen(window,"location-changed","_urlChanged"),this.listen(window,"popstate","_urlChanged"),this.listen(document.body,"click","_globalOnClick"),this._lastChangedAt=window.performance.now()-(this.dwellTime-200),this._initialized=!0,this._urlChanged()},detached:function(){this.unlisten(window,"hashchange","_hashChanged"),this.unlisten(window,"location-changed","_urlChanged"),this.unlisten(window,"popstate","_urlChanged"),this.unlisten(document.body,"click","_globalOnClick"),this._initialized=!1},_hashChanged:function(){this.hash=window.decodeURIComponent(window.location.hash.substring(1))},_urlChanged:function(){this._dontUpdateUrl=!0,this._hashChanged(),this.path=window.decodeURIComponent(window.location.pathname),this.query=window.location.search.substring(1),this._dontUpdateUrl=!1,this._updateUrl()},_getUrl:function(){var e=window.encodeURI(this.path).replace(/\#/g,"%23").replace(/\?/g,"%3F"),t="";this.query&&(t="?"+this.query.replace(/\#/g,"%23"));var n="";return this.hash&&(n="#"+window.encodeURI(this.hash)),e+t+n},_updateUrl:function(){if(!this._dontUpdateUrl&&this._initialized&&(this.path!==window.decodeURIComponent(window.location.pathname)||this.query!==window.location.search.substring(1)||this.hash!==window.decodeURIComponent(window.location.hash.substring(1)))){var t=e(this._getUrl(),window.location.protocol+"//"+window.location.host).href,n=window.performance.now(),i=this._lastChangedAt+this.dwellTime>n;this._lastChangedAt=n,i?window.history.replaceState({},"",t):window.history.pushState({},"",t),this.fire("location-changed",{},{node:window})}},_globalOnClick:function(e){if(!e.defaultPrevented){var t=this._getSameOriginLinkHref(e);t&&(e.preventDefault(),t!==window.location.href&&(window.history.pushState({},"",t),this.fire("location-changed",{},{node:window})))}},_getSameOriginLinkHref:function(t){if(0!==t.button)return null;if(t.metaKey||t.ctrlKey)return null;for(var n=Polymer.dom(t).path,i=null,o=0;o<n.length;o++){var a=n[o];if("A"===a.tagName&&a.href){i=a;break}}if(!i)return null;if("_blank"===i.target)return null;if(("_top"===i.target||"_parent"===i.target)&&window.top!==window)return null;var h,r=i.href;h=null!=document.baseURI?e(r,document.baseURI):e(r);var l;l=window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.host;if((h.origin?h.origin:h.protocol+"//"+h.host)!==l)return null;var d=h.pathname+h.search+h.hash;return"/"!==d[0]&&(d="/"+d),this._urlSpaceRegExp&&!this._urlSpaceRegExp.test(d)?null:e(d,window.location.href).href},_makeRegExp:function(e){return RegExp(e)}})}();</script><script>"use strict";Polymer({is:"iron-query-params",properties:{paramsString:{type:String,notify:!0,observer:"paramsStringChanged"},paramsObject:{type:Object,notify:!0,value:function(){return{}}},_dontReact:{type:Boolean,value:!1}},hostAttributes:{hidden:!0},observers:["paramsObjectChanged(paramsObject.*)"],paramsStringChanged:function(){this._dontReact=!0,this.paramsObject=this._decodeParams(this.paramsString),this._dontReact=!1},paramsObjectChanged:function(){this._dontReact||(this.paramsString=this._encodeParams(this.paramsObject).replace(/%3F/g,"?").replace(/%2F/g,"/").replace(/'/g,"%27"))},_encodeParams:function(e){var t=[];for(var a in e){var n=e[a];""===n?t.push(encodeURIComponent(a)):n&&t.push(encodeURIComponent(a)+"="+encodeURIComponent(n.toString()))}return t.join("&")},_decodeParams:function(e){for(var t={},a=(e=(e||"").replace(/\+/g,"%20")).split("&"),n=0;n<a.length;n++){var r=a[n].split("=");r[0]&&(t[decodeURIComponent(r[0])]=decodeURIComponent(r[1]||""))}return t}});</script><script>!function(){"use strict";Polymer.AppRouteConverterBehavior={properties:{route:{type:Object,notify:!0},queryParams:{type:Object,notify:!0},path:{type:String,notify:!0}},observers:["_locationChanged(path, queryParams)","_routeChanged(route.prefix, route.path)","_routeQueryParamsChanged(route.__queryParams)"],created:function(){this.linkPaths("route.__queryParams","queryParams"),this.linkPaths("queryParams","route.__queryParams")},_locationChanged:function(){this.route&&this.route.path===this.path&&this.queryParams===this.route.__queryParams||(this.route={prefix:"",path:this.path,__queryParams:this.queryParams})},_routeChanged:function(){this.route&&(this.path=this.route.prefix+this.route.path)},_routeQueryParamsChanged:function(t){this.route&&(this.queryParams=t)}}}();</script><dom-module id="app-location" assetpath="../bower_components/app-route/"><template><iron-location path="{{__path}}" query="{{__query}}" hash="{{__hash}}" url-space-regex="{{urlSpaceRegex}}"></iron-location><iron-query-params params-string="{{__query}}" params-object="{{queryParams}}"></iron-query-params></template><script>!function(){"use strict";Polymer({is:"app-location",properties:{route:{type:Object,notify:!0},useHashAsPath:{type:Boolean,value:!1},urlSpaceRegex:{type:String,notify:!0},__queryParams:{type:Object},__path:{type:String},__query:{type:String},__hash:{type:String},path:{type:String,observer:"__onPathChanged"},_isReady:{type:Boolean}},behaviors:[Polymer.AppRouteConverterBehavior],observers:["__computeRoutePath(useHashAsPath, __hash, __path)"],ready:function(){this._isReady=!0},__computeRoutePath:function(){this.path=this.useHashAsPath?this.__hash:this.__path},__onPathChanged:function(){this._isReady&&(this.useHashAsPath?this.__hash=this.path:this.__path=this.path)}})}();</script></dom-module><dom-module id="iron-icon" assetpath="../bower_components/iron-icon/"><template><style>:host{@apply --layout-inline;@apply --layout-center-center;position:relative;vertical-align:middle;fill:var(--iron-icon-fill-color, currentcolor);stroke:var(--iron-icon-stroke-color, none);width:var(--iron-icon-width, 24px);height:var(--iron-icon-height, 24px);@apply --iron-icon;}:host([hidden]){display:none;}</style></template><script>Polymer({is:"iron-icon",properties:{icon:{type:String},theme:{type:String},src:{type:String},_meta:{value:Polymer.Base.create("iron-meta",{type:"iconset"})}},observers:["_updateIcon(_meta, isAttached)","_updateIcon(theme, isAttached)","_srcChanged(src, isAttached)","_iconChanged(icon, isAttached)"],_DEFAULT_ICONSET:"icons",_iconChanged:function(t){var i=(t||"").split(":");this._iconName=i.pop(),this._iconsetName=i.pop()||this._DEFAULT_ICONSET,this._updateIcon()},_srcChanged:function(t){this._updateIcon()},_usesIconset:function(){return this.icon||!this.src},_updateIcon:function(){this._usesIconset()?(this._img&&this._img.parentNode&&Polymer.dom(this.root).removeChild(this._img),""===this._iconName?this._iconset&&this._iconset.removeIcon(this):this._iconsetName&&this._meta&&(this._iconset=this._meta.byKey(this._iconsetName),this._iconset?(this._iconset.applyIcon(this,this._iconName,this.theme),this.unlisten(window,"iron-iconset-added","_updateIcon")):this.listen(window,"iron-iconset-added","_updateIcon"))):(this._iconset&&this._iconset.removeIcon(this),this._img||(this._img=document.createElement("img"),this._img.style.width="100%",this._img.style.height="100%",this._img.draggable=!1),this._img.src=this.src,Polymer.dom(this.root).appendChild(this._img))}});</script></dom-module><script>Polymer.IronMenuBehaviorImpl={properties:{focusedItem:{observer:"_focusedItemChanged",readOnly:!0,type:Object},attrForItemTitle:{type:String},disabled:{type:Boolean,value:!1,observer:"_disabledChanged"}},_SEARCH_RESET_TIMEOUT_MS:1e3,_previousTabIndex:0,hostAttributes:{role:"menu"},observers:["_updateMultiselectable(multi)"],listeners:{focus:"_onFocus",keydown:"_onKeydown","iron-items-changed":"_onIronItemsChanged"},keyBindings:{up:"_onUpKey",down:"_onDownKey",esc:"_onEscKey","shift+tab:keydown":"_onShiftTabDown"},attached:function(){this._resetTabindices()},select:function(e){this._defaultFocusAsync&&(this.cancelAsync(this._defaultFocusAsync),this._defaultFocusAsync=null);var t=this._valueToItem(e);t&&t.hasAttribute("disabled")||(this._setFocusedItem(t),Polymer.IronMultiSelectableBehaviorImpl.select.apply(this,arguments))},_resetTabindices:function(){var e=this.multi?this.selectedItems&&this.selectedItems[0]:this.selectedItem;this.items.forEach(function(t){t.setAttribute("tabindex",t===e?"0":"-1")},this)},_updateMultiselectable:function(e){e?this.setAttribute("aria-multiselectable","true"):this.removeAttribute("aria-multiselectable")},_focusWithKeyboardEvent:function(e){var t=this;this.cancelDebouncer("_clearSearchText");for(var i,s=this._searchText||"",o=(s+=(e.key&&1==e.key.length?e.key:String.fromCharCode(e.keyCode)).toLocaleLowerCase()).length,n=0;i=this.items[n];n++)if(!i.hasAttribute("disabled")){var r=t.attrForItemTitle||"textContent",a=(i[r]||i.getAttribute(r)||"").trim();if(!(a.length<o)&&a.slice(0,o).toLocaleLowerCase()==s){t._setFocusedItem(i);break}}this._searchText=s,this.debounce("_clearSearchText",this._clearSearchText,this._SEARCH_RESET_TIMEOUT_MS)},_clearSearchText:function(){this._searchText=""},_focusPrevious:function(){for(var e=this,t=this.items.length,i=Number(this.indexOf(this.focusedItem)),s=1;s<t+1;s++){var o=e.items[(i-s+t)%t];if(!o.hasAttribute("disabled")){var n=Polymer.dom(o).getOwnerRoot()||document;if(e._setFocusedItem(o),Polymer.dom(n).activeElement==o)return}}},_focusNext:function(){for(var e=this,t=this.items.length,i=Number(this.indexOf(this.focusedItem)),s=1;s<t+1;s++){var o=e.items[(i+s)%t];if(!o.hasAttribute("disabled")){var n=Polymer.dom(o).getOwnerRoot()||document;if(e._setFocusedItem(o),Polymer.dom(n).activeElement==o)return}}},_applySelection:function(e,t){t?e.setAttribute("aria-selected","true"):e.removeAttribute("aria-selected"),Polymer.IronSelectableBehavior._applySelection.apply(this,arguments)},_focusedItemChanged:function(e,t){t&&t.setAttribute("tabindex","-1"),!e||e.hasAttribute("disabled")||this.disabled||(e.setAttribute("tabindex","0"),e.focus())},_onIronItemsChanged:function(e){e.detail.addedNodes.length&&this._resetTabindices()},_onShiftTabDown:function(e){var t=this.getAttribute("tabindex");Polymer.IronMenuBehaviorImpl._shiftTabPressed=!0,this._setFocusedItem(null),this.setAttribute("tabindex","-1"),this.async(function(){this.setAttribute("tabindex",t),Polymer.IronMenuBehaviorImpl._shiftTabPressed=!1},1)},_onFocus:function(e){if(!Polymer.IronMenuBehaviorImpl._shiftTabPressed){var t=Polymer.dom(e).rootTarget;(t===this||void 0===t.tabIndex||this.isLightDescendant(t))&&(this._defaultFocusAsync=this.async(function(){var e=this.multi?this.selectedItems&&this.selectedItems[0]:this.selectedItem;this._setFocusedItem(null),e?this._setFocusedItem(e):this.items[0]&&this._focusNext()}))}},_onUpKey:function(e){this._focusPrevious(),e.detail.keyboardEvent.preventDefault()},_onDownKey:function(e){this._focusNext(),e.detail.keyboardEvent.preventDefault()},_onEscKey:function(e){var t=this.focusedItem;t&&t.blur()},_onKeydown:function(e){this.keyboardEventMatchesKeys(e,"up down esc")||this._focusWithKeyboardEvent(e),e.stopPropagation()},_activateHandler:function(e){Polymer.IronSelectableBehavior._activateHandler.call(this,e),e.stopPropagation()},_disabledChanged:function(e){e?(this._previousTabIndex=this.hasAttribute("tabindex")?this.tabIndex:0,this.removeAttribute("tabindex")):this.hasAttribute("tabindex")||this.setAttribute("tabindex",this._previousTabIndex)}},Polymer.IronMenuBehaviorImpl._shiftTabPressed=!1,Polymer.IronMenuBehavior=[Polymer.IronMultiSelectableBehavior,Polymer.IronA11yKeysBehavior,Polymer.IronMenuBehaviorImpl];</script><script>Polymer.IronMenubarBehaviorImpl={hostAttributes:{role:"menubar"},keyBindings:{left:"_onLeftKey",right:"_onRightKey"},_onUpKey:function(e){this.focusedItem.click(),e.detail.keyboardEvent.preventDefault()},_onDownKey:function(e){this.focusedItem.click(),e.detail.keyboardEvent.preventDefault()},get _isRTL(){return"rtl"===window.getComputedStyle(this).direction},_onLeftKey:function(e){this._isRTL?this._focusNext():this._focusPrevious(),e.detail.keyboardEvent.preventDefault()},_onRightKey:function(e){this._isRTL?this._focusPrevious():this._focusNext(),e.detail.keyboardEvent.preventDefault()},_onKeydown:function(e){this.keyboardEventMatchesKeys(e,"up down left right esc")||this._focusWithKeyboardEvent(e)}},Polymer.IronMenubarBehavior=[Polymer.IronMenuBehavior,Polymer.IronMenubarBehaviorImpl];</script><dom-module id="paper-icon-button" assetpath="../bower_components/paper-icon-button/"><template strip-whitespace=""><style>:host{display:inline-block;position:relative;padding:8px;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;z-index:0;line-height:1;width:40px;height:40px;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);-webkit-tap-highlight-color:transparent;box-sizing:border-box !important;@apply --paper-icon-button;}:host #ink{color:var(--paper-icon-button-ink-color, var(--primary-text-color));opacity:0.6;}:host([disabled]){color:var(--paper-icon-button-disabled-text, var(--disabled-text-color));pointer-events:none;cursor:auto;@apply --paper-icon-button-disabled;}:host(:hover){@apply --paper-icon-button-hover;}iron-icon{--iron-icon-width:100%;--iron-icon-height:100%;}</style><iron-icon id="icon" src="[[src]]" icon="[[icon]]" alt$="[[alt]]"></iron-icon></template><script>Polymer({is:"paper-icon-button",hostAttributes:{role:"button",tabindex:"0"},behaviors:[Polymer.PaperInkyFocusBehavior],properties:{src:{type:String},icon:{type:String},alt:{type:String,observer:"_altChanged"}},_altChanged:function(t,e){var r=this.getAttribute("aria-label");r&&e!=r||this.setAttribute("aria-label",t)}});</script></dom-module><script>Polymer({is:"iron-iconset-svg",properties:{name:{type:String,observer:"_nameChanged"},size:{type:Number,value:24},rtlMirroring:{type:Boolean,value:!1}},created:function(){this._meta=new Polymer.IronMeta({type:"iconset",key:null,value:null})},attached:function(){this.style.display="none"},getIconNames:function(){return this._icons=this._createIconMap(),Object.keys(this._icons).map(function(e){return this.name+":"+e},this)},applyIcon:function(e,t){this.removeIcon(e);var n=this._cloneIcon(t,this.rtlMirroring&&this._targetIsRTL(e));if(n){var i=Polymer.dom(e.root||e);return i.insertBefore(n,i.childNodes[0]),e._svgIcon=n}return null},removeIcon:function(e){e._svgIcon&&(Polymer.dom(e.root||e).removeChild(e._svgIcon),e._svgIcon=null)},_targetIsRTL:function(e){return null==this.__targetIsRTL&&(e&&e.nodeType!==Node.ELEMENT_NODE&&(e=e.host),this.__targetIsRTL=e&&"rtl"===window.getComputedStyle(e).direction),this.__targetIsRTL},_nameChanged:function(){this._meta.value=null,this._meta.key=this.name,this._meta.value=this,this.async(function(){this.fire("iron-iconset-added",this,{node:window})})},_createIconMap:function(){var e=Object.create(null);return Polymer.dom(this).querySelectorAll("[id]").forEach(function(t){e[t.id]=t}),e},_cloneIcon:function(e,t){return this._icons=this._icons||this._createIconMap(),this._prepareSvgClone(this._icons[e],this.size,t)},_prepareSvgClone:function(e,t,n){if(e){var i=e.cloneNode(!0),r=document.createElementNS("http://www.w3.org/2000/svg","svg"),o=i.getAttribute("viewBox")||"0 0 "+t+" "+t,s="pointer-events: none; display: block; width: 100%; height: 100%;";return n&&i.hasAttribute("mirror-in-rtl")&&(s+="-webkit-transform:scale(-1,1);transform:scale(-1,1);"),r.setAttribute("viewBox",o),r.setAttribute("preserveAspectRatio","xMidYMid meet"),r.style.cssText=s,r.appendChild(i).removeAttribute("id"),r}return null}});</script><iron-iconset-svg name="paper-tabs" size="24"><svg><defs><g id="chevron-left"><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"></path></g><g id="chevron-right"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"></path></g></defs></svg></iron-iconset-svg><dom-module id="paper-tab" assetpath="../bower_components/paper-tabs/"><template><style>:host{@apply --layout-inline;@apply --layout-center;@apply --layout-center-justified;@apply --layout-flex-auto;position:relative;padding:0 12px;overflow:hidden;cursor:pointer;vertical-align:middle;@apply --paper-font-common-base;@apply --paper-tab;}:host(:focus){outline:none;}:host([link]){padding:0;}.tab-content{height:100%;transform:translateZ(0);-webkit-transform:translateZ(0);transition:opacity 0.1s cubic-bezier(0.4, 0.0, 1, 1);@apply --layout-horizontal;@apply --layout-center-center;@apply --layout-flex-auto;@apply --paper-tab-content;}:host(:not(.iron-selected)) > .tab-content{opacity:0.8;@apply --paper-tab-content-unselected;}:host(:focus) .tab-content{opacity:1;font-weight:700;}paper-ripple{color:var(--paper-tab-ink, var(--paper-yellow-a100));}.tab-content > ::slotted(a){@apply --layout-flex-auto;height:100%;}</style><div class="tab-content"><slot></slot></div></template><script>Polymer({is:"paper-tab",behaviors:[Polymer.IronControlState,Polymer.IronButtonState,Polymer.PaperRippleBehavior],properties:{link:{type:Boolean,value:!1,reflectToAttribute:!0}},hostAttributes:{role:"tab"},listeners:{down:"_updateNoink",tap:"_onTap"},attached:function(){this._updateNoink()},get _parentNoink(){var t=Polymer.dom(this).parentNode;return!!t&&!!t.noink},_updateNoink:function(){this.noink=!!this.noink||!!this._parentNoink},_onTap:function(t){if(this.link){var e=this.queryEffectiveChildren("a");if(!e)return;if(t.target===e)return;e.click()}}});</script></dom-module><dom-module id="paper-tabs" assetpath="../bower_components/paper-tabs/"><template><style>:host{@apply --layout;@apply --layout-center;height:48px;font-size:14px;font-weight:500;overflow:hidden;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);-webkit-tap-highlight-color:transparent;@apply --paper-tabs;}:host-context([dir=rtl]){@apply --layout-horizontal-reverse;}#tabsContainer{position:relative;height:100%;white-space:nowrap;overflow:hidden;@apply --layout-flex-auto;@apply --paper-tabs-container;}#tabsContent{height:100%;-moz-flex-basis:auto;-ms-flex-basis:auto;flex-basis:auto;@apply --paper-tabs-content;}#tabsContent.scrollable{position:absolute;white-space:nowrap;}#tabsContent:not(.scrollable),
+      .dragging > #main > #scrim{visibility:visible;opacity:var(--paper-drawer-panel-scrim-opacity, 1);}.narrow-layout > #main > *{margin:0;min-height:100%;left:0;right:0;-moz-box-sizing:border-box;box-sizing:border-box;}</style><iron-media-query id="mq" on-query-matches-changed="_onQueryMatchesChanged" query="[[_computeMediaQuery(forceNarrow, responsiveWidth)]]"></iron-media-query><iron-selector attr-for-selected="id" class$="[[_computeIronSelectorClass(narrow, _transition, dragging, rightDrawer, peeking)]]" on-transitionend="_onTransitionEnd" activate-event="" selected="[[selected]]"><div id="main" style$="[[_computeMainStyle(narrow, rightDrawer, drawerWidth)]]"><slot name="main"></slot><div id="scrim" on-tap="closeDrawer"></div></div><div id="drawer" style$="[[_computeDrawerStyle(drawerWidth)]]"><slot id="drawerSlot" name="drawer"></slot></div></iron-selector></template><script>!function(){"use strict";function e(e){var t=[];for(var i in e)e.hasOwnProperty(i)&&e[i]&&t.push(i);return t.join(" ")}var t=null;Polymer({is:"paper-drawer-panel",behaviors:[Polymer.IronResizableBehavior],properties:{defaultSelected:{type:String,value:"main"},disableEdgeSwipe:{type:Boolean,value:!1},disableSwipe:{type:Boolean,value:!1},dragging:{type:Boolean,value:!1,readOnly:!0,notify:!0},drawerWidth:{type:String,value:"256px"},edgeSwipeSensitivity:{type:Number,value:30},forceNarrow:{type:Boolean,value:!1},hasTransform:{type:Boolean,value:function(){return"transform"in this.style}},hasWillChange:{type:Boolean,value:function(){return"willChange"in this.style}},narrow:{reflectToAttribute:!0,type:Boolean,value:!1,readOnly:!0,notify:!0},peeking:{type:Boolean,value:!1,readOnly:!0,notify:!0},responsiveWidth:{type:String,value:"768px"},rightDrawer:{type:Boolean,value:!1},selected:{reflectToAttribute:!0,notify:!0,type:String,value:null},drawerFocusSelector:{type:String,value:'a[href]:not([tabindex="-1"]),area[href]:not([tabindex="-1"]),input:not([disabled]):not([tabindex="-1"]),select:not([disabled]):not([tabindex="-1"]),textarea:not([disabled]):not([tabindex="-1"]),button:not([disabled]):not([tabindex="-1"]),iframe:not([tabindex="-1"]),[tabindex]:not([tabindex="-1"]),[contentEditable=true]:not([tabindex="-1"])'},_transition:{type:Boolean,value:!1}},listeners:{tap:"_onTap",track:"_onTrack",down:"_downHandler",up:"_upHandler"},observers:["_forceNarrowChanged(forceNarrow, defaultSelected)","_toggleFocusListener(selected)"],ready:function(){this._transition=!0,this._boundFocusListener=this._didFocus.bind(this),console.warn(this.is,"is deprecated. Please use app-layout instead!")},togglePanel:function(){this._isMainSelected()?this.openDrawer():this.closeDrawer()},openDrawer:function(){requestAnimationFrame(function(){this.toggleClass("transition-drawer",!0,this.$.drawer),this.selected="drawer"}.bind(this))},closeDrawer:function(){requestAnimationFrame(function(){this.toggleClass("transition-drawer",!0,this.$.drawer),this.selected="main"}.bind(this))},_onTransitionEnd:function(e){if(Polymer.dom(e).localTarget===this.$.drawer&&("left"!==e.propertyName&&"right"!==e.propertyName||this.notifyResize(),"transform"===e.propertyName&&(requestAnimationFrame(function(){this.toggleClass("transition-drawer",!1,this.$.drawer)}.bind(this)),"drawer"===this.selected))){var t=this._getAutoFocusedNode();t&&t.focus()}},_computeIronSelectorClass:function(t,i,r,n,a){return e({dragging:r,"narrow-layout":t,"right-drawer":n,"left-drawer":!n,transition:i,peeking:a})},_computeDrawerStyle:function(e){return"width:"+e+";"},_computeMainStyle:function(e,t,i){var r="";return r+="left:"+(e||t?"0":i)+";",t&&(r+="right:"+(e?"":i)+";"),r},_computeMediaQuery:function(e,t){return e?"":"(max-width: "+t+")"},_computeSwipeOverlayHidden:function(e,t){return!e||t},_onTrack:function(e){if(!t||this===t)switch(e.detail.state){case"start":this._trackStart(e);break;case"track":this._trackX(e);break;case"end":this._trackEnd(e)}},_responsiveChange:function(e){this._setNarrow(e),this.selected=this.narrow?this.defaultSelected:null,this.setScrollDirection(this._swipeAllowed()?"y":"all"),this.fire("paper-responsive-change",{narrow:this.narrow})},_onQueryMatchesChanged:function(e){this._responsiveChange(e.detail.value)},_forceNarrowChanged:function(){this._responsiveChange(this.forceNarrow||this.$.mq.queryMatches)},_swipeAllowed:function(){return this.narrow&&!this.disableSwipe},_isMainSelected:function(){return"main"===this.selected},_startEdgePeek:function(){this.width=this.$.drawer.offsetWidth,this._moveDrawer(this._translateXForDeltaX(this.rightDrawer?-this.edgeSwipeSensitivity:this.edgeSwipeSensitivity)),this._setPeeking(!0)},_stopEdgePeek:function(){this.peeking&&(this._setPeeking(!1),this._moveDrawer(null))},_downHandler:function(e){!this.dragging&&this._isMainSelected()&&this._isEdgeTouch(e)&&!t&&(this._startEdgePeek(),e.preventDefault(),t=this)},_upHandler:function(){this._stopEdgePeek(),t=null},_onTap:function(e){var t=Polymer.dom(e).localTarget;t&&this.drawerToggleAttribute&&t.hasAttribute(this.drawerToggleAttribute)&&this.togglePanel()},_isEdgeTouch:function(e){var t=e.detail.x;return!this.disableEdgeSwipe&&this._swipeAllowed()&&(this.rightDrawer?t>=this.offsetWidth-this.edgeSwipeSensitivity:t<=this.edgeSwipeSensitivity)},_trackStart:function(e){this._swipeAllowed()&&(t=this,this._setDragging(!0),this._isMainSelected()&&this._setDragging(this.peeking||this._isEdgeTouch(e)),this.dragging&&(this.width=this.$.drawer.offsetWidth,this._transition=!1))},_translateXForDeltaX:function(e){var t=this._isMainSelected();return this.rightDrawer?Math.max(0,t?this.width+e:e):Math.min(0,t?e-this.width:e)},_trackX:function(e){if(this.dragging){var t=e.detail.dx;if(this.peeking){if(Math.abs(t)<=this.edgeSwipeSensitivity)return;this._setPeeking(!1)}this._moveDrawer(this._translateXForDeltaX(t))}},_trackEnd:function(e){if(this.dragging){var i=e.detail.dx>0;this._setDragging(!1),this._transition=!0,t=null,this._moveDrawer(null),this.rightDrawer?this[i?"closeDrawer":"openDrawer"]():this[i?"openDrawer":"closeDrawer"]()}},_transformForTranslateX:function(e){return null===e?"":this.hasWillChange?"translateX("+e+"px)":"translate3d("+e+"px, 0, 0)"},_moveDrawer:function(e){this.transform(this._transformForTranslateX(e),this.$.drawer)},_getDrawerSlot:function(){return Polymer.dom(this.$.drawerSlot).getDistributedNodes()[0]},_getAutoFocusedNode:function(){return this.drawerFocusSelector?Polymer.dom(this._getDrawerSlot()).querySelector(this.drawerFocusSelector):null},_toggleFocusListener:function(e){"drawer"===e?this.addEventListener("focus",this._boundFocusListener,!0):this.removeEventListener("focus",this._boundFocusListener,!0)},_didFocus:function(e){var t=this._getAutoFocusedNode();if(t){var i=Polymer.dom(e).path,r=(i[0],this._getDrawerSlot());-1!==i.indexOf(r)||(e.stopPropagation(),t.focus())}},_isDrawerClosed:function(e,t){return!e||"drawer"!==t}})}();</script></dom-module><dom-module id="iron-pages" assetpath="../bower_components/iron-pages/"><template><style>:host{display:block;}:host > ::slotted(:not(.iron-selected)){display:none !important;}</style><slot></slot></template><script>Polymer({is:"iron-pages",behaviors:[Polymer.IronResizableBehavior,Polymer.IronSelectableBehavior],properties:{activateEvent:{type:String,value:null}},observers:["_selectedPageChanged(selected)"],_selectedPageChanged:function(e,a){this.async(this.notifyResize)}});</script></dom-module><script>!function(){"use strict";Polymer({is:"app-route",properties:{route:{type:Object,notify:!0},pattern:{type:String},data:{type:Object,value:function(){return{}},notify:!0},queryParams:{type:Object,value:function(){return{}},notify:!0},tail:{type:Object,value:function(){return{path:null,prefix:null,__queryParams:null}},notify:!0},active:{type:Boolean,notify:!0,readOnly:!0},_queryParamsUpdating:{type:Boolean,value:!1},_matched:{type:String,value:""}},observers:["__tryToMatch(route.path, pattern)","__updatePathOnDataChange(data.*)","__tailPathChanged(tail.path)","__routeQueryParamsChanged(route.__queryParams)","__tailQueryParamsChanged(tail.__queryParams)","__queryParamsChanged(queryParams.*)"],created:function(){this.linkPaths("route.__queryParams","tail.__queryParams"),this.linkPaths("tail.__queryParams","route.__queryParams")},__routeQueryParamsChanged:function(t){if(t&&this.tail){if(this.tail.__queryParams!==t&&this.set("tail.__queryParams",t),!this.active||this._queryParamsUpdating)return;var a={},i=!1;for(var e in t)a[e]=t[e],!i&&this.queryParams&&t[e]===this.queryParams[e]||(i=!0);for(var e in this.queryParams)if(i||!(e in t)){i=!0;break}if(!i)return;this._queryParamsUpdating=!0,this.set("queryParams",a),this._queryParamsUpdating=!1}},__tailQueryParamsChanged:function(t){t&&this.route&&this.route.__queryParams!=t&&this.set("route.__queryParams",t)},__queryParamsChanged:function(t){this.active&&!this._queryParamsUpdating&&this.set("route.__"+t.path,t.value)},__resetProperties:function(){this._setActive(!1),this._matched=null},__tryToMatch:function(){if(this.route){var t=this.route.path,a=this.pattern;if(a)if(t){for(var i=t.split("/"),e=a.split("/"),r=[],s={},h=0;h<e.length;h++){var n=e[h];if(!n&&""!==n)break;var u=i.shift();if(!u&&""!==u)return void this.__resetProperties();if(r.push(u),":"==n.charAt(0))s[n.slice(1)]=u;else if(n!==u)return void this.__resetProperties()}this._matched=r.join("/");var _={};this.active||(_.active=!0);var o=this.route.prefix+this._matched,l=i.join("/");i.length>0&&(l="/"+l),this.tail&&this.tail.prefix===o&&this.tail.path===l||(_.tail={prefix:o,path:l,__queryParams:this.route.__queryParams}),_.data=s,this._dataInUrl={};for(var p in s)this._dataInUrl[p]=s[p];this.setProperties?(this.active||this._setActive(!0),this.setProperties(_)):this.__setMulti(_)}else this.__resetProperties()}},__tailPathChanged:function(t){if(this.active){var a=t,i=this._matched;a&&("/"!==a.charAt(0)&&(a="/"+a),i+=a),this.set("route.path",i)}},__updatePathOnDataChange:function(){if(this.route&&this.active){var t=this.__getLink({});t!==this.__getLink(this._dataInUrl)&&this.set("route.path",t)}},__getLink:function(t){var a={tail:null};for(var i in this.data)a[i]=this.data[i];for(var i in t)a[i]=t[i];var e=this.pattern.split("/").map(function(t){return":"==t[0]&&(t=a[t.slice(1)]),t},this);return a.tail&&a.tail.path&&(e.length>0&&"/"===a.tail.path.charAt(0)?e.push(a.tail.path.slice(1)):e.push(a.tail.path)),e.join("/")},__setMulti:function(t){for(var a in t)this._propertySetter(a,t[a]);void 0!==t.data&&(this._pathEffector("data",this.data),this._notifyChange("data")),void 0!==t.active&&(this._pathEffector("active",this.active),this._notifyChange("active")),void 0!==t.tail&&(this._pathEffector("tail",this.tail),this._notifyChange("tail"))}})}();</script><script>!function(){"use strict";function e(e,a){if(void 0===t){t=!1;try{var h=new URL("b","http://a");h.pathname="c%20d",t="http://a/c%20d"===h.href,t=t&&"http://www.google.com/?foo%20bar"===new URL("http://www.google.com/?foo bar").href}catch(e){}}return t?new URL(e,a):(n||(n=document.implementation.createHTMLDocument("url"),i=n.createElement("base"),n.head.appendChild(i),o=n.createElement("a")),i.href=a,o.href=e.replace(/ /g,"%20"),o)}var t,n,i,o;Polymer({is:"iron-location",properties:{path:{type:String,notify:!0,value:function(){return window.decodeURIComponent(window.location.pathname)}},query:{type:String,notify:!0,value:function(){return window.location.search.slice(1)}},hash:{type:String,notify:!0,value:function(){return window.decodeURIComponent(window.location.hash.slice(1))}},dwellTime:{type:Number,value:2e3},urlSpaceRegex:{type:String,value:""},_urlSpaceRegExp:{computed:"_makeRegExp(urlSpaceRegex)"},_lastChangedAt:{type:Number},_initialized:{type:Boolean,value:!1}},hostAttributes:{hidden:!0},observers:["_updateUrl(path, query, hash)"],attached:function(){this.listen(window,"hashchange","_hashChanged"),this.listen(window,"location-changed","_urlChanged"),this.listen(window,"popstate","_urlChanged"),this.listen(document.body,"click","_globalOnClick"),this._lastChangedAt=window.performance.now()-(this.dwellTime-200),this._initialized=!0,this._urlChanged()},detached:function(){this.unlisten(window,"hashchange","_hashChanged"),this.unlisten(window,"location-changed","_urlChanged"),this.unlisten(window,"popstate","_urlChanged"),this.unlisten(document.body,"click","_globalOnClick"),this._initialized=!1},_hashChanged:function(){this.hash=window.decodeURIComponent(window.location.hash.substring(1))},_urlChanged:function(){this._dontUpdateUrl=!0,this._hashChanged(),this.path=window.decodeURIComponent(window.location.pathname),this.query=window.location.search.substring(1),this._dontUpdateUrl=!1,this._updateUrl()},_getUrl:function(){var e=window.encodeURI(this.path).replace(/\#/g,"%23").replace(/\?/g,"%3F"),t="";this.query&&(t="?"+this.query.replace(/\#/g,"%23"));var n="";return this.hash&&(n="#"+window.encodeURI(this.hash)),e+t+n},_updateUrl:function(){if(!this._dontUpdateUrl&&this._initialized&&(this.path!==window.decodeURIComponent(window.location.pathname)||this.query!==window.location.search.substring(1)||this.hash!==window.decodeURIComponent(window.location.hash.substring(1)))){var t=e(this._getUrl(),window.location.protocol+"//"+window.location.host).href,n=window.performance.now(),i=this._lastChangedAt+this.dwellTime>n;this._lastChangedAt=n,i?window.history.replaceState({},"",t):window.history.pushState({},"",t),this.fire("location-changed",{},{node:window})}},_globalOnClick:function(e){if(!e.defaultPrevented){var t=this._getSameOriginLinkHref(e);t&&(e.preventDefault(),t!==window.location.href&&(window.history.pushState({},"",t),this.fire("location-changed",{},{node:window})))}},_getSameOriginLinkHref:function(t){if(0!==t.button)return null;if(t.metaKey||t.ctrlKey)return null;for(var n=Polymer.dom(t).path,i=null,o=0;o<n.length;o++){var a=n[o];if("A"===a.tagName&&a.href){i=a;break}}if(!i)return null;if("_blank"===i.target)return null;if(("_top"===i.target||"_parent"===i.target)&&window.top!==window)return null;var h,r=i.href;h=null!=document.baseURI?e(r,document.baseURI):e(r);var l;l=window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.host;if((h.origin?h.origin:h.protocol+"//"+h.host)!==l)return null;var d=h.pathname+h.search+h.hash;return"/"!==d[0]&&(d="/"+d),this._urlSpaceRegExp&&!this._urlSpaceRegExp.test(d)?null:e(d,window.location.href).href},_makeRegExp:function(e){return RegExp(e)}})}();</script><script>"use strict";Polymer({is:"iron-query-params",properties:{paramsString:{type:String,notify:!0,observer:"paramsStringChanged"},paramsObject:{type:Object,notify:!0,value:function(){return{}}},_dontReact:{type:Boolean,value:!1}},hostAttributes:{hidden:!0},observers:["paramsObjectChanged(paramsObject.*)"],paramsStringChanged:function(){this._dontReact=!0,this.paramsObject=this._decodeParams(this.paramsString),this._dontReact=!1},paramsObjectChanged:function(){this._dontReact||(this.paramsString=this._encodeParams(this.paramsObject).replace(/%3F/g,"?").replace(/%2F/g,"/").replace(/'/g,"%27"))},_encodeParams:function(e){var t=[];for(var a in e){var n=e[a];""===n?t.push(encodeURIComponent(a)):n&&t.push(encodeURIComponent(a)+"="+encodeURIComponent(n.toString()))}return t.join("&")},_decodeParams:function(e){for(var t={},a=(e=(e||"").replace(/\+/g,"%20")).split("&"),n=0;n<a.length;n++){var r=a[n].split("=");r[0]&&(t[decodeURIComponent(r[0])]=decodeURIComponent(r[1]||""))}return t}});</script><script>!function(){"use strict";Polymer.AppRouteConverterBehavior={properties:{route:{type:Object,notify:!0},queryParams:{type:Object,notify:!0},path:{type:String,notify:!0}},observers:["_locationChanged(path, queryParams)","_routeChanged(route.prefix, route.path)","_routeQueryParamsChanged(route.__queryParams)"],created:function(){this.linkPaths("route.__queryParams","queryParams"),this.linkPaths("queryParams","route.__queryParams")},_locationChanged:function(){this.route&&this.route.path===this.path&&this.queryParams===this.route.__queryParams||(this.route={prefix:"",path:this.path,__queryParams:this.queryParams})},_routeChanged:function(){this.route&&(this.path=this.route.prefix+this.route.path)},_routeQueryParamsChanged:function(t){this.route&&(this.queryParams=t)}}}();</script><dom-module id="app-location" assetpath="../bower_components/app-route/"><template><iron-location path="{{__path}}" query="{{__query}}" hash="{{__hash}}" url-space-regex="{{urlSpaceRegex}}"></iron-location><iron-query-params params-string="{{__query}}" params-object="{{queryParams}}"></iron-query-params></template><script>!function(){"use strict";Polymer({is:"app-location",properties:{route:{type:Object,notify:!0},useHashAsPath:{type:Boolean,value:!1},urlSpaceRegex:{type:String,notify:!0},__queryParams:{type:Object},__path:{type:String},__query:{type:String},__hash:{type:String},path:{type:String,observer:"__onPathChanged"},_isReady:{type:Boolean}},behaviors:[Polymer.AppRouteConverterBehavior],observers:["__computeRoutePath(useHashAsPath, __hash, __path)"],ready:function(){this._isReady=!0},__computeRoutePath:function(){this.path=this.useHashAsPath?this.__hash:this.__path},__onPathChanged:function(){this._isReady&&(this.useHashAsPath?this.__hash=this.path:this.__path=this.path)}})}();</script></dom-module><dom-module id="iron-icon" assetpath="../bower_components/iron-icon/"><template><style>:host{@apply --layout-inline;@apply --layout-center-center;position:relative;vertical-align:middle;fill:var(--iron-icon-fill-color, currentcolor);stroke:var(--iron-icon-stroke-color, none);width:var(--iron-icon-width, 24px);height:var(--iron-icon-height, 24px);@apply --iron-icon;}:host([hidden]){display:none;}</style></template><script>Polymer({is:"iron-icon",properties:{icon:{type:String},theme:{type:String},src:{type:String},_meta:{value:Polymer.Base.create("iron-meta",{type:"iconset"})}},observers:["_updateIcon(_meta, isAttached)","_updateIcon(theme, isAttached)","_srcChanged(src, isAttached)","_iconChanged(icon, isAttached)"],_DEFAULT_ICONSET:"icons",_iconChanged:function(t){var i=(t||"").split(":");this._iconName=i.pop(),this._iconsetName=i.pop()||this._DEFAULT_ICONSET,this._updateIcon()},_srcChanged:function(t){this._updateIcon()},_usesIconset:function(){return this.icon||!this.src},_updateIcon:function(){this._usesIconset()?(this._img&&this._img.parentNode&&Polymer.dom(this.root).removeChild(this._img),""===this._iconName?this._iconset&&this._iconset.removeIcon(this):this._iconsetName&&this._meta&&(this._iconset=this._meta.byKey(this._iconsetName),this._iconset?(this._iconset.applyIcon(this,this._iconName,this.theme),this.unlisten(window,"iron-iconset-added","_updateIcon")):this.listen(window,"iron-iconset-added","_updateIcon"))):(this._iconset&&this._iconset.removeIcon(this),this._img||(this._img=document.createElement("img"),this._img.style.width="100%",this._img.style.height="100%",this._img.draggable=!1),this._img.src=this.src,Polymer.dom(this.root).appendChild(this._img))}});</script></dom-module><script>Polymer.IronMenuBehaviorImpl={properties:{focusedItem:{observer:"_focusedItemChanged",readOnly:!0,type:Object},attrForItemTitle:{type:String},disabled:{type:Boolean,value:!1,observer:"_disabledChanged"}},_MODIFIER_KEYS:["Alt","AltGraph","CapsLock","Control","Fn","FnLock","Hyper","Meta","NumLock","OS","ScrollLock","Shift","Super","Symbol","SymbolLock"],_SEARCH_RESET_TIMEOUT_MS:1e3,_previousTabIndex:0,hostAttributes:{role:"menu"},observers:["_updateMultiselectable(multi)"],listeners:{focus:"_onFocus",keydown:"_onKeydown","iron-items-changed":"_onIronItemsChanged"},keyBindings:{up:"_onUpKey",down:"_onDownKey",esc:"_onEscKey","shift+tab:keydown":"_onShiftTabDown"},attached:function(){this._resetTabindices()},select:function(e){this._defaultFocusAsync&&(this.cancelAsync(this._defaultFocusAsync),this._defaultFocusAsync=null);var t=this._valueToItem(e);t&&t.hasAttribute("disabled")||(this._setFocusedItem(t),Polymer.IronMultiSelectableBehaviorImpl.select.apply(this,arguments))},_resetTabindices:function(){var e=this.multi?this.selectedItems&&this.selectedItems[0]:this.selectedItem;this.items.forEach(function(t){t.setAttribute("tabindex",t===e?"0":"-1")},this)},_updateMultiselectable:function(e){e?this.setAttribute("aria-multiselectable","true"):this.removeAttribute("aria-multiselectable")},_focusWithKeyboardEvent:function(e){if(-1===this._MODIFIER_KEYS.indexOf(e.key)){this.cancelDebouncer("_clearSearchText");for(var t,i=this._searchText||"",s=(i+=(e.key&&1==e.key.length?e.key:String.fromCharCode(e.keyCode)).toLocaleLowerCase()).length,o=0;t=this.items[o];o++)if(!t.hasAttribute("disabled")){var n=this.attrForItemTitle||"textContent",r=(t[n]||t.getAttribute(n)||"").trim();if(!(r.length<s)&&r.slice(0,s).toLocaleLowerCase()==i){this._setFocusedItem(t);break}}this._searchText=i,this.debounce("_clearSearchText",this._clearSearchText,this._SEARCH_RESET_TIMEOUT_MS)}},_clearSearchText:function(){this._searchText=""},_focusPrevious:function(){for(var e=this.items.length,t=Number(this.indexOf(this.focusedItem)),i=1;i<e+1;i++){var s=this.items[(t-i+e)%e];if(!s.hasAttribute("disabled")){var o=Polymer.dom(s).getOwnerRoot()||document;if(this._setFocusedItem(s),Polymer.dom(o).activeElement==s)return}}},_focusNext:function(){for(var e=this.items.length,t=Number(this.indexOf(this.focusedItem)),i=1;i<e+1;i++){var s=this.items[(t+i)%e];if(!s.hasAttribute("disabled")){var o=Polymer.dom(s).getOwnerRoot()||document;if(this._setFocusedItem(s),Polymer.dom(o).activeElement==s)return}}},_applySelection:function(e,t){t?e.setAttribute("aria-selected","true"):e.removeAttribute("aria-selected"),Polymer.IronSelectableBehavior._applySelection.apply(this,arguments)},_focusedItemChanged:function(e,t){t&&t.setAttribute("tabindex","-1"),!e||e.hasAttribute("disabled")||this.disabled||(e.setAttribute("tabindex","0"),e.focus())},_onIronItemsChanged:function(e){e.detail.addedNodes.length&&this._resetTabindices()},_onShiftTabDown:function(e){var t=this.getAttribute("tabindex");Polymer.IronMenuBehaviorImpl._shiftTabPressed=!0,this._setFocusedItem(null),this.setAttribute("tabindex","-1"),this.async(function(){this.setAttribute("tabindex",t),Polymer.IronMenuBehaviorImpl._shiftTabPressed=!1},1)},_onFocus:function(e){if(!Polymer.IronMenuBehaviorImpl._shiftTabPressed){var t=Polymer.dom(e).rootTarget;(t===this||void 0===t.tabIndex||this.isLightDescendant(t))&&(this._defaultFocusAsync=this.async(function(){var e=this.multi?this.selectedItems&&this.selectedItems[0]:this.selectedItem;this._setFocusedItem(null),e?this._setFocusedItem(e):this.items[0]&&this._focusNext()}))}},_onUpKey:function(e){this._focusPrevious(),e.detail.keyboardEvent.preventDefault()},_onDownKey:function(e){this._focusNext(),e.detail.keyboardEvent.preventDefault()},_onEscKey:function(e){var t=this.focusedItem;t&&t.blur()},_onKeydown:function(e){this.keyboardEventMatchesKeys(e,"up down esc")||this._focusWithKeyboardEvent(e),e.stopPropagation()},_activateHandler:function(e){Polymer.IronSelectableBehavior._activateHandler.call(this,e),e.stopPropagation()},_disabledChanged:function(e){e?(this._previousTabIndex=this.hasAttribute("tabindex")?this.tabIndex:0,this.removeAttribute("tabindex")):this.hasAttribute("tabindex")||this.setAttribute("tabindex",this._previousTabIndex)}},Polymer.IronMenuBehaviorImpl._shiftTabPressed=!1,Polymer.IronMenuBehavior=[Polymer.IronMultiSelectableBehavior,Polymer.IronA11yKeysBehavior,Polymer.IronMenuBehaviorImpl];</script><script>Polymer.IronMenubarBehaviorImpl={hostAttributes:{role:"menubar"},keyBindings:{left:"_onLeftKey",right:"_onRightKey"},_onUpKey:function(e){this.focusedItem.click(),e.detail.keyboardEvent.preventDefault()},_onDownKey:function(e){this.focusedItem.click(),e.detail.keyboardEvent.preventDefault()},get _isRTL(){return"rtl"===window.getComputedStyle(this).direction},_onLeftKey:function(e){this._isRTL?this._focusNext():this._focusPrevious(),e.detail.keyboardEvent.preventDefault()},_onRightKey:function(e){this._isRTL?this._focusPrevious():this._focusNext(),e.detail.keyboardEvent.preventDefault()},_onKeydown:function(e){this.keyboardEventMatchesKeys(e,"up down left right esc")||this._focusWithKeyboardEvent(e)}},Polymer.IronMenubarBehavior=[Polymer.IronMenuBehavior,Polymer.IronMenubarBehaviorImpl];</script><dom-module id="paper-icon-button" assetpath="../bower_components/paper-icon-button/"><template strip-whitespace=""><style>:host{display:inline-block;position:relative;padding:8px;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;z-index:0;line-height:1;width:40px;height:40px;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);-webkit-tap-highlight-color:transparent;box-sizing:border-box !important;@apply --paper-icon-button;}:host #ink{color:var(--paper-icon-button-ink-color, var(--primary-text-color));opacity:0.6;}:host([disabled]){color:var(--paper-icon-button-disabled-text, var(--disabled-text-color));pointer-events:none;cursor:auto;@apply --paper-icon-button-disabled;}:host(:hover){@apply --paper-icon-button-hover;}iron-icon{--iron-icon-width:100%;--iron-icon-height:100%;}</style><iron-icon id="icon" src="[[src]]" icon="[[icon]]" alt$="[[alt]]"></iron-icon></template><script>Polymer({is:"paper-icon-button",hostAttributes:{role:"button",tabindex:"0"},behaviors:[Polymer.PaperInkyFocusBehavior],properties:{src:{type:String},icon:{type:String},alt:{type:String,observer:"_altChanged"}},_altChanged:function(t,e){var r=this.getAttribute("aria-label");r&&e!=r||this.setAttribute("aria-label",t)}});</script></dom-module><script>Polymer({is:"iron-iconset-svg",properties:{name:{type:String,observer:"_nameChanged"},size:{type:Number,value:24},rtlMirroring:{type:Boolean,value:!1}},created:function(){this._meta=new Polymer.IronMeta({type:"iconset",key:null,value:null})},attached:function(){this.style.display="none"},getIconNames:function(){return this._icons=this._createIconMap(),Object.keys(this._icons).map(function(e){return this.name+":"+e},this)},applyIcon:function(e,t){this.removeIcon(e);var n=this._cloneIcon(t,this.rtlMirroring&&this._targetIsRTL(e));if(n){var i=Polymer.dom(e.root||e);return i.insertBefore(n,i.childNodes[0]),e._svgIcon=n}return null},removeIcon:function(e){e._svgIcon&&(Polymer.dom(e.root||e).removeChild(e._svgIcon),e._svgIcon=null)},_targetIsRTL:function(e){return null==this.__targetIsRTL&&(e&&e.nodeType!==Node.ELEMENT_NODE&&(e=e.host),this.__targetIsRTL=e&&"rtl"===window.getComputedStyle(e).direction),this.__targetIsRTL},_nameChanged:function(){this._meta.value=null,this._meta.key=this.name,this._meta.value=this,this.async(function(){this.fire("iron-iconset-added",this,{node:window})})},_createIconMap:function(){var e=Object.create(null);return Polymer.dom(this).querySelectorAll("[id]").forEach(function(t){e[t.id]=t}),e},_cloneIcon:function(e,t){return this._icons=this._icons||this._createIconMap(),this._prepareSvgClone(this._icons[e],this.size,t)},_prepareSvgClone:function(e,t,n){if(e){var i=e.cloneNode(!0),r=document.createElementNS("http://www.w3.org/2000/svg","svg"),o=i.getAttribute("viewBox")||"0 0 "+t+" "+t,s="pointer-events: none; display: block; width: 100%; height: 100%;";return n&&i.hasAttribute("mirror-in-rtl")&&(s+="-webkit-transform:scale(-1,1);transform:scale(-1,1);"),r.setAttribute("viewBox",o),r.setAttribute("preserveAspectRatio","xMidYMid meet"),r.style.cssText=s,r.appendChild(i).removeAttribute("id"),r}return null}});</script><iron-iconset-svg name="paper-tabs" size="24"><svg><defs><g id="chevron-left"><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"></path></g><g id="chevron-right"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"></path></g></defs></svg></iron-iconset-svg><dom-module id="paper-tab" assetpath="../bower_components/paper-tabs/"><template><style>:host{@apply --layout-inline;@apply --layout-center;@apply --layout-center-justified;@apply --layout-flex-auto;position:relative;padding:0 12px;overflow:hidden;cursor:pointer;vertical-align:middle;@apply --paper-font-common-base;@apply --paper-tab;}:host(:focus){outline:none;}:host([link]){padding:0;}.tab-content{height:100%;transform:translateZ(0);-webkit-transform:translateZ(0);transition:opacity 0.1s cubic-bezier(0.4, 0.0, 1, 1);@apply --layout-horizontal;@apply --layout-center-center;@apply --layout-flex-auto;@apply --paper-tab-content;}:host(:not(.iron-selected)) > .tab-content{opacity:0.8;@apply --paper-tab-content-unselected;}:host(:focus) .tab-content{opacity:1;font-weight:700;}paper-ripple{color:var(--paper-tab-ink, var(--paper-yellow-a100));}.tab-content > ::slotted(a){@apply --layout-flex-auto;height:100%;}</style><div class="tab-content"><slot></slot></div></template><script>Polymer({is:"paper-tab",behaviors:[Polymer.IronControlState,Polymer.IronButtonState,Polymer.PaperRippleBehavior],properties:{link:{type:Boolean,value:!1,reflectToAttribute:!0}},hostAttributes:{role:"tab"},listeners:{down:"_updateNoink",tap:"_onTap"},attached:function(){this._updateNoink()},get _parentNoink(){var t=Polymer.dom(this).parentNode;return!!t&&!!t.noink},_updateNoink:function(){this.noink=!!this.noink||!!this._parentNoink},_onTap:function(t){if(this.link){var e=this.queryEffectiveChildren("a");if(!e)return;if(t.target===e)return;e.click()}}});</script></dom-module><dom-module id="paper-tabs" assetpath="../bower_components/paper-tabs/"><template><style>:host{@apply --layout;@apply --layout-center;height:48px;font-size:14px;font-weight:500;overflow:hidden;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);-webkit-tap-highlight-color:transparent;@apply --paper-tabs;}:host-context([dir=rtl]){@apply --layout-horizontal-reverse;}#tabsContainer{position:relative;height:100%;white-space:nowrap;overflow:hidden;@apply --layout-flex-auto;@apply --paper-tabs-container;}#tabsContent{height:100%;-moz-flex-basis:auto;-ms-flex-basis:auto;flex-basis:auto;@apply --paper-tabs-content;}#tabsContent.scrollable{position:absolute;white-space:nowrap;}#tabsContent:not(.scrollable),
       #tabsContent.scrollable.fit-container{@apply --layout-horizontal;}#tabsContent.scrollable.fit-container{min-width:100%;}#tabsContent.scrollable.fit-container > ::slotted(*){-ms-flex:1 0 auto;-webkit-flex:1 0 auto;flex:1 0 auto;}.hidden{display:none;}.not-visible{opacity:0;cursor:default;}paper-icon-button{width:48px;height:48px;padding:12px;margin:0 4px;}#selectionBar{position:absolute;height:0;bottom:0;left:0;right:0;border-bottom:2px solid var(--paper-tabs-selection-bar-color, var(--paper-yellow-a100));-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:left center;transform-origin:left center;transition:-webkit-transform;transition:transform;@apply --paper-tabs-selection-bar;}#selectionBar.align-bottom{top:0;bottom:auto;}#selectionBar.expand{transition-duration:0.15s;transition-timing-function:cubic-bezier(0.4, 0.0, 1, 1);}#selectionBar.contract{transition-duration:0.18s;transition-timing-function:cubic-bezier(0.0, 0.0, 0.2, 1);}#tabsContent > ::slotted(:not(#selectionBar)){height:100%;}</style><paper-icon-button icon="paper-tabs:chevron-left" class$="[[_computeScrollButtonClass(_leftHidden, scrollable, hideScrollButtons)]]" on-up="_onScrollButtonUp" on-down="_onLeftScrollButtonDown" tabindex="-1"></paper-icon-button><div id="tabsContainer" on-track="_scroll" on-down="_down"><div id="tabsContent" class$="[[_computeTabsContentClass(scrollable, fitContainer)]]"><div id="selectionBar" class$="[[_computeSelectionBarClass(noBar, alignBottom)]]" on-transitionend="_onBarTransitionEnd"></div><slot></slot></div></div><paper-icon-button icon="paper-tabs:chevron-right" class$="[[_computeScrollButtonClass(_rightHidden, scrollable, hideScrollButtons)]]" on-up="_onScrollButtonUp" on-down="_onRightScrollButtonDown" tabindex="-1"></paper-icon-button></template><script>Polymer({is:"paper-tabs",behaviors:[Polymer.IronResizableBehavior,Polymer.IronMenubarBehavior],properties:{noink:{type:Boolean,value:!1,observer:"_noinkChanged"},noBar:{type:Boolean,value:!1},noSlide:{type:Boolean,value:!1},scrollable:{type:Boolean,value:!1},fitContainer:{type:Boolean,value:!1},disableDrag:{type:Boolean,value:!1},hideScrollButtons:{type:Boolean,value:!1},alignBottom:{type:Boolean,value:!1},selectable:{type:String,value:"paper-tab"},autoselect:{type:Boolean,value:!1},autoselectDelay:{type:Number,value:0},_step:{type:Number,value:10},_holdDelay:{type:Number,value:1},_leftHidden:{type:Boolean,value:!1},_rightHidden:{type:Boolean,value:!1},_previousTab:{type:Object}},hostAttributes:{role:"tablist"},listeners:{"iron-resize":"_onTabSizingChanged","iron-items-changed":"_onTabSizingChanged","iron-select":"_onIronSelect","iron-deselect":"_onIronDeselect"},keyBindings:{"left:keyup right:keyup":"_onArrowKeyup"},created:function(){this._holdJob=null,this._pendingActivationItem=void 0,this._pendingActivationTimeout=void 0,this._bindDelayedActivationHandler=this._delayedActivationHandler.bind(this),this.addEventListener("blur",this._onBlurCapture.bind(this),!0)},ready:function(){this.setScrollDirection("y",this.$.tabsContainer)},detached:function(){this._cancelPendingActivation()},_noinkChanged:function(t){Polymer.dom(this).querySelectorAll("paper-tab").forEach(t?this._setNoinkAttribute:this._removeNoinkAttribute)},_setNoinkAttribute:function(t){t.setAttribute("noink","")},_removeNoinkAttribute:function(t){t.removeAttribute("noink")},_computeScrollButtonClass:function(t,e,i){return!e||i?"hidden":t?"not-visible":""},_computeTabsContentClass:function(t,e){return t?"scrollable"+(e?" fit-container":""):" fit-container"},_computeSelectionBarClass:function(t,e){return t?"hidden":e?"align-bottom":""},_onTabSizingChanged:function(){this.debounce("_onTabSizingChanged",function(){this._scroll(),this._tabChanged(this.selectedItem)},10)},_onIronSelect:function(t){this._tabChanged(t.detail.item,this._previousTab),this._previousTab=t.detail.item,this.cancelDebouncer("tab-changed")},_onIronDeselect:function(t){this.debounce("tab-changed",function(){this._tabChanged(null,this._previousTab),this._previousTab=null},1)},_activateHandler:function(){this._cancelPendingActivation(),Polymer.IronMenuBehaviorImpl._activateHandler.apply(this,arguments)},_scheduleActivation:function(t,e){this._pendingActivationItem=t,this._pendingActivationTimeout=this.async(this._bindDelayedActivationHandler,e)},_delayedActivationHandler:function(){var t=this._pendingActivationItem;this._pendingActivationItem=void 0,this._pendingActivationTimeout=void 0,t.fire(this.activateEvent,null,{bubbles:!0,cancelable:!0})},_cancelPendingActivation:function(){void 0!==this._pendingActivationTimeout&&(this.cancelAsync(this._pendingActivationTimeout),this._pendingActivationItem=void 0,this._pendingActivationTimeout=void 0)},_onArrowKeyup:function(t){this.autoselect&&this._scheduleActivation(this.focusedItem,this.autoselectDelay)},_onBlurCapture:function(t){t.target===this._pendingActivationItem&&this._cancelPendingActivation()},get _tabContainerScrollSize(){return Math.max(0,this.$.tabsContainer.scrollWidth-this.$.tabsContainer.offsetWidth)},_scroll:function(t,e){if(this.scrollable){var i=e&&-e.ddx||0;this._affectScroll(i)}},_down:function(t){this.async(function(){this._defaultFocusAsync&&(this.cancelAsync(this._defaultFocusAsync),this._defaultFocusAsync=null)},1)},_affectScroll:function(t){this.$.tabsContainer.scrollLeft+=t;var e=this.$.tabsContainer.scrollLeft;this._leftHidden=0===e,this._rightHidden=e===this._tabContainerScrollSize},_onLeftScrollButtonDown:function(){this._scrollToLeft(),this._holdJob=setInterval(this._scrollToLeft.bind(this),this._holdDelay)},_onRightScrollButtonDown:function(){this._scrollToRight(),this._holdJob=setInterval(this._scrollToRight.bind(this),this._holdDelay)},_onScrollButtonUp:function(){clearInterval(this._holdJob),this._holdJob=null},_scrollToLeft:function(){this._affectScroll(-this._step)},_scrollToRight:function(){this._affectScroll(this._step)},_tabChanged:function(t,e){if(!t)return this.$.selectionBar.classList.remove("expand"),this.$.selectionBar.classList.remove("contract"),void this._positionBar(0,0);var i=this.$.tabsContent.getBoundingClientRect(),n=i.width,o=t.getBoundingClientRect(),s=o.left-i.left;if(this._pos={width:this._calcPercent(o.width,n),left:this._calcPercent(s,n)},this.noSlide||null==e)return this.$.selectionBar.classList.remove("expand"),this.$.selectionBar.classList.remove("contract"),void this._positionBar(this._pos.width,this._pos.left);var a=e.getBoundingClientRect(),l=this.items.indexOf(e),c=this.items.indexOf(t);this.$.selectionBar.classList.add("expand");var r=l<c;this._isRTL&&(r=!r),r?this._positionBar(this._calcPercent(o.left+o.width-a.left,n)-5,this._left):this._positionBar(this._calcPercent(a.left+a.width-o.left,n)-5,this._calcPercent(s,n)+5),this.scrollable&&this._scrollToSelectedIfNeeded(o.width,s)},_scrollToSelectedIfNeeded:function(t,e){var i=e-this.$.tabsContainer.scrollLeft;i<0?this.$.tabsContainer.scrollLeft+=i:(i+=t-this.$.tabsContainer.offsetWidth)>0&&(this.$.tabsContainer.scrollLeft+=i)},_calcPercent:function(t,e){return 100*t/e},_positionBar:function(t,e){t=t||0,e=e||0,this._width=t,this._left=e,this.transform("translateX("+e+"%) scaleX("+t/100+")",this.$.selectionBar)},_onBarTransitionEnd:function(t){var e=this.$.selectionBar.classList;e.contains("expand")?(e.remove("expand"),e.add("contract"),this._positionBar(this._pos.width,this._pos.left)):e.contains("contract")&&e.remove("contract")}});</script></dom-module><script>Polymer.AppLayoutBehavior=[Polymer.IronResizableBehavior,{listeners:{"app-reset-layout":"_appResetLayoutHandler","iron-resize":"resetLayout"},attached:function(){this.fire("app-reset-layout")},_appResetLayoutHandler:function(e){Polymer.dom(e).path[0]!==this&&(this.resetLayout(),e.stopPropagation())},_updateLayoutStates:function(){console.error("unimplemented")},resetLayout:function(){var e=this._updateLayoutStates.bind(this);Polymer.Async&&Polymer.Async.animationFrame?(this._layoutDebouncer=Polymer.Debouncer.debounce(this._layoutDebouncer,Polymer.Async.animationFrame,e),Polymer.enqueueDebouncer(this._layoutDebouncer)):this.debounce("resetLayout",e),this._notifyDescendantResize()},_notifyLayoutChanged:function(){var e=this;requestAnimationFrame(function(){e.fire("app-reset-layout")})},_notifyDescendantResize:function(){this.isAttached&&this._interestedResizables.forEach(function(e){this.resizerShouldNotify(e)&&this._notifyDescendant(e)},this)}}];</script><dom-module id="app-header-layout" assetpath="../bower_components/app-layout/app-header-layout/"><template><style>:host{display:block;position:relative;z-index:0;}#wrapper ::slotted([slot=header]){@apply --layout-fixed-top;z-index:1;}#wrapper.initializing ::slotted([slot=header]){position:relative;}:host([has-scrolling-region]){height:100%;}:host([has-scrolling-region]) #wrapper ::slotted([slot=header]){position:absolute;}:host([has-scrolling-region]) #wrapper.initializing ::slotted([slot=header]){position:relative;}:host([has-scrolling-region]) #wrapper #contentContainer{@apply --layout-fit;overflow-y:auto;-webkit-overflow-scrolling:touch;}:host([has-scrolling-region]) #wrapper.initializing #contentContainer{position:relative;}:host([fullbleed]){@apply --layout-vertical;@apply --layout-fit;}:host([fullbleed]) #wrapper,
       :host([fullbleed]) #wrapper #contentContainer{@apply --layout-vertical;@apply --layout-flex;}#contentContainer{position:relative;z-index:0;}</style><div id="wrapper" class="initializing"><slot id="headerSlot" name="header"></slot><div id="contentContainer"><slot></slot></div></div></template><script>Polymer({is:"app-header-layout",behaviors:[Polymer.AppLayoutBehavior],properties:{hasScrollingRegion:{type:Boolean,value:!1,reflectToAttribute:!0}},observers:["resetLayout(isAttached, hasScrollingRegion)"],get header(){return Polymer.dom(this.$.headerSlot).getDistributedNodes()[0]},_updateLayoutStates:function(){var e=this.header;if(this.isAttached&&e){this.$.wrapper.classList.remove("initializing"),e.scrollTarget=this.hasScrollingRegion?this.$.contentContainer:this.ownerDocument.documentElement;var t=e.offsetHeight;this.hasScrollingRegion?(e.style.left="",e.style.right=""):requestAnimationFrame(function(){var t=this.getBoundingClientRect(),i=document.documentElement.clientWidth-t.right;e.style.left=t.left+"px",e.style.right=i+"px"}.bind(this));var i=this.$.contentContainer.style;e.fixed&&!e.condenses&&this.hasScrollingRegion?(i.marginTop=t+"px",i.paddingTop=""):(i.paddingTop=t+"px",i.marginTop="")}}});</script></dom-module><script>Polymer.IronScrollTargetBehavior={properties:{scrollTarget:{type:HTMLElement,value:function(){return this._defaultScrollTarget}}},observers:["_scrollTargetChanged(scrollTarget, isAttached)"],_shouldHaveListener:!0,_scrollTargetChanged:function(l,t){if(this._oldScrollTarget&&(this._toggleScrollListener(!1,this._oldScrollTarget),this._oldScrollTarget=null),t)if("document"===l)this.scrollTarget=this._doc;else if("string"==typeof l){var r=this.domHost;this.scrollTarget=r&&r.$?r.$[l]:Polymer.dom(this.ownerDocument).querySelector("#"+l)}else this._isValidScrollTarget()&&(this._oldScrollTarget=l,this._toggleScrollListener(this._shouldHaveListener,l))},_scrollHandler:function(){},get _defaultScrollTarget(){return this._doc},get _doc(){return this.ownerDocument.documentElement},get _scrollTop(){return this._isValidScrollTarget()?this.scrollTarget===this._doc?window.pageYOffset:this.scrollTarget.scrollTop:0},get _scrollLeft(){return this._isValidScrollTarget()?this.scrollTarget===this._doc?window.pageXOffset:this.scrollTarget.scrollLeft:0},set _scrollTop(l){this.scrollTarget===this._doc?window.scrollTo(window.pageXOffset,l):this._isValidScrollTarget()&&(this.scrollTarget.scrollTop=l)},set _scrollLeft(l){this.scrollTarget===this._doc?window.scrollTo(l,window.pageYOffset):this._isValidScrollTarget()&&(this.scrollTarget.scrollLeft=l)},scroll:function(l,t){this.scrollTarget===this._doc?window.scrollTo(l,t):this._isValidScrollTarget()&&(this.scrollTarget.scrollLeft=l,this.scrollTarget.scrollTop=t)},get _scrollTargetWidth(){return this._isValidScrollTarget()?this.scrollTarget===this._doc?window.innerWidth:this.scrollTarget.offsetWidth:0},get _scrollTargetHeight(){return this._isValidScrollTarget()?this.scrollTarget===this._doc?window.innerHeight:this.scrollTarget.offsetHeight:0},_isValidScrollTarget:function(){return this.scrollTarget instanceof HTMLElement},_toggleScrollListener:function(l,t){var r=t===this._doc?window:t;l?this._boundScrollHandler||(this._boundScrollHandler=this._scrollHandler.bind(this),r.addEventListener("scroll",this._boundScrollHandler)):this._boundScrollHandler&&(r.removeEventListener("scroll",this._boundScrollHandler),this._boundScrollHandler=null)},toggleScrollListener:function(l){this._shouldHaveListener=l,this._toggleScrollListener(l,this.scrollTarget)}};</script><script>Polymer.AppLayout=Polymer.AppLayout||{},Polymer.AppLayout._scrollEffects=Polymer.AppLayout._scrollEffects||{},Polymer.AppLayout.scrollTimingFunction=function(o,e,l,r){return o/=r,-l*o*(o-2)+e},Polymer.AppLayout.registerEffect=function(o,e){if(null!=Polymer.AppLayout._scrollEffects[o])throw new Error("effect `"+o+"` is already registered.");Polymer.AppLayout._scrollEffects[o]=e},Polymer.AppLayout.queryAllRoot=function(o,e){for(var l=[e],r=[];l.length>0;){var t=l.shift();for(r.push.apply(r,t.querySelectorAll(o)),i=0;t.children[i];i++)t.children[i].shadowRoot&&l.push(t.children[i].shadowRoot)}return r},Polymer.AppLayout.scroll=function(o){o=o||{};var e=document.documentElement,l=o.target||e,r="scrollBehavior"in l.style&&l.scroll,t=o.top||0,i=o.left||0,n=l===e?window.scrollTo:function(o,e){l.scrollLeft=o,l.scrollTop=e};if("smooth"===o.behavior)if(r)l.scroll(o);else{var c=Polymer.AppLayout.scrollTimingFunction,s=Date.now(),a=l===e?window.pageYOffset:l.scrollTop,u=l===e?window.pageXOffset:l.scrollLeft,p=t-a,f=i-u;(function o(){var e=Date.now()-s;e<300?(n(c(e,u,f,300),c(e,a,p,300)),requestAnimationFrame(o)):n(i,t)}).bind(this)()}else if("silent"===o.behavior){var y=Polymer.AppLayout.queryAllRoot("app-header",document.body);y.forEach(function(o){o.setAttribute("silent-scroll","")}),window.cancelAnimationFrame(Polymer.AppLayout._scrollTimer),Polymer.AppLayout._scrollTimer=window.requestAnimationFrame(function(){y.forEach(function(o){o.removeAttribute("silent-scroll")}),Polymer.AppLayout._scrollTimer=null}),n(i,t)}else n(i,t)};</script><script>Polymer.AppScrollEffectsBehavior=[Polymer.IronScrollTargetBehavior,{properties:{effects:{type:String},effectsConfig:{type:Object,value:function(){return{}}},disabled:{type:Boolean,reflectToAttribute:!0,value:!1},threshold:{type:Number,value:0},thresholdTriggered:{type:Boolean,notify:!0,readOnly:!0,reflectToAttribute:!0}},observers:["_effectsChanged(effects, effectsConfig, isAttached)"],_updateScrollState:function(){},isOnScreen:function(){return!1},isContentBelow:function(){return!1},_effectsRunFn:null,_effects:null,get _clampedScrollTop(){return Math.max(0,this._scrollTop)},detached:function(){this._tearDownEffects()},createEffect:function(t,e){var n=Polymer.AppLayout._scrollEffects[t];if(!n)throw new ReferenceError(this._getUndefinedMsg(t));var f=this._boundEffect(n,e||{});return f.setUp(),f},_effectsChanged:function(t,e,n){this._tearDownEffects(),t&&n&&(t.split(" ").forEach(function(t){var n;""!==t&&((n=Polymer.AppLayout._scrollEffects[t])?this._effects.push(this._boundEffect(n,e[t])):console.warn(this._getUndefinedMsg(t)))},this),this._setUpEffect())},_layoutIfDirty:function(){return this.offsetWidth},_boundEffect:function(t,e){e=e||{};var n=parseFloat(e.startsAt||0),f=parseFloat(e.endsAt||1),s=f-n,r=function(){},o=0===n&&1===f?t.run:function(e,f){t.run.call(this,Math.max(0,(e-n)/s),f)};return{setUp:t.setUp?t.setUp.bind(this,e):r,run:t.run?o.bind(this):r,tearDown:t.tearDown?t.tearDown.bind(this):r}},_setUpEffect:function(){this.isAttached&&this._effects&&(this._effectsRunFn=[],this._effects.forEach(function(t){!1!==t.setUp()&&this._effectsRunFn.push(t.run)},this))},_tearDownEffects:function(){this._effects&&this._effects.forEach(function(t){t.tearDown()}),this._effectsRunFn=[],this._effects=[]},_runEffects:function(t,e){this._effectsRunFn&&this._effectsRunFn.forEach(function(n){n(t,e)})},_scrollHandler:function(){if(!this.disabled){var t=this._clampedScrollTop;this._updateScrollState(t),this.threshold>0&&this._setThresholdTriggered(t>=this.threshold)}},_getDOMRef:function(t){console.warn("_getDOMRef","`"+t+"` is undefined")},_getUndefinedMsg:function(t){return"Scroll effect `"+t+"` is undefined. Did you forget to import app-layout/app-scroll-effects/effects/"+t+".html ?"}}];</script><script>Polymer.AppLayout.registerEffect("waterfall",{run:function(){this.shadow=this.isOnScreen()&&this.isContentBelow()}});</script><dom-module id="app-header" assetpath="../bower_components/app-layout/app-header/"><template><style>:host{position:relative;display:block;transition-timing-function:linear;transition-property:-webkit-transform;transition-property:transform;}:host::before{position:absolute;right:0px;bottom:-5px;left:0px;width:100%;height:5px;content:"";transition:opacity 0.4s;pointer-events:none;opacity:0;box-shadow:inset 0px 5px 6px -3px rgba(0, 0, 0, 0.4);will-change:opacity;@apply --app-header-shadow;}:host([shadow])::before{opacity:1;}#background{@apply --layout-fit;overflow:hidden;}#backgroundFrontLayer,
       #backgroundRearLayer{@apply --layout-fit;height:100%;pointer-events:none;background-size:cover;}#backgroundFrontLayer{@apply --app-header-background-front-layer;}#backgroundRearLayer{opacity:0;@apply --app-header-background-rear-layer;}#contentContainer{position:relative;width:100%;height:100%;}:host([disabled]),
@@ -69,7 +69,7 @@
       :host([disabled]) ::slotted([sticky]),
       /* Silent scrolling should not run CSS transitions */
       :host([silent-scroll]) ::slotted(app-toolbar:first-of-type),
-      :host([silent-scroll]) ::slotted([sticky]){transition:none !important;}</style><div id="contentContainer"><slot id="slot"></slot></div></template><script>Polymer({is:"app-header",behaviors:[Polymer.AppScrollEffectsBehavior,Polymer.AppLayoutBehavior],properties:{condenses:{type:Boolean,value:!1},fixed:{type:Boolean,value:!1},reveals:{type:Boolean,value:!1},shadow:{type:Boolean,reflectToAttribute:!0,value:!1}},observers:["_configChanged(isAttached, condenses, fixed)"],_height:0,_dHeight:0,_stickyElTop:0,_stickyElRef:null,_top:0,_progress:0,_wasScrollingDown:!1,_initScrollTop:0,_initTimestamp:0,_lastTimestamp:0,_lastScrollTop:0,get _maxHeaderTop(){return this.fixed?this._dHeight:this._height+5},get _stickyEl(){var t=this;if(this._stickyElRef)return this._stickyElRef;for(var i,e=Polymer.dom(this.$.slot).getDistributedNodes(),s=0;i=e[s];s++)if(i.nodeType===Node.ELEMENT_NODE){if(i.hasAttribute("sticky")){t._stickyElRef=i;break}t._stickyElRef||(t._stickyElRef=i)}return this._stickyElRef},_configChanged:function(){this.resetLayout(),this._notifyLayoutChanged()},_updateLayoutStates:function(){if(0!==this.offsetWidth||0!==this.offsetHeight){var t=this._clampedScrollTop,i=0===this._height||0===t,e=this.disabled;this._height=this.offsetHeight,this._stickyElRef=null,this.disabled=!0,i||this._updateScrollState(0,!0),this._mayMove()?this._dHeight=this._stickyEl?this._height-this._stickyEl.offsetHeight:0:this._dHeight=0,this._stickyElTop=this._stickyEl?this._stickyEl.offsetTop:0,this._setUpEffect(),i?this._updateScrollState(t,!0):(this._updateScrollState(this._lastScrollTop,!0),this._layoutIfDirty()),this.disabled=e}},_updateScrollState:function(t,i){if(0!==this._height){var e=0,s=0,o=this._top,h=(this._lastScrollTop,this._maxHeaderTop),r=t-this._lastScrollTop,n=Math.abs(r),a=t>this._lastScrollTop,l=performance.now();if(this._mayMove()&&(s=this._clamp(this.reveals?o+r:t,0,h)),t>=this._dHeight&&(s=this.condenses&&!this.fixed?Math.max(this._dHeight,s):s,this.style.transitionDuration="0ms"),this.reveals&&!this.disabled&&n<100&&((l-this._initTimestamp>300||this._wasScrollingDown!==a)&&(this._initScrollTop=t,this._initTimestamp=l),t>=h))if(Math.abs(this._initScrollTop-t)>30||n>10){a&&t>=h?s=h:!a&&t>=this._dHeight&&(s=this.condenses&&!this.fixed?this._dHeight:0);var _=r/(l-this._lastTimestamp);this.style.transitionDuration=this._clamp((s-o)/_,0,300)+"ms"}else s=this._top;e=0===this._dHeight?t>0?1:0:s/this._dHeight,i||(this._lastScrollTop=t,this._top=s,this._wasScrollingDown=a,this._lastTimestamp=l),(i||e!==this._progress||o!==s||0===t)&&(this._progress=e,this._runEffects(e,s),this._transformHeader(s))}},_mayMove:function(){return this.condenses||!this.fixed},willCondense:function(){return this._dHeight>0&&this.condenses},isOnScreen:function(){return 0!==this._height&&this._top<this._height},isContentBelow:function(){return 0===this._top?this._clampedScrollTop>0:this._clampedScrollTop-this._maxHeaderTop>=0},_transformHeader:function(t){this.translate3d(0,-t+"px",0),this._stickyEl&&this.translate3d(0,this.condenses&&t>=this._stickyElTop?Math.min(t,this._dHeight)-this._stickyElTop+"px":0,0,this._stickyEl)},_clamp:function(t,i,e){return Math.min(e,Math.max(i,t))},_ensureBgContainers:function(){this._bgContainer||(this._bgContainer=document.createElement("div"),this._bgContainer.id="background",this._bgRear=document.createElement("div"),this._bgRear.id="backgroundRearLayer",this._bgContainer.appendChild(this._bgRear),this._bgFront=document.createElement("div"),this._bgFront.id="backgroundFrontLayer",this._bgContainer.appendChild(this._bgFront),Polymer.dom(this.root).insertBefore(this._bgContainer,this.$.contentContainer))},_getDOMRef:function(t){switch(t){case"backgroundFrontLayer":return this._ensureBgContainers(),this._bgFront;case"backgroundRearLayer":return this._ensureBgContainers(),this._bgRear;case"background":return this._ensureBgContainers(),this._bgContainer;case"mainTitle":return Polymer.dom(this).querySelector("[main-title]");case"condensedTitle":return Polymer.dom(this).querySelector("[condensed-title]")}return null},getScrollState:function(){return{progress:this._progress,top:this._top}}});</script></dom-module><dom-module id="app-toolbar" assetpath="../bower_components/app-layout/app-toolbar/"><template><style>:host{@apply --layout-horizontal;@apply --layout-center;position:relative;height:64px;padding:0 16px;pointer-events:none;font-size:var(--app-toolbar-font-size, 20px);}:host ::slotted(*){pointer-events:auto;}:host ::slotted(paper-icon-button){font-size:0;}:host ::slotted([main-title]),
+      :host([silent-scroll]) ::slotted([sticky]){transition:none !important;}</style><div id="contentContainer"><slot id="slot"></slot></div></template><script>Polymer({is:"app-header",behaviors:[Polymer.AppScrollEffectsBehavior,Polymer.AppLayoutBehavior],properties:{condenses:{type:Boolean,value:!1},fixed:{type:Boolean,value:!1},reveals:{type:Boolean,value:!1},shadow:{type:Boolean,reflectToAttribute:!0,value:!1}},observers:["_configChanged(isAttached, condenses, fixed)"],_height:0,_dHeight:0,_stickyElTop:0,_stickyElRef:null,_top:0,_progress:0,_wasScrollingDown:!1,_initScrollTop:0,_initTimestamp:0,_lastTimestamp:0,_lastScrollTop:0,get _maxHeaderTop(){return this.fixed?this._dHeight:this._height+5},get _stickyEl(){if(this._stickyElRef)return this._stickyElRef;for(var t,i=Polymer.dom(this.$.slot).getDistributedNodes(),e=0;t=i[e];e++)if(t.nodeType===Node.ELEMENT_NODE){if(t.hasAttribute("sticky")){this._stickyElRef=t;break}this._stickyElRef||(this._stickyElRef=t)}return this._stickyElRef},_configChanged:function(){this.resetLayout(),this._notifyLayoutChanged()},_updateLayoutStates:function(){if(0!==this.offsetWidth||0!==this.offsetHeight){var t=this._clampedScrollTop,i=0===this._height||0===t,e=this.disabled;this._height=this.offsetHeight,this._stickyElRef=null,this.disabled=!0,i||this._updateScrollState(0,!0),this._mayMove()?this._dHeight=this._stickyEl?this._height-this._stickyEl.offsetHeight:0:this._dHeight=0,this._stickyElTop=this._stickyEl?this._stickyEl.offsetTop:0,this._setUpEffect(),i?this._updateScrollState(t,!0):(this._updateScrollState(this._lastScrollTop,!0),this._layoutIfDirty()),this.disabled=e}},_updateScrollState:function(t,i){if(0!==this._height){var e=0,s=0,h=this._top,o=(this._lastScrollTop,this._maxHeaderTop),r=t-this._lastScrollTop,n=Math.abs(r),a=t>this._lastScrollTop,l=performance.now();if(this._mayMove()&&(s=this._clamp(this.reveals?h+r:t,0,o)),t>=this._dHeight&&(s=this.condenses&&!this.fixed?Math.max(this._dHeight,s):s,this.style.transitionDuration="0ms"),this.reveals&&!this.disabled&&n<100&&((l-this._initTimestamp>300||this._wasScrollingDown!==a)&&(this._initScrollTop=t,this._initTimestamp=l),t>=o))if(Math.abs(this._initScrollTop-t)>30||n>10){a&&t>=o?s=o:!a&&t>=this._dHeight&&(s=this.condenses&&!this.fixed?this._dHeight:0);var _=r/(l-this._lastTimestamp);this.style.transitionDuration=this._clamp((s-h)/_,0,300)+"ms"}else s=this._top;e=0===this._dHeight?t>0?1:0:s/this._dHeight,i||(this._lastScrollTop=t,this._top=s,this._wasScrollingDown=a,this._lastTimestamp=l),(i||e!==this._progress||h!==s||0===t)&&(this._progress=e,this._runEffects(e,s),this._transformHeader(s))}},_mayMove:function(){return this.condenses||!this.fixed},willCondense:function(){return this._dHeight>0&&this.condenses},isOnScreen:function(){return 0!==this._height&&this._top<this._height},isContentBelow:function(){return 0===this._top?this._clampedScrollTop>0:this._clampedScrollTop-this._maxHeaderTop>=0},_transformHeader:function(t){this.translate3d(0,-t+"px",0),this._stickyEl&&this.translate3d(0,this.condenses&&t>=this._stickyElTop?Math.min(t,this._dHeight)-this._stickyElTop+"px":0,0,this._stickyEl)},_clamp:function(t,i,e){return Math.min(e,Math.max(i,t))},_ensureBgContainers:function(){this._bgContainer||(this._bgContainer=document.createElement("div"),this._bgContainer.id="background",this._bgRear=document.createElement("div"),this._bgRear.id="backgroundRearLayer",this._bgContainer.appendChild(this._bgRear),this._bgFront=document.createElement("div"),this._bgFront.id="backgroundFrontLayer",this._bgContainer.appendChild(this._bgFront),Polymer.dom(this.root).insertBefore(this._bgContainer,this.$.contentContainer))},_getDOMRef:function(t){switch(t){case"backgroundFrontLayer":return this._ensureBgContainers(),this._bgFront;case"backgroundRearLayer":return this._ensureBgContainers(),this._bgRear;case"background":return this._ensureBgContainers(),this._bgContainer;case"mainTitle":return Polymer.dom(this).querySelector("[main-title]");case"condensedTitle":return Polymer.dom(this).querySelector("[condensed-title]")}return null},getScrollState:function(){return{progress:this._progress,top:this._top}}});</script></dom-module><dom-module id="app-toolbar" assetpath="../bower_components/app-layout/app-toolbar/"><template><style>:host{@apply --layout-horizontal;@apply --layout-center;position:relative;height:64px;padding:0 16px;pointer-events:none;font-size:var(--app-toolbar-font-size, 20px);}:host ::slotted(*){pointer-events:auto;}:host ::slotted(paper-icon-button){font-size:0;}:host ::slotted([main-title]),
       :host ::slotted([condensed-title]){pointer-events:none;@apply --layout-flex;}:host ::slotted([bottom-item]){position:absolute;right:0;bottom:0;left:0;}:host ::slotted([top-item]){position:absolute;top:0;right:0;left:0;}:host ::slotted([spacer]){margin-left:64px;}</style><slot></slot></template><script>Polymer({is:"app-toolbar"});</script></dom-module><dom-module id="ha-menu-button" assetpath="components/"><template><style>.invisible{visibility:hidden;}</style><paper-icon-button icon="mdi:menu" class$="[[computeMenuButtonClass(narrow, showMenu)]]" on-tap="toggleMenu"></paper-icon-button></template></dom-module><script>Polymer({is:"ha-menu-button",properties:{narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,value:!1}},computeMenuButtonClass:function(e,n){return!e&&n?"invisible":""},toggleMenu:function(e){e.stopPropagation(),this.fire("hass-open-menu")}});</script><dom-module id="ha-start-voice-button" assetpath="components/"><template><paper-icon-button icon="mdi:microphone" hidden$="[[!canListen]]" on-tap="handleListenClick"></paper-icon-button></template></dom-module><script>Polymer({is:"ha-start-voice-button",properties:{hass:{type:Object,value:null},canListen:{type:Boolean,computed:"computeCanListen(hass)"}},computeCanListen:function(e){return"webkitSpeechRecognition"in window&&window.hassUtil.isComponentLoaded(e,"conversation")},handleListenClick:function(){this.fire("hass-start-voice")}});</script><dom-module id="ha-label-badge" assetpath="components/"><template><style>.badge-container{display:inline-block;text-align:center;vertical-align:top;}.label-badge{position:relative;display:block;margin:0 auto;width:var(--ha-label-badge-size, 2.5em);text-align:center;height:var(--ha-label-badge-size, 2.5em);line-height:var(--ha-label-badge-size, 2.5em);font-size:var(--ha-label-badge-font-size, 1.5em);border-radius:50%;border:0.1em solid var(--ha-label-badge-color, --primary-color);color:var(--label-badge-text-color, rgb(76, 76, 76));white-space:nowrap;background-color:var(--label-badge-background-color, white);background-size:cover;transition:border .3s ease-in-out;}.label-badge .value{font-size:90%;overflow:hidden;text-overflow:ellipsis;}.label-badge .value.big{font-size:70%;}.label-badge .label{position:absolute;bottom:-1em;left:0;right:0;line-height:1em;font-size:0.5em;}.label-badge .label span{max-width:80%;display:inline-block;background-color:var(--ha-label-badge-color, --primary-color);color:white;border-radius:1em;padding:4px 8px;font-weight:500;text-transform:uppercase;overflow:hidden;text-overflow:ellipsis;transition:background-color .3s ease-in-out;}.badge-container .title{margin-top:1em;font-size:.9em;width:5em;font-weight:300;overflow:hidden;text-overflow:ellipsis;line-height:normal;}iron-image{border-radius:50%;}[hidden]{display:none !important;}</style><div class="badge-container"><div class="label-badge" id="badge"><div class$="[[computeClasses(value)]]"><iron-icon icon="[[icon]]" hidden$="[[computeHideIcon(icon, value, image)]]"></iron-icon><span hidden$="[[computeHideValue(value, image)]]">[[value]]</span></div><div class="label" hidden$="[[!label]]"><span>[[label]]</span></div></div><div class="title" hidden$="[[!description]]">[[description]]</div></div></template></dom-module><script>Polymer({is:"ha-label-badge",properties:{value:{type:String,value:null},icon:{type:String,value:null},label:{type:String,value:null},description:{type:String},image:{type:String,value:null,observer:"imageChanged"}},computeClasses:function(e){return e&&e.length>4?"value big":"value"},computeHideIcon:function(e,n,l){return!e||n||l},computeHideValue:function(e,n){return!e||n},imageChanged:function(e){this.$.badge.style.backgroundImage=e?"url("+e+")":""}});</script><dom-module id="ha-demo-badge" assetpath="components/"><template><style>:host{--ha-label-badge-color:#dac90d;}</style><ha-label-badge icon="mdi:emoticon" label="Demo" description=""></ha-label-badge></template></dom-module><script>Polymer({is:"ha-demo-badge"});</script><dom-module id="ha-state-label-badge" assetpath="components/entity/"><template><style>:host{cursor:pointer;}ha-label-badge{--ha-label-badge-color:var(--label-badge-red, #DF4C1E);}.red{--ha-label-badge-color:var(--label-badge-red, #DF4C1E);}.blue{--ha-label-badge-color:var(--label-badge-blue, #039be5);}.green{--ha-label-badge-color:var(--label-badge-green, #0DA035);}.yellow{--ha-label-badge-color:var(--label-badge-yellow, #f4b400);}.grey{--ha-label-badge-color:var(--label-badge-grey, --paper-grey-500);}</style><ha-label-badge class$="[[computeClasses(state)]]" value="[[computeValue(state)]]" icon="[[computeIcon(state)]]" image="[[computeImage(state)]]" label="[[computeLabel(state)]]" description="[[computeDescription(state)]]"></ha-label-badge></template></dom-module><script>Polymer({is:"ha-state-label-badge",properties:{hass:{type:Object},state:{type:Object,observer:"stateChanged"}},listeners:{tap:"badgeTap"},badgeTap:function(e){e.stopPropagation(),this.fire("hass-more-info",{entityId:this.state.entity_id})},computeClasses:function(e){switch(window.hassUtil.computeDomain(e)){case"binary_sensor":case"updater":return"blue";default:return""}},computeValue:function(e){switch(window.hassUtil.computeDomain(e)){case"binary_sensor":case"device_tracker":case"updater":case"sun":case"alarm_control_panel":return null;case"sensor":default:return"unknown"===e.state?"-":e.state}},computeIcon:function(e){if("unavailable"===e.state)return null;var t=window.hassUtil.computeDomain(e);switch(t){case"alarm_control_panel":return"pending"===e.state?"mdi:clock-fast":"armed_away"===e.state?"mdi:nature":"armed_home"===e.state?"mdi:home-variant":"triggered"===e.state?"mdi:alert-circle":window.hassUtil.domainIcon(t,e.state);case"binary_sensor":case"device_tracker":case"updater":return window.hassUtil.stateIcon(e);case"sun":return"above_horizon"===e.state?window.hassUtil.domainIcon(t):"mdi:brightness-3";default:return null}},computeImage:function(e){return e.attributes.entity_picture||null},computeLabel:function(e){if("unavailable"===e.state)return"unavai";switch(window.hassUtil.computeDomain(e)){case"device_tracker":return"not_home"===e.state?"Away":e.state;case"alarm_control_panel":return"pending"===e.state?"pend":"armed_away"===e.state||"armed_home"===e.state?"armed":"triggered"===e.state?"trig":"disarm";default:return e.attributes.unit_of_measurement||null}},computeDescription:function(e){return window.hassUtil.computeStateName(e)},stateChanged:function(){this.updateStyles()}});</script><dom-module id="ha-badges-card" assetpath="cards/"><template><style>ha-state-label-badge{display:inline-block;margin-bottom:var(--ha-state-label-badge-margin-bottom, 16px);}</style><template is="dom-repeat" items="[[states]]"><ha-state-label-badge hass="[[hass]]" state="[[item]]"></ha-state-label-badge></template></template></dom-module><script>Polymer({is:"ha-badges-card",properties:{hass:{type:Object},states:{type:Array}}});</script><dom-module id="paper-material-shared-styles" assetpath="../bower_components/paper-material/"><template><style>:host{display:block;position:relative;}:host([elevation="1"]){@apply --shadow-elevation-2dp;}:host([elevation="2"]){@apply --shadow-elevation-4dp;}:host([elevation="3"]){@apply --shadow-elevation-6dp;}:host([elevation="4"]){@apply --shadow-elevation-8dp;}:host([elevation="5"]){@apply --shadow-elevation-16dp;}</style></template></dom-module><dom-module id="paper-material" assetpath="../bower_components/paper-material/"><template><style include="paper-material-shared-styles"></style><style>:host([animated]){@apply --shadow-transition;}:host{@apply --paper-material;}</style><slot></slot></template></dom-module><script>Polymer({is:"paper-material",properties:{elevation:{type:Number,reflectToAttribute:!0,value:1},animated:{type:Boolean,reflectToAttribute:!0,value:!1}}});</script><dom-module id="ha-camera-card" assetpath="cards/"><template><style include="paper-material">:host{display:block;position:relative;font-size:0px;border-radius:2px;cursor:pointer;min-height:48px;line-height:0;}.camera-feed{width:100%;height:auto;border-radius:2px;}.caption{@apply (--paper-font-common-nowrap);position:absolute;left:0px;right:0px;bottom:0px;border-bottom-left-radius:2px;border-bottom-right-radius:2px;background-color:rgba(0, 0, 0, 0.3);padding:16px;font-size:16px;font-weight:500;line-height:16px;color:white;}</style><img src="[[cameraFeedSrc]]" class="camera-feed" hidden$="[[!imageLoaded]]" on-load="imageLoadSuccess" on-error="imageLoadFail" alt="[[computeStateName(stateObj)]]"><div class="caption">[[computeStateName(stateObj)]]<template is="dom-if" if="[[!imageLoaded]]">(Error loading image)</template></div></template></dom-module><script>Polymer({is:"ha-camera-card",UPDATE_INTERVAL:1e4,properties:{hass:{type:Object},stateObj:{type:Object,observer:"updateCameraFeedSrc"},cameraFeedSrc:{type:String},imageLoaded:{type:Boolean,value:!0},elevation:{type:Number,value:1,reflectToAttribute:!0}},listeners:{tap:"cardTapped"},attached:function(){this.timer=setInterval(function(){this.updateCameraFeedSrc(this.stateObj)}.bind(this),this.UPDATE_INTERVAL)},detached:function(){clearInterval(this.timer)},cardTapped:function(){this.fire("hass-more-info",{entityId:this.stateObj.entity_id})},updateCameraFeedSrc:function(e){var t=e.attributes,a=(new Date).getTime();this.cameraFeedSrc=t.entity_picture+"&time="+a},imageLoadSuccess:function(){this.imageLoaded=!0},imageLoadFail:function(){this.imageLoaded=!1},computeStateName:function(e){return window.hassUtil.computeStateName(e)}});</script><dom-module id="ha-card" assetpath="components/"><template><style include="paper-material">:host{display:block;border-radius:2px;transition:all 0.30s ease-out;background-color:var(--paper-card-background-color, white);}.header{@apply (--paper-font-headline);@apply (--paper-font-common-expensive-kerning);opacity:var(--dark-primary-opacity);padding:24px 16px 16px;text-transform:capitalize;}</style><template is="dom-if" if="[[header]]"><div class="header">[[header]]</div></template><slot></slot></template></dom-module><script>Polymer({is:"ha-card",properties:{header:{type:String},elevation:{type:Number,value:1,reflectToAttribute:!0}}});</script><dom-module id="paper-toggle-button" assetpath="../bower_components/paper-toggle-button/"><template strip-whitespace=""><style>:host{display:inline-block;@apply --layout-horizontal;@apply --layout-center;@apply --paper-font-common-base;}:host([disabled]){pointer-events:none;}:host(:focus){outline:none;}.toggle-bar{position:absolute;height:100%;width:100%;border-radius:8px;pointer-events:none;opacity:0.4;transition:background-color linear .08s;background-color:var(--paper-toggle-button-unchecked-bar-color, #000000);@apply --paper-toggle-button-unchecked-bar;}.toggle-button{position:absolute;top:-3px;left:0;height:20px;width:20px;border-radius:50%;box-shadow:0 1px 5px 0 rgba(0, 0, 0, 0.6);transition:-webkit-transform linear .08s, background-color linear .08s;transition:transform linear .08s, background-color linear .08s;will-change:transform;background-color:var(--paper-toggle-button-unchecked-button-color, var(--paper-grey-50));@apply --paper-toggle-button-unchecked-button;}.toggle-button.dragging{-webkit-transition:none;transition:none;}:host([checked]:not([disabled])) .toggle-bar{opacity:0.5;background-color:var(--paper-toggle-button-checked-bar-color, var(--primary-color));@apply --paper-toggle-button-checked-bar;}:host([disabled]) .toggle-bar{background-color:#000;opacity:0.12;}:host([checked]) .toggle-button{-webkit-transform:translate(16px, 0);transform:translate(16px, 0);}:host([checked]:not([disabled])) .toggle-button{background-color:var(--paper-toggle-button-checked-button-color, var(--primary-color));@apply --paper-toggle-button-checked-button;}:host([disabled]) .toggle-button{background-color:#bdbdbd;opacity:1;}.toggle-ink{position:absolute;top:-14px;left:-14px;right:auto;bottom:auto;width:48px;height:48px;opacity:0.5;pointer-events:none;color:var(--paper-toggle-button-unchecked-ink-color, var(--primary-text-color));@apply --paper-toggle-button-unchecked-ink;}:host([checked]) .toggle-ink{color:var(--paper-toggle-button-checked-ink-color, var(--primary-color));@apply --paper-toggle-button-checked-ink;}.toggle-container{display:inline-block;position:relative;width:36px;height:14px;margin:4px 1px;}.toggle-label{position:relative;display:inline-block;vertical-align:middle;padding-left:var(--paper-toggle-button-label-spacing, 8px);pointer-events:none;color:var(--paper-toggle-button-label-color, var(--primary-text-color));}:host([invalid]) .toggle-bar{background-color:var(--paper-toggle-button-invalid-bar-color, var(--error-color));}:host([invalid]) .toggle-button{background-color:var(--paper-toggle-button-invalid-button-color, var(--error-color));}:host([invalid]) .toggle-ink{color:var(--paper-toggle-button-invalid-ink-color, var(--error-color));}</style><div class="toggle-container"><div id="toggleBar" class="toggle-bar"></div><div id="toggleButton" class="toggle-button"></div></div><div class="toggle-label"><slot></slot></div></template><script>Polymer({is:"paper-toggle-button",behaviors:[Polymer.PaperCheckedElementBehavior],hostAttributes:{role:"button","aria-pressed":"false",tabindex:0},properties:{},listeners:{track:"_ontrack"},attached:function(){Polymer.RenderStatus.afterNextRender(this,function(){Polymer.Gestures.setTouchAction(this,"pan-y")})},_ontrack:function(t){var e=t.detail;"start"===e.state?this._trackStart(e):"track"===e.state?this._trackMove(e):"end"===e.state&&this._trackEnd(e)},_trackStart:function(t){this._width=this.$.toggleBar.offsetWidth/2,this._trackChecked=this.checked,this.$.toggleButton.classList.add("dragging")},_trackMove:function(t){var e=t.dx;this._x=Math.min(this._width,Math.max(0,this._trackChecked?this._width+e:e)),this.translate3d(this._x+"px",0,0,this.$.toggleButton),this._userActivate(this._x>this._width/2)},_trackEnd:function(t){this.$.toggleButton.classList.remove("dragging"),this.transform("",this.$.toggleButton)},_createRipple:function(){this._rippleContainer=this.$.toggleButton;var t=Polymer.PaperRippleBehavior._createRipple();return t.id="ink",t.setAttribute("recenters",""),t.classList.add("circle","toggle-ink"),t}});</script></dom-module><dom-module id="ha-entity-toggle" assetpath="components/entity/"><template><style>:host{white-space:nowrap;}paper-icon-button{color:var(--primary-text-color);transition:color .5s;}paper-icon-button[state-active]{color:var(--primary-color);}paper-toggle-button{cursor:pointer;--paper-toggle-button-label-spacing:0;padding:13px 5px;margin:-4px -5px;}</style><template is="dom-if" if="[[stateObj.attributes.assumed_state]]"><paper-icon-button icon="mdi:flash-off" on-tap="turnOff" state-active$="[[!isOn]]"></paper-icon-button><paper-icon-button icon="mdi:flash" on-tap="turnOn" state-active$="[[isOn]]"></paper-icon-button></template><template is="dom-if" if="[[!stateObj.attributes.assumed_state]]"><paper-toggle-button class="self-center" checked="[[toggleChecked]]" on-change="toggleChanged"></paper-toggle-button></template></template></dom-module><script>Polymer({is:"ha-entity-toggle",properties:{hass:{type:Object},stateObj:{type:Object},toggleChecked:{type:Boolean,value:!1},isOn:{type:Boolean,computed:"computeIsOn(stateObj)",observer:"isOnChanged"}},listeners:{tap:"onTap"},onTap:function(t){t.stopPropagation()},ready:function(){this.forceStateChange()},toggleChanged:function(t){var e=t.target.checked;e&&!this.isOn?this.callService(!0):!e&&this.isOn&&this.callService(!1)},isOnChanged:function(t){this.toggleChecked=t},forceStateChange:function(){this.toggleChecked===this.isOn&&(this.toggleChecked=!this.toggleChecked),this.toggleChecked=this.isOn},turnOn:function(){this.callService(!0)},turnOff:function(){this.callService(!1)},computeIsOn:function(t){return t&&-1===window.hassUtil.OFF_STATES.indexOf(t.state)},callService:function(t){var e,i,n,s=window.hassUtil.computeDomain(this.stateObj);"lock"===s?(e="lock",i=t?"lock":"unlock"):"cover"===s?(e="cover",i=t?"open":"close"):(e="homeassistant",i=t?"turn_on":"turn_off"),n=this.stateObj,this.hass.callService(e,i,{entity_id:this.stateObj.entity_id}).then(function(){setTimeout(function(){this.stateObj===n&&this.forceStateChange()}.bind(this),2e3)}.bind(this))}});</script><dom-module id="ha-state-icon" assetpath="components/entity/"><template><iron-icon icon="[[computeIcon(stateObj)]]"></iron-icon></template></dom-module><script>Polymer({is:"ha-state-icon",properties:{stateObj:{type:Object}},computeIcon:function(t){return window.hassUtil.stateIcon(t)}});</script><dom-module id="state-badge" assetpath="components/entity/"><template><style>:host{position:relative;display:inline-block;width:40px;color:var(--paper-item-icon-color, #44739e);border-radius:50%;height:40px;text-align:center;background-size:cover;line-height:40px;}ha-state-icon{transition:color .3s ease-in-out;}ha-state-icon[data-domain=light][data-state=on],
     ha-state-icon[data-domain=switch][data-state=on],
     ha-state-icon[data-domain=binary_sensor][data-state=on],
@@ -82,7 +82,7 @@
       :host(.transiting) #secondaryProgress{-webkit-transition-property:-webkit-transform;transition-property:transform;-webkit-transition-duration:var(--paper-progress-transition-duration, 0.08s);transition-duration:var(--paper-progress-transition-duration, 0.08s);-webkit-transition-timing-function:var(--paper-progress-transition-timing-function, ease);transition-timing-function:var(--paper-progress-transition-timing-function, ease);-webkit-transition-delay:var(--paper-progress-transition-delay, 0s);transition-delay:var(--paper-progress-transition-delay, 0s);}#primaryProgress,
       #secondaryProgress{@apply --layout-fit;-webkit-transform-origin:left center;transform-origin:left center;-webkit-transform:scaleX(0);transform:scaleX(0);will-change:transform;}#primaryProgress{background:var(--paper-progress-active-color, var(--google-green-500));}#secondaryProgress{background:var(--paper-progress-secondary-color, var(--google-green-100));}:host([disabled]) #primaryProgress{background:var(--paper-progress-disabled-active-color, var(--google-grey-500));}:host([disabled]) #secondaryProgress{background:var(--paper-progress-disabled-secondary-color, var(--google-grey-300));}:host(:not([disabled])) #primaryProgress.indeterminate{-webkit-transform-origin:right center;transform-origin:right center;-webkit-animation:indeterminate-bar var(--paper-progress-indeterminate-cycle-duration, 2s) linear infinite;animation:indeterminate-bar var(--paper-progress-indeterminate-cycle-duration, 2s) linear infinite;}:host(:not([disabled])) #primaryProgress.indeterminate::after{content:"";-webkit-transform-origin:center center;transform-origin:center center;-webkit-animation:indeterminate-splitter var(--paper-progress-indeterminate-cycle-duration, 2s) linear infinite;animation:indeterminate-splitter var(--paper-progress-indeterminate-cycle-duration, 2s) linear infinite;}@-webkit-keyframes indeterminate-bar{0%{-webkit-transform:scaleX(1) translateX(-100%);}50%{-webkit-transform:scaleX(1) translateX(0%);}75%{-webkit-transform:scaleX(1) translateX(0%);-webkit-animation-timing-function:cubic-bezier(.28,.62,.37,.91);}100%{-webkit-transform:scaleX(0) translateX(0%);}}@-webkit-keyframes indeterminate-splitter{0%{-webkit-transform:scaleX(.75) translateX(-125%);}30%{-webkit-transform:scaleX(.75) translateX(-125%);-webkit-animation-timing-function:cubic-bezier(.42,0,.6,.8);}90%{-webkit-transform:scaleX(.75) translateX(125%);}100%{-webkit-transform:scaleX(.75) translateX(125%);}}@keyframes indeterminate-bar{0%{transform:scaleX(1) translateX(-100%);}50%{transform:scaleX(1) translateX(0%);}75%{transform:scaleX(1) translateX(0%);animation-timing-function:cubic-bezier(.28,.62,.37,.91);}100%{transform:scaleX(0) translateX(0%);}}@keyframes indeterminate-splitter{0%{transform:scaleX(.75) translateX(-125%);}30%{transform:scaleX(.75) translateX(-125%);animation-timing-function:cubic-bezier(.42,0,.6,.8);}90%{transform:scaleX(.75) translateX(125%);}100%{transform:scaleX(.75) translateX(125%);}}</style><div id="progressContainer"><div id="secondaryProgress" hidden$="[[_hideSecondaryProgress(secondaryRatio)]]"></div><div id="primaryProgress"></div></div></template></dom-module><script>Polymer({is:"paper-progress",behaviors:[Polymer.IronRangeBehavior],properties:{secondaryProgress:{type:Number,value:0},secondaryRatio:{type:Number,value:0,readOnly:!0},indeterminate:{type:Boolean,value:!1,observer:"_toggleIndeterminate"},disabled:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_disabledChanged"}},observers:["_progressChanged(secondaryProgress, value, min, max, indeterminate)"],hostAttributes:{role:"progressbar"},_toggleIndeterminate:function(e){this.toggleClass("indeterminate",e,this.$.primaryProgress)},_transformProgress:function(e,r){var s="scaleX("+r/100+")";e.style.transform=e.style.webkitTransform=s},_mainRatioChanged:function(e){this._transformProgress(this.$.primaryProgress,e)},_progressChanged:function(e,r,s,t,a){e=this._clampValue(e),r=this._clampValue(r);var i=100*this._calcRatio(e),o=100*this._calcRatio(r);this._setSecondaryRatio(i),this._transformProgress(this.$.secondaryProgress,i),this._transformProgress(this.$.primaryProgress,o),this.secondaryProgress=e,a?this.removeAttribute("aria-valuenow"):this.setAttribute("aria-valuenow",r),this.setAttribute("aria-valuemin",s),this.setAttribute("aria-valuemax",t)},_disabledChanged:function(e){this.setAttribute("aria-disabled",e?"true":"false")},_hideSecondaryProgress:function(e){return 0===e}});</script><dom-module id="paper-slider" assetpath="../bower_components/paper-slider/"><template strip-whitespace=""><style>:host{@apply --layout;@apply --layout-justified;@apply --layout-center;width:200px;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);--paper-progress-active-color:var(--paper-slider-active-color, var(--google-blue-700));--paper-progress-secondary-color:var(--paper-slider-secondary-color, var(--google-blue-300));--paper-progress-disabled-active-color:var(--paper-slider-disabled-active-color, var(--paper-grey-400));--paper-progress-disabled-secondary-color:var(--paper-slider-disabled-secondary-color, var(--paper-grey-400));--calculated-paper-slider-height:var(--paper-slider-height, 2px);}:host(:focus){outline:none;}:host-context([dir="rtl"]) #sliderContainer{-webkit-transform:scaleX(-1);transform:scaleX(-1);}:host([dir="rtl"]) #sliderContainer{-webkit-transform:scaleX(-1);transform:scaleX(-1);}:host([dir="ltr"]) #sliderContainer{-webkit-transform:scaleX(1);transform:scaleX(1);}#sliderContainer{position:relative;width:100%;height:calc(30px + var(--calculated-paper-slider-height));margin-left:calc(15px + var(--calculated-paper-slider-height)/2);margin-right:calc(15px + var(--calculated-paper-slider-height)/2);}#sliderContainer:focus{outline:0;}#sliderContainer.editable{margin-top:12px;margin-bottom:12px;}.bar-container{position:absolute;top:0;bottom:0;left:0;right:0;overflow:hidden;}.ring > .bar-container{left:calc(5px + var(--calculated-paper-slider-height)/2);transition:left 0.18s ease;}.ring.expand.dragging > .bar-container{transition:none;}.ring.expand:not(.pin) > .bar-container{left:calc(8px + var(--calculated-paper-slider-height)/2);}#sliderBar{padding:15px 0;width:100%;background-color:var(--paper-slider-bar-color, transparent);--paper-progress-container-color:var(--paper-slider-container-color, var(--paper-grey-400));--paper-progress-height:var(--calculated-paper-slider-height);}.slider-markers{position:absolute;top:calc(14px + var(--paper-slider-height,2px)/2);height:var(--calculated-paper-slider-height);left:0;right:-1px;box-sizing:border-box;pointer-events:none;@apply --layout-horizontal;}.slider-marker{@apply --layout-flex;}.slider-markers::after,
       .slider-marker::after{content:"";display:block;margin-left:-1px;width:2px;height:var(--calculated-paper-slider-height);border-radius:50%;background-color:var(--paper-slider-markers-color, #000);}.slider-knob{position:absolute;left:0;top:0;margin-left:calc(-15px - var(--calculated-paper-slider-height)/2);width:calc(30px + var(--calculated-paper-slider-height));height:calc(30px + var(--calculated-paper-slider-height));}.transiting > .slider-knob{transition:left 0.08s ease;}.slider-knob:focus{outline:none;}.slider-knob.dragging{transition:none;}.snaps > .slider-knob.dragging{transition:-webkit-transform 0.08s ease;transition:transform 0.08s ease;}.slider-knob-inner{margin:10px;width:calc(100% - 20px);height:calc(100% - 20px);background-color:var(--paper-slider-knob-color, var(--google-blue-700));border:2px solid var(--paper-slider-knob-color, var(--google-blue-700));border-radius:50%;-moz-box-sizing:border-box;box-sizing:border-box;transition-property:-webkit-transform, background-color, border;transition-property:transform, background-color, border;transition-duration:0.18s;transition-timing-function:ease;}.expand:not(.pin) > .slider-knob > .slider-knob-inner{-webkit-transform:scale(1.5);transform:scale(1.5);}.ring > .slider-knob > .slider-knob-inner{background-color:var(--paper-slider-knob-start-color, transparent);border:2px solid var(--paper-slider-knob-start-border-color, var(--paper-grey-400));}.slider-knob-inner::before{background-color:var(--paper-slider-pin-color, var(--google-blue-700));}.pin > .slider-knob > .slider-knob-inner::before{content:"";position:absolute;top:0;left:50%;margin-left:-13px;width:26px;height:26px;border-radius:50% 50% 50% 0;-webkit-transform:rotate(-45deg) scale(0) translate(0);transform:rotate(-45deg) scale(0) translate(0);}.slider-knob-inner::before,
-      .slider-knob-inner::after{transition:-webkit-transform .18s ease, background-color .18s ease;transition:transform .18s ease, background-color .18s ease;}.pin.ring > .slider-knob > .slider-knob-inner::before{background-color:var(--paper-slider-pin-start-color, var(--paper-grey-400));}.pin.expand > .slider-knob > .slider-knob-inner::before{-webkit-transform:rotate(-45deg) scale(1) translate(17px, -17px);transform:rotate(-45deg) scale(1) translate(17px, -17px);}.pin > .slider-knob > .slider-knob-inner::after{content:attr(value);position:absolute;top:0;left:50%;margin-left:-16px;width:32px;height:26px;text-align:center;color:var(--paper-slider-font-color, #fff);font-size:10px;-webkit-transform:scale(0) translate(0);transform:scale(0) translate(0);}.pin.expand > .slider-knob > .slider-knob-inner::after{-webkit-transform:scale(1) translate(0, -17px);transform:scale(1) translate(0, -17px);}.slider-input{width:50px;overflow:hidden;--paper-input-container-input:{text-align:center;};@apply --paper-slider-input;}#sliderContainer.disabled{pointer-events:none;}.disabled > .slider-knob > .slider-knob-inner{background-color:var(--paper-slider-disabled-knob-color, var(--paper-grey-400));border:2px solid var(--paper-slider-disabled-knob-color, var(--paper-grey-400));-webkit-transform:scale3d(0.75, 0.75, 1);transform:scale3d(0.75, 0.75, 1);}.disabled.ring > .slider-knob > .slider-knob-inner{background-color:var(--paper-slider-knob-start-color, transparent);border:2px solid var(--paper-slider-knob-start-border-color, var(--paper-grey-400));}paper-ripple{color:var(--paper-slider-knob-color, var(--google-blue-700));}</style><div id="sliderContainer" class$="[[_getClassNames(disabled, pin, snaps, immediateValue, min, expand, dragging, transiting, editable)]]"><div class="bar-container"><paper-progress disabled$="[[disabled]]" id="sliderBar" aria-hidden="true" min="[[min]]" max="[[max]]" step="[[step]]" value="[[immediateValue]]" secondary-progress="[[secondaryProgress]]" on-down="_bardown" on-up="_resetKnob" on-track="_onTrack"></paper-progress></div><template is="dom-if" if="[[snaps]]"><div class="slider-markers"><template is="dom-repeat" items="[[markers]]"><div class="slider-marker"></div></template></div></template><div id="sliderKnob" class="slider-knob" on-down="_knobdown" on-up="_resetKnob" on-track="_onTrack" on-transitionend="_knobTransitionEnd"><div class="slider-knob-inner" value$="[[immediateValue]]"></div></div></div><template is="dom-if" if="[[editable]]"><paper-input id="input" type="number" step="[[step]]" min="[[min]]" max="[[max]]" class="slider-input" disabled$="[[disabled]]" value="[[immediateValue]]" on-change="_changeValue" on-keydown="_inputKeyDown" no-label-float=""></paper-input></template></template><script>Polymer({is:"paper-slider",behaviors:[Polymer.IronA11yKeysBehavior,Polymer.IronFormElementBehavior,Polymer.PaperInkyFocusBehavior,Polymer.IronRangeBehavior],properties:{snaps:{type:Boolean,value:!1,notify:!0},pin:{type:Boolean,value:!1,notify:!0},secondaryProgress:{type:Number,value:0,notify:!0,observer:"_secondaryProgressChanged"},editable:{type:Boolean,value:!1},immediateValue:{type:Number,value:0,readOnly:!0,notify:!0},maxMarkers:{type:Number,value:0,notify:!0},expand:{type:Boolean,value:!1,readOnly:!0},dragging:{type:Boolean,value:!1,readOnly:!0},transiting:{type:Boolean,value:!1,readOnly:!0},markers:{type:Array,readOnly:!0,value:function(){return[]}}},observers:["_updateKnob(value, min, max, snaps, step)","_valueChanged(value)","_immediateValueChanged(immediateValue)","_updateMarkers(maxMarkers, min, max, snaps)"],hostAttributes:{role:"slider",tabindex:0},keyBindings:{left:"_leftKey",right:"_rightKey","down pagedown home":"_decrementKey","up pageup end":"_incrementKey"},increment:function(){this.value=this._clampValue(this.value+this.step)},decrement:function(){this.value=this._clampValue(this.value-this.step)},_updateKnob:function(t,e,i,s,a){this.setAttribute("aria-valuemin",e),this.setAttribute("aria-valuemax",i),this.setAttribute("aria-valuenow",t),this._positionKnob(100*this._calcRatio(t))},_valueChanged:function(){this.fire("value-change",{composed:!0})},_immediateValueChanged:function(){this.dragging?this.fire("immediate-value-change",{composed:!0}):this.value=this.immediateValue},_secondaryProgressChanged:function(){this.secondaryProgress=this._clampValue(this.secondaryProgress)},_expandKnob:function(){this._setExpand(!0)},_resetKnob:function(){this.cancelDebouncer("expandKnob"),this._setExpand(!1)},_positionKnob:function(t){this._setImmediateValue(this._calcStep(this._calcKnobPosition(t))),this._setRatio(100*this._calcRatio(this.immediateValue)),this.$.sliderKnob.style.left=this.ratio+"%",this.dragging&&(this._knobstartx=this.ratio*this._w/100,this.translate3d(0,0,0,this.$.sliderKnob))},_calcKnobPosition:function(t){return(this.max-this.min)*t/100+this.min},_onTrack:function(t){switch(t.stopPropagation(),t.detail.state){case"start":this._trackStart(t);break;case"track":this._trackX(t);break;case"end":this._trackEnd()}},_trackStart:function(t){this._setTransiting(!1),this._w=this.$.sliderBar.offsetWidth,this._x=this.ratio*this._w/100,this._startx=this._x,this._knobstartx=this._startx,this._minx=-this._startx,this._maxx=this._w-this._startx,this.$.sliderKnob.classList.add("dragging"),this._setDragging(!0)},_trackX:function(t){this.dragging||this._trackStart(t);var e=this._isRTL?-1:1,i=Math.min(this._maxx,Math.max(this._minx,t.detail.dx*e));this._x=this._startx+i;var s=this._calcStep(this._calcKnobPosition(this._x/this._w*100));this._setImmediateValue(s);var a=this._calcRatio(this.immediateValue)*this._w-this._knobstartx;this.translate3d(a+"px",0,0,this.$.sliderKnob)},_trackEnd:function(){var t=this.$.sliderKnob.style;this.$.sliderKnob.classList.remove("dragging"),this._setDragging(!1),this._resetKnob(),this.value=this.immediateValue,t.transform=t.webkitTransform="",this.fire("change",{composed:!0})},_knobdown:function(t){this._expandKnob(),t.preventDefault(),this.focus()},_bardown:function(t){this._w=this.$.sliderBar.offsetWidth;var e=this.$.sliderBar.getBoundingClientRect(),i=(t.detail.x-e.left)/this._w*100;this._isRTL&&(i=100-i);var s=this.ratio;this._setTransiting(!0),this._positionKnob(i),this.debounce("expandKnob",this._expandKnob,60),s===this.ratio&&this._setTransiting(!1),this.async(function(){this.fire("change",{composed:!0})}),t.preventDefault(),this.focus()},_knobTransitionEnd:function(t){t.target===this.$.sliderKnob&&this._setTransiting(!1)},_updateMarkers:function(t,e,i,s){s||this._setMarkers([]);var a=Math.round((i-e)/this.step);a>t&&(a=t),(a<0||!isFinite(a))&&(a=0),this._setMarkers(new Array(a))},_mergeClasses:function(t){return Object.keys(t).filter(function(e){return t[e]}).join(" ")},_getClassNames:function(){return this._mergeClasses({disabled:this.disabled,pin:this.pin,snaps:this.snaps,ring:this.immediateValue<=this.min,expand:this.expand,dragging:this.dragging,transiting:this.transiting,editable:this.editable})},get _isRTL(){return void 0===this.__isRTL&&(this.__isRTL="rtl"===window.getComputedStyle(this).direction),this.__isRTL},_leftKey:function(t){this._isRTL?this._incrementKey(t):this._decrementKey(t)},_rightKey:function(t){this._isRTL?this._decrementKey(t):this._incrementKey(t)},_incrementKey:function(t){this.disabled||("end"===t.detail.key?this.value=this.max:this.increment(),this.fire("change"),t.preventDefault())},_decrementKey:function(t){this.disabled||("home"===t.detail.key?this.value=this.min:this.decrement(),this.fire("change"),t.preventDefault())},_changeValue:function(t){this.value=t.target.value,this.fire("change",{composed:!0})},_inputKeyDown:function(t){t.stopPropagation()},_createRipple:function(){return this._rippleContainer=this.$.sliderKnob,Polymer.PaperInkyFocusBehaviorImpl._createRipple.call(this)},_focusedChanged:function(t){t&&this.ensureRipple(),this.hasRipple()&&(this._ripple.style.display=t?"":"none",this._ripple.holdDown=t)}});</script></dom-module><dom-module id="ha-cover-tilt-controls" assetpath="components/"><template><style is="custom-style" include="iron-flex"></style><style>:host{white-space:nowrap;}[invisible]{visibility:hidden !important;}</style><paper-icon-button icon="mdi:arrow-top-right" on-tap="onOpenTiltTap" title="Open tilt" invisible$="[[!entityObj.supportsOpenTilt]]" disabled="[[computeOpenDisabled(stateObj, entityObj)]]"></paper-icon-button><paper-icon-button icon="mdi:stop" on-tap="onStopTiltTap" invisible$="[[!entityObj.supportsStopTilt]]" title="Stop tilt"></paper-icon-button><paper-icon-button icon="mdi:arrow-bottom-left" on-tap="onCloseTiltTap" title="Close tilt" invisible$="[[!entityObj.supportsCloseTilt]]" disabled="[[computeClosedDisabled(stateObj, entityObj)]]"></paper-icon-button></template></dom-module><script>Polymer({is:"ha-cover-tilt-controls",properties:{hass:{type:Object},stateObj:{type:Object},entityObj:{type:Object,computed:"computeEntityObj(hass, stateObj)"}},computeEntityObj:function(t,e){return new window.CoverEntity(t,e)},computeOpenDisabled:function(t,e){var o=!0===t.attributes.assumed_state;return e.isFullyOpenTilt&&!o},computeClosedDisabled:function(t,e){var o=!0===t.attributes.assumed_state;return e.isFullyClosedTilt&&!o},onOpenTiltTap:function(t){t.stopPropagation(),this.entityObj.openCoverTilt()},onCloseTiltTap:function(t){t.stopPropagation(),this.entityObj.closeCoverTilt()},onStopTiltTap:function(t){t.stopPropagation(),this.entityObj.stopCoverTilt()}});</script><dom-module id="state-card-cover" assetpath="state-summary/"><template><style is="custom-style" include="iron-flex iron-flex-alignment"></style><style>:host{line-height:1.5;}</style><div class="horizontal justified layout"><state-info state-obj="[[stateObj]]" in-dialog="[[inDialog]]"></state-info><div class="horizontal layout"><ha-cover-controls hidden$="[[entityObj.isTiltOnly]]" hass="[[hass]]" state-obj="[[stateObj]]"></ha-cover-controls><ha-cover-tilt-controls hidden$="[[!entityObj.isTiltOnly]]" hass="[[hass]]" state-obj="[[stateObj]]"></ha-cover-tilt-controls></div></div></template></dom-module><script>Polymer({is:"state-card-cover",properties:{hass:{type:Object},inDialog:{type:Boolean,value:!1},stateObj:{type:Object},entityObj:{type:Object,computed:"computeEntityObj(hass, stateObj)"}},computeEntityObj:function(t,e){return new window.CoverEntity(t,e)}});</script><dom-module id="state-card-display" assetpath="state-summary/"><template><style is="custom-style" include="iron-flex iron-flex-alignment"></style><style>.state{@apply (--paper-font-body1);color:var(--primary-text-color);margin-left:16px;text-align:right;line-height:40px;}</style><div class="horizontal justified layout"><state-info state-obj="[[stateObj]]" in-dialog="[[inDialog]]"></state-info><div class="state">[[computeStateDisplay(stateObj)]]</div></div></template></dom-module><script>Polymer({is:"state-card-display",properties:{inDialog:{type:Boolean,value:!1},stateObj:{type:Object}},computeStateDisplay:function(t){return window.hassUtil.computeStateState(t)}});</script><script>Polymer.IronFitBehavior={properties:{sizingTarget:{type:Object,value:function(){return this}},fitInto:{type:Object,value:window},noOverlap:{type:Boolean},positionTarget:{type:Element},horizontalAlign:{type:String},verticalAlign:{type:String},dynamicAlign:{type:Boolean},horizontalOffset:{type:Number,value:0,notify:!0},verticalOffset:{type:Number,value:0,notify:!0},autoFitOnAttach:{type:Boolean,value:!1},_fitInfo:{type:Object}},get _fitWidth(){return this.fitInto===window?this.fitInto.innerWidth:this.fitInto.getBoundingClientRect().width},get _fitHeight(){return this.fitInto===window?this.fitInto.innerHeight:this.fitInto.getBoundingClientRect().height},get _fitLeft(){return this.fitInto===window?0:this.fitInto.getBoundingClientRect().left},get _fitTop(){return this.fitInto===window?0:this.fitInto.getBoundingClientRect().top},get _defaultPositionTarget(){var t=Polymer.dom(this).parentNode;return t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(t=t.host),t},get _localeHorizontalAlign(){if(this._isRTL){if("right"===this.horizontalAlign)return"left";if("left"===this.horizontalAlign)return"right"}return this.horizontalAlign},attached:function(){void 0===this._isRTL&&(this._isRTL="rtl"==window.getComputedStyle(this).direction),this.positionTarget=this.positionTarget||this._defaultPositionTarget,this.autoFitOnAttach&&("none"===window.getComputedStyle(this).display?setTimeout(function(){this.fit()}.bind(this)):(window.ShadyDOM&&ShadyDOM.flush(),this.fit()))},detached:function(){this.__deferredFit&&(clearTimeout(this.__deferredFit),this.__deferredFit=null)},fit:function(){this.position(),this.constrain(),this.center()},_discoverInfo:function(){if(!this._fitInfo){var t=window.getComputedStyle(this),i=window.getComputedStyle(this.sizingTarget);this._fitInfo={inlineStyle:{top:this.style.top||"",left:this.style.left||"",position:this.style.position||""},sizerInlineStyle:{maxWidth:this.sizingTarget.style.maxWidth||"",maxHeight:this.sizingTarget.style.maxHeight||"",boxSizing:this.sizingTarget.style.boxSizing||""},positionedBy:{vertically:"auto"!==t.top?"top":"auto"!==t.bottom?"bottom":null,horizontally:"auto"!==t.left?"left":"auto"!==t.right?"right":null},sizedBy:{height:"none"!==i.maxHeight,width:"none"!==i.maxWidth,minWidth:parseInt(i.minWidth,10)||0,minHeight:parseInt(i.minHeight,10)||0},margin:{top:parseInt(t.marginTop,10)||0,right:parseInt(t.marginRight,10)||0,bottom:parseInt(t.marginBottom,10)||0,left:parseInt(t.marginLeft,10)||0}}}},resetFit:function(){var t=this,i=this._fitInfo||{};for(var e in i.sizerInlineStyle)t.sizingTarget.style[e]=i.sizerInlineStyle[e];for(var e in i.inlineStyle)t.style[e]=i.inlineStyle[e];this._fitInfo=null},refit:function(){var t=this.sizingTarget.scrollLeft,i=this.sizingTarget.scrollTop;this.resetFit(),this.fit(),this.sizingTarget.scrollLeft=t,this.sizingTarget.scrollTop=i},position:function(){if(this.horizontalAlign||this.verticalAlign){this._discoverInfo(),this.style.position="fixed",this.sizingTarget.style.boxSizing="border-box",this.style.left="0px",this.style.top="0px";var t=this.getBoundingClientRect(),i=this.__getNormalizedRect(this.positionTarget),e=this.__getNormalizedRect(this.fitInto),n=this._fitInfo.margin,o={width:t.width+n.left+n.right,height:t.height+n.top+n.bottom},h=this.__getPosition(this._localeHorizontalAlign,this.verticalAlign,o,i,e),s=h.left+n.left,l=h.top+n.top,r=Math.min(e.right-n.right,s+t.width),a=Math.min(e.bottom-n.bottom,l+t.height);s=Math.max(e.left+n.left,Math.min(s,r-this._fitInfo.sizedBy.minWidth)),l=Math.max(e.top+n.top,Math.min(l,a-this._fitInfo.sizedBy.minHeight)),this.sizingTarget.style.maxWidth=Math.max(r-s,this._fitInfo.sizedBy.minWidth)+"px",this.sizingTarget.style.maxHeight=Math.max(a-l,this._fitInfo.sizedBy.minHeight)+"px",this.style.left=s-t.left+"px",this.style.top=l-t.top+"px"}},constrain:function(){if(!this.horizontalAlign&&!this.verticalAlign){this._discoverInfo();var t=this._fitInfo;t.positionedBy.vertically||(this.style.position="fixed",this.style.top="0px"),t.positionedBy.horizontally||(this.style.position="fixed",this.style.left="0px"),this.sizingTarget.style.boxSizing="border-box";var i=this.getBoundingClientRect();t.sizedBy.height||this.__sizeDimension(i,t.positionedBy.vertically,"top","bottom","Height"),t.sizedBy.width||this.__sizeDimension(i,t.positionedBy.horizontally,"left","right","Width")}},_sizeDimension:function(t,i,e,n,o){this.__sizeDimension(t,i,e,n,o)},__sizeDimension:function(t,i,e,n,o){var h=this._fitInfo,s=this.__getNormalizedRect(this.fitInto),l="Width"===o?s.width:s.height,r=i===n,a=r?l-t[n]:t[e],f=h.margin[r?e:n],g="offset"+o,d=this[g]-this.sizingTarget[g];this.sizingTarget.style["max"+o]=l-f-a-d+"px"},center:function(){if(!this.horizontalAlign&&!this.verticalAlign){this._discoverInfo();var t=this._fitInfo.positionedBy;if(!t.vertically||!t.horizontally){this.style.position="fixed",t.vertically||(this.style.top="0px"),t.horizontally||(this.style.left="0px");var i=this.getBoundingClientRect(),e=this.__getNormalizedRect(this.fitInto);if(!t.vertically){var n=e.top-i.top+(e.height-i.height)/2;this.style.top=n+"px"}if(!t.horizontally){var o=e.left-i.left+(e.width-i.width)/2;this.style.left=o+"px"}}}},__getNormalizedRect:function(t){return t===document.documentElement||t===window?{top:0,left:0,width:window.innerWidth,height:window.innerHeight,right:window.innerWidth,bottom:window.innerHeight}:t.getBoundingClientRect()},__getCroppedArea:function(t,i,e){var n=Math.min(0,t.top)+Math.min(0,e.bottom-(t.top+i.height)),o=Math.min(0,t.left)+Math.min(0,e.right-(t.left+i.width));return Math.abs(n)*i.width+Math.abs(o)*i.height},__getPosition:function(t,i,e,n,o){var h=this,s=[{verticalAlign:"top",horizontalAlign:"left",top:n.top+this.verticalOffset,left:n.left+this.horizontalOffset},{verticalAlign:"top",horizontalAlign:"right",top:n.top+this.verticalOffset,left:n.right-e.width-this.horizontalOffset},{verticalAlign:"bottom",horizontalAlign:"left",top:n.bottom-e.height-this.verticalOffset,left:n.left+this.horizontalOffset},{verticalAlign:"bottom",horizontalAlign:"right",top:n.bottom-e.height-this.verticalOffset,left:n.right-e.width-this.horizontalOffset}];if(this.noOverlap){for(var l=0,r=s.length;l<r;l++){var a={};for(var f in s[l])a[f]=s[l][f];s.push(a)}s[0].top=s[1].top+=n.height,s[2].top=s[3].top-=n.height,s[4].left=s[6].left+=n.width,s[5].left=s[7].left-=n.width}i="auto"===i?null:i,t="auto"===t?null:t;for(var g,l=0;l<s.length;l++){var d=s[l];if(!h.dynamicAlign&&!h.noOverlap&&d.verticalAlign===i&&d.horizontalAlign===t){g=d;break}var p=!(i&&d.verticalAlign!==i||t&&d.horizontalAlign!==t);if(h.dynamicAlign||p){g=g||d,d.croppedArea=h.__getCroppedArea(d,e,o);var y=d.croppedArea-g.croppedArea;if((y<0||0===y&&p)&&(g=d),0===g.croppedArea&&p)break}}return g}};</script><dom-module id="iron-overlay-backdrop" assetpath="../bower_components/iron-overlay-behavior/"><template><style>:host{position:fixed;top:0;left:0;width:100%;height:100%;background-color:var(--iron-overlay-backdrop-background-color, #000);opacity:0;transition:opacity 0.2s;pointer-events:none;@apply --iron-overlay-backdrop;}:host(.opened){opacity:var(--iron-overlay-backdrop-opacity, 0.6);pointer-events:auto;@apply --iron-overlay-backdrop-opened;}</style><slot></slot></template></dom-module><script>!function(){"use strict";Polymer({is:"iron-overlay-backdrop",properties:{opened:{reflectToAttribute:!0,type:Boolean,value:!1,observer:"_openedChanged"}},listeners:{transitionend:"_onTransitionend"},created:function(){this.__openedRaf=null},attached:function(){this.opened&&this._openedChanged(this.opened)},prepare:function(){this.opened&&!this.parentNode&&Polymer.dom(document.body).appendChild(this)},open:function(){this.opened=!0},close:function(){this.opened=!1},complete:function(){this.opened||this.parentNode!==document.body||Polymer.dom(this.parentNode).removeChild(this)},_onTransitionend:function(e){e&&e.target===this&&this.complete()},_openedChanged:function(e){if(e)this.prepare();else{var t=window.getComputedStyle(this);"0s"!==t.transitionDuration&&0!=t.opacity||this.complete()}this.isAttached&&(this.__openedRaf&&(window.cancelAnimationFrame(this.__openedRaf),this.__openedRaf=null),this.scrollTop=this.scrollTop,this.__openedRaf=window.requestAnimationFrame(function(){this.__openedRaf=null,this.toggleClass("opened",this.opened)}.bind(this)))}})}();</script><script>Polymer.IronOverlayManagerClass=function(){this._overlays=[],this._minimumZ=101,this._backdropElement=null,Polymer.Gestures.add(document.documentElement,"tap",null),document.addEventListener("tap",this._onCaptureClick.bind(this),!0),document.addEventListener("focus",this._onCaptureFocus.bind(this),!0),document.addEventListener("keydown",this._onCaptureKeyDown.bind(this),!0)},Polymer.IronOverlayManagerClass.prototype={constructor:Polymer.IronOverlayManagerClass,get backdropElement(){return this._backdropElement||(this._backdropElement=document.createElement("iron-overlay-backdrop")),this._backdropElement},get deepActiveElement(){for(var e=document.activeElement||document.body;e.root&&Polymer.dom(e.root).activeElement;)e=Polymer.dom(e.root).activeElement;return e},_bringOverlayAtIndexToFront:function(e){var t=this,r=this._overlays[e];if(r){var a=this._overlays.length-1,n=this._overlays[a];if(n&&this._shouldBeBehindOverlay(r,n)&&a--,!(e>=a)){var o=Math.max(this.currentOverlayZ(),this._minimumZ);for(this._getZ(r)<=o&&this._applyOverlayZ(r,o);e<a;)t._overlays[e]=t._overlays[e+1],e++;this._overlays[a]=r}}},addOrRemoveOverlay:function(e){e.opened?this.addOverlay(e):this.removeOverlay(e)},addOverlay:function(e){var t=this._overlays.indexOf(e);if(t>=0)return this._bringOverlayAtIndexToFront(t),void this.trackBackdrop();var r=this._overlays.length,a=this._overlays[r-1],n=Math.max(this._getZ(a),this._minimumZ),o=this._getZ(e);if(a&&this._shouldBeBehindOverlay(e,a)){this._applyOverlayZ(a,n),r--;var i=this._overlays[r-1];n=Math.max(this._getZ(i),this._minimumZ)}o<=n&&this._applyOverlayZ(e,n),this._overlays.splice(r,0,e),this.trackBackdrop()},removeOverlay:function(e){var t=this._overlays.indexOf(e);-1!==t&&(this._overlays.splice(t,1),this.trackBackdrop())},currentOverlay:function(){var e=this._overlays.length-1;return this._overlays[e]},currentOverlayZ:function(){return this._getZ(this.currentOverlay())},ensureMinimumZ:function(e){this._minimumZ=Math.max(this._minimumZ,e)},focusOverlay:function(){var e=this.currentOverlay();e&&e._applyFocus()},trackBackdrop:function(){var e=this._overlayWithBackdrop();(e||this._backdropElement)&&(this.backdropElement.style.zIndex=this._getZ(e)-1,this.backdropElement.opened=!!e,this.backdropElement.prepare())},getBackdrops:function(){for(var e=this,t=[],r=0;r<this._overlays.length;r++)e._overlays[r].withBackdrop&&t.push(e._overlays[r]);return t},backdropZ:function(){return this._getZ(this._overlayWithBackdrop())-1},_overlayWithBackdrop:function(){for(var e=this,t=0;t<this._overlays.length;t++)if(e._overlays[t].withBackdrop)return e._overlays[t]},_getZ:function(e){var t=this._minimumZ;if(e){var r=Number(e.style.zIndex||window.getComputedStyle(e).zIndex);r===r&&(t=r)}return t},_setZ:function(e,t){e.style.zIndex=t},_applyOverlayZ:function(e,t){this._setZ(e,t+2)},_overlayInPath:function(e){var t=this;e=e||[];for(var r=0;r<e.length;r++)if(e[r]._manager===t)return e[r]},_onCaptureClick:function(e){var t=this.currentOverlay();t&&this._overlayInPath(Polymer.dom(e).path)!==t&&t._onCaptureClick(e)},_onCaptureFocus:function(e){var t=this.currentOverlay();t&&t._onCaptureFocus(e)},_onCaptureKeyDown:function(e){var t=this.currentOverlay();t&&(Polymer.IronA11yKeysBehavior.keyboardEventMatchesKeys(e,"esc")?t._onCaptureEsc(e):Polymer.IronA11yKeysBehavior.keyboardEventMatchesKeys(e,"tab")&&t._onCaptureTab(e))},_shouldBeBehindOverlay:function(e,t){return!e.alwaysOnTop&&t.alwaysOnTop}},Polymer.IronOverlayManager=new Polymer.IronOverlayManagerClass;</script><script>!function(){"use strict";var e=Element.prototype,t=e.matches||e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;Polymer.IronFocusablesHelper={getTabbableNodes:function(e){var t=[];return this._collectTabbableNodes(e,t)?this._sortByTabIndex(t):t},isFocusable:function(e){return t.call(e,"input, select, textarea, button, object")?t.call(e,":not([disabled])"):t.call(e,"a[href], area[href], iframe, [tabindex], [contentEditable]")},isTabbable:function(e){return this.isFocusable(e)&&t.call(e,':not([tabindex="-1"])')&&this._isVisible(e)},_normalizedTabIndex:function(e){if(this.isFocusable(e)){var t=e.getAttribute("tabindex")||0;return Number(t)}return-1},_collectTabbableNodes:function(e,t){var r=this;if(e.nodeType!==Node.ELEMENT_NODE||!this._isVisible(e))return!1;var a=e,i=this._normalizedTabIndex(a),n=i>0;i>=0&&t.push(a);var o;o="content"===a.localName||"slot"===a.localName?Polymer.dom(a).getDistributedNodes():Polymer.dom(a.root||a).children;for(var s=0;s<o.length;s++)n=r._collectTabbableNodes(o[s],t)||n;return n},_isVisible:function(e){var t=e.style;return"hidden"!==t.visibility&&"none"!==t.display&&("hidden"!==(t=window.getComputedStyle(e)).visibility&&"none"!==t.display)},_sortByTabIndex:function(e){var t=e.length;if(t<2)return e;var r=Math.ceil(t/2),a=this._sortByTabIndex(e.slice(0,r)),i=this._sortByTabIndex(e.slice(r));return this._mergeSortByTabIndex(a,i)},_mergeSortByTabIndex:function(e,t){for(var r=this,a=[];e.length>0&&t.length>0;)r._hasLowerTabOrder(e[0],t[0])?a.push(t.shift()):a.push(e.shift());return a.concat(e,t)},_hasLowerTabOrder:function(e,t){var r=Math.max(e.tabIndex,0),a=Math.max(t.tabIndex,0);return 0===r||0===a?a>r:r>a}}}();</script><script>!function(){"use strict";Polymer.IronOverlayBehaviorImpl={properties:{opened:{observer:"_openedChanged",type:Boolean,value:!1,notify:!0},canceled:{observer:"_canceledChanged",readOnly:!0,type:Boolean,value:!1},withBackdrop:{observer:"_withBackdropChanged",type:Boolean},noAutoFocus:{type:Boolean,value:!1},noCancelOnEscKey:{type:Boolean,value:!1},noCancelOnOutsideClick:{type:Boolean,value:!1},closingReason:{type:Object},restoreFocusOnClose:{type:Boolean,value:!1},alwaysOnTop:{type:Boolean},_manager:{type:Object,value:Polymer.IronOverlayManager},_focusedChild:{type:Object}},listeners:{"iron-resize":"_onIronResize"},get backdropElement(){return this._manager.backdropElement},get _focusNode(){return this._focusedChild||Polymer.dom(this).querySelector("[autofocus]")||this},get _focusableNodes(){return Polymer.IronFocusablesHelper.getTabbableNodes(this)},ready:function(){this.__isAnimating=!1,this.__shouldRemoveTabIndex=!1,this.__firstFocusableNode=this.__lastFocusableNode=null,this.__raf=null,this.__restoreFocusNode=null,this._ensureSetup()},attached:function(){this.opened&&this._openedChanged(this.opened),this._observer=Polymer.dom(this).observeNodes(this._onNodesChange)},detached:function(){Polymer.dom(this).unobserveNodes(this._observer),this._observer=null,this.__raf&&(window.cancelAnimationFrame(this.__raf),this.__raf=null),this._manager.removeOverlay(this)},toggle:function(){this._setCanceled(!1),this.opened=!this.opened},open:function(){this._setCanceled(!1),this.opened=!0},close:function(){this._setCanceled(!1),this.opened=!1},cancel:function(e){this.fire("iron-overlay-canceled",e,{cancelable:!0}).defaultPrevented||(this._setCanceled(!0),this.opened=!1)},invalidateTabbables:function(){this.__firstFocusableNode=this.__lastFocusableNode=null},_ensureSetup:function(){this._overlaySetup||(this._overlaySetup=!0,this.style.outline="none",this.style.display="none")},_openedChanged:function(e){e?this.removeAttribute("aria-hidden"):this.setAttribute("aria-hidden","true"),this.isAttached&&(this.__isAnimating=!0,this.__onNextAnimationFrame(this.__openedChanged))},_canceledChanged:function(){this.closingReason=this.closingReason||{},this.closingReason.canceled=this.canceled},_withBackdropChanged:function(){this.withBackdrop&&!this.hasAttribute("tabindex")?(this.setAttribute("tabindex","-1"),this.__shouldRemoveTabIndex=!0):this.__shouldRemoveTabIndex&&(this.removeAttribute("tabindex"),this.__shouldRemoveTabIndex=!1),this.opened&&this.isAttached&&this._manager.trackBackdrop()},_prepareRenderOpened:function(){this.__restoreFocusNode=this._manager.deepActiveElement,this._preparePositioning(),this.refit(),this._finishPositioning(),this.noAutoFocus&&document.activeElement===this._focusNode&&(this._focusNode.blur(),this.__restoreFocusNode.focus())},_renderOpened:function(){this._finishRenderOpened()},_renderClosed:function(){this._finishRenderClosed()},_finishRenderOpened:function(){this.notifyResize(),this.__isAnimating=!1,this.fire("iron-overlay-opened")},_finishRenderClosed:function(){this.style.display="none",this.style.zIndex="",this.notifyResize(),this.__isAnimating=!1,this.fire("iron-overlay-closed",this.closingReason)},_preparePositioning:function(){this.style.transition=this.style.webkitTransition="none",this.style.transform=this.style.webkitTransform="none",this.style.display=""},_finishPositioning:function(){this.style.display="none",this.scrollTop=this.scrollTop,this.style.transition=this.style.webkitTransition="",this.style.transform=this.style.webkitTransform="",this.style.display="",this.scrollTop=this.scrollTop},_applyFocus:function(){if(this.opened)this.noAutoFocus||this._focusNode.focus();else{this._focusNode.blur(),this._focusedChild=null,this.restoreFocusOnClose&&this.__restoreFocusNode&&this.__restoreFocusNode.focus(),this.__restoreFocusNode=null;var e=this._manager.currentOverlay();e&&this!==e&&e._applyFocus()}},_onCaptureClick:function(e){this.noCancelOnOutsideClick||this.cancel(e)},_onCaptureFocus:function(e){if(this.withBackdrop){var t=Polymer.dom(e).path;-1===t.indexOf(this)?(e.stopPropagation(),this._applyFocus()):this._focusedChild=t[0]}},_onCaptureEsc:function(e){this.noCancelOnEscKey||this.cancel(e)},_onCaptureTab:function(e){if(this.withBackdrop){this.__ensureFirstLastFocusables();var t=e.shiftKey,s=t?this.__firstFocusableNode:this.__lastFocusableNode,i=t?this.__lastFocusableNode:this.__firstFocusableNode,o=!1;if(s===i)o=!0;else{var n=this._manager.deepActiveElement;o=n===s||n===this}o&&(e.preventDefault(),this._focusedChild=i,this._applyFocus())}},_onIronResize:function(){this.opened&&!this.__isAnimating&&this.__onNextAnimationFrame(this.refit)},_onNodesChange:function(){this.opened&&!this.__isAnimating&&(this.invalidateTabbables(),this.notifyResize())},__ensureFirstLastFocusables:function(){if(!this.__firstFocusableNode||!this.__lastFocusableNode){var e=this._focusableNodes;this.__firstFocusableNode=e[0],this.__lastFocusableNode=e[e.length-1]}},__openedChanged:function(){this.opened?(this._prepareRenderOpened(),this._manager.addOverlay(this),this._applyFocus(),this._renderOpened()):(this._manager.removeOverlay(this),this._applyFocus(),this._renderClosed())},__onNextAnimationFrame:function(e){this.__raf&&window.cancelAnimationFrame(this.__raf);var t=this;this.__raf=window.requestAnimationFrame(function(){t.__raf=null,e.call(t)})}},Polymer.IronOverlayBehavior=[Polymer.IronFitBehavior,Polymer.IronResizableBehavior,Polymer.IronOverlayBehaviorImpl]}();</script><script>Polymer.NeonAnimatableBehavior={properties:{animationConfig:{type:Object},entryAnimation:{observer:"_entryAnimationChanged",type:String},exitAnimation:{observer:"_exitAnimationChanged",type:String}},_entryAnimationChanged:function(){this.animationConfig=this.animationConfig||{},this.animationConfig.entry=[{name:this.entryAnimation,node:this}]},_exitAnimationChanged:function(){this.animationConfig=this.animationConfig||{},this.animationConfig.exit=[{name:this.exitAnimation,node:this}]},_copyProperties:function(i,n){for(var t in n)i[t]=n[t]},_cloneConfig:function(i){var n={isClone:!0};return this._copyProperties(n,i),n},_getAnimationConfigRecursive:function(i,n,t){var o=this;if(this.animationConfig)if(this.animationConfig.value&&"function"==typeof this.animationConfig.value)this._warn(this._logf("playAnimation","Please put 'animationConfig' inside of your components 'properties' object instead of outside of it."));else{var e;if(e=i?this.animationConfig[i]:this.animationConfig,Array.isArray(e)||(e=[e]),e)for(var a,r=0;a=e[r];r++)if(a.animatable)a.animatable._getAnimationConfigRecursive(a.type||i,n,t);else if(a.id){var s=n[a.id];s?(s.isClone||(n[a.id]=o._cloneConfig(s),s=n[a.id]),o._copyProperties(s,a)):n[a.id]=a}else t.push(a)}},getAnimationConfig:function(i){var n={},t=[];this._getAnimationConfigRecursive(i,n,t);for(var o in n)t.push(n[o]);return t}};</script><script>Polymer.NeonAnimationRunnerBehaviorImpl={_configureAnimations:function(n){var i=this,e=[];if(n.length>0)for(var t,o=0;t=n[o];o++){var a=document.createElement(t.name);if(a.isNeonAnimation){var l=null;try{"function"!=typeof(l=a.configure(t)).cancel&&(l=document.timeline.play(l))}catch(n){l=null,console.warn("Couldnt play","(",t.name,").",n)}l&&e.push({neonAnimation:a,config:t,animation:l})}else console.warn(i.is+":",t.name,"not found!")}return e},_shouldComplete:function(n){for(var i=!0,e=0;e<n.length;e++)if("finished"!=n[e].animation.playState){i=!1;break}return i},_complete:function(n){for(i=0;i<n.length;i++)n[i].neonAnimation.complete(n[i].config);for(var i=0;i<n.length;i++)n[i].animation.cancel()},playAnimation:function(n,i){var e=this,t=this.getAnimationConfig(n);if(t){this._active=this._active||{},this._active[n]&&(this._complete(this._active[n]),delete this._active[n]);var o=this._configureAnimations(t);if(0!=o.length){this._active[n]=o;for(var a=0;a<o.length;a++)o[a].animation.onfinish=function(){this._shouldComplete(o)&&(this._complete(o),delete this._active[n],this.fire("neon-animation-finish",i,{bubbles:!1}))}.bind(e)}else this.fire("neon-animation-finish",i,{bubbles:!1})}},cancelAnimation:function(){var n=this;for(var i in this._animations)n._animations[i].cancel();this._animations={}}},Polymer.NeonAnimationRunnerBehavior=[Polymer.NeonAnimatableBehavior,Polymer.NeonAnimationRunnerBehaviorImpl];</script><script>!function(){"use strict";var e={pageX:0,pageY:0},t=null,l=[],n=["wheel","mousewheel","DOMMouseScroll","touchstart","touchmove"];Polymer.IronDropdownScrollManager={get currentLockingElement(){return this._lockingElements[this._lockingElements.length-1]},elementIsScrollLocked:function(e){var t=this.currentLockingElement;if(void 0===t)return!1;var l;return!!this._hasCachedLockedElement(e)||!this._hasCachedUnlockedElement(e)&&((l=!!t&&t!==e&&!this._composedTreeContains(t,e))?this._lockedElementCache.push(e):this._unlockedElementCache.push(e),l)},pushScrollLock:function(e){this._lockingElements.indexOf(e)>=0||(0===this._lockingElements.length&&this._lockScrollInteractions(),this._lockingElements.push(e),this._lockedElementCache=[],this._unlockedElementCache=[])},removeScrollLock:function(e){var t=this._lockingElements.indexOf(e);-1!==t&&(this._lockingElements.splice(t,1),this._lockedElementCache=[],this._unlockedElementCache=[],0===this._lockingElements.length&&this._unlockScrollInteractions())},_lockingElements:[],_lockedElementCache:null,_unlockedElementCache:null,_hasCachedLockedElement:function(e){return this._lockedElementCache.indexOf(e)>-1},_hasCachedUnlockedElement:function(e){return this._unlockedElementCache.indexOf(e)>-1},_composedTreeContains:function(e,t){var l,n,o,r,c=this;if(e.contains(t))return!0;for(l=Polymer.dom(e).querySelectorAll("content,slot"),o=0;o<l.length;++o)for(n=Polymer.dom(l[o]).getDistributedNodes(),r=0;r<n.length;++r)if(n[r].nodeType===Node.ELEMENT_NODE&&c._composedTreeContains(n[r],t))return!0;return!1},_scrollInteractionHandler:function(t){if(t.cancelable&&this._shouldPreventScrolling(t)&&t.preventDefault(),t.targetTouches){var l=t.targetTouches[0];e.pageX=l.pageX,e.pageY=l.pageY}},_lockScrollInteractions:function(){var e=this;this._boundScrollHandler=this._boundScrollHandler||this._scrollInteractionHandler.bind(this);for(var t=0,l=n.length;t<l;t++)document.addEventListener(n[t],e._boundScrollHandler,{capture:!0,passive:!1})},_unlockScrollInteractions:function(){for(var e=this,t=0,l=n.length;t<l;t++)document.removeEventListener(n[t],e._boundScrollHandler,{capture:!0,passive:!1})},_shouldPreventScrolling:function(e){var n=Polymer.dom(e).rootTarget;if("touchmove"!==e.type&&t!==n&&(t=n,l=this._getScrollableNodes(Polymer.dom(e).path)),!l.length)return!0;if("touchstart"===e.type)return!1;var o=this._getScrollInfo(e);return!this._getScrollingNode(l,o.deltaX,o.deltaY)},_getScrollableNodes:function(e){for(var t=[],l=e.indexOf(this.currentLockingElement),n=0;n<=l;n++)if(e[n].nodeType===Node.ELEMENT_NODE){var o=e[n],r=o.style;"scroll"!==r.overflow&&"auto"!==r.overflow&&(r=window.getComputedStyle(o)),"scroll"!==r.overflow&&"auto"!==r.overflow||t.push(o)}return t},_getScrollingNode:function(e,t,l){if(t||l)for(var n=Math.abs(l)>=Math.abs(t),o=0;o<e.length;o++){var r=e[o];if(n?l<0?r.scrollTop>0:r.scrollTop<r.scrollHeight-r.clientHeight:t<0?r.scrollLeft>0:r.scrollLeft<r.scrollWidth-r.clientWidth)return r}},_getScrollInfo:function(t){var l={deltaX:t.deltaX,deltaY:t.deltaY};if("deltaX"in t);else if("wheelDeltaX"in t)l.deltaX=-t.wheelDeltaX,l.deltaY=-t.wheelDeltaY;else if("axis"in t)l.deltaX=1===t.axis?t.detail:0,l.deltaY=2===t.axis?t.detail:0;else if(t.targetTouches){var n=t.targetTouches[0];l.deltaX=e.pageX-n.pageX,l.deltaY=e.pageY-n.pageY}return l}}}();</script><dom-module id="iron-dropdown" assetpath="../bower_components/iron-dropdown/"><template><style>:host{position:fixed;}#contentWrapper ::slotted(*){overflow:auto;}#contentWrapper.animating ::slotted(*){overflow:hidden;}</style><div id="contentWrapper"><slot id="content" name="dropdown-content"></slot></div></template><script>!function(){"use strict";Polymer({is:"iron-dropdown",behaviors:[Polymer.IronControlState,Polymer.IronA11yKeysBehavior,Polymer.IronOverlayBehavior,Polymer.NeonAnimationRunnerBehavior],properties:{horizontalAlign:{type:String,value:"left",reflectToAttribute:!0},verticalAlign:{type:String,value:"top",reflectToAttribute:!0},openAnimationConfig:{type:Object},closeAnimationConfig:{type:Object},focusTarget:{type:Object},noAnimations:{type:Boolean,value:!1},allowOutsideScroll:{type:Boolean,value:!1},_boundOnCaptureScroll:{type:Function,value:function(){return this._onCaptureScroll.bind(this)}}},listeners:{"neon-animation-finish":"_onNeonAnimationFinish"},observers:["_updateOverlayPosition(positionTarget, verticalAlign, horizontalAlign, verticalOffset, horizontalOffset)"],get containedElement(){for(var o=Polymer.dom(this.$.content).getDistributedNodes(),n=0,t=o.length;n<t;n++)if(o[n].nodeType===Node.ELEMENT_NODE)return o[n]},ready:function(){this._scrollTop=0,this._scrollLeft=0,this._refitOnScrollRAF=null},attached:function(){this.sizingTarget&&this.sizingTarget!==this||(this.sizingTarget=this.containedElement||this)},detached:function(){this.cancelAnimation(),document.removeEventListener("scroll",this._boundOnCaptureScroll),Polymer.IronDropdownScrollManager.removeScrollLock(this)},_openedChanged:function(){this.opened&&this.disabled?this.cancel():(this.cancelAnimation(),this._updateAnimationConfig(),this._saveScrollPosition(),this.opened?(document.addEventListener("scroll",this._boundOnCaptureScroll),!this.allowOutsideScroll&&Polymer.IronDropdownScrollManager.pushScrollLock(this)):(document.removeEventListener("scroll",this._boundOnCaptureScroll),Polymer.IronDropdownScrollManager.removeScrollLock(this)),Polymer.IronOverlayBehaviorImpl._openedChanged.apply(this,arguments))},_renderOpened:function(){!this.noAnimations&&this.animationConfig.open?(this.$.contentWrapper.classList.add("animating"),this.playAnimation("open")):Polymer.IronOverlayBehaviorImpl._renderOpened.apply(this,arguments)},_renderClosed:function(){!this.noAnimations&&this.animationConfig.close?(this.$.contentWrapper.classList.add("animating"),this.playAnimation("close")):Polymer.IronOverlayBehaviorImpl._renderClosed.apply(this,arguments)},_onNeonAnimationFinish:function(){this.$.contentWrapper.classList.remove("animating"),this.opened?this._finishRenderOpened():this._finishRenderClosed()},_onCaptureScroll:function(){this.allowOutsideScroll?(this._refitOnScrollRAF&&window.cancelAnimationFrame(this._refitOnScrollRAF),this._refitOnScrollRAF=window.requestAnimationFrame(this.refit.bind(this))):this._restoreScrollPosition()},_saveScrollPosition:function(){document.scrollingElement?(this._scrollTop=document.scrollingElement.scrollTop,this._scrollLeft=document.scrollingElement.scrollLeft):(this._scrollTop=Math.max(document.documentElement.scrollTop,document.body.scrollTop),this._scrollLeft=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft))},_restoreScrollPosition:function(){document.scrollingElement?(document.scrollingElement.scrollTop=this._scrollTop,document.scrollingElement.scrollLeft=this._scrollLeft):(document.documentElement.scrollTop=this._scrollTop,document.documentElement.scrollLeft=this._scrollLeft,document.body.scrollTop=this._scrollTop,document.body.scrollLeft=this._scrollLeft)},_updateAnimationConfig:function(){for(var o=this.containedElement,n=[].concat(this.openAnimationConfig||[]).concat(this.closeAnimationConfig||[]),t=0;t<n.length;t++)n[t].node=o;this.animationConfig={open:this.openAnimationConfig,close:this.closeAnimationConfig}},_updateOverlayPosition:function(){this.isAttached&&this.notifyResize()},_applyFocus:function(){var o=this.focusTarget||this.containedElement;o&&this.opened&&!this.noAutoFocus?o.focus():Polymer.IronOverlayBehaviorImpl._applyFocus.apply(this,arguments)}})}();</script></dom-module><script>Polymer.NeonAnimationBehavior={properties:{animationTiming:{type:Object,value:function(){return{duration:500,easing:"cubic-bezier(0.4, 0, 0.2, 1)",fill:"both"}}}},isNeonAnimation:!0,created:function(){document.body.animate||console.warn("No web animations detected. This element will not function without a web animations polyfill.")},timingFromConfig:function(i){var n=this;if(i.timing)for(var t in i.timing)n.animationTiming[t]=i.timing[t];return this.animationTiming},setPrefixedProperty:function(i,n,t){for(var o,e={transform:["webkitTransform"],transformOrigin:["mozTransformOrigin","webkitTransformOrigin"]}[n],r=0;o=e[r];r++)i.style[o]=t;i.style[n]=t},complete:function(){}};</script><script>Polymer({is:"fade-in-animation",behaviors:[Polymer.NeonAnimationBehavior],configure:function(i){var e=i.node;return this._effect=new KeyframeEffect(e,[{opacity:"0"},{opacity:"1"}],this.timingFromConfig(i)),this._effect}});</script><script>Polymer({is:"fade-out-animation",behaviors:[Polymer.NeonAnimationBehavior],configure:function(e){var i=e.node;return this._effect=new KeyframeEffect(i,[{opacity:"1"},{opacity:"0"}],this.timingFromConfig(e)),this._effect}});</script><script>Polymer({is:"paper-menu-grow-height-animation",behaviors:[Polymer.NeonAnimationBehavior],configure:function(e){var i=e.node,t=i.getBoundingClientRect().height;return this._effect=new KeyframeEffect(i,[{height:t/2+"px"},{height:t+"px"}],this.timingFromConfig(e)),this._effect}}),Polymer({is:"paper-menu-grow-width-animation",behaviors:[Polymer.NeonAnimationBehavior],configure:function(e){var i=e.node,t=i.getBoundingClientRect().width;return this._effect=new KeyframeEffect(i,[{width:t/2+"px"},{width:t+"px"}],this.timingFromConfig(e)),this._effect}}),Polymer({is:"paper-menu-shrink-width-animation",behaviors:[Polymer.NeonAnimationBehavior],configure:function(e){var i=e.node,t=i.getBoundingClientRect().width;return this._effect=new KeyframeEffect(i,[{width:t+"px"},{width:t-t/20+"px"}],this.timingFromConfig(e)),this._effect}}),Polymer({is:"paper-menu-shrink-height-animation",behaviors:[Polymer.NeonAnimationBehavior],configure:function(e){var i=e.node,t=i.getBoundingClientRect(),n=t.height;t.top;return this.setPrefixedProperty(i,"transformOrigin","0 0"),this._effect=new KeyframeEffect(i,[{height:n+"px",transform:"translateY(0)"},{height:n/2+"px",transform:"translateY(-20px)"}],this.timingFromConfig(e)),this._effect}});</script><dom-module id="paper-menu-button" assetpath="../bower_components/paper-menu-button/"><template><style>:host{display:inline-block;position:relative;padding:8px;outline:none;@apply --paper-menu-button;}:host([disabled]){cursor:auto;color:var(--disabled-text-color);@apply --paper-menu-button-disabled;}iron-dropdown{@apply --paper-menu-button-dropdown;}.dropdown-content{@apply --shadow-elevation-2dp;position:relative;border-radius:2px;background-color:var(--paper-menu-button-dropdown-background, var(--primary-background-color));@apply --paper-menu-button-content;}:host([vertical-align="top"]) .dropdown-content{margin-bottom:20px;margin-top:-10px;top:10px;}:host([vertical-align="bottom"]) .dropdown-content{bottom:10px;margin-bottom:-10px;margin-top:20px;}#trigger{cursor:pointer;}</style><div id="trigger" on-tap="toggle"><slot name="dropdown-trigger"></slot></div><iron-dropdown id="dropdown" opened="{{opened}}" horizontal-align="[[horizontalAlign]]" vertical-align="[[verticalAlign]]" dynamic-align="[[dynamicAlign]]" horizontal-offset="[[horizontalOffset]]" vertical-offset="[[verticalOffset]]" no-overlap="[[noOverlap]]" open-animation-config="[[openAnimationConfig]]" close-animation-config="[[closeAnimationConfig]]" no-animations="[[noAnimations]]" focus-target="[[_dropdownContent]]" allow-outside-scroll="[[allowOutsideScroll]]" restore-focus-on-close="[[restoreFocusOnClose]]" on-iron-overlay-canceled="__onIronOverlayCanceled"><div slot="dropdown-content" class="dropdown-content"><slot id="content" name="dropdown-content"></slot></div></iron-dropdown></template><script>!function(){"use strict";var e={ANIMATION_CUBIC_BEZIER:"cubic-bezier(.3,.95,.5,1)",MAX_ANIMATION_TIME_MS:400},n=Polymer({is:"paper-menu-button",behaviors:[Polymer.IronA11yKeysBehavior,Polymer.IronControlState],properties:{opened:{type:Boolean,value:!1,notify:!0,observer:"_openedChanged"},horizontalAlign:{type:String,value:"left",reflectToAttribute:!0},verticalAlign:{type:String,value:"top",reflectToAttribute:!0},dynamicAlign:{type:Boolean},horizontalOffset:{type:Number,value:0,notify:!0},verticalOffset:{type:Number,value:0,notify:!0},noOverlap:{type:Boolean},noAnimations:{type:Boolean,value:!1},ignoreSelect:{type:Boolean,value:!1},closeOnActivate:{type:Boolean,value:!1},openAnimationConfig:{type:Object,value:function(){return[{name:"fade-in-animation",timing:{delay:100,duration:200}},{name:"paper-menu-grow-width-animation",timing:{delay:100,duration:150,easing:e.ANIMATION_CUBIC_BEZIER}},{name:"paper-menu-grow-height-animation",timing:{delay:100,duration:275,easing:e.ANIMATION_CUBIC_BEZIER}}]}},closeAnimationConfig:{type:Object,value:function(){return[{name:"fade-out-animation",timing:{duration:150}},{name:"paper-menu-shrink-width-animation",timing:{delay:100,duration:50,easing:e.ANIMATION_CUBIC_BEZIER}},{name:"paper-menu-shrink-height-animation",timing:{duration:200,easing:"ease-in"}}]}},allowOutsideScroll:{type:Boolean,value:!1},restoreFocusOnClose:{type:Boolean,value:!0},_dropdownContent:{type:Object}},hostAttributes:{role:"group","aria-haspopup":"true"},listeners:{"iron-activate":"_onIronActivate","iron-select":"_onIronSelect"},get contentElement(){for(var e=Polymer.dom(this.$.content).getDistributedNodes(),n=0,t=e.length;n<t;n++)if(e[n].nodeType===Node.ELEMENT_NODE)return e[n]},toggle:function(){this.opened?this.close():this.open()},open:function(){this.disabled||this.$.dropdown.open()},close:function(){this.$.dropdown.close()},_onIronSelect:function(e){this.ignoreSelect||this.close()},_onIronActivate:function(e){this.closeOnActivate&&this.close()},_openedChanged:function(e,n){e?(this._dropdownContent=this.contentElement,this.fire("paper-dropdown-open")):null!=n&&this.fire("paper-dropdown-close")},_disabledChanged:function(e){Polymer.IronControlState._disabledChanged.apply(this,arguments),e&&this.opened&&this.close()},__onIronOverlayCanceled:function(e){var n=e.detail,t=(Polymer.dom(n).rootTarget,this.$.trigger);Polymer.dom(n).path.indexOf(t)>-1&&e.preventDefault()}});Object.keys(e).forEach(function(t){n[t]=e[t]}),Polymer.PaperMenuButton=n}();</script></dom-module><iron-iconset-svg name="paper-dropdown-menu" size="24"><svg><defs><g id="arrow-drop-down"><path d="M7 10l5 5 5-5z"></path></g></defs></svg></iron-iconset-svg><dom-module id="paper-dropdown-menu-shared-styles" assetpath="../bower_components/paper-dropdown-menu/"><template><style>:host{display:inline-block;position:relative;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;--paper-input-container-input:{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;max-width:100%;box-sizing:border-box;cursor:pointer;};@apply --paper-dropdown-menu;}:host([disabled]){@apply --paper-dropdown-menu-disabled;}:host([noink]) paper-ripple{display:none;}:host([no-label-float]) paper-ripple{top:8px;}paper-ripple{top:12px;left:0px;bottom:8px;right:0px;@apply --paper-dropdown-menu-ripple;}paper-menu-button{display:block;padding:0;@apply --paper-dropdown-menu-button;}paper-input{@apply --paper-dropdown-menu-input;}iron-icon{color:var(--disabled-text-color);@apply --paper-dropdown-menu-icon;}</style></template></dom-module><dom-module id="paper-dropdown-menu" assetpath="../bower_components/paper-dropdown-menu/"><template><style include="paper-dropdown-menu-shared-styles"></style><span role="button"></span><paper-menu-button id="menuButton" vertical-align="[[verticalAlign]]" horizontal-align="[[horizontalAlign]]" dynamic-align="[[dynamicAlign]]" vertical-offset="[[_computeMenuVerticalOffset(noLabelFloat)]]" disabled="[[disabled]]" no-animations="[[noAnimations]]" on-iron-select="_onIronSelect" on-iron-deselect="_onIronDeselect" opened="{{opened}}" close-on-activate="" allow-outside-scroll="[[allowOutsideScroll]]" restore-focus-on-close="[[restoreFocusOnClose]]"><div class="dropdown-trigger" slot="dropdown-trigger"><paper-ripple></paper-ripple><paper-input type="text" invalid="[[invalid]]" readonly="" disabled="[[disabled]]" value="[[selectedItemLabel]]" placeholder="[[placeholder]]" error-message="[[errorMessage]]" always-float-label="[[alwaysFloatLabel]]" no-label-float="[[noLabelFloat]]" label="[[label]]"><iron-icon icon="paper-dropdown-menu:arrow-drop-down" suffix="" slot="suffix"></iron-icon></paper-input></div><slot id="content" name="dropdown-content" slot="dropdown-content"></slot></paper-menu-button></template><script>!function(){"use strict";Polymer({is:"paper-dropdown-menu",behaviors:[Polymer.IronButtonState,Polymer.IronControlState,Polymer.IronFormElementBehavior,Polymer.IronValidatableBehavior],properties:{selectedItemLabel:{type:String,notify:!0,readOnly:!0},selectedItem:{type:Object,notify:!0,readOnly:!0},value:{type:String,notify:!0,readOnly:!0},label:{type:String},placeholder:{type:String},errorMessage:{type:String},opened:{type:Boolean,notify:!0,value:!1,observer:"_openedChanged"},allowOutsideScroll:{type:Boolean,value:!1},noLabelFloat:{type:Boolean,value:!1,reflectToAttribute:!0},alwaysFloatLabel:{type:Boolean,value:!1},noAnimations:{type:Boolean,value:!1},horizontalAlign:{type:String,value:"right"},verticalAlign:{type:String,value:"top"},dynamicAlign:{type:Boolean},restoreFocusOnClose:{type:Boolean,value:!0}},listeners:{tap:"_onTap"},keyBindings:{"up down":"open",esc:"close"},hostAttributes:{role:"combobox","aria-autocomplete":"none","aria-haspopup":"true"},observers:["_selectedItemChanged(selectedItem)"],attached:function(){var e=this.contentElement;e&&e.selectedItem&&this._setSelectedItem(e.selectedItem)},get contentElement(){for(var e=Polymer.dom(this.$.content).getDistributedNodes(),t=0,n=e.length;t<n;t++)if(e[t].nodeType===Node.ELEMENT_NODE)return e[t]},open:function(){this.$.menuButton.open()},close:function(){this.$.menuButton.close()},_onIronSelect:function(e){this._setSelectedItem(e.detail.item)},_onIronDeselect:function(e){this._setSelectedItem(null)},_onTap:function(e){Polymer.Gestures.findOriginalTarget(e)===this&&this.open()},_selectedItemChanged:function(e){var t="";t=e?e.label||e.getAttribute("label")||e.textContent.trim():"",this._setValue(t),this._setSelectedItemLabel(t)},_computeMenuVerticalOffset:function(e){return e?-4:8},_getValidity:function(e){return this.disabled||!this.required||this.required&&!!this.value},_openedChanged:function(){var e=this.opened?"true":"false",t=this.contentElement;t&&t.setAttribute("aria-expanded",e)}})}();</script></dom-module><dom-module id="paper-listbox" assetpath="../bower_components/paper-listbox/"><template><style>:host{display:block;padding:8px 0;background:var(--paper-listbox-background-color, var(--primary-background-color));color:var(--paper-listbox-color, var(--primary-text-color));@apply --paper-listbox;}</style><slot></slot></template><script>Polymer({is:"paper-listbox",behaviors:[Polymer.IronMenuBehavior],hostAttributes:{role:"listbox"}});</script></dom-module><script>Polymer.PaperItemBehaviorImpl={hostAttributes:{role:"option",tabindex:"0"}},Polymer.PaperItemBehavior=[Polymer.IronButtonState,Polymer.IronControlState,Polymer.PaperItemBehaviorImpl];</script><dom-module id="paper-item-shared-styles" assetpath="../bower_components/paper-item/"><template><style>:host, .paper-item{display:block;position:relative;min-height:var(--paper-item-min-height, 48px);padding:0px 16px;}.paper-item{@apply --paper-font-subhead;border:none;outline:none;background:white;width:100%;text-align:left;}:host([hidden]), .paper-item[hidden]{display:none !important;}:host(.iron-selected), .paper-item.iron-selected{font-weight:var(--paper-item-selected-weight, bold);@apply --paper-item-selected;}:host([disabled]), .paper-item[disabled]{color:var(--paper-item-disabled-color, var(--disabled-text-color));@apply --paper-item-disabled;}:host(:focus), .paper-item:focus{position:relative;outline:0;@apply --paper-item-focused;}:host(:focus):before, .paper-item:focus:before{@apply --layout-fit;background:currentColor;content:'';opacity:var(--dark-divider-opacity);pointer-events:none;@apply --paper-item-focused-before;}</style></template></dom-module><dom-module id="paper-item" assetpath="../bower_components/paper-item/"><template><style include="paper-item-shared-styles"></style><style>:host{@apply --layout-horizontal;@apply --layout-center;@apply --paper-font-subhead;@apply --paper-item;}</style><slot></slot></template><script>Polymer({is:"paper-item",behaviors:[Polymer.PaperItemBehavior]});</script></dom-module><dom-module id="state-card-input_select" assetpath="state-summary/"><template><style>:host{display:block;}state-badge{float:left;margin-top:10px;}paper-dropdown-menu{display:block;margin-left:53px;}paper-item{cursor:pointer;}</style><state-badge state-obj="[[stateObj]]"></state-badge><paper-dropdown-menu on-tap="stopPropagation" selected-item-label="{{selectedOption}}" label="[[computeStateName(stateObj)]]"><paper-listbox slot="dropdown-content" selected="[[computeSelected(stateObj)]]"><template is="dom-repeat" items="[[stateObj.attributes.options]]"><paper-item>[[item]]</paper-item></template></paper-listbox></paper-dropdown-menu></template></dom-module><script>Polymer({is:"state-card-input_select",properties:{hass:{type:Object},inDialog:{type:Boolean,value:!1},stateObj:{type:Object},selectedOption:{type:String,observer:"selectedOptionChanged"}},computeStateName:function(t){return window.hassUtil.computeStateName(t)},computeSelected:function(t){return t.attributes.options.indexOf(t.state)},selectedOptionChanged:function(t){""!==t&&t!==this.stateObj.state&&this.hass.callService("input_select","select_option",{option:t,entity_id:this.stateObj.entity_id})},stopPropagation:function(t){t.stopPropagation()}});</script><dom-module id="state-card-input_slider" assetpath="state-summary/"><template><style is="custom-style" include="iron-flex iron-flex-alignment"></style><style>paper-slider{margin-left:16px;}</style><div class="horizontal justified layout"><state-info state-obj="[[stateObj]]" in-dialog="[[inDialog]]"></state-info><paper-slider min="[[min]]" max="[[max]]" value="{{value}}" step="[[step]]" pin="" on-change="selectedValueChanged" on-tap="stopPropagation"></paper-slider></div></template></dom-module><script>Polymer({is:"state-card-input_slider",properties:{hass:{type:Object},inDialog:{type:Boolean,value:!1},stateObj:{type:Object,observer:"stateObjectChanged"},min:{type:Number,value:0},max:{type:Number,value:100},step:{type:Number},value:{type:Number}},stateObjectChanged:function(e){this.min=Number(e.attributes.min),this.max=Number(e.attributes.max),this.step=Number(e.attributes.step),this.value=Number(e.state)},selectedValueChanged:function(){this.value!==Number(this.stateObj.state)&&this.hass.callService("input_slider","select_value",{value:this.value,entity_id:this.stateObj.entity_id})},stopPropagation:function(e){e.stopPropagation()}});</script><dom-module id="state-card-media_player" assetpath="state-summary/"><template><style is="custom-style" include="iron-flex iron-flex-alignment"></style><style>:host{line-height:1.5;}.state{@apply (--paper-font-common-nowrap);@apply (--paper-font-body1);margin-left:16px;text-align:right;}.main-text{@apply (--paper-font-common-nowrap);color:var(--primary-text-color);text-transform:capitalize;}.main-text[take-height]{line-height:40px;}.secondary-text{@apply (--paper-font-common-nowrap);color:var(--secondary-text-color);}</style><div class="horizontal justified layout"><state-info state-obj="[[stateObj]]" in-dialog="[[inDialog]]"></state-info><div class="state"><div class="main-text" take-height$="[[!playerObj.secondaryText]]">[[playerObj.primaryText]]</div><div class="secondary-text">[[playerObj.secondaryText]]</div></div></div></template></dom-module><script>Polymer({PLAYING_STATES:["playing","paused"],is:"state-card-media_player",properties:{hass:{type:Object},inDialog:{type:Boolean,value:!1},stateObj:{type:Object},playerObj:{type:Object,computed:"computePlayerObj(hass, stateObj)"}},computePlayerObj:function(e,t){return new window.MediaPlayerEntity(e,t)}});</script><dom-module id="state-card-scene" assetpath="state-summary/"><template><style is="custom-style" include="iron-flex iron-flex-alignment"></style><style>paper-button{color:var(--primary-color);font-weight:500;top:3px;height:37px;margin-right:-.57em;}</style><div class="horizontal justified layout"><state-info state-obj="[[stateObj]]" in-dialog="[[inDialog]]"></state-info><paper-button on-tap="activateScene">ACTIVATE</paper-button></div></template></dom-module><script>Polymer({is:"state-card-scene",properties:{hass:{type:Object},inDialog:{type:Boolean,value:!1},stateObj:{type:Object}},activateScene:function(e){e.stopPropagation(),this.hass.callService("scene","turn_on",{entity_id:this.stateObj.entity_id})}});</script><dom-module id="state-card-script" assetpath="state-summary/"><template><style is="custom-style" include="iron-flex iron-flex-alignment"></style><style>paper-button{color:var(--primary-color);font-weight:500;top:3px;height:37px;margin-right:-.57em;}ha-entity-toggle{margin-left:16px;}</style><div class="horizontal justified layout"><state-info state-obj="[[stateObj]]" in-dialog="[[inDialog]]"></state-info><template is="dom-if" if="[[stateObj.attributes.can_cancel]]"><ha-entity-toggle state-obj="[[stateObj]]" hass="[[hass]]"></ha-entity-toggle></template><template is="dom-if" if="[[!stateObj.attributes.can_cancel]]"><paper-button on-tap="fireScript">ACTIVATE</paper-button></template></div></template></dom-module><script>Polymer({is:"state-card-script",properties:{inDialog:{type:Boolean,value:!1},stateObj:{type:Object}},fireScript:function(t){t.stopPropagation(),this.hass.callService("script","turn_on",{entity_id:this.stateObj.entity_id})}});</script><dom-module id="state-card-toggle" assetpath="state-summary/"><template><style is="custom-style" include="iron-flex iron-flex-alignment"></style><style>ha-entity-toggle{margin-left:16px;}</style><div class="horizontal justified layout"><state-info state-obj="[[stateObj]]" in-dialog="[[inDialog]]"></state-info><ha-entity-toggle state-obj="[[stateObj]]" hass="[[hass]]"></ha-entity-toggle></div></template></dom-module><script>Polymer({is:"state-card-toggle",properties:{hass:{type:Object},inDialog:{type:Boolean,value:!1},stateObj:{type:Object}}});</script><dom-module id="state-card-weblink" assetpath="state-summary/"><template><style>:host{display:block;}.name{@apply (--paper-font-common-nowrap);@apply (--paper-font-body1);color:var(--primary-color);text-transform:capitalize;line-height:40px;margin-left:16px;}</style><state-badge state-obj="[[stateObj]]" in-dialog="[[inDialog]]"></state-badge><a href$="[[stateObj.state]]" target="_blank" class="name" id="link">[[computeStateName(stateObj)]]</a></template></dom-module><script>Polymer({is:"state-card-weblink",properties:{inDialog:{type:Boolean,value:!1},stateObj:{type:Object}},listeners:{tap:"onTap"},computeStateName:function(t){return window.hassUtil.computeStateName(t)},onTap:function(t){t.stopPropagation(),t.target!==this.$.link&&window.open(this.stateObj.state,"_blank")}});</script><script>Polymer({is:"state-card-content",properties:{hass:{type:Object},inDialog:{type:Boolean,value:!1},stateObj:{type:Object}},observers:["inputChanged(hass, inDialog, stateObj)"],_ensureCustomUILoaded:function(t){this.importHref("/local/custom_ui/state-card-"+t+".html",function(){},function(){console.error("Error loading %s from /local/custom_ui/state-card-%s.html",t,t)},!0)},inputChanged:function(t,e,s){var a;s&&t&&(s.attributes&&"custom_ui_state_card"in s.attributes?(a=s.attributes.custom_ui_state_card,this._ensureCustomUILoaded(a)):a=window.hassUtil.stateCardType(t,s),window.hassUtil.dynamicContentUpdater(this,"STATE-CARD-"+a.toUpperCase(),{hass:t,stateObj:s,inDialog:e}))}});</script><dom-module id="ha-entities-card" assetpath="cards/"><template><style is="custom-style" include="iron-flex"></style><style>.states{padding-bottom:16px;}.state{padding:4px 16px;cursor:pointer;}.header{@apply (--paper-font-headline);line-height:40px;color:var(--primary-text-color);padding:20px 16px 12px;}.header .name{@apply (--paper-font-common-nowrap);}.header.domain .name{text-transform:capitalize;}ha-entity-toggle{margin-left:16px;}.header-more-info{cursor:pointer;}</style><ha-card><div class$="[[computeTitleClass(groupEntity)]]" on-tap="entityTapped"><div class="flex name">[[computeTitle(states, groupEntity)]]</div><template is="dom-if" if="[[showGroupToggle(groupEntity, states)]]"><ha-entity-toggle hass="[[hass]]" state-obj="[[groupEntity]]"></ha-entity-toggle></template></div><div class="states"><template is="dom-repeat" items="[[states]]"><div class="state" on-tap="entityTapped"><state-card-content hass="[[hass]]" class="state-card" state-obj="[[item]]"></state-card-content></div></template></div></ha-card></template></dom-module><script>Polymer({is:"ha-entities-card",properties:{hass:{type:Object},states:{type:Array},groupEntity:{type:Object}},computeTitle:function(t,e){return e?window.hassUtil.computeStateName(e):window.hassUtil.computeDomain(t[0]).replace(/_/g," ")},computeTitleClass:function(t){var e="header horizontal layout center ";return e+=t?"header-more-info":"domain"},entityTapped:function(t){var e;t.target.classList.contains("paper-toggle-button")||t.target.classList.contains("paper-icon-button")||!t.model&&!this.groupEntity||(t.stopPropagation(),e=t.model?t.model.item.entity_id:this.groupEntity.entity_id,this.fire("hass-more-info",{entityId:e}))},showGroupToggle:function(t,e){var o=this;if(!t||!e||"hidden"===t.attributes.control||"on"!==t.state&&"off"!==t.state)return!1;for(var i=0,n=0;n<e.length&&!(window.hassUtil.canToggleState(o.hass,e[n])&&++i>1);n++);return i>1}});</script><dom-module id="ha-introduction-card" assetpath="cards/"><template><style>:host{@apply (--paper-font-body1);}a{color:var(--dark-primary-color);}ul{margin:8px;padding-left:16px;}li{margin-bottom:8px;}.content{padding:0 16px 16px;}.install{display:block;line-height:1.5em;margin-top:8px;margin-bottom:16px;}</style><ha-card header="Welcome Home!"><div class="content"><template is="dom-if" if="[[hass.demo]]">To install Home Assistant, run:<br><code class="install">pip3 install homeassistant<br>hass --open-ui</code></template>Here are some resources to get you started.<ul><template is="dom-if" if="[[hass.demo]]"><li><a href="https://home-assistant.io/getting-started/">Home Assistant website</a></li><li><a href="https://home-assistant.io/getting-started/">Installation instructions</a></li><li><a href="https://home-assistant.io/getting-started/troubleshooting/">Troubleshooting your installation</a></li></template><li><a href="https://home-assistant.io/getting-started/configuration/" target="_blank">Configuring Home Assistant </a></li><li><a href="https://home-assistant.io/components/" target="_blank">Available components </a></li><li><a href="https://home-assistant.io/getting-started/troubleshooting-configuration/" target="_blank">Troubleshooting your configuration</a></li><li><a href="https://home-assistant.io/help/" target="_blank">Ask the community for help </a></li></ul><template is="dom-if" if="[[showHideInstruction]]">To remove this card, edit your config in <code>configuration.yaml</code> and disable the <code>introduction</code> component.</template></div></ha-card></template></dom-module><script>Polymer({is:"ha-introduction-card",properties:{hass:{type:Object},showHideInstruction:{type:Boolean,value:!0}}});</script><script>!function(){function t(t,e){Object.defineProperty(window.MediaPlayerEntity.prototype,t,{get:e})}window.MediaPlayerEntity=function(t,e){this.hass=t,this.stateObj=e},t("isOff",function(){return"off"===this.stateObj.state}),t("isIdle",function(){return"idle"===this.stateObj.state}),t("isMuted",function(){return this.stateObj.attributes.is_volume_muted}),t("isPaused",function(){return"paused"===this.stateObj.state}),t("isPlaying",function(){return"playing"===this.stateObj.state}),t("isMusic",function(){return"music"===this.stateObj.attributes.media_content_type}),t("isTVShow",function(){return"tvshow"===this.stateObj.attributes.media_content_type}),t("hasMediaControl",function(){return-1!==["playing","paused","unknown"].indexOf(this.stateObj.state)}),t("volumeSliderValue",function(){return 100*this.stateObj.attributes.volume_level}),t("showProgress",function(){return(this.isPlaying||this.isPaused)&&"media_position"in this.stateObj.attributes&&"media_position_updated_at"in this.stateObj.attributes}),t("currentProgress",function(){return this.stateObj.attributes.media_position+(Date.now()-new Date(this.stateObj.attributes.media_position_updated_at))/1e3}),t("supportsPause",function(){return 0!=(1&this.stateObj.attributes.supported_features)}),t("supportsVolumeSet",function(){return 0!=(4&this.stateObj.attributes.supported_features)}),t("supportsVolumeMute",function(){return 0!=(8&this.stateObj.attributes.supported_features)}),t("supportsPreviousTrack",function(){return 0!=(16&this.stateObj.attributes.supported_features)}),t("supportsNextTrack",function(){return 0!=(32&this.stateObj.attributes.supported_features)}),t("supportsTurnOn",function(){return 0!=(128&this.stateObj.attributes.supported_features)}),t("supportsTurnOff",function(){return 0!=(256&this.stateObj.attributes.supported_features)}),t("supportsPlayMedia",function(){return 0!=(512&this.stateObj.attributes.supported_features)}),t("supportsVolumeButtons",function(){return 0!=(1024&this.stateObj.attributes.supported_features)}),t("supportsPlay",function(){return 0!=(16384&this.stateObj.attributes.supported_features)}),t("primaryText",function(){return this.stateObj.attributes.media_title||window.hassUtil.computeStateState(this.stateObj)}),t("secondaryText",function(){if(this.isMusic)return this.stateObj.attributes.media_artist;if(this.isTVShow){var t=this.stateObj.attributes.media_series_title;return this.stateObj.attributes.media_season&&(t+=" S"+this.stateObj.attributes.media_season,this.stateObj.attributes.media_episode&&(t+="E"+this.stateObj.attributes.media_episode)),t}return this.stateObj.attributes.app_name?this.stateObj.attributes.app_name:""}),Object.assign(window.MediaPlayerEntity.prototype,{mediaPlayPause:function(){this.callService("media_play_pause")},nextTrack:function(){this.callService("media_next_track")},playbackControl:function(){this.callService("media_play_pause")},previousTrack:function(){this.callService("media_previous_track")},setVolume:function(t){this.callService("volume_set",{volume_level:t})},togglePower:function(){this.isOff?this.turnOn():this.turnOff()},turnOff:function(){this.callService("turn_off")},turnOn:function(){this.callService("turn_on")},volumeDown:function(){this.callService("volume_down")},volumeMute:function(t){if(!this.supportsVolumeMute)throw new Error("Muting volume not supported");this.callService("volume_mute",{is_volume_muted:t})},volumeUp:function(){this.callService("volume_up")},callService:function(t,e){var s=e||{};s.entity_id=this.stateObj.entity_id,this.hass.callService("media_player",t,s)}})}();</script><dom-module id="ha-media_player-card" assetpath="cards/"><template><style include="paper-material iron-flex iron-flex-alignment iron-positioning">:host{display:block;position:relative;font-size:0px;border-radius:2px;overflow:hidden;}.banner{position:relative;background-color:white;border-top-left-radius:2px;border-top-right-radius:2px;}.banner:before{display:block;content:"";width:100%;padding-top:56%;transition:padding-top .8s;}.banner.no-cover{background-position:center center;background-image:url(/static/images/card_media_player_bg.png);background-repeat:no-repeat;background-color:var(--primary-color);}.banner.content-type-music:before{padding-top:100%;}.banner.no-cover:before{padding-top:88px;}.banner > .cover{position:absolute;top:0;left:0;right:0;bottom:0;border-top-left-radius:2px;border-top-right-radius:2px;background-position:center center;background-size:cover;transition:opacity .8s;opacity:1;}.banner.is-off > .cover{opacity:0;}.banner > .caption{@apply (--paper-font-caption);position:absolute;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, var(--dark-secondary-opacity));padding:8px 16px;font-size:14px;font-weight:500;color:white;transition:background-color .5s;}.banner.is-off > .caption{background-color:initial;}.banner > .caption .title{@apply (--paper-font-common-nowrap);font-size:1.2em;margin:8px 0 4px;}.progress{width:100%;--paper-progress-active-color:var(--accent-color);--paper-progress-container-color:#FFF;}.controls{position:relative;@apply (--paper-font-body1);padding:8px;border-bottom-left-radius:2px;border-bottom-right-radius:2px;background-color:var(--paper-card-background-color, white);}.controls paper-icon-button{width:44px;height:44px;}paper-icon-button{opacity:var(--dark-primary-opacity);}paper-icon-button[disabled]{opacity:var(--dark-disabled-opacity);}paper-icon-button.primary{width:56px !important;height:56px !important;background-color:var(--primary-color);color:white;border-radius:50%;padding:8px;transition:background-color .5s;}paper-icon-button.primary[disabled]{background-color:rgba(0, 0, 0, var(--dark-disabled-opacity));}[invisible]{visibility:hidden !important;}</style><div class$="[[computeBannerClasses(playerObj)]]"><div class="cover" id="cover"></div><div class="caption">[[computeStateName(stateObj)]]<div class="title">[[playerObj.primaryText]]</div>[[playerObj.secondaryText]]<br></div></div><paper-progress max="[[stateObj.attributes.media_duration]]" value="[[playbackPosition]]" hidden$="[[computeHideProgress(playerObj)]]" class="progress"></paper-progress><div class="controls layout horizontal justified"><paper-icon-button icon="mdi:power" on-tap="handleTogglePower" invisible$="[[computeHidePowerButton(playerObj)]]" class="self-center secondary"></paper-icon-button><div><paper-icon-button icon="mdi:skip-previous" invisible$="[[!playerObj.supportsPreviousTrack]]" disabled="[[playerObj.isOff]]" on-tap="handlePrevious"></paper-icon-button><paper-icon-button class="primary" icon="[[computePlaybackControlIcon(playerObj)]]" invisible$="[[!computePlaybackControlIcon(playerObj)]]" disabled="[[playerObj.isOff]]" on-tap="handlePlaybackControl"></paper-icon-button><paper-icon-button icon="mdi:skip-next" invisible$="[[!playerObj.supportsNextTrack]]" disabled="[[playerObj.isOff]]" on-tap="handleNext"></paper-icon-button></div><paper-icon-button icon="mdi:dots-vertical" on-tap="handleOpenMoreInfo" class="self-center secondary"></paper-icon-button></div></template></dom-module><script>Polymer({is:"ha-media_player-card",properties:{hass:{type:Object},stateObj:{type:Object},playerObj:{type:Object,computed:"computePlayerObj(hass, stateObj)",observer:"playerObjChanged"},playbackControlIcon:{type:String,computed:"computePlaybackControlIcon(playerObj)"},playbackPosition:{type:Number},elevation:{type:Number,value:1,reflectToAttribute:!0}},created:function(){this.updatePlaybackPosition=this.updatePlaybackPosition.bind(this)},playerObjChanged:function(t){var e,o=t.stateObj.attributes.entity_picture;o?((e=document.createElement("IMG")).onload=function(){this.$.cover.style.backgroundImage="url("+o+")",e.onerror=e.onload=null,e.src="",e=null}.bind(this),e.onerror=function(){this.$.cover.style.backgroundImage="",this.toggleClass("no-cover",!0,this.$.cover.parentElement),e.onerror=e.onload=null,e.src="",e=null}.bind(this),this._timeout_id&&clearTimeout(this._timeout_id),this._timeout_id=setTimeout(function(){e&&(this.$.cover.style.backgroundImage=""),this._timeout_id=null},5e3),e.src=o):this.$.cover.style.backgroundImage="",t.isPlaying?(this._positionTracking||(this._positionTracking=setInterval(this.updatePlaybackPosition,1e3)),this.updatePlaybackPosition()):this._positionTracking&&(clearInterval(this._positionTracking),this._positionTracking=null,this.playbackPosition=0)},updatePlaybackPosition:function(){this.playbackPosition=this.playerObj.currentProgress},computeBannerClasses:function(t){var e="banner";return t.isOff||t.isIdle?e+=" is-off no-cover":t.stateObj.attributes.entity_picture?"music"===t.stateObj.attributes.media_content_type&&(e+=" content-type-music"):e+=" no-cover",e},computeHideProgress:function(t){return!t.showProgress},computeHidePowerButton:function(t){return t.isOff?!t.supportsTurnOn:!t.supportsTurnOff},computePlayerObj:function(t,e){return new window.MediaPlayerEntity(t,e)},computePlaybackControlIcon:function(t){return t.isPlaying?t.supportsPause?"mdi:pause":"mdi:stop":t.isPaused||t.isOff||t.isIdle?t.supportsPlay?"mdi:play":null:""},computeStateName:function(t){return window.hassUtil.computeStateName(t)},handleNext:function(t){t.stopPropagation(),this.playerObj.nextTrack()},handleOpenMoreInfo:function(t){t.stopPropagation(),this.fire("hass-more-info",{entityId:this.stateObj.entity_id})},handlePlaybackControl:function(t){t.stopPropagation(),this.playerObj.mediaPlayPause()},handlePrevious:function(t){t.stopPropagation(),this.playerObj.previousTrack()},handleTogglePower:function(t){t.stopPropagation(),this.playerObj.togglePower()}});</script><dom-module id="ha-attributes" assetpath="components/"><template><style is="custom-style" include="iron-flex iron-flex-alignment"></style><style>.data-entry .value{max-width:200px;}.attribution{color:var(--secondary-text-color);text-align:right;}</style><div class="layout vertical"><template is="dom-repeat" items="[[computeDisplayAttributes(stateObj, filtersArray)]]" as="attribute"><div class="data-entry layout justified horizontal"><div class="key">[[formatAttribute(attribute)]]</div><div class="value">[[formatAttributeValue(stateObj, attribute)]]</div></div></template><div class="attribution" hidden$="[[!computeAttribution(stateObj)]]">[[computeAttribution(stateObj)]]</div></div></template></dom-module><script>!function(){"use strict";Polymer({is:"ha-attributes",properties:{stateObj:{type:Object},extraFilters:{type:String,value:""},filtersArray:{type:Array,computed:"computeFiltersArray(extraFilters)"}},computeFiltersArray:function(t){return window.hassUtil.LOGIC_STATE_ATTRIBUTES+(t?t.split(","):[])},computeDisplayAttributes:function(t,r){return t?Object.keys(t.attributes).filter(function(t){return-1===r.indexOf(t)}):[]},formatAttribute:function(t){return t.replace(/_/g," ")},formatAttributeValue:function(t,r){var e=t.attributes[r];return Array.isArray(e)?e.join(", "):e instanceof Object?JSON.stringify(e,null,2):e},computeAttribution:function(t){return t.attributes.attribution}})}();</script><dom-module id="ha-weather-card" assetpath="cards/"><template><style>.content{padding:0 16px 16px;}.attribution{color:var(--secondary-text-color);text-align:right;}tr.temphigh span{color:red;font-weight:600;}tr.templow span{color:blue;}tr.date span{color:darkgrey;font-weight:600;}.content td{text-align:center;vertical-align:middle;overflow-x:hidden;}tr.cond td{overflow-x:hidden;overflow-y:visible;text-align:center;vertical-align:middle;width:0%;height:2.4em;}tr.cond td div{font-size:2em;margin-left:-2em;transform:translateX(1em);}.forecast td:first-child{background-color:#ddd;}.forecast td:nth-child(2n+3){background-color:#eee;}table, tr, td{border:0;padding:0;border-spacing:0;}.currentcond{text-align:center;vertical-align:middle;}td.pw_small span{font-size:2.4em;}td.pw_small{width:25%;height:2.6em;}td.pw_smallp span{font-size:1.2em;}td.pw_large span{font-size:6em;}</style><ha-card header="[[computeTitle(stateObj)]]"><div class="content"><table class="currentcond" width="100%"><tbody><tr><td class="pw_small"><span>[[stateObj.attributes.temperature]]°</span></td><td rowspan="2" class="pw_large"><span>[[nowCond]]</span></td><td class="pw_small"><span>[[stateObj.attributes.humidity]]%</span></td></tr><tr><td class="pw_smallp"><span>[[windBearing]]<br>[[stateObj.attributes.wind_speed]]</span></td><td class="pw_smallp"><span>Visual<br>[[stateObj.attributes.visibility]]</span></td></tr></tbody></table><br><table class="forecast" width="100%"><tbody><tr class="cond"><template is="dom-repeat" items="[[data.cond]]"><td><div>[[item]]</div></td></template></tr><tr class="temphigh"><template is="dom-repeat" items="[[data.temphigh]]"><td><span>[[item]]</span></td></template></tr><tr class="templow"><template is="dom-repeat" items="[[data.templow]]"><td><span>[[item]]</span></td></template></tr><tr class="date"><template is="dom-repeat" items="[[data.date]]"><td><span>[[item]]</span></td></template></tr></tbody></table></div></ha-card></template></dom-module><script>!function(){"use strict";var t={cloudy:"🌫",fog:"🌫",hail:"Hail",lightning:"🌩","lightning-rainy":"⛈",partlycloudy:"⛅",pouring:"🌢",rainy:"🌧",snowy:"🌨","snowy-rainy":"SR",sunny:"☀",windy:"🌬","windy-variant":"[]",exceptional:"!!"},e=["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW","N"];Polymer({is:"ha-weather-card",properties:{hass:{type:Object},stateObj:{type:Object,observer:"checkRequirements"}},computeTitle:function(t){return t.attributes.friendly_name},getDataArray:function(){var e,i=this.stateObj.attributes.forecast;if(!this.stateObj.attributes.forecast)return[];var a=[],n=[],r=[],s=[];for(e=0;e<i.length;e++)a.push(new Date(i[e].datetime).getDate()),n.push(i[e].temperature),r.push(i[e].templow),s.push(t[i[e].condition]);return{date:a,cond:s,temphigh:n,templow:r}},checkRequirements:function(){this.stateObj&&this.stateObj.attributes&&this.stateObj.attributes.forecast&&(this.nowCond=t[this.stateObj.state],this.windBearing=this.windBearingToText(this.stateObj.attributes.windBearing),this.data=this.getDataArray())},windBearingToText:function(t){return e[(parseInt(t)+5.63)/11.25|0]}})}();</script><dom-module id="ha-persistent_notification-card" assetpath="cards/"><template><style>:host{@apply (--paper-font-body1);}.content{padding:0 16px 16px;-ms-user-select:initial;-webkit-user-select:initial;-moz-user-select:initial;}paper-button{margin:8px;font-weight:500;}</style><ha-card header="[[computeTitle(stateObj)]]"><div id="pnContent" class="content"></div><paper-button on-tap="dismissTap">DISMISS</paper-button></ha-card></template></dom-module><script>Polymer({is:"ha-persistent_notification-card",properties:{hass:{type:Object},stateObj:{type:Object},scriptLoaded:{type:Boolean,value:!1}},observers:["computeContent(stateObj, scriptLoaded)"],computeTitle:function(t){return t.attributes.title||window.hassUtil.computeStateName(t)},loadScript:function(){var t=function(){this.scriptLoaded=!0}.bind(this);this.importHref("/static/micromarkdown-js.html",t,function(){console.error("Micromarkdown was not loaded.")})},computeContent:function(t,e){var i="",o="";e&&(i=this.$.pnContent,o=window.micromarkdown.parse(t.state),i.innerHTML=o)},ready:function(){this.loadScript()},dismissTap:function(t){t.preventDefault(),this.hass.callApi("DELETE","states/"+this.stateObj.entity_id)}});</script><script>Polymer({is:"ha-card-chooser",properties:{cardData:{type:Object,observer:"cardDataChanged"}},cardDataChanged:function(a){a&&window.hassUtil.dynamicContentUpdater(this,"HA-"+a.cardType.toUpperCase()+"-CARD",a)}});</script><dom-module id="ha-cards" assetpath="components/"><template><style is="custom-style" include="iron-flex iron-flex-factors"></style><style>:host{display:block;padding-top:8px;padding-right:8px;}.badges{font-size:85%;text-align:center;}.column{max-width:500px;overflow-x:hidden;}.zone-card{margin-left:8px;margin-bottom:8px;}@media (max-width: 500px){:host{padding-right:0;}.zone-card{margin-left:0;}}@media (max-width: 599px){.column{max-width:600px;}}</style><div class="main"><template is="dom-if" if="[[cards.badges]]"><div class="badges"><template is="dom-if" if="[[cards.demo]]"><ha-demo-badge></ha-demo-badge></template><ha-badges-card states="[[cards.badges]]" hass="[[hass]]"></ha-badges-card></div></template><div class="horizontal layout center-justified"><template is="dom-repeat" items="[[cards.columns]]" as="column"><div class="column flex-1"><template is="dom-repeat" items="[[column]]" as="card"><div class="zone-card"><ha-card-chooser card-data="[[card]]" hass="[[hass]]"></ha-card-chooser></div></template></div></template></div></div></template></dom-module><script>!function(){"use strict";function t(t){return t in o?o[t]:100}function e(t,e){return t.priority-e.priority}function n(t,e){var n=(t.attributes.friendly_name||t.entity_id).toLowerCase(),s=(e.attributes.friendly_name||e.entity_id).toLowerCase();return n<s?-1:n>s?1:0}function s(t,s){Object.keys(t).map(function(e){return t[e]}).sort(e).forEach(function(t){t.states.sort(n),s(t)})}var i={camera:4,media_player:3,persistent_notification:0,weather:4},o={configurator:-20,persistent_notification:-15,updater:0,sun:1,device_tracker:2,alarm_control_panel:3,sensor:5,binary_sensor:6},r=window.hassUtil.computeDomain;Polymer({is:"ha-cards",properties:{hass:{type:Object},showIntroduction:{type:Boolean,value:!1},columns:{type:Number,value:2},states:{type:Object},panelVisible:{type:Boolean},viewVisible:{type:Boolean,value:!1},cards:{type:Object}},observers:["updateCards(columns, states, showIntroduction, panelVisible, viewVisible)"],updateCards:function(t,e,n,s,i){s&&i&&this.debounce("updateCards",function(){this.panelVisible&&this.viewVisible&&(this.cards=this.computeCards(t,e,n))}.bind(this),10)},computeCards:function(e,n,o){function a(t){var e=0;for(c=0;c<l.length;c++){if(l[c]<5){e=c;break}l[c]<l[e]&&(e=c)}return l[e]+=t,e}function u(t,e,n){var s,o,u,c;0!==e.length&&(s=[],o=[],u=0,e.forEach(function(t){var e=r(t);e in i?(s.push(t),u+=i[e]):(o.push(t),u++)}),u+=o.length>0,c=a(u),o.length>0&&d.columns[c].push({hass:p,cardType:"entities",states:o,groupEntity:n||!1}),s.forEach(function(t){d.columns[c].push({hass:p,cardType:r(t),stateObj:t})}))}var c,p=this.hass,d={demo:!1,badges:[],columns:[]},l=[];for(c=0;c<e;c++)d.columns.push([]),l.push(0);o&&d.columns[a(5)].push({hass:p,cardType:"introduction",showHideInstruction:n.size>0&&!window.HASS_DEMO});var h=window.HAWS.splitByGroups(n),f={},m={},y={};return Object.keys(h.ungrouped).forEach(function(e){var n=h.ungrouped[e],s=r(n);if("a"!==s){var i,o=t(s);s in(i=o<0?m:o<10?f:y)||(i[s]={domain:s,priority:o,states:[]}),i[s].states.push(n)}else d.demo=!0}),s(f,function(t){d.badges.push.apply(d.badges,t.states)}),s(m,function(t){u(t.domain,t.states)}),h.groups.forEach(function(t){var e=window.HAWS.getGroupEntities(n,t);u(t.entity_id,Object.keys(e).map(function(t){return e[t]}),t)}),s(y,function(t){u(t.domain,t.states)}),d.columns=d.columns.filter(function(t){return t.length>0}),d}})}();</script><dom-module id="partial-cards" assetpath="layouts/"><template><style include="iron-flex iron-positioning ha-style">:host{-ms-user-select:none;-webkit-user-select:none;-moz-user-select:none;}app-header-layout{background-color:var(--secondary-background-color, #E5E5E5);}paper-tabs{margin-left:12px;--paper-tabs-selection-bar-color:#FFF;text-transform:uppercase;}</style><app-route route="{{route}}" pattern="/:view" data="{{routeData}}" active="{{routeMatch}}"></app-route><app-header-layout has-scrolling-region="" id="layout"><app-header effects="waterfall" condenses="" fixed="" slot="header"><app-toolbar><ha-menu-button narrow="[[narrow]]" show-menu="[[showMenu]]"></ha-menu-button><div main-title="">[[computeTitle(views, locationName)]]</div><ha-start-voice-button hass="[[hass]]"></ha-start-voice-button></app-toolbar><div sticky="" hidden$="[[areTabsHidden(views, showTabs)]]"><paper-tabs scrollable="" selected="[[currentView]]" attr-for-selected="data-entity" on-iron-activate="handleViewSelected"><paper-tab data-entity="" on-tap="scrollToTop"><template is="dom-if" if="[[!defaultView]]">[[locationName]]</template><template is="dom-if" if="[[defaultView]]"><template is="dom-if" if="[[defaultView.attributes.icon]]"><iron-icon title$="[[computeStateName(defaultView)]]" icon="[[defaultView.attributes.icon]]"></iron-icon></template><template is="dom-if" if="[[!defaultView.attributes.icon]]">[[computeStateName(defaultView)]]</template></template></paper-tab><template is="dom-repeat" items="[[views]]"><paper-tab data-entity$="[[item.entity_id]]" on-tap="scrollToTop"><template is="dom-if" if="[[item.attributes.icon]]"><iron-icon title$="[[computeStateName(item)]]" icon="[[item.attributes.icon]]"></iron-icon></template><template is="dom-if" if="[[!item.attributes.icon]]">[[computeStateName(item)]]</template></paper-tab></template></paper-tabs></div></app-header><iron-pages attr-for-selected="data-view" selected="[[currentView]]" selected-attribute="view-visible"><ha-cards data-view="" show-introduction="[[computeShowIntroduction(currentView, introductionLoaded, viewStates)]]" states="[[viewStates]]" columns="[[_columns]]" hass="[[hass]]" panel-visible="[[panelVisible]]"></ha-cards><template is="dom-repeat" items="[[views]]"><ha-cards data-view$="[[item.entity_id]]" states="[[viewStates]]" columns="[[_columns]]" hass="[[hass]]" panel-visible="[[panelVisible]]"></ha-cards></template></iron-pages></app-header-layout></template></dom-module><script>Polymer({DEFAULT_VIEW_ENTITY_ID:"group.default_view",ALWAYS_SHOW_DOMAIN:["persistent_notification","configurator"],is:"partial-cards",properties:{hass:{type:Object,value:null,observer:"hassChanged"},narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,observer:"handleWindowChange"},panelVisible:{type:Boolean,value:!1},route:Object,routeData:Object,routeMatch:Boolean,_columns:{type:Number,value:1},introductionLoaded:{type:Boolean,computed:"computeIntroductionLoaded(hass)"},locationName:{type:String,value:"",computed:"computeLocationName(hass)"},currentView:{type:String,computed:"_computeCurrentView(routeMatch, routeData)"},views:{type:Array},defaultView:{type:Object},viewStates:{type:Object,computed:"computeViewStates(currentView, hass, defaultView)"},showTabs:{type:Boolean,value:!1}},created:function(){this.handleWindowChange=this.handleWindowChange.bind(this),this.mqls=[300,600,900,1200].map(function(t){var e=window.matchMedia("(min-width: "+t+"px)");return e.addListener(this.handleWindowChange),e}.bind(this))},detached:function(){this.mqls.forEach(function(t){t.removeListener(this.handleWindowChange)})},handleWindowChange:function(){var t=this.mqls.reduce(function(t,e){return t+e.matches},0);this._columns=Math.max(1,t-(!this.narrow&&this.showMenu))},areTabsHidden:function(t,e){return!t.length||!e},scrollToTop:function(){var t=this.$.layout.header.scrollTarget,e=function(t,e,n,i){return t/=i,-n*t*(t-2)+e},n=Math.random(),i=Date.now(),a=t.scrollTop,o=0-a;this._currentAnimationId=n,function s(){var r=Date.now()-i;r>200?t.scrollTop=0:this._currentAnimationId===n&&(t.scrollTop=e(r,a,o,200),requestAnimationFrame(s.bind(this)))}.call(this)},handleViewSelected:function(t){var e=t.detail.item.getAttribute("data-entity")||null;if(e!==this.currentView){var n="/states";e&&(n+="/"+e),history.pushState(null,null,n),this.fire("location-changed")}},_computeCurrentView:function(t,e){return t?e.view:""},computeTitle:function(t,e){return t&&t.length>0?"Home Assistant":e},computeShowIntroduction:function(t,e,n){return""===t&&(e||0===n.size)},computeStateName:function(t){return t.entity_id===this.DEFAULT_VIEW_ENTITY_ID?t.attributes.friendly_name&&"default_view"!==t.attributes.friendly_name?t.attributes.friendly_name:this.computeLocationName(this.hass):window.hassUtil.computeStateName(t)},computeLocationName:function(t){return window.hassUtil.computeLocationName(t)},computeIntroductionLoaded:function(t){return window.hassUtil.isComponentLoaded(t,"introduction")},hassChanged:function(t){if(t){var e=window.HAWS.extractViews(t.states);e.length>0&&e[0].entity_id===this.DEFAULT_VIEW_ENTITY_ID?this.defaultView=e.shift():this.defaultView=null,this.views=e}},computeViewStates:function(t,e,n){var i,a,o,s,r=this,u=Object.keys(e.states);if(!t&&!n){for(s={},i=0;i<u.length;i++)a=u[i],(o=e.states[a]).attributes.hidden||(s[a]=o);return s}for(s=t?window.HAWS.getViewEntities(e.states,e.states[t]):window.HAWS.getViewEntities(e.states,e.states[this.DEFAULT_VIEW_ENTITY_ID]),i=0;i<u.length;i++)a=u[i],o=e.states[a],-1!==r.ALWAYS_SHOW_DOMAIN.indexOf(window.hassUtil.computeDomain(o))&&(s[a]=o);return s}});</script><dom-module id="hass-loading-screen" assetpath="layouts/"><template><style include="iron-flex ha-style">.placeholder{height:100%;}.layout{height:calc(100% - 64px);}</style><div class="placeholder"><app-toolbar><ha-menu-button narrow="[[narrow]]" show-menu="[[showMenu]]"></ha-menu-button><div main-title="">[[title]]</div></app-toolbar><div class="layout horizontal center-center"><paper-spinner active=""></paper-spinner></div></div></template></dom-module><script>Polymer({is:"hass-loading-screen",properties:{narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,value:!1},title:{type:String,value:""}}});</script><dom-module id="partial-panel-resolver" assetpath="layouts/"><template><style>[hidden]{display:none !important;}</style><app-route route="{{route}}" pattern="/:panel" data="{{routeData}}" tail="{{routeTail}}"></app-route><template is="dom-if" if="[[!resolved]]"><hass-loading-screen narrow="[[narrow]]" show-menu="[[showMenu]]"></hass-loading-screen></template><span id="panel" hidden$="[[!resolved]]"></span></template></dom-module><script>Polymer({is:"partial-panel-resolver",properties:{hass:{type:Object,observer:"updateAttributes"},narrow:{type:Boolean,value:!1,observer:"updateAttributes"},showMenu:{type:Boolean,value:!1,observer:"updateAttributes"},route:Object,routeData:Object,routeTail:{type:Object,observer:"updateAttributes"},resolved:{type:Boolean,value:!1},errorLoading:{type:Boolean,value:!1},panel:{type:Object,computed:"computeCurrentPanel(hass, routeData)",observer:"panelChanged"}},computeCurrentPanel:function(e,t){return t?e.config.panels[t.panel]:null},panelChanged:function(e){e?(this.resolved=!1,this.errorLoading=!1,this.importHref(e.url,function(){window.hassUtil.dynamicContentUpdater(this.$.panel,"ha-panel-"+e.component_name,{hass:this.hass,narrow:this.narrow,showMenu:this.showMenu,route:this.routeTail,panel:e}),this.resolved=!0}.bind(this),function(){this.errorLoading=!0}.bind(this),!0)):this.$.panel.lastChild&&this.$.panel.removeChild(this.$.panel.lastChild)},updateAttributes:function(){var e=Polymer.dom(this.$.panel).lastChild;e&&(e.hass=this.hass,e.narrow=this.narrow,e.showMenu=this.showMenu,e.route=this.routeTail)}});</script><script>!function(){"use strict";Polymer.PaperDialogBehaviorImpl={hostAttributes:{role:"dialog",tabindex:"-1"},properties:{modal:{type:Boolean,value:!1},__readied:{type:Boolean,value:!1}},observers:["_modalChanged(modal, __readied)"],listeners:{tap:"_onDialogClick"},ready:function(){this.__prevNoCancelOnOutsideClick=this.noCancelOnOutsideClick,this.__prevNoCancelOnEscKey=this.noCancelOnEscKey,this.__prevWithBackdrop=this.withBackdrop,this.__readied=!0},_modalChanged:function(i,e){e&&(i?(this.__prevNoCancelOnOutsideClick=this.noCancelOnOutsideClick,this.__prevNoCancelOnEscKey=this.noCancelOnEscKey,this.__prevWithBackdrop=this.withBackdrop,this.noCancelOnOutsideClick=!0,this.noCancelOnEscKey=!0,this.withBackdrop=!0):(this.noCancelOnOutsideClick=this.noCancelOnOutsideClick&&this.__prevNoCancelOnOutsideClick,this.noCancelOnEscKey=this.noCancelOnEscKey&&this.__prevNoCancelOnEscKey,this.withBackdrop=this.withBackdrop&&this.__prevWithBackdrop))},_updateClosingReasonConfirmed:function(i){this.closingReason=this.closingReason||{},this.closingReason.confirmed=i},_onDialogClick:function(i){for(var e=this,o=Polymer.dom(i).path,t=0,n=o.indexOf(this);t<n;t++){var a=o[t];if(a.hasAttribute&&(a.hasAttribute("dialog-dismiss")||a.hasAttribute("dialog-confirm"))){e._updateClosingReasonConfirmed(a.hasAttribute("dialog-confirm")),e.close(),i.stopPropagation();break}}}},Polymer.PaperDialogBehavior=[Polymer.IronOverlayBehavior,Polymer.PaperDialogBehaviorImpl]}();</script><dom-module id="paper-dialog-shared-styles" assetpath="../bower_components/paper-dialog-behavior/"><template><style>:host{display:block;margin:24px 40px;background:var(--paper-dialog-background-color, var(--primary-background-color));color:var(--paper-dialog-color, var(--primary-text-color));@apply --paper-font-body1;@apply --shadow-elevation-16dp;@apply --paper-dialog;}:host > ::slotted(*){margin-top:20px;padding:0 24px;}:host > ::slotted(.no-padding){padding:0;}:host > ::slotted(h2){position:relative;margin:0;@apply --paper-font-title;@apply --paper-dialog-title;}:host > ::slotted(*:first-child){margin-top:24px;}:host > ::slotted(*:last-child){margin-bottom:24px;}:host > ::slotted(.buttons){position:relative;padding:8px 8px 8px 24px;margin:0;color:var(--paper-dialog-button-color, var(--primary-color));@apply --layout-horizontal;@apply --layout-end-justified;}</style></template></dom-module><dom-module id="paper-dialog" assetpath="../bower_components/paper-dialog/"><template><style include="paper-dialog-shared-styles"></style><slot></slot></template></dom-module><script>!function(){"use strict";Polymer({is:"paper-dialog",behaviors:[Polymer.PaperDialogBehavior,Polymer.NeonAnimationRunnerBehavior],listeners:{"neon-animation-finish":"_onNeonAnimationFinish"},_renderOpened:function(){this.cancelAnimation(),this.playAnimation("entry")},_renderClosed:function(){this.cancelAnimation(),this.playAnimation("exit")},_onNeonAnimationFinish:function(){this.opened?this._finishRenderOpened():this._finishRenderClosed()}})}();</script><dom-module id="paper-dialog-scrollable" assetpath="../bower_components/paper-dialog-scrollable/"><template><style>:host{display:block;@apply --layout-relative;}:host(.is-scrolled:not(:first-child))::before{content:'';position:absolute;top:0;left:0;right:0;height:1px;background:var(--divider-color);}:host(.can-scroll:not(.scrolled-to-bottom):not(:last-child))::after{content:'';position:absolute;bottom:0;left:0;right:0;height:1px;background:var(--divider-color);}.scrollable{padding:0 24px;@apply --layout-scroll;@apply --paper-dialog-scrollable;}.fit{@apply --layout-fit;}</style><div id="scrollable" class="scrollable" on-scroll="updateScrollState"><slot></slot></div></template></dom-module><script>Polymer({is:"paper-dialog-scrollable",properties:{dialogElement:{type:Object}},get scrollTarget(){return this.$.scrollable},ready:function(){this._ensureTarget(),this.classList.add("no-padding")},attached:function(){this._ensureTarget(),requestAnimationFrame(this.updateScrollState.bind(this))},updateScrollState:function(){this.toggleClass("is-scrolled",this.scrollTarget.scrollTop>0),this.toggleClass("can-scroll",this.scrollTarget.offsetHeight<this.scrollTarget.scrollHeight),this.toggleClass("scrolled-to-bottom",this.scrollTarget.scrollTop+this.scrollTarget.offsetHeight>=this.scrollTarget.scrollHeight)},_ensureTarget:function(){this.dialogElement=this.dialogElement||this.parentElement,this.dialogElement&&this.dialogElement.behaviors&&this.dialogElement.behaviors.indexOf(Polymer.PaperDialogBehaviorImpl)>=0?(this.dialogElement.sizingTarget=this.scrollTarget,this.scrollTarget.classList.remove("fit")):this.dialogElement&&this.scrollTarget.classList.add("fit")}});</script><script>!function(){"use strict";Polymer.IronJsonpLibraryBehavior={properties:{libraryLoaded:{type:Boolean,value:!1,notify:!0,readOnly:!0},libraryErrorMessage:{type:String,value:null,notify:!0,readOnly:!0}},observers:["_libraryUrlChanged(libraryUrl)"],_libraryUrlChanged:function(r){this._isReady&&this.libraryUrl&&this._loadLibrary()},_libraryLoadCallback:function(r,i){r?(Polymer.Base._warn("Library load failed:",r.message),this._setLibraryErrorMessage(r.message)):(this._setLibraryErrorMessage(null),this._setLibraryLoaded(!0),this.notifyEvent&&this.fire(this.notifyEvent,i))},_loadLibrary:function(){r.require(this.libraryUrl,this._libraryLoadCallback.bind(this),this.callbackName)},ready:function(){this._isReady=!0,this.libraryUrl&&this._loadLibrary()}};var r={apiMap:{},require:function(r,t,e){var a=this.nameFromUrl(r);this.apiMap[a]||(this.apiMap[a]=new i(a,r,e)),this.apiMap[a].requestNotify(t)},nameFromUrl:function(r){return r.replace(/[\:\/\%\?\&\.\=\-\,]/g,"_")+"_api"}},i=function(r,i,t){if(this.notifiers=[],!t){if(!(i.indexOf(this.callbackMacro)>=0))return void(this.error=new Error("IronJsonpLibraryBehavior a %%callback%% parameter is required in libraryUrl"));t=r+"_loaded",i=i.replace(this.callbackMacro,t)}this.callbackName=t,window[this.callbackName]=this.success.bind(this),this.addScript(i)};i.prototype={callbackMacro:"%%callback%%",loaded:!1,addScript:function(r){var i=document.createElement("script");i.src=r,i.onerror=this.handleError.bind(this);var t=document.querySelector("script")||document.body;t.parentNode.insertBefore(i,t),this.script=i},removeScript:function(){this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.script=null},handleError:function(r){this.error=new Error("Library failed to load"),this.notifyAll(),this.cleanup()},success:function(){this.loaded=!0,this.result=Array.prototype.slice.call(arguments),this.notifyAll(),this.cleanup()},cleanup:function(){delete window[this.callbackName]},notifyAll:function(){this.notifiers.forEach(function(r){r(this.error,this.result)}.bind(this)),this.notifiers=[]},requestNotify:function(r){this.loaded||this.error?r(this.error,this.result):this.notifiers.push(r)}}}();</script><script>Polymer({is:"iron-jsonp-library",behaviors:[Polymer.IronJsonpLibraryBehavior],properties:{libraryUrl:String,callbackName:String,notifyEvent:String}});</script><script>Polymer({is:"google-legacy-loader",behaviors:[Polymer.IronJsonpLibraryBehavior],properties:{libraryUrl:{type:String,value:"https://www.google.com/jsapi?callback=%%callback%%"},notifyEvent:{type:String,value:"api-load"}},get api(){return google}});</script><style>div.charts-tooltip{z-index:200 !important;}</style><script>Polymer({is:"state-history-chart-timeline",properties:{data:{type:Object,observer:"dataChanged"},isAttached:{type:Boolean,value:!1,observer:"dataChanged"}},created:function(){this.style.display="block"},attached:function(){this.isAttached=!0},dataChanged:function(){this.drawChart()},drawChart:function(){function t(t,e,n,d){var i=e.replace(/_/g," ");a.addRow([t,i,n,d])}var e,a,n,d,i,o,l,h=Polymer.dom(this),s=this.data;if(this.isAttached){for(;h.node.lastChild;)h.node.removeChild(h.node.lastChild);s&&0!==s.length&&(e=new window.google.visualization.Timeline(this),(a=new window.google.visualization.DataTable).addColumn({type:"string",id:"Entity"}),a.addColumn({type:"string",id:"State"}),a.addColumn({type:"date",id:"Start"}),a.addColumn({type:"date",id:"End"}),n=new Date(s.reduce(function(t,e){return Math.min(t,new Date(e[0].last_changed))},new Date)),(d=new Date(s.reduce(function(t,e){return Math.max(t,new Date(e[e.length-1].last_changed))},n)))>new Date&&(d=new Date),o="H:mm",(l=(d-n)/864e5)>30.1?o="MMM d":l>3.1?o="EEE, MMM d":l>1.1&&(o="EEE, MMM d, H:mm"),i=0,s.forEach(function(e){var a,n,o=null,l=null;0!==e.length&&(a=window.hassUtil.computeStateName(e[0]),e.forEach(function(e){new Date(e.last_changed)>d||(null!==o&&e.state!==o?(n=new Date(e.last_changed),t(a,o,l,n),o=e.state,l=n):null===o&&(o=e.state,l=new Date(e.last_changed)))}),t(a,o,l,d),i++)}),e.draw(a,{backgroundColor:"#fafafa",height:55+42*i,timeline:{showRowLabels:s.length>1},hAxis:{format:o}}))}}});</script><script>!function(){"use strict";function t(t,e){var a,n=[];for(a=t;a<e;a++)n.push(a);return n}function e(t){var e=parseFloat(t);return!isNaN(e)&&isFinite(e)?e:null}Polymer({is:"state-history-chart-line",properties:{data:{type:Object,observer:"dataChanged"},unit:{type:String},isSingleDevice:{type:Boolean,value:!1},isAttached:{type:Boolean,value:!1,observer:"dataChanged"},chartEngine:{type:Object}},created:function(){this.style.display="block"},attached:function(){this.isAttached=!0},dataChanged:function(){this.drawChart()},drawChart:function(){var a,n,r,i,o,u,s=this.unit,l=this.data;this.isAttached&&(this.chartEngine||(this.chartEngine=new window.google.visualization.LineChart(this)),0!==l.length&&(a={backgroundColor:"#fafafa",legend:{position:"top"},interpolateNulls:!0,titlePosition:"none",vAxes:{0:{title:s}},hAxis:{format:"H:mm"},chartArea:{left:"60",width:"95%"},explorer:{actions:["dragToZoom","rightClickToReset","dragToPan"],keepInBounds:!0,axis:"horizontal",maxZoomIn:.1}},this.isSingleDevice&&(a.legend.position="none",a.vAxes[0].title=null,a.chartArea.left=40,a.chartArea.height="80%",a.chartArea.top=5),n=new Date(Math.min.apply(null,l.map(function(t){return new Date(t[0].last_changed)}))),(r=new Date(Math.max.apply(null,l.map(function(t){return new Date(t[t.length-1].last_changed)}))))>new Date&&(r=new Date),(u=(r-n)/864e5)>30.1?a.hAxis.format="MMM d":u>3.1?a.hAxis.format="EEE, MMM d":u>1.1&&(a.hAxis.format="EEE, MMM d, H:mm"),o=1===(i=l.map(function(t){function a(t,e){var a=t[0];a>r||(n&&e&&c.push([a].concat(n.slice(1).map(function(t,a){return e[a]?t:null}))),c.push(t),n=t)}var n,i,o,u,s=t[t.length-1],l=window.hassUtil.computeDomain(s),h=window.hassUtil.computeStateName(s),c=[],d=new window.google.visualization.DataTable;return d.addColumn({type:"datetime",id:"Time"}),"thermostat"===l||"climate"===l?(i=t.reduce(function(t,e){return t||e.attributes.target_temp_high!==e.attributes.target_temp_low},!1),d.addColumn("number",h+" current temperature"),i?(d.addColumn("number",h+" target temperature high"),d.addColumn("number",h+" target temperature low"),u=[!1,!0,!0],o=function(t){var n=e(t.attributes.current_temperature),r=e(t.attributes.target_temp_high),i=e(t.attributes.target_temp_low);a([new Date(t.last_updated),n,r,i],u)}):(d.addColumn("number",h+" target temperature"),u=[!1,!0],o=function(t){var n=e(t.attributes.current_temperature),r=e(t.attributes.temperature);a([new Date(t.last_updated),n,r],u)}),t.forEach(o)):(d.addColumn("number",h),u="sensor"!==l&&[!0],t.forEach(function(t){var n=e(t.state);a([new Date(t.last_changed),n],u)})),a([r].concat(n.slice(1)),!1),d.addRows(c),d})).length?i[0]:i.slice(1).reduce(function(e,a){return window.google.visualization.data.join(e,a,"full",[[0,0]],t(1,e.getNumberOfColumns()),t(1,a.getNumberOfColumns()))},i[0]),this.chartEngine.draw(o,a)))}})}();</script><dom-module id="state-history-charts" assetpath="components/"><template><link href="https://ajax.googleapis.com/ajax/static/modules/gviz/1.0/core/tooltip.css" rel="stylesheet" type="text/css"><style>:host{display:block;}.loading-container{text-align:center;padding:8px;}.loading{height:0px;overflow:hidden;}</style><google-legacy-loader on-api-load="_googleApiLoaded"></google-legacy-loader><template is="dom-if" if="[[_isLoading]]"><div class="loading-container"><paper-spinner active="" alt="Updating history data"></paper-spinner></div></template><template is="dom-if" if="[[!_isLoading]]"><template is="dom-if" if="[[_computeIsEmpty(historyData)]]">No state history found.</template><state-history-chart-timeline data="[[historyData.timeline]]"></state-history-chart-timeline><template is="dom-repeat" items="[[historyData.line]]"><state-history-chart-line unit="[[item.unit]]" data="[[item.data]]" is-single-device="[[_computeIsSingleLineChart(historyData)]]"></state-history-chart-line></template></template></template></dom-module><script>Polymer({is:"state-history-charts",properties:{historyData:{type:Object,value:null},isLoadingData:{type:Boolean,value:!0},_apiLoaded:{type:Boolean,value:!1},_isLoading:{type:Boolean,computed:"_computeIsLoading(isLoadingData, _apiLoaded)"}},_computeIsSingleLineChart:function(e){return e&&1===e.line.length},_googleApiLoaded:function(){window.google.load("visualization","1",{packages:["timeline","corechart"],callback:function(){this._apiLoaded=!0}.bind(this)})},_computeIsLoading:function(e,t){return e||!t},_computeIsEmpty:function(e){return e&&0===e.timeline.length&&0===e.line.length}});</script><dom-module id="more-info-alarm_control_panel" assetpath="more-infos/"><template><style is="custom-style" include="iron-flex"></style><div class="layout horizontal"><paper-input label="code" value="{{enteredCode}}" pattern="[[codeFormat]]" type="password" hidden$="[[!codeInputVisible]]" disabled="[[!codeInputEnabled]]"></paper-input></div><div class="layout horizontal"><paper-button on-tap="handleDisarmTap" hidden$="[[!disarmButtonVisible]]" disabled="[[!codeValid]]">Disarm</paper-button><paper-button on-tap="handleHomeTap" hidden$="[[!armHomeButtonVisible]]" disabled="[[!codeValid]]">Arm Home</paper-button><paper-button on-tap="handleAwayTap" hidden$="[[!armAwayButtonVisible]]" disabled="[[!codeValid]]">Arm Away</paper-button></div></template></dom-module><script>Polymer({is:"more-info-alarm_control_panel",properties:{hass:{type:Object},stateObj:{type:Object,observer:"stateObjChanged"},enteredCode:{type:String,value:""},disarmButtonVisible:{type:Boolean,value:!1},armHomeButtonVisible:{type:Boolean,value:!1},armAwayButtonVisible:{type:Boolean,value:!1},codeInputVisible:{type:Boolean,value:!1},codeInputEnabled:{type:Boolean,value:!1},codeFormat:{type:String,value:""},codeValid:{type:Boolean,computed:"validateCode(enteredCode, codeFormat)"}},validateCode:function(e,t){var a=new RegExp(t);return null===t||a.test(e)},stateObjChanged:function(e,t){e&&(this.codeFormat=e.attributes.code_format,this.codeInputVisible=null!==this.codeFormat,this.codeInputEnabled="armed_home"===e.state||"armed_away"===e.state||"disarmed"===e.state||"pending"===e.state||"triggered"===e.state,this.disarmButtonVisible="armed_home"===e.state||"armed_away"===e.state||"pending"===e.state||"triggered"===e.state,this.armHomeButtonVisible="disarmed"===e.state,this.armAwayButtonVisible="disarmed"===e.state),t&&this.async(function(){this.fire("iron-resize")}.bind(this),500)},handleDisarmTap:function(){this.callService("alarm_disarm",{code:this.enteredCode})},handleHomeTap:function(){this.callService("alarm_arm_home",{code:this.enteredCode})},handleAwayTap:function(){this.callService("alarm_arm_away",{code:this.enteredCode})},callService:function(e,t){var a=t||{};a.entity_id=this.stateObj.entity_id,this.hass.callService("alarm_control_panel",e,a).then(function(){this.enteredCode=""}.bind(this))}});</script><dom-module id="more-info-automation" assetpath="more-infos/"><template><style>paper-button{color:var(--primary-color);font-weight:500;top:3px;height:37px;}</style><p>Last triggered:<ha-relative-time datetime="[[stateObj.attributes.last_triggered]]"></ha-relative-time></p><paper-button on-tap="handleTriggerTapped">TRIGGER</paper-button></template></dom-module><script>Polymer({is:"more-info-automation",properties:{hass:{type:Object},stateObj:{type:Object}},handleTriggerTapped:function(){this.hass.callService("automation","trigger",{entity_id:this.stateObj.entity_id})}});</script><dom-module id="more-info-camera" assetpath="more-infos/"><template><style>:host{max-width:640px;}.camera-image{width:100%;}</style><img class="camera-image" src="[[computeCameraImageUrl(hass, stateObj, isVisible)]]" on-load="imageLoaded" alt="[[computeStateName(stateObj)]]"></template></dom-module><script>Polymer({is:"more-info-camera",properties:{hass:{type:Object},stateObj:{type:Object},isVisible:{type:Boolean,value:!0}},imageLoaded:function(){this.fire("iron-resize")},computeStateName:function(e){return window.hassUtil.computeStateName(e)},computeCameraImageUrl:function(e,t,a){return e.demo?"/demo/webcam.jpg":t&&a?"/api/camera_proxy_stream/"+t.entity_id+"?token="+t.attributes.access_token:"data:image/gif;base64,R0lGODlhAQABAAAAACw="}});</script><dom-module id="ha-climate-control" assetpath="components/"><template><style is="custom-style" include="iron-flex iron-flex-alignment"></style><style>:host{@apply (--layout-flex);@apply (--layout-horizontal);@apply (--layout-justified);}.target-temperature{@apply (--layout-self-center);font-size:200%;}.control-buttons{font-size:200%;text-align:right;}paper-icon-button{height:48px;width:48px;}</style><div class="target-temperature">[[value]] [[units]]</div><div class="control-buttons"><div><paper-icon-button icon="mdi:chevron-up" on-tap="incrementValue"></paper-icon-button></div><div><paper-icon-button icon="mdi:chevron-down" on-tap="decrementValue"></paper-icon-button></div></div></template><script>Polymer({is:"ha-climate-control",properties:{value:{type:Number,observer:"valueChanged"},units:{type:String},min:{type:Number},max:{type:Number},step:{type:Number,value:1}},incrementValue:function(){var e=this.value+this.step;this.last_changed=Date.now(),e<=this.max?this.value=e:this.value=this.max},decrementValue:function(){var e=this.value-this.step;this.last_changed=Date.now(),e>=this.min?this.value=e:this.value=this.min},valueChanged:function(){this.last_changed&&window.setTimeout(function(e){Date.now()-e.last_changed>=2e3&&(e.fire("change"),e.last_changed=null)},2010,this)}});</script></dom-module><dom-module id="more-info-climate" assetpath="more-infos/"><template><style is="custom-style" include="iron-flex"></style><style>:host{color:var(--primary-text-color);--paper-input-container-input:{text-transform:capitalize;};}.container-away_mode,
+      .slider-knob-inner::after{transition:-webkit-transform .18s ease, background-color .18s ease;transition:transform .18s ease, background-color .18s ease;}.pin.ring > .slider-knob > .slider-knob-inner::before{background-color:var(--paper-slider-pin-start-color, var(--paper-grey-400));}.pin.expand > .slider-knob > .slider-knob-inner::before{-webkit-transform:rotate(-45deg) scale(1) translate(17px, -17px);transform:rotate(-45deg) scale(1) translate(17px, -17px);}.pin > .slider-knob > .slider-knob-inner::after{content:attr(value);position:absolute;top:0;left:50%;margin-left:-16px;width:32px;height:26px;text-align:center;color:var(--paper-slider-font-color, #fff);font-size:10px;-webkit-transform:scale(0) translate(0);transform:scale(0) translate(0);}.pin.expand > .slider-knob > .slider-knob-inner::after{-webkit-transform:scale(1) translate(0, -17px);transform:scale(1) translate(0, -17px);}.slider-input{width:50px;overflow:hidden;--paper-input-container-input:{text-align:center;};@apply --paper-slider-input;}#sliderContainer.disabled{pointer-events:none;}.disabled > .slider-knob > .slider-knob-inner{background-color:var(--paper-slider-disabled-knob-color, var(--paper-grey-400));border:2px solid var(--paper-slider-disabled-knob-color, var(--paper-grey-400));-webkit-transform:scale3d(0.75, 0.75, 1);transform:scale3d(0.75, 0.75, 1);}.disabled.ring > .slider-knob > .slider-knob-inner{background-color:var(--paper-slider-knob-start-color, transparent);border:2px solid var(--paper-slider-knob-start-border-color, var(--paper-grey-400));}paper-ripple{color:var(--paper-slider-knob-color, var(--google-blue-700));}</style><div id="sliderContainer" class$="[[_getClassNames(disabled, pin, snaps, immediateValue, min, expand, dragging, transiting, editable)]]"><div class="bar-container"><paper-progress disabled$="[[disabled]]" id="sliderBar" aria-hidden="true" min="[[min]]" max="[[max]]" step="[[step]]" value="[[immediateValue]]" secondary-progress="[[secondaryProgress]]" on-down="_bardown" on-up="_resetKnob" on-track="_onTrack"></paper-progress></div><template is="dom-if" if="[[snaps]]"><div class="slider-markers"><template is="dom-repeat" items="[[markers]]"><div class="slider-marker"></div></template></div></template><div id="sliderKnob" class="slider-knob" on-down="_knobdown" on-up="_resetKnob" on-track="_onTrack" on-transitionend="_knobTransitionEnd"><div class="slider-knob-inner" value$="[[immediateValue]]"></div></div></div><template is="dom-if" if="[[editable]]"><paper-input id="input" type="number" step="[[step]]" min="[[min]]" max="[[max]]" class="slider-input" disabled$="[[disabled]]" value="[[immediateValue]]" on-change="_changeValue" on-keydown="_inputKeyDown" no-label-float=""></paper-input></template></template><script>Polymer({is:"paper-slider",behaviors:[Polymer.IronA11yKeysBehavior,Polymer.IronFormElementBehavior,Polymer.PaperInkyFocusBehavior,Polymer.IronRangeBehavior],properties:{snaps:{type:Boolean,value:!1,notify:!0},pin:{type:Boolean,value:!1,notify:!0},secondaryProgress:{type:Number,value:0,notify:!0,observer:"_secondaryProgressChanged"},editable:{type:Boolean,value:!1},immediateValue:{type:Number,value:0,readOnly:!0,notify:!0},maxMarkers:{type:Number,value:0,notify:!0},expand:{type:Boolean,value:!1,readOnly:!0},dragging:{type:Boolean,value:!1,readOnly:!0},transiting:{type:Boolean,value:!1,readOnly:!0},markers:{type:Array,readOnly:!0,value:function(){return[]}}},observers:["_updateKnob(value, min, max, snaps, step)","_valueChanged(value)","_immediateValueChanged(immediateValue)","_updateMarkers(maxMarkers, min, max, snaps)"],hostAttributes:{role:"slider",tabindex:0},keyBindings:{left:"_leftKey",right:"_rightKey","down pagedown home":"_decrementKey","up pageup end":"_incrementKey"},increment:function(){this.value=this._clampValue(this.value+this.step)},decrement:function(){this.value=this._clampValue(this.value-this.step)},_updateKnob:function(t,e,i,s,a){this.setAttribute("aria-valuemin",e),this.setAttribute("aria-valuemax",i),this.setAttribute("aria-valuenow",t),this._positionKnob(100*this._calcRatio(t))},_valueChanged:function(){this.fire("value-change",{composed:!0})},_immediateValueChanged:function(){this.dragging?this.fire("immediate-value-change",{composed:!0}):this.value=this.immediateValue},_secondaryProgressChanged:function(){this.secondaryProgress=this._clampValue(this.secondaryProgress)},_expandKnob:function(){this._setExpand(!0)},_resetKnob:function(){this.cancelDebouncer("expandKnob"),this._setExpand(!1)},_positionKnob:function(t){this._setImmediateValue(this._calcStep(this._calcKnobPosition(t))),this._setRatio(100*this._calcRatio(this.immediateValue)),this.$.sliderKnob.style.left=this.ratio+"%",this.dragging&&(this._knobstartx=this.ratio*this._w/100,this.translate3d(0,0,0,this.$.sliderKnob))},_calcKnobPosition:function(t){return(this.max-this.min)*t/100+this.min},_onTrack:function(t){switch(t.stopPropagation(),t.detail.state){case"start":this._trackStart(t);break;case"track":this._trackX(t);break;case"end":this._trackEnd()}},_trackStart:function(t){this._setTransiting(!1),this._w=this.$.sliderBar.offsetWidth,this._x=this.ratio*this._w/100,this._startx=this._x,this._knobstartx=this._startx,this._minx=-this._startx,this._maxx=this._w-this._startx,this.$.sliderKnob.classList.add("dragging"),this._setDragging(!0)},_trackX:function(t){this.dragging||this._trackStart(t);var e=this._isRTL?-1:1,i=Math.min(this._maxx,Math.max(this._minx,t.detail.dx*e));this._x=this._startx+i;var s=this._calcStep(this._calcKnobPosition(this._x/this._w*100));this._setImmediateValue(s);var a=this._calcRatio(this.immediateValue)*this._w-this._knobstartx;this.translate3d(a+"px",0,0,this.$.sliderKnob)},_trackEnd:function(){var t=this.$.sliderKnob.style;this.$.sliderKnob.classList.remove("dragging"),this._setDragging(!1),this._resetKnob(),this.value=this.immediateValue,t.transform=t.webkitTransform="",this.fire("change",{composed:!0})},_knobdown:function(t){this._expandKnob(),t.preventDefault(),this.focus()},_bardown:function(t){this._w=this.$.sliderBar.offsetWidth;var e=this.$.sliderBar.getBoundingClientRect(),i=(t.detail.x-e.left)/this._w*100;this._isRTL&&(i=100-i);var s=this.ratio;this._setTransiting(!0),this._positionKnob(i),this.debounce("expandKnob",this._expandKnob,60),s===this.ratio&&this._setTransiting(!1),this.async(function(){this.fire("change",{composed:!0})}),t.preventDefault(),this.focus()},_knobTransitionEnd:function(t){t.target===this.$.sliderKnob&&this._setTransiting(!1)},_updateMarkers:function(t,e,i,s){s||this._setMarkers([]);var a=Math.round((i-e)/this.step);a>t&&(a=t),(a<0||!isFinite(a))&&(a=0),this._setMarkers(new Array(a))},_mergeClasses:function(t){return Object.keys(t).filter(function(e){return t[e]}).join(" ")},_getClassNames:function(){return this._mergeClasses({disabled:this.disabled,pin:this.pin,snaps:this.snaps,ring:this.immediateValue<=this.min,expand:this.expand,dragging:this.dragging,transiting:this.transiting,editable:this.editable})},get _isRTL(){return void 0===this.__isRTL&&(this.__isRTL="rtl"===window.getComputedStyle(this).direction),this.__isRTL},_leftKey:function(t){this._isRTL?this._incrementKey(t):this._decrementKey(t)},_rightKey:function(t){this._isRTL?this._decrementKey(t):this._incrementKey(t)},_incrementKey:function(t){this.disabled||("end"===t.detail.key?this.value=this.max:this.increment(),this.fire("change"),t.preventDefault())},_decrementKey:function(t){this.disabled||("home"===t.detail.key?this.value=this.min:this.decrement(),this.fire("change"),t.preventDefault())},_changeValue:function(t){this.value=t.target.value,this.fire("change",{composed:!0})},_inputKeyDown:function(t){t.stopPropagation()},_createRipple:function(){return this._rippleContainer=this.$.sliderKnob,Polymer.PaperInkyFocusBehaviorImpl._createRipple.call(this)},_focusedChanged:function(t){t&&this.ensureRipple(),this.hasRipple()&&(this._ripple.style.display=t?"":"none",this._ripple.holdDown=t)}});</script></dom-module><dom-module id="ha-cover-tilt-controls" assetpath="components/"><template><style is="custom-style" include="iron-flex"></style><style>:host{white-space:nowrap;}[invisible]{visibility:hidden !important;}</style><paper-icon-button icon="mdi:arrow-top-right" on-tap="onOpenTiltTap" title="Open tilt" invisible$="[[!entityObj.supportsOpenTilt]]" disabled="[[computeOpenDisabled(stateObj, entityObj)]]"></paper-icon-button><paper-icon-button icon="mdi:stop" on-tap="onStopTiltTap" invisible$="[[!entityObj.supportsStopTilt]]" title="Stop tilt"></paper-icon-button><paper-icon-button icon="mdi:arrow-bottom-left" on-tap="onCloseTiltTap" title="Close tilt" invisible$="[[!entityObj.supportsCloseTilt]]" disabled="[[computeClosedDisabled(stateObj, entityObj)]]"></paper-icon-button></template></dom-module><script>Polymer({is:"ha-cover-tilt-controls",properties:{hass:{type:Object},stateObj:{type:Object},entityObj:{type:Object,computed:"computeEntityObj(hass, stateObj)"}},computeEntityObj:function(t,e){return new window.CoverEntity(t,e)},computeOpenDisabled:function(t,e){var o=!0===t.attributes.assumed_state;return e.isFullyOpenTilt&&!o},computeClosedDisabled:function(t,e){var o=!0===t.attributes.assumed_state;return e.isFullyClosedTilt&&!o},onOpenTiltTap:function(t){t.stopPropagation(),this.entityObj.openCoverTilt()},onCloseTiltTap:function(t){t.stopPropagation(),this.entityObj.closeCoverTilt()},onStopTiltTap:function(t){t.stopPropagation(),this.entityObj.stopCoverTilt()}});</script><dom-module id="state-card-cover" assetpath="state-summary/"><template><style is="custom-style" include="iron-flex iron-flex-alignment"></style><style>:host{line-height:1.5;}</style><div class="horizontal justified layout"><state-info state-obj="[[stateObj]]" in-dialog="[[inDialog]]"></state-info><div class="horizontal layout"><ha-cover-controls hidden$="[[entityObj.isTiltOnly]]" hass="[[hass]]" state-obj="[[stateObj]]"></ha-cover-controls><ha-cover-tilt-controls hidden$="[[!entityObj.isTiltOnly]]" hass="[[hass]]" state-obj="[[stateObj]]"></ha-cover-tilt-controls></div></div></template></dom-module><script>Polymer({is:"state-card-cover",properties:{hass:{type:Object},inDialog:{type:Boolean,value:!1},stateObj:{type:Object},entityObj:{type:Object,computed:"computeEntityObj(hass, stateObj)"}},computeEntityObj:function(t,e){return new window.CoverEntity(t,e)}});</script><dom-module id="state-card-display" assetpath="state-summary/"><template><style is="custom-style" include="iron-flex iron-flex-alignment"></style><style>.state{@apply (--paper-font-body1);color:var(--primary-text-color);margin-left:16px;text-align:right;line-height:40px;}</style><div class="horizontal justified layout"><state-info state-obj="[[stateObj]]" in-dialog="[[inDialog]]"></state-info><div class="state">[[computeStateDisplay(stateObj)]]</div></div></template></dom-module><script>Polymer({is:"state-card-display",properties:{inDialog:{type:Boolean,value:!1},stateObj:{type:Object}},computeStateDisplay:function(t){return window.hassUtil.computeStateState(t)}});</script><script>Polymer.IronFitBehavior={properties:{sizingTarget:{type:Object,value:function(){return this}},fitInto:{type:Object,value:window},noOverlap:{type:Boolean},positionTarget:{type:Element},horizontalAlign:{type:String},verticalAlign:{type:String},dynamicAlign:{type:Boolean},horizontalOffset:{type:Number,value:0,notify:!0},verticalOffset:{type:Number,value:0,notify:!0},autoFitOnAttach:{type:Boolean,value:!1},_fitInfo:{type:Object}},get _fitWidth(){return this.fitInto===window?this.fitInto.innerWidth:this.fitInto.getBoundingClientRect().width},get _fitHeight(){return this.fitInto===window?this.fitInto.innerHeight:this.fitInto.getBoundingClientRect().height},get _fitLeft(){return this.fitInto===window?0:this.fitInto.getBoundingClientRect().left},get _fitTop(){return this.fitInto===window?0:this.fitInto.getBoundingClientRect().top},get _defaultPositionTarget(){var t=Polymer.dom(this).parentNode;return t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(t=t.host),t},get _localeHorizontalAlign(){if(this._isRTL){if("right"===this.horizontalAlign)return"left";if("left"===this.horizontalAlign)return"right"}return this.horizontalAlign},attached:function(){void 0===this._isRTL&&(this._isRTL="rtl"==window.getComputedStyle(this).direction),this.positionTarget=this.positionTarget||this._defaultPositionTarget,this.autoFitOnAttach&&("none"===window.getComputedStyle(this).display?setTimeout(function(){this.fit()}.bind(this)):(window.ShadyDOM&&ShadyDOM.flush(),this.fit()))},detached:function(){this.__deferredFit&&(clearTimeout(this.__deferredFit),this.__deferredFit=null)},fit:function(){this.position(),this.constrain(),this.center()},_discoverInfo:function(){if(!this._fitInfo){var t=window.getComputedStyle(this),i=window.getComputedStyle(this.sizingTarget);this._fitInfo={inlineStyle:{top:this.style.top||"",left:this.style.left||"",position:this.style.position||""},sizerInlineStyle:{maxWidth:this.sizingTarget.style.maxWidth||"",maxHeight:this.sizingTarget.style.maxHeight||"",boxSizing:this.sizingTarget.style.boxSizing||""},positionedBy:{vertically:"auto"!==t.top?"top":"auto"!==t.bottom?"bottom":null,horizontally:"auto"!==t.left?"left":"auto"!==t.right?"right":null},sizedBy:{height:"none"!==i.maxHeight,width:"none"!==i.maxWidth,minWidth:parseInt(i.minWidth,10)||0,minHeight:parseInt(i.minHeight,10)||0},margin:{top:parseInt(t.marginTop,10)||0,right:parseInt(t.marginRight,10)||0,bottom:parseInt(t.marginBottom,10)||0,left:parseInt(t.marginLeft,10)||0}}}},resetFit:function(){var t=this._fitInfo||{};for(var i in t.sizerInlineStyle)this.sizingTarget.style[i]=t.sizerInlineStyle[i];for(var i in t.inlineStyle)this.style[i]=t.inlineStyle[i];this._fitInfo=null},refit:function(){var t=this.sizingTarget.scrollLeft,i=this.sizingTarget.scrollTop;this.resetFit(),this.fit(),this.sizingTarget.scrollLeft=t,this.sizingTarget.scrollTop=i},position:function(){if(this.horizontalAlign||this.verticalAlign){this._discoverInfo(),this.style.position="fixed",this.sizingTarget.style.boxSizing="border-box",this.style.left="0px",this.style.top="0px";var t=this.getBoundingClientRect(),i=this.__getNormalizedRect(this.positionTarget),e=this.__getNormalizedRect(this.fitInto),n=this._fitInfo.margin,o={width:t.width+n.left+n.right,height:t.height+n.top+n.bottom},h=this.__getPosition(this._localeHorizontalAlign,this.verticalAlign,o,i,e),s=h.left+n.left,l=h.top+n.top,r=Math.min(e.right-n.right,s+t.width),a=Math.min(e.bottom-n.bottom,l+t.height);s=Math.max(e.left+n.left,Math.min(s,r-this._fitInfo.sizedBy.minWidth)),l=Math.max(e.top+n.top,Math.min(l,a-this._fitInfo.sizedBy.minHeight)),this.sizingTarget.style.maxWidth=Math.max(r-s,this._fitInfo.sizedBy.minWidth)+"px",this.sizingTarget.style.maxHeight=Math.max(a-l,this._fitInfo.sizedBy.minHeight)+"px",this.style.left=s-t.left+"px",this.style.top=l-t.top+"px"}},constrain:function(){if(!this.horizontalAlign&&!this.verticalAlign){this._discoverInfo();var t=this._fitInfo;t.positionedBy.vertically||(this.style.position="fixed",this.style.top="0px"),t.positionedBy.horizontally||(this.style.position="fixed",this.style.left="0px"),this.sizingTarget.style.boxSizing="border-box";var i=this.getBoundingClientRect();t.sizedBy.height||this.__sizeDimension(i,t.positionedBy.vertically,"top","bottom","Height"),t.sizedBy.width||this.__sizeDimension(i,t.positionedBy.horizontally,"left","right","Width")}},_sizeDimension:function(t,i,e,n,o){this.__sizeDimension(t,i,e,n,o)},__sizeDimension:function(t,i,e,n,o){var h=this._fitInfo,s=this.__getNormalizedRect(this.fitInto),l="Width"===o?s.width:s.height,r=i===n,a=r?l-t[n]:t[e],f=h.margin[r?e:n],g="offset"+o,d=this[g]-this.sizingTarget[g];this.sizingTarget.style["max"+o]=l-f-a-d+"px"},center:function(){if(!this.horizontalAlign&&!this.verticalAlign){this._discoverInfo();var t=this._fitInfo.positionedBy;if(!t.vertically||!t.horizontally){this.style.position="fixed",t.vertically||(this.style.top="0px"),t.horizontally||(this.style.left="0px");var i=this.getBoundingClientRect(),e=this.__getNormalizedRect(this.fitInto);if(!t.vertically){var n=e.top-i.top+(e.height-i.height)/2;this.style.top=n+"px"}if(!t.horizontally){var o=e.left-i.left+(e.width-i.width)/2;this.style.left=o+"px"}}}},__getNormalizedRect:function(t){return t===document.documentElement||t===window?{top:0,left:0,width:window.innerWidth,height:window.innerHeight,right:window.innerWidth,bottom:window.innerHeight}:t.getBoundingClientRect()},__getCroppedArea:function(t,i,e){var n=Math.min(0,t.top)+Math.min(0,e.bottom-(t.top+i.height)),o=Math.min(0,t.left)+Math.min(0,e.right-(t.left+i.width));return Math.abs(n)*i.width+Math.abs(o)*i.height},__getPosition:function(t,i,e,n,o){var h=[{verticalAlign:"top",horizontalAlign:"left",top:n.top+this.verticalOffset,left:n.left+this.horizontalOffset},{verticalAlign:"top",horizontalAlign:"right",top:n.top+this.verticalOffset,left:n.right-e.width-this.horizontalOffset},{verticalAlign:"bottom",horizontalAlign:"left",top:n.bottom-e.height-this.verticalOffset,left:n.left+this.horizontalOffset},{verticalAlign:"bottom",horizontalAlign:"right",top:n.bottom-e.height-this.verticalOffset,left:n.right-e.width-this.horizontalOffset}];if(this.noOverlap){for(var s=0,l=h.length;s<l;s++){var r={};for(var a in h[s])r[a]=h[s][a];h.push(r)}h[0].top=h[1].top+=n.height,h[2].top=h[3].top-=n.height,h[4].left=h[6].left+=n.width,h[5].left=h[7].left-=n.width}i="auto"===i?null:i,t="auto"===t?null:t;for(var f,s=0;s<h.length;s++){var g=h[s];if(!this.dynamicAlign&&!this.noOverlap&&g.verticalAlign===i&&g.horizontalAlign===t){f=g;break}var d=!(i&&g.verticalAlign!==i||t&&g.horizontalAlign!==t);if(this.dynamicAlign||d){f=f||g,g.croppedArea=this.__getCroppedArea(g,e,o);var p=g.croppedArea-f.croppedArea;if((p<0||0===p&&d)&&(f=g),0===f.croppedArea&&d)break}}return f}};</script><dom-module id="iron-overlay-backdrop" assetpath="../bower_components/iron-overlay-behavior/"><template><style>:host{position:fixed;top:0;left:0;width:100%;height:100%;background-color:var(--iron-overlay-backdrop-background-color, #000);opacity:0;transition:opacity 0.2s;pointer-events:none;@apply --iron-overlay-backdrop;}:host(.opened){opacity:var(--iron-overlay-backdrop-opacity, 0.6);pointer-events:auto;@apply --iron-overlay-backdrop-opened;}</style><slot></slot></template></dom-module><script>!function(){"use strict";Polymer({is:"iron-overlay-backdrop",properties:{opened:{reflectToAttribute:!0,type:Boolean,value:!1,observer:"_openedChanged"}},listeners:{transitionend:"_onTransitionend"},created:function(){this.__openedRaf=null},attached:function(){this.opened&&this._openedChanged(this.opened)},prepare:function(){this.opened&&!this.parentNode&&Polymer.dom(document.body).appendChild(this)},open:function(){this.opened=!0},close:function(){this.opened=!1},complete:function(){this.opened||this.parentNode!==document.body||Polymer.dom(this.parentNode).removeChild(this)},_onTransitionend:function(e){e&&e.target===this&&this.complete()},_openedChanged:function(e){if(e)this.prepare();else{var t=window.getComputedStyle(this);"0s"!==t.transitionDuration&&0!=t.opacity||this.complete()}this.isAttached&&(this.__openedRaf&&(window.cancelAnimationFrame(this.__openedRaf),this.__openedRaf=null),this.scrollTop=this.scrollTop,this.__openedRaf=window.requestAnimationFrame(function(){this.__openedRaf=null,this.toggleClass("opened",this.opened)}.bind(this)))}})}();</script><script>Polymer.IronOverlayManagerClass=function(){this._overlays=[],this._minimumZ=101,this._backdropElement=null,Polymer.Gestures.add(document.documentElement,"tap",null),document.addEventListener("tap",this._onCaptureClick.bind(this),!0),document.addEventListener("focus",this._onCaptureFocus.bind(this),!0),document.addEventListener("keydown",this._onCaptureKeyDown.bind(this),!0)},Polymer.IronOverlayManagerClass.prototype={constructor:Polymer.IronOverlayManagerClass,get backdropElement(){return this._backdropElement||(this._backdropElement=document.createElement("iron-overlay-backdrop")),this._backdropElement},get deepActiveElement(){for(var e=document.activeElement||document.body;e.root&&Polymer.dom(e.root).activeElement;)e=Polymer.dom(e.root).activeElement;return e},_bringOverlayAtIndexToFront:function(e){var t=this._overlays[e];if(t){var r=this._overlays.length-1,a=this._overlays[r];if(a&&this._shouldBeBehindOverlay(t,a)&&r--,!(e>=r)){var n=Math.max(this.currentOverlayZ(),this._minimumZ);for(this._getZ(t)<=n&&this._applyOverlayZ(t,n);e<r;)this._overlays[e]=this._overlays[e+1],e++;this._overlays[r]=t}}},addOrRemoveOverlay:function(e){e.opened?this.addOverlay(e):this.removeOverlay(e)},addOverlay:function(e){var t=this._overlays.indexOf(e);if(t>=0)return this._bringOverlayAtIndexToFront(t),void this.trackBackdrop();var r=this._overlays.length,a=this._overlays[r-1],n=Math.max(this._getZ(a),this._minimumZ),o=this._getZ(e);if(a&&this._shouldBeBehindOverlay(e,a)){this._applyOverlayZ(a,n),r--;var i=this._overlays[r-1];n=Math.max(this._getZ(i),this._minimumZ)}o<=n&&this._applyOverlayZ(e,n),this._overlays.splice(r,0,e),this.trackBackdrop()},removeOverlay:function(e){var t=this._overlays.indexOf(e);-1!==t&&(this._overlays.splice(t,1),this.trackBackdrop())},currentOverlay:function(){var e=this._overlays.length-1;return this._overlays[e]},currentOverlayZ:function(){return this._getZ(this.currentOverlay())},ensureMinimumZ:function(e){this._minimumZ=Math.max(this._minimumZ,e)},focusOverlay:function(){var e=this.currentOverlay();e&&e._applyFocus()},trackBackdrop:function(){var e=this._overlayWithBackdrop();(e||this._backdropElement)&&(this.backdropElement.style.zIndex=this._getZ(e)-1,this.backdropElement.opened=!!e,this.backdropElement.prepare())},getBackdrops:function(){for(var e=[],t=0;t<this._overlays.length;t++)this._overlays[t].withBackdrop&&e.push(this._overlays[t]);return e},backdropZ:function(){return this._getZ(this._overlayWithBackdrop())-1},_overlayWithBackdrop:function(){for(var e=0;e<this._overlays.length;e++)if(this._overlays[e].withBackdrop)return this._overlays[e]},_getZ:function(e){var t=this._minimumZ;if(e){var r=Number(e.style.zIndex||window.getComputedStyle(e).zIndex);r===r&&(t=r)}return t},_setZ:function(e,t){e.style.zIndex=t},_applyOverlayZ:function(e,t){this._setZ(e,t+2)},_overlayInPath:function(e){e=e||[];for(var t=0;t<e.length;t++)if(e[t]._manager===this)return e[t]},_onCaptureClick:function(e){var t=this.currentOverlay();t&&this._overlayInPath(Polymer.dom(e).path)!==t&&t._onCaptureClick(e)},_onCaptureFocus:function(e){var t=this.currentOverlay();t&&t._onCaptureFocus(e)},_onCaptureKeyDown:function(e){var t=this.currentOverlay();t&&(Polymer.IronA11yKeysBehavior.keyboardEventMatchesKeys(e,"esc")?t._onCaptureEsc(e):Polymer.IronA11yKeysBehavior.keyboardEventMatchesKeys(e,"tab")&&t._onCaptureTab(e))},_shouldBeBehindOverlay:function(e,t){return!e.alwaysOnTop&&t.alwaysOnTop}},Polymer.IronOverlayManager=new Polymer.IronOverlayManagerClass;</script><script>!function(){"use strict";var e=Element.prototype,t=e.matches||e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;Polymer.IronFocusablesHelper={getTabbableNodes:function(e){var t=[];return this._collectTabbableNodes(e,t)?this._sortByTabIndex(t):t},isFocusable:function(e){return t.call(e,"input, select, textarea, button, object")?t.call(e,":not([disabled])"):t.call(e,"a[href], area[href], iframe, [tabindex], [contentEditable]")},isTabbable:function(e){return this.isFocusable(e)&&t.call(e,':not([tabindex="-1"])')&&this._isVisible(e)},_normalizedTabIndex:function(e){if(this.isFocusable(e)){var t=e.getAttribute("tabindex")||0;return Number(t)}return-1},_collectTabbableNodes:function(e,t){if(e.nodeType!==Node.ELEMENT_NODE||!this._isVisible(e))return!1;var r=e,a=this._normalizedTabIndex(r),i=a>0;a>=0&&t.push(r);var n;n="content"===r.localName||"slot"===r.localName?Polymer.dom(r).getDistributedNodes():Polymer.dom(r.root||r).children;for(var o=0;o<n.length;o++)i=this._collectTabbableNodes(n[o],t)||i;return i},_isVisible:function(e){var t=e.style;return"hidden"!==t.visibility&&"none"!==t.display&&("hidden"!==(t=window.getComputedStyle(e)).visibility&&"none"!==t.display)},_sortByTabIndex:function(e){var t=e.length;if(t<2)return e;var r=Math.ceil(t/2),a=this._sortByTabIndex(e.slice(0,r)),i=this._sortByTabIndex(e.slice(r));return this._mergeSortByTabIndex(a,i)},_mergeSortByTabIndex:function(e,t){for(var r=[];e.length>0&&t.length>0;)this._hasLowerTabOrder(e[0],t[0])?r.push(t.shift()):r.push(e.shift());return r.concat(e,t)},_hasLowerTabOrder:function(e,t){var r=Math.max(e.tabIndex,0),a=Math.max(t.tabIndex,0);return 0===r||0===a?a>r:r>a}}}();</script><script>!function(){"use strict";Polymer.IronOverlayBehaviorImpl={properties:{opened:{observer:"_openedChanged",type:Boolean,value:!1,notify:!0},canceled:{observer:"_canceledChanged",readOnly:!0,type:Boolean,value:!1},withBackdrop:{observer:"_withBackdropChanged",type:Boolean},noAutoFocus:{type:Boolean,value:!1},noCancelOnEscKey:{type:Boolean,value:!1},noCancelOnOutsideClick:{type:Boolean,value:!1},closingReason:{type:Object},restoreFocusOnClose:{type:Boolean,value:!1},alwaysOnTop:{type:Boolean},_manager:{type:Object,value:Polymer.IronOverlayManager},_focusedChild:{type:Object}},listeners:{"iron-resize":"_onIronResize"},get backdropElement(){return this._manager.backdropElement},get _focusNode(){return this._focusedChild||Polymer.dom(this).querySelector("[autofocus]")||this},get _focusableNodes(){return Polymer.IronFocusablesHelper.getTabbableNodes(this)},ready:function(){this.__isAnimating=!1,this.__shouldRemoveTabIndex=!1,this.__firstFocusableNode=this.__lastFocusableNode=null,this.__raf=null,this.__restoreFocusNode=null,this._ensureSetup()},attached:function(){this.opened&&this._openedChanged(this.opened),this._observer=Polymer.dom(this).observeNodes(this._onNodesChange)},detached:function(){Polymer.dom(this).unobserveNodes(this._observer),this._observer=null,this.__raf&&(window.cancelAnimationFrame(this.__raf),this.__raf=null),this._manager.removeOverlay(this)},toggle:function(){this._setCanceled(!1),this.opened=!this.opened},open:function(){this._setCanceled(!1),this.opened=!0},close:function(){this._setCanceled(!1),this.opened=!1},cancel:function(e){this.fire("iron-overlay-canceled",e,{cancelable:!0}).defaultPrevented||(this._setCanceled(!0),this.opened=!1)},invalidateTabbables:function(){this.__firstFocusableNode=this.__lastFocusableNode=null},_ensureSetup:function(){this._overlaySetup||(this._overlaySetup=!0,this.style.outline="none",this.style.display="none")},_openedChanged:function(e){e?this.removeAttribute("aria-hidden"):this.setAttribute("aria-hidden","true"),this.isAttached&&(this.__isAnimating=!0,this.__onNextAnimationFrame(this.__openedChanged))},_canceledChanged:function(){this.closingReason=this.closingReason||{},this.closingReason.canceled=this.canceled},_withBackdropChanged:function(){this.withBackdrop&&!this.hasAttribute("tabindex")?(this.setAttribute("tabindex","-1"),this.__shouldRemoveTabIndex=!0):this.__shouldRemoveTabIndex&&(this.removeAttribute("tabindex"),this.__shouldRemoveTabIndex=!1),this.opened&&this.isAttached&&this._manager.trackBackdrop()},_prepareRenderOpened:function(){this.__restoreFocusNode=this._manager.deepActiveElement,this._preparePositioning(),this.refit(),this._finishPositioning(),this.noAutoFocus&&document.activeElement===this._focusNode&&(this._focusNode.blur(),this.__restoreFocusNode.focus())},_renderOpened:function(){this._finishRenderOpened()},_renderClosed:function(){this._finishRenderClosed()},_finishRenderOpened:function(){this.notifyResize(),this.__isAnimating=!1,this.fire("iron-overlay-opened")},_finishRenderClosed:function(){this.style.display="none",this.style.zIndex="",this.notifyResize(),this.__isAnimating=!1,this.fire("iron-overlay-closed",this.closingReason)},_preparePositioning:function(){this.style.transition=this.style.webkitTransition="none",this.style.transform=this.style.webkitTransform="none",this.style.display=""},_finishPositioning:function(){this.style.display="none",this.scrollTop=this.scrollTop,this.style.transition=this.style.webkitTransition="",this.style.transform=this.style.webkitTransform="",this.style.display="",this.scrollTop=this.scrollTop},_applyFocus:function(){if(this.opened)this.noAutoFocus||this._focusNode.focus();else{this._focusNode.blur(),this._focusedChild=null,this.restoreFocusOnClose&&this.__restoreFocusNode&&this.__restoreFocusNode.focus(),this.__restoreFocusNode=null;var e=this._manager.currentOverlay();e&&this!==e&&e._applyFocus()}},_onCaptureClick:function(e){this.noCancelOnOutsideClick||this.cancel(e)},_onCaptureFocus:function(e){if(this.withBackdrop){var t=Polymer.dom(e).path;-1===t.indexOf(this)?(e.stopPropagation(),this._applyFocus()):this._focusedChild=t[0]}},_onCaptureEsc:function(e){this.noCancelOnEscKey||this.cancel(e)},_onCaptureTab:function(e){if(this.withBackdrop){this.__ensureFirstLastFocusables();var t=e.shiftKey,s=t?this.__firstFocusableNode:this.__lastFocusableNode,i=t?this.__lastFocusableNode:this.__firstFocusableNode,o=!1;if(s===i)o=!0;else{var n=this._manager.deepActiveElement;o=n===s||n===this}o&&(e.preventDefault(),this._focusedChild=i,this._applyFocus())}},_onIronResize:function(){this.opened&&!this.__isAnimating&&this.__onNextAnimationFrame(this.refit)},_onNodesChange:function(){this.opened&&!this.__isAnimating&&(this.invalidateTabbables(),this.notifyResize())},__ensureFirstLastFocusables:function(){if(!this.__firstFocusableNode||!this.__lastFocusableNode){var e=this._focusableNodes;this.__firstFocusableNode=e[0],this.__lastFocusableNode=e[e.length-1]}},__openedChanged:function(){this.opened?(this._prepareRenderOpened(),this._manager.addOverlay(this),this._applyFocus(),this._renderOpened()):(this._manager.removeOverlay(this),this._applyFocus(),this._renderClosed())},__onNextAnimationFrame:function(e){this.__raf&&window.cancelAnimationFrame(this.__raf);var t=this;this.__raf=window.requestAnimationFrame(function(){t.__raf=null,e.call(t)})}},Polymer.IronOverlayBehavior=[Polymer.IronFitBehavior,Polymer.IronResizableBehavior,Polymer.IronOverlayBehaviorImpl]}();</script><script>Polymer.NeonAnimatableBehavior={properties:{animationConfig:{type:Object},entryAnimation:{observer:"_entryAnimationChanged",type:String},exitAnimation:{observer:"_exitAnimationChanged",type:String}},_entryAnimationChanged:function(){this.animationConfig=this.animationConfig||{},this.animationConfig.entry=[{name:this.entryAnimation,node:this}]},_exitAnimationChanged:function(){this.animationConfig=this.animationConfig||{},this.animationConfig.exit=[{name:this.exitAnimation,node:this}]},_copyProperties:function(i,n){for(var t in n)i[t]=n[t]},_cloneConfig:function(i){var n={isClone:!0};return this._copyProperties(n,i),n},_getAnimationConfigRecursive:function(i,n,t){if(this.animationConfig)if(this.animationConfig.value&&"function"==typeof this.animationConfig.value)this._warn(this._logf("playAnimation","Please put 'animationConfig' inside of your components 'properties' object instead of outside of it."));else{var o;if(o=i?this.animationConfig[i]:this.animationConfig,Array.isArray(o)||(o=[o]),o)for(var e,a=0;e=o[a];a++)if(e.animatable)e.animatable._getAnimationConfigRecursive(e.type||i,n,t);else if(e.id){var r=n[e.id];r?(r.isClone||(n[e.id]=this._cloneConfig(r),r=n[e.id]),this._copyProperties(r,e)):n[e.id]=e}else t.push(e)}},getAnimationConfig:function(i){var n={},t=[];this._getAnimationConfigRecursive(i,n,t);for(var o in n)t.push(n[o]);return t}};</script><script>Polymer.NeonAnimationRunnerBehaviorImpl={_configureAnimations:function(n){var i=[];if(n.length>0)for(var e,t=0;e=n[t];t++){var o=document.createElement(e.name);if(o.isNeonAnimation){var a=null;try{"function"!=typeof(a=o.configure(e)).cancel&&(a=document.timeline.play(a))}catch(n){a=null,console.warn("Couldnt play","(",e.name,").",n)}a&&i.push({neonAnimation:o,config:e,animation:a})}else console.warn(this.is+":",e.name,"not found!")}return i},_shouldComplete:function(n){for(var i=!0,e=0;e<n.length;e++)if("finished"!=n[e].animation.playState){i=!1;break}return i},_complete:function(n){for(i=0;i<n.length;i++)n[i].neonAnimation.complete(n[i].config);for(var i=0;i<n.length;i++)n[i].animation.cancel()},playAnimation:function(n,i){var e=this.getAnimationConfig(n);if(e){this._active=this._active||{},this._active[n]&&(this._complete(this._active[n]),delete this._active[n]);var t=this._configureAnimations(e);if(0!=t.length){this._active[n]=t;for(var o=0;o<t.length;o++)t[o].animation.onfinish=function(){this._shouldComplete(t)&&(this._complete(t),delete this._active[n],this.fire("neon-animation-finish",i,{bubbles:!1}))}.bind(this)}else this.fire("neon-animation-finish",i,{bubbles:!1})}},cancelAnimation:function(){for(var n in this._animations)this._animations[n].cancel();this._animations={}}},Polymer.NeonAnimationRunnerBehavior=[Polymer.NeonAnimatableBehavior,Polymer.NeonAnimationRunnerBehaviorImpl];</script><script>!function(){"use strict";var e={pageX:0,pageY:0},t=null,l=[],n=["wheel","mousewheel","DOMMouseScroll","touchstart","touchmove"];Polymer.IronDropdownScrollManager={get currentLockingElement(){return this._lockingElements[this._lockingElements.length-1]},elementIsScrollLocked:function(e){var t=this.currentLockingElement;if(void 0===t)return!1;var l;return!!this._hasCachedLockedElement(e)||!this._hasCachedUnlockedElement(e)&&((l=!!t&&t!==e&&!this._composedTreeContains(t,e))?this._lockedElementCache.push(e):this._unlockedElementCache.push(e),l)},pushScrollLock:function(e){this._lockingElements.indexOf(e)>=0||(0===this._lockingElements.length&&this._lockScrollInteractions(),this._lockingElements.push(e),this._lockedElementCache=[],this._unlockedElementCache=[])},removeScrollLock:function(e){var t=this._lockingElements.indexOf(e);-1!==t&&(this._lockingElements.splice(t,1),this._lockedElementCache=[],this._unlockedElementCache=[],0===this._lockingElements.length&&this._unlockScrollInteractions())},_lockingElements:[],_lockedElementCache:null,_unlockedElementCache:null,_hasCachedLockedElement:function(e){return this._lockedElementCache.indexOf(e)>-1},_hasCachedUnlockedElement:function(e){return this._unlockedElementCache.indexOf(e)>-1},_composedTreeContains:function(e,t){var l,n,o,r;if(e.contains(t))return!0;for(l=Polymer.dom(e).querySelectorAll("content,slot"),o=0;o<l.length;++o)for(n=Polymer.dom(l[o]).getDistributedNodes(),r=0;r<n.length;++r)if(n[r].nodeType===Node.ELEMENT_NODE&&this._composedTreeContains(n[r],t))return!0;return!1},_scrollInteractionHandler:function(t){if(t.cancelable&&this._shouldPreventScrolling(t)&&t.preventDefault(),t.targetTouches){var l=t.targetTouches[0];e.pageX=l.pageX,e.pageY=l.pageY}},_lockScrollInteractions:function(){this._boundScrollHandler=this._boundScrollHandler||this._scrollInteractionHandler.bind(this);for(var e=0,t=n.length;e<t;e++)document.addEventListener(n[e],this._boundScrollHandler,{capture:!0,passive:!1})},_unlockScrollInteractions:function(){for(var e=0,t=n.length;e<t;e++)document.removeEventListener(n[e],this._boundScrollHandler,{capture:!0,passive:!1})},_shouldPreventScrolling:function(e){var n=Polymer.dom(e).rootTarget;if("touchmove"!==e.type&&t!==n&&(t=n,l=this._getScrollableNodes(Polymer.dom(e).path)),!l.length)return!0;if("touchstart"===e.type)return!1;var o=this._getScrollInfo(e);return!this._getScrollingNode(l,o.deltaX,o.deltaY)},_getScrollableNodes:function(e){for(var t=[],l=e.indexOf(this.currentLockingElement),n=0;n<=l;n++)if(e[n].nodeType===Node.ELEMENT_NODE){var o=e[n],r=o.style;"scroll"!==r.overflow&&"auto"!==r.overflow&&(r=window.getComputedStyle(o)),"scroll"!==r.overflow&&"auto"!==r.overflow||t.push(o)}return t},_getScrollingNode:function(e,t,l){if(t||l)for(var n=Math.abs(l)>=Math.abs(t),o=0;o<e.length;o++){var r=e[o];if(n?l<0?r.scrollTop>0:r.scrollTop<r.scrollHeight-r.clientHeight:t<0?r.scrollLeft>0:r.scrollLeft<r.scrollWidth-r.clientWidth)return r}},_getScrollInfo:function(t){var l={deltaX:t.deltaX,deltaY:t.deltaY};if("deltaX"in t);else if("wheelDeltaX"in t)l.deltaX=-t.wheelDeltaX,l.deltaY=-t.wheelDeltaY;else if("axis"in t)l.deltaX=1===t.axis?t.detail:0,l.deltaY=2===t.axis?t.detail:0;else if(t.targetTouches){var n=t.targetTouches[0];l.deltaX=e.pageX-n.pageX,l.deltaY=e.pageY-n.pageY}return l}}}();</script><dom-module id="iron-dropdown" assetpath="../bower_components/iron-dropdown/"><template><style>:host{position:fixed;}#contentWrapper ::slotted(*){overflow:auto;}#contentWrapper.animating ::slotted(*){overflow:hidden;}</style><div id="contentWrapper"><slot id="content" name="dropdown-content"></slot></div></template><script>!function(){"use strict";Polymer({is:"iron-dropdown",behaviors:[Polymer.IronControlState,Polymer.IronA11yKeysBehavior,Polymer.IronOverlayBehavior,Polymer.NeonAnimationRunnerBehavior],properties:{horizontalAlign:{type:String,value:"left",reflectToAttribute:!0},verticalAlign:{type:String,value:"top",reflectToAttribute:!0},openAnimationConfig:{type:Object},closeAnimationConfig:{type:Object},focusTarget:{type:Object},noAnimations:{type:Boolean,value:!1},allowOutsideScroll:{type:Boolean,value:!1},_boundOnCaptureScroll:{type:Function,value:function(){return this._onCaptureScroll.bind(this)}}},listeners:{"neon-animation-finish":"_onNeonAnimationFinish"},observers:["_updateOverlayPosition(positionTarget, verticalAlign, horizontalAlign, verticalOffset, horizontalOffset)"],get containedElement(){for(var o=Polymer.dom(this.$.content).getDistributedNodes(),n=0,t=o.length;n<t;n++)if(o[n].nodeType===Node.ELEMENT_NODE)return o[n]},ready:function(){this._scrollTop=0,this._scrollLeft=0,this._refitOnScrollRAF=null},attached:function(){this.sizingTarget&&this.sizingTarget!==this||(this.sizingTarget=this.containedElement||this)},detached:function(){this.cancelAnimation(),document.removeEventListener("scroll",this._boundOnCaptureScroll),Polymer.IronDropdownScrollManager.removeScrollLock(this)},_openedChanged:function(){this.opened&&this.disabled?this.cancel():(this.cancelAnimation(),this._updateAnimationConfig(),this._saveScrollPosition(),this.opened?(document.addEventListener("scroll",this._boundOnCaptureScroll),!this.allowOutsideScroll&&Polymer.IronDropdownScrollManager.pushScrollLock(this)):(document.removeEventListener("scroll",this._boundOnCaptureScroll),Polymer.IronDropdownScrollManager.removeScrollLock(this)),Polymer.IronOverlayBehaviorImpl._openedChanged.apply(this,arguments))},_renderOpened:function(){!this.noAnimations&&this.animationConfig.open?(this.$.contentWrapper.classList.add("animating"),this.playAnimation("open")):Polymer.IronOverlayBehaviorImpl._renderOpened.apply(this,arguments)},_renderClosed:function(){!this.noAnimations&&this.animationConfig.close?(this.$.contentWrapper.classList.add("animating"),this.playAnimation("close")):Polymer.IronOverlayBehaviorImpl._renderClosed.apply(this,arguments)},_onNeonAnimationFinish:function(){this.$.contentWrapper.classList.remove("animating"),this.opened?this._finishRenderOpened():this._finishRenderClosed()},_onCaptureScroll:function(){this.allowOutsideScroll?(this._refitOnScrollRAF&&window.cancelAnimationFrame(this._refitOnScrollRAF),this._refitOnScrollRAF=window.requestAnimationFrame(this.refit.bind(this))):this._restoreScrollPosition()},_saveScrollPosition:function(){document.scrollingElement?(this._scrollTop=document.scrollingElement.scrollTop,this._scrollLeft=document.scrollingElement.scrollLeft):(this._scrollTop=Math.max(document.documentElement.scrollTop,document.body.scrollTop),this._scrollLeft=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft))},_restoreScrollPosition:function(){document.scrollingElement?(document.scrollingElement.scrollTop=this._scrollTop,document.scrollingElement.scrollLeft=this._scrollLeft):(document.documentElement.scrollTop=this._scrollTop,document.documentElement.scrollLeft=this._scrollLeft,document.body.scrollTop=this._scrollTop,document.body.scrollLeft=this._scrollLeft)},_updateAnimationConfig:function(){for(var o=this.containedElement,n=[].concat(this.openAnimationConfig||[]).concat(this.closeAnimationConfig||[]),t=0;t<n.length;t++)n[t].node=o;this.animationConfig={open:this.openAnimationConfig,close:this.closeAnimationConfig}},_updateOverlayPosition:function(){this.isAttached&&this.notifyResize()},_applyFocus:function(){var o=this.focusTarget||this.containedElement;o&&this.opened&&!this.noAutoFocus?o.focus():Polymer.IronOverlayBehaviorImpl._applyFocus.apply(this,arguments)}})}();</script></dom-module><script>Polymer.NeonAnimationBehavior={properties:{animationTiming:{type:Object,value:function(){return{duration:500,easing:"cubic-bezier(0.4, 0, 0.2, 1)",fill:"both"}}}},isNeonAnimation:!0,created:function(){document.body.animate||console.warn("No web animations detected. This element will not function without a web animations polyfill.")},timingFromConfig:function(i){if(i.timing)for(var n in i.timing)this.animationTiming[n]=i.timing[n];return this.animationTiming},setPrefixedProperty:function(i,n,t){for(var o,e={transform:["webkitTransform"],transformOrigin:["mozTransformOrigin","webkitTransformOrigin"]}[n],r=0;o=e[r];r++)i.style[o]=t;i.style[n]=t},complete:function(){}};</script><script>Polymer({is:"fade-in-animation",behaviors:[Polymer.NeonAnimationBehavior],configure:function(i){var e=i.node;return this._effect=new KeyframeEffect(e,[{opacity:"0"},{opacity:"1"}],this.timingFromConfig(i)),this._effect}});</script><script>Polymer({is:"fade-out-animation",behaviors:[Polymer.NeonAnimationBehavior],configure:function(e){var i=e.node;return this._effect=new KeyframeEffect(i,[{opacity:"1"},{opacity:"0"}],this.timingFromConfig(e)),this._effect}});</script><script>Polymer({is:"paper-menu-grow-height-animation",behaviors:[Polymer.NeonAnimationBehavior],configure:function(e){var i=e.node,t=i.getBoundingClientRect().height;return this._effect=new KeyframeEffect(i,[{height:t/2+"px"},{height:t+"px"}],this.timingFromConfig(e)),this._effect}}),Polymer({is:"paper-menu-grow-width-animation",behaviors:[Polymer.NeonAnimationBehavior],configure:function(e){var i=e.node,t=i.getBoundingClientRect().width;return this._effect=new KeyframeEffect(i,[{width:t/2+"px"},{width:t+"px"}],this.timingFromConfig(e)),this._effect}}),Polymer({is:"paper-menu-shrink-width-animation",behaviors:[Polymer.NeonAnimationBehavior],configure:function(e){var i=e.node,t=i.getBoundingClientRect().width;return this._effect=new KeyframeEffect(i,[{width:t+"px"},{width:t-t/20+"px"}],this.timingFromConfig(e)),this._effect}}),Polymer({is:"paper-menu-shrink-height-animation",behaviors:[Polymer.NeonAnimationBehavior],configure:function(e){var i=e.node,t=i.getBoundingClientRect(),n=t.height;t.top;return this.setPrefixedProperty(i,"transformOrigin","0 0"),this._effect=new KeyframeEffect(i,[{height:n+"px",transform:"translateY(0)"},{height:n/2+"px",transform:"translateY(-20px)"}],this.timingFromConfig(e)),this._effect}});</script><dom-module id="paper-menu-button" assetpath="../bower_components/paper-menu-button/"><template><style>:host{display:inline-block;position:relative;padding:8px;outline:none;@apply --paper-menu-button;}:host([disabled]){cursor:auto;color:var(--disabled-text-color);@apply --paper-menu-button-disabled;}iron-dropdown{@apply --paper-menu-button-dropdown;}.dropdown-content{@apply --shadow-elevation-2dp;position:relative;border-radius:2px;background-color:var(--paper-menu-button-dropdown-background, var(--primary-background-color));@apply --paper-menu-button-content;}:host([vertical-align="top"]) .dropdown-content{margin-bottom:20px;margin-top:-10px;top:10px;}:host([vertical-align="bottom"]) .dropdown-content{bottom:10px;margin-bottom:-10px;margin-top:20px;}#trigger{cursor:pointer;}</style><div id="trigger" on-tap="toggle"><slot name="dropdown-trigger"></slot></div><iron-dropdown id="dropdown" opened="{{opened}}" horizontal-align="[[horizontalAlign]]" vertical-align="[[verticalAlign]]" dynamic-align="[[dynamicAlign]]" horizontal-offset="[[horizontalOffset]]" vertical-offset="[[verticalOffset]]" no-overlap="[[noOverlap]]" open-animation-config="[[openAnimationConfig]]" close-animation-config="[[closeAnimationConfig]]" no-animations="[[noAnimations]]" focus-target="[[_dropdownContent]]" allow-outside-scroll="[[allowOutsideScroll]]" restore-focus-on-close="[[restoreFocusOnClose]]" on-iron-overlay-canceled="__onIronOverlayCanceled"><div slot="dropdown-content" class="dropdown-content"><slot id="content" name="dropdown-content"></slot></div></iron-dropdown></template><script>!function(){"use strict";var e={ANIMATION_CUBIC_BEZIER:"cubic-bezier(.3,.95,.5,1)",MAX_ANIMATION_TIME_MS:400},n=Polymer({is:"paper-menu-button",behaviors:[Polymer.IronA11yKeysBehavior,Polymer.IronControlState],properties:{opened:{type:Boolean,value:!1,notify:!0,observer:"_openedChanged"},horizontalAlign:{type:String,value:"left",reflectToAttribute:!0},verticalAlign:{type:String,value:"top",reflectToAttribute:!0},dynamicAlign:{type:Boolean},horizontalOffset:{type:Number,value:0,notify:!0},verticalOffset:{type:Number,value:0,notify:!0},noOverlap:{type:Boolean},noAnimations:{type:Boolean,value:!1},ignoreSelect:{type:Boolean,value:!1},closeOnActivate:{type:Boolean,value:!1},openAnimationConfig:{type:Object,value:function(){return[{name:"fade-in-animation",timing:{delay:100,duration:200}},{name:"paper-menu-grow-width-animation",timing:{delay:100,duration:150,easing:e.ANIMATION_CUBIC_BEZIER}},{name:"paper-menu-grow-height-animation",timing:{delay:100,duration:275,easing:e.ANIMATION_CUBIC_BEZIER}}]}},closeAnimationConfig:{type:Object,value:function(){return[{name:"fade-out-animation",timing:{duration:150}},{name:"paper-menu-shrink-width-animation",timing:{delay:100,duration:50,easing:e.ANIMATION_CUBIC_BEZIER}},{name:"paper-menu-shrink-height-animation",timing:{duration:200,easing:"ease-in"}}]}},allowOutsideScroll:{type:Boolean,value:!1},restoreFocusOnClose:{type:Boolean,value:!0},_dropdownContent:{type:Object}},hostAttributes:{role:"group","aria-haspopup":"true"},listeners:{"iron-activate":"_onIronActivate","iron-select":"_onIronSelect"},get contentElement(){for(var e=Polymer.dom(this.$.content).getDistributedNodes(),n=0,t=e.length;n<t;n++)if(e[n].nodeType===Node.ELEMENT_NODE)return e[n]},toggle:function(){this.opened?this.close():this.open()},open:function(){this.disabled||this.$.dropdown.open()},close:function(){this.$.dropdown.close()},_onIronSelect:function(e){this.ignoreSelect||this.close()},_onIronActivate:function(e){this.closeOnActivate&&this.close()},_openedChanged:function(e,n){e?(this._dropdownContent=this.contentElement,this.fire("paper-dropdown-open")):null!=n&&this.fire("paper-dropdown-close")},_disabledChanged:function(e){Polymer.IronControlState._disabledChanged.apply(this,arguments),e&&this.opened&&this.close()},__onIronOverlayCanceled:function(e){var n=e.detail,t=(Polymer.dom(n).rootTarget,this.$.trigger);Polymer.dom(n).path.indexOf(t)>-1&&e.preventDefault()}});Object.keys(e).forEach(function(t){n[t]=e[t]}),Polymer.PaperMenuButton=n}();</script></dom-module><iron-iconset-svg name="paper-dropdown-menu" size="24"><svg><defs><g id="arrow-drop-down"><path d="M7 10l5 5 5-5z"></path></g></defs></svg></iron-iconset-svg><dom-module id="paper-dropdown-menu-shared-styles" assetpath="../bower_components/paper-dropdown-menu/"><template><style>:host{display:inline-block;position:relative;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;--paper-input-container-input:{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;max-width:100%;box-sizing:border-box;cursor:pointer;};@apply --paper-dropdown-menu;}:host([disabled]){@apply --paper-dropdown-menu-disabled;}:host([noink]) paper-ripple{display:none;}:host([no-label-float]) paper-ripple{top:8px;}paper-ripple{top:12px;left:0px;bottom:8px;right:0px;@apply --paper-dropdown-menu-ripple;}paper-menu-button{display:block;padding:0;@apply --paper-dropdown-menu-button;}paper-input{@apply --paper-dropdown-menu-input;}iron-icon{color:var(--disabled-text-color);@apply --paper-dropdown-menu-icon;}</style></template></dom-module><dom-module id="paper-dropdown-menu" assetpath="../bower_components/paper-dropdown-menu/"><template><style include="paper-dropdown-menu-shared-styles"></style><span role="button"></span><paper-menu-button id="menuButton" vertical-align="[[verticalAlign]]" horizontal-align="[[horizontalAlign]]" dynamic-align="[[dynamicAlign]]" vertical-offset="[[_computeMenuVerticalOffset(noLabelFloat)]]" disabled="[[disabled]]" no-animations="[[noAnimations]]" on-iron-select="_onIronSelect" on-iron-deselect="_onIronDeselect" opened="{{opened}}" close-on-activate="" allow-outside-scroll="[[allowOutsideScroll]]" restore-focus-on-close="[[restoreFocusOnClose]]"><div class="dropdown-trigger" slot="dropdown-trigger"><paper-ripple></paper-ripple><paper-input type="text" invalid="[[invalid]]" readonly="" disabled="[[disabled]]" value="[[selectedItemLabel]]" placeholder="[[placeholder]]" error-message="[[errorMessage]]" always-float-label="[[alwaysFloatLabel]]" no-label-float="[[noLabelFloat]]" label="[[label]]"><iron-icon icon="paper-dropdown-menu:arrow-drop-down" suffix="" slot="suffix"></iron-icon></paper-input></div><slot id="content" name="dropdown-content" slot="dropdown-content"></slot></paper-menu-button></template><script>!function(){"use strict";Polymer({is:"paper-dropdown-menu",behaviors:[Polymer.IronButtonState,Polymer.IronControlState,Polymer.IronFormElementBehavior,Polymer.IronValidatableBehavior],properties:{selectedItemLabel:{type:String,notify:!0,readOnly:!0},selectedItem:{type:Object,notify:!0,readOnly:!0},value:{type:String,notify:!0,readOnly:!0},label:{type:String},placeholder:{type:String},errorMessage:{type:String},opened:{type:Boolean,notify:!0,value:!1,observer:"_openedChanged"},allowOutsideScroll:{type:Boolean,value:!1},noLabelFloat:{type:Boolean,value:!1,reflectToAttribute:!0},alwaysFloatLabel:{type:Boolean,value:!1},noAnimations:{type:Boolean,value:!1},horizontalAlign:{type:String,value:"right"},verticalAlign:{type:String,value:"top"},dynamicAlign:{type:Boolean},restoreFocusOnClose:{type:Boolean,value:!0}},listeners:{tap:"_onTap"},keyBindings:{"up down":"open",esc:"close"},hostAttributes:{role:"combobox","aria-autocomplete":"none","aria-haspopup":"true"},observers:["_selectedItemChanged(selectedItem)"],attached:function(){var e=this.contentElement;e&&e.selectedItem&&this._setSelectedItem(e.selectedItem)},get contentElement(){for(var e=Polymer.dom(this.$.content).getDistributedNodes(),t=0,n=e.length;t<n;t++)if(e[t].nodeType===Node.ELEMENT_NODE)return e[t]},open:function(){this.$.menuButton.open()},close:function(){this.$.menuButton.close()},_onIronSelect:function(e){this._setSelectedItem(e.detail.item)},_onIronDeselect:function(e){this._setSelectedItem(null)},_onTap:function(e){Polymer.Gestures.findOriginalTarget(e)===this&&this.open()},_selectedItemChanged:function(e){var t="";t=e?e.label||e.getAttribute("label")||e.textContent.trim():"",this._setValue(t),this._setSelectedItemLabel(t)},_computeMenuVerticalOffset:function(e){return e?-4:8},_getValidity:function(e){return this.disabled||!this.required||this.required&&!!this.value},_openedChanged:function(){var e=this.opened?"true":"false",t=this.contentElement;t&&t.setAttribute("aria-expanded",e)}})}();</script></dom-module><dom-module id="paper-listbox" assetpath="../bower_components/paper-listbox/"><template><style>:host{display:block;padding:8px 0;background:var(--paper-listbox-background-color, var(--primary-background-color));color:var(--paper-listbox-color, var(--primary-text-color));@apply --paper-listbox;}</style><slot></slot></template><script>Polymer({is:"paper-listbox",behaviors:[Polymer.IronMenuBehavior],hostAttributes:{role:"listbox"}});</script></dom-module><script>Polymer.PaperItemBehaviorImpl={hostAttributes:{role:"option",tabindex:"0"}},Polymer.PaperItemBehavior=[Polymer.IronButtonState,Polymer.IronControlState,Polymer.PaperItemBehaviorImpl];</script><dom-module id="paper-item-shared-styles" assetpath="../bower_components/paper-item/"><template><style>:host, .paper-item{display:block;position:relative;min-height:var(--paper-item-min-height, 48px);padding:0px 16px;}.paper-item{@apply --paper-font-subhead;border:none;outline:none;background:white;width:100%;text-align:left;}:host([hidden]), .paper-item[hidden]{display:none !important;}:host(.iron-selected), .paper-item.iron-selected{font-weight:var(--paper-item-selected-weight, bold);@apply --paper-item-selected;}:host([disabled]), .paper-item[disabled]{color:var(--paper-item-disabled-color, var(--disabled-text-color));@apply --paper-item-disabled;}:host(:focus), .paper-item:focus{position:relative;outline:0;@apply --paper-item-focused;}:host(:focus):before, .paper-item:focus:before{@apply --layout-fit;background:currentColor;content:'';opacity:var(--dark-divider-opacity);pointer-events:none;@apply --paper-item-focused-before;}</style></template></dom-module><dom-module id="paper-item" assetpath="../bower_components/paper-item/"><template><style include="paper-item-shared-styles"></style><style>:host{@apply --layout-horizontal;@apply --layout-center;@apply --paper-font-subhead;@apply --paper-item;}</style><slot></slot></template><script>Polymer({is:"paper-item",behaviors:[Polymer.PaperItemBehavior]});</script></dom-module><dom-module id="state-card-input_select" assetpath="state-summary/"><template><style>:host{display:block;}state-badge{float:left;margin-top:10px;}paper-dropdown-menu{display:block;margin-left:53px;}paper-item{cursor:pointer;}</style><state-badge state-obj="[[stateObj]]"></state-badge><paper-dropdown-menu on-tap="stopPropagation" selected-item-label="{{selectedOption}}" label="[[computeStateName(stateObj)]]"><paper-listbox slot="dropdown-content" selected="[[computeSelected(stateObj)]]"><template is="dom-repeat" items="[[stateObj.attributes.options]]"><paper-item>[[item]]</paper-item></template></paper-listbox></paper-dropdown-menu></template></dom-module><script>Polymer({is:"state-card-input_select",properties:{hass:{type:Object},inDialog:{type:Boolean,value:!1},stateObj:{type:Object},selectedOption:{type:String,observer:"selectedOptionChanged"}},computeStateName:function(t){return window.hassUtil.computeStateName(t)},computeSelected:function(t){return t.attributes.options.indexOf(t.state)},selectedOptionChanged:function(t){""!==t&&t!==this.stateObj.state&&this.hass.callService("input_select","select_option",{option:t,entity_id:this.stateObj.entity_id})},stopPropagation:function(t){t.stopPropagation()}});</script><dom-module id="state-card-input_slider" assetpath="state-summary/"><template><style is="custom-style" include="iron-flex iron-flex-alignment"></style><style>paper-slider{margin-left:16px;}</style><div class="horizontal justified layout"><state-info state-obj="[[stateObj]]" in-dialog="[[inDialog]]"></state-info><paper-slider min="[[min]]" max="[[max]]" value="{{value}}" step="[[step]]" pin="" on-change="selectedValueChanged" on-tap="stopPropagation"></paper-slider></div></template></dom-module><script>Polymer({is:"state-card-input_slider",properties:{hass:{type:Object},inDialog:{type:Boolean,value:!1},stateObj:{type:Object,observer:"stateObjectChanged"},min:{type:Number,value:0},max:{type:Number,value:100},step:{type:Number},value:{type:Number}},stateObjectChanged:function(e){this.min=Number(e.attributes.min),this.max=Number(e.attributes.max),this.step=Number(e.attributes.step),this.value=Number(e.state)},selectedValueChanged:function(){this.value!==Number(this.stateObj.state)&&this.hass.callService("input_slider","select_value",{value:this.value,entity_id:this.stateObj.entity_id})},stopPropagation:function(e){e.stopPropagation()}});</script><dom-module id="state-card-media_player" assetpath="state-summary/"><template><style is="custom-style" include="iron-flex iron-flex-alignment"></style><style>:host{line-height:1.5;}.state{@apply (--paper-font-common-nowrap);@apply (--paper-font-body1);margin-left:16px;text-align:right;}.main-text{@apply (--paper-font-common-nowrap);color:var(--primary-text-color);text-transform:capitalize;}.main-text[take-height]{line-height:40px;}.secondary-text{@apply (--paper-font-common-nowrap);color:var(--secondary-text-color);}</style><div class="horizontal justified layout"><state-info state-obj="[[stateObj]]" in-dialog="[[inDialog]]"></state-info><div class="state"><div class="main-text" take-height$="[[!playerObj.secondaryText]]">[[playerObj.primaryText]]</div><div class="secondary-text">[[playerObj.secondaryText]]</div></div></div></template></dom-module><script>Polymer({PLAYING_STATES:["playing","paused"],is:"state-card-media_player",properties:{hass:{type:Object},inDialog:{type:Boolean,value:!1},stateObj:{type:Object},playerObj:{type:Object,computed:"computePlayerObj(hass, stateObj)"}},computePlayerObj:function(e,t){return new window.MediaPlayerEntity(e,t)}});</script><dom-module id="state-card-scene" assetpath="state-summary/"><template><style is="custom-style" include="iron-flex iron-flex-alignment"></style><style>paper-button{color:var(--primary-color);font-weight:500;top:3px;height:37px;margin-right:-.57em;}</style><div class="horizontal justified layout"><state-info state-obj="[[stateObj]]" in-dialog="[[inDialog]]"></state-info><paper-button on-tap="activateScene">ACTIVATE</paper-button></div></template></dom-module><script>Polymer({is:"state-card-scene",properties:{hass:{type:Object},inDialog:{type:Boolean,value:!1},stateObj:{type:Object}},activateScene:function(e){e.stopPropagation(),this.hass.callService("scene","turn_on",{entity_id:this.stateObj.entity_id})}});</script><dom-module id="state-card-script" assetpath="state-summary/"><template><style is="custom-style" include="iron-flex iron-flex-alignment"></style><style>paper-button{color:var(--primary-color);font-weight:500;top:3px;height:37px;margin-right:-.57em;}ha-entity-toggle{margin-left:16px;}</style><div class="horizontal justified layout"><state-info state-obj="[[stateObj]]" in-dialog="[[inDialog]]"></state-info><template is="dom-if" if="[[stateObj.attributes.can_cancel]]"><ha-entity-toggle state-obj="[[stateObj]]" hass="[[hass]]"></ha-entity-toggle></template><template is="dom-if" if="[[!stateObj.attributes.can_cancel]]"><paper-button on-tap="fireScript">ACTIVATE</paper-button></template></div></template></dom-module><script>Polymer({is:"state-card-script",properties:{inDialog:{type:Boolean,value:!1},stateObj:{type:Object}},fireScript:function(t){t.stopPropagation(),this.hass.callService("script","turn_on",{entity_id:this.stateObj.entity_id})}});</script><dom-module id="state-card-toggle" assetpath="state-summary/"><template><style is="custom-style" include="iron-flex iron-flex-alignment"></style><style>ha-entity-toggle{margin-left:16px;}</style><div class="horizontal justified layout"><state-info state-obj="[[stateObj]]" in-dialog="[[inDialog]]"></state-info><ha-entity-toggle state-obj="[[stateObj]]" hass="[[hass]]"></ha-entity-toggle></div></template></dom-module><script>Polymer({is:"state-card-toggle",properties:{hass:{type:Object},inDialog:{type:Boolean,value:!1},stateObj:{type:Object}}});</script><dom-module id="state-card-weblink" assetpath="state-summary/"><template><style>:host{display:block;}.name{@apply (--paper-font-common-nowrap);@apply (--paper-font-body1);color:var(--primary-color);text-transform:capitalize;line-height:40px;margin-left:16px;}</style><state-badge state-obj="[[stateObj]]" in-dialog="[[inDialog]]"></state-badge><a href$="[[stateObj.state]]" target="_blank" class="name" id="link">[[computeStateName(stateObj)]]</a></template></dom-module><script>Polymer({is:"state-card-weblink",properties:{inDialog:{type:Boolean,value:!1},stateObj:{type:Object}},listeners:{tap:"onTap"},computeStateName:function(t){return window.hassUtil.computeStateName(t)},onTap:function(t){t.stopPropagation(),t.target!==this.$.link&&window.open(this.stateObj.state,"_blank")}});</script><script>Polymer({is:"state-card-content",properties:{hass:{type:Object},inDialog:{type:Boolean,value:!1},stateObj:{type:Object}},observers:["inputChanged(hass, inDialog, stateObj)"],_ensureCustomUILoaded:function(t){this.importHref("/local/custom_ui/state-card-"+t+".html",function(){},function(){console.error("Error loading %s from /local/custom_ui/state-card-%s.html",t,t)},!0)},inputChanged:function(t,e,s){var a;s&&t&&(s.attributes&&"custom_ui_state_card"in s.attributes?(a=s.attributes.custom_ui_state_card,this._ensureCustomUILoaded(a)):a=window.hassUtil.stateCardType(t,s),window.hassUtil.dynamicContentUpdater(this,"STATE-CARD-"+a.toUpperCase(),{hass:t,stateObj:s,inDialog:e}))}});</script><dom-module id="ha-entities-card" assetpath="cards/"><template><style is="custom-style" include="iron-flex"></style><style>.states{padding-bottom:16px;}.state{padding:4px 16px;cursor:pointer;}.header{@apply (--paper-font-headline);line-height:40px;color:var(--primary-text-color);padding:20px 16px 12px;}.header .name{@apply (--paper-font-common-nowrap);}.header.domain .name{text-transform:capitalize;}ha-entity-toggle{margin-left:16px;}.header-more-info{cursor:pointer;}</style><ha-card><div class$="[[computeTitleClass(groupEntity)]]" on-tap="entityTapped"><div class="flex name">[[computeTitle(states, groupEntity)]]</div><template is="dom-if" if="[[showGroupToggle(groupEntity, states)]]"><ha-entity-toggle hass="[[hass]]" state-obj="[[groupEntity]]"></ha-entity-toggle></template></div><div class="states"><template is="dom-repeat" items="[[states]]"><div class="state" on-tap="entityTapped"><state-card-content hass="[[hass]]" class="state-card" state-obj="[[item]]"></state-card-content></div></template></div></ha-card></template></dom-module><script>Polymer({is:"ha-entities-card",properties:{hass:{type:Object},states:{type:Array},groupEntity:{type:Object}},computeTitle:function(t,e){return e?window.hassUtil.computeStateName(e):window.hassUtil.computeDomain(t[0]).replace(/_/g," ")},computeTitleClass:function(t){var e="header horizontal layout center ";return e+=t?"header-more-info":"domain"},entityTapped:function(t){var e;t.target.classList.contains("paper-toggle-button")||t.target.classList.contains("paper-icon-button")||!t.model&&!this.groupEntity||(t.stopPropagation(),e=t.model?t.model.item.entity_id:this.groupEntity.entity_id,this.fire("hass-more-info",{entityId:e}))},showGroupToggle:function(t,e){if(!t||!e||"hidden"===t.attributes.control||"on"!==t.state&&"off"!==t.state)return!1;for(var o=0,i=0;i<e.length&&!(window.hassUtil.canToggleState(this.hass,e[i])&&++o>1);i++);return o>1}});</script><dom-module id="ha-introduction-card" assetpath="cards/"><template><style>:host{@apply (--paper-font-body1);}a{color:var(--dark-primary-color);}ul{margin:8px;padding-left:16px;}li{margin-bottom:8px;}.content{padding:0 16px 16px;}.install{display:block;line-height:1.5em;margin-top:8px;margin-bottom:16px;}</style><ha-card header="Welcome Home!"><div class="content"><template is="dom-if" if="[[hass.demo]]">To install Home Assistant, run:<br><code class="install">pip3 install homeassistant<br>hass --open-ui</code></template>Here are some resources to get you started.<ul><template is="dom-if" if="[[hass.demo]]"><li><a href="https://home-assistant.io/getting-started/">Home Assistant website</a></li><li><a href="https://home-assistant.io/getting-started/">Installation instructions</a></li><li><a href="https://home-assistant.io/getting-started/troubleshooting/">Troubleshooting your installation</a></li></template><li><a href="https://home-assistant.io/getting-started/configuration/" target="_blank">Configuring Home Assistant </a></li><li><a href="https://home-assistant.io/components/" target="_blank">Available components </a></li><li><a href="https://home-assistant.io/getting-started/troubleshooting-configuration/" target="_blank">Troubleshooting your configuration</a></li><li><a href="https://home-assistant.io/help/" target="_blank">Ask the community for help </a></li></ul><template is="dom-if" if="[[showHideInstruction]]">To remove this card, edit your config in <code>configuration.yaml</code> and disable the <code>introduction</code> component.</template></div></ha-card></template></dom-module><script>Polymer({is:"ha-introduction-card",properties:{hass:{type:Object},showHideInstruction:{type:Boolean,value:!0}}});</script><script>!function(){function t(t,e){Object.defineProperty(window.MediaPlayerEntity.prototype,t,{get:e})}window.MediaPlayerEntity=function(t,e){this.hass=t,this.stateObj=e},t("isOff",function(){return"off"===this.stateObj.state}),t("isIdle",function(){return"idle"===this.stateObj.state}),t("isMuted",function(){return this.stateObj.attributes.is_volume_muted}),t("isPaused",function(){return"paused"===this.stateObj.state}),t("isPlaying",function(){return"playing"===this.stateObj.state}),t("isMusic",function(){return"music"===this.stateObj.attributes.media_content_type}),t("isTVShow",function(){return"tvshow"===this.stateObj.attributes.media_content_type}),t("hasMediaControl",function(){return-1!==["playing","paused","unknown"].indexOf(this.stateObj.state)}),t("volumeSliderValue",function(){return 100*this.stateObj.attributes.volume_level}),t("showProgress",function(){return(this.isPlaying||this.isPaused)&&"media_position"in this.stateObj.attributes&&"media_position_updated_at"in this.stateObj.attributes}),t("currentProgress",function(){return this.stateObj.attributes.media_position+(Date.now()-new Date(this.stateObj.attributes.media_position_updated_at))/1e3}),t("supportsPause",function(){return 0!=(1&this.stateObj.attributes.supported_features)}),t("supportsVolumeSet",function(){return 0!=(4&this.stateObj.attributes.supported_features)}),t("supportsVolumeMute",function(){return 0!=(8&this.stateObj.attributes.supported_features)}),t("supportsPreviousTrack",function(){return 0!=(16&this.stateObj.attributes.supported_features)}),t("supportsNextTrack",function(){return 0!=(32&this.stateObj.attributes.supported_features)}),t("supportsTurnOn",function(){return 0!=(128&this.stateObj.attributes.supported_features)}),t("supportsTurnOff",function(){return 0!=(256&this.stateObj.attributes.supported_features)}),t("supportsPlayMedia",function(){return 0!=(512&this.stateObj.attributes.supported_features)}),t("supportsVolumeButtons",function(){return 0!=(1024&this.stateObj.attributes.supported_features)}),t("supportsPlay",function(){return 0!=(16384&this.stateObj.attributes.supported_features)}),t("primaryText",function(){return this.stateObj.attributes.media_title||window.hassUtil.computeStateState(this.stateObj)}),t("secondaryText",function(){if(this.isMusic)return this.stateObj.attributes.media_artist;if(this.isTVShow){var t=this.stateObj.attributes.media_series_title;return this.stateObj.attributes.media_season&&(t+=" S"+this.stateObj.attributes.media_season,this.stateObj.attributes.media_episode&&(t+="E"+this.stateObj.attributes.media_episode)),t}return this.stateObj.attributes.app_name?this.stateObj.attributes.app_name:""}),Object.assign(window.MediaPlayerEntity.prototype,{mediaPlayPause:function(){this.callService("media_play_pause")},nextTrack:function(){this.callService("media_next_track")},playbackControl:function(){this.callService("media_play_pause")},previousTrack:function(){this.callService("media_previous_track")},setVolume:function(t){this.callService("volume_set",{volume_level:t})},togglePower:function(){this.isOff?this.turnOn():this.turnOff()},turnOff:function(){this.callService("turn_off")},turnOn:function(){this.callService("turn_on")},volumeDown:function(){this.callService("volume_down")},volumeMute:function(t){if(!this.supportsVolumeMute)throw new Error("Muting volume not supported");this.callService("volume_mute",{is_volume_muted:t})},volumeUp:function(){this.callService("volume_up")},callService:function(t,e){var s=e||{};s.entity_id=this.stateObj.entity_id,this.hass.callService("media_player",t,s)}})}();</script><dom-module id="ha-media_player-card" assetpath="cards/"><template><style include="paper-material iron-flex iron-flex-alignment iron-positioning">:host{display:block;position:relative;font-size:0px;border-radius:2px;overflow:hidden;}.banner{position:relative;background-color:white;border-top-left-radius:2px;border-top-right-radius:2px;}.banner:before{display:block;content:"";width:100%;padding-top:56%;transition:padding-top .8s;}.banner.no-cover{background-position:center center;background-image:url(/static/images/card_media_player_bg.png);background-repeat:no-repeat;background-color:var(--primary-color);}.banner.content-type-music:before{padding-top:100%;}.banner.no-cover:before{padding-top:88px;}.banner > .cover{position:absolute;top:0;left:0;right:0;bottom:0;border-top-left-radius:2px;border-top-right-radius:2px;background-position:center center;background-size:cover;transition:opacity .8s;opacity:1;}.banner.is-off > .cover{opacity:0;}.banner > .caption{@apply (--paper-font-caption);position:absolute;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, var(--dark-secondary-opacity));padding:8px 16px;font-size:14px;font-weight:500;color:white;transition:background-color .5s;}.banner.is-off > .caption{background-color:initial;}.banner > .caption .title{@apply (--paper-font-common-nowrap);font-size:1.2em;margin:8px 0 4px;}.progress{width:100%;--paper-progress-active-color:var(--accent-color);--paper-progress-container-color:#FFF;}.controls{position:relative;@apply (--paper-font-body1);padding:8px;border-bottom-left-radius:2px;border-bottom-right-radius:2px;background-color:var(--paper-card-background-color, white);}.controls paper-icon-button{width:44px;height:44px;}paper-icon-button{opacity:var(--dark-primary-opacity);}paper-icon-button[disabled]{opacity:var(--dark-disabled-opacity);}paper-icon-button.primary{width:56px !important;height:56px !important;background-color:var(--primary-color);color:white;border-radius:50%;padding:8px;transition:background-color .5s;}paper-icon-button.primary[disabled]{background-color:rgba(0, 0, 0, var(--dark-disabled-opacity));}[invisible]{visibility:hidden !important;}</style><div class$="[[computeBannerClasses(playerObj)]]"><div class="cover" id="cover"></div><div class="caption">[[computeStateName(stateObj)]]<div class="title">[[playerObj.primaryText]]</div>[[playerObj.secondaryText]]<br></div></div><paper-progress max="[[stateObj.attributes.media_duration]]" value="[[playbackPosition]]" hidden$="[[computeHideProgress(playerObj)]]" class="progress"></paper-progress><div class="controls layout horizontal justified"><paper-icon-button icon="mdi:power" on-tap="handleTogglePower" invisible$="[[computeHidePowerButton(playerObj)]]" class="self-center secondary"></paper-icon-button><div><paper-icon-button icon="mdi:skip-previous" invisible$="[[!playerObj.supportsPreviousTrack]]" disabled="[[playerObj.isOff]]" on-tap="handlePrevious"></paper-icon-button><paper-icon-button class="primary" icon="[[computePlaybackControlIcon(playerObj)]]" invisible$="[[!computePlaybackControlIcon(playerObj)]]" disabled="[[playerObj.isOff]]" on-tap="handlePlaybackControl"></paper-icon-button><paper-icon-button icon="mdi:skip-next" invisible$="[[!playerObj.supportsNextTrack]]" disabled="[[playerObj.isOff]]" on-tap="handleNext"></paper-icon-button></div><paper-icon-button icon="mdi:dots-vertical" on-tap="handleOpenMoreInfo" class="self-center secondary"></paper-icon-button></div></template></dom-module><script>Polymer({is:"ha-media_player-card",properties:{hass:{type:Object},stateObj:{type:Object},playerObj:{type:Object,computed:"computePlayerObj(hass, stateObj)",observer:"playerObjChanged"},playbackControlIcon:{type:String,computed:"computePlaybackControlIcon(playerObj)"},playbackPosition:{type:Number},elevation:{type:Number,value:1,reflectToAttribute:!0}},created:function(){this.updatePlaybackPosition=this.updatePlaybackPosition.bind(this)},playerObjChanged:function(t){var e,o=t.stateObj.attributes.entity_picture;o?((e=document.createElement("IMG")).onload=function(){this.$.cover.style.backgroundImage="url("+o+")",e.onerror=e.onload=null,e.src="",e=null}.bind(this),e.onerror=function(){this.$.cover.style.backgroundImage="",this.toggleClass("no-cover",!0,this.$.cover.parentElement),e.onerror=e.onload=null,e.src="",e=null}.bind(this),this._timeout_id&&clearTimeout(this._timeout_id),this._timeout_id=setTimeout(function(){e&&(this.$.cover.style.backgroundImage=""),this._timeout_id=null},5e3),e.src=o):this.$.cover.style.backgroundImage="",t.isPlaying?(this._positionTracking||(this._positionTracking=setInterval(this.updatePlaybackPosition,1e3)),this.updatePlaybackPosition()):this._positionTracking&&(clearInterval(this._positionTracking),this._positionTracking=null,this.playbackPosition=0)},updatePlaybackPosition:function(){this.playbackPosition=this.playerObj.currentProgress},computeBannerClasses:function(t){var e="banner";return t.isOff||t.isIdle?e+=" is-off no-cover":t.stateObj.attributes.entity_picture?"music"===t.stateObj.attributes.media_content_type&&(e+=" content-type-music"):e+=" no-cover",e},computeHideProgress:function(t){return!t.showProgress},computeHidePowerButton:function(t){return t.isOff?!t.supportsTurnOn:!t.supportsTurnOff},computePlayerObj:function(t,e){return new window.MediaPlayerEntity(t,e)},computePlaybackControlIcon:function(t){return t.isPlaying?t.supportsPause?"mdi:pause":"mdi:stop":t.isPaused||t.isOff||t.isIdle?t.supportsPlay?"mdi:play":null:""},computeStateName:function(t){return window.hassUtil.computeStateName(t)},handleNext:function(t){t.stopPropagation(),this.playerObj.nextTrack()},handleOpenMoreInfo:function(t){t.stopPropagation(),this.fire("hass-more-info",{entityId:this.stateObj.entity_id})},handlePlaybackControl:function(t){t.stopPropagation(),this.playerObj.mediaPlayPause()},handlePrevious:function(t){t.stopPropagation(),this.playerObj.previousTrack()},handleTogglePower:function(t){t.stopPropagation(),this.playerObj.togglePower()}});</script><dom-module id="ha-attributes" assetpath="components/"><template><style is="custom-style" include="iron-flex iron-flex-alignment"></style><style>.data-entry .value{max-width:200px;}.attribution{color:var(--secondary-text-color);text-align:right;}</style><div class="layout vertical"><template is="dom-repeat" items="[[computeDisplayAttributes(stateObj, filtersArray)]]" as="attribute"><div class="data-entry layout justified horizontal"><div class="key">[[formatAttribute(attribute)]]</div><div class="value">[[formatAttributeValue(stateObj, attribute)]]</div></div></template><div class="attribution" hidden$="[[!computeAttribution(stateObj)]]">[[computeAttribution(stateObj)]]</div></div></template></dom-module><script>!function(){"use strict";Polymer({is:"ha-attributes",properties:{stateObj:{type:Object},extraFilters:{type:String,value:""},filtersArray:{type:Array,computed:"computeFiltersArray(extraFilters)"}},computeFiltersArray:function(t){return window.hassUtil.LOGIC_STATE_ATTRIBUTES+(t?t.split(","):[])},computeDisplayAttributes:function(t,r){return t?Object.keys(t.attributes).filter(function(t){return-1===r.indexOf(t)}):[]},formatAttribute:function(t){return t.replace(/_/g," ")},formatAttributeValue:function(t,r){var e=t.attributes[r];return Array.isArray(e)?e.join(", "):e instanceof Object?JSON.stringify(e,null,2):e},computeAttribution:function(t){return t.attributes.attribution}})}();</script><dom-module id="ha-weather-card" assetpath="cards/"><template><style>.content{padding:0 16px 16px;}.attribution{color:var(--secondary-text-color);text-align:right;}tr.temphigh span{color:red;font-weight:600;}tr.templow span{color:blue;}tr.date span{color:darkgrey;font-weight:600;}.content td{text-align:center;vertical-align:middle;overflow-x:hidden;}tr.cond td{overflow-x:hidden;overflow-y:visible;text-align:center;vertical-align:middle;width:0%;height:2.4em;}tr.cond td div{font-size:2em;margin-left:-2em;transform:translateX(1em);}.forecast td:first-child{background-color:#ddd;}.forecast td:nth-child(2n+3){background-color:#eee;}table, tr, td{border:0;padding:0;border-spacing:0;}.currentcond{text-align:center;vertical-align:middle;}td.pw_small span{font-size:2.4em;}td.pw_small{width:25%;height:2.6em;}td.pw_smallp span{font-size:1.2em;}td.pw_large span{font-size:6em;}</style><ha-card header="[[computeTitle(stateObj)]]"><div class="content"><table class="currentcond" width="100%"><tbody><tr><td class="pw_small"><span>[[stateObj.attributes.temperature]]°</span></td><td rowspan="2" class="pw_large"><span>[[nowCond]]</span></td><td class="pw_small"><span>[[stateObj.attributes.humidity]]%</span></td></tr><tr><td class="pw_smallp"><span>[[windBearing]]<br>[[stateObj.attributes.wind_speed]]</span></td><td class="pw_smallp"><span>Visual<br>[[stateObj.attributes.visibility]]</span></td></tr></tbody></table><br><table class="forecast" width="100%"><tbody><tr class="cond"><template is="dom-repeat" items="[[data.cond]]"><td><div>[[item]]</div></td></template></tr><tr class="temphigh"><template is="dom-repeat" items="[[data.temphigh]]"><td><span>[[item]]</span></td></template></tr><tr class="templow"><template is="dom-repeat" items="[[data.templow]]"><td><span>[[item]]</span></td></template></tr><tr class="date"><template is="dom-repeat" items="[[data.date]]"><td><span>[[item]]</span></td></template></tr></tbody></table></div></ha-card></template></dom-module><script>!function(){"use strict";var t={cloudy:"🌫",fog:"🌫",hail:"Hail",lightning:"🌩","lightning-rainy":"⛈",partlycloudy:"⛅",pouring:"🌢",rainy:"🌧",snowy:"🌨","snowy-rainy":"SR",sunny:"☀",windy:"🌬","windy-variant":"[]",exceptional:"!!"},e=["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW","N"];Polymer({is:"ha-weather-card",properties:{hass:{type:Object},stateObj:{type:Object,observer:"checkRequirements"}},computeTitle:function(t){return t.attributes.friendly_name},getDataArray:function(){var e,i=this.stateObj.attributes.forecast;if(!this.stateObj.attributes.forecast)return[];var a=[],n=[],r=[],s=[];for(e=0;e<i.length;e++)a.push(new Date(i[e].datetime).getDate()),n.push(i[e].temperature),r.push(i[e].templow),s.push(t[i[e].condition]);return{date:a,cond:s,temphigh:n,templow:r}},checkRequirements:function(){this.stateObj&&this.stateObj.attributes&&this.stateObj.attributes.forecast&&(this.nowCond=t[this.stateObj.state],this.windBearing=this.windBearingToText(this.stateObj.attributes.windBearing),this.data=this.getDataArray())},windBearingToText:function(t){return e[(parseInt(t)+5.63)/11.25|0]}})}();</script><dom-module id="ha-persistent_notification-card" assetpath="cards/"><template><style>:host{@apply (--paper-font-body1);}.content{padding:0 16px 16px;-ms-user-select:initial;-webkit-user-select:initial;-moz-user-select:initial;}paper-button{margin:8px;font-weight:500;}</style><ha-card header="[[computeTitle(stateObj)]]"><div id="pnContent" class="content"></div><paper-button on-tap="dismissTap">DISMISS</paper-button></ha-card></template></dom-module><script>Polymer({is:"ha-persistent_notification-card",properties:{hass:{type:Object},stateObj:{type:Object},scriptLoaded:{type:Boolean,value:!1}},observers:["computeContent(stateObj, scriptLoaded)"],computeTitle:function(t){return t.attributes.title||window.hassUtil.computeStateName(t)},loadScript:function(){var t=function(){this.scriptLoaded=!0}.bind(this);this.importHref("/static/micromarkdown-js.html",t,function(){console.error("Micromarkdown was not loaded.")})},computeContent:function(t,e){var i="",o="";e&&(i=this.$.pnContent,o=window.micromarkdown.parse(t.state),i.innerHTML=o)},ready:function(){this.loadScript()},dismissTap:function(t){t.preventDefault(),this.hass.callApi("DELETE","states/"+this.stateObj.entity_id)}});</script><script>Polymer({is:"ha-card-chooser",properties:{cardData:{type:Object,observer:"cardDataChanged"}},cardDataChanged:function(a){a&&window.hassUtil.dynamicContentUpdater(this,"HA-"+a.cardType.toUpperCase()+"-CARD",a)}});</script><dom-module id="ha-cards" assetpath="components/"><template><style is="custom-style" include="iron-flex iron-flex-factors"></style><style>:host{display:block;padding-top:8px;padding-right:8px;}.badges{font-size:85%;text-align:center;}.column{max-width:500px;overflow-x:hidden;}.zone-card{margin-left:8px;margin-bottom:8px;}@media (max-width: 500px){:host{padding-right:0;}.zone-card{margin-left:0;}}@media (max-width: 599px){.column{max-width:600px;}}</style><div class="main"><template is="dom-if" if="[[cards.badges]]"><div class="badges"><template is="dom-if" if="[[cards.demo]]"><ha-demo-badge></ha-demo-badge></template><ha-badges-card states="[[cards.badges]]" hass="[[hass]]"></ha-badges-card></div></template><div class="horizontal layout center-justified"><template is="dom-repeat" items="[[cards.columns]]" as="column"><div class="column flex-1"><template is="dom-repeat" items="[[column]]" as="card"><div class="zone-card"><ha-card-chooser card-data="[[card]]" hass="[[hass]]"></ha-card-chooser></div></template></div></template></div></div></template></dom-module><script>!function(){"use strict";function t(t){return t in o?o[t]:100}function e(t,e){return t.priority-e.priority}function n(t,e){var n=(t.attributes.friendly_name||t.entity_id).toLowerCase(),s=(e.attributes.friendly_name||e.entity_id).toLowerCase();return n<s?-1:n>s?1:0}function s(t,s){Object.keys(t).map(function(e){return t[e]}).sort(e).forEach(function(t){t.states.sort(n),s(t)})}var i={camera:4,media_player:3,persistent_notification:0,weather:4},o={configurator:-20,persistent_notification:-15,updater:0,sun:1,device_tracker:2,alarm_control_panel:3,sensor:5,binary_sensor:6},r=window.hassUtil.computeDomain;Polymer({is:"ha-cards",properties:{hass:{type:Object},showIntroduction:{type:Boolean,value:!1},columns:{type:Number,value:2},states:{type:Object},panelVisible:{type:Boolean},viewVisible:{type:Boolean,value:!1},cards:{type:Object}},observers:["updateCards(columns, states, showIntroduction, panelVisible, viewVisible)"],updateCards:function(t,e,n,s,i){s&&i&&this.debounce("updateCards",function(){this.panelVisible&&this.viewVisible&&(this.cards=this.computeCards(t,e,n))}.bind(this),10)},computeCards:function(e,n,o){function a(t){var e=0;for(c=0;c<l.length;c++){if(l[c]<5){e=c;break}l[c]<l[e]&&(e=c)}return l[e]+=t,e}function u(t,e,n){var s,o,u,c;0!==e.length&&(s=[],o=[],u=0,e.forEach(function(t){var e=r(t);e in i?(s.push(t),u+=i[e]):(o.push(t),u++)}),u+=o.length>0,c=a(u),o.length>0&&d.columns[c].push({hass:p,cardType:"entities",states:o,groupEntity:n||!1}),s.forEach(function(t){d.columns[c].push({hass:p,cardType:r(t),stateObj:t})}))}var c,p=this.hass,d={demo:!1,badges:[],columns:[]},l=[];for(c=0;c<e;c++)d.columns.push([]),l.push(0);o&&d.columns[a(5)].push({hass:p,cardType:"introduction",showHideInstruction:n.size>0&&!window.HASS_DEMO});var h=window.HAWS.splitByGroups(n),f={},m={},y={};return Object.keys(h.ungrouped).forEach(function(e){var n=h.ungrouped[e],s=r(n);if("a"!==s){var i,o=t(s);s in(i=o<0?m:o<10?f:y)||(i[s]={domain:s,priority:o,states:[]}),i[s].states.push(n)}else d.demo=!0}),s(f,function(t){d.badges.push.apply(d.badges,t.states)}),s(m,function(t){u(t.domain,t.states)}),h.groups.forEach(function(t){var e=window.HAWS.getGroupEntities(n,t);u(t.entity_id,Object.keys(e).map(function(t){return e[t]}),t)}),s(y,function(t){u(t.domain,t.states)}),d.columns=d.columns.filter(function(t){return t.length>0}),d}})}();</script><dom-module id="partial-cards" assetpath="layouts/"><template><style include="iron-flex iron-positioning ha-style">:host{-ms-user-select:none;-webkit-user-select:none;-moz-user-select:none;}app-header-layout{background-color:var(--secondary-background-color, #E5E5E5);}paper-tabs{margin-left:12px;--paper-tabs-selection-bar-color:#FFF;text-transform:uppercase;}</style><app-route route="{{route}}" pattern="/:view" data="{{routeData}}" active="{{routeMatch}}"></app-route><app-header-layout has-scrolling-region="" id="layout"><app-header effects="waterfall" condenses="" fixed="" slot="header"><app-toolbar><ha-menu-button narrow="[[narrow]]" show-menu="[[showMenu]]"></ha-menu-button><div main-title="">[[computeTitle(views, locationName)]]</div><ha-start-voice-button hass="[[hass]]"></ha-start-voice-button></app-toolbar><div sticky="" hidden$="[[areTabsHidden(views, showTabs)]]"><paper-tabs scrollable="" selected="[[currentView]]" attr-for-selected="data-entity" on-iron-activate="handleViewSelected"><paper-tab data-entity="" on-tap="scrollToTop"><template is="dom-if" if="[[!defaultView]]">[[locationName]]</template><template is="dom-if" if="[[defaultView]]"><template is="dom-if" if="[[defaultView.attributes.icon]]"><iron-icon title$="[[computeStateName(defaultView)]]" icon="[[defaultView.attributes.icon]]"></iron-icon></template><template is="dom-if" if="[[!defaultView.attributes.icon]]">[[computeStateName(defaultView)]]</template></template></paper-tab><template is="dom-repeat" items="[[views]]"><paper-tab data-entity$="[[item.entity_id]]" on-tap="scrollToTop"><template is="dom-if" if="[[item.attributes.icon]]"><iron-icon title$="[[computeStateName(item)]]" icon="[[item.attributes.icon]]"></iron-icon></template><template is="dom-if" if="[[!item.attributes.icon]]">[[computeStateName(item)]]</template></paper-tab></template></paper-tabs></div></app-header><iron-pages attr-for-selected="data-view" selected="[[currentView]]" selected-attribute="view-visible"><ha-cards data-view="" show-introduction="[[computeShowIntroduction(currentView, introductionLoaded, viewStates)]]" states="[[viewStates]]" columns="[[_columns]]" hass="[[hass]]" panel-visible="[[panelVisible]]"></ha-cards><template is="dom-repeat" items="[[views]]"><ha-cards data-view$="[[item.entity_id]]" states="[[viewStates]]" columns="[[_columns]]" hass="[[hass]]" panel-visible="[[panelVisible]]"></ha-cards></template></iron-pages></app-header-layout></template></dom-module><script>Polymer({DEFAULT_VIEW_ENTITY_ID:"group.default_view",ALWAYS_SHOW_DOMAIN:["persistent_notification","configurator"],is:"partial-cards",properties:{hass:{type:Object,value:null,observer:"hassChanged"},narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,observer:"handleWindowChange"},panelVisible:{type:Boolean,value:!1},route:Object,routeData:Object,routeMatch:Boolean,_columns:{type:Number,value:1},introductionLoaded:{type:Boolean,computed:"computeIntroductionLoaded(hass)"},locationName:{type:String,value:"",computed:"computeLocationName(hass)"},currentView:{type:String,computed:"_computeCurrentView(routeMatch, routeData)"},views:{type:Array},defaultView:{type:Object},viewStates:{type:Object,computed:"computeViewStates(currentView, hass, defaultView)"},showTabs:{type:Boolean,value:!1}},created:function(){this.handleWindowChange=this.handleWindowChange.bind(this),this.mqls=[300,600,900,1200].map(function(t){var e=window.matchMedia("(min-width: "+t+"px)");return e.addListener(this.handleWindowChange),e}.bind(this))},detached:function(){this.mqls.forEach(function(t){t.removeListener(this.handleWindowChange)})},handleWindowChange:function(){var t=this.mqls.reduce(function(t,e){return t+e.matches},0);this._columns=Math.max(1,t-(!this.narrow&&this.showMenu))},areTabsHidden:function(t,e){return!t||!t.length||!e},scrollToTop:function(){var t=this.$.layout.header.scrollTarget,e=function(t,e,n,i){return t/=i,-n*t*(t-2)+e},n=Math.random(),i=Date.now(),a=t.scrollTop,o=0-a;this._currentAnimationId=n,function s(){var r=Date.now()-i;r>200?t.scrollTop=0:this._currentAnimationId===n&&(t.scrollTop=e(r,a,o,200),requestAnimationFrame(s.bind(this)))}.call(this)},handleViewSelected:function(t){var e=t.detail.item.getAttribute("data-entity")||null;if(e!==this.currentView){var n="/states";e&&(n+="/"+e),history.pushState(null,null,n),this.fire("location-changed")}},_computeCurrentView:function(t,e){return t?e.view:""},computeTitle:function(t,e){return t&&t.length>0?"Home Assistant":e},computeShowIntroduction:function(t,e,n){return""===t&&(e||0===n.size)},computeStateName:function(t){return t.entity_id===this.DEFAULT_VIEW_ENTITY_ID?t.attributes.friendly_name&&"default_view"!==t.attributes.friendly_name?t.attributes.friendly_name:this.computeLocationName(this.hass):window.hassUtil.computeStateName(t)},computeLocationName:function(t){return window.hassUtil.computeLocationName(t)},computeIntroductionLoaded:function(t){return window.hassUtil.isComponentLoaded(t,"introduction")},hassChanged:function(t){if(t){var e=window.HAWS.extractViews(t.states);e.length>0&&e[0].entity_id===this.DEFAULT_VIEW_ENTITY_ID?this.defaultView=e.shift():this.defaultView=null,this.views=e}},computeViewStates:function(t,e,n){var i,a,o,s,r=Object.keys(e.states);if(!t&&!n){for(s={},i=0;i<r.length;i++)a=r[i],(o=e.states[a]).attributes.hidden||(s[a]=o);return s}for(s=t?window.HAWS.getViewEntities(e.states,e.states[t]):window.HAWS.getViewEntities(e.states,e.states[this.DEFAULT_VIEW_ENTITY_ID]),i=0;i<r.length;i++)a=r[i],o=e.states[a],-1!==this.ALWAYS_SHOW_DOMAIN.indexOf(window.hassUtil.computeDomain(o))&&(s[a]=o);return s}});</script><dom-module id="hass-loading-screen" assetpath="layouts/"><template><style include="iron-flex ha-style">.placeholder{height:100%;}.layout{height:calc(100% - 64px);}</style><div class="placeholder"><app-toolbar><ha-menu-button narrow="[[narrow]]" show-menu="[[showMenu]]"></ha-menu-button><div main-title="">[[title]]</div></app-toolbar><div class="layout horizontal center-center"><paper-spinner active=""></paper-spinner></div></div></template></dom-module><script>Polymer({is:"hass-loading-screen",properties:{narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,value:!1},title:{type:String,value:""}}});</script><dom-module id="partial-panel-resolver" assetpath="layouts/"><template><style>[hidden]{display:none !important;}</style><app-route route="{{route}}" pattern="/:panel" data="{{routeData}}" tail="{{routeTail}}"></app-route><template is="dom-if" if="[[!resolved]]"><hass-loading-screen narrow="[[narrow]]" show-menu="[[showMenu]]"></hass-loading-screen></template><span id="panel" hidden$="[[!resolved]]"></span></template></dom-module><script>Polymer({is:"partial-panel-resolver",properties:{hass:{type:Object,observer:"updateAttributes"},narrow:{type:Boolean,value:!1,observer:"updateAttributes"},showMenu:{type:Boolean,value:!1,observer:"updateAttributes"},route:Object,routeData:Object,routeTail:{type:Object,observer:"updateAttributes"},resolved:{type:Boolean,value:!1},errorLoading:{type:Boolean,value:!1},panel:{type:Object,computed:"computeCurrentPanel(hass, routeData)",observer:"panelChanged"}},computeCurrentPanel:function(e,t){return t?e.config.panels[t.panel]:null},panelChanged:function(e){e?(this.resolved=!1,this.errorLoading=!1,this.importHref(e.url,function(){window.hassUtil.dynamicContentUpdater(this.$.panel,"ha-panel-"+e.component_name,{hass:this.hass,narrow:this.narrow,showMenu:this.showMenu,route:this.routeTail,panel:e}),this.resolved=!0}.bind(this),function(){this.errorLoading=!0}.bind(this),!0)):this.$.panel.lastChild&&this.$.panel.removeChild(this.$.panel.lastChild)},updateAttributes:function(){var e=Polymer.dom(this.$.panel).lastChild;e&&(e.hass=this.hass,e.narrow=this.narrow,e.showMenu=this.showMenu,e.route=this.routeTail)}});</script><script>!function(){"use strict";Polymer.PaperDialogBehaviorImpl={hostAttributes:{role:"dialog",tabindex:"-1"},properties:{modal:{type:Boolean,value:!1},__readied:{type:Boolean,value:!1}},observers:["_modalChanged(modal, __readied)"],listeners:{tap:"_onDialogClick"},ready:function(){this.__prevNoCancelOnOutsideClick=this.noCancelOnOutsideClick,this.__prevNoCancelOnEscKey=this.noCancelOnEscKey,this.__prevWithBackdrop=this.withBackdrop,this.__readied=!0},_modalChanged:function(i,e){e&&(i?(this.__prevNoCancelOnOutsideClick=this.noCancelOnOutsideClick,this.__prevNoCancelOnEscKey=this.noCancelOnEscKey,this.__prevWithBackdrop=this.withBackdrop,this.noCancelOnOutsideClick=!0,this.noCancelOnEscKey=!0,this.withBackdrop=!0):(this.noCancelOnOutsideClick=this.noCancelOnOutsideClick&&this.__prevNoCancelOnOutsideClick,this.noCancelOnEscKey=this.noCancelOnEscKey&&this.__prevNoCancelOnEscKey,this.withBackdrop=this.withBackdrop&&this.__prevWithBackdrop))},_updateClosingReasonConfirmed:function(i){this.closingReason=this.closingReason||{},this.closingReason.confirmed=i},_onDialogClick:function(i){for(var e=Polymer.dom(i).path,o=0,t=e.indexOf(this);o<t;o++){var n=e[o];if(n.hasAttribute&&(n.hasAttribute("dialog-dismiss")||n.hasAttribute("dialog-confirm"))){this._updateClosingReasonConfirmed(n.hasAttribute("dialog-confirm")),this.close(),i.stopPropagation();break}}}},Polymer.PaperDialogBehavior=[Polymer.IronOverlayBehavior,Polymer.PaperDialogBehaviorImpl]}();</script><dom-module id="paper-dialog-shared-styles" assetpath="../bower_components/paper-dialog-behavior/"><template><style>:host{display:block;margin:24px 40px;background:var(--paper-dialog-background-color, var(--primary-background-color));color:var(--paper-dialog-color, var(--primary-text-color));@apply --paper-font-body1;@apply --shadow-elevation-16dp;@apply --paper-dialog;}:host > ::slotted(*){margin-top:20px;padding:0 24px;}:host > ::slotted(.no-padding){padding:0;}:host > ::slotted(h2){position:relative;margin:0;@apply --paper-font-title;@apply --paper-dialog-title;}:host > ::slotted(*:first-child){margin-top:24px;}:host > ::slotted(*:last-child){margin-bottom:24px;}:host > ::slotted(.buttons){position:relative;padding:8px 8px 8px 24px;margin:0;color:var(--paper-dialog-button-color, var(--primary-color));@apply --layout-horizontal;@apply --layout-end-justified;}</style></template></dom-module><dom-module id="paper-dialog" assetpath="../bower_components/paper-dialog/"><template><style include="paper-dialog-shared-styles"></style><slot></slot></template></dom-module><script>!function(){"use strict";Polymer({is:"paper-dialog",behaviors:[Polymer.PaperDialogBehavior,Polymer.NeonAnimationRunnerBehavior],listeners:{"neon-animation-finish":"_onNeonAnimationFinish"},_renderOpened:function(){this.cancelAnimation(),this.playAnimation("entry")},_renderClosed:function(){this.cancelAnimation(),this.playAnimation("exit")},_onNeonAnimationFinish:function(){this.opened?this._finishRenderOpened():this._finishRenderClosed()}})}();</script><dom-module id="paper-dialog-scrollable" assetpath="../bower_components/paper-dialog-scrollable/"><template><style>:host{display:block;@apply --layout-relative;}:host(.is-scrolled:not(:first-child))::before{content:'';position:absolute;top:0;left:0;right:0;height:1px;background:var(--divider-color);}:host(.can-scroll:not(.scrolled-to-bottom):not(:last-child))::after{content:'';position:absolute;bottom:0;left:0;right:0;height:1px;background:var(--divider-color);}.scrollable{padding:0 24px;@apply --layout-scroll;@apply --paper-dialog-scrollable;}.fit{@apply --layout-fit;}</style><div id="scrollable" class="scrollable" on-scroll="updateScrollState"><slot></slot></div></template></dom-module><script>Polymer({is:"paper-dialog-scrollable",properties:{dialogElement:{type:Object}},get scrollTarget(){return this.$.scrollable},ready:function(){this._ensureTarget(),this.classList.add("no-padding")},attached:function(){this._ensureTarget(),requestAnimationFrame(this.updateScrollState.bind(this))},updateScrollState:function(){this.toggleClass("is-scrolled",this.scrollTarget.scrollTop>0),this.toggleClass("can-scroll",this.scrollTarget.offsetHeight<this.scrollTarget.scrollHeight),this.toggleClass("scrolled-to-bottom",this.scrollTarget.scrollTop+this.scrollTarget.offsetHeight>=this.scrollTarget.scrollHeight)},_ensureTarget:function(){this.dialogElement=this.dialogElement||this.parentElement,this.dialogElement&&this.dialogElement.behaviors&&this.dialogElement.behaviors.indexOf(Polymer.PaperDialogBehaviorImpl)>=0?(this.dialogElement.sizingTarget=this.scrollTarget,this.scrollTarget.classList.remove("fit")):this.dialogElement&&this.scrollTarget.classList.add("fit")}});</script><script>!function(){"use strict";Polymer.IronJsonpLibraryBehavior={properties:{libraryLoaded:{type:Boolean,value:!1,notify:!0,readOnly:!0},libraryErrorMessage:{type:String,value:null,notify:!0,readOnly:!0}},observers:["_libraryUrlChanged(libraryUrl)"],_libraryUrlChanged:function(r){this._isReady&&this.libraryUrl&&this._loadLibrary()},_libraryLoadCallback:function(r,i){r?(Polymer.Base._warn("Library load failed:",r.message),this._setLibraryErrorMessage(r.message)):(this._setLibraryErrorMessage(null),this._setLibraryLoaded(!0),this.notifyEvent&&this.fire(this.notifyEvent,i))},_loadLibrary:function(){r.require(this.libraryUrl,this._libraryLoadCallback.bind(this),this.callbackName)},ready:function(){this._isReady=!0,this.libraryUrl&&this._loadLibrary()}};var r={apiMap:{},require:function(r,t,e){var a=this.nameFromUrl(r);this.apiMap[a]||(this.apiMap[a]=new i(a,r,e)),this.apiMap[a].requestNotify(t)},nameFromUrl:function(r){return r.replace(/[\:\/\%\?\&\.\=\-\,]/g,"_")+"_api"}},i=function(r,i,t){if(this.notifiers=[],!t){if(!(i.indexOf(this.callbackMacro)>=0))return void(this.error=new Error("IronJsonpLibraryBehavior a %%callback%% parameter is required in libraryUrl"));t=r+"_loaded",i=i.replace(this.callbackMacro,t)}this.callbackName=t,window[this.callbackName]=this.success.bind(this),this.addScript(i)};i.prototype={callbackMacro:"%%callback%%",loaded:!1,addScript:function(r){var i=document.createElement("script");i.src=r,i.onerror=this.handleError.bind(this);var t=document.querySelector("script")||document.body;t.parentNode.insertBefore(i,t),this.script=i},removeScript:function(){this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.script=null},handleError:function(r){this.error=new Error("Library failed to load"),this.notifyAll(),this.cleanup()},success:function(){this.loaded=!0,this.result=Array.prototype.slice.call(arguments),this.notifyAll(),this.cleanup()},cleanup:function(){delete window[this.callbackName]},notifyAll:function(){this.notifiers.forEach(function(r){r(this.error,this.result)}.bind(this)),this.notifiers=[]},requestNotify:function(r){this.loaded||this.error?r(this.error,this.result):this.notifiers.push(r)}}}();</script><script>Polymer({is:"iron-jsonp-library",behaviors:[Polymer.IronJsonpLibraryBehavior],properties:{libraryUrl:String,callbackName:String,notifyEvent:String}});</script><script>Polymer({is:"google-legacy-loader",behaviors:[Polymer.IronJsonpLibraryBehavior],properties:{libraryUrl:{type:String,value:"https://www.google.com/jsapi?callback=%%callback%%"},notifyEvent:{type:String,value:"api-load"}},get api(){return google}});</script><style>div.charts-tooltip{z-index:200 !important;}</style><script>Polymer({is:"state-history-chart-timeline",properties:{data:{type:Object,observer:"dataChanged"},isAttached:{type:Boolean,value:!1,observer:"dataChanged"}},created:function(){this.style.display="block"},attached:function(){this.isAttached=!0},dataChanged:function(){this.drawChart()},drawChart:function(){function t(t,e,n,d){var i=e.replace(/_/g," ");a.addRow([t,i,n,d])}var e,a,n,d,i,o,l,h=Polymer.dom(this),s=this.data;if(this.isAttached){for(;h.node.lastChild;)h.node.removeChild(h.node.lastChild);s&&0!==s.length&&(e=new window.google.visualization.Timeline(this),(a=new window.google.visualization.DataTable).addColumn({type:"string",id:"Entity"}),a.addColumn({type:"string",id:"State"}),a.addColumn({type:"date",id:"Start"}),a.addColumn({type:"date",id:"End"}),n=new Date(s.reduce(function(t,e){return Math.min(t,new Date(e[0].last_changed))},new Date)),(d=new Date(s.reduce(function(t,e){return Math.max(t,new Date(e[e.length-1].last_changed))},n)))>new Date&&(d=new Date),o="H:mm",(l=(d-n)/864e5)>30.1?o="MMM d":l>3.1?o="EEE, MMM d":l>1.1&&(o="EEE, MMM d, H:mm"),i=0,s.forEach(function(e){var a,n,o=null,l=null;0!==e.length&&(a=window.hassUtil.computeStateName(e[0]),e.forEach(function(e){new Date(e.last_changed)>d||(null!==o&&e.state!==o?(n=new Date(e.last_changed),t(a,o,l,n),o=e.state,l=n):null===o&&(o=e.state,l=new Date(e.last_changed)))}),t(a,o,l,d),i++)}),e.draw(a,{backgroundColor:"#fafafa",height:55+42*i,timeline:{showRowLabels:s.length>1},hAxis:{format:o}}))}}});</script><script>!function(){"use strict";function t(t,e){var a,n=[];for(a=t;a<e;a++)n.push(a);return n}function e(t){var e=parseFloat(t);return!isNaN(e)&&isFinite(e)?e:null}Polymer({is:"state-history-chart-line",properties:{data:{type:Object,observer:"dataChanged"},unit:{type:String},isSingleDevice:{type:Boolean,value:!1},isAttached:{type:Boolean,value:!1,observer:"dataChanged"},chartEngine:{type:Object}},created:function(){this.style.display="block"},attached:function(){this.isAttached=!0},dataChanged:function(){this.drawChart()},drawChart:function(){var a,n,r,i,o,u,s=this.unit,l=this.data;this.isAttached&&(this.chartEngine||(this.chartEngine=new window.google.visualization.LineChart(this)),0!==l.length&&(a={backgroundColor:"#fafafa",legend:{position:"top"},interpolateNulls:!0,titlePosition:"none",vAxes:{0:{title:s}},hAxis:{format:"H:mm"},chartArea:{left:"60",width:"95%"},explorer:{actions:["dragToZoom","rightClickToReset","dragToPan"],keepInBounds:!0,axis:"horizontal",maxZoomIn:.1}},this.isSingleDevice&&(a.legend.position="none",a.vAxes[0].title=null,a.chartArea.left=40,a.chartArea.height="80%",a.chartArea.top=5),n=new Date(Math.min.apply(null,l.map(function(t){return new Date(t[0].last_changed)}))),(r=new Date(Math.max.apply(null,l.map(function(t){return new Date(t[t.length-1].last_changed)}))))>new Date&&(r=new Date),(u=(r-n)/864e5)>30.1?a.hAxis.format="MMM d":u>3.1?a.hAxis.format="EEE, MMM d":u>1.1&&(a.hAxis.format="EEE, MMM d, H:mm"),o=1===(i=l.map(function(t){function a(t,e){var a=t[0];a>r||(n&&e&&c.push([a].concat(n.slice(1).map(function(t,a){return e[a]?t:null}))),c.push(t),n=t)}var n,i,o,u,s=t[t.length-1],l=window.hassUtil.computeDomain(s),h=window.hassUtil.computeStateName(s),c=[],d=new window.google.visualization.DataTable;return d.addColumn({type:"datetime",id:"Time"}),"thermostat"===l||"climate"===l?(i=t.reduce(function(t,e){return t||e.attributes.target_temp_high!==e.attributes.target_temp_low},!1),d.addColumn("number",h+" current temperature"),i?(d.addColumn("number",h+" target temperature high"),d.addColumn("number",h+" target temperature low"),u=[!1,!0,!0],o=function(t){var n=e(t.attributes.current_temperature),r=e(t.attributes.target_temp_high),i=e(t.attributes.target_temp_low);a([new Date(t.last_updated),n,r,i],u)}):(d.addColumn("number",h+" target temperature"),u=[!1,!0],o=function(t){var n=e(t.attributes.current_temperature),r=e(t.attributes.temperature);a([new Date(t.last_updated),n,r],u)}),t.forEach(o)):(d.addColumn("number",h),u="sensor"!==l&&[!0],t.forEach(function(t){var n=e(t.state);a([new Date(t.last_changed),n],u)})),a([r].concat(n.slice(1)),!1),d.addRows(c),d})).length?i[0]:i.slice(1).reduce(function(e,a){return window.google.visualization.data.join(e,a,"full",[[0,0]],t(1,e.getNumberOfColumns()),t(1,a.getNumberOfColumns()))},i[0]),this.chartEngine.draw(o,a)))}})}();</script><dom-module id="state-history-charts" assetpath="components/"><template><link href="https://ajax.googleapis.com/ajax/static/modules/gviz/1.0/core/tooltip.css" rel="stylesheet" type="text/css"><style>:host{display:block;}.loading-container{text-align:center;padding:8px;}.loading{height:0px;overflow:hidden;}</style><google-legacy-loader on-api-load="_googleApiLoaded"></google-legacy-loader><template is="dom-if" if="[[_isLoading]]"><div class="loading-container"><paper-spinner active="" alt="Updating history data"></paper-spinner></div></template><template is="dom-if" if="[[!_isLoading]]"><template is="dom-if" if="[[_computeIsEmpty(historyData)]]">No state history found.</template><state-history-chart-timeline data="[[historyData.timeline]]"></state-history-chart-timeline><template is="dom-repeat" items="[[historyData.line]]"><state-history-chart-line unit="[[item.unit]]" data="[[item.data]]" is-single-device="[[_computeIsSingleLineChart(historyData)]]"></state-history-chart-line></template></template></template></dom-module><script>Polymer({is:"state-history-charts",properties:{historyData:{type:Object,value:null},isLoadingData:{type:Boolean,value:!0},_apiLoaded:{type:Boolean,value:!1},_isLoading:{type:Boolean,computed:"_computeIsLoading(isLoadingData, _apiLoaded)"}},_computeIsSingleLineChart:function(e){return e&&1===e.line.length},_googleApiLoaded:function(){window.google.load("visualization","1",{packages:["timeline","corechart"],callback:function(){this._apiLoaded=!0}.bind(this)})},_computeIsLoading:function(e,t){return e||!t},_computeIsEmpty:function(e){return e&&0===e.timeline.length&&0===e.line.length}});</script><dom-module id="more-info-alarm_control_panel" assetpath="more-infos/"><template><style is="custom-style" include="iron-flex"></style><div class="layout horizontal"><paper-input label="code" value="{{enteredCode}}" pattern="[[codeFormat]]" type="password" hidden$="[[!codeInputVisible]]" disabled="[[!codeInputEnabled]]"></paper-input></div><div class="layout horizontal"><paper-button on-tap="handleDisarmTap" hidden$="[[!disarmButtonVisible]]" disabled="[[!codeValid]]">Disarm</paper-button><paper-button on-tap="handleHomeTap" hidden$="[[!armHomeButtonVisible]]" disabled="[[!codeValid]]">Arm Home</paper-button><paper-button on-tap="handleAwayTap" hidden$="[[!armAwayButtonVisible]]" disabled="[[!codeValid]]">Arm Away</paper-button></div></template></dom-module><script>Polymer({is:"more-info-alarm_control_panel",properties:{hass:{type:Object},stateObj:{type:Object,observer:"stateObjChanged"},enteredCode:{type:String,value:""},disarmButtonVisible:{type:Boolean,value:!1},armHomeButtonVisible:{type:Boolean,value:!1},armAwayButtonVisible:{type:Boolean,value:!1},codeInputVisible:{type:Boolean,value:!1},codeInputEnabled:{type:Boolean,value:!1},codeFormat:{type:String,value:""},codeValid:{type:Boolean,computed:"validateCode(enteredCode, codeFormat)"}},validateCode:function(e,t){var a=new RegExp(t);return null===t||a.test(e)},stateObjChanged:function(e,t){e&&(this.codeFormat=e.attributes.code_format,this.codeInputVisible=null!==this.codeFormat,this.codeInputEnabled="armed_home"===e.state||"armed_away"===e.state||"disarmed"===e.state||"pending"===e.state||"triggered"===e.state,this.disarmButtonVisible="armed_home"===e.state||"armed_away"===e.state||"pending"===e.state||"triggered"===e.state,this.armHomeButtonVisible="disarmed"===e.state,this.armAwayButtonVisible="disarmed"===e.state),t&&this.async(function(){this.fire("iron-resize")}.bind(this),500)},handleDisarmTap:function(){this.callService("alarm_disarm",{code:this.enteredCode})},handleHomeTap:function(){this.callService("alarm_arm_home",{code:this.enteredCode})},handleAwayTap:function(){this.callService("alarm_arm_away",{code:this.enteredCode})},callService:function(e,t){var a=t||{};a.entity_id=this.stateObj.entity_id,this.hass.callService("alarm_control_panel",e,a).then(function(){this.enteredCode=""}.bind(this))}});</script><dom-module id="more-info-automation" assetpath="more-infos/"><template><style>paper-button{color:var(--primary-color);font-weight:500;top:3px;height:37px;}</style><p>Last triggered:<ha-relative-time datetime="[[stateObj.attributes.last_triggered]]"></ha-relative-time></p><paper-button on-tap="handleTriggerTapped">TRIGGER</paper-button></template></dom-module><script>Polymer({is:"more-info-automation",properties:{hass:{type:Object},stateObj:{type:Object}},handleTriggerTapped:function(){this.hass.callService("automation","trigger",{entity_id:this.stateObj.entity_id})}});</script><dom-module id="more-info-camera" assetpath="more-infos/"><template><style>:host{max-width:640px;}.camera-image{width:100%;}</style><img class="camera-image" src="[[computeCameraImageUrl(hass, stateObj, isVisible)]]" on-load="imageLoaded" alt="[[computeStateName(stateObj)]]"></template></dom-module><script>Polymer({is:"more-info-camera",properties:{hass:{type:Object},stateObj:{type:Object},isVisible:{type:Boolean,value:!0}},imageLoaded:function(){this.fire("iron-resize")},computeStateName:function(e){return window.hassUtil.computeStateName(e)},computeCameraImageUrl:function(e,t,a){return e.demo?"/demo/webcam.jpg":t&&a?"/api/camera_proxy_stream/"+t.entity_id+"?token="+t.attributes.access_token:"data:image/gif;base64,R0lGODlhAQABAAAAACw="}});</script><dom-module id="ha-climate-control" assetpath="components/"><template><style is="custom-style" include="iron-flex iron-flex-alignment"></style><style>:host{@apply (--layout-flex);@apply (--layout-horizontal);@apply (--layout-justified);}.target-temperature{@apply (--layout-self-center);font-size:200%;}.control-buttons{font-size:200%;text-align:right;}paper-icon-button{height:48px;width:48px;}</style><div class="target-temperature">[[value]] [[units]]</div><div class="control-buttons"><div><paper-icon-button icon="mdi:chevron-up" on-tap="incrementValue"></paper-icon-button></div><div><paper-icon-button icon="mdi:chevron-down" on-tap="decrementValue"></paper-icon-button></div></div></template><script>Polymer({is:"ha-climate-control",properties:{value:{type:Number,observer:"valueChanged"},units:{type:String},min:{type:Number},max:{type:Number},step:{type:Number,value:1}},incrementValue:function(){var e=this.value+this.step;this.last_changed=Date.now(),e<=this.max?this.value=e:this.value=this.max},decrementValue:function(){var e=this.value-this.step;this.last_changed=Date.now(),e>=this.min?this.value=e:this.value=this.min},valueChanged:function(){this.last_changed&&window.setTimeout(function(e){Date.now()-e.last_changed>=2e3&&(e.fire("change"),e.last_changed=null)},2010,this)}});</script></dom-module><dom-module id="more-info-climate" assetpath="more-infos/"><template><style is="custom-style" include="iron-flex"></style><style>:host{color:var(--primary-text-color);--paper-input-container-input:{text-transform:capitalize;};}.container-away_mode,
       .container-aux_heat,
       .container-temperature,
       .container-humidity,
@@ -109,11 +109,11 @@
       .card-actions ha-call-api-button:not([disabled]),
       .card-actions ha-call-service-button:not([disabled]){color:var(--primary-color);font-weight:500;}.card-actions paper-button.warning:not([disabled]),
       .card-actions ha-call-api-button.warning:not([disabled]),
-      .card-actions ha-call-service-button.warning:not([disabled]){color:var(--google-red-500);}</style></template></dom-module><dom-module id="paper-toast" assetpath="../bower_components/paper-toast/"><template><style>:host{display:block;position:fixed;background-color:var(--paper-toast-background-color, #323232);color:var(--paper-toast-color, #f1f1f1);min-height:48px;min-width:288px;padding:16px 24px;box-sizing:border-box;box-shadow:0 2px 5px 0 rgba(0, 0, 0, 0.26);border-radius:2px;margin:12px;font-size:14px;cursor:default;-webkit-transition:-webkit-transform 0.3s, opacity 0.3s;transition:transform 0.3s, opacity 0.3s;opacity:0;-webkit-transform:translateY(100px);transform:translateY(100px);@apply --paper-font-common-base;}:host(.capsule){border-radius:24px;}:host(.fit-bottom){width:100%;min-width:0;border-radius:0;margin:0;}:host(.paper-toast-open){opacity:1;-webkit-transform:translateY(0px);transform:translateY(0px);}</style><span id="label">{{text}}</span><slot></slot></template><script>!function(){"use strict";var e=null;Polymer({is:"paper-toast",behaviors:[Polymer.IronOverlayBehavior],properties:{fitInto:{type:Object,value:window,observer:"_onFitIntoChanged"},horizontalAlign:{type:String,value:"left"},verticalAlign:{type:String,value:"bottom"},duration:{type:Number,value:3e3},text:{type:String,value:""},noCancelOnOutsideClick:{type:Boolean,value:!0},noAutoFocus:{type:Boolean,value:!0}},listeners:{transitionend:"__onTransitionEnd"},get visible(){return Polymer.Base._warn("`visible` is deprecated, use `opened` instead"),this.opened},get _canAutoClose(){return this.duration>0&&this.duration!==1/0},created:function(){this._autoClose=null,Polymer.IronA11yAnnouncer.requestAvailability()},show:function(e){var t=this;"string"==typeof e&&(e={text:e});for(var n in e)0===n.indexOf("_")?Polymer.Base._warn('The property "'+n+'" is private and was not set.'):n in t?t[n]=e[n]:Polymer.Base._warn('The property "'+n+'" is not valid.');this.open()},hide:function(){this.close()},__onTransitionEnd:function(e){e&&e.target===this&&"opacity"===e.propertyName&&(this.opened?this._finishRenderOpened():this._finishRenderClosed())},_openedChanged:function(){null!==this._autoClose&&(this.cancelAsync(this._autoClose),this._autoClose=null),this.opened?(e&&e!==this&&e.close(),e=this,this.fire("iron-announce",{text:this.text}),this._canAutoClose&&(this._autoClose=this.async(this.close,this.duration))):e===this&&(e=null),Polymer.IronOverlayBehaviorImpl._openedChanged.apply(this,arguments)},_renderOpened:function(){this.classList.add("paper-toast-open")},_renderClosed:function(){this.classList.remove("paper-toast-open")},_onFitIntoChanged:function(e){this.positionTarget=e}})}();</script></dom-module><dom-module id="notification-manager" assetpath="managers/"><template><style>paper-toast{z-index:1;}</style><paper-toast id="toast" text="[[_text]]" no-cancel-on-outside-click="[[_cancelOnOutsideClick]]"></paper-toast><paper-toast id="connToast" duration="0" text="Connection lost. Reconnecting…" opened="[[!isStreaming]]"></paper-toast></template></dom-module><script>Polymer({is:"notification-manager",properties:{hass:{type:Object},isStreaming:{type:Boolean,computed:"computeIsStreaming(hass)"},_cancelOnOutsideClick:{type:Boolean,value:!1},_text:{type:String,readOnly:!0},toastClass:{type:String,value:""}},computeIsStreaming:function(t){return!t||t.connected},created:function(){this.handleWindowChange=this.handleWindowChange.bind(this),this._mediaq=window.matchMedia("(max-width: 599px)"),this._mediaq.addListener(this.handleWindowChange)},attached:function(){this.handleWindowChange(this._mediaq)},detached:function(){this._mediaq.removeListener(this.handleWindowChange)},handleWindowChange:function(t){this.$.toast.classList.toggle("fit-bottom",t.matches),this.$.connToast.classList.toggle("fit-bottom",t.matches)},showNotification:function(t){this._set_text(t),this.$.toast.show()}});</script></div><dom-module id="home-assistant"><template><ha-pref-storage hass="[[hass]]" id="storage"></ha-pref-storage><notification-manager id="notifications" hass="[[hass]]"></notification-manager><template is="dom-if" if="[[showMain]]" restamp=""><home-assistant-main on-hass-more-info="handleMoreInfo" on-hass-dock-sidebar="handleDockSidebar" on-hass-notification="handleNotification" on-hass-logout="handleLogout" hass="[[hass]]"></home-assistant-main></template><template is="dom-if" if="[[!showMain]]" restamp=""><login-form hass="[[hass]]" connection-promise="{{connectionPromise}}" show-loading="[[computeShowLoading(connectionPromise, hass, iconsLoaded)]]"></login-form></template></template></dom-module><script>window.removeInitMsg=function(){var n=document.getElementById("ha-init-skeleton");n&&n.parentElement.removeChild(n)},Polymer({is:"home-assistant",hostAttributes:{icons:null},properties:{connectionPromise:{type:Object,value:window.hassConnection||null,observer:"handleConnectionPromise"},connection:{type:Object,value:null,observer:"connectionChanged"},hass:{type:Object,value:null},icons:{type:String},iconsLoaded:{type:Boolean,value:!1},showMain:{type:Boolean,computed:"computeShowMain(hass, iconsLoaded)"}},computeShowMain:function(n,t){return n&&n.states&&n.config&&t},computeShowLoading:function(n,t,i){return null!=n||t&&(!t.states||!t.config||!i)},loadIcons:function(){var n=function(){this.iconsLoaded=!0}.bind(this);this.importHref("/static/mdi-"+this.icons+".html",n,function(){this.importHref("/static/mdi.html",n,n)})},connectionChanged:function(n,t){if(t&&(this.unsubConnection(),this.unsubConnection=null),n){var i=this.$.notifications,e=this;this.hass=Object.assign({connection:n,connected:!0,states:null,config:null,themes:null,dockedSidebar:!1,moreInfoEntityId:null,callService:function(t,o,s){return n.callService(t,o,s||{}).then(function(){var n,a;s.entity_id&&e.hass.states&&e.hass.states[s.entity_id]&&(a=window.hassUtil.computeStateName(e.hass.states[s.entity_id])),n="turn_on"===o&&s.entity_id?"Turned on "+(a||s.entity_id)+".":"turn_off"===o&&s.entity_id?"Turned off "+(a||s.entity_id)+".":"Service "+t+"/"+o+" called.",i.showNotification(n)},function(){return i.showNotification("Failed to call service "+t+"/"+o),Promise.reject()})},callApi:function(t,i,e){var o=window.location.protocol+"//"+window.location.host,s=n.options.authToken?n.options:{};return window.hassCallApi(o,s,t,i,e)}},this.$.storage.getStoredState());var o=function(){this.hass=Object.assign({},this.hass,{connected:!0})}.bind(this);n.addEventListener("ready",o);var s=function(){this.hass=Object.assign({},this.hass,{connected:!1})}.bind(this);n.addEventListener("disconnected",s);var a;window.HAWS.subscribeEntities(n,function(n){this.hass=Object.assign({},this.hass,{states:n})}.bind(this)).then(function(n){a=n});var c;window.HAWS.subscribeConfig(n,function(n){this.hass=Object.assign({},this.hass,{config:n})}.bind(this)).then(function(n){c=n});var h;this.hass.callApi("get","themes").then(function(n){e.hass.themes=n,window.hassUtil.applyThemesOnElement(e,n)}),n.subscribeEvents(function(n){e.hass.themes=n.data,window.hassUtil.applyThemesOnElement(e,n.data)},"themes_updated").then(function(n){h=n}),this.unsubConnection=function(){n.removeEventListener("ready",o),n.removeEventListener("disconnected",s),a(),c(),h()}}else this.hass=null},handleConnectionPromise:function(n){if(n){var t=this;n.then(function(n){t.connection=n},function(){t.connectionPromise=null})}},handleMoreInfo:function(n){n.stopPropagation(),this.hass=Object.assign({},this.hass,{moreInfoEntityId:n.detail.entityId})},handleDockSidebar:function(n){n.stopPropagation(),this.hass=Object.assign({},this.hass,{dockedSidebar:n.detail.dock}),this.$.storage.storeState()},handleNotification:function(n){this.$.notifications.showNotification(n.detail.message)},handleLogout:function(){delete localStorage.authToken;var n=this.connection;this.connectionPromise=null;try{this.connection=null}catch(n){}n.close()},ready:function(){this.loadIcons(),null!==this.connectionPromise&&this.handleConnectionPromise(this.connectionPromise)}});</script><dom-module id="iron-image" assetpath="../bower_components/iron-image/"><template><style>:host{display:inline-block;overflow:hidden;position:relative;}#baseURIAnchor{display:none;}#sizedImgDiv{position:absolute;top:0px;right:0px;bottom:0px;left:0px;display:none;}#img{display:block;width:var(--iron-image-width, auto);height:var(--iron-image-height, auto);}:host([sizing]) #sizedImgDiv{display:block;}:host([sizing]) #img{display:none;}#placeholder{position:absolute;top:0px;right:0px;bottom:0px;left:0px;background-color:inherit;opacity:1;@apply --iron-image-placeholder;}#placeholder.faded-out{transition:opacity 0.5s linear;opacity:0;}</style><a id="baseURIAnchor" href="#"></a><div id="sizedImgDiv" role="img" hidden$="[[_computeImgDivHidden(sizing)]]" aria-hidden$="[[_computeImgDivARIAHidden(alt)]]" aria-label$="[[_computeImgDivARIALabel(alt, src)]]"></div><img id="img" alt$="[[alt]]" hidden$="[[_computeImgHidden(sizing)]]" crossorigin$="[[crossorigin]]" on-load="_imgOnLoad" on-error="_imgOnError"><div id="placeholder" hidden$="[[_computePlaceholderHidden(preload, fade, loading, loaded)]]" class$="[[_computePlaceholderClassName(preload, fade, loading, loaded)]]"></div></template><script>Polymer({is:"iron-image",properties:{src:{type:String,value:""},alt:{type:String,value:null},crossorigin:{type:String,value:null},preventLoad:{type:Boolean,value:!1},sizing:{type:String,value:null,reflectToAttribute:!0},position:{type:String,value:"center"},preload:{type:Boolean,value:!1},placeholder:{type:String,value:null,observer:"_placeholderChanged"},fade:{type:Boolean,value:!1},loaded:{notify:!0,readOnly:!0,type:Boolean,value:!1},loading:{notify:!0,readOnly:!0,type:Boolean,value:!1},error:{notify:!0,readOnly:!0,type:Boolean,value:!1},width:{observer:"_widthChanged",type:Number,value:null},height:{observer:"_heightChanged",type:Number,value:null}},observers:["_transformChanged(sizing, position)","_loadStateObserver(src, preventLoad)"],created:function(){this._resolvedSrc=""},_imgOnLoad:function(){this.$.img.src===this._resolveSrc(this.src)&&(this._setLoading(!1),this._setLoaded(!0),this._setError(!1))},_imgOnError:function(){this.$.img.src===this._resolveSrc(this.src)&&(this.$.img.removeAttribute("src"),this.$.sizedImgDiv.style.backgroundImage="",this._setLoading(!1),this._setLoaded(!1),this._setError(!0))},_computePlaceholderHidden:function(){return!this.preload||!this.fade&&!this.loading&&this.loaded},_computePlaceholderClassName:function(){return this.preload&&this.fade&&!this.loading&&this.loaded?"faded-out":""},_computeImgDivHidden:function(){return!this.sizing},_computeImgDivARIAHidden:function(){return""===this.alt?"true":void 0},_computeImgDivARIALabel:function(){return null!==this.alt?this.alt:""===this.src?"":this._resolveSrc(this.src).replace(/[?|#].*/g,"").split("/").pop()},_computeImgHidden:function(){return!!this.sizing},_widthChanged:function(){this.style.width=isNaN(this.width)?this.width:this.width+"px"},_heightChanged:function(){this.style.height=isNaN(this.height)?this.height:this.height+"px"},_loadStateObserver:function(e,t){var i=this._resolveSrc(e);i!==this._resolvedSrc&&(this._resolvedSrc="",this.$.img.removeAttribute("src"),this.$.sizedImgDiv.style.backgroundImage="",""===e||t?(this._setLoading(!1),this._setLoaded(!1),this._setError(!1)):(this._resolvedSrc=i,this.$.img.src=this._resolvedSrc,this.$.sizedImgDiv.style.backgroundImage='url("'+this._resolvedSrc+'")',this._setLoading(!0),this._setLoaded(!1),this._setError(!1)))},_placeholderChanged:function(){this.$.placeholder.style.backgroundImage=this.placeholder?'url("'+this.placeholder+'")':""},_transformChanged:function(){var e=this.$.sizedImgDiv.style,t=this.$.placeholder.style;e.backgroundSize=t.backgroundSize=this.sizing,e.backgroundPosition=t.backgroundPosition=this.sizing?this.position:"",e.backgroundRepeat=t.backgroundRepeat=this.sizing?"no-repeat":""},_resolveSrc:function(e){var t=Polymer.ResolveUrl.resolveUrl(e,this.$.baseURIAnchor.href);return"/"===t[0]&&(t=(location.origin||location.protocol+"//"+location.host)+t),t}});</script></dom-module><dom-module id="paper-card" assetpath="../bower_components/paper-card/"><template><style include="paper-material-styles">:host{display:inline-block;position:relative;box-sizing:border-box;background-color:var(--paper-card-background-color, var(--primary-background-color));border-radius:2px;@apply --paper-font-common-base;@apply --paper-card;}[hidden]{display:none !important;}.header{position:relative;border-top-left-radius:inherit;border-top-right-radius:inherit;overflow:hidden;@apply --paper-card-header;}.header iron-image{display:block;width:100%;--iron-image-width:100%;pointer-events:none;@apply --paper-card-header-image;}.header .title-text{padding:16px;font-size:24px;font-weight:400;color:var(--paper-card-header-color, #000);@apply --paper-card-header-text;}.header .title-text.over-image{position:absolute;bottom:0px;@apply --paper-card-header-image-text;}:host ::slotted(.card-content){padding:16px;position:relative;@apply --paper-card-content;}:host ::slotted(.card-actions){border-top:1px solid #e8e8e8;padding:5px 16px;position:relative;@apply --paper-card-actions;}:host([elevation="1"]){@apply --paper-material-elevation-1;}:host([elevation="2"]){@apply --paper-material-elevation-2;}:host([elevation="3"]){@apply --paper-material-elevation-3;}:host([elevation="4"]){@apply --paper-material-elevation-4;}:host([elevation="5"]){@apply --paper-material-elevation-5;}</style><div class="header"><iron-image hidden$="[[!image]]" aria-hidden$="[[_isHidden(image)]]" src="[[image]]" alt="[[alt]]" placeholder="[[placeholderImage]]" preload="[[preloadImage]]" fade="[[fadeImage]]"></iron-image><div hidden$="[[!heading]]" class$="title-text [[_computeHeadingClass(image)]]">[[heading]]</div></div><slot></slot></template><script>Polymer({is:"paper-card",properties:{heading:{type:String,value:"",observer:"_headingChanged"},image:{type:String,value:""},alt:{type:String},preloadImage:{type:Boolean,value:!1},fadeImage:{type:Boolean,value:!1},placeholderImage:{type:String,value:null},elevation:{type:Number,value:1,reflectToAttribute:!0},animatedShadow:{type:Boolean,value:!1},animated:{type:Boolean,reflectToAttribute:!0,readOnly:!0,computed:"_computeAnimated(animatedShadow)"}},_isHidden:function(e){return e?"false":"true"},_headingChanged:function(e){var t=this.getAttribute("heading"),a=this.getAttribute("aria-label");"string"==typeof a&&a!==t||this.setAttribute("aria-label",e)},_computeHeadingClass:function(e){return e?" over-image":""},_computeAnimated:function(e){return e}});</script></dom-module><dom-module id="paper-item-body" assetpath="../bower_components/paper-item/"><template><style>:host{overflow:hidden;@apply --layout-vertical;@apply --layout-center-justified;@apply --layout-flex;}:host([two-line]){min-height:var(--paper-item-body-two-line-min-height, 72px);}:host([three-line]){min-height:var(--paper-item-body-three-line-min-height, 88px);}:host > ::slotted(*){overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}:host > ::slotted([secondary]){@apply --paper-font-body1;color:var(--paper-item-body-secondary-color, var(--secondary-text-color));@apply --paper-item-body-secondary;}</style><slot></slot></template><script>Polymer({is:"paper-item-body"});</script></dom-module><dom-module id="paper-dropdown-menu-light" assetpath="../bower_components/paper-dropdown-menu/"><template><style include="paper-dropdown-menu-shared-styles">:host(:focus){outline:none;}:host{width:200px;}[slot="dropdown-trigger"]{box-sizing:border-box;position:relative;width:100%;padding:16px 0 8px 0;}:host([disabled]) [slot="dropdown-trigger"]{pointer-events:none;opacity:var(--paper-dropdown-menu-disabled-opacity, 0.33);}:host([no-label-float]) [slot="dropdown-trigger"]{padding-top:8px;}#input{@apply --paper-font-subhead;@apply --paper-font-common-nowrap;line-height:1.5;border-bottom:1px solid var(--paper-dropdown-menu-color, var(--secondary-text-color));color:var(--paper-dropdown-menu-color, var(--primary-text-color));width:100%;box-sizing:border-box;padding:12px 20px 0 0;outline:none;@apply --paper-dropdown-menu-input;}:host(:dir(rtl)) #input,
+      .card-actions ha-call-service-button.warning:not([disabled]){color:var(--google-red-500);}</style></template></dom-module><dom-module id="paper-toast" assetpath="../bower_components/paper-toast/"><template><style>:host{display:block;position:fixed;background-color:var(--paper-toast-background-color, #323232);color:var(--paper-toast-color, #f1f1f1);min-height:48px;min-width:288px;padding:16px 24px;box-sizing:border-box;box-shadow:0 2px 5px 0 rgba(0, 0, 0, 0.26);border-radius:2px;margin:12px;font-size:14px;cursor:default;-webkit-transition:-webkit-transform 0.3s, opacity 0.3s;transition:transform 0.3s, opacity 0.3s;opacity:0;-webkit-transform:translateY(100px);transform:translateY(100px);@apply --paper-font-common-base;}:host(.capsule){border-radius:24px;}:host(.fit-bottom){width:100%;min-width:0;border-radius:0;margin:0;}:host(.paper-toast-open){opacity:1;-webkit-transform:translateY(0px);transform:translateY(0px);}</style><span id="label">{{text}}</span><slot></slot></template><script>!function(){"use strict";var e=null;Polymer({is:"paper-toast",behaviors:[Polymer.IronOverlayBehavior],properties:{fitInto:{type:Object,value:window,observer:"_onFitIntoChanged"},horizontalAlign:{type:String,value:"left"},verticalAlign:{type:String,value:"bottom"},duration:{type:Number,value:3e3},text:{type:String,value:""},noCancelOnOutsideClick:{type:Boolean,value:!0},noAutoFocus:{type:Boolean,value:!0}},listeners:{transitionend:"__onTransitionEnd"},get visible(){return Polymer.Base._warn("`visible` is deprecated, use `opened` instead"),this.opened},get _canAutoClose(){return this.duration>0&&this.duration!==1/0},created:function(){this._autoClose=null,Polymer.IronA11yAnnouncer.requestAvailability()},show:function(e){"string"==typeof e&&(e={text:e});for(var t in e)0===t.indexOf("_")?Polymer.Base._warn('The property "'+t+'" is private and was not set.'):t in this?this[t]=e[t]:Polymer.Base._warn('The property "'+t+'" is not valid.');this.open()},hide:function(){this.close()},__onTransitionEnd:function(e){e&&e.target===this&&"opacity"===e.propertyName&&(this.opened?this._finishRenderOpened():this._finishRenderClosed())},_openedChanged:function(){null!==this._autoClose&&(this.cancelAsync(this._autoClose),this._autoClose=null),this.opened?(e&&e!==this&&e.close(),e=this,this.fire("iron-announce",{text:this.text}),this._canAutoClose&&(this._autoClose=this.async(this.close,this.duration))):e===this&&(e=null),Polymer.IronOverlayBehaviorImpl._openedChanged.apply(this,arguments)},_renderOpened:function(){this.classList.add("paper-toast-open")},_renderClosed:function(){this.classList.remove("paper-toast-open")},_onFitIntoChanged:function(e){this.positionTarget=e}})}();</script></dom-module><dom-module id="notification-manager" assetpath="managers/"><template><style>paper-toast{z-index:1;}</style><paper-toast id="toast" text="[[_text]]" no-cancel-on-outside-click="[[_cancelOnOutsideClick]]"></paper-toast><paper-toast id="connToast" duration="0" text="Connection lost. Reconnecting…" opened="[[!isStreaming]]"></paper-toast></template></dom-module><script>Polymer({is:"notification-manager",properties:{hass:{type:Object},isStreaming:{type:Boolean,computed:"computeIsStreaming(hass)"},_cancelOnOutsideClick:{type:Boolean,value:!1},_text:{type:String,readOnly:!0},toastClass:{type:String,value:""}},computeIsStreaming:function(t){return!t||t.connected},created:function(){this.handleWindowChange=this.handleWindowChange.bind(this),this._mediaq=window.matchMedia("(max-width: 599px)"),this._mediaq.addListener(this.handleWindowChange)},attached:function(){this.handleWindowChange(this._mediaq)},detached:function(){this._mediaq.removeListener(this.handleWindowChange)},handleWindowChange:function(t){this.$.toast.classList.toggle("fit-bottom",t.matches),this.$.connToast.classList.toggle("fit-bottom",t.matches)},showNotification:function(t){this._set_text(t),this.$.toast.show()}});</script></div><dom-module id="home-assistant"><template><ha-pref-storage hass="[[hass]]" id="storage"></ha-pref-storage><notification-manager id="notifications" hass="[[hass]]"></notification-manager><template is="dom-if" if="[[showMain]]" restamp=""><home-assistant-main on-hass-more-info="handleMoreInfo" on-hass-dock-sidebar="handleDockSidebar" on-hass-notification="handleNotification" on-hass-logout="handleLogout" hass="[[hass]]"></home-assistant-main></template><template is="dom-if" if="[[!showMain]]" restamp=""><login-form hass="[[hass]]" connection-promise="{{connectionPromise}}" show-loading="[[computeShowLoading(connectionPromise, hass, iconsLoaded)]]"></login-form></template></template></dom-module><script>window.removeInitMsg=function(){var n=document.getElementById("ha-init-skeleton");n&&n.parentElement.removeChild(n)},Polymer({is:"home-assistant",hostAttributes:{icons:null},properties:{connectionPromise:{type:Object,value:window.hassConnection||null,observer:"handleConnectionPromise"},connection:{type:Object,value:null,observer:"connectionChanged"},hass:{type:Object,value:null},icons:{type:String},iconsLoaded:{type:Boolean,value:!1},showMain:{type:Boolean,computed:"computeShowMain(hass, iconsLoaded)"}},computeShowMain:function(n,t){return n&&n.states&&n.config&&t},computeShowLoading:function(n,t,e){return null!=n||t&&(!t.states||!t.config||!e)},loadIcons:function(){var n=this,t=function(){n.iconsLoaded=!0};this.importHref("/static/mdi-"+this.icons+".html",t,function(){this.importHref("/static/mdi.html",t,t)})},connectionChanged:function(n,t){var e=this;if(t&&(this.unsubConnection(),this.unsubConnection=null),n){var i=this.$.notifications;this.hass=Object.assign({connection:n,connected:!0,states:null,config:null,themes:null,dockedSidebar:!1,moreInfoEntityId:null,callService:function(t,o,s){return n.callService(t,o,s||{}).then(function(){var n,a;s.entity_id&&e.hass.states&&e.hass.states[s.entity_id]&&(a=window.hassUtil.computeStateName(e.hass.states[s.entity_id])),n="turn_on"===o&&s.entity_id?"Turned on "+(a||s.entity_id)+".":"turn_off"===o&&s.entity_id?"Turned off "+(a||s.entity_id)+".":"Service "+t+"/"+o+" called.",i.showNotification(n)},function(){return i.showNotification("Failed to call service "+t+"/"+o),Promise.reject()})},callApi:function(t,e,i){var o=window.location.protocol+"//"+window.location.host,s=n.options.authToken?n.options:{};return window.hassCallApi(o,s,t,e,i)}},this.$.storage.getStoredState());var o=function(){e.hass=Object.assign({},e.hass,{connected:!0})};n.addEventListener("ready",o);var s=function(){e.hass=Object.assign({},e.hass,{connected:!1})};n.addEventListener("disconnected",s);var a;window.HAWS.subscribeEntities(n,function(n){e.hass=Object.assign({},e.hass,{states:n})}).then(function(n){a=n});var c;window.HAWS.subscribeConfig(n,function(n){e.hass=Object.assign({},e.hass,{config:n})}).then(function(n){c=n});var h;this.hass.callApi("get","themes").then(function(n){e.hass.themes=n,window.hassUtil.applyThemesOnElement(e,n)}),n.subscribeEvents(function(n){e.hass.themes=n.data,window.hassUtil.applyThemesOnElement(e,n.data)},"themes_updated").then(function(n){h=n}),this.unsubConnection=function(){n.removeEventListener("ready",o),n.removeEventListener("disconnected",s),a(),c(),h()}}else this.hass=null},handleConnectionPromise:function(n){var t=this;n&&n.then(function(n){t.connection=n},function(){t.connectionPromise=null})},handleMoreInfo:function(n){n.stopPropagation(),this.hass=Object.assign({},this.hass,{moreInfoEntityId:n.detail.entityId})},handleDockSidebar:function(n){n.stopPropagation(),this.hass=Object.assign({},this.hass,{dockedSidebar:n.detail.dock}),this.$.storage.storeState()},handleNotification:function(n){this.$.notifications.showNotification(n.detail.message)},handleLogout:function(){delete localStorage.authToken;var n=this.connection;this.connectionPromise=null;try{this.connection=null}catch(n){}n.close()},ready:function(){this.loadIcons()}});</script><dom-module id="iron-image" assetpath="../bower_components/iron-image/"><template><style>:host{display:inline-block;overflow:hidden;position:relative;}#baseURIAnchor{display:none;}#sizedImgDiv{position:absolute;top:0px;right:0px;bottom:0px;left:0px;display:none;}#img{display:block;width:var(--iron-image-width, auto);height:var(--iron-image-height, auto);}:host([sizing]) #sizedImgDiv{display:block;}:host([sizing]) #img{display:none;}#placeholder{position:absolute;top:0px;right:0px;bottom:0px;left:0px;background-color:inherit;opacity:1;@apply --iron-image-placeholder;}#placeholder.faded-out{transition:opacity 0.5s linear;opacity:0;}</style><a id="baseURIAnchor" href="#"></a><div id="sizedImgDiv" role="img" hidden$="[[_computeImgDivHidden(sizing)]]" aria-hidden$="[[_computeImgDivARIAHidden(alt)]]" aria-label$="[[_computeImgDivARIALabel(alt, src)]]"></div><img id="img" alt$="[[alt]]" hidden$="[[_computeImgHidden(sizing)]]" crossorigin$="[[crossorigin]]" on-load="_imgOnLoad" on-error="_imgOnError"><div id="placeholder" hidden$="[[_computePlaceholderHidden(preload, fade, loading, loaded)]]" class$="[[_computePlaceholderClassName(preload, fade, loading, loaded)]]"></div></template><script>Polymer({is:"iron-image",properties:{src:{type:String,value:""},alt:{type:String,value:null},crossorigin:{type:String,value:null},preventLoad:{type:Boolean,value:!1},sizing:{type:String,value:null,reflectToAttribute:!0},position:{type:String,value:"center"},preload:{type:Boolean,value:!1},placeholder:{type:String,value:null,observer:"_placeholderChanged"},fade:{type:Boolean,value:!1},loaded:{notify:!0,readOnly:!0,type:Boolean,value:!1},loading:{notify:!0,readOnly:!0,type:Boolean,value:!1},error:{notify:!0,readOnly:!0,type:Boolean,value:!1},width:{observer:"_widthChanged",type:Number,value:null},height:{observer:"_heightChanged",type:Number,value:null}},observers:["_transformChanged(sizing, position)","_loadStateObserver(src, preventLoad)"],created:function(){this._resolvedSrc=""},_imgOnLoad:function(){this.$.img.src===this._resolveSrc(this.src)&&(this._setLoading(!1),this._setLoaded(!0),this._setError(!1))},_imgOnError:function(){this.$.img.src===this._resolveSrc(this.src)&&(this.$.img.removeAttribute("src"),this.$.sizedImgDiv.style.backgroundImage="",this._setLoading(!1),this._setLoaded(!1),this._setError(!0))},_computePlaceholderHidden:function(){return!this.preload||!this.fade&&!this.loading&&this.loaded},_computePlaceholderClassName:function(){return this.preload&&this.fade&&!this.loading&&this.loaded?"faded-out":""},_computeImgDivHidden:function(){return!this.sizing},_computeImgDivARIAHidden:function(){return""===this.alt?"true":void 0},_computeImgDivARIALabel:function(){return null!==this.alt?this.alt:""===this.src?"":this._resolveSrc(this.src).replace(/[?|#].*/g,"").split("/").pop()},_computeImgHidden:function(){return!!this.sizing},_widthChanged:function(){this.style.width=isNaN(this.width)?this.width:this.width+"px"},_heightChanged:function(){this.style.height=isNaN(this.height)?this.height:this.height+"px"},_loadStateObserver:function(e,t){var i=this._resolveSrc(e);i!==this._resolvedSrc&&(this._resolvedSrc="",this.$.img.removeAttribute("src"),this.$.sizedImgDiv.style.backgroundImage="",""===e||t?(this._setLoading(!1),this._setLoaded(!1),this._setError(!1)):(this._resolvedSrc=i,this.$.img.src=this._resolvedSrc,this.$.sizedImgDiv.style.backgroundImage='url("'+this._resolvedSrc+'")',this._setLoading(!0),this._setLoaded(!1),this._setError(!1)))},_placeholderChanged:function(){this.$.placeholder.style.backgroundImage=this.placeholder?'url("'+this.placeholder+'")':""},_transformChanged:function(){var e=this.$.sizedImgDiv.style,t=this.$.placeholder.style;e.backgroundSize=t.backgroundSize=this.sizing,e.backgroundPosition=t.backgroundPosition=this.sizing?this.position:"",e.backgroundRepeat=t.backgroundRepeat=this.sizing?"no-repeat":""},_resolveSrc:function(e){var t=Polymer.ResolveUrl.resolveUrl(e,this.$.baseURIAnchor.href);return"/"===t[0]&&(t=(location.origin||location.protocol+"//"+location.host)+t),t}});</script></dom-module><dom-module id="paper-card" assetpath="../bower_components/paper-card/"><template><style include="paper-material-styles">:host{display:inline-block;position:relative;box-sizing:border-box;background-color:var(--paper-card-background-color, var(--primary-background-color));border-radius:2px;@apply --paper-font-common-base;@apply --paper-card;}[hidden]{display:none !important;}.header{position:relative;border-top-left-radius:inherit;border-top-right-radius:inherit;overflow:hidden;@apply --paper-card-header;}.header iron-image{display:block;width:100%;--iron-image-width:100%;pointer-events:none;@apply --paper-card-header-image;}.header .title-text{padding:16px;font-size:24px;font-weight:400;color:var(--paper-card-header-color, #000);@apply --paper-card-header-text;}.header .title-text.over-image{position:absolute;bottom:0px;@apply --paper-card-header-image-text;}:host ::slotted(.card-content){padding:16px;position:relative;@apply --paper-card-content;}:host ::slotted(.card-actions){border-top:1px solid #e8e8e8;padding:5px 16px;position:relative;@apply --paper-card-actions;}:host([elevation="1"]){@apply --paper-material-elevation-1;}:host([elevation="2"]){@apply --paper-material-elevation-2;}:host([elevation="3"]){@apply --paper-material-elevation-3;}:host([elevation="4"]){@apply --paper-material-elevation-4;}:host([elevation="5"]){@apply --paper-material-elevation-5;}</style><div class="header"><iron-image hidden$="[[!image]]" aria-hidden$="[[_isHidden(image)]]" src="[[image]]" alt="[[alt]]" placeholder="[[placeholderImage]]" preload="[[preloadImage]]" fade="[[fadeImage]]"></iron-image><div hidden$="[[!heading]]" class$="title-text [[_computeHeadingClass(image)]]">[[heading]]</div></div><slot></slot></template><script>Polymer({is:"paper-card",properties:{heading:{type:String,value:"",observer:"_headingChanged"},image:{type:String,value:""},alt:{type:String},preloadImage:{type:Boolean,value:!1},fadeImage:{type:Boolean,value:!1},placeholderImage:{type:String,value:null},elevation:{type:Number,value:1,reflectToAttribute:!0},animatedShadow:{type:Boolean,value:!1},animated:{type:Boolean,reflectToAttribute:!0,readOnly:!0,computed:"_computeAnimated(animatedShadow)"}},_isHidden:function(e){return e?"false":"true"},_headingChanged:function(e){var t=this.getAttribute("heading"),a=this.getAttribute("aria-label");"string"==typeof a&&a!==t||this.setAttribute("aria-label",e)},_computeHeadingClass:function(e){return e?" over-image":""},_computeAnimated:function(e){return e}});</script></dom-module><dom-module id="paper-item-body" assetpath="../bower_components/paper-item/"><template><style>:host{overflow:hidden;@apply --layout-vertical;@apply --layout-center-justified;@apply --layout-flex;}:host([two-line]){min-height:var(--paper-item-body-two-line-min-height, 72px);}:host([three-line]){min-height:var(--paper-item-body-three-line-min-height, 88px);}:host > ::slotted(*){overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}:host > ::slotted([secondary]){@apply --paper-font-body1;color:var(--paper-item-body-secondary-color, var(--secondary-text-color));@apply --paper-item-body-secondary;}</style><slot></slot></template><script>Polymer({is:"paper-item-body"});</script></dom-module><dom-module id="paper-dropdown-menu-light" assetpath="../bower_components/paper-dropdown-menu/"><template><style include="paper-dropdown-menu-shared-styles">:host(:focus){outline:none;}:host{width:200px;}[slot="dropdown-trigger"]{box-sizing:border-box;position:relative;width:100%;padding:16px 0 8px 0;}:host([disabled]) [slot="dropdown-trigger"]{pointer-events:none;opacity:var(--paper-dropdown-menu-disabled-opacity, 0.33);}:host([no-label-float]) [slot="dropdown-trigger"]{padding-top:8px;}#input{@apply --paper-font-subhead;@apply --paper-font-common-nowrap;line-height:1.5;border-bottom:1px solid var(--paper-dropdown-menu-color, var(--secondary-text-color));color:var(--paper-dropdown-menu-color, var(--primary-text-color));width:100%;box-sizing:border-box;padding:12px 20px 0 0;outline:none;@apply --paper-dropdown-menu-input;}:host(:dir(rtl)) #input,
       :host-context([dir="rtl"]) #input{padding-right:0px;padding-left:20px;}:host([disabled]) #input{border-bottom:1px dashed var(--paper-dropdown-menu-color, var(--secondary-text-color));}:host([invalid]) #input{border-bottom:2px solid var(--paper-dropdown-error-color, var(--error-color));}:host([no-label-float]) #input{padding-top:0;}label{@apply --paper-font-subhead;@apply --paper-font-common-nowrap;display:block;position:absolute;bottom:0;left:0;right:0;top:28px;box-sizing:border-box;width:100%;padding-right:20px;text-align:left;transition-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1);color:var(--paper-dropdown-menu-color, var(--secondary-text-color));@apply --paper-dropdown-menu-label;}:host(:dir(rtl)) label,
       :host-context([dir="rtl"]) label{padding-right:0px;padding-left:20px;}:host([no-label-float]) label{top:8px;transition-duration:0s;}label.label-is-floating{font-size:12px;top:8px;}label.label-is-hidden{visibility:hidden;}:host([focused]) label.label-is-floating{color:var(--paper-dropdown-menu-focus-color, var(--primary-color));}:host([invalid]) label.label-is-floating{color:var(--paper-dropdown-error-color, var(--error-color));}label:after{background-color:var(--paper-dropdown-menu-focus-color, var(--primary-color));bottom:7px;content:'';height:2px;left:45%;position:absolute;transition-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1);visibility:hidden;width:8px;z-index:10;}:host([invalid]) label:after{background-color:var(--paper-dropdown-error-color, var(--error-color));}:host([no-label-float]) label:after{bottom:7px;}:host([focused]:not([disabled])) label:after{left:0;visibility:visible;width:100%;}iron-icon{position:absolute;right:0px;bottom:8px;@apply --paper-font-subhead;color:var(--disabled-text-color);@apply --paper-dropdown-menu-icon;}:host(:dir(rtl)) iron-icon,
-      :host-context([dir="rtl"]) iron-icon{left:0;right:auto;}:host([no-label-float]) iron-icon{margin-top:0px;}.error{display:inline-block;visibility:hidden;color:var(--paper-dropdown-error-color, var(--error-color));@apply --paper-font-caption;position:absolute;left:0;right:0;bottom:-12px;}:host([invalid]) .error{visibility:visible;}</style><span role="button"></span><paper-menu-button id="menuButton" vertical-align="[[verticalAlign]]" horizontal-align="[[horizontalAlign]]" vertical-offset="[[_computeMenuVerticalOffset(noLabelFloat)]]" disabled="[[disabled]]" no-animations="[[noAnimations]]" on-iron-select="_onIronSelect" on-iron-deselect="_onIronDeselect" opened="{{opened}}" close-on-activate="" allow-outside-scroll="[[allowOutsideScroll]]"><div class="dropdown-trigger" slot="dropdown-trigger"><label class$="[[_computeLabelClass(noLabelFloat,alwaysFloatLabel,hasContent)]]">[[label]]</label><div id="input" tabindex="-1">&nbsp;</div><iron-icon icon="paper-dropdown-menu:arrow-drop-down"></iron-icon><span class="error">[[errorMessage]]</span></div><slot id="content" name="dropdown-content" slot="dropdown-content"></slot></paper-menu-button></template><script>!function(){"use strict";Polymer({is:"paper-dropdown-menu-light",behaviors:[Polymer.IronButtonState,Polymer.IronControlState,Polymer.PaperRippleBehavior,Polymer.IronFormElementBehavior,Polymer.IronValidatableBehavior],properties:{selectedItemLabel:{type:String,notify:!0,readOnly:!0},selectedItem:{type:Object,notify:!0,readOnly:!0},value:{type:String,notify:!0,readOnly:!0,observer:"_valueChanged"},label:{type:String},placeholder:{type:String},opened:{type:Boolean,notify:!0,value:!1,observer:"_openedChanged"},allowOutsideScroll:{type:Boolean,value:!1},noLabelFloat:{type:Boolean,value:!1,reflectToAttribute:!0},alwaysFloatLabel:{type:Boolean,value:!1},noAnimations:{type:Boolean,value:!1},horizontalAlign:{type:String,value:"right"},verticalAlign:{type:String,value:"top"},hasContent:{type:Boolean,readOnly:!0}},listeners:{tap:"_onTap"},keyBindings:{"up down":"open",esc:"close"},hostAttributes:{tabindex:0,role:"combobox","aria-autocomplete":"none","aria-haspopup":"true"},observers:["_selectedItemChanged(selectedItem)"],attached:function(){var e=this.contentElement;e&&e.selectedItem&&this._setSelectedItem(e.selectedItem)},get contentElement(){for(var e=Polymer.dom(this.$.content).getDistributedNodes(),t=0,n=e.length;t<n;t++)if(e[t].nodeType===Node.ELEMENT_NODE)return e[t]},open:function(){this.$.menuButton.open()},close:function(){this.$.menuButton.close()},_onIronSelect:function(e){this._setSelectedItem(e.detail.item)},_onIronDeselect:function(e){this._setSelectedItem(null)},_onTap:function(e){Polymer.Gestures.findOriginalTarget(e)===this&&this.open()},_selectedItemChanged:function(e){var t="";t=e?e.label||e.getAttribute("label")||e.textContent.trim():"",this._setValue(t),this._setSelectedItemLabel(t)},_computeMenuVerticalOffset:function(e){return e?-4:8},_getValidity:function(e){return this.disabled||!this.required||this.required&&!!this.value},_openedChanged:function(){var e=this.opened?"true":"false",t=this.contentElement;t&&t.setAttribute("aria-expanded",e)},_computeLabelClass:function(e,t,n){var o="";return!0===e?n?"label-is-hidden":"":((n||!0===t)&&(o+=" label-is-floating"),o)},_valueChanged:function(){this.$.input&&this.$.input.textContent!==this.value&&(this.$.input.textContent=this.value),this._setHasContent(!!this.value)}})}();</script></dom-module><dom-module id="iron-autogrow-textarea" assetpath="../bower_components/iron-autogrow-textarea/"><template><style>:host{display:inline-block;position:relative;width:400px;border:1px solid;padding:2px;-moz-appearance:textarea;-webkit-appearance:textarea;overflow:hidden;}.mirror-text{visibility:hidden;word-wrap:break-word;@apply --iron-autogrow-textarea;}.fit{@apply --layout-fit;}textarea{position:relative;outline:none;border:none;resize:none;background:inherit;color:inherit;width:100%;height:100%;font-size:inherit;font-family:inherit;line-height:inherit;text-align:inherit;@apply --iron-autogrow-textarea;}textarea::-webkit-input-placeholder{@apply --iron-autogrow-textarea-placeholder;}textarea:-moz-placeholder{@apply --iron-autogrow-textarea-placeholder;}textarea::-moz-placeholder{@apply --iron-autogrow-textarea-placeholder;}textarea:-ms-input-placeholder{@apply --iron-autogrow-textarea-placeholder;}</style><div id="mirror" class="mirror-text" aria-hidden="true">&nbsp;</div><div class="textarea-container fit"><textarea id="textarea" name$="[[name]]" aria-label$="[[label]]" autocomplete$="[[autocomplete]]" autofocus$="[[autofocus]]" inputmode$="[[inputmode]]" placeholder$="[[placeholder]]" readonly$="[[readonly]]" required$="[[required]]" disabled$="[[disabled]]" rows$="[[rows]]" minlength$="[[minlength]]" maxlength$="[[maxlength]]"></textarea></div></template></dom-module><script>Polymer({is:"iron-autogrow-textarea",behaviors:[Polymer.IronValidatableBehavior,Polymer.IronControlState],properties:{value:{observer:"_valueChanged",type:String,notify:!0},bindValue:{observer:"_bindValueChanged",type:String,notify:!0},rows:{type:Number,value:1,observer:"_updateCached"},maxRows:{type:Number,value:0,observer:"_updateCached"},autocomplete:{type:String,value:"off"},autofocus:{type:Boolean,value:!1},inputmode:{type:String},placeholder:{type:String},readonly:{type:String},required:{type:Boolean},minlength:{type:Number},maxlength:{type:Number},label:{type:String}},listeners:{input:"_onInput"},get textarea(){return this.$.textarea},get selectionStart(){return this.$.textarea.selectionStart},get selectionEnd(){return this.$.textarea.selectionEnd},set selectionStart(e){this.$.textarea.selectionStart=e},set selectionEnd(e){this.$.textarea.selectionEnd=e},attached:function(){navigator.userAgent.match(/iP(?:[oa]d|hone)/)&&(this.$.textarea.style.marginLeft="-3px")},validate:function(){var e=this.$.textarea.validity.valid;return e&&(this.required&&""===this.value?e=!1:this.hasValidator()&&(e=Polymer.IronValidatableBehavior.validate.call(this,this.value))),this.invalid=!e,this.fire("iron-input-validate"),e},_bindValueChanged:function(e){this.value=e},_valueChanged:function(e){var t=this.textarea;t&&(t.value!==e&&(t.value=e||0===e?e:""),this.bindValue=e,this.$.mirror.innerHTML=this._valueForMirror())},_onInput:function(e){var t=Polymer.dom(e).path;this.value=t?t[0].value:e.target.value},_constrain:function(e){var t;for(e=e||[""],t=this.maxRows>0&&e.length>this.maxRows?e.slice(0,this.maxRows):e.slice(0);this.rows>0&&t.length<this.rows;)t.push("");return t.join("<br/>")+"&#160;"},_valueForMirror:function(){var e=this.textarea;if(e)return this.tokens=e&&e.value?e.value.replace(/&/gm,"&amp;").replace(/"/gm,"&quot;").replace(/'/gm,"&#39;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;").split("\n"):[""],this._constrain(this.tokens)},_updateCached:function(){this.$.mirror.innerHTML=this._constrain(this.tokens)}});</script><dom-module id="ha-config-section" assetpath="../panels/config/"><template><style include="iron-flex ha-style">.content{padding:28px 20px 0;max-width:1040px;margin:0 auto;}.header{@apply (--paper-font-display1);opacity:var(--dark-primary-opacity);}.together{margin-top:32px;}.intro{@apply (--paper-font-subhead);width:100%;max-width:400px;margin-right:40px;opacity:var(--dark-primary-opacity);}.panel{margin-top:-24px;}.panel ::slotted(*){margin-top:24px;display:block;}.narrow.content{max-width:640px;}.narrow .together{margin-top:20px;}.narrow .header{@apply (--paper-font-headline);}.narrow .intro{font-size:14px;padding-bottom:20px;margin-right:0;max-width:500px;}</style><div class$="[[computeContentClasses(isWide)]]"><div class="header"><slot name="header"></slot></div><div class$="[[computeClasses(isWide)]]"><div class="intro"><slot name="introduction"></slot></div><div class="flex panel"><slot></slot></div></div></div></template></dom-module><script>Polymer({is:"ha-config-section",properties:{hass:{type:Object},narrow:{type:Boolean},showMenu:{type:Boolean,value:!1},isWide:{type:Boolean,value:!1}},computeContentClasses:function(e){return e?"content ":"content narrow"},computeClasses:function(e){return"together layout "+(e?"horizontal":"vertical narrow")}});</script><dom-module id="ha-progress-button" assetpath="components/buttons/"><template><style>.container{position:relative;display:inline-block;}paper-button{transition:all 1s;}.success paper-button{color:white;background-color:var(--google-green-500);transition:none;}.error paper-button{color:white;background-color:var(--google-red-500);transition:none;}paper-button[disabled]{color:#c8c8c8;}.progress{@apply (--layout);@apply (--layout-center-center);position:absolute;top:0;left:0;right:0;bottom:0;}</style><div class="container" id="container"><paper-button id="button" disabled="[[computeDisabled(disabled, progress)]]" on-tap="buttonTapped"><slot></slot></paper-button><template is="dom-if" if="[[progress]]"><div class="progress"><paper-spinner active=""></paper-spinner></div></template></div></template></dom-module><script>Polymer({is:"ha-progress-button",properties:{hass:{type:Object},progress:{type:Boolean,value:!1},domain:{type:String},service:{type:String},serviceData:{type:Object,value:{}},disabled:{type:Boolean,value:!1}},tempClass:function(t){var e=this.$.container.classList;e.add(t),this.async(function(){e.remove(t)},1e3)},listeners:{tap:"buttonTapped"},buttonTapped:function(t){this.progress&&t.stopPropagation()},actionSuccess:function(){this.tempClass("success")},actionError:function(){this.tempClass("error")},computeDisabled:function(t,e){return t||e}});</script><dom-module id="ha-call-service-button" assetpath="components/buttons/"><template><ha-progress-button id="progress" progress="[[progress]]" on-tap="buttonTapped"><slot></slot></ha-progress-button><template is="dom-if" if="[[showDescription]]"><div style="color: grey">[[getDescription(hass, domain, service)]]</div></template></template></dom-module><script>Polymer({is:"ha-call-service-button",properties:{hass:{type:Object},progress:{type:Boolean,value:!1},domain:{type:String},service:{type:String},serviceData:{type:Object,value:{}},showDescription:{type:Boolean,value:!1}},buttonTapped:function(){this.progress=!0;var e=this,s={domain:this.domain,service:this.service,serviceData:this.serviceData};this.hass.callService(this.domain,this.service,this.serviceData).then(function(){e.progress=!1,e.$.progress.actionSuccess(),s.success=!0},function(){e.progress=!1,e.$.progress.actionError(),s.success=!1}).then(function(){e.fire("hass-service-called",s)})},getDescription:function(e,s,i){var r=e.config.services[s];if(!r)return"";var t=r[i];return t?t.description:""}});</script><dom-module id="paper-textarea" assetpath="../bower_components/paper-input/"><template><style>:host{display:block;}:host([hidden]){display:none !important;}label{pointer-events:none;}</style><paper-input-container no-label-float$="[[noLabelFloat]]" always-float-label="[[_computeAlwaysFloatLabel(alwaysFloatLabel,placeholder)]]" auto-validate$="[[autoValidate]]" disabled$="[[disabled]]" invalid="[[invalid]]"><label hidden$="[[!label]]" aria-hidden="true" for="input" slot="label">[[label]]</label><iron-autogrow-textarea id="input" class="paper-input-input" slot="input" aria-labelledby$="[[_ariaLabelledBy]]" aria-describedby$="[[_ariaDescribedBy]]" bind-value="{{value}}" invalid="{{invalid}}" validator$="[[validator]]" disabled$="[[disabled]]" autocomplete$="[[autocomplete]]" autofocus$="[[autofocus]]" inputmode$="[[inputmode]]" name$="[[name]]" placeholder$="[[placeholder]]" readonly$="[[readonly]]" required$="[[required]]" minlength$="[[minlength]]" maxlength$="[[maxlength]]" autocapitalize$="[[autocapitalize]]" rows$="[[rows]]" max-rows$="[[maxRows]]" on-change="_onChange"></iron-autogrow-textarea><template is="dom-if" if="[[errorMessage]]"><paper-input-error aria-live="assertive" slot="add-on">[[errorMessage]]</paper-input-error></template><template is="dom-if" if="[[charCounter]]"><paper-input-char-counter slot="add-on"></paper-input-char-counter></template></paper-input-container></template></dom-module><script>Polymer({is:"paper-textarea",behaviors:[Polymer.PaperInputBehavior,Polymer.IronFormElementBehavior],properties:{_ariaLabelledBy:{observer:"_ariaLabelledByChanged",type:String},_ariaDescribedBy:{observer:"_ariaDescribedByChanged",type:String},rows:{type:Number,value:1},maxRows:{type:Number,value:0}},_ariaLabelledByChanged:function(e){this.$.input.textarea.setAttribute("aria-labelledby",e)},_ariaDescribedByChanged:function(e){this.$.input.textarea.setAttribute("aria-describedby",e)},get _focusableElement(){return this.$.input.textarea}});</script><script>!function(){"use strict";var t=/\.splices$/,e=/\.length$/,i=/\.?#?([0-9]+)$/;Polymer.AppStorageBehavior={properties:{data:{type:Object,notify:!0,value:function(){return this.zeroValue}},sequentialTransactions:{type:Boolean,value:!1},log:{type:Boolean,value:!1}},observers:["__dataChanged(data.*)"],created:function(){this.__initialized=!1,this.__syncingToMemory=!1,this.__initializingStoredValue=null,this.__transactionQueueAdvances=Promise.resolve()},ready:function(){this._initializeStoredValue()},get isNew(){return!0},get transactionsComplete(){return this.__transactionQueueAdvances},get zeroValue(){},saveValue:function(t){return Promise.resolve()},reset:function(){},destroy:function(){return this.data=this.zeroValue,this.saveValue()},initializeStoredValue:function(){return this.isNew?Promise.resolve():this._getStoredValue("data").then(function(t){if(this._log("Got stored value!",t,this.data),null==t)return this._setStoredValue("data",this.data||this.zeroValue);this.syncToMemory(function(){this.set("data",t)})}.bind(this))},getStoredValue:function(t){return Promise.resolve()},setStoredValue:function(t,e){return Promise.resolve(e)},memoryPathToStoragePath:function(t){return t},storagePathToMemoryPath:function(t){return t},syncToMemory:function(t){this.__syncingToMemory||(this._group("Sync to memory."),this.__syncingToMemory=!0,t.call(this),this.__syncingToMemory=!1,this._groupEnd("Sync to memory."))},valueIsEmpty:function(t){return Array.isArray(t)?0===t.length:Object.prototype.isPrototypeOf(t)?0===Object.keys(t).length:null==t},_getStoredValue:function(t){return this.getStoredValue(this.memoryPathToStoragePath(t))},_setStoredValue:function(t,e){return this.setStoredValue(this.memoryPathToStoragePath(t),e)},_enqueueTransaction:function(t){if(this.sequentialTransactions)t=t.bind(this);else{var e=t.call(this);t=function(){return e}}return this.__transactionQueueAdvances=this.__transactionQueueAdvances.then(t).catch(function(t){this._error("Error performing queued transaction.",t)}.bind(this))},_log:function(){this.log&&console.log.apply(console,arguments)},_error:function(){this.log&&console.error.apply(console,arguments)},_group:function(){this.log&&console.group.apply(console,arguments)},_groupEnd:function(){this.log&&console.groupEnd.apply(console,arguments)},_initializeStoredValue:function(){if(!this.__initializingStoredValue){this._group("Initializing stored value.");var t=this.__initializingStoredValue=this.initializeStoredValue().then(function(){this.__initialized=!0,this.__initializingStoredValue=null,this._groupEnd("Initializing stored value.")}.bind(this));return this._enqueueTransaction(function(){return t})}},__dataChanged:function(t){if(!this.isNew&&!this.__syncingToMemory&&this.__initialized&&!this.__pathCanBeIgnored(t.path)){var e=this.__normalizeMemoryPath(t.path),i=t.value,n=i&&i.indexSplices;this._enqueueTransaction(function(){return this._log("Setting",e+":",n||i),n&&this.__pathIsSplices(e)&&(e=this.__parentPath(e),i=this.get(e)),this._setStoredValue(e,i)})}},__normalizeMemoryPath:function(t){for(var e=this,i=t.split("."),n=[],r=[],o=[],s=0;s<i.length;++s)r.push(i[s]),/^#/.test(i[s])?o.push(e.get(n).indexOf(e.get(r))):o.push(i[s]),n.push(i[s]);return o.join(".")},__parentPath:function(t){var e=t.split(".");return e.slice(0,e.length-1).join(".")},__pathCanBeIgnored:function(t){return e.test(t)&&Array.isArray(this.get(this.__parentPath(t)))},__pathIsSplices:function(e){return t.test(e)&&Array.isArray(this.get(this.__parentPath(e)))},__pathRefersToArray:function(i){return(t.test(i)||e.test(i))&&Array.isArray(this.get(this.__parentPath(i)))},__pathTailToIndex:function(t){var e=t.split(".").pop();return window.parseInt(e.replace(i,"$1"),10)}}}();</script><dom-module id="app-localstorage-document" assetpath="../bower_components/app-storage/app-localstorage/"><script>"use strict";Polymer({is:"app-localstorage-document",behaviors:[Polymer.AppStorageBehavior],properties:{key:{type:String,notify:!0},sessionOnly:{type:Boolean,value:!1},storage:{type:Object,computed:"__computeStorage(sessionOnly)"}},observers:["__storageSourceChanged(storage, key)"],attached:function(){this.listen(window,"storage","__onStorage"),this.listen(window.top,"app-local-storage-changed","__onAppLocalStorageChanged")},detached:function(){this.unlisten(window,"storage","__onStorage"),this.unlisten(window.top,"app-local-storage-changed","__onAppLocalStorageChanged")},get isNew(){return!this.key},saveValue:function(e){try{this.__setStorageValue(e,this.data)}catch(e){return Promise.reject(e)}return this.key=e,Promise.resolve()},reset:function(){this.key=null,this.data=this.zeroValue},destroy:function(){try{this.storage.removeItem(this.key),this.reset()}catch(e){return Promise.reject(e)}return Promise.resolve()},getStoredValue:function(e){var t;if(null!=this.key)try{t=null!=(t=this.__parseValueFromStorage())?this.get(e,{data:t}):void 0}catch(e){return Promise.reject(e)}return Promise.resolve(t)},setStoredValue:function(e,t){if(null!=this.key){try{this.__setStorageValue(this.key,this.data)}catch(e){return Promise.reject(e)}this.fire("app-local-storage-changed",this,{node:window.top})}return Promise.resolve(t)},__computeStorage:function(e){return e?window.sessionStorage:window.localStorage},__storageSourceChanged:function(e,t){this._initializeStoredValue()},__onStorage:function(e){e.key===this.key&&e.storageArea===this.storage&&this.syncToMemory(function(){this.set("data",this.__parseValueFromStorage())})},__onAppLocalStorageChanged:function(e){e.detail!==this&&e.detail.key===this.key&&e.detail.storage===this.storage&&this.syncToMemory(function(){this.set("data",e.detail.data)})},__parseValueFromStorage:function(){try{return JSON.parse(this.storage.getItem(this.key))}catch(e){console.error("Failed to parse value from storage for",this.key)}},__setStorageValue:function(e,t){this.storage.setItem(this.key,JSON.stringify(this.data))}});</script></dom-module><script>window.vaadin=window.vaadin||{},vaadin.elements=vaadin.elements||{},vaadin.elements.datepicker=vaadin.elements.datepicker||{},vaadin.elements.datepicker.DatePickerHelper={_getISOWeekNumber:function(e){var t=e.getDay();0===t&&(t=7);var a=4-t,n=new Date(e.getTime()+24*a*3600*1e3),i=new Date(0,0);i.setFullYear(n.getFullYear());var r=n.getTime()-i.getTime(),l=Math.round(r/864e5);return Math.floor(l/7+1)},_dateEquals:function(e,t){return e instanceof Date&&t instanceof Date&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()},_dateAllowed:function(e,t,a){return(!t||e>=t)&&(!a||e<=a)},_getClosestDate:function(e,t){return t.filter(function(e){return void 0!==e}).reduce(function(t,a){return a?t?Math.abs(e.getTime()-a.getTime())<Math.abs(t.getTime()-e.getTime())?a:t:a:t})}};</script><dom-module id="vaadin-month-calendar" assetpath="../bower_components/vaadin-date-picker/"><template><style>:host{display:block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font:inherit;@apply --paper-font-common-base;@apply --vaadin-date-picker-calendar;}#title{color:var(--primary-text-color);text-align:center;padding:6px 0;@apply --paper-font-subhead;@apply --vaadin-date-picker-calendar-title;}#monthGrid{display:flex;flex-wrap:wrap;}#monthGrid div{text-align:center;width:calc(14.285714286% - 2px);margin:0 1px;box-sizing:border-box;padding:6px 0;@apply --paper-font-body1;@apply --vaadin-date-picker-calendar-cell;}:host([week-numbers]) #monthGrid div{width:calc(12.5% - 2px);}#monthGrid div:not(:empty){cursor:pointer;color:var(--primary-text-color);@apply --vaadin-date-picker-calendar-date-cell;}#monthGrid div:not(:empty):not([disabled]):not(.weekday):not(.weeknumber):active{background:var(--light-primary-color);border-radius:2px;}#monthGrid div.weekday{text-transform:uppercase;color:var(--secondary-text-color);cursor:default;padding:8px 0;@apply --paper-font-caption;@apply --vaadin-date-picker-calendar-weekday-cell;}#monthGrid div.weekday:empty,
-      #monthGrid div.weeknumber{width:calc(10% - 2px);padding-right:1.25%;}#monthGrid div[today]{position:relative;color:var(--primary-color);@apply --vaadin-date-picker-calendar-cell-today;}#monthGrid div[today][selected]{@apply --vaadin-date-picker-calendar-cell-today-selected;}#monthGrid div[focused]{background:var(--light-primary-color);box-sizing:border-box;border-radius:2px;@apply --vaadin-date-picker-calendar-cell-focused;}:host([focused]) #monthGrid div[focused]{background:var(--primary-color);color:var(--primary-background-color);@apply --vaadin-date-picker-calendar-focused-cell-focused;}#monthGrid div[selected]{font-weight:600;@apply --vaadin-date-picker-calendar-cell-selected;}#monthGrid div[today][selected]{@apply --vaadin-date-picker-calendar-cell-today-selected;}#monthGrid div[disabled]{opacity:0.3;cursor:default;@apply --vaadin-date-picker-calendar-cell-disabled;}#monthGrid div.weeknumber{cursor:default;color:rgba(0, 0, 0, 0.4);@apply --paper-font-caption;@apply --vaadin-date-picker-calendar-weeknumber-cell;}</style><div id="title" role="heading">[[_getTitle(month, i18n.monthNames)]]</div><div id="monthGrid" on-tap="_handleTap" on-touchend="_preventDefault" on-touchstart="_onMonthGridTouchStart"><template is="dom-repeat" items="[[_getWeekDayNames(i18n.weekdays, i18n.weekdaysShort, showWeekNumbers, i18n.firstDayOfWeek)]]"><div class="weekday" role="heading" aria-label$="[[item.weekDay]]">[[item.weekDayShort]]</div></template><template is="dom-repeat" items="[[_days]]"><template is="dom-if" if="[[_showWeekSeparator(showWeekNumbers, i18n.firstDayOfWeek, index)]]"><div class="weeknumber" role="heading" aria-label$="[[i18n.week]] [[_getWeekNumber(item, _days)]]">[[_getWeekNumber(item, _days)]]</div></template><div today$="[[_isToday(item)]]" selected$="[[_dateEquals(item, selectedDate)]]" focused$="[[_dateEquals(item, focusedDate)]]" date="[[item]]" disabled$="[[!_dateAllowed(item, minDate, maxDate)]]" role$="[[_getRole(item)]]" aria-label$="[[_getAriaLabel(item)]]" aria-disabled$="[[_getAriaDisabled(item, minDate, maxDate)]]">[[_getDate(item)]]</div></template></div></template><script>Polymer({is:"vaadin-month-calendar",properties:{month:{type:Date,value:new Date},selectedDate:{type:Date,notify:!0},focusedDate:Date,showWeekNumbers:{type:Boolean,value:!1},i18n:{type:Object},ignoreTaps:Boolean,_notTapping:Boolean,minDate:{type:Date,value:null},maxDate:{type:Date,value:null},_days:{type:Array,computed:"_getDays(month, i18n.firstDayOfWeek, minDate, maxDate)"}},observers:["_showWeekNumbersChanged(showWeekNumbers, i18n.firstDayOfWeek)"],_getTitle:function(e,t){if(void 0!==e&&void 0!==t)return this.i18n.formatTitle(t[e.getMonth()],e.getFullYear())},_dateEquals:vaadin.elements.datepicker.DatePickerHelper._dateEquals,_onMonthGridTouchStart:function(){this._notTapping=!1,this.async(function(){this._notTapping=!0},300)},_dateAdd:function(e,t){e.setDate(e.getDate()+t)},_applyFirstDayOfWeek:function(e,t){if(void 0!==e&&void 0!==t)return e.slice(t).concat(e.slice(0,t))},_getWeekDayNames:function(e,t,a,n){if(void 0!==e&&void 0!==t&&void 0!==a&&void 0!==n)return e=this._applyFirstDayOfWeek(e,n),t=this._applyFirstDayOfWeek(t,n),e=e.map(function(e,a){return{weekDay:e,weekDayShort:t[a]}}),a&&1===n&&e.unshift({weekDay:"",weekDayShort:""}),e},_getDate:function(e){return e?e.getDate():""},_showWeekNumbersChanged:function(e,t){this.toggleAttribute("week-numbers",e&&1===t)},_showWeekSeparator:function(e,t,a){return e&&1===t&&a%7==0},_isToday:function(e){return this._dateEquals(new Date,e)},_getDays:function(e,t){var a=this;if(void 0!==e&&void 0!==t){var n=new Date(0,0);for(n.setFullYear(e.getFullYear()),n.setMonth(e.getMonth()),n.setDate(1);n.getDay()!==t;)a._dateAdd(n,-1);for(var i=[],o=n.getMonth(),r=e.getMonth();n.getMonth()===r||n.getMonth()===o;)i.push(n.getMonth()===r?new Date(n.getTime()):null),a._dateAdd(n,1);return i}},_getWeekNumber:function(e,t){if(void 0!==e&&void 0!==t)return e||(e=t.reduce(function(e,t){return!e&&t?t:e})),vaadin.elements.datepicker.DatePickerHelper._getISOWeekNumber(e)},_handleTap:function(e){this.ignoreTaps||this._notTapping||!e.target.date||e.target.hasAttribute("disabled")||(this.selectedDate=e.target.date,this.fire("date-tap"))},_preventDefault:function(e){e.preventDefault()},_dateAllowed:vaadin.elements.datepicker.DatePickerHelper._dateAllowed,_getRole:function(e){return e?"button":"presentational"},_getAriaLabel:function(e){if(!e)return"";var t=this._getDate(e)+" "+this.i18n.monthNames[e.getMonth()]+" "+e.getFullYear()+", "+this.i18n.weekdays[e.getDay()];return this._isToday(e)&&(t+=", "+this.i18n.today),t},_getAriaDisabled:function(e,t,a){if(void 0!==e&&void 0!==t&&void 0!==a)return this._dateAllowed(e,t,a)?"false":"true"}});</script></dom-module><dom-module id="vaadin-infinite-scroller" assetpath="../bower_components/vaadin-date-picker/"><template><style>:host{display:block;overflow:hidden;height:500px;}#scroller{position:relative;height:100%;overflow:auto;outline:none;margin-right:-40px;-webkit-overflow-scrolling:touch;-ms-overflow-style:none;overflow-x:hidden;}#scroller.notouchscroll{-webkit-overflow-scrolling:auto;}#scroller::-webkit-scrollbar{display:none;}.buffer{position:absolute;width:100%;box-sizing:border-box;padding-right:40px;@apply --vaadin-infinite-scroller-buffer;}:host(:not([init-animation-done])) .buffer > *{animation:fadein 0.2s;}@keyframes fadein{from{opacity:0;}to{opacity:1;}}</style><div id="scroller"><div class="buffer"></div><div class="buffer"></div><div id="fullHeight"></div></div></template></dom-module><script>Polymer({is:"vaadin-infinite-scroller",behaviors:[Polymer.Templatizer],properties:{itemHeight:{type:Number,value:50},bufferSize:{type:Number,value:20},_initialScroll:{value:5e5},_initialIndex:{value:0},_buffers:Array,_preventScrollEvent:Boolean,_bufferHeight:Number,_mayHaveMomentum:Boolean,_initialized:Boolean,active:Boolean},observers:["_activated(active)"],_activated:function(t){t&&!this._initialized&&(this._createPool(),this._initialized=!0)},listeners:{animationend:"_animationEnd"},_animationEnd:function(){this.toggleAttribute("init-animation-done",!0)},_finishInit:function(){this._initDone||(this._buffers.forEach(function(t){[].forEach.call(t.children,function(t){this._ensureStampedInstance(t)}.bind(this))},this),this._buffers[0].translateY||this._reset(),this._initDone=!0)},ready:function(){this._bufferHeight=this.itemHeight*this.bufferSize,this._buffers=Array.prototype.slice.call(Polymer.dom(this.root).querySelectorAll(".buffer")),this.$.fullHeight.style.height=2*this._initialScroll+"px";var t=Polymer.dom(this).querySelector("template");this.templatize(t),navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&(this.$.scroller.tabIndex=-1)},_translateBuffer:function(t){var i=t?1:0;this._buffers[i].translateY=this._buffers[i?0:1].translateY+this._bufferHeight*(i?-1:1),this.transform("translate3d(0, "+this._buffers[i].translateY+"px, 0)",this._buffers[i]),this._buffers[i].updated=!1,this._buffers.reverse()},_scroll:function(){var t=this.$.scroller.scrollTop;(t<this._bufferHeight||t>2*this._initialScroll-this._bufferHeight)&&(this._initialIndex=~~this.position,this._reset());var i=this.$$(".buffer").offsetTop,e=t>this._buffers[1].translateY+this.itemHeight+i,s=t<this._buffers[0].translateY+this.itemHeight+i;(e||s)&&(this._translateBuffer(s),this._updateClones()),this._preventScrollEvent||(this.fire("custom-scroll",void 0,{bubbles:!1}),this._mayHaveMomentum=!0),this._preventScrollEvent=!1,this.debounce("scrollFinish",function(){var t=this.$.scroller.getBoundingClientRect();this._isVisible(this._buffers[0],t)||this._isVisible(this._buffers[1],t)||(this.position=this.position)},200)},set position(t){this._preventScrollEvent=!0,t>this._firstIndex&&t<this._firstIndex+2*this.bufferSize?this.$.scroller.scrollTop=this.itemHeight*(t-this._firstIndex)+this._buffers[0].translateY:(this._initialIndex=~~t,this._reset(),this.unlisten(this.$.scroller,"scroll","_scroll"),this.$.scroller.scrollTop+=t%1*this.itemHeight,this.listen(this.$.scroller,"scroll","_scroll")),this._mayHaveMomentum&&(this.$.scroller.classList.add("notouchscroll"),this._mayHaveMomentum=!1,this.async(function(){this.$.scroller.classList.remove("notouchscroll")},10))},get position(){return(this.$.scroller.scrollTop-this._buffers[0].translateY)/this.itemHeight+this._firstIndex},_reset:function(){this.unlisten(this.$.scroller,"scroll","_scroll"),this.$.scroller.scrollTop=this._initialScroll,this._buffers[0].translateY=this._initialScroll-this._bufferHeight,this._buffers[1].translateY=this._initialScroll,this._buffers.forEach(function(t){Polymer.Base.transform("translate3d(0, "+t.translateY+"px, 0)",t)}),this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones(!0),this.debounce("updateAllClones",function(){this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones()},200),this.listen(this.$.scroller,"scroll","_scroll")},_createPool:function(){var t=this.getBoundingClientRect();this._buffers.forEach(function(i){for(var e=this,s=0;s<this.bufferSize;s++){var r=document.createElement("div");r.style.height=e.itemHeight+"px",r.instance={},Polymer.dom(i).appendChild(r),e.async(function(t,i){this._isVisible(t,i)&&this._ensureStampedInstance(t)}.bind(e,r,t),1),Polymer.RenderStatus.afterNextRender(r,e._finishInit.bind(e))}},this)},_ensureStampedInstance:function(t){if(!t.firstElementChild){var i=t.instance;t.instance=this.stamp({}),Polymer.dom(t).appendChild(t.instance.root),Object.keys(i).forEach(function(e){t.instance.set(e,i[e])})}},_updateClones:function(t){this._firstIndex=~~((this._buffers[0].translateY-this._initialScroll)/this.itemHeight)+this._initialIndex;var i=t?this.$.scroller.getBoundingClientRect():void 0;this._buffers.forEach(function(e,s){if(!e.updated){var r=this._firstIndex+this.bufferSize*s;[].forEach.call(e.children,function(e,s){t&&!this._isVisible(e,i)||(e.instance.index=r+s)}.bind(this)),e.updated=!0}},this)},_isVisible:function(t,i){var e=t.getBoundingClientRect();return e.bottom>i.top&&e.top<i.bottom},created:function(){this._parentModel=!0},_forwardHostPropV2:function(t,i){this._forwardParentProp(t,i)},_forwardParentProp:function(t,i){"index"!==t&&this._buffers.forEach(function(e){[].forEach.call(e.children,function(e){e.instance[t]=i})})}});</script><iron-iconset-svg size="24" name="vaadin-date-picker"><svg><defs><g id="chevron-right"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"></path></g><g id="clear"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"></path></g><g id="event"><path d="M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"></path></g></defs></svg></iron-iconset-svg><dom-module id="vaadin-date-picker-overlay" assetpath="../bower_components/vaadin-date-picker/"><template><style>:host{display:flex;flex-direction:column;height:100%;width:100%;background:var(--primary-background-color);font:inherit;outline:none;@apply --paper-font-common-base;@apply --shadow-elevation-2dp;@apply --vaadin-date-picker-overlay;}#toolbar{display:flex;justify-content:space-between;padding:14px;background:var(--primary-background-color);z-index:2;@apply --paper-font-button;@apply --shadow-elevation-2dp;flex-shrink:0;transform:translateZ(0);color:var(--primary-color);@apply --vaadin-date-picker-toolbar;}#toolbar:not([desktop]){cursor:pointer;}#toolbar iron-icon{fill:var(--primary-color);padding:0;transition:transform 200ms;will-change:transform;--iron-icon-width:20px;--iron-icon-height:20px;@apply --vaadin-date-picker-toolbar-icon;}#toolbar iron-icon[rotate]{transform:rotate(180deg);}#toolbar iron-icon[hidden]{display:none;}#scrollers{display:flex;flex-direction:row;height:100%;width:100%;position:relative;overflow:hidden;}#scrollers #fade{pointer-events:none;display:block;background:linear-gradient(90deg, var(--primary-background-color), rgba(255, 255, 255, 0));width:50px;position:absolute;height:100%;z-index:1;transform:translateX(-100%);@apply --vaadin-date-picker-scrollers-fade;}#scrollers[desktop] #fade{display:none;}#scroller,
+      :host-context([dir="rtl"]) iron-icon{left:0;right:auto;}:host([no-label-float]) iron-icon{margin-top:0px;}.error{display:inline-block;visibility:hidden;color:var(--paper-dropdown-error-color, var(--error-color));@apply --paper-font-caption;position:absolute;left:0;right:0;bottom:-12px;}:host([invalid]) .error{visibility:visible;}</style><span role="button"></span><paper-menu-button id="menuButton" vertical-align="[[verticalAlign]]" horizontal-align="[[horizontalAlign]]" vertical-offset="[[_computeMenuVerticalOffset(noLabelFloat)]]" disabled="[[disabled]]" no-animations="[[noAnimations]]" on-iron-select="_onIronSelect" on-iron-deselect="_onIronDeselect" opened="{{opened}}" close-on-activate="" allow-outside-scroll="[[allowOutsideScroll]]"><div class="dropdown-trigger" slot="dropdown-trigger"><label class$="[[_computeLabelClass(noLabelFloat,alwaysFloatLabel,hasContent)]]">[[label]]</label><div id="input" tabindex="-1">&nbsp;</div><iron-icon icon="paper-dropdown-menu:arrow-drop-down"></iron-icon><span class="error">[[errorMessage]]</span></div><slot id="content" name="dropdown-content" slot="dropdown-content"></slot></paper-menu-button></template><script>!function(){"use strict";Polymer({is:"paper-dropdown-menu-light",behaviors:[Polymer.IronButtonState,Polymer.IronControlState,Polymer.PaperRippleBehavior,Polymer.IronFormElementBehavior,Polymer.IronValidatableBehavior],properties:{selectedItemLabel:{type:String,notify:!0,readOnly:!0},selectedItem:{type:Object,notify:!0,readOnly:!0},value:{type:String,notify:!0,readOnly:!0,observer:"_valueChanged"},label:{type:String},placeholder:{type:String},opened:{type:Boolean,notify:!0,value:!1,observer:"_openedChanged"},allowOutsideScroll:{type:Boolean,value:!1},noLabelFloat:{type:Boolean,value:!1,reflectToAttribute:!0},alwaysFloatLabel:{type:Boolean,value:!1},noAnimations:{type:Boolean,value:!1},horizontalAlign:{type:String,value:"right"},verticalAlign:{type:String,value:"top"},hasContent:{type:Boolean,readOnly:!0}},listeners:{tap:"_onTap"},keyBindings:{"up down":"open",esc:"close"},hostAttributes:{tabindex:0,role:"combobox","aria-autocomplete":"none","aria-haspopup":"true"},observers:["_selectedItemChanged(selectedItem)"],attached:function(){var e=this.contentElement;e&&e.selectedItem&&this._setSelectedItem(e.selectedItem)},get contentElement(){for(var e=Polymer.dom(this.$.content).getDistributedNodes(),t=0,n=e.length;t<n;t++)if(e[t].nodeType===Node.ELEMENT_NODE)return e[t]},open:function(){this.$.menuButton.open()},close:function(){this.$.menuButton.close()},_onIronSelect:function(e){this._setSelectedItem(e.detail.item)},_onIronDeselect:function(e){this._setSelectedItem(null)},_onTap:function(e){Polymer.Gestures.findOriginalTarget(e)===this&&this.open()},_selectedItemChanged:function(e){var t="";t=e?e.label||e.getAttribute("label")||e.textContent.trim():"",this._setValue(t),this._setSelectedItemLabel(t)},_computeMenuVerticalOffset:function(e){return e?-4:8},_getValidity:function(e){return this.disabled||!this.required||this.required&&!!this.value},_openedChanged:function(){var e=this.opened?"true":"false",t=this.contentElement;t&&t.setAttribute("aria-expanded",e)},_computeLabelClass:function(e,t,n){var o="";return!0===e?n?"label-is-hidden":"":((n||!0===t)&&(o+=" label-is-floating"),o)},_valueChanged:function(){this.$.input&&this.$.input.textContent!==this.value&&(this.$.input.textContent=this.value),this._setHasContent(!!this.value)}})}();</script></dom-module><dom-module id="iron-autogrow-textarea" assetpath="../bower_components/iron-autogrow-textarea/"><template><style>:host{display:inline-block;position:relative;width:400px;border:1px solid;padding:2px;-moz-appearance:textarea;-webkit-appearance:textarea;overflow:hidden;}.mirror-text{visibility:hidden;word-wrap:break-word;@apply --iron-autogrow-textarea;}.fit{@apply --layout-fit;}textarea{position:relative;outline:none;border:none;resize:none;background:inherit;color:inherit;width:100%;height:100%;font-size:inherit;font-family:inherit;line-height:inherit;text-align:inherit;@apply --iron-autogrow-textarea;}textarea::-webkit-input-placeholder{@apply --iron-autogrow-textarea-placeholder;}textarea:-moz-placeholder{@apply --iron-autogrow-textarea-placeholder;}textarea::-moz-placeholder{@apply --iron-autogrow-textarea-placeholder;}textarea:-ms-input-placeholder{@apply --iron-autogrow-textarea-placeholder;}</style><div id="mirror" class="mirror-text" aria-hidden="true">&nbsp;</div><div class="textarea-container fit"><textarea id="textarea" name$="[[name]]" aria-label$="[[label]]" autocomplete$="[[autocomplete]]" autofocus$="[[autofocus]]" inputmode$="[[inputmode]]" placeholder$="[[placeholder]]" readonly$="[[readonly]]" required$="[[required]]" disabled$="[[disabled]]" rows$="[[rows]]" minlength$="[[minlength]]" maxlength$="[[maxlength]]"></textarea></div></template></dom-module><script>Polymer({is:"iron-autogrow-textarea",behaviors:[Polymer.IronValidatableBehavior,Polymer.IronControlState],properties:{value:{observer:"_valueChanged",type:String,notify:!0},bindValue:{observer:"_bindValueChanged",type:String,notify:!0},rows:{type:Number,value:1,observer:"_updateCached"},maxRows:{type:Number,value:0,observer:"_updateCached"},autocomplete:{type:String,value:"off"},autofocus:{type:Boolean,value:!1},inputmode:{type:String},placeholder:{type:String},readonly:{type:String},required:{type:Boolean},minlength:{type:Number},maxlength:{type:Number},label:{type:String}},listeners:{input:"_onInput"},get textarea(){return this.$.textarea},get selectionStart(){return this.$.textarea.selectionStart},get selectionEnd(){return this.$.textarea.selectionEnd},set selectionStart(e){this.$.textarea.selectionStart=e},set selectionEnd(e){this.$.textarea.selectionEnd=e},attached:function(){navigator.userAgent.match(/iP(?:[oa]d|hone)/)&&(this.$.textarea.style.marginLeft="-3px")},validate:function(){var e=this.$.textarea.validity.valid;return e&&(this.required&&""===this.value?e=!1:this.hasValidator()&&(e=Polymer.IronValidatableBehavior.validate.call(this,this.value))),this.invalid=!e,this.fire("iron-input-validate"),e},_bindValueChanged:function(e){this.value=e},_valueChanged:function(e){var t=this.textarea;t&&(t.value!==e&&(t.value=e||0===e?e:""),this.bindValue=e,this.$.mirror.innerHTML=this._valueForMirror())},_onInput:function(e){var t=Polymer.dom(e).path;this.value=t?t[0].value:e.target.value},_constrain:function(e){var t;for(e=e||[""],t=this.maxRows>0&&e.length>this.maxRows?e.slice(0,this.maxRows):e.slice(0);this.rows>0&&t.length<this.rows;)t.push("");return t.join("<br/>")+"&#160;"},_valueForMirror:function(){var e=this.textarea;if(e)return this.tokens=e&&e.value?e.value.replace(/&/gm,"&amp;").replace(/"/gm,"&quot;").replace(/'/gm,"&#39;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;").split("\n"):[""],this._constrain(this.tokens)},_updateCached:function(){this.$.mirror.innerHTML=this._constrain(this.tokens)}});</script><dom-module id="ha-config-section" assetpath="../panels/config/"><template><style include="iron-flex ha-style">.content{padding:28px 20px 0;max-width:1040px;margin:0 auto;}.header{@apply (--paper-font-display1);opacity:var(--dark-primary-opacity);}.together{margin-top:32px;}.intro{@apply (--paper-font-subhead);width:100%;max-width:400px;margin-right:40px;opacity:var(--dark-primary-opacity);}.panel{margin-top:-24px;}.panel ::slotted(*){margin-top:24px;display:block;}.narrow.content{max-width:640px;}.narrow .together{margin-top:20px;}.narrow .header{@apply (--paper-font-headline);}.narrow .intro{font-size:14px;padding-bottom:20px;margin-right:0;max-width:500px;}</style><div class$="[[computeContentClasses(isWide)]]"><div class="header"><slot name="header"></slot></div><div class$="[[computeClasses(isWide)]]"><div class="intro"><slot name="introduction"></slot></div><div class="flex panel"><slot></slot></div></div></div></template></dom-module><script>Polymer({is:"ha-config-section",properties:{hass:{type:Object},narrow:{type:Boolean},showMenu:{type:Boolean,value:!1},isWide:{type:Boolean,value:!1}},computeContentClasses:function(e){return e?"content ":"content narrow"},computeClasses:function(e){return"together layout "+(e?"horizontal":"vertical narrow")}});</script><dom-module id="ha-progress-button" assetpath="components/buttons/"><template><style>.container{position:relative;display:inline-block;}paper-button{transition:all 1s;}.success paper-button{color:white;background-color:var(--google-green-500);transition:none;}.error paper-button{color:white;background-color:var(--google-red-500);transition:none;}paper-button[disabled]{color:#c8c8c8;}.progress{@apply (--layout);@apply (--layout-center-center);position:absolute;top:0;left:0;right:0;bottom:0;}</style><div class="container" id="container"><paper-button id="button" disabled="[[computeDisabled(disabled, progress)]]" on-tap="buttonTapped"><slot></slot></paper-button><template is="dom-if" if="[[progress]]"><div class="progress"><paper-spinner active=""></paper-spinner></div></template></div></template></dom-module><script>Polymer({is:"ha-progress-button",properties:{hass:{type:Object},progress:{type:Boolean,value:!1},domain:{type:String},service:{type:String},serviceData:{type:Object,value:{}},disabled:{type:Boolean,value:!1}},tempClass:function(t){var e=this.$.container.classList;e.add(t),this.async(function(){e.remove(t)},1e3)},listeners:{tap:"buttonTapped"},buttonTapped:function(t){this.progress&&t.stopPropagation()},actionSuccess:function(){this.tempClass("success")},actionError:function(){this.tempClass("error")},computeDisabled:function(t,e){return t||e}});</script><dom-module id="ha-call-service-button" assetpath="components/buttons/"><template><ha-progress-button id="progress" progress="[[progress]]" on-tap="buttonTapped"><slot></slot></ha-progress-button><template is="dom-if" if="[[showDescription]]"><div style="color: grey">[[getDescription(hass, domain, service)]]</div></template></template></dom-module><script>Polymer({is:"ha-call-service-button",properties:{hass:{type:Object},progress:{type:Boolean,value:!1},domain:{type:String},service:{type:String},serviceData:{type:Object,value:{}},showDescription:{type:Boolean,value:!1}},buttonTapped:function(){this.progress=!0;var e=this,s={domain:this.domain,service:this.service,serviceData:this.serviceData};this.hass.callService(this.domain,this.service,this.serviceData).then(function(){e.progress=!1,e.$.progress.actionSuccess(),s.success=!0},function(){e.progress=!1,e.$.progress.actionError(),s.success=!1}).then(function(){e.fire("hass-service-called",s)})},getDescription:function(e,s,i){var r=e.config.services[s];if(!r)return"";var t=r[i];return t?t.description:""}});</script><dom-module id="paper-textarea" assetpath="../bower_components/paper-input/"><template><style>:host{display:block;}:host([hidden]){display:none !important;}label{pointer-events:none;}</style><paper-input-container no-label-float$="[[noLabelFloat]]" always-float-label="[[_computeAlwaysFloatLabel(alwaysFloatLabel,placeholder)]]" auto-validate$="[[autoValidate]]" disabled$="[[disabled]]" invalid="[[invalid]]"><label hidden$="[[!label]]" aria-hidden="true" for="input" slot="label">[[label]]</label><iron-autogrow-textarea id="input" class="paper-input-input" slot="input" aria-labelledby$="[[_ariaLabelledBy]]" aria-describedby$="[[_ariaDescribedBy]]" bind-value="{{value}}" invalid="{{invalid}}" validator$="[[validator]]" disabled$="[[disabled]]" autocomplete$="[[autocomplete]]" autofocus$="[[autofocus]]" inputmode$="[[inputmode]]" name$="[[name]]" placeholder$="[[placeholder]]" readonly$="[[readonly]]" required$="[[required]]" minlength$="[[minlength]]" maxlength$="[[maxlength]]" autocapitalize$="[[autocapitalize]]" rows$="[[rows]]" max-rows$="[[maxRows]]" on-change="_onChange"></iron-autogrow-textarea><template is="dom-if" if="[[errorMessage]]"><paper-input-error aria-live="assertive" slot="add-on">[[errorMessage]]</paper-input-error></template><template is="dom-if" if="[[charCounter]]"><paper-input-char-counter slot="add-on"></paper-input-char-counter></template></paper-input-container></template></dom-module><script>Polymer({is:"paper-textarea",behaviors:[Polymer.PaperInputBehavior,Polymer.IronFormElementBehavior],properties:{_ariaLabelledBy:{observer:"_ariaLabelledByChanged",type:String},_ariaDescribedBy:{observer:"_ariaDescribedByChanged",type:String},rows:{type:Number,value:1},maxRows:{type:Number,value:0}},_ariaLabelledByChanged:function(e){this.$.input.textarea.setAttribute("aria-labelledby",e)},_ariaDescribedByChanged:function(e){this.$.input.textarea.setAttribute("aria-describedby",e)},get _focusableElement(){return this.$.input.textarea}});</script><script>!function(){"use strict";var t=/\.splices$/,e=/\.length$/,i=/\.?#?([0-9]+)$/;Polymer.AppStorageBehavior={properties:{data:{type:Object,notify:!0,value:function(){return this.zeroValue}},sequentialTransactions:{type:Boolean,value:!1},log:{type:Boolean,value:!1}},observers:["__dataChanged(data.*)"],created:function(){this.__initialized=!1,this.__syncingToMemory=!1,this.__initializingStoredValue=null,this.__transactionQueueAdvances=Promise.resolve()},ready:function(){this._initializeStoredValue()},get isNew(){return!0},get transactionsComplete(){return this.__transactionQueueAdvances},get zeroValue(){},saveValue:function(t){return Promise.resolve()},reset:function(){},destroy:function(){return this.data=this.zeroValue,this.saveValue()},initializeStoredValue:function(){return this.isNew?Promise.resolve():this._getStoredValue("data").then(function(t){if(this._log("Got stored value!",t,this.data),null==t)return this._setStoredValue("data",this.data||this.zeroValue);this.syncToMemory(function(){this.set("data",t)})}.bind(this))},getStoredValue:function(t){return Promise.resolve()},setStoredValue:function(t,e){return Promise.resolve(e)},memoryPathToStoragePath:function(t){return t},storagePathToMemoryPath:function(t){return t},syncToMemory:function(t){this.__syncingToMemory||(this._group("Sync to memory."),this.__syncingToMemory=!0,t.call(this),this.__syncingToMemory=!1,this._groupEnd("Sync to memory."))},valueIsEmpty:function(t){return Array.isArray(t)?0===t.length:Object.prototype.isPrototypeOf(t)?0===Object.keys(t).length:null==t},_getStoredValue:function(t){return this.getStoredValue(this.memoryPathToStoragePath(t))},_setStoredValue:function(t,e){return this.setStoredValue(this.memoryPathToStoragePath(t),e)},_enqueueTransaction:function(t){if(this.sequentialTransactions)t=t.bind(this);else{var e=t.call(this);t=function(){return e}}return this.__transactionQueueAdvances=this.__transactionQueueAdvances.then(t).catch(function(t){this._error("Error performing queued transaction.",t)}.bind(this))},_log:function(){this.log&&console.log.apply(console,arguments)},_error:function(){this.log&&console.error.apply(console,arguments)},_group:function(){this.log&&console.group.apply(console,arguments)},_groupEnd:function(){this.log&&console.groupEnd.apply(console,arguments)},_initializeStoredValue:function(){if(!this.__initializingStoredValue){this._group("Initializing stored value.");var t=this.__initializingStoredValue=this.initializeStoredValue().then(function(){this.__initialized=!0,this.__initializingStoredValue=null,this._groupEnd("Initializing stored value.")}.bind(this));return this._enqueueTransaction(function(){return t})}},__dataChanged:function(t){if(!this.isNew&&!this.__syncingToMemory&&this.__initialized&&!this.__pathCanBeIgnored(t.path)){var e=this.__normalizeMemoryPath(t.path),i=t.value,n=i&&i.indexSplices;this._enqueueTransaction(function(){return this._log("Setting",e+":",n||i),n&&this.__pathIsSplices(e)&&(e=this.__parentPath(e),i=this.get(e)),this._setStoredValue(e,i)})}},__normalizeMemoryPath:function(t){for(var e=t.split("."),i=[],n=[],r=[],o=0;o<e.length;++o)n.push(e[o]),/^#/.test(e[o])?r.push(this.get(i).indexOf(this.get(n))):r.push(e[o]),i.push(e[o]);return r.join(".")},__parentPath:function(t){var e=t.split(".");return e.slice(0,e.length-1).join(".")},__pathCanBeIgnored:function(t){return e.test(t)&&Array.isArray(this.get(this.__parentPath(t)))},__pathIsSplices:function(e){return t.test(e)&&Array.isArray(this.get(this.__parentPath(e)))},__pathRefersToArray:function(i){return(t.test(i)||e.test(i))&&Array.isArray(this.get(this.__parentPath(i)))},__pathTailToIndex:function(t){var e=t.split(".").pop();return window.parseInt(e.replace(i,"$1"),10)}}}();</script><dom-module id="app-localstorage-document" assetpath="../bower_components/app-storage/app-localstorage/"><script>"use strict";Polymer({is:"app-localstorage-document",behaviors:[Polymer.AppStorageBehavior],properties:{key:{type:String,notify:!0},sessionOnly:{type:Boolean,value:!1},storage:{type:Object,computed:"__computeStorage(sessionOnly)"}},observers:["__storageSourceChanged(storage, key)"],attached:function(){this.listen(window,"storage","__onStorage"),this.listen(window.top,"app-local-storage-changed","__onAppLocalStorageChanged")},detached:function(){this.unlisten(window,"storage","__onStorage"),this.unlisten(window.top,"app-local-storage-changed","__onAppLocalStorageChanged")},get isNew(){return!this.key},saveValue:function(e){try{this.__setStorageValue(e,this.data)}catch(e){return Promise.reject(e)}return this.key=e,Promise.resolve()},reset:function(){this.key=null,this.data=this.zeroValue},destroy:function(){try{this.storage.removeItem(this.key),this.reset()}catch(e){return Promise.reject(e)}return Promise.resolve()},getStoredValue:function(e){var t;if(null!=this.key)try{t=null!=(t=this.__parseValueFromStorage())?this.get(e,{data:t}):void 0}catch(e){return Promise.reject(e)}return Promise.resolve(t)},setStoredValue:function(e,t){if(null!=this.key){try{this.__setStorageValue(this.key,this.data)}catch(e){return Promise.reject(e)}this.fire("app-local-storage-changed",this,{node:window.top})}return Promise.resolve(t)},__computeStorage:function(e){return e?window.sessionStorage:window.localStorage},__storageSourceChanged:function(e,t){this._initializeStoredValue()},__onStorage:function(e){e.key===this.key&&e.storageArea===this.storage&&this.syncToMemory(function(){this.set("data",this.__parseValueFromStorage())})},__onAppLocalStorageChanged:function(e){e.detail!==this&&e.detail.key===this.key&&e.detail.storage===this.storage&&this.syncToMemory(function(){this.set("data",e.detail.data)})},__parseValueFromStorage:function(){try{return JSON.parse(this.storage.getItem(this.key))}catch(e){console.error("Failed to parse value from storage for",this.key)}},__setStorageValue:function(e,t){this.storage.setItem(this.key,JSON.stringify(this.data))}});</script></dom-module><script>window.vaadin=window.vaadin||{},vaadin.elements=vaadin.elements||{},vaadin.elements.datepicker=vaadin.elements.datepicker||{},vaadin.elements.datepicker.DatePickerHelper={_getISOWeekNumber:function(e){var t=e.getDay();0===t&&(t=7);var a=4-t,n=new Date(e.getTime()+24*a*3600*1e3),i=new Date(0,0);i.setFullYear(n.getFullYear());var r=n.getTime()-i.getTime(),l=Math.round(r/864e5);return Math.floor(l/7+1)},_dateEquals:function(e,t){return e instanceof Date&&t instanceof Date&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()},_dateAllowed:function(e,t,a){return(!t||e>=t)&&(!a||e<=a)},_getClosestDate:function(e,t){return t.filter(function(e){return void 0!==e}).reduce(function(t,a){return a?t?Math.abs(e.getTime()-a.getTime())<Math.abs(t.getTime()-e.getTime())?a:t:a:t})}};</script><dom-module id="vaadin-month-calendar" assetpath="../bower_components/vaadin-date-picker/"><template><style>:host{display:block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font:inherit;@apply --paper-font-common-base;@apply --vaadin-date-picker-calendar;}#title{color:var(--primary-text-color);text-align:center;padding:6px 0;@apply --paper-font-subhead;@apply --vaadin-date-picker-calendar-title;}#monthGrid{display:flex;flex-wrap:wrap;}#monthGrid div{text-align:center;width:calc(14.285714286% - 2px);margin:0 1px;box-sizing:border-box;padding:6px 0;@apply --paper-font-body1;@apply --vaadin-date-picker-calendar-cell;}:host([week-numbers]) #monthGrid div{width:calc(12.5% - 2px);}#monthGrid div:not(:empty){cursor:pointer;color:var(--primary-text-color);@apply --vaadin-date-picker-calendar-date-cell;}#monthGrid div:not(:empty):not([disabled]):not(.weekday):not(.weeknumber):active{background:var(--light-primary-color);border-radius:2px;}#monthGrid div.weekday{text-transform:uppercase;color:var(--secondary-text-color);cursor:default;padding:8px 0;@apply --paper-font-caption;@apply --vaadin-date-picker-calendar-weekday-cell;}#monthGrid div.weekday:empty,
+      #monthGrid div.weeknumber{width:calc(10% - 2px);padding-right:1.25%;}#monthGrid div[today]{position:relative;color:var(--primary-color);@apply --vaadin-date-picker-calendar-cell-today;}#monthGrid div[today][selected]{@apply --vaadin-date-picker-calendar-cell-today-selected;}#monthGrid div[focused]{background:var(--light-primary-color);box-sizing:border-box;border-radius:2px;@apply --vaadin-date-picker-calendar-cell-focused;}:host([focused]) #monthGrid div[focused]{background:var(--primary-color);color:var(--primary-background-color);@apply --vaadin-date-picker-calendar-focused-cell-focused;}#monthGrid div[selected]{font-weight:600;@apply --vaadin-date-picker-calendar-cell-selected;}#monthGrid div[today][selected]{@apply --vaadin-date-picker-calendar-cell-today-selected;}#monthGrid div[disabled]{opacity:0.3;cursor:default;@apply --vaadin-date-picker-calendar-cell-disabled;}#monthGrid div.weeknumber{cursor:default;color:rgba(0, 0, 0, 0.4);@apply --paper-font-caption;@apply --vaadin-date-picker-calendar-weeknumber-cell;}</style><div id="title" role="heading">[[_getTitle(month, i18n.monthNames)]]</div><div id="monthGrid" on-tap="_handleTap" on-touchend="_preventDefault" on-touchstart="_onMonthGridTouchStart"><template is="dom-repeat" items="[[_getWeekDayNames(i18n.weekdays, i18n.weekdaysShort, showWeekNumbers, i18n.firstDayOfWeek)]]"><div class="weekday" role="heading" aria-label$="[[item.weekDay]]">[[item.weekDayShort]]</div></template><template is="dom-repeat" items="[[_days]]"><template is="dom-if" if="[[_showWeekSeparator(showWeekNumbers, i18n.firstDayOfWeek, index)]]"><div class="weeknumber" role="heading" aria-label$="[[i18n.week]] [[_getWeekNumber(item, _days)]]">[[_getWeekNumber(item, _days)]]</div></template><div today$="[[_isToday(item)]]" selected$="[[_dateEquals(item, selectedDate)]]" focused$="[[_dateEquals(item, focusedDate)]]" date="[[item]]" disabled$="[[!_dateAllowed(item, minDate, maxDate)]]" role$="[[_getRole(item)]]" aria-label$="[[_getAriaLabel(item)]]" aria-disabled$="[[_getAriaDisabled(item, minDate, maxDate)]]">[[_getDate(item)]]</div></template></div></template><script>Polymer({is:"vaadin-month-calendar",properties:{month:{type:Date,value:new Date},selectedDate:{type:Date,notify:!0},focusedDate:Date,showWeekNumbers:{type:Boolean,value:!1},i18n:{type:Object},ignoreTaps:Boolean,_notTapping:Boolean,minDate:{type:Date,value:null},maxDate:{type:Date,value:null},_days:{type:Array,computed:"_getDays(month, i18n.firstDayOfWeek, minDate, maxDate)"}},observers:["_showWeekNumbersChanged(showWeekNumbers, i18n.firstDayOfWeek)"],_getTitle:function(e,t){if(void 0!==e&&void 0!==t)return this.i18n.formatTitle(t[e.getMonth()],e.getFullYear())},_dateEquals:vaadin.elements.datepicker.DatePickerHelper._dateEquals,_onMonthGridTouchStart:function(){this._notTapping=!1,this.async(function(){this._notTapping=!0},300)},_dateAdd:function(e,t){e.setDate(e.getDate()+t)},_applyFirstDayOfWeek:function(e,t){if(void 0!==e&&void 0!==t)return e.slice(t).concat(e.slice(0,t))},_getWeekDayNames:function(e,t,a,n){if(void 0!==e&&void 0!==t&&void 0!==a&&void 0!==n)return e=this._applyFirstDayOfWeek(e,n),t=this._applyFirstDayOfWeek(t,n),e=e.map(function(e,a){return{weekDay:e,weekDayShort:t[a]}}),a&&1===n&&e.unshift({weekDay:"",weekDayShort:""}),e},_getDate:function(e){return e?e.getDate():""},_showWeekNumbersChanged:function(e,t){this.toggleAttribute("week-numbers",e&&1===t)},_showWeekSeparator:function(e,t,a){return e&&1===t&&a%7==0},_isToday:function(e){return this._dateEquals(new Date,e)},_getDays:function(e,t){if(void 0!==e&&void 0!==t){var a=new Date(0,0);for(a.setFullYear(e.getFullYear()),a.setMonth(e.getMonth()),a.setDate(1);a.getDay()!==t;)this._dateAdd(a,-1);for(var n=[],i=a.getMonth(),o=e.getMonth();a.getMonth()===o||a.getMonth()===i;)n.push(a.getMonth()===o?new Date(a.getTime()):null),this._dateAdd(a,1);return n}},_getWeekNumber:function(e,t){if(void 0!==e&&void 0!==t)return e||(e=t.reduce(function(e,t){return!e&&t?t:e})),vaadin.elements.datepicker.DatePickerHelper._getISOWeekNumber(e)},_handleTap:function(e){this.ignoreTaps||this._notTapping||!e.target.date||e.target.hasAttribute("disabled")||(this.selectedDate=e.target.date,this.fire("date-tap"))},_preventDefault:function(e){e.preventDefault()},_dateAllowed:vaadin.elements.datepicker.DatePickerHelper._dateAllowed,_getRole:function(e){return e?"button":"presentational"},_getAriaLabel:function(e){if(!e)return"";var t=this._getDate(e)+" "+this.i18n.monthNames[e.getMonth()]+" "+e.getFullYear()+", "+this.i18n.weekdays[e.getDay()];return this._isToday(e)&&(t+=", "+this.i18n.today),t},_getAriaDisabled:function(e,t,a){if(void 0!==e&&void 0!==t&&void 0!==a)return this._dateAllowed(e,t,a)?"false":"true"}});</script></dom-module><dom-module id="vaadin-infinite-scroller" assetpath="../bower_components/vaadin-date-picker/"><template><style>:host{display:block;overflow:hidden;height:500px;}#scroller{position:relative;height:100%;overflow:auto;outline:none;margin-right:-40px;-webkit-overflow-scrolling:touch;-ms-overflow-style:none;overflow-x:hidden;}#scroller.notouchscroll{-webkit-overflow-scrolling:auto;}#scroller::-webkit-scrollbar{display:none;}.buffer{position:absolute;width:100%;box-sizing:border-box;padding-right:40px;@apply --vaadin-infinite-scroller-buffer;}:host(:not([init-animation-done])) .buffer > *{animation:fadein 0.2s;}@keyframes fadein{from{opacity:0;}to{opacity:1;}}</style><div id="scroller"><div class="buffer"></div><div class="buffer"></div><div id="fullHeight"></div></div></template></dom-module><script>Polymer({is:"vaadin-infinite-scroller",behaviors:[Polymer.Templatizer],properties:{itemHeight:{type:Number,value:50},bufferSize:{type:Number,value:20},_initialScroll:{value:5e5},_initialIndex:{value:0},_buffers:Array,_preventScrollEvent:Boolean,_bufferHeight:Number,_mayHaveMomentum:Boolean,_initialized:Boolean,active:Boolean},observers:["_activated(active)"],_activated:function(t){t&&!this._initialized&&(this._createPool(),this._initialized=!0)},listeners:{animationend:"_animationEnd"},_animationEnd:function(){this.toggleAttribute("init-animation-done",!0)},_finishInit:function(){this._initDone||(this._buffers.forEach(function(t){[].forEach.call(t.children,function(t){this._ensureStampedInstance(t)}.bind(this))},this),this._buffers[0].translateY||this._reset(),this._initDone=!0)},ready:function(){this._bufferHeight=this.itemHeight*this.bufferSize,this._buffers=Array.prototype.slice.call(Polymer.dom(this.root).querySelectorAll(".buffer")),this.$.fullHeight.style.height=2*this._initialScroll+"px";var t=Polymer.dom(this).querySelector("template");this.templatize(t),navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&(this.$.scroller.tabIndex=-1)},_translateBuffer:function(t){var i=t?1:0;this._buffers[i].translateY=this._buffers[i?0:1].translateY+this._bufferHeight*(i?-1:1),this.transform("translate3d(0, "+this._buffers[i].translateY+"px, 0)",this._buffers[i]),this._buffers[i].updated=!1,this._buffers.reverse()},_scroll:function(){var t=this.$.scroller.scrollTop;(t<this._bufferHeight||t>2*this._initialScroll-this._bufferHeight)&&(this._initialIndex=~~this.position,this._reset());var i=this.$$(".buffer").offsetTop,e=t>this._buffers[1].translateY+this.itemHeight+i,s=t<this._buffers[0].translateY+this.itemHeight+i;(e||s)&&(this._translateBuffer(s),this._updateClones()),this._preventScrollEvent||(this.fire("custom-scroll",void 0,{bubbles:!1}),this._mayHaveMomentum=!0),this._preventScrollEvent=!1,this.debounce("scrollFinish",function(){var t=this.$.scroller.getBoundingClientRect();this._isVisible(this._buffers[0],t)||this._isVisible(this._buffers[1],t)||(this.position=this.position)},200)},set position(t){this._preventScrollEvent=!0,t>this._firstIndex&&t<this._firstIndex+2*this.bufferSize?this.$.scroller.scrollTop=this.itemHeight*(t-this._firstIndex)+this._buffers[0].translateY:(this._initialIndex=~~t,this._reset(),this.unlisten(this.$.scroller,"scroll","_scroll"),this.$.scroller.scrollTop+=t%1*this.itemHeight,this.listen(this.$.scroller,"scroll","_scroll")),this._mayHaveMomentum&&(this.$.scroller.classList.add("notouchscroll"),this._mayHaveMomentum=!1,this.async(function(){this.$.scroller.classList.remove("notouchscroll")},10))},get position(){return(this.$.scroller.scrollTop-this._buffers[0].translateY)/this.itemHeight+this._firstIndex},_reset:function(){this.unlisten(this.$.scroller,"scroll","_scroll"),this.$.scroller.scrollTop=this._initialScroll,this._buffers[0].translateY=this._initialScroll-this._bufferHeight,this._buffers[1].translateY=this._initialScroll,this._buffers.forEach(function(t){Polymer.Base.transform("translate3d(0, "+t.translateY+"px, 0)",t)}),this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones(!0),this.debounce("updateAllClones",function(){this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones()},200),this.listen(this.$.scroller,"scroll","_scroll")},_createPool:function(){var t=this.getBoundingClientRect();this._buffers.forEach(function(i){for(var e=0;e<this.bufferSize;e++){var s=document.createElement("div");s.style.height=this.itemHeight+"px",s.instance={},Polymer.dom(i).appendChild(s),this.async(function(t,i){this._isVisible(t,i)&&this._ensureStampedInstance(t)}.bind(this,s,t),1),Polymer.RenderStatus.afterNextRender(s,this._finishInit.bind(this))}},this)},_ensureStampedInstance:function(t){if(!t.firstElementChild){var i=t.instance;t.instance=this.stamp({}),Polymer.dom(t).appendChild(t.instance.root),Object.keys(i).forEach(function(e){t.instance.set(e,i[e])})}},_updateClones:function(t){this._firstIndex=~~((this._buffers[0].translateY-this._initialScroll)/this.itemHeight)+this._initialIndex;var i=t?this.$.scroller.getBoundingClientRect():void 0;this._buffers.forEach(function(e,s){if(!e.updated){var r=this._firstIndex+this.bufferSize*s;[].forEach.call(e.children,function(e,s){t&&!this._isVisible(e,i)||(e.instance.index=r+s)}.bind(this)),e.updated=!0}},this)},_isVisible:function(t,i){var e=t.getBoundingClientRect();return e.bottom>i.top&&e.top<i.bottom},created:function(){this._parentModel=!0},_forwardHostPropV2:function(t,i){this._forwardParentProp(t,i)},_forwardParentProp:function(t,i){"index"!==t&&this._buffers.forEach(function(e){[].forEach.call(e.children,function(e){e.instance[t]=i})})}});</script><iron-iconset-svg size="24" name="vaadin-date-picker"><svg><defs><g id="chevron-right"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"></path></g><g id="clear"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"></path></g><g id="event"><path d="M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"></path></g></defs></svg></iron-iconset-svg><dom-module id="vaadin-date-picker-overlay" assetpath="../bower_components/vaadin-date-picker/"><template><style>:host{display:flex;flex-direction:column;height:100%;width:100%;background:var(--primary-background-color);font:inherit;outline:none;@apply --paper-font-common-base;@apply --shadow-elevation-2dp;@apply --vaadin-date-picker-overlay;}#toolbar{display:flex;justify-content:space-between;padding:14px;background:var(--primary-background-color);z-index:2;@apply --paper-font-button;@apply --shadow-elevation-2dp;flex-shrink:0;transform:translateZ(0);color:var(--primary-color);@apply --vaadin-date-picker-toolbar;}#toolbar:not([desktop]){cursor:pointer;}#toolbar iron-icon{fill:var(--primary-color);padding:0;transition:transform 200ms;will-change:transform;--iron-icon-width:20px;--iron-icon-height:20px;@apply --vaadin-date-picker-toolbar-icon;}#toolbar iron-icon[rotate]{transform:rotate(180deg);}#toolbar iron-icon[hidden]{display:none;}#scrollers{display:flex;flex-direction:row;height:100%;width:100%;position:relative;overflow:hidden;}#scrollers #fade{pointer-events:none;display:block;background:linear-gradient(90deg, var(--primary-background-color), rgba(255, 255, 255, 0));width:50px;position:absolute;height:100%;z-index:1;transform:translateX(-100%);@apply --vaadin-date-picker-scrollers-fade;}#scrollers[desktop] #fade{display:none;}#scroller,
       #yearScroller{height:100%;}#scroller{padding:0 8px;position:absolute;top:0;left:0;right:0;bottom:0;}#scrollers[desktop] #scroller{right:50px;transform:none !important;}#yearScroller{text-align:center;width:50px;background:var(--dark-theme-background-color);color:var(--dark-theme-secondary-color);cursor:pointer;position:absolute;right:0;transform:translateX(100%);-webkit-tap-highlight-color:transparent;@apply --paper-font-menu;@apply --vaadin-date-picker-yearscroller;}#yearScroller div{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}#scrollers[desktop] #yearScroller{position:absolute;transform:none !important;}#yearScroller{--vaadin-infinite-scroller-buffer:{top:50%;margin-top:-12px;width:90px;};}#yearScroller::before{content:'';display:block;background:transparent;width:0;height:0;position:absolute;left:0;top:50%;margin-top:-6px;border-width:6px;border-style:solid;border-color:transparent;border-left-color:var(--primary-background-color);@apply --vaadin-date-picker-yearscroller-indicator;}:host(.animate) vaadin-infinite-scroller{transition:all 200ms;}:host(:not([fullscreen])) #header{display:none;}#toolbar[desktop]{display:none;}#header{background:var(--primary-color);padding:0 14px 14px;display:flex;flex-shrink:0;height:64px;box-sizing:border-box;@apply --paper-font-subhead;@apply --shadow-elevation-2dp;@apply --vaadin-date-picker-header;}#header label,
       #header input{color:var(--dark-theme-text-color);}#header iron-icon{color:var(--dark-theme-text-color);cursor:pointer;}#toggle{align-self:flex-end;}#header paper-input-container{flex:1;margin-right:24px;padding-bottom:0;--paper-input-container-underline:{display:none;};--paper-input-container-underline-focus:{display:block;background:var(--dark-theme-text-color);-webkit-transform:none;transform:none;};}#clear{display:none;}#clear[showclear]{display:flex;}#footer{display:flex;justify-content:space-between;padding:4px;@apply --paper-font-body2;background:var(--primary-background-color);z-index:2;box-shadow:0 -1px 4px 0 rgba(0, 0, 0, 0.5);color:var(--primary-color);flex-shrink:0;@apply --vaadin-date-picker-footer;}paper-button.keyboard-focus{color:var(--primary-background-color);background:var(--primary-color);outline:none;}#announcer{display:inline-block;position:fixed;clip:rect(0, 0, 0, 0);clip-path:inset(100%);}input{position:relative;outline:none;box-shadow:none;padding:0;width:100%;max-width:100%;background:transparent;border:none;color:var(--paper-input-container-input-color, var(--primary-text-color));-webkit-appearance:none;text-align:inherit;vertical-align:bottom;min-width:0;@apply --paper-font-subhead;@apply --paper-input-container-input;}</style><div id="announcer" role="alert" aria-live="polite">[[i18n.calendar]]</div><div id="header" on-touchend="_preventDefault" aria-hidden="true"><paper-input-container><label>[[label]]</label><iron-input id="input" slot="input" bind-value="[[_formatDisplayed(selectedDate, i18n.formatDate)]]"><input readonly="" autocomplete="off"></iron-input><iron-icon id="clear" slot="suffix" on-tap="_clear" icon="vaadin-date-picker:clear" showclear$="[[_showClear(selectedDate)]]"></iron-icon></paper-input-container><iron-icon id="toggle" icon="vaadin-date-picker:event" on-tap="_cancel"></iron-icon></div><div id="toolbar" desktop$="[[_desktopMode]]" on-tap="_toggleYearScroller" aria-hidden="true">[[_yearAfterXMonths(_visibleMonthIndex)]]<iron-icon rotate$="[[_isYearScrollerVisible(_translateX)]]" icon="vaadin-date-picker:chevron-right"></iron-icon></div><div id="scrollers" desktop$="[[_desktopMode]]" on-track="_track"><div id="fade"></div><vaadin-infinite-scroller id="scroller" on-custom-scroll="_onMonthScroll" on-touchstart="_onMonthScrollTouchStart" item-height="250" buffer-size="6" active="[[initialPosition]]"><template><vaadin-month-calendar i18n="[[i18n]]" month="[[_dateAfterXMonths(index)]]" selected-date="{{selectedDate}}" focused-date="[[focusedDate]]" ignore-taps="[[_ignoreTaps]]" show-week-numbers="[[showWeekNumbers]]" min-date="[[minDate]]" max-date="[[maxDate]]" focused$="[[_focused]]"></vaadin-month-calendar></template></vaadin-infinite-scroller><vaadin-infinite-scroller id="yearScroller" on-tap="_onYearTap" on-custom-scroll="_onYearScroll" on-touchstart="_onYearScrollTouchStart" item-height="80" buffer-size="25" active="[[initialPosition]]"><template><div role="button">[[_yearAfterXYears(index)]]</div><div style="font-size: 18px; line-height: 56px; opacity: 0.3" aria-hidden="true">•</div></template></vaadin-infinite-scroller></div><div id="footer" on-touchend="_preventDefault" role="toolbar"><paper-button id="todayButton" disabled="[[!_isTodayAllowed(minDate, maxDate)]]" on-tap="_onTodayTap">[[i18n.today]]</paper-button><paper-button id="cancelButton" on-tap="_cancel">[[i18n.cancel]]</paper-button></div><iron-media-query query="(min-width: 375px)" query-matches="{{_desktopMode}}"></iron-media-query></template><script>Polymer({is:"vaadin-date-picker-overlay",listeners:{keydown:"_onKeydown",tap:"_stopPropagation",focus:"_onOverlayFocus",blur:"_onOverlayBlur"},hostAttributes:{tabIndex:"0"},properties:{selectedDate:{type:Date,notify:!0},focusedDate:{type:Date,notify:!0,observer:"_focusedDateChanged"},_focusedMonthDate:Number,initialPosition:{type:Date,observer:"_initialPositionChanged"},_originDate:{value:new Date},_visibleMonthIndex:Number,_desktopMode:Boolean,_translateX:{observer:"_translateXChanged"},_yearScrollerWidth:{value:50},i18n:{type:Object},showWeekNumbers:{type:Boolean},_ignoreTaps:Boolean,_notTapping:Boolean,minDate:Date,maxDate:Date,_focused:Boolean,label:String},attached:function(){this._translateX=this._yearScrollerWidth,this.toggleClass("animate",!0),this.setScrollDirection("y",this.$.scrollers),Polymer.IronA11yAnnouncer.requestAvailability()},announceFocusedDate:function(){var t=this._currentlyFocusedDate(),e=[];vaadin.elements.datepicker.DatePickerHelper._dateEquals(t,new Date)&&e.push(this.i18n.today),e=e.concat([this.i18n.weekdays[t.getDay()],t.getDate(),this.i18n.monthNames[t.getMonth()],t.getFullYear()]),this.showWeekNumbers&&1===this.i18n.firstDayOfWeek&&(e.push(this.i18n.week),e.push(vaadin.elements.datepicker.DatePickerHelper._getISOWeekNumber(t))),this.fire("iron-announce",{text:e.join(" ")})},focusCancel:function(){this.$.cancelButton.focus()},scrollToDate:function(t,e){this._scrollToPosition(this._differenceInMonths(t,this._originDate),e)},_focusedDateChanged:function(t){this.revealDate(t)},revealDate:function(t){if(t){var e=this._differenceInMonths(t,this._originDate),i=this.$.scroller.position>e,s=this.$.scroller.clientHeight/this.$.scroller.itemHeight,o=this.$.scroller.position+s-1<e;i?this._scrollToPosition(e,!0):o&&this._scrollToPosition(e-s+1,!0)}},_onOverlayFocus:function(){this._focused=!0},_onOverlayBlur:function(){this._focused=!1},_initialPositionChanged:function(t){this.scrollToDate(t)},_repositionYearScroller:function(){this._visibleMonthIndex=Math.floor(this.$.scroller.position),this.$.yearScroller.position=(this.$.scroller.position+this._originDate.getMonth())/12},_repositionMonthScroller:function(){this.$.scroller.position=12*this.$.yearScroller.position-this._originDate.getMonth(),this._visibleMonthIndex=Math.floor(this.$.scroller.position)},_onMonthScroll:function(){this._repositionYearScroller(),this._doIgnoreTaps()},_onYearScroll:function(){this._repositionMonthScroller(),this._doIgnoreTaps()},_onYearScrollTouchStart:function(){this._notTapping=!1,this.async(function(){this._notTapping=!0},300),this._repositionMonthScroller()},_onMonthScrollTouchStart:function(){this._repositionYearScroller()},_doIgnoreTaps:function(){this._ignoreTaps=!0,this.debounce("restore-taps",function(){this._ignoreTaps=!1},300)},_formatDisplayed:function(t,e){if(t)return e(t)},_onTodayTap:function(){var t=new Date;this.$.scroller.position===this._differenceInMonths(t,this._originDate)?(this.selectedDate=t,this._close()):this._scrollToCurrentMonth()},_scrollToCurrentMonth:function(){this.focusedDate&&(this.focusedDate=new Date),this.scrollToDate(new Date,!0)},_showClear:function(t){return null!==t},_onYearTap:function(t){if(!this._ignoreTaps&&!this._notTapping){var e=(t.detail.y-(this.$.yearScroller.getBoundingClientRect().top+this.$.yearScroller.clientHeight/2))/this.$.yearScroller.itemHeight;this._scrollToPosition(this.$.scroller.position+12*e,!0)}},_scrollToPosition:function(t,e){if(void 0===this._targetPosition){if(!e)return this.$.scroller.position=t,this._targetPosition=void 0,void this._repositionYearScroller();this._targetPosition=t;var i=function(t,e,i,s){return(t/=s/2)<1?i/2*t*t+e:(t--,-i/2*(t*(t-2)-1)+e)},s=e?300:0,o=0,a=this.$.scroller.position,n=function(t){var e=t-(o=o||t);if(e<s){var r=i(e,a,this._targetPosition-a,s);this.$.scroller.position=r,window.requestAnimationFrame(n)}else this.fire("scroll-animation-finished",{position:this._targetPosition,oldPosition:a}),this.$.scroller.position=this._targetPosition,this._targetPosition=void 0;this.async(this._repositionYearScroller,1)}.bind(this);window.requestAnimationFrame(n)}else this._targetPosition=t},_limit:function(t,e){return Math.min(e.max,Math.max(e.min,t))},_handleTrack:function(t){if(!(Math.abs(t.detail.dx)<10||Math.abs(t.detail.ddy)>10)){Math.abs(t.detail.ddx)>this._yearScrollerWidth/3&&this.toggleClass("animate",!0);var e=this._translateX+t.detail.ddx;this._translateX=this._limit(e,{min:0,max:this._yearScrollerWidth})}},_track:function(t){if(!this._desktopMode)switch(t.detail.state){case"start":this.toggleClass("animate",!1);break;case"track":this._handleTrack(t);break;case"end":this.toggleClass("animate",!0),this._translateX>=this._yearScrollerWidth/2?this._closeYearScroller():this._openYearScroller()}},_toggleYearScroller:function(){this._isYearScrollerVisible()?this._closeYearScroller():this._openYearScroller()},_openYearScroller:function(){this._translateX=0},_closeYearScroller:function(){this._translateX=this._yearScrollerWidth},_isYearScrollerVisible:function(){return this._translateX<this._yearScrollerWidth/2},_translateXChanged:function(t){this._desktopMode||(this.transform("translateX("+(t-this._yearScrollerWidth)+"px)",this.$.scroller),this.transform("translateX("+t+"px)",this.$.yearScroller),this.transform("translateX("+-t+"px)",this.$.fade))},_yearAfterXYears:function(t){var e=new Date(this._originDate);return e.setFullYear(parseInt(t)+this._originDate.getFullYear()),e.getFullYear()},_yearAfterXMonths:function(t){return this._dateAfterXMonths(t).getFullYear()},_dateAfterXMonths:function(t){var e=new Date(this._originDate);return e.setDate(1),e.setMonth(parseInt(t)+this._originDate.getMonth()),e},_differenceInMonths:function(t,e){return 12*(t.getFullYear()-e.getFullYear())-e.getMonth()+t.getMonth()},_differenceInYears:function(t,e){return this._differenceInMonths(t,e)/12},_clear:function(){this.selectedDate="",this._close()},_close:function(){this.fire("close")},_cancel:function(){this.focusedDate=this.selectedDate,this._close()},_preventDefault:function(t){t.preventDefault()},_eventKey:function(t){for(var e=["down","up","right","left","enter","space","home","end","pageup","pagedown","tab"],i=0;i<e.length;i++){var s=e[i];if(Polymer.IronA11yKeysBehavior.keyboardEventMatchesKeys(t,s))return s}},_onKeydown:function(t){var e=this._currentlyFocusedDate(),i=this._eventKey(t);if("tab"===i)t.stopPropagation(),this.hasAttribute("fullscreen")?t.preventDefault():(this.$.cancelButton.focused||this.$.todayButton.focused)&&t.shiftKey||(this.$.cancelButton.focused&&!t.shiftKey||this._focused&&t.shiftKey?(t.preventDefault(),this.fire("focus-input")):this.async(function(){this._focused&&this.revealDate(this.focusedDate)},1));else if(i)switch(t.preventDefault(),t.stopPropagation(),i){case"down":this._moveFocusByDays(7),this.focus();break;case"up":this._moveFocusByDays(-7),this.focus();break;case"right":this._buttonFocused()||this._moveFocusByDays(1);break;case"left":this._buttonFocused()||this._moveFocusByDays(-1);break;case"enter":this._buttonFocused()||this._close();break;case"space":var s=this.focusedDate;vaadin.elements.datepicker.DatePickerHelper._dateEquals(s,this.selectedDate)?(this.selectedDate="",this.focusedDate=s):this.selectedDate=s;break;case"home":this._moveFocusInsideMonth(e,"minDate");break;case"end":this._moveFocusInsideMonth(e,"maxDate");break;case"pagedown":this._moveFocusByMonths(t.shiftKey?12:1);break;case"pageup":this._moveFocusByMonths(t.shiftKey?-12:-1)}},_buttonFocused:function(){return this.$.todayButton.focused||this.$.cancelButton.focused},_currentlyFocusedDate:function(){return this.focusedDate||this.selectedDate||this.initialPosition||new Date},_moveFocusByDays:function(t){var e=this._currentlyFocusedDate(),i=new Date(0,0);i.setFullYear(e.getFullYear()),i.setMonth(e.getMonth()),i.setDate(e.getDate()+t),this._dateAllowed(i,this.minDate,this.maxDate)?(this.focusedDate=i,this._focusedMonthDate=this.focusedDate.getDate()):this._dateAllowed(e,this.minDate,this.maxDate)?t>0?(this.focusedDate=this.maxDate,this._focusedMonthDate=this.maxDate.getDate()):(this.focusedDate=this.minDate,this._focusedMonthDate=this.minDate.getDate()):(this.focusedDate=vaadin.elements.datepicker.DatePickerHelper._getClosestDate(e,[this.minDate,this.maxDate]),this._focusedMonthDate=this.focusedDate.getDate())},_moveFocusByMonths:function(t){var e=this._currentlyFocusedDate(),i=new Date(0,0);i.setFullYear(e.getFullYear()),i.setMonth(e.getMonth()+t);var s=i.getMonth();i.setDate(this._focusedMonthDate||(this._focusedMonthDate=e.getDate())),i.getMonth()!==s&&i.setDate(0),this._dateAllowed(i,this.minDate,this.maxDate)?this.focusedDate=i:this._dateAllowed(e,this.minDate,this.maxDate)?t>0?(this.focusedDate=this.maxDate,this._focusedMonthDate=this.maxDate.getDate()):(this.focusedDate=this.minDate,this._focusedMonthDate=this.minDate.getDate()):(this.focusedDate=vaadin.elements.datepicker.DatePickerHelper._getClosestDate(e,[this.minDate,this.maxDate]),this._focusedMonthDate=this.focusedDate.getDate())},_moveFocusInsideMonth:function(t,e){var i=new Date(0,0);i.setFullYear(t.getFullYear()),"minDate"===e?(i.setMonth(t.getMonth()),i.setDate(1)):(i.setMonth(t.getMonth()+1),i.setDate(0)),this._dateAllowed(i,this.minDate,this.maxDate)?(this.focusedDate=i,this._focusedMonthDate=this.focusedDate.getDate()):this._dateAllowed(t,this.minDate,this.maxDate)?(this.focusedDate=this[e],this._focusedMonthDate=this[e].getDate()):(this.focusedDate=vaadin.elements.datepicker.DatePickerHelper._getClosestDate(t,[this.minDate,this.maxDate]),this._focusedMonthDate=this.focusedDate.getDate())},_dateAllowed:function(t,e,i){return(!e||t>=e)&&(!i||t<=i)},_isTodayAllowed:function(t,e){var i=new Date,s=new Date(0,0);return s.setFullYear(i.getFullYear()),s.setMonth(i.getMonth()),s.setDate(i.getDate()),this._dateAllowed(s,t,e)},_stopPropagation:function(t){t.stopPropagation()}});</script></dom-module><script>window.vaadin=window.vaadin||{},vaadin.elements=vaadin.elements||{},vaadin.elements.datepicker=vaadin.elements.datepicker||{},vaadin.elements.datepicker.DatePickerBehaviorImpl={observers:["_selectedDateChanged(_selectedDate, i18n.formatDate)","_validateInput(_selectedDate, _minDate, _maxDate)","_focusedDateChanged(_focusedDate, i18n.formatDate)","_announceFocusedDate(_focusedDate, opened, _ignoreAnnounce)"],properties:{_selectedDate:{type:Date},_focusedDate:Date,value:{type:String,observer:"_valueChanged"},hasValue:{type:Boolean,computed:"_hasValue(value)",reflectToAttribute:!0},initialPosition:String,label:String,opened:{type:Boolean,reflectToAttribute:!0,notify:!0},showWeekNumbers:{type:Boolean},_fullscreen:{value:!1,observer:"_fullscreenChanged"},_fullscreenMediaQuery:{value:"(max-width: 420px), (max-height: 420px)"},_touchPrevented:Array,i18n:{type:Object,value:function(){return{monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],firstDayOfWeek:0,week:"Week",calendar:"Calendar",clear:"Clear",today:"Today",cancel:"Cancel",formatDate:function(e){var t=e.getFullYear(),n=t.toString();return n.length<3&&t>=0&&(n=(t<10?"000":"00")+t),e.getMonth()+1+"/"+e.getDate()+"/"+n},parseDate:function(e){var t,n=e.split("/"),i=new Date,a=i.getMonth(),o=i.getFullYear();if(3===n.length?(o=parseInt(n[2]),n[2].length<3&&o>=0&&(o+=o<50?2e3:1900),a=parseInt(n[0])-1,t=parseInt(n[1])):2===n.length?(a=parseInt(n[0])-1,t=parseInt(n[1])):1===n.length&&(t=parseInt(n[0])),void 0!==t){var s=new Date(0,0);return s.setFullYear(o),s.setMonth(a),s.setDate(t),s}},formatTitle:function(e,t){return e+" "+t}}}},min:{type:String,observer:"_minChanged"},max:{type:String,observer:"_maxChanged"},_minDate:{type:Date,value:""},_maxDate:{type:Date,value:""},_noInput:{type:Boolean,computed:"_isNoInput(_fullscreen, i18n, i18n.*, _ios)"},_ios:{type:Boolean,value:navigator.userAgent.match(/iP(?:hone|ad;(?: U;)? CPU) OS (\d+)/)},_ignoreAnnounce:{value:!0},_focusOverlayOnOpen:Boolean,_documentPointerEvents:String},created:function(){this._boundOnScroll=this._onScroll.bind(this)},listeners:{tap:"open",touchend:"_preventDefault",keydown:"_onKeydown",close:"_close","date-tap":"_close","focus-input":"_focusAndSelect",input:"_onUserInput"},ready:function(){void 0===this.value&&(this.value="")},open:function(){this.disabled||this.readonly||(this.$.dropdown.open(),this._updateAlignmentAndPosition())},_close:function(e){e&&e.stopPropagation(),this.inputElement.focus(),this.close()},close:function(){this.$.dropdown.close()},get inputElement(){return this._input()},get _nativeInput(){if(this.inputElement)return this.inputElement.inputElement?this.inputElement.inputElement:window.unwrap?window.unwrap(this.inputElement):this.inputElement},_parseDate:function(e){var t=/^(\d{4}|[-+]\d{6})-(\d{2})-(\d{2})$/.exec(e);if(t){var n=new Date(0,0);return n.setFullYear(parseInt(t[1],10)),n.setMonth(parseInt(t[2],10)-1),n.setDate(parseInt(t[3],10)),n}},_isNoInput:function(){return this._fullscreen||!this.i18n.parseDate||this._ios},_formatISO:function(e){return e instanceof Date?new Date(e.getTime()-6e4*e.getTimezoneOffset()).toISOString().split("T")[0]:""},_selectedDateChanged:function(e,t){void 0!==e&&void 0!==t&&(this.value=this._formatISO(e),this._focusedDate=e,this._inputValue=e?t(e):"")},_focusedDateChanged:function(e,t){void 0!==e&&void 0!==t&&(this._ignoreFocusedDateChange||this._noInput||(this._inputValue=e?t(e):""))},_hasValue:function(e){return!!e},_handleDateChange:function(e,t,n){if(t){var i=this._parseDate(t);i?vaadin.elements.datepicker.DatePickerHelper._dateEquals(this[e],i)||(this[e]=i):this.value=n}else this[e]=""},_valueChanged:function(e,t){this._handleDateChange("_selectedDate",e,t)},_minChanged:function(e,t){this._handleDateChange("_minDate",e,t)},_maxChanged:function(e,t){this._handleDateChange("_maxDate",e,t)},_updateAlignmentAndPosition:function(){var e=Math.max(document.documentElement.clientWidth,window.innerWidth||0);this.$.dropdown.positionTarget=this._fullscreen?document.documentElement:this;var t=Math.max(document.documentElement.clientHeight,window.innerHeight||0),n=this.getBoundingClientRect().top>t/2,i=this.getBoundingClientRect().left+this.clientWidth/2>e/2;this.$.dropdown.verticalAlign=n?"bottom":"top",this.$.dropdown.horizontalAlign=this._fullscreen?null:i?"right":"left",this._fullscreen?(this.$.dropdown.style.marginTop=0,this.$.dropdown.style.marginBottom=0):(this.$.dropdown.style.marginTop=(n?10:this.clientHeight+2)+"px",this.$.dropdown.style.marginBottom=(n?this.clientHeight:10)+"px")},_fullscreenChanged:function(){this.$.dropdown.opened&&this._updateAlignmentAndPosition()},_onOverlayOpened:function(){var e=this._parseDate(this.initialPosition),t=this._selectedDate||this.$.overlay.initialPosition||e||new Date;e||vaadin.elements.datepicker.DatePickerHelper._dateAllowed(t,this._minDate,this._maxDate)?this.$.overlay.initialPosition=t:this.$.overlay.initialPosition=vaadin.elements.datepicker.DatePickerHelper._getClosestDate(t,[this._minDate,this._maxDate]),this.$.overlay.scrollToDate(this.$.overlay.focusedDate||this.$.overlay.initialPosition),this._ignoreFocusedDateChange=!0,this.$.overlay.focusedDate=this.$.overlay.focusedDate||this.$.overlay.initialPosition,this._ignoreFocusedDateChange=!1,window.addEventListener("scroll",this._boundOnScroll,!0),this.listen(this,"iron-resize","_updateAlignmentAndPosition"),""===document.createElement("div").style.webkitOverflowScrolling&&(this._touchPrevented=this._preventWebkitOverflowScrollingTouch(this.parentElement)),this._focusOverlayOnOpen?(this.$.overlay.focus(),this._focusOverlayOnOpen=!1):this._focus(),this.updateStyles(),this._documentPointerEvents=document.body.style.pointerEvents,document.body.style.pointerEvents="none",this._ignoreAnnounce=!1},_preventWebkitOverflowScrollingTouch:function(e){for(var t=[];e;){if("touch"===window.getComputedStyle(e).webkitOverflowScrolling){var n=e.style.webkitOverflowScrolling;e.style.webkitOverflowScrolling="auto",t.push({element:e,oldInlineValue:n})}e=e.parentElement}return t},_onOverlayClosed:function(){if(this._ignoreAnnounce=!0,window.removeEventListener("scroll",this._boundOnScroll,!0),this.unlisten(this,"iron-resize","_updateAlignmentAndPosition"),this._touchPrevented&&(this._touchPrevented.forEach(function(e){e.element.style.webkitOverflowScrolling=e.oldInlineValue}),this._touchPrevented=[]),this.updateStyles(),document.body.style.pointerEvents=this._documentPointerEvents,this._ignoreFocusedDateChange=!0,this.i18n.parseDate){var e=this._inputValue||"",t=this.i18n.parseDate(e);this._isValidDate(t)?this._selectedDate=t:(this._selectedDate=null,this._inputValue=e)}else this._focusedDate&&(this._selectedDate=this._focusedDate);this._ignoreFocusedDateChange=!1,this._nativeInput&&this._nativeInput.selectionStart&&(this._nativeInput.selectionStart=this._nativeInput.selectionEnd),this.validate()},detached:function(){this._onOverlayClosed()},_onScroll:function(e){e.target!==window&&this.$.overlay.contains(e.target)||this._updateAlignmentAndPosition()},_preventCancelOnComponentAccess:function(e){var t=Polymer.dom(e.detail);/tap|mousedown|touchstart/.test(e.detail.type)&&t.path.indexOf(this)>-1&&e.preventDefault()},_focus:function(){this._noInput?this.$.overlay.focus():this._nativeInput.focus()},_focusAndSelect:function(){this._noInput||(this._focus(),this._setSelectionRange(0,this._inputValue.length))},_setSelectionRange:function(e,t){this._nativeInput&&this._nativeInput.setSelectionRange&&this._nativeInput.setSelectionRange(e,t)},_preventDefault:function(e){e.preventDefault()},_eventKey:function(e){for(var t=["down","up","enter","esc","tab"],n=0;n<t.length;n++){var i=t[n];if(Polymer.IronA11yKeysBehavior.keyboardEventMatchesKeys(e,i))return i}},_isValidDate:function(e){return e&&!isNaN(e.getTime())},_onKeydown:function(e){switch(this._noInput&&-1===[9].indexOf(e.keyCode)&&e.preventDefault(),this._eventKey(e)){case"down":case"up":e.preventDefault(),this.opened?(this.$.overlay.focus(),this.$.overlay._onKeydown(e)):(this._focusOverlayOnOpen=!0,this.open());break;case"enter":this.$.overlay.focusedDate&&(this._selectedDate=this.$.overlay.focusedDate),this.close();break;case"esc":this._focusedDate=this._selectedDate,this._close();break;case"tab":this.opened&&(e.preventDefault(),this._setSelectionRange(0,0),e.shiftKey?this.$.overlay.focusCancel():(this.$.overlay.focus(),this.$.overlay.revealDate(this._focusedDate)))}},_validateInput:function(e,t,n){e&&(t||n)&&(this.invalid=!vaadin.elements.datepicker.DatePickerHelper._dateAllowed(e,t,n))},_onUserInput:function(e){this._userInputValueChanged(),this.opened||(this.open(),this._ios&&this.$.dropdown.async(this.$.dropdown.refit,500))},_userInputValueChanged:function(e){if(this.opened&&this._inputValue){var t=this.i18n.parseDate&&this.i18n.parseDate(this._inputValue);this._isValidDate(t)&&(this._ignoreFocusedDateChange=!0,this._focusedDate=t,this._ignoreFocusedDateChange=!1)}},_announceFocusedDate:function(e,t,n){t&&!n&&this.$.overlay.announceFocusedDate()}},vaadin.elements.datepicker.DatePickerBehavior=[Polymer.IronFormElementBehavior,Polymer.IronValidatableBehavior,Polymer.IronA11yKeysBehavior,Polymer.IronResizableBehavior,vaadin.elements.datepicker.DatePickerBehaviorImpl];</script><dom-module id="vaadin-date-picker" assetpath="../bower_components/vaadin-date-picker/"><template><style>:host{display:block;}:host([opened]){pointer-events:auto;}#sufix{display:flex;}#overlay{height:100vh;width:420px;}#inputcontainer{padding-bottom:0;}#inputcontainer,
       #inputcontainer input{cursor:pointer;}#inputcontainer:focus{outline:none;}paper-input-container div[suffix]{box-sizing:content-box;position:absolute;right:-4px;bottom:-4px;width:24px;height:24px;padding:4px;text-align:center;}paper-input-container iron-icon{fill:rgba(0, 0, 0, .26);cursor:pointer;--iron-icon-width:20px;--iron-icon-height:20px;margin-top:-1px;transition:fill 0.2s;}paper-input-container paper-ripple{color:rgba(0, 0, 0, .54);}:host([opened]) paper-input-container{--paper-input-container-underline-focus:{-webkit-transform:none;transform:none;};}paper-input-container iron-icon:hover,
diff --git a/homeassistant/components/frontend/www_static/frontend.html.gz b/homeassistant/components/frontend/www_static/frontend.html.gz
index bde7d8e8ae1881ceeb7f692b7f4ecdb8c7d22198..1507b30d12d04126e590bca124674db6fd25deb1 100644
Binary files a/homeassistant/components/frontend/www_static/frontend.html.gz and b/homeassistant/components/frontend/www_static/frontend.html.gz differ
diff --git a/homeassistant/components/frontend/www_static/home-assistant-polymer b/homeassistant/components/frontend/www_static/home-assistant-polymer
index 512b07963b912b973212c14efb7d6250dcd3b81c..572f92fd1ecbc31d3d9c3d349f268b6b15158141 160000
--- a/homeassistant/components/frontend/www_static/home-assistant-polymer
+++ b/homeassistant/components/frontend/www_static/home-assistant-polymer
@@ -1 +1 @@
-Subproject commit 512b07963b912b973212c14efb7d6250dcd3b81c
+Subproject commit 572f92fd1ecbc31d3d9c3d349f268b6b15158141
diff --git a/homeassistant/components/frontend/www_static/images/leaflet/leaflet.css b/homeassistant/components/frontend/www_static/images/leaflet/leaflet.css
new file mode 100644
index 0000000000000000000000000000000000000000..a3ea996ead227ec54727ad618ad4135b5929516b
--- /dev/null
+++ b/homeassistant/components/frontend/www_static/images/leaflet/leaflet.css
@@ -0,0 +1,631 @@
+/* required styles */
+
+.leaflet-pane,
+.leaflet-tile,
+.leaflet-marker-icon,
+.leaflet-marker-shadow,
+.leaflet-tile-container,
+.leaflet-pane > svg,
+.leaflet-pane > canvas,
+.leaflet-zoom-box,
+.leaflet-image-layer,
+.leaflet-layer {
+  position: absolute;
+  left: 0;
+  top: 0;
+  }
+.leaflet-container {
+  overflow: hidden;
+  }
+.leaflet-tile,
+.leaflet-marker-icon,
+.leaflet-marker-shadow {
+  -webkit-user-select: none;
+     -moz-user-select: none;
+          user-select: none;
+    -webkit-user-drag: none;
+  }
+/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
+.leaflet-safari .leaflet-tile {
+  image-rendering: -webkit-optimize-contrast;
+  }
+/* hack that prevents hw layers "stretching" when loading new tiles */
+.leaflet-safari .leaflet-tile-container {
+  width: 1600px;
+  height: 1600px;
+  -webkit-transform-origin: 0 0;
+  }
+.leaflet-marker-icon,
+.leaflet-marker-shadow {
+  display: block;
+  }
+/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
+/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
+.leaflet-container .leaflet-overlay-pane svg,
+.leaflet-container .leaflet-marker-pane img,
+.leaflet-container .leaflet-shadow-pane img,
+.leaflet-container .leaflet-tile-pane img,
+.leaflet-container img.leaflet-image-layer {
+  max-width: none !important;
+  }
+
+.leaflet-container.leaflet-touch-zoom {
+  -ms-touch-action: pan-x pan-y;
+  touch-action: pan-x pan-y;
+  }
+.leaflet-container.leaflet-touch-drag {
+  -ms-touch-action: pinch-zoom;
+  }
+.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
+  -ms-touch-action: none;
+  touch-action: none;
+}
+.leaflet-container {
+  -webkit-tap-highlight-color: transparent;
+}
+.leaflet-container a {
+  -webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
+}
+.leaflet-tile {
+  filter: inherit;
+  visibility: hidden;
+  }
+.leaflet-tile-loaded {
+  visibility: inherit;
+  }
+.leaflet-zoom-box {
+  width: 0;
+  height: 0;
+  -moz-box-sizing: border-box;
+       box-sizing: border-box;
+  z-index: 800;
+  }
+/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
+.leaflet-overlay-pane svg {
+  -moz-user-select: none;
+  }
+
+.leaflet-pane         { z-index: 400; }
+
+.leaflet-tile-pane    { z-index: 200; }
+.leaflet-overlay-pane { z-index: 400; }
+.leaflet-shadow-pane  { z-index: 500; }
+.leaflet-marker-pane  { z-index: 600; }
+.leaflet-tooltip-pane   { z-index: 650; }
+.leaflet-popup-pane   { z-index: 700; }
+
+.leaflet-map-pane canvas { z-index: 100; }
+.leaflet-map-pane svg    { z-index: 200; }
+
+.leaflet-vml-shape {
+  width: 1px;
+  height: 1px;
+  }
+.lvml {
+  behavior: url(#default#VML);
+  display: inline-block;
+  position: absolute;
+  }
+
+
+/* control positioning */
+
+.leaflet-control {
+  position: relative;
+  z-index: 800;
+  pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
+  pointer-events: auto;
+  }
+.leaflet-top,
+.leaflet-bottom {
+  position: absolute;
+  z-index: 1000;
+  pointer-events: none;
+  }
+.leaflet-top {
+  top: 0;
+  }
+.leaflet-right {
+  right: 0;
+  }
+.leaflet-bottom {
+  bottom: 0;
+  }
+.leaflet-left {
+  left: 0;
+  }
+.leaflet-control {
+  float: left;
+  clear: both;
+  }
+.leaflet-right .leaflet-control {
+  float: right;
+  }
+.leaflet-top .leaflet-control {
+  margin-top: 10px;
+  }
+.leaflet-bottom .leaflet-control {
+  margin-bottom: 10px;
+  }
+.leaflet-left .leaflet-control {
+  margin-left: 10px;
+  }
+.leaflet-right .leaflet-control {
+  margin-right: 10px;
+  }
+
+
+/* zoom and fade animations */
+
+.leaflet-fade-anim .leaflet-tile {
+  will-change: opacity;
+  }
+.leaflet-fade-anim .leaflet-popup {
+  opacity: 0;
+  -webkit-transition: opacity 0.2s linear;
+     -moz-transition: opacity 0.2s linear;
+       -o-transition: opacity 0.2s linear;
+          transition: opacity 0.2s linear;
+  }
+.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
+  opacity: 1;
+  }
+.leaflet-zoom-animated {
+  -webkit-transform-origin: 0 0;
+      -ms-transform-origin: 0 0;
+          transform-origin: 0 0;
+  }
+.leaflet-zoom-anim .leaflet-zoom-animated {
+  will-change: transform;
+  }
+.leaflet-zoom-anim .leaflet-zoom-animated {
+  -webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
+     -moz-transition:    -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
+       -o-transition:      -o-transform 0.25s cubic-bezier(0,0,0.25,1);
+          transition:         transform 0.25s cubic-bezier(0,0,0.25,1);
+  }
+.leaflet-zoom-anim .leaflet-tile,
+.leaflet-pan-anim .leaflet-tile {
+  -webkit-transition: none;
+     -moz-transition: none;
+       -o-transition: none;
+          transition: none;
+  }
+
+.leaflet-zoom-anim .leaflet-zoom-hide {
+  visibility: hidden;
+  }
+
+
+/* cursors */
+
+.leaflet-interactive {
+  cursor: pointer;
+  }
+.leaflet-grab {
+  cursor: -webkit-grab;
+  cursor:    -moz-grab;
+  }
+.leaflet-crosshair,
+.leaflet-crosshair .leaflet-interactive {
+  cursor: crosshair;
+  }
+.leaflet-popup-pane,
+.leaflet-control {
+  cursor: auto;
+  }
+.leaflet-dragging .leaflet-grab,
+.leaflet-dragging .leaflet-grab .leaflet-interactive,
+.leaflet-dragging .leaflet-marker-draggable {
+  cursor: move;
+  cursor: -webkit-grabbing;
+  cursor:    -moz-grabbing;
+  }
+
+/* marker & overlays interactivity */
+.leaflet-marker-icon,
+.leaflet-marker-shadow,
+.leaflet-image-layer,
+.leaflet-pane > svg path,
+.leaflet-tile-container {
+  pointer-events: none;
+  }
+
+.leaflet-marker-icon.leaflet-interactive,
+.leaflet-image-layer.leaflet-interactive,
+.leaflet-pane > svg path.leaflet-interactive {
+  pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
+  pointer-events: auto;
+  }
+
+/* visual tweaks */
+
+.leaflet-container {
+  background: #ddd;
+  outline: 0;
+  }
+.leaflet-container a {
+  color: #0078A8;
+  }
+.leaflet-container a.leaflet-active {
+  outline: 2px solid orange;
+  }
+.leaflet-zoom-box {
+  border: 2px dotted #38f;
+  background: rgba(255,255,255,0.5);
+  }
+
+
+/* general typography */
+.leaflet-container {
+  font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
+  }
+
+
+/* general toolbar styles */
+
+.leaflet-bar {
+  box-shadow: 0 1px 5px rgba(0,0,0,0.65);
+  border-radius: 4px;
+  }
+.leaflet-bar a,
+.leaflet-bar a:hover {
+  background-color: #fff;
+  border-bottom: 1px solid #ccc;
+  width: 26px;
+  height: 26px;
+  line-height: 26px;
+  display: block;
+  text-align: center;
+  text-decoration: none;
+  color: black;
+  }
+.leaflet-bar a,
+.leaflet-control-layers-toggle {
+  background-position: 50% 50%;
+  background-repeat: no-repeat;
+  display: block;
+  }
+.leaflet-bar a:hover {
+  background-color: #f4f4f4;
+  }
+.leaflet-bar a:first-child {
+  border-top-left-radius: 4px;
+  border-top-right-radius: 4px;
+  }
+.leaflet-bar a:last-child {
+  border-bottom-left-radius: 4px;
+  border-bottom-right-radius: 4px;
+  border-bottom: none;
+  }
+.leaflet-bar a.leaflet-disabled {
+  cursor: default;
+  background-color: #f4f4f4;
+  color: #bbb;
+  }
+
+.leaflet-touch .leaflet-bar a {
+  width: 30px;
+  height: 30px;
+  line-height: 30px;
+  }
+.leaflet-touch .leaflet-bar a:first-child {
+  border-top-left-radius: 2px;
+  border-top-right-radius: 2px;
+  }
+.leaflet-touch .leaflet-bar a:last-child {
+  border-bottom-left-radius: 2px;
+  border-bottom-right-radius: 2px;
+  }
+
+/* zoom control */
+
+.leaflet-control-zoom-in,
+.leaflet-control-zoom-out {
+  font: bold 18px 'Lucida Console', Monaco, monospace;
+  text-indent: 1px;
+  }
+
+.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out  {
+  font-size: 22px;
+  }
+
+
+/* layers control */
+
+.leaflet-control-layers {
+  box-shadow: 0 1px 5px rgba(0,0,0,0.4);
+  background: #fff;
+  border-radius: 5px;
+  }
+.leaflet-control-layers-toggle {
+  background-image: url(images/layers.png);
+  width: 36px;
+  height: 36px;
+  }
+.leaflet-retina .leaflet-control-layers-toggle {
+  background-image: url(images/layers-2x.png);
+  background-size: 26px 26px;
+  }
+.leaflet-touch .leaflet-control-layers-toggle {
+  width: 44px;
+  height: 44px;
+  }
+.leaflet-control-layers .leaflet-control-layers-list,
+.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
+  display: none;
+  }
+.leaflet-control-layers-expanded .leaflet-control-layers-list {
+  display: block;
+  position: relative;
+  }
+.leaflet-control-layers-expanded {
+  padding: 6px 10px 6px 6px;
+  color: #333;
+  background: #fff;
+  }
+.leaflet-control-layers-scrollbar {
+  overflow-y: scroll;
+  padding-right: 5px;
+  }
+.leaflet-control-layers-selector {
+  margin-top: 2px;
+  position: relative;
+  top: 1px;
+  }
+.leaflet-control-layers label {
+  display: block;
+  }
+.leaflet-control-layers-separator {
+  height: 0;
+  border-top: 1px solid #ddd;
+  margin: 5px -10px 5px -6px;
+  }
+
+/* Default icon URLs */
+.leaflet-default-icon-path {
+  background-image: url(images/marker-icon.png);
+  }
+
+
+/* attribution and scale controls */
+
+.leaflet-container .leaflet-control-attribution {
+  background: #fff;
+  background: rgba(255, 255, 255, 0.7);
+  margin: 0;
+  }
+.leaflet-control-attribution,
+.leaflet-control-scale-line {
+  padding: 0 5px;
+  color: #333;
+  }
+.leaflet-control-attribution a {
+  text-decoration: none;
+  }
+.leaflet-control-attribution a:hover {
+  text-decoration: underline;
+  }
+.leaflet-container .leaflet-control-attribution,
+.leaflet-container .leaflet-control-scale {
+  font-size: 11px;
+  }
+.leaflet-left .leaflet-control-scale {
+  margin-left: 5px;
+  }
+.leaflet-bottom .leaflet-control-scale {
+  margin-bottom: 5px;
+  }
+.leaflet-control-scale-line {
+  border: 2px solid #777;
+  border-top: none;
+  line-height: 1.1;
+  padding: 2px 5px 1px;
+  font-size: 11px;
+  white-space: nowrap;
+  overflow: hidden;
+  -moz-box-sizing: border-box;
+       box-sizing: border-box;
+
+  background: #fff;
+  background: rgba(255, 255, 255, 0.5);
+  }
+.leaflet-control-scale-line:not(:first-child) {
+  border-top: 2px solid #777;
+  border-bottom: none;
+  margin-top: -2px;
+  }
+.leaflet-control-scale-line:not(:first-child):not(:last-child) {
+  border-bottom: 2px solid #777;
+  }
+
+.leaflet-touch .leaflet-control-attribution,
+.leaflet-touch .leaflet-control-layers,
+.leaflet-touch .leaflet-bar {
+  box-shadow: none;
+  }
+.leaflet-touch .leaflet-control-layers,
+.leaflet-touch .leaflet-bar {
+  border: 2px solid rgba(0,0,0,0.2);
+  background-clip: padding-box;
+  }
+
+
+/* popup */
+
+.leaflet-popup {
+  position: absolute;
+  text-align: center;
+  margin-bottom: 20px;
+  }
+.leaflet-popup-content-wrapper {
+  padding: 1px;
+  text-align: left;
+  border-radius: 12px;
+  }
+.leaflet-popup-content {
+  margin: 13px 19px;
+  line-height: 1.4;
+  }
+.leaflet-popup-content p {
+  margin: 18px 0;
+  }
+.leaflet-popup-tip-container {
+  width: 40px;
+  height: 20px;
+  position: absolute;
+  left: 50%;
+  margin-left: -20px;
+  overflow: hidden;
+  pointer-events: none;
+  }
+.leaflet-popup-tip {
+  width: 17px;
+  height: 17px;
+  padding: 1px;
+
+  margin: -10px auto 0;
+
+  -webkit-transform: rotate(45deg);
+     -moz-transform: rotate(45deg);
+      -ms-transform: rotate(45deg);
+       -o-transform: rotate(45deg);
+          transform: rotate(45deg);
+  }
+.leaflet-popup-content-wrapper,
+.leaflet-popup-tip {
+  background: white;
+  color: #333;
+  box-shadow: 0 3px 14px rgba(0,0,0,0.4);
+  }
+.leaflet-container a.leaflet-popup-close-button {
+  position: absolute;
+  top: 0;
+  right: 0;
+  padding: 4px 4px 0 0;
+  border: none;
+  text-align: center;
+  width: 18px;
+  height: 14px;
+  font: 16px/14px Tahoma, Verdana, sans-serif;
+  color: #c3c3c3;
+  text-decoration: none;
+  font-weight: bold;
+  background: transparent;
+  }
+.leaflet-container a.leaflet-popup-close-button:hover {
+  color: #999;
+  }
+.leaflet-popup-scrolled {
+  overflow: auto;
+  border-bottom: 1px solid #ddd;
+  border-top: 1px solid #ddd;
+  }
+
+.leaflet-oldie .leaflet-popup-content-wrapper {
+  zoom: 1;
+  }
+.leaflet-oldie .leaflet-popup-tip {
+  width: 24px;
+  margin: 0 auto;
+
+  -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
+  filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
+  }
+.leaflet-oldie .leaflet-popup-tip-container {
+  margin-top: -1px;
+  }
+
+.leaflet-oldie .leaflet-control-zoom,
+.leaflet-oldie .leaflet-control-layers,
+.leaflet-oldie .leaflet-popup-content-wrapper,
+.leaflet-oldie .leaflet-popup-tip {
+  border: 1px solid #999;
+  }
+
+
+/* div icon */
+
+.leaflet-div-icon {
+  background: #fff;
+  border: 1px solid #666;
+  }
+
+
+/* Tooltip */
+/* Base styles for the element that has a tooltip */
+.leaflet-tooltip {
+  position: absolute;
+  padding: 6px;
+  background-color: #fff;
+  border: 1px solid #fff;
+  border-radius: 3px;
+  color: #222;
+  white-space: nowrap;
+  -webkit-user-select: none;
+  -moz-user-select: none;
+  -ms-user-select: none;
+  user-select: none;
+  pointer-events: none;
+  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
+  }
+.leaflet-tooltip.leaflet-clickable {
+  cursor: pointer;
+  pointer-events: auto;
+  }
+.leaflet-tooltip-top:before,
+.leaflet-tooltip-bottom:before,
+.leaflet-tooltip-left:before,
+.leaflet-tooltip-right:before {
+  position: absolute;
+  pointer-events: none;
+  border: 6px solid transparent;
+  background: transparent;
+  content: "";
+  }
+
+/* Directions */
+
+.leaflet-tooltip-bottom {
+  margin-top: 6px;
+}
+.leaflet-tooltip-top {
+  margin-top: -6px;
+}
+.leaflet-tooltip-bottom:before,
+.leaflet-tooltip-top:before {
+  left: 50%;
+  margin-left: -6px;
+  }
+.leaflet-tooltip-top:before {
+  bottom: 0;
+  margin-bottom: -12px;
+  border-top-color: #fff;
+  }
+.leaflet-tooltip-bottom:before {
+  top: 0;
+  margin-top: -12px;
+  margin-left: -6px;
+  border-bottom-color: #fff;
+  }
+.leaflet-tooltip-left {
+  margin-left: -6px;
+}
+.leaflet-tooltip-right {
+  margin-left: 6px;
+}
+.leaflet-tooltip-left:before,
+.leaflet-tooltip-right:before {
+  top: 50%;
+  margin-top: -6px;
+  }
+.leaflet-tooltip-left:before {
+  right: 0;
+  margin-right: -12px;
+  border-left-color: #fff;
+  }
+.leaflet-tooltip-right:before {
+  left: 0;
+  margin-left: -12px;
+  border-right-color: #fff;
+  }
diff --git a/homeassistant/components/frontend/www_static/panels/ha-panel-automation.html b/homeassistant/components/frontend/www_static/panels/ha-panel-automation.html
index 0af40e134e307eaf47b231b2e41850b6b6b4bf85..6e03db64c35b5aced66573dc181b81a692b78c0c 100644
--- a/homeassistant/components/frontend/www_static/panels/ha-panel-automation.html
+++ b/homeassistant/components/frontend/www_static/panels/ha-panel-automation.html
@@ -1,4 +1,4 @@
-<html><head></head><body><div hidden="" by-polymer-bundler=""><dom-module id="paper-fab" assetpath="../../bower_components/paper-fab/"><template strip-whitespace=""><style include="paper-material-styles">:host{@apply --layout-vertical;@apply --layout-center-center;background:var(--paper-fab-background, var(--accent-color));border-radius:50%;box-sizing:border-box;color:var(--text-primary-color);cursor:pointer;height:56px;min-width:0;outline:none;padding:16px;position:relative;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none;width:56px;z-index:0;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;@apply --paper-fab;}[hidden]{display:none !important;}:host([mini]){width:40px;height:40px;padding:8px;@apply --paper-fab-mini;}:host([disabled]){color:var(--paper-fab-disabled-text, var(--paper-grey-500));background:var(--paper-fab-disabled-background, var(--paper-grey-300));@apply --paper-fab-disabled;}iron-icon{@apply --paper-fab-iron-icon;}span{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;@apply --paper-fab-label;}:host(.keyboard-focus){background:var(--paper-fab-keyboard-focus-background, var(--paper-pink-900));}:host([elevation="1"]){@apply --paper-material-elevation-1;}:host([elevation="2"]){@apply --paper-material-elevation-2;}:host([elevation="3"]){@apply --paper-material-elevation-3;}:host([elevation="4"]){@apply --paper-material-elevation-4;}:host([elevation="5"]){@apply --paper-material-elevation-5;}</style><iron-icon id="icon" hidden$="{{!_computeIsIconFab(icon, src)}}" src="[[src]]" icon="[[icon]]"></iron-icon><span hidden$="{{_computeIsIconFab(icon, src)}}">{{label}}</span></template><script>Polymer({is:"paper-fab",behaviors:[Polymer.PaperButtonBehavior],properties:{src:{type:String,value:""},icon:{type:String,value:""},mini:{type:Boolean,value:!1,reflectToAttribute:!0},label:{type:String,observer:"_labelChanged"}},_labelChanged:function(){this.setAttribute("aria-label",this.label)},_computeIsIconFab:function(e,t){return e.length>0||t.length>0}});</script></dom-module><dom-module id="ha-automation-picker"><template><style include="ha-style">:host{display:block;}paper-card{display:block;max-width:600px;margin:0 auto;}.content{padding:16px;}.content > paper-card:first-child{margin-bottom:16px;color:var(--google-red-500);}paper-item{cursor:pointer;}paper-fab{position:fixed;bottom:16px;right:16px;z-index:1;}paper-fab[is-wide]{bottom:24px;right:24px;}a{color:var(--primary-color);}</style><app-header-layout has-scrolling-region=""><app-header slot="header" fixed=""><app-toolbar><ha-menu-button narrow="[[narrow]]" show-menu="[[showMenu]]"></ha-menu-button><div main-title="">Automations Editor</div></app-toolbar></app-header><div class="content"><paper-card><div class="card-content">Currently Chrome is the only supported browser.</div></paper-card><paper-card heading="Pick automation to edit"><div class="card-content">The automation editor allows you to create and edit automations. Please read <a href="https://home-assistant.io/docs/automation/editor/" target="_blank">the instructions</a> to make sure that you have configured Home Assistant correctly.<template is="dom-if" if="[[!automations.length]]"><p>We couldn't find any editable automations.</p></template></div><template is="dom-repeat" items="[[automations]]" as="automation"><paper-item><paper-item-body two-line="" on-tap="automationTapped"><div>[[computeName(automation)]]</div><div secondary="">[[computeDescription(automation)]]</div></paper-item-body>[[computeStatus(automation)]]</paper-item></template></paper-card><paper-fab is-wide$="[[isWide]]" icon="mdi:plus" title="Add Automation" on-tap="addAutomation"></paper-fab></div></app-header-layout></template></dom-module><script>Polymer({is:"ha-automation-picker",properties:{hass:{type:Object},narrow:{type:Boolean},showMenu:{type:Boolean,value:!1},automations:{type:Array},isWide:{type:Boolean}},automationTapped:function(t){history.pushState(null,null,"/automation/edit/"+this.automations[t.model.index].attributes.id),this.fire("location-changed")},addAutomation:function(){history.pushState(null,null,"/automation/new"),this.fire("location-changed")},computeName:function(t){return window.hassUtil.computeStateName(t)},computeDescription:function(t){return""},computeStatus:function(t){return t.state}});</script><script>!function(){"use strict";function e(){}function n(n,t){var o=arguments,r=U,i=void 0,a=void 0,l=void 0,s=void 0;for(s=arguments.length;s-- >2;)A.push(o[s]);for(t&&null!=t.children&&(A.length||A.push(t.children),delete t.children);A.length;)if((a=A.pop())&&void 0!==a.pop)for(s=a.length;s--;)A.push(a[s]);else!0!==a&&!1!==a||(a=null),(l="function"!=typeof n)&&(null==a?a="":"number"==typeof a?a=String(a):"string"!=typeof a&&(l=!1)),l&&i?r[r.length-1]+=a:r===U?r=[a]:r.push(a),i=l;var p=new e;return p.nodeName=n,p.children=r,p.attributes=null==t?void 0:t,p.key=null==t?void 0:t.key,void 0!==j.vnode&&j.vnode(p),p}function t(e,n){for(var t in n)e[t]=n[t];return e}function o(e){!e._dirty&&(e._dirty=!0)&&1==z.push(e)&&(j.debounceRendering||setTimeout)(r)}function r(){var e=void 0,n=z;for(z=[];e=n.pop();)e._dirty&&x(e)}function i(e,n,t){return"string"==typeof n||"number"==typeof n?void 0!==e.splitText:"string"==typeof n.nodeName?!e._componentConstructor&&a(e,n.nodeName):t||e._componentConstructor===n.nodeName}function a(e,n){return e.normalizedNodeName===n||e.nodeName.toLowerCase()===n.toLowerCase()}function l(e){var n=t({},e.attributes);n.children=e.children;var o=e.nodeName.defaultProps;if(void 0!==o)for(var r in o)void 0===n[r]&&(n[r]=o[r]);return n}function s(e,n){var t=n?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return t.normalizedNodeName=e,t}function p(e){e.parentNode&&e.parentNode.removeChild(e)}function u(e,n,t,o,r){if("className"===n&&(n="class"),"key"===n);else if("ref"===n)t&&t(null),o&&o(e);else if("class"!==n||r)if("style"===n){if(o&&"string"!=typeof o&&"string"!=typeof t||(e.style.cssText=o||""),o&&"object"===(void 0===o?"undefined":H(o))){if("string"!=typeof t)for(var i in t)i in o||(e.style[i]="");for(var a in o)e.style[a]="number"==typeof o[a]&&!1===W.test(a)?o[a]+"px":o[a]}}else if("dangerouslySetInnerHTML"===n)o&&(e.innerHTML=o.__html||"");else if("o"==n[0]&&"n"==n[1]){var l=n!==(n=n.replace(/Capture$/,""));n=n.toLowerCase().substring(2),o?t||e.addEventListener(n,d,l):e.removeEventListener(n,d,l),(e._listeners||(e._listeners={}))[n]=o}else if("list"!==n&&"type"!==n&&!r&&n in e)c(e,n,null==o?"":o),null!=o&&!1!==o||e.removeAttribute(n);else{var s=r&&n!==(n=n.replace(/^xlink\:?/,""));null==o||!1===o?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",n.toLowerCase()):e.removeAttribute(n):"function"!=typeof o&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",n.toLowerCase(),o):e.setAttribute(n,o))}else e.className=o||""}function c(e,n,t){try{e[n]=t}catch(e){}}function d(e){return this._listeners[e.type](j.event&&j.event(e)||e)}function h(){for(var e=void 0;e=G.pop();)j.afterMount&&j.afterMount(e),e.componentDidMount&&e.componentDidMount()}function f(e,n,t,o,r,i){K++||(Q=null!=r&&void 0!==r.ownerSVGElement,X=null!=e&&!(B in e));var a=g(e,n,t,o,i);return r&&a.parentNode!==r&&r.appendChild(a),--K||(X=!1,i||h()),a}function g(e,n,t,o,r){var i=e,l=Q;if(null==n&&(n=""),"string"==typeof n)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=n&&(e.nodeValue=n):(i=document.createTextNode(n),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),m(e,!0))),i[B]=!0,i;if("function"==typeof n.nodeName)return N(e,n,t,o);if(Q="svg"===n.nodeName||"foreignObject"!==n.nodeName&&Q,(!e||!a(e,String(n.nodeName)))&&(i=s(String(n.nodeName),Q),e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),m(e,!0)}var p=i.firstChild,u=i[B]||(i[B]={}),c=n.children;return!X&&c&&1===c.length&&"string"==typeof c[0]&&null!=p&&void 0!==p.splitText&&null==p.nextSibling?p.nodeValue!=c[0]&&(p.nodeValue=c[0]):(c&&c.length||null!=p)&&v(i,c,t,o,X||null!=u.dangerouslySetInnerHTML),b(i,n.attributes,u),Q=l,i}function v(e,n,t,o,r){var a=e.childNodes,l=[],s={},u=0,c=0,d=a.length,h=0,f=n?n.length:0,v=void 0,y=void 0,b=void 0,C=void 0;if(0!==d)for(var _=0;_<d;_++){var w=a[_],k=w[B],x=f&&k?w._component?w._component.__key:k.key:null;null!=x?(u++,s[x]=w):(k||(void 0!==w.splitText?!r||w.nodeValue.trim():r))&&(l[h++]=w)}if(0!==f)for(var N=0;N<f;N++){C=null;var O=(b=n[N]).key;if(null!=O)u&&void 0!==s[O]&&(C=s[O],s[O]=void 0,u--);else if(!C&&c<h)for(v=c;v<h;v++)if(void 0!==l[v]&&i(y=l[v],b,r)){C=y,l[v]=void 0,v===h-1&&h--,v===c&&c++;break}(C=g(C,b,t,o))&&C!==e&&(N>=d?e.appendChild(C):C!==a[N]&&(C===a[N+1]?p(a[N]):e.insertBefore(C,a[N]||null)))}if(u)for(var S in s)void 0!==s[S]&&m(s[S],!1);for(;c<=h;)void 0!==(C=l[h--])&&m(C,!1)}function m(e,n){var t=e._component;t?O(t):(null!=e[B]&&e[B].ref&&e[B].ref(null),!1!==n&&null!=e[B]||p(e),y(e))}function y(e){for(e=e.lastChild;e;){var n=e.previousSibling;m(e,!0),e=n}}function b(e,n,t){var o=void 0;for(o in t)n&&null!=n[o]||null==t[o]||u(e,o,t[o],t[o]=void 0,Q);for(o in n)"children"===o||"innerHTML"===o||o in t&&n[o]===("value"===o||"checked"===o?e[o]:t[o])||u(e,o,t[o],t[o]=n[o],Q)}function C(e){var n=e.constructor.name;(Y[n]||(Y[n]=[])).push(e)}function _(e,n,t){var o=Y[e.name],r=void 0;if(e.prototype&&e.prototype.render?(r=new e(n,t),S.call(r,n,t)):((r=new S(n,t)).constructor=e,r.render=w),o)for(var i=o.length;i--;)if(o[i].constructor===e){r.nextBase=o[i].nextBase,o.splice(i,1);break}return r}function w(e,n,t){return this.constructor(e,t)}function k(e,n,t,r,i){e._disable||(e._disable=!0,(e.__ref=n.ref)&&delete n.ref,(e.__key=n.key)&&delete n.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(n,r),r&&r!==e.context&&(e.prevContext||(e.prevContext=e.context),e.context=r),e.prevProps||(e.prevProps=e.props),e.props=n,e._disable=!1,t!==L&&(t!==E&&!1===j.syncComponentUpdates&&e.base?o(e):x(e,E,i)),e.__ref&&e.__ref(e))}function x(e,n,o,r){if(!e._disable){var i=e.props,a=e.state,s=e.context,p=e.prevProps||i,u=e.prevState||a,c=e.prevContext||s,d=e.base,g=e.nextBase,v=d||g,y=e._component,b=!1,C=void 0,w=void 0,N=void 0;if(d&&(e.props=p,e.state=u,e.context=c,n!==M&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(i,a,s)?b=!0:e.componentWillUpdate&&e.componentWillUpdate(i,a,s),e.props=i,e.state=a,e.context=s),e.prevProps=e.prevState=e.prevContext=e.nextBase=null,e._dirty=!1,!b){C=e.render(i,a,s),e.getChildContext&&(s=t(t({},s),e.getChildContext()));var S=C&&C.nodeName,T=void 0,D=void 0;if("function"==typeof S){var P=l(C);(w=y)&&w.constructor===S&&P.key==w.__key?k(w,P,E,s,!1):(T=w,e._component=w=_(S,P,s),w.nextBase=w.nextBase||g,w._parentComponent=e,k(w,P,L,s,!1),x(w,E,o,!0)),D=w.base}else N=v,(T=y)&&(N=e._component=null),(v||n===E)&&(N&&(N._component=null),D=f(N,C,s,o||!d,v&&v.parentNode,!0));if(v&&D!==v&&w!==y){var A=v.parentNode;A&&D!==A&&(A.replaceChild(D,v),T||(v._component=null,m(v,!1)))}if(T&&O(T),e.base=D,D&&!r){for(var U=e,V=e;V=V._parentComponent;)(U=V).base=D;D._component=U,D._componentConstructor=U.constructor}}if(!d||o?G.unshift(e):b||(h(),e.componentDidUpdate&&e.componentDidUpdate(p,u,c),j.afterUpdate&&j.afterUpdate(e)),null!=e._renderCallbacks)for(;e._renderCallbacks.length;)e._renderCallbacks.pop().call(e);K||r||h()}}function N(e,n,t,o){for(var r=e&&e._component,i=r,a=e,s=r&&e._componentConstructor===n.nodeName,p=s,u=l(n);r&&!p&&(r=r._parentComponent);)p=r.constructor===n.nodeName;return r&&p&&(!o||r._component)?(k(r,u,V,t,o),e=r.base):(i&&!s&&(O(i),e=a=null),r=_(n.nodeName,u,t),e&&!r.nextBase&&(r.nextBase=e,a=null),k(r,u,E,t,o),e=r.base,a&&e!==a&&(a._component=null,m(a,!1))),e}function O(e){j.beforeUnmount&&j.beforeUnmount(e);var n=e.base;e._disable=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var t=e._component;t?O(t):n&&(n[B]&&n[B].ref&&n[B].ref(null),e.nextBase=n,p(n),C(e),y(n)),e.__ref&&e.__ref(null)}function S(e,n){this._dirty=!0,this.context=n,this.props=e,this.state=this.state||{}}function T(e,n,t){return f(t,e,{},!1,n,!1)}function D(e){var n=F({},this.props.trigger);e.target.value?n[e.target.name]=e.target.value:delete n[e.target.name],this.props.onChange(this.props.index,n)}function P(e){return"service"in e?"Call Service":null}var j={},A=[],U=[],L=0,E=1,M=2,V=3,B="__preactattr_",W=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,z=[],H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},J=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),R=function(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e},F=Object.assign||function(e){for(var n=arguments,t=1;t<arguments.length;t++){var o=n[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},$=function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)},q=function(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n},G=[],K=0,Q=!1,X=!1,Y={};t(S.prototype,{setState:function(e,n){var r=this.state;this.prevState||(this.prevState=t({},r)),t(r,"function"==typeof e?e(r,this.props):e),n&&(this._renderCallbacks=this._renderCallbacks||[]).push(n),o(this)},forceUpdate:function(e){e&&(this._renderCallbacks=this._renderCallbacks||[]).push(e),x(this,M)},render:function(){}});var Z=function(e){function t(e){I(this,t);var n=q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state.isValid=!0,n.state.value=JSON.stringify(e.value||{},null,2),n.onChange=n.onChange.bind(n),n}return $(t,S),J(t,[{key:"onChange",value:function(e){var n=e.target.value,t=void 0,o=void 0;try{t=JSON.parse(n),o=!0}catch(e){o=!1}this.setState({value:n,isValid:o}),o&&this.props.onChange(t)}},{key:"componentWillReceiveProps",value:function(e){var n=e.value;this.setState({value:JSON.stringify(n,null,2),isValid:!0})}},{key:"render",value:function(e,t){var o=t.value,r={minWidth:300,width:"100%"};return t.isValid||(r.border="1px solid red"),n("iron-autogrow-textarea",{value:o,style:r,"onValue-Changed":this.onChange})}}]),t}(),ee={event:function(e){function t(){I(this,t);var e=q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.onChange=D.bind(e),e.eventDataChanged=e.eventDataChanged.bind(e),e}return $(t,S),J(t,[{key:"eventDataChanged",value:function(e){this.props.onChange(this.props.index,F({},this.props.trigger,{event_data:e}))}},{key:"render",value:function(e){var t=e.trigger,o=t.event_type,r=t.event_data;return n("div",null,n("paper-input",{label:"Event Type",name:"event_type",value:o,onChange:this.onChange}),"Event Data",n(Z,{value:r,onChange:this.eventDataChanged}))}}]),t}(),state:function(e){function t(){I(this,t);var e=q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.onChange=D.bind(e),e}return $(t,S),J(t,[{key:"render",value:function(e){var t=e.trigger,o=t.entity_id,r=t.to,i=t.from,a=t.for;return n("div",null,n("paper-input",{label:"Entity Id",name:"entity_id",value:o,onChange:this.onChange}),n("paper-input",{label:"From",name:"from",value:i,onChange:this.onChange}),n("paper-input",{label:"To",name:"to",value:r,onChange:this.onChange}),a&&n("pre",null,"For: ",JSON.stringify(a,null,2)))}}]),t}(),homeassistant:null,mqtt:null,numeric_state:function(e){function t(){I(this,t);var e=q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.onChange=D.bind(e),e}return $(t,S),J(t,[{key:"render",value:function(e){var t=e.trigger,o=t.value_template,r=t.entity_id,i=t.below,a=t.above;return n("div",null,n("paper-input",{label:"Entity Id",name:"entity_id",value:r,onChange:this.onChange}),n("paper-input",{label:"Above",name:"above",value:a,onChange:this.onChange}),n("paper-input",{label:"Below",name:"below",value:i,onChange:this.onChange}),"Value template (optional)",n("br",null),n("textarea",{name:"value_template",value:o,style:{width:"100%",height:100},onChange:this.onChange}))}}]),t}(),sun:null,template:null,time:null,zone:null},ne=Object.keys(ee).sort(),te=function(e){function t(){I(this,t);var e=q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.typeChanged=e.typeChanged.bind(e),e.onDelete=e.onDelete.bind(e),e}return $(t,S),J(t,[{key:"typeChanged",value:function(e){var n=e.target.selectedItem.innerHTML;n!==this.props.trigger.platform&&this.props.onChange(this.props.index,{platform:n})}},{key:"onDelete",value:function(){confirm("Sure you want to delete?")&&this.props.onChange(this.props.index,null)}},{key:"render",value:function(e){var t=e.index,o=e.trigger,r=e.onChange,i=ee[o.platform],a=ne.indexOf(o.platform),l=void 0;return l=i?n("div",null,n("paper-dropdown-menu-light",{label:"Trigger Type","no-animations":!0},n("paper-listbox",{slot:"dropdown-content",selected:a,"oniron-select":this.typeChanged},ne.map(function(e){return n("paper-item",null,e)}))),n(i,{index:t,trigger:o,onChange:r})):n("div",null,"Unsupported platform: ",o.platform,n("pre",null,JSON.stringify(o,null,2))),n("paper-card",null,n("div",{class:"card-menu"},n("paper-menu-button",{"no-animations":!0,"horizontal-align":"right","horizontal-offset":"-5","vertical-offset":"-5"},n("paper-icon-button",{icon:"mdi:dots-vertical",slot:"dropdown-trigger"}),n("paper-listbox",{slot:"dropdown-content"},n("paper-item",{disabled:!0},"Duplicate"),n("paper-item",{onTap:this.onDelete},"Delete")))),n("div",{class:"card-content"},l))}}]),t}(),oe=function(e){function t(){I(this,t);var e=q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.addTrigger=e.addTrigger.bind(e),e.triggerChanged=e.triggerChanged.bind(e),e}return $(t,S),J(t,[{key:"addTrigger",value:function(){var e=this.props.trigger.concat({platform:"event"});this.props.onChange(e)}},{key:"triggerChanged",value:function(e,n){var t=this.props.trigger.concat();null===n?t.splice(e,1):t[e]=n,this.props.onChange(t)}},{key:"render",value:function(e){var t=this;return n("div",{class:"triggers"},e.trigger.map(function(e,o){return n(te,{index:o,trigger:e,onChange:t.triggerChanged})}),n("paper-card",null,n("div",{class:"card-actions add-card"},n("paper-button",{onTap:this.addTrigger},"Add trigger"))))}}]),t}(),re={"Call Service":function(e){function t(){I(this,t);var e=q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.onChange=e.onChange.bind(e),e.serviceDataChanged=e.serviceDataChanged.bind(e),e}return $(t,S),J(t,[{key:"onChange",value:function(e){this.props.onChange(this.props.index,F({},this.props.action,R({},e.target.name,e.target.value)))}},{key:"serviceDataChanged",value:function(e){this.props.onChange(this.props.index,F({},this.props.action,{data:e}))}},{key:"render",value:function(e){var t=e.action,o=t.alias,r=t.service,i=t.data;return n("div",null,n("paper-input",{label:"Alias",name:"alias",value:o,onChange:this.onChange}),n("paper-input",{label:"Service",name:"service",value:r,onChange:this.onChange}),"Service Data",n("br",null),n(Z,{value:i,onChange:this.serviceDataChanged}))}}]),t}(),Delay:null,"Templated Delay":null,Condition:null,"Fire Event":null},ie=Object.keys(re).sort(),ae=function(e){function t(){I(this,t);var e=q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.typeChanged=e.typeChanged.bind(e),e.onDelete=e.onDelete.bind(e),e}return $(t,S),J(t,[{key:"typeChanged",value:function(e){var n=e.target.selectedItem.innerHTML;P(this.props.action)!==n&&this.props.onChange(this.props.index,{platform:n})}},{key:"onDelete",value:function(){confirm("Sure you want to delete?")&&this.props.onChange(this.props.index,null)}},{key:"render",value:function(e){var t=e.index,o=e.action,r=e.onChange,i=P(o),a=re[i],l=ie.indexOf(i),s=void 0;return s=a?n("div",null,n("paper-dropdown-menu-light",{label:"Action Type","no-animations":!0},n("paper-listbox",{slot:"dropdown-content",selected:l,"oniron-select":this.typeChanged},ie.map(function(e){return n("paper-item",null,e)}))),n(a,{index:t,action:o,onChange:r})):n("div",null,"Unsupported action",n("pre",null,JSON.stringify(o,null,2))),n("paper-card",null,n("div",{class:"card-menu"},n("paper-menu-button",{"no-animations":!0,"horizontal-align":"right","horizontal-offset":"-5","vertical-offset":"-5"},n("paper-icon-button",{icon:"mdi:dots-vertical",slot:"dropdown-trigger"}),n("paper-listbox",{slot:"dropdown-content"},n("paper-item",{disabled:!0},"Duplicate"),n("paper-item",{onTap:this.onDelete},"Delete")))),n("div",{class:"card-content"},s))}}]),t}(),le=function(e){function t(){I(this,t);var e=q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.addAction=e.addAction.bind(e),e.actionChanged=e.actionChanged.bind(e),e}return $(t,S),J(t,[{key:"addAction",value:function(){var e=this.props.script.concat({service:""});this.props.onChange(e)}},{key:"actionChanged",value:function(e,n){var t=this.props.script.concat();null===n?t.splice(e,1):t[e]=n,this.props.onChange(t)}},{key:"render",value:function(e){var t=this;return n("div",{class:"script"},e.script.map(function(e,o){return n(ae,{index:o,action:e,onChange:t.actionChanged})}),n("paper-card",null,n("div",{class:"card-actions add-card"},n("paper-button",{onTap:this.addAction},"Add action"))))}}]),t}(),se=function(e){function t(){I(this,t);var e=q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.onChange=e.onChange.bind(e),e.triggerChanged=e.triggerChanged.bind(e),e.actionChanged=e.actionChanged.bind(e),e}return $(t,S),J(t,[{key:"onChange",value:function(e){this.props.onChange(F({},this.props.automation,R({},e.target.name,e.target.value)))}},{key:"triggerChanged",value:function(e){this.props.onChange(F({},this.props.automation,{trigger:e}))}},{key:"actionChanged",value:function(e){this.props.onChange(F({},this.props.automation,{action:e}))}},{key:"render",value:function(e){var t=e.automation,o=e.isWide,r=t.alias,i=t.trigger,a=t.condition,l=t.action;return n("div",null,n("ha-config-section",{"is-wide":o},n("span",{slot:"header"},r),n("span",{slot:"introduction"},"Use automations to bring your home alive."),n("paper-card",null,n("div",{class:"card-content"},n("paper-input",{label:"Name",name:"alias",value:r,onChange:this.onChange})))),n("ha-config-section",{"is-wide":o},n("span",{slot:"header"},"Triggers"),n("span",{slot:"introduction"},"Triggers are what starts the processing of an automation rule. It is possible to specify multiple triggers for the same rule. Once a trigger starts, Home Assistant will validate the conditions, if any, and call the action.",n("p",null,n("a",{href:"https://home-assistant.io/docs/automation/trigger/",target:"_blank"},"Learn more about triggers."))),n(oe,{trigger:i,onChange:this.triggerChanged})),a&&n("ha-config-section",{"is-wide":o},n("span",{slot:"header"},"Conditions"),n("span",{slot:"introduction"},"Conditions are an optional part of an automation rule and can be used to prevent an action from happening when triggered. Conditions look very similar to triggers but are very different. A trigger will look at events happening in the system while a condition only looks at how the system looks right now. A trigger can observe that a switch is being turned on. A condition can only see if a switch is currently on or off.",n("p",null,n("a",{href:"https://home-assistant.io/docs/scripts/conditions/",target:"_blank"},"Learn more about conditions."))),n("paper-card",null,n("div",{class:"card-content"},"Conditions are not supported yet.",n("pre",null,JSON.stringify(a,null,2))))),n("ha-config-section",{"is-wide":o},n("span",{slot:"header"},"Action"),n("span",{slot:"introduction"},"The actions are what Home Assistant will do when the automation is triggered.",n("p",null,n("a",{href:"https://home-assistant.io/docs/scripts/",target:"_blank"},"Learn more about actions."))),n(le,{script:l,onChange:this.actionChanged})))}}]),t}();window.AutomationEditor=function(e,t,o){return T(n(se,t),e,o)},window.unmountPreact=function(e,n){T(function(){return null},e,n)}}();</script><dom-module id="ha-automation-editor"><template><style include="ha-style">.errors{padding:20px;font-weight:bold;color:var(--google-red-500);}.content{padding-bottom:20px;}paper-card{display:block;}.triggers,
+<html><head></head><body><div hidden="" by-polymer-bundler=""><dom-module id="paper-fab" assetpath="../../bower_components/paper-fab/"><template strip-whitespace=""><style include="paper-material-styles">:host{@apply --layout-vertical;@apply --layout-center-center;background:var(--paper-fab-background, var(--accent-color));border-radius:50%;box-sizing:border-box;color:var(--text-primary-color);cursor:pointer;height:56px;min-width:0;outline:none;padding:16px;position:relative;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none;width:56px;z-index:0;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;@apply --paper-fab;}[hidden]{display:none !important;}:host([mini]){width:40px;height:40px;padding:8px;@apply --paper-fab-mini;}:host([disabled]){color:var(--paper-fab-disabled-text, var(--paper-grey-500));background:var(--paper-fab-disabled-background, var(--paper-grey-300));@apply --paper-fab-disabled;}iron-icon{@apply --paper-fab-iron-icon;}span{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;@apply --paper-fab-label;}:host(.keyboard-focus){background:var(--paper-fab-keyboard-focus-background, var(--paper-pink-900));}:host([elevation="1"]){@apply --paper-material-elevation-1;}:host([elevation="2"]){@apply --paper-material-elevation-2;}:host([elevation="3"]){@apply --paper-material-elevation-3;}:host([elevation="4"]){@apply --paper-material-elevation-4;}:host([elevation="5"]){@apply --paper-material-elevation-5;}</style><iron-icon id="icon" hidden$="{{!_computeIsIconFab(icon, src)}}" src="[[src]]" icon="[[icon]]"></iron-icon><span hidden$="{{_computeIsIconFab(icon, src)}}">{{label}}</span></template><script>Polymer({is:"paper-fab",behaviors:[Polymer.PaperButtonBehavior],properties:{src:{type:String,value:""},icon:{type:String,value:""},mini:{type:Boolean,value:!1,reflectToAttribute:!0},label:{type:String,observer:"_labelChanged"}},_labelChanged:function(){this.setAttribute("aria-label",this.label)},_computeIsIconFab:function(e,t){return e.length>0||t.length>0}});</script></dom-module><dom-module id="ha-automation-picker"><template><style include="ha-style">:host{display:block;}paper-card{display:block;max-width:600px;margin:0 auto;}.content{padding:16px;}paper-item{cursor:pointer;}paper-fab{position:fixed;bottom:16px;right:16px;z-index:1;}paper-fab[is-wide]{bottom:24px;right:24px;}a{color:var(--primary-color);}</style><app-header-layout has-scrolling-region=""><app-header slot="header" fixed=""><app-toolbar><ha-menu-button narrow="[[narrow]]" show-menu="[[showMenu]]"></ha-menu-button><div main-title="">Automations Editor</div></app-toolbar></app-header><div class="content"><paper-card heading="Pick automation to edit"><div class="card-content">The automation editor allows you to create and edit automations. Please read <a href="https://home-assistant.io/docs/automation/editor/" target="_blank">the instructions</a> to make sure that you have configured Home Assistant correctly.<template is="dom-if" if="[[!automations.length]]"><p>We couldn't find any editable automations.</p></template></div><template is="dom-repeat" items="[[automations]]" as="automation"><paper-item><paper-item-body two-line="" on-tap="automationTapped"><div>[[computeName(automation)]]</div><div secondary="">[[computeDescription(automation)]]</div></paper-item-body>[[computeStatus(automation)]]</paper-item></template></paper-card><paper-fab is-wide$="[[isWide]]" icon="mdi:plus" title="Add Automation" on-tap="addAutomation"></paper-fab></div></app-header-layout></template></dom-module><script>Polymer({is:"ha-automation-picker",properties:{hass:{type:Object},narrow:{type:Boolean},showMenu:{type:Boolean,value:!1},automations:{type:Array},isWide:{type:Boolean}},automationTapped:function(t){history.pushState(null,null,"/automation/edit/"+this.automations[t.model.index].attributes.id),this.fire("location-changed")},addAutomation:function(){history.pushState(null,null,"/automation/new"),this.fire("location-changed")},computeName:function(t){return window.hassUtil.computeStateName(t)},computeDescription:function(t){return""},computeStatus:function(t){return t.state}});</script><script>var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(){"use strict";function e(){}function n(n,t){var o=U,r=void 0,i=void 0,a=void 0,l=void 0;for(l=arguments.length;l-- >2;)A.push(arguments[l]);for(t&&null!=t.children&&(A.length||A.push(t.children),delete t.children);A.length;)if((i=A.pop())&&void 0!==i.pop)for(l=i.length;l--;)A.push(i[l]);else!0!==i&&!1!==i||(i=null),(a="function"!=typeof n)&&(null==i?i="":"number"==typeof i?i=String(i):"string"!=typeof i&&(a=!1)),a&&r?o[o.length-1]+=i:o===U?o=[i]:o.push(i),r=a;var s=new e;return s.nodeName=n,s.children=o,s.attributes=null==t?void 0:t,s.key=null==t?void 0:t.key,void 0!==j.vnode&&j.vnode(s),s}function t(e,n){for(var t in n)e[t]=n[t];return e}function o(e){!e._dirty&&(e._dirty=!0)&&1==z.push(e)&&(j.debounceRendering||setTimeout)(r)}function r(){var e=void 0,n=z;for(z=[];e=n.pop();)e._dirty&&x(e)}function i(e,n,t){return"string"==typeof n||"number"==typeof n?void 0!==e.splitText:"string"==typeof n.nodeName?!e._componentConstructor&&a(e,n.nodeName):t||e._componentConstructor===n.nodeName}function a(e,n){return e.normalizedNodeName===n||e.nodeName.toLowerCase()===n.toLowerCase()}function l(e){var n=t({},e.attributes);n.children=e.children;var o=e.nodeName.defaultProps;if(void 0!==o)for(var r in o)void 0===n[r]&&(n[r]=o[r]);return n}function s(e,n){var t=n?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return t.normalizedNodeName=e,t}function p(e){e.parentNode&&e.parentNode.removeChild(e)}function u(e,n,t,o,r){if("className"===n&&(n="class"),"key"===n);else if("ref"===n)t&&t(null),o&&o(e);else if("class"!==n||r)if("style"===n){if(o&&"string"!=typeof o&&"string"!=typeof t||(e.style.cssText=o||""),o&&"object"===(void 0===o?"undefined":H(o))){if("string"!=typeof t)for(var i in t)i in o||(e.style[i]="");for(var a in o)e.style[a]="number"==typeof o[a]&&!1===W.test(a)?o[a]+"px":o[a]}}else if("dangerouslySetInnerHTML"===n)o&&(e.innerHTML=o.__html||"");else if("o"==n[0]&&"n"==n[1]){var l=n!==(n=n.replace(/Capture$/,""));n=n.toLowerCase().substring(2),o?t||e.addEventListener(n,d,l):e.removeEventListener(n,d,l),(e._listeners||(e._listeners={}))[n]=o}else if("list"!==n&&"type"!==n&&!r&&n in e)c(e,n,null==o?"":o),null!=o&&!1!==o||e.removeAttribute(n);else{var s=r&&n!==(n=n.replace(/^xlink\:?/,""));null==o||!1===o?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",n.toLowerCase()):e.removeAttribute(n):"function"!=typeof o&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",n.toLowerCase(),o):e.setAttribute(n,o))}else e.className=o||""}function c(e,n,t){try{e[n]=t}catch(e){}}function d(e){return this._listeners[e.type](j.event&&j.event(e)||e)}function h(){for(var e=void 0;e=G.pop();)j.afterMount&&j.afterMount(e),e.componentDidMount&&e.componentDidMount()}function f(e,n,t,o,r,i){K++||(Q=null!=r&&void 0!==r.ownerSVGElement,X=null!=e&&!(B in e));var a=g(e,n,t,o,i);return r&&a.parentNode!==r&&r.appendChild(a),--K||(X=!1,i||h()),a}function g(e,n,t,o,r){var i=e,l=Q;if(null==n&&(n=""),"string"==typeof n)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=n&&(e.nodeValue=n):(i=document.createTextNode(n),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),m(e,!0))),i[B]=!0,i;if("function"==typeof n.nodeName)return N(e,n,t,o);if(Q="svg"===n.nodeName||"foreignObject"!==n.nodeName&&Q,(!e||!a(e,String(n.nodeName)))&&(i=s(String(n.nodeName),Q),e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),m(e,!0)}var p=i.firstChild,u=i[B]||(i[B]={}),c=n.children;return!X&&c&&1===c.length&&"string"==typeof c[0]&&null!=p&&void 0!==p.splitText&&null==p.nextSibling?p.nodeValue!=c[0]&&(p.nodeValue=c[0]):(c&&c.length||null!=p)&&v(i,c,t,o,X||null!=u.dangerouslySetInnerHTML),b(i,n.attributes,u),Q=l,i}function v(e,n,t,o,r){var a=e.childNodes,l=[],s={},u=0,c=0,d=a.length,h=0,f=n?n.length:0,v=void 0,y=void 0,b=void 0,C=void 0;if(0!==d)for(var _=0;_<d;_++){var w=a[_],k=w[B],x=f&&k?w._component?w._component.__key:k.key:null;null!=x?(u++,s[x]=w):(k||(void 0!==w.splitText?!r||w.nodeValue.trim():r))&&(l[h++]=w)}if(0!==f)for(var N=0;N<f;N++){C=null;var O=(b=n[N]).key;if(null!=O)u&&void 0!==s[O]&&(C=s[O],s[O]=void 0,u--);else if(!C&&c<h)for(v=c;v<h;v++)if(void 0!==l[v]&&i(y=l[v],b,r)){C=y,l[v]=void 0,v===h-1&&h--,v===c&&c++;break}(C=g(C,b,t,o))&&C!==e&&(N>=d?e.appendChild(C):C!==a[N]&&(C===a[N+1]?p(a[N]):e.insertBefore(C,a[N]||null)))}if(u)for(var S in s)void 0!==s[S]&&m(s[S],!1);for(;c<=h;)void 0!==(C=l[h--])&&m(C,!1)}function m(e,n){var t=e._component;t?O(t):(null!=e[B]&&e[B].ref&&e[B].ref(null),!1!==n&&null!=e[B]||p(e),y(e))}function y(e){for(e=e.lastChild;e;){var n=e.previousSibling;m(e,!0),e=n}}function b(e,n,t){var o=void 0;for(o in t)n&&null!=n[o]||null==t[o]||u(e,o,t[o],t[o]=void 0,Q);for(o in n)"children"===o||"innerHTML"===o||o in t&&n[o]===("value"===o||"checked"===o?e[o]:t[o])||u(e,o,t[o],t[o]=n[o],Q)}function C(e){var n=e.constructor.name;(Y[n]||(Y[n]=[])).push(e)}function _(e,n,t){var o=Y[e.name],r=void 0;if(e.prototype&&e.prototype.render?(r=new e(n,t),S.call(r,n,t)):((r=new S(n,t)).constructor=e,r.render=w),o)for(var i=o.length;i--;)if(o[i].constructor===e){r.nextBase=o[i].nextBase,o.splice(i,1);break}return r}function w(e,n,t){return this.constructor(e,t)}function k(e,n,t,r,i){e._disable||(e._disable=!0,(e.__ref=n.ref)&&delete n.ref,(e.__key=n.key)&&delete n.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(n,r),r&&r!==e.context&&(e.prevContext||(e.prevContext=e.context),e.context=r),e.prevProps||(e.prevProps=e.props),e.props=n,e._disable=!1,t!==L&&(t!==E&&!1===j.syncComponentUpdates&&e.base?o(e):x(e,E,i)),e.__ref&&e.__ref(e))}function x(e,n,o,r){if(!e._disable){var i=e.props,a=e.state,s=e.context,p=e.prevProps||i,u=e.prevState||a,c=e.prevContext||s,d=e.base,g=e.nextBase,v=d||g,y=e._component,b=!1,C=void 0,w=void 0,N=void 0;if(d&&(e.props=p,e.state=u,e.context=c,n!==M&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(i,a,s)?b=!0:e.componentWillUpdate&&e.componentWillUpdate(i,a,s),e.props=i,e.state=a,e.context=s),e.prevProps=e.prevState=e.prevContext=e.nextBase=null,e._dirty=!1,!b){C=e.render(i,a,s),e.getChildContext&&(s=t(t({},s),e.getChildContext()));var S=C&&C.nodeName,T=void 0,D=void 0;if("function"==typeof S){var P=l(C);(w=y)&&w.constructor===S&&P.key==w.__key?k(w,P,E,s,!1):(T=w,e._component=w=_(S,P,s),w.nextBase=w.nextBase||g,w._parentComponent=e,k(w,P,L,s,!1),x(w,E,o,!0)),D=w.base}else N=v,(T=y)&&(N=e._component=null),(v||n===E)&&(N&&(N._component=null),D=f(N,C,s,o||!d,v&&v.parentNode,!0));if(v&&D!==v&&w!==y){var A=v.parentNode;A&&D!==A&&(A.replaceChild(D,v),T||(v._component=null,m(v,!1)))}if(T&&O(T),e.base=D,D&&!r){for(var U=e,V=e;V=V._parentComponent;)(U=V).base=D;D._component=U,D._componentConstructor=U.constructor}}if(!d||o?G.unshift(e):b||(h(),e.componentDidUpdate&&e.componentDidUpdate(p,u,c),j.afterUpdate&&j.afterUpdate(e)),null!=e._renderCallbacks)for(;e._renderCallbacks.length;)e._renderCallbacks.pop().call(e);K||r||h()}}function N(e,n,t,o){for(var r=e&&e._component,i=r,a=e,s=r&&e._componentConstructor===n.nodeName,p=s,u=l(n);r&&!p&&(r=r._parentComponent);)p=r.constructor===n.nodeName;return r&&p&&(!o||r._component)?(k(r,u,V,t,o),e=r.base):(i&&!s&&(O(i),e=a=null),r=_(n.nodeName,u,t),e&&!r.nextBase&&(r.nextBase=e,a=null),k(r,u,E,t,o),e=r.base,a&&e!==a&&(a._component=null,m(a,!1))),e}function O(e){j.beforeUnmount&&j.beforeUnmount(e);var n=e.base;e._disable=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var t=e._component;t?O(t):n&&(n[B]&&n[B].ref&&n[B].ref(null),e.nextBase=n,p(n),C(e),y(n)),e.__ref&&e.__ref(null)}function S(e,n){this._dirty=!0,this.context=n,this.props=e,this.state=this.state||{}}function T(e,n,t){return f(t,e,{},!1,n,!1)}function D(e){var n=F({},this.props.trigger);e.target.value?n[e.target.name]=e.target.value:delete n[e.target.name],this.props.onChange(this.props.index,n)}function P(e){return"service"in e?"Call Service":null}var j={},A=[],U=[],L=0,E=1,M=2,V=3,B="__preactattr_",W=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,z=[],H="function"==typeof Symbol&&"symbol"==_typeof(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof(e)},I=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},J=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),R=function(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e},F=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},$=function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+(void 0===n?"undefined":_typeof(n)));e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)},q=function(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=(void 0===n?"undefined":_typeof(n))&&"function"!=typeof n?e:n},G=[],K=0,Q=!1,X=!1,Y={};t(S.prototype,{setState:function(e,n){var r=this.state;this.prevState||(this.prevState=t({},r)),t(r,"function"==typeof e?e(r,this.props):e),n&&(this._renderCallbacks=this._renderCallbacks||[]).push(n),o(this)},forceUpdate:function(e){e&&(this._renderCallbacks=this._renderCallbacks||[]).push(e),x(this,M)},render:function(){}});var Z=function(e){function t(e){I(this,t);var n=q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state.isValid=!0,n.state.value=JSON.stringify(e.value||{},null,2),n.onChange=n.onChange.bind(n),n}return $(t,S),J(t,[{key:"onChange",value:function(e){var n=e.target.value,t=void 0,o=void 0;try{t=JSON.parse(n),o=!0}catch(e){o=!1}this.setState({value:n,isValid:o}),o&&this.props.onChange(t)}},{key:"componentWillReceiveProps",value:function(e){var n=e.value;this.setState({value:JSON.stringify(n,null,2),isValid:!0})}},{key:"render",value:function(e,t){var o=t.value,r={minWidth:300,width:"100%"};return t.isValid||(r.border="1px solid red"),n("iron-autogrow-textarea",{value:o,style:r,"onValue-Changed":this.onChange})}}]),t}(),ee={event:function(e){function t(){I(this,t);var e=q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.onChange=D.bind(e),e.eventDataChanged=e.eventDataChanged.bind(e),e}return $(t,S),J(t,[{key:"eventDataChanged",value:function(e){this.props.onChange(this.props.index,F({},this.props.trigger,{event_data:e}))}},{key:"render",value:function(e){var t=e.trigger,o=t.event_type,r=t.event_data;return n("div",null,n("paper-input",{label:"Event Type",name:"event_type",value:o,onChange:this.onChange}),"Event Data",n(Z,{value:r,onChange:this.eventDataChanged}))}}]),t}(),state:function(e){function t(){I(this,t);var e=q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.onChange=D.bind(e),e}return $(t,S),J(t,[{key:"render",value:function(e){var t=e.trigger,o=t.entity_id,r=t.to,i=t.from,a=t.for;return n("div",null,n("paper-input",{label:"Entity Id",name:"entity_id",value:o,onChange:this.onChange}),n("paper-input",{label:"From",name:"from",value:i,onChange:this.onChange}),n("paper-input",{label:"To",name:"to",value:r,onChange:this.onChange}),a&&n("pre",null,"For: ",JSON.stringify(a,null,2)))}}]),t}(),homeassistant:null,mqtt:null,numeric_state:function(e){function t(){I(this,t);var e=q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.onChange=D.bind(e),e}return $(t,S),J(t,[{key:"render",value:function(e){var t=e.trigger,o=t.value_template,r=t.entity_id,i=t.below,a=t.above;return n("div",null,n("paper-input",{label:"Entity Id",name:"entity_id",value:r,onChange:this.onChange}),n("paper-input",{label:"Above",name:"above",value:a,onChange:this.onChange}),n("paper-input",{label:"Below",name:"below",value:i,onChange:this.onChange}),"Value template (optional)",n("br",null),n("textarea",{name:"value_template",value:o,style:{width:"100%",height:100},onChange:this.onChange}))}}]),t}(),sun:null,template:null,time:null,zone:null},ne=Object.keys(ee).sort(),te=function(e){function t(){I(this,t);var e=q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.typeChanged=e.typeChanged.bind(e),e.onDelete=e.onDelete.bind(e),e}return $(t,S),J(t,[{key:"typeChanged",value:function(e){var n=e.target.selectedItem.innerHTML;n!==this.props.trigger.platform&&this.props.onChange(this.props.index,{platform:n})}},{key:"onDelete",value:function(){confirm("Sure you want to delete?")&&this.props.onChange(this.props.index,null)}},{key:"render",value:function(e){var t=e.index,o=e.trigger,r=e.onChange,i=ee[o.platform],a=ne.indexOf(o.platform),l=void 0;return l=i?n("div",null,n("paper-dropdown-menu-light",{label:"Trigger Type","no-animations":!0},n("paper-listbox",{slot:"dropdown-content",selected:a,"oniron-select":this.typeChanged},ne.map(function(e){return n("paper-item",null,e)}))),n(i,{index:t,trigger:o,onChange:r})):n("div",null,"Unsupported platform: ",o.platform,n("pre",null,JSON.stringify(o,null,2))),n("paper-card",null,n("div",{class:"card-menu"},n("paper-menu-button",{"no-animations":!0,"horizontal-align":"right","horizontal-offset":"-5","vertical-offset":"-5"},n("paper-icon-button",{icon:"mdi:dots-vertical",slot:"dropdown-trigger"}),n("paper-listbox",{slot:"dropdown-content"},n("paper-item",{disabled:!0},"Duplicate"),n("paper-item",{onTap:this.onDelete},"Delete")))),n("div",{class:"card-content"},l))}}]),t}(),oe=function(e){function t(){I(this,t);var e=q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.addTrigger=e.addTrigger.bind(e),e.triggerChanged=e.triggerChanged.bind(e),e}return $(t,S),J(t,[{key:"addTrigger",value:function(){var e=this.props.trigger.concat({platform:"event"});this.props.onChange(e)}},{key:"triggerChanged",value:function(e,n){var t=this.props.trigger.concat();null===n?t.splice(e,1):t[e]=n,this.props.onChange(t)}},{key:"render",value:function(e){var t=this;return n("div",{class:"triggers"},e.trigger.map(function(e,o){return n(te,{index:o,trigger:e,onChange:t.triggerChanged})}),n("paper-card",null,n("div",{class:"card-actions add-card"},n("paper-button",{onTap:this.addTrigger},"Add trigger"))))}}]),t}(),re={"Call Service":function(e){function t(){I(this,t);var e=q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.onChange=e.onChange.bind(e),e.serviceDataChanged=e.serviceDataChanged.bind(e),e}return $(t,S),J(t,[{key:"onChange",value:function(e){this.props.onChange(this.props.index,F({},this.props.action,R({},e.target.name,e.target.value)))}},{key:"serviceDataChanged",value:function(e){this.props.onChange(this.props.index,F({},this.props.action,{data:e}))}},{key:"render",value:function(e){var t=e.action,o=t.alias,r=t.service,i=t.data;return n("div",null,n("paper-input",{label:"Alias",name:"alias",value:o,onChange:this.onChange}),n("paper-input",{label:"Service",name:"service",value:r,onChange:this.onChange}),"Service Data",n("br",null),n(Z,{value:i,onChange:this.serviceDataChanged}))}}]),t}(),Delay:null,"Templated Delay":null,Condition:null,"Fire Event":null},ie=Object.keys(re).sort(),ae=function(e){function t(){I(this,t);var e=q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.typeChanged=e.typeChanged.bind(e),e.onDelete=e.onDelete.bind(e),e}return $(t,S),J(t,[{key:"typeChanged",value:function(e){var n=e.target.selectedItem.innerHTML;P(this.props.action)!==n&&this.props.onChange(this.props.index,{platform:n})}},{key:"onDelete",value:function(){confirm("Sure you want to delete?")&&this.props.onChange(this.props.index,null)}},{key:"render",value:function(e){var t=e.index,o=e.action,r=e.onChange,i=P(o),a=re[i],l=ie.indexOf(i),s=void 0;return s=a?n("div",null,n("paper-dropdown-menu-light",{label:"Action Type","no-animations":!0},n("paper-listbox",{slot:"dropdown-content",selected:l,"oniron-select":this.typeChanged},ie.map(function(e){return n("paper-item",null,e)}))),n(a,{index:t,action:o,onChange:r})):n("div",null,"Unsupported action",n("pre",null,JSON.stringify(o,null,2))),n("paper-card",null,n("div",{class:"card-menu"},n("paper-menu-button",{"no-animations":!0,"horizontal-align":"right","horizontal-offset":"-5","vertical-offset":"-5"},n("paper-icon-button",{icon:"mdi:dots-vertical",slot:"dropdown-trigger"}),n("paper-listbox",{slot:"dropdown-content"},n("paper-item",{disabled:!0},"Duplicate"),n("paper-item",{onTap:this.onDelete},"Delete")))),n("div",{class:"card-content"},s))}}]),t}(),le=function(e){function t(){I(this,t);var e=q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.addAction=e.addAction.bind(e),e.actionChanged=e.actionChanged.bind(e),e}return $(t,S),J(t,[{key:"addAction",value:function(){var e=this.props.script.concat({service:""});this.props.onChange(e)}},{key:"actionChanged",value:function(e,n){var t=this.props.script.concat();null===n?t.splice(e,1):t[e]=n,this.props.onChange(t)}},{key:"render",value:function(e){var t=this;return n("div",{class:"script"},e.script.map(function(e,o){return n(ae,{index:o,action:e,onChange:t.actionChanged})}),n("paper-card",null,n("div",{class:"card-actions add-card"},n("paper-button",{onTap:this.addAction},"Add action"))))}}]),t}(),se=function(e){function t(){I(this,t);var e=q(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.onChange=e.onChange.bind(e),e.triggerChanged=e.triggerChanged.bind(e),e.actionChanged=e.actionChanged.bind(e),e}return $(t,S),J(t,[{key:"onChange",value:function(e){this.props.onChange(F({},this.props.automation,R({},e.target.name,e.target.value)))}},{key:"triggerChanged",value:function(e){this.props.onChange(F({},this.props.automation,{trigger:e}))}},{key:"actionChanged",value:function(e){this.props.onChange(F({},this.props.automation,{action:e}))}},{key:"render",value:function(e){var t=e.automation,o=e.isWide,r=t.alias,i=t.trigger,a=t.condition,l=t.action;return n("div",null,n("ha-config-section",{"is-wide":o},n("span",{slot:"header"},r),n("span",{slot:"introduction"},"Use automations to bring your home alive."),n("paper-card",null,n("div",{class:"card-content"},n("paper-input",{label:"Name",name:"alias",value:r,onChange:this.onChange})))),n("ha-config-section",{"is-wide":o},n("span",{slot:"header"},"Triggers"),n("span",{slot:"introduction"},"Triggers are what starts the processing of an automation rule. It is possible to specify multiple triggers for the same rule. Once a trigger starts, Home Assistant will validate the conditions, if any, and call the action.",n("p",null,n("a",{href:"https://home-assistant.io/docs/automation/trigger/",target:"_blank"},"Learn more about triggers."))),n(oe,{trigger:i,onChange:this.triggerChanged})),a&&n("ha-config-section",{"is-wide":o},n("span",{slot:"header"},"Conditions"),n("span",{slot:"introduction"},"Conditions are an optional part of an automation rule and can be used to prevent an action from happening when triggered. Conditions look very similar to triggers but are very different. A trigger will look at events happening in the system while a condition only looks at how the system looks right now. A trigger can observe that a switch is being turned on. A condition can only see if a switch is currently on or off.",n("p",null,n("a",{href:"https://home-assistant.io/docs/scripts/conditions/",target:"_blank"},"Learn more about conditions."))),n("paper-card",null,n("div",{class:"card-content"},"Conditions are not supported yet.",n("pre",null,JSON.stringify(a,null,2))))),n("ha-config-section",{"is-wide":o},n("span",{slot:"header"},"Action"),n("span",{slot:"introduction"},"The actions are what Home Assistant will do when the automation is triggered.",n("p",null,n("a",{href:"https://home-assistant.io/docs/scripts/",target:"_blank"},"Learn more about actions."))),n(le,{script:l,onChange:this.actionChanged})))}}]),t}();window.AutomationEditor=function(e,t,o){return T(n(se,t),e,o)},window.unmountPreact=function(e,n){T(function(){return null},e,n)}}();</script><dom-module id="ha-automation-editor"><template><style include="ha-style">.errors{padding:20px;font-weight:bold;color:var(--google-red-500);}.content{padding-bottom:20px;}paper-card{display:block;}.triggers,
       .script{margin-top:-16px;}.triggers paper-card,
       .script paper-card{margin-top:16px;}.add-card paper-button{display:block;text-align:center;}.card-menu{position:absolute;top:0;right:0;z-index:1;color:var(--primary-text-color);}.card-menu paper-item{cursor:pointer;}span[slot=introduction] a{color:var(--primary-color);}paper-fab{position:fixed;bottom:16px;right:16px;z-index:1;margin-bottom:-80px;transition:margin-bottom .3s;}paper-fab[is-wide]{bottom:24px;right:24px;}paper-fab[dirty]{margin-bottom:0;}</style><app-header-layout has-scrolling-region=""><app-header slot="header" fixed=""><app-toolbar><paper-icon-button icon="mdi:arrow-left" on-tap="backTapped"></paper-icon-button><div main-title="">Automation [[name]]</div></app-toolbar></app-header><div class="content"><template is="dom-if" if="[[errors]]"><div class="errors">[[errors]]</div></template><div id="root"></div><paper-fab is-wide$="[[isWide]]" dirty$="[[dirty]]" icon="mdi:content-save" title="Save" on-tap="saveAutomation"></paper-fab></div></app-header-layout></template></dom-module><script>Polymer({is:"ha-automation-editor",properties:{hass:{type:Object},narrow:{type:Boolean},showMenu:{type:Boolean,value:!1},errors:{type:Object,value:null},dirty:{type:Boolean,value:!1},config:{type:Object,value:null},automation:{type:Object,observer:"automationChanged"},creatingNew:{type:Boolean,observer:"creatingNewChanged"},name:{type:String,computed:"computeName(automation)"},isWide:{type:Boolean,observer:"isWideChanged"}},created:function(){this.configChanged=this.configChanged.bind(this),this._rendered=null},detached:function(){this._rendered&&window.unmountPreact(this._rendered)},configChanged:function(t){null!==this._rendered&&(this.config=t,this.errors=null,this.dirty=!0,this._updateComponent(t))},automationChanged:function(t,i){t&&(this.hass?i&&i.attributes.id===t.attributes.id||this.hass.callApi("get","config/automation/config/"+t.attributes.id).then(function(t){["trigger","condition","action"].forEach(function(i){var e=t[i];e&&!Array.isArray(e)&&(t[i]=[e])}),this.dirty=!1,this.config=t,this._updateComponent()}.bind(this)):setTimeout(this.automationChanged.bind(this,t,i),0))},creatingNewChanged:function(t){t&&(this.dirty=!1,this.config={alias:"New Automation",trigger:[{platform:"state"}],action:[{service:""}]},this._updateComponent())},isWideChanged:function(){null!==this.config&&this._updateComponent()},backTapped:function(){this.dirty&&!confirm("You have unsaved changes. Are you sure you want to leave?")||(history.pushState(null,null,"/automation"),this.fire("location-changed"))},_updateComponent:function(){this._rendered=window.AutomationEditor(this.$.root,{automation:this.config,onChange:this.configChanged,isWide:this.isWide},this._rendered)},saveAutomation:function(){var t=this.creatingNew?""+Date.now():this.automation.attributes.id;this.hass.callApi("post","config/automation/config/"+t,this.config).then(function(){this.dirty=!1,this.creatingNew&&(history.pushState(null,null,"/automation/edit/"+t),this.fire("location-changed"))}.bind(this),function(t){throw this.errors=t.body.message,t}.bind(this))},computeName:function(t){return t&&window.hassUtil.computeStateName(t)}});</script></div><dom-module id="ha-panel-automation"><template><style>ha-automation-picker,
-      ha-automation-editor{height:100%;}</style><app-route route="[[route]]" pattern="/edit/:automation" data="{{_routeData}}" active="{{_edittingAddon}}"></app-route><app-route route="[[route]]" pattern="/new" active="{{_creatingNew}}"></app-route><iron-media-query query="(min-width: 1040px)" query-matches="{{wide}}"></iron-media-query><iron-media-query query="(min-width: 1296px)" query-matches="{{wideSidebar}}"></iron-media-query><template is="dom-if" if="[[!showEditor]]"><ha-automation-picker automations="[[automations]]" is-wide="[[isWide]]"></ha-automation-picker></template><template is="dom-if" if="[[showEditor]]" restamp=""><ha-automation-editor hass="[[hass]]" automation="[[automation]]" is-wide="[[isWide]]" creating-new="[[_creatingNew]]"></ha-automation-editor></template></template></dom-module><script>Polymer({is:"ha-panel-automation",properties:{hass:Object,narrow:Boolean,showMenu:Boolean,route:Object,_routeData:Object,_routeMatches:Boolean,_creatingNew:Boolean,_edittingAddon:Boolean,automations:{type:Array,computed:"computeAutomations(hass)"},automation:{type:Object,computed:"computeAutomation(automations, _edittingAddon, _routeData)"},wide:Boolean,wideSidebar:Boolean,isWide:{type:Boolean,computed:"computeIsWide(showMenu, wideSidebar, wide)"},showEditor:{type:Boolean,computed:"computeShowEditor(_edittingAddon, _creatingNew)"}},computeIsWide:function(t,o,e){return t?o:e},computeAutomation:function(t,o,e){if(!t||!o)return null;for(var a=0;a<t.length;a++)if(t[a].attributes.id===e.automation)return t[a];return null},computeAutomations:function(t){var o=[];return Object.keys(t.states).forEach(function(e){var a=t.states[e];"automation"===window.hassUtil.computeDomain(a)&&"id"in a.attributes&&o.push(a)}),o.sort(function(t,o){var e=(t.attributes.alias||t.entity_id).toLowerCase(),a=(o.attributes.alias||o.entity_id).toLowerCase();return e<a?-1:e>a?1:0})},computeShowEditor:function(t,o){return o||t}});</script></body></html>
\ No newline at end of file
+      ha-automation-editor{height:100%;}</style><app-route route="[[route]]" pattern="/edit/:automation" data="{{_routeData}}" active="{{_edittingAddon}}"></app-route><app-route route="[[route]]" pattern="/new" active="{{_creatingNew}}"></app-route><iron-media-query query="(min-width: 1040px)" query-matches="{{wide}}"></iron-media-query><iron-media-query query="(min-width: 1296px)" query-matches="{{wideSidebar}}"></iron-media-query><template is="dom-if" if="[[!showEditor]]"><ha-automation-picker narrow="[[narrow]]" show-menu="[[showMenu]]" automations="[[automations]]" is-wide="[[isWide]]"></ha-automation-picker></template><template is="dom-if" if="[[showEditor]]" restamp=""><ha-automation-editor hass="[[hass]]" automation="[[automation]]" is-wide="[[isWide]]" creating-new="[[_creatingNew]]"></ha-automation-editor></template></template></dom-module><script>Polymer({is:"ha-panel-automation",properties:{hass:Object,narrow:Boolean,showMenu:Boolean,route:Object,_routeData:Object,_routeMatches:Boolean,_creatingNew:Boolean,_edittingAddon:Boolean,automations:{type:Array,computed:"computeAutomations(hass)"},automation:{type:Object,computed:"computeAutomation(automations, _edittingAddon, _routeData)"},wide:Boolean,wideSidebar:Boolean,isWide:{type:Boolean,computed:"computeIsWide(showMenu, wideSidebar, wide)"},showEditor:{type:Boolean,computed:"computeShowEditor(_edittingAddon, _creatingNew)"}},computeIsWide:function(t,o,e){return t?o:e},computeAutomation:function(t,o,e){if(!t||!o)return null;for(var a=0;a<t.length;a++)if(t[a].attributes.id===e.automation)return t[a];return null},computeAutomations:function(t){var o=[];return Object.keys(t.states).forEach(function(e){var a=t.states[e];"automation"===window.hassUtil.computeDomain(a)&&"id"in a.attributes&&o.push(a)}),o.sort(function(t,o){var e=(t.attributes.alias||t.entity_id).toLowerCase(),a=(o.attributes.alias||o.entity_id).toLowerCase();return e<a?-1:e>a?1:0})},computeShowEditor:function(t,o){return o||t}});</script></body></html>
\ No newline at end of file
diff --git a/homeassistant/components/frontend/www_static/panels/ha-panel-automation.html.gz b/homeassistant/components/frontend/www_static/panels/ha-panel-automation.html.gz
index 42f65e6a7491dadc5d6709d38ccbcb25009d03a2..6be71ce9b340285dc95e040ecc8593cc3f67ffeb 100644
Binary files a/homeassistant/components/frontend/www_static/panels/ha-panel-automation.html.gz and b/homeassistant/components/frontend/www_static/panels/ha-panel-automation.html.gz differ
diff --git a/homeassistant/components/frontend/www_static/panels/ha-panel-config.html b/homeassistant/components/frontend/www_static/panels/ha-panel-config.html
index b1952f40ecae433cc1e09ad58e225c06cf8e7fd9..edb382e5b1dcecc87185306fce45094783478d28 100644
--- a/homeassistant/components/frontend/www_static/panels/ha-panel-config.html
+++ b/homeassistant/components/frontend/www_static/panels/ha-panel-config.html
@@ -1 +1 @@
-<html><head></head><body><div hidden="" by-polymer-bundler=""><dom-module id="ha-config-section-core" assetpath="core/"><template><style include="iron-flex ha-style">.validate-container{@apply (--layout-vertical);@apply (--layout-center-center);height:140px;}.validate-result{color:var(--google-green-500);font-weight:500;margin-bottom:1em;}.config-invalid{margin:1em 0;}.config-invalid .text{color:var(--google-red-500);font-weight:500;}.config-invalid paper-button{float:right;}.validate-log{white-space:pre-wrap;}</style><ha-config-section is-wide="[[isWide]]"><span slot="header">Server Management</span> <span slot="introduction">Changing your configuration can be a tiresome process. We know. This section will try to make your life a little bit easier.</span><paper-card heading="Configuration Validation"><div class="card-content">Validate your configuration if you recently made some changes to your configuration and want to make sure that it is all valid.<template is="dom-if" if="[[!validateLog]]"><div class="validate-container"><template is="dom-if" if="[[!validating]]"><div class="validate-result" id="result">[[validateResult]]</div><paper-button raised="" on-tap="validateConfig">check config</paper-button></template><template is="dom-if" if="[[validating]]"><paper-spinner active=""></paper-spinner></template></div></template><template is="dom-if" if="[[validateLog]]"><div class="config-invalid"><span class="text">Configuration invalid.</span><paper-button raised="" on-tap="validateConfig">check config</paper-button></div><div id="configLog" class="validate-log">[[validateLog]]</div></template></div></paper-card><paper-card heading="Configuration Reloading"><div class="card-content">Some parts of Home Assistant can reload without requiring a restart. Hitting reload will unload their current configuration and load the new one.</div><div class="card-actions"><ha-call-service-button hass="[[hass]]" domain="homeassistant" service="reload_core_config">Reload Core</ha-call-service-button><ha-call-service-button hass="[[hass]]" domain="group" service="reload" hidden$="[[!groupLoaded(hass)]]">Reload Groups</ha-call-service-button><ha-call-service-button hass="[[hass]]" domain="automation" service="reload" hidden$="[[!automationLoaded(hass)]]">Reload Automation</ha-call-service-button><ha-call-service-button hass="[[hass]]" domain="script" service="reload" hidden$="[[!scriptLoaded(hass)]]">Reload Scripts</ha-call-service-button></div></paper-card><paper-card heading="Server Management"><div class="card-content">Control your Home Assistant server… from Home Assistant.</div><div class="card-actions warning"><ha-call-service-button class="warning" hass="[[hass]]" domain="homeassistant" service="restart">Restart</ha-call-service-button><ha-call-service-button class="warning" hass="[[hass]]" domain="homeassistant" service="stop">Stop</ha-call-service-button></div></paper-card></ha-config-section></template></dom-module><script>Polymer({is:"ha-config-section-core",properties:{hass:{type:Object},isWide:{type:Boolean,value:!1},validating:{type:Boolean,value:!1},validateResult:{type:String,value:""},validateLog:{type:String,value:""}},groupLoaded:function(i){return window.hassUtil.isComponentLoaded(i,"group")},automationLoaded:function(i){return window.hassUtil.isComponentLoaded(i,"automation")},scriptLoaded:function(i){return window.hassUtil.isComponentLoaded(i,"script")},validateConfig:function(){this.validating=!0,this.validateLog="",this.validateResult="";var i=this;this.hass.callApi("POST","config/core/check_config").then(function(t){i.validating=!1,(i.configValid="valid"===t.result)?i.validateResult="Valid!":i.validateLog=t.errors})}});</script><dom-module id="ha-entity-config"><template><style include="iron-flex ha-style">paper-card{display:block;}.device-picker{@apply (--layout-horizontal);padding-bottom:24px;}.form-placeholder{@apply (--layout-vertical);@apply (--layout-center-center);height:96px;}[hidden]:{display:none;};.card-actions{@apply (--layout-horizontal);@apply (--layout-justified);}</style><paper-card><div class="card-content"><div class="device-picker"><paper-dropdown-menu label="[[label]]" class="flex" disabled="[[!entities.length]]"><paper-listbox slot="dropdown-content" selected="{{selectedEntity}}"><template is="dom-repeat" items="[[entities]]" as="state"><paper-item>[[computeSelectCaption(state)]]</paper-item></template></paper-listbox></paper-dropdown-menu></div><div class="form-container"><template is="dom-if" if="[[computeShowPlaceholder(formState)]]"><div class="form-placeholder"><template is="dom-if" if="[[computeShowNoDevices(formState)]]">No entities found! :-(</template><template is="dom-if" if="[[computeShowSpinner(formState)]]"><paper-spinner active="" alt="[[formState]]"></paper-spinner>[[formState]]</template></div></template><div hidden$="[[!computeShowForm(formState)]]" id="form"></div></div></div><div class="card-actions"><paper-button on-tap="saveEntity" disabled="[[computeShowPlaceholder(formState)]]">SAVE</paper-button><template is="dom-if" if="[[allowDelete]]"><paper-button class="warning" on-tap="deleteEntity" disabled="[[computeShowPlaceholder(formState)]]">DELETE</paper-button></template></div></paper-card></template></dom-module><script>Polymer({is:"ha-entity-config",properties:{hass:{type:Object,observer:"hassChanged"},label:{type:String,value:"Device"},entities:{type:Array,observer:"entitiesChanged"},allowDelete:{type:Boolean,value:!1},selectedEntity:{type:Number,value:-1,observer:"entityChanged"},formState:{type:String,value:"no-devices"},config:{type:Object}},attached:function(){this.formEl=document.createElement(this.config.component),this.formEl.hass=this.hass,this.$.form.appendChild(this.formEl),this.entityChanged(this.selectedEntity)},computeSelectCaption:function(t){return this.config.computeSelectCaption?this.config.computeSelectCaption(t):window.hassUtil.computeStateName(t)},computeShowNoDevices:function(t){return"no-devices"===t},computeShowSpinner:function(t){return"loading"===t||"saving"===t},computeShowPlaceholder:function(t){return"editing"!==t},computeShowForm:function(t){return"editing"===t},hassChanged:function(t){this.formEl&&(this.formEl.hass=t)},entitiesChanged:function(t,e){if(0!==t.length)if(e){var i=e[this.selectedEntity].entity_id,n=t.findIndex(function(t){return t.entity_id===i});-1===n?this.selectedEntity=0:n!==this.selectedEntity&&(this.selectedEntity=n)}else this.selectedEntity=0;else this.formState="no-devices"},entityChanged:function(t){if(this.entities&&this.formEl){var e=this.entities[t];this.formState="loading";var i=this;this.formEl.loadEntity(e).then(function(){i.formState="editing"})}},saveEntity:function(){this.formState="saving";var t=this;this.formEl.saveEntity().then(function(){t.formState="editing"})}});</script><dom-module id="paper-radio-button" assetpath="../../bower_components/paper-radio-button/"><template strip-whitespace=""><style>:host{display:inline-block;line-height:0;white-space:nowrap;cursor:pointer;@apply --paper-font-common-base;--calculated-paper-radio-button-size:var(--paper-radio-button-size, 16px);--calculated-paper-radio-button-ink-size:var(--paper-radio-button-ink-size, -1px);}:host(:focus){outline:none;}#radioContainer{@apply --layout-inline;@apply --layout-center-center;position:relative;width:var(--calculated-paper-radio-button-size);height:var(--calculated-paper-radio-button-size);vertical-align:middle;@apply --paper-radio-button-radio-container;}#ink{position:absolute;top:50%;left:50%;right:auto;width:var(--calculated-paper-radio-button-ink-size);height:var(--calculated-paper-radio-button-ink-size);color:var(--paper-radio-button-unchecked-ink-color, var(--primary-text-color));opacity:0.6;pointer-events:none;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);}#ink[checked]{color:var(--paper-radio-button-checked-ink-color, var(--primary-color));}#offRadio, #onRadio{position:absolute;box-sizing:border-box;top:0;left:0;width:100%;height:100%;border-radius:50%;}#offRadio{border:2px solid var(--paper-radio-button-unchecked-color, var(--primary-text-color));background-color:var(--paper-radio-button-unchecked-background-color, transparent);transition:border-color 0.28s;}#onRadio{background-color:var(--paper-radio-button-checked-color, var(--primary-color));-webkit-transform:scale(0);transform:scale(0);transition:-webkit-transform ease 0.28s;transition:transform ease 0.28s;will-change:transform;}:host([checked]) #offRadio{border-color:var(--paper-radio-button-checked-color, var(--primary-color));}:host([checked]) #onRadio{-webkit-transform:scale(0.5);transform:scale(0.5);}#radioLabel{line-height:normal;position:relative;display:inline-block;vertical-align:middle;margin-left:var(--paper-radio-button-label-spacing, 10px);white-space:normal;color:var(--paper-radio-button-label-color, var(--primary-text-color));@apply --paper-radio-button-label;}:host([checked]) #radioLabel{@apply --paper-radio-button-label-checked;}:host-context([dir="rtl"]) #radioLabel{margin-left:0;margin-right:var(--paper-radio-button-label-spacing, 10px);}#radioLabel[hidden]{display:none;}:host([disabled]) #offRadio{border-color:var(--paper-radio-button-unchecked-color, var(--primary-text-color));opacity:0.5;}:host([disabled][checked]) #onRadio{background-color:var(--paper-radio-button-unchecked-color, var(--primary-text-color));opacity:0.5;}:host([disabled]) #radioLabel{opacity:0.65;}</style><div id="radioContainer"><div id="offRadio"></div><div id="onRadio"></div></div><div id="radioLabel"><slot></slot></div></template><script>Polymer({is:"paper-radio-button",behaviors:[Polymer.PaperCheckedElementBehavior],hostAttributes:{role:"radio","aria-checked":!1,tabindex:0},properties:{ariaActiveAttribute:{type:String,value:"aria-checked"}},ready:function(){this._rippleContainer=this.$.radioContainer},attached:function(){Polymer.RenderStatus.afterNextRender(this,function(){if("-1px"===this.getComputedStyleValue("--calculated-paper-radio-button-ink-size").trim()){var e=parseFloat(this.getComputedStyleValue("--calculated-paper-radio-button-size").trim()),t=Math.floor(3*e);t%2!=e%2&&t++,this.updateStyles({"--paper-radio-button-ink-size":t+"px"})}})}});</script></dom-module><dom-module id="paper-radio-group" assetpath="../../bower_components/paper-radio-group/"><template><style>:host{display:inline-block;}:host ::slotted(*){padding:var(--paper-radio-group-item-padding, 12px);}</style><slot></slot></template></dom-module><script>Polymer({is:"paper-radio-group",behaviors:[Polymer.IronMenubarBehavior],hostAttributes:{role:"radiogroup",tabindex:0},properties:{attrForSelected:{type:String,value:"name"},selectedAttribute:{type:String,value:"checked"},selectable:{type:String,value:"paper-radio-button"},allowEmptySelection:{type:Boolean,value:!1}},select:function(e){var t=this._valueToItem(e);if(!t||!t.hasAttribute("disabled")){if(this.selected){var i=this._valueToItem(this.selected);if(this.selected==e){if(!this.allowEmptySelection)return void(i&&(i.checked=!0));e=""}i&&(i.checked=!1)}Polymer.IronSelectableBehavior.select.apply(this,[e]),this.fire("paper-radio-group-changed")}},_activateFocusedItem:function(){this._itemActivate(this._valueForItem(this.focusedItem),this.focusedItem)},_onUpKey:function(e){this._focusPrevious(),e.preventDefault(),this._activateFocusedItem()},_onDownKey:function(e){this._focusNext(),e.preventDefault(),this._activateFocusedItem()},_onLeftKey:function(e){Polymer.IronMenubarBehaviorImpl._onLeftKey.apply(this,arguments),this._activateFocusedItem()},_onRightKey:function(e){Polymer.IronMenubarBehaviorImpl._onRightKey.apply(this,arguments),this._activateFocusedItem()}});</script><script>!function(t){"use strict";"function"==typeof define&&define.amd?define(t):"undefined"!=typeof module&&void 0!==module.exports?module.exports=t():window.Sortable=t()}(function(){"use strict";function t(t,e){var n=this;if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be HTMLElement, and not "+{}.toString.call(t);this.el=t,this.options=e=_({},e),t[V]=this;var i={group:Math.random(),sort:!0,disabled:!1,store:null,handle:null,scroll:!0,scrollSensitivity:30,scrollSpeed:10,draggable:/[uo]l/i.test(t.nodeName)?"li":">*",ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0}};for(var o in i)!(o in e)&&(e[o]=i[o]);at(e);for(var a in this)"_"===a.charAt(0)&&"function"==typeof n[a]&&(n[a]=n[a].bind(n));this.nativeDraggable=!e.forceFallback&&K,r(t,"mousedown",this._onTapStart),r(t,"touchstart",this._onTapStart),r(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(r(t,"dragover",this),r(t,"dragenter",this)),ot.push(this._onDragOver),e.store&&this.sort(e.store.get(this))}function e(t,e){"clone"!==t.lastPullMode&&(e=!0),S&&S.state!==e&&(l(S,"display",e?"none":""),e||S.state&&(t.options.group.revertClone?(E.insertBefore(S,x),t._animate(w,S)):E.insertBefore(S,w)),S.state=e)}function n(t,e,n){if(t){n=n||z;do{if(">*"===e&&t.parentNode===n||m(t,e))return t}while(t=i(t))}return null}function i(t){var e=t.host;return e&&e.nodeType?e:t.parentNode}function o(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.preventDefault()}function r(t,e,n){t.addEventListener(e,n,J)}function a(t,e,n){t.removeEventListener(e,n,J)}function s(t,e,n){if(t)if(t.classList)t.classList[n?"add":"remove"](e);else{var i=(" "+t.className+" ").replace(H," ").replace(" "+e+" "," ");t.className=(i+(n?" "+e:"")).replace(H," ")}}function l(t,e,n){var i=t&&t.style;if(i){if(void 0===n)return z.defaultView&&z.defaultView.getComputedStyle?n=z.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in i||(e="-webkit-"+e),i[e]=n+("string"==typeof n?"":"px")}}function c(t,e,n){if(t){var i=t.getElementsByTagName(e),o=0,r=i.length;if(n)for(;o<r;o++)n(i[o],o);return i}return[]}function d(t,e,n,i,o,r,a){t=t||e[V];var s=z.createEvent("Event"),l=t.options,c="on"+n.charAt(0).toUpperCase()+n.substr(1);s.initEvent(n,!0,!0),s.to=e,s.from=o||e,s.item=i||e,s.clone=S,s.oldIndex=r,s.newIndex=a,e.dispatchEvent(s),l[c]&&l[c].call(t,s)}function h(t,e,n,i,o,r,a,s){var l,c,d=t[V],h=d.options.onMove;return(l=z.createEvent("Event")).initEvent("move",!0,!0),l.to=e,l.from=t,l.dragged=n,l.draggedRect=i,l.related=o||e,l.relatedRect=r||e.getBoundingClientRect(),l.willInsertAfter=s,t.dispatchEvent(l),h&&(c=h.call(d,l,a)),c}function u(t){t.draggable=!1}function f(){tt=!1}function p(t,e){var n=t.lastElementChild.getBoundingClientRect();return e.clientY-(n.top+n.height)>5||e.clientX-(n.left+n.width)>5}function g(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,i=0;n--;)i+=e.charCodeAt(n);return i.toString(36)}function v(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t&&(t=t.previousElementSibling);)"TEMPLATE"===t.nodeName.toUpperCase()||">*"!==e&&!m(t,e)||n++;return n}function m(t,e){if(t){var n=(e=e.split(".")).shift().toUpperCase(),i=new RegExp("\\s("+e.join("|")+")(?=\\s)","g");return!(""!==n&&t.nodeName.toUpperCase()!=n||e.length&&((" "+t.className+" ").match(i)||[]).length!=e.length)}return!1}function b(t,e){var n,i;return function(){void 0===n&&(n=arguments,i=this,setTimeout(function(){1===n.length?t.call(i,n[0]):t.apply(i,n),n=void 0},e))}}function _(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function D(t){return Q?Q(t).clone(!0)[0]:Z&&Z.dom?Z.dom(t).cloneNode(!0):t.cloneNode(!0)}function y(t){for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var i=e[n];i.checked&&it.push(i)}}if("undefined"==typeof window||!window.document)return function(){throw new Error("Sortable.js requires a window with a document")};var w,T,C,S,E,x,N,k,B,Y,O,X,A,M,P,R,I,L,F,U,j={},H=/\s+/g,W=/left|right|inline/,V="Sortable"+(new Date).getTime(),q=window,z=q.document,G=q.parseInt,Q=q.jQuery||q.Zepto,Z=q.Polymer,J=!1,K=!!("draggable"in z.createElement("div")),$=function(t){return!navigator.userAgent.match(/Trident.*rv[ :]?11\./)&&(t=z.createElement("x"),t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents)}(),tt=!1,et=Math.abs,nt=Math.min,it=[],ot=[],rt=b(function(t,e,n){if(n&&e.scroll){var i,o,r,a,s,l,c=n[V],d=e.scrollSensitivity,h=e.scrollSpeed,u=t.clientX,f=t.clientY,p=window.innerWidth,g=window.innerHeight;if(B!==n&&(k=e.scroll,B=n,Y=e.scrollFn,!0===k)){k=n;do{if(k.offsetWidth<k.scrollWidth||k.offsetHeight<k.scrollHeight)break}while(k=k.parentNode)}k&&(i=k,o=k.getBoundingClientRect(),r=(et(o.right-u)<=d)-(et(o.left-u)<=d),a=(et(o.bottom-f)<=d)-(et(o.top-f)<=d)),r||a||(a=(g-f<=d)-(f<=d),((r=(p-u<=d)-(u<=d))||a)&&(i=q)),j.vx===r&&j.vy===a&&j.el===i||(j.el=i,j.vx=r,j.vy=a,clearInterval(j.pid),i&&(j.pid=setInterval(function(){if(l=a?a*h:0,s=r?r*h:0,"function"==typeof Y)return Y.call(c,s,l,t);i===q?q.scrollTo(q.pageXOffset+s,q.pageYOffset+l):(i.scrollTop+=l,i.scrollLeft+=s)},24)))}},30),at=function(t){function e(t,e){return void 0!==t&&!0!==t||(t=n.name),"function"==typeof t?t:function(n,i){var o=i.options.group.name;return e?t:t&&(t.join?t.indexOf(o)>-1:o==t)}}var n={},i=t.group;i&&"object"==typeof i||(i={name:i}),n.name=i.name,n.checkPull=e(i.pull,!0),n.checkPut=e(i.put),n.revertClone=i.revertClone,t.group=n};t.prototype={constructor:t,_onTapStart:function(t){var e,i=this,o=this.el,r=this.options,a=r.preventOnFilter,s=t.type,l=t.touches&&t.touches[0],c=(l||t).target,h=t.target.shadowRoot&&t.path[0]||c,u=r.filter;if(y(o),!w&&!("mousedown"===s&&0!==t.button||r.disabled)&&(c=n(c,r.draggable,o))&&N!==c){if(e=v(c,r.draggable),"function"==typeof u){if(u.call(this,t,c,this))return d(i,h,"filter",c,o,e),void(a&&t.preventDefault())}else if(u&&(u=u.split(",").some(function(t){if(t=n(h,t.trim(),o))return d(i,t,"filter",c,o,e),!0})))return void(a&&t.preventDefault());r.handle&&!n(h,r.handle,o)||this._prepareDragStart(t,l,c,e)}},_prepareDragStart:function(t,e,n,i){var o,a=this,l=a.el,h=a.options,f=l.ownerDocument;n&&!w&&n.parentNode===l&&(L=t,E=l,T=(w=n).parentNode,x=w.nextSibling,N=n,R=h.group,M=i,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,w.style["will-change"]="transform",o=function(){a._disableDelayedDrag(),w.draggable=a.nativeDraggable,s(w,h.chosenClass,!0),a._triggerDragStart(t,e),d(a,E,"choose",w,E,M)},h.ignore.split(",").forEach(function(t){c(w,t.trim(),u)}),r(f,"mouseup",a._onDrop),r(f,"touchend",a._onDrop),r(f,"touchcancel",a._onDrop),r(f,"pointercancel",a._onDrop),r(f,"selectstart",a),h.delay?(r(f,"mouseup",a._disableDelayedDrag),r(f,"touchend",a._disableDelayedDrag),r(f,"touchcancel",a._disableDelayedDrag),r(f,"mousemove",a._disableDelayedDrag),r(f,"touchmove",a._disableDelayedDrag),r(f,"pointermove",a._disableDelayedDrag),a._dragStartTimer=setTimeout(o,h.delay)):o())},_disableDelayedDrag:function(){var t=this.el.ownerDocument;clearTimeout(this._dragStartTimer),a(t,"mouseup",this._disableDelayedDrag),a(t,"touchend",this._disableDelayedDrag),a(t,"touchcancel",this._disableDelayedDrag),a(t,"mousemove",this._disableDelayedDrag),a(t,"touchmove",this._disableDelayedDrag),a(t,"pointermove",this._disableDelayedDrag)},_triggerDragStart:function(t,e){(e=e||("touch"==t.pointerType?t:null))?(L={target:w,clientX:e.clientX,clientY:e.clientY},this._onDragStart(L,"touch")):this.nativeDraggable?(r(w,"dragend",this),r(E,"dragstart",this._onDragStart)):this._onDragStart(L,!0);try{z.selection?setTimeout(function(){z.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(){if(E&&w){var e=this.options;s(w,e.ghostClass,!0),s(w,e.dragClass,!1),t.active=this,d(this,E,"start",w,E,M)}else this._nulling()},_emulateDragOver:function(){if(F){if(this._lastX===F.clientX&&this._lastY===F.clientY)return;this._lastX=F.clientX,this._lastY=F.clientY,$||l(C,"display","none");var t=z.elementFromPoint(F.clientX,F.clientY),e=t,n=ot.length;if(e)do{if(e[V]){for(;n--;)ot[n]({clientX:F.clientX,clientY:F.clientY,target:t,rootEl:e});break}t=e}while(e=e.parentNode);$||l(C,"display","")}},_onTouchMove:function(e){if(L){var n=this.options,i=n.fallbackTolerance,o=n.fallbackOffset,r=e.touches?e.touches[0]:e,a=r.clientX-L.clientX+o.x,s=r.clientY-L.clientY+o.y,c=e.touches?"translate3d("+a+"px,"+s+"px,0)":"translate("+a+"px,"+s+"px)";if(!t.active){if(i&&nt(et(r.clientX-this._lastX),et(r.clientY-this._lastY))<i)return;this._dragStarted()}this._appendGhost(),U=!0,F=r,l(C,"webkitTransform",c),l(C,"mozTransform",c),l(C,"msTransform",c),l(C,"transform",c),e.preventDefault()}},_appendGhost:function(){if(!C){var t,e=w.getBoundingClientRect(),n=l(w),i=this.options;s(C=w.cloneNode(!0),i.ghostClass,!1),s(C,i.fallbackClass,!0),s(C,i.dragClass,!0),l(C,"top",e.top-G(n.marginTop,10)),l(C,"left",e.left-G(n.marginLeft,10)),l(C,"width",e.width),l(C,"height",e.height),l(C,"opacity","0.8"),l(C,"position","fixed"),l(C,"zIndex","100000"),l(C,"pointerEvents","none"),i.fallbackOnBody&&z.body.appendChild(C)||E.appendChild(C),t=C.getBoundingClientRect(),l(C,"width",2*e.width-t.width),l(C,"height",2*e.height-t.height)}},_onDragStart:function(t,e){var n=t.dataTransfer,i=this.options;this._offUpEvents(),R.checkPull(this,this,w,t)&&((S=D(w)).draggable=!1,S.style["will-change"]="",l(S,"display","none"),s(S,this.options.chosenClass,!1),E.insertBefore(S,w),d(this,E,"clone",w)),s(w,i.dragClass,!0),e?("touch"===e?(r(z,"touchmove",this._onTouchMove),r(z,"touchend",this._onDrop),r(z,"touchcancel",this._onDrop),r(z,"pointermove",this._onTouchMove),r(z,"pointerup",this._onDrop)):(r(z,"mousemove",this._onTouchMove),r(z,"mouseup",this._onDrop)),this._loopId=setInterval(this._emulateDragOver,50)):(n&&(n.effectAllowed="move",i.setData&&i.setData.call(this,n,w)),r(z,"drop",this),setTimeout(this._dragStarted,0))},_onDragOver:function(i){var o,r,a,s,c=this.el,d=this.options,u=d.group,g=t.active,v=R===u,m=!1,b=d.sort;if(void 0!==i.preventDefault&&(i.preventDefault(),!d.dragoverBubble&&i.stopPropagation()),!w.animated&&(U=!0,g&&!d.disabled&&(v?b||(s=!E.contains(w)):I===this||(g.lastPullMode=R.checkPull(this,g,w,i))&&u.checkPut(this,g,w,i))&&(void 0===i.rootEl||i.rootEl===this.el))){if(rt(i,d,this.el),tt)return;if(o=n(i.target,d.draggable,c),r=w.getBoundingClientRect(),I!==this&&(I=this,m=!0),s)return e(g,!0),T=E,void(S||x?E.insertBefore(w,S||x):b||E.appendChild(w));if(0===c.children.length||c.children[0]===C||c===i.target&&p(c,i)){if(0!==c.children.length&&c.children[0]!==C&&c===i.target&&(o=c.lastElementChild),o){if(o.animated)return;a=o.getBoundingClientRect()}e(g,v),!1!==h(E,c,w,r,o,a,i)&&(w.contains(c)||(c.appendChild(w),T=c),this._animate(r,w),o&&this._animate(a,o))}else if(o&&!o.animated&&o!==w&&void 0!==o.parentNode[V]){O!==o&&(O=o,X=l(o),A=l(o.parentNode));var _=(a=o.getBoundingClientRect()).right-a.left,D=a.bottom-a.top,y=W.test(X.cssFloat+X.display)||"flex"==A.display&&0===A["flex-direction"].indexOf("row"),N=o.offsetWidth>w.offsetWidth,k=o.offsetHeight>w.offsetHeight,B=(y?(i.clientX-a.left)/_:(i.clientY-a.top)/D)>.5,Y=o.nextElementSibling,M=!1;if(y){var P=w.offsetTop,L=o.offsetTop;M=P===L?o.previousElementSibling===w&&!N||B&&N:o.previousElementSibling===w||w.previousElementSibling===o?(i.clientY-a.top)/D>.5:L>P}else m||(M=Y!==w&&!k||B&&k);var F=h(E,c,w,r,o,a,i,M);!1!==F&&(1!==F&&-1!==F||(M=1===F),tt=!0,setTimeout(f,30),e(g,v),w.contains(c)||(M&&!Y?c.appendChild(w):o.parentNode.insertBefore(w,M?Y:o)),T=w.parentNode,this._animate(r,w),this._animate(a,o))}}},_animate:function(t,e){var n=this.options.animation;if(n){var i=e.getBoundingClientRect();1===t.nodeType&&(t=t.getBoundingClientRect()),l(e,"transition","none"),l(e,"transform","translate3d("+(t.left-i.left)+"px,"+(t.top-i.top)+"px,0)"),e.offsetWidth,l(e,"transition","all "+n+"ms"),l(e,"transform","translate3d(0,0,0)"),clearTimeout(e.animated),e.animated=setTimeout(function(){l(e,"transition",""),l(e,"transform",""),e.animated=!1},n)}},_offUpEvents:function(){var t=this.el.ownerDocument;a(z,"touchmove",this._onTouchMove),a(z,"pointermove",this._onTouchMove),a(t,"mouseup",this._onDrop),a(t,"touchend",this._onDrop),a(t,"pointerup",this._onDrop),a(t,"touchcancel",this._onDrop),a(t,"pointercancel",this._onDrop),a(t,"selectstart",this)},_onDrop:function(e){var n=this.el,i=this.options;clearInterval(this._loopId),clearInterval(j.pid),clearTimeout(this._dragStartTimer),a(z,"mousemove",this._onTouchMove),this.nativeDraggable&&(a(z,"drop",this),a(n,"dragstart",this._onDragStart)),this._offUpEvents(),e&&(U&&(e.preventDefault(),!i.dropBubble&&e.stopPropagation()),C&&C.parentNode&&C.parentNode.removeChild(C),E!==T&&"clone"===t.active.lastPullMode||S&&S.parentNode&&S.parentNode.removeChild(S),w&&(this.nativeDraggable&&a(w,"dragend",this),u(w),w.style["will-change"]="",s(w,this.options.ghostClass,!1),s(w,this.options.chosenClass,!1),d(this,E,"unchoose",w,E,M),E!==T?(P=v(w,i.draggable))>=0&&(d(null,T,"add",w,E,M,P),d(this,E,"remove",w,E,M,P),d(null,T,"sort",w,E,M,P),d(this,E,"sort",w,E,M,P)):w.nextSibling!==x&&(P=v(w,i.draggable))>=0&&(d(this,E,"update",w,E,M,P),d(this,E,"sort",w,E,M,P)),t.active&&(null!=P&&-1!==P||(P=M),d(this,E,"end",w,E,M,P),this.save()))),this._nulling()},_nulling:function(){E=w=T=C=x=S=N=k=B=L=F=U=P=O=X=I=R=t.active=null,it.forEach(function(t){t.checked=!0}),it.length=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragover":case"dragenter":w&&(this._onDragOver(t),o(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=this,i=[],o=this.el.children,r=0,a=o.length,s=this.options;r<a;r++)n(t=o[r],s.draggable,e.el)&&i.push(t.getAttribute(s.dataIdAttr)||g(t));return i},sort:function(t){var e={},i=this.el;this.toArray().forEach(function(t,o){var r=i.children[o];n(r,this.options.draggable,i)&&(e[t]=r)},this),t.forEach(function(t){e[t]&&(i.removeChild(e[t]),i.appendChild(e[t]))})},save:function(){var t=this.options.store;t&&t.set(this)},closest:function(t,e){return n(t,e||this.options.draggable,this.el)},option:function(t,e){var n=this.options;if(void 0===e)return n[t];n[t]=e,"group"===t&&at(n)},destroy:function(){var t=this.el;t[V]=null,a(t,"mousedown",this._onTapStart),a(t,"touchstart",this._onTapStart),a(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(a(t,"dragover",this),a(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),ot.splice(ot.indexOf(this._onDragOver),1),this._onDrop(),this.el=t=null}},r(z,"touchmove",function(e){t.active&&e.preventDefault()});try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){J={capture:!1,passive:!1}}}))}catch(t){}return t.utils={on:r,off:a,css:l,find:c,is:function(t,e){return!!n(t,e,t)},extend:_,throttle:b,closest:n,toggleClass:s,clone:D,index:v},t.create=function(e,n){return new t(e,n)},t.version="1.6.0",t});</script><dom-module id="sortable-js" assetpath="../../bower_components/polymer-sortablejs/"><template><content></content></template></dom-module><script>"use strict";Polymer({is:"sortable-js",properties:{group:{type:String,value:function(){return Math.random()},observer:"groupChanged"},sort:{type:Boolean,value:!0,observer:"sortChanged"},disabled:{type:Boolean,value:!1,observer:"disabledChanged"},store:{type:Object,value:null,observer:"storeChanged"},handle:{type:String,value:null,observer:"handleChanged"},scrollSensitivity:{type:Number,value:30,observer:"scrollSensitivityChanged"},scrollSpeed:{type:Number,value:10,observer:"scrollSpeedChanged"},ghostClass:{type:String,value:"sortable-ghost",observer:"ghostClassChanged"},chosenClass:{type:String,value:"sortable-chosen",observer:"chosenClassChanged"},ignore:{type:String,value:"a, img",observer:"ignoreChanged"},filter:{type:Object,value:null,observer:"filterChanged"},animation:{type:Number,value:0,observer:"animationChanged"},dropBubble:{type:Boolean,value:!1,observer:"dropBubbleChanged"},dragoverBubble:{type:Boolean,value:!1,observer:"dragoverBubbleChanged"},dataIdAttr:{type:String,value:"data-id",observer:"dataIdAttrChanged"},delay:{type:Number,value:0,observer:"delayChanged"},forceFallback:{type:Boolean,value:!1,observer:"forceFallbackChanged"},fallbackClass:{type:String,value:"sortable-fallback",observer:"fallbackClassChanged"},fallbackOnBody:{type:Boolean,value:!1,observer:"fallbackOnBodyChanged"},draggable:{},scroll:{}},created:function(){Object.defineProperties(this,{draggable:{get:function(){return this._draggable||this.getAttribute("draggable")||">*"},set:function(e){this._draggable=e,this.draggableChanged(e)}},scroll:{get:function(){return this._scroll||JSON.parse(this.getAttribute("scroll")||"true")},set:function(e){this._scroll=e,this.scrollChanged(e)}}})},attached:function(){this.initialize()},detached:function(){this.destroy()},initialize:function(){var e=this.querySelectorAll("template[is='dom-repeat']"),t=e[e.length-1],o={};Object.keys(this.properties).forEach(function(e){o[e]=this[e]}.bind(this));var a=this,s={onUpdate:function(e){t&&t.splice("items",e.newIndex,0,t.splice("items",e.oldIndex,1)[0]),a.fire("update",e)},onAdd:function(e){if(t){var o=e.from.querySelectorAll("template[is='dom-repeat']"),s=o[o.length-1].items[e.oldIndex];t.splice("items",e.newIndex,0,s)}a.fire("add",e)},onRemove:function(e){t&&t.splice("items",e.oldIndex,1)[0],a.fire("remove",e)},onChoose:function(e){a.fire("choose",e)},onStart:function(e){a.fire("start",e)},onEnd:function(e){a.fire("end",e)},onSort:function(e){a.fire("sort",e)},onFilter:function(e){a.fire("filter",e)},onMove:function(e){a.fire("move",e)},onClone:function(e){a.fire("clone",e)}};Object.keys(s).forEach(function(e){o[e]=s[e]}),this.sortable=Sortable.create(this,o)},destroy:function(){this.sortable&&this.sortable.destroy()},groupChanged:function(e){this.sortable&&this.sortable.option("group",e)},sortChanged:function(e){this.sortable&&this.sortable.option("sort",e)},disabledChanged:function(e){this.sortable&&this.sortable.option("disabled",e)},storeChanged:function(e){this.sortable&&this.sortable.option("store",e)},handleChanged:function(e){this.sortable&&this.sortable.option("handle",e)},scrollChanged:function(e){this.sortable&&this.sortable.option("scroll",e)},scrollSensitivityChanged:function(e){this.sortable&&this.sortable.option("scrollSensitivity",e)},scrollSpeedChanged:function(e){this.sortable&&this.sortable.option("scrollSpeed",e)},draggableChanged:function(e){this.sortable&&this.sortable.option("draggable",e)},ghostClassChanged:function(e){this.sortable&&this.sortable.option("ghostClass",e)},chosenClassChanged:function(e){this.sortable&&this.sortable.option("chosenClass",e)},ignoreChanged:function(e){this.sortable&&this.sortable.option("ignore",e)},filterChanged:function(e){this.sortable&&this.sortable.option("filter",e)},animationChanged:function(e){this.sortable&&this.sortable.option("animation",e)},dropBubbleChanged:function(e){this.sortable&&this.sortable.option("dropBubble",e)},dragoverBubbleChanged:function(e){this.sortable&&this.sortable.option("dragoverBubble",e)},dataIdAttrChanged:function(e){this.sortable&&this.sortable.option("dataIdAttr",e)},delayChanged:function(e){this.sortable&&this.sortable.option("delay",e)},forceFallbackChanged:function(e){this.sortable&&this.sortable.option("forceFallback",e)},fallbackClassChanged:function(e){this.sortable&&this.sortable.option("fallbackClass",e)},fallbackOnBodyChanged:function(e){this.sortable&&this.sortable.option("fallbackOnBody",e)}});</script><dom-module id="ha-form-style"><template><style>.form-group{@apply (--layout-horizontal);@apply (--layout-center);padding:8px 16px;}.form-group label{@apply (--layout-flex-2);}.form-group .form-control{@apply (--layout-flex-1);}.form-group.vertical{@apply (--layout-vertical);@apply (--layout-start);}paper-dropdown-menu.form-control{margin:-9px 0;}</style></template></dom-module><dom-module id="ha-form-group" assetpath="group/"><template><style include="iron-flex ha-style ha-form-style">.entities-header{@apply (--layout-horizontal);@apply (--layout-justified);@apply (--layout-center);width:100%;}.drag-handle{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab;}.sortable-chosen .drag-handle, .sortable-ghost{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing;}sortable-js{width:100%;}.entity-row{@apply (--layout-horizontal);@apply (--layout-center);padding:4px 0;border-top:1px solid rgba(0, 0, 0, .12);}.entity-row:first-child{border-top:1px solid rgba(0, 0, 0, 0);}.entity-row.sortable-chosen{background-color:var(--paper-grey-200);border-top:1px solid rgba(0, 0, 0, 0);}.entity-row .unknown{padding-left:56px;}.entity-row paper-icon-button{visibility:hidden;}.entity-row:not(.sortable-chosen):hover paper-icon-button{visibility:visible;}</style><div class="form-group"><paper-input class="form-control flex" label="Name" value="{{entityName}}"></paper-input></div><div class="form-group"><label>Type</label><paper-radio-group selected="{{entityType}}" class="form-control"><paper-radio-button name="group">Group</paper-radio-button><paper-radio-button name="view">View</paper-radio-button></paper-radio-group></div><div class="form-group vertical entities"><div class="entities-header"><label>Entities (drag to reorder):</label></div><sortable-js class="form-control" on-choose="handleRowChosen" handle=".drag-handle"><template is="dom-repeat" items="{{entityChildren}}"><div class="entity-row"><iron-icon icon="mdi:drag-vertical" class="drag-handle"></iron-icon><template is="dom-if" if="[[!item.state]]"><div class="unknown flex">Unknown entity [[item.entity_id]]</div></template><template is="dom-if" if="[[item.state]]" restamp=""><state-info state-obj="[[item]]" class="flex"></state-info></template></div></template></sortable-js></div></template></dom-module><script>Polymer({is:"ha-form-group",properties:{hass:{type:Object},entity:{type:Object},entityName:{type:String,value:""},entityType:{type:String},entityChildren:{type:Object}},handleRowChosen:function(t){t.detail&&window.navigator.vibrate&&window.navigator.vibrate(50)},loadEntity:function(t){var i=this.hass.states;return this.entity=t,this.entityName=t.attributes.friendly_name||"",this.entityType=t.attributes.view?"view":"group",this.entityChildren=t.attributes.entity_id.map(function(t){return i[t]||{state:!1,entity_id:t,attributes:{}}}),Promise.resolve()},saveEntity:function(){var t={name:this.entityName,view:"view"===this.entityType,entities:this.entityChildren.map(function(t){return t.entity_id})},i=this.entity.entity_id.split(".")[1];return this.hass.callApi("POST","config/group/config/"+i,t)}});</script><dom-module id="ha-config-section-group" assetpath="group/"><template><ha-config-section is-wide="[[isWide]]"><span slot="header">Groups &amp; Views</span> <span slot="introduction">Use groups to organize your entities and make Home Assistant really your own.<br><br>Got more groups than you can handle? Create views to manage your groups.</span><ha-entity-config hass="[[hass]]" label="Group" entities="[[entities]]" config="[[entityConfig]]"></ha-entity-config></ha-config-section></template></dom-module><script>Polymer({is:"ha-config-section-group",properties:{hass:{type:Object},isWide:{type:Boolean,value:!1},entities:{type:Array,computed:"computeEntities(hass)"},entityConfig:{type:Object,value:{component:"ha-form-group",computeSelectCaption:function(t){return window.hassUtil.computeStateName(t)+(t.attributes.view?" (view)":"")}}}},computeEntities:function(t){return Object.keys(t.states).map(function(e){return t.states[e]}).filter(function(t){return"group"===window.hassUtil.computeDomain(t)&&!t.attributes.auto}).sort(window.hassUtil.sortByName)}});</script><dom-module id="ha-config-section-hassbian" assetpath="hassbian/"><template><style include="iron-flex ha-style">.header{font-size:16px;margin-bottom:1em;}.header .status{font-size:14px;float:right;}.card-actions paper-button{color:var(--default-primary-color);font-weight:500;}</style><ha-config-section is-wide="[[isWide]]"><span slot="header">Bring Hassbian to the next level</span> <span slot="introduction">Discover exciting add-ons to enhance your Home Assistant installation. Add an MQTT server or control a connected TV via HDMI-CEC.</span><template is="dom-if" if="[[suiteStatus]]"><template is="dom-repeat" items="[[computeSuiteKeys(suiteStatus)]]" as="suiteKey"><paper-card><div class="card-content"><div class="header">[[computeTitle(suiteKey)]] <span class="status">[[computeSuiteStatus(suiteStatus, suiteKey)]]</span></div>[[computeSuiteDescription(suiteStatus, suiteKey)]]</div><div class="card-actions"><paper-button on-tap="suiteMoreInfoTapped">LEARN MORE</paper-button><template is="dom-if" if="[[computeShowInstall(suiteStatus, suiteKey)]]"><paper-button on-tap="suiteActionTapped">INSTALL</paper-button></template></div></paper-card></template></template></ha-config-section></template></dom-module><script>Polymer({is:"ha-config-section-hassbian",properties:{hass:{type:Object},isWide:{type:Boolean},suiteStatus:{type:Object,value:null}},updateStatus:function(){this.hass.callApi("GET","config/hassbian/suites").then(function(t){this.suiteStatus=t;for(var e=!1,s=Object.keys(t),i=0;i<s.length;i++)if("installing"===t[s[i]].state){e=!0;break}e&&this.async(this.updateStatus,5e3)}.bind(this))},attached:function(){this.updateStatus=this.updateStatus.bind(this),this.updateStatus()},computeSuiteKeys:function(t){return Object.keys(t).sort(function(e,s){var i="installing"===t[e].state,n="installing"===t[s].state;if(i&&n);else{if(i)return-1;if(n)return 1}return e<s?-1:e>s?1:0})},computeSuiteDescription:function(t,e){return t[e].description},computeTitle:function(t){return t.substr(0,1).toUpperCase()+t.substr(1)},computeSuiteStatus:function(t,e){var s=t[e].state.replace(/_/," ");return s.substr(0,1).toUpperCase()+s.substr(1)},computeShowStatus:function(t,e){var s=t[e].state;return"installing"!==s&&"not_installed"!==s},computeShowInstall:function(t,e){return"not_installed"===t[e].state},suiteMoreInfoTapped:function(){},suiteActionTapped:function(){this.hass.callApi("POST","config/hassbian/suites/openzwave/install").then(this.updateStatus)}});</script><dom-module id="ha-form-zwave-device" assetpath="z-wave/"><template><style include="iron-flex ha-style ha-form-style"></style><div class="form-group"><paper-checkbox checked="{{entityIgnored}}" class="form-control">Exclude from Home Assistant</paper-checkbox></div><div class="form-group"><paper-dropdown-menu class="form-control flex" label="Polling intensity" disabled="[[entityIgnored]]"><paper-listbox slot="dropdown-content" selected="{{entityPollingIntensity}}"><paper-item>Do not poll (0)</paper-item><paper-item>Poll every time (1)</paper-item><paper-item>Poll every other time (2)</paper-item></paper-listbox></paper-dropdown-menu></div></template></dom-module><script>Polymer({is:"ha-form-zwave-device",properties:{hass:{type:Object},entity:{type:Object},entityIgnored:{type:Boolean},entityPollingIntensity:{type:Number}},loadEntity:function(t){this.entity=t;var i=this;return this.hass.callApi("GET","config/zwave/device_config/"+t.entity_id).then(function(t){i.entityIgnored=t.ignored||!1,i.entityPollingIntensity=t.polling_intensity||0})},saveEntity:function(){var t={ignored:this.entityIgnored,polling_intensity:this.entityPollingIntensity};return this.hass.callApi("POST","config/zwave/device_config/"+this.entity.entity_id,t)}});</script><dom-module id="ha-config-section-zwave" assetpath="z-wave/"><template><ha-config-section is-wide="[[isWide]]"><span slot="header">Z-Wave</span> <span slot="introduction">Z-Wave devices contain a lot of options. These controls will allow you to get into the nitty gritty details.</span><ha-entity-config hass="[[hass]]" entities="[[entities]]" config="[[entityConfig]]"></ha-entity-config></ha-config-section></template></dom-module><script>Polymer({is:"ha-config-section-zwave",properties:{hass:{type:Object},isWide:{type:Boolean,value:!1},entities:{type:Array,computed:"computeEntities(hass)"},entityConfig:{type:Object,value:{component:"ha-form-zwave-device",computeSelectCaption:function(t){return window.hassUtil.computeStateName(t)+" ("+window.hassUtil.computeDomain(t)+")"}}}},computeEntities:function(t){return Object.keys(t.states).map(function(e){return t.states[e]}).filter(function(t){return!t.attributes.hidden&&"node_id"in t.attributes}).sort(window.hassUtil.sortByName)}});</script></div><dom-module id="ha-panel-config"><template><style include="iron-flex ha-style">.content{padding-bottom:32px;}.border{margin:32px auto 0;border-bottom:1px solid rgba(0, 0, 0, 0.12);max-width:1040px;}.narrow .border{max-width:640px;}</style><iron-media-query query="(min-width: 1040px)" query-matches="{{wide}}"></iron-media-query><iron-media-query query="(min-width: 1296px)" query-matches="{{wideSidebar}}"></iron-media-query><app-header-layout has-scrolling-region=""><app-header slot="header" fixed=""><app-toolbar><ha-menu-button narrow="[[narrow]]" show-menu="[[showMenu]]"></ha-menu-button><div main-title="">Configuration</div></app-toolbar></app-header><div class$="[[computeClasses(isWide)]]"><ha-config-section-group is-wide="[[isWide]]" hass="[[hass]]"></ha-config-section-group><ha-config-section-core is-wide="[[isWide]]" hass="[[hass]]"></ha-config-section-core><template is="dom-if" if="[[computeIsHassbianLoaded(hass)]]"><div class="border"></div><ha-config-section-hassbian is-wide="[[isWide]]" hass="[[hass]]"></ha-config-section-hassbian></template><template is="dom-if" if="[[computeIsZwaveLoaded(hass)]]"><div class="border"></div><ha-config-section-zwave is-wide="[[isWide]]" hass="[[hass]]"></ha-config-section-zwave></template></div></app-header-layout></template></dom-module><script>Polymer({is:"ha-panel-config",properties:{hass:{type:Object},narrow:{type:Boolean},showMenu:{type:Boolean,value:!1},wide:{type:Boolean},wideSidebar:{type:Boolean},isWide:{type:Boolean,computed:"computeIsWide(showMenu, wideSidebar, wide)"}},computeIsWide:function(e,o,n){return e?o:n},computeClasses:function(e){return e?"content":"content narrow"},computeIsHassbianLoaded:function(e){return window.hassUtil.isComponentLoaded(e,"config.hassbian")},computeIsZwaveLoaded:function(e){return window.hassUtil.isComponentLoaded(e,"config.zwave")}});</script></body></html>
\ No newline at end of file
+<html><head></head><body><div hidden="" by-polymer-bundler=""><dom-module id="ha-config-section-core" assetpath="core/"><template><style include="iron-flex ha-style">.validate-container{@apply (--layout-vertical);@apply (--layout-center-center);height:140px;}.validate-result{color:var(--google-green-500);font-weight:500;margin-bottom:1em;}.config-invalid{margin:1em 0;}.config-invalid .text{color:var(--google-red-500);font-weight:500;}.config-invalid paper-button{float:right;}.validate-log{white-space:pre-wrap;}</style><ha-config-section is-wide="[[isWide]]"><span slot="header">Server Management</span> <span slot="introduction">Changing your configuration can be a tiresome process. We know. This section will try to make your life a little bit easier.</span><paper-card heading="Configuration Validation"><div class="card-content">Validate your configuration if you recently made some changes to your configuration and want to make sure that it is all valid.<template is="dom-if" if="[[!validateLog]]"><div class="validate-container"><template is="dom-if" if="[[!validating]]"><div class="validate-result" id="result">[[validateResult]]</div><paper-button raised="" on-tap="validateConfig">check config</paper-button></template><template is="dom-if" if="[[validating]]"><paper-spinner active=""></paper-spinner></template></div></template><template is="dom-if" if="[[validateLog]]"><div class="config-invalid"><span class="text">Configuration invalid.</span><paper-button raised="" on-tap="validateConfig">check config</paper-button></div><div id="configLog" class="validate-log">[[validateLog]]</div></template></div></paper-card><paper-card heading="Configuration Reloading"><div class="card-content">Some parts of Home Assistant can reload without requiring a restart. Hitting reload will unload their current configuration and load the new one.</div><div class="card-actions"><ha-call-service-button hass="[[hass]]" domain="homeassistant" service="reload_core_config">Reload Core</ha-call-service-button><ha-call-service-button hass="[[hass]]" domain="group" service="reload" hidden$="[[!groupLoaded(hass)]]">Reload Groups</ha-call-service-button><ha-call-service-button hass="[[hass]]" domain="automation" service="reload" hidden$="[[!automationLoaded(hass)]]">Reload Automation</ha-call-service-button><ha-call-service-button hass="[[hass]]" domain="script" service="reload" hidden$="[[!scriptLoaded(hass)]]">Reload Scripts</ha-call-service-button></div></paper-card><paper-card heading="Server Management"><div class="card-content">Control your Home Assistant server… from Home Assistant.</div><div class="card-actions warning"><ha-call-service-button class="warning" hass="[[hass]]" domain="homeassistant" service="restart">Restart</ha-call-service-button><ha-call-service-button class="warning" hass="[[hass]]" domain="homeassistant" service="stop">Stop</ha-call-service-button></div></paper-card></ha-config-section></template></dom-module><script>Polymer({is:"ha-config-section-core",properties:{hass:{type:Object},isWide:{type:Boolean,value:!1},validating:{type:Boolean,value:!1},validateResult:{type:String,value:""},validateLog:{type:String,value:""}},groupLoaded:function(i){return window.hassUtil.isComponentLoaded(i,"group")},automationLoaded:function(i){return window.hassUtil.isComponentLoaded(i,"automation")},scriptLoaded:function(i){return window.hassUtil.isComponentLoaded(i,"script")},validateConfig:function(){this.validating=!0,this.validateLog="",this.validateResult="";var i=this;this.hass.callApi("POST","config/core/check_config").then(function(t){i.validating=!1,(i.configValid="valid"===t.result)?i.validateResult="Valid!":i.validateLog=t.errors})}});</script><dom-module id="ha-entity-config"><template><style include="iron-flex ha-style">paper-card{display:block;}.device-picker{@apply (--layout-horizontal);padding-bottom:24px;}.form-placeholder{@apply (--layout-vertical);@apply (--layout-center-center);height:96px;}[hidden]:{display:none;};.card-actions{@apply (--layout-horizontal);@apply (--layout-justified);}</style><paper-card><div class="card-content"><div class="device-picker"><paper-dropdown-menu label="[[label]]" class="flex" disabled="[[!entities.length]]"><paper-listbox slot="dropdown-content" selected="{{selectedEntity}}"><template is="dom-repeat" items="[[entities]]" as="state"><paper-item>[[computeSelectCaption(state)]]</paper-item></template></paper-listbox></paper-dropdown-menu></div><div class="form-container"><template is="dom-if" if="[[computeShowPlaceholder(formState)]]"><div class="form-placeholder"><template is="dom-if" if="[[computeShowNoDevices(formState)]]">No entities found! :-(</template><template is="dom-if" if="[[computeShowSpinner(formState)]]"><paper-spinner active="" alt="[[formState]]"></paper-spinner>[[formState]]</template></div></template><div hidden$="[[!computeShowForm(formState)]]" id="form"></div></div></div><div class="card-actions"><paper-button on-tap="saveEntity" disabled="[[computeShowPlaceholder(formState)]]">SAVE</paper-button><template is="dom-if" if="[[allowDelete]]"><paper-button class="warning" on-tap="deleteEntity" disabled="[[computeShowPlaceholder(formState)]]">DELETE</paper-button></template></div></paper-card></template></dom-module><script>Polymer({is:"ha-entity-config",properties:{hass:{type:Object,observer:"hassChanged"},label:{type:String,value:"Device"},entities:{type:Array,observer:"entitiesChanged"},allowDelete:{type:Boolean,value:!1},selectedEntity:{type:Number,value:-1,observer:"entityChanged"},formState:{type:String,value:"no-devices"},config:{type:Object}},attached:function(){this.formEl=document.createElement(this.config.component),this.formEl.hass=this.hass,this.$.form.appendChild(this.formEl),this.entityChanged(this.selectedEntity)},computeSelectCaption:function(t){return this.config.computeSelectCaption?this.config.computeSelectCaption(t):window.hassUtil.computeStateName(t)},computeShowNoDevices:function(t){return"no-devices"===t},computeShowSpinner:function(t){return"loading"===t||"saving"===t},computeShowPlaceholder:function(t){return"editing"!==t},computeShowForm:function(t){return"editing"===t},hassChanged:function(t){this.formEl&&(this.formEl.hass=t)},entitiesChanged:function(t,e){if(0!==t.length)if(e){var i=e[this.selectedEntity].entity_id,n=t.findIndex(function(t){return t.entity_id===i});-1===n?this.selectedEntity=0:n!==this.selectedEntity&&(this.selectedEntity=n)}else this.selectedEntity=0;else this.formState="no-devices"},entityChanged:function(t){if(this.entities&&this.formEl){var e=this.entities[t];this.formState="loading";var i=this;this.formEl.loadEntity(e).then(function(){i.formState="editing"})}},saveEntity:function(){this.formState="saving";var t=this;this.formEl.saveEntity().then(function(){t.formState="editing"})}});</script><dom-module id="paper-radio-button" assetpath="../../bower_components/paper-radio-button/"><template strip-whitespace=""><style>:host{display:inline-block;line-height:0;white-space:nowrap;cursor:pointer;@apply --paper-font-common-base;--calculated-paper-radio-button-size:var(--paper-radio-button-size, 16px);--calculated-paper-radio-button-ink-size:var(--paper-radio-button-ink-size, -1px);}:host(:focus){outline:none;}#radioContainer{@apply --layout-inline;@apply --layout-center-center;position:relative;width:var(--calculated-paper-radio-button-size);height:var(--calculated-paper-radio-button-size);vertical-align:middle;@apply --paper-radio-button-radio-container;}#ink{position:absolute;top:50%;left:50%;right:auto;width:var(--calculated-paper-radio-button-ink-size);height:var(--calculated-paper-radio-button-ink-size);color:var(--paper-radio-button-unchecked-ink-color, var(--primary-text-color));opacity:0.6;pointer-events:none;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);}#ink[checked]{color:var(--paper-radio-button-checked-ink-color, var(--primary-color));}#offRadio, #onRadio{position:absolute;box-sizing:border-box;top:0;left:0;width:100%;height:100%;border-radius:50%;}#offRadio{border:2px solid var(--paper-radio-button-unchecked-color, var(--primary-text-color));background-color:var(--paper-radio-button-unchecked-background-color, transparent);transition:border-color 0.28s;}#onRadio{background-color:var(--paper-radio-button-checked-color, var(--primary-color));-webkit-transform:scale(0);transform:scale(0);transition:-webkit-transform ease 0.28s;transition:transform ease 0.28s;will-change:transform;}:host([checked]) #offRadio{border-color:var(--paper-radio-button-checked-color, var(--primary-color));}:host([checked]) #onRadio{-webkit-transform:scale(0.5);transform:scale(0.5);}#radioLabel{line-height:normal;position:relative;display:inline-block;vertical-align:middle;margin-left:var(--paper-radio-button-label-spacing, 10px);white-space:normal;color:var(--paper-radio-button-label-color, var(--primary-text-color));@apply --paper-radio-button-label;}:host([checked]) #radioLabel{@apply --paper-radio-button-label-checked;}:host-context([dir="rtl"]) #radioLabel{margin-left:0;margin-right:var(--paper-radio-button-label-spacing, 10px);}#radioLabel[hidden]{display:none;}:host([disabled]) #offRadio{border-color:var(--paper-radio-button-unchecked-color, var(--primary-text-color));opacity:0.5;}:host([disabled][checked]) #onRadio{background-color:var(--paper-radio-button-unchecked-color, var(--primary-text-color));opacity:0.5;}:host([disabled]) #radioLabel{opacity:0.65;}</style><div id="radioContainer"><div id="offRadio"></div><div id="onRadio"></div></div><div id="radioLabel"><slot></slot></div></template><script>Polymer({is:"paper-radio-button",behaviors:[Polymer.PaperCheckedElementBehavior],hostAttributes:{role:"radio","aria-checked":!1,tabindex:0},properties:{ariaActiveAttribute:{type:String,value:"aria-checked"}},ready:function(){this._rippleContainer=this.$.radioContainer},attached:function(){Polymer.RenderStatus.afterNextRender(this,function(){if("-1px"===this.getComputedStyleValue("--calculated-paper-radio-button-ink-size").trim()){var e=parseFloat(this.getComputedStyleValue("--calculated-paper-radio-button-size").trim()),t=Math.floor(3*e);t%2!=e%2&&t++,this.updateStyles({"--paper-radio-button-ink-size":t+"px"})}})}});</script></dom-module><dom-module id="paper-radio-group" assetpath="../../bower_components/paper-radio-group/"><template><style>:host{display:inline-block;}:host ::slotted(*){padding:var(--paper-radio-group-item-padding, 12px);}</style><slot></slot></template></dom-module><script>Polymer({is:"paper-radio-group",behaviors:[Polymer.IronMenubarBehavior],hostAttributes:{role:"radiogroup",tabindex:0},properties:{attrForSelected:{type:String,value:"name"},selectedAttribute:{type:String,value:"checked"},selectable:{type:String,value:"paper-radio-button"},allowEmptySelection:{type:Boolean,value:!1}},select:function(e){var t=this._valueToItem(e);if(!t||!t.hasAttribute("disabled")){if(this.selected){var i=this._valueToItem(this.selected);if(this.selected==e){if(!this.allowEmptySelection)return void(i&&(i.checked=!0));e=""}i&&(i.checked=!1)}Polymer.IronSelectableBehavior.select.apply(this,[e]),this.fire("paper-radio-group-changed")}},_activateFocusedItem:function(){this._itemActivate(this._valueForItem(this.focusedItem),this.focusedItem)},_onUpKey:function(e){this._focusPrevious(),e.preventDefault(),this._activateFocusedItem()},_onDownKey:function(e){this._focusNext(),e.preventDefault(),this._activateFocusedItem()},_onLeftKey:function(e){Polymer.IronMenubarBehaviorImpl._onLeftKey.apply(this,arguments),this._activateFocusedItem()},_onRightKey:function(e){Polymer.IronMenubarBehaviorImpl._onRightKey.apply(this,arguments),this._activateFocusedItem()}});</script><script>var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t){"use strict";"function"==typeof define&&define.amd?define(t):"undefined"!=typeof module&&void 0!==module.exports?module.exports=t():window.Sortable=t()}(function(){"use strict";function t(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be HTMLElement, and not "+{}.toString.call(t);this.el=t,this.options=e=_({},e),t[V]=this;var n={group:Math.random(),sort:!0,disabled:!1,store:null,handle:null,scroll:!0,scrollSensitivity:30,scrollSpeed:10,draggable:/[uo]l/i.test(t.nodeName)?"li":">*",ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0}};for(var o in n)!(o in e)&&(e[o]=n[o]);at(e);for(var i in this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&K,r(t,"mousedown",this._onTapStart),r(t,"touchstart",this._onTapStart),r(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(r(t,"dragover",this),r(t,"dragenter",this)),it.push(this._onDragOver),e.store&&this.sort(e.store.get(this))}function e(t,e){"clone"!==t.lastPullMode&&(e=!0),C&&C.state!==e&&(l(C,"display",e?"none":""),e||C.state&&(t.options.group.revertClone?(E.insertBefore(C,x),t._animate(w,C)):E.insertBefore(C,w)),C.state=e)}function n(t,e,n){if(t){n=n||z;do{if(">*"===e&&t.parentNode===n||m(t,e))return t}while(t=o(t))}return null}function o(t){var e=t.host;return e&&e.nodeType?e:t.parentNode}function i(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.preventDefault()}function r(t,e,n){t.addEventListener(e,n,J)}function a(t,e,n){t.removeEventListener(e,n,J)}function s(t,e,n){if(t)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(H," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(H," ")}}function l(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return z.defaultView&&z.defaultView.getComputedStyle?n=z.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function c(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function d(t,e,n,o,i,r,a){t=t||e[V];var s=z.createEvent("Event"),l=t.options,c="on"+n.charAt(0).toUpperCase()+n.substr(1);s.initEvent(n,!0,!0),s.to=e,s.from=i||e,s.item=o||e,s.clone=C,s.oldIndex=r,s.newIndex=a,e.dispatchEvent(s),l[c]&&l[c].call(t,s)}function h(t,e,n,o,i,r,a,s){var l,c,d=t[V],h=d.options.onMove;return(l=z.createEvent("Event")).initEvent("move",!0,!0),l.to=e,l.from=t,l.dragged=n,l.draggedRect=o,l.related=i||e,l.relatedRect=r||e.getBoundingClientRect(),l.willInsertAfter=s,t.dispatchEvent(l),h&&(c=h.call(d,l,a)),c}function u(t){t.draggable=!1}function f(){tt=!1}function p(t,e){var n=t.lastElementChild.getBoundingClientRect();return e.clientY-(n.top+n.height)>5||e.clientX-(n.left+n.width)>5}function g(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function v(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t&&(t=t.previousElementSibling);)"TEMPLATE"===t.nodeName.toUpperCase()||">*"!==e&&!m(t,e)||n++;return n}function m(t,e){if(t){var n=(e=e.split(".")).shift().toUpperCase(),o=new RegExp("\\s("+e.join("|")+")(?=\\s)","g");return!(""!==n&&t.nodeName.toUpperCase()!=n||e.length&&((" "+t.className+" ").match(o)||[]).length!=e.length)}return!1}function b(t,e){var n,o;return function(){void 0===n&&(n=arguments,o=this,setTimeout(function(){1===n.length?t.call(o,n[0]):t.apply(o,n),n=void 0},e))}}function _(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function y(t){return Q?Q(t).clone(!0)[0]:Z&&Z.dom?Z.dom(t).cloneNode(!0):t.cloneNode(!0)}function D(t){for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var o=e[n];o.checked&&ot.push(o)}}if("undefined"==typeof window||!window.document)return function(){throw new Error("Sortable.js requires a window with a document")};var w,T,S,C,E,x,N,k,B,Y,O,X,A,M,P,R,I,L,F,U,j={},H=/\s+/g,W=/left|right|inline/,V="Sortable"+(new Date).getTime(),q=window,z=q.document,G=q.parseInt,Q=q.jQuery||q.Zepto,Z=q.Polymer,J=!1,K=!!("draggable"in z.createElement("div")),$=function(t){return!navigator.userAgent.match(/Trident.*rv[ :]?11\./)&&(t=z.createElement("x"),t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents)}(),tt=!1,et=Math.abs,nt=Math.min,ot=[],it=[],rt=b(function(t,e,n){if(n&&e.scroll){var o,i,r,a,s,l,c=n[V],d=e.scrollSensitivity,h=e.scrollSpeed,u=t.clientX,f=t.clientY,p=window.innerWidth,g=window.innerHeight;if(B!==n&&(k=e.scroll,B=n,Y=e.scrollFn,!0===k)){k=n;do{if(k.offsetWidth<k.scrollWidth||k.offsetHeight<k.scrollHeight)break}while(k=k.parentNode)}k&&(o=k,i=k.getBoundingClientRect(),r=(et(i.right-u)<=d)-(et(i.left-u)<=d),a=(et(i.bottom-f)<=d)-(et(i.top-f)<=d)),r||a||(a=(g-f<=d)-(f<=d),((r=(p-u<=d)-(u<=d))||a)&&(o=q)),j.vx===r&&j.vy===a&&j.el===o||(j.el=o,j.vx=r,j.vy=a,clearInterval(j.pid),o&&(j.pid=setInterval(function(){if(l=a?a*h:0,s=r?r*h:0,"function"==typeof Y)return Y.call(c,s,l,t);o===q?q.scrollTo(q.pageXOffset+s,q.pageYOffset+l):(o.scrollTop+=l,o.scrollLeft+=s)},24)))}},30),at=function(t){function e(t,e){return void 0!==t&&!0!==t||(t=n.name),"function"==typeof t?t:function(n,o){var i=o.options.group.name;return e?t:t&&(t.join?t.indexOf(i)>-1:i==t)}}var n={},o=t.group;o&&"object"==(void 0===o?"undefined":_typeof(o))||(o={name:o}),n.name=o.name,n.checkPull=e(o.pull,!0),n.checkPut=e(o.put),n.revertClone=o.revertClone,t.group=n};t.prototype={constructor:t,_onTapStart:function(t){var e,o=this,i=this.el,r=this.options,a=r.preventOnFilter,s=t.type,l=t.touches&&t.touches[0],c=(l||t).target,h=t.target.shadowRoot&&t.path[0]||c,u=r.filter;if(D(i),!w&&!("mousedown"===s&&0!==t.button||r.disabled)&&(c=n(c,r.draggable,i))&&N!==c){if(e=v(c,r.draggable),"function"==typeof u){if(u.call(this,t,c,this))return d(o,h,"filter",c,i,e),void(a&&t.preventDefault())}else if(u&&(u=u.split(",").some(function(t){if(t=n(h,t.trim(),i))return d(o,t,"filter",c,i,e),!0})))return void(a&&t.preventDefault());r.handle&&!n(h,r.handle,i)||this._prepareDragStart(t,l,c,e)}},_prepareDragStart:function(t,e,n,o){var i,a=this,l=a.el,h=a.options,f=l.ownerDocument;n&&!w&&n.parentNode===l&&(L=t,E=l,T=(w=n).parentNode,x=w.nextSibling,N=n,R=h.group,M=o,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,w.style["will-change"]="transform",i=function(){a._disableDelayedDrag(),w.draggable=a.nativeDraggable,s(w,h.chosenClass,!0),a._triggerDragStart(t,e),d(a,E,"choose",w,E,M)},h.ignore.split(",").forEach(function(t){c(w,t.trim(),u)}),r(f,"mouseup",a._onDrop),r(f,"touchend",a._onDrop),r(f,"touchcancel",a._onDrop),r(f,"pointercancel",a._onDrop),r(f,"selectstart",a),h.delay?(r(f,"mouseup",a._disableDelayedDrag),r(f,"touchend",a._disableDelayedDrag),r(f,"touchcancel",a._disableDelayedDrag),r(f,"mousemove",a._disableDelayedDrag),r(f,"touchmove",a._disableDelayedDrag),r(f,"pointermove",a._disableDelayedDrag),a._dragStartTimer=setTimeout(i,h.delay)):i())},_disableDelayedDrag:function(){var t=this.el.ownerDocument;clearTimeout(this._dragStartTimer),a(t,"mouseup",this._disableDelayedDrag),a(t,"touchend",this._disableDelayedDrag),a(t,"touchcancel",this._disableDelayedDrag),a(t,"mousemove",this._disableDelayedDrag),a(t,"touchmove",this._disableDelayedDrag),a(t,"pointermove",this._disableDelayedDrag)},_triggerDragStart:function(t,e){(e=e||("touch"==t.pointerType?t:null))?(L={target:w,clientX:e.clientX,clientY:e.clientY},this._onDragStart(L,"touch")):this.nativeDraggable?(r(w,"dragend",this),r(E,"dragstart",this._onDragStart)):this._onDragStart(L,!0);try{z.selection?setTimeout(function(){z.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(){if(E&&w){var e=this.options;s(w,e.ghostClass,!0),s(w,e.dragClass,!1),t.active=this,d(this,E,"start",w,E,M)}else this._nulling()},_emulateDragOver:function(){if(F){if(this._lastX===F.clientX&&this._lastY===F.clientY)return;this._lastX=F.clientX,this._lastY=F.clientY,$||l(S,"display","none");var t=z.elementFromPoint(F.clientX,F.clientY),e=t,n=it.length;if(e)do{if(e[V]){for(;n--;)it[n]({clientX:F.clientX,clientY:F.clientY,target:t,rootEl:e});break}t=e}while(e=e.parentNode);$||l(S,"display","")}},_onTouchMove:function(e){if(L){var n=this.options,o=n.fallbackTolerance,i=n.fallbackOffset,r=e.touches?e.touches[0]:e,a=r.clientX-L.clientX+i.x,s=r.clientY-L.clientY+i.y,c=e.touches?"translate3d("+a+"px,"+s+"px,0)":"translate("+a+"px,"+s+"px)";if(!t.active){if(o&&nt(et(r.clientX-this._lastX),et(r.clientY-this._lastY))<o)return;this._dragStarted()}this._appendGhost(),U=!0,F=r,l(S,"webkitTransform",c),l(S,"mozTransform",c),l(S,"msTransform",c),l(S,"transform",c),e.preventDefault()}},_appendGhost:function(){if(!S){var t,e=w.getBoundingClientRect(),n=l(w),o=this.options;s(S=w.cloneNode(!0),o.ghostClass,!1),s(S,o.fallbackClass,!0),s(S,o.dragClass,!0),l(S,"top",e.top-G(n.marginTop,10)),l(S,"left",e.left-G(n.marginLeft,10)),l(S,"width",e.width),l(S,"height",e.height),l(S,"opacity","0.8"),l(S,"position","fixed"),l(S,"zIndex","100000"),l(S,"pointerEvents","none"),o.fallbackOnBody&&z.body.appendChild(S)||E.appendChild(S),t=S.getBoundingClientRect(),l(S,"width",2*e.width-t.width),l(S,"height",2*e.height-t.height)}},_onDragStart:function(t,e){var n=t.dataTransfer,o=this.options;this._offUpEvents(),R.checkPull(this,this,w,t)&&((C=y(w)).draggable=!1,C.style["will-change"]="",l(C,"display","none"),s(C,this.options.chosenClass,!1),E.insertBefore(C,w),d(this,E,"clone",w)),s(w,o.dragClass,!0),e?("touch"===e?(r(z,"touchmove",this._onTouchMove),r(z,"touchend",this._onDrop),r(z,"touchcancel",this._onDrop),r(z,"pointermove",this._onTouchMove),r(z,"pointerup",this._onDrop)):(r(z,"mousemove",this._onTouchMove),r(z,"mouseup",this._onDrop)),this._loopId=setInterval(this._emulateDragOver,50)):(n&&(n.effectAllowed="move",o.setData&&o.setData.call(this,n,w)),r(z,"drop",this),setTimeout(this._dragStarted,0))},_onDragOver:function(o){var i,r,a,s,c=this.el,d=this.options,u=d.group,g=t.active,v=R===u,m=!1,b=d.sort;if(void 0!==o.preventDefault&&(o.preventDefault(),!d.dragoverBubble&&o.stopPropagation()),!w.animated&&(U=!0,g&&!d.disabled&&(v?b||(s=!E.contains(w)):I===this||(g.lastPullMode=R.checkPull(this,g,w,o))&&u.checkPut(this,g,w,o))&&(void 0===o.rootEl||o.rootEl===this.el))){if(rt(o,d,this.el),tt)return;if(i=n(o.target,d.draggable,c),r=w.getBoundingClientRect(),I!==this&&(I=this,m=!0),s)return e(g,!0),T=E,void(C||x?E.insertBefore(w,C||x):b||E.appendChild(w));if(0===c.children.length||c.children[0]===S||c===o.target&&p(c,o)){if(0!==c.children.length&&c.children[0]!==S&&c===o.target&&(i=c.lastElementChild),i){if(i.animated)return;a=i.getBoundingClientRect()}e(g,v),!1!==h(E,c,w,r,i,a,o)&&(w.contains(c)||(c.appendChild(w),T=c),this._animate(r,w),i&&this._animate(a,i))}else if(i&&!i.animated&&i!==w&&void 0!==i.parentNode[V]){O!==i&&(O=i,X=l(i),A=l(i.parentNode));var _=(a=i.getBoundingClientRect()).right-a.left,y=a.bottom-a.top,D=W.test(X.cssFloat+X.display)||"flex"==A.display&&0===A["flex-direction"].indexOf("row"),N=i.offsetWidth>w.offsetWidth,k=i.offsetHeight>w.offsetHeight,B=(D?(o.clientX-a.left)/_:(o.clientY-a.top)/y)>.5,Y=i.nextElementSibling,M=!1;if(D){var P=w.offsetTop,L=i.offsetTop;M=P===L?i.previousElementSibling===w&&!N||B&&N:i.previousElementSibling===w||w.previousElementSibling===i?(o.clientY-a.top)/y>.5:L>P}else m||(M=Y!==w&&!k||B&&k);var F=h(E,c,w,r,i,a,o,M);!1!==F&&(1!==F&&-1!==F||(M=1===F),tt=!0,setTimeout(f,30),e(g,v),w.contains(c)||(M&&!Y?c.appendChild(w):i.parentNode.insertBefore(w,M?Y:i)),T=w.parentNode,this._animate(r,w),this._animate(a,i))}}},_animate:function(t,e){var n=this.options.animation;if(n){var o=e.getBoundingClientRect();1===t.nodeType&&(t=t.getBoundingClientRect()),l(e,"transition","none"),l(e,"transform","translate3d("+(t.left-o.left)+"px,"+(t.top-o.top)+"px,0)"),e.offsetWidth,l(e,"transition","all "+n+"ms"),l(e,"transform","translate3d(0,0,0)"),clearTimeout(e.animated),e.animated=setTimeout(function(){l(e,"transition",""),l(e,"transform",""),e.animated=!1},n)}},_offUpEvents:function(){var t=this.el.ownerDocument;a(z,"touchmove",this._onTouchMove),a(z,"pointermove",this._onTouchMove),a(t,"mouseup",this._onDrop),a(t,"touchend",this._onDrop),a(t,"pointerup",this._onDrop),a(t,"touchcancel",this._onDrop),a(t,"pointercancel",this._onDrop),a(t,"selectstart",this)},_onDrop:function(e){var n=this.el,o=this.options;clearInterval(this._loopId),clearInterval(j.pid),clearTimeout(this._dragStartTimer),a(z,"mousemove",this._onTouchMove),this.nativeDraggable&&(a(z,"drop",this),a(n,"dragstart",this._onDragStart)),this._offUpEvents(),e&&(U&&(e.preventDefault(),!o.dropBubble&&e.stopPropagation()),S&&S.parentNode&&S.parentNode.removeChild(S),E!==T&&"clone"===t.active.lastPullMode||C&&C.parentNode&&C.parentNode.removeChild(C),w&&(this.nativeDraggable&&a(w,"dragend",this),u(w),w.style["will-change"]="",s(w,this.options.ghostClass,!1),s(w,this.options.chosenClass,!1),d(this,E,"unchoose",w,E,M),E!==T?(P=v(w,o.draggable))>=0&&(d(null,T,"add",w,E,M,P),d(this,E,"remove",w,E,M,P),d(null,T,"sort",w,E,M,P),d(this,E,"sort",w,E,M,P)):w.nextSibling!==x&&(P=v(w,o.draggable))>=0&&(d(this,E,"update",w,E,M,P),d(this,E,"sort",w,E,M,P)),t.active&&(null!=P&&-1!==P||(P=M),d(this,E,"end",w,E,M,P),this.save()))),this._nulling()},_nulling:function(){E=w=T=S=x=C=N=k=B=L=F=U=P=O=X=I=R=t.active=null,ot.forEach(function(t){t.checked=!0}),ot.length=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragover":case"dragenter":w&&(this._onDragOver(t),i(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],o=this.el.children,i=0,r=o.length,a=this.options;i<r;i++)n(t=o[i],a.draggable,this.el)&&e.push(t.getAttribute(a.dataIdAttr)||g(t));return e},sort:function(t){var e={},o=this.el;this.toArray().forEach(function(t,i){var r=o.children[i];n(r,this.options.draggable,o)&&(e[t]=r)},this),t.forEach(function(t){e[t]&&(o.removeChild(e[t]),o.appendChild(e[t]))})},save:function(){var t=this.options.store;t&&t.set(this)},closest:function(t,e){return n(t,e||this.options.draggable,this.el)},option:function(t,e){var n=this.options;if(void 0===e)return n[t];n[t]=e,"group"===t&&at(n)},destroy:function(){var t=this.el;t[V]=null,a(t,"mousedown",this._onTapStart),a(t,"touchstart",this._onTapStart),a(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(a(t,"dragover",this),a(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),it.splice(it.indexOf(this._onDragOver),1),this._onDrop(),this.el=t=null}},r(z,"touchmove",function(e){t.active&&e.preventDefault()});try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){J={capture:!1,passive:!1}}}))}catch(t){}return t.utils={on:r,off:a,css:l,find:c,is:function(t,e){return!!n(t,e,t)},extend:_,throttle:b,closest:n,toggleClass:s,clone:y,index:v},t.create=function(e,n){return new t(e,n)},t.version="1.6.0",t});</script><dom-module id="sortable-js" assetpath="../../bower_components/polymer-sortablejs/"><template><content></content></template></dom-module><script>"use strict";Polymer({is:"sortable-js",properties:{group:{type:String,value:function(){return Math.random()},observer:"groupChanged"},sort:{type:Boolean,value:!0,observer:"sortChanged"},disabled:{type:Boolean,value:!1,observer:"disabledChanged"},store:{type:Object,value:null,observer:"storeChanged"},handle:{type:String,value:null,observer:"handleChanged"},scrollSensitivity:{type:Number,value:30,observer:"scrollSensitivityChanged"},scrollSpeed:{type:Number,value:10,observer:"scrollSpeedChanged"},ghostClass:{type:String,value:"sortable-ghost",observer:"ghostClassChanged"},chosenClass:{type:String,value:"sortable-chosen",observer:"chosenClassChanged"},ignore:{type:String,value:"a, img",observer:"ignoreChanged"},filter:{type:Object,value:null,observer:"filterChanged"},animation:{type:Number,value:0,observer:"animationChanged"},dropBubble:{type:Boolean,value:!1,observer:"dropBubbleChanged"},dragoverBubble:{type:Boolean,value:!1,observer:"dragoverBubbleChanged"},dataIdAttr:{type:String,value:"data-id",observer:"dataIdAttrChanged"},delay:{type:Number,value:0,observer:"delayChanged"},forceFallback:{type:Boolean,value:!1,observer:"forceFallbackChanged"},fallbackClass:{type:String,value:"sortable-fallback",observer:"fallbackClassChanged"},fallbackOnBody:{type:Boolean,value:!1,observer:"fallbackOnBodyChanged"},draggable:{},scroll:{}},created:function(){Object.defineProperties(this,{draggable:{get:function(){return this._draggable||this.getAttribute("draggable")||">*"},set:function(e){this._draggable=e,this.draggableChanged(e)}},scroll:{get:function(){return this._scroll||JSON.parse(this.getAttribute("scroll")||"true")},set:function(e){this._scroll=e,this.scrollChanged(e)}}})},attached:function(){this.initialize()},detached:function(){this.destroy()},initialize:function(){var e=this.querySelectorAll("template[is='dom-repeat']"),t=e[e.length-1],o={};Object.keys(this.properties).forEach(function(e){o[e]=this[e]}.bind(this));var a=this,s={onUpdate:function(e){t&&t.splice("items",e.newIndex,0,t.splice("items",e.oldIndex,1)[0]),a.fire("update",e)},onAdd:function(e){if(t){var o=e.from.querySelectorAll("template[is='dom-repeat']"),s=o[o.length-1].items[e.oldIndex];t.splice("items",e.newIndex,0,s)}a.fire("add",e)},onRemove:function(e){t&&t.splice("items",e.oldIndex,1)[0],a.fire("remove",e)},onChoose:function(e){a.fire("choose",e)},onStart:function(e){a.fire("start",e)},onEnd:function(e){a.fire("end",e)},onSort:function(e){a.fire("sort",e)},onFilter:function(e){a.fire("filter",e)},onMove:function(e){a.fire("move",e)},onClone:function(e){a.fire("clone",e)}};Object.keys(s).forEach(function(e){o[e]=s[e]}),this.sortable=Sortable.create(this,o)},destroy:function(){this.sortable&&this.sortable.destroy()},groupChanged:function(e){this.sortable&&this.sortable.option("group",e)},sortChanged:function(e){this.sortable&&this.sortable.option("sort",e)},disabledChanged:function(e){this.sortable&&this.sortable.option("disabled",e)},storeChanged:function(e){this.sortable&&this.sortable.option("store",e)},handleChanged:function(e){this.sortable&&this.sortable.option("handle",e)},scrollChanged:function(e){this.sortable&&this.sortable.option("scroll",e)},scrollSensitivityChanged:function(e){this.sortable&&this.sortable.option("scrollSensitivity",e)},scrollSpeedChanged:function(e){this.sortable&&this.sortable.option("scrollSpeed",e)},draggableChanged:function(e){this.sortable&&this.sortable.option("draggable",e)},ghostClassChanged:function(e){this.sortable&&this.sortable.option("ghostClass",e)},chosenClassChanged:function(e){this.sortable&&this.sortable.option("chosenClass",e)},ignoreChanged:function(e){this.sortable&&this.sortable.option("ignore",e)},filterChanged:function(e){this.sortable&&this.sortable.option("filter",e)},animationChanged:function(e){this.sortable&&this.sortable.option("animation",e)},dropBubbleChanged:function(e){this.sortable&&this.sortable.option("dropBubble",e)},dragoverBubbleChanged:function(e){this.sortable&&this.sortable.option("dragoverBubble",e)},dataIdAttrChanged:function(e){this.sortable&&this.sortable.option("dataIdAttr",e)},delayChanged:function(e){this.sortable&&this.sortable.option("delay",e)},forceFallbackChanged:function(e){this.sortable&&this.sortable.option("forceFallback",e)},fallbackClassChanged:function(e){this.sortable&&this.sortable.option("fallbackClass",e)},fallbackOnBodyChanged:function(e){this.sortable&&this.sortable.option("fallbackOnBody",e)}});</script><dom-module id="ha-form-style"><template><style>.form-group{@apply (--layout-horizontal);@apply (--layout-center);padding:8px 16px;}.form-group label{@apply (--layout-flex-2);}.form-group .form-control{@apply (--layout-flex-1);}.form-group.vertical{@apply (--layout-vertical);@apply (--layout-start);}paper-dropdown-menu.form-control{margin:-9px 0;}</style></template></dom-module><dom-module id="ha-form-group" assetpath="group/"><template><style include="iron-flex ha-style ha-form-style">.entities-header{@apply (--layout-horizontal);@apply (--layout-justified);@apply (--layout-center);width:100%;}.drag-handle{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab;}.sortable-chosen .drag-handle, .sortable-ghost{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing;}sortable-js{width:100%;}.entity-row{@apply (--layout-horizontal);@apply (--layout-center);padding:4px 0;border-top:1px solid rgba(0, 0, 0, .12);}.entity-row:first-child{border-top:1px solid rgba(0, 0, 0, 0);}.entity-row.sortable-chosen{background-color:var(--paper-grey-200);border-top:1px solid rgba(0, 0, 0, 0);}.entity-row .unknown{padding-left:56px;}.entity-row paper-icon-button{visibility:hidden;}.entity-row:not(.sortable-chosen):hover paper-icon-button{visibility:visible;}</style><div class="form-group"><paper-input class="form-control flex" label="Name" value="{{entityName}}"></paper-input></div><div class="form-group"><label>Type</label><paper-radio-group selected="{{entityType}}" class="form-control"><paper-radio-button name="group">Group</paper-radio-button><paper-radio-button name="view">View</paper-radio-button></paper-radio-group></div><div class="form-group vertical entities"><div class="entities-header"><label>Entities (drag to reorder):</label></div><sortable-js class="form-control" on-choose="handleRowChosen" handle=".drag-handle"><template is="dom-repeat" items="{{entityChildren}}"><div class="entity-row"><iron-icon icon="mdi:drag-vertical" class="drag-handle"></iron-icon><template is="dom-if" if="[[!item.state]]"><div class="unknown flex">Unknown entity [[item.entity_id]]</div></template><template is="dom-if" if="[[item.state]]" restamp=""><state-info state-obj="[[item]]" class="flex"></state-info></template></div></template></sortable-js></div></template></dom-module><script>Polymer({is:"ha-form-group",properties:{hass:{type:Object},entity:{type:Object},entityName:{type:String,value:""},entityType:{type:String},entityChildren:{type:Object}},handleRowChosen:function(t){t.detail&&window.navigator.vibrate&&window.navigator.vibrate(50)},loadEntity:function(t){var i=this.hass.states;return this.entity=t,this.entityName=t.attributes.friendly_name||"",this.entityType=t.attributes.view?"view":"group",this.entityChildren=t.attributes.entity_id.map(function(t){return i[t]||{state:!1,entity_id:t,attributes:{}}}),Promise.resolve()},saveEntity:function(){var t={name:this.entityName,view:"view"===this.entityType,entities:this.entityChildren.map(function(t){return t.entity_id})},i=this.entity.entity_id.split(".")[1];return this.hass.callApi("POST","config/group/config/"+i,t)}});</script><dom-module id="ha-config-section-group" assetpath="group/"><template><ha-config-section is-wide="[[isWide]]"><span slot="header">Groups &amp; Views</span> <span slot="introduction">Use groups to organize your entities and make Home Assistant really your own.<br><br>Got more groups than you can handle? Create views to manage your groups.</span><ha-entity-config hass="[[hass]]" label="Group" entities="[[entities]]" config="[[entityConfig]]"></ha-entity-config></ha-config-section></template></dom-module><script>Polymer({is:"ha-config-section-group",properties:{hass:{type:Object},isWide:{type:Boolean,value:!1},entities:{type:Array,computed:"computeEntities(hass)"},entityConfig:{type:Object,value:{component:"ha-form-group",computeSelectCaption:function(t){return window.hassUtil.computeStateName(t)+(t.attributes.view?" (view)":"")}}}},computeEntities:function(t){return Object.keys(t.states).map(function(e){return t.states[e]}).filter(function(t){return"group"===window.hassUtil.computeDomain(t)&&!t.attributes.auto}).sort(window.hassUtil.sortByName)}});</script><dom-module id="ha-config-section-hassbian" assetpath="hassbian/"><template><style include="iron-flex ha-style">.header{font-size:16px;margin-bottom:1em;}.header .status{font-size:14px;float:right;}.card-actions paper-button{color:var(--default-primary-color);font-weight:500;}</style><ha-config-section is-wide="[[isWide]]"><span slot="header">Bring Hassbian to the next level</span> <span slot="introduction">Discover exciting add-ons to enhance your Home Assistant installation. Add an MQTT server or control a connected TV via HDMI-CEC.</span><template is="dom-if" if="[[suiteStatus]]"><template is="dom-repeat" items="[[computeSuiteKeys(suiteStatus)]]" as="suiteKey"><paper-card><div class="card-content"><div class="header">[[computeTitle(suiteKey)]] <span class="status">[[computeSuiteStatus(suiteStatus, suiteKey)]]</span></div>[[computeSuiteDescription(suiteStatus, suiteKey)]]</div><div class="card-actions"><paper-button on-tap="suiteMoreInfoTapped">LEARN MORE</paper-button><template is="dom-if" if="[[computeShowInstall(suiteStatus, suiteKey)]]"><paper-button on-tap="suiteActionTapped">INSTALL</paper-button></template></div></paper-card></template></template></ha-config-section></template></dom-module><script>Polymer({is:"ha-config-section-hassbian",properties:{hass:{type:Object},isWide:{type:Boolean},suiteStatus:{type:Object,value:null}},updateStatus:function(){this.hass.callApi("GET","config/hassbian/suites").then(function(t){this.suiteStatus=t;for(var e=!1,s=Object.keys(t),i=0;i<s.length;i++)if("installing"===t[s[i]].state){e=!0;break}e&&this.async(this.updateStatus,5e3)}.bind(this))},attached:function(){this.updateStatus=this.updateStatus.bind(this),this.updateStatus()},computeSuiteKeys:function(t){return Object.keys(t).sort(function(e,s){var i="installing"===t[e].state,n="installing"===t[s].state;if(i&&n);else{if(i)return-1;if(n)return 1}return e<s?-1:e>s?1:0})},computeSuiteDescription:function(t,e){return t[e].description},computeTitle:function(t){return t.substr(0,1).toUpperCase()+t.substr(1)},computeSuiteStatus:function(t,e){var s=t[e].state.replace(/_/," ");return s.substr(0,1).toUpperCase()+s.substr(1)},computeShowStatus:function(t,e){var s=t[e].state;return"installing"!==s&&"not_installed"!==s},computeShowInstall:function(t,e){return"not_installed"===t[e].state},suiteMoreInfoTapped:function(){},suiteActionTapped:function(){this.hass.callApi("POST","config/hassbian/suites/openzwave/install").then(this.updateStatus)}});</script><dom-module id="ha-form-zwave-device" assetpath="z-wave/"><template><style include="iron-flex ha-style ha-form-style"></style><div class="form-group"><paper-checkbox checked="{{entityIgnored}}" class="form-control">Exclude from Home Assistant</paper-checkbox></div><div class="form-group"><paper-dropdown-menu class="form-control flex" label="Polling intensity" disabled="[[entityIgnored]]"><paper-listbox slot="dropdown-content" selected="{{entityPollingIntensity}}"><paper-item>Do not poll (0)</paper-item><paper-item>Poll every time (1)</paper-item><paper-item>Poll every other time (2)</paper-item></paper-listbox></paper-dropdown-menu></div></template></dom-module><script>Polymer({is:"ha-form-zwave-device",properties:{hass:{type:Object},entity:{type:Object},entityIgnored:{type:Boolean},entityPollingIntensity:{type:Number}},loadEntity:function(t){this.entity=t;var i=this;return this.hass.callApi("GET","config/zwave/device_config/"+t.entity_id).then(function(t){i.entityIgnored=t.ignored||!1,i.entityPollingIntensity=t.polling_intensity||0})},saveEntity:function(){var t={ignored:this.entityIgnored,polling_intensity:this.entityPollingIntensity};return this.hass.callApi("POST","config/zwave/device_config/"+this.entity.entity_id,t)}});</script><dom-module id="ha-config-section-zwave" assetpath="z-wave/"><template><ha-config-section is-wide="[[isWide]]"><span slot="header">Z-Wave</span> <span slot="introduction">Z-Wave devices contain a lot of options. These controls will allow you to get into the nitty gritty details.</span><ha-entity-config hass="[[hass]]" entities="[[entities]]" config="[[entityConfig]]"></ha-entity-config></ha-config-section></template></dom-module><script>Polymer({is:"ha-config-section-zwave",properties:{hass:{type:Object},isWide:{type:Boolean,value:!1},entities:{type:Array,computed:"computeEntities(hass)"},entityConfig:{type:Object,value:{component:"ha-form-zwave-device",computeSelectCaption:function(t){return window.hassUtil.computeStateName(t)+" ("+window.hassUtil.computeDomain(t)+")"}}}},computeEntities:function(t){return Object.keys(t.states).map(function(e){return t.states[e]}).filter(function(t){return!t.attributes.hidden&&"node_id"in t.attributes}).sort(window.hassUtil.sortByName)}});</script></div><dom-module id="ha-panel-config"><template><style include="iron-flex ha-style">.content{padding-bottom:32px;}.border{margin:32px auto 0;border-bottom:1px solid rgba(0, 0, 0, 0.12);max-width:1040px;}.narrow .border{max-width:640px;}</style><iron-media-query query="(min-width: 1040px)" query-matches="{{wide}}"></iron-media-query><iron-media-query query="(min-width: 1296px)" query-matches="{{wideSidebar}}"></iron-media-query><app-header-layout has-scrolling-region=""><app-header slot="header" fixed=""><app-toolbar><ha-menu-button narrow="[[narrow]]" show-menu="[[showMenu]]"></ha-menu-button><div main-title="">Configuration</div></app-toolbar></app-header><div class$="[[computeClasses(isWide)]]"><ha-config-section-group is-wide="[[isWide]]" hass="[[hass]]"></ha-config-section-group><ha-config-section-core is-wide="[[isWide]]" hass="[[hass]]"></ha-config-section-core><template is="dom-if" if="[[computeIsHassbianLoaded(hass)]]"><div class="border"></div><ha-config-section-hassbian is-wide="[[isWide]]" hass="[[hass]]"></ha-config-section-hassbian></template><template is="dom-if" if="[[computeIsZwaveLoaded(hass)]]"><div class="border"></div><ha-config-section-zwave is-wide="[[isWide]]" hass="[[hass]]"></ha-config-section-zwave></template></div></app-header-layout></template></dom-module><script>Polymer({is:"ha-panel-config",properties:{hass:{type:Object},narrow:{type:Boolean},showMenu:{type:Boolean,value:!1},wide:{type:Boolean},wideSidebar:{type:Boolean},isWide:{type:Boolean,computed:"computeIsWide(showMenu, wideSidebar, wide)"}},computeIsWide:function(e,o,n){return e?o:n},computeClasses:function(e){return e?"content":"content narrow"},computeIsHassbianLoaded:function(e){return window.hassUtil.isComponentLoaded(e,"config.hassbian")},computeIsZwaveLoaded:function(e){return window.hassUtil.isComponentLoaded(e,"config.zwave")}});</script></body></html>
\ No newline at end of file
diff --git a/homeassistant/components/frontend/www_static/panels/ha-panel-config.html.gz b/homeassistant/components/frontend/www_static/panels/ha-panel-config.html.gz
index dd1def9b1bd6c9638625211678420fb8985990e9..7325c68ccac6295aec5f673a61d70cb18d753626 100644
Binary files a/homeassistant/components/frontend/www_static/panels/ha-panel-config.html.gz and b/homeassistant/components/frontend/www_static/panels/ha-panel-config.html.gz differ
diff --git a/homeassistant/components/frontend/www_static/panels/ha-panel-dev-service.html b/homeassistant/components/frontend/www_static/panels/ha-panel-dev-service.html
index bcd3161b05133aa646a5a5cbadc29a757b06268f..0f7153098541f8dab1b8004f2c3ad9a9d4c0f6d9 100644
--- a/homeassistant/components/frontend/www_static/panels/ha-panel-dev-service.html
+++ b/homeassistant/components/frontend/www_static/panels/ha-panel-dev-service.html
@@ -1,5 +1,5 @@
-<html><head></head><body><div hidden="" by-polymer-bundler=""><script>window.vaadin=window.vaadin||{},vaadin.elements=vaadin.elements||{},vaadin.elements.combobox=vaadin.elements.combobox||{},vaadin.elements.combobox.DropdownBehavior={properties:{opened:{type:Boolean,notify:!0,value:!1,reflectToAttribute:!0,observer:"_openedChanged"},disabled:{type:Boolean,value:!1,reflectToAttribute:!0},readonly:{type:Boolean,value:!1,reflectToAttribute:!0}},open:function(){this.disabled||this.readonly||(this.opened=!0)},close:function(){this.opened=!1},detached:function(){this.close()},_openedChanged:function(e,t){void 0!==t&&(this.opened?this._open():this._close())},_open:function(){this.$.overlay._moveTo(document.body),this._addOutsideClickListener(),this.$.overlay.touchDevice||this.inputElement.focused||this.inputElement.focus(),this.fire("vaadin-dropdown-opened")},_close:function(){this.$.overlay._moveTo(this.root),this._removeOutsideClickListener(),this.fire("vaadin-dropdown-closed")},_outsideClickListener:function(e){var t=Polymer.dom(e).path;t.indexOf(this)<0&&t.indexOf(this.$.overlay)<0&&(this.opened=!1)},_addOutsideClickListener:function(){this.$.overlay.touchDevice?(Polymer.Gestures.add(document,"tap",null),document.addEventListener("tap",this._outsideClickListener.bind(this),!0)):document.addEventListener("click",this._outsideClickListener.bind(this),!0)},_removeOutsideClickListener:function(){this.$.overlay.touchDevice?(Polymer.Gestures.remove(document,"tap",null),document.removeEventListener("tap",this._outsideClickListener.bind(this),!0)):document.removeEventListener("click",this._outsideClickListener.bind(this),!0)}};</script><script>window.vaadin=window.vaadin||{},vaadin.elements=vaadin.elements||{},vaadin.elements.combobox=vaadin.elements.combobox||{},vaadin.elements.combobox.ComboBoxBehaviorImpl={properties:{items:{type:Array},allowCustomValue:{type:Boolean,value:!1},filteredItems:{type:Array},value:{type:String,observer:"_valueChanged",notify:!!Polymer.Element},_lastCommittedValue:String,hasValue:{type:Boolean,value:!1,readOnly:!0,reflectToAttribute:!0},loading:{type:Boolean,value:!1},_focusedIndex:{type:Number,value:-1},filter:{type:String,value:"",notify:!0},selectedItem:{type:Object,notify:!0},itemLabelPath:{type:String,value:"label"},itemValuePath:{type:String,value:"value"},inputElement:{type:HTMLElement,readOnly:!0},_toggleElement:Object,_clearElement:Object,_inputElementValue:String,_closeOnBlurIsPrevented:Boolean,_templatized:Boolean,_itemTemplate:Boolean,_previousDocumentPointerEvents:String},observers:["_filterChanged(filter, itemValuePath, itemLabelPath)","_itemsChanged(items.*, itemValuePath, itemLabelPath)","_filteredItemsChanged(filteredItems.*, itemValuePath, itemLabelPath)","_loadingChanged(loading)","_selectedItemChanged(selectedItem)"],listeners:{"vaadin-dropdown-opened":"_onOpened","vaadin-dropdown-closed":"_onClosed",keydown:"_onKeyDown",tap:"_onTap"},ready:function(){void 0===this.value&&(this.value=""),this._lastCommittedValue=this.value,Polymer.IronA11yAnnouncer.requestAvailability(),this.$.overlay.addEventListener("selection-changed",this._overlaySelectedItemChanged.bind(this))},_onBlur:function(){this._closeOnBlurIsPrevented||this.close()},_onOverlayDown:function(e){this.$.overlay.touchDevice&&e.target!==this.$.overlay.$.scroller&&(this._closeOnBlurIsPrevented=!0,this.inputElement.blur(),this._closeOnBlurIsPrevented=!1)},_onTap:function(e){this._closeOnBlurIsPrevented=!0;var t=Polymer.dom(e).path;-1!==t.indexOf(this._clearElement)?this._clear():-1!==t.indexOf(this._toggleElement)?this._toggle():-1!==t.indexOf(this.inputElement)&&this._openAsync(),this._closeOnBlurIsPrevented=!1},_onKeyDown:function(e){this._isEventKey(e,"down")?(this._closeOnBlurIsPrevented=!0,this._onArrowDown(),this._closeOnBlurIsPrevented=!1,e.preventDefault()):this._isEventKey(e,"up")?(this._closeOnBlurIsPrevented=!0,this._onArrowUp(),this._closeOnBlurIsPrevented=!1,e.preventDefault()):this._isEventKey(e,"enter")?this._onEnter(e):this._isEventKey(e,"esc")&&this._onEscape()},_isEventKey:function(e,t){return Polymer.IronA11yKeysBehavior.keyboardEventMatchesKeys(e,t)},_getItemLabel:function(e){return this.$.overlay.getItemLabel(e)},_getItemValue:function(e){var t=e?this.get(this.itemValuePath,e):void 0;return void 0===t&&(t=e?e.toString():""),t},_onArrowDown:function(){this.opened?this.$.overlay._items&&(this._focusedIndex=Math.min(this.$.overlay._items.length-1,this._focusedIndex+1),this._prefillFocusedItemLabel()):this.open()},_onArrowUp:function(){this.opened?(this._focusedIndex>-1?this._focusedIndex=Math.max(0,this._focusedIndex-1):this.$.overlay._items&&(this._focusedIndex=this.$.overlay._items.length-1),this._prefillFocusedItemLabel()):this.open()},_prefillFocusedItemLabel:function(){this._focusedIndex>-1&&(this._inputElementValue="",this.async(function(){this._inputElementValue=this._getItemLabel(this.$.overlay._focusedItem),this._setSelectionRange()},1))},_setSelectionRange:function(){this.inputElement.setSelectionRange&&this.inputElement.setSelectionRange(0,this._inputElementValue.length)},_onEnter:function(e){this.opened&&(this.allowCustomValue||""===this._inputElementValue||this._focusedIndex>-1)&&(this.close(),e.preventDefault())},_onEscape:function(){this.opened&&(this._focusedIndex>-1?(this._focusedIndex=-1,this._revertInputValue()):this.cancel())},_openAsync:function(){this.async(this.open)},_toggle:function(){this.opened?this.close():this.open()},_clear:function(){this.selectedItem=null,this.allowCustomValue&&(this.value=""),this.opened?this.close():this._detectAndDispatchChange()},cancel:function(){this._revertInputValueToValue(),this._lastCommittedValue=this.value,this.close()},_onOpened:function(){Polymer.flush&&Polymer.flush(),this.$.overlay.hidden=!this._hasItems(this.$.overlay._items)&&!this.loading,this.$.overlay.ensureItemsRendered(),this.$.overlay.updateViewportBoundaries(),this.$.overlay.async(this.$.overlay.adjustScrollPosition),this.$.overlay.async(this.$.overlay.notifyResize,1),this._previousDocumentPointerEvents=document.body.style.pointerEvents,document.body.style.pointerEvents="none",this._lastCommittedValue=this.value},_onClosed:function(){if(this._focusedIndex>-1){var e=this.$.overlay._items[this._focusedIndex];this.selectedItem!==e&&(this.selectedItem=e),this._inputElementValue=this._getItemLabel(this.selectedItem)}else if(""===this._inputElementValue)this._clear();else if(this.allowCustomValue){if(!this.fire("custom-value-set",this._inputElementValue,{cancelable:!0}).defaultPrevented){var t=this._inputElementValue;this.selectedItem=null,this.value=t}}else this._inputElementValue=this._getItemLabel(this.selectedItem);this._detectAndDispatchChange(),this._clearSelectionRange(),this.filter="",document.body.style.pointerEvents=this._previousDocumentPointerEvents},_inputValueChanged:function(e){-1!==Polymer.dom(e).path.indexOf(this.inputElement)&&(this._inputElementValue=this.inputElement.value,this._filterFromInput())},_filterFromInput:function(e){this.filter===this._inputElementValue?this._filterChanged(this.filter,this.itemValuePath,this.itemLabelPath):(this._userDefinedFilter=!0,this.filter=this._inputElementValue,this._userDefinedFilter=!1),this.opened||this.open()},_clearSelectionRange:function(){if((document.activeElement===this.inputElement||document.activeElement===this)&&this.inputElement.setSelectionRange){var e=this._inputElementValue?this._inputElementValue.length:0;this.inputElement.setSelectionRange(e,e)}},_filterChanged:function(e,t,i){void 0!==e&&void 0!==t&&void 0!==i&&this.items&&(this.filteredItems=this._filterItems(this.items,e))},_loadingChanged:function(e){e&&(this._focusedIndex=-1)},_revertInputValue:function(){""!==this.filter?this._inputElementValue=this.filter:this._revertInputValueToValue(),this._clearSelectionRange()},_revertInputValueToValue:function(){this.allowCustomValue&&!this.selectedItem?this._inputElementValue=this.value:this._inputElementValue=this._getItemLabel(this.selectedItem)},_selectedItemChanged:function(e){if(this.filteredItems){if(null===e||void 0===e)this.allowCustomValue||(this.value=""),this._setHasValue(""!==this.value),this._inputElementValue=this.value;else{var t=this._getItemValue(e);this.value!==t&&(this.value=t),this._setHasValue(!0),this._inputElementValue=this._getItemLabel(e),this.inputElement&&(this.inputElement.value=this._inputElementValue)}this.$.overlay._selectedItem=e,this._focusedIndex=this.filteredItems.indexOf(e)}},_valueChanged:function(e){if(this._isValidValue(e)){if(this._getItemValue(this.selectedItem)!==e){var t=this._indexOfValue(e,this.filteredItems);this.selectedItem=t>=0?this.filteredItems[t]:null}else var i=this.selectedItem;!i&&this.allowCustomValue&&(this._inputElementValue=e),this._setHasValue(""!==this.value)}else this.selectedItem=null;this._lastCommittedValue=void 0},_detectAndDispatchChange:function(){this.value!==this._lastCommittedValue&&(this.fire("change",void 0,{bubbles:!0}),this._lastCommittedValue=this.value)},_itemsChanged:function(e,t,i){if(void 0!==e&&void 0!==t&&void 0!==i&&("items"===e.path||"items.splices"===e.path)){this.filteredItems=this.items?this.items.slice(0):this.items;var n=this._indexOfValue(this.value,this.items);this._focusedIndex=n;var s=n>-1&&this.items[n];s&&(this.selectedItem=s)}},_filteredItemsChanged:function(e,t,i){void 0!==e&&void 0!==t&&void 0!==i&&("filteredItems"!==e.path&&"filteredItems.splices"!==e.path||(this._setOverlayItems(this.filteredItems),this._focusedIndex=this.opened||this._userDefinedFilter?this.$.overlay.indexOfLabel(this.filter):this._indexOfValue(this.value,this.filteredItems),this.async(function(){this.$.overlay.notifyResize()},1)))},_filterItems:function(e,t){return e?e.filter(function(e){return t=t?t.toString().toLowerCase():"",this._getItemLabel(e).toString().toLowerCase().indexOf(t)>-1}.bind(this)):e},_setOverlayItems:function(e){this.$.overlay.notifyPath("_items",void 0),this.$.overlay.set("_items",e),this.$.overlay.hidden=!this._hasItems(e),this.$.overlay.notifyResize()},_hasItems:function(e){return e&&e.length},_indexOfValue:function(e,t){var i=this;if(t&&this._isValidValue(e))for(var n=0;n<t.length;n++)if(i._getItemValue(t[n])===e)return n;return-1},_isValidValue:function(e){return void 0!==e&&null!==e},_overlaySelectedItemChanged:function(e){this.selectedItem!==e.detail.item&&(this.selectedItem=e.detail.item),this.opened&&this.close(),e.stopPropagation()},_getValidity:function(){if(this._bindableInput.validate)return this._bindableInput.validate()},get _instanceProps(){return{item:!0,index:!0,selected:!0,focused:!0}},_ensureTemplatized:function(){this._templatized||(this._templatized=!0,this._itemTemplate=Polymer.dom(this).querySelector("template"),this._itemTemplate&&this.templatize(this._itemTemplate))},created:function(){this._parentModel=!0},_forwardHostPropV2:function(e,t){this._forwardParentProp(e,t),this._forwardParentPath(e,t)},_forwardParentProp:function(e,t){var i=this.$.overlay.$.selector.querySelectorAll("vaadin-combo-box-item");Array.prototype.forEach.call(i,function(i){i._itemTemplateInstance&&i._itemTemplateInstance.set(e,t)})},_forwardParentPath:function(e,t){var i=this.$.overlay.$.selector.querySelectorAll("vaadin-combo-box-item");Array.prototype.forEach.call(i,function(i){i._itemTemplateInstance&&i._itemTemplateInstance.notifyPath(e,t,!0)})},_preventInputBlur:function(){this._toggleElement&&this.listen(this._toggleElement,"down","_preventDefault"),this._clearElement&&this.listen(this._clearElement,"down","_preventDefault")},_restoreInputBlur:function(){this._toggleElement&&this.unlisten(this._toggleElement,"down","_preventDefault"),this._clearElement&&this.unlisten(this._clearElement,"down","_preventDefault")},_preventDefault:function(e){e.preventDefault()},_stopPropagation:function(e){e.stopPropagation()}},vaadin.elements.combobox.ComboBoxBehavior=[Polymer.IronFormElementBehavior,Polymer.Templatizer,vaadin.elements.combobox.DropdownBehavior,vaadin.elements.combobox.ComboBoxBehaviorImpl];</script><dom-module id="iron-list" assetpath="../../bower_components/iron-list/"><template><style>:host{display:block;}@media only screen and (-webkit-max-device-pixel-ratio: 1){:host{will-change:transform;}}#items{@apply --iron-list-items-container;position:relative;}:host(:not([grid])) #items > ::slotted(*){width:100%;}#items > ::slotted(*){box-sizing:border-box;margin:0;position:absolute;top:0;will-change:transform;}</style><array-selector id="selector" items="{{items}}" selected="{{selectedItems}}" selected-item="{{selectedItem}}"></array-selector><div id="items"><slot></slot></div></template></dom-module><script>!function(){var t=navigator.userAgent.match(/iP(?:hone|ad;(?: U;)? CPU) OS (\d+)/),i=t&&t[1]>=8,e=null!=Polymer.flush,s=e?Polymer.Async.animationFrame:0,h=e?Polymer.Async.idlePeriod:1,l=e?Polymer.Async.microTask:2;Polymer.OptionalMutableDataBehavior||(Polymer.OptionalMutableDataBehavior={}),Polymer({is:"iron-list",properties:{items:{type:Array},maxPhysicalCount:{type:Number,value:500},as:{type:String,value:"item"},indexAs:{type:String,value:"index"},selectedAs:{type:String,value:"selected"},grid:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_gridChanged"},selectionEnabled:{type:Boolean,value:!1},selectedItem:{type:Object,notify:!0},selectedItems:{type:Object,notify:!0},multiSelection:{type:Boolean,value:!1},scrollOffset:{type:Number,value:0}},observers:["_itemsChanged(items.*)","_selectionEnabledChanged(selectionEnabled)","_multiSelectionChanged(multiSelection)","_setOverflow(scrollTarget, scrollOffset)"],behaviors:[Polymer.Templatizer,Polymer.IronResizableBehavior,Polymer.IronScrollTargetBehavior,Polymer.OptionalMutableDataBehavior],_ratio:.5,_scrollerPaddingTop:0,_scrollPosition:0,_physicalSize:0,_physicalAverage:0,_physicalAverageCount:0,_physicalTop:0,_virtualCount:0,_estScrollHeight:0,_scrollHeight:0,_viewportHeight:0,_viewportWidth:0,_physicalItems:null,_physicalSizes:null,_firstVisibleIndexVal:null,_collection:null,_lastVisibleIndexVal:null,_maxPages:2,_focusedItem:null,_focusedVirtualIndex:-1,_focusedPhysicalIndex:-1,_offscreenFocusedItem:null,_focusBackfillItem:null,_itemsPerRow:1,_itemWidth:0,_rowHeight:0,_templateCost:0,_parentModel:!0,get _physicalBottom(){return this._physicalTop+this._physicalSize},get _scrollBottom(){return this._scrollPosition+this._viewportHeight},get _virtualEnd(){return this._virtualStart+this._physicalCount-1},get _hiddenContentSize(){return(this.grid?this._physicalRows*this._rowHeight:this._physicalSize)-this._viewportHeight},get _itemsParent(){return Polymer.dom(Polymer.dom(this._userTemplate).parentNode)},get _maxScrollTop(){return this._estScrollHeight-this._viewportHeight+this._scrollOffset},get _maxVirtualStart(){var t=this._convertIndexToCompleteRow(this._virtualCount);return Math.max(0,t-this._physicalCount)},set _virtualStart(t){t=this._clamp(t,0,this._maxVirtualStart),this.grid&&(t-=t%this._itemsPerRow),this._virtualStartVal=t},get _virtualStart(){return this._virtualStartVal||0},set _physicalStart(t){(t%=this._physicalCount)<0&&(t=this._physicalCount+t),this.grid&&(t-=t%this._itemsPerRow),this._physicalStartVal=t},get _physicalStart(){return this._physicalStartVal||0},get _physicalEnd(){return(this._physicalStart+this._physicalCount-1)%this._physicalCount},set _physicalCount(t){this._physicalCountVal=t},get _physicalCount(){return this._physicalCountVal||0},get _optPhysicalSize(){return this.grid?this._estRowsInView*this._rowHeight*this._maxPages:0===this._viewportHeight?1/0:this._viewportHeight*this._maxPages},get _isVisible(){return Boolean(this.offsetWidth||this.offsetHeight)},get firstVisibleIndex(){var t=this._firstVisibleIndexVal;if(null==t){var i=this._physicalTop+this._scrollOffset;t=this._iterateItems(function(t,e){return(i+=this._getPhysicalSizeIncrement(t))>this._scrollPosition?this.grid?e-e%this._itemsPerRow:e:this.grid&&this._virtualCount-1===e?e-e%this._itemsPerRow:void 0})||0,this._firstVisibleIndexVal=t}return t},get lastVisibleIndex(){var t=this._lastVisibleIndexVal;if(null==t){if(this.grid)t=Math.min(this._virtualCount,this.firstVisibleIndex+this._estRowsInView*this._itemsPerRow-1);else{var i=this._physicalTop+this._scrollOffset;this._iterateItems(function(e,s){i<this._scrollBottom&&(t=s),i+=this._getPhysicalSizeIncrement(e)})}this._lastVisibleIndexVal=t}return t},get _defaultScrollTarget(){return this},get _virtualRowCount(){return Math.ceil(this._virtualCount/this._itemsPerRow)},get _estRowsInView(){return Math.ceil(this._viewportHeight/this._rowHeight)},get _physicalRows(){return Math.ceil(this._physicalCount/this._itemsPerRow)},get _scrollOffset(){return this._scrollerPaddingTop+this.scrollOffset},ready:function(){this.addEventListener("focus",this._didFocus.bind(this),!0)},attached:function(){this._debounceRender(this._render,s),this.listen(this,"iron-resize","_resizeHandler"),this.listen(this,"keydown","_keydownHandler")},detached:function(){this.unlisten(this,"iron-resize","_resizeHandler"),this.unlisten(this,"keydown","_keydownHandler")},_setOverflow:function(t){this.style.webkitOverflowScrolling=t===this?"touch":"",this.style.overflowY=t===this?"auto":"",this._lastVisibleIndexVal=null,this._firstVisibleIndexVal=null,this._debounceRender(this._render,s)},updateViewportBoundaries:function(){var t=window.getComputedStyle(this);this._scrollerPaddingTop=this.scrollTarget===this?0:parseInt(t["padding-top"],10),this._isRTL=Boolean("rtl"===t.direction),this._viewportWidth=this.$.items.offsetWidth,this._viewportHeight=this._scrollTargetHeight,this.grid&&this._updateGridMetrics()},_scrollHandler:function(){var t=Math.max(0,Math.min(this._maxScrollTop,this._scrollTop)),i=t-this._scrollPosition,e=i>=0;if(this._scrollPosition=t,this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null,Math.abs(i)>this._physicalSize&&this._physicalSize>0){i-=this._scrollOffset;var s=Math.round(i/this._physicalAverage)*this._itemsPerRow;this._virtualStart=this._virtualStart+s,this._physicalStart=this._physicalStart+s,this._physicalTop=Math.floor(this._virtualStart/this._itemsPerRow)*this._physicalAverage,this._update()}else if(this._physicalCount>0){var h=this._getReusables(e);e?(this._physicalTop=h.physicalTop,this._virtualStart=this._virtualStart+h.indexes.length,this._physicalStart=this._physicalStart+h.indexes.length):(this._virtualStart=this._virtualStart-h.indexes.length,this._physicalStart=this._physicalStart-h.indexes.length),this._update(h.indexes,e?null:h.indexes),this._debounceRender(this._increasePoolIfNeeded.bind(this,0),l)}},_getReusables:function(t){var i,e,s,h=this,l=[],r=this._hiddenContentSize*this._ratio,o=this._virtualStart,n=this._virtualEnd,a=this._physicalCount,c=this._physicalTop+this._scrollOffset,_=this._physicalBottom+this._scrollOffset,u=this._scrollTop,d=this._scrollBottom;for(t?(i=this._physicalStart,this._physicalEnd,e=u-c):(i=this._physicalEnd,this._physicalStart,e=_-d);;){if(s=h._getPhysicalSizeIncrement(i),e-=s,l.length>=a||e<=r)break;if(t){if(n+l.length+1>=h._virtualCount)break;if(c+s>=u-h._scrollOffset)break;l.push(i),c+=s,i=(i+1)%a}else{if(o-l.length<=0)break;if(c+h._physicalSize-s<=d)break;l.push(i),c-=s,i=0===i?a-1:i-1}}return{indexes:l,physicalTop:c-this._scrollOffset}},_update:function(t,i){var e=this;if(!(t&&0===t.length||0===this._physicalCount)){if(this._manageFocus(),this._assignModels(t),this._updateMetrics(t),i)for(;i.length;){var s=i.pop();e._physicalTop-=e._getPhysicalSizeIncrement(s)}this._positionItems(),this._updateScrollerSize()}},_createPool:function(t){var i=this;this._ensureTemplatized();var e,s,h=new Array(t);for(e=0;e<t;e++)s=i.stamp(null),h[e]=s.root.querySelector("*"),i._itemsParent.appendChild(s.root);return h},_isClientFull:function(){return 0!=this._scrollBottom&&this._physicalBottom-1>=this._scrollBottom&&this._physicalTop<=this._scrollPosition},_increasePoolIfNeeded:function(t){var i=this._clamp(this._physicalCount+t,3,this._virtualCount-this._virtualStart);if(i=this._convertIndexToCompleteRow(i),this.grid){var e=i%this._itemsPerRow;e&&i-e<=this._physicalCount&&(i+=this._itemsPerRow),i-=e}var s=i-this._physicalCount,r=Math.round(.5*this._physicalCount);if(!(s<0)){if(s>0){var o=window.performance.now();[].push.apply(this._physicalItems,this._createPool(s)),[].push.apply(this._physicalSizes,new Array(s)),this._physicalCount=this._physicalCount+s,this._physicalStart>this._physicalEnd&&this._isIndexRendered(this._focusedVirtualIndex)&&this._getPhysicalIndex(this._focusedVirtualIndex)<this._physicalEnd&&(this._physicalStart=this._physicalStart+s),this._update(),this._templateCost=(window.performance.now()-o)/s,r=Math.round(.5*this._physicalCount)}this._virtualEnd>=this._virtualCount-1||0===r||(this._isClientFull()?this._physicalSize<this._optPhysicalSize&&this._debounceRender(this._increasePoolIfNeeded.bind(this,this._clamp(Math.round(50/this._templateCost),1,r)),h):this._debounceRender(this._increasePoolIfNeeded.bind(this,r),l))}},_render:function(){if(this.isAttached&&this._isVisible)if(0!==this._physicalCount){var t=this._getReusables(!0);this._physicalTop=t.physicalTop,this._virtualStart=this._virtualStart+t.indexes.length,this._physicalStart=this._physicalStart+t.indexes.length,this._update(t.indexes),this._update(),this._increasePoolIfNeeded(0)}else this._virtualCount>0&&(this.updateViewportBoundaries(),this._increasePoolIfNeeded(3))},_ensureTemplatized:function(){if(!this.ctor){this._userTemplate=this.queryEffectiveChildren("template"),this._userTemplate||console.warn("iron-list requires a template to be provided in light-dom");var t={};t.__key__=!0,t[this.as]=!0,t[this.indexAs]=!0,t[this.selectedAs]=!0,t.tabIndex=!0,this._instanceProps=t,this.templatize(this._userTemplate,this.mutableData)}},_gridChanged:function(t,i){void 0!==i&&(this.notifyResize(),Polymer.flush?Polymer.flush():Polymer.dom.flush(),t&&this._updateGridMetrics())},_itemsChanged:function(t){if("items"===t.path)this._virtualStart=0,this._physicalTop=0,this._virtualCount=this.items?this.items.length:0,this._collection=this.items&&Polymer.Collection?Polymer.Collection.get(this.items):null,this._physicalIndexForKey={},this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null,this._physicalCount=this._physicalCount||0,this._physicalItems=this._physicalItems||[],this._physicalSizes=this._physicalSizes||[],this._physicalStart=0,this._scrollTop>this._scrollOffset&&this._resetScrollPosition(0),this._removeFocusedItem(),this._debounceRender(this._render,s);else if("items.splices"===t.path){this._adjustVirtualIndex(t.value.indexSplices),this._virtualCount=this.items?this.items.length:0;var i=t.value.indexSplices.some(function(t){return this._isIndexRendered(t.index)},this);this._isClientFull()&&!i||this._debounceRender(this._render,s)}else"items.length"!==t.path&&this._forwardItemPath(t.path,t.value)},_forwardItemPath:function(t,i){var s=(t=t.slice(6)).indexOf(".")+1;0===s&&(s=t.length);var h,l,r=e?parseInt(t.substring(0,s),10):parseInt(t.substring(1,s),10),o=this._offscreenFocusedItem,n=this._isIndexRendered(r);n?(l=this._getPhysicalIndex(r),h=this.modelForElement(this._physicalItems[l])):o&&(h=this.modelForElement(o)),h&&h[this.indexAs]===r&&(t=t.substring(s),t=this.as+(t?"."+t:""),e?h._setPendingPropertyOrPath(t,i,!1,!0):h.notifyPath(t,i,!0),h._flushProperties&&h._flushProperties(!0),n&&(this._updateMetrics([l]),this._positionItems(),this._updateScrollerSize()))},_adjustVirtualIndex:function(t){t.forEach(function(t){if(t.removed.forEach(this._removeItem,this),t.index<this._virtualStart){var i=Math.max(t.addedCount-t.removed.length,t.index-this._virtualStart);this._virtualStart=this._virtualStart+i,this._focusedVirtualIndex>=0&&(this._focusedVirtualIndex=this._focusedVirtualIndex+i)}},this)},_removeItem:function(t){this.$.selector.deselect(t),this._focusedItem&&this.modelForElement(this._focusedItem)[this.as]===t&&(this._removeFocusedItem(),document.activeElement&&document.activeElement.blur&&document.activeElement.blur())},_iterateItems:function(t,i){var e,s,h,l,r=this;if(2===arguments.length&&i){for(l=0;l<i.length;l++)if(e=i[l],s=r._computeVidx(e),null!=(h=t.call(r,e,s)))return h}else{for(e=this._physicalStart,s=this._virtualStart;e<this._physicalCount;e++,s++)if(null!=(h=t.call(r,e,s)))return h;for(e=0;e<this._physicalStart;e++,s++)if(null!=(h=t.call(r,e,s)))return h}},_computeVidx:function(t){return t>=this._physicalStart?this._virtualStart+(t-this._physicalStart):this._virtualStart+(this._physicalCount-this._physicalStart)+t},_assignModels:function(t){this._iterateItems(function(t,i){var e=this._physicalItems[t],s=this.items&&this.items[i];if(null!=s){var h=this.modelForElement(e);h.__key__=this._collection?this._collection.getKey(s):null,this._forwardProperty(h,this.as,s),this._forwardProperty(h,this.selectedAs,this.$.selector.isSelected(s)),this._forwardProperty(h,this.indexAs,i),this._forwardProperty(h,"tabIndex",this._focusedVirtualIndex===i?0:-1),this._physicalIndexForKey[h.__key__]=t,h._flushProperties&&h._flushProperties(!0),e.removeAttribute("hidden")}else e.setAttribute("hidden","")},t)},_updateMetrics:function(t){Polymer.flush?Polymer.flush():Polymer.dom.flush();var i=0,e=0,s=this._physicalAverageCount,h=this._physicalAverage;this._iterateItems(function(t,s){e+=this._physicalSizes[t]||0,this._physicalSizes[t]=this._physicalItems[t].offsetHeight,i+=this._physicalSizes[t],this._physicalAverageCount+=this._physicalSizes[t]?1:0},t),this.grid?(this._updateGridMetrics(),this._physicalSize=Math.ceil(this._physicalCount/this._itemsPerRow)*this._rowHeight):(e=1===this._itemsPerRow?e:Math.ceil(this._physicalCount/this._itemsPerRow)*this._rowHeight,this._physicalSize=this._physicalSize+i-e,this._itemsPerRow=1),this._physicalAverageCount!==s&&(this._physicalAverage=Math.round((h*s+i)/this._physicalAverageCount))},_updateGridMetrics:function(){this._itemWidth=this._physicalCount>0?this._physicalItems[0].getBoundingClientRect().width:200,this._rowHeight=this._physicalCount>0?this._physicalItems[0].offsetHeight:200,this._itemsPerRow=this._itemWidth?Math.floor(this._viewportWidth/this._itemWidth):this._itemsPerRow},_positionItems:function(){this._adjustScrollPosition();var t=this._physicalTop;if(this.grid){var i=this._itemsPerRow*this._itemWidth,e=(this._viewportWidth-i)/2;this._iterateItems(function(i,s){var h=s%this._itemsPerRow,l=Math.floor(h*this._itemWidth+e);this._isRTL&&(l*=-1),this.translate3d(l+"px",t+"px",0,this._physicalItems[i]),this._shouldRenderNextRow(s)&&(t+=this._rowHeight)})}else this._iterateItems(function(i,e){this.translate3d(0,t+"px",0,this._physicalItems[i]),t+=this._physicalSizes[i]})},_getPhysicalSizeIncrement:function(t){return this.grid?this._computeVidx(t)%this._itemsPerRow!=this._itemsPerRow-1?0:this._rowHeight:this._physicalSizes[t]},_shouldRenderNextRow:function(t){return t%this._itemsPerRow==this._itemsPerRow-1},_adjustScrollPosition:function(){var t=0===this._virtualStart?this._physicalTop:Math.min(this._scrollPosition+this._physicalTop,0);if(0!==t){this._physicalTop=this._physicalTop-t;var e=this._scrollTop;!i&&e>0&&this._resetScrollPosition(e-t)}},_resetScrollPosition:function(t){this.scrollTarget&&t>=0&&(this._scrollTop=t,this._scrollPosition=this._scrollTop)},_updateScrollerSize:function(t){this.grid?this._estScrollHeight=this._virtualRowCount*this._rowHeight:this._estScrollHeight=this._physicalBottom+Math.max(this._virtualCount-this._physicalCount-this._virtualStart,0)*this._physicalAverage,((t=(t=(t=t||0===this._scrollHeight)||this._scrollPosition>=this._estScrollHeight-this._physicalSize)||this.grid&&this.$.items.style.height<this._estScrollHeight)||Math.abs(this._estScrollHeight-this._scrollHeight)>=this._optPhysicalSize)&&(this.$.items.style.height=this._estScrollHeight+"px",this._scrollHeight=this._estScrollHeight)},scrollToItem:function(t){return this.scrollToIndex(this.items.indexOf(t))},scrollToIndex:function(t){var i=this;if(!("number"!=typeof t||t<0||t>this.items.length-1)&&(Polymer.flush?Polymer.flush():Polymer.dom.flush(),0!==this._physicalCount)){t=this._clamp(t,0,this._virtualCount-1),(!this._isIndexRendered(t)||t>=this._maxVirtualStart)&&(this._virtualStart=this.grid?t-2*this._itemsPerRow:t-1),this._manageFocus(),this._assignModels(),this._updateMetrics(),this._physicalTop=Math.floor(this._virtualStart/this._itemsPerRow)*this._physicalAverage;for(var e=this._physicalStart,s=this._virtualStart,h=0,l=this._hiddenContentSize;s<t&&h<=l;)h+=i._getPhysicalSizeIncrement(e),e=(e+1)%i._physicalCount,s++;this._updateScrollerSize(!0),this._positionItems(),this._resetScrollPosition(this._physicalTop+this._scrollOffset+h),this._increasePoolIfNeeded(0),this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null}},_resetAverage:function(){this._physicalAverage=0,this._physicalAverageCount=0},_resizeHandler:function(){this._debounceRender(function(){this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null;Math.abs(this._viewportHeight-this._scrollTargetHeight);this.updateViewportBoundaries(),this._isVisible?(this.toggleScrollListener(!0),this._resetAverage(),this._render()):this.toggleScrollListener(!1)},s)},selectItem:function(t){return this.selectIndex(this.items.indexOf(t))},selectIndex:function(t){if(!(t<0||t>=this._virtualCount)){if(!this.multiSelection&&this.selectedItem&&this.clearSelection(),this._isIndexRendered(t)){var i=this.modelForElement(this._physicalItems[this._getPhysicalIndex(t)]);i&&(i[this.selectedAs]=!0),this.updateSizeForIndex(t)}this.$.selector.selectIndex?this.$.selector.selectIndex(t):this.$.selector.select(this.items[t])}},deselectItem:function(t){return this.deselectIndex(this.items.indexOf(t))},deselectIndex:function(t){t<0||t>=this._virtualCount||(this._isIndexRendered(t)&&(this.modelForElement(this._physicalItems[this._getPhysicalIndex(t)])[this.selectedAs]=!1,this.updateSizeForIndex(t)),this.$.selector.deselectIndex?this.$.selector.deselectIndex(t):this.$.selector.deselect(this.items[t]))},toggleSelectionForItem:function(t){return this.toggleSelectionForIndex(this.items.indexOf(t))},toggleSelectionForIndex:function(t){(this.$.selector.isIndexSelected?this.$.selector.isIndexSelected(t):this.$.selector.isSelected(this.items[t]))?this.deselectIndex(t):this.selectIndex(t)},clearSelection:function(){this._iterateItems(function(t,i){this.modelForElement(this._physicalItems[t])[this.selectedAs]=!1}),this.$.selector.clearSelection()},_selectionEnabledChanged:function(t){(t?this.listen:this.unlisten).call(this,this,"tap","_selectionHandler")},_selectionHandler:function(t){var i=this.modelForElement(t.target);if(i){var e,s,h=Polymer.dom(t).path[0],l=this._itemsParent.node.domHost,r=Polymer.dom(l?l.root:document).activeElement,o=this._physicalItems[this._getPhysicalIndex(i[this.indexAs])];"input"!==h.localName&&"button"!==h.localName&&"select"!==h.localName&&(e=i.tabIndex,i.tabIndex=-100,s=r?r.tabIndex:-1,i.tabIndex=e,r&&o!==r&&o.contains(r)&&-100!==s||this.toggleSelectionForItem(i[this.as]))}},_multiSelectionChanged:function(t){this.clearSelection(),this.$.selector.multi=t},updateSizeForItem:function(t){return this.updateSizeForIndex(this.items.indexOf(t))},updateSizeForIndex:function(t){return this._isIndexRendered(t)?(this._updateMetrics([this._getPhysicalIndex(t)]),this._positionItems(),null):null},_manageFocus:function(){var t=this._focusedVirtualIndex;t>=0&&t<this._virtualCount?this._isIndexRendered(t)?this._restoreFocusedItem():this._createFocusBackfillItem():this._virtualCount>0&&this._physicalCount>0&&(this._focusedPhysicalIndex=this._physicalStart,this._focusedVirtualIndex=this._virtualStart,this._focusedItem=this._physicalItems[this._physicalStart])},_convertIndexToCompleteRow:function(t){return this._itemsPerRow=this._itemsPerRow||1,this.grid?Math.ceil(t/this._itemsPerRow)*this._itemsPerRow:t},_isIndexRendered:function(t){return t>=this._virtualStart&&t<=this._virtualEnd},_isIndexVisible:function(t){return t>=this.firstVisibleIndex&&t<=this.lastVisibleIndex},_getPhysicalIndex:function(t){return(this._physicalStart+(t-this._virtualStart))%this._physicalCount},focusItem:function(t){this._focusPhysicalItem(t)},_focusPhysicalItem:function(t){if(!(t<0||t>=this._virtualCount)){this._restoreFocusedItem(),this._isIndexRendered(t)||this.scrollToIndex(t);var i,e=this._physicalItems[this._getPhysicalIndex(t)],s=this.modelForElement(e);s.tabIndex=-100,-100===e.tabIndex&&(i=e),i||(i=Polymer.dom(e).querySelector('[tabindex="-100"]')),s.tabIndex=0,this._focusedVirtualIndex=t,i&&i.focus()}},_removeFocusedItem:function(){this._offscreenFocusedItem&&this._itemsParent.removeChild(this._offscreenFocusedItem),this._offscreenFocusedItem=null,this._focusBackfillItem=null,this._focusedItem=null,this._focusedVirtualIndex=-1,this._focusedPhysicalIndex=-1},_createFocusBackfillItem:function(){var t=this._focusedPhysicalIndex;if(!(this._offscreenFocusedItem||this._focusedVirtualIndex<0)){if(!this._focusBackfillItem){var i=this.stamp(null);this._focusBackfillItem=i.root.querySelector("*"),this._itemsParent.appendChild(i.root)}this._offscreenFocusedItem=this._physicalItems[t],this.modelForElement(this._offscreenFocusedItem).tabIndex=0,this._physicalItems[t]=this._focusBackfillItem,this._focusedPhysicalIndex=t,this.translate3d(0,"-10000px",0,this._offscreenFocusedItem)}},_restoreFocusedItem:function(){if(this._offscreenFocusedItem&&!(this._focusedVirtualIndex<0)){this._assignModels();var t=this._focusedPhysicalIndex,i=this._physicalItems[t];if(i){var e=this.modelForElement(i),s=this.modelForElement(this._offscreenFocusedItem);e[this.as]===s[this.as]?(this._focusBackfillItem=i,e.tabIndex=-1,this._physicalItems[t]=this._offscreenFocusedItem,this.translate3d(0,"-10000px",0,this._focusBackfillItem)):(this._removeFocusedItem(),this._focusBackfillItem=null),this._offscreenFocusedItem=null}}},_didFocus:function(t){var i=this.modelForElement(t.target),e=this.modelForElement(this._focusedItem),s=null!==this._offscreenFocusedItem,h=this._focusedVirtualIndex;i&&(e===i?this._isIndexVisible(h)||this.scrollToIndex(h):(this._restoreFocusedItem(),e&&(e.tabIndex=-1),i.tabIndex=0,h=i[this.indexAs],this._focusedVirtualIndex=h,this._focusedPhysicalIndex=this._getPhysicalIndex(h),this._focusedItem=this._physicalItems[this._focusedPhysicalIndex],s&&!this._offscreenFocusedItem&&this._update()))},_keydownHandler:function(t){switch(t.keyCode){case 40:t.preventDefault(),this._focusPhysicalItem(this._focusedVirtualIndex+(this.grid?this._itemsPerRow:1));break;case 39:this.grid&&this._focusPhysicalItem(this._focusedVirtualIndex+(this._isRTL?-1:1));break;case 38:this._focusPhysicalItem(this._focusedVirtualIndex-(this.grid?this._itemsPerRow:1));break;case 37:this.grid&&this._focusPhysicalItem(this._focusedVirtualIndex+(this._isRTL?1:-1));break;case 13:this._focusPhysicalItem(this._focusedVirtualIndex),this._selectionHandler(t)}},_clamp:function(t,i,e){return Math.min(e,Math.max(i,t))},_debounceRender:function(t,i){e?(this._renderDebouncer=Polymer.Debouncer.debounce(this._renderDebouncer,i,t.bind(this)),Polymer.enqueueDebouncer(this._renderDebouncer)):this._debounceTemplate(t)},_forwardProperty:function(t,i,s){e?t._setPendingProperty(i,s):t[i]=s},_forwardHostPropV2:function(t,i){(this._physicalItems||[]).concat([this._offscreenFocusedItem,this._focusBackfillItem]).forEach(function(e){e&&this.modelForElement(e).forwardHostProp(t,i)},this)},_notifyInstancePropV2:function(t,i,e){if(Polymer.Path.matches(this.as,i)){var s=t[this.indexAs];i==this.as&&(this.items[s]=e),this.notifyPath(Polymer.Path.translate(this.as,"items."+s,i),e)}},_getStampedChildren:function(){return this._physicalItems},_forwardInstancePath:function(t,i,e){0===i.indexOf(this.as+".")&&this.notifyPath("items."+t.__key__+"."+i.slice(this.as.length+1),e)},_forwardParentPath:function(t,i){(this._physicalItems||[]).concat([this._offscreenFocusedItem,this._focusBackfillItem]).forEach(function(e){e&&this.modelForElement(e).notifyPath(t,i,!0)},this)},_forwardParentProp:function(t,i){(this._physicalItems||[]).concat([this._offscreenFocusedItem,this._focusBackfillItem]).forEach(function(e){e&&(this.modelForElement(e)[t]=i)},this)}})}();</script><script>window.vaadin=window.vaadin||{},vaadin.elements=vaadin.elements||{},vaadin.elements.combobox=vaadin.elements.combobox||{},vaadin.elements.combobox.OverlayBehaviorImpl={properties:{positionTarget:{type:Object},verticalOffset:{type:Number,value:0},_alignedAbove:{type:Boolean,value:!1}},listeners:{"iron-resize":"_setPosition"},created:function(){this._boundSetPosition=this._setPosition.bind(this)},_unwrapIfNeeded:function(t){return Polymer.Settings.hasShadow&&!Polymer.Settings.nativeShadow?window.unwrap(t):t},_processPendingMutationObserversFor:function(t){window.CustomElements&&!Polymer.Settings.useNativeCustomElements&&CustomElements.takeRecords(t)},_moveTo:function(t){var e=this.parentNode;Polymer.dom(t).appendChild(this),e&&(this._processPendingMutationObserversFor(e),e.host&&!Polymer.Element&&Polymer.StyleTransformer.dom(this,e.host.is,this._scopeCssViaAttr,!0)),this._processPendingMutationObserversFor(this),t.host&&!Polymer.Element&&Polymer.StyleTransformer.dom(this,t.host.is,this._scopeCssViaAttr),t===document.body?(this.style.position=this._isPositionFixed(this.positionTarget)?"fixed":"absolute",window.addEventListener("scroll",this._boundSetPosition,!0),this._setPosition()):window.removeEventListener("scroll",this._boundSetPosition,!0)},_verticalOffset:function(t,e){return this._alignedAbove?-t.height:e.height+this.verticalOffset},_isPositionFixed:function(t){var e=this._getOffsetParent(t);return"fixed"===window.getComputedStyle(this._unwrapIfNeeded(t)).position||e&&this._isPositionFixed(e)},_getOffsetParent:function(t){if(t.assignedSlot)return t.assignedSlot.parentElement;if(t.parentElement)return t.offsetParent;var e=Polymer.dom(t).parentNode;return e&&11===e.nodeType&&e.host?e.host:void 0},_maxHeight:function(t){var e=Math.min(window.innerHeight,document.body.scrollHeight-document.body.scrollTop);return this._alignedAbove?Math.max(t.top-8+Math.min(document.body.scrollTop,0),116)+"px":Math.max(e-t.bottom-8,116)+"px"},_setPosition:function(t){if(t&&t.target){var e=t.target===document?document.body:t.target,i=this._unwrapIfNeeded(this.parentElement);if(!e.contains(this)&&!e.contains(this.positionTarget)||i!==document.body)return}var o=this.positionTarget.getBoundingClientRect();this._alignedAbove=this._shouldAlignAbove(),this.style.maxHeight=this._maxHeight(o),this.$.selector.style.maxHeight=this._maxHeight(o);var n=this.getBoundingClientRect();this._translateX=o.left-n.left+(this._translateX||0),this._translateY=o.top-n.top+(this._translateY||0)+this._verticalOffset(n,o);var s=window.devicePixelRatio||1;this._translateX=Math.round(this._translateX*s)/s,this._translateY=Math.round(this._translateY*s)/s,this.translate3d(this._translateX+"px",this._translateY+"px","0"),this.style.width=this.positionTarget.clientWidth+"px",this.updateViewportBoundaries()},_shouldAlignAbove:function(){return(window.innerHeight-this.positionTarget.getBoundingClientRect().bottom-Math.min(document.body.scrollTop,0))/window.innerHeight<.3}},vaadin.elements.combobox.OverlayBehavior=[Polymer.IronResizableBehavior,vaadin.elements.combobox.OverlayBehaviorImpl];</script><dom-module id="vaadin-combo-box-item" assetpath="../../bower_components/vaadin-combo-box/"><template><style>:host{display:block;}</style>[[label]]</template></dom-module><script>Polymer({is:"vaadin-combo-box-item",properties:{index:Number,item:Object,label:String,selected:{type:Boolean,value:!1,reflectToAttribute:!0},focused:{type:Boolean,value:!1,reflectToAttribute:!0},_itemTemplateInstance:Object},observers:['_updateTemplateInstanceVariable("index", index, _itemTemplateInstance)','_updateTemplateInstanceVariable("item", item, _itemTemplateInstance)','_updateTemplateInstanceVariable("selected", selected, _itemTemplateInstance)','_updateTemplateInstanceVariable("focused", focused, _itemTemplateInstance)'],attached:function(){if(!this._itemTemplateInstance){var e=this.domHost.dataHost||this.domHost.__dataHost;e._ensureTemplatized(),e._itemTemplate&&(this._itemTemplateInstance=e.stamp({}),Polymer.dom(this.root).textContent="",Polymer.dom(this.root).appendChild(this._itemTemplateInstance.root))}},_updateTemplateInstanceVariable:function(e,t,a){void 0!==e&&void 0!==t&&void 0!==a&&(a[e]=t)}});</script><dom-module id="vaadin-spinner" assetpath="../../bower_components/vaadin-combo-box/"><template><style>@keyframes vaadin-spin-360{100%{transform:rotate(1turn);}}:host{display:block;box-sizing:border-box;border:2px solid var(--primary-color, #03A9F4);border-radius:50%;border-right-color:transparent;border-top-color:transparent;content:"";height:24px;left:50%;margin-left:-12px;margin-top:-12px;position:absolute;top:50%;width:24px;pointer-events:none;opacity:0;}:host([active]){opacity:1;animation:vaadin-spin-360 400ms linear infinite;}</style></template><script>Polymer({is:"vaadin-spinner",properties:{active:{type:Boolean,reflectToAttribute:!0}}});</script></dom-module><dom-module id="vaadin-combo-box-overlay" assetpath="../../bower_components/vaadin-combo-box/"><template><style>:host{position:absolute;@apply --shadow-elevation-2dp;background:#fff;border-radius:0 0 2px 2px;top:0;left:0;pointer-events:auto;z-index:200;overflow:hidden;}#scroller{overflow:auto;max-height:var(--vaadin-combo-box-overlay-max-height, 65vh);transform:translate3d(0, 0, 0);-webkit-overflow-scrolling:touch;}#selector{--iron-list-items-container:{border-top:8px solid transparent;border-bottom:8px solid transparent;};}#selector vaadin-combo-box-item{cursor:pointer;padding:13px 16px;color:var(--primary-text-color);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}:host([opened][loading]){display:block !important;height:58px;}#selector:not([touch-device]) vaadin-combo-box-item:hover,
-      #selector vaadin-combo-box-item[focused]{background:#eee;}#selector vaadin-combo-box-item[selected]{color:var(--primary-color);}#selector vaadin-combo-box-item[hidden]{display:none;}</style><vaadin-spinner active="[[loading]]"></vaadin-spinner><div id="scroller" scroller="[[_getScroller()]]" on-tap="_stopPropagation" on-touchstart="_onTouchStart" on-touchend="_preventDefault" on-scroll="_onScroll" hidden$="[[loading]]"><iron-list id="selector" touch-device$="[[touchDevice]]" role="listbox" items="[[_items]]" scroll-target="[[_getScroller()]]"><template><vaadin-combo-box-item on-tap="_onTap" index="[[index]]" item="[[item]]" label="[[getItemLabel(item)]]" selected="[[_isItemSelected(item, _selectedItem)]]" role$="[[_getAriaRole(index)]]" aria-selected$="[[_getAriaSelected(_focusedIndex,index)]]" focused="[[_isItemFocused(_focusedIndex,index)]]"></vaadin-combo-box-item></template></iron-list></div></template></dom-module><script>Polymer({is:"vaadin-combo-box-overlay",behaviors:[vaadin.elements.combobox.OverlayBehavior],properties:{touchDevice:{type:Boolean,reflectToAttribute:!0,value:function(){try{return document.createEvent("TouchEvent"),!0}catch(t){return!1}}},loading:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"notifyResize"},_selectedItem:{type:Object},_items:{type:Object},_focusedIndex:{type:Number,notify:!0,value:-1,observer:"_focusedIndexChanged"},_focusedItem:{type:String,computed:"_getFocusedItem(_focusedIndex)"},_itemLabelPath:{type:String,value:"label"},_itemValuePath:{type:String,value:"value"},_notTapping:Boolean,_ignoreTaps:Boolean},ready:function(){this._patchWheelOverScrolling(),void 0!==this.$.selector._scroller&&(this.$.selector._scroller=this._getScroller()),this._patchIronListStamping(),/Trident/.test(navigator.userAgent)&&this.$.scroller.setAttribute("unselectable","on")},_patchIronListStamping:function(){var t=this.$.selector.stamp;this.$.selector.stamp=function(e){return null===e&&(e={}),t.call(this,e)}},_getFocusedItem:function(t){if(t>=0)return this._items[t]},_isItemSelected:function(t,e){return t===e},_onTap:function(t){this._notTapping||this._ignoreTaps||this.fire("selection-changed",{item:t.model.item})},_onTouchStart:function(){this._notTapping=!1,this.async(function(){this._notTapping=!0},300)},_onScroll:function(){this._ignoreTaps=!0,this.debounce("restore-taps",function(){this._ignoreTaps=!1},300)},indexOfLabel:function(t){var e=this;if(this._items&&t)for(var i=0;i<this._items.length;i++)if(e.getItemLabel(e._items[i]).toString().toLowerCase()===t.toString().toLowerCase())return i;return-1},getItemLabel:function(t){var e=t?this.get(this._itemLabelPath,t):void 0;return void 0===e&&(e=t?t.toString():""),e},_isItemFocused:function(t,e){return t==e},_getAriaSelected:function(t,e){return this._isItemFocused(t,e).toString()},_getAriaRole:function(t){return void 0!==t&&"option"},_focusedIndexChanged:function(t){t>=0&&this._scrollIntoView(t)},_scrollIntoView:function(t){var e=this._visibleItemsCount();if(void 0!==e){var i=t;t>this.$.selector.lastVisibleIndex-1?i=t-e+1:t>this.$.selector.firstVisibleIndex&&(i=this.$.selector.firstVisibleIndex),this.$.selector.scrollToIndex(Math.max(0,i));var o=this.$.selector._getPhysicalIndex(t),n=this.$.selector._physicalItems[o];if(n){var r=n.getBoundingClientRect(),s=this.$.scroller.getBoundingClientRect(),l=r.bottom-s.bottom+this._viewportTotalPaddingBottom;l>0&&(this.$.scroller.scrollTop+=l)}}},ensureItemsRendered:function(){this.$.selector._render()},adjustScrollPosition:function(){this._items&&this._scrollIntoView(this._focusedIndex)},_getScroller:function(){return this.$.scroller},_patchWheelOverScrolling:function(){var t=this.$.selector;t.addEventListener("wheel",function(e){var i=t._scroller||t.scrollTarget,o=0===i.scrollTop,n=i.scrollHeight-i.scrollTop-i.clientHeight<=1;o&&e.deltaY<0?e.preventDefault():n&&e.deltaY>0&&e.preventDefault()})},updateViewportBoundaries:function(){this._cachedViewportTotalPaddingBottom=void 0,this.$.selector.updateViewportBoundaries()},get _viewportTotalPaddingBottom(){if(void 0===this._cachedViewportTotalPaddingBottom){var t=window.getComputedStyle(this._unwrapIfNeeded(this.$.selector.$.items));this._cachedViewportTotalPaddingBottom=[t.paddingBottom,t.borderBottomWidth].map(function(t){return parseInt(t,10)}).reduce(function(t,e){return t+e})}return this._cachedViewportTotalPaddingBottom},_visibleItemsCount:function(){return this.$.selector.flushDebouncer("_debounceTemplate"),this.$.selector.scrollToIndex(this.$.selector.firstVisibleIndex),this.updateViewportBoundaries(),this.$.selector.lastVisibleIndex-this.$.selector.firstVisibleIndex+1},_selectItem:function(t){t="number"==typeof t?this._items[t]:t,this.$.selector.selectedItem!==t&&this.$.selector.selectItem(t)},_preventDefault:function(t){t.cancelable&&t.preventDefault()},_stopPropagation:function(t){t.stopPropagation()}});</script><dom-module id="vaadin-combo-box-shared-styles" assetpath="../../bower_components/vaadin-combo-box/"><template><style>:host([opened]){pointer-events:auto;}.rotate-on-open,
+<html><head></head><body><div hidden="" by-polymer-bundler=""><script>window.vaadin=window.vaadin||{},vaadin.elements=vaadin.elements||{},vaadin.elements.combobox=vaadin.elements.combobox||{},vaadin.elements.combobox.DropdownBehavior={properties:{opened:{type:Boolean,notify:!0,value:!1,reflectToAttribute:!0,observer:"_openedChanged"},disabled:{type:Boolean,value:!1,reflectToAttribute:!0},readonly:{type:Boolean,value:!1,reflectToAttribute:!0}},open:function(){this.disabled||this.readonly||(this.opened=!0)},close:function(){this.opened=!1},detached:function(){this.close()},_openedChanged:function(e,t){void 0!==t&&(this.opened?this._open():this._close())},_open:function(){this.$.overlay._moveTo(document.body),this._addOutsideClickListener(),this.$.overlay.touchDevice||this.inputElement.focused||this.inputElement.focus(),this.fire("vaadin-dropdown-opened")},_close:function(){this.$.overlay._moveTo(this.root),this._removeOutsideClickListener(),this.fire("vaadin-dropdown-closed")},_outsideClickListener:function(e){var t=Polymer.dom(e).path;t.indexOf(this)<0&&t.indexOf(this.$.overlay)<0&&(this.opened=!1)},_addOutsideClickListener:function(){this.$.overlay.touchDevice?(Polymer.Gestures.add(document,"tap",null),document.addEventListener("tap",this._outsideClickListener.bind(this),!0)):document.addEventListener("click",this._outsideClickListener.bind(this),!0)},_removeOutsideClickListener:function(){this.$.overlay.touchDevice?(Polymer.Gestures.remove(document,"tap",null),document.removeEventListener("tap",this._outsideClickListener.bind(this),!0)):document.removeEventListener("click",this._outsideClickListener.bind(this),!0)}};</script><script>window.vaadin=window.vaadin||{},vaadin.elements=vaadin.elements||{},vaadin.elements.combobox=vaadin.elements.combobox||{},vaadin.elements.combobox.ComboBoxBehaviorImpl={properties:{items:{type:Array},allowCustomValue:{type:Boolean,value:!1},filteredItems:{type:Array},value:{type:String,observer:"_valueChanged",notify:!!Polymer.Element},_lastCommittedValue:String,hasValue:{type:Boolean,value:!1,readOnly:!0,reflectToAttribute:!0},loading:{type:Boolean,value:!1},_focusedIndex:{type:Number,value:-1},filter:{type:String,value:"",notify:!0},selectedItem:{type:Object,notify:!0},itemLabelPath:{type:String,value:"label"},itemValuePath:{type:String,value:"value"},inputElement:{type:HTMLElement,readOnly:!0},_toggleElement:Object,_clearElement:Object,_inputElementValue:String,_closeOnBlurIsPrevented:Boolean,_templatized:Boolean,_itemTemplate:Boolean,_previousDocumentPointerEvents:String},observers:["_filterChanged(filter, itemValuePath, itemLabelPath)","_itemsChanged(items.*, itemValuePath, itemLabelPath)","_filteredItemsChanged(filteredItems.*, itemValuePath, itemLabelPath)","_loadingChanged(loading)","_selectedItemChanged(selectedItem)"],listeners:{"vaadin-dropdown-opened":"_onOpened","vaadin-dropdown-closed":"_onClosed",keydown:"_onKeyDown",tap:"_onTap"},ready:function(){void 0===this.value&&(this.value=""),this._lastCommittedValue=this.value,Polymer.IronA11yAnnouncer.requestAvailability(),this.$.overlay.addEventListener("selection-changed",this._overlaySelectedItemChanged.bind(this))},_onBlur:function(){this._closeOnBlurIsPrevented||this.close()},_onOverlayDown:function(e){this.$.overlay.touchDevice&&e.target!==this.$.overlay.$.scroller&&(this._closeOnBlurIsPrevented=!0,this.inputElement.blur(),this._closeOnBlurIsPrevented=!1)},_onTap:function(e){this._closeOnBlurIsPrevented=!0;var t=Polymer.dom(e).path;-1!==t.indexOf(this._clearElement)?this._clear():-1!==t.indexOf(this._toggleElement)?this._toggle():-1!==t.indexOf(this.inputElement)&&this._openAsync(),this._closeOnBlurIsPrevented=!1},_onKeyDown:function(e){this._isEventKey(e,"down")?(this._closeOnBlurIsPrevented=!0,this._onArrowDown(),this._closeOnBlurIsPrevented=!1,e.preventDefault()):this._isEventKey(e,"up")?(this._closeOnBlurIsPrevented=!0,this._onArrowUp(),this._closeOnBlurIsPrevented=!1,e.preventDefault()):this._isEventKey(e,"enter")?this._onEnter(e):this._isEventKey(e,"esc")&&this._onEscape()},_isEventKey:function(e,t){return Polymer.IronA11yKeysBehavior.keyboardEventMatchesKeys(e,t)},_getItemLabel:function(e){return this.$.overlay.getItemLabel(e)},_getItemValue:function(e){var t=e?this.get(this.itemValuePath,e):void 0;return void 0===t&&(t=e?e.toString():""),t},_onArrowDown:function(){this.opened?this.$.overlay._items&&(this._focusedIndex=Math.min(this.$.overlay._items.length-1,this._focusedIndex+1),this._prefillFocusedItemLabel()):this.open()},_onArrowUp:function(){this.opened?(this._focusedIndex>-1?this._focusedIndex=Math.max(0,this._focusedIndex-1):this.$.overlay._items&&(this._focusedIndex=this.$.overlay._items.length-1),this._prefillFocusedItemLabel()):this.open()},_prefillFocusedItemLabel:function(){this._focusedIndex>-1&&(this._inputElementValue="",this.async(function(){this._inputElementValue=this._getItemLabel(this.$.overlay._focusedItem),this._setSelectionRange()},1))},_setSelectionRange:function(){this.inputElement.setSelectionRange&&this.inputElement.setSelectionRange(0,this._inputElementValue.length)},_onEnter:function(e){this.opened&&(this.allowCustomValue||""===this._inputElementValue||this._focusedIndex>-1)&&(this.close(),e.preventDefault())},_onEscape:function(){this.opened&&(this._focusedIndex>-1?(this._focusedIndex=-1,this._revertInputValue()):this.cancel())},_openAsync:function(){this.async(this.open)},_toggle:function(){this.opened?this.close():this.open()},_clear:function(){this.selectedItem=null,this.allowCustomValue&&(this.value=""),this.opened?this.close():this._detectAndDispatchChange()},cancel:function(){this._revertInputValueToValue(),this._lastCommittedValue=this.value,this.close()},_onOpened:function(){Polymer.flush&&Polymer.flush(),this.$.overlay.hidden=!this._hasItems(this.$.overlay._items)&&!this.loading,this.$.overlay.ensureItemsRendered(),this.$.overlay.updateViewportBoundaries(),this.$.overlay.async(this.$.overlay.adjustScrollPosition),this.$.overlay.async(this.$.overlay.notifyResize,1),this._previousDocumentPointerEvents=document.body.style.pointerEvents,document.body.style.pointerEvents="none",this._lastCommittedValue=this.value},_onClosed:function(){if(this._focusedIndex>-1){var e=this.$.overlay._items[this._focusedIndex];this.selectedItem!==e&&(this.selectedItem=e),this._inputElementValue=this._getItemLabel(this.selectedItem)}else if(""===this._inputElementValue)this._clear();else if(this.allowCustomValue){if(!this.fire("custom-value-set",this._inputElementValue,{cancelable:!0}).defaultPrevented){var t=this._inputElementValue;this.selectedItem=null,this.value=t}}else this._inputElementValue=this._getItemLabel(this.selectedItem);this._detectAndDispatchChange(),this._clearSelectionRange(),this.filter="",document.body.style.pointerEvents=this._previousDocumentPointerEvents},_inputValueChanged:function(e){-1!==Polymer.dom(e).path.indexOf(this.inputElement)&&(this._inputElementValue=this.inputElement.value,this._filterFromInput())},_filterFromInput:function(e){this.filter===this._inputElementValue?this._filterChanged(this.filter,this.itemValuePath,this.itemLabelPath):(this._userDefinedFilter=!0,this.filter=this._inputElementValue,this._userDefinedFilter=!1),this.opened||this.open()},_clearSelectionRange:function(){if((document.activeElement===this.inputElement||document.activeElement===this)&&this.inputElement.setSelectionRange){var e=this._inputElementValue?this._inputElementValue.length:0;this.inputElement.setSelectionRange(e,e)}},_filterChanged:function(e,t,i){void 0!==e&&void 0!==t&&void 0!==i&&this.items&&(this.filteredItems=this._filterItems(this.items,e))},_loadingChanged:function(e){e&&(this._focusedIndex=-1)},_revertInputValue:function(){""!==this.filter?this._inputElementValue=this.filter:this._revertInputValueToValue(),this._clearSelectionRange()},_revertInputValueToValue:function(){this.allowCustomValue&&!this.selectedItem?this._inputElementValue=this.value:this._inputElementValue=this._getItemLabel(this.selectedItem)},_selectedItemChanged:function(e){if(this.filteredItems){if(null===e||void 0===e)this.allowCustomValue||(this.value=""),this._setHasValue(""!==this.value),this._inputElementValue=this.value;else{var t=this._getItemValue(e);this.value!==t&&(this.value=t),this._setHasValue(!0),this._inputElementValue=this._getItemLabel(e),this.inputElement&&(this.inputElement.value=this._inputElementValue)}this.$.overlay._selectedItem=e,this._focusedIndex=this.filteredItems.indexOf(e)}},_valueChanged:function(e){if(this._isValidValue(e)){if(this._getItemValue(this.selectedItem)!==e){var t=this._indexOfValue(e,this.filteredItems);this.selectedItem=t>=0?this.filteredItems[t]:null}else var i=this.selectedItem;!i&&this.allowCustomValue&&(this._inputElementValue=e),this._setHasValue(""!==this.value)}else this.selectedItem=null;this._lastCommittedValue=void 0},_detectAndDispatchChange:function(){this.value!==this._lastCommittedValue&&(this.fire("change",void 0,{bubbles:!0}),this._lastCommittedValue=this.value)},_itemsChanged:function(e,t,i){if(void 0!==e&&void 0!==t&&void 0!==i&&("items"===e.path||"items.splices"===e.path)){this.filteredItems=this.items?this.items.slice(0):this.items;var n=this._indexOfValue(this.value,this.items);this._focusedIndex=n;var s=n>-1&&this.items[n];s&&(this.selectedItem=s)}},_filteredItemsChanged:function(e,t,i){void 0!==e&&void 0!==t&&void 0!==i&&("filteredItems"!==e.path&&"filteredItems.splices"!==e.path||(this._setOverlayItems(this.filteredItems),this._focusedIndex=this.opened||this._userDefinedFilter?this.$.overlay.indexOfLabel(this.filter):this._indexOfValue(this.value,this.filteredItems),this.async(function(){this.$.overlay.notifyResize()},1)))},_filterItems:function(e,t){return e?e.filter(function(e){return t=t?t.toString().toLowerCase():"",this._getItemLabel(e).toString().toLowerCase().indexOf(t)>-1}.bind(this)):e},_setOverlayItems:function(e){this.$.overlay.notifyPath("_items",void 0),this.$.overlay.set("_items",e),this.$.overlay.hidden=!this._hasItems(e),this.$.overlay.notifyResize()},_hasItems:function(e){return e&&e.length},_indexOfValue:function(e,t){if(t&&this._isValidValue(e))for(var i=0;i<t.length;i++)if(this._getItemValue(t[i])===e)return i;return-1},_isValidValue:function(e){return void 0!==e&&null!==e},_overlaySelectedItemChanged:function(e){this.selectedItem!==e.detail.item&&(this.selectedItem=e.detail.item),this.opened&&this.close(),e.stopPropagation()},_getValidity:function(){if(this._bindableInput.validate)return this._bindableInput.validate()},get _instanceProps(){return{item:!0,index:!0,selected:!0,focused:!0}},_ensureTemplatized:function(){this._templatized||(this._templatized=!0,this._itemTemplate=Polymer.dom(this).querySelector("template"),this._itemTemplate&&this.templatize(this._itemTemplate))},created:function(){this._parentModel=!0},_forwardHostPropV2:function(e,t){this._forwardParentProp(e,t),this._forwardParentPath(e,t)},_forwardParentProp:function(e,t){var i=this.$.overlay.$.selector.querySelectorAll("vaadin-combo-box-item");Array.prototype.forEach.call(i,function(i){i._itemTemplateInstance&&i._itemTemplateInstance.set(e,t)})},_forwardParentPath:function(e,t){var i=this.$.overlay.$.selector.querySelectorAll("vaadin-combo-box-item");Array.prototype.forEach.call(i,function(i){i._itemTemplateInstance&&i._itemTemplateInstance.notifyPath(e,t,!0)})},_preventInputBlur:function(){this._toggleElement&&this.listen(this._toggleElement,"down","_preventDefault"),this._clearElement&&this.listen(this._clearElement,"down","_preventDefault")},_restoreInputBlur:function(){this._toggleElement&&this.unlisten(this._toggleElement,"down","_preventDefault"),this._clearElement&&this.unlisten(this._clearElement,"down","_preventDefault")},_preventDefault:function(e){e.preventDefault()},_stopPropagation:function(e){e.stopPropagation()}},vaadin.elements.combobox.ComboBoxBehavior=[Polymer.IronFormElementBehavior,Polymer.Templatizer,vaadin.elements.combobox.DropdownBehavior,vaadin.elements.combobox.ComboBoxBehaviorImpl];</script><dom-module id="iron-list" assetpath="../../bower_components/iron-list/"><template><style>:host{display:block;}@media only screen and (-webkit-max-device-pixel-ratio: 1){:host{will-change:transform;}}#items{@apply --iron-list-items-container;position:relative;}:host(:not([grid])) #items > ::slotted(*){width:100%;}#items > ::slotted(*){box-sizing:border-box;margin:0;position:absolute;top:0;will-change:transform;}</style><array-selector id="selector" items="{{items}}" selected="{{selectedItems}}" selected-item="{{selectedItem}}"></array-selector><div id="items"><slot></slot></div></template></dom-module><script>!function(){var t=navigator.userAgent.match(/iP(?:hone|ad;(?: U;)? CPU) OS (\d+)/),i=t&&t[1]>=8,e=null!=Polymer.flush,s=e?Polymer.Async.animationFrame:0,h=e?Polymer.Async.idlePeriod:1,l=e?Polymer.Async.microTask:2;Polymer.OptionalMutableDataBehavior||(Polymer.OptionalMutableDataBehavior={}),Polymer({is:"iron-list",properties:{items:{type:Array},as:{type:String,value:"item"},indexAs:{type:String,value:"index"},selectedAs:{type:String,value:"selected"},grid:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_gridChanged"},selectionEnabled:{type:Boolean,value:!1},selectedItem:{type:Object,notify:!0},selectedItems:{type:Object,notify:!0},multiSelection:{type:Boolean,value:!1},scrollOffset:{type:Number,value:0}},observers:["_itemsChanged(items.*)","_selectionEnabledChanged(selectionEnabled)","_multiSelectionChanged(multiSelection)","_setOverflow(scrollTarget, scrollOffset)"],behaviors:[Polymer.Templatizer,Polymer.IronResizableBehavior,Polymer.IronScrollTargetBehavior,Polymer.OptionalMutableDataBehavior],_ratio:.5,_scrollerPaddingTop:0,_scrollPosition:0,_physicalSize:0,_physicalAverage:0,_physicalAverageCount:0,_physicalTop:0,_virtualCount:0,_estScrollHeight:0,_scrollHeight:0,_viewportHeight:0,_viewportWidth:0,_physicalItems:null,_physicalSizes:null,_firstVisibleIndexVal:null,_collection:null,_lastVisibleIndexVal:null,_maxPages:2,_focusedItem:null,_focusedVirtualIndex:-1,_focusedPhysicalIndex:-1,_offscreenFocusedItem:null,_focusBackfillItem:null,_itemsPerRow:1,_itemWidth:0,_rowHeight:0,_templateCost:0,_parentModel:!0,get _physicalBottom(){return this._physicalTop+this._physicalSize},get _scrollBottom(){return this._scrollPosition+this._viewportHeight},get _virtualEnd(){return this._virtualStart+this._physicalCount-1},get _hiddenContentSize(){return(this.grid?this._physicalRows*this._rowHeight:this._physicalSize)-this._viewportHeight},get _itemsParent(){return Polymer.dom(Polymer.dom(this._userTemplate).parentNode)},get _maxScrollTop(){return this._estScrollHeight-this._viewportHeight+this._scrollOffset},get _maxVirtualStart(){var t=this._convertIndexToCompleteRow(this._virtualCount);return Math.max(0,t-this._physicalCount)},set _virtualStart(t){t=this._clamp(t,0,this._maxVirtualStart),this.grid&&(t-=t%this._itemsPerRow),this._virtualStartVal=t},get _virtualStart(){return this._virtualStartVal||0},set _physicalStart(t){(t%=this._physicalCount)<0&&(t=this._physicalCount+t),this.grid&&(t-=t%this._itemsPerRow),this._physicalStartVal=t},get _physicalStart(){return this._physicalStartVal||0},get _physicalEnd(){return(this._physicalStart+this._physicalCount-1)%this._physicalCount},set _physicalCount(t){this._physicalCountVal=t},get _physicalCount(){return this._physicalCountVal||0},get _optPhysicalSize(){return 0===this._viewportHeight?1/0:this._viewportHeight*this._maxPages},get _isVisible(){return Boolean(this.offsetWidth||this.offsetHeight)},get firstVisibleIndex(){var t=this._firstVisibleIndexVal;if(null==t){var i=this._physicalTop+this._scrollOffset;t=this._iterateItems(function(t,e){return(i+=this._getPhysicalSizeIncrement(t))>this._scrollPosition?this.grid?e-e%this._itemsPerRow:e:this.grid&&this._virtualCount-1===e?e-e%this._itemsPerRow:void 0})||0,this._firstVisibleIndexVal=t}return t},get lastVisibleIndex(){var t=this._lastVisibleIndexVal;if(null==t){if(this.grid)t=Math.min(this._virtualCount,this.firstVisibleIndex+this._estRowsInView*this._itemsPerRow-1);else{var i=this._physicalTop+this._scrollOffset;this._iterateItems(function(e,s){i<this._scrollBottom&&(t=s),i+=this._getPhysicalSizeIncrement(e)})}this._lastVisibleIndexVal=t}return t},get _defaultScrollTarget(){return this},get _virtualRowCount(){return Math.ceil(this._virtualCount/this._itemsPerRow)},get _estRowsInView(){return Math.ceil(this._viewportHeight/this._rowHeight)},get _physicalRows(){return Math.ceil(this._physicalCount/this._itemsPerRow)},get _scrollOffset(){return this._scrollerPaddingTop+this.scrollOffset},ready:function(){this.addEventListener("focus",this._didFocus.bind(this),!0)},attached:function(){this._debounce("_render",this._render,s),this.listen(this,"iron-resize","_resizeHandler"),this.listen(this,"keydown","_keydownHandler")},detached:function(){this.unlisten(this,"iron-resize","_resizeHandler"),this.unlisten(this,"keydown","_keydownHandler")},_setOverflow:function(t){this.style.webkitOverflowScrolling=t===this?"touch":"",this.style.overflowY=t===this?"auto":"",this._lastVisibleIndexVal=null,this._firstVisibleIndexVal=null,this._debounce("_render",this._render,s)},updateViewportBoundaries:function(){var t=window.getComputedStyle(this);this._scrollerPaddingTop=this.scrollTarget===this?0:parseInt(t["padding-top"],10),this._isRTL=Boolean("rtl"===t.direction),this._viewportWidth=this.$.items.offsetWidth,this._viewportHeight=this._scrollTargetHeight,this.grid&&this._updateGridMetrics()},_scrollHandler:function(){var t=Math.max(0,Math.min(this._maxScrollTop,this._scrollTop)),i=t-this._scrollPosition,e=i>=0;if(this._scrollPosition=t,this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null,Math.abs(i)>this._physicalSize&&this._physicalSize>0){i-=this._scrollOffset;var s=Math.round(i/this._physicalAverage)*this._itemsPerRow;this._virtualStart=this._virtualStart+s,this._physicalStart=this._physicalStart+s,this._physicalTop=Math.floor(this._virtualStart/this._itemsPerRow)*this._physicalAverage,this._update()}else if(this._physicalCount>0){var h=this._getReusables(e);e?(this._physicalTop=h.physicalTop,this._virtualStart=this._virtualStart+h.indexes.length,this._physicalStart=this._physicalStart+h.indexes.length):(this._virtualStart=this._virtualStart-h.indexes.length,this._physicalStart=this._physicalStart-h.indexes.length),this._update(h.indexes,e?null:h.indexes),this._debounce("_increasePoolIfNeeded",this._increasePoolIfNeeded.bind(this,0),l)}},_getReusables:function(t){var i,e,s,h=[],l=this._hiddenContentSize*this._ratio,o=this._virtualStart,r=this._virtualEnd,n=this._physicalCount,a=this._physicalTop+this._scrollOffset,c=this._physicalBottom+this._scrollOffset,_=this._scrollTop,u=this._scrollBottom;for(t?(i=this._physicalStart,this._physicalEnd,e=_-a):(i=this._physicalEnd,this._physicalStart,e=c-u);;){if(s=this._getPhysicalSizeIncrement(i),e-=s,h.length>=n||e<=l)break;if(t){if(r+h.length+1>=this._virtualCount)break;if(a+s>=_-this._scrollOffset)break;h.push(i),a+=s,i=(i+1)%n}else{if(o-h.length<=0)break;if(a+this._physicalSize-s<=u)break;h.push(i),a-=s,i=0===i?n-1:i-1}}return{indexes:h,physicalTop:a-this._scrollOffset}},_update:function(t,i){if(!(t&&0===t.length||0===this._physicalCount)){if(this._manageFocus(),this._assignModels(t),this._updateMetrics(t),i)for(;i.length;){var e=i.pop();this._physicalTop-=this._getPhysicalSizeIncrement(e)}this._positionItems(),this._updateScrollerSize()}},_createPool:function(t){this._ensureTemplatized();var i,e,s=new Array(t);for(i=0;i<t;i++)e=this.stamp(null),s[i]=e.root.querySelector("*"),this._itemsParent.appendChild(e.root);return s},_isClientFull:function(){return 0!=this._scrollBottom&&this._physicalBottom-1>=this._scrollBottom&&this._physicalTop<=this._scrollPosition},_increasePoolIfNeeded:function(t){var i=this._clamp(this._physicalCount+t,3,this._virtualCount-this._virtualStart);if(i=this._convertIndexToCompleteRow(i),this.grid){var e=i%this._itemsPerRow;e&&i-e<=this._physicalCount&&(i+=this._itemsPerRow),i-=e}var s=i-this._physicalCount,o=Math.round(.5*this._physicalCount);if(!(s<0)){if(s>0){var r=window.performance.now();[].push.apply(this._physicalItems,this._createPool(s)),[].push.apply(this._physicalSizes,new Array(s)),this._physicalCount=this._physicalCount+s,this._physicalStart>this._physicalEnd&&this._isIndexRendered(this._focusedVirtualIndex)&&this._getPhysicalIndex(this._focusedVirtualIndex)<this._physicalEnd&&(this._physicalStart=this._physicalStart+s),this._update(),this._templateCost=(window.performance.now()-r)/s,o=Math.round(.5*this._physicalCount)}this._virtualEnd>=this._virtualCount-1||0===o||(this._isClientFull()?this._physicalSize<this._optPhysicalSize&&this._debounce("_increasePoolIfNeeded",this._increasePoolIfNeeded.bind(this,this._clamp(Math.round(50/this._templateCost),1,o)),h):this._debounce("_increasePoolIfNeeded",this._increasePoolIfNeeded.bind(this,o),l))}},_render:function(){if(this.isAttached&&this._isVisible)if(0!==this._physicalCount){var t=this._getReusables(!0);this._physicalTop=t.physicalTop,this._virtualStart=this._virtualStart+t.indexes.length,this._physicalStart=this._physicalStart+t.indexes.length,this._update(t.indexes),this._update(),this._increasePoolIfNeeded(0)}else this._virtualCount>0&&(this.updateViewportBoundaries(),this._increasePoolIfNeeded(3))},_ensureTemplatized:function(){if(!this.ctor){this._userTemplate=this.queryEffectiveChildren("template"),this._userTemplate||console.warn("iron-list requires a template to be provided in light-dom");var t={};t.__key__=!0,t[this.as]=!0,t[this.indexAs]=!0,t[this.selectedAs]=!0,t.tabIndex=!0,this._instanceProps=t,this.templatize(this._userTemplate,this.mutableData)}},_gridChanged:function(t,i){void 0!==i&&(this.notifyResize(),Polymer.flush?Polymer.flush():Polymer.dom.flush(),t&&this._updateGridMetrics())},_itemsChanged:function(t){if("items"===t.path)this._virtualStart=0,this._physicalTop=0,this._virtualCount=this.items?this.items.length:0,this._collection=this.items&&Polymer.Collection?Polymer.Collection.get(this.items):null,this._physicalIndexForKey={},this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null,this._physicalCount=this._physicalCount||0,this._physicalItems=this._physicalItems||[],this._physicalSizes=this._physicalSizes||[],this._physicalStart=0,this._scrollTop>this._scrollOffset&&this._resetScrollPosition(0),this._removeFocusedItem(),this._debounce("_render",this._render,s);else if("items.splices"===t.path){this._adjustVirtualIndex(t.value.indexSplices),this._virtualCount=this.items?this.items.length:0;var i=t.value.indexSplices.some(function(t){return this._isIndexRendered(t.index)},this);this._isClientFull()&&!i||this._debounce("_render",this._render,s)}else"items.length"!==t.path&&this._forwardItemPath(t.path,t.value)},_forwardItemPath:function(t,i){var s=(t=t.slice(6)).indexOf(".")+1;0===s&&(s=t.length);var h,l,o=e?parseInt(t.substring(0,s),10):parseInt(t.substring(1,s),10),r=this._offscreenFocusedItem,n=this._isIndexRendered(o);n?(l=this._getPhysicalIndex(o),h=this.modelForElement(this._physicalItems[l])):r&&(h=this.modelForElement(r)),h&&h[this.indexAs]===o&&(t=t.substring(s),t=this.as+(t?"."+t:""),e?h._setPendingPropertyOrPath(t,i,!1,!0):h.notifyPath(t,i,!0),h._flushProperties&&h._flushProperties(!0),n&&(this._updateMetrics([l]),this._positionItems(),this._updateScrollerSize()))},_adjustVirtualIndex:function(t){t.forEach(function(t){if(t.removed.forEach(this._removeItem,this),t.index<this._virtualStart){var i=Math.max(t.addedCount-t.removed.length,t.index-this._virtualStart);this._virtualStart=this._virtualStart+i,this._focusedVirtualIndex>=0&&(this._focusedVirtualIndex=this._focusedVirtualIndex+i)}},this)},_removeItem:function(t){this.$.selector.deselect(t),this._focusedItem&&this.modelForElement(this._focusedItem)[this.as]===t&&(this._removeFocusedItem(),document.activeElement&&document.activeElement.blur&&document.activeElement.blur())},_iterateItems:function(t,i){var e,s,h,l;if(2===arguments.length&&i){for(l=0;l<i.length;l++)if(e=i[l],s=this._computeVidx(e),null!=(h=t.call(this,e,s)))return h}else{for(e=this._physicalStart,s=this._virtualStart;e<this._physicalCount;e++,s++)if(null!=(h=t.call(this,e,s)))return h;for(e=0;e<this._physicalStart;e++,s++)if(null!=(h=t.call(this,e,s)))return h}},_computeVidx:function(t){return t>=this._physicalStart?this._virtualStart+(t-this._physicalStart):this._virtualStart+(this._physicalCount-this._physicalStart)+t},_assignModels:function(t){this._iterateItems(function(t,i){var e=this._physicalItems[t],s=this.items&&this.items[i];if(null!=s){var h=this.modelForElement(e);h.__key__=this._collection?this._collection.getKey(s):null,this._forwardProperty(h,this.as,s),this._forwardProperty(h,this.selectedAs,this.$.selector.isSelected(s)),this._forwardProperty(h,this.indexAs,i),this._forwardProperty(h,"tabIndex",this._focusedVirtualIndex===i?0:-1),this._physicalIndexForKey[h.__key__]=t,h._flushProperties&&h._flushProperties(!0),e.removeAttribute("hidden")}else e.setAttribute("hidden","")},t)},_updateMetrics:function(t){Polymer.flush?Polymer.flush():Polymer.dom.flush();var i=0,e=0,s=this._physicalAverageCount,h=this._physicalAverage;this._iterateItems(function(t,s){e+=this._physicalSizes[t]||0,this._physicalSizes[t]=this._physicalItems[t].offsetHeight,i+=this._physicalSizes[t],this._physicalAverageCount+=this._physicalSizes[t]?1:0},t),this.grid?(this._updateGridMetrics(),this._physicalSize=Math.ceil(this._physicalCount/this._itemsPerRow)*this._rowHeight):(e=1===this._itemsPerRow?e:Math.ceil(this._physicalCount/this._itemsPerRow)*this._rowHeight,this._physicalSize=this._physicalSize+i-e,this._itemsPerRow=1),this._physicalAverageCount!==s&&(this._physicalAverage=Math.round((h*s+i)/this._physicalAverageCount))},_updateGridMetrics:function(){this._itemWidth=this._physicalCount>0?this._physicalItems[0].getBoundingClientRect().width:200,this._rowHeight=this._physicalCount>0?this._physicalItems[0].offsetHeight:200,this._itemsPerRow=this._itemWidth?Math.floor(this._viewportWidth/this._itemWidth):this._itemsPerRow},_positionItems:function(){this._adjustScrollPosition();var t=this._physicalTop;if(this.grid){var i=this._itemsPerRow*this._itemWidth,e=(this._viewportWidth-i)/2;this._iterateItems(function(i,s){var h=s%this._itemsPerRow,l=Math.floor(h*this._itemWidth+e);this._isRTL&&(l*=-1),this.translate3d(l+"px",t+"px",0,this._physicalItems[i]),this._shouldRenderNextRow(s)&&(t+=this._rowHeight)})}else this._iterateItems(function(i,e){this.translate3d(0,t+"px",0,this._physicalItems[i]),t+=this._physicalSizes[i]})},_getPhysicalSizeIncrement:function(t){return this.grid?this._computeVidx(t)%this._itemsPerRow!=this._itemsPerRow-1?0:this._rowHeight:this._physicalSizes[t]},_shouldRenderNextRow:function(t){return t%this._itemsPerRow==this._itemsPerRow-1},_adjustScrollPosition:function(){var t=0===this._virtualStart?this._physicalTop:Math.min(this._scrollPosition+this._physicalTop,0);if(0!==t){this._physicalTop=this._physicalTop-t;var e=this._scrollTop;!i&&e>0&&this._resetScrollPosition(e-t)}},_resetScrollPosition:function(t){this.scrollTarget&&t>=0&&(this._scrollTop=t,this._scrollPosition=this._scrollTop)},_updateScrollerSize:function(t){this.grid?this._estScrollHeight=this._virtualRowCount*this._rowHeight:this._estScrollHeight=this._physicalBottom+Math.max(this._virtualCount-this._physicalCount-this._virtualStart,0)*this._physicalAverage,((t=(t=(t=t||0===this._scrollHeight)||this._scrollPosition>=this._estScrollHeight-this._physicalSize)||this.grid&&this.$.items.style.height<this._estScrollHeight)||Math.abs(this._estScrollHeight-this._scrollHeight)>=this._viewportHeight)&&(this.$.items.style.height=this._estScrollHeight+"px",this._scrollHeight=this._estScrollHeight)},scrollToItem:function(t){return this.scrollToIndex(this.items.indexOf(t))},scrollToIndex:function(t){if(!("number"!=typeof t||t<0||t>this.items.length-1)&&(Polymer.flush?Polymer.flush():Polymer.dom.flush(),0!==this._physicalCount)){t=this._clamp(t,0,this._virtualCount-1),(!this._isIndexRendered(t)||t>=this._maxVirtualStart)&&(this._virtualStart=this.grid?t-2*this._itemsPerRow:t-1),this._manageFocus(),this._assignModels(),this._updateMetrics(),this._physicalTop=Math.floor(this._virtualStart/this._itemsPerRow)*this._physicalAverage;for(var i=this._physicalStart,e=this._virtualStart,s=0,h=this._hiddenContentSize;e<t&&s<=h;)s+=this._getPhysicalSizeIncrement(i),i=(i+1)%this._physicalCount,e++;this._updateScrollerSize(!0),this._positionItems(),this._resetScrollPosition(this._physicalTop+this._scrollOffset+s),this._increasePoolIfNeeded(0),this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null}},_resetAverage:function(){this._physicalAverage=0,this._physicalAverageCount=0},_resizeHandler:function(){this._debounce("_render",function(){this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null;Math.abs(this._viewportHeight-this._scrollTargetHeight);this.updateViewportBoundaries(),this._isVisible?(this.toggleScrollListener(!0),this._resetAverage(),this._render()):this.toggleScrollListener(!1)},s)},selectItem:function(t){return this.selectIndex(this.items.indexOf(t))},selectIndex:function(t){if(!(t<0||t>=this._virtualCount)){if(!this.multiSelection&&this.selectedItem&&this.clearSelection(),this._isIndexRendered(t)){var i=this.modelForElement(this._physicalItems[this._getPhysicalIndex(t)]);i&&(i[this.selectedAs]=!0),this.updateSizeForIndex(t)}this.$.selector.selectIndex?this.$.selector.selectIndex(t):this.$.selector.select(this.items[t])}},deselectItem:function(t){return this.deselectIndex(this.items.indexOf(t))},deselectIndex:function(t){t<0||t>=this._virtualCount||(this._isIndexRendered(t)&&(this.modelForElement(this._physicalItems[this._getPhysicalIndex(t)])[this.selectedAs]=!1,this.updateSizeForIndex(t)),this.$.selector.deselectIndex?this.$.selector.deselectIndex(t):this.$.selector.deselect(this.items[t]))},toggleSelectionForItem:function(t){return this.toggleSelectionForIndex(this.items.indexOf(t))},toggleSelectionForIndex:function(t){(this.$.selector.isIndexSelected?this.$.selector.isIndexSelected(t):this.$.selector.isSelected(this.items[t]))?this.deselectIndex(t):this.selectIndex(t)},clearSelection:function(){this._iterateItems(function(t,i){this.modelForElement(this._physicalItems[t])[this.selectedAs]=!1}),this.$.selector.clearSelection()},_selectionEnabledChanged:function(t){(t?this.listen:this.unlisten).call(this,this,"tap","_selectionHandler")},_selectionHandler:function(t){var i=this.modelForElement(t.target);if(i){var e,s,h=Polymer.dom(t).path[0],l=this._itemsParent.node.domHost,o=Polymer.dom(l?l.root:document).activeElement,r=this._physicalItems[this._getPhysicalIndex(i[this.indexAs])];"input"!==h.localName&&"button"!==h.localName&&"select"!==h.localName&&(e=i.tabIndex,i.tabIndex=-100,s=o?o.tabIndex:-1,i.tabIndex=e,o&&r!==o&&r.contains(o)&&-100!==s||this.toggleSelectionForItem(i[this.as]))}},_multiSelectionChanged:function(t){this.clearSelection(),this.$.selector.multi=t},updateSizeForItem:function(t){return this.updateSizeForIndex(this.items.indexOf(t))},updateSizeForIndex:function(t){return this._isIndexRendered(t)?(this._updateMetrics([this._getPhysicalIndex(t)]),this._positionItems(),null):null},_manageFocus:function(){var t=this._focusedVirtualIndex;t>=0&&t<this._virtualCount?this._isIndexRendered(t)?this._restoreFocusedItem():this._createFocusBackfillItem():this._virtualCount>0&&this._physicalCount>0&&(this._focusedPhysicalIndex=this._physicalStart,this._focusedVirtualIndex=this._virtualStart,this._focusedItem=this._physicalItems[this._physicalStart])},_convertIndexToCompleteRow:function(t){return this._itemsPerRow=this._itemsPerRow||1,this.grid?Math.ceil(t/this._itemsPerRow)*this._itemsPerRow:t},_isIndexRendered:function(t){return t>=this._virtualStart&&t<=this._virtualEnd},_isIndexVisible:function(t){return t>=this.firstVisibleIndex&&t<=this.lastVisibleIndex},_getPhysicalIndex:function(t){return(this._physicalStart+(t-this._virtualStart))%this._physicalCount},focusItem:function(t){this._focusPhysicalItem(t)},_focusPhysicalItem:function(t){if(!(t<0||t>=this._virtualCount)){this._restoreFocusedItem(),this._isIndexRendered(t)||this.scrollToIndex(t);var i,e=this._physicalItems[this._getPhysicalIndex(t)],s=this.modelForElement(e);s.tabIndex=-100,-100===e.tabIndex&&(i=e),i||(i=Polymer.dom(e).querySelector('[tabindex="-100"]')),s.tabIndex=0,this._focusedVirtualIndex=t,i&&i.focus()}},_removeFocusedItem:function(){this._offscreenFocusedItem&&this._itemsParent.removeChild(this._offscreenFocusedItem),this._offscreenFocusedItem=null,this._focusBackfillItem=null,this._focusedItem=null,this._focusedVirtualIndex=-1,this._focusedPhysicalIndex=-1},_createFocusBackfillItem:function(){var t=this._focusedPhysicalIndex;if(!(this._offscreenFocusedItem||this._focusedVirtualIndex<0)){if(!this._focusBackfillItem){var i=this.stamp(null);this._focusBackfillItem=i.root.querySelector("*"),this._itemsParent.appendChild(i.root)}this._offscreenFocusedItem=this._physicalItems[t],this.modelForElement(this._offscreenFocusedItem).tabIndex=0,this._physicalItems[t]=this._focusBackfillItem,this._focusedPhysicalIndex=t,this.translate3d(0,"-10000px",0,this._offscreenFocusedItem)}},_restoreFocusedItem:function(){if(this._offscreenFocusedItem&&!(this._focusedVirtualIndex<0)){this._assignModels();var t=this._focusedPhysicalIndex,i=this._physicalItems[t];if(i){var e=this.modelForElement(i),s=this.modelForElement(this._offscreenFocusedItem);e[this.as]===s[this.as]?(this._focusBackfillItem=i,e.tabIndex=-1,this._physicalItems[t]=this._offscreenFocusedItem,this.translate3d(0,"-10000px",0,this._focusBackfillItem)):(this._removeFocusedItem(),this._focusBackfillItem=null),this._offscreenFocusedItem=null}}},_didFocus:function(t){var i=this.modelForElement(t.target),e=this.modelForElement(this._focusedItem),s=null!==this._offscreenFocusedItem,h=this._focusedVirtualIndex;i&&(e===i?this._isIndexVisible(h)||this.scrollToIndex(h):(this._restoreFocusedItem(),e&&(e.tabIndex=-1),i.tabIndex=0,h=i[this.indexAs],this._focusedVirtualIndex=h,this._focusedPhysicalIndex=this._getPhysicalIndex(h),this._focusedItem=this._physicalItems[this._focusedPhysicalIndex],s&&!this._offscreenFocusedItem&&this._update()))},_keydownHandler:function(t){switch(t.keyCode){case 40:t.preventDefault(),this._focusPhysicalItem(this._focusedVirtualIndex+(this.grid?this._itemsPerRow:1));break;case 39:this.grid&&this._focusPhysicalItem(this._focusedVirtualIndex+(this._isRTL?-1:1));break;case 38:this._focusPhysicalItem(this._focusedVirtualIndex-(this.grid?this._itemsPerRow:1));break;case 37:this.grid&&this._focusPhysicalItem(this._focusedVirtualIndex+(this._isRTL?1:-1));break;case 13:this._focusPhysicalItem(this._focusedVirtualIndex),this._selectionHandler(t)}},_clamp:function(t,i,e){return Math.min(e,Math.max(i,t))},_debounce:function(t,i,s){e?(this._debouncers=this._debouncers||{},this._debouncers[t]=Polymer.Debouncer.debounce(this._debouncers[t],s,i.bind(this)),Polymer.enqueueDebouncer(this._debouncers[t])):Polymer.dom.addDebouncer(this.debounce(t,i))},_forwardProperty:function(t,i,s){e?t._setPendingProperty(i,s):t[i]=s},_forwardHostPropV2:function(t,i){(this._physicalItems||[]).concat([this._offscreenFocusedItem,this._focusBackfillItem]).forEach(function(e){e&&this.modelForElement(e).forwardHostProp(t,i)},this)},_notifyInstancePropV2:function(t,i,e){if(Polymer.Path.matches(this.as,i)){var s=t[this.indexAs];i==this.as&&(this.items[s]=e),this.notifyPath(Polymer.Path.translate(this.as,"items."+s,i),e)}},_getStampedChildren:function(){return this._physicalItems},_forwardInstancePath:function(t,i,e){0===i.indexOf(this.as+".")&&this.notifyPath("items."+t.__key__+"."+i.slice(this.as.length+1),e)},_forwardParentPath:function(t,i){(this._physicalItems||[]).concat([this._offscreenFocusedItem,this._focusBackfillItem]).forEach(function(e){e&&this.modelForElement(e).notifyPath(t,i,!0)},this)},_forwardParentProp:function(t,i){(this._physicalItems||[]).concat([this._offscreenFocusedItem,this._focusBackfillItem]).forEach(function(e){e&&(this.modelForElement(e)[t]=i)},this)}})}();</script><script>window.vaadin=window.vaadin||{},vaadin.elements=vaadin.elements||{},vaadin.elements.combobox=vaadin.elements.combobox||{},vaadin.elements.combobox.OverlayBehaviorImpl={properties:{positionTarget:{type:Object},verticalOffset:{type:Number,value:0},_alignedAbove:{type:Boolean,value:!1}},listeners:{"iron-resize":"_setPosition"},created:function(){this._boundSetPosition=this._setPosition.bind(this)},_unwrapIfNeeded:function(t){return Polymer.Settings.hasShadow&&!Polymer.Settings.nativeShadow?window.unwrap(t):t},_processPendingMutationObserversFor:function(t){window.CustomElements&&!Polymer.Settings.useNativeCustomElements&&CustomElements.takeRecords(t)},_moveTo:function(t){var e=this.parentNode;Polymer.dom(t).appendChild(this),e&&(this._processPendingMutationObserversFor(e),e.host&&!Polymer.Element&&Polymer.StyleTransformer.dom(this,e.host.is,this._scopeCssViaAttr,!0)),this._processPendingMutationObserversFor(this),t.host&&!Polymer.Element&&Polymer.StyleTransformer.dom(this,t.host.is,this._scopeCssViaAttr),t===document.body?(this.style.position=this._isPositionFixed(this.positionTarget)?"fixed":"absolute",window.addEventListener("scroll",this._boundSetPosition,!0),this._setPosition()):window.removeEventListener("scroll",this._boundSetPosition,!0)},_verticalOffset:function(t,e){return this._alignedAbove?-t.height:e.height+this.verticalOffset},_isPositionFixed:function(t){var e=this._getOffsetParent(t);return"fixed"===window.getComputedStyle(this._unwrapIfNeeded(t)).position||e&&this._isPositionFixed(e)},_getOffsetParent:function(t){if(t.assignedSlot)return t.assignedSlot.parentElement;if(t.parentElement)return t.offsetParent;var e=Polymer.dom(t).parentNode;return e&&11===e.nodeType&&e.host?e.host:void 0},_maxHeight:function(t){var e=Math.min(window.innerHeight,document.body.scrollHeight-document.body.scrollTop);return this._alignedAbove?Math.max(t.top-8+Math.min(document.body.scrollTop,0),116)+"px":Math.max(e-t.bottom-8,116)+"px"},_setPosition:function(t){if(t&&t.target){var e=t.target===document?document.body:t.target,i=this._unwrapIfNeeded(this.parentElement);if(!e.contains(this)&&!e.contains(this.positionTarget)||i!==document.body)return}var o=this.positionTarget.getBoundingClientRect();this._alignedAbove=this._shouldAlignAbove(),this.style.maxHeight=this._maxHeight(o),this.$.selector.style.maxHeight=this._maxHeight(o);var n=this.getBoundingClientRect();this._translateX=o.left-n.left+(this._translateX||0),this._translateY=o.top-n.top+(this._translateY||0)+this._verticalOffset(n,o);var s=window.devicePixelRatio||1;this._translateX=Math.round(this._translateX*s)/s,this._translateY=Math.round(this._translateY*s)/s,this.translate3d(this._translateX+"px",this._translateY+"px","0"),this.style.width=this.positionTarget.clientWidth+"px",this.updateViewportBoundaries()},_shouldAlignAbove:function(){return(window.innerHeight-this.positionTarget.getBoundingClientRect().bottom-Math.min(document.body.scrollTop,0))/window.innerHeight<.3}},vaadin.elements.combobox.OverlayBehavior=[Polymer.IronResizableBehavior,vaadin.elements.combobox.OverlayBehaviorImpl];</script><dom-module id="vaadin-combo-box-item" assetpath="../../bower_components/vaadin-combo-box/"><template><style>:host{display:block;}</style>[[label]]</template></dom-module><script>Polymer({is:"vaadin-combo-box-item",properties:{index:Number,item:Object,label:String,selected:{type:Boolean,value:!1,reflectToAttribute:!0},focused:{type:Boolean,value:!1,reflectToAttribute:!0},_itemTemplateInstance:Object},observers:['_updateTemplateInstanceVariable("index", index, _itemTemplateInstance)','_updateTemplateInstanceVariable("item", item, _itemTemplateInstance)','_updateTemplateInstanceVariable("selected", selected, _itemTemplateInstance)','_updateTemplateInstanceVariable("focused", focused, _itemTemplateInstance)'],attached:function(){if(!this._itemTemplateInstance){var e=this.domHost.dataHost||this.domHost.__dataHost;e._ensureTemplatized(),e._itemTemplate&&(this._itemTemplateInstance=e.stamp({}),Polymer.dom(this.root).textContent="",Polymer.dom(this.root).appendChild(this._itemTemplateInstance.root))}},_updateTemplateInstanceVariable:function(e,t,a){void 0!==e&&void 0!==t&&void 0!==a&&(a[e]=t)}});</script><dom-module id="vaadin-spinner" assetpath="../../bower_components/vaadin-combo-box/"><template><style>@keyframes vaadin-spin-360{100%{transform:rotate(1turn);}}:host{display:block;box-sizing:border-box;border:2px solid var(--primary-color, #03A9F4);border-radius:50%;border-right-color:transparent;border-top-color:transparent;content:"";height:24px;left:50%;margin-left:-12px;margin-top:-12px;position:absolute;top:50%;width:24px;pointer-events:none;opacity:0;}:host([active]){opacity:1;animation:vaadin-spin-360 400ms linear infinite;}</style></template><script>Polymer({is:"vaadin-spinner",properties:{active:{type:Boolean,reflectToAttribute:!0}}});</script></dom-module><dom-module id="vaadin-combo-box-overlay" assetpath="../../bower_components/vaadin-combo-box/"><template><style>:host{position:absolute;@apply --shadow-elevation-2dp;background:#fff;border-radius:0 0 2px 2px;top:0;left:0;pointer-events:auto;z-index:200;overflow:hidden;}#scroller{overflow:auto;max-height:var(--vaadin-combo-box-overlay-max-height, 65vh);transform:translate3d(0, 0, 0);-webkit-overflow-scrolling:touch;}#selector{--iron-list-items-container:{border-top:8px solid transparent;border-bottom:8px solid transparent;};}#selector vaadin-combo-box-item{cursor:pointer;padding:13px 16px;color:var(--primary-text-color);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}:host([opened][loading]){display:block !important;height:58px;}#selector:not([touch-device]) vaadin-combo-box-item:hover,
+      #selector vaadin-combo-box-item[focused]{background:#eee;}#selector vaadin-combo-box-item[selected]{color:var(--primary-color);}#selector vaadin-combo-box-item[hidden]{display:none;}</style><vaadin-spinner active="[[loading]]"></vaadin-spinner><div id="scroller" scroller="[[_getScroller()]]" on-tap="_stopPropagation" on-touchstart="_onTouchStart" on-touchend="_preventDefault" on-scroll="_onScroll" hidden$="[[loading]]"><iron-list id="selector" touch-device$="[[touchDevice]]" role="listbox" items="[[_items]]" scroll-target="[[_getScroller()]]"><template><vaadin-combo-box-item on-tap="_onTap" index="[[index]]" item="[[item]]" label="[[getItemLabel(item)]]" selected="[[_isItemSelected(item, _selectedItem)]]" role$="[[_getAriaRole(index)]]" aria-selected$="[[_getAriaSelected(_focusedIndex,index)]]" focused="[[_isItemFocused(_focusedIndex,index)]]"></vaadin-combo-box-item></template></iron-list></div></template></dom-module><script>Polymer({is:"vaadin-combo-box-overlay",behaviors:[vaadin.elements.combobox.OverlayBehavior],properties:{touchDevice:{type:Boolean,reflectToAttribute:!0,value:function(){try{return document.createEvent("TouchEvent"),!0}catch(t){return!1}}},loading:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"notifyResize"},_selectedItem:{type:Object},_items:{type:Object},_focusedIndex:{type:Number,notify:!0,value:-1,observer:"_focusedIndexChanged"},_focusedItem:{type:String,computed:"_getFocusedItem(_focusedIndex)"},_itemLabelPath:{type:String,value:"label"},_itemValuePath:{type:String,value:"value"},_notTapping:Boolean,_ignoreTaps:Boolean},ready:function(){this._patchWheelOverScrolling(),void 0!==this.$.selector._scroller&&(this.$.selector._scroller=this._getScroller()),this._patchIronListStamping(),/Trident/.test(navigator.userAgent)&&this.$.scroller.setAttribute("unselectable","on")},_patchIronListStamping:function(){var t=this.$.selector.stamp;this.$.selector.stamp=function(e){return null===e&&(e={}),t.call(this,e)}},_getFocusedItem:function(t){if(t>=0)return this._items[t]},_isItemSelected:function(t,e){return t===e},_onTap:function(t){this._notTapping||this._ignoreTaps||this.fire("selection-changed",{item:t.model.item})},_onTouchStart:function(){this._notTapping=!1,this.async(function(){this._notTapping=!0},300)},_onScroll:function(){this._ignoreTaps=!0,this.debounce("restore-taps",function(){this._ignoreTaps=!1},300)},indexOfLabel:function(t){if(this._items&&t)for(var e=0;e<this._items.length;e++)if(this.getItemLabel(this._items[e]).toString().toLowerCase()===t.toString().toLowerCase())return e;return-1},getItemLabel:function(t){var e=t?this.get(this._itemLabelPath,t):void 0;return void 0===e&&(e=t?t.toString():""),e},_isItemFocused:function(t,e){return t==e},_getAriaSelected:function(t,e){return this._isItemFocused(t,e).toString()},_getAriaRole:function(t){return void 0!==t&&"option"},_focusedIndexChanged:function(t){t>=0&&this._scrollIntoView(t)},_scrollIntoView:function(t){var e=this._visibleItemsCount();if(void 0!==e){var i=t;t>this.$.selector.lastVisibleIndex-1?i=t-e+1:t>this.$.selector.firstVisibleIndex&&(i=this.$.selector.firstVisibleIndex),this.$.selector.scrollToIndex(Math.max(0,i));var o=this.$.selector._getPhysicalIndex(t),n=this.$.selector._physicalItems[o];if(n){var s=n.getBoundingClientRect(),r=this.$.scroller.getBoundingClientRect(),l=s.bottom-r.bottom+this._viewportTotalPaddingBottom;l>0&&(this.$.scroller.scrollTop+=l)}}},ensureItemsRendered:function(){this.$.selector._render()},adjustScrollPosition:function(){this._items&&this._scrollIntoView(this._focusedIndex)},_getScroller:function(){return this.$.scroller},_patchWheelOverScrolling:function(){var t=this.$.selector;t.addEventListener("wheel",function(e){var i=t._scroller||t.scrollTarget,o=0===i.scrollTop,n=i.scrollHeight-i.scrollTop-i.clientHeight<=1;o&&e.deltaY<0?e.preventDefault():n&&e.deltaY>0&&e.preventDefault()})},updateViewportBoundaries:function(){this._cachedViewportTotalPaddingBottom=void 0,this.$.selector.updateViewportBoundaries()},get _viewportTotalPaddingBottom(){if(void 0===this._cachedViewportTotalPaddingBottom){var t=window.getComputedStyle(this._unwrapIfNeeded(this.$.selector.$.items));this._cachedViewportTotalPaddingBottom=[t.paddingBottom,t.borderBottomWidth].map(function(t){return parseInt(t,10)}).reduce(function(t,e){return t+e})}return this._cachedViewportTotalPaddingBottom},_visibleItemsCount:function(){return this.$.selector.flushDebouncer("_debounceTemplate"),this.$.selector.scrollToIndex(this.$.selector.firstVisibleIndex),this.updateViewportBoundaries(),this.$.selector.lastVisibleIndex-this.$.selector.firstVisibleIndex+1},_selectItem:function(t){t="number"==typeof t?this._items[t]:t,this.$.selector.selectedItem!==t&&this.$.selector.selectItem(t)},_preventDefault:function(t){t.cancelable&&t.preventDefault()},_stopPropagation:function(t){t.stopPropagation()}});</script><dom-module id="vaadin-combo-box-shared-styles" assetpath="../../bower_components/vaadin-combo-box/"><template><style>:host([opened]){pointer-events:auto;}.rotate-on-open,
       :host ::slotted(.rotate-on-open){transition:all 0.2s !important;}:host ::slotted(paper-input-container) .rotate-on-open{transition:all 0.2s !important;}:host([opened]) .rotate-on-open,
       :host([opened]) ::slotted(.rotate-on-open){-webkit-transform:rotate(180deg);transform:rotate(180deg);}:host([opened]) ::slotted(paper-input-container) .rotate-on-open{-webkit-transform:rotate(180deg);transform:rotate(180deg);}paper-icon-button.small,
       :host ::slotted(paper-icon-button.small){padding:6px !important;}:host ::slotted(paper-input-container) paper-icon-button.small{padding:6px !important;}:host(:not([has-value])) ::slotted([slot="clear-button"]),
diff --git a/homeassistant/components/frontend/www_static/panels/ha-panel-dev-service.html.gz b/homeassistant/components/frontend/www_static/panels/ha-panel-dev-service.html.gz
index 7b6037014490b6159b779e65e8c6d2cf8a5e6f5d..5e8ff9027d2b7e38e377c3417ad7c50334755782 100644
Binary files a/homeassistant/components/frontend/www_static/panels/ha-panel-dev-service.html.gz and b/homeassistant/components/frontend/www_static/panels/ha-panel-dev-service.html.gz differ
diff --git a/homeassistant/components/frontend/www_static/panels/ha-panel-map.html b/homeassistant/components/frontend/www_static/panels/ha-panel-map.html
index c6bcf738d2a29c6190622dc69aff1a49f6827dc5..e2a93ae1cea702b6a8370398d1d310521196bdd1 100644
--- a/homeassistant/components/frontend/www_static/panels/ha-panel-map.html
+++ b/homeassistant/components/frontend/www_static/panels/ha-panel-map.html
@@ -1,47 +1 @@
-<html><head></head><body><div hidden="" by-polymer-bundler=""><script>!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i(t.L=t.L||{})}(this,function(t){"use strict";function i(t){var i,e,n,o,s=arguments;for(e=1,n=arguments.length;e<n;e++){o=s[e];for(i in o)t[i]=o[i]}return t}function e(t,i){var e=Array.prototype.slice;if(t.bind)return t.bind.apply(t,e.call(arguments,1));var n=e.call(arguments,2);return function(){return t.apply(i,n.length?n.concat(e.call(arguments)):arguments)}}function n(t){return t._leaflet_id=t._leaflet_id||++$t,t._leaflet_id}function o(t,i,e){var n,o,s,r;return r=function(){n=!1,o&&(s.apply(e,o),o=!1)},s=function(){n?o=arguments:(t.apply(e,arguments),setTimeout(r,i),n=!0)}}function s(t,i,e){var n=i[1],o=i[0],s=n-o;return t===n&&e?t:((t-o)%s+s)%s+o}function r(){return!1}function a(t,i){var e=Math.pow(10,i||5);return Math.round(t*e)/e}function h(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function u(t){return h(t).split(/\s+/)}function l(t,i){t.hasOwnProperty("options")||(t.options=t.options?Jt(t.options):{});for(var e in i)t.options[e]=i[e];return t.options}function c(t,i,e){var n=[];for(var o in t)n.push(encodeURIComponent(e?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(i&&-1!==i.indexOf("?")?"&":"?")+n.join("&")}function _(t,i){return t.replace(Qt,function(t,e){var n=i[e];if(void 0===n)throw new Error("No value provided for variable "+t);return"function"==typeof n&&(n=n(i)),n})}function d(t,i){for(var e=0;e<t.length;e++)if(t[e]===i)return e;return-1}function p(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}function m(t){var i=+new Date,e=Math.max(0,16-(i-ei));return ei=i+e,window.setTimeout(t,e)}function f(t,i,n){return n&&ni===m?void t.call(i):ni.call(window,e(t,i))}function v(t){t&&oi.call(window,t)}function g(){}function y(t){if(L&&L.Mixin){t=ti(t)?t:[t];for(var i=0;i<t.length;i++)t[i]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}function x(t,i,e){this.x=e?Math.round(t):t,this.y=e?Math.round(i):i}function w(t,i,e){return t instanceof x?t:ti(t)?new x(t[0],t[1]):void 0===t||null===t?t:"object"==typeof t&&"x"in t&&"y"in t?new x(t.x,t.y):new x(t,i,e)}function P(t,i){var e=this;if(t)for(var n=i?[t,i]:t,o=0,s=n.length;o<s;o++)e.extend(n[o])}function b(t,i){return!t||t instanceof P?t:new P(t,i)}function T(t,i){var e=this;if(t)for(var n=i?[t,i]:t,o=0,s=n.length;o<s;o++)e.extend(n[o])}function z(t,i){return t instanceof T?t:new T(t,i)}function M(t,i,e){if(isNaN(t)||isNaN(i))throw new Error("Invalid LatLng object: ("+t+", "+i+")");this.lat=+t,this.lng=+i,void 0!==e&&(this.alt=+e)}function C(t,i,e){return t instanceof M?t:ti(t)&&"object"!=typeof t[0]?3===t.length?new M(t[0],t[1],t[2]):2===t.length?new M(t[0],t[1]):null:void 0===t||null===t?t:"object"==typeof t&&"lat"in t?new M(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===i?null:new M(t,i,e)}function Z(t,i,e,n){return ti(t)?(this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3])):(this._a=t,this._b=i,this._c=e,void(this._d=n))}function E(t,i,e,n){return new Z(t,i,e,n)}function S(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function k(t,i){var e,n,o,s,r,a,h="";for(e=0,o=t.length;e<o;e++){for(n=0,s=(r=t[e]).length;n<s;n++)a=r[n],h+=(n?"L":"M")+a.x+" "+a.y;h+=i?Vi?"z":"x":""}return h||"M0 0"}function B(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}function I(t,i,e,n){return"touchstart"===i?O(t,e,n):"touchmove"===i?W(t,e,n):"touchend"===i&&H(t,e,n),this}function A(t,i,e){var n=t["_leaflet_"+i+e];return"touchstart"===i?t.removeEventListener(Ki,n,!1):"touchmove"===i?t.removeEventListener(Yi,n,!1):"touchend"===i&&(t.removeEventListener(Xi,n,!1),t.removeEventListener(Ji,n,!1)),this}function O(t,i,n){var o=e(function(t){if("mouse"!==t.pointerType&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE){if(!($i.indexOf(t.target.tagName)<0))return;$(t)}j(t,i)});t["_leaflet_touchstart"+n]=o,t.addEventListener(Ki,o,!1),te||(document.documentElement.addEventListener(Ki,R,!0),document.documentElement.addEventListener(Yi,D,!0),document.documentElement.addEventListener(Xi,N,!0),document.documentElement.addEventListener(Ji,N,!0),te=!0)}function R(t){Qi[t.pointerId]=t,ie++}function D(t){Qi[t.pointerId]&&(Qi[t.pointerId]=t)}function N(t){delete Qi[t.pointerId],ie--}function j(t,i){t.touches=[];for(var e in Qi)t.touches.push(Qi[e]);t.changedTouches=[t],i(t)}function W(t,i,e){var n=function(t){(t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&"mouse"!==t.pointerType||0!==t.buttons)&&j(t,i)};t["_leaflet_touchmove"+e]=n,t.addEventListener(Yi,n,!1)}function H(t,i,e){var n=function(t){j(t,i)};t["_leaflet_touchend"+e]=n,t.addEventListener(Xi,n,!1),t.addEventListener(Ji,n,!1)}function F(t,i,e){function n(t){var i;if(Ni){if(!xi||"mouse"===t.pointerType)return;i=ie}else i=t.touches.length;if(!(i>1)){var e=Date.now(),n=e-(s||e);r=t.touches?t.touches[0]:t,a=n>0&&n<=h,s=e}}function o(t){if(a&&!r.cancelBubble){if(Ni){if(!xi||"mouse"===t.pointerType)return;var e,n,o={};for(n in r)e=r[n],o[n]=e&&e.bind?e.bind(r):e;r=o}r.type="dblclick",i(r),s=null}}var s,r,a=!1,h=250;return t[oe+ee+e]=n,t[oe+ne+e]=o,t[oe+"dblclick"+e]=i,t.addEventListener(ee,n,!1),t.addEventListener(ne,o,!1),t.addEventListener("dblclick",i,!1),this}function U(t,i){var e=t[oe+ee+i],n=t[oe+ne+i],o=t[oe+"dblclick"+i];return t.removeEventListener(ee,e,!1),t.removeEventListener(ne,n,!1),xi||t.removeEventListener("dblclick",o,!1),this}function V(t,i,e,n){if("object"==typeof i)for(var o in i)q(t,o,i[o],e);else for(var s=0,r=(i=u(i)).length;s<r;s++)q(t,i[s],e,n);return this}function G(t,i,e,n){if("object"==typeof i)for(var o in i)K(t,o,i[o],e);else if(i)for(var s=0,r=(i=u(i)).length;s<r;s++)K(t,i[s],e,n);else{for(var a in t[se])K(t,a,t[se][a]);delete t[se]}}function q(t,i,e,o){var s=i+n(e)+(o?"_"+n(o):"");if(t[se]&&t[se][s])return this;var r=function(i){return e.call(o||t,i||window.event)},a=r;Ni&&0===i.indexOf("touch")?I(t,i,r,s):!ji||"dblclick"!==i||!F||Ni&&Ti?"addEventListener"in t?"mousewheel"===i?t.addEventListener("onwheel"in t?"wheel":"mousewheel",r,!1):"mouseenter"===i||"mouseleave"===i?(r=function(i){i=i||window.event,ot(t,i)&&a(i)},t.addEventListener("mouseenter"===i?"mouseover":"mouseout",r,!1)):("click"===i&&Li&&(r=function(t){st(t,a)}),t.addEventListener(i,r,!1)):"attachEvent"in t&&t.attachEvent("on"+i,r):F(t,r,s),t[se]=t[se]||{},t[se][s]=r}function K(t,i,e,o){var s=i+n(e)+(o?"_"+n(o):""),r=t[se]&&t[se][s];return r?(Ni&&0===i.indexOf("touch")?A(t,i,s):ji&&"dblclick"===i&&U?U(t,s):"removeEventListener"in t?"mousewheel"===i?t.removeEventListener("onwheel"in t?"wheel":"mousewheel",r,!1):t.removeEventListener("mouseenter"===i?"mouseover":"mouseleave"===i?"mouseout":i,r,!1):"detachEvent"in t&&t.detachEvent("on"+i,r),void(t[se][s]=null)):this}function Y(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,nt(t),this}function X(t){return q(t,"mousewheel",Y)}function J(t){return V(t,"mousedown touchstart dblclick",Y),q(t,"click",et),this}function $(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Q(t){return $(t),Y(t),this}function tt(t,i){if(!i)return new x(t.clientX,t.clientY);var e=i.getBoundingClientRect();return new x(t.clientX-e.left-i.clientLeft,t.clientY-e.top-i.clientTop)}function it(t){return xi?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/re:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}function et(t){ae[t.type]=!0}function nt(t){var i=ae[t.type];return ae[t.type]=!1,i}function ot(t,i){var e=i.relatedTarget;if(!e)return!0;try{for(;e&&e!==t;)e=e.parentNode}catch(t){return!1}return e!==t}function st(t,i){var e=t.timeStamp||t.originalEvent&&t.originalEvent.timeStamp,n=ci&&e-ci;return n&&n>100&&n<500||t.target._simulatedClick&&!t._simulated?void Q(t):(ci=e,void i(t))}function rt(t){return"string"==typeof t?document.getElementById(t):t}function at(t,i){var e=t.style[i]||t.currentStyle&&t.currentStyle[i];if((!e||"auto"===e)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);e=n?n[i]:null}return"auto"===e?null:e}function ht(t,i,e){var n=document.createElement(t);return n.className=i||"",e&&e.appendChild(n),n}function ut(t){var i=t.parentNode;i&&i.removeChild(t)}function lt(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function ct(t){var i=t.parentNode;i.lastChild!==t&&i.appendChild(t)}function _t(t){var i=t.parentNode;i.firstChild!==t&&i.insertBefore(t,i.firstChild)}function dt(t,i){if(void 0!==t.classList)return t.classList.contains(i);var e=vt(t);return e.length>0&&new RegExp("(^|\\s)"+i+"(\\s|$)").test(e)}function pt(t,i){if(void 0!==t.classList)for(var e=u(i),n=0,o=e.length;n<o;n++)t.classList.add(e[n]);else if(!dt(t,i)){var s=vt(t);ft(t,(s?s+" ":"")+i)}}function mt(t,i){void 0!==t.classList?t.classList.remove(i):ft(t,h((" "+vt(t)+" ").replace(" "+i+" "," ")))}function ft(t,i){void 0===t.className.baseVal?t.className=i:t.className.baseVal=i}function vt(t){return void 0===t.className.baseVal?t.className:t.className.baseVal}function gt(t,i){"opacity"in t.style?t.style.opacity=i:"filter"in t.style&&yt(t,i)}function yt(t,i){var e=!1,n="DXImageTransform.Microsoft.Alpha";try{e=t.filters.item(n)}catch(t){if(1===i)return}i=Math.round(100*i),e?(e.Enabled=100!==i,e.Opacity=i):t.style.filter+=" progid:"+n+"(opacity="+i+")"}function xt(t){for(var i=document.documentElement.style,e=0;e<t.length;e++)if(t[e]in i)return t[e];return!1}function wt(t,i,e){var n=i||new x(0,0);t.style[ue]=(Si?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(e?" scale("+e+")":"")}function Lt(t,i){t._leaflet_pos=i,Ii?wt(t,i):(t.style.left=i.x+"px",t.style.top=i.y+"px")}function Pt(t){return t._leaflet_pos||new x(0,0)}function bt(){V(window,"dragstart",$)}function Tt(){G(window,"dragstart",$)}function zt(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(Mt(),de=t,pe=t.style.outline,t.style.outline="none",V(window,"keydown",Mt))}function Mt(){de&&(de.style.outline=pe,de=void 0,pe=void 0,G(window,"keydown",Mt))}function Ct(t,i){if(!i||!t.length)return t.slice();var e=i*i;return t=kt(t,e),t=Et(t,e)}function Zt(t,i,e){return Math.sqrt(Rt(t,i,e,!0))}function Et(t,i){var e=t.length,n=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(e);n[0]=n[e-1]=1,St(t,n,i,0,e-1);var o,s=[];for(o=0;o<e;o++)n[o]&&s.push(t[o]);return s}function St(t,i,e,n,o){var s,r,a,h=0;for(r=n+1;r<=o-1;r++)(a=Rt(t[r],t[n],t[o],!0))>h&&(s=r,h=a);h>e&&(i[s]=1,St(t,i,e,n,s),St(t,i,e,s,o))}function kt(t,i){for(var e=[t[0]],n=1,o=0,s=t.length;n<s;n++)Ot(t[n],t[o])>i&&(e.push(t[n]),o=n);return o<s-1&&e.push(t[s-1]),e}function Bt(t,i,e,n,o){var s,r,a,h=n?be:At(t,e),u=At(i,e);for(be=u;;){if(!(h|u))return[t,i];if(h&u)return!1;a=At(r=It(t,i,s=h||u,e,o),e),s===h?(t=r,h=a):(i=r,u=a)}}function It(t,i,e,n,o){var s,r,a=i.x-t.x,h=i.y-t.y,u=n.min,l=n.max;return 8&e?(s=t.x+a*(l.y-t.y)/h,r=l.y):4&e?(s=t.x+a*(u.y-t.y)/h,r=u.y):2&e?(s=l.x,r=t.y+h*(l.x-t.x)/a):1&e&&(s=u.x,r=t.y+h*(u.x-t.x)/a),new x(s,r,o)}function At(t,i){var e=0;return t.x<i.min.x?e|=1:t.x>i.max.x&&(e|=2),t.y<i.min.y?e|=4:t.y>i.max.y&&(e|=8),e}function Ot(t,i){var e=i.x-t.x,n=i.y-t.y;return e*e+n*n}function Rt(t,i,e,n){var o,s=i.x,r=i.y,a=e.x-s,h=e.y-r,u=a*a+h*h;return u>0&&((o=((t.x-s)*a+(t.y-r)*h)/u)>1?(s=e.x,r=e.y):o>0&&(s+=a*o,r+=h*o)),a=t.x-s,h=t.y-r,n?a*a+h*h:new x(s,r)}function Dt(t){return!ti(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function Nt(t,i,e){var n,o,s,r,a,h,u,l,c,_=[1,4,2,8];for(o=0,u=t.length;o<u;o++)t[o]._code=At(t[o],i);for(r=0;r<4;r++){for(l=_[r],n=[],o=0,s=(u=t.length)-1;o<u;s=o++)a=t[o],h=t[s],a._code&l?h._code&l||(c=It(h,a,l,i,e),c._code=At(c,i),n.push(c)):(h._code&l&&(c=It(h,a,l,i,e),c._code=At(c,i),n.push(c)),n.push(a));t=n}return t}function jt(t,i){var e,n,o,s,r="Feature"===t.type?t.geometry:t,a=r?r.coordinates:null,h=[],u=i&&i.pointToLayer,l=i&&i.coordsToLatLng||Wt;if(!a&&!r)return null;switch(r.type){case"Point":return e=l(a),u?u(t,e):new Ge(e);case"MultiPoint":for(o=0,s=a.length;o<s;o++)e=l(a[o]),h.push(u?u(t,e):new Ge(e));return new He(h);case"LineString":case"MultiLineString":return n=Ht(a,"LineString"===r.type?0:1,l),new Xe(n,i);case"Polygon":case"MultiPolygon":return n=Ht(a,"Polygon"===r.type?1:2,l),new Je(n,i);case"GeometryCollection":for(o=0,s=r.geometries.length;o<s;o++){var c=jt({geometry:r.geometries[o],type:"Feature",properties:t.properties},i);c&&h.push(c)}return new He(h);default:throw new Error("Invalid GeoJSON object.")}}function Wt(t){return new M(t[1],t[0],t[2])}function Ht(t,i,e){for(var n,o=[],s=0,r=t.length;s<r;s++)n=i?Ht(t[s],i-1,e):(e||Wt)(t[s]),o.push(n);return o}function Ft(t,i){return i="number"==typeof i?i:6,void 0!==t.alt?[a(t.lng,i),a(t.lat,i),a(t.alt,i)]:[a(t.lng,i),a(t.lat,i)]}function Ut(t,i,e,n){for(var o=[],s=0,r=t.length;s<r;s++)o.push(i?Ut(t[s],i-1,e,n):Ft(t[s],n));return!i&&e&&o.push(o[0]),o}function Vt(t,e){return t.feature?i({},t.feature,{geometry:e}):Gt(e)}function Gt(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}function qt(t,i){return new $e(t,i)}function Kt(t,i){return new un(t,i)}function Yt(t){return Ui?new _n(t):null}function Xt(t){return Vi||Gi?new fn(t):null}var Jt=Object.create||function(){function t(){}return function(i){return t.prototype=i,new t}}(),$t=0,Qt=/\{ *([\w_\-]+) *\}/g,ti=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},ii="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",ei=0,ni=window.requestAnimationFrame||p("RequestAnimationFrame")||m,oi=window.cancelAnimationFrame||p("CancelAnimationFrame")||p("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)},si=(Object.freeze||Object)({extend:i,create:Jt,bind:e,lastId:$t,stamp:n,throttle:o,wrapNum:s,falseFn:r,formatNum:a,trim:h,splitWords:u,setOptions:l,getParamString:c,template:_,isArray:ti,indexOf:d,emptyImageUrl:ii,requestFn:ni,cancelFn:oi,requestAnimFrame:f,cancelAnimFrame:v});g.extend=function(t){var e=this,n=function(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},o=n.__super__=this.prototype,s=Jt(o);s.constructor=n,n.prototype=s;for(var r in this)e.hasOwnProperty(r)&&"prototype"!==r&&"__super__"!==r&&(n[r]=e[r]);return t.statics&&(i(n,t.statics),delete t.statics),t.includes&&(y(t.includes),i.apply(null,[s].concat(t.includes)),delete t.includes),s.options&&(t.options=i(Jt(s.options),t.options)),i(s,t),s._initHooks=[],s.callInitHooks=function(){var t=this;if(!this._initHooksCalled){o.callInitHooks&&o.callInitHooks.call(this),this._initHooksCalled=!0;for(var i=0,e=s._initHooks.length;i<e;i++)s._initHooks[i].call(t)}},n},g.include=function(t){return i(this.prototype,t),this},g.mergeOptions=function(t){return i(this.prototype.options,t),this},g.addInitHook=function(t){var i=Array.prototype.slice.call(arguments,1),e="function"==typeof t?t:function(){this[t].apply(this,i)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(e),this};var ri={on:function(t,i,e){var n=this;if("object"==typeof t)for(var o in t)n._on(o,t[o],i);else for(var s=0,r=(t=u(t)).length;s<r;s++)n._on(t[s],i,e);return this},off:function(t,i,e){var n=this;if(t)if("object"==typeof t)for(var o in t)n._off(o,t[o],i);else for(var s=0,r=(t=u(t)).length;s<r;s++)n._off(t[s],i,e);else delete this._events;return this},_on:function(t,i,e){this._events=this._events||{};var n=this._events[t];n||(n=[],this._events[t]=n),e===this&&(e=void 0);for(var o={fn:i,ctx:e},s=n,r=0,a=s.length;r<a;r++)if(s[r].fn===i&&s[r].ctx===e)return;s.push(o)},_off:function(t,i,e){var n,o,s,a=this;if(this._events&&(n=this._events[t])){if(!i){for(o=0,s=n.length;o<s;o++)n[o].fn=r;return void delete this._events[t]}if(e===this&&(e=void 0),n)for(o=0,s=n.length;o<s;o++){var h=n[o];if(h.ctx===e&&h.fn===i)return h.fn=r,a._firingCount&&(a._events[t]=n=n.slice()),void n.splice(o,1)}}},fire:function(t,e,n){var o=this;if(!this.listens(t,n))return this;var s=i({},e,{type:t,target:this});if(this._events){var r=this._events[t];if(r){this._firingCount=this._firingCount+1||1;for(var a=0,h=r.length;a<h;a++){var u=r[a];u.fn.call(u.ctx||o,s)}this._firingCount--}}return n&&this._propagateEvent(s),this},listens:function(t,i){var e=this,n=this._events&&this._events[t];if(n&&n.length)return!0;if(i)for(var o in this._eventParents)if(e._eventParents[o].listens(t,i))return!0;return!1},once:function(t,i,n){var o=this;if("object"==typeof t){for(var s in t)o.once(s,t[s],i);return this}var r=e(function(){this.off(t,i,n).off(t,r,n)},this);return this.on(t,i,n).on(t,r,n)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[n(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[n(t)],this},_propagateEvent:function(t){var e=this;for(var n in this._eventParents)e._eventParents[n].fire(t.type,i({layer:t.target},t),!0)}};ri.addEventListener=ri.on,ri.removeEventListener=ri.clearAllEventListeners=ri.off,ri.addOneTimeEventListener=ri.once,ri.fireEvent=ri.fire,ri.hasEventListeners=ri.listens;var ai=g.extend(ri);x.prototype={clone:function(){return new x(this.x,this.y)},add:function(t){return this.clone()._add(w(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(w(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new x(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new x(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},distanceTo:function(t){var i=(t=w(t)).x-this.x,e=t.y-this.y;return Math.sqrt(i*i+e*e)},equals:function(t){return(t=w(t)).x===this.x&&t.y===this.y},contains:function(t){return t=w(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+a(this.x)+", "+a(this.y)+")"}},P.prototype={extend:function(t){return t=w(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new x((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new x(this.min.x,this.max.y)},getTopRight:function(){return new x(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var i,e;return(t="number"==typeof t[0]||t instanceof x?w(t):b(t))instanceof P?(i=t.min,e=t.max):i=e=t,i.x>=this.min.x&&e.x<=this.max.x&&i.y>=this.min.y&&e.y<=this.max.y},intersects:function(t){t=b(t);var i=this.min,e=this.max,n=t.min,o=t.max,s=o.x>=i.x&&n.x<=e.x,r=o.y>=i.y&&n.y<=e.y;return s&&r},overlaps:function(t){t=b(t);var i=this.min,e=this.max,n=t.min,o=t.max,s=o.x>i.x&&n.x<e.x,r=o.y>i.y&&n.y<e.y;return s&&r},isValid:function(){return!(!this.min||!this.max)}},T.prototype={extend:function(t){var i,e,n=this._southWest,o=this._northEast;if(t instanceof M)i=t,e=t;else{if(!(t instanceof T))return t?this.extend(C(t)||z(t)):this;if(i=t._southWest,e=t._northEast,!i||!e)return this}return n||o?(n.lat=Math.min(i.lat,n.lat),n.lng=Math.min(i.lng,n.lng),o.lat=Math.max(e.lat,o.lat),o.lng=Math.max(e.lng,o.lng)):(this._southWest=new M(i.lat,i.lng),this._northEast=new M(e.lat,e.lng)),this},pad:function(t){var i=this._southWest,e=this._northEast,n=Math.abs(i.lat-e.lat)*t,o=Math.abs(i.lng-e.lng)*t;return new T(new M(i.lat-n,i.lng-o),new M(e.lat+n,e.lng+o))},getCenter:function(){return new M((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new M(this.getNorth(),this.getWest())},getSouthEast:function(){return new M(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof M||"lat"in t?C(t):z(t);var i,e,n=this._southWest,o=this._northEast;return t instanceof T?(i=t.getSouthWest(),e=t.getNorthEast()):i=e=t,i.lat>=n.lat&&e.lat<=o.lat&&i.lng>=n.lng&&e.lng<=o.lng},intersects:function(t){t=z(t);var i=this._southWest,e=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=i.lat&&n.lat<=e.lat,r=o.lng>=i.lng&&n.lng<=e.lng;return s&&r},overlaps:function(t){t=z(t);var i=this._southWest,e=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>i.lat&&n.lat<e.lat,r=o.lng>i.lng&&n.lng<e.lng;return s&&r},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,i){return!!t&&(t=z(t),this._southWest.equals(t.getSouthWest(),i)&&this._northEast.equals(t.getNorthEast(),i))},isValid:function(){return!(!this._southWest||!this._northEast)}},M.prototype={equals:function(t,i){return!!t&&(t=C(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===i?1e-9:i))},toString:function(t){return"LatLng("+a(this.lat,t)+", "+a(this.lng,t)+")"},distanceTo:function(t){return ui.distance(this,C(t))},wrap:function(){return ui.wrapLatLng(this)},toBounds:function(t){var i=180*t/40075017,e=i/Math.cos(Math.PI/180*this.lat);return z([this.lat-i,this.lng-e],[this.lat+i,this.lng+e])},clone:function(){return new M(this.lat,this.lng,this.alt)}};var hi={latLngToPoint:function(t,i){var e=this.projection.project(t),n=this.scale(i);return this.transformation._transform(e,n)},pointToLatLng:function(t,i){var e=this.scale(i),n=this.transformation.untransform(t,e);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var i=this.projection.bounds,e=this.scale(t);return new P(this.transformation.transform(i.min,e),this.transformation.transform(i.max,e))},infinite:!1,wrapLatLng:function(t){var i=this.wrapLng?s(t.lng,this.wrapLng,!0):t.lng;return new M(this.wrapLat?s(t.lat,this.wrapLat,!0):t.lat,i,t.alt)},wrapLatLngBounds:function(t){var i=t.getCenter(),e=this.wrapLatLng(i),n=i.lat-e.lat,o=i.lng-e.lng;if(0===n&&0===o)return t;var s=t.getSouthWest(),r=t.getNorthEast();return new T(new M(s.lat-n,s.lng-o),new M(r.lat-n,r.lng-o))}},ui=i({},hi,{wrapLng:[-180,180],R:6371e3,distance:function(t,i){var e=Math.PI/180,n=t.lat*e,o=i.lat*e,s=Math.sin(n)*Math.sin(o)+Math.cos(n)*Math.cos(o)*Math.cos((i.lng-t.lng)*e);return this.R*Math.acos(Math.min(s,1))}}),li={R:6378137,MAX_LATITUDE:85.0511287798,project:function(t){var i=Math.PI/180,e=this.MAX_LATITUDE,n=Math.max(Math.min(e,t.lat),-e),o=Math.sin(n*i);return new x(this.R*t.lng*i,this.R*Math.log((1+o)/(1-o))/2)},unproject:function(t){var i=180/Math.PI;return new M((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*i,t.x*i/this.R)},bounds:function(){var t=6378137*Math.PI;return new P([-t,-t],[t,t])}()};Z.prototype={transform:function(t,i){return this._transform(t.clone(),i)},_transform:function(t,i){return i=i||1,t.x=i*(this._a*t.x+this._b),t.y=i*(this._c*t.y+this._d),t},untransform:function(t,i){return i=i||1,new x((t.x/i-this._b)/this._a,(t.y/i-this._d)/this._c)}};var ci,_i,di,pi,mi=i({},ui,{code:"EPSG:3857",projection:li,transformation:function(){var t=.5/(Math.PI*li.R);return E(t,.5,-t,.5)}()}),fi=i({},mi,{code:"EPSG:900913"}),vi=document.documentElement.style,gi="ActiveXObject"in window,yi=gi&&!document.addEventListener,xi="msLaunchUri"in navigator&&!("documentMode"in document),wi=B("webkit"),Li=B("android"),Pi=B("android 2")||B("android 3"),bi=!!window.opera,Ti=B("chrome"),zi=B("gecko")&&!wi&&!bi&&!gi,Mi=!Ti&&B("safari"),Ci=B("phantom"),Zi="OTransition"in vi,Ei=0===navigator.platform.indexOf("Win"),Si=gi&&"transition"in vi,ki="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!Pi,Bi="MozPerspective"in vi,Ii=!window.L_DISABLE_3D&&(Si||ki||Bi)&&!Zi&&!Ci,Ai="undefined"!=typeof orientation||B("mobile"),Oi=Ai&&wi,Ri=Ai&&ki,Di=!window.PointerEvent&&window.MSPointerEvent,Ni=!(!window.PointerEvent&&!Di),ji=!window.L_NO_TOUCH&&(Ni||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),Wi=Ai&&bi,Hi=Ai&&zi,Fi=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Ui=!!document.createElement("canvas").getContext,Vi=!(!document.createElementNS||!S("svg").createSVGRect),Gi=!Vi&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(t){return!1}}(),qi=(Object.freeze||Object)({ie:gi,ielt9:yi,edge:xi,webkit:wi,android:Li,android23:Pi,opera:bi,chrome:Ti,gecko:zi,safari:Mi,phantom:Ci,opera12:Zi,win:Ei,ie3d:Si,webkit3d:ki,gecko3d:Bi,any3d:Ii,mobile:Ai,mobileWebkit:Oi,mobileWebkit3d:Ri,msPointer:Di,pointer:Ni,touch:ji,mobileOpera:Wi,mobileGecko:Hi,retina:Fi,canvas:Ui,svg:Vi,vml:Gi}),Ki=Di?"MSPointerDown":"pointerdown",Yi=Di?"MSPointerMove":"pointermove",Xi=Di?"MSPointerUp":"pointerup",Ji=Di?"MSPointerCancel":"pointercancel",$i=["INPUT","SELECT","OPTION"],Qi={},te=!1,ie=0,ee=Di?"MSPointerDown":Ni?"pointerdown":"touchstart",ne=Di?"MSPointerUp":Ni?"pointerup":"touchend",oe="_leaflet_",se="_leaflet_events",re=Ei&&Ti?2*window.devicePixelRatio:zi?window.devicePixelRatio:1,ae={},he=(Object.freeze||Object)({on:V,off:G,stopPropagation:Y,disableScrollPropagation:X,disableClickPropagation:J,preventDefault:$,stop:Q,getMousePosition:tt,getWheelDelta:it,fakeStop:et,skipped:nt,isExternalTarget:ot,addListener:V,removeListener:G}),ue=xt(["transform","WebkitTransform","OTransform","MozTransform","msTransform"]),le=xt(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ce="webkitTransition"===le||"OTransition"===le?le+"End":"transitionend";if("onselectstart"in document)_i=function(){V(window,"selectstart",$)},di=function(){G(window,"selectstart",$)};else{var _e=xt(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);_i=function(){if(_e){var t=document.documentElement.style;pi=t[_e],t[_e]="none"}},di=function(){_e&&(document.documentElement.style[_e]=pi,pi=void 0)}}var de,pe,me=(Object.freeze||Object)({TRANSFORM:ue,TRANSITION:le,TRANSITION_END:ce,get:rt,getStyle:at,create:ht,remove:ut,empty:lt,toFront:ct,toBack:_t,hasClass:dt,addClass:pt,removeClass:mt,setClass:ft,getClass:vt,setOpacity:gt,testProp:xt,setTransform:wt,setPosition:Lt,getPosition:Pt,disableTextSelection:_i,enableTextSelection:di,disableImageDrag:bt,enableImageDrag:Tt,preventOutline:zt,restoreOutline:Mt}),fe=ai.extend({run:function(t,i,e,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=e||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=Pt(t),this._offset=i.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=f(this._animate,this),this._step()},_step:function(t){var i=+new Date-this._startTime,e=1e3*this._duration;i<e?this._runFrame(this._easeOut(i/e),t):(this._runFrame(1),this._complete())},_runFrame:function(t,i){var e=this._startPos.add(this._offset.multiplyBy(t));i&&e._round(),Lt(this._el,e),this.fire("step")},_complete:function(){v(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),ve=ai.extend({options:{crs:mi,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,i){i=l(this,i),this._initContainer(t),this._initLayout(),this._onResize=e(this._onResize,this),this._initEvents(),i.maxBounds&&this.setMaxBounds(i.maxBounds),void 0!==i.zoom&&(this._zoom=this._limitZoom(i.zoom)),i.center&&void 0!==i.zoom&&this.setView(C(i.center),i.zoom,{reset:!0}),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this.callInitHooks(),this._zoomAnimated=le&&Ii&&!Wi&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),V(this._proxy,ce,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,n){return e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(C(t),e,this.options.maxBounds),n=n||{},this._stop(),this._loaded&&!n.reset&&!0!==n&&(void 0!==n.animate&&(n.zoom=i({animate:n.animate},n.zoom),n.pan=i({animate:n.animate,duration:n.duration},n.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,n.zoom):this._tryAnimatedPan(t,n.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e),this)},setZoom:function(t,i){return this._loaded?this.setView(this.getCenter(),t,{zoom:i}):(this._zoom=t,this)},zoomIn:function(t,i){return t=t||(Ii?this.options.zoomDelta:1),this.setZoom(this._zoom+t,i)},zoomOut:function(t,i){return t=t||(Ii?this.options.zoomDelta:1),this.setZoom(this._zoom-t,i)},setZoomAround:function(t,i,e){var n=this.getZoomScale(i),o=this.getSize().divideBy(2),s=(t instanceof x?t:this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1-1/n),r=this.containerPointToLatLng(o.add(s));return this.setView(r,i,{zoom:e})},_getBoundsCenterZoom:function(t,i){i=i||{},t=t.getBounds?t.getBounds():z(t);var e=w(i.paddingTopLeft||i.padding||[0,0]),n=w(i.paddingBottomRight||i.padding||[0,0]),o=this.getBoundsZoom(t,!1,e.add(n));if((o="number"==typeof i.maxZoom?Math.min(i.maxZoom,o):o)===1/0)return{center:t.getCenter(),zoom:o};var s=n.subtract(e).divideBy(2),r=this.project(t.getSouthWest(),o),a=this.project(t.getNorthEast(),o);return{center:this.unproject(r.add(a).divideBy(2).add(s),o),zoom:o}},fitBounds:function(t,i){if(!(t=z(t)).isValid())throw new Error("Bounds are not valid.");var e=this._getBoundsCenterZoom(t,i);return this.setView(e.center,e.zoom,i)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,i){return this.setView(t,this._zoom,{pan:i})},panBy:function(t,i){if(t=w(t).round(),i=i||{},!t.x&&!t.y)return this.fire("moveend");if(!0!==i.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new fe,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),i.noMoveStart||this.fire("movestart"),!1!==i.animate){pt(this._mapPane,"leaflet-pan-anim");var e=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,e,i.duration||.25,i.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,i,e){function n(t){var i=(v*v-m*m+(t?-1:1)*x*x*g*g)/(2*(t?v:m)*x*g),e=Math.sqrt(i*i+1)-i;return e<1e-9?-18:Math.log(e)}function o(t){return(Math.exp(t)-Math.exp(-t))/2}function s(t){return(Math.exp(t)+Math.exp(-t))/2}function r(t){return o(t)/s(t)}function a(t){return m*(s(w)/s(w+y*t))}function h(t){return m*(s(w)*r(w+y*t)-o(w))/x}function u(t){return 1-Math.pow(1-t,1.5)}function l(){var e=(Date.now()-L)/b,n=u(e)*P;e<=1?(this._flyToFrame=f(l,this),this._move(this.unproject(c.add(_.subtract(c).multiplyBy(h(n)/g)),p),this.getScaleZoom(m/a(n),p),{flyTo:!0})):this._move(t,i)._moveEnd(!0)}if(!1===(e=e||{}).animate||!Ii)return this.setView(t,i,e);this._stop();var c=this.project(this.getCenter()),_=this.project(t),d=this.getSize(),p=this._zoom;t=C(t),i=void 0===i?p:i;var m=Math.max(d.x,d.y),v=m*this.getZoomScale(p,i),g=_.distanceTo(c)||1,y=1.42,x=y*y,w=n(0),L=Date.now(),P=(n(1)-w)/y,b=e.duration?1e3*e.duration:1e3*P*.8;return this._moveStart(!0),l.call(this),this},flyToBounds:function(t,i){var e=this._getBoundsCenterZoom(t,i);return this.flyTo(e.center,e.zoom,i)},setMaxBounds:function(t){return(t=z(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){return this.options.minZoom=t,this._loaded&&this.getZoom()<this.options.minZoom?this.setZoom(t):this},setMaxZoom:function(t){return this.options.maxZoom=t,this._loaded&&this.getZoom()>this.options.maxZoom?this.setZoom(t):this},panInsideBounds:function(t,i){this._enforcingBounds=!0;var e=this.getCenter(),n=this._limitCenter(e,this._zoom,z(t));return e.equals(n)||this.panTo(n,i),this._enforcingBounds=!1,this},invalidateSize:function(t){if(!this._loaded)return this;t=i({animate:!1,pan:!0},!0===t?{animate:!0}:t);var n=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var o=this.getSize(),s=n.divideBy(2).round(),r=o.divideBy(2).round(),a=s.subtract(r);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(e(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:n,newSize:o})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=i({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var n=e(this._handleGeolocationResponse,this),o=e(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(n,o,t):navigator.geolocation.getCurrentPosition(n,o,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var i=t.code,e=t.message||(1===i?"permission denied":2===i?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:i,message:"Geolocation error: "+e+"."})},_handleGeolocationResponse:function(t){var i=new M(t.coords.latitude,t.coords.longitude),e=i.toBounds(t.coords.accuracy),n=this._locateOptions;if(n.setView){var o=this.getBoundsZoom(e);this.setView(i,n.maxZoom?Math.min(o,n.maxZoom):o)}var s={latlng:i,bounds:e,timestamp:t.timestamp};for(var r in t.coords)"number"==typeof t.coords[r]&&(s[r]=t.coords[r]);this.fire("locationfound",s)},addHandler:function(t,i){if(!i)return this;var e=this[t]=new i(this);return this._handlers.push(e),this.options[t]&&e.enable(),this},remove:function(){var t=this;if(this._initEvents(!0),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(i){this._container._leaflet_id=void 0,this._containerId=void 0}ut(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._clearHandlers(),this._loaded&&this.fire("unload");var i;for(i in this._layers)t._layers[i].remove();for(i in this._panes)ut(t._panes[i]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,i){var e=ht("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),i||this._mapPane);return t&&(this._panes[t]=e),e},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new T(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,i,e){t=z(t),e=w(e||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=t.getSouthEast(),h=this.getSize().subtract(e),u=b(this.project(a,n),this.project(r,n)).getSize(),l=Ii?this.options.zoomSnap:1,c=h.x/u.x,_=h.y/u.y,d=i?Math.max(c,_):Math.min(c,_);return n=this.getScaleZoom(d,n),l&&(n=Math.round(n/(l/100))*(l/100),n=i?Math.ceil(n/l)*l:Math.floor(n/l)*l),Math.max(o,Math.min(s,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new x(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,i){var e=this._getTopLeftPoint(t,i);return new P(e,e.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,i){var e=this.options.crs;return i=void 0===i?this._zoom:i,e.scale(t)/e.scale(i)},getScaleZoom:function(t,i){var e=this.options.crs;i=void 0===i?this._zoom:i;var n=e.zoom(t*e.scale(i));return isNaN(n)?1/0:n},project:function(t,i){return i=void 0===i?this._zoom:i,this.options.crs.latLngToPoint(C(t),i)},unproject:function(t,i){return i=void 0===i?this._zoom:i,this.options.crs.pointToLatLng(w(t),i)},layerPointToLatLng:function(t){var i=w(t).add(this.getPixelOrigin());return this.unproject(i)},latLngToLayerPoint:function(t){return this.project(C(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(C(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(z(t))},distance:function(t,i){return this.options.crs.distance(C(t),C(i))},containerPointToLayerPoint:function(t){return w(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return w(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var i=this.containerPointToLayerPoint(w(t));return this.layerPointToLatLng(i)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(C(t)))},mouseEventToContainerPoint:function(t){return tt(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var i=this._container=rt(t);if(!i)throw new Error("Map container not found.");if(i._leaflet_id)throw new Error("Map container is already initialized.");V(i,"scroll",this._onScroll,this),this._containerId=n(i)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&Ii,pt(t,"leaflet-container"+(ji?" leaflet-touch":"")+(Fi?" leaflet-retina":"")+(yi?" leaflet-oldie":"")+(Mi?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var i=at(t,"position");"absolute"!==i&&"relative"!==i&&"fixed"!==i&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Lt(this._mapPane,new x(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(pt(t.markerPane,"leaflet-zoom-hide"),pt(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,i){Lt(this._mapPane,new x(0,0));var e=!this._loaded;this._loaded=!0,i=this._limitZoom(i),this.fire("viewprereset");var n=this._zoom!==i;this._moveStart(n)._move(t,i)._moveEnd(n),this.fire("viewreset"),e&&this.fire("load")},_moveStart:function(t){return t&&this.fire("zoomstart"),this.fire("movestart")},_move:function(t,i,e){void 0===i&&(i=this._zoom);var n=this._zoom!==i;return this._zoom=i,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(n||e&&e.pinch)&&this.fire("zoom",e),this.fire("move",e)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return v(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Lt(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[n(this._container)]=this;var i=t?G:V;i(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress",this._handleDOMEvent,this),this.options.trackResize&&i(window,"resize",this._onResize,this),Ii&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){v(this._resizeRequest),this._resizeRequest=f(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,i){for(var e,o=this,s=[],r="mouseout"===i||"mouseover"===i,a=t.target||t.srcElement,h=!1;a;){if((e=o._targets[n(a)])&&("click"===i||"preclick"===i)&&!t._simulated&&o._draggableMoved(e)){h=!0;break}if(e&&e.listens(i,!0)){if(r&&!ot(a,t))break;if(s.push(e),r)break}if(a===o._container)break;a=a.parentNode}return s.length||h||r||!ot(a,t)||(s=[this]),s},_handleDOMEvent:function(t){if(this._loaded&&!nt(t)){var i=t.type;"mousedown"!==i&&"keypress"!==i||zt(t.target||t.srcElement),this._fireDOMEvent(t,i)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,n){var o=this;if("click"===t.type){var s=i({},t);s.type="preclick",this._fireDOMEvent(s,s.type,n)}if(!t._stopped&&(n=(n||[]).concat(this._findEventTargets(t,e))).length){var r=n[0];"contextmenu"===e&&r.listens(e,!0)&&$(t);var a={originalEvent:t};if("keypress"!==t.type){var h=r.options&&"icon"in r.options;a.containerPoint=h?this.latLngToContainerPoint(r.getLatLng()):this.mouseEventToContainerPoint(t),a.layerPoint=this.containerPointToLayerPoint(a.containerPoint),a.latlng=h?r.getLatLng():this.layerPointToLatLng(a.layerPoint)}for(var u=0;u<n.length;u++)if(n[u].fire(e,a,!0),a.originalEvent._stopped||!1===n[u].options.bubblingMouseEvents&&-1!==d(o._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=this,i=0,e=this._handlers.length;i<e;i++)t._handlers[i].disable()},whenReady:function(t,i){return this._loaded?t.call(i||this,{target:this}):this.on("load",t,i),this},_getMapPanePos:function(){return Pt(this._mapPane)||new x(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,i){return(t&&void 0!==i?this._getNewPixelOrigin(t,i):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,i){var e=this.getSize()._divideBy(2);return this.project(t,i)._subtract(e)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,i,e){var n=this._getNewPixelOrigin(e,i);return this.project(t,i)._subtract(n)},_latLngBoundsToNewLayerBounds:function(t,i,e){var n=this._getNewPixelOrigin(e,i);return b([this.project(t.getSouthWest(),i)._subtract(n),this.project(t.getNorthWest(),i)._subtract(n),this.project(t.getSouthEast(),i)._subtract(n),this.project(t.getNorthEast(),i)._subtract(n)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,i,e){if(!e)return t;var n=this.project(t,i),o=this.getSize().divideBy(2),s=new P(n.subtract(o),n.add(o)),r=this._getBoundsOffset(s,e,i);return r.round().equals([0,0])?t:this.unproject(n.add(r),i)},_limitOffset:function(t,i){if(!i)return t;var e=this.getPixelBounds(),n=new P(e.min.add(t),e.max.add(t));return t.add(this._getBoundsOffset(n,i))},_getBoundsOffset:function(t,i,e){var n=b(this.project(i.getNorthEast(),e),this.project(i.getSouthWest(),e)),o=n.min.subtract(t.min),s=n.max.subtract(t.max);return new x(this._rebound(o.x,-s.x),this._rebound(o.y,-s.y))},_rebound:function(t,i){return t+i>0?Math.round(t-i)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(i))},_limitZoom:function(t){var i=this.getMinZoom(),e=this.getMaxZoom(),n=Ii?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(i,Math.min(e,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){mt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,i){var e=this._getCenterOffset(t)._floor();return!(!0!==(i&&i.animate)&&!this.getSize().contains(e)||(this.panBy(e,i),0))},_createAnimProxy:function(){var t=this._proxy=ht("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(t){var i=ue,e=this._proxy.style[i];wt(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),e===this._proxy.style[i]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",function(){var t=this.getCenter(),i=this.getZoom();wt(this._proxy,this.project(t,i),this.getZoomScale(i,1))},this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ut(this._proxy),delete this._proxy},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,i,e){if(this._animatingZoom)return!0;if(e=e||{},!this._zoomAnimated||!1===e.animate||this._nothingToAnimate()||Math.abs(i-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(i),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==e.animate&&!this.getSize().contains(o)||(f(function(){this._moveStart(!0)._animateZoom(t,i,!0)},this),0))},_animateZoom:function(t,i,n,o){n&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=i,pt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:i,noUpdate:o}),setTimeout(e(this._onZoomTransitionEnd,this),250)},_onZoomTransitionEnd:function(){this._animatingZoom&&(mt(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),f(function(){this._moveEnd(!0)},this))}}),ge=g.extend({options:{position:"topright"},initialize:function(t){l(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var i=this._map;return i&&i.removeControl(this),this.options.position=t,i&&i.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var i=this._container=this.onAdd(t),e=this.getPosition(),n=t._controlCorners[e];return pt(i,"leaflet-control"),-1!==e.indexOf("bottom")?n.insertBefore(i,n.firstChild):n.appendChild(i),this},remove:function(){return this._map?(ut(this._container),this.onRemove&&this.onRemove(this._map),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),ye=function(t){return new ge(t)};ve.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){function t(t,o){var s=e+t+" "+e+o;i[t+o]=ht("div",s,n)}var i=this._controlCorners={},e="leaflet-",n=this._controlContainer=ht("div",e+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){var t=this;for(var i in this._controlCorners)ut(t._controlCorners[i]);ut(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var xe=ge.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,i,e,n){return e<n?-1:n<e?1:0}},initialize:function(t,i,e){var n=this;l(this,e),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1;for(var o in t)n._addLayer(t[o],o);for(o in i)n._addLayer(i[o],o,!0)},onAdd:function(t){var i=this;this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)i._layers[e].layer.on("add remove",i._onLayerChange,i);return this._container},addTo:function(t){return ge.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){var t=this;this._map.off("zoomend",this._checkDisabledLayers,this);for(var i=0;i<this._layers.length;i++)t._layers[i].layer.off("add remove",t._onLayerChange,t)},addBaseLayer:function(t,i){return this._addLayer(t,i),this._map?this._update():this},addOverlay:function(t,i){return this._addLayer(t,i,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var i=this._getLayer(n(t));return i&&this._layers.splice(this._layers.indexOf(i),1),this._map?this._update():this},expand:function(){pt(this._container,"leaflet-control-layers-expanded"),this._form.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._form.clientHeight?(pt(this._form,"leaflet-control-layers-scrollbar"),this._form.style.height=t+"px"):mt(this._form,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return mt(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",i=this._container=ht("div",t),n=this.options.collapsed;i.setAttribute("aria-haspopup",!0),J(i),X(i);var o=this._form=ht("form",t+"-list");n&&(this._map.on("click",this.collapse,this),Li||V(i,{mouseenter:this.expand,mouseleave:this.collapse},this));var s=this._layersLink=ht("a",t+"-toggle",i);s.href="#",s.title="Layers",ji?(V(s,"click",Q),V(s,"click",this.expand,this)):V(s,"focus",this.expand,this),V(o,"click",function(){setTimeout(e(this._onInputClick,this),0)},this),n||this.expand(),this._baseLayersList=ht("div",t+"-base",o),this._separator=ht("div",t+"-separator",o),this._overlaysList=ht("div",t+"-overlays",o),i.appendChild(o)},_getLayer:function(t){for(var i=this,e=0;e<this._layers.length;e++)if(i._layers[e]&&n(i._layers[e].layer)===t)return i._layers[e]},_addLayer:function(t,i,e){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:i,overlay:e}),this.options.sortLayers&&this._layers.sort(L.bind(function(t,i){return this.options.sortFunction(t.layer,i.layer,t.name,i.name)},this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){var t=this;if(!this._container)return this;lt(this._baseLayersList),lt(this._overlaysList),this._layerControlInputs=[];var i,e,n,o,s=0;for(n=0;n<this._layers.length;n++)o=t._layers[n],t._addItem(o),e=e||o.overlay,i=i||!o.overlay,s+=o.overlay?0:1;return this.options.hideSingleBase&&(i=i&&s>1,this._baseLayersList.style.display=i?"":"none"),this._separator.style.display=e&&i?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var i=this._getLayer(n(t.target)),e=i.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;e&&this._map.fire(e,i)},_createRadioElement:function(t,i){var e='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(i?' checked="checked"':"")+"/>",n=document.createElement("div");return n.innerHTML=e,n.firstChild},_addItem:function(t){var i,e=document.createElement("label"),o=this._map.hasLayer(t.layer);t.overlay?(i=document.createElement("input"),i.type="checkbox",i.className="leaflet-control-layers-selector",i.defaultChecked=o):i=this._createRadioElement("leaflet-base-layers",o),this._layerControlInputs.push(i),i.layerId=n(t.layer),V(i,"click",this._onInputClick,this);var s=document.createElement("span");s.innerHTML=" "+t.name;var r=document.createElement("div");return e.appendChild(r),r.appendChild(i),r.appendChild(s),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(e),this._checkDisabledLayers(),e},_onInputClick:function(){var t,i,e,n=this,o=this._layerControlInputs,s=[],r=[];this._handlingClick=!0;for(var a=o.length-1;a>=0;a--)t=o[a],i=n._getLayer(t.layerId).layer,e=n._map.hasLayer(i),t.checked&&!e?s.push(i):!t.checked&&e&&r.push(i);for(a=0;a<r.length;a++)n._map.removeLayer(r[a]);for(a=0;a<s.length;a++)n._map.addLayer(s[a]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,i,e=this,n=this._layerControlInputs,o=this._map.getZoom(),s=n.length-1;s>=0;s--)t=n[s],i=e._getLayer(t.layerId).layer,t.disabled=void 0!==i.options.minZoom&&o<i.options.minZoom||void 0!==i.options.maxZoom&&o>i.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),we=ge.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"&#x2212;",zoomOutTitle:"Zoom out"},onAdd:function(t){var i="leaflet-control-zoom",e=ht("div",i+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,i+"-in",e,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,i+"-out",e,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),e},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,i,e,n,o){var s=ht("a",e,n);return s.innerHTML=t,s.href="#",s.title=i,s.setAttribute("role","button"),s.setAttribute("aria-label",i),J(s),V(s,"click",Q),V(s,"click",o,this),V(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,i="leaflet-disabled";mt(this._zoomInButton,i),mt(this._zoomOutButton,i),(this._disabled||t._zoom===t.getMinZoom())&&pt(this._zoomOutButton,i),(this._disabled||t._zoom===t.getMaxZoom())&&pt(this._zoomInButton,i)}});ve.mergeOptions({zoomControl:!0}),ve.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new we,this.addControl(this.zoomControl))});var Le=ge.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var i="leaflet-control-scale",e=ht("div",i),n=this.options;return this._addScales(n,i+"-line",e),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),e},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,i,e){t.metric&&(this._mScale=ht("div",i,e)),t.imperial&&(this._iScale=ht("div",i,e))},_update:function(){var t=this._map,i=t.getSize().y/2,e=t.distance(t.containerPointToLatLng([0,i]),t.containerPointToLatLng([this.options.maxWidth,i]));this._updateScales(e)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var i=this._getRoundNum(t),e=i<1e3?i+" m":i/1e3+" km";this._updateScale(this._mScale,e,i/t)},_updateImperial:function(t){var i,e,n,o=3.2808399*t;o>5280?(i=o/5280,e=this._getRoundNum(i),this._updateScale(this._iScale,e+" mi",e/i)):(n=this._getRoundNum(o),this._updateScale(this._iScale,n+" ft",n/o))},_updateScale:function(t,i,e){t.style.width=Math.round(this.options.maxWidth*e)+"px",t.innerHTML=i},_getRoundNum:function(t){var i=Math.pow(10,(Math.floor(t)+"").length-1),e=t/i;return e=e>=10?10:e>=5?5:e>=3?3:e>=2?2:1,i*e}}),Pe=ge.extend({options:{position:"bottomright",prefix:'<a href="http://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){l(this,t),this._attributions={}},onAdd:function(t){var i=this;t.attributionControl=this,this._container=ht("div","leaflet-control-attribution"),J(this._container);for(var e in t._layers)t._layers[e].getAttribution&&i.addAttribution(t._layers[e].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){var t=this;if(this._map){var i=[];for(var e in this._attributions)t._attributions[e]&&i.push(e);var n=[];this.options.prefix&&n.push(this.options.prefix),i.length&&n.push(i.join(", ")),this._container.innerHTML=n.join(" | ")}}});ve.mergeOptions({attributionControl:!0}),ve.addInitHook(function(){this.options.attributionControl&&(new Pe).addTo(this)});ge.Layers=xe,ge.Zoom=we,ge.Scale=Le,ge.Attribution=Pe,ye.layers=function(t,i,e){return new xe(t,i,e)},ye.zoom=function(t){return new we(t)},ye.scale=function(t){return new Le(t)},ye.attribution=function(t){return new Pe(t)};var be,Te=g.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}}),ze={Events:ri},Me=!1,Ce=ji?"touchstart mousedown":"mousedown",Ze={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},Ee={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},Se=ai.extend({options:{clickTolerance:3},initialize:function(t,i,e,n){l(this,n),this._element=t,this._dragStartTarget=i||t,this._preventOutline=e},enable:function(){this._enabled||(V(this._dragStartTarget,Ce,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(L.Draggable._dragging===this&&this.finishDrag(),G(this._dragStartTarget,Ce,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!dt(this._element,"leaflet-zoom-anim")&&!(Me||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(Me=this,this._preventOutline&&zt(this._element),bt(),_i(),this._moving)))){this.fire("down");var i=t.touches?t.touches[0]:t;this._startPoint=new x(i.clientX,i.clientY),V(document,Ee[t.type],this._onMove,this),V(document,Ze[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled){if(t.touches&&t.touches.length>1)return void(this._moved=!0);var i=t.touches&&1===t.touches.length?t.touches[0]:t,e=new x(i.clientX,i.clientY).subtract(this._startPoint);(e.x||e.y)&&(Math.abs(e.x)+Math.abs(e.y)<this.options.clickTolerance||($(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=Pt(this._element).subtract(e),pt(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),pt(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(e),this._moving=!0,v(this._animRequest),this._lastEvent=t,this._animRequest=f(this._updatePosition,this,!0)))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Lt(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){var t=this;mt(document.body,"leaflet-dragging"),this._lastTarget&&(mt(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null);for(var i in Ee)G(document,Ee[i],t._onMove,t),G(document,Ze[i],t._onUp,t);Tt(),di(),this._moved&&this._moving&&(v(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1,Me=!1}}),ke=(Object.freeze||Object)({simplify:Ct,pointToSegmentDistance:Zt,closestPointOnSegment:function(t,i,e){return Rt(t,i,e)},clipSegment:Bt,_getEdgeIntersection:It,_getBitCode:At,_sqClosestPointOnSegment:Rt,_flat:Dt}),Be=(Object.freeze||Object)({clipPolygon:Nt}),Ie={project:function(t){return new x(t.lng,t.lat)},unproject:function(t){return new M(t.y,t.x)},bounds:new P([-180,-90],[180,90])},Ae={R:6378137,R_MINOR:6356752.314245179,bounds:new P([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var i=Math.PI/180,e=this.R,n=t.lat*i,o=this.R_MINOR/e,s=Math.sqrt(1-o*o),r=s*Math.sin(n),a=Math.tan(Math.PI/4-n/2)/Math.pow((1-r)/(1+r),s/2);return n=-e*Math.log(Math.max(a,1e-10)),new x(t.lng*i*e,n)},unproject:function(t){for(var i,e=180/Math.PI,n=this.R,o=this.R_MINOR/n,s=Math.sqrt(1-o*o),r=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(r),h=0,u=.1;h<15&&Math.abs(u)>1e-7;h++)i=s*Math.sin(a),i=Math.pow((1-i)/(1+i),s/2),u=Math.PI/2-2*Math.atan(r*i)-a,a+=u;return new M(a*e,t.x*e/n)}},Oe=(Object.freeze||Object)({LonLat:Ie,Mercator:Ae,SphericalMercator:li}),Re=i({},ui,{code:"EPSG:3395",projection:Ae,transformation:function(){var t=.5/(Math.PI*Ae.R);return E(t,.5,-t,.5)}()}),De=i({},ui,{code:"EPSG:4326",projection:Ie,transformation:E(1/180,1,-1/180,.5)}),Ne=i({},hi,{projection:Ie,transformation:E(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,i){var e=i.lng-t.lng,n=i.lat-t.lat;return Math.sqrt(e*e+n*n)},infinite:!0});hi.Earth=ui,hi.EPSG3395=Re,hi.EPSG3857=mi,hi.EPSG900913=fi,hi.EPSG4326=De,hi.Simple=Ne;var je=ai.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[n(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[n(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var i=t.target;if(i.hasLayer(this)){if(this._map=i,this._zoomAnimated=i._zoomAnimated,this.getEvents){var e=this.getEvents();i.on(e,this),this.once("remove",function(){i.off(e,this)},this)}this.onAdd(i),this.getAttribution&&i.attributionControl&&i.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),i.fire("layeradd",{layer:this})}}});ve.include({addLayer:function(t){var i=n(t);return this._layers[i]?this:(this._layers[i]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t),this)},removeLayer:function(t){var i=n(t);return this._layers[i]?(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),delete this._layers[i],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return!!t&&n(t)in this._layers},eachLayer:function(t,i){var e=this;for(var n in this._layers)t.call(i,e._layers[n]);return this},_addLayers:function(t){for(var i=this,e=0,n=(t=t?ti(t)?t:[t]:[]).length;e<n;e++)i.addLayer(t[e])},_addZoomLimit:function(t){!isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[n(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var i=n(t);this._zoomBoundLayers[i]&&(delete this._zoomBoundLayers[i],this._updateZoomLevels())},_updateZoomLevels:function(){var t=this,i=1/0,e=-1/0,n=this._getZoomSpan();for(var o in this._zoomBoundLayers){var s=t._zoomBoundLayers[o].options;i=void 0===s.minZoom?i:Math.min(i,s.minZoom),e=void 0===s.maxZoom?e:Math.max(e,s.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=i===1/0?void 0:i,n!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var We=je.extend({initialize:function(t){var i=this;this._layers={};var e,n;if(t)for(e=0,n=t.length;e<n;e++)i.addLayer(t[e])},addLayer:function(t){var i=this.getLayerId(t);return this._layers[i]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var i=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[i]&&this._map.removeLayer(this._layers[i]),delete this._layers[i],this},hasLayer:function(t){return!!t&&(t in this._layers||this.getLayerId(t)in this._layers)},clearLayers:function(){var t=this;for(var i in this._layers)t.removeLayer(t._layers[i]);return this},invoke:function(t){var i,e,n=this,o=Array.prototype.slice.call(arguments,1);for(i in this._layers)(e=n._layers[i])[t]&&e[t].apply(e,o);return this},onAdd:function(t){var i=this;for(var e in this._layers)t.addLayer(i._layers[e])},onRemove:function(t){var i=this;for(var e in this._layers)t.removeLayer(i._layers[e])},eachLayer:function(t,i){var e=this;for(var n in this._layers)t.call(i,e._layers[n]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=this,i=[];for(var e in this._layers)i.push(t._layers[e]);return i},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return n(t)}}),He=We.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),We.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),We.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=this,i=new T;for(var e in this._layers){var n=t._layers[e];i.extend(n.getBounds?n.getBounds():n.getLatLng())}return i}}),Fe=g.extend({initialize:function(t){l(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,i){var e=this._getIconUrl(t);if(!e){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n=this._createImg(e,i&&"IMG"===i.tagName?i:null);return this._setIconStyles(n,t),n},_setIconStyles:function(t,i){var e=this.options,n=e[i+"Size"];"number"==typeof n&&(n=[n,n]);var o=w(n),s=w("shadow"===i&&e.shadowAnchor||e.iconAnchor||o&&o.divideBy(2,!0));t.className="leaflet-marker-"+i+" "+(e.className||""),s&&(t.style.marginLeft=-s.x+"px",t.style.marginTop=-s.y+"px"),o&&(t.style.width=o.x+"px",t.style.height=o.y+"px")},_createImg:function(t,i){return i=i||document.createElement("img"),i.src=t,i},_getIconUrl:function(t){return Fi&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}}),Ue=Fe.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return Ue.imagePath||(Ue.imagePath=this._detectIconPath()),(this.options.imagePath||Ue.imagePath)+Fe.prototype._getIconUrl.call(this,t)},_detectIconPath:function(){var t=ht("div","leaflet-default-icon-path",document.body),i=at(t,"background-image")||at(t,"backgroundImage");return document.body.removeChild(t),i=null===i||0!==i.indexOf("url")?"":i.replace(/^url\([\"\']?/,"").replace(/marker-icon\.png[\"\']?\)$/,"")}}),Ve=Te.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new Se(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),pt(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&mt(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(t){var i=this._marker,e=i._shadow,n=Pt(i._icon),o=i._map.layerPointToLatLng(n);e&&Lt(e,n),i._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,i.fire("move",t).fire("drag",t)},_onDragEnd:function(t){delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Ge=je.extend({options:{icon:new Ue,interactive:!0,draggable:!1,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",bubblingMouseEvents:!1},initialize:function(t,i){l(this,i),this._latlng=C(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var i=this._latlng;return this._latlng=C(t),this.update(),this.fire("move",{oldLatLng:i,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,i="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),e=t.icon.createIcon(this._icon),n=!1;e!==this._icon&&(this._icon&&this._removeIcon(),n=!0,t.title&&(e.title=t.title),t.alt&&(e.alt=t.alt)),pt(e,i),t.keyboard&&(e.tabIndex="0"),this._icon=e,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});var o=t.icon.createShadow(this._shadow),s=!1;o!==this._shadow&&(this._removeShadow(),s=!0),o&&(pt(o,i),o.alt=""),this._shadow=o,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),o&&s&&this.getPane("shadowPane").appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),ut(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ut(this._shadow),this._shadow=null},_setPos:function(t){Lt(this._icon,t),this._shadow&&Lt(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var i=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(i)},_initInteraction:function(){if(this.options.interactive&&(pt(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Ve)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Ve(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;gt(this._icon,t),this._shadow&&gt(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor||[0,0]},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor||[0,0]}}),qe=je.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return l(this,t),this._renderer&&this._renderer._updateStyle(this),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(ji?10:0)}}),Ke=qe.extend({options:{fill:!0,radius:10},initialize:function(t,i){l(this,i),this._latlng=C(t),this._radius=this.options.radius},setLatLng:function(t){return this._latlng=C(t),this.redraw(),this.fire("move",{latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var i=t&&t.radius||this._radius;return qe.prototype.setStyle.call(this,t),this.setRadius(i),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,i=this._radiusY||t,e=this._clickTolerance(),n=[t+e,i+e];this._pxBounds=new P(this._point.subtract(n),this._point.add(n))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}}),Ye=Ke.extend({initialize:function(t,e,n){if("number"==typeof e&&(e=i({},n,{radius:e})),l(this,e),this._latlng=C(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new T(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:qe.prototype.setStyle,_project:function(){var t=this._latlng.lng,i=this._latlng.lat,e=this._map,n=e.options.crs;if(n.distance===ui.distance){var o=Math.PI/180,s=this._mRadius/ui.R/o,r=e.project([i+s,t]),a=e.project([i-s,t]),h=r.add(a).divideBy(2),u=e.unproject(h).lat,l=Math.acos((Math.cos(s*o)-Math.sin(i*o)*Math.sin(u*o))/(Math.cos(i*o)*Math.cos(u*o)))/o;(isNaN(l)||0===l)&&(l=s/Math.cos(Math.PI/180*i)),this._point=h.subtract(e.getPixelOrigin()),this._radius=isNaN(l)?0:Math.max(Math.round(h.x-e.project([u,t-l]).x),1),this._radiusY=Math.max(Math.round(h.y-r.y),1)}else{var c=n.unproject(n.project(this._latlng).subtract([this._mRadius,0]));this._point=e.latLngToLayerPoint(this._latlng),this._radius=this._point.x-e.latLngToLayerPoint(c).x}this._updateBounds()}}),Xe=qe.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,i){l(this,i),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var i,e,n=1/0,o=null,s=Rt,r=0,a=this._parts.length;r<a;r++)for(var h=this._parts[r],u=1,l=h.length;u<l;u++){var c=s(t,i=h[u-1],e=h[u],!0);c<n&&(n=c,o=s(t,i,e))}return o&&(o.distance=Math.sqrt(n)),o},getCenter:function(){var t=this;if(!this._map)throw new Error("Must add layer to map before using getCenter()");var i,e,n,o,s,r,a,h=this._rings[0],u=h.length;if(!u)return null;for(i=0,e=0;i<u-1;i++)e+=h[i].distanceTo(h[i+1])/2;if(0===e)return this._map.layerPointToLatLng(h[0]);for(i=0,o=0;i<u-1;i++)if(s=h[i],r=h[i+1],n=s.distanceTo(r),(o+=n)>e)return a=(o-e)/n,t._map.layerPointToLatLng([r.x-a*(r.x-s.x),r.y-a*(r.y-s.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,i){return i=i||this._defaultShape(),t=C(t),i.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new T,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Dt(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var i=this,e=[],n=Dt(t),o=0,s=t.length;o<s;o++)n?(e[o]=C(t[o]),i._bounds.extend(e[o])):e[o]=i._convertLatLngs(t[o]);return e},_project:function(){var t=new P;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t);var i=this._clickTolerance(),e=new x(i,i);this._bounds.isValid()&&t.isValid()&&(t.min._subtract(e),t.max._add(e),this._pxBounds=t)},_projectLatlngs:function(t,i,e){var n,o,s=this,r=t[0]instanceof M,a=t.length;if(r){for(o=[],n=0;n<a;n++)o[n]=s._map.latLngToLayerPoint(t[n]),e.extend(o[n]);i.push(o)}else for(n=0;n<a;n++)s._projectLatlngs(t[n],i,e)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t)){if(this.options.noClip)return void(this._parts=this._rings);var i,e,n,o,s,r,a,h=this._parts;for(i=0,n=0,o=this._rings.length;i<o;i++)for(a=this._rings[i],e=0,s=a.length;e<s-1;e++)(r=Bt(a[e],a[e+1],t,e,!0))&&(h[n]=h[n]||[],h[n].push(r[0]),r[1]===a[e+1]&&e!==s-2||(h[n].push(r[1]),n++))}},_simplifyPoints:function(){for(var t=this._parts,i=this.options.smoothFactor,e=0,n=t.length;e<n;e++)t[e]=Ct(t[e],i)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,i){var e,n,o,s,r,a,h=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(e=0,s=this._parts.length;e<s;e++)for(a=this._parts[e],n=0,r=a.length,o=r-1;n<r;o=n++)if((i||0!==n)&&Zt(t,a[o],a[n])<=h)return!0;return!1}}),Je=Xe.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,i,e,n,o,s,r,a,h,u=this._rings[0],l=u.length;if(!l)return null;for(s=r=a=0,t=0,i=l-1;t<l;i=t++)e=u[t],n=u[i],o=e.y*n.x-n.y*e.x,r+=(e.x+n.x)*o,a+=(e.y+n.y)*o,s+=3*o;return h=0===s?u[0]:[r/s,a/s],this._map.layerPointToLatLng(h)},_convertLatLngs:function(t){var i=Xe.prototype._convertLatLngs.call(this,t),e=i.length;return e>=2&&i[0]instanceof M&&i[0].equals(i[e-1])&&i.pop(),i},_setLatLngs:function(t){Xe.prototype._setLatLngs.call(this,t),Dt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Dt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this,i=this._renderer._bounds,e=this.options.weight,n=new x(e,e);if(i=new P(i.min.subtract(n),i.max.add(n)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(i)){if(this.options.noClip)return void(this._parts=this._rings);for(var o,s=0,r=this._rings.length;s<r;s++)(o=Nt(t._rings[s],i,!0)).length&&t._parts.push(o)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var i,e,n,o,s,r,a,h,u=!1;if(!this._pxBounds.contains(t))return!1;for(o=0,a=this._parts.length;o<a;o++)for(i=this._parts[o],s=0,h=i.length,r=h-1;s<h;r=s++)e=i[s],n=i[r],e.y>t.y!=n.y>t.y&&t.x<(n.x-e.x)*(t.y-e.y)/(n.y-e.y)+e.x&&(u=!u);return u||Xe.prototype._containsPoint.call(this,t,!0)}}),$e=He.extend({initialize:function(t,i){l(this,i),this._layers={},t&&this.addData(t)},addData:function(t){var i,e,n,o=this,s=ti(t)?t:t.features;if(s){for(i=0,e=s.length;i<e;i++)((n=s[i]).geometries||n.geometry||n.features||n.coordinates)&&o.addData(n);return this}var r=this.options;if(r.filter&&!r.filter(t))return this;var a=jt(t,r);return a?(a.feature=Gt(t),a.defaultOptions=a.options,this.resetStyle(a),r.onEachFeature&&r.onEachFeature(t,a),this.addLayer(a)):this},resetStyle:function(t){return t.options=i({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this},setStyle:function(t){return this.eachLayer(function(i){this._setLayerStyle(i,t)},this)},_setLayerStyle:function(t,i){"function"==typeof i&&(i=i(t.feature)),t.setStyle&&t.setStyle(i)}}),Qe={toGeoJSON:function(t){return Vt(this,{type:"Point",coordinates:Ft(this.getLatLng(),t)})}};Ge.include(Qe),Ye.include(Qe),Ke.include(Qe),Xe.include({toGeoJSON:function(t){var i=!Dt(this._latlngs),e=Ut(this._latlngs,i?1:0,!1,t);return Vt(this,{type:(i?"Multi":"")+"LineString",coordinates:e})}}),Je.include({toGeoJSON:function(t){var i=!Dt(this._latlngs),e=i&&!Dt(this._latlngs[0]),n=Ut(this._latlngs,e?2:i?1:0,!0,t);return i||(n=[n]),Vt(this,{type:(e?"Multi":"")+"Polygon",coordinates:n})}}),We.include({toMultiPoint:function(t){var i=[];return this.eachLayer(function(e){i.push(e.toGeoJSON(t).geometry.coordinates)}),Vt(this,{type:"MultiPoint",coordinates:i})},toGeoJSON:function(t){var i=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===i)return this.toMultiPoint(t);var e="GeometryCollection"===i,n=[];return this.eachLayer(function(i){if(i.toGeoJSON){var o=i.toGeoJSON(t);if(e)n.push(o.geometry);else{var s=Gt(o);"FeatureCollection"===s.type?n.push.apply(n,s.features):n.push(s)}}}),e?Vt(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});var tn=qt,en=je.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,i,e){this._url=t,this._bounds=z(i),l(this,e)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(pt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ut(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&ct(this._image),this},bringToBack:function(){return this._map&&_t(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=t,this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t=this._image=ht("img","leaflet-image-layer "+(this._zoomAnimated?"leaflet-zoom-animated":"")+(this.options.className||""));t.onselectstart=r,t.onmousemove=r,t.onload=e(this.fire,this,"load"),t.onerror=e(this._overlayOnError,this,"error"),this.options.crossOrigin&&(t.crossOrigin=""),this.options.zIndex&&this._updateZIndex(),t.src=this._url,t.alt=this.options.alt},_animateZoom:function(t){var i=this._map.getZoomScale(t.zoom),e=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;wt(this._image,e,i)},_reset:function(){var t=this._image,i=new P(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),e=i.getSize();Lt(t,i.min),t.style.width=e.x+"px",t.style.height=e.y+"px"},_updateOpacity:function(){gt(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)}}),nn=en.extend({options:{autoplay:!0,loop:!0},_initImage:function(){var t=this,i=this._image=ht("video","leaflet-image-layer "+(this._zoomAnimated?"leaflet-zoom-animated":""));i.onselectstart=r,i.onmousemove=r,i.onloadeddata=e(this.fire,this,"load"),ti(this._url)||(this._url=[this._url]),i.autoplay=!!this.options.autoplay,i.loop=!!this.options.loop;for(var n=0;n<this._url.length;n++){var o=ht("source");o.src=t._url[n],i.appendChild(o)}}}),on=je.extend({options:{offset:[0,7],className:"",pane:"popupPane"},initialize:function(t,i){l(this,t),this._source=i},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&gt(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&gt(this._container,1),this.bringToFront()},onRemove:function(t){t._fadeAnimated?(gt(this._container,0),this._removeTimeout=setTimeout(e(ut,void 0,this._container),200)):ut(this._container)},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=C(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&ct(this._container),this},bringToBack:function(){return this._map&&_t(this._container),this},_updateContent:function(){if(this._content){var t=this._contentNode,i="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof i)t.innerHTML=i;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(i)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),i=w(this.options.offset),e=this._getAnchor();this._zoomAnimated?Lt(this._container,t.add(e)):i=i.add(t).add(e);var n=this._containerBottom=-i.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+i.x;this._container.style.bottom=n+"px",this._container.style.left=o+"px"}},_getAnchor:function(){return[0,0]}}),sn=on.extend({options:{maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,className:""},openOn:function(t){return t.openPopup(this),this},onAdd:function(t){on.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof qe||this._source.on("preclick",Y))},onRemove:function(t){on.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof qe||this._source.off("preclick",Y))},getEvents:function(){var t=on.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this._close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var t="leaflet-popup",i=this._container=ht("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),e=this._wrapper=ht("div",t+"-content-wrapper",i);if(this._contentNode=ht("div",t+"-content",e),J(e),X(this._contentNode),V(e,"contextmenu",Y),this._tipContainer=ht("div",t+"-tip-container",i),this._tip=ht("div",t+"-tip",this._tipContainer),this.options.closeButton){var n=this._closeButton=ht("a",t+"-close-button",i);n.href="#close",n.innerHTML="&#215;",V(n,"click",this._onCloseButtonClick,this)}},_updateLayout:function(){var t=this._contentNode,i=t.style;i.width="",i.whiteSpace="nowrap";var e=t.offsetWidth;e=Math.min(e,this.options.maxWidth),e=Math.max(e,this.options.minWidth),i.width=e+1+"px",i.whiteSpace="",i.height="";var n=t.offsetHeight,o=this.options.maxHeight,s="leaflet-popup-scrolled";o&&n>o?(i.height=o+"px",pt(t,s)):mt(t,s),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var i=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),e=this._getAnchor();Lt(this._container,i.add(e))},_adjustPan:function(){if(!(!this.options.autoPan||this._map._panAnim&&this._map._panAnim._inProgress)){var t=this._map,i=parseInt(at(this._container,"marginBottom"),10)||0,e=this._container.offsetHeight+i,n=this._containerWidth,o=new x(this._containerLeft,-e-this._containerBottom);o._add(Pt(this._container));var s=t.layerPointToContainerPoint(o),r=w(this.options.autoPanPadding),a=w(this.options.autoPanPaddingTopLeft||r),h=w(this.options.autoPanPaddingBottomRight||r),u=t.getSize(),l=0,c=0;s.x+n+h.x>u.x&&(l=s.x+n-u.x+h.x),s.x-l-a.x<0&&(l=s.x-a.x),s.y+e+h.y>u.y&&(c=s.y+e-u.y+h.y),s.y-c-a.y<0&&(c=s.y-a.y),(l||c)&&t.fire("autopanstart").panBy([l,c])}},_onCloseButtonClick:function(t){this._close(),Q(t)},_getAnchor:function(){return w(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});ve.mergeOptions({closePopupOnClick:!0}),ve.include({openPopup:function(t,i,e){return t instanceof sn||(t=new sn(e).setContent(t)),i&&t.setLatLng(i),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),je.include({bindPopup:function(t,i){return t instanceof sn?(l(t,i),this._popup=t,t._source=this):(this._popup&&!i||(this._popup=new sn(i,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,i){var e=this;if(t instanceof je||(i=t,t=this),t instanceof He)for(var n in this._layers){t=e._layers[n];break}return i||(i=t.getCenter?t.getCenter():t.getLatLng()),this._popup&&this._map&&(this._popup._source=t,this._popup.update(),this._map.openPopup(this._popup,i)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var i=t.layer||t.target;if(this._popup&&this._map)return Q(t),i instanceof qe?void this.openPopup(t.layer||t.target,t.latlng):void(this._map.hasLayer(this._popup)&&this._popup._source===i?this.closePopup():this.openPopup(i,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var rn=on.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){on.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){on.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=on.prototype.getEvents.call(this);return ji&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=ht("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var i=this._map,e=this._container,n=i.latLngToContainerPoint(i.getCenter()),o=i.layerPointToContainerPoint(t),s=this.options.direction,r=e.offsetWidth,a=e.offsetHeight,h=w(this.options.offset),u=this._getAnchor();"top"===s?t=t.add(w(-r/2+h.x,-a+h.y+u.y,!0)):"bottom"===s?t=t.subtract(w(r/2-h.x,-h.y,!0)):"center"===s?t=t.subtract(w(r/2+h.x,a/2-u.y+h.y,!0)):"right"===s||"auto"===s&&o.x<n.x?(s="right",t=t.add(w(h.x+u.x,u.y-a/2+h.y,!0))):(s="left",t=t.subtract(w(r+u.x-h.x,a/2-u.y-h.y,!0))),mt(e,"leaflet-tooltip-right"),mt(e,"leaflet-tooltip-left"),mt(e,"leaflet-tooltip-top"),mt(e,"leaflet-tooltip-bottom"),pt(e,"leaflet-tooltip-"+s),Lt(e,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&gt(this._container,t)},_animateZoom:function(t){var i=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(i)},_getAnchor:function(){return w(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}});ve.include({openTooltip:function(t,i,e){return t instanceof rn||(t=new rn(e).setContent(t)),i&&t.setLatLng(i),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),je.include({bindTooltip:function(t,i){return t instanceof rn?(l(t,i),this._tooltip=t,t._source=this):(this._tooltip&&!i||(this._tooltip=new rn(i,this)),this._tooltip.setContent(t)),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var i=t?"off":"on",e={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?e.add=this._openTooltip:(e.mouseover=this._openTooltip,e.mouseout=this.closeTooltip,this._tooltip.options.sticky&&(e.mousemove=this._moveTooltip),ji&&(e.click=this._openTooltip)),this[i](e),this._tooltipHandlersAdded=!t}},openTooltip:function(t,i){var e=this;if(t instanceof je||(i=t,t=this),t instanceof He)for(var n in this._layers){t=e._layers[n];break}return i||(i=t.getCenter?t.getCenter():t.getLatLng()),this._tooltip&&this._map&&(this._tooltip._source=t,this._tooltip.update(),this._map.openTooltip(this._tooltip,i),this._tooltip.options.interactive&&this._tooltip._container&&(pt(this._tooltip._container,"leaflet-clickable"),this.addInteractiveTarget(this._tooltip._container))),this},closeTooltip:function(){return this._tooltip&&(this._tooltip._close(),this._tooltip.options.interactive&&this._tooltip._container&&(mt(this._tooltip._container,"leaflet-clickable"),this.removeInteractiveTarget(this._tooltip._container))),this},toggleTooltip:function(t){return this._tooltip&&(this._tooltip._map?this.closeTooltip():this.openTooltip(t)),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){var i=t.layer||t.target;this._tooltip&&this._map&&this.openTooltip(i,this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var i,e,n=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(i=this._map.mouseEventToContainerPoint(t.originalEvent),e=this._map.containerPointToLayerPoint(i),n=this._map.layerPointToLatLng(e)),this._tooltip.setLatLng(n)}});var an=Fe.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var i=t&&"DIV"===t.tagName?t:document.createElement("div"),e=this.options;if(i.innerHTML=!1!==e.html?e.html:"",e.bgPos){var n=w(e.bgPos);i.style.backgroundPosition=-n.x+"px "+-n.y+"px"}return this._setIconStyles(i,"icon"),i},createShadow:function(){return null}});Fe.Default=Ue;var hn=je.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Ai,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){l(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView(),this._update()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ut(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=null},bringToFront:function(){return this._map&&(ct(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(_t(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=o(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof x?t:new x(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var i,e=this,n=this.getPane().children,o=-t(-1/0,1/0),s=0,r=n.length;s<r;s++)i=n[s].style.zIndex,n[s]!==e._container&&i&&(o=t(o,+i));isFinite(o)&&(this.options.zIndex=o+t(-1,1),this._updateZIndex())},_updateOpacity:function(){var t=this;if(this._map&&!yi){gt(this._container,this.options.opacity);var i=+new Date,e=!1,n=!1;for(var o in this._tiles){var s=t._tiles[o];if(s.current&&s.loaded){var r=Math.min(1,(i-s.loaded)/200);gt(s.el,r),r<1?e=!0:(s.active?n=!0:t._onOpaqueTile(s),s.active=!0)}}n&&!this._noPrune&&this._pruneTiles(),e&&(v(this._fadeFrame),this._fadeFrame=f(this._updateOpacity,this))}},_onOpaqueTile:r,_initContainer:function(){this._container||(this._container=ht("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this,i=this._tileZoom,e=this.options.maxZoom;if(void 0!==i){for(var n in this._levels)t._levels[n].el.children.length||n===i?(t._levels[n].el.style.zIndex=e-Math.abs(i-n),t._onUpdateLevel(n)):(ut(t._levels[n].el),t._removeTilesAtZoom(n),t._onRemoveLevel(n),delete t._levels[n]);var o=this._levels[i],s=this._map;return o||(o=this._levels[i]={},o.el=ht("div","leaflet-tile-container leaflet-zoom-animated",this._container),o.el.style.zIndex=e,o.origin=s.project(s.unproject(s.getPixelOrigin()),i).round(),o.zoom=i,this._setZoomTransform(o,s.getCenter(),s.getZoom()),o.el.offsetWidth,this._onCreateLevel(o)),this._level=o,o}},_onUpdateLevel:r,_onRemoveLevel:r,_onCreateLevel:r,_pruneTiles:function(){var t=this;if(this._map){var i,e,n=this._map.getZoom();if(n>this.options.maxZoom||n<this.options.minZoom)return void this._removeAllTiles();for(i in this._tiles)e=t._tiles[i],e.retain=e.current;for(i in this._tiles)if((e=t._tiles[i]).current&&!e.active){var o=e.coords;t._retainParent(o.x,o.y,o.z,o.z-5)||t._retainChildren(o.x,o.y,o.z,o.z+2)}for(i in this._tiles)t._tiles[i].retain||t._removeTile(i)}},_removeTilesAtZoom:function(t){var i=this;for(var e in this._tiles)i._tiles[e].coords.z===t&&i._removeTile(e)},_removeAllTiles:function(){var t=this;for(var i in this._tiles)t._removeTile(i)},_invalidateAll:function(){var t=this;for(var i in this._levels)ut(t._levels[i].el),t._onRemoveLevel(i),delete t._levels[i];this._removeAllTiles(),this._tileZoom=null},_retainParent:function(t,i,e,n){var o=Math.floor(t/2),s=Math.floor(i/2),r=e-1,a=new x(+o,+s);a.z=+r;var h=this._tileCoordsToKey(a),u=this._tiles[h];return u&&u.active?(u.retain=!0,!0):(u&&u.loaded&&(u.retain=!0),r>n&&this._retainParent(o,s,r,n))},_retainChildren:function(t,i,e,n){for(var o=this,s=2*t;s<2*t+2;s++)for(var r=2*i;r<2*i+2;r++){var a=new x(s,r);a.z=e+1;var h=o._tileCoordsToKey(a),u=o._tiles[h];u&&u.active?u.retain=!0:(u&&u.loaded&&(u.retain=!0),e+1<n&&o._retainChildren(s,r,e+1,n))}},_resetView:function(t){var i=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),i,i)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var i=this.options;return void 0!==i.minNativeZoom&&t<i.minNativeZoom?i.minNativeZoom:void 0!==i.maxNativeZoom&&i.maxNativeZoom<t?i.maxNativeZoom:t},_setView:function(t,i,e,n){var o=this._clampZoom(Math.round(i));(void 0!==this.options.maxZoom&&o>this.options.maxZoom||void 0!==this.options.minZoom&&o<this.options.minZoom)&&(o=void 0);var s=this.options.updateWhenZooming&&o!==this._tileZoom;n&&!s||(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==o&&this._update(t),e||this._pruneTiles(),this._noPrune=!!e),this._setZoomTransforms(t,i)},_setZoomTransforms:function(t,i){var e=this;for(var n in this._levels)e._setZoomTransform(e._levels[n],t,i)},_setZoomTransform:function(t,i,e){var n=this._map.getZoomScale(e,t.zoom),o=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(i,e)).round();Ii?wt(t.el,o,n):Lt(t.el,o)},_resetGrid:function(){var t=this._map,i=t.options.crs,e=this._tileSize=this.getTileSize(),n=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=i.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,i.wrapLng[0]],n).x/e.x),Math.ceil(t.project([0,i.wrapLng[1]],n).x/e.y)],this._wrapY=i.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([i.wrapLat[0],0],n).y/e.x),Math.ceil(t.project([i.wrapLat[1],0],n).y/e.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var i=this._map,e=i._animatingZoom?Math.max(i._animateToZoom,i.getZoom()):i.getZoom(),n=i.getZoomScale(e,this._tileZoom),o=i.project(t,this._tileZoom).floor(),s=i.getSize().divideBy(2*n);return new P(o.subtract(s),o.add(s))},_update:function(t){var i=this,e=this._map;if(e){var n=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var o=this._getTiledPixelBounds(t),s=this._pxBoundsToTileRange(o),r=s.getCenter(),a=[],h=this.options.keepBuffer,u=new P(s.getBottomLeft().subtract([h,-h]),s.getTopRight().add([h,-h]));if(!(isFinite(s.min.x)&&isFinite(s.min.y)&&isFinite(s.max.x)&&isFinite(s.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var l in this._tiles){var c=i._tiles[l].coords;c.z===i._tileZoom&&u.contains(new x(c.x,c.y))||(i._tiles[l].current=!1)}if(Math.abs(n-this._tileZoom)>1)return void this._setView(t,n);for(var _=s.min.y;_<=s.max.y;_++)for(var d=s.min.x;d<=s.max.x;d++){var p=new x(d,_);p.z=i._tileZoom,i._isValidTile(p)&&(i._tiles[i._tileCoordsToKey(p)]||a.push(p))}if(a.sort(function(t,i){return t.distanceTo(r)-i.distanceTo(r)}),0!==a.length){this._loading||(this._loading=!0,this.fire("loading"));var m=document.createDocumentFragment();for(d=0;d<a.length;d++)i._addTile(a[d],m);this._level.el.appendChild(m)}}}},_isValidTile:function(t){var i=this._map.options.crs;if(!i.infinite){var e=this._globalTileRange;if(!i.wrapLng&&(t.x<e.min.x||t.x>e.max.x)||!i.wrapLat&&(t.y<e.min.y||t.y>e.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return z(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToBounds:function(t){var i=this._map,e=this.getTileSize(),n=t.scaleBy(e),o=n.add(e),s=new T(i.unproject(n,t.z),i.unproject(o,t.z));return this.options.noWrap||i.wrapLatLngBounds(s),s},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var i=t.split(":"),e=new x(+i[0],+i[1]);return e.z=+i[2],e},_removeTile:function(t){var i=this._tiles[t];i&&(ut(i.el),delete this._tiles[t],this.fire("tileunload",{tile:i.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){pt(t,"leaflet-tile");var i=this.getTileSize();t.style.width=i.x+"px",t.style.height=i.y+"px",t.onselectstart=r,t.onmousemove=r,yi&&this.options.opacity<1&&gt(t,this.options.opacity),Li&&!Pi&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,i){var n=this._getTilePos(t),o=this._tileCoordsToKey(t),s=this.createTile(this._wrapCoords(t),e(this._tileReady,this,t));this._initTile(s),this.createTile.length<2&&f(e(this._tileReady,this,t,null,s)),Lt(s,n),this._tiles[o]={el:s,coords:t,current:!0},i.appendChild(s),this.fire("tileloadstart",{tile:s,coords:t})},_tileReady:function(t,i,n){if(this._map){i&&this.fire("tileerror",{error:i,tile:n,coords:t});var o=this._tileCoordsToKey(t);(n=this._tiles[o])&&(n.loaded=+new Date,this._map._fadeAnimated?(gt(n.el,0),v(this._fadeFrame),this._fadeFrame=f(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),i||(pt(n.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:n.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),yi||!this._map._fadeAnimated?f(this._pruneTiles,this):setTimeout(e(this._pruneTiles,this),250)))}},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var i=new x(this._wrapX?s(t.x,this._wrapX):t.x,this._wrapY?s(t.y,this._wrapY):t.y);return i.z=t.z,i},_pxBoundsToTileRange:function(t){var i=this.getTileSize();return new P(t.min.unscaleBy(i).floor(),t.max.unscaleBy(i).ceil().subtract([1,1]))},_noTilesToLoad:function(){var t=this;for(var i in this._tiles)if(!t._tiles[i].loaded)return!1;return!0}}),un=hn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,i){this._url=t,(i=l(this,i)).detectRetina&&Fi&&i.maxZoom>0&&(i.tileSize=Math.floor(i.tileSize/2),i.zoomReverse?(i.zoomOffset--,i.minZoom++):(i.zoomOffset++,i.maxZoom--),i.minZoom=Math.max(0,i.minZoom)),"string"==typeof i.subdomains&&(i.subdomains=i.subdomains.split("")),Li||this.on("tileunload",this._onTileRemove)},setUrl:function(t,i){return this._url=t,i||this.redraw(),this},createTile:function(t,i){var n=document.createElement("img");return V(n,"load",e(this._tileOnLoad,this,i,n)),V(n,"error",e(this._tileOnError,this,i,n)),this.options.crossOrigin&&(n.crossOrigin=""),n.alt="",n.setAttribute("role","presentation"),n.src=this.getTileUrl(t),n},getTileUrl:function(t){var e={r:Fi?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var n=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=n),e["-y"]=n}return _(this._url,i(e,this.options))},_tileOnLoad:function(t,i){yi?setTimeout(e(t,this,null,i),0):t(null,i)},_tileOnError:function(t,i,e){var n=this.options.errorTileUrl;n&&i.src!==n&&(i.src=n),t(e,i)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,i=this.options.maxZoom,e=this.options.zoomReverse,n=this.options.zoomOffset;return e&&(t=i-t),t+n},_getSubdomain:function(t){var i=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[i]},_abortLoading:function(){var t,i,e=this;for(t in this._tiles)e._tiles[t].coords.z!==e._tileZoom&&(i=e._tiles[t].el,i.onload=r,i.onerror=r,i.complete||(i.src=ii,ut(i)))}}),ln=un.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){var n=this;this._url=t;var o=i({},this.defaultWmsParams);for(var s in e)s in n.options||(o[s]=e[s]);e=l(this,e),o.width=o.height=e.tileSize*(e.detectRetina&&Fi?2:1),this.wmsParams=o},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var i=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[i]=this._crs.code,un.prototype.onAdd.call(this,t)},getTileUrl:function(t){var i=this._tileCoordsToBounds(t),e=this._crs.project(i.getNorthWest()),n=this._crs.project(i.getSouthEast()),o=(this._wmsVersion>=1.3&&this._crs===De?[n.y,e.x,e.y,n.x]:[e.x,n.y,n.x,e.y]).join(","),s=un.prototype.getTileUrl.call(this,t);return s+c(this.wmsParams,s,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+o},setParams:function(t,e){return i(this.wmsParams,t),e||this.redraw(),this}});un.WMS=ln,Kt.wms=function(t,i){return new ln(t,i)};var cn=je.extend({options:{padding:.1},initialize:function(t){l(this,t),n(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&pt(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,i){var e=this._map.getZoomScale(i,this._zoom),n=Pt(this._container),o=this._map.getSize().multiplyBy(.5+this.options.padding),s=this._map.project(this._center,i),r=this._map.project(t,i).subtract(s),a=o.multiplyBy(-e).add(n).add(o).subtract(r);Ii?wt(this._container,a,e):Lt(this._container,a)},_reset:function(){var t=this;this._update(),this._updateTransform(this._center,this._zoom);for(var i in this._layers)t._layers[i]._reset()},_onZoomEnd:function(){var t=this;for(var i in this._layers)t._layers[i]._project()},_updatePaths:function(){var t=this;for(var i in this._layers)t._layers[i]._update()},_update:function(){var t=this.options.padding,i=this._map.getSize(),e=this._map.containerPointToLayerPoint(i.multiplyBy(-t)).round();this._bounds=new P(e,e.add(i.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),_n=cn.extend({getEvents:function(){var t=cn.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){cn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");V(t,"mousemove",o(this._onMouseMove,32,this),this),V(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),V(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){delete this._ctx,ut(this._container),G(this._container),delete this._container},_updatePaths:function(){var t=this;if(!this._postponeUpdatePaths){this._redrawBounds=null;for(var i in this._layers)t._layers[i]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){this._drawnLayers={},cn.prototype._update.call(this);var t=this._bounds,i=this._container,e=t.getSize(),n=Fi?2:1;Lt(i,t.min),i.width=n*e.x,i.height=n*e.y,i.style.width=e.x+"px",i.style.height=e.y+"px",Fi&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){cn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[n(t)]=t;var i=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=i),this._drawLast=i,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var i=t._order,e=i.next,n=i.prev;e?e.prev=n:this._drawLast=n,n?n.next=e:this._drawFirst=e,delete t._order,delete this._layers[L.stamp(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if(t.options.dashArray){var i,e=t.options.dashArray.split(","),n=[];for(i=0;i<e.length;i++)n.push(Number(e[i]));t.options._dashArray=n}},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||f(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var i=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new P,this._redrawBounds.extend(t._pxBounds.min.subtract([i,i])),this._redrawBounds.extend(t._pxBounds.max.add([i,i]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var i=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,i.x,i.y)}else this._ctx.clearRect(0,0,this._container.width,this._container.height)},_draw:function(){var t,i=this._redrawBounds;if(this._ctx.save(),i){var e=i.getSize();this._ctx.beginPath(),this._ctx.rect(i.min.x,i.min.y,e.x,e.y),this._ctx.clip()}this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)t=n.layer,(!i||t._pxBounds&&t._pxBounds.intersects(i))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,i){if(this._drawing){var e,n,o,s,r=t._parts,a=r.length,h=this._ctx;if(a){for(this._drawnLayers[t._leaflet_id]=t,h.beginPath(),e=0;e<a;e++){for(n=0,o=r[e].length;n<o;n++)s=r[e][n],h[n?"lineTo":"moveTo"](s.x,s.y);i&&h.closePath()}this._fillStroke(h,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var i=t._point,e=this._ctx,n=t._radius,o=(t._radiusY||n)/n;this._drawnLayers[t._leaflet_id]=t,1!==o&&(e.save(),e.scale(1,o)),e.beginPath(),e.arc(i.x,i.y/o,n,0,2*Math.PI,!1),1!==o&&e.restore(),this._fillStroke(e,t)}},_fillStroke:function(t,i){var e=i.options;e.fill&&(t.globalAlpha=e.fillOpacity,t.fillStyle=e.fillColor||e.color,t.fill(e.fillRule||"evenodd")),e.stroke&&0!==e.weight&&(t.setLineDash&&t.setLineDash(i.options&&i.options._dashArray||[]),t.globalAlpha=e.opacity,t.lineWidth=e.weight,t.strokeStyle=e.color,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.stroke())},_onClick:function(t){for(var i,e,n=this,o=this._map.mouseEventToLayerPoint(t),s=this._drawFirst;s;s=s.next)(i=s.layer).options.interactive&&i._containsPoint(o)&&!n._map._draggableMoved(i)&&(e=i);e&&(et(t),this._fireEvent([e],t))},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var i=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,i)}},_handleMouseOut:function(t){var i=this._hoveredLayer;i&&(mt(this._container,"leaflet-interactive"),this._fireEvent([i],t,"mouseout"),this._hoveredLayer=null)},_handleMouseHover:function(t,i){for(var e,n,o=this._drawFirst;o;o=o.next)(e=o.layer).options.interactive&&e._containsPoint(i)&&(n=e);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(pt(this._container,"leaflet-interactive"),this._fireEvent([n],t,"mouseover"),this._hoveredLayer=n)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t)},_fireEvent:function(t,i,e){this._map._fireDOMEvent(i,e||i.type,t)},_bringToFront:function(t){var i=t._order,e=i.next,n=i.prev;e&&(e.prev=n,n?n.next=e:e&&(this._drawFirst=e),i.prev=this._drawLast,this._drawLast.next=i,i.next=null,this._drawLast=i,this._requestRedraw(t))},_bringToBack:function(t){var i=t._order,e=i.next,n=i.prev;n&&(n.next=e,e?e.prev=n:n&&(this._drawLast=n),i.prev=null,i.next=this._drawFirst,this._drawFirst.prev=i,this._drawFirst=i,this._requestRedraw(t))}}),dn=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),pn={_initContainer:function(){this._container=ht("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(cn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var i=t._container=dn("shape");pt(i,"leaflet-vml-shape "+(this.options.className||"")),i.coordsize="1 1",t._path=dn("path"),i.appendChild(t._path),this._updateStyle(t),this._layers[n(t)]=t},_addPath:function(t){var i=t._container;this._container.appendChild(i),t.options.interactive&&t.addInteractiveTarget(i)},_removePath:function(t){var i=t._container;ut(i),t.removeInteractiveTarget(i),delete this._layers[n(t)]},_updateStyle:function(t){var i=t._stroke,e=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(i||(i=t._stroke=dn("stroke")),o.appendChild(i),i.weight=n.weight+"px",i.color=n.color,i.opacity=n.opacity,n.dashArray?i.dashStyle=ti(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):i.dashStyle="",i.endcap=n.lineCap.replace("butt","flat"),i.joinstyle=n.lineJoin):i&&(o.removeChild(i),t._stroke=null),n.fill?(e||(e=t._fill=dn("fill")),o.appendChild(e),e.color=n.fillColor||n.color,e.opacity=n.fillOpacity):e&&(o.removeChild(e),t._fill=null)},_updateCircle:function(t){var i=t._point.round(),e=Math.round(t._radius),n=Math.round(t._radiusY||e);this._setPath(t,t._empty()?"M0 0":"AL "+i.x+","+i.y+" "+e+","+n+" 0,23592600")},_setPath:function(t,i){t._path.v=i},_bringToFront:function(t){ct(t._container)},_bringToBack:function(t){_t(t._container)}},mn=Gi?dn:S,fn=cn.extend({getEvents:function(){var t=cn.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=mn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=mn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ut(this._container),G(this._container),delete this._container,delete this._rootGroup},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){cn.prototype._update.call(this);var t=this._bounds,i=t.getSize(),e=this._container;this._svgSize&&this._svgSize.equals(i)||(this._svgSize=i,e.setAttribute("width",i.x),e.setAttribute("height",i.y)),Lt(e,t.min),e.setAttribute("viewBox",[t.min.x,t.min.y,i.x,i.y].join(" ")),this.fire("update")}},_initPath:function(t){var i=t._path=mn("path");t.options.className&&pt(i,t.options.className),t.options.interactive&&pt(i,"leaflet-interactive"),this._updateStyle(t),this._layers[n(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ut(t._path),t.removeInteractiveTarget(t._path),delete this._layers[n(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var i=t._path,e=t.options;i&&(e.stroke?(i.setAttribute("stroke",e.color),i.setAttribute("stroke-opacity",e.opacity),i.setAttribute("stroke-width",e.weight),i.setAttribute("stroke-linecap",e.lineCap),i.setAttribute("stroke-linejoin",e.lineJoin),e.dashArray?i.setAttribute("stroke-dasharray",e.dashArray):i.removeAttribute("stroke-dasharray"),e.dashOffset?i.setAttribute("stroke-dashoffset",e.dashOffset):i.removeAttribute("stroke-dashoffset")):i.setAttribute("stroke","none"),e.fill?(i.setAttribute("fill",e.fillColor||e.color),i.setAttribute("fill-opacity",e.fillOpacity),i.setAttribute("fill-rule",e.fillRule||"evenodd")):i.setAttribute("fill","none"))},_updatePoly:function(t,i){this._setPath(t,k(t._parts,i))},_updateCircle:function(t){var i=t._point,e=t._radius,n="a"+e+","+(t._radiusY||e)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(i.x-e)+","+i.y+n+2*e+",0 "+n+2*-e+",0 ";this._setPath(t,o)},_setPath:function(t,i){t._path.setAttribute("d",i)},_bringToFront:function(t){ct(t._path)},_bringToBack:function(t){_t(t._path)}});Gi&&fn.include(pn),ve.include({getRenderer:function(t){var i=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return i||(i=this._renderer=this.options.preferCanvas&&Yt()||Xt()),this.hasLayer(i)||this.addLayer(i),i},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var i=this._paneRenderers[t];return void 0===i&&(i=fn&&Xt({pane:t})||_n&&Yt({pane:t}),this._paneRenderers[t]=i),i}});var vn=Je.extend({initialize:function(t,i){Je.prototype.initialize.call(this,this._boundsToLatLngs(t),i)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=z(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});fn.create=mn,fn.pointsToPath=k,$e.geometryToLayer=jt,$e.coordsToLatLng=Wt,$e.coordsToLatLngs=Ht,$e.latLngToCoords=Ft,$e.latLngsToCoords=Ut,$e.getFeature=Vt,$e.asFeature=Gt,ve.mergeOptions({boxZoom:!0});var gn=Te.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){V(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){G(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ut(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){return!(!t.shiftKey||1!==t.which&&1!==t.button)&&(this._clearDeferredResetState(),this._resetState(),_i(),bt(),this._startPoint=this._map.mouseEventToContainerPoint(t),void V(document,{contextmenu:Q,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this))},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=ht("div","leaflet-zoom-box",this._container),pt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var i=new P(this._point,this._startPoint),e=i.getSize();Lt(this._box,i.min),this._box.style.width=e.x+"px",this._box.style.height=e.y+"px"},_finish:function(){this._moved&&(ut(this._box),mt(this._container,"leaflet-crosshair")),di(),Tt(),G(document,{contextmenu:Q,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(e(this._resetState,this),0);var i=new T(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(i).fire("boxzoomend",{boxZoomBounds:i})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});ve.addInitHook("addHandler","boxZoom",gn),ve.mergeOptions({doubleClickZoom:!0});var yn=Te.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var i=this._map,e=i.getZoom(),n=i.options.zoomDelta,o=t.originalEvent.shiftKey?e-n:e+n;"center"===i.options.doubleClickZoom?i.setZoom(o):i.setZoomAround(t.containerPoint,o)}});ve.addInitHook("addHandler","doubleClickZoom",yn),ve.mergeOptions({dragging:!0,inertia:!Pi,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var xn=Te.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new Se(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}pt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){mt(this._map._container,"leaflet-grab"),mt(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var i=z(this._map.options.maxBounds);this._offsetLimit=b(this._map.latLngToContainerPoint(i.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(i.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var i=this._lastTime=+new Date,e=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(e),this._times.push(i),i-this._times[0]>50&&(this._positions.shift(),this._times.shift())}this._map.fire("move",t).fire("drag",t)},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),i=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=i.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,i){return t-(t-i)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),i=this._offsetLimit;t.x<i.min.x&&(t.x=this._viscousLimit(t.x,i.min.x)),t.y<i.min.y&&(t.y=this._viscousLimit(t.y,i.min.y)),t.x>i.max.x&&(t.x=this._viscousLimit(t.x,i.max.x)),t.y>i.max.y&&(t.y=this._viscousLimit(t.y,i.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,i=Math.round(t/2),e=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-i+e)%t+i-e,s=(n+i+e)%t-i-e,r=Math.abs(o+e)<Math.abs(s+e)?o:s;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=r},_onDragEnd:function(t){var i=this._map,e=i.options,n=!e.inertia||this._times.length<2;if(i.fire("dragend",t),n)i.fire("moveend");else{var o=this._lastPos.subtract(this._positions[0]),s=(this._lastTime-this._times[0])/1e3,r=e.easeLinearity,a=o.multiplyBy(r/s),h=a.distanceTo([0,0]),u=Math.min(e.inertiaMaxSpeed,h),l=a.multiplyBy(u/h),c=u/(e.inertiaDeceleration*r),_=l.multiplyBy(-c/2).round();_.x||_.y?(_=i._limitOffset(_,i.options.maxBounds),f(function(){i.panBy(_,{duration:c,easeLinearity:r,noMoveStart:!0,animate:!0})})):i.fire("moveend")}}});ve.addInitHook("addHandler","dragging",xn),ve.mergeOptions({keyboard:!0,keyboardPanDelta:80});var wn=Te.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),V(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),G(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,i=document.documentElement,e=t.scrollTop||i.scrollTop,n=t.scrollLeft||i.scrollLeft;this._map._container.focus(),window.scrollTo(n,e)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var i,e,n=this._panKeys={},o=this.keyCodes;for(i=0,e=o.left.length;i<e;i++)n[o.left[i]]=[-1*t,0];for(i=0,e=o.right.length;i<e;i++)n[o.right[i]]=[t,0];for(i=0,e=o.down.length;i<e;i++)n[o.down[i]]=[0,t];for(i=0,e=o.up.length;i<e;i++)n[o.up[i]]=[0,-1*t]},_setZoomDelta:function(t){var i,e,n=this._zoomKeys={},o=this.keyCodes;for(i=0,e=o.zoomIn.length;i<e;i++)n[o.zoomIn[i]]=t;for(i=0,e=o.zoomOut.length;i<e;i++)n[o.zoomOut[i]]=-t},_addHooks:function(){V(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){G(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var i,e=t.keyCode,n=this._map;if(e in this._panKeys){if(n._panAnim&&n._panAnim._inProgress)return;i=this._panKeys[e],t.shiftKey&&(i=w(i).multiplyBy(3)),n.panBy(i),n.options.maxBounds&&n.panInsideBounds(n.options.maxBounds)}else if(e in this._zoomKeys)n.setZoom(n.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[e]);else{if(27!==e||!n._popup)return;n.closePopup()}Q(t)}}});ve.addInitHook("addHandler","keyboard",wn),ve.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var Ln=Te.extend({addHooks:function(){V(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){G(this._map._container,"mousewheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var i=it(t),n=this._map.options.wheelDebounceTime;this._delta+=i,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var o=Math.max(n-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(e(this._performZoom,this),o),Q(t)},_performZoom:function(){var t=this._map,i=t.getZoom(),e=this._map.options.zoomSnap||0;t._stop();var n=this._delta/(4*this._map.options.wheelPxPerZoomLevel),o=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,s=e?Math.ceil(o/e)*e:o,r=t._limitZoom(i+(this._delta>0?s:-s))-i;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(i+r):t.setZoomAround(this._lastMousePos,i+r))}});ve.addInitHook("addHandler","scrollWheelZoom",Ln),ve.mergeOptions({tap:!0,tapTolerance:15});var Pn=Te.extend({addHooks:function(){V(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){G(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if($(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var i=t.touches[0],n=i.target;this._startPos=this._newPos=new x(i.clientX,i.clientY),n.tagName&&"a"===n.tagName.toLowerCase()&&pt(n,"leaflet-active"),this._holdTimeout=setTimeout(e(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",i))},this),1e3),this._simulateEvent("mousedown",i),V(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),G(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var i=t.changedTouches[0],e=i.target;e&&e.tagName&&"a"===e.tagName.toLowerCase()&&mt(e,"leaflet-active"),this._simulateEvent("mouseup",i),this._isTapValid()&&this._simulateEvent("click",i)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var i=t.touches[0];this._newPos=new x(i.clientX,i.clientY),this._simulateEvent("mousemove",i)},_simulateEvent:function(t,i){var e=document.createEvent("MouseEvents");e._simulated=!0,i.target._simulatedClick=!0,e.initMouseEvent(t,!0,!0,window,1,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),i.target.dispatchEvent(e)}});ji&&!Ni&&ve.addInitHook("addHandler","tap",Pn),ve.mergeOptions({touchZoom:ji&&!Pi,bounceAtZoomLimits:!0});var bn=Te.extend({addHooks:function(){pt(this._map._container,"leaflet-touch-zoom"),V(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){mt(this._map._container,"leaflet-touch-zoom"),G(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var i=this._map;if(t.touches&&2===t.touches.length&&!i._animatingZoom&&!this._zooming){var e=i.mouseEventToContainerPoint(t.touches[0]),n=i.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=i.getSize()._divideBy(2),this._startLatLng=i.containerPointToLatLng(this._centerPoint),"center"!==i.options.touchZoom&&(this._pinchStartLatLng=i.containerPointToLatLng(e.add(n)._divideBy(2))),this._startDist=e.distanceTo(n),this._startZoom=i.getZoom(),this._moved=!1,this._zooming=!0,i._stop(),V(document,"touchmove",this._onTouchMove,this),V(document,"touchend",this._onTouchEnd,this),$(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var i=this._map,n=i.mouseEventToContainerPoint(t.touches[0]),o=i.mouseEventToContainerPoint(t.touches[1]),s=n.distanceTo(o)/this._startDist;if(this._zoom=i.getScaleZoom(s,this._startZoom),!i.options.bounceAtZoomLimits&&(this._zoom<i.getMinZoom()&&s<1||this._zoom>i.getMaxZoom()&&s>1)&&(this._zoom=i._limitZoom(this._zoom)),"center"===i.options.touchZoom){if(this._center=this._startLatLng,1===s)return}else{var r=n._add(o)._divideBy(2)._subtract(this._centerPoint);if(1===s&&0===r.x&&0===r.y)return;this._center=i.unproject(i.project(this._pinchStartLatLng,this._zoom).subtract(r),this._zoom)}this._moved||(i._moveStart(!0),this._moved=!0),v(this._animRequest);var a=e(i._move,i,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=f(a,this,!0),$(t)}},_onTouchEnd:function(){return this._moved&&this._zooming?(this._zooming=!1,v(this._animRequest),G(document,"touchmove",this._onTouchMove),G(document,"touchend",this._onTouchEnd),void(this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom)))):void(this._zooming=!1)}});ve.addInitHook("addHandler","touchZoom",bn),ve.BoxZoom=gn,ve.DoubleClickZoom=yn,ve.Drag=xn,ve.Keyboard=wn,ve.ScrollWheelZoom=Ln,ve.Tap=Pn,ve.TouchZoom=bn;var Tn=window.L;window.L=t,t.version="1.1.0",t.noConflict=function(){return window.L=Tn,this},t.Control=ge,t.control=ye,t.Browser=qi,t.Evented=ai,t.Mixin=ze,t.Util=si,t.Class=g,t.Handler=Te,t.extend=i,t.bind=e,t.stamp=n,t.setOptions=l,t.DomEvent=he,t.DomUtil=me,t.PosAnimation=fe,t.Draggable=Se,t.LineUtil=ke,t.PolyUtil=Be,t.Point=x,t.point=w,t.Bounds=P,t.bounds=b,t.Transformation=Z,t.transformation=E,t.Projection=Oe,t.LatLng=M,t.latLng=C,t.LatLngBounds=T,t.latLngBounds=z,t.CRS=hi,t.GeoJSON=$e,t.geoJSON=qt,t.geoJson=tn,t.Layer=je,t.LayerGroup=We,t.layerGroup=function(t){return new We(t)},t.FeatureGroup=He,t.featureGroup=function(t){return new He(t)},t.ImageOverlay=en,t.imageOverlay=function(t,i,e){return new en(t,i,e)},t.VideoOverlay=nn,t.videoOverlay=function(t,i,e){return new nn(t,i,e)},t.DivOverlay=on,t.Popup=sn,t.popup=function(t,i){return new sn(t,i)},t.Tooltip=rn,t.tooltip=function(t,i){return new rn(t,i)},t.Icon=Fe,t.icon=function(t){return new Fe(t)},t.DivIcon=an,t.divIcon=function(t){return new an(t)},t.Marker=Ge,t.marker=function(t,i){return new Ge(t,i)},t.TileLayer=un,t.tileLayer=Kt,t.GridLayer=hn,t.gridLayer=function(t){return new hn(t)},t.SVG=fn,t.svg=Xt,t.Renderer=cn,t.Canvas=_n,t.canvas=Yt,t.Path=qe,t.CircleMarker=Ke,t.circleMarker=function(t,i){return new Ke(t,i)},t.Circle=Ye,t.circle=function(t,i,e){return new Ye(t,i,e)},t.Polyline=Xe,t.polyline=function(t,i){return new Xe(t,i)},t.Polygon=Je,t.polygon=function(t,i){return new Je(t,i)},t.Rectangle=vn,t.rectangle=function(t,i){return new vn(t,i)},t.Map=ve,t.map=function(t,i){return new ve(t,i)}});</script><dom-module id="ha-entity-marker"><template><style is="custom-style" include="iron-positioning"></style><style>.marker{vertical-align:top;position:relative;display:block;margin:0 auto;width:2.5em;text-align:center;height:2.5em;line-height:2.5em;font-size:1.5em;border-radius:50%;border:0.1em solid var(--ha-marker-color, --default-primary-color);color:rgb(76, 76, 76);background-color:white;}iron-image{border-radius:50%;}</style><div class="marker"><template is="dom-if" if="[[entityName]]">[[entityName]]</template><template is="dom-if" if="[[entityPicture]]"><iron-image sizing="cover" class="fit" src="[[entityPicture]]"></iron-image></template></div></template></dom-module><script>Polymer({is:"ha-entity-marker",hostAttributes:{entityId:null,entityName:null,entityPicture:null},properties:{hass:{type:Object},entityId:{type:String,value:""},entityName:{type:String,value:null},entityPicture:{type:String,value:null}},listeners:{tap:"badgeTap"},badgeTap:function(t){t.stopPropagation(),this.entityId&&this.fire("hass-more-info",{entityId:this.entityId})}});</script></div><dom-module id="ha-panel-map"><style>.leaflet-pane,
-.leaflet-tile,
-.leaflet-marker-icon,
-.leaflet-marker-shadow,
-.leaflet-tile-container,
-.leaflet-pane > svg,
-.leaflet-pane > canvas,
-.leaflet-zoom-box,
-.leaflet-image-layer,
-.leaflet-layer{position:absolute;left:0;top:0;}.leaflet-container{overflow:hidden;}.leaflet-tile,
-.leaflet-marker-icon,
-.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none;}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast;}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0;}.leaflet-marker-icon,
-.leaflet-marker-shadow{display:block;}.leaflet-container .leaflet-overlay-pane svg,
-.leaflet-container .leaflet-marker-pane img,
-.leaflet-container .leaflet-shadow-pane img,
-.leaflet-container .leaflet-tile-pane img,
-.leaflet-container img.leaflet-image-layer{max-width:none !important;}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y;}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none;}.leaflet-container{-webkit-tap-highlight-color:transparent;}.leaflet-container a{-webkit-tap-highlight-color:rgba(51, 181, 229, 0.4);}.leaflet-tile{filter:inherit;visibility:hidden;}.leaflet-tile-loaded{visibility:inherit;}.leaflet-zoom-box{width:0;height:0;-moz-box-sizing:border-box;box-sizing:border-box;z-index:800;}.leaflet-overlay-pane svg{-moz-user-select:none;}.leaflet-pane{z-index:400;}.leaflet-tile-pane{z-index:200;}.leaflet-overlay-pane{z-index:400;}.leaflet-shadow-pane{z-index:500;}.leaflet-marker-pane{z-index:600;}.leaflet-tooltip-pane{z-index:650;}.leaflet-popup-pane{z-index:700;}.leaflet-map-pane canvas{z-index:100;}.leaflet-map-pane svg{z-index:200;}.leaflet-vml-shape{width:1px;height:1px;}.lvml{behavior:url("#default#VML");display:inline-block;position:absolute;}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto;}.leaflet-top,
-.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none;}.leaflet-top{top:0;}.leaflet-right{right:0;}.leaflet-bottom{bottom:0;}.leaflet-left{left:0;}.leaflet-control{float:left;clear:both;}.leaflet-right .leaflet-control{float:right;}.leaflet-top .leaflet-control{margin-top:10px;}.leaflet-bottom .leaflet-control{margin-bottom:10px;}.leaflet-left .leaflet-control{margin-left:10px;}.leaflet-right .leaflet-control{margin-right:10px;}.leaflet-fade-anim .leaflet-tile{will-change:opacity;}.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity 0.2s linear;-moz-transition:opacity 0.2s linear;-o-transition:opacity 0.2s linear;transition:opacity 0.2s linear;}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1;}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;}.leaflet-zoom-anim .leaflet-zoom-animated{will-change:transform;}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform 0.25s cubic-bezier(0,0,0.25,1);-moz-transition:-moz-transform 0.25s cubic-bezier(0,0,0.25,1);-o-transition:-o-transform 0.25s cubic-bezier(0,0,0.25,1);transition:transform 0.25s cubic-bezier(0,0,0.25,1);}.leaflet-zoom-anim .leaflet-tile,
-.leaflet-pan-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none;}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden;}.leaflet-interactive{cursor:pointer;}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;}.leaflet-crosshair,
-.leaflet-crosshair .leaflet-interactive{cursor:crosshair;}.leaflet-popup-pane,
-.leaflet-control{cursor:auto;}.leaflet-dragging .leaflet-grab,
-.leaflet-dragging .leaflet-grab .leaflet-interactive,
-.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;}.leaflet-marker-icon,
-.leaflet-marker-shadow,
-.leaflet-image-layer,
-.leaflet-pane > svg path,
-.leaflet-tile-container{pointer-events:none;}.leaflet-marker-icon.leaflet-interactive,
-.leaflet-image-layer.leaflet-interactive,
-.leaflet-pane > svg path.leaflet-interactive{pointer-events:visiblePainted;pointer-events:auto;}.leaflet-container{background:#ddd;outline:0;}.leaflet-container a{color:#0078A8;}.leaflet-container a.leaflet-active{outline:2px solid orange;}.leaflet-zoom-box{border:2px dotted #38f;background:rgba(255,255,255,0.5);}.leaflet-container{font:12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;}.leaflet-bar{box-shadow:0 1px 5px rgba(0,0,0,0.65);border-radius:4px;}.leaflet-bar a,
-.leaflet-bar a:hover{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:black;}.leaflet-bar a,
-.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block;}.leaflet-bar a:hover{background-color:#f4f4f4;}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px;}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none;}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb;}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px;}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px;}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px;}.leaflet-control-zoom-in,
-.leaflet-control-zoom-out{font:bold 18px 'Lucida Console', Monaco, monospace;text-indent:1px;}.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out{font-size:22px;}.leaflet-control-layers{box-shadow:0 1px 5px rgba(0,0,0,0.4);background:#fff;border-radius:5px;}.leaflet-control-layers-toggle{background-image:url("../../bower_components/leaflet/dist/images/layers.png");width:36px;height:36px;}.leaflet-retina .leaflet-control-layers-toggle{background-image:url("../../bower_components/leaflet/dist/images/layers-2x.png");background-size:26px 26px;}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px;}.leaflet-control-layers .leaflet-control-layers-list,
-.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none;}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative;}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff;}.leaflet-control-layers-scrollbar{overflow-y:scroll;padding-right:5px;}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px;}.leaflet-control-layers label{display:block;}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px;}.leaflet-default-icon-path{background-image:url("../../bower_components/leaflet/dist/images/marker-icon.png");}.leaflet-container .leaflet-control-attribution{background:#fff;background:rgba(255, 255, 255, 0.7);margin:0;}.leaflet-control-attribution,
-.leaflet-control-scale-line{padding:0 5px;color:#333;}.leaflet-control-attribution a{text-decoration:none;}.leaflet-control-attribution a:hover{text-decoration:underline;}.leaflet-container .leaflet-control-attribution,
-.leaflet-container .leaflet-control-scale{font-size:11px;}.leaflet-left .leaflet-control-scale{margin-left:5px;}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px;}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;font-size:11px;white-space:nowrap;overflow:hidden;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;background:rgba(255, 255, 255, 0.5);}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px;}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777;}.leaflet-touch .leaflet-control-attribution,
-.leaflet-touch .leaflet-control-layers,
-.leaflet-touch .leaflet-bar{box-shadow:none;}.leaflet-touch .leaflet-control-layers,
-.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,0.2);background-clip:padding-box;}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px;}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px;}.leaflet-popup-content{margin:13px 19px;line-height:1.4;}.leaflet-popup-content p{margin:18px 0;}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-left:-20px;overflow:hidden;pointer-events:none;}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg);}.leaflet-popup-content-wrapper,
-.leaflet-popup-tip{background:white;color:#333;box-shadow:0 3px 14px rgba(0,0,0,0.4);}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;padding:4px 4px 0 0;border:none;text-align:center;width:18px;height:14px;font:16px/14px Tahoma, Verdana, sans-serif;color:#c3c3c3;text-decoration:none;font-weight:bold;background:transparent;}.leaflet-container a.leaflet-popup-close-button:hover{color:#999;}.leaflet-popup-scrolled{overflow:auto;border-bottom:1px solid #ddd;border-top:1px solid #ddd;}.leaflet-oldie .leaflet-popup-content-wrapper{zoom:1;}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);}.leaflet-oldie .leaflet-popup-tip-container{margin-top:-1px;}.leaflet-oldie .leaflet-control-zoom,
-.leaflet-oldie .leaflet-control-layers,
-.leaflet-oldie .leaflet-popup-content-wrapper,
-.leaflet-oldie .leaflet-popup-tip{border:1px solid #999;}.leaflet-div-icon{background:#fff;border:1px solid #666;}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px rgba(0,0,0,0.4);}.leaflet-tooltip.leaflet-clickable{cursor:pointer;pointer-events:auto;}.leaflet-tooltip-top:before,
-.leaflet-tooltip-bottom:before,
-.leaflet-tooltip-left:before,
-.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:"";}.leaflet-tooltip-bottom{margin-top:6px;}.leaflet-tooltip-top{margin-top:-6px;}.leaflet-tooltip-bottom:before,
-.leaflet-tooltip-top:before{left:50%;margin-left:-6px;}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff;}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff;}.leaflet-tooltip-left{margin-left:-6px;}.leaflet-tooltip-right{margin-left:6px;}.leaflet-tooltip-left:before,
-.leaflet-tooltip-right:before{top:50%;margin-top:-6px;}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff;}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff;}</style><template><style include="ha-style">#map{height:calc(100% - 64px);width:100%;z-index:0;}</style><app-toolbar><ha-menu-button narrow="[[narrow]]" show-menu="[[showMenu]]"></ha-menu-button><div main-title="">Map</div></app-toolbar><div id="map"></div></template></dom-module><script>window.L.Icon.Default.imagePath="/static/images/leaflet",Polymer({is:"ha-panel-map",properties:{hass:{type:Object,observer:"drawEntities"},narrow:{type:Boolean},showMenu:{type:Boolean,value:!1}},attached:function(){if(window.HASS_DEV){var t=document.createElement("link");t.setAttribute("href","/static/home-assistant-polymer/bower_components/leaflet/dist/leaflet.css"),t.setAttribute("rel","stylesheet"),this.shadowRoot.appendChild(t)}var i=this._map=window.L.map(this.$.map);i.setView([51.505,-.09],13),window.L.tileLayer("https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="https://cartodb.com/attributions">CartoDB</a>',maxZoom:18}).addTo(i),this.drawEntities(this.hass),this.async(function(){i.invalidateSize(),this.fitMap()}.bind(this),1)},fitMap:function(){var t;0===this._mapItems.length?this._map.setView(new window.L.LatLng(this.hass.config.core.latitude,this.hass.config.core.longitude),14):(t=new window.L.latLngBounds(this._mapItems.map(function(t){return t.getLatLng()})),this._map.fitBounds(t.pad(.5)))},drawEntities:function(t){var i=this._map;if(i){this._mapItems&&this._mapItems.forEach(function(t){t.remove()});var e=this._mapItems=[];Object.keys(t.states).forEach(function(a){var s=t.states[a],n=window.hassUtil.computeStateName(s);if(!(s.attributes.hidden&&"zone"!==window.hassUtil.computeDomain(s)||"home"===s.state)&&"latitude"in s.attributes&&"longitude"in s.attributes){var o;if("zone"===window.hassUtil.computeDomain(s)){if(s.attributes.passive)return;var r="";return r=s.attributes.icon?"<iron-icon icon='"+s.attributes.icon+"'></iron-icon>":n,o=window.L.divIcon({html:r,iconSize:[24,24],className:""}),e.push(window.L.marker([s.attributes.latitude,s.attributes.longitude],{icon:o,interactive:!1,title:n}).addTo(i)),void e.push(window.L.circle([s.attributes.latitude,s.attributes.longitude],{interactive:!1,color:"#FF9800",radius:s.attributes.radius}).addTo(i))}var u=s.attributes.entity_picture||"",c=n.split(" ").map(function(t){return t.substr(0,1)}).join("");o=window.L.divIcon({html:"<ha-entity-marker entity-id='"+s.entity_id+"' entity-name='"+c+"' entity-picture='"+u+"'></ha-entity-marker>",iconSize:[45,45],className:""}),e.push(window.L.marker([s.attributes.latitude,s.attributes.longitude],{icon:o,title:window.hassUtil.computeStateName(s)}).addTo(i)),s.attributes.gps_accuracy&&e.push(window.L.circle([s.attributes.latitude,s.attributes.longitude],{interactive:!1,color:"#0288D1",radius:s.attributes.gps_accuracy}).addTo(i))}})}}});</script></body></html>
\ No newline at end of file
+<html><head></head><body><div hidden="" by-polymer-bundler=""><script>var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t,i){"object"==("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i(t.L=t.L||{})}(this,function(t){"use strict";function i(t){var i,e,n,o;for(e=1,n=arguments.length;e<n;e++){o=arguments[e];for(i in o)t[i]=o[i]}return t}function e(t,i){var e=Array.prototype.slice;if(t.bind)return t.bind.apply(t,e.call(arguments,1));var n=e.call(arguments,2);return function(){return t.apply(i,n.length?n.concat(e.call(arguments)):arguments)}}function n(t){return t._leaflet_id=t._leaflet_id||++$t,t._leaflet_id}function o(t,i,e){var n,o,s,r;return r=function(){n=!1,o&&(s.apply(e,o),o=!1)},s=function(){n?o=arguments:(t.apply(e,arguments),setTimeout(r,i),n=!0)}}function s(t,i,e){var n=i[1],o=i[0],s=n-o;return t===n&&e?t:((t-o)%s+s)%s+o}function r(){return!1}function a(t,i){var e=Math.pow(10,i||5);return Math.round(t*e)/e}function h(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function u(t){return h(t).split(/\s+/)}function l(t,i){t.hasOwnProperty("options")||(t.options=t.options?Jt(t.options):{});for(var e in i)t.options[e]=i[e];return t.options}function c(t,i,e){var n=[];for(var o in t)n.push(encodeURIComponent(e?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(i&&-1!==i.indexOf("?")?"&":"?")+n.join("&")}function _(t,i){return t.replace(Qt,function(t,e){var n=i[e];if(void 0===n)throw new Error("No value provided for variable "+t);return"function"==typeof n&&(n=n(i)),n})}function d(t,i){for(var e=0;e<t.length;e++)if(t[e]===i)return e;return-1}function p(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}function m(t){var i=+new Date,e=Math.max(0,16-(i-ei));return ei=i+e,window.setTimeout(t,e)}function f(t,i,n){return n&&ni===m?void t.call(i):ni.call(window,e(t,i))}function g(t){t&&oi.call(window,t)}function v(){}function y(t){if(L&&L.Mixin){t=ti(t)?t:[t];for(var i=0;i<t.length;i++)t[i]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}function x(t,i,e){this.x=e?Math.round(t):t,this.y=e?Math.round(i):i}function w(t,i,e){return t instanceof x?t:ti(t)?new x(t[0],t[1]):void 0===t||null===t?t:"object"==(void 0===t?"undefined":_typeof(t))&&"x"in t&&"y"in t?new x(t.x,t.y):new x(t,i,e)}function b(t,i){if(t)for(var e=i?[t,i]:t,n=0,o=e.length;n<o;n++)this.extend(e[n])}function P(t,i){return!t||t instanceof b?t:new b(t,i)}function T(t,i){if(t)for(var e=i?[t,i]:t,n=0,o=e.length;n<o;n++)this.extend(e[n])}function z(t,i){return t instanceof T?t:new T(t,i)}function M(t,i,e){if(isNaN(t)||isNaN(i))throw new Error("Invalid LatLng object: ("+t+", "+i+")");this.lat=+t,this.lng=+i,void 0!==e&&(this.alt=+e)}function C(t,i,e){return t instanceof M?t:ti(t)&&"object"!=_typeof(t[0])?3===t.length?new M(t[0],t[1],t[2]):2===t.length?new M(t[0],t[1]):null:void 0===t||null===t?t:"object"==(void 0===t?"undefined":_typeof(t))&&"lat"in t?new M(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===i?null:new M(t,i,e)}function Z(t,i,e,n){return ti(t)?(this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3])):(this._a=t,this._b=i,this._c=e,void(this._d=n))}function S(t,i,e,n){return new Z(t,i,e,n)}function E(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function k(t,i){var e,n,o,s,r,a,h="";for(e=0,o=t.length;e<o;e++){for(n=0,s=(r=t[e]).length;n<s;n++)a=r[n],h+=(n?"L":"M")+a.x+" "+a.y;h+=i?Vi?"z":"x":""}return h||"M0 0"}function B(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}function I(t,i,e,n){return"touchstart"===i?O(t,e,n):"touchmove"===i?W(t,e,n):"touchend"===i&&H(t,e,n),this}function A(t,i,e){var n=t["_leaflet_"+i+e];return"touchstart"===i?t.removeEventListener(Ki,n,!1):"touchmove"===i?t.removeEventListener(Yi,n,!1):"touchend"===i&&(t.removeEventListener(Xi,n,!1),t.removeEventListener(Ji,n,!1)),this}function O(t,i,n){var o=e(function(t){if("mouse"!==t.pointerType&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE){if(!($i.indexOf(t.target.tagName)<0))return;$(t)}j(t,i)});t["_leaflet_touchstart"+n]=o,t.addEventListener(Ki,o,!1),te||(document.documentElement.addEventListener(Ki,R,!0),document.documentElement.addEventListener(Yi,D,!0),document.documentElement.addEventListener(Xi,N,!0),document.documentElement.addEventListener(Ji,N,!0),te=!0)}function R(t){Qi[t.pointerId]=t,ie++}function D(t){Qi[t.pointerId]&&(Qi[t.pointerId]=t)}function N(t){delete Qi[t.pointerId],ie--}function j(t,i){t.touches=[];for(var e in Qi)t.touches.push(Qi[e]);t.changedTouches=[t],i(t)}function W(t,i,e){var n=function(t){(t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&"mouse"!==t.pointerType||0!==t.buttons)&&j(t,i)};t["_leaflet_touchmove"+e]=n,t.addEventListener(Yi,n,!1)}function H(t,i,e){var n=function(t){j(t,i)};t["_leaflet_touchend"+e]=n,t.addEventListener(Xi,n,!1),t.addEventListener(Ji,n,!1)}function F(t,i,e){function n(t){var i;if(Ni){if(!xi||"mouse"===t.pointerType)return;i=ie}else i=t.touches.length;if(!(i>1)){var e=Date.now(),n=e-(s||e);r=t.touches?t.touches[0]:t,a=n>0&&n<=h,s=e}}function o(t){if(a&&!r.cancelBubble){if(Ni){if(!xi||"mouse"===t.pointerType)return;var e,n,o={};for(n in r)e=r[n],o[n]=e&&e.bind?e.bind(r):e;r=o}r.type="dblclick",i(r),s=null}}var s,r,a=!1,h=250;return t[oe+ee+e]=n,t[oe+ne+e]=o,t[oe+"dblclick"+e]=i,t.addEventListener(ee,n,!1),t.addEventListener(ne,o,!1),t.addEventListener("dblclick",i,!1),this}function U(t,i){var e=t[oe+ee+i],n=t[oe+ne+i],o=t[oe+"dblclick"+i];return t.removeEventListener(ee,e,!1),t.removeEventListener(ne,n,!1),xi||t.removeEventListener("dblclick",o,!1),this}function V(t,i,e,n){if("object"==(void 0===i?"undefined":_typeof(i)))for(var o in i)q(t,o,i[o],e);else for(var s=0,r=(i=u(i)).length;s<r;s++)q(t,i[s],e,n);return this}function G(t,i,e,n){if("object"==(void 0===i?"undefined":_typeof(i)))for(var o in i)K(t,o,i[o],e);else if(i)for(var s=0,r=(i=u(i)).length;s<r;s++)K(t,i[s],e,n);else{for(var a in t[se])K(t,a,t[se][a]);delete t[se]}}function q(t,i,e,o){var s=i+n(e)+(o?"_"+n(o):"");if(t[se]&&t[se][s])return this;var r=function(i){return e.call(o||t,i||window.event)},a=r;Ni&&0===i.indexOf("touch")?I(t,i,r,s):!ji||"dblclick"!==i||!F||Ni&&Ti?"addEventListener"in t?"mousewheel"===i?t.addEventListener("onwheel"in t?"wheel":"mousewheel",r,!1):"mouseenter"===i||"mouseleave"===i?(r=function(i){i=i||window.event,ot(t,i)&&a(i)},t.addEventListener("mouseenter"===i?"mouseover":"mouseout",r,!1)):("click"===i&&Li&&(r=function(t){st(t,a)}),t.addEventListener(i,r,!1)):"attachEvent"in t&&t.attachEvent("on"+i,r):F(t,r,s),t[se]=t[se]||{},t[se][s]=r}function K(t,i,e,o){var s=i+n(e)+(o?"_"+n(o):""),r=t[se]&&t[se][s];return r?(Ni&&0===i.indexOf("touch")?A(t,i,s):ji&&"dblclick"===i&&U?U(t,s):"removeEventListener"in t?"mousewheel"===i?t.removeEventListener("onwheel"in t?"wheel":"mousewheel",r,!1):t.removeEventListener("mouseenter"===i?"mouseover":"mouseleave"===i?"mouseout":i,r,!1):"detachEvent"in t&&t.detachEvent("on"+i,r),void(t[se][s]=null)):this}function Y(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,nt(t),this}function X(t){return q(t,"mousewheel",Y)}function J(t){return V(t,"mousedown touchstart dblclick",Y),q(t,"click",et),this}function $(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Q(t){return $(t),Y(t),this}function tt(t,i){if(!i)return new x(t.clientX,t.clientY);var e=i.getBoundingClientRect();return new x(t.clientX-e.left-i.clientLeft,t.clientY-e.top-i.clientTop)}function it(t){return xi?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/re:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}function et(t){ae[t.type]=!0}function nt(t){var i=ae[t.type];return ae[t.type]=!1,i}function ot(t,i){var e=i.relatedTarget;if(!e)return!0;try{for(;e&&e!==t;)e=e.parentNode}catch(t){return!1}return e!==t}function st(t,i){var e=t.timeStamp||t.originalEvent&&t.originalEvent.timeStamp,n=ci&&e-ci;return n&&n>100&&n<500||t.target._simulatedClick&&!t._simulated?void Q(t):(ci=e,void i(t))}function rt(t){return"string"==typeof t?document.getElementById(t):t}function at(t,i){var e=t.style[i]||t.currentStyle&&t.currentStyle[i];if((!e||"auto"===e)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);e=n?n[i]:null}return"auto"===e?null:e}function ht(t,i,e){var n=document.createElement(t);return n.className=i||"",e&&e.appendChild(n),n}function ut(t){var i=t.parentNode;i&&i.removeChild(t)}function lt(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function ct(t){var i=t.parentNode;i.lastChild!==t&&i.appendChild(t)}function _t(t){var i=t.parentNode;i.firstChild!==t&&i.insertBefore(t,i.firstChild)}function dt(t,i){if(void 0!==t.classList)return t.classList.contains(i);var e=gt(t);return e.length>0&&new RegExp("(^|\\s)"+i+"(\\s|$)").test(e)}function pt(t,i){if(void 0!==t.classList)for(var e=u(i),n=0,o=e.length;n<o;n++)t.classList.add(e[n]);else if(!dt(t,i)){var s=gt(t);ft(t,(s?s+" ":"")+i)}}function mt(t,i){void 0!==t.classList?t.classList.remove(i):ft(t,h((" "+gt(t)+" ").replace(" "+i+" "," ")))}function ft(t,i){void 0===t.className.baseVal?t.className=i:t.className.baseVal=i}function gt(t){return void 0===t.className.baseVal?t.className:t.className.baseVal}function vt(t,i){"opacity"in t.style?t.style.opacity=i:"filter"in t.style&&yt(t,i)}function yt(t,i){var e=!1,n="DXImageTransform.Microsoft.Alpha";try{e=t.filters.item(n)}catch(t){if(1===i)return}i=Math.round(100*i),e?(e.Enabled=100!==i,e.Opacity=i):t.style.filter+=" progid:"+n+"(opacity="+i+")"}function xt(t){for(var i=document.documentElement.style,e=0;e<t.length;e++)if(t[e]in i)return t[e];return!1}function wt(t,i,e){var n=i||new x(0,0);t.style[ue]=(Ei?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(e?" scale("+e+")":"")}function Lt(t,i){t._leaflet_pos=i,Ii?wt(t,i):(t.style.left=i.x+"px",t.style.top=i.y+"px")}function bt(t){return t._leaflet_pos||new x(0,0)}function Pt(){V(window,"dragstart",$)}function Tt(){G(window,"dragstart",$)}function zt(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(Mt(),de=t,pe=t.style.outline,t.style.outline="none",V(window,"keydown",Mt))}function Mt(){de&&(de.style.outline=pe,de=void 0,pe=void 0,G(window,"keydown",Mt))}function Ct(t,i){if(!i||!t.length)return t.slice();var e=i*i;return t=kt(t,e),t=St(t,e)}function Zt(t,i,e){return Math.sqrt(Rt(t,i,e,!0))}function St(t,i){var e=t.length,n=new(("undefined"==typeof Uint8Array?"undefined":_typeof(Uint8Array))!=void 0+""?Uint8Array:Array)(e);n[0]=n[e-1]=1,Et(t,n,i,0,e-1);var o,s=[];for(o=0;o<e;o++)n[o]&&s.push(t[o]);return s}function Et(t,i,e,n,o){var s,r,a,h=0;for(r=n+1;r<=o-1;r++)(a=Rt(t[r],t[n],t[o],!0))>h&&(s=r,h=a);h>e&&(i[s]=1,Et(t,i,e,n,s),Et(t,i,e,s,o))}function kt(t,i){for(var e=[t[0]],n=1,o=0,s=t.length;n<s;n++)Ot(t[n],t[o])>i&&(e.push(t[n]),o=n);return o<s-1&&e.push(t[s-1]),e}function Bt(t,i,e,n,o){var s,r,a,h=n?Pe:At(t,e),u=At(i,e);for(Pe=u;;){if(!(h|u))return[t,i];if(h&u)return!1;a=At(r=It(t,i,s=h||u,e,o),e),s===h?(t=r,h=a):(i=r,u=a)}}function It(t,i,e,n,o){var s,r,a=i.x-t.x,h=i.y-t.y,u=n.min,l=n.max;return 8&e?(s=t.x+a*(l.y-t.y)/h,r=l.y):4&e?(s=t.x+a*(u.y-t.y)/h,r=u.y):2&e?(s=l.x,r=t.y+h*(l.x-t.x)/a):1&e&&(s=u.x,r=t.y+h*(u.x-t.x)/a),new x(s,r,o)}function At(t,i){var e=0;return t.x<i.min.x?e|=1:t.x>i.max.x&&(e|=2),t.y<i.min.y?e|=4:t.y>i.max.y&&(e|=8),e}function Ot(t,i){var e=i.x-t.x,n=i.y-t.y;return e*e+n*n}function Rt(t,i,e,n){var o,s=i.x,r=i.y,a=e.x-s,h=e.y-r,u=a*a+h*h;return u>0&&((o=((t.x-s)*a+(t.y-r)*h)/u)>1?(s=e.x,r=e.y):o>0&&(s+=a*o,r+=h*o)),a=t.x-s,h=t.y-r,n?a*a+h*h:new x(s,r)}function Dt(t){return!ti(t[0])||"object"!=_typeof(t[0][0])&&void 0!==t[0][0]}function Nt(t,i,e){var n,o,s,r,a,h,u,l,c,_=[1,4,2,8];for(o=0,u=t.length;o<u;o++)t[o]._code=At(t[o],i);for(r=0;r<4;r++){for(l=_[r],n=[],o=0,s=(u=t.length)-1;o<u;s=o++)a=t[o],h=t[s],a._code&l?h._code&l||(c=It(h,a,l,i,e),c._code=At(c,i),n.push(c)):(h._code&l&&(c=It(h,a,l,i,e),c._code=At(c,i),n.push(c)),n.push(a));t=n}return t}function jt(t,i){var e,n,o,s,r="Feature"===t.type?t.geometry:t,a=r?r.coordinates:null,h=[],u=i&&i.pointToLayer,l=i&&i.coordsToLatLng||Wt;if(!a&&!r)return null;switch(r.type){case"Point":return e=l(a),u?u(t,e):new Ge(e);case"MultiPoint":for(o=0,s=a.length;o<s;o++)e=l(a[o]),h.push(u?u(t,e):new Ge(e));return new He(h);case"LineString":case"MultiLineString":return n=Ht(a,"LineString"===r.type?0:1,l),new Xe(n,i);case"Polygon":case"MultiPolygon":return n=Ht(a,"Polygon"===r.type?1:2,l),new Je(n,i);case"GeometryCollection":for(o=0,s=r.geometries.length;o<s;o++){var c=jt({geometry:r.geometries[o],type:"Feature",properties:t.properties},i);c&&h.push(c)}return new He(h);default:throw new Error("Invalid GeoJSON object.")}}function Wt(t){return new M(t[1],t[0],t[2])}function Ht(t,i,e){for(var n,o=[],s=0,r=t.length;s<r;s++)n=i?Ht(t[s],i-1,e):(e||Wt)(t[s]),o.push(n);return o}function Ft(t,i){return i="number"==typeof i?i:6,void 0!==t.alt?[a(t.lng,i),a(t.lat,i),a(t.alt,i)]:[a(t.lng,i),a(t.lat,i)]}function Ut(t,i,e,n){for(var o=[],s=0,r=t.length;s<r;s++)o.push(i?Ut(t[s],i-1,e,n):Ft(t[s],n));return!i&&e&&o.push(o[0]),o}function Vt(t,e){return t.feature?i({},t.feature,{geometry:e}):Gt(e)}function Gt(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}function qt(t,i){return new $e(t,i)}function Kt(t,i){return new un(t,i)}function Yt(t){return Ui?new _n(t):null}function Xt(t){return Vi||Gi?new fn(t):null}var Jt=Object.create||function(){function t(){}return function(i){return t.prototype=i,new t}}(),$t=0,Qt=/\{ *([\w_\-]+) *\}/g,ti=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},ii="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",ei=0,ni=window.requestAnimationFrame||p("RequestAnimationFrame")||m,oi=window.cancelAnimationFrame||p("CancelAnimationFrame")||p("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)},si=(Object.freeze||Object)({extend:i,create:Jt,bind:e,lastId:$t,stamp:n,throttle:o,wrapNum:s,falseFn:r,formatNum:a,trim:h,splitWords:u,setOptions:l,getParamString:c,template:_,isArray:ti,indexOf:d,emptyImageUrl:ii,requestFn:ni,cancelFn:oi,requestAnimFrame:f,cancelAnimFrame:g});v.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},n=e.__super__=this.prototype,o=Jt(n);o.constructor=e,e.prototype=o;for(var s in this)this.hasOwnProperty(s)&&"prototype"!==s&&"__super__"!==s&&(e[s]=this[s]);return t.statics&&(i(e,t.statics),delete t.statics),t.includes&&(y(t.includes),i.apply(null,[o].concat(t.includes)),delete t.includes),o.options&&(t.options=i(Jt(o.options),t.options)),i(o,t),o._initHooks=[],o.callInitHooks=function(){if(!this._initHooksCalled){n.callInitHooks&&n.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,i=o._initHooks.length;t<i;t++)o._initHooks[t].call(this)}},e},v.include=function(t){return i(this.prototype,t),this},v.mergeOptions=function(t){return i(this.prototype.options,t),this},v.addInitHook=function(t){var i=Array.prototype.slice.call(arguments,1),e="function"==typeof t?t:function(){this[t].apply(this,i)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(e),this};var ri={on:function(t,i,e){if("object"==(void 0===t?"undefined":_typeof(t)))for(var n in t)this._on(n,t[n],i);else for(var o=0,s=(t=u(t)).length;o<s;o++)this._on(t[o],i,e);return this},off:function(t,i,e){if(t)if("object"==(void 0===t?"undefined":_typeof(t)))for(var n in t)this._off(n,t[n],i);else for(var o=0,s=(t=u(t)).length;o<s;o++)this._off(t[o],i,e);else delete this._events;return this},_on:function(t,i,e){this._events=this._events||{};var n=this._events[t];n||(n=[],this._events[t]=n),e===this&&(e=void 0);for(var o={fn:i,ctx:e},s=n,r=0,a=s.length;r<a;r++)if(s[r].fn===i&&s[r].ctx===e)return;s.push(o)},_off:function(t,i,e){var n,o,s;if(this._events&&(n=this._events[t])){if(!i){for(o=0,s=n.length;o<s;o++)n[o].fn=r;return void delete this._events[t]}if(e===this&&(e=void 0),n)for(o=0,s=n.length;o<s;o++){var a=n[o];if(a.ctx===e&&a.fn===i)return a.fn=r,this._firingCount&&(this._events[t]=n=n.slice()),void n.splice(o,1)}}},fire:function(t,e,n){if(!this.listens(t,n))return this;var o=i({},e,{type:t,target:this});if(this._events){var s=this._events[t];if(s){this._firingCount=this._firingCount+1||1;for(var r=0,a=s.length;r<a;r++){var h=s[r];h.fn.call(h.ctx||this,o)}this._firingCount--}}return n&&this._propagateEvent(o),this},listens:function(t,i){var e=this._events&&this._events[t];if(e&&e.length)return!0;if(i)for(var n in this._eventParents)if(this._eventParents[n].listens(t,i))return!0;return!1},once:function(t,i,n){if("object"==(void 0===t?"undefined":_typeof(t))){for(var o in t)this.once(o,t[o],i);return this}var s=e(function(){this.off(t,i,n).off(t,s,n)},this);return this.on(t,i,n).on(t,s,n)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[n(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[n(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,i({layer:t.target},t),!0)}};ri.addEventListener=ri.on,ri.removeEventListener=ri.clearAllEventListeners=ri.off,ri.addOneTimeEventListener=ri.once,ri.fireEvent=ri.fire,ri.hasEventListeners=ri.listens;var ai=v.extend(ri);x.prototype={clone:function(){return new x(this.x,this.y)},add:function(t){return this.clone()._add(w(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(w(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new x(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new x(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},distanceTo:function(t){var i=(t=w(t)).x-this.x,e=t.y-this.y;return Math.sqrt(i*i+e*e)},equals:function(t){return(t=w(t)).x===this.x&&t.y===this.y},contains:function(t){return t=w(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+a(this.x)+", "+a(this.y)+")"}},b.prototype={extend:function(t){return t=w(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new x((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new x(this.min.x,this.max.y)},getTopRight:function(){return new x(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var i,e;return(t="number"==typeof t[0]||t instanceof x?w(t):P(t))instanceof b?(i=t.min,e=t.max):i=e=t,i.x>=this.min.x&&e.x<=this.max.x&&i.y>=this.min.y&&e.y<=this.max.y},intersects:function(t){t=P(t);var i=this.min,e=this.max,n=t.min,o=t.max,s=o.x>=i.x&&n.x<=e.x,r=o.y>=i.y&&n.y<=e.y;return s&&r},overlaps:function(t){t=P(t);var i=this.min,e=this.max,n=t.min,o=t.max,s=o.x>i.x&&n.x<e.x,r=o.y>i.y&&n.y<e.y;return s&&r},isValid:function(){return!(!this.min||!this.max)}},T.prototype={extend:function(t){var i,e,n=this._southWest,o=this._northEast;if(t instanceof M)i=t,e=t;else{if(!(t instanceof T))return t?this.extend(C(t)||z(t)):this;if(i=t._southWest,e=t._northEast,!i||!e)return this}return n||o?(n.lat=Math.min(i.lat,n.lat),n.lng=Math.min(i.lng,n.lng),o.lat=Math.max(e.lat,o.lat),o.lng=Math.max(e.lng,o.lng)):(this._southWest=new M(i.lat,i.lng),this._northEast=new M(e.lat,e.lng)),this},pad:function(t){var i=this._southWest,e=this._northEast,n=Math.abs(i.lat-e.lat)*t,o=Math.abs(i.lng-e.lng)*t;return new T(new M(i.lat-n,i.lng-o),new M(e.lat+n,e.lng+o))},getCenter:function(){return new M((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new M(this.getNorth(),this.getWest())},getSouthEast:function(){return new M(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof M||"lat"in t?C(t):z(t);var i,e,n=this._southWest,o=this._northEast;return t instanceof T?(i=t.getSouthWest(),e=t.getNorthEast()):i=e=t,i.lat>=n.lat&&e.lat<=o.lat&&i.lng>=n.lng&&e.lng<=o.lng},intersects:function(t){t=z(t);var i=this._southWest,e=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=i.lat&&n.lat<=e.lat,r=o.lng>=i.lng&&n.lng<=e.lng;return s&&r},overlaps:function(t){t=z(t);var i=this._southWest,e=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>i.lat&&n.lat<e.lat,r=o.lng>i.lng&&n.lng<e.lng;return s&&r},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,i){return!!t&&(t=z(t),this._southWest.equals(t.getSouthWest(),i)&&this._northEast.equals(t.getNorthEast(),i))},isValid:function(){return!(!this._southWest||!this._northEast)}},M.prototype={equals:function(t,i){return!!t&&(t=C(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===i?1e-9:i))},toString:function(t){return"LatLng("+a(this.lat,t)+", "+a(this.lng,t)+")"},distanceTo:function(t){return ui.distance(this,C(t))},wrap:function(){return ui.wrapLatLng(this)},toBounds:function(t){var i=180*t/40075017,e=i/Math.cos(Math.PI/180*this.lat);return z([this.lat-i,this.lng-e],[this.lat+i,this.lng+e])},clone:function(){return new M(this.lat,this.lng,this.alt)}};var hi={latLngToPoint:function(t,i){var e=this.projection.project(t),n=this.scale(i);return this.transformation._transform(e,n)},pointToLatLng:function(t,i){var e=this.scale(i),n=this.transformation.untransform(t,e);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var i=this.projection.bounds,e=this.scale(t);return new b(this.transformation.transform(i.min,e),this.transformation.transform(i.max,e))},infinite:!1,wrapLatLng:function(t){var i=this.wrapLng?s(t.lng,this.wrapLng,!0):t.lng;return new M(this.wrapLat?s(t.lat,this.wrapLat,!0):t.lat,i,t.alt)},wrapLatLngBounds:function(t){var i=t.getCenter(),e=this.wrapLatLng(i),n=i.lat-e.lat,o=i.lng-e.lng;if(0===n&&0===o)return t;var s=t.getSouthWest(),r=t.getNorthEast();return new T(new M(s.lat-n,s.lng-o),new M(r.lat-n,r.lng-o))}},ui=i({},hi,{wrapLng:[-180,180],R:6371e3,distance:function(t,i){var e=Math.PI/180,n=t.lat*e,o=i.lat*e,s=Math.sin(n)*Math.sin(o)+Math.cos(n)*Math.cos(o)*Math.cos((i.lng-t.lng)*e);return this.R*Math.acos(Math.min(s,1))}}),li={R:6378137,MAX_LATITUDE:85.0511287798,project:function(t){var i=Math.PI/180,e=this.MAX_LATITUDE,n=Math.max(Math.min(e,t.lat),-e),o=Math.sin(n*i);return new x(this.R*t.lng*i,this.R*Math.log((1+o)/(1-o))/2)},unproject:function(t){var i=180/Math.PI;return new M((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*i,t.x*i/this.R)},bounds:function(){var t=6378137*Math.PI;return new b([-t,-t],[t,t])}()};Z.prototype={transform:function(t,i){return this._transform(t.clone(),i)},_transform:function(t,i){return i=i||1,t.x=i*(this._a*t.x+this._b),t.y=i*(this._c*t.y+this._d),t},untransform:function(t,i){return i=i||1,new x((t.x/i-this._b)/this._a,(t.y/i-this._d)/this._c)}};var ci,_i,di,pi,mi=i({},ui,{code:"EPSG:3857",projection:li,transformation:function(){var t=.5/(Math.PI*li.R);return S(t,.5,-t,.5)}()}),fi=i({},mi,{code:"EPSG:900913"}),gi=document.documentElement.style,vi="ActiveXObject"in window,yi=vi&&!document.addEventListener,xi="msLaunchUri"in navigator&&!("documentMode"in document),wi=B("webkit"),Li=B("android"),bi=B("android 2")||B("android 3"),Pi=!!window.opera,Ti=B("chrome"),zi=B("gecko")&&!wi&&!Pi&&!vi,Mi=!Ti&&B("safari"),Ci=B("phantom"),Zi="OTransition"in gi,Si=0===navigator.platform.indexOf("Win"),Ei=vi&&"transition"in gi,ki="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!bi,Bi="MozPerspective"in gi,Ii=!window.L_DISABLE_3D&&(Ei||ki||Bi)&&!Zi&&!Ci,Ai="undefined"!=typeof orientation||B("mobile"),Oi=Ai&&wi,Ri=Ai&&ki,Di=!window.PointerEvent&&window.MSPointerEvent,Ni=!(!window.PointerEvent&&!Di),ji=!window.L_NO_TOUCH&&(Ni||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),Wi=Ai&&Pi,Hi=Ai&&zi,Fi=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Ui=!!document.createElement("canvas").getContext,Vi=!(!document.createElementNS||!E("svg").createSVGRect),Gi=!Vi&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==_typeof(i.adj)}catch(t){return!1}}(),qi=(Object.freeze||Object)({ie:vi,ielt9:yi,edge:xi,webkit:wi,android:Li,android23:bi,opera:Pi,chrome:Ti,gecko:zi,safari:Mi,phantom:Ci,opera12:Zi,win:Si,ie3d:Ei,webkit3d:ki,gecko3d:Bi,any3d:Ii,mobile:Ai,mobileWebkit:Oi,mobileWebkit3d:Ri,msPointer:Di,pointer:Ni,touch:ji,mobileOpera:Wi,mobileGecko:Hi,retina:Fi,canvas:Ui,svg:Vi,vml:Gi}),Ki=Di?"MSPointerDown":"pointerdown",Yi=Di?"MSPointerMove":"pointermove",Xi=Di?"MSPointerUp":"pointerup",Ji=Di?"MSPointerCancel":"pointercancel",$i=["INPUT","SELECT","OPTION"],Qi={},te=!1,ie=0,ee=Di?"MSPointerDown":Ni?"pointerdown":"touchstart",ne=Di?"MSPointerUp":Ni?"pointerup":"touchend",oe="_leaflet_",se="_leaflet_events",re=Si&&Ti?2*window.devicePixelRatio:zi?window.devicePixelRatio:1,ae={},he=(Object.freeze||Object)({on:V,off:G,stopPropagation:Y,disableScrollPropagation:X,disableClickPropagation:J,preventDefault:$,stop:Q,getMousePosition:tt,getWheelDelta:it,fakeStop:et,skipped:nt,isExternalTarget:ot,addListener:V,removeListener:G}),ue=xt(["transform","WebkitTransform","OTransform","MozTransform","msTransform"]),le=xt(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ce="webkitTransition"===le||"OTransition"===le?le+"End":"transitionend";if("onselectstart"in document)_i=function(){V(window,"selectstart",$)},di=function(){G(window,"selectstart",$)};else{var _e=xt(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);_i=function(){if(_e){var t=document.documentElement.style;pi=t[_e],t[_e]="none"}},di=function(){_e&&(document.documentElement.style[_e]=pi,pi=void 0)}}var de,pe,me=(Object.freeze||Object)({TRANSFORM:ue,TRANSITION:le,TRANSITION_END:ce,get:rt,getStyle:at,create:ht,remove:ut,empty:lt,toFront:ct,toBack:_t,hasClass:dt,addClass:pt,removeClass:mt,setClass:ft,getClass:gt,setOpacity:vt,testProp:xt,setTransform:wt,setPosition:Lt,getPosition:bt,disableTextSelection:_i,enableTextSelection:di,disableImageDrag:Pt,enableImageDrag:Tt,preventOutline:zt,restoreOutline:Mt}),fe=ai.extend({run:function(t,i,e,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=e||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=bt(t),this._offset=i.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=f(this._animate,this),this._step()},_step:function(t){var i=+new Date-this._startTime,e=1e3*this._duration;i<e?this._runFrame(this._easeOut(i/e),t):(this._runFrame(1),this._complete())},_runFrame:function(t,i){var e=this._startPos.add(this._offset.multiplyBy(t));i&&e._round(),Lt(this._el,e),this.fire("step")},_complete:function(){g(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),ge=ai.extend({options:{crs:mi,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,i){i=l(this,i),this._initContainer(t),this._initLayout(),this._onResize=e(this._onResize,this),this._initEvents(),i.maxBounds&&this.setMaxBounds(i.maxBounds),void 0!==i.zoom&&(this._zoom=this._limitZoom(i.zoom)),i.center&&void 0!==i.zoom&&this.setView(C(i.center),i.zoom,{reset:!0}),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this.callInitHooks(),this._zoomAnimated=le&&Ii&&!Wi&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),V(this._proxy,ce,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,n){return e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(C(t),e,this.options.maxBounds),n=n||{},this._stop(),this._loaded&&!n.reset&&!0!==n&&(void 0!==n.animate&&(n.zoom=i({animate:n.animate},n.zoom),n.pan=i({animate:n.animate,duration:n.duration},n.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,n.zoom):this._tryAnimatedPan(t,n.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e),this)},setZoom:function(t,i){return this._loaded?this.setView(this.getCenter(),t,{zoom:i}):(this._zoom=t,this)},zoomIn:function(t,i){return t=t||(Ii?this.options.zoomDelta:1),this.setZoom(this._zoom+t,i)},zoomOut:function(t,i){return t=t||(Ii?this.options.zoomDelta:1),this.setZoom(this._zoom-t,i)},setZoomAround:function(t,i,e){var n=this.getZoomScale(i),o=this.getSize().divideBy(2),s=(t instanceof x?t:this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1-1/n),r=this.containerPointToLatLng(o.add(s));return this.setView(r,i,{zoom:e})},_getBoundsCenterZoom:function(t,i){i=i||{},t=t.getBounds?t.getBounds():z(t);var e=w(i.paddingTopLeft||i.padding||[0,0]),n=w(i.paddingBottomRight||i.padding||[0,0]),o=this.getBoundsZoom(t,!1,e.add(n));if((o="number"==typeof i.maxZoom?Math.min(i.maxZoom,o):o)===1/0)return{center:t.getCenter(),zoom:o};var s=n.subtract(e).divideBy(2),r=this.project(t.getSouthWest(),o),a=this.project(t.getNorthEast(),o);return{center:this.unproject(r.add(a).divideBy(2).add(s),o),zoom:o}},fitBounds:function(t,i){if(!(t=z(t)).isValid())throw new Error("Bounds are not valid.");var e=this._getBoundsCenterZoom(t,i);return this.setView(e.center,e.zoom,i)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,i){return this.setView(t,this._zoom,{pan:i})},panBy:function(t,i){if(t=w(t).round(),i=i||{},!t.x&&!t.y)return this.fire("moveend");if(!0!==i.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new fe,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),i.noMoveStart||this.fire("movestart"),!1!==i.animate){pt(this._mapPane,"leaflet-pan-anim");var e=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,e,i.duration||.25,i.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,i,e){function n(t){var i=(g*g-m*m+(t?-1:1)*x*x*v*v)/(2*(t?g:m)*x*v),e=Math.sqrt(i*i+1)-i;return e<1e-9?-18:Math.log(e)}function o(t){return(Math.exp(t)-Math.exp(-t))/2}function s(t){return(Math.exp(t)+Math.exp(-t))/2}function r(t){return o(t)/s(t)}function a(t){return m*(s(w)/s(w+y*t))}function h(t){return m*(s(w)*r(w+y*t)-o(w))/x}function u(t){return 1-Math.pow(1-t,1.5)}function l(){var e=(Date.now()-L)/P,n=u(e)*b;e<=1?(this._flyToFrame=f(l,this),this._move(this.unproject(c.add(_.subtract(c).multiplyBy(h(n)/v)),p),this.getScaleZoom(m/a(n),p),{flyTo:!0})):this._move(t,i)._moveEnd(!0)}if(!1===(e=e||{}).animate||!Ii)return this.setView(t,i,e);this._stop();var c=this.project(this.getCenter()),_=this.project(t),d=this.getSize(),p=this._zoom;t=C(t),i=void 0===i?p:i;var m=Math.max(d.x,d.y),g=m*this.getZoomScale(p,i),v=_.distanceTo(c)||1,y=1.42,x=y*y,w=n(0),L=Date.now(),b=(n(1)-w)/y,P=e.duration?1e3*e.duration:1e3*b*.8;return this._moveStart(!0),l.call(this),this},flyToBounds:function(t,i){var e=this._getBoundsCenterZoom(t,i);return this.flyTo(e.center,e.zoom,i)},setMaxBounds:function(t){return(t=z(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){return this.options.minZoom=t,this._loaded&&this.getZoom()<this.options.minZoom?this.setZoom(t):this},setMaxZoom:function(t){return this.options.maxZoom=t,this._loaded&&this.getZoom()>this.options.maxZoom?this.setZoom(t):this},panInsideBounds:function(t,i){this._enforcingBounds=!0;var e=this.getCenter(),n=this._limitCenter(e,this._zoom,z(t));return e.equals(n)||this.panTo(n,i),this._enforcingBounds=!1,this},invalidateSize:function(t){if(!this._loaded)return this;t=i({animate:!1,pan:!0},!0===t?{animate:!0}:t);var n=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var o=this.getSize(),s=n.divideBy(2).round(),r=o.divideBy(2).round(),a=s.subtract(r);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(e(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:n,newSize:o})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=i({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var n=e(this._handleGeolocationResponse,this),o=e(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(n,o,t):navigator.geolocation.getCurrentPosition(n,o,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var i=t.code,e=t.message||(1===i?"permission denied":2===i?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:i,message:"Geolocation error: "+e+"."})},_handleGeolocationResponse:function(t){var i=new M(t.coords.latitude,t.coords.longitude),e=i.toBounds(t.coords.accuracy),n=this._locateOptions;if(n.setView){var o=this.getBoundsZoom(e);this.setView(i,n.maxZoom?Math.min(o,n.maxZoom):o)}var s={latlng:i,bounds:e,timestamp:t.timestamp};for(var r in t.coords)"number"==typeof t.coords[r]&&(s[r]=t.coords[r]);this.fire("locationfound",s)},addHandler:function(t,i){if(!i)return this;var e=this[t]=new i(this);return this._handlers.push(e),this.options[t]&&e.enable(),this},remove:function(){if(this._initEvents(!0),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}ut(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._clearHandlers(),this._loaded&&this.fire("unload");var t;for(t in this._layers)this._layers[t].remove();for(t in this._panes)ut(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,i){var e=ht("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),i||this._mapPane);return t&&(this._panes[t]=e),e},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new T(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,i,e){t=z(t),e=w(e||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=t.getSouthEast(),h=this.getSize().subtract(e),u=P(this.project(a,n),this.project(r,n)).getSize(),l=Ii?this.options.zoomSnap:1,c=h.x/u.x,_=h.y/u.y,d=i?Math.max(c,_):Math.min(c,_);return n=this.getScaleZoom(d,n),l&&(n=Math.round(n/(l/100))*(l/100),n=i?Math.ceil(n/l)*l:Math.floor(n/l)*l),Math.max(o,Math.min(s,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new x(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,i){var e=this._getTopLeftPoint(t,i);return new b(e,e.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,i){var e=this.options.crs;return i=void 0===i?this._zoom:i,e.scale(t)/e.scale(i)},getScaleZoom:function(t,i){var e=this.options.crs;i=void 0===i?this._zoom:i;var n=e.zoom(t*e.scale(i));return isNaN(n)?1/0:n},project:function(t,i){return i=void 0===i?this._zoom:i,this.options.crs.latLngToPoint(C(t),i)},unproject:function(t,i){return i=void 0===i?this._zoom:i,this.options.crs.pointToLatLng(w(t),i)},layerPointToLatLng:function(t){var i=w(t).add(this.getPixelOrigin());return this.unproject(i)},latLngToLayerPoint:function(t){return this.project(C(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(C(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(z(t))},distance:function(t,i){return this.options.crs.distance(C(t),C(i))},containerPointToLayerPoint:function(t){return w(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return w(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var i=this.containerPointToLayerPoint(w(t));return this.layerPointToLatLng(i)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(C(t)))},mouseEventToContainerPoint:function(t){return tt(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var i=this._container=rt(t);if(!i)throw new Error("Map container not found.");if(i._leaflet_id)throw new Error("Map container is already initialized.");V(i,"scroll",this._onScroll,this),this._containerId=n(i)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&Ii,pt(t,"leaflet-container"+(ji?" leaflet-touch":"")+(Fi?" leaflet-retina":"")+(yi?" leaflet-oldie":"")+(Mi?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var i=at(t,"position");"absolute"!==i&&"relative"!==i&&"fixed"!==i&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Lt(this._mapPane,new x(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(pt(t.markerPane,"leaflet-zoom-hide"),pt(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,i){Lt(this._mapPane,new x(0,0));var e=!this._loaded;this._loaded=!0,i=this._limitZoom(i),this.fire("viewprereset");var n=this._zoom!==i;this._moveStart(n)._move(t,i)._moveEnd(n),this.fire("viewreset"),e&&this.fire("load")},_moveStart:function(t){return t&&this.fire("zoomstart"),this.fire("movestart")},_move:function(t,i,e){void 0===i&&(i=this._zoom);var n=this._zoom!==i;return this._zoom=i,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(n||e&&e.pinch)&&this.fire("zoom",e),this.fire("move",e)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return g(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Lt(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[n(this._container)]=this;var i=t?G:V;i(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress",this._handleDOMEvent,this),this.options.trackResize&&i(window,"resize",this._onResize,this),Ii&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){g(this._resizeRequest),this._resizeRequest=f(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,i){for(var e,o=[],s="mouseout"===i||"mouseover"===i,r=t.target||t.srcElement,a=!1;r;){if((e=this._targets[n(r)])&&("click"===i||"preclick"===i)&&!t._simulated&&this._draggableMoved(e)){a=!0;break}if(e&&e.listens(i,!0)){if(s&&!ot(r,t))break;if(o.push(e),s)break}if(r===this._container)break;r=r.parentNode}return o.length||a||s||!ot(r,t)||(o=[this]),o},_handleDOMEvent:function(t){if(this._loaded&&!nt(t)){var i=t.type;"mousedown"!==i&&"keypress"!==i||zt(t.target||t.srcElement),this._fireDOMEvent(t,i)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,n){if("click"===t.type){var o=i({},t);o.type="preclick",this._fireDOMEvent(o,o.type,n)}if(!t._stopped&&(n=(n||[]).concat(this._findEventTargets(t,e))).length){var s=n[0];"contextmenu"===e&&s.listens(e,!0)&&$(t);var r={originalEvent:t};if("keypress"!==t.type){var a=s.options&&"icon"in s.options;r.containerPoint=a?this.latLngToContainerPoint(s.getLatLng()):this.mouseEventToContainerPoint(t),r.layerPoint=this.containerPointToLayerPoint(r.containerPoint),r.latlng=a?s.getLatLng():this.layerPointToLatLng(r.layerPoint)}for(var h=0;h<n.length;h++)if(n[h].fire(e,r,!0),r.originalEvent._stopped||!1===n[h].options.bubblingMouseEvents&&-1!==d(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,i=this._handlers.length;t<i;t++)this._handlers[t].disable()},whenReady:function(t,i){return this._loaded?t.call(i||this,{target:this}):this.on("load",t,i),this},_getMapPanePos:function(){return bt(this._mapPane)||new x(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,i){return(t&&void 0!==i?this._getNewPixelOrigin(t,i):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,i){var e=this.getSize()._divideBy(2);return this.project(t,i)._subtract(e)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,i,e){var n=this._getNewPixelOrigin(e,i);return this.project(t,i)._subtract(n)},_latLngBoundsToNewLayerBounds:function(t,i,e){var n=this._getNewPixelOrigin(e,i);return P([this.project(t.getSouthWest(),i)._subtract(n),this.project(t.getNorthWest(),i)._subtract(n),this.project(t.getSouthEast(),i)._subtract(n),this.project(t.getNorthEast(),i)._subtract(n)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,i,e){if(!e)return t;var n=this.project(t,i),o=this.getSize().divideBy(2),s=new b(n.subtract(o),n.add(o)),r=this._getBoundsOffset(s,e,i);return r.round().equals([0,0])?t:this.unproject(n.add(r),i)},_limitOffset:function(t,i){if(!i)return t;var e=this.getPixelBounds(),n=new b(e.min.add(t),e.max.add(t));return t.add(this._getBoundsOffset(n,i))},_getBoundsOffset:function(t,i,e){var n=P(this.project(i.getNorthEast(),e),this.project(i.getSouthWest(),e)),o=n.min.subtract(t.min),s=n.max.subtract(t.max);return new x(this._rebound(o.x,-s.x),this._rebound(o.y,-s.y))},_rebound:function(t,i){return t+i>0?Math.round(t-i)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(i))},_limitZoom:function(t){var i=this.getMinZoom(),e=this.getMaxZoom(),n=Ii?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(i,Math.min(e,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){mt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,i){var e=this._getCenterOffset(t)._floor();return!(!0!==(i&&i.animate)&&!this.getSize().contains(e)||(this.panBy(e,i),0))},_createAnimProxy:function(){var t=this._proxy=ht("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(t){var i=ue,e=this._proxy.style[i];wt(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),e===this._proxy.style[i]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",function(){var t=this.getCenter(),i=this.getZoom();wt(this._proxy,this.project(t,i),this.getZoomScale(i,1))},this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ut(this._proxy),delete this._proxy},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,i,e){if(this._animatingZoom)return!0;if(e=e||{},!this._zoomAnimated||!1===e.animate||this._nothingToAnimate()||Math.abs(i-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(i),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==e.animate&&!this.getSize().contains(o)||(f(function(){this._moveStart(!0)._animateZoom(t,i,!0)},this),0))},_animateZoom:function(t,i,n,o){n&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=i,pt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:i,noUpdate:o}),setTimeout(e(this._onZoomTransitionEnd,this),250)},_onZoomTransitionEnd:function(){this._animatingZoom&&(mt(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),f(function(){this._moveEnd(!0)},this))}}),ve=v.extend({options:{position:"topright"},initialize:function(t){l(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var i=this._map;return i&&i.removeControl(this),this.options.position=t,i&&i.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var i=this._container=this.onAdd(t),e=this.getPosition(),n=t._controlCorners[e];return pt(i,"leaflet-control"),-1!==e.indexOf("bottom")?n.insertBefore(i,n.firstChild):n.appendChild(i),this},remove:function(){return this._map?(ut(this._container),this.onRemove&&this.onRemove(this._map),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),ye=function(t){return new ve(t)};ge.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){function t(t,o){var s=e+t+" "+e+o;i[t+o]=ht("div",s,n)}var i=this._controlCorners={},e="leaflet-",n=this._controlContainer=ht("div",e+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ut(this._controlCorners[t]);ut(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var xe=ve.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,i,e,n){return e<n?-1:n<e?1:0}},initialize:function(t,i,e){l(this,e),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1;for(var n in t)this._addLayer(t[n],n);for(n in i)this._addLayer(i[n],n,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var i=0;i<this._layers.length;i++)this._layers[i].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return ve.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,i){return this._addLayer(t,i),this._map?this._update():this},addOverlay:function(t,i){return this._addLayer(t,i,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var i=this._getLayer(n(t));return i&&this._layers.splice(this._layers.indexOf(i),1),this._map?this._update():this},expand:function(){pt(this._container,"leaflet-control-layers-expanded"),this._form.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._form.clientHeight?(pt(this._form,"leaflet-control-layers-scrollbar"),this._form.style.height=t+"px"):mt(this._form,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return mt(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",i=this._container=ht("div",t),n=this.options.collapsed;i.setAttribute("aria-haspopup",!0),J(i),X(i);var o=this._form=ht("form",t+"-list");n&&(this._map.on("click",this.collapse,this),Li||V(i,{mouseenter:this.expand,mouseleave:this.collapse},this));var s=this._layersLink=ht("a",t+"-toggle",i);s.href="#",s.title="Layers",ji?(V(s,"click",Q),V(s,"click",this.expand,this)):V(s,"focus",this.expand,this),V(o,"click",function(){setTimeout(e(this._onInputClick,this),0)},this),n||this.expand(),this._baseLayersList=ht("div",t+"-base",o),this._separator=ht("div",t+"-separator",o),this._overlaysList=ht("div",t+"-overlays",o),i.appendChild(o)},_getLayer:function(t){for(var i=0;i<this._layers.length;i++)if(this._layers[i]&&n(this._layers[i].layer)===t)return this._layers[i]},_addLayer:function(t,i,e){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:i,overlay:e}),this.options.sortLayers&&this._layers.sort(L.bind(function(t,i){return this.options.sortFunction(t.layer,i.layer,t.name,i.name)},this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;lt(this._baseLayersList),lt(this._overlaysList),this._layerControlInputs=[];var t,i,e,n,o=0;for(e=0;e<this._layers.length;e++)n=this._layers[e],this._addItem(n),i=i||n.overlay,t=t||!n.overlay,o+=n.overlay?0:1;return this.options.hideSingleBase&&(t=t&&o>1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=i&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var i=this._getLayer(n(t.target)),e=i.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;e&&this._map.fire(e,i)},_createRadioElement:function(t,i){var e='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(i?' checked="checked"':"")+"/>",n=document.createElement("div");return n.innerHTML=e,n.firstChild},_addItem:function(t){var i,e=document.createElement("label"),o=this._map.hasLayer(t.layer);t.overlay?(i=document.createElement("input"),i.type="checkbox",i.className="leaflet-control-layers-selector",i.defaultChecked=o):i=this._createRadioElement("leaflet-base-layers",o),this._layerControlInputs.push(i),i.layerId=n(t.layer),V(i,"click",this._onInputClick,this);var s=document.createElement("span");s.innerHTML=" "+t.name;var r=document.createElement("div");return e.appendChild(r),r.appendChild(i),r.appendChild(s),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(e),this._checkDisabledLayers(),e},_onInputClick:function(){var t,i,e,n=this._layerControlInputs,o=[],s=[];this._handlingClick=!0;for(var r=n.length-1;r>=0;r--)t=n[r],i=this._getLayer(t.layerId).layer,e=this._map.hasLayer(i),t.checked&&!e?o.push(i):!t.checked&&e&&s.push(i);for(r=0;r<s.length;r++)this._map.removeLayer(s[r]);for(r=0;r<o.length;r++)this._map.addLayer(o[r]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,i,e=this._layerControlInputs,n=this._map.getZoom(),o=e.length-1;o>=0;o--)t=e[o],i=this._getLayer(t.layerId).layer,t.disabled=void 0!==i.options.minZoom&&n<i.options.minZoom||void 0!==i.options.maxZoom&&n>i.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),we=ve.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"&#x2212;",zoomOutTitle:"Zoom out"},onAdd:function(t){var i="leaflet-control-zoom",e=ht("div",i+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,i+"-in",e,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,i+"-out",e,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),e},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,i,e,n,o){var s=ht("a",e,n);return s.innerHTML=t,s.href="#",s.title=i,s.setAttribute("role","button"),s.setAttribute("aria-label",i),J(s),V(s,"click",Q),V(s,"click",o,this),V(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,i="leaflet-disabled";mt(this._zoomInButton,i),mt(this._zoomOutButton,i),(this._disabled||t._zoom===t.getMinZoom())&&pt(this._zoomOutButton,i),(this._disabled||t._zoom===t.getMaxZoom())&&pt(this._zoomInButton,i)}});ge.mergeOptions({zoomControl:!0}),ge.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new we,this.addControl(this.zoomControl))});var Le=ve.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var i="leaflet-control-scale",e=ht("div",i),n=this.options;return this._addScales(n,i+"-line",e),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),e},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,i,e){t.metric&&(this._mScale=ht("div",i,e)),t.imperial&&(this._iScale=ht("div",i,e))},_update:function(){var t=this._map,i=t.getSize().y/2,e=t.distance(t.containerPointToLatLng([0,i]),t.containerPointToLatLng([this.options.maxWidth,i]));this._updateScales(e)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var i=this._getRoundNum(t),e=i<1e3?i+" m":i/1e3+" km";this._updateScale(this._mScale,e,i/t)},_updateImperial:function(t){var i,e,n,o=3.2808399*t;o>5280?(i=o/5280,e=this._getRoundNum(i),this._updateScale(this._iScale,e+" mi",e/i)):(n=this._getRoundNum(o),this._updateScale(this._iScale,n+" ft",n/o))},_updateScale:function(t,i,e){t.style.width=Math.round(this.options.maxWidth*e)+"px",t.innerHTML=i},_getRoundNum:function(t){var i=Math.pow(10,(Math.floor(t)+"").length-1),e=t/i;return e=e>=10?10:e>=5?5:e>=3?3:e>=2?2:1,i*e}}),be=ve.extend({options:{position:"bottomright",prefix:'<a href="http://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){l(this,t),this._attributions={}},onAdd:function(t){t.attributionControl=this,this._container=ht("div","leaflet-control-attribution"),J(this._container);for(var i in t._layers)t._layers[i].getAttribution&&this.addAttribution(t._layers[i].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var i in this._attributions)this._attributions[i]&&t.push(i);var e=[];this.options.prefix&&e.push(this.options.prefix),t.length&&e.push(t.join(", ")),this._container.innerHTML=e.join(" | ")}}});ge.mergeOptions({attributionControl:!0}),ge.addInitHook(function(){this.options.attributionControl&&(new be).addTo(this)});ve.Layers=xe,ve.Zoom=we,ve.Scale=Le,ve.Attribution=be,ye.layers=function(t,i,e){return new xe(t,i,e)},ye.zoom=function(t){return new we(t)},ye.scale=function(t){return new Le(t)},ye.attribution=function(t){return new be(t)};var Pe,Te=v.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}}),ze={Events:ri},Me=!1,Ce=ji?"touchstart mousedown":"mousedown",Ze={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},Se={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},Ee=ai.extend({options:{clickTolerance:3},initialize:function(t,i,e,n){l(this,n),this._element=t,this._dragStartTarget=i||t,this._preventOutline=e},enable:function(){this._enabled||(V(this._dragStartTarget,Ce,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(L.Draggable._dragging===this&&this.finishDrag(),G(this._dragStartTarget,Ce,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!dt(this._element,"leaflet-zoom-anim")&&!(Me||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(Me=this,this._preventOutline&&zt(this._element),Pt(),_i(),this._moving)))){this.fire("down");var i=t.touches?t.touches[0]:t;this._startPoint=new x(i.clientX,i.clientY),V(document,Se[t.type],this._onMove,this),V(document,Ze[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled){if(t.touches&&t.touches.length>1)return void(this._moved=!0);var i=t.touches&&1===t.touches.length?t.touches[0]:t,e=new x(i.clientX,i.clientY).subtract(this._startPoint);(e.x||e.y)&&(Math.abs(e.x)+Math.abs(e.y)<this.options.clickTolerance||($(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=bt(this._element).subtract(e),pt(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),pt(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(e),this._moving=!0,g(this._animRequest),this._lastEvent=t,this._animRequest=f(this._updatePosition,this,!0)))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Lt(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){mt(document.body,"leaflet-dragging"),this._lastTarget&&(mt(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null);for(var t in Se)G(document,Se[t],this._onMove,this),G(document,Ze[t],this._onUp,this);Tt(),di(),this._moved&&this._moving&&(g(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1,Me=!1}}),ke=(Object.freeze||Object)({simplify:Ct,pointToSegmentDistance:Zt,closestPointOnSegment:function(t,i,e){return Rt(t,i,e)},clipSegment:Bt,_getEdgeIntersection:It,_getBitCode:At,_sqClosestPointOnSegment:Rt,_flat:Dt}),Be=(Object.freeze||Object)({clipPolygon:Nt}),Ie={project:function(t){return new x(t.lng,t.lat)},unproject:function(t){return new M(t.y,t.x)},bounds:new b([-180,-90],[180,90])},Ae={R:6378137,R_MINOR:6356752.314245179,bounds:new b([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var i=Math.PI/180,e=this.R,n=t.lat*i,o=this.R_MINOR/e,s=Math.sqrt(1-o*o),r=s*Math.sin(n),a=Math.tan(Math.PI/4-n/2)/Math.pow((1-r)/(1+r),s/2);return n=-e*Math.log(Math.max(a,1e-10)),new x(t.lng*i*e,n)},unproject:function(t){for(var i,e=180/Math.PI,n=this.R,o=this.R_MINOR/n,s=Math.sqrt(1-o*o),r=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(r),h=0,u=.1;h<15&&Math.abs(u)>1e-7;h++)i=s*Math.sin(a),i=Math.pow((1-i)/(1+i),s/2),a+=u=Math.PI/2-2*Math.atan(r*i)-a;return new M(a*e,t.x*e/n)}},Oe=(Object.freeze||Object)({LonLat:Ie,Mercator:Ae,SphericalMercator:li}),Re=i({},ui,{code:"EPSG:3395",projection:Ae,transformation:function(){var t=.5/(Math.PI*Ae.R);return S(t,.5,-t,.5)}()}),De=i({},ui,{code:"EPSG:4326",projection:Ie,transformation:S(1/180,1,-1/180,.5)}),Ne=i({},hi,{projection:Ie,transformation:S(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,i){var e=i.lng-t.lng,n=i.lat-t.lat;return Math.sqrt(e*e+n*n)},infinite:!0});hi.Earth=ui,hi.EPSG3395=Re,hi.EPSG3857=mi,hi.EPSG900913=fi,hi.EPSG4326=De,hi.Simple=Ne;var je=ai.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[n(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[n(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var i=t.target;if(i.hasLayer(this)){if(this._map=i,this._zoomAnimated=i._zoomAnimated,this.getEvents){var e=this.getEvents();i.on(e,this),this.once("remove",function(){i.off(e,this)},this)}this.onAdd(i),this.getAttribution&&i.attributionControl&&i.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),i.fire("layeradd",{layer:this})}}});ge.include({addLayer:function(t){var i=n(t);return this._layers[i]?this:(this._layers[i]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t),this)},removeLayer:function(t){var i=n(t);return this._layers[i]?(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),delete this._layers[i],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return!!t&&n(t)in this._layers},eachLayer:function(t,i){for(var e in this._layers)t.call(i,this._layers[e]);return this},_addLayers:function(t){for(var i=0,e=(t=t?ti(t)?t:[t]:[]).length;i<e;i++)this.addLayer(t[i])},_addZoomLimit:function(t){!isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[n(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var i=n(t);this._zoomBoundLayers[i]&&(delete this._zoomBoundLayers[i],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,i=-1/0,e=this._getZoomSpan();for(var n in this._zoomBoundLayers){var o=this._zoomBoundLayers[n].options;t=void 0===o.minZoom?t:Math.min(t,o.minZoom),i=void 0===o.maxZoom?i:Math.max(i,o.maxZoom)}this._layersMaxZoom=i===-1/0?void 0:i,this._layersMinZoom=t===1/0?void 0:t,e!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var We=je.extend({initialize:function(t){this._layers={};var i,e;if(t)for(i=0,e=t.length;i<e;i++)this.addLayer(t[i])},addLayer:function(t){var i=this.getLayerId(t);return this._layers[i]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var i=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[i]&&this._map.removeLayer(this._layers[i]),delete this._layers[i],this},hasLayer:function(t){return!!t&&(t in this._layers||this.getLayerId(t)in this._layers)},clearLayers:function(){for(var t in this._layers)this.removeLayer(this._layers[t]);return this},invoke:function(t){var i,e,n=Array.prototype.slice.call(arguments,1);for(i in this._layers)(e=this._layers[i])[t]&&e[t].apply(e,n);return this},onAdd:function(t){for(var i in this._layers)t.addLayer(this._layers[i])},onRemove:function(t){for(var i in this._layers)t.removeLayer(this._layers[i])},eachLayer:function(t,i){for(var e in this._layers)t.call(i,this._layers[e]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];for(var i in this._layers)t.push(this._layers[i]);return t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return n(t)}}),He=We.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),We.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),We.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new T;for(var i in this._layers){var e=this._layers[i];t.extend(e.getBounds?e.getBounds():e.getLatLng())}return t}}),Fe=v.extend({initialize:function(t){l(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,i){var e=this._getIconUrl(t);if(!e){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n=this._createImg(e,i&&"IMG"===i.tagName?i:null);return this._setIconStyles(n,t),n},_setIconStyles:function(t,i){var e=this.options,n=e[i+"Size"];"number"==typeof n&&(n=[n,n]);var o=w(n),s=w("shadow"===i&&e.shadowAnchor||e.iconAnchor||o&&o.divideBy(2,!0));t.className="leaflet-marker-"+i+" "+(e.className||""),s&&(t.style.marginLeft=-s.x+"px",t.style.marginTop=-s.y+"px"),o&&(t.style.width=o.x+"px",t.style.height=o.y+"px")},_createImg:function(t,i){return i=i||document.createElement("img"),i.src=t,i},_getIconUrl:function(t){return Fi&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}}),Ue=Fe.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return Ue.imagePath||(Ue.imagePath=this._detectIconPath()),(this.options.imagePath||Ue.imagePath)+Fe.prototype._getIconUrl.call(this,t)},_detectIconPath:function(){var t=ht("div","leaflet-default-icon-path",document.body),i=at(t,"background-image")||at(t,"backgroundImage");return document.body.removeChild(t),i=null===i||0!==i.indexOf("url")?"":i.replace(/^url\([\"\']?/,"").replace(/marker-icon\.png[\"\']?\)$/,"")}}),Ve=Te.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new Ee(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),pt(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&mt(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(t){var i=this._marker,e=i._shadow,n=bt(i._icon),o=i._map.layerPointToLatLng(n);e&&Lt(e,n),i._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,i.fire("move",t).fire("drag",t)},_onDragEnd:function(t){delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Ge=je.extend({options:{icon:new Ue,interactive:!0,draggable:!1,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",bubblingMouseEvents:!1},initialize:function(t,i){l(this,i),this._latlng=C(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var i=this._latlng;return this._latlng=C(t),this.update(),this.fire("move",{oldLatLng:i,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,i="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),e=t.icon.createIcon(this._icon),n=!1;e!==this._icon&&(this._icon&&this._removeIcon(),n=!0,t.title&&(e.title=t.title),t.alt&&(e.alt=t.alt)),pt(e,i),t.keyboard&&(e.tabIndex="0"),this._icon=e,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});var o=t.icon.createShadow(this._shadow),s=!1;o!==this._shadow&&(this._removeShadow(),s=!0),o&&(pt(o,i),o.alt=""),this._shadow=o,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),o&&s&&this.getPane("shadowPane").appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),ut(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ut(this._shadow),this._shadow=null},_setPos:function(t){Lt(this._icon,t),this._shadow&&Lt(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var i=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(i)},_initInteraction:function(){if(this.options.interactive&&(pt(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Ve)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Ve(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;vt(this._icon,t),this._shadow&&vt(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor||[0,0]},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor||[0,0]}}),qe=je.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return l(this,t),this._renderer&&this._renderer._updateStyle(this),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(ji?10:0)}}),Ke=qe.extend({options:{fill:!0,radius:10},initialize:function(t,i){l(this,i),this._latlng=C(t),this._radius=this.options.radius},setLatLng:function(t){return this._latlng=C(t),this.redraw(),this.fire("move",{latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var i=t&&t.radius||this._radius;return qe.prototype.setStyle.call(this,t),this.setRadius(i),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,i=this._radiusY||t,e=this._clickTolerance(),n=[t+e,i+e];this._pxBounds=new b(this._point.subtract(n),this._point.add(n))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}}),Ye=Ke.extend({initialize:function(t,e,n){if("number"==typeof e&&(e=i({},n,{radius:e})),l(this,e),this._latlng=C(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new T(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:qe.prototype.setStyle,_project:function(){var t=this._latlng.lng,i=this._latlng.lat,e=this._map,n=e.options.crs;if(n.distance===ui.distance){var o=Math.PI/180,s=this._mRadius/ui.R/o,r=e.project([i+s,t]),a=e.project([i-s,t]),h=r.add(a).divideBy(2),u=e.unproject(h).lat,l=Math.acos((Math.cos(s*o)-Math.sin(i*o)*Math.sin(u*o))/(Math.cos(i*o)*Math.cos(u*o)))/o;(isNaN(l)||0===l)&&(l=s/Math.cos(Math.PI/180*i)),this._point=h.subtract(e.getPixelOrigin()),this._radius=isNaN(l)?0:Math.max(Math.round(h.x-e.project([u,t-l]).x),1),this._radiusY=Math.max(Math.round(h.y-r.y),1)}else{var c=n.unproject(n.project(this._latlng).subtract([this._mRadius,0]));this._point=e.latLngToLayerPoint(this._latlng),this._radius=this._point.x-e.latLngToLayerPoint(c).x}this._updateBounds()}}),Xe=qe.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,i){l(this,i),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var i,e,n=1/0,o=null,s=Rt,r=0,a=this._parts.length;r<a;r++)for(var h=this._parts[r],u=1,l=h.length;u<l;u++){var c=s(t,i=h[u-1],e=h[u],!0);c<n&&(n=c,o=s(t,i,e))}return o&&(o.distance=Math.sqrt(n)),o},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,i,e,n,o,s,r,a=this._rings[0],h=a.length;if(!h)return null;for(t=0,i=0;t<h-1;t++)i+=a[t].distanceTo(a[t+1])/2;if(0===i)return this._map.layerPointToLatLng(a[0]);for(t=0,n=0;t<h-1;t++)if(o=a[t],s=a[t+1],e=o.distanceTo(s),(n+=e)>i)return r=(n-i)/e,this._map.layerPointToLatLng([s.x-r*(s.x-o.x),s.y-r*(s.y-o.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,i){return i=i||this._defaultShape(),t=C(t),i.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new T,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Dt(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var i=[],e=Dt(t),n=0,o=t.length;n<o;n++)e?(i[n]=C(t[n]),this._bounds.extend(i[n])):i[n]=this._convertLatLngs(t[n]);return i},_project:function(){var t=new b;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t);var i=this._clickTolerance(),e=new x(i,i);this._bounds.isValid()&&t.isValid()&&(t.min._subtract(e),t.max._add(e),this._pxBounds=t)},_projectLatlngs:function(t,i,e){var n,o,s=t[0]instanceof M,r=t.length;if(s){for(o=[],n=0;n<r;n++)o[n]=this._map.latLngToLayerPoint(t[n]),e.extend(o[n]);i.push(o)}else for(n=0;n<r;n++)this._projectLatlngs(t[n],i,e)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t)){if(this.options.noClip)return void(this._parts=this._rings);var i,e,n,o,s,r,a,h=this._parts;for(i=0,n=0,o=this._rings.length;i<o;i++)for(e=0,s=(a=this._rings[i]).length;e<s-1;e++)(r=Bt(a[e],a[e+1],t,e,!0))&&(h[n]=h[n]||[],h[n].push(r[0]),r[1]===a[e+1]&&e!==s-2||(h[n].push(r[1]),n++))}},_simplifyPoints:function(){for(var t=this._parts,i=this.options.smoothFactor,e=0,n=t.length;e<n;e++)t[e]=Ct(t[e],i)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,i){var e,n,o,s,r,a,h=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(e=0,s=this._parts.length;e<s;e++)for(n=0,o=(r=(a=this._parts[e]).length)-1;n<r;o=n++)if((i||0!==n)&&Zt(t,a[o],a[n])<=h)return!0;return!1}}),Je=Xe.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,i,e,n,o,s,r,a,h,u=this._rings[0],l=u.length;if(!l)return null;for(s=r=a=0,t=0,i=l-1;t<l;i=t++)e=u[t],n=u[i],o=e.y*n.x-n.y*e.x,r+=(e.x+n.x)*o,a+=(e.y+n.y)*o,s+=3*o;return h=0===s?u[0]:[r/s,a/s],this._map.layerPointToLatLng(h)},_convertLatLngs:function(t){var i=Xe.prototype._convertLatLngs.call(this,t),e=i.length;return e>=2&&i[0]instanceof M&&i[0].equals(i[e-1])&&i.pop(),i},_setLatLngs:function(t){Xe.prototype._setLatLngs.call(this,t),Dt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Dt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,i=this.options.weight,e=new x(i,i);if(t=new b(t.min.subtract(e),t.max.add(e)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t)){if(this.options.noClip)return void(this._parts=this._rings);for(var n,o=0,s=this._rings.length;o<s;o++)(n=Nt(this._rings[o],t,!0)).length&&this._parts.push(n)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var i,e,n,o,s,r,a,h,u=!1;if(!this._pxBounds.contains(t))return!1;for(o=0,a=this._parts.length;o<a;o++)for(s=0,r=(h=(i=this._parts[o]).length)-1;s<h;r=s++)e=i[s],n=i[r],e.y>t.y!=n.y>t.y&&t.x<(n.x-e.x)*(t.y-e.y)/(n.y-e.y)+e.x&&(u=!u);return u||Xe.prototype._containsPoint.call(this,t,!0)}}),$e=He.extend({initialize:function(t,i){l(this,i),this._layers={},t&&this.addData(t)},addData:function(t){var i,e,n,o=ti(t)?t:t.features;if(o){for(i=0,e=o.length;i<e;i++)((n=o[i]).geometries||n.geometry||n.features||n.coordinates)&&this.addData(n);return this}var s=this.options;if(s.filter&&!s.filter(t))return this;var r=jt(t,s);return r?(r.feature=Gt(t),r.defaultOptions=r.options,this.resetStyle(r),s.onEachFeature&&s.onEachFeature(t,r),this.addLayer(r)):this},resetStyle:function(t){return t.options=i({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this},setStyle:function(t){return this.eachLayer(function(i){this._setLayerStyle(i,t)},this)},_setLayerStyle:function(t,i){"function"==typeof i&&(i=i(t.feature)),t.setStyle&&t.setStyle(i)}}),Qe={toGeoJSON:function(t){return Vt(this,{type:"Point",coordinates:Ft(this.getLatLng(),t)})}};Ge.include(Qe),Ye.include(Qe),Ke.include(Qe),Xe.include({toGeoJSON:function(t){var i=!Dt(this._latlngs),e=Ut(this._latlngs,i?1:0,!1,t);return Vt(this,{type:(i?"Multi":"")+"LineString",coordinates:e})}}),Je.include({toGeoJSON:function(t){var i=!Dt(this._latlngs),e=i&&!Dt(this._latlngs[0]),n=Ut(this._latlngs,e?2:i?1:0,!0,t);return i||(n=[n]),Vt(this,{type:(e?"Multi":"")+"Polygon",coordinates:n})}}),We.include({toMultiPoint:function(t){var i=[];return this.eachLayer(function(e){i.push(e.toGeoJSON(t).geometry.coordinates)}),Vt(this,{type:"MultiPoint",coordinates:i})},toGeoJSON:function(t){var i=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===i)return this.toMultiPoint(t);var e="GeometryCollection"===i,n=[];return this.eachLayer(function(i){if(i.toGeoJSON){var o=i.toGeoJSON(t);if(e)n.push(o.geometry);else{var s=Gt(o);"FeatureCollection"===s.type?n.push.apply(n,s.features):n.push(s)}}}),e?Vt(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});var tn=qt,en=je.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,i,e){this._url=t,this._bounds=z(i),l(this,e)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(pt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ut(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&ct(this._image),this},bringToBack:function(){return this._map&&_t(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=t,this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t=this._image=ht("img","leaflet-image-layer "+(this._zoomAnimated?"leaflet-zoom-animated":"")+(this.options.className||""));t.onselectstart=r,t.onmousemove=r,t.onload=e(this.fire,this,"load"),t.onerror=e(this._overlayOnError,this,"error"),this.options.crossOrigin&&(t.crossOrigin=""),this.options.zIndex&&this._updateZIndex(),t.src=this._url,t.alt=this.options.alt},_animateZoom:function(t){var i=this._map.getZoomScale(t.zoom),e=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;wt(this._image,e,i)},_reset:function(){var t=this._image,i=new b(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),e=i.getSize();Lt(t,i.min),t.style.width=e.x+"px",t.style.height=e.y+"px"},_updateOpacity:function(){vt(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)}}),nn=en.extend({options:{autoplay:!0,loop:!0},_initImage:function(){var t=this._image=ht("video","leaflet-image-layer "+(this._zoomAnimated?"leaflet-zoom-animated":""));t.onselectstart=r,t.onmousemove=r,t.onloadeddata=e(this.fire,this,"load"),ti(this._url)||(this._url=[this._url]),t.autoplay=!!this.options.autoplay,t.loop=!!this.options.loop;for(var i=0;i<this._url.length;i++){var n=ht("source");n.src=this._url[i],t.appendChild(n)}}}),on=je.extend({options:{offset:[0,7],className:"",pane:"popupPane"},initialize:function(t,i){l(this,t),this._source=i},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&vt(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&vt(this._container,1),this.bringToFront()},onRemove:function(t){t._fadeAnimated?(vt(this._container,0),this._removeTimeout=setTimeout(e(ut,void 0,this._container),200)):ut(this._container)},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=C(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&ct(this._container),this},bringToBack:function(){return this._map&&_t(this._container),this},_updateContent:function(){if(this._content){var t=this._contentNode,i="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof i)t.innerHTML=i;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(i)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),i=w(this.options.offset),e=this._getAnchor();this._zoomAnimated?Lt(this._container,t.add(e)):i=i.add(t).add(e);var n=this._containerBottom=-i.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+i.x;this._container.style.bottom=n+"px",this._container.style.left=o+"px"}},_getAnchor:function(){return[0,0]}}),sn=on.extend({options:{maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,className:""},openOn:function(t){return t.openPopup(this),this},onAdd:function(t){on.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof qe||this._source.on("preclick",Y))},onRemove:function(t){on.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof qe||this._source.off("preclick",Y))},getEvents:function(){var t=on.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this._close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var t="leaflet-popup",i=this._container=ht("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),e=this._wrapper=ht("div",t+"-content-wrapper",i);if(this._contentNode=ht("div",t+"-content",e),J(e),X(this._contentNode),V(e,"contextmenu",Y),this._tipContainer=ht("div",t+"-tip-container",i),this._tip=ht("div",t+"-tip",this._tipContainer),this.options.closeButton){var n=this._closeButton=ht("a",t+"-close-button",i);n.href="#close",n.innerHTML="&#215;",V(n,"click",this._onCloseButtonClick,this)}},_updateLayout:function(){var t=this._contentNode,i=t.style;i.width="",i.whiteSpace="nowrap";var e=t.offsetWidth;e=Math.min(e,this.options.maxWidth),e=Math.max(e,this.options.minWidth),i.width=e+1+"px",i.whiteSpace="",i.height="";var n=t.offsetHeight,o=this.options.maxHeight,s="leaflet-popup-scrolled";o&&n>o?(i.height=o+"px",pt(t,s)):mt(t,s),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var i=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),e=this._getAnchor();Lt(this._container,i.add(e))},_adjustPan:function(){if(!(!this.options.autoPan||this._map._panAnim&&this._map._panAnim._inProgress)){var t=this._map,i=parseInt(at(this._container,"marginBottom"),10)||0,e=this._container.offsetHeight+i,n=this._containerWidth,o=new x(this._containerLeft,-e-this._containerBottom);o._add(bt(this._container));var s=t.layerPointToContainerPoint(o),r=w(this.options.autoPanPadding),a=w(this.options.autoPanPaddingTopLeft||r),h=w(this.options.autoPanPaddingBottomRight||r),u=t.getSize(),l=0,c=0;s.x+n+h.x>u.x&&(l=s.x+n-u.x+h.x),s.x-l-a.x<0&&(l=s.x-a.x),s.y+e+h.y>u.y&&(c=s.y+e-u.y+h.y),s.y-c-a.y<0&&(c=s.y-a.y),(l||c)&&t.fire("autopanstart").panBy([l,c])}},_onCloseButtonClick:function(t){this._close(),Q(t)},_getAnchor:function(){return w(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});ge.mergeOptions({closePopupOnClick:!0}),ge.include({openPopup:function(t,i,e){return t instanceof sn||(t=new sn(e).setContent(t)),i&&t.setLatLng(i),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),je.include({bindPopup:function(t,i){return t instanceof sn?(l(t,i),this._popup=t,t._source=this):(this._popup&&!i||(this._popup=new sn(i,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,i){if(t instanceof je||(i=t,t=this),t instanceof He)for(var e in this._layers){t=this._layers[e];break}return i||(i=t.getCenter?t.getCenter():t.getLatLng()),this._popup&&this._map&&(this._popup._source=t,this._popup.update(),this._map.openPopup(this._popup,i)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var i=t.layer||t.target;if(this._popup&&this._map)return Q(t),i instanceof qe?void this.openPopup(t.layer||t.target,t.latlng):void(this._map.hasLayer(this._popup)&&this._popup._source===i?this.closePopup():this.openPopup(i,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var rn=on.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){on.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){on.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=on.prototype.getEvents.call(this);return ji&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=ht("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var i=this._map,e=this._container,n=i.latLngToContainerPoint(i.getCenter()),o=i.layerPointToContainerPoint(t),s=this.options.direction,r=e.offsetWidth,a=e.offsetHeight,h=w(this.options.offset),u=this._getAnchor();"top"===s?t=t.add(w(-r/2+h.x,-a+h.y+u.y,!0)):"bottom"===s?t=t.subtract(w(r/2-h.x,-h.y,!0)):"center"===s?t=t.subtract(w(r/2+h.x,a/2-u.y+h.y,!0)):"right"===s||"auto"===s&&o.x<n.x?(s="right",t=t.add(w(h.x+u.x,u.y-a/2+h.y,!0))):(s="left",t=t.subtract(w(r+u.x-h.x,a/2-u.y-h.y,!0))),mt(e,"leaflet-tooltip-right"),mt(e,"leaflet-tooltip-left"),mt(e,"leaflet-tooltip-top"),mt(e,"leaflet-tooltip-bottom"),pt(e,"leaflet-tooltip-"+s),Lt(e,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&vt(this._container,t)},_animateZoom:function(t){var i=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(i)},_getAnchor:function(){return w(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}});ge.include({openTooltip:function(t,i,e){return t instanceof rn||(t=new rn(e).setContent(t)),i&&t.setLatLng(i),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),je.include({bindTooltip:function(t,i){return t instanceof rn?(l(t,i),this._tooltip=t,t._source=this):(this._tooltip&&!i||(this._tooltip=new rn(i,this)),this._tooltip.setContent(t)),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var i=t?"off":"on",e={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?e.add=this._openTooltip:(e.mouseover=this._openTooltip,e.mouseout=this.closeTooltip,this._tooltip.options.sticky&&(e.mousemove=this._moveTooltip),ji&&(e.click=this._openTooltip)),this[i](e),this._tooltipHandlersAdded=!t}},openTooltip:function(t,i){if(t instanceof je||(i=t,t=this),t instanceof He)for(var e in this._layers){t=this._layers[e];break}return i||(i=t.getCenter?t.getCenter():t.getLatLng()),this._tooltip&&this._map&&(this._tooltip._source=t,this._tooltip.update(),this._map.openTooltip(this._tooltip,i),this._tooltip.options.interactive&&this._tooltip._container&&(pt(this._tooltip._container,"leaflet-clickable"),this.addInteractiveTarget(this._tooltip._container))),this},closeTooltip:function(){return this._tooltip&&(this._tooltip._close(),this._tooltip.options.interactive&&this._tooltip._container&&(mt(this._tooltip._container,"leaflet-clickable"),this.removeInteractiveTarget(this._tooltip._container))),this},toggleTooltip:function(t){return this._tooltip&&(this._tooltip._map?this.closeTooltip():this.openTooltip(t)),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){var i=t.layer||t.target;this._tooltip&&this._map&&this.openTooltip(i,this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var i,e,n=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(i=this._map.mouseEventToContainerPoint(t.originalEvent),e=this._map.containerPointToLayerPoint(i),n=this._map.layerPointToLatLng(e)),this._tooltip.setLatLng(n)}});var an=Fe.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var i=t&&"DIV"===t.tagName?t:document.createElement("div"),e=this.options;if(i.innerHTML=!1!==e.html?e.html:"",e.bgPos){var n=w(e.bgPos);i.style.backgroundPosition=-n.x+"px "+-n.y+"px"}return this._setIconStyles(i,"icon"),i},createShadow:function(){return null}});Fe.Default=Ue;var hn=je.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Ai,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){l(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView(),this._update()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ut(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=null},bringToFront:function(){return this._map&&(ct(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(_t(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=o(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof x?t:new x(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var i,e=this.getPane().children,n=-t(-1/0,1/0),o=0,s=e.length;o<s;o++)i=e[o].style.zIndex,e[o]!==this._container&&i&&(n=t(n,+i));isFinite(n)&&(this.options.zIndex=n+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!yi){vt(this._container,this.options.opacity);var t=+new Date,i=!1,e=!1;for(var n in this._tiles){var o=this._tiles[n];if(o.current&&o.loaded){var s=Math.min(1,(t-o.loaded)/200);vt(o.el,s),s<1?i=!0:(o.active?e=!0:this._onOpaqueTile(o),o.active=!0)}}e&&!this._noPrune&&this._pruneTiles(),i&&(g(this._fadeFrame),this._fadeFrame=f(this._updateOpacity,this))}},_onOpaqueTile:r,_initContainer:function(){this._container||(this._container=ht("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,i=this.options.maxZoom;if(void 0!==t){for(var e in this._levels)this._levels[e].el.children.length||e===t?(this._levels[e].el.style.zIndex=i-Math.abs(t-e),this._onUpdateLevel(e)):(ut(this._levels[e].el),this._removeTilesAtZoom(e),this._onRemoveLevel(e),delete this._levels[e]);var n=this._levels[t],o=this._map;return n||(n=this._levels[t]={},n.el=ht("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=i,n.origin=o.project(o.unproject(o.getPixelOrigin()),t).round(),n.zoom=t,this._setZoomTransform(n,o.getCenter(),o.getZoom()),n.el.offsetWidth,this._onCreateLevel(n)),this._level=n,n}},_onUpdateLevel:r,_onRemoveLevel:r,_onCreateLevel:r,_pruneTiles:function(){if(this._map){var t,i,e=this._map.getZoom();if(e>this.options.maxZoom||e<this.options.minZoom)return void this._removeAllTiles();for(t in this._tiles)(i=this._tiles[t]).retain=i.current;for(t in this._tiles)if((i=this._tiles[t]).current&&!i.active){var n=i.coords;this._retainParent(n.x,n.y,n.z,n.z-5)||this._retainChildren(n.x,n.y,n.z,n.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}},_removeTilesAtZoom:function(t){for(var i in this._tiles)this._tiles[i].coords.z===t&&this._removeTile(i)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)ut(this._levels[t].el),this._onRemoveLevel(t),delete this._levels[t];this._removeAllTiles(),this._tileZoom=null},_retainParent:function(t,i,e,n){var o=Math.floor(t/2),s=Math.floor(i/2),r=e-1,a=new x(+o,+s);a.z=+r;var h=this._tileCoordsToKey(a),u=this._tiles[h];return u&&u.active?(u.retain=!0,!0):(u&&u.loaded&&(u.retain=!0),r>n&&this._retainParent(o,s,r,n))},_retainChildren:function(t,i,e,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*i;s<2*i+2;s++){var r=new x(o,s);r.z=e+1;var a=this._tileCoordsToKey(r),h=this._tiles[a];h&&h.active?h.retain=!0:(h&&h.loaded&&(h.retain=!0),e+1<n&&this._retainChildren(o,s,e+1,n))}},_resetView:function(t){var i=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),i,i)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var i=this.options;return void 0!==i.minNativeZoom&&t<i.minNativeZoom?i.minNativeZoom:void 0!==i.maxNativeZoom&&i.maxNativeZoom<t?i.maxNativeZoom:t},_setView:function(t,i,e,n){var o=this._clampZoom(Math.round(i));(void 0!==this.options.maxZoom&&o>this.options.maxZoom||void 0!==this.options.minZoom&&o<this.options.minZoom)&&(o=void 0);var s=this.options.updateWhenZooming&&o!==this._tileZoom;n&&!s||(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==o&&this._update(t),e||this._pruneTiles(),this._noPrune=!!e),this._setZoomTransforms(t,i)},_setZoomTransforms:function(t,i){for(var e in this._levels)this._setZoomTransform(this._levels[e],t,i)},_setZoomTransform:function(t,i,e){var n=this._map.getZoomScale(e,t.zoom),o=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(i,e)).round();Ii?wt(t.el,o,n):Lt(t.el,o)},_resetGrid:function(){var t=this._map,i=t.options.crs,e=this._tileSize=this.getTileSize(),n=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=i.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,i.wrapLng[0]],n).x/e.x),Math.ceil(t.project([0,i.wrapLng[1]],n).x/e.y)],this._wrapY=i.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([i.wrapLat[0],0],n).y/e.x),Math.ceil(t.project([i.wrapLat[1],0],n).y/e.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var i=this._map,e=i._animatingZoom?Math.max(i._animateToZoom,i.getZoom()):i.getZoom(),n=i.getZoomScale(e,this._tileZoom),o=i.project(t,this._tileZoom).floor(),s=i.getSize().divideBy(2*n);return new b(o.subtract(s),o.add(s))},_update:function(t){var i=this._map;if(i){var e=this._clampZoom(i.getZoom());if(void 0===t&&(t=i.getCenter()),void 0!==this._tileZoom){var n=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(n),s=o.getCenter(),r=[],a=this.options.keepBuffer,h=new b(o.getBottomLeft().subtract([a,-a]),o.getTopRight().add([a,-a]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var u in this._tiles){var l=this._tiles[u].coords;l.z===this._tileZoom&&h.contains(new x(l.x,l.y))||(this._tiles[u].current=!1)}if(Math.abs(e-this._tileZoom)>1)return void this._setView(t,e);for(var c=o.min.y;c<=o.max.y;c++)for(var _=o.min.x;_<=o.max.x;_++){var d=new x(_,c);d.z=this._tileZoom,this._isValidTile(d)&&(this._tiles[this._tileCoordsToKey(d)]||r.push(d))}if(r.sort(function(t,i){return t.distanceTo(s)-i.distanceTo(s)}),0!==r.length){this._loading||(this._loading=!0,this.fire("loading"));var p=document.createDocumentFragment();for(_=0;_<r.length;_++)this._addTile(r[_],p);this._level.el.appendChild(p)}}}},_isValidTile:function(t){var i=this._map.options.crs;if(!i.infinite){var e=this._globalTileRange;if(!i.wrapLng&&(t.x<e.min.x||t.x>e.max.x)||!i.wrapLat&&(t.y<e.min.y||t.y>e.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return z(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToBounds:function(t){var i=this._map,e=this.getTileSize(),n=t.scaleBy(e),o=n.add(e),s=new T(i.unproject(n,t.z),i.unproject(o,t.z));return this.options.noWrap||i.wrapLatLngBounds(s),s},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var i=t.split(":"),e=new x(+i[0],+i[1]);return e.z=+i[2],e},_removeTile:function(t){var i=this._tiles[t];i&&(ut(i.el),delete this._tiles[t],this.fire("tileunload",{tile:i.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){pt(t,"leaflet-tile");var i=this.getTileSize();t.style.width=i.x+"px",t.style.height=i.y+"px",t.onselectstart=r,t.onmousemove=r,yi&&this.options.opacity<1&&vt(t,this.options.opacity),Li&&!bi&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,i){var n=this._getTilePos(t),o=this._tileCoordsToKey(t),s=this.createTile(this._wrapCoords(t),e(this._tileReady,this,t));this._initTile(s),this.createTile.length<2&&f(e(this._tileReady,this,t,null,s)),Lt(s,n),this._tiles[o]={el:s,coords:t,current:!0},i.appendChild(s),this.fire("tileloadstart",{tile:s,coords:t})},_tileReady:function(t,i,n){if(this._map){i&&this.fire("tileerror",{error:i,tile:n,coords:t});var o=this._tileCoordsToKey(t);(n=this._tiles[o])&&(n.loaded=+new Date,this._map._fadeAnimated?(vt(n.el,0),g(this._fadeFrame),this._fadeFrame=f(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),i||(pt(n.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:n.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),yi||!this._map._fadeAnimated?f(this._pruneTiles,this):setTimeout(e(this._pruneTiles,this),250)))}},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var i=new x(this._wrapX?s(t.x,this._wrapX):t.x,this._wrapY?s(t.y,this._wrapY):t.y);return i.z=t.z,i},_pxBoundsToTileRange:function(t){var i=this.getTileSize();return new b(t.min.unscaleBy(i).floor(),t.max.unscaleBy(i).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}}),un=hn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,i){this._url=t,(i=l(this,i)).detectRetina&&Fi&&i.maxZoom>0&&(i.tileSize=Math.floor(i.tileSize/2),i.zoomReverse?(i.zoomOffset--,i.minZoom++):(i.zoomOffset++,i.maxZoom--),i.minZoom=Math.max(0,i.minZoom)),"string"==typeof i.subdomains&&(i.subdomains=i.subdomains.split("")),Li||this.on("tileunload",this._onTileRemove)},setUrl:function(t,i){return this._url=t,i||this.redraw(),this},createTile:function(t,i){var n=document.createElement("img");return V(n,"load",e(this._tileOnLoad,this,i,n)),V(n,"error",e(this._tileOnError,this,i,n)),this.options.crossOrigin&&(n.crossOrigin=""),n.alt="",n.setAttribute("role","presentation"),n.src=this.getTileUrl(t),n},getTileUrl:function(t){var e={r:Fi?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var n=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=n),e["-y"]=n}return _(this._url,i(e,this.options))},_tileOnLoad:function(t,i){yi?setTimeout(e(t,this,null,i),0):t(null,i)},_tileOnError:function(t,i,e){var n=this.options.errorTileUrl;n&&i.src!==n&&(i.src=n),t(e,i)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,i=this.options.maxZoom,e=this.options.zoomReverse,n=this.options.zoomOffset;return e&&(t=i-t),t+n},_getSubdomain:function(t){var i=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[i]},_abortLoading:function(){var t,i;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&(i=this._tiles[t].el,i.onload=r,i.onerror=r,i.complete||(i.src=ii,ut(i)))}}),ln=un.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var n=i({},this.defaultWmsParams);for(var o in e)o in this.options||(n[o]=e[o]);e=l(this,e),n.width=n.height=e.tileSize*(e.detectRetina&&Fi?2:1),this.wmsParams=n},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var i=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[i]=this._crs.code,un.prototype.onAdd.call(this,t)},getTileUrl:function(t){var i=this._tileCoordsToBounds(t),e=this._crs.project(i.getNorthWest()),n=this._crs.project(i.getSouthEast()),o=(this._wmsVersion>=1.3&&this._crs===De?[n.y,e.x,e.y,n.x]:[e.x,n.y,n.x,e.y]).join(","),s=un.prototype.getTileUrl.call(this,t);return s+c(this.wmsParams,s,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+o},setParams:function(t,e){return i(this.wmsParams,t),e||this.redraw(),this}});un.WMS=ln,Kt.wms=function(t,i){return new ln(t,i)};var cn=je.extend({options:{padding:.1},initialize:function(t){l(this,t),n(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&pt(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,i){var e=this._map.getZoomScale(i,this._zoom),n=bt(this._container),o=this._map.getSize().multiplyBy(.5+this.options.padding),s=this._map.project(this._center,i),r=this._map.project(t,i).subtract(s),a=o.multiplyBy(-e).add(n).add(o).subtract(r);Ii?wt(this._container,a,e):Lt(this._container,a)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var t in this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,i=this._map.getSize(),e=this._map.containerPointToLayerPoint(i.multiplyBy(-t)).round();this._bounds=new b(e,e.add(i.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),_n=cn.extend({getEvents:function(){var t=cn.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){cn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");V(t,"mousemove",o(this._onMouseMove,32,this),this),V(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),V(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){delete this._ctx,ut(this._container),G(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){this._redrawBounds=null;for(var t in this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){this._drawnLayers={},cn.prototype._update.call(this);var t=this._bounds,i=this._container,e=t.getSize(),n=Fi?2:1;Lt(i,t.min),i.width=n*e.x,i.height=n*e.y,i.style.width=e.x+"px",i.style.height=e.y+"px",Fi&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){cn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[n(t)]=t;var i=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=i),this._drawLast=i,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var i=t._order,e=i.next,n=i.prev;e?e.prev=n:this._drawLast=n,n?n.next=e:this._drawFirst=e,delete t._order,delete this._layers[L.stamp(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if(t.options.dashArray){var i,e=t.options.dashArray.split(","),n=[];for(i=0;i<e.length;i++)n.push(Number(e[i]));t.options._dashArray=n}},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||f(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var i=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new b,this._redrawBounds.extend(t._pxBounds.min.subtract([i,i])),this._redrawBounds.extend(t._pxBounds.max.add([i,i]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var i=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,i.x,i.y)}else this._ctx.clearRect(0,0,this._container.width,this._container.height)},_draw:function(){var t,i=this._redrawBounds;if(this._ctx.save(),i){var e=i.getSize();this._ctx.beginPath(),this._ctx.rect(i.min.x,i.min.y,e.x,e.y),this._ctx.clip()}this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)t=n.layer,(!i||t._pxBounds&&t._pxBounds.intersects(i))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,i){if(this._drawing){var e,n,o,s,r=t._parts,a=r.length,h=this._ctx;if(a){for(this._drawnLayers[t._leaflet_id]=t,h.beginPath(),e=0;e<a;e++){for(n=0,o=r[e].length;n<o;n++)s=r[e][n],h[n?"lineTo":"moveTo"](s.x,s.y);i&&h.closePath()}this._fillStroke(h,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var i=t._point,e=this._ctx,n=t._radius,o=(t._radiusY||n)/n;this._drawnLayers[t._leaflet_id]=t,1!==o&&(e.save(),e.scale(1,o)),e.beginPath(),e.arc(i.x,i.y/o,n,0,2*Math.PI,!1),1!==o&&e.restore(),this._fillStroke(e,t)}},_fillStroke:function(t,i){var e=i.options;e.fill&&(t.globalAlpha=e.fillOpacity,t.fillStyle=e.fillColor||e.color,t.fill(e.fillRule||"evenodd")),e.stroke&&0!==e.weight&&(t.setLineDash&&t.setLineDash(i.options&&i.options._dashArray||[]),t.globalAlpha=e.opacity,t.lineWidth=e.weight,t.strokeStyle=e.color,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.stroke())},_onClick:function(t){for(var i,e,n=this._map.mouseEventToLayerPoint(t),o=this._drawFirst;o;o=o.next)(i=o.layer).options.interactive&&i._containsPoint(n)&&!this._map._draggableMoved(i)&&(e=i);e&&(et(t),this._fireEvent([e],t))},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var i=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,i)}},_handleMouseOut:function(t){var i=this._hoveredLayer;i&&(mt(this._container,"leaflet-interactive"),this._fireEvent([i],t,"mouseout"),this._hoveredLayer=null)},_handleMouseHover:function(t,i){for(var e,n,o=this._drawFirst;o;o=o.next)(e=o.layer).options.interactive&&e._containsPoint(i)&&(n=e);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(pt(this._container,"leaflet-interactive"),this._fireEvent([n],t,"mouseover"),this._hoveredLayer=n)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t)},_fireEvent:function(t,i,e){this._map._fireDOMEvent(i,e||i.type,t)},_bringToFront:function(t){var i=t._order,e=i.next,n=i.prev;e&&(e.prev=n,n?n.next=e:e&&(this._drawFirst=e),i.prev=this._drawLast,this._drawLast.next=i,i.next=null,this._drawLast=i,this._requestRedraw(t))},_bringToBack:function(t){var i=t._order,e=i.next,n=i.prev;n&&(n.next=e,e?e.prev=n:n&&(this._drawLast=n),i.prev=null,i.next=this._drawFirst,this._drawFirst.prev=i,this._drawFirst=i,this._requestRedraw(t))}}),dn=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),pn={_initContainer:function(){this._container=ht("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(cn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var i=t._container=dn("shape");pt(i,"leaflet-vml-shape "+(this.options.className||"")),i.coordsize="1 1",t._path=dn("path"),i.appendChild(t._path),this._updateStyle(t),this._layers[n(t)]=t},_addPath:function(t){var i=t._container;this._container.appendChild(i),t.options.interactive&&t.addInteractiveTarget(i)},_removePath:function(t){var i=t._container;ut(i),t.removeInteractiveTarget(i),delete this._layers[n(t)]},_updateStyle:function(t){var i=t._stroke,e=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(i||(i=t._stroke=dn("stroke")),o.appendChild(i),i.weight=n.weight+"px",i.color=n.color,i.opacity=n.opacity,n.dashArray?i.dashStyle=ti(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):i.dashStyle="",i.endcap=n.lineCap.replace("butt","flat"),i.joinstyle=n.lineJoin):i&&(o.removeChild(i),t._stroke=null),n.fill?(e||(e=t._fill=dn("fill")),o.appendChild(e),e.color=n.fillColor||n.color,e.opacity=n.fillOpacity):e&&(o.removeChild(e),t._fill=null)},_updateCircle:function(t){var i=t._point.round(),e=Math.round(t._radius),n=Math.round(t._radiusY||e);this._setPath(t,t._empty()?"M0 0":"AL "+i.x+","+i.y+" "+e+","+n+" 0,23592600")},_setPath:function(t,i){t._path.v=i},_bringToFront:function(t){ct(t._container)},_bringToBack:function(t){_t(t._container)}},mn=Gi?dn:E,fn=cn.extend({getEvents:function(){var t=cn.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=mn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=mn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ut(this._container),G(this._container),delete this._container,delete this._rootGroup},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){cn.prototype._update.call(this);var t=this._bounds,i=t.getSize(),e=this._container;this._svgSize&&this._svgSize.equals(i)||(this._svgSize=i,e.setAttribute("width",i.x),e.setAttribute("height",i.y)),Lt(e,t.min),e.setAttribute("viewBox",[t.min.x,t.min.y,i.x,i.y].join(" ")),this.fire("update")}},_initPath:function(t){var i=t._path=mn("path");t.options.className&&pt(i,t.options.className),t.options.interactive&&pt(i,"leaflet-interactive"),this._updateStyle(t),this._layers[n(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ut(t._path),t.removeInteractiveTarget(t._path),delete this._layers[n(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var i=t._path,e=t.options;i&&(e.stroke?(i.setAttribute("stroke",e.color),i.setAttribute("stroke-opacity",e.opacity),i.setAttribute("stroke-width",e.weight),i.setAttribute("stroke-linecap",e.lineCap),i.setAttribute("stroke-linejoin",e.lineJoin),e.dashArray?i.setAttribute("stroke-dasharray",e.dashArray):i.removeAttribute("stroke-dasharray"),e.dashOffset?i.setAttribute("stroke-dashoffset",e.dashOffset):i.removeAttribute("stroke-dashoffset")):i.setAttribute("stroke","none"),e.fill?(i.setAttribute("fill",e.fillColor||e.color),i.setAttribute("fill-opacity",e.fillOpacity),i.setAttribute("fill-rule",e.fillRule||"evenodd")):i.setAttribute("fill","none"))},_updatePoly:function(t,i){this._setPath(t,k(t._parts,i))},_updateCircle:function(t){var i=t._point,e=t._radius,n="a"+e+","+(t._radiusY||e)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(i.x-e)+","+i.y+n+2*e+",0 "+n+2*-e+",0 ";this._setPath(t,o)},_setPath:function(t,i){t._path.setAttribute("d",i)},_bringToFront:function(t){ct(t._path)},_bringToBack:function(t){_t(t._path)}});Gi&&fn.include(pn),ge.include({getRenderer:function(t){var i=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return i||(i=this._renderer=this.options.preferCanvas&&Yt()||Xt()),this.hasLayer(i)||this.addLayer(i),i},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var i=this._paneRenderers[t];return void 0===i&&(i=fn&&Xt({pane:t})||_n&&Yt({pane:t}),this._paneRenderers[t]=i),i}});var gn=Je.extend({initialize:function(t,i){Je.prototype.initialize.call(this,this._boundsToLatLngs(t),i)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=z(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});fn.create=mn,fn.pointsToPath=k,$e.geometryToLayer=jt,$e.coordsToLatLng=Wt,$e.coordsToLatLngs=Ht,$e.latLngToCoords=Ft,$e.latLngsToCoords=Ut,$e.getFeature=Vt,$e.asFeature=Gt,ge.mergeOptions({boxZoom:!0});var vn=Te.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){V(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){G(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ut(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){return!(!t.shiftKey||1!==t.which&&1!==t.button)&&(this._clearDeferredResetState(),this._resetState(),_i(),Pt(),this._startPoint=this._map.mouseEventToContainerPoint(t),void V(document,{contextmenu:Q,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this))},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=ht("div","leaflet-zoom-box",this._container),pt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var i=new b(this._point,this._startPoint),e=i.getSize();Lt(this._box,i.min),this._box.style.width=e.x+"px",this._box.style.height=e.y+"px"},_finish:function(){this._moved&&(ut(this._box),mt(this._container,"leaflet-crosshair")),di(),Tt(),G(document,{contextmenu:Q,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(e(this._resetState,this),0);var i=new T(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(i).fire("boxzoomend",{boxZoomBounds:i})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});ge.addInitHook("addHandler","boxZoom",vn),ge.mergeOptions({doubleClickZoom:!0});var yn=Te.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var i=this._map,e=i.getZoom(),n=i.options.zoomDelta,o=t.originalEvent.shiftKey?e-n:e+n;"center"===i.options.doubleClickZoom?i.setZoom(o):i.setZoomAround(t.containerPoint,o)}});ge.addInitHook("addHandler","doubleClickZoom",yn),ge.mergeOptions({dragging:!0,inertia:!bi,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var xn=Te.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new Ee(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}pt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){mt(this._map._container,"leaflet-grab"),mt(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var i=z(this._map.options.maxBounds);this._offsetLimit=P(this._map.latLngToContainerPoint(i.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(i.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var i=this._lastTime=+new Date,e=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(e),this._times.push(i),i-this._times[0]>50&&(this._positions.shift(),this._times.shift())}this._map.fire("move",t).fire("drag",t)},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),i=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=i.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,i){return t-(t-i)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),i=this._offsetLimit;t.x<i.min.x&&(t.x=this._viscousLimit(t.x,i.min.x)),t.y<i.min.y&&(t.y=this._viscousLimit(t.y,i.min.y)),t.x>i.max.x&&(t.x=this._viscousLimit(t.x,i.max.x)),t.y>i.max.y&&(t.y=this._viscousLimit(t.y,i.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,i=Math.round(t/2),e=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-i+e)%t+i-e,s=(n+i+e)%t-i-e,r=Math.abs(o+e)<Math.abs(s+e)?o:s;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=r},_onDragEnd:function(t){var i=this._map,e=i.options,n=!e.inertia||this._times.length<2;if(i.fire("dragend",t),n)i.fire("moveend");else{var o=this._lastPos.subtract(this._positions[0]),s=(this._lastTime-this._times[0])/1e3,r=e.easeLinearity,a=o.multiplyBy(r/s),h=a.distanceTo([0,0]),u=Math.min(e.inertiaMaxSpeed,h),l=a.multiplyBy(u/h),c=u/(e.inertiaDeceleration*r),_=l.multiplyBy(-c/2).round();_.x||_.y?(_=i._limitOffset(_,i.options.maxBounds),f(function(){i.panBy(_,{duration:c,easeLinearity:r,noMoveStart:!0,animate:!0})})):i.fire("moveend")}}});ge.addInitHook("addHandler","dragging",xn),ge.mergeOptions({keyboard:!0,keyboardPanDelta:80});var wn=Te.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),V(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),G(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,i=document.documentElement,e=t.scrollTop||i.scrollTop,n=t.scrollLeft||i.scrollLeft;this._map._container.focus(),window.scrollTo(n,e)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var i,e,n=this._panKeys={},o=this.keyCodes;for(i=0,e=o.left.length;i<e;i++)n[o.left[i]]=[-1*t,0];for(i=0,e=o.right.length;i<e;i++)n[o.right[i]]=[t,0];for(i=0,e=o.down.length;i<e;i++)n[o.down[i]]=[0,t];for(i=0,e=o.up.length;i<e;i++)n[o.up[i]]=[0,-1*t]},_setZoomDelta:function(t){var i,e,n=this._zoomKeys={},o=this.keyCodes;for(i=0,e=o.zoomIn.length;i<e;i++)n[o.zoomIn[i]]=t;for(i=0,e=o.zoomOut.length;i<e;i++)n[o.zoomOut[i]]=-t},_addHooks:function(){V(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){G(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var i,e=t.keyCode,n=this._map;if(e in this._panKeys){if(n._panAnim&&n._panAnim._inProgress)return;i=this._panKeys[e],t.shiftKey&&(i=w(i).multiplyBy(3)),n.panBy(i),n.options.maxBounds&&n.panInsideBounds(n.options.maxBounds)}else if(e in this._zoomKeys)n.setZoom(n.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[e]);else{if(27!==e||!n._popup)return;n.closePopup()}Q(t)}}});ge.addInitHook("addHandler","keyboard",wn),ge.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var Ln=Te.extend({addHooks:function(){V(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){G(this._map._container,"mousewheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var i=it(t),n=this._map.options.wheelDebounceTime;this._delta+=i,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var o=Math.max(n-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(e(this._performZoom,this),o),Q(t)},_performZoom:function(){var t=this._map,i=t.getZoom(),e=this._map.options.zoomSnap||0;t._stop();var n=this._delta/(4*this._map.options.wheelPxPerZoomLevel),o=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,s=e?Math.ceil(o/e)*e:o,r=t._limitZoom(i+(this._delta>0?s:-s))-i;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(i+r):t.setZoomAround(this._lastMousePos,i+r))}});ge.addInitHook("addHandler","scrollWheelZoom",Ln),ge.mergeOptions({tap:!0,tapTolerance:15});var bn=Te.extend({addHooks:function(){V(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){G(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if($(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var i=t.touches[0],n=i.target;this._startPos=this._newPos=new x(i.clientX,i.clientY),n.tagName&&"a"===n.tagName.toLowerCase()&&pt(n,"leaflet-active"),this._holdTimeout=setTimeout(e(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",i))},this),1e3),this._simulateEvent("mousedown",i),V(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),G(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var i=t.changedTouches[0],e=i.target;e&&e.tagName&&"a"===e.tagName.toLowerCase()&&mt(e,"leaflet-active"),this._simulateEvent("mouseup",i),this._isTapValid()&&this._simulateEvent("click",i)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var i=t.touches[0];this._newPos=new x(i.clientX,i.clientY),this._simulateEvent("mousemove",i)},_simulateEvent:function(t,i){var e=document.createEvent("MouseEvents");e._simulated=!0,i.target._simulatedClick=!0,e.initMouseEvent(t,!0,!0,window,1,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),i.target.dispatchEvent(e)}});ji&&!Ni&&ge.addInitHook("addHandler","tap",bn),ge.mergeOptions({touchZoom:ji&&!bi,bounceAtZoomLimits:!0});var Pn=Te.extend({addHooks:function(){pt(this._map._container,"leaflet-touch-zoom"),V(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){mt(this._map._container,"leaflet-touch-zoom"),G(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var i=this._map;if(t.touches&&2===t.touches.length&&!i._animatingZoom&&!this._zooming){var e=i.mouseEventToContainerPoint(t.touches[0]),n=i.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=i.getSize()._divideBy(2),this._startLatLng=i.containerPointToLatLng(this._centerPoint),"center"!==i.options.touchZoom&&(this._pinchStartLatLng=i.containerPointToLatLng(e.add(n)._divideBy(2))),this._startDist=e.distanceTo(n),this._startZoom=i.getZoom(),this._moved=!1,this._zooming=!0,i._stop(),V(document,"touchmove",this._onTouchMove,this),V(document,"touchend",this._onTouchEnd,this),$(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var i=this._map,n=i.mouseEventToContainerPoint(t.touches[0]),o=i.mouseEventToContainerPoint(t.touches[1]),s=n.distanceTo(o)/this._startDist;if(this._zoom=i.getScaleZoom(s,this._startZoom),!i.options.bounceAtZoomLimits&&(this._zoom<i.getMinZoom()&&s<1||this._zoom>i.getMaxZoom()&&s>1)&&(this._zoom=i._limitZoom(this._zoom)),"center"===i.options.touchZoom){if(this._center=this._startLatLng,1===s)return}else{var r=n._add(o)._divideBy(2)._subtract(this._centerPoint);if(1===s&&0===r.x&&0===r.y)return;this._center=i.unproject(i.project(this._pinchStartLatLng,this._zoom).subtract(r),this._zoom)}this._moved||(i._moveStart(!0),this._moved=!0),g(this._animRequest);var a=e(i._move,i,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=f(a,this,!0),$(t)}},_onTouchEnd:function(){return this._moved&&this._zooming?(this._zooming=!1,g(this._animRequest),G(document,"touchmove",this._onTouchMove),G(document,"touchend",this._onTouchEnd),void(this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom)))):void(this._zooming=!1)}});ge.addInitHook("addHandler","touchZoom",Pn),ge.BoxZoom=vn,ge.DoubleClickZoom=yn,ge.Drag=xn,ge.Keyboard=wn,ge.ScrollWheelZoom=Ln,ge.Tap=bn,ge.TouchZoom=Pn;var Tn=window.L;window.L=t,t.version="1.1.0",t.noConflict=function(){return window.L=Tn,this},t.Control=ve,t.control=ye,t.Browser=qi,t.Evented=ai,t.Mixin=ze,t.Util=si,t.Class=v,t.Handler=Te,t.extend=i,t.bind=e,t.stamp=n,t.setOptions=l,t.DomEvent=he,t.DomUtil=me,t.PosAnimation=fe,t.Draggable=Ee,t.LineUtil=ke,t.PolyUtil=Be,t.Point=x,t.point=w,t.Bounds=b,t.bounds=P,t.Transformation=Z,t.transformation=S,t.Projection=Oe,t.LatLng=M,t.latLng=C,t.LatLngBounds=T,t.latLngBounds=z,t.CRS=hi,t.GeoJSON=$e,t.geoJSON=qt,t.geoJson=tn,t.Layer=je,t.LayerGroup=We,t.layerGroup=function(t){return new We(t)},t.FeatureGroup=He,t.featureGroup=function(t){return new He(t)},t.ImageOverlay=en,t.imageOverlay=function(t,i,e){return new en(t,i,e)},t.VideoOverlay=nn,t.videoOverlay=function(t,i,e){return new nn(t,i,e)},t.DivOverlay=on,t.Popup=sn,t.popup=function(t,i){return new sn(t,i)},t.Tooltip=rn,t.tooltip=function(t,i){return new rn(t,i)},t.Icon=Fe,t.icon=function(t){return new Fe(t)},t.DivIcon=an,t.divIcon=function(t){return new an(t)},t.Marker=Ge,t.marker=function(t,i){return new Ge(t,i)},t.TileLayer=un,t.tileLayer=Kt,t.GridLayer=hn,t.gridLayer=function(t){return new hn(t)},t.SVG=fn,t.svg=Xt,t.Renderer=cn,t.Canvas=_n,t.canvas=Yt,t.Path=qe,t.CircleMarker=Ke,t.circleMarker=function(t,i){return new Ke(t,i)},t.Circle=Ye,t.circle=function(t,i,e){return new Ye(t,i,e)},t.Polyline=Xe,t.polyline=function(t,i){return new Xe(t,i)},t.Polygon=Je,t.polygon=function(t,i){return new Je(t,i)},t.Rectangle=gn,t.rectangle=function(t,i){return new gn(t,i)},t.Map=ge,t.map=function(t,i){return new ge(t,i)}});</script><dom-module id="ha-entity-marker"><template><style is="custom-style" include="iron-positioning"></style><style>.marker{vertical-align:top;position:relative;display:block;margin:0 auto;width:2.5em;text-align:center;height:2.5em;line-height:2.5em;font-size:1.5em;border-radius:50%;border:0.1em solid var(--ha-marker-color, --default-primary-color);color:rgb(76, 76, 76);background-color:white;}iron-image{border-radius:50%;}</style><div class="marker"><template is="dom-if" if="[[entityName]]">[[entityName]]</template><template is="dom-if" if="[[entityPicture]]"><iron-image sizing="cover" class="fit" src="[[entityPicture]]"></iron-image></template></div></template></dom-module><script>Polymer({is:"ha-entity-marker",hostAttributes:{entityId:null,entityName:null,entityPicture:null},properties:{hass:{type:Object},entityId:{type:String,value:""},entityName:{type:String,value:null},entityPicture:{type:String,value:null}},listeners:{tap:"badgeTap"},badgeTap:function(t){t.stopPropagation(),this.entityId&&this.fire("hass-more-info",{entityId:this.entityId})}});</script></div><dom-module id="ha-panel-map"><template><link rel="stylesheet" href="/static/images/leaflet/leaflet.css"><style include="ha-style">#map{height:calc(100% - 64px);width:100%;z-index:0;}</style><app-toolbar><ha-menu-button narrow="[[narrow]]" show-menu="[[showMenu]]"></ha-menu-button><div main-title="">Map</div></app-toolbar><div id="map"></div></template></dom-module><script>window.L.Icon.Default.imagePath="/static/images/leaflet",Polymer({is:"ha-panel-map",properties:{hass:{type:Object,observer:"drawEntities"},narrow:{type:Boolean},showMenu:{type:Boolean,value:!1}},attached:function(){var t=this._map=window.L.map(this.$.map);t.setView([51.505,-.09],13),window.L.tileLayer("https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="https://cartodb.com/attributions">CartoDB</a>',maxZoom:18}).addTo(t),this.drawEntities(this.hass),this.async(function(){t.invalidateSize(),this.fitMap()}.bind(this),1)},fitMap:function(){var t;0===this._mapItems.length?this._map.setView(new window.L.LatLng(this.hass.config.core.latitude,this.hass.config.core.longitude),14):(t=new window.L.latLngBounds(this._mapItems.map(function(t){return t.getLatLng()})),this._map.fitBounds(t.pad(.5)))},drawEntities:function(t){var i=this._map;if(i){this._mapItems&&this._mapItems.forEach(function(t){t.remove()});var a=this._mapItems=[];Object.keys(t.states).forEach(function(e){var s=t.states[e],n=window.hassUtil.computeStateName(s);if(!(s.attributes.hidden&&"zone"!==window.hassUtil.computeDomain(s)||"home"===s.state)&&"latitude"in s.attributes&&"longitude"in s.attributes){var o;if("zone"===window.hassUtil.computeDomain(s)){if(s.attributes.passive)return;var r="";return r=s.attributes.icon?"<iron-icon icon='"+s.attributes.icon+"'></iron-icon>":n,o=window.L.divIcon({html:r,iconSize:[24,24],className:""}),a.push(window.L.marker([s.attributes.latitude,s.attributes.longitude],{icon:o,interactive:!1,title:n}).addTo(i)),void a.push(window.L.circle([s.attributes.latitude,s.attributes.longitude],{interactive:!1,color:"#FF9800",radius:s.attributes.radius}).addTo(i))}var u=s.attributes.entity_picture||"",c=n.split(" ").map(function(t){return t.substr(0,1)}).join("");o=window.L.divIcon({html:"<ha-entity-marker entity-id='"+s.entity_id+"' entity-name='"+c+"' entity-picture='"+u+"'></ha-entity-marker>",iconSize:[45,45],className:""}),a.push(window.L.marker([s.attributes.latitude,s.attributes.longitude],{icon:o,title:window.hassUtil.computeStateName(s)}).addTo(i)),s.attributes.gps_accuracy&&a.push(window.L.circle([s.attributes.latitude,s.attributes.longitude],{interactive:!1,color:"#0288D1",radius:s.attributes.gps_accuracy}).addTo(i))}})}}});</script></body></html>
\ No newline at end of file
diff --git a/homeassistant/components/frontend/www_static/panels/ha-panel-map.html.gz b/homeassistant/components/frontend/www_static/panels/ha-panel-map.html.gz
index fe209e3015c80b5103327fd9820a723d659950a3..801450f1bd8d95079910db89eeaac7099433f571 100644
Binary files a/homeassistant/components/frontend/www_static/panels/ha-panel-map.html.gz and b/homeassistant/components/frontend/www_static/panels/ha-panel-map.html.gz differ
diff --git a/homeassistant/components/frontend/www_static/service_worker.js b/homeassistant/components/frontend/www_static/service_worker.js
index 0be4be44cc099877c9c2fdfa878fa308fe3208c4..e033471390ebd7415eb8f2a15e5a37db694c938d 100644
--- a/homeassistant/components/frontend/www_static/service_worker.js
+++ b/homeassistant/components/frontend/www_static/service_worker.js
@@ -37,7 +37,7 @@
 /* eslint-disable indent, no-unused-vars, no-multiple-empty-lines, max-nested-callbacks, space-before-function-paren, quotes, comma-spacing */
 'use strict';
 
-var precacheConfig = [["/","ca5e387a1783ea4d555830f249c72170"],["/Users/paulus/dev/python/home-assistant/homeassistant/components/frontend/www_static/fonts/roboto/Roboto-Bold.ttf","d329cc8b34667f114a95422aaad1b063"],["/Users/paulus/dev/python/home-assistant/homeassistant/components/frontend/www_static/fonts/roboto/Roboto-Light.ttf","7b5fb88f12bec8143f00e21bc3222124"],["/Users/paulus/dev/python/home-assistant/homeassistant/components/frontend/www_static/fonts/roboto/Roboto-Medium.ttf","fe13e4170719c2fc586501e777bde143"],["/Users/paulus/dev/python/home-assistant/homeassistant/components/frontend/www_static/fonts/roboto/Roboto-Regular.ttf","ac3f799d5bbaf5196fab15ab8de8431c"],["/Users/paulus/dev/python/home-assistant/homeassistant/components/frontend/www_static/icons/favicon-192x192.png","419903b8422586a7e28021bbe9011175"],["/Users/paulus/dev/python/home-assistant/homeassistant/components/frontend/www_static/icons/favicon.ico","04235bda7843ec2fceb1cbe2bc696cf4"],["/Users/paulus/dev/python/home-assistant/homeassistant/components/frontend/www_static/images/card_media_player_bg.png","a34281d1c1835d338a642e90930e61aa"],["/Users/paulus/dev/python/home-assistant/homeassistant/components/frontend/www_static/webcomponents-lite.min.js","32b5a9b7ada86304bec6b43d3f2194f0"],["/frontend/panels/dev-event-d409e7ab537d9fe629126d122345279c.html","936814991f2a5e23d61d29f0d40f81b8"],["/frontend/panels/dev-info-b0e55eb657fd75f21aba2426ac0cedc0.html","1fa953b0224470f70d4e87bbe4dff191"],["/frontend/panels/dev-mqtt-94b222b013a98583842de3e72d5888c6.html","dc3ddfac58397feda97317358f0aecbb"],["/frontend/panels/dev-service-a260b4ef948bbac503451f139c7f9e98.html","8e58373af8308b8ab3bf26da6ff44fd8"],["/frontend/panels/dev-state-7948d3dba058f31517d880df8ed0e857.html","ff8156bb1a52490fcc07466556fce0e1"],["/frontend/panels/dev-template-f47b6910d8e4880e22cc508ca452f9b6.html","9aa0675e01373c6bc2737438bb84a9ec"],["/frontend/panels/map-354bea2f785aa01fa9ffe4766c2ede87.html","a1983ec19c1d24c41b11e6a9121a8695"],["/static/compatibility-1686167ff210e001f063f5c606b2e74b.js","6ee7b5e2dd82b510c3bd92f7e215988e"],["/static/core-2a7d01e45187c7d4635da05065b5e54e.js","90a0a8a6a6dd0ca41b16f40e7d23924d"],["/static/frontend-e4dcb1409ba0a62be183a7f0a057b7c0.html","e4d95364e54e163deac79ec400fab944"],["/static/mdi-e91f61a039ed0a9936e7ee5360da3870.html","5e587bc82719b740a4f0798722a83aee"]];
+var precacheConfig = [["/","91486fe0099ad4d5d5a9b11cfdf70b7b"],["/Users/paulus/dev/python/home-assistant/homeassistant/components/frontend/www_static/fonts/roboto/Roboto-Bold.ttf","d329cc8b34667f114a95422aaad1b063"],["/Users/paulus/dev/python/home-assistant/homeassistant/components/frontend/www_static/fonts/roboto/Roboto-Light.ttf","7b5fb88f12bec8143f00e21bc3222124"],["/Users/paulus/dev/python/home-assistant/homeassistant/components/frontend/www_static/fonts/roboto/Roboto-Medium.ttf","fe13e4170719c2fc586501e777bde143"],["/Users/paulus/dev/python/home-assistant/homeassistant/components/frontend/www_static/fonts/roboto/Roboto-Regular.ttf","ac3f799d5bbaf5196fab15ab8de8431c"],["/Users/paulus/dev/python/home-assistant/homeassistant/components/frontend/www_static/icons/favicon-192x192.png","419903b8422586a7e28021bbe9011175"],["/Users/paulus/dev/python/home-assistant/homeassistant/components/frontend/www_static/icons/favicon.ico","04235bda7843ec2fceb1cbe2bc696cf4"],["/Users/paulus/dev/python/home-assistant/homeassistant/components/frontend/www_static/images/card_media_player_bg.png","a34281d1c1835d338a642e90930e61aa"],["/frontend/panels/dev-event-d409e7ab537d9fe629126d122345279c.html","936814991f2a5e23d61d29f0d40f81b8"],["/frontend/panels/dev-info-b0e55eb657fd75f21aba2426ac0cedc0.html","1fa953b0224470f70d4e87bbe4dff191"],["/frontend/panels/dev-mqtt-94b222b013a98583842de3e72d5888c6.html","dc3ddfac58397feda97317358f0aecbb"],["/frontend/panels/dev-service-61b164e0c0964782a539cba7008bb716.html","86e4a07af018a9e020e3ab822c924a44"],["/frontend/panels/dev-state-7948d3dba058f31517d880df8ed0e857.html","ff8156bb1a52490fcc07466556fce0e1"],["/frontend/panels/dev-template-f47b6910d8e4880e22cc508ca452f9b6.html","9aa0675e01373c6bc2737438bb84a9ec"],["/frontend/panels/map-c2544fff3eedb487d44105cf94b335ec.html","113c5bf9a68a74c62e50cd354034e78b"],["/static/compatibility-1686167ff210e001f063f5c606b2e74b.js","6ee7b5e2dd82b510c3bd92f7e215988e"],["/static/core-2a7d01e45187c7d4635da05065b5e54e.js","90a0a8a6a6dd0ca41b16f40e7d23924d"],["/static/frontend-da3a65fd69361319864767a3ce0b4b9d.html","18b3bebc403a3b2a686c3d6f3482b1f6"],["/static/mdi-e91f61a039ed0a9936e7ee5360da3870.html","5e587bc82719b740a4f0798722a83aee"]];
 var cacheName = 'sw-precache-v3--' + (self.registration ? self.registration.scope : '');
 
 
diff --git a/homeassistant/components/frontend/www_static/service_worker.js.gz b/homeassistant/components/frontend/www_static/service_worker.js.gz
index 05cf45162f1eea496d2acf74f291ba79f9d19b32..27397d1f46c07143c8f9e4f1f9c67066b1cc9780 100644
Binary files a/homeassistant/components/frontend/www_static/service_worker.js.gz and b/homeassistant/components/frontend/www_static/service_worker.js.gz differ
diff --git a/homeassistant/components/frontend/www_static/webcomponents-lite.js b/homeassistant/components/frontend/www_static/webcomponents-lite.js
new file mode 100644
index 0000000000000000000000000000000000000000..7f2e16c7c2920f508916b4ebc2daf3abcd1a4bc6
--- /dev/null
+++ b/homeassistant/components/frontend/www_static/webcomponents-lite.js
@@ -0,0 +1,191 @@
+(function(){/*
+
+ Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
+ This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+ The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
+ Code distributed by Google as part of the polymer project is also
+ subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
+
+ Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
+ This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+ The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
+ Code distributed by Google as part of the polymer project is also
+ subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
+
+Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
+This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
+Code distributed by Google as part of the polymer project is also
+subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
+
+Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
+This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
+Code distributed by Google as part of the polymer project is also
+subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
+*/
+'use strict';var nb="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this;
+(function(){function k(){var a=this;this.s={};this.g=document.documentElement;var b=new za;b.rules=[];this.h=t.set(this.g,new t(b));this.i=!1;this.b=this.a=null;ob(function(){a.c()})}function H(){this.customStyles=[];this.enqueued=!1}function pb(){}function ha(a){this.cache={};this.c=void 0===a?100:a}function p(){}function t(a,b,c,d,e){this.G=a||null;this.b=b||null;this.sa=c||[];this.P=null;this.Y=e||"";this.a=this.B=this.K=null}function r(){}function za(){this.end=this.start=0;this.rules=this.parent=
+this.previous=null;this.cssText=this.parsedCssText="";this.atRule=!1;this.type=0;this.parsedSelector=this.selector=this.keyframesName=""}function $c(a){function b(b,c){Object.defineProperty(b,"innerHTML",{enumerable:c.enumerable,configurable:!0,get:c.get,set:function(b){var d=this,e=void 0;m(this)&&(e=[],J(this,function(a){a!==d&&e.push(a)}));c.set.call(this,b);if(e)for(var f=0;f<e.length;f++){var g=e[f];1===g.__CE_state&&a.disconnectedCallback(g)}this.ownerDocument.__CE_hasRegistry?a.c(this):a.j(this);
+return b}})}function c(b,c){u(b,"insertAdjacentElement",function(b,d){var e=m(d);b=c.call(this,b,d);e&&a.a(d);m(b)&&a.b(d);return b})}qb?u(Element.prototype,"attachShadow",function(a){return this.__CE_shadowRoot=a=qb.call(this,a)}):console.warn("Custom Elements: `Element#attachShadow` was not patched.");if(Aa&&Aa.get)b(Element.prototype,Aa);else if(Ba&&Ba.get)b(HTMLElement.prototype,Ba);else{var d=Ca.call(document,"div");a.u(function(a){b(a,{enumerable:!0,configurable:!0,get:function(){return rb.call(this,
+!0).innerHTML},set:function(a){var b="template"===this.localName?this.content:this;for(d.innerHTML=a;0<b.childNodes.length;)Da.call(b,b.childNodes[0]);for(;0<d.childNodes.length;)ja.call(b,d.childNodes[0])}})})}u(Element.prototype,"setAttribute",function(b,c){if(1!==this.__CE_state)return sb.call(this,b,c);var d=Ea.call(this,b);sb.call(this,b,c);c=Ea.call(this,b);a.attributeChangedCallback(this,b,d,c,null)});u(Element.prototype,"setAttributeNS",function(b,c,d){if(1!==this.__CE_state)return tb.call(this,
+b,c,d);var e=ka.call(this,b,c);tb.call(this,b,c,d);d=ka.call(this,b,c);a.attributeChangedCallback(this,c,e,d,b)});u(Element.prototype,"removeAttribute",function(b){if(1!==this.__CE_state)return ub.call(this,b);var c=Ea.call(this,b);ub.call(this,b);null!==c&&a.attributeChangedCallback(this,b,c,null,null)});u(Element.prototype,"removeAttributeNS",function(b,c){if(1!==this.__CE_state)return vb.call(this,b,c);var d=ka.call(this,b,c);vb.call(this,b,c);var e=ka.call(this,b,c);d!==e&&a.attributeChangedCallback(this,
+c,d,e,b)});wb?c(HTMLElement.prototype,wb):xb?c(Element.prototype,xb):console.warn("Custom Elements: `Element#insertAdjacentElement` was not patched.");yb(a,Element.prototype,{La:ad,append:bd});cd(a,{kb:dd,jb:ed,ub:fd,remove:gd})}function cd(a,b){var c=Element.prototype;c.before=function(c){for(var d=[],f=0;f<arguments.length;++f)d[f-0]=arguments[f];f=d.filter(function(a){return a instanceof Node&&m(a)});b.kb.apply(this,d);for(var g=0;g<f.length;g++)a.a(f[g]);if(m(this))for(f=0;f<d.length;f++)g=d[f],
+g instanceof Element&&a.b(g)};c.after=function(c){for(var d=[],f=0;f<arguments.length;++f)d[f-0]=arguments[f];f=d.filter(function(a){return a instanceof Node&&m(a)});b.jb.apply(this,d);for(var g=0;g<f.length;g++)a.a(f[g]);if(m(this))for(f=0;f<d.length;f++)g=d[f],g instanceof Element&&a.b(g)};c.replaceWith=function(c){for(var d=[],f=0;f<arguments.length;++f)d[f-0]=arguments[f];f=d.filter(function(a){return a instanceof Node&&m(a)});var g=m(this);b.ub.apply(this,d);for(var h=0;h<f.length;h++)a.a(f[h]);
+if(g)for(a.a(this),f=0;f<d.length;f++)g=d[f],g instanceof Element&&a.b(g)};c.remove=function(){var c=m(this);b.remove.call(this);c&&a.a(this)}}function hd(a){function b(b,d){Object.defineProperty(b,"textContent",{enumerable:d.enumerable,configurable:!0,get:d.get,set:function(b){if(this.nodeType===Node.TEXT_NODE)d.set.call(this,b);else{var c=void 0;if(this.firstChild){var e=this.childNodes,h=e.length;if(0<h&&m(this)){c=Array(h);for(var n=0;n<h;n++)c[n]=e[n]}}d.set.call(this,b);if(c)for(b=0;b<c.length;b++)a.a(c[b])}}})}
+u(Node.prototype,"insertBefore",function(b,d){if(b instanceof DocumentFragment){var c=Array.prototype.slice.apply(b.childNodes);b=zb.call(this,b,d);if(m(this))for(d=0;d<c.length;d++)a.b(c[d]);return b}c=m(b);d=zb.call(this,b,d);c&&a.a(b);m(this)&&a.b(b);return d});u(Node.prototype,"appendChild",function(b){if(b instanceof DocumentFragment){var c=Array.prototype.slice.apply(b.childNodes);b=ja.call(this,b);if(m(this))for(var e=0;e<c.length;e++)a.b(c[e]);return b}c=m(b);e=ja.call(this,b);c&&a.a(b);m(this)&&
+a.b(b);return e});u(Node.prototype,"cloneNode",function(b){b=rb.call(this,b);this.ownerDocument.__CE_hasRegistry?a.c(b):a.j(b);return b});u(Node.prototype,"removeChild",function(b){var c=m(b),e=Da.call(this,b);c&&a.a(b);return e});u(Node.prototype,"replaceChild",function(b,d){if(b instanceof DocumentFragment){var c=Array.prototype.slice.apply(b.childNodes);b=Ab.call(this,b,d);if(m(this))for(a.a(d),d=0;d<c.length;d++)a.b(c[d]);return b}c=m(b);var f=Ab.call(this,b,d),g=m(this);g&&a.a(d);c&&a.a(b);g&&
+a.b(b);return f});Fa&&Fa.get?b(Node.prototype,Fa):a.u(function(a){b(a,{enumerable:!0,configurable:!0,get:function(){for(var a=[],b=0;b<this.childNodes.length;b++)a.push(this.childNodes[b].textContent);return a.join("")},set:function(a){for(;this.firstChild;)Da.call(this,this.firstChild);ja.call(this,document.createTextNode(a))}})})}function id(a){u(Document.prototype,"createElement",function(b){if(this.__CE_hasRegistry){var c=a.f(b);if(c)return new c.constructor}b=Ca.call(this,b);a.g(b);return b});
+u(Document.prototype,"importNode",function(b,c){b=jd.call(this,b,c);this.__CE_hasRegistry?a.c(b):a.j(b);return b});u(Document.prototype,"createElementNS",function(b,c){if(this.__CE_hasRegistry&&(null===b||"http://www.w3.org/1999/xhtml"===b)){var d=a.f(c);if(d)return new d.constructor}b=kd.call(this,b,c);a.g(b);return b});yb(a,Document.prototype,{La:ld,append:md})}function yb(a,b,c){b.prepend=function(b){for(var d=[],f=0;f<arguments.length;++f)d[f-0]=arguments[f];f=d.filter(function(a){return a instanceof
+Node&&m(a)});c.La.apply(this,d);for(var g=0;g<f.length;g++)a.a(f[g]);if(m(this))for(f=0;f<d.length;f++)g=d[f],g instanceof Element&&a.b(g)};b.append=function(b){for(var d=[],f=0;f<arguments.length;++f)d[f-0]=arguments[f];f=d.filter(function(a){return a instanceof Node&&m(a)});c.append.apply(this,d);for(var g=0;g<f.length;g++)a.a(f[g]);if(m(this))for(f=0;f<d.length;f++)g=d[f],g instanceof Element&&a.b(g)}}function nd(a){window.HTMLElement=function(){function b(){var b=this.constructor,d=a.C(b);if(!d)throw Error("The custom element being constructed was not registered with `customElements`.");
+var e=d.constructionStack;if(!e.length)return e=Ca.call(document,d.localName),Object.setPrototypeOf(e,b.prototype),e.__CE_state=1,e.__CE_definition=d,a.g(e),e;d=e.length-1;var f=e[d];if(f===Bb)throw Error("The HTMLElement constructor was either called reentrantly for this constructor or called multiple times.");e[d]=Bb;Object.setPrototypeOf(f,b.prototype);a.g(f);return f}b.prototype=od.prototype;return b}()}function B(a){this.f=!1;this.a=a;this.h=new Map;this.g=function(a){return a()};this.b=!1;this.c=
+[];this.i=new Ga(a,document)}function Cb(){var a=this;this.b=this.a=void 0;this.c=new Promise(function(b){a.b=b;a.a&&b(a.a)})}function Ga(a,b){this.b=a;this.a=b;this.N=void 0;this.b.c(this.a);"loading"===this.a.readyState&&(this.N=new MutationObserver(this.f.bind(this)),this.N.observe(this.a,{childList:!0,subtree:!0}))}function A(){this.s=new Map;this.l=new Map;this.i=[];this.h=!1}function l(a,b,c){if(a!==Db)throw new TypeError("Illegal constructor");a=document.createDocumentFragment();a.__proto__=
+l.prototype;a.D(b,c);return a}function la(a){if(!a.__shady||void 0===a.__shady.firstChild){a.__shady=a.__shady||{};a.__shady.firstChild=Ha(a);a.__shady.lastChild=Ia(a);Eb(a);for(var b=a.__shady.childNodes=S(a),c=0,d;c<b.length&&(d=b[c]);c++)d.__shady=d.__shady||{},d.__shady.parentNode=a,d.__shady.nextSibling=b[c+1]||null,d.__shady.previousSibling=b[c-1]||null,Fb(d)}}function pd(a){var b=a&&a.N;b&&(b.ba.delete(a.ab),b.ba.size||(a.fb.__shady.W=null))}function qd(a,b){a.__shady=a.__shady||{};a.__shady.W||
+(a.__shady.W=new ma);a.__shady.W.ba.add(b);var c=a.__shady.W;return{ab:b,N:c,fb:a,takeRecords:function(){return c.takeRecords()}}}function ma(){this.a=!1;this.addedNodes=[];this.removedNodes=[];this.ba=new Set}function T(a){return a.__shady&&void 0!==a.__shady.firstChild}function L(a){return"ShadyRoot"===a.Wa}function Z(a){a=a.getRootNode();if(L(a))return a}function Ja(a,b){if(a&&b)for(var c=Object.getOwnPropertyNames(b),d=0,e;d<c.length&&(e=c[d]);d++){var f=Object.getOwnPropertyDescriptor(b,e);f&&
+Object.defineProperty(a,e,f)}}function Ka(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];for(d=0;d<c.length;d++)Ja(a,c[d]);return a}function rd(a,b){for(var c in b)a[c]=b[c]}function Gb(a){La.push(a);Ma.textContent=Hb++}function Ib(a){Na||(Na=!0,Gb(na));aa.push(a)}function na(){Na=!1;for(var a=!!aa.length;aa.length;)aa.shift()();return a}function sd(a,b){var c=b.getRootNode();return a.map(function(a){var b=c===a.target.getRootNode();if(b&&a.addedNodes){if(b=Array.from(a.addedNodes).filter(function(a){return c===
+a.getRootNode()}),b.length)return a=Object.create(a),Object.defineProperty(a,"addedNodes",{value:b,configurable:!0}),a}else if(b)return a}).filter(function(a){return a})}function Jb(a){switch(a){case "&":return"&amp;";case "<":return"&lt;";case ">":return"&gt;";case '"':return"&quot;";case "\u00a0":return"&nbsp;"}}function Kb(a){for(var b={},c=0;c<a.length;c++)b[a[c]]=!0;return b}function Oa(a,b){"template"===a.localName&&(a=a.content);for(var c="",d=b?b(a):a.childNodes,e=0,f=d.length,g;e<f&&(g=d[e]);e++){a:{var h=
+g;var n=a;var R=b;switch(h.nodeType){case Node.ELEMENT_NODE:for(var k=h.localName,ia="<"+k,l=h.attributes,m=0;n=l[m];m++)ia+=" "+n.name+'="'+n.value.replace(td,Jb)+'"';ia+=">";h=ud[k]?ia:ia+Oa(h,R)+"</"+k+">";break a;case Node.TEXT_NODE:h=h.data;h=n&&vd[n.localName]?h:h.replace(wd,Jb);break a;case Node.COMMENT_NODE:h="\x3c!--"+h.data+"--\x3e";break a;default:throw window.console.error(h),Error("not implemented");}}c+=h}return c}function U(a){F.currentNode=a;return F.parentNode()}function Ha(a){F.currentNode=
+a;return F.firstChild()}function Ia(a){F.currentNode=a;return F.lastChild()}function Lb(a){F.currentNode=a;return F.previousSibling()}function Mb(a){F.currentNode=a;return F.nextSibling()}function S(a){var b=[];F.currentNode=a;for(a=F.firstChild();a;)b.push(a),a=F.nextSibling();return b}function Nb(a){x.currentNode=a;return x.parentNode()}function Ob(a){x.currentNode=a;return x.firstChild()}function Pb(a){x.currentNode=a;return x.lastChild()}function Qb(a){x.currentNode=a;return x.previousSibling()}
+function Rb(a){x.currentNode=a;return x.nextSibling()}function Sb(a){var b=[];x.currentNode=a;for(a=x.firstChild();a;)b.push(a),a=x.nextSibling();return b}function Tb(a){return Oa(a,function(a){return S(a)})}function Ub(a){switch(a.nodeType){case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:a=document.createTreeWalker(a,NodeFilter.SHOW_TEXT,null,!1);for(var b="",c;c=a.nextNode();)b+=c.nodeValue;return b;default:return a.nodeValue}}function M(a,b,c){for(var d in b){var e=Object.getOwnPropertyDescriptor(a,
+d);e&&e.configurable||!e&&c?Object.defineProperty(a,d,b[d]):c&&console.warn("Could not define",d,"on",a)}}function N(a){M(a,Vb);M(a,Pa);M(a,Qa)}function Wb(a,b,c){Fb(a);c=c||null;a.__shady=a.__shady||{};b.__shady=b.__shady||{};c&&(c.__shady=c.__shady||{});a.__shady.previousSibling=c?c.__shady.previousSibling:b.lastChild;var d=a.__shady.previousSibling;d&&d.__shady&&(d.__shady.nextSibling=a);(d=a.__shady.nextSibling=c)&&d.__shady&&(d.__shady.previousSibling=a);a.__shady.parentNode=b;c?c===b.__shady.firstChild&&
+(b.__shady.firstChild=a):(b.__shady.lastChild=a,b.__shady.firstChild||(b.__shady.firstChild=a));b.__shady.childNodes=null}function Ra(a,b,c){if(b===a)throw Error("Failed to execute 'appendChild' on 'Node': The new child element contains the parent.");if(c){var d=c.__shady&&c.__shady.parentNode;if(void 0!==d&&d!==a||void 0===d&&U(c)!==a)throw Error("Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.");}if(c===b)return b;b.parentNode&&
+Sa(b.parentNode,b);d=Z(a);var e;if(e=d)a:{if(!b.__noInsertionPoint){var f;"slot"===b.localName?f=[b]:b.querySelectorAll&&(f=b.querySelectorAll("slot"));if(f&&f.length){e=f;break a}}e=void 0}f=e;d&&("slot"===a.localName||f)&&d.M();if(T(a)){e=c;Eb(a);a.__shady=a.__shady||{};void 0!==a.__shady.firstChild&&(a.__shady.childNodes=null);if(b.nodeType===Node.DOCUMENT_FRAGMENT_NODE){for(var g=b.childNodes,h=0;h<g.length;h++)Wb(g[h],a,e);b.__shady=b.__shady||{};e=void 0!==b.__shady.firstChild?null:void 0;b.__shady.firstChild=
+b.__shady.lastChild=e;b.__shady.childNodes=e}else Wb(b,a,e);if(Ta(a)){a.__shady.root.M();var n=!0}else a.__shady.root&&(n=!0)}n||(n=L(a)?a.host:a,c?(c=Xb(c),Ua.call(n,b,c)):Yb.call(n,b));Zb(a,b);f&&d.$a(f);return b}function Sa(a,b){if(b.parentNode!==a)throw Error("The node to be removed is not a child of this node: "+b);var c=Z(b);if(T(a)){b.__shady=b.__shady||{};a.__shady=a.__shady||{};b===a.__shady.firstChild&&(a.__shady.firstChild=b.__shady.nextSibling);b===a.__shady.lastChild&&(a.__shady.lastChild=
+b.__shady.previousSibling);var d=b.__shady.previousSibling;var e=b.__shady.nextSibling;d&&(d.__shady=d.__shady||{},d.__shady.nextSibling=e);e&&(e.__shady=e.__shady||{},e.__shady.previousSibling=d);b.__shady.parentNode=b.__shady.previousSibling=b.__shady.nextSibling=void 0;void 0!==a.__shady.childNodes&&(a.__shady.childNodes=null);if(Ta(a)){a.__shady.root.M();var f=!0}}$b(b);c&&((e=a&&"slot"===a.localName)&&(f=!0),((d=c.gb(b))||e)&&c.M());f||(f=L(a)?a.host:a,(!a.__shady.root&&"slot"!==b.localName||
+f===U(b))&&ba.call(f,b));Zb(a,null,b);return b}function $b(a){if(a.__shady&&void 0!==a.__shady.ta)for(var b=a.childNodes,c=0,d=b.length,e;c<d&&(e=b[c]);c++)$b(e);a.__shady&&(a.__shady.ta=void 0)}function Xb(a){var b=a;a&&"slot"===a.localName&&(b=(b=a.__shady&&a.__shady.U)&&b.length?b[0]:Xb(a.nextSibling));return b}function Ta(a){return(a=a&&a.__shady&&a.__shady.root)&&a.Ba()}function ac(a,b){"slot"===b?(a=a.parentNode,Ta(a)&&a.__shady.root.M()):"slot"===a.localName&&"name"===b&&(b=Z(a))&&(b.ib(a),
+b.M())}function Zb(a,b,c){if(a=a.__shady&&a.__shady.W)b&&a.addedNodes.push(b),c&&a.removedNodes.push(c),a.wb()}function bc(a){if(a&&a.nodeType){a.__shady=a.__shady||{};var b=a.__shady.ta;void 0===b&&(L(a)?b=a:b=(b=a.parentNode)?bc(b):a,document.documentElement.contains(a)&&(a.__shady.ta=b));return b}}function oa(a,b,c){var d=[];cc(a.childNodes,b,c,d);return d}function cc(a,b,c,d){for(var e=0,f=a.length,g;e<f&&(g=a[e]);e++){var h;if(h=g.nodeType===Node.ELEMENT_NODE){h=g;var n=b,R=c,k=d,l=n(h);l&&k.push(h);
+R&&R(l)?h=l:(cc(h.childNodes,n,R,k),h=void 0)}if(h)break}}function dc(a){a=a.getRootNode();L(a)&&a.Ea()}function ec(a,b,c){pa||(pa=window.ShadyCSS&&window.ShadyCSS.ScopingShim);pa&&"class"===b?pa.setElementClass(a,c):(fc.call(a,b,c),ac(a,b))}function gc(a,b){if(a.ownerDocument!==document)return Va.call(document,a,b);var c=Va.call(document,a,!1);if(b){a=a.childNodes;b=0;for(var d;b<a.length;b++)d=gc(a[b],!0),c.appendChild(d)}return c}function Wa(a,b){var c=[],d=a;for(a=a===window?window:a.getRootNode();d;)c.push(d),
+d=d.assignedSlot?d.assignedSlot:d.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&d.host&&(b||d!==a)?d.host:d.parentNode;c[c.length-1]===document&&c.push(window);return c}function hc(a,b){if(!L)return a;a=Wa(a,!0);for(var c=0,d,e,f,g;c<b.length;c++)if(d=b[c],f=d===window?window:d.getRootNode(),f!==e&&(g=a.indexOf(f),e=f),!L(f)||-1<g)return d}function Xa(a){function b(b,d){b=new a(b,d);b.ja=d&&!!d.composed;return b}rd(b,a);b.prototype=a.prototype;return b}function ic(a,b,c){if(c=b.__handlers&&b.__handlers[a.type]&&
+b.__handlers[a.type][c])for(var d=0,e;(e=c[d])&&a.target!==a.relatedTarget&&(e.call(b,a),!a.Ua);d++);}function xd(a){var b=a.composedPath();Object.defineProperty(a,"currentTarget",{get:function(){return d},configurable:!0});for(var c=b.length-1;0<=c;c--){var d=b[c];ic(a,d,"capture");if(a.ka)return}Object.defineProperty(a,"eventPhase",{get:function(){return Event.AT_TARGET}});var e;for(c=0;c<b.length;c++){d=b[c];var f=d.__shady&&d.__shady.root;if(!c||f&&f===e)if(ic(a,d,"bubble"),d!==window&&(e=d.getRootNode()),
+a.ka)break}}function jc(a,b,c,d,e,f){for(var g=0;g<a.length;g++){var h=a[g],n=h.type,R=h.capture,k=h.once,l=h.passive;if(b===h.node&&c===n&&d===R&&e===k&&f===l)return g}return-1}function kc(a,b,c){if(b){if("object"===typeof c){var d=!!c.capture;var e=!!c.once;var f=!!c.passive}else d=!!c,f=e=!1;var g=c&&c.la||this,h=b.Z;if(h){if(-1<jc(h,g,a,d,e,f))return}else b.Z=[];h=function(d){e&&this.removeEventListener(a,b,c);d.__target||lc(d);if(g!==this){var f=Object.getOwnPropertyDescriptor(d,"currentTarget");
+Object.defineProperty(d,"currentTarget",{get:function(){return g},configurable:!0})}if(d.composed||-1<d.composedPath().indexOf(g))if(d.target===d.relatedTarget)d.eventPhase===Event.BUBBLING_PHASE&&d.stopImmediatePropagation();else if(d.eventPhase===Event.CAPTURING_PHASE||d.bubbles||d.target===g){var h="object"===typeof b&&b.handleEvent?b.handleEvent(d):b.call(g,d);g!==this&&(f?(Object.defineProperty(d,"currentTarget",f),f=null):delete d.currentTarget);return h}};b.Z.push({node:this,type:a,capture:d,
+once:e,passive:f,zb:h});Ya[a]?(this.__handlers=this.__handlers||{},this.__handlers[a]=this.__handlers[a]||{capture:[],bubble:[]},this.__handlers[a][d?"capture":"bubble"].push(h)):(this instanceof Window?mc:nc).call(this,a,h,c)}}function oc(a,b,c){if(b){if("object"===typeof c){var d=!!c.capture;var e=!!c.once;var f=!!c.passive}else d=!!c,f=e=!1;var g=c&&c.la||this,h=void 0;var n=null;try{n=b.Z}catch(R){}n&&(e=jc(n,g,a,d,e,f),-1<e&&(h=n.splice(e,1)[0].zb,n.length||(b.Z=void 0)));(this instanceof Window?
+pc:qc).call(this,a,h||b,c);h&&Ya[a]&&this.__handlers&&this.__handlers[a]&&(a=this.__handlers[a][d?"capture":"bubble"],h=a.indexOf(h),-1<h&&a.splice(h,1))}}function yd(){for(var a in Ya)window.addEventListener(a,function(a){a.__target||(lc(a),xd(a))},!0)}function lc(a){a.__target=a.target;a.za=a.relatedTarget;if(C.V){var b=rc,c=Object.getPrototypeOf(a);if(!c.hasOwnProperty("__patchProto")){var d=Object.create(c);d.Bb=c;Ja(d,b);c.__patchProto=d}a.__proto__=c.__patchProto}else Ja(a,rc)}function ca(a,
+b){return{index:a,X:[],aa:b}}function zd(a,b,c,d){var e=0,f=0,g=0,h=0,n=Math.min(b-e,d-f);if(0==e&&0==f)a:{for(g=0;g<n;g++)if(a[g]!==c[g])break a;g=n}if(b==a.length&&d==c.length){h=a.length;for(var k=c.length,l=0;l<n-g&&Ad(a[--h],c[--k]);)l++;h=l}e+=g;f+=g;b-=h;d-=h;if(!(b-e||d-f))return[];if(e==b){for(b=ca(e,0);f<d;)b.X.push(c[f++]);return[b]}if(f==d)return[ca(e,b-e)];n=e;g=f;d=d-g+1;h=b-n+1;b=Array(d);for(k=0;k<d;k++)b[k]=Array(h),b[k][0]=k;for(k=0;k<h;k++)b[0][k]=k;for(k=1;k<d;k++)for(l=1;l<h;l++)if(a[n+
+l-1]===c[g+k-1])b[k][l]=b[k-1][l-1];else{var m=b[k-1][l]+1,p=b[k][l-1]+1;b[k][l]=m<p?m:p}n=b.length-1;g=b[0].length-1;d=b[n][g];for(a=[];0<n||0<g;)n?g?(h=b[n-1][g-1],k=b[n-1][g],l=b[n][g-1],m=k<l?k<h?k:h:l<h?l:h,m==h?(h==d?a.push(0):(a.push(1),d=h),n--,g--):m==k?(a.push(3),n--,d=k):(a.push(2),g--,d=l)):(a.push(3),n--):(a.push(2),g--);a.reverse();b=void 0;n=[];for(g=0;g<a.length;g++)switch(a[g]){case 0:b&&(n.push(b),b=void 0);e++;f++;break;case 1:b||(b=ca(e,0));b.aa++;e++;b.X.push(c[f]);f++;break;
+case 2:b||(b=ca(e,0));b.aa++;e++;break;case 3:b||(b=ca(e,0)),b.X.push(c[f]),f++}b&&n.push(b);return n}function Ad(a,b){return a===b}function sc(a){var b=[];do b.unshift(a);while(a=a.parentNode);return b}function tc(a){dc(a);return a.__shady&&a.__shady.assignedSlot||null}function I(a,b){for(var c=Object.getOwnPropertyNames(b),d=0;d<c.length;d++){var e=c[d],f=Object.getOwnPropertyDescriptor(b,e);f.value?a[e]=f.value:Object.defineProperty(a,e,f)}}function Bd(){var a=window.customElements&&window.customElements.nativeHTMLElement||
+HTMLElement;I(window.Node.prototype,Cd);I(window.Window.prototype,Dd);I(window.Text.prototype,Ed);I(window.DocumentFragment.prototype,Za);I(window.Element.prototype,uc);I(window.Document.prototype,vc);window.HTMLSlotElement&&I(window.HTMLSlotElement.prototype,wc);I(a.prototype,Fd);C.V&&(N(window.Node.prototype),N(window.Text.prototype),N(window.DocumentFragment.prototype),N(window.Element.prototype),N(a.prototype),N(window.Document.prototype),window.HTMLSlotElement&&N(window.HTMLSlotElement.prototype))}
+function xc(a){var b=Gd.has(a);a=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(a);return!b&&a}function m(a){var b=a.isConnected;if(void 0!==b)return b;for(;a&&!(a.__CE_isImportDocument||a instanceof Document);)a=a.parentNode||(window.ShadowRoot&&a instanceof ShadowRoot?a.host:void 0);return!(!a||!(a.__CE_isImportDocument||a instanceof Document))}function $a(a,b){for(;b&&b!==a&&!b.nextSibling;)b=b.parentNode;return b&&b!==a?b.nextSibling:null}function J(a,b,c){c=c?c:new Set;for(var d=a;d;){if(d.nodeType===
+Node.ELEMENT_NODE){var e=d;b(e);var f=e.localName;if("link"===f&&"import"===e.getAttribute("rel")){d=e.import;if(d instanceof Node&&!c.has(d))for(c.add(d),d=d.firstChild;d;d=d.nextSibling)J(d,b,c);d=$a(a,e);continue}else if("template"===f){d=$a(a,e);continue}if(e=e.__CE_shadowRoot)for(e=e.firstChild;e;e=e.nextSibling)J(e,b,c)}d=d.firstChild?d.firstChild:$a(a,d)}}function u(a,b,c){a[b]=c}function ab(a){a=a.replace(G.mb,"").replace(G.port,"");var b=yc,c=a,d=new za;d.start=0;d.end=c.length;for(var e=
+d,f=0,g=c.length;f<g;f++)if("{"===c[f]){e.rules||(e.rules=[]);var h=e,n=h.rules[h.rules.length-1]||null;e=new za;e.start=f+1;e.parent=h;e.previous=n;h.rules.push(e)}else"}"===c[f]&&(e.end=f+1,e=e.parent||d);return b(d,a)}function yc(a,b){var c=b.substring(a.start,a.end-1);a.parsedCssText=a.cssText=c.trim();a.parent&&((c=b.substring(a.previous?a.previous.end:a.parent.start,a.start-1),c=Hd(c),c=c.replace(G.Ka," "),c=c.substring(c.lastIndexOf(";")+1),c=a.parsedSelector=a.selector=c.trim(),a.atRule=!c.indexOf("@"),
+a.atRule)?c.indexOf("@media")?c.match(G.rb)&&(a.type=O.ia,a.keyframesName=a.selector.split(G.Ka).pop()):a.type=O.MEDIA_RULE:a.type=c.indexOf("--")?O.STYLE_RULE:O.va);if(c=a.rules)for(var d=0,e=c.length,f;d<e&&(f=c[d]);d++)yc(f,b);return a}function Hd(a){return a.replace(/\\([0-9a-f]{1,6})\s/gi,function(a,c){a=c;for(c=6-a.length;c--;)a="0"+a;return"\\"+a})}function zc(a,b,c){c=void 0===c?"":c;var d="";if(a.cssText||a.rules){var e=a.rules,f;if(f=e)f=e[0],f=!(f&&f.selector&&0===f.selector.indexOf("--"));
+if(f){f=0;for(var g=e.length,h;f<g&&(h=e[f]);f++)d=zc(h,b,d)}else b?b=a.cssText:(b=a.cssText,b=b.replace(G.Fa,"").replace(G.Ja,""),b=b.replace(G.sb,"").replace(G.yb,"")),(d=b.trim())&&(d="  "+d+"\n")}d&&(a.selector&&(c+=a.selector+" {\n"),c+=d,a.selector&&(c+="}\n\n"));return c}function Ac(a){q=a&&a.shimcssproperties?!1:w||!(navigator.userAgent.match("AppleWebKit/601")||!window.CSS||!CSS.supports||!CSS.supports("box-shadow","0 0 0 var(--foo)"))}function V(a,b){if(!a)return"";"string"===typeof a&&
+(a=ab(a));b&&W(a,b);return zc(a,q)}function qa(a){!a.__cssRules&&a.textContent&&(a.__cssRules=ab(a.textContent));return a.__cssRules||null}function Bc(a){return!!a.parent&&a.parent.type===O.ia}function W(a,b,c,d){if(a){var e=!1,f=a.type;if(d&&f===O.MEDIA_RULE){var g=a.selector.match(Id);g&&(window.matchMedia(g[1]).matches||(e=!0))}f===O.STYLE_RULE?b(a):c&&f===O.ia?c(a):f===O.va&&(e=!0);if((a=a.rules)&&!e){e=0;f=a.length;for(var h;e<f&&(h=a[e]);e++)W(h,b,c,d)}}}function bb(a,b,c,d){var e=document.createElement("style");
+b&&e.setAttribute("scope",b);e.textContent=a;Cc(e,c,d);return e}function Cc(a,b,c){b=b||document.head;b.insertBefore(a,c&&c.nextSibling||b.firstChild);P?a.compareDocumentPosition(P)===Node.DOCUMENT_POSITION_PRECEDING&&(P=a):P=a}function Dc(a,b){var c=a.indexOf("var(");if(-1===c)return b(a,"","","");a:{var d=0;var e=c+3;for(var f=a.length;e<f;e++)if("("===a[e])d++;else if(")"===a[e]&&!--d)break a;e=-1}d=a.substring(c+4,e);c=a.substring(0,c);a=Dc(a.substring(e+1),b);e=d.indexOf(",");return-1===e?b(c,
+d.trim(),"",a):b(c,d.substring(0,e).trim(),d.substring(e+1).trim(),a)}function ra(a,b){w?a.setAttribute("class",b):window.ShadyDOM.nativeMethods.setAttribute.call(a,"class",b)}function Q(a){var b=a.localName,c="";b?-1<b.indexOf("-")||(c=b,b=a.getAttribute&&a.getAttribute("is")||""):(b=a.is,c=a.extends);return{is:b,Y:c}}function Ec(a){for(var b=0;b<a.length;b++){var c=a[b];if(c.target!==document.documentElement&&c.target!==document.head)for(var d=0;d<c.addedNodes.length;d++){var e=c.addedNodes[d];
+if(e.nodeType===Node.ELEMENT_NODE){var f=e.getRootNode();var g=e;var h=[];g.classList?h=Array.from(g.classList):g instanceof window.SVGElement&&g.hasAttribute("class")&&(h=g.getAttribute("class").split(/\s+/));g=h;h=g.indexOf(v.c);(g=-1<h?g[h+1]:"")&&f===e.ownerDocument?v.a(e,g,!0):f.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(f=f.host)&&(f=Q(f).is,g!==f&&(g&&v.a(e,g,!0),v.a(e,f)))}}}}function Jd(a){if(a=sa[a])a._applyShimCurrentVersion=a._applyShimCurrentVersion||0,a._applyShimValidatingVersion=a._applyShimValidatingVersion||
+0,a._applyShimNextVersion=(a._applyShimNextVersion||0)+1}function Fc(a){return a._applyShimCurrentVersion===a._applyShimNextVersion}function Kd(a){a._applyShimValidatingVersion=a._applyShimNextVersion;a.b||(a.b=!0,Ld.then(function(){a._applyShimCurrentVersion=a._applyShimNextVersion;a.b=!1}))}function ob(a){requestAnimationFrame(function(){Gc?Gc(a):(cb||(cb=new Promise(function(a){db=a}),"complete"===document.readyState?db():document.addEventListener("readystatechange",function(){"complete"===document.readyState&&
+db()})),cb.then(function(){a&&a()}))})}(function(){if(!function(){var a=document.createEvent("Event");a.initEvent("foo",!0,!0);a.preventDefault();return a.defaultPrevented}()){var a=Event.prototype.preventDefault;Event.prototype.preventDefault=function(){this.cancelable&&(a.call(this),Object.defineProperty(this,"defaultPrevented",{get:function(){return!0},configurable:!0}))}}var b=/Trident/.test(navigator.userAgent);if(!window.CustomEvent||b&&"function"!==typeof window.CustomEvent)window.CustomEvent=
+function(a,b){b=b||{};var c=document.createEvent("CustomEvent");c.initCustomEvent(a,!!b.bubbles,!!b.cancelable,b.detail);return c},window.CustomEvent.prototype=window.Event.prototype;if(!window.Event||b&&"function"!==typeof window.Event){var c=window.Event;window.Event=function(a,b){b=b||{};var c=document.createEvent("Event");c.initEvent(a,!!b.bubbles,!!b.cancelable);return c};if(c)for(var d in c)window.Event[d]=c[d];window.Event.prototype=c.prototype}if(!window.MouseEvent||b&&"function"!==typeof window.MouseEvent){b=
+window.MouseEvent;window.MouseEvent=function(a,b){b=b||{};var c=document.createEvent("MouseEvent");c.initMouseEvent(a,!!b.bubbles,!!b.cancelable,b.view||window,b.detail,b.screenX,b.screenY,b.clientX,b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,b.button,b.relatedTarget);return c};if(b)for(d in b)window.MouseEvent[d]=b[d];window.MouseEvent.prototype=b.prototype}Array.from||(Array.from=function(a){return[].slice.call(a)});Object.assign||(Object.assign=function(a,b){for(var c=[].slice.call(arguments,
+1),d=0,e;d<c.length;d++)if(e=c[d])for(var f=a,k=e,l=Object.getOwnPropertyNames(k),m=0;m<l.length;m++)e=l[m],f[e]=k[e];return a})})(window.WebComponents);(function(){function a(){}var b="undefined"===typeof HTMLTemplateElement;/Trident/.test(navigator.userAgent)&&function(){var a=Document.prototype.importNode;Document.prototype.importNode=function(){var b=a.apply(this,arguments);if(b.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var c=this.createDocumentFragment();c.appendChild(b);return c}return b}}();
+var c=Node.prototype.cloneNode,d=Document.prototype.createElement,e=Document.prototype.importNode,f=function(){if(!b){var a=document.createElement("template"),c=document.createElement("template");c.content.appendChild(document.createElement("div"));a.content.appendChild(c);a=a.cloneNode(!0);return 0===a.content.childNodes.length||0===a.content.firstChild.content.childNodes.length||!(document.createDocumentFragment().cloneNode()instanceof DocumentFragment)}}();if(b){var g=function(a){switch(a){case "&":return"&amp;";
+case "<":return"&lt;";case ">":return"&gt;";case "\u00a0":return"&nbsp;"}},h=function(b){Object.defineProperty(b,"innerHTML",{get:function(){for(var a="",b=this.content.firstChild;b;b=b.nextSibling)a+=b.outerHTML||b.data.replace(t,g);return a},set:function(b){k.body.innerHTML=b;for(a.b(k);this.content.firstChild;)this.content.removeChild(this.content.firstChild);for(;k.body.firstChild;)this.content.appendChild(k.body.firstChild)},configurable:!0})},k=document.implementation.createHTMLDocument("template"),
+l=!0,m=document.createElement("style");m.textContent="template{display:none;}";var p=document.head;p.insertBefore(m,p.firstElementChild);a.prototype=Object.create(HTMLElement.prototype);var r=!document.createElement("div").hasOwnProperty("innerHTML");a.O=function(b){if(!b.content){b.content=k.createDocumentFragment();for(var c;c=b.firstChild;)b.content.appendChild(c);if(r)b.__proto__=a.prototype;else if(b.cloneNode=function(b){return a.a(this,b)},l)try{h(b)}catch(y){l=!1}a.b(b.content)}};h(a.prototype);
+a.b=function(b){b=b.querySelectorAll("template");for(var c=0,d=b.length,e;c<d&&(e=b[c]);c++)a.O(e)};document.addEventListener("DOMContentLoaded",function(){a.b(document)});Document.prototype.createElement=function(){var b=d.apply(this,arguments);"template"===b.localName&&a.O(b);return b};var t=/[&\u00A0<>]/g}if(b||f)a.a=function(a,b){var d=c.call(a,!1);this.O&&this.O(d);b&&(d.content.appendChild(c.call(a.content,!0)),this.ra(d.content,a.content));return d},a.prototype.cloneNode=function(b){return a.a(this,
+b)},a.ra=function(a,b){if(b.querySelectorAll){b=b.querySelectorAll("template");a=a.querySelectorAll("template");for(var c=0,d=a.length,e,f;c<d;c++)f=b[c],e=a[c],this.O&&this.O(f),e.parentNode.replaceChild(f.cloneNode(!0),e)}},Node.prototype.cloneNode=function(b){if(this instanceof DocumentFragment)if(b)var d=this.ownerDocument.importNode(this,!0);else return this.ownerDocument.createDocumentFragment();else d=c.call(this,b);b&&a.ra(d,this);return d},Document.prototype.importNode=function(b,c){if("template"===
+b.localName)return a.a(b,c);var d=e.call(this,b,c);c&&a.ra(d,b);return d},f&&(window.HTMLTemplateElement.prototype.cloneNode=function(b){return a.a(this,b)});b&&(window.HTMLTemplateElement=a)})();!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.Eb?define(b):a.ES6Promise=b()}(window,function(){function a(a,b){E[x]=a;E[x+1]=b;x+=2;2===x&&(H?H(g):O())}function b(){return function(){return process.Hb(g)}}function c(){return"undefined"!=
+typeof C?function(){C(g)}:f()}function d(){var a=0,b=new L(g),c=document.createTextNode("");return b.observe(c,{characterData:!0}),function(){c.data=a=++a%2}}function e(){var a=new MessageChannel;return a.port1.onmessage=g,function(){return a.port2.postMessage(0)}}function f(){var a=setTimeout;return function(){return a(g,1)}}function g(){for(var a=0;a<x;a+=2)(0,E[a])(E[a+1]),E[a]=void 0,E[a+1]=void 0;x=0}function h(){try{var a=require("vertx");return C=a.Jb||a.Ib,c()}catch(Hc){return f()}}function k(b,
+c){var d=arguments,e=this,f=new this.constructor(m);void 0===f[M]&&Ic(f);var g=e.o;return g?!function(){var b=d[g-1];a(function(){return Jc(g,f,b,e.m)})}():u(e,f,b,c),f}function l(a){if(a&&"object"==typeof a&&a.constructor===this)return a;var b=new this(m);return y(b,a),b}function m(){}function p(a){try{return a.then}catch(Hc){return N.error=Hc,N}}function r(a,b,c,d){try{a.call(b,c,d)}catch(Od){return Od}}function t(b,c,d){a(function(a){var b=!1,e=r(d,c,function(d){b||(b=!0,c!==d?y(a,d):q(a,d))},
+function(c){b||(b=!0,z(a,c))});!b&&e&&(b=!0,z(a,e))},b)}function v(a,b){b.o===K?q(a,b.m):b.o===J?z(a,b.m):u(b,void 0,function(b){return y(a,b)},function(b){return z(a,b)})}function w(a,b,c){b.constructor===a.constructor&&c===k&&b.constructor.resolve===l?v(a,b):c===N?(z(a,N.error),N.error=null):void 0===c?q(a,b):"function"==typeof c?t(a,b,c):q(a,b)}function y(a,b){if(a===b)z(a,new TypeError("You cannot resolve a promise with itself"));else{var c=typeof b;null===b||"object"!==c&&"function"!==c?q(a,
+b):w(a,b,p(b))}}function B(a){a.Ca&&a.Ca(a.m);X(a)}function q(b,c){b.o===I&&(b.m=c,b.o=K,0!==b.T.length&&a(X,b))}function z(b,c){b.o===I&&(b.o=J,b.m=c,a(B,b))}function u(b,c,d,e){var f=b.T,g=f.length;b.Ca=null;f[g]=c;f[g+K]=d;f[g+J]=e;0===g&&b.o&&a(X,b)}function X(a){var b=a.T,c=a.o;if(0!==b.length){for(var d,e,f=a.m,g=0;g<b.length;g+=3)d=b[g],e=b[g+c],d?Jc(c,d,e,f):e(f);a.T.length=0}}function Kc(){this.error=null}function Jc(a,b,c,d){var e="function"==typeof c,f=void 0,g=void 0,h=void 0,X=void 0;
+if(e){try{var k=c(d)}catch(Pd){k=(P.error=Pd,P)}if(f=k,f===P?(X=!0,g=f.error,f.error=null):h=!0,b===f)return void z(b,new TypeError("A promises callback cannot return that same promise."))}else f=d,h=!0;b.o!==I||(e&&h?y(b,f):X?z(b,g):a===K?q(b,f):a===J&&z(b,f))}function Lc(a,b){try{b(function(b){y(a,b)},function(b){z(a,b)})}catch(Md){z(a,Md)}}function Ic(a){a[M]=Q++;a.o=void 0;a.m=void 0;a.T=[]}function da(a,b){this.eb=a;this.J=new a(m);this.J[M]||Ic(this.J);F(b)?(this.length=b.length,this.$=b.length,
+this.m=Array(this.length),0===this.length?q(this.J,this.m):(this.length=this.length||0,this.cb(b),0===this.$&&q(this.J,this.m))):z(this.J,Error("Array Methods must be provided an Array"))}function D(a){this[M]=Q++;this.m=this.o=void 0;this.T=[];if(m!==a){if("function"!=typeof a)throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(this instanceof D)Lc(this,a);else throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
+}}var A=void 0,F=A=Array.isArray?Array.isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)},x=0,C=void 0,H=void 0,G=(A="undefined"!=typeof window?window:void 0)||{},L=G.MutationObserver||G.WebKitMutationObserver;G="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;var E=Array(1E3),O=void 0;O="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)?b():L?d():G?e():A||"function"!=
+typeof require?f():h();var M=Math.random().toString(36).substring(16),I=void 0,K=1,J=2,N=new Kc,P=new Kc,Q=0;return da.prototype.cb=function(a){for(var b=0;this.o===I&&b<a.length;b++)this.bb(a[b],b)},da.prototype.bb=function(a,b){var c=this.eb,d=c.resolve;d===l?(d=p(a),d===k&&a.o!==I?this.oa(a.o,b,a.m):"function"!=typeof d?(this.$--,this.m[b]=a):c===D?(c=new c(m),w(c,a,d),this.pa(c,b)):this.pa(new c(function(b){return b(a)}),b)):this.pa(d(a),b)},da.prototype.oa=function(a,b,c){var d=this.J;d.o===
+I&&(this.$--,a===J?z(d,c):this.m[b]=c);0===this.$&&q(d,this.m)},da.prototype.pa=function(a,b){var c=this;u(a,void 0,function(a){return c.oa(K,b,a)},function(a){return c.oa(J,b,a)})},D.g=function(a){return(new da(this,a)).J},D.h=function(a){var b=this;return new b(F(a)?function(c,d){for(var e=a.length,f=0;f<e;f++)b.resolve(a[f]).then(c,d)}:function(a,b){return b(new TypeError("You must pass an array to race."))})},D.resolve=l,D.i=function(a){var b=new this(m);return z(b,a),b},D.f=function(a){H=a},
+D.c=function(b){a=b},D.b=a,D.prototype={constructor:D,then:k,"catch":function(a){return this.then(null,a)}},D.a=function(){var a=void 0;if("undefined"!=typeof global)a=global;else if("undefined"!=typeof self)a=self;else try{a=Function("return this")()}catch(Nd){throw Error("polyfill failed because global object is unavailable in this environment");}var b=a.Promise;if(b){var c=null;try{c=Object.prototype.toString.call(b.resolve())}catch(Nd){}if("[object Promise]"===c&&!b.Fb)return}a.Promise=D},D.Promise=
+D,D.a(),D});(function(a){function b(a,b){if("function"===typeof window.CustomEvent)return new CustomEvent(a,b);var c=document.createEvent("CustomEvent");c.initCustomEvent(a,!!b.bubbles,!!b.cancelable,b.detail);return c}function c(a){if(m)return a.ownerDocument!==document?a.ownerDocument:null;var b=a.__importDoc;if(!b&&a.parentNode){b=a.parentNode;if("function"===typeof b.closest)b=b.closest("link[rel=import]");else for(;!h(b)&&(b=b.parentNode););a.__importDoc=b}return b}function d(a){var b=document.querySelectorAll("link[rel=import]:not(import-dependency)"),
+c=b.length;c?l(b,function(b){return g(b,function(){--c||a()})}):a()}function e(a){function b(){"loading"!==document.readyState&&document.body&&(document.removeEventListener("readystatechange",b),a())}document.addEventListener("readystatechange",b);b()}function f(a){e(function(){return d(function(){return a&&a()})})}function g(a,b){if(a.__loaded)b&&b();else if("script"===a.localName&&!a.src||"style"===a.localName&&!a.firstChild)a.__loaded=!0,b&&b();else{var c=function(d){a.removeEventListener(d.type,
+c);a.__loaded=!0;b&&b()};a.addEventListener("load",c);v&&"style"===a.localName||a.addEventListener("error",c)}}function h(a){return a.nodeType===Node.ELEMENT_NODE&&"link"===a.localName&&"import"===a.rel}function k(){var a=this;this.a={};this.b=0;this.f=new MutationObserver(function(b){return a.l(b)});this.f.observe(document.head,{childList:!0,subtree:!0});this.c(document)}function l(a,b,c){var d=a?a.length:0,e=c?-1:1;for(c=c?d-1:0;c<d&&0<=c;c+=e)b(a[c],c)}var m="import"in document.createElement("link"),
+p=null;!1==="currentScript"in document&&Object.defineProperty(document,"currentScript",{get:function(){return p||("complete"!==document.readyState?document.scripts[document.scripts.length-1]:null)},configurable:!0});var q=/(^\/)|(^#)|(^[\w-\d]*:)/,r=/(url\()([^)]*)(\))/g,t=/(@import[\s]+(?!url\())([^;]*)(;)/g,x=/(<link[^>]*)(rel=['|"]?stylesheet['|"]?[^>]*>)/g,y={nb:function(a,b){a.href&&a.setAttribute("href",y.ua(a.getAttribute("href"),b));a.src&&a.setAttribute("src",y.ua(a.getAttribute("src"),b));
+if("style"===a.localName){var c=y.Ma(a.textContent,b,r);a.textContent=y.Ma(c,b,t)}},Ma:function(a,b,c){return a.replace(c,function(a,c,d,e){a=d.replace(/["']/g,"");b&&(a=y.Na(a,b));return c+"'"+a+"'"+e})},ua:function(a,b){return a&&q.test(a)?a:y.Na(a,b)},Na:function(a,b){if(void 0===y.ma){y.ma=!1;try{var c=new URL("b","http://a");c.pathname="c%20d";y.ma="http://a/c%20d"===c.href}catch(Lc){}}if(y.ma)return(new URL(a,b)).href;c=y.Za;c||(c=document.implementation.createHTMLDocument("temp"),y.Za=c,c.xa=
+c.createElement("base"),c.head.appendChild(c.xa),c.wa=c.createElement("a"));c.xa.href=b;c.wa.href=a;return c.wa.href||a}},w={async:!0,load:function(a,b,c){if(a)if(a.match(/^data:/)){a=a.split(",");var d=a[1];d=-1<a[0].indexOf(";base64")?atob(d):decodeURIComponent(d);b(d)}else{var e=new XMLHttpRequest;e.open("GET",a,w.async);e.onload=function(){var a=e.responseURL||e.getResponseHeader("Location");a&&!a.indexOf("/")&&(a=(location.origin||location.protocol+"//"+location.host)+a);var d=e.response||e.responseText;
+304===e.status||!e.status||200<=e.status&&300>e.status?b(d,a):c(d)};e.send()}else c("error: href must be specified")}},v=/Trident/.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent);k.prototype.c=function(a){var b=this;a=a.querySelectorAll("link[rel=import]");l(a,function(a){return b.h(a)})};k.prototype.h=function(a){var b=this,c=a.href;if(void 0!==this.a[c]){var d=this.a[c];d&&d.__loaded&&(a.import=d,this.g(a))}else this.b++,this.a[c]="pending",w.load(c,function(a,d){a=b.s(a,d||c);
+b.a[c]=a;b.b--;b.c(a);b.i()},function(){b.a[c]=null;b.b--;b.i()})};k.prototype.s=function(a,b){if(!a)return document.createDocumentFragment();v&&(a=a.replace(x,function(a,b,c){return-1===a.indexOf("type=")?b+" type=import-disable "+c:a}));var c=document.createElement("template");c.innerHTML=a;if(c.content)a=c.content;else for(a=document.createDocumentFragment();c.firstChild;)a.appendChild(c.firstChild);if(c=a.querySelector("base"))b=y.ua(c.getAttribute("href"),b),c.removeAttribute("href");c=a.querySelectorAll('link[rel=import], link[rel=stylesheet][href][type=import-disable],\n    style:not([type]), link[rel=stylesheet][href]:not([type]),\n    script:not([type]), script[type="application/javascript"],\n    script[type="text/javascript"]');
+var d=0;l(c,function(a){g(a);y.nb(a,b);a.setAttribute("import-dependency","");"script"===a.localName&&!a.src&&a.textContent&&(a.setAttribute("src","data:text/javascript;charset=utf-8,"+encodeURIComponent(a.textContent+("\n//# sourceURL="+b+(d?"-"+d:"")+".js\n"))),a.textContent="",d++)});return a};k.prototype.i=function(){var a=this;if(!this.b){this.f.disconnect();this.flatten(document);var b=!1,c=!1,d=function(){c&&b&&(a.c(document),a.b||(a.f.observe(document.head,{childList:!0,subtree:!0}),a.j()))};
+this.v(function(){c=!0;d()});this.u(function(){b=!0;d()})}};k.prototype.flatten=function(a){var b=this;a=a.querySelectorAll("link[rel=import]");l(a,function(a){var c=b.a[a.href];(a.import=c)&&c.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(b.a[a.href]=a,a.readyState="loading",a.import=a,b.flatten(c),a.appendChild(c))})};k.prototype.u=function(a){function b(e){if(e<d){var f=c[e],h=document.createElement("script");f.removeAttribute("import-dependency");l(f.attributes,function(a){return h.setAttribute(a.name,
+a.value)});p=h;f.parentNode.replaceChild(h,f);g(h,function(){p=null;b(e+1)})}else a()}var c=document.querySelectorAll("script[import-dependency]"),d=c.length;b(0)};k.prototype.v=function(a){var b=document.querySelectorAll("style[import-dependency],\n    link[rel=stylesheet][import-dependency]"),d=b.length;if(d){var e=v&&!!document.querySelector("link[rel=stylesheet][href][type=import-disable]");l(b,function(b){g(b,function(){b.removeAttribute("import-dependency");--d||a()});if(e&&b.parentNode!==document.head){var f=
+document.createElement(b.localName);f.__appliedElement=b;f.setAttribute("type","import-placeholder");b.parentNode.insertBefore(f,b.nextSibling);for(f=c(b);f&&c(f);)f=c(f);f.parentNode!==document.head&&(f=null);document.head.insertBefore(b,f);b.removeAttribute("type")}})}else a()};k.prototype.j=function(){var a=this,b=document.querySelectorAll("link[rel=import]");l(b,function(b){return a.g(b)},!0)};k.prototype.g=function(a){a.__loaded||(a.__loaded=!0,a.import&&(a.import.readyState="complete"),a.dispatchEvent(b(a.import?
+"load":"error",{bubbles:!1,cancelable:!1,detail:void 0})))};k.prototype.l=function(a){var b=this;l(a,function(a){return l(a.addedNodes,function(a){a&&a.nodeType===Node.ELEMENT_NODE&&(h(a)?b.h(a):b.c(a))})})};if(m){var z=document.querySelectorAll("link[rel=import]");l(z,function(a){a.import&&"loading"===a.import.readyState||(a.__loaded=!0)});z=function(a){a=a.target;h(a)&&(a.__loaded=!0)};document.addEventListener("load",z,!0);document.addEventListener("error",z,!0)}else{var u=Object.getOwnPropertyDescriptor(Node.prototype,
+"baseURI");Object.defineProperty((!u||u.configurable?Node:Element).prototype,"baseURI",{get:function(){var a=h(this)?this:c(this);return a?a.href:u&&u.get?u.get.call(this):(document.querySelector("base")||window.location).href},configurable:!0,enumerable:!0});e(function(){return new k})}f(function(){return document.dispatchEvent(b("HTMLImportsLoaded",{cancelable:!0,bubbles:!0,detail:void 0}))});a.useNative=m;a.whenReady=f;a.importForElement=c})(window.HTMLImports=window.HTMLImports||{});(function(){window.WebComponents=
+window.WebComponents||{flags:{}};var a=document.querySelector('script[src*="webcomponents-lite.js"]'),b=/wc-(.+)/,c={};if(!c.noOpts){location.search.slice(1).split("&").forEach(function(a){a=a.split("=");var d;a[0]&&(d=a[0].match(b))&&(c[d[1]]=a[1]||!0)});if(a)for(var d=0,e;e=a.attributes[d];d++)"src"!==e.name&&(c[e.name]=e.value||!0);c.log&&c.log.split?(a=c.log.split(","),c.log={},a.forEach(function(a){c.log[a]=!0})):c.log={}}window.WebComponents.flags=c;if(a=c.shadydom)window.ShadyDOM=window.ShadyDOM||
+{},window.ShadyDOM.force=a;(a=c.register||c.ce)&&window.customElements&&(window.customElements.forcePolyfill=a)})();var C=window.ShadyDOM||{};C.ob=!(!Element.prototype.attachShadow||!Node.prototype.getRootNode);var eb=Object.getOwnPropertyDescriptor(Node.prototype,"firstChild");C.V=!!(eb&&eb.configurable&&eb.get);C.Ia=C.force||!C.ob;var Y=Element.prototype,Mc=Y.matches||Y.matchesSelector||Y.mozMatchesSelector||Y.msMatchesSelector||Y.oMatchesSelector||Y.webkitMatchesSelector,Ma=document.createTextNode(""),
+Hb=0,La=[];(new MutationObserver(function(){for(;La.length;)try{La.shift()()}catch(a){throw Ma.textContent=Hb++,a;}})).observe(Ma,{characterData:!0});var aa=[],Na;na.list=aa;ma.prototype.wb=function(){var a=this;this.a||(this.a=!0,Gb(function(){a.b()}))};ma.prototype.b=function(){if(this.a){this.a=!1;var a=this.takeRecords();a.length&&this.ba.forEach(function(b){b(a)})}};ma.prototype.takeRecords=function(){if(this.addedNodes.length||this.removedNodes.length){var a=[{addedNodes:this.addedNodes,removedNodes:this.removedNodes}];
+this.addedNodes=[];this.removedNodes=[];return a}return[]};var Yb=Element.prototype.appendChild,Ua=Element.prototype.insertBefore,ba=Element.prototype.removeChild,fc=Element.prototype.setAttribute,Nc=Element.prototype.removeAttribute,fb=Element.prototype.cloneNode,Va=Document.prototype.importNode,nc=Element.prototype.addEventListener,qc=Element.prototype.removeEventListener,mc=Window.prototype.addEventListener,pc=Window.prototype.removeEventListener,gb=Element.prototype.dispatchEvent,Qd=Object.freeze({appendChild:Yb,
+insertBefore:Ua,removeChild:ba,setAttribute:fc,removeAttribute:Nc,cloneNode:fb,importNode:Va,addEventListener:nc,removeEventListener:qc,Kb:mc,Lb:pc,dispatchEvent:gb,querySelector:Element.prototype.querySelector,querySelectorAll:Element.prototype.querySelectorAll}),td=/[&\u00A0"]/g,wd=/[&\u00A0<>]/g,ud=Kb("area base br col command embed hr img input keygen link meta param source track wbr".split(" ")),vd=Kb("style script xmp iframe noembed noframes plaintext noscript".split(" ")),F=document.createTreeWalker(document,
+NodeFilter.SHOW_ALL,null,!1),x=document.createTreeWalker(document,NodeFilter.SHOW_ELEMENT,null,!1),Rd=Object.freeze({parentNode:U,firstChild:Ha,lastChild:Ia,previousSibling:Lb,nextSibling:Mb,childNodes:S,parentElement:Nb,firstElementChild:Ob,lastElementChild:Pb,previousElementSibling:Qb,nextElementSibling:Rb,children:Sb,innerHTML:Tb,textContent:Ub}),hb=Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML")||Object.getOwnPropertyDescriptor(HTMLElement.prototype,"innerHTML"),ta=document.implementation.createHTMLDocument("inert").createElement("div"),
+ib=Object.getOwnPropertyDescriptor(Document.prototype,"activeElement"),Vb={parentElement:{get:function(){var a=this.__shady&&this.__shady.parentNode;a&&a.nodeType!==Node.ELEMENT_NODE&&(a=null);return void 0!==a?a:Nb(this)},configurable:!0},parentNode:{get:function(){var a=this.__shady&&this.__shady.parentNode;return void 0!==a?a:U(this)},configurable:!0},nextSibling:{get:function(){var a=this.__shady&&this.__shady.nextSibling;return void 0!==a?a:Mb(this)},configurable:!0},previousSibling:{get:function(){var a=
+this.__shady&&this.__shady.previousSibling;return void 0!==a?a:Lb(this)},configurable:!0},className:{get:function(){return this.getAttribute("class")||""},set:function(a){this.setAttribute("class",a)},configurable:!0},nextElementSibling:{get:function(){if(this.__shady&&void 0!==this.__shady.nextSibling){for(var a=this.nextSibling;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.nextSibling;return a}return Rb(this)},configurable:!0},previousElementSibling:{get:function(){if(this.__shady&&void 0!==this.__shady.previousSibling){for(var a=
+this.previousSibling;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.previousSibling;return a}return Qb(this)},configurable:!0}},Pa={childNodes:{get:function(){if(T(this)){if(!this.__shady.childNodes){this.__shady.childNodes=[];for(var a=this.firstChild;a;a=a.nextSibling)this.__shady.childNodes.push(a)}var b=this.__shady.childNodes}else b=S(this);b.item=function(a){return b[a]};return b},configurable:!0},childElementCount:{get:function(){return this.children.length},configurable:!0},firstChild:{get:function(){var a=
+this.__shady&&this.__shady.firstChild;return void 0!==a?a:Ha(this)},configurable:!0},lastChild:{get:function(){var a=this.__shady&&this.__shady.lastChild;return void 0!==a?a:Ia(this)},configurable:!0},textContent:{get:function(){if(T(this)){for(var a=[],b=0,c=this.childNodes,d;d=c[b];b++)d.nodeType!==Node.COMMENT_NODE&&a.push(d.textContent);return a.join("")}return Ub(this)},set:function(a){switch(this.nodeType){case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:for(;this.firstChild;)this.removeChild(this.firstChild);
+this.appendChild(document.createTextNode(a));break;default:this.nodeValue=a}},configurable:!0},firstElementChild:{get:function(){if(this.__shady&&void 0!==this.__shady.firstChild){for(var a=this.firstChild;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.nextSibling;return a}return Ob(this)},configurable:!0},lastElementChild:{get:function(){if(this.__shady&&void 0!==this.__shady.lastChild){for(var a=this.lastChild;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.previousSibling;return a}return Pb(this)},configurable:!0},
+children:{get:function(){var a;T(this)?a=Array.prototype.filter.call(this.childNodes,function(a){return a.nodeType===Node.ELEMENT_NODE}):a=Sb(this);a.item=function(b){return a[b]};return a},configurable:!0},innerHTML:{get:function(){var a="template"===this.localName?this.content:this;return T(this)?Oa(a):Tb(a)},set:function(a){for(var b="template"===this.localName?this.content:this;b.firstChild;)b.removeChild(b.firstChild);for(hb&&hb.set?hb.set.call(ta,a):ta.innerHTML=a;ta.firstChild;)b.appendChild(ta.firstChild)},
+configurable:!0}},Oc={shadowRoot:{get:function(){return this.__shady&&this.__shady.tb||null},configurable:!0}},Qa={activeElement:{get:function(){var a=ib&&ib.get?ib.get.call(document):C.V?void 0:document.activeElement;if(a&&a.nodeType){var b=!!L(this);if(this===document||b&&this.host!==a&&this.host.contains(a)){for(b=Z(a);b&&b!==this;)a=b.host,b=Z(a);a=this===document?b?null:a:b===this?a:null}else a=null}else a=null;return a},set:function(){},configurable:!0}},Fb=C.V?function(){}:function(a){a.__shady&&
+a.__shady.Xa||(a.__shady=a.__shady||{},a.__shady.Xa=!0,M(a,Vb,!0))},Eb=C.V?function(){}:function(a){a.__shady&&a.__shady.Va||(a.__shady=a.__shady||{},a.__shady.Va=!0,M(a,Pa,!0),M(a,Oc,!0))},pa=null,Sd={blur:!0,focus:!0,focusin:!0,focusout:!0,click:!0,dblclick:!0,mousedown:!0,mouseenter:!0,mouseleave:!0,mousemove:!0,mouseout:!0,mouseover:!0,mouseup:!0,wheel:!0,beforeinput:!0,input:!0,keydown:!0,keyup:!0,compositionstart:!0,compositionupdate:!0,compositionend:!0,touchstart:!0,touchend:!0,touchmove:!0,
+touchcancel:!0,pointerover:!0,pointerenter:!0,pointerdown:!0,pointermove:!0,pointerup:!0,pointercancel:!0,pointerout:!0,pointerleave:!0,gotpointercapture:!0,lostpointercapture:!0,dragstart:!0,drag:!0,dragenter:!0,dragleave:!0,dragover:!0,drop:!0,dragend:!0,DOMActivate:!0,DOMFocusIn:!0,DOMFocusOut:!0,keypress:!0},rc={get composed(){!1!==this.isTrusted&&void 0===this.ja&&(this.ja=Sd[this.type]);return this.ja||!1},composedPath:function(){this.ya||(this.ya=Wa(this.__target,this.composed));return this.ya},
+get target(){return hc(this.currentTarget,this.composedPath())},get relatedTarget(){if(!this.za)return null;this.Aa||(this.Aa=Wa(this.za,!0));return hc(this.currentTarget,this.Aa)},stopPropagation:function(){Event.prototype.stopPropagation.call(this);this.ka=!0},stopImmediatePropagation:function(){Event.prototype.stopImmediatePropagation.call(this);this.ka=this.Ua=!0}},Ya={focus:!0,blur:!0},Td=Xa(window.Event),Ud=Xa(window.CustomEvent),Vd=Xa(window.MouseEvent),Db={};l.prototype=Object.create(DocumentFragment.prototype);
+l.prototype.D=function(a,b){this.Wa="ShadyRoot";la(a);la(this);this.host=a;this.L=b&&b.mode;a.__shady=a.__shady||{};a.__shady.root=this;a.__shady.tb="closed"!==this.L?this:null;this.S=!1;this.b=[];this.a=null;b=S(a);for(var c=0,d=b.length;c<d;c++)ba.call(a,b[c])};l.prototype.M=function(){var a=this;this.S||(this.S=!0,Ib(function(){return a.Ea()}))};l.prototype.C=function(){for(var a=this,b=this;b;)b.S&&(a=b),b=b.hb();return a};l.prototype.hb=function(){var a=this.host.getRootNode();if(L(a))for(var b=
+this.host.childNodes,c=0,d;c<b.length;c++)if(d=b[c],this.h(d))return a};l.prototype.Ea=function(){this.S&&this.C()._renderRoot()};l.prototype._renderRoot=function(){this.S=!1;this.v();this.s()};l.prototype.v=function(){for(var a=0,b;a<this.b.length;a++)b=this.b[a],this.l(b);for(b=this.host.firstChild;b;b=b.nextSibling)this.f(b);for(a=0;a<this.b.length;a++){b=this.b[a];if(!b.__shady.assignedNodes.length)for(var c=b.firstChild;c;c=c.nextSibling)this.f(c,b);c=b.parentNode;(c=c.__shady&&c.__shady.root)&&
+c.Ba()&&c._renderRoot();this.c(b.__shady.U,b.__shady.assignedNodes);if(c=b.__shady.Da){for(var d=0;d<c.length;d++)c[d].__shady.na=null;b.__shady.Da=null;c.length>b.__shady.assignedNodes.length&&(b.__shady.qa=!0)}b.__shady.qa&&(b.__shady.qa=!1,this.g(b))}};l.prototype.f=function(a,b){a.__shady=a.__shady||{};var c=a.__shady.na;a.__shady.na=null;b||(b=(b=this.a[a.slot||"__catchall"])&&b[0]);b?(b.__shady.assignedNodes.push(a),a.__shady.assignedSlot=b):a.__shady.assignedSlot=void 0;c!==a.__shady.assignedSlot&&
+a.__shady.assignedSlot&&(a.__shady.assignedSlot.__shady.qa=!0)};l.prototype.l=function(a){var b=a.__shady.assignedNodes;a.__shady.assignedNodes=[];a.__shady.U=[];if(a.__shady.Da=b)for(var c=0;c<b.length;c++){var d=b[c];d.__shady.na=d.__shady.assignedSlot;d.__shady.assignedSlot===a&&(d.__shady.assignedSlot=null)}};l.prototype.c=function(a,b){for(var c=0,d;c<b.length&&(d=b[c]);c++)"slot"==d.localName?this.c(a,d.__shady.assignedNodes):a.push(b[c])};l.prototype.g=function(a){gb.call(a,new Event("slotchange"));
+a.__shady.assignedSlot&&this.g(a.__shady.assignedSlot)};l.prototype.s=function(){for(var a=this.b,b=[],c=0;c<a.length;c++){var d=a[c].parentNode;d.__shady&&d.__shady.root||!(0>b.indexOf(d))||b.push(d)}for(a=0;a<b.length;a++)c=b[a],this.I(c===this?this.host:c,this.u(c))};l.prototype.u=function(a){var b=[];a=a.childNodes;for(var c=0;c<a.length;c++){var d=a[c];if(this.h(d)){d=d.__shady.U;for(var e=0;e<d.length;e++)b.push(d[e])}else b.push(d)}return b};l.prototype.h=function(a){return"slot"==a.localName};
+l.prototype.I=function(a,b){for(var c=S(a),d=zd(b,b.length,c,c.length),e=0,f=0,g;e<d.length&&(g=d[e]);e++){for(var h=0,k;h<g.X.length&&(k=g.X[h]);h++)U(k)===a&&ba.call(a,k),c.splice(g.index+f,1);f-=g.aa}for(e=0;e<d.length&&(g=d[e]);e++)for(f=c[g.index],h=g.index;h<g.index+g.aa;h++)k=b[h],Ua.call(a,k,f),c.splice(h,0,k)};l.prototype.$a=function(a){this.a=this.a||{};this.b=this.b||[];for(var b=0;b<a.length;b++){var c=a[b];c.__shady=c.__shady||{};la(c);la(c.parentNode);var d=this.i(c);if(this.a[d]){var e=
+e||{};e[d]=!0;this.a[d].push(c)}else this.a[d]=[c];this.b.push(c)}if(e)for(var f in e)this.a[f]=this.j(this.a[f])};l.prototype.i=function(a){var b=a.name||a.getAttribute("name")||"__catchall";return a.Ya=b};l.prototype.j=function(a){return a.sort(function(a,c){a=sc(a);for(var b=sc(c),e=0;e<a.length;e++){c=a[e];var f=b[e];if(c!==f)return a=Array.from(c.parentNode.childNodes),a.indexOf(c)-a.indexOf(f)}})};l.prototype.gb=function(a){this.a=this.a||{};this.b=this.b||[];var b=this.a,c;for(c in b)for(var d=
+b[c],e=0;e<d.length;e++){var f=d[e],g;a:{for(g=f;g;){if(g==a){g=!0;break a}g=g.parentNode}g=void 0}if(g){d.splice(e,1);var h=this.b.indexOf(f);0<=h&&this.b.splice(h,1);e--;this.H(f);h=!0}}return h};l.prototype.ib=function(a){var b=a.Ya,c=this.i(a);if(c!==b){b=this.a[b];var d=b.indexOf(a);0<=d&&b.splice(d,1);b=this.a[c]||(this.a[c]=[]);b.push(a);1<b.length&&(this.a[c]=this.j(b))}};l.prototype.H=function(a){if(a=a.__shady.U)for(var b=0;b<a.length;b++){var c=a[b],d=U(c);d&&ba.call(d,c)}};l.prototype.Ba=
+function(){return!!this.b.length};l.prototype.addEventListener=function(a,b,c){"object"!==typeof c&&(c={capture:!!c});c.la=this;this.host.addEventListener(a,b,c)};l.prototype.removeEventListener=function(a,b,c){"object"!==typeof c&&(c={capture:!!c});c.la=this;this.host.removeEventListener(a,b,c)};l.prototype.getElementById=function(a){return oa(this,function(b){return b.id==a},function(a){return!!a})[0]||null};(function(a){M(a,Pa,!0);M(a,Qa,!0)})(l.prototype);var Dd={addEventListener:kc.bind(window),
+removeEventListener:oc.bind(window)},Cd={addEventListener:kc,removeEventListener:oc,appendChild:function(a){return Ra(this,a)},insertBefore:function(a,b){return Ra(this,a,b)},removeChild:function(a){return Sa(this,a)},replaceChild:function(a,b){Ra(this,a,b);Sa(this,b);return a},cloneNode:function(a){if("template"==this.localName)var b=fb.call(this,a);else if(b=fb.call(this,!1),a){a=this.childNodes;for(var c=0,d;c<a.length;c++)d=a[c].cloneNode(!0),b.appendChild(d)}return b},getRootNode:function(){return bc(this)},
+get isConnected(){var a=this.ownerDocument;if(a&&a.contains&&a.contains(this)||(a=a.documentElement)&&a.contains&&a.contains(this))return!0;for(a=this;a&&!(a instanceof Document);)a=a.parentNode||(a instanceof l?a.host:void 0);return!!(a&&a instanceof Document)},dispatchEvent:function(a){na();return gb.call(this,a)}},Ed={get assignedSlot(){return tc(this)}},Za={querySelector:function(a){return oa(this,function(b){return Mc.call(b,a)},function(a){return!!a})[0]||null},querySelectorAll:function(a){return oa(this,
+function(b){return Mc.call(b,a)})}},wc={assignedNodes:function(a){if("slot"===this.localName)return dc(this),this.__shady?(a&&a.flatten?this.__shady.U:this.__shady.assignedNodes)||[]:[]}},uc=Ka({setAttribute:function(a,b){ec(this,a,b)},removeAttribute:function(a){Nc.call(this,a);ac(this,a)},attachShadow:function(a){if(!this)throw"Must provide a host.";if(!a)throw"Not enough arguments.";return new l(Db,this,a)},get slot(){return this.getAttribute("slot")},set slot(a){ec(this,"slot",a)},get assignedSlot(){return tc(this)}},
+Za,wc);Object.defineProperties(uc,Oc);var vc=Ka({importNode:function(a,b){return gc(a,b)},getElementById:function(a){return oa(this,function(b){return b.id==a},function(a){return!!a})[0]||null}},Za);Object.defineProperties(vc,{_activeElement:Qa.activeElement});var Wd=HTMLElement.prototype.blur,Fd=Ka({blur:function(){var a=this.__shady&&this.__shady.root;(a=a&&a.activeElement)?a.blur():Wd.call(this)}});C.Ia&&(window.ShadyDOM={inUse:C.Ia,patch:function(a){return a},isShadyRoot:L,enqueue:Ib,flush:na,
+settings:C,filterMutations:sd,observeChildren:qd,unobserveChildren:pd,nativeMethods:Qd,nativeTree:Rd},window.Event=Td,window.CustomEvent=Ud,window.MouseEvent=Vd,yd(),Bd(),window.ShadowRoot=l);var Gd=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" "));A.prototype.D=function(a,b){this.s.set(a,b);this.l.set(b.constructor,b)};A.prototype.f=function(a){return this.s.get(a)};A.prototype.C=function(a){return this.l.get(a)};
+A.prototype.u=function(a){this.h=!0;this.i.push(a)};A.prototype.j=function(a){var b=this;this.h&&J(a,function(a){return b.g(a)})};A.prototype.g=function(a){if(this.h&&!a.__CE_patched){a.__CE_patched=!0;for(var b=0;b<this.i.length;b++)this.i[b](a)}};A.prototype.b=function(a){var b=[];J(a,function(a){return b.push(a)});for(a=0;a<b.length;a++){var c=b[a];1===c.__CE_state?this.connectedCallback(c):this.v(c)}};A.prototype.a=function(a){var b=[];J(a,function(a){return b.push(a)});for(a=0;a<b.length;a++){var c=
+b[a];1===c.__CE_state&&this.disconnectedCallback(c)}};A.prototype.c=function(a,b){var c=this;b=b?b:new Set;var d=[];J(a,function(a){if("link"===a.localName&&"import"===a.getAttribute("rel")){var e=a.import;e instanceof Node&&"complete"===e.readyState?(e.__CE_isImportDocument=!0,e.__CE_hasRegistry=!0):a.addEventListener("load",function(){var d=a.import;d.__CE_documentLoadHandled||(d.__CE_documentLoadHandled=!0,d.__CE_isImportDocument=!0,d.__CE_hasRegistry=!0,b.delete(d),c.c(d,b))})}else d.push(a)},
+b);if(this.h)for(a=0;a<d.length;a++)this.g(d[a]);for(a=0;a<d.length;a++)this.v(d[a])};A.prototype.v=function(a){if(void 0===a.__CE_state){var b=this.f(a.localName);if(b){b.constructionStack.push(a);var c=b.constructor;try{try{if(new c!==a)throw Error("The custom element constructor did not produce the element being upgraded.");}finally{b.constructionStack.pop()}}catch(f){throw a.__CE_state=2,f;}a.__CE_state=1;a.__CE_definition=b;if(b.attributeChangedCallback)for(b=b.observedAttributes,c=0;c<b.length;c++){var d=
+b[c],e=a.getAttribute(d);null!==e&&this.attributeChangedCallback(a,d,null,e,null)}m(a)&&this.connectedCallback(a)}}};A.prototype.connectedCallback=function(a){var b=a.__CE_definition;b.connectedCallback&&b.connectedCallback.call(a)};A.prototype.disconnectedCallback=function(a){var b=a.__CE_definition;b.disconnectedCallback&&b.disconnectedCallback.call(a)};A.prototype.attributeChangedCallback=function(a,b,c,d,e){var f=a.__CE_definition;f.attributeChangedCallback&&-1<f.observedAttributes.indexOf(b)&&
+f.attributeChangedCallback.call(a,b,c,d,e)};Ga.prototype.c=function(){this.N&&this.N.disconnect()};Ga.prototype.f=function(a){var b=this.a.readyState;"interactive"!==b&&"complete"!==b||this.c();for(b=0;b<a.length;b++)for(var c=a[b].addedNodes,d=0;d<c.length;d++)this.b.c(c[d])};Cb.prototype.resolve=function(a){if(this.a)throw Error("Already resolved.");this.a=a;this.b&&this.b(a)};B.prototype.define=function(a,b){var c=this;if(!(b instanceof Function))throw new TypeError("Custom element constructors must be functions.");
+if(!xc(a))throw new SyntaxError("The element name '"+a+"' is not valid.");if(this.a.f(a))throw Error("A custom element with name '"+a+"' has already been defined.");if(this.f)throw Error("A custom element is already being defined.");this.f=!0;try{var d=function(a){var b=e[a];if(void 0!==b&&!(b instanceof Function))throw Error("The '"+a+"' callback must be a function.");return b},e=b.prototype;if(!(e instanceof Object))throw new TypeError("The custom element constructor's prototype is not an object.");
+var f=d("connectedCallback");var g=d("disconnectedCallback");var h=d("adoptedCallback");var k=d("attributeChangedCallback");var l=b.observedAttributes||[]}catch(le){return}finally{this.f=!1}this.a.D(a,{localName:a,constructor:b,connectedCallback:f,disconnectedCallback:g,adoptedCallback:h,attributeChangedCallback:k,observedAttributes:l,constructionStack:[]});this.c.push(a);this.b||(this.b=!0,this.g(function(){return c.j()}))};B.prototype.j=function(){if(!1!==this.b)for(this.b=!1,this.a.c(document);0<
+this.c.length;){var a=this.c.shift();(a=this.h.get(a))&&a.resolve(void 0)}};B.prototype.get=function(a){if(a=this.a.f(a))return a.constructor};B.prototype.whenDefined=function(a){if(!xc(a))return Promise.reject(new SyntaxError("'"+a+"' is not a valid custom element name."));var b=this.h.get(a);if(b)return b.c;b=new Cb;this.h.set(a,b);this.a.f(a)&&-1===this.c.indexOf(a)&&b.resolve(void 0);return b.c};B.prototype.l=function(a){this.i.c();var b=this.g;this.g=function(c){return a(function(){return b(c)})}};
+window.CustomElementRegistry=B;B.prototype.define=B.prototype.define;B.prototype.get=B.prototype.get;B.prototype.whenDefined=B.prototype.whenDefined;B.prototype.polyfillWrapFlushCallback=B.prototype.l;var Ca=window.Document.prototype.createElement,kd=window.Document.prototype.createElementNS,jd=window.Document.prototype.importNode,ld=window.Document.prototype.prepend,md=window.Document.prototype.append,rb=window.Node.prototype.cloneNode,ja=window.Node.prototype.appendChild,zb=window.Node.prototype.insertBefore,
+Da=window.Node.prototype.removeChild,Ab=window.Node.prototype.replaceChild,Fa=Object.getOwnPropertyDescriptor(window.Node.prototype,"textContent"),qb=window.Element.prototype.attachShadow,Aa=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),Ea=window.Element.prototype.getAttribute,sb=window.Element.prototype.setAttribute,ub=window.Element.prototype.removeAttribute,ka=window.Element.prototype.getAttributeNS,tb=window.Element.prototype.setAttributeNS,vb=window.Element.prototype.removeAttributeNS,
+xb=window.Element.prototype.insertAdjacentElement,ad=window.Element.prototype.prepend,bd=window.Element.prototype.append,dd=window.Element.prototype.before,ed=window.Element.prototype.after,fd=window.Element.prototype.replaceWith,gd=window.Element.prototype.remove,od=window.HTMLElement,Ba=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),wb=window.HTMLElement.prototype.insertAdjacentElement,Bb=new function(){},ua=window.customElements;if(!ua||ua.forcePolyfill||"function"!=
+typeof ua.define||"function"!=typeof ua.get){var ea=new A;nd(ea);id(ea);hd(ea);$c(ea);document.__CE_hasRegistry=!0;var Xd=new B(ea);Object.defineProperty(window,"customElements",{configurable:!0,enumerable:!0,value:Xd})}var O={STYLE_RULE:1,ia:7,MEDIA_RULE:4,va:1E3},G={mb:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,Fa:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,Ja:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,sb:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,yb:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,
+rb:/^@[^\s]*keyframes/,Ka:/\s+/g},w=!(window.ShadyDOM&&window.ShadyDOM.inUse);if(window.ShadyCSS&&void 0!==window.ShadyCSS.nativeCss)var q=window.ShadyCSS.nativeCss;else window.ShadyCSS?(Ac(window.ShadyCSS),window.ShadyCSS=void 0):Ac(window.WebComponents&&window.WebComponents.flags);var va=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi,wa=/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi,Yd=/(--[\w-]+)\s*([:,;)]|$)/gi,Zd=/(animation\s*:)|(animation-name\s*:)/,
+Id=/@media\s(.*)/,$d=/\{[^}]*\}/g,P=null;r.prototype.a=function(a,b,c){a.__styleScoped?a.__styleScoped=null:this.i(a,b||"",c)};r.prototype.i=function(a,b,c){a.nodeType===Node.ELEMENT_NODE&&this.v(a,b,c);if(a="template"===a.localName?(a.content||a.Cb).childNodes:a.children||a.childNodes)for(var d=0;d<a.length;d++)this.i(a[d],b,c)};r.prototype.v=function(a,b,c){if(b)if(a.classList)c?(a.classList.remove("style-scope"),a.classList.remove(b)):(a.classList.add("style-scope"),a.classList.add(b));else if(a.getAttribute){var d=
+a.getAttribute(ae);c?d&&(b=d.replace("style-scope","").replace(b,""),ra(a,b)):ra(a,(d?d+" ":"")+"style-scope "+b)}};r.prototype.b=function(a,b,c){var d=a.__cssBuild;w||"shady"===d?b=V(b,c):(a=Q(a),b=this.H(b,a.is,a.Y,c)+"\n\n");return b.trim()};r.prototype.H=function(a,b,c,d){var e=this.f(b,c);b=this.h(b);var f=this;return V(a,function(a){a.c||(f.R(a,b,e),a.c=!0);d&&d(a,b,e)})};r.prototype.h=function(a){return a?be+a:""};r.prototype.f=function(a,b){return b?"[is="+a+"]":a};r.prototype.R=function(a,
+b,c){this.j(a,this.g,b,c)};r.prototype.j=function(a,b,c,d){a.selector=a.A=this.l(a,b,c,d)};r.prototype.l=function(a,b,c,d){var e=a.selector.split(Pc);if(!Bc(a)){a=0;for(var f=e.length,g;a<f&&(g=e[a]);a++)e[a]=b.call(this,g,c,d)}return e.join(Pc)};r.prototype.g=function(a,b,c){var d=this,e=!1;a=a.trim();a=a.replace(ce,function(a,b,c){return":"+b+"("+c.replace(/\s/g,"")+")"});a=a.replace(de,jb+" $1");return a=a.replace(ee,function(a,g,h){e||(a=d.C(h,g,b,c),e=e||a.stop,g=a.lb,h=a.value);return g+h})};
+r.prototype.C=function(a,b,c,d){var e=a.indexOf(kb);0<=a.indexOf(jb)?a=this.L(a,d):0!==e&&(a=c?this.s(a,c):a);c=!1;0<=e&&(b="",c=!0);if(c){var f=!0;c&&(a=a.replace(fe,function(a,b){return" > "+b}))}a=a.replace(ge,function(a,b,c){return'[dir="'+c+'"] '+b+", "+b+'[dir="'+c+'"]'});return{value:a,lb:b,stop:f}};r.prototype.s=function(a,b){a=a.split(Qc);a[0]+=b;return a.join(Qc)};r.prototype.L=function(a,b){var c=a.match(Rc);return(c=c&&c[2].trim()||"")?c[0].match(Sc)?a.replace(Rc,function(a,c,f){return b+
+f}):c.split(Sc)[0]===b?c:he:a.replace(jb,b)};r.prototype.I=function(a){a.selector=a.parsedSelector;this.u(a);this.j(a,this.D)};r.prototype.u=function(a){a.selector===ie&&(a.selector="html")};r.prototype.D=function(a){return a.match(kb)?this.g(a,Tc):this.s(a.trim(),Tc)};nb.Object.defineProperties(r.prototype,{c:{configurable:!0,enumerable:!0,get:function(){return"style-scope"}}});var ce=/:(nth[-\w]+)\(([^)]+)\)/,Tc=":not(.style-scope)",Pc=",",ee=/(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=[])+)/g,Sc=/[[.:#*]/,
+jb=":host",ie=":root",kb="::slotted",de=new RegExp("^("+kb+")"),Rc=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,fe=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,ge=/(.*):dir\((?:(ltr|rtl))\)/,be=".",Qc=":",ae="class",he="should_not_match",v=new r;t.get=function(a){return a?a.__styleInfo:null};t.set=function(a,b){return a.__styleInfo=b};t.prototype.c=function(){return this.G};t.prototype._getStyleRules=t.prototype.c;var Uc=function(a){return a.matches||a.matchesSelector||a.mozMatchesSelector||a.msMatchesSelector||
+a.oMatchesSelector||a.webkitMatchesSelector}(window.Element.prototype),je=navigator.userAgent.match("Trident");p.prototype.R=function(a){var b=this,c={},d=[],e=0;W(a,function(a){b.c(a);a.index=e++;b.I(a.w.cssText,c)},function(a){d.push(a)});a.b=d;a=[];for(var f in c)a.push(f);return a};p.prototype.c=function(a){if(!a.w){var b={},c={};this.b(a,c)&&(b.F=c,a.rules=null);b.cssText=this.H(a);a.w=b}};p.prototype.b=function(a,b){var c=a.w;if(c){if(c.F)return Object.assign(b,c.F),!0}else{c=a.parsedCssText;
+for(var d;a=va.exec(c);){d=(a[2]||a[3]).trim();if("inherit"!==d||"unset"!==d)b[a[1].trim()]=d;d=!0}return d}};p.prototype.H=function(a){return this.L(a.parsedCssText)};p.prototype.L=function(a){return a.replace($d,"").replace(va,"")};p.prototype.I=function(a,b){for(var c;c=Yd.exec(a);){var d=c[1];":"!==c[2]&&(b[d]=!0)}};p.prototype.fa=function(a){for(var b=Object.getOwnPropertyNames(a),c=0,d;c<b.length;c++)d=b[c],a[d]=this.a(a[d],a)};p.prototype.a=function(a,b){if(a)if(0<=a.indexOf(";"))a=this.f(a,
+b);else{var c=this;a=Dc(a,function(a,e,f,g){if(!e)return a+g;(e=c.a(b[e],b))&&"initial"!==e?"apply-shim-inherit"===e&&(e="inherit"):e=c.a(b[f]||f,b)||f;return a+(e||"")+g})}return a&&a.trim()||""};p.prototype.f=function(a,b){a=a.split(";");for(var c=0,d,e;c<a.length;c++)if(d=a[c]){wa.lastIndex=0;if(e=wa.exec(d))d=this.a(b[e[1]],b);else if(e=d.indexOf(":"),-1!==e){var f=d.substring(e);f=f.trim();f=this.a(f,b)||f;d=d.substring(0,e)+f}a[c]=d&&d.lastIndexOf(";")===d.length-1?d.slice(0,-1):d||""}return a.join(";")};
+p.prototype.D=function(a,b){var c="";a.w||this.c(a);a.w.cssText&&(c=this.f(a.w.cssText,b));a.cssText=c};p.prototype.C=function(a,b){var c=a.cssText,d=a.cssText;null==a.Ha&&(a.Ha=Zd.test(c));if(a.Ha)if(null==a.ca){a.ca=[];for(var e in b)d=b[e],d=d(c),c!==d&&(c=d,a.ca.push(e))}else{for(e=0;e<a.ca.length;++e)d=b[a.ca[e]],c=d(c);d=c}a.cssText=d};p.prototype.ea=function(a,b){var c={},d=this,e=[];W(a,function(a){a.w||d.c(a);var f=a.A||a.parsedSelector;b&&a.w.F&&f&&Uc.call(b,f)&&(d.b(a,c),a=a.index,f=parseInt(a/
+32,10),e[f]=(e[f]||0)|1<<a%32)},null,!0);return{F:c,key:e}};p.prototype.ha=function(a,b,c,d){b.w||this.c(b);if(b.w.F){var e=Q(a);a=e.is;e=e.Y;e=a?v.f(a,e):"html";var f=b.parsedSelector,g=":host > *"===f||"html"===f,h=0===f.indexOf(":host")&&!g;"shady"===c&&(g=f===e+" > *."+e||-1!==f.indexOf("html"),h=!g&&0===f.indexOf(e));"shadow"===c&&(g=":host > *"===f||"html"===f,h=h&&!g);if(g||h)c=e,h&&(w&&!b.A&&(b.A=v.l(b,v.g,v.h(a),e)),c=b.A||e),d({xb:c,qb:h,Gb:g})}};p.prototype.da=function(a,b){var c={},d=
+{},e=this,f=b&&b.__cssBuild;W(b,function(b){e.ha(a,b,f,function(f){Uc.call(a.Db||a,f.xb)&&(f.qb?e.b(b,c):e.b(b,d))})},null,!0);return{vb:d,pb:c}};p.prototype.ga=function(a,b,c){var d=this,e=Q(a),f=v.f(e.is,e.Y),g=new RegExp("(?:^|[^.#[:])"+(a.extends?"\\"+f.slice(0,-1)+"\\]":f)+"($|[.:[\\s>+~])");e=t.get(a).G;var h=this.h(e,c);return v.b(a,e,function(a){d.D(a,b);w||Bc(a)||!a.cssText||(d.C(a,h),d.l(a,g,f,c))})};p.prototype.h=function(a,b){a=a.b;var c={};if(!w&&a)for(var d=0,e=a[d];d<a.length;e=a[++d])this.j(e,
+b),c[e.keyframesName]=this.i(e);return c};p.prototype.i=function(a){return function(b){return b.replace(a.f,a.a)}};p.prototype.j=function(a,b){a.f=new RegExp(a.keyframesName,"g");a.a=a.keyframesName+"-"+b;a.A=a.A||a.selector;a.selector=a.A.replace(a.keyframesName,a.a)};p.prototype.l=function(a,b,c,d){a.A=a.A||a.selector;d="."+d;for(var e=a.A.split(","),f=0,g=e.length,h;f<g&&(h=e[f]);f++)e[f]=h.match(b)?h.replace(c,d):d+" "+h;a.selector=e.join(",")};p.prototype.u=function(a,b,c){var d=a.getAttribute("class")||
+"",e=d;c&&(e=d.replace(new RegExp("\\s*x-scope\\s*"+c+"\\s*","g")," "));e+=(e?" ":"")+"x-scope "+b;d!==e&&ra(a,e)};p.prototype.v=function(a,b,c,d){b=d?d.textContent||"":this.ga(a,b,c);var e=t.get(a),f=e.a;f&&!w&&f!==d&&(f._useCount--,0>=f._useCount&&f.parentNode&&f.parentNode.removeChild(f));w?e.a?(e.a.textContent=b,d=e.a):b&&(d=bb(b,c,a.shadowRoot,e.b)):d?d.parentNode||(je&&-1<b.indexOf("@media")&&(d.textContent=b),Cc(d,null,e.b)):b&&(d=bb(b,c,null,e.b));d&&(d._useCount=d._useCount||0,e.a!=d&&d._useCount++,
+e.a=d);return d};p.prototype.s=function(a,b){var c=qa(a),d=this;a.textContent=V(c,function(a){var c=a.cssText=a.parsedCssText;a.w&&a.w.cssText&&(c=c.replace(G.Fa,"").replace(G.Ja,""),a.cssText=d.f(c,b))})};nb.Object.defineProperties(p.prototype,{g:{configurable:!0,enumerable:!0,get:function(){return"x-scope"}}});var K=new p,lb={},xa=window.customElements;if(xa&&!w){var ke=xa.define;xa.define=function(a,b,c){var d=document.createComment(" Shady DOM styles for "+a+" "),e=document.head;e.insertBefore(d,
+(P?P.nextSibling:null)||e.firstChild);P=d;lb[a]=d;return ke.call(xa,a,b,c)}}ha.prototype.a=function(a,b,c){for(var d=0;d<c.length;d++){var e=c[d];if(a.F[e]!==b[e])return!1}return!0};ha.prototype.b=function(a,b,c,d){var e=this.cache[a]||[];e.push({F:b,styleElement:c,B:d});e.length>this.c&&e.shift();this.cache[a]=e};ha.prototype.fetch=function(a,b,c){if(a=this.cache[a])for(var d=a.length-1;0<=d;d--){var e=a[d];if(this.a(e,b,c))return e}};if(!w){var Vc=new MutationObserver(Ec),Wc=function(a){Vc.observe(a,
+{childList:!0,subtree:!0})};if(window.customElements&&!window.customElements.polyfillWrapFlushCallback)Wc(document);else{var mb=function(){Wc(document.body)};window.HTMLImports?window.HTMLImports.whenReady(mb):requestAnimationFrame(function(){if("loading"===document.readyState){var a=function(){mb();document.removeEventListener("readystatechange",a)};document.addEventListener("readystatechange",a)}else mb()})}pb=function(){Ec(Vc.takeRecords())}}var sa={},Ld=Promise.resolve(),cb=null,Gc=window.HTMLImports&&
+window.HTMLImports.whenReady||null,db,ya=null,fa=null;H.prototype.Ga=function(){!this.enqueued&&fa&&(this.enqueued=!0,ob(fa))};H.prototype.b=function(a){a.__seenByShadyCSS||(a.__seenByShadyCSS=!0,this.customStyles.push(a),this.Ga())};H.prototype.a=function(a){return a.__shadyCSSCachedStyle?a.__shadyCSSCachedStyle:a.getStyle?a.getStyle():a};H.prototype.c=function(){for(var a=this.customStyles,b=0;b<a.length;b++){var c=a[b];if(!c.__shadyCSSCachedStyle){var d=this.a(c);d&&(d=d.__appliedElement||d,ya&&
+ya(d),c.__shadyCSSCachedStyle=d)}}return a};H.prototype.addCustomStyle=H.prototype.b;H.prototype.getStyleForCustomStyle=H.prototype.a;H.prototype.processStyles=H.prototype.c;Object.defineProperties(H.prototype,{transformCallback:{get:function(){return ya},set:function(a){ya=a}},validateCallback:{get:function(){return fa},set:function(a){var b=!1;fa||(b=!0);fa=a;b&&this.Ga()}}});var Xc=new ha;k.prototype.C=function(){pb()};k.prototype.da=function(a){var b=this.s[a]=(this.s[a]||0)+1;return a+"-"+b};
+k.prototype.Ra=function(a){return qa(a)};k.prototype.Ta=function(a){return V(a)};k.prototype.R=function(a){a=a.content.querySelectorAll("style");for(var b=[],c=0;c<a.length;c++){var d=a[c];b.push(d.textContent);d.parentNode.removeChild(d)}return b.join("").trim()};k.prototype.fa=function(a){return(a=a.content.querySelector("style"))?a.getAttribute("css-build")||"":""};k.prototype.prepareTemplate=function(a,b,c){if(!a.f){a.f=!0;a.name=b;a.extends=c;sa[b]=a;var d=this.fa(a),e=this.R(a);c={is:b,extends:c,
+Ab:d};w||v.a(a.content,b);this.c();var f=wa.test(e)||va.test(e);wa.lastIndex=0;va.lastIndex=0;e=ab(e);f&&q&&this.a&&this.a.transformRules(e,b);a._styleAst=e;a.g=d;d=[];q||(d=K.R(a._styleAst));if(!d.length||q)b=this.ea(c,a._styleAst,w?a.content:null,lb[b]),a.a=b;a.c=d}};k.prototype.ea=function(a,b,c,d){b=v.b(a,b);if(b.length)return bb(b,a.is,c,d)};k.prototype.ha=function(a){var b=Q(a),c=b.is;b=b.Y;var d=lb[c];c=sa[c];if(c){var e=c._styleAst;var f=c.c}return t.set(a,new t(e,d,f,0,b))};k.prototype.H=
+function(){!this.a&&window.ShadyCSS&&window.ShadyCSS.ApplyShim&&(this.a=window.ShadyCSS.ApplyShim,this.a.invalidCallback=Jd)};k.prototype.I=function(){var a=this;!this.b&&window.ShadyCSS&&window.ShadyCSS.CustomStyleInterface&&(this.b=window.ShadyCSS.CustomStyleInterface,this.b.transformCallback=function(b){a.v(b)},this.b.validateCallback=function(){requestAnimationFrame(function(){(a.b.enqueued||a.i)&&a.f()})})};k.prototype.c=function(){this.H();this.I()};k.prototype.f=function(){this.c();if(this.b){var a=
+this.b.processStyles();this.b.enqueued&&(q?this.Pa(a):(this.u(this.g,this.h),this.D(a)),this.b.enqueued=!1,this.i&&!q&&this.styleDocument())}};k.prototype.styleElement=function(a,b){var c=Q(a).is,d=t.get(a);d||(d=this.ha(a));this.j(a)||(this.i=!0);b&&(d.P=d.P||{},Object.assign(d.P,b));if(q){if(d.P){b=d.P;for(var e in b)null===e?a.style.removeProperty(e):a.style.setProperty(e,b[e])}if(((e=sa[c])||this.j(a))&&e&&e.a&&!Fc(e)){if(Fc(e)||e._applyShimValidatingVersion!==e._applyShimNextVersion)this.c(),
+this.a&&this.a.transformRules(e._styleAst,c),e.a.textContent=v.b(a,d.G),Kd(e);w&&(c=a.shadowRoot)&&(c.querySelector("style").textContent=v.b(a,d.G));d.G=e._styleAst}}else this.u(a,d),d.sa&&d.sa.length&&this.L(a,d)};k.prototype.l=function(a){return(a=a.getRootNode().host)?t.get(a)?a:this.l(a):this.g};k.prototype.j=function(a){return a===this.g};k.prototype.L=function(a,b){var c=Q(a).is,d=Xc.fetch(c,b.K,b.sa),e=d?d.styleElement:null,f=b.B;b.B=d&&d.B||this.da(c);e=K.v(a,b.K,b.B,e);w||K.u(a,b.B,f);d||
+Xc.b(c,b.K,e,b.B)};k.prototype.u=function(a,b){var c=this.l(a),d=t.get(c);c=Object.create(d.K||null);var e=K.da(a,b.G);a=K.ea(d.G,a).F;Object.assign(c,e.pb,a,e.vb);this.ga(c,b.P);K.fa(c);b.K=c};k.prototype.ga=function(a,b){for(var c in b){var d=b[c];if(d||0===d)a[c]=d}};k.prototype.styleDocument=function(a){this.styleSubtree(this.g,a)};k.prototype.styleSubtree=function(a,b){var c=a.shadowRoot;(c||this.j(a))&&this.styleElement(a,b);if(b=c&&(c.children||c.childNodes))for(a=0;a<b.length;a++)this.styleSubtree(b[a]);
+else if(a=a.children||a.childNodes)for(b=0;b<a.length;b++)this.styleSubtree(a[b])};k.prototype.Pa=function(a){for(var b=0;b<a.length;b++){var c=this.b.getStyleForCustomStyle(a[b]);c&&this.Oa(c)}};k.prototype.D=function(a){for(var b=0;b<a.length;b++){var c=this.b.getStyleForCustomStyle(a[b]);c&&K.s(c,this.h.K)}};k.prototype.v=function(a){var b=this,c=qa(a);W(c,function(a){w?v.u(a):v.I(a);q&&(b.c(),b.a&&b.a.transformRule(a))});q?a.textContent=V(c):this.h.G.rules.push(c)};k.prototype.Oa=function(a){if(q&&
+this.a){var b=qa(a);this.c();this.a.transformRules(b);a.textContent=V(b)}};k.prototype.getComputedStyleValue=function(a,b){var c;q||(c=(t.get(a)||t.get(this.l(a))).K[b]);return(c=c||window.getComputedStyle(a).getPropertyValue(b))?c.trim():""};k.prototype.Sa=function(a,b){var c=a.getRootNode();b=b?b.split(/\s/):[];c=c.host&&c.host.localName;if(!c){var d=a.getAttribute("class");if(d){d=d.split(/\s/);for(var e=0;e<d.length;e++)if(d[e]===v.c){c=d[e+1];break}}}c&&b.push(v.c,c);q||(c=t.get(a))&&c.B&&b.push(K.g,
+c.B);ra(a,b.join(" "))};k.prototype.Qa=function(a){return t.get(a)};k.prototype.flush=k.prototype.C;k.prototype.prepareTemplate=k.prototype.prepareTemplate;k.prototype.styleElement=k.prototype.styleElement;k.prototype.styleDocument=k.prototype.styleDocument;k.prototype.styleSubtree=k.prototype.styleSubtree;k.prototype.getComputedStyleValue=k.prototype.getComputedStyleValue;k.prototype.setElementClass=k.prototype.Sa;k.prototype._styleInfoForNode=k.prototype.Qa;k.prototype.transformCustomStyleForDocument=
+k.prototype.v;k.prototype.getStyleAst=k.prototype.Ra;k.prototype.styleAstToString=k.prototype.Ta;k.prototype.flushCustomStyles=k.prototype.f;Object.defineProperties(k.prototype,{nativeShadow:{get:function(){return w}},nativeCss:{get:function(){return q}}});var E=new k;if(window.ShadyCSS){var Yc=window.ShadyCSS.ApplyShim;var Zc=window.ShadyCSS.CustomStyleInterface}window.ShadyCSS={ScopingShim:E,prepareTemplate:function(a,b,c){E.f();E.prepareTemplate(a,b,c)},styleSubtree:function(a,b){E.f();E.styleSubtree(a,
+b)},styleElement:function(a){E.f();E.styleElement(a)},styleDocument:function(a){E.f();E.styleDocument(a)},getComputedStyleValue:function(a,b){return E.getComputedStyleValue(a,b)},nativeCss:q,nativeShadow:w};Yc&&(window.ShadyCSS.ApplyShim=Yc);Zc&&(window.ShadyCSS.CustomStyleInterface=Zc);(function(){var a=window.customElements,b=window.HTMLImports;window.WebComponents=window.WebComponents||{};if(a&&a.polyfillWrapFlushCallback){var c,d=function(){if(c){var a=c;c=null;a();return!0}},e=b.whenReady;a.polyfillWrapFlushCallback(function(a){c=
+a;e(d)});b.whenReady=function(a){e(function(){d()?b.whenReady(a):a()})}}b.whenReady(function(){requestAnimationFrame(function(){window.WebComponents.ready=!0;document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))})})})();(function(){var a=document.createElement("style");a.textContent="body {transition: opacity ease-in 0.2s; } \nbody[unresolved] {opacity: 0; display: block; overflow: hidden; position: relative; } \n";var b=document.querySelector("head");b.insertBefore(a,b.firstChild)})()})();}).call(this);
+
+//# sourceMappingURL=webcomponents-lite.js.map
diff --git a/homeassistant/components/frontend/www_static/webcomponents-lite.js.gz b/homeassistant/components/frontend/www_static/webcomponents-lite.js.gz
new file mode 100644
index 0000000000000000000000000000000000000000..daf3276518ce50410d99add54444017ba6184175
Binary files /dev/null and b/homeassistant/components/frontend/www_static/webcomponents-lite.js.gz differ
diff --git a/homeassistant/components/frontend/www_static/webcomponents-lite.min.js b/homeassistant/components/frontend/www_static/webcomponents-lite.min.js
deleted file mode 100644
index fb9d01025f808e4a4b5bcb4b7450427e65efbe18..0000000000000000000000000000000000000000
--- a/homeassistant/components/frontend/www_static/webcomponents-lite.min.js
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- * @license
- * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
- * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
- * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
- * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
- * Code distributed by Google as part of the polymer project is also
- * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
- */
-// @version 0.7.24
-!function(){window.WebComponents=window.WebComponents||{flags:{}};var e="webcomponents-lite.js",t=document.querySelector('script[src*="'+e+'"]'),n={};if(!n.noOpts){if(location.search.slice(1).split("&").forEach(function(e){var t,o=e.split("=");o[0]&&(t=o[0].match(/wc-(.+)/))&&(n[t[1]]=o[1]||!0)}),t)for(var o,r=0;o=t.attributes[r];r++)"src"!==o.name&&(n[o.name]=o.value||!0);if(n.log&&n.log.split){var i=n.log.split(",");n.log={},i.forEach(function(e){n.log[e]=!0})}else n.log={}}n.register&&(window.CustomElements=window.CustomElements||{flags:{}},window.CustomElements.flags.register=n.register),WebComponents.flags=n}(),function(e){"use strict";function t(e){return void 0!==h[e]}function n(){s.call(this),this._isInvalid=!0}function o(e){return""==e&&n.call(this),e.toLowerCase()}function r(e){var t=e.charCodeAt(0);return t>32&&t<127&&[34,35,60,62,63,96].indexOf(t)==-1?e:encodeURIComponent(e)}function i(e){var t=e.charCodeAt(0);return t>32&&t<127&&[34,35,60,62,96].indexOf(t)==-1?e:encodeURIComponent(e)}function a(e,a,s){function c(e){g.push(e)}var d=a||"scheme start",l=0,u="",w=!1,_=!1,g=[];e:for(;(e[l-1]!=p||0==l)&&!this._isInvalid;){var b=e[l];switch(d){case"scheme start":if(!b||!m.test(b)){if(a){c("Invalid scheme.");break e}u="",d="no scheme";continue}u+=b.toLowerCase(),d="scheme";break;case"scheme":if(b&&v.test(b))u+=b.toLowerCase();else{if(":"!=b){if(a){if(p==b)break e;c("Code point not allowed in scheme: "+b);break e}u="",l=0,d="no scheme";continue}if(this._scheme=u,u="",a)break e;t(this._scheme)&&(this._isRelative=!0),d="file"==this._scheme?"relative":this._isRelative&&s&&s._scheme==this._scheme?"relative or authority":this._isRelative?"authority first slash":"scheme data"}break;case"scheme data":"?"==b?(this._query="?",d="query"):"#"==b?(this._fragment="#",d="fragment"):p!=b&&"\t"!=b&&"\n"!=b&&"\r"!=b&&(this._schemeData+=r(b));break;case"no scheme":if(s&&t(s._scheme)){d="relative";continue}c("Missing scheme."),n.call(this);break;case"relative or authority":if("/"!=b||"/"!=e[l+1]){c("Expected /, got: "+b),d="relative";continue}d="authority ignore slashes";break;case"relative":if(this._isRelative=!0,"file"!=this._scheme&&(this._scheme=s._scheme),p==b){this._host=s._host,this._port=s._port,this._path=s._path.slice(),this._query=s._query,this._username=s._username,this._password=s._password;break e}if("/"==b||"\\"==b)"\\"==b&&c("\\ is an invalid code point."),d="relative slash";else if("?"==b)this._host=s._host,this._port=s._port,this._path=s._path.slice(),this._query="?",this._username=s._username,this._password=s._password,d="query";else{if("#"!=b){var y=e[l+1],E=e[l+2];("file"!=this._scheme||!m.test(b)||":"!=y&&"|"!=y||p!=E&&"/"!=E&&"\\"!=E&&"?"!=E&&"#"!=E)&&(this._host=s._host,this._port=s._port,this._username=s._username,this._password=s._password,this._path=s._path.slice(),this._path.pop()),d="relative path";continue}this._host=s._host,this._port=s._port,this._path=s._path.slice(),this._query=s._query,this._fragment="#",this._username=s._username,this._password=s._password,d="fragment"}break;case"relative slash":if("/"!=b&&"\\"!=b){"file"!=this._scheme&&(this._host=s._host,this._port=s._port,this._username=s._username,this._password=s._password),d="relative path";continue}"\\"==b&&c("\\ is an invalid code point."),d="file"==this._scheme?"file host":"authority ignore slashes";break;case"authority first slash":if("/"!=b){c("Expected '/', got: "+b),d="authority ignore slashes";continue}d="authority second slash";break;case"authority second slash":if(d="authority ignore slashes","/"!=b){c("Expected '/', got: "+b);continue}break;case"authority ignore slashes":if("/"!=b&&"\\"!=b){d="authority";continue}c("Expected authority, got: "+b);break;case"authority":if("@"==b){w&&(c("@ already seen."),u+="%40"),w=!0;for(var L=0;L<u.length;L++){var N=u[L];if("\t"!=N&&"\n"!=N&&"\r"!=N)if(":"!=N||null!==this._password){var M=r(N);null!==this._password?this._password+=M:this._username+=M}else this._password="";else c("Invalid whitespace in authority.")}u=""}else{if(p==b||"/"==b||"\\"==b||"?"==b||"#"==b){l-=u.length,u="",d="host";continue}u+=b}break;case"file host":if(p==b||"/"==b||"\\"==b||"?"==b||"#"==b){2!=u.length||!m.test(u[0])||":"!=u[1]&&"|"!=u[1]?0==u.length?d="relative path start":(this._host=o.call(this,u),u="",d="relative path start"):d="relative path";continue}"\t"==b||"\n"==b||"\r"==b?c("Invalid whitespace in file host."):u+=b;break;case"host":case"hostname":if(":"!=b||_){if(p==b||"/"==b||"\\"==b||"?"==b||"#"==b){if(this._host=o.call(this,u),u="",d="relative path start",a)break e;continue}"\t"!=b&&"\n"!=b&&"\r"!=b?("["==b?_=!0:"]"==b&&(_=!1),u+=b):c("Invalid code point in host/hostname: "+b)}else if(this._host=o.call(this,u),u="",d="port","hostname"==a)break e;break;case"port":if(/[0-9]/.test(b))u+=b;else{if(p==b||"/"==b||"\\"==b||"?"==b||"#"==b||a){if(""!=u){var T=parseInt(u,10);T!=h[this._scheme]&&(this._port=T+""),u=""}if(a)break e;d="relative path start";continue}"\t"==b||"\n"==b||"\r"==b?c("Invalid code point in port: "+b):n.call(this)}break;case"relative path start":if("\\"==b&&c("'\\' not allowed in path."),d="relative path","/"!=b&&"\\"!=b)continue;break;case"relative path":if(p!=b&&"/"!=b&&"\\"!=b&&(a||"?"!=b&&"#"!=b))"\t"!=b&&"\n"!=b&&"\r"!=b&&(u+=r(b));else{"\\"==b&&c("\\ not allowed in relative path.");var O;(O=f[u.toLowerCase()])&&(u=O),".."==u?(this._path.pop(),"/"!=b&&"\\"!=b&&this._path.push("")):"."==u&&"/"!=b&&"\\"!=b?this._path.push(""):"."!=u&&("file"==this._scheme&&0==this._path.length&&2==u.length&&m.test(u[0])&&"|"==u[1]&&(u=u[0]+":"),this._path.push(u)),u="","?"==b?(this._query="?",d="query"):"#"==b&&(this._fragment="#",d="fragment")}break;case"query":a||"#"!=b?p!=b&&"\t"!=b&&"\n"!=b&&"\r"!=b&&(this._query+=i(b)):(this._fragment="#",d="fragment");break;case"fragment":p!=b&&"\t"!=b&&"\n"!=b&&"\r"!=b&&(this._fragment+=b)}l++}}function s(){this._scheme="",this._schemeData="",this._username="",this._password=null,this._host="",this._port="",this._path=[],this._query="",this._fragment="",this._isInvalid=!1,this._isRelative=!1}function c(e,t){void 0===t||t instanceof c||(t=new c(String(t))),this._url=e,s.call(this);var n=e.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g,"");a.call(this,n,null,t)}var d=!1;if(!e.forceJURL)try{var l=new URL("b","http://a");l.pathname="c%20d",d="http://a/c%20d"===l.href}catch(u){}if(!d){var h=Object.create(null);h.ftp=21,h.file=0,h.gopher=70,h.http=80,h.https=443,h.ws=80,h.wss=443;var f=Object.create(null);f["%2e"]=".",f[".%2e"]="..",f["%2e."]="..",f["%2e%2e"]="..";var p=void 0,m=/[a-zA-Z]/,v=/[a-zA-Z0-9\+\-\.]/;c.prototype={toString:function(){return this.href},get href(){if(this._isInvalid)return this._url;var e="";return""==this._username&&null==this._password||(e=this._username+(null!=this._password?":"+this._password:"")+"@"),this.protocol+(this._isRelative?"//"+e+this.host:"")+this.pathname+this._query+this._fragment},set href(e){s.call(this),a.call(this,e)},get protocol(){return this._scheme+":"},set protocol(e){this._isInvalid||a.call(this,e+":","scheme start")},get host(){return this._isInvalid?"":this._port?this._host+":"+this._port:this._host},set host(e){!this._isInvalid&&this._isRelative&&a.call(this,e,"host")},get hostname(){return this._host},set hostname(e){!this._isInvalid&&this._isRelative&&a.call(this,e,"hostname")},get port(){return this._port},set port(e){!this._isInvalid&&this._isRelative&&a.call(this,e,"port")},get pathname(){return this._isInvalid?"":this._isRelative?"/"+this._path.join("/"):this._schemeData},set pathname(e){!this._isInvalid&&this._isRelative&&(this._path=[],a.call(this,e,"relative path start"))},get search(){return this._isInvalid||!this._query||"?"==this._query?"":this._query},set search(e){!this._isInvalid&&this._isRelative&&(this._query="?","?"==e[0]&&(e=e.slice(1)),a.call(this,e,"query"))},get hash(){return this._isInvalid||!this._fragment||"#"==this._fragment?"":this._fragment},set hash(e){this._isInvalid||(this._fragment="#","#"==e[0]&&(e=e.slice(1)),a.call(this,e,"fragment"))},get origin(){var e;if(this._isInvalid||!this._scheme)return"";switch(this._scheme){case"data":case"file":case"javascript":case"mailto":return"null"}return e=this.host,e?this._scheme+"://"+e:""}};var w=e.URL;w&&(c.createObjectURL=function(e){return w.createObjectURL.apply(w,arguments)},c.revokeObjectURL=function(e){w.revokeObjectURL(e)}),e.URL=c}}(self),"undefined"==typeof WeakMap&&!function(){var e=Object.defineProperty,t=Date.now()%1e9,n=function(){this.name="__st"+(1e9*Math.random()>>>0)+(t++ +"__")};n.prototype={set:function(t,n){var o=t[this.name];return o&&o[0]===t?o[1]=n:e(t,this.name,{value:[t,n],writable:!0}),this},get:function(e){var t;return(t=e[this.name])&&t[0]===e?t[1]:void 0},"delete":function(e){var t=e[this.name];return!(!t||t[0]!==e)&&(t[0]=t[1]=void 0,!0)},has:function(e){var t=e[this.name];return!!t&&t[0]===e}},window.WeakMap=n}(),function(e){function t(e){b.push(e),g||(g=!0,m(o))}function n(e){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(e)||e}function o(){g=!1;var e=b;b=[],e.sort(function(e,t){return e.uid_-t.uid_});var t=!1;e.forEach(function(e){var n=e.takeRecords();r(e),n.length&&(e.callback_(n,e),t=!0)}),t&&o()}function r(e){e.nodes_.forEach(function(t){var n=v.get(t);n&&n.forEach(function(t){t.observer===e&&t.removeTransientObservers()})})}function i(e,t){for(var n=e;n;n=n.parentNode){var o=v.get(n);if(o)for(var r=0;r<o.length;r++){var i=o[r],a=i.options;if(n===e||a.subtree){var s=t(a);s&&i.enqueue(s)}}}}function a(e){this.callback_=e,this.nodes_=[],this.records_=[],this.uid_=++y}function s(e,t){this.type=e,this.target=t,this.addedNodes=[],this.removedNodes=[],this.previousSibling=null,this.nextSibling=null,this.attributeName=null,this.attributeNamespace=null,this.oldValue=null}function c(e){var t=new s(e.type,e.target);return t.addedNodes=e.addedNodes.slice(),t.removedNodes=e.removedNodes.slice(),t.previousSibling=e.previousSibling,t.nextSibling=e.nextSibling,t.attributeName=e.attributeName,t.attributeNamespace=e.attributeNamespace,t.oldValue=e.oldValue,t}function d(e,t){return E=new s(e,t)}function l(e){return L?L:(L=c(E),L.oldValue=e,L)}function u(){E=L=void 0}function h(e){return e===L||e===E}function f(e,t){return e===t?e:L&&h(e)?L:null}function p(e,t,n){this.observer=e,this.target=t,this.options=n,this.transientObservedNodes=[]}if(!e.JsMutationObserver){var m,v=new WeakMap;if(/Trident|Edge/.test(navigator.userAgent))m=setTimeout;else if(window.setImmediate)m=window.setImmediate;else{var w=[],_=String(Math.random());window.addEventListener("message",function(e){if(e.data===_){var t=w;w=[],t.forEach(function(e){e()})}}),m=function(e){w.push(e),window.postMessage(_,"*")}}var g=!1,b=[],y=0;a.prototype={observe:function(e,t){if(e=n(e),!t.childList&&!t.attributes&&!t.characterData||t.attributeOldValue&&!t.attributes||t.attributeFilter&&t.attributeFilter.length&&!t.attributes||t.characterDataOldValue&&!t.characterData)throw new SyntaxError;var o=v.get(e);o||v.set(e,o=[]);for(var r,i=0;i<o.length;i++)if(o[i].observer===this){r=o[i],r.removeListeners(),r.options=t;break}r||(r=new p(this,e,t),o.push(r),this.nodes_.push(e)),r.addListeners()},disconnect:function(){this.nodes_.forEach(function(e){for(var t=v.get(e),n=0;n<t.length;n++){var o=t[n];if(o.observer===this){o.removeListeners(),t.splice(n,1);break}}},this),this.records_=[]},takeRecords:function(){var e=this.records_;return this.records_=[],e}};var E,L;p.prototype={enqueue:function(e){var n=this.observer.records_,o=n.length;if(n.length>0){var r=n[o-1],i=f(r,e);if(i)return void(n[o-1]=i)}else t(this.observer);n[o]=e},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(e){var t=this.options;t.attributes&&e.addEventListener("DOMAttrModified",this,!0),t.characterData&&e.addEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.addEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(e){var t=this.options;t.attributes&&e.removeEventListener("DOMAttrModified",this,!0),t.characterData&&e.removeEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.removeEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(e){if(e!==this.target){this.addListeners_(e),this.transientObservedNodes.push(e);var t=v.get(e);t||v.set(e,t=[]),t.push(this)}},removeTransientObservers:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach(function(e){this.removeListeners_(e);for(var t=v.get(e),n=0;n<t.length;n++)if(t[n]===this){t.splice(n,1);break}},this)},handleEvent:function(e){switch(e.stopImmediatePropagation(),e.type){case"DOMAttrModified":var t=e.attrName,n=e.relatedNode.namespaceURI,o=e.target,r=new d("attributes",o);r.attributeName=t,r.attributeNamespace=n;var a=e.attrChange===MutationEvent.ADDITION?null:e.prevValue;i(o,function(e){if(e.attributes&&(!e.attributeFilter||!e.attributeFilter.length||e.attributeFilter.indexOf(t)!==-1||e.attributeFilter.indexOf(n)!==-1))return e.attributeOldValue?l(a):r});break;case"DOMCharacterDataModified":var o=e.target,r=d("characterData",o),a=e.prevValue;i(o,function(e){if(e.characterData)return e.characterDataOldValue?l(a):r});break;case"DOMNodeRemoved":this.addTransientObserver(e.target);case"DOMNodeInserted":var s,c,h=e.target;"DOMNodeInserted"===e.type?(s=[h],c=[]):(s=[],c=[h]);var f=h.previousSibling,p=h.nextSibling,r=d("childList",e.target.parentNode);r.addedNodes=s,r.removedNodes=c,r.previousSibling=f,r.nextSibling=p,i(e.relatedNode,function(e){if(e.childList)return r})}u()}},e.JsMutationObserver=a,e.MutationObserver||(e.MutationObserver=a,a._isPolyfilled=!0)}}(self),function(){function e(e){switch(e){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case" ":return"&nbsp;"}}function t(t){return t.replace(u,e)}var n="undefined"==typeof HTMLTemplateElement;/Trident/.test(navigator.userAgent)&&!function(){var e=document.importNode;document.importNode=function(){var t=e.apply(document,arguments);if(t.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var n=document.createDocumentFragment();return n.appendChild(t),n}return t}}();var o=function(){if(!n){var e=document.createElement("template"),t=document.createElement("template");t.content.appendChild(document.createElement("div")),e.content.appendChild(t);var o=e.cloneNode(!0);return 0===o.content.childNodes.length||0===o.content.firstChild.content.childNodes.length}}(),r="template",i=function(){};if(n){var a=document.implementation.createHTMLDocument("template"),s=!0,c=document.createElement("style");c.textContent=r+"{display:none;}";var d=document.head;d.insertBefore(c,d.firstElementChild),i.prototype=Object.create(HTMLElement.prototype),i.decorate=function(e){if(!e.content){e.content=a.createDocumentFragment();for(var n;n=e.firstChild;)e.content.appendChild(n);if(e.cloneNode=function(e){return i.cloneNode(this,e)},s)try{Object.defineProperty(e,"innerHTML",{get:function(){for(var e="",n=this.content.firstChild;n;n=n.nextSibling)e+=n.outerHTML||t(n.data);return e},set:function(e){for(a.body.innerHTML=e,i.bootstrap(a);this.content.firstChild;)this.content.removeChild(this.content.firstChild);for(;a.body.firstChild;)this.content.appendChild(a.body.firstChild)},configurable:!0})}catch(o){s=!1}i.bootstrap(e.content)}},i.bootstrap=function(e){for(var t,n=e.querySelectorAll(r),o=0,a=n.length;o<a&&(t=n[o]);o++)i.decorate(t)},document.addEventListener("DOMContentLoaded",function(){i.bootstrap(document)});var l=document.createElement;document.createElement=function(){"use strict";var e=l.apply(document,arguments);return"template"===e.localName&&i.decorate(e),e};var u=/[&\u00A0<>]/g}if(n||o){var h=Node.prototype.cloneNode;i.cloneNode=function(e,t){var n=h.call(e,!1);return this.decorate&&this.decorate(n),t&&(n.content.appendChild(h.call(e.content,!0)),this.fixClonedDom(n.content,e.content)),n},i.fixClonedDom=function(e,t){if(t.querySelectorAll)for(var n,o,i=t.querySelectorAll(r),a=e.querySelectorAll(r),s=0,c=a.length;s<c;s++)o=i[s],n=a[s],this.decorate&&this.decorate(o),n.parentNode.replaceChild(o.cloneNode(!0),n)};var f=document.importNode;Node.prototype.cloneNode=function(e){var t=h.call(this,e);return e&&i.fixClonedDom(t,this),t},document.importNode=function(e,t){if(e.localName===r)return i.cloneNode(e,t);var n=f.call(document,e,t);return t&&i.fixClonedDom(n,e),n},o&&(HTMLTemplateElement.prototype.cloneNode=function(e){return i.cloneNode(this,e)})}n&&(window.HTMLTemplateElement=i)}(),function(e){"use strict";if(!window.performance||!window.performance.now){var t=Date.now();window.performance={now:function(){return Date.now()-t}}}window.requestAnimationFrame||(window.requestAnimationFrame=function(){var e=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame;return e?function(t){return e(function(){t(performance.now())})}:function(e){return window.setTimeout(e,1e3/60)}}()),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(){return window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}}());var n=function(){var e=document.createEvent("Event");return e.initEvent("foo",!0,!0),e.preventDefault(),e.defaultPrevented}();if(!n){var o=Event.prototype.preventDefault;Event.prototype.preventDefault=function(){this.cancelable&&(o.call(this),Object.defineProperty(this,"defaultPrevented",{get:function(){return!0},configurable:!0}))}}var r=/Trident/.test(navigator.userAgent);if((!window.CustomEvent||r&&"function"!=typeof window.CustomEvent)&&(window.CustomEvent=function(e,t){t=t||{};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,Boolean(t.bubbles),Boolean(t.cancelable),t.detail),n},window.CustomEvent.prototype=window.Event.prototype),!window.Event||r&&"function"!=typeof window.Event){var i=window.Event;window.Event=function(e,t){t=t||{};var n=document.createEvent("Event");return n.initEvent(e,Boolean(t.bubbles),Boolean(t.cancelable)),n},window.Event.prototype=i.prototype}}(window.WebComponents),window.HTMLImports=window.HTMLImports||{flags:{}},function(e){function t(e,t){t=t||p,o(function(){i(e,t)},t)}function n(e){return"complete"===e.readyState||e.readyState===w}function o(e,t){if(n(t))e&&e();else{var r=function(){"complete"!==t.readyState&&t.readyState!==w||(t.removeEventListener(_,r),o(e,t))};t.addEventListener(_,r)}}function r(e){e.target.__loaded=!0}function i(e,t){function n(){c==d&&e&&e({allImports:s,loadedImports:l,errorImports:u})}function o(e){r(e),l.push(this),c++,n()}function i(e){u.push(this),c++,n()}var s=t.querySelectorAll("link[rel=import]"),c=0,d=s.length,l=[],u=[];if(d)for(var h,f=0;f<d&&(h=s[f]);f++)a(h)?(l.push(this),c++,n()):(h.addEventListener("load",o),h.addEventListener("error",i));else n()}function a(e){return u?e.__loaded||e["import"]&&"loading"!==e["import"].readyState:e.__importParsed}function s(e){for(var t,n=0,o=e.length;n<o&&(t=e[n]);n++)c(t)&&d(t)}function c(e){return"link"===e.localName&&"import"===e.rel}function d(e){var t=e["import"];t?r({target:e}):(e.addEventListener("load",r),e.addEventListener("error",r))}var l="import",u=Boolean(l in document.createElement("link")),h=Boolean(window.ShadowDOMPolyfill),f=function(e){return h?window.ShadowDOMPolyfill.wrapIfNeeded(e):e},p=f(document),m={get:function(){var e=window.HTMLImports.currentScript||document.currentScript||("complete"!==document.readyState?document.scripts[document.scripts.length-1]:null);return f(e)},configurable:!0};Object.defineProperty(document,"_currentScript",m),Object.defineProperty(p,"_currentScript",m);var v=/Trident/.test(navigator.userAgent),w=v?"complete":"interactive",_="readystatechange";u&&(new MutationObserver(function(e){for(var t,n=0,o=e.length;n<o&&(t=e[n]);n++)t.addedNodes&&s(t.addedNodes)}).observe(document.head,{childList:!0}),function(){if("loading"===document.readyState)for(var e,t=document.querySelectorAll("link[rel=import]"),n=0,o=t.length;n<o&&(e=t[n]);n++)d(e)}()),t(function(e){window.HTMLImports.ready=!0,window.HTMLImports.readyTime=(new Date).getTime();var t=p.createEvent("CustomEvent");t.initCustomEvent("HTMLImportsLoaded",!0,!0,e),p.dispatchEvent(t)}),e.IMPORT_LINK_TYPE=l,e.useNative=u,e.rootDocument=p,e.whenReady=t,e.isIE=v}(window.HTMLImports),function(e){var t=[],n=function(e){t.push(e)},o=function(){t.forEach(function(t){t(e)})};e.addModule=n,e.initializeModules=o}(window.HTMLImports),window.HTMLImports.addModule(function(e){var t=/(url\()([^)]*)(\))/g,n=/(@import[\s]+(?!url\())([^;]*)(;)/g,o={resolveUrlsInStyle:function(e,t){var n=e.ownerDocument,o=n.createElement("a");return e.textContent=this.resolveUrlsInCssText(e.textContent,t,o),e},resolveUrlsInCssText:function(e,o,r){var i=this.replaceUrls(e,r,o,t);return i=this.replaceUrls(i,r,o,n)},replaceUrls:function(e,t,n,o){return e.replace(o,function(e,o,r,i){var a=r.replace(/["']/g,"");return n&&(a=new URL(a,n).href),t.href=a,a=t.href,o+"'"+a+"'"+i})}};e.path=o}),window.HTMLImports.addModule(function(e){var t={async:!0,ok:function(e){return e.status>=200&&e.status<300||304===e.status||0===e.status},load:function(n,o,r){var i=new XMLHttpRequest;return(e.flags.debug||e.flags.bust)&&(n+="?"+Math.random()),i.open("GET",n,t.async),i.addEventListener("readystatechange",function(e){if(4===i.readyState){var n=null;try{var a=i.getResponseHeader("Location");a&&(n="/"===a.substr(0,1)?location.origin+a:a)}catch(e){console.error(e.message)}o.call(r,!t.ok(i)&&i,i.response||i.responseText,n)}}),i.send(),i},loadDocument:function(e,t,n){this.load(e,t,n).responseType="document"}};e.xhr=t}),window.HTMLImports.addModule(function(e){var t=e.xhr,n=e.flags,o=function(e,t){this.cache={},this.onload=e,this.oncomplete=t,this.inflight=0,this.pending={}};o.prototype={addNodes:function(e){this.inflight+=e.length;for(var t,n=0,o=e.length;n<o&&(t=e[n]);n++)this.require(t);this.checkDone()},addNode:function(e){this.inflight++,this.require(e),this.checkDone()},require:function(e){var t=e.src||e.href;e.__nodeUrl=t,this.dedupe(t,e)||this.fetch(t,e)},dedupe:function(e,t){if(this.pending[e])return this.pending[e].push(t),!0;return this.cache[e]?(this.onload(e,t,this.cache[e]),this.tail(),!0):(this.pending[e]=[t],!1)},fetch:function(e,o){if(n.load&&console.log("fetch",e,o),e)if(e.match(/^data:/)){var r=e.split(","),i=r[0],a=r[1];a=i.indexOf(";base64")>-1?atob(a):decodeURIComponent(a),setTimeout(function(){this.receive(e,o,null,a)}.bind(this),0)}else{var s=function(t,n,r){this.receive(e,o,t,n,r)}.bind(this);t.load(e,s)}else setTimeout(function(){this.receive(e,o,{error:"href must be specified"},null)}.bind(this),0)},receive:function(e,t,n,o,r){this.cache[e]=o;for(var i,a=this.pending[e],s=0,c=a.length;s<c&&(i=a[s]);s++)this.onload(e,i,o,n,r),this.tail();this.pending[e]=null},tail:function(){--this.inflight,this.checkDone()},checkDone:function(){this.inflight||this.oncomplete()}},e.Loader=o}),window.HTMLImports.addModule(function(e){var t=function(e){this.addCallback=e,this.mo=new MutationObserver(this.handler.bind(this))};t.prototype={handler:function(e){for(var t,n=0,o=e.length;n<o&&(t=e[n]);n++)"childList"===t.type&&t.addedNodes.length&&this.addedNodes(t.addedNodes)},addedNodes:function(e){this.addCallback&&this.addCallback(e);for(var t,n=0,o=e.length;n<o&&(t=e[n]);n++)t.children&&t.children.length&&this.addedNodes(t.children)},observe:function(e){this.mo.observe(e,{childList:!0,subtree:!0})}},e.Observer=t}),window.HTMLImports.addModule(function(e){function t(e){return"link"===e.localName&&e.rel===l}function n(e){var t=o(e);return"data:text/javascript;charset=utf-8,"+encodeURIComponent(t)}function o(e){return e.textContent+r(e)}function r(e){var t=e.ownerDocument;t.__importedScripts=t.__importedScripts||0;var n=e.ownerDocument.baseURI,o=t.__importedScripts?"-"+t.__importedScripts:"";return t.__importedScripts++,"\n//# sourceURL="+n+o+".js\n"}function i(e){var t=e.ownerDocument.createElement("style");return t.textContent=e.textContent,a.resolveUrlsInStyle(t),t}var a=e.path,s=e.rootDocument,c=e.flags,d=e.isIE,l=e.IMPORT_LINK_TYPE,u="link[rel="+l+"]",h={documentSelectors:u,importsSelectors:[u,"link[rel=stylesheet]:not([type])","style:not([type])","script:not([type])",'script[type="application/javascript"]','script[type="text/javascript"]'].join(","),map:{link:"parseLink",script:"parseScript",style:"parseStyle"},dynamicElements:[],parseNext:function(){var e=this.nextToParse();e&&this.parse(e)},parse:function(e){if(this.isParsed(e))return void(c.parse&&console.log("[%s] is already parsed",e.localName));var t=this[this.map[e.localName]];t&&(this.markParsing(e),t.call(this,e))},parseDynamic:function(e,t){this.dynamicElements.push(e),t||this.parseNext()},markParsing:function(e){c.parse&&console.log("parsing",e),this.parsingElement=e},markParsingComplete:function(e){e.__importParsed=!0,this.markDynamicParsingComplete(e),e.__importElement&&(e.__importElement.__importParsed=!0,this.markDynamicParsingComplete(e.__importElement)),this.parsingElement=null,c.parse&&console.log("completed",e)},markDynamicParsingComplete:function(e){var t=this.dynamicElements.indexOf(e);t>=0&&this.dynamicElements.splice(t,1)},parseImport:function(e){if(e["import"]=e.__doc,window.HTMLImports.__importsParsingHook&&window.HTMLImports.__importsParsingHook(e),e["import"]&&(e["import"].__importParsed=!0),this.markParsingComplete(e),e.__resource&&!e.__error?e.dispatchEvent(new CustomEvent("load",{bubbles:!1})):e.dispatchEvent(new CustomEvent("error",{bubbles:!1})),e.__pending)for(var t;e.__pending.length;)t=e.__pending.shift(),t&&t({target:e});this.parseNext()},parseLink:function(e){t(e)?this.parseImport(e):(e.href=e.href,this.parseGeneric(e))},parseStyle:function(e){var t=e;e=i(e),t.__appliedElement=e,e.__importElement=t,this.parseGeneric(e)},parseGeneric:function(e){this.trackElement(e),this.addElementToDocument(e)},rootImportForElement:function(e){for(var t=e;t.ownerDocument.__importLink;)t=t.ownerDocument.__importLink;return t},addElementToDocument:function(e){var t=this.rootImportForElement(e.__importElement||e);t.parentNode.insertBefore(e,t)},trackElement:function(e,t){var n=this,o=function(r){e.removeEventListener("load",o),e.removeEventListener("error",o),t&&t(r),n.markParsingComplete(e),n.parseNext()};if(e.addEventListener("load",o),e.addEventListener("error",o),d&&"style"===e.localName){var r=!1;if(e.textContent.indexOf("@import")==-1)r=!0;else if(e.sheet){r=!0;for(var i,a=e.sheet.cssRules,s=a?a.length:0,c=0;c<s&&(i=a[c]);c++)i.type===CSSRule.IMPORT_RULE&&(r=r&&Boolean(i.styleSheet))}r&&setTimeout(function(){e.dispatchEvent(new CustomEvent("load",{bubbles:!1}))})}},parseScript:function(t){var o=document.createElement("script");o.__importElement=t,o.src=t.src?t.src:n(t),e.currentScript=t,this.trackElement(o,function(t){o.parentNode&&o.parentNode.removeChild(o),e.currentScript=null}),this.addElementToDocument(o)},nextToParse:function(){return this._mayParse=[],!this.parsingElement&&(this.nextToParseInDoc(s)||this.nextToParseDynamic())},nextToParseInDoc:function(e,n){if(e&&this._mayParse.indexOf(e)<0){this._mayParse.push(e);for(var o,r=e.querySelectorAll(this.parseSelectorsForNode(e)),i=0,a=r.length;i<a&&(o=r[i]);i++)if(!this.isParsed(o))return this.hasResource(o)?t(o)?this.nextToParseInDoc(o.__doc,o):o:void 0}return n},nextToParseDynamic:function(){return this.dynamicElements[0]},parseSelectorsForNode:function(e){var t=e.ownerDocument||e;return t===s?this.documentSelectors:this.importsSelectors},isParsed:function(e){return e.__importParsed},needsDynamicParsing:function(e){return this.dynamicElements.indexOf(e)>=0},hasResource:function(e){return!t(e)||void 0!==e.__doc}};e.parser=h,e.IMPORT_SELECTOR=u}),window.HTMLImports.addModule(function(e){function t(e){return n(e,a)}function n(e,t){return"link"===e.localName&&e.getAttribute("rel")===t}function o(e){return!!Object.getOwnPropertyDescriptor(e,"baseURI")}function r(e,t){var n=document.implementation.createHTMLDocument(a);n._URL=t;var r=n.createElement("base");r.setAttribute("href",t),n.baseURI||o(n)||Object.defineProperty(n,"baseURI",{value:t});var i=n.createElement("meta");return i.setAttribute("charset","utf-8"),n.head.appendChild(i),n.head.appendChild(r),n.body.innerHTML=e,window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(n),n}var i=e.flags,a=e.IMPORT_LINK_TYPE,s=e.IMPORT_SELECTOR,c=e.rootDocument,d=e.Loader,l=e.Observer,u=e.parser,h={documents:{},documentPreloadSelectors:s,importsPreloadSelectors:[s].join(","),loadNode:function(e){f.addNode(e)},loadSubtree:function(e){var t=this.marshalNodes(e);f.addNodes(t)},marshalNodes:function(e){return e.querySelectorAll(this.loadSelectorsForNode(e))},loadSelectorsForNode:function(e){var t=e.ownerDocument||e;return t===c?this.documentPreloadSelectors:this.importsPreloadSelectors},loaded:function(e,n,o,a,s){if(i.load&&console.log("loaded",e,n),n.__resource=o,n.__error=a,t(n)){var c=this.documents[e];void 0===c&&(c=a?null:r(o,s||e),c&&(c.__importLink=n,this.bootDocument(c)),this.documents[e]=c),n.__doc=c}u.parseNext()},bootDocument:function(e){this.loadSubtree(e),this.observer.observe(e),u.parseNext()},loadedAll:function(){u.parseNext()}},f=new d(h.loaded.bind(h),h.loadedAll.bind(h));if(h.observer=new l,!document.baseURI){var p={get:function(){var e=document.querySelector("base");return e?e.href:window.location.href},configurable:!0};Object.defineProperty(document,"baseURI",p),Object.defineProperty(c,"baseURI",p)}e.importer=h,e.importLoader=f}),window.HTMLImports.addModule(function(e){var t=e.parser,n=e.importer,o={added:function(e){for(var o,r,i,a,s=0,c=e.length;s<c&&(a=e[s]);s++)o||(o=a.ownerDocument,r=t.isParsed(o)),i=this.shouldLoadNode(a),i&&n.loadNode(a),this.shouldParseNode(a)&&r&&t.parseDynamic(a,i)},shouldLoadNode:function(e){return 1===e.nodeType&&r.call(e,n.loadSelectorsForNode(e))},shouldParseNode:function(e){return 1===e.nodeType&&r.call(e,t.parseSelectorsForNode(e))}};n.observer.addCallback=o.added.bind(o);var r=HTMLElement.prototype.matches||HTMLElement.prototype.matchesSelector||HTMLElement.prototype.webkitMatchesSelector||HTMLElement.prototype.mozMatchesSelector||HTMLElement.prototype.msMatchesSelector}),function(e){function t(){window.HTMLImports.importer.bootDocument(o)}var n=e.initializeModules;e.isIE;if(!e.useNative){n();var o=e.rootDocument;"complete"===document.readyState||"interactive"===document.readyState&&!window.attachEvent?t():document.addEventListener("DOMContentLoaded",t)}}(window.HTMLImports),window.CustomElements=window.CustomElements||{flags:{}},function(e){var t=e.flags,n=[],o=function(e){n.push(e)},r=function(){n.forEach(function(t){t(e)})};e.addModule=o,e.initializeModules=r,e.hasNative=Boolean(document.registerElement),e.isIE=/Trident/.test(navigator.userAgent),e.useNative=!t.register&&e.hasNative&&!window.ShadowDOMPolyfill&&(!window.HTMLImports||window.HTMLImports.useNative)}(window.CustomElements),window.CustomElements.addModule(function(e){function t(e,t){n(e,function(e){return!!t(e)||void o(e,t)}),o(e,t)}function n(e,t,o){var r=e.firstElementChild;if(!r)for(r=e.firstChild;r&&r.nodeType!==Node.ELEMENT_NODE;)r=r.nextSibling;for(;r;)t(r,o)!==!0&&n(r,t,o),r=r.nextElementSibling;return null}function o(e,n){for(var o=e.shadowRoot;o;)t(o,n),o=o.olderShadowRoot}function r(e,t){i(e,t,[])}function i(e,t,n){if(e=window.wrap(e),!(n.indexOf(e)>=0)){n.push(e);for(var o,r=e.querySelectorAll("link[rel="+a+"]"),s=0,c=r.length;s<c&&(o=r[s]);s++)o["import"]&&i(o["import"],t,n);t(e)}}var a=window.HTMLImports?window.HTMLImports.IMPORT_LINK_TYPE:"none";e.forDocumentTree=r,e.forSubtree=t}),window.CustomElements.addModule(function(e){function t(e,t){return n(e,t)||o(e,t)}function n(t,n){return!!e.upgrade(t,n)||void(n&&a(t))}function o(e,t){g(e,function(e){if(n(e,t))return!0})}function r(e){L.push(e),E||(E=!0,setTimeout(i))}function i(){E=!1;for(var e,t=L,n=0,o=t.length;n<o&&(e=t[n]);n++)e();L=[]}function a(e){y?r(function(){s(e);
-}):s(e)}function s(e){e.__upgraded__&&!e.__attached&&(e.__attached=!0,e.attachedCallback&&e.attachedCallback())}function c(e){d(e),g(e,function(e){d(e)})}function d(e){y?r(function(){l(e)}):l(e)}function l(e){e.__upgraded__&&e.__attached&&(e.__attached=!1,e.detachedCallback&&e.detachedCallback())}function u(e){for(var t=e,n=window.wrap(document);t;){if(t==n)return!0;t=t.parentNode||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host}}function h(e){if(e.shadowRoot&&!e.shadowRoot.__watched){_.dom&&console.log("watching shadow-root for: ",e.localName);for(var t=e.shadowRoot;t;)m(t),t=t.olderShadowRoot}}function f(e,n){if(_.dom){var o=n[0];if(o&&"childList"===o.type&&o.addedNodes&&o.addedNodes){for(var r=o.addedNodes[0];r&&r!==document&&!r.host;)r=r.parentNode;var i=r&&(r.URL||r._URL||r.host&&r.host.localName)||"";i=i.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",n.length,i||"")}var a=u(e);n.forEach(function(e){"childList"===e.type&&(N(e.addedNodes,function(e){e.localName&&t(e,a)}),N(e.removedNodes,function(e){e.localName&&c(e)}))}),_.dom&&console.groupEnd()}function p(e){for(e=window.wrap(e),e||(e=window.wrap(document));e.parentNode;)e=e.parentNode;var t=e.__observer;t&&(f(e,t.takeRecords()),i())}function m(e){if(!e.__observer){var t=new MutationObserver(f.bind(this,e));t.observe(e,{childList:!0,subtree:!0}),e.__observer=t}}function v(e){e=window.wrap(e),_.dom&&console.group("upgradeDocument: ",e.baseURI.split("/").pop());var n=e===window.wrap(document);t(e,n),m(e),_.dom&&console.groupEnd()}function w(e){b(e,v)}var _=e.flags,g=e.forSubtree,b=e.forDocumentTree,y=window.MutationObserver._isPolyfilled&&_["throttle-attached"];e.hasPolyfillMutations=y,e.hasThrottledAttached=y;var E=!1,L=[],N=Array.prototype.forEach.call.bind(Array.prototype.forEach),M=Element.prototype.createShadowRoot;M&&(Element.prototype.createShadowRoot=function(){var e=M.call(this);return window.CustomElements.watchShadow(this),e}),e.watchShadow=h,e.upgradeDocumentTree=w,e.upgradeDocument=v,e.upgradeSubtree=o,e.upgradeAll=t,e.attached=a,e.takeRecords=p}),window.CustomElements.addModule(function(e){function t(t,o){if("template"===t.localName&&window.HTMLTemplateElement&&HTMLTemplateElement.decorate&&HTMLTemplateElement.decorate(t),!t.__upgraded__&&t.nodeType===Node.ELEMENT_NODE){var r=t.getAttribute("is"),i=e.getRegisteredDefinition(t.localName)||e.getRegisteredDefinition(r);if(i&&(r&&i.tag==t.localName||!r&&!i["extends"]))return n(t,i,o)}}function n(t,n,r){return a.upgrade&&console.group("upgrade:",t.localName),n.is&&t.setAttribute("is",n.is),o(t,n),t.__upgraded__=!0,i(t),r&&e.attached(t),e.upgradeSubtree(t,r),a.upgrade&&console.groupEnd(),t}function o(e,t){Object.__proto__?e.__proto__=t.prototype:(r(e,t.prototype,t["native"]),e.__proto__=t.prototype)}function r(e,t,n){for(var o={},r=t;r!==n&&r!==HTMLElement.prototype;){for(var i,a=Object.getOwnPropertyNames(r),s=0;i=a[s];s++)o[i]||(Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i)),o[i]=1);r=Object.getPrototypeOf(r)}}function i(e){e.createdCallback&&e.createdCallback()}var a=e.flags;e.upgrade=t,e.upgradeWithDefinition=n,e.implementPrototype=o}),window.CustomElements.addModule(function(e){function t(t,o){var c=o||{};if(!t)throw new Error("document.registerElement: first argument `name` must not be empty");if(t.indexOf("-")<0)throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '"+String(t)+"'.");if(r(t))throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '"+String(t)+"'. The type name is invalid.");if(d(t))throw new Error("DuplicateDefinitionError: a type with name '"+String(t)+"' is already registered");return c.prototype||(c.prototype=Object.create(HTMLElement.prototype)),c.__name=t.toLowerCase(),c["extends"]&&(c["extends"]=c["extends"].toLowerCase()),c.lifecycle=c.lifecycle||{},c.ancestry=i(c["extends"]),a(c),s(c),n(c.prototype),l(c.__name,c),c.ctor=u(c),c.ctor.prototype=c.prototype,c.prototype.constructor=c.ctor,e.ready&&v(document),c.ctor}function n(e){if(!e.setAttribute._polyfilled){var t=e.setAttribute;e.setAttribute=function(e,n){o.call(this,e,n,t)};var n=e.removeAttribute;e.removeAttribute=function(e){o.call(this,e,null,n)},e.setAttribute._polyfilled=!0}}function o(e,t,n){e=e.toLowerCase();var o=this.getAttribute(e);n.apply(this,arguments);var r=this.getAttribute(e);this.attributeChangedCallback&&r!==o&&this.attributeChangedCallback(e,o,r)}function r(e){for(var t=0;t<y.length;t++)if(e===y[t])return!0}function i(e){var t=d(e);return t?i(t["extends"]).concat([t]):[]}function a(e){for(var t,n=e["extends"],o=0;t=e.ancestry[o];o++)n=t.is&&t.tag;e.tag=n||e.__name,n&&(e.is=e.__name)}function s(e){if(!Object.__proto__){var t=HTMLElement.prototype;if(e.is){var n=document.createElement(e.tag);t=Object.getPrototypeOf(n)}for(var o,r=e.prototype,i=!1;r;)r==t&&(i=!0),o=Object.getPrototypeOf(r),o&&(r.__proto__=o),r=o;i||console.warn(e.tag+" prototype not found in prototype chain for "+e.is),e["native"]=t}}function c(e){return _(N(e.tag),e)}function d(e){if(e)return E[e.toLowerCase()]}function l(e,t){E[e]=t}function u(e){return function(){return c(e)}}function h(e,t,n){return e===L?f(t,n):M(e,t)}function f(e,t){e&&(e=e.toLowerCase()),t&&(t=t.toLowerCase());var n=d(t||e);if(n){if(e==n.tag&&t==n.is)return new n.ctor;if(!t&&!n.is)return new n.ctor}var o;return t?(o=f(e),o.setAttribute("is",t),o):(o=N(e),e.indexOf("-")>=0&&g(o,HTMLElement),o)}function p(e,t){var n=e[t];e[t]=function(){var e=n.apply(this,arguments);return w(e),e}}var m,v=(e.isIE,e.upgradeDocumentTree),w=e.upgradeAll,_=e.upgradeWithDefinition,g=e.implementPrototype,b=e.useNative,y=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"],E={},L="http://www.w3.org/1999/xhtml",N=document.createElement.bind(document),M=document.createElementNS.bind(document);m=Object.__proto__||b?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;for(var n=e;n;){if(n===t.prototype)return!0;n=n.__proto__}return!1},p(Node.prototype,"cloneNode"),p(document,"importNode"),document.registerElement=t,document.createElement=f,document.createElementNS=h,e.registry=E,e["instanceof"]=m,e.reservedTagList=y,e.getRegisteredDefinition=d,document.register=document.registerElement}),function(e){function t(){i(window.wrap(document)),window.CustomElements.ready=!0;var e=window.requestAnimationFrame||function(e){setTimeout(e,16)};e(function(){setTimeout(function(){window.CustomElements.readyTime=Date.now(),window.HTMLImports&&(window.CustomElements.elapsed=window.CustomElements.readyTime-window.HTMLImports.readyTime),document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))})})}var n=e.useNative,o=e.initializeModules;e.isIE;if(n){var r=function(){};e.watchShadow=r,e.upgrade=r,e.upgradeAll=r,e.upgradeDocumentTree=r,e.upgradeSubtree=r,e.takeRecords=r,e["instanceof"]=function(e,t){return e instanceof t}}else o();var i=e.upgradeDocumentTree,a=e.upgradeDocument;if(window.wrap||(window.ShadowDOMPolyfill?(window.wrap=window.ShadowDOMPolyfill.wrapIfNeeded,window.unwrap=window.ShadowDOMPolyfill.unwrapIfNeeded):window.wrap=window.unwrap=function(e){return e}),window.HTMLImports&&(window.HTMLImports.__importsParsingHook=function(e){e["import"]&&a(wrap(e["import"]))}),"complete"===document.readyState||e.flags.eager)t();else if("interactive"!==document.readyState||window.attachEvent||window.HTMLImports&&!window.HTMLImports.ready){var s=window.HTMLImports&&!window.HTMLImports.ready?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(s,t)}else t()}(window.CustomElements),function(e){var t=document.createElement("style");t.textContent="body {transition: opacity ease-in 0.2s; } \nbody[unresolved] {opacity: 0; display: block; overflow: hidden; position: relative; } \n";var n=document.querySelector("head");n.insertBefore(t,n.firstChild)}(window.WebComponents);
\ No newline at end of file
diff --git a/homeassistant/components/frontend/www_static/webcomponents-lite.min.js.gz b/homeassistant/components/frontend/www_static/webcomponents-lite.min.js.gz
deleted file mode 100644
index 429e986e27344eafba945c8802bb963e3beb7c05..0000000000000000000000000000000000000000
Binary files a/homeassistant/components/frontend/www_static/webcomponents-lite.min.js.gz and /dev/null differ
diff --git a/homeassistant/components/group.py b/homeassistant/components/group.py
index 9985d129a3a3ede4c60d655a8528ff18a1cee619..fb910109d7c4190dc96a3fd9e5351db5605ff24d 100644
--- a/homeassistant/components/group.py
+++ b/homeassistant/components/group.py
@@ -338,7 +338,7 @@ def async_setup(hass, config):
         # remove group
         if service.service == SERVICE_REMOVE:
             if object_id not in service_groups:
-                _LOGGER.warning("Group '%s' not exists!", object_id)
+                _LOGGER.warning("Group '%s' doesn't exist!", object_id)
                 return
 
             del_group = service_groups.pop(object_id)
diff --git a/script/build_frontend b/script/build_frontend
index 7ce2dfb77e1f3e834afcb2b7f7bb6bb73cdd0312..12a4fefca05a650692c4ea07529f9b7fe14d52fa 100755
--- a/script/build_frontend
+++ b/script/build_frontend
@@ -10,13 +10,15 @@ cd "$(dirname "$0")/.."
 rm -rf homeassistant/components/frontend/www_static/core.js* \
        homeassistant/components/frontend/www_static/compatibility.js* \
        homeassistant/components/frontend/www_static/frontend.html* \
-       homeassistant/components/frontend/www_static/webcomponents-lite.min.js* \
+       homeassistant/components/frontend/www_static/webcomponents-lite.js* \
+       homeassistant/components/frontend/www_static/custom-elements-es5-adapter.js* \
        homeassistant/components/frontend/www_static/panels
 cd homeassistant/components/frontend/www_static/home-assistant-polymer
 
 # Build frontend
 BUILD_DEV=0 gulp
-cp bower_components/webcomponentsjs/webcomponents-lite.min.js ..
+cp bower_components/webcomponentsjs/webcomponents-lite.js ..
+cp bower_components/webcomponentsjs/custom-elements-es5-adapter.js ..
 cp build/*.js build/*.html ..
 mkdir ../panels
 cp build/panels/*.html ../panels