@webqit/oohtml 4.3.15 → 4.3.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -3,7 +3,7 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1
3
3
  `,r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(ft).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=h.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=t.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Me),this.regexpState=null,this.privateNameStack=[]},vt={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};z.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};vt.inFunction.get=function(){return(this.currentVarScope().flags&le)>0};vt.inGenerator.get=function(){return(this.currentVarScope().flags&Kr)>0&&!this.currentVarScope().inClassFieldInit};vt.inAsync.get=function(){return(this.currentVarScope().flags&Ji)>0&&!this.currentVarScope().inClassFieldInit};vt.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&Ve)return!1;if(t.flags&le)return(t.flags&Ji)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};vt.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&Zi)>0||i||this.options.allowSuperOutsideMethod};vt.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Jr)>0};vt.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};vt.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&(le|Ve))>0||i};vt.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Ve)>0};z.extend=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];for(var r=this,s=0;s<t.length;s++)r=t[s](r);return r};z.parse=function(t,i){return new this(i,t).parse()};z.parseExpressionAt=function(t,i,r){var s=new this(r,t,i);return s.nextToken(),s.parseExpression()};z.tokenizer=function(t,i){return new this(i,t)};Object.defineProperties(z.prototype,vt);var tt=z.prototype,zn=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;tt.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){ht.lastIndex=e,e+=ht.exec(this.input)[0].length;var t=zn.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){ht.lastIndex=e+t[0].length;var i=ht.exec(this.input),r=i.index+i[0].length,s=this.input.charAt(r);return s===";"||s==="}"||ft.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(s)||s==="!"&&this.input.charAt(r+1)==="=")}e+=t[0].length,ht.lastIndex=e,e+=ht.exec(this.input)[0].length,this.input[e]===";"&&e++}};tt.eat=function(e){return this.type===e?(this.next(),!0):!1};tt.isContextual=function(e){return this.type===h.name&&this.value===e&&!this.containsEsc};tt.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};tt.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};tt.canInsertSemicolon=function(){return this.type===h.eof||this.type===h.braceR||ft.test(this.input.slice(this.lastTokEnd,this.start))};tt.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};tt.semicolon=function(){!this.eat(h.semi)&&!this.insertSemicolon()&&this.unexpected()};tt.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0};tt.expect=function(e){this.eat(e)||this.unexpected()};tt.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var fi=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};tt.checkPatternErrors=function(e,t){if(!!e){e.trailingComma>-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,t?"Assigning to rvalue":"Parenthesized pattern")}};tt.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,r=e.doubleProto;if(!t)return i>=0||r>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property")};tt.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")};tt.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var I=z.prototype;I.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==h.eof;){var i=this.parseStatement(null,!0,t);e.body.push(i)}if(this.inModule)for(var r=0,s=Object.keys(this.undefinedExports);r<s.length;r+=1){var n=s[r];this.raiseRecoverable(this.undefinedExports[n].start,"Export '"+n+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var rr={kind:"loop"},Qn={kind:"switch"};I.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;ht.lastIndex=this.pos;var t=ht.exec(this.input),i=this.pos+t[0].length,r=this.input.charCodeAt(i);if(r===91||r===92)return!0;if(e)return!1;if(r===123||r>55295&&r<56320)return!0;if(Ot(r,!0)){for(var s=i+1;ue(r=this.input.charCodeAt(s),!0);)++s;if(r===92||r>55295&&r<56320)return!0;var n=this.input.slice(i,s);if(!Dn.test(n))return!0}return!1};I.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;ht.lastIndex=this.pos;var e=ht.exec(this.input),t=this.pos+e[0].length,i;return!ft.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(ue(i=this.input.charCodeAt(t+8))||i>55295&&i<56320))};I.parseStatement=function(e,t,i){var r=this.type,s=this.startNode(),n;switch(this.isLet(e)&&(r=h._var,n="let"),r){case h._break:case h._continue:return this.parseBreakContinueStatement(s,r.keyword);case h._debugger:return this.parseDebuggerStatement(s);case h._do:return this.parseDoStatement(s);case h._for:return this.parseForStatement(s);case h._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case h._class:return e&&this.unexpected(),this.parseClass(s,!0);case h._if:return this.parseIfStatement(s);case h._return:return this.parseReturnStatement(s);case h._switch:return this.parseSwitchStatement(s);case h._throw:return this.parseThrowStatement(s);case h._try:return this.parseTryStatement(s);case h._const:case h._var:return n=n||this.value,e&&n!=="var"&&this.unexpected(),this.parseVarStatement(s,n);case h._while:return this.parseWhileStatement(s);case h._with:return this.parseWithStatement(s);case h.braceL:return this.parseBlock(!0,s);case h.semi:return this.parseEmptyStatement(s);case h._export:case h._import:if(this.options.ecmaVersion>10&&r===h._import){ht.lastIndex=this.pos;var a=ht.exec(this.input),o=this.pos+a[0].length,u=this.input.charCodeAt(o);if(u===40||u===46)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===h._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===h.name&&l.type==="Identifier"&&this.eat(h.colon)?this.parseLabeledStatement(s,c,l,e):this.parseExpressionStatement(s,l)}};I.parseBreakContinueStatement=function(e,t){var i=t==="break";this.next(),this.eat(h.semi)||this.insertSemicolon()?e.label=null:this.type!==h.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var r=0;r<this.labels.length;++r){var s=this.labels[r];if((e.label==null||s.name===e.label.name)&&(s.kind!=null&&(i||s.kind==="loop")||e.label&&i))break}return r===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")};I.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};I.parseDoStatement=function(e){return this.next(),this.labels.push(rr),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(h._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(h.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};I.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(rr),this.enterScope(0),this.expect(h.parenL),this.type===h.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===h._var||this.type===h._const||i){var r=this.startNode(),s=i?"let":this.value;return this.next(),this.parseVar(r,!0,s),this.finishNode(r,"VariableDeclaration"),(this.type===h._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&r.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===h._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,r)):(t>-1&&this.unexpected(t),this.parseFor(e,r))}var n=this.isContextual("let"),a=!1,o=new fi,u=this.parseExpression(t>-1?"await":!0,o);return this.type===h._in||(a=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===h._in?t>-1&&this.unexpected(t):e.await=t>-1),n&&a&&this.raise(u.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(u,!1,o),this.checkLValPattern(u),this.parseForIn(e,u)):(this.checkExpressionErrors(o,!0),t>-1&&this.unexpected(t),this.parseFor(e,u))};I.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,Le|(i?0:Xi),!1,t)};I.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(h._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};I.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(h.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};I.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(h.braceL),this.labels.push(Qn),this.enterScope(0);for(var t,i=!1;this.type!==h.braceR;)if(this.type===h._case||this.type===h._default){var r=this.type===h._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(h.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")};I.parseThrowStatement=function(e){return this.next(),ft.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 Gn=[];I.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===h._catch){var t=this.startNode();if(this.next(),this.eat(h.parenL)){t.param=this.parseBindingAtom();var i=t.param.type==="Identifier";this.enterScope(i?Yr:0),this.checkLValPattern(t.param,i?ts:It),this.expect(h.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(h._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};I.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")};I.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(rr),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};I.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")};I.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};I.parseLabeledStatement=function(e,t,i,r){for(var s=0,n=this.labels;s<n.length;s+=1){var a=n[s];a.name===t&&this.raise(i.start,"Label '"+t+"' is already declared")}for(var o=this.type.isLoop?"loop":this.type===h._switch?"switch":null,u=this.labels.length-1;u>=0;u--){var c=this.labels[u];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf("label")===-1?r+"label":r:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")};I.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};I.parseBlock=function(e,t,i){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(h.braceL),e&&this.enterScope(0);this.type!==h.braceR;){var r=this.parseStatement(null);t.body.push(r)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};I.parseFor=function(e,t){return e.init=t,this.expect(h.semi),e.test=this.type===h.semi?null:this.parseExpression(),this.expect(h.semi),e.update=this.type===h.parenR?null:this.parseExpression(),this.expect(h.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};I.parseForIn=function(e,t){var i=this.type===h._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(h.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")};I.parseVar=function(e,t,i){for(e.declarations=[],e.kind=i;;){var r=this.startNode();if(this.parseVarId(r,i),this.eat(h.eq)?r.init=this.parseMaybeAssign(t):i==="const"&&!(this.type===h._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():r.id.type!=="Identifier"&&!(t&&(this.type===h._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):r.init=null,e.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(h.comma))break}return e};I.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?ir:It,!1)};var Le=1,Xi=2,is=4;I.parseFunction=function(e,t,i,r,s){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===h.star&&t&Xi&&this.unexpected(),e.generator=this.eat(h.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&Le&&(e.id=t&is&&this.type!==h.name?null:this.parseIdent(),e.id&&!(t&Xi)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?ir:It:Zr));var n=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(er(e.async,e.generator)),t&Le||(e.id=this.type===h.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,s),this.yieldPos=n,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,t&Le?"FunctionDeclaration":"FunctionExpression")};I.parseFunctionParams=function(e){this.expect(h.parenL),e.params=this.parseBindingList(h.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};I.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),s=this.startNode(),n=!1;for(s.body=[],this.expect(h.braceL);this.type!==h.braceR;){var a=this.parseClassElement(e.superClass!==null);a&&(s.body.push(a),a.type==="MethodDefinition"&&a.kind==="constructor"?(n&&this.raise(a.start,"Duplicate constructor in the same class"),n=!0):a.key&&a.key.type==="PrivateIdentifier"&&Kn(r,a)&&this.raiseRecoverable(a.key.start,"Identifier '#"+a.key.name+"' has already been declared"))}return this.strict=i,this.next(),e.body=this.finishNode(s,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};I.parseClassElement=function(e){if(this.eat(h.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),r="",s=!1,n=!1,a="method",o=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(h.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===h.star?o=!0:r="static"}if(i.static=o,!r&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===h.star)&&!this.canInsertSemicolon()?n=!0:r="async"),!r&&(t>=9||!n)&&this.eat(h.star)&&(s=!0),!r&&!n&&!s){var u=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?a=u:r=u)}if(r?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=r,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===h.parenL||a!=="method"||s||n){var c=!i.static&&ci(i,"constructor"),l=c&&e;c&&a!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=c?"constructor":a,this.parseClassMethod(i,s,n,l)}else this.parseClassField(i);return i};I.isClassElementNameStart=function(){return this.type===h.name||this.type===h.privateId||this.type===h.num||this.type===h.string||this.type===h.bracketL||this.type.keyword};I.parseClassElementName=function(e){this.type===h.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};I.parseClassMethod=function(e,t,i,r){var s=e.key;e.kind==="constructor"?(t&&this.raise(s.start,"Constructor can't be a generator"),i&&this.raise(s.start,"Constructor can't be an async method")):e.static&&ci(e,"prototype")&&this.raise(s.start,"Classes may not have a static property named prototype");var n=e.value=this.parseMethod(t,i,r);return e.kind==="get"&&n.params.length!==0&&this.raiseRecoverable(n.start,"getter should have no params"),e.kind==="set"&&n.params.length!==1&&this.raiseRecoverable(n.start,"setter should have exactly one param"),e.kind==="set"&&n.params[0].type==="RestElement"&&this.raiseRecoverable(n.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};I.parseClassField=function(e){if(ci(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&ci(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(h.eq)){var t=this.currentThisScope(),i=t.inClassFieldInit;t.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),t.inClassFieldInit=i}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};I.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(Ve|Zi);this.type!==h.braceR;){var i=this.parseStatement(null);e.body.push(i)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};I.parseClassId=function(e,t){this.type===h.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,It,!1)):(t===!0&&this.unexpected(),e.id=null)};I.parseClassSuper=function(e){e.superClass=this.eat(h._extends)?this.parseExprSubscripts(null,!1):null};I.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};I.exitClassBody=function(){for(var e=this.privateNameStack.pop(),t=e.declared,i=e.used,r=this.privateNameStack.length,s=r===0?null:this.privateNameStack[r-1],n=0;n<i.length;++n){var a=i[n];De(t,a.name)||(s?s.used.push(a):this.raiseRecoverable(a.start,"Private field '#"+a.name+"' must be declared in an enclosing class"))}};function Kn(e,t){var i=t.key.name,r=e[i],s="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(s=(t.static?"s":"i")+t.kind),r==="iget"&&s==="iset"||r==="iset"&&s==="iget"||r==="sget"&&s==="sset"||r==="sset"&&s==="sget"?(e[i]="true",!1):r?!0:(e[i]=s,!1)}function ci(e,t){var i=e.computed,r=e.key;return!i&&(r.type==="Identifier"&&r.name===t||r.type==="Literal"&&r.value===t)}I.parseExport=function(e,t){if(this.next(),this.eat(h.star))return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==h.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(h._default)){this.checkExport(t,"default",this.lastTokStart);var i;if(this.type===h._function||(i=this.isAsyncFunction())){var r=this.startNode();this.next(),i&&this.next(),e.declaration=this.parseFunction(r,Le|is,!1,i)}else if(this.type===h._class){var s=this.startNode();e.declaration=this.parseClass(s,"nullableID")}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==h.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var n=0,a=e.specifiers;n<a.length;n+=1){var o=a[n];this.checkUnreserved(o.local),this.checkLocalExport(o.local),o.local.type==="Literal"&&this.raise(o.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};I.checkExport=function(e,t,i){!e||(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),De(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)};I.checkPatternExport=function(e,t){var i=t.type;if(i==="Identifier")this.checkExport(e,t,t.start);else if(i==="ObjectPattern")for(var r=0,s=t.properties;r<s.length;r+=1){var n=s[r];this.checkPatternExport(e,n)}else if(i==="ArrayPattern")for(var a=0,o=t.elements;a<o.length;a+=1){var u=o[a];u&&this.checkPatternExport(e,u)}else i==="Property"?this.checkPatternExport(e,t.value):i==="AssignmentPattern"?this.checkPatternExport(e,t.left):i==="RestElement"?this.checkPatternExport(e,t.argument):i==="ParenthesizedExpression"&&this.checkPatternExport(e,t.expression)};I.checkVariableExport=function(e,t){if(!!e)for(var i=0,r=t;i<r.length;i+=1){var s=r[i];this.checkPatternExport(e,s.id)}};I.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};I.parseExportSpecifiers=function(e){var t=[],i=!0;for(this.expect(h.braceL);!this.eat(h.braceR);){if(i)i=!1;else if(this.expect(h.comma),this.afterTrailingComma(h.braceR))break;var r=this.startNode();r.local=this.parseModuleExportName(),r.exported=this.eatContextual("as")?this.parseModuleExportName():r.local,this.checkExport(e,r.exported,r.exported.start),t.push(this.finishNode(r,"ExportSpecifier"))}return t};I.parseImport=function(e){return this.next(),this.type===h.string?(e.specifiers=Gn,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===h.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,"ImportDeclaration")};I.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===h.name){var i=this.startNode();if(i.local=this.parseIdent(),this.checkLValSimple(i.local,It),e.push(this.finishNode(i,"ImportDefaultSpecifier")),!this.eat(h.comma))return e}if(this.type===h.star){var r=this.startNode();return this.next(),this.expectContextual("as"),r.local=this.parseIdent(),this.checkLValSimple(r.local,It),e.push(this.finishNode(r,"ImportNamespaceSpecifier")),e}for(this.expect(h.braceL);!this.eat(h.braceR);){if(t)t=!1;else if(this.expect(h.comma),this.afterTrailingComma(h.braceR))break;var s=this.startNode();s.imported=this.parseModuleExportName(),this.eatContextual("as")?s.local=this.parseIdent():(this.checkUnreserved(s.imported),s.local=s.imported),this.checkLValSimple(s.local,It),e.push(this.finishNode(s,"ImportSpecifier"))}return e};I.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===h.string){var e=this.parseLiteral(this.value);return Hn.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};I.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)};I.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var gt=z.prototype;gt.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var r=0,s=e.properties;r<s.length;r+=1){var n=s[r];this.toAssignable(n,t),n.type==="RestElement"&&(n.argument.type==="ArrayPattern"||n.argument.type==="ObjectPattern")&&this.raise(n.argument.start,"Unexpected token")}break;case"Property":e.kind!=="init"&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern"&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":e.operator!=="="&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return e};gt.toAssignableList=function(e,t){for(var i=e.length,r=0;r<i;r++){var s=e[r];s&&this.toAssignable(s,t)}if(i){var n=e[i-1];this.options.ecmaVersion===6&&t&&n&&n.type==="RestElement"&&n.argument.type!=="Identifier"&&this.unexpected(n.argument.start)}return e};gt.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")};gt.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==h.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};gt.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case h.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(h.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case h.braceL:return this.parseObj(!0)}return this.parseIdent()};gt.parseBindingList=function(e,t,i){for(var r=[],s=!0;!this.eat(e);)if(s?s=!1:this.expect(h.comma),t&&this.type===h.comma)r.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===h.ellipsis){var n=this.parseRestBinding();this.parseBindingListItem(n),r.push(n),this.type===h.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else{var a=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(a),r.push(a)}}return r};gt.parseBindingListItem=function(e){return e};gt.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(h.eq))return i;var r=this.startNodeAt(e,t);return r.left=i,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")};gt.checkLValSimple=function(e,t,i){t===void 0&&(t=ui);var r=t!==ui;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?"Binding ":"Assigning to ")+e.name+" in strict mode"),r&&(t===It&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(De(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),t!==es&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":r&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return r&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(r?"Binding":"Assigning to")+" rvalue")}};gt.checkLValPattern=function(e,t,i){switch(t===void 0&&(t=ui),e.type){case"ObjectPattern":for(var r=0,s=e.properties;r<s.length;r+=1){var n=s[r];this.checkLValInnerPattern(n,t,i)}break;case"ArrayPattern":for(var a=0,o=e.elements;a<o.length;a+=1){var u=o[a];u&&this.checkLValInnerPattern(u,t,i)}break;default:this.checkLValSimple(e,t,i)}};gt.checkLValInnerPattern=function(e,t,i){switch(t===void 0&&(t=ui),e.type){case"Property":this.checkLValInnerPattern(e.value,t,i);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case"RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i)}};var mt=function(t,i,r,s,n){this.token=t,this.isExpr=!!i,this.preserveSpace=!!r,this.override=s,this.generator=!!n},B={b_stat:new mt("{",!1),b_expr:new mt("{",!0),b_tmpl:new mt("${",!1),p_stat:new mt("(",!1),p_expr:new mt("(",!0),q_tmpl:new mt("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new mt("function",!1),f_expr:new mt("function",!0),f_expr_gen:new mt("function",!0,!1,null,!0),f_gen:new mt("function",!1,!1,null,!0)},he=z.prototype;he.initialContext=function(){return[B.b_stat]};he.curContext=function(){return this.context[this.context.length-1]};he.braceIsBlock=function(e){var t=this.curContext();return t===B.f_expr||t===B.f_stat?!0:e===h.colon&&(t===B.b_stat||t===B.b_expr)?!t.isExpr:e===h._return||e===h.name&&this.exprAllowed?ft.test(this.input.slice(this.lastTokEnd,this.start)):e===h._else||e===h.semi||e===h.eof||e===h.parenR||e===h.arrow?!0:e===h.braceL?t===B.b_stat:e===h._var||e===h._const||e===h.name?!1:!this.exprAllowed};he.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function")return t.generator}return!1};he.updateContext=function(e){var t,i=this.type;i.keyword&&e===h.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr};he.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)};h.parenR.updateContext=h.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===B.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr};h.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?B.b_stat:B.b_expr),this.exprAllowed=!0};h.dollarBraceL.updateContext=function(){this.context.push(B.b_tmpl),this.exprAllowed=!0};h.parenL.updateContext=function(e){var t=e===h._if||e===h._for||e===h._with||e===h._while;this.context.push(t?B.p_stat:B.p_expr),this.exprAllowed=!0};h.incDec.updateContext=function(){};h._function.updateContext=h._class.updateContext=function(e){e.beforeExpr&&e!==h._else&&!(e===h.semi&&this.curContext()!==B.p_stat)&&!(e===h._return&&ft.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===h.colon||e===h.braceL)&&this.curContext()===B.b_stat)?this.context.push(B.f_expr):this.context.push(B.f_stat),this.exprAllowed=!1};h.backQuote.updateContext=function(){this.curContext()===B.q_tmpl?this.context.pop():this.context.push(B.q_tmpl),this.exprAllowed=!1};h.star.updateContext=function(e){if(e===h._function){var t=this.context.length-1;this.context[t]===B.f_expr?this.context[t]=B.f_expr_gen:this.context[t]=B.f_gen}this.exprAllowed=!0};h.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==h.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var T=z.prototype;T.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,s;switch(r.type){case"Identifier":s=r.name;break;case"Literal":s=String(r.value);break;default:return}var n=e.kind;if(this.options.ecmaVersion>=6){s==="__proto__"&&n==="init"&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=r.start):this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),t.proto=!0);return}s="$"+s;var a=t[s];if(a){var o;n==="init"?o=this.strict&&a.init||a.get||a.set:o=a.init||a[n],o&&this.raiseRecoverable(r.start,"Redefinition of property")}else a=t[s]={init:!1,get:!1,set:!1};a[n]=!0}};T.parseExpression=function(e,t){var i=this.start,r=this.startLoc,s=this.parseMaybeAssign(e,t);if(this.type===h.comma){var n=this.startNodeAt(i,r);for(n.expressions=[s];this.eat(h.comma);)n.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(n,"SequenceExpression")}return s};T.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,s=-1,n=-1,a=-1;t?(s=t.parenthesizedAssign,n=t.trailingComma,a=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new fi,r=!0);var o=this.start,u=this.startLoc;(this.type===h.parenL||this.type===h.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var c=this.parseMaybeConditional(e,t);if(i&&(c=i.call(this,c,o,u)),this.type.isAssign){var l=this.startNodeAt(o,u);return l.operator=this.value,this.type===h.eq&&(c=this.toAssignable(c,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=c.start&&(t.shorthandAssign=-1),this.type===h.eq?this.checkLValPattern(c):this.checkLValSimple(c),l.left=c,this.next(),l.right=this.parseMaybeAssign(e),a>-1&&(t.doubleProto=a),this.finishNode(l,"AssignmentExpression")}else r&&this.checkExpressionErrors(t,!0);return s>-1&&(t.parenthesizedAssign=s),n>-1&&(t.trailingComma=n),c};T.parseMaybeConditional=function(e,t){var i=this.start,r=this.startLoc,s=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return s;if(this.eat(h.question)){var n=this.startNodeAt(i,r);return n.test=s,n.consequent=this.parseMaybeAssign(),this.expect(h.colon),n.alternate=this.parseMaybeAssign(e),this.finishNode(n,"ConditionalExpression")}return s};T.parseExprOps=function(e,t){var i=this.start,r=this.startLoc,s=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||s.start===i&&s.type==="ArrowFunctionExpression"?s:this.parseExprOp(s,i,r,-1,e)};T.parseExprOp=function(e,t,i,r,s){var n=this.type.binop;if(n!=null&&(!s||this.type!==h._in)&&n>r){var a=this.type===h.logicalOR||this.type===h.logicalAND,o=this.type===h.coalesce;o&&(n=h.logicalAND.binop);var u=this.value;this.next();var c=this.start,l=this.startLoc,f=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,s),c,l,n,s),p=this.buildBinary(t,i,e,f,u,a||o);return(a&&this.type===h.coalesce||o&&(this.type===h.logicalOR||this.type===h.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(p,t,i,r,s)}return e};T.buildBinary=function(e,t,i,r,s,n){r.type==="PrivateIdentifier"&&this.raise(r.start,"Private identifier can only be left side of binary expression");var a=this.startNodeAt(e,t);return a.left=i,a.operator=s,a.right=r,this.finishNode(a,n?"LogicalExpression":"BinaryExpression")};T.parseMaybeUnary=function(e,t,i,r){var s=this.start,n=this.startLoc,a;if(this.isContextual("await")&&this.canAwait)a=this.parseAwait(r),t=!0;else if(this.type.prefix){var o=this.startNode(),u=this.type===h.incDec;o.operator=this.value,o.prefix=!0,this.next(),o.argument=this.parseMaybeUnary(null,!0,u,r),this.checkExpressionErrors(e,!0),u?this.checkLValSimple(o.argument):this.strict&&o.operator==="delete"&&o.argument.type==="Identifier"?this.raiseRecoverable(o.start,"Deleting local variable in strict mode"):o.operator==="delete"&&rs(o.argument)?this.raiseRecoverable(o.start,"Private fields can not be deleted"):t=!0,a=this.finishNode(o,u?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===h.privateId)(r||this.privateNameStack.length===0)&&this.unexpected(),a=this.parsePrivateIdent(),this.type!==h._in&&this.unexpected();else{if(a=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return a;for(;this.type.postfix&&!this.canInsertSemicolon();){var c=this.startNodeAt(s,n);c.operator=this.value,c.prefix=!1,c.argument=a,this.checkLValSimple(a),this.next(),a=this.finishNode(c,"UpdateExpression")}}if(!i&&this.eat(h.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(s,n,a,this.parseMaybeUnary(null,!1,!1,r),"**",!1);else return a};function rs(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&rs(e.expression)}T.parseExprSubscripts=function(e,t){var i=this.start,r=this.startLoc,s=this.parseExprAtom(e,t);if(s.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return s;var n=this.parseSubscripts(s,i,r,!1,t);return e&&n.type==="MemberExpression"&&(e.parenthesizedAssign>=n.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=n.start&&(e.parenthesizedBind=-1),e.trailingComma>=n.start&&(e.trailingComma=-1)),n};T.parseSubscripts=function(e,t,i,r,s){for(var n=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,a=!1;;){var o=this.parseSubscript(e,t,i,r,n,a,s);if(o.optional&&(a=!0),o===e||o.type==="ArrowFunctionExpression"){if(a){var u=this.startNodeAt(t,i);u.expression=o,o=this.finishNode(u,"ChainExpression")}return o}e=o}};T.parseSubscript=function(e,t,i,r,s,n,a){var o=this.options.ecmaVersion>=11,u=o&&this.eat(h.questionDot);r&&u&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var c=this.eat(h.bracketL);if(c||u&&this.type!==h.parenL&&this.type!==h.backQuote||this.eat(h.dot)){var l=this.startNodeAt(t,i);l.object=e,c?(l.property=this.parseExpression(),this.expect(h.bracketR)):this.type===h.privateId&&e.type!=="Super"?l.property=this.parsePrivateIdent():l.property=this.parseIdent(this.options.allowReserved!=="never"),l.computed=!!c,o&&(l.optional=u),e=this.finishNode(l,"MemberExpression")}else if(!r&&this.eat(h.parenL)){var f=new fi,p=this.yieldPos,m=this.awaitPos,g=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var v=this.parseExprList(h.parenR,this.options.ecmaVersion>=8,!1,f);if(s&&!u&&!this.canInsertSemicolon()&&this.eat(h.arrow))return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=p,this.awaitPos=m,this.awaitIdentPos=g,this.parseArrowExpression(this.startNodeAt(t,i),v,!0,a);this.checkExpressionErrors(f,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=m||this.awaitPos,this.awaitIdentPos=g||this.awaitIdentPos;var E=this.startNodeAt(t,i);E.callee=e,E.arguments=v,o&&(E.optional=u),e=this.finishNode(E,"CallExpression")}else if(this.type===h.backQuote){(u||n)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var y=this.startNodeAt(t,i);y.tag=e,y.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(y,"TaggedTemplateExpression")}return e};T.parseExprAtom=function(e,t){this.type===h.slash&&this.readRegexp();var i,r=this.potentialArrowAt===this.start;switch(this.type){case h._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),i=this.startNode(),this.next(),this.type===h.parenL&&!this.allowDirectSuper&&this.raise(i.start,"super() call outside constructor of a subclass"),this.type!==h.dot&&this.type!==h.bracketL&&this.type!==h.parenL&&this.unexpected(),this.finishNode(i,"Super");case h._this:return i=this.startNode(),this.next(),this.finishNode(i,"ThisExpression");case h.name:var s=this.start,n=this.startLoc,a=this.containsEsc,o=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!a&&o.name==="async"&&!this.canInsertSemicolon()&&this.eat(h._function))return this.overrideContext(B.f_expr),this.parseFunction(this.startNodeAt(s,n),0,!1,!0,t);if(r&&!this.canInsertSemicolon()){if(this.eat(h.arrow))return this.parseArrowExpression(this.startNodeAt(s,n),[o],!1,t);if(this.options.ecmaVersion>=8&&o.name==="async"&&this.type===h.name&&!a&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return o=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(h.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(s,n),[o],!0,t)}return o;case h.regexp:var u=this.value;return i=this.parseLiteral(u.value),i.regex={pattern:u.pattern,flags:u.flags},i;case h.num:case h.string:return this.parseLiteral(this.value);case h._null:case h._true:case h._false:return i=this.startNode(),i.value=this.type===h._null?null:this.type===h._true,i.raw=this.type.keyword,this.next(),this.finishNode(i,"Literal");case h.parenL:var c=this.start,l=this.parseParenAndDistinguishExpression(r,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(l)&&(e.parenthesizedAssign=c),e.parenthesizedBind<0&&(e.parenthesizedBind=c)),l;case h.bracketL:return i=this.startNode(),this.next(),i.elements=this.parseExprList(h.bracketR,!0,!0,e),this.finishNode(i,"ArrayExpression");case h.braceL:return this.overrideContext(B.b_expr),this.parseObj(!1,e);case h._function:return i=this.startNode(),this.next(),this.parseFunction(i,0);case h._class:return this.parseClass(this.startNode(),!1);case h._new:return this.parseNew();case h.backQuote:return this.parseTemplate();case h._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}};T.parseExprImport=function(){var e=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var t=this.parseIdent(!0);switch(this.type){case h.parenL:return this.parseDynamicImport(e);case h.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}};T.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(h.parenR)){var t=this.start;this.eat(h.comma)&&this.eat(h.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")};T.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};T.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")};T.parseParenExpression=function(){this.expect(h.parenL);var e=this.parseExpression();return this.expect(h.parenR),e};T.parseParenAndDistinguishExpression=function(e,t){var i=this.start,r=this.startLoc,s,n=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var a=this.start,o=this.startLoc,u=[],c=!0,l=!1,f=new fi,p=this.yieldPos,m=this.awaitPos,g;for(this.yieldPos=0,this.awaitPos=0;this.type!==h.parenR;)if(c?c=!1:this.expect(h.comma),n&&this.afterTrailingComma(h.parenR,!0)){l=!0;break}else if(this.type===h.ellipsis){g=this.start,u.push(this.parseParenItem(this.parseRestBinding())),this.type===h.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}else u.push(this.parseMaybeAssign(!1,f,this.parseParenItem));var v=this.lastTokEnd,E=this.lastTokEndLoc;if(this.expect(h.parenR),e&&!this.canInsertSemicolon()&&this.eat(h.arrow))return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=p,this.awaitPos=m,this.parseParenArrowList(i,r,u,t);(!u.length||l)&&this.unexpected(this.lastTokStart),g&&this.unexpected(g),this.checkExpressionErrors(f,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=m||this.awaitPos,u.length>1?(s=this.startNodeAt(a,o),s.expressions=u,this.finishNodeAt(s,"SequenceExpression",v,E)):s=u[0]}else s=this.parseParenExpression();if(this.options.preserveParens){var y=this.startNodeAt(i,r);return y.expression=s,this.finishNode(y,"ParenthesizedExpression")}else return s};T.parseParenItem=function(e){return e};T.parseParenArrowList=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,r)};var Xn=[];T.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(h.dot)){e.meta=t;var i=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var r=this.start,s=this.startLoc,n=this.type===h._import;return e.callee=this.parseSubscripts(this.parseExprAtom(),r,s,!0,!1),n&&e.callee.type==="ImportExpression"&&this.raise(r,"Cannot use new with import()"),this.eat(h.parenL)?e.arguments=this.parseExprList(h.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Xn,this.finishNode(e,"NewExpression")};T.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===h.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,`
