(()=>{var e={1:e=>{!function(){var t={de_DE:{identifier:"de-DE",days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],shortDays:["So","Mo","Di","Mi","Do","Fr","Sa"],months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],shortMonths:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d.%m.%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},en_CA:{identifier:"en-CA",days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ordinalSuffixes:["st","nd","rd","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","st","nd","rd","th","th","th","th","th","th","th","st"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}},en_US:{identifier:"en-US",days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ordinalSuffixes:["st","nd","rd","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","st","nd","rd","th","th","th","th","th","th","th","st"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%m/%d/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}},es_MX:{identifier:"es-MX",days:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],shortDays:["dom","lun","mar","mié","jue","vie","sáb"],months:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre"," diciembre"],shortMonths:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},fr_FR:{identifier:"fr-FR",days:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],shortDays:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],months:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],shortMonths:["janv.","févr.","mars","avril","mai","juin","juil.","août","sept.","oct.","nov.","déc."],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},it_IT:{identifier:"it-IT",days:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],shortDays:["dom","lun","mar","mer","gio","ven","sab"],months:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],shortMonths:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},nl_NL:{identifier:"nl-NL",days:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],shortDays:["zo","ma","di","wo","do","vr","za"],months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],shortMonths:["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},pt_BR:{identifier:"pt-BR",days:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],shortDays:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],months:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],shortMonths:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},ru_RU:{identifier:"ru-RU",days:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"],shortDays:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],shortMonths:["янв","фев","мар","апр","май","июн","июл","авг","сен","окт","ноя","дек"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X",D:"%d.%m.%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},tr_TR:{identifier:"tr-TR",days:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],shortDays:["Paz","Pzt","Sal","Çrş","Prş","Cum","Cts"],months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],shortMonths:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],AM:"ÖÖ",PM:"ÖS",am:"ÖÖ",pm:"ÖS",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},zh_CN:{identifier:"zh-CN",days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],shortDays:["日","一","二","三","四","五","六"],months:["一月份","二月份","三月份","四月份","五月份","六月份","七月份","八月份","九月份","十月份","十一月份","十二月份"],shortMonths:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],AM:"上午",PM:"下午",am:"上午",pm:"下午",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}}},n=t.en_US,i=new function e(i,p,d){var f,g=i||n,m=p||0,v=d||!1,y=0;function b(e,t,n,i){for(var l="",p=null,d=!1,f=e.length,g=!1,y=0;yy?(y=s,f=new Date(y),n=y,v&&(f=new Date(y+l(f)+m))):n=y,t=f}return b(e,t,g,n)};return x.localize=function(t){return new e(t||g,m,v)},x.localizeByIdentifier=function(e){var n=t[e];return n?x.localize(n):(u('[WARNING] No locale found with identifier "'+e+'".'),x)},x.timezone=function(t){var n=m,i=v,r=typeof t;"number"!==r&&"string"!==r||(i=!0,"string"===r?n=("-"===t[0]?-1:1)*(60*parseInt(t.slice(1,3),10)+parseInt(t.slice(3,5),10))*60*1e3:"number"===r&&(n=60*t*1e3));return new e(g,n,i)},x.utc=function(){return new e(g,m,!0)},x}(n,0,!1);function r(e,t){return""===t||e>9?e:(null==t&&(t="0"),t+e)}function s(e){return e>99?e:e>9?"0"+e:"00"+e}function a(e){return 0===e?12:e>12?e-12:e}function o(e,t){t=t||"sunday";var n=e.getDay();"monday"===t&&(0===n?n=6:n--);var i=Date.UTC(e.getFullYear(),0,1),r=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),s=(Math.floor((r-i)/864e5)+7-n)/7;return Math.floor(s)}function c(e){var t=e%10,n=e%100;if(n>=11&&n<=13||0===t||t>=4)return"th";switch(t){case 1:return"st";case 2:return"nd";case 3:return"rd"}}function l(e){return 6e4*(e.getTimezoneOffset()||0)}function h(e,t){return function(e,t){if(null==t)return null;var n=e.toLocaleString(t,{timeZoneName:"short"}).match(/\s([\w]+)$/);return n&&n[1]}(e,t)||function(e){var t=e.toString().match(/\(([\w\s]+)\)/);return t&&t[1]}(e)}function u(e){"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(e)}e.exports=i,"function"!=typeof Date.now&&(Date.now=function(){return+new Date})}()},449:function(e,t,n){e.exports=function(e){"use strict";var t=Object.freeze({__proto__:null,get FunctionDeclaration(){return Ke},get VariableDeclaration(){return Qe},get VariableDeclarator(){return Ze},get ClassDeclaration(){return et},get ClassBody(){return tt},get MethodDefinition(){return nt}}),i=Object.freeze({__proto__:null,get FunctionDeclaration(){return sn},get VariableDeclaration(){return an},get VariableDeclarator(){return on},get ClassDeclaration(){return cn},get ClassBody(){return ln},get MethodDefinition(){return hn}}),r=Object.freeze,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.prototype.hasOwnProperty;function c(e,t){return o.call(e,t)}var l=Object.getOwnPropertyNames,h=Object.setPrototypeOf;function u(e,t){h?h(e,t):e.__proto__=t}var p=Object.getPrototypeOf;function d(e){return p?p(e):e.__proto__}var f=Object.getOwnPropertyDescriptor;function g(e,t,n){for(;t;){var i=f(t,n),r=void 0!==i&&void 0===i.writable&&"function"==typeof i[e]&&i[e];if(r)return r;t=d(t)}}function m(e,t){return g("get",e,t)}function v(e,t){return g("set",e,t)}var y=Object.create;function b(e,t){u(e,t),e.prototype=y(t.prototype,{constructor:{value:e,writable:!0}})}function x(e){for(var t=1;t=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}var M="0.4.8",N={RES:void 0},O={RES:void 0},L=T("continue"),D=T("break"),R=T("super"),$=T("supercall"),V=T("noctor"),B=T("clsctor"),j=T("newtarget"),F=T("noinit"),U=T("deadzone"),H=function(){function e(e,t){this.kind=e,this.value=t}return e.prototype.get=function(){return this.value},e.prototype.set=function(e){if("const"===this.kind)throw new TypeError("Assignment to constant variable");return this.value=e},e}(),q=function(){function e(e,t){this.object=e,this.property=t}return e.prototype.get=function(){return this.object[this.property]},e.prototype.set=function(e){return this.object[this.property]=e,!0},e.prototype.del=function(){return delete this.object[this.property]},e}(),z=function(){function e(e,t){void 0===e&&(e=null),void 0===t&&(t=!1),this.context=y(null),this.parent=e,this.isolated=t}return e.prototype.global=function(){for(var e=this;e.parent;)e=e.parent;return e},e.prototype.clone=function(){var t=new e(this.parent,this.isolated);for(var n in this.context){var i=this.context[n];t[i.kind](n,i.get())}return t},e.prototype.find=function(e){if(this.context[e])return this.context[e];if(this.parent)return this.parent.find(e);var t=this.global().find("window").get();return e in t?new q(t,e):null},e.prototype.var=function(e,t){for(var n=this;n.parent&&!n.isolated;)n=n.parent;var i=n.context[e];if(i){if("var"!==i.kind)throw new SyntaxError("Identifier '"+e+"' has already been declared");t!==F&&i.set(t)}else n.context[e]=new H("var",t===F?void 0:t);if(!n.parent){var r=n.find("window").get();t!==F&&s(r,e,{value:t,writable:!0,enumerable:!0})}},e.prototype.let=function(e,t){var n=this.context[e];if(n&&n.get()!==U)throw new SyntaxError("Identifier '"+e+"' has already been declared");this.context[e]=new H("let",t)},e.prototype.const=function(e,t){var n=this.context[e];if(n&&n.get()!==U)throw new SyntaxError("Identifier '"+e+"' has already been declared");this.context[e]=new H("const",t)},e.prototype.func=function(e,t){var n=this.context[e];if(n&&"var"!==n.kind)throw new SyntaxError("Identifier '"+e+"' has already been declared");this.context[e]=new H("var",t)},e}(); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ function W(e,t){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(e){return function(t){return c([e,t])}}function c(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function G(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,s=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)a.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return a}function J(){for(var e=[],t=0;t":return n>i;case">=":return n>=i;case"<<":return n<>":return n>>i;case">>>":return n>>>i;case"+":return n+i;case"-":return n-i;case"*":return n*i;case"**":return Math.pow(n,i);case"/":return n/i;case"%":return n%i;case"|":return n|i;case"^":return n^i;case"&":return n&i;case"in":return n in i;case"instanceof":return n instanceof i;default:throw new SyntaxError("Unexpected token "+e.operator)}}function oe(e,t){var n,i=Xe(e.right,t),r=e.left;if("Identifier"===r.type){if(!(n=X(r,t,{getVar:!0,throwErr:!1}))){var s=t.global().find("window").get();n=new q(s,r.name)}}else{if("MemberExpression"!==r.type)return xn(r,t,{feed:i});n=le(r,t,{getVar:!0})}switch(e.operator){case"=":return n.set(i),n.get();case"+=":return n.set(n.get()+i),n.get();case"-=":return n.set(n.get()-i),n.get();case"*=":return n.set(n.get()*i),n.get();case"/=":return n.set(n.get()/i),n.get();case"%=":return n.set(n.get()%i),n.get();case"**=":return n.set(Math.pow(n.get(),i)),n.get();case"<<=":return n.set(n.get()<>=":return n.set(n.get()>>i),n.get();case">>>=":return n.set(n.get()>>>i),n.get();case"|=":return n.set(n.get()|i),n.get();case"^=":return n.set(n.get()^i),n.get();case"&=":return n.set(n.get()&i),n.get();default:throw new SyntaxError("Unexpected token "+e.operator)}}function ce(e,t){switch(e.operator){case"||":return Xe(e.left,t)||Xe(e.right,t);case"&&":return Xe(e.left,t)&&Xe(e.right,t);default:throw new SyntaxError("Unexpected token "+e.operator)}}function le(e,t,n){void 0===n&&(n={});var i,r,a=n.getObj,o=void 0!==a&&a,c=n.getVar,l=void 0!==c&&c;if(i="Super"===e.object.type?xe(e.object,t,{getProto:!0}):Xe(e.object,t),o)return i;if(r=e.computed?Xe(e.property,t):e.property.name,l){var h=v(i,r);if("Super"===e.object.type&&h){var u=t.find("this").get(),p=T(r);return s(u,p,{set:h}),new q(u,p)}return new q(i,r)}var d=m(i,r);return"Super"===e.object.type&&d?(u=t.find("this").get(),d.call(u)):i[r]}function he(e,t){return Xe(e.test,t)?Xe(e.consequent,t):Xe(e.alternate,t)}function ue(e,t){var n,i;if("MemberExpression"===e.callee.type){i=le(e.callee,t,{getObj:!0});var r=void 0;if(r=e.callee.computed?Xe(e.callee.property,t):e.callee.property.name,"Super"===e.callee.object.type){var s=t.find("this").get();n=i[r].bind(s)}else n=i[r];if("function"!=typeof n)throw new TypeError(r+" is not a function");if(n[B])throw new TypeError("Class constructor "+r+" cannot be invoked without 'new'")}else if(i=t.find("this").get(),"function"!=typeof(n=Xe(e.callee,t))||"Super"!==e.callee.type&&n[B]){var a;if("Identifier"===e.callee.type)a=e.callee.name;else try{a=JSON.stringify(n)}catch(e){a=""+n}throw"function"!=typeof n?new TypeError(a+" is not a function"):new TypeError("Class constructor "+a+" cannot be invoked without 'new'")}for(var o=[],c=0;c":return[2,n>i];case">=":return[2,n>=i];case"<<":return[2,n<>":return[2,n>>i];case">>>":return[2,n>>>i];case"+":return[2,n+i];case"-":return[2,n-i];case"*":return[2,n*i];case"**":return[2,Math.pow(n,i)];case"/":return[2,n/i];case"%":return[2,n%i];case"|":return[2,n|i];case"^":return[2,n^i];case"&":return[2,n&i];case"in":return[2,n in i];case"instanceof":return[2,n instanceof i];default:throw new SyntaxError("Unexpected token "+e.operator)}}}))}function ft(e,t){var n,i,r,s;return W(this,(function(a){switch(a.label){case 0:return[5,Y(rn(e.right,t))];case 1:return n=a.sent(),"Identifier"!==(i=e.left).type?[3,3]:[5,Y(it(i,t,{getVar:!0,throwErr:!1}))];case 2:return(r=a.sent())||(s=t.global().find("window").get(),r=new q(s,i.name)),[3,7];case 3:return"MemberExpression"!==i.type?[3,5]:[5,Y(mt(i,t,{getVar:!0}))];case 4:return r=a.sent(),[3,7];case 5:return[5,Y(fn(i,t,{feed:n}))];case 6:return[2,a.sent()];case 7:switch(e.operator){case"=":return r.set(n),[2,r.get()];case"+=":return r.set(r.get()+n),[2,r.get()];case"-=":return r.set(r.get()-n),[2,r.get()];case"*=":return r.set(r.get()*n),[2,r.get()];case"/=":return r.set(r.get()/n),[2,r.get()];case"%=":return r.set(r.get()%n),[2,r.get()];case"**=":return r.set(Math.pow(r.get(),n)),[2,r.get()];case"<<=":return r.set(r.get()<>=":return r.set(r.get()>>n),[2,r.get()];case">>>=":return r.set(r.get()>>>n),[2,r.get()];case"|=":return r.set(r.get()|n),[2,r.get()];case"^=":return r.set(r.get()^n),[2,r.get()];case"&=":return r.set(r.get()&n),[2,r.get()];default:throw new SyntaxError("Unexpected token "+e.operator)}}}))}function gt(e,t){var n,i;return W(this,(function(r){switch(r.label){case 0:switch(e.operator){case"||":return[3,1];case"&&":return[3,5]}return[3,9];case 1:return[5,Y(rn(e.left,t))];case 2:return(n=r.sent())?[3,4]:[5,Y(rn(e.right,t))];case 3:n=r.sent(),r.label=4;case 4:return[2,n];case 5:return[5,Y(rn(e.left,t))];case 6:return(i=r.sent())?[5,Y(rn(e.right,t))]:[3,8];case 7:i=r.sent(),r.label=8;case 8:return[2,i];case 9:throw new SyntaxError("Unexpected token "+e.operator)}}))}function mt(e,t,n){var i,r,a,o,c,l,h,u,p,d;return void 0===n&&(n={}),W(this,(function(f){switch(f.label){case 0:return i=n.getObj,r=void 0!==i&&i,a=n.getVar,o=void 0!==a&&a,"Super"!==e.object.type?[3,2]:[5,Y(Ct(e.object,t,{getProto:!0}))];case 1:return c=f.sent(),[3,4];case 2:return[5,Y(rn(e.object,t))];case 3:c=f.sent(),f.label=4;case 4:return r?[2,c]:e.computed?[5,Y(rn(e.property,t))]:[3,6];case 5:return l=f.sent(),[3,7];case 6:l=e.property.name,f.label=7;case 7:return o?(h=v(c,l),"Super"===e.object.type&&h?(d=t.find("this").get(),u=T(l),s(d,u,{set:h}),[2,new q(d,u)]):[2,new q(c,l)]):(p=m(c,l),"Super"===e.object.type&&p?(d=t.find("this").get(),[2,p.call(d)]):[2,c[l]])}}))}function vt(e,t){var n;return W(this,(function(i){switch(i.label){case 0:return[5,Y(rn(e.test,t))];case 1:return i.sent()?[5,Y(rn(e.consequent,t))]:[3,3];case 2:return n=i.sent(),[3,5];case 3:return[5,Y(rn(e.alternate,t))];case 4:n=i.sent(),i.label=5;case 5:return[2,n]}}))}function yt(e,t){var n,i,r,s,a,o,c,l,h,u,p,d;return W(this,(function(f){switch(f.label){case 0:return"MemberExpression"!==e.callee.type?[3,5]:[5,Y(mt(e.callee,t,{getObj:!0}))];case 1:return i=f.sent(),r=void 0,e.callee.computed?[5,Y(rn(e.callee.property,t))]:[3,3];case 2:return r=f.sent(),[3,4];case 3:r=e.callee.property.name,f.label=4;case 4:if("Super"===e.callee.object.type?(s=t.find("this").get(),n=i[r].bind(s)):n=i[r],"function"!=typeof n)throw new TypeError(r+" is not a function");if(n[B])throw new TypeError("Class constructor "+r+" cannot be invoked without 'new'");return[3,7];case 5:return i=t.find("this").get(),[5,Y(rn(e.callee,t))];case 6:if("function"!=typeof(n=f.sent())||"Super"!==e.callee.type&&n[B]){if("Identifier"===e.callee.type)a=e.callee.name;else try{a=JSON.stringify(n)}catch(e){a=""+n}throw"function"!=typeof n?new TypeError(a+" is not a function"):new TypeError("Class constructor "+a+" cannot be invoked without 'new'")}f.label=7;case 7:o=[],c=0,f.label=8;case 8:return c-1;c--)e.body.splice(a[c],1);e.body=s.concat(e.body)}return[2]}}))}function dn(e,t){var n,i,r,s,a;return W(this,(function(o){switch(o.label){case 0:switch(e.type){case"VariableDeclaration":return[3,1];case"ForInStatement":case"ForOfStatement":return[3,3];case"ForStatement":return[3,5];case"WhileStatement":case"DoWhileStatement":return[3,7];case"IfStatement":return[3,9];case"BlockStatement":return[3,13];case"SwitchStatement":return[3,18];case"TryStatement":return[3,25]}return[3,38];case 1:return[5,Y(an(e,t,{hoist:!0}))];case 2:return o.sent(),[3,38];case 3:return"VariableDeclaration"!==e.left.type?[3,5]:[5,Y(an(e.left,t,{hoist:!0}))];case 4:o.sent(),o.label=5;case 5:return"ForStatement"!==e.type||"VariableDeclaration"!==e.init.type?[3,7]:[5,Y(an(e.init,t,{hoist:!0}))];case 6:o.sent(),o.label=7;case 7:return[5,Y(dn(e.body,t))];case 8:return o.sent(),[3,38];case 9:return[5,Y(dn(e.consequent,t))];case 10:return o.sent(),e.alternate?[5,Y(dn(e.alternate,t))]:[3,12];case 11:o.sent(),o.label=12;case 12:return[3,38];case 13:a=0,o.label=14;case 14:return a-1;o--)e.body.splice(a[o],1);e.body=s.concat(e.body)}}function bn(e,t){switch(e.type){case"VariableDeclaration":Qe(e,t,{hoist:!0});break;case"ForInStatement":case"ForOfStatement":"VariableDeclaration"===e.left.type&&Qe(e.left,t,{hoist:!0});case"ForStatement":"ForStatement"===e.type&&"VariableDeclaration"===e.init.type&&Qe(e.init,t,{hoist:!0});case"WhileStatement":case"DoWhileStatement":bn(e.body,t);break;case"IfStatement":bn(e.consequent,t),e.alternate&&bn(e.alternate,t);break;case"BlockStatement":for(var n=0;n{"use strict";n.r(t),n.d(t,{Node:()=>ie,Parser:()=>j,Position:()=>L,SourceLocation:()=>D,TokContext:()=>ae,Token:()=>Te,TokenType:()=>m,defaultOptions:()=>$,getLineInfo:()=>R,isIdentifierChar:()=>g,isIdentifierStart:()=>f,isNewLine:()=>E,keywordTypes:()=>x,lineBreak:()=>_,lineBreakG:()=>k,nonASCIIwhitespace:()=>A,parse:()=>Le,parseExpressionAt:()=>De,tokContexts:()=>oe,tokTypes:()=>S,tokenizer:()=>Re,version:()=>Oe});var i={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},r="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",s={5:r,"5module":r+" export import",6:r+" const class extends export import super"},a=/^in(stanceof)?$/,o="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿯ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-Ᶎꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭧꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",c="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",l=new RegExp("["+o+"]"),h=new RegExp("["+o+c+"]");o=c=null;var u=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,477,28,11,0,9,21,155,22,13,52,76,44,33,24,27,35,30,0,12,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,0,33,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,0,161,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,270,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,754,9486,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,15,7472,3104,541],p=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,525,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,4,9,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,232,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,792487,239];function d(e,t){for(var n=65536,i=0;ie)return!1;if((n+=t[i+1])>=e)return!0}}function f(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&l.test(String.fromCharCode(e)):!1!==t&&d(e,u)))}function g(e,t){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&h.test(String.fromCharCode(e)):!1!==t&&(d(e,u)||d(e,p)))))}var m=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function v(e,t){return new m(e,{beforeExpr:!0,binop:t})}var y={beforeExpr:!0},b={startsExpr:!0},x={};function w(e,t){return void 0===t&&(t={}),t.keyword=e,x[e]=new m(e,t)}var S={num:new m("num",b),regexp:new m("regexp",b),string:new m("string",b),name:new m("name",b),eof:new m("eof"),bracketL:new m("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new m("]"),braceL:new m("{",{beforeExpr:!0,startsExpr:!0}),braceR:new m("}"),parenL:new m("(",{beforeExpr:!0,startsExpr:!0}),parenR:new m(")"),comma:new m(",",y),semi:new m(";",y),colon:new m(":",y),dot:new m("."),question:new m("?",y),arrow:new m("=>",y),template:new m("template"),invalidTemplate:new m("invalidTemplate"),ellipsis:new m("...",y),backQuote:new m("`",b),dollarBraceL:new m("${",{beforeExpr:!0,startsExpr:!0}),eq:new m("=",{beforeExpr:!0,isAssign:!0}),assign:new m("_=",{beforeExpr:!0,isAssign:!0}),incDec:new m("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new m("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:v("||",1),logicalAND:v("&&",2),bitwiseOR:v("|",3),bitwiseXOR:v("^",4),bitwiseAND:v("&",5),equality:v("==/!=/===/!==",6),relational:v("/<=/>=",7),bitShift:v("<>/>>>",8),plusMin:new m("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:v("%",10),star:v("*",10),slash:v("/",10),starstar:new m("**",{beforeExpr:!0}),_break:w("break"),_case:w("case",y),_catch:w("catch"),_continue:w("continue"),_debugger:w("debugger"),_default:w("default",y),_do:w("do",{isLoop:!0,beforeExpr:!0}),_else:w("else",y),_finally:w("finally"),_for:w("for",{isLoop:!0}),_function:w("function",b),_if:w("if"),_return:w("return",y),_switch:w("switch"),_throw:w("throw",y),_try:w("try"),_var:w("var"),_const:w("const"),_while:w("while",{isLoop:!0}),_with:w("with"),_new:w("new",{beforeExpr:!0,startsExpr:!0}),_this:w("this",b),_super:w("super",b),_class:w("class",b),_extends:w("extends",y),_export:w("export"),_import:w("import",b),_null:w("null",b),_true:w("true",b),_false:w("false",b),_in:w("in",{beforeExpr:!0,binop:7}),_instanceof:w("instanceof",{beforeExpr:!0,binop:7}),_typeof:w("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:w("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:w("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},_=/\r\n?|\n|\u2028|\u2029/,k=new RegExp(_.source,"g");function E(e,t){return 10===e||13===e||!t&&(8232===e||8233===e)}var A=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,C=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,I=Object.prototype,T=I.hasOwnProperty,P=I.toString;function M(e,t){return T.call(e,t)}var N=Array.isArray||function(e){return"[object Array]"===P.call(e)};function O(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}var L=function(e,t){this.line=e,this.column=t};L.prototype.offset=function(e){return new L(this.line,this.column+e)};var D=function(e,t,n){this.start=t,this.end=n,null!==e.sourceFile&&(this.source=e.sourceFile)};function R(e,t){for(var n=1,i=0;;){k.lastIndex=i;var r=k.exec(e);if(!(r&&r.index=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),N(t.onToken)){var i=t.onToken;t.onToken=function(e){return i.push(e)}}return N(t.onComment)&&(t.onComment=function(e,t){return function(n,i,r,s,a,o){var c={type:n?"Block":"Line",value:i,start:r,end:s};e.locations&&(c.loc=new D(this,a,o)),e.ranges&&(c.range=[r,s]),t.push(c)}}(t,t.onComment)),t}function B(e,t){return 2|(e?4:0)|(t?8:0)}var j=function(e,t,n){this.options=e=V(e),this.sourceFile=e.sourceFile,this.keywords=O(s[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var r="";if(!0!==e.allowReserved){for(var a=e.ecmaVersion;!(r=i[a]);a--);"module"===e.sourceType&&(r+=" await")}this.reservedWords=O(r);var o=(r?r+" ":"")+i.strict;this.reservedWordsStrict=O(o),this.reservedWordsStrictBind=O(o+" "+i.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf("\n",n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(_).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=S.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null},F={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};j.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},F.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},F.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},F.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},F.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0},F.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},F.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},j.prototype.inNonArrowFunction=function(){return(2&this.currentThisScope().flags)>0},j.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,i=0;i-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,"Parenthesized pattern")}},U.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,i=e.doubleProto;if(!t)return n>=0||i>=0;n>=0&&this.raise(n,"Shorthand property assignments are valid only in destructuring patterns"),i>=0&&this.raiseRecoverable(i,"Redefinition of __proto__ property")},U.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case S._class:return e&&this.unexpected(),this.parseClass(s,!0);case S._if:return this.parseIfStatement(s);case S._return:return this.parseReturnStatement(s);case S._switch:return this.parseSwitchStatement(s);case S._throw:return this.parseThrowStatement(s);case S._try:return this.parseTryStatement(s);case S._const:case S._var:return i=i||this.value,e&&"var"!==i&&this.unexpected(),this.parseVarStatement(s,i);case S._while:return this.parseWhileStatement(s);case S._with:return this.parseWithStatement(s);case S.braceL:return this.parseBlock(!0,s);case S.semi:return this.parseEmptyStatement(s);case S._export:case S._import:if(this.options.ecmaVersion>10&&r===S._import){C.lastIndex=this.pos;var a=C.exec(this.input),o=this.pos+a[0].length;if(40===this.input.charCodeAt(o))return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===S._import?this.parseImport(s):this.parseExport(s,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!e);var c=this.value,l=this.parseExpression();return r===S.name&&"Identifier"===l.type&&this.eat(S.colon)?this.parseLabeledStatement(s,c,l,e):this.parseExpressionStatement(s,l)}},z.parseBreakContinueStatement=function(e,t){var n="break"===t;this.next(),this.eat(S.semi)||this.insertSemicolon()?e.label=null:this.type!==S.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var i=0;i=6?this.eat(S.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},z.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(W),this.enterScope(0),this.expect(S.parenL),this.type===S.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===S._var||this.type===S._const||n){var i=this.startNode(),r=n?"let":this.value;return this.next(),this.parseVar(i,!0,r),this.finishNode(i,"VariableDeclaration"),(this.type===S._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===i.declarations.length?(this.options.ecmaVersion>=9&&(this.type===S._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,i)):(t>-1&&this.unexpected(t),this.parseFor(e,i))}var s=new q,a=this.parseExpression(!0,s);return this.type===S._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===S._in?t>-1&&this.unexpected(t):e.await=t>-1),this.toAssignable(a,!1,s),this.checkLVal(a),this.parseForIn(e,a)):(this.checkExpressionErrors(s,!0),t>-1&&this.unexpected(t),this.parseFor(e,a))},z.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,J|(n?0:X),!1,t)},z.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(S._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},z.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(S.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},z.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(S.braceL),this.labels.push(Y),this.enterScope(0);for(var n=!1;this.type!==S.braceR;)if(this.type===S._case||this.type===S._default){var i=this.type===S._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),i?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),n=!0,t.test=null),this.expect(S.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},z.parseThrowStatement=function(e){return this.next(),_.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var G=[];z.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===S._catch){var t=this.startNode();if(this.next(),this.eat(S.parenL)){t.param=this.parseBindingAtom();var n="Identifier"===t.param.type;this.enterScope(n?32:0),this.checkLVal(t.param,n?4:2),this.expect(S.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(S._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},z.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},z.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(W),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},z.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},z.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},z.parseLabeledStatement=function(e,t,n,i){for(var r=0,s=this.labels;r=0;o--){var c=this.labels[o];if(c.statementStart!==e.start)break;c.statementStart=this.start,c.kind=a}return this.labels.push({name:t,kind:a,statementStart:this.start}),e.body=this.parseStatement(i?-1===i.indexOf("label")?i+"label":i:"label"),this.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")},z.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},z.parseBlock=function(e,t){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(S.braceL),e&&this.enterScope(0);!this.eat(S.braceR);){var n=this.parseStatement(null);t.body.push(n)}return e&&this.exitScope(),this.finishNode(t,"BlockStatement")},z.parseFor=function(e,t){return e.init=t,this.expect(S.semi),e.test=this.type===S.semi?null:this.parseExpression(),this.expect(S.semi),e.update=this.type===S.parenR?null:this.parseExpression(),this.expect(S.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},z.parseForIn=function(e,t){var n=this.type===S._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!n||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)?this.raise(t.start,(n?"for-in":"for-of")+" loop variable declaration may not have an initializer"):"AssignmentPattern"===t.type&&this.raise(t.start,"Invalid left-hand side in for-loop"),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(S.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,n?"ForInStatement":"ForOfStatement")},z.parseVar=function(e,t,n){for(e.declarations=[],e.kind=n;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(S.eq)?i.init=this.parseMaybeAssign(t):"const"!==n||this.type===S._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===i.id.type||t&&(this.type===S._in||this.isContextual("of"))?i.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(i,"VariableDeclarator")),!this.eat(S.comma))break}return e},z.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLVal(e.id,"var"===t?1:2,!1)};var J=1,X=2;z.parseFunction=function(e,t,n,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!i)&&(this.type===S.star&&t&X&&this.unexpected(),e.generator=this.eat(S.star)),this.options.ecmaVersion>=8&&(e.async=!!i),t&J&&(e.id=4&t&&this.type!==S.name?null:this.parseIdent(),!e.id||t&X||this.checkLVal(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var r=this.yieldPos,s=this.awaitPos,a=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(B(e.async,e.generator)),t&J||(e.id=this.type===S.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1),this.yieldPos=r,this.awaitPos=s,this.awaitIdentPos=a,this.finishNode(e,t&J?"FunctionDeclaration":"FunctionExpression")},z.parseFunctionParams=function(e){this.expect(S.parenL),e.params=this.parseBindingList(S.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},z.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var i=this.startNode(),r=!1;for(i.body=[],this.expect(S.braceL);!this.eat(S.braceR);){var s=this.parseClassElement(null!==e.superClass);s&&(i.body.push(s),"MethodDefinition"===s.type&&"constructor"===s.kind&&(r&&this.raise(s.start,"Duplicate constructor in the same class"),r=!0))}return e.body=this.finishNode(i,"ClassBody"),this.strict=n,this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},z.parseClassElement=function(e){var t=this;if(this.eat(S.semi))return null;var n=this.startNode(),i=function(e,i){void 0===i&&(i=!1);var r=t.start,s=t.startLoc;return!!t.eatContextual(e)&&(!(t.type===S.parenL||i&&t.canInsertSemicolon())||(n.key&&t.unexpected(),n.computed=!1,n.key=t.startNodeAt(r,s),n.key.name=e,t.finishNode(n.key,"Identifier"),!1))};n.kind="method",n.static=i("static");var r=this.eat(S.star),s=!1;r||(this.options.ecmaVersion>=8&&i("async",!0)?(s=!0,r=this.options.ecmaVersion>=9&&this.eat(S.star)):i("get")?n.kind="get":i("set")&&(n.kind="set")),n.key||this.parsePropertyName(n);var a=n.key,o=!1;return n.computed||n.static||!("Identifier"===a.type&&"constructor"===a.name||"Literal"===a.type&&"constructor"===a.value)?n.static&&"Identifier"===a.type&&"prototype"===a.name&&this.raise(a.start,"Classes may not have a static property named prototype"):("method"!==n.kind&&this.raise(a.start,"Constructor can't have get/set modifier"),r&&this.raise(a.start,"Constructor can't be a generator"),s&&this.raise(a.start,"Constructor can't be an async method"),n.kind="constructor",o=e),this.parseClassMethod(n,r,s,o),"get"===n.kind&&0!==n.value.params.length&&this.raiseRecoverable(n.value.start,"getter should have no params"),"set"===n.kind&&1!==n.value.params.length&&this.raiseRecoverable(n.value.start,"setter should have exactly one param"),"set"===n.kind&&"RestElement"===n.value.params[0].type&&this.raiseRecoverable(n.value.params[0].start,"Setter cannot use rest params"),n},z.parseClassMethod=function(e,t,n,i){return e.value=this.parseMethod(t,n,i),this.finishNode(e,"MethodDefinition")},z.parseClassId=function(e,t){this.type===S.name?(e.id=this.parseIdent(),t&&this.checkLVal(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},z.parseClassSuper=function(e){e.superClass=this.eat(S._extends)?this.parseExprSubscripts():null},z.parseExport=function(e,t){if(this.next(),this.eat(S.star))return this.expectContextual("from"),this.type!==S.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(S._default)){var n;if(this.checkExport(t,"default",this.lastTokStart),this.type===S._function||(n=this.isAsyncFunction())){var i=this.startNode();this.next(),n&&this.next(),e.declaration=this.parseFunction(i,4|J,!1,n)}else if(this.type===S._class){var r=this.startNode();e.declaration=this.parseClass(r,"nullableID")}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id.name,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==S.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var s=0,a=e.specifiers;s=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",n&&this.checkPatternErrors(n,!0);for(var i=0,r=e.properties;i=8&&!s&&"async"===a.name&&!this.canInsertSemicolon()&&this.eat(S._function))return this.parseFunction(this.startNodeAt(i,r),0,!1,!0);if(n&&!this.canInsertSemicolon()){if(this.eat(S.arrow))return this.parseArrowExpression(this.startNodeAt(i,r),[a],!1);if(this.options.ecmaVersion>=8&&"async"===a.name&&this.type===S.name&&!s)return a=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(S.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(i,r),[a],!0)}return a;case S.regexp:var o=this.value;return(t=this.parseLiteral(o.value)).regex={pattern:o.pattern,flags:o.flags},t;case S.num:case S.string:return this.parseLiteral(this.value);case S._null:case S._true:case S._false:return(t=this.startNode()).value=this.type===S._null?null:this.type===S._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,"Literal");case S.parenL:var c=this.start,l=this.parseParenAndDistinguishExpression(n);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(l)&&(e.parenthesizedAssign=c),e.parenthesizedBind<0&&(e.parenthesizedBind=c)),l;case S.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(S.bracketR,!0,!0,e),this.finishNode(t,"ArrayExpression");case S.braceL:return this.parseObj(!1,e);case S._function:return t=this.startNode(),this.next(),this.parseFunction(t,0);case S._class:return this.parseClass(this.startNode(),!1);case S._new:return this.parseNew();case S.backQuote:return this.parseTemplate();case S._import:return this.options.ecmaVersion>10?this.parseDynamicImport():this.unexpected();default:this.unexpected()}},Q.parseDynamicImport=function(){var e=this.startNode();return this.next(),this.type!==S.parenL&&this.unexpected(),this.finishNode(e,"Import")},Q.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=t.raw.slice(0,-1)),this.next(),this.finishNode(t,"Literal")},Q.parseParenExpression=function(){this.expect(S.parenL);var e=this.parseExpression();return this.expect(S.parenR),e},Q.parseParenAndDistinguishExpression=function(e){var t,n=this.start,i=this.startLoc,r=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var s,a=this.start,o=this.startLoc,c=[],l=!0,h=!1,u=new q,p=this.yieldPos,d=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==S.parenR;){if(l?l=!1:this.expect(S.comma),r&&this.afterTrailingComma(S.parenR,!0)){h=!0;break}if(this.type===S.ellipsis){s=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===S.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}c.push(this.parseMaybeAssign(!1,u,this.parseParenItem))}var f=this.start,g=this.startLoc;if(this.expect(S.parenR),e&&!this.canInsertSemicolon()&&this.eat(S.arrow))return this.checkPatternErrors(u,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=p,this.awaitPos=d,this.parseParenArrowList(n,i,c);c.length&&!h||this.unexpected(this.lastTokStart),s&&this.unexpected(s),this.checkExpressionErrors(u,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=d||this.awaitPos,c.length>1?((t=this.startNodeAt(a,o)).expressions=c,this.finishNodeAt(t,"SequenceExpression",f,g)):t=c[0]}else t=this.parseParenExpression();if(this.options.preserveParens){var m=this.startNodeAt(n,i);return m.expression=t,this.finishNode(m,"ParenthesizedExpression")}return t},Q.parseParenItem=function(e){return e},Q.parseParenArrowList=function(e,t,n){return this.parseArrowExpression(this.startNodeAt(e,t),n)};var Z=[];Q.parseNew=function(){var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(S.dot)){e.meta=t;var n=this.containsEsc;return e.property=this.parseIdent(!0),("target"!==e.property.name||n)&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is new.target"),this.inNonArrowFunction()||this.raiseRecoverable(e.start,"new.target can only be used in functions"),this.finishNode(e,"MetaProperty")}var i=this.start,r=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(),i,r,!0),this.options.ecmaVersion>10&&"Import"===e.callee.type&&this.raise(e.callee.start,"Cannot use new with import(...)"),this.eat(S.parenL)?e.arguments=this.parseExprList(S.parenR,this.options.ecmaVersion>=8&&"Import"!==e.callee.type,!1):e.arguments=Z,this.finishNode(e,"NewExpression")},Q.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===S.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),n.value={raw:this.value,cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),n.tail=this.type===S.backQuote,this.finishNode(n,"TemplateElement")},Q.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var i=this.parseTemplateElement({isTagged:t});for(n.quasis=[i];!i.tail;)this.type===S.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(S.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(S.braceR),n.quasis.push(i=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,"TemplateLiteral")},Q.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===S.name||this.type===S.num||this.type===S.string||this.type===S.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===S.star)&&!_.test(this.input.slice(this.lastTokEnd,this.start))},Q.parseObj=function(e,t){var n=this.startNode(),i=!0,r={};for(n.properties=[],this.next();!this.eat(S.braceR);){if(i)i=!1;else if(this.expect(S.comma),this.afterTrailingComma(S.braceR))break;var s=this.parseProperty(e,t);e||this.checkPropClash(s,r,t),n.properties.push(s)}return this.finishNode(n,e?"ObjectPattern":"ObjectExpression")},Q.parseProperty=function(e,t){var n,i,r,s,a=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(S.ellipsis))return e?(a.argument=this.parseIdent(!1),this.type===S.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(a,"RestElement")):(this.type===S.parenL&&t&&(t.parenthesizedAssign<0&&(t.parenthesizedAssign=this.start),t.parenthesizedBind<0&&(t.parenthesizedBind=this.start)),a.argument=this.parseMaybeAssign(!1,t),this.type===S.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(a,"SpreadElement"));this.options.ecmaVersion>=6&&(a.method=!1,a.shorthand=!1,(e||t)&&(r=this.start,s=this.startLoc),e||(n=this.eat(S.star)));var o=this.containsEsc;return this.parsePropertyName(a),!e&&!o&&this.options.ecmaVersion>=8&&!n&&this.isAsyncProp(a)?(i=!0,n=this.options.ecmaVersion>=9&&this.eat(S.star),this.parsePropertyName(a,t)):i=!1,this.parsePropertyValue(a,e,n,i,r,s,t,o),this.finishNode(a,"Property")},Q.parsePropertyValue=function(e,t,n,i,r,s,a,o){if((n||i)&&this.type===S.colon&&this.unexpected(),this.eat(S.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===S.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(n,i);else if(t||o||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===S.comma||this.type===S.braceR)this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((n||i)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=r),e.kind="init",t?e.value=this.parseMaybeDefault(r,s,e.key):this.type===S.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),e.value=this.parseMaybeDefault(r,s,e.key)):e.value=e.key,e.shorthand=!0):this.unexpected();else{(n||i)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var c="get"===e.kind?0:1;if(e.value.params.length!==c){var l=e.value.start;"get"===e.kind?this.raiseRecoverable(l,"getter should have no params"):this.raiseRecoverable(l,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}},Q.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(S.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(S.bracketR),e.key;e.computed=!1}return e.key=this.type===S.num||this.type===S.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},Q.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},Q.parseMethod=function(e,t,n){var i=this.startNode(),r=this.yieldPos,s=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(i),this.options.ecmaVersion>=6&&(i.generator=e),this.options.ecmaVersion>=8&&(i.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|B(t,i.generator)|(n?128:0)),this.expect(S.parenL),i.params=this.parseBindingList(S.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(i,!1,!0),this.yieldPos=r,this.awaitPos=s,this.awaitIdentPos=a,this.finishNode(i,"FunctionExpression")},Q.parseArrowExpression=function(e,t,n){var i=this.yieldPos,r=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(16|B(n,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1),this.yieldPos=i,this.awaitPos=r,this.awaitIdentPos=s,this.finishNode(e,"ArrowFunctionExpression")},Q.parseFunctionBody=function(e,t,n){var i=t&&this.type!==S.braceL,r=this.strict,s=!1;if(i)e.body=this.parseMaybeAssign(),e.expression=!0,this.checkParams(e,!1);else{var a=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);r&&!a||(s=this.strictDirective(this.end))&&a&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var o=this.labels;this.labels=[],s&&(this.strict=!0),this.checkParams(e,!r&&!s&&!t&&!n&&this.isSimpleParamList(e.params)),e.body=this.parseBlock(!1),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=o}this.exitScope(),this.strict&&e.id&&this.checkLVal(e.id,5),this.strict=r},Q.isSimpleParamList=function(e){for(var t=0,n=e;t-1||r.functions.indexOf(e)>-1||r.var.indexOf(e)>-1,r.lexical.push(e),this.inModule&&1&r.flags&&delete this.undefinedExports[e]}else if(4===t){this.currentScope().lexical.push(e)}else if(3===t){var s=this.currentScope();i=this.treatFunctionsAsVar?s.lexical.indexOf(e)>-1:s.lexical.indexOf(e)>-1||s.var.indexOf(e)>-1,s.functions.push(e)}else for(var a=this.scopeStack.length-1;a>=0;--a){var o=this.scopeStack[a];if(o.lexical.indexOf(e)>-1&&!(32&o.flags&&o.lexical[0]===e)||!this.treatFunctionsAsVarInScope(o)&&o.functions.indexOf(e)>-1){i=!0;break}if(o.var.push(e),this.inModule&&1&o.flags&&delete this.undefinedExports[e],3&o.flags)break}i&&this.raiseRecoverable(n,"Identifier '"+e+"' has already been declared")},te.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},te.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},te.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(3&t.flags)return t}},te.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(3&t.flags&&!(16&t.flags))return t}};var ie=function(e,t,n){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new D(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},re=j.prototype;function se(e,t,n,i){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=i),this.options.ranges&&(e.range[1]=n),e}re.startNode=function(){return new ie(this,this.start,this.startLoc)},re.startNodeAt=function(e,t){return new ie(this,e,t)},re.finishNode=function(e,t){return se.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},re.finishNodeAt=function(e,t,n,i){return se.call(this,e,t,n,i)};var ae=function(e,t,n,i,r){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=i,this.generator=!!r},oe={b_stat:new ae("{",!1),b_expr:new ae("{",!0),b_tmpl:new ae("${",!1),p_stat:new ae("(",!1),p_expr:new ae("(",!0),q_tmpl:new ae("`",!0,!0,(function(e){return e.tryReadTemplateToken()})),f_stat:new ae("function",!1),f_expr:new ae("function",!0),f_expr_gen:new ae("function",!0,!1,null,!0),f_gen:new ae("function",!1,!1,null,!0)},ce=j.prototype;ce.initialContext=function(){return[oe.b_stat]},ce.braceIsBlock=function(e){var t=this.curContext();return t===oe.f_expr||t===oe.f_stat||(e!==S.colon||t!==oe.b_stat&&t!==oe.b_expr?e===S._return||e===S.name&&this.exprAllowed?_.test(this.input.slice(this.lastTokEnd,this.start)):e===S._else||e===S.semi||e===S.eof||e===S.parenR||e===S.arrow||(e===S.braceL?t===oe.b_stat:e!==S._var&&e!==S._const&&e!==S.name&&!this.exprAllowed):!t.isExpr)},ce.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return!1},ce.updateContext=function(e){var t,n=this.type;n.keyword&&e===S.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},S.parenR.updateContext=S.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===oe.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},S.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?oe.b_stat:oe.b_expr),this.exprAllowed=!0},S.dollarBraceL.updateContext=function(){this.context.push(oe.b_tmpl),this.exprAllowed=!0},S.parenL.updateContext=function(e){var t=e===S._if||e===S._for||e===S._with||e===S._while;this.context.push(t?oe.p_stat:oe.p_expr),this.exprAllowed=!0},S.incDec.updateContext=function(){},S._function.updateContext=S._class.updateContext=function(e){!e.beforeExpr||e===S.semi||e===S._else||e===S._return&&_.test(this.input.slice(this.lastTokEnd,this.start))||(e===S.colon||e===S.braceL)&&this.curContext()===oe.b_stat?this.context.push(oe.f_stat):this.context.push(oe.f_expr),this.exprAllowed=!1},S.backQuote.updateContext=function(){this.curContext()===oe.q_tmpl?this.context.pop():this.context.push(oe.q_tmpl),this.exprAllowed=!1},S.star.updateContext=function(e){if(e===S._function){var t=this.context.length-1;this.context[t]===oe.f_expr?this.context[t]=oe.f_expr_gen:this.context[t]=oe.f_gen}this.exprAllowed=!0},S.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==S.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var le="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",he=le+" Extended_Pictographic",ue={9:le,10:he,11:he},pe="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",de="Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",fe=de+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",ge={9:de,10:fe,11:fe+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"},me={};function ve(e){var t=me[e]={binary:O(ue[e]+" "+pe),nonBinary:{General_Category:O(pe),Script:O(ge[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}ve(9),ve(10),ve(11);var ye=j.prototype,be=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":""),this.unicodeProperties=me[e.options.ecmaVersion>=11?11:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};function xe(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function we(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function Se(e){return e>=65&&e<=90||e>=97&&e<=122}function _e(e){return Se(e)||95===e}function ke(e){return _e(e)||Ee(e)}function Ee(e){return e>=48&&e<=57}function Ae(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Ce(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function Ie(e){return e>=48&&e<=55}be.prototype.reset=function(e,t,n){var i=-1!==n.indexOf("u");this.start=0|e,this.source=t+"",this.flags=n,this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchN=i&&this.parser.options.ecmaVersion>=9},be.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},be.prototype.at=function(e){var t=this.source,n=t.length;if(e>=n)return-1;var i=t.charCodeAt(e);if(!this.switchU||i<=55295||i>=57344||e+1>=n)return i;var r=t.charCodeAt(e+1);return r>=56320&&r<=57343?(i<<10)+r-56613888:i},be.prototype.nextIndex=function(e){var t=this.source,n=t.length;if(e>=n)return n;var i,r=t.charCodeAt(e);return!this.switchU||r<=55295||r>=57344||e+1>=n||(i=t.charCodeAt(e+1))<56320||i>57343?e+1:e+2},be.prototype.current=function(){return this.at(this.pos)},be.prototype.lookahead=function(){return this.at(this.nextIndex(this.pos))},be.prototype.advance=function(){this.pos=this.nextIndex(this.pos)},be.prototype.eat=function(e){return this.current()===e&&(this.advance(),!0)},ye.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,i=0;i-1&&this.raise(e.start,"Duplicate regular expression flag")}},ye.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},ye.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,n=e.backReferenceNames;t=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},ye.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},ye.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},ye.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var i=0,r=-1;if(this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue),e.eat(125)))return-1!==r&&r=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},ye.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},ye.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},ye.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!we(t)&&(e.lastIntValue=t,e.advance(),!0)},ye.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;-1!==(n=e.current())&&!we(n);)e.advance();return e.pos!==t},ye.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t)&&(e.advance(),!0)},ye.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e))return-1!==e.groupNames.indexOf(e.lastStringValue)&&e.raise("Duplicate capture group name"),void e.groupNames.push(e.lastStringValue);e.raise("Invalid group")}},ye.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},ye.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=xe(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=xe(e.lastIntValue);return!0}return!1},ye.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=e.current();return e.advance(),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e)&&(n=e.lastIntValue),function(e){return f(e,!0)||36===e||95===e}(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},ye.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=e.current();return e.advance(),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e)&&(n=e.lastIntValue),function(e){return g(e,!0)||36===e||95===e||8204===e||8205===e}(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},ye.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},ye.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},ye.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},ye.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},ye.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},ye.regexp_eatZero=function(e){return 48===e.current()&&!Ee(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},ye.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},ye.regexp_eatControlLetter=function(e){var t=e.current();return!!Se(t)&&(e.lastIntValue=t%32,e.advance(),!0)},ye.regexp_eatRegExpUnicodeEscapeSequence=function(e){var t,n=e.pos;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(e.switchU&&i>=55296&&i<=56319){var r=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(s>=56320&&s<=57343)return e.lastIntValue=1024*(i-55296)+(s-56320)+65536,!0}e.pos=r,e.lastIntValue=i}return!0}if(e.switchU&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&((t=e.lastIntValue)>=0&&t<=1114111))return!0;e.switchU&&e.raise("Invalid unicode escape"),e.pos=n}return!1},ye.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t)&&(e.lastIntValue=t,e.advance(),!0)},ye.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1},ye.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&this.options.ecmaVersion>=9&&(80===t||112===t)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return!0;e.raise("Invalid property name")}return!1},ye.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,i),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,r),!0}return!1},ye.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){M(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(n)||e.raise("Invalid property value")},ye.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")},ye.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";_e(t=e.current());)e.lastStringValue+=xe(t),e.advance();return""!==e.lastStringValue},ye.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";ke(t=e.current());)e.lastStringValue+=xe(t),e.advance();return""!==e.lastStringValue},ye.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},ye.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return!0;e.raise("Unterminated character class")}return!1},ye.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;!e.switchU||-1!==t&&-1!==n||e.raise("Invalid character class"),-1!==t&&-1!==n&&t>n&&e.raise("Range out of order in character class")}}},ye.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(99===n||Ie(n))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var i=e.current();return 93!==i&&(e.lastIntValue=i,e.advance(),!0)},ye.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},ye.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!Ee(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},ye.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},ye.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Ee(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t},ye.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Ae(n=e.current());)e.lastIntValue=16*e.lastIntValue+Ce(n),e.advance();return e.pos!==t},ye.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*n+e.lastIntValue:e.lastIntValue=8*t+n}else e.lastIntValue=t;return!0}return!1},ye.regexp_eatOctalDigit=function(e){var t=e.current();return Ie(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},ye.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var i=0;i>10),56320+(1023&e)))}Pe.next=function(){this.options.onToken&&this.options.onToken(new Te(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Pe.getToken=function(){return this.next(),new Te(this)},"undefined"!=typeof Symbol&&(Pe[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===S.eof,value:t}}}}),Pe.curContext=function(){return this.context[this.context.length-1]},Pe.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(S.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},Pe.readToken=function(e){return f(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},Pe.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},Pe.skipBlockComment=function(){var e,t=this.options.onComment&&this.curPosition(),n=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(-1===i&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(k.lastIndex=n;(e=k.exec(this.input))&&e.index8&&e<14||e>=5760&&A.test(String.fromCharCode(e))))break e;++this.pos}}},Pe.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},Pe.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(S.ellipsis)):(++this.pos,this.finishToken(S.dot))},Pe.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(S.assign,2):this.finishOp(S.slash,1)},Pe.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,i=42===e?S.star:S.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++n,i=S.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(S.assign,n+1):this.finishOp(i,n)},Pe.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.finishOp(124===e?S.logicalOR:S.logicalAND,2):61===t?this.finishOp(S.assign,2):this.finishOp(124===e?S.bitwiseOR:S.bitwiseAND,1)},Pe.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(S.assign,2):this.finishOp(S.bitwiseXOR,1)},Pe.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!_.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(S.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(S.assign,2):this.finishOp(S.plusMin,1)},Pe.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+n)?this.finishOp(S.assign,n+1):this.finishOp(S.bitShift,n)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(n=2),this.finishOp(S.relational,n)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},Pe.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(S.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(S.arrow)):this.finishOp(61===e?S.eq:S.prefix,1)},Pe.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(S.parenL);case 41:return++this.pos,this.finishToken(S.parenR);case 59:return++this.pos,this.finishToken(S.semi);case 44:return++this.pos,this.finishToken(S.comma);case 91:return++this.pos,this.finishToken(S.bracketL);case 93:return++this.pos,this.finishToken(S.bracketR);case 123:return++this.pos,this.finishToken(S.braceL);case 125:return++this.pos,this.finishToken(S.braceR);case 58:return++this.pos,this.finishToken(S.colon);case 63:return++this.pos,this.finishToken(S.question);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(S.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 126:return this.finishOp(S.prefix,1)}this.raise(this.pos,"Unexpected character '"+Me(e)+"'")},Pe.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},Pe.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,"Unterminated regular expression");var i=this.input.charAt(this.pos);if(_.test(i)&&this.raise(n,"Unterminated regular expression"),e)e=!1;else{if("["===i)t=!0;else if("]"===i&&t)t=!1;else if("/"===i&&!t)break;e="\\"===i}++this.pos}var r=this.input.slice(n,this.pos);++this.pos;var s=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(s);var o=this.regexpState||(this.regexpState=new be(this));o.reset(n,r,a),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var c=null;try{c=new RegExp(r,a)}catch(e){}return this.finishToken(S.regexp,{pattern:r,flags:a,value:c})},Pe.readInt=function(e,t){for(var n=this.pos,i=0,r=0,s=null==t?1/0:t;r=97?a-97+10:a>=65?a-65+10:a>=48&&a<=57?a-48:1/0)>=e)break;++this.pos,i=i*e+o}return this.pos===n||null!=t&&this.pos-n!==t?null:i},Pe.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return null==n&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(n="undefined"!=typeof BigInt?BigInt(this.input.slice(t,this.pos)):null,++this.pos):f(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(S.num,n)},Pe.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10)||this.raise(t,"Invalid number");var n=this.pos-t>=2&&48===this.input.charCodeAt(t);n&&this.strict&&this.raise(t,"Invalid number"),n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1);var i=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&110===i){var r=this.input.slice(t,this.pos),s="undefined"!=typeof BigInt?BigInt(r):null;return++this.pos,f(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(S.num,s)}46!==i||n||(++this.pos,this.readInt(10),i=this.input.charCodeAt(this.pos)),69!==i&&101!==i||n||(43!==(i=this.input.charCodeAt(++this.pos))&&45!==i||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),f(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var a=this.input.slice(t,this.pos),o=n?parseInt(a,8):parseFloat(a);return this.finishToken(S.num,o)},Pe.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},Pe.readString=function(e){for(var t="",n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var i=this.input.charCodeAt(this.pos);if(i===e)break;92===i?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):(E(i,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(S.string,t)};var Ne={};Pe.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==Ne)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},Pe.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Ne;this.raise(e,t)},Pe.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var n=this.input.charCodeAt(this.pos);if(96===n||36===n&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==S.template&&this.type!==S.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(S.template,e)):36===n?(this.pos+=2,this.finishToken(S.dollarBraceL)):(++this.pos,this.finishToken(S.backQuote));if(92===n)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(E(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(n)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},Pe.readInvalidTemplateToken=function(){for(;this.pos=48&&t<=55){var n=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(n,8);return i>255&&(n=n.slice(0,-1),i=parseInt(n,8)),this.pos+=n.length-1,t=this.input.charCodeAt(this.pos),"0"===n&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-n.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)}return E(t)?"":String.fromCharCode(t)}},Pe.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return null===n&&this.invalidStringToken(t,"Bad character escape sequence"),n},Pe.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,n=this.pos,i=this.options.ecmaVersion>=6;this.pos{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict"; /** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const e=window,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),r=new WeakMap;class s{constructor(e,t,n){if(this._$cssResult$=!0,n!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const n=this.t;if(t&&void 0===e){const t=void 0!==n&&1===n.length;t&&(e=r.get(n)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&r.set(n,e))}return e}toString(){return this.cssText}}const a=(e,...t)=>{const n=1===e.length?e[0]:t.reduce(((t,n,i)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[i+1]),e[0]);return new s(n,e,i)},o=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return(e=>new s("string"==typeof e?e:e+"",void 0,i))(t)})(e):e; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ var c;const l=window,h=l.trustedTypes,u=h?h.emptyScript:"",p=l.reactiveElementPolyfillSupport,d={toAttribute(e,t){switch(t){case Boolean:e=e?u:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},f=(e,t)=>t!==e&&(t==t||e==e),g={attribute:!0,type:String,converter:d,reflect:!1,hasChanged:f};class m extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var t;this.finalize(),(null!==(t=this.h)&&void 0!==t?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach(((t,n)=>{const i=this._$Ep(n,t);void 0!==i&&(this._$Ev.set(i,n),e.push(i))})),e}static createProperty(e,t=g){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const n="symbol"==typeof e?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,t);void 0!==i&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(i){const r=this[e];this[t]=i,this.requestUpdate(e,r,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||g}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),void 0!==e.h&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const n of t)this.createProperty(n,e[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(o(e))}else void 0!==e&&t.push(o(e));return t}static _$Ep(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(e=this.constructor.h)||void 0===e||e.forEach((e=>e(this)))}addController(e){var t,n;(null!==(t=this._$ES)&&void 0!==t?t:this._$ES=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(n=e.hostConnected)||void 0===n||n.call(e))}removeController(e){var t;null===(t=this._$ES)||void 0===t||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])}))}createRenderRoot(){var n;const i=null!==(n=this.shadowRoot)&&void 0!==n?n:this.attachShadow(this.constructor.shadowRootOptions);return((n,i)=>{t?n.adoptedStyleSheets=i.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet)):i.forEach((t=>{const i=document.createElement("style"),r=e.litNonce;void 0!==r&&i.setAttribute("nonce",r),i.textContent=t.cssText,n.appendChild(i)}))})(i,this.constructor.elementStyles),i}connectedCallback(){var e;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)}))}enableUpdating(e){}disconnectedCallback(){var e;null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)}))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EO(e,t,n=g){var i;const r=this.constructor._$Ep(e,n);if(void 0!==r&&!0===n.reflect){const s=(void 0!==(null===(i=n.converter)||void 0===i?void 0:i.toAttribute)?n.converter:d).toAttribute(t,n.type);this._$El=e,null==s?this.removeAttribute(r):this.setAttribute(r,s),this._$El=null}}_$AK(e,t){var n;const i=this.constructor,r=i._$Ev.get(e);if(void 0!==r&&this._$El!==r){const e=i.getPropertyOptions(r),s="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null===(n=e.converter)||void 0===n?void 0:n.fromAttribute)?e.converter:d;this._$El=r,this[r]=s.fromAttribute(t,e.type),this._$El=null}}requestUpdate(e,t,n){let i=!0;void 0!==e&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||f)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===n.reflect&&this._$El!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,n))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((e,t)=>this[t]=e)),this._$Ei=void 0);let t=!1;const n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)})),this.update(n)):this._$Ek()}catch(e){throw t=!1,this._$Ek(),e}t&&this._$AE(n)}willUpdate(e){}_$AE(e){var t;null===(t=this._$ES)||void 0===t||t.forEach((e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){void 0!==this._$EC&&(this._$EC.forEach(((e,t)=>this._$EO(t,this[t],e))),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}} /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ var v;m.finalized=!0,m.elementProperties=new Map,m.elementStyles=[],m.shadowRootOptions={mode:"open"},null==p||p({ReactiveElement:m}),(null!==(c=l.reactiveElementVersions)&&void 0!==c?c:l.reactiveElementVersions=[]).push("1.4.2");const y=window,b=y.trustedTypes,x=b?b.createPolicy("lit-html",{createHTML:e=>e}):void 0,w=`lit$${(Math.random()+"").slice(9)}$`,S="?"+w,_=`<${S}>`,k=document,E=(e="")=>k.createComment(e),A=e=>null===e||"object"!=typeof e&&"function"!=typeof e,C=Array.isArray,I=e=>C(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]),T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,P=/-->/g,M=/>/g,N=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),O=/'/g,L=/"/g,D=/^(?:script|style|textarea|title)$/i,R=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),$=R(1),V=(R(2),Symbol.for("lit-noChange")),B=Symbol.for("lit-nothing"),j=new WeakMap,F=k.createTreeWalker(k,129,null,!1),U=(e,t)=>{const n=e.length-1,i=[];let r,s=2===t?"":"",a=T;for(let t=0;t"===c[0]?(a=null!=r?r:T,l=-1):void 0===c[1]?l=-2:(l=a.lastIndex-c[2].length,o=c[1],a=void 0===c[3]?N:'"'===c[3]?L:O):a===L||a===O?a=N:a===P||a===M?a=T:(a=N,r=void 0);const u=a===N&&e[t+1].startsWith("/>")?" ":"";s+=a===T?n+_:l>=0?(i.push(o),n.slice(0,l)+"$lit$"+n.slice(l)+w+u):n+w+(-2===l?(i.push(void 0),t):u)}const o=s+(e[n]||"")+(2===t?"":"");if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==x?x.createHTML(o):o,i]};class H{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let r=0,s=0;const a=e.length-1,o=this.parts,[c,l]=U(e,t);if(this.el=H.createElement(c,n),F.currentNode=this.el.content,2===t){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(i=F.nextNode())&&o.length0){i.textContent=b?b.emptyScript:"";for(let n=0;n2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=B}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,n,i){const r=this.strings;let s=!1;if(void 0===r)e=q(this,e,t,0),s=!A(e)||e!==this._$AH&&e!==V,s&&(this._$AH=e);else{const i=e;let a,o;for(e=r[0],a=0;a{var i,r;const s=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:t;let a=s._$litPart$;if(void 0===a){const e=null!==(r=null==n?void 0:n.renderBefore)&&void 0!==r?r:null;s._$litPart$=a=new W(t.insertBefore(E(),e),e,void 0,null!=n?n:{})}return a._$AI(e),a})(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}render(){return V}}ne.finalized=!0,ne._$litElement$=!0,null===(ee=globalThis.litElementHydrateSupport)||void 0===ee||ee.call(globalThis,{LitElement:ne});const ie=globalThis.litElementPolyfillSupport;null==ie||ie({LitElement:ne});(null!==(te=globalThis.litElementVersions)&&void 0!==te?te:globalThis.litElementVersions=[]).push("3.2.2"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const re=e=>t=>"function"==typeof t?((e,t)=>(customElements.define(e,t),t))(e,t):((e,t)=>{const{kind:n,elements:i}=t;return{kind:n,elements:i,finisher(t){customElements.define(e,t)}}})(e,t),se=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(n){n.createProperty(t.key,e)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(n){n.createProperty(t.key,e)}};function ae(e){return(t,n)=>void 0!==n?((e,t,n)=>{t.constructor.createProperty(n,e)})(e,t,n):se(e,t)} /** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ var oe;null===(oe=window.HTMLSlotElement)||void 0===oe||oe.prototype.assignedElements;class ce{static closestElement(e,t){return function t(n){if(!n||n===document||n===window)return null;n.assignedSlot&&(n=n.assignedSlot);const i=n.closest(e);return i||t(n.getRootNode().host)}(t)}}const le=(e,t,n,i)=>{i=i||{},n=null==n?{}:n;const r=new Event(t,{bubbles:void 0===i.bubbles||i.bubbles,cancelable:Boolean(i.cancelable),composed:void 0===i.composed||i.composed});return r.detail=n,e.dispatchEvent(r),r},he=(e,t,n=!1)=>{n?history.replaceState(null,"",t):history.pushState(null,"",t),le(window,"location-changed",{replace:n})};class ue{constructor(e,t,n,i){this.entityId=e,this.svgElement=t,this.originalSvgElement=n,this.originalBBox=i}}class pe{constructor(e){this.rule=e,this.svgElementInfos={}}}class de{constructor(e,t,n,i,r,s){this.instance=e,this.entityId=t,this.elementId=n,this.svgElementInfo=i,this.ruleInfo=r,this.actions=s}}const fe={},ge={};ge.click=ge.mousedown=ge.mouseup=ge.mousemove="MouseEvents";let me=1;function ve(e){return e._dtId||(e._dtId=me++)}function ye(e){const t=e.indexOf(".");return t>0?{e:e.substring(0,e.indexOf(".")),ns:e.substring(t+1,e.length)}:{e}}function be(e,t,n,i){const r=ye(n).e;if(!e._dtId)return!1;const s=fe[ve(e)],a=function(e,t,n,i){return n=ye(n),(fe[ve(e)]||[]).filter((e=>e&&(!n.e||e.e===n.e)&&(!n.ns||e.ns===n.ns)&&(!i||e.callback===i)&&(!t||e.selector===t)))}(e,t,n,i);a.forEach((t=>{e.removeEventListener?e.removeEventListener(r,t.delegator||t.callback):e.detachEvent&&e.detachEvent("on"+r,t.delegator||t.callback),s.splice(s.indexOf(t),1)}))}function xe(e,t,n,i,r,s){const a=ye(n).e,o=ye(n).ns;e.addEventListener?e.addEventListener(a,r||i,s):e.attachEvent&&e.attachEvent("on"+a,r||i);const c=ve(e);(fe[c]||(fe[c]=[])).push({delegator:r,callback:i,e:a,ns:o,selector:t})}const we={on(e,t,n,i=null){xe(e,null,t,n,null,i)},off(e,t,n=null){be(e,null,t,n)},once(e,t,n){const i=e=>(we.off(e.currentTarget,e.type,i),n(e));this.on(e,t,i)},delegate(e,t,n,i,r=null){xe(e,t,n,i,(function(n){const r=e.querySelectorAll(t);let s=!1;for(let e=0;e{n=!1,t=setTimeout((()=>{n=!0,e.dispatchEvent(new Event("longClick"))}),400)},r=i=>{clearTimeout(t),n||e.dispatchEvent(new Event("short"+i.type[0].toUpperCase()+i.type.slice(1)))},s=e=>{n&&(e.preventDefault(),e.stopImmediatePropagation&&e.stopImmediatePropagation())};_e.on(e,"mousedown",i.bind(this)),_e.on(e,"tapstart",i.bind(this)),_e.on(e,"touchstart",i.bind(this),{passive:!0}),_e.on(e,"click",r.bind(this)),_e.on(e,"mouseup",r.bind(this)),_e.on(e,"tapend",r.bind(this)),_e.on(e,"touchend",r.bind(this)),_e.on(e,"tap",s.bind(this)),_e.on(e,"touch",s.bind(this)),_e.on(e,"mouseup",s.bind(this)),_e.on(e,"tapend",s.bind(this)),_e.on(e,"touchend",s.bind(this)),_e.on(e,"click",(e=>{e.preventDefault(),e.stopImmediatePropagation&&e.stopImmediatePropagation()}).bind(this))}}const Ee=Se,Ae=new Set;class Ce{static observe(e){if(Ae.has(e))return;Ae.add(e);let t,n=0;Ee.on(e,"click",(()=>{n++,t=setTimeout((()=>{1===n&&(n=0,e.dispatchEvent(new Event("singleClick")))}),400),2===n&&(clearTimeout(t),n=0,e.dispatchEvent(new Event("doubleClick")))}).bind(this))}}var Ie,Te=n(1),Pe=n.n(Te);class Me{static timeago(e){let t="second",n=0;const i=("string"==typeof e?new Date(e):e).getTime()-(new Date).getTime(),r=i/this.MILLISECONDS_IN_YEAR;if(Math.abs(r)>=1)t="year",n=r;else{const e=i/this.MILLISECONDS_IN_DAY;if(Math.abs(e)>=1)t="day",n=e;else{const e=i/this.MILLISECONDS_IN_HOUR;if(Math.abs(e)>=1)t="hour",n=e;else{const e=i/this.MILLISECONDS_IN_MINUTE;if(Math.abs(e)>=1)t="minute",n=e;else{t="second",n=i/this.MILLISECONDS_IN_SECOND}}}}return this.relativeTimeFormat.format(Math.round(n),t)}}Me.strftime=Pe(),Me.MILLISECONDS_IN_SECOND=1e3,Me.MILLISECONDS_IN_MINUTE=6e4,Me.MILLISECONDS_IN_HOUR=36e5,Me.MILLISECONDS_IN_DAY=864e5,Me.MILLISECONDS_IN_YEAR=31536e6,Me.relativeTimeFormat=new Intl.RelativeTimeFormat(null!==(Ie=navigator.language)&&void 0!==Ie?Ie:"en",{numeric:"auto",style:"long"});var Ne=n(449),Oe=n.n(Ne);function Le(e){return(e=>{if("object"==typeof(t=e)&&null!==t&&"message"in t&&"string"==typeof t.message)return e;var t;try{return new Error(JSON.stringify(e))}catch(t){return new Error(String(e))}})(e).message}class De{static isCode(e){return this.isCodeBlock(e)||this.isCodeLine(e)}static isCodeBlock(e){return e.trim().startsWith(">")}static isCodeLine(e){return e.includes("${")&&e.includes("}")}static evaluate(e,t,n,i,r,s,a){this.expression=e.trim();const o=`${this.expression}_${null!=r?r:""}`;this.parsedFunction=this.cache[o],void 0===this.parsedFunction&&(this.functionBody=this.expression,this.isCodeBlock(this.functionBody)?this.functionBody=this.functionBody.slice(1).trim():this.isCodeLine(this.functionBody)&&(this.functionBody.startsWith('"')&&this.functionBody.endsWith('"')&&(this.functionBody=this.functionBody.slice(1,this.functionBody.length-2)),this.functionBody=this.functionBody.replace(/\\"/g,'"'),this.functionBody=`\`${this.functionBody}\`;`,this.functionBody.includes("return")||(this.functionBody=`return ${this.functionBody}`)),this.parsedFunction=this.interpreter.parse(`exports.result = (() => { ${this.functionBody} })();`),this.cache[o]=this.parsedFunction,this.interpreter.import("config",n),this.interpreter.import("util",this.util)),this.entityState=i?t.states[i]:void 0,this.interpreter.import("functions",a),this.interpreter.import("entity",this.entityState),this.interpreter.import("entities",t.states),this.interpreter.import("states",t.states),this.interpreter.import("hass",t),this.interpreter.import("element",r),this.interpreter.import("elements",s);try{this.interpreter.run(this.parsedFunction)}catch(e){throw new EvalError(Le(e))}return this.interpreter.exports.result}} /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ function Re(e){return null==e}De.cache={},De.interpreter=new(Oe())({ecmaVer:2019,sandBox:!0}),De.util={color:class{static miredToRGB(e){return this.kelvinToRGB(1e6/e)}static kelvinToRGB(e){const t=e/100;let n,i,r;return t<=66?(n=255,i=t,i=99.4708025861*Math.log(i)-161.1195681661,t<=19?r=0:(r=t-10,r=138.5177312231*Math.log(r)-305.0447927307)):(n=t-60,n=329.698727446*Math.pow(n,-.1332047592),i=t-60,i=288.1221695283*Math.pow(i,-.0755148492),r=255),[Math.min(Math.max(Math.round(n),0),255),Math.min(Math.max(Math.round(i),0),255),Math.min(Math.max(Math.round(r),0),255)]}},date:Me};var $e={isNothing:Re,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:Re(e)?[]:[e]},repeat:function(e,t){var n,i="";for(n=0;no&&(t=i-o+(s=" ... ").length),n-i>o&&(n=i+o-(a=" ...").length),{str:s+e.slice(t,n).replace(/\t/g,"→")+a,pos:i-t+s.length}}function Ue(e,t){return $e.repeat(" ",t-e.length)+e}var He=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var n,i=/\r?\n|\r|\0/g,r=[0],s=[],a=-1;n=i.exec(e.buffer);)s.push(n.index),r.push(n.index+n[0].length),e.position<=n.index&&a<0&&(a=r.length-2);a<0&&(a=r.length-1);var o,c,l="",h=Math.min(e.line+t.linesAfter,s.length).toString().length,u=t.maxLength-(t.indent+h+3);for(o=1;o<=t.linesBefore&&!(a-o<0);o++)c=Fe(e.buffer,r[a-o],s[a-o],e.position-(r[a]-r[a-o]),u),l=$e.repeat(" ",t.indent)+Ue((e.line-o+1).toString(),h)+" | "+c.str+"\n"+l;for(c=Fe(e.buffer,r[a],s[a],e.position,u),l+=$e.repeat(" ",t.indent)+Ue((e.line+1).toString(),h)+" | "+c.str+"\n",l+=$e.repeat("-",t.indent+h+3+c.pos)+"^\n",o=1;o<=t.linesAfter&&!(a+o>=s.length);o++)c=Fe(e.buffer,r[a+o],s[a+o],e.position-(r[a]-r[a+o]),u),l+=$e.repeat(" ",t.indent)+Ue((e.line+o+1).toString(),h)+" | "+c.str+"\n";return l.replace(/\n$/,"")},qe=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],ze=["scalar","sequence","mapping"];var We=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===qe.indexOf(t))throw new je('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=function(e){var t={};return null!==e&&Object.keys(e).forEach((function(n){e[n].forEach((function(e){t[String(e)]=n}))})),t}(t.styleAliases||null),-1===ze.indexOf(this.kind))throw new je('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function Ye(e,t){var n=[];return e[t].forEach((function(e){var t=n.length;n.forEach((function(n,i){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=i)})),n[t]=e})),n}function Ge(e){return this.extend(e)}Ge.prototype.extend=function(e){var t=[],n=[];if(e instanceof We)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new je("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof We))throw new je("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new je("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new je("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(e){if(!(e instanceof We))throw new je("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var i=Object.create(Ge.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=Ye(i,"implicit"),i.compiledExplicit=Ye(i,"explicit"),i.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function i(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),at=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var ot=/^[-+]?[0-9]+e/;var ct=new We("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!at.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||$e.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if($e.isNegativeZero(e))return"-0.0";return n=e.toString(10),ot.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"}),lt=Ze.extend({implicit:[et,tt,st,ct]}),ht=lt,ut=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),pt=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");var dt=new We("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==ut.exec(e)||null!==pt.exec(e))},construct:function(e){var t,n,i,r,s,a,o,c,l=0,h=null;if(null===(t=ut.exec(e))&&(t=pt.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,i,r));if(s=+t[4],a=+t[5],o=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(h=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(h=-h)),c=new Date(Date.UTC(n,i,r,s,a,o,l)),h&&c.setTime(c.getTime()-h),c},instanceOf:Date,represent:function(e){return e.toISOString()}});var ft=new We("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),gt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var mt=new We("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i=0,r=e.length,s=gt;for(n=0;n64)){if(t<0)return!1;i+=6}return i%8==0},construct:function(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,s=gt,a=0,o=[];for(t=0;t>16&255),o.push(a>>8&255),o.push(255&a)),a=a<<6|s.indexOf(i.charAt(t));return 0===(n=r%4*6)?(o.push(a>>16&255),o.push(a>>8&255),o.push(255&a)):18===n?(o.push(a>>10&255),o.push(a>>2&255)):12===n&&o.push(a>>4&255),new Uint8Array(o)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,n,i="",r=0,s=e.length,a=gt;for(t=0;t>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]),r=(r<<8)+e[t];return 0===(n=s%3)?(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]):2===n?(i+=a[r>>10&63],i+=a[r>>4&63],i+=a[r<<2&63],i+=a[64]):1===n&&(i+=a[r>>2&63],i+=a[r<<4&63],i+=a[64],i+=a[64]),i}}),vt=Object.prototype.hasOwnProperty,yt=Object.prototype.toString;var bt=new We("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,i,r,s,a=[],o=e;for(t=0,n=o.length;t>10),56320+(e-65536&1023))}for(var Gt=new Array(256),Jt=new Array(256),Xt=0;Xt<256;Xt++)Gt[Xt]=Wt(Xt)?1:0,Jt[Xt]=Wt(Xt);function Kt(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||kt,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Qt(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=He(n),new je(t,n)}function Zt(e,t){throw Qt(e,t)}function en(e,t){e.onWarning&&e.onWarning.call(null,Qt(e,t))}var tn={YAML:function(e,t,n){var i,r,s;null!==e.version&&Zt(e,"duplication of %YAML directive"),1!==n.length&&Zt(e,"YAML directive accepts exactly one argument"),null===(i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&Zt(e,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),s=parseInt(i[2],10),1!==r&&Zt(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=s<2,1!==s&&2!==s&&en(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var i,r;2!==n.length&&Zt(e,"TAG directive accepts exactly two arguments"),i=n[0],r=n[1],Rt.test(i)||Zt(e,"ill-formed tag handle (first argument) of the TAG directive"),Et.call(e.tagMap,i)&&Zt(e,'there is a previously declared suffix for "'+i+'" tag handle'),$t.test(r)||Zt(e,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(t){Zt(e,"tag prefix is malformed: "+r)}e.tagMap[i]=r}};function nn(e,t,n,i){var r,s,a,o;if(t1&&(e.result+=$e.repeat("\n",t-1))}function hn(e,t){var n,i,r=e.tag,s=e.anchor,a=[],o=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),i=e.input.charCodeAt(e.position);0!==i&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,Zt(e,"tab characters must not be used in indentation")),45===i)&&Ft(e.input.charCodeAt(e.position+1));)if(o=!0,e.position++,on(e,!0,-1)&&e.lineIndent<=t)a.push(null),i=e.input.charCodeAt(e.position);else if(n=e.line,dn(e,t,It,!1,!0),a.push(e.result),on(e,!0,-1),i=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==i)Zt(e,"bad indentation of a sequence entry");else if(e.lineIndentt?f=1:e.lineIndent===t?f=0:e.lineIndentt?f=1:e.lineIndent===t?f=0:e.lineIndentt)&&(v&&(a=e.line,o=e.lineStart,c=e.position),dn(e,t,Tt,!0,r)&&(v?g=e.result:m=e.result),v||(sn(e,p,d,f,g,m,a,o,c),f=g=m=null),on(e,!0,-1),l=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&0!==l)Zt(e,"bad indentation of a mapping entry");else if(e.lineIndent=0))break;0===r?Zt(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?Zt(e,"repeat of an indentation width identifier"):(l=t+r-1,c=!0)}if(jt(s)){do{s=e.input.charCodeAt(++e.position)}while(jt(s));if(35===s)do{s=e.input.charCodeAt(++e.position)}while(!Bt(s)&&0!==s)}for(;0!==s;){for(an(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!c||e.lineIndentl&&(l=e.lineIndent),Bt(s))h++;else{if(e.lineIndent0){for(r=a,s=0;r>0;r--)(a=Ht(o=e.input.charCodeAt(++e.position)))>=0?s=(s<<4)+a:Zt(e,"expected hexadecimal character");e.result+=Yt(s),e.position++}else Zt(e,"unknown escape sequence");n=i=e.position}else Bt(o)?(nn(e,n,i,!0),ln(e,on(e,!1,t)),n=i=e.position):e.position===e.lineStart&&cn(e)?Zt(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}Zt(e,"unexpected end of the stream within a double quoted scalar")}(e,p)?m=!0:!function(e){var t,n,i;if(42!==(i=e.input.charCodeAt(e.position)))return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!Ft(i)&&!Ut(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&Zt(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),Et.call(e.anchorMap,n)||Zt(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],on(e,!0,-1),!0}(e)?function(e,t,n){var i,r,s,a,o,c,l,h,u=e.kind,p=e.result;if(Ft(h=e.input.charCodeAt(e.position))||Ut(h)||35===h||38===h||42===h||33===h||124===h||62===h||39===h||34===h||37===h||64===h||96===h)return!1;if((63===h||45===h)&&(Ft(i=e.input.charCodeAt(e.position+1))||n&&Ut(i)))return!1;for(e.kind="scalar",e.result="",r=s=e.position,a=!1;0!==h;){if(58===h){if(Ft(i=e.input.charCodeAt(e.position+1))||n&&Ut(i))break}else if(35===h){if(Ft(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&cn(e)||n&&Ut(h))break;if(Bt(h)){if(o=e.line,c=e.lineStart,l=e.lineIndent,on(e,!1,-1),e.lineIndent>=t){a=!0,h=e.input.charCodeAt(e.position);continue}e.position=s,e.line=o,e.lineStart=c,e.lineIndent=l;break}}a&&(nn(e,r,s,!1),ln(e,e.line-o),r=s=e.position,a=!1),jt(h)||(s=e.position+1),h=e.input.charCodeAt(++e.position)}return nn(e,r,s,!1),!!e.result||(e.kind=u,e.result=p,!1)}(e,p,At===n)&&(m=!0,null===e.tag&&(e.tag="?")):(m=!0,null===e.tag&&null===e.anchor||Zt(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===f&&(m=o&&hn(e,d))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&Zt(e,'unacceptable node kind for ! tag; it should be "scalar", not "'+e.kind+'"'),c=0,l=e.implicitTypes.length;c"),null!==e.result&&u.kind!==e.kind&&Zt(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+u.kind+'", not "'+e.kind+'"'),u.resolve(e.result,e.tag)?(e.result=u.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):Zt(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||m}function fn(e){var t,n,i,r,s=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(r=e.input.charCodeAt(e.position))&&(on(e,!0,-1),r=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==r));){for(a=!0,r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!Ft(r);)r=e.input.charCodeAt(++e.position);for(i=[],(n=e.input.slice(t,e.position)).length<1&&Zt(e,"directive name must not be less than one character in length");0!==r;){for(;jt(r);)r=e.input.charCodeAt(++e.position);if(35===r){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&!Bt(r));break}if(Bt(r))break;for(t=e.position;0!==r&&!Ft(r);)r=e.input.charCodeAt(++e.position);i.push(e.input.slice(t,e.position))}0!==r&&an(e),Et.call(tn,n)?tn[n](e,n,i):en(e,'unknown document directive "'+n+'"')}on(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,on(e,!0,-1)):a&&Zt(e,"directives end mark is expected"),dn(e,e.lineIndent-1,Tt,!1,!0),on(e,!0,-1),e.checkLineBreaks&&Lt.test(e.input.slice(s,e.position))&&en(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&cn(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,on(e,!0,-1)):e.position=55296&&i<=56319&&t+1=56320&&n<=57343?1024*(i-55296)+n-56320+65536:i}function ri(e){return/^\n* /.test(e)}var si=1,ai=2,oi=3,ci=4,li=5;function hi(e,t,n,i,r,s,a,o){var c,l=0,h=null,u=!1,p=!1,d=-1!==i,f=-1,g=function(e){return ei(e)&&e!==bn&&!Zn(e)&&e!==Nn&&e!==Rn&&e!==On&&e!==Mn&&e!==Vn&&e!==Bn&&e!==Fn&&e!==Hn&&e!==An&&e!==In&&e!==Pn&&e!==kn&&e!==Un&&e!==Ln&&e!==Dn&&e!==Tn&&e!==En&&e!==Cn&&e!==$n&&e!==jn}(ii(e,0))&&function(e){return!Zn(e)&&e!==On}(ii(e,e.length-1));if(t||a)for(c=0;c=65536?c+=2:c++){if(!ei(l=ii(e,c)))return li;g=g&&ni(l,h,o),h=l}else{for(c=0;c=65536?c+=2:c++){if((l=ii(e,c))===wn)u=!0,d&&(p=p||c-f-1>i&&" "!==e[f+1],f=c);else if(!ei(l))return li;g=g&&ni(l,h,o),h=l}p=p||d&&c-f-1>i&&" "!==e[f+1]}return u||p?n>9&&ri(e)?li:a?s===Jn?li:ai:p?ci:oi:!g||a||r(e)?s===Jn?li:ai:si}function ui(e,t,n,i,r){e.dump=function(){if(0===t.length)return e.quotingType===Jn?'""':"''";if(!e.noCompatMode&&(-1!==zn.indexOf(t)||Wn.test(t)))return e.quotingType===Jn?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,n),a=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),o=i||e.flowLevel>-1&&n>=e.flowLevel;switch(hi(t,o,e.indent,a,(function(t){return function(e,t){var n,i;for(n=0,i=e.implicitTypes.length;n"+pi(t,e.indent)+di(Kn(function(e,t){var n,i,r=/(\n+)([^\n]*)/g,s=(o=e.indexOf("\n"),o=-1!==o?o:e.length,r.lastIndex=o,fi(e.slice(0,o),t)),a="\n"===e[0]||" "===e[0];var o;for(;i=r.exec(e);){var c=i[1],l=i[2];n=" "===l[0],s+=c+(a||n||""===l?"":"\n")+fi(l,t),a=n}return s}(t,a),s));case li:return'"'+function(e){for(var t,n="",i=0,r=0;r=65536?r+=2:r++)i=ii(e,r),!(t=qn[i])&&ei(i)?(n+=e[r],i>=65536&&(n+=e[r+1])):n+=t||Yn(i);return n}(t)+'"';default:throw new je("impossible error: invalid scalar style")}}()}function pi(e,t){var n=ri(e)?String(t):"",i="\n"===e[e.length-1];return n+(i&&("\n"===e[e.length-2]||"\n"===e)?"+":i?"":"-")+"\n"}function di(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function fi(e,t){if(""===e||" "===e[0])return e;for(var n,i,r=/ [^ ]/g,s=0,a=0,o=0,c="";n=r.exec(e);)(o=n.index)-s>t&&(i=a>s?a:o,c+="\n"+e.slice(s,i),s=i+1),a=o;return c+="\n",e.length-s>t&&a>s?c+=e.slice(s,a)+"\n"+e.slice(a+1):c+=e.slice(s),c.slice(1)}function gi(e,t,n,i){var r,s,a,o="",c=e.tag;for(r=0,s=n.length;r tag resolver accepts not "'+c+'" style');i=o.represent[c](t,c)}e.dump=i}return!0}return!1}function vi(e,t,n,i,r,s,a){e.tag=null,e.dump=n,mi(e,n,!1)||mi(e,n,!0);var o,c=vn.call(e.dump),l=i;i&&(i=e.flowLevel<0||e.flowLevel>t);var h,u,p="[object Object]"===c||"[object Array]"===c;if(p&&(u=-1!==(h=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||u||2!==e.indent&&t>0)&&(r=!1),u&&e.usedDuplicates[h])e.dump="*ref_"+h;else{if(p&&u&&!e.usedDuplicates[h]&&(e.usedDuplicates[h]=!0),"[object Object]"===c)i&&0!==Object.keys(e.dump).length?(!function(e,t,n,i){var r,s,a,o,c,l,h="",u=e.tag,p=Object.keys(n);if(!0===e.sortKeys)p.sort();else if("function"==typeof e.sortKeys)p.sort(e.sortKeys);else if(e.sortKeys)throw new je("sortKeys must be a boolean or a function");for(r=0,s=p.length;r1024)&&(e.dump&&wn===e.dump.charCodeAt(0)?l+="?":l+="? "),l+=e.dump,c&&(l+=Qn(e,t)),vi(e,t+1,o,!0,c)&&(e.dump&&wn===e.dump.charCodeAt(0)?l+=":":l+=": ",h+=l+=e.dump));e.tag=u,e.dump=h||"{}"}(e,t,e.dump,r),u&&(e.dump="&ref_"+h+e.dump)):(!function(e,t,n){var i,r,s,a,o,c="",l=e.tag,h=Object.keys(n);for(i=0,r=h.length;i1024&&(o+="? "),o+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),vi(e,t,a,!1,!1)&&(c+=o+=e.dump));e.tag=l,e.dump="{"+c+"}"}(e,t,e.dump),u&&(e.dump="&ref_"+h+" "+e.dump));else if("[object Array]"===c)i&&0!==e.dump.length?(e.noArrayIndent&&!a&&t>0?gi(e,t-1,e.dump,r):gi(e,t,e.dump,r),u&&(e.dump="&ref_"+h+e.dump)):(!function(e,t,n){var i,r,s,a="",o=e.tag;for(i=0,r=n.length;i",e.dump=o+" "+e.dump)}return!0}function yi(e,t){var n,i,r=[],s=[];for(bi(e,r,s),n=0,i=s.length;ne.trim())).filter((e=>e.length));for(let t=0;te.trim()));e.style.setProperty(i[0],i[1])}}static setText(e,t,n){e instanceof SVGTextElement||(e=e.querySelector("text")||e);const i=t.replace(/\\n/g,"\n").split("\n"),r=i.length>1,s=e.querySelector("tspan");if(r){const t=null==s?void 0:s.getAttribute("x"),r=null==s?void 0:s.getAttribute("y");t&&!e.getAttribute("x")&&e.setAttribute("x",t),r&&!e.getAttribute("y")&&e.setAttribute("y",r);const a=e.querySelector("tspan")||!1;e.textContent="",e.dataset.ha_floorplan_notice="The text_set function split your text into multiple tspans. Only the style of the first tspan is preserved. The style from the original tspan is reused on every tspan. The x and y are calculated on the basis of the first tspan or text-element.";const o=e.getAttribute("x")||"0",c=n||"1em";i.forEach(((t,n)=>{const i=document.createElementNS("http://www.w3.org/2000/svg","tspan");if(i.textContent=t,i.setAttribute("x",o),i.setAttribute("dy",n>=1?c:"0"),a){const e=a.getAttribute("style");e&&i.setAttribute("style",e)}e.appendChild(i)}))}else{(s||e).textContent=t}}static waitForChildNodes(e,t,n){return new Promise(((i,r)=>{const s=setTimeout((()=>r("Timeout waiting for child element(s) to load")),n);new MutationObserver((e=>{for(const t of e)if("childList"===t.type&&t.addedNodes.length)return clearTimeout(s),i()})).observe(e,{childList:!0,subtree:!0}),t()}))}static formatDate(e){return e?"string"==typeof e?new Date(e).toLocaleString():e.toLocaleString():""}static parseYaml(e){return wi.load(e)}static fetchText(e,t,n,i){return Si(this,void 0,void 0,(function*(){n&&(e=e.replace(/^\/local\/floorplan\/examples\//g,`${n}/`)),e=i?e:_i.cacheBuster(e);const r=new Request(e,{cache:i?"default":"no-store",mode:t?"no-cors":void 0});try{const e=yield fetch(r);if(e.ok||t&&"opaque"===e.type){return yield e.text()}throw new Error("Error fetching resource")}catch(t){throw new URIError(`${e}: ${t.message}`)}}))}static fetchImage(e,t,n,i){return Si(this,void 0,void 0,(function*(){t&&(e=e.replace(/^\/local\/floorplan\/examples\//g,`${n}/`)),e=i?e:_i.cacheBuster(e);const r=new Request(e,{cache:i?"default":"no-store",headers:new Headers({"Content-Type":"text/plain; charset=x-user-defined"}),mode:t?"no-cors":void 0});try{const e=yield fetch(r);if(e.ok||t&&"opaque"===e.type){const t=yield e.arrayBuffer();return`data:image/jpeg;base64,${_i.arrayBufferToBase64(t)}`}throw new Error("Error fetching resource")}catch(t){throw new URIError(`${e}: ${t.message}`)}}))}static singleToArray(e){return null==e?[]:Array.isArray(e)?e:[e]}static getArray(e){if(null==e)return[];if(Array.isArray(e))return e;{const t=e;return Object.values(t)}}static getSet(e){if(Array.isArray(e))return new Set(e);{const t=e;return new Set(Object.values(t))}}static arrayBufferToBase64(e){let t="";[].slice.call(new Uint8Array(e)).forEach((e=>t+=String.fromCharCode(e)));let n=window.btoa(t);for(;n.length%4>0;)n+="=";return n}static cacheBuster(e){return`${e}${e.includes("?")?"&":"?"}_=${(new Date).getTime()}`}static equal(e,t){if(e===t)return!0;const n=Array.isArray(e),i=Array.isArray(t);let r=0;if(n&&i){if(e.length!=t.length)return!1;for(r=0;rMath.floor(1e5*(1+Math.random())).toString(16).substring(1);localStorage[e]=`${t()}${t()}_${t()}${t()}`}return localStorage[e]}}class ki{constructor(e,t,n){this.element=e,this.logLevel=t,this.consoleLogLevel=n,this.logLevelGroups={error:["error"],warn:["error","warning","warn"],warning:["error","warning","warn"],info:["error","warning","warn","info"],debug:["error","warning","warn","info","debug"]}}log(e,t,n=!1){var i;const r=`${_i.formatDate(new Date)} ${e.toUpperCase()} ${t}`,s=this.logLevel&&this.logLevelGroups[this.logLevel.toLowerCase()],a=(null==s?void 0:s.length)&&s.includes(e.toLowerCase());if((n||a)&&this.element){const t=document.createElement("li");_i.addClass(t,e),t.textContent=r,null===(i=this.element.querySelector("ul"))||void 0===i||i.prepend(t),this.element.style.display="block"}this.consoleLog(e,t,n)}consoleLog(e,t,n=!1){const i=`${_i.formatDate(new Date)} ${e.toUpperCase()} ${t}`,r=this.consoleLogLevel&&this.logLevelGroups[this.consoleLogLevel.toLowerCase()],s=(null==r?void 0:r.length)&&r.includes(e.toLowerCase());if(n||s)switch(e){case"error":console.error(i);break;case"warn":case"warning":console.warn(i);break;case"info":console.info(i);break;default:console.log(i)}}}var Ei=function(e,t,n,i){var r,s=arguments.length,a=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,n,a):r(t,n))||a);return s>3&&a&&Object.defineProperty(t,n,a),a},Ai=function(e,t,n,i){return new(n||(n=Promise))((function(r,s){function a(e){try{c(i.next(e))}catch(e){s(e)}}function o(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}c((i=i.apply(e,t||[])).next())}))};const Ci=Se;console.info("%cFloorplan for Home Assistant (ha-floorplan)%c\nVersion 1.0.43","color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: rgb(71, 170, 238)");let Ii=class extends ne{constructor(){super(),this.pageInfos={},this.entityInfos={},this.elementInfos={},this.cssRules=[],this.functions={},this.variables={},this.svgElements={},this.isRulesLoaded=!1,window.onerror=this.handleWindowError.bind(this)}render(){return $` `}static get styles(){return a` :host #floorplan-container { display: flex; flex-flow: column; flex: 1; min-height: 0; } :host #floorplan { display: flex; flex-flow: column; flex: 1; min-height: 0; } :host #log { max-height: 150px; overflow: auto; background-color: #eee; padding: 10px; } :host #log ul { list-style-type: none; padding-left: 0px; text-align: left; } :host svg, :host svg * { /* vector-effect: non-scaling-stroke !important; */ pointer-events: all !important; } ha-circular-progress { margin: auto; } #log { min-height: 100px; max-height: 100px; overflow: auto; background-color: #eee; display: none; padding: 10px; } #log ul { list-style-type: none; padding-left: 0px; text-align: left; } .error { color: #ff0000; } .warning { color: #ff851b; } .info { color: #0000ff; } .debug { color: #000000; } `}clearLog(){this.logElement.querySelector("#log ul").innerHTML=""}updated(e){const t=Object.create(null,{updated:{get:()=>super.updated}});return Ai(this,void 0,void 0,(function*(){t.updated.call(this,e),e.has("_config")&&(yield this._configChanged(),yield this.hassChanged()),e.has("hass")&&(yield this.hassChanged())}))}_configChanged(){return Ai(this,void 0,void 0,(function*(){this._config&&(yield this.init())}))}hassChanged(){return Ai(this,void 0,void 0,(function*(){if(!this.hass||!this.config||!this.svg)return;const e=_i.deviceId();this.hass.states[`sensor.ha_floorplan_${e}`]={entity_id:`sensor.ha_floorplan_${e}`,state:"on",last_changed:(new Date).toString(),last_updated:(new Date).toString(),attributes:{device_class:"ha-floorplan",friendly_name:"ha-floorplan - Floorplan for Home Assistant",icon:"mdi:floor-plan",assumed_state:!1,hidden:!0},context:{}},this.isRulesLoaded?this.handleEntities():(this.initFloorplanRules(this.svg,this.config),this.isRulesLoaded=!0,yield this.handleEntities(!0))}))}get floorplanElement(){var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("floorplan")}get logElement(){var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("log")}init(){return Ai(this,void 0,void 0,(function*(){try{const e=yield this.loadConfig(this._config,!1);if(this.isShowLog=void 0!==e.log_level,this.logger=new ki(this.logElement,e.log_level,e.console_log_level),this.logInfo("INIT","Floorplan for Home Assistant (ha-floorplan) v1.0.43"),!this.validateConfig(e))return;this.config=e,this.config.pages?yield this.initMultiPage():yield this.initSinglePage()}catch(e){this.handleError(e)}}))}initMultiPage(){return Ai(this,void 0,void 0,(function*(){try{yield this.loadPages(),this.initPageDisplay(),this.initVariables(),this.initStartupActions()}catch(e){this.handleError(e)}}))}initSinglePage(){return Ai(this,void 0,void 0,(function*(){try{yield this.loadStyleSheet(this.config.stylesheet);const e=this.getBestImage(this.config);this.svg=yield this.loadFloorplanSvg(e),this.initPageDisplay(),this.initVariables(),this.initStartupActions()}catch(e){this.handleError(e)}}))}loadConfig(e,t){return Ai(this,void 0,void 0,(function*(){if("string"==typeof e){let n;try{n=yield _i.fetchText(e,this.isDemo,this.examplespath,t)}catch(t){throw this.logError("CONFIG",`Error loading config: ${e}`),t}return wi.load(n)}return JSON.parse(JSON.stringify(e))}))}loadScript(e,t){return e?new Promise(((n,i)=>{var r;const s=document.createElement("script");s.src=t?e:_i.cacheBuster(e),s.onload=()=>n(),s.onerror=e=>{i(new URIError(`${e.target.src}`))},null===(r=this.shadowRoot)||void 0===r||r.appendChild(s)})):Promise.resolve()}loadPages(){return Ai(this,void 0,void 0,(function*(){for(const e of this.config.pages)yield this.loadPageConfig(e,this.config.pages.indexOf(e));const e=Object.keys(this.pageInfos).map((e=>this.pageInfos[e]));e.sort(((e,t)=>e.index-t.index));const t=e.find((e=>void 0!==e.config.master_page));if(!t)throw new Error("A master page is required");t.isMaster=!0;const n=e.find((e=>void 0===e.config.master_page));n&&(n.isDefault=!0),yield this.loadPageFloorplanSvg(t,t);const i=e.filter((e=>e!==t));for(const e of i)yield this.loadPageFloorplanSvg(e,t);this.svg=t.svg}))}loadPageConfig(e,t){return Ai(this,void 0,void 0,(function*(){const n=yield this.loadConfig(e,!1),i=this.createPageInfo(n);return i.index=t,i}))}loadPageFloorplanSvg(e,t){return Ai(this,void 0,void 0,(function*(){const n=this.getBestImage(e.config),i=yield this.loadFloorplanSvg(n,e,t);i.id=e.config.page_id,e.svg=i,yield this.loadStyleSheet(e.config.stylesheet),this.initFloorplanRules(e.svg,e.config)}))}getBestImage(e){var t;let n="",i=!0;if("string"==typeof e.image)n=_i.isMobile&&"string"==typeof e.image_mobile?e.image_mobile:e.image;else if(null===(t=e.image)||void 0===t?void 0:t.sizes){e.image.sizes.sort(((e,t)=>t.min_width-e.min_width));for(const t of e.image.sizes)if(screen.width>=t.min_width){n=t.location,i=!0===t.cache;break}}else _i.isMobile&&e.image_mobile?(n=e.image_mobile.location,i=!0===e.image_mobile.cache):(n=e.image.location,i=!0===e.image.cache);return{location:n,cache:i}}createPageInfo(e){const t={config:e};return t.config.rules&&this.config.rules&&(t.config.rules=t.config.rules.concat(this.config.rules)),this.pageInfos[t.config.page_id]=t,t}loadStyleSheet(e){return Ai(this,void 0,void 0,(function*(){const t="string"==typeof e?e:e.location,n="string"!=typeof e&&!0===e.cache;if(!t)return;let i;try{i=yield _i.fetchText(t,this.isDemo,this.examplespath,n)}catch(e){throw this.logError("STYLESHEET",`Error loading stylesheet: ${t}`),e}const r=document.createElement("style"),s=()=>{var e;r.innerHTML=i,null===(e=this.shadowRoot)||void 0===e||e.appendChild(r)};try{yield _i.waitForChildNodes(r,s,1e4)}catch(e){this.logError("STYLESHEET","Error loading stylesheet")}const a=this.getCssRules(r);this.cssRules=this.cssRules.concat(a)}))}getCssRules(e){var t,n,i,r,s,a;let o;if(e.sheet)o=null!==(n=null===(t=e.sheet)||void 0===t?void 0:t.cssRules)&&void 0!==n?n:null===(i=e.sheet)||void 0===i?void 0:i.rules;else{const t=e;t.styleSheet&&(o=null!==(s=null===(r=t.styleSheet)||void 0===r?void 0:r.cssRules)&&void 0!==s?s:null===(a=t.styleSheet)||void 0===a?void 0:a.rules)}return o?_i.getArray(o):[]}loadFloorplanSvg(e,t,n){var i;return Ai(this,void 0,void 0,(function*(){let r;try{r=yield _i.fetchText(e.location,this.isDemo,this.examplespath,e.cache)}catch(t){throw this.logError("IMAGE",`Error loading image: ${e.location}`),t}const s=document.createElement("div");s.innerHTML=r;const a=s.querySelector("svg");if(t&&a.setAttribute("id",t.config.page_id),a.setAttribute("height","100%"),a.setAttribute("width","100%"),a.style.height="100%",a.style.width="100%",a.style.margin="auto",a.style.cursor="default",a.style.opacity="0",a.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),t&&n){const e=n.config.page_id,r=n.config.master_page.content_element;if(t.config.page_id===e)this.floorplanElement.replaceChildren(a);else{const e=this.floorplanElement.querySelector("#"+r),t=Number.parseFloat(a.getAttribute("height")),n=Number.parseFloat(a.getAttribute("width"));a.getAttribute("viewBox")||a.setAttribute("viewBox",`0 0 ${n} ${t}`),a.setAttribute("preserveAspectRatio","xMinYMin meet"),a.setAttribute("height",e.getAttribute("height")),a.setAttribute("width",e.getAttribute("width")),a.setAttribute("x",e.getAttribute("x")),a.setAttribute("y",e.getAttribute("y")),null===(i=e.parentElement)||void 0===i||i.replaceChildren(a)}}else this.floorplanElement.replaceChildren(a);return a}))}loadImage(e,t,n,i,r){return Ai(this,void 0,void 0,(function*(){return e.toLowerCase().includes(".svg")||"svg"===t.svgElement.nodeName||t.svgElement.querySelector("svg")?yield this.loadSvgImage(e,t,n,i,r):yield this.loadBitmapImage(e,t,n,i,r)}))}loadBitmapImage(e,t,n,i,r){return Ai(this,void 0,void 0,(function*(){e=r?e:_i.cacheBuster(e),this.logDebug("IMAGE",`${n} (setting image: ${e})`);let s=t.svgElement;return"image"!==s.nodeName&&(s=this.createImageElement(t.originalSvgElement),t.svgElement=this.replaceElement(t.svgElement,s),this.attachClickHandlers(s,t,n,void 0,i),s.onmouseover=()=>{this.handleEntityIdSetHoverOver(n,t)}),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e),s}))}loadSvgImage(e,t,n,i,r){return Ai(this,void 0,void 0,(function*(){let s;if(null==e?void 0:e.trim().length)try{s=yield _i.fetchText(e,this.isDemo,this.examplespath,r)}catch(t){throw this.logError("IMAGE",`Error loading image: ${e}`),t}else{const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("viewBox","0 0 0 0"),s=e.outerHTML}this.logDebug("IMAGE",`${n} (setting image: ${e})`);const a="g"===t.svgElement.nodeName?t.svgElement:document.createElement("div");a.innerHTML=s;const o=a.querySelector("svg"),c=Number.parseFloat(o.getAttribute("height")),l=Number.parseFloat(o.getAttribute("width"));if(o.getAttribute("viewBox")||o.setAttribute("viewBox",`0 0 ${l} ${c}`),o.id=t.svgElement.id,o.setAttribute("preserveAspectRatio","xMinYMin meet"),null!==t.originalBBox&&(o.setAttribute("height",t.originalBBox.height.toString()),o.setAttribute("width",t.originalBBox.width.toString()),o.setAttribute("x",t.originalBBox.x.toString()),o.setAttribute("y",t.originalBBox.y.toString())),"g"!==t.svgElement.nodeName){const e=t.svgElement.getAttribute("transform");e&&o.setAttribute("transform",e),t.svgElement=this.replaceElement(t.svgElement,o)}return this.attachClickHandlers(o,t,n,void 0,i),t.svgElement.onmouseover=()=>{this.handleEntityIdSetHoverOver(n,t)},o}))}_querySelectorAll(e,t=void 0,n){let i=t?Array.from(e.querySelectorAll(t).values()):[];return i=n?[e].concat(i):i,i}replaceElement(e,t){const n=e.parentElement;for(const n of Array.from(e.classList))t.classList.add(n);return this._querySelectorAll(e,"*",!0).forEach((e=>{Ci.off(e,"click"),Ci.off(e,"longClick"),e.remove()})),e.remove(),null==n||n.appendChild(t),t}initPageDisplay(){if(this.config.pages)for(const e of Object.values(this.pageInfos))e.svg.style.opacity="1",e.svg.style.display=e.isMaster||e.isDefault?"initial":"none";else this.svg.style.opacity="1",this.svg.style.display="block"}initVariables(){if(this.config.variables)for(const e of this.config.variables)this.initVariable(e);if(this.config.pages)for(const e of Object.values(this.pageInfos))if(e.config.variables)for(const t of e.config.variables)this.initVariable(t)}initVariable(e){let t,n;if("string"==typeof e?t=e:(t=e.name,n=e.value,e.value&&(n=this.evaluate(e.value,t,void 0))),!this.entityInfos[t]){const e={entityId:t,ruleInfos:[],lastState:void 0};this.entityInfos[t]=e}this.hass.states[t]||(this.hass.states[t]={entity_id:t,state:n,last_changed:(new Date).toString(),last_updated:(new Date).toString(),attributes:{},context:{}}),this.setVariable(t,n,{},!0)}getActionConfigs(e){var t,n;if(null==e)return[];if(Array.isArray(e)){for(const n of e)n.action=null!==(t=n.action)&&void 0!==t?t:"call-service";return e}return"object"==typeof e?(e.action=null!==(n=e.action)&&void 0!==n?n:"call-service",[e]):"string"==typeof e?e.includes(".")?[{action:"call-service",service:e}]:[{action:e}]:[]}initStartupActions(){if(this.handleActions(this.config.startup_action,void 0,void 0,void 0),this.config.pages)for(const e of Object.values(this.pageInfos))this.handleActions(e.config.startup_action,void 0,void 0,void 0)}initFloorplanRules(e,t){if(!t.rules)return;const n=this._querySelectorAll(e,"*",!0);for(const e of n)e.id&&(this.svgElements[e.id]=e);this.initRules(t,e,n)}initRules(e,t,n){if(e.functions&&(this.functions=this.evaluate(e.functions)),e.defaults){const t=e.defaults;for(const n of e.rules)n.hover_action=void 0===n.hover_action?t.hover_action:n.hover_action,n.tap_action=void 0===n.tap_action?t.tap_action:n.tap_action,n.hold_action=void 0===n.hold_action?t.hold_action:n.hold_action,n.hover_info_filter=void 0===n.hover_info_filter?t.hover_info_filter:n.hover_info_filter}for(const i of e.rules)i.entity||i.entities?this.initEntityRule(i,t,n):(i.element||i.elements)&&this.initElementRule(i,t,n)}initEntityRule(e,t,n){const i=this.initGetEntityRuleEntities(e);for(const r of i){const i=r.entityId;let s=this.entityInfos[i];s||(s={entityId:i,ruleInfos:[],lastState:void 0},this.entityInfos[i]=s);const a=new pe(e);s.ruleInfos.push(a);for(const e of r.elementIds){const r=n.find((t=>t.id===e));if(!r){this.logWarning("CONFIG",`Cannot find element '${e}' in SVG file`);continue}const o=this.addSvgElementToRule(t,r,a);o.svgElement=r,r.querySelector("title")||r.appendChild(document.createElementNS("http://www.w3.org/2000/svg","title")),r.onmouseenter=()=>{this.handleEntitySetHoverOver(s,o)},r.onmouseleave=()=>{this.handleEntitySetHoverOver(s,o)},this.attachClickHandlers(r,o,i,void 0,a)}}}initGetEntityRuleEntities(e){const t=[];e.groups=e.groups?e.groups:[];for(const n of e.groups){const e=this.hass.states[n];if(e)for(const n of e.attributes.entity_id)this.addTargetEntity(n,[n],t);else this.logWarning("CONFIG",`Cannot find '${n}' in Home Assistant groups`)}e.entities=e.entities?e.entities:[],e.entities=e.entity?e.entities.concat(e.entity):e.entities;const n=e.entities.filter((e=>"string"==typeof e));for(const i of n){let n=[];e.elements?n=n.concat(e.elements):e.element?n=n.concat(this.evaluate(e.element,i,void 0)):null!==e.element&&(n=n.concat(i)),this.addTargetEntity(i,n,t)}const i=e.entities.filter((e=>"string"!=typeof e));for(const e of i){const n=e;this.addTargetEntity(n.entity,[n.element],t)}return t}addTargetEntity(e,t,n){const i=this.hass.states[e],r="floorplan"===e.split(".")[0];i||r?n.push({entityId:e,elementIds:t}):this.logWarning("CONFIG",`Cannot find '${e}' in Home Assistant entities`)}initElementRule(e,t,n){if(e.element||e.elements){e.elements=e.elements?e.elements:[],e.elements=e.element?e.elements.concat(e.element):e.elements;for(const i of e.elements){const r=n.find((e=>e.id===i));if(r){let n=this.elementInfos[i];n||(n={ruleInfos:[],lastState:void 0},this.elementInfos[i]=n);const s=new pe(e);n.ruleInfos.push(s);const a=this.addSvgElementToRule(t,r,s);this.attachClickHandlers(r,a,void 0,i,s)}else this.logWarning("CONFIG",`Cannot find '${i}' in SVG file`)}}}attachClickHandlers(e,t,n,i,r){this._querySelectorAll(e,void 0,!0).forEach((s=>{const a=s,o=s===e;if(a.querySelector("title")||a.appendChild(document.createElementNS("http://www.w3.org/2000/svg","title")),r.rule.tap_action||r.rule.double_tap_action){const e=!!r.rule.tap_action&&this.getActionConfigs(r.rule.tap_action),s=!!r.rule.double_tap_action&&this.getActionConfigs(r.rule.double_tap_action),c=!!e&&new de(this,n,i,t,r,e);if(e&&!s&&Ci.on(a,"click",this.onClick.bind(c)),s){const o=!!s&&new de(this,n,i,t,r,s);Ce.observe(a),e&&Ci.on(a,"singleClick",this.onClick.bind(c)),Ci.on(a,"doubleClick",this.onLongClick.bind(o))}a.style&&(a.style.cursor="pointer"),_i.addClass(a,"floorplan-click"+(o?"":"-child"))}if(r.rule.hold_action){const e=this.getActionConfigs(r.rule.hold_action),s=new de(this,n,i,t,r,e);ke.observe(a),Ci.on(a,"longClick",this.onLongClick.bind(s)),a.style&&(a.style.cursor="pointer"),_i.addClass(a,"floorplan-long-click"+(o?"":"-child"))}}))}addSvgElementToRule(e,t,n){const i=t.getBBox?t.getBBox():null,r=new ue(t.id,t,t,i);return n.svgElementInfos[t.id]=r,r}createImageElement(e){const t=document.createElementNS("http://www.w3.org/2000/svg","image");return t.setAttribute("id",e.getAttribute("id")),t.setAttribute("x",e.getAttribute("x")),t.setAttribute("y",e.getAttribute("y")),t.setAttribute("height",e.getAttribute("height")),t.setAttribute("width",e.getAttribute("width")),t}handleEntities(e=!1){return Ai(this,void 0,void 0,(function*(){this.handleElements();const t=this.getChangedEntities(e);for(const e of Object.keys(this.variables))t.add(e);if(t.size)for(const e of t)yield this.handleEntity(e)}))}getChangedEntities(e){const t=new Set,n=Object.keys(this.hass.states),i=_i.deviceId();for(const r of n)if(r!==`sensor.ha_floorplan_${i}`||t.has(r)){const n=this.entityInfos[r];if(n){const i=this.hass.states[r];if(e)this.logDebug("STATE",`${r}: ${i.state} (initial load)`),t.has(r)||t.add(r);else if(n.lastState){const e=i.state;i.last_changed!==n.lastState.last_changed?(this.logDebug("STATE",`${r}: ${e} (last changed ${_i.formatDate(n.lastState.last_changed)})`),t.has(r)||t.add(r)):_i.equal(n.lastState.attributes,i.attributes)||(this.logDebug("STATE",`${r}: attributes (last updated ${_i.formatDate(n.lastState.last_changed)})`),t.has(r)||t.add(r))}}}else t.add(r);return t}handleEntity(e){return Ai(this,void 0,void 0,(function*(){const t=this.hass.states[e],n=this.entityInfos[e];if(n){n.lastState=Object.assign({},t);for(const e of n.ruleInfos){const t=Object.values(e.svgElementInfos);if(t.length)for(const i of t)i.svgElement&&this.handleActions(e.rule.state_action,n.entityId,i,e);else this.handleActions(e.rule.state_action,n.entityId,void 0,e)}}}))}handleElements(){return Ai(this,void 0,void 0,(function*(){for(const e of Object.values(this.elementInfos))for(const t of e.ruleInfos)for(const e of Object.values(t.svgElementInfos))this.handleActions(t.rule.state_action,void 0,e,t)}))}handleEntityIdSetHoverOver(e,t){const n=this.entityInfos[e];n&&this.handleEntitySetHoverOver(n,t)}handleEntitySetHoverOver(e,t){const n=e.entityId,i=this.hass.states[n];for(const n of e.ruleInfos)if(n.rule.hover_action){let r="string"==typeof n.rule.hover_action&&"hover-info"===n.rule.hover_action;if(r=r||"object"==typeof n.rule.hover_action&&"hover-info"===n.rule.hover_action.action,r=r||Array.isArray(n.rule.hover_action)&&n.rule.hover_action.some((e=>"hover-info"===e.action)),r){const e=new Set(n.rule.hover_info_filter);for(const t of Object.values(n.svgElementInfos))_i.addClass(t.svgElement,"floorplan-hover"),t.svgElement.style.cursor="pointer",t.svgElement.querySelectorAll("title").forEach((t=>{let n=`${i.attributes.friendly_name}\n`;n+=`State: ${i.state}\n\n`,Object.keys(i.attributes).map((t=>{e.has(t)||(n+=`${t}: ${i.attributes[t]}\n`)})),n+="\n",n+=`Last changed: ${Me.timeago(i.last_changed)}\n`,n+=`Last updated: ${Me.timeago(i.last_updated)}`,t.textContent=n}))}else n.rule.hover_action&&this.handleActions(n.rule.hover_action,e.entityId,t,n)}}isOptionEnabled(e){return null===e||void 0!==e}validateConfig(e){let t=!0;if(e.pages||e.rules)if(e.pages)e.pages.length||this.logWarning("CONFIG","The 'pages' section must contain one or more pages in floorplan configuration");else{e.rules||this.logWarning("CONFIG","Cannot find 'rules' in floorplan configuration");let n=e.rules.filter((e=>e.entities&&e.elements));n.length&&(this.logError("CONFIG","A rule cannot contain both 'entities' and 'elements' in floorplan configuration"),t=!1),n=e.rules.filter((e=>!(e.entity||e.entities||e.element||e.elements))),n.length&&(this.logError("CONFIG","A rule must contain either 'entities' or 'elements' in floorplan configuration"),t=!1)}else this.logWarning("CONFIG","Cannot find 'pages' nor 'rules' in floorplan configuration");return t}evaluate(e,t,n){if("string"!=typeof e||!De.isCode(e))return e;try{return De.evaluate(e,this.hass,this.config,t,n,this.svgElements,this.functions)}catch(i){return this.handleError(i,{expression:e,entityId:t,hass:this.hass,svgElement:n})}}onClick(e){e.stopPropagation(),e.preventDefault();const t=this;t.instance.handleActions(t.actions,t.entityId,t.svgElementInfo,t.ruleInfo)}onLongClick(e){e.stopPropagation(),e.preventDefault();const t=this,n=t.instance;setTimeout((()=>{n.handleActions(t.actions,t.entityId,t.svgElementInfo,t.ruleInfo)}),300)}handleActions(e,t,n,i){var r;const s=this.getActionConfigs(e);for(const e of s){if(e.confirmation&&(!e.confirmation.exemptions||!e.confirmation.exemptions.some((e=>e.user===this.hass.user.id)))&&!confirm(e.confirmation.text||`Are you sure you want to ${e.action}?`))return;switch(e.action){case"more-info":this.isDemo?this.notify(`Performing action: ${e.action} ${t}`):le(this,"hass-more-info",{entityId:t});break;case"navigate":if(this.isDemo)this.notify(`Performing action: ${e.action} ${e.navigation_path}`);else{const i=this.evaluate(e.navigation_path,t,null==n?void 0:n.svgElement);he(0,i,null!==(r=e.navigation_replace)&&void 0!==r&&r)}break;case"url":if(this.isDemo)this.notify(`Performing action: ${e.action} ${e.url_path}`);else{const i=e.same_tab?"_self":"_blank",r=this.evaluate(e.url_path,t,null==n?void 0:n.svgElement);window.open(r,i)}break;case"toggle":if(t){const e={action:"call-service",service:"homeassistant.toggle",service_data:{entity_id:t}};this.callService(e,t,n,i)}break;case"call-service":if(!e.service)return;this.callService(e,t,n,i);break;case"fire-dom-event":le(this,"ll-custom",e)}}}getSvgElementsFromServiceData(e,t){let n=[],i=[];if(Array.isArray(null==e?void 0:e.elements)&&(i=i.concat(null==e?void 0:e.elements)),"string"==typeof(null==e?void 0:e.element)&&(i=i.concat([null==e?void 0:e.element])),i.length)for(const e of i)n=n.concat(this._querySelectorAll(this.svg,`#${e.replace(/\./g,"\\.")}`,!1));else t&&(n=[t]);return n}getServiceData(e,t,n){let i={};if("object"==typeof e.service_data)for(const r of Object.keys(e.service_data))i[r]=this.evaluate(e.service_data[r],t,n);else if("string"==typeof e.service_data){const r=this.evaluate(e.service_data,t,n);i="string"==typeof r&&r.trim().startsWith("{")?JSON.parse(r):r}else void 0!==e.service_data&&(i=e.service_data);return i}executeServiceData(e,t,n){try{if("object"==typeof e.service_data)for(const i of Object.keys(e.service_data))this.evaluate(e.service_data[i],t,n);else"string"==typeof e.service_data?this.evaluate(e.service_data,t,n):void 0!==e.service_data&&this.logWarning("CONFIG","Invalid execution data");return!0}catch(e){return this.logWarning("CONFIG","Error thrown while executing service"),!1}}callService(e,t,n,i){const r=this.evaluate(e.service,t,null==n?void 0:n.svgElement),[s,a]=r.split(".",2);if("floorplan"===s)this.callFloorplanService(s,a,e,t,n,i);else this.callHomeAssistantService(s,a,e,t,n)}callFloorplanService(e,t,n,i,r,s){var a,o,c;const l=null!==(a=null==r?void 0:r.svgElement)&&void 0!==a?a:void 0;let h,u,p,d,f,g,m,v,y,b=[],x=null;switch(x=!["execute"].includes(t)?this.getServiceData(n,i,l):{},t){case"class_toggle":b=this.getSvgElementsFromServiceData(x,null==r?void 0:r.svgElement);for(const e of b)y=1===b.length&&b[0]===(null==r?void 0:r.svgElement),y||(x=this.getServiceData(n,i,e)),p="string"==typeof x?x:x.class,_i.toggleClass(e,p);break;case"class_set":b=this.getSvgElementsFromServiceData(x,null==r?void 0:r.svgElement);for(const e of b)y=1===b.length&&b[0]===(null==r?void 0:r.svgElement),y||(x=this.getServiceData(n,i,e)),p="string"==typeof x?x:x.class,_i.setClass(e,p);break;case"dataset_set":{let e,t;if("string"==typeof x){const n=x.split(":");if(n.length<2){this.logError("FLOORPLAN_ACTION",`Service data "${x}" is not a valid dataset key value pair.`);break}e=n[1],t=n[0]}else e=x.value,t=x.key;b=this.getSvgElementsFromServiceData(x,null==r?void 0:r.svgElement);for(const s of b)y=1===b.length&&b[0]===(null==r?void 0:r.svgElement),y||(x=this.getServiceData(n,i,s)),_i.datasetSet(s,t,e);break}case"style_set":b=this.getSvgElementsFromServiceData(x,null==r?void 0:r.svgElement);for(const e of b)y=1===b.length&&b[0]===(null==r?void 0:r.svgElement),y||(x=this.getServiceData(n,i,e)),d="string"==typeof x?x:x.style,_i.setStyle(e,d);break;case"text_set":b=this.getSvgElementsFromServiceData(x,null==r?void 0:r.svgElement);for(const e of b){y=1===b.length&&b[0]===(null==r?void 0:r.svgElement),y||(x=this.getServiceData(n,i,e)),v="string"==typeof x?x:x.text;const t=(null===(o=n.service_data)||void 0===o?void 0:o.shift_y_axis)?null===(c=n.service_data)||void 0===c?void 0:c.shift_y_axis:"1em";_i.setText(e,v,t)}break;case"image_set":r&&s&&(x=this.getServiceData(n,i,null==r?void 0:r.svgElement),f="string"==typeof x?x:x.image,g="object"==typeof x?x.image_refresh_interval:0,m=!(g>0)&&("object"!=typeof x||!0===x.cache),s.imageLoader&&clearInterval(s.imageLoader),g&&(s.imageLoader=setInterval(this.loadImage.bind(this),1e3*g,f,r,i,s,m)),this.loadImage(f,r,i,s,m));break;case"page_navigate":x=this.getServiceData(n,i,null==r?void 0:r.svgElement),h=x.page_id,u=h?this.pageInfos[h]:void 0,u&&(Object.keys(this.pageInfos).map((e=>{const t=this.pageInfos[e];t.isMaster||"none"===t.svg.style.display||(t.svg.style.display="none")})),u.svg.style.display="block");break;case"variable_set":if(x=this.getServiceData(n,i,null==r?void 0:r.svgElement),x.variable){const e={};if(x.attributes){const t=x.attributes;for(const n of Object.keys(t))e[n]=this.getActionValue(t[n],i,l)}const t=x,n=this.getActionValue(t,i,l);this.setVariable(x.variable,n,e,!1)}break;case"execute":this.executeServiceData(n,i,null==r?void 0:r.svgElement);for(const e of b)y=1===b.length&&b[0]===(null==r?void 0:r.svgElement),y||this.executeServiceData(n,i,e)}}getActionValue(e,t,n){let i=e.value;return e.value&&(i=this.evaluate(e.value,t,n)),i}setVariable(e,t,n,i){if(this.variables[e]=t,this.hass.states[e]){this.hass.states[e].state=t.toString();for(const t of Object.keys(n))this.hass.states[e].attributes[t]=n[t]}for(const e of Object.keys(this.variables)){const t=this.hass.states[e];t&&(t.last_changed=(new Date).toString())}i||this.handleEntities()}callHomeAssistantService(e,t,n,i,r){const s=this.getServiceData(n,i,null==r?void 0:r.svgElement);"object"==typeof s&&(null===s.entity_id||Array.isArray(s.entity_id)&&!s.entity_id.length||!s.entity_id&&i&&(s.entity_id=i)),this.hass.callService(e,t,s),this.isDemo&&this.notify(`Calling service: ${e}.${t} (${s.entity_id})`)}handleWindowError(e,t,n,i,r){if(e.toLowerCase().includes("script error"))this.logError("SCRIPT","Script error: See browser console for detail");else{const s=[e,"URL: "+t,"Line: "+n+", column: "+i,"Error: "+JSON.stringify(r)].join("
");this.logError("ERROR",s)}return!1}handleError(e,t){console.error(e,t);let n="Error";"string"==typeof e&&(n=e),e.message?n=`${e.message} (See console for more info)`:e.stack&&(n=`${e.stack}`),this.logger.log("error",n)}logError(e,t){this.logger.log("error",`${e} ${t}`)}logWarning(e,t){this.logger.log("warning",`${e} ${t}`)}logInfo(e,t){this.logger.log("info",`${e} ${t}`)}logDebug(e,t){this.logger.log("debug",`${e} ${t}`)}};Ei([ae({type:String})],Ii.prototype,"examplespath",void 0),Ei([ae({type:Object})],Ii.prototype,"hass",void 0),Ei([ae({type:String||Object})],Ii.prototype,"_config",void 0),Ei([ae({type:Boolean})],Ii.prototype,"isDemo",void 0),Ei([ae({type:Boolean})],Ii.prototype,"isShowLog",void 0),Ei([ae({type:Function})],Ii.prototype,"notify",void 0),Ii=Ei([re("floorplan-element")],Ii); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const Ti=1;class Pi{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}} /** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const Mi=(e=>(...t)=>({_$litDirective$:e,values:t}))(class extends Pi{constructor(e){var t;if(super(e),e.type!==Ti||"style"!==e.name||(null===(t=e.strings)||void 0===t?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,n)=>{const i=e[n];return null==i?t:t+`${n=n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(e,[t]){const{style:n}=e.element;if(void 0===this.vt){this.vt=new Set;for(const e in t)this.vt.add(e);return this.render(t)}this.vt.forEach((e=>{null==t[e]&&(this.vt.delete(e),e.includes("-")?n.removeProperty(e):n[e]="")}));for(const e in t){const i=t[e];null!=i&&(this.vt.add(e),e.includes("-")?n.setProperty(e,i):n[e]=i)}return V}});var Ni,Oi=function(e,t,n,i){var r,s=arguments.length,a=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,n,a):r(t,n))||a);return s>3&&a&&Object.defineProperty(t,n,a),a};let Li=Ni=class extends ne{constructor(){super(...arguments),this.styles={dummy:`calc(100vh - ${this.appHeaderHeight}px - ${this.cardHeaderHeight}px)`}}render(){var e,t;return this.config?$` ${this.isDisplayCardHeader?$`

