prettier 4.0.3 → 4.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -1
  3. data/node_modules/prettier/LICENSE +53 -124
  4. data/node_modules/prettier/doc.js +5 -5
  5. data/node_modules/prettier/index.cjs +1 -1
  6. data/node_modules/prettier/index.d.ts +5 -7
  7. data/node_modules/prettier/index.mjs +7854 -7334
  8. data/node_modules/prettier/internal/cli.mjs +18 -19
  9. data/node_modules/prettier/package.json +1 -2
  10. data/node_modules/prettier/plugins/acorn.js +1 -1
  11. data/node_modules/prettier/plugins/acorn.mjs +1 -1
  12. data/node_modules/prettier/plugins/angular.js +1 -2
  13. data/node_modules/prettier/plugins/angular.mjs +1 -2
  14. data/node_modules/prettier/plugins/babel.js +1 -1
  15. data/node_modules/prettier/plugins/babel.mjs +1 -1
  16. data/node_modules/prettier/plugins/estree.js +26 -26
  17. data/node_modules/prettier/plugins/estree.mjs +26 -26
  18. data/node_modules/prettier/plugins/flow.js +17 -17
  19. data/node_modules/prettier/plugins/flow.mjs +16 -16
  20. data/node_modules/prettier/plugins/glimmer.js +20 -20
  21. data/node_modules/prettier/plugins/glimmer.mjs +20 -20
  22. data/node_modules/prettier/plugins/markdown.js +40 -40
  23. data/node_modules/prettier/plugins/markdown.mjs +40 -40
  24. data/node_modules/prettier/plugins/meriyah.js +5 -5
  25. data/node_modules/prettier/plugins/meriyah.mjs +5 -5
  26. data/node_modules/prettier/plugins/postcss.js +1 -1
  27. data/node_modules/prettier/plugins/postcss.mjs +1 -1
  28. data/node_modules/prettier/plugins/typescript.js +20 -20
  29. data/node_modules/prettier/plugins/typescript.mjs +20 -20
  30. data/node_modules/prettier/standalone.d.ts +1 -1
  31. data/node_modules/prettier/standalone.js +15 -18
  32. data/node_modules/prettier/standalone.mjs +16 -19
  33. data/package.json +1 -1
  34. data/src/plugin.js +7 -4
  35. metadata +2 -3
  36. data/node_modules/prettier/internal/internal.mjs +0 -712
