UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

2 lines 117 kB
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[5126],{68928:function(e,t,n){"use strict";n.d(t,{WU:function(){return S}});var r=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,o="[1-9]\\d?",i="\\d\\d",a="[^\\s]+",s=/\[([^]*?)\]/gm;function c(e,t){for(var n=[],r=0,o=e.length;r<o;r++)n.push(e[r].substr(0,t));return n}var l=function(e){return function(t,n){var r=n[e].map((function(e){return e.toLowerCase()})).indexOf(t.toLowerCase());return r>-1?r:null}};function u(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,o=t;r<o.length;r++){var i=o[r];for(var a in i)e[a]=i[a]}return e}var f=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],d=["January","February","March","April","May","June","July","August","September","October","November","December"],p=c(d,3),h={dayNamesShort:c(f,3),dayNames:f,monthNamesShort:p,monthNames:d,amPm:["am","pm"],DoFn:function(e){return e+["th","st","nd","rd"][e%10>3?0:(e-e%10!=10?1:0)*e%10]}},m=u({},h),y=function(e,t){for(void 0===t&&(t=2),e=String(e);e.length<t;)e="0"+e;return e},v={D:function(e){return String(e.getDate())},DD:function(e){return y(e.getDate())},Do:function(e,t){return t.DoFn(e.getDate())},d:function(e){return String(e.getDay())},dd:function(e){return y(e.getDay())},ddd:function(e,t){return t.dayNamesShort[e.getDay()]},dddd:function(e,t){return t.dayNames[e.getDay()]},M:function(e){return String(e.getMonth()+1)},MM:function(e){return y(e.getMonth()+1)},MMM:function(e,t){return t.monthNamesShort[e.getMonth()]},MMMM:function(e,t){return t.monthNames[e.getMonth()]},YY:function(e){return y(String(e.getFullYear()),4).substr(2)},YYYY:function(e){return y(e.getFullYear(),4)},h:function(e){return String(e.getHours()%12||12)},hh:function(e){return y(e.getHours()%12||12)},H:function(e){return String(e.getHours())},HH:function(e){return y(e.getHours())},m:function(e){return String(e.getMinutes())},mm:function(e){return y(e.getMinutes())},s:function(e){return String(e.getSeconds())},ss:function(e){return y(e.getSeconds())},S:function(e){return String(Math.round(e.getMilliseconds()/100))},SS:function(e){return y(Math.round(e.getMilliseconds()/10),2)},SSS:function(e){return y(e.getMilliseconds(),3)},a:function(e,t){return e.getHours()<12?t.amPm[0]:t.amPm[1]},A:function(e,t){return e.getHours()<12?t.amPm[0].toUpperCase():t.amPm[1].toUpperCase()},ZZ:function(e){var t=e.getTimezoneOffset();return(t>0?"-":"+")+y(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)},Z:function(e){var t=e.getTimezoneOffset();return(t>0?"-":"+")+y(Math.floor(Math.abs(t)/60),2)+":"+y(Math.abs(t)%60,2)}},g=function(e){return+e-1},b=[null,o],w=[null,a],k=["isPm",a,function(e,t){var n=e.toLowerCase();return n===t.amPm[0]?0:n===t.amPm[1]?1:null}],_=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(e){var t=(e+"").match(/([+-]|\d\d)/gi);if(t){var n=60*+t[1]+parseInt(t[2],10);return"+"===t[0]?n:-n}return 0}],E=(l("monthNamesShort"),l("monthNames"),{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",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"}),S=function(e,t,n){if(void 0===t&&(t=E.default),void 0===n&&(n={}),"number"==typeof e&&(e=new Date(e)),"[object Date]"!==Object.prototype.toString.call(e)||isNaN(e.getTime()))throw new Error("Invalid Date pass to format");var o=[];t=(t=E[t]||t).replace(s,(function(e,t){return o.push(t),"@@@"}));var i=u(u({},m),n);return(t=t.replace(r,(function(t){return v[t](e,i)}))).replace(/@@@/g,(function(){return o.shift()}))}},58993:function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(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)}}n.d(t,{yh:function(){return a},U2:function(){return c},t8:function(){return l},ZH:function(){return u}});var i,a=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"keyval-store",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"keyval";r(this,e),this.storeName=n,this._dbp=new Promise((function(e,r){var o=indexedDB.open(t,1);o.onerror=function(){return r(o.error)},o.onsuccess=function(){return e(o.result)},o.onupgradeneeded=function(){o.result.createObjectStore(n)}}))}var t,n,i;return t=e,(n=[{key:"_withIDBStore",value:function(e,t){var n=this;return this._dbp.then((function(r){return new Promise((function(o,i){var a=r.transaction(n.storeName,e);a.oncomplete=function(){return o()},a.onabort=a.onerror=function(){return i(a.error)},t(a.objectStore(n.storeName))}))}))}}])&&o(t.prototype,n),i&&o(t,i),e}();function s(){return i||(i=new a),i}function c(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s();return n._withIDBStore("readonly",(function(n){t=n.get(e)})).then((function(){return t.result}))}function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s();return n._withIDBStore("readwrite",(function(n){n.put(t,e)}))}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s();return e._withIDBStore("readwrite",(function(e){e.clear()}))}},43274:function(e,t,n){"use strict";n.d(t,{Sb:function(){return r},BF:function(){return o},Op:function(){return i}});var r=function(){try{(new Date).toLocaleDateString("i")}catch(e){return"RangeError"===e.name}return!1}(),o=function(){try{(new Date).toLocaleTimeString("i")}catch(e){return"RangeError"===e.name}return!1}(),i=function(){try{(new Date).toLocaleString("i")}catch(e){return"RangeError"===e.name}return!1}()},44583:function(e,t,n){"use strict";n.d(t,{o:function(){return i},E:function(){return a}});var r=n(68928),o=n(43274),i=o.Op?function(e,t){return e.toLocaleString(t,{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"})}:function(e){return(0,r.WU)(e,"MMMM D, YYYY, HH:mm")},a=o.Op?function(e,t){return e.toLocaleString(t,{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"})}:function(e){return(0,r.WU)(e,"MMMM D, YYYY, HH:mm:ss")}},98762:function(e,t,n){"use strict";n(53918);var r=n(15652);n(31206);function o(e){return(o="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})(e)}function i(){var e=c(["\n      :host {\n        outline: none;\n        display: inline-block;\n        position: relative;\n      }\n\n      mwc-button {\n        transition: all 1s;\n      }\n\n      mwc-button.success {\n        --mdc-theme-primary: white;\n        background-color: var(--success-color);\n        transition: none;\n      }\n\n      mwc-button[raised].success {\n        --mdc-theme-primary: var(--success-color);\n        --mdc-theme-on-primary: white;\n      }\n\n      mwc-button.error {\n        --mdc-theme-primary: white;\n        background-color: var(--error-color);\n        transition: none;\n      }\n\n      mwc-button[raised].error {\n        --mdc-theme-primary: var(--error-color);\n        --mdc-theme-on-primary: white;\n      }\n\n      .progress {\n        bottom: 0;\n        margin-top: 4px;\n        position: absolute;\n        text-align: center;\n        top: 0;\n        width: 100%;\n      }\n    "]);return i=function(){return e},e}function a(){var e=c(['<div class="progress">\n            <ha-circular-progress size="small" active></ha-circular-progress>\n          </div>']);return a=function(){return e},e}function s(){var e=c(["\n      <mwc-button\n        ?raised=","\n        .disabled=","\n        @click=","\n      >\n        <slot></slot>\n      </mwc-button>\n      ","\n    "]);return s=function(){return e},e}function c(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return d(this,n)}}function d(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?p(e):t}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(){m=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(n){t.forEach((function(t){t.kind===n&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var n=e.prototype;["method","field"].forEach((function(r){t.forEach((function(t){var o=t.placement;if(t.kind===r&&("static"===o||"prototype"===o)){var i="static"===o?e:n;this.defineClassElement(i,t)}}),this)}),this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var r=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],r=[],o={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,o)}),this),e.forEach((function(e){if(!g(e))return n.push(e);var t=this.decorateElement(e,o);n.push(t.element),n.push.apply(n,t.extras),r.push.apply(r,t.finishers)}),this),!t)return{elements:n,finishers:r};var i=this.decorateConstructor(n,t);return r.push.apply(r,i.finishers),i.finishers=r,i},addElementPlacement:function(e,t,n){var r=t[e.placement];if(!n&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,t){for(var n=[],r=[],o=e.decorators,i=o.length-1;i>=0;i--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,o[i])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&r.push(c.finisher);var l=c.extras;if(l){for(var u=0;u<l.length;u++)this.addElementPlacement(l[u],t);n.push.apply(n,l)}}return{element:e,finishers:r,extras:n}},decorateConstructor:function(e,t){for(var n=[],r=t.length-1;r>=0;r--){var o=this.fromClassDescriptor(e),i=this.toClassDescriptor((0,t[r])(o)||o);if(void 0!==i.finisher&&n.push(i.finisher),void 0!==i.elements){e=i.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:n}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var n=k(e.key),r=String(e.placement);if("static"!==r&&"prototype"!==r&&"own"!==r)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+r+'"');var o=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var i={kind:t,key:n,placement:r,descriptor:Object.assign({},o)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(o,"get","The property descriptor of a field descriptor"),this.disallowProperty(o,"set","The property descriptor of a field descriptor"),this.disallowProperty(o,"value","The property descriptor of a field descriptor"),i.initializer=e.initializer),i},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:w(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var n=w(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:n}},runClassFinishers:function(e,t){for(var n=0;n<t.length;n++){var r=(0,t[n])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,t,n){if(void 0!==e[t])throw new TypeError(n+" can't have a ."+t+" property.")}};return e}function y(e){var t,n=k(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function v(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function g(e){return e.decorators&&e.decorators.length}function b(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function w(e,t){var n=e[t];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+t+"' to be a function");return n}function k(e){var t=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===o(t)?t:String(t)}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}!function(e,t,n,r){var o=m();if(r)for(var i=0;i<r.length;i++)o=r[i](o);var a=t((function(e){o.initializeInstanceElements(e,s.elements)}),n),s=o.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===i.key&&e.placement===i.placement},r=0;r<e.length;r++){var o,i=e[r];if("method"===i.kind&&(o=t.find(n)))if(b(i.descriptor)||b(o.descriptor)){if(g(i)||g(o))throw new ReferenceError("Duplicated methods ("+i.key+") can't be decorated.");o.descriptor=i.descriptor}else{if(g(i)){if(g(o))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+i.key+").");o.decorators=i.decorators}v(i,o)}else t.push(i)}return t}(a.d.map(y)),e);o.initializeClassElements(a.F,s.elements),o.runClassFinishers(a.F,s.finishers)}([(0,r.Mo)("ha-progress-button")],(function(e,t){return{F:function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(r,t);var n=f(r);function r(){var t;l(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return t=n.call.apply(n,[this].concat(i)),e(p(t)),t}return r}(t),d:[{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"disabled",value:function(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"progress",value:function(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"raised",value:function(){return!1}},{kind:"field",decorators:[(0,r.IO)("mwc-button",!0)],key:"_button",value:void 0},{kind:"method",key:"render",value:function(){return(0,r.dy)(s(),this.raised,this.disabled||this.progress,this._buttonTapped,this.progress?(0,r.dy)(a()):"")}},{kind:"method",key:"actionSuccess",value:function(){this._tempClass("success")}},{kind:"method",key:"actionError",value:function(){this._tempClass("error")}},{kind:"method",key:"_tempClass",value:function(e){var t=this;this._button.classList.add(e),setTimeout((function(){t._button.classList.remove(e)}),1e3)}},{kind:"method",key:"_buttonTapped",value:function(e){this.progress&&e.stopPropagation()}},{kind:"get",static:!0,key:"styles",value:function(){return(0,r.iv)(i())}}]}}),r.oi)},99282:function(e,t,n){"use strict";var r=n(52039),o=n(55317);function i(e){return(i="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})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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)}}function c(e,t,n){return(c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=d(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d(e);if(t){var o=d(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return f(this,n)}}function f(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var p=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(f,e);var t,n,r,i=u(f);function f(){return a(this,f),i.apply(this,arguments)}return t=f,(n=[{key:"connectedCallback",value:function(){var e=this;c(d(f.prototype),"connectedCallback",this).call(this),setTimeout((function(){e.path="ltr"===window.getComputedStyle(e).direction?o.zrb:o.gAv}),100)}}])&&s(t.prototype,n),r&&s(t,r),f}(r.C);customElements.define("ha-icon-next",p)},27434:function(e,t,n){"use strict";n.d(t,{t:function(){return r},z:function(){return o}});var r=function(e){return e.callWS({type:"cloud/alexa/entities"})},o=function(e){return e.callWS({type:"cloud/alexa/sync"})}},92310:function(e,t,n){"use strict";n.r(t);var r=n(15652),o=n(83849),i=n(18199),a=(n(53918),n(89194),n(50856)),s=n(28426),c=n(44583),l=(n(60458),n(22098),n(83270)),u=(n(60010),n(11052)),f=n(1265),d=n(87744),p=(n(3426),n(88165),n(47181)),h=(n(43709),n(27434));function m(e){return(m="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})(e)}function y(){var e=_(['\n      a {\n        color: var(--primary-color);\n      }\n      .switch {\n        position: absolute;\n        right: 24px;\n        top: 32px;\n      }\n      :host([dir="rtl"]) .switch {\n        right: auto;\n        left: 24px;\n      }\n      .card-actions {\n        display: flex;\n      }\n      .card-actions a {\n        text-decoration: none;\n      }\n      .spacer {\n        flex-grow: 1;\n      }\n      .state-reporting {\n        display: flex;\n        margin-top: 1.5em;\n      }\n      .state-reporting + p {\n        margin-top: 0.5em;\n      }\n      .state-reporting h3 {\n        flex-grow: 1;\n        margin: 0;\n      }\n      .state-reporting-switch {\n        margin-top: 0.25em;\n        margin-right: 7px;\n        margin-left: 0.5em;\n      }\n    ']);return y=function(){return e},e}function v(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,o)}function g(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){v(i,r,o,a,s,"next",e)}function s(e){v(i,r,o,a,s,"throw",e)}a(void 0)}))}}function b(){var e=_(['\n                <div class="state-reporting">\n                  <h3>\n                    ','\n                  </h3>\n                  <div class="state-reporting-switch">\n                    <ha-switch\n                      .checked=',"\n                      @change=","\n                    ></ha-switch>\n                  </div>\n                </div>\n                <p>\n                  ","\n                </p>\n              "]);return b=function(){return e},e}function w(){var e=_(["\n      <ha-card\n        header=",'\n      >\n        <div class="switch">\n          <ha-switch\n            .checked=',"\n            @change=",'\n          ></ha-switch>\n        </div>\n        <div class="card-content">\n          ','\n          <ul>\n            <li>\n              <a\n                href="https://skills-store.amazon.com/deeplink/dp/B0772J1QKB?deviceType=app"\n                target="_blank"\n                rel="noreferrer"\n              >\n                ','\n              </a>\n            </li>\n            <li>\n              <a\n                href="https://www.nabucasa.com/config/amazon_alexa/"\n                target="_blank"\n                rel="noreferrer"\n              >\n                ',"\n              </a>\n            </li>\n          </ul>\n          ",'\n        </div>\n        <div class="card-actions">\n          <mwc-button @click='," .disabled=",">\n            ",'\n          </mwc-button>\n          <div class="spacer"></div>\n          <a href="/config/cloud/alexa">\n            <mwc-button\n              >',"</mwc-button\n            >\n          </a>\n        </div>\n      </ha-card>\n    "]);return w=function(){return e},e}function k(){var e=_([""]);return k=function(){return e},e}function _(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S(e,t){return(S=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=D(e);if(t){var o=D(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return x(this,n)}}function x(e,t){return!t||"object"!==m(t)&&"function"!=typeof t?O(e):t}function O(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D(e){return(D=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function z(){z=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(n){t.forEach((function(t){t.kind===n&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var n=e.prototype;["method","field"].forEach((function(r){t.forEach((function(t){var o=t.placement;if(t.kind===r&&("static"===o||"prototype"===o)){var i="static"===o?e:n;this.defineClassElement(i,t)}}),this)}),this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var r=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],r=[],o={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,o)}),this),e.forEach((function(e){if(!T(e))return n.push(e);var t=this.decorateElement(e,o);n.push(t.element),n.push.apply(n,t.extras),r.push.apply(r,t.finishers)}),this),!t)return{elements:n,finishers:r};var i=this.decorateConstructor(n,t);return r.push.apply(r,i.finishers),i.finishers=r,i},addElementPlacement:function(e,t,n){var r=t[e.placement];if(!n&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,t){for(var n=[],r=[],o=e.decorators,i=o.length-1;i>=0;i--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,o[i])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&r.push(c.finisher);var l=c.extras;if(l){for(var u=0;u<l.length;u++)this.addElementPlacement(l[u],t);n.push.apply(n,l)}}return{element:e,finishers:r,extras:n}},decorateConstructor:function(e,t){for(var n=[],r=t.length-1;r>=0;r--){var o=this.fromClassDescriptor(e),i=this.toClassDescriptor((0,t[r])(o)||o);if(void 0!==i.finisher&&n.push(i.finisher),void 0!==i.elements){e=i.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:n}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return F(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?F(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var n=M(e.key),r=String(e.placement);if("static"!==r&&"prototype"!==r&&"own"!==r)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+r+'"');var o=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var i={kind:t,key:n,placement:r,descriptor:Object.assign({},o)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(o,"get","The property descriptor of a field descriptor"),this.disallowProperty(o,"set","The property descriptor of a field descriptor"),this.disallowProperty(o,"value","The property descriptor of a field descriptor"),i.initializer=e.initializer),i},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:R(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var n=R(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:n}},runClassFinishers:function(e,t){for(var n=0;n<t.length;n++){var r=(0,t[n])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,t,n){if(void 0!==e[t])throw new TypeError(n+" can't have a ."+t+" property.")}};return e}function j(e){var t,n=M(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function C(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function T(e){return e.decorators&&e.decorators.length}function A(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function R(e,t){var n=e[t];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+t+"' to be a function");return n}function M(e){var t=function(e,t){if("object"!==m(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==m(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===m(t)?t:String(t)}function F(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var I=function(e,t,n,r){var o=z();if(r)for(var i=0;i<r.length;i++)o=r[i](o);var a=t((function(e){o.initializeInstanceElements(e,s.elements)}),n),s=o.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===i.key&&e.placement===i.placement},r=0;r<e.length;r++){var o,i=e[r];if("method"===i.kind&&(o=t.find(n)))if(A(i.descriptor)||A(o.descriptor)){if(T(i)||T(o))throw new ReferenceError("Duplicated methods ("+i.key+") can't be decorated.");o.descriptor=i.descriptor}else{if(T(i)){if(T(o))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+i.key+").");o.decorators=i.decorators}C(i,o)}else t.push(i)}return t}(a.d.map(j)),e);return o.initializeClassElements(a.F,s.elements),o.runClassFinishers(a.F,s.finishers)}(null,(function(e,t){var n,o,i;return{F:function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&S(e,t)}(r,t);var n=P(r);function r(){var t;E(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return t=n.call.apply(n,[this].concat(i)),e(O(t)),t}return r}(t),d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"cloudStatus",value:void 0},{kind:"field",decorators:[(0,r.sz)()],key:"_syncing",value:function(){return!1}},{kind:"method",key:"render",value:function(){if(!this.cloudStatus)return(0,r.dy)(k());var e=this.cloudStatus.prefs,t=e.alexa_enabled,n=e.alexa_report_state;return(0,r.dy)(w(),this.hass.localize("ui.panel.config.cloud.account.alexa.title"),t,this._enabledToggleChanged,this.hass.localize("ui.panel.config.cloud.account.alexa.info"),this.hass.localize("ui.panel.config.cloud.account.alexa.enable_ha_skill"),this.hass.localize("ui.panel.config.cloud.account.alexa.config_documentation"),t?(0,r.dy)(b(),this.hass.localize("ui.panel.config.cloud.account.alexa.enable_state_reporting"),n,this._reportToggleChanged,this.hass.localize("ui.panel.config.cloud.account.alexa.info_state_reporting")):"",this._handleSync,this._syncing,this.hass.localize("ui.panel.config.cloud.account.alexa.sync_entities"),this.hass.localize("ui.panel.config.cloud.account.alexa.manage_entities"))}},{kind:"method",key:"_handleSync",value:(i=g(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._syncing=!0,e.prev=1,e.next=4,(0,h.z)(this.hass);case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),alert("".concat(this.hass.localize("ui.panel.config.cloud.account.alexa.sync_entities_error")," ").concat(e.t0.body.message));case 9:return e.prev=9,this._syncing=!1,e.finish(9);case 12:case"end":return e.stop()}}),e,this,[[1,6,9,12]])}))),function(){return i.apply(this,arguments)})},{kind:"method",key:"_enabledToggleChanged",value:(o=g(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.target,e.prev=1,e.next=4,(0,l.LV)(this.hass,{alexa_enabled:n.checked});case 4:(0,p.B)(this,"ha-refresh-cloud-status"),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),n.checked=!n.checked;case 10:case"end":return e.stop()}}),e,this,[[1,7]])}))),function(e){return o.apply(this,arguments)})},{kind:"method",key:"_reportToggleChanged",value:(n=g(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.target,e.prev=1,e.next=4,(0,l.LV)(this.hass,{alexa_report_state:n.checked});case 4:(0,p.B)(this,"ha-refresh-cloud-status"),e.next=11;break;case 7:e.prev=7,e.t0=e.catch(1),alert("".concat(this.hass.localize("ui.panel.config.cloud.account.alexa.state_reporting_error","enable_disable",this.hass.localize(n.checked?"ui.panel.config.cloud.account.alexa.enable":"ui.panel.config.cloud.account.alexa.disable"))," ").concat(e.t0.message)),n.checked=!n.checked;case 11:case"end":return e.stop()}}),e,this,[[1,7]])}))),function(e){return n.apply(this,arguments)})},{kind:"get",static:!0,key:"styles",value:function(){return(0,r.iv)(y())}}]}}),r.oi);customElements.define("cloud-alexa-pref",I);n(30879);var Y=n(98573);function H(e){return(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})(e)}function L(){var e=q(['\n      a {\n        color: var(--primary-color);\n      }\n      .switch {\n        position: absolute;\n        right: 24px;\n        top: 32px;\n      }\n      :host([dir="rtl"]) .switch {\n        right: auto;\n        left: 24px;\n      }\n      ha-call-api-button {\n        color: var(--primary-color);\n        font-weight: 500;\n      }\n      .secure_devices {\n        padding-top: 8px;\n      }\n      paper-input {\n        width: 250px;\n      }\n      .card-actions {\n        display: flex;\n      }\n      .card-actions a {\n        text-decoration: none;\n      }\n      .spacer {\n        flex-grow: 1;\n      }\n      .state-reporting {\n        display: flex;\n        margin-top: 1.5em;\n      }\n      .state-reporting + p {\n        margin-top: 0.5em;\n      }\n      h3 {\n        margin: 0 0 8px 0;\n      }\n      .state-reporting h3 {\n        flex-grow: 1;\n        margin: 0;\n      }\n      .state-reporting-switch {\n        margin-top: 0.25em;\n        margin-right: 7px;\n        margin-left: 0.5em;\n      }\n    ']);return L=function(){return e},e}function B(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,o)}function W(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){N(i,r,o,a,s,"next",e)}function s(e){N(i,r,o,a,s,"throw",e)}a(void 0)}))}}function U(){var e=q(['\n                <div class="state-reporting">\n                  <h3>\n                    ','\n                  </h3>\n                  <div class="state-reporting-switch">\n                    <ha-switch\n                      .checked=',"\n                      @change=","\n                    ></ha-switch>\n                  </div>\n                </div>\n                <p>\n                  ",'\n                </p>\n                <div class="secure_devices">\n                  <h3>\n                    ',"\n                  </h3>\n                  ",'\n                  <paper-input\n                    label="','"\n                    id="google_secure_devices_pin"\n                    placeholder="','"\n                    .value=','\n                    @change="','"\n                  ></paper-input>\n                </div>\n              ']);return U=function(){return e},e}function $(){var e=q(["\n      <ha-card\n        header=",'\n      >\n        <div class="switch">\n          <ha-switch\n            id="google_enabled"\n            .checked="','"\n            @change="','"\n          ></ha-switch>\n        </div>\n        <div class="card-content">\n          ','\n          <ul>\n            <li>\n              <a\n                href="https://assistant.google.com/services/a/uid/00000091fd5fb875?hl=en-US"\n                target="_blank"\n                rel="noreferrer"\n              >\n                ','\n              </a>\n            </li>\n            <li>\n              <a\n                href="https://www.nabucasa.com/config/google_assistant/"\n                target="_blank"\n                rel="noreferrer"\n              >\n                ',"\n              </a>\n            </li>\n          </ul>\n          ",'\n        </div>\n        <div class="card-actions">\n          <ha-call-api-button\n            .hass=','\n            .disabled="','"\n            @hass-api-called=','\n            path="cloud/google_actions/sync"\n          >\n            ','\n          </ha-call-api-button>\n          <div class="spacer"></div>\n          <a href="/config/cloud/google-assistant">\n            <mwc-button\n              >',"</mwc-button\n            >\n          </a>\n        </div>\n      </ha-card>\n    "]);return $=function(){return e},e}function Z(){var e=q([""]);return Z=function(){return e},e}function q(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function V(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J(e,t){return(J=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Q(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=X(e);if(t){var o=X(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return K(this,n)}}function K(e,t){return!t||"object"!==H(t)&&"function"!=typeof t?G(e):t}function G(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function X(e){return(X=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ee(){ee=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(n){t.forEach((function(t){t.kind===n&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var n=e.prototype;["method","field"].forEach((function(r){t.forEach((function(t){var o=t.placement;if(t.kind===r&&("static"===o||"prototype"===o)){var i="static"===o?e:n;this.defineClassElement(i,t)}}),this)}),this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var r=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],r=[],o={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,o)}),this),e.forEach((function(e){if(!re(e))return n.push(e);var t=this.decorateElement(e,o);n.push(t.element),n.push.apply(n,t.extras),r.push.apply(r,t.finishers)}),this),!t)return{elements:n,finishers:r};var i=this.decorateConstructor(n,t);return r.push.apply(r,i.finishers),i.finishers=r,i},addElementPlacement:function(e,t,n){var r=t[e.placement];if(!n&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,t){for(var n=[],r=[],o=e.decorators,i=o.length-1;i>=0;i--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,o[i])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&r.push(c.finisher);var l=c.extras;if(l){for(var u=0;u<l.length;u++)this.addElementPlacement(l[u],t);n.push.apply(n,l)}}return{element:e,finishers:r,extras:n}},decorateConstructor:function(e,t){for(var n=[],r=t.length-1;r>=0;r--){var o=this.fromClassDescriptor(e),i=this.toClassDescriptor((0,t[r])(o)||o);if(void 0!==i.finisher&&n.push(i.finisher),void 0!==i.elements){e=i.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:n}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return se(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?se(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var n=ae(e.key),r=String(e.placement);if("static"!==r&&"prototype"!==r&&"own"!==r)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+r+'"');var o=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var i={kind:t,key:n,placement:r,descriptor:Object.assign({},o)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(o,"get","The property descriptor of a field descriptor"),this.disallowProperty(o,"set","The property descriptor of a field descriptor"),this.disallowProperty(o,"value","The property descriptor of a field descriptor"),i.initializer=e.initializer),i},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:ie(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var n=ie(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:n}},runClassFinishers:function(e,t){for(var n=0;n<t.length;n++){var r=(0,t[n])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,t,n){if(void 0!==e[t])throw new TypeError(n+" can't have a ."+t+" property.")}};return e}function te(e){var t,n=ae(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function ne(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function re(e){return e.decorators&&e.decorators.length}function oe(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function ie(e,t){var n=e[t];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+t+"' to be a function");return n}function ae(e){var t=function(e,t){if("object"!==H(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==H(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===H(t)?t:String(t)}function se(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ce=function(e,t,n,r){var o=ee();if(r)for(var i=0;i<r.length;i++)o=r[i](o);var a=t((function(e){o.initializeInstanceElements(e,s.elements)}),n),s=o.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===i.key&&e.placement===i.placement},r=0;r<e.length;r++){var o,i=e[r];if("method"===i.kind&&(o=t.find(n)))if(oe(i.descriptor)||oe(o.descriptor)){if(re(i)||re(o))throw new ReferenceError("Duplicated methods ("+i.key+") can't be decorated.");o.descriptor=i.descriptor}else{if(re(i)){if(re(o))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+i.key+").");o.decorators=i.decorators}ne(i,o)}else t.push(i)}return t}(a.d.map(te)),e);return o.initializeClassElements(a.F,s.elements),o.runClassFinishers(a.F,s.finishers)}(null,(function(e,t){var n,o,i;return{F:function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&J(e,t)}(r,t);var n=Q(r);function r(){var t;V(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return t=n.call.apply(n,[this].concat(i)),e(G(t)),t}return r}(t),d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"cloudStatus",value:void 0},{kind:"method",key:"render",value:function(){if(!this.cloudStatus)return(0,r.dy)(Z());var e=this.cloudStatus.prefs,t=e.google_enabled,n=e.google_report_state,o=e.google_secure_devices_pin;return(0,r.dy)($(),this.hass.localize("ui.panel.config.cloud.account.google.title"),t,this._enableToggleChanged,this.hass.localize("ui.panel.config.cloud.account.google.info"),this.hass.localize("ui.panel.config.cloud.account.google.enable_ha_skill"),this.hass.localize("ui.panel.config.cloud.account.google.config_documentation"),t?(0,r.dy)(U(),this.hass.localize("ui.panel.config.cloud.account.google.enable_state_reporting"),n,this._reportToggleChanged,this.hass.localize("ui.panel.config.cloud.account.google.info_state_reporting"),this.hass.localize("ui.panel.config.cloud.account.google.security_devices"),this.hass.localize("ui.panel.config.cloud.account.google.enter_pin_info"),this.hass.localize("ui.panel.config.cloud.account.google.devices_pin"),this.hass.localize("ui.panel.config.cloud.account.google.enter_pin_hint"),o||"",this._pinChanged):"",this.hass,!t,this._syncEntitiesCalled,this.hass.localize("ui.panel.config.cloud.account.google.sync_entities"),this.hass.localize("ui.panel.config.cloud.account.google.manage_entities"))}},{kind:"method",key:"_syncEntitiesCalled",value:function(e){e.detail.success||404!==e.detail.response.status_code||alert(this.hass.localize("ui.panel.config.cloud.account.google.sync_entities_404_message"))}},{kind:"method",key:"_enableToggleChanged",value:(i=W(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.target,e.prev=1,e.next=4,(0,l.LV)(this.hass,B({},n.id,n.checked));case 4:(0,p.B)(this,"ha-refresh-cloud-status"),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),n.checked=!n.checked;case 10:case"end":return e.stop()}}),e,this,[[1,7]])}))),function(e){return i.apply(this,arguments)})},{kind:"method",key:"_reportToggleChanged",value:(o=W(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.target,e.prev=1,e.next=4,(0,l.LV)(this.hass,{google_report_state:n.checked});case 4:(0,p.B)(this,"ha-refresh-cloud-status"),e.next=11;break;case 7:e.prev=7,e.t0=e.catch(1),alert("Unable to ".concat(n.checked?"enable":"disable"," report state. ").concat(e.t0.message)),n.checked=!n.checked;case 11:case"end":return e.stop()}}),e,this,[[1,7]])}))),function(e){return o.apply(this,arguments)})},{kind:"method",key:"_pinChanged",value:(n=W(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.target,e.prev=1,e.next=4,(0,l.LV)(this.hass,B({},n.id,n.value||null));case 4:(0,Y.f)(this,this.hass),(0,p.B)(this,"ha-refresh-cloud-status"),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),alert("".concat(this.hass.localize("ui.panel.config.cloud.account.google.enter_pin_error")," ").concat(e.t0.message)),n.value=this.cloudStatus.prefs.google_secure_devices_pin;case 12:case"end":return e.stop()}}),e,this,[[1,8]])}))),function(e){return n.apply(this,arguments)})},{kind:"get",static:!0,key:"styles",value:function(){return(0,r.iv)(L())}}]}}),r.oi);customElements.define("cloud-google-pref",ce);function le(e){return(le="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})(e)}function ue(){var e=ye(['\n      .preparing {\n        padding: 0 16px 16px;\n      }\n      a {\n        color: var(--primary-color);\n      }\n      .break-word {\n        overflow-wrap: break-word;\n      }\n      .switch {\n        position: absolute;\n        right: 24px;\n        top: 32px;\n      }\n      :host([dir="rtl"]) .switch {\n        right: auto;\n        left: 24px;\n      }\n      .card-actions {\n        display: flex;\n      }\n      .card-actions a {\n        text-decoration: none;\n      }\n      .spacer {\n        flex-grow: 1;\n      }\n    ']);return ue=function(){return e},e}function fe(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,o)}function de(){var e=ye(['\n                <div class="spacer"></div>\n                <mwc-button @click=',">\n                  ","\n                </mwc-button>\n              "]);return de=function(){return e},e}function pe(){var e=ye(["\n      <ha-card\n        header=",'\n      >\n        <div class="switch">\n          <ha-switch\n            .checked="','"\n            @change="','"\n          ></ha-switch>\n        </div>\n        <div class="card-content">\n          ',"\n          ",'\n          <a\n            href="https://','"\n            target="_blank"\n            class="break-word"\n            rel="noreferrer"\n          >\n            https://','</a\n          >.\n        </div>\n        <div class="card-actions">\n          <a\n            href="https://www.nabucasa.com/config/remote/"\n            target="_blank"\n            rel="noreferrer"\n          >\n            <mwc-button\n              >',"</mwc-button\n            >\n          </a>\n          ","\n        </div>\n      </ha-card>\n    "]);return pe=function(){return e},e}function he(){var e=ye(["\n        <ha-card\n          header=",'\n        >\n          <div class="preparing">\n            ',"\n          </div>\n        </ha-card>\n      "]);return he=function(){return e},e}function me(){var e=ye([""]);return me=function(){return e},e}function ye(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ge(e,t){return(ge=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function be(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=_e(e);if(t){var o=_e(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return we(this,n)}}function we(e,t){return!t||"object"!==le(t)&&"function"!=typeof t?ke(e):t}function ke(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _e(e){return(_e=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ee(){Ee=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(n){t.forEach((function(t){t.kind===n&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var n=e.prototype;["method","field"].forEach((function(r){t.forEach((function(t){var o=t.placement;if(t.kind===r&&("static"===o||"prototype"===o)){var i="static"===o?e:n;this.defineClassElement(i,t)}}),this)}),this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var r=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],r=[],o={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,o)}),this),e.forEach((function(e){if(!xe(e))return n.push(e);var t=this.decorateElement(e,o);n.push(t.element),n.push.apply(n,t.extras),r.push.apply(r,t.finishers)}),this),!t)return{elements:n,finishers:r};var i=this.decorateConstructor(n,t);return r.push.apply(r,i.finishers),i.finishers=r,i},addElementPlacement:function(e,t,n){var r=t[e.placement];if(!n&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,t){for(var n=[],r=[],o=e.decorators,i=o.length-1;i>=0;i--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,o[i])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&r.push(c.finisher);var l=c.extras;if(l){for(var u=0;u<l.length;u++)this.addElementPlacement(l[u],t);n.push.apply(n,l)}}return{element:e,finishers:r,extras:n}},decorateConstructor:function(e,t){for(var n=[],r=t.length-1;r>=0;r--){var o=this.fromClassDescriptor(e),i=this.toClassDescriptor((0,t[r])(o)||o);if(void 0!==i.finisher&&n.push(i.finisher),void 0!==i.elements){e=i.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:n}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return je(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?je(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var n=ze(e.key),r=String(e.placement);if("static"!==r&&"prototype"!==r&&"own"!==r)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+r+'"');var o=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var i={kind:t,key:n,placement:r,descriptor:Object.assign({},o)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(o,"get","The property descriptor of a field descriptor"),this.disallowProperty(o,"set","The property descriptor of a field descriptor"),this.disallowProperty(o,"value","The property descriptor of a field descriptor"),i.initializer=e.initializer),i},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:De(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var n=De(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:n}},runClassFinishers:function(e,t){for(var n=0;n<t.length;n++){var r=(0,t[n])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,t,n){if(void 0!==e[t])throw new TypeError(n+" can't have a ."+t+" property.")}};return e}function Se(e){var t,n=ze(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function Pe(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function xe(e){return e.decorators&&e.decorators.length}function Oe(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function De(e,t){var n=e[t];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+t+"' to be a function");return n}function ze(e){var t=function(e,t){if("object"!==le(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==le(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===le(t)?t:String(t)}function je(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}(function(e,t,n,r){var o=Ee();if(r)for(var i=0;i<r.length;i++)o=r[i](o);var a=t((function(e){o.initializeInstanceElements(e,s.elements)}),n),s=o.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===i.key&&e.placement===i.placement},r=0;r<e.length;r++){var o,i=e[r];if("method"===i.kind&&(o=t.find(n)))if(Oe(i.descriptor)||Oe(o.descriptor)){if(xe(i)||xe(o))throw new ReferenceError("Duplicated methods ("+i.key+") can't be decorated.");o.descriptor=i.descriptor}else{if(xe(i)){if(xe(o))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+i.key+").");o.decorators=i.decorators}Pe(i,o)}else t.push(i)}return t}(a.d.map(Se)),e);o.initializeClassElements(a.F,s.elements),o.runClassFinishers(a.F,s.finishers)})([(0,r.Mo)("cloud-remote-pref")],(function(e,t){var o,i;return{F:function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ge(e,t)}(r,t);var n=be(r);function r(){var t;ve(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return t=n.call.apply(n,[this].concat(i)),e(ke(t)),t}return r}(t),d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"cloudStatus",value:void 0},{kind:"method",key:"render",value:function(){if(!this.cloudStatus)return(0,r.dy)(me());var e=this.cloudStatus,t=e.remote_connected,n=e.remote_domain,o=e.remote_certificate;return o?(0,r.dy)(pe(),this.hass.localize("ui.panel.config.cloud.account.remote.title"),t,this._toggleChanged,this.hass.localize("ui.panel.config.cloud.account.remote.info"),t?this.hass.localize("ui.panel.config.cloud.account.remote.instance_is_available"):this.hass.localize("ui.panel.config.cloud.account.remote.instance_will_be_available"),n,n,this.hass.localize("ui.panel.config.cloud.account.remote.link_learn_how_it_works"),o?(0,r.dy)(de(),this._openCertInfo,this.hass.localize("ui.panel.config.cloud.account.remote.certificate_info")):""):(0,r.dy)(he(),this.hass.localize("ui.panel.config.cloud.account.remote.title"),this.hass.localize("ui.panel.config.cloud.account.remote.access_is_being_prepared"))}},{kind:"method",key:"_openCertInfo",value:function(){var e,t;e=this,t={certificateInfo:this.cloudStatus.remote_certificate},(0,p.B)(e,"show-dialog",{dialogTag:"dialog-cloud-certificate",dialogImport:function(){return Promise.all([n.e(5009),n.e(808),n.e(5208)]).then(n.bind(n,89394))},dialogParams:t})}},{kind:"method",key:"_toggleChanged",value:(o=regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.target,e.prev=1,!n.checked){e.next=7;break}return e.next=5,(0,l.dn)(this.hass);case 5:e.next=9;break;case 7:return e.next=9,(0,l.H9)(this.hass);case 9:(0,p.B)(this,"ha-refresh-cloud-status"),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(1),alert(e.t0.message),n.checked=!n.checked;case 16:case"end":return e.stop()}}),e,this,[[1,12]])})),i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function a(e){fe(i,n,r,a,s,"next",e)}function s(e){fe(i,n,r,a,s,"throw",e)}a(void 0)}))},function(e){return i.apply(this,arguments)})},{kind:"get",static:!0,key:"styles",value:function(){return(0,r.iv)(ue())}}]}}),r.oi),n(53973),n(31206),n(14089);var Ce=n(11654);function Te(e){return(Te="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})(e)}function Ae(){var e=$e(["\n        .body-text {\n          padding: 8px 0;\n        }\n        .webhook {\n          display: flex;\n          padding: 4px 0;\n        }\n        .progress {\n          margin-right: 16px;\n          display: flex;\n          flex-direction: column;\n          justify-content: center;\n        }\n        .footer {\n          padding-top: 16px;\n        }\n        .body-text a,\n        .footer a {\n          color: var(--primary-color);\n        }\n        ha-settings-row {\n          padding: 0;\n        }\n      "]);return Ae=function(){return e},e}function Re(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Me(e){return function(e){if(Array.isArray(e))return it(e)}(e)||at(e)||ot(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fe(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,o)}function Ie(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Fe(i,r,o,a,s,"next",e)}function s(e){Fe(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Ye(){var e=$e(["<ha-switch @click=",">\n                        </ha-switch>"]);return Ye=function(){return e},e}function He(){var e=$e(['\n                          <mwc-button @click="','">\n                            ',"\n                          </mwc-button>\n                        "]);return He=function(){return e},e}function Le(){var e=$e(['\n                          <div class="progress">\n                            <ha-circular-progress active></ha-circular-progress>\n                          </div>\n                        ']);return Le=function(){return e},e}function Be(){var e=$e(["\n                  <ha-settings-row .narrow="," .entry=",'>\n                    <span slot="heading">\n                      ',"\n                      ",'\n                    </span>\n                    <span slot="description">',"</span>\n                    ","\n                  </ha-settings-row>\n                "]);return Be=function(){return e},e}function Ne(){var e=$e(['\n                <div class="body-text">\n                  ','\n                  <a href="/config/integrations"\n                    >',"\n                  </a>\n                  ",'\n                  <a href="/config/automation/new"\n                    >',"</a\n                  >.\n                </div>\n              "]);return Ne=function(){return e},e}function We(){var e=$e(['\n                <div class="body-text">\n                  ',"\n                </div>\n              "]);return We=function(){return e},e}function Ue(){var e=$e(["\n      <ha-card\n        header=",'\n      >\n        <div class="card-content">\n          ',"\n          ",'\n          <div class="footer">\n            <a\n              href="https://www.nabucasa.com/config/webhooks"\n              target="_blank"\n              rel="noreferrer"\n            >\n              ',"\n            </a>\n          </div>\n        </div>\n      </ha-card>\n    "]);return Ue=function(){return e},e}function $e(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Ze(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qe(e,t){return(qe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ve(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ct(e);if(t){var o=ct(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Je(this,n)}}function Je(e,t){return!t||"object"!==Te(t)&&"function"!=typeof t?Qe(e):t}function Qe(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ke(){Ke=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(n){t.forEach((function(t){t.kind===n&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var n=e.prototype;["method","field"].forEach((function(r){t.forEach((function(t){var o=t.placement;if(t.kind===r&&("static"===o||"prototype"===o)){var i="static"===o?e:n;this.defineClassElement(i,t)}}),this)}),this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var r=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],r=[],o={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,o)}),this),e.forEach((function(e){if(!et(e))return n.push(e);var t=this.decorateElement(e,o);n.push(t.element),n.push.apply(n,t.extras),r.push.apply(r,t.finishers)}),this),!t)return{elements:n,finishers:r};var i=this.decorateConstructor(n,t);return r.push.apply(r,i.finishers),i.finishers=r,i},addElementPlacement:function(e,t,n){var r=t[e.placement];if(!n&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,t){for(var n=[],r=[],o=e.decorators,i=o.length-1;i>=0;i--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,o[i])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&r.push(c.finisher);var l=c.extras;if(l){for(var u=0;u<l.length;u++)this.addElementPlacement(l[u],t);n.push.apply(n,l)}}return{element:e,finishers:r,extras:n}},decorateConstructor:function(e,t){for(var n=[],r=t.length-1;r>=0;r--){var o=this.fromClassDescriptor(e),i=this.toClassDescriptor((0,t[r])(o)||o);if(void 0!==i.finisher&&n.push(i.finisher),void 0!==i.elements){e=i.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:n}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||at(t)||ot(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var n=rt(e.key),r=String(e.placement);if("static"!==r&&"prototype"!==r&&"own"!==r)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+r+'"');var o=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var i={kind:t,key:n,placement:r,descriptor:Object.assign({},o)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(o,"get","The property descriptor of a field descriptor"),this.disallowProperty(o,"set","The property descriptor of a field descriptor"),this.disallowProperty(o,"value","The property descriptor of a field descriptor"),i.initializer=e.initializer),i},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:nt(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var n=nt(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:n}},runClassFinishers:function(e,t){for(var n=0;n<t.length;n++){var r=(0,t[n])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,t,n){if(void 0!==e[t])throw new TypeError(n+" can't have a ."+t+" property.")}};return e}function Ge(e){var t,n=rt(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function Xe(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function et(e){return e.decorators&&e.decorators.length}function tt(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function nt(e,t){var n=e[t];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+t+"' to be a function");return n}function rt(e){var t=function(e,t){if("object"!==Te(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Te(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Te(t)?t:String(t)}function ot(e,t){if(e){if("string"==typeof e)return it(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?it(e,t):void 0}}function it(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function at(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function st(e,t,n){return(st="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=ct(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function ct(e){return(ct=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e,t,n,r){var o=Ke();if(r)for(var i=0;i<r.length;i++)o=r[i](o);var a=t((function(e){o.initializeInstanceElements(e,s.elements)}),n),s=o.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===i.key&&e.placement===i.placement},r=0;r<e.length;r++){var o,i=e[r];if("method"===i.kind&&(o=t.find(n)))if(tt(i.descriptor)||tt(o.descriptor)){if(et(i)||et(o))throw new ReferenceError("Duplicated methods ("+i.key+") can't be decorated.");o.descriptor=i.descriptor}else{if(et(i)){if(et(o))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+i.key+").");o.decorators=i.decorators}Xe(i,o)}else t.push(i)}return t}(a.d.map(Ge)),e);o.initializeClassElements(a.F,s.elements),o.runClassFinishers(a.F,s.finishers)}([(0,r.Mo)("cloud-webhooks")],(function(e,t){var o,i,a,s=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&qe(e,t)}(r,t);var n=Ve(r);function r(){var t;Ze(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return t=n.call.apply(n,[this].concat(i)),e(Qe(t)),t}return r}(t);return{F:s,d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"cloudStatus",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"narrow",value:void 0},{kind:"field",decorators:[(0,r.sz)()],key:"_cloudHooks",value:void 0},{kind:"field",decorators:[(0,r.sz)()],key:"_localHooks",value:void 0},{kind:"field",decorators:[(0,r.sz)()],key:"_progress",value:function(){return[]}},{kind:"method",key:"connectedCallback",value:function(){st(ct(s.prototype),"connectedCallback",this).call(this),this._fetchData()}},{kind:"method",key:"render",value:function(){var e=this;return(0,r.dy)(Ue(),this.hass.localize("ui.panel.config.cloud.account.webhooks.title"),this.hass.localize("ui.panel.config.cloud.account.webhooks.info"),this.cloudStatus&&this._localHooks&&this._cloudHooks&&this.hass?0===this._localHooks.length?(0,r.dy)(Ne(),this.hass.localize("ui.panel.config.cloud.account.webhooks.no_hooks_yet"),this.hass.localize("ui.panel.config.cloud.account.webhooks.no_hooks_yet_link_integration"),this.hass.localize("ui.panel.config.cloud.account.webhooks.no_hooks_yet2"),this.hass.localize("ui.panel.config.cloud.account.webhooks.no_hooks_yet_link_automation")):this._localHooks.map((function(t){return(0,r.dy)(Be(),e.narrow,t,t.name,t.domain!==t.name.toLowerCase()?" (".concat(t.domain,")"):"",t.webhook_id,e._progress.includes(t.webhook_id)?(0,r.dy)(Le()):e._cloudHooks[t.webhook_id]?(0,r.dy)(He(),e._handleManageButton,e.hass.localize("ui.panel.config.cloud.account.webhooks.manage")):(0,r.dy)(Ye(),e._enableWebhook))})):(0,r.dy)(We(),this.hass.localize("ui.panel.config.cloud.account.webhooks.loading")),this.hass.localize("ui.panel.config.cloud.account.webhooks.link_learn_more"))}},{kind:"method",key:"updated",value:function(e){st(ct(s.prototype),"updated",this).call(this,e),e.has("cloudStatus")&&this.cloudStatus&&(this._cloudHooks=this.cloudStatus.prefs.cloudhooks||{})}},{kind:"method",key:"_showDialog",value:function(e){var t,r,o=this,i=this._localHooks.find((function(t){return t.webhook_id===e})),a=this._cloudHooks[e];t=this,r={webhook:i,cloudhook:a,disableHook:function(){return o._disableWebhook(e)}},(0,p.B)(t,"show-dialog",{dialogTag:"dialog-manage-cloudhook",dialogImport:function(){return Promise.all([n.e(5009),n.e(3047),n.e(4885)]).then(n.bind(n,70975))},dialogParams:r})}},{kind:"method",key:"_handleManageButton",value:function(e){var t=e.currentTarget.parentElement.entry;this._showDialog(t.webhook_id)}},{kind:"method",key:"_enableWebhook",value:(a=Ie(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.currentTarget.parentElement.entry,this._progress=[].concat(Me(this._progress),[n.webhook_id]),e.prev=2,e.next=5,(0,l.AV)(this.hass,n.webhook_id);case 5:r=e.sent,e.next=12;break;case 8:return e.prev=8,e.t0=e.catch(2),alert(e.t0.message),e.abrupt("return");case 12:return e.prev=12,this._progress=this._progress.filter((function(e){return e!==n.webhook_id})),e.finish(12);case 15:this._cloudHooks=Object.assign({},this._cloudHooks,(o={},i=n.webhook_id,a=r,i in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o)),0===this._progress.length&&this._showDialog(n.webhook_id);case 17:case"end":return e.stop()}var o,i,a}),e,this,[[2,8,12,15]])}))),function(e){return a.apply(this,arguments)})},{kind:"method",key:"_disableWebhook",value:(i=Ie(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._progress=[].concat(Me(this._progress),[t]),e.prev=1,e.next=4,(0,l.Mc)(this.hass,t);case 4:e.next=10;break;case 6:return e.prev=6,e.t0=e.catch(1),alert("".concat(this.hass.localize("ui.panel.config.cloud.account.webhooks.disable_hook_error_msg")," ").concat(e.t0.message)),e.abrupt("return");case 10:return e.prev=10,this._progress=this._progress.filter((function(e){return e!==t})),e.finish(10);case 13:(n=this._cloudHooks)[t],r=Re(n,[t].map(rt)),this._cloudHooks=r;case 15:case"end":return e.stop()}}),e,this,[[1,6,10,13]])}))),function(e){return i.apply(this,arguments)})},{kind:"method",key:"_fetchData",value:(o=Ie(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.hass.config.components.includes("webhook")){e.next=6;break}return e.next=3,this.hass.callWS({type:"webhook/list"});case 3:e.t0=e.sent,e.next=7;break;case 6:e.t0=[];case 7:this._localHooks=e.t0;case 8:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{kind:"get",static:!0,key:"styles",value:function(){return[Ce.Qx,(0,r.iv)(Ae())]}}]}}),r.oi);function lt(e){return(lt="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})(e)}function ut(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n      <style include="iron-flex ha-style">\n        [slot="introduction"] {\n          margin: -1em 0;\n        }\n        [slot="introduction"] a {\n          color: var(--primary-color);\n        }\n        .content {\n          padding-bottom: 24px;\n        }\n        .account-row {\n          display: flex;\n          padding: 0 16px;\n        }\n        mwc-button {\n          align-self: center;\n        }\n        .soon {\n          font-style: italic;\n          margin-top: 24px;\n          text-align: center;\n        }\n        .nowrap {\n          white-space: nowrap;\n        }\n        .wrap {\n          white-space: normal;\n        }\n        .status {\n          text-transform: capitalize;\n          padding: 16px;\n        }\n        a {\n          color: var(--primary-color);\n        }\n      </style>\n      <hass-subpage header="[[localize(\'ui.panel.config.cloud.caption\')]]">\n        <div class="content">\n          <ha-config-section is-wide="[[isWide]]">\n            <span slot="header"\n              >[[localize(\'ui.panel.config.cloud.caption\')]]</span\n            >\n            <div slot="introduction">\n              <p>\n                [[localize(\'ui.panel.config.cloud.account.thank_you_note\')]]\n              </p>\n            </div>\n\n            <ha-card\n              header="[[localize(\'ui.panel.config.cloud.account.nabu_casa_account\')]]"\n            >\n              <div class="account-row">\n                <paper-item-body two-line="">\n                  [[cloudStatus.email]]\n                  <div secondary class="wrap">\n                    [[_formatSubscription(_subscription)]]\n                  </div>\n                </paper-item-body>\n              </div>\n\n              <div class="account-row">\n                <paper-item-body\n                  >[[localize(\'ui.panel.config.cloud.account.connection_status\')]]</paper-item-body\n                >\n                <div class="status">[[cloudStatus.cloud]]</div>\n              </div>\n\n              <div class="card-actions">\n                <a\n                  href="https://account.nabucasa.com"\n                  target="_blank"\n                  rel="noreferrer"\n                >\n                  <mwc-button\n                    >[[localize(\'ui.panel.config.cloud.account.manage_account\')]]</mwc-button\n                  >\n                </a>\n                <mwc-button style="float: right" on-click="handleLogout"\n                  >[[localize(\'ui.panel.config.cloud.account.sign_out\')]]</mwc-button\n                >\n              </div>\n            </ha-card>\n          </ha-config-section>\n\n          <ha-config-section is-wide="[[isWide]]">\n            <span slot="header"\n              >[[localize(\'ui.panel.config.cloud.account.integrations\')]]</span\n            >\n            <div slot="introduction">\n              <p>\n                [[localize(\'ui.panel.config.cloud.account.integrations_introduction\')]]\n              </p>\n              <p>\n                [[localize(\'ui.panel.config.cloud.account.integrations_introduction2\')]]\n                <a\n                  href="https://www.nabucasa.com"\n                  target="_blank"\n                  rel="noreferrer"\n                >\n                  [[localize(\'ui.panel.config.cloud.account.integrations_link_all_features\')]] </a\n                >.\n              </p>\n            </div>\n\n            <cloud-remote-pref\n              hass="[[hass]]"\n              cloud-status="[[cloudStatus]]"\n              dir="[[_rtlDirection]]"\n            ></cloud-remote-pref>\n\n            <cloud-alexa-pref\n              hass="[[hass]]"\n              cloud-status="[[cloudStatus]]"\n              dir="[[_rtlDirection]]"\n            ></cloud-alexa-pref>\n\n            <cloud-google-pref\n              hass="[[hass]]"\n              cloud-status="[[cloudStatus]]"\n              dir="[[_rtlDirection]]"\n            ></cloud-google-pref>\n\n            <cloud-webhooks\n              hass="[[hass]]"\n              cloud-status="[[cloudStatus]]"\n              dir="[[_rtlDirection]]"\n            ></cloud-webhooks>\n          </ha-config-section>\n        </div>\n      </hass-subpage>\n    ']);return ut=function(){return e},e}function ft(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,o)}function dt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pt(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)}}function ht(e,t,n){return(ht="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=gt(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function mt(e,t){return(mt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function yt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=gt(e);if(t){var o=gt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return vt(this,n)}}function vt(e,t){return!t||"object"!==lt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function gt(e){return(gt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var bt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&mt(e,t)}(u,e);var t,n,r,o,i,s=yt(u);function u(){return dt(this,u),s.apply(this,arguments)}return t=u,n=[{key:"ready",value:function(){ht(gt(u.prototype),"ready",this).call(this),this._fetchSubscriptionInfo()}},{key:"_computeRemoteConnected",value:function(e){return e?this.hass.localize("ui.panel.config.cloud.account.connected"):this.hass.localize("ui.panel.config.cloud.account.not_connected")}},{key:"_fetchSubscriptionInfo",value:(o=regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,l.De)(this.hass);case 2:this._subscription=e.sent,this._subscription.provider&&this.cloudStatus&&"connected"!==this.cloudStatus.cloud&&this.fire("ha-refresh-cloud-status");case 4:case"end":return e.stop()}}),e,this)})),i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function a(e){ft(i,n,r,a,s,"next",e)}function s(e){ft(i,n,r,a,s,"throw",e)}a(void 0)}))},function(){return i.apply(this,arguments)})},{key:"handleLogout",value:function(){var e=this;this.hass.callApi("post","cloud/logout").then((function(){return e.fire("ha-refresh-cloud-status")}))}},{key:"_formatSubscription",value:function(e){if(null===e)return this.hass.localize("ui.panel.config.cloud.account.fetching_subscription");var t=e.human_description;return e.plan_renewal_date&&(t=t.replace("{periodEnd}",(0,c.o)(new Date(1e3*e.plan_renewal_date),this.hass.language))),t}},{key:"_computeRTLDirection",value:function(e){return(0,d.Zu)(e)}}],r=[{key:"template",get:function(){return(0,a.d)(ut())}},{key:"properties",get:function(){return{hass:Object,isWide:Boolean,cloudStatus:Object,_subscription:{type:Object,value:null},_rtlDirection:{type:Boolean,computed:"_computeRTLDirection(hass)"}}}}],n&&pt(t.prototype,n),r&&pt(t,r),u}((0,u.I)((0,f.Z)(s.H3)));customElements.define("cloud-account",bt);n(10983),n(60748),n(98762),n(99282);function wt(e){return(wt="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})(e)}function kt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _t(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)}}function Et(e,t){return(Et=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function St(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=xt(e);if(t){var o=xt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Pt(this,n)}}function Pt(e,t){return!t||"object"!==wt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function xt(e){return(xt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ot=(0,n(76389).o)((function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Et(e,t)}(a,e);var t,n,r,i=St(a);function a(){return kt(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"navigate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];o.c.apply(void 0,[this].concat(t))}}])&&_t(t.prototype,n),r&&_t(t,r),a}(e)}));function Dt(e){return(Dt="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})(e)}function zt(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n      <style include="iron-flex ha-style">\n        .content {\n          padding-bottom: 24px;\n        }\n        [slot="introduction"] {\n          margin: -1em 0;\n        }\n        [slot="introduction"] a {\n          color: var(--primary-color);\n        }\n        paper-item {\n          cursor: pointer;\n        }\n        ha-card {\n          overflow: hidden;\n        }\n        ha-card .card-header {\n          margin-bottom: -8px;\n        }\n        h1 {\n          @apply --paper-font-headline;\n          margin: 0;\n        }\n        .error {\n          color: var(--error-color);\n        }\n        .card-actions {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n        }\n        [hidden] {\n          display: none;\n        }\n        .flash-msg {\n          padding-right: 44px;\n        }\n        .flash-msg ha-icon-button {\n          position: absolute;\n          top: 4px;\n          right: 8px;\n          color: var(--secondary-text-color);\n        }\n        :host([rtl]) .flash-msg ha-icon-button {\n          right: auto;\n          left: 8px;\n        }\n      </style>\n      <hass-subpage header="[[localize(\'ui.panel.config.cloud.caption\')]]">\n        <div class="content">\n          <ha-config-section is-wide="[[isWide]]">\n            <span slot="header"\n              >[[localize(\'ui.panel.config.cloud.caption\')]]</span\n            >\n            <div slot="introduction">\n              <p>\n                [[localize(\'ui.panel.config.cloud.login.introduction\')]]\n              </p>\n              <p>\n                [[localize(\'ui.panel.config.cloud.login.introduction2\')]]\n                <a\n                  href="https://www.nabucasa.com"\n                  target="_blank"\n                  rel="noreferrer"\n                >\n                  Nabu&nbsp;Casa,&nbsp;Inc\n                </a>\n                [[localize(\'ui.panel.config.cloud.login.introduction2a\')]]\n              </p>\n              <p>\n                [[localize(\'ui.panel.config.cloud.login.introduction3\')]]\n              </p>\n              <p>\n                <a\n                  href="https://www.nabucasa.com"\n                  target="_blank"\n                  rel="noreferrer"\n                >\n                  [[localize(\'ui.panel.config.cloud.login.learn_more_link\')]]\n                </a>\n              </p>\n            </div>\n\n            <ha-card hidden$="[[!flashMessage]]">\n              <div class="card-content flash-msg">\n                [[flashMessage]]\n                <ha-icon-button icon="hass:close" on-click="_dismissFlash"\n                  >[[localize(\'ui.panel.config.cloud.login.dismiss\')]]</ha-icon-button\n                >\n                <paper-ripple id="flashRipple" noink=""></paper-ripple>\n              </div>\n            </ha-card>\n\n            <ha-card\n              header="[[localize(\'ui.panel.config.cloud.login.sign_in\')]]"\n            >\n              <div class="card-content">\n                <div class="error" hidden$="[[!_error]]">[[_error]]</div>\n                <paper-input\n                  label="[[localize(\'ui.panel.config.cloud.login.email\')]]"\n                  id="email"\n                  type="email"\n                  value="{{email}}"\n                  on-keydown="_keyDown"\n                  error-message="[[localize(\'ui.panel.config.cloud.login.email_error_msg\')]]"\n                ></paper-input>\n                <paper-input\n                  id="password"\n                  label="[[localize(\'ui.panel.config.cloud.login.password\')]]"\n                  value="{{_password}}"\n                  type="password"\n                  on-keydown="_keyDown"\n                  error-message="[[localize(\'ui.panel.config.cloud.login.password_error_msg\')]]"\n                ></paper-input>\n              </div>\n              <div class="card-actions">\n                <ha-progress-button\n                  on-click="_handleLogin"\n                  progress="[[_requestInProgress]]"\n                  >[[localize(\'ui.panel.config.cloud.login.sign_in\')]]</ha-progress-button\n                >\n                <button\n                  class="link"\n                  hidden="[[_requestInProgress]]"\n                  on-click="_handleForgotPassword"\n                >\n                  [[localize(\'ui.panel.config.cloud.login.forgot_password\')]]\n                </button>\n              </div>\n            </ha-card>\n\n            <ha-card>\n              <paper-item on-click="_handleRegister">\n                <paper-item-body two-line="">\n                  [[localize(\'ui.panel.config.cloud.login.start_trial\')]]\n                  <div secondary="">\n                    [[localize(\'ui.panel.config.cloud.login.trial_info\')]]\n                  </div>\n                </paper-item-body>\n                <ha-icon-next></ha-icon-next>\n              </paper-item>\n            </ha-card>\n          </ha-config-section>\n        </div>\n      </hass-subpage>\n    ']);return zt=function(){return e},e}function jt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ct(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)}}function Tt(e,t,n){return(Tt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ft(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function At(e,t){return(At=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Rt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ft(e);if(t){var o=Ft(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Mt(this,n)}}function Mt(e,t){return!t||"object"!==Dt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ft(e){return(Ft=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var It=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&At(e,t)}(i,e);var t,n,r,o=Rt(i);function i(){return jt(this,i),o.apply(this,arguments)}return t=i,r=[{key:"template",get:function(){return(0,a.d)(zt())}},{key:"properties",get:function(){return{hass:Object,isWide:Boolean,email:{type:String,notify:!0},_password:{type:String,value:""},_requestInProgress:{type:Boolean,value:!1},flashMessage:{type:String,notify:!0},rtl:{type:Boolean,reflectToAttribute:!0,computed:"_computeRTL(hass)"},_error:String}}},{key:"observers",get:function(){return["_inputChanged(email, _password)"]}}],(n=[{key:"connectedCallback",value:function(){var e=this;Tt(Ft(i.prototype),"connectedCallback",this).call(this),this.flashMessage&&requestAnimationFrame((function(){return requestAnimationFrame((function(){return e.$.flashRipple.simulatedRipple()}))}))}},{key:"_inputChanged",value:function(){this.$.email.invalid=!1,this.$.password.invalid=!1,this._error=!1}},{key:"_keyDown",value:function(e){13===e.keyCode&&(this._handleLogin(),e.preventDefault())}},{key:"_handleLogin",value:function(){var e=this,t=!1;this.email&&this.email.includes("@")||(this.$.email.invalid=!0,this.$.email.focus(),t=!0),this._password.length<8&&(this.$.password.invalid=!0,t||(t=!0,this.$.password.focus())),t||(this._requestInProgress=!0,this.hass.callApi("post","cloud/login",{email:this.email,password:this._password}).then((function(){e.fire("ha-refresh-cloud-status"),e.setProperties({email:"",_password:""})}),(function(t){e._password="";var n=t&&t.body&&t.body.code;if("PasswordChangeRequired"===n)return alert("[[localize('ui.panel.config.cloud.login.alert_password_change_required')]]"),void e.navigate("/config/cloud/forgot-password");var r={_requestInProgress:!1,_error:t&&t.body&&t.body.message?t.body.message:"Unknown error"};"UserNotConfirmed"===n&&(r._error="[[localize('ui.panel.config.cloud.login.alert_email_confirm_necessary')]]"),e.setProperties(r),e.$.email.focus()})))}},{key:"_handleRegister",value:function(){this.flashMessage="",this.navigate("/config/cloud/register")}},{key:"_handleForgotPassword",value:function(){this.flashMessage="",this.navigate("/config/cloud/forgot-password")}},{key:"_dismissFlash",value:function(){var e=this;setTimeout((function(){e.flashMessage=""}),200)}},{key:"_computeRTL",value:function(e){return(0,d.HE)(e)}}])&&Ct(t.prototype,n),r&&Ct(t,r),i}((0,f.Z)(Ot((0,u.I)(s.H3))));function Yt(e){return(Yt="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})(e)}function Ht(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lt(e,t){return(Lt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Bt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Xt(e);if(t){var o=Xt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Nt(this,n)}}function Nt(e,t){return!t||"object"!==Yt(t)&&"function"!=typeof t?Wt(e):t}function Wt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ut(){Ut=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(n){t.forEach((function(t){t.kind===n&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var n=e.prototype;["method","field"].forEach((function(r){t.forEach((function(t){var o=t.placement;if(t.kind===r&&("static"===o||"prototype"===o)){var i="static"===o?e:n;this.defineClassElement(i,t)}}),this)}),this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var r=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],r=[],o={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,o)}),this),e.forEach((function(e){if(!qt(e))return n.push(e);var t=this.decorateElement(e,o);n.push(t.element),n.push.apply(n,t.extras),r.push.apply(r,t.finishers)}),this),!t)return{elements:n,finishers:r};var i=this.decorateConstructor(n,t);return r.push.apply(r,i.finishers),i.finishers=r,i},addElementPlacement:function(e,t,n){var r=t[e.placement];if(!n&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,t){for(var n=[],r=[],o=e.decorators,i=o.length-1;i>=0;i--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,o[i])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&r.push(c.finisher);var l=c.extras;if(l){for(var u=0;u<l.length;u++)this.addElementPlacement(l[u],t);n.push.apply(n,l)}}return{element:e,finishers:r,extras:n}},decorateConstructor:function(e,t){for(var n=[],r=t.length-1;r>=0;r--){var o=this.fromClassDescriptor(e),i=this.toClassDescriptor((0,t[r])(o)||o);if(void 0!==i.finisher&&n.push(i.finisher),void 0!==i.elements){e=i.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:n}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return Kt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Kt(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var n=Qt(e.key),r=String(e.placement);if("static"!==r&&"prototype"!==r&&"own"!==r)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+r+'"');var o=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var i={kind:t,key:n,placement:r,descriptor:Object.assign({},o)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(o,"get","The property descriptor of a field descriptor"),this.disallowProperty(o,"set","The property descriptor of a field descriptor"),this.disallowProperty(o,"value","The property descriptor of a field descriptor"),i.initializer=e.initializer),i},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:Jt(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var n=Jt(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:n}},runClassFinishers:function(e,t){for(var n=0;n<t.length;n++){var r=(0,t[n])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,t,n){if(void 0!==e[t])throw new TypeError(n+" can't have a ."+t+" property.")}};return e}function $t(e){var t,n=Qt(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function Zt(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function qt(e){return e.decorators&&e.decorators.length}function Vt(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function Jt(e,t){var n=e[t];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+t+"' to be a function");return n}function Qt(e){var t=function(e,t){if("object"!==Yt(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Yt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Yt(t)?t:String(t)}function Kt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Gt(e,t,n){return(Gt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Xt(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function Xt(e){return(Xt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}customElements.define("cloud-login",It);var en=["account","google-assistant","alexa"],tn=["login","register","forgot-password"];!function(e,t,n,r){var o=Ut();if(r)for(var i=0;i<r.length;i++)o=r[i](o);var a=t((function(e){o.initializeInstanceElements(e,s.elements)}),n),s=o.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===i.key&&e.placement===i.placement},r=0;r<e.length;r++){var o,i=e[r];if("method"===i.kind&&(o=t.find(n)))if(Vt(i.descriptor)||Vt(o.descriptor)){if(qt(i)||qt(o))throw new ReferenceError("Duplicated methods ("+i.key+") can't be decorated.");o.descriptor=i.descriptor}else{if(qt(i)){if(qt(o))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+i.key+").");o.decorators=i.decorators}Zt(i,o)}else t.push(i)}return t}(a.d.map($t)),e);o.initializeClassElements(a.F,s.elements),o.runClassFinishers(a.F,s.finishers)}([(0,r.Mo)("ha-config-cloud")],(function(e,t){var i=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Lt(e,t)}(r,t);var n=Bt(r);function r(){var t;Ht(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return t=n.call.apply(n,[this].concat(i)),e(Wt(t)),t}return r}(t);return{F:i,d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"isWide",value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"narrow",value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"route",value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"cloudStatus",value:void 0},{kind:"field",key:"routerOptions",value:function(){var e=this;return{defaultPage:"login",showLoading:!0,initialLoad:function(){return e._cloudStatusLoaded},beforeRender:function(t){if(e.cloudStatus.logged_in){if(!en.includes(t))return"account"}else if(!tn.includes(t))return"login"},routes:{login:{tag:"cloud-login"},register:{tag:"cloud-register",load:function(){return n.e(1628).then(n.bind(n,93699))}},"forgot-password":{tag:"cloud-forgot-password",load:function(){return n.e(6789).then(n.bind(n,2958))}},account:{tag:"cloud-account"},"google-assistant":{tag:"cloud-google-assistant",load:function(){return Promise.all([n.e(3641),n.e(4444),n.e(2174),n.e(3238),n.e(1927),n.e(9385),n.e(5225)]).then(n.bind(n,93888))}},alexa:{tag:"cloud-alexa",load:function(){return Promise.all([n.e(3641),n.e(4444),n.e(2174),n.e(3238),n.e(1927),n.e(9385),n.e(5204)]).then(n.bind(n,38654))}}}}}},{kind:"field",decorators:[(0,r.sz)()],key:"_flashMessage",value:function(){return""}},{kind:"field",decorators:[(0,r.sz)()],key:"_loginEmail",value:function(){return""}},{kind:"field",key:"_resolveCloudStatusLoaded",value:void 0},{kind:"field",key:"_cloudStatusLoaded",value:function(){var e=this;return new Promise((function(t){e._resolveCloudStatusLoaded=t}))}},{kind:"method",key:"firstUpdated",value:function(e){var t=this;Gt(Xt(i.prototype),"firstUpdated",this).call(this,e),this.addEventListener("cloud-done",(function(e){t._flashMessage=e.detail.flashMessage,(0,o.c)(t,"/config/cloud/login")}))}},{kind:"method",key:"updated",value:function(e){if(Gt(Xt(i.prototype),"updated",this).call(this,e),e.has("cloudStatus")){var t=e.get("cloudStatus");void 0===t?this._resolveCloudStatusLoaded():t.logged_in!==this.cloudStatus.logged_in&&(0,o.c)(this,this.route.prefix,!0)}}},{kind:"method",key:"createElement",value:function(e){var t=this,n=Gt(Xt(i.prototype),"createElement",this).call(this,e);return n.addEventListener("email-changed",(function(e){t._loginEmail=e.detail.value})),n.addEventListener("flash-message-changed",(function(e){t._flashMessage=e.detail.value})),n}},{kind:"method",key:"updatePageEl",value:function(e){this.cloudStatus&&!this.cloudStatus.logged_in&&en.includes(this._currentPage)||("setProperties"in e?e.setProperties({hass:this.hass,email:this._loginEmail,isWide:this.isWide,cloudStatus:this.cloudStatus,flashMessage:this._flashMessage}):(e.hass=this.hass,e.email=this._loginEmail,e.isWide=this.isWide,e.narrow=this.narrow,e.cloudStatus=this.cloudStatus,e.flashMessage=this._flashMessage))}}]}}),i.n)},98573:function(e,t,n){"use strict";n.d(t,{f:function(){return o}});var r=n(81796),o=function(e,t){return(0,r.C)(e,{message:t.localize("ui.common.successfully_saved")})}}}]);
//# sourceMappingURL=chunk.3a5344c007b544b37684.js.map