31 lines
134 KiB
JavaScript
Raw Normal View History

var Br=Object.defineProperty;var Ir=e=>{throw TypeError(e)};var jn=(e,t,r)=>t in e?Br(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Ue=(e,t)=>{for(var r in t)Br(e,r,{get:t[r],enumerable:!0})};var Me=(e,t,r)=>jn(e,typeof t!="symbol"?t+"":t,r),Rr=(e,t,r)=>t.has(e)||Ir("Cannot "+r);var I=(e,t,r)=>(Rr(e,t,"read from private field"),r?r.call(e):t.get(e)),Pt=(e,t,r)=>t.has(e)?Ir("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),J=(e,t,r,n)=>(Rr(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);var Pr={};Ue(Pr,{languages:()=>mn,parsers:()=>Ar,printers:()=>vi});var Qn=(e,t,r,n)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(r,n):r.global?t.replace(r,n):t.split(r).join(n)},ze=Qn;var Mt="string",zt="array",Yt="cursor",Lt="indent",Dt="align",Gt="trim",_t="group",Ot="fill",Bt="if-break",Kt="indent-if-break",Wt="line-suffix",jt="line-suffix-boundary",$="line",Qt="label",It="break-parent",me=new Set([Yt,Lt,Dt,Gt,_t,Ot,Bt,Kt,Wt,jt,$,Qt,It]);function Jn(e){if(typeof e=="string")return Mt;if(Array.isArray(e))return zt;if(!e)return;let{type:t}=e;if(me.has(t))return t}var Jt=Jn;var $n=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function Xn(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return`Unexpected doc '${t}',
Expected it to be 'string' or 'object'.`;if(Jt(e))throw new Error("doc is valid.");let r=Object.prototype.toString.call(e);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=$n([...me].map(s=>`'${s}'`));return`Unexpected doc.type '${e.type}'.
Expected it to be ${n}.`}var Ye=class extends Error{name="InvalidDocError";constructor(t){super(Xn(t)),this.doc=t}},Ge=Ye;var qr=()=>{},dt=qr,de=qr;function B(e){return dt(e),{type:Lt,contents:e}}function Zn(e,t){return dt(t),{type:Dt,contents:t,n:e}}function R(e,t={}){return dt(e),de(t.expandedStates,!0),{type:_t,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Ke(e){return Zn(-1,e)}function We(e){return de(e),{type:Ot,parts:e}}function je(e,t="",r={}){return dt(e),t!==""&&dt(t),{type:Bt,breakContents:e,flatContents:t,groupId:r.groupId}}var Vr={type:It};var ts={type:$,hard:!0},es={type:$,hard:!0,literal:!0},L={type:$},M={type:$,soft:!0},gt=[ts,Vr],Hr=[es,Vr];function bt(e,t){dt(e),de(t);let r=[];for(let n=0;n<t.length;n++)n!==0&&r.push(e),r.push(t[n]);return r}var rs=(e,t,r)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[r<0?t.length+r:r]:t.at(r)},it=rs;function ns(e,t){if(typeof e=="string")return t(e);let r=new Map;return n(e);function n(i){if(r.has(i))return r.get(i);let a=s(i);return r.set(i,a),a}function s(i){switch(Jt(i)){case zt:return t(i.map(n));case Ot:return t({...i,parts:i.parts.map(n)});case Bt:return t({...i,breakContents:n(i.breakContents),flatContents:n(i.flatContents)});case _t:{let{expandedStates:a,contents:o}=i;return a?(a=a.map(n),o=a[0]):o=n(o),t({...i,contents:o,expandedStates:a})}case Dt:case Lt:case Kt:case Qt:case Wt:return t({...i,contents:n(i.contents)});case Mt:case Yt:case Gt:case jt:case $:case It:return t(i);default:throw new Ge(i)}}}function Fr(e,t=Hr){return ns(e,r=>typeof r=="string"?bt(t,r.split(`
`)):r)}var ge="'",Ur='"';function ss(e,t){let r=t===!0||t===ge?ge:Ur,n=r===ge?Ur:ge,s=0,i=0;for(let a of e)a===r?s++:a===n&&i++;return s>i?n:r}var be=ss;function Qe(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var U,Je=class{constructor(t){Pt(this,U);J(this,U,new Set(t))}getLeadingWhitespaceCount(t){let r=I(this,U),n=0;for(let s=0;s<t.length&&r.has(t.charAt(s));s++)n++;return n}getTrailingWhitespaceCount(t){let r=I(this,U),n=0;for(let s=t.length-1;s>=0&&r.has(t.charAt(s));s--)n++;return n}getLeadingWhitespace(t){let r=this.getLeadingWhitespaceCount(t);return t.slice(0,r)}getTrailingWhitespace(t){let r=this.getTrailingWhitespaceCount(t);return t.slice(t.length-r)}hasLeadingWhitespace(t){return I(this,U).has(t.charAt(0))}hasTrailingWhitespace(t){return I(this,U).has(it(!1,t,-1))}trimStart(t){let r=this.getLeadingWhitespaceCount(t);return t.slice(r)}trimEnd(t){let r=this.getTrailingWhitespaceCount(t);return t.slice(0,t.length-r)}trim(t){return this.trimEnd(this.trimStart(t))}split(t,r=!1){let n=`[${Qe([...I(this,U)].join(""))}]+`,s=new RegExp(r?`(${n})`:n,"u");return t.split(s)}hasWhitespaceCharacter(t){let r=I(this,U);return Array.prototype.some.call(t,n=>r.has(n))}hasNonWhitespaceCharacter(t){let r=I(this,U);return Array.prototype.some.call(t,n=>!r.has(n))}isWhitespaceOnly(t){let r=I(this,U);return Array.prototype.every.call(t,n=>r.has(n))}};U=new WeakMap;var Mr=Je;var is=[" ",`
`,"\f","\r"," "],as=new Mr(is),z=as;function os(e){return Array.isArray(e)&&e.length>0}var $t=os;var $e=class extends Error{name="UnexpectedNodeError";constructor(t,r,n="type"){super(`Unexpected ${r} node ${n}: ${JSON.stringify(t[n])}.`),this.node=t}},zr=$e;function Yr(e,t){if(e.type==="TextNode"){let r=e.chars.trim();if(!r)return null;t.chars=z.split(r).join(" ")}e.type==="ElementNode"&&(delete t.startTag,delete t.openTag,delete t.parts,delete t.endTag,delete t.closeTag,delete t.nameNode,delete t.body,delete t.blockParamNodes,delete t.params,delete t.path),e.type==="Block"&&(delete t.blockParamNodes,delete t.params),e.type==="AttrNode"&&e.name.toLowerCase()==="class"&&delete t.value,e.type==="PathExpression"&&(t.head=e.head.original)}Yr.ignoredProperties=new Set(["loc","selfClosing"]);var Gr=Yr;var Xt=null;function Zt(e){if(Xt!==null&&typeof Xt.property){let t=Xt;return Xt=Zt.prototype=null,t}return Xt=Zt.prototype=e??Object.create(null),new Zt}var ls=10;for(let e=0;e<=ls;e++)Zt();function Xe(e){return Zt(e)}function cs(e,t="type"){Xe(e);function r(n){let s=n[t],i=e[s];if(!Array.isArray(i))throw Object.assign(new Error(`Missing visitor keys for '${s}'.`),{node:n});return i}return r}var Kr=cs;var Wr={Template:["body"],Block:["body"],MustacheStatement:["path","params","hash"],BlockStatement:["path","params","hash","program","inverse"],ElementModifierStatement:["path","params","hash"],CommentStatement:[],MustacheCommentStatement:[],ElementNode:["attributes","modifiers","children","comments"],AttrNode:["value"],TextNode:[],ConcatStatement:["parts"],SubExpression:["path","params","hash"],PathExpression:[],StringLiteral:[],BooleanLiteral:[],NumberLiteral:[],NullLiteral:[],UndefinedLiteral:[],Hash:["pairs"],HashPair:["value"]};var us=Kr(Wr),jr=us;function yt(e){return e.loc.start.offset}function te(e){return e.loc.end.offset}var Qr=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]);function $r(e){return e.toUpperCase()===e}function hs(e){return e.type==="ElementNode"&&typeof e.tag=="string"&&!e.tag.startsWith(":")&&($r(e.tag[0])||e.tag.includes("."))}function ps(e){return Qr.has(e.toLowerCase())&&!$r(e[0])}function Ze(e){return e.selfClosing===!0||ps(e.tag)||hs(e)&&e.children.every(t=>ye(t))}function ye(e){return e.type==="TextNode"&&!/\S/u.test(e.chars)}function Jr(e){return(e==null?void 0:e.type)==="MustacheCommentStatement"&&typeof e.value=="string"&&e.value.trim()==="prettier-ignore"}function Xr(e){return Jr(e.node)||e.isInArray&&(e.key==="children"||e.key==="body"||e.key==="parts")&&Jr(e.siblings[e.index-2])}var on=2;function fs(e,t,r){var s,i,a,o,c,h,p,m,v;let{node:n}=e;switch(n.type){case"Block":case"Program":case"Template":return R(e.map(r,"body"));case"ElementNode":{let g=R(ds(e,r)),E=t.htmlWhitespaceSensitivity==="ignore"&&((s=e.next)==null?void 0:s.type)==="ElementNode"?M:"";if(Ze(n))return[g,E];let N=["</",n.tag,">"];return n.children.length===0?[g,B(N),E]:t.htmlWhitespaceSensitivity==="ignore"?[g,B(Zr(e,t,r)),gt,B(N),E]:[g,B(R(Zr(e,t,r))),B(N),E]}case"BlockStatement":return vs(e)?[Es(e,r),rn(e,r,t),nn(e,r,t)]:[ks(e,r),R([rn(e,r,t),nn(e,r,t),ws(e,r,t)])];case"ElementModifierStatement":return R(["{{",an(e,r),"}}"]);case"MustacheStatement":return R([ke(n),an(e,r),Se(n)]);case"SubExpression":return R(["(",Ls(e,r),M,")"]);case"AttrNode":{let{name:g,value:E}=n,N=E.type==="TextNode";if(N&&E.chars===""&&yt(E)===te(E))return g;let w=N?be(E.chars,t.singleQuote):E.type==="ConcatStatement"?be(E.parts.map(q=>q.type==="TextNode"?q.chars:"").join(""),t.singleQuote):"",Z=r("value");return[g,"=",w,g==="class"&&w?R(B(Z)):Z,w]}case"ConcatStatement":return e.map(r,"parts");case"Hash":return bt(L,e.map(r,"pairs"));case"HashPair":return[n.key,"=",r("value")];case"TextNode":{let g=ze(!1,n.chars,"{{",String.raw`\{{`),E=Cs(e);if(E){if(E==="class"){let j=g.trim().split(/\s+/u).join(" "),tt=!1,V=!1;return e.parent.type==="ConcatStatement"&&(((i=e.previous)==null?void 0:i.type)==="MustacheStatement"&&/^\s/u.test(g)&&(tt=!0),((a=e.next)==null?void 0:a.type)==="Mustac
`).length-1}function Ns(e){e=typeof e=="string"?e:"";let t=(e.match(/^([^\S\n\r]*[\n\r])+/gu)||[])[0]||"";return Rt(t)}function xs(e){e=typeof e=="string"?e:"";let t=(e.match(/([\n\r][^\S\n\r]*)+$/gu)||[])[0]||"";return Rt(t)}function ee(e=0){return Array.from({length:Math.min(e,on)}).fill(gt)}function As(e,t){let{node:{value:r}}=e,n=be(r,Ps(e)?!t.singleQuote:t.singleQuote);return[n,ze(!1,r,n,`\\${n}`),n]}function Ps(e){let{ancestors:t}=e,r=t.findIndex(n=>n.type!=="SubExpression");return r!==-1&&t[r+1].type==="ConcatStatement"&&t[r+2].type==="AttrNode"}function Ls(e,t){let r=tr(e,t),n=ve(e,t);return n?B([r,L,R(n)]):r}function an(e,t){let r=tr(e,t),n=ve(e,t);return n?[B([r,L,n]),M]:r}function tr(e,t){return t("path")}function ve(e,t){var s;let{node:r}=e,n=[];return r.params.length>0&&n.push(...e.map(t,"params")),((s=r.hash)==null?void 0:s.pairs.length)>0&&n.push(t("hash")),n.length===0?"":bt(L,n)}function er(e){return["as |",e.blockParams.join(" "),"|"]}var Ds=new Set("!\"#%&'()*+,./;<=>@[\\]^`{|}~"),_s=new Set(["true","false","null","undefined"]),Os=(e,t)=>t===0&&e.startsWith("@")?!1:t!==0&&_s.has(e)||/\s/u.test(e)||/^\d/u.test(e)||Array.prototype.some.call(e,r=>Ds.has(r));function Bs(e){return e.tail.length===0&&e.original.includes("/")?e.original:[e.head.original,...e.tail].map((r,n)=>Os(r,n)?`[${r}]`:r).join(".")}var Is={print:fs,massageAstNode:Gr,hasPrettierIgnore:Xr,getVisitorKeys:jr},fn=Is;var mn=[{linguistLanguageId:155,name:"Handlebars",type:"markup",color:"#f7931e",aliases:["hbs","htmlbars"],extensions:[".handlebars",".hbs"],tmScope:"text.html.handlebars",aceMode:"handlebars",parsers:["glimmer"],vscodeLanguageIds:["handlebars"]}];var Ar={};Ue(Ar,{glimmer:()=>Si});var Rs=Object.freeze([]);function gn(){return Rs}var Oa=gn(),Ba=gn();var rr=Object.assign;var dn=console;function bn(e,t="unexpected unreachable branch"){throw dn.log("unreachable",e),dn.log(`${t} :: ${JSON.stringify(e)} (${e})`),new Error("code reached unreachable")}var qs=function(){var e=function(nt,d,k,b){for(k=k||{},b=nt.length;b--;k[nt[b]]=d);return k},t=[2,44],r=[1,20],n=[5,14,15,19,29,34,39,44,47,48,52,56,60],s=[1,35],i=[1,38],a=[1,30],o=[1,31],c=[1,32],h=[1,33],p=[1,34],m=[1,37],v=[14,15,19,29,34,39,44,47,48,52,56,60],g=[14,15,19,29,34,44,47,48,52,56,60],E=[15,18],N=[14,15,19,29,34,47,48,52,56,60],x=[33,64,71,79,80,81,82,83,84],w=[23,33,55,64,67,71,74,79,80,81,82,83,84],Z=[1,51],q=[23,33,55,64,67,71,74,79,80,81,82,83,84,86],W=[2,43],Tt=[55,64,71,79,80,81,82,83,84],Ct=[1,58],j=[1,59],tt=[1,66],V=[33,64,71,74,79,80,81,82,83,84],Nt=[23,64,71,79,80,81,82,83,84],H=[1,76],et=[64,67,71,79,80,81,82,83,84],P=[33,74],rt=[23,33,55,67,71,74],he=[1,106],Oe=[1,118],Lr=[71,76],Be={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,expr:49,mustache_repetition0:50,mustache_option0:51,OPEN_UNESCAPED:52,mustache_repetition1:53,mustache_option1:54,CLOSE_UNESCAPED:55,OPEN_PARTIAL:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,sexpr:63,OPEN_SEXPR:64,sexpr_repetition0:65,sexpr_option0:66,CLOSE_SEXPR:67,hash:68,hash_repetition_plus0:69,hashSegment:70,ID:71,EQUALS:72,blockParams:73,OPEN_BLOCK_PARAMS:74,blockParams_repetition_plus0:75,CLOSE_BLOCK_PARAMS:76,path:77,dataName:78,STRING:79,NUMBER:80,BOOLEAN:
`+A.showPosition()+`
Expecting `+fe.join(", ")+", got '"+(this.terminals_[O]||O)+"'":Fe="Parse error on line "+(st+1)+": Unexpected "+(O==_r?"end of input":"'"+(this.terminals_[O]||O)+"'"),this.parseError(Fe,{text:A.match,token:this.terminals_[O]||O,line:A.yylineno,loc:qe,expected:fe})}if(F[0]instanceof Array&&F.length>1)throw new Error("Parse Error: multiple actions possible at state: "+mt+", token: "+O);switch(F[0]){case 1:b.push(O),C.push(A.yytext),l.push(A.yylloc),b.push(F[1]),O=null,Ve?(O=Ve,Ve=null):(Ut=A.yyleng,u=A.yytext,st=A.yylineno,qe=A.yylloc,Dr>0&&Dr--);break;case 2:if(Q=this.productions_[F[1]][1],At.$=C[C.length-Q],At._$={first_line:l[l.length-(Q||1)].first_line,last_line:l[l.length-1].last_line,first_column:l[l.length-(Q||1)].first_column,last_column:l[l.length-1].last_column},Kn&&(At._$.range=[l[l.length-(Q||1)].range[0],l[l.length-1].range[1]]),He=this.performAction.apply(At,[u,Ut,st,ft.yy,F[1],C,l].concat(Gn)),typeof He<"u")return He;Q&&(b=b.slice(0,-1*Q*2),C=C.slice(0,-1*Q),l=l.slice(0,-1*Q)),b.push(this.productions_[F[1]][0]),C.push(At.$),l.push(At._$),Or=xt[b[b.length-2]][b[b.length-1]],b.push(Or);break;case 3:return!0}}return!0}},zn=function(){var nt={EOF:1,parseError:function(k,b){if(this.yy.parser)this.yy.parser.parseError(k,b);else throw new Error(k)},setInput:function(d,k){return this.yy=k||this.yy||{},this._input=d,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var d=this._input[0];this.yytext+=d,this.yyleng++,this.offset++,this.match+=d,this.matched+=d;var k=d.match(/(?:\r\n?|\n).*/g);return k?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),d},unput:function(d){var k=d.length,b=d.split(/(?:\r\n?|\n)/g);this._input=d+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-k),this.offset-=k;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),b.length-1&&(this.yylineno-=b.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:b?(b.length===y.length?this.yylloc.first_column:0)+y[y.length-b.length].length-b[0].length:this.yylloc.first_column-k},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-k]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(d){this.unput(this.match.slice(d))},pastInput:function(){var d=this.matched.substr(0,this.matched.length-this.match.length);return(d.length>20?"...":"")+d.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var d=this.match;return d.length<20&&(d+=this._input.substr(0,20-d.length)),(d.substr(0,20)+(d.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var d=this.pastInput(),k=new Array(d.length+1).join("-");return d+this.upcomingInput()+`
`+k+"^"},test_match:function(d,k){var b,y,C;if(this.options.backtrack_lexer&&(C={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(C.yylloc.range=this.yylloc.range.slice(0))),y=d[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+d[0].length},this.yytext+=d[0],this.match+=d[0],this.matches=d,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(d[0].length),this.matched+=d[0],b=this.performAction.call(this,this.yy,this,k,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),b)return b;if(this._backtrack){for(var l in C)this[l]=C[l];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var d,k,b,y;this._more||(this.yytext="",this.match="");for(var C=this._currentRules(),l=0;l<C.length;l++)if(b=this._input.match(this.rules[C[l]]),b&&(!k||b[0].length>k[0].length)){if(k=b,y=l,this.options.backtrack_lexer){if(d=this.test_match(b,C[l]),d!==!1)return d;if(this._backtrack){k=!1;continue}else return!1}else if(!this.options.flex)break}return k?(d=this.test_match(k,C[y]),d!==!1?d:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var k=this.next();return k||this.lex()},begin:function(k){this.conditionStack.push(k)},popState:function(){var k=this.conditionStack.length-1;return k>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(k){return k=this.conditionStack.length-1-Math.abs(k||0),k>=0?this.conditionStack[k]:"INITIAL"},pushState:function(k){this.begin(k)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(k,b,y,C){function l(u,st){return b.yytext=b.yytext.substring(u,b.yyleng-st+u)}var xt=C;switch(y){case 0:if(b.yytext.slice(-2)==="\\\\"?(l(0,1),this.begin("mu")):b.yytext.slice(-1)==="\\"?(l(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;break;case 3:return this.begin("raw"),15;break;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(l(5,9),18);case 5:return 15;case 6:return this.popState(),14;break;case 7:return 64;case 8:return 67;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;break;case 11:return 56;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;break;case 16:return this.popState(),44;break;case 17:return 34;case 18:return 39;case 19:return 52;case 20:return 48;case 21:this.unput(b.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;break;case 23:return 48;case 24:return 72;case 25:return 71;case 26:return 71;case 27:return 86;case 28:break;case 29:return this.popState(),55;break;case 30:return this.popState(),33;break;case 31:return b.yytext=l(1,2).replace(/\\"/g,'"'),79;break;case 32:return b.yytext=l(1,2).replace(/\\'/g,"'"),79;break;case 33:return 84;case 34:return 81;case 35:return 81;case 36:return 82;case 37:return 83;case 38:return 80;case 39:return 74;case 40:return 76;case 41:return 71;case 42:return b.yytext=b.yytext.replace(/\\([\\\]])/g,"$1"),71;break;case 43:return"INVALID";case 44:return 5}},rules:[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],conditions:{mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}}};return nt}();Be.lexer=zn;function Ie(){this.yy={}}return Ie.prototype=Be,Be.Parser=Ie,new Ie}(),Ee=qs;var nr=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function sr(e,t){var r=t&&t.loc,n,s,i,a;r&&(n=r.start.line,s=r.end.line,i=r.start.column,a=r.end.column,e+=" - "+n+":"+i);for(var o=Error.prototype.constructor.call(this,e),c=0;c<nr.length;c++)this[nr[c]]=o[nr[c]];Error.captureStackTrace&&Error.captureStackTrace(this,sr);try{r&&(this.lineNumber=n,this.endLineNumber=s,Objec
`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nharr:"\u21AE",nhArr:"\u21CE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlarr:"\u219A",nlArr:"\u21CD",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nleftarrow:"\u219A",nLeftarrow:"\u21CD",nleftrightarrow:"\u21AE",nLeftrightarrow:"\u21CE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",nopf:"\u{1D55F}",Nopf:"\u2115",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangle:"\u22EB",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",nparallel:"\u2226",npar:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",nprec:"\u2280",npreceq:"\u2AAF\u0338",npre:"\u2AAF\u0338",nrarrc:"\u2933\u0338",nrarr:"\u219B",nrArr:"\u21CF",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nRightarrow:"\u21CF",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvDash:"\u22AD",nVdash:"\u22AE",nVDash:"\u22AF",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwarr:"\u2196",nwArr:"\u21D6",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",Ocirc:"\xD4",ocirc:"\xF4",ocir:"\u229A",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u01
`)}var hr=function(){function e(t,r,n){n===void 0&&(n="precompile"),this.delegate=t,this.entityParser=r,this.mode=n,this.state="beforeData",this.line=-1,this.column=-1,this.input="",this.index=-1,this.tagNameBuffer="",this.states={beforeData:function(){var s=this.peek();if(s==="<"&&!this.isIgnoredEndTag())this.transitionTo("tagOpen"),this.markTagStart(),this.consume();else{if(this.mode==="precompile"&&s===`
`){var i=this.tagNameBuffer.toLowerCase();(i==="pre"||i==="textarea")&&this.consume()}this.transitionTo("data"),this.delegate.beginData()}},data:function(){var s=this.peek(),i=this.tagNameBuffer;s==="<"&&!this.isIgnoredEndTag()?(this.delegate.finishData(),this.transitionTo("tagOpen"),this.markTagStart(),this.consume()):s==="&"&&i!=="script"&&i!=="style"?(this.consume(),this.delegate.appendToData(this.consumeCharRef()||"&")):(this.consume(),this.delegate.appendToData(s))},tagOpen:function(){var s=this.consume();s==="!"?this.transitionTo("markupDeclarationOpen"):s==="/"?this.transitionTo("endTagOpen"):(s==="@"||s===":"||wn(s))&&(this.transitionTo("tagName"),this.tagNameBuffer="",this.delegate.beginStartTag(),this.appendToTagName(s))},markupDeclarationOpen:function(){var s=this.consume();if(s==="-"&&this.peek()==="-")this.consume(),this.transitionTo("commentStart"),this.delegate.beginComment();else{var i=s.toUpperCase()+this.input.substring(this.index,this.index+6).toUpperCase();i==="DOCTYPE"&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.transitionTo("doctype"),this.delegate.beginDoctype&&this.delegate.beginDoctype())}},doctype:function(){var s=this.consume();_(s)&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var s=this.consume();_(s)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(s.toLowerCase()))},doctypeName:function(){var s=this.consume();_(s)?this.transitionTo("afterDoctypeName"):s===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(s.toLowerCase())},afterDoctypeName:function(){var s=this.consume();if(!_(s))if(s===">")this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData");else{var i=s.toUpperCase()+this.input.substring(this.index,this.index+5).toUpperCase(),a=i.toUpperCase()==="PUBLIC",o=i.toUpperCase()==="SYSTEM";(a||o)&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume()),a?this.transitionTo("afterDoctypePublicKeyword"):o&&this.transitionTo("afterDoctypeSystemKeyword")}},afterDoctypePublicKeyword:function(){var s=this.peek();_(s)?(this.transitionTo("beforeDoctypePublicIdentifier"),this.consume()):s==='"'?(this.transitionTo("doctypePublicIdentifierDoubleQuoted"),this.consume()):s==="'"?(this.transitionTo("doctypePublicIdentifierSingleQuoted"),this.consume()):s===">"&&(this.consume(),this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},doctypePublicIdentifierDoubleQuoted:function(){var s=this.consume();s==='"'?this.transitionTo("afterDoctypePublicIdentifier"):s===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(s)},doctypePublicIdentifierSingleQuoted:function(){var s=this.consume();s==="'"?this.transitionTo("afterDoctypePublicIdentifier"):s===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(s)},afterDoctypePublicIdentifier:function(){var s=this.consume();_(s)?this.transitionTo("betweenDoctypePublicAndSystemIdentifiers"):s===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):s==='"'?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):s==="'"&&this.transitionTo("doctypeSystemIdentifierSingleQuoted")},betweenDoctypePublicAndSystemIdentifiers:function(){var s=this.consume();_(s)||(s===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):s==='"'?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):s==="'"&&this.transitionTo("doctypeSystemIdentifierSingleQuoted"))},doctypeSystemIdentifierDoubleQuoted:function(){var s=this.consume();s==='"'?this.transitionTo("afterDoctypeSystemIdentifier"):s===">"?(this.delegate.endDoctype&&this.delegat
`?(this.line++,this.column=0):this.column++,t},e.prototype.consumeCharRef=function(){var t=this.input.indexOf(";",this.index);if(t!==-1){var r=this.input.slice(this.index,t),n=this.entityParser.parse(r);if(n){for(var s=r.length;s;)this.consume(),s--;return this.consume(),n}}},e.prototype.markTagStart=function(){this.delegate.tagOpen()},e.prototype.appendToTagName=function(t){this.tagNameBuffer+=t,this.delegate.appendToTagName(t)},e.prototype.isIgnoredEndTag=function(){var t=this.tagNameBuffer;return t==="title"&&this.input.substring(this.index,this.index+8)!=="</title>"||t==="style"&&this.input.substring(this.index,this.index+8)!=="</style>"||t==="script"&&this.input.substring(this.index,this.index+9)!=="<\/script>"},e}(),Ka=function(){function e(t,r){r===void 0&&(r={}),this.options=r,this.token=null,this.startLine=1,this.startColumn=0,this.tokens=[],this.tokenizer=new hr(this,t,r.mode),this._currentAttribute=void 0}return e.prototype.tokenize=function(t){return this.tokens=[],this.tokenizer.tokenize(t),this.tokens},e.prototype.tokenizePart=function(t){return this.tokens=[],this.tokenizer.tokenizePart(t),this.tokens},e.prototype.tokenizeEOF=function(){return this.tokens=[],this.tokenizer.tokenizeEOF(),this.tokens[0]},e.prototype.reset=function(){this.token=null,this.startLine=1,this.startColumn=0},e.prototype.current=function(){var t=this.token;if(t===null)throw new Error("token was unexpectedly null");if(arguments.length===0)return t;for(var r=0;r<arguments.length;r++)if(t.type===arguments[r])return t;throw new Error("token type was unexpectedly "+t.type)},e.prototype.push=function(t){this.token=t,this.tokens.push(t)},e.prototype.currentAttribute=function(){return this._currentAttribute},e.prototype.addLocInfo=function(){this.options.loc&&(this.current().loc={start:{line:this.startLine,column:this.startColumn},end:{line:this.tokenizer.line,column:this.tokenizer.column}}),this.startLine=this.tokenizer.line,this.startColumn=this.tokenizer.column},e.prototype.beginDoctype=function(){this.push({type:"Doctype",name:""})},e.prototype.appendToDoctypeName=function(t){this.current("Doctype").name+=t},e.prototype.appendToDoctypePublicIdentifier=function(t){var r=this.current("Doctype");r.publicIdentifier===void 0?r.publicIdentifier=t:r.publicIdentifier+=t},e.prototype.appendToDoctypeSystemIdentifier=function(t){var r=this.current("Doctype");r.systemIdentifier===void 0?r.systemIdentifier=t:r.systemIdentifier+=t},e.prototype.endDoctype=function(){this.addLocInfo()},e.prototype.beginData=function(){this.push({type:"Chars",chars:""})},e.prototype.appendToData=function(t){this.current("Chars").chars+=t},e.prototype.finishData=function(){this.addLocInfo()},e.prototype.beginComment=function(){this.push({type:"Comment",chars:""})},e.prototype.appendToCommentData=function(t){this.current("Comment").chars+=t},e.prototype.finishComment=function(){this.addLocInfo()},e.prototype.tagOpen=function(){},e.prototype.beginStartTag=function(){this.push({type:"StartTag",tagName:"",attributes:[],selfClosing:!1})},e.prototype.beginEndTag=function(){this.push({type:"EndTag",tagName:""})},e.prototype.finishTag=function(){this.addLocInfo()},e.prototype.markTagAsSelfClosing=function(){this.current("StartTag").selfClosing=!0},e.prototype.appendToTagName=function(t){this.current("StartTag","EndTag").tagName+=t},e.prototype.beginAttribute=function(){this._currentAttribute=["","",!1]},e.prototype.appendToAttributeName=function(t){this.currentAttribute()[0]+=t},e.prototype.beginAttributeValue=function(t){this.currentAttribute()[2]=t},e.prototype.appendToAttributeValue=function(t){this.currentAttribute()[1]+=t},e.prototype.finishAttributeValue=function(){this.current("StartTag").attributes.push(this._currentAttribute)},e.prototype.reportSyntaxError=function(t){this.current().syntaxError=t},e}();var xe={Append:1,TrustingAppend:2,Comment:3,Modifier:4,StrictModifier:5,Block:6,StrictBlock:7,Component:8,OpenElement:10,OpenElementWithSplat:11,FlushElement:12,CloseElement:13,StaticAttr:14,DynamicAttr:15,ComponentAttr:16,AttrSplat:17,Yield:18,DynamicArg:20,StaticArg:21
`,n);if(t<=s||s===-1)return{line:r+1,column:t-n};r+=1,n=s+1}}charPosFor(t){let{line:r,column:n}=t,s=this.source.length,i=0,a=0;for(;a<s;){let o=this.source.indexOf(`
`,a);if(o===-1&&(o=this.source.length),i===r-1){if(a+n>o)return o;if(!1){let c=this.hbsPosFor(a+n);c.line,c.column}return a+n}if(o===-1)return 0;i+=1,a=o+1}return s}};function S(e,t){let{module:r,loc:n}=t,{line:s,column:i}=n.start,a=t.asString(),o=a?`
|
| ${a.split(`
`).join(`
| `)}
|
`:"",c=new Error(`${e}: ${o}(error occurred in '${r}' @ line ${s} : column ${i})`);return c.name="SyntaxError",c.location=t,c.code=a,c}var ai={Template:["body"],Block:["body"],MustacheStatement:["path","params","hash"],BlockStatement:["path","params","hash","program","inverse"],ElementModifierStatement:["path","params","hash"],CommentStatement:[],MustacheCommentStatement:[],ElementNode:["attributes","modifiers","children","comments"],AttrNode:["value"],TextNode:[],ConcatStatement:["parts"],SubExpression:["path","params","hash"],PathExpression:[],StringLiteral:[],BooleanLiteral:[],NumberLiteral:[],NullLiteral:[],UndefinedLiteral:[],Hash:["pairs"],HashPair:["value"]},xr=function(){function e(t,r,n,s){let i=Error.call(this,t);this.key=s,this.message=t,this.node=r,this.parent=n,i.stack&&(this.stack=i.stack)}return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}();function Nn(e,t,r){return new xr("Cannot remove a node unless it is part of an array",e,t,r)}function oi(e,t,r){return new xr("Cannot replace a node with multiple nodes unless it is part of an array",e,t,r)}function xn(e,t){return new xr("Replacing and removing in key handlers is not yet supported.",e,null,t)}var Ft=class{node;parent;parentKey;constructor(t,r=null,n=null){this.node=t,this.parent=r,this.parentKey=n}get parentNode(){return this.parent?this.parent.node:null}parents(){return{[Symbol.iterator]:()=>new vr(this)}}},vr=class{path;constructor(t){this.path=t}next(){return this.path.parent?(this.path=this.path.parent,{done:!1,value:this.path}):{done:!0,value:null}}};function Bn(e){return typeof e=="function"?e:e.enter}function In(e){return typeof e=="function"?void 0:e.exit}function De(e,t){let r,n,s,{node:i,parent:a,parentKey:o}=t,c=function(h,p){if(h.Program&&(p==="Template"&&!h.Template||p==="Block"&&!h.Block))return h.Program;let m=h[p];return m!==void 0?m:h.All}(e,i.type);if(c!==void 0&&(r=Bn(c),n=In(c)),r!==void 0&&(s=r(i,t)),s!=null){if(JSON.stringify(i)!==JSON.stringify(s))return Array.isArray(s)?(Rn(e,s,a,o),s):De(e,new Ft(s,a,o))||s;s=void 0}if(s===void 0){let h=ai[i.type];for(let p=0;p<h.length;p++)li(e,c,t,h[p]);n!==void 0&&(s=n(i,t))}return s}function An(e,t,r){e[t]=r}function li(e,t,r,n){let s,i,{node:a}=r,o=function(c,h){return c[h]}(a,n);if(o){if(t!==void 0){let c=function(h,p){let m=typeof h!="function"?h.keys:void 0;if(m===void 0)return;let v=m[p];return v!==void 0?v:m.All}(t,n);c!==void 0&&(s=Bn(c),i=In(c))}if(s!==void 0&&s(a,n)!==void 0)throw xn(a,n);if(Array.isArray(o))Rn(e,o,r,n);else{let c=De(e,new Ft(o,r,n));c!==void 0&&function(h,p,m,v){if(v===null)throw Nn(m,h,p);if(Array.isArray(v)){if(v.length!==1)throw v.length===0?Nn(m,h,p):oi(m,h,p);An(h,p,v[0])}else An(h,p,v)}(a,n,o,c)}if(i!==void 0&&i(a,n)!==void 0)throw xn(a,n)}}function Rn(e,t,r,n){for(let s=0;s<t.length;s++){let i=t[s],a=De(e,new Ft(i,r,n));a!==void 0&&(s+=ci(t,s,a)-1)}}function ci(e,t,r){return r===null?(e.splice(t,1),0):Array.isArray(r)?(e.splice(t,1,...r),r.length):(e.splice(t,1,r),1)}function ui(e,t){De(t,new Ft(e))}function Vt(e,t){(function(r){switch(r.type){case"Block":case"Template":return r.body;case"ElementNode":return r.children}})(e).push(t)}function qn(e){return e.type==="StringLiteral"||e.type==="BooleanLiteral"||e.type==="NumberLiteral"||e.type==="NullLiteral"||e.type==="UndefinedLiteral"}var pr;function fr(){return pr||(pr=new Et("","(synthetic)")),pr}function Pn(e,t){return f.var({name:e,loc:T(t||null)})}function lt(e,t){let r=T(t||null);if(typeof e!="string"){if("type"in e)return e;{e.head.indexOf(".");let{head:i,tail:a}=e;return f.path({head:f.head({original:i,loc:r.sliceStartChars({chars:i.length})}),tail:a,loc:T(t||null)})}}let{head:n,tail:s}=function(i,a){let[o,...c]=ie(i.split(".")),h=f.head({original:o,loc:T(a||null)});return f.path({head:h,tail:c,loc:T(a||null)})}(e,r);return f.path({head:n,tail:s,loc:r})}function Pe(e,t,r){return f.literal({type:e,value:t,loc:T(r||null)})}function ne(e=[],t){return f.hash({pairs:e,loc:T(t||null)})}function Vn(e){return e.map(t=>typeof t=="string"?f.var({name:t,loc:D.synthetic(t)}):t)}functio
`)}},wr=class extends Er{pendingError=null;parse(t,r){var i;let n=f.template({body:[],blockParams:r,loc:this.source.spanFor(t.loc)}),s=this.parseProgram(n,t);return(i=this.pendingError)==null||i.eof(s.loc.getEnd()),s}Program(t,r){let n=f.blockItself({body:[],params:r,chained:t.chained,loc:this.source.spanFor(t.loc)});return this.parseProgram(n,t)}parseProgram(t,r){if(r.body.length===0)return t;let n;try{this.elementStack.push(t);for(let s of r.body)this.acceptNode(s)}finally{n=this.elementStack.pop()}if(t!==n){if((n==null?void 0:n.type)==="ElementNode")throw S(`Unclosed element \`${n.tag}\``,n.loc);t.type}return t}BlockStatement(t){var p;if(this.tokenizer.state==="comment")return void this.appendToCommentData(this.sourceForNode(t));if(this.tokenizer.state!=="data"&&this.tokenizer.state!=="beforeData")throw S("A block may only be used inside an HTML element or another block.",this.source.spanFor(t.loc));let{path:r,params:n,hash:s}=dr(this,t),i=this.source.spanFor(t.loc),a=[];if((p=t.program.blockParams)!=null&&p.length){let m=s.loc.collapse("end");m=t.program.loc?m.withEnd(this.source.spanFor(t.program.loc).getStart()):t.program.body[0]?m.withEnd(this.source.spanFor(t.program.body[0].loc).getStart()):m.withEnd(i.getEnd());let v=m.asString(),g=v.indexOf("|")+1,E=v.indexOf("|",g);for(let N of t.program.blockParams){let x,w;x=g>=E?-1:v.indexOf(N,g),x===-1||x+N.length>E?(g=E,w=this.source.spanFor(se)):(g=x,w=m.sliceStartChars({skipStart:g,chars:N.length}),g+=N.length),a.push(f.var({name:N,loc:w}))}}t.program.loc||(t.program.loc=se),t.inverse&&!t.inverse.loc&&(t.inverse.loc=se);let o=this.Program(t.program,a),c=t.inverse?this.Program(t.inverse,[]):null,h=f.block({path:r,params:n,hash:s,defaultBlock:o,elseBlock:c,loc:this.source.spanFor(t.loc),openStrip:t.openStrip,inverseStrip:t.inverseStrip,closeStrip:t.closeStrip});Vt(this.currentElement(),h)}MustacheStatement(t){var o;(o=this.pendingError)==null||o.mustache(this.source.spanFor(t.loc));let{tokenizer:r}=this;if(r.state==="comment")return void this.appendToCommentData(this.sourceForNode(t));let n,{escaped:s,loc:i,strip:a}=t;if("original"in t.path&&t.path.original==="...attributes")throw S("Illegal use of ...attributes",this.source.spanFor(t.loc));if(qn(t.path))n=f.mustache({path:this.acceptNode(t.path),params:[],hash:f.hash({pairs:[],loc:this.source.spanFor(t.path.loc).collapse("end")}),trusting:!s,loc:this.source.spanFor(i),strip:a});else{let{path:c,params:h,hash:p}=dr(this,t);n=f.mustache({path:c,params:h,hash:p,trusting:!s,loc:this.source.spanFor(i),strip:a})}switch(r.state){case"tagOpen":case"tagName":throw S("Cannot use mustaches in an elements tagname",n.loc);case"beforeAttributeName":gr(this.currentStartTag,n);break;case"attributeName":case"afterAttributeName":this.beginAttributeValue(!1),this.finishAttributeValue(),gr(this.currentStartTag,n),r.transitionTo("beforeAttributeName");break;case"afterAttributeValueQuoted":gr(this.currentStartTag,n),r.transitionTo("beforeAttributeName");break;case"beforeAttributeValue":this.beginAttributeValue(!1),this.appendDynamicAttributeValuePart(n),r.transitionTo("attributeValueUnquoted");break;case"attributeValueDoubleQuoted":case"attributeValueSingleQuoted":case"attributeValueUnquoted":this.appendDynamicAttributeValuePart(n);break;default:Vt(this.currentElement(),n)}return n}appendDynamicAttributeValuePart(t){this.finalizeTextPart();let r=this.currentAttr;r.isDynamic=!0,r.parts.push(t)}finalizeTextPart(){let t=this.currentAttr.currentPart;t!==null&&(this.currentAttr.parts.push(t),this.startTextPart())}startTextPart(){this.currentAttr.currentPart=null}ContentStatement(t){(function(r,n){let s=n.loc.start.line,i=n.loc.start.column,a=function(o,c){if(c==="")return{lines:o.split(`
`).length-1,columns:0};let[h]=o.split(c),p=h.split(/\n/u),m=p.length-1;return{lines:m,columns:p[m].length}}(n.original,n.value);s+=a.lines,a.lines?i=a.columns:i+=a.columns,r.line=s,r.column=i})(this.tokenizer,t),this.tokenizer.tokenizePart(t.value),this.tokenizer.flushData()}CommentStatement(t){let{tokenizer:r}=this;if(r.state==="comment")return this.appendToCommentData(this.sourceForNode(t)),null;let{value:n,loc:s}=t,i=f.mustacheComment({value:n,loc:this.source.spanFor(s)});switch(r.state){case"beforeAttributeName":case"afterAttributeName":this.currentStartTag.comments.push(i);break;case"beforeData":case"data":Vt(this.currentElement(),i);break;default:throw S(`Using a Handlebars comment when in the \`${r.state}\` state is not supported`,this.source.spanFor(t.loc))}return i}PartialStatement(t){throw S("Handlebars partials are not supported",this.source.spanFor(t.loc))}PartialBlockStatement(t){throw S("Handlebars partial blocks are not supported",this.source.spanFor(t.loc))}Decorator(t){throw S("Handlebars decorators are not supported",this.source.spanFor(t.loc))}DecoratorBlock(t){throw S("Handlebars decorator blocks are not supported",this.source.spanFor(t.loc))}SubExpression(t){let{path:r,params:n,hash:s}=dr(this,t);return f.sexpr({path:r,params:n,hash:s,loc:this.source.spanFor(t.loc)})}PathExpression(t){let{original:r}=t,n;if(r.indexOf("/")!==-1){if(r.slice(0,2)==="./")throw S('Using "./" is not supported in Glimmer and unnecessary',this.source.spanFor(t.loc));if(r.slice(0,3)==="../")throw S('Changing context using "../" is not supported in Glimmer',this.source.spanFor(t.loc));if(r.indexOf(".")!==-1)throw S("Mixing '.' and '/' in paths is not supported in Glimmer; use only '.' to separate property paths",this.source.spanFor(t.loc));n=[t.parts.join("/")]}else{if(r===".")throw S("'.' is not a supported path in Glimmer; check for a path with a trailing '.'",this.source.spanFor(t.loc));n=t.parts}let s,i=!1;if(/^this(?:\..+)?$/u.test(r)&&(i=!0),i)s=f.this({loc:this.source.spanFor({start:t.loc.start,end:{line:t.loc.start.line,column:t.loc.start.column+4}})});else if(t.data){let a=n.shift();if(a===void 0)throw S("Attempted to parse a path expression, but it was not valid. Paths beginning with @ must start with a-z.",this.source.spanFor(t.loc));s=f.atName({name:`@${a}`,loc:this.source.spanFor({start:t.loc.start,end:{line:t.loc.start.line,column:t.loc.start.column+a.length+1}})})}else{let a=n.shift();if(a===void 0)throw S("Attempted to parse a path expression, but it was not valid. Paths must start with a-z or A-Z.",this.source.spanFor(t.loc));s=f.var({name:a,loc:this.source.spanFor({start:t.loc.start,end:{line:t.loc.start.line,column:t.loc.start.column+a.length}})})}return f.path({head:s,tail:n,loc:this.source.spanFor(t.loc)})}Hash(t){let r=t.pairs.map(n=>f.pair({key:n.key,value:this.acceptNode(n.value),loc:this.source.spanFor(n.loc)}));return f.hash({pairs:r,loc:this.source.spanFor(t.loc)})}StringLiteral(t){return f.literal({type:"StringLiteral",value:t.value,loc:this.source.spanFor(t.loc)})}BooleanLiteral(t){return f.literal({type:"BooleanLiteral",value:t.value,loc:this.source.spanFor(t.loc)})}NumberLiteral(t){return f.literal({type:"NumberLiteral",value:t.value,loc:this.source.spanFor(t.loc)})}UndefinedLiteral(t){return f.literal({type:"UndefinedLiteral",value:void 0,loc:this.source.spanFor(t.loc)})}NullLiteral(t){return f.literal({type:"NullLiteral",value:null,loc:this.source.spanFor(t.loc)})}};function dr(e,t){let r;switch(t.path.type){case"PathExpression":r=e.PathExpression(t.path);break;case"SubExpression":r=e.SubExpression(t.path);break;case"StringLiteral":case"UndefinedLiteral":case"NullLiteral":case"NumberLiteral":case"BooleanLiteral":{let i;throw i=t.path.type==="BooleanLiteral"?t.path.original.toString():t.path.type==="StringLiteral"?`"${t.path.original}"`:t.path.type==="NullLiteral"?"null":t.path.type==="NumberLiteral"?t.path.value.toString():"undefined",S(`${t.path.type} "${t.path.type==="StringLiteral"?t.path.original:i}" cannot be called as a sub-expression, replace (${i}) with ${i}`,e.source.spanFor(t.path.lo
`?n?n.loc.getEnd():this.currentAttr.valueSpan.getStart():i.move(-1),this.currentAttr.currentPart=f.text({chars:t,loc:i.collapsed()})}}finishAttributeValue(){this.finalizeTextPart();let t=this.currentTag,r=this.offset();if(t.type==="EndTag")throw S("Invalid end tag: closing tag must not have attributes",this.source.spanFor({start:t.start.toJSON(),end:r.toJSON()}));let{name:n,parts:s,start:i,isQuoted:a,isDynamic:o,valueSpan:c}=this.currentAttr;if(n.startsWith("|")&&s.length===0&&!a&&!o)throw S("Invalid block parameters syntax: block parameters must be preceded by the `as` keyword",i.until(i.move(n.length)));let h=this.assembleAttributeValue(s,a,o,i.until(r));h.loc=c.withEnd(r);let p=f.attr({name:n,value:h,loc:i.until(r)});this.currentStartTag.attributes.push(p)}parsePossibleBlockParams(){let t=/[!"#%&'()*+./;<=>@[\\\]^`{|}~]/u;this.tokenizer.state;let r=this.currentStartTag,n=this.currentAttr,s={state:"PossibleAs"},i={PossibleAs:o=>{if(s.state,qt(o))s={state:"BeforeStartPipe"},this.tokenizer.transitionTo("afterAttributeName"),this.tokenizer.consume();else{if(o==="|")throw S('Invalid block parameters syntax: expecting at least one space character between "as" and "|"',n.start.until(this.offset().move(1)));s={state:"Done"}}},BeforeStartPipe:o=>{s.state,qt(o)?this.tokenizer.consume():o==="|"?(s={state:"BeforeBlockParamName"},this.tokenizer.transitionTo("beforeAttributeName"),this.tokenizer.consume()):s={state:"Done"}},BeforeBlockParamName:o=>{if(s.state,qt(o))this.tokenizer.consume();else if(o==="")s={state:"Done"},this.pendingError={mustache(c){throw S("Invalid block parameters syntax: mustaches cannot be used inside parameters list",c)},eof(c){throw S('Invalid block parameters syntax: expecting the tag to be closed with ">" or "/>" after parameters list',n.start.until(c))}};else if(o==="|"){if(r.params.length===0)throw S("Invalid block parameters syntax: empty parameters list, expecting at least one identifier",n.start.until(this.offset().move(1)));s={state:"AfterEndPipe"},this.tokenizer.consume()}else{if(o===">"||o==="/")throw S('Invalid block parameters syntax: incomplete parameters list, expecting "|" but the tag was closed prematurely',n.start.until(this.offset().move(1)));s={state:"BlockParamName",name:o,start:this.offset()},this.tokenizer.consume()}},BlockParamName:o=>{if(s.state,o==="")s={state:"Done"},this.pendingError={mustache(c){throw S("Invalid block parameters syntax: mustaches cannot be used inside parameters list",c)},eof(c){throw S('Invalid block parameters syntax: expecting the tag to be closed with ">" or "/>" after parameters list',n.start.until(c))}};else if(o==="|"||qt(o)){let c=s.start.until(this.offset());if(s.name==="this"||t.test(s.name))throw S(`Invalid block parameters syntax: invalid identifier name \`${s.name}\``,c);r.params.push(f.var({name:s.name,loc:c})),s=o==="|"?{state:"AfterEndPipe"}:{state:"BeforeBlockParamName"},this.tokenizer.consume()}else{if(o===">"||o==="/")throw S('Invalid block parameters syntax: expecting "|" but the tag was closed prematurely',n.start.until(this.offset().move(1)));s.name+=o,this.tokenizer.consume()}},AfterEndPipe:o=>{s.state,qt(o)?this.tokenizer.consume():o===""?(s={state:"Done"},this.pendingError={mustache(c){throw S("Invalid block parameters syntax: modifiers cannot follow parameters list",c)},eof(c){throw S('Invalid block parameters syntax: expecting the tag to be closed with ">" or "/>" after parameters list',n.start.until(c))}}):o===">"||o==="/"?s={state:"Done"}:(s={state:"Error",message:'Invalid block parameters syntax: expecting the tag to be closed with ">" or "/>" after parameters list',start:this.offset()},this.tokenizer.consume())},Error:o=>{if(s.state,o===""||o==="/"||o===">"||qt(o))throw S(s.message,s.start.until(this.offset()));this.tokenizer.consume()},Done:()=>{}},a;do a=this.tokenizer.peek(),i[s.state](a);while(s.state!=="Done"&&a!=="");s.state}reportSyntaxError(t){throw S(t,this.offset().collapsed())}assembleConcatenatedValue(t){for(let s of t)if(s.type!=="MustacheStatement"&&s.type!=="TextNode")throw S(`Unsupported node in quoted attribute val
`,Fn="\r",Un=function(){function e(t){this.length=t.length;for(var r=[0],n=0;n<t.length;)switch(t[n]){case _e:n+=_e.length,r.push(n);break;case Fn:n+=Fn.length,t[n]===_e&&(n+=_e.length),r.push(n);break;default:n++;break}this.offsets=r}return e.prototype.locationForIndex=function(t){if(t<0||t>this.length)return null;for(var r=0,n=this.offsets;n[r+1]<=t;)r++;var s=t-n[r];return{line:r,column:s}},e.prototype.indexForLocation=function(t){var r=t.line,n=t.column;return r<0||r>=this.offsets.length||n<0||n>this.lengthOfLine(r)?null:this.offsets[r]+n},e.prototype.lengthOfLine=function(t){var r=this.offsets[t],n=t===this.offsets.length-1?this.length:this.offsets[t+1];return n-r},e}();function mi(e,t){let r=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(r,t)}var Mn=mi;function di(e){let t=e.children??e.body;if(t)for(let r=0;r<t.length-1;r++)t[r].type==="TextNode"&&t[r+1].type==="MustacheStatement"&&(t[r].chars=t[r].chars.replace(/\\$/u,"\\\\"))}function gi(e){let t=new Un(e),r=({line:s,column:i})=>t.indexForLocation({line:s-1,column:i}),n=s=>{let{start:i,end:a}=s.loc;i.offset=r(i),a.offset=r(a)};return()=>({name:"prettierParsePlugin",visitor:{All(s){n(s),di(s)}}})}function bi(e){let t;try{t=Hn(e,{mode:"codemod",plugins:{ast:[gi(e)]}})}catch(r){let n=ki(r);if(n){let s=yi(r);throw Mn(s,{loc:n,cause:r})}throw r}return t}function yi(e){let{message:t}=e,r=t.split(`
`);return r.length>=4&&/^Parse error on line \d+:$/u.test(r[0])&&/^-*\^$/u.test(it(!1,r,-2))?it(!1,r,-1):r.length>=4&&/:\s?$/u.test(r[0])&&/^\(error occurred in '.*?' @ line \d+ : column \d+\)$/u.test(it(!1,r,-1))&&r[1]===""&&it(!1,r,-2)===""&&r.slice(2,-2).every(n=>n.startsWith("|"))?r[0].trim().slice(0,-1):t}function ki(e){let{location:t,hash:r}=e;if(t){let{start:n,end:s}=t;return typeof s.line!="number"?{start:n}:t}if(r){let{loc:{last_line:n,last_column:s}}=r;return{start:{line:n,column:s+1}}}}var Si={parse:bi,astFormat:"glimmer",locStart:yt,locEnd:te};var vi={glimmer:fn};var wo=Pr;export{wo as default,mn as languages,Ar as parsers,vi as printers};