4
4
  `),cooked:this.value},this.next(),i.tail=this.type===h.backQuote,this.finishNode(i,"TemplateElement")};T.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(i.quasis=[r];!r.tail;)this.type===h.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(h.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(h.braceR),i.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")};T.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===h.name||this.type===h.num||this.type===h.string||this.type===h.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===h.star)&&!ft.test(this.input.slice(this.lastTokEnd,this.start))};T.parseObj=function(e,t){var i=this.startNode(),r=!0,s={};for(i.properties=[],this.next();!this.eat(h.braceR);){if(r)r=!1;else if(this.expect(h.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(h.braceR))break;var n=this.parseProperty(e,t);e||this.checkPropClash(n,s,t),i.properties.push(n)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")};T.parseProperty=function(e,t){var i=this.startNode(),r,s,n,a;if(this.options.ecmaVersion>=9&&this.eat(h.ellipsis))return e?(i.argument=this.parseIdent(!1),this.type===h.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,t),this.type===h.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(e||t)&&(n=this.start,a=this.startLoc),e||(r=this.eat(h.star)));var o=this.containsEsc;return this.parsePropertyName(i),!e&&!o&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(i)?(s=!0,r=this.options.ecmaVersion>=9&&this.eat(h.star),this.parsePropertyName(i)):s=!1,this.parsePropertyValue(i,e,r,s,n,a,t,o),this.finishNode(i,"Property")};T.parsePropertyValue=function(e,t,i,r,s,n,a,o){if((i||r)&&this.type===h.colon&&this.unexpected(),this.eat(h.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===h.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(i,r);else if(!t&&!o&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==h.comma&&this.type!==h.braceR&&this.type!==h.eq){(i||r)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var u=e.kind==="get"?0:1;if(e.value.params.length!==u){var c=e.value.start;e.kind==="get"?this.raiseRecoverable(c,"getter should have no params"):this.raiseRecoverable(c,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}else this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((i||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=s),e.kind="init",t?e.value=this.parseMaybeDefault(s,n,this.copyNode(e.key)):this.type===h.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),e.value=this.parseMaybeDefault(s,n,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()};T.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(h.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(h.bracketR),e.key;e.computed=!1}return e.key=this.type===h.num||this.type===h.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};T.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};T.parseMethod=function(e,t,i){var r=this.startNode(),s=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(er(t,r.generator)|Zi|(i?Jr:0)),this.expect(h.parenL),r.params=this.parseBindingList(h.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=s,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(r,"FunctionExpression")};T.parseArrowExpression=function(e,t,i,r){var s=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(er(i,!1)|Xr),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,r),this.yieldPos=s,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(e,"ArrowFunctionExpression")};T.parseFunctionBody=function(e,t,i,r){var s=t&&this.type!==h.braceL,n=this.strict,a=!1;if(s)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!n||o)&&(a=this.strictDirective(this.end),a&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var u=this.labels;this.labels=[],a&&(this.strict=!0),this.checkParams(e,!n&&!a&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,es),e.body=this.parseBlock(!1,void 0,a&&!n),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=u}this.exitScope()};T.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1){var r=i[t];if(r.type!=="Identifier")return!1}return!0};T.checkParams=function(e,t){for(var i=Object.create(null),r=0,s=e.params;r<s.length;r+=1){var n=s[r];this.checkLValInnerPattern(n,ir,t?null:i)}};T.parseExprList=function(e,t,i,r){for(var s=[],n=!0;!this.eat(e);){if(n)n=!1;else if(this.expect(h.comma),t&&this.afterTrailingComma(e))break;var a=void 0;i&&this.type===h.comma?a=null:this.type===h.ellipsis?(a=this.parseSpread(r),r&&this.type===h.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):a=this.parseMaybeAssign(!1,r),s.push(a)}return s};T.checkUnreserved=function(e){var t=e.start,i=e.end,r=e.name;if(this.inGenerator&&r==="yield"&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().inClassFieldInit&&r==="arguments"&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(r==="arguments"||r==="await")&&this.raise(t,"Cannot use "+r+" in class static initialization block"),this.keywords.test(r)&&this.raise(t,"Unexpected keyword '"+r+"'"),!(this.options.ecmaVersion<6&&this.input.slice(t,i).indexOf("\\")!==-1)){var s=this.strict?this.reservedWordsStrict:this.reservedWords;s.test(r)&&(!this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+r+"' is reserved"))}};T.parseIdent=function(e){var t=this.startNode();return this.type===h.name?t.name=this.value:this.type.keyword?(t.name=this.type.keyword,(t.name==="class"||t.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop()):this.unexpected(),this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),t.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t};T.parsePrivateIdent=function(){var e=this.startNode();return this.type===h.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.privateNameStack.length===0?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e),e};T.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===h.semi||this.canInsertSemicolon()||this.type!==h.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(h.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")};T.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var li=z.prototype;li.raise=function(e,t){var i=Gr(this.input,e);t+=" ("+i.line+":"+i.column+")";var r=new SyntaxError(t);throw r.pos=e,r.loc=i,r.raisedAt=this.pos,r};li.raiseRecoverable=li.raise;li.curPosition=function(){if(this.options.locations)return new Re(this.curLine,this.pos-this.lineStart)};var Dt=z.prototype,Yn=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[],this.inClassFieldInit=!1};Dt.enterScope=function(e){this.scopeStack.push(new Yn(e))};Dt.exitScope=function(){this.scopeStack.pop()};Dt.treatFunctionsAsVarInScope=function(e){return e.flags&le||!this.inModule&&e.flags&Me};Dt.declareName=function(e,t,i){var r=!1;if(t===It){var s=this.currentScope();r=s.lexical.indexOf(e)>-1||s.functions.indexOf(e)>-1||s.var.indexOf(e)>-1,s.lexical.push(e),this.inModule&&s.flags&Me&&delete this.undefinedExports[e]}else if(t===ts){var n=this.currentScope();n.lexical.push(e)}else if(t===Zr){var a=this.currentScope();this.treatFunctionsAsVar?r=a.lexical.indexOf(e)>-1:r=a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var u=this.scopeStack[o];if(u.lexical.indexOf(e)>-1&&!(u.flags&Yr&&u.lexical[0]===e)||!this.treatFunctionsAsVarInScope(u)&&u.functions.indexOf(e)>-1){r=!0;break}if(u.var.push(e),this.inModule&&u.flags&Me&&delete this.undefinedExports[e],u.flags&tr)break}r&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")};Dt.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};Dt.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Dt.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&tr)return t}};Dt.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&tr&&!(t.flags&Xr))return t}};var pi=function(t,i,r){this.type="",this.start=i,this.end=0,t.options.locations&&(this.loc=new hi(t,r)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[i,0])},Fe=z.prototype;Fe.startNode=function(){return new pi(this,this.start,this.startLoc)};Fe.startNodeAt=function(e,t){return new pi(this,e,t)};function ss(e,t,i,r){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=i),e}Fe.finishNode=function(e,t){return ss.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};Fe.finishNodeAt=function(e,t,i,r){return ss.call(this,e,t,i,r)};Fe.copyNode=function(e){var t=new pi(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var ns="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",as=ns+" Extended_Pictographic",os=as,us=os+" EBase EComp EMod EPres ExtPict",cs=us,Jn=cs,Zn={9:ns,10:as,11:os,12:us,13:cs,14:Jn},jr="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",ls="Adlam Adlm 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 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",hs=ls+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",fs=hs+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",ps=fs+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",ds=ps+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",ta=ds+" Kawi Nag_Mundari Nagm",ea={9:ls,10:hs,11:fs,12:ps,13:ds,14:ta},ms={};function ia(e){var t=ms[e]={binary:zt(Zn[e]+" "+jr),nonBinary:{General_Category:zt(jr),Script:zt(ea[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}for(oi=0,Qi=[9,10,11,12,13,14];oi<Qi.length;oi+=1)Br=Qi[oi],ia(Br);var Br,oi,Qi,k=z.prototype,Tt=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":""),this.unicodeProperties=ms[t.options.ecmaVersion>=14?14:t.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=[]};Tt.prototype.reset=function(t,i,r){var s=r.indexOf("u")!==-1;this.start=t|0,this.source=i+"",this.flags=r,this.switchU=s&&this.parser.options.ecmaVersion>=6,this.switchN=s&&this.parser.options.ecmaVersion>=9};Tt.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)};Tt.prototype.at=function(t,i){i===void 0&&(i=!1);var r=this.source,s=r.length;if(t>=s)return-1;var n=r.charCodeAt(t);if(!(i||this.switchU)||n<=55295||n>=57344||t+1>=s)return n;var a=r.charCodeAt(t+1);return a>=56320&&a<=57343?(n<<10)+a-56613888:n};Tt.prototype.nextIndex=function(t,i){i===void 0&&(i=!1);var r=this.source,s=r.length;if(t>=s)return s;var n=r.charCodeAt(t),a;return!(i||this.switchU)||n<=55295||n>=57344||t+1>=s||(a=r.charCodeAt(t+1))<56320||a>57343?t+1:t+2};Tt.prototype.current=function(t){return t===void 0&&(t=!1),this.at(this.pos,t)};Tt.prototype.lookahead=function(t){return t===void 0&&(t=!1),this.at(this.nextIndex(this.pos,t),t)};Tt.prototype.advance=function(t){t===void 0&&(t=!1),this.pos=this.nextIndex(this.pos,t)};Tt.prototype.eat=function(t,i){return i===void 0&&(i=!1),this.current(i)===t?(this.advance(i),!0):!1};k.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,r=0;r<i.length;r++){var s=i.charAt(r);t.indexOf(s)===-1&&this.raise(e.start,"Invalid regular expression flag"),i.indexOf(s,r+1)>-1&&this.raise(e.start,"Duplicate regular expression flag")}};k.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))};k.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<i.length;t+=1){var r=i[t];e.groupNames.indexOf(r)===-1&&e.raise("Invalid named capture referenced")}};k.regexp_disjunction=function(e){for(this.regexp_alternative(e);e.eat(124);)this.regexp_alternative(e);this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")};k.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););};k.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1};k.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var i=!1;if(this.options.ecmaVersion>=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};k.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1};k.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};k.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var r=0,s=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue),e.eat(125)))return s!==-1&&s<r&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i}return!1};k.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)};k.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1};k.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)&&e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}e.pos=t}return!1};k.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};k.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)};k.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};k.regexp_eatSyntaxCharacter=function(e){var t=e.current();return gs(t)?(e.lastIntValue=t,e.advance(),!0):!1};function gs(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}k.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;(i=e.current())!==-1&&!gs(i);)e.advance();return e.pos!==t};k.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1};k.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e)){e.groupNames.indexOf(e.lastStringValue)!==-1&&e.raise("Duplicate capture group name"),e.groupNames.push(e.lastStringValue);return}e.raise("Invalid group")}};k.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};k.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Mt(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Mt(e.lastIntValue);return!0}return!1};k.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),ra(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function ra(e){return Ot(e,!0)||e===36||e===95}k.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),sa(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function sa(e){return ue(e,!0)||e===36||e===95||e===8204||e===8205}k.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};k.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};k.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};k.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,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};k.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1};k.regexp_eatZero=function(e){return e.current()===48&&!di(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};k.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1};k.regexp_eatControlLetter=function(e){var t=e.current();return ys(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function ys(e){return e>=65&&e<=90||e>=97&&e<=122}k.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var i=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(r&&s>=55296&&s<=56319){var n=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(a>=56320&&a<=57343)return e.lastIntValue=(s-55296)*1024+(a-56320)+65536,!0}e.pos=n,e.lastIntValue=s}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&na(e.lastIntValue))return!0;r&&e.raise("Invalid unicode escape"),e.pos=i}return!1};function na(e){return e>=0&&e<=1114111}k.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1};k.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};k.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(aa(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&this.options.ecmaVersion>=9&&(t===80||t===112)){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};function aa(e){return e===100||e===68||e===115||e===83||e===119||e===87}k.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 r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,r),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var s=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,s),!0}return!1};k.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){De(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")};k.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")};k.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";xs(t=e.current());)e.lastStringValue+=Mt(t),e.advance();return e.lastStringValue!==""};function xs(e){return ys(e)||e===95}k.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";oa(t=e.current());)e.lastStringValue+=Mt(t),e.advance();return e.lastStringValue!==""};function oa(e){return xs(e)||di(e)}k.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};k.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};k.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&&(t===-1||i===-1)&&e.raise("Invalid character class"),t!==-1&&i!==-1&&t>i&&e.raise("Range out of order in character class")}}};k.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();(i===99||vs(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var r=e.current();return r!==93?(e.lastIntValue=r,e.advance(),!0):!1};k.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)};k.regexp_eatClassControlLetter=function(e){var t=e.current();return di(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1};k.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};k.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;di(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t};function di(e){return e>=48&&e<=57}k.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;bs(i=e.current());)e.lastIntValue=16*e.lastIntValue+ws(i),e.advance();return e.pos!==t};function bs(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function ws(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}k.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=t*64+i*8+e.lastIntValue:e.lastIntValue=t*8+i}else e.lastIntValue=t;return!0}return!1};k.regexp_eatOctalDigit=function(e){var t=e.current();return vs(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function vs(e){return e>=48&&e<=55}k.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var s=e.current();if(!bs(s))return e.pos=i,!1;e.lastIntValue=16*e.lastIntValue+ws(s),e.advance()}return!0};var sr=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new hi(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},N=z.prototype;N.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new sr(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};N.getToken=function(){return this.next(),new sr(this)};typeof Symbol<"u"&&(N[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===h.eof,value:t}}}});N.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(h.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};N.readToken=function(e){return Ot(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};N.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888};N.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var r=void 0,s=t;(r=Wr(this.input,s,this.pos))>-1;)++this.curLine,s=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,i),t,this.pos,e,this.curPosition())};N.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!ce(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition())};N.skipSpace=function(){t:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break t}break;default:if(e>8&&e<14||e>=5760&&zr.test(String.fromCharCode(e)))++this.pos;else break t}}};N.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)};N.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&&e===46&&t===46?(this.pos+=3,this.finishToken(h.ellipsis)):(++this.pos,this.finishToken(h.dot))};N.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(h.assign,2):this.finishOp(h.slash,1)};N.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,r=e===42?h.star:h.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++i,r=h.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(h.assign,i+1):this.finishOp(r,i)};N.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(h.assign,3)}return this.finishOp(e===124?h.logicalOR:h.logicalAND,2)}return t===61?this.finishOp(h.assign,2):this.finishOp(e===124?h.bitwiseOR:h.bitwiseAND,1)};N.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(h.assign,2):this.finishOp(h.bitwiseXOR,1)};N.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||ft.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(h.incDec,2):t===61?this.finishOp(h.assign,2):this.finishOp(h.plusMin,1)};N.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(h.assign,i+1):this.finishOp(h.bitShift,i)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(i=2),this.finishOp(h.relational,i))};N.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(h.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(h.arrow)):this.finishOp(e===61?h.eq:h.prefix,1)};N.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(h.questionDot,2)}if(t===63){if(e>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(h.assign,3)}return this.finishOp(h.coalesce,2)}}return this.finishOp(h.question,1)};N.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),Ot(t,!0)||t===92))return this.finishToken(h.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Mt(t)+"'")};N.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(h.parenL);case 41:return++this.pos,this.finishToken(h.parenR);case 59:return++this.pos,this.finishToken(h.semi);case 44:return++this.pos,this.finishToken(h.comma);case 91:return++this.pos,this.finishToken(h.bracketL);case 93:return++this.pos,this.finishToken(h.bracketR);case 123:return++this.pos,this.finishToken(h.braceL);case 125:return++this.pos,this.finishToken(h.braceR);case 58:return++this.pos,this.finishToken(h.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(h.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)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 63:return this.readToken_question();case 126:return this.finishOp(h.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Mt(e)+"'")};N.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)};N.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(ft.test(r)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if(r==="[")t=!0;else if(r==="]"&&t)t=!1;else if(r==="/"&&!t)break;e=r==="\\"}++this.pos}var s=this.input.slice(i,this.pos);++this.pos;var n=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(n);var o=this.regexpState||(this.regexpState=new Tt(this));o.reset(i,s,a),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var u=null;try{u=new RegExp(s,a)}catch{}return this.finishToken(h.regexp,{pattern:s,flags:a,value:u})};N.readInt=function(e,t,i){for(var r=this.options.ecmaVersion>=12&&t===void 0,s=i&&this.input.charCodeAt(this.pos)===48,n=this.pos,a=0,o=0,u=0,c=t??1/0;u<c;++u,++this.pos){var l=this.input.charCodeAt(this.pos),f=void 0;if(r&&l===95){s&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),o===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),u===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=l;continue}if(l>=97?f=l-97+10:l>=65?f=l-65+10:l>=48&&l<=57?f=l-48:f=1/0,f>=e)break;o=l,a=a*e+f}return r&&o===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===n||t!=null&&this.pos-n!==t?null:a};function ua(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function Ss(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}N.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return i==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=Ss(this.input.slice(t,this.pos)),++this.pos):Ot(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(h.num,i)};N.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,"Invalid number");var i=this.pos-t>=2&&this.input.charCodeAt(t)===48;i&&this.strict&&this.raise(t,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&r===110){var s=Ss(this.input.slice(t,this.pos));return++this.pos,Ot(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(h.num,s)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1),r===46&&!i&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!i&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),Ot(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var n=ua(this.input.slice(t,this.pos),i);return this.finishToken(h.num,n)};N.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var i=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(i,"Code point out of bounds")}else t=this.readHexChar(4);return t};N.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(ce(r)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(h.string,t)};var _s={};N.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===_s)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};N.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw _s;this.raise(e,t)};N.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(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===h.template||this.type===h.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(h.dollarBraceL)):(++this.pos,this.finishToken(h.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(h.template,e));if(i===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(ce(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
5
5
  `;break;default:e+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}};N.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(h.invalidTemplate,this.input.slice(this.start,this.pos))}this.raise(this.start,"Unterminated template")};N.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