@@ -1,2 +1 @@
1
- (function(n){function e(){var i=n();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.angular=e()}})(function(){"use strict";var Se=Object.defineProperty;var Ut=Object.getOwnPropertyDescriptor;var Gt=Object.getOwnPropertyNames;var Dt=Object.prototype.hasOwnProperty;var Vt=(r,e,t)=>e in r?Se(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Xe=(r,e)=>{for(var t in e)Se(r,t,{get:e[t],enumerable:!0})},Wt=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Gt(e))!Dt.call(r,n)&&n!==t&&Se(r,n,{get:()=>e[n],enumerable:!(s=Ut(e,n))||s.enumerable});return r};var Qt=r=>Wt(Se({},"__esModule",{value:!0}),r);var Ze=(r,e,t)=>(Vt(r,typeof e!="symbol"?e+"":e,t),t),Je=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)};var Ke=(r,e,t)=>(Je(r,e,"read from private field"),t?t.call(r):e.get(r)),Ye=(r,e,t)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,t)},et=(r,e,t,s)=>(Je(r,e,"write to private field"),s?s.call(r,t):e.set(r,t),t);var Wr={};Xe(Wr,{parsers:()=>qe});var qe={};Xe(qe,{__ng_action:()=>Ur,__ng_binding:()=>Gr,__ng_directive:()=>Vr,__ng_interpolation:()=>Dr});var we=`
2
- `,tt="\r",rt=function(){function r(e){this.length=e.length;for(var t=[0],s=0;s<e.length;)switch(e[s]){case we:s+=we.length,t.push(s);break;case tt:s+=tt.length,e[s]===we&&(s+=we.length),t.push(s);break;default:s++;break}this.offsets=t}return r.prototype.locationForIndex=function(e){if(e<0||e>this.length)return null;for(var t=0,s=this.offsets;s[t+1]<=e;)t++;var n=e-s[t];return{line:t,column:n}},r.prototype.indexForLocation=function(e){var t=e.line,s=e.column;return t<0||t>=this.offsets.length||s<0||s>this.lengthOfLine(t)?null:this.offsets[t]+s},r.prototype.lengthOfLine=function(e){var t=this.offsets[e],s=e===this.offsets.length-1?this.length:this.offsets[e+1];return s-t},r}();var D=class{constructor(e,t,s,n){this.input=t,this.errLocation=s,this.ctxLocation=n,this.message=`Parser Error: ${e} ${s} [${t}] in ${n}`}},R=class{constructor(e,t){this.start=e,this.end=t}toAbsolute(e){return new N(e+this.start,e+this.end)}},w=class{constructor(e,t){this.span=e,this.sourceSpan=t}toString(){return"AST"}},V=class extends w{constructor(e,t,s){super(e,t),this.nameSpan=s}},C=class extends w{visit(e,t=null){}},L=class extends w{visit(e,t=null){return e.visitImplicitReceiver(this,t)}},ye=class extends L{visit(e,t=null){var s;return(s=e.visitThisReceiver)==null?void 0:s.call(e,this,t)}},W=class extends w{constructor(e,t,s){super(e,t),this.expressions=s}visit(e,t=null){return e.visitChain(this,t)}},Q=class extends w{constructor(e,t,s,n,i){super(e,t),this.condition=s,this.trueExp=n,this.falseExp=i}visit(e,t=null){return e.visitConditional(this,t)}},K=class extends V{constructor(e,t,s,n,i){super(e,t,s),this.receiver=n,this.name=i}visit(e,t=null){return e.visitPropertyRead(this,t)}},H=class extends V{constructor(e,t,s,n,i,a){super(e,t,s),this.receiver=n,this.name=i,this.value=a}visit(e,t=null){return e.visitPropertyWrite(this,t)}},z=class extends V{constructor(e,t,s,n,i){super(e,t,s),this.receiver=n,this.name=i}visit(e,t=null){return e.visitSafePropertyRead(this,t)}},q=class extends w{constructor(e,t,s,n){super(e,t),this.receiver=s,this.key=n}visit(e,t=null){return e.visitKeyedRead(this,t)}},j=class extends w{constructor(e,t,s,n){super(e,t),this.receiver=s,this.key=n}visit(e,t=null){return e.visitSafeKeyedRead(this,t)}},X=class extends w{constructor(e,t,s,n,i){super(e,t),this.receiver=s,this.key=n,this.value=i}visit(e,t=null){return e.visitKeyedWrite(this,t)}},Z=class extends V{constructor(e,t,s,n,i,a){super(e,t,a),this.exp=s,this.name=n,this.args=i}visit(e,t=null){return e.visitPipe(this,t)}},A=class extends w{constructor(e,t,s){super(e,t),this.value=s}visit(e,t=null){return e.visitLiteralPrimitive(this,t)}},J=class extends w{constructor(e,t,s){super(e,t),this.expressions=s}visit(e,t=null){return e.visitLiteralArray(this,t)}},Y=class extends w{constructor(e,t,s,n){super(e,t),this.keys=s,this.values=n}visit(e,t=null){return e.visitLiteralMap(this,t)}},Ee=class extends w{constructor(e,t,s,n){super(e,t),this.strings=s,this.expressions=n}visit(e,t=null){return e.visitInterpolation(this,t)}},$=class extends w{constructor(e,t,s,n,i){super(e,t),this.operation=s,this.left=n,this.right=i}visit(e,t=null){return e.visitBinary(this,t)}},B=class r extends ${static createMinus(e,t,s){return new r(e,t,"-",s,"-",new A(e,t,0),s)}static createPlus(e,t,s){return new r(e,t,"+",s,"-",s,new A(e,t,0))}constructor(e,t,s,n,i,a,h){super(e,t,i,a,h),this.operator=s,this.expr=n,this.left=null,this.right=null,this.operation=null}visit(e,t=null){return e.visitUnary!==void 0?e.visitUnary(this,t):e.visitBinary(this,t)}},ee=class extends w{constructor(e,t,s){super(e,t),this.expression=s}visit(e,t=null){return e.visitPrefixNot(this,t)}},te=class extends w{constructor(e,t,s){super(e,t),this.expression=s}visit(e,t=null){return e.visitNonNullAssert(this,t)}},re=class extends w{constructor(e,t,s,n,i){super(e,t),this.receiver=s,this.args=n,this.argumentSpan=i}visit(e,t=null){return e.visitCall(this,t)}},se=class extends w{constructor(e,t,s,n,i){super(e,t),this.receiver=s,this.args=n,this.argumentSpan=i}visit(e,t=null){return e.visitSafeCall(this,t)}},N=class{constructor(e,t){this.start=e,this.end=t}},P=class extends w{constructor(e,t,s,n,i){super(new R(0,t===null?0:t.length),new N(n,t===null?n:n+t.length)),this.ast=e,this.source=t,this.location=s,this.errors=i}visit(e,t=null){return e.visitASTWithSource?e.visitASTWithSource(this,t):this.ast.visit(e,t)}toString(){return`${this.source} in ${this.location}`}},T=class{constructor(e,t,s){this.sourceSpan=e,this.key=t,this.value=s}},ne=class{constructor(e,t,s){this.sourceSpan=e,this.key=t,this.value=s}},Ce=class{visit(e,t){e.visit(this,t)}visitUnary(e,t){this.visit(e.expr,t)}visitBinary(e,t){this.visit(e.left,t),this.visit(e.right,t)}visitChain(e,t){this.visitAll(e.expressions,t)}visitConditional(e,t){this.visit(e.condition,t),this.visit(e.trueExp,t),this.visit(e.falseExp,t)}visitPipe(e,t){this.visit(e.exp,t),this.visitAll(e.args,t)}visitImplicitReceiver(e,t){}visitThisReceiver(e,t){}visitInterpolation(e,t){this.visitAll(e.expressions,t)}visitKeyedRead(e,t){this.visit(e.receiver,t),this.visit(e.key,t)}visitKeyedWrite(e,t){this.visit(e.receiver,t),this.visit(e.key,t),this.visit(e.value,t)}visitLiteralArray(e,t){this.visitAll(e.expressions,t)}visitLiteralMap(e,t){this.visitAll(e.values,t)}visitLiteralPrimitive(e,t){}visitPrefixNot(e,t){this.visit(e.expression,t)}visitNonNullAssert(e,t){this.visit(e.expression,t)}visitPropertyRead(e,t){this.visit(e.receiver,t)}visitPropertyWrite(e,t){this.visit(e.receiver,t),this.visit(e.value,t)}visitSafePropertyRead(e,t){this.visit(e.receiver,t)}visitSafeKeyedRead(e,t){this.visit(e.receiver,t),this.visit(e.key,t)}visitCall(e,t){this.visit(e.receiver,t),this.visitAll(e.args,t)}visitSafeCall(e,t){this.visit(e.receiver,t),this.visitAll(e.args,t)}visitAll(e,t){for(let s of e)this.visit(s,t)}};var st;(function(r){r[r.DEFAULT=0]="DEFAULT",r[r.LITERAL_ATTR=1]="LITERAL_ATTR",r[r.ANIMATION=2]="ANIMATION"})(st||(st={}));function nt(r){return r>=9&&r<=32||r==160}function b(r){return 48<=r&&r<=57}function it(r){return r>=97&&r<=122||r>=65&&r<=90}function Be(r){return r===39||r===34||r===96}var d;(function(r){r[r.Character=0]="Character",r[r.Identifier=1]="Identifier",r[r.PrivateIdentifier=2]="PrivateIdentifier",r[r.Keyword=3]="Keyword",r[r.String=4]="String",r[r.Operator=5]="Operator",r[r.Number=6]="Number",r[r.Error=7]="Error"})(d||(d={}));var yr=["var","let","as","null","undefined","true","false","if","else","this"],le=class{tokenize(e){let t=new Me(e),s=[],n=t.scanToken();for(;n!=null;)s.push(n),n=t.scanToken();return s}},O=class{constructor(e,t,s,n,i){this.index=e,this.end=t,this.type=s,this.numValue=n,this.strValue=i}isCharacter(e){return this.type==d.Character&&this.numValue==e}isNumber(){return this.type==d.Number}isString(){return this.type==d.String}isOperator(e){return this.type==d.Operator&&this.strValue==e}isIdentifier(){return this.type==d.Identifier}isPrivateIdentifier(){return this.type==d.PrivateIdentifier}isKeyword(){return this.type==d.Keyword}isKeywordLet(){return this.type==d.Keyword&&this.strValue=="let"}isKeywordAs(){return this.type==d.Keyword&&this.strValue=="as"}isKeywordNull(){return this.type==d.Keyword&&this.strValue=="null"}isKeywordUndefined(){return this.type==d.Keyword&&this.strValue=="undefined"}isKeywordTrue(){return this.type==d.Keyword&&this.strValue=="true"}isKeywordFalse(){return this.type==d.Keyword&&this.strValue=="false"}isKeywordThis(){return this.type==d.Keyword&&this.strValue=="this"}isError(){return this.type==d.Error}toNumber(){return this.type==d.Number?this.numValue:-1}toString(){switch(this.type){case d.Character:case d.Identifier:case d.Keyword:case d.Operator:case d.PrivateIdentifier:case d.String:case d.Error:return this.strValue;case d.Number:return this.numValue.toString();default:return null}}};function pt(r,e,t){return new O(r,e,d.Character,t,String.fromCharCode(t))}function Er(r,e,t){return new O(r,e,d.Identifier,0,t)}function Cr(r,e,t){return new O(r,e,d.PrivateIdentifier,0,t)}function Ar(r,e,t){return new O(r,e,d.Keyword,0,t)}function _e(r,e,t){return new O(r,e,d.Operator,0,t)}function $r(r,e,t){return new O(r,e,d.String,0,t)}function Or(r,e,t){return new O(r,e,d.Number,t,"")}function Ir(r,e,t){return new O(r,e,d.Error,0,t)}var Ie=new O(-1,-1,d.Character,0,""),Me=class{constructor(e){this.input=e,this.peek=0,this.index=-1,this.length=e.length,this.advance()}advance(){this.peek=++this.index>=this.length?0:this.input.charCodeAt(this.index)}scanToken(){let e=this.input,t=this.length,s=this.peek,n=this.index;for(;s<=32;)if(++n>=t){s=0;break}else s=e.charCodeAt(n);if(this.peek=s,this.index=n,n>=t)return null;if(ut(s))return this.scanIdentifier();if(b(s))return this.scanNumber(n);let i=n;switch(s){case 46:return this.advance(),b(this.peek)?this.scanNumber(i):pt(i,this.index,46);case 40:case 41:case 123:case 125:case 91:case 93:case 44:case 58:case 59:return this.scanCharacter(i,s);case 39:case 34:return this.scanString();case 35:return this.scanPrivateIdentifier();case 43:case 45:case 42:case 47:case 37:case 94:return this.scanOperator(i,String.fromCharCode(s));case 63:return this.scanQuestion(i);case 60:case 62:return this.scanComplexOperator(i,String.fromCharCode(s),61,"=");case 33:case 61:return this.scanComplexOperator(i,String.fromCharCode(s),61,"=",61,"=");case 38:return this.scanComplexOperator(i,"&",38,"&");case 124:return this.scanComplexOperator(i,"|",124,"|");case 160:for(;nt(this.peek);)this.advance();return this.scanToken()}return this.advance(),this.error(`Unexpected character [${String.fromCharCode(s)}]`,0)}scanCharacter(e,t){return this.advance(),pt(e,this.index,t)}scanOperator(e,t){return this.advance(),_e(e,this.index,t)}scanComplexOperator(e,t,s,n,i,a){this.advance();let h=t;return this.peek==s&&(this.advance(),h+=n),i!=null&&this.peek==i&&(this.advance(),h+=a),_e(e,this.index,h)}scanIdentifier(){let e=this.index;for(this.advance();lt(this.peek);)this.advance();let t=this.input.substring(e,this.index);return yr.indexOf(t)>-1?Ar(e,this.index,t):Er(e,this.index,t)}scanPrivateIdentifier(){let e=this.index;if(this.advance(),!ut(this.peek))return this.error("Invalid character [#]",-1);for(;lt(this.peek);)this.advance();let t=this.input.substring(e,this.index);return Cr(e,this.index,t)}scanNumber(e){let t=this.index===e,s=!1;for(this.advance();;){if(!b(this.peek))if(this.peek===95){if(!b(this.input.charCodeAt(this.index-1))||!b(this.input.charCodeAt(this.index+1)))return this.error("Invalid numeric separator",0);s=!0}else if(this.peek===46)t=!1;else if(Nr(this.peek)){if(this.advance(),kr(this.peek)&&this.advance(),!b(this.peek))return this.error("Invalid exponent",-1);t=!1}else break;this.advance()}let n=this.input.substring(e,this.index);s&&(n=n.replace(/_/g,""));let i=t?Rr(n):parseFloat(n);return Or(e,this.index,i)}scanString(){let e=this.index,t=this.peek;this.advance();let s="",n=this.index,i=this.input;for(;this.peek!=t;)if(this.peek==92){s+=i.substring(n,this.index);let h;if(this.advance(),this.peek==117){let g=i.substring(this.index+1,this.index+5);if(/^[0-9a-f]+$/i.test(g))h=parseInt(g,16);else return this.error(`Invalid unicode escape [\\u${g}]`,0);for(let f=0;f<5;f++)this.advance()}else h=Pr(this.peek),this.advance();s+=String.fromCharCode(h),n=this.index}else{if(this.peek==0)return this.error("Unterminated quote",0);this.advance()}let a=i.substring(n,this.index);return this.advance(),$r(e,this.index,s+a)}scanQuestion(e){this.advance();let t="?";return(this.peek===63||this.peek===46)&&(t+=this.peek===46?".":"?",this.advance()),_e(e,this.index,t)}error(e,t){let s=this.index+t;return Ir(s,this.index,`Lexer Error: ${e} at column ${s} in expression [${this.input}]`)}};function ut(r){return 97<=r&&r<=122||65<=r&&r<=90||r==95||r==36}function lt(r){return it(r)||b(r)||r==95||r==36}function Nr(r){return r==101||r==69}function kr(r){return r==45||r==43}function Pr(r){switch(r){case 110:return 10;case 102:return 12;case 114:return 13;case 116:return 9;case 118:return 11;default:return r}}function Rr(r){let e=parseInt(r);if(isNaN(e))throw new Error("Invalid integer literal when parsing "+r);return e}var Lr=[/^\s*$/,/[<>]/,/^[{}]$/,/&(#|[a-z])/i,/^\/\//];function vt(r,e){if(e!=null&&!(Array.isArray(e)&&e.length==2))throw new Error(`Expected '${r}' to be an array, [start, end].`);if(e!=null){let t=e[0],s=e[1];Lr.forEach(n=>{if(n.test(t)||n.test(s))throw new Error(`['${t}', '${s}'] contains unusable interpolation symbol.`)})}}var Ue=class r{static fromArray(e){return e?(vt("interpolation",e),new r(e[0],e[1])):F}constructor(e,t){this.start=e,this.end=t}},F=new Ue("{{","}}");var Ge=class{constructor(e,t,s){this.strings=e,this.expressions=t,this.offsets=s}},De=class{constructor(e,t,s){this.templateBindings=e,this.warnings=t,this.errors=s}},fe=class{constructor(e){this._lexer=e,this.errors=[]}parseAction(e,t,s,n,i=F){this._checkNoInterpolation(e,s,i);let a=this._stripComments(e),h=this._lexer.tokenize(a),g=1;t&&(g|=2);let f=new U(e,s,n,h,g,this.errors,0).parseChain();return new P(f,e,s,n,this.errors)}parseBinding(e,t,s,n=F){let i=this._parseBindingAst(e,t,s,n);return new P(i,e,t,s,this.errors)}checkSimpleExpression(e){let t=new Ve;return e.visit(t),t.errors}parseSimpleBinding(e,t,s,n=F){let i=this._parseBindingAst(e,t,s,n),a=this.checkSimpleExpression(i);return a.length>0&&this._reportError(`Host binding expression cannot contain ${a.join(" ")}`,e,t),new P(i,e,t,s,this.errors)}_reportError(e,t,s,n){this.errors.push(new D(e,t,s,n))}_parseBindingAst(e,t,s,n){this._checkNoInterpolation(e,t,n);let i=this._stripComments(e),a=this._lexer.tokenize(i);return new U(e,t,s,a,0,this.errors,0).parseChain()}parseTemplateBindings(e,t,s,n,i){let a=this._lexer.tokenize(t);return new U(t,s,i,a,0,this.errors,0).parseTemplateBindings({source:e,span:new N(n,n+e.length)})}parseInterpolation(e,t,s,n,i=F){let{strings:a,expressions:h,offsets:g}=this.splitInterpolation(e,t,n,i);if(h.length===0)return null;let f=[];for(let y=0;y<h.length;++y){let E=h[y].text,m=this._stripComments(E),o=this._lexer.tokenize(m),u=new U(e,t,s,o,0,this.errors,g[y]).parseChain();f.push(u)}return this.createInterpolationAst(a.map(y=>y.text),f,e,t,s)}parseInterpolationExpression(e,t,s){let n=this._stripComments(e),i=this._lexer.tokenize(n),a=new U(e,t,s,i,0,this.errors,0).parseChain(),h=["",""];return this.createInterpolationAst(h,[a],e,t,s)}createInterpolationAst(e,t,s,n,i){let a=new R(0,s.length),h=new Ee(a,a.toAbsolute(i),e,t);return new P(h,s,n,i,this.errors)}splitInterpolation(e,t,s,n=F){let i=[],a=[],h=[],g=s?br(s):null,f=0,y=!1,E=!1,{start:m,end:o}=n;for(;f<e.length;)if(y){let u=f,v=u+m.length,c=this._getInterpolationEndIndex(e,o,v);if(c===-1){y=!1,E=!0;break}let x=c+o.length,l=e.substring(v,c);l.trim().length===0&&this._reportError("Blank expressions are not allowed in interpolated strings",e,`at column ${f} in`,t),a.push({text:l,start:u,end:x});let k=((g==null?void 0:g.get(u))??u)+m.length;h.push(k),f=x,y=!1}else{let u=f;f=e.indexOf(m,f),f===-1&&(f=e.length);let v=e.substring(u,f);i.push({text:v,start:u,end:f}),y=!0}if(!y)if(E){let u=i[i.length-1];u.text+=e.substring(f),u.end=e.length}else i.push({text:e.substring(f),start:f,end:e.length});return new Ge(i,a,h)}wrapLiteralPrimitive(e,t,s){let n=new R(0,e==null?0:e.length);return new P(new A(n,n.toAbsolute(s),e),e,t,s,this.errors)}_stripComments(e){let t=this._commentStart(e);return t!=null?e.substring(0,t):e}_commentStart(e){let t=null;for(let s=0;s<e.length-1;s++){let n=e.charCodeAt(s),i=e.charCodeAt(s+1);if(n===47&&i==47&&t==null)return s;t===n?t=null:t==null&&Be(n)&&(t=n)}return null}_checkNoInterpolation(e,t,{start:s,end:n}){let i=-1,a=-1;for(let h of this._forEachUnquotedChar(e,0))if(i===-1)e.startsWith(s)&&(i=h);else if(a=this._getInterpolationEndIndex(e,n,h),a>-1)break;i>-1&&a>-1&&this._reportError(`Got interpolation (${s}${n}) where expression was expected`,e,`at column ${i} in`,t)}_getInterpolationEndIndex(e,t,s){for(let n of this._forEachUnquotedChar(e,s)){if(e.startsWith(t,n))return n;if(e.startsWith("//",n))return e.indexOf(t,n)}return-1}*_forEachUnquotedChar(e,t){let s=null,n=0;for(let i=t;i<e.length;i++){let a=e[i];Be(e.charCodeAt(i))&&(s===null||s===a)&&n%2===0?s=s===null?a:null:s===null&&(yield i),n=a==="\\"?n+1:0}}},pe;(function(r){r[r.None=0]="None",r[r.Writable=1]="Writable"})(pe||(pe={}));var U=class{constructor(e,t,s,n,i,a,h){this.input=e,this.location=t,this.absoluteOffset=s,this.tokens=n,this.parseFlags=i,this.errors=a,this.offset=h,this.rparensExpected=0,this.rbracketsExpected=0,this.rbracesExpected=0,this.context=pe.None,this.sourceSpanCache=new Map,this.index=0}peek(e){let t=this.index+e;return t<this.tokens.length?this.tokens[t]:Ie}get next(){return this.peek(0)}get atEOF(){return this.index>=this.tokens.length}get inputIndex(){return this.atEOF?this.currentEndIndex:this.next.index+this.offset}get currentEndIndex(){return this.index>0?this.peek(-1).end+this.offset:this.tokens.length===0?this.input.length+this.offset:this.next.index+this.offset}get currentAbsoluteOffset(){return this.absoluteOffset+this.inputIndex}span(e,t){let s=this.currentEndIndex;if(t!==void 0&&t>this.currentEndIndex&&(s=t),e>s){let n=s;s=e,e=n}return new R(e,s)}sourceSpan(e,t){let s=`${e}@${this.inputIndex}:${t}`;return this.sourceSpanCache.has(s)||this.sourceSpanCache.set(s,this.span(e,t).toAbsolute(this.absoluteOffset)),this.sourceSpanCache.get(s)}advance(){this.index++}withContext(e,t){this.context|=e;let s=t();return this.context^=e,s}consumeOptionalCharacter(e){return this.next.isCharacter(e)?(this.advance(),!0):!1}peekKeywordLet(){return this.next.isKeywordLet()}peekKeywordAs(){return this.next.isKeywordAs()}expectCharacter(e){this.consumeOptionalCharacter(e)||this.error(`Missing expected ${String.fromCharCode(e)}`)}consumeOptionalOperator(e){return this.next.isOperator(e)?(this.advance(),!0):!1}expectOperator(e){this.consumeOptionalOperator(e)||this.error(`Missing expected operator ${e}`)}prettyPrintToken(e){return e===Ie?"end of input":`token ${e}`}expectIdentifierOrKeyword(){let e=this.next;return!e.isIdentifier()&&!e.isKeyword()?(e.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(e,"expected identifier or keyword"):this.error(`Unexpected ${this.prettyPrintToken(e)}, expected identifier or keyword`),null):(this.advance(),e.toString())}expectIdentifierOrKeywordOrString(){let e=this.next;return!e.isIdentifier()&&!e.isKeyword()&&!e.isString()?(e.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(e,"expected identifier, keyword or string"):this.error(`Unexpected ${this.prettyPrintToken(e)}, expected identifier, keyword, or string`),""):(this.advance(),e.toString())}parseChain(){let e=[],t=this.inputIndex;for(;this.index<this.tokens.length;){let s=this.parsePipe();if(e.push(s),this.consumeOptionalCharacter(59))for(this.parseFlags&1||this.error("Binding expression cannot contain chained expression");this.consumeOptionalCharacter(59););else if(this.index<this.tokens.length){let n=this.index;if(this.error(`Unexpected token '${this.next}'`),this.index===n)break}}if(e.length===0){let s=this.offset,n=this.offset+this.input.length;return new C(this.span(s,n),this.sourceSpan(s,n))}return e.length==1?e[0]:new W(this.span(t),this.sourceSpan(t),e)}parsePipe(){let e=this.inputIndex,t=this.parseExpression();if(this.consumeOptionalOperator("|")){this.parseFlags&1&&this.error("Cannot have a pipe in an action expression");do{let s=this.inputIndex,n=this.expectIdentifierOrKeyword(),i,a;n!==null?i=this.sourceSpan(s):(n="",a=this.next.index!==-1?this.next.index:this.input.length+this.offset,i=new R(a,a).toAbsolute(this.absoluteOffset));let h=[];for(;this.consumeOptionalCharacter(58);)h.push(this.parseExpression());t=new Z(this.span(e),this.sourceSpan(e,a),t,n,h,i)}while(this.consumeOptionalOperator("|"))}return t}parseExpression(){return this.parseConditional()}parseConditional(){let e=this.inputIndex,t=this.parseLogicalOr();if(this.consumeOptionalOperator("?")){let s=this.parsePipe(),n;if(this.consumeOptionalCharacter(58))n=this.parsePipe();else{let i=this.inputIndex,a=this.input.substring(e,i);this.error(`Conditional expression ${a} requires all 3 expressions`),n=new C(this.span(e),this.sourceSpan(e))}return new Q(this.span(e),this.sourceSpan(e),t,s,n)}else return t}parseLogicalOr(){let e=this.inputIndex,t=this.parseLogicalAnd();for(;this.consumeOptionalOperator("||");){let s=this.parseLogicalAnd();t=new $(this.span(e),this.sourceSpan(e),"||",t,s)}return t}parseLogicalAnd(){let e=this.inputIndex,t=this.parseNullishCoalescing();for(;this.consumeOptionalOperator("&&");){let s=this.parseNullishCoalescing();t=new $(this.span(e),this.sourceSpan(e),"&&",t,s)}return t}parseNullishCoalescing(){let e=this.inputIndex,t=this.parseEquality();for(;this.consumeOptionalOperator("??");){let s=this.parseEquality();t=new $(this.span(e),this.sourceSpan(e),"??",t,s)}return t}parseEquality(){let e=this.inputIndex,t=this.parseRelational();for(;this.next.type==d.Operator;){let s=this.next.strValue;switch(s){case"==":case"===":case"!=":case"!==":this.advance();let n=this.parseRelational();t=new $(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parseRelational(){let e=this.inputIndex,t=this.parseAdditive();for(;this.next.type==d.Operator;){let s=this.next.strValue;switch(s){case"<":case">":case"<=":case">=":this.advance();let n=this.parseAdditive();t=new $(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parseAdditive(){let e=this.inputIndex,t=this.parseMultiplicative();for(;this.next.type==d.Operator;){let s=this.next.strValue;switch(s){case"+":case"-":this.advance();let n=this.parseMultiplicative();t=new $(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parseMultiplicative(){let e=this.inputIndex,t=this.parsePrefix();for(;this.next.type==d.Operator;){let s=this.next.strValue;switch(s){case"*":case"%":case"/":this.advance();let n=this.parsePrefix();t=new $(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parsePrefix(){if(this.next.type==d.Operator){let e=this.inputIndex,t=this.next.strValue,s;switch(t){case"+":return this.advance(),s=this.parsePrefix(),B.createPlus(this.span(e),this.sourceSpan(e),s);case"-":return this.advance(),s=this.parsePrefix(),B.createMinus(this.span(e),this.sourceSpan(e),s);case"!":return this.advance(),s=this.parsePrefix(),new ee(this.span(e),this.sourceSpan(e),s)}}return this.parseCallChain()}parseCallChain(){let e=this.inputIndex,t=this.parsePrimary();for(;;)if(this.consumeOptionalCharacter(46))t=this.parseAccessMember(t,e,!1);else if(this.consumeOptionalOperator("?."))this.consumeOptionalCharacter(40)?t=this.parseCall(t,e,!0):t=this.consumeOptionalCharacter(91)?this.parseKeyedReadOrWrite(t,e,!0):this.parseAccessMember(t,e,!0);else if(this.consumeOptionalCharacter(91))t=this.parseKeyedReadOrWrite(t,e,!1);else if(this.consumeOptionalCharacter(40))t=this.parseCall(t,e,!1);else if(this.consumeOptionalOperator("!"))t=new te(this.span(e),this.sourceSpan(e),t);else return t}parsePrimary(){let e=this.inputIndex;if(this.consumeOptionalCharacter(40)){this.rparensExpected++;let t=this.parsePipe();return this.rparensExpected--,this.expectCharacter(41),t}else{if(this.next.isKeywordNull())return this.advance(),new A(this.span(e),this.sourceSpan(e),null);if(this.next.isKeywordUndefined())return this.advance(),new A(this.span(e),this.sourceSpan(e),void 0);if(this.next.isKeywordTrue())return this.advance(),new A(this.span(e),this.sourceSpan(e),!0);if(this.next.isKeywordFalse())return this.advance(),new A(this.span(e),this.sourceSpan(e),!1);if(this.next.isKeywordThis())return this.advance(),new ye(this.span(e),this.sourceSpan(e));if(this.consumeOptionalCharacter(91)){this.rbracketsExpected++;let t=this.parseExpressionList(93);return this.rbracketsExpected--,this.expectCharacter(93),new J(this.span(e),this.sourceSpan(e),t)}else{if(this.next.isCharacter(123))return this.parseLiteralMap();if(this.next.isIdentifier())return this.parseAccessMember(new L(this.span(e),this.sourceSpan(e)),e,!1);if(this.next.isNumber()){let t=this.next.toNumber();return this.advance(),new A(this.span(e),this.sourceSpan(e),t)}else if(this.next.isString()){let t=this.next.toString();return this.advance(),new A(this.span(e),this.sourceSpan(e),t)}else return this.next.isPrivateIdentifier()?(this._reportErrorForPrivateIdentifier(this.next,null),new C(this.span(e),this.sourceSpan(e))):this.index>=this.tokens.length?(this.error(`Unexpected end of expression: ${this.input}`),new C(this.span(e),this.sourceSpan(e))):(this.error(`Unexpected token ${this.next}`),new C(this.span(e),this.sourceSpan(e)))}}}parseExpressionList(e){let t=[];do if(!this.next.isCharacter(e))t.push(this.parsePipe());else break;while(this.consumeOptionalCharacter(44));return t}parseLiteralMap(){let e=[],t=[],s=this.inputIndex;if(this.expectCharacter(123),!this.consumeOptionalCharacter(125)){this.rbracesExpected++;do{let n=this.inputIndex,i=this.next.isString(),a=this.expectIdentifierOrKeywordOrString();if(e.push({key:a,quoted:i}),i)this.expectCharacter(58),t.push(this.parsePipe());else if(this.consumeOptionalCharacter(58))t.push(this.parsePipe());else{let h=this.span(n),g=this.sourceSpan(n);t.push(new K(h,g,g,new L(h,g),a))}}while(this.consumeOptionalCharacter(44)&&!this.next.isCharacter(125));this.rbracesExpected--,this.expectCharacter(125)}return new Y(this.span(s),this.sourceSpan(s),e,t)}parseAccessMember(e,t,s){let n=this.inputIndex,i=this.withContext(pe.Writable,()=>{let g=this.expectIdentifierOrKeyword()??"";return g.length===0&&this.error("Expected identifier for property access",e.span.end),g}),a=this.sourceSpan(n),h;if(s)this.consumeOptionalAssignment()?(this.error("The '?.' operator cannot be used in the assignment"),h=new C(this.span(t),this.sourceSpan(t))):h=new z(this.span(t),this.sourceSpan(t),a,e,i);else if(this.consumeOptionalAssignment()){if(!(this.parseFlags&1))return this.error("Bindings cannot contain assignments"),new C(this.span(t),this.sourceSpan(t));let g=this.parseConditional();h=new H(this.span(t),this.sourceSpan(t),a,e,i,g)}else h=new K(this.span(t),this.sourceSpan(t),a,e,i);return h}parseCall(e,t,s){let n=this.inputIndex;this.rparensExpected++;let i=this.parseCallArguments(),a=this.span(n,this.inputIndex).toAbsolute(this.absoluteOffset);this.expectCharacter(41),this.rparensExpected--;let h=this.span(t),g=this.sourceSpan(t);return s?new se(h,g,e,i,a):new re(h,g,e,i,a)}consumeOptionalAssignment(){return this.parseFlags&2&&this.next.isOperator("!")&&this.peek(1).isOperator("=")?(this.advance(),this.advance(),!0):this.consumeOptionalOperator("=")}parseCallArguments(){if(this.next.isCharacter(41))return[];let e=[];do e.push(this.parsePipe());while(this.consumeOptionalCharacter(44));return e}expectTemplateBindingKey(){let e="",t=!1,s=this.currentAbsoluteOffset;do e+=this.expectIdentifierOrKeywordOrString(),t=this.consumeOptionalOperator("-"),t&&(e+="-");while(t);return{source:e,span:new N(s,s+e.length)}}parseTemplateBindings(e){let t=[];for(t.push(...this.parseDirectiveKeywordBindings(e));this.index<this.tokens.length;){let s=this.parseLetBinding();if(s)t.push(s);else{let n=this.expectTemplateBindingKey(),i=this.parseAsBinding(n);i?t.push(i):(n.source=e.source+n.source.charAt(0).toUpperCase()+n.source.substring(1),t.push(...this.parseDirectiveKeywordBindings(n)))}this.consumeStatementTerminator()}return new De(t,[],this.errors)}parseKeyedReadOrWrite(e,t,s){return this.withContext(pe.Writable,()=>{this.rbracketsExpected++;let n=this.parsePipe();if(n instanceof C&&this.error("Key access cannot be empty"),this.rbracketsExpected--,this.expectCharacter(93),this.consumeOptionalOperator("="))if(s)this.error("The '?.' operator cannot be used in the assignment");else{let i=this.parseConditional();return new X(this.span(t),this.sourceSpan(t),e,n,i)}else return s?new j(this.span(t),this.sourceSpan(t),e,n):new q(this.span(t),this.sourceSpan(t),e,n);return new C(this.span(t),this.sourceSpan(t))})}parseDirectiveKeywordBindings(e){let t=[];this.consumeOptionalCharacter(58);let s=this.getDirectiveBoundTarget(),n=this.currentAbsoluteOffset,i=this.parseAsBinding(e);i||(this.consumeStatementTerminator(),n=this.currentAbsoluteOffset);let a=new N(e.span.start,n);return t.push(new ne(a,e,s)),i&&t.push(i),t}getDirectiveBoundTarget(){if(this.next===Ie||this.peekKeywordAs()||this.peekKeywordLet())return null;let e=this.parsePipe(),{start:t,end:s}=e.span,n=this.input.substring(t,s);return new P(e,n,this.location,this.absoluteOffset+t,this.errors)}parseAsBinding(e){if(!this.peekKeywordAs())return null;this.advance();let t=this.expectTemplateBindingKey();this.consumeStatementTerminator();let s=new N(e.span.start,this.currentAbsoluteOffset);return new T(s,t,e)}parseLetBinding(){if(!this.peekKeywordLet())return null;let e=this.currentAbsoluteOffset;this.advance();let t=this.expectTemplateBindingKey(),s=null;this.consumeOptionalOperator("=")&&(s=this.expectTemplateBindingKey()),this.consumeStatementTerminator();let n=new N(e,this.currentAbsoluteOffset);return new T(n,t,s)}consumeStatementTerminator(){this.consumeOptionalCharacter(59)||this.consumeOptionalCharacter(44)}error(e,t=null){this.errors.push(new D(e,this.input,this.locationText(t),this.location)),this.skip()}locationText(e=null){return e==null&&(e=this.index),e<this.tokens.length?`at column ${this.tokens[e].index+1} in`:"at the end of the expression"}_reportErrorForPrivateIdentifier(e,t){let s=`Private identifiers are not supported. Unexpected private identifier: ${e}`;t!==null&&(s+=`, ${t}`),this.error(s)}skip(){let e=this.next;for(;this.index<this.tokens.length&&!e.isCharacter(59)&&!e.isOperator("|")&&(this.rparensExpected<=0||!e.isCharacter(41))&&(this.rbracesExpected<=0||!e.isCharacter(125))&&(this.rbracketsExpected<=0||!e.isCharacter(93))&&(!(this.context&pe.Writable)||!e.isOperator("="));)this.next.isError()&&this.errors.push(new D(this.next.toString(),this.input,this.locationText(),this.location)),this.advance(),e=this.next}},Ve=class extends Ce{constructor(){super(...arguments),this.errors=[]}visitPipe(){this.errors.push("pipes")}};function br(r){let e=new Map,t=0,s=0,n=0;for(;n<r.length;){let i=r[n];if(i.type===9){let[a,h]=i.parts;t+=h.length,s+=a.length}else{let a=i.parts.reduce((h,g)=>h+g.length,0);s+=a,t+=a}e.set(s,t),n++}return e}var mt="angular-estree-parser",Qe="NgEstreeParser",We=0,Ne=[mt,We];function St(){return new fe(new le)}function ke(r,e){let t=St(),{astInput:s,comments:n}=Br(r,t),{ast:i,errors:a}=e(s,t);return $t(a),{ast:i,comments:n}}function wt(r){return ke(r,(e,t)=>t.parseBinding(e,...Ne))}function yt(r){return ke(r,(e,t)=>t.parseSimpleBinding(e,...Ne))}function Et(r){return ke(r,(e,t)=>t.parseAction(e,!1,...Ne))}function Ct(r){return ke(r,(e,t)=>{let s=t.parseInterpolationExpression(e,...Ne);return s.ast=s.ast.expressions[0],s})}function At(r){let e=St(),{templateBindings:t,errors:s}=e.parseTemplateBindings(Qe,r,mt,We,We);return $t(s),t}function $t(r){if(r.length!==0){let[{message:e}]=r;throw new SyntaxError(e.replace(/^Parser Error: | at column \d+ in [^]*$/g,""))}}function Br(r,e){let t=e._commentStart(r);return t===null?{astInput:r,comments:[]}:{astInput:r.slice(0,t),comments:[{type:"Comment",value:r.slice(t+2),sourceSpan:{start:t,end:r.length}}]}}function Ot(r){return r instanceof B?"Unary":r instanceof $?"Binary":r instanceof Z?"BindingPipe":r instanceof re?"Call":r instanceof W?"Chain":r instanceof Q?"Conditional":r instanceof C?"EmptyExpr":r instanceof L?"ImplicitReceiver":r instanceof q?"KeyedRead":r instanceof j?"SafeKeyedRead":r instanceof X?"KeyedWrite":r instanceof J?"LiteralArray":r instanceof Y?"LiteralMap":r instanceof A?"LiteralPrimitive":r instanceof te?"NonNullAssert":r instanceof ee?"PrefixNot":r instanceof K?"PropertyRead":r instanceof H?"PropertyWrite":r instanceof se?"SafeCall":r instanceof z?"SafePropertyRead":r.type}function gt({start:r,end:e},t){let s=r,n=e;for(;n!==s&&/\s/.test(t[n-1]);)n--;for(;s!==n&&/\s/.test(t[s]);)s++;return{start:s,end:n}}function Tr({start:r,end:e},t){let s=r,n=e;for(;n!==t.length&&/\s/.test(t[n]);)n++;for(;s!==0&&/\s/.test(t[s-1]);)s--;return{start:s,end:n}}function _r(r,e){return e[r.start-1]==="("&&e[r.end]===")"?{start:r.start-1,end:r.end+1}:r}function It(r,e,t){let s=0,n={start:r.start,end:r.end};for(;;){let i=Tr(n,e),a=_r(i,e);if(i.start===a.start&&i.end===a.end)break;n.start=a.start,n.end=a.end,s++}return{hasParens:(t?s-1:s)!==0,outerSpan:gt(t?{start:n.start+1,end:n.end-1}:n,e),innerSpan:gt(r,e)}}function Nt(r){return typeof r=="string"?e=>e===r:e=>r.test(e)}function kt(r,e,t){let s=Nt(e);for(let n=t;n>=0;n--){let i=r[n];if(s(i))return n}throw new Error(`Cannot find front char ${e} from index ${t} in ${JSON.stringify(r)}`)}function Pt(r,e,t){let s=Nt(e);for(let n=t;n<r.length;n++){let i=r[n];if(s(i))return n}throw new Error(`Cannot find character ${e} from index ${t} in ${JSON.stringify(r)}`)}function Rt(r){return r.slice(0,1).toLowerCase()+r.slice(1)}var ge,ve=class{constructor(e){Ze(this,"text");Ye(this,ge,void 0);this.text=e}locationForIndex(e){Ke(this,ge)??et(this,ge,new rt(this.text));let{line:t,column:s}=Ke(this,ge).locationForIndex(e);return{line:t+1,column:s,index:e}}getCharacterIndex(e,t){return Pt(this.text,e,t)}getCharacterLastIndex(e,t){return kt(this.text,e,t)}};ge=new WeakMap;var Mr=(r,e,t)=>{if(!(r&&e==null))return Array.isArray(e)||typeof e=="string"?e[t<0?e.length+t:t]:e.at(t)},Pe=Mr;var G=(r,e,t=!1)=>{let s=Ot(r);switch(s){case"Unary":{let{operator:o,expr:u}=r,v=n(u);return a("UnaryExpression",{prefix:!0,argument:v,operator:o},r.sourceSpan,{hasParentParens:t})}case"Binary":{let{left:o,operation:u,right:v}=r,c=n(o),x=n(v);return a(u==="&&"||u==="||"||u==="??"?"LogicalExpression":"BinaryExpression",{left:c,right:x,operator:u},{start:E(c),end:m(x)},{hasParentParens:t})}case"BindingPipe":{let{exp:o,name:u,args:v}=r,c=n(o),x=e.getCharacterIndex(/\S/,e.getCharacterIndex("|",m(c))+1),l=a("Identifier",{name:u},{start:x,end:x+u.length}),p=v.map(n);return a("NGPipeExpression",{left:c,right:l,arguments:p},{start:E(c),end:m(p.length===0?l:Pe(!1,p,-1))},{hasParentParens:t})}case"Chain":{let{expressions:o}=r;return a("NGChainedExpression",{expressions:o.map(n)},r.sourceSpan,{hasParentParens:t})}case"Comment":{let{value:o}=r;return a("CommentLine",{value:o},r.sourceSpan,{processSpan:!1})}case"Conditional":{let{condition:o,trueExp:u,falseExp:v}=r,c=n(o),x=n(u),l=n(v);return a("ConditionalExpression",{test:c,consequent:x,alternate:l},{start:E(c),end:m(l)},{hasParentParens:t})}case"EmptyExpr":return a("NGEmptyExpression",{},r.sourceSpan,{hasParentParens:t});case"ImplicitReceiver":return a("ThisExpression",{},r.sourceSpan,{hasParentParens:t});case"KeyedRead":case"SafeKeyedRead":{let o=s==="SafeKeyedRead",{key:u}=r,v=Object.prototype.hasOwnProperty.call(r,"receiver")?r.receiver:r.obj,c=n(u);return h(v,c,{computed:!0,optional:o},{end:r.sourceSpan.end,hasParentParens:t})}case"LiteralArray":{let{expressions:o}=r;return a("ArrayExpression",{elements:o.map(n)},r.sourceSpan,{hasParentParens:t})}case"LiteralMap":{let{keys:o,values:u}=r,v=u.map(x=>n(x)),c=o.map(({key:x,quoted:l},p)=>{let k=v[p],S=E(k),I=m(k),ue=e.getCharacterIndex(/\S/,p===0?r.sourceSpan.start+1:e.getCharacterIndex(",",m(v[p-1]))+1),Mt=S===ue?I:e.getCharacterLastIndex(/\S/,e.getCharacterLastIndex(":",S-1)-1)+1,je={start:ue,end:Mt},me=l?a("StringLiteral",{value:x},je):a("Identifier",{name:x},je),Ft=me.end<me.start||ue===S;return a("ObjectProperty",{key:me,value:k,shorthand:Ft,computed:!1},{start:E(me),end:I})});return a("ObjectExpression",{properties:c},r.sourceSpan,{hasParentParens:t})}case"LiteralPrimitive":{let{value:o}=r;switch(typeof o){case"boolean":return a("BooleanLiteral",{value:o},r.sourceSpan,{hasParentParens:t});case"number":return a("NumericLiteral",{value:o},r.sourceSpan,{hasParentParens:t});case"object":return a("NullLiteral",{},r.sourceSpan,{hasParentParens:t});case"string":return a("StringLiteral",{value:o},r.sourceSpan,{hasParentParens:t});case"undefined":return a("Identifier",{name:"undefined"},r.sourceSpan,{hasParentParens:t});default:throw new Error(`Unexpected LiteralPrimitive value type ${typeof o}`)}}case"Call":case"SafeCall":{let o=s==="SafeCall",{receiver:u,args:v}=r,c=v.length===1?[i(v[0])]:v.map(n),x=n(u),l=f(x),p=o||l?"OptionalCallExpression":"CallExpression";return a(p,{callee:x,arguments:c,optional:p==="OptionalCallExpression"?o:void 0},{start:E(x),end:r.sourceSpan.end},{hasParentParens:t})}case"NonNullAssert":{let{expression:o}=r,u=n(o);return a("TSNonNullExpression",{expression:u},{start:E(u),end:r.sourceSpan.end},{hasParentParens:t})}case"PrefixNot":{let{expression:o}=r,u=n(o);return a("UnaryExpression",{prefix:!0,operator:"!",argument:u},{start:r.sourceSpan.start,end:m(u)},{hasParentParens:t})}case"PropertyRead":case"SafePropertyRead":{let o=s==="SafePropertyRead",{receiver:u,name:v}=r,c=e.getCharacterLastIndex(/\S/,r.sourceSpan.end-1)+1,x=a("Identifier",{name:v},{start:c-v.length,end:c},g(u)?{hasParentParens:t}:{});return h(u,x,{computed:!1,optional:o},{hasParentParens:t})}case"KeyedWrite":{let{key:o,value:u}=r,v=Object.prototype.hasOwnProperty.call(r,"receiver")?r.receiver:r.obj,c=n(o),x=n(u),l=h(v,c,{computed:!0,optional:!1},{end:e.getCharacterIndex("]",m(c))+1});return a("AssignmentExpression",{left:l,operator:"=",right:x},{start:E(l),end:m(x)},{hasParentParens:t})}case"PropertyWrite":{let{receiver:o,name:u,value:v}=r,c=n(v),x=e.getCharacterLastIndex(/\S/,e.getCharacterLastIndex("=",E(c)-1)-1)+1,l=a("Identifier",{name:u},{start:x-u.length,end:x}),p=h(o,l,{computed:!1,optional:!1});return a("AssignmentExpression",{left:p,operator:"=",right:c},{start:E(p),end:m(c)},{hasParentParens:t})}default:throw new Error(`Unexpected node ${s}`)}function n(o){return G(o,e)}function i(o){return G(o,e,!0)}function a(o,u,v,{processSpan:c=!0,hasParentParens:x=!1}={}){let l={type:o,...Re(v,e,c,x),...u};switch(o){case"NumericLiteral":{let p=l;p.extra={...p.extra,raw:e.text.slice(p.start,p.end),rawValue:p.value};break}case"StringLiteral":{let p=l;p.extra={...p.extra,raw:e.text.slice(p.start,p.end),rawValue:p.value};break}case"ObjectProperty":{let p=l;p.shorthand&&(p.extra={...p.extra,shorthand:p.shorthand});break}}return l}function h(o,u,v,{end:c=m(u),hasParentParens:x=!1}={}){if(g(o)||o.sourceSpan.start===u.start)return u;let l=n(o),p=f(l);return a(v.optional||p?"OptionalMemberExpression":"MemberExpression",{object:l,property:u,computed:v.computed,...v.optional?{optional:!0}:p?{optional:!1}:null},{start:E(l),end:c},{hasParentParens:x})}function g(o){return o.sourceSpan.start>=o.sourceSpan.end||/^\s+$/.test(e.text.slice(o.sourceSpan.start,o.sourceSpan.end))}function f(o){return(o.type==="OptionalCallExpression"||o.type==="OptionalMemberExpression")&&!y(o)}function y(o){return o.extra&&o.extra.parenthesized}function E(o){return y(o)?o.extra.parenStart:o.start}function m(o){return y(o)?o.extra.parenEnd:o.end}};function Re(r,e,t=!1,s=!1){if(!t){let{start:h,end:g}=r;return{start:h,end:g,loc:{filename:"",identifierName:"",start:e.locationForIndex(h),end:e.locationForIndex(g)}}}let{outerSpan:n,innerSpan:i,hasParens:a}=It(r,e.text,s);return{start:i.start,end:i.end,loc:{filename:"",identifierName:"",start:e.locationForIndex(i.start),end:e.locationForIndex(i.end)},...a&&{extra:{parenthesized:!0,parenStart:n.start,parenEnd:n.end}}}}function Lt(r,e){r.forEach(o);let[t]=r,{key:s}=t,n=e.text.slice(t.sourceSpan.start,t.sourceSpan.end).trim().length===0?r.slice(1):r,i=[],a=null;for(let c=0;c<n.length;c++){let x=n[c];if(a&&E(a)&&m(x)&&x.value&&x.value.source===a.key.source){let l=f("NGMicrosyntaxKey",{name:x.key.source},x.key.span),p=(I,ue)=>({...I,...Re({start:I.start,end:ue},e)}),k=I=>({...p(I,l.end),alias:l}),S=i.pop();if(S.type==="NGMicrosyntaxExpression")i.push(k(S));else if(S.type==="NGMicrosyntaxKeyedExpression"){let I=k(S.expression);i.push(p({...S,expression:I},I.end))}else throw new Error(`Unexpected type ${S.type}`)}else i.push(h(x,c));a=x}return f("NGMicrosyntax",{body:i},i.length===0?r[0].sourceSpan:{start:i[0].start,end:Pe(!1,i,-1).end});function h(c,x){if(E(c)){let{key:l,value:p}=c;return p?x===0?f("NGMicrosyntaxExpression",{expression:g(p.ast),alias:null},p.sourceSpan):f("NGMicrosyntaxKeyedExpression",{key:f("NGMicrosyntaxKey",{name:y(l.source)},l.span),expression:f("NGMicrosyntaxExpression",{expression:g(p.ast),alias:null},p.sourceSpan)},{start:l.span.start,end:p.sourceSpan.end}):f("NGMicrosyntaxKey",{name:y(l.source)},l.span)}else{let{key:l,sourceSpan:p}=c;if(/^let\s$/.test(e.text.slice(p.start,p.start+4))){let{value:S}=c;return f("NGMicrosyntaxLet",{key:f("NGMicrosyntaxKey",{name:l.source},l.span),value:S?f("NGMicrosyntaxKey",{name:S.source},S.span):null},{start:p.start,end:S?S.span.end:l.span.end})}else{let S=v(c);return f("NGMicrosyntaxAs",{key:f("NGMicrosyntaxKey",{name:S.source},S.span),alias:f("NGMicrosyntaxKey",{name:l.source},l.span)},{start:S.span.start,end:l.span.end})}}}function g(c){return G(c,e)}function f(c,x,l,p=!0){return{type:c,...Re(l,e,p),...x}}function y(c){return Rt(c.slice(s.source.length))}function E(c){return c instanceof ne}function m(c){return c instanceof T}function o(c){u(c.key.span),m(c)&&c.value&&u(c.value.span)}function u(c){if(e.text[c.start]!=='"'&&e.text[c.start]!=="'")return;let x=e.text[c.start],l=!1;for(let p=c.start+1;p<e.text.length;p++)switch(e.text[p]){case x:if(!l){c.end=p+1;return}default:l=!1;break;case"\\":l=!l;break}}function v(c){if(!c.value||c.value.source!==Qe)return c.value;let x=e.getCharacterIndex(/\S/,c.sourceSpan.start);return{source:"$implicit",span:{start:x,end:x}}}}function Le(r){return e=>{let{ast:t,comments:s}=r(e),n=new ve(e),i=G(t,n);return i.comments=s.map(a=>G(a,n)),i}}var bt=Le(wt),As=Le(yt),Kt=Le(Ct),He=Le(Et),Bt=r=>Lt(At(r),new ve(r));function Fr(r){return Array.isArray(r)&&r.length>0}var Tt=Fr;function ze(r){var s;let e=r.range?r.range[0]:r.start,t=((s=r.declaration)==null?void 0:s.decorators)??r.decorators;return Tt(t)?Math.min(ze(t[0]),e):e}function _t(r){return r.range?r.range[1]:r.end}function be(r){return{astFormat:"estree",parse(e){let t=r(e);return{type:"NGRoot",node:r===He&&t.type!=="NGChainedExpression"?{...t,type:"NGChainedExpression",expressions:[t]}:t}},locStart:ze,locEnd:_t}}var Ur=be(He),Gr=be(bt),Dr=be(Kt),Vr=be(Bt);return Qt(Wr);});
1
+ (function(n){function e(){var i=n();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.angular=e()}})(function(){"use strict";var Re=Object.defineProperty;var Rt=Object.getOwnPropertyDescriptor;var Lt=Object.getOwnPropertyNames;var Kt=Object.prototype.hasOwnProperty;var ze=(r,e)=>{for(var t in e)Re(r,t,{get:e[t],enumerable:!0})},bt=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Lt(e))!Kt.call(r,n)&&n!==t&&Re(r,n,{get:()=>e[n],enumerable:!(s=Rt(e,n))||s.enumerable});return r};var Bt=r=>bt(Re({},"__esModule",{value:!0}),r);var br={};ze(br,{parsers:()=>Qe});var Qe={};ze(Qe,{__ng_action:()=>Pr,__ng_binding:()=>Rr,__ng_directive:()=>Kr,__ng_interpolation:()=>Lr});var D=class{constructor(e,t,s,n){this.input=t,this.errLocation=s,this.ctxLocation=n,this.message=`Parser Error: ${e} ${s} [${t}] in ${n}`}},R=class{constructor(e,t){this.start=e,this.end=t}toAbsolute(e){return new I(e+this.start,e+this.end)}},w=class{constructor(e,t){this.span=e,this.sourceSpan=t}toString(){return"AST"}},V=class extends w{constructor(e,t,s){super(e,t),this.nameSpan=s}},$=class extends w{visit(e,t=null){}},L=class extends w{visit(e,t=null){return e.visitImplicitReceiver(this,t)}},me=class extends L{visit(e,t=null){var s;return(s=e.visitThisReceiver)==null?void 0:s.call(e,this,t)}},W=class extends w{constructor(e,t,s){super(e,t),this.expressions=s}visit(e,t=null){return e.visitChain(this,t)}},Q=class extends w{constructor(e,t,s,n,i){super(e,t),this.condition=s,this.trueExp=n,this.falseExp=i}visit(e,t=null){return e.visitConditional(this,t)}},b=class extends V{constructor(e,t,s,n,i){super(e,t,s),this.receiver=n,this.name=i}visit(e,t=null){return e.visitPropertyRead(this,t)}},H=class extends V{constructor(e,t,s,n,i,a){super(e,t,s),this.receiver=n,this.name=i,this.value=a}visit(e,t=null){return e.visitPropertyWrite(this,t)}},z=class extends V{constructor(e,t,s,n,i){super(e,t,s),this.receiver=n,this.name=i}visit(e,t=null){return e.visitSafePropertyRead(this,t)}},q=class extends w{constructor(e,t,s,n){super(e,t),this.receiver=s,this.key=n}visit(e,t=null){return e.visitKeyedRead(this,t)}},j=class extends w{constructor(e,t,s,n){super(e,t),this.receiver=s,this.key=n}visit(e,t=null){return e.visitSafeKeyedRead(this,t)}},X=class extends w{constructor(e,t,s,n,i){super(e,t),this.receiver=s,this.key=n,this.value=i}visit(e,t=null){return e.visitKeyedWrite(this,t)}},Z=class extends V{constructor(e,t,s,n,i,a){super(e,t,a),this.exp=s,this.name=n,this.args=i}visit(e,t=null){return e.visitPipe(this,t)}},C=class extends w{constructor(e,t,s){super(e,t),this.value=s}visit(e,t=null){return e.visitLiteralPrimitive(this,t)}},J=class extends w{constructor(e,t,s){super(e,t),this.expressions=s}visit(e,t=null){return e.visitLiteralArray(this,t)}},Y=class extends w{constructor(e,t,s,n){super(e,t),this.keys=s,this.values=n}visit(e,t=null){return e.visitLiteralMap(this,t)}},Se=class extends w{constructor(e,t,s,n){super(e,t),this.strings=s,this.expressions=n}visit(e,t=null){return e.visitInterpolation(this,t)}},A=class extends w{constructor(e,t,s,n,i){super(e,t),this.operation=s,this.left=n,this.right=i}visit(e,t=null){return e.visitBinary(this,t)}},B=class r extends A{static createMinus(e,t,s){return new r(e,t,"-",s,"-",new C(e,t,0),s)}static createPlus(e,t,s){return new r(e,t,"+",s,"-",s,new C(e,t,0))}constructor(e,t,s,n,i,a,h){super(e,t,i,a,h),this.operator=s,this.expr=n,this.left=null,this.right=null,this.operation=null}visit(e,t=null){return e.visitUnary!==void 0?e.visitUnary(this,t):e.visitBinary(this,t)}},ee=class extends w{constructor(e,t,s){super(e,t),this.expression=s}visit(e,t=null){return e.visitPrefixNot(this,t)}},te=class extends w{constructor(e,t,s){super(e,t),this.expression=s}visit(e,t=null){return e.visitNonNullAssert(this,t)}},re=class extends w{constructor(e,t,s,n,i){super(e,t),this.receiver=s,this.args=n,this.argumentSpan=i}visit(e,t=null){return e.visitCall(this,t)}},se=class extends w{constructor(e,t,s,n,i){super(e,t),this.receiver=s,this.args=n,this.argumentSpan=i}visit(e,t=null){return e.visitSafeCall(this,t)}},I=class{constructor(e,t){this.start=e,this.end=t}},P=class extends w{constructor(e,t,s,n,i){super(new R(0,t===null?0:t.length),new I(n,t===null?n:n+t.length)),this.ast=e,this.source=t,this.location=s,this.errors=i}visit(e,t=null){return e.visitASTWithSource?e.visitASTWithSource(this,t):this.ast.visit(e,t)}toString(){return`${this.source} in ${this.location}`}},T=class{constructor(e,t,s){this.sourceSpan=e,this.key=t,this.value=s}},ne=class{constructor(e,t,s){this.sourceSpan=e,this.key=t,this.value=s}},we=class{visit(e,t){e.visit(this,t)}visitUnary(e,t){this.visit(e.expr,t)}visitBinary(e,t){this.visit(e.left,t),this.visit(e.right,t)}visitChain(e,t){this.visitAll(e.expressions,t)}visitConditional(e,t){this.visit(e.condition,t),this.visit(e.trueExp,t),this.visit(e.falseExp,t)}visitPipe(e,t){this.visit(e.exp,t),this.visitAll(e.args,t)}visitImplicitReceiver(e,t){}visitThisReceiver(e,t){}visitInterpolation(e,t){this.visitAll(e.expressions,t)}visitKeyedRead(e,t){this.visit(e.receiver,t),this.visit(e.key,t)}visitKeyedWrite(e,t){this.visit(e.receiver,t),this.visit(e.key,t),this.visit(e.value,t)}visitLiteralArray(e,t){this.visitAll(e.expressions,t)}visitLiteralMap(e,t){this.visitAll(e.values,t)}visitLiteralPrimitive(e,t){}visitPrefixNot(e,t){this.visit(e.expression,t)}visitNonNullAssert(e,t){this.visit(e.expression,t)}visitPropertyRead(e,t){this.visit(e.receiver,t)}visitPropertyWrite(e,t){this.visit(e.receiver,t),this.visit(e.value,t)}visitSafePropertyRead(e,t){this.visit(e.receiver,t)}visitSafeKeyedRead(e,t){this.visit(e.receiver,t),this.visit(e.key,t)}visitCall(e,t){this.visit(e.receiver,t),this.visitAll(e.args,t)}visitSafeCall(e,t){this.visit(e.receiver,t),this.visitAll(e.args,t)}visitAll(e,t){for(let s of e)this.visit(s,t)}};var qe;(function(r){r[r.DEFAULT=0]="DEFAULT",r[r.LITERAL_ATTR=1]="LITERAL_ATTR",r[r.ANIMATION=2]="ANIMATION"})(qe||(qe={}));function je(r){return r>=9&&r<=32||r==160}function K(r){return 48<=r&&r<=57}function Xe(r){return r>=97&&r<=122||r>=65&&r<=90}function Le(r){return r===39||r===34||r===96}var f;(function(r){r[r.Character=0]="Character",r[r.Identifier=1]="Identifier",r[r.PrivateIdentifier=2]="PrivateIdentifier",r[r.Keyword=3]="Keyword",r[r.String=4]="String",r[r.Operator=5]="Operator",r[r.Number=6]="Number",r[r.Error=7]="Error"})(f||(f={}));var ur=["var","let","as","null","undefined","true","false","if","else","this"],le=class{tokenize(e){let t=new Be(e),s=[],n=t.scanToken();for(;n!=null;)s.push(n),n=t.scanToken();return s}},O=class{constructor(e,t,s,n,i){this.index=e,this.end=t,this.type=s,this.numValue=n,this.strValue=i}isCharacter(e){return this.type==f.Character&&this.numValue==e}isNumber(){return this.type==f.Number}isString(){return this.type==f.String}isOperator(e){return this.type==f.Operator&&this.strValue==e}isIdentifier(){return this.type==f.Identifier}isPrivateIdentifier(){return this.type==f.PrivateIdentifier}isKeyword(){return this.type==f.Keyword}isKeywordLet(){return this.type==f.Keyword&&this.strValue=="let"}isKeywordAs(){return this.type==f.Keyword&&this.strValue=="as"}isKeywordNull(){return this.type==f.Keyword&&this.strValue=="null"}isKeywordUndefined(){return this.type==f.Keyword&&this.strValue=="undefined"}isKeywordTrue(){return this.type==f.Keyword&&this.strValue=="true"}isKeywordFalse(){return this.type==f.Keyword&&this.strValue=="false"}isKeywordThis(){return this.type==f.Keyword&&this.strValue=="this"}isError(){return this.type==f.Error}toNumber(){return this.type==f.Number?this.numValue:-1}toString(){switch(this.type){case f.Character:case f.Identifier:case f.Keyword:case f.Operator:case f.PrivateIdentifier:case f.String:case f.Error:return this.strValue;case f.Number:return this.numValue.toString();default:return null}}};function tt(r,e,t){return new O(r,e,f.Character,t,String.fromCharCode(t))}function lr(r,e,t){return new O(r,e,f.Identifier,0,t)}function xr(r,e,t){return new O(r,e,f.PrivateIdentifier,0,t)}function dr(r,e,t){return new O(r,e,f.Keyword,0,t)}function be(r,e,t){return new O(r,e,f.Operator,0,t)}function fr(r,e,t){return new O(r,e,f.String,0,t)}function vr(r,e,t){return new O(r,e,f.Number,t,"")}function gr(r,e,t){return new O(r,e,f.Error,0,t)}var Ce=new O(-1,-1,f.Character,0,""),Be=class{constructor(e){this.input=e,this.peek=0,this.index=-1,this.length=e.length,this.advance()}advance(){this.peek=++this.index>=this.length?0:this.input.charCodeAt(this.index)}scanToken(){let e=this.input,t=this.length,s=this.peek,n=this.index;for(;s<=32;)if(++n>=t){s=0;break}else s=e.charCodeAt(n);if(this.peek=s,this.index=n,n>=t)return null;if(rt(s))return this.scanIdentifier();if(K(s))return this.scanNumber(n);let i=n;switch(s){case 46:return this.advance(),K(this.peek)?this.scanNumber(i):tt(i,this.index,46);case 40:case 41:case 123:case 125:case 91:case 93:case 44:case 58:case 59:return this.scanCharacter(i,s);case 39:case 34:return this.scanString();case 35:return this.scanPrivateIdentifier();case 43:case 45:case 42:case 47:case 37:case 94:return this.scanOperator(i,String.fromCharCode(s));case 63:return this.scanQuestion(i);case 60:case 62:return this.scanComplexOperator(i,String.fromCharCode(s),61,"=");case 33:case 61:return this.scanComplexOperator(i,String.fromCharCode(s),61,"=",61,"=");case 38:return this.scanComplexOperator(i,"&",38,"&");case 124:return this.scanComplexOperator(i,"|",124,"|");case 160:for(;je(this.peek);)this.advance();return this.scanToken()}return this.advance(),this.error(`Unexpected character [${String.fromCharCode(s)}]`,0)}scanCharacter(e,t){return this.advance(),tt(e,this.index,t)}scanOperator(e,t){return this.advance(),be(e,this.index,t)}scanComplexOperator(e,t,s,n,i,a){this.advance();let h=t;return this.peek==s&&(this.advance(),h+=n),i!=null&&this.peek==i&&(this.advance(),h+=a),be(e,this.index,h)}scanIdentifier(){let e=this.index;for(this.advance();st(this.peek);)this.advance();let t=this.input.substring(e,this.index);return ur.indexOf(t)>-1?dr(e,this.index,t):lr(e,this.index,t)}scanPrivateIdentifier(){let e=this.index;if(this.advance(),!rt(this.peek))return this.error("Invalid character [#]",-1);for(;st(this.peek);)this.advance();let t=this.input.substring(e,this.index);return xr(e,this.index,t)}scanNumber(e){let t=this.index===e,s=!1;for(this.advance();;){if(!K(this.peek))if(this.peek===95){if(!K(this.input.charCodeAt(this.index-1))||!K(this.input.charCodeAt(this.index+1)))return this.error("Invalid numeric separator",0);s=!0}else if(this.peek===46)t=!1;else if(mr(this.peek)){if(this.advance(),Sr(this.peek)&&this.advance(),!K(this.peek))return this.error("Invalid exponent",-1);t=!1}else break;this.advance()}let n=this.input.substring(e,this.index);s&&(n=n.replace(/_/g,""));let i=t?yr(n):parseFloat(n);return vr(e,this.index,i)}scanString(){let e=this.index,t=this.peek;this.advance();let s="",n=this.index,i=this.input;for(;this.peek!=t;)if(this.peek==92){s+=i.substring(n,this.index);let h;if(this.advance(),this.peek==117){let g=i.substring(this.index+1,this.index+5);if(/^[0-9a-f]+$/i.test(g))h=parseInt(g,16);else return this.error(`Invalid unicode escape [\\u${g}]`,0);for(let d=0;d<5;d++)this.advance()}else h=wr(this.peek),this.advance();s+=String.fromCharCode(h),n=this.index}else{if(this.peek==0)return this.error("Unterminated quote",0);this.advance()}let a=i.substring(n,this.index);return this.advance(),fr(e,this.index,s+a)}scanQuestion(e){this.advance();let t="?";return(this.peek===63||this.peek===46)&&(t+=this.peek===46?".":"?",this.advance()),be(e,this.index,t)}error(e,t){let s=this.index+t;return gr(s,this.index,`Lexer Error: ${e} at column ${s} in expression [${this.input}]`)}};function rt(r){return 97<=r&&r<=122||65<=r&&r<=90||r==95||r==36}function st(r){return Xe(r)||K(r)||r==95||r==36}function mr(r){return r==101||r==69}function Sr(r){return r==45||r==43}function wr(r){switch(r){case 110:return 10;case 102:return 12;case 114:return 13;case 116:return 9;case 118:return 11;default:return r}}function yr(r){let e=parseInt(r);if(isNaN(e))throw new Error("Invalid integer literal when parsing "+r);return e}var Er=[/^\s*$/,/[<>]/,/^[{}]$/,/&(#|[a-z])/i,/^\/\//];function ot(r,e){if(e!=null&&!(Array.isArray(e)&&e.length==2))throw new Error(`Expected '${r}' to be an array, [start, end].`);if(e!=null){let t=e[0],s=e[1];Er.forEach(n=>{if(n.test(t)||n.test(s))throw new Error(`['${t}', '${s}'] contains unusable interpolation symbol.`)})}}var _e=class r{static fromArray(e){return e?(ot("interpolation",e),new r(e[0],e[1])):F}constructor(e,t){this.start=e,this.end=t}},F=new _e("{{","}}");var Me=class{constructor(e,t,s){this.strings=e,this.expressions=t,this.offsets=s}},Fe=class{constructor(e,t,s){this.templateBindings=e,this.warnings=t,this.errors=s}},fe=class{constructor(e){this._lexer=e,this.errors=[]}parseAction(e,t,s,n,i=F){this._checkNoInterpolation(e,s,i);let a=this._stripComments(e),h=this._lexer.tokenize(a),g=1;t&&(g|=2);let d=new U(e,s,n,h,g,this.errors,0).parseChain();return new P(d,e,s,n,this.errors)}parseBinding(e,t,s,n=F){let i=this._parseBindingAst(e,t,s,n);return new P(i,e,t,s,this.errors)}checkSimpleExpression(e){let t=new Ue;return e.visit(t),t.errors}parseSimpleBinding(e,t,s,n=F){let i=this._parseBindingAst(e,t,s,n),a=this.checkSimpleExpression(i);return a.length>0&&this._reportError(`Host binding expression cannot contain ${a.join(" ")}`,e,t),new P(i,e,t,s,this.errors)}_reportError(e,t,s,n){this.errors.push(new D(e,t,s,n))}_parseBindingAst(e,t,s,n){this._checkNoInterpolation(e,t,n);let i=this._stripComments(e),a=this._lexer.tokenize(i);return new U(e,t,s,a,0,this.errors,0).parseChain()}parseTemplateBindings(e,t,s,n,i){let a=this._lexer.tokenize(t);return new U(t,s,i,a,0,this.errors,0).parseTemplateBindings({source:e,span:new I(n,n+e.length)})}parseInterpolation(e,t,s,n,i=F){let{strings:a,expressions:h,offsets:g}=this.splitInterpolation(e,t,n,i);if(h.length===0)return null;let d=[];for(let y=0;y<h.length;++y){let E=h[y].text,m=this._stripComments(E),o=this._lexer.tokenize(m),u=new U(e,t,s,o,0,this.errors,g[y]).parseChain();d.push(u)}return this.createInterpolationAst(a.map(y=>y.text),d,e,t,s)}parseInterpolationExpression(e,t,s){let n=this._stripComments(e),i=this._lexer.tokenize(n),a=new U(e,t,s,i,0,this.errors,0).parseChain(),h=["",""];return this.createInterpolationAst(h,[a],e,t,s)}createInterpolationAst(e,t,s,n,i){let a=new R(0,s.length),h=new Se(a,a.toAbsolute(i),e,t);return new P(h,s,n,i,this.errors)}splitInterpolation(e,t,s,n=F){let i=[],a=[],h=[],g=s?$r(s):null,d=0,y=!1,E=!1,{start:m,end:o}=n;for(;d<e.length;)if(y){let u=d,v=u+m.length,c=this._getInterpolationEndIndex(e,o,v);if(c===-1){y=!1,E=!0;break}let x=c+o.length,l=e.substring(v,c);l.trim().length===0&&this._reportError("Blank expressions are not allowed in interpolated strings",e,`at column ${d} in`,t),a.push({text:l,start:u,end:x});let k=((g==null?void 0:g.get(u))??u)+m.length;h.push(k),d=x,y=!1}else{let u=d;d=e.indexOf(m,d),d===-1&&(d=e.length);let v=e.substring(u,d);i.push({text:v,start:u,end:d}),y=!0}if(!y)if(E){let u=i[i.length-1];u.text+=e.substring(d),u.end=e.length}else i.push({text:e.substring(d),start:d,end:e.length});return new Me(i,a,h)}wrapLiteralPrimitive(e,t,s){let n=new R(0,e==null?0:e.length);return new P(new C(n,n.toAbsolute(s),e),e,t,s,this.errors)}_stripComments(e){let t=this._commentStart(e);return t!=null?e.substring(0,t):e}_commentStart(e){let t=null;for(let s=0;s<e.length-1;s++){let n=e.charCodeAt(s),i=e.charCodeAt(s+1);if(n===47&&i==47&&t==null)return s;t===n?t=null:t==null&&Le(n)&&(t=n)}return null}_checkNoInterpolation(e,t,{start:s,end:n}){let i=-1,a=-1;for(let h of this._forEachUnquotedChar(e,0))if(i===-1)e.startsWith(s)&&(i=h);else if(a=this._getInterpolationEndIndex(e,n,h),a>-1)break;i>-1&&a>-1&&this._reportError(`Got interpolation (${s}${n}) where expression was expected`,e,`at column ${i} in`,t)}_getInterpolationEndIndex(e,t,s){for(let n of this._forEachUnquotedChar(e,s)){if(e.startsWith(t,n))return n;if(e.startsWith("//",n))return e.indexOf(t,n)}return-1}*_forEachUnquotedChar(e,t){let s=null,n=0;for(let i=t;i<e.length;i++){let a=e[i];Le(e.charCodeAt(i))&&(s===null||s===a)&&n%2===0?s=s===null?a:null:s===null&&(yield i),n=a==="\\"?n+1:0}}},pe;(function(r){r[r.None=0]="None",r[r.Writable=1]="Writable"})(pe||(pe={}));var U=class{constructor(e,t,s,n,i,a,h){this.input=e,this.location=t,this.absoluteOffset=s,this.tokens=n,this.parseFlags=i,this.errors=a,this.offset=h,this.rparensExpected=0,this.rbracketsExpected=0,this.rbracesExpected=0,this.context=pe.None,this.sourceSpanCache=new Map,this.index=0}peek(e){let t=this.index+e;return t<this.tokens.length?this.tokens[t]:Ce}get next(){return this.peek(0)}get atEOF(){return this.index>=this.tokens.length}get inputIndex(){return this.atEOF?this.currentEndIndex:this.next.index+this.offset}get currentEndIndex(){return this.index>0?this.peek(-1).end+this.offset:this.tokens.length===0?this.input.length+this.offset:this.next.index+this.offset}get currentAbsoluteOffset(){return this.absoluteOffset+this.inputIndex}span(e,t){let s=this.currentEndIndex;if(t!==void 0&&t>this.currentEndIndex&&(s=t),e>s){let n=s;s=e,e=n}return new R(e,s)}sourceSpan(e,t){let s=`${e}@${this.inputIndex}:${t}`;return this.sourceSpanCache.has(s)||this.sourceSpanCache.set(s,this.span(e,t).toAbsolute(this.absoluteOffset)),this.sourceSpanCache.get(s)}advance(){this.index++}withContext(e,t){this.context|=e;let s=t();return this.context^=e,s}consumeOptionalCharacter(e){return this.next.isCharacter(e)?(this.advance(),!0):!1}peekKeywordLet(){return this.next.isKeywordLet()}peekKeywordAs(){return this.next.isKeywordAs()}expectCharacter(e){this.consumeOptionalCharacter(e)||this.error(`Missing expected ${String.fromCharCode(e)}`)}consumeOptionalOperator(e){return this.next.isOperator(e)?(this.advance(),!0):!1}expectOperator(e){this.consumeOptionalOperator(e)||this.error(`Missing expected operator ${e}`)}prettyPrintToken(e){return e===Ce?"end of input":`token ${e}`}expectIdentifierOrKeyword(){let e=this.next;return!e.isIdentifier()&&!e.isKeyword()?(e.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(e,"expected identifier or keyword"):this.error(`Unexpected ${this.prettyPrintToken(e)}, expected identifier or keyword`),null):(this.advance(),e.toString())}expectIdentifierOrKeywordOrString(){let e=this.next;return!e.isIdentifier()&&!e.isKeyword()&&!e.isString()?(e.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(e,"expected identifier, keyword or string"):this.error(`Unexpected ${this.prettyPrintToken(e)}, expected identifier, keyword, or string`),""):(this.advance(),e.toString())}parseChain(){let e=[],t=this.inputIndex;for(;this.index<this.tokens.length;){let s=this.parsePipe();if(e.push(s),this.consumeOptionalCharacter(59))for(this.parseFlags&1||this.error("Binding expression cannot contain chained expression");this.consumeOptionalCharacter(59););else if(this.index<this.tokens.length){let n=this.index;if(this.error(`Unexpected token '${this.next}'`),this.index===n)break}}if(e.length===0){let s=this.offset,n=this.offset+this.input.length;return new $(this.span(s,n),this.sourceSpan(s,n))}return e.length==1?e[0]:new W(this.span(t),this.sourceSpan(t),e)}parsePipe(){let e=this.inputIndex,t=this.parseExpression();if(this.consumeOptionalOperator("|")){this.parseFlags&1&&this.error("Cannot have a pipe in an action expression");do{let s=this.inputIndex,n=this.expectIdentifierOrKeyword(),i,a;n!==null?i=this.sourceSpan(s):(n="",a=this.next.index!==-1?this.next.index:this.input.length+this.offset,i=new R(a,a).toAbsolute(this.absoluteOffset));let h=[];for(;this.consumeOptionalCharacter(58);)h.push(this.parseExpression());t=new Z(this.span(e),this.sourceSpan(e,a),t,n,h,i)}while(this.consumeOptionalOperator("|"))}return t}parseExpression(){return this.parseConditional()}parseConditional(){let e=this.inputIndex,t=this.parseLogicalOr();if(this.consumeOptionalOperator("?")){let s=this.parsePipe(),n;if(this.consumeOptionalCharacter(58))n=this.parsePipe();else{let i=this.inputIndex,a=this.input.substring(e,i);this.error(`Conditional expression ${a} requires all 3 expressions`),n=new $(this.span(e),this.sourceSpan(e))}return new Q(this.span(e),this.sourceSpan(e),t,s,n)}else return t}parseLogicalOr(){let e=this.inputIndex,t=this.parseLogicalAnd();for(;this.consumeOptionalOperator("||");){let s=this.parseLogicalAnd();t=new A(this.span(e),this.sourceSpan(e),"||",t,s)}return t}parseLogicalAnd(){let e=this.inputIndex,t=this.parseNullishCoalescing();for(;this.consumeOptionalOperator("&&");){let s=this.parseNullishCoalescing();t=new A(this.span(e),this.sourceSpan(e),"&&",t,s)}return t}parseNullishCoalescing(){let e=this.inputIndex,t=this.parseEquality();for(;this.consumeOptionalOperator("??");){let s=this.parseEquality();t=new A(this.span(e),this.sourceSpan(e),"??",t,s)}return t}parseEquality(){let e=this.inputIndex,t=this.parseRelational();for(;this.next.type==f.Operator;){let s=this.next.strValue;switch(s){case"==":case"===":case"!=":case"!==":this.advance();let n=this.parseRelational();t=new A(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parseRelational(){let e=this.inputIndex,t=this.parseAdditive();for(;this.next.type==f.Operator;){let s=this.next.strValue;switch(s){case"<":case">":case"<=":case">=":this.advance();let n=this.parseAdditive();t=new A(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parseAdditive(){let e=this.inputIndex,t=this.parseMultiplicative();for(;this.next.type==f.Operator;){let s=this.next.strValue;switch(s){case"+":case"-":this.advance();let n=this.parseMultiplicative();t=new A(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parseMultiplicative(){let e=this.inputIndex,t=this.parsePrefix();for(;this.next.type==f.Operator;){let s=this.next.strValue;switch(s){case"*":case"%":case"/":this.advance();let n=this.parsePrefix();t=new A(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parsePrefix(){if(this.next.type==f.Operator){let e=this.inputIndex,t=this.next.strValue,s;switch(t){case"+":return this.advance(),s=this.parsePrefix(),B.createPlus(this.span(e),this.sourceSpan(e),s);case"-":return this.advance(),s=this.parsePrefix(),B.createMinus(this.span(e),this.sourceSpan(e),s);case"!":return this.advance(),s=this.parsePrefix(),new ee(this.span(e),this.sourceSpan(e),s)}}return this.parseCallChain()}parseCallChain(){let e=this.inputIndex,t=this.parsePrimary();for(;;)if(this.consumeOptionalCharacter(46))t=this.parseAccessMember(t,e,!1);else if(this.consumeOptionalOperator("?."))this.consumeOptionalCharacter(40)?t=this.parseCall(t,e,!0):t=this.consumeOptionalCharacter(91)?this.parseKeyedReadOrWrite(t,e,!0):this.parseAccessMember(t,e,!0);else if(this.consumeOptionalCharacter(91))t=this.parseKeyedReadOrWrite(t,e,!1);else if(this.consumeOptionalCharacter(40))t=this.parseCall(t,e,!1);else if(this.consumeOptionalOperator("!"))t=new te(this.span(e),this.sourceSpan(e),t);else return t}parsePrimary(){let e=this.inputIndex;if(this.consumeOptionalCharacter(40)){this.rparensExpected++;let t=this.parsePipe();return this.rparensExpected--,this.expectCharacter(41),t}else{if(this.next.isKeywordNull())return this.advance(),new C(this.span(e),this.sourceSpan(e),null);if(this.next.isKeywordUndefined())return this.advance(),new C(this.span(e),this.sourceSpan(e),void 0);if(this.next.isKeywordTrue())return this.advance(),new C(this.span(e),this.sourceSpan(e),!0);if(this.next.isKeywordFalse())return this.advance(),new C(this.span(e),this.sourceSpan(e),!1);if(this.next.isKeywordThis())return this.advance(),new me(this.span(e),this.sourceSpan(e));if(this.consumeOptionalCharacter(91)){this.rbracketsExpected++;let t=this.parseExpressionList(93);return this.rbracketsExpected--,this.expectCharacter(93),new J(this.span(e),this.sourceSpan(e),t)}else{if(this.next.isCharacter(123))return this.parseLiteralMap();if(this.next.isIdentifier())return this.parseAccessMember(new L(this.span(e),this.sourceSpan(e)),e,!1);if(this.next.isNumber()){let t=this.next.toNumber();return this.advance(),new C(this.span(e),this.sourceSpan(e),t)}else if(this.next.isString()){let t=this.next.toString();return this.advance(),new C(this.span(e),this.sourceSpan(e),t)}else return this.next.isPrivateIdentifier()?(this._reportErrorForPrivateIdentifier(this.next,null),new $(this.span(e),this.sourceSpan(e))):this.index>=this.tokens.length?(this.error(`Unexpected end of expression: ${this.input}`),new $(this.span(e),this.sourceSpan(e))):(this.error(`Unexpected token ${this.next}`),new $(this.span(e),this.sourceSpan(e)))}}}parseExpressionList(e){let t=[];do if(!this.next.isCharacter(e))t.push(this.parsePipe());else break;while(this.consumeOptionalCharacter(44));return t}parseLiteralMap(){let e=[],t=[],s=this.inputIndex;if(this.expectCharacter(123),!this.consumeOptionalCharacter(125)){this.rbracesExpected++;do{let n=this.inputIndex,i=this.next.isString(),a=this.expectIdentifierOrKeywordOrString();if(e.push({key:a,quoted:i}),i)this.expectCharacter(58),t.push(this.parsePipe());else if(this.consumeOptionalCharacter(58))t.push(this.parsePipe());else{let h=this.span(n),g=this.sourceSpan(n);t.push(new b(h,g,g,new L(h,g),a))}}while(this.consumeOptionalCharacter(44)&&!this.next.isCharacter(125));this.rbracesExpected--,this.expectCharacter(125)}return new Y(this.span(s),this.sourceSpan(s),e,t)}parseAccessMember(e,t,s){let n=this.inputIndex,i=this.withContext(pe.Writable,()=>{let g=this.expectIdentifierOrKeyword()??"";return g.length===0&&this.error("Expected identifier for property access",e.span.end),g}),a=this.sourceSpan(n),h;if(s)this.consumeOptionalAssignment()?(this.error("The '?.' operator cannot be used in the assignment"),h=new $(this.span(t),this.sourceSpan(t))):h=new z(this.span(t),this.sourceSpan(t),a,e,i);else if(this.consumeOptionalAssignment()){if(!(this.parseFlags&1))return this.error("Bindings cannot contain assignments"),new $(this.span(t),this.sourceSpan(t));let g=this.parseConditional();h=new H(this.span(t),this.sourceSpan(t),a,e,i,g)}else h=new b(this.span(t),this.sourceSpan(t),a,e,i);return h}parseCall(e,t,s){let n=this.inputIndex;this.rparensExpected++;let i=this.parseCallArguments(),a=this.span(n,this.inputIndex).toAbsolute(this.absoluteOffset);this.expectCharacter(41),this.rparensExpected--;let h=this.span(t),g=this.sourceSpan(t);return s?new se(h,g,e,i,a):new re(h,g,e,i,a)}consumeOptionalAssignment(){return this.parseFlags&2&&this.next.isOperator("!")&&this.peek(1).isOperator("=")?(this.advance(),this.advance(),!0):this.consumeOptionalOperator("=")}parseCallArguments(){if(this.next.isCharacter(41))return[];let e=[];do e.push(this.parsePipe());while(this.consumeOptionalCharacter(44));return e}expectTemplateBindingKey(){let e="",t=!1,s=this.currentAbsoluteOffset;do e+=this.expectIdentifierOrKeywordOrString(),t=this.consumeOptionalOperator("-"),t&&(e+="-");while(t);return{source:e,span:new I(s,s+e.length)}}parseTemplateBindings(e){let t=[];for(t.push(...this.parseDirectiveKeywordBindings(e));this.index<this.tokens.length;){let s=this.parseLetBinding();if(s)t.push(s);else{let n=this.expectTemplateBindingKey(),i=this.parseAsBinding(n);i?t.push(i):(n.source=e.source+n.source.charAt(0).toUpperCase()+n.source.substring(1),t.push(...this.parseDirectiveKeywordBindings(n)))}this.consumeStatementTerminator()}return new Fe(t,[],this.errors)}parseKeyedReadOrWrite(e,t,s){return this.withContext(pe.Writable,()=>{this.rbracketsExpected++;let n=this.parsePipe();if(n instanceof $&&this.error("Key access cannot be empty"),this.rbracketsExpected--,this.expectCharacter(93),this.consumeOptionalOperator("="))if(s)this.error("The '?.' operator cannot be used in the assignment");else{let i=this.parseConditional();return new X(this.span(t),this.sourceSpan(t),e,n,i)}else return s?new j(this.span(t),this.sourceSpan(t),e,n):new q(this.span(t),this.sourceSpan(t),e,n);return new $(this.span(t),this.sourceSpan(t))})}parseDirectiveKeywordBindings(e){let t=[];this.consumeOptionalCharacter(58);let s=this.getDirectiveBoundTarget(),n=this.currentAbsoluteOffset,i=this.parseAsBinding(e);i||(this.consumeStatementTerminator(),n=this.currentAbsoluteOffset);let a=new I(e.span.start,n);return t.push(new ne(a,e,s)),i&&t.push(i),t}getDirectiveBoundTarget(){if(this.next===Ce||this.peekKeywordAs()||this.peekKeywordLet())return null;let e=this.parsePipe(),{start:t,end:s}=e.span,n=this.input.substring(t,s);return new P(e,n,this.location,this.absoluteOffset+t,this.errors)}parseAsBinding(e){if(!this.peekKeywordAs())return null;this.advance();let t=this.expectTemplateBindingKey();this.consumeStatementTerminator();let s=new I(e.span.start,this.currentAbsoluteOffset);return new T(s,t,e)}parseLetBinding(){if(!this.peekKeywordLet())return null;let e=this.currentAbsoluteOffset;this.advance();let t=this.expectTemplateBindingKey(),s=null;this.consumeOptionalOperator("=")&&(s=this.expectTemplateBindingKey()),this.consumeStatementTerminator();let n=new I(e,this.currentAbsoluteOffset);return new T(n,t,s)}consumeStatementTerminator(){this.consumeOptionalCharacter(59)||this.consumeOptionalCharacter(44)}error(e,t=null){this.errors.push(new D(e,this.input,this.locationText(t),this.location)),this.skip()}locationText(e=null){return e==null&&(e=this.index),e<this.tokens.length?`at column ${this.tokens[e].index+1} in`:"at the end of the expression"}_reportErrorForPrivateIdentifier(e,t){let s=`Private identifiers are not supported. Unexpected private identifier: ${e}`;t!==null&&(s+=`, ${t}`),this.error(s)}skip(){let e=this.next;for(;this.index<this.tokens.length&&!e.isCharacter(59)&&!e.isOperator("|")&&(this.rparensExpected<=0||!e.isCharacter(41))&&(this.rbracesExpected<=0||!e.isCharacter(125))&&(this.rbracketsExpected<=0||!e.isCharacter(93))&&(!(this.context&pe.Writable)||!e.isOperator("="));)this.next.isError()&&this.errors.push(new D(this.next.toString(),this.input,this.locationText(),this.location)),this.advance(),e=this.next}},Ue=class extends we{constructor(){super(...arguments),this.errors=[]}visitPipe(){this.errors.push("pipes")}};function $r(r){let e=new Map,t=0,s=0,n=0;for(;n<r.length;){let i=r[n];if(i.type===9){let[a,h]=i.parts;t+=h.length,s+=a.length}else{let a=i.parts.reduce((h,g)=>h+g.length,0);s+=a,t+=a}e.set(s,t),n++}return e}var ht="angular-estree-parser",De="NgEstreeParser",Ge=0,Ae=[ht,Ge];function pt(){return new fe(new le)}function Oe(r,e){let t=pt(),{astInput:s,comments:n}=Ar(r,t),{ast:i,errors:a}=e(s,t);return vt(a),{ast:i,comments:n}}function ut(r){return Oe(r,(e,t)=>t.parseBinding(e,...Ae))}function lt(r){return Oe(r,(e,t)=>t.parseSimpleBinding(e,...Ae))}function xt(r){return Oe(r,(e,t)=>t.parseAction(e,!1,...Ae))}function dt(r){return Oe(r,(e,t)=>{let s=t.parseInterpolationExpression(e,...Ae);return s.ast=s.ast.expressions[0],s})}function ft(r){let e=pt(),{templateBindings:t,errors:s}=e.parseTemplateBindings(De,r,ht,Ge,Ge);return vt(s),t}function vt(r){if(r.length!==0){let[{message:e}]=r;throw new SyntaxError(e.replace(/^Parser Error: | at column \d+ in [^]*$/g,""))}}function Ar(r,e){let t=e._commentStart(r);return t===null?{astInput:r,comments:[]}:{astInput:r.slice(0,t),comments:[{type:"Comment",value:r.slice(t+2),sourceSpan:{start:t,end:r.length}}]}}function gt(r){return r instanceof B?"Unary":r instanceof A?"Binary":r instanceof Z?"BindingPipe":r instanceof re?"Call":r instanceof W?"Chain":r instanceof Q?"Conditional":r instanceof $?"EmptyExpr":r instanceof L?"ImplicitReceiver":r instanceof q?"KeyedRead":r instanceof j?"SafeKeyedRead":r instanceof X?"KeyedWrite":r instanceof J?"LiteralArray":r instanceof Y?"LiteralMap":r instanceof C?"LiteralPrimitive":r instanceof te?"NonNullAssert":r instanceof ee?"PrefixNot":r instanceof b?"PropertyRead":r instanceof H?"PropertyWrite":r instanceof se?"SafeCall":r instanceof z?"SafePropertyRead":r.type}function ct({start:r,end:e},t){let s=r,n=e;for(;n!==s&&/\s/.test(t[n-1]);)n--;for(;s!==n&&/\s/.test(t[s]);)s++;return{start:s,end:n}}function Or({start:r,end:e},t){let s=r,n=e;for(;n!==t.length&&/\s/.test(t[n]);)n++;for(;s!==0&&/\s/.test(t[s-1]);)s--;return{start:s,end:n}}function Nr(r,e){return e[r.start-1]==="("&&e[r.end]===")"?{start:r.start-1,end:r.end+1}:r}function mt(r,e,t){let s=0,n={start:r.start,end:r.end};for(;;){let i=Or(n,e),a=Nr(i,e);if(i.start===a.start&&i.end===a.end)break;n.start=a.start,n.end=a.end,s++}return{hasParens:(t?s-1:s)!==0,outerSpan:ct(t?{start:n.start+1,end:n.end-1}:n,e),innerSpan:ct(r,e)}}function St(r){return typeof r=="string"?e=>e===r:e=>r.test(e)}function wt(r,e,t){let s=St(e);for(let n=t;n>=0;n--){let i=r[n];if(s(i))return n}throw new Error(`Cannot find front char ${e} from index ${t} in ${JSON.stringify(r)}`)}function yt(r,e,t){let s=St(e);for(let n=t;n<r.length;n++){let i=r[n];if(s(i))return n}throw new Error(`Cannot find character ${e} from index ${t} in ${JSON.stringify(r)}`)}function Et(r){return r.slice(0,1).toLowerCase()+r.slice(1)}var ve=class{text;constructor(e){this.text=e}getCharacterIndex(e,t){return yt(this.text,e,t)}getCharacterLastIndex(e,t){return wt(this.text,e,t)}};var Ir=(r,e,t)=>{if(!(r&&e==null))return Array.isArray(e)||typeof e=="string"?e[t<0?e.length+t:t]:e.at(t)},Ne=Ir;var G=(r,e,t=!1)=>{let s=gt(r);switch(s){case"Unary":{let{operator:o,expr:u}=r,v=n(u);return a("UnaryExpression",{prefix:!0,argument:v,operator:o},r.sourceSpan,{hasParentParens:t})}case"Binary":{let{left:o,operation:u,right:v}=r,c=n(o),x=n(v);return a(u==="&&"||u==="||"||u==="??"?"LogicalExpression":"BinaryExpression",{left:c,right:x,operator:u},{start:E(c),end:m(x)},{hasParentParens:t})}case"BindingPipe":{let{exp:o,name:u,args:v}=r,c=n(o),x=e.getCharacterIndex(/\S/,e.getCharacterIndex("|",m(c))+1),l=a("Identifier",{name:u},{start:x,end:x+u.length}),p=v.map(n);return a("NGPipeExpression",{left:c,right:l,arguments:p},{start:E(c),end:m(p.length===0?l:Ne(!1,p,-1))},{hasParentParens:t})}case"Chain":{let{expressions:o}=r;return a("NGChainedExpression",{expressions:o.map(n)},r.sourceSpan,{hasParentParens:t})}case"Comment":{let{value:o}=r;return a("CommentLine",{value:o},r.sourceSpan,{processSpan:!1})}case"Conditional":{let{condition:o,trueExp:u,falseExp:v}=r,c=n(o),x=n(u),l=n(v);return a("ConditionalExpression",{test:c,consequent:x,alternate:l},{start:E(c),end:m(l)},{hasParentParens:t})}case"EmptyExpr":return a("NGEmptyExpression",{},r.sourceSpan,{hasParentParens:t});case"ImplicitReceiver":return a("ThisExpression",{},r.sourceSpan,{hasParentParens:t});case"KeyedRead":case"SafeKeyedRead":{let o=s==="SafeKeyedRead",{key:u}=r,v=Object.prototype.hasOwnProperty.call(r,"receiver")?r.receiver:r.obj,c=n(u);return h(v,c,{computed:!0,optional:o},{end:r.sourceSpan.end,hasParentParens:t})}case"LiteralArray":{let{expressions:o}=r;return a("ArrayExpression",{elements:o.map(n)},r.sourceSpan,{hasParentParens:t})}case"LiteralMap":{let{keys:o,values:u}=r,v=u.map(x=>n(x)),c=o.map(({key:x,quoted:l},p)=>{let k=v[p],S=E(k),N=m(k),ue=e.getCharacterIndex(/\S/,p===0?r.sourceSpan.start+1:e.getCharacterIndex(",",m(v[p-1]))+1),kt=S===ue?N:e.getCharacterLastIndex(/\S/,e.getCharacterLastIndex(":",S-1)-1)+1,He={start:ue,end:kt},ge=l?a("StringLiteral",{value:x},He):a("Identifier",{name:x},He),Pt=ge.end<ge.start||ue===S;return a("ObjectProperty",{key:ge,value:k,shorthand:Pt,computed:!1},{start:E(ge),end:N})});return a("ObjectExpression",{properties:c},r.sourceSpan,{hasParentParens:t})}case"LiteralPrimitive":{let{value:o}=r;switch(typeof o){case"boolean":return a("BooleanLiteral",{value:o},r.sourceSpan,{hasParentParens:t});case"number":return a("NumericLiteral",{value:o},r.sourceSpan,{hasParentParens:t});case"object":return a("NullLiteral",{},r.sourceSpan,{hasParentParens:t});case"string":return a("StringLiteral",{value:o},r.sourceSpan,{hasParentParens:t});case"undefined":return a("Identifier",{name:"undefined"},r.sourceSpan,{hasParentParens:t});default:throw new Error(`Unexpected LiteralPrimitive value type ${typeof o}`)}}case"Call":case"SafeCall":{let o=s==="SafeCall",{receiver:u,args:v}=r,c=v.length===1?[i(v[0])]:v.map(n),x=n(u),l=d(x),p=o||l?"OptionalCallExpression":"CallExpression";return a(p,{callee:x,arguments:c,optional:p==="OptionalCallExpression"?o:void 0},{start:E(x),end:r.sourceSpan.end},{hasParentParens:t})}case"NonNullAssert":{let{expression:o}=r,u=n(o);return a("TSNonNullExpression",{expression:u},{start:E(u),end:r.sourceSpan.end},{hasParentParens:t})}case"PrefixNot":{let{expression:o}=r,u=n(o);return a("UnaryExpression",{prefix:!0,operator:"!",argument:u},{start:r.sourceSpan.start,end:m(u)},{hasParentParens:t})}case"PropertyRead":case"SafePropertyRead":{let o=s==="SafePropertyRead",{receiver:u,name:v}=r,c=e.getCharacterLastIndex(/\S/,r.sourceSpan.end-1)+1,x=a("Identifier",{name:v},{start:c-v.length,end:c},g(u)?{hasParentParens:t}:{});return h(u,x,{computed:!1,optional:o},{hasParentParens:t})}case"KeyedWrite":{let{key:o,value:u}=r,v=Object.prototype.hasOwnProperty.call(r,"receiver")?r.receiver:r.obj,c=n(o),x=n(u),l=h(v,c,{computed:!0,optional:!1},{end:e.getCharacterIndex("]",m(c))+1});return a("AssignmentExpression",{left:l,operator:"=",right:x},{start:E(l),end:m(x)},{hasParentParens:t})}case"PropertyWrite":{let{receiver:o,name:u,value:v}=r,c=n(v),x=e.getCharacterLastIndex(/\S/,e.getCharacterLastIndex("=",E(c)-1)-1)+1,l=a("Identifier",{name:u},{start:x-u.length,end:x}),p=h(o,l,{computed:!1,optional:!1});return a("AssignmentExpression",{left:p,operator:"=",right:c},{start:E(p),end:m(c)},{hasParentParens:t})}default:throw new Error(`Unexpected node ${s}`)}function n(o){return G(o,e)}function i(o){return G(o,e,!0)}function a(o,u,v,{processSpan:c=!0,hasParentParens:x=!1}={}){let l={type:o,...Ie(v,e,c,x),...u};switch(o){case"NumericLiteral":{let p=l;p.extra={...p.extra,raw:e.text.slice(p.start,p.end),rawValue:p.value};break}case"StringLiteral":{let p=l;p.extra={...p.extra,raw:e.text.slice(p.start,p.end),rawValue:p.value};break}case"ObjectProperty":{let p=l;p.shorthand&&(p.extra={...p.extra,shorthand:p.shorthand});break}}return l}function h(o,u,v,{end:c=m(u),hasParentParens:x=!1}={}){if(g(o)||o.sourceSpan.start===u.start)return u;let l=n(o),p=d(l);return a(v.optional||p?"OptionalMemberExpression":"MemberExpression",{object:l,property:u,computed:v.computed,...v.optional?{optional:!0}:p?{optional:!1}:null},{start:E(l),end:c},{hasParentParens:x})}function g(o){return o.sourceSpan.start>=o.sourceSpan.end||/^\s+$/.test(e.text.slice(o.sourceSpan.start,o.sourceSpan.end))}function d(o){return(o.type==="OptionalCallExpression"||o.type==="OptionalMemberExpression")&&!y(o)}function y(o){return o.extra&&o.extra.parenthesized}function E(o){return y(o)?o.extra.parenStart:o.start}function m(o){return y(o)?o.extra.parenEnd:o.end}};function Ie(r,e,t=!1,s=!1){if(!t){let{start:g,end:d}=r;return{start:g,end:d,range:[g,d]}}let{outerSpan:n,innerSpan:{start:i,end:a},hasParens:h}=mt(r,e.text,s);return{start:i,end:a,range:[i,a],...h&&{extra:{parenthesized:!0,parenStart:n.start,parenEnd:n.end}}}}function $t(r,e){r.forEach(o);let[t]=r,{key:s}=t,n=e.text.slice(t.sourceSpan.start,t.sourceSpan.end).trim().length===0?r.slice(1):r,i=[],a=null;for(let c=0;c<n.length;c++){let x=n[c];if(a&&E(a)&&m(x)&&x.value&&x.value.source===a.key.source){let l=d("NGMicrosyntaxKey",{name:x.key.source},x.key.span),p=(N,ue)=>({...N,...Ie({start:N.start,end:ue},e)}),k=N=>({...p(N,l.end),alias:l}),S=i.pop();if(S.type==="NGMicrosyntaxExpression")i.push(k(S));else if(S.type==="NGMicrosyntaxKeyedExpression"){let N=k(S.expression);i.push(p({...S,expression:N},N.end))}else throw new Error(`Unexpected type ${S.type}`)}else i.push(h(x,c));a=x}return d("NGMicrosyntax",{body:i},i.length===0?r[0].sourceSpan:{start:i[0].start,end:Ne(!1,i,-1).end});function h(c,x){if(E(c)){let{key:l,value:p}=c;return p?x===0?d("NGMicrosyntaxExpression",{expression:g(p.ast),alias:null},p.sourceSpan):d("NGMicrosyntaxKeyedExpression",{key:d("NGMicrosyntaxKey",{name:y(l.source)},l.span),expression:d("NGMicrosyntaxExpression",{expression:g(p.ast),alias:null},p.sourceSpan)},{start:l.span.start,end:p.sourceSpan.end}):d("NGMicrosyntaxKey",{name:y(l.source)},l.span)}else{let{key:l,sourceSpan:p}=c;if(/^let\s$/.test(e.text.slice(p.start,p.start+4))){let{value:S}=c;return d("NGMicrosyntaxLet",{key:d("NGMicrosyntaxKey",{name:l.source},l.span),value:S?d("NGMicrosyntaxKey",{name:S.source},S.span):null},{start:p.start,end:S?S.span.end:l.span.end})}else{let S=v(c);return d("NGMicrosyntaxAs",{key:d("NGMicrosyntaxKey",{name:S.source},S.span),alias:d("NGMicrosyntaxKey",{name:l.source},l.span)},{start:S.span.start,end:l.span.end})}}}function g(c){return G(c,e)}function d(c,x,l,p=!0){return{type:c,...Ie(l,e,p),...x}}function y(c){return Et(c.slice(s.source.length))}function E(c){return c instanceof ne}function m(c){return c instanceof T}function o(c){u(c.key.span),m(c)&&c.value&&u(c.value.span)}function u(c){if(e.text[c.start]!=='"'&&e.text[c.start]!=="'")return;let x=e.text[c.start],l=!1;for(let p=c.start+1;p<e.text.length;p++)switch(e.text[p]){case x:if(!l){c.end=p+1;return}default:l=!1;break;case"\\":l=!l;break}}function v(c){if(!c.value||c.value.source!==De)return c.value;let x=e.getCharacterIndex(/\S/,c.sourceSpan.start);return{source:"$implicit",span:{start:x,end:x}}}}function ke(r){return e=>{let{ast:t,comments:s}=r(e),n=new ve(e),i=G(t,n);return i.comments=s.map(a=>G(a,n)),i}}var Ct=ke(ut),us=ke(lt),At=ke(dt),Ve=ke(xt),Ot=r=>$t(ft(r),new ve(r));function kr(r){return Array.isArray(r)&&r.length>0}var Nt=kr;function We(r){var s;let e=r.range?r.range[0]:r.start,t=((s=r.declaration)==null?void 0:s.decorators)??r.decorators;return Nt(t)?Math.min(We(t[0]),e):e}function It(r){return r.range?r.range[1]:r.end}function Pe(r){return{astFormat:"estree",parse(e){let t=r(e);return{type:"NGRoot",node:r===Ve&&t.type!=="NGChainedExpression"?{...t,type:"NGChainedExpression",expressions:[t]}:t}},locStart:We,locEnd:It}}var Pr=Pe(Ve),Rr=Pe(Ct),Lr=Pe(At),Kr=Pe(Ot);return Bt(br);});
@@ -1,2 +1 @@
1
- var Xe=Object.defineProperty;var Gt=(r,e,t)=>e in r?Xe(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Ze=(r,e)=>{for(var t in e)Xe(r,t,{get:e[t],enumerable:!0})};var Je=(r,e,t)=>(Gt(r,typeof e!="symbol"?e+"":e,t),t),Ye=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)};var be=(r,e,t)=>(Ye(r,e,"read from private field"),t?t.call(r):e.get(r)),et=(r,e,t)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,t)},tt=(r,e,t,s)=>(Ye(r,e,"write to private field"),s?s.call(r,t):e.set(r,t),t);var qe={};Ze(qe,{parsers:()=>ze});var ze={};Ze(ze,{__ng_action:()=>Tr,__ng_binding:()=>_r,__ng_directive:()=>Fr,__ng_interpolation:()=>Mr});var Se=`
2
- `,rt="\r",st=function(){function r(e){this.length=e.length;for(var t=[0],s=0;s<e.length;)switch(e[s]){case Se:s+=Se.length,t.push(s);break;case rt:s+=rt.length,e[s]===Se&&(s+=Se.length),t.push(s);break;default:s++;break}this.offsets=t}return r.prototype.locationForIndex=function(e){if(e<0||e>this.length)return null;for(var t=0,s=this.offsets;s[t+1]<=e;)t++;var n=e-s[t];return{line:t,column:n}},r.prototype.indexForLocation=function(e){var t=e.line,s=e.column;return t<0||t>=this.offsets.length||s<0||s>this.lengthOfLine(t)?null:this.offsets[t]+s},r.prototype.lengthOfLine=function(e){var t=this.offsets[e],s=e===this.offsets.length-1?this.length:this.offsets[e+1];return s-t},r}();var D=class{constructor(e,t,s,n){this.input=t,this.errLocation=s,this.ctxLocation=n,this.message=`Parser Error: ${e} ${s} [${t}] in ${n}`}},R=class{constructor(e,t){this.start=e,this.end=t}toAbsolute(e){return new N(e+this.start,e+this.end)}},w=class{constructor(e,t){this.span=e,this.sourceSpan=t}toString(){return"AST"}},V=class extends w{constructor(e,t,s){super(e,t),this.nameSpan=s}},C=class extends w{visit(e,t=null){}},L=class extends w{visit(e,t=null){return e.visitImplicitReceiver(this,t)}},we=class extends L{visit(e,t=null){var s;return(s=e.visitThisReceiver)==null?void 0:s.call(e,this,t)}},W=class extends w{constructor(e,t,s){super(e,t),this.expressions=s}visit(e,t=null){return e.visitChain(this,t)}},Q=class extends w{constructor(e,t,s,n,i){super(e,t),this.condition=s,this.trueExp=n,this.falseExp=i}visit(e,t=null){return e.visitConditional(this,t)}},K=class extends V{constructor(e,t,s,n,i){super(e,t,s),this.receiver=n,this.name=i}visit(e,t=null){return e.visitPropertyRead(this,t)}},H=class extends V{constructor(e,t,s,n,i,a){super(e,t,s),this.receiver=n,this.name=i,this.value=a}visit(e,t=null){return e.visitPropertyWrite(this,t)}},z=class extends V{constructor(e,t,s,n,i){super(e,t,s),this.receiver=n,this.name=i}visit(e,t=null){return e.visitSafePropertyRead(this,t)}},q=class extends w{constructor(e,t,s,n){super(e,t),this.receiver=s,this.key=n}visit(e,t=null){return e.visitKeyedRead(this,t)}},j=class extends w{constructor(e,t,s,n){super(e,t),this.receiver=s,this.key=n}visit(e,t=null){return e.visitSafeKeyedRead(this,t)}},X=class extends w{constructor(e,t,s,n,i){super(e,t),this.receiver=s,this.key=n,this.value=i}visit(e,t=null){return e.visitKeyedWrite(this,t)}},Z=class extends V{constructor(e,t,s,n,i,a){super(e,t,a),this.exp=s,this.name=n,this.args=i}visit(e,t=null){return e.visitPipe(this,t)}},A=class extends w{constructor(e,t,s){super(e,t),this.value=s}visit(e,t=null){return e.visitLiteralPrimitive(this,t)}},J=class extends w{constructor(e,t,s){super(e,t),this.expressions=s}visit(e,t=null){return e.visitLiteralArray(this,t)}},Y=class extends w{constructor(e,t,s,n){super(e,t),this.keys=s,this.values=n}visit(e,t=null){return e.visitLiteralMap(this,t)}},ye=class extends w{constructor(e,t,s,n){super(e,t),this.strings=s,this.expressions=n}visit(e,t=null){return e.visitInterpolation(this,t)}},$=class extends w{constructor(e,t,s,n,i){super(e,t),this.operation=s,this.left=n,this.right=i}visit(e,t=null){return e.visitBinary(this,t)}},B=class r extends ${static createMinus(e,t,s){return new r(e,t,"-",s,"-",new A(e,t,0),s)}static createPlus(e,t,s){return new r(e,t,"+",s,"-",s,new A(e,t,0))}constructor(e,t,s,n,i,a,h){super(e,t,i,a,h),this.operator=s,this.expr=n,this.left=null,this.right=null,this.operation=null}visit(e,t=null){return e.visitUnary!==void 0?e.visitUnary(this,t):e.visitBinary(this,t)}},ee=class extends w{constructor(e,t,s){super(e,t),this.expression=s}visit(e,t=null){return e.visitPrefixNot(this,t)}},te=class extends w{constructor(e,t,s){super(e,t),this.expression=s}visit(e,t=null){return e.visitNonNullAssert(this,t)}},re=class extends w{constructor(e,t,s,n,i){super(e,t),this.receiver=s,this.args=n,this.argumentSpan=i}visit(e,t=null){return e.visitCall(this,t)}},se=class extends w{constructor(e,t,s,n,i){super(e,t),this.receiver=s,this.args=n,this.argumentSpan=i}visit(e,t=null){return e.visitSafeCall(this,t)}},N=class{constructor(e,t){this.start=e,this.end=t}},P=class extends w{constructor(e,t,s,n,i){super(new R(0,t===null?0:t.length),new N(n,t===null?n:n+t.length)),this.ast=e,this.source=t,this.location=s,this.errors=i}visit(e,t=null){return e.visitASTWithSource?e.visitASTWithSource(this,t):this.ast.visit(e,t)}toString(){return`${this.source} in ${this.location}`}},T=class{constructor(e,t,s){this.sourceSpan=e,this.key=t,this.value=s}},ne=class{constructor(e,t,s){this.sourceSpan=e,this.key=t,this.value=s}},Ee=class{visit(e,t){e.visit(this,t)}visitUnary(e,t){this.visit(e.expr,t)}visitBinary(e,t){this.visit(e.left,t),this.visit(e.right,t)}visitChain(e,t){this.visitAll(e.expressions,t)}visitConditional(e,t){this.visit(e.condition,t),this.visit(e.trueExp,t),this.visit(e.falseExp,t)}visitPipe(e,t){this.visit(e.exp,t),this.visitAll(e.args,t)}visitImplicitReceiver(e,t){}visitThisReceiver(e,t){}visitInterpolation(e,t){this.visitAll(e.expressions,t)}visitKeyedRead(e,t){this.visit(e.receiver,t),this.visit(e.key,t)}visitKeyedWrite(e,t){this.visit(e.receiver,t),this.visit(e.key,t),this.visit(e.value,t)}visitLiteralArray(e,t){this.visitAll(e.expressions,t)}visitLiteralMap(e,t){this.visitAll(e.values,t)}visitLiteralPrimitive(e,t){}visitPrefixNot(e,t){this.visit(e.expression,t)}visitNonNullAssert(e,t){this.visit(e.expression,t)}visitPropertyRead(e,t){this.visit(e.receiver,t)}visitPropertyWrite(e,t){this.visit(e.receiver,t),this.visit(e.value,t)}visitSafePropertyRead(e,t){this.visit(e.receiver,t)}visitSafeKeyedRead(e,t){this.visit(e.receiver,t),this.visit(e.key,t)}visitCall(e,t){this.visit(e.receiver,t),this.visitAll(e.args,t)}visitSafeCall(e,t){this.visit(e.receiver,t),this.visitAll(e.args,t)}visitAll(e,t){for(let s of e)this.visit(s,t)}};var nt;(function(r){r[r.DEFAULT=0]="DEFAULT",r[r.LITERAL_ATTR=1]="LITERAL_ATTR",r[r.ANIMATION=2]="ANIMATION"})(nt||(nt={}));function it(r){return r>=9&&r<=32||r==160}function b(r){return 48<=r&&r<=57}function at(r){return r>=97&&r<=122||r>=65&&r<=90}function Ke(r){return r===39||r===34||r===96}var d;(function(r){r[r.Character=0]="Character",r[r.Identifier=1]="Identifier",r[r.PrivateIdentifier=2]="PrivateIdentifier",r[r.Keyword=3]="Keyword",r[r.String=4]="String",r[r.Operator=5]="Operator",r[r.Number=6]="Number",r[r.Error=7]="Error"})(d||(d={}));var gr=["var","let","as","null","undefined","true","false","if","else","this"],le=class{tokenize(e){let t=new _e(e),s=[],n=t.scanToken();for(;n!=null;)s.push(n),n=t.scanToken();return s}},O=class{constructor(e,t,s,n,i){this.index=e,this.end=t,this.type=s,this.numValue=n,this.strValue=i}isCharacter(e){return this.type==d.Character&&this.numValue==e}isNumber(){return this.type==d.Number}isString(){return this.type==d.String}isOperator(e){return this.type==d.Operator&&this.strValue==e}isIdentifier(){return this.type==d.Identifier}isPrivateIdentifier(){return this.type==d.PrivateIdentifier}isKeyword(){return this.type==d.Keyword}isKeywordLet(){return this.type==d.Keyword&&this.strValue=="let"}isKeywordAs(){return this.type==d.Keyword&&this.strValue=="as"}isKeywordNull(){return this.type==d.Keyword&&this.strValue=="null"}isKeywordUndefined(){return this.type==d.Keyword&&this.strValue=="undefined"}isKeywordTrue(){return this.type==d.Keyword&&this.strValue=="true"}isKeywordFalse(){return this.type==d.Keyword&&this.strValue=="false"}isKeywordThis(){return this.type==d.Keyword&&this.strValue=="this"}isError(){return this.type==d.Error}toNumber(){return this.type==d.Number?this.numValue:-1}toString(){switch(this.type){case d.Character:case d.Identifier:case d.Keyword:case d.Operator:case d.PrivateIdentifier:case d.String:case d.Error:return this.strValue;case d.Number:return this.numValue.toString();default:return null}}};function ut(r,e,t){return new O(r,e,d.Character,t,String.fromCharCode(t))}function mr(r,e,t){return new O(r,e,d.Identifier,0,t)}function Sr(r,e,t){return new O(r,e,d.PrivateIdentifier,0,t)}function wr(r,e,t){return new O(r,e,d.Keyword,0,t)}function Te(r,e,t){return new O(r,e,d.Operator,0,t)}function yr(r,e,t){return new O(r,e,d.String,0,t)}function Er(r,e,t){return new O(r,e,d.Number,t,"")}function Cr(r,e,t){return new O(r,e,d.Error,0,t)}var Oe=new O(-1,-1,d.Character,0,""),_e=class{constructor(e){this.input=e,this.peek=0,this.index=-1,this.length=e.length,this.advance()}advance(){this.peek=++this.index>=this.length?0:this.input.charCodeAt(this.index)}scanToken(){let e=this.input,t=this.length,s=this.peek,n=this.index;for(;s<=32;)if(++n>=t){s=0;break}else s=e.charCodeAt(n);if(this.peek=s,this.index=n,n>=t)return null;if(lt(s))return this.scanIdentifier();if(b(s))return this.scanNumber(n);let i=n;switch(s){case 46:return this.advance(),b(this.peek)?this.scanNumber(i):ut(i,this.index,46);case 40:case 41:case 123:case 125:case 91:case 93:case 44:case 58:case 59:return this.scanCharacter(i,s);case 39:case 34:return this.scanString();case 35:return this.scanPrivateIdentifier();case 43:case 45:case 42:case 47:case 37:case 94:return this.scanOperator(i,String.fromCharCode(s));case 63:return this.scanQuestion(i);case 60:case 62:return this.scanComplexOperator(i,String.fromCharCode(s),61,"=");case 33:case 61:return this.scanComplexOperator(i,String.fromCharCode(s),61,"=",61,"=");case 38:return this.scanComplexOperator(i,"&",38,"&");case 124:return this.scanComplexOperator(i,"|",124,"|");case 160:for(;it(this.peek);)this.advance();return this.scanToken()}return this.advance(),this.error(`Unexpected character [${String.fromCharCode(s)}]`,0)}scanCharacter(e,t){return this.advance(),ut(e,this.index,t)}scanOperator(e,t){return this.advance(),Te(e,this.index,t)}scanComplexOperator(e,t,s,n,i,a){this.advance();let h=t;return this.peek==s&&(this.advance(),h+=n),i!=null&&this.peek==i&&(this.advance(),h+=a),Te(e,this.index,h)}scanIdentifier(){let e=this.index;for(this.advance();xt(this.peek);)this.advance();let t=this.input.substring(e,this.index);return gr.indexOf(t)>-1?wr(e,this.index,t):mr(e,this.index,t)}scanPrivateIdentifier(){let e=this.index;if(this.advance(),!lt(this.peek))return this.error("Invalid character [#]",-1);for(;xt(this.peek);)this.advance();let t=this.input.substring(e,this.index);return Sr(e,this.index,t)}scanNumber(e){let t=this.index===e,s=!1;for(this.advance();;){if(!b(this.peek))if(this.peek===95){if(!b(this.input.charCodeAt(this.index-1))||!b(this.input.charCodeAt(this.index+1)))return this.error("Invalid numeric separator",0);s=!0}else if(this.peek===46)t=!1;else if(Ar(this.peek)){if(this.advance(),$r(this.peek)&&this.advance(),!b(this.peek))return this.error("Invalid exponent",-1);t=!1}else break;this.advance()}let n=this.input.substring(e,this.index);s&&(n=n.replace(/_/g,""));let i=t?Ir(n):parseFloat(n);return Er(e,this.index,i)}scanString(){let e=this.index,t=this.peek;this.advance();let s="",n=this.index,i=this.input;for(;this.peek!=t;)if(this.peek==92){s+=i.substring(n,this.index);let h;if(this.advance(),this.peek==117){let g=i.substring(this.index+1,this.index+5);if(/^[0-9a-f]+$/i.test(g))h=parseInt(g,16);else return this.error(`Invalid unicode escape [\\u${g}]`,0);for(let f=0;f<5;f++)this.advance()}else h=Or(this.peek),this.advance();s+=String.fromCharCode(h),n=this.index}else{if(this.peek==0)return this.error("Unterminated quote",0);this.advance()}let a=i.substring(n,this.index);return this.advance(),yr(e,this.index,s+a)}scanQuestion(e){this.advance();let t="?";return(this.peek===63||this.peek===46)&&(t+=this.peek===46?".":"?",this.advance()),Te(e,this.index,t)}error(e,t){let s=this.index+t;return Cr(s,this.index,`Lexer Error: ${e} at column ${s} in expression [${this.input}]`)}};function lt(r){return 97<=r&&r<=122||65<=r&&r<=90||r==95||r==36}function xt(r){return at(r)||b(r)||r==95||r==36}function Ar(r){return r==101||r==69}function $r(r){return r==45||r==43}function Or(r){switch(r){case 110:return 10;case 102:return 12;case 114:return 13;case 116:return 9;case 118:return 11;default:return r}}function Ir(r){let e=parseInt(r);if(isNaN(e))throw new Error("Invalid integer literal when parsing "+r);return e}var Nr=[/^\s*$/,/[<>]/,/^[{}]$/,/&(#|[a-z])/i,/^\/\//];function gt(r,e){if(e!=null&&!(Array.isArray(e)&&e.length==2))throw new Error(`Expected '${r}' to be an array, [start, end].`);if(e!=null){let t=e[0],s=e[1];Nr.forEach(n=>{if(n.test(t)||n.test(s))throw new Error(`['${t}', '${s}'] contains unusable interpolation symbol.`)})}}var Fe=class r{static fromArray(e){return e?(gt("interpolation",e),new r(e[0],e[1])):F}constructor(e,t){this.start=e,this.end=t}},F=new Fe("{{","}}");var Ue=class{constructor(e,t,s){this.strings=e,this.expressions=t,this.offsets=s}},Ge=class{constructor(e,t,s){this.templateBindings=e,this.warnings=t,this.errors=s}},fe=class{constructor(e){this._lexer=e,this.errors=[]}parseAction(e,t,s,n,i=F){this._checkNoInterpolation(e,s,i);let a=this._stripComments(e),h=this._lexer.tokenize(a),g=1;t&&(g|=2);let f=new U(e,s,n,h,g,this.errors,0).parseChain();return new P(f,e,s,n,this.errors)}parseBinding(e,t,s,n=F){let i=this._parseBindingAst(e,t,s,n);return new P(i,e,t,s,this.errors)}checkSimpleExpression(e){let t=new De;return e.visit(t),t.errors}parseSimpleBinding(e,t,s,n=F){let i=this._parseBindingAst(e,t,s,n),a=this.checkSimpleExpression(i);return a.length>0&&this._reportError(`Host binding expression cannot contain ${a.join(" ")}`,e,t),new P(i,e,t,s,this.errors)}_reportError(e,t,s,n){this.errors.push(new D(e,t,s,n))}_parseBindingAst(e,t,s,n){this._checkNoInterpolation(e,t,n);let i=this._stripComments(e),a=this._lexer.tokenize(i);return new U(e,t,s,a,0,this.errors,0).parseChain()}parseTemplateBindings(e,t,s,n,i){let a=this._lexer.tokenize(t);return new U(t,s,i,a,0,this.errors,0).parseTemplateBindings({source:e,span:new N(n,n+e.length)})}parseInterpolation(e,t,s,n,i=F){let{strings:a,expressions:h,offsets:g}=this.splitInterpolation(e,t,n,i);if(h.length===0)return null;let f=[];for(let y=0;y<h.length;++y){let E=h[y].text,m=this._stripComments(E),o=this._lexer.tokenize(m),u=new U(e,t,s,o,0,this.errors,g[y]).parseChain();f.push(u)}return this.createInterpolationAst(a.map(y=>y.text),f,e,t,s)}parseInterpolationExpression(e,t,s){let n=this._stripComments(e),i=this._lexer.tokenize(n),a=new U(e,t,s,i,0,this.errors,0).parseChain(),h=["",""];return this.createInterpolationAst(h,[a],e,t,s)}createInterpolationAst(e,t,s,n,i){let a=new R(0,s.length),h=new ye(a,a.toAbsolute(i),e,t);return new P(h,s,n,i,this.errors)}splitInterpolation(e,t,s,n=F){let i=[],a=[],h=[],g=s?kr(s):null,f=0,y=!1,E=!1,{start:m,end:o}=n;for(;f<e.length;)if(y){let u=f,v=u+m.length,c=this._getInterpolationEndIndex(e,o,v);if(c===-1){y=!1,E=!0;break}let x=c+o.length,l=e.substring(v,c);l.trim().length===0&&this._reportError("Blank expressions are not allowed in interpolated strings",e,`at column ${f} in`,t),a.push({text:l,start:u,end:x});let k=((g==null?void 0:g.get(u))??u)+m.length;h.push(k),f=x,y=!1}else{let u=f;f=e.indexOf(m,f),f===-1&&(f=e.length);let v=e.substring(u,f);i.push({text:v,start:u,end:f}),y=!0}if(!y)if(E){let u=i[i.length-1];u.text+=e.substring(f),u.end=e.length}else i.push({text:e.substring(f),start:f,end:e.length});return new Ue(i,a,h)}wrapLiteralPrimitive(e,t,s){let n=new R(0,e==null?0:e.length);return new P(new A(n,n.toAbsolute(s),e),e,t,s,this.errors)}_stripComments(e){let t=this._commentStart(e);return t!=null?e.substring(0,t):e}_commentStart(e){let t=null;for(let s=0;s<e.length-1;s++){let n=e.charCodeAt(s),i=e.charCodeAt(s+1);if(n===47&&i==47&&t==null)return s;t===n?t=null:t==null&&Ke(n)&&(t=n)}return null}_checkNoInterpolation(e,t,{start:s,end:n}){let i=-1,a=-1;for(let h of this._forEachUnquotedChar(e,0))if(i===-1)e.startsWith(s)&&(i=h);else if(a=this._getInterpolationEndIndex(e,n,h),a>-1)break;i>-1&&a>-1&&this._reportError(`Got interpolation (${s}${n}) where expression was expected`,e,`at column ${i} in`,t)}_getInterpolationEndIndex(e,t,s){for(let n of this._forEachUnquotedChar(e,s)){if(e.startsWith(t,n))return n;if(e.startsWith("//",n))return e.indexOf(t,n)}return-1}*_forEachUnquotedChar(e,t){let s=null,n=0;for(let i=t;i<e.length;i++){let a=e[i];Ke(e.charCodeAt(i))&&(s===null||s===a)&&n%2===0?s=s===null?a:null:s===null&&(yield i),n=a==="\\"?n+1:0}}},pe;(function(r){r[r.None=0]="None",r[r.Writable=1]="Writable"})(pe||(pe={}));var U=class{constructor(e,t,s,n,i,a,h){this.input=e,this.location=t,this.absoluteOffset=s,this.tokens=n,this.parseFlags=i,this.errors=a,this.offset=h,this.rparensExpected=0,this.rbracketsExpected=0,this.rbracesExpected=0,this.context=pe.None,this.sourceSpanCache=new Map,this.index=0}peek(e){let t=this.index+e;return t<this.tokens.length?this.tokens[t]:Oe}get next(){return this.peek(0)}get atEOF(){return this.index>=this.tokens.length}get inputIndex(){return this.atEOF?this.currentEndIndex:this.next.index+this.offset}get currentEndIndex(){return this.index>0?this.peek(-1).end+this.offset:this.tokens.length===0?this.input.length+this.offset:this.next.index+this.offset}get currentAbsoluteOffset(){return this.absoluteOffset+this.inputIndex}span(e,t){let s=this.currentEndIndex;if(t!==void 0&&t>this.currentEndIndex&&(s=t),e>s){let n=s;s=e,e=n}return new R(e,s)}sourceSpan(e,t){let s=`${e}@${this.inputIndex}:${t}`;return this.sourceSpanCache.has(s)||this.sourceSpanCache.set(s,this.span(e,t).toAbsolute(this.absoluteOffset)),this.sourceSpanCache.get(s)}advance(){this.index++}withContext(e,t){this.context|=e;let s=t();return this.context^=e,s}consumeOptionalCharacter(e){return this.next.isCharacter(e)?(this.advance(),!0):!1}peekKeywordLet(){return this.next.isKeywordLet()}peekKeywordAs(){return this.next.isKeywordAs()}expectCharacter(e){this.consumeOptionalCharacter(e)||this.error(`Missing expected ${String.fromCharCode(e)}`)}consumeOptionalOperator(e){return this.next.isOperator(e)?(this.advance(),!0):!1}expectOperator(e){this.consumeOptionalOperator(e)||this.error(`Missing expected operator ${e}`)}prettyPrintToken(e){return e===Oe?"end of input":`token ${e}`}expectIdentifierOrKeyword(){let e=this.next;return!e.isIdentifier()&&!e.isKeyword()?(e.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(e,"expected identifier or keyword"):this.error(`Unexpected ${this.prettyPrintToken(e)}, expected identifier or keyword`),null):(this.advance(),e.toString())}expectIdentifierOrKeywordOrString(){let e=this.next;return!e.isIdentifier()&&!e.isKeyword()&&!e.isString()?(e.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(e,"expected identifier, keyword or string"):this.error(`Unexpected ${this.prettyPrintToken(e)}, expected identifier, keyword, or string`),""):(this.advance(),e.toString())}parseChain(){let e=[],t=this.inputIndex;for(;this.index<this.tokens.length;){let s=this.parsePipe();if(e.push(s),this.consumeOptionalCharacter(59))for(this.parseFlags&1||this.error("Binding expression cannot contain chained expression");this.consumeOptionalCharacter(59););else if(this.index<this.tokens.length){let n=this.index;if(this.error(`Unexpected token '${this.next}'`),this.index===n)break}}if(e.length===0){let s=this.offset,n=this.offset+this.input.length;return new C(this.span(s,n),this.sourceSpan(s,n))}return e.length==1?e[0]:new W(this.span(t),this.sourceSpan(t),e)}parsePipe(){let e=this.inputIndex,t=this.parseExpression();if(this.consumeOptionalOperator("|")){this.parseFlags&1&&this.error("Cannot have a pipe in an action expression");do{let s=this.inputIndex,n=this.expectIdentifierOrKeyword(),i,a;n!==null?i=this.sourceSpan(s):(n="",a=this.next.index!==-1?this.next.index:this.input.length+this.offset,i=new R(a,a).toAbsolute(this.absoluteOffset));let h=[];for(;this.consumeOptionalCharacter(58);)h.push(this.parseExpression());t=new Z(this.span(e),this.sourceSpan(e,a),t,n,h,i)}while(this.consumeOptionalOperator("|"))}return t}parseExpression(){return this.parseConditional()}parseConditional(){let e=this.inputIndex,t=this.parseLogicalOr();if(this.consumeOptionalOperator("?")){let s=this.parsePipe(),n;if(this.consumeOptionalCharacter(58))n=this.parsePipe();else{let i=this.inputIndex,a=this.input.substring(e,i);this.error(`Conditional expression ${a} requires all 3 expressions`),n=new C(this.span(e),this.sourceSpan(e))}return new Q(this.span(e),this.sourceSpan(e),t,s,n)}else return t}parseLogicalOr(){let e=this.inputIndex,t=this.parseLogicalAnd();for(;this.consumeOptionalOperator("||");){let s=this.parseLogicalAnd();t=new $(this.span(e),this.sourceSpan(e),"||",t,s)}return t}parseLogicalAnd(){let e=this.inputIndex,t=this.parseNullishCoalescing();for(;this.consumeOptionalOperator("&&");){let s=this.parseNullishCoalescing();t=new $(this.span(e),this.sourceSpan(e),"&&",t,s)}return t}parseNullishCoalescing(){let e=this.inputIndex,t=this.parseEquality();for(;this.consumeOptionalOperator("??");){let s=this.parseEquality();t=new $(this.span(e),this.sourceSpan(e),"??",t,s)}return t}parseEquality(){let e=this.inputIndex,t=this.parseRelational();for(;this.next.type==d.Operator;){let s=this.next.strValue;switch(s){case"==":case"===":case"!=":case"!==":this.advance();let n=this.parseRelational();t=new $(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parseRelational(){let e=this.inputIndex,t=this.parseAdditive();for(;this.next.type==d.Operator;){let s=this.next.strValue;switch(s){case"<":case">":case"<=":case">=":this.advance();let n=this.parseAdditive();t=new $(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parseAdditive(){let e=this.inputIndex,t=this.parseMultiplicative();for(;this.next.type==d.Operator;){let s=this.next.strValue;switch(s){case"+":case"-":this.advance();let n=this.parseMultiplicative();t=new $(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parseMultiplicative(){let e=this.inputIndex,t=this.parsePrefix();for(;this.next.type==d.Operator;){let s=this.next.strValue;switch(s){case"*":case"%":case"/":this.advance();let n=this.parsePrefix();t=new $(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parsePrefix(){if(this.next.type==d.Operator){let e=this.inputIndex,t=this.next.strValue,s;switch(t){case"+":return this.advance(),s=this.parsePrefix(),B.createPlus(this.span(e),this.sourceSpan(e),s);case"-":return this.advance(),s=this.parsePrefix(),B.createMinus(this.span(e),this.sourceSpan(e),s);case"!":return this.advance(),s=this.parsePrefix(),new ee(this.span(e),this.sourceSpan(e),s)}}return this.parseCallChain()}parseCallChain(){let e=this.inputIndex,t=this.parsePrimary();for(;;)if(this.consumeOptionalCharacter(46))t=this.parseAccessMember(t,e,!1);else if(this.consumeOptionalOperator("?."))this.consumeOptionalCharacter(40)?t=this.parseCall(t,e,!0):t=this.consumeOptionalCharacter(91)?this.parseKeyedReadOrWrite(t,e,!0):this.parseAccessMember(t,e,!0);else if(this.consumeOptionalCharacter(91))t=this.parseKeyedReadOrWrite(t,e,!1);else if(this.consumeOptionalCharacter(40))t=this.parseCall(t,e,!1);else if(this.consumeOptionalOperator("!"))t=new te(this.span(e),this.sourceSpan(e),t);else return t}parsePrimary(){let e=this.inputIndex;if(this.consumeOptionalCharacter(40)){this.rparensExpected++;let t=this.parsePipe();return this.rparensExpected--,this.expectCharacter(41),t}else{if(this.next.isKeywordNull())return this.advance(),new A(this.span(e),this.sourceSpan(e),null);if(this.next.isKeywordUndefined())return this.advance(),new A(this.span(e),this.sourceSpan(e),void 0);if(this.next.isKeywordTrue())return this.advance(),new A(this.span(e),this.sourceSpan(e),!0);if(this.next.isKeywordFalse())return this.advance(),new A(this.span(e),this.sourceSpan(e),!1);if(this.next.isKeywordThis())return this.advance(),new we(this.span(e),this.sourceSpan(e));if(this.consumeOptionalCharacter(91)){this.rbracketsExpected++;let t=this.parseExpressionList(93);return this.rbracketsExpected--,this.expectCharacter(93),new J(this.span(e),this.sourceSpan(e),t)}else{if(this.next.isCharacter(123))return this.parseLiteralMap();if(this.next.isIdentifier())return this.parseAccessMember(new L(this.span(e),this.sourceSpan(e)),e,!1);if(this.next.isNumber()){let t=this.next.toNumber();return this.advance(),new A(this.span(e),this.sourceSpan(e),t)}else if(this.next.isString()){let t=this.next.toString();return this.advance(),new A(this.span(e),this.sourceSpan(e),t)}else return this.next.isPrivateIdentifier()?(this._reportErrorForPrivateIdentifier(this.next,null),new C(this.span(e),this.sourceSpan(e))):this.index>=this.tokens.length?(this.error(`Unexpected end of expression: ${this.input}`),new C(this.span(e),this.sourceSpan(e))):(this.error(`Unexpected token ${this.next}`),new C(this.span(e),this.sourceSpan(e)))}}}parseExpressionList(e){let t=[];do if(!this.next.isCharacter(e))t.push(this.parsePipe());else break;while(this.consumeOptionalCharacter(44));return t}parseLiteralMap(){let e=[],t=[],s=this.inputIndex;if(this.expectCharacter(123),!this.consumeOptionalCharacter(125)){this.rbracesExpected++;do{let n=this.inputIndex,i=this.next.isString(),a=this.expectIdentifierOrKeywordOrString();if(e.push({key:a,quoted:i}),i)this.expectCharacter(58),t.push(this.parsePipe());else if(this.consumeOptionalCharacter(58))t.push(this.parsePipe());else{let h=this.span(n),g=this.sourceSpan(n);t.push(new K(h,g,g,new L(h,g),a))}}while(this.consumeOptionalCharacter(44)&&!this.next.isCharacter(125));this.rbracesExpected--,this.expectCharacter(125)}return new Y(this.span(s),this.sourceSpan(s),e,t)}parseAccessMember(e,t,s){let n=this.inputIndex,i=this.withContext(pe.Writable,()=>{let g=this.expectIdentifierOrKeyword()??"";return g.length===0&&this.error("Expected identifier for property access",e.span.end),g}),a=this.sourceSpan(n),h;if(s)this.consumeOptionalAssignment()?(this.error("The '?.' operator cannot be used in the assignment"),h=new C(this.span(t),this.sourceSpan(t))):h=new z(this.span(t),this.sourceSpan(t),a,e,i);else if(this.consumeOptionalAssignment()){if(!(this.parseFlags&1))return this.error("Bindings cannot contain assignments"),new C(this.span(t),this.sourceSpan(t));let g=this.parseConditional();h=new H(this.span(t),this.sourceSpan(t),a,e,i,g)}else h=new K(this.span(t),this.sourceSpan(t),a,e,i);return h}parseCall(e,t,s){let n=this.inputIndex;this.rparensExpected++;let i=this.parseCallArguments(),a=this.span(n,this.inputIndex).toAbsolute(this.absoluteOffset);this.expectCharacter(41),this.rparensExpected--;let h=this.span(t),g=this.sourceSpan(t);return s?new se(h,g,e,i,a):new re(h,g,e,i,a)}consumeOptionalAssignment(){return this.parseFlags&2&&this.next.isOperator("!")&&this.peek(1).isOperator("=")?(this.advance(),this.advance(),!0):this.consumeOptionalOperator("=")}parseCallArguments(){if(this.next.isCharacter(41))return[];let e=[];do e.push(this.parsePipe());while(this.consumeOptionalCharacter(44));return e}expectTemplateBindingKey(){let e="",t=!1,s=this.currentAbsoluteOffset;do e+=this.expectIdentifierOrKeywordOrString(),t=this.consumeOptionalOperator("-"),t&&(e+="-");while(t);return{source:e,span:new N(s,s+e.length)}}parseTemplateBindings(e){let t=[];for(t.push(...this.parseDirectiveKeywordBindings(e));this.index<this.tokens.length;){let s=this.parseLetBinding();if(s)t.push(s);else{let n=this.expectTemplateBindingKey(),i=this.parseAsBinding(n);i?t.push(i):(n.source=e.source+n.source.charAt(0).toUpperCase()+n.source.substring(1),t.push(...this.parseDirectiveKeywordBindings(n)))}this.consumeStatementTerminator()}return new Ge(t,[],this.errors)}parseKeyedReadOrWrite(e,t,s){return this.withContext(pe.Writable,()=>{this.rbracketsExpected++;let n=this.parsePipe();if(n instanceof C&&this.error("Key access cannot be empty"),this.rbracketsExpected--,this.expectCharacter(93),this.consumeOptionalOperator("="))if(s)this.error("The '?.' operator cannot be used in the assignment");else{let i=this.parseConditional();return new X(this.span(t),this.sourceSpan(t),e,n,i)}else return s?new j(this.span(t),this.sourceSpan(t),e,n):new q(this.span(t),this.sourceSpan(t),e,n);return new C(this.span(t),this.sourceSpan(t))})}parseDirectiveKeywordBindings(e){let t=[];this.consumeOptionalCharacter(58);let s=this.getDirectiveBoundTarget(),n=this.currentAbsoluteOffset,i=this.parseAsBinding(e);i||(this.consumeStatementTerminator(),n=this.currentAbsoluteOffset);let a=new N(e.span.start,n);return t.push(new ne(a,e,s)),i&&t.push(i),t}getDirectiveBoundTarget(){if(this.next===Oe||this.peekKeywordAs()||this.peekKeywordLet())return null;let e=this.parsePipe(),{start:t,end:s}=e.span,n=this.input.substring(t,s);return new P(e,n,this.location,this.absoluteOffset+t,this.errors)}parseAsBinding(e){if(!this.peekKeywordAs())return null;this.advance();let t=this.expectTemplateBindingKey();this.consumeStatementTerminator();let s=new N(e.span.start,this.currentAbsoluteOffset);return new T(s,t,e)}parseLetBinding(){if(!this.peekKeywordLet())return null;let e=this.currentAbsoluteOffset;this.advance();let t=this.expectTemplateBindingKey(),s=null;this.consumeOptionalOperator("=")&&(s=this.expectTemplateBindingKey()),this.consumeStatementTerminator();let n=new N(e,this.currentAbsoluteOffset);return new T(n,t,s)}consumeStatementTerminator(){this.consumeOptionalCharacter(59)||this.consumeOptionalCharacter(44)}error(e,t=null){this.errors.push(new D(e,this.input,this.locationText(t),this.location)),this.skip()}locationText(e=null){return e==null&&(e=this.index),e<this.tokens.length?`at column ${this.tokens[e].index+1} in`:"at the end of the expression"}_reportErrorForPrivateIdentifier(e,t){let s=`Private identifiers are not supported. Unexpected private identifier: ${e}`;t!==null&&(s+=`, ${t}`),this.error(s)}skip(){let e=this.next;for(;this.index<this.tokens.length&&!e.isCharacter(59)&&!e.isOperator("|")&&(this.rparensExpected<=0||!e.isCharacter(41))&&(this.rbracesExpected<=0||!e.isCharacter(125))&&(this.rbracketsExpected<=0||!e.isCharacter(93))&&(!(this.context&pe.Writable)||!e.isOperator("="));)this.next.isError()&&this.errors.push(new D(this.next.toString(),this.input,this.locationText(),this.location)),this.advance(),e=this.next}},De=class extends Ee{constructor(){super(...arguments),this.errors=[]}visitPipe(){this.errors.push("pipes")}};function kr(r){let e=new Map,t=0,s=0,n=0;for(;n<r.length;){let i=r[n];if(i.type===9){let[a,h]=i.parts;t+=h.length,s+=a.length}else{let a=i.parts.reduce((h,g)=>h+g.length,0);s+=a,t+=a}e.set(s,t),n++}return e}var St="angular-estree-parser",We="NgEstreeParser",Ve=0,Ie=[St,Ve];function wt(){return new fe(new le)}function Ne(r,e){let t=wt(),{astInput:s,comments:n}=Rr(r,t),{ast:i,errors:a}=e(s,t);return Ot(a),{ast:i,comments:n}}function yt(r){return Ne(r,(e,t)=>t.parseBinding(e,...Ie))}function Et(r){return Ne(r,(e,t)=>t.parseSimpleBinding(e,...Ie))}function Ct(r){return Ne(r,(e,t)=>t.parseAction(e,!1,...Ie))}function At(r){return Ne(r,(e,t)=>{let s=t.parseInterpolationExpression(e,...Ie);return s.ast=s.ast.expressions[0],s})}function $t(r){let e=wt(),{templateBindings:t,errors:s}=e.parseTemplateBindings(We,r,St,Ve,Ve);return Ot(s),t}function Ot(r){if(r.length!==0){let[{message:e}]=r;throw new SyntaxError(e.replace(/^Parser Error: | at column \d+ in [^]*$/g,""))}}function Rr(r,e){let t=e._commentStart(r);return t===null?{astInput:r,comments:[]}:{astInput:r.slice(0,t),comments:[{type:"Comment",value:r.slice(t+2),sourceSpan:{start:t,end:r.length}}]}}function It(r){return r instanceof B?"Unary":r instanceof $?"Binary":r instanceof Z?"BindingPipe":r instanceof re?"Call":r instanceof W?"Chain":r instanceof Q?"Conditional":r instanceof C?"EmptyExpr":r instanceof L?"ImplicitReceiver":r instanceof q?"KeyedRead":r instanceof j?"SafeKeyedRead":r instanceof X?"KeyedWrite":r instanceof J?"LiteralArray":r instanceof Y?"LiteralMap":r instanceof A?"LiteralPrimitive":r instanceof te?"NonNullAssert":r instanceof ee?"PrefixNot":r instanceof K?"PropertyRead":r instanceof H?"PropertyWrite":r instanceof se?"SafeCall":r instanceof z?"SafePropertyRead":r.type}function mt({start:r,end:e},t){let s=r,n=e;for(;n!==s&&/\s/.test(t[n-1]);)n--;for(;s!==n&&/\s/.test(t[s]);)s++;return{start:s,end:n}}function Lr({start:r,end:e},t){let s=r,n=e;for(;n!==t.length&&/\s/.test(t[n]);)n++;for(;s!==0&&/\s/.test(t[s-1]);)s--;return{start:s,end:n}}function br(r,e){return e[r.start-1]==="("&&e[r.end]===")"?{start:r.start-1,end:r.end+1}:r}function Nt(r,e,t){let s=0,n={start:r.start,end:r.end};for(;;){let i=Lr(n,e),a=br(i,e);if(i.start===a.start&&i.end===a.end)break;n.start=a.start,n.end=a.end,s++}return{hasParens:(t?s-1:s)!==0,outerSpan:mt(t?{start:n.start+1,end:n.end-1}:n,e),innerSpan:mt(r,e)}}function kt(r){return typeof r=="string"?e=>e===r:e=>r.test(e)}function Pt(r,e,t){let s=kt(e);for(let n=t;n>=0;n--){let i=r[n];if(s(i))return n}throw new Error(`Cannot find front char ${e} from index ${t} in ${JSON.stringify(r)}`)}function Rt(r,e,t){let s=kt(e);for(let n=t;n<r.length;n++){let i=r[n];if(s(i))return n}throw new Error(`Cannot find character ${e} from index ${t} in ${JSON.stringify(r)}`)}function Lt(r){return r.slice(0,1).toLowerCase()+r.slice(1)}var ge,ve=class{constructor(e){Je(this,"text");et(this,ge,void 0);this.text=e}locationForIndex(e){be(this,ge)??tt(this,ge,new st(this.text));let{line:t,column:s}=be(this,ge).locationForIndex(e);return{line:t+1,column:s,index:e}}getCharacterIndex(e,t){return Rt(this.text,e,t)}getCharacterLastIndex(e,t){return Pt(this.text,e,t)}};ge=new WeakMap;var Kr=(r,e,t)=>{if(!(r&&e==null))return Array.isArray(e)||typeof e=="string"?e[t<0?e.length+t:t]:e.at(t)},ke=Kr;var G=(r,e,t=!1)=>{let s=It(r);switch(s){case"Unary":{let{operator:o,expr:u}=r,v=n(u);return a("UnaryExpression",{prefix:!0,argument:v,operator:o},r.sourceSpan,{hasParentParens:t})}case"Binary":{let{left:o,operation:u,right:v}=r,c=n(o),x=n(v);return a(u==="&&"||u==="||"||u==="??"?"LogicalExpression":"BinaryExpression",{left:c,right:x,operator:u},{start:E(c),end:m(x)},{hasParentParens:t})}case"BindingPipe":{let{exp:o,name:u,args:v}=r,c=n(o),x=e.getCharacterIndex(/\S/,e.getCharacterIndex("|",m(c))+1),l=a("Identifier",{name:u},{start:x,end:x+u.length}),p=v.map(n);return a("NGPipeExpression",{left:c,right:l,arguments:p},{start:E(c),end:m(p.length===0?l:ke(!1,p,-1))},{hasParentParens:t})}case"Chain":{let{expressions:o}=r;return a("NGChainedExpression",{expressions:o.map(n)},r.sourceSpan,{hasParentParens:t})}case"Comment":{let{value:o}=r;return a("CommentLine",{value:o},r.sourceSpan,{processSpan:!1})}case"Conditional":{let{condition:o,trueExp:u,falseExp:v}=r,c=n(o),x=n(u),l=n(v);return a("ConditionalExpression",{test:c,consequent:x,alternate:l},{start:E(c),end:m(l)},{hasParentParens:t})}case"EmptyExpr":return a("NGEmptyExpression",{},r.sourceSpan,{hasParentParens:t});case"ImplicitReceiver":return a("ThisExpression",{},r.sourceSpan,{hasParentParens:t});case"KeyedRead":case"SafeKeyedRead":{let o=s==="SafeKeyedRead",{key:u}=r,v=Object.prototype.hasOwnProperty.call(r,"receiver")?r.receiver:r.obj,c=n(u);return h(v,c,{computed:!0,optional:o},{end:r.sourceSpan.end,hasParentParens:t})}case"LiteralArray":{let{expressions:o}=r;return a("ArrayExpression",{elements:o.map(n)},r.sourceSpan,{hasParentParens:t})}case"LiteralMap":{let{keys:o,values:u}=r,v=u.map(x=>n(x)),c=o.map(({key:x,quoted:l},p)=>{let k=v[p],S=E(k),I=m(k),ue=e.getCharacterIndex(/\S/,p===0?r.sourceSpan.start+1:e.getCharacterIndex(",",m(v[p-1]))+1),Ft=S===ue?I:e.getCharacterLastIndex(/\S/,e.getCharacterLastIndex(":",S-1)-1)+1,je={start:ue,end:Ft},me=l?a("StringLiteral",{value:x},je):a("Identifier",{name:x},je),Ut=me.end<me.start||ue===S;return a("ObjectProperty",{key:me,value:k,shorthand:Ut,computed:!1},{start:E(me),end:I})});return a("ObjectExpression",{properties:c},r.sourceSpan,{hasParentParens:t})}case"LiteralPrimitive":{let{value:o}=r;switch(typeof o){case"boolean":return a("BooleanLiteral",{value:o},r.sourceSpan,{hasParentParens:t});case"number":return a("NumericLiteral",{value:o},r.sourceSpan,{hasParentParens:t});case"object":return a("NullLiteral",{},r.sourceSpan,{hasParentParens:t});case"string":return a("StringLiteral",{value:o},r.sourceSpan,{hasParentParens:t});case"undefined":return a("Identifier",{name:"undefined"},r.sourceSpan,{hasParentParens:t});default:throw new Error(`Unexpected LiteralPrimitive value type ${typeof o}`)}}case"Call":case"SafeCall":{let o=s==="SafeCall",{receiver:u,args:v}=r,c=v.length===1?[i(v[0])]:v.map(n),x=n(u),l=f(x),p=o||l?"OptionalCallExpression":"CallExpression";return a(p,{callee:x,arguments:c,optional:p==="OptionalCallExpression"?o:void 0},{start:E(x),end:r.sourceSpan.end},{hasParentParens:t})}case"NonNullAssert":{let{expression:o}=r,u=n(o);return a("TSNonNullExpression",{expression:u},{start:E(u),end:r.sourceSpan.end},{hasParentParens:t})}case"PrefixNot":{let{expression:o}=r,u=n(o);return a("UnaryExpression",{prefix:!0,operator:"!",argument:u},{start:r.sourceSpan.start,end:m(u)},{hasParentParens:t})}case"PropertyRead":case"SafePropertyRead":{let o=s==="SafePropertyRead",{receiver:u,name:v}=r,c=e.getCharacterLastIndex(/\S/,r.sourceSpan.end-1)+1,x=a("Identifier",{name:v},{start:c-v.length,end:c},g(u)?{hasParentParens:t}:{});return h(u,x,{computed:!1,optional:o},{hasParentParens:t})}case"KeyedWrite":{let{key:o,value:u}=r,v=Object.prototype.hasOwnProperty.call(r,"receiver")?r.receiver:r.obj,c=n(o),x=n(u),l=h(v,c,{computed:!0,optional:!1},{end:e.getCharacterIndex("]",m(c))+1});return a("AssignmentExpression",{left:l,operator:"=",right:x},{start:E(l),end:m(x)},{hasParentParens:t})}case"PropertyWrite":{let{receiver:o,name:u,value:v}=r,c=n(v),x=e.getCharacterLastIndex(/\S/,e.getCharacterLastIndex("=",E(c)-1)-1)+1,l=a("Identifier",{name:u},{start:x-u.length,end:x}),p=h(o,l,{computed:!1,optional:!1});return a("AssignmentExpression",{left:p,operator:"=",right:c},{start:E(p),end:m(c)},{hasParentParens:t})}default:throw new Error(`Unexpected node ${s}`)}function n(o){return G(o,e)}function i(o){return G(o,e,!0)}function a(o,u,v,{processSpan:c=!0,hasParentParens:x=!1}={}){let l={type:o,...Pe(v,e,c,x),...u};switch(o){case"NumericLiteral":{let p=l;p.extra={...p.extra,raw:e.text.slice(p.start,p.end),rawValue:p.value};break}case"StringLiteral":{let p=l;p.extra={...p.extra,raw:e.text.slice(p.start,p.end),rawValue:p.value};break}case"ObjectProperty":{let p=l;p.shorthand&&(p.extra={...p.extra,shorthand:p.shorthand});break}}return l}function h(o,u,v,{end:c=m(u),hasParentParens:x=!1}={}){if(g(o)||o.sourceSpan.start===u.start)return u;let l=n(o),p=f(l);return a(v.optional||p?"OptionalMemberExpression":"MemberExpression",{object:l,property:u,computed:v.computed,...v.optional?{optional:!0}:p?{optional:!1}:null},{start:E(l),end:c},{hasParentParens:x})}function g(o){return o.sourceSpan.start>=o.sourceSpan.end||/^\s+$/.test(e.text.slice(o.sourceSpan.start,o.sourceSpan.end))}function f(o){return(o.type==="OptionalCallExpression"||o.type==="OptionalMemberExpression")&&!y(o)}function y(o){return o.extra&&o.extra.parenthesized}function E(o){return y(o)?o.extra.parenStart:o.start}function m(o){return y(o)?o.extra.parenEnd:o.end}};function Pe(r,e,t=!1,s=!1){if(!t){let{start:h,end:g}=r;return{start:h,end:g,loc:{filename:"",identifierName:"",start:e.locationForIndex(h),end:e.locationForIndex(g)}}}let{outerSpan:n,innerSpan:i,hasParens:a}=Nt(r,e.text,s);return{start:i.start,end:i.end,loc:{filename:"",identifierName:"",start:e.locationForIndex(i.start),end:e.locationForIndex(i.end)},...a&&{extra:{parenthesized:!0,parenStart:n.start,parenEnd:n.end}}}}function bt(r,e){r.forEach(o);let[t]=r,{key:s}=t,n=e.text.slice(t.sourceSpan.start,t.sourceSpan.end).trim().length===0?r.slice(1):r,i=[],a=null;for(let c=0;c<n.length;c++){let x=n[c];if(a&&E(a)&&m(x)&&x.value&&x.value.source===a.key.source){let l=f("NGMicrosyntaxKey",{name:x.key.source},x.key.span),p=(I,ue)=>({...I,...Pe({start:I.start,end:ue},e)}),k=I=>({...p(I,l.end),alias:l}),S=i.pop();if(S.type==="NGMicrosyntaxExpression")i.push(k(S));else if(S.type==="NGMicrosyntaxKeyedExpression"){let I=k(S.expression);i.push(p({...S,expression:I},I.end))}else throw new Error(`Unexpected type ${S.type}`)}else i.push(h(x,c));a=x}return f("NGMicrosyntax",{body:i},i.length===0?r[0].sourceSpan:{start:i[0].start,end:ke(!1,i,-1).end});function h(c,x){if(E(c)){let{key:l,value:p}=c;return p?x===0?f("NGMicrosyntaxExpression",{expression:g(p.ast),alias:null},p.sourceSpan):f("NGMicrosyntaxKeyedExpression",{key:f("NGMicrosyntaxKey",{name:y(l.source)},l.span),expression:f("NGMicrosyntaxExpression",{expression:g(p.ast),alias:null},p.sourceSpan)},{start:l.span.start,end:p.sourceSpan.end}):f("NGMicrosyntaxKey",{name:y(l.source)},l.span)}else{let{key:l,sourceSpan:p}=c;if(/^let\s$/.test(e.text.slice(p.start,p.start+4))){let{value:S}=c;return f("NGMicrosyntaxLet",{key:f("NGMicrosyntaxKey",{name:l.source},l.span),value:S?f("NGMicrosyntaxKey",{name:S.source},S.span):null},{start:p.start,end:S?S.span.end:l.span.end})}else{let S=v(c);return f("NGMicrosyntaxAs",{key:f("NGMicrosyntaxKey",{name:S.source},S.span),alias:f("NGMicrosyntaxKey",{name:l.source},l.span)},{start:S.span.start,end:l.span.end})}}}function g(c){return G(c,e)}function f(c,x,l,p=!0){return{type:c,...Pe(l,e,p),...x}}function y(c){return Lt(c.slice(s.source.length))}function E(c){return c instanceof ne}function m(c){return c instanceof T}function o(c){u(c.key.span),m(c)&&c.value&&u(c.value.span)}function u(c){if(e.text[c.start]!=='"'&&e.text[c.start]!=="'")return;let x=e.text[c.start],l=!1;for(let p=c.start+1;p<e.text.length;p++)switch(e.text[p]){case x:if(!l){c.end=p+1;return}default:l=!1;break;case"\\":l=!l;break}}function v(c){if(!c.value||c.value.source!==We)return c.value;let x=e.getCharacterIndex(/\S/,c.sourceSpan.start);return{source:"$implicit",span:{start:x,end:x}}}}function Re(r){return e=>{let{ast:t,comments:s}=r(e),n=new ve(e),i=G(t,n);return i.comments=s.map(a=>G(a,n)),i}}var Kt=Re(yt),Ss=Re(Et),Bt=Re(At),Qe=Re(Ct),Tt=r=>bt($t(r),new ve(r));function Br(r){return Array.isArray(r)&&r.length>0}var _t=Br;function He(r){var s;let e=r.range?r.range[0]:r.start,t=((s=r.declaration)==null?void 0:s.decorators)??r.decorators;return _t(t)?Math.min(He(t[0]),e):e}function Mt(r){return r.range?r.range[1]:r.end}function Le(r){return{astFormat:"estree",parse(e){let t=r(e);return{type:"NGRoot",node:r===Qe&&t.type!=="NGChainedExpression"?{...t,type:"NGChainedExpression",expressions:[t]}:t}},locStart:He,locEnd:Mt}}var Tr=Le(Qe),_r=Le(Kt),Mr=Le(Bt),Fr=Le(Tt);var Os=qe;export{Os as default,ze as parsers};
1
+ var Rt=Object.defineProperty;var ze=(r,e)=>{for(var t in e)Rt(r,t,{get:e[t],enumerable:!0})};var Qe={};ze(Qe,{parsers:()=>We});var We={};ze(We,{__ng_action:()=>Or,__ng_binding:()=>Nr,__ng_directive:()=>kr,__ng_interpolation:()=>Ir});var D=class{constructor(e,t,s,n){this.input=t,this.errLocation=s,this.ctxLocation=n,this.message=`Parser Error: ${e} ${s} [${t}] in ${n}`}},R=class{constructor(e,t){this.start=e,this.end=t}toAbsolute(e){return new I(e+this.start,e+this.end)}},w=class{constructor(e,t){this.span=e,this.sourceSpan=t}toString(){return"AST"}},V=class extends w{constructor(e,t,s){super(e,t),this.nameSpan=s}},$=class extends w{visit(e,t=null){}},L=class extends w{visit(e,t=null){return e.visitImplicitReceiver(this,t)}},me=class extends L{visit(e,t=null){var s;return(s=e.visitThisReceiver)==null?void 0:s.call(e,this,t)}},W=class extends w{constructor(e,t,s){super(e,t),this.expressions=s}visit(e,t=null){return e.visitChain(this,t)}},Q=class extends w{constructor(e,t,s,n,i){super(e,t),this.condition=s,this.trueExp=n,this.falseExp=i}visit(e,t=null){return e.visitConditional(this,t)}},b=class extends V{constructor(e,t,s,n,i){super(e,t,s),this.receiver=n,this.name=i}visit(e,t=null){return e.visitPropertyRead(this,t)}},H=class extends V{constructor(e,t,s,n,i,a){super(e,t,s),this.receiver=n,this.name=i,this.value=a}visit(e,t=null){return e.visitPropertyWrite(this,t)}},z=class extends V{constructor(e,t,s,n,i){super(e,t,s),this.receiver=n,this.name=i}visit(e,t=null){return e.visitSafePropertyRead(this,t)}},q=class extends w{constructor(e,t,s,n){super(e,t),this.receiver=s,this.key=n}visit(e,t=null){return e.visitKeyedRead(this,t)}},j=class extends w{constructor(e,t,s,n){super(e,t),this.receiver=s,this.key=n}visit(e,t=null){return e.visitSafeKeyedRead(this,t)}},X=class extends w{constructor(e,t,s,n,i){super(e,t),this.receiver=s,this.key=n,this.value=i}visit(e,t=null){return e.visitKeyedWrite(this,t)}},Z=class extends V{constructor(e,t,s,n,i,a){super(e,t,a),this.exp=s,this.name=n,this.args=i}visit(e,t=null){return e.visitPipe(this,t)}},C=class extends w{constructor(e,t,s){super(e,t),this.value=s}visit(e,t=null){return e.visitLiteralPrimitive(this,t)}},J=class extends w{constructor(e,t,s){super(e,t),this.expressions=s}visit(e,t=null){return e.visitLiteralArray(this,t)}},Y=class extends w{constructor(e,t,s,n){super(e,t),this.keys=s,this.values=n}visit(e,t=null){return e.visitLiteralMap(this,t)}},Se=class extends w{constructor(e,t,s,n){super(e,t),this.strings=s,this.expressions=n}visit(e,t=null){return e.visitInterpolation(this,t)}},A=class extends w{constructor(e,t,s,n,i){super(e,t),this.operation=s,this.left=n,this.right=i}visit(e,t=null){return e.visitBinary(this,t)}},B=class r extends A{static createMinus(e,t,s){return new r(e,t,"-",s,"-",new C(e,t,0),s)}static createPlus(e,t,s){return new r(e,t,"+",s,"-",s,new C(e,t,0))}constructor(e,t,s,n,i,a,h){super(e,t,i,a,h),this.operator=s,this.expr=n,this.left=null,this.right=null,this.operation=null}visit(e,t=null){return e.visitUnary!==void 0?e.visitUnary(this,t):e.visitBinary(this,t)}},ee=class extends w{constructor(e,t,s){super(e,t),this.expression=s}visit(e,t=null){return e.visitPrefixNot(this,t)}},te=class extends w{constructor(e,t,s){super(e,t),this.expression=s}visit(e,t=null){return e.visitNonNullAssert(this,t)}},re=class extends w{constructor(e,t,s,n,i){super(e,t),this.receiver=s,this.args=n,this.argumentSpan=i}visit(e,t=null){return e.visitCall(this,t)}},se=class extends w{constructor(e,t,s,n,i){super(e,t),this.receiver=s,this.args=n,this.argumentSpan=i}visit(e,t=null){return e.visitSafeCall(this,t)}},I=class{constructor(e,t){this.start=e,this.end=t}},P=class extends w{constructor(e,t,s,n,i){super(new R(0,t===null?0:t.length),new I(n,t===null?n:n+t.length)),this.ast=e,this.source=t,this.location=s,this.errors=i}visit(e,t=null){return e.visitASTWithSource?e.visitASTWithSource(this,t):this.ast.visit(e,t)}toString(){return`${this.source} in ${this.location}`}},T=class{constructor(e,t,s){this.sourceSpan=e,this.key=t,this.value=s}},ne=class{constructor(e,t,s){this.sourceSpan=e,this.key=t,this.value=s}},we=class{visit(e,t){e.visit(this,t)}visitUnary(e,t){this.visit(e.expr,t)}visitBinary(e,t){this.visit(e.left,t),this.visit(e.right,t)}visitChain(e,t){this.visitAll(e.expressions,t)}visitConditional(e,t){this.visit(e.condition,t),this.visit(e.trueExp,t),this.visit(e.falseExp,t)}visitPipe(e,t){this.visit(e.exp,t),this.visitAll(e.args,t)}visitImplicitReceiver(e,t){}visitThisReceiver(e,t){}visitInterpolation(e,t){this.visitAll(e.expressions,t)}visitKeyedRead(e,t){this.visit(e.receiver,t),this.visit(e.key,t)}visitKeyedWrite(e,t){this.visit(e.receiver,t),this.visit(e.key,t),this.visit(e.value,t)}visitLiteralArray(e,t){this.visitAll(e.expressions,t)}visitLiteralMap(e,t){this.visitAll(e.values,t)}visitLiteralPrimitive(e,t){}visitPrefixNot(e,t){this.visit(e.expression,t)}visitNonNullAssert(e,t){this.visit(e.expression,t)}visitPropertyRead(e,t){this.visit(e.receiver,t)}visitPropertyWrite(e,t){this.visit(e.receiver,t),this.visit(e.value,t)}visitSafePropertyRead(e,t){this.visit(e.receiver,t)}visitSafeKeyedRead(e,t){this.visit(e.receiver,t),this.visit(e.key,t)}visitCall(e,t){this.visit(e.receiver,t),this.visitAll(e.args,t)}visitSafeCall(e,t){this.visit(e.receiver,t),this.visitAll(e.args,t)}visitAll(e,t){for(let s of e)this.visit(s,t)}};var qe;(function(r){r[r.DEFAULT=0]="DEFAULT",r[r.LITERAL_ATTR=1]="LITERAL_ATTR",r[r.ANIMATION=2]="ANIMATION"})(qe||(qe={}));function je(r){return r>=9&&r<=32||r==160}function K(r){return 48<=r&&r<=57}function Xe(r){return r>=97&&r<=122||r>=65&&r<=90}function Re(r){return r===39||r===34||r===96}var f;(function(r){r[r.Character=0]="Character",r[r.Identifier=1]="Identifier",r[r.PrivateIdentifier=2]="PrivateIdentifier",r[r.Keyword=3]="Keyword",r[r.String=4]="String",r[r.Operator=5]="Operator",r[r.Number=6]="Number",r[r.Error=7]="Error"})(f||(f={}));var or=["var","let","as","null","undefined","true","false","if","else","this"],le=class{tokenize(e){let t=new be(e),s=[],n=t.scanToken();for(;n!=null;)s.push(n),n=t.scanToken();return s}},O=class{constructor(e,t,s,n,i){this.index=e,this.end=t,this.type=s,this.numValue=n,this.strValue=i}isCharacter(e){return this.type==f.Character&&this.numValue==e}isNumber(){return this.type==f.Number}isString(){return this.type==f.String}isOperator(e){return this.type==f.Operator&&this.strValue==e}isIdentifier(){return this.type==f.Identifier}isPrivateIdentifier(){return this.type==f.PrivateIdentifier}isKeyword(){return this.type==f.Keyword}isKeywordLet(){return this.type==f.Keyword&&this.strValue=="let"}isKeywordAs(){return this.type==f.Keyword&&this.strValue=="as"}isKeywordNull(){return this.type==f.Keyword&&this.strValue=="null"}isKeywordUndefined(){return this.type==f.Keyword&&this.strValue=="undefined"}isKeywordTrue(){return this.type==f.Keyword&&this.strValue=="true"}isKeywordFalse(){return this.type==f.Keyword&&this.strValue=="false"}isKeywordThis(){return this.type==f.Keyword&&this.strValue=="this"}isError(){return this.type==f.Error}toNumber(){return this.type==f.Number?this.numValue:-1}toString(){switch(this.type){case f.Character:case f.Identifier:case f.Keyword:case f.Operator:case f.PrivateIdentifier:case f.String:case f.Error:return this.strValue;case f.Number:return this.numValue.toString();default:return null}}};function tt(r,e,t){return new O(r,e,f.Character,t,String.fromCharCode(t))}function cr(r,e,t){return new O(r,e,f.Identifier,0,t)}function hr(r,e,t){return new O(r,e,f.PrivateIdentifier,0,t)}function pr(r,e,t){return new O(r,e,f.Keyword,0,t)}function Ke(r,e,t){return new O(r,e,f.Operator,0,t)}function ur(r,e,t){return new O(r,e,f.String,0,t)}function lr(r,e,t){return new O(r,e,f.Number,t,"")}function xr(r,e,t){return new O(r,e,f.Error,0,t)}var Ce=new O(-1,-1,f.Character,0,""),be=class{constructor(e){this.input=e,this.peek=0,this.index=-1,this.length=e.length,this.advance()}advance(){this.peek=++this.index>=this.length?0:this.input.charCodeAt(this.index)}scanToken(){let e=this.input,t=this.length,s=this.peek,n=this.index;for(;s<=32;)if(++n>=t){s=0;break}else s=e.charCodeAt(n);if(this.peek=s,this.index=n,n>=t)return null;if(rt(s))return this.scanIdentifier();if(K(s))return this.scanNumber(n);let i=n;switch(s){case 46:return this.advance(),K(this.peek)?this.scanNumber(i):tt(i,this.index,46);case 40:case 41:case 123:case 125:case 91:case 93:case 44:case 58:case 59:return this.scanCharacter(i,s);case 39:case 34:return this.scanString();case 35:return this.scanPrivateIdentifier();case 43:case 45:case 42:case 47:case 37:case 94:return this.scanOperator(i,String.fromCharCode(s));case 63:return this.scanQuestion(i);case 60:case 62:return this.scanComplexOperator(i,String.fromCharCode(s),61,"=");case 33:case 61:return this.scanComplexOperator(i,String.fromCharCode(s),61,"=",61,"=");case 38:return this.scanComplexOperator(i,"&",38,"&");case 124:return this.scanComplexOperator(i,"|",124,"|");case 160:for(;je(this.peek);)this.advance();return this.scanToken()}return this.advance(),this.error(`Unexpected character [${String.fromCharCode(s)}]`,0)}scanCharacter(e,t){return this.advance(),tt(e,this.index,t)}scanOperator(e,t){return this.advance(),Ke(e,this.index,t)}scanComplexOperator(e,t,s,n,i,a){this.advance();let h=t;return this.peek==s&&(this.advance(),h+=n),i!=null&&this.peek==i&&(this.advance(),h+=a),Ke(e,this.index,h)}scanIdentifier(){let e=this.index;for(this.advance();st(this.peek);)this.advance();let t=this.input.substring(e,this.index);return or.indexOf(t)>-1?pr(e,this.index,t):cr(e,this.index,t)}scanPrivateIdentifier(){let e=this.index;if(this.advance(),!rt(this.peek))return this.error("Invalid character [#]",-1);for(;st(this.peek);)this.advance();let t=this.input.substring(e,this.index);return hr(e,this.index,t)}scanNumber(e){let t=this.index===e,s=!1;for(this.advance();;){if(!K(this.peek))if(this.peek===95){if(!K(this.input.charCodeAt(this.index-1))||!K(this.input.charCodeAt(this.index+1)))return this.error("Invalid numeric separator",0);s=!0}else if(this.peek===46)t=!1;else if(dr(this.peek)){if(this.advance(),fr(this.peek)&&this.advance(),!K(this.peek))return this.error("Invalid exponent",-1);t=!1}else break;this.advance()}let n=this.input.substring(e,this.index);s&&(n=n.replace(/_/g,""));let i=t?gr(n):parseFloat(n);return lr(e,this.index,i)}scanString(){let e=this.index,t=this.peek;this.advance();let s="",n=this.index,i=this.input;for(;this.peek!=t;)if(this.peek==92){s+=i.substring(n,this.index);let h;if(this.advance(),this.peek==117){let g=i.substring(this.index+1,this.index+5);if(/^[0-9a-f]+$/i.test(g))h=parseInt(g,16);else return this.error(`Invalid unicode escape [\\u${g}]`,0);for(let d=0;d<5;d++)this.advance()}else h=vr(this.peek),this.advance();s+=String.fromCharCode(h),n=this.index}else{if(this.peek==0)return this.error("Unterminated quote",0);this.advance()}let a=i.substring(n,this.index);return this.advance(),ur(e,this.index,s+a)}scanQuestion(e){this.advance();let t="?";return(this.peek===63||this.peek===46)&&(t+=this.peek===46?".":"?",this.advance()),Ke(e,this.index,t)}error(e,t){let s=this.index+t;return xr(s,this.index,`Lexer Error: ${e} at column ${s} in expression [${this.input}]`)}};function rt(r){return 97<=r&&r<=122||65<=r&&r<=90||r==95||r==36}function st(r){return Xe(r)||K(r)||r==95||r==36}function dr(r){return r==101||r==69}function fr(r){return r==45||r==43}function vr(r){switch(r){case 110:return 10;case 102:return 12;case 114:return 13;case 116:return 9;case 118:return 11;default:return r}}function gr(r){let e=parseInt(r);if(isNaN(e))throw new Error("Invalid integer literal when parsing "+r);return e}var mr=[/^\s*$/,/[<>]/,/^[{}]$/,/&(#|[a-z])/i,/^\/\//];function ot(r,e){if(e!=null&&!(Array.isArray(e)&&e.length==2))throw new Error(`Expected '${r}' to be an array, [start, end].`);if(e!=null){let t=e[0],s=e[1];mr.forEach(n=>{if(n.test(t)||n.test(s))throw new Error(`['${t}', '${s}'] contains unusable interpolation symbol.`)})}}var Te=class r{static fromArray(e){return e?(ot("interpolation",e),new r(e[0],e[1])):F}constructor(e,t){this.start=e,this.end=t}},F=new Te("{{","}}");var _e=class{constructor(e,t,s){this.strings=e,this.expressions=t,this.offsets=s}},Me=class{constructor(e,t,s){this.templateBindings=e,this.warnings=t,this.errors=s}},fe=class{constructor(e){this._lexer=e,this.errors=[]}parseAction(e,t,s,n,i=F){this._checkNoInterpolation(e,s,i);let a=this._stripComments(e),h=this._lexer.tokenize(a),g=1;t&&(g|=2);let d=new U(e,s,n,h,g,this.errors,0).parseChain();return new P(d,e,s,n,this.errors)}parseBinding(e,t,s,n=F){let i=this._parseBindingAst(e,t,s,n);return new P(i,e,t,s,this.errors)}checkSimpleExpression(e){let t=new Fe;return e.visit(t),t.errors}parseSimpleBinding(e,t,s,n=F){let i=this._parseBindingAst(e,t,s,n),a=this.checkSimpleExpression(i);return a.length>0&&this._reportError(`Host binding expression cannot contain ${a.join(" ")}`,e,t),new P(i,e,t,s,this.errors)}_reportError(e,t,s,n){this.errors.push(new D(e,t,s,n))}_parseBindingAst(e,t,s,n){this._checkNoInterpolation(e,t,n);let i=this._stripComments(e),a=this._lexer.tokenize(i);return new U(e,t,s,a,0,this.errors,0).parseChain()}parseTemplateBindings(e,t,s,n,i){let a=this._lexer.tokenize(t);return new U(t,s,i,a,0,this.errors,0).parseTemplateBindings({source:e,span:new I(n,n+e.length)})}parseInterpolation(e,t,s,n,i=F){let{strings:a,expressions:h,offsets:g}=this.splitInterpolation(e,t,n,i);if(h.length===0)return null;let d=[];for(let y=0;y<h.length;++y){let E=h[y].text,m=this._stripComments(E),o=this._lexer.tokenize(m),u=new U(e,t,s,o,0,this.errors,g[y]).parseChain();d.push(u)}return this.createInterpolationAst(a.map(y=>y.text),d,e,t,s)}parseInterpolationExpression(e,t,s){let n=this._stripComments(e),i=this._lexer.tokenize(n),a=new U(e,t,s,i,0,this.errors,0).parseChain(),h=["",""];return this.createInterpolationAst(h,[a],e,t,s)}createInterpolationAst(e,t,s,n,i){let a=new R(0,s.length),h=new Se(a,a.toAbsolute(i),e,t);return new P(h,s,n,i,this.errors)}splitInterpolation(e,t,s,n=F){let i=[],a=[],h=[],g=s?Sr(s):null,d=0,y=!1,E=!1,{start:m,end:o}=n;for(;d<e.length;)if(y){let u=d,v=u+m.length,c=this._getInterpolationEndIndex(e,o,v);if(c===-1){y=!1,E=!0;break}let x=c+o.length,l=e.substring(v,c);l.trim().length===0&&this._reportError("Blank expressions are not allowed in interpolated strings",e,`at column ${d} in`,t),a.push({text:l,start:u,end:x});let k=((g==null?void 0:g.get(u))??u)+m.length;h.push(k),d=x,y=!1}else{let u=d;d=e.indexOf(m,d),d===-1&&(d=e.length);let v=e.substring(u,d);i.push({text:v,start:u,end:d}),y=!0}if(!y)if(E){let u=i[i.length-1];u.text+=e.substring(d),u.end=e.length}else i.push({text:e.substring(d),start:d,end:e.length});return new _e(i,a,h)}wrapLiteralPrimitive(e,t,s){let n=new R(0,e==null?0:e.length);return new P(new C(n,n.toAbsolute(s),e),e,t,s,this.errors)}_stripComments(e){let t=this._commentStart(e);return t!=null?e.substring(0,t):e}_commentStart(e){let t=null;for(let s=0;s<e.length-1;s++){let n=e.charCodeAt(s),i=e.charCodeAt(s+1);if(n===47&&i==47&&t==null)return s;t===n?t=null:t==null&&Re(n)&&(t=n)}return null}_checkNoInterpolation(e,t,{start:s,end:n}){let i=-1,a=-1;for(let h of this._forEachUnquotedChar(e,0))if(i===-1)e.startsWith(s)&&(i=h);else if(a=this._getInterpolationEndIndex(e,n,h),a>-1)break;i>-1&&a>-1&&this._reportError(`Got interpolation (${s}${n}) where expression was expected`,e,`at column ${i} in`,t)}_getInterpolationEndIndex(e,t,s){for(let n of this._forEachUnquotedChar(e,s)){if(e.startsWith(t,n))return n;if(e.startsWith("//",n))return e.indexOf(t,n)}return-1}*_forEachUnquotedChar(e,t){let s=null,n=0;for(let i=t;i<e.length;i++){let a=e[i];Re(e.charCodeAt(i))&&(s===null||s===a)&&n%2===0?s=s===null?a:null:s===null&&(yield i),n=a==="\\"?n+1:0}}},pe;(function(r){r[r.None=0]="None",r[r.Writable=1]="Writable"})(pe||(pe={}));var U=class{constructor(e,t,s,n,i,a,h){this.input=e,this.location=t,this.absoluteOffset=s,this.tokens=n,this.parseFlags=i,this.errors=a,this.offset=h,this.rparensExpected=0,this.rbracketsExpected=0,this.rbracesExpected=0,this.context=pe.None,this.sourceSpanCache=new Map,this.index=0}peek(e){let t=this.index+e;return t<this.tokens.length?this.tokens[t]:Ce}get next(){return this.peek(0)}get atEOF(){return this.index>=this.tokens.length}get inputIndex(){return this.atEOF?this.currentEndIndex:this.next.index+this.offset}get currentEndIndex(){return this.index>0?this.peek(-1).end+this.offset:this.tokens.length===0?this.input.length+this.offset:this.next.index+this.offset}get currentAbsoluteOffset(){return this.absoluteOffset+this.inputIndex}span(e,t){let s=this.currentEndIndex;if(t!==void 0&&t>this.currentEndIndex&&(s=t),e>s){let n=s;s=e,e=n}return new R(e,s)}sourceSpan(e,t){let s=`${e}@${this.inputIndex}:${t}`;return this.sourceSpanCache.has(s)||this.sourceSpanCache.set(s,this.span(e,t).toAbsolute(this.absoluteOffset)),this.sourceSpanCache.get(s)}advance(){this.index++}withContext(e,t){this.context|=e;let s=t();return this.context^=e,s}consumeOptionalCharacter(e){return this.next.isCharacter(e)?(this.advance(),!0):!1}peekKeywordLet(){return this.next.isKeywordLet()}peekKeywordAs(){return this.next.isKeywordAs()}expectCharacter(e){this.consumeOptionalCharacter(e)||this.error(`Missing expected ${String.fromCharCode(e)}`)}consumeOptionalOperator(e){return this.next.isOperator(e)?(this.advance(),!0):!1}expectOperator(e){this.consumeOptionalOperator(e)||this.error(`Missing expected operator ${e}`)}prettyPrintToken(e){return e===Ce?"end of input":`token ${e}`}expectIdentifierOrKeyword(){let e=this.next;return!e.isIdentifier()&&!e.isKeyword()?(e.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(e,"expected identifier or keyword"):this.error(`Unexpected ${this.prettyPrintToken(e)}, expected identifier or keyword`),null):(this.advance(),e.toString())}expectIdentifierOrKeywordOrString(){let e=this.next;return!e.isIdentifier()&&!e.isKeyword()&&!e.isString()?(e.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(e,"expected identifier, keyword or string"):this.error(`Unexpected ${this.prettyPrintToken(e)}, expected identifier, keyword, or string`),""):(this.advance(),e.toString())}parseChain(){let e=[],t=this.inputIndex;for(;this.index<this.tokens.length;){let s=this.parsePipe();if(e.push(s),this.consumeOptionalCharacter(59))for(this.parseFlags&1||this.error("Binding expression cannot contain chained expression");this.consumeOptionalCharacter(59););else if(this.index<this.tokens.length){let n=this.index;if(this.error(`Unexpected token '${this.next}'`),this.index===n)break}}if(e.length===0){let s=this.offset,n=this.offset+this.input.length;return new $(this.span(s,n),this.sourceSpan(s,n))}return e.length==1?e[0]:new W(this.span(t),this.sourceSpan(t),e)}parsePipe(){let e=this.inputIndex,t=this.parseExpression();if(this.consumeOptionalOperator("|")){this.parseFlags&1&&this.error("Cannot have a pipe in an action expression");do{let s=this.inputIndex,n=this.expectIdentifierOrKeyword(),i,a;n!==null?i=this.sourceSpan(s):(n="",a=this.next.index!==-1?this.next.index:this.input.length+this.offset,i=new R(a,a).toAbsolute(this.absoluteOffset));let h=[];for(;this.consumeOptionalCharacter(58);)h.push(this.parseExpression());t=new Z(this.span(e),this.sourceSpan(e,a),t,n,h,i)}while(this.consumeOptionalOperator("|"))}return t}parseExpression(){return this.parseConditional()}parseConditional(){let e=this.inputIndex,t=this.parseLogicalOr();if(this.consumeOptionalOperator("?")){let s=this.parsePipe(),n;if(this.consumeOptionalCharacter(58))n=this.parsePipe();else{let i=this.inputIndex,a=this.input.substring(e,i);this.error(`Conditional expression ${a} requires all 3 expressions`),n=new $(this.span(e),this.sourceSpan(e))}return new Q(this.span(e),this.sourceSpan(e),t,s,n)}else return t}parseLogicalOr(){let e=this.inputIndex,t=this.parseLogicalAnd();for(;this.consumeOptionalOperator("||");){let s=this.parseLogicalAnd();t=new A(this.span(e),this.sourceSpan(e),"||",t,s)}return t}parseLogicalAnd(){let e=this.inputIndex,t=this.parseNullishCoalescing();for(;this.consumeOptionalOperator("&&");){let s=this.parseNullishCoalescing();t=new A(this.span(e),this.sourceSpan(e),"&&",t,s)}return t}parseNullishCoalescing(){let e=this.inputIndex,t=this.parseEquality();for(;this.consumeOptionalOperator("??");){let s=this.parseEquality();t=new A(this.span(e),this.sourceSpan(e),"??",t,s)}return t}parseEquality(){let e=this.inputIndex,t=this.parseRelational();for(;this.next.type==f.Operator;){let s=this.next.strValue;switch(s){case"==":case"===":case"!=":case"!==":this.advance();let n=this.parseRelational();t=new A(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parseRelational(){let e=this.inputIndex,t=this.parseAdditive();for(;this.next.type==f.Operator;){let s=this.next.strValue;switch(s){case"<":case">":case"<=":case">=":this.advance();let n=this.parseAdditive();t=new A(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parseAdditive(){let e=this.inputIndex,t=this.parseMultiplicative();for(;this.next.type==f.Operator;){let s=this.next.strValue;switch(s){case"+":case"-":this.advance();let n=this.parseMultiplicative();t=new A(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parseMultiplicative(){let e=this.inputIndex,t=this.parsePrefix();for(;this.next.type==f.Operator;){let s=this.next.strValue;switch(s){case"*":case"%":case"/":this.advance();let n=this.parsePrefix();t=new A(this.span(e),this.sourceSpan(e),s,t,n);continue}break}return t}parsePrefix(){if(this.next.type==f.Operator){let e=this.inputIndex,t=this.next.strValue,s;switch(t){case"+":return this.advance(),s=this.parsePrefix(),B.createPlus(this.span(e),this.sourceSpan(e),s);case"-":return this.advance(),s=this.parsePrefix(),B.createMinus(this.span(e),this.sourceSpan(e),s);case"!":return this.advance(),s=this.parsePrefix(),new ee(this.span(e),this.sourceSpan(e),s)}}return this.parseCallChain()}parseCallChain(){let e=this.inputIndex,t=this.parsePrimary();for(;;)if(this.consumeOptionalCharacter(46))t=this.parseAccessMember(t,e,!1);else if(this.consumeOptionalOperator("?."))this.consumeOptionalCharacter(40)?t=this.parseCall(t,e,!0):t=this.consumeOptionalCharacter(91)?this.parseKeyedReadOrWrite(t,e,!0):this.parseAccessMember(t,e,!0);else if(this.consumeOptionalCharacter(91))t=this.parseKeyedReadOrWrite(t,e,!1);else if(this.consumeOptionalCharacter(40))t=this.parseCall(t,e,!1);else if(this.consumeOptionalOperator("!"))t=new te(this.span(e),this.sourceSpan(e),t);else return t}parsePrimary(){let e=this.inputIndex;if(this.consumeOptionalCharacter(40)){this.rparensExpected++;let t=this.parsePipe();return this.rparensExpected--,this.expectCharacter(41),t}else{if(this.next.isKeywordNull())return this.advance(),new C(this.span(e),this.sourceSpan(e),null);if(this.next.isKeywordUndefined())return this.advance(),new C(this.span(e),this.sourceSpan(e),void 0);if(this.next.isKeywordTrue())return this.advance(),new C(this.span(e),this.sourceSpan(e),!0);if(this.next.isKeywordFalse())return this.advance(),new C(this.span(e),this.sourceSpan(e),!1);if(this.next.isKeywordThis())return this.advance(),new me(this.span(e),this.sourceSpan(e));if(this.consumeOptionalCharacter(91)){this.rbracketsExpected++;let t=this.parseExpressionList(93);return this.rbracketsExpected--,this.expectCharacter(93),new J(this.span(e),this.sourceSpan(e),t)}else{if(this.next.isCharacter(123))return this.parseLiteralMap();if(this.next.isIdentifier())return this.parseAccessMember(new L(this.span(e),this.sourceSpan(e)),e,!1);if(this.next.isNumber()){let t=this.next.toNumber();return this.advance(),new C(this.span(e),this.sourceSpan(e),t)}else if(this.next.isString()){let t=this.next.toString();return this.advance(),new C(this.span(e),this.sourceSpan(e),t)}else return this.next.isPrivateIdentifier()?(this._reportErrorForPrivateIdentifier(this.next,null),new $(this.span(e),this.sourceSpan(e))):this.index>=this.tokens.length?(this.error(`Unexpected end of expression: ${this.input}`),new $(this.span(e),this.sourceSpan(e))):(this.error(`Unexpected token ${this.next}`),new $(this.span(e),this.sourceSpan(e)))}}}parseExpressionList(e){let t=[];do if(!this.next.isCharacter(e))t.push(this.parsePipe());else break;while(this.consumeOptionalCharacter(44));return t}parseLiteralMap(){let e=[],t=[],s=this.inputIndex;if(this.expectCharacter(123),!this.consumeOptionalCharacter(125)){this.rbracesExpected++;do{let n=this.inputIndex,i=this.next.isString(),a=this.expectIdentifierOrKeywordOrString();if(e.push({key:a,quoted:i}),i)this.expectCharacter(58),t.push(this.parsePipe());else if(this.consumeOptionalCharacter(58))t.push(this.parsePipe());else{let h=this.span(n),g=this.sourceSpan(n);t.push(new b(h,g,g,new L(h,g),a))}}while(this.consumeOptionalCharacter(44)&&!this.next.isCharacter(125));this.rbracesExpected--,this.expectCharacter(125)}return new Y(this.span(s),this.sourceSpan(s),e,t)}parseAccessMember(e,t,s){let n=this.inputIndex,i=this.withContext(pe.Writable,()=>{let g=this.expectIdentifierOrKeyword()??"";return g.length===0&&this.error("Expected identifier for property access",e.span.end),g}),a=this.sourceSpan(n),h;if(s)this.consumeOptionalAssignment()?(this.error("The '?.' operator cannot be used in the assignment"),h=new $(this.span(t),this.sourceSpan(t))):h=new z(this.span(t),this.sourceSpan(t),a,e,i);else if(this.consumeOptionalAssignment()){if(!(this.parseFlags&1))return this.error("Bindings cannot contain assignments"),new $(this.span(t),this.sourceSpan(t));let g=this.parseConditional();h=new H(this.span(t),this.sourceSpan(t),a,e,i,g)}else h=new b(this.span(t),this.sourceSpan(t),a,e,i);return h}parseCall(e,t,s){let n=this.inputIndex;this.rparensExpected++;let i=this.parseCallArguments(),a=this.span(n,this.inputIndex).toAbsolute(this.absoluteOffset);this.expectCharacter(41),this.rparensExpected--;let h=this.span(t),g=this.sourceSpan(t);return s?new se(h,g,e,i,a):new re(h,g,e,i,a)}consumeOptionalAssignment(){return this.parseFlags&2&&this.next.isOperator("!")&&this.peek(1).isOperator("=")?(this.advance(),this.advance(),!0):this.consumeOptionalOperator("=")}parseCallArguments(){if(this.next.isCharacter(41))return[];let e=[];do e.push(this.parsePipe());while(this.consumeOptionalCharacter(44));return e}expectTemplateBindingKey(){let e="",t=!1,s=this.currentAbsoluteOffset;do e+=this.expectIdentifierOrKeywordOrString(),t=this.consumeOptionalOperator("-"),t&&(e+="-");while(t);return{source:e,span:new I(s,s+e.length)}}parseTemplateBindings(e){let t=[];for(t.push(...this.parseDirectiveKeywordBindings(e));this.index<this.tokens.length;){let s=this.parseLetBinding();if(s)t.push(s);else{let n=this.expectTemplateBindingKey(),i=this.parseAsBinding(n);i?t.push(i):(n.source=e.source+n.source.charAt(0).toUpperCase()+n.source.substring(1),t.push(...this.parseDirectiveKeywordBindings(n)))}this.consumeStatementTerminator()}return new Me(t,[],this.errors)}parseKeyedReadOrWrite(e,t,s){return this.withContext(pe.Writable,()=>{this.rbracketsExpected++;let n=this.parsePipe();if(n instanceof $&&this.error("Key access cannot be empty"),this.rbracketsExpected--,this.expectCharacter(93),this.consumeOptionalOperator("="))if(s)this.error("The '?.' operator cannot be used in the assignment");else{let i=this.parseConditional();return new X(this.span(t),this.sourceSpan(t),e,n,i)}else return s?new j(this.span(t),this.sourceSpan(t),e,n):new q(this.span(t),this.sourceSpan(t),e,n);return new $(this.span(t),this.sourceSpan(t))})}parseDirectiveKeywordBindings(e){let t=[];this.consumeOptionalCharacter(58);let s=this.getDirectiveBoundTarget(),n=this.currentAbsoluteOffset,i=this.parseAsBinding(e);i||(this.consumeStatementTerminator(),n=this.currentAbsoluteOffset);let a=new I(e.span.start,n);return t.push(new ne(a,e,s)),i&&t.push(i),t}getDirectiveBoundTarget(){if(this.next===Ce||this.peekKeywordAs()||this.peekKeywordLet())return null;let e=this.parsePipe(),{start:t,end:s}=e.span,n=this.input.substring(t,s);return new P(e,n,this.location,this.absoluteOffset+t,this.errors)}parseAsBinding(e){if(!this.peekKeywordAs())return null;this.advance();let t=this.expectTemplateBindingKey();this.consumeStatementTerminator();let s=new I(e.span.start,this.currentAbsoluteOffset);return new T(s,t,e)}parseLetBinding(){if(!this.peekKeywordLet())return null;let e=this.currentAbsoluteOffset;this.advance();let t=this.expectTemplateBindingKey(),s=null;this.consumeOptionalOperator("=")&&(s=this.expectTemplateBindingKey()),this.consumeStatementTerminator();let n=new I(e,this.currentAbsoluteOffset);return new T(n,t,s)}consumeStatementTerminator(){this.consumeOptionalCharacter(59)||this.consumeOptionalCharacter(44)}error(e,t=null){this.errors.push(new D(e,this.input,this.locationText(t),this.location)),this.skip()}locationText(e=null){return e==null&&(e=this.index),e<this.tokens.length?`at column ${this.tokens[e].index+1} in`:"at the end of the expression"}_reportErrorForPrivateIdentifier(e,t){let s=`Private identifiers are not supported. Unexpected private identifier: ${e}`;t!==null&&(s+=`, ${t}`),this.error(s)}skip(){let e=this.next;for(;this.index<this.tokens.length&&!e.isCharacter(59)&&!e.isOperator("|")&&(this.rparensExpected<=0||!e.isCharacter(41))&&(this.rbracesExpected<=0||!e.isCharacter(125))&&(this.rbracketsExpected<=0||!e.isCharacter(93))&&(!(this.context&pe.Writable)||!e.isOperator("="));)this.next.isError()&&this.errors.push(new D(this.next.toString(),this.input,this.locationText(),this.location)),this.advance(),e=this.next}},Fe=class extends we{constructor(){super(...arguments),this.errors=[]}visitPipe(){this.errors.push("pipes")}};function Sr(r){let e=new Map,t=0,s=0,n=0;for(;n<r.length;){let i=r[n];if(i.type===9){let[a,h]=i.parts;t+=h.length,s+=a.length}else{let a=i.parts.reduce((h,g)=>h+g.length,0);s+=a,t+=a}e.set(s,t),n++}return e}var ht="angular-estree-parser",Ge="NgEstreeParser",Ue=0,Ae=[ht,Ue];function pt(){return new fe(new le)}function Oe(r,e){let t=pt(),{astInput:s,comments:n}=yr(r,t),{ast:i,errors:a}=e(s,t);return vt(a),{ast:i,comments:n}}function ut(r){return Oe(r,(e,t)=>t.parseBinding(e,...Ae))}function lt(r){return Oe(r,(e,t)=>t.parseSimpleBinding(e,...Ae))}function xt(r){return Oe(r,(e,t)=>t.parseAction(e,!1,...Ae))}function dt(r){return Oe(r,(e,t)=>{let s=t.parseInterpolationExpression(e,...Ae);return s.ast=s.ast.expressions[0],s})}function ft(r){let e=pt(),{templateBindings:t,errors:s}=e.parseTemplateBindings(Ge,r,ht,Ue,Ue);return vt(s),t}function vt(r){if(r.length!==0){let[{message:e}]=r;throw new SyntaxError(e.replace(/^Parser Error: | at column \d+ in [^]*$/g,""))}}function yr(r,e){let t=e._commentStart(r);return t===null?{astInput:r,comments:[]}:{astInput:r.slice(0,t),comments:[{type:"Comment",value:r.slice(t+2),sourceSpan:{start:t,end:r.length}}]}}function gt(r){return r instanceof B?"Unary":r instanceof A?"Binary":r instanceof Z?"BindingPipe":r instanceof re?"Call":r instanceof W?"Chain":r instanceof Q?"Conditional":r instanceof $?"EmptyExpr":r instanceof L?"ImplicitReceiver":r instanceof q?"KeyedRead":r instanceof j?"SafeKeyedRead":r instanceof X?"KeyedWrite":r instanceof J?"LiteralArray":r instanceof Y?"LiteralMap":r instanceof C?"LiteralPrimitive":r instanceof te?"NonNullAssert":r instanceof ee?"PrefixNot":r instanceof b?"PropertyRead":r instanceof H?"PropertyWrite":r instanceof se?"SafeCall":r instanceof z?"SafePropertyRead":r.type}function ct({start:r,end:e},t){let s=r,n=e;for(;n!==s&&/\s/.test(t[n-1]);)n--;for(;s!==n&&/\s/.test(t[s]);)s++;return{start:s,end:n}}function Er({start:r,end:e},t){let s=r,n=e;for(;n!==t.length&&/\s/.test(t[n]);)n++;for(;s!==0&&/\s/.test(t[s-1]);)s--;return{start:s,end:n}}function $r(r,e){return e[r.start-1]==="("&&e[r.end]===")"?{start:r.start-1,end:r.end+1}:r}function mt(r,e,t){let s=0,n={start:r.start,end:r.end};for(;;){let i=Er(n,e),a=$r(i,e);if(i.start===a.start&&i.end===a.end)break;n.start=a.start,n.end=a.end,s++}return{hasParens:(t?s-1:s)!==0,outerSpan:ct(t?{start:n.start+1,end:n.end-1}:n,e),innerSpan:ct(r,e)}}function St(r){return typeof r=="string"?e=>e===r:e=>r.test(e)}function wt(r,e,t){let s=St(e);for(let n=t;n>=0;n--){let i=r[n];if(s(i))return n}throw new Error(`Cannot find front char ${e} from index ${t} in ${JSON.stringify(r)}`)}function yt(r,e,t){let s=St(e);for(let n=t;n<r.length;n++){let i=r[n];if(s(i))return n}throw new Error(`Cannot find character ${e} from index ${t} in ${JSON.stringify(r)}`)}function Et(r){return r.slice(0,1).toLowerCase()+r.slice(1)}var ve=class{text;constructor(e){this.text=e}getCharacterIndex(e,t){return yt(this.text,e,t)}getCharacterLastIndex(e,t){return wt(this.text,e,t)}};var Cr=(r,e,t)=>{if(!(r&&e==null))return Array.isArray(e)||typeof e=="string"?e[t<0?e.length+t:t]:e.at(t)},Ne=Cr;var G=(r,e,t=!1)=>{let s=gt(r);switch(s){case"Unary":{let{operator:o,expr:u}=r,v=n(u);return a("UnaryExpression",{prefix:!0,argument:v,operator:o},r.sourceSpan,{hasParentParens:t})}case"Binary":{let{left:o,operation:u,right:v}=r,c=n(o),x=n(v);return a(u==="&&"||u==="||"||u==="??"?"LogicalExpression":"BinaryExpression",{left:c,right:x,operator:u},{start:E(c),end:m(x)},{hasParentParens:t})}case"BindingPipe":{let{exp:o,name:u,args:v}=r,c=n(o),x=e.getCharacterIndex(/\S/,e.getCharacterIndex("|",m(c))+1),l=a("Identifier",{name:u},{start:x,end:x+u.length}),p=v.map(n);return a("NGPipeExpression",{left:c,right:l,arguments:p},{start:E(c),end:m(p.length===0?l:Ne(!1,p,-1))},{hasParentParens:t})}case"Chain":{let{expressions:o}=r;return a("NGChainedExpression",{expressions:o.map(n)},r.sourceSpan,{hasParentParens:t})}case"Comment":{let{value:o}=r;return a("CommentLine",{value:o},r.sourceSpan,{processSpan:!1})}case"Conditional":{let{condition:o,trueExp:u,falseExp:v}=r,c=n(o),x=n(u),l=n(v);return a("ConditionalExpression",{test:c,consequent:x,alternate:l},{start:E(c),end:m(l)},{hasParentParens:t})}case"EmptyExpr":return a("NGEmptyExpression",{},r.sourceSpan,{hasParentParens:t});case"ImplicitReceiver":return a("ThisExpression",{},r.sourceSpan,{hasParentParens:t});case"KeyedRead":case"SafeKeyedRead":{let o=s==="SafeKeyedRead",{key:u}=r,v=Object.prototype.hasOwnProperty.call(r,"receiver")?r.receiver:r.obj,c=n(u);return h(v,c,{computed:!0,optional:o},{end:r.sourceSpan.end,hasParentParens:t})}case"LiteralArray":{let{expressions:o}=r;return a("ArrayExpression",{elements:o.map(n)},r.sourceSpan,{hasParentParens:t})}case"LiteralMap":{let{keys:o,values:u}=r,v=u.map(x=>n(x)),c=o.map(({key:x,quoted:l},p)=>{let k=v[p],S=E(k),N=m(k),ue=e.getCharacterIndex(/\S/,p===0?r.sourceSpan.start+1:e.getCharacterIndex(",",m(v[p-1]))+1),kt=S===ue?N:e.getCharacterLastIndex(/\S/,e.getCharacterLastIndex(":",S-1)-1)+1,He={start:ue,end:kt},ge=l?a("StringLiteral",{value:x},He):a("Identifier",{name:x},He),Pt=ge.end<ge.start||ue===S;return a("ObjectProperty",{key:ge,value:k,shorthand:Pt,computed:!1},{start:E(ge),end:N})});return a("ObjectExpression",{properties:c},r.sourceSpan,{hasParentParens:t})}case"LiteralPrimitive":{let{value:o}=r;switch(typeof o){case"boolean":return a("BooleanLiteral",{value:o},r.sourceSpan,{hasParentParens:t});case"number":return a("NumericLiteral",{value:o},r.sourceSpan,{hasParentParens:t});case"object":return a("NullLiteral",{},r.sourceSpan,{hasParentParens:t});case"string":return a("StringLiteral",{value:o},r.sourceSpan,{hasParentParens:t});case"undefined":return a("Identifier",{name:"undefined"},r.sourceSpan,{hasParentParens:t});default:throw new Error(`Unexpected LiteralPrimitive value type ${typeof o}`)}}case"Call":case"SafeCall":{let o=s==="SafeCall",{receiver:u,args:v}=r,c=v.length===1?[i(v[0])]:v.map(n),x=n(u),l=d(x),p=o||l?"OptionalCallExpression":"CallExpression";return a(p,{callee:x,arguments:c,optional:p==="OptionalCallExpression"?o:void 0},{start:E(x),end:r.sourceSpan.end},{hasParentParens:t})}case"NonNullAssert":{let{expression:o}=r,u=n(o);return a("TSNonNullExpression",{expression:u},{start:E(u),end:r.sourceSpan.end},{hasParentParens:t})}case"PrefixNot":{let{expression:o}=r,u=n(o);return a("UnaryExpression",{prefix:!0,operator:"!",argument:u},{start:r.sourceSpan.start,end:m(u)},{hasParentParens:t})}case"PropertyRead":case"SafePropertyRead":{let o=s==="SafePropertyRead",{receiver:u,name:v}=r,c=e.getCharacterLastIndex(/\S/,r.sourceSpan.end-1)+1,x=a("Identifier",{name:v},{start:c-v.length,end:c},g(u)?{hasParentParens:t}:{});return h(u,x,{computed:!1,optional:o},{hasParentParens:t})}case"KeyedWrite":{let{key:o,value:u}=r,v=Object.prototype.hasOwnProperty.call(r,"receiver")?r.receiver:r.obj,c=n(o),x=n(u),l=h(v,c,{computed:!0,optional:!1},{end:e.getCharacterIndex("]",m(c))+1});return a("AssignmentExpression",{left:l,operator:"=",right:x},{start:E(l),end:m(x)},{hasParentParens:t})}case"PropertyWrite":{let{receiver:o,name:u,value:v}=r,c=n(v),x=e.getCharacterLastIndex(/\S/,e.getCharacterLastIndex("=",E(c)-1)-1)+1,l=a("Identifier",{name:u},{start:x-u.length,end:x}),p=h(o,l,{computed:!1,optional:!1});return a("AssignmentExpression",{left:p,operator:"=",right:c},{start:E(p),end:m(c)},{hasParentParens:t})}default:throw new Error(`Unexpected node ${s}`)}function n(o){return G(o,e)}function i(o){return G(o,e,!0)}function a(o,u,v,{processSpan:c=!0,hasParentParens:x=!1}={}){let l={type:o,...Ie(v,e,c,x),...u};switch(o){case"NumericLiteral":{let p=l;p.extra={...p.extra,raw:e.text.slice(p.start,p.end),rawValue:p.value};break}case"StringLiteral":{let p=l;p.extra={...p.extra,raw:e.text.slice(p.start,p.end),rawValue:p.value};break}case"ObjectProperty":{let p=l;p.shorthand&&(p.extra={...p.extra,shorthand:p.shorthand});break}}return l}function h(o,u,v,{end:c=m(u),hasParentParens:x=!1}={}){if(g(o)||o.sourceSpan.start===u.start)return u;let l=n(o),p=d(l);return a(v.optional||p?"OptionalMemberExpression":"MemberExpression",{object:l,property:u,computed:v.computed,...v.optional?{optional:!0}:p?{optional:!1}:null},{start:E(l),end:c},{hasParentParens:x})}function g(o){return o.sourceSpan.start>=o.sourceSpan.end||/^\s+$/.test(e.text.slice(o.sourceSpan.start,o.sourceSpan.end))}function d(o){return(o.type==="OptionalCallExpression"||o.type==="OptionalMemberExpression")&&!y(o)}function y(o){return o.extra&&o.extra.parenthesized}function E(o){return y(o)?o.extra.parenStart:o.start}function m(o){return y(o)?o.extra.parenEnd:o.end}};function Ie(r,e,t=!1,s=!1){if(!t){let{start:g,end:d}=r;return{start:g,end:d,range:[g,d]}}let{outerSpan:n,innerSpan:{start:i,end:a},hasParens:h}=mt(r,e.text,s);return{start:i,end:a,range:[i,a],...h&&{extra:{parenthesized:!0,parenStart:n.start,parenEnd:n.end}}}}function $t(r,e){r.forEach(o);let[t]=r,{key:s}=t,n=e.text.slice(t.sourceSpan.start,t.sourceSpan.end).trim().length===0?r.slice(1):r,i=[],a=null;for(let c=0;c<n.length;c++){let x=n[c];if(a&&E(a)&&m(x)&&x.value&&x.value.source===a.key.source){let l=d("NGMicrosyntaxKey",{name:x.key.source},x.key.span),p=(N,ue)=>({...N,...Ie({start:N.start,end:ue},e)}),k=N=>({...p(N,l.end),alias:l}),S=i.pop();if(S.type==="NGMicrosyntaxExpression")i.push(k(S));else if(S.type==="NGMicrosyntaxKeyedExpression"){let N=k(S.expression);i.push(p({...S,expression:N},N.end))}else throw new Error(`Unexpected type ${S.type}`)}else i.push(h(x,c));a=x}return d("NGMicrosyntax",{body:i},i.length===0?r[0].sourceSpan:{start:i[0].start,end:Ne(!1,i,-1).end});function h(c,x){if(E(c)){let{key:l,value:p}=c;return p?x===0?d("NGMicrosyntaxExpression",{expression:g(p.ast),alias:null},p.sourceSpan):d("NGMicrosyntaxKeyedExpression",{key:d("NGMicrosyntaxKey",{name:y(l.source)},l.span),expression:d("NGMicrosyntaxExpression",{expression:g(p.ast),alias:null},p.sourceSpan)},{start:l.span.start,end:p.sourceSpan.end}):d("NGMicrosyntaxKey",{name:y(l.source)},l.span)}else{let{key:l,sourceSpan:p}=c;if(/^let\s$/.test(e.text.slice(p.start,p.start+4))){let{value:S}=c;return d("NGMicrosyntaxLet",{key:d("NGMicrosyntaxKey",{name:l.source},l.span),value:S?d("NGMicrosyntaxKey",{name:S.source},S.span):null},{start:p.start,end:S?S.span.end:l.span.end})}else{let S=v(c);return d("NGMicrosyntaxAs",{key:d("NGMicrosyntaxKey",{name:S.source},S.span),alias:d("NGMicrosyntaxKey",{name:l.source},l.span)},{start:S.span.start,end:l.span.end})}}}function g(c){return G(c,e)}function d(c,x,l,p=!0){return{type:c,...Ie(l,e,p),...x}}function y(c){return Et(c.slice(s.source.length))}function E(c){return c instanceof ne}function m(c){return c instanceof T}function o(c){u(c.key.span),m(c)&&c.value&&u(c.value.span)}function u(c){if(e.text[c.start]!=='"'&&e.text[c.start]!=="'")return;let x=e.text[c.start],l=!1;for(let p=c.start+1;p<e.text.length;p++)switch(e.text[p]){case x:if(!l){c.end=p+1;return}default:l=!1;break;case"\\":l=!l;break}}function v(c){if(!c.value||c.value.source!==Ge)return c.value;let x=e.getCharacterIndex(/\S/,c.sourceSpan.start);return{source:"$implicit",span:{start:x,end:x}}}}function ke(r){return e=>{let{ast:t,comments:s}=r(e),n=new ve(e),i=G(t,n);return i.comments=s.map(a=>G(a,n)),i}}var Ct=ke(ut),as=ke(lt),At=ke(dt),De=ke(xt),Ot=r=>$t(ft(r),new ve(r));function Ar(r){return Array.isArray(r)&&r.length>0}var Nt=Ar;function Ve(r){var s;let e=r.range?r.range[0]:r.start,t=((s=r.declaration)==null?void 0:s.decorators)??r.decorators;return Nt(t)?Math.min(Ve(t[0]),e):e}function It(r){return r.range?r.range[1]:r.end}function Pe(r){return{astFormat:"estree",parse(e){let t=r(e);return{type:"NGRoot",node:r===De&&t.type!=="NGChainedExpression"?{...t,type:"NGChainedExpression",expressions:[t]}:t}},locStart:Ve,locEnd:It}}var Or=Pe(De),Nr=Pe(Ct),Ir=Pe(At),kr=Pe(Ot);var xs=Qe;export{xs as default,We as parsers};
@@ -13,4 +13,4 @@
13
13
  `||i==="\r"||i==="\u2028"||i==="\u2029")return t-1}else{if(i==="\r"&&a.charAt(t+1)===`
14
14
  `)return t+2;if(i===`
15
15
  `||i==="\r"||i==="\u2028"||i==="\u2029")return t+1}return t}var fs=wr;function _e(a){return(t,e,s)=>{let i=!!(s!=null&&s.backwards);if(e===!1)return!1;let{length:r}=t,n=e;for(;n>=0&&n<r;){let o=t.charAt(n);if(a instanceof RegExp){if(!a.test(o))return n}else if(!a.includes(o))return n;i?n--:n++}return n===-1||n===r?n:!1}}var ba=_e(/\s/),ds=_e(" "),Aa=_e(",; "),ms=_e(/[^\n\r]/);function Cr(a,t){return t===!1?!1:a.charAt(t)==="/"&&a.charAt(t+1)==="/"?ms(a,t):t}var ys=Cr;function Er(a,t){let e=null,s=t;for(;s!==e;)e=s,s=ds(a,s),s=us(a,s),s=ys(a,s),s=fs(a,s);return s}var xs=Er;var re=qe(ws(),1);function Br(a){let t=Re(a);t&&(a=a.slice(t.length+1));let e=(0,re.extract)(a),{pragmas:s,comments:i}=(0,re.parseWithComments)(e);return{shebang:t,text:a,pragmas:s,comments:i}}function Cs(a){let{pragmas:t}=Br(a);return Object.prototype.hasOwnProperty.call(t,"prettier")||Object.prototype.hasOwnProperty.call(t,"format")}function Rr(a){return Array.isArray(a)&&a.length>0}var Y=Rr;function D(a){var s;let t=a.range?a.range[0]:a.start,e=((s=a.declaration)==null?void 0:s.decorators)??a.decorators;return Y(e)?Math.min(D(e[0]),t):t}function B(a){return a.range?a.range[1]:a.end}function _r(a){return a=typeof a=="function"?{parse:a}:a,{astFormat:"estree",hasPragma:Cs,locStart:D,locEnd:B,...a}}var ae=_r;function Ur(a,t){let e=new SyntaxError(a+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(e,t)}var Ue=Ur;function jr(a){let{message:t,loc:{line:e,column:s}}=a,i=` (${e}:${s})`;return t.endsWith(i)&&(t=t.slice(0,-i.length)),Ue(t,{loc:{start:{line:e,column:s+1}},cause:a})}var Te=jr;var $r=(a,t,e)=>{if(!(a&&t==null))return Array.isArray(t)||typeof t=="string"?t[e<0?t.length+e:e]:t.at(e)},Et=$r;function Vr(a){return a=new Set(a),t=>a.has(t==null?void 0:t.type)}var Es=Vr;var qr=Es(["Block","CommentBlock","MultiLine"]),be=qr;function zr(a){return be(a)&&a.value[0]==="*"&&/@(?:type|satisfies)\b/.test(a.value)}var Is=zr;function Kr(a){let t=`*${a.value}*`.split(`
16
- `);return t.length>1&&t.every(e=>e.trimStart()[0]==="*")}var It=Kr;var Ae=null;function Se(a){if(Ae!==null&&typeof Ae.property){let t=Ae;return Ae=Se.prototype=null,t}return Ae=Se.prototype=a??Object.create(null),new Se}var Hr=10;for(let a=0;a<=Hr;a++)Se();function Nt(a){return Se(a)}function Wr(a,t="type"){Nt(a);function e(s){let i=s[t],r=a[i];if(!Array.isArray(r))throw Object.assign(new Error(`Missing visitor keys for '${i}'.`),{node:s});return r}return e}var Ns=Wr;var ks={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["test","body"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body","returnType","typeParameters","predicate"],FunctionExpression:["id","params","body","returnType","typeParameters"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["key","params","body","decorators","returnType","typeParameters"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["params","body","returnType","typeParameters","predicate"],ClassBody:["body"],ClassExpression:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators","superTypeArguments"],ClassDeclaration:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators","superTypeArguments"],ExportAllDeclaration:["source","attributes","assertions","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes","assertions"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes","assertions"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["local","imported"],ImportExpression:["source","options","attributes"],MetaProperty:["meta","property"],ClassMethod:["key","params","body","decorators","returnType","typeParameters"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","quasi","typeParameters","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],Import:[],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["key","value","typeAnnotation","decorators","variance"],ClassAccessorProperty:["key","value","typeAnnotation","decorators"],ClassPrivateProperty:["key","value","decorators","typeAnnotation","variance"],ClassPrivateMethod:["key","params","body","decorators","returnType","typeParameters"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source"],DeclareExportAllDeclaration:["source"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","params","rest","returnType","this"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value","optional","static","method"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["id","key","value","variance"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["id","qualification"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes","typeArguments","typeParameters"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],DecimalLiteral:[],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","typeAnnotation","nameType"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],TSTemplateLiteralType:["quasis","types"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareEnum:["id","body"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[],AsConstExpression:["expression"],SatisfiesExpression:["expression","typeAnnotation"]};var Jr=Ns(ks),vs=Jr;function kt(a,t){if(!(a!==null&&typeof a=="object"))return a;if(Array.isArray(a)){for(let s=0;s<a.length;s++)a[s]=kt(a[s],t);return a}let e=vs(a);for(let s=0;s<e.length;s++)a[e[s]]=kt(a[e[s]],t);return t(a)||a}var je=kt;function Xr(a,t){let{parser:e,text:s}=t;if(a.type==="File"&&a.program.interpreter){let{program:{interpreter:r},comments:n}=a;delete a.program.interpreter,n.unshift(r)}if(e==="babel"){let r=new Set;a=je(a,n=>{var o;(o=n.leadingComments)!=null&&o.some(Is)&&r.add(D(n))}),a=je(a,n=>{if(n.type==="ParenthesizedExpression"){let{expression:o}=n;if(o.type==="TypeCastExpression")return o.range=n.range,o;let h=D(n);if(!r.has(h))return o.extra={...o.extra,parenthesized:!0},o}})}if(a=je(a,r=>{switch(r.type){case"LogicalExpression":if(Ls(r))return vt(r);break;case"VariableDeclaration":{let n=Et(!1,r.declarations,-1);n!=null&&n.init&&i(r,n);break}case"TSParenthesizedType":return r.typeAnnotation;case"TSTypeParameter":if(typeof r.name=="string"){let n=D(r);r.name={type:"Identifier",name:r.name,range:[n,n+r.name.length]}}break;case"TopicReference":a.extra={...a.extra,__isUsingHackPipeline:!0};break;case"ExportAllDeclaration":{let{exported:n}=r;if(e==="meriyah"&&(n==null?void 0:n.type)==="Identifier"){let o=s.slice(D(n),B(n));(o.startsWith('"')||o.startsWith("'"))&&(r.exported={...r.exported,type:"Literal",value:r.exported.name,raw:o})}break}case"TSUnionType":case"TSIntersectionType":if(r.types.length===1)return r.types[0];break}}),Y(a.comments)){let r=Et(!1,a.comments,-1);for(let n=a.comments.length-2;n>=0;n--){let o=a.comments[n];B(o)===D(r)&&be(o)&&be(r)&&It(o)&&It(r)&&(a.comments.splice(n+1,1),o.value+="*//*"+r.value,o.range=[D(o),B(r)]),r=o}}return a.type==="Program"&&(a.range=[0,s.length]),a;function i(r,n){s[B(n)]!==";"&&(r.range=[D(r),B(n)])}}function Ls(a){return a.type==="LogicalExpression"&&a.right.type==="LogicalExpression"&&a.operator===a.right.operator}function vt(a){return Ls(a)?vt({type:"LogicalExpression",operator:a.operator,left:vt({type:"LogicalExpression",operator:a.operator,left:a.left,right:a.right.left,range:[D(a.left),B(a.right.left)]}),right:a.right.right,range:[D(a),B(a)]}):a}var Ds=Xr;function Gr(a){let{filepath:t}=a;if(t){if(t=t.toLowerCase(),t.endsWith(".cjs"))return"script";if(t.endsWith(".mjs"))return"module"}}var Ms=Gr;function Yr(a,t){let{type:e="JsExpressionRoot",rootMarker:s,text:i}=t,{tokens:r,comments:n}=a;return delete a.tokens,delete a.comments,{tokens:r,comments:n,type:e,node:a,range:[0,i.length],rootMarker:s}}var $e=Yr;var ne=a=>ae(ia(a)),Qr={sourceType:"module",allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,allowNewTargetOutsideFunction:!0,allowSuperOutsideMethod:!0,allowUndeclaredExports:!0,errorRecovery:!0,createParenthesizedExpressions:!0,createImportExpressions:!0,plugins:["doExpressions","exportDefaultFrom","functionBind","functionSent","throwExpressions","partialApplication","decorators","decimal","moduleBlocks","asyncDoExpressions","regexpUnicodeSets","destructuringPrivate","decoratorAutoAccessors","importReflection","explicitResourceManagement",["importAttributes",{deprecatedAssertSyntax:!0}],"sourcePhaseImports","deferredImportEvaluation",["optionalChainingAssign",{version:"2023-07"}]],tokens:!0,ranges:!0},Zr=["recordAndTuple",{syntaxType:"hash"}],Os="v8intrinsic",Fs=[["pipelineOperator",{proposal:"hack",topicToken:"%"}],["pipelineOperator",{proposal:"minimal"}],["pipelineOperator",{proposal:"fsharp"}]],R=(a,t=Qr)=>({...t,plugins:[...t.plugins,...a]}),ea=/@(?:no)?flow\b/;function ta(a,t){var i;if((i=t.filepath)!=null&&i.endsWith(".js.flow"))return!0;let e=Re(a);e&&(a=a.slice(e.length));let s=xs(a,0);return s!==!1&&(a=a.slice(0,s)),ea.test(a)}function sa(a,t,e){let s=a(t,e),i=s.errors.find(r=>!ra.has(r.reasonCode));if(i)throw i;return s}function ia({isExpression:a=!1,optionsCombinations:t}){return(e,s={})=>{if((s.parser==="babel"||s.parser==="__babel_estree")&&ta(e,s))return s.parser="babel-flow",$s.parse(e,s);let i=t;(s.__babelSourceType??Ms(s))==="script"&&(i=i.map(l=>({...l,sourceType:"script"}))),/#[[{]/.test(e)&&(i=i.map(l=>R([Zr],l)));let n=/%[A-Z]/.test(e);e.includes("|>")?i=(n?[...Fs,Os]:Fs).flatMap(c=>i.map(u=>R([c],u))):n&&(i=i.map(l=>R([Os],l)));let o=a?Ve.parseExpression:Ve.parse,h;try{h=ps(i.map(l=>()=>sa(o,e,l)))}catch({errors:[l]}){throw Te(l)}return a&&(h=$e(h,{text:e,rootMarker:s.rootMarker})),Ds(h,{parser:"babel",text:e})}}var ra=new Set(["StrictNumericEscape","StrictWith","StrictOctalLiteral","StrictDelete","StrictEvalArguments","StrictEvalArgumentsBinding","StrictFunction","EmptyTypeArguments","EmptyTypeParameters","ConstructorHasTypeParameters","UnsupportedParameterPropertyKind","MixedLabeledAndUnlabeledElements","DuplicateAccessibilityModifier","DecoratorExportClass","ParamDupe","InvalidDecimal","RestTrailingComma","UnsupportedParameterDecorator","UnterminatedJsxContent","UnexpectedReservedWord","ModuleAttributesWithDuplicateKeys","LineTerminatorBeforeArrow","InvalidEscapeSequenceTemplate","NonAbstractClassHasAbstractMethod","OptionalTypeBeforeRequired","PatternIsOptional","OptionalBindingPattern","DeclareClassFieldHasInitializer","TypeImportCannotSpecifyDefaultAndNamed","DeclareFunctionHasImplementation","ConstructorClassField","VarRedeclaration","InvalidPrivateFieldResolution","DuplicateExport"]),js=[R(["jsx"])],Bs=ne({optionsCombinations:js}),Rs=ne({optionsCombinations:[R(["jsx","typescript"]),R(["typescript"])]}),_s=ne({isExpression:!0,optionsCombinations:[R(["jsx"])]}),Us=ne({isExpression:!0,optionsCombinations:[R(["typescript"])]}),$s=ne({optionsCombinations:[R(["jsx",["flow",{all:!0,enums:!0}],"flowComments"])]}),aa=ne({optionsCombinations:js.map(a=>R(["estree"],a))}),Vs={babel:Bs,"babel-flow":$s,"babel-ts":Rs,__js_expression:_s,__ts_expression:Us,__vue_expression:_s,__vue_ts_expression:Us,__vue_event_binding:Bs,__vue_ts_event_binding:Rs,__babel_estree:aa};var zs=qe(Ct(),1);function Ks(a={}){let{allowComments:t=!0}=a;return function(s){let i;try{i=(0,zs.parseExpression)(s,{tokens:!0,ranges:!0,attachComment:!1})}catch(r){throw(r==null?void 0:r.reasonCode)==="MissingPlugin"||(r==null?void 0:r.reasonCode)==="MissingOneOfPlugins"?Te({message:"Unexpected token",loc:r.loc}):Te(r)}if(!t&&Y(i.comments))throw W(i.comments[0],"Comment");return oe(i),$e(i,{type:"JsonRoot",text:s})}}function W(a,t){let[e,s]=[a.loc.start,a.loc.end].map(({line:i,column:r})=>({line:i,column:r+1}));return Ue(`${t} is not allowed in JSON.`,{loc:{start:e,end:s}})}function oe(a){switch(a.type){case"ArrayExpression":for(let t of a.elements)t!==null&&oe(t);return;case"ObjectExpression":for(let t of a.properties)oe(t);return;case"ObjectProperty":if(a.computed)throw W(a.key,"Computed key");if(a.shorthand)throw W(a.key,"Shorthand property");a.key.type!=="Identifier"&&oe(a.key),oe(a.value);return;case"UnaryExpression":{let{operator:t,argument:e}=a;if(t!=="+"&&t!=="-")throw W(a,`Operator '${a.operator}'`);if(e.type==="NumericLiteral"||e.type==="Identifier"&&(e.name==="Infinity"||e.name==="NaN"))return;throw W(e,`Operator '${t}' before '${e.type}'`)}case"Identifier":if(a.name!=="Infinity"&&a.name!=="NaN"&&a.name!=="undefined")throw W(a,`Identifier '${a.name}'`);return;case"TemplateLiteral":if(Y(a.expressions))throw W(a.expressions[0],"'TemplateLiteral' with expression");for(let t of a.quasis)oe(t);return;case"NullLiteral":case"BooleanLiteral":case"NumericLiteral":case"StringLiteral":case"TemplateElement":return;default:throw W(a,`'${a.type}'`)}}var qs=Ks(),na={json:ae({parse:qs,hasPragma(){return!0}}),json5:ae(qs),"json-stringify":ae({parse:Ks({allowComments:!1}),astFormat:"estree-json"})},Hs=na;var oa={...Vs,...Hs};return Zs(ha);});
16
+ `);return t.length>1&&t.every(e=>e.trimStart()[0]==="*")}var It=Kr;var Ae=null;function Se(a){if(Ae!==null&&typeof Ae.property){let t=Ae;return Ae=Se.prototype=null,t}return Ae=Se.prototype=a??Object.create(null),new Se}var Hr=10;for(let a=0;a<=Hr;a++)Se();function Nt(a){return Se(a)}function Wr(a,t="type"){Nt(a);function e(s){let i=s[t],r=a[i];if(!Array.isArray(r))throw Object.assign(new Error(`Missing visitor keys for '${i}'.`),{node:s});return r}return e}var Ns=Wr;var ks={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["test","body"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body","returnType","typeParameters","predicate"],FunctionExpression:["id","params","body","returnType","typeParameters"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["key","params","body","decorators","returnType","typeParameters"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["params","body","returnType","typeParameters","predicate"],ClassBody:["body"],ClassExpression:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators","superTypeArguments"],ClassDeclaration:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["local","imported"],ImportExpression:["source","options","attributes"],MetaProperty:["meta","property"],ClassMethod:["key","params","body","decorators","returnType","typeParameters"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","quasi","typeParameters","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],Import:[],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["key","value","typeAnnotation","decorators","variance"],ClassAccessorProperty:["key","value","typeAnnotation","decorators"],ClassPrivateProperty:["key","value","decorators","typeAnnotation","variance"],ClassPrivateMethod:["key","params","body","decorators","returnType","typeParameters"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source"],DeclareExportAllDeclaration:["source"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","params","rest","returnType","this"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value","optional","static","method"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["id","key","value","variance"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["id","qualification"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes","typeArguments","typeParameters"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],DecimalLiteral:[],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","typeAnnotation","nameType"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],TSTemplateLiteralType:["quasis","types"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareEnum:["id","body"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[],AsConstExpression:["expression"],SatisfiesExpression:["expression","typeAnnotation"]};var Jr=Ns(ks),vs=Jr;function kt(a,t){if(!(a!==null&&typeof a=="object"))return a;if(Array.isArray(a)){for(let s=0;s<a.length;s++)a[s]=kt(a[s],t);return a}let e=vs(a);for(let s=0;s<e.length;s++)a[e[s]]=kt(a[e[s]],t);return t(a)||a}var je=kt;function Xr(a,t){let{parser:e,text:s}=t;if(a.type==="File"&&a.program.interpreter){let{program:{interpreter:i},comments:r}=a;delete a.program.interpreter,r.unshift(i)}if(e==="babel"){let i=new Set;a=je(a,r=>{var n;(n=r.leadingComments)!=null&&n.some(Is)&&i.add(D(r))}),a=je(a,r=>{if(r.type==="ParenthesizedExpression"){let{expression:n}=r;if(n.type==="TypeCastExpression")return n.range=[...r.range],n;let o=D(r);if(!i.has(o))return n.extra={...n.extra,parenthesized:!0},n}})}if(a=je(a,i=>{var r;switch(i.type){case"LogicalExpression":if(Ls(i))return vt(i);break;case"VariableDeclaration":{let n=Et(!1,i.declarations,-1);n!=null&&n.init&&s[B(n)]!==";"&&(i.range=[D(i),B(n)]);break}case"TSParenthesizedType":return i.typeAnnotation;case"TSTypeParameter":if(typeof i.name=="string"){let n=D(i);i.name={type:"Identifier",name:i.name,range:[n,n+i.name.length]}}break;case"TopicReference":a.extra={...a.extra,__isUsingHackPipeline:!0};break;case"ExportAllDeclaration":if(e==="meriyah"&&((r=i.exported)==null?void 0:r.type)==="Identifier"){let{exported:n}=i,o=s.slice(D(n),B(n));(o.startsWith('"')||o.startsWith("'"))&&(i.exported={...i.exported,type:"Literal",value:i.exported.name,raw:o})}break;case"TSUnionType":case"TSIntersectionType":if(i.types.length===1)return i.types[0];break}}),Y(a.comments)){let i=Et(!1,a.comments,-1);for(let r=a.comments.length-2;r>=0;r--){let n=a.comments[r];B(n)===D(i)&&be(n)&&be(i)&&It(n)&&It(i)&&(a.comments.splice(r+1,1),n.value+="*//*"+i.value,n.range=[D(n),B(i)]),i=n}}return a.type==="Program"&&(a.range=[0,s.length]),a}function Ls(a){return a.type==="LogicalExpression"&&a.right.type==="LogicalExpression"&&a.operator===a.right.operator}function vt(a){return Ls(a)?vt({type:"LogicalExpression",operator:a.operator,left:vt({type:"LogicalExpression",operator:a.operator,left:a.left,right:a.right.left,range:[D(a.left),B(a.right.left)]}),right:a.right.right,range:[D(a),B(a)]}):a}var Ds=Xr;function Gr(a){let{filepath:t}=a;if(t){if(t=t.toLowerCase(),t.endsWith(".cjs"))return"script";if(t.endsWith(".mjs"))return"module"}}var Ms=Gr;function Yr(a,t){let{type:e="JsExpressionRoot",rootMarker:s,text:i}=t,{tokens:r,comments:n}=a;return delete a.tokens,delete a.comments,{tokens:r,comments:n,type:e,node:a,range:[0,i.length],rootMarker:s}}var $e=Yr;var ne=a=>ae(ia(a)),Qr={sourceType:"module",allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,allowNewTargetOutsideFunction:!0,allowSuperOutsideMethod:!0,allowUndeclaredExports:!0,errorRecovery:!0,createParenthesizedExpressions:!0,createImportExpressions:!0,plugins:["doExpressions","exportDefaultFrom","functionBind","functionSent","throwExpressions","partialApplication","decorators","decimal","moduleBlocks","asyncDoExpressions","regexpUnicodeSets","destructuringPrivate","decoratorAutoAccessors","importReflection","explicitResourceManagement",["importAttributes",{deprecatedAssertSyntax:!0}],"sourcePhaseImports","deferredImportEvaluation",["optionalChainingAssign",{version:"2023-07"}]],tokens:!0,ranges:!0},Zr=["recordAndTuple",{syntaxType:"hash"}],Os="v8intrinsic",Fs=[["pipelineOperator",{proposal:"hack",topicToken:"%"}],["pipelineOperator",{proposal:"minimal"}],["pipelineOperator",{proposal:"fsharp"}]],R=(a,t=Qr)=>({...t,plugins:[...t.plugins,...a]}),ea=/@(?:no)?flow\b/;function ta(a,t){var i;if((i=t.filepath)!=null&&i.endsWith(".js.flow"))return!0;let e=Re(a);e&&(a=a.slice(e.length));let s=xs(a,0);return s!==!1&&(a=a.slice(0,s)),ea.test(a)}function sa(a,t,e){let s=a(t,e),i=s.errors.find(r=>!ra.has(r.reasonCode));if(i)throw i;return s}function ia({isExpression:a=!1,optionsCombinations:t}){return(e,s={})=>{if((s.parser==="babel"||s.parser==="__babel_estree")&&ta(e,s))return s.parser="babel-flow",$s.parse(e,s);let i=t;(s.__babelSourceType??Ms(s))==="script"&&(i=i.map(l=>({...l,sourceType:"script"}))),/#[[{]/.test(e)&&(i=i.map(l=>R([Zr],l)));let n=/%[A-Z]/.test(e);e.includes("|>")?i=(n?[...Fs,Os]:Fs).flatMap(c=>i.map(u=>R([c],u))):n&&(i=i.map(l=>R([Os],l)));let o=a?Ve.parseExpression:Ve.parse,h;try{h=ps(i.map(l=>()=>sa(o,e,l)))}catch({errors:[l]}){throw Te(l)}return a&&(h=$e(h,{text:e,rootMarker:s.rootMarker})),Ds(h,{parser:"babel",text:e})}}var ra=new Set(["StrictNumericEscape","StrictWith","StrictOctalLiteral","StrictDelete","StrictEvalArguments","StrictEvalArgumentsBinding","StrictFunction","EmptyTypeArguments","EmptyTypeParameters","ConstructorHasTypeParameters","UnsupportedParameterPropertyKind","MixedLabeledAndUnlabeledElements","DuplicateAccessibilityModifier","DecoratorExportClass","ParamDupe","InvalidDecimal","RestTrailingComma","UnsupportedParameterDecorator","UnterminatedJsxContent","UnexpectedReservedWord","ModuleAttributesWithDuplicateKeys","LineTerminatorBeforeArrow","InvalidEscapeSequenceTemplate","NonAbstractClassHasAbstractMethod","OptionalTypeBeforeRequired","PatternIsOptional","OptionalBindingPattern","DeclareClassFieldHasInitializer","TypeImportCannotSpecifyDefaultAndNamed","DeclareFunctionHasImplementation","ConstructorClassField","VarRedeclaration","InvalidPrivateFieldResolution","DuplicateExport"]),js=[R(["jsx"])],Bs=ne({optionsCombinations:js}),Rs=ne({optionsCombinations:[R(["jsx","typescript"]),R(["typescript"])]}),_s=ne({isExpression:!0,optionsCombinations:[R(["jsx"])]}),Us=ne({isExpression:!0,optionsCombinations:[R(["typescript"])]}),$s=ne({optionsCombinations:[R(["jsx",["flow",{all:!0,enums:!0}],"flowComments"])]}),aa=ne({optionsCombinations:js.map(a=>R(["estree"],a))}),Vs={babel:Bs,"babel-flow":$s,"babel-ts":Rs,__js_expression:_s,__ts_expression:Us,__vue_expression:_s,__vue_ts_expression:Us,__vue_event_binding:Bs,__vue_ts_event_binding:Rs,__babel_estree:aa};var zs=qe(Ct(),1);function Ks(a={}){let{allowComments:t=!0}=a;return function(s){let i;try{i=(0,zs.parseExpression)(s,{tokens:!0,ranges:!0,attachComment:!1})}catch(r){throw(r==null?void 0:r.reasonCode)==="MissingPlugin"||(r==null?void 0:r.reasonCode)==="MissingOneOfPlugins"?Te({message:"Unexpected token",loc:r.loc}):Te(r)}if(!t&&Y(i.comments))throw W(i.comments[0],"Comment");return oe(i),$e(i,{type:"JsonRoot",text:s})}}function W(a,t){let[e,s]=[a.loc.start,a.loc.end].map(({line:i,column:r})=>({line:i,column:r+1}));return Ue(`${t} is not allowed in JSON.`,{loc:{start:e,end:s}})}function oe(a){switch(a.type){case"ArrayExpression":for(let t of a.elements)t!==null&&oe(t);return;case"ObjectExpression":for(let t of a.properties)oe(t);return;case"ObjectProperty":if(a.computed)throw W(a.key,"Computed key");if(a.shorthand)throw W(a.key,"Shorthand property");a.key.type!=="Identifier"&&oe(a.key),oe(a.value);return;case"UnaryExpression":{let{operator:t,argument:e}=a;if(t!=="+"&&t!=="-")throw W(a,`Operator '${a.operator}'`);if(e.type==="NumericLiteral"||e.type==="Identifier"&&(e.name==="Infinity"||e.name==="NaN"))return;throw W(e,`Operator '${t}' before '${e.type}'`)}case"Identifier":if(a.name!=="Infinity"&&a.name!=="NaN"&&a.name!=="undefined")throw W(a,`Identifier '${a.name}'`);return;case"TemplateLiteral":if(Y(a.expressions))throw W(a.expressions[0],"'TemplateLiteral' with expression");for(let t of a.quasis)oe(t);return;case"NullLiteral":case"BooleanLiteral":case"NumericLiteral":case"StringLiteral":case"TemplateElement":return;default:throw W(a,`'${a.type}'`)}}var qs=Ks(),na={json:ae({parse:qs,hasPragma(){return!0}}),json5:ae(qs),"json-stringify":ae({parse:Ks({allowComments:!1}),astFormat:"estree-json"})},Hs=na;var oa={...Vs,...Hs};return Zs(ha);});