var t,e,n,i,o,r,a,u,s,c,l,d,h,f,v,p,m,g,_,y,b,D,A,w,C,E,k,F,O,j,S,T;function B(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function $(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function x(t,e,n){return(e=nt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function M(t,e,n,i){var o=P(Z(1&i?t.prototype:t),e,n);return 2&i&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function P(){return P="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Z(t)););return t}(t,e);if(i){var o=Object.getOwnPropertyDescriptor(i,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},P.apply(null,arguments)}function H(t){return function(t){if(Array.isArray(t))return J(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||X(t)||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 I(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,o,r,a,u=[],s=!0,c=!1;try{if(r=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;s=!1}else for(;!(s=(i=r.call(n)).done)&&(u.push(i.value),u.length!==e);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||X(t,e)||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.")}()}function R(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var t,e,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function r(n,i,o,r){var s=i&&i.prototype instanceof u?i:u,c=Object.create(s.prototype);return N(c,"_invoke",function(n,i,o){var r,u,s,c=0,l=o||[],d=!1,h={p:0,n:0,v:t,a:f,f:f.bind(t,4),d:function(e,n){return r=e,u=0,s=t,h.n=n,a}};function f(n,i){for(u=n,s=i,e=0;!d&&c&&!o&&e3?(o=v===i)&&(s=r[(u=r[4])?5:(u=3,3)],r[4]=r[5]=t):r[0]<=f&&((o=n<2&&fi||i>v)&&(r[4]=n,r[5]=i,h.n=v,u=0))}if(o||n>1)return a;throw d=!0,i}return function(o,l,v){if(c>1)throw TypeError("Generator is already running");for(d&&1===l&&f(l,v),u=l,s=v;(e=u<2?t:s)||!d;){r||(u?u<3?(u>1&&(h.n=-1),f(u,s)):h.n=s:h.v=s);try{if(c=2,r){if(u||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,u<2&&(u=0)}else 1===u&&(e=r.return)&&e.call(r),u<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),u=1);r=t}else if((e=(d=h.n<0)?s:n.call(i,h))!==a)break}catch(e){r=t,u=1,s=e}finally{c=1}}return{value:e,done:d}}}(n,o,r),!0),c}var a={};function u(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][i]?e(e([][i]())):(N(e={},i,(function(){return this})),e),d=c.prototype=u.prototype=Object.create(l);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,N(t,o,"GeneratorFunction")),t.prototype=Object.create(d),t}return s.prototype=c,N(d,"constructor",c),N(c,"constructor",s),s.displayName="GeneratorFunction",N(c,o,"GeneratorFunction"),N(d),N(d,o,"Generator"),N(d,i,(function(){return this})),N(d,"toString",(function(){return"[object Generator]"})),(R=function(){return{w:r,m:h}})()}function N(t,e,n,i){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}N=function(t,e,n,i){function r(e,n){N(t,e,(function(t){return this._invoke(e,n,t)}))}e?o?o(t,e,{value:n,enumerable:!i,configurable:!i,writable:!i}):t[e]=n:(r("next",0),r("throw",1),r("return",2))},N(t,e,n,i)}function V(t,e,n,i,o,r,a){try{var u=t[r](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(i,o)}function z(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var r=t.apply(e,n);function a(t){V(r,i,o,a,u,"next",t)}function u(t){V(r,i,o,a,u,"throw",t)}a(void 0)}))}}function L(t,e,n){return e=Z(e),function(t,e){if(e&&("object"==it(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return U(t)}(t,W()?Reflect.construct(e,n||[],Z(t).constructor):e.apply(t,n))}function U(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function G(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Y(t,e)}function q(t){var e="function"==typeof Map?new Map:void 0;return q=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(Te){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(W())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,e);var o=new(t.bind.apply(t,i));return n&&Y(o,n.prototype),o}(t,arguments,Z(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Y(n,t)},q(t)}function W(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(W=function(){return!!t})()}function Y(t,e){return Y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Y(t,e)}function Z(t){return Z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Z(t)}function K(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=X(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,o=function(){};return{s:o,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,r=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw r}}}}function X(t,e){if(t){if("string"==typeof t)return J(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?J(t,e):void 0}}function J(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n=0;u--)(o=t[u])&&(a=(r<3?o(a):r>3?o(e,n,a):o(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a}"function"==typeof SuppressedError&&SuppressedError; /** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ var rt=globalThis,at=rt.ShadowRoot&&(void 0===rt.ShadyCSS||rt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ut=Symbol(),st=new WeakMap,ct=function(){return et((function t(e,n,i){if(Q(this,t),this._$cssResult$=!0,i!==ut)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}),[{key:"styleSheet",get:function(){var t=this.o,e=this.t;if(at&&void 0===t){var n=void 0!==e&&1===e.length;n&&(t=st.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&st.set(e,t))}return t}},{key:"toString",value:function(){return this.cssText}}])}(),lt=at?function(t){return t}:function(t){return t instanceof CSSStyleSheet?function(t){var e,n="",i=K(t.cssRules);try{for(i.s();!(e=i.n()).done;){n+=e.value.cssText}}catch(o){i.e(o)}finally{i.f()}return function(t){return new ct("string"==typeof t?t:t+"",void 0,ut)}(n)}(t):t},dt=Object.is,ht=Object.defineProperty,ft=Object.getOwnPropertyDescriptor,vt=Object.getOwnPropertyNames,pt=Object.getOwnPropertySymbols,mt=Object.getPrototypeOf,gt=globalThis,_t=gt.trustedTypes,yt=_t?_t.emptyScript:"",bt=gt.reactiveElementPolyfillSupport,Dt=function(t,e){return t},At={toAttribute:function(t,e){switch(e){case Boolean:t=t?yt:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute:function(t,e){var n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},wt=function(t,e){return!dt(t,e)},Ct={attribute:!0,type:String,converter:At,reflect:!1,useDefault:!1,hasChanged:wt};null!==(t=Symbol.metadata)&&void 0!==t||(Symbol.metadata=Symbol("metadata")),null!==(e=gt.litPropertyMetadata)&&void 0!==e||(gt.litPropertyMetadata=new WeakMap);var Et=function(t){function e(){var t;return Q(this,e),(t=L(this,e))._$Ep=void 0,t.isUpdatePending=!1,t.hasUpdated=!1,t._$Em=null,t._$Ev(),t}return G(e,q(HTMLElement)),et(e,[{key:"_$Ev",value:function(){var t,e=this;this._$ES=new Promise((function(t){return e.enableUpdating=t})),this._$AL=new Map,this._$E_(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach((function(t){return t(e)}))}},{key:"addController",value:function(t){var e,n;(null!==(e=this._$EO)&&void 0!==e?e:this._$EO=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&(null===(n=t.hostConnected)||void 0===n||n.call(t))}},{key:"removeController",value:function(t){var e;null===(e=this._$EO)||void 0===e||e.delete(t)}},{key:"_$E_",value:function(){var t,e=new Map,n=K(this.constructor.elementProperties.keys());try{for(n.s();!(t=n.n()).done;){var i=t.value;this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i])}}catch(o){n.e(o)}finally{n.f()}e.size>0&&(this._$Ep=e)}},{key:"createRenderRoot",value:function(){var t,e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return function(t,e){if(at)t.adoptedStyleSheets=e.map((function(t){return t instanceof CSSStyleSheet?t:t.styleSheet}));else{var n,i=K(e);try{for(i.s();!(n=i.n()).done;){var o=n.value,r=document.createElement("style"),a=rt.litNonce;void 0!==a&&r.setAttribute("nonce",a),r.textContent=o.cssText,t.appendChild(r)}}catch(u){i.e(u)}finally{i.f()}}}(e,this.constructor.elementStyles),e}},{key:"connectedCallback",value:function(){var t,e;null!==(t=this.renderRoot)&&void 0!==t||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$EO)||void 0===e||e.forEach((function(t){var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}},{key:"enableUpdating",value:function(t){}},{key:"disconnectedCallback",value:function(){var t;null===(t=this._$EO)||void 0===t||t.forEach((function(t){var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}},{key:"attributeChangedCallback",value:function(t,e,n){this._$AK(t,n)}},{key:"_$ET",value:function(t,e){var n=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,n);if(void 0!==i&&!0===n.reflect){var o,r=(void 0!==(null===(o=n.converter)||void 0===o?void 0:o.toAttribute)?n.converter:At).toAttribute(e,n.type);this._$Em=t,null==r?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}},{key:"_$AK",value:function(t,e){var n=this.constructor,i=n._$Eh.get(t);if(void 0!==i&&this._$Em!==i){var o,r,a,u=n.getPropertyOptions(i),s="function"==typeof u.converter?{fromAttribute:u.converter}:void 0!==(null===(o=u.converter)||void 0===o?void 0:o.fromAttribute)?u.converter:At;this._$Em=i;var c=s.fromAttribute(e,u.type);this[i]=null!==(r=null!=c?c:null===(a=this._$Ej)||void 0===a?void 0:a.get(i))&&void 0!==r?r:c,this._$Em=null}}},{key:"requestUpdate",value:function(t,e,n){if(void 0!==t){var i,o,r=this.constructor,a=this[t];if(null!=n||(n=r.getPropertyOptions(t)),!((null!==(i=n.hasChanged)&&void 0!==i?i:wt)(a,e)||n.useDefault&&n.reflect&&a===(null===(o=this._$Ej)||void 0===o?void 0:o.get(t))&&!this.hasAttribute(r._$Eu(t,n))))return;this.C(t,e,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}},{key:"C",value:function(t,e,n,i){var o,r,a,u=n.useDefault,s=n.reflect,c=n.wrapped;u&&!(null!==(o=this._$Ej)&&void 0!==o?o:this._$Ej=new Map).has(t)&&(this._$Ej.set(t,null!==(r=null!=i?i:e)&&void 0!==r?r:this[t]),!0!==c||void 0!==i)||(this._$AL.has(t)||(this.hasUpdated||u||(e=void 0),this._$AL.set(t,e)),!0===s&&this._$Em!==t&&(null!==(a=this._$Eq)&&void 0!==a?a:this._$Eq=new Set).add(t))}},{key:"_$EP",value:(n=z(R().m((function t(){var e,n;return R().w((function(t){for(;;)switch(t.p=t.n){case 0:return this.isUpdatePending=!0,t.p=1,t.n=2,this._$ES;case 2:t.n=4;break;case 3:t.p=3,n=t.v,Promise.reject(n);case 4:if(null==(e=this.scheduleUpdate())){t.n=5;break}return t.n=5,e;case 5:return t.a(2,!this.isUpdatePending)}}),t,this,[[1,3]])}))),function(){return n.apply(this,arguments)})},{key:"scheduleUpdate",value:function(){return this.performUpdate()}},{key:"performUpdate",value:function(){if(this.isUpdatePending){if(!this.hasUpdated){var t;if(null!==(t=this.renderRoot)&&void 0!==t||(this.renderRoot=this.createRenderRoot()),this._$Ep){var e,n=K(this._$Ep);try{for(n.s();!(e=n.n()).done;){var i=I(e.value,2),o=i[0],r=i[1];this[o]=r}}catch(g){n.e(g)}finally{n.f()}this._$Ep=void 0}var a=this.constructor.elementProperties;if(a.size>0){var u,s=K(a);try{for(s.s();!(u=s.n()).done;){var c=I(u.value,2),l=c[0],d=c[1],h=d.wrapped,f=this[l];!0!==h||this._$AL.has(l)||void 0===f||this.C(l,void 0,d,f)}}catch(g){s.e(g)}finally{s.f()}}}var v=!1,p=this._$AL;try{var m;(v=this.shouldUpdate(p))?(this.willUpdate(p),null!==(m=this._$EO)&&void 0!==m&&m.forEach((function(t){var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(p)):this._$EM()}catch(p){throw v=!1,this._$EM(),p}v&&this._$AE(p)}}},{key:"willUpdate",value:function(t){}},{key:"_$AE",value:function(t){var e;null!==(e=this._$EO)&&void 0!==e&&e.forEach((function(t){var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}},{key:"_$EM",value:function(){this._$AL=new Map,this.isUpdatePending=!1}},{key:"updateComplete",get:function(){return this.getUpdateComplete()}},{key:"getUpdateComplete",value:function(){return this._$ES}},{key:"shouldUpdate",value:function(t){return!0}},{key:"update",value:function(t){var e=this;this._$Eq&&(this._$Eq=this._$Eq.forEach((function(t){return e._$ET(t,e[t])}))),this._$EM()}},{key:"updated",value:function(t){}},{key:"firstUpdated",value:function(t){}}],[{key:"addInitializer",value:function(t){var e;this._$Ei(),(null!==(e=this.l)&&void 0!==e?e:this.l=[]).push(t)}},{key:"observedAttributes",get:function(){return this.finalize(),this._$Eh&&H(this._$Eh.keys())}},{key:"createProperty",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ct;if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){var n=Symbol(),i=this.getPropertyDescriptor(t,n,e);void 0!==i&&ht(this.prototype,t,i)}}},{key:"getPropertyDescriptor",value:function(t,e,n){var i,o=null!==(i=ft(this.prototype,t))&&void 0!==i?i:{get:function(){return this[e]},set:function(t){this[e]=t}},r=o.get,a=o.set;return{get:r,set:function(e){var i=null==r?void 0:r.call(this);null!=a&&a.call(this,e),this.requestUpdate(t,i,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function(t){var e;return null!==(e=this.elementProperties.get(t))&&void 0!==e?e:Ct}},{key:"_$Ei",value:function(){if(!this.hasOwnProperty(Dt("elementProperties"))){var t=mt(this);t.finalize(),void 0!==t.l&&(this.l=H(t.l)),this.elementProperties=new Map(t.elementProperties)}}},{key:"finalize",value:function(){if(!this.hasOwnProperty(Dt("finalized"))){if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Dt("properties"))){var t,e=this.properties,n=K([].concat(H(vt(e)),H(pt(e))));try{for(n.s();!(t=n.n()).done;){var i=t.value;this.createProperty(i,e[i])}}catch(g){n.e(g)}finally{n.f()}}var o=this[Symbol.metadata];if(null!==o){var r=litPropertyMetadata.get(o);if(void 0!==r){var a,u=K(r);try{for(u.s();!(a=u.n()).done;){var s=I(a.value,2),c=s[0],l=s[1];this.elementProperties.set(c,l)}}catch(g){u.e(g)}finally{u.f()}}}this._$Eh=new Map;var d,h=K(this.elementProperties);try{for(h.s();!(d=h.n()).done;){var f=I(d.value,2),v=f[0],p=f[1],m=this._$Eu(v,p);void 0!==m&&this._$Eh.set(m,v)}}catch(g){h.e(g)}finally{h.f()}this.elementStyles=this.finalizeStyles(this.styles)}}},{key:"finalizeStyles",value:function(t){var e=[];if(Array.isArray(t)){var n,i=K(new Set(t.flat(1/0).reverse()));try{for(i.s();!(n=i.n()).done;){var o=n.value;e.unshift(lt(o))}}catch(r){i.e(r)}finally{i.f()}}else void 0!==t&&e.push(lt(t));return e}},{key:"_$Eu",value:function(t,e){var n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}}]);var n}();Et.elementStyles=[],Et.shadowRootOptions={mode:"open"},Et[Dt("elementProperties")]=new Map,Et[Dt("finalized")]=new Map,null!=bt&&bt({ReactiveElement:Et}),(null!==(n=gt.reactiveElementVersions)&&void 0!==n?n:gt.reactiveElementVersions=[]).push("2.1.1"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ var kt=globalThis,Ft=kt.trustedTypes,Ot=Ft?Ft.createPolicy("lit-html",{createHTML:function(t){return t}}):void 0,jt="$lit$",St="lit$".concat(Math.random().toFixed(9).slice(2),"$"),Tt="?"+St,Bt="<".concat(Tt,">"),$t=document,xt=function(){return $t.createComment("")},Mt=function(t){return null===t||"object"!=it(t)&&"function"!=typeof t},Pt=Array.isArray,Ht="[ \t\n\f\r]",It=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Rt=/-->/g,Nt=/>/g,Vt=RegExp(">|".concat(Ht,"(?:([^\\s\"'>=/]+)(").concat(Ht,"*=").concat(Ht,"*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)"),"g"),zt=/'/g,Lt=/"/g,Ut=/^(?:script|style|textarea|title)$/i,Gt=function(t){return function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o":3===e?"":"",a=It,u=0;u"===l[0]?(a=null!=n?n:It,d=-1):void 0===l[1]?d=-2:(d=a.lastIndex-l[2].length,c=l[1],a=void 0===l[3]?Vt:'"'===l[3]?Lt:zt):a===Lt||a===zt?a=Vt:a===Rt||a===Nt?a=It:(a=Vt,n=void 0);var f=a===Vt&&t[u+1].startsWith("/>")?" ":"";r+=a===It?s+Bt:d>=0?(o.push(c),s.slice(0,d)+jt+s.slice(d)+St+f):s+St+(-2===d?u:f)}return[Kt(t,r+(t[i]||"")+(2===e?"":3===e?"":"")),o]},Jt=function(){return et((function t(e,n){var i,o=e.strings,r=e._$litType$;Q(this,t),this.parts=[];var a=0,u=0,s=o.length-1,c=this.parts,l=I(Xt(o,r),2),d=l[0],h=l[1];if(this.el=t.createElement(d,n),Zt.currentNode=this.el.content,2===r||3===r){var f=this.el.content.firstChild;f.replaceWith.apply(f,H(f.childNodes))}for(;null!==(i=Zt.nextNode())&&c.length0){i.textContent=Ft?Ft.emptyScript:"";for(var A=0;A2&&void 0!==arguments[2]?arguments[2]:t,s=arguments.length>3?arguments[3]:void 0;if(e===qt)return e;var c=void 0!==s?null===(n=u._$Co)||void 0===n?void 0:n[s]:u._$Cl,l=Mt(e)?void 0:e._$litDirective$;return(null===(i=c)||void 0===i?void 0:i.constructor)!==l&&(null!==(o=c)&&void 0!==o&&null!==(r=o._$AO)&&void 0!==r&&r.call(o,!1),void 0===l?c=void 0:(c=new l(t))._$AT(t,u,s),void 0!==s?(null!==(a=u._$Co)&&void 0!==a?a:u._$Co=[])[s]=c:u._$Cl=c),void 0!==c&&(e=Qt(t,c._$AS(t,e.values),c,s)),e}var te=function(){return et((function t(e,n){Q(this,t),this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}),[{key:"parentNode",get:function(){return this._$AM.parentNode}},{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"u",value:function(t){var e,n=this._$AD,i=n.el.content,o=n.parts,r=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:$t).importNode(i,!0);Zt.currentNode=r;for(var a=Zt.nextNode(),u=0,s=0,c=o[0];void 0!==c;){var l;if(u===c.index){var d=void 0;2===c.type?d=new ee(a,a.nextSibling,this,t):1===c.type?d=new c.ctor(a,c.name,c.strings,this,t):6===c.type&&(d=new ae(a,this,t)),this._$AV.push(d),c=o[++s]}u!==(null===(l=c)||void 0===l?void 0:l.index)&&(a=Zt.nextNode(),u++)}return Zt.currentNode=$t,r}},{key:"p",value:function(t){var e,n=0,i=K(this._$AV);try{for(i.s();!(e=i.n()).done;){var o=e.value;void 0!==o&&(void 0!==o.strings?(o._$AI(t,o,n),n+=o.strings.length-2):o._$AI(t[n])),n++}}catch(r){i.e(r)}finally{i.f()}}}])}(),ee=function(){function t(e,n,i,o){var r;Q(this,t),this.type=2,this._$AH=Wt,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=i,this.options=o,this._$Cv=null===(r=null==o?void 0:o.isConnected)||void 0===r||r}return et(t,[{key:"_$AU",get:function(){var t,e;return null!==(t=null===(e=this._$AM)||void 0===e?void 0:e._$AU)&&void 0!==t?t:this._$Cv}},{key:"parentNode",get:function(){var t,e=this._$AA.parentNode,n=this._$AM;return void 0!==n&&11===(null===(t=e)||void 0===t?void 0:t.nodeType)&&(e=n.parentNode),e}},{key:"startNode",get:function(){return this._$AA}},{key:"endNode",get:function(){return this._$AB}},{key:"_$AI",value:function(t){t=Qt(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this),Mt(t)?t===Wt||null==t||""===t?(this._$AH!==Wt&&this._$AR(),this._$AH=Wt):t!==this._$AH&&t!==qt&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):function(t){return Pt(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator])}(t)?this.k(t):this._(t)}},{key:"O",value:function(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}},{key:"T",value:function(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}},{key:"_",value:function(t){this._$AH!==Wt&&Mt(this._$AH)?this._$AA.nextSibling.data=t:this.T($t.createTextNode(t)),this._$AH=t}},{key:"$",value:function(t){var e,n=t.values,i=t._$litType$,o="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=Jt.createElement(Kt(i.h,i.h[0]),this.options)),i);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===o)this._$AH.p(n);else{var r=new te(o,this),a=r.u(this.options);r.p(n),this.T(a),this._$AH=r}}},{key:"_$AC",value:function(t){var e=Yt.get(t.strings);return void 0===e&&Yt.set(t.strings,e=new Jt(t)),e}},{key:"k",value:function(e){Pt(this._$AH)||(this._$AH=[],this._$AR());var n,i,o=this._$AH,r=0,a=K(e);try{for(a.s();!(i=a.n()).done;){var u=i.value;r===o.length?o.push(n=new t(this.O(xt()),this.O(xt()),this,this.options)):n=o[r],n._$AI(u),r++}}catch(s){a.e(s)}finally{a.f()}r0&&void 0!==arguments[0]?arguments[0]:this._$AA.nextSibling,e=arguments.length>1?arguments[1]:void 0;for(null===(n=this._$AP)||void 0===n||n.call(this,!1,!0,e);t!==this._$AB;){var n,i=t.nextSibling;t.remove(),t=i}}},{key:"setConnected",value:function(t){var e;void 0===this._$AM&&(this._$Cv=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}])}(),ne=function(){return et((function t(e,n,i,o,r){Q(this,t),this.type=1,this._$AH=Wt,this._$AN=void 0,this.element=e,this.name=n,this._$AM=o,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Wt}),[{key:"tagName",get:function(){return this.element.tagName}},{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AI",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=this.strings,r=!1;if(void 0===o)t=Qt(this,t,e,0),(r=!Mt(t)||t!==this._$AH&&t!==qt)&&(this._$AH=t);else{var a,u,s=t;for(t=o[0],a=0;a1&&void 0!==arguments[1]?arguments[1]:this,0))&&void 0!==e?e:Wt)!==qt){var n=this._$AH,i=t===Wt&&n!==Wt||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,o=t!==Wt&&(n===Wt||i);i&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}}},{key:"handleEvent",value:function(t){var e,n;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(n=this.options)||void 0===n?void 0:n.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}])}(),ae=function(){return et((function t(e,n,i){Q(this,t),this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i}),[{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AI",value:function(t){Qt(this,t)}}])}(),ue=kt.litHtmlPolyfillSupport;null!=ue&&ue(Jt,ee),(null!==(i=kt.litHtmlVersions)&&void 0!==i?i:kt.litHtmlVersions=[]).push("3.3.1");var se=globalThis,ce=function(t){function e(){var t;return Q(this,e),(t=L(this,e,arguments)).renderOptions={host:U(t)},t._$Do=void 0,t}return G(e,Et),et(e,[{key:"createRenderRoot",value:function(){var t,n,i=M(e,"createRenderRoot",this,3)([]);return null!==(n=(t=this.renderOptions).renderBefore)&&void 0!==n||(t.renderBefore=i.firstChild),i}},{key:"update",value:function(t){var n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),M(e,"update",this,3)([t]),this._$Do=function(t,e,n){var i,o=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:e,r=o._$litPart$;if(void 0===r){var a,u=null!==(a=null==n?void 0:n.renderBefore)&&void 0!==a?a:null;o._$litPart$=r=new ee(e.insertBefore(xt(),u),u,void 0,null!=n?n:{})}return r._$AI(t),r}(n,this.renderRoot,this.renderOptions)}},{key:"connectedCallback",value:function(){var t;M(e,"connectedCallback",this,3)([]),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}},{key:"disconnectedCallback",value:function(){var t;M(e,"disconnectedCallback",this,3)([]),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}},{key:"render",value:function(){return qt}}])}(); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ce._$litElement$=!0,ce.finalized=!0,null===(o=se.litElementHydrateSupport)||void 0===o||o.call(se,{LitElement:ce});var le=se.litElementPolyfillSupport;null==le||le({LitElement:ce}),(null!==(r=se.litElementVersions)&&void 0!==r?r:se.litElementVersions=[]).push("4.2.1"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ var de={attribute:!0,type:String,converter:At,reflect:!1,hasChanged:wt}; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */function he(t){return function(e,n){return"object"==it(n)?function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:de,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=n.kind,o=n.metadata,r=globalThis.litPropertyMetadata.get(o);if(void 0===r&&globalThis.litPropertyMetadata.set(o,r=new Map),"setter"===i&&((t=Object.create(t)).wrapped=!0),r.set(n.name,t),"accessor"===i){var a=n.name;return{set:function(n){var i=e.get.call(this);e.set.call(this,n),this.requestUpdate(a,i,t)},init:function(e){return void 0!==e&&this.C(a,void 0,t,e),e}}}if("setter"===i){var u=n.name;return function(n){var i=this[u];e.call(this,n),this.requestUpdate(u,i,t)}}throw Error("Unsupported decorator location: "+i)}(t,e,n):function(t,e,n){var i=e.hasOwnProperty(n);return e.constructor.createProperty(n,t),i?Object.getOwnPropertyDescriptor(e,n):void 0}(t,e,n)}} /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ /** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ var fe=function(t){return null!=t?t:Wt},ve=1,pe=2,me=function(t){return function(){for(var e=arguments.length,n=new Array(e),i=0;i1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this._$AH,o=this._$AN;if(void 0!==o&&0!==o.size)if(e)if(Array.isArray(i))for(var r=n;r1&&void 0!==arguments[1])||arguments[1];t!==this.isConnected&&(this.isConnected=t,t?null===(e=this.reconnected)||void 0===e||e.call(this):null===(n=this.disconnected)||void 0===n||n.call(this)),i&&(_e(this,t),ye(this))}},{key:"setValue",value:function(t){if(function(t){return void 0===t.strings}(this._$Ct))this._$Ct._$AI(t,this);else{var e=H(this._$Ct._$AH);e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}},{key:"disconnected",value:function(){}},{key:"reconnected",value:function(){}}])}(),Ee=function(){return et((function t(e){Q(this,t),this.G=e}),[{key:"disconnect",value:function(){this.G=void 0}},{key:"reconnect",value:function(t){this.G=t}},{key:"deref",value:function(){return this.G}}])}(),ke=function(){return et((function t(){Q(this,t),this.Y=void 0,this.Z=void 0}),[{key:"get",value:function(){return this.Y}},{key:"pause",value:function(){var t,e=this;null!==(t=this.Y)&&void 0!==t||(this.Y=new Promise((function(t){return e.Z=t})))}},{key:"resume",value:function(){var t;null!==(t=this.Z)&&void 0!==t&&t.call(this),this.Y=this.Z=void 0}}])}(),Fe=function(t){return!function(t){return null===t||"object"!=it(t)&&"function"!=typeof t}(t)&&"function"==typeof t.then},Oe=1073741823,je=function(t){function e(){var t;return Q(this,e),(t=L(this,e,arguments))._$Cwt=Oe,t._$Cbt=[],t._$CK=new Ee(U(t)),t._$CX=new ke,t}return G(e,Ce),et(e,[{key:"render",value:function(){for(var t,e=arguments.length,n=new Array(e),i=0;i-1&&othis._$Cwt);c++)if(u=s())return u.v;return qt}},{key:"disconnected",value:function(){this._$CK.disconnect(),this._$CX.pause()}},{key:"reconnected",value:function(){this._$CK.reconnect(this),this._$CX.resume()}}])}(),Se=me(je),Te="important",Be=" !"+Te,$e=me(function(t){function e(t){var n,i;if(Q(this,e),i=L(this,e,[t]),t.type!==ve||"style"!==t.name||(null===(n=t.strings)||void 0===n?void 0:n.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");return i}return G(e,ge),et(e,[{key:"render",value:function(t){return Object.keys(t).reduce((function(e,n){var i=t[n];return null==i?e:e+"".concat(n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase(),":").concat(i,";")}),"")}},{key:"update",value:function(t,e){var n=I(e,1)[0],i=t.element.style;if(void 0===this.ft)return this.ft=new Set(Object.keys(n)),this.render(n);var o,r=K(this.ft);try{for(r.s();!(o=r.n()).done;){var a=o.value;null==n[a]&&(this.ft.delete(a),a.includes("-")?i.removeProperty(a):i[a]=null)}}catch(l){r.e(l)}finally{r.f()}for(var u in n){var s=n[u];if(null!=s){this.ft.add(u);var c="string"==typeof s&&s.endsWith(Be);u.includes("-")||c?i.setProperty(u,c?s.slice(0,-11):s,c?Te:""):i[u]=s}}return qt}}])}()),xe=function(t){function e(t){var n;if(Q(this,e),(n=L(this,e,[t])).it=Wt,t.type!==pe)throw Error(n.constructor.directiveName+"() can only be used in child bindings");return n}return G(e,ge),et(e,[{key:"render",value:function(t){if(t===Wt||null==t)return this._t=void 0,this.it=t;if(t===qt)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;var e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}])}();xe.directiveName="unsafeHTML",xe.resultType=1;var Me=me(xe),Pe=me(function(t){function e(t){var n,i;if(Q(this,e),i=L(this,e,[t]),t.type!==ve||"class"!==t.name||(null===(n=t.strings)||void 0===n?void 0:n.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");return i}return G(e,ge),et(e,[{key:"render",value:function(t){return" "+Object.keys(t).filter((function(e){return t[e]})).join(" ")+" "}},{key:"update",value:function(t,e){var n=I(e,1)[0];if(void 0===this.st){for(var i in this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((function(t){return""!==t})))),n){var o;n[i]&&(null===(o=this.nt)||void 0===o||!o.has(i))&&this.st.add(i)}return this.render(n)}var r,a=t.element.classList,u=K(this.st);try{for(u.s();!(r=u.n()).done;){var s=r.value;s in n||(a.remove(s),this.st.delete(s))}}catch(h){u.e(h)}finally{u.f()}for(var c in n){var l,d=!!n[c];d===this.st.has(c)||(null===(l=this.nt)||void 0===l?void 0:l.has(c))||(d?(a.add(c),this.st.add(c)):(a.remove(c),this.st.delete(c)))}return qt}}])}()),He=function(t,e,n,i){i=i||{},n=null==n?{}:n;var o=new Event(e,{bubbles:void 0===i.bubbles||i.bubbles,cancelable:Boolean(i.cancelable),composed:void 0===i.composed||i.composed});return o.detail=n,t.dispatchEvent(o),o},Ie=function(t,e){if(t===e)return!0;if(t&&e&&"object"===it(t)&&"object"===it(e)){if(t.constructor!==e.constructor)return!1;var n,i;if(Array.isArray(t)){if((i=t.length)!==e.length)return!1;for(n=i;0!=n--;)if(!Ie(t[n],e[n]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;var o,r=K(t.entries());try{for(r.s();!(o=r.n()).done;)if(n=o.value,!e.has(n[0]))return!1}catch(h){r.e(h)}finally{r.f()}var a,u=K(t.entries());try{for(u.s();!(a=u.n()).done;)if(n=a.value,!Ie(n[1],e.get(n[0])))return!1}catch(h){u.e(h)}finally{u.f()}return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;var s,c=K(t.entries());try{for(c.s();!(s=c.n()).done;)if(n=s.value,!e.has(n[0]))return!1}catch(h){c.e(h)}finally{c.f()}return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if((i=t.length)!==e.length)return!1;for(n=i;0!=n--;)if(t[n]!==e[n])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();var l=Object.keys(t);if((i=l.length)!==Object.keys(e).length)return!1;for(n=i;0!=n--;)if(!Object.prototype.hasOwnProperty.call(e,l[n]))return!1;for(n=i;0!=n--;){var d=l[n];if(!Ie(t[d],e[d]))return!1}return!0}return t!=t&&e!=e},Re="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,Ne=function(t){function e(){var t;return Q(this,e),(t=L(this,e,arguments)).holdTime=500,t.held=!1,t.cancelled=!1,t.isRepeating=!1,t.repeatCount=0,t}return G(e,q(HTMLElement)),et(e,[{key:"connectedCallback",value:function(){var t=this;Object.assign(this.style,{position:"fixed",width:Re?"100px":"50px",height:Re?"100px":"50px",transform:"translate(-50%, -50%) scale(0)",pointerEvents:"none",zIndex:"999",background:"var(--primary-color)",display:null,opacity:"0.2",borderRadius:"50%",transition:"transform 180ms ease-in-out"}),["touchcancel","mouseout","mouseup","touchmove","mousewheel","wheel","scroll"].forEach((function(e){document.addEventListener(e,(function(){t.cancelled=!0,t.timer&&(t.stopAnimation(),clearTimeout(t.timer),t.timer=void 0,t.isRepeating&&t.repeatTimeout&&(clearInterval(t.repeatTimeout),t.isRepeating=!1))}),{passive:!0})}))}},{key:"bind",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.actionHandler&&Ie(n,t.actionHandler.options)||(t.actionHandler?(t.removeEventListener("touchstart",t.actionHandler.start),t.removeEventListener("touchend",t.actionHandler.end),t.removeEventListener("touchcancel",t.actionHandler.end),t.removeEventListener("mousedown",t.actionHandler.start),t.removeEventListener("click",t.actionHandler.end),t.removeEventListener("keydown",t.actionHandler.handleKeyDown)):t.addEventListener("contextmenu",(function(t){var e=t||window.event;return e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,e.returnValue=!1,!1})),t.actionHandler={options:n},n.disabled||(t.actionHandler.start=function(i){var o,r,a;if(!(null===(o=i.detail)||void 0===o?void 0:o.ignore))if(e.cancelled=!1,i.touches?(r=i.touches[0].clientX,a=i.touches[0].clientY):(r=i.clientX,a=i.clientY),n.isMomentary){if(!i.touches&&0!==i.button)return;He(t,"action",{action:"press"})}else n.hasHold&&(e.held=!1,e.timer=window.setTimeout((function(){e.startAnimation(r,a),e.held=!0,n.repeat&&!e.isRepeating&&(e.repeatCount=0,e.isRepeating=!0,e.repeatTimeout=setInterval((function(){He(t,"action",{action:"hold"}),e.repeatCount++,e.repeatTimeout&&n.repeatLimit&&e.repeatCount>=n.repeatLimit&&(clearInterval(e.repeatTimeout),e.isRepeating=!1)}),n.repeat))}),e.holdTime))},t.actionHandler.end=function(i){var o;if(!(null===(o=i.detail)||void 0===o?void 0:o.ignore)){if(["touchend","touchcancel"].includes(i.type)&&e.cancelled)return e.isRepeating&&e.repeatTimeout&&(clearInterval(e.repeatTimeout),e.isRepeating=!1),void(n.isMomentary&&He(t,"action",{action:"release"}));if("touchcancel"!=i.type){var r=i.target;i.cancelable&&i.preventDefault(),n.isMomentary?He(t,"action",{action:"release"}):(n.hasHold&&(clearTimeout(e.timer),e.isRepeating&&e.repeatTimeout&&clearInterval(e.repeatTimeout),e.isRepeating=!1,e.stopAnimation(),e.timer=void 0),n.hasHold&&e.held?n.repeat||He(r,"action",{action:"hold"}):n.hasDoubleClick?"click"===i.type&&i.detail<2||!e.dblClickTimeout?e.dblClickTimeout=window.setTimeout((function(){e.dblClickTimeout=void 0,He(r,"action",{action:"tap"})}),250):(clearTimeout(e.dblClickTimeout),e.dblClickTimeout=void 0,He(r,"action",{action:"double_tap"})):He(r,"action",{action:"tap"}))}}},t.actionHandler.handleTouchMove=function(t){"touchmove"==t.type&&n.hasHold&&e.held&&(t.stopPropagation(),t.preventDefault())},t.actionHandler.handleKeyDown=function(t){n.disableKbd||["Enter"," "].includes(t.key)&&t.currentTarget.actionHandler.end(t)},t.addEventListener("touchstart",t.actionHandler.start,{passive:!0}),t.addEventListener("touchmove",t.actionHandler.handleTouchMove),t.addEventListener("touchend",t.actionHandler.end),t.addEventListener("touchcancel",t.actionHandler.end),t.addEventListener("mousedown",t.actionHandler.start,{passive:!0}),t.addEventListener("click",t.actionHandler.end),t.addEventListener("keydown",t.actionHandler.handleKeyDown)))}},{key:"startAnimation",value:function(t,e){Object.assign(this.style,{left:"".concat(t,"px"),top:"".concat(e,"px"),transform:"translate(-50%, -50%) scale(1)"})}},{key:"stopAnimation",value:function(){Object.assign(this.style,{left:null,top:null,transform:"translate(-50%, -50%) scale(0)"})}}])}(); /** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause */customElements.define("button-card-action-handler",Ne);var Ve=function(t,e){var n=function(){var t=document.body;if(t.querySelector("button-card-action-handler"))return t.querySelector("button-card-action-handler");var e=document.createElement("button-card-action-handler");return t.appendChild(e),e}();n&&n.bind(t,e)},ze=me(function(t){function e(){return Q(this,e),L(this,e,arguments)}return G(e,ge),et(e,[{key:"update",value:function(t,e){var n=I(e,1)[0];return Ve(t.element,n),qt}},{key:"render",value:function(t){}}])}());function Le(t,e){(function(t){return"string"==typeof t&&-1!==t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var n=function(t){return"string"==typeof t&&-1!==t.indexOf("%")}(t);return t=360===e?t:Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:t=360===e?(t<0?t%e+e:t%e)/parseFloat(String(e)):t%e/parseFloat(String(e))}function Ue(t){return Math.min(1,Math.max(0,t))}function Ge(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function qe(t){return Number(t)<=1?"".concat(100*Number(t),"%"):t}function We(t){return 1===t.length?"0"+t:String(t)}function Ye(t,e,n){t=Le(t,255),e=Le(e,255),n=Le(n,255);var i=Math.max(t,e,n),o=Math.min(t,e,n),r=0,a=0,u=(i+o)/2;if(i===o)a=0,r=0;else{var s=i-o;switch(a=u>.5?s/(2-i-o):s/(i+o),i){case t:r=(e-n)/s+(e1&&(n-=1),n<1/6?t+6*n*(e-t):n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Ke(t,e,n){t=Le(t,255),e=Le(e,255),n=Le(n,255);var i=Math.max(t,e,n),o=Math.min(t,e,n),r=0,a=i,u=i-o,s=0===i?0:u/i;if(i===o)r=0;else{switch(i){case t:r=(e-n)/u+(e0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Q(this,t),n instanceof t)return n;"number"==typeof n&&(n=function(t){return{r:t>>16,g:(65280&t)>>8,b:255&t}}(n)),this.originalInput=n;var o=on(n);this.originalInput=n,this.r=o.r,this.g=o.g,this.b=o.b,this.a=o.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(e=i.format)&&void 0!==e?e:o.format,this.gradientType=i.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=o.ok}return et(t,[{key:"isDark",value:function(){return this.getBrightness()<128}},{key:"isLight",value:function(){return!this.isDark()}},{key:"getBrightness",value:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3}},{key:"getLuminance",value:function(){var t=this.toRgb(),e=t.r/255,n=t.g/255,i=t.b/255;return.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.0722*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))}},{key:"getAlpha",value:function(){return this.a}},{key:"setAlpha",value:function(t){return this.a=Ge(t),this.roundA=Math.round(100*this.a)/100,this}},{key:"isMonochrome",value:function(){return 0===this.toHsl().s}},{key:"toHsv",value:function(){var t=Ke(this.r,this.g,this.b);return{h:360*t.h,s:t.s,v:t.v,a:this.a}}},{key:"toHsvString",value:function(){var t=Ke(this.r,this.g,this.b),e=Math.round(360*t.h),n=Math.round(100*t.s),i=Math.round(100*t.v);return 1===this.a?"hsv(".concat(e,", ").concat(n,"%, ").concat(i,"%)"):"hsva(".concat(e,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")}},{key:"toHsl",value:function(){var t=Ye(this.r,this.g,this.b);return{h:360*t.h,s:t.s,l:t.l,a:this.a}}},{key:"toHslString",value:function(){var t=Ye(this.r,this.g,this.b),e=Math.round(360*t.h),n=Math.round(100*t.s),i=Math.round(100*t.l);return 1===this.a?"hsl(".concat(e,", ").concat(n,"%, ").concat(i,"%)"):"hsla(".concat(e,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")}},{key:"toHex",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Xe(this.r,this.g,this.b,t)}},{key:"toHexString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return"#"+this.toHex(t)}},{key:"toHex8",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function(t,e,n,i,o){var r=[We(Math.round(t).toString(16)),We(Math.round(e).toString(16)),We(Math.round(n).toString(16)),We(Qe(i))];return o&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))&&r[3].startsWith(r[3].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0)+r[3].charAt(0):r.join("")}(this.r,this.g,this.b,this.a,t)}},{key:"toHex8String",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return"#"+this.toHex8(t)}},{key:"toHexShortString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return 1===this.a?this.toHexString(t):this.toHex8String(t)}},{key:"toRgb",value:function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}},{key:"toRgbString",value:function(){var t=Math.round(this.r),e=Math.round(this.g),n=Math.round(this.b);return 1===this.a?"rgb(".concat(t,", ").concat(e,", ").concat(n,")"):"rgba(".concat(t,", ").concat(e,", ").concat(n,", ").concat(this.roundA,")")}},{key:"toPercentageRgb",value:function(){var t=function(t){return"".concat(Math.round(100*Le(t,255)),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}}},{key:"toPercentageRgbString",value:function(){var t=function(t){return Math.round(100*Le(t,255))};return 1===this.a?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")}},{key:"toCmyk",value:function(){return function(t){for(var e=1;e=0;return e||!i||!t.startsWith("hex")&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),"cmyk"===t&&(n=this.toCmykString()),n||this.toHexString()):"name"===t&&0===this.a?this.toName():this.toRgbString()}},{key:"toNumber",value:function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}},{key:"clone",value:function(){return new t(this.toString())}},{key:"lighten",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=this.toHsl();return n.l+=e/100,n.l=Ue(n.l),new t(n)}},{key:"brighten",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-e/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-e/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-e/100*255))),new t(n)}},{key:"darken",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=this.toHsl();return n.l-=e/100,n.l=Ue(n.l),new t(n)}},{key:"tint",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this.mix("white",t)}},{key:"shade",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this.mix("black",t)}},{key:"desaturate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=this.toHsl();return n.s-=e/100,n.s=Ue(n.s),new t(n)}},{key:"saturate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=this.toHsl();return n.s+=e/100,n.s=Ue(n.s),new t(n)}},{key:"greyscale",value:function(){return this.desaturate(100)}},{key:"spin",value:function(e){var n=this.toHsl(),i=(n.h+e)%360;return n.h=i<0?360+i:i,new t(n)}},{key:"mix",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,i=this.toRgb(),o=new t(e).toRgb(),r=n/100;return new t({r:(o.r-i.r)*r+i.r,g:(o.g-i.g)*r+i.g,b:(o.b-i.b)*r+i.b,a:(o.a-i.a)*r+i.a})}},{key:"analogous",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,i=this.toHsl(),o=360/n,r=[this];for(i.h=(i.h-(o*e>>1)+720)%360;--e;)i.h=(i.h+o)%360,r.push(new t(i));return r}},{key:"complement",value:function(){var e=this.toHsl();return e.h=(e.h+180)%360,new t(e)}},{key:"monochromatic",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6,n=this.toHsv(),i=n.h,o=n.s,r=n.v,a=[],u=1/e;e--;)a.push(new t({h:i,s:o,v:r})),r=(r+u)%1;return a}},{key:"splitcomplement",value:function(){var e=this.toHsl(),n=e.h;return[this,new t({h:(n+72)%360,s:e.s,l:e.l}),new t({h:(n+216)%360,s:e.s,l:e.l})]}},{key:"onBackground",value:function(e){var n=this.toRgb(),i=new t(e).toRgb(),o=n.a+i.a*(1-n.a);return new t({r:(n.r*n.a+i.r*i.a*(1-n.a))/o,g:(n.g*n.a+i.g*i.a*(1-n.a))/o,b:(n.b*n.a+i.b*i.a*(1-n.a))/o,a:o})}},{key:"triad",value:function(){return this.polyad(3)}},{key:"tetrad",value:function(){return this.polyad(4)}},{key:"polyad",value:function(e){for(var n=this.toHsl(),i=n.h,o=[this],r=360/e,a=1;at.length)&&(n=t.length);for(var i=[],o=0;o1?e-1:0),i=1;i :first-child {\n width: 100%;\n }\n [style*='--aspect-ratio'] > img {\n height: auto;\n }\n @supports (--custom: property) {\n [style*='--aspect-ratio'] {\n position: relative;\n }\n [style*='--aspect-ratio']::before {\n content: '';\n display: block;\n padding-bottom: calc(100% / (var(--aspect-ratio)));\n }\n [style*='--aspect-ratio'] > :first-child {\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n }\n }\n"])));!function(t){t.language="language",t.system="system",t.comma_decimal="comma_decimal",t.decimal_comma="decimal_comma",t.space_comma="space_comma",t.none="none"}(Mn||(Mn={})),function(t){t.language="language",t.system="system",t.am_pm="12",t.twenty_four="24"}(Pn||(Pn={})),function(t){t.local="local",t.server="server"}(Hn||(Hn={})),function(t){t.language="language",t.system="system",t.DMY="DMY",t.MDY="MDY",t.YMD="YMD"}(In||(In={})),function(t){t.language="language",t.monday="monday",t.tuesday="tuesday",t.wednesday="wednesday",t.thursday="thursday",t.friday="friday",t.saturday="saturday",t.sunday="sunday"}(Rn||(Rn={}));var qn,Wn,Yn,Zn,Kn,Xn=function(t,e,n){var i=e?function(t){switch(t.number_format){case Mn.comma_decimal:return["en-US","en"];case Mn.decimal_comma:return["de","es","it"];case Mn.space_comma:return["fr","sv","cs"];case Mn.system:return;default:return t.language}}(e):void 0;if(Number.isNaN=Number.isNaN||function t(e){return"number"==typeof e&&t(e)},(null==e?void 0:e.number_format)!==Mn.none&&!Number.isNaN(Number(t))&&Intl)try{return new Intl.NumberFormat(i,Qn(t,n)).format(Number(t))}catch(o){return console.error(o),new Intl.NumberFormat(void 0,Qn(t,n)).format(Number(t))}return"string"==typeof t?t:"".concat(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return Math.round(t*Math.pow(10,e))/Math.pow(10,e)}(t,null==n?void 0:n.maximumFractionDigits).toString()).concat("currency"===(null==n?void 0:n.style)?" ".concat(n.currency):"")},Jn=function(t,e,n){var i,o=null==n?void 0:n.display_precision;return void 0!==e&&(o=e),null!=o?{maximumFractionDigits:o,minimumFractionDigits:o}:Number.isInteger(Number(null===(i=t.attributes)||void 0===i?void 0:i.step))&&Number.isInteger(Number(t.state))?{maximumFractionDigits:0}:null!=t.attributes.step?{maximumFractionDigits:Math.ceil(Math.log10(1/t.attributes.step))}:void 0},Qn=function(t,e){var n=Object.assign({maximumFractionDigits:2},e);if("string"!=typeof t)return n;if(!e||void 0===e.minimumFractionDigits&&void 0===e.maximumFractionDigits){var i=t.indexOf(".")>-1?t.split(".")[1].length:0;n.minimumFractionDigits=i,n.maximumFractionDigits=i}return n};!function(t){t.language="language",t.system="system",t.comma_decimal="comma_decimal",t.decimal_comma="decimal_comma",t.space_comma="space_comma",t.none="none"}(qn||(qn={})),function(t){t.language="language",t.system="system",t.am_pm="12",t.twenty_four="24"}(Wn||(Wn={})),function(t){t.local="local",t.server="server"}(Yn||(Yn={})),function(t){t.language="language",t.system="system",t.DMY="DMY",t.MDY="MDY",t.YMD="YMD"}(Zn||(Zn={})),function(t){t.language="language",t.monday="monday",t.tuesday="tuesday",t.wednesday="wednesday",t.thursday="thursday",t.friday="friday",t.saturday="saturday",t.sunday="sunday"}(Kn||(Kn={}));var ti=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=""+t,i=1;i0?"".concat(e,":").concat(ti(n),":").concat(ti(i)):n>0?"".concat(n,":").concat(ti(i)):i>0||o>0?"".concat(i).concat(o>0?".".concat(ti(o,3)):""):null}(parseFloat(t)*ei[e])||"0"},ii=Number.isNaN||function(t){return"number"==typeof t&&t!=t};function oi(t,e){if(t.length!==e.length)return!1;for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"_",n="àáäâãåăæąçćčđďèéěėëêęğǵḧìíïîįłḿǹńňñòóöôœøṕŕřßşśšșťțùúüûǘůűūųẃẍÿýźžż·/_,:;",i="aaaaaaaaacccddeeeeeeegghiiiiilmnnnnooooooprrsssssttuuuuuuuuuwxyyzzz".concat(e).concat(e).concat(e).concat(e).concat(e).concat(e),o=new RegExp(n.split("").join("|"),"g");return t.toString().toLowerCase().replace(/\s+/g,e).replace(o,(function(t){return i.charAt(n.indexOf(t))})).replace(/&/g,"".concat(e,"and").concat(e)).replace(/[^\w-]+/g,"").replace(/-/g,e).replace(new RegExp("(".concat(e,")\\1+"),"g"),"$1").replace(new RegExp("^".concat(e,"+")),"").replace(new RegExp("".concat(e,"+$")),"")}(o,"_"),s=r?"active":"inactive";if(i&&yn.includes(i)&&"inactive"==s)return bn;var c=e.attributes.device_class;return c&&a.push("--state-".concat(t,"-").concat(c,"-").concat(u,"-color")),a.push("--state-".concat(t,"-").concat(u,"-color"),"--state-".concat(t,"-").concat(s,"-color"),"--state-".concat(s,"-color")),a},vo=function(t,e,n){var i=void 0!==e?e:null==t?void 0:t.state,o=Cn(t.entity_id),r=t.attributes.device_class;if("sensor"===o&&"battery"===r){var a=function(t){var e=Number(t);if(!isNaN(e))return e>=70?"--state-sensor-battery-high-color":e>=30?"--state-sensor-battery-medium-color":"--state-sensor-battery-low-color"}(i);if(a)return[a]}if("group"===o){var u=function(t){var e=t.attributes.entity_id||[],n=H(new Set(e.map((function(t){return Cn(t)}))));return 1===n.length?n[0]:void 0}(t);if(u&&lo.has(u))return fo(u,t,e,n)}return lo.has(o)?fo(o,t,e,n):n&&yn.includes(n)?bn:void 0},po=function(){var t=z(R().m((function t(e,n,i,o){return R().w((function(t){for(;;)switch(t.n){case 0:He(e,"hass-action",{config:i,action:o});case 1:return t.a(2)}}),t)})));return function(e,n,i,o){return t.apply(this,arguments)}}(),mo=Object.create(null),go=36e5,_o=24*go,yo=365.25*_o;mo.year=mo.yr=mo.y=yo,mo.month=mo.mo=mo.mth=yo/12,mo.week=mo.wk=mo.w=7*_o,mo.day=mo.d=_o,mo.hour=mo.hr=mo.h=go,mo.minute=mo.min=mo.m=6e4,mo.second=mo.sec=mo.s=1e3,mo.millisecond=mo.millisec=mo.ms=1,mo.microsecond=mo.microsec=mo.us=mo.µs=.001,mo.nanosecond=mo.nanosec=mo.ns=1e-6,mo.group=",",mo.decimal=".",mo.placeholder=" _";var bo=/((?:[0-9]{1,16}(?:\.[0-9]{1,16})?|\.[0-9]{1,16})(?:[Ee][\+\x2D]?[0-9]{1,4})?)[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]?((?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDB0-\uDDDB\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2\uDFF3]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]){0,14})/g;function Do(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ms",i=null;return String(e).replace(new RegExp("(\\d)[".concat(Do.unit.placeholder).concat(Do.unit.group,"](\\d)"),"g"),"$1$2").replace(Do.unit.decimal,".").replace(bo,(function(e,o,r){if(r)r=r.toLowerCase();else if(t){for(var a in Do.unit)if(Do.unit[a]1&&void 0!==arguments[1]&&arguments[1],n=function(t,e){return i("hui-error-card",{type:"error",error:t,config:e})},i=function(t,e){var i=window.document.createElement(t);try{if(!i.setConfig)return;i.setConfig(e)}catch(o){return console.error(t,o),n(o.message,e)}return i};if(!t||"object"!==it(t)||!e&&!t.type)return n("No type defined",t);var o=t.type;if(o&&o.startsWith("custom:"))o=o.substr(7);else if(e)if(Ln.has(o))o="hui-".concat(o,"-row");else{if(!t.entity)return n("Invalid config given.",t);var r=t.entity.split(".",1)[0];o="hui-".concat(Un[r]||"text","-entity-row")}else o="hui-".concat(o,"-card");if(customElements.get(o))return i(o,t);var a=n("Custom element doesn't exist: ".concat(t.type,"."),t);a.style.display="None";var u=setTimeout((function(){a.style.display=""}),2e3);return customElements.whenDefined(t.type).then((function(){clearTimeout(u),He(a,"ll-rebuild",{},a)})),a}(t);return Bo.then((function(){He(e,"ll-rebuild",{})})),e}},{key:"render",value:function(){var t,e,n,i=this;if(!this._config||!this._hass)return Gt(u||(u=B([""])));this._stateObj=this._config.entity?this._hass.states[this._config.entity]:void 0;try{return this._evaluatedVariables={},(null===(t=this._config)||void 0===t?void 0:t.variables)&&(null===(n=Object.keys(null===(e=this._config)||void 0===e?void 0:e.variables))||void 0===n||n.forEach((function(t){var e=i._config.variables[t];if("object"===it(e)&&null!==e&&e.force_eval)i._pVariables[t]}))),this._cardHtml()}catch(Pe){Pe.stack?console.error(Pe.stack):console.error(Pe);var o=document.createElement("hui-error-card");return o.preview=this.preview,o.setConfig({type:"error",error:Pe.name,message:Pe.message}),Gt(s||(s=B([" "," "])),o)}}},{key:"_hasAnEntityChanged",value:function(t){var e=t.get("_hass");if(e){return this._monitoredEntities.some(function(t){return(null==e?void 0:e.states[t])!==this._hass.states[t]}.bind(this))}return!1}},{key:"shouldUpdate",value:function(t){return!!t.has("_config")||(this._updateTimerDuration?!!t.has("_updateTimerMS")||this._updateTimerChanged():!!(t.has("_timeRemaining")||t.has("_updateTimerMS")||t.has("_spinnerActive"))||this._hasAnEntityChanged(t)?(this._expandTriggerGroups(),!0):!!t.has("preview"))}},{key:"willUpdate",value:function(t){var e=this;t.has("preview")&&Object.keys(this._cards).forEach((function(t){e._cards[t].preview=e.preview}))}},{key:"updated",value:function(t){var n=this;if(M(e,"updated",this,3)([t]),this._config&&this._config.entity&&"timer"===Cn(this._config.entity)&&t.has("_hass")){var i=this._hass.states[this._config.entity],o=t.get("_hass");(o?o.states[this._config.entity]:void 0)!==i?this._startInterval(i):i||this._clearInterval()}this.updateComplete.then((function(){var t,e,i,o,r=null===(t=n.shadowRoot)||void 0===t?void 0:t.getElementById("tooltip");r&&(null===(e=r.eventController)||void 0===e||e.abort(),r.eventController=new AbortController,r.anchor=void 0,null===(o=(i=r).handleForChange)||void 0===o||o.call(i))})),this._updateTimer(),this._computeHidden()}},{key:"_clearInterval",value:function(){this._interval&&(window.clearInterval(this._interval),this._interval=void 0)}},{key:"_startInterval",value:function(t){var e=this;this._clearInterval(),this._calculateRemaining(t),"active"===t.state&&(this._interval=window.setInterval((function(){return e._calculateRemaining(t)}),1e3))}},{key:"_calculateRemaining",value:function(t){t.attributes.remaining&&(this._timeRemaining=function(t){if(t.attributes.remaining){var e=$n(t.attributes.remaining);if("active"===t.state){var n=(new Date).getTime(),i=new Date(t.last_changed).getTime();e=Math.max(e-(n-i)/1e3,0)}return e}}(t))}},{key:"_computeTimeDisplay",value:function(t){if(t)return function(t){var e=Math.floor(t/3600),n=Math.floor(t%3600/60),i=Math.floor(t%3600%60);return e>0?"".concat(e,":").concat(xn(n),":").concat(xn(i)):n>0?"".concat(n,":").concat(xn(i)):i>0?""+i:null}(this._timeRemaining||$n(t.attributes.duration))}},{key:"_getMatchingConfigState",value:function(t){var e=this;if(this._config.state){var n=this._config.state.find((function(t){return"template"===t.operator}));if(t||n){var i,o=this._config.state.find((function(n){if(!n.operator)return t&&e._getTemplateOrValue(t,n.value)==t.state;switch(n.operator){case"==":return t&&t.state==e._getTemplateOrValue(t,n.value);case"<=":return t&&t.state<=e._getTemplateOrValue(t,n.value);case"<":return t&&t.state=":return t&&t.state>=e._getTemplateOrValue(t,n.value);case">":return t&&t.state>e._getTemplateOrValue(t,n.value);case"!=":return t&&t.state!=e._getTemplateOrValue(t,n.value);case"regex":return!(!t||!t.state.match(e._getTemplateOrValue(t,n.value)));case"template":return e._getTemplateOrValue(t,n.value);case"default":return i=n,!1;default:return!1}}));return!o&&i?i:o}}}},{key:"_localize",value:function(t,e,n){var i,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4?arguments[4]:void 0;return Si(this._hass.localize,t,this._hass.locale,this._hass.config,this._hass.entities,{numeric_precision:"card"===n?null===(i=this._config)||void 0===i?void 0:i.numeric_precision:n,show_units:o,units:r},e)}},{key:"_relativeTime",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?Gt(c||(c=B(['\n \n '])),this._hass,t,e):""}},{key:"_getTemplateHelpers",value:function(){var t=this;return{localize:this._localize.bind(this),formatDateTime:function(e){return wi(new Date(e),t._hass.locale,t._hass.config)},formatShortDateTimeWithYear:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,Ei(i,o.time_zone).format(n);var n,i,o},formatShortDateTime:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,ki(i,o.time_zone).format(n);var n,i,o},formatDateTimeWithSeconds:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,Fi(i,o.time_zone).format(n);var n,i,o},formatDateTimeNumeric:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,"".concat(ci(n,i,o),", ").concat(_i(n,i,o));var n,i,o},relativeTime:this._relativeTime.bind(this),formatTime:function(e){return _i(new Date(e),t._hass.locale,t._hass.config)},formatTimeWithSeconds:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,bi(i,o.time_zone).format(n);var n,i,o},formatTimeWeekday:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,Di(i,o.time_zone).format(n);var n,i,o},formatTime24h:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,Ai(i,o.time_zone).format(n);var n,i,o},formatDateWeekdayDay:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,ai(i,o.time_zone).format(n);var n,i,o},formatDate:function(e){return ui(new Date(e),t._hass.locale,t._hass.config)},formatDateNumeric:function(e){return ci(new Date(e),t._hass.locale,t._hass.config)},formatDateShort:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,di(i,o.time_zone).format(n);var n,i,o},formatDateMonthYear:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,hi(i,o.time_zone).format(n);var n,i,o},formatDateMonth:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,fi(i,o.time_zone).format(n);var n,i,o},formatDateYear:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,vi(i,o.time_zone).format(n);var n,i,o},formatDateWeekday:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,pi(i,o.time_zone).format(n);var n,i,o},formatDateWeekdayShort:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,mi(i,o.time_zone).format(n);var n,i,o},parseDuration:function(e,n,i){var o;return void 0===n&&(n="ms"),void 0===i&&(i=null===(o=t._hass.locale)||void 0===o?void 0:o.language),So(e,n,i)},toastMessage:function(e){return t._sendToastMessage.bind(t)({message:e})},toast:function(e){return t._sendToastMessage.bind(t)(e)},runAction:function(e){var n=t._evalActions(t._config,e);t._buildActionConfig(n)}}}},{key:"_evalTemplate",value:function(t,e){try{return new Function("states","entity","user","hass","variables","html","helpers","'use strict'; ".concat(e)).call(this,this._pStates,t,this._hass.user,this._pHass,this._pVariables,Gt,this._getTemplateHelpers())}catch(Pe){var n=e.length<=100?e.trim():"".concat(e.trim().substring(0,98),"...");throw Pe.message="".concat(Pe.name,": ").concat(Pe.message," in '").concat(n,"'"),Pe.name="ButtonCardJSTemplateError",Pe}}},{key:"_objectEvalTemplate",value:function(t,e){var n=co(e);return this._getTemplateOrValue(t,n)}},{key:"_getTemplateOrValue",value:function(t,e){var n=this;if(["number","boolean","function"].includes(it(e)))return e;if(!e)return e;if("object"===it(e))return Object.keys(e).forEach((function(i){e[i]=n._getTemplateOrValue(t,e[i])})),e;var i=e.trim(),o=new RegExp("^(\\[{3,})(.*?)(\\]{3,})$","s"),r=i.match(o);return r&&4===r.length?3===r[1].length&&3===r[3].length?this._evalTemplate(t,r[2]):r[1].length===r[3].length?i.slice(1,-1):e:e}},{key:"_getColorForLightEntity",value:function(t,e,n){var i,o,r,a,u,s,c,l=Dn;return yn.includes(l)&&(l=Bn(bn)),t&&(Tn(t)?(t.attributes.rgb_color?l="rgb(".concat(t.attributes.rgb_color.join(","),")"):e&&t.attributes.color_temp&&t.attributes.min_mireds&&t.attributes.max_mireds?(i=t.attributes.color_temp,o=t.attributes.min_mireds,r=t.attributes.max_mireds,a=new dn("rgb(255, 160, 0)"),u=new dn("rgb(166, 209, 255)"),s=new dn("white"),l=(c=(i-o)/(r-o)*100)<50?u.mix(s,2*c).toRgbString():s.mix(a,2*(c-50)).toRgbString()):l=ho(t,t.state,n)||Dn,t.attributes.brightness&&(l=function(t,e,n){var i=new dn(En(t,e));if(i.isValid){var o=i.mix("black",100-n).toString();if(o)return o}return e}(this,l,(t.attributes.brightness+245)/5))):l=ho(t,t.state,n)||Dn),l}},{key:"_buildCssColorAttribute",value:function(t,e){var n,i,o="";return(null==e?void 0:e.color)?o=e.color:this._config.color&&(o=this._config.color),_n.includes(o)&&(!t||t&&"light"!==Cn(t.entity_id))&&(o=""),_n.includes(o)?this._getColorForLightEntity(t,"auto-no-temperature"!==o,null===(n=this._config)||void 0===n?void 0:n.color_type):o||(t&&ho(t,t.state,null===(i=this._config)||void 0===i?void 0:i.color_type)||Dn)}},{key:"_buildIcon",value:function(t,e){if(this._config.show_icon){var n;if(null==e?void 0:e.icon)n=e.icon;else{if(!this._config.icon)return;n=this._config.icon}return this._getTemplateOrValue(t,n)}}},{key:"_buildEntityPicture",value:function(t,e){if(this._config.show_entity_picture&&(t||e||this._config.entity_picture)){var n;(null==e?void 0:e.entity_picture)?n=e.entity_picture:this._config.entity_picture?n=this._config.entity_picture:t&&(n=t.attributes&&t.attributes.entity_picture?t.attributes.entity_picture:void 0);var i=this._getTemplateOrValue(t,n);return i&&Nn(i)?Vn(this._hass,i).then((function(t){return t.url})).catch((function(){return""})):i}}},{key:"_buildStyleGeneric",value:function(t,e,n){var i,o,r=this,a={};if((null===(i=this._config.styles)||void 0===i?void 0:i[n])&&(a=Object.assign.apply(Object,[a].concat(H(this._config.styles[n])))),null===(o=null==e?void 0:e.styles)||void 0===o?void 0:o[n]){var u={};u=Object.assign.apply(Object,[u].concat(H(e.styles[n]))),a=Object.assign(Object.assign({},a),u)}return Object.keys(a).forEach((function(e){a[e]=r._getTemplateOrValue(t,a[e])})),a}},{key:"_buildCustomStyleGeneric",value:function(t,e,n){var i,o,r,a,u=this,s={};if((null===(o=null===(i=this._config.styles)||void 0===i?void 0:i.custom_fields)||void 0===o?void 0:o[n])&&(s=Object.assign.apply(Object,[s].concat(H(this._config.styles.custom_fields[n])))),null===(a=null===(r=null==e?void 0:e.styles)||void 0===r?void 0:r.custom_fields)||void 0===a?void 0:a[n]){var c={};c=Object.assign.apply(Object,[c].concat(H(e.styles.custom_fields[n]))),s=Object.assign(Object.assign({},s),c)}return Object.keys(s).forEach((function(e){s[e]=u._getTemplateOrValue(t,s[e])})),s}},{key:"_buildName",value:function(t,e){var n,i;if(!1!==this._config.show_name)return(null==e?void 0:e.name)?n=e.name:this._config.name?n=this._config.name:t&&(n=t.attributes&&t.attributes.friendly_name?t.attributes.friendly_name:(i=t.entity_id).substr(i.indexOf(".")+1)),this._getTemplateOrValue(t,n)}},{key:"_buildStateString",value:function(t){var e;return this._config.show_state&&t&&t.state&&("timer"===Cn(t.entity_id)?"idle"===t.state||0===this._timeRemaining?e=Si(this._hass.localize,t,this._hass.locale,this._hass.config,this._hass.entities,this._config):(e=this._computeTimeDisplay(t),"paused"===t.state&&(e+=" (".concat(Si(this._hass.localize,t,this._hass.locale,this._hass.config,this._hass.entities,this._config),")"))):e=Si(this._hass.localize,t,this._hass.locale,this._hass.config,this._hass.entities,this._config)),e}},{key:"_buildLastChanged",value:function(t,e){return this._config.show_last_changed&&t?Gt(l||(l=B(['\n \n \n ',"\n \n \n "," ","\n ","\n \n "])),S,$e(A),Pe(F),$e(y),this._tooltipShow,(function(t){return u._handleAction(t,{isIcon:!1})}),ze({hasDoubleClick:this._isActionDoingSomething(this._stateObj,this._config.double_tap_action),hasHold:this._isActionDoingSomething(this._stateObj,this._config.hold_action),repeat:null==T?void 0:T.repeat,repeatLimit:null==T?void 0:T.repeat_limit,isMomentary:this._cardMomentary,disableKbd:null===(a=this._config)||void 0===a?void 0:a.disable_kbd}),this._config,this._buttonContent(this._stateObj,s,_),!this._cardRipple,this._getLock(b),this._getSpinner(D,s),this._getTooltip(k,s))}},{key:"_getTooltip",value:function(t,e){var n,i,o,r,a,u,s;u="string"==typeof this._config.tooltip?{content:this._getTemplateOrValue(this._stateObj,this._config.tooltip)}:null!==(n=this._objectEvalTemplate(this._stateObj,this._config.tooltip))&&void 0!==n?n:{},s="string"==typeof(null==e?void 0:e.tooltip)?{content:this._getTemplateOrValue(this._stateObj,null==e?void 0:e.tooltip)}:null!==(i=this._objectEvalTemplate(this._stateObj,null==e?void 0:e.tooltip))&&void 0!==i?i:{};var c=Object.assign(Object.assign({},u),s);if(c&&c.content){var l=So(String(null!==(o=null==c?void 0:c.delay)&&void 0!==o?o:"150"),"ms","en"),d=So(String(null!==(a=null!==(r=null==c?void 0:c.hide_delay)&&void 0!==r?r:null==c?void 0:c.delay)&&void 0!==a?a:"150"),"ms","en"),h=!(null==c?void 0:c.arrow)||void 0;return Gt(_||(_=B(['\n \n ',"\n \n "])),this._tooltipShow,fe(c.placement||void 0),fe(c.distance||void 0),fe(c.skidding||void 0),l,d,h||Wt,$e(t),this._unsafeHTMLorNot(c.content))}return Gt(y||(y=B([""])))}},{key:"_getSpinner",value:function(t,e){var n=this._getTemplateOrValue(this._stateObj,null==e?void 0:e.spinner)||this._getTemplateOrValue(this._stateObj,this._config.spinner);return this._spinnerActive||n?Gt(b||(b=B(['\n
\n
\n \n
\n '])),$e(t)):Gt(D||(D=B([""])))}},{key:"_getLock",value:function(t){var e;return this._config.lock&&this._getTemplateOrValue(this._stateObj,this._config.lock.enabled)?Gt(A||(A=B(['\n \n =100&&n!==this._updateTimerDuration)return!0}return!1}},{key:"_updateTimer",value:function(){var t,e=this;if(this._updateTimeout&&(window.clearTimeout(this._updateTimeout),this._updateTimeout=void 0),null===(t=this._config)||void 0===t?void 0:t.update_timer){var n=this._getTemplateOrValue(this._stateObj,this._config.update_timer),i=So(n,"ms","en");i&&i>=100&&(this._updateTimerDuration=i,this._updateTimeout=window.setTimeout((function(){e._updateRefresh()}),i))}}},{key:"_updateRefresh",value:function(){this._updateTimerMS=Date.now(),this._updateTimeout=void 0}},{key:"getCardSize",value:function(){var t;return(null===(t=this._config)||void 0===t?void 0:t.card_size)||3}},{key:"getGridOptions",value:function(){var t;if(null===(t=this._config)||void 0===t?void 0:t.section_mode)return{rows:2,columns:6,min_rows:1,min_columns:1}}},{key:"_partialActionEval",value:function(t){var e=this;if(!t)return{action:"none"};if("string"==typeof t)return this._objectEvalTemplate(this._stateObj,t);var n=co(t);return["action","repeat","repeat_limit"].forEach((function(t){n[t]=e._getTemplateOrValue(e._stateObj,n[t])})),n}},{key:"_evalActions",value:function(t,e){var n,i;i="string"==typeof e?this._objectEvalTemplate(this._stateObj,e):co(e);var o=this._getTemplateOrValue(this._stateObj,null==i?void 0:i.action);if("none"===o||!o){var r={};return r[wn]={action:"none"},r}var a=this._getTemplateOrValue(this._stateObj,null==i?void 0:i.repeat),u=this._getTemplateOrValue(this._stateObj,null==i?void 0:i.repeat_limit),s=this._getTemplateOrValue(this._stateObj,null==i?void 0:i.sound),c=this._getTemplateOrValue(this._stateObj,null==i?void 0:i.confirmation);!c&&t.confirmation&&(c=this._objectEvalTemplate(this._stateObj,t.confirmation));var l=this._getTemplateOrValue(this._stateObj,null==i?void 0:i.haptic),d=Object.assign(Object.assign({},this._objectEvalTemplate(this._stateObj,t.protect)),this._objectEvalTemplate(this._stateObj,null==i?void 0:i.protect)),h={};switch(o){case"javascript":h[wn]={action:"fire-dom-event",buttonCardCustomAction:{callback:this._customActionsCallback.bind(this),type:"javascript",data:{javascript:null==i?void 0:i.javascript}}};break;case"multi-actions":h[wn]={action:"fire-dom-event",buttonCardCustomAction:{callback:this._customActionsCallback.bind(this),type:"multi-actions",data:{multiActions:null==i?void 0:i.actions}}};break;case"toast":h[wn]={action:"fire-dom-event",buttonCardCustomAction:{callback:this._customActionsCallback.bind(this),type:"toast",data:{toast:null==i?void 0:i.toast}}};break;case"toggle":h.entity=this._getTemplateOrValue(this._stateObj,null==i?void 0:i.entity)||this._getTemplateOrValue(this._stateObj,t.entity),h[wn]={action:"toggle"};break;case"more-info":h.entity=this._getTemplateOrValue(this._stateObj,null==i?void 0:i.entity)||this._getTemplateOrValue(this._stateObj,t.entity),h[wn]={action:"more-info"};break;case"navigate":h[wn]={action:"navigate",navigation_path:this._getTemplateOrValue(this._stateObj,null==i?void 0:i.navigation_path),navigation_replace:this._getTemplateOrValue(this._stateObj,null==i?void 0:i.navigation_replace)};break;case"url":h[wn]={action:"url",url_path:this._getTemplateOrValue(this._stateObj,null==i?void 0:i.url_path)};break;case"perform-action":case"call-service":h[wn]={action:"perform-action",perform_action:this._getTemplateOrValue(this._stateObj,null==i?void 0:i.perform_action)||this._getTemplateOrValue(this._stateObj,null==i?void 0:i.service),data:this._objectEvalTemplate(this._stateObj,null==i?void 0:i.data)||this._objectEvalTemplate(this._stateObj,null==i?void 0:i.service_data),target:this._objectEvalTemplate(this._stateObj,null==i?void 0:i.target)},"entity"===(null===(n=h[wn].data)||void 0===n?void 0:n.entity_id)&&(h[wn].data.entity_id=this._getTemplateOrValue(this._stateObj,t.entity));break;case"assist":h[wn]={action:"assist",pipeline_id:this._getTemplateOrValue(this._stateObj,null==i?void 0:i.pipeline_id),start_listening:this._getTemplateOrValue(this._stateObj,null==i?void 0:i.start_listening)};break;case"fire-dom-event":h[wn]=Object.assign({action:"fire-dom-event"},this._objectEvalTemplate(this._stateObj,i));break;default:return x({},wn,{action:"none"})}return h[wn]=Object.assign(Object.assign({},h[wn]),{repeat:a,repeat_limit:u,sound:s,haptic:l,confirmation:c,protect:d}),d&&(d.password||d.pin)&&(this._protectedAction=co(h)),h}},{key:"_handleRippleIcon",value:function(t){this._ripple.then((function(e){var n,i;if(e)if("pointerenter"===t.type){var o=null!==(i=null===(n=t.target)||void 0===n?void 0:n.getBoundingClientRect())&&void 0!==i?i:null,r=e.getBoundingClientRect(),a={top:0,left:0,bottom:0,right:0},u=t.target?getComputedStyle(t.target):null,s=u?parseInt(u.getPropertyValue("--button-card-ripple-icon-inset-padding")):12,c="";o&&r&&(a.top=o.top-r.top-s,a.top=a.top<0?0:a.top,a.left=o.left-r.left-s,a.left=a.left<0?0:a.left,a.bottom=r.bottom-o.bottom-s,a.bottom=a.bottom<0?0:a.bottom,a.right=r.right-o.right-s,a.right=a.right<0?0:a.right,c="".concat(a.top,"px ").concat(a.right,"px ").concat(a.bottom,"px ").concat(a.left,"px")),e.setAttribute("icon",""),""!=c&&e.style.setProperty("--dynamic-ripple-icon-inset",c)}else"pointerleave"===t.type&&(e.removeAttribute("icon"),e.style.removeProperty("--dynamic-ripple-icon-inset"))}))}},{key:"_hapticInterceptHandler",value:function(t){this._hapticCapture&&t.stopPropagation&&("failure"!==t.detail&&t.stopPropagation())}},{key:"_handleAction",value:function(t,e){var n;if(e.isIcon&&this._hasIconActions&&t.stopPropagation&&t.stopPropagation(),null===(n=t.detail)||void 0===n?void 0:n.action){var i=this._config;if(!i)return;var o=t.detail.action,r=e.isIcon?"icon_".concat(o,"_action"):"".concat(o,"_action");if(this._isActionDoingSomething(this._stateObj,i[r])){var a=this._evalActions(i,i[r]);this._buildActionConfig(a)}}}},{key:"_buildActionConfig",value:function(t){var e,n,i,o,r=this;t&&((null===(n=null===(e=t[wn])||void 0===e?void 0:e.protect)||void 0===n?void 0:n.pin)?window.cardHelpers.showEnterCodeDialog(this,{submit:function(t){return r._protectedConfirmedCallback.bind(r)(t,"pin")},cancel:this._cancelledCallback.bind(this),codeFormat:"number"}):(null===(o=null===(i=t[wn])||void 0===i?void 0:i.protect)||void 0===o?void 0:o.password)?window.cardHelpers.showPromptDialog(this,{title:"Password",inputLabel:"Password",inputType:"password",confirm:function(t){return r._protectedConfirmedCallback.bind(r)(t,"password")},cancel:this._cancelledCallback.bind(this)}):this._executeAction(t))}},{key:"_executeAction",value:function(t){var e,n,i=null===(e=t[wn])||void 0===e?void 0:e.sound;i&&(Nn(i)?Vn(this._hass,i).then((function(t){new Audio(t.url).play()})).catch((function(){console.error("button-card: Error loading media source: ".concat(i))})):new Audio(i).play());var o=null===(n=t[wn])||void 0===n?void 0:n.haptic;this._hapticCapture=void 0!==o,po(this,this._hass,t,"tap"),this._hapticCapture=!1,o&&"none"!=o&&He(this,"haptic",o)}},{key:"_customActionsCallback",value:(n=z(R().m((function t(e){var n,i,o,r,a,u,s,c,l,d,h,f,v,p,m,g,_,y,b,D,A,w,C,E;return R().w((function(t){for(;;)switch(t.p=t.n){case 0:if(e.detail&&e.detail.buttonCardCustomAction){t.n=1;break}return t.a(2);case 1:d=e.detail.buttonCardCustomAction,C=d.type,t.n="javascript"===C?2:"multi-actions"===C?3:"toast"===C?19:20;break;case 2:return this._getTemplateOrValue(this._stateObj,null===(n=d.data)||void 0===n?void 0:n.javascript),t.a(3,20);case 3:if("string"==typeof(h=null===(i=d.data)||void 0===i?void 0:i.multiActions)&&(h=this._objectEvalTemplate(this._stateObj,h)),f=function(t){return new Promise((function(e){return setTimeout(e,t)}))},!Array.isArray(h)){t.n=18;break}this._spinnerActive=h.some((function(t){return"string"!=typeof t&&((null==t?void 0:t.delay)||(null==t?void 0:t.wait_completion))})),v=K(h),t.p=4,v.s();case 5:if((p=v.n()).done){t.n=14;break}if("string"==typeof(m=p.value)||!(null==m?void 0:m.delay)){t.n=7;break}if(g=this._getTemplateOrValue(this._stateObj,m.delay),!(g=So(g||"","ms","en"))){t.n=6;break}return t.n=6,f(g);case 6:t.n=13;break;case 7:if("string"==typeof m||!(null==m?void 0:m.wait_completion)){t.n=12;break}return _=m,t.n=8,f(500);case 8:y=this._getTemplateOrValue(this._stateObj,_.timeout),b=0,D=So(y||"","ms","en")||0;case 9:if(!(b