6
- `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Mt(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],s=parseInt(r,8);return s>255&&(r=r.slice(0,-1),s=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(s)}return ce(t)?"":String.fromCharCode(t)}};N.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return i===null&&this.invalidStringToken(t,"Bad character escape sequence"),i};N.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var s=this.fullCharCodeAtPos();if(ue(s,r))this.pos+=s<=65535?1:2;else if(s===92){this.containsEsc=!0,e+=this.input.slice(i,this.pos);var n=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var a=this.readCodePoint();(t?Ot:ue)(a,r)||this.invalidStringToken(n,"Invalid Unicode escape"),e+=Mt(a),i=this.pos}else break;t=!1}return e+this.input.slice(i,this.pos)};N.readWord=function(){var e=this.readWord1(),t=h.name;return this.keywords.test(e)&&(t=Yi[e]),this.finishToken(t,e)};var ca="8.8.2";z.acorn={Parser:z,version:ca,defaultOptions:Ki,Position:Re,SourceLocation:hi,getLineInfo:Gr,Node:pi,TokenType:M,tokTypes:h,keywordTypes:Yi,TokContext:mt,tokContexts:B,isIdentifierChar:ue,isIdentifierStart:Ot,Token:sr,isNewLine:ce,lineBreak:ft,lineBreakG:qn,nonASCIIwhitespace:zr};var Es=z.extend(function(e){return class extends e{static parse(t,i){let r=super.parse(t,i);return r.isQuantumProgram=i.executionMode!=="RegularProgram",r.originalSource=t,r}constructor(...t){super(...t),this.isQuantumFunction=!1,this.functionStack=[]}isQuantumToekn(){return this.value==="quantum"}nextToken(){let t=this.type;if(super.nextToken(),this.type===h.name&&this.value==="async"&&this.input.slice(this.pos).trim().startsWith("quantum")){t===h.name?this.functionStack[0].isQuantumFunction=!0:this.isQuantumFunction=!0;let{type:i,value:r,start:s,end:n,startLoc:a,endLoc:o}=this;super.nextToken(),Object.assign(this,{type:i,value:r,start:s,end:n,startLoc:a,endLoc:o})}else this.isQuantumToekn()&&this.input.slice(this.pos).trim().startsWith("function")?(super.nextToken(),this.isQuantumFunction=!0):t===h.name&&this.functionStack[0]?.type==="classElement"&&this.isQuantumToekn()?(super.nextToken(),this.functionStack[0].isQuantumFunction=!0):this.isQuantumToekn()&&/^(\(|[\w$]+(\s+)?=>)/.test(this.input.slice(this.pos).trim())?(super.nextToken(),this.isQuantumFunction=!0):this.type===h.starstar&&(t===h._function?this.isQuantumFunction||(super.nextToken(),this.isQuantumFunction=!0):["property","classElement"].includes(this.functionStack[0]?.type)&&(this.functionStack[0].isQuantumFunction||(this.functionStack[0].isQuantumFunction=!0,super.nextToken())))}parseArrowExpression(...t){let i=this.isQuantumFunction;this.isQuantumFunction=!1,this.functionStack.unshift({type:"arrowFunction",isQuantumFunction:i});let r=super.parseArrowExpression(...t);return this.functionStack[0].isQuantumFunction&&(r.isQuantumFunction=!0),this.functionStack.shift(),r}parseFunction(t,i,r,s,n){let a=this.isQuantumFunction;this.isQuantumFunction=!1,this.functionStack.unshift({type:"function",isQuantumFunction:a}),this.functionStack[0].isQuantumFunction&&(t.isQuantumFunction=!0);let o=super.parseFunction(t,i,r,s,n);return this.functionStack.shift(),o}parseProperty(t,i){let r=this.isQuantumFunction;this.isQuantumFunction=!1,this.functionStack.unshift({type:"property",isQuantumFunction:r}),(this.type===h.starstar||this.isQuantumToekn())&&(this.functionStack[0].isQuantumFunction=!0,super.nextToken());let s=super.parseProperty(t,i);return this.functionStack[0].isQuantumFunction&&(s.value.isQuantumFunction=!0),this.functionStack.shift(),s}parseClassElement(t){let i=this.isQuantumFunction;this.isQuantumFunction=!1,this.functionStack.unshift({type:"classElement",isQuantumFunction:i}),(this.type===h.starstar||this.isQuantumToekn())&&(this.functionStack[0].isQuantumFunction=!0,super.nextToken());let r=super.parseClassElement(t);return this.functionStack[0].isQuantumFunction&&(r.value.isQuantumFunction=!0),this.functionStack.shift(),r}}});var{stringify:la}=JSON;if(!String.prototype.repeat)throw new Error("String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation");if(!String.prototype.endsWith)throw new Error("String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation");var mi={"||":2,"??":3,"&&":4,"|":5,"^":6,"&":7,"==":8,"!=":8,"===":8,"!==":8,"<":9,">":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},yt=17,ha={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,PrivateIdentifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,ChainExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:yt,ClassExpression:yt,FunctionExpression:yt,ObjectExpression:yt,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};function fe(e,t){let{generator:i}=e;if(e.write("("),t!=null&&t.length>0){i[t[0].type](t[0],e);let{length:r}=t;for(let s=1;s<r;s++){let n=t[s];e.write(", "),i[n.type](n,e)}}e.write(")")}function Ts(e,t,i,r){let s=e.expressionsPrecedence[t.type];if(s===yt)return!0;let n=e.expressionsPrecedence[i.type];return s!==n?!r&&s===15&&n===14&&i.operator==="**"||s<n:s!==13&&s!==14?!1:t.operator==="**"&&i.operator==="**"?!r:s===13&&n===13&&(t.operator==="??"||i.operator==="??")?!0:r?mi[t.operator]<=mi[i.operator]:mi[t.operator]<mi[i.operator]}function gi(e,t,i,r){let{generator:s}=e;Ts(e,t,i,r)?(e.write("("),s[t.type](t,e),e.write(")")):s[t.type](t,e)}function fa(e,t,i,r){let s=t.split(`
6
+ `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Mt(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],s=parseInt(r,8);return s>255&&(r=r.slice(0,-1),s=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(s)}return ce(t)?"":String.fromCharCode(t)}};N.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return i===null&&this.invalidStringToken(t,"Bad character escape sequence"),i};N.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var s=this.fullCharCodeAtPos();if(ue(s,r))this.pos+=s<=65535?1:2;else if(s===92){this.containsEsc=!0,e+=this.input.slice(i,this.pos);var n=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var a=this.readCodePoint();(t?Ot:ue)(a,r)||this.invalidStringToken(n,"Invalid Unicode escape"),e+=Mt(a),i=this.pos}else break;t=!1}return e+this.input.slice(i,this.pos)};N.readWord=function(){var e=this.readWord1(),t=h.name;return this.keywords.test(e)&&(t=Yi[e]),this.finishToken(t,e)};var ca="8.8.2";z.acorn={Parser:z,version:ca,defaultOptions:Ki,Position:Re,SourceLocation:hi,getLineInfo:Gr,Node:pi,TokenType:M,tokTypes:h,keywordTypes:Yi,TokContext:mt,tokContexts:B,isIdentifierChar:ue,isIdentifierStart:Ot,Token:sr,isNewLine:ce,lineBreak:ft,lineBreakG:qn,nonASCIIwhitespace:zr};var Es=z.extend(function(e){return class extends e{static parse(t,i){i.ecmaVersion||(i={...i,ecmaVersion:"latest"});let r=super.parse(t,i);return r.isQuantumProgram=i.executionMode!=="RegularProgram",r.originalSource=t,r}constructor(...t){super(...t),this.isQuantumFunction=!1,this.functionStack=[]}isQuantumToekn(){return this.value==="quantum"}nextToken(){let t=this.type;if(super.nextToken(),this.type===h.name&&this.value==="async"&&this.input.slice(this.pos).trim().startsWith("quantum")){t===h.name?this.functionStack[0].isQuantumFunction=!0:this.isQuantumFunction=!0;let{type:i,value:r,start:s,end:n,startLoc:a,endLoc:o}=this;super.nextToken(),Object.assign(this,{type:i,value:r,start:s,end:n,startLoc:a,endLoc:o})}else this.isQuantumToekn()&&this.input.slice(this.pos).trim().startsWith("function")?(super.nextToken(),this.isQuantumFunction=!0):t===h.name&&this.functionStack[0]?.type==="classElement"&&this.isQuantumToekn()?(super.nextToken(),this.functionStack[0].isQuantumFunction=!0):this.isQuantumToekn()&&/^(\(|[\w$]+(\s+)?=>)/.test(this.input.slice(this.pos).trim())?(super.nextToken(),this.isQuantumFunction=!0):this.type===h.starstar&&(t===h._function?this.isQuantumFunction||(super.nextToken(),this.isQuantumFunction=!0):["property","classElement"].includes(this.functionStack[0]?.type)&&(this.functionStack[0].isQuantumFunction||(this.functionStack[0].isQuantumFunction=!0,super.nextToken())))}parseArrowExpression(...t){let i=this.isQuantumFunction;this.isQuantumFunction=!1,this.functionStack.unshift({type:"arrowFunction",isQuantumFunction:i});let r=super.parseArrowExpression(...t);return this.functionStack[0].isQuantumFunction&&(r.isQuantumFunction=!0),this.functionStack.shift(),r}parseFunction(t,i,r,s,n){let a=this.isQuantumFunction;this.isQuantumFunction=!1,this.functionStack.unshift({type:"function",isQuantumFunction:a}),this.functionStack[0].isQuantumFunction&&(t.isQuantumFunction=!0);let o=super.parseFunction(t,i,r,s,n);return this.functionStack.shift(),o}parseProperty(t,i){let r=this.isQuantumFunction;this.isQuantumFunction=!1,this.functionStack.unshift({type:"property",isQuantumFunction:r}),(this.type===h.starstar||this.isQuantumToekn())&&(this.functionStack[0].isQuantumFunction=!0,super.nextToken());let s=super.parseProperty(t,i);return this.functionStack[0].isQuantumFunction&&(s.value.isQuantumFunction=!0),this.functionStack.shift(),s}parseClassElement(t){let i=this.isQuantumFunction;this.isQuantumFunction=!1,this.functionStack.unshift({type:"classElement",isQuantumFunction:i}),(this.type===h.starstar||this.isQuantumToekn())&&(this.functionStack[0].isQuantumFunction=!0,super.nextToken());let r=super.parseClassElement(t);return this.functionStack[0].isQuantumFunction&&(r.value.isQuantumFunction=!0),this.functionStack.shift(),r}}});var{stringify:la}=JSON;if(!String.prototype.repeat)throw new Error("String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation");if(!String.prototype.endsWith)throw new Error("String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation");var mi={"||":2,"??":3,"&&":4,"|":5,"^":6,"&":7,"==":8,"!=":8,"===":8,"!==":8,"<":9,">":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},yt=17,ha={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,PrivateIdentifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,ChainExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:yt,ClassExpression:yt,FunctionExpression:yt,ObjectExpression:yt,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};function fe(e,t){let{generator:i}=e;if(e.write("("),t!=null&&t.length>0){i[t[0].type](t[0],e);let{length:r}=t;for(let s=1;s<r;s++){let n=t[s];e.write(", "),i[n.type](n,e)}}e.write(")")}function Ts(e,t,i,r){let s=e.expressionsPrecedence[t.type];if(s===yt)return!0;let n=e.expressionsPrecedence[i.type];return s!==n?!r&&s===15&&n===14&&i.operator==="**"||s<n:s!==13&&s!==14?!1:t.operator==="**"&&i.operator==="**"?!r:s===13&&n===13&&(t.operator==="??"||i.operator==="??")?!0:r?mi[t.operator]<=mi[i.operator]:mi[t.operator]<mi[i.operator]}function gi(e,t,i,r){let{generator:s}=e;Ts(e,t,i,r)?(e.write("("),s[t.type](t,e),e.write(")")):s[t.type](t,e)}function fa(e,t,i,r){let s=t.split(`
7
7
  `),n=s.length-1;if(e.write(s[0].trim()),n>0){e.write(r);for(let a=1;a<n;a++)e.write(i+s[a].trim()+r);e.write(i+s[n].trim())}}function et(e,t,i,r){let{length:s}=t;for(let n=0;n<s;n++){let a=t[n];e.write(i),a.type[0]==="L"?e.write("// "+a.value.trim()+`
