diff --git a/dist/floorplan-examples.js b/dist/floorplan-examples.js index 4215f239..224fe2cd 100644 --- a/dist/floorplan-examples.js +++ b/dist/floorplan-examples.js @@ -51,7 +51,7 @@ const re=e=>t=>"function"==typeof t?((e,t)=>(customElements.define(e,t),t))(e,t) */ var oe;null===(oe=window.HTMLSlotElement)||void 0===oe||oe.prototype.assignedElements;class ce{constructor(){this.states={}}callWS(e){return console.log(e),Promise.resolve(null)}callService(e,t,i){const n={context:{id:"",parent_id:void 0,user_id:void 0}};return Promise.resolve(n)}clone(){const e=new ce;return e.callService=this.callService,e.states=JSON.parse(JSON.stringify(this.states)),e}}class le{}let he=/(-?(?:\d+\.?\d*|\d*\.?\d+)(?:e[-+]?\d+)?)\s*([\p{L}]*)/giu;function ue(e="",t="ms"){var i=null;return(e=(e+"").replace(/(\d)[,_](\d)/g,"$1$2")).replace(he,(function(e,t,n){(n=pe(n))&&(i=(i||0)+parseFloat(t,10)*n)})),i&&i/(pe(t)||1)}function pe(e){return ue[e]||ue[e.toLowerCase().replace(/s$/,"")]}ue.nanosecond=ue.ns=1e-6,ue["µs"]=ue["μs"]=ue.us=ue.microsecond=.001,ue.millisecond=ue.ms=ue[""]=1,ue.second=ue.sec=ue.s=1e3*ue.ms,ue.minute=ue.min=ue.m=60*ue.s,ue.hour=ue.hr=ue.h=60*ue.m,ue.day=ue.d=24*ue.h,ue.week=ue.wk=ue.w=7*ue.d,ue.month=ue.b=30.4375*ue.d,ue.year=ue.yr=ue.y=365.25*ue.d;const de=ue;class fe{static miredToRGB(e){return this.kelvinToRGB(1e6/e)}static kelvinToRGB(e){const t=e/100;let i,n,r;return t<=66?(i=255,n=t,n=99.4708025861*Math.log(n)-161.1195681661,t<=19?r=0:(r=t-10,r=138.5177312231*Math.log(r)-305.0447927307)):(i=t-60,i=329.698727446*Math.pow(i,-.1332047592),n=t-60,n=288.1221695283*Math.pow(n,-.0755148492),r=255),[Math.min(Math.max(Math.round(i),0),255),Math.min(Math.max(Math.round(n),0),255),Math.min(Math.max(Math.round(r),0),255)]}}var me,ge=i(1),ve=i.n(ge);class ye{static timeago(e){let t="second",i=0;const n=("string"==typeof e?new Date(e):e).getTime()-(new Date).getTime(),r=n/this.MILLISECONDS_IN_YEAR;if(Math.abs(r)>=1)t="year",i=r;else{const e=n/this.MILLISECONDS_IN_DAY;if(Math.abs(e)>=1)t="day",i=e;else{const e=n/this.MILLISECONDS_IN_HOUR;if(Math.abs(e)>=1)t="hour",i=e;else{const e=n/this.MILLISECONDS_IN_MINUTE;if(Math.abs(e)>=1)t="minute",i=e;else{t="second",i=n/this.MILLISECONDS_IN_SECOND}}}}return this.relativeTimeFormat.format(Math.round(i),t)}}ye.strftime=ve(),ye.MILLISECONDS_IN_SECOND=1e3,ye.MILLISECONDS_IN_MINUTE=6e4,ye.MILLISECONDS_IN_HOUR=36e5,ye.MILLISECONDS_IN_DAY=864e5,ye.MILLISECONDS_IN_YEAR=31536e6,ye.relativeTimeFormat=new Intl.RelativeTimeFormat(null!==(me=navigator.language)&&void 0!==me?me:"en",{numeric:"auto",style:"long"});var be=i(449),xe=i.n(be);function we(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 Se{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){var i;this.expression=e.trim();const n=`${this.expression}_${null!==(i=t.entity_id)&&void 0!==i?i:""}`;this.parsedFunction=this.cache[n],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[n]=this.parsedFunction,this.interpreter.import("util",this.util)),this.entityState=t,this.interpreter.import("entity",this.entityState);try{this.interpreter.run(this.parsedFunction)}catch(e){throw new EvalError(we(e))}return this.interpreter.exports.result}}Se.cache={},Se.interpreter=new(xe())({ecmaVer:2019,sandBox:!0}),Se.util={color:fe,date:ye};class _e{constructor(e,t){this.hassChanged=t,this.simulationProcessors=[],this.hass=new ce,this.hass.callService=this.callService.bind(this);for(const t of e.simulations){const e=new ke(t,this.hass,this.onEntityStatesChanged.bind(this));this.simulationProcessors.push(e)}}onEntityStatesChanged(e){for(const t of e)this.hass.states[t.entity_id]=t;this.hassChanged(this.hass.clone())}callService(e,t,i){switch(console.log("HassSimulator.callService()",e,t,i),e){case"homeassistant":case"light":case"fan":if("toggle"===t)this.homeAssistantToggle(i);break;case"media_player":switch(t){case"volume_up":this.homeAssistantVolumeUp(i);break;case"volume_down":this.homeAssistantVolumeDown(i)}}const n={context:{id:"",parent_id:void 0,user_id:void 0}};return Promise.resolve(n)}homeAssistantToggle(e){if(e.entity_id){const t=e.entity_id.split(".")[0],i=this.hass.states[e.entity_id];switch(t){case"switch":case"light":case"fan":case"binary_sensor":case"sensor":case"media_player":i.state="on"===i.state?"off":"on";for(const t of this.simulationProcessors)t.updateEntityState(e.entity_id,i)}}}homeAssistantVolumeUp(e){if(e.entity_id){const t=e.entity_id.split(".")[0],i=this.hass.states[e.entity_id];let n;if("media_player"===t){n=i.attributes.volume_level,i.attributes.volume_level=Math.min(1,n+.1);for(const t of this.simulationProcessors)t.updateEntityState(e.entity_id,i)}}}homeAssistantVolumeDown(e){if(e.entity_id){const t=e.entity_id.split(".")[0],i=this.hass.states[e.entity_id];let n;if("media_player"===t){n=i.attributes.volume_level,i.attributes.volume_level=Math.max(0,n-.1);for(const t of this.simulationProcessors)t.updateEntityState(e.entity_id,i)}}}}class ke{constructor(e,t,i){var n,r;this.simulation=e,this.hass=t,this.onEntityStatesChanged=i,this.currentIndex=0,this.entities=[],this.simulation.entities&&(this.entities=this.entities.concat(this.simulation.entities)),this.simulation.entity&&(this.entities=this.entities.concat(this.simulation.entity)),this.entities.length||console.error("Simulation must contain at least one entity",e),(null===(n=this.simulation.states)||void 0===n?void 0:n.length)||this.simulation.state||console.error("Simulation must contain at least one state",e),this.triggerState(null!==(r=this.simulation.state)&&void 0!==r?r:this.simulation.states[0])}triggerState(e){var t;if(this.simulation.enabled||void 0===this.simulation.enabled)for(const t of this.entities)this.updateEntityState(t,e);if(this.simulation.states){let i;if("string"==typeof this.simulation.states){const e=null!==(t=this.simulation.state)&&void 0!==t?t:{entity_id:this.simulation.entity};i=Se.evaluate(this.simulation.states,e),this.simulation.state=i}else{const t=(this.simulation.states.indexOf(e)+1)%this.simulation.states.length;i=this.simulation.states[t]}if(null==i?void 0:i.duration){const t=e,n="number"==typeof t.duration?1e3*t.duration:de(t.duration);setTimeout(this.triggerState.bind(this),n,i)}}}updateEntityState(e,t){var i,n,r;const s="string"==typeof e?e:e.entity_id,a=this.hass.states[s];let o;a?(o=Object.assign({},a),o.attributes=Object.assign({},a.attributes)):(o=new le,o.entity_id=s),"string"==typeof t?o.state="string"==typeof t?t:t.state:"object"==typeof t&&(o.state=t.state,t.attributes&&(o.attributes=Object.assign({},o.attributes,t.attributes))),o.attributes=null!==(i=o.attributes)&&void 0!==i?i:{},o.attributes.friendly_name=null!==(r=null===(n=o.attributes)||void 0===n?void 0:n.friendly_name)&&void 0!==r?r:s,o.last_changed=(new Date).toString(),o.last_updated=(new Date).toString(),this.onEntityStatesChanged([o])}} /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ -function Ee(e){return null==e}var Ae={isNothing:Ee,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:Ee(e)?[]:[e]},repeat:function(e,t){var i,n="";for(i=0;io&&(t=n-o+(s=" ... ").length),i-n>o&&(i=n+o-(a=" ...").length),{str:s+e.slice(t,i).replace(/\t/g,"→")+a,pos:n-t+s.length}}function Oe(e,t){return Ae.repeat(" ",t-e.length)+e}var Ne=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 i,n=/\r?\n|\r|\0/g,r=[0],s=[],a=-1;i=n.exec(e.buffer);)s.push(i.index),r.push(i.index+i[0].length),e.position<=i.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=Pe(e.buffer,r[a-o],s[a-o],e.position-(r[a]-r[a-o]),u),l=Ae.repeat(" ",t.indent)+Oe((e.line-o+1).toString(),h)+" | "+c.str+"\n"+l;for(c=Pe(e.buffer,r[a],s[a],e.position,u),l+=Ae.repeat(" ",t.indent)+Oe((e.line+1).toString(),h)+" | "+c.str+"\n",l+=Ae.repeat("-",t.indent+h+3+c.pos)+"^\n",o=1;o<=t.linesAfter&&!(a+o>=s.length);o++)c=Pe(e.buffer,r[a+o],s[a+o],e.position-(r[a]-r[a+o]),u),l+=Ae.repeat(" ",t.indent)+Oe((e.line+o+1).toString(),h)+" | "+c.str+"\n";return l.replace(/\n$/,"")},Me=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Le=["scalar","sequence","mapping"];var De=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===Me.indexOf(t))throw new Te('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(i){e[i].forEach((function(e){t[String(e)]=i}))})),t}(t.styleAliases||null),-1===Le.indexOf(this.kind))throw new Te('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function $e(e,t){var i=[];return e[t].forEach((function(e){var t=i.length;i.forEach((function(i,n){i.tag===e.tag&&i.kind===e.kind&&i.multi===e.multi&&(t=n)})),i[t]=e})),i}function Re(e){return this.extend(e)}Re.prototype.extend=function(e){var t=[],i=[];if(e instanceof De)i.push(e);else if(Array.isArray(e))i=i.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new Te("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(i=i.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof De))throw new Te("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new Te("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 Te("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),i.forEach((function(e){if(!(e instanceof De))throw new Te("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var n=Object.create(Re.prototype);return n.implicit=(this.implicit||[]).concat(t),n.explicit=(this.explicit||[]).concat(i),n.compiledImplicit=$e(n,"implicit"),n.compiledExplicit=$e(n,"explicit"),n.compiledTypeMap=function(){var e,t,i={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function n(e){e.multi?(i.multi[e.kind].push(e),i.multi.fallback.push(e)):i[e.kind][e.tag]=i.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"]}}),Je=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var Xe=/^[-+]?[0-9]+e/;var Ke=new De("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!Je.test(e)||"_"===e[e.length-1])},construct:function(e){var t,i;return i="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===i?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:i*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||Ae.isNegativeZero(e))},represent:function(e,t){var i;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(Ae.isNegativeZero(e))return"-0.0";return i=e.toString(10),Xe.test(i)?i.replace("e",".e"):i},defaultStyle:"lowercase"}),Qe=Ue.extend({implicit:[He,qe,Ge,Ke]}),Ze=Qe,et=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),tt=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 it=new De("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==et.exec(e)||null!==tt.exec(e))},construct:function(e){var t,i,n,r,s,a,o,c,l=0,h=null;if(null===(t=et.exec(e))&&(t=tt.exec(e)),null===t)throw new Error("Date resolve error");if(i=+t[1],n=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(i,n,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(i,n,r,s,a,o,l)),h&&c.setTime(c.getTime()-h),c},instanceOf:Date,represent:function(e){return e.toISOString()}});var nt=new De("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),rt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var st=new De("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,i,n=0,r=e.length,s=rt;for(i=0;i64)){if(t<0)return!1;n+=6}return n%8==0},construct:function(e){var t,i,n=e.replace(/[\r\n=]/g,""),r=n.length,s=rt,a=0,o=[];for(t=0;t>16&255),o.push(a>>8&255),o.push(255&a)),a=a<<6|s.indexOf(n.charAt(t));return 0===(i=r%4*6)?(o.push(a>>16&255),o.push(a>>8&255),o.push(255&a)):18===i?(o.push(a>>10&255),o.push(a>>2&255)):12===i&&o.push(a>>4&255),new Uint8Array(o)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,i,n="",r=0,s=e.length,a=rt;for(t=0;t>18&63],n+=a[r>>12&63],n+=a[r>>6&63],n+=a[63&r]),r=(r<<8)+e[t];return 0===(i=s%3)?(n+=a[r>>18&63],n+=a[r>>12&63],n+=a[r>>6&63],n+=a[63&r]):2===i?(n+=a[r>>10&63],n+=a[r>>4&63],n+=a[r<<2&63],n+=a[64]):1===i&&(n+=a[r>>2&63],n+=a[r<<4&63],n+=a[64],n+=a[64]),n}}),at=Object.prototype.hasOwnProperty,ot=Object.prototype.toString;var ct=new De("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,i,n,r,s,a=[],o=e;for(t=0,i=o.length;t>10),56320+(e-65536&1023))}for(var Rt=new Array(256),jt=new Array(256),Bt=0;Bt<256;Bt++)Rt[Bt]=Dt(Bt)?1:0,jt[Bt]=Dt(Bt);function Vt(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||dt,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 Ft(e,t){var i={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return i.snippet=Ne(i),new Te(t,i)}function Ut(e,t){throw Ft(e,t)}function Ht(e,t){e.onWarning&&e.onWarning.call(null,Ft(e,t))}var qt={YAML:function(e,t,i){var n,r,s;null!==e.version&&Ut(e,"duplication of %YAML directive"),1!==i.length&&Ut(e,"YAML directive accepts exactly one argument"),null===(n=/^([0-9]+)\.([0-9]+)$/.exec(i[0]))&&Ut(e,"ill-formed argument of the YAML directive"),r=parseInt(n[1],10),s=parseInt(n[2],10),1!==r&&Ut(e,"unacceptable YAML version of the document"),e.version=i[0],e.checkLineBreaks=s<2,1!==s&&2!==s&&Ht(e,"unsupported YAML version of the document")},TAG:function(e,t,i){var n,r;2!==i.length&&Ut(e,"TAG directive accepts exactly two arguments"),n=i[0],r=i[1],Et.test(n)||Ut(e,"ill-formed tag handle (first argument) of the TAG directive"),ft.call(e.tagMap,n)&&Ut(e,'there is a previously declared suffix for "'+n+'" tag handle'),At.test(r)||Ut(e,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(t){Ut(e,"tag prefix is malformed: "+r)}e.tagMap[n]=r}};function zt(e,t,i,n){var r,s,a,o;if(t1&&(e.result+=Ae.repeat("\n",t-1))}function Qt(e,t){var i,n,r=e.tag,s=e.anchor,a=[],o=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),n=e.input.charCodeAt(e.position);0!==n&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,Ut(e,"tab characters must not be used in indentation")),45===n)&&Pt(e.input.charCodeAt(e.position+1));)if(o=!0,e.position++,Jt(e,!0,-1)&&e.lineIndent<=t)a.push(null),n=e.input.charCodeAt(e.position);else if(i=e.line,ti(e,t,vt,!1,!0),a.push(e.result),Jt(e,!0,-1),n=e.input.charCodeAt(e.position),(e.line===i||e.lineIndent>t)&&0!==n)Ut(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),ti(e,t,yt,!0,r)&&(v?m=e.result:g=e.result),v||(Yt(e,p,d,f,m,g,a,o,c),f=m=g=null),Jt(e,!0,-1),l=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&0!==l)Ut(e,"bad indentation of a mapping entry");else if(e.lineIndent=0))break;0===r?Ut(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?Ut(e,"repeat of an indentation width identifier"):(l=t+r-1,c=!0)}if(Tt(s)){do{s=e.input.charCodeAt(++e.position)}while(Tt(s));if(35===s)do{s=e.input.charCodeAt(++e.position)}while(!It(s)&&0!==s)}for(;0!==s;){for(Gt(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!c||e.lineIndentl&&(l=e.lineIndent),It(s))h++;else{if(e.lineIndent0){for(r=a,s=0;r>0;r--)(a=Nt(o=e.input.charCodeAt(++e.position)))>=0?s=(s<<4)+a:Ut(e,"expected hexadecimal character");e.result+=$t(s),e.position++}else Ut(e,"unknown escape sequence");i=n=e.position}else It(o)?(zt(e,i,n,!0),Kt(e,Jt(e,!1,t)),i=n=e.position):e.position===e.lineStart&&Xt(e)?Ut(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}Ut(e,"unexpected end of the stream within a double quoted scalar")}(e,p)?g=!0:!function(e){var t,i,n;if(42!==(n=e.input.charCodeAt(e.position)))return!1;for(n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!Pt(n)&&!Ot(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Ut(e,"name of an alias node must contain at least one character"),i=e.input.slice(t,e.position),ft.call(e.anchorMap,i)||Ut(e,'unidentified alias "'+i+'"'),e.result=e.anchorMap[i],Jt(e,!0,-1),!0}(e)?function(e,t,i){var n,r,s,a,o,c,l,h,u=e.kind,p=e.result;if(Pt(h=e.input.charCodeAt(e.position))||Ot(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)&&(Pt(n=e.input.charCodeAt(e.position+1))||i&&Ot(n)))return!1;for(e.kind="scalar",e.result="",r=s=e.position,a=!1;0!==h;){if(58===h){if(Pt(n=e.input.charCodeAt(e.position+1))||i&&Ot(n))break}else if(35===h){if(Pt(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&Xt(e)||i&&Ot(h))break;if(It(h)){if(o=e.line,c=e.lineStart,l=e.lineIndent,Jt(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&&(zt(e,r,s,!1),Kt(e,e.line-o),r=s=e.position,a=!1),Tt(h)||(s=e.position+1),h=e.input.charCodeAt(++e.position)}return zt(e,r,s,!1),!!e.result||(e.kind=u,e.result=p,!1)}(e,p,mt===i)&&(g=!0,null===e.tag&&(e.tag="?")):(g=!0,null===e.tag&&null===e.anchor||Ut(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===f&&(g=o&&Qt(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&&Ut(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&&Ut(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)):Ut(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||g}function ii(e){var t,i,n,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))&&(Jt(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&&!Pt(r);)r=e.input.charCodeAt(++e.position);for(n=[],(i=e.input.slice(t,e.position)).length<1&&Ut(e,"directive name must not be less than one character in length");0!==r;){for(;Tt(r);)r=e.input.charCodeAt(++e.position);if(35===r){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&!It(r));break}if(It(r))break;for(t=e.position;0!==r&&!Pt(r);)r=e.input.charCodeAt(++e.position);n.push(e.input.slice(t,e.position))}0!==r&&Gt(e),ft.call(qt,i)?qt[i](e,i,n):Ht(e,'unknown document directive "'+i+'"')}Jt(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,Jt(e,!0,-1)):a&&Ut(e,"directives end mark is expected"),ti(e,e.lineIndent-1,yt,!1,!0),Jt(e,!0,-1),e.checkLineBreaks&&_t.test(e.input.slice(s,e.position))&&Ht(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Xt(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,Jt(e,!0,-1)):e.position=55296&&n<=56319&&t+1=56320&&i<=57343?1024*(n-55296)+i-56320+65536:n}function Wi(e){return/^\n* /.test(e)}var Yi=1,Gi=2,Ji=3,Xi=4,Ki=5;function Qi(e,t,i,n,r,s,a,o){var c,l=0,h=null,u=!1,p=!1,d=-1!==n,f=-1,m=function(e){return Ui(e)&&e!==oi&&!Fi(e)&&e!==xi&&e!==ki&&e!==wi&&e!==bi&&e!==Ai&&e!==Ci&&e!==Ti&&e!==Oi&&e!==fi&&e!==gi&&e!==yi&&e!==pi&&e!==Pi&&e!==Si&&e!==_i&&e!==vi&&e!==di&&e!==mi&&e!==Ei&&e!==Ii}(zi(e,0))&&function(e){return!Fi(e)&&e!==wi}(zi(e,e.length-1));if(t||a)for(c=0;c=65536?c+=2:c++){if(!Ui(l=zi(e,c)))return Ki;m=m&&qi(l,h,o),h=l}else{for(c=0;c=65536?c+=2:c++){if((l=zi(e,c))===li)u=!0,d&&(p=p||c-f-1>n&&" "!==e[f+1],f=c);else if(!Ui(l))return Ki;m=m&&qi(l,h,o),h=l}p=p||d&&c-f-1>n&&" "!==e[f+1]}return u||p?i>9&&Wi(e)?Ki:a?s===Ri?Ki:Gi:p?Xi:Ji:!m||a||r(e)?s===Ri?Ki:Gi:Yi}function Zi(e,t,i,n,r){e.dump=function(){if(0===t.length)return e.quotingType===Ri?'""':"''";if(!e.noCompatMode&&(-1!==Mi.indexOf(t)||Li.test(t)))return e.quotingType===Ri?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,i),a=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),o=n||e.flowLevel>-1&&i>=e.flowLevel;switch(Qi(t,o,e.indent,a,(function(t){return function(e,t){var i,n;for(i=0,n=e.implicitTypes.length;i"+en(t,e.indent)+tn(Bi(function(e,t){var i,n,r=/(\n+)([^\n]*)/g,s=(o=e.indexOf("\n"),o=-1!==o?o:e.length,r.lastIndex=o,nn(e.slice(0,o),t)),a="\n"===e[0]||" "===e[0];var o;for(;n=r.exec(e);){var c=n[1],l=n[2];i=" "===l[0],s+=c+(a||i||""===l?"":"\n")+nn(l,t),a=i}return s}(t,a),s));case Ki:return'"'+function(e){for(var t,i="",n=0,r=0;r=65536?r+=2:r++)n=zi(e,r),!(t=Ni[n])&&Ui(n)?(i+=e[r],n>=65536&&(i+=e[r+1])):i+=t||Di(n);return i}(t)+'"';default:throw new Te("impossible error: invalid scalar style")}}()}function en(e,t){var i=Wi(e)?String(t):"",n="\n"===e[e.length-1];return i+(n&&("\n"===e[e.length-2]||"\n"===e)?"+":n?"":"-")+"\n"}function tn(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function nn(e,t){if(""===e||" "===e[0])return e;for(var i,n,r=/ [^ ]/g,s=0,a=0,o=0,c="";i=r.exec(e);)(o=i.index)-s>t&&(n=a>s?a:o,c+="\n"+e.slice(s,n),s=n+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 rn(e,t,i,n){var r,s,a,o="",c=e.tag;for(r=0,s=i.length;r tag resolver accepts not "'+c+'" style');n=o.represent[c](t,c)}e.dump=n}return!0}return!1}function an(e,t,i,n,r,s,a){e.tag=null,e.dump=i,sn(e,i,!1)||sn(e,i,!0);var o,c=si.call(e.dump),l=n;n&&(n=e.flowLevel<0||e.flowLevel>t);var h,u,p="[object Object]"===c||"[object Array]"===c;if(p&&(u=-1!==(h=e.duplicates.indexOf(i))),(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)n&&0!==Object.keys(e.dump).length?(!function(e,t,i,n){var r,s,a,o,c,l,h="",u=e.tag,p=Object.keys(i);if(!0===e.sortKeys)p.sort();else if("function"==typeof e.sortKeys)p.sort(e.sortKeys);else if(e.sortKeys)throw new Te("sortKeys must be a boolean or a function");for(r=0,s=p.length;r1024)&&(e.dump&&li===e.dump.charCodeAt(0)?l+="?":l+="? "),l+=e.dump,c&&(l+=Vi(e,t)),an(e,t+1,o,!0,c)&&(e.dump&&li===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,i){var n,r,s,a,o,c="",l=e.tag,h=Object.keys(i);for(n=0,r=h.length;n1024&&(o+="? "),o+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),an(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)n&&0!==e.dump.length?(e.noArrayIndent&&!a&&t>0?rn(e,t-1,e.dump,r):rn(e,t,e.dump,r),u&&(e.dump="&ref_"+h+e.dump)):(!function(e,t,i){var n,r,s,a="",o=e.tag;for(n=0,r=i.length;n",e.dump=o+" "+e.dump)}return!0}function on(e,t){var i,n,r=[],s=[];for(cn(e,r,s),i=0,n=s.length;ie.trim())).filter((e=>e.length));for(let t=0;te.trim()));e.style.setProperty(n[0],n[1])}}static setText(e,t,i){e instanceof SVGTextElement||(e=e.querySelector("text")||e);const n=t.replace(/\\n/g,"\n").split("\n"),r=n.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 splitted 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 basis of the first tspan or text-element.";const o=e.getAttribute("x")||"0",c=i||"1em";n.forEach(((t,i)=>{const n=document.createElementNS("http://www.w3.org/2000/svg","tspan");if(n.textContent=t,n.setAttribute("x",o),n.setAttribute("dy",i>=1?c:"0"),a){const e=a.getAttribute("style");e&&n.setAttribute("style",e)}e.appendChild(n)}))}else{(s||e).textContent=t}}static waitForChildNodes(e,t,i){return new Promise(((n,r)=>{const s=setTimeout((()=>r("Timeout waiting for child element(s) to load")),i);new MutationObserver((e=>{for(const t of e)if("childList"===t.type&&t.addedNodes.length)return clearTimeout(s),n()})).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 hn.load(e)}static fetchText(e,t,i,n){return un(this,void 0,void 0,(function*(){i&&(e=e.replace(/^\/local\/floorplan\/examples\//g,`${i}/`)),e=n?e:pn.cacheBuster(e);const r=new Request(e,{cache:n?"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,i,n){return un(this,void 0,void 0,(function*(){t&&(e=e.replace(/^\/local\/floorplan\/examples\//g,`${i}/`)),e=n?e:pn.cacheBuster(e);const r=new Request(e,{cache:n?"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,${pn.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 i=window.btoa(t);for(;i.length%4>0;)i+="=";return i}static cacheBuster(e){return`${e}${e.includes("?")?"&":"?"}_=${(new Date).getTime()}`}static equal(e,t){if(e===t)return!0;const i=Array.isArray(e),n=Array.isArray(t);let r=0;if(i&&n){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 dn{static closestElement(e,t){return function t(i){if(!i||i===document||i===window)return null;i.assignedSlot&&(i=i.assignedSlot);const n=i.closest(e);return n||t(i.getRootNode().host)}(t)}}const fn=(e,t,i,n)=>{n=n||{},i=null==i?{}:i;const r=new Event(t,{bubbles:void 0===n.bubbles||n.bubbles,cancelable:Boolean(n.cancelable),composed:void 0===n.composed||n.composed});return r.detail=i,e.dispatchEvent(r),r},mn=(e,t,i=!1)=>{i?history.replaceState(null,"",t):history.pushState(null,"",t),fn(window,"location-changed",{replace:i})};class gn{constructor(e,t,i,n){this.entityId=e,this.svgElement=t,this.originalSvgElement=i,this.originalBBox=n}}class vn{constructor(e){this.rule=e,this.svgElementInfos={}}}class yn{constructor(e,t,i,n,r,s){this.instance=e,this.entityId=t,this.elementId=i,this.svgElementInfo=n,this.ruleInfo=r,this.actions=s}}const bn={},xn={};xn.click=xn.mousedown=xn.mouseup=xn.mousemove="MouseEvents";let wn=1;function Sn(e){return e._dtId||(e._dtId=wn++)}function _n(e){const t=e.indexOf(".");return t>0?{e:e.substring(0,e.indexOf(".")),ns:e.substring(t+1,e.length)}:{e}}function kn(e,t,i,n){const r=_n(i).e;if(!e._dtId)return!1;const s=bn[Sn(e)],a=function(e,t,i,n){return i=_n(i),(bn[Sn(e)]||[]).filter((e=>e&&(!i.e||e.e===i.e)&&(!i.ns||e.ns===i.ns)&&(!n||e.callback===n)&&(!t||e.selector===t)))}(e,t,i,n);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 En(e,t,i,n,r,s){const a=_n(i).e,o=_n(i).ns;e.addEventListener?e.addEventListener(a,r||n,s):e.attachEvent&&e.attachEvent("on"+a,r||n);const c=Sn(e);(bn[c]||(bn[c]=[])).push({delegator:r,callback:n,e:a,ns:o,selector:t})}const An={on(e,t,i,n=null){En(e,null,t,i,null,n)},off(e,t,i=null){kn(e,null,t,i)},once(e,t,i){const n=e=>(An.off(e.currentTarget,e.type,n),i(e));this.on(e,t,n)},delegate(e,t,i,n,r=null){En(e,t,i,n,(function(i){const r=e.querySelectorAll(t);let s=!1;for(let e=0;e{i=!1,t=setTimeout((()=>{i=!0,e.dispatchEvent(new Event("longClick"))}),400)},r=n=>{clearTimeout(t),i||e.dispatchEvent(new Event("short"+n.type[0].toUpperCase()+n.type.slice(1)))},s=e=>{i&&(e.preventDefault(),e.stopImmediatePropagation&&e.stopImmediatePropagation())};In.on(e,"mousedown",n.bind(this)),In.on(e,"tapstart",n.bind(this)),In.on(e,"touchstart",n.bind(this),{passive:!0}),In.on(e,"click",r.bind(this)),In.on(e,"mouseup",r.bind(this)),In.on(e,"tapend",r.bind(this)),In.on(e,"touchend",r.bind(this)),In.on(e,"tap",s.bind(this)),In.on(e,"touch",s.bind(this)),In.on(e,"mouseup",s.bind(this)),In.on(e,"tapend",s.bind(this)),In.on(e,"touchend",s.bind(this)),In.on(e,"click",(e=>{e.preventDefault(),e.stopImmediatePropagation&&e.stopImmediatePropagation()}).bind(this))}}const Pn=Cn,On=new Set;class Nn{static observe(e){if(On.has(e))return;On.add(e);let t,i=0;Pn.on(e,"click",(()=>{i++,t=setTimeout((()=>{1===i&&(i=0,e.dispatchEvent(new Event("singleClick")))}),400),2===i&&(clearTimeout(t),i=0,e.dispatchEvent(new Event("doubleClick")))}).bind(this))}}class Mn{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,i,n,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",i),this.interpreter.import("util",this.util)),this.entityState=n?t.states[n]: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(we(e))}return this.interpreter.exports.result}}Mn.cache={},Mn.interpreter=new(xe())({ecmaVer:2019,sandBox:!0}),Mn.util={color:fe,date:ye};class Ln{constructor(e,t,i){this.element=e,this.logLevel=t,this.consoleLogLevel=i,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,i=!1){var n;const r=`${pn.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((i||a)&&this.element){const t=document.createElement("li");pn.addClass(t,e),t.textContent=r,null===(n=this.element.querySelector("ul"))||void 0===n||n.prepend(t),this.element.style.display="block"}this.consoleLog(e,t,i)}consoleLog(e,t,i=!1){const n=`${pn.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(i||s)switch(e){case"error":console.error(n);break;case"warn":case"warning":console.warn(n);break;case"info":console.info(n);break;default:console.log(n)}}}var Dn=function(e,t,i,n){var r,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a},$n=function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function a(e){try{c(n.next(e))}catch(e){s(e)}}function o(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}c((n=n.apply(e,t||[])).next())}))};const Rn=Cn;console.info("%cFloorplan for Home Assistant (ha-floorplan)%c\nVersion 1.0.40","color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: rgb(71, 170, 238)");let jn=class extends ie{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 R` +function Ee(e){return null==e}var Ae={isNothing:Ee,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:Ee(e)?[]:[e]},repeat:function(e,t){var i,n="";for(i=0;io&&(t=n-o+(s=" ... ").length),i-n>o&&(i=n+o-(a=" ...").length),{str:s+e.slice(t,i).replace(/\t/g,"→")+a,pos:n-t+s.length}}function Oe(e,t){return Ae.repeat(" ",t-e.length)+e}var Ne=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 i,n=/\r?\n|\r|\0/g,r=[0],s=[],a=-1;i=n.exec(e.buffer);)s.push(i.index),r.push(i.index+i[0].length),e.position<=i.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=Pe(e.buffer,r[a-o],s[a-o],e.position-(r[a]-r[a-o]),u),l=Ae.repeat(" ",t.indent)+Oe((e.line-o+1).toString(),h)+" | "+c.str+"\n"+l;for(c=Pe(e.buffer,r[a],s[a],e.position,u),l+=Ae.repeat(" ",t.indent)+Oe((e.line+1).toString(),h)+" | "+c.str+"\n",l+=Ae.repeat("-",t.indent+h+3+c.pos)+"^\n",o=1;o<=t.linesAfter&&!(a+o>=s.length);o++)c=Pe(e.buffer,r[a+o],s[a+o],e.position-(r[a]-r[a+o]),u),l+=Ae.repeat(" ",t.indent)+Oe((e.line+o+1).toString(),h)+" | "+c.str+"\n";return l.replace(/\n$/,"")},Me=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Le=["scalar","sequence","mapping"];var De=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===Me.indexOf(t))throw new Te('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(i){e[i].forEach((function(e){t[String(e)]=i}))})),t}(t.styleAliases||null),-1===Le.indexOf(this.kind))throw new Te('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function $e(e,t){var i=[];return e[t].forEach((function(e){var t=i.length;i.forEach((function(i,n){i.tag===e.tag&&i.kind===e.kind&&i.multi===e.multi&&(t=n)})),i[t]=e})),i}function Re(e){return this.extend(e)}Re.prototype.extend=function(e){var t=[],i=[];if(e instanceof De)i.push(e);else if(Array.isArray(e))i=i.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new Te("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(i=i.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof De))throw new Te("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new Te("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 Te("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),i.forEach((function(e){if(!(e instanceof De))throw new Te("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var n=Object.create(Re.prototype);return n.implicit=(this.implicit||[]).concat(t),n.explicit=(this.explicit||[]).concat(i),n.compiledImplicit=$e(n,"implicit"),n.compiledExplicit=$e(n,"explicit"),n.compiledTypeMap=function(){var e,t,i={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function n(e){e.multi?(i.multi[e.kind].push(e),i.multi.fallback.push(e)):i[e.kind][e.tag]=i.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"]}}),Je=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var Xe=/^[-+]?[0-9]+e/;var Ke=new De("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!Je.test(e)||"_"===e[e.length-1])},construct:function(e){var t,i;return i="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===i?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:i*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||Ae.isNegativeZero(e))},represent:function(e,t){var i;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(Ae.isNegativeZero(e))return"-0.0";return i=e.toString(10),Xe.test(i)?i.replace("e",".e"):i},defaultStyle:"lowercase"}),Qe=Ue.extend({implicit:[He,qe,Ge,Ke]}),Ze=Qe,et=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),tt=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 it=new De("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==et.exec(e)||null!==tt.exec(e))},construct:function(e){var t,i,n,r,s,a,o,c,l=0,h=null;if(null===(t=et.exec(e))&&(t=tt.exec(e)),null===t)throw new Error("Date resolve error");if(i=+t[1],n=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(i,n,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(i,n,r,s,a,o,l)),h&&c.setTime(c.getTime()-h),c},instanceOf:Date,represent:function(e){return e.toISOString()}});var nt=new De("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),rt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var st=new De("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,i,n=0,r=e.length,s=rt;for(i=0;i64)){if(t<0)return!1;n+=6}return n%8==0},construct:function(e){var t,i,n=e.replace(/[\r\n=]/g,""),r=n.length,s=rt,a=0,o=[];for(t=0;t>16&255),o.push(a>>8&255),o.push(255&a)),a=a<<6|s.indexOf(n.charAt(t));return 0===(i=r%4*6)?(o.push(a>>16&255),o.push(a>>8&255),o.push(255&a)):18===i?(o.push(a>>10&255),o.push(a>>2&255)):12===i&&o.push(a>>4&255),new Uint8Array(o)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,i,n="",r=0,s=e.length,a=rt;for(t=0;t>18&63],n+=a[r>>12&63],n+=a[r>>6&63],n+=a[63&r]),r=(r<<8)+e[t];return 0===(i=s%3)?(n+=a[r>>18&63],n+=a[r>>12&63],n+=a[r>>6&63],n+=a[63&r]):2===i?(n+=a[r>>10&63],n+=a[r>>4&63],n+=a[r<<2&63],n+=a[64]):1===i&&(n+=a[r>>2&63],n+=a[r<<4&63],n+=a[64],n+=a[64]),n}}),at=Object.prototype.hasOwnProperty,ot=Object.prototype.toString;var ct=new De("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,i,n,r,s,a=[],o=e;for(t=0,i=o.length;t>10),56320+(e-65536&1023))}for(var Rt=new Array(256),jt=new Array(256),Bt=0;Bt<256;Bt++)Rt[Bt]=Dt(Bt)?1:0,jt[Bt]=Dt(Bt);function Vt(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||dt,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 Ft(e,t){var i={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return i.snippet=Ne(i),new Te(t,i)}function Ut(e,t){throw Ft(e,t)}function Ht(e,t){e.onWarning&&e.onWarning.call(null,Ft(e,t))}var qt={YAML:function(e,t,i){var n,r,s;null!==e.version&&Ut(e,"duplication of %YAML directive"),1!==i.length&&Ut(e,"YAML directive accepts exactly one argument"),null===(n=/^([0-9]+)\.([0-9]+)$/.exec(i[0]))&&Ut(e,"ill-formed argument of the YAML directive"),r=parseInt(n[1],10),s=parseInt(n[2],10),1!==r&&Ut(e,"unacceptable YAML version of the document"),e.version=i[0],e.checkLineBreaks=s<2,1!==s&&2!==s&&Ht(e,"unsupported YAML version of the document")},TAG:function(e,t,i){var n,r;2!==i.length&&Ut(e,"TAG directive accepts exactly two arguments"),n=i[0],r=i[1],Et.test(n)||Ut(e,"ill-formed tag handle (first argument) of the TAG directive"),ft.call(e.tagMap,n)&&Ut(e,'there is a previously declared suffix for "'+n+'" tag handle'),At.test(r)||Ut(e,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(t){Ut(e,"tag prefix is malformed: "+r)}e.tagMap[n]=r}};function zt(e,t,i,n){var r,s,a,o;if(t1&&(e.result+=Ae.repeat("\n",t-1))}function Qt(e,t){var i,n,r=e.tag,s=e.anchor,a=[],o=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),n=e.input.charCodeAt(e.position);0!==n&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,Ut(e,"tab characters must not be used in indentation")),45===n)&&Pt(e.input.charCodeAt(e.position+1));)if(o=!0,e.position++,Jt(e,!0,-1)&&e.lineIndent<=t)a.push(null),n=e.input.charCodeAt(e.position);else if(i=e.line,ti(e,t,vt,!1,!0),a.push(e.result),Jt(e,!0,-1),n=e.input.charCodeAt(e.position),(e.line===i||e.lineIndent>t)&&0!==n)Ut(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),ti(e,t,yt,!0,r)&&(v?m=e.result:g=e.result),v||(Yt(e,p,d,f,m,g,a,o,c),f=m=g=null),Jt(e,!0,-1),l=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&0!==l)Ut(e,"bad indentation of a mapping entry");else if(e.lineIndent=0))break;0===r?Ut(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?Ut(e,"repeat of an indentation width identifier"):(l=t+r-1,c=!0)}if(Tt(s)){do{s=e.input.charCodeAt(++e.position)}while(Tt(s));if(35===s)do{s=e.input.charCodeAt(++e.position)}while(!It(s)&&0!==s)}for(;0!==s;){for(Gt(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!c||e.lineIndentl&&(l=e.lineIndent),It(s))h++;else{if(e.lineIndent0){for(r=a,s=0;r>0;r--)(a=Nt(o=e.input.charCodeAt(++e.position)))>=0?s=(s<<4)+a:Ut(e,"expected hexadecimal character");e.result+=$t(s),e.position++}else Ut(e,"unknown escape sequence");i=n=e.position}else It(o)?(zt(e,i,n,!0),Kt(e,Jt(e,!1,t)),i=n=e.position):e.position===e.lineStart&&Xt(e)?Ut(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}Ut(e,"unexpected end of the stream within a double quoted scalar")}(e,p)?g=!0:!function(e){var t,i,n;if(42!==(n=e.input.charCodeAt(e.position)))return!1;for(n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!Pt(n)&&!Ot(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Ut(e,"name of an alias node must contain at least one character"),i=e.input.slice(t,e.position),ft.call(e.anchorMap,i)||Ut(e,'unidentified alias "'+i+'"'),e.result=e.anchorMap[i],Jt(e,!0,-1),!0}(e)?function(e,t,i){var n,r,s,a,o,c,l,h,u=e.kind,p=e.result;if(Pt(h=e.input.charCodeAt(e.position))||Ot(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)&&(Pt(n=e.input.charCodeAt(e.position+1))||i&&Ot(n)))return!1;for(e.kind="scalar",e.result="",r=s=e.position,a=!1;0!==h;){if(58===h){if(Pt(n=e.input.charCodeAt(e.position+1))||i&&Ot(n))break}else if(35===h){if(Pt(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&Xt(e)||i&&Ot(h))break;if(It(h)){if(o=e.line,c=e.lineStart,l=e.lineIndent,Jt(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&&(zt(e,r,s,!1),Kt(e,e.line-o),r=s=e.position,a=!1),Tt(h)||(s=e.position+1),h=e.input.charCodeAt(++e.position)}return zt(e,r,s,!1),!!e.result||(e.kind=u,e.result=p,!1)}(e,p,mt===i)&&(g=!0,null===e.tag&&(e.tag="?")):(g=!0,null===e.tag&&null===e.anchor||Ut(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===f&&(g=o&&Qt(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&&Ut(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&&Ut(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)):Ut(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||g}function ii(e){var t,i,n,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))&&(Jt(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&&!Pt(r);)r=e.input.charCodeAt(++e.position);for(n=[],(i=e.input.slice(t,e.position)).length<1&&Ut(e,"directive name must not be less than one character in length");0!==r;){for(;Tt(r);)r=e.input.charCodeAt(++e.position);if(35===r){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&!It(r));break}if(It(r))break;for(t=e.position;0!==r&&!Pt(r);)r=e.input.charCodeAt(++e.position);n.push(e.input.slice(t,e.position))}0!==r&&Gt(e),ft.call(qt,i)?qt[i](e,i,n):Ht(e,'unknown document directive "'+i+'"')}Jt(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,Jt(e,!0,-1)):a&&Ut(e,"directives end mark is expected"),ti(e,e.lineIndent-1,yt,!1,!0),Jt(e,!0,-1),e.checkLineBreaks&&_t.test(e.input.slice(s,e.position))&&Ht(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Xt(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,Jt(e,!0,-1)):e.position=55296&&n<=56319&&t+1=56320&&i<=57343?1024*(n-55296)+i-56320+65536:n}function Wi(e){return/^\n* /.test(e)}var Yi=1,Gi=2,Ji=3,Xi=4,Ki=5;function Qi(e,t,i,n,r,s,a,o){var c,l=0,h=null,u=!1,p=!1,d=-1!==n,f=-1,m=function(e){return Ui(e)&&e!==oi&&!Fi(e)&&e!==xi&&e!==ki&&e!==wi&&e!==bi&&e!==Ai&&e!==Ci&&e!==Ti&&e!==Oi&&e!==fi&&e!==gi&&e!==yi&&e!==pi&&e!==Pi&&e!==Si&&e!==_i&&e!==vi&&e!==di&&e!==mi&&e!==Ei&&e!==Ii}(zi(e,0))&&function(e){return!Fi(e)&&e!==wi}(zi(e,e.length-1));if(t||a)for(c=0;c=65536?c+=2:c++){if(!Ui(l=zi(e,c)))return Ki;m=m&&qi(l,h,o),h=l}else{for(c=0;c=65536?c+=2:c++){if((l=zi(e,c))===li)u=!0,d&&(p=p||c-f-1>n&&" "!==e[f+1],f=c);else if(!Ui(l))return Ki;m=m&&qi(l,h,o),h=l}p=p||d&&c-f-1>n&&" "!==e[f+1]}return u||p?i>9&&Wi(e)?Ki:a?s===Ri?Ki:Gi:p?Xi:Ji:!m||a||r(e)?s===Ri?Ki:Gi:Yi}function Zi(e,t,i,n,r){e.dump=function(){if(0===t.length)return e.quotingType===Ri?'""':"''";if(!e.noCompatMode&&(-1!==Mi.indexOf(t)||Li.test(t)))return e.quotingType===Ri?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,i),a=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),o=n||e.flowLevel>-1&&i>=e.flowLevel;switch(Qi(t,o,e.indent,a,(function(t){return function(e,t){var i,n;for(i=0,n=e.implicitTypes.length;i"+en(t,e.indent)+tn(Bi(function(e,t){var i,n,r=/(\n+)([^\n]*)/g,s=(o=e.indexOf("\n"),o=-1!==o?o:e.length,r.lastIndex=o,nn(e.slice(0,o),t)),a="\n"===e[0]||" "===e[0];var o;for(;n=r.exec(e);){var c=n[1],l=n[2];i=" "===l[0],s+=c+(a||i||""===l?"":"\n")+nn(l,t),a=i}return s}(t,a),s));case Ki:return'"'+function(e){for(var t,i="",n=0,r=0;r=65536?r+=2:r++)n=zi(e,r),!(t=Ni[n])&&Ui(n)?(i+=e[r],n>=65536&&(i+=e[r+1])):i+=t||Di(n);return i}(t)+'"';default:throw new Te("impossible error: invalid scalar style")}}()}function en(e,t){var i=Wi(e)?String(t):"",n="\n"===e[e.length-1];return i+(n&&("\n"===e[e.length-2]||"\n"===e)?"+":n?"":"-")+"\n"}function tn(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function nn(e,t){if(""===e||" "===e[0])return e;for(var i,n,r=/ [^ ]/g,s=0,a=0,o=0,c="";i=r.exec(e);)(o=i.index)-s>t&&(n=a>s?a:o,c+="\n"+e.slice(s,n),s=n+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 rn(e,t,i,n){var r,s,a,o="",c=e.tag;for(r=0,s=i.length;r tag resolver accepts not "'+c+'" style');n=o.represent[c](t,c)}e.dump=n}return!0}return!1}function an(e,t,i,n,r,s,a){e.tag=null,e.dump=i,sn(e,i,!1)||sn(e,i,!0);var o,c=si.call(e.dump),l=n;n&&(n=e.flowLevel<0||e.flowLevel>t);var h,u,p="[object Object]"===c||"[object Array]"===c;if(p&&(u=-1!==(h=e.duplicates.indexOf(i))),(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)n&&0!==Object.keys(e.dump).length?(!function(e,t,i,n){var r,s,a,o,c,l,h="",u=e.tag,p=Object.keys(i);if(!0===e.sortKeys)p.sort();else if("function"==typeof e.sortKeys)p.sort(e.sortKeys);else if(e.sortKeys)throw new Te("sortKeys must be a boolean or a function");for(r=0,s=p.length;r1024)&&(e.dump&&li===e.dump.charCodeAt(0)?l+="?":l+="? "),l+=e.dump,c&&(l+=Vi(e,t)),an(e,t+1,o,!0,c)&&(e.dump&&li===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,i){var n,r,s,a,o,c="",l=e.tag,h=Object.keys(i);for(n=0,r=h.length;n1024&&(o+="? "),o+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),an(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)n&&0!==e.dump.length?(e.noArrayIndent&&!a&&t>0?rn(e,t-1,e.dump,r):rn(e,t,e.dump,r),u&&(e.dump="&ref_"+h+e.dump)):(!function(e,t,i){var n,r,s,a="",o=e.tag;for(n=0,r=i.length;n",e.dump=o+" "+e.dump)}return!0}function on(e,t){var i,n,r=[],s=[];for(cn(e,r,s),i=0,n=s.length;ie.trim())).filter((e=>e.length));for(let t=0;te.trim()));e.style.setProperty(n[0],n[1])}}static setText(e,t,i){e instanceof SVGTextElement||(e=e.querySelector("text")||e);const n=t.replace(/\\n/g,"\n").split("\n"),r=n.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=i||"1em";n.forEach(((t,i)=>{const n=document.createElementNS("http://www.w3.org/2000/svg","tspan");if(n.textContent=t,n.setAttribute("x",o),n.setAttribute("dy",i>=1?c:"0"),a){const e=a.getAttribute("style");e&&n.setAttribute("style",e)}e.appendChild(n)}))}else{(s||e).textContent=t}}static waitForChildNodes(e,t,i){return new Promise(((n,r)=>{const s=setTimeout((()=>r("Timeout waiting for child element(s) to load")),i);new MutationObserver((e=>{for(const t of e)if("childList"===t.type&&t.addedNodes.length)return clearTimeout(s),n()})).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 hn.load(e)}static fetchText(e,t,i,n){return un(this,void 0,void 0,(function*(){i&&(e=e.replace(/^\/local\/floorplan\/examples\//g,`${i}/`)),e=n?e:pn.cacheBuster(e);const r=new Request(e,{cache:n?"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,i,n){return un(this,void 0,void 0,(function*(){t&&(e=e.replace(/^\/local\/floorplan\/examples\//g,`${i}/`)),e=n?e:pn.cacheBuster(e);const r=new Request(e,{cache:n?"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,${pn.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 i=window.btoa(t);for(;i.length%4>0;)i+="=";return i}static cacheBuster(e){return`${e}${e.includes("?")?"&":"?"}_=${(new Date).getTime()}`}static equal(e,t){if(e===t)return!0;const i=Array.isArray(e),n=Array.isArray(t);let r=0;if(i&&n){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 dn{static closestElement(e,t){return function t(i){if(!i||i===document||i===window)return null;i.assignedSlot&&(i=i.assignedSlot);const n=i.closest(e);return n||t(i.getRootNode().host)}(t)}}const fn=(e,t,i,n)=>{n=n||{},i=null==i?{}:i;const r=new Event(t,{bubbles:void 0===n.bubbles||n.bubbles,cancelable:Boolean(n.cancelable),composed:void 0===n.composed||n.composed});return r.detail=i,e.dispatchEvent(r),r},mn=(e,t,i=!1)=>{i?history.replaceState(null,"",t):history.pushState(null,"",t),fn(window,"location-changed",{replace:i})};class gn{constructor(e,t,i,n){this.entityId=e,this.svgElement=t,this.originalSvgElement=i,this.originalBBox=n}}class vn{constructor(e){this.rule=e,this.svgElementInfos={}}}class yn{constructor(e,t,i,n,r,s){this.instance=e,this.entityId=t,this.elementId=i,this.svgElementInfo=n,this.ruleInfo=r,this.actions=s}}const bn={},xn={};xn.click=xn.mousedown=xn.mouseup=xn.mousemove="MouseEvents";let wn=1;function Sn(e){return e._dtId||(e._dtId=wn++)}function _n(e){const t=e.indexOf(".");return t>0?{e:e.substring(0,e.indexOf(".")),ns:e.substring(t+1,e.length)}:{e}}function kn(e,t,i,n){const r=_n(i).e;if(!e._dtId)return!1;const s=bn[Sn(e)],a=function(e,t,i,n){return i=_n(i),(bn[Sn(e)]||[]).filter((e=>e&&(!i.e||e.e===i.e)&&(!i.ns||e.ns===i.ns)&&(!n||e.callback===n)&&(!t||e.selector===t)))}(e,t,i,n);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 En(e,t,i,n,r,s){const a=_n(i).e,o=_n(i).ns;e.addEventListener?e.addEventListener(a,r||n,s):e.attachEvent&&e.attachEvent("on"+a,r||n);const c=Sn(e);(bn[c]||(bn[c]=[])).push({delegator:r,callback:n,e:a,ns:o,selector:t})}const An={on(e,t,i,n=null){En(e,null,t,i,null,n)},off(e,t,i=null){kn(e,null,t,i)},once(e,t,i){const n=e=>(An.off(e.currentTarget,e.type,n),i(e));this.on(e,t,n)},delegate(e,t,i,n,r=null){En(e,t,i,n,(function(i){const r=e.querySelectorAll(t);let s=!1;for(let e=0;e{i=!1,t=setTimeout((()=>{i=!0,e.dispatchEvent(new Event("longClick"))}),400)},r=n=>{clearTimeout(t),i||e.dispatchEvent(new Event("short"+n.type[0].toUpperCase()+n.type.slice(1)))},s=e=>{i&&(e.preventDefault(),e.stopImmediatePropagation&&e.stopImmediatePropagation())};In.on(e,"mousedown",n.bind(this)),In.on(e,"tapstart",n.bind(this)),In.on(e,"touchstart",n.bind(this),{passive:!0}),In.on(e,"click",r.bind(this)),In.on(e,"mouseup",r.bind(this)),In.on(e,"tapend",r.bind(this)),In.on(e,"touchend",r.bind(this)),In.on(e,"tap",s.bind(this)),In.on(e,"touch",s.bind(this)),In.on(e,"mouseup",s.bind(this)),In.on(e,"tapend",s.bind(this)),In.on(e,"touchend",s.bind(this)),In.on(e,"click",(e=>{e.preventDefault(),e.stopImmediatePropagation&&e.stopImmediatePropagation()}).bind(this))}}const Pn=Cn,On=new Set;class Nn{static observe(e){if(On.has(e))return;On.add(e);let t,i=0;Pn.on(e,"click",(()=>{i++,t=setTimeout((()=>{1===i&&(i=0,e.dispatchEvent(new Event("singleClick")))}),400),2===i&&(clearTimeout(t),i=0,e.dispatchEvent(new Event("doubleClick")))}).bind(this))}}class Mn{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,i,n,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",i),this.interpreter.import("util",this.util)),this.entityState=n?t.states[n]: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(we(e))}return this.interpreter.exports.result}}Mn.cache={},Mn.interpreter=new(xe())({ecmaVer:2019,sandBox:!0}),Mn.util={color:fe,date:ye};class Ln{constructor(e,t,i){this.element=e,this.logLevel=t,this.consoleLogLevel=i,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,i=!1){var n;const r=`${pn.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((i||a)&&this.element){const t=document.createElement("li");pn.addClass(t,e),t.textContent=r,null===(n=this.element.querySelector("ul"))||void 0===n||n.prepend(t),this.element.style.display="block"}this.consoleLog(e,t,i)}consoleLog(e,t,i=!1){const n=`${pn.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(i||s)switch(e){case"error":console.error(n);break;case"warn":case"warning":console.warn(n);break;case"info":console.info(n);break;default:console.log(n)}}}var Dn=function(e,t,i,n){var r,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a},$n=function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function a(e){try{c(n.next(e))}catch(e){s(e)}}function o(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}c((n=n.apply(e,t||[])).next())}))};const Rn=Cn;console.info("%cFloorplan for Home Assistant (ha-floorplan)%c\nVersion 1.0.40","color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: rgb(71, 170, 238)");let jn=class extends ie{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 R`
diff --git a/dist/floorplan.js b/dist/floorplan.js index 94b54122..609507dd 100644 --- a/dist/floorplan.js +++ b/dist/floorplan.js @@ -51,7 +51,7 @@ const re=e=>t=>"function"==typeof t?((e,t)=>(customElements.define(e,t),t))(e,t) */ 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 splitted 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 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.40","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 $` +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.40","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 $`
diff --git a/docs/_docs/floorplan/floorplan-examples.js b/docs/_docs/floorplan/floorplan-examples.js index f40d7447..479e104b 100644 --- a/docs/_docs/floorplan/floorplan-examples.js +++ b/docs/_docs/floorplan/floorplan-examples.js @@ -1,4 +1,4 @@ -(()=>{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"}}},i=t.en_US,n=new function e(n,p,d){var f,m=n||i,g=p||0,v=d||!1,y=0;function b(e,t,i,n){for(var l="",p=null,d=!1,f=e.length,m=!1,y=0;yy?(y=s,f=new Date(y),i=y,v&&(f=new Date(y+l(f)+g))):i=y,t=f}return b(e,t,m,i)};return x.localize=function(t){return new e(t||m,g,v)},x.localizeByIdentifier=function(e){var i=t[e];return i?x.localize(i):(u('[WARNING] No locale found with identifier "'+e+'".'),x)},x.timezone=function(t){var i=g,n=v,r=typeof t;"number"!==r&&"string"!==r||(n=!0,"string"===r?i=("-"===t[0]?-1:1)*(60*parseInt(t.slice(1,3),10)+parseInt(t.slice(3,5),10))*60*1e3:"number"===r&&(i=60*t*1e3));return new e(m,i,n)},x.utc=function(){return new e(m,g,!0)},x}(i,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 i=e.getDay();"monday"===t&&(0===i?i=6:i--);var n=Date.UTC(e.getFullYear(),0,1),r=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),s=(Math.floor((r-n)/864e5)+7-i)/7;return Math.floor(s)}function c(e){var t=e%10,i=e%100;if(i>=11&&i<=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 i=e.toLocaleString(t,{timeZoneName:"short"}).match(/\s([\w]+)$/);return i&&i[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=n,"function"!=typeof Date.now&&(Date.now=function(){return+new Date})}()},449:function(e,t,i){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 it}}),n=Object.freeze({__proto__:null,get FunctionDeclaration(){return ri},get VariableDeclaration(){return si},get VariableDeclarator(){return ai},get ClassDeclaration(){return oi},get ClassBody(){return ci},get MethodDefinition(){return li}}),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 m(e,t,i){for(;t;){var n=f(t,i),r=void 0!==n&&void 0===n.writable&&"function"==typeof n[e]&&n[e];if(r)return r;t=d(t)}}function g(e,t){return m("get",e,t)}function v(e,t){return m("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[i++],done:!e}}}}var O="0.4.8",N={RES:void 0},M={RES:void 0},L=T("continue"),D=T("break"),$=T("super"),R=T("supercall"),j=T("noctor"),B=T("clsctor"),V=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 i in this.context){var n=this.context[i];t[n.kind](i,n.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 i=this;i.parent&&!i.isolated;)i=i.parent;var n=i.context[e];if(n){if("var"!==n.kind)throw new SyntaxError("Identifier '"+e+"' has already been declared");t!==F&&n.set(t)}else i.context[e]=new H("var",t===F?void 0:t);if(!i.parent){var r=i.find("window").get();t!==F&&s(r,e,{value:t,writable:!0,enumerable:!0})}},e.prototype.let=function(e,t){var i=this.context[e];if(i&&i.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 i=this.context[e];if(i&&i.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 i=this.context[e];if(i&&"var"!==i.kind)throw new SyntaxError("Identifier '"+e+"' has already been declared");this.context[e]=new H("var",t)},e}(); +(()=>{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"}}},i=t.en_US,n=new function e(n,p,d){var f,m=n||i,g=p||0,v=d||!1,y=0;function b(e,t,i,n){for(var l="",p=null,d=!1,f=e.length,m=!1,y=0;yy?(y=s,f=new Date(y),i=y,v&&(f=new Date(y+l(f)+g))):i=y,t=f}return b(e,t,m,i)};return x.localize=function(t){return new e(t||m,g,v)},x.localizeByIdentifier=function(e){var i=t[e];return i?x.localize(i):(u('[WARNING] No locale found with identifier "'+e+'".'),x)},x.timezone=function(t){var i=g,n=v,r=typeof t;return"number"!==r&&"string"!==r||(n=!0,"string"===r?i=("-"===t[0]?-1:1)*(60*parseInt(t.slice(1,3),10)+parseInt(t.slice(3,5),10))*60*1e3:"number"===r&&(i=60*t*1e3)),new e(m,i,n)},x.utc=function(){return new e(m,g,!0)},x}(i,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 i=e.getDay();"monday"===t&&(0===i?i=6:i--);var n=Date.UTC(e.getFullYear(),0,1),r=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),s=(Math.floor((r-n)/864e5)+7-i)/7;return Math.floor(s)}function c(e){var t=e%10,i=e%100;if(i>=11&&i<=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 i=e.toLocaleString(t,{timeZoneName:"short"}).match(/\s([\w]+)$/);return i&&i[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=n,"function"!=typeof Date.now&&(Date.now=function(){return+new Date})}()},449:function(e,t,i){e.exports=function(e){"use strict";var t=Object.freeze({__proto__:null,get FunctionDeclaration(){return pe},get VariableDeclaration(){return de},get VariableDeclarator(){return fe},get ClassDeclaration(){return me},get ClassBody(){return ge},get MethodDefinition(){return ve}}),n=Object.freeze({__proto__:null,get FunctionDeclaration(){return je},get VariableDeclaration(){return Be},get VariableDeclarator(){return Ve},get ClassDeclaration(){return Fe},get ClassBody(){return Ue},get MethodDefinition(){return He}}),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;var u=Object.getPrototypeOf;function p(e){return u?u(e):e.__proto__}var d=Object.getOwnPropertyDescriptor;function f(e,t,i){for(;t;){var n=d(t,i),r=void 0!==n&&void 0===n.writable&&"function"==typeof n[e]&&n[e];if(r)return r;t=p(t)}}function m(e,t){return f("get",e,t)}function g(e,t){return f("set",e,t)}var v=Object.create;function y(e,t){(function(e,t){h?h(e,t):e.__proto__=t})(e,t),e.prototype=v(t.prototype,{constructor:{value:e,writable:!0}})}var b=Object.assign||function(e){for(var t=1;t0&&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[i++],done:!e}}}}function G(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,s=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return a}function J(){for(var e=[],t=0;t":return i>n;case">=":return i>=n;case"<<":return i<>":return i>>n;case">>>":return i>>>n;case"+":return i+n;case"-":return i-n;case"*":return i*n;case"**":return Math.pow(i,n);case"/":return i/n;case"%":return i%n;case"|":return i|n;case"^":return i^n;case"&":return i&n;case"in":return i in n;case"instanceof":return i instanceof n;default:throw new SyntaxError("Unexpected token "+e.operator)}}function oe(e,t){var i,n=Xe(e.right,t),r=e.left;if("Identifier"===r.type){if(!(i=X(r,t,{getVar:!0,throwErr:!1}))){var s=t.global().find("window").get();i=new q(s,r.name)}}else{if("MemberExpression"!==r.type)return bi(r,t,{feed:n});i=le(r,t,{getVar:!0})}switch(e.operator){case"=":return i.set(n),i.get();case"+=":return i.set(i.get()+n),i.get();case"-=":return i.set(i.get()-n),i.get();case"*=":return i.set(i.get()*n),i.get();case"/=":return i.set(i.get()/n),i.get();case"%=":return i.set(i.get()%n),i.get();case"**=":return i.set(Math.pow(i.get(),n)),i.get();case"<<=":return i.set(i.get()<>=":return i.set(i.get()>>n),i.get();case">>>=":return i.set(i.get()>>>n),i.get();case"|=":return i.set(i.get()|n),i.get();case"^=":return i.set(i.get()^n),i.get();case"&=":return i.set(i.get()&n),i.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,i){void 0===i&&(i={});var n,r,a=i.getObj,o=void 0!==a&&a,c=i.getVar,l=void 0!==c&&c;if(n="Super"===e.object.type?xe(e.object,t,{getProto:!0}):Xe(e.object,t),o)return n;if(r=e.computed?Xe(e.property,t):e.property.name,l){var h=v(n,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(n,r)}var d=g(n,r);return"Super"===e.object.type&&d?(u=t.find("this").get(),d.call(u)):n[r]}function he(e,t){return Xe(e.test,t)?Xe(e.consequent,t):Xe(e.alternate,t)}function ue(e,t){var i,n;if("MemberExpression"===e.callee.type){n=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();i=n[r].bind(s)}else i=n[r];if("function"!=typeof i)throw new TypeError(r+" is not a function");if(i[B])throw new TypeError("Class constructor "+r+" cannot be invoked without 'new'")}else if(n=t.find("this").get(),"function"!=typeof(i=Xe(e.callee,t))||"Super"!==e.callee.type&&i[B]){var a;if("Identifier"===e.callee.type)a=e.callee.name;else try{a=JSON.stringify(i)}catch(e){a=""+i}throw"function"!=typeof i?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,i>n];case">=":return[2,i>=n];case"<<":return[2,i<>":return[2,i>>n];case">>>":return[2,i>>>n];case"+":return[2,i+n];case"-":return[2,i-n];case"*":return[2,i*n];case"**":return[2,Math.pow(i,n)];case"/":return[2,i/n];case"%":return[2,i%n];case"|":return[2,i|n];case"^":return[2,i^n];case"&":return[2,i&n];case"in":return[2,i in n];case"instanceof":return[2,i instanceof n];default:throw new SyntaxError("Unexpected token "+e.operator)}}}))}function ft(e,t){var i,n,r,s;return W(this,(function(a){switch(a.label){case 0:return[5,Y(ni(e.right,t))];case 1:return i=a.sent(),"Identifier"!==(n=e.left).type?[3,3]:[5,Y(nt(n,t,{getVar:!0,throwErr:!1}))];case 2:return(r=a.sent())||(s=t.global().find("window").get(),r=new q(s,n.name)),[3,7];case 3:return"MemberExpression"!==n.type?[3,5]:[5,Y(gt(n,t,{getVar:!0}))];case 4:return r=a.sent(),[3,7];case 5:return[5,Y(di(n,t,{feed:i}))];case 6:return[2,a.sent()];case 7:switch(e.operator){case"=":return r.set(i),[2,r.get()];case"+=":return r.set(r.get()+i),[2,r.get()];case"-=":return r.set(r.get()-i),[2,r.get()];case"*=":return r.set(r.get()*i),[2,r.get()];case"/=":return r.set(r.get()/i),[2,r.get()];case"%=":return r.set(r.get()%i),[2,r.get()];case"**=":return r.set(Math.pow(r.get(),i)),[2,r.get()];case"<<=":return r.set(r.get()<>=":return r.set(r.get()>>i),[2,r.get()];case">>>=":return r.set(r.get()>>>i),[2,r.get()];case"|=":return r.set(r.get()|i),[2,r.get()];case"^=":return r.set(r.get()^i),[2,r.get()];case"&=":return r.set(r.get()&i),[2,r.get()];default:throw new SyntaxError("Unexpected token "+e.operator)}}}))}function mt(e,t){var i,n;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(ni(e.left,t))];case 2:return(i=r.sent())?[3,4]:[5,Y(ni(e.right,t))];case 3:i=r.sent(),r.label=4;case 4:return[2,i];case 5:return[5,Y(ni(e.left,t))];case 6:return(n=r.sent())?[5,Y(ni(e.right,t))]:[3,8];case 7:n=r.sent(),r.label=8;case 8:return[2,n];case 9:throw new SyntaxError("Unexpected token "+e.operator)}}))}function gt(e,t,i){var n,r,a,o,c,l,h,u,p,d;return void 0===i&&(i={}),W(this,(function(f){switch(f.label){case 0:return n=i.getObj,r=void 0!==n&&n,a=i.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(ni(e.object,t))];case 3:c=f.sent(),f.label=4;case 4:return r?[2,c]:e.computed?[5,Y(ni(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=g(c,l),"Super"===e.object.type&&p?(d=t.find("this").get(),[2,p.call(d)]):[2,c[l]])}}))}function vt(e,t){var i;return W(this,(function(n){switch(n.label){case 0:return[5,Y(ni(e.test,t))];case 1:return n.sent()?[5,Y(ni(e.consequent,t))]:[3,3];case 2:return i=n.sent(),[3,5];case 3:return[5,Y(ni(e.alternate,t))];case 4:i=n.sent(),n.label=5;case 5:return[2,i]}}))}function yt(e,t){var i,n,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(gt(e.callee,t,{getObj:!0}))];case 1:return n=f.sent(),r=void 0,e.callee.computed?[5,Y(ni(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(),i=n[r].bind(s)):i=n[r],"function"!=typeof i)throw new TypeError(r+" is not a function");if(i[B])throw new TypeError("Class constructor "+r+" cannot be invoked without 'new'");return[3,7];case 5:return n=t.find("this").get(),[5,Y(ni(e.callee,t))];case 6:if("function"!=typeof(i=f.sent())||"Super"!==e.callee.type&&i[B]){if("Identifier"===e.callee.type)a=e.callee.name;else try{a=JSON.stringify(i)}catch(e){a=""+i}throw"function"!=typeof i?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 pi(e,t){var i,n,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(si(e,t,{hoist:!0}))];case 2:return o.sent(),[3,38];case 3:return"VariableDeclaration"!==e.left.type?[3,5]:[5,Y(si(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(si(e.init,t,{hoist:!0}))];case 6:o.sent(),o.label=7;case 7:return[5,Y(pi(e.body,t))];case 8:return o.sent(),[3,38];case 9:return[5,Y(pi(e.consequent,t))];case 10:return o.sent(),e.alternate?[5,Y(pi(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 yi(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":yi(e.body,t);break;case"IfStatement":yi(e.consequent,t),e.alternate&&yi(e.alternate,t);break;case"BlockStatement":for(var i=0;i{"use strict";i.r(t),i.d(t,{Node:()=>ne,Parser:()=>V,Position:()=>L,SourceLocation:()=>D,TokContext:()=>ae,Token:()=>Te,TokenType:()=>g,defaultOptions:()=>R,getLineInfo:()=>$,isIdentifierChar:()=>m,isIdentifierStart:()=>f,isNewLine:()=>E,keywordTypes:()=>x,lineBreak:()=>_,lineBreakG:()=>k,nonASCIIwhitespace:()=>A,parse:()=>Le,parseExpressionAt:()=>De,tokContexts:()=>oe,tokTypes:()=>S,tokenizer:()=>$e,version:()=>Me});var n={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 i=65536,n=0;ne)return!1;if((i+=t[n+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 m(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 g=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 g(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 g(e,t)}var S={num:new g("num",b),regexp:new g("regexp",b),string:new g("string",b),name:new g("name",b),eof:new g("eof"),bracketL:new g("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new g("]"),braceL:new g("{",{beforeExpr:!0,startsExpr:!0}),braceR:new g("}"),parenL:new g("(",{beforeExpr:!0,startsExpr:!0}),parenR:new g(")"),comma:new g(",",y),semi:new g(";",y),colon:new g(":",y),dot:new g("."),question:new g("?",y),arrow:new g("=>",y),template:new g("template"),invalidTemplate:new g("invalidTemplate"),ellipsis:new g("...",y),backQuote:new g("`",b),dollarBraceL:new g("${",{beforeExpr:!0,startsExpr:!0}),eq:new g("=",{beforeExpr:!0,isAssign:!0}),assign:new g("_=",{beforeExpr:!0,isAssign:!0}),incDec:new g("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new g("!/~",{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 g("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:v("%",10),star:v("*",10),slash:v("/",10),starstar:new g("**",{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 O(e,t){return T.call(e,t)}var N=Array.isArray||function(e){return"[object Array]"===P.call(e)};function M(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,i){this.start=t,this.end=i,null!==e.sourceFile&&(this.source=e.sourceFile)};function $(e,t){for(var i=1,n=0;;){k.lastIndex=n;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 n=t.onToken;t.onToken=function(e){return n.push(e)}}return N(t.onComment)&&(t.onComment=function(e,t){return function(i,n,r,s,a,o){var c={type:i?"Block":"Line",value:n,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 V=function(e,t,i){this.options=e=j(e),this.sourceFile=e.sourceFile,this.keywords=M(s[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var r="";if(!0!==e.allowReserved){for(var a=e.ecmaVersion;!(r=n[a]);a--);"module"===e.sourceType&&(r+=" await")}this.reservedWords=M(r);var o=(r?r+" ":"")+n.strict;this.reservedWordsStrict=M(o),this.reservedWordsStrictBind=M(o+" "+n.strictBind),this.input=String(t),this.containsEsc=!1,i?(this.pos=i,this.lineStart=this.input.lastIndexOf("\n",i-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}};V.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())},V.prototype.inNonArrowFunction=function(){return(2&this.currentThisScope().flags)>0},V.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var i=this,n=0;n-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,"Parenthesized pattern")}},U.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,n=e.doubleProto;if(!t)return i>=0||n>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),n>=0&&this.raiseRecoverable(n,"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 n=n||this.value,e&&"var"!==n&&this.unexpected(),this.parseVarStatement(s,n);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,i);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 i="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 n=0;n=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 i=this.isLet();if(this.type===S._var||this.type===S._const||i){var n=this.startNode(),r=i?"let":this.value;return this.next(),this.parseVar(n,!0,r),this.finishNode(n,"VariableDeclaration"),(this.type===S._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===n.declarations.length?(this.options.ecmaVersion>=9&&(this.type===S._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,n)):(t>-1&&this.unexpected(t),this.parseFor(e,n))}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,i){return this.next(),this.parseFunction(e,J|(i?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 i=!1;this.type!==S.braceR;)if(this.type===S._case||this.type===S._default){var n=this.type===S._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),n?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!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 i="Identifier"===t.param.type;this.enterScope(i?32:0),this.checkLVal(t.param,i?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,i,n){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(n?-1===n.indexOf("label")?n+"label":n:"label"),this.labels.pop(),e.label=i,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 i=this.parseStatement(null);t.body.push(i)}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 i=this.type===S._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!i||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)?this.raise(t.start,(i?"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=i?this.parseExpression():this.parseMaybeAssign(),this.expect(S.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")},z.parseVar=function(e,t,i){for(e.declarations=[],e.kind=i;;){var n=this.startNode();if(this.parseVarId(n,i),this.eat(S.eq)?n.init=this.parseMaybeAssign(t):"const"!==i||this.type===S._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===n.id.type||t&&(this.type===S._in||this.isContextual("of"))?n.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(n,"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,i,n){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===S.star&&t&X&&this.unexpected(),e.generator=this.eat(S.star)),this.options.ecmaVersion>=8&&(e.async=!!n),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,i,!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 i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var n=this.startNode(),r=!1;for(n.body=[],this.expect(S.braceL);!this.eat(S.braceR);){var s=this.parseClassElement(null!==e.superClass);s&&(n.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(n,"ClassBody"),this.strict=i,this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},z.parseClassElement=function(e){var t=this;if(this.eat(S.semi))return null;var i=this.startNode(),n=function(e,n){void 0===n&&(n=!1);var r=t.start,s=t.startLoc;return!!t.eatContextual(e)&&(!(t.type===S.parenL||n&&t.canInsertSemicolon())||(i.key&&t.unexpected(),i.computed=!1,i.key=t.startNodeAt(r,s),i.key.name=e,t.finishNode(i.key,"Identifier"),!1))};i.kind="method",i.static=n("static");var r=this.eat(S.star),s=!1;r||(this.options.ecmaVersion>=8&&n("async",!0)?(s=!0,r=this.options.ecmaVersion>=9&&this.eat(S.star)):n("get")?i.kind="get":n("set")&&(i.kind="set")),i.key||this.parsePropertyName(i);var a=i.key,o=!1;return i.computed||i.static||!("Identifier"===a.type&&"constructor"===a.name||"Literal"===a.type&&"constructor"===a.value)?i.static&&"Identifier"===a.type&&"prototype"===a.name&&this.raise(a.start,"Classes may not have a static property named prototype"):("method"!==i.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"),i.kind="constructor",o=e),this.parseClassMethod(i,r,s,o),"get"===i.kind&&0!==i.value.params.length&&this.raiseRecoverable(i.value.start,"getter should have no params"),"set"===i.kind&&1!==i.value.params.length&&this.raiseRecoverable(i.value.start,"setter should have exactly one param"),"set"===i.kind&&"RestElement"===i.value.params[0].type&&this.raiseRecoverable(i.value.params[0].start,"Setter cannot use rest params"),i},z.parseClassMethod=function(e,t,i,n){return e.value=this.parseMethod(t,i,n),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 i;if(this.checkExport(t,"default",this.lastTokStart),this.type===S._function||(i=this.isAsyncFunction())){var n=this.startNode();this.next(),i&&this.next(),e.declaration=this.parseFunction(n,4|J,!1,i)}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",i&&this.checkPatternErrors(i,!0);for(var n=0,r=e.properties;n=8&&!s&&"async"===a.name&&!this.canInsertSemicolon()&&this.eat(S._function))return this.parseFunction(this.startNodeAt(n,r),0,!1,!0);if(i&&!this.canInsertSemicolon()){if(this.eat(S.arrow))return this.parseArrowExpression(this.startNodeAt(n,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(n,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(i);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,i=this.start,n=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,m=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(i,n,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,m)):t=c[0]}else t=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(i,n);return g.expression=t,this.finishNode(g,"ParenthesizedExpression")}return t},Q.parseParenItem=function(e){return e},Q.parseParenArrowList=function(e,t,i){return this.parseArrowExpression(this.startNodeAt(e,t),i)};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 i=this.containsEsc;return e.property=this.parseIdent(!0),("target"!==e.property.name||i)&&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 n=this.start,r=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(),n,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,i=this.startNode();return this.type===S.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value,cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),i.tail=this.type===S.backQuote,this.finishNode(i,"TemplateElement")},Q.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var n=this.parseTemplateElement({isTagged:t});for(i.quasis=[n];!n.tail;)this.type===S.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(S.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(S.braceR),i.quasis.push(n=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"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 i=this.startNode(),n=!0,r={};for(i.properties=[],this.next();!this.eat(S.braceR);){if(n)n=!1;else if(this.expect(S.comma),this.afterTrailingComma(S.braceR))break;var s=this.parseProperty(e,t);e||this.checkPropClash(s,r,t),i.properties.push(s)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")},Q.parseProperty=function(e,t){var i,n,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||(i=this.eat(S.star)));var o=this.containsEsc;return this.parsePropertyName(a),!e&&!o&&this.options.ecmaVersion>=8&&!i&&this.isAsyncProp(a)?(n=!0,i=this.options.ecmaVersion>=9&&this.eat(S.star),this.parsePropertyName(a,t)):n=!1,this.parsePropertyValue(a,e,i,n,r,s,t,o),this.finishNode(a,"Property")},Q.parsePropertyValue=function(e,t,i,n,r,s,a,o){if((i||n)&&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(i,n);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?((i||n)&&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{(i||n)&&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,i){var n=this.startNode(),r=this.yieldPos,s=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=e),this.options.ecmaVersion>=8&&(n.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|B(t,n.generator)|(i?128:0)),this.expect(S.parenL),n.params=this.parseBindingList(S.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1,!0),this.yieldPos=r,this.awaitPos=s,this.awaitIdentPos=a,this.finishNode(n,"FunctionExpression")},Q.parseArrowExpression=function(e,t,i){var n=this.yieldPos,r=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(16|B(i,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1),this.yieldPos=n,this.awaitPos=r,this.awaitIdentPos=s,this.finishNode(e,"ArrowFunctionExpression")},Q.parseFunctionBody=function(e,t,i){var n=t&&this.type!==S.braceL,r=this.strict,s=!1;if(n)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&&!i&&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,i=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();n=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){n=!0;break}if(o.var.push(e),this.inModule&&1&o.flags&&delete this.undefinedExports[e],3&o.flags)break}n&&this.raiseRecoverable(i,"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 ne=function(e,t,i){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new D(e,i)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},re=V.prototype;function se(e,t,i,n){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=n),this.options.ranges&&(e.range[1]=i),e}re.startNode=function(){return new ne(this,this.start,this.startLoc)},re.startNodeAt=function(e,t){return new ne(this,e,t)},re.finishNode=function(e,t){return se.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},re.finishNodeAt=function(e,t,i,n){return se.call(this,e,t,i,n)};var ae=function(e,t,i,n,r){this.token=e,this.isExpr=!!t,this.preserveSpace=!!i,this.override=n,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=V.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,i=this.type;i.keyword&&e===S.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.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",me={9:de,10:fe,11:fe+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"},ge={};function ve(e){var t=ge[e]={binary:M(ue[e]+" "+pe),nonBinary:{General_Category:M(pe),Script:M(me[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=V.prototype,be=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":""),this.unicodeProperties=ge[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,i){var n=-1!==i.indexOf("u");this.start=0|e,this.source=t+"",this.flags=i,this.switchU=n&&this.parser.options.ecmaVersion>=6,this.switchN=n&&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,i=t.length;if(e>=i)return-1;var n=t.charCodeAt(e);if(!this.switchU||n<=55295||n>=57344||e+1>=i)return n;var r=t.charCodeAt(e+1);return r>=56320&&r<=57343?(n<<10)+r-56613888:n},be.prototype.nextIndex=function(e){var t=this.source,i=t.length;if(e>=i)return i;var n,r=t.charCodeAt(e);return!this.switchU||r<=55295||r>=57344||e+1>=i||(n=t.charCodeAt(e+1))<56320||n>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,i=e.flags,n=0;n-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,i=e.backReferenceNames;t=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,!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 i=e.pos;if(e.eat(123)){var n=0,r=-1;if(this.regexp_eatDecimalDigits(e)&&(n=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,i=0;-1!==(i=e.current())&&!we(i);)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,i=e.current();return e.advance(),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(e)&&(i=e.lastIntValue),function(e){return f(e,!0)||36===e||95===e}(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)},ye.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=e.current();return e.advance(),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(e)&&(i=e.lastIntValue),function(e){return m(e,!0)||36===e||95===e||8204===e||8205===e}(i)?(e.lastIntValue=i,!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 i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),!0;if(i<=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,i=e.pos;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var n=e.lastIntValue;if(e.switchU&&n>=55296&&n<=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*(n-55296)+(s-56320)+65536,!0}e.pos=r,e.lastIntValue=n}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=i}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 i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,n),!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,i){O(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||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 i=e.lastIntValue;!e.switchU||-1!==t&&-1!==i||e.raise("Invalid character class"),-1!==t&&-1!==i&&t>i&&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 i=e.current();(99===i||Ie(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var n=e.current();return 93!==n&&(e.lastIntValue=n,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,i=0;for(e.lastIntValue=0;Ee(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t},ye.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Ae(i=e.current());)e.lastIntValue=16*e.lastIntValue+Ce(i),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 i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*i+e.lastIntValue:e.lastIntValue=8*t+i}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 i=e.pos;e.lastIntValue=0;for(var n=0;n>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(),i=this.pos,n=this.input.indexOf("*/",this.pos+=2);if(-1===n&&this.raise(this.pos-2,"Unterminated comment"),this.pos=n+2,this.options.locations)for(k.lastIndex=i;(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 i=this.type;this.type=e,this.value=t,this.updateContext(i)},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),i=1,n=42===e?S.star:S.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++i,n=S.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(S.assign,i+1):this.finishOp(n,i)},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),i=1;return t===e?(i=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+i)?this.finishOp(S.assign,i+1):this.finishOp(S.bitShift,i)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(i=2),this.finishOp(S.relational,i)):(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 '"+Oe(e)+"'")},Pe.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)},Pe.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var n=this.input.charAt(this.pos);if(_.test(n)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if("["===n)t=!0;else if("]"===n&&t)t=!1;else if("/"===n&&!t)break;e="\\"===n}++this.pos}var r=this.input.slice(i,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(i,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 i=this.pos,n=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,n=n*e+o}return this.pos===i||null!=t&&this.pos-i!==t?null:n},Pe.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return null==i&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(i="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,i)},Pe.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10)||this.raise(t,"Invalid number");var i=this.pos-t>=2&&48===this.input.charCodeAt(t);i&&this.strict&&this.raise(t,"Invalid number"),i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1);var n=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&110===n){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!==n||i||(++this.pos,this.readInt(10),n=this.input.charCodeAt(this.pos)),69!==n&&101!==n||i||(43!==(n=this.input.charCodeAt(++this.pos))&&45!==n||++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=i?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="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var n=this.input.charCodeAt(this.pos);if(n===e)break;92===n?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):(E(n,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,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 i=this.input.charCodeAt(this.pos);if(96===i||36===i&&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===i?(this.pos+=2,this.finishToken(S.dollarBraceL)):(++this.pos,this.finishToken(S.backQuote));if(92===i)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(E(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(i)}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 i=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],n=parseInt(i,8);return n>255&&(i=i.slice(0,-1),n=parseInt(i,8)),this.pos+=i.length-1,t=this.input.charCodeAt(this.pos),"0"===i&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-i.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(n)}return E(t)?"":String.fromCharCode(t)}},Pe.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return null===i&&this.invalidStringToken(t,"Bad character escape sequence"),i},Pe.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,n=this.options.ecmaVersion>=6;this.pos{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict"; + ***************************************************************************** */function F(e,t){var i,n,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(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=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++,n=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[i++],done:!e}}}}function H(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,s=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return a}function q(){for(var e=[],t=0;t":return i>n;case">=":return i>=n;case"<<":return i<>":return i>>n;case">>>":return i>>>n;case"+":return i+n;case"-":return i-n;case"*":return i*n;case"**":return Math.pow(i,n);case"/":return i/n;case"%":return i%n;case"|":return i|n;case"^":return i^n;case"&":return i&n;case"in":return i in n;case"instanceof":return i instanceof n;default:throw new SyntaxError("Unexpected token "+e.operator)}},AssignmentExpression:function(e,t){var i,n=ue(e.right,t),r=e.left;if("Identifier"===r.type){if(!(i=z(r,t,{getVar:!0,throwErr:!1}))){var s=t.global().find("window").get();i=new B(s,r.name)}}else{if("MemberExpression"!==r.type)return Ze(r,t,{feed:n});i=J(r,t,{getVar:!0})}switch(e.operator){case"=":return i.set(n),i.get();case"+=":return i.set(i.get()+n),i.get();case"-=":return i.set(i.get()-n),i.get();case"*=":return i.set(i.get()*n),i.get();case"/=":return i.set(i.get()/n),i.get();case"%=":return i.set(i.get()%n),i.get();case"**=":return i.set(Math.pow(i.get(),n)),i.get();case"<<=":return i.set(i.get()<>=":return i.set(i.get()>>n),i.get();case">>>=":return i.set(i.get()>>>n),i.get();case"|=":return i.set(i.get()|n),i.get();case"^=":return i.set(i.get()^n),i.get();case"&=":return i.set(i.get()&n),i.get();default:throw new SyntaxError("Unexpected token "+e.operator)}},LogicalExpression:function(e,t){switch(e.operator){case"||":return ue(e.left,t)||ue(e.right,t);case"&&":return ue(e.left,t)&&ue(e.right,t);default:throw new SyntaxError("Unexpected token "+e.operator)}},MemberExpression:J,ConditionalExpression:function(e,t){return ue(e.test,t)?ue(e.consequent,t):ue(e.alternate,t)},CallExpression:function(e,t){var i,n;if("MemberExpression"===e.callee.type){n=J(e.callee,t,{getObj:!0});var r;if(r=e.callee.computed?ue(e.callee.property,t):e.callee.property.name,"Super"===e.callee.object.type){var s=t.find("this").get();i=n[r].bind(s)}else i=n[r];if("function"!=typeof i)throw new TypeError(r+" is not a function");if(i[L])throw new TypeError("Class constructor "+r+" cannot be invoked without 'new'")}else if(n=t.find("this").get(),"function"!=typeof(i=ue(e.callee,t))||"Super"!==e.callee.type&&i[L]){var a;if("Identifier"===e.callee.type)a=e.callee.name;else try{a=JSON.stringify(i)}catch(e){a=""+i}throw"function"!=typeof i?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,i>n];case">=":return[2,i>=n];case"<<":return[2,i<>":return[2,i>>n];case">>>":return[2,i>>>n];case"+":return[2,i+n];case"-":return[2,i-n];case"*":return[2,i*n];case"**":return[2,Math.pow(i,n)];case"/":return[2,i/n];case"%":return[2,i%n];case"|":return[2,i|n];case"^":return[2,i^n];case"&":return[2,i&n];case"in":return[2,i in n];case"instanceof":return[2,i instanceof n];default:throw new SyntaxError("Unexpected token "+e.operator)}}}))},AssignmentExpression:function(e,t){var i,n,r,s;return F(this,(function(a){switch(a.label){case 0:return[5,U(Re(e.right,t))];case 1:return i=a.sent(),"Identifier"!==(n=e.left).type?[3,3]:[5,U(ye(n,t,{getVar:!0,throwErr:!1}))];case 2:return(r=a.sent())||(s=t.global().find("window").get(),r=new B(s,n.name)),[3,7];case 3:return"MemberExpression"!==n.type?[3,5]:[5,U(Se(n,t,{getVar:!0}))];case 4:return r=a.sent(),[3,7];case 5:return[5,U(Ye(n,t,{feed:i}))];case 6:return[2,a.sent()];case 7:switch(e.operator){case"=":return r.set(i),[2,r.get()];case"+=":return r.set(r.get()+i),[2,r.get()];case"-=":return r.set(r.get()-i),[2,r.get()];case"*=":return r.set(r.get()*i),[2,r.get()];case"/=":return r.set(r.get()/i),[2,r.get()];case"%=":return r.set(r.get()%i),[2,r.get()];case"**=":return r.set(Math.pow(r.get(),i)),[2,r.get()];case"<<=":return r.set(r.get()<>=":return r.set(r.get()>>i),[2,r.get()];case">>>=":return r.set(r.get()>>>i),[2,r.get()];case"|=":return r.set(r.get()|i),[2,r.get()];case"^=":return r.set(r.get()^i),[2,r.get()];case"&=":return r.set(r.get()&i),[2,r.get()];default:throw new SyntaxError("Unexpected token "+e.operator)}}}))},LogicalExpression:function(e,t){var i,n;return F(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,U(Re(e.left,t))];case 2:return(i=r.sent())?[3,4]:[5,U(Re(e.right,t))];case 3:i=r.sent(),r.label=4;case 4:return[2,i];case 5:return[5,U(Re(e.left,t))];case 6:return(n=r.sent())?[5,U(Re(e.right,t))]:[3,8];case 7:n=r.sent(),r.label=8;case 8:return[2,n];case 9:throw new SyntaxError("Unexpected token "+e.operator)}}))},MemberExpression:Se,ConditionalExpression:function(e,t){var i;return F(this,(function(n){switch(n.label){case 0:return[5,U(Re(e.test,t))];case 1:return n.sent()?[5,U(Re(e.consequent,t))]:[3,3];case 2:return i=n.sent(),[3,5];case 3:return[5,U(Re(e.alternate,t))];case 4:i=n.sent(),n.label=5;case 5:return[2,i]}}))},CallExpression:function(e,t){var i,n,r,s,a,o,c,l,h,u,p,d;return F(this,(function(f){switch(f.label){case 0:return"MemberExpression"!==e.callee.type?[3,5]:[5,U(Se(e.callee,t,{getObj:!0}))];case 1:return n=f.sent(),r=void 0,e.callee.computed?[5,U(Re(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(),i=n[r].bind(s)):i=n[r],"function"!=typeof i)throw new TypeError(r+" is not a function");if(i[L])throw new TypeError("Class constructor "+r+" cannot be invoked without 'new'");return[3,7];case 5:return n=t.find("this").get(),[5,U(Re(e.callee,t))];case 6:if("function"!=typeof(i=f.sent())||"Super"!==e.callee.type&&i[L]){if("Identifier"===e.callee.type)a=e.callee.name;else try{a=JSON.stringify(i)}catch(e){a=""+i}throw"function"!=typeof i?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=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}}}(i),r=void 0,C.RES=n.next(),[4,C]):[3,8];case 2:r=p.sent(),p.label=3;case 3:return r.done?[3,7]:[5,U(Xe(e,t,{value:r.value}))];case 4:if((c=p.sent())===P)return[3,7];if(c===T)return[3,5];if(c===I)return[2,c];p.label=5;case 5:return C.RES=n.next(),[4,C];case 6:return r=p.sent(),[3,3];case 7:return[3,15];case 8:p.trys.push([8,13,14,15]),s=U(i),a=s.next(),p.label=9;case 9:return a.done?[3,12]:(o=a.value,[5,U(Xe(e,t,{value:o}))]);case 10:if((c=p.sent())===P)return[3,12];if(c===T)return[3,11];if(c===I)return[2,c];p.label=11;case 11:return a=s.next(),[3,9];case 12:return[3,15];case 13:return l=p.sent(),h={error:l},[3,15];case 14:try{a&&!a.done&&(u=s.return)&&u.call(s)}finally{if(h)throw h.error}return[7];case 15:return[2]}}))}});function Oe(e,t,i){var n,r,s,a,o,c,l,h,u,p,d,f,m,g,v;return void 0===i&&(i={}),F(this,(function(y){switch(y.label){case 0:n=i.kind,r=void 0===n?"var":n,s=i.hoist,a=void 0!==s&&s,o=i.onlyBlock,c=void 0!==o&&o,l=i.feed,h=void 0===l?{}:l,u=[],p=0,y.label=1;case 1:return p-1;c--)e.body.splice(a[c],1);e.body=s.concat(e.body)}return[2]}}))}function We(e,t){var i,n,r,s,a;return F(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,U(Be(e,t,{hoist:!0}))];case 2:return o.sent(),[3,38];case 3:return"VariableDeclaration"!==e.left.type?[3,5]:[5,U(Be(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,U(Be(e.init,t,{hoist:!0}))];case 6:o.sent(),o.label=7;case 7:return[5,U(We(e.body,t))];case 8:return o.sent(),[3,38];case 9:return[5,U(We(e.consequent,t))];case 10:return o.sent(),e.alternate?[5,U(We(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 Qe(e,t){switch(e.type){case"VariableDeclaration":de(e,t,{hoist:!0});break;case"ForInStatement":case"ForOfStatement":"VariableDeclaration"===e.left.type&&de(e.left,t,{hoist:!0});case"ForStatement":"ForStatement"===e.type&&"VariableDeclaration"===e.init.type&&de(e.init,t,{hoist:!0});case"WhileStatement":case"DoWhileStatement":Qe(e.body,t);break;case"IfStatement":Qe(e.consequent,t),e.alternate&&Qe(e.alternate,t);break;case"BlockStatement":for(var i=0;i{"use strict";i.r(t),i.d(t,{Node:()=>ie,Parser:()=>B,Position:()=>L,SourceLocation:()=>D,TokContext:()=>se,Token:()=>Ie,TokenType:()=>g,defaultOptions:()=>R,getLineInfo:()=>$,isIdentifierChar:()=>m,isIdentifierStart:()=>f,isNewLine:()=>E,keywordTypes:()=>x,lineBreak:()=>_,lineBreakG:()=>k,nonASCIIwhitespace:()=>A,parse:()=>Me,parseExpressionAt:()=>Le,tokContexts:()=>ae,tokTypes:()=>S,tokenizer:()=>De,version:()=>Ne});var n={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 i=65536,n=0;ne)return!1;if((i+=t[n+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 m(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 g=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 g(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 g(e,t)}var S={num:new g("num",b),regexp:new g("regexp",b),string:new g("string",b),name:new g("name",b),eof:new g("eof"),bracketL:new g("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new g("]"),braceL:new g("{",{beforeExpr:!0,startsExpr:!0}),braceR:new g("}"),parenL:new g("(",{beforeExpr:!0,startsExpr:!0}),parenR:new g(")"),comma:new g(",",y),semi:new g(";",y),colon:new g(":",y),dot:new g("."),question:new g("?",y),arrow:new g("=>",y),template:new g("template"),invalidTemplate:new g("invalidTemplate"),ellipsis:new g("...",y),backQuote:new g("`",b),dollarBraceL:new g("${",{beforeExpr:!0,startsExpr:!0}),eq:new g("=",{beforeExpr:!0,isAssign:!0}),assign:new g("_=",{beforeExpr:!0,isAssign:!0}),incDec:new g("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new g("!/~",{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 g("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:v("%",10),star:v("*",10),slash:v("/",10),starstar:new g("**",{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 O(e,t){return T.call(e,t)}var N=Array.isArray||function(e){return"[object Array]"===P.call(e)};function M(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,i){this.start=t,this.end=i,null!==e.sourceFile&&(this.source=e.sourceFile)};function $(e,t){for(var i=1,n=0;;){k.lastIndex=n;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 n=t.onToken;t.onToken=function(e){return n.push(e)}}return N(t.onComment)&&(t.onComment=function(e,t){return function(i,n,r,s,a,o){var c={type:i?"Block":"Line",value:n,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}(e),this.sourceFile=e.sourceFile,this.keywords=M(s[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var r="";if(!0!==e.allowReserved){for(var a=e.ecmaVersion;!(r=n[a]);a--);"module"===e.sourceType&&(r+=" await")}this.reservedWords=M(r);var o=(r?r+" ":"")+n.strict;this.reservedWordsStrict=M(o),this.reservedWordsStrictBind=M(o+" "+n.strictBind),this.input=String(t),this.containsEsc=!1,i?(this.pos=i,this.lineStart=this.input.lastIndexOf("\n",i-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},V={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};B.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},V.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},V.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},V.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},V.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0},V.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},V.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},B.prototype.inNonArrowFunction=function(){return(2&this.currentThisScope().flags)>0},B.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var i=this,n=0;n-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,"Parenthesized pattern")}},F.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,n=e.doubleProto;if(!t)return i>=0||n>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),n>=0&&this.raiseRecoverable(n,"Redefinition of __proto__ property")},F.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 n=n||this.value,e&&"var"!==n&&this.unexpected(),this.parseVarStatement(s,n);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,i);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)}},q.parseBreakContinueStatement=function(e,t){var i="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 n=0;n=6?this.eat(S.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},q.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(z),this.enterScope(0),this.expect(S.parenL),this.type===S.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===S._var||this.type===S._const||i){var n=this.startNode(),r=i?"let":this.value;return this.next(),this.parseVar(n,!0,r),this.finishNode(n,"VariableDeclaration"),(this.type===S._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===n.declarations.length?(this.options.ecmaVersion>=9&&(this.type===S._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,n)):(t>-1&&this.unexpected(t),this.parseFor(e,n))}var s=new H,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))},q.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,G|(i?0:J),!1,t)},q.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")},q.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")},q.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(S.braceL),this.labels.push(W),this.enterScope(0);for(var i=!1;this.type!==S.braceR;)if(this.type===S._case||this.type===S._default){var n=this.type===S._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),n?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!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")},q.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 Y=[];q.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 i="Identifier"===t.param.type;this.enterScope(i?32:0),this.checkLVal(t.param,i?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")},q.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},q.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(z),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},q.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")},q.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},q.parseLabeledStatement=function(e,t,i,n){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(n?-1===n.indexOf("label")?n+"label":n:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")},q.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},q.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 i=this.parseStatement(null);t.body.push(i)}return e&&this.exitScope(),this.finishNode(t,"BlockStatement")},q.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")},q.parseForIn=function(e,t){var i=this.type===S._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!i||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)?this.raise(t.start,(i?"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=i?this.parseExpression():this.parseMaybeAssign(),this.expect(S.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")},q.parseVar=function(e,t,i){for(e.declarations=[],e.kind=i;;){var n=this.startNode();if(this.parseVarId(n,i),this.eat(S.eq)?n.init=this.parseMaybeAssign(t):"const"!==i||this.type===S._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===n.id.type||t&&(this.type===S._in||this.isContextual("of"))?n.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(n,"VariableDeclarator")),!this.eat(S.comma))break}return e},q.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLVal(e.id,"var"===t?1:2,!1)};var G=1,J=2;q.parseFunction=function(e,t,i,n){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===S.star&&t&J&&this.unexpected(),e.generator=this.eat(S.star)),this.options.ecmaVersion>=8&&(e.async=!!n),t&G&&(e.id=4&t&&this.type!==S.name?null:this.parseIdent(),!e.id||t&J||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(j(e.async,e.generator)),t&G||(e.id=this.type===S.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1),this.yieldPos=r,this.awaitPos=s,this.awaitIdentPos=a,this.finishNode(e,t&G?"FunctionDeclaration":"FunctionExpression")},q.parseFunctionParams=function(e){this.expect(S.parenL),e.params=this.parseBindingList(S.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},q.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var n=this.startNode(),r=!1;for(n.body=[],this.expect(S.braceL);!this.eat(S.braceR);){var s=this.parseClassElement(null!==e.superClass);s&&(n.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(n,"ClassBody"),this.strict=i,this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},q.parseClassElement=function(e){var t=this;if(this.eat(S.semi))return null;var i=this.startNode(),n=function(e,n){void 0===n&&(n=!1);var r=t.start,s=t.startLoc;return!(!t.eatContextual(e)||(t.type===S.parenL||n&&t.canInsertSemicolon())&&(i.key&&t.unexpected(),i.computed=!1,i.key=t.startNodeAt(r,s),i.key.name=e,t.finishNode(i.key,"Identifier"),1))};i.kind="method",i.static=n("static");var r=this.eat(S.star),s=!1;r||(this.options.ecmaVersion>=8&&n("async",!0)?(s=!0,r=this.options.ecmaVersion>=9&&this.eat(S.star)):n("get")?i.kind="get":n("set")&&(i.kind="set")),i.key||this.parsePropertyName(i);var a=i.key,o=!1;return i.computed||i.static||!("Identifier"===a.type&&"constructor"===a.name||"Literal"===a.type&&"constructor"===a.value)?i.static&&"Identifier"===a.type&&"prototype"===a.name&&this.raise(a.start,"Classes may not have a static property named prototype"):("method"!==i.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"),i.kind="constructor",o=e),this.parseClassMethod(i,r,s,o),"get"===i.kind&&0!==i.value.params.length&&this.raiseRecoverable(i.value.start,"getter should have no params"),"set"===i.kind&&1!==i.value.params.length&&this.raiseRecoverable(i.value.start,"setter should have exactly one param"),"set"===i.kind&&"RestElement"===i.value.params[0].type&&this.raiseRecoverable(i.value.params[0].start,"Setter cannot use rest params"),i},q.parseClassMethod=function(e,t,i,n){return e.value=this.parseMethod(t,i,n),this.finishNode(e,"MethodDefinition")},q.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)},q.parseClassSuper=function(e){e.superClass=this.eat(S._extends)?this.parseExprSubscripts():null},q.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 i;if(this.checkExport(t,"default",this.lastTokStart),this.type===S._function||(i=this.isAsyncFunction())){var n=this.startNode();this.next(),i&&this.next(),e.declaration=this.parseFunction(n,4|G,!1,i)}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",i&&this.checkPatternErrors(i,!0);for(var n=0,r=e.properties;n=8&&!s&&"async"===a.name&&!this.canInsertSemicolon()&&this.eat(S._function))return this.parseFunction(this.startNodeAt(n,r),0,!1,!0);if(i&&!this.canInsertSemicolon()){if(this.eat(S.arrow))return this.parseArrowExpression(this.startNodeAt(n,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(n,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(i);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()}},K.parseDynamicImport=function(){var e=this.startNode();return this.next(),this.type!==S.parenL&&this.unexpected(),this.finishNode(e,"Import")},K.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")},K.parseParenExpression=function(){this.expect(S.parenL);var e=this.parseExpression();return this.expect(S.parenR),e},K.parseParenAndDistinguishExpression=function(e){var t,i=this.start,n=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 H,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,m=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(i,n,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,m)):t=c[0]}else t=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(i,n);return g.expression=t,this.finishNode(g,"ParenthesizedExpression")}return t},K.parseParenItem=function(e){return e},K.parseParenArrowList=function(e,t,i){return this.parseArrowExpression(this.startNodeAt(e,t),i)};var Q=[];K.parseNew=function(){var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(S.dot)){e.meta=t;var i=this.containsEsc;return e.property=this.parseIdent(!0),("target"!==e.property.name||i)&&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 n=this.start,r=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(),n,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=Q,this.finishNode(e,"NewExpression")},K.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===S.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value,cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),i.tail=this.type===S.backQuote,this.finishNode(i,"TemplateElement")},K.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var n=this.parseTemplateElement({isTagged:t});for(i.quasis=[n];!n.tail;)this.type===S.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(S.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(S.braceR),i.quasis.push(n=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")},K.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))},K.parseObj=function(e,t){var i=this.startNode(),n=!0,r={};for(i.properties=[],this.next();!this.eat(S.braceR);){if(n)n=!1;else if(this.expect(S.comma),this.afterTrailingComma(S.braceR))break;var s=this.parseProperty(e,t);e||this.checkPropClash(s,r,t),i.properties.push(s)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")},K.parseProperty=function(e,t){var i,n,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||(i=this.eat(S.star)));var o=this.containsEsc;return this.parsePropertyName(a),!e&&!o&&this.options.ecmaVersion>=8&&!i&&this.isAsyncProp(a)?(n=!0,i=this.options.ecmaVersion>=9&&this.eat(S.star),this.parsePropertyName(a,t)):n=!1,this.parsePropertyValue(a,e,i,n,r,s,t,o),this.finishNode(a,"Property")},K.parsePropertyValue=function(e,t,i,n,r,s,a,o){if((i||n)&&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(i,n);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?((i||n)&&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{(i||n)&&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")}},K.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)},K.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},K.parseMethod=function(e,t,i){var n=this.startNode(),r=this.yieldPos,s=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=e),this.options.ecmaVersion>=8&&(n.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|j(t,n.generator)|(i?128:0)),this.expect(S.parenL),n.params=this.parseBindingList(S.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1,!0),this.yieldPos=r,this.awaitPos=s,this.awaitIdentPos=a,this.finishNode(n,"FunctionExpression")},K.parseArrowExpression=function(e,t,i){var n=this.yieldPos,r=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(16|j(i,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1),this.yieldPos=n,this.awaitPos=r,this.awaitIdentPos=s,this.finishNode(e,"ArrowFunctionExpression")},K.parseFunctionBody=function(e,t,i){var n=t&&this.type!==S.braceL,r=this.strict,s=!1;if(n)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&&!i&&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},K.isSimpleParamList=function(e){for(var t=0,i=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();n=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){n=!0;break}if(o.var.push(e),this.inModule&&1&o.flags&&delete this.undefinedExports[e],3&o.flags)break}n&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")},ee.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},ee.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},ee.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(3&t.flags)return t}},ee.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,i){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new D(e,i)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},ne=B.prototype;function re(e,t,i,n){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=n),this.options.ranges&&(e.range[1]=i),e}ne.startNode=function(){return new ie(this,this.start,this.startLoc)},ne.startNodeAt=function(e,t){return new ie(this,e,t)},ne.finishNode=function(e,t){return re.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},ne.finishNodeAt=function(e,t,i,n){return re.call(this,e,t,i,n)};var se=function(e,t,i,n,r){this.token=e,this.isExpr=!!t,this.preserveSpace=!!i,this.override=n,this.generator=!!r},ae={b_stat:new se("{",!1),b_expr:new se("{",!0),b_tmpl:new se("${",!1),p_stat:new se("(",!1),p_expr:new se("(",!0),q_tmpl:new se("`",!0,!0,(function(e){return e.tryReadTemplateToken()})),f_stat:new se("function",!1),f_expr:new se("function",!0),f_expr_gen:new se("function",!0,!1,null,!0),f_gen:new se("function",!1,!1,null,!0)},oe=B.prototype;oe.initialContext=function(){return[ae.b_stat]},oe.braceIsBlock=function(e){var t=this.curContext();return t===ae.f_expr||t===ae.f_stat||(e!==S.colon||t!==ae.b_stat&&t!==ae.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===ae.b_stat:e!==S._var&&e!==S._const&&e!==S.name&&!this.exprAllowed):!t.isExpr)},oe.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},oe.updateContext=function(e){var t,i=this.type;i.keyword&&e===S.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr},S.parenR.updateContext=S.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===ae.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)?ae.b_stat:ae.b_expr),this.exprAllowed=!0},S.dollarBraceL.updateContext=function(){this.context.push(ae.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?ae.p_stat:ae.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()===ae.b_stat?this.context.push(ae.f_stat):this.context.push(ae.f_expr),this.exprAllowed=!1},S.backQuote.updateContext=function(){this.curContext()===ae.q_tmpl?this.context.pop():this.context.push(ae.q_tmpl),this.exprAllowed=!1},S.star.updateContext=function(e){if(e===S._function){var t=this.context.length-1;this.context[t]===ae.f_expr?this.context[t]=ae.f_expr_gen:this.context[t]=ae.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 ce="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",le=ce+" Extended_Pictographic",he={9:ce,10:le,11:le},ue="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",pe="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",de=pe+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",fe={9:pe,10:de,11:de+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"},me={};function ge(e){var t=me[e]={binary:M(he[e]+" "+ue),nonBinary:{General_Category:M(ue),Script:M(fe[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}ge(9),ge(10),ge(11);var ve=B.prototype,ye=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 be(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function xe(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function we(e){return e>=65&&e<=90||e>=97&&e<=122}function Se(e){return we(e)||95===e}function _e(e){return Se(e)||ke(e)}function ke(e){return e>=48&&e<=57}function Ee(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Ae(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function Ce(e){return e>=48&&e<=55}ye.prototype.reset=function(e,t,i){var n=-1!==i.indexOf("u");this.start=0|e,this.source=t+"",this.flags=i,this.switchU=n&&this.parser.options.ecmaVersion>=6,this.switchN=n&&this.parser.options.ecmaVersion>=9},ye.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},ye.prototype.at=function(e){var t=this.source,i=t.length;if(e>=i)return-1;var n=t.charCodeAt(e);if(!this.switchU||n<=55295||n>=57344||e+1>=i)return n;var r=t.charCodeAt(e+1);return r>=56320&&r<=57343?(n<<10)+r-56613888:n},ye.prototype.nextIndex=function(e){var t=this.source,i=t.length;if(e>=i)return i;var n,r=t.charCodeAt(e);return!this.switchU||r<=55295||r>=57344||e+1>=i||(n=t.charCodeAt(e+1))<56320||n>57343?e+1:e+2},ye.prototype.current=function(){return this.at(this.pos)},ye.prototype.lookahead=function(){return this.at(this.nextIndex(this.pos))},ye.prototype.advance=function(){this.pos=this.nextIndex(this.pos)},ye.prototype.eat=function(e){return this.current()===e&&(this.advance(),!0)},ve.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,n=0;n-1&&this.raise(e.start,"Duplicate regular expression flag")}},ve.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},ve.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,i=e.backReferenceNames;t=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,!0}return e.pos=t,!1},ve.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},ve.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},ve.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var n=0,r=-1;if(this.regexp_eatDecimalDigits(e)&&(n=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},ve.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)},ve.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},ve.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!xe(t)&&(e.lastIntValue=t,e.advance(),!0)},ve.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;-1!==(i=e.current())&&!xe(i);)e.advance();return e.pos!==t},ve.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))},ve.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")}},ve.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},ve.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=be(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=be(e.lastIntValue);return!0}return!1},ve.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=e.current();return e.advance(),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(e)&&(i=e.lastIntValue),function(e){return f(e,!0)||36===e||95===e}(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)},ve.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=e.current();return e.advance(),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(e)&&(i=e.lastIntValue),function(e){return m(e,!0)||36===e||95===e||8204===e||8205===e}(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)},ve.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)},ve.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),!0;if(i<=e.numCapturingParens)return!0;e.pos=t}return!1},ve.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},ve.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)},ve.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},ve.regexp_eatZero=function(e){return 48===e.current()&&!ke(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},ve.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)},ve.regexp_eatControlLetter=function(e){var t=e.current();return!!we(t)&&(e.lastIntValue=t%32,e.advance(),!0)},ve.regexp_eatRegExpUnicodeEscapeSequence=function(e){var t,i=e.pos;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var n=e.lastIntValue;if(e.switchU&&n>=55296&&n<=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*(n-55296)+(s-56320)+65536,!0}e.pos=r,e.lastIntValue=n}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=i}return!1},ve.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))},ve.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},ve.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},ve.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,n),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,r),!0}return!1},ve.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){O(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")},ve.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")},ve.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Se(t=e.current());)e.lastStringValue+=be(t),e.advance();return""!==e.lastStringValue},ve.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";_e(t=e.current());)e.lastStringValue+=be(t),e.advance();return""!==e.lastStringValue},ve.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},ve.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},ve.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;!e.switchU||-1!==t&&-1!==i||e.raise("Invalid character class"),-1!==t&&-1!==i&&t>i&&e.raise("Range out of order in character class")}}},ve.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var i=e.current();(99===i||Ce(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var n=e.current();return 93!==n&&(e.lastIntValue=n,e.advance(),!0)},ve.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)},ve.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!ke(t)&&95!==t||(e.lastIntValue=t%32,e.advance(),0))},ve.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},ve.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;ke(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t},ve.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Ee(i=e.current());)e.lastIntValue=16*e.lastIntValue+Ae(i),e.advance();return e.pos!==t},ve.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*i+e.lastIntValue:e.lastIntValue=8*t+i}else e.lastIntValue=t;return!0}return!1},ve.regexp_eatOctalDigit=function(e){var t=e.current();return Ce(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},ve.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var n=0;n>10),56320+(1023&e)))}Te.next=function(){this.options.onToken&&this.options.onToken(new Ie(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Te.getToken=function(){return this.next(),new Ie(this)},"undefined"!=typeof Symbol&&(Te[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===S.eof,value:t}}}}),Te.curContext=function(){return this.context[this.context.length-1]},Te.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())},Te.readToken=function(e){return f(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},Te.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},Te.skipBlockComment=function(){var e,t=this.options.onComment&&this.curPosition(),i=this.pos,n=this.input.indexOf("*/",this.pos+=2);if(-1===n&&this.raise(this.pos-2,"Unterminated comment"),this.pos=n+2,this.options.locations)for(k.lastIndex=i;(e=k.exec(this.input))&&e.index8&&e<14||e>=5760&&A.test(String.fromCharCode(e))))break e;++this.pos}}},Te.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i)},Te.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))},Te.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)},Te.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,n=42===e?S.star:S.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++i,n=S.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(S.assign,i+1):this.finishOp(n,i)},Te.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)},Te.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(S.assign,2):this.finishOp(S.bitwiseXOR,1)},Te.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)},Te.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+i)?this.finishOp(S.assign,i+1):this.finishOp(S.bitShift,i)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(i=2),this.finishOp(S.relational,i)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},Te.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)},Te.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 '"+Pe(e)+"'")},Te.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)},Te.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var n=this.input.charAt(this.pos);if(_.test(n)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if("["===n)t=!0;else if("]"===n&&t)t=!1;else if("/"===n&&!t)break;e="\\"===n}++this.pos}var r=this.input.slice(i,this.pos);++this.pos;var s=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(s);var o=this.regexpState||(this.regexpState=new ye(this));o.reset(i,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})},Te.readInt=function(e,t){for(var i=this.pos,n=0,r=0,s=null==t?1/0:t;r=97?o-97+10:o>=65?o-65+10:o>=48&&o<=57?o-48:1/0)>=e)break;++this.pos,n=n*e+a}return this.pos===i||null!=t&&this.pos-i!==t?null:n},Te.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return null==i&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(i="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,i)},Te.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10)||this.raise(t,"Invalid number");var i=this.pos-t>=2&&48===this.input.charCodeAt(t);i&&this.strict&&this.raise(t,"Invalid number"),i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1);var n=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&110===n){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!==n||i||(++this.pos,this.readInt(10),n=this.input.charCodeAt(this.pos)),69!==n&&101!==n||i||(43!==(n=this.input.charCodeAt(++this.pos))&&45!==n||++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=i?parseInt(a,8):parseFloat(a);return this.finishToken(S.num,o)},Te.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},Te.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var n=this.input.charCodeAt(this.pos);if(n===e)break;92===n?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):(E(n,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(S.string,t)};var Oe={};Te.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==Oe)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},Te.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Oe;this.raise(e,t)},Te.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(96===i||36===i&&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===i?(this.pos+=2,this.finishToken(S.dollarBraceL)):(++this.pos,this.finishToken(S.backQuote));if(92===i)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(E(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(i)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},Te.readInvalidTemplateToken=function(){for(;this.pos=48&&t<=55){var i=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],n=parseInt(i,8);return n>255&&(i=i.slice(0,-1),n=parseInt(i,8)),this.pos+=i.length-1,t=this.input.charCodeAt(this.pos),"0"===i&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-i.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(n)}return E(t)?"":String.fromCharCode(t)}},Te.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return null===i&&this.invalidStringToken(t,"Bad character escape sequence"),i},Te.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,n=this.options.ecmaVersion>=6;this.pos{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.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,n=Symbol(),r=new WeakMap;class s{constructor(e,t,i){if(this._$cssResult$=!0,i!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const i=this.t;if(t&&void 0===e){const t=void 0!==i&&1===i.length;t&&(e=r.get(i)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&r.set(i,e))}return e}toString(){return this.cssText}}const a=(e,...t)=>{const i=1===e.length?e[0]:t.reduce(((t,i,n)=>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.")})(i)+e[n+1]),e[0]);return new s(i,e,n)},o=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return(e=>new s("string"==typeof e?e:e+"",void 0,n))(t)})(e):e; + */const e=window,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),r=new WeakMap;class s{constructor(e,t,i){if(this._$cssResult$=!0,i!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const i=this.t;if(t&&void 0===e){const t=void 0!==i&&1===i.length;t&&(e=r.get(i)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&r.set(i,e))}return e}toString(){return this.cssText}}const a=(e,...t)=>{const i=1===e.length?e[0]:t.reduce(((t,i,n)=>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.")})(i)+e[n+1]),e[0]);return new s(i,e,n)},o=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return(e=>new s("string"==typeof e?e:e+"",void 0,n))(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 i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},f=(e,t)=>t!==e&&(t==t||e==e),m={attribute:!0,type:String,converter:d,reflect:!1,hasChanged:f};class g 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,i)=>{const n=this._$Ep(i,t);void 0!==n&&(this._$Ev.set(n,i),e.push(n))})),e}static createProperty(e,t=m){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const i="symbol"==typeof e?Symbol():"__"+e,n=this.getPropertyDescriptor(e,i,t);void 0!==n&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,t,i){return{get(){return this[t]},set(n){const r=this[e];this[t]=n,this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||m}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 i of t)this.createProperty(i,e[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(o(e))}else void 0!==e&&t.push(o(e));return t}static _$Ep(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"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,i;(null!==(t=this._$ES)&&void 0!==t?t:this._$ES=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(i=e.hostConnected)||void 0===i||i.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 i;const n=null!==(i=this.shadowRoot)&&void 0!==i?i:this.attachShadow(this.constructor.shadowRootOptions);return((i,n)=>{t?i.adoptedStyleSheets=n.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet)):n.forEach((t=>{const n=document.createElement("style"),r=e.litNonce;void 0!==r&&n.setAttribute("nonce",r),n.textContent=t.cssText,i.appendChild(n)}))})(n,this.constructor.elementStyles),n}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,i){this._$AK(e,i)}_$EO(e,t,i=m){var n;const r=this.constructor._$Ep(e,i);if(void 0!==r&&!0===i.reflect){const s=(void 0!==(null===(n=i.converter)||void 0===n?void 0:n.toAttribute)?i.converter:d).toAttribute(t,i.type);this._$El=e,null==s?this.removeAttribute(r):this.setAttribute(r,s),this._$El=null}}_$AK(e,t){var i;const n=this.constructor,r=n._$Ev.get(e);if(void 0!==r&&this._$El!==r){const e=n.getPropertyOptions(r),s="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null===(i=e.converter)||void 0===i?void 0:i.fromAttribute)?e.converter:d;this._$El=r,this[r]=s.fromAttribute(t,e.type),this._$El=null}}requestUpdate(e,t,i){let n=!0;void 0!==e&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||f)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===i.reflect&&this._$El!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,i))):n=!1),!this.isUpdatePending&&n&&(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 i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),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(i)):this._$Ek()}catch(e){throw t=!1,this._$Ek(),e}t&&this._$AE(i)}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){}} + */;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 i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},f=(e,t)=>t!==e&&(t==t||e==e),m={attribute:!0,type:String,converter:d,reflect:!1,hasChanged:f};class g 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,i)=>{const n=this._$Ep(i,t);void 0!==n&&(this._$Ev.set(n,i),e.push(n))})),e}static createProperty(e,t=m){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const i="symbol"==typeof e?Symbol():"__"+e,n=this.getPropertyDescriptor(e,i,t);void 0!==n&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,t,i){return{get(){return this[t]},set(n){const r=this[e];this[t]=n,this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||m}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 i of t)this.createProperty(i,e[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(o(e))}else void 0!==e&&t.push(o(e));return t}static _$Ep(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"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,i;(null!==(t=this._$ES)&&void 0!==t?t:this._$ES=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(i=e.hostConnected)||void 0===i||i.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 i;const n=null!==(i=this.shadowRoot)&&void 0!==i?i:this.attachShadow(this.constructor.shadowRootOptions);return((i,n)=>{t?i.adoptedStyleSheets=n.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet)):n.forEach((t=>{const n=document.createElement("style"),r=e.litNonce;void 0!==r&&n.setAttribute("nonce",r),n.textContent=t.cssText,i.appendChild(n)}))})(n,this.constructor.elementStyles),n}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,i){this._$AK(e,i)}_$EO(e,t,i=m){var n;const r=this.constructor._$Ep(e,i);if(void 0!==r&&!0===i.reflect){const s=(void 0!==(null===(n=i.converter)||void 0===n?void 0:n.toAttribute)?i.converter:d).toAttribute(t,i.type);this._$El=e,null==s?this.removeAttribute(r):this.setAttribute(r,s),this._$El=null}}_$AK(e,t){var i;const n=this.constructor,r=n._$Ev.get(e);if(void 0!==r&&this._$El!==r){const e=n.getPropertyOptions(r),s="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null===(i=e.converter)||void 0===i?void 0:i.fromAttribute)?e.converter:d;this._$El=r,this[r]=s.fromAttribute(t,e.type),this._$El=null}}requestUpdate(e,t,i){let n=!0;void 0!==e&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||f)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===i.reflect&&this._$El!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,i))):n=!1),!this.isUpdatePending&&n&&(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 i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),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(i)):this._$Ek()}catch(e){throw t=!1,this._$Ek(),e}t&&this._$AE(i)}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;g.finalized=!0,g.elementProperties=new Map,g.elementStyles=[],g.shadowRootOptions={mode:"open"},null==p||p({ReactiveElement:g}),(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,O=/>/g,N=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),M=/'/g,L=/"/g,D=/^(?:script|style|textarea|title)$/i,$=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),R=$(1),j=($(2),Symbol.for("lit-noChange")),B=Symbol.for("lit-nothing"),V=new WeakMap,F=k.createTreeWalker(k,129,null,!1),U=(e,t)=>{const i=e.length-1,n=[];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:M):a===L||a===M?a=N:a===P||a===O?a=T:(a=N,r=void 0);const u=a===N&&e[t+1].startsWith("/>")?" ":"";s+=a===T?i+_:l>=0?(n.push(o),i.slice(0,l)+"$lit$"+i.slice(l)+w+u):i+w+(-2===l?(n.push(void 0),t):u)}const o=s+(e[i]||"")+(2===t?"":"");if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==x?x.createHTML(o):o,n]};class H{constructor({strings:e,_$litType$:t},i){let n;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,i),F.currentNode=this.el.content,2===t){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(n=F.nextNode())&&o.length0){n.textContent=b?b.emptyScript:"";for(let i=0;i2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=B}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,i,n){const r=this.strings;let s=!1;if(void 0===r)e=q(this,e,t,0),s=!A(e)||e!==this._$AH&&e!==j,s&&(this._$AH=e);else{const n=e;let a,o;for(e=r[0],a=0;ae}):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=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,T=/-->/g,P=/>/g,O=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),N=/'/g,M=/"/g,L=/^(?:script|style|textarea|title)$/i,D=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),$=D(1),R=(D(2),Symbol.for("lit-noChange")),j=Symbol.for("lit-nothing"),B=new WeakMap,V=k.createTreeWalker(k,129,null,!1);class F{constructor({strings:e,_$litType$:t},i){let n;this.parts=[];let r=0,s=0;const a=e.length-1,o=this.parts,[c,l]=((e,t)=>{const i=e.length-1,n=[];let r,s=2===t?"":"",a=I;for(let t=0;t"===c[0]?(a=null!=r?r:I,l=-1):void 0===c[1]?l=-2:(l=a.lastIndex-c[2].length,o=c[1],a=void 0===c[3]?O:'"'===c[3]?M:N):a===M||a===N?a=O:a===T||a===P?a=I:(a=O,r=void 0);const u=a===O&&e[t+1].startsWith("/>")?" ":"";s+=a===I?i+_:l>=0?(n.push(o),i.slice(0,l)+"$lit$"+i.slice(l)+w+u):i+w+(-2===l?(n.push(void 0),t):u)}const o=s+(e[i]||"")+(2===t?"":"");if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==x?x.createHTML(o):o,n]})(e,t);if(this.el=F.createElement(c,i),V.currentNode=this.el.content,2===t){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(n=V.nextNode())&&o.length0){n.textContent=b?b.emptyScript:"";for(let i=0;iC(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]))(e)?this.k(e):this.g(e)}O(e,t=this._$AB){return this._$AA.parentNode.insertBefore(e,t)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}g(e){this._$AH!==j&&A(this._$AH)?this._$AA.nextSibling.data=e:this.T(k.createTextNode(e)),this._$AH=e}$(e){var t;const{values:i,_$litType$:n}=e,r="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=F.createElement(n.h,this.options)),n);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===r)this._$AH.p(i);else{const e=new H(r,this),t=e.v(this.options);e.p(i),this.T(t),this._$AH=e}}_$AC(e){let t=B.get(e.strings);return void 0===t&&B.set(e.strings,t=new F(e)),t}k(e){C(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,n=0;for(const r of e)n===t.length?t.push(i=new q(this.O(E()),this.O(E()),this,this.options)):i=t[n],i._$AI(r),n++;n2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=j}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,i,n){const r=this.strings;let s=!1;if(void 0===r)e=U(this,e,t,0),s=!A(e)||e!==this._$AH&&e!==R,s&&(this._$AH=e);else{const n=e;let a,o;for(e=r[0],a=0;a{var n,r;const s=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:t;let a=s._$litPart$;if(void 0===a){const e=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;s._$litPart$=a=new W(t.insertBefore(E(),e),e,void 0,null!=i?i:{})}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 j}}ie.finalized=!0,ie._$litElement$=!0,null===(ee=globalThis.litElementHydrateSupport)||void 0===ee||ee.call(globalThis,{LitElement:ie});const ne=globalThis.litElementPolyfillSupport;null==ne||ne({LitElement:ie});(null!==(te=globalThis.litElementVersions)&&void 0!==te?te:globalThis.litElementVersions=[]).push("3.2.2"); +var Q,Z;null==K||K(F,q),(null!==(v=y.litHtmlVersions)&&void 0!==v?v:y.litHtmlVersions=[]).push("2.4.0");class ee extends g{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;const i=super.createRenderRoot();return null!==(e=(t=this.renderOptions).renderBefore)&&void 0!==e||(t.renderBefore=i.firstChild),i}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,i)=>{var n,r;const s=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:t;let a=s._$litPart$;if(void 0===a){const e=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;s._$litPart$=a=new q(t.insertBefore(E(),e),e,void 0,null!=i?i:{})}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 R}}ee.finalized=!0,ee._$litElement$=!0,null===(Q=globalThis.litElementHydrateSupport)||void 0===Q||Q.call(globalThis,{LitElement:ee});const te=globalThis.litElementPolyfillSupport;null==te||te({LitElement:ee}),(null!==(Z=globalThis.litElementVersions)&&void 0!==Z?Z: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:i,elements:n}=t;return{kind:i,elements:n,finisher(t){customElements.define(e,t)}}})(e,t),se=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(i){i.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(i){i.createProperty(t.key,e)}};function ae(e){return(t,i)=>void 0!==i?((e,t,i)=>{t.constructor.createProperty(i,e)})(e,t,i):se(e,t)} +const ie=e=>t=>"function"==typeof t?((e,t)=>(customElements.define(e,t),t))(e,t):((e,t)=>{const{kind:i,elements:n}=t;return{kind:i,elements:n,finisher(t){customElements.define(e,t)}}})(e,t),ne=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(i){i.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(i){i.createProperty(t.key,e)}};function re(e){return(t,i)=>void 0!==i?((e,t,i)=>{t.constructor.createProperty(i,e)})(e,t,i):ne(e,t) /** * @license * Copyright 2021 Google LLC @@ -132,17 +128,16 @@ const re=e=>t=>"function"==typeof t?((e,t)=>(customElements.define(e,t),t))(e,t) * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const Bn=1,Vn=2,Fn=e=>(...t)=>({_$litDirective$:e,values:t});class Un{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}} +const Dn=e=>(...t)=>({_$litDirective$:e,values:t});class $n{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$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 Hn=Fn(class extends Un{constructor(e){var t;if(super(e),e.type!==Bn||"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,i)=>{const n=e[i];return null==n?t:t+`${i=i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`}),"")}update(e,[t]){const{style:i}=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("-")?i.removeProperty(e):i[e]="")}));for(const e in t){const n=t[e];null!=n&&(this.vt.add(e),e.includes("-")?i.setProperty(e,n):i[e]=n)}return j}});var qn,zn=function(e,t,i,n){var r,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let Wn=qn=class extends ie{constructor(){super(...arguments),this.styles={dummy:`calc(100vh - ${this.appHeaderHeight}px - ${this.cardHeaderHeight}px)`}}render(){var e,t;return this.config?R` + */const Rn=Dn(class extends $n{constructor(e){var t;if(super(e),1!==e.type||"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,i)=>{const n=e[i];return null==n?t:t+`${i=i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`}),"")}update(e,[t]){const{style:i}=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("-")?i.removeProperty(e):i[e]="")}));for(const e in t){const n=t[e];null!=n&&(this.vt.add(e),e.includes("-")?i.setProperty(e,n):i[e]=n)}return R}});var jn,Bn=function(e,t,i,n){var r,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let Vn=jn=class extends ee{constructor(){super(...arguments),this.styles={dummy:`calc(100vh - ${this.appHeaderHeight}px - ${this.cardHeaderHeight}px)`}}render(){var e,t;return this.config?$` - ${this.isDisplayCardHeader?R`

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

`:""} + ${this.isDisplayCardHeader?$`

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

`:""} -
+
- `:R``}static get styles(){return a` + `:$``}static get styles(){return a` /* header (main toolbar) */ /* --header-height: 56px; */ @@ -166,7 +161,7 @@ const Hn=Fn(class extends Un{constructor(e){var t;if(super(e),e.type!==Bn||"styl 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=dn.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?qn.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)}};Wn.cardHeaderHeight=76,zn([ae({type:Object})],Wn.prototype,"hass",void 0),zn([ae({type:Boolean})],Wn.prototype,"isPanel",void 0),zn([ae({type:Boolean})],Wn.prototype,"editMode",void 0),zn([ae({type:Object})],Wn.prototype,"config",void 0),zn([ae({type:String})],Wn.prototype,"examplespath",void 0),zn([ae({type:Boolean})],Wn.prototype,"isDemo",void 0),zn([ae({type:Function})],Wn.prototype,"notify",void 0),Wn=qn=zn([re("floorplan-card")],Wn);var Yn,Gn=function(e,t,i,n){var r,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let Jn=Yn=class extends ie{constructor(){super(...arguments),this.styles={height:"calc(100vh)"}}render(){var e,t,i;return R` + `}get isFullHeight(){var e;return null===(e=this.config)||void 0===e?void 0:e.full_height}get view(){return this._view||(this._view=ln.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?jn.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)}};Vn.cardHeaderHeight=76,Bn([re({type:Object})],Vn.prototype,"hass",void 0),Bn([re({type:Boolean})],Vn.prototype,"isPanel",void 0),Bn([re({type:Boolean})],Vn.prototype,"editMode",void 0),Bn([re({type:Object})],Vn.prototype,"config",void 0),Bn([re({type:String})],Vn.prototype,"examplespath",void 0),Bn([re({type:Boolean})],Vn.prototype,"isDemo",void 0),Bn([re({type:Function})],Vn.prototype,"notify",void 0),Vn=jn=Bn([ie("floorplan-card")],Vn);var Fn,Un=function(e,t,i,n){var r,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let Hn=Fn=class extends ee{constructor(){super(...arguments),this.styles={height:"calc(100vh)"}}render(){var e,t,i;return $` @@ -176,7 +171,7 @@ const Hn=Fn(class extends Un{constructor(e){var t;if(super(e),e.type!==Bn||"styl -
+
@@ -195,13 +190,13 @@ const Hn=Fn(class extends Un{constructor(e){var t;if(super(e),e.type!==Bn||"styl [hidden] { display: none !important; } - `}get appHeaderHeight(){return this.isDemo?0:this.showAppHeader?Yn.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)}};Jn.appHeaderHeight=64,Gn([ae({type:Object})],Jn.prototype,"hass",void 0),Gn([ae({type:Boolean})],Jn.prototype,"narrow",void 0),Gn([ae({type:Object})],Jn.prototype,"panel",void 0),Gn([ae({type:Boolean})],Jn.prototype,"showSideBar",void 0),Gn([ae({type:Boolean})],Jn.prototype,"showAppHeader",void 0),Gn([ae({type:String})],Jn.prototype,"examplespath",void 0),Gn([ae({type:Boolean})],Jn.prototype,"isDemo",void 0),Gn([ae({type:Function})],Jn.prototype,"notify",void 0),Jn=Yn=Gn([re("floorplan-panel")],Jn); + `}get appHeaderHeight(){return this.isDemo?0:this.showAppHeader?Fn.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)}};Hn.appHeaderHeight=64,Un([re({type:Object})],Hn.prototype,"hass",void 0),Un([re({type:Boolean})],Hn.prototype,"narrow",void 0),Un([re({type:Object})],Hn.prototype,"panel",void 0),Un([re({type:Boolean})],Hn.prototype,"showSideBar",void 0),Un([re({type:Boolean})],Hn.prototype,"showAppHeader",void 0),Un([re({type:String})],Hn.prototype,"examplespath",void 0),Un([re({type:Boolean})],Hn.prototype,"isDemo",void 0),Un([re({type:Function})],Hn.prototype,"notify",void 0),Hn=Fn=Un([ie("floorplan-panel")],Hn); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -class Xn extends Un{constructor(e){if(super(e),this.it=B,e.type!==Vn)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===B||null==e)return this._t=void 0,this.it=e;if(e===j)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}Xn.directiveName="unsafeHTML",Xn.resultType=1;const Kn=Fn(Xn);var Qn=function(e,t,i,n){var r,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let Zn=class extends ie{constructor(){super(...arguments),this.lang="",this.code=""}render(){return R`
${Kn(this.code)}
`}static get styles(){return a` +class qn extends $n{constructor(e){if(super(e),this.it=j,2!==e.type)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===j||null==e)return this._t=void 0,this.it=e;if(e===R)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}qn.directiveName="unsafeHTML",qn.resultType=1;const zn=Dn(qn);var Wn=function(e,t,i,n){var r,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let Yn=class extends ee{constructor(){super(...arguments),this.lang="",this.code=""}render(){return $`
${zn(this.code)}
`}static get styles(){return a` .hljs { display: block; overflow-x: auto; @@ -290,16 +285,16 @@ class Xn extends Un{constructor(e){if(super(e),this.it=B,e.type!==Vn)throw Error .hljs-strong { font-weight: bold; } - `}};Qn([ae({type:String})],Zn.prototype,"lang",void 0),Qn([ae({type:String})],Zn.prototype,"code",void 0),Zn=Qn([re("code-block")],Zn);var er=function(e,t,i,n){var r,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a},tr=function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function a(e){try{c(n.next(e))}catch(e){s(e)}}function o(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}c((n=n.apply(e,t||[])).next())}))};let ir=class extends ie{render(){return R` + `}};Wn([re({type:String})],Yn.prototype,"lang",void 0),Wn([re({type:String})],Yn.prototype,"code",void 0),Yn=Wn([ie("code-block")],Yn);var Gn=function(e,t,i,n){var r,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let Jn=class extends ee{render(){return $`
- ${this.example.isCard?R``:R` `:$`
- `}static get styles(){return a``}update(e){const t=Object.create(null,{update:{get:()=>super.update}});return tr(this,void 0,void 0,(function*(){if(t.update.call(this,e),(e.has("example")||e.has("examplespath"))&&this.example&&this.examplespath){const e=`${this.examplespath}/${this.example.dir}/${this.example.configFile}`,t=yield pn.fetchText(e,!0,this.examplespath,!1);if(this.config=pn.parseYaml(t),this.configYaml=t,this.example.simulationFile){const e=`${this.examplespath}/${this.example.dir}/${this.example.simulationFile}`,t=yield pn.fetchText(e,!0,this.examplespath,!1),i=pn.parseYaml(t);this.simulator=new _e(i,this.setHass.bind(this))}}}))}setHass(e){this.hass=e}};er([ae({type:Object})],ir.prototype,"hass",void 0),er([ae({type:Object})],ir.prototype,"config",void 0),er([ae({type:String})],ir.prototype,"configYaml",void 0),er([ae({type:String})],ir.prototype,"examplespath",void 0),er([ae({type:Object})],ir.prototype,"example",void 0),er([ae({type:Boolean})],ir.prototype,"isDemo",void 0),er([ae({type:Function})],ir.prototype,"notify",void 0),ir=er([re("floorplan-example")],ir);var nr=function(e,t,i,n){var r,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let rr=class extends ie{constructor(){super(),this._toastText=""}render(){return R`
${this._toastText}
`}static get styles(){return a` + `}static get styles(){return a``}update(e){const t=Object.create(null,{update:{get:()=>super.update}});return function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function a(e){try{c(n.next(e))}catch(e){s(e)}}function o(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}c((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){if(t.update.call(this,e),(e.has("example")||e.has("examplespath"))&&this.example&&this.examplespath){const e=`${this.examplespath}/${this.example.dir}/${this.example.configFile}`,t=yield cn.fetchText(e,!0,this.examplespath,!1);if(this.config=cn.parseYaml(t),this.configYaml=t,this.example.simulationFile){const e=`${this.examplespath}/${this.example.dir}/${this.example.simulationFile}`,t=yield cn.fetchText(e,!0,this.examplespath,!1),i=cn.parseYaml(t);this.simulator=new we(i,this.setHass.bind(this))}}}))}setHass(e){this.hass=e}};Gn([re({type:Object})],Jn.prototype,"hass",void 0),Gn([re({type:Object})],Jn.prototype,"config",void 0),Gn([re({type:String})],Jn.prototype,"configYaml",void 0),Gn([re({type:String})],Jn.prototype,"examplespath",void 0),Gn([re({type:Object})],Jn.prototype,"example",void 0),Gn([re({type:Boolean})],Jn.prototype,"isDemo",void 0),Gn([re({type:Function})],Jn.prototype,"notify",void 0),Jn=Gn([ie("floorplan-example")],Jn);var Xn=function(e,t,i,n){var r,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let Kn=class extends ee{constructor(){super(),this._toastText=""}render(){return $`
${this._toastText}
`}static get styles(){return a` :host { display: none; justify-content: center; @@ -385,8 +380,8 @@ class Xn extends Un{constructor(e){if(super(e),this.it=B,e.type!==Vn)throw Error opacity: 0; } } - `}firstUpdated(){this.style.setProperty("aria-live","assertive"),this.style.setProperty("aria-atomic","true"),this.style.setProperty("aria-relevant","all")}show(e=""){"show"===this.className||(this._toastText=e,this.className="show",setTimeout((()=>{this.className=this.className.replace("show","")}),3e3))}};nr([ae({type:String})],rr.prototype,"_toastText",void 0),rr=nr([re("lit-toast")],rr);var sr=function(e,t,i,n){var r,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let ar=class extends ie{constructor(){super(),this.floorplanExamples=[{name:"remote",dir:"remote",configFile:"remote.yaml",simulationFile:"simulations.yaml",isCard:!0},{name:"light",dir:"light",configFile:"light.yaml",simulationFile:"simulations.yaml",isCard:!0},{name:"ring",dir:"ring",configFile:"ring.yaml",simulationFile:"simulations.yaml",isCard:!0},{name:"rinnai",dir:"rinnai",configFile:"rinnai.yaml",simulationFile:"simulations.yaml",isCard:!0},{name:"floorplanner_home",dir:"floorplanner_home",configFile:"floorplanner_home.yaml",simulationFile:"simulations.yaml",isCard:!0},{name:"home",dir:"home",configFile:"home.yaml",simulationFile:"simulations.yaml",isCard:!1},{name:"multi_floor",dir:"multi_floor",configFile:"multi_floor.yaml",simulationFile:"simulations.yaml",isCard:!1}]}render(){var e;return R` - ${null===(e=this.examples)||void 0===e?void 0:e.map((e=>R` {this.className=this.className.replace("show","")}),3e3))}};Xn([re({type:String})],Kn.prototype,"_toastText",void 0),Kn=Xn([ie("lit-toast")],Kn);var Qn=function(e,t,i,n){var r,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let Zn=class extends ee{constructor(){super(),this.floorplanExamples=[{name:"remote",dir:"remote",configFile:"remote.yaml",simulationFile:"simulations.yaml",isCard:!0},{name:"light",dir:"light",configFile:"light.yaml",simulationFile:"simulations.yaml",isCard:!0},{name:"ring",dir:"ring",configFile:"ring.yaml",simulationFile:"simulations.yaml",isCard:!0},{name:"rinnai",dir:"rinnai",configFile:"rinnai.yaml",simulationFile:"simulations.yaml",isCard:!0},{name:"floorplanner_home",dir:"floorplanner_home",configFile:"floorplanner_home.yaml",simulationFile:"simulations.yaml",isCard:!0},{name:"home",dir:"home",configFile:"home.yaml",simulationFile:"simulations.yaml",isCard:!1},{name:"multi_floor",dir:"multi_floor",configFile:"multi_floor.yaml",simulationFile:"simulations.yaml",isCard:!1}]}render(){var e;return $` + ${null===(e=this.examples)||void 0===e?void 0:e.map((e=>$` `))} - `}static get styles(){return a``}connectedCallback(){if(super.connectedCallback(),this.dataset.include&&!this.examples){const e=this.dataset.include.split(",").map((e=>e.trim()));this.examples=this.floorplanExamples.filter((t=>e.includes(t.name.toLocaleLowerCase())))}}get litToast(){var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("lit-toast")}notify(e){this.litToast.show(e)}};sr([ae({type:String})],ar.prototype,"examplespath",void 0),sr([ae({type:Array})],ar.prototype,"examples",void 0),ar=sr([re("floorplan-examples")],ar)})()})(); \ No newline at end of file + `}static get styles(){return a``}connectedCallback(){if(super.connectedCallback(),this.dataset.include&&!this.examples){const e=this.dataset.include.split(",").map((e=>e.trim()));this.examples=this.floorplanExamples.filter((t=>e.includes(t.name.toLocaleLowerCase())))}}get litToast(){var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("lit-toast")}notify(e){this.litToast.show(e)}};Qn([re({type:String})],Zn.prototype,"examplespath",void 0),Qn([re({type:Array})],Zn.prototype,"examples",void 0),Zn=Qn([ie("floorplan-examples")],Zn)})()})(); \ No newline at end of file