${null===(e=this.config)||void 0===e?void 0:e.title}

`:""}
`:$``}static get styles(){return a` /* header (main toolbar) */ /* --header-height: 56px; */ /* card header */ /* height: 76px; */ :host .content, :host .content floorplan-element { display: flex; flex-flow: column; flex: 1; min-height: 0; } `}get isFullHeight(){var e;return null===(e=this.config)||void 0===e?void 0:e.full_height}get view(){return this._view||(this._view=ce.closestElement("#view",this)),this._view}get appHeader(){var e;return this._appHeader||(this._appHeader=null===(e=this.view)||void 0===e?void 0:e.previousElementSibling),this._appHeader}get appHeaderHeight(){if(this.isDemo)return 0;const e=this.appHeader;return e?e.clientHeight:0}get cardHeaderHeight(){return this.isDemo?0:this.isDisplayCardHeader?Ni.cardHeaderHeight:0}get isDisplayCardHeader(){var e,t;return!this.isDemo&&(null===(t=null===(e=this.config)||void 0===e?void 0:e.title)||void 0===t?void 0:t.trim().length)>0}getCardSize(){return 1}setConfig(e){this.config=e}update(e){this.isFullHeight?this.styles={height:`calc(100vh - ${this.appHeaderHeight}px - ${this.cardHeaderHeight}px)`}:this.styles={dummy:""},super.update(e)}};Li.cardHeaderHeight=76,Oi([ae({type:Object})],Li.prototype,"hass",void 0),Oi([ae({type:Boolean})],Li.prototype,"isPanel",void 0),Oi([ae({type:Boolean})],Li.prototype,"editMode",void 0),Oi([ae({type:Object})],Li.prototype,"config",void 0),Oi([ae({type:String})],Li.prototype,"examplespath",void 0),Oi([ae({type:Boolean})],Li.prototype,"isDemo",void 0),Oi([ae({type:Function})],Li.prototype,"notify",void 0),Li=Ni=Oi([re("floorplan-card")],Li);var Di,Ri=function(e,t,n,i){var r,s=arguments.length,a=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,n,a):r(t,n))||a);return s>3&&a&&Object.defineProperty(t,n,a),a};let $i=Di=class extends ne{constructor(){super(...arguments),this.styles={height:"calc(100vh)"}}render(){var e,t,n;return $`
${null===(e=this.panel)||void 0===e?void 0:e.title}
`}static get styles(){return a` :host .content, :host .content floorplan-element { display: flex; flex-flow: column; flex: 1; min-height: 0; } [hidden] { display: none !important; } `}get appHeaderHeight(){return this.isDemo?0:this.showAppHeader?Di.appHeaderHeight:0}update(e){this.panel&&(this.showSideBar=!1!==this.panel.config.show_side_bar,this.showAppHeader=!1!==this.panel.config.show_app_header&&!this.isDemo,this.hass&&!1===this.panel.config.show_side_bar&&(this.hass.dockedSidebar="always_hidden"),this.styles={height:`calc(100vh - ${this.appHeaderHeight}px)`}),super.update(e)}};$i.appHeaderHeight=64,Ri([ae({type:Object})],$i.prototype,"hass",void 0),Ri([ae({type:Boolean})],$i.prototype,"narrow",void 0),Ri([ae({type:Object})],$i.prototype,"panel",void 0),Ri([ae({type:Boolean})],$i.prototype,"showSideBar",void 0),Ri([ae({type:Boolean})],$i.prototype,"showAppHeader",void 0),Ri([ae({type:String})],$i.prototype,"examplespath",void 0),Ri([ae({type:Boolean})],$i.prototype,"isDemo",void 0),Ri([ae({type:Function})],$i.prototype,"notify",void 0),$i=Di=Ri([re("floorplan-panel")],$i)})()})();