8
8
  `,a):(e.write("/*"),fa(e,a.value,i,r),e.write("*/"+r))}}function pa(e){let t=e;for(;t!=null;){let{type:i}=t;if(i[0]==="C"&&i[1]==="a")return!0;if(i[0]==="M"&&i[1]==="e"&&i[2]==="m")t=t.object;else return!1}}function nr(e,t){let{generator:i}=e,{declarations:r}=t;e.write(t.kind+" ");let{length:s}=r;if(s>0){i.VariableDeclarator(r[0],e);for(let n=1;n<s;n++)e.write(", "),i.VariableDeclarator(r[n],e)}}var Cs,ks,As,Ps,Is,Os,da={Program(e,t){let i=t.indent.repeat(t.indentLevel),{lineEnd:r,writeComments:s}=t;s&&e.comments!=null&&et(t,e.comments,i,r);let n=e.body,{length:a}=n;for(let o=0;o<a;o++){let u=n[o];s&&u.comments!=null&&et(t,u.comments,i,r),t.write(i),this[u.type](u,t),t.write(r)}s&&e.trailingComments!=null&&et(t,e.trailingComments,i,r)},BlockStatement:Os=function(e,t){let i=t.indent.repeat(t.indentLevel++),{lineEnd:r,writeComments:s}=t,n=i+t.indent;t.write("{");let a=e.body;if(a!=null&&a.length>0){t.write(r),s&&e.comments!=null&&et(t,e.comments,n,r);let{length:o}=a;for(let u=0;u<o;u++){let c=a[u];s&&c.comments!=null&&et(t,c.comments,n,r),t.write(n),this[c.type](c,t),t.write(r)}t.write(i)}else s&&e.comments!=null&&(t.write(r),et(t,e.comments,n,r),t.write(i));s&&e.trailingComments!=null&&et(t,e.trailingComments,n,r),t.write("}"),t.indentLevel--},ClassBody:Os,StaticBlock(e,t){t.write("static "),this.BlockStatement(e,t)},EmptyStatement(e,t){t.write(";")},ExpressionStatement(e,t){let i=t.expressionsPrecedence[e.expression.type];i===yt||i===3&&e.expression.left.type[0]==="O"?(t.write("("),this[e.expression.type](e.expression,t),t.write(")")):this[e.expression.type](e.expression,t),t.write(";")},IfStatement(e,t){t.write("if ("),this[e.test.type](e.test,t),t.write(") "),this[e.consequent.type](e.consequent,t),e.alternate!=null&&(t.write(" else "),this[e.alternate.type](e.alternate,t))},LabeledStatement(e,t){this[e.label.type](e.label,t),t.write(": "),this[e.body.type](e.body,t)},BreakStatement(e,t){t.write("break"),e.label!=null&&(t.write(" "),this[e.label.type](e.label,t)),t.write(";")},ContinueStatement(e,t){t.write("continue"),e.label!=null&&(t.write(" "),this[e.label.type](e.label,t)),t.write(";")},WithStatement(e,t){t.write("with ("),this[e.object.type](e.object,t),t.write(") "),this[e.body.type](e.body,t)},SwitchStatement(e,t){let i=t.indent.repeat(t.indentLevel++),{lineEnd:r,writeComments:s}=t;t.indentLevel++;let n=i+t.indent,a=n+t.indent;t.write("switch ("),this[e.discriminant.type](e.discriminant,t),t.write(") {"+r);let{cases:o}=e,{length:u}=o;for(let c=0;c<u;c++){let l=o[c];s&&l.comments!=null&&et(t,l.comments,n,r),l.test?(t.write(n+"case "),this[l.test.type](l.test,t),t.write(":"+r)):t.write(n+"default:"+r);let{consequent:f}=l,{length:p}=f;for(let m=0;m<p;m++){let g=f[m];s&&g.comments!=null&&et(t,g.comments,a,r),t.write(a),this[g.type](g,t),t.write(r)}}t.indentLevel-=2,t.write(i+"}")},ReturnStatement(e,t){t.write("return"),e.argument&&(t.write(" "),this[e.argument.type](e.argument,t)),t.write(";")},ThrowStatement(e,t){t.write("throw "),this[e.argument.type](e.argument,t),t.write(";")},TryStatement(e,t){if(t.write("try "),this[e.block.type](e.block,t),e.handler){let{handler:i}=e;i.param==null?t.write(" catch "):(t.write(" catch ("),this[i.param.type](i.param,t),t.write(") ")),this[i.body.type](i.body,t)}e.finalizer&&(t.write(" finally "),this[e.finalizer.type](e.finalizer,t))},WhileStatement(e,t){t.write("while ("),this[e.test.type](e.test,t),t.write(") "),this[e.body.type](e.body,t)},DoWhileStatement(e,t){t.write("do "),this[e.body.type](e.body,t),t.write(" while ("),this[e.test.type](e.test,t),t.write(");")},ForStatement(e,t){if(t.write("for ("),e.init!=null){let{init:i}=e;i.type[0]==="V"?nr(t,i):this[i.type](i,t)}t.write("; "),e.test&&this[e.test.type](e.test,t),t.write("; "),e.update&&this[e.update.type](e.update,t),t.write(") "),this[e.body.type](e.body,t)},ForInStatement:Cs=function(e,t){t.write(`for ${e.await?"await ":""}(`);let{left:i}=e;i.type[0]==="V"?nr(t,i):this[i.type](i,t),t.write(e.type[3]==="I"?" in ":" of "),this[e.right.type](e.right,t),t.write(") "),this[e.body.type](e.body,t)},ForOfStatement:Cs,DebuggerStatement(e,t){t.write("debugger;",e)},FunctionDeclaration:ks=function(e,t){t.write((e.async?"async ":"")+(e.generator?"function* ":"function ")+(e.id?e.id.name:""),e),fe(t,e.params),t.write(" "),this[e.body.type](e.body,t)},FunctionExpression:ks,VariableDeclaration(e,t){nr(t,e),t.write(";")},VariableDeclarator(e,t){this[e.id.type](e.id,t),e.init!=null&&(t.write(" = "),this[e.init.type](e.init,t))},ClassDeclaration(e,t){if(t.write("class "+(e.id?`${e.id.name} `:""),e),e.superClass){t.write("extends ");let{superClass:i}=e,{type:r}=i,s=t.expressionsPrecedence[r];(r[0]!=="C"||r[1]!=="l"||r[5]!=="E")&&(s===yt||s<t.expressionsPrecedence.ClassExpression)?(t.write("("),this[e.superClass.type](i,t),t.write(")")):this[i.type](i,t),t.write(" ")}this.ClassBody(e.body,t)},ImportDeclaration(e,t){t.write("import ");let{specifiers:i,attributes:r}=e,{length:s}=i,n=0;if(s>0){for(;n<s;){n>0&&t.write(", ");let a=i[n],o=a.type[6];if(o==="D")t.write(a.local.name,a),n++;else if(o==="N")t.write("* as "+a.local.name,a),n++;else break}if(n<s){for(t.write("{");;){let a=i[n],{name:o}=a.imported;if(t.write(o,a),o!==a.local.name&&t.write(" as "+a.local.name),++n<s)t.write(", ");else break}t.write("}")}t.write(" from ")}if(this.Literal(e.source,t),r&&r.length>0){t.write(" with { ");for(let a=0;a<r.length;a++)this.ImportAttribute(r[a],t),a<r.length-1&&t.write(", ");t.write(" }")}t.write(";")},ImportAttribute(e,t){this.Identifier(e.key,t),t.write(": "),this.Literal(e.value,t)},ImportExpression(e,t){t.write("import("),this[e.source.type](e.source,t),t.write(")")},ExportDefaultDeclaration(e,t){t.write("export default "),this[e.declaration.type](e.declaration,t),t.expressionsPrecedence[e.declaration.type]!=null&&e.declaration.type[0]!=="F"&&t.write(";")},ExportNamedDeclaration(e,t){if(t.write("export "),e.declaration)this[e.declaration.type](e.declaration,t);else{t.write("{");let{specifiers:i}=e,{length:r}=i;if(r>0)for(let s=0;;){let n=i[s],{name:a}=n.local;if(t.write(a,n),a!==n.exported.name&&t.write(" as "+n.exported.name),++s<r)t.write(", ");else break}if(t.write("}"),e.source&&(t.write(" from "),this.Literal(e.source,t)),e.attributes&&e.attributes.length>0){t.write(" with { ");for(let s=0;s<e.attributes.length;s++)this.ImportAttribute(e.attributes[s],t),s<e.attributes.length-1&&t.write(", ");t.write(" }")}t.write(";")}},ExportAllDeclaration(e,t){if(e.exported!=null?t.write("export * as "+e.exported.name+" from "):t.write("export * from "),this.Literal(e.source,t),e.attributes&&e.attributes.length>0){t.write(" with { ");for(let i=0;i<e.attributes.length;i++)this.ImportAttribute(e.attributes[i],t),i<e.attributes.length-1&&t.write(", ");t.write(" }")}t.write(";")},MethodDefinition(e,t){e.static&&t.write("static ");let i=e.kind[0];(i==="g"||i==="s")&&t.write(e.kind+" "),e.value.async&&t.write("async "),e.value.generator&&t.write("*"),e.computed?(t.write("["),this[e.key.type](e.key,t),t.write("]")):this[e.key.type](e.key,t),fe(t,e.value.params),t.write(" "),this[e.value.body.type](e.value.body,t)},ClassExpression(e,t){this.ClassDeclaration(e,t)},ArrowFunctionExpression(e,t){t.write(e.async?"async ":"",e);let{params:i}=e;i!=null&&(i.length===1&&i[0].type[0]==="I"?t.write(i[0].name,i[0]):fe(t,e.params)),t.write(" => "),e.body.type[0]==="O"?(t.write("("),this.ObjectExpression(e.body,t),t.write(")")):this[e.body.type](e.body,t)},ThisExpression(e,t){t.write("this",e)},Super(e,t){t.write("super",e)},RestElement:As=function(e,t){t.write("..."),this[e.argument.type](e.argument,t)},SpreadElement:As,YieldExpression(e,t){t.write(e.delegate?"yield*":"yield"),e.argument&&(t.write(" "),this[e.argument.type](e.argument,t))},AwaitExpression(e,t){t.write("await ",e),gi(t,e.argument,e)},TemplateLiteral(e,t){let{quasis:i,expressions:r}=e;t.write("`");let{length:s}=r;for(let a=0;a<s;a++){let o=r[a],u=i[a];t.write(u.value.raw,u),t.write("${"),this[o.type](o,t),t.write("}")}let n=i[i.length-1];t.write(n.value.raw,n),t.write("`")},TemplateElement(e,t){t.write(e.value.raw,e)},TaggedTemplateExpression(e,t){gi(t,e.tag,e),this[e.quasi.type](e.quasi,t)},ArrayExpression:Is=function(e,t){if(t.write("["),e.elements.length>0){let{elements:i}=e,{length:r}=i;for(let s=0;;){let n=i[s];if(n!=null&&this[n.type](n,t),++s<r)t.write(", ");else{n==null&&t.write(", ");break}}}t.write("]")},ArrayPattern:Is,ObjectExpression(e,t){let i=t.indent.repeat(t.indentLevel++),{lineEnd:r,writeComments:s}=t,n=i+t.indent;if(t.write("{"),e.properties.length>0){t.write(r),s&&e.comments!=null&&et(t,e.comments,n,r);let a=","+r,{properties:o}=e,{length:u}=o;for(let c=0;;){let l=o[c];if(s&&l.comments!=null&&et(t,l.comments,n,r),t.write(n),this[l.type](l,t),++c<u)t.write(a);else break}t.write(r),s&&e.trailingComments!=null&&et(t,e.trailingComments,n,r),t.write(i+"}")}else s?e.comments!=null?(t.write(r),et(t,e.comments,n,r),e.trailingComments!=null&&et(t,e.trailingComments,n,r),t.write(i+"}")):e.trailingComments!=null?(t.write(r),et(t,e.trailingComments,n,r),t.write(i+"}")):t.write("}"):t.write("}");t.indentLevel--},Property(e,t){e.method||e.kind[0]!=="i"?this.MethodDefinition(e,t):(e.shorthand||(e.computed?(t.write("["),this[e.key.type](e.key,t),t.write("]")):this[e.key.type](e.key,t),t.write(": ")),this[e.value.type](e.value,t))},PropertyDefinition(e,t){if(e.static&&t.write("static "),e.computed&&t.write("["),this[e.key.type](e.key,t),e.computed&&t.write("]"),e.value==null){e.key.type[0]!=="F"&&t.write(";");return}t.write(" = "),this[e.value.type](e.value,t),t.write(";")},ObjectPattern(e,t){if(t.write("{"),e.properties.length>0){let{properties:i}=e,{length:r}=i;for(let s=0;this[i[s].type](i[s],t),++s<r;)t.write(", ")}t.write("}")},SequenceExpression(e,t){fe(t,e.expressions)},UnaryExpression(e,t){if(e.prefix){let{operator:i,argument:r,argument:{type:s}}=e;t.write(i);let n=Ts(t,r,e);!n&&(i.length>1||s[0]==="U"&&(s[1]==="n"||s[1]==="p")&&r.prefix&&r.operator[0]===i&&(i==="+"||i==="-"))&&t.write(" "),n?(t.write(i.length>1?" (":"("),this[s](r,t),t.write(")")):this[s](r,t)}else this[e.argument.type](e.argument,t),t.write(e.operator)},UpdateExpression(e,t){e.prefix?(t.write(e.operator),this[e.argument.type](e.argument,t)):(this[e.argument.type](e.argument,t),t.write(e.operator))},AssignmentExpression(e,t){this[e.left.type](e.left,t),t.write(" "+e.operator+" "),this[e.right.type](e.right,t)},AssignmentPattern(e,t){this[e.left.type](e.left,t),t.write(" = "),this[e.right.type](e.right,t)},BinaryExpression:Ps=function(e,t){let i=e.operator==="in";i&&t.write("("),gi(t,e.left,e,!1),t.write(" "+e.operator+" "),gi(t,e.right,e,!0),i&&t.write(")")},LogicalExpression:Ps,ConditionalExpression(e,t){let{test:i}=e,r=t.expressionsPrecedence[i.type];r===yt||r<=t.expressionsPrecedence.ConditionalExpression?(t.write("("),this[i.type](i,t),t.write(")")):this[i.type](i,t),t.write(" ? "),this[e.consequent.type](e.consequent,t),t.write(" : "),this[e.alternate.type](e.alternate,t)},NewExpression(e,t){t.write("new ");let i=t.expressionsPrecedence[e.callee.type];i===yt||i<t.expressionsPrecedence.CallExpression||pa(e.callee)?(t.write("("),this[e.callee.type](e.callee,t),t.write(")")):this[e.callee.type](e.callee,t),fe(t,e.arguments)},CallExpression(e,t){let i=t.expressionsPrecedence[e.callee.type];i===yt||i<t.expressionsPrecedence.CallExpression?(t.write("("),this[e.callee.type](e.callee,t),t.write(")")):this[e.callee.type](e.callee,t),e.optional&&t.write("?."),fe(t,e.arguments)},ChainExpression(e,t){this[e.expression.type](e.expression,t)},MemberExpression(e,t){let i=t.expressionsPrecedence[e.object.type];i===yt||i<t.expressionsPrecedence.MemberExpression?(t.write("("),this[e.object.type](e.object,t),t.write(")")):this[e.object.type](e.object,t),e.computed?(e.optional&&t.write("?."),t.write("["),this[e.property.type](e.property,t),t.write("]")):(e.optional?t.write("?."):t.write("."),this[e.property.type](e.property,t))},MetaProperty(e,t){t.write(e.meta.name+"."+e.property.name,e)},Identifier(e,t){t.write(e.name,e)},PrivateIdentifier(e,t){t.write(`#${e.name}`,e)},Literal(e,t){e.raw!=null?t.write(e.raw,e):e.regex!=null?this.RegExpLiteral(e,t):e.bigint!=null?t.write(e.bigint+"n",e):t.write(la(e.value),e)},RegExpLiteral(e,t){let{regex:i}=e;t.write(`/${i.pattern}/${i.flags}`,e)}},ma={};var ar=class{constructor(t){let i=t??ma;this.output="",i.output!=null?(this.output=i.output,this.write=this.writeToStream):this.output="",this.generator=i.generator!=null?i.generator:da,this.expressionsPrecedence=i.expressionsPrecedence!=null?i.expressionsPrecedence:ha,this.indent=i.indent!=null?i.indent:" ",this.lineEnd=i.lineEnd!=null?i.lineEnd:`
9
9
  `,this.indentLevel=i.startingIndentLevel!=null?i.startingIndentLevel:0,this.writeComments=i.comments?i.comments:!1,i.sourceMap!=null&&(this.write=i.output==null?this.writeAndMap:this.writeToStreamAndMap,this.sourceMap=i.sourceMap,this.line=1,this.column=0,this.lineEndSize=this.lineEnd.split(`
@@ -12,7 +12,7 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1
12
12
  `).join(`
13
13
  `);i=`return ${e==="async-function"?"async ":""}function**(${n.join(", ")}) {
14
14
  ${g}
15
- }`,u.executionMode="RegularProgram"}else if(!["script","async-script"].includes(e))throw new Error(`Unrecognized sourceType specified: "${e}".`);c.sourceType=e,u.inBrowser=f,c.base64=p&&f&&"export default async function(%0) {%1}";let m=t(i,{parserParams:u,compilerParams:c});if(m instanceof Promise&&!["async-function","async-script","module"].includes(e))throw new Error("Parse-compile can only return a Promise for sourceTypes: async-function, async-script, module.");return l.sourceType=e,l.inBrowser=f,l.exportNamespace=a,l.fileName=o,at(m,g=>{let v=["function","async-function"].includes(e);return at(((y,w)=>{if(l.compileFunction)return l.compileFunction(w.toString(),[y]);if(c.base64){let C=`data:text/javascript;base64,${w.toString("base64")}`;return(()=>import(C).then(x=>x.default))()}return new(p?async function(){}.constructor:Function)(y,w.toString())})(g.identifier+"",g),y=>{let w=(C,b=s)=>{let x=y;C&&(x=x.bind(C));let _="global",S=new it(void 0,_,globalThis);return(e.endsWith("script")||b)&&(_="env",S=new it(S,_,b)),e==="module"&&(_="module",S=new it(S,_)),typeof C<"u"&&(S=new it(S,"this",{this:C})),new Yt(void 0,_,{...l,originalSource:g.originalSource,executionMode:g.isQuantumProgram&&"QuantumProgram"||"RegularProgram"},S,x)};return v?w().execute():{createRuntime:w,compilation:g}})})}var Jt=class{constructor(...t){let i=this.constructor,r=typeof t[t.length-1]=="object"?t.pop():{},s=t.pop()||"";this.$program=Ue(i.sourceType,i.parseCompileCallback,s,r)}execute(){return at(this.$program,({createRuntime:t})=>t().execute())}bind(t,i=void 0){return at(this.$program,({createRuntime:r})=>r(t,i))}toString(t=!1){return at(this.$program,({compilation:i})=>t?i+"":i.originalSource)}};function ba(...e){let{source:t,params:i}=Ui(e);return Ue("function",Qe,t,i)}function Ms(...e){let{source:t,params:i}=Ui(e);return Ue("async-function",Qe,t,i)}var wa=Ms,We=class extends Jt{};G(We,"sourceType","script"),G(We,"parseCompileCallback",Qe);var me=class extends Jt{};G(me,"sourceType","async-script"),G(me,"parseCompileCallback",Qe);var va=me,ze=class extends Jt{};G(ze,"sourceType","module"),G(ze,"parseCompileCallback",Qe);function Qe(e,t){let i=Ls(e,t.parserParams);return Rs(i,t.compilerParams)}function Ge(e,t,i={},r={}){t=W(t).slice();for(var s=e;!kt(s)&&!Ee(s)&&t.length;){var n=t.shift();if(!(i.get?i.get(s,n):q(s)?n in s:s[n])){r.exists=!1;return}s=i.get?i.get(s,n):s[n]}return r.exists=!0,s}function ur(e,t,i,r={},s={}){let n=(l,f,p)=>s.set?s.set(l,f,p):(ut(t[o])&&L(l)?l.push(p):l[f]=p,!0);t=W(t);for(var a=e,o=0;o<t.length;o++)if(o<t.length-1){if(!a||!q(a)&&!F(a))return!1;var u=Ge(a,t[o],s);if(!q(u)){if(s.buildTree===!1)return!1;u=F(s.buildTree)?s.buildTree(o):ut(t[o+1])?[]:{};var c=n(a,t[o],u);if(!c)return!1}a=u}else return n(a,t[o],i)}var Ke=class{constructor(t,i=!1){Object.defineProperty(this,"window",{value:t}),Object.defineProperty(this,"readCallbacks",{value:new Set}),Object.defineProperty(this,"writeCallbacks",{value:new Set}),Object.defineProperty(this,"_synthesis",{value:0,writable:!0}),!i&&this.window.requestAnimationFrame?this._loop():this._synthesis++}get synthesis(){return this._synthesis}async synthesizeWhile(t){this._synthesis++,this._fulfill();let i=await t();return this._synthesis--,i}_fulfill(){for(let t of this.readCallbacks)t(),this.readCallbacks.delete(t);for(let t of this.writeCallbacks)t(),this.writeCallbacks.delete(t)}_loop(){this.window.requestAnimationFrame(()=>{this._fulfill(),this._loop()})}onread(t,i=!1){if(i)return new Promise(r=>{this.synthesis?r(t()):this.readCallbacks.add(()=>{r(t())})});this.synthesis?Promise.resolve().then(t):this.readCallbacks.add(t)}onwrite(t,i=!1){if(i)return new Promise(r=>{this.synthesis?r(t()):this.writeCallbacks.add(()=>{r(t())})});this.synthesis?Promise.resolve().then(t):this.writeCallbacks.add(t)}cycle(t,i,r){this.onread(()=>{let s=t(r),n=a=>{a!==void 0&&this.onwrite(()=>{let o=i(a,r),u=c=>{c!==void 0&&this.cycle(t,i,c)};o instanceof Promise?o.then(u):u(o)})};s instanceof Promise?s.then(n):n(s)})}};function Ds(e){return(e=e.trim())&&e.startsWith("(")&&e.endsWith(")")}function ge(e,t,i,r=!0){i=(Array.isArray(i)?i:[i]).map(a=>(a+"").replace("(",r?"(.//":"(./")).join("|");let s=[],n;try{let a=e.document.evaluate(i,t,null,e.XPathResult.ANY_TYPE);for(;n=a.iterateNext();)s.push(n)}catch{}return s}function Vs(e,t,i){i=(Array.isArray(i)?i:[i]).map(r=>(r+"").replace("(","(self::")).join("|");try{return e.document.evaluate(`${i}`,t,null,e.XPathResult.BOOLEAN_TYPE).booleanValue}catch{}}function Xe(e,t,i,r=!1,s=null){let n=s?.get(t)?.get(i);if(typeof n<"u")return n;let a=c=>(s?.has(t)||s?.set(t,new WeakMap),s?.get(t)?.set(i,c),c),o=t.getRootNode(),u=i.getRootNode();return o===u?a(t.contains(i)):r&&u instanceof e.ShadowRoot?a(Xe(e,t,u.host,r,s)):a(!1)}function Fs(e,t="|"){return[...e].reduce(([i,r,s,n],a)=>!i&&r===0&&(Array.isArray(t)?t:[t]).includes(a)?[i,r,[""].concat(s)]:(!i&&["(","[","{"].includes(a)&&!s[0].endsWith("\\")&&r++,!i&&[")","]","}"].includes(a)&&!s[0].endsWith("\\")&&r--,['"',"'","`"].includes(a)&&!s[0].endsWith("\\")&&(i=i===a?null:i||a),s[0]+=a,[i,r,s]),[null,0,[""]])[2].reverse()}var pt=class{constructor(t){this.content=t,this.type=typeof t=="string"?"selector":"instance",this.kind=this.type==="instance"?null:Ds(t)?"xpath":"css",this.kind==="xpath"&&(this.isXpathAttr=Fs(t.trim().slice(1,-1),"@").length>1)}toString(){return this.content}};var Zt=class{constructor(t,i,r){this.context=t,this.namespace=i,this.window=t.defaultView||t.ownerDocument?.defaultView||r,this.document=this.window.document,this.webqit=this.window.webqit,Object.defineProperty(this,"#",{value:{}})}resolveArgs(t){if(F(t[0])?t=[[],...t]:V(t[0])&&!(t[0]instanceof pt)&&t.length===1?t=[[],void 0,t[0]]:V(t[1])&&t.length===2?t=[W(t[0],!1),void 0,t[1]]:t[0]=W(t[0],!1),t[0].filter(i=>typeof i!="string"&&!(i instanceof pt)&&!(i instanceof this.window.Node)).length)throw new Error("Argument #2 must be either a string or a Node object, or a list of those.");return t[0]=t[0].map(i=>i instanceof pt?i:new pt(i)),t}registry(...t){return K("realdom.realtime",this.window,this.namespace,...t)}createSignalGenerator(){return{generate(){return this.lastController?.abort(),this.lastController=new AbortController,{signal:this.lastController.signal}},disconnect(){this.lastController?.abort()}}}forEachMatchingContext(t,i,r){let{window:s}=this,n=new Set,a=new WeakMap;for(let[o,u]of this.registry(t)){let c=[].concat(i).filter(f=>Xe(s,o.context,f.target,o.params.subtree==="cross-roots",a));if(!c.length)continue;let l=[o,Array.isArray(i)?c:c[0]];u?n.add(l):r.call(s,...l)}for(let o of n)r.call(s,...o);n.clear()}disconnectables(t,...i){let r={disconnect(){i.forEach(s=>s&&F(s.disconnect)&&s.disconnect()||F(s)&&s()||V(s)&&(s.disconnected=!0))}};return t&&t.addEventListener("abort",()=>r.disconnect()),r}};var Vt=class extends Zt{type="attr";constructor(t,...i){super(t,"attr",...i)}get(t,i=void 0,r={}){let s=typeof t=="string"||t instanceof pt;[t=[],i=void 0,r={}]=this.resolveArgs(arguments);let{context:n}=this,a=Hs(n,t);if(!i)return a;let o=r.lifecycleSignals&&this.createSignalGenerator();if(s)for(let u of a){let c=o?o.generate():{};i(u,c,n)}else{let u=o?.generate()||{};i(a,u,n)}if(r.live){o&&(r={...r,signalGenerator:o});let u=this.observe(s?t[0]:t,i,{newValue:!0,...r});return this.disconnectables(r.signal,u)}}observe(t,i,r={}){let s=typeof t=="string"||t instanceof pt;if([t=[],i,r={}]=this.resolveArgs(arguments),["sync","intercept"].includes(r.timing))return this.observeSync(s?t[0]:t,i,r);if(r.timing&&r.timing!=="async")throw new Error(`Timing option "${r.timing}" invalid.`);let{context:n,window:a,webqit:o}=this;r.eventDetails&&!o.realdom.attrInterceptionHooks?.intercepting&&js.call(a,"intercept",()=>{});let u=new a.MutationObserver(p=>{p=Bs(p).map(m=>Us.call(a,m)),qs.call(a,f,p,n)}),c={attributes:!0,attributeOldValue:r.oldValue,subtree:r.subtree&&!0};t.length&&(c.attributeFilter=t.map(p=>p+"")),u.observe(n,c);let l=r.signalGenerator||r.lifecycleSignals&&this.createSignalGenerator(),f={context:n,spec:t,callback:i,params:r,atomics:new Map,originalFilterIsString:s,signalGenerator:l,disconnectable:u};return this.disconnectables(r.signal,u,l)}observeSync(t,i,r={}){let s=typeof t=="string"||t instanceof pt;[t,i,r={}]=this.resolveArgs(arguments);let{context:n,window:a}=this;if(r.timing&&!["sync","intercept"].includes(r.timing))throw new Error(`Timing option "${r.timing}" invalid.`);let o=r.timing==="intercept"?"intercept":"sync";this.registry(o).size||js.call(a,o,p=>{this.forEachMatchingContext(o,p,qs)});let u={disconnect(){f.delete(l)}},c=r.signalGenerator||r.lifecycleSignals&&this.createSignalGenerator(),l={context:n,spec:t,callback:i,params:r,atomics:new Map,originalFilterIsString:s,signalGenerator:c,disconnectable:u},f=this.registry(o);return f.set(l,!!l.params.deferred),this.disconnectables(r.signal,u,c)}};function Bs(e){return e.reduce((t,i,r)=>t[r-1]?.attributeName===i.attributeName||K(i.target,"internalAttrInteractions").get(i.attributeName)?t:t.concat(i),[])}function qs(e,t){let{context:i,spec:r,callback:s,params:n,atomics:a,originalFilterIsString:o,signalGenerator:u}=e;if(n.subtree||(t=t.filter(p=>p.target===i)),!t.length)return;let c=r.map(p=>p+"");if(n.atomic&&!a.size?t=Hs(i,r,t):n.timing!=="async"&&r.length&&(t=t.filter(p=>c.includes(p.name))),!t.length)return;n.newValue===null&&n.oldValue===null&&n.eventDetails||(t=t.map(p=>{let m;return n.eventDetails||({event:m,...p}=p),!n.oldValue&&"oldValue"in p&&({oldValue:m,...p}=p),!n.newValue&&"value"in p?{value:m,...p}=p:n.newValue&&typeof p.value>"u"&&(p={...p,value:xi(p.target,p.name,()=>p.target.getAttribute(p.name))}),p})),n.atomic&&(t.forEach(p=>a.set(p.name,p)),t=Array.from(a.entries()).map(([,p])=>p));let l=o?t[0]:t,f=u?u.generate():{};s(l,f,i)}function xi(e,t,i){let r=K(e,"internalAttrInteractions").get(t);K(e,"internalAttrInteractions").set(t,!0);let s=i();return K(e,"internalAttrInteractions").set(t,r),s}function Hs(e,t,i=[]){let r={event:null,type:"attribute"};return t.length?t.map(n=>(n=n+"",i.find(a=>a.name===n)||{target:e,name:n,value:xi(e,n,()=>e.getAttribute(n)),...r})):Array.from(e.attributes).map(n=>i.find(a=>a.name===n.nodeName)||{target:e,name:n.nodeName,value:xi(e,n.nodeName,()=>n.nodeValue),...r})}function Us({target:e,attributeName:t,value:i,oldValue:r}){let a=(this.webqit.realdom.attrInterceptionRecords?.get(e)||{})[t]?.[0]||"mutation";return{target:e,name:t,value:i,oldValue:r,type:"observation",event:a}}function js(e,t){let i=this,{webqit:r,document:s,Element:n}=i;r.realdom.attrInterceptionHooks||Object.defineProperty(r.realdom,"attrInterceptionHooks",{value:new Map}),r.realdom.attrInterceptionHooks.has(e)||r.realdom.attrInterceptionHooks.set(e,new Set),r.realdom.attrInterceptionHooks.get(e).add(t);let a=()=>r.realdom.attrInterceptionHooks.get(e).delete(t);if(r.realdom.attrInterceptionHooks?.intercepting)return a;console.warn("Attr mutation APIs are now being intercepted."),r.realdom.attrInterceptionHooks.intercepting=!0,Object.defineProperty(r.realdom,"attrInterceptionRecords",{value:new Map});let o=(l,f)=>{r.realdom.attrInterceptionRecords.has(l.target)||r.realdom.attrInterceptionRecords.set(l.target,{});let p=r.realdom.attrInterceptionRecords.get(l.target);if(p[l.name]=p[l.name]||[],p[l.name].unshift(l.event),K(l.target,"internalAttrInteractions").get(l.name))return f();r.realdom.attrInterceptionHooks.get("intercept")?.forEach(g=>g([l]));let m=f();return r.realdom.attrInterceptionHooks.get("sync")?.forEach(g=>g([l])),m};new i.MutationObserver(l=>{l=l.filter(f=>!(i.webqit.realdom.attrInterceptionRecords?.get(f.target)||{})[f.attributeName]?.shift()),l=Bs(l).map(f=>Us.call(i,f)),l.length&&(r.realdom.attrInterceptionHooks.get("intercept")?.forEach(f=>f(l)),r.realdom.attrInterceptionHooks.get("sync")?.forEach(f=>f(l)))}).observe(s,{attributes:!0,subtree:!0,attributeOldValue:!0});let c=Object.create(null);return["setAttribute","removeAttribute","toggleAttribute"].forEach(l=>{c[l]=n.prototype[l],n.prototype[l]=function(...f){let p,m=xi(this,f[0],()=>this.getAttribute(f[0]));["setAttribute","toggleAttribute"].includes(l)&&(p=f[1]),l==="toggleAttribute"&&p===void 0&&(p=m===null);let g={target:this,name:f[0],value:p,oldValue:m,type:"interception",event:[this,l]};return o(g,()=>c[l].call(this,...f))}}),a}var Ye=class extends Zt{constructor(t,...i){super(t,"tree",...i)}attr(t,i=void 0,r={}){let{context:s,window:n}=this;return new Vt(s,n).get(...arguments)}query(t,i=void 0,r={}){[t,i=void 0,r={}]=this.resolveArgs(arguments);let{context:s}=this,n=new Map,a=c=>(n.has(c)||n.set(c,{target:c,entrants:[],exits:[],type:"query",event:null}),n.get(c));if(!r.generation||r.generation==="entrants"){if(!t.length)[...s.children].forEach(c=>a(s).entrants.push(c));else if(t.every(c=>c.type==="selector")){let[c,l]=t.reduce(([p,m],g)=>g.kind==="xpath"?[p,m.concat(g)]:[p.concat(g),m],[[],[]]),f=[];r.subtree?(c.length&&f.push(...s.querySelectorAll(c.join(","))),l.length&&f.push(...ge(this.window,s,l))):(c.length&&f.push(...[...s.children].filter(p=>p.matches(c))),l.length&&f.push(...ge(this.window,s,l,!1))),f.forEach(p=>a(p.parentNode||s).entrants.push(p))}}if(!i)return n;let o={disconnected:!1},u=i&&r.lifecycleSignals&&this.createSignalGenerator();for(let[,c]of n){if(o.disconnected)break;let l=u?.generate()||{};i(c,l,s)}if(r.live){u&&(r={...r,signalGenerator:u});let c=this.observe(t,i,r);return this.disconnectables(r.signal,o,c)}return this.disconnectables(r.signal,o,u)}children(t,i=void 0,r={}){return[t,i=void 0,r={}]=this.resolveArgs(arguments),this.query(t,i,{...r,subtree:!1})}subtree(t,i=void 0,r={}){return[t,i=void 0,r={}]=this.resolveArgs(arguments),this.query(t,i,{...r,subtree:!0})}observe(t,i,r={}){if([t,i,r={}]=this.resolveArgs(arguments),["sync","intercept"].includes(r.timing))return this.observeSync(t,i,r);if(r.timing&&r.timing!=="async")throw new Error(`Timing option "${r.timing}" invalid.`);let{context:s,window:n,webqit:a,document:o}=this;r.eventDetails&&(a.realdom.domInterceptionRecordsAlwaysOn=!0),(o.readyState==="loading"||a.realdom.domInterceptionRecordsAlwaysOn)&&!a.realdom.domInterceptionHooks?.intercepting&&Qs.call(n,"sync",()=>{});let u=new n.MutationObserver(f=>f.forEach(p=>{lr.call(n,l,zs.call(n,p),s)}));u.observe(s,{childList:!0,subtree:r.subtree&&!0});let c=r.signalGenerator||r.lifecycleSignals&&this.createSignalGenerator(),l={context:s,spec:t,callback:i,params:r,signalGenerator:c,disconnectable:u};if(r.staticSensitivity){let f=Ws.call(n,l);return this.disconnectables(r.signal,u,c,f)}return this.disconnectables(r.signal,u,c)}observeSync(t,i,r={}){[t,i,r={}]=this.resolveArgs(arguments);let{context:s,window:n}=this;if(r.timing&&!["sync","intercept"].includes(r.timing))throw new Error(`Timing option "${r.timing}" invalid.`);let a=r.timing==="intercept"?"intercept":"sync";this.registry(a).size||Qs.call(n,a,p=>{this.forEachMatchingContext(a,p,lr)});let o=new n.MutationObserver(p=>p.forEach(m=>{Array.isArray((m=zs.call(n,m)).event)||lr.call(n,l,m,s)}));o.observe(s,{childList:!0,subtree:r.subtree&&!0});let u={disconnect(){f.delete(l),o.disconnect()}},c=r.signalGenerator||r.lifecycleSignals&&this.createSignalGenerator(),l={context:s,spec:t,callback:i,params:r,signalGenerator:c,disconnectable:u},f=this.registry(a);if(f.set(l,!!l.params.deferred),r.staticSensitivity){let p=Ws.call(n,l);return this.disconnectables(r.signal,u,c,p)}return this.disconnectables(r.signal,u,c)}track(t,i,r={}){return r={subtree:!0,...r},this.observe(t,s=>{s.entrants.length&&i(!0,Array.isArray(t)?s.entrants:s.entrants[0]),s.exits.length&&i(!1,Array.isArray(t)?s.exits:s.exits[0])},r)}};function Ws(e){let t=this,{context:i,spec:r,callback:s,params:n,signalGenerator:a}=e,o=r.filter(m=>m.kind==="css"),u=m=>m.match(/\.([\w-]+)/g)?.length?["class"]:[],c=m=>m.match(/#([\w-]+)/g)?.length?["id"]:[],l=m=>[...m.matchAll(/\[([^\=\]]+)(\=[^\]]+)?\]/g)].map(g=>g[1]).concat(u(m)).concat(c(m));if(!(e.$attrs=Array.from(new Set(o.filter(m=>(m+"").includes("[")).reduce((m,g)=>m.concat(l(g+"")),[])))).length)return;let f=new Set,p=new Set;return f.push=m=>(p.delete(m),f.add(m)),p.push=m=>(f.delete(m),p.add(m)),e.$deliveryCache={entrants:f,exits:p},new Vt(i,t).observe(e.$attrs,m=>{let g=new Map,v=w=>(g.has(w)||g.set(w,{target:w,entrants:[],exits:[],type:"static",event:null}),g.get(w)),E=new WeakMap,y=w=>(E.has(w)||E.set(w,o.some(C=>w.matches(C+""))),E.get(w));for(let w of m)["entrants","exits"].forEach(C=>{n.generation&&C!==n.generation||e.$deliveryCache[C].has(w.target)||(C==="entrants"?!y(w.target):y(w.target))||(e.$deliveryCache[C].push(w.target),v(w.target)[C].push(w.target),v(w.target).event=w.event)});for(let[,w]of g){let C=a?.generate()||{};s(w,C,i)}},{subtree:n.subtree,timing:n.timing,eventDetails:n.eventDetails})}function lr(e,t){let{context:i,spec:r,callback:s,params:n,signalGenerator:a,$deliveryCache:o}=e,u={...t,entrants:[],exits:[]};if(n.eventDetails||delete u.event,["entrants","exits"].forEach(l=>{if(!(n.generation&&l!==n.generation)&&(r.length?u[l]=Ca.call(this,r,n.subtree==="cross-roots",t[l],t.event!=="parse"):u[l]=[...t[l]],!!o))for(let f of u[l])o[l].push(f)}),!u.entrants.length&&!u.exits.length)return;let c=a?.generate()||{};s(u,c,i)}function Ca(e,t,i,r){i=Array.isArray(i)?i:[...i];let s=(n,a)=>{if(a.type==="selector"){let o=a.isXpathAttr?[]:n.filter(u=>a.kind==="xpath"?Vs(this,u,a+""):u.matches&&u.matches(a+""));if((r||a.isXpathAttr)&&(o=n.reduce((u,c)=>a.kind==="xpath"?[...u,...ge(this,c,a,r)]:c.querySelectorAll?[...u,...c.querySelectorAll(a+"")]:u,o)),o.length)return o}else if(n.includes(a.content)||r&&n.some(o=>Xe(this,o,a.content,t)))return[a.content]};return i.$$searchCache||(i.$$searchCache=new Map),e.reduce((n,a)=>{let o;return i.$$searchCache.has(a.content)?o=i.$$searchCache.get(a.content):(o=s(i,a)||[],a.type==="instance"&&i.$$searchCache.set(a.content,o)),n.concat(o)},[])}function zs({target:e,addedNodes:t,removedNodes:i}){let r=this,s;return s=W(t).reduce((n,a)=>n||r.webqit.realdom.domInterceptionRecords?.get(a),null),s=W(i).reduce((n,a)=>n||r.webqit.realdom.domInterceptionRecords?.get(a),s),s=s||r.document.readyState==="loading"&&"parse"||"mutation",{target:e,entrants:t,exits:i,type:"observation",event:s}}function Qs(e,t){let i=this,{webqit:r,document:s,Node:n,CharacterData:a,Element:o,HTMLElement:u,HTMLTemplateElement:c,DocumentFragment:l}=i;r.realdom.domInterceptionHooks||Object.defineProperty(r.realdom,"domInterceptionHooks",{value:new Map}),r.realdom.domInterceptionNoRecurse||Object.defineProperty(r.realdom,"domInterceptionNoRecurse",{value:new Map}),r.realdom.domInterceptionHooks.has(e)||r.realdom.domInterceptionHooks.set(e,new Set),r.realdom.domInterceptionHooks.get(e).add(t);let f=()=>r.realdom.domInterceptionHooks.get(e).delete(t);if(r.realdom.domInterceptionHooks?.intercepting)return f;console.warn("DOM mutation APIs are now being intercepted."),r.realdom.domInterceptionHooks.intercepting=!0,Object.defineProperty(r.realdom,"domInterceptionRecords",{value:new Map});let p=(y,w,C)=>{r.realdom.domInterceptionNoRecurse.set(y,w);let b=C();return r.realdom.domInterceptionNoRecurse.delete(y),b},m=(y,w)=>{y.entrants.concat(y.exits).forEach(b=>{clearTimeout(r.realdom.domInterceptionRecords.get(b)?.timeout),r.realdom.domInterceptionRecords.set(b,y.event);let x=setTimeout(()=>{r.realdom.domInterceptionRecords.delete(b)},0);Object.defineProperty(y.event,"timeout",{value:x,configurable:!0})}),r.realdom.domInterceptionHooks.get("intercept")?.forEach(b=>b(y));let C=w();return r.realdom.domInterceptionHooks.get("sync")?.forEach(b=>b(y)),C},g={ShadowRoot:["innerHTML","setHTMLUnsafe"],DocumentFragment:["replaceChildren","append","prepend"],Document:["replaceChildren","append","prepend"],HTMLElement:["outerText","innerText"],Element:["append","prepend","before","after","insertAdjacentElement","insertAdjacentHTML","remove","replaceChildren","replaceWith","setHTMLUnsafe","innerHTML","outerHTML"],CharacterData:["before","after","remove","replaceWith"],Node:["insertBefore","replaceChild","removeChild","appendChild","textContent","nodeValue"]},v={ShadowRoot:Object.create(null),DocumentFragment:Object.create(null),Document:Object.create(null),HTMLElement:Object.create(null),Element:Object.create(null),CharacterData:Object.create(null),Node:Object.create(null)};return new Set(Object.values(g).reduce((y,w)=>y.concat(w),[])).forEach(y=>{Object.keys(g).forEach(b=>{if(!g[b].includes(y))return;let x=Object.getOwnPropertyDescriptor(i[b].prototype,y);!x||(Object.defineProperty(i[b].prototype,y,"value"in x?{...x,value:w}:{...x,set:C}),v[b][y]=x)});function w(...b){let x=Object.keys(v).find(X=>this instanceof i[X]&&y in v[X]),_=v[x],S=()=>_[y].value.call(this,...b);if(r.realdom.domInterceptionNoRecurse.get(this)===y)return S();let O=[],P=[],D=this;["insertBefore"].includes(y)?P=[b[0]]:["insertAdjacentElement","insertAdjacentHTML"].includes(y)?(P=[b[1]],["beforebegin","afterend"].includes(b[0])&&(D=this.parentNode)):["setHTMLUnsafe","replaceChildren"].includes(y)?(O=[...this.childNodes],P=y==="replaceChildren"?[...b]:[b[0]]):["replaceWith","remove"].includes(y)?(O=[this],P=y==="replaceWith"?[...b]:[],D=this.parentNode):["replaceChild"].includes(y)?(O=[b[1]],P=[b[0]]):["removeChild"].includes(y)?O=[...b]:(P=[...b],["before","after"].includes(y)&&(D=this.parentNode));let U=y;if(["insertAdjacentHTML","setHTMLUnsafe"].includes(y)){let X=this.nodeName;if(y==="insertAdjacentHTML"&&["beforebegin","afterend"].includes(b[0])){if(!this.parentNode)return _[y].value.call(this,...b);X=this.parentNode.nodeName}let Y=s.createElement(X.includes("-")?"div":X);_.setHTMLUnsafe.value.call(Y,P[0],y==="setHTMLUnsafe"?b[1]:{}),P=[...Y.childNodes],y==="insertAdjacentHTML"?(U="insertAdjacentElement",b[1]=new l,p(b[1],"append",()=>b[1].append(...Y.childNodes))):(U="replaceChildren",b=[...Y.childNodes])}return m({target:D,entrants:P,exits:O,type:"interception",event:[this,y]},()=>_[U].value.call(this,...b))}function C(b){let x=Object.keys(v).find(Q=>this instanceof i[Q]&&y in v[Q]),_=v[x],S=()=>_[y].set.call(this,b);if(this instanceof HTMLScriptElement||r.realdom.domInterceptionNoRecurse.get(this)===y)return S();let O=[],P=[],D=this;if(["outerHTML","outerText"].includes(y)?(O=[this],D=this.parentNode):this instanceof c?(D=this.content,O=[...this.content.childNodes]):O=[...this.childNodes],["outerHTML","innerHTML"].includes(y)){let Q=this.nodeName;if(y==="outerHTML"){if(!this.parentNode)return S();Q=this.parentNode.nodeName}let X=s.createElement(Q.includes("-")?"div":Q);if(p(X,y,()=>X[y]=b),P=this instanceof c?[...X.content.childNodes]:[...X.childNodes],this instanceof c&&this.hasAttribute("src")||this instanceof ShadowRoot){let Y=Bt=>Bt.reduce((Et,Ct)=>Ct instanceof HTMLScriptElement?Et.concat(Ct):Ct instanceof c?Et.concat(Y([Ct.content])):(Et=Et.concat(Y([...Ct.querySelectorAll?.("template")||[]].map(hn=>hn.content))),Et.concat(...Ct.querySelectorAll?.("script")||[])),[]);for(let Bt of Y(P)){if(this instanceof ShadowRoot){Bt.setAttribute("data-handling","manual");continue}let Et=s.createElement("script");[...Bt.attributes].forEach(Ct=>Et.setAttribute(Ct.name,Ct.value)),Et.textContent=Bt.textContent,p(Bt,"replaceWith",()=>Bt.replaceWith(Et))}}y==="outerHTML"?(b=new l,p(b,"append",()=>b.append(...P)),S=()=>p(this,"replaceWith",()=>o.prototype.replaceWith.call(this,b))):this instanceof c?S=()=>p(this.content,"replaceChildren",()=>this.content.replaceChildren(...P)):S=()=>p(this,"replaceChildren",()=>o.prototype.replaceChildren.call(this,...P))}return m({target:D,entrants:P,exits:O,type:"interception",event:[this,y]},S)}}),f}function Gs(){ka.call(this),Aa.call(this),Pa.call(this)}function ka(){let e=this;e.CSS||(e.CSS={}),e.CSS.escape||(e.CSS.escape=t=>t.replace(/([\:@\~\$\&])/g,"\\$1"))}function Aa(){let e=this;"isConnected"in e.Node.prototype||Object.defineProperty(e.Node.prototype,"isConnected",{get:function(){return!this.ownerDocument||!(this.ownerDocument.compareDocumentPosition(this)&this.DOCUMENT_POSITION_DISCONNECTED)}})}function Pa(){let e=this;e.Element.prototype.matches||(e.Element.prototype.matches=e.Element.prototype.matchesSelector||e.Element.prototype.mozMatchesSelector||e.Element.prototype.msMatchesSelector||e.Element.prototype.oMatchesSelector||e.Element.prototype.webkitMatchesSelector||function(t){for(var i=(this.document||this.ownerDocument).querySelectorAll(t),r=i.length;--r>=0&&i.item(r)!==this;);return r>-1})}function Ks(){let e=this;if(e.webqit||(e.webqit={}),e.webqit.realdom)return e.webqit.realdom;e.webqit.realdom={},Gs.call(e),e.webqit.realdom.meta=(...i)=>Ia.call(e,...i),e.webqit.realdom.ready=(...i)=>hr.call(e,...i),e.webqit.realdom.realtime=(i,r="dom")=>{if(r==="dom")return new Ye(i,e);if(r==="attr")return new Vt(i,e)};let t=new Ke(e);return e.webqit.realdom.schedule=(i,...r)=>t[`on${i}`](...r),e.webqit.realdom.synthesizeWhile=(...i)=>t.synthesizeWhile(...i),e.webqit.realdom}function hr(...e){let t="interactive",i;ae(e[0])?(t=e[0],F(e[1])&&(i=e[1])):F(e[0])&&(i=e[0]);let r={interactive:["interactive","complete"],complete:["complete"]};if(!r[t])throw new Error(`Invalid ready-state timing: ${t}.`);let s=this;if(!i)return s.webqit.realdom.readyStatePromises||(s.webqit.realdom.readyStatePromises={interactive:new Promise(n=>hr.call(this,"interactive",n)),complete:new Promise(n=>hr.call(this,"complete",n))}),s.webqit.realdom.readyStatePromises[t];if(r[t].includes(s.document.readyState))return i(s);s.webqit.realdom.readyStateCallbacks||(s.webqit.realdom.readyStateCallbacks={interactive:[],complete:[]},s.document.addEventListener("readystatechange",()=>{let n=s.document.readyState;for(let a of s.webqit.realdom.readyStateCallbacks[n].splice(0))a(s)},!1)),s.webqit.realdom.readyStateCallbacks[t].push(i)}function Ia(e){let t=this,i={},r;return(r=t.document.querySelector(`meta[name="${e}"]`))&&(i=(r.content||"").split(";").filter(s=>s).reduce((s,n)=>{let a=n.split("=").map(o=>o.trim());return ur(s,a[0].split("."),a[1]==="true"?!0:a[1]==="false"?!1:ut(a[1])?parseInt(a[1]):a[1]),s},{})),{get name(){return e},get content(){return r.content},json(){return JSON.parse(JSON.stringify(i))}}}function bi(e,t){return typeof e!="string"?e:e.replace(/\w\S*/g,function(i){return i.charAt(0).toUpperCase()+(typeof t!==void 0&&t?i.substr(1).toLowerCase():i.substr(1))})}var A=(...e)=>K("oohtml",...e),H={};function st(e,t,i){let r=this,s=Ks.call(r);H.window=r,r.webqitConfig||(r.webqitConfig=s.meta("webqit").json()),r.webqit||(r.webqit={}),r.webqit.oohtml||(r.webqit.oohtml={}),r.webqit.oohtml.configs||(r.webqit.oohtml.configs={});let n=e.toUpperCase().replace("-","_");if(!r.webqit.oohtml.configs[n]){r.webqit.oohtml.configs[n]={};let a=r.webqit.oohtml.configs[n];ke(2,a,i,t,s.meta(e).json()),r.webqitConfig.prefix&&Object.keys(a).forEach(o=>{Object.keys(a[o]).forEach(u=>{o==="api"&&typeof a[o][u]=="string"?a[o][u]=`${r.webqitConfig.prefix}${bi(a[o][u])}`:["attr","elements"].includes(o)&&a[o][u]?.startsWith("data-")===!1&&(a[o][u]=`${r.webqitConfig.prefix}-${a[o][u]}`)})})}return{config:r.webqit.oohtml.configs[n],realdom:s,window:r}}function pr(e,t){return K(e,"internalAttrInteractions").get(t)}function Ys(e,t,i){let r=K(e,"internalAttrInteractions").get(t);K(e,"internalAttrInteractions").set(t,!0);let s=i();return K(e,"internalAttrInteractions").set(t,r),s}function $t(e,t){return[...e].reduce(([i,r,s],n)=>!i&&r===0&&(Array.isArray(t)?t:[t]).includes(n)?[i,r,[""].concat(s)]:(!i&&["(","[","{"].includes(n)&&!s[0].endsWith("\\")&&r++,!i&&[")","]","}"].includes(n)&&!s[0].endsWith("\\")&&r--,['"',"'","`"].includes(n)&&!s[0].endsWith("\\")&&(i=i===n?null:i||n),s[0]+=n,[i,r,s]),[null,0,[""]])[2].reverse()}var Na=()=>(0|Math.random()*9e6).toString(36),fr=new Map;function te(e){let t;return(t=fr.get(e))||(t=Na(),fr.set(e,t)),t}function wi(e){let t;return fr.forEach((i,r)=>{i===e&&(t=r)}),t}function vi(){let{window:e}=H,{webqit:t}=e;if(t.DOMContextRequestEvent)return t.DOMContextRequestEvent;class i extends e.Event{constructor(...s){let n=s.pop();if(typeof n!="function")throw new Error("Callback must be provided.");let a=s.pop();if(!a?.kind)throw new Error('"options.kind" must be specified.');let o=["contextrequest","contextclaim"],u=s.pop()||o[0];if(!o.includes(u))throw new Error(`Invalid event type. Must be one of: ${o.join(",")}`);let{kind:c,detail:l,targetContext:f,live:p,signal:m,diff:g,...v}=a;super(u,{...v,bubbles:v.bubbles!==!1}),Object.defineProperty(this,"callback",{get:()=>n}),Object.defineProperty(this,"kind",{get:()=>c}),Object.defineProperty(this,"targetContext",{get:()=>f}),Object.defineProperty(this,"detail",{get:()=>l}),Object.defineProperty(this,"live",{get:()=>p}),Object.defineProperty(this,"signal",{get:()=>m}),Object.defineProperty(this,"diff",{get:()=>g}),Object.defineProperty(this,"options",{get:()=>v}),Object.defineProperty(this,"meta",{value:{}})}get target(){return super.target||this.meta.target}get answered(){return this.meta.answered||!1}respondWith(s){if(this.meta.answered=!0,this.diff){if("_prevValue"in this&&this._prevValue===s)return;Object.defineProperty(this,"_prevValue",{value:s,configurable:!0})}return this.callback(s)}}return t.DOMContextRequestEvent=i,i}var ee=class extends AbortController{constructor(t){super(),t(i=>{let{window:{webqit:{Observer:r}}}=H;r.defineProperty(this,"value",{value:i,configurable:!0,enumerable:!0})},this)}};var ie=class extends Error{};var Ft=class{static instance(t){return A(t).get("contexts::instance")||new this(t)}constructor(t){A(t).get("contexts::instance")?.dispose(),A(t).set("contexts::instance",this);let i={host:t,contexts:new Set};Object.defineProperty(this,"#",{get:()=>i})}[Symbol.iterator](){return this["#"].contexts[Symbol.iterator]()}get length(){return this["#"].contexts.size}find(...t){return[...this["#"].contexts].find(i=>typeof t[0]=="function"?t[0](i):i.constructor.kind===t[0]&&(!t[1]||i.detail===t[1]))}attach(t){if(!(t instanceof nt))throw new TypeError("Context is not a valid DOMContext instance.");if(this.find(t.constructor.kind,t.detail))throw new ie(`Context of same kind "${t.constructor.kind}"${t.detail?` and detail "${t.detail}"`:""} already exists.`);this["#"].contexts.add(t),t.initialize(this["#"].host)}detach(t){t.dispose(this["#"].host),this["#"].contexts.delete(t)}request(...t){return new ee((i,r)=>{typeof t[t.length-1]!="function"&&(t[t.length-1]?t.push(i):t[t.length-1]=i);let s;(s=t.find(a=>typeof a=="object"&&a))&&s.live&&(s.signal&&s.signal.addEventListener("abort",()=>r.abort()),t[t.indexOf(s)]={...s,signal:r.signal});let n=new(vi())(...t);this["#"].host.dispatchEvent(n)})}};var dr=class{static createRequest(){return{kind:this.kind}}constructor(t=null){Object.defineProperty(this,"detail",{get:()=>t}),Object.defineProperty(this,"subscriptions",{value:new Set})}get configs(){let{window:{webqit:{oohtml:{configs:t}}}}=H;return t}get name(){return[H.window.Document,H.window.ShadowRoot].some(t=>this.host instanceof t)?1/0:this.host.getAttribute(this.configs.CONTEXT_API.attr.contextname)}subscribed(t){}handle(t){}unsubscribed(t){}matchEvent(t){return t.kind===this.constructor.kind&&(!t.targetContext||t.targetContext===this.name)}handleEvent(t){if(!(this.disposed||typeof t.respondWith!="function")){if(t.type==="contextclaim"){if(!(t.detail instanceof dr)||t.target===this.host)return;let i=new Set;if(this.subscriptions.forEach(r=>{!t.target.contains(r.target)||!t.detail.matchEvent(r)||(this.subscriptions.delete(r),this.unsubscribed(r),i.add(r))}),i.size)return t.respondWith(i)}if(t.type==="contextrequest")return this.matchEvent(t)?(t.live&&(this.subscriptions.add(t),this.subscribed(t),t.signal?.addEventListener("abort",()=>{this.subscriptions.delete(t),this.unsubscribed(t)})),t.stopPropagation(),this.handle(t)):void 0}}initialize(t){this.host=t,this.disposed=!1,t.addEventListener("contextrequest",this),t.addEventListener("contextclaim",this);let{value:i}=Ft.instance(t).request("contextclaim",{kind:this.constructor.kind,detail:this});return i?.forEach(r=>{this.subscriptions.add(r),this.subscribed(r),this.handle(r)}),this}dispose(t){return this.disposed=!0,t.removeEventListener("contextrequest",this),t.removeEventListener("contextclaim",this),this.subscriptions.forEach(i=>{this.subscriptions.delete(i),this.unsubscribed(i);let{target:r}=i;i.meta.answered=!1,r.dispatchEvent(i)}),this}},nt=dr;G(nt,"kind");var ye=class extends nt{static createRequest(t=null){let i=super.createRequest();if(t?.startsWith("@")){let[r,...s]=s.slice(1).split("/").map(n=>n.trim());i.targetContext=r,i.detail=s.join("/")}else i.detail=t;return i}get namespaceObj(){return this.host[this.configs.NAMESPACED_HTML.api.namespace]}handle(t){let{window:{webqit:{Observer:i}}}=H;if(t.meta.controller?.abort(),!(t.detail||"").trim())return t.respondWith(i.unproxy(this.namespaceObj));let r=(t.detail||"").split("/").map(s=>s.trim()).filter(s=>s);if(!r.length)return t.respondWith();r=r.join(`/${this.configs.NAMESPACED_HTML.api.namespace}/`)?.split("/")||[],t.meta.controller=i.reduce(this.namespaceObj,r,i.get,s=>{this.disposed||t.respondWith(s.value)},{live:t.live,signal:t.signal,descripted:!0})}unsubscribed(t){t.meta.controller?.abort()}};G(ye,"kind","namespace");function mr(e={}){let{config:t,window:i}=st.call(this,"namespaced-html",e,{attr:{namespace:"namespace",lid:"id"},api:{namespace:"namespace"},tokens:{lidrefPrefix:"~",lidrefSeparator:":"},target:{className:":target",eventName:":target",scrolling:!0}});t.lidSelector=`[${i.CSS.escape(t.attr.lid)}]`,t.namespaceSelector=`[${i.CSS.escape(t.attr.namespace)}]`,i.webqit.DOMNamingContext=ye,$a.call(i,t),La.call(i,t)}function Js(e){let{lidrefPrefix:t,lidrefSeparator:i}=e.tokens;return{escape(r,s=1){return[...r].map(n=>/\w/.test(n)?n:s===2?`\\\\${n}`:`\\${n}`).join("")},lidrefPrefix(r=0){return r?this.escape(t,r):t},lidrefSeparator(r=0){return r?this.escape(i,r):i},isUuid(r,s=0){return r.startsWith(this.lidrefPrefix(s))&&r.includes(this.lidrefSeparator(s))},toUuid(r,s,n=0){return r.endsWith("-root")?s:`${this.lidrefPrefix(n)}${r}${this.lidrefSeparator(n)}${s}`},uuidToId(r,s=0){return this.isUuid(r)?r.split(this.lidrefSeparator(s))[1]:r},uuidToLidref(r,s=0){return this.isUuid(r)?`${this.lidrefPrefix(s)}${r.split(this.lidrefSeparator(s))[1]}`:r}}}function gr(e,t,i=null,r=0){let s=this,{webqit:{oohtml:{configs:{NAMESPACED_HTML:n}}}}=s,a=Js(n),o=new RegExp(`${i?":scope|":""}#(${a.lidrefPrefix(r+1)})?([\\w]+${a.lidrefSeparator(r+1)})?((?:[\\w-]|\\\\.)+)`,"g"),[u,c]=$t(e,",").reduce(([f,p],m)=>{let g,v;return m=m.replace(o,(E,y,w,C,b)=>{if(g||(g=[...m.matchAll(/(["'])(?:(?=(\\?))\2.)*?\1/g)]),g.some(O=>b>O.index&&b+E.length<O.index+O[0].length))return E;if(E===":scope")return v=!0,i;let x=y&&!w;if(y&&w)return`#${a.escape(E.replace("#",""),1)}`;if(x&&n.attr.lid==="id"&&t&&!t.endsWith("-root"))return`#${a.toUuid(t,C,1)}`;let S;return n.attr.lid==="id"?S=`:is(#${C},[id^="${a.lidrefPrefix(r)}"][id$="${a.lidrefSeparator(r)}${C}"])`:S=`:is(#${C},[${s.CSS.escape(n.attr.lid)}="${C}"])`,x?`:is(${S}):not(${i?i+" ":""}${n.namespaceSelector} *)`:S}),v?[f,p.concat(m)]:[f.concat(m),p]},[[],[]]),l;return i&&u.length?l=[u.length>1?`${i} :is(${u.join(", ")})`:`${i} ${u[0]}`,c.join(", ")].filter(f=>f).join(", "):l=[...u,...c].join(", "),l}function Si(e){let t=this;if(!A(e).has("namespace")){let i=Object.create(null);A(e).set("namespace",i);let r=[t.Document,t.ShadowRoot].some(s=>e instanceof s);Object.defineProperty(i,Symbol.toStringTag,{get(){return r?"RootNamespaceRegistry":"NamespaceRegistry"}})}return A(e).get("namespace")}function xe(e,t=!1){let i=this,{webqit:{oohtml:{configs:{NAMESPACED_HTML:r}}}}=i,s=[i.Document,i.ShadowRoot].some(n=>e instanceof n);return Si.call(i,s?e:(t?e.parentNode:e)?.closest?.(r.namespaceSelector)||e.getRootNode())}function _i(e){let t=Object.prototype.toString.call(e)==="[object RootNamespaceRegistry]";return(wi(e)||te(e))+(t?"-root":"")}function $a(e){let t=this,{webqit:{Observer:i}}=t;[t.Document.prototype,t.Element.prototype,t.ShadowRoot.prototype].forEach(r=>{let s=r===t.Document.prototype?"Document":r===t.ShadowRoot.prototype?"ShadowRoot":"Element";if(e.api.namespace in r)throw new Error(`The ${s} prototype already has a "${e.api.namespace}" API!`);Object.defineProperty(r,e.api.namespace,{get:function(){return i.proxy(Si.call(t,this))}})})}function La(e){let t=this,{webqit:{Observer:i,realdom:r,oohtml:{configs:s},DOMNamingContext:n}}=t,a=["aria-owns","aria-controls","aria-labelledby","aria-describedby","aria-flowto"],o=["for","list","form","aria-activedescendant","aria-details","aria-errormessage"],u=[e.attr.lid,...a,...o],c={id:"id",for:"htmlFor","aria-owns":"ariaOwns","aria-controls":"ariaControls","aria-labelledby":"ariaLabelledBy","aria-describedby":"ariaDescribedBy","aria-flowto":"ariaFlowto","aria-activedescendant":"ariaActiveDescendant","aria-details":"ariaDetails","aria-errormessage":"ariaErrorMessage"},l=Js(e),f=(x,_,S)=>{if(!pr(x,_)&&A(x,"attrOriginals").has(_))return A(x,"attrOriginals").get(_);let O=S();return pr(x,_)?O:O&&O.split(" ").map(P=>(P=P.trim())&&(_===e.attr.lid?l.uuidToId:l.uuidToLidref).call(l,P)).join(" ")},p=Object.getOwnPropertyDescriptor(t.Document.prototype,"getElementById");Object.defineProperty(t.Document.prototype,"getElementById",{...p,value(x){return this.querySelector(`#${x}`)}});for(let x of["querySelector","querySelectorAll"])for(nodeApi of[t.Document,t.Element]){let _=Object.getOwnPropertyDescriptor(nodeApi.prototype,x);Object.defineProperty(nodeApi.prototype,x,{..._,value(S){return _.value.call(this,gr.call(t,S,_i(Si.call(t,this))))}})}let m=Object.getOwnPropertyDescriptor(t.Element.prototype,"getAttribute");Object.defineProperty(t.Element.prototype,"getAttribute",{...m,value(x){let _=()=>m.value.call(this,x);return u.includes(x)&&!A(this,"lock").get(x)?f(this,x,_):_()}});let g=Object.getOwnPropertyDescriptor(t.Attr.prototype,"value");Object.defineProperty(t.Attr.prototype,"value",{...g,get(){let x=()=>g.get.call(this);return u.includes(this.name)?f(this.ownerElement,this.name,x):x()}});let v=Object.getOwnPropertyDescriptor(t.Node.prototype,"nodeValue");Object.defineProperty(t.Node.prototype,"nodeValue",{...v,get(){let x=()=>v.get.call(this);return this instanceof t.Attr&&u.includes(this.name)?f(this.ownerElement,this.name,x):x()}});for(let x of u){if(!(x in c))continue;let _=x==="for"?[t.HTMLLabelElement,t.HTMLOutputElement]:[t.Element];for(let S of _){let O=Object.getOwnPropertyDescriptor(S.prototype,c[x]);!O||Object.defineProperty(S.prototype,c[x],{...O,get(){return f(this,x,()=>O.get.call(this,x))}})}}e.attr.lid!=="id"&&Object.defineProperty(t.Element.prototype,e.attr.lid,{configurable:!0,enumerable:!0,get(){return this.getAttribute(e.attr.lid)},set(x){return this.setAttribute(e.attr.lid,x)}});let E=(x,_,S,O)=>Ys(x,_,()=>(typeof S=="function"&&(S=S()),O(S))),y=(x,_,S,O=null)=>{E(x,_,S,P=>{let D=_===e.attr.lid,U=O||xe.call(t,x,D),Q=_i(U);if(D){let X=l.uuidToId(P);if(i.get(U,X)!==x){let Y=l.toUuid(Q,X);Y!==P&&x.setAttribute("id",Y),i.set(U,X,x)}}else{A(x,"attrOriginals").set(_,P);let X=P.split(" ").map(Y=>(Y=Y.trim())&&l.isUuid(Y)?Y:l.toUuid(Q,Y)).join(" ");x.setAttribute(_,X),A(U).set("idrefs",A(U).get("idrefs")||new Set),A(U).get("idrefs").add(x)}})},w=(x,_,S,O=null)=>{E(x,_,S,P=>{let D=_===e.attr.lid,U=O||xe.call(t,x,D);if(D){let Q=l.uuidToId(P);i.get(U,Q)===x&&i.deleteProperty(U,Q)}else{let Q=A(x,"attrOriginals").get(_);x.hasAttribute(_)&&x.setAttribute(_,Q),A(U).get("idrefs")?.delete(x)}})};r.realtime(t.document).query(e.namespaceSelector,x=>{let _=(S,O,P,D)=>{if(!S.hasAttribute(O))return;let U=()=>S.getAttribute(O);w(S,O,U,P),S.isConnected&&y(S,O,A(S,"attrOriginals").get(O)||U,D)};x.exits.forEach(S=>{if(S.isConnected){let D=Si.call(t,S);for(let U of new Set([...Object.values(D),...A(D).get("idrefs")||[]]))for(let Q of u)_(U,Q,D)}let O=S[s.CONTEXT_API.api.contexts],P=O.find(n.kind);P&&O.detach(P)}),x.entrants.forEach(S=>{let O,P=xe.call(t,S,!0);for(let U of new Set([...Object.values(P),...A(P).get("idrefs")||[]]))if((O=xe.call(t,U,!0))!==P)for(let Q of u)_(U,Q,P,O);let D=S[s.CONTEXT_API.api.contexts];D.find(n.kind)||D.attach(new n)})},{id:"namespace-html:namespace",live:!0,subtree:"cross-roots",timing:"sync",staticSensitivity:!0,eventDetails:!0}),r.realtime(t.document).query(`[${u.map(x=>t.CSS.escape(x)).join("],[")}]`,x=>{let _={forID:new Map,forOther:new Map};for(let S of u){let O=S===e.attr.lid?_.forID:_.forOther;x.exits.forEach(P=>{if(!P.hasAttribute(S))return;let D=O.get(P);typeof D>"u"&&(D=(S===e.attr.lid?P.parentNode:P)?.closest?.(e.namespaceSelector)||P.getRootNode().host,O.set(P,D)),!(D&&!D.isConnected)&&w(P,S,()=>P.getAttribute(S))}),x.entrants.forEach(P=>{!P.hasAttribute(S)||y(P,S,()=>P.getAttribute(S))})}_.forID.clear(),_.forOther.clear()},{id:"namespace-html:attrs",live:!0,subtree:"cross-roots",timing:"sync"}),r.realtime(t.document,"attr").observe(u,x=>{for(let _ of x)_.oldValue&&w(_.target,_.name,_.oldValue),_.value&&y(_.target,_.name,_.value)},{id:"namespace-html:attr(attrs)",subtree:"cross-roots",timing:"sync",newValue:!0,oldValue:!0});let C,b=()=>{if(!t.location.hash?.startsWith(`#${l.lidrefPrefix()}`))return;let x=t.location.hash?.substring(`#${l.lidrefPrefix()}`.length).split("/").map(S=>S.trim()).filter(S=>S)||[],_=x.reduce((S,O)=>S&&S[e.api.namespace][O],t.document);C&&e.target.className&&C.classList.toggle(e.target.className,!1),_&&_!==t.document&&(e.target.className&&_.classList.toggle(e.target.className,!0),e.target.eventName&&_.dispatchEvent(new t.CustomEvent(e.target.eventName)),e.target.scrolling&&x.length>1&&_.scrollIntoView(),C=_)};t.addEventListener("hashchange",b),r.ready(b)}function yr({advanced:e={},...t}){let{config:i,window:r}=st.call(this,"scoped-js",t,{script:{retention:"retain",mimeTypes:"module|text/javascript|application/javascript",timing:"auto"},api:{scripts:"scripts"},advanced:de(e)}),s=Array.isArray(i.script.mimeTypes)?i.script.mimeTypes:i.script.mimeTypes.split("|").filter(n=>n);i.scriptSelector=s.map(n=>`script[type="${r.CSS.escape(n)}"]:not([oohtmlignore])`).concat("script:not([type])").join(","),r.webqit.oohtml.Script={compileCache:[new Map,new Map],execute:Ma.bind(r,i)},Ra.call(r,i),Da.call(r,i)}function Ra(e){let t=this,i=new Map;if(e.api.scripts in t.Element.prototype)throw new Error(`The "Element" class already has a "${e.api.scripts}" property!`);[t.ShadowRoot.prototype,t.Element.prototype].forEach(r=>{Object.defineProperty(r,e.api.scripts,{get:function(){return i.has(this)||i.set(this,[]),i.get(this)}})}),Object.defineProperties(t.HTMLScriptElement.prototype,{scoped:{configurable:!0,get(){return this.hasAttribute("scoped")},set(r){this.toggleAttribute("scoped",r)}},quantum:{configurable:!0,get(){return this.hasAttribute("quantum")},set(r){this.toggleAttribute("quantum",r)}}})}async function Ma(e,t){let i=this,{realdom:r}=i.webqit,s=wi(t);if(!s)throw new Error("Argument must be a valid exec hash.");let{script:n,compiledScript:a,thisContext:o}=s;e.script.retention==="dispose"?n.remove():e.script.retention==="hidden"?n.textContent='"source hidden"':n.textContent=await a.toString();let u=n.scoped?o:n.getRootNode();A(u).has("scriptEnv")||A(u).set("scriptEnv",Object.create(null));let c=await(await a.bind(o,A(u).get("scriptEnv"))).execute();n.quantum&&Object.defineProperty(n,"state",{value:c}),r.realtime(i.document).observe(n,()=>{n.quantum&&c.dispose(),o instanceof i.Element&&o[e.api.scripts]?.splice(o[e.api.scripts].indexOf(n,1))},{id:"scoped-js:script-exits",subtree:"cross-roots",timing:"sync",generation:"exits"})}function Da(e){let t=this,{webqit:{oohtml:i,realdom:r}}=t;t.HTMLScriptElement.supports||(t.HTMLScriptElement.supports=n=>["text/javascript","application/javascript"].includes(n));let s=new WeakSet;r.realtime(t.document).query(e.scriptSelector,n=>{n.entrants.forEach(a=>{if(s.has(a))return;let o=Zs.call(t,e,a);if(!o)return;s.add(a);let u=a.scoped?a.parentNode||n.target:a.type==="module"?void 0:t;a.scoped&&u[e.api.scripts].push(a);let c=te({script:a,compiledScript:o,thisContext:u});n.type==="query"||a.type&&!t.HTMLScriptElement.supports(a.type)||a.getAttribute("data-handling")==="manual"||e.script.timing==="manual"?i.Script.execute(c):a.textContent=`webqit.oohtml.Script.execute( '${c}' );`})},{id:"scoped-js:script-entries",live:!0,subtree:"cross-roots",timing:"intercept",generation:"entrants",eventDetails:!0})}function Zs(e,t){let i=this,{webqit:{oohtml:r,QuantumScript:s,AsyncQuantumScript:n,QuantumModule:a}}=i,o=(t._=t.textContent.trim())&&t._.startsWith("/*@oohtml*/if(false){")&&t._.endsWith("}/*@oohtml*/")?t._.slice(21,-12):t.textContent;if(!o.trim().length)return;let u=te(o),c=r.Script.compileCache[t.quantum?0:1],l;if(!(l=c.get(u))){let{parserParams:f,compilerParams:p,runtimeParams:m}=e.advanced;l=new(t.type==="module"?a:s||n)(o,{exportNamespace:`#${t.id}`,fileName:`${i.document.url?.split("#")?.[0]||""}#${t.id}`,parserParams:{...f,executionMode:t.quantum&&"QuantumProgram"||"RegularProgram"},compilerParams:p,runtimeParams:m}),c.set(u,l)}return l}function tn(e){let t=this,{webqit:{oohtml:{configs:{SCOPED_JS:i}}}}=t;[...e?.querySelectorAll(i.scriptSelector)||[]].forEach(r=>{Zs.call(t,i,r)})}function wr(e={}){let{config:t,window:i}=st.call(this,"data-binding",e,{attr:{render:"render",itemIndex:"data-key"},tokens:{nodeType:"processing-instruction",tagStart:"?{",tagEnd:"}?",stateStart:"; [=",stateEnd:"]"},advanced:de({runtimeParams:{spec:{handler:s=>{}}}})});({CONTEXT_API:t.CONTEXT_API,BINDINGS_API:t.BINDINGS_API,HTML_IMPORTS:t.HTML_IMPORTS}=i.webqit.oohtml.configs),t.attrSelector=`[${i.CSS.escape(t.attr.render)}]`;let r=(s,n)=>{let a=`starts-with(., "${s}")`,o=`substring(., string-length(.) - string-length("${n}") + 1) = "${n}"`;return`${a} and ${o}`};t.discreteBindingsSelector=`comment()[${r(t.tokens.tagStart,t.tokens.tagEnd)}]`,Va.call(i,t)}function Va(e){let t=this,{webqit:{realdom:i}}=t;i.realtime(t.document).query(e.attrSelector,r=>{en.call(this,...r.exits),setTimeout(()=>{qa.call(t,e,...r.entrants)},0)},{id:"data-binding:attr",live:!0,subtree:"cross-roots",timing:"sync",eventDetails:!0,staticSensitivity:!0}),i.realtime(t.document).query(`(${e.discreteBindingsSelector})`,r=>{setTimeout(()=>{en.call(this,...r.exits),Fa.call(t,e,...r.entrants)},0)},{id:"data-binding:descrete",live:!0,subtree:"cross-roots",timing:"sync"})}function rn(e,t){let{webqit:{realdom:i,Observer:r,DOMBindingsContext:s}}=this;if(A(t).has("data-binding"))return A(t).get("data-binding");let n=Object.create(null),a=new AbortController;n.$exec__=(u,c,...l)=>{(()=>{try{u[c](...l)}catch(p){throw new Error(`Error executing "${c}()": ${p.message} at ${p.cause}`)}})()},n.$assign__=(u,c,l)=>{(()=>{try{u[c]=l}catch(p){throw new Error(`Error executing "${c} = ${l}": ${p.message} at ${p.cause}`)}})()},r.intercept(n,{get:(u,c,l)=>{if(!(u.key in n)){let f={...s.createRequest(u.key),live:!0,signal:a.signal};t[e.CONTEXT_API.api.contexts].request(f,p=>{r.set(n,u.key,p)})}return l(n[u.key]??(u.key in globalThis?globalThis[u.key]:void 0))},has:(u,c,l)=>l(!0)});let o={scope:n,abortController:a,bindings:new Map};return A(t).set("data-binding",o),o}function en(...e){for(let t of e){let i=t.nodeName==="#text"?t.parentNode:t,{bindings:r,abortController:s}=A(i).get("data-binding")||{};if(!r?.has(t))return;r.get(t).state.dispose(),r.get(t).signals?.forEach(n=>n.abort()),r.delete(t),r.size||(s.abort(),A(i).delete("data-binding"))}}function sn(e,t){let i=e.tokens.tagStart.split("").map(c=>`\\${c}`).join(""),r=e.tokens.tagEnd.split("").map(c=>`\\${c}`).join(""),s=e.tokens.stateStart.split("").map(c=>c===" "?"(?:\\s+)?":`\\${c}`).join(""),n=e.tokens.stateEnd.split("").map(c=>`\\${c}`).join(""),a=`^${i}(.*?)(?:${s}(\\d+)${n}(?:\\s+)?)?${r}$`,[,o,u]=t.match(new RegExp(a));return{raw:t,expr:o,span:parseInt(u??0)}}async function Fa(e,...t){let i=this,r=t.reduce((s,n)=>{if(n.isBound)return s;let a=sn(e,n.nodeValue),o=n;if(a.span){if(o=n.nextSibling,o?.nodeName!=="#text"||o.nodeValue.length<a.span)return s;o.nodeValue.length>a.span&&o.splitText(a.span)}else o=n.ownerDocument.createTextNode(""),n.after(o);o.isBound=!0;let u=n;return i.webqit.env!=="server"&&(u.remove(),u=null),s.concat({textNode:o,template:a,anchorNode:u})},[]);for(let{textNode:s,template:n,anchorNode:a}of r){let o=nn.call(i,e,n.expr),{scope:u,bindings:c}=rn.call(this,e,s.parentNode);Object.defineProperty(s,"$oohtml_internal_databinding_anchorNode",{value:a,configurable:!0});try{c.set(s,{state:await(await o.bind(s,u)).execute()})}catch(l){console.log(l)}}}var xr=new Map;function nn(e,t){if(xr.has(t))return xr.get(t);let i=`let content = ((${t}) ?? '') + '';`;i+="$assign__(this, 'nodeValue', content);",i+=`if ( this.$oohtml_internal_databinding_anchorNode ) { $assign__(this.$oohtml_internal_databinding_anchorNode, 'nodeValue', "${e.tokens.tagStart}${be(t)}${e.tokens.stateStart}" + content.length + "${e.tokens.stateEnd} ${e.tokens.tagEnd}"); }`;let{webqit:{QuantumModule:r}}=this,{parserParams:s,compilerParams:n,runtimeParams:a}=e.advanced,o=new r(i,{parserParams:s,compilerParams:n,runtimeParams:a});return xr.set(t,o),o}async function qa(e,...t){for(let i of t){let r=an.call(this,e,i.getAttribute(e.attr.render)),{scope:s,bindings:n}=rn.call(this,e,i),a=[];Object.defineProperty(i,"$oohtml_internal_databinding_signals",{value:a,configurable:!0});try{n.set(i,{signals:a,state:await(await r.bind(i,s)).execute()})}catch(o){console.log(o)}}}var br=new Map;function an(e,t){if(br.has(t))return br.get(t);let i={},r=-1,s=$t(t,";").map(l=>{let[f,p]=$t(l,":").map(y=>y.trim()),m=f[0],g=f.slice(1).trim(),v=`(${p})`,E=`(${v} ?? '')`;if(m==="&")return g.startsWith("--")?`$exec__(this.style, 'setProperty', "${be(g)}", ${E});`:`$assign__(this.style, "${be(g)}", ${E});`;if(m==="%")return`$exec__(this.classList, 'toggle', "${be(g)}", !!${v});`;if(m==="~")return g.startsWith("?")?`$exec__(this, 'toggleAttribute', "${be(g.substring(1).trim())}", !!${v});`:`$exec__(this, 'setAttribute', "${be(g)}", ${E});`;if(m==="#"){if(i[g])throw new Error(`Duplicate binding: ${f}.`);if(i[g]=!0,g==="text")return`$assign__(this, 'textContent', ${E});`;if(g==="html")return`$assign__(this, 'innerHTML', ${E});`;if(g==="items"){let[y,w]=$t(p,"/");if(!w)throw new Error(`Invalid ${m}items spec: ${l}; no import specifier.`);let[C,b,x,_]=y.trim().match(/(.*?[\)\s+])(of|in)([\(\{\[\s+].*)/i)||[];if(!C)throw new Error(`Invalid ${m}items spec: ${l}.`);if(b.startsWith("(")?b=b.trim().slice(1,-1).split(",").map(O=>O.trim()):b=[b],b.length>(x==="in"?3:2))throw new Error(`Invalid ${m}items spec: ${l}.`);let S=x==="in"?b[2]:b[1]||"$index__";return`
15
+ }`,u.executionMode="RegularProgram"}else if(!["script","async-script"].includes(e))throw new Error(`Unrecognized sourceType specified: "${e}".`);c.sourceType=e,u.inBrowser=f,c.base64=p&&f&&"export default async function(%0) {%1}";let m=t(i,{parserParams:u,compilerParams:c});if(m instanceof Promise&&!["async-function","async-script","module"].includes(e))throw new Error("Parse-compile can only return a Promise for sourceTypes: async-function, async-script, module.");return l.sourceType=e,l.inBrowser=f,l.exportNamespace=a,l.fileName=o,at(m,g=>{let v=["function","async-function"].includes(e);return at(((y,w)=>{if(l.compileFunction)return l.compileFunction(w.toString(),[y]);if(c.base64){let C=`data:text/javascript;base64,${w.toString("base64")}`;return(()=>import(C).then(x=>x.default))()}return new(p?async function(){}.constructor:Function)(y,w.toString())})(g.identifier+"",g),y=>{let w=(C,b=s)=>{let x=y;C&&(x=x.bind(C));let _="global",S=new it(void 0,_,globalThis);return(e.endsWith("script")||b)&&(_="env",S=new it(S,_,b)),e==="module"&&(_="module",S=new it(S,_)),typeof C<"u"&&(S=new it(S,"this",{this:C})),new Yt(void 0,_,{...l,originalSource:g.originalSource,executionMode:g.isQuantumProgram&&"QuantumProgram"||"RegularProgram"},S,x)};return v?w().execute():{createRuntime:w,compilation:g}})})}var Jt=class{constructor(...t){let i=this.constructor,r=typeof t[t.length-1]=="object"?t.pop():{},s=t.pop()||"";this.$program=Ue(i.sourceType,i.parseCompileCallback,s,r)}execute(){return at(this.$program,({createRuntime:t})=>t().execute())}bind(t,i=void 0){return at(this.$program,({createRuntime:r})=>r(t,i))}toString(t=!1){return at(this.$program,({compilation:i})=>t?i+"":i.originalSource)}};function ba(...e){let{source:t,params:i}=Ui(e);return Ue("function",Qe,t,i)}function Ms(...e){let{source:t,params:i}=Ui(e);return Ue("async-function",Qe,t,i)}var wa=Ms,We=class extends Jt{};G(We,"sourceType","script"),G(We,"parseCompileCallback",Qe);var me=class extends Jt{};G(me,"sourceType","async-script"),G(me,"parseCompileCallback",Qe);var va=me,ze=class extends Jt{};G(ze,"sourceType","module"),G(ze,"parseCompileCallback",Qe);function Qe(e,t){let i=Ls(e,t.parserParams);return Rs(i,t.compilerParams)}function Ge(e,t,i={},r={}){t=W(t).slice();for(var s=e;!kt(s)&&!Ee(s)&&t.length;){var n=t.shift();if(!(i.get?i.get(s,n):q(s)?n in s:s[n])){r.exists=!1;return}s=i.get?i.get(s,n):s[n]}return r.exists=!0,s}function ur(e,t,i,r={},s={}){let n=(l,f,p)=>s.set?s.set(l,f,p):(ut(t[o])&&L(l)?l.push(p):l[f]=p,!0);t=W(t);for(var a=e,o=0;o<t.length;o++)if(o<t.length-1){if(!a||!q(a)&&!F(a))return!1;var u=Ge(a,t[o],s);if(!q(u)){if(s.buildTree===!1)return!1;u=F(s.buildTree)?s.buildTree(o):ut(t[o+1])?[]:{};var c=n(a,t[o],u);if(!c)return!1}a=u}else return n(a,t[o],i)}var Ke=class{constructor(t,i=!1){Object.defineProperty(this,"window",{value:t}),Object.defineProperty(this,"readCallbacks",{value:new Set}),Object.defineProperty(this,"writeCallbacks",{value:new Set}),Object.defineProperty(this,"_synthesis",{value:0,writable:!0}),!i&&this.window.requestAnimationFrame?this._loop():this._synthesis++}get synthesis(){return this._synthesis}async synthesizeWhile(t){this._synthesis++,this._fulfill();let i=await t();return this._synthesis--,i}_fulfill(){for(let t of this.readCallbacks)t(),this.readCallbacks.delete(t);for(let t of this.writeCallbacks)t(),this.writeCallbacks.delete(t)}_loop(){this.window.requestAnimationFrame(()=>{this._fulfill(),this._loop()})}onread(t,i=!1){if(i)return new Promise(r=>{this.synthesis?r(t()):this.readCallbacks.add(()=>{r(t())})});this.synthesis?Promise.resolve().then(t):this.readCallbacks.add(t)}onwrite(t,i=!1){if(i)return new Promise(r=>{this.synthesis?r(t()):this.writeCallbacks.add(()=>{r(t())})});this.synthesis?Promise.resolve().then(t):this.writeCallbacks.add(t)}cycle(t,i,r){this.onread(()=>{let s=t(r),n=a=>{a!==void 0&&this.onwrite(()=>{let o=i(a,r),u=c=>{c!==void 0&&this.cycle(t,i,c)};o instanceof Promise?o.then(u):u(o)})};s instanceof Promise?s.then(n):n(s)})}};function Ds(e){return(e=e.trim())&&e.startsWith("(")&&e.endsWith(")")}function ge(e,t,i,r=!0){i=(Array.isArray(i)?i:[i]).map(a=>(a+"").replace("(",r?"(.//":"(./")).join("|");let s=[],n;try{let a=e.document.evaluate(i,t,null,e.XPathResult.ANY_TYPE);for(;n=a.iterateNext();)s.push(n)}catch{}return s}function Vs(e,t,i){i=(Array.isArray(i)?i:[i]).map(r=>(r+"").replace("(","(self::")).join("|");try{return e.document.evaluate(`${i}`,t,null,e.XPathResult.BOOLEAN_TYPE).booleanValue}catch{}}function Xe(e,t,i,r=!1,s=null){let n=s?.get(t)?.get(i);if(typeof n<"u")return n;let a=c=>(s?.has(t)||s?.set(t,new WeakMap),s?.get(t)?.set(i,c),c),o=t.getRootNode(),u=i.getRootNode();return o===u?a(t.contains(i)):r&&u instanceof e.ShadowRoot?a(Xe(e,t,u.host,r,s)):a(!1)}function Fs(e,t="|"){return[...e].reduce(([i,r,s,n],a)=>!i&&r===0&&(Array.isArray(t)?t:[t]).includes(a)?[i,r,[""].concat(s)]:(!i&&["(","[","{"].includes(a)&&!s[0].endsWith("\\")&&r++,!i&&[")","]","}"].includes(a)&&!s[0].endsWith("\\")&&r--,['"',"'","`"].includes(a)&&!s[0].endsWith("\\")&&(i=i===a?null:i||a),s[0]+=a,[i,r,s]),[null,0,[""]])[2].reverse()}var pt=class{constructor(t){this.content=t,this.type=typeof t=="string"?"selector":"instance",this.kind=this.type==="instance"?null:Ds(t)?"xpath":"css",this.kind==="xpath"&&(this.isXpathAttr=Fs(t.trim().slice(1,-1),"@").length>1)}toString(){return this.content}};var Zt=class{constructor(t,i,r){this.context=t,this.namespace=i,this.window=t.defaultView||t.ownerDocument?.defaultView||r,this.document=this.window.document,this.webqit=this.window.webqit,Object.defineProperty(this,"#",{value:{}})}resolveArgs(t){if(F(t[0])?t=[[],...t]:V(t[0])&&!(t[0]instanceof pt)&&t.length===1?t=[[],void 0,t[0]]:V(t[1])&&t.length===2?t=[W(t[0],!1),void 0,t[1]]:t[0]=W(t[0],!1),t[0].filter(i=>typeof i!="string"&&!(i instanceof pt)&&!(i instanceof this.window.Node)).length)throw new Error("Argument #2 must be either a string or a Node object, or a list of those.");return t[0]=t[0].map(i=>i instanceof pt?i:new pt(i)),t}registry(...t){return K("realdom.realtime",this.window,this.namespace,...t)}createSignalGenerator(){return{generate(){return this.lastController?.abort(),this.lastController=new AbortController,{signal:this.lastController.signal}},disconnect(){this.lastController?.abort()}}}forEachMatchingContext(t,i,r){let{window:s}=this,n=new Set,a=new WeakMap;for(let[o,u]of this.registry(t)){let c=[].concat(i).filter(f=>Xe(s,o.context,f.target,o.params.subtree==="cross-roots",a));if(!c.length)continue;let l=[o,Array.isArray(i)?c:c[0]];u?n.add(l):r.call(s,...l)}for(let o of n)r.call(s,...o);n.clear()}disconnectables(t,...i){let r={disconnect(){i.forEach(s=>s&&F(s.disconnect)&&s.disconnect()||F(s)&&s()||V(s)&&(s.disconnected=!0))}};return t&&t.addEventListener("abort",()=>r.disconnect()),r}};var Vt=class extends Zt{type="attr";constructor(t,...i){super(t,"attr",...i)}get(t,i=void 0,r={}){let s=typeof t=="string"||t instanceof pt;[t=[],i=void 0,r={}]=this.resolveArgs(arguments);let{context:n}=this,a=Hs(n,t);if(!i)return a;let o=r.lifecycleSignals&&this.createSignalGenerator();if(s)for(let u of a){let c=o?o.generate():{};i(u,c,n)}else{let u=o?.generate()||{};i(a,u,n)}if(r.live){o&&(r={...r,signalGenerator:o});let u=this.observe(s?t[0]:t,i,{newValue:!0,...r});return this.disconnectables(r.signal,u)}}observe(t,i,r={}){let s=typeof t=="string"||t instanceof pt;if([t=[],i,r={}]=this.resolveArgs(arguments),["sync","intercept"].includes(r.timing))return this.observeSync(s?t[0]:t,i,r);if(r.timing&&r.timing!=="async")throw new Error(`Timing option "${r.timing}" invalid.`);let{context:n,window:a,webqit:o}=this;r.eventDetails&&!o.realdom.attrInterceptionHooks?.intercepting&&js.call(a,"intercept",()=>{});let u=new a.MutationObserver(p=>{p=Bs(p).map(m=>Us.call(a,m)),qs.call(a,f,p,n)}),c={attributes:!0,attributeOldValue:r.oldValue,subtree:r.subtree&&!0};t.length&&(c.attributeFilter=t.map(p=>p+"")),u.observe(n,c);let l=r.signalGenerator||r.lifecycleSignals&&this.createSignalGenerator(),f={context:n,spec:t,callback:i,params:r,atomics:new Map,originalFilterIsString:s,signalGenerator:l,disconnectable:u};return this.disconnectables(r.signal,u,l)}observeSync(t,i,r={}){let s=typeof t=="string"||t instanceof pt;[t,i,r={}]=this.resolveArgs(arguments);let{context:n,window:a}=this;if(r.timing&&!["sync","intercept"].includes(r.timing))throw new Error(`Timing option "${r.timing}" invalid.`);let o=r.timing==="intercept"?"intercept":"sync";this.registry(o).size||js.call(a,o,p=>{this.forEachMatchingContext(o,p,qs)});let u={disconnect(){f.delete(l)}},c=r.signalGenerator||r.lifecycleSignals&&this.createSignalGenerator(),l={context:n,spec:t,callback:i,params:r,atomics:new Map,originalFilterIsString:s,signalGenerator:c,disconnectable:u},f=this.registry(o);return f.set(l,!!l.params.deferred),this.disconnectables(r.signal,u,c)}};function Bs(e){return e.reduce((t,i,r)=>t[r-1]?.attributeName===i.attributeName||K(i.target,"internalAttrInteractions").get(i.attributeName)?t:t.concat(i),[])}function qs(e,t){let{context:i,spec:r,callback:s,params:n,atomics:a,originalFilterIsString:o,signalGenerator:u}=e;if(n.subtree||(t=t.filter(p=>p.target===i)),!t.length)return;let c=r.map(p=>p+"");if(n.atomic&&!a.size?t=Hs(i,r,t):n.timing!=="async"&&r.length&&(t=t.filter(p=>c.includes(p.name))),!t.length)return;n.newValue===null&&n.oldValue===null&&n.eventDetails||(t=t.map(p=>{let m;return n.eventDetails||({event:m,...p}=p),!n.oldValue&&"oldValue"in p&&({oldValue:m,...p}=p),!n.newValue&&"value"in p?{value:m,...p}=p:n.newValue&&typeof p.value>"u"&&(p={...p,value:xi(p.target,p.name,()=>p.target.getAttribute(p.name))}),p})),n.atomic&&(t.forEach(p=>a.set(p.name,p)),t=Array.from(a.entries()).map(([,p])=>p));let l=o?t[0]:t,f=u?u.generate():{};s(l,f,i)}function xi(e,t,i){let r=K(e,"internalAttrInteractions").get(t);K(e,"internalAttrInteractions").set(t,!0);let s=i();return K(e,"internalAttrInteractions").set(t,r),s}function Hs(e,t,i=[]){let r={event:null,type:"attribute"};return t.length?t.map(n=>(n=n+"",i.find(a=>a.name===n)||{target:e,name:n,value:xi(e,n,()=>e.getAttribute(n)),...r})):Array.from(e.attributes).map(n=>i.find(a=>a.name===n.nodeName)||{target:e,name:n.nodeName,value:xi(e,n.nodeName,()=>n.nodeValue),...r})}function Us({target:e,attributeName:t,value:i,oldValue:r}){let a=(this.webqit.realdom.attrInterceptionRecords?.get(e)||{})[t]?.[0]||"mutation";return{target:e,name:t,value:i,oldValue:r,type:"observation",event:a}}function js(e,t){let i=this,{webqit:r,document:s,Element:n}=i;r.realdom.attrInterceptionHooks||Object.defineProperty(r.realdom,"attrInterceptionHooks",{value:new Map}),r.realdom.attrInterceptionHooks.has(e)||r.realdom.attrInterceptionHooks.set(e,new Set),r.realdom.attrInterceptionHooks.get(e).add(t);let a=()=>r.realdom.attrInterceptionHooks.get(e).delete(t);if(r.realdom.attrInterceptionHooks?.intercepting)return a;console.warn("Attr mutation APIs are now being intercepted."),r.realdom.attrInterceptionHooks.intercepting=!0,Object.defineProperty(r.realdom,"attrInterceptionRecords",{value:new Map});let o=(l,f)=>{r.realdom.attrInterceptionRecords.has(l.target)||r.realdom.attrInterceptionRecords.set(l.target,{});let p=r.realdom.attrInterceptionRecords.get(l.target);if(p[l.name]=p[l.name]||[],p[l.name].unshift(l.event),K(l.target,"internalAttrInteractions").get(l.name))return f();r.realdom.attrInterceptionHooks.get("intercept")?.forEach(g=>g([l]));let m=f();return r.realdom.attrInterceptionHooks.get("sync")?.forEach(g=>g([l])),m};new i.MutationObserver(l=>{l=l.filter(f=>!(i.webqit.realdom.attrInterceptionRecords?.get(f.target)||{})[f.attributeName]?.shift()),l=Bs(l).map(f=>Us.call(i,f)),l.length&&(r.realdom.attrInterceptionHooks.get("intercept")?.forEach(f=>f(l)),r.realdom.attrInterceptionHooks.get("sync")?.forEach(f=>f(l)))}).observe(s,{attributes:!0,subtree:!0,attributeOldValue:!0});let c=Object.create(null);return["setAttribute","removeAttribute","toggleAttribute"].forEach(l=>{c[l]=n.prototype[l],n.prototype[l]=function(...f){let p,m=xi(this,f[0],()=>this.getAttribute(f[0]));["setAttribute","toggleAttribute"].includes(l)&&(p=f[1]),l==="toggleAttribute"&&p===void 0&&(p=m===null);let g={target:this,name:f[0],value:p,oldValue:m,type:"interception",event:[this,l]};return o(g,()=>c[l].call(this,...f))}}),a}var Ye=class extends Zt{constructor(t,...i){super(t,"tree",...i)}attr(t,i=void 0,r={}){let{context:s,window:n}=this;return new Vt(s,n).get(...arguments)}query(t,i=void 0,r={}){[t,i=void 0,r={}]=this.resolveArgs(arguments);let{context:s}=this,n=new Map,a=c=>(n.has(c)||n.set(c,{target:c,entrants:[],exits:[],type:"query",event:null}),n.get(c));if(!r.generation||r.generation==="entrants"){if(!t.length)[...s.children].forEach(c=>a(s).entrants.push(c));else if(t.every(c=>c.type==="selector")){let[c,l]=t.reduce(([p,m],g)=>g.kind==="xpath"?[p,m.concat(g)]:[p.concat(g),m],[[],[]]),f=[];r.subtree?(c.length&&f.push(...s.querySelectorAll(c.join(","))),l.length&&f.push(...ge(this.window,s,l))):(c.length&&f.push(...[...s.children].filter(p=>p.matches(c))),l.length&&f.push(...ge(this.window,s,l,!1))),f.forEach(p=>a(p.parentNode||s).entrants.push(p))}}if(!i)return n;let o={disconnected:!1},u=i&&r.lifecycleSignals&&this.createSignalGenerator();for(let[,c]of n){if(o.disconnected)break;let l=u?.generate()||{};i(c,l,s)}if(r.live){u&&(r={...r,signalGenerator:u});let c=this.observe(t,i,r);return this.disconnectables(r.signal,o,c)}return this.disconnectables(r.signal,o,u)}children(t,i=void 0,r={}){return[t,i=void 0,r={}]=this.resolveArgs(arguments),this.query(t,i,{...r,subtree:!1})}subtree(t,i=void 0,r={}){return[t,i=void 0,r={}]=this.resolveArgs(arguments),this.query(t,i,{...r,subtree:!0})}observe(t,i,r={}){if([t,i,r={}]=this.resolveArgs(arguments),["sync","intercept"].includes(r.timing))return this.observeSync(t,i,r);if(r.timing&&r.timing!=="async")throw new Error(`Timing option "${r.timing}" invalid.`);let{context:s,window:n,webqit:a,document:o}=this;r.eventDetails&&(a.realdom.domInterceptionRecordsAlwaysOn=!0),(o.readyState==="loading"||a.realdom.domInterceptionRecordsAlwaysOn)&&!a.realdom.domInterceptionHooks?.intercepting&&Qs.call(n,"sync",()=>{});let u=new n.MutationObserver(f=>f.forEach(p=>{lr.call(n,l,zs.call(n,p),s)}));u.observe(s,{childList:!0,subtree:r.subtree&&!0});let c=r.signalGenerator||r.lifecycleSignals&&this.createSignalGenerator(),l={context:s,spec:t,callback:i,params:r,signalGenerator:c,disconnectable:u};if(r.staticSensitivity){let f=Ws.call(n,l);return this.disconnectables(r.signal,u,c,f)}return this.disconnectables(r.signal,u,c)}observeSync(t,i,r={}){[t,i,r={}]=this.resolveArgs(arguments);let{context:s,window:n}=this;if(r.timing&&!["sync","intercept"].includes(r.timing))throw new Error(`Timing option "${r.timing}" invalid.`);let a=r.timing==="intercept"?"intercept":"sync";this.registry(a).size||Qs.call(n,a,p=>{this.forEachMatchingContext(a,p,lr)});let o=new n.MutationObserver(p=>p.forEach(m=>{Array.isArray((m=zs.call(n,m)).event)||lr.call(n,l,m,s)}));o.observe(s,{childList:!0,subtree:r.subtree&&!0});let u={disconnect(){f.delete(l),o.disconnect()}},c=r.signalGenerator||r.lifecycleSignals&&this.createSignalGenerator(),l={context:s,spec:t,callback:i,params:r,signalGenerator:c,disconnectable:u},f=this.registry(a);if(f.set(l,!!l.params.deferred),r.staticSensitivity){let p=Ws.call(n,l);return this.disconnectables(r.signal,u,c,p)}return this.disconnectables(r.signal,u,c)}track(t,i,r={}){return r={subtree:!0,...r},this.observe(t,s=>{s.entrants.length&&i(!0,Array.isArray(t)?s.entrants:s.entrants[0]),s.exits.length&&i(!1,Array.isArray(t)?s.exits:s.exits[0])},r)}};function Ws(e){let t=this,{context:i,spec:r,callback:s,params:n,signalGenerator:a}=e,o=r.filter(m=>m.kind==="css"),u=m=>m.match(/\.([\w-]+)/g)?.length?["class"]:[],c=m=>m.match(/#([\w-]+)/g)?.length?["id"]:[],l=m=>[...m.matchAll(/\[([^\=\]]+)(\=[^\]]+)?\]/g)].map(g=>g[1]).concat(u(m)).concat(c(m));if(!(e.$attrs=Array.from(new Set(o.filter(m=>(m+"").includes("[")).reduce((m,g)=>m.concat(l(g+"")),[])))).length)return;let f=new Set,p=new Set;return f.push=m=>(p.delete(m),f.add(m)),p.push=m=>(f.delete(m),p.add(m)),e.$deliveryCache={entrants:f,exits:p},new Vt(i,t).observe(e.$attrs,m=>{let g=new Map,v=w=>(g.has(w)||g.set(w,{target:w,entrants:[],exits:[],type:"static",event:null}),g.get(w)),E=new WeakMap,y=w=>(E.has(w)||E.set(w,o.some(C=>w.matches(C+""))),E.get(w));for(let w of m)["entrants","exits"].forEach(C=>{n.generation&&C!==n.generation||e.$deliveryCache[C].has(w.target)||(C==="entrants"?!y(w.target):y(w.target))||(e.$deliveryCache[C].push(w.target),v(w.target)[C].push(w.target),v(w.target).event=w.event)});for(let[,w]of g){let C=a?.generate()||{};s(w,C,i)}},{subtree:n.subtree,timing:n.timing,eventDetails:n.eventDetails})}function lr(e,t){let{context:i,spec:r,callback:s,params:n,signalGenerator:a,$deliveryCache:o}=e,u={...t,entrants:[],exits:[]};if(n.eventDetails||delete u.event,["entrants","exits"].forEach(l=>{if(!(n.generation&&l!==n.generation)&&(r.length?u[l]=Ca.call(this,r,n.subtree==="cross-roots",t[l],t.event!=="parse"):u[l]=[...t[l]],!!o))for(let f of u[l])o[l].push(f)}),!u.entrants.length&&!u.exits.length)return;let c=a?.generate()||{};s(u,c,i)}function Ca(e,t,i,r){i=Array.isArray(i)?i:[...i];let s=(n,a)=>{if(a.type==="selector"){let o=a.isXpathAttr?[]:n.filter(u=>a.kind==="xpath"?Vs(this,u,a+""):u.matches&&u.matches(a+""));if((r||a.isXpathAttr)&&(o=n.reduce((u,c)=>a.kind==="xpath"?[...u,...ge(this,c,a,r)]:c.querySelectorAll?[...u,...c.querySelectorAll(a+"")]:u,o)),o.length)return o}else if(n.includes(a.content)||r&&n.some(o=>Xe(this,o,a.content,t)))return[a.content]};return i.$$searchCache||(i.$$searchCache=new Map),e.reduce((n,a)=>{let o;return i.$$searchCache.has(a.content)?o=i.$$searchCache.get(a.content):(o=s(i,a)||[],a.type==="instance"&&i.$$searchCache.set(a.content,o)),n.concat(o)},[])}function zs({target:e,addedNodes:t,removedNodes:i}){let r=this,s;return s=W(t).reduce((n,a)=>n||r.webqit.realdom.domInterceptionRecords?.get(a),null),s=W(i).reduce((n,a)=>n||r.webqit.realdom.domInterceptionRecords?.get(a),s),s=s||r.document.readyState==="loading"&&"parse"||"mutation",{target:e,entrants:t,exits:i,type:"observation",event:s}}function Qs(e,t){let i=this,{webqit:r,document:s,Node:n,CharacterData:a,Element:o,HTMLElement:u,HTMLTemplateElement:c,DocumentFragment:l}=i;r.realdom.domInterceptionHooks||Object.defineProperty(r.realdom,"domInterceptionHooks",{value:new Map}),r.realdom.domInterceptionNoRecurse||Object.defineProperty(r.realdom,"domInterceptionNoRecurse",{value:new Map}),r.realdom.domInterceptionHooks.has(e)||r.realdom.domInterceptionHooks.set(e,new Set),r.realdom.domInterceptionHooks.get(e).add(t);let f=()=>r.realdom.domInterceptionHooks.get(e).delete(t);if(r.realdom.domInterceptionHooks?.intercepting)return f;console.warn("DOM mutation APIs are now being intercepted."),r.realdom.domInterceptionHooks.intercepting=!0,Object.defineProperty(r.realdom,"domInterceptionRecords",{value:new Map});let p=(y,w,C)=>{r.realdom.domInterceptionNoRecurse.set(y,w);let b=C();return r.realdom.domInterceptionNoRecurse.delete(y),b},m=(y,w)=>{y.entrants.concat(y.exits).forEach(b=>{clearTimeout(r.realdom.domInterceptionRecords.get(b)?.timeout),r.realdom.domInterceptionRecords.set(b,y.event);let x=setTimeout(()=>{r.realdom.domInterceptionRecords.delete(b)},0);Object.defineProperty(y.event,"timeout",{value:x,configurable:!0})}),r.realdom.domInterceptionHooks.get("intercept")?.forEach(b=>b(y));let C=w();return r.realdom.domInterceptionHooks.get("sync")?.forEach(b=>b(y)),C},g={ShadowRoot:["innerHTML","setHTMLUnsafe"],DocumentFragment:["replaceChildren","append","prepend"],Document:["replaceChildren","append","prepend"],HTMLElement:["outerText","innerText"],Element:["append","prepend","before","after","insertAdjacentElement","insertAdjacentHTML","remove","replaceChildren","replaceWith","setHTMLUnsafe","innerHTML","outerHTML"],CharacterData:["before","after","remove","replaceWith"],Node:["insertBefore","replaceChild","removeChild","appendChild","textContent","nodeValue"]},v={ShadowRoot:Object.create(null),DocumentFragment:Object.create(null),Document:Object.create(null),HTMLElement:Object.create(null),Element:Object.create(null),CharacterData:Object.create(null),Node:Object.create(null)};return new Set(Object.values(g).reduce((y,w)=>y.concat(w),[])).forEach(y=>{Object.keys(g).forEach(b=>{if(!g[b].includes(y))return;let x=Object.getOwnPropertyDescriptor(i[b].prototype,y);!x||(Object.defineProperty(i[b].prototype,y,"value"in x?{...x,value:w}:{...x,set:C}),v[b][y]=x)});function w(...b){let x=Object.keys(v).find(X=>this instanceof i[X]&&y in v[X]),_=v[x],S=()=>_[y].value.call(this,...b);if(r.realdom.domInterceptionNoRecurse.get(this)===y)return S();let O=[],P=[],D=this;["insertBefore"].includes(y)?P=[b[0]]:["insertAdjacentElement","insertAdjacentHTML"].includes(y)?(P=[b[1]],["beforebegin","afterend"].includes(b[0])&&(D=this.parentNode)):["setHTMLUnsafe","replaceChildren"].includes(y)?(O=[...this.childNodes],P=y==="replaceChildren"?[...b]:[b[0]]):["replaceWith","remove"].includes(y)?(O=[this],P=y==="replaceWith"?[...b]:[],D=this.parentNode):["replaceChild"].includes(y)?(O=[b[1]],P=[b[0]]):["removeChild"].includes(y)?O=[...b]:(P=[...b],["before","after"].includes(y)&&(D=this.parentNode));let U=y;if(["insertAdjacentHTML","setHTMLUnsafe"].includes(y)){let X=this.nodeName;if(y==="insertAdjacentHTML"&&["beforebegin","afterend"].includes(b[0])){if(!this.parentNode)return _[y].value.call(this,...b);X=this.parentNode.nodeName}let Y=s.createElement(X.includes("-")?"div":X);_.setHTMLUnsafe.value.call(Y,P[0],y==="setHTMLUnsafe"?b[1]:{}),P=[...Y.childNodes],y==="insertAdjacentHTML"?(U="insertAdjacentElement",b[1]=new l,p(b[1],"append",()=>b[1].append(...Y.childNodes))):(U="replaceChildren",b=[...Y.childNodes])}return m({target:D,entrants:P,exits:O,type:"interception",event:[this,y]},()=>_[U].value.call(this,...b))}function C(b){let x=Object.keys(v).find(Q=>this instanceof i[Q]&&y in v[Q]),_=v[x],S=()=>_[y].set.call(this,b);if(this instanceof HTMLScriptElement||r.realdom.domInterceptionNoRecurse.get(this)===y)return S();let O=[],P=[],D=this;if(["outerHTML","outerText"].includes(y)?(O=[this],D=this.parentNode):this instanceof c?(D=this.content,O=[...this.content.childNodes]):O=[...this.childNodes],["outerHTML","innerHTML"].includes(y)){let Q=this.nodeName;if(y==="outerHTML"){if(!this.parentNode)return S();Q=this.parentNode.nodeName}let X=s.createElement(Q.includes("-")?"div":Q);if(p(X,y,()=>X[y]=b),P=this instanceof c?[...X.content.childNodes]:[...X.childNodes],this instanceof c&&this.hasAttribute("src")||this instanceof ShadowRoot){let Y=Bt=>Bt.reduce((Et,Ct)=>Ct instanceof HTMLScriptElement?Et.concat(Ct):Ct instanceof c?Et.concat(Y([Ct.content])):(Et=Et.concat(Y([...Ct.querySelectorAll?.("template")||[]].map(hn=>hn.content))),Et.concat(...Ct.querySelectorAll?.("script")||[])),[]);for(let Bt of Y(P)){if(this instanceof ShadowRoot){Bt.setAttribute("data-handling","manual");continue}let Et=s.createElement("script");[...Bt.attributes].forEach(Ct=>Et.setAttribute(Ct.name,Ct.value)),Et.textContent=Bt.textContent,p(Bt,"replaceWith",()=>Bt.replaceWith(Et))}}y==="outerHTML"?(b=new l,p(b,"append",()=>b.append(...P)),S=()=>p(this,"replaceWith",()=>o.prototype.replaceWith.call(this,b))):this instanceof c?S=()=>p(this.content,"replaceChildren",()=>this.content.replaceChildren(...P)):S=()=>p(this,"replaceChildren",()=>o.prototype.replaceChildren.call(this,...P))}return m({target:D,entrants:P,exits:O,type:"interception",event:[this,y]},S)}}),f}function Gs(){ka.call(this),Aa.call(this),Pa.call(this)}function ka(){let e=this;e.CSS||(e.CSS={}),e.CSS.escape||(e.CSS.escape=t=>t.replace(/([\:@\~\$\&])/g,"\\$1"))}function Aa(){let e=this;"isConnected"in e.Node.prototype||Object.defineProperty(e.Node.prototype,"isConnected",{get:function(){return!this.ownerDocument||!(this.ownerDocument.compareDocumentPosition(this)&this.DOCUMENT_POSITION_DISCONNECTED)}})}function Pa(){let e=this;e.Element.prototype.matches||(e.Element.prototype.matches=e.Element.prototype.matchesSelector||e.Element.prototype.mozMatchesSelector||e.Element.prototype.msMatchesSelector||e.Element.prototype.oMatchesSelector||e.Element.prototype.webkitMatchesSelector||function(t){for(var i=(this.document||this.ownerDocument).querySelectorAll(t),r=i.length;--r>=0&&i.item(r)!==this;);return r>-1})}function Ks(){let e=this;if(e.webqit||(e.webqit={}),e.webqit.realdom)return e.webqit.realdom;e.webqit.realdom={},Gs.call(e),e.webqit.realdom.meta=(...i)=>Ia.call(e,...i),e.webqit.realdom.ready=(...i)=>hr.call(e,...i),e.webqit.realdom.realtime=(i,r="dom")=>{if(r==="dom")return new Ye(i,e);if(r==="attr")return new Vt(i,e)};let t=new Ke(e);return e.webqit.realdom.schedule=(i,...r)=>t[`on${i}`](...r),e.webqit.realdom.synthesizeWhile=(...i)=>t.synthesizeWhile(...i),e.webqit.realdom}function hr(...e){let t="interactive",i;ae(e[0])?(t=e[0],F(e[1])&&(i=e[1])):F(e[0])&&(i=e[0]);let r={interactive:["interactive","complete"],complete:["complete"]};if(!r[t])throw new Error(`Invalid ready-state timing: ${t}.`);let s=this;if(!i)return s.webqit.realdom.readyStatePromises||(s.webqit.realdom.readyStatePromises={interactive:new Promise(n=>hr.call(this,"interactive",n)),complete:new Promise(n=>hr.call(this,"complete",n))}),s.webqit.realdom.readyStatePromises[t];if(r[t].includes(s.document.readyState))return i(s);s.webqit.realdom.readyStateCallbacks||(s.webqit.realdom.readyStateCallbacks={interactive:[],complete:[]},s.document.addEventListener("readystatechange",()=>{let n=s.document.readyState;for(let a of s.webqit.realdom.readyStateCallbacks[n].splice(0))a(s)},!1)),s.webqit.realdom.readyStateCallbacks[t].push(i)}function Ia(e){let t=this,i={},r;return(r=t.document.querySelector(`meta[name="${e}"]`))&&(i=(r.content||"").split(";").filter(s=>s).reduce((s,n)=>{let a=n.split("=").map(o=>o.trim());return ur(s,a[0].split("."),a[1]==="true"?!0:a[1]==="false"?!1:ut(a[1])?parseInt(a[1]):a[1]),s},{})),{get name(){return e},get content(){return r.content},json(){return JSON.parse(JSON.stringify(i))}}}function bi(e,t){return typeof e!="string"?e:e.replace(/\w\S*/g,function(i){return i.charAt(0).toUpperCase()+(typeof t!==void 0&&t?i.substr(1).toLowerCase():i.substr(1))})}var A=(...e)=>K("oohtml",...e),H={};function st(e,t,i){let r=this,s=Ks.call(r);H.window=r,r.webqitConfig||(r.webqitConfig=s.meta("webqit").json()),r.webqit||(r.webqit={}),r.webqit.oohtml||(r.webqit.oohtml={}),r.webqit.oohtml.configs||(r.webqit.oohtml.configs={});let n=e.toUpperCase().replace("-","_");if(!r.webqit.oohtml.configs[n]){r.webqit.oohtml.configs[n]={};let a=r.webqit.oohtml.configs[n];ke(2,a,i,t,s.meta(e).json()),r.webqitConfig.prefix&&Object.keys(a).forEach(o=>{Object.keys(a[o]).forEach(u=>{o==="api"&&typeof a[o][u]=="string"?a[o][u]=`${r.webqitConfig.prefix}${bi(a[o][u])}`:["attr","elements"].includes(o)&&a[o][u]?.startsWith("data-")===!1&&(a[o][u]=`${r.webqitConfig.prefix}-${a[o][u]}`)})})}return{config:r.webqit.oohtml.configs[n],realdom:s,window:r}}function pr(e,t){return K(e,"internalAttrInteractions").get(t)}function Ys(e,t,i){let r=K(e,"internalAttrInteractions").get(t);K(e,"internalAttrInteractions").set(t,!0);let s=i();return K(e,"internalAttrInteractions").set(t,r),s}function $t(e,t){return[...e].reduce(([i,r,s],n)=>!i&&r===0&&(Array.isArray(t)?t:[t]).includes(n)?[i,r,[""].concat(s)]:(!i&&["(","[","{"].includes(n)&&!s[0].endsWith("\\")&&r++,!i&&[")","]","}"].includes(n)&&!s[0].endsWith("\\")&&r--,['"',"'","`"].includes(n)&&!s[0].endsWith("\\")&&(i=i===n?null:i||n),s[0]+=n,[i,r,s]),[null,0,[""]])[2].reverse()}var Na=()=>(0|Math.random()*9e6).toString(36),fr=new Map;function te(e){let t;return(t=fr.get(e))||(t=Na(),fr.set(e,t)),t}function wi(e){let t;return fr.forEach((i,r)=>{i===e&&(t=r)}),t}function vi(){let{window:e}=H,{webqit:t}=e;if(t.DOMContextRequestEvent)return t.DOMContextRequestEvent;class i extends e.Event{constructor(...s){let n=s.pop();if(typeof n!="function")throw new Error("Callback must be provided.");let a=s.pop();if(!a?.kind)throw new Error('"options.kind" must be specified.');let o=["contextrequest","contextclaim"],u=s.pop()||o[0];if(!o.includes(u))throw new Error(`Invalid event type. Must be one of: ${o.join(",")}`);let{kind:c,detail:l,targetContext:f,live:p,signal:m,diff:g,...v}=a;super(u,{...v,bubbles:v.bubbles!==!1}),Object.defineProperty(this,"callback",{get:()=>n}),Object.defineProperty(this,"kind",{get:()=>c}),Object.defineProperty(this,"targetContext",{get:()=>f}),Object.defineProperty(this,"detail",{get:()=>l}),Object.defineProperty(this,"live",{get:()=>p}),Object.defineProperty(this,"signal",{get:()=>m}),Object.defineProperty(this,"diff",{get:()=>g}),Object.defineProperty(this,"options",{get:()=>v}),Object.defineProperty(this,"meta",{value:{}})}get target(){return super.target||this.meta.target}get answered(){return this.meta.answered||!1}respondWith(s){if(this.meta.answered=!0,this.diff){if("_prevValue"in this&&this._prevValue===s)return;Object.defineProperty(this,"_prevValue",{value:s,configurable:!0})}return this.callback(s)}}return t.DOMContextRequestEvent=i,i}var ee=class extends AbortController{constructor(t){super(),t(i=>{let{window:{webqit:{Observer:r}}}=H;r.defineProperty(this,"value",{value:i,configurable:!0,enumerable:!0})},this)}};var ie=class extends Error{};var Ft=class{static instance(t){return A(t).get("contexts::instance")||new this(t)}constructor(t){A(t).get("contexts::instance")?.dispose(),A(t).set("contexts::instance",this);let i={host:t,contexts:new Set};Object.defineProperty(this,"#",{get:()=>i})}[Symbol.iterator](){return this["#"].contexts[Symbol.iterator]()}get length(){return this["#"].contexts.size}find(...t){return[...this["#"].contexts].find(i=>typeof t[0]=="function"?t[0](i):i.constructor.kind===t[0]&&(!t[1]||i.detail===t[1]))}attach(t){if(!(t instanceof nt))throw new TypeError("Context is not a valid DOMContext instance.");if(this.find(t.constructor.kind,t.detail))throw new ie(`Context of same kind "${t.constructor.kind}"${t.detail?` and detail "${t.detail}"`:""} already exists.`);this["#"].contexts.add(t),t.initialize(this["#"].host)}detach(t){t.dispose(this["#"].host),this["#"].contexts.delete(t)}request(...t){return new ee((i,r)=>{typeof t[t.length-1]!="function"&&(t[t.length-1]?t.push(i):t[t.length-1]=i);let s;(s=t.find(a=>typeof a=="object"&&a))&&s.live&&(s.signal&&s.signal.addEventListener("abort",()=>r.abort()),t[t.indexOf(s)]={...s,signal:r.signal});let n=new(vi())(...t);this["#"].host.dispatchEvent(n)})}};var dr=class{static createRequest(){return{kind:this.kind}}constructor(t=null){Object.defineProperty(this,"detail",{get:()=>t}),Object.defineProperty(this,"subscriptions",{value:new Set})}get configs(){let{window:{webqit:{oohtml:{configs:t}}}}=H;return t}get name(){return[H.window.Document,H.window.ShadowRoot].some(t=>this.host instanceof t)?1/0:this.host.getAttribute(this.configs.CONTEXT_API.attr.contextname)}subscribed(t){}handle(t){}unsubscribed(t){}matchEvent(t){return t.kind===this.constructor.kind&&(!t.targetContext||t.targetContext===this.name)}handleEvent(t){if(!(this.disposed||typeof t.respondWith!="function")){if(t.type==="contextclaim"){if(!(t.detail instanceof dr)||t.target===this.host)return;let i=new Set;if(this.subscriptions.forEach(r=>{!t.target.contains(r.target)||!t.detail.matchEvent(r)||(this.subscriptions.delete(r),this.unsubscribed(r),i.add(r))}),i.size)return t.respondWith(i)}if(t.type==="contextrequest")return this.matchEvent(t)?(t.live&&(this.subscriptions.add(t),this.subscribed(t),t.signal?.addEventListener("abort",()=>{this.subscriptions.delete(t),this.unsubscribed(t)})),t.stopPropagation(),this.handle(t)):void 0}}initialize(t){this.host=t,this.disposed=!1,t.addEventListener("contextrequest",this),t.addEventListener("contextclaim",this);let{value:i}=Ft.instance(t).request("contextclaim",{kind:this.constructor.kind,detail:this});return i?.forEach(r=>{this.subscriptions.add(r),this.subscribed(r),this.handle(r)}),this}dispose(t){return this.disposed=!0,t.removeEventListener("contextrequest",this),t.removeEventListener("contextclaim",this),this.subscriptions.forEach(i=>{this.subscriptions.delete(i),this.unsubscribed(i);let{target:r}=i;i.meta.answered=!1,r.dispatchEvent(i)}),this}},nt=dr;G(nt,"kind");var ye=class extends nt{static createRequest(t=null){let i=super.createRequest();if(t?.startsWith("@")){let[r,...s]=s.slice(1).split("/").map(n=>n.trim());i.targetContext=r,i.detail=s.join("/")}else i.detail=t;return i}get namespaceObj(){return this.host[this.configs.NAMESPACED_HTML.api.namespace]}handle(t){let{window:{webqit:{Observer:i}}}=H;if(t.meta.controller?.abort(),!(t.detail||"").trim())return t.respondWith(i.unproxy(this.namespaceObj));let r=(t.detail||"").split("/").map(s=>s.trim()).filter(s=>s);if(!r.length)return t.respondWith();r=r.join(`/${this.configs.NAMESPACED_HTML.api.namespace}/`)?.split("/")||[],t.meta.controller=i.reduce(this.namespaceObj,r,i.get,s=>{this.disposed||t.respondWith(s.value)},{live:t.live,signal:t.signal,descripted:!0})}unsubscribed(t){t.meta.controller?.abort()}};G(ye,"kind","namespace");function mr(e={}){let{config:t,window:i}=st.call(this,"namespaced-html",e,{attr:{namespace:"namespace",lid:"id"},api:{namespace:"namespace"},tokens:{lidrefPrefix:"~",lidrefSeparator:":"},target:{className:":target",eventName:":target",scrolling:!0}});t.lidSelector=`[${i.CSS.escape(t.attr.lid)}]`,t.namespaceSelector=`[${i.CSS.escape(t.attr.namespace)}]`,i.webqit.DOMNamingContext=ye,$a.call(i,t),La.call(i,t)}function Js(e){let{lidrefPrefix:t,lidrefSeparator:i}=e.tokens;return{escape(r,s=1){return[...r].map(n=>/\w/.test(n)?n:s===2?`\\\\${n}`:`\\${n}`).join("")},lidrefPrefix(r=0){return r?this.escape(t,r):t},lidrefSeparator(r=0){return r?this.escape(i,r):i},isUuid(r,s=0){return r.startsWith(this.lidrefPrefix(s))&&r.includes(this.lidrefSeparator(s))},toUuid(r,s,n=0){return r.endsWith("-root")?s:`${this.lidrefPrefix(n)}${r}${this.lidrefSeparator(n)}${s}`},uuidToId(r,s=0){return this.isUuid(r)?r.split(this.lidrefSeparator(s))[1]:r},uuidToLidref(r,s=0){return this.isUuid(r)?`${this.lidrefPrefix(s)}${r.split(this.lidrefSeparator(s))[1]}`:r}}}function gr(e,t,i=null,r=0){let s=this,{webqit:{oohtml:{configs:{NAMESPACED_HTML:n}}}}=s,a=Js(n),o=new RegExp(`${i?":scope|":""}#(${a.lidrefPrefix(r+1)})?([\\w]+${a.lidrefSeparator(r+1)})?((?:[\\w-]|\\\\.)+)`,"g"),[u,c]=$t(e,",").reduce(([f,p],m)=>{let g,v;return m=m.replace(o,(E,y,w,C,b)=>{if(g||(g=[...m.matchAll(/(["'])(?:(?=(\\?))\2.)*?\1/g)]),g.some(O=>b>O.index&&b+E.length<O.index+O[0].length))return E;if(E===":scope")return v=!0,i;let x=y&&!w;if(y&&w)return`#${a.escape(E.replace("#",""),1)}`;if(x&&n.attr.lid==="id"&&t&&!t.endsWith("-root"))return`#${a.toUuid(t,C,1)}`;let S;return n.attr.lid==="id"?S=`:is(#${C},[id^="${a.lidrefPrefix(r)}"][id$="${a.lidrefSeparator(r)}${C}"])`:S=`:is(#${C},[${s.CSS.escape(n.attr.lid)}="${C}"])`,x?`:is(${S}):not(${i?i+" ":""}${n.namespaceSelector} *)`:S}),v?[f,p.concat(m)]:[f.concat(m),p]},[[],[]]),l;return i&&u.length?l=[u.length>1?`${i} :is(${u.join(", ")})`:`${i} ${u[0]}`,c.join(", ")].filter(f=>f).join(", "):l=[...u,...c].join(", "),l}function Si(e){let t=this;if(!A(e).has("namespace")){let i=Object.create(null);A(e).set("namespace",i);let r=[t.Document,t.ShadowRoot].some(s=>e instanceof s);Object.defineProperty(i,Symbol.toStringTag,{get(){return r?"RootNamespaceRegistry":"NamespaceRegistry"}})}return A(e).get("namespace")}function xe(e,t=!1){let i=this,{webqit:{oohtml:{configs:{NAMESPACED_HTML:r}}}}=i,s=[i.Document,i.ShadowRoot].some(n=>e instanceof n);return Si.call(i,s?e:(t?e.parentNode:e)?.closest?.(r.namespaceSelector)||e.getRootNode())}function _i(e){let t=Object.prototype.toString.call(e)==="[object RootNamespaceRegistry]";return(wi(e)||te(e))+(t?"-root":"")}function $a(e){let t=this,{webqit:{Observer:i}}=t;[t.Document.prototype,t.Element.prototype,t.ShadowRoot.prototype].forEach(r=>{let s=r===t.Document.prototype?"Document":r===t.ShadowRoot.prototype?"ShadowRoot":"Element";if(e.api.namespace in r)throw new Error(`The ${s} prototype already has a "${e.api.namespace}" API!`);Object.defineProperty(r,e.api.namespace,{get:function(){return i.proxy(Si.call(t,this))}})})}function La(e){let t=this,{webqit:{Observer:i,realdom:r,oohtml:{configs:s},DOMNamingContext:n}}=t,a=["aria-owns","aria-controls","aria-labelledby","aria-describedby","aria-flowto"],o=["for","list","form","aria-activedescendant","aria-details","aria-errormessage"],u=[e.attr.lid,...a,...o],c={id:"id",for:"htmlFor","aria-owns":"ariaOwns","aria-controls":"ariaControls","aria-labelledby":"ariaLabelledBy","aria-describedby":"ariaDescribedBy","aria-flowto":"ariaFlowto","aria-activedescendant":"ariaActiveDescendant","aria-details":"ariaDetails","aria-errormessage":"ariaErrorMessage"},l=Js(e),f=(x,_,S)=>{if(!pr(x,_)&&A(x,"attrOriginals").has(_))return A(x,"attrOriginals").get(_);let O=S();return pr(x,_)?O:O&&O.split(" ").map(P=>(P=P.trim())&&(_===e.attr.lid?l.uuidToId:l.uuidToLidref).call(l,P)).join(" ")},p=Object.getOwnPropertyDescriptor(t.Document.prototype,"getElementById");Object.defineProperty(t.Document.prototype,"getElementById",{...p,value(x){return this.querySelector(`#${x}`)}});for(let x of["querySelector","querySelectorAll"])for(nodeApi of[t.Document,t.Element]){let _=Object.getOwnPropertyDescriptor(nodeApi.prototype,x);Object.defineProperty(nodeApi.prototype,x,{..._,value(S){return _.value.call(this,gr.call(t,S,_i(Si.call(t,this))))}})}let m=Object.getOwnPropertyDescriptor(t.Element.prototype,"getAttribute");Object.defineProperty(t.Element.prototype,"getAttribute",{...m,value(x){let _=()=>m.value.call(this,x);return u.includes(x)&&!A(this,"lock").get(x)?f(this,x,_):_()}});let g=Object.getOwnPropertyDescriptor(t.Attr.prototype,"value");Object.defineProperty(t.Attr.prototype,"value",{...g,get(){let x=()=>g.get.call(this);return u.includes(this.name)?f(this.ownerElement,this.name,x):x()}});let v=Object.getOwnPropertyDescriptor(t.Node.prototype,"nodeValue");Object.defineProperty(t.Node.prototype,"nodeValue",{...v,get(){let x=()=>v.get.call(this);return this instanceof t.Attr&&u.includes(this.name)?f(this.ownerElement,this.name,x):x()}});for(let x of u){if(!(x in c))continue;let _=x==="for"?[t.HTMLLabelElement,t.HTMLOutputElement]:[t.Element];for(let S of _){let O=Object.getOwnPropertyDescriptor(S.prototype,c[x]);!O||Object.defineProperty(S.prototype,c[x],{...O,get(){return f(this,x,()=>O.get.call(this,x))}})}}e.attr.lid!=="id"&&Object.defineProperty(t.Element.prototype,e.attr.lid,{configurable:!0,enumerable:!0,get(){return this.getAttribute(e.attr.lid)},set(x){return this.setAttribute(e.attr.lid,x)}});let E=(x,_,S,O)=>Ys(x,_,()=>(typeof S=="function"&&(S=S()),O(S))),y=(x,_,S,O=null)=>{E(x,_,S,P=>{let D=_===e.attr.lid,U=O||xe.call(t,x,D),Q=_i(U);if(D){let X=l.uuidToId(P);if(i.get(U,X)!==x){let Y=l.toUuid(Q,X);Y!==P&&x.setAttribute("id",Y),i.set(U,X,x)}}else{A(x,"attrOriginals").set(_,P);let X=P.split(" ").map(Y=>(Y=Y.trim())&&l.isUuid(Y)?Y:l.toUuid(Q,Y)).join(" ");x.setAttribute(_,X),A(U).set("idrefs",A(U).get("idrefs")||new Set),A(U).get("idrefs").add(x)}})},w=(x,_,S,O=null)=>{E(x,_,S,P=>{let D=_===e.attr.lid,U=O||xe.call(t,x,D);if(D){let Q=l.uuidToId(P);i.get(U,Q)===x&&i.deleteProperty(U,Q)}else{let Q=A(x,"attrOriginals").get(_);x.hasAttribute(_)&&x.setAttribute(_,Q),A(U).get("idrefs")?.delete(x)}})};r.realtime(t.document).query(e.namespaceSelector,x=>{let _=(S,O,P,D)=>{if(!S.hasAttribute(O))return;let U=()=>S.getAttribute(O);w(S,O,U,P),S.isConnected&&y(S,O,A(S,"attrOriginals").get(O)||U,D)};x.exits.forEach(S=>{if(S.isConnected){let D=Si.call(t,S);for(let U of new Set([...Object.values(D),...A(D).get("idrefs")||[]]))for(let Q of u)_(U,Q,D)}let O=S[s.CONTEXT_API.api.contexts],P=O.find(n.kind);P&&O.detach(P)}),x.entrants.forEach(S=>{let O,P=xe.call(t,S,!0);for(let U of new Set([...Object.values(P),...A(P).get("idrefs")||[]]))if((O=xe.call(t,U,!0))!==P)for(let Q of u)_(U,Q,P,O);let D=S[s.CONTEXT_API.api.contexts];D.find(n.kind)||D.attach(new n)})},{id:"namespace-html:namespace",live:!0,subtree:"cross-roots",timing:"sync",staticSensitivity:!0,eventDetails:!0}),r.realtime(t.document).query(`[${u.map(x=>t.CSS.escape(x)).join("],[")}]`,x=>{let _={forID:new Map,forOther:new Map};for(let S of u){let O=S===e.attr.lid?_.forID:_.forOther;x.exits.forEach(P=>{if(!P.hasAttribute(S))return;let D=O.get(P);typeof D>"u"&&(D=(S===e.attr.lid?P.parentNode:P)?.closest?.(e.namespaceSelector)||P.getRootNode().host,O.set(P,D)),!(D&&!D.isConnected)&&w(P,S,()=>P.getAttribute(S))}),x.entrants.forEach(P=>{!P.hasAttribute(S)||y(P,S,()=>P.getAttribute(S))})}_.forID.clear(),_.forOther.clear()},{id:"namespace-html:attrs",live:!0,subtree:"cross-roots",timing:"sync"}),r.realtime(t.document,"attr").observe(u,x=>{for(let _ of x)_.oldValue&&w(_.target,_.name,_.oldValue),_.value&&y(_.target,_.name,_.value)},{id:"namespace-html:attr(attrs)",subtree:"cross-roots",timing:"sync",newValue:!0,oldValue:!0});let C,b=()=>{if(!t.location.hash?.startsWith(`#${l.lidrefPrefix()}`))return;let x=t.location.hash?.substring(`#${l.lidrefPrefix()}`.length).split("/").map(S=>S.trim()).filter(S=>S)||[],_=x.reduce((S,O)=>S&&S[e.api.namespace][O],t.document);C&&e.target.className&&C.classList.toggle(e.target.className,!1),_&&_!==t.document&&(e.target.className&&_.classList.toggle(e.target.className,!0),e.target.eventName&&_.dispatchEvent(new t.CustomEvent(e.target.eventName)),e.target.scrolling&&x.length>1&&_.scrollIntoView(),C=_)};t.addEventListener("hashchange",b),r.ready(b)}function yr({advanced:e={},...t}){let{config:i,window:r}=st.call(this,"scoped-js",t,{script:{retention:"retain",mimeTypes:"module|text/javascript|application/javascript",timing:"auto"},api:{scripts:"scripts"},advanced:de(e)}),s=Array.isArray(i.script.mimeTypes)?i.script.mimeTypes:i.script.mimeTypes.split("|").filter(n=>n);i.scriptSelector=s.map(n=>`script[type="${r.CSS.escape(n)}"]:not([oohtmlignore])`).concat("script:not([type])").join(","),r.webqit.oohtml.Script={compileCache:[new Map,new Map],execute:Ma.bind(r,i)},Ra.call(r,i),Da.call(r,i)}function Ra(e){let t=this,i=new Map;if(e.api.scripts in t.Element.prototype)throw new Error(`The "Element" class already has a "${e.api.scripts}" property!`);[t.ShadowRoot.prototype,t.Element.prototype].forEach(r=>{Object.defineProperty(r,e.api.scripts,{get:function(){return i.has(this)||i.set(this,[]),i.get(this)}})}),Object.defineProperties(t.HTMLScriptElement.prototype,{scoped:{configurable:!0,get(){return this.hasAttribute("scoped")},set(r){this.toggleAttribute("scoped",r)}},quantum:{configurable:!0,get(){return this.hasAttribute("quantum")},set(r){this.toggleAttribute("quantum",r)}}})}async function Ma(e,t){let i=this,{realdom:r}=i.webqit,s=wi(t);if(!s)throw new Error("Argument must be a valid exec hash.");let{script:n,compiledScript:a,thisContext:o}=s;e.script.retention==="dispose"?n.remove():e.script.retention==="hidden"?n.textContent='"source hidden"':n.textContent=await a.toString();let u=n.scoped?o:n.getRootNode();A(u).has("scriptEnv")||A(u).set("scriptEnv",Object.create(null));let c=await(await a.bind(o,A(u).get("scriptEnv"))).execute();n.quantum&&Object.defineProperty(n,"state",{value:c}),r.realtime(i.document).observe(n,()=>{n.quantum&&c.dispose(),o instanceof i.Element&&o[e.api.scripts]?.splice(o[e.api.scripts].indexOf(n,1))},{id:"scoped-js:script-exits",subtree:"cross-roots",timing:"sync",generation:"exits"})}function Da(e){let t=Object.getOwnPropertyDescriptor(globalThis,"window")?.get?.toString().includes("[native code]")??!1,i=this,{webqit:{oohtml:r,realdom:s}}=i;i.HTMLScriptElement.supports||(i.HTMLScriptElement.supports=a=>["text/javascript","application/javascript"].includes(a));let n=new WeakSet;s.realtime(i.document).query(e.scriptSelector,a=>{a.entrants.forEach(o=>{if(n.has(o)||!t&&!o.hasAttribute("ssr"))return;let u=Zs.call(i,e,o);if(!u)return;n.add(o);let c=o.scoped?o.parentNode||a.target:o.type==="module"?void 0:i;o.scoped&&c[e.api.scripts].push(o);let l=te({script:o,compiledScript:u,thisContext:c});a.type==="query"||o.type&&!i.HTMLScriptElement.supports(o.type)||o.getAttribute("data-handling")==="manual"||e.script.timing==="manual"?r.Script.execute(l):o.textContent=`webqit.oohtml.Script.execute( '${l}' );`})},{id:"scoped-js:script-entries",live:!0,subtree:"cross-roots",timing:"intercept",generation:"entrants",eventDetails:!0})}function Zs(e,t){let i=this,{webqit:{oohtml:r,QuantumScript:s,AsyncQuantumScript:n,QuantumModule:a}}=i,o=(t._=t.textContent.trim())&&t._.startsWith("/*@oohtml*/if(false){")&&t._.endsWith("}/*@oohtml*/")?t._.slice(21,-12):t.textContent;if(!o.trim().length)return;let u=te(o),c=r.Script.compileCache[t.quantum?0:1],l;if(!(l=c.get(u))){let{parserParams:f,compilerParams:p,runtimeParams:m}=e.advanced;l=new(t.type==="module"?a:s||n)(o,{exportNamespace:`#${t.id}`,fileName:`${i.document.url?.split("#")?.[0]||""}#${t.id}`,parserParams:{...f,executionMode:t.quantum&&"QuantumProgram"||"RegularProgram"},compilerParams:p,runtimeParams:m}),c.set(u,l)}return l}function tn(e){let t=this,{webqit:{oohtml:{configs:{SCOPED_JS:i}}}}=t;[...e?.querySelectorAll(i.scriptSelector)||[]].forEach(r=>{Zs.call(t,i,r)})}function wr(e={}){let{config:t,window:i}=st.call(this,"data-binding",e,{attr:{render:"render",itemIndex:"data-key"},tokens:{nodeType:"processing-instruction",tagStart:"?{",tagEnd:"}?",stateStart:"; [=",stateEnd:"]"},advanced:de({runtimeParams:{spec:{handler:s=>{}}}})});({CONTEXT_API:t.CONTEXT_API,BINDINGS_API:t.BINDINGS_API,HTML_IMPORTS:t.HTML_IMPORTS}=i.webqit.oohtml.configs),t.attrSelector=`[${i.CSS.escape(t.attr.render)}]`;let r=(s,n)=>{let a=`starts-with(., "${s}")`,o=`substring(., string-length(.) - string-length("${n}") + 1) = "${n}"`;return`${a} and ${o}`};t.discreteBindingsSelector=`comment()[${r(t.tokens.tagStart,t.tokens.tagEnd)}]`,Va.call(i,t)}function Va(e){let t=this,{webqit:{realdom:i}}=t;i.realtime(t.document).query(e.attrSelector,r=>{en.call(this,...r.exits),setTimeout(()=>{qa.call(t,e,...r.entrants)},0)},{id:"data-binding:attr",live:!0,subtree:"cross-roots",timing:"sync",eventDetails:!0,staticSensitivity:!0}),i.realtime(t.document).query(`(${e.discreteBindingsSelector})`,r=>{setTimeout(()=>{en.call(this,...r.exits),Fa.call(t,e,...r.entrants)},0)},{id:"data-binding:descrete",live:!0,subtree:"cross-roots",timing:"sync"})}function rn(e,t){let{webqit:{realdom:i,Observer:r,DOMBindingsContext:s}}=this;if(A(t).has("data-binding"))return A(t).get("data-binding");let n=Object.create(null),a=new AbortController;n.$exec__=(u,c,...l)=>{(()=>{try{u[c](...l)}catch(p){throw new Error(`Error executing "${c}()": ${p.message} at ${p.cause}`)}})()},n.$assign__=(u,c,l)=>{(()=>{try{u[c]=l}catch(p){throw new Error(`Error executing "${c} = ${l}": ${p.message} at ${p.cause}`)}})()},r.intercept(n,{get:(u,c,l)=>{if(!(u.key in n)){let f={...s.createRequest(u.key),live:!0,signal:a.signal};t[e.CONTEXT_API.api.contexts].request(f,p=>{r.set(n,u.key,p)})}return l(n[u.key]??(u.key in globalThis?globalThis[u.key]:void 0))},has:(u,c,l)=>l(!0)});let o={scope:n,abortController:a,bindings:new Map};return A(t).set("data-binding",o),o}function en(...e){for(let t of e){let i=t.nodeName==="#text"?t.parentNode:t,{bindings:r,abortController:s}=A(i).get("data-binding")||{};if(!r?.has(t))return;r.get(t).state.dispose(),r.get(t).signals?.forEach(n=>n.abort()),r.delete(t),r.size||(s.abort(),A(i).delete("data-binding"))}}function sn(e,t){let i=e.tokens.tagStart.split("").map(c=>`\\${c}`).join(""),r=e.tokens.tagEnd.split("").map(c=>`\\${c}`).join(""),s=e.tokens.stateStart.split("").map(c=>c===" "?"(?:\\s+)?":`\\${c}`).join(""),n=e.tokens.stateEnd.split("").map(c=>`\\${c}`).join(""),a=`^${i}(.*?)(?:${s}(\\d+)${n}(?:\\s+)?)?${r}$`,[,o,u]=t.match(new RegExp(a));return{raw:t,expr:o,span:parseInt(u??0)}}async function Fa(e,...t){let i=this,r=t.reduce((s,n)=>{if(n.isBound)return s;let a=sn(e,n.nodeValue),o=n;if(a.span){if(o=n.nextSibling,o?.nodeName!=="#text"||o.nodeValue.length<a.span)return s;o.nodeValue.length>a.span&&o.splitText(a.span)}else o=n.ownerDocument.createTextNode(""),n.after(o);o.isBound=!0;let u=n;return i.webqit.env!=="server"&&(u.remove(),u=null),s.concat({textNode:o,template:a,anchorNode:u})},[]);for(let{textNode:s,template:n,anchorNode:a}of r){let o=nn.call(i,e,n.expr),{scope:u,bindings:c}=rn.call(this,e,s.parentNode);Object.defineProperty(s,"$oohtml_internal_databinding_anchorNode",{value:a,configurable:!0});try{c.set(s,{state:await(await o.bind(s,u)).execute()})}catch(l){console.log(l)}}}var xr=new Map;function nn(e,t){if(xr.has(t))return xr.get(t);let i=`let content = ((${t}) ?? '') + '';`;i+="$assign__(this, 'nodeValue', content);",i+=`if ( this.$oohtml_internal_databinding_anchorNode ) { $assign__(this.$oohtml_internal_databinding_anchorNode, 'nodeValue', "${e.tokens.tagStart}${be(t)}${e.tokens.stateStart}" + content.length + "${e.tokens.stateEnd} ${e.tokens.tagEnd}"); }`;let{webqit:{QuantumModule:r}}=this,{parserParams:s,compilerParams:n,runtimeParams:a}=e.advanced,o=new r(i,{parserParams:s,compilerParams:n,runtimeParams:a});return xr.set(t,o),o}async function qa(e,...t){for(let i of t){let r=an.call(this,e,i.getAttribute(e.attr.render)),{scope:s,bindings:n}=rn.call(this,e,i),a=[];Object.defineProperty(i,"$oohtml_internal_databinding_signals",{value:a,configurable:!0});try{n.set(i,{signals:a,state:await(await r.bind(i,s)).execute()})}catch(o){console.log(o)}}}var br=new Map;function an(e,t){if(br.has(t))return br.get(t);let i={},r=-1,s=$t(t,";").map(l=>{let[f,p]=$t(l,":").map(y=>y.trim()),m=f[0],g=f.slice(1).trim(),v=`(${p})`,E=`(${v} ?? '')`;if(m==="&")return g.startsWith("--")?`$exec__(this.style, 'setProperty', "${be(g)}", ${E});`:`$assign__(this.style, "${be(g)}", ${E});`;if(m==="%")return`$exec__(this.classList, 'toggle', "${be(g)}", !!${v});`;if(m==="~")return g.startsWith("?")?`$exec__(this, 'toggleAttribute', "${be(g.substring(1).trim())}", !!${v});`:`$exec__(this, 'setAttribute', "${be(g)}", ${E});`;if(m==="#"){if(i[g])throw new Error(`Duplicate binding: ${f}.`);if(i[g]=!0,g==="text")return`$assign__(this, 'textContent', ${E});`;if(g==="html")return`$assign__(this, 'innerHTML', ${E});`;if(g==="items"){let[y,w]=$t(p,"/");if(!w)throw new Error(`Invalid ${m}items spec: ${l}; no import specifier.`);let[C,b,x,_]=y.trim().match(/(.*?[\)\s+])(of|in)([\(\{\[\s+].*)/i)||[];if(!C)throw new Error(`Invalid ${m}items spec: ${l}.`);if(b.startsWith("(")?b=b.trim().slice(1,-1).split(",").map(O=>O.trim()):b=[b],b.length>(x==="in"?3:2))throw new Error(`Invalid ${m}items spec: ${l}.`);let S=x==="in"?b[2]:b[1]||"$index__";return`
16
16
  let $iteratee__ = ${_};
17
17
  let $import__ = this.${e.HTML_IMPORTS.api.import}( ${w.trim()}, true );
18
18
  this.$oohtml_internal_databinding_signals?.push( $import__ );