@wavemaker/app-runtime-wm-build 12.0.0-next.45057 → 12.0.0-next.45061
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- app-runtime-wm-build/package.json +1 -1
- app-runtime-wm-build/wmapp/scripts/wm-libs.js +2 -2
- app-runtime-wm-build/wmapp/scripts/wm-libs.min.js +45 -45
- app-runtime-wm-build/wmapp/scripts/wm-loader.js +2 -2
- app-runtime-wm-build/wmapp/scripts/wm-loader.min.js +2 -2
- app-runtime-wm-build/wmapp/styles/foundation/foundation.css +457 -193
- app-runtime-wm-build/wmapp/styles/foundation/foundation.min.css +1 -1
- app-runtime-wm-build/wmmobile/scripts/wm-libs.js +2 -2
- app-runtime-wm-build/wmmobile/scripts/wm-libs.min.js +45 -45
- app-runtime-wm-build/wmmobile/scripts/wm-mobileloader.js +2 -2
- app-runtime-wm-build/wmmobile/scripts/wm-mobileloader.min.js +2 -2
|
@@ -435,7 +435,7 @@
|
|
|
435
435
|
* @license Angular v17.3.11
|
|
436
436
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
437
437
|
* License: MIT
|
|
438
|
-
*/const _SELECTOR_REGEXP=new RegExp("(\\:not\\()|"+"(([\\.\\#]?)[-\\w]+)|"+"(?:\\[([-.\\w*\\\\$]+)(?:=([\"']?)([^\\]\"']*)\\5)?\\])|"+"(\\))|"+"(\\s*,\\s*)","g");class CssSelector{constructor(){this.element=null;this.classNames=[];this.attrs=[];this.notSelectors=[]}static parse(selector){const results=[];const _addResult=(res,cssSel)=>{if(cssSel.notSelectors.length>0&&!cssSel.element&&cssSel.classNames.length==0&&cssSel.attrs.length==0){cssSel.element="*"}res.push(cssSel)};let cssSelector=new CssSelector;let match;let current=cssSelector;let inNot=false;_SELECTOR_REGEXP.lastIndex=0;while(match=_SELECTOR_REGEXP.exec(selector)){if(match[1]){if(inNot){throw new Error("Nesting :not in a selector is not allowed")}inNot=true;current=new CssSelector;cssSelector.notSelectors.push(current)}const tag=match[2];if(tag){const prefix=match[3];if(prefix==="#"){current.addAttribute("id",tag.slice(1))}else if(prefix==="."){current.addClassName(tag.slice(1))}else{current.setElement(tag)}}const attribute=match[4];if(attribute){current.addAttribute(current.unescapeAttribute(attribute),match[6])}if(match[7]){inNot=false;current=cssSelector}if(match[8]){if(inNot){throw new Error("Multiple selectors in :not are not supported")}_addResult(results,cssSelector);cssSelector=current=new CssSelector}}_addResult(results,cssSelector);return results}unescapeAttribute(attr){let result="";let escaping=false;for(let i=0;i<attr.length;i++){const char=attr.charAt(i);if(char==="\\"){escaping=true;continue}if(char==="$"&&!escaping){throw new Error(`Error in attribute selector "${attr}". `+`Unescaped "$" is not supported. Please escape with "\\$".`)}escaping=false;result+=char}return result}escapeAttribute(attr){return attr.replace(/\\/g,"\\\\").replace(/\$/g,"\\$")}isElementSelector(){return this.hasElementSelector()&&this.classNames.length==0&&this.attrs.length==0&&this.notSelectors.length===0}hasElementSelector(){return!!this.element}setElement(element=null){this.element=element}getAttrs(){const result=[];if(this.classNames.length>0){result.push("class",this.classNames.join(" "))}return result.concat(this.attrs)}addAttribute(name,value=""){this.attrs.push(name,value&&value.toLowerCase()||"")}addClassName(name){this.classNames.push(name.toLowerCase())}toString(){let res=this.element||"";if(this.classNames){this.classNames.forEach((klass=>res+=`.${klass}`))}if(this.attrs){for(let i=0;i<this.attrs.length;i+=2){const name=this.escapeAttribute(this.attrs[i]);const value=this.attrs[i+1];res+=`[${name}${value?"="+value:""}]`}}this.notSelectors.forEach((notSelector=>res+=`:not(${notSelector})`));return res}}class SelectorMatcher{constructor(){this._elementMap=new Map;this._elementPartialMap=new Map;this._classMap=new Map;this._classPartialMap=new Map;this._attrValueMap=new Map;this._attrValuePartialMap=new Map;this._listContexts=[]}static createNotMatcher(notSelectors){const notMatcher=new SelectorMatcher;notMatcher.addSelectables(notSelectors,null);return notMatcher}addSelectables(cssSelectors,callbackCtxt){let listContext=null;if(cssSelectors.length>1){listContext=new SelectorListContext(cssSelectors);this._listContexts.push(listContext)}for(let i=0;i<cssSelectors.length;i++){this._addSelectable(cssSelectors[i],callbackCtxt,listContext)}}_addSelectable(cssSelector,callbackCtxt,listContext){let matcher=this;const element=cssSelector.element;const classNames=cssSelector.classNames;const attrs=cssSelector.attrs;const selectable=new SelectorContext(cssSelector,callbackCtxt,listContext);if(element){const isTerminal=attrs.length===0&&classNames.length===0;if(isTerminal){this._addTerminal(matcher._elementMap,element,selectable)}else{matcher=this._addPartial(matcher._elementPartialMap,element)}}if(classNames){for(let i=0;i<classNames.length;i++){const isTerminal=attrs.length===0&&i===classNames.length-1;const className=classNames[i];if(isTerminal){this._addTerminal(matcher._classMap,className,selectable)}else{matcher=this._addPartial(matcher._classPartialMap,className)}}}if(attrs){for(let i=0;i<attrs.length;i+=2){const isTerminal=i===attrs.length-2;const name=attrs[i];const value=attrs[i+1];if(isTerminal){const terminalMap=matcher._attrValueMap;let terminalValuesMap=terminalMap.get(name);if(!terminalValuesMap){terminalValuesMap=new Map;terminalMap.set(name,terminalValuesMap)}this._addTerminal(terminalValuesMap,value,selectable)}else{const partialMap=matcher._attrValuePartialMap;let partialValuesMap=partialMap.get(name);if(!partialValuesMap){partialValuesMap=new Map;partialMap.set(name,partialValuesMap)}matcher=this._addPartial(partialValuesMap,value)}}}}_addTerminal(map,name,selectable){let terminalList=map.get(name);if(!terminalList){terminalList=[];map.set(name,terminalList)}terminalList.push(selectable)}_addPartial(map,name){let matcher=map.get(name);if(!matcher){matcher=new SelectorMatcher;map.set(name,matcher)}return matcher}match(cssSelector,matchedCallback){let result=false;const element=cssSelector.element;const classNames=cssSelector.classNames;const attrs=cssSelector.attrs;for(let i=0;i<this._listContexts.length;i++){this._listContexts[i].alreadyMatched=false}result=this._matchTerminal(this._elementMap,element,cssSelector,matchedCallback)||result;result=this._matchPartial(this._elementPartialMap,element,cssSelector,matchedCallback)||result;if(classNames){for(let i=0;i<classNames.length;i++){const className=classNames[i];result=this._matchTerminal(this._classMap,className,cssSelector,matchedCallback)||result;result=this._matchPartial(this._classPartialMap,className,cssSelector,matchedCallback)||result}}if(attrs){for(let i=0;i<attrs.length;i+=2){const name=attrs[i];const value=attrs[i+1];const terminalValuesMap=this._attrValueMap.get(name);if(value){result=this._matchTerminal(terminalValuesMap,"",cssSelector,matchedCallback)||result}result=this._matchTerminal(terminalValuesMap,value,cssSelector,matchedCallback)||result;const partialValuesMap=this._attrValuePartialMap.get(name);if(value){result=this._matchPartial(partialValuesMap,"",cssSelector,matchedCallback)||result}result=this._matchPartial(partialValuesMap,value,cssSelector,matchedCallback)||result}}return result}_matchTerminal(map,name,cssSelector,matchedCallback){if(!map||typeof name!=="string"){return false}let selectables=map.get(name)||[];const starSelectables=map.get("*");if(starSelectables){selectables=selectables.concat(starSelectables)}if(selectables.length===0){return false}let selectable;let result=false;for(let i=0;i<selectables.length;i++){selectable=selectables[i];result=selectable.finalize(cssSelector,matchedCallback)||result}return result}_matchPartial(map,name,cssSelector,matchedCallback){if(!map||typeof name!=="string"){return false}const nestedSelector=map.get(name);if(!nestedSelector){return false}return nestedSelector.match(cssSelector,matchedCallback)}}class SelectorListContext{constructor(selectors){this.selectors=selectors;this.alreadyMatched=false}}class SelectorContext{constructor(selector,cbContext,listContext){this.selector=selector;this.cbContext=cbContext;this.listContext=listContext;this.notSelectors=selector.notSelectors}finalize(cssSelector,callback){let result=true;if(this.notSelectors.length>0&&(!this.listContext||!this.listContext.alreadyMatched)){const notMatcher=SelectorMatcher.createNotMatcher(this.notSelectors);result=!notMatcher.match(cssSelector,null)}if(result&&callback&&(!this.listContext||!this.listContext.alreadyMatched)){if(this.listContext){this.listContext.alreadyMatched=true}callback(this.selector,this.cbContext)}return result}}const emitDistinctChangesOnlyDefaultValue=true;exports.ViewEncapsulation=void 0;(function(ViewEncapsulation){ViewEncapsulation[ViewEncapsulation["Emulated"]=0]="Emulated";ViewEncapsulation[ViewEncapsulation["None"]=2]="None";ViewEncapsulation[ViewEncapsulation["ShadowDom"]=3]="ShadowDom"})(exports.ViewEncapsulation||(exports.ViewEncapsulation={}));exports.ChangeDetectionStrategy=void 0;(function(ChangeDetectionStrategy){ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"]=0]="OnPush";ChangeDetectionStrategy[ChangeDetectionStrategy["Default"]=1]="Default"})(exports.ChangeDetectionStrategy||(exports.ChangeDetectionStrategy={}));var InputFlags;(function(InputFlags){InputFlags[InputFlags["None"]=0]="None";InputFlags[InputFlags["SignalBased"]=1]="SignalBased";InputFlags[InputFlags["HasDecoratorInputTransform"]=2]="HasDecoratorInputTransform"})(InputFlags||(InputFlags={}));const CUSTOM_ELEMENTS_SCHEMA={name:"custom-elements"};const NO_ERRORS_SCHEMA={name:"no-errors-schema"};const Type$1=Function;var SecurityContext;(function(SecurityContext){SecurityContext[SecurityContext["NONE"]=0]="NONE";SecurityContext[SecurityContext["HTML"]=1]="HTML";SecurityContext[SecurityContext["STYLE"]=2]="STYLE";SecurityContext[SecurityContext["SCRIPT"]=3]="SCRIPT";SecurityContext[SecurityContext["URL"]=4]="URL";SecurityContext[SecurityContext["RESOURCE_URL"]=5]="RESOURCE_URL"})(SecurityContext||(SecurityContext={}));var MissingTranslationStrategy;(function(MissingTranslationStrategy){MissingTranslationStrategy[MissingTranslationStrategy["Error"]=0]="Error";MissingTranslationStrategy[MissingTranslationStrategy["Warning"]=1]="Warning";MissingTranslationStrategy[MissingTranslationStrategy["Ignore"]=2]="Ignore"})(MissingTranslationStrategy||(MissingTranslationStrategy={}));function parserSelectorToSimpleSelector(selector){const classes=selector.classNames&&selector.classNames.length?[8,...selector.classNames]:[];const elementName=selector.element&&selector.element!=="*"?selector.element:"";return[elementName,...selector.attrs,...classes]}function parserSelectorToNegativeSelector(selector){const classes=selector.classNames&&selector.classNames.length?[8,...selector.classNames]:[];if(selector.element){return[1|4,selector.element,...selector.attrs,...classes]}else if(selector.attrs.length){return[1|2,...selector.attrs,...classes]}else{return selector.classNames&&selector.classNames.length?[1|8,...selector.classNames]:[]}}function parserSelectorToR3Selector(selector){const positive=parserSelectorToSimpleSelector(selector);const negative=selector.notSelectors&&selector.notSelectors.length?selector.notSelectors.map((notSelector=>parserSelectorToNegativeSelector(notSelector))):[];return positive.concat(...negative)}function parseSelectorToR3Selector(selector){return selector?CssSelector.parse(selector).map(parserSelectorToR3Selector):[]}var core=Object.freeze({__proto__:null,emitDistinctChangesOnlyDefaultValue:emitDistinctChangesOnlyDefaultValue,get ViewEncapsulation(){return exports.ViewEncapsulation},get ChangeDetectionStrategy(){return exports.ChangeDetectionStrategy},get InputFlags(){return InputFlags},CUSTOM_ELEMENTS_SCHEMA:CUSTOM_ELEMENTS_SCHEMA,NO_ERRORS_SCHEMA:NO_ERRORS_SCHEMA,Type:Type$1,get SecurityContext(){return SecurityContext},get MissingTranslationStrategy(){return MissingTranslationStrategy},parseSelectorToR3Selector:parseSelectorToR3Selector});let textEncoder;function digest$1(message){return message.id||computeDigest(message)}function computeDigest(message){return sha1(serializeNodes(message.nodes).join("")+`[${message.meaning}]`)}function decimalDigest(message){return message.id||computeDecimalDigest(message)}function computeDecimalDigest(message){const visitor=new _SerializerIgnoreIcuExpVisitor;const parts=message.nodes.map((a=>a.visit(visitor,null)));return computeMsgId(parts.join(""),message.meaning)}class _SerializerVisitor{visitText(text,context){return text.value}visitContainer(container,context){return`[${container.children.map((child=>child.visit(this))).join(", ")}]`}visitIcu(icu,context){const strCases=Object.keys(icu.cases).map((k=>`${k} {${icu.cases[k].visit(this)}}`));return`{${icu.expression}, ${icu.type}, ${strCases.join(", ")}}`}visitTagPlaceholder(ph,context){return ph.isVoid?`<ph tag name="${ph.startName}"/>`:`<ph tag name="${ph.startName}">${ph.children.map((child=>child.visit(this))).join(", ")}</ph name="${ph.closeName}">`}visitPlaceholder(ph,context){return ph.value?`<ph name="${ph.name}">${ph.value}</ph>`:`<ph name="${ph.name}"/>`}visitIcuPlaceholder(ph,context){return`<ph icu name="${ph.name}">${ph.value.visit(this)}</ph>`}visitBlockPlaceholder(ph,context){return`<ph block name="${ph.startName}">${ph.children.map((child=>child.visit(this))).join(", ")}</ph name="${ph.closeName}">`}}const serializerVisitor$1=new _SerializerVisitor;function serializeNodes(nodes){return nodes.map((a=>a.visit(serializerVisitor$1,null)))}class _SerializerIgnoreIcuExpVisitor extends _SerializerVisitor{visitIcu(icu,context){let strCases=Object.keys(icu.cases).map((k=>`${k} {${icu.cases[k].visit(this)}}`));return`{${icu.type}, ${strCases.join(", ")}}`}}function sha1(str){textEncoder??=new TextEncoder;const utf8=[...textEncoder.encode(str)];const words32=bytesToWords32(utf8,Endian.Big);const len=utf8.length*8;const w=new Uint32Array(80);let a=1732584193,b=4023233417,c=2562383102,d=271733878,e=3285377520;words32[len>>5]|=128<<24-len%32;words32[(len+64>>9<<4)+15]=len;for(let i=0;i<words32.length;i+=16){const h0=a,h1=b,h2=c,h3=d,h4=e;for(let j=0;j<80;j++){if(j<16){w[j]=words32[i+j]}else{w[j]=rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16],1)}const fkVal=fk(j,b,c,d);const f=fkVal[0];const k=fkVal[1];const temp=[rol32(a,5),f,e,k,w[j]].reduce(add32);e=d;d=c;c=rol32(b,30);b=a;a=temp}a=add32(a,h0);b=add32(b,h1);c=add32(c,h2);d=add32(d,h3);e=add32(e,h4)}return toHexU32(a)+toHexU32(b)+toHexU32(c)+toHexU32(d)+toHexU32(e)}function toHexU32(value){return(value>>>0).toString(16).padStart(8,"0")}function fk(index,b,c,d){if(index<20){return[b&c|~b&d,1518500249]}if(index<40){return[b^c^d,1859775393]}if(index<60){return[b&c|b&d|c&d,2400959708]}return[b^c^d,3395469782]}function fingerprint(str){textEncoder??=new TextEncoder;const utf8=textEncoder.encode(str);const view=new DataView(utf8.buffer,utf8.byteOffset,utf8.byteLength);let hi=hash32(view,utf8.length,0);let lo=hash32(view,utf8.length,102072);if(hi==0&&(lo==0||lo==1)){hi=hi^319790063;lo=lo^-1801410264}return BigInt.asUintN(32,BigInt(hi))<<BigInt(32)|BigInt.asUintN(32,BigInt(lo))}function computeMsgId(msg,meaning=""){let msgFingerprint=fingerprint(msg);if(meaning){msgFingerprint=BigInt.asUintN(64,msgFingerprint<<BigInt(1))|msgFingerprint>>BigInt(63)&BigInt(1);msgFingerprint+=fingerprint(meaning)}return BigInt.asUintN(63,msgFingerprint).toString()}function hash32(view,length,c){let a=2654435769,b=2654435769;let index=0;const end=length-12;for(;index<=end;index+=12){a+=view.getUint32(index,true);b+=view.getUint32(index+4,true);c+=view.getUint32(index+8,true);const res=mix(a,b,c);a=res[0],b=res[1],c=res[2]}const remainder=length-index;c+=length;if(remainder>=4){a+=view.getUint32(index,true);index+=4;if(remainder>=8){b+=view.getUint32(index,true);index+=4;if(remainder>=9){c+=view.getUint8(index++)<<8}if(remainder>=10){c+=view.getUint8(index++)<<16}if(remainder===11){c+=view.getUint8(index++)<<24}}else{if(remainder>=5){b+=view.getUint8(index++)}if(remainder>=6){b+=view.getUint8(index++)<<8}if(remainder===7){b+=view.getUint8(index++)<<16}}}else{if(remainder>=1){a+=view.getUint8(index++)}if(remainder>=2){a+=view.getUint8(index++)<<8}if(remainder===3){a+=view.getUint8(index++)<<16}}return mix(a,b,c)[2]}function mix(a,b,c){a-=b;a-=c;a^=c>>>13;b-=c;b-=a;b^=a<<8;c-=a;c-=b;c^=b>>>13;a-=b;a-=c;a^=c>>>12;b-=c;b-=a;b^=a<<16;c-=a;c-=b;c^=b>>>5;a-=b;a-=c;a^=c>>>3;b-=c;b-=a;b^=a<<10;c-=a;c-=b;c^=b>>>15;return[a,b,c]}var Endian;(function(Endian){Endian[Endian["Little"]=0]="Little";Endian[Endian["Big"]=1]="Big"})(Endian||(Endian={}));function add32(a,b){return add32to64(a,b)[1]}function add32to64(a,b){const low=(a&65535)+(b&65535);const high=(a>>>16)+(b>>>16)+(low>>>16);return[high>>>16,high<<16|low&65535]}function rol32(a,count){return a<<count|a>>>32-count}function bytesToWords32(bytes,endian){const size=bytes.length+3>>>2;const words32=[];for(let i=0;i<size;i++){words32[i]=wordAt(bytes,i*4,endian)}return words32}function byteAt(bytes,index){return index>=bytes.length?0:bytes[index]}function wordAt(bytes,index,endian){let word=0;if(endian===Endian.Big){for(let i=0;i<4;i++){word+=byteAt(bytes,index+i)<<24-8*i}}else{for(let i=0;i<4;i++){word+=byteAt(bytes,index+i)<<8*i}}return word}exports.TypeModifier=void 0;(function(TypeModifier){TypeModifier[TypeModifier["None"]=0]="None";TypeModifier[TypeModifier["Const"]=1]="Const"})(exports.TypeModifier||(exports.TypeModifier={}));class Type{constructor(modifiers=exports.TypeModifier.None){this.modifiers=modifiers}hasModifier(modifier){return(this.modifiers&modifier)!==0}}exports.BuiltinTypeName=void 0;(function(BuiltinTypeName){BuiltinTypeName[BuiltinTypeName["Dynamic"]=0]="Dynamic";BuiltinTypeName[BuiltinTypeName["Bool"]=1]="Bool";BuiltinTypeName[BuiltinTypeName["String"]=2]="String";BuiltinTypeName[BuiltinTypeName["Int"]=3]="Int";BuiltinTypeName[BuiltinTypeName["Number"]=4]="Number";BuiltinTypeName[BuiltinTypeName["Function"]=5]="Function";BuiltinTypeName[BuiltinTypeName["Inferred"]=6]="Inferred";BuiltinTypeName[BuiltinTypeName["None"]=7]="None"})(exports.BuiltinTypeName||(exports.BuiltinTypeName={}));class BuiltinType extends Type{constructor(name,modifiers){super(modifiers);this.name=name}visitType(visitor,context){return visitor.visitBuiltinType(this,context)}}class ExpressionType extends Type{constructor(value,modifiers,typeParams=null){super(modifiers);this.value=value;this.typeParams=typeParams}visitType(visitor,context){return visitor.visitExpressionType(this,context)}}class ArrayType extends Type{constructor(of,modifiers){super(modifiers);this.of=of}visitType(visitor,context){return visitor.visitArrayType(this,context)}}class MapType extends Type{constructor(valueType,modifiers){super(modifiers);this.valueType=valueType||null}visitType(visitor,context){return visitor.visitMapType(this,context)}}class TransplantedType extends Type{constructor(type,modifiers){super(modifiers);this.type=type}visitType(visitor,context){return visitor.visitTransplantedType(this,context)}}const DYNAMIC_TYPE=new BuiltinType(exports.BuiltinTypeName.Dynamic);const INFERRED_TYPE=new BuiltinType(exports.BuiltinTypeName.Inferred);const BOOL_TYPE=new BuiltinType(exports.BuiltinTypeName.Bool);const INT_TYPE=new BuiltinType(exports.BuiltinTypeName.Int);const NUMBER_TYPE=new BuiltinType(exports.BuiltinTypeName.Number);const STRING_TYPE=new BuiltinType(exports.BuiltinTypeName.String);const FUNCTION_TYPE=new BuiltinType(exports.BuiltinTypeName.Function);const NONE_TYPE=new BuiltinType(exports.BuiltinTypeName.None);exports.UnaryOperator=void 0;(function(UnaryOperator){UnaryOperator[UnaryOperator["Minus"]=0]="Minus";UnaryOperator[UnaryOperator["Plus"]=1]="Plus"})(exports.UnaryOperator||(exports.UnaryOperator={}));exports.BinaryOperator=void 0;(function(BinaryOperator){BinaryOperator[BinaryOperator["Equals"]=0]="Equals";BinaryOperator[BinaryOperator["NotEquals"]=1]="NotEquals";BinaryOperator[BinaryOperator["Identical"]=2]="Identical";BinaryOperator[BinaryOperator["NotIdentical"]=3]="NotIdentical";BinaryOperator[BinaryOperator["Minus"]=4]="Minus";BinaryOperator[BinaryOperator["Plus"]=5]="Plus";BinaryOperator[BinaryOperator["Divide"]=6]="Divide";BinaryOperator[BinaryOperator["Multiply"]=7]="Multiply";BinaryOperator[BinaryOperator["Modulo"]=8]="Modulo";BinaryOperator[BinaryOperator["And"]=9]="And";BinaryOperator[BinaryOperator["Or"]=10]="Or";BinaryOperator[BinaryOperator["BitwiseOr"]=11]="BitwiseOr";BinaryOperator[BinaryOperator["BitwiseAnd"]=12]="BitwiseAnd";BinaryOperator[BinaryOperator["Lower"]=13]="Lower";BinaryOperator[BinaryOperator["LowerEquals"]=14]="LowerEquals";BinaryOperator[BinaryOperator["Bigger"]=15]="Bigger";BinaryOperator[BinaryOperator["BiggerEquals"]=16]="BiggerEquals";BinaryOperator[BinaryOperator["NullishCoalesce"]=17]="NullishCoalesce"})(exports.BinaryOperator||(exports.BinaryOperator={}));function nullSafeIsEquivalent(base,other){if(base==null||other==null){return base==other}return base.isEquivalent(other)}function areAllEquivalentPredicate(base,other,equivalentPredicate){const len=base.length;if(len!==other.length){return false}for(let i=0;i<len;i++){if(!equivalentPredicate(base[i],other[i])){return false}}return true}function areAllEquivalent(base,other){return areAllEquivalentPredicate(base,other,((baseElement,otherElement)=>baseElement.isEquivalent(otherElement)))}class Expression{constructor(type,sourceSpan){this.type=type||null;this.sourceSpan=sourceSpan||null}prop(name,sourceSpan){return new ReadPropExpr(this,name,null,sourceSpan)}key(index,type,sourceSpan){return new ReadKeyExpr(this,index,type,sourceSpan)}callFn(params,sourceSpan,pure){return new InvokeFunctionExpr(this,params,null,sourceSpan,pure)}instantiate(params,type,sourceSpan){return new InstantiateExpr(this,params,type,sourceSpan)}conditional(trueCase,falseCase=null,sourceSpan){return new ConditionalExpr(this,trueCase,falseCase,null,sourceSpan)}equals(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.Equals,this,rhs,null,sourceSpan)}notEquals(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.NotEquals,this,rhs,null,sourceSpan)}identical(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.Identical,this,rhs,null,sourceSpan)}notIdentical(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.NotIdentical,this,rhs,null,sourceSpan)}minus(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.Minus,this,rhs,null,sourceSpan)}plus(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.Plus,this,rhs,null,sourceSpan)}divide(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.Divide,this,rhs,null,sourceSpan)}multiply(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.Multiply,this,rhs,null,sourceSpan)}modulo(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.Modulo,this,rhs,null,sourceSpan)}and(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.And,this,rhs,null,sourceSpan)}bitwiseOr(rhs,sourceSpan,parens=true){return new BinaryOperatorExpr(exports.BinaryOperator.BitwiseOr,this,rhs,null,sourceSpan,parens)}bitwiseAnd(rhs,sourceSpan,parens=true){return new BinaryOperatorExpr(exports.BinaryOperator.BitwiseAnd,this,rhs,null,sourceSpan,parens)}or(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.Or,this,rhs,null,sourceSpan)}lower(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.Lower,this,rhs,null,sourceSpan)}lowerEquals(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.LowerEquals,this,rhs,null,sourceSpan)}bigger(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.Bigger,this,rhs,null,sourceSpan)}biggerEquals(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.BiggerEquals,this,rhs,null,sourceSpan)}isBlank(sourceSpan){return this.equals(TYPED_NULL_EXPR,sourceSpan)}nullishCoalesce(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.NullishCoalesce,this,rhs,null,sourceSpan)}toStmt(){return new ExpressionStatement(this,null)}}class ReadVarExpr extends Expression{constructor(name,type,sourceSpan){super(type,sourceSpan);this.name=name}isEquivalent(e){return e instanceof ReadVarExpr&&this.name===e.name}isConstant(){return false}visitExpression(visitor,context){return visitor.visitReadVarExpr(this,context)}clone(){return new ReadVarExpr(this.name,this.type,this.sourceSpan)}set(value){return new WriteVarExpr(this.name,value,null,this.sourceSpan)}}class TypeofExpr extends Expression{constructor(expr,type,sourceSpan){super(type,sourceSpan);this.expr=expr}visitExpression(visitor,context){return visitor.visitTypeofExpr(this,context)}isEquivalent(e){return e instanceof TypeofExpr&&e.expr.isEquivalent(this.expr)}isConstant(){return this.expr.isConstant()}clone(){return new TypeofExpr(this.expr.clone())}}class WrappedNodeExpr extends Expression{constructor(node,type,sourceSpan){super(type,sourceSpan);this.node=node}isEquivalent(e){return e instanceof WrappedNodeExpr&&this.node===e.node}isConstant(){return false}visitExpression(visitor,context){return visitor.visitWrappedNodeExpr(this,context)}clone(){return new WrappedNodeExpr(this.node,this.type,this.sourceSpan)}}class WriteVarExpr extends Expression{constructor(name,value,type,sourceSpan){super(type||value.type,sourceSpan);this.name=name;this.value=value}isEquivalent(e){return e instanceof WriteVarExpr&&this.name===e.name&&this.value.isEquivalent(e.value)}isConstant(){return false}visitExpression(visitor,context){return visitor.visitWriteVarExpr(this,context)}clone(){return new WriteVarExpr(this.name,this.value.clone(),this.type,this.sourceSpan)}toDeclStmt(type,modifiers){return new DeclareVarStmt(this.name,this.value,type,modifiers,this.sourceSpan)}toConstDecl(){return this.toDeclStmt(INFERRED_TYPE,exports.StmtModifier.Final)}}class WriteKeyExpr extends Expression{constructor(receiver,index,value,type,sourceSpan){super(type||value.type,sourceSpan);this.receiver=receiver;this.index=index;this.value=value}isEquivalent(e){return e instanceof WriteKeyExpr&&this.receiver.isEquivalent(e.receiver)&&this.index.isEquivalent(e.index)&&this.value.isEquivalent(e.value)}isConstant(){return false}visitExpression(visitor,context){return visitor.visitWriteKeyExpr(this,context)}clone(){return new WriteKeyExpr(this.receiver.clone(),this.index.clone(),this.value.clone(),this.type,this.sourceSpan)}}class WritePropExpr extends Expression{constructor(receiver,name,value,type,sourceSpan){super(type||value.type,sourceSpan);this.receiver=receiver;this.name=name;this.value=value}isEquivalent(e){return e instanceof WritePropExpr&&this.receiver.isEquivalent(e.receiver)&&this.name===e.name&&this.value.isEquivalent(e.value)}isConstant(){return false}visitExpression(visitor,context){return visitor.visitWritePropExpr(this,context)}clone(){return new WritePropExpr(this.receiver.clone(),this.name,this.value.clone(),this.type,this.sourceSpan)}}class InvokeFunctionExpr extends Expression{constructor(fn,args,type,sourceSpan,pure=false){super(type,sourceSpan);this.fn=fn;this.args=args;this.pure=pure}get receiver(){return this.fn}isEquivalent(e){return e instanceof InvokeFunctionExpr&&this.fn.isEquivalent(e.fn)&&areAllEquivalent(this.args,e.args)&&this.pure===e.pure}isConstant(){return false}visitExpression(visitor,context){return visitor.visitInvokeFunctionExpr(this,context)}clone(){return new InvokeFunctionExpr(this.fn.clone(),this.args.map((arg=>arg.clone())),this.type,this.sourceSpan,this.pure)}}class TaggedTemplateExpr extends Expression{constructor(tag,template,type,sourceSpan){super(type,sourceSpan);this.tag=tag;this.template=template}isEquivalent(e){return e instanceof TaggedTemplateExpr&&this.tag.isEquivalent(e.tag)&&areAllEquivalentPredicate(this.template.elements,e.template.elements,((a,b)=>a.text===b.text))&&areAllEquivalent(this.template.expressions,e.template.expressions)}isConstant(){return false}visitExpression(visitor,context){return visitor.visitTaggedTemplateExpr(this,context)}clone(){return new TaggedTemplateExpr(this.tag.clone(),this.template.clone(),this.type,this.sourceSpan)}}class InstantiateExpr extends Expression{constructor(classExpr,args,type,sourceSpan){super(type,sourceSpan);this.classExpr=classExpr;this.args=args}isEquivalent(e){return e instanceof InstantiateExpr&&this.classExpr.isEquivalent(e.classExpr)&&areAllEquivalent(this.args,e.args)}isConstant(){return false}visitExpression(visitor,context){return visitor.visitInstantiateExpr(this,context)}clone(){return new InstantiateExpr(this.classExpr.clone(),this.args.map((arg=>arg.clone())),this.type,this.sourceSpan)}}class LiteralExpr extends Expression{constructor(value,type,sourceSpan){super(type,sourceSpan);this.value=value}isEquivalent(e){return e instanceof LiteralExpr&&this.value===e.value}isConstant(){return true}visitExpression(visitor,context){return visitor.visitLiteralExpr(this,context)}clone(){return new LiteralExpr(this.value,this.type,this.sourceSpan)}}class TemplateLiteral{constructor(elements,expressions){this.elements=elements;this.expressions=expressions}clone(){return new TemplateLiteral(this.elements.map((el=>el.clone())),this.expressions.map((expr=>expr.clone())))}}class TemplateLiteralElement{constructor(text,sourceSpan,rawText){this.text=text;this.sourceSpan=sourceSpan;this.rawText=rawText??sourceSpan?.toString()??escapeForTemplateLiteral(escapeSlashes(text))}clone(){return new TemplateLiteralElement(this.text,this.sourceSpan,this.rawText)}}class LiteralPiece{constructor(text,sourceSpan){this.text=text;this.sourceSpan=sourceSpan}}class PlaceholderPiece{constructor(text,sourceSpan,associatedMessage){this.text=text;this.sourceSpan=sourceSpan;this.associatedMessage=associatedMessage}}const MEANING_SEPARATOR$1="|";const ID_SEPARATOR$1="@@";const LEGACY_ID_INDICATOR="\u241f";class LocalizedString extends Expression{constructor(metaBlock,messageParts,placeHolderNames,expressions,sourceSpan){super(STRING_TYPE,sourceSpan);this.metaBlock=metaBlock;this.messageParts=messageParts;this.placeHolderNames=placeHolderNames;this.expressions=expressions}isEquivalent(e){return false}isConstant(){return false}visitExpression(visitor,context){return visitor.visitLocalizedString(this,context)}clone(){return new LocalizedString(this.metaBlock,this.messageParts,this.placeHolderNames,this.expressions.map((expr=>expr.clone())),this.sourceSpan)}serializeI18nHead(){let metaBlock=this.metaBlock.description||"";if(this.metaBlock.meaning){metaBlock=`${this.metaBlock.meaning}${MEANING_SEPARATOR$1}${metaBlock}`}if(this.metaBlock.customId){metaBlock=`${metaBlock}${ID_SEPARATOR$1}${this.metaBlock.customId}`}if(this.metaBlock.legacyIds){this.metaBlock.legacyIds.forEach((legacyId=>{metaBlock=`${metaBlock}${LEGACY_ID_INDICATOR}${legacyId}`}))}return createCookedRawString(metaBlock,this.messageParts[0].text,this.getMessagePartSourceSpan(0))}getMessagePartSourceSpan(i){return this.messageParts[i]?.sourceSpan??this.sourceSpan}getPlaceholderSourceSpan(i){return this.placeHolderNames[i]?.sourceSpan??this.expressions[i]?.sourceSpan??this.sourceSpan}serializeI18nTemplatePart(partIndex){const placeholder=this.placeHolderNames[partIndex-1];const messagePart=this.messageParts[partIndex];let metaBlock=placeholder.text;if(placeholder.associatedMessage?.legacyIds.length===0){metaBlock+=`${ID_SEPARATOR$1}${computeMsgId(placeholder.associatedMessage.messageString,placeholder.associatedMessage.meaning)}`}return createCookedRawString(metaBlock,messagePart.text,this.getMessagePartSourceSpan(partIndex))}}const escapeSlashes=str=>str.replace(/\\/g,"\\\\");const escapeStartingColon=str=>str.replace(/^:/,"\\:");const escapeColons=str=>str.replace(/:/g,"\\:");const escapeForTemplateLiteral=str=>str.replace(/`/g,"\\`").replace(/\${/g,"$\\{");function createCookedRawString(metaBlock,messagePart,range){if(metaBlock===""){return{cooked:messagePart,raw:escapeForTemplateLiteral(escapeStartingColon(escapeSlashes(messagePart))),range:range}}else{return{cooked:`:${metaBlock}:${messagePart}`,raw:escapeForTemplateLiteral(`:${escapeColons(escapeSlashes(metaBlock))}:${escapeSlashes(messagePart)}`),range:range}}}class ExternalExpr extends Expression{constructor(value,type,typeParams=null,sourceSpan){super(type,sourceSpan);this.value=value;this.typeParams=typeParams}isEquivalent(e){return e instanceof ExternalExpr&&this.value.name===e.value.name&&this.value.moduleName===e.value.moduleName&&this.value.runtime===e.value.runtime}isConstant(){return false}visitExpression(visitor,context){return visitor.visitExternalExpr(this,context)}clone(){return new ExternalExpr(this.value,this.type,this.typeParams,this.sourceSpan)}}class ExternalReference{constructor(moduleName,name,runtime){this.moduleName=moduleName;this.name=name;this.runtime=runtime}}class ConditionalExpr extends Expression{constructor(condition,trueCase,falseCase=null,type,sourceSpan){super(type||trueCase.type,sourceSpan);this.condition=condition;this.falseCase=falseCase;this.trueCase=trueCase}isEquivalent(e){return e instanceof ConditionalExpr&&this.condition.isEquivalent(e.condition)&&this.trueCase.isEquivalent(e.trueCase)&&nullSafeIsEquivalent(this.falseCase,e.falseCase)}isConstant(){return false}visitExpression(visitor,context){return visitor.visitConditionalExpr(this,context)}clone(){return new ConditionalExpr(this.condition.clone(),this.trueCase.clone(),this.falseCase?.clone(),this.type,this.sourceSpan)}}class DynamicImportExpr extends Expression{constructor(url,sourceSpan){super(null,sourceSpan);this.url=url}isEquivalent(e){return e instanceof DynamicImportExpr&&this.url===e.url}isConstant(){return false}visitExpression(visitor,context){return visitor.visitDynamicImportExpr(this,context)}clone(){return new DynamicImportExpr(this.url,this.sourceSpan)}}class NotExpr extends Expression{constructor(condition,sourceSpan){super(BOOL_TYPE,sourceSpan);this.condition=condition}isEquivalent(e){return e instanceof NotExpr&&this.condition.isEquivalent(e.condition)}isConstant(){return false}visitExpression(visitor,context){return visitor.visitNotExpr(this,context)}clone(){return new NotExpr(this.condition.clone(),this.sourceSpan)}}class FnParam{constructor(name,type=null){this.name=name;this.type=type}isEquivalent(param){return this.name===param.name}clone(){return new FnParam(this.name,this.type)}}class FunctionExpr extends Expression{constructor(params,statements,type,sourceSpan,name){super(type,sourceSpan);this.params=params;this.statements=statements;this.name=name}isEquivalent(e){return(e instanceof FunctionExpr||e instanceof DeclareFunctionStmt)&&areAllEquivalent(this.params,e.params)&&areAllEquivalent(this.statements,e.statements)}isConstant(){return false}visitExpression(visitor,context){return visitor.visitFunctionExpr(this,context)}toDeclStmt(name,modifiers){return new DeclareFunctionStmt(name,this.params,this.statements,this.type,modifiers,this.sourceSpan)}clone(){return new FunctionExpr(this.params.map((p=>p.clone())),this.statements,this.type,this.sourceSpan,this.name)}}class ArrowFunctionExpr extends Expression{constructor(params,body,type,sourceSpan){super(type,sourceSpan);this.params=params;this.body=body}isEquivalent(e){if(!(e instanceof ArrowFunctionExpr)||!areAllEquivalent(this.params,e.params)){return false}if(this.body instanceof Expression&&e.body instanceof Expression){return this.body.isEquivalent(e.body)}if(Array.isArray(this.body)&&Array.isArray(e.body)){return areAllEquivalent(this.body,e.body)}return false}isConstant(){return false}visitExpression(visitor,context){return visitor.visitArrowFunctionExpr(this,context)}clone(){return new ArrowFunctionExpr(this.params.map((p=>p.clone())),Array.isArray(this.body)?this.body:this.body.clone(),this.type,this.sourceSpan)}toDeclStmt(name,modifiers){return new DeclareVarStmt(name,this,INFERRED_TYPE,modifiers,this.sourceSpan)}}class UnaryOperatorExpr extends Expression{constructor(operator,expr,type,sourceSpan,parens=true){super(type||NUMBER_TYPE,sourceSpan);this.operator=operator;this.expr=expr;this.parens=parens}isEquivalent(e){return e instanceof UnaryOperatorExpr&&this.operator===e.operator&&this.expr.isEquivalent(e.expr)}isConstant(){return false}visitExpression(visitor,context){return visitor.visitUnaryOperatorExpr(this,context)}clone(){return new UnaryOperatorExpr(this.operator,this.expr.clone(),this.type,this.sourceSpan,this.parens)}}class BinaryOperatorExpr extends Expression{constructor(operator,lhs,rhs,type,sourceSpan,parens=true){super(type||lhs.type,sourceSpan);this.operator=operator;this.rhs=rhs;this.parens=parens;this.lhs=lhs}isEquivalent(e){return e instanceof BinaryOperatorExpr&&this.operator===e.operator&&this.lhs.isEquivalent(e.lhs)&&this.rhs.isEquivalent(e.rhs)}isConstant(){return false}visitExpression(visitor,context){return visitor.visitBinaryOperatorExpr(this,context)}clone(){return new BinaryOperatorExpr(this.operator,this.lhs.clone(),this.rhs.clone(),this.type,this.sourceSpan,this.parens)}}class ReadPropExpr extends Expression{constructor(receiver,name,type,sourceSpan){super(type,sourceSpan);this.receiver=receiver;this.name=name}get index(){return this.name}isEquivalent(e){return e instanceof ReadPropExpr&&this.receiver.isEquivalent(e.receiver)&&this.name===e.name}isConstant(){return false}visitExpression(visitor,context){return visitor.visitReadPropExpr(this,context)}set(value){return new WritePropExpr(this.receiver,this.name,value,null,this.sourceSpan)}clone(){return new ReadPropExpr(this.receiver.clone(),this.name,this.type,this.sourceSpan)}}class ReadKeyExpr extends Expression{constructor(receiver,index,type,sourceSpan){super(type,sourceSpan);this.receiver=receiver;this.index=index}isEquivalent(e){return e instanceof ReadKeyExpr&&this.receiver.isEquivalent(e.receiver)&&this.index.isEquivalent(e.index)}isConstant(){return false}visitExpression(visitor,context){return visitor.visitReadKeyExpr(this,context)}set(value){return new WriteKeyExpr(this.receiver,this.index,value,null,this.sourceSpan)}clone(){return new ReadKeyExpr(this.receiver.clone(),this.index.clone(),this.type,this.sourceSpan)}}class LiteralArrayExpr extends Expression{constructor(entries,type,sourceSpan){super(type,sourceSpan);this.entries=entries}isConstant(){return this.entries.every((e=>e.isConstant()))}isEquivalent(e){return e instanceof LiteralArrayExpr&&areAllEquivalent(this.entries,e.entries)}visitExpression(visitor,context){return visitor.visitLiteralArrayExpr(this,context)}clone(){return new LiteralArrayExpr(this.entries.map((e=>e.clone())),this.type,this.sourceSpan)}}class LiteralMapEntry{constructor(key,value,quoted){this.key=key;this.value=value;this.quoted=quoted}isEquivalent(e){return this.key===e.key&&this.value.isEquivalent(e.value)}clone(){return new LiteralMapEntry(this.key,this.value.clone(),this.quoted)}}class LiteralMapExpr extends Expression{constructor(entries,type,sourceSpan){super(type,sourceSpan);this.entries=entries;this.valueType=null;if(type){this.valueType=type.valueType}}isEquivalent(e){return e instanceof LiteralMapExpr&&areAllEquivalent(this.entries,e.entries)}isConstant(){return this.entries.every((e=>e.value.isConstant()))}visitExpression(visitor,context){return visitor.visitLiteralMapExpr(this,context)}clone(){const entriesClone=this.entries.map((entry=>entry.clone()));return new LiteralMapExpr(entriesClone,this.type,this.sourceSpan)}}class CommaExpr extends Expression{constructor(parts,sourceSpan){super(parts[parts.length-1].type,sourceSpan);this.parts=parts}isEquivalent(e){return e instanceof CommaExpr&&areAllEquivalent(this.parts,e.parts)}isConstant(){return false}visitExpression(visitor,context){return visitor.visitCommaExpr(this,context)}clone(){return new CommaExpr(this.parts.map((p=>p.clone())))}}const NULL_EXPR=new LiteralExpr(null,null,null);const TYPED_NULL_EXPR=new LiteralExpr(null,INFERRED_TYPE,null);exports.StmtModifier=void 0;(function(StmtModifier){StmtModifier[StmtModifier["None"]=0]="None";StmtModifier[StmtModifier["Final"]=1]="Final";StmtModifier[StmtModifier["Private"]=2]="Private";StmtModifier[StmtModifier["Exported"]=4]="Exported";StmtModifier[StmtModifier["Static"]=8]="Static"})(exports.StmtModifier||(exports.StmtModifier={}));class LeadingComment{constructor(text,multiline,trailingNewline){this.text=text;this.multiline=multiline;this.trailingNewline=trailingNewline}toString(){return this.multiline?` ${this.text} `:this.text}}class JSDocComment extends LeadingComment{constructor(tags){super("",true,true);this.tags=tags}toString(){return serializeTags(this.tags)}}class Statement{constructor(modifiers=exports.StmtModifier.None,sourceSpan=null,leadingComments){this.modifiers=modifiers;this.sourceSpan=sourceSpan;this.leadingComments=leadingComments}hasModifier(modifier){return(this.modifiers&modifier)!==0}addLeadingComment(leadingComment){this.leadingComments=this.leadingComments??[];this.leadingComments.push(leadingComment)}}class DeclareVarStmt extends Statement{constructor(name,value,type,modifiers,sourceSpan,leadingComments){super(modifiers,sourceSpan,leadingComments);this.name=name;this.value=value;this.type=type||value&&value.type||null}isEquivalent(stmt){return stmt instanceof DeclareVarStmt&&this.name===stmt.name&&(this.value?!!stmt.value&&this.value.isEquivalent(stmt.value):!stmt.value)}visitStatement(visitor,context){return visitor.visitDeclareVarStmt(this,context)}}class DeclareFunctionStmt extends Statement{constructor(name,params,statements,type,modifiers,sourceSpan,leadingComments){super(modifiers,sourceSpan,leadingComments);this.name=name;this.params=params;this.statements=statements;this.type=type||null}isEquivalent(stmt){return stmt instanceof DeclareFunctionStmt&&areAllEquivalent(this.params,stmt.params)&&areAllEquivalent(this.statements,stmt.statements)}visitStatement(visitor,context){return visitor.visitDeclareFunctionStmt(this,context)}}class ExpressionStatement extends Statement{constructor(expr,sourceSpan,leadingComments){super(exports.StmtModifier.None,sourceSpan,leadingComments);this.expr=expr}isEquivalent(stmt){return stmt instanceof ExpressionStatement&&this.expr.isEquivalent(stmt.expr)}visitStatement(visitor,context){return visitor.visitExpressionStmt(this,context)}}class ReturnStatement extends Statement{constructor(value,sourceSpan=null,leadingComments){super(exports.StmtModifier.None,sourceSpan,leadingComments);this.value=value}isEquivalent(stmt){return stmt instanceof ReturnStatement&&this.value.isEquivalent(stmt.value)}visitStatement(visitor,context){return visitor.visitReturnStmt(this,context)}}class IfStmt extends Statement{constructor(condition,trueCase,falseCase=[],sourceSpan,leadingComments){super(exports.StmtModifier.None,sourceSpan,leadingComments);this.condition=condition;this.trueCase=trueCase;this.falseCase=falseCase}isEquivalent(stmt){return stmt instanceof IfStmt&&this.condition.isEquivalent(stmt.condition)&&areAllEquivalent(this.trueCase,stmt.trueCase)&&areAllEquivalent(this.falseCase,stmt.falseCase)}visitStatement(visitor,context){return visitor.visitIfStmt(this,context)}}class RecursiveAstVisitor$1{visitType(ast,context){return ast}visitExpression(ast,context){if(ast.type){ast.type.visitType(this,context)}return ast}visitBuiltinType(type,context){return this.visitType(type,context)}visitExpressionType(type,context){type.value.visitExpression(this,context);if(type.typeParams!==null){type.typeParams.forEach((param=>this.visitType(param,context)))}return this.visitType(type,context)}visitArrayType(type,context){return this.visitType(type,context)}visitMapType(type,context){return this.visitType(type,context)}visitTransplantedType(type,context){return type}visitWrappedNodeExpr(ast,context){return ast}visitTypeofExpr(ast,context){return this.visitExpression(ast,context)}visitReadVarExpr(ast,context){return this.visitExpression(ast,context)}visitWriteVarExpr(ast,context){ast.value.visitExpression(this,context);return this.visitExpression(ast,context)}visitWriteKeyExpr(ast,context){ast.receiver.visitExpression(this,context);ast.index.visitExpression(this,context);ast.value.visitExpression(this,context);return this.visitExpression(ast,context)}visitWritePropExpr(ast,context){ast.receiver.visitExpression(this,context);ast.value.visitExpression(this,context);return this.visitExpression(ast,context)}visitDynamicImportExpr(ast,context){return this.visitExpression(ast,context)}visitInvokeFunctionExpr(ast,context){ast.fn.visitExpression(this,context);this.visitAllExpressions(ast.args,context);return this.visitExpression(ast,context)}visitTaggedTemplateExpr(ast,context){ast.tag.visitExpression(this,context);this.visitAllExpressions(ast.template.expressions,context);return this.visitExpression(ast,context)}visitInstantiateExpr(ast,context){ast.classExpr.visitExpression(this,context);this.visitAllExpressions(ast.args,context);return this.visitExpression(ast,context)}visitLiteralExpr(ast,context){return this.visitExpression(ast,context)}visitLocalizedString(ast,context){return this.visitExpression(ast,context)}visitExternalExpr(ast,context){if(ast.typeParams){ast.typeParams.forEach((type=>type.visitType(this,context)))}return this.visitExpression(ast,context)}visitConditionalExpr(ast,context){ast.condition.visitExpression(this,context);ast.trueCase.visitExpression(this,context);ast.falseCase.visitExpression(this,context);return this.visitExpression(ast,context)}visitNotExpr(ast,context){ast.condition.visitExpression(this,context);return this.visitExpression(ast,context)}visitFunctionExpr(ast,context){this.visitAllStatements(ast.statements,context);return this.visitExpression(ast,context)}visitArrowFunctionExpr(ast,context){if(Array.isArray(ast.body)){this.visitAllStatements(ast.body,context)}else{this.visitExpression(ast.body,context)}return this.visitExpression(ast,context)}visitUnaryOperatorExpr(ast,context){ast.expr.visitExpression(this,context);return this.visitExpression(ast,context)}visitBinaryOperatorExpr(ast,context){ast.lhs.visitExpression(this,context);ast.rhs.visitExpression(this,context);return this.visitExpression(ast,context)}visitReadPropExpr(ast,context){ast.receiver.visitExpression(this,context);return this.visitExpression(ast,context)}visitReadKeyExpr(ast,context){ast.receiver.visitExpression(this,context);ast.index.visitExpression(this,context);return this.visitExpression(ast,context)}visitLiteralArrayExpr(ast,context){this.visitAllExpressions(ast.entries,context);return this.visitExpression(ast,context)}visitLiteralMapExpr(ast,context){ast.entries.forEach((entry=>entry.value.visitExpression(this,context)));return this.visitExpression(ast,context)}visitCommaExpr(ast,context){this.visitAllExpressions(ast.parts,context);return this.visitExpression(ast,context)}visitAllExpressions(exprs,context){exprs.forEach((expr=>expr.visitExpression(this,context)))}visitDeclareVarStmt(stmt,context){if(stmt.value){stmt.value.visitExpression(this,context)}if(stmt.type){stmt.type.visitType(this,context)}return stmt}visitDeclareFunctionStmt(stmt,context){this.visitAllStatements(stmt.statements,context);if(stmt.type){stmt.type.visitType(this,context)}return stmt}visitExpressionStmt(stmt,context){stmt.expr.visitExpression(this,context);return stmt}visitReturnStmt(stmt,context){stmt.value.visitExpression(this,context);return stmt}visitIfStmt(stmt,context){stmt.condition.visitExpression(this,context);this.visitAllStatements(stmt.trueCase,context);this.visitAllStatements(stmt.falseCase,context);return stmt}visitAllStatements(stmts,context){stmts.forEach((stmt=>stmt.visitStatement(this,context)))}}function leadingComment(text,multiline=false,trailingNewline=true){return new LeadingComment(text,multiline,trailingNewline)}function jsDocComment(tags=[]){return new JSDocComment(tags)}function variable(name,type,sourceSpan){return new ReadVarExpr(name,type,sourceSpan)}function importExpr(id,typeParams=null,sourceSpan){return new ExternalExpr(id,null,typeParams,sourceSpan)}function importType(id,typeParams,typeModifiers){return id!=null?expressionType(importExpr(id,typeParams,null),typeModifiers):null}function expressionType(expr,typeModifiers,typeParams){return new ExpressionType(expr,typeModifiers,typeParams)}function transplantedType(type,typeModifiers){return new TransplantedType(type,typeModifiers)}function typeofExpr(expr){return new TypeofExpr(expr)}function literalArr(values,type,sourceSpan){return new LiteralArrayExpr(values,type,sourceSpan)}function literalMap(values,type=null){return new LiteralMapExpr(values.map((e=>new LiteralMapEntry(e.key,e.value,e.quoted))),type,null)}function unary(operator,expr,type,sourceSpan){return new UnaryOperatorExpr(operator,expr,type,sourceSpan)}function not(expr,sourceSpan){return new NotExpr(expr,sourceSpan)}function fn(params,body,type,sourceSpan,name){return new FunctionExpr(params,body,type,sourceSpan,name)}function arrowFn(params,body,type,sourceSpan){return new ArrowFunctionExpr(params,body,type,sourceSpan)}function ifStmt(condition,thenClause,elseClause,sourceSpan,leadingComments){return new IfStmt(condition,thenClause,elseClause,sourceSpan,leadingComments)}function taggedTemplate(tag,template,type,sourceSpan){return new TaggedTemplateExpr(tag,template,type,sourceSpan)}function literal(value,type,sourceSpan){return new LiteralExpr(value,type,sourceSpan)}function localizedString(metaBlock,messageParts,placeholderNames,expressions,sourceSpan){return new LocalizedString(metaBlock,messageParts,placeholderNames,expressions,sourceSpan)}function isNull(exp){return exp instanceof LiteralExpr&&exp.value===null}function tagToString(tag){let out="";if(tag.tagName){out+=` @${tag.tagName}`}if(tag.text){if(tag.text.match(/\/\*|\*\//)){throw new Error('JSDoc text cannot contain "/*" and "*/"')}out+=" "+tag.text.replace(/@/g,"\\@")}return out}function serializeTags(tags){if(tags.length===0)return"";if(tags.length===1&&tags[0].tagName&&!tags[0].text){return`*${tagToString(tags[0])} `}let out="*\n";for(const tag of tags){out+=" *";out+=tagToString(tag).replace(/\n/g,"\n * ");out+="\n"}out+=" ";return out}var output_ast=Object.freeze({__proto__:null,get TypeModifier(){return exports.TypeModifier},Type:Type,get BuiltinTypeName(){return exports.BuiltinTypeName},BuiltinType:BuiltinType,ExpressionType:ExpressionType,ArrayType:ArrayType,MapType:MapType,TransplantedType:TransplantedType,DYNAMIC_TYPE:DYNAMIC_TYPE,INFERRED_TYPE:INFERRED_TYPE,BOOL_TYPE:BOOL_TYPE,INT_TYPE:INT_TYPE,NUMBER_TYPE:NUMBER_TYPE,STRING_TYPE:STRING_TYPE,FUNCTION_TYPE:FUNCTION_TYPE,NONE_TYPE:NONE_TYPE,get UnaryOperator(){return exports.UnaryOperator},get BinaryOperator(){return exports.BinaryOperator},nullSafeIsEquivalent:nullSafeIsEquivalent,areAllEquivalent:areAllEquivalent,Expression:Expression,ReadVarExpr:ReadVarExpr,TypeofExpr:TypeofExpr,WrappedNodeExpr:WrappedNodeExpr,WriteVarExpr:WriteVarExpr,WriteKeyExpr:WriteKeyExpr,WritePropExpr:WritePropExpr,InvokeFunctionExpr:InvokeFunctionExpr,TaggedTemplateExpr:TaggedTemplateExpr,InstantiateExpr:InstantiateExpr,LiteralExpr:LiteralExpr,TemplateLiteral:TemplateLiteral,TemplateLiteralElement:TemplateLiteralElement,LiteralPiece:LiteralPiece,PlaceholderPiece:PlaceholderPiece,LocalizedString:LocalizedString,ExternalExpr:ExternalExpr,ExternalReference:ExternalReference,ConditionalExpr:ConditionalExpr,DynamicImportExpr:DynamicImportExpr,NotExpr:NotExpr,FnParam:FnParam,FunctionExpr:FunctionExpr,ArrowFunctionExpr:ArrowFunctionExpr,UnaryOperatorExpr:UnaryOperatorExpr,BinaryOperatorExpr:BinaryOperatorExpr,ReadPropExpr:ReadPropExpr,ReadKeyExpr:ReadKeyExpr,LiteralArrayExpr:LiteralArrayExpr,LiteralMapEntry:LiteralMapEntry,LiteralMapExpr:LiteralMapExpr,CommaExpr:CommaExpr,NULL_EXPR:NULL_EXPR,TYPED_NULL_EXPR:TYPED_NULL_EXPR,get StmtModifier(){return exports.StmtModifier},LeadingComment:LeadingComment,JSDocComment:JSDocComment,Statement:Statement,DeclareVarStmt:DeclareVarStmt,DeclareFunctionStmt:DeclareFunctionStmt,ExpressionStatement:ExpressionStatement,ReturnStatement:ReturnStatement,IfStmt:IfStmt,RecursiveAstVisitor:RecursiveAstVisitor$1,leadingComment:leadingComment,jsDocComment:jsDocComment,variable:variable,importExpr:importExpr,importType:importType,expressionType:expressionType,transplantedType:transplantedType,typeofExpr:typeofExpr,literalArr:literalArr,literalMap:literalMap,unary:unary,not:not,fn:fn,arrowFn:arrowFn,ifStmt:ifStmt,taggedTemplate:taggedTemplate,literal:literal,localizedString:localizedString,isNull:isNull});const CONSTANT_PREFIX="_c";const UNKNOWN_VALUE_KEY=variable("<unknown>");const KEY_CONTEXT={};const POOL_INCLUSION_LENGTH_THRESHOLD_FOR_STRINGS=50;class FixupExpression extends Expression{constructor(resolved){super(resolved.type);this.resolved=resolved;this.shared=false;this.original=resolved}visitExpression(visitor,context){if(context===KEY_CONTEXT){return this.original.visitExpression(visitor,context)}else{return this.resolved.visitExpression(visitor,context)}}isEquivalent(e){return e instanceof FixupExpression&&this.resolved.isEquivalent(e.resolved)}isConstant(){return true}clone(){throw new Error(`Not supported.`)}fixup(expression){this.resolved=expression;this.shared=true}}class ConstantPool{constructor(isClosureCompilerEnabled=false){this.isClosureCompilerEnabled=isClosureCompilerEnabled;this.statements=[];this.literals=new Map;this.literalFactories=new Map;this.sharedConstants=new Map;this._claimedNames=new Map;this.nextNameIndex=0}getConstLiteral(literal,forceShared){if(literal instanceof LiteralExpr&&!isLongStringLiteral(literal)||literal instanceof FixupExpression){return literal}const key=GenericKeyFn.INSTANCE.keyOf(literal);let fixup=this.literals.get(key);let newValue=false;if(!fixup){fixup=new FixupExpression(literal);this.literals.set(key,fixup);newValue=true}if(!newValue&&!fixup.shared||newValue&&forceShared){const name=this.freshName();let definition;let usage;if(this.isClosureCompilerEnabled&&isLongStringLiteral(literal)){definition=variable(name).set(new FunctionExpr([],[new ReturnStatement(literal)]));usage=variable(name).callFn([])}else{definition=variable(name).set(literal);usage=variable(name)}this.statements.push(definition.toDeclStmt(INFERRED_TYPE,exports.StmtModifier.Final));fixup.fixup(usage)}return fixup}getSharedConstant(def,expr){const key=def.keyOf(expr);if(!this.sharedConstants.has(key)){const id=this.freshName();this.sharedConstants.set(key,variable(id));this.statements.push(def.toSharedConstantDeclaration(id,expr))}return this.sharedConstants.get(key)}getLiteralFactory(literal){if(literal instanceof LiteralArrayExpr){const argumentsForKey=literal.entries.map((e=>e.isConstant()?e:UNKNOWN_VALUE_KEY));const key=GenericKeyFn.INSTANCE.keyOf(literalArr(argumentsForKey));return this._getLiteralFactory(key,literal.entries,(entries=>literalArr(entries)))}else{const expressionForKey=literalMap(literal.entries.map((e=>({key:e.key,value:e.value.isConstant()?e.value:UNKNOWN_VALUE_KEY,quoted:e.quoted}))));const key=GenericKeyFn.INSTANCE.keyOf(expressionForKey);return this._getLiteralFactory(key,literal.entries.map((e=>e.value)),(entries=>literalMap(entries.map(((value,index)=>({key:literal.entries[index].key,value:value,quoted:literal.entries[index].quoted}))))))}}getSharedFunctionReference(fn,prefix,useUniqueName=true){const isArrow=fn instanceof ArrowFunctionExpr;for(const current of this.statements){if(isArrow&¤t instanceof DeclareVarStmt&¤t.value?.isEquivalent(fn)){return variable(current.name)}if(!isArrow&¤t instanceof DeclareFunctionStmt&&fn.isEquivalent(current)){return variable(current.name)}}const name=useUniqueName?this.uniqueName(prefix):prefix;this.statements.push(fn.toDeclStmt(name,exports.StmtModifier.Final));return variable(name)}_getLiteralFactory(key,values,resultMap){let literalFactory=this.literalFactories.get(key);const literalFactoryArguments=values.filter((e=>!e.isConstant()));if(!literalFactory){const resultExpressions=values.map(((e,index)=>e.isConstant()?this.getConstLiteral(e,true):variable(`a${index}`)));const parameters=resultExpressions.filter(isVariable).map((e=>new FnParam(e.name,DYNAMIC_TYPE)));const pureFunctionDeclaration=arrowFn(parameters,resultMap(resultExpressions),INFERRED_TYPE);const name=this.freshName();this.statements.push(variable(name).set(pureFunctionDeclaration).toDeclStmt(INFERRED_TYPE,exports.StmtModifier.Final));literalFactory=variable(name);this.literalFactories.set(key,literalFactory)}return{literalFactory:literalFactory,literalFactoryArguments:literalFactoryArguments}}uniqueName(name,alwaysIncludeSuffix=true){const count=this._claimedNames.get(name)??0;const result=count===0&&!alwaysIncludeSuffix?`${name}`:`${name}${count}`;this._claimedNames.set(name,count+1);return result}freshName(){return this.uniqueName(CONSTANT_PREFIX)}}class GenericKeyFn{static{this.INSTANCE=new GenericKeyFn}keyOf(expr){if(expr instanceof LiteralExpr&&typeof expr.value==="string"){return`"${expr.value}"`}else if(expr instanceof LiteralExpr){return String(expr.value)}else if(expr instanceof LiteralArrayExpr){const entries=[];for(const entry of expr.entries){entries.push(this.keyOf(entry))}return`[${entries.join(",")}]`}else if(expr instanceof LiteralMapExpr){const entries=[];for(const entry of expr.entries){let key=entry.key;if(entry.quoted){key=`"${key}"`}entries.push(key+":"+this.keyOf(entry.value))}return`{${entries.join(",")}}`}else if(expr instanceof ExternalExpr){return`import("${expr.value.moduleName}", ${expr.value.name})`}else if(expr instanceof ReadVarExpr){return`read(${expr.name})`}else if(expr instanceof TypeofExpr){return`typeof(${this.keyOf(expr.expr)})`}else{throw new Error(`${this.constructor.name} does not handle expressions of type ${expr.constructor.name}`)}}}function isVariable(e){return e instanceof ReadVarExpr}function isLongStringLiteral(expr){return expr instanceof LiteralExpr&&typeof expr.value==="string"&&expr.value.length>=POOL_INCLUSION_LENGTH_THRESHOLD_FOR_STRINGS}const CORE="@angular/core";class Identifiers{static{this.NEW_METHOD="factory"}static{this.TRANSFORM_METHOD="transform"}static{this.PATCH_DEPS="patchedDeps"}static{this.core={name:null,moduleName:CORE}}static{this.namespaceHTML={name:"\u0275\u0275namespaceHTML",moduleName:CORE}}static{this.namespaceMathML={name:"\u0275\u0275namespaceMathML",moduleName:CORE}}static{this.namespaceSVG={name:"\u0275\u0275namespaceSVG",moduleName:CORE}}static{this.element={name:"\u0275\u0275element",moduleName:CORE}}static{this.elementStart={name:"\u0275\u0275elementStart",moduleName:CORE}}static{this.elementEnd={name:"\u0275\u0275elementEnd",moduleName:CORE}}static{this.advance={name:"\u0275\u0275advance",moduleName:CORE}}static{this.syntheticHostProperty={name:"\u0275\u0275syntheticHostProperty",moduleName:CORE}}static{this.syntheticHostListener={name:"\u0275\u0275syntheticHostListener",moduleName:CORE}}static{this.attribute={name:"\u0275\u0275attribute",moduleName:CORE}}static{this.attributeInterpolate1={name:"\u0275\u0275attributeInterpolate1",moduleName:CORE}}static{this.attributeInterpolate2={name:"\u0275\u0275attributeInterpolate2",moduleName:CORE}}static{this.attributeInterpolate3={name:"\u0275\u0275attributeInterpolate3",moduleName:CORE}}static{this.attributeInterpolate4={name:"\u0275\u0275attributeInterpolate4",moduleName:CORE}}static{this.attributeInterpolate5={name:"\u0275\u0275attributeInterpolate5",moduleName:CORE}}static{this.attributeInterpolate6={name:"\u0275\u0275attributeInterpolate6",moduleName:CORE}}static{this.attributeInterpolate7={name:"\u0275\u0275attributeInterpolate7",moduleName:CORE}}static{this.attributeInterpolate8={name:"\u0275\u0275attributeInterpolate8",moduleName:CORE}}static{this.attributeInterpolateV={name:"\u0275\u0275attributeInterpolateV",moduleName:CORE}}static{this.classProp={name:"\u0275\u0275classProp",moduleName:CORE}}static{this.elementContainerStart={name:"\u0275\u0275elementContainerStart",moduleName:CORE}}static{this.elementContainerEnd={name:"\u0275\u0275elementContainerEnd",moduleName:CORE}}static{this.elementContainer={name:"\u0275\u0275elementContainer",moduleName:CORE}}static{this.styleMap={name:"\u0275\u0275styleMap",moduleName:CORE}}static{this.styleMapInterpolate1={name:"\u0275\u0275styleMapInterpolate1",moduleName:CORE}}static{this.styleMapInterpolate2={name:"\u0275\u0275styleMapInterpolate2",moduleName:CORE}}static{this.styleMapInterpolate3={name:"\u0275\u0275styleMapInterpolate3",moduleName:CORE}}static{this.styleMapInterpolate4={name:"\u0275\u0275styleMapInterpolate4",moduleName:CORE}}static{this.styleMapInterpolate5={name:"\u0275\u0275styleMapInterpolate5",moduleName:CORE}}static{this.styleMapInterpolate6={name:"\u0275\u0275styleMapInterpolate6",moduleName:CORE}}static{this.styleMapInterpolate7={name:"\u0275\u0275styleMapInterpolate7",moduleName:CORE}}static{this.styleMapInterpolate8={name:"\u0275\u0275styleMapInterpolate8",moduleName:CORE}}static{this.styleMapInterpolateV={name:"\u0275\u0275styleMapInterpolateV",moduleName:CORE}}static{this.classMap={name:"\u0275\u0275classMap",moduleName:CORE}}static{this.classMapInterpolate1={name:"\u0275\u0275classMapInterpolate1",moduleName:CORE}}static{this.classMapInterpolate2={name:"\u0275\u0275classMapInterpolate2",moduleName:CORE}}static{this.classMapInterpolate3={name:"\u0275\u0275classMapInterpolate3",moduleName:CORE}}static{this.classMapInterpolate4={name:"\u0275\u0275classMapInterpolate4",moduleName:CORE}}static{this.classMapInterpolate5={name:"\u0275\u0275classMapInterpolate5",moduleName:CORE}}static{this.classMapInterpolate6={name:"\u0275\u0275classMapInterpolate6",moduleName:CORE}}static{this.classMapInterpolate7={name:"\u0275\u0275classMapInterpolate7",moduleName:CORE}}static{this.classMapInterpolate8={name:"\u0275\u0275classMapInterpolate8",moduleName:CORE}}static{this.classMapInterpolateV={name:"\u0275\u0275classMapInterpolateV",moduleName:CORE}}static{this.styleProp={name:"\u0275\u0275styleProp",moduleName:CORE}}static{this.stylePropInterpolate1={name:"\u0275\u0275stylePropInterpolate1",moduleName:CORE}}static{this.stylePropInterpolate2={name:"\u0275\u0275stylePropInterpolate2",moduleName:CORE}}static{this.stylePropInterpolate3={name:"\u0275\u0275stylePropInterpolate3",moduleName:CORE}}static{this.stylePropInterpolate4={name:"\u0275\u0275stylePropInterpolate4",moduleName:CORE}}static{this.stylePropInterpolate5={name:"\u0275\u0275stylePropInterpolate5",moduleName:CORE}}static{this.stylePropInterpolate6={name:"\u0275\u0275stylePropInterpolate6",moduleName:CORE}}static{this.stylePropInterpolate7={name:"\u0275\u0275stylePropInterpolate7",moduleName:CORE}}static{this.stylePropInterpolate8={name:"\u0275\u0275stylePropInterpolate8",moduleName:CORE}}static{this.stylePropInterpolateV={name:"\u0275\u0275stylePropInterpolateV",moduleName:CORE}}static{this.nextContext={name:"\u0275\u0275nextContext",moduleName:CORE}}static{this.resetView={name:"\u0275\u0275resetView",moduleName:CORE}}static{this.templateCreate={name:"\u0275\u0275template",moduleName:CORE}}static{this.defer={name:"\u0275\u0275defer",moduleName:CORE}}static{this.deferWhen={name:"\u0275\u0275deferWhen",moduleName:CORE}}static{this.deferOnIdle={name:"\u0275\u0275deferOnIdle",moduleName:CORE}}static{this.deferOnImmediate={name:"\u0275\u0275deferOnImmediate",moduleName:CORE}}static{this.deferOnTimer={name:"\u0275\u0275deferOnTimer",moduleName:CORE}}static{this.deferOnHover={name:"\u0275\u0275deferOnHover",moduleName:CORE}}static{this.deferOnInteraction={name:"\u0275\u0275deferOnInteraction",moduleName:CORE}}static{this.deferOnViewport={name:"\u0275\u0275deferOnViewport",moduleName:CORE}}static{this.deferPrefetchWhen={name:"\u0275\u0275deferPrefetchWhen",moduleName:CORE}}static{this.deferPrefetchOnIdle={name:"\u0275\u0275deferPrefetchOnIdle",moduleName:CORE}}static{this.deferPrefetchOnImmediate={name:"\u0275\u0275deferPrefetchOnImmediate",moduleName:CORE}}static{this.deferPrefetchOnTimer={name:"\u0275\u0275deferPrefetchOnTimer",moduleName:CORE}}static{this.deferPrefetchOnHover={name:"\u0275\u0275deferPrefetchOnHover",moduleName:CORE}}static{this.deferPrefetchOnInteraction={name:"\u0275\u0275deferPrefetchOnInteraction",moduleName:CORE}}static{this.deferPrefetchOnViewport={name:"\u0275\u0275deferPrefetchOnViewport",moduleName:CORE}}static{this.deferEnableTimerScheduling={name:"\u0275\u0275deferEnableTimerScheduling",moduleName:CORE}}static{this.conditional={name:"\u0275\u0275conditional",moduleName:CORE}}static{this.repeater={name:"\u0275\u0275repeater",moduleName:CORE}}static{this.repeaterCreate={name:"\u0275\u0275repeaterCreate",moduleName:CORE}}static{this.repeaterTrackByIndex={name:"\u0275\u0275repeaterTrackByIndex",moduleName:CORE}}static{this.repeaterTrackByIdentity={name:"\u0275\u0275repeaterTrackByIdentity",moduleName:CORE}}static{this.componentInstance={name:"\u0275\u0275componentInstance",moduleName:CORE}}static{this.text={name:"\u0275\u0275text",moduleName:CORE}}static{this.enableBindings={name:"\u0275\u0275enableBindings",moduleName:CORE}}static{this.disableBindings={name:"\u0275\u0275disableBindings",moduleName:CORE}}static{this.getCurrentView={name:"\u0275\u0275getCurrentView",moduleName:CORE}}static{this.textInterpolate={name:"\u0275\u0275textInterpolate",moduleName:CORE}}static{this.textInterpolate1={name:"\u0275\u0275textInterpolate1",moduleName:CORE}}static{this.textInterpolate2={name:"\u0275\u0275textInterpolate2",moduleName:CORE}}static{this.textInterpolate3={name:"\u0275\u0275textInterpolate3",moduleName:CORE}}static{this.textInterpolate4={name:"\u0275\u0275textInterpolate4",moduleName:CORE}}static{this.textInterpolate5={name:"\u0275\u0275textInterpolate5",moduleName:CORE}}static{this.textInterpolate6={name:"\u0275\u0275textInterpolate6",moduleName:CORE}}static{this.textInterpolate7={name:"\u0275\u0275textInterpolate7",moduleName:CORE}}static{this.textInterpolate8={name:"\u0275\u0275textInterpolate8",moduleName:CORE}}static{this.textInterpolateV={name:"\u0275\u0275textInterpolateV",moduleName:CORE}}static{this.restoreView={name:"\u0275\u0275restoreView",moduleName:CORE}}static{this.pureFunction0={name:"\u0275\u0275pureFunction0",moduleName:CORE}}static{this.pureFunction1={name:"\u0275\u0275pureFunction1",moduleName:CORE}}static{this.pureFunction2={name:"\u0275\u0275pureFunction2",moduleName:CORE}}static{this.pureFunction3={name:"\u0275\u0275pureFunction3",moduleName:CORE}}static{this.pureFunction4={name:"\u0275\u0275pureFunction4",moduleName:CORE}}static{this.pureFunction5={name:"\u0275\u0275pureFunction5",moduleName:CORE}}static{this.pureFunction6={name:"\u0275\u0275pureFunction6",moduleName:CORE}}static{this.pureFunction7={name:"\u0275\u0275pureFunction7",moduleName:CORE}}static{this.pureFunction8={name:"\u0275\u0275pureFunction8",moduleName:CORE}}static{this.pureFunctionV={name:"\u0275\u0275pureFunctionV",moduleName:CORE}}static{this.pipeBind1={name:"\u0275\u0275pipeBind1",moduleName:CORE}}static{this.pipeBind2={name:"\u0275\u0275pipeBind2",moduleName:CORE}}static{this.pipeBind3={name:"\u0275\u0275pipeBind3",moduleName:CORE}}static{this.pipeBind4={name:"\u0275\u0275pipeBind4",moduleName:CORE}}static{this.pipeBindV={name:"\u0275\u0275pipeBindV",moduleName:CORE}}static{this.hostProperty={name:"\u0275\u0275hostProperty",moduleName:CORE}}static{this.property={name:"\u0275\u0275property",moduleName:CORE}}static{this.propertyInterpolate={name:"\u0275\u0275propertyInterpolate",moduleName:CORE}}static{this.propertyInterpolate1={name:"\u0275\u0275propertyInterpolate1",moduleName:CORE}}static{this.propertyInterpolate2={name:"\u0275\u0275propertyInterpolate2",moduleName:CORE}}static{this.propertyInterpolate3={name:"\u0275\u0275propertyInterpolate3",moduleName:CORE}}static{this.propertyInterpolate4={name:"\u0275\u0275propertyInterpolate4",moduleName:CORE}}static{this.propertyInterpolate5={name:"\u0275\u0275propertyInterpolate5",moduleName:CORE}}static{this.propertyInterpolate6={name:"\u0275\u0275propertyInterpolate6",moduleName:CORE}}static{this.propertyInterpolate7={name:"\u0275\u0275propertyInterpolate7",moduleName:CORE}}static{this.propertyInterpolate8={name:"\u0275\u0275propertyInterpolate8",moduleName:CORE}}static{this.propertyInterpolateV={name:"\u0275\u0275propertyInterpolateV",moduleName:CORE}}static{this.i18n={name:"\u0275\u0275i18n",moduleName:CORE}}static{this.i18nAttributes={name:"\u0275\u0275i18nAttributes",moduleName:CORE}}static{this.i18nExp={name:"\u0275\u0275i18nExp",moduleName:CORE}}static{this.i18nStart={name:"\u0275\u0275i18nStart",moduleName:CORE}}static{this.i18nEnd={name:"\u0275\u0275i18nEnd",moduleName:CORE}}static{this.i18nApply={name:"\u0275\u0275i18nApply",moduleName:CORE}}static{this.i18nPostprocess={name:"\u0275\u0275i18nPostprocess",moduleName:CORE}}static{this.pipe={name:"\u0275\u0275pipe",moduleName:CORE}}static{this.projection={name:"\u0275\u0275projection",moduleName:CORE}}static{this.projectionDef={name:"\u0275\u0275projectionDef",moduleName:CORE}}static{this.reference={name:"\u0275\u0275reference",moduleName:CORE}}static{this.inject={name:"\u0275\u0275inject",moduleName:CORE}}static{this.injectAttribute={name:"\u0275\u0275injectAttribute",moduleName:CORE}}static{this.directiveInject={name:"\u0275\u0275directiveInject",moduleName:CORE}}static{this.invalidFactory={name:"\u0275\u0275invalidFactory",moduleName:CORE}}static{this.invalidFactoryDep={name:"\u0275\u0275invalidFactoryDep",moduleName:CORE}}static{this.templateRefExtractor={name:"\u0275\u0275templateRefExtractor",moduleName:CORE}}static{this.forwardRef={name:"forwardRef",moduleName:CORE}}static{this.resolveForwardRef={name:"resolveForwardRef",moduleName:CORE}}static{this.\u0275\u0275defineInjectable={name:"\u0275\u0275defineInjectable",moduleName:CORE}}static{this.declareInjectable={name:"\u0275\u0275ngDeclareInjectable",moduleName:CORE}}static{this.InjectableDeclaration={name:"\u0275\u0275InjectableDeclaration",moduleName:CORE}}static{this.resolveWindow={name:"\u0275\u0275resolveWindow",moduleName:CORE}}static{this.resolveDocument={name:"\u0275\u0275resolveDocument",moduleName:CORE}}static{this.resolveBody={name:"\u0275\u0275resolveBody",moduleName:CORE}}static{this.getComponentDepsFactory={name:"\u0275\u0275getComponentDepsFactory",moduleName:CORE}}static{this.defineComponent={name:"\u0275\u0275defineComponent",moduleName:CORE}}static{this.declareComponent={name:"\u0275\u0275ngDeclareComponent",moduleName:CORE}}static{this.setComponentScope={name:"\u0275\u0275setComponentScope",moduleName:CORE}}static{this.ChangeDetectionStrategy={name:"ChangeDetectionStrategy",moduleName:CORE}}static{this.ViewEncapsulation={name:"ViewEncapsulation",moduleName:CORE}}static{this.ComponentDeclaration={name:"\u0275\u0275ComponentDeclaration",moduleName:CORE}}static{this.FactoryDeclaration={name:"\u0275\u0275FactoryDeclaration",moduleName:CORE}}static{this.declareFactory={name:"\u0275\u0275ngDeclareFactory",moduleName:CORE}}static{this.FactoryTarget={name:"\u0275\u0275FactoryTarget",moduleName:CORE}}static{this.defineDirective={name:"\u0275\u0275defineDirective",moduleName:CORE}}static{this.declareDirective={name:"\u0275\u0275ngDeclareDirective",moduleName:CORE}}static{this.DirectiveDeclaration={name:"\u0275\u0275DirectiveDeclaration",moduleName:CORE}}static{this.InjectorDef={name:"\u0275\u0275InjectorDef",moduleName:CORE}}static{this.InjectorDeclaration={name:"\u0275\u0275InjectorDeclaration",moduleName:CORE}}static{this.defineInjector={name:"\u0275\u0275defineInjector",moduleName:CORE}}static{this.declareInjector={name:"\u0275\u0275ngDeclareInjector",moduleName:CORE}}static{this.NgModuleDeclaration={name:"\u0275\u0275NgModuleDeclaration",moduleName:CORE}}static{this.ModuleWithProviders={name:"ModuleWithProviders",moduleName:CORE}}static{this.defineNgModule={name:"\u0275\u0275defineNgModule",moduleName:CORE}}static{this.declareNgModule={name:"\u0275\u0275ngDeclareNgModule",moduleName:CORE}}static{this.setNgModuleScope={name:"\u0275\u0275setNgModuleScope",moduleName:CORE}}static{this.registerNgModuleType={name:"\u0275\u0275registerNgModuleType",moduleName:CORE}}static{this.PipeDeclaration={name:"\u0275\u0275PipeDeclaration",moduleName:CORE}}static{this.definePipe={name:"\u0275\u0275definePipe",moduleName:CORE}}static{this.declarePipe={name:"\u0275\u0275ngDeclarePipe",moduleName:CORE}}static{this.declareClassMetadata={name:"\u0275\u0275ngDeclareClassMetadata",moduleName:CORE}}static{this.setClassMetadata={name:"\u0275setClassMetadata",moduleName:CORE}}static{this.setClassMetadataAsync={name:"\u0275setClassMetadataAsync",moduleName:CORE}}static{this.setClassDebugInfo={name:"\u0275setClassDebugInfo",moduleName:CORE}}static{this.queryRefresh={name:"\u0275\u0275queryRefresh",moduleName:CORE}}static{this.viewQuery={name:"\u0275\u0275viewQuery",moduleName:CORE}}static{this.loadQuery={name:"\u0275\u0275loadQuery",moduleName:CORE}}static{this.contentQuery={name:"\u0275\u0275contentQuery",moduleName:CORE}}static{this.viewQuerySignal={name:"\u0275\u0275viewQuerySignal",moduleName:CORE}}static{this.contentQuerySignal={name:"\u0275\u0275contentQuerySignal",moduleName:CORE}}static{this.queryAdvance={name:"\u0275\u0275queryAdvance",moduleName:CORE}}static{this.twoWayProperty={name:"\u0275\u0275twoWayProperty",moduleName:CORE}}static{this.twoWayBindingSet={name:"\u0275\u0275twoWayBindingSet",moduleName:CORE}}static{this.twoWayListener={name:"\u0275\u0275twoWayListener",moduleName:CORE}}static{this.NgOnChangesFeature={name:"\u0275\u0275NgOnChangesFeature",moduleName:CORE}}static{this.InheritDefinitionFeature={name:"\u0275\u0275InheritDefinitionFeature",moduleName:CORE}}static{this.CopyDefinitionFeature={name:"\u0275\u0275CopyDefinitionFeature",moduleName:CORE}}static{this.StandaloneFeature={name:"\u0275\u0275StandaloneFeature",moduleName:CORE}}static{this.ProvidersFeature={name:"\u0275\u0275ProvidersFeature",moduleName:CORE}}static{this.HostDirectivesFeature={name:"\u0275\u0275HostDirectivesFeature",moduleName:CORE}}static{this.InputTransformsFeatureFeature={name:"\u0275\u0275InputTransformsFeature",moduleName:CORE}}static{this.listener={name:"\u0275\u0275listener",moduleName:CORE}}static{this.getInheritedFactory={name:"\u0275\u0275getInheritedFactory",moduleName:CORE}}static{this.InputFlags={name:"\u0275\u0275InputFlags",moduleName:CORE}}static{this.sanitizeHtml={name:"\u0275\u0275sanitizeHtml",moduleName:CORE}}static{this.sanitizeStyle={name:"\u0275\u0275sanitizeStyle",moduleName:CORE}}static{this.sanitizeResourceUrl={name:"\u0275\u0275sanitizeResourceUrl",moduleName:CORE}}static{this.sanitizeScript={name:"\u0275\u0275sanitizeScript",moduleName:CORE}}static{this.sanitizeUrl={name:"\u0275\u0275sanitizeUrl",moduleName:CORE}}static{this.sanitizeUrlOrResourceUrl={name:"\u0275\u0275sanitizeUrlOrResourceUrl",moduleName:CORE}}static{this.trustConstantHtml={name:"\u0275\u0275trustConstantHtml",moduleName:CORE}}static{this.trustConstantResourceUrl={name:"\u0275\u0275trustConstantResourceUrl",moduleName:CORE}}static{this.validateIframeAttribute={name:"\u0275\u0275validateIframeAttribute",moduleName:CORE}}static{this.InputSignalBrandWriteType={name:"\u0275INPUT_SIGNAL_BRAND_WRITE_TYPE",moduleName:CORE}}static{this.UnwrapDirectiveSignalInputs={name:"\u0275UnwrapDirectiveSignalInputs",moduleName:CORE}}static{this.unwrapWritableSignal={name:"\u0275unwrapWritableSignal",moduleName:CORE}}}const DASH_CASE_REGEXP=/-+([a-z0-9])/g;function dashCaseToCamelCase(input){return input.replace(DASH_CASE_REGEXP,((...m)=>m[1].toUpperCase()))}function splitAtColon(input,defaultValues){return _splitAt(input,":",defaultValues)}function splitAtPeriod(input,defaultValues){return _splitAt(input,".",defaultValues)}function _splitAt(input,character,defaultValues){const characterIndex=input.indexOf(character);if(characterIndex==-1)return defaultValues;return[input.slice(0,characterIndex).trim(),input.slice(characterIndex+1).trim()]}function noUndefined(val){return val===undefined?null:val}function error(msg){throw new Error(`Internal Error: ${msg}`)}function utf8Encode(str){let encoded=[];for(let index=0;index<str.length;index++){let codePoint=str.charCodeAt(index);if(codePoint>=55296&&codePoint<=56319&&str.length>index+1){const low=str.charCodeAt(index+1);if(low>=56320&&low<=57343){index++;codePoint=(codePoint-55296<<10)+low-56320+65536}}if(codePoint<=127){encoded.push(codePoint)}else if(codePoint<=2047){encoded.push(codePoint>>6&31|192,codePoint&63|128)}else if(codePoint<=65535){encoded.push(codePoint>>12|224,codePoint>>6&63|128,codePoint&63|128)}else if(codePoint<=2097151){encoded.push(codePoint>>18&7|240,codePoint>>12&63|128,codePoint>>6&63|128,codePoint&63|128)}}return encoded}function stringify(token){if(typeof token==="string"){return token}if(Array.isArray(token)){return"["+token.map(stringify).join(", ")+"]"}if(token==null){return""+token}if(token.overriddenName){return`${token.overriddenName}`}if(token.name){return`${token.name}`}if(!token.toString){return"object"}const res=token.toString();if(res==null){return""+res}const newLineIndex=res.indexOf("\n");return newLineIndex===-1?res:res.substring(0,newLineIndex)}class Version{constructor(full){this.full=full;const splits=full.split(".");this.major=splits[0];this.minor=splits[1];this.patch=splits.slice(2).join(".")}}const _global=globalThis;function partitionArray(arr,conditionFn){const truthy=[];const falsy=[];for(const item of arr){(conditionFn(item)?truthy:falsy).push(item)}return[truthy,falsy]}const VERSION$1=3;const JS_B64_PREFIX="# sourceMappingURL=data:application/json;base64,";class SourceMapGenerator{constructor(file=null){this.file=file;this.sourcesContent=new Map;this.lines=[];this.lastCol0=0;this.hasMappings=false}addSource(url,content=null){if(!this.sourcesContent.has(url)){this.sourcesContent.set(url,content)}return this}addLine(){this.lines.push([]);this.lastCol0=0;return this}addMapping(col0,sourceUrl,sourceLine0,sourceCol0){if(!this.currentLine){throw new Error(`A line must be added before mappings can be added`)}if(sourceUrl!=null&&!this.sourcesContent.has(sourceUrl)){throw new Error(`Unknown source file "${sourceUrl}"`)}if(col0==null){throw new Error(`The column in the generated code must be provided`)}if(col0<this.lastCol0){throw new Error(`Mapping should be added in output order`)}if(sourceUrl&&(sourceLine0==null||sourceCol0==null)){throw new Error(`The source location must be provided when a source url is provided`)}this.hasMappings=true;this.lastCol0=col0;this.currentLine.push({col0:col0,sourceUrl:sourceUrl,sourceLine0:sourceLine0,sourceCol0:sourceCol0});return this}get currentLine(){return this.lines.slice(-1)[0]}toJSON(){if(!this.hasMappings){return null}const sourcesIndex=new Map;const sources=[];const sourcesContent=[];Array.from(this.sourcesContent.keys()).forEach(((url,i)=>{sourcesIndex.set(url,i);sources.push(url);sourcesContent.push(this.sourcesContent.get(url)||null)}));let mappings="";let lastCol0=0;let lastSourceIndex=0;let lastSourceLine0=0;let lastSourceCol0=0;this.lines.forEach((segments=>{lastCol0=0;mappings+=segments.map((segment=>{let segAsStr=toBase64VLQ(segment.col0-lastCol0);lastCol0=segment.col0;if(segment.sourceUrl!=null){segAsStr+=toBase64VLQ(sourcesIndex.get(segment.sourceUrl)-lastSourceIndex);lastSourceIndex=sourcesIndex.get(segment.sourceUrl);segAsStr+=toBase64VLQ(segment.sourceLine0-lastSourceLine0);lastSourceLine0=segment.sourceLine0;segAsStr+=toBase64VLQ(segment.sourceCol0-lastSourceCol0);lastSourceCol0=segment.sourceCol0}return segAsStr})).join(",");mappings+=";"}));mappings=mappings.slice(0,-1);return{file:this.file||"",version:VERSION$1,sourceRoot:"",sources:sources,sourcesContent:sourcesContent,mappings:mappings}}toJsComment(){return this.hasMappings?"//"+JS_B64_PREFIX+toBase64String(JSON.stringify(this,null,0)):""}}function toBase64String(value){let b64="";const encoded=utf8Encode(value);for(let i=0;i<encoded.length;){const i1=encoded[i++];const i2=i<encoded.length?encoded[i++]:null;const i3=i<encoded.length?encoded[i++]:null;b64+=toBase64Digit(i1>>2);b64+=toBase64Digit((i1&3)<<4|(i2===null?0:i2>>4));b64+=i2===null?"=":toBase64Digit((i2&15)<<2|(i3===null?0:i3>>6));b64+=i2===null||i3===null?"=":toBase64Digit(i3&63)}return b64}function toBase64VLQ(value){value=value<0?(-value<<1)+1:value<<1;let out="";do{let digit=value&31;value=value>>5;if(value>0){digit=digit|32}out+=toBase64Digit(digit)}while(value>0);return out}const B64_DIGITS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function toBase64Digit(value){if(value<0||value>=64){throw new Error(`Can only encode value in the range [0, 63]`)}return B64_DIGITS[value]}const _SINGLE_QUOTE_ESCAPE_STRING_RE=/'|\\|\n|\r|\$/g;const _LEGAL_IDENTIFIER_RE=/^[$A-Z_][0-9A-Z_$]*$/i;const _INDENT_WITH=" ";class _EmittedLine{constructor(indent){this.indent=indent;this.partsLength=0;this.parts=[];this.srcSpans=[]}}class EmitterVisitorContext{static createRoot(){return new EmitterVisitorContext(0)}constructor(_indent){this._indent=_indent;this._lines=[new _EmittedLine(_indent)]}get _currentLine(){return this._lines[this._lines.length-1]}println(from,lastPart=""){this.print(from||null,lastPart,true)}lineIsEmpty(){return this._currentLine.parts.length===0}lineLength(){return this._currentLine.indent*_INDENT_WITH.length+this._currentLine.partsLength}print(from,part,newLine=false){if(part.length>0){this._currentLine.parts.push(part);this._currentLine.partsLength+=part.length;this._currentLine.srcSpans.push(from&&from.sourceSpan||null)}if(newLine){this._lines.push(new _EmittedLine(this._indent))}}removeEmptyLastLine(){if(this.lineIsEmpty()){this._lines.pop()}}incIndent(){this._indent++;if(this.lineIsEmpty()){this._currentLine.indent=this._indent}}decIndent(){this._indent--;if(this.lineIsEmpty()){this._currentLine.indent=this._indent}}toSource(){return this.sourceLines.map((l=>l.parts.length>0?_createIndent(l.indent)+l.parts.join(""):"")).join("\n")}toSourceMapGenerator(genFilePath,startsAtLine=0){const map=new SourceMapGenerator(genFilePath);let firstOffsetMapped=false;const mapFirstOffsetIfNeeded=()=>{if(!firstOffsetMapped){map.addSource(genFilePath," ").addMapping(0,genFilePath,0,0);firstOffsetMapped=true}};for(let i=0;i<startsAtLine;i++){map.addLine();mapFirstOffsetIfNeeded()}this.sourceLines.forEach(((line,lineIdx)=>{map.addLine();const spans=line.srcSpans;const parts=line.parts;let col0=line.indent*_INDENT_WITH.length;let spanIdx=0;while(spanIdx<spans.length&&!spans[spanIdx]){col0+=parts[spanIdx].length;spanIdx++}if(spanIdx<spans.length&&lineIdx===0&&col0===0){firstOffsetMapped=true}else{mapFirstOffsetIfNeeded()}while(spanIdx<spans.length){const span=spans[spanIdx];const source=span.start.file;const sourceLine=span.start.line;const sourceCol=span.start.col;map.addSource(source.url,source.content).addMapping(col0,source.url,sourceLine,sourceCol);col0+=parts[spanIdx].length;spanIdx++;while(spanIdx<spans.length&&(span===spans[spanIdx]||!spans[spanIdx])){col0+=parts[spanIdx].length;spanIdx++}}}));return map}spanOf(line,column){const emittedLine=this._lines[line];if(emittedLine){let columnsLeft=column-_createIndent(emittedLine.indent).length;for(let partIndex=0;partIndex<emittedLine.parts.length;partIndex++){const part=emittedLine.parts[partIndex];if(part.length>columnsLeft){return emittedLine.srcSpans[partIndex]}columnsLeft-=part.length}}return null}get sourceLines(){if(this._lines.length&&this._lines[this._lines.length-1].parts.length===0){return this._lines.slice(0,-1)}return this._lines}}class AbstractEmitterVisitor{constructor(_escapeDollarInStrings){this._escapeDollarInStrings=_escapeDollarInStrings}printLeadingComments(stmt,ctx){if(stmt.leadingComments===undefined){return}for(const comment of stmt.leadingComments){if(comment instanceof JSDocComment){ctx.print(stmt,`/*${comment.toString()}*/`,comment.trailingNewline)}else{if(comment.multiline){ctx.print(stmt,`/* ${comment.text} */`,comment.trailingNewline)}else{comment.text.split("\n").forEach((line=>{ctx.println(stmt,`// ${line}`)}))}}}}visitExpressionStmt(stmt,ctx){this.printLeadingComments(stmt,ctx);stmt.expr.visitExpression(this,ctx);ctx.println(stmt,";");return null}visitReturnStmt(stmt,ctx){this.printLeadingComments(stmt,ctx);ctx.print(stmt,`return `);stmt.value.visitExpression(this,ctx);ctx.println(stmt,";");return null}visitIfStmt(stmt,ctx){this.printLeadingComments(stmt,ctx);ctx.print(stmt,`if (`);stmt.condition.visitExpression(this,ctx);ctx.print(stmt,`) {`);const hasElseCase=stmt.falseCase!=null&&stmt.falseCase.length>0;if(stmt.trueCase.length<=1&&!hasElseCase){ctx.print(stmt,` `);this.visitAllStatements(stmt.trueCase,ctx);ctx.removeEmptyLastLine();ctx.print(stmt,` `)}else{ctx.println();ctx.incIndent();this.visitAllStatements(stmt.trueCase,ctx);ctx.decIndent();if(hasElseCase){ctx.println(stmt,`} else {`);ctx.incIndent();this.visitAllStatements(stmt.falseCase,ctx);ctx.decIndent()}}ctx.println(stmt,`}`);return null}visitWriteVarExpr(expr,ctx){const lineWasEmpty=ctx.lineIsEmpty();if(!lineWasEmpty){ctx.print(expr,"(")}ctx.print(expr,`${expr.name} = `);expr.value.visitExpression(this,ctx);if(!lineWasEmpty){ctx.print(expr,")")}return null}visitWriteKeyExpr(expr,ctx){const lineWasEmpty=ctx.lineIsEmpty();if(!lineWasEmpty){ctx.print(expr,"(")}expr.receiver.visitExpression(this,ctx);ctx.print(expr,`[`);expr.index.visitExpression(this,ctx);ctx.print(expr,`] = `);expr.value.visitExpression(this,ctx);if(!lineWasEmpty){ctx.print(expr,")")}return null}visitWritePropExpr(expr,ctx){const lineWasEmpty=ctx.lineIsEmpty();if(!lineWasEmpty){ctx.print(expr,"(")}expr.receiver.visitExpression(this,ctx);ctx.print(expr,`.${expr.name} = `);expr.value.visitExpression(this,ctx);if(!lineWasEmpty){ctx.print(expr,")")}return null}visitInvokeFunctionExpr(expr,ctx){const shouldParenthesize=expr.fn instanceof ArrowFunctionExpr;if(shouldParenthesize){ctx.print(expr.fn,"(")}expr.fn.visitExpression(this,ctx);if(shouldParenthesize){ctx.print(expr.fn,")")}ctx.print(expr,`(`);this.visitAllExpressions(expr.args,ctx,",");ctx.print(expr,`)`);return null}visitTaggedTemplateExpr(expr,ctx){expr.tag.visitExpression(this,ctx);ctx.print(expr,"`"+expr.template.elements[0].rawText);for(let i=1;i<expr.template.elements.length;i++){ctx.print(expr,"${");expr.template.expressions[i-1].visitExpression(this,ctx);ctx.print(expr,`}${expr.template.elements[i].rawText}`)}ctx.print(expr,"`");return null}visitWrappedNodeExpr(ast,ctx){throw new Error("Abstract emitter cannot visit WrappedNodeExpr.")}visitTypeofExpr(expr,ctx){ctx.print(expr,"typeof ");expr.expr.visitExpression(this,ctx)}visitReadVarExpr(ast,ctx){ctx.print(ast,ast.name);return null}visitInstantiateExpr(ast,ctx){ctx.print(ast,`new `);ast.classExpr.visitExpression(this,ctx);ctx.print(ast,`(`);this.visitAllExpressions(ast.args,ctx,",");ctx.print(ast,`)`);return null}visitLiteralExpr(ast,ctx){const value=ast.value;if(typeof value==="string"){ctx.print(ast,escapeIdentifier(value,this._escapeDollarInStrings))}else{ctx.print(ast,`${value}`)}return null}visitLocalizedString(ast,ctx){const head=ast.serializeI18nHead();ctx.print(ast,"$localize `"+head.raw);for(let i=1;i<ast.messageParts.length;i++){ctx.print(ast,"${");ast.expressions[i-1].visitExpression(this,ctx);ctx.print(ast,`}${ast.serializeI18nTemplatePart(i).raw}`)}ctx.print(ast,"`");return null}visitConditionalExpr(ast,ctx){ctx.print(ast,`(`);ast.condition.visitExpression(this,ctx);ctx.print(ast,"? ");ast.trueCase.visitExpression(this,ctx);ctx.print(ast,": ");ast.falseCase.visitExpression(this,ctx);ctx.print(ast,`)`);return null}visitDynamicImportExpr(ast,ctx){ctx.print(ast,`import(${ast.url})`)}visitNotExpr(ast,ctx){ctx.print(ast,"!");ast.condition.visitExpression(this,ctx);return null}visitUnaryOperatorExpr(ast,ctx){let opStr;switch(ast.operator){case exports.UnaryOperator.Plus:opStr="+";break;case exports.UnaryOperator.Minus:opStr="-";break;default:throw new Error(`Unknown operator ${ast.operator}`)}if(ast.parens)ctx.print(ast,`(`);ctx.print(ast,opStr);ast.expr.visitExpression(this,ctx);if(ast.parens)ctx.print(ast,`)`);return null}visitBinaryOperatorExpr(ast,ctx){let opStr;switch(ast.operator){case exports.BinaryOperator.Equals:opStr="==";break;case exports.BinaryOperator.Identical:opStr="===";break;case exports.BinaryOperator.NotEquals:opStr="!=";break;case exports.BinaryOperator.NotIdentical:opStr="!==";break;case exports.BinaryOperator.And:opStr="&&";break;case exports.BinaryOperator.BitwiseOr:opStr="|";break;case exports.BinaryOperator.BitwiseAnd:opStr="&";break;case exports.BinaryOperator.Or:opStr="||";break;case exports.BinaryOperator.Plus:opStr="+";break;case exports.BinaryOperator.Minus:opStr="-";break;case exports.BinaryOperator.Divide:opStr="/";break;case exports.BinaryOperator.Multiply:opStr="*";break;case exports.BinaryOperator.Modulo:opStr="%";break;case exports.BinaryOperator.Lower:opStr="<";break;case exports.BinaryOperator.LowerEquals:opStr="<=";break;case exports.BinaryOperator.Bigger:opStr=">";break;case exports.BinaryOperator.BiggerEquals:opStr=">=";break;case exports.BinaryOperator.NullishCoalesce:opStr="??";break;default:throw new Error(`Unknown operator ${ast.operator}`)}if(ast.parens)ctx.print(ast,`(`);ast.lhs.visitExpression(this,ctx);ctx.print(ast,` ${opStr} `);ast.rhs.visitExpression(this,ctx);if(ast.parens)ctx.print(ast,`)`);return null}visitReadPropExpr(ast,ctx){ast.receiver.visitExpression(this,ctx);ctx.print(ast,`.`);ctx.print(ast,ast.name);return null}visitReadKeyExpr(ast,ctx){ast.receiver.visitExpression(this,ctx);ctx.print(ast,`[`);ast.index.visitExpression(this,ctx);ctx.print(ast,`]`);return null}visitLiteralArrayExpr(ast,ctx){ctx.print(ast,`[`);this.visitAllExpressions(ast.entries,ctx,",");ctx.print(ast,`]`);return null}visitLiteralMapExpr(ast,ctx){ctx.print(ast,`{`);this.visitAllObjects((entry=>{ctx.print(ast,`${escapeIdentifier(entry.key,this._escapeDollarInStrings,entry.quoted)}:`);entry.value.visitExpression(this,ctx)}),ast.entries,ctx,",");ctx.print(ast,`}`);return null}visitCommaExpr(ast,ctx){ctx.print(ast,"(");this.visitAllExpressions(ast.parts,ctx,",");ctx.print(ast,")");return null}visitAllExpressions(expressions,ctx,separator){this.visitAllObjects((expr=>expr.visitExpression(this,ctx)),expressions,ctx,separator)}visitAllObjects(handler,expressions,ctx,separator){let incrementedIndent=false;for(let i=0;i<expressions.length;i++){if(i>0){if(ctx.lineLength()>80){ctx.print(null,separator,true);if(!incrementedIndent){ctx.incIndent();ctx.incIndent();incrementedIndent=true}}else{ctx.print(null,separator,false)}}handler(expressions[i])}if(incrementedIndent){ctx.decIndent();ctx.decIndent()}}visitAllStatements(statements,ctx){statements.forEach((stmt=>stmt.visitStatement(this,ctx)))}}function escapeIdentifier(input,escapeDollar,alwaysQuote=true){if(input==null){return null}const body=input.replace(_SINGLE_QUOTE_ESCAPE_STRING_RE,((...match)=>{if(match[0]=="$"){return escapeDollar?"\\$":"$"}else if(match[0]=="\n"){return"\\n"}else if(match[0]=="\r"){return"\\r"}else{return`\\${match[0]}`}}));const requiresQuotes=alwaysQuote||!_LEGAL_IDENTIFIER_RE.test(body);return requiresQuotes?`'${body}'`:body}function _createIndent(count){let res="";for(let i=0;i<count;i++){res+=_INDENT_WITH}return res}function typeWithParameters(type,numParams){if(numParams===0){return expressionType(type)}const params=[];for(let i=0;i<numParams;i++){params.push(DYNAMIC_TYPE)}return expressionType(type,undefined,params)}const ANIMATE_SYMBOL_PREFIX="@";function prepareSyntheticPropertyName(name){return`${ANIMATE_SYMBOL_PREFIX}${name}`}function prepareSyntheticListenerName(name,phase){return`${ANIMATE_SYMBOL_PREFIX}${name}.${phase}`}function getSafePropertyAccessString(accessor,name){const escapedName=escapeIdentifier(name,false,false);return escapedName!==name?`${accessor}[${escapedName}]`:`${accessor}.${name}`}function prepareSyntheticListenerFunctionName(name,phase){return`animation_${name}_${phase}`}function jitOnlyGuardedExpression(expr){return guardedExpression("ngJitMode",expr)}function devOnlyGuardedExpression(expr){return guardedExpression("ngDevMode",expr)}function guardedExpression(guard,expr){const guardExpr=new ExternalExpr({name:guard,moduleName:null});const guardNotDefined=new BinaryOperatorExpr(exports.BinaryOperator.Identical,new TypeofExpr(guardExpr),literal("undefined"));const guardUndefinedOrTrue=new BinaryOperatorExpr(exports.BinaryOperator.Or,guardNotDefined,guardExpr,undefined,undefined,true);return new BinaryOperatorExpr(exports.BinaryOperator.And,guardUndefinedOrTrue,expr)}function wrapReference(value){const wrapped=new WrappedNodeExpr(value);return{value:wrapped,type:wrapped}}function refsToArray(refs,shouldForwardDeclare){const values=literalArr(refs.map((ref=>ref.value)));return shouldForwardDeclare?arrowFn([],values):values}function createMayBeForwardRefExpression(expression,forwardRef){return{expression:expression,forwardRef:forwardRef}}function convertFromMaybeForwardRefExpression({expression:expression,forwardRef:forwardRef}){switch(forwardRef){case 0:case 1:return expression;case 2:return generateForwardRef(expression)}}function generateForwardRef(expr){return importExpr(Identifiers.forwardRef).callFn([arrowFn([],expr)])}var R3FactoryDelegateType;(function(R3FactoryDelegateType){R3FactoryDelegateType[R3FactoryDelegateType["Class"]=0]="Class";R3FactoryDelegateType[R3FactoryDelegateType["Function"]=1]="Function"})(R3FactoryDelegateType||(R3FactoryDelegateType={}));exports.FactoryTarget=void 0;(function(FactoryTarget){FactoryTarget[FactoryTarget["Directive"]=0]="Directive";FactoryTarget[FactoryTarget["Component"]=1]="Component";FactoryTarget[FactoryTarget["Injectable"]=2]="Injectable";FactoryTarget[FactoryTarget["Pipe"]=3]="Pipe";FactoryTarget[FactoryTarget["NgModule"]=4]="NgModule"})(exports.FactoryTarget||(exports.FactoryTarget={}));function compileFactoryFunction(meta){const t=variable("t");let baseFactoryVar=null;const typeForCtor=!isDelegatedFactoryMetadata(meta)?new BinaryOperatorExpr(exports.BinaryOperator.Or,t,meta.type.value):t;let ctorExpr=null;if(meta.deps!==null){if(meta.deps!=="invalid"){ctorExpr=new InstantiateExpr(typeForCtor,injectDependencies(meta.deps,meta.target))}}else{baseFactoryVar=variable(`\u0275${meta.name}_BaseFactory`);ctorExpr=baseFactoryVar.callFn([typeForCtor])}const body=[];let retExpr=null;function makeConditionalFactory(nonCtorExpr){const r=variable("r");body.push(r.set(NULL_EXPR).toDeclStmt());const ctorStmt=ctorExpr!==null?r.set(ctorExpr).toStmt():importExpr(Identifiers.invalidFactory).callFn([]).toStmt();body.push(ifStmt(t,[ctorStmt],[r.set(nonCtorExpr).toStmt()]));return r}if(isDelegatedFactoryMetadata(meta)){const delegateArgs=injectDependencies(meta.delegateDeps,meta.target);const factoryExpr=new(meta.delegateType===R3FactoryDelegateType.Class?InstantiateExpr:InvokeFunctionExpr)(meta.delegate,delegateArgs);retExpr=makeConditionalFactory(factoryExpr)}else if(isExpressionFactoryMetadata(meta)){retExpr=makeConditionalFactory(meta.expression)}else{retExpr=ctorExpr}if(retExpr===null){body.push(importExpr(Identifiers.invalidFactory).callFn([]).toStmt())}else if(baseFactoryVar!==null){const getInheritedFactoryCall=importExpr(Identifiers.getInheritedFactory).callFn([meta.type.value]);const baseFactory=new BinaryOperatorExpr(exports.BinaryOperator.Or,baseFactoryVar,baseFactoryVar.set(getInheritedFactoryCall));body.push(new ReturnStatement(baseFactory.callFn([typeForCtor])))}else{body.push(new ReturnStatement(retExpr))}let factoryFn=fn([new FnParam("t",DYNAMIC_TYPE)],body,INFERRED_TYPE,undefined,`${meta.name}_Factory`);if(baseFactoryVar!==null){factoryFn=arrowFn([],[new DeclareVarStmt(baseFactoryVar.name),new ReturnStatement(factoryFn)]).callFn([],undefined,true)}return{expression:factoryFn,statements:[],type:createFactoryType(meta)}}function createFactoryType(meta){const ctorDepsType=meta.deps!==null&&meta.deps!=="invalid"?createCtorDepsType(meta.deps):NONE_TYPE;return expressionType(importExpr(Identifiers.FactoryDeclaration,[typeWithParameters(meta.type.type,meta.typeArgumentCount),ctorDepsType]))}function injectDependencies(deps,target){return deps.map(((dep,index)=>compileInjectDependency(dep,target,index)))}function compileInjectDependency(dep,target,index){if(dep.token===null){return importExpr(Identifiers.invalidFactoryDep).callFn([literal(index)])}else if(dep.attributeNameType===null){const flags=0|(dep.self?2:0)|(dep.skipSelf?4:0)|(dep.host?1:0)|(dep.optional?8:0)|(target===exports.FactoryTarget.Pipe?16:0);let flagsParam=flags!==0||dep.optional?literal(flags):null;const injectArgs=[dep.token];if(flagsParam){injectArgs.push(flagsParam)}const injectFn=getInjectFn(target);return importExpr(injectFn).callFn(injectArgs)}else{return importExpr(Identifiers.injectAttribute).callFn([dep.token])}}function createCtorDepsType(deps){let hasTypes=false;const attributeTypes=deps.map((dep=>{const type=createCtorDepType(dep);if(type!==null){hasTypes=true;return type}else{return literal(null)}}));if(hasTypes){return expressionType(literalArr(attributeTypes))}else{return NONE_TYPE}}function createCtorDepType(dep){const entries=[];if(dep.attributeNameType!==null){entries.push({key:"attribute",value:dep.attributeNameType,quoted:false})}if(dep.optional){entries.push({key:"optional",value:literal(true),quoted:false})}if(dep.host){entries.push({key:"host",value:literal(true),quoted:false})}if(dep.self){entries.push({key:"self",value:literal(true),quoted:false})}if(dep.skipSelf){entries.push({key:"skipSelf",value:literal(true),quoted:false})}return entries.length>0?literalMap(entries):null}function isDelegatedFactoryMetadata(meta){return meta.delegateType!==undefined}function isExpressionFactoryMetadata(meta){return meta.expression!==undefined}function getInjectFn(target){switch(target){case exports.FactoryTarget.Component:case exports.FactoryTarget.Directive:case exports.FactoryTarget.Pipe:return Identifiers.directiveInject;case exports.FactoryTarget.NgModule:case exports.FactoryTarget.Injectable:default:return Identifiers.inject}}exports.TagContentType=void 0;(function(TagContentType){TagContentType[TagContentType["RAW_TEXT"]=0]="RAW_TEXT";TagContentType[TagContentType["ESCAPABLE_RAW_TEXT"]=1]="ESCAPABLE_RAW_TEXT";TagContentType[TagContentType["PARSABLE_DATA"]=2]="PARSABLE_DATA"})(exports.TagContentType||(exports.TagContentType={}));function splitNsName(elementName,fatal=true){if(elementName[0]!=":"){return[null,elementName]}const colonIndex=elementName.indexOf(":",1);if(colonIndex===-1){if(fatal){throw new Error(`Unsupported format "${elementName}" expecting ":namespace:name"`)}else{return[null,elementName]}}return[elementName.slice(1,colonIndex),elementName.slice(colonIndex+1)]}function isNgContainer(tagName){return splitNsName(tagName)[1]==="ng-container"}function isNgContent(tagName){return splitNsName(tagName)[1]==="ng-content"}function isNgTemplate(tagName){return splitNsName(tagName)[1]==="ng-template"}function getNsPrefix(fullName){return fullName===null?null:splitNsName(fullName)[0]}function mergeNsAndName(prefix,localName){return prefix?`:${prefix}:${localName}`:localName}class Comment$1{constructor(value,sourceSpan){this.value=value;this.sourceSpan=sourceSpan}visit(_visitor){throw new Error("visit() not implemented for Comment")}}class Text$3{constructor(value,sourceSpan){this.value=value;this.sourceSpan=sourceSpan}visit(visitor){return visitor.visitText(this)}}class BoundText{constructor(value,sourceSpan,i18n){this.value=value;this.sourceSpan=sourceSpan;this.i18n=i18n}visit(visitor){return visitor.visitBoundText(this)}}class TextAttribute{constructor(name,value,sourceSpan,keySpan,valueSpan,i18n){this.name=name;this.value=value;this.sourceSpan=sourceSpan;this.keySpan=keySpan;this.valueSpan=valueSpan;this.i18n=i18n}visit(visitor){return visitor.visitTextAttribute(this)}}class BoundAttribute{constructor(name,type,securityContext,value,unit,sourceSpan,keySpan,valueSpan,i18n){this.name=name;this.type=type;this.securityContext=securityContext;this.value=value;this.unit=unit;this.sourceSpan=sourceSpan;this.keySpan=keySpan;this.valueSpan=valueSpan;this.i18n=i18n}static fromBoundElementProperty(prop,i18n){if(prop.keySpan===undefined){throw new Error(`Unexpected state: keySpan must be defined for bound attributes but was not for ${prop.name}: ${prop.sourceSpan}`)}return new BoundAttribute(prop.name,prop.type,prop.securityContext,prop.value,prop.unit,prop.sourceSpan,prop.keySpan,prop.valueSpan,i18n)}visit(visitor){return visitor.visitBoundAttribute(this)}}class BoundEvent{constructor(name,type,handler,target,phase,sourceSpan,handlerSpan,keySpan){this.name=name;this.type=type;this.handler=handler;this.target=target;this.phase=phase;this.sourceSpan=sourceSpan;this.handlerSpan=handlerSpan;this.keySpan=keySpan}static fromParsedEvent(event){const target=event.type===0?event.targetOrPhase:null;const phase=event.type===1?event.targetOrPhase:null;if(event.keySpan===undefined){throw new Error(`Unexpected state: keySpan must be defined for bound event but was not for ${event.name}: ${event.sourceSpan}`)}return new BoundEvent(event.name,event.type,event.handler,target,phase,event.sourceSpan,event.handlerSpan,event.keySpan)}visit(visitor){return visitor.visitBoundEvent(this)}}class Element$1{constructor(name,attributes,inputs,outputs,children,references,sourceSpan,startSourceSpan,endSourceSpan,i18n){this.name=name;this.attributes=attributes;this.inputs=inputs;this.outputs=outputs;this.children=children;this.references=references;this.sourceSpan=sourceSpan;this.startSourceSpan=startSourceSpan;this.endSourceSpan=endSourceSpan;this.i18n=i18n}visit(visitor){return visitor.visitElement(this)}}class DeferredTrigger{constructor(nameSpan,sourceSpan,prefetchSpan,whenOrOnSourceSpan){this.nameSpan=nameSpan;this.sourceSpan=sourceSpan;this.prefetchSpan=prefetchSpan;this.whenOrOnSourceSpan=whenOrOnSourceSpan}visit(visitor){return visitor.visitDeferredTrigger(this)}}class BoundDeferredTrigger extends DeferredTrigger{constructor(value,sourceSpan,prefetchSpan,whenSourceSpan){super(null,sourceSpan,prefetchSpan,whenSourceSpan);this.value=value}}class IdleDeferredTrigger extends DeferredTrigger{}class ImmediateDeferredTrigger extends DeferredTrigger{}class HoverDeferredTrigger extends DeferredTrigger{constructor(reference,nameSpan,sourceSpan,prefetchSpan,onSourceSpan){super(nameSpan,sourceSpan,prefetchSpan,onSourceSpan);this.reference=reference}}class TimerDeferredTrigger extends DeferredTrigger{constructor(delay,nameSpan,sourceSpan,prefetchSpan,onSourceSpan){super(nameSpan,sourceSpan,prefetchSpan,onSourceSpan);this.delay=delay}}class InteractionDeferredTrigger extends DeferredTrigger{constructor(reference,nameSpan,sourceSpan,prefetchSpan,onSourceSpan){super(nameSpan,sourceSpan,prefetchSpan,onSourceSpan);this.reference=reference}}class ViewportDeferredTrigger extends DeferredTrigger{constructor(reference,nameSpan,sourceSpan,prefetchSpan,onSourceSpan){super(nameSpan,sourceSpan,prefetchSpan,onSourceSpan);this.reference=reference}}class BlockNode{constructor(nameSpan,sourceSpan,startSourceSpan,endSourceSpan){this.nameSpan=nameSpan;this.sourceSpan=sourceSpan;this.startSourceSpan=startSourceSpan;this.endSourceSpan=endSourceSpan}}class DeferredBlockPlaceholder extends BlockNode{constructor(children,minimumTime,nameSpan,sourceSpan,startSourceSpan,endSourceSpan,i18n){super(nameSpan,sourceSpan,startSourceSpan,endSourceSpan);this.children=children;this.minimumTime=minimumTime;this.i18n=i18n}visit(visitor){return visitor.visitDeferredBlockPlaceholder(this)}}class DeferredBlockLoading extends BlockNode{constructor(children,afterTime,minimumTime,nameSpan,sourceSpan,startSourceSpan,endSourceSpan,i18n){super(nameSpan,sourceSpan,startSourceSpan,endSourceSpan);this.children=children;this.afterTime=afterTime;this.minimumTime=minimumTime;this.i18n=i18n}visit(visitor){return visitor.visitDeferredBlockLoading(this)}}class DeferredBlockError extends BlockNode{constructor(children,nameSpan,sourceSpan,startSourceSpan,endSourceSpan,i18n){super(nameSpan,sourceSpan,startSourceSpan,endSourceSpan);this.children=children;this.i18n=i18n}visit(visitor){return visitor.visitDeferredBlockError(this)}}class DeferredBlock extends BlockNode{constructor(children,triggers,prefetchTriggers,placeholder,loading,error,nameSpan,sourceSpan,mainBlockSpan,startSourceSpan,endSourceSpan,i18n){super(nameSpan,sourceSpan,startSourceSpan,endSourceSpan);this.children=children;this.placeholder=placeholder;this.loading=loading;this.error=error;this.mainBlockSpan=mainBlockSpan;this.i18n=i18n;this.triggers=triggers;this.prefetchTriggers=prefetchTriggers;this.definedTriggers=Object.keys(triggers);this.definedPrefetchTriggers=Object.keys(prefetchTriggers)}visit(visitor){return visitor.visitDeferredBlock(this)}visitAll(visitor){this.visitTriggers(this.definedTriggers,this.triggers,visitor);this.visitTriggers(this.definedPrefetchTriggers,this.prefetchTriggers,visitor);visitAll$1(visitor,this.children);const remainingBlocks=[this.placeholder,this.loading,this.error].filter((x=>x!==null));visitAll$1(visitor,remainingBlocks)}visitTriggers(keys,triggers,visitor){visitAll$1(visitor,keys.map((k=>triggers[k])))}}class SwitchBlock extends BlockNode{constructor(expression,cases,unknownBlocks,sourceSpan,startSourceSpan,endSourceSpan,nameSpan){super(nameSpan,sourceSpan,startSourceSpan,endSourceSpan);this.expression=expression;this.cases=cases;this.unknownBlocks=unknownBlocks}visit(visitor){return visitor.visitSwitchBlock(this)}}class SwitchBlockCase extends BlockNode{constructor(expression,children,sourceSpan,startSourceSpan,endSourceSpan,nameSpan,i18n){super(nameSpan,sourceSpan,startSourceSpan,endSourceSpan);this.expression=expression;this.children=children;this.i18n=i18n}visit(visitor){return visitor.visitSwitchBlockCase(this)}}class ForLoopBlock extends BlockNode{constructor(item,expression,trackBy,trackKeywordSpan,contextVariables,children,empty,sourceSpan,mainBlockSpan,startSourceSpan,endSourceSpan,nameSpan,i18n){super(nameSpan,sourceSpan,startSourceSpan,endSourceSpan);this.item=item;this.expression=expression;this.trackBy=trackBy;this.trackKeywordSpan=trackKeywordSpan;this.contextVariables=contextVariables;this.children=children;this.empty=empty;this.mainBlockSpan=mainBlockSpan;this.i18n=i18n}visit(visitor){return visitor.visitForLoopBlock(this)}}class ForLoopBlockEmpty extends BlockNode{constructor(children,sourceSpan,startSourceSpan,endSourceSpan,nameSpan,i18n){super(nameSpan,sourceSpan,startSourceSpan,endSourceSpan);this.children=children;this.i18n=i18n}visit(visitor){return visitor.visitForLoopBlockEmpty(this)}}class IfBlock extends BlockNode{constructor(branches,sourceSpan,startSourceSpan,endSourceSpan,nameSpan){super(nameSpan,sourceSpan,startSourceSpan,endSourceSpan);this.branches=branches}visit(visitor){return visitor.visitIfBlock(this)}}class IfBlockBranch extends BlockNode{constructor(expression,children,expressionAlias,sourceSpan,startSourceSpan,endSourceSpan,nameSpan,i18n){super(nameSpan,sourceSpan,startSourceSpan,endSourceSpan);this.expression=expression;this.children=children;this.expressionAlias=expressionAlias;this.i18n=i18n}visit(visitor){return visitor.visitIfBlockBranch(this)}}class UnknownBlock{constructor(name,sourceSpan,nameSpan){this.name=name;this.sourceSpan=sourceSpan;this.nameSpan=nameSpan}visit(visitor){return visitor.visitUnknownBlock(this)}}class Template{constructor(tagName,attributes,inputs,outputs,templateAttrs,children,references,variables,sourceSpan,startSourceSpan,endSourceSpan,i18n){this.tagName=tagName;this.attributes=attributes;this.inputs=inputs;this.outputs=outputs;this.templateAttrs=templateAttrs;this.children=children;this.references=references;this.variables=variables;this.sourceSpan=sourceSpan;this.startSourceSpan=startSourceSpan;this.endSourceSpan=endSourceSpan;this.i18n=i18n}visit(visitor){return visitor.visitTemplate(this)}}class Content{constructor(selector,attributes,sourceSpan,i18n){this.selector=selector;this.attributes=attributes;this.sourceSpan=sourceSpan;this.i18n=i18n;this.name="ng-content"}visit(visitor){return visitor.visitContent(this)}}class Variable{constructor(name,value,sourceSpan,keySpan,valueSpan){this.name=name;this.value=value;this.sourceSpan=sourceSpan;this.keySpan=keySpan;this.valueSpan=valueSpan}visit(visitor){return visitor.visitVariable(this)}}class Reference{constructor(name,value,sourceSpan,keySpan,valueSpan){this.name=name;this.value=value;this.sourceSpan=sourceSpan;this.keySpan=keySpan;this.valueSpan=valueSpan}visit(visitor){return visitor.visitReference(this)}}class Icu$1{constructor(vars,placeholders,sourceSpan,i18n){this.vars=vars;this.placeholders=placeholders;this.sourceSpan=sourceSpan;this.i18n=i18n}visit(visitor){return visitor.visitIcu(this)}}class RecursiveVisitor$1{visitElement(element){visitAll$1(this,element.attributes);visitAll$1(this,element.inputs);visitAll$1(this,element.outputs);visitAll$1(this,element.children);visitAll$1(this,element.references)}visitTemplate(template){visitAll$1(this,template.attributes);visitAll$1(this,template.inputs);visitAll$1(this,template.outputs);visitAll$1(this,template.children);visitAll$1(this,template.references);visitAll$1(this,template.variables)}visitDeferredBlock(deferred){deferred.visitAll(this)}visitDeferredBlockPlaceholder(block){visitAll$1(this,block.children)}visitDeferredBlockError(block){visitAll$1(this,block.children)}visitDeferredBlockLoading(block){visitAll$1(this,block.children)}visitSwitchBlock(block){visitAll$1(this,block.cases)}visitSwitchBlockCase(block){visitAll$1(this,block.children)}visitForLoopBlock(block){const blockItems=[block.item,...Object.values(block.contextVariables),...block.children];block.empty&&blockItems.push(block.empty);visitAll$1(this,blockItems)}visitForLoopBlockEmpty(block){visitAll$1(this,block.children)}visitIfBlock(block){visitAll$1(this,block.branches)}visitIfBlockBranch(block){const blockItems=block.children;block.expressionAlias&&blockItems.push(block.expressionAlias);visitAll$1(this,blockItems)}visitContent(content){}visitVariable(variable){}visitReference(reference){}visitTextAttribute(attribute){}visitBoundAttribute(attribute){}visitBoundEvent(attribute){}visitText(text){}visitBoundText(text){}visitIcu(icu){}visitDeferredTrigger(trigger){}visitUnknownBlock(block){}}function visitAll$1(visitor,nodes){const result=[];if(visitor.visit){for(const node of nodes){visitor.visit(node)||node.visit(visitor)}}else{for(const node of nodes){const newNode=node.visit(visitor);if(newNode){result.push(newNode)}}}return result}class Message{constructor(nodes,placeholders,placeholderToMessage,meaning,description,customId){this.nodes=nodes;this.placeholders=placeholders;this.placeholderToMessage=placeholderToMessage;this.meaning=meaning;this.description=description;this.customId=customId;this.legacyIds=[];this.id=this.customId;this.messageString=serializeMessage(this.nodes);if(nodes.length){this.sources=[{filePath:nodes[0].sourceSpan.start.file.url,startLine:nodes[0].sourceSpan.start.line+1,startCol:nodes[0].sourceSpan.start.col+1,endLine:nodes[nodes.length-1].sourceSpan.end.line+1,endCol:nodes[0].sourceSpan.start.col+1}]}else{this.sources=[]}}}class Text$2{constructor(value,sourceSpan){this.value=value;this.sourceSpan=sourceSpan}visit(visitor,context){return visitor.visitText(this,context)}}class Container{constructor(children,sourceSpan){this.children=children;this.sourceSpan=sourceSpan}visit(visitor,context){return visitor.visitContainer(this,context)}}class Icu{constructor(expression,type,cases,sourceSpan,expressionPlaceholder){this.expression=expression;this.type=type;this.cases=cases;this.sourceSpan=sourceSpan;this.expressionPlaceholder=expressionPlaceholder}visit(visitor,context){return visitor.visitIcu(this,context)}}class TagPlaceholder{constructor(tag,attrs,startName,closeName,children,isVoid,sourceSpan,startSourceSpan,endSourceSpan){this.tag=tag;this.attrs=attrs;this.startName=startName;this.closeName=closeName;this.children=children;this.isVoid=isVoid;this.sourceSpan=sourceSpan;this.startSourceSpan=startSourceSpan;this.endSourceSpan=endSourceSpan}visit(visitor,context){return visitor.visitTagPlaceholder(this,context)}}class Placeholder{constructor(value,name,sourceSpan){this.value=value;this.name=name;this.sourceSpan=sourceSpan}visit(visitor,context){return visitor.visitPlaceholder(this,context)}}class IcuPlaceholder{constructor(value,name,sourceSpan){this.value=value;this.name=name;this.sourceSpan=sourceSpan}visit(visitor,context){return visitor.visitIcuPlaceholder(this,context)}}class BlockPlaceholder{constructor(name,parameters,startName,closeName,children,sourceSpan,startSourceSpan,endSourceSpan){this.name=name;this.parameters=parameters;this.startName=startName;this.closeName=closeName;this.children=children;this.sourceSpan=sourceSpan;this.startSourceSpan=startSourceSpan;this.endSourceSpan=endSourceSpan}visit(visitor,context){return visitor.visitBlockPlaceholder(this,context)}}class CloneVisitor{visitText(text,context){return new Text$2(text.value,text.sourceSpan)}visitContainer(container,context){const children=container.children.map((n=>n.visit(this,context)));return new Container(children,container.sourceSpan)}visitIcu(icu,context){const cases={};Object.keys(icu.cases).forEach((key=>cases[key]=icu.cases[key].visit(this,context)));const msg=new Icu(icu.expression,icu.type,cases,icu.sourceSpan,icu.expressionPlaceholder);return msg}visitTagPlaceholder(ph,context){const children=ph.children.map((n=>n.visit(this,context)));return new TagPlaceholder(ph.tag,ph.attrs,ph.startName,ph.closeName,children,ph.isVoid,ph.sourceSpan,ph.startSourceSpan,ph.endSourceSpan)}visitPlaceholder(ph,context){return new Placeholder(ph.value,ph.name,ph.sourceSpan)}visitIcuPlaceholder(ph,context){return new IcuPlaceholder(ph.value,ph.name,ph.sourceSpan)}visitBlockPlaceholder(ph,context){const children=ph.children.map((n=>n.visit(this,context)));return new BlockPlaceholder(ph.name,ph.parameters,ph.startName,ph.closeName,children,ph.sourceSpan,ph.startSourceSpan,ph.endSourceSpan)}}class RecurseVisitor{visitText(text,context){}visitContainer(container,context){container.children.forEach((child=>child.visit(this)))}visitIcu(icu,context){Object.keys(icu.cases).forEach((k=>{icu.cases[k].visit(this)}))}visitTagPlaceholder(ph,context){ph.children.forEach((child=>child.visit(this)))}visitPlaceholder(ph,context){}visitIcuPlaceholder(ph,context){}visitBlockPlaceholder(ph,context){ph.children.forEach((child=>child.visit(this)))}}function serializeMessage(messageNodes){const visitor=new LocalizeMessageStringVisitor;const str=messageNodes.map((n=>n.visit(visitor))).join("");return str}class LocalizeMessageStringVisitor{visitText(text){return text.value}visitContainer(container){return container.children.map((child=>child.visit(this))).join("")}visitIcu(icu){const strCases=Object.keys(icu.cases).map((k=>`${k} {${icu.cases[k].visit(this)}}`));return`{${icu.expressionPlaceholder}, ${icu.type}, ${strCases.join(" ")}}`}visitTagPlaceholder(ph){const children=ph.children.map((child=>child.visit(this))).join("");return`{$${ph.startName}}${children}{$${ph.closeName}}`}visitPlaceholder(ph){return`{$${ph.name}}`}visitIcuPlaceholder(ph){return`{$${ph.name}}`}visitBlockPlaceholder(ph){const children=ph.children.map((child=>child.visit(this))).join("");return`{$${ph.startName}}${children}{$${ph.closeName}}`}}class Serializer{createNameMapper(message){return null}}class SimplePlaceholderMapper extends RecurseVisitor{constructor(message,mapName){super();this.mapName=mapName;this.internalToPublic={};this.publicToNextId={};this.publicToInternal={};message.nodes.forEach((node=>node.visit(this)))}toPublicName(internalName){return this.internalToPublic.hasOwnProperty(internalName)?this.internalToPublic[internalName]:null}toInternalName(publicName){return this.publicToInternal.hasOwnProperty(publicName)?this.publicToInternal[publicName]:null}visitText(text,context){return null}visitTagPlaceholder(ph,context){this.visitPlaceholderName(ph.startName);super.visitTagPlaceholder(ph,context);this.visitPlaceholderName(ph.closeName)}visitPlaceholder(ph,context){this.visitPlaceholderName(ph.name)}visitBlockPlaceholder(ph,context){this.visitPlaceholderName(ph.startName);super.visitBlockPlaceholder(ph,context);this.visitPlaceholderName(ph.closeName)}visitIcuPlaceholder(ph,context){this.visitPlaceholderName(ph.name)}visitPlaceholderName(internalName){if(!internalName||this.internalToPublic.hasOwnProperty(internalName)){return}let publicName=this.mapName(internalName);if(this.publicToInternal.hasOwnProperty(publicName)){const nextId=this.publicToNextId[publicName];this.publicToNextId[publicName]=nextId+1;publicName=`${publicName}_${nextId}`}else{this.publicToNextId[publicName]=1}this.internalToPublic[internalName]=publicName;this.publicToInternal[publicName]=internalName}}class _Visitor$2{visitTag(tag){const strAttrs=this._serializeAttributes(tag.attrs);if(tag.children.length==0){return`<${tag.name}${strAttrs}/>`}const strChildren=tag.children.map((node=>node.visit(this)));return`<${tag.name}${strAttrs}>${strChildren.join("")}</${tag.name}>`}visitText(text){return text.value}visitDeclaration(decl){return`<?xml${this._serializeAttributes(decl.attrs)} ?>`}_serializeAttributes(attrs){const strAttrs=Object.keys(attrs).map((name=>`${name}="${attrs[name]}"`)).join(" ");return strAttrs.length>0?" "+strAttrs:""}visitDoctype(doctype){return`<!DOCTYPE ${doctype.rootTag} [\n${doctype.dtd}\n]>`}}const _visitor=new _Visitor$2;function serialize(nodes){return nodes.map((node=>node.visit(_visitor))).join("")}class Declaration{constructor(unescapedAttrs){this.attrs={};Object.keys(unescapedAttrs).forEach((k=>{this.attrs[k]=escapeXml(unescapedAttrs[k])}))}visit(visitor){return visitor.visitDeclaration(this)}}class Doctype{constructor(rootTag,dtd){this.rootTag=rootTag;this.dtd=dtd}visit(visitor){return visitor.visitDoctype(this)}}class Tag{constructor(name,unescapedAttrs={},children=[]){this.name=name;this.children=children;this.attrs={};Object.keys(unescapedAttrs).forEach((k=>{this.attrs[k]=escapeXml(unescapedAttrs[k])}))}visit(visitor){return visitor.visitTag(this)}}class Text$1{constructor(unescapedValue){this.value=escapeXml(unescapedValue)}visit(visitor){return visitor.visitText(this)}}class CR extends Text$1{constructor(ws=0){super(`\n${new Array(ws+1).join(" ")}`)}}const _ESCAPED_CHARS=[[/&/g,"&"],[/"/g,"""],[/'/g,"'"],[/</g,"<"],[/>/g,">"]];function escapeXml(text){return _ESCAPED_CHARS.reduce(((text,entry)=>text.replace(entry[0],entry[1])),text)}const _MESSAGES_TAG="messagebundle";const _MESSAGE_TAG="msg";const _PLACEHOLDER_TAG$3="ph";const _EXAMPLE_TAG="ex";const _SOURCE_TAG$2="source";const _DOCTYPE=`<!ELEMENT messagebundle (msg)*>\n<!ATTLIST messagebundle class CDATA #IMPLIED>\n\n<!ELEMENT msg (#PCDATA|ph|source)*>\n<!ATTLIST msg id CDATA #IMPLIED>\n<!ATTLIST msg seq CDATA #IMPLIED>\n<!ATTLIST msg name CDATA #IMPLIED>\n<!ATTLIST msg desc CDATA #IMPLIED>\n<!ATTLIST msg meaning CDATA #IMPLIED>\n<!ATTLIST msg obsolete (obsolete) #IMPLIED>\n<!ATTLIST msg xml:space (default|preserve) "default">\n<!ATTLIST msg is_hidden CDATA #IMPLIED>\n\n<!ELEMENT source (#PCDATA)>\n\n<!ELEMENT ph (#PCDATA|ex)*>\n<!ATTLIST ph name CDATA #REQUIRED>\n\n<!ELEMENT ex (#PCDATA)>`;class Xmb extends Serializer{write(messages,locale){const exampleVisitor=new ExampleVisitor;const visitor=new _Visitor$1;let rootNode=new Tag(_MESSAGES_TAG);messages.forEach((message=>{const attrs={id:message.id};if(message.description){attrs["desc"]=message.description}if(message.meaning){attrs["meaning"]=message.meaning}let sourceTags=[];message.sources.forEach((source=>{sourceTags.push(new Tag(_SOURCE_TAG$2,{},[new Text$1(`${source.filePath}:${source.startLine}${source.endLine!==source.startLine?","+source.endLine:""}`)]))}));rootNode.children.push(new CR(2),new Tag(_MESSAGE_TAG,attrs,[...sourceTags,...visitor.serialize(message.nodes)]))}));rootNode.children.push(new CR);return serialize([new Declaration({version:"1.0",encoding:"UTF-8"}),new CR,new Doctype(_MESSAGES_TAG,_DOCTYPE),new CR,exampleVisitor.addDefaultExamples(rootNode),new CR])}load(content,url){throw new Error("Unsupported")}digest(message){return digest(message)}createNameMapper(message){return new SimplePlaceholderMapper(message,toPublicName)}}class _Visitor$1{visitText(text,context){return[new Text$1(text.value)]}visitContainer(container,context){const nodes=[];container.children.forEach((node=>nodes.push(...node.visit(this))));return nodes}visitIcu(icu,context){const nodes=[new Text$1(`{${icu.expressionPlaceholder}, ${icu.type}, `)];Object.keys(icu.cases).forEach((c=>{nodes.push(new Text$1(`${c} {`),...icu.cases[c].visit(this),new Text$1(`} `))}));nodes.push(new Text$1(`}`));return nodes}visitTagPlaceholder(ph,context){const startTagAsText=new Text$1(`<${ph.tag}>`);const startEx=new Tag(_EXAMPLE_TAG,{},[startTagAsText]);const startTagPh=new Tag(_PLACEHOLDER_TAG$3,{name:ph.startName},[startEx,startTagAsText]);if(ph.isVoid){return[startTagPh]}const closeTagAsText=new Text$1(`</${ph.tag}>`);const closeEx=new Tag(_EXAMPLE_TAG,{},[closeTagAsText]);const closeTagPh=new Tag(_PLACEHOLDER_TAG$3,{name:ph.closeName},[closeEx,closeTagAsText]);return[startTagPh,...this.serialize(ph.children),closeTagPh]}visitPlaceholder(ph,context){const interpolationAsText=new Text$1(`{{${ph.value}}}`);const exTag=new Tag(_EXAMPLE_TAG,{},[interpolationAsText]);return[new Tag(_PLACEHOLDER_TAG$3,{name:ph.name},[exTag,interpolationAsText])]}visitBlockPlaceholder(ph,context){const startAsText=new Text$1(`@${ph.name}`);const startEx=new Tag(_EXAMPLE_TAG,{},[startAsText]);const startTagPh=new Tag(_PLACEHOLDER_TAG$3,{name:ph.startName},[startEx,startAsText]);const closeAsText=new Text$1(`}`);const closeEx=new Tag(_EXAMPLE_TAG,{},[closeAsText]);const closeTagPh=new Tag(_PLACEHOLDER_TAG$3,{name:ph.closeName},[closeEx,closeAsText]);return[startTagPh,...this.serialize(ph.children),closeTagPh]}visitIcuPlaceholder(ph,context){const icuExpression=ph.value.expression;const icuType=ph.value.type;const icuCases=Object.keys(ph.value.cases).map((value=>value+" {...}")).join(" ");const icuAsText=new Text$1(`{${icuExpression}, ${icuType}, ${icuCases}}`);const exTag=new Tag(_EXAMPLE_TAG,{},[icuAsText]);return[new Tag(_PLACEHOLDER_TAG$3,{name:ph.name},[exTag,icuAsText])]}serialize(nodes){return[].concat(...nodes.map((node=>node.visit(this))))}}function digest(message){return decimalDigest(message)}class ExampleVisitor{addDefaultExamples(node){node.visit(this);return node}visitTag(tag){if(tag.name===_PLACEHOLDER_TAG$3){if(!tag.children||tag.children.length==0){const exText=new Text$1(tag.attrs["name"]||"...");tag.children=[new Tag(_EXAMPLE_TAG,{},[exText])]}}else if(tag.children){tag.children.forEach((node=>node.visit(this)))}}visitText(text){}visitDeclaration(decl){}visitDoctype(doctype){}}function toPublicName(internalName){return internalName.toUpperCase().replace(/[^A-Z0-9_]/g,"_")}const CLOSURE_TRANSLATION_VAR_PREFIX="MSG_";const TRANSLATION_VAR_PREFIX$1="i18n_";const I18N_ATTR="i18n";const I18N_ATTR_PREFIX="i18n-";const I18N_ICU_VAR_PREFIX="VAR_";const I18N_ICU_MAPPING_PREFIX$1="I18N_EXP_";const I18N_PLACEHOLDER_SYMBOL="\ufffd";function isI18nAttribute(name){return name===I18N_ATTR||name.startsWith(I18N_ATTR_PREFIX)}function isI18nRootNode(meta){return meta instanceof Message}function isSingleI18nIcu(meta){return isI18nRootNode(meta)&&meta.nodes.length===1&&meta.nodes[0]instanceof Icu}function hasI18nMeta(node){return!!node.i18n}function hasI18nAttrs(element){return element.attrs.some((attr=>isI18nAttribute(attr.name)))}function icuFromI18nMessage(message){return message.nodes[0]}function wrapI18nPlaceholder(content,contextId=0){const blockId=contextId>0?`:${contextId}`:"";return`${I18N_PLACEHOLDER_SYMBOL}${content}${blockId}${I18N_PLACEHOLDER_SYMBOL}`}function assembleI18nBoundString(strings,bindingStartIndex=0,contextId=0){if(!strings.length)return"";let acc="";const lastIdx=strings.length-1;for(let i=0;i<lastIdx;i++){acc+=`${strings[i]}${wrapI18nPlaceholder(bindingStartIndex+i,contextId)}`}acc+=strings[lastIdx];return acc}function getSeqNumberGenerator(startsAt=0){let current=startsAt;return()=>current++}function placeholdersToParams(placeholders){const params={};placeholders.forEach(((values,key)=>{params[key]=literal(values.length>1?`[${values.join("|")}]`:values[0])}));return params}function updatePlaceholderMap(map,name,...values){const current=map.get(name)||[];current.push(...values);map.set(name,current)}function assembleBoundTextPlaceholders(meta,bindingStartIndex=0,contextId=0){const startIdx=bindingStartIndex;const placeholders=new Map;const node=meta instanceof Message?meta.nodes.find((node=>node instanceof Container)):meta;if(node){node.children.filter((child=>child instanceof Placeholder)).forEach(((child,idx)=>{const content=wrapI18nPlaceholder(startIdx+idx,contextId);updatePlaceholderMap(placeholders,child.name,content)}))}return placeholders}function formatI18nPlaceholderNamesInMap(params={},useCamelCase){const _params={};if(params&&Object.keys(params).length){Object.keys(params).forEach((key=>_params[formatI18nPlaceholderName(key,useCamelCase)]=params[key]))}return _params}function formatI18nPlaceholderName(name,useCamelCase=true){const publicName=toPublicName(name);if(!useCamelCase){return publicName}const chunks=publicName.split("_");if(chunks.length===1){return name.toLowerCase()}let postfix;if(/^\d+$/.test(chunks[chunks.length-1])){postfix=chunks.pop()}let raw=chunks.shift().toLowerCase();if(chunks.length){raw+=chunks.map((c=>c.charAt(0).toUpperCase()+c.slice(1).toLowerCase())).join("")}return postfix?`${raw}_${postfix}`:raw}function getTranslationConstPrefix(extra){return`${CLOSURE_TRANSLATION_VAR_PREFIX}${extra}`.toUpperCase()}function declareI18nVariable(variable){return new DeclareVarStmt(variable.name,undefined,INFERRED_TYPE,undefined,variable.sourceSpan)}const UNSAFE_OBJECT_KEY_NAME_REGEXP=/[-.]/;const TEMPORARY_NAME="_t";const CONTEXT_NAME="ctx";const RENDER_FLAGS="rf";const REFERENCE_PREFIX="_r";const IMPLICIT_REFERENCE="$implicit";const NON_BINDABLE_ATTR="ngNonBindable";const RESTORED_VIEW_CONTEXT_NAME="restoredCtx";const DIRECT_CONTEXT_REFERENCE="#context";const MAX_CHAIN_LENGTH=500;const CHAINABLE_INSTRUCTIONS=new Set([Identifiers.element,Identifiers.elementStart,Identifiers.elementEnd,Identifiers.elementContainer,Identifiers.elementContainerStart,Identifiers.elementContainerEnd,Identifiers.i18nExp,Identifiers.listener,Identifiers.classProp,Identifiers.syntheticHostListener,Identifiers.hostProperty,Identifiers.syntheticHostProperty,Identifiers.property,Identifiers.propertyInterpolate1,Identifiers.propertyInterpolate2,Identifiers.propertyInterpolate3,Identifiers.propertyInterpolate4,Identifiers.propertyInterpolate5,Identifiers.propertyInterpolate6,Identifiers.propertyInterpolate7,Identifiers.propertyInterpolate8,Identifiers.propertyInterpolateV,Identifiers.attribute,Identifiers.attributeInterpolate1,Identifiers.attributeInterpolate2,Identifiers.attributeInterpolate3,Identifiers.attributeInterpolate4,Identifiers.attributeInterpolate5,Identifiers.attributeInterpolate6,Identifiers.attributeInterpolate7,Identifiers.attributeInterpolate8,Identifiers.attributeInterpolateV,Identifiers.styleProp,Identifiers.stylePropInterpolate1,Identifiers.stylePropInterpolate2,Identifiers.stylePropInterpolate3,Identifiers.stylePropInterpolate4,Identifiers.stylePropInterpolate5,Identifiers.stylePropInterpolate6,Identifiers.stylePropInterpolate7,Identifiers.stylePropInterpolate8,Identifiers.stylePropInterpolateV,Identifiers.textInterpolate,Identifiers.textInterpolate1,Identifiers.textInterpolate2,Identifiers.textInterpolate3,Identifiers.textInterpolate4,Identifiers.textInterpolate5,Identifiers.textInterpolate6,Identifiers.textInterpolate7,Identifiers.textInterpolate8,Identifiers.textInterpolateV,Identifiers.templateCreate,Identifiers.twoWayProperty,Identifiers.twoWayListener]);function invokeInstruction(span,reference,params){return importExpr(reference,null,span).callFn(params,span)}function temporaryAllocator(pushStatement,name){let temp=null;return()=>{if(!temp){pushStatement(new DeclareVarStmt(TEMPORARY_NAME,undefined,DYNAMIC_TYPE));temp=variable(name)}return temp}}function invalid(arg){throw new Error(`Invalid state: Visitor ${this.constructor.name} doesn't handle ${arg.constructor.name}`)}function asLiteral(value){if(Array.isArray(value)){return literalArr(value.map(asLiteral))}return literal(value,INFERRED_TYPE)}function conditionallyCreateDirectiveBindingLiteral(map,forInputs){const keys=Object.getOwnPropertyNames(map);if(keys.length===0){return null}return literalMap(keys.map((key=>{const value=map[key];let declaredName;let publicName;let minifiedName;let expressionValue;if(typeof value==="string"){declaredName=key;minifiedName=key;publicName=value;expressionValue=asLiteral(publicName)}else{minifiedName=key;declaredName=value.classPropertyName;publicName=value.bindingPropertyName;const differentDeclaringName=publicName!==declaredName;const hasDecoratorInputTransform=value.transformFunction!==null;let flags=null;if(value.isSignal){flags=bitwiseOrInputFlagsExpr(InputFlags.SignalBased,flags)}if(hasDecoratorInputTransform){flags=bitwiseOrInputFlagsExpr(InputFlags.HasDecoratorInputTransform,flags)}if(forInputs&&(differentDeclaringName||hasDecoratorInputTransform||flags!==null)){const flagsExpr=flags??importExpr(Identifiers.InputFlags).prop(InputFlags[InputFlags.None]);const result=[flagsExpr,asLiteral(publicName)];if(differentDeclaringName||hasDecoratorInputTransform){result.push(asLiteral(declaredName));if(hasDecoratorInputTransform){result.push(value.transformFunction)}}expressionValue=literalArr(result)}else{expressionValue=asLiteral(publicName)}}return{key:minifiedName,quoted:UNSAFE_OBJECT_KEY_NAME_REGEXP.test(minifiedName),value:expressionValue}})))}function getInputFlagExpr(flag){return importExpr(Identifiers.InputFlags).prop(InputFlags[flag])}function bitwiseOrInputFlagsExpr(flag,expr){if(expr===null){return getInputFlagExpr(flag)}return getInputFlagExpr(flag).bitwiseOr(expr)}function trimTrailingNulls(parameters){while(isNull(parameters[parameters.length-1])){parameters.pop()}return parameters}class DefinitionMap{constructor(){this.values=[]}set(key,value){if(value){const existing=this.values.find((value=>value.key===key));if(existing){existing.value=value}else{this.values.push({key:key,value:value,quoted:false})}}}toLiteralMap(){return literalMap(this.values)}}function createCssSelectorFromNode(node){const elementName=node instanceof Element$1?node.name:"ng-template";const attributes=getAttrsForDirectiveMatching(node);const cssSelector=new CssSelector;const elementNameNoNs=splitNsName(elementName)[1];cssSelector.setElement(elementNameNoNs);Object.getOwnPropertyNames(attributes).forEach((name=>{const nameNoNs=splitNsName(name)[1];const value=attributes[name];cssSelector.addAttribute(nameNoNs,value);if(name.toLowerCase()==="class"){const classes=value.trim().split(/\s+/);classes.forEach((className=>cssSelector.addClassName(className)))}}));return cssSelector}function getAttrsForDirectiveMatching(elOrTpl){const attributesMap={};if(elOrTpl instanceof Template&&elOrTpl.tagName!=="ng-template"){elOrTpl.templateAttrs.forEach((a=>attributesMap[a.name]=""))}else{elOrTpl.attributes.forEach((a=>{if(!isI18nAttribute(a.name)){attributesMap[a.name]=a.value}}));elOrTpl.inputs.forEach((i=>{if(i.type===0||i.type===5){attributesMap[i.name]=""}}));elOrTpl.outputs.forEach((o=>{attributesMap[o.name]=""}))}return attributesMap}function getInterpolationArgsLength(interpolation){const{expressions:expressions,strings:strings}=interpolation;if(expressions.length===1&&strings.length===2&&strings[0]===""&&strings[1]===""){return 1}else{return expressions.length+strings.length}}function getInstructionStatements(instructions){const statements=[];let pendingExpression=null;let pendingExpressionType=null;let chainLength=0;for(const current of instructions){const resolvedParams=(typeof current.paramsOrFn==="function"?current.paramsOrFn():current.paramsOrFn)??[];const params=Array.isArray(resolvedParams)?resolvedParams:[resolvedParams];if(chainLength<MAX_CHAIN_LENGTH&&pendingExpressionType===current.reference&&CHAINABLE_INSTRUCTIONS.has(pendingExpressionType)){pendingExpression=pendingExpression.callFn(params,pendingExpression.sourceSpan);chainLength++}else{if(pendingExpression!==null){statements.push(pendingExpression.toStmt())}pendingExpression=invokeInstruction(current.span,current.reference,params);pendingExpressionType=current.reference;chainLength=0}}if(pendingExpression!==null){statements.push(pendingExpression.toStmt())}return statements}function compileInjectable(meta,resolveForwardRefs){let result=null;const factoryMeta={name:meta.name,type:meta.type,typeArgumentCount:meta.typeArgumentCount,deps:[],target:exports.FactoryTarget.Injectable};if(meta.useClass!==undefined){const useClassOnSelf=meta.useClass.expression.isEquivalent(meta.type.value);let deps=undefined;if(meta.deps!==undefined){deps=meta.deps}if(deps!==undefined){result=compileFactoryFunction({...factoryMeta,delegate:meta.useClass.expression,delegateDeps:deps,delegateType:R3FactoryDelegateType.Class})}else if(useClassOnSelf){result=compileFactoryFunction(factoryMeta)}else{result={statements:[],expression:delegateToFactory(meta.type.value,meta.useClass.expression,resolveForwardRefs)}}}else if(meta.useFactory!==undefined){if(meta.deps!==undefined){result=compileFactoryFunction({...factoryMeta,delegate:meta.useFactory,delegateDeps:meta.deps||[],delegateType:R3FactoryDelegateType.Function})}else{result={statements:[],expression:arrowFn([],meta.useFactory.callFn([]))}}}else if(meta.useValue!==undefined){result=compileFactoryFunction({...factoryMeta,expression:meta.useValue.expression})}else if(meta.useExisting!==undefined){result=compileFactoryFunction({...factoryMeta,expression:importExpr(Identifiers.inject).callFn([meta.useExisting.expression])})}else{result={statements:[],expression:delegateToFactory(meta.type.value,meta.type.value,resolveForwardRefs)}}const token=meta.type.value;const injectableProps=new DefinitionMap;injectableProps.set("token",token);injectableProps.set("factory",result.expression);if(meta.providedIn.expression.value!==null){injectableProps.set("providedIn",convertFromMaybeForwardRefExpression(meta.providedIn))}const expression=importExpr(Identifiers.\u0275\u0275defineInjectable).callFn([injectableProps.toLiteralMap()],undefined,true);return{expression:expression,type:createInjectableType(meta),statements:result.statements}}function createInjectableType(meta){return new ExpressionType(importExpr(Identifiers.InjectableDeclaration,[typeWithParameters(meta.type.type,meta.typeArgumentCount)]))}function delegateToFactory(type,useType,unwrapForwardRefs){if(type.node===useType.node){return useType.prop("\u0275fac")}if(!unwrapForwardRefs){return createFactoryFunction(useType)}const unwrappedType=importExpr(Identifiers.resolveForwardRef).callFn([useType]);return createFactoryFunction(unwrappedType)}function createFactoryFunction(type){return arrowFn([new FnParam("t",DYNAMIC_TYPE)],type.prop("\u0275fac").callFn([variable("t")]))}const UNUSABLE_INTERPOLATION_REGEXPS=[/^\s*$/,/[<>]/,/^[{}]$/,/&(#|[a-z])/i,/^\/\//];function assertInterpolationSymbols(identifier,value){if(value!=null&&!(Array.isArray(value)&&value.length==2)){throw new Error(`Expected '${identifier}' to be an array, [start, end].`)}else if(value!=null){const start=value[0];const end=value[1];UNUSABLE_INTERPOLATION_REGEXPS.forEach((regexp=>{if(regexp.test(start)||regexp.test(end)){throw new Error(`['${start}', '${end}'] contains unusable interpolation symbol.`)}}))}}class InterpolationConfig{static fromArray(markers){if(!markers){return DEFAULT_INTERPOLATION_CONFIG}assertInterpolationSymbols("interpolation",markers);return new InterpolationConfig(markers[0],markers[1])}constructor(start,end){this.start=start;this.end=end}}const DEFAULT_INTERPOLATION_CONFIG=new InterpolationConfig("{{","}}");const DEFAULT_CONTAINER_BLOCKS=new Set(["switch"]);const $EOF=0;const $BSPACE=8;const $TAB=9;const $LF=10;const $VTAB=11;const $FF=12;const $CR=13;const $SPACE=32;const $BANG=33;const $DQ=34;const $HASH=35;const $$=36;const $PERCENT=37;const $AMPERSAND=38;const $SQ=39;const $LPAREN=40;const $RPAREN=41;const $STAR=42;const $PLUS=43;const $COMMA=44;const $MINUS=45;const $PERIOD=46;const $SLASH=47;const $COLON=58;const $SEMICOLON=59;const $LT=60;const $EQ=61;const $GT=62;const $QUESTION=63;const $0=48;const $7=55;const $9=57;const $A=65;const $E=69;const $F=70;const $X=88;const $Z=90;const $LBRACKET=91;const $BACKSLASH=92;const $RBRACKET=93;const $CARET=94;const $_=95;const $a=97;const $b=98;const $e=101;const $f=102;const $n=110;const $r=114;const $t=116;const $u=117;const $v=118;const $x=120;const $z=122;const $LBRACE=123;const $BAR=124;const $RBRACE=125;const $NBSP=160;const $AT=64;const $BT=96;function isWhitespace(code){return code>=$TAB&&code<=$SPACE||code==$NBSP}function isDigit(code){return $0<=code&&code<=$9}function isAsciiLetter(code){return code>=$a&&code<=$z||code>=$A&&code<=$Z}function isAsciiHexDigit(code){return code>=$a&&code<=$f||code>=$A&&code<=$F||isDigit(code)}function isNewLine(code){return code===$LF||code===$CR}function isOctalDigit(code){return $0<=code&&code<=$7}function isQuote(code){return code===$SQ||code===$DQ||code===$BT}class ParseLocation{constructor(file,offset,line,col){this.file=file;this.offset=offset;this.line=line;this.col=col}toString(){return this.offset!=null?`${this.file.url}@${this.line}:${this.col}`:this.file.url}moveBy(delta){const source=this.file.content;const len=source.length;let offset=this.offset;let line=this.line;let col=this.col;while(offset>0&&delta<0){offset--;delta++;const ch=source.charCodeAt(offset);if(ch==$LF){line--;const priorLine=source.substring(0,offset-1).lastIndexOf(String.fromCharCode($LF));col=priorLine>0?offset-priorLine:offset}else{col--}}while(offset<len&&delta>0){const ch=source.charCodeAt(offset);offset++;delta--;if(ch==$LF){line++;col=0}else{col++}}return new ParseLocation(this.file,offset,line,col)}getContext(maxChars,maxLines){const content=this.file.content;let startOffset=this.offset;if(startOffset!=null){if(startOffset>content.length-1){startOffset=content.length-1}let endOffset=startOffset;let ctxChars=0;let ctxLines=0;while(ctxChars<maxChars&&startOffset>0){startOffset--;ctxChars++;if(content[startOffset]=="\n"){if(++ctxLines==maxLines){break}}}ctxChars=0;ctxLines=0;while(ctxChars<maxChars&&endOffset<content.length-1){endOffset++;ctxChars++;if(content[endOffset]=="\n"){if(++ctxLines==maxLines){break}}}return{before:content.substring(startOffset,this.offset),after:content.substring(this.offset,endOffset+1)}}return null}}class ParseSourceFile{constructor(content,url){this.content=content;this.url=url}}class ParseSourceSpan{constructor(start,end,fullStart=start,details=null){this.start=start;this.end=end;this.fullStart=fullStart;this.details=details}toString(){return this.start.file.content.substring(this.start.offset,this.end.offset)}}exports.ParseErrorLevel=void 0;(function(ParseErrorLevel){ParseErrorLevel[ParseErrorLevel["WARNING"]=0]="WARNING";ParseErrorLevel[ParseErrorLevel["ERROR"]=1]="ERROR"})(exports.ParseErrorLevel||(exports.ParseErrorLevel={}));class ParseError{constructor(span,msg,level=exports.ParseErrorLevel.ERROR){this.span=span;this.msg=msg;this.level=level}contextualMessage(){const ctx=this.span.start.getContext(100,3);return ctx?`${this.msg} ("${ctx.before}[${exports.ParseErrorLevel[this.level]} ->]${ctx.after}")`:this.msg}toString(){const details=this.span.details?`, ${this.span.details}`:"";return`${this.contextualMessage()}: ${this.span.start}${details}`}}function r3JitTypeSourceSpan(kind,typeName,sourceUrl){const sourceFileName=`in ${kind} ${typeName} in ${sourceUrl}`;const sourceFile=new ParseSourceFile("",sourceFileName);return new ParseSourceSpan(new ParseLocation(sourceFile,-1,-1,-1),new ParseLocation(sourceFile,-1,-1,-1))}let _anonymousTypeIndex=0;function identifierName(compileIdentifier){if(!compileIdentifier||!compileIdentifier.reference){return null}const ref=compileIdentifier.reference;if(ref["__anonymousType"]){return ref["__anonymousType"]}if(ref["__forward_ref__"]){return"__forward_ref__"}let identifier=stringify(ref);if(identifier.indexOf("(")>=0){identifier=`anonymous_${_anonymousTypeIndex++}`;ref["__anonymousType"]=identifier}else{identifier=sanitizeIdentifier(identifier)}return identifier}function sanitizeIdentifier(name){return name.replace(/\W/g,"_")}const makeTemplateObjectPolyfill='(this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e})';class AbstractJsEmitterVisitor extends AbstractEmitterVisitor{constructor(){super(false)}visitWrappedNodeExpr(ast,ctx){throw new Error("Cannot emit a WrappedNodeExpr in Javascript.")}visitDeclareVarStmt(stmt,ctx){ctx.print(stmt,`var ${stmt.name}`);if(stmt.value){ctx.print(stmt," = ");stmt.value.visitExpression(this,ctx)}ctx.println(stmt,`;`);return null}visitTaggedTemplateExpr(ast,ctx){const elements=ast.template.elements;ast.tag.visitExpression(this,ctx);ctx.print(ast,`(${makeTemplateObjectPolyfill}(`);ctx.print(ast,`[${elements.map((part=>escapeIdentifier(part.text,false))).join(", ")}], `);ctx.print(ast,`[${elements.map((part=>escapeIdentifier(part.rawText,false))).join(", ")}])`);ast.template.expressions.forEach((expression=>{ctx.print(ast,", ");expression.visitExpression(this,ctx)}));ctx.print(ast,")");return null}visitFunctionExpr(ast,ctx){ctx.print(ast,`function${ast.name?" "+ast.name:""}(`);this._visitParams(ast.params,ctx);ctx.println(ast,`) {`);ctx.incIndent();this.visitAllStatements(ast.statements,ctx);ctx.decIndent();ctx.print(ast,`}`);return null}visitArrowFunctionExpr(ast,ctx){ctx.print(ast,"(");this._visitParams(ast.params,ctx);ctx.print(ast,") =>");if(Array.isArray(ast.body)){ctx.println(ast,`{`);ctx.incIndent();this.visitAllStatements(ast.body,ctx);ctx.decIndent();ctx.print(ast,`}`)}else{const isObjectLiteral=ast.body instanceof LiteralMapExpr;if(isObjectLiteral){ctx.print(ast,"(")}ast.body.visitExpression(this,ctx);if(isObjectLiteral){ctx.print(ast,")")}}return null}visitDeclareFunctionStmt(stmt,ctx){ctx.print(stmt,`function ${stmt.name}(`);this._visitParams(stmt.params,ctx);ctx.println(stmt,`) {`);ctx.incIndent();this.visitAllStatements(stmt.statements,ctx);ctx.decIndent();ctx.println(stmt,`}`);return null}visitLocalizedString(ast,ctx){ctx.print(ast,`$localize(${makeTemplateObjectPolyfill}(`);const parts=[ast.serializeI18nHead()];for(let i=1;i<ast.messageParts.length;i++){parts.push(ast.serializeI18nTemplatePart(i))}ctx.print(ast,`[${parts.map((part=>escapeIdentifier(part.cooked,false))).join(", ")}], `);ctx.print(ast,`[${parts.map((part=>escapeIdentifier(part.raw,false))).join(", ")}])`);ast.expressions.forEach((expression=>{ctx.print(ast,", ");expression.visitExpression(this,ctx)}));ctx.print(ast,")");return null}_visitParams(params,ctx){this.visitAllObjects((param=>ctx.print(null,param.name)),params,ctx,",")}}function trustedScriptFromString(script){return script}function newTrustedFunctionForJIT(...args){if(!_global["trustedTypes"]){return new Function(...args)}const fnArgs=args.slice(0,-1).join(",");const fnBody=args[args.length-1];const body=`(function anonymous(${fnArgs}\n) { ${fnBody}\n})`;const fn=_global["eval"](trustedScriptFromString(body));if(fn.bind===undefined){return new Function(...args)}fn.toString=()=>body;return fn.bind(_global)}class JitEvaluator{evaluateStatements(sourceUrl,statements,refResolver,createSourceMaps){const converter=new JitEmitterVisitor(refResolver);const ctx=EmitterVisitorContext.createRoot();if(statements.length>0&&!isUseStrictStatement(statements[0])){statements=[literal("use strict").toStmt(),...statements]}converter.visitAllStatements(statements,ctx);converter.createReturnStmt(ctx);return this.evaluateCode(sourceUrl,ctx,converter.getArgs(),createSourceMaps)}evaluateCode(sourceUrl,ctx,vars,createSourceMap){let fnBody=`"use strict";${ctx.toSource()}\n//# sourceURL=${sourceUrl}`;const fnArgNames=[];const fnArgValues=[];for(const argName in vars){fnArgValues.push(vars[argName]);fnArgNames.push(argName)}if(createSourceMap){const emptyFn=newTrustedFunctionForJIT(...fnArgNames.concat("return null;")).toString();const headerLines=emptyFn.slice(0,emptyFn.indexOf("return null;")).split("\n").length-1;fnBody+=`\n${ctx.toSourceMapGenerator(sourceUrl,headerLines).toJsComment()}`}const fn=newTrustedFunctionForJIT(...fnArgNames.concat(fnBody));return this.executeFunction(fn,fnArgValues)}executeFunction(fn,args){return fn(...args)}}class JitEmitterVisitor extends AbstractJsEmitterVisitor{constructor(refResolver){super();this.refResolver=refResolver;this._evalArgNames=[];this._evalArgValues=[];this._evalExportedVars=[]}createReturnStmt(ctx){const stmt=new ReturnStatement(new LiteralMapExpr(this._evalExportedVars.map((resultVar=>new LiteralMapEntry(resultVar,variable(resultVar),false)))));stmt.visitStatement(this,ctx)}getArgs(){const result={};for(let i=0;i<this._evalArgNames.length;i++){result[this._evalArgNames[i]]=this._evalArgValues[i]}return result}visitExternalExpr(ast,ctx){this._emitReferenceToExternal(ast,this.refResolver.resolveExternalReference(ast.value),ctx);return null}visitWrappedNodeExpr(ast,ctx){this._emitReferenceToExternal(ast,ast.node,ctx);return null}visitDeclareVarStmt(stmt,ctx){if(stmt.hasModifier(exports.StmtModifier.Exported)){this._evalExportedVars.push(stmt.name)}return super.visitDeclareVarStmt(stmt,ctx)}visitDeclareFunctionStmt(stmt,ctx){if(stmt.hasModifier(exports.StmtModifier.Exported)){this._evalExportedVars.push(stmt.name)}return super.visitDeclareFunctionStmt(stmt,ctx)}_emitReferenceToExternal(ast,value,ctx){let id=this._evalArgValues.indexOf(value);if(id===-1){id=this._evalArgValues.length;this._evalArgValues.push(value);const name=identifierName({reference:value})||"val";this._evalArgNames.push(`jit_${name}_${id}`)}ctx.print(ast,this._evalArgNames[id])}}function isUseStrictStatement(statement){return statement.isEquivalent(literal("use strict").toStmt())}function compileInjector(meta){const definitionMap=new DefinitionMap;if(meta.providers!==null){definitionMap.set("providers",meta.providers)}if(meta.imports.length>0){definitionMap.set("imports",literalArr(meta.imports))}const expression=importExpr(Identifiers.defineInjector).callFn([definitionMap.toLiteralMap()],undefined,true);const type=createInjectorType(meta);return{expression:expression,type:type,statements:[]}}function createInjectorType(meta){return new ExpressionType(importExpr(Identifiers.InjectorDeclaration,[new ExpressionType(meta.type.type)]))}class R3JitReflector{constructor(context){this.context=context}resolveExternalReference(ref){if(ref.moduleName!=="@angular/core"){throw new Error(`Cannot resolve external reference to ${ref.moduleName}, only references to @angular/core are supported.`)}if(!this.context.hasOwnProperty(ref.name)){throw new Error(`No value provided for @angular/core symbol '${ref.name}'.`)}return this.context[ref.name]}}exports.R3SelectorScopeMode=void 0;(function(R3SelectorScopeMode){R3SelectorScopeMode[R3SelectorScopeMode["Inline"]=0]="Inline";R3SelectorScopeMode[R3SelectorScopeMode["SideEffect"]=1]="SideEffect";R3SelectorScopeMode[R3SelectorScopeMode["Omit"]=2]="Omit"})(exports.R3SelectorScopeMode||(exports.R3SelectorScopeMode={}));exports.R3NgModuleMetadataKind=void 0;(function(R3NgModuleMetadataKind){R3NgModuleMetadataKind[R3NgModuleMetadataKind["Global"]=0]="Global";R3NgModuleMetadataKind[R3NgModuleMetadataKind["Local"]=1]="Local"})(exports.R3NgModuleMetadataKind||(exports.R3NgModuleMetadataKind={}));function compileNgModule(meta){const statements=[];const definitionMap=new DefinitionMap;definitionMap.set("type",meta.type.value);if(meta.kind===exports.R3NgModuleMetadataKind.Global&&meta.bootstrap.length>0){definitionMap.set("bootstrap",refsToArray(meta.bootstrap,meta.containsForwardDecls))}if(meta.selectorScopeMode===exports.R3SelectorScopeMode.Inline){if(meta.declarations.length>0){definitionMap.set("declarations",refsToArray(meta.declarations,meta.containsForwardDecls))}if(meta.imports.length>0){definitionMap.set("imports",refsToArray(meta.imports,meta.containsForwardDecls))}if(meta.exports.length>0){definitionMap.set("exports",refsToArray(meta.exports,meta.containsForwardDecls))}}else if(meta.selectorScopeMode===exports.R3SelectorScopeMode.SideEffect){const setNgModuleScopeCall=generateSetNgModuleScopeCall(meta);if(setNgModuleScopeCall!==null){statements.push(setNgModuleScopeCall)}}else;if(meta.schemas!==null&&meta.schemas.length>0){definitionMap.set("schemas",literalArr(meta.schemas.map((ref=>ref.value))))}if(meta.id!==null){definitionMap.set("id",meta.id);statements.push(importExpr(Identifiers.registerNgModuleType).callFn([meta.type.value,meta.id]).toStmt())}const expression=importExpr(Identifiers.defineNgModule).callFn([definitionMap.toLiteralMap()],undefined,true);const type=createNgModuleType(meta);return{expression:expression,type:type,statements:statements}}function compileNgModuleDeclarationExpression(meta){const definitionMap=new DefinitionMap;definitionMap.set("type",new WrappedNodeExpr(meta.type));if(meta.bootstrap!==undefined){definitionMap.set("bootstrap",new WrappedNodeExpr(meta.bootstrap))}if(meta.declarations!==undefined){definitionMap.set("declarations",new WrappedNodeExpr(meta.declarations))}if(meta.imports!==undefined){definitionMap.set("imports",new WrappedNodeExpr(meta.imports))}if(meta.exports!==undefined){definitionMap.set("exports",new WrappedNodeExpr(meta.exports))}if(meta.schemas!==undefined){definitionMap.set("schemas",new WrappedNodeExpr(meta.schemas))}if(meta.id!==undefined){definitionMap.set("id",new WrappedNodeExpr(meta.id))}return importExpr(Identifiers.defineNgModule).callFn([definitionMap.toLiteralMap()])}function createNgModuleType(meta){if(meta.kind===exports.R3NgModuleMetadataKind.Local){return new ExpressionType(meta.type.value)}const{type:moduleType,declarations:declarations,exports:exports$1,imports:imports,includeImportTypes:includeImportTypes,publicDeclarationTypes:publicDeclarationTypes}=meta;return new ExpressionType(importExpr(Identifiers.NgModuleDeclaration,[new ExpressionType(moduleType.type),publicDeclarationTypes===null?tupleTypeOf(declarations):tupleOfTypes(publicDeclarationTypes),includeImportTypes?tupleTypeOf(imports):NONE_TYPE,tupleTypeOf(exports$1)]))}function generateSetNgModuleScopeCall(meta){const scopeMap=new DefinitionMap;if(meta.kind===exports.R3NgModuleMetadataKind.Global){if(meta.declarations.length>0){scopeMap.set("declarations",refsToArray(meta.declarations,meta.containsForwardDecls))}}else{if(meta.declarationsExpression){scopeMap.set("declarations",meta.declarationsExpression)}}if(meta.kind===exports.R3NgModuleMetadataKind.Global){if(meta.imports.length>0){scopeMap.set("imports",refsToArray(meta.imports,meta.containsForwardDecls))}}else{if(meta.importsExpression){scopeMap.set("imports",meta.importsExpression)}}if(meta.kind===exports.R3NgModuleMetadataKind.Global){if(meta.exports.length>0){scopeMap.set("exports",refsToArray(meta.exports,meta.containsForwardDecls))}}else{if(meta.exportsExpression){scopeMap.set("exports",meta.exportsExpression)}}if(meta.kind===exports.R3NgModuleMetadataKind.Local&&meta.bootstrapExpression){scopeMap.set("bootstrap",meta.bootstrapExpression)}if(Object.keys(scopeMap.values).length===0){return null}const fnCall=new InvokeFunctionExpr(importExpr(Identifiers.setNgModuleScope),[meta.type.value,scopeMap.toLiteralMap()]);const guardedCall=jitOnlyGuardedExpression(fnCall);const iife=new FunctionExpr([],[guardedCall.toStmt()]);const iifeCall=new InvokeFunctionExpr(iife,[]);return iifeCall.toStmt()}function tupleTypeOf(exp){const types=exp.map((ref=>typeofExpr(ref.type)));return exp.length>0?expressionType(literalArr(types)):NONE_TYPE}function tupleOfTypes(types){const typeofTypes=types.map((type=>typeofExpr(type)));return types.length>0?expressionType(literalArr(typeofTypes)):NONE_TYPE}function compilePipeFromMetadata(metadata){const definitionMapValues=[];definitionMapValues.push({key:"name",value:literal(metadata.pipeName),quoted:false});definitionMapValues.push({key:"type",value:metadata.type.value,quoted:false});definitionMapValues.push({key:"pure",value:literal(metadata.pure),quoted:false});if(metadata.isStandalone){definitionMapValues.push({key:"standalone",value:literal(true),quoted:false})}const expression=importExpr(Identifiers.definePipe).callFn([literalMap(definitionMapValues)],undefined,true);const type=createPipeType(metadata);return{expression:expression,type:type,statements:[]}}function createPipeType(metadata){return new ExpressionType(importExpr(Identifiers.PipeDeclaration,[typeWithParameters(metadata.type.type,metadata.typeArgumentCount),new ExpressionType(new LiteralExpr(metadata.pipeName)),new ExpressionType(new LiteralExpr(metadata.isStandalone))]))}exports.R3TemplateDependencyKind=void 0;(function(R3TemplateDependencyKind){R3TemplateDependencyKind[R3TemplateDependencyKind["Directive"]=0]="Directive";R3TemplateDependencyKind[R3TemplateDependencyKind["Pipe"]=1]="Pipe";R3TemplateDependencyKind[R3TemplateDependencyKind["NgModule"]=2]="NgModule"})(exports.R3TemplateDependencyKind||(exports.R3TemplateDependencyKind={}));class ParserError{constructor(message,input,errLocation,ctxLocation){this.input=input;this.errLocation=errLocation;this.ctxLocation=ctxLocation;this.message=`Parser Error: ${message} ${errLocation} [${input}] in ${ctxLocation}`}}class ParseSpan{constructor(start,end){this.start=start;this.end=end}toAbsolute(absoluteOffset){return new AbsoluteSourceSpan(absoluteOffset+this.start,absoluteOffset+this.end)}}class AST{constructor(span,sourceSpan){this.span=span;this.sourceSpan=sourceSpan}toString(){return"AST"}}class ASTWithName extends AST{constructor(span,sourceSpan,nameSpan){super(span,sourceSpan);this.nameSpan=nameSpan}}class EmptyExpr$1 extends AST{visit(visitor,context=null){}}class ImplicitReceiver extends AST{visit(visitor,context=null){return visitor.visitImplicitReceiver(this,context)}}class ThisReceiver extends ImplicitReceiver{visit(visitor,context=null){return visitor.visitThisReceiver?.(this,context)}}class Chain extends AST{constructor(span,sourceSpan,expressions){super(span,sourceSpan);this.expressions=expressions}visit(visitor,context=null){return visitor.visitChain(this,context)}}class Conditional extends AST{constructor(span,sourceSpan,condition,trueExp,falseExp){super(span,sourceSpan);this.condition=condition;this.trueExp=trueExp;this.falseExp=falseExp}visit(visitor,context=null){return visitor.visitConditional(this,context)}}class PropertyRead extends ASTWithName{constructor(span,sourceSpan,nameSpan,receiver,name){super(span,sourceSpan,nameSpan);this.receiver=receiver;this.name=name}visit(visitor,context=null){return visitor.visitPropertyRead(this,context)}}class PropertyWrite extends ASTWithName{constructor(span,sourceSpan,nameSpan,receiver,name,value){super(span,sourceSpan,nameSpan);this.receiver=receiver;this.name=name;this.value=value}visit(visitor,context=null){return visitor.visitPropertyWrite(this,context)}}class SafePropertyRead extends ASTWithName{constructor(span,sourceSpan,nameSpan,receiver,name){super(span,sourceSpan,nameSpan);this.receiver=receiver;this.name=name}visit(visitor,context=null){return visitor.visitSafePropertyRead(this,context)}}class KeyedRead extends AST{constructor(span,sourceSpan,receiver,key){super(span,sourceSpan);this.receiver=receiver;this.key=key}visit(visitor,context=null){return visitor.visitKeyedRead(this,context)}}class SafeKeyedRead extends AST{constructor(span,sourceSpan,receiver,key){super(span,sourceSpan);this.receiver=receiver;this.key=key}visit(visitor,context=null){return visitor.visitSafeKeyedRead(this,context)}}class KeyedWrite extends AST{constructor(span,sourceSpan,receiver,key,value){super(span,sourceSpan);this.receiver=receiver;this.key=key;this.value=value}visit(visitor,context=null){return visitor.visitKeyedWrite(this,context)}}class BindingPipe extends ASTWithName{constructor(span,sourceSpan,exp,name,args,nameSpan){super(span,sourceSpan,nameSpan);this.exp=exp;this.name=name;this.args=args}visit(visitor,context=null){return visitor.visitPipe(this,context)}}class LiteralPrimitive extends AST{constructor(span,sourceSpan,value){super(span,sourceSpan);this.value=value}visit(visitor,context=null){return visitor.visitLiteralPrimitive(this,context)}}class LiteralArray extends AST{constructor(span,sourceSpan,expressions){super(span,sourceSpan);this.expressions=expressions}visit(visitor,context=null){return visitor.visitLiteralArray(this,context)}}class LiteralMap extends AST{constructor(span,sourceSpan,keys,values){super(span,sourceSpan);this.keys=keys;this.values=values}visit(visitor,context=null){return visitor.visitLiteralMap(this,context)}}class Interpolation$1 extends AST{constructor(span,sourceSpan,strings,expressions){super(span,sourceSpan);this.strings=strings;this.expressions=expressions}visit(visitor,context=null){return visitor.visitInterpolation(this,context)}}class Binary extends AST{constructor(span,sourceSpan,operation,left,right){super(span,sourceSpan);this.operation=operation;this.left=left;this.right=right}visit(visitor,context=null){return visitor.visitBinary(this,context)}}class Unary extends Binary{static createMinus(span,sourceSpan,expr){return new Unary(span,sourceSpan,"-",expr,"-",new LiteralPrimitive(span,sourceSpan,0),expr)}static createPlus(span,sourceSpan,expr){return new Unary(span,sourceSpan,"+",expr,"-",expr,new LiteralPrimitive(span,sourceSpan,0))}constructor(span,sourceSpan,operator,expr,binaryOp,binaryLeft,binaryRight){super(span,sourceSpan,binaryOp,binaryLeft,binaryRight);this.operator=operator;this.expr=expr;this.left=null;this.right=null;this.operation=null}visit(visitor,context=null){if(visitor.visitUnary!==undefined){return visitor.visitUnary(this,context)}return visitor.visitBinary(this,context)}}class PrefixNot extends AST{constructor(span,sourceSpan,expression){super(span,sourceSpan);this.expression=expression}visit(visitor,context=null){return visitor.visitPrefixNot(this,context)}}class NonNullAssert extends AST{constructor(span,sourceSpan,expression){super(span,sourceSpan);this.expression=expression}visit(visitor,context=null){return visitor.visitNonNullAssert(this,context)}}class Call extends AST{constructor(span,sourceSpan,receiver,args,argumentSpan){super(span,sourceSpan);this.receiver=receiver;this.args=args;this.argumentSpan=argumentSpan}visit(visitor,context=null){return visitor.visitCall(this,context)}}class SafeCall extends AST{constructor(span,sourceSpan,receiver,args,argumentSpan){super(span,sourceSpan);this.receiver=receiver;this.args=args;this.argumentSpan=argumentSpan}visit(visitor,context=null){return visitor.visitSafeCall(this,context)}}class AbsoluteSourceSpan{constructor(start,end){this.start=start;this.end=end}}class ASTWithSource extends AST{constructor(ast,source,location,absoluteOffset,errors){super(new ParseSpan(0,source===null?0:source.length),new AbsoluteSourceSpan(absoluteOffset,source===null?absoluteOffset:absoluteOffset+source.length));this.ast=ast;this.source=source;this.location=location;this.errors=errors}visit(visitor,context=null){if(visitor.visitASTWithSource){return visitor.visitASTWithSource(this,context)}return this.ast.visit(visitor,context)}toString(){return`${this.source} in ${this.location}`}}class VariableBinding{constructor(sourceSpan,key,value){this.sourceSpan=sourceSpan;this.key=key;this.value=value}}class ExpressionBinding{constructor(sourceSpan,key,value){this.sourceSpan=sourceSpan;this.key=key;this.value=value}}class RecursiveAstVisitor{visit(ast,context){ast.visit(this,context)}visitUnary(ast,context){this.visit(ast.expr,context)}visitBinary(ast,context){this.visit(ast.left,context);this.visit(ast.right,context)}visitChain(ast,context){this.visitAll(ast.expressions,context)}visitConditional(ast,context){this.visit(ast.condition,context);this.visit(ast.trueExp,context);this.visit(ast.falseExp,context)}visitPipe(ast,context){this.visit(ast.exp,context);this.visitAll(ast.args,context)}visitImplicitReceiver(ast,context){}visitThisReceiver(ast,context){}visitInterpolation(ast,context){this.visitAll(ast.expressions,context)}visitKeyedRead(ast,context){this.visit(ast.receiver,context);this.visit(ast.key,context)}visitKeyedWrite(ast,context){this.visit(ast.receiver,context);this.visit(ast.key,context);this.visit(ast.value,context)}visitLiteralArray(ast,context){this.visitAll(ast.expressions,context)}visitLiteralMap(ast,context){this.visitAll(ast.values,context)}visitLiteralPrimitive(ast,context){}visitPrefixNot(ast,context){this.visit(ast.expression,context)}visitNonNullAssert(ast,context){this.visit(ast.expression,context)}visitPropertyRead(ast,context){this.visit(ast.receiver,context)}visitPropertyWrite(ast,context){this.visit(ast.receiver,context);this.visit(ast.value,context)}visitSafePropertyRead(ast,context){this.visit(ast.receiver,context)}visitSafeKeyedRead(ast,context){this.visit(ast.receiver,context);this.visit(ast.key,context)}visitCall(ast,context){this.visit(ast.receiver,context);this.visitAll(ast.args,context)}visitSafeCall(ast,context){this.visit(ast.receiver,context);this.visitAll(ast.args,context)}visitAll(asts,context){for(const ast of asts){this.visit(ast,context)}}}class AstTransformer{visitImplicitReceiver(ast,context){return ast}visitThisReceiver(ast,context){return ast}visitInterpolation(ast,context){return new Interpolation$1(ast.span,ast.sourceSpan,ast.strings,this.visitAll(ast.expressions))}visitLiteralPrimitive(ast,context){return new LiteralPrimitive(ast.span,ast.sourceSpan,ast.value)}visitPropertyRead(ast,context){return new PropertyRead(ast.span,ast.sourceSpan,ast.nameSpan,ast.receiver.visit(this),ast.name)}visitPropertyWrite(ast,context){return new PropertyWrite(ast.span,ast.sourceSpan,ast.nameSpan,ast.receiver.visit(this),ast.name,ast.value.visit(this))}visitSafePropertyRead(ast,context){return new SafePropertyRead(ast.span,ast.sourceSpan,ast.nameSpan,ast.receiver.visit(this),ast.name)}visitLiteralArray(ast,context){return new LiteralArray(ast.span,ast.sourceSpan,this.visitAll(ast.expressions))}visitLiteralMap(ast,context){return new LiteralMap(ast.span,ast.sourceSpan,ast.keys,this.visitAll(ast.values))}visitUnary(ast,context){switch(ast.operator){case"+":return Unary.createPlus(ast.span,ast.sourceSpan,ast.expr.visit(this));case"-":return Unary.createMinus(ast.span,ast.sourceSpan,ast.expr.visit(this));default:throw new Error(`Unknown unary operator ${ast.operator}`)}}visitBinary(ast,context){return new Binary(ast.span,ast.sourceSpan,ast.operation,ast.left.visit(this),ast.right.visit(this))}visitPrefixNot(ast,context){return new PrefixNot(ast.span,ast.sourceSpan,ast.expression.visit(this))}visitNonNullAssert(ast,context){return new NonNullAssert(ast.span,ast.sourceSpan,ast.expression.visit(this))}visitConditional(ast,context){return new Conditional(ast.span,ast.sourceSpan,ast.condition.visit(this),ast.trueExp.visit(this),ast.falseExp.visit(this))}visitPipe(ast,context){return new BindingPipe(ast.span,ast.sourceSpan,ast.exp.visit(this),ast.name,this.visitAll(ast.args),ast.nameSpan)}visitKeyedRead(ast,context){return new KeyedRead(ast.span,ast.sourceSpan,ast.receiver.visit(this),ast.key.visit(this))}visitKeyedWrite(ast,context){return new KeyedWrite(ast.span,ast.sourceSpan,ast.receiver.visit(this),ast.key.visit(this),ast.value.visit(this))}visitCall(ast,context){return new Call(ast.span,ast.sourceSpan,ast.receiver.visit(this),this.visitAll(ast.args),ast.argumentSpan)}visitSafeCall(ast,context){return new SafeCall(ast.span,ast.sourceSpan,ast.receiver.visit(this),this.visitAll(ast.args),ast.argumentSpan)}visitAll(asts){const res=[];for(let i=0;i<asts.length;++i){res[i]=asts[i].visit(this)}return res}visitChain(ast,context){return new Chain(ast.span,ast.sourceSpan,this.visitAll(ast.expressions))}visitSafeKeyedRead(ast,context){return new SafeKeyedRead(ast.span,ast.sourceSpan,ast.receiver.visit(this),ast.key.visit(this))}}class AstMemoryEfficientTransformer{visitImplicitReceiver(ast,context){return ast}visitThisReceiver(ast,context){return ast}visitInterpolation(ast,context){const expressions=this.visitAll(ast.expressions);if(expressions!==ast.expressions)return new Interpolation$1(ast.span,ast.sourceSpan,ast.strings,expressions);return ast}visitLiteralPrimitive(ast,context){return ast}visitPropertyRead(ast,context){const receiver=ast.receiver.visit(this);if(receiver!==ast.receiver){return new PropertyRead(ast.span,ast.sourceSpan,ast.nameSpan,receiver,ast.name)}return ast}visitPropertyWrite(ast,context){const receiver=ast.receiver.visit(this);const value=ast.value.visit(this);if(receiver!==ast.receiver||value!==ast.value){return new PropertyWrite(ast.span,ast.sourceSpan,ast.nameSpan,receiver,ast.name,value)}return ast}visitSafePropertyRead(ast,context){const receiver=ast.receiver.visit(this);if(receiver!==ast.receiver){return new SafePropertyRead(ast.span,ast.sourceSpan,ast.nameSpan,receiver,ast.name)}return ast}visitLiteralArray(ast,context){const expressions=this.visitAll(ast.expressions);if(expressions!==ast.expressions){return new LiteralArray(ast.span,ast.sourceSpan,expressions)}return ast}visitLiteralMap(ast,context){const values=this.visitAll(ast.values);if(values!==ast.values){return new LiteralMap(ast.span,ast.sourceSpan,ast.keys,values)}return ast}visitUnary(ast,context){const expr=ast.expr.visit(this);if(expr!==ast.expr){switch(ast.operator){case"+":return Unary.createPlus(ast.span,ast.sourceSpan,expr);case"-":return Unary.createMinus(ast.span,ast.sourceSpan,expr);default:throw new Error(`Unknown unary operator ${ast.operator}`)}}return ast}visitBinary(ast,context){const left=ast.left.visit(this);const right=ast.right.visit(this);if(left!==ast.left||right!==ast.right){return new Binary(ast.span,ast.sourceSpan,ast.operation,left,right)}return ast}visitPrefixNot(ast,context){const expression=ast.expression.visit(this);if(expression!==ast.expression){return new PrefixNot(ast.span,ast.sourceSpan,expression)}return ast}visitNonNullAssert(ast,context){const expression=ast.expression.visit(this);if(expression!==ast.expression){return new NonNullAssert(ast.span,ast.sourceSpan,expression)}return ast}visitConditional(ast,context){const condition=ast.condition.visit(this);const trueExp=ast.trueExp.visit(this);const falseExp=ast.falseExp.visit(this);if(condition!==ast.condition||trueExp!==ast.trueExp||falseExp!==ast.falseExp){return new Conditional(ast.span,ast.sourceSpan,condition,trueExp,falseExp)}return ast}visitPipe(ast,context){const exp=ast.exp.visit(this);const args=this.visitAll(ast.args);if(exp!==ast.exp||args!==ast.args){return new BindingPipe(ast.span,ast.sourceSpan,exp,ast.name,args,ast.nameSpan)}return ast}visitKeyedRead(ast,context){const obj=ast.receiver.visit(this);const key=ast.key.visit(this);if(obj!==ast.receiver||key!==ast.key){return new KeyedRead(ast.span,ast.sourceSpan,obj,key)}return ast}visitKeyedWrite(ast,context){const obj=ast.receiver.visit(this);const key=ast.key.visit(this);const value=ast.value.visit(this);if(obj!==ast.receiver||key!==ast.key||value!==ast.value){return new KeyedWrite(ast.span,ast.sourceSpan,obj,key,value)}return ast}visitAll(asts){const res=[];let modified=false;for(let i=0;i<asts.length;++i){const original=asts[i];const value=original.visit(this);res[i]=value;modified=modified||value!==original}return modified?res:asts}visitChain(ast,context){const expressions=this.visitAll(ast.expressions);if(expressions!==ast.expressions){return new Chain(ast.span,ast.sourceSpan,expressions)}return ast}visitCall(ast,context){const receiver=ast.receiver.visit(this);const args=this.visitAll(ast.args);if(receiver!==ast.receiver||args!==ast.args){return new Call(ast.span,ast.sourceSpan,receiver,args,ast.argumentSpan)}return ast}visitSafeCall(ast,context){const receiver=ast.receiver.visit(this);const args=this.visitAll(ast.args);if(receiver!==ast.receiver||args!==ast.args){return new SafeCall(ast.span,ast.sourceSpan,receiver,args,ast.argumentSpan)}return ast}visitSafeKeyedRead(ast,context){const obj=ast.receiver.visit(this);const key=ast.key.visit(this);if(obj!==ast.receiver||key!==ast.key){return new SafeKeyedRead(ast.span,ast.sourceSpan,obj,key)}return ast}}class ParsedProperty{constructor(name,expression,type,sourceSpan,keySpan,valueSpan){this.name=name;this.expression=expression;this.type=type;this.sourceSpan=sourceSpan;this.keySpan=keySpan;this.valueSpan=valueSpan;this.isLiteral=this.type===exports.ParsedPropertyType.LITERAL_ATTR;this.isAnimation=this.type===exports.ParsedPropertyType.ANIMATION}}exports.ParsedPropertyType=void 0;(function(ParsedPropertyType){ParsedPropertyType[ParsedPropertyType["DEFAULT"]=0]="DEFAULT";ParsedPropertyType[ParsedPropertyType["LITERAL_ATTR"]=1]="LITERAL_ATTR";ParsedPropertyType[ParsedPropertyType["ANIMATION"]=2]="ANIMATION";ParsedPropertyType[ParsedPropertyType["TWO_WAY"]=3]="TWO_WAY"})(exports.ParsedPropertyType||(exports.ParsedPropertyType={}));class ParsedEvent{constructor(name,targetOrPhase,type,handler,sourceSpan,handlerSpan,keySpan){this.name=name;this.targetOrPhase=targetOrPhase;this.type=type;this.handler=handler;this.sourceSpan=sourceSpan;this.handlerSpan=handlerSpan;this.keySpan=keySpan}}class ParsedVariable{constructor(name,value,sourceSpan,keySpan,valueSpan){this.name=name;this.value=value;this.sourceSpan=sourceSpan;this.keySpan=keySpan;this.valueSpan=valueSpan}}class BoundElementProperty{constructor(name,type,securityContext,value,unit,sourceSpan,keySpan,valueSpan){this.name=name;this.type=type;this.securityContext=securityContext;this.value=value;this.unit=unit;this.sourceSpan=sourceSpan;this.keySpan=keySpan;this.valueSpan=valueSpan}}class EventHandlerVars{static{this.event=variable("$event")}}function convertActionBinding(localResolver,implicitReceiver,action,bindingId,baseSourceSpan,implicitReceiverAccesses,globals){localResolver??=new DefaultLocalResolver(globals);const visitor=new _AstToIrVisitor(localResolver,implicitReceiver,bindingId,false,baseSourceSpan,implicitReceiverAccesses);const actionStmts=[];flattenStatements(convertActionBuiltins(action).visit(visitor,_Mode.Statement),actionStmts);prependTemporaryDecls(visitor.temporaryCount,bindingId,actionStmts);if(visitor.usesImplicitReceiver){localResolver.notifyImplicitReceiverUse()}const lastIndex=actionStmts.length-1;if(lastIndex>=0){const lastStatement=actionStmts[lastIndex];if(lastStatement instanceof ExpressionStatement){actionStmts[lastIndex]=new ReturnStatement(lastStatement.expr)}}return actionStmts}function convertAssignmentActionBinding(localResolver,implicitReceiver,action,bindingId,baseSourceSpan,implicitReceiverAccesses,globals){localResolver??=new DefaultLocalResolver(globals);const visitor=new _AstToIrVisitor(localResolver,implicitReceiver,bindingId,false,baseSourceSpan,implicitReceiverAccesses);let convertedAction=convertActionBuiltins(action).visit(visitor,_Mode.Statement);if(!(convertedAction instanceof ExpressionStatement)){throw new Error(`Illegal state: unsupported expression in two-way action binding.`)}convertedAction=wrapAssignmentAction(convertedAction.expr).toStmt();const actionStmts=[];flattenStatements(convertedAction,actionStmts);prependTemporaryDecls(visitor.temporaryCount,bindingId,actionStmts);actionStmts.push(new ReturnStatement(EventHandlerVars.event));implicitReceiverAccesses?.add(EventHandlerVars.event.name);if(visitor.usesImplicitReceiver){localResolver.notifyImplicitReceiverUse()}return actionStmts}function wrapAssignmentReadExpression(ast){return new ExternalExpr(Identifiers.twoWayBindingSet).callFn([ast,EventHandlerVars.event]).or(ast.set(EventHandlerVars.event))}function isReadExpression$1(value){return value instanceof ReadPropExpr||value instanceof ReadKeyExpr}function wrapAssignmentAction(ast){if(isReadExpression$1(ast)){return wrapAssignmentReadExpression(ast)}if(ast instanceof BinaryOperatorExpr&&isReadExpression$1(ast.rhs)){return new BinaryOperatorExpr(ast.operator,ast.lhs,wrapAssignmentReadExpression(ast.rhs))}if(ast instanceof ConditionalExpr&&isReadExpression$1(ast.falseCase)){return new ConditionalExpr(ast.condition,ast.trueCase,wrapAssignmentReadExpression(ast.falseCase))}if(ast instanceof NotExpr){let expr=ast.condition;while(true){if(expr instanceof NotExpr){expr=expr.condition}else{if(isReadExpression$1(expr)){return wrapAssignmentReadExpression(expr)}break}}}throw new Error(`Illegal state: unsupported expression in two-way action binding.`)}function convertPropertyBindingBuiltins(converterFactory,ast){return convertBuiltins(converterFactory,ast)}class ConvertPropertyBindingResult{constructor(stmts,currValExpr){this.stmts=stmts;this.currValExpr=currValExpr}}function convertPropertyBinding(localResolver,implicitReceiver,expressionWithoutBuiltins,bindingId){if(!localResolver){localResolver=new DefaultLocalResolver}const visitor=new _AstToIrVisitor(localResolver,implicitReceiver,bindingId,false);const outputExpr=expressionWithoutBuiltins.visit(visitor,_Mode.Expression);const stmts=getStatementsFromVisitor(visitor,bindingId);if(visitor.usesImplicitReceiver){localResolver.notifyImplicitReceiverUse()}return new ConvertPropertyBindingResult(stmts,outputExpr)}function convertPureComponentScopeFunction(ast,localResolver,implicitReceiver,bindingId){const converted=convertPropertyBindingBuiltins({createLiteralArrayConverter:()=>args=>literalArr(args),createLiteralMapConverter:keys=>values=>literalMap(keys.map(((key,index)=>({key:key.key,value:values[index],quoted:key.quoted})))),createPipeConverter:()=>{throw new Error("Illegal State: Pipes are not allowed in this context")}},ast);const visitor=new _AstToIrVisitor(localResolver,implicitReceiver,bindingId,false);const statements=[];flattenStatements(converted.visit(visitor,_Mode.Statement),statements);return statements}function convertUpdateArguments(localResolver,contextVariableExpression,expressionWithArgumentsToExtract,bindingId){const visitor=new _AstToIrVisitor(localResolver,contextVariableExpression,bindingId,true);const outputExpr=visitor.visitInterpolation(expressionWithArgumentsToExtract,_Mode.Expression);if(visitor.usesImplicitReceiver){localResolver.notifyImplicitReceiverUse()}const stmts=getStatementsFromVisitor(visitor,bindingId);const args=outputExpr.args;return{stmts:stmts,args:args}}function getStatementsFromVisitor(visitor,bindingId){const stmts=[];for(let i=0;i<visitor.temporaryCount;i++){stmts.push(temporaryDeclaration(bindingId,i))}return stmts}function convertBuiltins(converterFactory,ast){const visitor=new _BuiltinAstConverter(converterFactory);return ast.visit(visitor)}function convertActionBuiltins(action){const converterFactory={createLiteralArrayConverter:()=>args=>literalArr(args),createLiteralMapConverter:keys=>values=>{const entries=keys.map(((k,i)=>({key:k.key,value:values[i],quoted:k.quoted})));return literalMap(entries)},createPipeConverter:name=>{throw new Error(`Illegal State: Actions are not allowed to contain pipes. Pipe: ${name}`)}};return convertPropertyBindingBuiltins(converterFactory,action)}function temporaryName(bindingId,temporaryNumber){return`tmp_${bindingId}_${temporaryNumber}`}function temporaryDeclaration(bindingId,temporaryNumber){return new DeclareVarStmt(temporaryName(bindingId,temporaryNumber))}function prependTemporaryDecls(temporaryCount,bindingId,statements){for(let i=temporaryCount-1;i>=0;i--){statements.unshift(temporaryDeclaration(bindingId,i))}}var _Mode;(function(_Mode){_Mode[_Mode["Statement"]=0]="Statement";_Mode[_Mode["Expression"]=1]="Expression"})(_Mode||(_Mode={}));function ensureStatementMode(mode,ast){if(mode!==_Mode.Statement){throw new Error(`Expected a statement, but saw ${ast}`)}}function ensureExpressionMode(mode,ast){if(mode!==_Mode.Expression){throw new Error(`Expected an expression, but saw ${ast}`)}}function convertToStatementIfNeeded(mode,expr){if(mode===_Mode.Statement){return expr.toStmt()}else{return expr}}class _BuiltinAstConverter extends AstTransformer{constructor(_converterFactory){super();this._converterFactory=_converterFactory}visitPipe(ast,context){const args=[ast.exp,...ast.args].map((ast=>ast.visit(this,context)));return new BuiltinFunctionCall(ast.span,ast.sourceSpan,args,this._converterFactory.createPipeConverter(ast.name,args.length))}visitLiteralArray(ast,context){const args=ast.expressions.map((ast=>ast.visit(this,context)));return new BuiltinFunctionCall(ast.span,ast.sourceSpan,args,this._converterFactory.createLiteralArrayConverter(ast.expressions.length))}visitLiteralMap(ast,context){const args=ast.values.map((ast=>ast.visit(this,context)));return new BuiltinFunctionCall(ast.span,ast.sourceSpan,args,this._converterFactory.createLiteralMapConverter(ast.keys))}}class _AstToIrVisitor{constructor(_localResolver,_implicitReceiver,bindingId,supportsInterpolation,baseSourceSpan,implicitReceiverAccesses){this._localResolver=_localResolver;this._implicitReceiver=_implicitReceiver;this.bindingId=bindingId;this.supportsInterpolation=supportsInterpolation;this.baseSourceSpan=baseSourceSpan;this.implicitReceiverAccesses=implicitReceiverAccesses;this._nodeMap=new Map;this._resultMap=new Map;this._currentTemporary=0;this.temporaryCount=0;this.usesImplicitReceiver=false}visitUnary(ast,mode){let op;switch(ast.operator){case"+":op=exports.UnaryOperator.Plus;break;case"-":op=exports.UnaryOperator.Minus;break;default:throw new Error(`Unsupported operator ${ast.operator}`)}return convertToStatementIfNeeded(mode,new UnaryOperatorExpr(op,this._visit(ast.expr,_Mode.Expression),undefined,this.convertSourceSpan(ast.span)))}visitBinary(ast,mode){let op;switch(ast.operation){case"+":op=exports.BinaryOperator.Plus;break;case"-":op=exports.BinaryOperator.Minus;break;case"*":op=exports.BinaryOperator.Multiply;break;case"/":op=exports.BinaryOperator.Divide;break;case"%":op=exports.BinaryOperator.Modulo;break;case"&&":op=exports.BinaryOperator.And;break;case"||":op=exports.BinaryOperator.Or;break;case"==":op=exports.BinaryOperator.Equals;break;case"!=":op=exports.BinaryOperator.NotEquals;break;case"===":op=exports.BinaryOperator.Identical;break;case"!==":op=exports.BinaryOperator.NotIdentical;break;case"<":op=exports.BinaryOperator.Lower;break;case">":op=exports.BinaryOperator.Bigger;break;case"<=":op=exports.BinaryOperator.LowerEquals;break;case">=":op=exports.BinaryOperator.BiggerEquals;break;case"??":return this.convertNullishCoalesce(ast,mode);default:throw new Error(`Unsupported operation ${ast.operation}`)}return convertToStatementIfNeeded(mode,new BinaryOperatorExpr(op,this._visit(ast.left,_Mode.Expression),this._visit(ast.right,_Mode.Expression),undefined,this.convertSourceSpan(ast.span)))}visitChain(ast,mode){ensureStatementMode(mode,ast);return this.visitAll(ast.expressions,mode)}visitConditional(ast,mode){const value=this._visit(ast.condition,_Mode.Expression);return convertToStatementIfNeeded(mode,value.conditional(this._visit(ast.trueExp,_Mode.Expression),this._visit(ast.falseExp,_Mode.Expression),this.convertSourceSpan(ast.span)))}visitPipe(ast,mode){throw new Error(`Illegal state: Pipes should have been converted into functions. Pipe: ${ast.name}`)}visitImplicitReceiver(ast,mode){ensureExpressionMode(mode,ast);this.usesImplicitReceiver=true;return this._implicitReceiver}visitThisReceiver(ast,mode){return this.visitImplicitReceiver(ast,mode)}visitInterpolation(ast,mode){if(!this.supportsInterpolation){throw new Error("Unexpected interpolation")}ensureExpressionMode(mode,ast);let args=[];for(let i=0;i<ast.strings.length-1;i++){args.push(literal(ast.strings[i]));args.push(this._visit(ast.expressions[i],_Mode.Expression))}args.push(literal(ast.strings[ast.strings.length-1]));const strings=ast.strings;if(strings.length===2&&strings[0]===""&&strings[1]===""){args=[args[1]]}else if(ast.expressions.length>=9){args=[literalArr(args)]}return new InterpolationExpression(args)}visitKeyedRead(ast,mode){const leftMostSafe=this.leftMostSafeNode(ast);if(leftMostSafe){return this.convertSafeAccess(ast,leftMostSafe,mode)}else{return convertToStatementIfNeeded(mode,this._visit(ast.receiver,_Mode.Expression).key(this._visit(ast.key,_Mode.Expression)))}}visitKeyedWrite(ast,mode){const obj=this._visit(ast.receiver,_Mode.Expression);const key=this._visit(ast.key,_Mode.Expression);const value=this._visit(ast.value,_Mode.Expression);if(obj===this._implicitReceiver){this._localResolver.maybeRestoreView()}return convertToStatementIfNeeded(mode,obj.key(key).set(value))}visitLiteralArray(ast,mode){throw new Error(`Illegal State: literal arrays should have been converted into functions`)}visitLiteralMap(ast,mode){throw new Error(`Illegal State: literal maps should have been converted into functions`)}visitLiteralPrimitive(ast,mode){const type=ast.value===null||ast.value===undefined||ast.value===true||ast.value===true?INFERRED_TYPE:undefined;return convertToStatementIfNeeded(mode,literal(ast.value,type,this.convertSourceSpan(ast.span)))}_getLocal(name,receiver){if(this._localResolver.globals?.has(name)&&receiver instanceof ThisReceiver){return null}return this._localResolver.getLocal(name)}visitPrefixNot(ast,mode){return convertToStatementIfNeeded(mode,not(this._visit(ast.expression,_Mode.Expression)))}visitNonNullAssert(ast,mode){return convertToStatementIfNeeded(mode,this._visit(ast.expression,_Mode.Expression))}visitPropertyRead(ast,mode){const leftMostSafe=this.leftMostSafeNode(ast);if(leftMostSafe){return this.convertSafeAccess(ast,leftMostSafe,mode)}else{let result=null;const prevUsesImplicitReceiver=this.usesImplicitReceiver;const receiver=this._visit(ast.receiver,_Mode.Expression);if(receiver===this._implicitReceiver){result=this._getLocal(ast.name,ast.receiver);if(result){this.usesImplicitReceiver=prevUsesImplicitReceiver;this.addImplicitReceiverAccess(ast.name)}}if(result==null){result=receiver.prop(ast.name,this.convertSourceSpan(ast.span))}return convertToStatementIfNeeded(mode,result)}}visitPropertyWrite(ast,mode){const receiver=this._visit(ast.receiver,_Mode.Expression);const prevUsesImplicitReceiver=this.usesImplicitReceiver;let varExpr=null;if(receiver===this._implicitReceiver){const localExpr=this._getLocal(ast.name,ast.receiver);if(localExpr){if(localExpr instanceof ReadPropExpr){varExpr=localExpr;this.usesImplicitReceiver=prevUsesImplicitReceiver;this.addImplicitReceiverAccess(ast.name)}else{const receiver=ast.name;const value=ast.value instanceof PropertyRead?ast.value.name:undefined;throw new Error(`Cannot assign value "${value}" to template variable "${receiver}". Template variables are read-only.`)}}}if(varExpr===null){varExpr=receiver.prop(ast.name,this.convertSourceSpan(ast.span))}return convertToStatementIfNeeded(mode,varExpr.set(this._visit(ast.value,_Mode.Expression)))}visitSafePropertyRead(ast,mode){return this.convertSafeAccess(ast,this.leftMostSafeNode(ast),mode)}visitSafeKeyedRead(ast,mode){return this.convertSafeAccess(ast,this.leftMostSafeNode(ast),mode)}visitAll(asts,mode){return asts.map((ast=>this._visit(ast,mode)))}visitCall(ast,mode){const leftMostSafe=this.leftMostSafeNode(ast);if(leftMostSafe){return this.convertSafeAccess(ast,leftMostSafe,mode)}const convertedArgs=this.visitAll(ast.args,_Mode.Expression);if(ast instanceof BuiltinFunctionCall){return convertToStatementIfNeeded(mode,ast.converter(convertedArgs))}const receiver=ast.receiver;if(receiver instanceof PropertyRead&&receiver.receiver instanceof ImplicitReceiver&&!(receiver.receiver instanceof ThisReceiver)&&receiver.name==="$any"){if(convertedArgs.length!==1){throw new Error(`Invalid call to $any, expected 1 argument but received ${convertedArgs.length||"none"}`)}return convertToStatementIfNeeded(mode,convertedArgs[0])}const call=this._visit(receiver,_Mode.Expression).callFn(convertedArgs,this.convertSourceSpan(ast.span));return convertToStatementIfNeeded(mode,call)}visitSafeCall(ast,mode){return this.convertSafeAccess(ast,this.leftMostSafeNode(ast),mode)}_visit(ast,mode){const result=this._resultMap.get(ast);if(result)return result;return(this._nodeMap.get(ast)||ast).visit(this,mode)}convertSafeAccess(ast,leftMostSafe,mode){let guardedExpression=this._visit(leftMostSafe.receiver,_Mode.Expression);let temporary=undefined;if(this.needsTemporaryInSafeAccess(leftMostSafe.receiver)){temporary=this.allocateTemporary();guardedExpression=temporary.set(guardedExpression);this._resultMap.set(leftMostSafe.receiver,temporary)}const condition=guardedExpression.isBlank();if(leftMostSafe instanceof SafeCall){this._nodeMap.set(leftMostSafe,new Call(leftMostSafe.span,leftMostSafe.sourceSpan,leftMostSafe.receiver,leftMostSafe.args,leftMostSafe.argumentSpan))}else if(leftMostSafe instanceof SafeKeyedRead){this._nodeMap.set(leftMostSafe,new KeyedRead(leftMostSafe.span,leftMostSafe.sourceSpan,leftMostSafe.receiver,leftMostSafe.key))}else{this._nodeMap.set(leftMostSafe,new PropertyRead(leftMostSafe.span,leftMostSafe.sourceSpan,leftMostSafe.nameSpan,leftMostSafe.receiver,leftMostSafe.name))}const access=this._visit(ast,_Mode.Expression);this._nodeMap.delete(leftMostSafe);if(temporary){this.releaseTemporary(temporary)}return convertToStatementIfNeeded(mode,condition.conditional(NULL_EXPR,access))}convertNullishCoalesce(ast,mode){const left=this._visit(ast.left,_Mode.Expression);const right=this._visit(ast.right,_Mode.Expression);const temporary=this.allocateTemporary();this.releaseTemporary(temporary);return convertToStatementIfNeeded(mode,temporary.set(left).notIdentical(NULL_EXPR).and(temporary.notIdentical(literal(undefined))).conditional(temporary,right))}leftMostSafeNode(ast){const visit=(visitor,ast)=>(this._nodeMap.get(ast)||ast).visit(visitor);return ast.visit({visitUnary(ast){return null},visitBinary(ast){return null},visitChain(ast){return null},visitConditional(ast){return null},visitCall(ast){return visit(this,ast.receiver)},visitSafeCall(ast){return visit(this,ast.receiver)||ast},visitImplicitReceiver(ast){return null},visitThisReceiver(ast){return null},visitInterpolation(ast){return null},visitKeyedRead(ast){return visit(this,ast.receiver)},visitKeyedWrite(ast){return null},visitLiteralArray(ast){return null},visitLiteralMap(ast){return null},visitLiteralPrimitive(ast){return null},visitPipe(ast){return null},visitPrefixNot(ast){return null},visitNonNullAssert(ast){return visit(this,ast.expression)},visitPropertyRead(ast){return visit(this,ast.receiver)},visitPropertyWrite(ast){return null},visitSafePropertyRead(ast){return visit(this,ast.receiver)||ast},visitSafeKeyedRead(ast){return visit(this,ast.receiver)||ast}})}needsTemporaryInSafeAccess(ast){const visit=(visitor,ast)=>ast&&(this._nodeMap.get(ast)||ast).visit(visitor);const visitSome=(visitor,ast)=>ast.some((ast=>visit(visitor,ast)));return ast.visit({visitUnary(ast){return visit(this,ast.expr)},visitBinary(ast){return visit(this,ast.left)||visit(this,ast.right)},visitChain(ast){return false},visitConditional(ast){return visit(this,ast.condition)||visit(this,ast.trueExp)||visit(this,ast.falseExp)},visitCall(ast){return true},visitSafeCall(ast){return true},visitImplicitReceiver(ast){return false},visitThisReceiver(ast){return false},visitInterpolation(ast){return visitSome(this,ast.expressions)},visitKeyedRead(ast){return false},visitKeyedWrite(ast){return false},visitLiteralArray(ast){return true},visitLiteralMap(ast){return true},visitLiteralPrimitive(ast){return false},visitPipe(ast){return true},visitPrefixNot(ast){return visit(this,ast.expression)},visitNonNullAssert(ast){return visit(this,ast.expression)},visitPropertyRead(ast){return false},visitPropertyWrite(ast){return false},visitSafePropertyRead(ast){return false},visitSafeKeyedRead(ast){return false}})}allocateTemporary(){const tempNumber=this._currentTemporary++;this.temporaryCount=Math.max(this._currentTemporary,this.temporaryCount);return new ReadVarExpr(temporaryName(this.bindingId,tempNumber))}releaseTemporary(temporary){this._currentTemporary--;if(temporary.name!=temporaryName(this.bindingId,this._currentTemporary)){throw new Error(`Temporary ${temporary.name} released out of order`)}}convertSourceSpan(span){if(this.baseSourceSpan){const start=this.baseSourceSpan.start.moveBy(span.start);const end=this.baseSourceSpan.start.moveBy(span.end);const fullStart=this.baseSourceSpan.fullStart.moveBy(span.start);return new ParseSourceSpan(start,end,fullStart)}else{return null}}addImplicitReceiverAccess(name){if(this.implicitReceiverAccesses){this.implicitReceiverAccesses.add(name)}}}function flattenStatements(arg,output){if(Array.isArray(arg)){arg.forEach((entry=>flattenStatements(entry,output)))}else{output.push(arg)}}function unsupported(){throw new Error("Unsupported operation")}class InterpolationExpression extends Expression{constructor(args){super(null,null);this.args=args;this.isConstant=unsupported;this.isEquivalent=unsupported;this.visitExpression=unsupported;this.clone=unsupported}}class DefaultLocalResolver{constructor(globals){this.globals=globals}notifyImplicitReceiverUse(){}maybeRestoreView(){}getLocal(name){if(name===EventHandlerVars.event.name){return EventHandlerVars.event}return null}}class BuiltinFunctionCall extends Call{constructor(span,sourceSpan,args,converter){super(span,sourceSpan,new EmptyExpr$1(span,sourceSpan),args,null);this.converter=converter}}let _SECURITY_SCHEMA;function SECURITY_SCHEMA(){if(!_SECURITY_SCHEMA){_SECURITY_SCHEMA={};registerContext(SecurityContext.HTML,["iframe|srcdoc","*|innerHTML","*|outerHTML"]);registerContext(SecurityContext.STYLE,["*|style"]);registerContext(SecurityContext.URL,["*|formAction","area|href","area|ping","audio|src","a|href","a|ping","blockquote|cite","body|background","del|cite","form|action","img|src","input|src","ins|cite","q|cite","source|src","track|src","video|poster","video|src"]);registerContext(SecurityContext.RESOURCE_URL,["applet|code","applet|codebase","base|href","embed|src","frame|src","head|profile","html|manifest","iframe|src","link|href","media|src","object|codebase","object|data","script|src"])}return _SECURITY_SCHEMA}function registerContext(ctx,specs){for(const spec of specs)_SECURITY_SCHEMA[spec.toLowerCase()]=ctx}const IFRAME_SECURITY_SENSITIVE_ATTRS=new Set(["sandbox","allow","allowfullscreen","referrerpolicy","csp","fetchpriority"]);function isIframeSecuritySensitiveAttr(attrName){return IFRAME_SECURITY_SENSITIVE_ATTRS.has(attrName.toLowerCase())}const animationKeywords=new Set(["inherit","initial","revert","unset","alternate","alternate-reverse","normal","reverse","backwards","both","forwards","none","paused","running","ease","ease-in","ease-in-out","ease-out","linear","step-start","step-end","end","jump-both","jump-end","jump-none","jump-start","start"]);const scopedAtRuleIdentifiers=["@media","@supports","@document","@layer","@container","@scope","@starting-style"];class ShadowCss{constructor(){this._animationDeclarationKeyframesRe=/(^|\s+)(?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))(?=[,\s]|$)/g}shimCssText(cssText,selector,hostSelector=""){const comments=[];cssText=cssText.replace(_commentRe,(m=>{if(m.match(_commentWithHashRe)){comments.push(m)}else{const newLinesMatches=m.match(_newLinesRe);comments.push((newLinesMatches?.join("")??"")+"\n")}return COMMENT_PLACEHOLDER}));cssText=this._insertDirectives(cssText);const scopedCssText=this._scopeCssText(cssText,selector,hostSelector);let commentIdx=0;return scopedCssText.replace(_commentWithHashPlaceHolderRe,(()=>comments[commentIdx++]))}_insertDirectives(cssText){cssText=this._insertPolyfillDirectivesInCssText(cssText);return this._insertPolyfillRulesInCssText(cssText)}_scopeKeyframesRelatedCss(cssText,scopeSelector){const unscopedKeyframesSet=new Set;const scopedKeyframesCssText=processRules(cssText,(rule=>this._scopeLocalKeyframeDeclarations(rule,scopeSelector,unscopedKeyframesSet)));return processRules(scopedKeyframesCssText,(rule=>this._scopeAnimationRule(rule,scopeSelector,unscopedKeyframesSet)))}_scopeLocalKeyframeDeclarations(rule,scopeSelector,unscopedKeyframesSet){return{...rule,selector:rule.selector.replace(/(^@(?:-webkit-)?keyframes(?:\s+))(['"]?)(.+)\2(\s*)$/,((_,start,quote,keyframeName,endSpaces)=>{unscopedKeyframesSet.add(unescapeQuotes(keyframeName,quote));return`${start}${quote}${scopeSelector}_${keyframeName}${quote}${endSpaces}`}))}}_scopeAnimationKeyframe(keyframe,scopeSelector,unscopedKeyframesSet){return keyframe.replace(/^(\s*)(['"]?)(.+?)\2(\s*)$/,((_,spaces1,quote,name,spaces2)=>{name=`${unscopedKeyframesSet.has(unescapeQuotes(name,quote))?scopeSelector+"_":""}${name}`;return`${spaces1}${quote}${name}${quote}${spaces2}`}))}_scopeAnimationRule(rule,scopeSelector,unscopedKeyframesSet){let content=rule.content.replace(/((?:^|\s+|;)(?:-webkit-)?animation(?:\s*):(?:\s*))([^;]+)/g,((_,start,animationDeclarations)=>start+animationDeclarations.replace(this._animationDeclarationKeyframesRe,((original,leadingSpaces,quote="",quotedName,nonQuotedName)=>{if(quotedName){return`${leadingSpaces}${this._scopeAnimationKeyframe(`${quote}${quotedName}${quote}`,scopeSelector,unscopedKeyframesSet)}`}else{return animationKeywords.has(nonQuotedName)?original:`${leadingSpaces}${this._scopeAnimationKeyframe(nonQuotedName,scopeSelector,unscopedKeyframesSet)}`}}))));content=content.replace(/((?:^|\s+|;)(?:-webkit-)?animation-name(?:\s*):(?:\s*))([^;]+)/g,((_match,start,commaSeparatedKeyframes)=>`${start}${commaSeparatedKeyframes.split(",").map((keyframe=>this._scopeAnimationKeyframe(keyframe,scopeSelector,unscopedKeyframesSet))).join(",")}`));return{...rule,content:content}}_insertPolyfillDirectivesInCssText(cssText){return cssText.replace(_cssContentNextSelectorRe,(function(...m){return m[2]+"{"}))}_insertPolyfillRulesInCssText(cssText){return cssText.replace(_cssContentRuleRe,((...m)=>{const rule=m[0].replace(m[1],"").replace(m[2],"");return m[4]+rule}))}_scopeCssText(cssText,scopeSelector,hostSelector){const unscopedRules=this._extractUnscopedRulesFromCssText(cssText);cssText=this._insertPolyfillHostInCssText(cssText);cssText=this._convertColonHost(cssText);cssText=this._convertColonHostContext(cssText);cssText=this._convertShadowDOMSelectors(cssText);if(scopeSelector){cssText=this._scopeKeyframesRelatedCss(cssText,scopeSelector);cssText=this._scopeSelectors(cssText,scopeSelector,hostSelector)}cssText=cssText+"\n"+unscopedRules;return cssText.trim()}_extractUnscopedRulesFromCssText(cssText){let r="";let m;_cssContentUnscopedRuleRe.lastIndex=0;while((m=_cssContentUnscopedRuleRe.exec(cssText))!==null){const rule=m[0].replace(m[2],"").replace(m[1],m[4]);r+=rule+"\n\n"}return r}_convertColonHost(cssText){return cssText.replace(_cssColonHostRe,((_,hostSelectors,otherSelectors)=>{if(hostSelectors){const convertedSelectors=[];const hostSelectorArray=hostSelectors.split(",").map((p=>p.trim()));for(const hostSelector of hostSelectorArray){if(!hostSelector)break;const convertedSelector=_polyfillHostNoCombinator+hostSelector.replace(_polyfillHost,"")+otherSelectors;convertedSelectors.push(convertedSelector)}return convertedSelectors.join(",")}else{return _polyfillHostNoCombinator+otherSelectors}}))}_convertColonHostContext(cssText){return cssText.replace(_cssColonHostContextReGlobal,(selectorText=>{const contextSelectorGroups=[[]];let match;while(match=_cssColonHostContextRe.exec(selectorText)){const newContextSelectors=(match[1]??"").trim().split(",").map((m=>m.trim())).filter((m=>m!==""));const contextSelectorGroupsLength=contextSelectorGroups.length;repeatGroups(contextSelectorGroups,newContextSelectors.length);for(let i=0;i<newContextSelectors.length;i++){for(let j=0;j<contextSelectorGroupsLength;j++){contextSelectorGroups[j+i*contextSelectorGroupsLength].push(newContextSelectors[i])}}selectorText=match[2]}return contextSelectorGroups.map((contextSelectors=>combineHostContextSelectors(contextSelectors,selectorText))).join(", ")}))}_convertShadowDOMSelectors(cssText){return _shadowDOMSelectorsRe.reduce(((result,pattern)=>result.replace(pattern," ")),cssText)}_scopeSelectors(cssText,scopeSelector,hostSelector){return processRules(cssText,(rule=>{let selector=rule.selector;let content=rule.content;if(rule.selector[0]!=="@"){selector=this._scopeSelector(rule.selector,scopeSelector,hostSelector)}else if(scopedAtRuleIdentifiers.some((atRule=>rule.selector.startsWith(atRule)))){content=this._scopeSelectors(rule.content,scopeSelector,hostSelector)}else if(rule.selector.startsWith("@font-face")||rule.selector.startsWith("@page")){content=this._stripScopingSelectors(rule.content)}return new CssRule(selector,content)}))}_stripScopingSelectors(cssText){return processRules(cssText,(rule=>{const selector=rule.selector.replace(_shadowDeepSelectors," ").replace(_polyfillHostNoCombinatorRe," ");return new CssRule(selector,rule.content)}))}_scopeSelector(selector,scopeSelector,hostSelector){return selector.split(",").map((part=>part.trim().split(_shadowDeepSelectors))).map((deepParts=>{const[shallowPart,...otherParts]=deepParts;const applyScope=shallowPart=>{if(this._selectorNeedsScoping(shallowPart,scopeSelector)){return this._applySelectorScope(shallowPart,scopeSelector,hostSelector)}else{return shallowPart}};return[applyScope(shallowPart),...otherParts].join(" ")})).join(", ")}_selectorNeedsScoping(selector,scopeSelector){const re=this._makeScopeMatcher(scopeSelector);return!re.test(selector)}_makeScopeMatcher(scopeSelector){const lre=/\[/g;const rre=/\]/g;scopeSelector=scopeSelector.replace(lre,"\\[").replace(rre,"\\]");return new RegExp("^("+scopeSelector+")"+_selectorReSuffix,"m")}_applySimpleSelectorScope(selector,scopeSelector,hostSelector){_polyfillHostRe.lastIndex=0;if(_polyfillHostRe.test(selector)){const replaceBy=`[${hostSelector}]`;return selector.replace(_polyfillHostNoCombinatorRe,((hnc,selector)=>selector.replace(/([^:]*)(:*)(.*)/,((_,before,colon,after)=>before+replaceBy+colon+after)))).replace(_polyfillHostRe,replaceBy+" ")}return scopeSelector+" "+selector}_applySelectorScope(selector,scopeSelector,hostSelector){const isRe=/\[is=([^\]]*)\]/g;scopeSelector=scopeSelector.replace(isRe,((_,...parts)=>parts[0]));const attrName="["+scopeSelector+"]";const _scopeSelectorPart=p=>{let scopedP=p.trim();if(!scopedP){return""}if(p.indexOf(_polyfillHostNoCombinator)>-1){scopedP=this._applySimpleSelectorScope(p,scopeSelector,hostSelector)}else{const t=p.replace(_polyfillHostRe,"");if(t.length>0){const matches=t.match(/([^:]*)(:*)(.*)/);if(matches){scopedP=matches[1]+attrName+matches[2]+matches[3]}}}return scopedP};const safeContent=new SafeSelector(selector);selector=safeContent.content();let scopedSelector="";let startIndex=0;let res;const sep=/( |>|\+|~(?!=))\s*/g;const hasHost=selector.indexOf(_polyfillHostNoCombinator)>-1;let shouldScope=!hasHost;while((res=sep.exec(selector))!==null){const separator=res[1];const part=selector.slice(startIndex,res.index).trim();if(part.match(/__esc-ph-(\d+)__/)&&selector[res.index+1]?.match(/[a-fA-F\d]/)){continue}shouldScope=shouldScope||part.indexOf(_polyfillHostNoCombinator)>-1;const scopedPart=shouldScope?_scopeSelectorPart(part):part;scopedSelector+=`${scopedPart} ${separator} `;startIndex=sep.lastIndex}const part=selector.substring(startIndex);shouldScope=shouldScope||part.indexOf(_polyfillHostNoCombinator)>-1;scopedSelector+=shouldScope?_scopeSelectorPart(part):part;return safeContent.restore(scopedSelector)}_insertPolyfillHostInCssText(selector){return selector.replace(_colonHostContextRe,_polyfillHostContext).replace(_colonHostRe,_polyfillHost)}}class SafeSelector{constructor(selector){this.placeholders=[];this.index=0;selector=this._escapeRegexMatches(selector,/(\[[^\]]*\])/g);selector=selector.replace(/(\\.)/g,((_,keep)=>{const replaceBy=`__esc-ph-${this.index}__`;this.placeholders.push(keep);this.index++;return replaceBy}));this._content=selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g,((_,pseudo,exp)=>{const replaceBy=`__ph-${this.index}__`;this.placeholders.push(exp);this.index++;return pseudo+replaceBy}))}restore(content){return content.replace(/__(?:ph|esc-ph)-(\d+)__/g,((_ph,index)=>this.placeholders[+index]))}content(){return this._content}_escapeRegexMatches(content,pattern){return content.replace(pattern,((_,keep)=>{const replaceBy=`__ph-${this.index}__`;this.placeholders.push(keep);this.index++;return replaceBy}))}}const _cssContentNextSelectorRe=/polyfill-next-selector[^}]*content:[\s]*?(['"])(.*?)\1[;\s]*}([^{]*?){/gim;const _cssContentRuleRe=/(polyfill-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim;const _cssContentUnscopedRuleRe=/(polyfill-unscoped-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim;const _polyfillHost="-shadowcsshost";const _polyfillHostContext="-shadowcsscontext";const _parenSuffix="(?:\\(("+"(?:\\([^)(]*\\)|[^)(]*)+?"+")\\))?([^,{]*)";const _cssColonHostRe=new RegExp(_polyfillHost+_parenSuffix,"gim");const _cssColonHostContextReGlobal=new RegExp(_polyfillHostContext+_parenSuffix,"gim");const _cssColonHostContextRe=new RegExp(_polyfillHostContext+_parenSuffix,"im");const _polyfillHostNoCombinator=_polyfillHost+"-no-combinator";const _polyfillHostNoCombinatorRe=/-shadowcsshost-no-combinator([^\s]*)/;const _shadowDOMSelectorsRe=[/::shadow/g,/::content/g,/\/shadow-deep\//g,/\/shadow\//g];const _shadowDeepSelectors=/(?:>>>)|(?:\/deep\/)|(?:::ng-deep)/g;const _selectorReSuffix="([>\\s~+[.,{:][\\s\\S]*)?$";const _polyfillHostRe=/-shadowcsshost/gim;const _colonHostRe=/:host/gim;const _colonHostContextRe=/:host-context/gim;const _newLinesRe=/\r?\n/g;const _commentRe=/\/\*[\s\S]*?\*\//g;const _commentWithHashRe=/\/\*\s*#\s*source(Mapping)?URL=/g;const COMMENT_PLACEHOLDER="%COMMENT%";const _commentWithHashPlaceHolderRe=new RegExp(COMMENT_PLACEHOLDER,"g");const BLOCK_PLACEHOLDER="%BLOCK%";const _ruleRe=new RegExp(`(\\s*(?:${COMMENT_PLACEHOLDER}\\s*)*)([^;\\{\\}]+?)(\\s*)((?:{%BLOCK%}?\\s*;?)|(?:\\s*;))`,"g");const CONTENT_PAIRS=new Map([["{","}"]]);const COMMA_IN_PLACEHOLDER="%COMMA_IN_PLACEHOLDER%";const SEMI_IN_PLACEHOLDER="%SEMI_IN_PLACEHOLDER%";const COLON_IN_PLACEHOLDER="%COLON_IN_PLACEHOLDER%";const _cssCommaInPlaceholderReGlobal=new RegExp(COMMA_IN_PLACEHOLDER,"g");const _cssSemiInPlaceholderReGlobal=new RegExp(SEMI_IN_PLACEHOLDER,"g");const _cssColonInPlaceholderReGlobal=new RegExp(COLON_IN_PLACEHOLDER,"g");class CssRule{constructor(selector,content){this.selector=selector;this.content=content}}function processRules(input,ruleCallback){const escaped=escapeInStrings(input);const inputWithEscapedBlocks=escapeBlocks(escaped,CONTENT_PAIRS,BLOCK_PLACEHOLDER);let nextBlockIndex=0;const escapedResult=inputWithEscapedBlocks.escapedString.replace(_ruleRe,((...m)=>{const selector=m[2];let content="";let suffix=m[4];let contentPrefix="";if(suffix&&suffix.startsWith("{"+BLOCK_PLACEHOLDER)){content=inputWithEscapedBlocks.blocks[nextBlockIndex++];suffix=suffix.substring(BLOCK_PLACEHOLDER.length+1);contentPrefix="{"}const rule=ruleCallback(new CssRule(selector,content));return`${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`}));return unescapeInStrings(escapedResult)}class StringWithEscapedBlocks{constructor(escapedString,blocks){this.escapedString=escapedString;this.blocks=blocks}}function escapeBlocks(input,charPairs,placeholder){const resultParts=[];const escapedBlocks=[];let openCharCount=0;let nonBlockStartIndex=0;let blockStartIndex=-1;let openChar;let closeChar;for(let i=0;i<input.length;i++){const char=input[i];if(char==="\\"){i++}else if(char===closeChar){openCharCount--;if(openCharCount===0){escapedBlocks.push(input.substring(blockStartIndex,i));resultParts.push(placeholder);nonBlockStartIndex=i;blockStartIndex=-1;openChar=closeChar=undefined}}else if(char===openChar){openCharCount++}else if(openCharCount===0&&charPairs.has(char)){openChar=char;closeChar=charPairs.get(char);openCharCount=1;blockStartIndex=i+1;resultParts.push(input.substring(nonBlockStartIndex,blockStartIndex))}}if(blockStartIndex!==-1){escapedBlocks.push(input.substring(blockStartIndex));resultParts.push(placeholder)}else{resultParts.push(input.substring(nonBlockStartIndex))}return new StringWithEscapedBlocks(resultParts.join(""),escapedBlocks)}const ESCAPE_IN_STRING_MAP={";":SEMI_IN_PLACEHOLDER,",":COMMA_IN_PLACEHOLDER,":":COLON_IN_PLACEHOLDER};function escapeInStrings(input){let result=input;let currentQuoteChar=null;for(let i=0;i<result.length;i++){const char=result[i];if(char==="\\"){i++}else{if(currentQuoteChar!==null){if(char===currentQuoteChar){currentQuoteChar=null}else{const placeholder=ESCAPE_IN_STRING_MAP[char];if(placeholder){result=`${result.substr(0,i)}${placeholder}${result.substr(i+1)}`;i+=placeholder.length-1}}}else if(char==="'"||char==='"'){currentQuoteChar=char}}}return result}function unescapeInStrings(input){let result=input.replace(_cssCommaInPlaceholderReGlobal,",");result=result.replace(_cssSemiInPlaceholderReGlobal,";");result=result.replace(_cssColonInPlaceholderReGlobal,":");return result}function unescapeQuotes(str,isQuoted){return!isQuoted?str:str.replace(/((?:^|[^\\])(?:\\\\)*)\\(?=['"])/g,"$1")}function combineHostContextSelectors(contextSelectors,otherSelectors){const hostMarker=_polyfillHostNoCombinator;_polyfillHostRe.lastIndex=0;const otherSelectorsHasHost=_polyfillHostRe.test(otherSelectors);if(contextSelectors.length===0){return hostMarker+otherSelectors}const combined=[contextSelectors.pop()||""];while(contextSelectors.length>0){const length=combined.length;const contextSelector=contextSelectors.pop();for(let i=0;i<length;i++){const previousSelectors=combined[i];combined[length*2+i]=previousSelectors+" "+contextSelector;combined[length+i]=contextSelector+" "+previousSelectors;combined[i]=contextSelector+previousSelectors}}return combined.map((s=>otherSelectorsHasHost?`${s}${otherSelectors}`:`${s}${hostMarker}${otherSelectors}, ${s} ${hostMarker}${otherSelectors}`)).join(",")}function repeatGroups(groups,multiples){const length=groups.length;for(let i=1;i<multiples;i++){for(let j=0;j<length;j++){groups[j+i*length]=groups[j].slice(0)}}}var OpKind;(function(OpKind){OpKind[OpKind["ListEnd"]=0]="ListEnd";OpKind[OpKind["Statement"]=1]="Statement";OpKind[OpKind["Variable"]=2]="Variable";OpKind[OpKind["ElementStart"]=3]="ElementStart";OpKind[OpKind["Element"]=4]="Element";OpKind[OpKind["Template"]=5]="Template";OpKind[OpKind["ElementEnd"]=6]="ElementEnd";OpKind[OpKind["ContainerStart"]=7]="ContainerStart";OpKind[OpKind["Container"]=8]="Container";OpKind[OpKind["ContainerEnd"]=9]="ContainerEnd";OpKind[OpKind["DisableBindings"]=10]="DisableBindings";OpKind[OpKind["Conditional"]=11]="Conditional";OpKind[OpKind["EnableBindings"]=12]="EnableBindings";OpKind[OpKind["Text"]=13]="Text";OpKind[OpKind["Listener"]=14]="Listener";OpKind[OpKind["InterpolateText"]=15]="InterpolateText";OpKind[OpKind["Binding"]=16]="Binding";OpKind[OpKind["Property"]=17]="Property";OpKind[OpKind["StyleProp"]=18]="StyleProp";OpKind[OpKind["ClassProp"]=19]="ClassProp";OpKind[OpKind["StyleMap"]=20]="StyleMap";OpKind[OpKind["ClassMap"]=21]="ClassMap";OpKind[OpKind["Advance"]=22]="Advance";OpKind[OpKind["Pipe"]=23]="Pipe";OpKind[OpKind["Attribute"]=24]="Attribute";OpKind[OpKind["ExtractedAttribute"]=25]="ExtractedAttribute";OpKind[OpKind["Defer"]=26]="Defer";OpKind[OpKind["DeferOn"]=27]="DeferOn";OpKind[OpKind["DeferWhen"]=28]="DeferWhen";OpKind[OpKind["I18nMessage"]=29]="I18nMessage";OpKind[OpKind["HostProperty"]=30]="HostProperty";OpKind[OpKind["Namespace"]=31]="Namespace";OpKind[OpKind["ProjectionDef"]=32]="ProjectionDef";OpKind[OpKind["Projection"]=33]="Projection";OpKind[OpKind["RepeaterCreate"]=34]="RepeaterCreate";OpKind[OpKind["Repeater"]=35]="Repeater";OpKind[OpKind["TwoWayProperty"]=36]="TwoWayProperty";OpKind[OpKind["TwoWayListener"]=37]="TwoWayListener";OpKind[OpKind["I18nStart"]=38]="I18nStart";OpKind[OpKind["I18n"]=39]="I18n";OpKind[OpKind["I18nEnd"]=40]="I18nEnd";OpKind[OpKind["I18nExpression"]=41]="I18nExpression";OpKind[OpKind["I18nApply"]=42]="I18nApply";OpKind[OpKind["IcuStart"]=43]="IcuStart";OpKind[OpKind["IcuEnd"]=44]="IcuEnd";OpKind[OpKind["IcuPlaceholder"]=45]="IcuPlaceholder";OpKind[OpKind["I18nContext"]=46]="I18nContext";OpKind[OpKind["I18nAttributes"]=47]="I18nAttributes"})(OpKind||(OpKind={}));var ExpressionKind;(function(ExpressionKind){ExpressionKind[ExpressionKind["LexicalRead"]=0]="LexicalRead";ExpressionKind[ExpressionKind["Context"]=1]="Context";ExpressionKind[ExpressionKind["TrackContext"]=2]="TrackContext";ExpressionKind[ExpressionKind["ReadVariable"]=3]="ReadVariable";ExpressionKind[ExpressionKind["NextContext"]=4]="NextContext";ExpressionKind[ExpressionKind["Reference"]=5]="Reference";ExpressionKind[ExpressionKind["GetCurrentView"]=6]="GetCurrentView";ExpressionKind[ExpressionKind["RestoreView"]=7]="RestoreView";ExpressionKind[ExpressionKind["ResetView"]=8]="ResetView";ExpressionKind[ExpressionKind["PureFunctionExpr"]=9]="PureFunctionExpr";ExpressionKind[ExpressionKind["PureFunctionParameterExpr"]=10]="PureFunctionParameterExpr";ExpressionKind[ExpressionKind["PipeBinding"]=11]="PipeBinding";ExpressionKind[ExpressionKind["PipeBindingVariadic"]=12]="PipeBindingVariadic";ExpressionKind[ExpressionKind["SafePropertyRead"]=13]="SafePropertyRead";ExpressionKind[ExpressionKind["SafeKeyedRead"]=14]="SafeKeyedRead";ExpressionKind[ExpressionKind["SafeInvokeFunction"]=15]="SafeInvokeFunction";ExpressionKind[ExpressionKind["SafeTernaryExpr"]=16]="SafeTernaryExpr";ExpressionKind[ExpressionKind["EmptyExpr"]=17]="EmptyExpr";ExpressionKind[ExpressionKind["AssignTemporaryExpr"]=18]="AssignTemporaryExpr";ExpressionKind[ExpressionKind["ReadTemporaryExpr"]=19]="ReadTemporaryExpr";ExpressionKind[ExpressionKind["SlotLiteralExpr"]=20]="SlotLiteralExpr";ExpressionKind[ExpressionKind["ConditionalCase"]=21]="ConditionalCase";ExpressionKind[ExpressionKind["ConstCollected"]=22]="ConstCollected";ExpressionKind[ExpressionKind["TwoWayBindingSet"]=23]="TwoWayBindingSet"})(ExpressionKind||(ExpressionKind={}));var VariableFlags;(function(VariableFlags){VariableFlags[VariableFlags["None"]=0]="None";VariableFlags[VariableFlags["AlwaysInline"]=1]="AlwaysInline"})(VariableFlags||(VariableFlags={}));var SemanticVariableKind;(function(SemanticVariableKind){SemanticVariableKind[SemanticVariableKind["Context"]=0]="Context";SemanticVariableKind[SemanticVariableKind["Identifier"]=1]="Identifier";SemanticVariableKind[SemanticVariableKind["SavedView"]=2]="SavedView";SemanticVariableKind[SemanticVariableKind["Alias"]=3]="Alias"})(SemanticVariableKind||(SemanticVariableKind={}));var CompatibilityMode;(function(CompatibilityMode){CompatibilityMode[CompatibilityMode["Normal"]=0]="Normal";CompatibilityMode[CompatibilityMode["TemplateDefinitionBuilder"]=1]="TemplateDefinitionBuilder"})(CompatibilityMode||(CompatibilityMode={}));var BindingKind;(function(BindingKind){BindingKind[BindingKind["Attribute"]=0]="Attribute";BindingKind[BindingKind["ClassName"]=1]="ClassName";BindingKind[BindingKind["StyleProperty"]=2]="StyleProperty";BindingKind[BindingKind["Property"]=3]="Property";BindingKind[BindingKind["Template"]=4]="Template";BindingKind[BindingKind["I18n"]=5]="I18n";BindingKind[BindingKind["Animation"]=6]="Animation";BindingKind[BindingKind["TwoWayProperty"]=7]="TwoWayProperty"})(BindingKind||(BindingKind={}));var I18nParamResolutionTime;(function(I18nParamResolutionTime){I18nParamResolutionTime[I18nParamResolutionTime["Creation"]=0]="Creation";I18nParamResolutionTime[I18nParamResolutionTime["Postproccessing"]=1]="Postproccessing"})(I18nParamResolutionTime||(I18nParamResolutionTime={}));var I18nExpressionFor;(function(I18nExpressionFor){I18nExpressionFor[I18nExpressionFor["I18nText"]=0]="I18nText";I18nExpressionFor[I18nExpressionFor["I18nAttribute"]=1]="I18nAttribute"})(I18nExpressionFor||(I18nExpressionFor={}));var I18nParamValueFlags;(function(I18nParamValueFlags){I18nParamValueFlags[I18nParamValueFlags["None"]=0]="None";I18nParamValueFlags[I18nParamValueFlags["ElementTag"]=1]="ElementTag";I18nParamValueFlags[I18nParamValueFlags["TemplateTag"]=2]="TemplateTag";I18nParamValueFlags[I18nParamValueFlags["OpenTag"]=4]="OpenTag";I18nParamValueFlags[I18nParamValueFlags["CloseTag"]=8]="CloseTag";I18nParamValueFlags[I18nParamValueFlags["ExpressionIndex"]=16]="ExpressionIndex"})(I18nParamValueFlags||(I18nParamValueFlags={}));var Namespace;(function(Namespace){Namespace[Namespace["HTML"]=0]="HTML";Namespace[Namespace["SVG"]=1]="SVG";Namespace[Namespace["Math"]=2]="Math"})(Namespace||(Namespace={}));var DeferTriggerKind;(function(DeferTriggerKind){DeferTriggerKind[DeferTriggerKind["Idle"]=0]="Idle";DeferTriggerKind[DeferTriggerKind["Immediate"]=1]="Immediate";DeferTriggerKind[DeferTriggerKind["Timer"]=2]="Timer";DeferTriggerKind[DeferTriggerKind["Hover"]=3]="Hover";DeferTriggerKind[DeferTriggerKind["Interaction"]=4]="Interaction";DeferTriggerKind[DeferTriggerKind["Viewport"]=5]="Viewport"})(DeferTriggerKind||(DeferTriggerKind={}));var I18nContextKind;(function(I18nContextKind){I18nContextKind[I18nContextKind["RootI18n"]=0]="RootI18n";I18nContextKind[I18nContextKind["Icu"]=1]="Icu";I18nContextKind[I18nContextKind["Attr"]=2]="Attr"})(I18nContextKind||(I18nContextKind={}));var TemplateKind;(function(TemplateKind){TemplateKind[TemplateKind["NgTemplate"]=0]="NgTemplate";TemplateKind[TemplateKind["Structural"]=1]="Structural";TemplateKind[TemplateKind["Block"]=2]="Block"})(TemplateKind||(TemplateKind={}));const ConsumesSlot=Symbol("ConsumesSlot");const DependsOnSlotContext=Symbol("DependsOnSlotContext");const ConsumesVarsTrait=Symbol("ConsumesVars");const UsesVarOffset=Symbol("UsesVarOffset");const TRAIT_CONSUMES_SLOT={[ConsumesSlot]:true,numSlotsUsed:1};const TRAIT_DEPENDS_ON_SLOT_CONTEXT={[DependsOnSlotContext]:true};const TRAIT_CONSUMES_VARS={[ConsumesVarsTrait]:true};function hasConsumesSlotTrait(op){return op[ConsumesSlot]===true}function hasDependsOnSlotContextTrait(op){return op[DependsOnSlotContext]===true}function hasConsumesVarsTrait(value){return value[ConsumesVarsTrait]===true}function hasUsesVarOffsetTrait(expr){return expr[UsesVarOffset]===true}function createStatementOp(statement){return{kind:OpKind.Statement,statement:statement,...NEW_OP}}function createVariableOp(xref,variable,initializer,flags){return{kind:OpKind.Variable,xref:xref,variable:variable,initializer:initializer,flags:flags,...NEW_OP}}const NEW_OP={debugListId:null,prev:null,next:null};function createInterpolateTextOp(xref,interpolation,sourceSpan){return{kind:OpKind.InterpolateText,target:xref,interpolation:interpolation,sourceSpan:sourceSpan,...TRAIT_DEPENDS_ON_SLOT_CONTEXT,...TRAIT_CONSUMES_VARS,...NEW_OP}}class Interpolation{constructor(strings,expressions,i18nPlaceholders){this.strings=strings;this.expressions=expressions;this.i18nPlaceholders=i18nPlaceholders;if(i18nPlaceholders.length!==0&&i18nPlaceholders.length!==expressions.length){throw new Error(`Expected ${expressions.length} placeholders to match interpolation expression count, but got ${i18nPlaceholders.length}`)}}}function createBindingOp(target,kind,name,expression,unit,securityContext,isTextAttribute,isStructuralTemplateAttribute,templateKind,i18nMessage,sourceSpan){return{kind:OpKind.Binding,bindingKind:kind,target:target,name:name,expression:expression,unit:unit,securityContext:securityContext,isTextAttribute:isTextAttribute,isStructuralTemplateAttribute:isStructuralTemplateAttribute,templateKind:templateKind,i18nContext:null,i18nMessage:i18nMessage,sourceSpan:sourceSpan,...NEW_OP}}function createPropertyOp(target,name,expression,isAnimationTrigger,securityContext,isStructuralTemplateAttribute,templateKind,i18nContext,i18nMessage,sourceSpan){return{kind:OpKind.Property,target:target,name:name,expression:expression,isAnimationTrigger:isAnimationTrigger,securityContext:securityContext,sanitizer:null,isStructuralTemplateAttribute:isStructuralTemplateAttribute,templateKind:templateKind,i18nContext:i18nContext,i18nMessage:i18nMessage,sourceSpan:sourceSpan,...TRAIT_DEPENDS_ON_SLOT_CONTEXT,...TRAIT_CONSUMES_VARS,...NEW_OP}}function createTwoWayPropertyOp(target,name,expression,securityContext,isStructuralTemplateAttribute,templateKind,i18nContext,i18nMessage,sourceSpan){return{kind:OpKind.TwoWayProperty,target:target,name:name,expression:expression,securityContext:securityContext,sanitizer:null,isStructuralTemplateAttribute:isStructuralTemplateAttribute,templateKind:templateKind,i18nContext:i18nContext,i18nMessage:i18nMessage,sourceSpan:sourceSpan,...TRAIT_DEPENDS_ON_SLOT_CONTEXT,...TRAIT_CONSUMES_VARS,...NEW_OP}}function createStylePropOp(xref,name,expression,unit,sourceSpan){return{kind:OpKind.StyleProp,target:xref,name:name,expression:expression,unit:unit,sourceSpan:sourceSpan,...TRAIT_DEPENDS_ON_SLOT_CONTEXT,...TRAIT_CONSUMES_VARS,...NEW_OP}}function createClassPropOp(xref,name,expression,sourceSpan){return{kind:OpKind.ClassProp,target:xref,name:name,expression:expression,sourceSpan:sourceSpan,...TRAIT_DEPENDS_ON_SLOT_CONTEXT,...TRAIT_CONSUMES_VARS,...NEW_OP}}function createStyleMapOp(xref,expression,sourceSpan){return{kind:OpKind.StyleMap,target:xref,expression:expression,sourceSpan:sourceSpan,...TRAIT_DEPENDS_ON_SLOT_CONTEXT,...TRAIT_CONSUMES_VARS,...NEW_OP}}function createClassMapOp(xref,expression,sourceSpan){return{kind:OpKind.ClassMap,target:xref,expression:expression,sourceSpan:sourceSpan,...TRAIT_DEPENDS_ON_SLOT_CONTEXT,...TRAIT_CONSUMES_VARS,...NEW_OP}}function createAttributeOp(target,namespace,name,expression,securityContext,isTextAttribute,isStructuralTemplateAttribute,templateKind,i18nMessage,sourceSpan){return{kind:OpKind.Attribute,target:target,namespace:namespace,name:name,expression:expression,securityContext:securityContext,sanitizer:null,isTextAttribute:isTextAttribute,isStructuralTemplateAttribute:isStructuralTemplateAttribute,templateKind:templateKind,i18nContext:null,i18nMessage:i18nMessage,sourceSpan:sourceSpan,...TRAIT_DEPENDS_ON_SLOT_CONTEXT,...TRAIT_CONSUMES_VARS,...NEW_OP}}function createAdvanceOp(delta,sourceSpan){return{kind:OpKind.Advance,delta:delta,sourceSpan:sourceSpan,...NEW_OP}}function createConditionalOp(target,targetSlot,test,conditions,sourceSpan){return{kind:OpKind.Conditional,target:target,targetSlot:targetSlot,test:test,conditions:conditions,processed:null,sourceSpan:sourceSpan,contextValue:null,...NEW_OP,...TRAIT_DEPENDS_ON_SLOT_CONTEXT,...TRAIT_CONSUMES_VARS}}function createRepeaterOp(repeaterCreate,targetSlot,collection,sourceSpan){return{kind:OpKind.Repeater,target:repeaterCreate,targetSlot:targetSlot,collection:collection,sourceSpan:sourceSpan,...NEW_OP,...TRAIT_DEPENDS_ON_SLOT_CONTEXT}}function createDeferWhenOp(target,expr,prefetch,sourceSpan){return{kind:OpKind.DeferWhen,target:target,expr:expr,prefetch:prefetch,sourceSpan:sourceSpan,...NEW_OP,...TRAIT_DEPENDS_ON_SLOT_CONTEXT,...TRAIT_CONSUMES_VARS}}function createI18nExpressionOp(context,target,i18nOwner,handle,expression,icuPlaceholder,i18nPlaceholder,resolutionTime,usage,name,sourceSpan){return{kind:OpKind.I18nExpression,context:context,target:target,i18nOwner:i18nOwner,handle:handle,expression:expression,icuPlaceholder:icuPlaceholder,i18nPlaceholder:i18nPlaceholder,resolutionTime:resolutionTime,usage:usage,name:name,sourceSpan:sourceSpan,...NEW_OP,...TRAIT_CONSUMES_VARS,...TRAIT_DEPENDS_ON_SLOT_CONTEXT}}function createI18nApplyOp(owner,handle,sourceSpan){return{kind:OpKind.I18nApply,owner:owner,handle:handle,sourceSpan:sourceSpan,...NEW_OP}}var _a,_b,_c,_d,_e,_f;function isIrExpression(expr){return expr instanceof ExpressionBase}class ExpressionBase extends Expression{constructor(sourceSpan=null){super(null,sourceSpan)}}class LexicalReadExpr extends ExpressionBase{constructor(name){super();this.name=name;this.kind=ExpressionKind.LexicalRead}visitExpression(visitor,context){}isEquivalent(other){return this.name===other.name}isConstant(){return false}transformInternalExpressions(){}clone(){return new LexicalReadExpr(this.name)}}class ReferenceExpr extends ExpressionBase{constructor(target,targetSlot,offset){super();this.target=target;this.targetSlot=targetSlot;this.offset=offset;this.kind=ExpressionKind.Reference}visitExpression(){}isEquivalent(e){return e instanceof ReferenceExpr&&e.target===this.target}isConstant(){return false}transformInternalExpressions(){}clone(){return new ReferenceExpr(this.target,this.targetSlot,this.offset)}}class ContextExpr extends ExpressionBase{constructor(view){super();this.view=view;this.kind=ExpressionKind.Context}visitExpression(){}isEquivalent(e){return e instanceof ContextExpr&&e.view===this.view}isConstant(){return false}transformInternalExpressions(){}clone(){return new ContextExpr(this.view)}}class TrackContextExpr extends ExpressionBase{constructor(view){super();this.view=view;this.kind=ExpressionKind.TrackContext}visitExpression(){}isEquivalent(e){return e instanceof TrackContextExpr&&e.view===this.view}isConstant(){return false}transformInternalExpressions(){}clone(){return new TrackContextExpr(this.view)}}class NextContextExpr extends ExpressionBase{constructor(){super();this.kind=ExpressionKind.NextContext;this.steps=1}visitExpression(){}isEquivalent(e){return e instanceof NextContextExpr&&e.steps===this.steps}isConstant(){return false}transformInternalExpressions(){}clone(){const expr=new NextContextExpr;expr.steps=this.steps;return expr}}class GetCurrentViewExpr extends ExpressionBase{constructor(){super();this.kind=ExpressionKind.GetCurrentView}visitExpression(){}isEquivalent(e){return e instanceof GetCurrentViewExpr}isConstant(){return false}transformInternalExpressions(){}clone(){return new GetCurrentViewExpr}}class RestoreViewExpr extends ExpressionBase{constructor(view){super();this.view=view;this.kind=ExpressionKind.RestoreView}visitExpression(visitor,context){if(typeof this.view!=="number"){this.view.visitExpression(visitor,context)}}isEquivalent(e){if(!(e instanceof RestoreViewExpr)||typeof e.view!==typeof this.view){return false}if(typeof this.view==="number"){return this.view===e.view}else{return this.view.isEquivalent(e.view)}}isConstant(){return false}transformInternalExpressions(transform,flags){if(typeof this.view!=="number"){this.view=transformExpressionsInExpression(this.view,transform,flags)}}clone(){return new RestoreViewExpr(this.view instanceof Expression?this.view.clone():this.view)}}class ResetViewExpr extends ExpressionBase{constructor(expr){super();this.expr=expr;this.kind=ExpressionKind.ResetView}visitExpression(visitor,context){this.expr.visitExpression(visitor,context)}isEquivalent(e){return e instanceof ResetViewExpr&&this.expr.isEquivalent(e.expr)}isConstant(){return false}transformInternalExpressions(transform,flags){this.expr=transformExpressionsInExpression(this.expr,transform,flags)}clone(){return new ResetViewExpr(this.expr.clone())}}class TwoWayBindingSetExpr extends ExpressionBase{constructor(target,value){super();this.target=target;this.value=value;this.kind=ExpressionKind.TwoWayBindingSet}visitExpression(visitor,context){this.target.visitExpression(visitor,context);this.value.visitExpression(visitor,context)}isEquivalent(other){return this.target.isEquivalent(other.target)&&this.value.isEquivalent(other.value)}isConstant(){return false}transformInternalExpressions(transform,flags){this.target=transformExpressionsInExpression(this.target,transform,flags);this.value=transformExpressionsInExpression(this.value,transform,flags)}clone(){return new TwoWayBindingSetExpr(this.target,this.value)}}class ReadVariableExpr extends ExpressionBase{constructor(xref){super();this.xref=xref;this.kind=ExpressionKind.ReadVariable;this.name=null}visitExpression(){}isEquivalent(other){return other instanceof ReadVariableExpr&&other.xref===this.xref}isConstant(){return false}transformInternalExpressions(){}clone(){const expr=new ReadVariableExpr(this.xref);expr.name=this.name;return expr}}class PureFunctionExpr extends ExpressionBase{static{_a=ConsumesVarsTrait,_b=UsesVarOffset}constructor(expression,args){super();this.kind=ExpressionKind.PureFunctionExpr;this[_a]=true;this[_b]=true;this.varOffset=null;this.fn=null;this.body=expression;this.args=args}visitExpression(visitor,context){this.body?.visitExpression(visitor,context);for(const arg of this.args){arg.visitExpression(visitor,context)}}isEquivalent(other){if(!(other instanceof PureFunctionExpr)||other.args.length!==this.args.length){return false}return other.body!==null&&this.body!==null&&other.body.isEquivalent(this.body)&&other.args.every(((arg,idx)=>arg.isEquivalent(this.args[idx])))}isConstant(){return false}transformInternalExpressions(transform,flags){if(this.body!==null){this.body=transformExpressionsInExpression(this.body,transform,flags|VisitorContextFlag.InChildOperation)}else if(this.fn!==null){this.fn=transformExpressionsInExpression(this.fn,transform,flags)}for(let i=0;i<this.args.length;i++){this.args[i]=transformExpressionsInExpression(this.args[i],transform,flags)}}clone(){const expr=new PureFunctionExpr(this.body?.clone()??null,this.args.map((arg=>arg.clone())));expr.fn=this.fn?.clone()??null;expr.varOffset=this.varOffset;return expr}}class PureFunctionParameterExpr extends ExpressionBase{constructor(index){super();this.index=index;this.kind=ExpressionKind.PureFunctionParameterExpr}visitExpression(){}isEquivalent(other){return other instanceof PureFunctionParameterExpr&&other.index===this.index}isConstant(){return true}transformInternalExpressions(){}clone(){return new PureFunctionParameterExpr(this.index)}}class PipeBindingExpr extends ExpressionBase{static{_c=ConsumesVarsTrait,_d=UsesVarOffset}constructor(target,targetSlot,name,args){super();this.target=target;this.targetSlot=targetSlot;this.name=name;this.args=args;this.kind=ExpressionKind.PipeBinding;this[_c]=true;this[_d]=true;this.varOffset=null}visitExpression(visitor,context){for(const arg of this.args){arg.visitExpression(visitor,context)}}isEquivalent(){return false}isConstant(){return false}transformInternalExpressions(transform,flags){for(let idx=0;idx<this.args.length;idx++){this.args[idx]=transformExpressionsInExpression(this.args[idx],transform,flags)}}clone(){const r=new PipeBindingExpr(this.target,this.targetSlot,this.name,this.args.map((a=>a.clone())));r.varOffset=this.varOffset;return r}}class PipeBindingVariadicExpr extends ExpressionBase{static{_e=ConsumesVarsTrait,_f=UsesVarOffset}constructor(target,targetSlot,name,args,numArgs){super();this.target=target;this.targetSlot=targetSlot;this.name=name;this.args=args;this.numArgs=numArgs;this.kind=ExpressionKind.PipeBindingVariadic;this[_e]=true;this[_f]=true;this.varOffset=null}visitExpression(visitor,context){this.args.visitExpression(visitor,context)}isEquivalent(){return false}isConstant(){return false}transformInternalExpressions(transform,flags){this.args=transformExpressionsInExpression(this.args,transform,flags)}clone(){const r=new PipeBindingVariadicExpr(this.target,this.targetSlot,this.name,this.args.clone(),this.numArgs);r.varOffset=this.varOffset;return r}}class SafePropertyReadExpr extends ExpressionBase{constructor(receiver,name){super();this.receiver=receiver;this.name=name;this.kind=ExpressionKind.SafePropertyRead}get index(){return this.name}visitExpression(visitor,context){this.receiver.visitExpression(visitor,context)}isEquivalent(){return false}isConstant(){return false}transformInternalExpressions(transform,flags){this.receiver=transformExpressionsInExpression(this.receiver,transform,flags)}clone(){return new SafePropertyReadExpr(this.receiver.clone(),this.name)}}class SafeKeyedReadExpr extends ExpressionBase{constructor(receiver,index,sourceSpan){super(sourceSpan);this.receiver=receiver;this.index=index;this.kind=ExpressionKind.SafeKeyedRead}visitExpression(visitor,context){this.receiver.visitExpression(visitor,context);this.index.visitExpression(visitor,context)}isEquivalent(){return false}isConstant(){return false}transformInternalExpressions(transform,flags){this.receiver=transformExpressionsInExpression(this.receiver,transform,flags);this.index=transformExpressionsInExpression(this.index,transform,flags)}clone(){return new SafeKeyedReadExpr(this.receiver.clone(),this.index.clone(),this.sourceSpan)}}class SafeInvokeFunctionExpr extends ExpressionBase{constructor(receiver,args){super();this.receiver=receiver;this.args=args;this.kind=ExpressionKind.SafeInvokeFunction}visitExpression(visitor,context){this.receiver.visitExpression(visitor,context);for(const a of this.args){a.visitExpression(visitor,context)}}isEquivalent(){return false}isConstant(){return false}transformInternalExpressions(transform,flags){this.receiver=transformExpressionsInExpression(this.receiver,transform,flags);for(let i=0;i<this.args.length;i++){this.args[i]=transformExpressionsInExpression(this.args[i],transform,flags)}}clone(){return new SafeInvokeFunctionExpr(this.receiver.clone(),this.args.map((a=>a.clone())))}}class SafeTernaryExpr extends ExpressionBase{constructor(guard,expr){super();this.guard=guard;this.expr=expr;this.kind=ExpressionKind.SafeTernaryExpr}visitExpression(visitor,context){this.guard.visitExpression(visitor,context);this.expr.visitExpression(visitor,context)}isEquivalent(){return false}isConstant(){return false}transformInternalExpressions(transform,flags){this.guard=transformExpressionsInExpression(this.guard,transform,flags);this.expr=transformExpressionsInExpression(this.expr,transform,flags)}clone(){return new SafeTernaryExpr(this.guard.clone(),this.expr.clone())}}class EmptyExpr extends ExpressionBase{constructor(){super(...arguments);this.kind=ExpressionKind.EmptyExpr}visitExpression(visitor,context){}isEquivalent(e){return e instanceof EmptyExpr}isConstant(){return true}clone(){return new EmptyExpr}transformInternalExpressions(){}}class AssignTemporaryExpr extends ExpressionBase{constructor(expr,xref){super();this.expr=expr;this.xref=xref;this.kind=ExpressionKind.AssignTemporaryExpr;this.name=null}visitExpression(visitor,context){this.expr.visitExpression(visitor,context)}isEquivalent(){return false}isConstant(){return false}transformInternalExpressions(transform,flags){this.expr=transformExpressionsInExpression(this.expr,transform,flags)}clone(){const a=new AssignTemporaryExpr(this.expr.clone(),this.xref);a.name=this.name;return a}}class ReadTemporaryExpr extends ExpressionBase{constructor(xref){super();this.xref=xref;this.kind=ExpressionKind.ReadTemporaryExpr;this.name=null}visitExpression(visitor,context){}isEquivalent(){return this.xref===this.xref}isConstant(){return false}transformInternalExpressions(transform,flags){}clone(){const r=new ReadTemporaryExpr(this.xref);r.name=this.name;return r}}class SlotLiteralExpr extends ExpressionBase{constructor(slot){super();this.slot=slot;this.kind=ExpressionKind.SlotLiteralExpr}visitExpression(visitor,context){}isEquivalent(e){return e instanceof SlotLiteralExpr&&e.slot===this.slot}isConstant(){return true}clone(){return new SlotLiteralExpr(this.slot)}transformInternalExpressions(){}}class ConditionalCaseExpr extends ExpressionBase{constructor(expr,target,targetSlot,alias=null){super();this.expr=expr;this.target=target;this.targetSlot=targetSlot;this.alias=alias;this.kind=ExpressionKind.ConditionalCase}visitExpression(visitor,context){if(this.expr!==null){this.expr.visitExpression(visitor,context)}}isEquivalent(e){return e instanceof ConditionalCaseExpr&&e.expr===this.expr}isConstant(){return true}clone(){return new ConditionalCaseExpr(this.expr,this.target,this.targetSlot)}transformInternalExpressions(transform,flags){if(this.expr!==null){this.expr=transformExpressionsInExpression(this.expr,transform,flags)}}}class ConstCollectedExpr extends ExpressionBase{constructor(expr){super();this.expr=expr;this.kind=ExpressionKind.ConstCollected}transformInternalExpressions(transform,flags){this.expr=transform(this.expr,flags)}visitExpression(visitor,context){this.expr.visitExpression(visitor,context)}isEquivalent(e){if(!(e instanceof ConstCollectedExpr)){return false}return this.expr.isEquivalent(e.expr)}isConstant(){return this.expr.isConstant()}clone(){return new ConstCollectedExpr(this.expr)}}function visitExpressionsInOp(op,visitor){transformExpressionsInOp(op,((expr,flags)=>{visitor(expr,flags);return expr}),VisitorContextFlag.None)}var VisitorContextFlag;(function(VisitorContextFlag){VisitorContextFlag[VisitorContextFlag["None"]=0]="None";VisitorContextFlag[VisitorContextFlag["InChildOperation"]=1]="InChildOperation"})(VisitorContextFlag||(VisitorContextFlag={}));function transformExpressionsInInterpolation(interpolation,transform,flags){for(let i=0;i<interpolation.expressions.length;i++){interpolation.expressions[i]=transformExpressionsInExpression(interpolation.expressions[i],transform,flags)}}function transformExpressionsInOp(op,transform,flags){switch(op.kind){case OpKind.StyleProp:case OpKind.StyleMap:case OpKind.ClassProp:case OpKind.ClassMap:case OpKind.Binding:if(op.expression instanceof Interpolation){transformExpressionsInInterpolation(op.expression,transform,flags)}else{op.expression=transformExpressionsInExpression(op.expression,transform,flags)}break;case OpKind.Property:case OpKind.HostProperty:case OpKind.Attribute:if(op.expression instanceof Interpolation){transformExpressionsInInterpolation(op.expression,transform,flags)}else{op.expression=transformExpressionsInExpression(op.expression,transform,flags)}op.sanitizer=op.sanitizer&&transformExpressionsInExpression(op.sanitizer,transform,flags);break;case OpKind.TwoWayProperty:op.expression=transformExpressionsInExpression(op.expression,transform,flags);op.sanitizer=op.sanitizer&&transformExpressionsInExpression(op.sanitizer,transform,flags);break;case OpKind.I18nExpression:op.expression=transformExpressionsInExpression(op.expression,transform,flags);break;case OpKind.InterpolateText:transformExpressionsInInterpolation(op.interpolation,transform,flags);break;case OpKind.Statement:transformExpressionsInStatement(op.statement,transform,flags);break;case OpKind.Variable:op.initializer=transformExpressionsInExpression(op.initializer,transform,flags);break;case OpKind.Conditional:for(const condition of op.conditions){if(condition.expr===null){continue}condition.expr=transformExpressionsInExpression(condition.expr,transform,flags)}if(op.processed!==null){op.processed=transformExpressionsInExpression(op.processed,transform,flags)}if(op.contextValue!==null){op.contextValue=transformExpressionsInExpression(op.contextValue,transform,flags)}break;case OpKind.Listener:case OpKind.TwoWayListener:for(const innerOp of op.handlerOps){transformExpressionsInOp(innerOp,transform,flags|VisitorContextFlag.InChildOperation)}break;case OpKind.ExtractedAttribute:op.expression=op.expression&&transformExpressionsInExpression(op.expression,transform,flags);op.trustedValueFn=op.trustedValueFn&&transformExpressionsInExpression(op.trustedValueFn,transform,flags);break;case OpKind.RepeaterCreate:op.track=transformExpressionsInExpression(op.track,transform,flags);if(op.trackByFn!==null){op.trackByFn=transformExpressionsInExpression(op.trackByFn,transform,flags)}break;case OpKind.Repeater:op.collection=transformExpressionsInExpression(op.collection,transform,flags);break;case OpKind.Defer:if(op.loadingConfig!==null){op.loadingConfig=transformExpressionsInExpression(op.loadingConfig,transform,flags)}if(op.placeholderConfig!==null){op.placeholderConfig=transformExpressionsInExpression(op.placeholderConfig,transform,flags)}if(op.resolverFn!==null){op.resolverFn=transformExpressionsInExpression(op.resolverFn,transform,flags)}break;case OpKind.I18nMessage:for(const[placeholder,expr]of op.params){op.params.set(placeholder,transformExpressionsInExpression(expr,transform,flags))}for(const[placeholder,expr]of op.postprocessingParams){op.postprocessingParams.set(placeholder,transformExpressionsInExpression(expr,transform,flags))}break;case OpKind.DeferWhen:op.expr=transformExpressionsInExpression(op.expr,transform,flags);break;case OpKind.Advance:case OpKind.Container:case OpKind.ContainerEnd:case OpKind.ContainerStart:case OpKind.DeferOn:case OpKind.DisableBindings:case OpKind.Element:case OpKind.ElementEnd:case OpKind.ElementStart:case OpKind.EnableBindings:case OpKind.I18n:case OpKind.I18nApply:case OpKind.I18nContext:case OpKind.I18nEnd:case OpKind.I18nStart:case OpKind.IcuEnd:case OpKind.IcuStart:case OpKind.Namespace:case OpKind.Pipe:case OpKind.Projection:case OpKind.ProjectionDef:case OpKind.Template:case OpKind.Text:case OpKind.I18nAttributes:case OpKind.IcuPlaceholder:break;default:throw new Error(`AssertionError: transformExpressionsInOp doesn't handle ${OpKind[op.kind]}`)}}function transformExpressionsInExpression(expr,transform,flags){if(expr instanceof ExpressionBase){expr.transformInternalExpressions(transform,flags)}else if(expr instanceof BinaryOperatorExpr){expr.lhs=transformExpressionsInExpression(expr.lhs,transform,flags);expr.rhs=transformExpressionsInExpression(expr.rhs,transform,flags)}else if(expr instanceof UnaryOperatorExpr){expr.expr=transformExpressionsInExpression(expr.expr,transform,flags)}else if(expr instanceof ReadPropExpr){expr.receiver=transformExpressionsInExpression(expr.receiver,transform,flags)}else if(expr instanceof ReadKeyExpr){expr.receiver=transformExpressionsInExpression(expr.receiver,transform,flags);expr.index=transformExpressionsInExpression(expr.index,transform,flags)}else if(expr instanceof WritePropExpr){expr.receiver=transformExpressionsInExpression(expr.receiver,transform,flags);expr.value=transformExpressionsInExpression(expr.value,transform,flags)}else if(expr instanceof WriteKeyExpr){expr.receiver=transformExpressionsInExpression(expr.receiver,transform,flags);expr.index=transformExpressionsInExpression(expr.index,transform,flags);expr.value=transformExpressionsInExpression(expr.value,transform,flags)}else if(expr instanceof InvokeFunctionExpr){expr.fn=transformExpressionsInExpression(expr.fn,transform,flags);for(let i=0;i<expr.args.length;i++){expr.args[i]=transformExpressionsInExpression(expr.args[i],transform,flags)}}else if(expr instanceof LiteralArrayExpr){for(let i=0;i<expr.entries.length;i++){expr.entries[i]=transformExpressionsInExpression(expr.entries[i],transform,flags)}}else if(expr instanceof LiteralMapExpr){for(let i=0;i<expr.entries.length;i++){expr.entries[i].value=transformExpressionsInExpression(expr.entries[i].value,transform,flags)}}else if(expr instanceof ConditionalExpr){expr.condition=transformExpressionsInExpression(expr.condition,transform,flags);expr.trueCase=transformExpressionsInExpression(expr.trueCase,transform,flags);if(expr.falseCase!==null){expr.falseCase=transformExpressionsInExpression(expr.falseCase,transform,flags)}}else if(expr instanceof TypeofExpr){expr.expr=transformExpressionsInExpression(expr.expr,transform,flags)}else if(expr instanceof WriteVarExpr){expr.value=transformExpressionsInExpression(expr.value,transform,flags)}else if(expr instanceof LocalizedString){for(let i=0;i<expr.expressions.length;i++){expr.expressions[i]=transformExpressionsInExpression(expr.expressions[i],transform,flags)}}else if(expr instanceof NotExpr){expr.condition=transformExpressionsInExpression(expr.condition,transform,flags)}else if(expr instanceof TaggedTemplateExpr){expr.tag=transformExpressionsInExpression(expr.tag,transform,flags);expr.template.expressions=expr.template.expressions.map((e=>transformExpressionsInExpression(e,transform,flags)))}else if(expr instanceof ArrowFunctionExpr){if(Array.isArray(expr.body)){for(let i=0;i<expr.body.length;i++){transformExpressionsInStatement(expr.body[i],transform,flags)}}else{expr.body=transformExpressionsInExpression(expr.body,transform,flags)}}else if(expr instanceof WrappedNodeExpr);else if(expr instanceof ReadVarExpr||expr instanceof ExternalExpr||expr instanceof LiteralExpr);else{throw new Error(`Unhandled expression kind: ${expr.constructor.name}`)}return transform(expr,flags)}function transformExpressionsInStatement(stmt,transform,flags){if(stmt instanceof ExpressionStatement){stmt.expr=transformExpressionsInExpression(stmt.expr,transform,flags)}else if(stmt instanceof ReturnStatement){stmt.value=transformExpressionsInExpression(stmt.value,transform,flags)}else if(stmt instanceof DeclareVarStmt){if(stmt.value!==undefined){stmt.value=transformExpressionsInExpression(stmt.value,transform,flags)}}else if(stmt instanceof IfStmt){stmt.condition=transformExpressionsInExpression(stmt.condition,transform,flags);for(const caseStatement of stmt.trueCase){transformExpressionsInStatement(caseStatement,transform,flags)}for(const caseStatement of stmt.falseCase){transformExpressionsInStatement(caseStatement,transform,flags)}}else{throw new Error(`Unhandled statement kind: ${stmt.constructor.name}`)}}function isStringLiteral(expr){return expr instanceof LiteralExpr&&typeof expr.value==="string"}class OpList{static{this.nextListId=0}constructor(){this.debugListId=OpList.nextListId++;this.head={kind:OpKind.ListEnd,next:null,prev:null,debugListId:this.debugListId};this.tail={kind:OpKind.ListEnd,next:null,prev:null,debugListId:this.debugListId};this.head.next=this.tail;this.tail.prev=this.head}push(op){if(Array.isArray(op)){for(const o of op){this.push(o)}return}OpList.assertIsNotEnd(op);OpList.assertIsUnowned(op);op.debugListId=this.debugListId;const oldLast=this.tail.prev;op.prev=oldLast;oldLast.next=op;op.next=this.tail;this.tail.prev=op}prepend(ops){if(ops.length===0){return}for(const op of ops){OpList.assertIsNotEnd(op);OpList.assertIsUnowned(op);op.debugListId=this.debugListId}const first=this.head.next;let prev=this.head;for(const op of ops){prev.next=op;op.prev=prev;prev=op}prev.next=first;first.prev=prev}*[Symbol.iterator](){let current=this.head.next;while(current!==this.tail){OpList.assertIsOwned(current,this.debugListId);const next=current.next;yield current;current=next}}*reversed(){let current=this.tail.prev;while(current!==this.head){OpList.assertIsOwned(current,this.debugListId);const prev=current.prev;yield current;current=prev}}static replace(oldOp,newOp){OpList.assertIsNotEnd(oldOp);OpList.assertIsNotEnd(newOp);OpList.assertIsOwned(oldOp);OpList.assertIsUnowned(newOp);newOp.debugListId=oldOp.debugListId;if(oldOp.prev!==null){oldOp.prev.next=newOp;newOp.prev=oldOp.prev}if(oldOp.next!==null){oldOp.next.prev=newOp;newOp.next=oldOp.next}oldOp.debugListId=null;oldOp.prev=null;oldOp.next=null}static replaceWithMany(oldOp,newOps){if(newOps.length===0){OpList.remove(oldOp);return}OpList.assertIsNotEnd(oldOp);OpList.assertIsOwned(oldOp);const listId=oldOp.debugListId;oldOp.debugListId=null;for(const newOp of newOps){OpList.assertIsNotEnd(newOp);OpList.assertIsUnowned(newOp)}const{prev:oldPrev,next:oldNext}=oldOp;oldOp.prev=null;oldOp.next=null;let prev=oldPrev;for(const newOp of newOps){this.assertIsUnowned(newOp);newOp.debugListId=listId;prev.next=newOp;newOp.prev=prev;newOp.next=null;prev=newOp}const first=newOps[0];const last=prev;if(oldPrev!==null){oldPrev.next=first;first.prev=oldPrev}if(oldNext!==null){oldNext.prev=last;last.next=oldNext}}static remove(op){OpList.assertIsNotEnd(op);OpList.assertIsOwned(op);op.prev.next=op.next;op.next.prev=op.prev;op.debugListId=null;op.prev=null;op.next=null}static insertBefore(op,target){if(Array.isArray(op)){for(const o of op){this.insertBefore(o,target)}return}OpList.assertIsOwned(target);if(target.prev===null){throw new Error(`AssertionError: illegal operation on list start`)}OpList.assertIsNotEnd(op);OpList.assertIsUnowned(op);op.debugListId=target.debugListId;op.prev=null;target.prev.next=op;op.prev=target.prev;op.next=target;target.prev=op}static insertAfter(op,target){OpList.assertIsOwned(target);if(target.next===null){throw new Error(`AssertionError: illegal operation on list end`)}OpList.assertIsNotEnd(op);OpList.assertIsUnowned(op);op.debugListId=target.debugListId;target.next.prev=op;op.next=target.next;op.prev=target;target.next=op}static assertIsUnowned(op){if(op.debugListId!==null){throw new Error(`AssertionError: illegal operation on owned node: ${OpKind[op.kind]}`)}}static assertIsOwned(op,byList){if(op.debugListId===null){throw new Error(`AssertionError: illegal operation on unowned node: ${OpKind[op.kind]}`)}else if(byList!==undefined&&op.debugListId!==byList){throw new Error(`AssertionError: node belongs to the wrong list (expected ${byList}, actual ${op.debugListId})`)}}static assertIsNotEnd(op){if(op.kind===OpKind.ListEnd){throw new Error(`AssertionError: illegal operation on list head or tail`)}}}class SlotHandle{constructor(){this.slot=null}}const elementContainerOpKinds=new Set([OpKind.Element,OpKind.ElementStart,OpKind.Container,OpKind.ContainerStart,OpKind.Template,OpKind.RepeaterCreate]);function isElementOrContainerOp(op){return elementContainerOpKinds.has(op.kind)}function createElementStartOp(tag,xref,namespace,i18nPlaceholder,startSourceSpan,wholeSourceSpan){return{kind:OpKind.ElementStart,xref:xref,tag:tag,handle:new SlotHandle,attributes:null,localRefs:[],nonBindable:false,namespace:namespace,i18nPlaceholder:i18nPlaceholder,startSourceSpan:startSourceSpan,wholeSourceSpan:wholeSourceSpan,...TRAIT_CONSUMES_SLOT,...NEW_OP}}function createTemplateOp(xref,templateKind,tag,functionNameSuffix,namespace,i18nPlaceholder,startSourceSpan,wholeSourceSpan){return{kind:OpKind.Template,xref:xref,templateKind:templateKind,attributes:null,tag:tag,handle:new SlotHandle,functionNameSuffix:functionNameSuffix,decls:null,vars:null,localRefs:[],nonBindable:false,namespace:namespace,i18nPlaceholder:i18nPlaceholder,startSourceSpan:startSourceSpan,wholeSourceSpan:wholeSourceSpan,...TRAIT_CONSUMES_SLOT,...NEW_OP}}function createRepeaterCreateOp(primaryView,emptyView,tag,track,varNames,emptyTag,i18nPlaceholder,emptyI18nPlaceholder,startSourceSpan,wholeSourceSpan){return{kind:OpKind.RepeaterCreate,attributes:null,xref:primaryView,handle:new SlotHandle,emptyView:emptyView,track:track,trackByFn:null,tag:tag,emptyTag:emptyTag,emptyAttributes:null,functionNameSuffix:"For",namespace:Namespace.HTML,nonBindable:false,localRefs:[],decls:null,vars:null,varNames:varNames,usesComponentInstance:false,i18nPlaceholder:i18nPlaceholder,emptyI18nPlaceholder:emptyI18nPlaceholder,startSourceSpan:startSourceSpan,wholeSourceSpan:wholeSourceSpan,...TRAIT_CONSUMES_SLOT,...NEW_OP,...TRAIT_CONSUMES_VARS,numSlotsUsed:emptyView===null?2:3}}function createElementEndOp(xref,sourceSpan){return{kind:OpKind.ElementEnd,xref:xref,sourceSpan:sourceSpan,...NEW_OP}}function createDisableBindingsOp(xref){return{kind:OpKind.DisableBindings,xref:xref,...NEW_OP}}function createEnableBindingsOp(xref){return{kind:OpKind.EnableBindings,xref:xref,...NEW_OP}}function createTextOp(xref,initialValue,icuPlaceholder,sourceSpan){return{kind:OpKind.Text,xref:xref,handle:new SlotHandle,initialValue:initialValue,icuPlaceholder:icuPlaceholder,sourceSpan:sourceSpan,...TRAIT_CONSUMES_SLOT,...NEW_OP}}function createListenerOp(target,targetSlot,name,tag,handlerOps,animationPhase,eventTarget,hostListener,sourceSpan){const handlerList=new OpList;handlerList.push(handlerOps);return{kind:OpKind.Listener,target:target,targetSlot:targetSlot,tag:tag,hostListener:hostListener,name:name,handlerOps:handlerList,handlerFnName:null,consumesDollarEvent:false,isAnimationListener:animationPhase!==null,animationPhase:animationPhase,eventTarget:eventTarget,sourceSpan:sourceSpan,...NEW_OP}}function createTwoWayListenerOp(target,targetSlot,name,tag,handlerOps,sourceSpan){const handlerList=new OpList;handlerList.push(handlerOps);return{kind:OpKind.TwoWayListener,target:target,targetSlot:targetSlot,tag:tag,name:name,handlerOps:handlerList,handlerFnName:null,sourceSpan:sourceSpan,...NEW_OP}}function createPipeOp(xref,slot,name){return{kind:OpKind.Pipe,xref:xref,handle:slot,name:name,...NEW_OP,...TRAIT_CONSUMES_SLOT}}function createNamespaceOp(namespace){return{kind:OpKind.Namespace,active:namespace,...NEW_OP}}function createProjectionDefOp(def){return{kind:OpKind.ProjectionDef,def:def,...NEW_OP}}function createProjectionOp(xref,selector,i18nPlaceholder,sourceSpan){return{kind:OpKind.Projection,xref:xref,handle:new SlotHandle,selector:selector,i18nPlaceholder:i18nPlaceholder,projectionSlotIndex:0,attributes:null,localRefs:[],sourceSpan:sourceSpan,...NEW_OP,...TRAIT_CONSUMES_SLOT}}function createExtractedAttributeOp(target,bindingKind,namespace,name,expression,i18nContext,i18nMessage,securityContext){return{kind:OpKind.ExtractedAttribute,target:target,bindingKind:bindingKind,namespace:namespace,name:name,expression:expression,i18nContext:i18nContext,i18nMessage:i18nMessage,securityContext:securityContext,trustedValueFn:null,...NEW_OP}}function createDeferOp(xref,main,mainSlot,metadata,resolverFn,sourceSpan){return{kind:OpKind.Defer,xref:xref,handle:new SlotHandle,mainView:main,mainSlot:mainSlot,loadingView:null,loadingSlot:null,loadingConfig:null,loadingMinimumTime:null,loadingAfterTime:null,placeholderView:null,placeholderSlot:null,placeholderConfig:null,placeholderMinimumTime:null,errorView:null,errorSlot:null,metadata:metadata,resolverFn:resolverFn,sourceSpan:sourceSpan,...NEW_OP,...TRAIT_CONSUMES_SLOT,numSlotsUsed:2}}function createDeferOnOp(defer,trigger,prefetch,sourceSpan){return{kind:OpKind.DeferOn,defer:defer,trigger:trigger,prefetch:prefetch,sourceSpan:sourceSpan,...NEW_OP}}function createI18nMessageOp(xref,i18nContext,i18nBlock,message,messagePlaceholder,params,postprocessingParams,needsPostprocessing){return{kind:OpKind.I18nMessage,xref:xref,i18nContext:i18nContext,i18nBlock:i18nBlock,message:message,messagePlaceholder:messagePlaceholder,params:params,postprocessingParams:postprocessingParams,needsPostprocessing:needsPostprocessing,subMessages:[],...NEW_OP}}function createI18nStartOp(xref,message,root,sourceSpan){return{kind:OpKind.I18nStart,xref:xref,handle:new SlotHandle,root:root??xref,message:message,messageIndex:null,subTemplateIndex:null,context:null,sourceSpan:sourceSpan,...NEW_OP,...TRAIT_CONSUMES_SLOT}}function createI18nEndOp(xref,sourceSpan){return{kind:OpKind.I18nEnd,xref:xref,sourceSpan:sourceSpan,...NEW_OP}}function createIcuStartOp(xref,message,messagePlaceholder,sourceSpan){return{kind:OpKind.IcuStart,xref:xref,message:message,messagePlaceholder:messagePlaceholder,context:null,sourceSpan:sourceSpan,...NEW_OP}}function createIcuEndOp(xref){return{kind:OpKind.IcuEnd,xref:xref,...NEW_OP}}function createIcuPlaceholderOp(xref,name,strings){return{kind:OpKind.IcuPlaceholder,xref:xref,name:name,strings:strings,expressionPlaceholders:[],...NEW_OP}}function createI18nContextOp(contextKind,xref,i18nBlock,message,sourceSpan){if(i18nBlock===null&&contextKind!==I18nContextKind.Attr){throw new Error("AssertionError: i18nBlock must be provided for non-attribute contexts.")}return{kind:OpKind.I18nContext,contextKind:contextKind,xref:xref,i18nBlock:i18nBlock,message:message,sourceSpan:sourceSpan,params:new Map,postprocessingParams:new Map,...NEW_OP}}function createI18nAttributesOp(xref,handle,target){return{kind:OpKind.I18nAttributes,xref:xref,handle:handle,target:target,i18nAttributesConfig:null,...NEW_OP,...TRAIT_CONSUMES_SLOT}}function createHostPropertyOp(name,expression,isAnimationTrigger,i18nContext,securityContext,sourceSpan){return{kind:OpKind.HostProperty,name:name,expression:expression,isAnimationTrigger:isAnimationTrigger,i18nContext:i18nContext,securityContext:securityContext,sanitizer:null,sourceSpan:sourceSpan,...TRAIT_CONSUMES_VARS,...NEW_OP}}const CTX_REF="CTX_REF_MARKER";var CompilationJobKind;(function(CompilationJobKind){CompilationJobKind[CompilationJobKind["Tmpl"]=0]="Tmpl";CompilationJobKind[CompilationJobKind["Host"]=1]="Host";CompilationJobKind[CompilationJobKind["Both"]=2]="Both"})(CompilationJobKind||(CompilationJobKind={}));class CompilationJob{constructor(componentName,pool,compatibility){this.componentName=componentName;this.pool=pool;this.compatibility=compatibility;this.kind=CompilationJobKind.Both;this.nextXrefId=0}allocateXrefId(){return this.nextXrefId++}}class ComponentCompilationJob extends CompilationJob{constructor(componentName,pool,compatibility,relativeContextFilePath,i18nUseExternalIds,deferBlocksMeta,allDeferrableDepsFn){super(componentName,pool,compatibility);this.relativeContextFilePath=relativeContextFilePath;this.i18nUseExternalIds=i18nUseExternalIds;this.deferBlocksMeta=deferBlocksMeta;this.allDeferrableDepsFn=allDeferrableDepsFn;this.kind=CompilationJobKind.Tmpl;this.fnSuffix="Template";this.views=new Map;this.contentSelectors=null;this.consts=[];this.constsInitializers=[];this.root=new ViewCompilationUnit(this,this.allocateXrefId(),null);this.views.set(this.root.xref,this.root)}allocateView(parent){const view=new ViewCompilationUnit(this,this.allocateXrefId(),parent);this.views.set(view.xref,view);return view}get units(){return this.views.values()}addConst(newConst,initializers){for(let idx=0;idx<this.consts.length;idx++){if(this.consts[idx].isEquivalent(newConst)){return idx}}const idx=this.consts.length;this.consts.push(newConst);if(initializers){this.constsInitializers.push(...initializers)}return idx}}class CompilationUnit{constructor(xref){this.xref=xref;this.create=new OpList;this.update=new OpList;this.fnName=null;this.vars=null}*ops(){for(const op of this.create){yield op;if(op.kind===OpKind.Listener||op.kind===OpKind.TwoWayListener){for(const listenerOp of op.handlerOps){yield listenerOp}}}for(const op of this.update){yield op}}}class ViewCompilationUnit extends CompilationUnit{constructor(job,xref,parent){super(xref);this.job=job;this.parent=parent;this.contextVariables=new Map;this.aliases=new Set;this.decls=null}}class HostBindingCompilationJob extends CompilationJob{constructor(componentName,pool,compatibility){super(componentName,pool,compatibility);this.kind=CompilationJobKind.Host;this.fnSuffix="HostBindings";this.root=new HostBindingCompilationUnit(this)}get units(){return[this.root]}}class HostBindingCompilationUnit extends CompilationUnit{constructor(job){super(0);this.job=job;this.attributes=null}}function deleteAnyCasts(job){for(const unit of job.units){for(const op of unit.ops()){transformExpressionsInOp(op,removeAnys,VisitorContextFlag.None)}}}function removeAnys(e){if(e instanceof InvokeFunctionExpr&&e.fn instanceof LexicalReadExpr&&e.fn.name==="$any"){if(e.args.length!==1){throw new Error("The $any builtin function expects exactly one argument.")}return e.args[0]}return e}function applyI18nExpressions(job){const i18nContexts=new Map;for(const unit of job.units){for(const op of unit.create){if(op.kind===OpKind.I18nContext){i18nContexts.set(op.xref,op)}}}for(const unit of job.units){for(const op of unit.update){if(op.kind===OpKind.I18nExpression&&needsApplication(i18nContexts,op)){OpList.insertAfter(createI18nApplyOp(op.i18nOwner,op.handle,null),op)}}}}function needsApplication(i18nContexts,op){if(op.next?.kind!==OpKind.I18nExpression){return true}const context=i18nContexts.get(op.context);const nextContext=i18nContexts.get(op.next.context);if(context===undefined){throw new Error("AssertionError: expected an I18nContextOp to exist for the I18nExpressionOp's context")}if(nextContext===undefined){throw new Error("AssertionError: expected an I18nContextOp to exist for the next I18nExpressionOp's context")}if(context.i18nBlock!==null){if(context.i18nBlock!==nextContext.i18nBlock){return true}return false}if(op.i18nOwner!==op.next.i18nOwner){return true}return false}function assignI18nSlotDependencies(job){for(const unit of job.units){let updateOp=unit.update.head;let i18nExpressionsInProgress=[];let state=null;for(const createOp of unit.create){if(createOp.kind===OpKind.I18nStart){state={blockXref:createOp.xref,lastSlotConsumer:createOp.xref}}else if(createOp.kind===OpKind.I18nEnd){for(const op of i18nExpressionsInProgress){op.target=state.lastSlotConsumer;OpList.insertBefore(op,updateOp)}i18nExpressionsInProgress.length=0;state=null}if(hasConsumesSlotTrait(createOp)){if(state!==null){state.lastSlotConsumer=createOp.xref}while(true){if(updateOp.next===null){break}if(state!==null&&updateOp.kind===OpKind.I18nExpression&&updateOp.usage===I18nExpressionFor.I18nText&&updateOp.i18nOwner===state.blockXref){const opToRemove=updateOp;updateOp=updateOp.next;OpList.remove(opToRemove);i18nExpressionsInProgress.push(opToRemove);continue}if(hasDependsOnSlotContextTrait(updateOp)&&updateOp.target!==createOp.xref){break}updateOp=updateOp.next}}}}}function createOpXrefMap(unit){const map=new Map;for(const op of unit.create){if(!hasConsumesSlotTrait(op)){continue}map.set(op.xref,op);if(op.kind===OpKind.RepeaterCreate&&op.emptyView!==null){map.set(op.emptyView,op)}}return map}function extractAttributes(job){for(const unit of job.units){const elements=createOpXrefMap(unit);for(const op of unit.ops()){switch(op.kind){case OpKind.Attribute:extractAttributeOp(unit,op,elements);break;case OpKind.Property:if(!op.isAnimationTrigger){let bindingKind;if(op.i18nMessage!==null&&op.templateKind===null){bindingKind=BindingKind.I18n}else if(op.isStructuralTemplateAttribute){bindingKind=BindingKind.Template}else{bindingKind=BindingKind.Property}OpList.insertBefore(createExtractedAttributeOp(op.target,bindingKind,null,op.name,null,null,null,op.securityContext),lookupElement$2(elements,op.target))}break;case OpKind.TwoWayProperty:OpList.insertBefore(createExtractedAttributeOp(op.target,BindingKind.TwoWayProperty,null,op.name,null,null,null,op.securityContext),lookupElement$2(elements,op.target));break;case OpKind.StyleProp:case OpKind.ClassProp:if(unit.job.compatibility===CompatibilityMode.TemplateDefinitionBuilder&&op.expression instanceof EmptyExpr){OpList.insertBefore(createExtractedAttributeOp(op.target,BindingKind.Property,null,op.name,null,null,null,SecurityContext.STYLE),lookupElement$2(elements,op.target))}break;case OpKind.Listener:if(!op.isAnimationListener){const extractedAttributeOp=createExtractedAttributeOp(op.target,BindingKind.Property,null,op.name,null,null,null,SecurityContext.NONE);if(job.kind===CompilationJobKind.Host){if(job.compatibility){break}unit.create.push(extractedAttributeOp)}else{OpList.insertBefore(extractedAttributeOp,lookupElement$2(elements,op.target))}}break;case OpKind.TwoWayListener:if(job.kind!==CompilationJobKind.Host){const extractedAttributeOp=createExtractedAttributeOp(op.target,BindingKind.Property,null,op.name,null,null,null,SecurityContext.NONE);OpList.insertBefore(extractedAttributeOp,lookupElement$2(elements,op.target))}break}}}}function lookupElement$2(elements,xref){const el=elements.get(xref);if(el===undefined){throw new Error("All attributes should have an element-like target.")}return el}function extractAttributeOp(unit,op,elements){if(op.expression instanceof Interpolation){return}let extractable=op.isTextAttribute||op.expression.isConstant();if(unit.job.compatibility===CompatibilityMode.TemplateDefinitionBuilder){extractable&&=op.isTextAttribute}if(extractable){const extractedAttributeOp=createExtractedAttributeOp(op.target,op.isStructuralTemplateAttribute?BindingKind.Template:BindingKind.Attribute,op.namespace,op.name,op.expression,op.i18nContext,op.i18nMessage,op.securityContext);if(unit.job.kind===CompilationJobKind.Host){unit.create.push(extractedAttributeOp)}else{const ownerOp=lookupElement$2(elements,op.target);OpList.insertBefore(extractedAttributeOp,ownerOp)}OpList.remove(op)}}function lookupElement$1(elements,xref){const el=elements.get(xref);if(el===undefined){throw new Error("All attributes should have an element-like target.")}return el}function specializeBindings(job){const elements=new Map;for(const unit of job.units){for(const op of unit.create){if(!isElementOrContainerOp(op)){continue}elements.set(op.xref,op)}}for(const unit of job.units){for(const op of unit.ops()){if(op.kind!==OpKind.Binding){continue}switch(op.bindingKind){case BindingKind.Attribute:if(op.name==="ngNonBindable"){OpList.remove(op);const target=lookupElement$1(elements,op.target);target.nonBindable=true}else{const[namespace,name]=splitNsName(op.name);OpList.replace(op,createAttributeOp(op.target,namespace,name,op.expression,op.securityContext,op.isTextAttribute,op.isStructuralTemplateAttribute,op.templateKind,op.i18nMessage,op.sourceSpan))}break;case BindingKind.Property:case BindingKind.Animation:if(job.kind===CompilationJobKind.Host){OpList.replace(op,createHostPropertyOp(op.name,op.expression,op.bindingKind===BindingKind.Animation,op.i18nContext,op.securityContext,op.sourceSpan))}else{OpList.replace(op,createPropertyOp(op.target,op.name,op.expression,op.bindingKind===BindingKind.Animation,op.securityContext,op.isStructuralTemplateAttribute,op.templateKind,op.i18nContext,op.i18nMessage,op.sourceSpan))}break;case BindingKind.TwoWayProperty:if(!(op.expression instanceof Expression)){throw new Error(`Expected value of two-way property binding "${op.name}" to be an expression`)}OpList.replace(op,createTwoWayPropertyOp(op.target,op.name,op.expression,op.securityContext,op.isStructuralTemplateAttribute,op.templateKind,op.i18nContext,op.i18nMessage,op.sourceSpan));break;case BindingKind.I18n:case BindingKind.ClassName:case BindingKind.StyleProperty:throw new Error(`Unhandled binding of kind ${BindingKind[op.bindingKind]}`)}}}}const CHAINABLE=new Set([Identifiers.attribute,Identifiers.classProp,Identifiers.element,Identifiers.elementContainer,Identifiers.elementContainerEnd,Identifiers.elementContainerStart,Identifiers.elementEnd,Identifiers.elementStart,Identifiers.hostProperty,Identifiers.i18nExp,Identifiers.listener,Identifiers.listener,Identifiers.property,Identifiers.styleProp,Identifiers.stylePropInterpolate1,Identifiers.stylePropInterpolate2,Identifiers.stylePropInterpolate3,Identifiers.stylePropInterpolate4,Identifiers.stylePropInterpolate5,Identifiers.stylePropInterpolate6,Identifiers.stylePropInterpolate7,Identifiers.stylePropInterpolate8,Identifiers.stylePropInterpolateV,Identifiers.syntheticHostListener,Identifiers.syntheticHostProperty,Identifiers.templateCreate,Identifiers.twoWayProperty,Identifiers.twoWayListener]);function chain(job){for(const unit of job.units){chainOperationsInList(unit.create);chainOperationsInList(unit.update)}}function chainOperationsInList(opList){let chain=null;for(const op of opList){if(op.kind!==OpKind.Statement||!(op.statement instanceof ExpressionStatement)){chain=null;continue}if(!(op.statement.expr instanceof InvokeFunctionExpr)||!(op.statement.expr.fn instanceof ExternalExpr)){chain=null;continue}const instruction=op.statement.expr.fn.value;if(!CHAINABLE.has(instruction)){chain=null;continue}if(chain!==null&&chain.instruction===instruction){const expression=chain.expression.callFn(op.statement.expr.args,op.statement.expr.sourceSpan,op.statement.expr.pure);chain.expression=expression;chain.op.statement=expression.toStmt();OpList.remove(op)}else{chain={op:op,instruction:instruction,expression:op.statement.expr}}}}function collapseSingletonInterpolations(job){for(const unit of job.units){for(const op of unit.update){const eligibleOpKind=op.kind===OpKind.Attribute;if(eligibleOpKind&&op.expression instanceof Interpolation&&op.expression.strings.length===2&&op.expression.strings.every((s=>s===""))){op.expression=op.expression.expressions[0]}}}}function generateConditionalExpressions(job){for(const unit of job.units){for(const op of unit.ops()){if(op.kind!==OpKind.Conditional){continue}let test;const defaultCase=op.conditions.findIndex((cond=>cond.expr===null));if(defaultCase>=0){const slot=op.conditions.splice(defaultCase,1)[0].targetSlot;test=new SlotLiteralExpr(slot)}else{test=literal(-1)}let tmp=op.test==null?null:new AssignTemporaryExpr(op.test,job.allocateXrefId());for(let i=op.conditions.length-1;i>=0;i--){let conditionalCase=op.conditions[i];if(conditionalCase.expr===null){continue}if(tmp!==null){const useTmp=i===0?tmp:new ReadTemporaryExpr(tmp.xref);conditionalCase.expr=new BinaryOperatorExpr(exports.BinaryOperator.Identical,useTmp,conditionalCase.expr)}else if(conditionalCase.alias!==null){const caseExpressionTemporaryXref=job.allocateXrefId();conditionalCase.expr=new AssignTemporaryExpr(conditionalCase.expr,caseExpressionTemporaryXref);op.contextValue=new ReadTemporaryExpr(caseExpressionTemporaryXref)}test=new ConditionalExpr(conditionalCase.expr,new SlotLiteralExpr(conditionalCase.targetSlot),test)}op.processed=test;op.conditions=[]}}}const BINARY_OPERATORS=new Map([["&&",exports.BinaryOperator.And],[">",exports.BinaryOperator.Bigger],[">=",exports.BinaryOperator.BiggerEquals],["|",exports.BinaryOperator.BitwiseOr],["&",exports.BinaryOperator.BitwiseAnd],["/",exports.BinaryOperator.Divide],["==",exports.BinaryOperator.Equals],["===",exports.BinaryOperator.Identical],["<",exports.BinaryOperator.Lower],["<=",exports.BinaryOperator.LowerEquals],["-",exports.BinaryOperator.Minus],["%",exports.BinaryOperator.Modulo],["*",exports.BinaryOperator.Multiply],["!=",exports.BinaryOperator.NotEquals],["!==",exports.BinaryOperator.NotIdentical],["??",exports.BinaryOperator.NullishCoalesce],["||",exports.BinaryOperator.Or],["+",exports.BinaryOperator.Plus]]);function namespaceForKey(namespacePrefixKey){const NAMESPACES=new Map([["svg",Namespace.SVG],["math",Namespace.Math]]);if(namespacePrefixKey===null){return Namespace.HTML}return NAMESPACES.get(namespacePrefixKey)??Namespace.HTML}function keyForNamespace(namespace){const NAMESPACES=new Map([["svg",Namespace.SVG],["math",Namespace.Math]]);for(const[k,n]of NAMESPACES.entries()){if(n===namespace){return k}}return null}function prefixWithNamespace(strippedTag,namespace){if(namespace===Namespace.HTML){return strippedTag}return`:${keyForNamespace(namespace)}:${strippedTag}`}function literalOrArrayLiteral(value){if(Array.isArray(value)){return literalArr(value.map(literalOrArrayLiteral))}return literal(value)}function collectElementConsts(job){const allElementAttributes=new Map;for(const unit of job.units){for(const op of unit.create){if(op.kind===OpKind.ExtractedAttribute){const attributes=allElementAttributes.get(op.target)||new ElementAttributes(job.compatibility);allElementAttributes.set(op.target,attributes);attributes.add(op.bindingKind,op.name,op.expression,op.namespace,op.trustedValueFn);OpList.remove(op)}}}if(job instanceof ComponentCompilationJob){for(const unit of job.units){for(const op of unit.create){if(op.kind==OpKind.Projection){const attributes=allElementAttributes.get(op.xref);if(attributes!==undefined){const attrArray=serializeAttributes(attributes);if(attrArray.entries.length>0){op.attributes=attrArray}}}else if(isElementOrContainerOp(op)){op.attributes=getConstIndex(job,allElementAttributes,op.xref);if(op.kind===OpKind.RepeaterCreate&&op.emptyView!==null){op.emptyAttributes=getConstIndex(job,allElementAttributes,op.emptyView)}}}}}else if(job instanceof HostBindingCompilationJob){for(const[xref,attributes]of allElementAttributes.entries()){if(xref!==job.root.xref){throw new Error(`An attribute would be const collected into the host binding's template function, but is not associated with the root xref.`)}const attrArray=serializeAttributes(attributes);if(attrArray.entries.length>0){job.root.attributes=attrArray}}}}function getConstIndex(job,allElementAttributes,xref){const attributes=allElementAttributes.get(xref);if(attributes!==undefined){const attrArray=serializeAttributes(attributes);if(attrArray.entries.length>0){return job.addConst(attrArray)}}return null}const FLYWEIGHT_ARRAY=Object.freeze([]);class ElementAttributes{get attributes(){return this.byKind.get(BindingKind.Attribute)??FLYWEIGHT_ARRAY}get classes(){return this.byKind.get(BindingKind.ClassName)??FLYWEIGHT_ARRAY}get styles(){return this.byKind.get(BindingKind.StyleProperty)??FLYWEIGHT_ARRAY}get bindings(){return this.propertyBindings??FLYWEIGHT_ARRAY}get template(){return this.byKind.get(BindingKind.Template)??FLYWEIGHT_ARRAY}get i18n(){return this.byKind.get(BindingKind.I18n)??FLYWEIGHT_ARRAY}constructor(compatibility){this.compatibility=compatibility;this.known=new Map;this.byKind=new Map;this.propertyBindings=null;this.projectAs=null}isKnown(kind,name){const nameToValue=this.known.get(kind)??new Set;this.known.set(kind,nameToValue);if(nameToValue.has(name)){return true}nameToValue.add(name);return false}add(kind,name,value,namespace,trustedValueFn){const allowDuplicates=this.compatibility===CompatibilityMode.TemplateDefinitionBuilder&&(kind===BindingKind.Attribute||kind===BindingKind.ClassName||kind===BindingKind.StyleProperty);if(!allowDuplicates&&this.isKnown(kind,name)){return}if(name==="ngProjectAs"){if(value===null||!(value instanceof LiteralExpr)||value.value==null||typeof value.value?.toString()!=="string"){throw Error("ngProjectAs must have a string literal value")}this.projectAs=value.value.toString()}const array=this.arrayFor(kind);array.push(...getAttributeNameLiterals$1(namespace,name));if(kind===BindingKind.Attribute||kind===BindingKind.StyleProperty){if(value===null){throw Error("Attribute, i18n attribute, & style element attributes must have a value")}if(trustedValueFn!==null){if(!isStringLiteral(value)){throw Error("AssertionError: extracted attribute value should be string literal")}array.push(taggedTemplate(trustedValueFn,new TemplateLiteral([new TemplateLiteralElement(value.value)],[]),undefined,value.sourceSpan))}else{array.push(value)}}}arrayFor(kind){if(kind===BindingKind.Property||kind===BindingKind.TwoWayProperty){this.propertyBindings??=[];return this.propertyBindings}else{if(!this.byKind.has(kind)){this.byKind.set(kind,[])}return this.byKind.get(kind)}}}function getAttributeNameLiterals$1(namespace,name){const nameLiteral=literal(name);if(namespace){return[literal(0),literal(namespace),nameLiteral]}return[nameLiteral]}function serializeAttributes({attributes:attributes,bindings:bindings,classes:classes,i18n:i18n,projectAs:projectAs,styles:styles,template:template}){const attrArray=[...attributes];if(projectAs!==null){const parsedR3Selector=parseSelectorToR3Selector(projectAs)[0];attrArray.push(literal(5),literalOrArrayLiteral(parsedR3Selector))}if(classes.length>0){attrArray.push(literal(1),...classes)}if(styles.length>0){attrArray.push(literal(2),...styles)}if(bindings.length>0){attrArray.push(literal(3),...bindings)}if(template.length>0){attrArray.push(literal(4),...template)}if(i18n.length>0){attrArray.push(literal(6),...i18n)}return literalArr(attrArray)}function convertI18nBindings(job){const i18nAttributesByElem=new Map;for(const unit of job.units){for(const op of unit.create){if(op.kind===OpKind.I18nAttributes){i18nAttributesByElem.set(op.target,op)}}for(const op of unit.update){switch(op.kind){case OpKind.Property:case OpKind.Attribute:if(op.i18nContext===null){continue}if(!(op.expression instanceof Interpolation)){continue}const i18nAttributesForElem=i18nAttributesByElem.get(op.target);if(i18nAttributesForElem===undefined){throw new Error("AssertionError: An i18n attribute binding instruction requires the owning element to have an I18nAttributes create instruction")}if(i18nAttributesForElem.target!==op.target){throw new Error("AssertionError: Expected i18nAttributes target element to match binding target element")}const ops=[];for(let i=0;i<op.expression.expressions.length;i++){const expr=op.expression.expressions[i];if(op.expression.i18nPlaceholders.length!==op.expression.expressions.length){throw new Error(`AssertionError: An i18n attribute binding instruction requires the same number of expressions and placeholders, but found ${op.expression.i18nPlaceholders.length} placeholders and ${op.expression.expressions.length} expressions`)}ops.push(createI18nExpressionOp(op.i18nContext,i18nAttributesForElem.target,i18nAttributesForElem.xref,i18nAttributesForElem.handle,expr,null,op.expression.i18nPlaceholders[i],I18nParamResolutionTime.Creation,I18nExpressionFor.I18nAttribute,op.name,op.sourceSpan))}OpList.replaceWithMany(op,ops);break}}}}function createDeferDepsFns(job){for(const unit of job.units){for(const op of unit.create){if(op.kind===OpKind.Defer){if(op.metadata.deps.length===0){continue}if(op.resolverFn!==null){continue}const dependencies=[];for(const dep of op.metadata.deps){if(dep.isDeferrable){const innerFn=arrowFn([new FnParam("m",DYNAMIC_TYPE)],variable("m").prop(dep.isDefaultImport?"default":dep.symbolName));const importExpr=new DynamicImportExpr(dep.importPath).prop("then").callFn([innerFn]);dependencies.push(importExpr)}else{dependencies.push(dep.type)}}const depsFnExpr=arrowFn([],literalArr(dependencies));if(op.handle.slot===null){throw new Error("AssertionError: slot must be assigned bfore extracting defer deps functions")}const fullPathName=unit.fnName?.replace(`_Template`,``);op.resolverFn=job.pool.getSharedFunctionReference(depsFnExpr,`${fullPathName}_Defer_${op.handle.slot}_DepsFn`,false)}}}}function createI18nContexts(job){const attrContextByMessage=new Map;for(const unit of job.units){for(const op of unit.ops()){switch(op.kind){case OpKind.Binding:case OpKind.Property:case OpKind.Attribute:case OpKind.ExtractedAttribute:if(op.i18nMessage===null){continue}if(!attrContextByMessage.has(op.i18nMessage)){const i18nContext=createI18nContextOp(I18nContextKind.Attr,job.allocateXrefId(),null,op.i18nMessage,null);unit.create.push(i18nContext);attrContextByMessage.set(op.i18nMessage,i18nContext.xref)}op.i18nContext=attrContextByMessage.get(op.i18nMessage);break}}}const blockContextByI18nBlock=new Map;for(const unit of job.units){for(const op of unit.create){switch(op.kind){case OpKind.I18nStart:if(op.xref===op.root){const contextOp=createI18nContextOp(I18nContextKind.RootI18n,job.allocateXrefId(),op.xref,op.message,null);unit.create.push(contextOp);op.context=contextOp.xref;blockContextByI18nBlock.set(op.xref,contextOp)}break}}}for(const unit of job.units){for(const op of unit.create){if(op.kind===OpKind.I18nStart&&op.xref!==op.root){const rootContext=blockContextByI18nBlock.get(op.root);if(rootContext===undefined){throw Error("AssertionError: Root i18n block i18n context should have been created.")}op.context=rootContext.xref;blockContextByI18nBlock.set(op.xref,rootContext)}}}let currentI18nOp=null;for(const unit of job.units){for(const op of unit.create){switch(op.kind){case OpKind.I18nStart:currentI18nOp=op;break;case OpKind.I18nEnd:currentI18nOp=null;break;case OpKind.IcuStart:if(currentI18nOp===null){throw Error("AssertionError: Unexpected ICU outside of an i18n block.")}if(op.message.id!==currentI18nOp.message.id){const contextOp=createI18nContextOp(I18nContextKind.Icu,job.allocateXrefId(),currentI18nOp.root,op.message,null);unit.create.push(contextOp);op.context=contextOp.xref}else{op.context=currentI18nOp.context;blockContextByI18nBlock.get(currentI18nOp.xref).contextKind=I18nContextKind.Icu}break}}}}function deduplicateTextBindings(job){const seen=new Map;for(const unit of job.units){for(const op of unit.update.reversed()){if(op.kind===OpKind.Binding&&op.isTextAttribute){const seenForElement=seen.get(op.target)||new Set;if(seenForElement.has(op.name)){if(job.compatibility===CompatibilityMode.TemplateDefinitionBuilder){if(op.name==="style"||op.name==="class"){OpList.remove(op)}}}seenForElement.add(op.name);seen.set(op.target,seenForElement)}}}}function configureDeferInstructions(job){for(const unit of job.units){for(const op of unit.create){if(op.kind!==OpKind.Defer){continue}if(op.placeholderMinimumTime!==null){op.placeholderConfig=new ConstCollectedExpr(literalOrArrayLiteral([op.placeholderMinimumTime]))}if(op.loadingMinimumTime!==null||op.loadingAfterTime!==null){op.loadingConfig=new ConstCollectedExpr(literalOrArrayLiteral([op.loadingMinimumTime,op.loadingAfterTime]))}}}}function resolveDeferTargetNames(job){const scopes=new Map;function getScopeForView(view){if(scopes.has(view.xref)){return scopes.get(view.xref)}const scope=new Scope$1;for(const op of view.create){if(!isElementOrContainerOp(op)||op.localRefs===null){continue}if(!Array.isArray(op.localRefs)){throw new Error("LocalRefs were already processed, but were needed to resolve defer targets.")}for(const ref of op.localRefs){if(ref.target!==""){continue}scope.targets.set(ref.name,{xref:op.xref,slot:op.handle})}}scopes.set(view.xref,scope);return scope}function resolveTrigger(deferOwnerView,op,placeholderView){switch(op.trigger.kind){case DeferTriggerKind.Idle:case DeferTriggerKind.Immediate:case DeferTriggerKind.Timer:return;case DeferTriggerKind.Hover:case DeferTriggerKind.Interaction:case DeferTriggerKind.Viewport:if(op.trigger.targetName===null){if(placeholderView===null){throw new Error("defer on trigger with no target name must have a placeholder block")}const placeholder=job.views.get(placeholderView);if(placeholder==undefined){throw new Error("AssertionError: could not find placeholder view for defer on trigger")}for(const placeholderOp of placeholder.create){if(hasConsumesSlotTrait(placeholderOp)&&(isElementOrContainerOp(placeholderOp)||placeholderOp.kind===OpKind.Projection)){op.trigger.targetXref=placeholderOp.xref;op.trigger.targetView=placeholderView;op.trigger.targetSlotViewSteps=-1;op.trigger.targetSlot=placeholderOp.handle;return}}return}let view=placeholderView!==null?job.views.get(placeholderView):deferOwnerView;let step=placeholderView!==null?-1:0;while(view!==null){const scope=getScopeForView(view);if(scope.targets.has(op.trigger.targetName)){const{xref:xref,slot:slot}=scope.targets.get(op.trigger.targetName);op.trigger.targetXref=xref;op.trigger.targetView=view.xref;op.trigger.targetSlotViewSteps=step;op.trigger.targetSlot=slot;return}view=view.parent!==null?job.views.get(view.parent):null;step++}break;default:throw new Error(`Trigger kind ${op.trigger.kind} not handled`)}}for(const unit of job.units){const defers=new Map;for(const op of unit.create){switch(op.kind){case OpKind.Defer:defers.set(op.xref,op);break;case OpKind.DeferOn:const deferOp=defers.get(op.defer);resolveTrigger(unit,op,deferOp.placeholderView);break}}}}class Scope$1{constructor(){this.targets=new Map}}const REPLACEMENTS=new Map([[OpKind.ElementEnd,[OpKind.ElementStart,OpKind.Element]],[OpKind.ContainerEnd,[OpKind.ContainerStart,OpKind.Container]],[OpKind.I18nEnd,[OpKind.I18nStart,OpKind.I18n]]]);const IGNORED_OP_KINDS=new Set([OpKind.Pipe]);function collapseEmptyInstructions(job){for(const unit of job.units){for(const op of unit.create){const opReplacements=REPLACEMENTS.get(op.kind);if(opReplacements===undefined){continue}const[startKind,mergedKind]=opReplacements;let prevOp=op.prev;while(prevOp!==null&&IGNORED_OP_KINDS.has(prevOp.kind)){prevOp=prevOp.prev}if(prevOp!==null&&prevOp.kind===startKind){prevOp.kind=mergedKind;OpList.remove(op)}}}}function expandSafeReads(job){for(const unit of job.units){for(const op of unit.ops()){transformExpressionsInOp(op,(e=>safeTransform(e,{job:job})),VisitorContextFlag.None);transformExpressionsInOp(op,ternaryTransform,VisitorContextFlag.None)}}}[InvokeFunctionExpr,LiteralArrayExpr,LiteralMapExpr,SafeInvokeFunctionExpr,PipeBindingExpr].map((e=>e.constructor.name));function needsTemporaryInSafeAccess(e){if(e instanceof UnaryOperatorExpr){return needsTemporaryInSafeAccess(e.expr)}else if(e instanceof BinaryOperatorExpr){return needsTemporaryInSafeAccess(e.lhs)||needsTemporaryInSafeAccess(e.rhs)}else if(e instanceof ConditionalExpr){if(e.falseCase&&needsTemporaryInSafeAccess(e.falseCase))return true;return needsTemporaryInSafeAccess(e.condition)||needsTemporaryInSafeAccess(e.trueCase)}else if(e instanceof NotExpr){return needsTemporaryInSafeAccess(e.condition)}else if(e instanceof AssignTemporaryExpr){return needsTemporaryInSafeAccess(e.expr)}else if(e instanceof ReadPropExpr){return needsTemporaryInSafeAccess(e.receiver)}else if(e instanceof ReadKeyExpr){return needsTemporaryInSafeAccess(e.receiver)||needsTemporaryInSafeAccess(e.index)}return e instanceof InvokeFunctionExpr||e instanceof LiteralArrayExpr||e instanceof LiteralMapExpr||e instanceof SafeInvokeFunctionExpr||e instanceof PipeBindingExpr}function temporariesIn(e){const temporaries=new Set;transformExpressionsInExpression(e,(e=>{if(e instanceof AssignTemporaryExpr){temporaries.add(e.xref)}return e}),VisitorContextFlag.None);return temporaries}function eliminateTemporaryAssignments(e,tmps,ctx){transformExpressionsInExpression(e,(e=>{if(e instanceof AssignTemporaryExpr&&tmps.has(e.xref)){const read=new ReadTemporaryExpr(e.xref);return ctx.job.compatibility===CompatibilityMode.TemplateDefinitionBuilder?new AssignTemporaryExpr(read,read.xref):read}return e}),VisitorContextFlag.None);return e}function safeTernaryWithTemporary(guard,body,ctx){let result;if(needsTemporaryInSafeAccess(guard)){const xref=ctx.job.allocateXrefId();result=[new AssignTemporaryExpr(guard,xref),new ReadTemporaryExpr(xref)]}else{result=[guard,guard.clone()];eliminateTemporaryAssignments(result[1],temporariesIn(result[0]),ctx)}return new SafeTernaryExpr(result[0],body(result[1]))}function isSafeAccessExpression(e){return e instanceof SafePropertyReadExpr||e instanceof SafeKeyedReadExpr||e instanceof SafeInvokeFunctionExpr}function isUnsafeAccessExpression(e){return e instanceof ReadPropExpr||e instanceof ReadKeyExpr||e instanceof InvokeFunctionExpr}function isAccessExpression(e){return isSafeAccessExpression(e)||isUnsafeAccessExpression(e)}function deepestSafeTernary(e){if(isAccessExpression(e)&&e.receiver instanceof SafeTernaryExpr){let st=e.receiver;while(st.expr instanceof SafeTernaryExpr){st=st.expr}return st}return null}function safeTransform(e,ctx){if(!isAccessExpression(e)){return e}const dst=deepestSafeTernary(e);if(dst){if(e instanceof InvokeFunctionExpr){dst.expr=dst.expr.callFn(e.args);return e.receiver}if(e instanceof ReadPropExpr){dst.expr=dst.expr.prop(e.name);return e.receiver}if(e instanceof ReadKeyExpr){dst.expr=dst.expr.key(e.index);return e.receiver}if(e instanceof SafeInvokeFunctionExpr){dst.expr=safeTernaryWithTemporary(dst.expr,(r=>r.callFn(e.args)),ctx);return e.receiver}if(e instanceof SafePropertyReadExpr){dst.expr=safeTernaryWithTemporary(dst.expr,(r=>r.prop(e.name)),ctx);return e.receiver}if(e instanceof SafeKeyedReadExpr){dst.expr=safeTernaryWithTemporary(dst.expr,(r=>r.key(e.index)),ctx);return e.receiver}}else{if(e instanceof SafeInvokeFunctionExpr){return safeTernaryWithTemporary(e.receiver,(r=>r.callFn(e.args)),ctx)}if(e instanceof SafePropertyReadExpr){return safeTernaryWithTemporary(e.receiver,(r=>r.prop(e.name)),ctx)}if(e instanceof SafeKeyedReadExpr){return safeTernaryWithTemporary(e.receiver,(r=>r.key(e.index)),ctx)}}return e}function ternaryTransform(e){if(!(e instanceof SafeTernaryExpr)){return e}return new ConditionalExpr(new BinaryOperatorExpr(exports.BinaryOperator.Equals,e.guard,NULL_EXPR),NULL_EXPR,e.expr)}const ESCAPE$1="\ufffd";const ELEMENT_MARKER="#";const TEMPLATE_MARKER="*";const TAG_CLOSE_MARKER="/";const CONTEXT_MARKER=":";const LIST_START_MARKER="[";const LIST_END_MARKER="]";const LIST_DELIMITER="|";function extractI18nMessages(job){const i18nMessagesByContext=new Map;const i18nBlocks=new Map;const i18nContexts=new Map;for(const unit of job.units){for(const op of unit.create){switch(op.kind){case OpKind.I18nContext:const i18nMessageOp=createI18nMessage(job,op);unit.create.push(i18nMessageOp);i18nMessagesByContext.set(op.xref,i18nMessageOp);i18nContexts.set(op.xref,op);break;case OpKind.I18nStart:i18nBlocks.set(op.xref,op);break}}}let currentIcu=null;for(const unit of job.units){for(const op of unit.create){switch(op.kind){case OpKind.IcuStart:currentIcu=op;OpList.remove(op);const icuContext=i18nContexts.get(op.context);if(icuContext.contextKind!==I18nContextKind.Icu){continue}const i18nBlock=i18nBlocks.get(icuContext.i18nBlock);if(i18nBlock.context===icuContext.xref){continue}const rootI18nBlock=i18nBlocks.get(i18nBlock.root);const rootMessage=i18nMessagesByContext.get(rootI18nBlock.context);if(rootMessage===undefined){throw Error("AssertionError: ICU sub-message should belong to a root message.")}const subMessage=i18nMessagesByContext.get(icuContext.xref);subMessage.messagePlaceholder=op.messagePlaceholder;rootMessage.subMessages.push(subMessage.xref);break;case OpKind.IcuEnd:currentIcu=null;OpList.remove(op);break;case OpKind.IcuPlaceholder:if(currentIcu===null||currentIcu.context==null){throw Error("AssertionError: Unexpected ICU placeholder outside of i18n context")}const msg=i18nMessagesByContext.get(currentIcu.context);msg.postprocessingParams.set(op.name,literal(formatIcuPlaceholder(op)));OpList.remove(op);break}}}}function createI18nMessage(job,context,messagePlaceholder){let formattedParams=formatParams(context.params);const formattedPostprocessingParams=formatParams(context.postprocessingParams);let needsPostprocessing=[...context.params.values()].some((v=>v.length>1));return createI18nMessageOp(job.allocateXrefId(),context.xref,context.i18nBlock,context.message,null,formattedParams,formattedPostprocessingParams,needsPostprocessing)}function formatIcuPlaceholder(op){if(op.strings.length!==op.expressionPlaceholders.length+1){throw Error(`AssertionError: Invalid ICU placeholder with ${op.strings.length} strings and ${op.expressionPlaceholders.length} expressions`)}const values=op.expressionPlaceholders.map(formatValue);return op.strings.flatMap(((str,i)=>[str,values[i]||""])).join("")}function formatParams(params){const formattedParams=new Map;for(const[placeholder,placeholderValues]of params){const serializedValues=formatParamValues(placeholderValues);if(serializedValues!==null){formattedParams.set(placeholder,literal(serializedValues))}}return formattedParams}function formatParamValues(values){if(values.length===0){return null}const serializedValues=values.map((value=>formatValue(value)));return serializedValues.length===1?serializedValues[0]:`${LIST_START_MARKER}${serializedValues.join(LIST_DELIMITER)}${LIST_END_MARKER}`}function formatValue(value){if(value.flags&I18nParamValueFlags.ElementTag&&value.flags&I18nParamValueFlags.TemplateTag){if(typeof value.value!=="object"){throw Error("AssertionError: Expected i18n param value to have an element and template slot")}const elementValue=formatValue({...value,value:value.value.element,flags:value.flags&~I18nParamValueFlags.TemplateTag});const templateValue=formatValue({...value,value:value.value.template,flags:value.flags&~I18nParamValueFlags.ElementTag});if(value.flags&I18nParamValueFlags.OpenTag&&value.flags&I18nParamValueFlags.CloseTag){return`${templateValue}${elementValue}${templateValue}`}return value.flags&I18nParamValueFlags.CloseTag?`${elementValue}${templateValue}`:`${templateValue}${elementValue}`}if(value.flags&I18nParamValueFlags.OpenTag&&value.flags&I18nParamValueFlags.CloseTag){return`${formatValue({...value,flags:value.flags&~I18nParamValueFlags.CloseTag})}${formatValue({...value,flags:value.flags&~I18nParamValueFlags.OpenTag})}`}if(value.flags===I18nParamValueFlags.None){return`${value.value}`}let tagMarker="";let closeMarker="";if(value.flags&I18nParamValueFlags.ElementTag){tagMarker=ELEMENT_MARKER}else if(value.flags&I18nParamValueFlags.TemplateTag){tagMarker=TEMPLATE_MARKER}if(tagMarker!==""){closeMarker=value.flags&I18nParamValueFlags.CloseTag?TAG_CLOSE_MARKER:""}const context=value.subTemplateIndex===null?"":`${CONTEXT_MARKER}${value.subTemplateIndex}`;return`${ESCAPE$1}${closeMarker}${tagMarker}${value.value}${context}${ESCAPE$1}`}function generateAdvance(job){for(const unit of job.units){const slotMap=new Map;for(const op of unit.create){if(!hasConsumesSlotTrait(op)){continue}else if(op.handle.slot===null){throw new Error(`AssertionError: expected slots to have been allocated before generating advance() calls`)}slotMap.set(op.xref,op.handle.slot)}let slotContext=0;for(const op of unit.update){if(!hasDependsOnSlotContextTrait(op)){continue}else if(!slotMap.has(op.target)){throw new Error(`AssertionError: reference to unknown slot for target ${op.target}`)}const slot=slotMap.get(op.target);if(slotContext!==slot){const delta=slot-slotContext;if(delta<0){throw new Error(`AssertionError: slot counter should never need to move backwards`)}OpList.insertBefore(createAdvanceOp(delta,op.sourceSpan),op);slotContext=slot}}}}function generateProjectionDefs(job){const share=job.compatibility===CompatibilityMode.TemplateDefinitionBuilder;const selectors=[];let projectionSlotIndex=0;for(const unit of job.units){for(const op of unit.create){if(op.kind===OpKind.Projection){selectors.push(op.selector);op.projectionSlotIndex=projectionSlotIndex++}}}if(selectors.length>0){let defExpr=null;if(selectors.length>1||selectors[0]!=="*"){const def=selectors.map((s=>s==="*"?s:parseSelectorToR3Selector(s)));defExpr=job.pool.getConstLiteral(literalOrArrayLiteral(def),share)}job.contentSelectors=job.pool.getConstLiteral(literalOrArrayLiteral(selectors),share);job.root.create.prepend([createProjectionDefOp(defExpr)])}}function generateVariables(job){recursivelyProcessView(job.root,null)}function recursivelyProcessView(view,parentScope){const scope=getScopeForView(view,parentScope);for(const op of view.create){switch(op.kind){case OpKind.Template:recursivelyProcessView(view.job.views.get(op.xref),scope);break;case OpKind.RepeaterCreate:recursivelyProcessView(view.job.views.get(op.xref),scope);if(op.emptyView){recursivelyProcessView(view.job.views.get(op.emptyView),scope)}break;case OpKind.Listener:case OpKind.TwoWayListener:op.handlerOps.prepend(generateVariablesInScopeForView(view,scope));break}}const preambleOps=generateVariablesInScopeForView(view,scope);view.update.prepend(preambleOps)}function getScopeForView(view,parent){const scope={view:view.xref,viewContextVariable:{kind:SemanticVariableKind.Context,name:null,view:view.xref},contextVariables:new Map,aliases:view.aliases,references:[],parent:parent};for(const identifier of view.contextVariables.keys()){scope.contextVariables.set(identifier,{kind:SemanticVariableKind.Identifier,name:null,identifier:identifier})}for(const op of view.create){switch(op.kind){case OpKind.ElementStart:case OpKind.Template:if(!Array.isArray(op.localRefs)){throw new Error(`AssertionError: expected localRefs to be an array`)}for(let offset=0;offset<op.localRefs.length;offset++){scope.references.push({name:op.localRefs[offset].name,targetId:op.xref,targetSlot:op.handle,offset:offset,variable:{kind:SemanticVariableKind.Identifier,name:null,identifier:op.localRefs[offset].name}})}break}}return scope}function generateVariablesInScopeForView(view,scope){const newOps=[];if(scope.view!==view.xref){newOps.push(createVariableOp(view.job.allocateXrefId(),scope.viewContextVariable,new NextContextExpr,VariableFlags.None))}const scopeView=view.job.views.get(scope.view);for(const[name,value]of scopeView.contextVariables){const context=new ContextExpr(scope.view);const variable=value===CTX_REF?context:new ReadPropExpr(context,value);newOps.push(createVariableOp(view.job.allocateXrefId(),scope.contextVariables.get(name),variable,VariableFlags.None))}for(const alias of scopeView.aliases){newOps.push(createVariableOp(view.job.allocateXrefId(),alias,alias.expression.clone(),VariableFlags.AlwaysInline))}for(const ref of scope.references){newOps.push(createVariableOp(view.job.allocateXrefId(),ref.variable,new ReferenceExpr(ref.targetId,ref.targetSlot,ref.offset),VariableFlags.None))}if(scope.parent!==null){newOps.push(...generateVariablesInScopeForView(view,scope.parent))}return newOps}function collectConstExpressions(job){for(const unit of job.units){for(const op of unit.ops()){transformExpressionsInOp(op,(expr=>{if(!(expr instanceof ConstCollectedExpr)){return expr}return literal(job.addConst(expr.expr))}),VisitorContextFlag.None)}}}const STYLE_DOT="style.";const CLASS_DOT="class.";const STYLE_BANG="style!";const CLASS_BANG="class!";const BANG_IMPORTANT="!important";function parseHostStyleProperties(job){for(const op of job.root.update){if(!(op.kind===OpKind.Binding&&op.bindingKind===BindingKind.Property)){continue}if(op.name.endsWith(BANG_IMPORTANT)){op.name=op.name.substring(0,op.name.length-BANG_IMPORTANT.length)}if(op.name.startsWith(STYLE_DOT)){op.bindingKind=BindingKind.StyleProperty;op.name=op.name.substring(STYLE_DOT.length);if(!isCssCustomProperty$1(op.name)){op.name=hyphenate$1(op.name)}const{property:property,suffix:suffix}=parseProperty$1(op.name);op.name=property;op.unit=suffix}else if(op.name.startsWith(STYLE_BANG)){op.bindingKind=BindingKind.StyleProperty;op.name="style"}else if(op.name.startsWith(CLASS_DOT)){op.bindingKind=BindingKind.ClassName;op.name=parseProperty$1(op.name.substring(CLASS_DOT.length)).property}else if(op.name.startsWith(CLASS_BANG)){op.bindingKind=BindingKind.ClassName;op.name=parseProperty$1(op.name.substring(CLASS_BANG.length)).property}}}function isCssCustomProperty$1(name){return name.startsWith("--")}function hyphenate$1(value){return value.replace(/[a-z][A-Z]/g,(v=>v.charAt(0)+"-"+v.charAt(1))).toLowerCase()}function parseProperty$1(name){const overrideIndex=name.indexOf("!important");if(overrideIndex!==-1){name=overrideIndex>0?name.substring(0,overrideIndex):""}let suffix=null;let property=name;const unitIndex=name.lastIndexOf(".");if(unitIndex>0){suffix=name.slice(unitIndex+1);property=name.substring(0,unitIndex)}return{property:property,suffix:suffix}}function mapLiteral(obj,quoted=false){return literalMap(Object.keys(obj).map((key=>({key:key,quoted:quoted,value:obj[key]}))))}class IcuSerializerVisitor{visitText(text){return text.value}visitContainer(container){return container.children.map((child=>child.visit(this))).join("")}visitIcu(icu){const strCases=Object.keys(icu.cases).map((k=>`${k} {${icu.cases[k].visit(this)}}`));const result=`{${icu.expressionPlaceholder}, ${icu.type}, ${strCases.join(" ")}}`;return result}visitTagPlaceholder(ph){return ph.isVoid?this.formatPh(ph.startName):`${this.formatPh(ph.startName)}${ph.children.map((child=>child.visit(this))).join("")}${this.formatPh(ph.closeName)}`}visitPlaceholder(ph){return this.formatPh(ph.name)}visitBlockPlaceholder(ph){return`${this.formatPh(ph.startName)}${ph.children.map((child=>child.visit(this))).join("")}${this.formatPh(ph.closeName)}`}visitIcuPlaceholder(ph,context){return this.formatPh(ph.name)}formatPh(value){return`{${formatI18nPlaceholderName(value,false)}}`}}const serializer=new IcuSerializerVisitor;function serializeIcuNode(icu){return icu.visit(serializer)}exports.TokenType=void 0;(function(TokenType){TokenType[TokenType["Character"]=0]="Character";TokenType[TokenType["Identifier"]=1]="Identifier";TokenType[TokenType["PrivateIdentifier"]=2]="PrivateIdentifier";TokenType[TokenType["Keyword"]=3]="Keyword";TokenType[TokenType["String"]=4]="String";TokenType[TokenType["Operator"]=5]="Operator";TokenType[TokenType["Number"]=6]="Number";TokenType[TokenType["Error"]=7]="Error"})(exports.TokenType||(exports.TokenType={}));const KEYWORDS=["var","let","as","null","undefined","true","false","if","else","this"];class Lexer{tokenize(text){const scanner=new _Scanner(text);const tokens=[];let token=scanner.scanToken();while(token!=null){tokens.push(token);token=scanner.scanToken()}return tokens}}class Token{constructor(index,end,type,numValue,strValue){this.index=index;this.end=end;this.type=type;this.numValue=numValue;this.strValue=strValue}isCharacter(code){return this.type==exports.TokenType.Character&&this.numValue==code}isNumber(){return this.type==exports.TokenType.Number}isString(){return this.type==exports.TokenType.String}isOperator(operator){return this.type==exports.TokenType.Operator&&this.strValue==operator}isIdentifier(){return this.type==exports.TokenType.Identifier}isPrivateIdentifier(){return this.type==exports.TokenType.PrivateIdentifier}isKeyword(){return this.type==exports.TokenType.Keyword}isKeywordLet(){return this.type==exports.TokenType.Keyword&&this.strValue=="let"}isKeywordAs(){return this.type==exports.TokenType.Keyword&&this.strValue=="as"}isKeywordNull(){return this.type==exports.TokenType.Keyword&&this.strValue=="null"}isKeywordUndefined(){return this.type==exports.TokenType.Keyword&&this.strValue=="undefined"}isKeywordTrue(){return this.type==exports.TokenType.Keyword&&this.strValue=="true"}isKeywordFalse(){return this.type==exports.TokenType.Keyword&&this.strValue=="false"}isKeywordThis(){return this.type==exports.TokenType.Keyword&&this.strValue=="this"}isError(){return this.type==exports.TokenType.Error}toNumber(){return this.type==exports.TokenType.Number?this.numValue:-1}toString(){switch(this.type){case exports.TokenType.Character:case exports.TokenType.Identifier:case exports.TokenType.Keyword:case exports.TokenType.Operator:case exports.TokenType.PrivateIdentifier:case exports.TokenType.String:case exports.TokenType.Error:return this.strValue;case exports.TokenType.Number:return this.numValue.toString();default:return null}}}function newCharacterToken(index,end,code){return new Token(index,end,exports.TokenType.Character,code,String.fromCharCode(code))}function newIdentifierToken(index,end,text){return new Token(index,end,exports.TokenType.Identifier,0,text)}function newPrivateIdentifierToken(index,end,text){return new Token(index,end,exports.TokenType.PrivateIdentifier,0,text)}function newKeywordToken(index,end,text){return new Token(index,end,exports.TokenType.Keyword,0,text)}function newOperatorToken(index,end,text){return new Token(index,end,exports.TokenType.Operator,0,text)}function newStringToken(index,end,text){return new Token(index,end,exports.TokenType.String,0,text)}function newNumberToken(index,end,n){return new Token(index,end,exports.TokenType.Number,n,"")}function newErrorToken(index,end,message){return new Token(index,end,exports.TokenType.Error,0,message)}const EOF=new Token(-1,-1,exports.TokenType.Character,0,"");class _Scanner{constructor(input){this.input=input;this.peek=0;this.index=-1;this.length=input.length;this.advance()}advance(){this.peek=++this.index>=this.length?$EOF:this.input.charCodeAt(this.index)}scanToken(){const input=this.input,length=this.length;let peek=this.peek,index=this.index;while(peek<=$SPACE){if(++index>=length){peek=$EOF;break}else{peek=input.charCodeAt(index)}}this.peek=peek;this.index=index;if(index>=length){return null}if(isIdentifierStart(peek))return this.scanIdentifier();if(isDigit(peek))return this.scanNumber(index);const start=index;switch(peek){case $PERIOD:this.advance();return isDigit(this.peek)?this.scanNumber(start):newCharacterToken(start,this.index,$PERIOD);case $LPAREN:case $RPAREN:case $LBRACE:case $RBRACE:case $LBRACKET:case $RBRACKET:case $COMMA:case $COLON:case $SEMICOLON:return this.scanCharacter(start,peek);case $SQ:case $DQ:return this.scanString();case $HASH:return this.scanPrivateIdentifier();case $PLUS:case $MINUS:case $STAR:case $SLASH:case $PERCENT:case $CARET:return this.scanOperator(start,String.fromCharCode(peek));case $QUESTION:return this.scanQuestion(start);case $LT:case $GT:return this.scanComplexOperator(start,String.fromCharCode(peek),$EQ,"=");case $BANG:case $EQ:return this.scanComplexOperator(start,String.fromCharCode(peek),$EQ,"=",$EQ,"=");case $AMPERSAND:return this.scanComplexOperator(start,"&",$AMPERSAND,"&");case $BAR:return this.scanComplexOperator(start,"|",$BAR,"|");case $NBSP:while(isWhitespace(this.peek))this.advance();return this.scanToken()}this.advance();return this.error(`Unexpected character [${String.fromCharCode(peek)}]`,0)}scanCharacter(start,code){this.advance();return newCharacterToken(start,this.index,code)}scanOperator(start,str){this.advance();return newOperatorToken(start,this.index,str)}scanComplexOperator(start,one,twoCode,two,threeCode,three){this.advance();let str=one;if(this.peek==twoCode){this.advance();str+=two}if(threeCode!=null&&this.peek==threeCode){this.advance();str+=three}return newOperatorToken(start,this.index,str)}scanIdentifier(){const start=this.index;this.advance();while(isIdentifierPart(this.peek))this.advance();const str=this.input.substring(start,this.index);return KEYWORDS.indexOf(str)>-1?newKeywordToken(start,this.index,str):newIdentifierToken(start,this.index,str)}scanPrivateIdentifier(){const start=this.index;this.advance();if(!isIdentifierStart(this.peek)){return this.error("Invalid character [#]",-1)}while(isIdentifierPart(this.peek))this.advance();const identifierName=this.input.substring(start,this.index);return newPrivateIdentifierToken(start,this.index,identifierName)}scanNumber(start){let simple=this.index===start;let hasSeparators=false;this.advance();while(true){if(isDigit(this.peek));else if(this.peek===$_){if(!isDigit(this.input.charCodeAt(this.index-1))||!isDigit(this.input.charCodeAt(this.index+1))){return this.error("Invalid numeric separator",0)}hasSeparators=true}else if(this.peek===$PERIOD){simple=false}else if(isExponentStart(this.peek)){this.advance();if(isExponentSign(this.peek))this.advance();if(!isDigit(this.peek))return this.error("Invalid exponent",-1);simple=false}else{break}this.advance()}let str=this.input.substring(start,this.index);if(hasSeparators){str=str.replace(/_/g,"")}const value=simple?parseIntAutoRadix(str):parseFloat(str);return newNumberToken(start,this.index,value)}scanString(){const start=this.index;const quote=this.peek;this.advance();let buffer="";let marker=this.index;const input=this.input;while(this.peek!=quote){if(this.peek==$BACKSLASH){buffer+=input.substring(marker,this.index);let unescapedCode;this.advance();if(this.peek==$u){const hex=input.substring(this.index+1,this.index+5);if(/^[0-9a-f]+$/i.test(hex)){unescapedCode=parseInt(hex,16)}else{return this.error(`Invalid unicode escape [\\u${hex}]`,0)}for(let i=0;i<5;i++){this.advance()}}else{unescapedCode=unescape(this.peek);this.advance()}buffer+=String.fromCharCode(unescapedCode);marker=this.index}else if(this.peek==$EOF){return this.error("Unterminated quote",0)}else{this.advance()}}const last=input.substring(marker,this.index);this.advance();return newStringToken(start,this.index,buffer+last)}scanQuestion(start){this.advance();let str="?";if(this.peek===$QUESTION||this.peek===$PERIOD){str+=this.peek===$PERIOD?".":"?";this.advance()}return newOperatorToken(start,this.index,str)}error(message,offset){const position=this.index+offset;return newErrorToken(position,this.index,`Lexer Error: ${message} at column ${position} in expression [${this.input}]`)}}function isIdentifierStart(code){return $a<=code&&code<=$z||$A<=code&&code<=$Z||code==$_||code==$$}function isIdentifier(input){if(input.length==0)return false;const scanner=new _Scanner(input);if(!isIdentifierStart(scanner.peek))return false;scanner.advance();while(scanner.peek!==$EOF){if(!isIdentifierPart(scanner.peek))return false;scanner.advance()}return true}function isIdentifierPart(code){return isAsciiLetter(code)||isDigit(code)||code==$_||code==$$}function isExponentStart(code){return code==$e||code==$E}function isExponentSign(code){return code==$MINUS||code==$PLUS}function unescape(code){switch(code){case $n:return $LF;case $f:return $FF;case $r:return $CR;case $t:return $TAB;case $v:return $VTAB;default:return code}}function parseIntAutoRadix(text){const result=parseInt(text);if(isNaN(result)){throw new Error("Invalid integer literal when parsing "+text)}return result}class SplitInterpolation{constructor(strings,expressions,offsets){this.strings=strings;this.expressions=expressions;this.offsets=offsets}}class TemplateBindingParseResult{constructor(templateBindings,warnings,errors){this.templateBindings=templateBindings;this.warnings=warnings;this.errors=errors}}class Parser$1{constructor(_lexer){this._lexer=_lexer;this.errors=[]}parseAction(input,location,absoluteOffset,interpolationConfig=DEFAULT_INTERPOLATION_CONFIG){this._checkNoInterpolation(input,location,interpolationConfig);const sourceToLex=this._stripComments(input);const tokens=this._lexer.tokenize(sourceToLex);const ast=new _ParseAST(input,location,absoluteOffset,tokens,1,this.errors,0).parseChain();return new ASTWithSource(ast,input,location,absoluteOffset,this.errors)}parseBinding(input,location,absoluteOffset,interpolationConfig=DEFAULT_INTERPOLATION_CONFIG){const ast=this._parseBindingAst(input,location,absoluteOffset,interpolationConfig);return new ASTWithSource(ast,input,location,absoluteOffset,this.errors)}checkSimpleExpression(ast){const checker=new SimpleExpressionChecker;ast.visit(checker);return checker.errors}parseSimpleBinding(input,location,absoluteOffset,interpolationConfig=DEFAULT_INTERPOLATION_CONFIG){const ast=this._parseBindingAst(input,location,absoluteOffset,interpolationConfig);const errors=this.checkSimpleExpression(ast);if(errors.length>0){this._reportError(`Host binding expression cannot contain ${errors.join(" ")}`,input,location)}return new ASTWithSource(ast,input,location,absoluteOffset,this.errors)}_reportError(message,input,errLocation,ctxLocation){this.errors.push(new ParserError(message,input,errLocation,ctxLocation))}_parseBindingAst(input,location,absoluteOffset,interpolationConfig){this._checkNoInterpolation(input,location,interpolationConfig);const sourceToLex=this._stripComments(input);const tokens=this._lexer.tokenize(sourceToLex);return new _ParseAST(input,location,absoluteOffset,tokens,0,this.errors,0).parseChain()}parseTemplateBindings(templateKey,templateValue,templateUrl,absoluteKeyOffset,absoluteValueOffset){const tokens=this._lexer.tokenize(templateValue);const parser=new _ParseAST(templateValue,templateUrl,absoluteValueOffset,tokens,0,this.errors,0);return parser.parseTemplateBindings({source:templateKey,span:new AbsoluteSourceSpan(absoluteKeyOffset,absoluteKeyOffset+templateKey.length)})}parseInterpolation(input,location,absoluteOffset,interpolatedTokens,interpolationConfig=DEFAULT_INTERPOLATION_CONFIG){const{strings:strings,expressions:expressions,offsets:offsets}=this.splitInterpolation(input,location,interpolatedTokens,interpolationConfig);if(expressions.length===0)return null;const expressionNodes=[];for(let i=0;i<expressions.length;++i){const expressionText=expressions[i].text;const sourceToLex=this._stripComments(expressionText);const tokens=this._lexer.tokenize(sourceToLex);const ast=new _ParseAST(input,location,absoluteOffset,tokens,0,this.errors,offsets[i]).parseChain();expressionNodes.push(ast)}return this.createInterpolationAst(strings.map((s=>s.text)),expressionNodes,input,location,absoluteOffset)}parseInterpolationExpression(expression,location,absoluteOffset){const sourceToLex=this._stripComments(expression);const tokens=this._lexer.tokenize(sourceToLex);const ast=new _ParseAST(expression,location,absoluteOffset,tokens,0,this.errors,0).parseChain();const strings=["",""];return this.createInterpolationAst(strings,[ast],expression,location,absoluteOffset)}createInterpolationAst(strings,expressions,input,location,absoluteOffset){const span=new ParseSpan(0,input.length);const interpolation=new Interpolation$1(span,span.toAbsolute(absoluteOffset),strings,expressions);return new ASTWithSource(interpolation,input,location,absoluteOffset,this.errors)}splitInterpolation(input,location,interpolatedTokens,interpolationConfig=DEFAULT_INTERPOLATION_CONFIG){const strings=[];const expressions=[];const offsets=[];const inputToTemplateIndexMap=interpolatedTokens?getIndexMapForOriginalTemplate(interpolatedTokens):null;let i=0;let atInterpolation=false;let extendLastString=false;let{start:interpStart,end:interpEnd}=interpolationConfig;while(i<input.length){if(!atInterpolation){const start=i;i=input.indexOf(interpStart,i);if(i===-1){i=input.length}const text=input.substring(start,i);strings.push({text:text,start:start,end:i});atInterpolation=true}else{const fullStart=i;const exprStart=fullStart+interpStart.length;const exprEnd=this._getInterpolationEndIndex(input,interpEnd,exprStart);if(exprEnd===-1){atInterpolation=false;extendLastString=true;break}const fullEnd=exprEnd+interpEnd.length;const text=input.substring(exprStart,exprEnd);if(text.trim().length===0){this._reportError("Blank expressions are not allowed in interpolated strings",input,`at column ${i} in`,location)}expressions.push({text:text,start:fullStart,end:fullEnd});const startInOriginalTemplate=inputToTemplateIndexMap?.get(fullStart)??fullStart;const offset=startInOriginalTemplate+interpStart.length;offsets.push(offset);i=fullEnd;atInterpolation=false}}if(!atInterpolation){if(extendLastString){const piece=strings[strings.length-1];piece.text+=input.substring(i);piece.end=input.length}else{strings.push({text:input.substring(i),start:i,end:input.length})}}return new SplitInterpolation(strings,expressions,offsets)}wrapLiteralPrimitive(input,location,absoluteOffset){const span=new ParseSpan(0,input==null?0:input.length);return new ASTWithSource(new LiteralPrimitive(span,span.toAbsolute(absoluteOffset),input),input,location,absoluteOffset,this.errors)}_stripComments(input){const i=this._commentStart(input);return i!=null?input.substring(0,i):input}_commentStart(input){let outerQuote=null;for(let i=0;i<input.length-1;i++){const char=input.charCodeAt(i);const nextChar=input.charCodeAt(i+1);if(char===$SLASH&&nextChar==$SLASH&&outerQuote==null)return i;if(outerQuote===char){outerQuote=null}else if(outerQuote==null&&isQuote(char)){outerQuote=char}}return null}_checkNoInterpolation(input,location,{start:start,end:end}){let startIndex=-1;let endIndex=-1;for(const charIndex of this._forEachUnquotedChar(input,0)){if(startIndex===-1){if(input.startsWith(start)){startIndex=charIndex}}else{endIndex=this._getInterpolationEndIndex(input,end,charIndex);if(endIndex>-1){break}}}if(startIndex>-1&&endIndex>-1){this._reportError(`Got interpolation (${start}${end}) where expression was expected`,input,`at column ${startIndex} in`,location)}}_getInterpolationEndIndex(input,expressionEnd,start){for(const charIndex of this._forEachUnquotedChar(input,start)){if(input.startsWith(expressionEnd,charIndex)){return charIndex}if(input.startsWith("//",charIndex)){return input.indexOf(expressionEnd,charIndex)}}return-1}*_forEachUnquotedChar(input,start){let currentQuote=null;let escapeCount=0;for(let i=start;i<input.length;i++){const char=input[i];if(isQuote(input.charCodeAt(i))&&(currentQuote===null||currentQuote===char)&&escapeCount%2===0){currentQuote=currentQuote===null?char:null}else if(currentQuote===null){yield i}escapeCount=char==="\\"?escapeCount+1:0}}}var ParseContextFlags;(function(ParseContextFlags){ParseContextFlags[ParseContextFlags["None"]=0]="None";ParseContextFlags[ParseContextFlags["Writable"]=1]="Writable"})(ParseContextFlags||(ParseContextFlags={}));class _ParseAST{constructor(input,location,absoluteOffset,tokens,parseFlags,errors,offset){this.input=input;this.location=location;this.absoluteOffset=absoluteOffset;this.tokens=tokens;this.parseFlags=parseFlags;this.errors=errors;this.offset=offset;this.rparensExpected=0;this.rbracketsExpected=0;this.rbracesExpected=0;this.context=ParseContextFlags.None;this.sourceSpanCache=new Map;this.index=0}peek(offset){const i=this.index+offset;return i<this.tokens.length?this.tokens[i]:EOF}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(){if(this.index>0){const curToken=this.peek(-1);return curToken.end+this.offset}if(this.tokens.length===0){return this.input.length+this.offset}return this.next.index+this.offset}get currentAbsoluteOffset(){return this.absoluteOffset+this.inputIndex}span(start,artificialEndIndex){let endIndex=this.currentEndIndex;if(artificialEndIndex!==undefined&&artificialEndIndex>this.currentEndIndex){endIndex=artificialEndIndex}if(start>endIndex){const tmp=endIndex;endIndex=start;start=tmp}return new ParseSpan(start,endIndex)}sourceSpan(start,artificialEndIndex){const serial=`${start}@${this.inputIndex}:${artificialEndIndex}`;if(!this.sourceSpanCache.has(serial)){this.sourceSpanCache.set(serial,this.span(start,artificialEndIndex).toAbsolute(this.absoluteOffset))}return this.sourceSpanCache.get(serial)}advance(){this.index++}withContext(context,cb){this.context|=context;const ret=cb();this.context^=context;return ret}consumeOptionalCharacter(code){if(this.next.isCharacter(code)){this.advance();return true}else{return false}}peekKeywordLet(){return this.next.isKeywordLet()}peekKeywordAs(){return this.next.isKeywordAs()}expectCharacter(code){if(this.consumeOptionalCharacter(code))return;this.error(`Missing expected ${String.fromCharCode(code)}`)}consumeOptionalOperator(op){if(this.next.isOperator(op)){this.advance();return true}else{return false}}expectOperator(operator){if(this.consumeOptionalOperator(operator))return;this.error(`Missing expected operator ${operator}`)}prettyPrintToken(tok){return tok===EOF?"end of input":`token ${tok}`}expectIdentifierOrKeyword(){const n=this.next;if(!n.isIdentifier()&&!n.isKeyword()){if(n.isPrivateIdentifier()){this._reportErrorForPrivateIdentifier(n,"expected identifier or keyword")}else{this.error(`Unexpected ${this.prettyPrintToken(n)}, expected identifier or keyword`)}return null}this.advance();return n.toString()}expectIdentifierOrKeywordOrString(){const n=this.next;if(!n.isIdentifier()&&!n.isKeyword()&&!n.isString()){if(n.isPrivateIdentifier()){this._reportErrorForPrivateIdentifier(n,"expected identifier, keyword or string")}else{this.error(`Unexpected ${this.prettyPrintToken(n)}, expected identifier, keyword, or string`)}return""}this.advance();return n.toString()}parseChain(){const exprs=[];const start=this.inputIndex;while(this.index<this.tokens.length){const expr=this.parsePipe();exprs.push(expr);if(this.consumeOptionalCharacter($SEMICOLON)){if(!(this.parseFlags&1)){this.error("Binding expression cannot contain chained expression")}while(this.consumeOptionalCharacter($SEMICOLON)){}}else if(this.index<this.tokens.length){const errorIndex=this.index;this.error(`Unexpected token '${this.next}'`);if(this.index===errorIndex){break}}}if(exprs.length===0){const artificialStart=this.offset;const artificialEnd=this.offset+this.input.length;return new EmptyExpr$1(this.span(artificialStart,artificialEnd),this.sourceSpan(artificialStart,artificialEnd))}if(exprs.length==1)return exprs[0];return new Chain(this.span(start),this.sourceSpan(start),exprs)}parsePipe(){const start=this.inputIndex;let result=this.parseExpression();if(this.consumeOptionalOperator("|")){if(this.parseFlags&1){this.error(`Cannot have a pipe in an action expression`)}do{const nameStart=this.inputIndex;let nameId=this.expectIdentifierOrKeyword();let nameSpan;let fullSpanEnd=undefined;if(nameId!==null){nameSpan=this.sourceSpan(nameStart)}else{nameId="";fullSpanEnd=this.next.index!==-1?this.next.index:this.input.length+this.offset;nameSpan=new ParseSpan(fullSpanEnd,fullSpanEnd).toAbsolute(this.absoluteOffset)}const args=[];while(this.consumeOptionalCharacter($COLON)){args.push(this.parseExpression())}result=new BindingPipe(this.span(start),this.sourceSpan(start,fullSpanEnd),result,nameId,args,nameSpan)}while(this.consumeOptionalOperator("|"))}return result}parseExpression(){return this.parseConditional()}parseConditional(){const start=this.inputIndex;const result=this.parseLogicalOr();if(this.consumeOptionalOperator("?")){const yes=this.parsePipe();let no;if(!this.consumeOptionalCharacter($COLON)){const end=this.inputIndex;const expression=this.input.substring(start,end);this.error(`Conditional expression ${expression} requires all 3 expressions`);no=new EmptyExpr$1(this.span(start),this.sourceSpan(start))}else{no=this.parsePipe()}return new Conditional(this.span(start),this.sourceSpan(start),result,yes,no)}else{return result}}parseLogicalOr(){const start=this.inputIndex;let result=this.parseLogicalAnd();while(this.consumeOptionalOperator("||")){const right=this.parseLogicalAnd();result=new Binary(this.span(start),this.sourceSpan(start),"||",result,right)}return result}parseLogicalAnd(){const start=this.inputIndex;let result=this.parseNullishCoalescing();while(this.consumeOptionalOperator("&&")){const right=this.parseNullishCoalescing();result=new Binary(this.span(start),this.sourceSpan(start),"&&",result,right)}return result}parseNullishCoalescing(){const start=this.inputIndex;let result=this.parseEquality();while(this.consumeOptionalOperator("??")){const right=this.parseEquality();result=new Binary(this.span(start),this.sourceSpan(start),"??",result,right)}return result}parseEquality(){const start=this.inputIndex;let result=this.parseRelational();while(this.next.type==exports.TokenType.Operator){const operator=this.next.strValue;switch(operator){case"==":case"===":case"!=":case"!==":this.advance();const right=this.parseRelational();result=new Binary(this.span(start),this.sourceSpan(start),operator,result,right);continue}break}return result}parseRelational(){const start=this.inputIndex;let result=this.parseAdditive();while(this.next.type==exports.TokenType.Operator){const operator=this.next.strValue;switch(operator){case"<":case">":case"<=":case">=":this.advance();const right=this.parseAdditive();result=new Binary(this.span(start),this.sourceSpan(start),operator,result,right);continue}break}return result}parseAdditive(){const start=this.inputIndex;let result=this.parseMultiplicative();while(this.next.type==exports.TokenType.Operator){const operator=this.next.strValue;switch(operator){case"+":case"-":this.advance();let right=this.parseMultiplicative();result=new Binary(this.span(start),this.sourceSpan(start),operator,result,right);continue}break}return result}parseMultiplicative(){const start=this.inputIndex;let result=this.parsePrefix();while(this.next.type==exports.TokenType.Operator){const operator=this.next.strValue;switch(operator){case"*":case"%":case"/":this.advance();let right=this.parsePrefix();result=new Binary(this.span(start),this.sourceSpan(start),operator,result,right);continue}break}return result}parsePrefix(){if(this.next.type==exports.TokenType.Operator){const start=this.inputIndex;const operator=this.next.strValue;let result;switch(operator){case"+":this.advance();result=this.parsePrefix();return Unary.createPlus(this.span(start),this.sourceSpan(start),result);case"-":this.advance();result=this.parsePrefix();return Unary.createMinus(this.span(start),this.sourceSpan(start),result);case"!":this.advance();result=this.parsePrefix();return new PrefixNot(this.span(start),this.sourceSpan(start),result)}}return this.parseCallChain()}parseCallChain(){const start=this.inputIndex;let result=this.parsePrimary();while(true){if(this.consumeOptionalCharacter($PERIOD)){result=this.parseAccessMember(result,start,false)}else if(this.consumeOptionalOperator("?.")){if(this.consumeOptionalCharacter($LPAREN)){result=this.parseCall(result,start,true)}else{result=this.consumeOptionalCharacter($LBRACKET)?this.parseKeyedReadOrWrite(result,start,true):this.parseAccessMember(result,start,true)}}else if(this.consumeOptionalCharacter($LBRACKET)){result=this.parseKeyedReadOrWrite(result,start,false)}else if(this.consumeOptionalCharacter($LPAREN)){result=this.parseCall(result,start,false)}else if(this.consumeOptionalOperator("!")){result=new NonNullAssert(this.span(start),this.sourceSpan(start),result)}else{return result}}}parsePrimary(){const start=this.inputIndex;if(this.consumeOptionalCharacter($LPAREN)){this.rparensExpected++;const result=this.parsePipe();this.rparensExpected--;this.expectCharacter($RPAREN);return result}else if(this.next.isKeywordNull()){this.advance();return new LiteralPrimitive(this.span(start),this.sourceSpan(start),null)}else if(this.next.isKeywordUndefined()){this.advance();return new LiteralPrimitive(this.span(start),this.sourceSpan(start),void 0)}else if(this.next.isKeywordTrue()){this.advance();return new LiteralPrimitive(this.span(start),this.sourceSpan(start),true)}else if(this.next.isKeywordFalse()){this.advance();return new LiteralPrimitive(this.span(start),this.sourceSpan(start),false)}else if(this.next.isKeywordThis()){this.advance();return new ThisReceiver(this.span(start),this.sourceSpan(start))}else if(this.consumeOptionalCharacter($LBRACKET)){this.rbracketsExpected++;const elements=this.parseExpressionList($RBRACKET);this.rbracketsExpected--;this.expectCharacter($RBRACKET);return new LiteralArray(this.span(start),this.sourceSpan(start),elements)}else if(this.next.isCharacter($LBRACE)){return this.parseLiteralMap()}else if(this.next.isIdentifier()){return this.parseAccessMember(new ImplicitReceiver(this.span(start),this.sourceSpan(start)),start,false)}else if(this.next.isNumber()){const value=this.next.toNumber();this.advance();return new LiteralPrimitive(this.span(start),this.sourceSpan(start),value)}else if(this.next.isString()){const literalValue=this.next.toString();this.advance();return new LiteralPrimitive(this.span(start),this.sourceSpan(start),literalValue)}else if(this.next.isPrivateIdentifier()){this._reportErrorForPrivateIdentifier(this.next,null);return new EmptyExpr$1(this.span(start),this.sourceSpan(start))}else if(this.index>=this.tokens.length){this.error(`Unexpected end of expression: ${this.input}`);return new EmptyExpr$1(this.span(start),this.sourceSpan(start))}else{this.error(`Unexpected token ${this.next}`);return new EmptyExpr$1(this.span(start),this.sourceSpan(start))}}parseExpressionList(terminator){const result=[];do{if(!this.next.isCharacter(terminator)){result.push(this.parsePipe())}else{break}}while(this.consumeOptionalCharacter($COMMA));return result}parseLiteralMap(){const keys=[];const values=[];const start=this.inputIndex;this.expectCharacter($LBRACE);if(!this.consumeOptionalCharacter($RBRACE)){this.rbracesExpected++;do{const keyStart=this.inputIndex;const quoted=this.next.isString();const key=this.expectIdentifierOrKeywordOrString();keys.push({key:key,quoted:quoted});if(quoted){this.expectCharacter($COLON);values.push(this.parsePipe())}else if(this.consumeOptionalCharacter($COLON)){values.push(this.parsePipe())}else{const span=this.span(keyStart);const sourceSpan=this.sourceSpan(keyStart);values.push(new PropertyRead(span,sourceSpan,sourceSpan,new ImplicitReceiver(span,sourceSpan),key))}}while(this.consumeOptionalCharacter($COMMA)&&!this.next.isCharacter($RBRACE));this.rbracesExpected--;this.expectCharacter($RBRACE)}return new LiteralMap(this.span(start),this.sourceSpan(start),keys,values)}parseAccessMember(readReceiver,start,isSafe){const nameStart=this.inputIndex;const id=this.withContext(ParseContextFlags.Writable,(()=>{const id=this.expectIdentifierOrKeyword()??"";if(id.length===0){this.error(`Expected identifier for property access`,readReceiver.span.end)}return id}));const nameSpan=this.sourceSpan(nameStart);let receiver;if(isSafe){if(this.consumeOptionalOperator("=")){this.error("The '?.' operator cannot be used in the assignment");receiver=new EmptyExpr$1(this.span(start),this.sourceSpan(start))}else{receiver=new SafePropertyRead(this.span(start),this.sourceSpan(start),nameSpan,readReceiver,id)}}else{if(this.consumeOptionalOperator("=")){if(!(this.parseFlags&1)){this.error("Bindings cannot contain assignments");return new EmptyExpr$1(this.span(start),this.sourceSpan(start))}const value=this.parseConditional();receiver=new PropertyWrite(this.span(start),this.sourceSpan(start),nameSpan,readReceiver,id,value)}else{receiver=new PropertyRead(this.span(start),this.sourceSpan(start),nameSpan,readReceiver,id)}}return receiver}parseCall(receiver,start,isSafe){const argumentStart=this.inputIndex;this.rparensExpected++;const args=this.parseCallArguments();const argumentSpan=this.span(argumentStart,this.inputIndex).toAbsolute(this.absoluteOffset);this.expectCharacter($RPAREN);this.rparensExpected--;const span=this.span(start);const sourceSpan=this.sourceSpan(start);return isSafe?new SafeCall(span,sourceSpan,receiver,args,argumentSpan):new Call(span,sourceSpan,receiver,args,argumentSpan)}parseCallArguments(){if(this.next.isCharacter($RPAREN))return[];const positionals=[];do{positionals.push(this.parsePipe())}while(this.consumeOptionalCharacter($COMMA));return positionals}expectTemplateBindingKey(){let result="";let operatorFound=false;const start=this.currentAbsoluteOffset;do{result+=this.expectIdentifierOrKeywordOrString();operatorFound=this.consumeOptionalOperator("-");if(operatorFound){result+="-"}}while(operatorFound);return{source:result,span:new AbsoluteSourceSpan(start,start+result.length)}}parseTemplateBindings(templateKey){const bindings=[];bindings.push(...this.parseDirectiveKeywordBindings(templateKey));while(this.index<this.tokens.length){const letBinding=this.parseLetBinding();if(letBinding){bindings.push(letBinding)}else{const key=this.expectTemplateBindingKey();const binding=this.parseAsBinding(key);if(binding){bindings.push(binding)}else{key.source=templateKey.source+key.source.charAt(0).toUpperCase()+key.source.substring(1);bindings.push(...this.parseDirectiveKeywordBindings(key))}}this.consumeStatementTerminator()}return new TemplateBindingParseResult(bindings,[],this.errors)}parseKeyedReadOrWrite(receiver,start,isSafe){return this.withContext(ParseContextFlags.Writable,(()=>{this.rbracketsExpected++;const key=this.parsePipe();if(key instanceof EmptyExpr$1){this.error(`Key access cannot be empty`)}this.rbracketsExpected--;this.expectCharacter($RBRACKET);if(this.consumeOptionalOperator("=")){if(isSafe){this.error("The '?.' operator cannot be used in the assignment")}else{const value=this.parseConditional();return new KeyedWrite(this.span(start),this.sourceSpan(start),receiver,key,value)}}else{return isSafe?new SafeKeyedRead(this.span(start),this.sourceSpan(start),receiver,key):new KeyedRead(this.span(start),this.sourceSpan(start),receiver,key)}return new EmptyExpr$1(this.span(start),this.sourceSpan(start))}))}parseDirectiveKeywordBindings(key){const bindings=[];this.consumeOptionalCharacter($COLON);const value=this.getDirectiveBoundTarget();let spanEnd=this.currentAbsoluteOffset;const asBinding=this.parseAsBinding(key);if(!asBinding){this.consumeStatementTerminator();spanEnd=this.currentAbsoluteOffset}const sourceSpan=new AbsoluteSourceSpan(key.span.start,spanEnd);bindings.push(new ExpressionBinding(sourceSpan,key,value));if(asBinding){bindings.push(asBinding)}return bindings}getDirectiveBoundTarget(){if(this.next===EOF||this.peekKeywordAs()||this.peekKeywordLet()){return null}const ast=this.parsePipe();const{start:start,end:end}=ast.span;const value=this.input.substring(start,end);return new ASTWithSource(ast,value,this.location,this.absoluteOffset+start,this.errors)}parseAsBinding(value){if(!this.peekKeywordAs()){return null}this.advance();const key=this.expectTemplateBindingKey();this.consumeStatementTerminator();const sourceSpan=new AbsoluteSourceSpan(value.span.start,this.currentAbsoluteOffset);return new VariableBinding(sourceSpan,key,value)}parseLetBinding(){if(!this.peekKeywordLet()){return null}const spanStart=this.currentAbsoluteOffset;this.advance();const key=this.expectTemplateBindingKey();let value=null;if(this.consumeOptionalOperator("=")){value=this.expectTemplateBindingKey()}this.consumeStatementTerminator();const sourceSpan=new AbsoluteSourceSpan(spanStart,this.currentAbsoluteOffset);return new VariableBinding(sourceSpan,key,value)}consumeStatementTerminator(){this.consumeOptionalCharacter($SEMICOLON)||this.consumeOptionalCharacter($COMMA)}error(message,index=null){this.errors.push(new ParserError(message,this.input,this.locationText(index),this.location));this.skip()}locationText(index=null){if(index==null)index=this.index;return index<this.tokens.length?`at column ${this.tokens[index].index+1} in`:`at the end of the expression`}_reportErrorForPrivateIdentifier(token,extraMessage){let errorMessage=`Private identifiers are not supported. Unexpected private identifier: ${token}`;if(extraMessage!==null){errorMessage+=`, ${extraMessage}`}this.error(errorMessage)}skip(){let n=this.next;while(this.index<this.tokens.length&&!n.isCharacter($SEMICOLON)&&!n.isOperator("|")&&(this.rparensExpected<=0||!n.isCharacter($RPAREN))&&(this.rbracesExpected<=0||!n.isCharacter($RBRACE))&&(this.rbracketsExpected<=0||!n.isCharacter($RBRACKET))&&(!(this.context&ParseContextFlags.Writable)||!n.isOperator("="))){if(this.next.isError()){this.errors.push(new ParserError(this.next.toString(),this.input,this.locationText(),this.location))}this.advance();n=this.next}}}class SimpleExpressionChecker extends RecursiveAstVisitor{constructor(){super(...arguments);this.errors=[]}visitPipe(){this.errors.push("pipes")}}function getIndexMapForOriginalTemplate(interpolatedTokens){let offsetMap=new Map;let consumedInOriginalTemplate=0;let consumedInInput=0;let tokenIndex=0;while(tokenIndex<interpolatedTokens.length){const currentToken=interpolatedTokens[tokenIndex];if(currentToken.type===9){const[decoded,encoded]=currentToken.parts;consumedInOriginalTemplate+=encoded.length;consumedInInput+=decoded.length}else{const lengthOfParts=currentToken.parts.reduce(((sum,current)=>sum+current.length),0);consumedInInput+=lengthOfParts;consumedInOriginalTemplate+=lengthOfParts}offsetMap.set(consumedInInput,consumedInOriginalTemplate);tokenIndex++}return offsetMap}class NodeWithI18n{constructor(sourceSpan,i18n){this.sourceSpan=sourceSpan;this.i18n=i18n}}class Text extends NodeWithI18n{constructor(value,sourceSpan,tokens,i18n){super(sourceSpan,i18n);this.value=value;this.tokens=tokens}visit(visitor,context){return visitor.visitText(this,context)}}class Expansion extends NodeWithI18n{constructor(switchValue,type,cases,sourceSpan,switchValueSourceSpan,i18n){super(sourceSpan,i18n);this.switchValue=switchValue;this.type=type;this.cases=cases;this.switchValueSourceSpan=switchValueSourceSpan}visit(visitor,context){return visitor.visitExpansion(this,context)}}class ExpansionCase{constructor(value,expression,sourceSpan,valueSourceSpan,expSourceSpan){this.value=value;this.expression=expression;this.sourceSpan=sourceSpan;this.valueSourceSpan=valueSourceSpan;this.expSourceSpan=expSourceSpan}visit(visitor,context){return visitor.visitExpansionCase(this,context)}}class Attribute extends NodeWithI18n{constructor(name,value,sourceSpan,keySpan,valueSpan,valueTokens,i18n){super(sourceSpan,i18n);this.name=name;this.value=value;this.keySpan=keySpan;this.valueSpan=valueSpan;this.valueTokens=valueTokens}visit(visitor,context){return visitor.visitAttribute(this,context)}}class Element extends NodeWithI18n{constructor(name,attrs,children,sourceSpan,startSourceSpan,endSourceSpan=null,i18n){super(sourceSpan,i18n);this.name=name;this.attrs=attrs;this.children=children;this.startSourceSpan=startSourceSpan;this.endSourceSpan=endSourceSpan}visit(visitor,context){return visitor.visitElement(this,context)}}class Comment{constructor(value,sourceSpan){this.value=value;this.sourceSpan=sourceSpan}visit(visitor,context){return visitor.visitComment(this,context)}}class Block extends NodeWithI18n{constructor(name,parameters,children,sourceSpan,nameSpan,startSourceSpan,endSourceSpan=null,i18n){super(sourceSpan,i18n);this.name=name;this.parameters=parameters;this.children=children;this.nameSpan=nameSpan;this.startSourceSpan=startSourceSpan;this.endSourceSpan=endSourceSpan}visit(visitor,context){return visitor.visitBlock(this,context)}}class BlockParameter{constructor(expression,sourceSpan){this.expression=expression;this.sourceSpan=sourceSpan}visit(visitor,context){return visitor.visitBlockParameter(this,context)}}function visitAll(visitor,nodes,context=null){const result=[];const visit=visitor.visit?ast=>visitor.visit(ast,context)||ast.visit(visitor,context):ast=>ast.visit(visitor,context);nodes.forEach((ast=>{const astResult=visit(ast);if(astResult){result.push(astResult)}}));return result}class RecursiveVisitor{constructor(){}visitElement(ast,context){this.visitChildren(context,(visit=>{visit(ast.attrs);visit(ast.children)}))}visitAttribute(ast,context){}visitText(ast,context){}visitComment(ast,context){}visitExpansion(ast,context){return this.visitChildren(context,(visit=>{visit(ast.cases)}))}visitExpansionCase(ast,context){}visitBlock(block,context){this.visitChildren(context,(visit=>{visit(block.parameters);visit(block.children)}))}visitBlockParameter(ast,context){}visitChildren(context,cb){let results=[];let t=this;function visit(children){if(children)results.push(visitAll(t,children,context))}cb(visit);return Array.prototype.concat.apply([],results)}}class ElementSchemaRegistry{}const BOOLEAN="boolean";const NUMBER="number";const STRING="string";const OBJECT="object";const SCHEMA=["[Element]|textContent,%ariaAtomic,%ariaAutoComplete,%ariaBusy,%ariaChecked,%ariaColCount,%ariaColIndex,%ariaColSpan,%ariaCurrent,%ariaDescription,%ariaDisabled,%ariaExpanded,%ariaHasPopup,%ariaHidden,%ariaKeyShortcuts,%ariaLabel,%ariaLevel,%ariaLive,%ariaModal,%ariaMultiLine,%ariaMultiSelectable,%ariaOrientation,%ariaPlaceholder,%ariaPosInSet,%ariaPressed,%ariaReadOnly,%ariaRelevant,%ariaRequired,%ariaRoleDescription,%ariaRowCount,%ariaRowIndex,%ariaRowSpan,%ariaSelected,%ariaSetSize,%ariaSort,%ariaValueMax,%ariaValueMin,%ariaValueNow,%ariaValueText,%classList,className,elementTiming,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*fullscreenchange,*fullscreenerror,*search,*webkitfullscreenchange,*webkitfullscreenerror,outerHTML,%part,#scrollLeft,#scrollTop,slot"+",*message,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored","[HTMLElement]^[Element]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,!inert,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy","abbr,address,article,aside,b,bdi,bdo,cite,content,code,dd,dfn,dt,em,figcaption,figure,footer,header,hgroup,i,kbd,main,mark,nav,noscript,rb,rp,rt,rtc,ruby,s,samp,section,small,strong,sub,sup,u,var,wbr^[HTMLElement]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy","media^[HTMLElement]|!autoplay,!controls,%controlsList,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,*waitingforkey,#playbackRate,preload,!preservesPitch,src,%srcObject,#volume",":svg:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex",":svg:graphics^:svg:|",":svg:animation^:svg:|*begin,*end,*repeat",":svg:geometry^:svg:|",":svg:componentTransferFunction^:svg:|",":svg:gradient^:svg:|",":svg:textContent^:svg:graphics|",":svg:textPositioning^:svg:textContent|","a^[HTMLElement]|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,rev,search,shape,target,text,type,username","area^[HTMLElement]|alt,coords,download,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,search,shape,target,username","audio^media|","br^[HTMLElement]|clear","base^[HTMLElement]|href,target","body^[HTMLElement]|aLink,background,bgColor,link,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink","button^[HTMLElement]|!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value","canvas^[HTMLElement]|#height,#width","content^[HTMLElement]|select","dl^[HTMLElement]|!compact","data^[HTMLElement]|value","datalist^[HTMLElement]|","details^[HTMLElement]|!open","dialog^[HTMLElement]|!open,returnValue","dir^[HTMLElement]|!compact","div^[HTMLElement]|align","embed^[HTMLElement]|align,height,name,src,type,width","fieldset^[HTMLElement]|!disabled,name","font^[HTMLElement]|color,face,size","form^[HTMLElement]|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target","frame^[HTMLElement]|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src","frameset^[HTMLElement]|cols,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows","hr^[HTMLElement]|align,color,!noShade,size,width","head^[HTMLElement]|","h1,h2,h3,h4,h5,h6^[HTMLElement]|align","html^[HTMLElement]|version","iframe^[HTMLElement]|align,allow,!allowFullscreen,!allowPaymentRequest,csp,frameBorder,height,loading,longDesc,marginHeight,marginWidth,name,referrerPolicy,%sandbox,scrolling,src,srcdoc,width","img^[HTMLElement]|align,alt,border,%crossOrigin,decoding,#height,#hspace,!isMap,loading,longDesc,lowsrc,name,referrerPolicy,sizes,src,srcset,useMap,#vspace,#width","input^[HTMLElement]|accept,align,alt,autocomplete,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width","li^[HTMLElement]|type,#value","label^[HTMLElement]|htmlFor","legend^[HTMLElement]|align","link^[HTMLElement]|as,charset,%crossOrigin,!disabled,href,hreflang,imageSizes,imageSrcset,integrity,media,referrerPolicy,rel,%relList,rev,%sizes,target,type","map^[HTMLElement]|name","marquee^[HTMLElement]|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width","menu^[HTMLElement]|!compact","meta^[HTMLElement]|content,httpEquiv,media,name,scheme","meter^[HTMLElement]|#high,#low,#max,#min,#optimum,#value","ins,del^[HTMLElement]|cite,dateTime","ol^[HTMLElement]|!compact,!reversed,#start,type","object^[HTMLElement]|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width","optgroup^[HTMLElement]|!disabled,label","option^[HTMLElement]|!defaultSelected,!disabled,label,!selected,text,value","output^[HTMLElement]|defaultValue,%htmlFor,name,value","p^[HTMLElement]|align","param^[HTMLElement]|name,type,value,valueType","picture^[HTMLElement]|","pre^[HTMLElement]|#width","progress^[HTMLElement]|#max,#value","q,blockquote,cite^[HTMLElement]|","script^[HTMLElement]|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,!noModule,%referrerPolicy,src,text,type","select^[HTMLElement]|autocomplete,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value","slot^[HTMLElement]|name","source^[HTMLElement]|#height,media,sizes,src,srcset,type,#width","span^[HTMLElement]|","style^[HTMLElement]|!disabled,media,type","caption^[HTMLElement]|align","th,td^[HTMLElement]|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width","col,colgroup^[HTMLElement]|align,ch,chOff,#span,vAlign,width","table^[HTMLElement]|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width","tr^[HTMLElement]|align,bgColor,ch,chOff,vAlign","tfoot,thead,tbody^[HTMLElement]|align,ch,chOff,vAlign","template^[HTMLElement]|","textarea^[HTMLElement]|autocomplete,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap","time^[HTMLElement]|dateTime","title^[HTMLElement]|text","track^[HTMLElement]|!default,kind,label,src,srclang","ul^[HTMLElement]|!compact,type","unknown^[HTMLElement]|","video^media|!disablePictureInPicture,#height,*enterpictureinpicture,*leavepictureinpicture,!playsInline,poster,#width",":svg:a^:svg:graphics|",":svg:animate^:svg:animation|",":svg:animateMotion^:svg:animation|",":svg:animateTransform^:svg:animation|",":svg:circle^:svg:geometry|",":svg:clipPath^:svg:graphics|",":svg:defs^:svg:graphics|",":svg:desc^:svg:|",":svg:discard^:svg:|",":svg:ellipse^:svg:geometry|",":svg:feBlend^:svg:|",":svg:feColorMatrix^:svg:|",":svg:feComponentTransfer^:svg:|",":svg:feComposite^:svg:|",":svg:feConvolveMatrix^:svg:|",":svg:feDiffuseLighting^:svg:|",":svg:feDisplacementMap^:svg:|",":svg:feDistantLight^:svg:|",":svg:feDropShadow^:svg:|",":svg:feFlood^:svg:|",":svg:feFuncA^:svg:componentTransferFunction|",":svg:feFuncB^:svg:componentTransferFunction|",":svg:feFuncG^:svg:componentTransferFunction|",":svg:feFuncR^:svg:componentTransferFunction|",":svg:feGaussianBlur^:svg:|",":svg:feImage^:svg:|",":svg:feMerge^:svg:|",":svg:feMergeNode^:svg:|",":svg:feMorphology^:svg:|",":svg:feOffset^:svg:|",":svg:fePointLight^:svg:|",":svg:feSpecularLighting^:svg:|",":svg:feSpotLight^:svg:|",":svg:feTile^:svg:|",":svg:feTurbulence^:svg:|",":svg:filter^:svg:|",":svg:foreignObject^:svg:graphics|",":svg:g^:svg:graphics|",":svg:image^:svg:graphics|decoding",":svg:line^:svg:geometry|",":svg:linearGradient^:svg:gradient|",":svg:mpath^:svg:|",":svg:marker^:svg:|",":svg:mask^:svg:|",":svg:metadata^:svg:|",":svg:path^:svg:geometry|",":svg:pattern^:svg:|",":svg:polygon^:svg:geometry|",":svg:polyline^:svg:geometry|",":svg:radialGradient^:svg:gradient|",":svg:rect^:svg:geometry|",":svg:svg^:svg:graphics|#currentScale,#zoomAndPan",":svg:script^:svg:|type",":svg:set^:svg:animation|",":svg:stop^:svg:|",":svg:style^:svg:|!disabled,media,title,type",":svg:switch^:svg:graphics|",":svg:symbol^:svg:|",":svg:tspan^:svg:textPositioning|",":svg:text^:svg:textPositioning|",":svg:textPath^:svg:textContent|",":svg:title^:svg:|",":svg:use^:svg:graphics|",":svg:view^:svg:|#zoomAndPan","data^[HTMLElement]|value","keygen^[HTMLElement]|!autofocus,challenge,!disabled,form,keytype,name","menuitem^[HTMLElement]|type,label,icon,!disabled,!checked,radiogroup,!default","summary^[HTMLElement]|","time^[HTMLElement]|dateTime",":svg:cursor^:svg:|",":math:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforeinput,*beforematch,*beforetoggle,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contentvisibilityautostatechange,*contextlost,*contextmenu,*contextrestored,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*scrollend,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex",":math:math^:math:|",":math:maction^:math:|",":math:menclose^:math:|",":math:merror^:math:|",":math:mfenced^:math:|",":math:mfrac^:math:|",":math:mi^:math:|",":math:mmultiscripts^:math:|",":math:mn^:math:|",":math:mo^:math:|",":math:mover^:math:|",":math:mpadded^:math:|",":math:mphantom^:math:|",":math:mroot^:math:|",":math:mrow^:math:|",":math:ms^:math:|",":math:mspace^:math:|",":math:msqrt^:math:|",":math:mstyle^:math:|",":math:msub^:math:|",":math:msubsup^:math:|",":math:msup^:math:|",":math:mtable^:math:|",":math:mtd^:math:|",":math:mtext^:math:|",":math:mtr^:math:|",":math:munder^:math:|",":math:munderover^:math:|",":math:semantics^:math:|"];const _ATTR_TO_PROP=new Map(Object.entries({class:"className",for:"htmlFor",formaction:"formAction",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex"}));const _PROP_TO_ATTR=Array.from(_ATTR_TO_PROP).reduce(((inverted,[propertyName,attributeName])=>{inverted.set(propertyName,attributeName);return inverted}),new Map);class DomElementSchemaRegistry extends ElementSchemaRegistry{constructor(){super();this._schema=new Map;this._eventSchema=new Map;SCHEMA.forEach((encodedType=>{const type=new Map;const events=new Set;const[strType,strProperties]=encodedType.split("|");const properties=strProperties.split(",");const[typeNames,superName]=strType.split("^");typeNames.split(",").forEach((tag=>{this._schema.set(tag.toLowerCase(),type);this._eventSchema.set(tag.toLowerCase(),events)}));const superType=superName&&this._schema.get(superName.toLowerCase());if(superType){for(const[prop,value]of superType){type.set(prop,value)}for(const superEvent of this._eventSchema.get(superName.toLowerCase())){events.add(superEvent)}}properties.forEach((property=>{if(property.length>0){switch(property[0]){case"*":events.add(property.substring(1));break;case"!":type.set(property.substring(1),BOOLEAN);break;case"#":type.set(property.substring(1),NUMBER);break;case"%":type.set(property.substring(1),OBJECT);break;default:type.set(property,STRING)}}}))}))}hasProperty(tagName,propName,schemaMetas){if(schemaMetas.some((schema=>schema.name===NO_ERRORS_SCHEMA.name))){return true}if(tagName.indexOf("-")>-1){if(isNgContainer(tagName)||isNgContent(tagName)){return false}if(schemaMetas.some((schema=>schema.name===CUSTOM_ELEMENTS_SCHEMA.name))){return true}}const elementProperties=this._schema.get(tagName.toLowerCase())||this._schema.get("unknown");return elementProperties.has(propName)}hasElement(tagName,schemaMetas){if(schemaMetas.some((schema=>schema.name===NO_ERRORS_SCHEMA.name))){return true}if(tagName.indexOf("-")>-1){if(isNgContainer(tagName)||isNgContent(tagName)){return true}if(schemaMetas.some((schema=>schema.name===CUSTOM_ELEMENTS_SCHEMA.name))){return true}}return this._schema.has(tagName.toLowerCase())}securityContext(tagName,propName,isAttribute){if(isAttribute){propName=this.getMappedPropName(propName)}tagName=tagName.toLowerCase();propName=propName.toLowerCase();let ctx=SECURITY_SCHEMA()[tagName+"|"+propName];if(ctx){return ctx}ctx=SECURITY_SCHEMA()["*|"+propName];return ctx?ctx:SecurityContext.NONE}getMappedPropName(propName){return _ATTR_TO_PROP.get(propName)??propName}getDefaultComponentElementName(){return"ng-component"}validateProperty(name){if(name.toLowerCase().startsWith("on")){const msg=`Binding to event property '${name}' is disallowed for security reasons, `+`please use (${name.slice(2)})=...`+`\nIf '${name}' is a directive input, make sure the directive is imported by the`+` current module.`;return{error:true,msg:msg}}else{return{error:false}}}validateAttribute(name){if(name.toLowerCase().startsWith("on")){const msg=`Binding to event attribute '${name}' is disallowed for security reasons, `+`please use (${name.slice(2)})=...`;return{error:true,msg:msg}}else{return{error:false}}}allKnownElementNames(){return Array.from(this._schema.keys())}allKnownAttributesOfElement(tagName){const elementProperties=this._schema.get(tagName.toLowerCase())||this._schema.get("unknown");return Array.from(elementProperties.keys()).map((prop=>_PROP_TO_ATTR.get(prop)??prop))}allKnownEventsOfElement(tagName){return Array.from(this._eventSchema.get(tagName.toLowerCase())??[])}normalizeAnimationStyleProperty(propName){return dashCaseToCamelCase(propName)}normalizeAnimationStyleValue(camelCaseProp,userProvidedProp,val){let unit="";const strVal=val.toString().trim();let errorMsg=null;if(_isPixelDimensionStyle(camelCaseProp)&&val!==0&&val!=="0"){if(typeof val==="number"){unit="px"}else{const valAndSuffixMatch=val.match(/^[+-]?[\d\.]+([a-z]*)$/);if(valAndSuffixMatch&&valAndSuffixMatch[1].length==0){errorMsg=`Please provide a CSS unit value for ${userProvidedProp}:${val}`}}}return{error:errorMsg,value:strVal+unit}}}function _isPixelDimensionStyle(prop){switch(prop){case"width":case"height":case"minWidth":case"minHeight":case"maxWidth":case"maxHeight":case"left":case"top":case"bottom":case"right":case"fontSize":case"outlineWidth":case"outlineOffset":case"paddingTop":case"paddingLeft":case"paddingBottom":case"paddingRight":case"marginTop":case"marginLeft":case"marginBottom":case"marginRight":case"borderRadius":case"borderWidth":case"borderTopWidth":case"borderLeftWidth":case"borderRightWidth":case"borderBottomWidth":case"textIndent":return true;default:return false}}class HtmlTagDefinition{constructor({closedByChildren:closedByChildren,implicitNamespacePrefix:implicitNamespacePrefix,contentType:contentType=exports.TagContentType.PARSABLE_DATA,closedByParent:closedByParent=false,isVoid:isVoid=false,ignoreFirstLf:ignoreFirstLf=false,preventNamespaceInheritance:preventNamespaceInheritance=false,canSelfClose:canSelfClose=false}={}){this.closedByChildren={};this.closedByParent=false;if(closedByChildren&&closedByChildren.length>0){closedByChildren.forEach((tagName=>this.closedByChildren[tagName]=true))}this.isVoid=isVoid;this.closedByParent=closedByParent||isVoid;this.implicitNamespacePrefix=implicitNamespacePrefix||null;this.contentType=contentType;this.ignoreFirstLf=ignoreFirstLf;this.preventNamespaceInheritance=preventNamespaceInheritance;this.canSelfClose=canSelfClose??isVoid}isClosedByChild(name){return this.isVoid||name.toLowerCase()in this.closedByChildren}getContentType(prefix){if(typeof this.contentType==="object"){const overrideType=prefix===undefined?undefined:this.contentType[prefix];return overrideType??this.contentType.default}return this.contentType}}let DEFAULT_TAG_DEFINITION;let TAG_DEFINITIONS;function getHtmlTagDefinition(tagName){if(!TAG_DEFINITIONS){DEFAULT_TAG_DEFINITION=new HtmlTagDefinition({canSelfClose:true});TAG_DEFINITIONS=Object.assign(Object.create(null),{base:new HtmlTagDefinition({isVoid:true}),meta:new HtmlTagDefinition({isVoid:true}),area:new HtmlTagDefinition({isVoid:true}),embed:new HtmlTagDefinition({isVoid:true}),link:new HtmlTagDefinition({isVoid:true}),img:new HtmlTagDefinition({isVoid:true}),input:new HtmlTagDefinition({isVoid:true}),param:new HtmlTagDefinition({isVoid:true}),hr:new HtmlTagDefinition({isVoid:true}),br:new HtmlTagDefinition({isVoid:true}),source:new HtmlTagDefinition({isVoid:true}),track:new HtmlTagDefinition({isVoid:true}),wbr:new HtmlTagDefinition({isVoid:true}),p:new HtmlTagDefinition({closedByChildren:["address","article","aside","blockquote","div","dl","fieldset","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","nav","ol","p","pre","section","table","ul"],closedByParent:true}),thead:new HtmlTagDefinition({closedByChildren:["tbody","tfoot"]}),tbody:new HtmlTagDefinition({closedByChildren:["tbody","tfoot"],closedByParent:true}),tfoot:new HtmlTagDefinition({closedByChildren:["tbody"],closedByParent:true}),tr:new HtmlTagDefinition({closedByChildren:["tr"],closedByParent:true}),td:new HtmlTagDefinition({closedByChildren:["td","th"],closedByParent:true}),th:new HtmlTagDefinition({closedByChildren:["td","th"],closedByParent:true}),col:new HtmlTagDefinition({isVoid:true}),svg:new HtmlTagDefinition({implicitNamespacePrefix:"svg"}),foreignObject:new HtmlTagDefinition({implicitNamespacePrefix:"svg",preventNamespaceInheritance:true}),math:new HtmlTagDefinition({implicitNamespacePrefix:"math"}),li:new HtmlTagDefinition({closedByChildren:["li"],closedByParent:true}),dt:new HtmlTagDefinition({closedByChildren:["dt","dd"]}),dd:new HtmlTagDefinition({closedByChildren:["dt","dd"],closedByParent:true}),rb:new HtmlTagDefinition({closedByChildren:["rb","rt","rtc","rp"],closedByParent:true}),rt:new HtmlTagDefinition({closedByChildren:["rb","rt","rtc","rp"],closedByParent:true}),rtc:new HtmlTagDefinition({closedByChildren:["rb","rtc","rp"],closedByParent:true}),rp:new HtmlTagDefinition({closedByChildren:["rb","rt","rtc","rp"],closedByParent:true}),optgroup:new HtmlTagDefinition({closedByChildren:["optgroup"],closedByParent:true}),option:new HtmlTagDefinition({closedByChildren:["option","optgroup"],closedByParent:true}),pre:new HtmlTagDefinition({ignoreFirstLf:true}),listing:new HtmlTagDefinition({ignoreFirstLf:true}),style:new HtmlTagDefinition({contentType:exports.TagContentType.RAW_TEXT}),script:new HtmlTagDefinition({contentType:exports.TagContentType.RAW_TEXT}),title:new HtmlTagDefinition({contentType:{default:exports.TagContentType.ESCAPABLE_RAW_TEXT,svg:exports.TagContentType.PARSABLE_DATA}}),textarea:new HtmlTagDefinition({contentType:exports.TagContentType.ESCAPABLE_RAW_TEXT,ignoreFirstLf:true})});(new DomElementSchemaRegistry).allKnownElementNames().forEach((knownTagName=>{if(!TAG_DEFINITIONS[knownTagName]&&getNsPrefix(knownTagName)===null){TAG_DEFINITIONS[knownTagName]=new HtmlTagDefinition({canSelfClose:false})}}))}return TAG_DEFINITIONS[tagName]??TAG_DEFINITIONS[tagName.toLowerCase()]??DEFAULT_TAG_DEFINITION}const TAG_TO_PLACEHOLDER_NAMES={A:"LINK",B:"BOLD_TEXT",BR:"LINE_BREAK",EM:"EMPHASISED_TEXT",H1:"HEADING_LEVEL1",H2:"HEADING_LEVEL2",H3:"HEADING_LEVEL3",H4:"HEADING_LEVEL4",H5:"HEADING_LEVEL5",H6:"HEADING_LEVEL6",HR:"HORIZONTAL_RULE",I:"ITALIC_TEXT",LI:"LIST_ITEM",LINK:"MEDIA_LINK",OL:"ORDERED_LIST",P:"PARAGRAPH",Q:"QUOTATION",S:"STRIKETHROUGH_TEXT",SMALL:"SMALL_TEXT",SUB:"SUBSTRIPT",SUP:"SUPERSCRIPT",TBODY:"TABLE_BODY",TD:"TABLE_CELL",TFOOT:"TABLE_FOOTER",TH:"TABLE_HEADER_CELL",THEAD:"TABLE_HEADER",TR:"TABLE_ROW",TT:"MONOSPACED_TEXT",U:"UNDERLINED_TEXT",UL:"UNORDERED_LIST"};class PlaceholderRegistry{constructor(){this._placeHolderNameCounts={};this._signatureToName={}}getStartTagPlaceholderName(tag,attrs,isVoid){const signature=this._hashTag(tag,attrs,isVoid);if(this._signatureToName[signature]){return this._signatureToName[signature]}const upperTag=tag.toUpperCase();const baseName=TAG_TO_PLACEHOLDER_NAMES[upperTag]||`TAG_${upperTag}`;const name=this._generateUniqueName(isVoid?baseName:`START_${baseName}`);this._signatureToName[signature]=name;return name}getCloseTagPlaceholderName(tag){const signature=this._hashClosingTag(tag);if(this._signatureToName[signature]){return this._signatureToName[signature]}const upperTag=tag.toUpperCase();const baseName=TAG_TO_PLACEHOLDER_NAMES[upperTag]||`TAG_${upperTag}`;const name=this._generateUniqueName(`CLOSE_${baseName}`);this._signatureToName[signature]=name;return name}getPlaceholderName(name,content){const upperName=name.toUpperCase();const signature=`PH: ${upperName}=${content}`;if(this._signatureToName[signature]){return this._signatureToName[signature]}const uniqueName=this._generateUniqueName(upperName);this._signatureToName[signature]=uniqueName;return uniqueName}getUniquePlaceholder(name){return this._generateUniqueName(name.toUpperCase())}getStartBlockPlaceholderName(name,parameters){const signature=this._hashBlock(name,parameters);if(this._signatureToName[signature]){return this._signatureToName[signature]}const placeholder=this._generateUniqueName(`START_BLOCK_${this._toSnakeCase(name)}`);this._signatureToName[signature]=placeholder;return placeholder}getCloseBlockPlaceholderName(name){const signature=this._hashClosingBlock(name);if(this._signatureToName[signature]){return this._signatureToName[signature]}const placeholder=this._generateUniqueName(`CLOSE_BLOCK_${this._toSnakeCase(name)}`);this._signatureToName[signature]=placeholder;return placeholder}_hashTag(tag,attrs,isVoid){const start=`<${tag}`;const strAttrs=Object.keys(attrs).sort().map((name=>` ${name}=${attrs[name]}`)).join("");const end=isVoid?"/>":`></${tag}>`;return start+strAttrs+end}_hashClosingTag(tag){return this._hashTag(`/${tag}`,{},false)}_hashBlock(name,parameters){const params=parameters.length===0?"":` (${parameters.sort().join("; ")})`;return`@${name}${params} {}`}_hashClosingBlock(name){return this._hashBlock(`close_${name}`,[])}_toSnakeCase(name){return name.toUpperCase().replace(/[^A-Z0-9]/g,"_")}_generateUniqueName(base){const seen=this._placeHolderNameCounts.hasOwnProperty(base);if(!seen){this._placeHolderNameCounts[base]=1;return base}const id=this._placeHolderNameCounts[base];this._placeHolderNameCounts[base]=id+1;return`${base}_${id}`}}const _expParser=new Parser$1(new Lexer);function createI18nMessageFactory(interpolationConfig,containerBlocks){const visitor=new _I18nVisitor(_expParser,interpolationConfig,containerBlocks);return(nodes,meaning,description,customId,visitNodeFn)=>visitor.toI18nMessage(nodes,meaning,description,customId,visitNodeFn)}function noopVisitNodeFn(_html,i18n){return i18n}class _I18nVisitor{constructor(_expressionParser,_interpolationConfig,_containerBlocks){this._expressionParser=_expressionParser;this._interpolationConfig=_interpolationConfig;this._containerBlocks=_containerBlocks}toI18nMessage(nodes,meaning="",description="",customId="",visitNodeFn){const context={isIcu:nodes.length==1&&nodes[0]instanceof Expansion,icuDepth:0,placeholderRegistry:new PlaceholderRegistry,placeholderToContent:{},placeholderToMessage:{},visitNodeFn:visitNodeFn||noopVisitNodeFn};const i18nodes=visitAll(this,nodes,context);return new Message(i18nodes,context.placeholderToContent,context.placeholderToMessage,meaning,description,customId)}visitElement(el,context){const children=visitAll(this,el.children,context);const attrs={};el.attrs.forEach((attr=>{attrs[attr.name]=attr.value}));const isVoid=getHtmlTagDefinition(el.name).isVoid;const startPhName=context.placeholderRegistry.getStartTagPlaceholderName(el.name,attrs,isVoid);context.placeholderToContent[startPhName]={text:el.startSourceSpan.toString(),sourceSpan:el.startSourceSpan};let closePhName="";if(!isVoid){closePhName=context.placeholderRegistry.getCloseTagPlaceholderName(el.name);context.placeholderToContent[closePhName]={text:`</${el.name}>`,sourceSpan:el.endSourceSpan??el.sourceSpan}}const node=new TagPlaceholder(el.name,attrs,startPhName,closePhName,children,isVoid,el.sourceSpan,el.startSourceSpan,el.endSourceSpan);return context.visitNodeFn(el,node)}visitAttribute(attribute,context){const node=attribute.valueTokens===undefined||attribute.valueTokens.length===1?new Text$2(attribute.value,attribute.valueSpan||attribute.sourceSpan):this._visitTextWithInterpolation(attribute.valueTokens,attribute.valueSpan||attribute.sourceSpan,context,attribute.i18n);return context.visitNodeFn(attribute,node)}visitText(text,context){const node=text.tokens.length===1?new Text$2(text.value,text.sourceSpan):this._visitTextWithInterpolation(text.tokens,text.sourceSpan,context,text.i18n);return context.visitNodeFn(text,node)}visitComment(comment,context){return null}visitExpansion(icu,context){context.icuDepth++;const i18nIcuCases={};const i18nIcu=new Icu(icu.switchValue,icu.type,i18nIcuCases,icu.sourceSpan);icu.cases.forEach((caze=>{i18nIcuCases[caze.value]=new Container(caze.expression.map((node=>node.visit(this,context))),caze.expSourceSpan)}));context.icuDepth--;if(context.isIcu||context.icuDepth>0){const expPh=context.placeholderRegistry.getUniquePlaceholder(`VAR_${icu.type}`);i18nIcu.expressionPlaceholder=expPh;context.placeholderToContent[expPh]={text:icu.switchValue,sourceSpan:icu.switchValueSourceSpan};return context.visitNodeFn(icu,i18nIcu)}const phName=context.placeholderRegistry.getPlaceholderName("ICU",icu.sourceSpan.toString());context.placeholderToMessage[phName]=this.toI18nMessage([icu],"","","",undefined);const node=new IcuPlaceholder(i18nIcu,phName,icu.sourceSpan);return context.visitNodeFn(icu,node)}visitExpansionCase(_icuCase,_context){throw new Error("Unreachable code")}visitBlock(block,context){const children=visitAll(this,block.children,context);if(this._containerBlocks.has(block.name)){return new Container(children,block.sourceSpan)}const parameters=block.parameters.map((param=>param.expression));const startPhName=context.placeholderRegistry.getStartBlockPlaceholderName(block.name,parameters);const closePhName=context.placeholderRegistry.getCloseBlockPlaceholderName(block.name);context.placeholderToContent[startPhName]={text:block.startSourceSpan.toString(),sourceSpan:block.startSourceSpan};context.placeholderToContent[closePhName]={text:block.endSourceSpan?block.endSourceSpan.toString():"}",sourceSpan:block.endSourceSpan??block.sourceSpan};const node=new BlockPlaceholder(block.name,parameters,startPhName,closePhName,children,block.sourceSpan,block.startSourceSpan,block.endSourceSpan);return context.visitNodeFn(block,node)}visitBlockParameter(_parameter,_context){throw new Error("Unreachable code")}_visitTextWithInterpolation(tokens,sourceSpan,context,previousI18n){const nodes=[];let hasInterpolation=false;for(const token of tokens){switch(token.type){case 8:case 17:hasInterpolation=true;const expression=token.parts[1];const baseName=extractPlaceholderName(expression)||"INTERPOLATION";const phName=context.placeholderRegistry.getPlaceholderName(baseName,expression);context.placeholderToContent[phName]={text:token.parts.join(""),sourceSpan:token.sourceSpan};nodes.push(new Placeholder(expression,phName,token.sourceSpan));break;default:if(token.parts[0].length>0){const previous=nodes[nodes.length-1];if(previous instanceof Text$2){previous.value+=token.parts[0];previous.sourceSpan=new ParseSourceSpan(previous.sourceSpan.start,token.sourceSpan.end,previous.sourceSpan.fullStart,previous.sourceSpan.details)}else{nodes.push(new Text$2(token.parts[0],token.sourceSpan))}}break}}if(hasInterpolation){reusePreviousSourceSpans(nodes,previousI18n);return new Container(nodes,sourceSpan)}else{return nodes[0]}}}function reusePreviousSourceSpans(nodes,previousI18n){if(previousI18n instanceof Message){assertSingleContainerMessage(previousI18n);previousI18n=previousI18n.nodes[0]}if(previousI18n instanceof Container){assertEquivalentNodes(previousI18n.children,nodes);for(let i=0;i<nodes.length;i++){nodes[i].sourceSpan=previousI18n.children[i].sourceSpan}}}function assertSingleContainerMessage(message){const nodes=message.nodes;if(nodes.length!==1||!(nodes[0]instanceof Container)){throw new Error("Unexpected previous i18n message - expected it to consist of only a single `Container` node.")}}function assertEquivalentNodes(previousNodes,nodes){if(previousNodes.length!==nodes.length){throw new Error("The number of i18n message children changed between first and second pass.")}if(previousNodes.some(((node,i)=>nodes[i].constructor!==node.constructor))){throw new Error("The types of the i18n message children changed between first and second pass.")}}const _CUSTOM_PH_EXP=/\/\/[\s\S]*i18n[\s\S]*\([\s\S]*ph[\s\S]*=[\s\S]*("|')([\s\S]*?)\1[\s\S]*\)/g;function extractPlaceholderName(input){return input.split(_CUSTOM_PH_EXP)[2]}class I18nError extends ParseError{constructor(span,msg){super(span,msg)}}const NAMED_ENTITIES={AElig:"\xc6",AMP:"&",amp:"&",Aacute:"\xc1",Abreve:"\u0102",Acirc:"\xc2",Acy:"\u0410",Afr:"\ud835\udd04",Agrave:"\xc0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2a53",Aogon:"\u0104",Aopf:"\ud835\udd38",ApplyFunction:"\u2061",af:"\u2061",Aring:"\xc5",angst:"\xc5",Ascr:"\ud835\udc9c",Assign:"\u2254",colone:"\u2254",coloneq:"\u2254",Atilde:"\xc3",Auml:"\xc4",Backslash:"\u2216",setminus:"\u2216",setmn:"\u2216",smallsetminus:"\u2216",ssetmn:"\u2216",Barv:"\u2ae7",Barwed:"\u2306",doublebarwedge:"\u2306",Bcy:"\u0411",Because:"\u2235",becaus:"\u2235",because:"\u2235",Bernoullis:"\u212c",Bscr:"\u212c",bernou:"\u212c",Beta:"\u0392",Bfr:"\ud835\udd05",Bopf:"\ud835\udd39",Breve:"\u02d8",breve:"\u02d8",Bumpeq:"\u224e",HumpDownHump:"\u224e",bump:"\u224e",CHcy:"\u0427",COPY:"\xa9",copy:"\xa9",Cacute:"\u0106",Cap:"\u22d2",CapitalDifferentialD:"\u2145",DD:"\u2145",Cayleys:"\u212d",Cfr:"\u212d",Ccaron:"\u010c",Ccedil:"\xc7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010a",Cedilla:"\xb8",cedil:"\xb8",CenterDot:"\xb7",centerdot:"\xb7",middot:"\xb7",Chi:"\u03a7",CircleDot:"\u2299",odot:"\u2299",CircleMinus:"\u2296",ominus:"\u2296",CirclePlus:"\u2295",oplus:"\u2295",CircleTimes:"\u2297",otimes:"\u2297",ClockwiseContourIntegral:"\u2232",cwconint:"\u2232",CloseCurlyDoubleQuote:"\u201d",rdquo:"\u201d",rdquor:"\u201d",CloseCurlyQuote:"\u2019",rsquo:"\u2019",rsquor:"\u2019",Colon:"\u2237",Proportion:"\u2237",Colone:"\u2a74",Congruent:"\u2261",equiv:"\u2261",Conint:"\u222f",DoubleContourIntegral:"\u222f",ContourIntegral:"\u222e",conint:"\u222e",oint:"\u222e",Copf:"\u2102",complexes:"\u2102",Coproduct:"\u2210",coprod:"\u2210",CounterClockwiseContourIntegral:"\u2233",awconint:"\u2233",Cross:"\u2a2f",Cscr:"\ud835\udc9e",Cup:"\u22d3",CupCap:"\u224d",asympeq:"\u224d",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040f",Dagger:"\u2021",ddagger:"\u2021",Darr:"\u21a1",Dashv:"\u2ae4",DoubleLeftTee:"\u2ae4",Dcaron:"\u010e",Dcy:"\u0414",Del:"\u2207",nabla:"\u2207",Delta:"\u0394",Dfr:"\ud835\udd07",DiacriticalAcute:"\xb4",acute:"\xb4",DiacriticalDot:"\u02d9",dot:"\u02d9",DiacriticalDoubleAcute:"\u02dd",dblac:"\u02dd",DiacriticalGrave:"`",grave:"`",DiacriticalTilde:"\u02dc",tilde:"\u02dc",Diamond:"\u22c4",diam:"\u22c4",diamond:"\u22c4",DifferentialD:"\u2146",dd:"\u2146",Dopf:"\ud835\udd3b",Dot:"\xa8",DoubleDot:"\xa8",die:"\xa8",uml:"\xa8",DotDot:"\u20dc",DotEqual:"\u2250",doteq:"\u2250",esdot:"\u2250",DoubleDownArrow:"\u21d3",Downarrow:"\u21d3",dArr:"\u21d3",DoubleLeftArrow:"\u21d0",Leftarrow:"\u21d0",lArr:"\u21d0",DoubleLeftRightArrow:"\u21d4",Leftrightarrow:"\u21d4",hArr:"\u21d4",iff:"\u21d4",DoubleLongLeftArrow:"\u27f8",Longleftarrow:"\u27f8",xlArr:"\u27f8",DoubleLongLeftRightArrow:"\u27fa",Longleftrightarrow:"\u27fa",xhArr:"\u27fa",DoubleLongRightArrow:"\u27f9",Longrightarrow:"\u27f9",xrArr:"\u27f9",DoubleRightArrow:"\u21d2",Implies:"\u21d2",Rightarrow:"\u21d2",rArr:"\u21d2",DoubleRightTee:"\u22a8",vDash:"\u22a8",DoubleUpArrow:"\u21d1",Uparrow:"\u21d1",uArr:"\u21d1",DoubleUpDownArrow:"\u21d5",Updownarrow:"\u21d5",vArr:"\u21d5",DoubleVerticalBar:"\u2225",par:"\u2225",parallel:"\u2225",shortparallel:"\u2225",spar:"\u2225",DownArrow:"\u2193",ShortDownArrow:"\u2193",darr:"\u2193",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21f5",duarr:"\u21f5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295e",DownLeftVector:"\u21bd",leftharpoondown:"\u21bd",lhard:"\u21bd",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295f",DownRightVector:"\u21c1",rhard:"\u21c1",rightharpoondown:"\u21c1",DownRightVectorBar:"\u2957",DownTee:"\u22a4",top:"\u22a4",DownTeeArrow:"\u21a7",mapstodown:"\u21a7",Dscr:"\ud835\udc9f",Dstrok:"\u0110",ENG:"\u014a",ETH:"\xd0",Eacute:"\xc9",Ecaron:"\u011a",Ecirc:"\xca",Ecy:"\u042d",Edot:"\u0116",Efr:"\ud835\udd08",Egrave:"\xc8",Element:"\u2208",in:"\u2208",isin:"\u2208",isinv:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25fb",EmptyVerySmallSquare:"\u25ab",Eogon:"\u0118",Eopf:"\ud835\udd3c",Epsilon:"\u0395",Equal:"\u2a75",EqualTilde:"\u2242",eqsim:"\u2242",esim:"\u2242",Equilibrium:"\u21cc",rightleftharpoons:"\u21cc",rlhar:"\u21cc",Escr:"\u2130",expectation:"\u2130",Esim:"\u2a73",Eta:"\u0397",Euml:"\xcb",Exists:"\u2203",exist:"\u2203",ExponentialE:"\u2147",ee:"\u2147",exponentiale:"\u2147",Fcy:"\u0424",Ffr:"\ud835\udd09",FilledSmallSquare:"\u25fc",FilledVerySmallSquare:"\u25aa",blacksquare:"\u25aa",squarf:"\u25aa",squf:"\u25aa",Fopf:"\ud835\udd3d",ForAll:"\u2200",forall:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",GT:">",gt:">",Gamma:"\u0393",Gammad:"\u03dc",Gbreve:"\u011e",Gcedil:"\u0122",Gcirc:"\u011c",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\ud835\udd0a",Gg:"\u22d9",ggg:"\u22d9",Gopf:"\ud835\udd3e",GreaterEqual:"\u2265",ge:"\u2265",geq:"\u2265",GreaterEqualLess:"\u22db",gel:"\u22db",gtreqless:"\u22db",GreaterFullEqual:"\u2267",gE:"\u2267",geqq:"\u2267",GreaterGreater:"\u2aa2",GreaterLess:"\u2277",gl:"\u2277",gtrless:"\u2277",GreaterSlantEqual:"\u2a7e",geqslant:"\u2a7e",ges:"\u2a7e",GreaterTilde:"\u2273",gsim:"\u2273",gtrsim:"\u2273",Gscr:"\ud835\udca2",Gt:"\u226b",NestedGreaterGreater:"\u226b",gg:"\u226b",HARDcy:"\u042a",Hacek:"\u02c7",caron:"\u02c7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210c",Poincareplane:"\u210c",HilbertSpace:"\u210b",Hscr:"\u210b",hamilt:"\u210b",Hopf:"\u210d",quaternions:"\u210d",HorizontalLine:"\u2500",boxh:"\u2500",Hstrok:"\u0126",HumpEqual:"\u224f",bumpe:"\u224f",bumpeq:"\u224f",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xcd",Icirc:"\xce",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Im:"\u2111",image:"\u2111",imagpart:"\u2111",Igrave:"\xcc",Imacr:"\u012a",ImaginaryI:"\u2148",ii:"\u2148",Int:"\u222c",Integral:"\u222b",int:"\u222b",Intersection:"\u22c2",bigcap:"\u22c2",xcap:"\u22c2",InvisibleComma:"\u2063",ic:"\u2063",InvisibleTimes:"\u2062",it:"\u2062",Iogon:"\u012e",Iopf:"\ud835\udd40",Iota:"\u0399",Iscr:"\u2110",imagline:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xcf",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\ud835\udd0d",Jopf:"\ud835\udd41",Jscr:"\ud835\udca5",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040c",Kappa:"\u039a",Kcedil:"\u0136",Kcy:"\u041a",Kfr:"\ud835\udd0e",Kopf:"\ud835\udd42",Kscr:"\ud835\udca6",LJcy:"\u0409",LT:"<",lt:"<",Lacute:"\u0139",Lambda:"\u039b",Lang:"\u27ea",Laplacetrf:"\u2112",Lscr:"\u2112",lagran:"\u2112",Larr:"\u219e",twoheadleftarrow:"\u219e",Lcaron:"\u013d",Lcedil:"\u013b",Lcy:"\u041b",LeftAngleBracket:"\u27e8",lang:"\u27e8",langle:"\u27e8",LeftArrow:"\u2190",ShortLeftArrow:"\u2190",larr:"\u2190",leftarrow:"\u2190",slarr:"\u2190",LeftArrowBar:"\u21e4",larrb:"\u21e4",LeftArrowRightArrow:"\u21c6",leftrightarrows:"\u21c6",lrarr:"\u21c6",LeftCeiling:"\u2308",lceil:"\u2308",LeftDoubleBracket:"\u27e6",lobrk:"\u27e6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21c3",dharl:"\u21c3",downharpoonleft:"\u21c3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230a",lfloor:"\u230a",LeftRightArrow:"\u2194",harr:"\u2194",leftrightarrow:"\u2194",LeftRightVector:"\u294e",LeftTee:"\u22a3",dashv:"\u22a3",LeftTeeArrow:"\u21a4",mapstoleft:"\u21a4",LeftTeeVector:"\u295a",LeftTriangle:"\u22b2",vartriangleleft:"\u22b2",vltri:"\u22b2",LeftTriangleBar:"\u29cf",LeftTriangleEqual:"\u22b4",ltrie:"\u22b4",trianglelefteq:"\u22b4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21bf",uharl:"\u21bf",upharpoonleft:"\u21bf",LeftUpVectorBar:"\u2958",LeftVector:"\u21bc",leftharpoonup:"\u21bc",lharu:"\u21bc",LeftVectorBar:"\u2952",LessEqualGreater:"\u22da",leg:"\u22da",lesseqgtr:"\u22da",LessFullEqual:"\u2266",lE:"\u2266",leqq:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",lg:"\u2276",LessLess:"\u2aa1",LessSlantEqual:"\u2a7d",leqslant:"\u2a7d",les:"\u2a7d",LessTilde:"\u2272",lesssim:"\u2272",lsim:"\u2272",Lfr:"\ud835\udd0f",Ll:"\u22d8",Lleftarrow:"\u21da",lAarr:"\u21da",Lmidot:"\u013f",LongLeftArrow:"\u27f5",longleftarrow:"\u27f5",xlarr:"\u27f5",LongLeftRightArrow:"\u27f7",longleftrightarrow:"\u27f7",xharr:"\u27f7",LongRightArrow:"\u27f6",longrightarrow:"\u27f6",xrarr:"\u27f6",Lopf:"\ud835\udd43",LowerLeftArrow:"\u2199",swarr:"\u2199",swarrow:"\u2199",LowerRightArrow:"\u2198",searr:"\u2198",searrow:"\u2198",Lsh:"\u21b0",lsh:"\u21b0",Lstrok:"\u0141",Lt:"\u226a",NestedLessLess:"\u226a",ll:"\u226a",Map:"\u2905",Mcy:"\u041c",MediumSpace:"\u205f",Mellintrf:"\u2133",Mscr:"\u2133",phmmat:"\u2133",Mfr:"\ud835\udd10",MinusPlus:"\u2213",mnplus:"\u2213",mp:"\u2213",Mopf:"\ud835\udd44",Mu:"\u039c",NJcy:"\u040a",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041d",NegativeMediumSpace:"\u200b",NegativeThickSpace:"\u200b",NegativeThinSpace:"\u200b",NegativeVeryThinSpace:"\u200b",ZeroWidthSpace:"\u200b",NewLine:"\n",Nfr:"\ud835\udd11",NoBreak:"\u2060",NonBreakingSpace:"\xa0",nbsp:"\xa0",Nopf:"\u2115",naturals:"\u2115",Not:"\u2aec",NotCongruent:"\u2262",nequiv:"\u2262",NotCupCap:"\u226d",NotDoubleVerticalBar:"\u2226",npar:"\u2226",nparallel:"\u2226",nshortparallel:"\u2226",nspar:"\u2226",NotElement:"\u2209",notin:"\u2209",notinva:"\u2209",NotEqual:"\u2260",ne:"\u2260",NotEqualTilde:"\u2242\u0338",nesim:"\u2242\u0338",NotExists:"\u2204",nexist:"\u2204",nexists:"\u2204",NotGreater:"\u226f",ngt:"\u226f",ngtr:"\u226f",NotGreaterEqual:"\u2271",nge:"\u2271",ngeq:"\u2271",NotGreaterFullEqual:"\u2267\u0338",ngE:"\u2267\u0338",ngeqq:"\u2267\u0338",NotGreaterGreater:"\u226b\u0338",nGtv:"\u226b\u0338",NotGreaterLess:"\u2279",ntgl:"\u2279",NotGreaterSlantEqual:"\u2a7e\u0338",ngeqslant:"\u2a7e\u0338",nges:"\u2a7e\u0338",NotGreaterTilde:"\u2275",ngsim:"\u2275",NotHumpDownHump:"\u224e\u0338",nbump:"\u224e\u0338",NotHumpEqual:"\u224f\u0338",nbumpe:"\u224f\u0338",NotLeftTriangle:"\u22ea",nltri:"\u22ea",ntriangleleft:"\u22ea",NotLeftTriangleBar:"\u29cf\u0338",NotLeftTriangleEqual:"\u22ec",nltrie:"\u22ec",ntrianglelefteq:"\u22ec",NotLess:"\u226e",nless:"\u226e",nlt:"\u226e",NotLessEqual:"\u2270",nle:"\u2270",nleq:"\u2270",NotLessGreater:"\u2278",ntlg:"\u2278",NotLessLess:"\u226a\u0338",nLtv:"\u226a\u0338",NotLessSlantEqual:"\u2a7d\u0338",nleqslant:"\u2a7d\u0338",nles:"\u2a7d\u0338",NotLessTilde:"\u2274",nlsim:"\u2274",NotNestedGreaterGreater:"\u2aa2\u0338",NotNestedLessLess:"\u2aa1\u0338",NotPrecedes:"\u2280",npr:"\u2280",nprec:"\u2280",NotPrecedesEqual:"\u2aaf\u0338",npre:"\u2aaf\u0338",npreceq:"\u2aaf\u0338",NotPrecedesSlantEqual:"\u22e0",nprcue:"\u22e0",NotReverseElement:"\u220c",notni:"\u220c",notniva:"\u220c",NotRightTriangle:"\u22eb",nrtri:"\u22eb",ntriangleright:"\u22eb",NotRightTriangleBar:"\u29d0\u0338",NotRightTriangleEqual:"\u22ed",nrtrie:"\u22ed",ntrianglerighteq:"\u22ed",NotSquareSubset:"\u228f\u0338",NotSquareSubsetEqual:"\u22e2",nsqsube:"\u22e2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22e3",nsqsupe:"\u22e3",NotSubset:"\u2282\u20d2",nsubset:"\u2282\u20d2",vnsub:"\u2282\u20d2",NotSubsetEqual:"\u2288",nsube:"\u2288",nsubseteq:"\u2288",NotSucceeds:"\u2281",nsc:"\u2281",nsucc:"\u2281",NotSucceedsEqual:"\u2ab0\u0338",nsce:"\u2ab0\u0338",nsucceq:"\u2ab0\u0338",NotSucceedsSlantEqual:"\u22e1",nsccue:"\u22e1",NotSucceedsTilde:"\u227f\u0338",NotSuperset:"\u2283\u20d2",nsupset:"\u2283\u20d2",vnsup:"\u2283\u20d2",NotSupersetEqual:"\u2289",nsupe:"\u2289",nsupseteq:"\u2289",NotTilde:"\u2241",nsim:"\u2241",NotTildeEqual:"\u2244",nsime:"\u2244",nsimeq:"\u2244",NotTildeFullEqual:"\u2247",ncong:"\u2247",NotTildeTilde:"\u2249",nap:"\u2249",napprox:"\u2249",NotVerticalBar:"\u2224",nmid:"\u2224",nshortmid:"\u2224",nsmid:"\u2224",Nscr:"\ud835\udca9",Ntilde:"\xd1",Nu:"\u039d",OElig:"\u0152",Oacute:"\xd3",Ocirc:"\xd4",Ocy:"\u041e",Odblac:"\u0150",Ofr:"\ud835\udd12",Ograve:"\xd2",Omacr:"\u014c",Omega:"\u03a9",ohm:"\u03a9",Omicron:"\u039f",Oopf:"\ud835\udd46",OpenCurlyDoubleQuote:"\u201c",ldquo:"\u201c",OpenCurlyQuote:"\u2018",lsquo:"\u2018",Or:"\u2a54",Oscr:"\ud835\udcaa",Oslash:"\xd8",Otilde:"\xd5",Otimes:"\u2a37",Ouml:"\xd6",OverBar:"\u203e",oline:"\u203e",OverBrace:"\u23de",OverBracket:"\u23b4",tbrk:"\u23b4",OverParenthesis:"\u23dc",PartialD:"\u2202",part:"\u2202",Pcy:"\u041f",Pfr:"\ud835\udd13",Phi:"\u03a6",Pi:"\u03a0",PlusMinus:"\xb1",plusmn:"\xb1",pm:"\xb1",Popf:"\u2119",primes:"\u2119",Pr:"\u2abb",Precedes:"\u227a",pr:"\u227a",prec:"\u227a",PrecedesEqual:"\u2aaf",pre:"\u2aaf",preceq:"\u2aaf",PrecedesSlantEqual:"\u227c",prcue:"\u227c",preccurlyeq:"\u227c",PrecedesTilde:"\u227e",precsim:"\u227e",prsim:"\u227e",Prime:"\u2033",Product:"\u220f",prod:"\u220f",Proportional:"\u221d",prop:"\u221d",propto:"\u221d",varpropto:"\u221d",vprop:"\u221d",Pscr:"\ud835\udcab",Psi:"\u03a8",QUOT:'"',quot:'"',Qfr:"\ud835\udd14",Qopf:"\u211a",rationals:"\u211a",Qscr:"\ud835\udcac",RBarr:"\u2910",drbkarow:"\u2910",REG:"\xae",circledR:"\xae",reg:"\xae",Racute:"\u0154",Rang:"\u27eb",Rarr:"\u21a0",twoheadrightarrow:"\u21a0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211c",Rfr:"\u211c",real:"\u211c",realpart:"\u211c",ReverseElement:"\u220b",SuchThat:"\u220b",ni:"\u220b",niv:"\u220b",ReverseEquilibrium:"\u21cb",leftrightharpoons:"\u21cb",lrhar:"\u21cb",ReverseUpEquilibrium:"\u296f",duhar:"\u296f",Rho:"\u03a1",RightAngleBracket:"\u27e9",rang:"\u27e9",rangle:"\u27e9",RightArrow:"\u2192",ShortRightArrow:"\u2192",rarr:"\u2192",rightarrow:"\u2192",srarr:"\u2192",RightArrowBar:"\u21e5",rarrb:"\u21e5",RightArrowLeftArrow:"\u21c4",rightleftarrows:"\u21c4",rlarr:"\u21c4",RightCeiling:"\u2309",rceil:"\u2309",RightDoubleBracket:"\u27e7",robrk:"\u27e7",RightDownTeeVector:"\u295d",RightDownVector:"\u21c2",dharr:"\u21c2",downharpoonright:"\u21c2",RightDownVectorBar:"\u2955",RightFloor:"\u230b",rfloor:"\u230b",RightTee:"\u22a2",vdash:"\u22a2",RightTeeArrow:"\u21a6",map:"\u21a6",mapsto:"\u21a6",RightTeeVector:"\u295b",RightTriangle:"\u22b3",vartriangleright:"\u22b3",vrtri:"\u22b3",RightTriangleBar:"\u29d0",RightTriangleEqual:"\u22b5",rtrie:"\u22b5",trianglerighteq:"\u22b5",RightUpDownVector:"\u294f",RightUpTeeVector:"\u295c",RightUpVector:"\u21be",uharr:"\u21be",upharpoonright:"\u21be",RightUpVectorBar:"\u2954",RightVector:"\u21c0",rharu:"\u21c0",rightharpoonup:"\u21c0",RightVectorBar:"\u2953",Ropf:"\u211d",reals:"\u211d",RoundImplies:"\u2970",Rrightarrow:"\u21db",rAarr:"\u21db",Rscr:"\u211b",realine:"\u211b",Rsh:"\u21b1",rsh:"\u21b1",RuleDelayed:"\u29f4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042c",Sacute:"\u015a",Sc:"\u2abc",Scaron:"\u0160",Scedil:"\u015e",Scirc:"\u015c",Scy:"\u0421",Sfr:"\ud835\udd16",ShortUpArrow:"\u2191",UpArrow:"\u2191",uarr:"\u2191",uparrow:"\u2191",Sigma:"\u03a3",SmallCircle:"\u2218",compfn:"\u2218",Sopf:"\ud835\udd4a",Sqrt:"\u221a",radic:"\u221a",Square:"\u25a1",squ:"\u25a1",square:"\u25a1",SquareIntersection:"\u2293",sqcap:"\u2293",SquareSubset:"\u228f",sqsub:"\u228f",sqsubset:"\u228f",SquareSubsetEqual:"\u2291",sqsube:"\u2291",sqsubseteq:"\u2291",SquareSuperset:"\u2290",sqsup:"\u2290",sqsupset:"\u2290",SquareSupersetEqual:"\u2292",sqsupe:"\u2292",sqsupseteq:"\u2292",SquareUnion:"\u2294",sqcup:"\u2294",Sscr:"\ud835\udcae",Star:"\u22c6",sstarf:"\u22c6",Sub:"\u22d0",Subset:"\u22d0",SubsetEqual:"\u2286",sube:"\u2286",subseteq:"\u2286",Succeeds:"\u227b",sc:"\u227b",succ:"\u227b",SucceedsEqual:"\u2ab0",sce:"\u2ab0",succeq:"\u2ab0",SucceedsSlantEqual:"\u227d",sccue:"\u227d",succcurlyeq:"\u227d",SucceedsTilde:"\u227f",scsim:"\u227f",succsim:"\u227f",Sum:"\u2211",sum:"\u2211",Sup:"\u22d1",Supset:"\u22d1",Superset:"\u2283",sup:"\u2283",supset:"\u2283",SupersetEqual:"\u2287",supe:"\u2287",supseteq:"\u2287",THORN:"\xde",TRADE:"\u2122",trade:"\u2122",TSHcy:"\u040b",TScy:"\u0426",Tab:"\t",Tau:"\u03a4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\ud835\udd17",Therefore:"\u2234",there4:"\u2234",therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205f\u200a",ThinSpace:"\u2009",thinsp:"\u2009",Tilde:"\u223c",sim:"\u223c",thicksim:"\u223c",thksim:"\u223c",TildeEqual:"\u2243",sime:"\u2243",simeq:"\u2243",TildeFullEqual:"\u2245",cong:"\u2245",TildeTilde:"\u2248",ap:"\u2248",approx:"\u2248",asymp:"\u2248",thickapprox:"\u2248",thkap:"\u2248",Topf:"\ud835\udd4b",TripleDot:"\u20db",tdot:"\u20db",Tscr:"\ud835\udcaf",Tstrok:"\u0166",Uacute:"\xda",Uarr:"\u219f",Uarrocir:"\u2949",Ubrcy:"\u040e",Ubreve:"\u016c",Ucirc:"\xdb",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\ud835\udd18",Ugrave:"\xd9",Umacr:"\u016a",UnderBar:"_",lowbar:"_",UnderBrace:"\u23df",UnderBracket:"\u23b5",bbrk:"\u23b5",UnderParenthesis:"\u23dd",Union:"\u22c3",bigcup:"\u22c3",xcup:"\u22c3",UnionPlus:"\u228e",uplus:"\u228e",Uogon:"\u0172",Uopf:"\ud835\udd4c",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21c5",udarr:"\u21c5",UpDownArrow:"\u2195",updownarrow:"\u2195",varr:"\u2195",UpEquilibrium:"\u296e",udhar:"\u296e",UpTee:"\u22a5",bot:"\u22a5",bottom:"\u22a5",perp:"\u22a5",UpTeeArrow:"\u21a5",mapstoup:"\u21a5",UpperLeftArrow:"\u2196",nwarr:"\u2196",nwarrow:"\u2196",UpperRightArrow:"\u2197",nearr:"\u2197",nearrow:"\u2197",Upsi:"\u03d2",upsih:"\u03d2",Upsilon:"\u03a5",Uring:"\u016e",Uscr:"\ud835\udcb0",Utilde:"\u0168",Uuml:"\xdc",VDash:"\u22ab",Vbar:"\u2aeb",Vcy:"\u0412",Vdash:"\u22a9",Vdashl:"\u2ae6",Vee:"\u22c1",bigvee:"\u22c1",xvee:"\u22c1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",mid:"\u2223",shortmid:"\u2223",smid:"\u2223",VerticalLine:"|",verbar:"|",vert:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",wr:"\u2240",wreath:"\u2240",VeryThinSpace:"\u200a",hairsp:"\u200a",Vfr:"\ud835\udd19",Vopf:"\ud835\udd4d",Vscr:"\ud835\udcb1",Vvdash:"\u22aa",Wcirc:"\u0174",Wedge:"\u22c0",bigwedge:"\u22c0",xwedge:"\u22c0",Wfr:"\ud835\udd1a",Wopf:"\ud835\udd4e",Wscr:"\ud835\udcb2",Xfr:"\ud835\udd1b",Xi:"\u039e",Xopf:"\ud835\udd4f",Xscr:"\ud835\udcb3",YAcy:"\u042f",YIcy:"\u0407",YUcy:"\u042e",Yacute:"\xdd",Ycirc:"\u0176",Ycy:"\u042b",Yfr:"\ud835\udd1c",Yopf:"\ud835\udd50",Yscr:"\ud835\udcb4",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017d",Zcy:"\u0417",Zdot:"\u017b",Zeta:"\u0396",Zfr:"\u2128",zeetrf:"\u2128",Zopf:"\u2124",integers:"\u2124",Zscr:"\ud835\udcb5",aacute:"\xe1",abreve:"\u0103",ac:"\u223e",mstpos:"\u223e",acE:"\u223e\u0333",acd:"\u223f",acirc:"\xe2",acy:"\u0430",aelig:"\xe6",afr:"\ud835\udd1e",agrave:"\xe0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03b1",amacr:"\u0101",amalg:"\u2a3f",and:"\u2227",wedge:"\u2227",andand:"\u2a55",andd:"\u2a5c",andslope:"\u2a58",andv:"\u2a5a",ang:"\u2220",angle:"\u2220",ange:"\u29a4",angmsd:"\u2221",measuredangle:"\u2221",angmsdaa:"\u29a8",angmsdab:"\u29a9",angmsdac:"\u29aa",angmsdad:"\u29ab",angmsdae:"\u29ac",angmsdaf:"\u29ad",angmsdag:"\u29ae",angmsdah:"\u29af",angrt:"\u221f",angrtvb:"\u22be",angrtvbd:"\u299d",angsph:"\u2222",angzarr:"\u237c",aogon:"\u0105",aopf:"\ud835\udd52",apE:"\u2a70",apacir:"\u2a6f",ape:"\u224a",approxeq:"\u224a",apid:"\u224b",apos:"'",aring:"\xe5",ascr:"\ud835\udcb6",ast:"*",midast:"*",atilde:"\xe3",auml:"\xe4",awint:"\u2a11",bNot:"\u2aed",backcong:"\u224c",bcong:"\u224c",backepsilon:"\u03f6",bepsi:"\u03f6",backprime:"\u2035",bprime:"\u2035",backsim:"\u223d",bsim:"\u223d",backsimeq:"\u22cd",bsime:"\u22cd",barvee:"\u22bd",barwed:"\u2305",barwedge:"\u2305",bbrktbrk:"\u23b6",bcy:"\u0431",bdquo:"\u201e",ldquor:"\u201e",bemptyv:"\u29b0",beta:"\u03b2",beth:"\u2136",between:"\u226c",twixt:"\u226c",bfr:"\ud835\udd1f",bigcirc:"\u25ef",xcirc:"\u25ef",bigodot:"\u2a00",xodot:"\u2a00",bigoplus:"\u2a01",xoplus:"\u2a01",bigotimes:"\u2a02",xotime:"\u2a02",bigsqcup:"\u2a06",xsqcup:"\u2a06",bigstar:"\u2605",starf:"\u2605",bigtriangledown:"\u25bd",xdtri:"\u25bd",bigtriangleup:"\u25b3",xutri:"\u25b3",biguplus:"\u2a04",xuplus:"\u2a04",bkarow:"\u290d",rbarr:"\u290d",blacklozenge:"\u29eb",lozf:"\u29eb",blacktriangle:"\u25b4",utrif:"\u25b4",blacktriangledown:"\u25be",dtrif:"\u25be",blacktriangleleft:"\u25c2",ltrif:"\u25c2",blacktriangleright:"\u25b8",rtrif:"\u25b8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20e5",bnequiv:"\u2261\u20e5",bnot:"\u2310",bopf:"\ud835\udd53",bowtie:"\u22c8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255d",boxUR:"\u255a",boxUl:"\u255c",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256c",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256b",boxVl:"\u2562",boxVr:"\u255f",boxbox:"\u29c9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250c",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252c",boxhu:"\u2534",boxminus:"\u229f",minusb:"\u229f",boxplus:"\u229e",plusb:"\u229e",boxtimes:"\u22a0",timesb:"\u22a0",boxuL:"\u255b",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256a",boxvL:"\u2561",boxvR:"\u255e",boxvh:"\u253c",boxvl:"\u2524",boxvr:"\u251c",brvbar:"\xa6",bscr:"\ud835\udcb7",bsemi:"\u204f",bsol:"\\",bsolb:"\u29c5",bsolhsub:"\u27c8",bull:"\u2022",bullet:"\u2022",bumpE:"\u2aae",cacute:"\u0107",cap:"\u2229",capand:"\u2a44",capbrcup:"\u2a49",capcap:"\u2a4b",capcup:"\u2a47",capdot:"\u2a40",caps:"\u2229\ufe00",caret:"\u2041",ccaps:"\u2a4d",ccaron:"\u010d",ccedil:"\xe7",ccirc:"\u0109",ccups:"\u2a4c",ccupssm:"\u2a50",cdot:"\u010b",cemptyv:"\u29b2",cent:"\xa2",cfr:"\ud835\udd20",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03c7",cir:"\u25cb",cirE:"\u29c3",circ:"\u02c6",circeq:"\u2257",cire:"\u2257",circlearrowleft:"\u21ba",olarr:"\u21ba",circlearrowright:"\u21bb",orarr:"\u21bb",circledS:"\u24c8",oS:"\u24c8",circledast:"\u229b",oast:"\u229b",circledcirc:"\u229a",ocir:"\u229a",circleddash:"\u229d",odash:"\u229d",cirfnint:"\u2a10",cirmid:"\u2aef",cirscir:"\u29c2",clubs:"\u2663",clubsuit:"\u2663",colon:":",comma:",",commat:"@",comp:"\u2201",complement:"\u2201",congdot:"\u2a6d",copf:"\ud835\udd54",copysr:"\u2117",crarr:"\u21b5",cross:"\u2717",cscr:"\ud835\udcb8",csub:"\u2acf",csube:"\u2ad1",csup:"\u2ad0",csupe:"\u2ad2",ctdot:"\u22ef",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22de",curlyeqprec:"\u22de",cuesc:"\u22df",curlyeqsucc:"\u22df",cularr:"\u21b6",curvearrowleft:"\u21b6",cularrp:"\u293d",cup:"\u222a",cupbrcap:"\u2a48",cupcap:"\u2a46",cupcup:"\u2a4a",cupdot:"\u228d",cupor:"\u2a45",cups:"\u222a\ufe00",curarr:"\u21b7",curvearrowright:"\u21b7",curarrm:"\u293c",curlyvee:"\u22ce",cuvee:"\u22ce",curlywedge:"\u22cf",cuwed:"\u22cf",curren:"\xa4",cwint:"\u2231",cylcty:"\u232d",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",dash:"\u2010",hyphen:"\u2010",dbkarow:"\u290f",rBarr:"\u290f",dcaron:"\u010f",dcy:"\u0434",ddarr:"\u21ca",downdownarrows:"\u21ca",ddotseq:"\u2a77",eDDot:"\u2a77",deg:"\xb0",delta:"\u03b4",demptyv:"\u29b1",dfisht:"\u297f",dfr:"\ud835\udd21",diamondsuit:"\u2666",diams:"\u2666",digamma:"\u03dd",gammad:"\u03dd",disin:"\u22f2",div:"\xf7",divide:"\xf7",divideontimes:"\u22c7",divonx:"\u22c7",djcy:"\u0452",dlcorn:"\u231e",llcorner:"\u231e",dlcrop:"\u230d",dollar:"$",dopf:"\ud835\udd55",doteqdot:"\u2251",eDot:"\u2251",dotminus:"\u2238",minusd:"\u2238",dotplus:"\u2214",plusdo:"\u2214",dotsquare:"\u22a1",sdotb:"\u22a1",drcorn:"\u231f",lrcorner:"\u231f",drcrop:"\u230c",dscr:"\ud835\udcb9",dscy:"\u0455",dsol:"\u29f6",dstrok:"\u0111",dtdot:"\u22f1",dtri:"\u25bf",triangledown:"\u25bf",dwangle:"\u29a6",dzcy:"\u045f",dzigrarr:"\u27ff",eacute:"\xe9",easter:"\u2a6e",ecaron:"\u011b",ecir:"\u2256",eqcirc:"\u2256",ecirc:"\xea",ecolon:"\u2255",eqcolon:"\u2255",ecy:"\u044d",edot:"\u0117",efDot:"\u2252",fallingdotseq:"\u2252",efr:"\ud835\udd22",eg:"\u2a9a",egrave:"\xe8",egs:"\u2a96",eqslantgtr:"\u2a96",egsdot:"\u2a98",el:"\u2a99",elinters:"\u23e7",ell:"\u2113",els:"\u2a95",eqslantless:"\u2a95",elsdot:"\u2a97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",varnothing:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014b",ensp:"\u2002",eogon:"\u0119",eopf:"\ud835\udd56",epar:"\u22d5",eparsl:"\u29e3",eplus:"\u2a71",epsi:"\u03b5",epsilon:"\u03b5",epsiv:"\u03f5",straightepsilon:"\u03f5",varepsilon:"\u03f5",equals:"=",equest:"\u225f",questeq:"\u225f",equivDD:"\u2a78",eqvparsl:"\u29e5",erDot:"\u2253",risingdotseq:"\u2253",erarr:"\u2971",escr:"\u212f",eta:"\u03b7",eth:"\xf0",euml:"\xeb",euro:"\u20ac",excl:"!",fcy:"\u0444",female:"\u2640",ffilig:"\ufb03",fflig:"\ufb00",ffllig:"\ufb04",ffr:"\ud835\udd23",filig:"\ufb01",fjlig:"fj",flat:"\u266d",fllig:"\ufb02",fltns:"\u25b1",fnof:"\u0192",fopf:"\ud835\udd57",fork:"\u22d4",pitchfork:"\u22d4",forkv:"\u2ad9",fpartint:"\u2a0d",frac12:"\xbd",half:"\xbd",frac13:"\u2153",frac14:"\xbc",frac15:"\u2155",frac16:"\u2159",frac18:"\u215b",frac23:"\u2154",frac25:"\u2156",frac34:"\xbe",frac35:"\u2157",frac38:"\u215c",frac45:"\u2158",frac56:"\u215a",frac58:"\u215d",frac78:"\u215e",frasl:"\u2044",frown:"\u2322",sfrown:"\u2322",fscr:"\ud835\udcbb",gEl:"\u2a8c",gtreqqless:"\u2a8c",gacute:"\u01f5",gamma:"\u03b3",gap:"\u2a86",gtrapprox:"\u2a86",gbreve:"\u011f",gcirc:"\u011d",gcy:"\u0433",gdot:"\u0121",gescc:"\u2aa9",gesdot:"\u2a80",gesdoto:"\u2a82",gesdotol:"\u2a84",gesl:"\u22db\ufe00",gesles:"\u2a94",gfr:"\ud835\udd24",gimel:"\u2137",gjcy:"\u0453",glE:"\u2a92",gla:"\u2aa5",glj:"\u2aa4",gnE:"\u2269",gneqq:"\u2269",gnap:"\u2a8a",gnapprox:"\u2a8a",gne:"\u2a88",gneq:"\u2a88",gnsim:"\u22e7",gopf:"\ud835\udd58",gscr:"\u210a",gsime:"\u2a8e",gsiml:"\u2a90",gtcc:"\u2aa7",gtcir:"\u2a7a",gtdot:"\u22d7",gtrdot:"\u22d7",gtlPar:"\u2995",gtquest:"\u2a7c",gtrarr:"\u2978",gvertneqq:"\u2269\ufe00",gvnE:"\u2269\ufe00",hardcy:"\u044a",harrcir:"\u2948",harrw:"\u21ad",leftrightsquigarrow:"\u21ad",hbar:"\u210f",hslash:"\u210f",planck:"\u210f",plankv:"\u210f",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",mldr:"\u2026",hercon:"\u22b9",hfr:"\ud835\udd25",hksearow:"\u2925",searhk:"\u2925",hkswarow:"\u2926",swarhk:"\u2926",hoarr:"\u21ff",homtht:"\u223b",hookleftarrow:"\u21a9",larrhk:"\u21a9",hookrightarrow:"\u21aa",rarrhk:"\u21aa",hopf:"\ud835\udd59",horbar:"\u2015",hscr:"\ud835\udcbd",hstrok:"\u0127",hybull:"\u2043",iacute:"\xed",icirc:"\xee",icy:"\u0438",iecy:"\u0435",iexcl:"\xa1",ifr:"\ud835\udd26",igrave:"\xec",iiiint:"\u2a0c",qint:"\u2a0c",iiint:"\u222d",tint:"\u222d",iinfin:"\u29dc",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012b",imath:"\u0131",inodot:"\u0131",imof:"\u22b7",imped:"\u01b5",incare:"\u2105",infin:"\u221e",infintie:"\u29dd",intcal:"\u22ba",intercal:"\u22ba",intlarhk:"\u2a17",intprod:"\u2a3c",iprod:"\u2a3c",iocy:"\u0451",iogon:"\u012f",iopf:"\ud835\udd5a",iota:"\u03b9",iquest:"\xbf",iscr:"\ud835\udcbe",isinE:"\u22f9",isindot:"\u22f5",isins:"\u22f4",isinsv:"\u22f3",itilde:"\u0129",iukcy:"\u0456",iuml:"\xef",jcirc:"\u0135",jcy:"\u0439",jfr:"\ud835\udd27",jmath:"\u0237",jopf:"\ud835\udd5b",jscr:"\ud835\udcbf",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03ba",kappav:"\u03f0",varkappa:"\u03f0",kcedil:"\u0137",kcy:"\u043a",kfr:"\ud835\udd28",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045c",kopf:"\ud835\udd5c",kscr:"\ud835\udcc0",lAtail:"\u291b",lBarr:"\u290e",lEg:"\u2a8b",lesseqqgtr:"\u2a8b",lHar:"\u2962",lacute:"\u013a",laemptyv:"\u29b4",lambda:"\u03bb",langd:"\u2991",lap:"\u2a85",lessapprox:"\u2a85",laquo:"\xab",larrbfs:"\u291f",larrfs:"\u291d",larrlp:"\u21ab",looparrowleft:"\u21ab",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21a2",leftarrowtail:"\u21a2",lat:"\u2aab",latail:"\u2919",late:"\u2aad",lates:"\u2aad\ufe00",lbarr:"\u290c",lbbrk:"\u2772",lbrace:"{",lcub:"{",lbrack:"[",lsqb:"[",lbrke:"\u298b",lbrksld:"\u298f",lbrkslu:"\u298d",lcaron:"\u013e",lcedil:"\u013c",lcy:"\u043b",ldca:"\u2936",ldrdhar:"\u2967",ldrushar:"\u294b",ldsh:"\u21b2",le:"\u2264",leq:"\u2264",leftleftarrows:"\u21c7",llarr:"\u21c7",leftthreetimes:"\u22cb",lthree:"\u22cb",lescc:"\u2aa8",lesdot:"\u2a7f",lesdoto:"\u2a81",lesdotor:"\u2a83",lesg:"\u22da\ufe00",lesges:"\u2a93",lessdot:"\u22d6",ltdot:"\u22d6",lfisht:"\u297c",lfr:"\ud835\udd29",lgE:"\u2a91",lharul:"\u296a",lhblk:"\u2584",ljcy:"\u0459",llhard:"\u296b",lltri:"\u25fa",lmidot:"\u0140",lmoust:"\u23b0",lmoustache:"\u23b0",lnE:"\u2268",lneqq:"\u2268",lnap:"\u2a89",lnapprox:"\u2a89",lne:"\u2a87",lneq:"\u2a87",lnsim:"\u22e6",loang:"\u27ec",loarr:"\u21fd",longmapsto:"\u27fc",xmap:"\u27fc",looparrowright:"\u21ac",rarrlp:"\u21ac",lopar:"\u2985",lopf:"\ud835\udd5d",loplus:"\u2a2d",lotimes:"\u2a34",lowast:"\u2217",loz:"\u25ca",lozenge:"\u25ca",lpar:"(",lparlt:"\u2993",lrhard:"\u296d",lrm:"\u200e",lrtri:"\u22bf",lsaquo:"\u2039",lscr:"\ud835\udcc1",lsime:"\u2a8d",lsimg:"\u2a8f",lsquor:"\u201a",sbquo:"\u201a",lstrok:"\u0142",ltcc:"\u2aa6",ltcir:"\u2a79",ltimes:"\u22c9",ltlarr:"\u2976",ltquest:"\u2a7b",ltrPar:"\u2996",ltri:"\u25c3",triangleleft:"\u25c3",lurdshar:"\u294a",luruhar:"\u2966",lvertneqq:"\u2268\ufe00",lvnE:"\u2268\ufe00",mDDot:"\u223a",macr:"\xaf",strns:"\xaf",male:"\u2642",malt:"\u2720",maltese:"\u2720",marker:"\u25ae",mcomma:"\u2a29",mcy:"\u043c",mdash:"\u2014",mfr:"\ud835\udd2a",mho:"\u2127",micro:"\xb5",midcir:"\u2af0",minus:"\u2212",minusdu:"\u2a2a",mlcp:"\u2adb",models:"\u22a7",mopf:"\ud835\udd5e",mscr:"\ud835\udcc2",mu:"\u03bc",multimap:"\u22b8",mumap:"\u22b8",nGg:"\u22d9\u0338",nGt:"\u226b\u20d2",nLeftarrow:"\u21cd",nlArr:"\u21cd",nLeftrightarrow:"\u21ce",nhArr:"\u21ce",nLl:"\u22d8\u0338",nLt:"\u226a\u20d2",nRightarrow:"\u21cf",nrArr:"\u21cf",nVDash:"\u22af",nVdash:"\u22ae",nacute:"\u0144",nang:"\u2220\u20d2",napE:"\u2a70\u0338",napid:"\u224b\u0338",napos:"\u0149",natur:"\u266e",natural:"\u266e",ncap:"\u2a43",ncaron:"\u0148",ncedil:"\u0146",ncongdot:"\u2a6d\u0338",ncup:"\u2a42",ncy:"\u043d",ndash:"\u2013",neArr:"\u21d7",nearhk:"\u2924",nedot:"\u2250\u0338",nesear:"\u2928",toea:"\u2928",nfr:"\ud835\udd2b",nharr:"\u21ae",nleftrightarrow:"\u21ae",nhpar:"\u2af2",nis:"\u22fc",nisd:"\u22fa",njcy:"\u045a",nlE:"\u2266\u0338",nleqq:"\u2266\u0338",nlarr:"\u219a",nleftarrow:"\u219a",nldr:"\u2025",nopf:"\ud835\udd5f",not:"\xac",notinE:"\u22f9\u0338",notindot:"\u22f5\u0338",notinvb:"\u22f7",notinvc:"\u22f6",notnivb:"\u22fe",notnivc:"\u22fd",nparsl:"\u2afd\u20e5",npart:"\u2202\u0338",npolint:"\u2a14",nrarr:"\u219b",nrightarrow:"\u219b",nrarrc:"\u2933\u0338",nrarrw:"\u219d\u0338",nscr:"\ud835\udcc3",nsub:"\u2284",nsubE:"\u2ac5\u0338",nsubseteqq:"\u2ac5\u0338",nsup:"\u2285",nsupE:"\u2ac6\u0338",nsupseteqq:"\u2ac6\u0338",ntilde:"\xf1",nu:"\u03bd",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22ad",nvHarr:"\u2904",nvap:"\u224d\u20d2",nvdash:"\u22ac",nvge:"\u2265\u20d2",nvgt:">\u20d2",nvinfin:"\u29de",nvlArr:"\u2902",nvle:"\u2264\u20d2",nvlt:"<\u20d2",nvltrie:"\u22b4\u20d2",nvrArr:"\u2903",nvrtrie:"\u22b5\u20d2",nvsim:"\u223c\u20d2",nwArr:"\u21d6",nwarhk:"\u2923",nwnear:"\u2927",oacute:"\xf3",ocirc:"\xf4",ocy:"\u043e",odblac:"\u0151",odiv:"\u2a38",odsold:"\u29bc",oelig:"\u0153",ofcir:"\u29bf",ofr:"\ud835\udd2c",ogon:"\u02db",ograve:"\xf2",ogt:"\u29c1",ohbar:"\u29b5",olcir:"\u29be",olcross:"\u29bb",olt:"\u29c0",omacr:"\u014d",omega:"\u03c9",omicron:"\u03bf",omid:"\u29b6",oopf:"\ud835\udd60",opar:"\u29b7",operp:"\u29b9",or:"\u2228",vee:"\u2228",ord:"\u2a5d",order:"\u2134",orderof:"\u2134",oscr:"\u2134",ordf:"\xaa",ordm:"\xba",origof:"\u22b6",oror:"\u2a56",orslope:"\u2a57",orv:"\u2a5b",oslash:"\xf8",osol:"\u2298",otilde:"\xf5",otimesas:"\u2a36",ouml:"\xf6",ovbar:"\u233d",para:"\xb6",parsim:"\u2af3",parsl:"\u2afd",pcy:"\u043f",percnt:"%",period:".",permil:"\u2030",pertenk:"\u2031",pfr:"\ud835\udd2d",phi:"\u03c6",phiv:"\u03d5",straightphi:"\u03d5",varphi:"\u03d5",phone:"\u260e",pi:"\u03c0",piv:"\u03d6",varpi:"\u03d6",planckh:"\u210e",plus:"+",plusacir:"\u2a23",pluscir:"\u2a22",plusdu:"\u2a25",pluse:"\u2a72",plussim:"\u2a26",plustwo:"\u2a27",pointint:"\u2a15",popf:"\ud835\udd61",pound:"\xa3",prE:"\u2ab3",prap:"\u2ab7",precapprox:"\u2ab7",precnapprox:"\u2ab9",prnap:"\u2ab9",precneqq:"\u2ab5",prnE:"\u2ab5",precnsim:"\u22e8",prnsim:"\u22e8",prime:"\u2032",profalar:"\u232e",profline:"\u2312",profsurf:"\u2313",prurel:"\u22b0",pscr:"\ud835\udcc5",psi:"\u03c8",puncsp:"\u2008",qfr:"\ud835\udd2e",qopf:"\ud835\udd62",qprime:"\u2057",qscr:"\ud835\udcc6",quatint:"\u2a16",quest:"?",rAtail:"\u291c",rHar:"\u2964",race:"\u223d\u0331",racute:"\u0155",raemptyv:"\u29b3",rangd:"\u2992",range:"\u29a5",raquo:"\xbb",rarrap:"\u2975",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291e",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21a3",rightarrowtail:"\u21a3",rarrw:"\u219d",rightsquigarrow:"\u219d",ratail:"\u291a",ratio:"\u2236",rbbrk:"\u2773",rbrace:"}",rcub:"}",rbrack:"]",rsqb:"]",rbrke:"\u298c",rbrksld:"\u298e",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdsh:"\u21b3",rect:"\u25ad",rfisht:"\u297d",rfr:"\ud835\udd2f",rharul:"\u296c",rho:"\u03c1",rhov:"\u03f1",varrho:"\u03f1",rightrightarrows:"\u21c9",rrarr:"\u21c9",rightthreetimes:"\u22cc",rthree:"\u22cc",ring:"\u02da",rlm:"\u200f",rmoust:"\u23b1",rmoustache:"\u23b1",rnmid:"\u2aee",roang:"\u27ed",roarr:"\u21fe",ropar:"\u2986",ropf:"\ud835\udd63",roplus:"\u2a2e",rotimes:"\u2a35",rpar:")",rpargt:"\u2994",rppolint:"\u2a12",rsaquo:"\u203a",rscr:"\ud835\udcc7",rtimes:"\u22ca",rtri:"\u25b9",triangleright:"\u25b9",rtriltri:"\u29ce",ruluhar:"\u2968",rx:"\u211e",sacute:"\u015b",scE:"\u2ab4",scap:"\u2ab8",succapprox:"\u2ab8",scaron:"\u0161",scedil:"\u015f",scirc:"\u015d",scnE:"\u2ab6",succneqq:"\u2ab6",scnap:"\u2aba",succnapprox:"\u2aba",scnsim:"\u22e9",succnsim:"\u22e9",scpolint:"\u2a13",scy:"\u0441",sdot:"\u22c5",sdote:"\u2a66",seArr:"\u21d8",sect:"\xa7",semi:";",seswar:"\u2929",tosa:"\u2929",sext:"\u2736",sfr:"\ud835\udd30",sharp:"\u266f",shchcy:"\u0449",shcy:"\u0448",shy:"\xad",sigma:"\u03c3",sigmaf:"\u03c2",sigmav:"\u03c2",varsigma:"\u03c2",simdot:"\u2a6a",simg:"\u2a9e",simgE:"\u2aa0",siml:"\u2a9d",simlE:"\u2a9f",simne:"\u2246",simplus:"\u2a24",simrarr:"\u2972",smashp:"\u2a33",smeparsl:"\u29e4",smile:"\u2323",ssmile:"\u2323",smt:"\u2aaa",smte:"\u2aac",smtes:"\u2aac\ufe00",softcy:"\u044c",sol:"/",solb:"\u29c4",solbar:"\u233f",sopf:"\ud835\udd64",spades:"\u2660",spadesuit:"\u2660",sqcaps:"\u2293\ufe00",sqcups:"\u2294\ufe00",sscr:"\ud835\udcc8",star:"\u2606",sub:"\u2282",subset:"\u2282",subE:"\u2ac5",subseteqq:"\u2ac5",subdot:"\u2abd",subedot:"\u2ac3",submult:"\u2ac1",subnE:"\u2acb",subsetneqq:"\u2acb",subne:"\u228a",subsetneq:"\u228a",subplus:"\u2abf",subrarr:"\u2979",subsim:"\u2ac7",subsub:"\u2ad5",subsup:"\u2ad3",sung:"\u266a",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",supE:"\u2ac6",supseteqq:"\u2ac6",supdot:"\u2abe",supdsub:"\u2ad8",supedot:"\u2ac4",suphsol:"\u27c9",suphsub:"\u2ad7",suplarr:"\u297b",supmult:"\u2ac2",supnE:"\u2acc",supsetneqq:"\u2acc",supne:"\u228b",supsetneq:"\u228b",supplus:"\u2ac0",supsim:"\u2ac8",supsub:"\u2ad4",supsup:"\u2ad6",swArr:"\u21d9",swnwar:"\u292a",szlig:"\xdf",target:"\u2316",tau:"\u03c4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",telrec:"\u2315",tfr:"\ud835\udd31",theta:"\u03b8",thetasym:"\u03d1",thetav:"\u03d1",vartheta:"\u03d1",thorn:"\xfe",times:"\xd7",timesbar:"\u2a31",timesd:"\u2a30",topbot:"\u2336",topcir:"\u2af1",topf:"\ud835\udd65",topfork:"\u2ada",tprime:"\u2034",triangle:"\u25b5",utri:"\u25b5",triangleq:"\u225c",trie:"\u225c",tridot:"\u25ec",triminus:"\u2a3a",triplus:"\u2a39",trisb:"\u29cd",tritime:"\u2a3b",trpezium:"\u23e2",tscr:"\ud835\udcc9",tscy:"\u0446",tshcy:"\u045b",tstrok:"\u0167",uHar:"\u2963",uacute:"\xfa",ubrcy:"\u045e",ubreve:"\u016d",ucirc:"\xfb",ucy:"\u0443",udblac:"\u0171",ufisht:"\u297e",ufr:"\ud835\udd32",ugrave:"\xf9",uhblk:"\u2580",ulcorn:"\u231c",ulcorner:"\u231c",ulcrop:"\u230f",ultri:"\u25f8",umacr:"\u016b",uogon:"\u0173",uopf:"\ud835\udd66",upsi:"\u03c5",upsilon:"\u03c5",upuparrows:"\u21c8",uuarr:"\u21c8",urcorn:"\u231d",urcorner:"\u231d",urcrop:"\u230e",uring:"\u016f",urtri:"\u25f9",uscr:"\ud835\udcca",utdot:"\u22f0",utilde:"\u0169",uuml:"\xfc",uwangle:"\u29a7",vBar:"\u2ae8",vBarv:"\u2ae9",vangrt:"\u299c",varsubsetneq:"\u228a\ufe00",vsubne:"\u228a\ufe00",varsubsetneqq:"\u2acb\ufe00",vsubnE:"\u2acb\ufe00",varsupsetneq:"\u228b\ufe00",vsupne:"\u228b\ufe00",varsupsetneqq:"\u2acc\ufe00",vsupnE:"\u2acc\ufe00",vcy:"\u0432",veebar:"\u22bb",veeeq:"\u225a",vellip:"\u22ee",vfr:"\ud835\udd33",vopf:"\ud835\udd67",vscr:"\ud835\udccb",vzigzag:"\u299a",wcirc:"\u0175",wedbar:"\u2a5f",wedgeq:"\u2259",weierp:"\u2118",wp:"\u2118",wfr:"\ud835\udd34",wopf:"\ud835\udd68",wscr:"\ud835\udccc",xfr:"\ud835\udd35",xi:"\u03be",xnis:"\u22fb",xopf:"\ud835\udd69",xscr:"\ud835\udccd",yacute:"\xfd",yacy:"\u044f",ycirc:"\u0177",ycy:"\u044b",yen:"\xa5",yfr:"\ud835\udd36",yicy:"\u0457",yopf:"\ud835\udd6a",yscr:"\ud835\udcce",yucy:"\u044e",yuml:"\xff",zacute:"\u017a",zcaron:"\u017e",zcy:"\u0437",zdot:"\u017c",zeta:"\u03b6",zfr:"\ud835\udd37",zhcy:"\u0436",zigrarr:"\u21dd",zopf:"\ud835\udd6b",zscr:"\ud835\udccf",zwj:"\u200d",zwnj:"\u200c"};const NGSP_UNICODE="\ue500";NAMED_ENTITIES["ngsp"]=NGSP_UNICODE;class TokenError extends ParseError{constructor(errorMsg,tokenType,span){super(span,errorMsg);this.tokenType=tokenType}}class TokenizeResult{constructor(tokens,errors,nonNormalizedIcuExpressions){this.tokens=tokens;this.errors=errors;this.nonNormalizedIcuExpressions=nonNormalizedIcuExpressions}}function tokenize(source,url,getTagDefinition,options={}){const tokenizer=new _Tokenizer(new ParseSourceFile(source,url),getTagDefinition,options);tokenizer.tokenize();return new TokenizeResult(mergeTextTokens(tokenizer.tokens),tokenizer.errors,tokenizer.nonNormalizedIcuExpressions)}const _CR_OR_CRLF_REGEXP=/\r\n?/g;function _unexpectedCharacterErrorMsg(charCode){const char=charCode===$EOF?"EOF":String.fromCharCode(charCode);return`Unexpected character "${char}"`}function _unknownEntityErrorMsg(entitySrc){return`Unknown entity "${entitySrc}" - use the "&#<decimal>;" or "&#x<hex>;" syntax`}function _unparsableEntityErrorMsg(type,entityStr){return`Unable to parse entity "${entityStr}" - ${type} character reference entities must end with ";"`}var CharacterReferenceType;(function(CharacterReferenceType){CharacterReferenceType["HEX"]="hexadecimal";CharacterReferenceType["DEC"]="decimal"})(CharacterReferenceType||(CharacterReferenceType={}));class _ControlFlowError{constructor(error){this.error=error}}class _Tokenizer{constructor(_file,_getTagDefinition,options){this._getTagDefinition=_getTagDefinition;this._currentTokenStart=null;this._currentTokenType=null;this._expansionCaseStack=[];this._inInterpolation=false;this.tokens=[];this.errors=[];this.nonNormalizedIcuExpressions=[];this._tokenizeIcu=options.tokenizeExpansionForms||false;this._interpolationConfig=options.interpolationConfig||DEFAULT_INTERPOLATION_CONFIG;this._leadingTriviaCodePoints=options.leadingTriviaChars&&options.leadingTriviaChars.map((c=>c.codePointAt(0)||0));const range=options.range||{endPos:_file.content.length,startPos:0,startLine:0,startCol:0};this._cursor=options.escapedString?new EscapedCharacterCursor(_file,range):new PlainCharacterCursor(_file,range);this._preserveLineEndings=options.preserveLineEndings||false;this._i18nNormalizeLineEndingsInICUs=options.i18nNormalizeLineEndingsInICUs||false;this._tokenizeBlocks=options.tokenizeBlocks??true;try{this._cursor.init()}catch(e){this.handleError(e)}}_processCarriageReturns(content){if(this._preserveLineEndings){return content}return content.replace(_CR_OR_CRLF_REGEXP,"\n")}tokenize(){while(this._cursor.peek()!==$EOF){const start=this._cursor.clone();try{if(this._attemptCharCode($LT)){if(this._attemptCharCode($BANG)){if(this._attemptCharCode($LBRACKET)){this._consumeCdata(start)}else if(this._attemptCharCode($MINUS)){this._consumeComment(start)}else{this._consumeDocType(start)}}else if(this._attemptCharCode($SLASH)){this._consumeTagClose(start)}else{this._consumeTagOpen(start)}}else if(this._tokenizeBlocks&&this._attemptCharCode($AT)){this._consumeBlockStart(start)}else if(this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansionCase()&&!this._isInExpansionForm()&&this._attemptCharCode($RBRACE)){this._consumeBlockEnd(start)}else if(!(this._tokenizeIcu&&this._tokenizeExpansionForm())){this._consumeWithInterpolation(5,8,(()=>this._isTextEnd()),(()=>this._isTagStart()))}}catch(e){this.handleError(e)}}this._beginToken(29);this._endToken([])}_getBlockName(){let spacesInNameAllowed=false;const nameCursor=this._cursor.clone();this._attemptCharCodeUntilFn((code=>{if(isWhitespace(code)){return!spacesInNameAllowed}if(isBlockNameChar(code)){spacesInNameAllowed=true;return false}return true}));return this._cursor.getChars(nameCursor).trim()}_consumeBlockStart(start){this._beginToken(24,start);const startToken=this._endToken([this._getBlockName()]);if(this._cursor.peek()===$LPAREN){this._cursor.advance();this._consumeBlockParameters();this._attemptCharCodeUntilFn(isNotWhitespace);if(this._attemptCharCode($RPAREN)){this._attemptCharCodeUntilFn(isNotWhitespace)}else{startToken.type=28;return}}if(this._attemptCharCode($LBRACE)){this._beginToken(25);this._endToken([])}else{startToken.type=28}}_consumeBlockEnd(start){this._beginToken(26,start);this._endToken([])}_consumeBlockParameters(){this._attemptCharCodeUntilFn(isBlockParameterChar);while(this._cursor.peek()!==$RPAREN&&this._cursor.peek()!==$EOF){this._beginToken(27);const start=this._cursor.clone();let inQuote=null;let openParens=0;while(this._cursor.peek()!==$SEMICOLON&&this._cursor.peek()!==$EOF||inQuote!==null){const char=this._cursor.peek();if(char===$BACKSLASH){this._cursor.advance()}else if(char===inQuote){inQuote=null}else if(inQuote===null&&isQuote(char)){inQuote=char}else if(char===$LPAREN&&inQuote===null){openParens++}else if(char===$RPAREN&&inQuote===null){if(openParens===0){break}else if(openParens>0){openParens--}}this._cursor.advance()}this._endToken([this._cursor.getChars(start)]);this._attemptCharCodeUntilFn(isBlockParameterChar)}}_tokenizeExpansionForm(){if(this.isExpansionFormStart()){this._consumeExpansionFormStart();return true}if(isExpansionCaseStart(this._cursor.peek())&&this._isInExpansionForm()){this._consumeExpansionCaseStart();return true}if(this._cursor.peek()===$RBRACE){if(this._isInExpansionCase()){this._consumeExpansionCaseEnd();return true}if(this._isInExpansionForm()){this._consumeExpansionFormEnd();return true}}return false}_beginToken(type,start=this._cursor.clone()){this._currentTokenStart=start;this._currentTokenType=type}_endToken(parts,end){if(this._currentTokenStart===null){throw new TokenError("Programming error - attempted to end a token when there was no start to the token",this._currentTokenType,this._cursor.getSpan(end))}if(this._currentTokenType===null){throw new TokenError("Programming error - attempted to end a token which has no token type",null,this._cursor.getSpan(this._currentTokenStart))}const token={type:this._currentTokenType,parts:parts,sourceSpan:(end??this._cursor).getSpan(this._currentTokenStart,this._leadingTriviaCodePoints)};this.tokens.push(token);this._currentTokenStart=null;this._currentTokenType=null;return token}_createError(msg,span){if(this._isInExpansionForm()){msg+=` (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.)`}const error=new TokenError(msg,this._currentTokenType,span);this._currentTokenStart=null;this._currentTokenType=null;return new _ControlFlowError(error)}handleError(e){if(e instanceof CursorError){e=this._createError(e.msg,this._cursor.getSpan(e.cursor))}if(e instanceof _ControlFlowError){this.errors.push(e.error)}else{throw e}}_attemptCharCode(charCode){if(this._cursor.peek()===charCode){this._cursor.advance();return true}return false}_attemptCharCodeCaseInsensitive(charCode){if(compareCharCodeCaseInsensitive(this._cursor.peek(),charCode)){this._cursor.advance();return true}return false}_requireCharCode(charCode){const location=this._cursor.clone();if(!this._attemptCharCode(charCode)){throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()),this._cursor.getSpan(location))}}_attemptStr(chars){const len=chars.length;if(this._cursor.charsLeft()<len){return false}const initialPosition=this._cursor.clone();for(let i=0;i<len;i++){if(!this._attemptCharCode(chars.charCodeAt(i))){this._cursor=initialPosition;return false}}return true}_attemptStrCaseInsensitive(chars){for(let i=0;i<chars.length;i++){if(!this._attemptCharCodeCaseInsensitive(chars.charCodeAt(i))){return false}}return true}_requireStr(chars){const location=this._cursor.clone();if(!this._attemptStr(chars)){throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()),this._cursor.getSpan(location))}}_attemptCharCodeUntilFn(predicate){while(!predicate(this._cursor.peek())){this._cursor.advance()}}_requireCharCodeUntilFn(predicate,len){const start=this._cursor.clone();this._attemptCharCodeUntilFn(predicate);if(this._cursor.diff(start)<len){throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()),this._cursor.getSpan(start))}}_attemptUntilChar(char){while(this._cursor.peek()!==char){this._cursor.advance()}}_readChar(){const char=String.fromCodePoint(this._cursor.peek());this._cursor.advance();return char}_consumeEntity(textTokenType){this._beginToken(9);const start=this._cursor.clone();this._cursor.advance();if(this._attemptCharCode($HASH)){const isHex=this._attemptCharCode($x)||this._attemptCharCode($X);const codeStart=this._cursor.clone();this._attemptCharCodeUntilFn(isDigitEntityEnd);if(this._cursor.peek()!=$SEMICOLON){this._cursor.advance();const entityType=isHex?CharacterReferenceType.HEX:CharacterReferenceType.DEC;throw this._createError(_unparsableEntityErrorMsg(entityType,this._cursor.getChars(start)),this._cursor.getSpan())}const strNum=this._cursor.getChars(codeStart);this._cursor.advance();try{const charCode=parseInt(strNum,isHex?16:10);this._endToken([String.fromCharCode(charCode),this._cursor.getChars(start)])}catch{throw this._createError(_unknownEntityErrorMsg(this._cursor.getChars(start)),this._cursor.getSpan())}}else{const nameStart=this._cursor.clone();this._attemptCharCodeUntilFn(isNamedEntityEnd);if(this._cursor.peek()!=$SEMICOLON){this._beginToken(textTokenType,start);this._cursor=nameStart;this._endToken(["&"])}else{const name=this._cursor.getChars(nameStart);this._cursor.advance();const char=NAMED_ENTITIES[name];if(!char){throw this._createError(_unknownEntityErrorMsg(name),this._cursor.getSpan(start))}this._endToken([char,`&${name};`])}}}_consumeRawText(consumeEntities,endMarkerPredicate){this._beginToken(consumeEntities?6:7);const parts=[];while(true){const tagCloseStart=this._cursor.clone();const foundEndMarker=endMarkerPredicate();this._cursor=tagCloseStart;if(foundEndMarker){break}if(consumeEntities&&this._cursor.peek()===$AMPERSAND){this._endToken([this._processCarriageReturns(parts.join(""))]);parts.length=0;this._consumeEntity(6);this._beginToken(6)}else{parts.push(this._readChar())}}this._endToken([this._processCarriageReturns(parts.join(""))])}_consumeComment(start){this._beginToken(10,start);this._requireCharCode($MINUS);this._endToken([]);this._consumeRawText(false,(()=>this._attemptStr("--\x3e")));this._beginToken(11);this._requireStr("--\x3e");this._endToken([])}_consumeCdata(start){this._beginToken(12,start);this._requireStr("CDATA[");this._endToken([]);this._consumeRawText(false,(()=>this._attemptStr("]]>")));this._beginToken(13);this._requireStr("]]>");this._endToken([])}_consumeDocType(start){this._beginToken(18,start);const contentStart=this._cursor.clone();this._attemptUntilChar($GT);const content=this._cursor.getChars(contentStart);this._cursor.advance();this._endToken([content])}_consumePrefixAndName(){const nameOrPrefixStart=this._cursor.clone();let prefix="";while(this._cursor.peek()!==$COLON&&!isPrefixEnd(this._cursor.peek())){this._cursor.advance()}let nameStart;if(this._cursor.peek()===$COLON){prefix=this._cursor.getChars(nameOrPrefixStart);this._cursor.advance();nameStart=this._cursor.clone()}else{nameStart=nameOrPrefixStart}this._requireCharCodeUntilFn(isNameEnd,prefix===""?0:1);const name=this._cursor.getChars(nameStart);return[prefix,name]}_consumeTagOpen(start){let tagName;let prefix;let openTagToken;try{if(!isAsciiLetter(this._cursor.peek())){throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()),this._cursor.getSpan(start))}openTagToken=this._consumeTagOpenStart(start);prefix=openTagToken.parts[0];tagName=openTagToken.parts[1];this._attemptCharCodeUntilFn(isNotWhitespace);while(this._cursor.peek()!==$SLASH&&this._cursor.peek()!==$GT&&this._cursor.peek()!==$LT&&this._cursor.peek()!==$EOF){this._consumeAttributeName();this._attemptCharCodeUntilFn(isNotWhitespace);if(this._attemptCharCode($EQ)){this._attemptCharCodeUntilFn(isNotWhitespace);this._consumeAttributeValue()}this._attemptCharCodeUntilFn(isNotWhitespace)}this._consumeTagOpenEnd()}catch(e){if(e instanceof _ControlFlowError){if(openTagToken){openTagToken.type=4}else{this._beginToken(5,start);this._endToken(["<"])}return}throw e}const contentTokenType=this._getTagDefinition(tagName).getContentType(prefix);if(contentTokenType===exports.TagContentType.RAW_TEXT){this._consumeRawTextWithTagClose(prefix,tagName,false)}else if(contentTokenType===exports.TagContentType.ESCAPABLE_RAW_TEXT){this._consumeRawTextWithTagClose(prefix,tagName,true)}}_consumeRawTextWithTagClose(prefix,tagName,consumeEntities){this._consumeRawText(consumeEntities,(()=>{if(!this._attemptCharCode($LT))return false;if(!this._attemptCharCode($SLASH))return false;this._attemptCharCodeUntilFn(isNotWhitespace);if(!this._attemptStrCaseInsensitive(tagName))return false;this._attemptCharCodeUntilFn(isNotWhitespace);return this._attemptCharCode($GT)}));this._beginToken(3);this._requireCharCodeUntilFn((code=>code===$GT),3);this._cursor.advance();this._endToken([prefix,tagName])}_consumeTagOpenStart(start){this._beginToken(0,start);const parts=this._consumePrefixAndName();return this._endToken(parts)}_consumeAttributeName(){const attrNameStart=this._cursor.peek();if(attrNameStart===$SQ||attrNameStart===$DQ){throw this._createError(_unexpectedCharacterErrorMsg(attrNameStart),this._cursor.getSpan())}this._beginToken(14);const prefixAndName=this._consumePrefixAndName();this._endToken(prefixAndName)}_consumeAttributeValue(){if(this._cursor.peek()===$SQ||this._cursor.peek()===$DQ){const quoteChar=this._cursor.peek();this._consumeQuote(quoteChar);const endPredicate=()=>this._cursor.peek()===quoteChar;this._consumeWithInterpolation(16,17,endPredicate,endPredicate);this._consumeQuote(quoteChar)}else{const endPredicate=()=>isNameEnd(this._cursor.peek());this._consumeWithInterpolation(16,17,endPredicate,endPredicate)}}_consumeQuote(quoteChar){this._beginToken(15);this._requireCharCode(quoteChar);this._endToken([String.fromCodePoint(quoteChar)])}_consumeTagOpenEnd(){const tokenType=this._attemptCharCode($SLASH)?2:1;this._beginToken(tokenType);this._requireCharCode($GT);this._endToken([])}_consumeTagClose(start){this._beginToken(3,start);this._attemptCharCodeUntilFn(isNotWhitespace);const prefixAndName=this._consumePrefixAndName();this._attemptCharCodeUntilFn(isNotWhitespace);this._requireCharCode($GT);this._endToken(prefixAndName)}_consumeExpansionFormStart(){this._beginToken(19);this._requireCharCode($LBRACE);this._endToken([]);this._expansionCaseStack.push(19);this._beginToken(7);const condition=this._readUntil($COMMA);const normalizedCondition=this._processCarriageReturns(condition);if(this._i18nNormalizeLineEndingsInICUs){this._endToken([normalizedCondition])}else{const conditionToken=this._endToken([condition]);if(normalizedCondition!==condition){this.nonNormalizedIcuExpressions.push(conditionToken)}}this._requireCharCode($COMMA);this._attemptCharCodeUntilFn(isNotWhitespace);this._beginToken(7);const type=this._readUntil($COMMA);this._endToken([type]);this._requireCharCode($COMMA);this._attemptCharCodeUntilFn(isNotWhitespace)}_consumeExpansionCaseStart(){this._beginToken(20);const value=this._readUntil($LBRACE).trim();this._endToken([value]);this._attemptCharCodeUntilFn(isNotWhitespace);this._beginToken(21);this._requireCharCode($LBRACE);this._endToken([]);this._attemptCharCodeUntilFn(isNotWhitespace);this._expansionCaseStack.push(21)}_consumeExpansionCaseEnd(){this._beginToken(22);this._requireCharCode($RBRACE);this._endToken([]);this._attemptCharCodeUntilFn(isNotWhitespace);this._expansionCaseStack.pop()}_consumeExpansionFormEnd(){this._beginToken(23);this._requireCharCode($RBRACE);this._endToken([]);this._expansionCaseStack.pop()}_consumeWithInterpolation(textTokenType,interpolationTokenType,endPredicate,endInterpolation){this._beginToken(textTokenType);const parts=[];while(!endPredicate()){const current=this._cursor.clone();if(this._interpolationConfig&&this._attemptStr(this._interpolationConfig.start)){this._endToken([this._processCarriageReturns(parts.join(""))],current);parts.length=0;this._consumeInterpolation(interpolationTokenType,current,endInterpolation);this._beginToken(textTokenType)}else if(this._cursor.peek()===$AMPERSAND){this._endToken([this._processCarriageReturns(parts.join(""))]);parts.length=0;this._consumeEntity(textTokenType);this._beginToken(textTokenType)}else{parts.push(this._readChar())}}this._inInterpolation=false;this._endToken([this._processCarriageReturns(parts.join(""))])}_consumeInterpolation(interpolationTokenType,interpolationStart,prematureEndPredicate){const parts=[];this._beginToken(interpolationTokenType,interpolationStart);parts.push(this._interpolationConfig.start);const expressionStart=this._cursor.clone();let inQuote=null;let inComment=false;while(this._cursor.peek()!==$EOF&&(prematureEndPredicate===null||!prematureEndPredicate())){const current=this._cursor.clone();if(this._isTagStart()){this._cursor=current;parts.push(this._getProcessedChars(expressionStart,current));this._endToken(parts);return}if(inQuote===null){if(this._attemptStr(this._interpolationConfig.end)){parts.push(this._getProcessedChars(expressionStart,current));parts.push(this._interpolationConfig.end);this._endToken(parts);return}else if(this._attemptStr("//")){inComment=true}}const char=this._cursor.peek();this._cursor.advance();if(char===$BACKSLASH){this._cursor.advance()}else if(char===inQuote){inQuote=null}else if(!inComment&&inQuote===null&&isQuote(char)){inQuote=char}}parts.push(this._getProcessedChars(expressionStart,this._cursor));this._endToken(parts)}_getProcessedChars(start,end){return this._processCarriageReturns(end.getChars(start))}_isTextEnd(){if(this._isTagStart()||this._cursor.peek()===$EOF){return true}if(this._tokenizeIcu&&!this._inInterpolation){if(this.isExpansionFormStart()){return true}if(this._cursor.peek()===$RBRACE&&this._isInExpansionCase()){return true}}if(this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansion()&&(this._cursor.peek()===$AT||this._cursor.peek()===$RBRACE)){return true}return false}_isTagStart(){if(this._cursor.peek()===$LT){const tmp=this._cursor.clone();tmp.advance();const code=tmp.peek();if($a<=code&&code<=$z||$A<=code&&code<=$Z||code===$SLASH||code===$BANG){return true}}return false}_readUntil(char){const start=this._cursor.clone();this._attemptUntilChar(char);return this._cursor.getChars(start)}_isInExpansion(){return this._isInExpansionCase()||this._isInExpansionForm()}_isInExpansionCase(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===21}_isInExpansionForm(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===19}isExpansionFormStart(){if(this._cursor.peek()!==$LBRACE){return false}if(this._interpolationConfig){const start=this._cursor.clone();const isInterpolation=this._attemptStr(this._interpolationConfig.start);this._cursor=start;return!isInterpolation}return true}}function isNotWhitespace(code){return!isWhitespace(code)||code===$EOF}function isNameEnd(code){return isWhitespace(code)||code===$GT||code===$LT||code===$SLASH||code===$SQ||code===$DQ||code===$EQ||code===$EOF}function isPrefixEnd(code){return(code<$a||$z<code)&&(code<$A||$Z<code)&&(code<$0||code>$9)}function isDigitEntityEnd(code){return code===$SEMICOLON||code===$EOF||!isAsciiHexDigit(code)}function isNamedEntityEnd(code){return code===$SEMICOLON||code===$EOF||!isAsciiLetter(code)}function isExpansionCaseStart(peek){return peek!==$RBRACE}function compareCharCodeCaseInsensitive(code1,code2){return toUpperCaseCharCode(code1)===toUpperCaseCharCode(code2)}function toUpperCaseCharCode(code){return code>=$a&&code<=$z?code-$a+$A:code}function isBlockNameChar(code){return isAsciiLetter(code)||isDigit(code)||code===$_}function isBlockParameterChar(code){return code!==$SEMICOLON&&isNotWhitespace(code)}function mergeTextTokens(srcTokens){const dstTokens=[];let lastDstToken=undefined;for(let i=0;i<srcTokens.length;i++){const token=srcTokens[i];if(lastDstToken&&lastDstToken.type===5&&token.type===5||lastDstToken&&lastDstToken.type===16&&token.type===16){lastDstToken.parts[0]+=token.parts[0];lastDstToken.sourceSpan.end=token.sourceSpan.end}else{lastDstToken=token;dstTokens.push(lastDstToken)}}return dstTokens}class PlainCharacterCursor{constructor(fileOrCursor,range){if(fileOrCursor instanceof PlainCharacterCursor){this.file=fileOrCursor.file;this.input=fileOrCursor.input;this.end=fileOrCursor.end;const state=fileOrCursor.state;this.state={peek:state.peek,offset:state.offset,line:state.line,column:state.column}}else{if(!range){throw new Error("Programming error: the range argument must be provided with a file argument.")}this.file=fileOrCursor;this.input=fileOrCursor.content;this.end=range.endPos;this.state={peek:-1,offset:range.startPos,line:range.startLine,column:range.startCol}}}clone(){return new PlainCharacterCursor(this)}peek(){return this.state.peek}charsLeft(){return this.end-this.state.offset}diff(other){return this.state.offset-other.state.offset}advance(){this.advanceState(this.state)}init(){this.updatePeek(this.state)}getSpan(start,leadingTriviaCodePoints){start=start||this;let fullStart=start;if(leadingTriviaCodePoints){while(this.diff(start)>0&&leadingTriviaCodePoints.indexOf(start.peek())!==-1){if(fullStart===start){start=start.clone()}start.advance()}}const startLocation=this.locationFromCursor(start);const endLocation=this.locationFromCursor(this);const fullStartLocation=fullStart!==start?this.locationFromCursor(fullStart):startLocation;return new ParseSourceSpan(startLocation,endLocation,fullStartLocation)}getChars(start){return this.input.substring(start.state.offset,this.state.offset)}charAt(pos){return this.input.charCodeAt(pos)}advanceState(state){if(state.offset>=this.end){this.state=state;throw new CursorError('Unexpected character "EOF"',this)}const currentChar=this.charAt(state.offset);if(currentChar===$LF){state.line++;state.column=0}else if(!isNewLine(currentChar)){state.column++}state.offset++;this.updatePeek(state)}updatePeek(state){state.peek=state.offset>=this.end?$EOF:this.charAt(state.offset)}locationFromCursor(cursor){return new ParseLocation(cursor.file,cursor.state.offset,cursor.state.line,cursor.state.column)}}class EscapedCharacterCursor extends PlainCharacterCursor{constructor(fileOrCursor,range){if(fileOrCursor instanceof EscapedCharacterCursor){super(fileOrCursor);this.internalState={...fileOrCursor.internalState}}else{super(fileOrCursor,range);this.internalState=this.state}}advance(){this.state=this.internalState;super.advance();this.processEscapeSequence()}init(){super.init();this.processEscapeSequence()}clone(){return new EscapedCharacterCursor(this)}getChars(start){const cursor=start.clone();let chars="";while(cursor.internalState.offset<this.internalState.offset){chars+=String.fromCodePoint(cursor.peek());cursor.advance()}return chars}processEscapeSequence(){const peek=()=>this.internalState.peek;if(peek()===$BACKSLASH){this.internalState={...this.state};this.advanceState(this.internalState);if(peek()===$n){this.state.peek=$LF}else if(peek()===$r){this.state.peek=$CR}else if(peek()===$v){this.state.peek=$VTAB}else if(peek()===$t){this.state.peek=$TAB}else if(peek()===$b){this.state.peek=$BSPACE}else if(peek()===$f){this.state.peek=$FF}else if(peek()===$u){this.advanceState(this.internalState);if(peek()===$LBRACE){this.advanceState(this.internalState);const digitStart=this.clone();let length=0;while(peek()!==$RBRACE){this.advanceState(this.internalState);length++}this.state.peek=this.decodeHexDigits(digitStart,length)}else{const digitStart=this.clone();this.advanceState(this.internalState);this.advanceState(this.internalState);this.advanceState(this.internalState);this.state.peek=this.decodeHexDigits(digitStart,4)}}else if(peek()===$x){this.advanceState(this.internalState);const digitStart=this.clone();this.advanceState(this.internalState);this.state.peek=this.decodeHexDigits(digitStart,2)}else if(isOctalDigit(peek())){let octal="";let length=0;let previous=this.clone();while(isOctalDigit(peek())&&length<3){previous=this.clone();octal+=String.fromCodePoint(peek());this.advanceState(this.internalState);length++}this.state.peek=parseInt(octal,8);this.internalState=previous.internalState}else if(isNewLine(this.internalState.peek)){this.advanceState(this.internalState);this.state=this.internalState}else{this.state.peek=this.internalState.peek}}}decodeHexDigits(start,length){const hex=this.input.slice(start.internalState.offset,start.internalState.offset+length);const charCode=parseInt(hex,16);if(!isNaN(charCode)){return charCode}else{start.state=start.internalState;throw new CursorError("Invalid hexadecimal escape sequence",start)}}}class CursorError{constructor(msg,cursor){this.msg=msg;this.cursor=cursor}}class TreeError extends ParseError{static create(elementName,span,msg){return new TreeError(elementName,span,msg)}constructor(elementName,span,msg){super(span,msg);this.elementName=elementName}}class ParseTreeResult{constructor(rootNodes,errors){this.rootNodes=rootNodes;this.errors=errors}}class Parser{constructor(getTagDefinition){this.getTagDefinition=getTagDefinition}parse(source,url,options){const tokenizeResult=tokenize(source,url,this.getTagDefinition,options);const parser=new _TreeBuilder(tokenizeResult.tokens,this.getTagDefinition);parser.build();return new ParseTreeResult(parser.rootNodes,tokenizeResult.errors.concat(parser.errors))}}class _TreeBuilder{constructor(tokens,getTagDefinition){this.tokens=tokens;this.getTagDefinition=getTagDefinition;this._index=-1;this._containerStack=[];this.rootNodes=[];this.errors=[];this._advance()}build(){while(this._peek.type!==29){if(this._peek.type===0||this._peek.type===4){this._consumeStartTag(this._advance())}else if(this._peek.type===3){this._consumeEndTag(this._advance())}else if(this._peek.type===12){this._closeVoidElement();this._consumeCdata(this._advance())}else if(this._peek.type===10){this._closeVoidElement();this._consumeComment(this._advance())}else if(this._peek.type===5||this._peek.type===7||this._peek.type===6){this._closeVoidElement();this._consumeText(this._advance())}else if(this._peek.type===19){this._consumeExpansion(this._advance())}else if(this._peek.type===24){this._closeVoidElement();this._consumeBlockOpen(this._advance())}else if(this._peek.type===26){this._closeVoidElement();this._consumeBlockClose(this._advance())}else if(this._peek.type===28){this._closeVoidElement();this._consumeIncompleteBlock(this._advance())}else{this._advance()}}for(const leftoverContainer of this._containerStack){if(leftoverContainer instanceof Block){this.errors.push(TreeError.create(leftoverContainer.name,leftoverContainer.sourceSpan,`Unclosed block "${leftoverContainer.name}"`))}}}_advance(){const prev=this._peek;if(this._index<this.tokens.length-1){this._index++}this._peek=this.tokens[this._index];return prev}_advanceIf(type){if(this._peek.type===type){return this._advance()}return null}_consumeCdata(_startToken){this._consumeText(this._advance());this._advanceIf(13)}_consumeComment(token){const text=this._advanceIf(7);const endToken=this._advanceIf(11);const value=text!=null?text.parts[0].trim():null;const sourceSpan=endToken==null?token.sourceSpan:new ParseSourceSpan(token.sourceSpan.start,endToken.sourceSpan.end,token.sourceSpan.fullStart);this._addToParent(new Comment(value,sourceSpan))}_consumeExpansion(token){const switchValue=this._advance();const type=this._advance();const cases=[];while(this._peek.type===20){const expCase=this._parseExpansionCase();if(!expCase)return;cases.push(expCase)}if(this._peek.type!==23){this.errors.push(TreeError.create(null,this._peek.sourceSpan,`Invalid ICU message. Missing '}'.`));return}const sourceSpan=new ParseSourceSpan(token.sourceSpan.start,this._peek.sourceSpan.end,token.sourceSpan.fullStart);this._addToParent(new Expansion(switchValue.parts[0],type.parts[0],cases,sourceSpan,switchValue.sourceSpan));this._advance()}_parseExpansionCase(){const value=this._advance();if(this._peek.type!==21){this.errors.push(TreeError.create(null,this._peek.sourceSpan,`Invalid ICU message. Missing '{'.`));return null}const start=this._advance();const exp=this._collectExpansionExpTokens(start);if(!exp)return null;const end=this._advance();exp.push({type:29,parts:[],sourceSpan:end.sourceSpan});const expansionCaseParser=new _TreeBuilder(exp,this.getTagDefinition);expansionCaseParser.build();if(expansionCaseParser.errors.length>0){this.errors=this.errors.concat(expansionCaseParser.errors);return null}const sourceSpan=new ParseSourceSpan(value.sourceSpan.start,end.sourceSpan.end,value.sourceSpan.fullStart);const expSourceSpan=new ParseSourceSpan(start.sourceSpan.start,end.sourceSpan.end,start.sourceSpan.fullStart);return new ExpansionCase(value.parts[0],expansionCaseParser.rootNodes,sourceSpan,value.sourceSpan,expSourceSpan)}_collectExpansionExpTokens(start){const exp=[];const expansionFormStack=[21];while(true){if(this._peek.type===19||this._peek.type===21){expansionFormStack.push(this._peek.type)}if(this._peek.type===22){if(lastOnStack(expansionFormStack,21)){expansionFormStack.pop();if(expansionFormStack.length===0)return exp}else{this.errors.push(TreeError.create(null,start.sourceSpan,`Invalid ICU message. Missing '}'.`));return null}}if(this._peek.type===23){if(lastOnStack(expansionFormStack,19)){expansionFormStack.pop()}else{this.errors.push(TreeError.create(null,start.sourceSpan,`Invalid ICU message. Missing '}'.`));return null}}if(this._peek.type===29){this.errors.push(TreeError.create(null,start.sourceSpan,`Invalid ICU message. Missing '}'.`));return null}exp.push(this._advance())}}_consumeText(token){const tokens=[token];const startSpan=token.sourceSpan;let text=token.parts[0];if(text.length>0&&text[0]==="\n"){const parent=this._getContainer();if(parent!=null&&parent.children.length===0&&this.getTagDefinition(parent.name).ignoreFirstLf){text=text.substring(1);tokens[0]={type:token.type,sourceSpan:token.sourceSpan,parts:[text]}}}while(this._peek.type===8||this._peek.type===5||this._peek.type===9){token=this._advance();tokens.push(token);if(token.type===8){text+=token.parts.join("").replace(/&([^;]+);/g,decodeEntity)}else if(token.type===9){text+=token.parts[0]}else{text+=token.parts.join("")}}if(text.length>0){const endSpan=token.sourceSpan;this._addToParent(new Text(text,new ParseSourceSpan(startSpan.start,endSpan.end,startSpan.fullStart,startSpan.details),tokens))}}_closeVoidElement(){const el=this._getContainer();if(el instanceof Element&&this.getTagDefinition(el.name).isVoid){this._containerStack.pop()}}_consumeStartTag(startTagToken){const[prefix,name]=startTagToken.parts;const attrs=[];while(this._peek.type===14){attrs.push(this._consumeAttr(this._advance()))}const fullName=this._getElementFullName(prefix,name,this._getClosestParentElement());let selfClosing=false;if(this._peek.type===2){this._advance();selfClosing=true;const tagDef=this.getTagDefinition(fullName);if(!(tagDef.canSelfClose||getNsPrefix(fullName)!==null||tagDef.isVoid)){this.errors.push(TreeError.create(fullName,startTagToken.sourceSpan,`Only void, custom and foreign elements can be self closed "${startTagToken.parts[1]}"`))}}else if(this._peek.type===1){this._advance();selfClosing=false}const end=this._peek.sourceSpan.fullStart;const span=new ParseSourceSpan(startTagToken.sourceSpan.start,end,startTagToken.sourceSpan.fullStart);const startSpan=new ParseSourceSpan(startTagToken.sourceSpan.start,end,startTagToken.sourceSpan.fullStart);const el=new Element(fullName,attrs,[],span,startSpan,undefined);const parentEl=this._getContainer();this._pushContainer(el,parentEl instanceof Element&&this.getTagDefinition(parentEl.name).isClosedByChild(el.name));if(selfClosing){this._popContainer(fullName,Element,span)}else if(startTagToken.type===4){this._popContainer(fullName,Element,null);this.errors.push(TreeError.create(fullName,span,`Opening tag "${fullName}" not terminated.`))}}_pushContainer(node,isClosedByChild){if(isClosedByChild){this._containerStack.pop()}this._addToParent(node);this._containerStack.push(node)}_consumeEndTag(endTagToken){const fullName=this._getElementFullName(endTagToken.parts[0],endTagToken.parts[1],this._getClosestParentElement());if(this.getTagDefinition(fullName).isVoid){this.errors.push(TreeError.create(fullName,endTagToken.sourceSpan,`Void elements do not have end tags "${endTagToken.parts[1]}"`))}else if(!this._popContainer(fullName,Element,endTagToken.sourceSpan)){const errMsg=`Unexpected closing tag "${fullName}". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags`;this.errors.push(TreeError.create(fullName,endTagToken.sourceSpan,errMsg))}}_popContainer(expectedName,expectedType,endSourceSpan){let unexpectedCloseTagDetected=false;for(let stackIndex=this._containerStack.length-1;stackIndex>=0;stackIndex--){const node=this._containerStack[stackIndex];if((node.name===expectedName||expectedName===null)&&node instanceof expectedType){node.endSourceSpan=endSourceSpan;node.sourceSpan.end=endSourceSpan!==null?endSourceSpan.end:node.sourceSpan.end;this._containerStack.splice(stackIndex,this._containerStack.length-stackIndex);return!unexpectedCloseTagDetected}if(node instanceof Block||node instanceof Element&&!this.getTagDefinition(node.name).closedByParent){unexpectedCloseTagDetected=true}}return false}_consumeAttr(attrName){const fullName=mergeNsAndName(attrName.parts[0],attrName.parts[1]);let attrEnd=attrName.sourceSpan.end;if(this._peek.type===15){this._advance()}let value="";const valueTokens=[];let valueStartSpan=undefined;let valueEnd=undefined;const nextTokenType=this._peek.type;if(nextTokenType===16){valueStartSpan=this._peek.sourceSpan;valueEnd=this._peek.sourceSpan.end;while(this._peek.type===16||this._peek.type===17||this._peek.type===9){const valueToken=this._advance();valueTokens.push(valueToken);if(valueToken.type===17){value+=valueToken.parts.join("").replace(/&([^;]+);/g,decodeEntity)}else if(valueToken.type===9){value+=valueToken.parts[0]}else{value+=valueToken.parts.join("")}valueEnd=attrEnd=valueToken.sourceSpan.end}}if(this._peek.type===15){const quoteToken=this._advance();attrEnd=quoteToken.sourceSpan.end}const valueSpan=valueStartSpan&&valueEnd&&new ParseSourceSpan(valueStartSpan.start,valueEnd,valueStartSpan.fullStart);return new Attribute(fullName,value,new ParseSourceSpan(attrName.sourceSpan.start,attrEnd,attrName.sourceSpan.fullStart),attrName.sourceSpan,valueSpan,valueTokens.length>0?valueTokens:undefined,undefined)}_consumeBlockOpen(token){const parameters=[];while(this._peek.type===27){const paramToken=this._advance();parameters.push(new BlockParameter(paramToken.parts[0],paramToken.sourceSpan))}if(this._peek.type===25){this._advance()}const end=this._peek.sourceSpan.fullStart;const span=new ParseSourceSpan(token.sourceSpan.start,end,token.sourceSpan.fullStart);const startSpan=new ParseSourceSpan(token.sourceSpan.start,end,token.sourceSpan.fullStart);const block=new Block(token.parts[0],parameters,[],span,token.sourceSpan,startSpan);this._pushContainer(block,false)}_consumeBlockClose(token){if(!this._popContainer(null,Block,token.sourceSpan)){this.errors.push(TreeError.create(null,token.sourceSpan,`Unexpected closing block. The block may have been closed earlier. `+`If you meant to write the } character, you should use the "}" `+`HTML entity instead.`))}}_consumeIncompleteBlock(token){const parameters=[];while(this._peek.type===27){const paramToken=this._advance();parameters.push(new BlockParameter(paramToken.parts[0],paramToken.sourceSpan))}const end=this._peek.sourceSpan.fullStart;const span=new ParseSourceSpan(token.sourceSpan.start,end,token.sourceSpan.fullStart);const startSpan=new ParseSourceSpan(token.sourceSpan.start,end,token.sourceSpan.fullStart);const block=new Block(token.parts[0],parameters,[],span,token.sourceSpan,startSpan);this._pushContainer(block,false);this._popContainer(null,Block,null);this.errors.push(TreeError.create(token.parts[0],span,`Incomplete block "${token.parts[0]}". If you meant to write the @ character, `+`you should use the "@" HTML entity instead.`))}_getContainer(){return this._containerStack.length>0?this._containerStack[this._containerStack.length-1]:null}_getClosestParentElement(){for(let i=this._containerStack.length-1;i>-1;i--){if(this._containerStack[i]instanceof Element){return this._containerStack[i]}}return null}_addToParent(node){const parent=this._getContainer();if(parent===null){this.rootNodes.push(node)}else{parent.children.push(node)}}_getElementFullName(prefix,localName,parentElement){if(prefix===""){prefix=this.getTagDefinition(localName).implicitNamespacePrefix||"";if(prefix===""&&parentElement!=null){const parentTagName=splitNsName(parentElement.name)[1];const parentTagDefinition=this.getTagDefinition(parentTagName);if(!parentTagDefinition.preventNamespaceInheritance){prefix=getNsPrefix(parentElement.name)}}}return mergeNsAndName(prefix,localName)}}function lastOnStack(stack,element){return stack.length>0&&stack[stack.length-1]===element}function decodeEntity(match,entity){if(NAMED_ENTITIES[entity]!==undefined){return NAMED_ENTITIES[entity]||match}if(/^#x[a-f0-9]+$/i.test(entity)){return String.fromCodePoint(parseInt(entity.slice(2),16))}if(/^#\d+$/.test(entity)){return String.fromCodePoint(parseInt(entity.slice(1),10))}return match}const TRUSTED_TYPES_SINKS=new Set(["iframe|srcdoc","*|innerhtml","*|outerhtml","embed|src","object|codebase","object|data"]);function isTrustedTypesSink(tagName,propName){tagName=tagName.toLowerCase();propName=propName.toLowerCase();return TRUSTED_TYPES_SINKS.has(tagName+"|"+propName)||TRUSTED_TYPES_SINKS.has("*|"+propName)}const setI18nRefs=(htmlNode,i18nNode)=>{if(htmlNode instanceof NodeWithI18n){if(i18nNode instanceof IcuPlaceholder&&htmlNode.i18n instanceof Message){i18nNode.previousMessage=htmlNode.i18n}htmlNode.i18n=i18nNode}return i18nNode};class I18nMetaVisitor{constructor(interpolationConfig=DEFAULT_INTERPOLATION_CONFIG,keepI18nAttrs=false,enableI18nLegacyMessageIdFormat=false,containerBlocks=DEFAULT_CONTAINER_BLOCKS){this.interpolationConfig=interpolationConfig;this.keepI18nAttrs=keepI18nAttrs;this.enableI18nLegacyMessageIdFormat=enableI18nLegacyMessageIdFormat;this.containerBlocks=containerBlocks;this.hasI18nMeta=false;this._errors=[]}_generateI18nMessage(nodes,meta="",visitNodeFn){const{meaning:meaning,description:description,customId:customId}=this._parseMetadata(meta);const createI18nMessage=createI18nMessageFactory(this.interpolationConfig,this.containerBlocks);const message=createI18nMessage(nodes,meaning,description,customId,visitNodeFn);this._setMessageId(message,meta);this._setLegacyIds(message,meta);return message}visitAllWithErrors(nodes){const result=nodes.map((node=>node.visit(this,null)));return new ParseTreeResult(result,this._errors)}visitElement(element){let message=undefined;if(hasI18nAttrs(element)){this.hasI18nMeta=true;const attrs=[];const attrsMeta={};for(const attr of element.attrs){if(attr.name===I18N_ATTR){const i18n=element.i18n||attr.value;message=this._generateI18nMessage(element.children,i18n,setI18nRefs);if(message.nodes.length===0){message=undefined}element.i18n=message}else if(attr.name.startsWith(I18N_ATTR_PREFIX)){const name=attr.name.slice(I18N_ATTR_PREFIX.length);if(isTrustedTypesSink(element.name,name)){this._reportError(attr,`Translating attribute '${name}' is disallowed for security reasons.`)}else{attrsMeta[name]=attr.value}}else{attrs.push(attr)}}if(Object.keys(attrsMeta).length){for(const attr of attrs){const meta=attrsMeta[attr.name];if(meta!==undefined&&attr.value){attr.i18n=this._generateI18nMessage([attr],attr.i18n||meta)}}}if(!this.keepI18nAttrs){element.attrs=attrs}}visitAll(this,element.children,message);return element}visitExpansion(expansion,currentMessage){let message;const meta=expansion.i18n;this.hasI18nMeta=true;if(meta instanceof IcuPlaceholder){const name=meta.name;message=this._generateI18nMessage([expansion],meta);const icu=icuFromI18nMessage(message);icu.name=name;if(currentMessage!==null){currentMessage.placeholderToMessage[name]=message}}else{message=this._generateI18nMessage([expansion],currentMessage||meta)}expansion.i18n=message;return expansion}visitText(text){return text}visitAttribute(attribute){return attribute}visitComment(comment){return comment}visitExpansionCase(expansionCase){return expansionCase}visitBlock(block,context){visitAll(this,block.children,context);return block}visitBlockParameter(parameter,context){return parameter}_parseMetadata(meta){return typeof meta==="string"?parseI18nMeta(meta):meta instanceof Message?meta:{}}_setMessageId(message,meta){if(!message.id){message.id=meta instanceof Message&&meta.id||decimalDigest(message)}}_setLegacyIds(message,meta){if(this.enableI18nLegacyMessageIdFormat){message.legacyIds=[computeDigest(message),computeDecimalDigest(message)]}else if(typeof meta!=="string"){const previousMessage=meta instanceof Message?meta:meta instanceof IcuPlaceholder?meta.previousMessage:undefined;message.legacyIds=previousMessage?previousMessage.legacyIds:[]}}_reportError(node,msg){this._errors.push(new I18nError(node.sourceSpan,msg))}}const I18N_MEANING_SEPARATOR="|";const I18N_ID_SEPARATOR="@@";function parseI18nMeta(meta=""){let customId;let meaning;let description;meta=meta.trim();if(meta){const idIndex=meta.indexOf(I18N_ID_SEPARATOR);const descIndex=meta.indexOf(I18N_MEANING_SEPARATOR);let meaningAndDesc;[meaningAndDesc,customId]=idIndex>-1?[meta.slice(0,idIndex),meta.slice(idIndex+2)]:[meta,""];[meaning,description]=descIndex>-1?[meaningAndDesc.slice(0,descIndex),meaningAndDesc.slice(descIndex+1)]:["",meaningAndDesc]}return{customId:customId,meaning:meaning,description:description}}function i18nMetaToJSDoc(meta){const tags=[];if(meta.description){tags.push({tagName:"desc",text:meta.description})}else{tags.push({tagName:"suppress",text:"{msgDescriptions}"})}if(meta.meaning){tags.push({tagName:"meaning",text:meta.meaning})}return jsDocComment(tags)}const GOOG_GET_MSG="goog.getMsg";function createGoogleGetMsgStatements(variable$1,message,closureVar,placeholderValues){const messageString=serializeI18nMessageForGetMsg(message);const args=[literal(messageString)];if(Object.keys(placeholderValues).length){args.push(mapLiteral(formatI18nPlaceholderNamesInMap(placeholderValues,true),true));args.push(mapLiteral({original_code:literalMap(Object.keys(placeholderValues).map((param=>({key:formatI18nPlaceholderName(param),quoted:true,value:message.placeholders[param]?literal(message.placeholders[param].sourceSpan.toString()):literal(message.placeholderToMessage[param].nodes.map((node=>node.sourceSpan.toString())).join(""))}))))}))}const googGetMsgStmt=closureVar.set(variable(GOOG_GET_MSG).callFn(args)).toConstDecl();googGetMsgStmt.addLeadingComment(i18nMetaToJSDoc(message));const i18nAssignmentStmt=new ExpressionStatement(variable$1.set(closureVar));return[googGetMsgStmt,i18nAssignmentStmt]}class GetMsgSerializerVisitor{formatPh(value){return`{$${formatI18nPlaceholderName(value)}}`}visitText(text){return text.value}visitContainer(container){return container.children.map((child=>child.visit(this))).join("")}visitIcu(icu){return serializeIcuNode(icu)}visitTagPlaceholder(ph){return ph.isVoid?this.formatPh(ph.startName):`${this.formatPh(ph.startName)}${ph.children.map((child=>child.visit(this))).join("")}${this.formatPh(ph.closeName)}`}visitPlaceholder(ph){return this.formatPh(ph.name)}visitBlockPlaceholder(ph){return`${this.formatPh(ph.startName)}${ph.children.map((child=>child.visit(this))).join("")}${this.formatPh(ph.closeName)}`}visitIcuPlaceholder(ph,context){return this.formatPh(ph.name)}}const serializerVisitor=new GetMsgSerializerVisitor;function serializeI18nMessageForGetMsg(message){return message.nodes.map((node=>node.visit(serializerVisitor,null))).join("")}function createLocalizeStatements(variable,message,params){const{messageParts:messageParts,placeHolders:placeHolders}=serializeI18nMessageForLocalize(message);const sourceSpan=getSourceSpan(message);const expressions=placeHolders.map((ph=>params[ph.text]));const localizedString$1=localizedString(message,messageParts,placeHolders,expressions,sourceSpan);const variableInitialization=variable.set(localizedString$1);return[new ExpressionStatement(variableInitialization)]}class LocalizeSerializerVisitor{constructor(placeholderToMessage,pieces){this.placeholderToMessage=placeholderToMessage;this.pieces=pieces}visitText(text){if(this.pieces[this.pieces.length-1]instanceof LiteralPiece){this.pieces[this.pieces.length-1].text+=text.value}else{const sourceSpan=new ParseSourceSpan(text.sourceSpan.fullStart,text.sourceSpan.end,text.sourceSpan.fullStart,text.sourceSpan.details);this.pieces.push(new LiteralPiece(text.value,sourceSpan))}}visitContainer(container){container.children.forEach((child=>child.visit(this)))}visitIcu(icu){this.pieces.push(new LiteralPiece(serializeIcuNode(icu),icu.sourceSpan))}visitTagPlaceholder(ph){this.pieces.push(this.createPlaceholderPiece(ph.startName,ph.startSourceSpan??ph.sourceSpan));if(!ph.isVoid){ph.children.forEach((child=>child.visit(this)));this.pieces.push(this.createPlaceholderPiece(ph.closeName,ph.endSourceSpan??ph.sourceSpan))}}visitPlaceholder(ph){this.pieces.push(this.createPlaceholderPiece(ph.name,ph.sourceSpan))}visitBlockPlaceholder(ph){this.pieces.push(this.createPlaceholderPiece(ph.startName,ph.startSourceSpan??ph.sourceSpan));ph.children.forEach((child=>child.visit(this)));this.pieces.push(this.createPlaceholderPiece(ph.closeName,ph.endSourceSpan??ph.sourceSpan))}visitIcuPlaceholder(ph){this.pieces.push(this.createPlaceholderPiece(ph.name,ph.sourceSpan,this.placeholderToMessage[ph.name]))}createPlaceholderPiece(name,sourceSpan,associatedMessage){return new PlaceholderPiece(formatI18nPlaceholderName(name,false),sourceSpan,associatedMessage)}}function serializeI18nMessageForLocalize(message){const pieces=[];const serializerVisitor=new LocalizeSerializerVisitor(message.placeholderToMessage,pieces);message.nodes.forEach((node=>node.visit(serializerVisitor)));return processMessagePieces(pieces)}function getSourceSpan(message){const startNode=message.nodes[0];const endNode=message.nodes[message.nodes.length-1];return new ParseSourceSpan(startNode.sourceSpan.fullStart,endNode.sourceSpan.end,startNode.sourceSpan.fullStart,startNode.sourceSpan.details)}function processMessagePieces(pieces){const messageParts=[];const placeHolders=[];if(pieces[0]instanceof PlaceholderPiece){messageParts.push(createEmptyMessagePart(pieces[0].sourceSpan.start))}for(let i=0;i<pieces.length;i++){const part=pieces[i];if(part instanceof LiteralPiece){messageParts.push(part)}else{placeHolders.push(part);if(pieces[i-1]instanceof PlaceholderPiece){messageParts.push(createEmptyMessagePart(pieces[i-1].sourceSpan.end))}}}if(pieces[pieces.length-1]instanceof PlaceholderPiece){messageParts.push(createEmptyMessagePart(pieces[pieces.length-1].sourceSpan.end))}return{messageParts:messageParts,placeHolders:placeHolders}}function createEmptyMessagePart(location){return new LiteralPiece("",new ParseSourceSpan(location,location))}const NG_I18N_CLOSURE_MODE$1="ngI18nClosureMode";const TRANSLATION_VAR_PREFIX="i18n_";const I18N_ICU_MAPPING_PREFIX="I18N_EXP_";const ESCAPE="\ufffd";function collectI18nConsts(job){const fileBasedI18nSuffix=job.relativeContextFilePath.replace(/[^A-Za-z0-9]/g,"_").toUpperCase()+"_";const extractedAttributesByI18nContext=new Map;const i18nAttributesByElement=new Map;const i18nExpressionsByElement=new Map;const messages=new Map;for(const unit of job.units){for(const op of unit.ops()){if(op.kind===OpKind.ExtractedAttribute&&op.i18nContext!==null){const attributes=extractedAttributesByI18nContext.get(op.i18nContext)??[];attributes.push(op);extractedAttributesByI18nContext.set(op.i18nContext,attributes)}else if(op.kind===OpKind.I18nAttributes){i18nAttributesByElement.set(op.target,op)}else if(op.kind===OpKind.I18nExpression&&op.usage===I18nExpressionFor.I18nAttribute){const expressions=i18nExpressionsByElement.get(op.target)??[];expressions.push(op);i18nExpressionsByElement.set(op.target,expressions)}else if(op.kind===OpKind.I18nMessage){messages.set(op.xref,op)}}}const i18nValuesByContext=new Map;const messageConstIndices=new Map;for(const unit of job.units){for(const op of unit.create){if(op.kind===OpKind.I18nMessage){if(op.messagePlaceholder===null){const{mainVar:mainVar,statements:statements}=collectMessage(job,fileBasedI18nSuffix,messages,op);if(op.i18nBlock!==null){const i18nConst=job.addConst(mainVar,statements);messageConstIndices.set(op.i18nBlock,i18nConst)}else{job.constsInitializers.push(...statements);i18nValuesByContext.set(op.i18nContext,mainVar);const attributesForMessage=extractedAttributesByI18nContext.get(op.i18nContext);if(attributesForMessage!==undefined){for(const attr of attributesForMessage){attr.expression=mainVar.clone()}}}}OpList.remove(op)}}}for(const unit of job.units){for(const elem of unit.create){if(isElementOrContainerOp(elem)){const i18nAttributes=i18nAttributesByElement.get(elem.xref);if(i18nAttributes===undefined){continue}let i18nExpressions=i18nExpressionsByElement.get(elem.xref);if(i18nExpressions===undefined){throw new Error("AssertionError: Could not find any i18n expressions associated with an I18nAttributes instruction")}const seenPropertyNames=new Set;i18nExpressions=i18nExpressions.filter((i18nExpr=>{const seen=seenPropertyNames.has(i18nExpr.name);seenPropertyNames.add(i18nExpr.name);return!seen}));const i18nAttributeConfig=i18nExpressions.flatMap((i18nExpr=>{const i18nExprValue=i18nValuesByContext.get(i18nExpr.context);if(i18nExprValue===undefined){throw new Error("AssertionError: Could not find i18n expression's value")}return[literal(i18nExpr.name),i18nExprValue]}));i18nAttributes.i18nAttributesConfig=job.addConst(new LiteralArrayExpr(i18nAttributeConfig))}}}for(const unit of job.units){for(const op of unit.create){if(op.kind===OpKind.I18nStart){const msgIndex=messageConstIndices.get(op.root);if(msgIndex===undefined){throw new Error("AssertionError: Could not find corresponding i18n block index for an i18n message op; was an i18n message incorrectly assumed to correspond to an attribute?")}op.messageIndex=msgIndex}}}}function collectMessage(job,fileBasedI18nSuffix,messages,messageOp){const statements=[];const subMessagePlaceholders=new Map;for(const subMessageId of messageOp.subMessages){const subMessage=messages.get(subMessageId);const{mainVar:subMessageVar,statements:subMessageStatements}=collectMessage(job,fileBasedI18nSuffix,messages,subMessage);statements.push(...subMessageStatements);const subMessages=subMessagePlaceholders.get(subMessage.messagePlaceholder)??[];subMessages.push(subMessageVar);subMessagePlaceholders.set(subMessage.messagePlaceholder,subMessages)}addSubMessageParams(messageOp,subMessagePlaceholders);messageOp.params=new Map([...messageOp.params.entries()].sort());const mainVar=variable(job.pool.uniqueName(TRANSLATION_VAR_PREFIX));const closureVar=i18nGenerateClosureVar(job.pool,messageOp.message.id,fileBasedI18nSuffix,job.i18nUseExternalIds);let transformFn=undefined;if(messageOp.needsPostprocessing||messageOp.postprocessingParams.size>0){const postprocessingParams=Object.fromEntries([...messageOp.postprocessingParams.entries()].sort());const formattedPostprocessingParams=formatI18nPlaceholderNamesInMap(postprocessingParams,false);const extraTransformFnParams=[];if(messageOp.postprocessingParams.size>0){extraTransformFnParams.push(mapLiteral(formattedPostprocessingParams,true))}transformFn=expr=>importExpr(Identifiers.i18nPostprocess).callFn([expr,...extraTransformFnParams])}statements.push(...getTranslationDeclStmts$1(messageOp.message,mainVar,closureVar,messageOp.params,transformFn));return{mainVar:mainVar,statements:statements}}function addSubMessageParams(messageOp,subMessagePlaceholders){for(const[placeholder,subMessages]of subMessagePlaceholders){if(subMessages.length===1){messageOp.params.set(placeholder,subMessages[0])}else{messageOp.params.set(placeholder,literal(`${ESCAPE}${I18N_ICU_MAPPING_PREFIX}${placeholder}${ESCAPE}`));messageOp.postprocessingParams.set(placeholder,literalArr(subMessages))}}}function getTranslationDeclStmts$1(message,variable,closureVar,params,transformFn){const paramsObject=Object.fromEntries(params);const statements=[declareI18nVariable(variable),ifStmt(createClosureModeGuard$1(),createGoogleGetMsgStatements(variable,message,closureVar,paramsObject),createLocalizeStatements(variable,message,formatI18nPlaceholderNamesInMap(paramsObject,false)))];if(transformFn){statements.push(new ExpressionStatement(variable.set(transformFn(variable))))}return statements}function createClosureModeGuard$1(){return typeofExpr(variable(NG_I18N_CLOSURE_MODE$1)).notIdentical(literal("undefined",STRING_TYPE)).and(variable(NG_I18N_CLOSURE_MODE$1))}function i18nGenerateClosureVar(pool,messageId,fileBasedI18nSuffix,useExternalIds){let name;const suffix=fileBasedI18nSuffix;if(useExternalIds){const prefix=getTranslationConstPrefix(`EXTERNAL_`);const uniqueSuffix=pool.uniqueName(suffix);name=`${prefix}${sanitizeIdentifier(messageId)}$$${uniqueSuffix}`}else{const prefix=getTranslationConstPrefix(suffix);name=pool.uniqueName(prefix)}return variable(name)}function convertI18nText(job){for(const unit of job.units){let currentI18n=null;let currentIcu=null;const textNodeI18nBlocks=new Map;const textNodeIcus=new Map;const icuPlaceholderByText=new Map;for(const op of unit.create){switch(op.kind){case OpKind.I18nStart:if(op.context===null){throw Error("I18n op should have its context set.")}currentI18n=op;break;case OpKind.I18nEnd:currentI18n=null;break;case OpKind.IcuStart:if(op.context===null){throw Error("Icu op should have its context set.")}currentIcu=op;break;case OpKind.IcuEnd:currentIcu=null;break;case OpKind.Text:if(currentI18n!==null){textNodeI18nBlocks.set(op.xref,currentI18n);textNodeIcus.set(op.xref,currentIcu);if(op.icuPlaceholder!==null){const icuPlaceholderOp=createIcuPlaceholderOp(job.allocateXrefId(),op.icuPlaceholder,[op.initialValue]);OpList.replace(op,icuPlaceholderOp);icuPlaceholderByText.set(op.xref,icuPlaceholderOp)}else{OpList.remove(op)}}break}}for(const op of unit.update){switch(op.kind){case OpKind.InterpolateText:if(!textNodeI18nBlocks.has(op.target)){continue}const i18nOp=textNodeI18nBlocks.get(op.target);const icuOp=textNodeIcus.get(op.target);const icuPlaceholder=icuPlaceholderByText.get(op.target);const contextId=icuOp?icuOp.context:i18nOp.context;const resolutionTime=icuOp?I18nParamResolutionTime.Postproccessing:I18nParamResolutionTime.Creation;const ops=[];for(let i=0;i<op.interpolation.expressions.length;i++){const expr=op.interpolation.expressions[i];ops.push(createI18nExpressionOp(contextId,i18nOp.xref,i18nOp.xref,i18nOp.handle,expr,icuPlaceholder?.xref??null,op.interpolation.i18nPlaceholders[i]??null,resolutionTime,I18nExpressionFor.I18nText,"",expr.sourceSpan??op.sourceSpan))}OpList.replaceWithMany(op,ops);if(icuPlaceholder!==undefined){icuPlaceholder.strings=op.interpolation.strings}break}}}}function liftLocalRefs(job){for(const unit of job.units){for(const op of unit.create){switch(op.kind){case OpKind.ElementStart:case OpKind.Template:if(!Array.isArray(op.localRefs)){throw new Error(`AssertionError: expected localRefs to be an array still`)}op.numSlotsUsed+=op.localRefs.length;if(op.localRefs.length>0){const localRefs=serializeLocalRefs(op.localRefs);op.localRefs=job.addConst(localRefs)}else{op.localRefs=null}break}}}}function serializeLocalRefs(refs){const constRefs=[];for(const ref of refs){constRefs.push(literal(ref.name),literal(ref.target))}return literalArr(constRefs)}function emitNamespaceChanges(job){for(const unit of job.units){let activeNamespace=Namespace.HTML;for(const op of unit.create){if(op.kind!==OpKind.ElementStart){continue}if(op.namespace!==activeNamespace){OpList.insertBefore(createNamespaceOp(op.namespace),op);activeNamespace=op.namespace}}}}function parse(value){const styles=[];let i=0;let parenDepth=0;let quote=0;let valueStart=0;let propStart=0;let currentProp=null;while(i<value.length){const token=value.charCodeAt(i++);switch(token){case 40:parenDepth++;break;case 41:parenDepth--;break;case 39:if(quote===0){quote=39}else if(quote===39&&value.charCodeAt(i-1)!==92){quote=0}break;case 34:if(quote===0){quote=34}else if(quote===34&&value.charCodeAt(i-1)!==92){quote=0}break;case 58:if(!currentProp&&parenDepth===0&"e===0){currentProp=hyphenate(value.substring(propStart,i-1).trim());valueStart=i}break;case 59:if(currentProp&&valueStart>0&&parenDepth===0&"e===0){const styleVal=value.substring(valueStart,i-1).trim();styles.push(currentProp,styleVal);propStart=i;valueStart=0;currentProp=null}break}}if(currentProp&&valueStart){const styleVal=value.slice(valueStart).trim();styles.push(currentProp,styleVal)}return styles}function hyphenate(value){return value.replace(/[a-z][A-Z]/g,(v=>v.charAt(0)+"-"+v.charAt(1))).toLowerCase()}function nameFunctionsAndVariables(job){addNamesToView(job.root,job.componentName,{index:0},job.compatibility===CompatibilityMode.TemplateDefinitionBuilder)}function addNamesToView(unit,baseName,state,compatibility){if(unit.fnName===null){unit.fnName=unit.job.pool.uniqueName(sanitizeIdentifier(`${baseName}_${unit.job.fnSuffix}`),false)}const varNames=new Map;for(const op of unit.ops()){switch(op.kind){case OpKind.Property:case OpKind.HostProperty:if(op.isAnimationTrigger){op.name="@"+op.name}break;case OpKind.Listener:if(op.handlerFnName!==null){break}if(!op.hostListener&&op.targetSlot.slot===null){throw new Error(`Expected a slot to be assigned`)}let animation="";if(op.isAnimationListener){op.name=`@${op.name}.${op.animationPhase}`;animation="animation"}if(op.hostListener){op.handlerFnName=`${baseName}_${animation}${op.name}_HostBindingHandler`}else{op.handlerFnName=`${unit.fnName}_${op.tag.replace("-","_")}_${animation}${op.name}_${op.targetSlot.slot}_listener`}op.handlerFnName=sanitizeIdentifier(op.handlerFnName);break;case OpKind.TwoWayListener:if(op.handlerFnName!==null){break}if(op.targetSlot.slot===null){throw new Error(`Expected a slot to be assigned`)}op.handlerFnName=sanitizeIdentifier(`${unit.fnName}_${op.tag.replace("-","_")}_${op.name}_${op.targetSlot.slot}_listener`);break;case OpKind.Variable:varNames.set(op.xref,getVariableName(unit,op.variable,state));break;case OpKind.RepeaterCreate:if(!(unit instanceof ViewCompilationUnit)){throw new Error(`AssertionError: must be compiling a component`)}if(op.handle.slot===null){throw new Error(`Expected slot to be assigned`)}if(op.emptyView!==null){const emptyView=unit.job.views.get(op.emptyView);addNamesToView(emptyView,`${baseName}_${op.functionNameSuffix}Empty_${op.handle.slot+2}`,state,compatibility)}addNamesToView(unit.job.views.get(op.xref),`${baseName}_${op.functionNameSuffix}_${op.handle.slot+1}`,state,compatibility);break;case OpKind.Template:if(!(unit instanceof ViewCompilationUnit)){throw new Error(`AssertionError: must be compiling a component`)}const childView=unit.job.views.get(op.xref);if(op.handle.slot===null){throw new Error(`Expected slot to be assigned`)}const suffix=op.functionNameSuffix.length===0?"":`_${op.functionNameSuffix}`;addNamesToView(childView,`${baseName}${suffix}_${op.handle.slot}`,state,compatibility);break;case OpKind.StyleProp:op.name=normalizeStylePropName(op.name);if(compatibility){op.name=stripImportant(op.name)}break;case OpKind.ClassProp:if(compatibility){op.name=stripImportant(op.name)}break}}for(const op of unit.ops()){visitExpressionsInOp(op,(expr=>{if(!(expr instanceof ReadVariableExpr)||expr.name!==null){return}if(!varNames.has(expr.xref)){throw new Error(`Variable ${expr.xref} not yet named`)}expr.name=varNames.get(expr.xref)}))}}function getVariableName(unit,variable,state){if(variable.name===null){switch(variable.kind){case SemanticVariableKind.Context:variable.name=`ctx_r${state.index++}`;break;case SemanticVariableKind.Identifier:if(unit.job.compatibility===CompatibilityMode.TemplateDefinitionBuilder){const compatPrefix=variable.identifier==="ctx"?"i":"";variable.name=`${variable.identifier}_${compatPrefix}r${++state.index}`}else{variable.name=`${variable.identifier}_i${state.index++}`}break;default:variable.name=`_r${++state.index}`;break}}return variable.name}function normalizeStylePropName(name){return name.startsWith("--")?name:hyphenate(name)}function stripImportant(name){const importantIndex=name.indexOf("!important");if(importantIndex>-1){return name.substring(0,importantIndex)}return name}function mergeNextContextExpressions(job){for(const unit of job.units){for(const op of unit.create){if(op.kind===OpKind.Listener||op.kind===OpKind.TwoWayListener){mergeNextContextsInOps(op.handlerOps)}}mergeNextContextsInOps(unit.update)}}function mergeNextContextsInOps(ops){for(const op of ops){if(op.kind!==OpKind.Statement||!(op.statement instanceof ExpressionStatement)||!(op.statement.expr instanceof NextContextExpr)){continue}const mergeSteps=op.statement.expr.steps;let tryToMerge=true;for(let candidate=op.next;candidate.kind!==OpKind.ListEnd&&tryToMerge;candidate=candidate.next){visitExpressionsInOp(candidate,((expr,flags)=>{if(!isIrExpression(expr)){return expr}if(!tryToMerge){return}if(flags&VisitorContextFlag.InChildOperation){return}switch(expr.kind){case ExpressionKind.NextContext:expr.steps+=mergeSteps;OpList.remove(op);tryToMerge=false;break;case ExpressionKind.GetCurrentView:case ExpressionKind.Reference:tryToMerge=false;break}return}))}}}const CONTAINER_TAG="ng-container";function generateNgContainerOps(job){for(const unit of job.units){const updatedElementXrefs=new Set;for(const op of unit.create){if(op.kind===OpKind.ElementStart&&op.tag===CONTAINER_TAG){op.kind=OpKind.ContainerStart;updatedElementXrefs.add(op.xref)}if(op.kind===OpKind.ElementEnd&&updatedElementXrefs.has(op.xref)){op.kind=OpKind.ContainerEnd}}}}function lookupElement(elements,xref){const el=elements.get(xref);if(el===undefined){throw new Error("All attributes should have an element-like target.")}return el}function disableBindings$1(job){const elements=new Map;for(const view of job.units){for(const op of view.create){if(!isElementOrContainerOp(op)){continue}elements.set(op.xref,op)}}for(const unit of job.units){for(const op of unit.create){if((op.kind===OpKind.ElementStart||op.kind===OpKind.ContainerStart)&&op.nonBindable){OpList.insertAfter(createDisableBindingsOp(op.xref),op)}if((op.kind===OpKind.ElementEnd||op.kind===OpKind.ContainerEnd)&&lookupElement(elements,op.xref).nonBindable){OpList.insertBefore(createEnableBindingsOp(op.xref),op)}}}}function generateNullishCoalesceExpressions(job){for(const unit of job.units){for(const op of unit.ops()){transformExpressionsInOp(op,(expr=>{if(!(expr instanceof BinaryOperatorExpr)||expr.operator!==exports.BinaryOperator.NullishCoalesce){return expr}const assignment=new AssignTemporaryExpr(expr.lhs.clone(),job.allocateXrefId());const read=new ReadTemporaryExpr(assignment.xref);return new ConditionalExpr(new BinaryOperatorExpr(exports.BinaryOperator.And,new BinaryOperatorExpr(exports.BinaryOperator.NotIdentical,assignment,NULL_EXPR),new BinaryOperatorExpr(exports.BinaryOperator.NotIdentical,read,new LiteralExpr(undefined))),read.clone(),expr.rhs)}),VisitorContextFlag.None)}}}function kindTest(kind){return op=>op.kind===kind}function kindWithInterpolationTest(kind,interpolation){return op=>op.kind===kind&&interpolation===op.expression instanceof Interpolation}function basicListenerKindTest(op){return op.kind===OpKind.Listener&&!(op.hostListener&&op.isAnimationListener)||op.kind===OpKind.TwoWayListener}function nonInterpolationPropertyKindTest(op){return(op.kind===OpKind.Property||op.kind===OpKind.TwoWayProperty)&&!(op.expression instanceof Interpolation)}const CREATE_ORDERING=[{test:op=>op.kind===OpKind.Listener&&op.hostListener&&op.isAnimationListener},{test:basicListenerKindTest}];const UPDATE_ORDERING=[{test:kindTest(OpKind.StyleMap),transform:keepLast},{test:kindTest(OpKind.ClassMap),transform:keepLast},{test:kindTest(OpKind.StyleProp)},{test:kindTest(OpKind.ClassProp)},{test:kindWithInterpolationTest(OpKind.Attribute,true)},{test:kindWithInterpolationTest(OpKind.Property,true)},{test:nonInterpolationPropertyKindTest},{test:kindWithInterpolationTest(OpKind.Attribute,false)}];const UPDATE_HOST_ORDERING=[{test:kindWithInterpolationTest(OpKind.HostProperty,true)},{test:kindWithInterpolationTest(OpKind.HostProperty,false)},{test:kindTest(OpKind.Attribute)},{test:kindTest(OpKind.StyleMap),transform:keepLast},{test:kindTest(OpKind.ClassMap),transform:keepLast},{test:kindTest(OpKind.StyleProp)},{test:kindTest(OpKind.ClassProp)}];const handledOpKinds=new Set([OpKind.Listener,OpKind.TwoWayListener,OpKind.StyleMap,OpKind.ClassMap,OpKind.StyleProp,OpKind.ClassProp,OpKind.Property,OpKind.TwoWayProperty,OpKind.HostProperty,OpKind.Attribute]);function orderOps(job){for(const unit of job.units){orderWithin(unit.create,CREATE_ORDERING);const ordering=unit.job.kind===CompilationJobKind.Host?UPDATE_HOST_ORDERING:UPDATE_ORDERING;orderWithin(unit.update,ordering)}}function orderWithin(opList,ordering){let opsToOrder=[];let firstTargetInGroup=null;for(const op of opList){const currentTarget=hasDependsOnSlotContextTrait(op)?op.target:null;if(!handledOpKinds.has(op.kind)||currentTarget!==firstTargetInGroup&&(firstTargetInGroup!==null&¤tTarget!==null)){OpList.insertBefore(reorder(opsToOrder,ordering),op);opsToOrder=[];firstTargetInGroup=null}if(handledOpKinds.has(op.kind)){opsToOrder.push(op);OpList.remove(op);firstTargetInGroup=currentTarget??firstTargetInGroup}}opList.push(reorder(opsToOrder,ordering))}function reorder(ops,ordering){const groups=Array.from(ordering,(()=>new Array));for(const op of ops){const groupIndex=ordering.findIndex((o=>o.test(op)));groups[groupIndex].push(op)}return groups.flatMap(((group,i)=>{const transform=ordering[i].transform;return transform?transform(group):group}))}function keepLast(ops){return ops.slice(ops.length-1)}function parseExtractedStyles(job){const elements=new Map;for(const unit of job.units){for(const op of unit.create){if(isElementOrContainerOp(op)){elements.set(op.xref,op)}}}for(const unit of job.units){for(const op of unit.create){if(op.kind===OpKind.ExtractedAttribute&&op.bindingKind===BindingKind.Attribute&&isStringLiteral(op.expression)){const target=elements.get(op.target);if(target!==undefined&&target.kind===OpKind.Template&&target.templateKind===TemplateKind.Structural){continue}if(op.name==="style"){const parsedStyles=parse(op.expression.value);for(let i=0;i<parsedStyles.length-1;i+=2){OpList.insertBefore(createExtractedAttributeOp(op.target,BindingKind.StyleProperty,null,parsedStyles[i],literal(parsedStyles[i+1]),null,null,SecurityContext.STYLE),op)}OpList.remove(op)}else if(op.name==="class"){const parsedClasses=op.expression.value.trim().split(/\s+/g);for(const parsedClass of parsedClasses){OpList.insertBefore(createExtractedAttributeOp(op.target,BindingKind.ClassName,null,parsedClass,null,null,null,SecurityContext.NONE),op)}OpList.remove(op)}}}}}function removeContentSelectors(job){for(const unit of job.units){const elements=createOpXrefMap(unit);for(const op of unit.ops()){switch(op.kind){case OpKind.Binding:const target=lookupInXrefMap(elements,op.target);if(isSelectAttribute(op.name)&&target.kind===OpKind.Projection){OpList.remove(op)}break}}}}function isSelectAttribute(name){return name.toLowerCase()==="select"}function lookupInXrefMap(map,xref){const el=map.get(xref);if(el===undefined){throw new Error("All attributes should have an slottable target.")}return el}function createPipes(job){for(const unit of job.units){processPipeBindingsInView(unit)}}function processPipeBindingsInView(unit){for(const updateOp of unit.update){visitExpressionsInOp(updateOp,((expr,flags)=>{if(!isIrExpression(expr)){return}if(expr.kind!==ExpressionKind.PipeBinding){return}if(flags&VisitorContextFlag.InChildOperation){throw new Error(`AssertionError: pipe bindings should not appear in child expressions`)}if(unit.job.compatibility){const slotHandle=updateOp.target;if(slotHandle==undefined){throw new Error(`AssertionError: expected slot handle to be assigned for pipe creation`)}addPipeToCreationBlock(unit,updateOp.target,expr)}else{unit.create.push(createPipeOp(expr.target,expr.targetSlot,expr.name))}}))}}function addPipeToCreationBlock(unit,afterTargetXref,binding){for(let op=unit.create.head.next;op.kind!==OpKind.ListEnd;op=op.next){if(!hasConsumesSlotTrait(op)){continue}if(op.xref!==afterTargetXref){continue}while(op.next.kind===OpKind.Pipe){op=op.next}const pipe=createPipeOp(binding.target,binding.targetSlot,binding.name);OpList.insertBefore(pipe,op.next);return}throw new Error(`AssertionError: unable to find insertion point for pipe ${binding.name}`)}function createVariadicPipes(job){for(const unit of job.units){for(const op of unit.update){transformExpressionsInOp(op,(expr=>{if(!(expr instanceof PipeBindingExpr)){return expr}if(expr.args.length<=4){return expr}return new PipeBindingVariadicExpr(expr.target,expr.targetSlot,expr.name,literalArr(expr.args),expr.args.length)}),VisitorContextFlag.None)}}}function propagateI18nBlocks(job){propagateI18nBlocksToTemplates(job.root,0)}function propagateI18nBlocksToTemplates(unit,subTemplateIndex){let i18nBlock=null;for(const op of unit.create){switch(op.kind){case OpKind.I18nStart:op.subTemplateIndex=subTemplateIndex===0?null:subTemplateIndex;i18nBlock=op;break;case OpKind.I18nEnd:if(i18nBlock.subTemplateIndex===null){subTemplateIndex=0}i18nBlock=null;break;case OpKind.Template:subTemplateIndex=propagateI18nBlocksForView(unit.job.views.get(op.xref),i18nBlock,op.i18nPlaceholder,subTemplateIndex);break;case OpKind.RepeaterCreate:const forView=unit.job.views.get(op.xref);subTemplateIndex=propagateI18nBlocksForView(forView,i18nBlock,op.i18nPlaceholder,subTemplateIndex);if(op.emptyView!==null){subTemplateIndex=propagateI18nBlocksForView(unit.job.views.get(op.emptyView),i18nBlock,op.emptyI18nPlaceholder,subTemplateIndex)}break}}return subTemplateIndex}function propagateI18nBlocksForView(view,i18nBlock,i18nPlaceholder,subTemplateIndex){if(i18nPlaceholder!==undefined){if(i18nBlock===null){throw Error("Expected template with i18n placeholder to be in an i18n block.")}subTemplateIndex++;wrapTemplateWithI18n(view,i18nBlock)}return propagateI18nBlocksToTemplates(view,subTemplateIndex)}function wrapTemplateWithI18n(unit,parentI18n){if(unit.create.head.next?.kind!==OpKind.I18nStart){const id=unit.job.allocateXrefId();OpList.insertAfter(createI18nStartOp(id,parentI18n.message,parentI18n.root,null),unit.create.head);OpList.insertBefore(createI18nEndOp(id,null),unit.create.tail)}}function extractPureFunctions(job){for(const view of job.units){for(const op of view.ops()){visitExpressionsInOp(op,(expr=>{if(!(expr instanceof PureFunctionExpr)||expr.body===null){return}const constantDef=new PureFunctionConstant(expr.args.length);expr.fn=job.pool.getSharedConstant(constantDef,expr.body);expr.body=null}))}}}class PureFunctionConstant extends GenericKeyFn{constructor(numArgs){super();this.numArgs=numArgs}keyOf(expr){if(expr instanceof PureFunctionParameterExpr){return`param(${expr.index})`}else{return super.keyOf(expr)}}toSharedConstantDeclaration(declName,keyExpr){const fnParams=[];for(let idx=0;idx<this.numArgs;idx++){fnParams.push(new FnParam("a"+idx))}const returnExpr=transformExpressionsInExpression(keyExpr,(expr=>{if(!(expr instanceof PureFunctionParameterExpr)){return expr}return variable("a"+expr.index)}),VisitorContextFlag.None);return new DeclareVarStmt(declName,new ArrowFunctionExpr(fnParams,returnExpr),undefined,exports.StmtModifier.Final)}}function generatePureLiteralStructures(job){for(const unit of job.units){for(const op of unit.update){transformExpressionsInOp(op,((expr,flags)=>{if(flags&VisitorContextFlag.InChildOperation){return expr}if(expr instanceof LiteralArrayExpr){return transformLiteralArray(expr)}else if(expr instanceof LiteralMapExpr){return transformLiteralMap(expr)}return expr}),VisitorContextFlag.None)}}}function transformLiteralArray(expr){const derivedEntries=[];const nonConstantArgs=[];for(const entry of expr.entries){if(entry.isConstant()){derivedEntries.push(entry)}else{const idx=nonConstantArgs.length;nonConstantArgs.push(entry);derivedEntries.push(new PureFunctionParameterExpr(idx))}}return new PureFunctionExpr(literalArr(derivedEntries),nonConstantArgs)}function transformLiteralMap(expr){let derivedEntries=[];const nonConstantArgs=[];for(const entry of expr.entries){if(entry.value.isConstant()){derivedEntries.push(entry)}else{const idx=nonConstantArgs.length;nonConstantArgs.push(entry.value);derivedEntries.push(new LiteralMapEntry(entry.key,new PureFunctionParameterExpr(idx),entry.quoted))}}return new PureFunctionExpr(literalMap(derivedEntries),nonConstantArgs)}function element(slot,tag,constIndex,localRefIndex,sourceSpan){return elementOrContainerBase(Identifiers.element,slot,tag,constIndex,localRefIndex,sourceSpan)}function elementStart(slot,tag,constIndex,localRefIndex,sourceSpan){return elementOrContainerBase(Identifiers.elementStart,slot,tag,constIndex,localRefIndex,sourceSpan)}function elementOrContainerBase(instruction,slot,tag,constIndex,localRefIndex,sourceSpan){const args=[literal(slot)];if(tag!==null){args.push(literal(tag))}if(localRefIndex!==null){args.push(literal(constIndex),literal(localRefIndex))}else if(constIndex!==null){args.push(literal(constIndex))}return call(instruction,args,sourceSpan)}function elementEnd(sourceSpan){return call(Identifiers.elementEnd,[],sourceSpan)}function elementContainerStart(slot,constIndex,localRefIndex,sourceSpan){return elementOrContainerBase(Identifiers.elementContainerStart,slot,null,constIndex,localRefIndex,sourceSpan)}function elementContainer(slot,constIndex,localRefIndex,sourceSpan){return elementOrContainerBase(Identifiers.elementContainer,slot,null,constIndex,localRefIndex,sourceSpan)}function elementContainerEnd(){return call(Identifiers.elementContainerEnd,[],null)}function template(slot,templateFnRef,decls,vars,tag,constIndex,localRefs,sourceSpan){const args=[literal(slot),templateFnRef,literal(decls),literal(vars),literal(tag),literal(constIndex)];if(localRefs!==null){args.push(literal(localRefs));args.push(importExpr(Identifiers.templateRefExtractor))}while(args[args.length-1].isEquivalent(NULL_EXPR)){args.pop()}return call(Identifiers.templateCreate,args,sourceSpan)}function disableBindings(){return call(Identifiers.disableBindings,[],null)}function enableBindings(){return call(Identifiers.enableBindings,[],null)}function listener(name,handlerFn,eventTargetResolver,syntheticHost,sourceSpan){const args=[literal(name),handlerFn];if(eventTargetResolver!==null){args.push(literal(false));args.push(importExpr(eventTargetResolver))}return call(syntheticHost?Identifiers.syntheticHostListener:Identifiers.listener,args,sourceSpan)}function twoWayBindingSet(target,value){return importExpr(Identifiers.twoWayBindingSet).callFn([target,value])}function twoWayListener(name,handlerFn,sourceSpan){return call(Identifiers.twoWayListener,[literal(name),handlerFn],sourceSpan)}function pipe(slot,name){return call(Identifiers.pipe,[literal(slot),literal(name)],null)}function namespaceHTML(){return call(Identifiers.namespaceHTML,[],null)}function namespaceSVG(){return call(Identifiers.namespaceSVG,[],null)}function namespaceMath(){return call(Identifiers.namespaceMathML,[],null)}function advance(delta,sourceSpan){return call(Identifiers.advance,delta>1?[literal(delta)]:[],sourceSpan)}function reference(slot){return importExpr(Identifiers.reference).callFn([literal(slot)])}function nextContext(steps){return importExpr(Identifiers.nextContext).callFn(steps===1?[]:[literal(steps)])}function getCurrentView(){return importExpr(Identifiers.getCurrentView).callFn([])}function restoreView(savedView){return importExpr(Identifiers.restoreView).callFn([savedView])}function resetView(returnValue){return importExpr(Identifiers.resetView).callFn([returnValue])}function text(slot,initialValue,sourceSpan){const args=[literal(slot,null)];if(initialValue!==""){args.push(literal(initialValue))}return call(Identifiers.text,args,sourceSpan)}function defer(selfSlot,primarySlot,dependencyResolverFn,loadingSlot,placeholderSlot,errorSlot,loadingConfig,placeholderConfig,enableTimerScheduling,sourceSpan){const args=[literal(selfSlot),literal(primarySlot),dependencyResolverFn??literal(null),literal(loadingSlot),literal(placeholderSlot),literal(errorSlot),loadingConfig??literal(null),placeholderConfig??literal(null),enableTimerScheduling?importExpr(Identifiers.deferEnableTimerScheduling):literal(null)];let expr;while((expr=args[args.length-1])!==null&&expr instanceof LiteralExpr&&expr.value===null){args.pop()}return call(Identifiers.defer,args,sourceSpan)}const deferTriggerToR3TriggerInstructionsMap=new Map([[DeferTriggerKind.Idle,[Identifiers.deferOnIdle,Identifiers.deferPrefetchOnIdle]],[DeferTriggerKind.Immediate,[Identifiers.deferOnImmediate,Identifiers.deferPrefetchOnImmediate]],[DeferTriggerKind.Timer,[Identifiers.deferOnTimer,Identifiers.deferPrefetchOnTimer]],[DeferTriggerKind.Hover,[Identifiers.deferOnHover,Identifiers.deferPrefetchOnHover]],[DeferTriggerKind.Interaction,[Identifiers.deferOnInteraction,Identifiers.deferPrefetchOnInteraction]],[DeferTriggerKind.Viewport,[Identifiers.deferOnViewport,Identifiers.deferPrefetchOnViewport]]]);function deferOn(trigger,args,prefetch,sourceSpan){const instructions=deferTriggerToR3TriggerInstructionsMap.get(trigger);if(instructions===undefined){throw new Error(`Unable to determine instruction for trigger ${trigger}`)}const instructionToCall=prefetch?instructions[1]:instructions[0];return call(instructionToCall,args.map((a=>literal(a))),sourceSpan)}function projectionDef(def){return call(Identifiers.projectionDef,def?[def]:[],null)}function projection(slot,projectionSlotIndex,attributes,sourceSpan){const args=[literal(slot)];if(projectionSlotIndex!==0||attributes!==null){args.push(literal(projectionSlotIndex));if(attributes!==null){args.push(attributes)}}return call(Identifiers.projection,args,sourceSpan)}function i18nStart(slot,constIndex,subTemplateIndex,sourceSpan){const args=[literal(slot),literal(constIndex)];if(subTemplateIndex!==null){args.push(literal(subTemplateIndex))}return call(Identifiers.i18nStart,args,sourceSpan)}function repeaterCreate(slot,viewFnName,decls,vars,tag,constIndex,trackByFn,trackByUsesComponentInstance,emptyViewFnName,emptyDecls,emptyVars,emptyTag,emptyConstIndex,sourceSpan){const args=[literal(slot),variable(viewFnName),literal(decls),literal(vars),literal(tag),literal(constIndex),trackByFn];if(trackByUsesComponentInstance||emptyViewFnName!==null){args.push(literal(trackByUsesComponentInstance));if(emptyViewFnName!==null){args.push(variable(emptyViewFnName),literal(emptyDecls),literal(emptyVars));if(emptyTag!==null||emptyConstIndex!==null){args.push(literal(emptyTag))}if(emptyConstIndex!==null){args.push(literal(emptyConstIndex))}}}return call(Identifiers.repeaterCreate,args,sourceSpan)}function repeater(collection,sourceSpan){return call(Identifiers.repeater,[collection],sourceSpan)}function deferWhen(prefetch,expr,sourceSpan){return call(prefetch?Identifiers.deferPrefetchWhen:Identifiers.deferWhen,[expr],sourceSpan)}function i18n(slot,constIndex,subTemplateIndex,sourceSpan){const args=[literal(slot),literal(constIndex)];if(subTemplateIndex){args.push(literal(subTemplateIndex))}return call(Identifiers.i18n,args,sourceSpan)}function i18nEnd(endSourceSpan){return call(Identifiers.i18nEnd,[],endSourceSpan)}function i18nAttributes(slot,i18nAttributesConfig){const args=[literal(slot),literal(i18nAttributesConfig)];return call(Identifiers.i18nAttributes,args,null)}function property(name,expression,sanitizer,sourceSpan){const args=[literal(name),expression];if(sanitizer!==null){args.push(sanitizer)}return call(Identifiers.property,args,sourceSpan)}function twoWayProperty(name,expression,sanitizer,sourceSpan){const args=[literal(name),expression];if(sanitizer!==null){args.push(sanitizer)}return call(Identifiers.twoWayProperty,args,sourceSpan)}function attribute(name,expression,sanitizer,namespace){const args=[literal(name),expression];if(sanitizer!==null||namespace!==null){args.push(sanitizer??literal(null))}if(namespace!==null){args.push(literal(namespace))}return call(Identifiers.attribute,args,null)}function styleProp(name,expression,unit,sourceSpan){const args=[literal(name),expression];if(unit!==null){args.push(literal(unit))}return call(Identifiers.styleProp,args,sourceSpan)}function classProp(name,expression,sourceSpan){return call(Identifiers.classProp,[literal(name),expression],sourceSpan)}function styleMap(expression,sourceSpan){return call(Identifiers.styleMap,[expression],sourceSpan)}function classMap(expression,sourceSpan){return call(Identifiers.classMap,[expression],sourceSpan)}const PIPE_BINDINGS=[Identifiers.pipeBind1,Identifiers.pipeBind2,Identifiers.pipeBind3,Identifiers.pipeBind4];function pipeBind(slot,varOffset,args){if(args.length<1||args.length>PIPE_BINDINGS.length){throw new Error(`pipeBind() argument count out of bounds`)}const instruction=PIPE_BINDINGS[args.length-1];return importExpr(instruction).callFn([literal(slot),literal(varOffset),...args])}function pipeBindV(slot,varOffset,args){return importExpr(Identifiers.pipeBindV).callFn([literal(slot),literal(varOffset),args])}function textInterpolate(strings,expressions,sourceSpan){if(strings.length<1||expressions.length!==strings.length-1){throw new Error(`AssertionError: expected specific shape of args for strings/expressions in interpolation`)}const interpolationArgs=[];if(expressions.length===1&&strings[0]===""&&strings[1]===""){interpolationArgs.push(expressions[0])}else{let idx;for(idx=0;idx<expressions.length;idx++){interpolationArgs.push(literal(strings[idx]),expressions[idx])}interpolationArgs.push(literal(strings[idx]))}return callVariadicInstruction(TEXT_INTERPOLATE_CONFIG,[],interpolationArgs,[],sourceSpan)}function i18nExp(expr,sourceSpan){return call(Identifiers.i18nExp,[expr],sourceSpan)}function i18nApply(slot,sourceSpan){return call(Identifiers.i18nApply,[literal(slot)],sourceSpan)}function propertyInterpolate(name,strings,expressions,sanitizer,sourceSpan){const interpolationArgs=collateInterpolationArgs(strings,expressions);const extraArgs=[];if(sanitizer!==null){extraArgs.push(sanitizer)}return callVariadicInstruction(PROPERTY_INTERPOLATE_CONFIG,[literal(name)],interpolationArgs,extraArgs,sourceSpan)}function attributeInterpolate(name,strings,expressions,sanitizer,sourceSpan){const interpolationArgs=collateInterpolationArgs(strings,expressions);const extraArgs=[];if(sanitizer!==null){extraArgs.push(sanitizer)}return callVariadicInstruction(ATTRIBUTE_INTERPOLATE_CONFIG,[literal(name)],interpolationArgs,extraArgs,sourceSpan)}function stylePropInterpolate(name,strings,expressions,unit,sourceSpan){const interpolationArgs=collateInterpolationArgs(strings,expressions);const extraArgs=[];if(unit!==null){extraArgs.push(literal(unit))}return callVariadicInstruction(STYLE_PROP_INTERPOLATE_CONFIG,[literal(name)],interpolationArgs,extraArgs,sourceSpan)}function styleMapInterpolate(strings,expressions,sourceSpan){const interpolationArgs=collateInterpolationArgs(strings,expressions);return callVariadicInstruction(STYLE_MAP_INTERPOLATE_CONFIG,[],interpolationArgs,[],sourceSpan)}function classMapInterpolate(strings,expressions,sourceSpan){const interpolationArgs=collateInterpolationArgs(strings,expressions);return callVariadicInstruction(CLASS_MAP_INTERPOLATE_CONFIG,[],interpolationArgs,[],sourceSpan)}function hostProperty(name,expression,sanitizer,sourceSpan){const args=[literal(name),expression];if(sanitizer!==null){args.push(sanitizer)}return call(Identifiers.hostProperty,args,sourceSpan)}function syntheticHostProperty(name,expression,sourceSpan){return call(Identifiers.syntheticHostProperty,[literal(name),expression],sourceSpan)}function pureFunction(varOffset,fn,args){return callVariadicInstructionExpr(PURE_FUNCTION_CONFIG,[literal(varOffset),fn],args,[],null)}function collateInterpolationArgs(strings,expressions){if(strings.length<1||expressions.length!==strings.length-1){throw new Error(`AssertionError: expected specific shape of args for strings/expressions in interpolation`)}const interpolationArgs=[];if(expressions.length===1&&strings[0]===""&&strings[1]===""){interpolationArgs.push(expressions[0])}else{let idx;for(idx=0;idx<expressions.length;idx++){interpolationArgs.push(literal(strings[idx]),expressions[idx])}interpolationArgs.push(literal(strings[idx]))}return interpolationArgs}function call(instruction,args,sourceSpan){const expr=importExpr(instruction).callFn(args,sourceSpan);return createStatementOp(new ExpressionStatement(expr,sourceSpan))}function conditional(slot,condition,contextValue,sourceSpan){const args=[literal(slot),condition];if(contextValue!==null){args.push(contextValue)}return call(Identifiers.conditional,args,sourceSpan)}const TEXT_INTERPOLATE_CONFIG={constant:[Identifiers.textInterpolate,Identifiers.textInterpolate1,Identifiers.textInterpolate2,Identifiers.textInterpolate3,Identifiers.textInterpolate4,Identifiers.textInterpolate5,Identifiers.textInterpolate6,Identifiers.textInterpolate7,Identifiers.textInterpolate8],variable:Identifiers.textInterpolateV,mapping:n=>{if(n%2===0){throw new Error(`Expected odd number of arguments`)}return(n-1)/2}};const PROPERTY_INTERPOLATE_CONFIG={constant:[Identifiers.propertyInterpolate,Identifiers.propertyInterpolate1,Identifiers.propertyInterpolate2,Identifiers.propertyInterpolate3,Identifiers.propertyInterpolate4,Identifiers.propertyInterpolate5,Identifiers.propertyInterpolate6,Identifiers.propertyInterpolate7,Identifiers.propertyInterpolate8],variable:Identifiers.propertyInterpolateV,mapping:n=>{if(n%2===0){throw new Error(`Expected odd number of arguments`)}return(n-1)/2}};const STYLE_PROP_INTERPOLATE_CONFIG={constant:[Identifiers.styleProp,Identifiers.stylePropInterpolate1,Identifiers.stylePropInterpolate2,Identifiers.stylePropInterpolate3,Identifiers.stylePropInterpolate4,Identifiers.stylePropInterpolate5,Identifiers.stylePropInterpolate6,Identifiers.stylePropInterpolate7,Identifiers.stylePropInterpolate8],variable:Identifiers.stylePropInterpolateV,mapping:n=>{if(n%2===0){throw new Error(`Expected odd number of arguments`)}return(n-1)/2}};const ATTRIBUTE_INTERPOLATE_CONFIG={constant:[Identifiers.attribute,Identifiers.attributeInterpolate1,Identifiers.attributeInterpolate2,Identifiers.attributeInterpolate3,Identifiers.attributeInterpolate4,Identifiers.attributeInterpolate5,Identifiers.attributeInterpolate6,Identifiers.attributeInterpolate7,Identifiers.attributeInterpolate8],variable:Identifiers.attributeInterpolateV,mapping:n=>{if(n%2===0){throw new Error(`Expected odd number of arguments`)}return(n-1)/2}};const STYLE_MAP_INTERPOLATE_CONFIG={constant:[Identifiers.styleMap,Identifiers.styleMapInterpolate1,Identifiers.styleMapInterpolate2,Identifiers.styleMapInterpolate3,Identifiers.styleMapInterpolate4,Identifiers.styleMapInterpolate5,Identifiers.styleMapInterpolate6,Identifiers.styleMapInterpolate7,Identifiers.styleMapInterpolate8],variable:Identifiers.styleMapInterpolateV,mapping:n=>{if(n%2===0){throw new Error(`Expected odd number of arguments`)}return(n-1)/2}};const CLASS_MAP_INTERPOLATE_CONFIG={constant:[Identifiers.classMap,Identifiers.classMapInterpolate1,Identifiers.classMapInterpolate2,Identifiers.classMapInterpolate3,Identifiers.classMapInterpolate4,Identifiers.classMapInterpolate5,Identifiers.classMapInterpolate6,Identifiers.classMapInterpolate7,Identifiers.classMapInterpolate8],variable:Identifiers.classMapInterpolateV,mapping:n=>{if(n%2===0){throw new Error(`Expected odd number of arguments`)}return(n-1)/2}};const PURE_FUNCTION_CONFIG={constant:[Identifiers.pureFunction0,Identifiers.pureFunction1,Identifiers.pureFunction2,Identifiers.pureFunction3,Identifiers.pureFunction4,Identifiers.pureFunction5,Identifiers.pureFunction6,Identifiers.pureFunction7,Identifiers.pureFunction8],variable:Identifiers.pureFunctionV,mapping:n=>n};function callVariadicInstructionExpr(config,baseArgs,interpolationArgs,extraArgs,sourceSpan){const n=config.mapping(interpolationArgs.length);if(n<config.constant.length){return importExpr(config.constant[n]).callFn([...baseArgs,...interpolationArgs,...extraArgs],sourceSpan)}else if(config.variable!==null){return importExpr(config.variable).callFn([...baseArgs,literalArr(interpolationArgs),...extraArgs],sourceSpan)}else{throw new Error(`AssertionError: unable to call variadic function`)}}function callVariadicInstruction(config,baseArgs,interpolationArgs,extraArgs,sourceSpan){return createStatementOp(callVariadicInstructionExpr(config,baseArgs,interpolationArgs,extraArgs,sourceSpan).toStmt())}const GLOBAL_TARGET_RESOLVERS$1=new Map([["window",Identifiers.resolveWindow],["document",Identifiers.resolveDocument],["body",Identifiers.resolveBody]]);function reify(job){for(const unit of job.units){reifyCreateOperations(unit,unit.create);reifyUpdateOperations(unit,unit.update)}}function reifyCreateOperations(unit,ops){for(const op of ops){transformExpressionsInOp(op,reifyIrExpression,VisitorContextFlag.None);switch(op.kind){case OpKind.Text:OpList.replace(op,text(op.handle.slot,op.initialValue,op.sourceSpan));break;case OpKind.ElementStart:OpList.replace(op,elementStart(op.handle.slot,op.tag,op.attributes,op.localRefs,op.startSourceSpan));break;case OpKind.Element:OpList.replace(op,element(op.handle.slot,op.tag,op.attributes,op.localRefs,op.wholeSourceSpan));break;case OpKind.ElementEnd:OpList.replace(op,elementEnd(op.sourceSpan));break;case OpKind.ContainerStart:OpList.replace(op,elementContainerStart(op.handle.slot,op.attributes,op.localRefs,op.startSourceSpan));break;case OpKind.Container:OpList.replace(op,elementContainer(op.handle.slot,op.attributes,op.localRefs,op.wholeSourceSpan));break;case OpKind.ContainerEnd:OpList.replace(op,elementContainerEnd());break;case OpKind.I18nStart:OpList.replace(op,i18nStart(op.handle.slot,op.messageIndex,op.subTemplateIndex,op.sourceSpan));break;case OpKind.I18nEnd:OpList.replace(op,i18nEnd(op.sourceSpan));break;case OpKind.I18n:OpList.replace(op,i18n(op.handle.slot,op.messageIndex,op.subTemplateIndex,op.sourceSpan));break;case OpKind.I18nAttributes:if(op.i18nAttributesConfig===null){throw new Error(`AssertionError: i18nAttributesConfig was not set`)}OpList.replace(op,i18nAttributes(op.handle.slot,op.i18nAttributesConfig));break;case OpKind.Template:if(!(unit instanceof ViewCompilationUnit)){throw new Error(`AssertionError: must be compiling a component`)}if(Array.isArray(op.localRefs)){throw new Error(`AssertionError: local refs array should have been extracted into a constant`)}const childView=unit.job.views.get(op.xref);OpList.replace(op,template(op.handle.slot,variable(childView.fnName),childView.decls,childView.vars,op.tag,op.attributes,op.localRefs,op.startSourceSpan));break;case OpKind.DisableBindings:OpList.replace(op,disableBindings());break;case OpKind.EnableBindings:OpList.replace(op,enableBindings());break;case OpKind.Pipe:OpList.replace(op,pipe(op.handle.slot,op.name));break;case OpKind.Listener:const listenerFn=reifyListenerHandler(unit,op.handlerFnName,op.handlerOps,op.consumesDollarEvent);const eventTargetResolver=op.eventTarget?GLOBAL_TARGET_RESOLVERS$1.get(op.eventTarget):null;if(eventTargetResolver===undefined){throw new Error(`Unexpected global target '${op.eventTarget}' defined for '${op.name}' event. Supported list of global targets: window,document,body.`)}OpList.replace(op,listener(op.name,listenerFn,eventTargetResolver,op.hostListener&&op.isAnimationListener,op.sourceSpan));break;case OpKind.TwoWayListener:OpList.replace(op,twoWayListener(op.name,reifyListenerHandler(unit,op.handlerFnName,op.handlerOps,true),op.sourceSpan));break;case OpKind.Variable:if(op.variable.name===null){throw new Error(`AssertionError: unnamed variable ${op.xref}`)}OpList.replace(op,createStatementOp(new DeclareVarStmt(op.variable.name,op.initializer,undefined,exports.StmtModifier.Final)));break;case OpKind.Namespace:switch(op.active){case Namespace.HTML:OpList.replace(op,namespaceHTML());break;case Namespace.SVG:OpList.replace(op,namespaceSVG());break;case Namespace.Math:OpList.replace(op,namespaceMath());break}break;case OpKind.Defer:const timerScheduling=!!op.loadingMinimumTime||!!op.loadingAfterTime||!!op.placeholderMinimumTime;OpList.replace(op,defer(op.handle.slot,op.mainSlot.slot,op.resolverFn,op.loadingSlot?.slot??null,op.placeholderSlot?.slot??null,op.errorSlot?.slot??null,op.loadingConfig,op.placeholderConfig,timerScheduling,op.sourceSpan));break;case OpKind.DeferOn:let args=[];switch(op.trigger.kind){case DeferTriggerKind.Idle:case DeferTriggerKind.Immediate:break;case DeferTriggerKind.Timer:args=[op.trigger.delay];break;case DeferTriggerKind.Interaction:case DeferTriggerKind.Hover:case DeferTriggerKind.Viewport:if(op.trigger.targetSlot?.slot==null||op.trigger.targetSlotViewSteps===null){throw new Error(`Slot or view steps not set in trigger reification for trigger kind ${op.trigger.kind}`)}args=[op.trigger.targetSlot.slot];if(op.trigger.targetSlotViewSteps!==0){args.push(op.trigger.targetSlotViewSteps)}break;default:throw new Error(`AssertionError: Unsupported reification of defer trigger kind ${op.trigger.kind}`)}OpList.replace(op,deferOn(op.trigger.kind,args,op.prefetch,op.sourceSpan));break;case OpKind.ProjectionDef:OpList.replace(op,projectionDef(op.def));break;case OpKind.Projection:if(op.handle.slot===null){throw new Error("No slot was assigned for project instruction")}OpList.replace(op,projection(op.handle.slot,op.projectionSlotIndex,op.attributes,op.sourceSpan));break;case OpKind.RepeaterCreate:if(op.handle.slot===null){throw new Error("No slot was assigned for repeater instruction")}if(!(unit instanceof ViewCompilationUnit)){throw new Error(`AssertionError: must be compiling a component`)}const repeaterView=unit.job.views.get(op.xref);if(repeaterView.fnName===null){throw new Error(`AssertionError: expected repeater primary view to have been named`)}let emptyViewFnName=null;let emptyDecls=null;let emptyVars=null;if(op.emptyView!==null){const emptyView=unit.job.views.get(op.emptyView);if(emptyView===undefined){throw new Error("AssertionError: repeater had empty view xref, but empty view was not found")}if(emptyView.fnName===null||emptyView.decls===null||emptyView.vars===null){throw new Error(`AssertionError: expected repeater empty view to have been named and counted`)}emptyViewFnName=emptyView.fnName;emptyDecls=emptyView.decls;emptyVars=emptyView.vars}OpList.replace(op,repeaterCreate(op.handle.slot,repeaterView.fnName,op.decls,op.vars,op.tag,op.attributes,op.trackByFn,op.usesComponentInstance,emptyViewFnName,emptyDecls,emptyVars,op.emptyTag,op.emptyAttributes,op.wholeSourceSpan));break;case OpKind.Statement:break;default:throw new Error(`AssertionError: Unsupported reification of create op ${OpKind[op.kind]}`)}}}function reifyUpdateOperations(_unit,ops){for(const op of ops){transformExpressionsInOp(op,reifyIrExpression,VisitorContextFlag.None);switch(op.kind){case OpKind.Advance:OpList.replace(op,advance(op.delta,op.sourceSpan));break;case OpKind.Property:if(op.expression instanceof Interpolation){OpList.replace(op,propertyInterpolate(op.name,op.expression.strings,op.expression.expressions,op.sanitizer,op.sourceSpan))}else{OpList.replace(op,property(op.name,op.expression,op.sanitizer,op.sourceSpan))}break;case OpKind.TwoWayProperty:OpList.replace(op,twoWayProperty(op.name,op.expression,op.sanitizer,op.sourceSpan));break;case OpKind.StyleProp:if(op.expression instanceof Interpolation){OpList.replace(op,stylePropInterpolate(op.name,op.expression.strings,op.expression.expressions,op.unit,op.sourceSpan))}else{OpList.replace(op,styleProp(op.name,op.expression,op.unit,op.sourceSpan))}break;case OpKind.ClassProp:OpList.replace(op,classProp(op.name,op.expression,op.sourceSpan));break;case OpKind.StyleMap:if(op.expression instanceof Interpolation){OpList.replace(op,styleMapInterpolate(op.expression.strings,op.expression.expressions,op.sourceSpan))}else{OpList.replace(op,styleMap(op.expression,op.sourceSpan))}break;case OpKind.ClassMap:if(op.expression instanceof Interpolation){OpList.replace(op,classMapInterpolate(op.expression.strings,op.expression.expressions,op.sourceSpan))}else{OpList.replace(op,classMap(op.expression,op.sourceSpan))}break;case OpKind.I18nExpression:OpList.replace(op,i18nExp(op.expression,op.sourceSpan));break;case OpKind.I18nApply:OpList.replace(op,i18nApply(op.handle.slot,op.sourceSpan));break;case OpKind.InterpolateText:OpList.replace(op,textInterpolate(op.interpolation.strings,op.interpolation.expressions,op.sourceSpan));break;case OpKind.Attribute:if(op.expression instanceof Interpolation){OpList.replace(op,attributeInterpolate(op.name,op.expression.strings,op.expression.expressions,op.sanitizer,op.sourceSpan))}else{OpList.replace(op,attribute(op.name,op.expression,op.sanitizer,op.namespace))}break;case OpKind.HostProperty:if(op.expression instanceof Interpolation){throw new Error("not yet handled")}else{if(op.isAnimationTrigger){OpList.replace(op,syntheticHostProperty(op.name,op.expression,op.sourceSpan))}else{OpList.replace(op,hostProperty(op.name,op.expression,op.sanitizer,op.sourceSpan))}}break;case OpKind.Variable:if(op.variable.name===null){throw new Error(`AssertionError: unnamed variable ${op.xref}`)}OpList.replace(op,createStatementOp(new DeclareVarStmt(op.variable.name,op.initializer,undefined,exports.StmtModifier.Final)));break;case OpKind.Conditional:if(op.processed===null){throw new Error(`Conditional test was not set.`)}if(op.targetSlot.slot===null){throw new Error(`Conditional slot was not set.`)}OpList.replace(op,conditional(op.targetSlot.slot,op.processed,op.contextValue,op.sourceSpan));break;case OpKind.Repeater:OpList.replace(op,repeater(op.collection,op.sourceSpan));break;case OpKind.DeferWhen:OpList.replace(op,deferWhen(op.prefetch,op.expr,op.sourceSpan));break;case OpKind.Statement:break;default:throw new Error(`AssertionError: Unsupported reification of update op ${OpKind[op.kind]}`)}}}function reifyIrExpression(expr){if(!isIrExpression(expr)){return expr}switch(expr.kind){case ExpressionKind.NextContext:return nextContext(expr.steps);case ExpressionKind.Reference:return reference(expr.targetSlot.slot+1+expr.offset);case ExpressionKind.LexicalRead:throw new Error(`AssertionError: unresolved LexicalRead of ${expr.name}`);case ExpressionKind.TwoWayBindingSet:throw new Error(`AssertionError: unresolved TwoWayBindingSet`);case ExpressionKind.RestoreView:if(typeof expr.view==="number"){throw new Error(`AssertionError: unresolved RestoreView`)}return restoreView(expr.view);case ExpressionKind.ResetView:return resetView(expr.expr);case ExpressionKind.GetCurrentView:return getCurrentView();case ExpressionKind.ReadVariable:if(expr.name===null){throw new Error(`Read of unnamed variable ${expr.xref}`)}return variable(expr.name);case ExpressionKind.ReadTemporaryExpr:if(expr.name===null){throw new Error(`Read of unnamed temporary ${expr.xref}`)}return variable(expr.name);case ExpressionKind.AssignTemporaryExpr:if(expr.name===null){throw new Error(`Assign of unnamed temporary ${expr.xref}`)}return variable(expr.name).set(expr.expr);case ExpressionKind.PureFunctionExpr:if(expr.fn===null){throw new Error(`AssertionError: expected PureFunctions to have been extracted`)}return pureFunction(expr.varOffset,expr.fn,expr.args);case ExpressionKind.PureFunctionParameterExpr:throw new Error(`AssertionError: expected PureFunctionParameterExpr to have been extracted`);case ExpressionKind.PipeBinding:return pipeBind(expr.targetSlot.slot,expr.varOffset,expr.args);case ExpressionKind.PipeBindingVariadic:return pipeBindV(expr.targetSlot.slot,expr.varOffset,expr.args);case ExpressionKind.SlotLiteralExpr:return literal(expr.slot.slot);default:throw new Error(`AssertionError: Unsupported reification of ir.Expression kind: ${ExpressionKind[expr.kind]}`)}}function reifyListenerHandler(unit,name,handlerOps,consumesDollarEvent){reifyUpdateOperations(unit,handlerOps);const handlerStmts=[];for(const op of handlerOps){if(op.kind!==OpKind.Statement){throw new Error(`AssertionError: expected reified statements, but found op ${OpKind[op.kind]}`)}handlerStmts.push(op.statement)}const params=[];if(consumesDollarEvent){params.push(new FnParam("$event"))}return fn(params,handlerStmts,undefined,undefined,name)}function removeEmptyBindings(job){for(const unit of job.units){for(const op of unit.update){switch(op.kind){case OpKind.Attribute:case OpKind.Binding:case OpKind.ClassProp:case OpKind.ClassMap:case OpKind.Property:case OpKind.StyleProp:case OpKind.StyleMap:if(op.expression instanceof EmptyExpr){OpList.remove(op)}break}}}}function removeI18nContexts(job){for(const unit of job.units){for(const op of unit.create){switch(op.kind){case OpKind.I18nContext:OpList.remove(op);break;case OpKind.I18nStart:op.context=null;break}}}}function removeUnusedI18nAttributesOps(job){for(const unit of job.units){const ownersWithI18nExpressions=new Set;for(const op of unit.update){switch(op.kind){case OpKind.I18nExpression:ownersWithI18nExpressions.add(op.i18nOwner)}}for(const op of unit.create){switch(op.kind){case OpKind.I18nAttributes:if(ownersWithI18nExpressions.has(op.xref)){continue}OpList.remove(op)}}}}function resolveContexts(job){for(const unit of job.units){processLexicalScope$1(unit,unit.create);processLexicalScope$1(unit,unit.update)}}function processLexicalScope$1(view,ops){const scope=new Map;scope.set(view.xref,variable("ctx"));for(const op of ops){switch(op.kind){case OpKind.Variable:switch(op.variable.kind){case SemanticVariableKind.Context:scope.set(op.variable.view,new ReadVariableExpr(op.xref));break}break;case OpKind.Listener:case OpKind.TwoWayListener:processLexicalScope$1(view,op.handlerOps);break}}if(view===view.job.root){scope.set(view.xref,variable("ctx"))}for(const op of ops){transformExpressionsInOp(op,(expr=>{if(expr instanceof ContextExpr){if(!scope.has(expr.view)){throw new Error(`No context found for reference to view ${expr.view} from view ${view.xref}`)}return scope.get(expr.view)}else{return expr}}),VisitorContextFlag.None)}}function resolveDollarEvent(job){for(const unit of job.units){transformDollarEvent(unit.create);transformDollarEvent(unit.update)}}function transformDollarEvent(ops){for(const op of ops){if(op.kind===OpKind.Listener||op.kind===OpKind.TwoWayListener){transformExpressionsInOp(op,(expr=>{if(expr instanceof LexicalReadExpr&&expr.name==="$event"){if(op.kind===OpKind.Listener){op.consumesDollarEvent=true}return new ReadVarExpr(expr.name)}return expr}),VisitorContextFlag.InChildOperation)}}}function resolveI18nElementPlaceholders(job){const i18nContexts=new Map;const elements=new Map;for(const unit of job.units){for(const op of unit.create){switch(op.kind){case OpKind.I18nContext:i18nContexts.set(op.xref,op);break;case OpKind.ElementStart:elements.set(op.xref,op);break}}}resolvePlaceholdersForView(job,job.root,i18nContexts,elements)}function resolvePlaceholdersForView(job,unit,i18nContexts,elements,pendingStructuralDirective){let currentOps=null;let pendingStructuralDirectiveCloses=new Map;for(const op of unit.create){switch(op.kind){case OpKind.I18nStart:if(!op.context){throw Error("Could not find i18n context for i18n op")}currentOps={i18nBlock:op,i18nContext:i18nContexts.get(op.context)};break;case OpKind.I18nEnd:currentOps=null;break;case OpKind.ElementStart:if(op.i18nPlaceholder!==undefined){if(currentOps===null){throw Error("i18n tag placeholder should only occur inside an i18n block")}recordElementStart(op,currentOps.i18nContext,currentOps.i18nBlock,pendingStructuralDirective);if(pendingStructuralDirective&&op.i18nPlaceholder.closeName){pendingStructuralDirectiveCloses.set(op.xref,pendingStructuralDirective)}pendingStructuralDirective=undefined}break;case OpKind.ElementEnd:const startOp=elements.get(op.xref);if(startOp&&startOp.i18nPlaceholder!==undefined){if(currentOps===null){throw Error("AssertionError: i18n tag placeholder should only occur inside an i18n block")}recordElementClose(startOp,currentOps.i18nContext,currentOps.i18nBlock,pendingStructuralDirectiveCloses.get(op.xref));pendingStructuralDirectiveCloses.delete(op.xref)}break;case OpKind.Projection:if(op.i18nPlaceholder!==undefined){if(currentOps===null){throw Error("i18n tag placeholder should only occur inside an i18n block")}recordElementStart(op,currentOps.i18nContext,currentOps.i18nBlock,pendingStructuralDirective);recordElementClose(op,currentOps.i18nContext,currentOps.i18nBlock,pendingStructuralDirective);pendingStructuralDirective=undefined}break;case OpKind.Template:const view=job.views.get(op.xref);if(op.i18nPlaceholder===undefined){resolvePlaceholdersForView(job,view,i18nContexts,elements)}else{if(currentOps===null){throw Error("i18n tag placeholder should only occur inside an i18n block")}if(op.templateKind===TemplateKind.Structural){resolvePlaceholdersForView(job,view,i18nContexts,elements,op)}else{recordTemplateStart(job,view,op.handle.slot,op.i18nPlaceholder,currentOps.i18nContext,currentOps.i18nBlock,pendingStructuralDirective);resolvePlaceholdersForView(job,view,i18nContexts,elements);recordTemplateClose(job,view,op.handle.slot,op.i18nPlaceholder,currentOps.i18nContext,currentOps.i18nBlock,pendingStructuralDirective);pendingStructuralDirective=undefined}}break;case OpKind.RepeaterCreate:if(pendingStructuralDirective!==undefined){throw Error("AssertionError: Unexpected structural directive associated with @for block")}const forSlot=op.handle.slot+1;const forView=job.views.get(op.xref);if(op.i18nPlaceholder===undefined){resolvePlaceholdersForView(job,forView,i18nContexts,elements)}else{if(currentOps===null){throw Error("i18n tag placeholder should only occur inside an i18n block")}recordTemplateStart(job,forView,forSlot,op.i18nPlaceholder,currentOps.i18nContext,currentOps.i18nBlock,pendingStructuralDirective);resolvePlaceholdersForView(job,forView,i18nContexts,elements);recordTemplateClose(job,forView,forSlot,op.i18nPlaceholder,currentOps.i18nContext,currentOps.i18nBlock,pendingStructuralDirective);pendingStructuralDirective=undefined}if(op.emptyView!==null){const emptySlot=op.handle.slot+2;const emptyView=job.views.get(op.emptyView);if(op.emptyI18nPlaceholder===undefined){resolvePlaceholdersForView(job,emptyView,i18nContexts,elements)}else{if(currentOps===null){throw Error("i18n tag placeholder should only occur inside an i18n block")}recordTemplateStart(job,emptyView,emptySlot,op.emptyI18nPlaceholder,currentOps.i18nContext,currentOps.i18nBlock,pendingStructuralDirective);resolvePlaceholdersForView(job,emptyView,i18nContexts,elements);recordTemplateClose(job,emptyView,emptySlot,op.emptyI18nPlaceholder,currentOps.i18nContext,currentOps.i18nBlock,pendingStructuralDirective);pendingStructuralDirective=undefined}}break}}}function recordElementStart(op,i18nContext,i18nBlock,structuralDirective){const{startName:startName,closeName:closeName}=op.i18nPlaceholder;let flags=I18nParamValueFlags.ElementTag|I18nParamValueFlags.OpenTag;let value=op.handle.slot;if(structuralDirective!==undefined){flags|=I18nParamValueFlags.TemplateTag;value={element:value,template:structuralDirective.handle.slot}}if(!closeName){flags|=I18nParamValueFlags.CloseTag}addParam(i18nContext.params,startName,value,i18nBlock.subTemplateIndex,flags)}function recordElementClose(op,i18nContext,i18nBlock,structuralDirective){const{closeName:closeName}=op.i18nPlaceholder;if(closeName){let flags=I18nParamValueFlags.ElementTag|I18nParamValueFlags.CloseTag;let value=op.handle.slot;if(structuralDirective!==undefined){flags|=I18nParamValueFlags.TemplateTag;value={element:value,template:structuralDirective.handle.slot}}addParam(i18nContext.params,closeName,value,i18nBlock.subTemplateIndex,flags)}}function recordTemplateStart(job,view,slot,i18nPlaceholder,i18nContext,i18nBlock,structuralDirective){let{startName:startName,closeName:closeName}=i18nPlaceholder;let flags=I18nParamValueFlags.TemplateTag|I18nParamValueFlags.OpenTag;if(!closeName){flags|=I18nParamValueFlags.CloseTag}if(structuralDirective!==undefined){addParam(i18nContext.params,startName,structuralDirective.handle.slot,i18nBlock.subTemplateIndex,flags)}addParam(i18nContext.params,startName,slot,getSubTemplateIndexForTemplateTag(job,i18nBlock,view),flags)}function recordTemplateClose(job,view,slot,i18nPlaceholder,i18nContext,i18nBlock,structuralDirective){const{closeName:closeName}=i18nPlaceholder;const flags=I18nParamValueFlags.TemplateTag|I18nParamValueFlags.CloseTag;if(closeName){addParam(i18nContext.params,closeName,slot,getSubTemplateIndexForTemplateTag(job,i18nBlock,view),flags);if(structuralDirective!==undefined){addParam(i18nContext.params,closeName,structuralDirective.handle.slot,i18nBlock.subTemplateIndex,flags)}}}function getSubTemplateIndexForTemplateTag(job,i18nOp,view){for(const childOp of view.create){if(childOp.kind===OpKind.I18nStart){return childOp.subTemplateIndex}}return i18nOp.subTemplateIndex}function addParam(params,placeholder,value,subTemplateIndex,flags){const values=params.get(placeholder)??[];values.push({value:value,subTemplateIndex:subTemplateIndex,flags:flags});params.set(placeholder,values)}function resolveI18nExpressionPlaceholders(job){const subTemplateIndices=new Map;const i18nContexts=new Map;const icuPlaceholders=new Map;for(const unit of job.units){for(const op of unit.create){switch(op.kind){case OpKind.I18nStart:subTemplateIndices.set(op.xref,op.subTemplateIndex);break;case OpKind.I18nContext:i18nContexts.set(op.xref,op);break;case OpKind.IcuPlaceholder:icuPlaceholders.set(op.xref,op);break}}}const expressionIndices=new Map;const referenceIndex=op=>op.usage===I18nExpressionFor.I18nText?op.i18nOwner:op.context;for(const unit of job.units){for(const op of unit.update){if(op.kind===OpKind.I18nExpression){const index=expressionIndices.get(referenceIndex(op))||0;const subTemplateIndex=subTemplateIndices.get(op.i18nOwner)??null;const value={value:index,subTemplateIndex:subTemplateIndex,flags:I18nParamValueFlags.ExpressionIndex};updatePlaceholder(op,value,i18nContexts,icuPlaceholders);expressionIndices.set(referenceIndex(op),index+1)}}}}function updatePlaceholder(op,value,i18nContexts,icuPlaceholders){if(op.i18nPlaceholder!==null){const i18nContext=i18nContexts.get(op.context);const params=op.resolutionTime===I18nParamResolutionTime.Creation?i18nContext.params:i18nContext.postprocessingParams;const values=params.get(op.i18nPlaceholder)||[];values.push(value);params.set(op.i18nPlaceholder,values)}if(op.icuPlaceholder!==null){const icuPlaceholderOp=icuPlaceholders.get(op.icuPlaceholder);icuPlaceholderOp?.expressionPlaceholders.push(value)}}function resolveNames(job){for(const unit of job.units){processLexicalScope(unit,unit.create,null);processLexicalScope(unit,unit.update,null)}}function processLexicalScope(unit,ops,savedView){const scope=new Map;for(const op of ops){switch(op.kind){case OpKind.Variable:switch(op.variable.kind){case SemanticVariableKind.Identifier:case SemanticVariableKind.Alias:if(scope.has(op.variable.identifier)){continue}scope.set(op.variable.identifier,op.xref);break;case SemanticVariableKind.SavedView:savedView={view:op.variable.view,variable:op.xref};break}break;case OpKind.Listener:case OpKind.TwoWayListener:processLexicalScope(unit,op.handlerOps,savedView);break}}for(const op of ops){if(op.kind==OpKind.Listener||op.kind===OpKind.TwoWayListener){continue}transformExpressionsInOp(op,(expr=>{if(expr instanceof LexicalReadExpr){if(scope.has(expr.name)){return new ReadVariableExpr(scope.get(expr.name))}else{return new ReadPropExpr(new ContextExpr(unit.job.root.xref),expr.name)}}else if(expr instanceof RestoreViewExpr&&typeof expr.view==="number"){if(savedView===null||savedView.view!==expr.view){throw new Error(`AssertionError: no saved view ${expr.view} from view ${unit.xref}`)}expr.view=new ReadVariableExpr(savedView.variable);return expr}else{return expr}}),VisitorContextFlag.None)}for(const op of ops){visitExpressionsInOp(op,(expr=>{if(expr instanceof LexicalReadExpr){throw new Error(`AssertionError: no lexical reads should remain, but found read of ${expr.name}`)}}))}}const sanitizerFns=new Map([[SecurityContext.HTML,Identifiers.sanitizeHtml],[SecurityContext.RESOURCE_URL,Identifiers.sanitizeResourceUrl],[SecurityContext.SCRIPT,Identifiers.sanitizeScript],[SecurityContext.STYLE,Identifiers.sanitizeStyle],[SecurityContext.URL,Identifiers.sanitizeUrl]]);const trustedValueFns=new Map([[SecurityContext.HTML,Identifiers.trustConstantHtml],[SecurityContext.RESOURCE_URL,Identifiers.trustConstantResourceUrl]]);function resolveSanitizers(job){for(const unit of job.units){const elements=createOpXrefMap(unit);if(job.kind!==CompilationJobKind.Host){for(const op of unit.create){if(op.kind===OpKind.ExtractedAttribute){const trustedValueFn=trustedValueFns.get(getOnlySecurityContext(op.securityContext))??null;op.trustedValueFn=trustedValueFn!==null?importExpr(trustedValueFn):null}}}for(const op of unit.update){switch(op.kind){case OpKind.Property:case OpKind.Attribute:case OpKind.HostProperty:let sanitizerFn=null;if(Array.isArray(op.securityContext)&&op.securityContext.length===2&&op.securityContext.indexOf(SecurityContext.URL)>-1&&op.securityContext.indexOf(SecurityContext.RESOURCE_URL)>-1){sanitizerFn=Identifiers.sanitizeUrlOrResourceUrl}else{sanitizerFn=sanitizerFns.get(getOnlySecurityContext(op.securityContext))??null}op.sanitizer=sanitizerFn!==null?importExpr(sanitizerFn):null;if(op.sanitizer===null){let isIframe=false;if(job.kind===CompilationJobKind.Host||op.kind===OpKind.HostProperty){isIframe=true}else{const ownerOp=elements.get(op.target);if(ownerOp===undefined||!isElementOrContainerOp(ownerOp)){throw Error("Property should have an element-like owner")}isIframe=isIframeElement$1(ownerOp)}if(isIframe&&isIframeSecuritySensitiveAttr(op.name)){op.sanitizer=importExpr(Identifiers.validateIframeAttribute)}}break}}}}function isIframeElement$1(op){return op.kind===OpKind.ElementStart&&op.tag?.toLowerCase()==="iframe"}function getOnlySecurityContext(securityContext){if(Array.isArray(securityContext)){if(securityContext.length>1){throw Error(`AssertionError: Ambiguous security context`)}return securityContext[0]||SecurityContext.NONE}return securityContext}function transformTwoWayBindingSet(job){for(const unit of job.units){for(const op of unit.create){if(op.kind===OpKind.TwoWayListener){transformExpressionsInOp(op,(expr=>{if(expr instanceof TwoWayBindingSetExpr){return wrapAction(expr.target,expr.value)}return expr}),VisitorContextFlag.InChildOperation)}}}}function wrapSetOperation(target,value){if(target instanceof ReadVariableExpr){return twoWayBindingSet(target,value)}return twoWayBindingSet(target,value).or(target.set(value))}function isReadExpression(value){return value instanceof ReadPropExpr||value instanceof ReadKeyExpr||value instanceof ReadVariableExpr}function wrapAction(target,value){if(isReadExpression(target)){return wrapSetOperation(target,value)}if(target instanceof BinaryOperatorExpr&&isReadExpression(target.rhs)){return new BinaryOperatorExpr(target.operator,target.lhs,wrapSetOperation(target.rhs,value))}if(target instanceof ConditionalExpr&&isReadExpression(target.falseCase)){return new ConditionalExpr(target.condition,target.trueCase,wrapSetOperation(target.falseCase,value))}if(target instanceof NotExpr){let expr=target.condition;while(true){if(expr instanceof NotExpr){expr=expr.condition}else{if(isReadExpression(expr)){return wrapSetOperation(expr,value)}break}}}throw new Error(`Unsupported expression in two-way action binding.`)}function saveAndRestoreView(job){for(const unit of job.units){unit.create.prepend([createVariableOp(unit.job.allocateXrefId(),{kind:SemanticVariableKind.SavedView,name:null,view:unit.xref},new GetCurrentViewExpr,VariableFlags.None)]);for(const op of unit.create){if(op.kind!==OpKind.Listener&&op.kind!==OpKind.TwoWayListener){continue}let needsRestoreView=unit!==job.root;if(!needsRestoreView){for(const handlerOp of op.handlerOps){visitExpressionsInOp(handlerOp,(expr=>{if(expr instanceof ReferenceExpr){needsRestoreView=true}}))}}if(needsRestoreView){addSaveRestoreViewOperationToListener(unit,op)}}}}function addSaveRestoreViewOperationToListener(unit,op){op.handlerOps.prepend([createVariableOp(unit.job.allocateXrefId(),{kind:SemanticVariableKind.Context,name:null,view:unit.xref},new RestoreViewExpr(unit.xref),VariableFlags.None)]);for(const handlerOp of op.handlerOps){if(handlerOp.kind===OpKind.Statement&&handlerOp.statement instanceof ReturnStatement){handlerOp.statement.value=new ResetViewExpr(handlerOp.statement.value)}}}function allocateSlots(job){const slotMap=new Map;for(const unit of job.units){let slotCount=0;for(const op of unit.create){if(!hasConsumesSlotTrait(op)){continue}op.handle.slot=slotCount;slotMap.set(op.xref,op.handle.slot);slotCount+=op.numSlotsUsed}unit.decls=slotCount}for(const unit of job.units){for(const op of unit.ops()){if(op.kind===OpKind.Template||op.kind===OpKind.RepeaterCreate){const childView=job.views.get(op.xref);op.decls=childView.decls}}}}function specializeStyleBindings(job){for(const unit of job.units){for(const op of unit.update){if(op.kind!==OpKind.Binding){continue}switch(op.bindingKind){case BindingKind.ClassName:if(op.expression instanceof Interpolation){throw new Error(`Unexpected interpolation in ClassName binding`)}OpList.replace(op,createClassPropOp(op.target,op.name,op.expression,op.sourceSpan));break;case BindingKind.StyleProperty:OpList.replace(op,createStylePropOp(op.target,op.name,op.expression,op.unit,op.sourceSpan));break;case BindingKind.Property:case BindingKind.Template:if(op.name==="style"){OpList.replace(op,createStyleMapOp(op.target,op.expression,op.sourceSpan))}else if(op.name==="class"){OpList.replace(op,createClassMapOp(op.target,op.expression,op.sourceSpan))}break}}}}function generateTemporaryVariables(job){for(const unit of job.units){unit.create.prepend(generateTemporaries(unit.create));unit.update.prepend(generateTemporaries(unit.update))}}function generateTemporaries(ops){let opCount=0;let generatedStatements=[];for(const op of ops){const finalReads=new Map;visitExpressionsInOp(op,((expr,flag)=>{if(flag&VisitorContextFlag.InChildOperation){return}if(expr instanceof ReadTemporaryExpr){finalReads.set(expr.xref,expr)}}));let count=0;const assigned=new Set;const released=new Set;const defs=new Map;visitExpressionsInOp(op,((expr,flag)=>{if(flag&VisitorContextFlag.InChildOperation){return}if(expr instanceof AssignTemporaryExpr){if(!assigned.has(expr.xref)){assigned.add(expr.xref);defs.set(expr.xref,`tmp_${opCount}_${count++}`)}assignName(defs,expr)}else if(expr instanceof ReadTemporaryExpr){if(finalReads.get(expr.xref)===expr){released.add(expr.xref);count--}assignName(defs,expr)}}));generatedStatements.push(...Array.from(new Set(defs.values())).map((name=>createStatementOp(new DeclareVarStmt(name)))));opCount++;if(op.kind===OpKind.Listener||op.kind===OpKind.TwoWayListener){op.handlerOps.prepend(generateTemporaries(op.handlerOps))}}return generatedStatements}function assignName(names,expr){const name=names.get(expr.xref);if(name===undefined){throw new Error(`Found xref with unassigned name: ${expr.xref}`)}expr.name=name}function generateTrackFns(job){for(const unit of job.units){for(const op of unit.create){if(op.kind!==OpKind.RepeaterCreate){continue}if(op.trackByFn!==null){continue}let usesComponentContext=false;op.track=transformExpressionsInExpression(op.track,(expr=>{if(expr instanceof PipeBindingExpr||expr instanceof PipeBindingVariadicExpr){throw new Error(`Illegal State: Pipes are not allowed in this context`)}if(expr instanceof TrackContextExpr){usesComponentContext=true;return variable("this")}return expr}),VisitorContextFlag.None);let fn;const fnParams=[new FnParam("$index"),new FnParam("$item")];if(usesComponentContext){fn=new FunctionExpr(fnParams,[new ReturnStatement(op.track)])}else{fn=arrowFn(fnParams,op.track)}op.trackByFn=job.pool.getSharedFunctionReference(fn,"_forTrack")}}}function optimizeTrackFns(job){for(const unit of job.units){for(const op of unit.create){if(op.kind!==OpKind.RepeaterCreate){continue}if(op.track instanceof ReadVarExpr&&op.track.name==="$index"){op.trackByFn=importExpr(Identifiers.repeaterTrackByIndex)}else if(op.track instanceof ReadVarExpr&&op.track.name==="$item"){op.trackByFn=importExpr(Identifiers.repeaterTrackByIdentity)}else if(isTrackByFunctionCall(job.root.xref,op.track)){op.usesComponentInstance=true;if(op.track.receiver.receiver.view===unit.xref){op.trackByFn=op.track.receiver}else{op.trackByFn=importExpr(Identifiers.componentInstance).callFn([]).prop(op.track.receiver.name);op.track=op.trackByFn}}else{op.track=transformExpressionsInExpression(op.track,(expr=>{if(expr instanceof ContextExpr){op.usesComponentInstance=true;return new TrackContextExpr(expr.view)}return expr}),VisitorContextFlag.None)}}}}function isTrackByFunctionCall(rootView,expr){if(!(expr instanceof InvokeFunctionExpr)||expr.args.length!==2){return false}if(!(expr.receiver instanceof ReadPropExpr&&expr.receiver.receiver instanceof ContextExpr)||expr.receiver.receiver.view!==rootView){return false}const[arg0,arg1]=expr.args;if(!(arg0 instanceof ReadVarExpr)||arg0.name!=="$index"){return false}if(!(arg1 instanceof ReadVarExpr)||arg1.name!=="$item"){return false}return true}function generateTrackVariables(job){for(const unit of job.units){for(const op of unit.create){if(op.kind!==OpKind.RepeaterCreate){continue}op.track=transformExpressionsInExpression(op.track,(expr=>{if(expr instanceof LexicalReadExpr){if(expr.name===op.varNames.$index){return variable("$index")}else if(expr.name===op.varNames.$implicit){return variable("$item")}}return expr}),VisitorContextFlag.None)}}}function countVariables(job){for(const unit of job.units){let varCount=0;for(const op of unit.ops()){if(hasConsumesVarsTrait(op)){varCount+=varsUsedByOp(op)}}for(const op of unit.ops()){visitExpressionsInOp(op,(expr=>{if(!isIrExpression(expr)){return}if(job.compatibility===CompatibilityMode.TemplateDefinitionBuilder&&expr instanceof PureFunctionExpr){return}if(hasUsesVarOffsetTrait(expr)){expr.varOffset=varCount}if(hasConsumesVarsTrait(expr)){varCount+=varsUsedByIrExpression(expr)}}))}if(job.compatibility===CompatibilityMode.TemplateDefinitionBuilder){for(const op of unit.ops()){visitExpressionsInOp(op,(expr=>{if(!isIrExpression(expr)||!(expr instanceof PureFunctionExpr)){return}if(hasUsesVarOffsetTrait(expr)){expr.varOffset=varCount}if(hasConsumesVarsTrait(expr)){varCount+=varsUsedByIrExpression(expr)}}))}}unit.vars=varCount}if(job instanceof ComponentCompilationJob){for(const unit of job.units){for(const op of unit.create){if(op.kind!==OpKind.Template&&op.kind!==OpKind.RepeaterCreate){continue}const childView=job.views.get(op.xref);op.vars=childView.vars}}}}function varsUsedByOp(op){let slots;switch(op.kind){case OpKind.Property:case OpKind.HostProperty:case OpKind.Attribute:slots=1;if(op.expression instanceof Interpolation&&!isSingletonInterpolation(op.expression)){slots+=op.expression.expressions.length}return slots;case OpKind.TwoWayProperty:return 1;case OpKind.StyleProp:case OpKind.ClassProp:case OpKind.StyleMap:case OpKind.ClassMap:slots=2;if(op.expression instanceof Interpolation){slots+=op.expression.expressions.length}return slots;case OpKind.InterpolateText:return op.interpolation.expressions.length;case OpKind.I18nExpression:case OpKind.Conditional:case OpKind.DeferWhen:return 1;case OpKind.RepeaterCreate:return op.emptyView?1:0;default:throw new Error(`Unhandled op: ${OpKind[op.kind]}`)}}function varsUsedByIrExpression(expr){switch(expr.kind){case ExpressionKind.PureFunctionExpr:return 1+expr.args.length;case ExpressionKind.PipeBinding:return 1+expr.args.length;case ExpressionKind.PipeBindingVariadic:return 1+expr.numArgs;default:throw new Error(`AssertionError: unhandled ConsumesVarsTrait expression ${expr.constructor.name}`)}}function isSingletonInterpolation(expr){if(expr.expressions.length!==1||expr.strings.length!==2){return false}if(expr.strings[0]!==""||expr.strings[1]!==""){return false}return true}function optimizeVariables(job){for(const unit of job.units){inlineAlwaysInlineVariables(unit.create);inlineAlwaysInlineVariables(unit.update);for(const op of unit.create){if(op.kind===OpKind.Listener||op.kind===OpKind.TwoWayListener){inlineAlwaysInlineVariables(op.handlerOps)}}optimizeVariablesInOpList(unit.create,job.compatibility);optimizeVariablesInOpList(unit.update,job.compatibility);for(const op of unit.create){if(op.kind===OpKind.Listener||op.kind===OpKind.TwoWayListener){optimizeVariablesInOpList(op.handlerOps,job.compatibility)}}}}var Fence;(function(Fence){Fence[Fence["None"]=0]="None";Fence[Fence["ViewContextRead"]=1]="ViewContextRead";Fence[Fence["ViewContextWrite"]=2]="ViewContextWrite";Fence[Fence["SideEffectful"]=4]="SideEffectful"})(Fence||(Fence={}));function inlineAlwaysInlineVariables(ops){const vars=new Map;for(const op of ops){if(op.kind===OpKind.Variable&&op.flags&VariableFlags.AlwaysInline){visitExpressionsInOp(op,(expr=>{if(isIrExpression(expr)&&fencesForIrExpression(expr)!==Fence.None){throw new Error(`AssertionError: A context-sensitive variable was marked AlwaysInline`)}}));vars.set(op.xref,op)}transformExpressionsInOp(op,(expr=>{if(expr instanceof ReadVariableExpr&&vars.has(expr.xref)){const varOp=vars.get(expr.xref);return varOp.initializer.clone()}return expr}),VisitorContextFlag.None)}for(const op of vars.values()){OpList.remove(op)}}function optimizeVariablesInOpList(ops,compatibility){const varDecls=new Map;const varUsages=new Map;const varRemoteUsages=new Set;const opMap=new Map;for(const op of ops){if(op.kind===OpKind.Variable){if(varDecls.has(op.xref)||varUsages.has(op.xref)){throw new Error(`Should not see two declarations of the same variable: ${op.xref}`)}varDecls.set(op.xref,op);varUsages.set(op.xref,0)}opMap.set(op,collectOpInfo(op));countVariableUsages(op,varUsages,varRemoteUsages)}let contextIsUsed=false;for(const op of ops.reversed()){const opInfo=opMap.get(op);if(op.kind===OpKind.Variable&&varUsages.get(op.xref)===0){if(contextIsUsed&&opInfo.fences&Fence.ViewContextWrite||opInfo.fences&Fence.SideEffectful){const stmtOp=createStatementOp(op.initializer.toStmt());opMap.set(stmtOp,opInfo);OpList.replace(op,stmtOp)}else{uncountVariableUsages(op,varUsages);OpList.remove(op)}opMap.delete(op);varDecls.delete(op.xref);varUsages.delete(op.xref);continue}if(opInfo.fences&Fence.ViewContextRead){contextIsUsed=true}}const toInline=[];for(const[id,count]of varUsages){const decl=varDecls.get(id);const isAlwaysInline=!!(decl.flags&VariableFlags.AlwaysInline);if(count!==1||isAlwaysInline){continue}if(varRemoteUsages.has(id)){continue}toInline.push(id)}let candidate;while(candidate=toInline.pop()){const decl=varDecls.get(candidate);const varInfo=opMap.get(decl);const isAlwaysInline=!!(decl.flags&VariableFlags.AlwaysInline);if(isAlwaysInline){throw new Error(`AssertionError: Found an 'AlwaysInline' variable after the always inlining pass.`)}for(let targetOp=decl.next;targetOp.kind!==OpKind.ListEnd;targetOp=targetOp.next){const opInfo=opMap.get(targetOp);if(opInfo.variablesUsed.has(candidate)){if(compatibility===CompatibilityMode.TemplateDefinitionBuilder&&!allowConservativeInlining(decl,targetOp)){break}if(tryInlineVariableInitializer(candidate,decl.initializer,targetOp,varInfo.fences)){opInfo.variablesUsed.delete(candidate);for(const id of varInfo.variablesUsed){opInfo.variablesUsed.add(id)}opInfo.fences|=varInfo.fences;varDecls.delete(candidate);varUsages.delete(candidate);opMap.delete(decl);OpList.remove(decl)}break}if(!safeToInlinePastFences(opInfo.fences,varInfo.fences)){break}}}}function fencesForIrExpression(expr){switch(expr.kind){case ExpressionKind.NextContext:return Fence.ViewContextRead|Fence.ViewContextWrite;case ExpressionKind.RestoreView:return Fence.ViewContextRead|Fence.ViewContextWrite|Fence.SideEffectful;case ExpressionKind.Reference:return Fence.ViewContextRead;default:return Fence.None}}function collectOpInfo(op){let fences=Fence.None;const variablesUsed=new Set;visitExpressionsInOp(op,(expr=>{if(!isIrExpression(expr)){return}switch(expr.kind){case ExpressionKind.ReadVariable:variablesUsed.add(expr.xref);break;default:fences|=fencesForIrExpression(expr)}}));return{fences:fences,variablesUsed:variablesUsed}}function countVariableUsages(op,varUsages,varRemoteUsage){visitExpressionsInOp(op,((expr,flags)=>{if(!isIrExpression(expr)){return}if(expr.kind!==ExpressionKind.ReadVariable){return}const count=varUsages.get(expr.xref);if(count===undefined){return}varUsages.set(expr.xref,count+1);if(flags&VisitorContextFlag.InChildOperation){varRemoteUsage.add(expr.xref)}}))}function uncountVariableUsages(op,varUsages){visitExpressionsInOp(op,(expr=>{if(!isIrExpression(expr)){return}if(expr.kind!==ExpressionKind.ReadVariable){return}const count=varUsages.get(expr.xref);if(count===undefined){return}else if(count===0){throw new Error(`Inaccurate variable count: ${expr.xref} - found another read but count is already 0`)}varUsages.set(expr.xref,count-1)}))}function safeToInlinePastFences(fences,declFences){if(fences&Fence.ViewContextWrite){if(declFences&Fence.ViewContextRead){return false}}else if(fences&Fence.ViewContextRead){if(declFences&Fence.ViewContextWrite){return false}}return true}function tryInlineVariableInitializer(id,initializer,target,declFences){let inlined=false;let inliningAllowed=true;transformExpressionsInOp(target,((expr,flags)=>{if(!isIrExpression(expr)){return expr}if(inlined||!inliningAllowed){return expr}else if(flags&VisitorContextFlag.InChildOperation&&declFences&Fence.ViewContextRead){return expr}switch(expr.kind){case ExpressionKind.ReadVariable:if(expr.xref===id){inlined=true;return initializer}break;default:const exprFences=fencesForIrExpression(expr);inliningAllowed=inliningAllowed&&safeToInlinePastFences(exprFences,declFences);break}return expr}),VisitorContextFlag.None);return inlined}function allowConservativeInlining(decl,target){switch(decl.variable.kind){case SemanticVariableKind.Identifier:if(decl.initializer instanceof ReadVarExpr&&decl.initializer.name==="ctx"){return true}return false;case SemanticVariableKind.Context:return target.kind===OpKind.Variable;default:return true}}function wrapI18nIcus(job){for(const unit of job.units){let currentI18nOp=null;let addedI18nId=null;for(const op of unit.create){switch(op.kind){case OpKind.I18nStart:currentI18nOp=op;break;case OpKind.I18nEnd:currentI18nOp=null;break;case OpKind.IcuStart:if(currentI18nOp===null){addedI18nId=job.allocateXrefId();OpList.insertBefore(createI18nStartOp(addedI18nId,op.message,undefined,null),op)}break;case OpKind.IcuEnd:if(addedI18nId!==null){OpList.insertAfter(createI18nEndOp(addedI18nId,null),op);addedI18nId=null}break}}}}
|
|
438
|
+
*/const _SELECTOR_REGEXP=new RegExp("(\\:not\\()|"+"(([\\.\\#]?)[-\\w]+)|"+"(?:\\[([-.\\w*\\\\$]+)(?:=([\"']?)([^\\]\"']*)\\5)?\\])|"+"(\\))|"+"(\\s*,\\s*)","g");class CssSelector{constructor(){this.element=null;this.classNames=[];this.attrs=[];this.notSelectors=[]}static parse(selector){const results=[];const _addResult=(res,cssSel)=>{if(cssSel.notSelectors.length>0&&!cssSel.element&&cssSel.classNames.length==0&&cssSel.attrs.length==0){cssSel.element="*"}res.push(cssSel)};let cssSelector=new CssSelector;let match;let current=cssSelector;let inNot=false;_SELECTOR_REGEXP.lastIndex=0;while(match=_SELECTOR_REGEXP.exec(selector)){if(match[1]){if(inNot){throw new Error("Nesting :not in a selector is not allowed")}inNot=true;current=new CssSelector;cssSelector.notSelectors.push(current)}const tag=match[2];if(tag){const prefix=match[3];if(prefix==="#"){current.addAttribute("id",tag.slice(1))}else if(prefix==="."){current.addClassName(tag.slice(1))}else{current.setElement(tag)}}const attribute=match[4];if(attribute){current.addAttribute(current.unescapeAttribute(attribute),match[6])}if(match[7]){inNot=false;current=cssSelector}if(match[8]){if(inNot){throw new Error("Multiple selectors in :not are not supported")}_addResult(results,cssSelector);cssSelector=current=new CssSelector}}_addResult(results,cssSelector);return results}unescapeAttribute(attr){let result="";let escaping=false;for(let i=0;i<attr.length;i++){const char=attr.charAt(i);if(char==="\\"){escaping=true;continue}if(char==="$"&&!escaping){throw new Error(`Error in attribute selector "${attr}". `+`Unescaped "$" is not supported. Please escape with "\\$".`)}escaping=false;result+=char}return result}escapeAttribute(attr){return attr.replace(/\\/g,"\\\\").replace(/\$/g,"\\$")}isElementSelector(){return this.hasElementSelector()&&this.classNames.length==0&&this.attrs.length==0&&this.notSelectors.length===0}hasElementSelector(){return!!this.element}setElement(element=null){this.element=element}getAttrs(){const result=[];if(this.classNames.length>0){result.push("class",this.classNames.join(" "))}return result.concat(this.attrs)}addAttribute(name,value=""){this.attrs.push(name,value&&value.toLowerCase()||"")}addClassName(name){this.classNames.push(name.toLowerCase())}toString(){let res=this.element||"";if(this.classNames){this.classNames.forEach((klass=>res+=`.${klass}`))}if(this.attrs){for(let i=0;i<this.attrs.length;i+=2){const name=this.escapeAttribute(this.attrs[i]);const value=this.attrs[i+1];res+=`[${name}${value?"="+value:""}]`}}this.notSelectors.forEach((notSelector=>res+=`:not(${notSelector})`));return res}}class SelectorMatcher{constructor(){this._elementMap=new Map;this._elementPartialMap=new Map;this._classMap=new Map;this._classPartialMap=new Map;this._attrValueMap=new Map;this._attrValuePartialMap=new Map;this._listContexts=[]}static createNotMatcher(notSelectors){const notMatcher=new SelectorMatcher;notMatcher.addSelectables(notSelectors,null);return notMatcher}addSelectables(cssSelectors,callbackCtxt){let listContext=null;if(cssSelectors.length>1){listContext=new SelectorListContext(cssSelectors);this._listContexts.push(listContext)}for(let i=0;i<cssSelectors.length;i++){this._addSelectable(cssSelectors[i],callbackCtxt,listContext)}}_addSelectable(cssSelector,callbackCtxt,listContext){let matcher=this;const element=cssSelector.element;const classNames=cssSelector.classNames;const attrs=cssSelector.attrs;const selectable=new SelectorContext(cssSelector,callbackCtxt,listContext);if(element){const isTerminal=attrs.length===0&&classNames.length===0;if(isTerminal){this._addTerminal(matcher._elementMap,element,selectable)}else{matcher=this._addPartial(matcher._elementPartialMap,element)}}if(classNames){for(let i=0;i<classNames.length;i++){const isTerminal=attrs.length===0&&i===classNames.length-1;const className=classNames[i];if(isTerminal){this._addTerminal(matcher._classMap,className,selectable)}else{matcher=this._addPartial(matcher._classPartialMap,className)}}}if(attrs){for(let i=0;i<attrs.length;i+=2){const isTerminal=i===attrs.length-2;const name=attrs[i];const value=attrs[i+1];if(isTerminal){const terminalMap=matcher._attrValueMap;let terminalValuesMap=terminalMap.get(name);if(!terminalValuesMap){terminalValuesMap=new Map;terminalMap.set(name,terminalValuesMap)}this._addTerminal(terminalValuesMap,value,selectable)}else{const partialMap=matcher._attrValuePartialMap;let partialValuesMap=partialMap.get(name);if(!partialValuesMap){partialValuesMap=new Map;partialMap.set(name,partialValuesMap)}matcher=this._addPartial(partialValuesMap,value)}}}}_addTerminal(map,name,selectable){let terminalList=map.get(name);if(!terminalList){terminalList=[];map.set(name,terminalList)}terminalList.push(selectable)}_addPartial(map,name){let matcher=map.get(name);if(!matcher){matcher=new SelectorMatcher;map.set(name,matcher)}return matcher}match(cssSelector,matchedCallback){let result=false;const element=cssSelector.element;const classNames=cssSelector.classNames;const attrs=cssSelector.attrs;for(let i=0;i<this._listContexts.length;i++){this._listContexts[i].alreadyMatched=false}result=this._matchTerminal(this._elementMap,element,cssSelector,matchedCallback)||result;result=this._matchPartial(this._elementPartialMap,element,cssSelector,matchedCallback)||result;if(classNames){for(let i=0;i<classNames.length;i++){const className=classNames[i];result=this._matchTerminal(this._classMap,className,cssSelector,matchedCallback)||result;result=this._matchPartial(this._classPartialMap,className,cssSelector,matchedCallback)||result}}if(attrs){for(let i=0;i<attrs.length;i+=2){const name=attrs[i];const value=attrs[i+1];const terminalValuesMap=this._attrValueMap.get(name);if(value){result=this._matchTerminal(terminalValuesMap,"",cssSelector,matchedCallback)||result}result=this._matchTerminal(terminalValuesMap,value,cssSelector,matchedCallback)||result;const partialValuesMap=this._attrValuePartialMap.get(name);if(value){result=this._matchPartial(partialValuesMap,"",cssSelector,matchedCallback)||result}result=this._matchPartial(partialValuesMap,value,cssSelector,matchedCallback)||result}}return result}_matchTerminal(map,name,cssSelector,matchedCallback){if(!map||typeof name!=="string"){return false}let selectables=map.get(name)||[];const starSelectables=map.get("*");if(starSelectables){selectables=selectables.concat(starSelectables)}if(selectables.length===0){return false}let selectable;let result=false;for(let i=0;i<selectables.length;i++){selectable=selectables[i];result=selectable.finalize(cssSelector,matchedCallback)||result}return result}_matchPartial(map,name,cssSelector,matchedCallback){if(!map||typeof name!=="string"){return false}const nestedSelector=map.get(name);if(!nestedSelector){return false}return nestedSelector.match(cssSelector,matchedCallback)}}class SelectorListContext{constructor(selectors){this.selectors=selectors;this.alreadyMatched=false}}class SelectorContext{constructor(selector,cbContext,listContext){this.selector=selector;this.cbContext=cbContext;this.listContext=listContext;this.notSelectors=selector.notSelectors}finalize(cssSelector,callback){let result=true;if(this.notSelectors.length>0&&(!this.listContext||!this.listContext.alreadyMatched)){const notMatcher=SelectorMatcher.createNotMatcher(this.notSelectors);result=!notMatcher.match(cssSelector,null)}if(result&&callback&&(!this.listContext||!this.listContext.alreadyMatched)){if(this.listContext){this.listContext.alreadyMatched=true}callback(this.selector,this.cbContext)}return result}}const emitDistinctChangesOnlyDefaultValue=true;exports.ViewEncapsulation=void 0;(function(ViewEncapsulation){ViewEncapsulation[ViewEncapsulation["Emulated"]=0]="Emulated";ViewEncapsulation[ViewEncapsulation["None"]=2]="None";ViewEncapsulation[ViewEncapsulation["ShadowDom"]=3]="ShadowDom"})(exports.ViewEncapsulation||(exports.ViewEncapsulation={}));exports.ChangeDetectionStrategy=void 0;(function(ChangeDetectionStrategy){ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"]=0]="OnPush";ChangeDetectionStrategy[ChangeDetectionStrategy["Default"]=1]="Default"})(exports.ChangeDetectionStrategy||(exports.ChangeDetectionStrategy={}));var InputFlags;(function(InputFlags){InputFlags[InputFlags["None"]=0]="None";InputFlags[InputFlags["SignalBased"]=1]="SignalBased";InputFlags[InputFlags["HasDecoratorInputTransform"]=2]="HasDecoratorInputTransform"})(InputFlags||(InputFlags={}));const CUSTOM_ELEMENTS_SCHEMA={name:"custom-elements"};const NO_ERRORS_SCHEMA={name:"no-errors-schema"};const Type$1=Function;var SecurityContext;(function(SecurityContext){SecurityContext[SecurityContext["NONE"]=0]="NONE";SecurityContext[SecurityContext["HTML"]=1]="HTML";SecurityContext[SecurityContext["STYLE"]=2]="STYLE";SecurityContext[SecurityContext["SCRIPT"]=3]="SCRIPT";SecurityContext[SecurityContext["URL"]=4]="URL";SecurityContext[SecurityContext["RESOURCE_URL"]=5]="RESOURCE_URL"})(SecurityContext||(SecurityContext={}));var MissingTranslationStrategy;(function(MissingTranslationStrategy){MissingTranslationStrategy[MissingTranslationStrategy["Error"]=0]="Error";MissingTranslationStrategy[MissingTranslationStrategy["Warning"]=1]="Warning";MissingTranslationStrategy[MissingTranslationStrategy["Ignore"]=2]="Ignore"})(MissingTranslationStrategy||(MissingTranslationStrategy={}));function parserSelectorToSimpleSelector(selector){const classes=selector.classNames&&selector.classNames.length?[8,...selector.classNames]:[];const elementName=selector.element&&selector.element!=="*"?selector.element:"";return[elementName,...selector.attrs,...classes]}function parserSelectorToNegativeSelector(selector){const classes=selector.classNames&&selector.classNames.length?[8,...selector.classNames]:[];if(selector.element){return[1|4,selector.element,...selector.attrs,...classes]}else if(selector.attrs.length){return[1|2,...selector.attrs,...classes]}else{return selector.classNames&&selector.classNames.length?[1|8,...selector.classNames]:[]}}function parserSelectorToR3Selector(selector){const positive=parserSelectorToSimpleSelector(selector);const negative=selector.notSelectors&&selector.notSelectors.length?selector.notSelectors.map((notSelector=>parserSelectorToNegativeSelector(notSelector))):[];return positive.concat(...negative)}function parseSelectorToR3Selector(selector){return selector?CssSelector.parse(selector).map(parserSelectorToR3Selector):[]}var core=Object.freeze({__proto__:null,emitDistinctChangesOnlyDefaultValue:emitDistinctChangesOnlyDefaultValue,get ViewEncapsulation(){return exports.ViewEncapsulation},get ChangeDetectionStrategy(){return exports.ChangeDetectionStrategy},get InputFlags(){return InputFlags},CUSTOM_ELEMENTS_SCHEMA:CUSTOM_ELEMENTS_SCHEMA,NO_ERRORS_SCHEMA:NO_ERRORS_SCHEMA,Type:Type$1,get SecurityContext(){return SecurityContext},get MissingTranslationStrategy(){return MissingTranslationStrategy},parseSelectorToR3Selector:parseSelectorToR3Selector});let textEncoder;function digest$1(message){return message.id||computeDigest(message)}function computeDigest(message){return sha1(serializeNodes(message.nodes).join("")+`[${message.meaning}]`)}function decimalDigest(message){return message.id||computeDecimalDigest(message)}function computeDecimalDigest(message){const visitor=new _SerializerIgnoreIcuExpVisitor;const parts=message.nodes.map((a=>a.visit(visitor,null)));return computeMsgId(parts.join(""),message.meaning)}class _SerializerVisitor{visitText(text,context){return text.value}visitContainer(container,context){return`[${container.children.map((child=>child.visit(this))).join(", ")}]`}visitIcu(icu,context){const strCases=Object.keys(icu.cases).map((k=>`${k} {${icu.cases[k].visit(this)}}`));return`{${icu.expression}, ${icu.type}, ${strCases.join(", ")}}`}visitTagPlaceholder(ph,context){return ph.isVoid?`<ph tag name="${ph.startName}"/>`:`<ph tag name="${ph.startName}">${ph.children.map((child=>child.visit(this))).join(", ")}</ph name="${ph.closeName}">`}visitPlaceholder(ph,context){return ph.value?`<ph name="${ph.name}">${ph.value}</ph>`:`<ph name="${ph.name}"/>`}visitIcuPlaceholder(ph,context){return`<ph icu name="${ph.name}">${ph.value.visit(this)}</ph>`}visitBlockPlaceholder(ph,context){return`<ph block name="${ph.startName}">${ph.children.map((child=>child.visit(this))).join(", ")}</ph name="${ph.closeName}">`}}const serializerVisitor$1=new _SerializerVisitor;function serializeNodes(nodes){return nodes.map((a=>a.visit(serializerVisitor$1,null)))}class _SerializerIgnoreIcuExpVisitor extends _SerializerVisitor{visitIcu(icu,context){let strCases=Object.keys(icu.cases).map((k=>`${k} {${icu.cases[k].visit(this)}}`));return`{${icu.type}, ${strCases.join(", ")}}`}}function sha1(str){textEncoder??=new TextEncoder;const utf8=[...textEncoder.encode(str)];const words32=bytesToWords32(utf8,Endian.Big);const len=utf8.length*8;const w=new Uint32Array(80);let a=1732584193,b=4023233417,c=2562383102,d=271733878,e=3285377520;words32[len>>5]|=128<<24-len%32;words32[(len+64>>9<<4)+15]=len;for(let i=0;i<words32.length;i+=16){const h0=a,h1=b,h2=c,h3=d,h4=e;for(let j=0;j<80;j++){if(j<16){w[j]=words32[i+j]}else{w[j]=rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16],1)}const fkVal=fk(j,b,c,d);const f=fkVal[0];const k=fkVal[1];const temp=[rol32(a,5),f,e,k,w[j]].reduce(add32);e=d;d=c;c=rol32(b,30);b=a;a=temp}a=add32(a,h0);b=add32(b,h1);c=add32(c,h2);d=add32(d,h3);e=add32(e,h4)}return toHexU32(a)+toHexU32(b)+toHexU32(c)+toHexU32(d)+toHexU32(e)}function toHexU32(value){return(value>>>0).toString(16).padStart(8,"0")}function fk(index,b,c,d){if(index<20){return[b&c|~b&d,1518500249]}if(index<40){return[b^c^d,1859775393]}if(index<60){return[b&c|b&d|c&d,2400959708]}return[b^c^d,3395469782]}function fingerprint(str){textEncoder??=new TextEncoder;const utf8=textEncoder.encode(str);const view=new DataView(utf8.buffer,utf8.byteOffset,utf8.byteLength);let hi=hash32(view,utf8.length,0);let lo=hash32(view,utf8.length,102072);if(hi==0&&(lo==0||lo==1)){hi=hi^319790063;lo=lo^-1801410264}return BigInt.asUintN(32,BigInt(hi))<<BigInt(32)|BigInt.asUintN(32,BigInt(lo))}function computeMsgId(msg,meaning=""){let msgFingerprint=fingerprint(msg);if(meaning){msgFingerprint=BigInt.asUintN(64,msgFingerprint<<BigInt(1))|msgFingerprint>>BigInt(63)&BigInt(1);msgFingerprint+=fingerprint(meaning)}return BigInt.asUintN(63,msgFingerprint).toString()}function hash32(view,length,c){let a=2654435769,b=2654435769;let index=0;const end=length-12;for(;index<=end;index+=12){a+=view.getUint32(index,true);b+=view.getUint32(index+4,true);c+=view.getUint32(index+8,true);const res=mix(a,b,c);a=res[0],b=res[1],c=res[2]}const remainder=length-index;c+=length;if(remainder>=4){a+=view.getUint32(index,true);index+=4;if(remainder>=8){b+=view.getUint32(index,true);index+=4;if(remainder>=9){c+=view.getUint8(index++)<<8}if(remainder>=10){c+=view.getUint8(index++)<<16}if(remainder===11){c+=view.getUint8(index++)<<24}}else{if(remainder>=5){b+=view.getUint8(index++)}if(remainder>=6){b+=view.getUint8(index++)<<8}if(remainder===7){b+=view.getUint8(index++)<<16}}}else{if(remainder>=1){a+=view.getUint8(index++)}if(remainder>=2){a+=view.getUint8(index++)<<8}if(remainder===3){a+=view.getUint8(index++)<<16}}return mix(a,b,c)[2]}function mix(a,b,c){a-=b;a-=c;a^=c>>>13;b-=c;b-=a;b^=a<<8;c-=a;c-=b;c^=b>>>13;a-=b;a-=c;a^=c>>>12;b-=c;b-=a;b^=a<<16;c-=a;c-=b;c^=b>>>5;a-=b;a-=c;a^=c>>>3;b-=c;b-=a;b^=a<<10;c-=a;c-=b;c^=b>>>15;return[a,b,c]}var Endian;(function(Endian){Endian[Endian["Little"]=0]="Little";Endian[Endian["Big"]=1]="Big"})(Endian||(Endian={}));function add32(a,b){return add32to64(a,b)[1]}function add32to64(a,b){const low=(a&65535)+(b&65535);const high=(a>>>16)+(b>>>16)+(low>>>16);return[high>>>16,high<<16|low&65535]}function rol32(a,count){return a<<count|a>>>32-count}function bytesToWords32(bytes,endian){const size=bytes.length+3>>>2;const words32=[];for(let i=0;i<size;i++){words32[i]=wordAt(bytes,i*4,endian)}return words32}function byteAt(bytes,index){return index>=bytes.length?0:bytes[index]}function wordAt(bytes,index,endian){let word=0;if(endian===Endian.Big){for(let i=0;i<4;i++){word+=byteAt(bytes,index+i)<<24-8*i}}else{for(let i=0;i<4;i++){word+=byteAt(bytes,index+i)<<8*i}}return word}exports.TypeModifier=void 0;(function(TypeModifier){TypeModifier[TypeModifier["None"]=0]="None";TypeModifier[TypeModifier["Const"]=1]="Const"})(exports.TypeModifier||(exports.TypeModifier={}));class Type{constructor(modifiers=exports.TypeModifier.None){this.modifiers=modifiers}hasModifier(modifier){return(this.modifiers&modifier)!==0}}exports.BuiltinTypeName=void 0;(function(BuiltinTypeName){BuiltinTypeName[BuiltinTypeName["Dynamic"]=0]="Dynamic";BuiltinTypeName[BuiltinTypeName["Bool"]=1]="Bool";BuiltinTypeName[BuiltinTypeName["String"]=2]="String";BuiltinTypeName[BuiltinTypeName["Int"]=3]="Int";BuiltinTypeName[BuiltinTypeName["Number"]=4]="Number";BuiltinTypeName[BuiltinTypeName["Function"]=5]="Function";BuiltinTypeName[BuiltinTypeName["Inferred"]=6]="Inferred";BuiltinTypeName[BuiltinTypeName["None"]=7]="None"})(exports.BuiltinTypeName||(exports.BuiltinTypeName={}));class BuiltinType extends Type{constructor(name,modifiers){super(modifiers);this.name=name}visitType(visitor,context){return visitor.visitBuiltinType(this,context)}}class ExpressionType extends Type{constructor(value,modifiers,typeParams=null){super(modifiers);this.value=value;this.typeParams=typeParams}visitType(visitor,context){return visitor.visitExpressionType(this,context)}}class ArrayType extends Type{constructor(of,modifiers){super(modifiers);this.of=of}visitType(visitor,context){return visitor.visitArrayType(this,context)}}class MapType extends Type{constructor(valueType,modifiers){super(modifiers);this.valueType=valueType||null}visitType(visitor,context){return visitor.visitMapType(this,context)}}class TransplantedType extends Type{constructor(type,modifiers){super(modifiers);this.type=type}visitType(visitor,context){return visitor.visitTransplantedType(this,context)}}const DYNAMIC_TYPE=new BuiltinType(exports.BuiltinTypeName.Dynamic);const INFERRED_TYPE=new BuiltinType(exports.BuiltinTypeName.Inferred);const BOOL_TYPE=new BuiltinType(exports.BuiltinTypeName.Bool);const INT_TYPE=new BuiltinType(exports.BuiltinTypeName.Int);const NUMBER_TYPE=new BuiltinType(exports.BuiltinTypeName.Number);const STRING_TYPE=new BuiltinType(exports.BuiltinTypeName.String);const FUNCTION_TYPE=new BuiltinType(exports.BuiltinTypeName.Function);const NONE_TYPE=new BuiltinType(exports.BuiltinTypeName.None);exports.UnaryOperator=void 0;(function(UnaryOperator){UnaryOperator[UnaryOperator["Minus"]=0]="Minus";UnaryOperator[UnaryOperator["Plus"]=1]="Plus"})(exports.UnaryOperator||(exports.UnaryOperator={}));exports.BinaryOperator=void 0;(function(BinaryOperator){BinaryOperator[BinaryOperator["Equals"]=0]="Equals";BinaryOperator[BinaryOperator["NotEquals"]=1]="NotEquals";BinaryOperator[BinaryOperator["Identical"]=2]="Identical";BinaryOperator[BinaryOperator["NotIdentical"]=3]="NotIdentical";BinaryOperator[BinaryOperator["Minus"]=4]="Minus";BinaryOperator[BinaryOperator["Plus"]=5]="Plus";BinaryOperator[BinaryOperator["Divide"]=6]="Divide";BinaryOperator[BinaryOperator["Multiply"]=7]="Multiply";BinaryOperator[BinaryOperator["Modulo"]=8]="Modulo";BinaryOperator[BinaryOperator["And"]=9]="And";BinaryOperator[BinaryOperator["Or"]=10]="Or";BinaryOperator[BinaryOperator["BitwiseOr"]=11]="BitwiseOr";BinaryOperator[BinaryOperator["BitwiseAnd"]=12]="BitwiseAnd";BinaryOperator[BinaryOperator["Lower"]=13]="Lower";BinaryOperator[BinaryOperator["LowerEquals"]=14]="LowerEquals";BinaryOperator[BinaryOperator["Bigger"]=15]="Bigger";BinaryOperator[BinaryOperator["BiggerEquals"]=16]="BiggerEquals";BinaryOperator[BinaryOperator["NullishCoalesce"]=17]="NullishCoalesce"})(exports.BinaryOperator||(exports.BinaryOperator={}));function nullSafeIsEquivalent(base,other){if(base==null||other==null){return base==other}return base.isEquivalent(other)}function areAllEquivalentPredicate(base,other,equivalentPredicate){const len=base.length;if(len!==other.length){return false}for(let i=0;i<len;i++){if(!equivalentPredicate(base[i],other[i])){return false}}return true}function areAllEquivalent(base,other){return areAllEquivalentPredicate(base,other,((baseElement,otherElement)=>baseElement.isEquivalent(otherElement)))}class Expression{constructor(type,sourceSpan){this.type=type||null;this.sourceSpan=sourceSpan||null}prop(name,sourceSpan){return new ReadPropExpr(this,name,null,sourceSpan)}key(index,type,sourceSpan){return new ReadKeyExpr(this,index,type,sourceSpan)}callFn(params,sourceSpan,pure){return new InvokeFunctionExpr(this,params,null,sourceSpan,pure)}instantiate(params,type,sourceSpan){return new InstantiateExpr(this,params,type,sourceSpan)}conditional(trueCase,falseCase=null,sourceSpan){return new ConditionalExpr(this,trueCase,falseCase,null,sourceSpan)}equals(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.Equals,this,rhs,null,sourceSpan)}notEquals(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.NotEquals,this,rhs,null,sourceSpan)}identical(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.Identical,this,rhs,null,sourceSpan)}notIdentical(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.NotIdentical,this,rhs,null,sourceSpan)}minus(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.Minus,this,rhs,null,sourceSpan)}plus(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.Plus,this,rhs,null,sourceSpan)}divide(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.Divide,this,rhs,null,sourceSpan)}multiply(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.Multiply,this,rhs,null,sourceSpan)}modulo(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.Modulo,this,rhs,null,sourceSpan)}and(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.And,this,rhs,null,sourceSpan)}bitwiseOr(rhs,sourceSpan,parens=true){return new BinaryOperatorExpr(exports.BinaryOperator.BitwiseOr,this,rhs,null,sourceSpan,parens)}bitwiseAnd(rhs,sourceSpan,parens=true){return new BinaryOperatorExpr(exports.BinaryOperator.BitwiseAnd,this,rhs,null,sourceSpan,parens)}or(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.Or,this,rhs,null,sourceSpan)}lower(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.Lower,this,rhs,null,sourceSpan)}lowerEquals(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.LowerEquals,this,rhs,null,sourceSpan)}bigger(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.Bigger,this,rhs,null,sourceSpan)}biggerEquals(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.BiggerEquals,this,rhs,null,sourceSpan)}isBlank(sourceSpan){return this.equals(TYPED_NULL_EXPR,sourceSpan)}nullishCoalesce(rhs,sourceSpan){return new BinaryOperatorExpr(exports.BinaryOperator.NullishCoalesce,this,rhs,null,sourceSpan)}toStmt(){return new ExpressionStatement(this,null)}}class ReadVarExpr extends Expression{constructor(name,type,sourceSpan){super(type,sourceSpan);this.name=name}isEquivalent(e){return e instanceof ReadVarExpr&&this.name===e.name}isConstant(){return false}visitExpression(visitor,context){return visitor.visitReadVarExpr(this,context)}clone(){return new ReadVarExpr(this.name,this.type,this.sourceSpan)}set(value){return new WriteVarExpr(this.name,value,null,this.sourceSpan)}}class TypeofExpr extends Expression{constructor(expr,type,sourceSpan){super(type,sourceSpan);this.expr=expr}visitExpression(visitor,context){return visitor.visitTypeofExpr(this,context)}isEquivalent(e){return e instanceof TypeofExpr&&e.expr.isEquivalent(this.expr)}isConstant(){return this.expr.isConstant()}clone(){return new TypeofExpr(this.expr.clone())}}class WrappedNodeExpr extends Expression{constructor(node,type,sourceSpan){super(type,sourceSpan);this.node=node}isEquivalent(e){return e instanceof WrappedNodeExpr&&this.node===e.node}isConstant(){return false}visitExpression(visitor,context){return visitor.visitWrappedNodeExpr(this,context)}clone(){return new WrappedNodeExpr(this.node,this.type,this.sourceSpan)}}class WriteVarExpr extends Expression{constructor(name,value,type,sourceSpan){super(type||value.type,sourceSpan);this.name=name;this.value=value}isEquivalent(e){return e instanceof WriteVarExpr&&this.name===e.name&&this.value.isEquivalent(e.value)}isConstant(){return false}visitExpression(visitor,context){return visitor.visitWriteVarExpr(this,context)}clone(){return new WriteVarExpr(this.name,this.value.clone(),this.type,this.sourceSpan)}toDeclStmt(type,modifiers){return new DeclareVarStmt(this.name,this.value,type,modifiers,this.sourceSpan)}toConstDecl(){return this.toDeclStmt(INFERRED_TYPE,exports.StmtModifier.Final)}}class WriteKeyExpr extends Expression{constructor(receiver,index,value,type,sourceSpan){super(type||value.type,sourceSpan);this.receiver=receiver;this.index=index;this.value=value}isEquivalent(e){return e instanceof WriteKeyExpr&&this.receiver.isEquivalent(e.receiver)&&this.index.isEquivalent(e.index)&&this.value.isEquivalent(e.value)}isConstant(){return false}visitExpression(visitor,context){return visitor.visitWriteKeyExpr(this,context)}clone(){return new WriteKeyExpr(this.receiver.clone(),this.index.clone(),this.value.clone(),this.type,this.sourceSpan)}}class WritePropExpr extends Expression{constructor(receiver,name,value,type,sourceSpan){super(type||value.type,sourceSpan);this.receiver=receiver;this.name=name;this.value=value}isEquivalent(e){return e instanceof WritePropExpr&&this.receiver.isEquivalent(e.receiver)&&this.name===e.name&&this.value.isEquivalent(e.value)}isConstant(){return false}visitExpression(visitor,context){return visitor.visitWritePropExpr(this,context)}clone(){return new WritePropExpr(this.receiver.clone(),this.name,this.value.clone(),this.type,this.sourceSpan)}}class InvokeFunctionExpr extends Expression{constructor(fn,args,type,sourceSpan,pure=false){super(type,sourceSpan);this.fn=fn;this.args=args;this.pure=pure}get receiver(){return this.fn}isEquivalent(e){return e instanceof InvokeFunctionExpr&&this.fn.isEquivalent(e.fn)&&areAllEquivalent(this.args,e.args)&&this.pure===e.pure}isConstant(){return false}visitExpression(visitor,context){return visitor.visitInvokeFunctionExpr(this,context)}clone(){return new InvokeFunctionExpr(this.fn.clone(),this.args.map((arg=>arg.clone())),this.type,this.sourceSpan,this.pure)}}class TaggedTemplateExpr extends Expression{constructor(tag,template,type,sourceSpan){super(type,sourceSpan);this.tag=tag;this.template=template}isEquivalent(e){return e instanceof TaggedTemplateExpr&&this.tag.isEquivalent(e.tag)&&areAllEquivalentPredicate(this.template.elements,e.template.elements,((a,b)=>a.text===b.text))&&areAllEquivalent(this.template.expressions,e.template.expressions)}isConstant(){return false}visitExpression(visitor,context){return visitor.visitTaggedTemplateExpr(this,context)}clone(){return new TaggedTemplateExpr(this.tag.clone(),this.template.clone(),this.type,this.sourceSpan)}}class InstantiateExpr extends Expression{constructor(classExpr,args,type,sourceSpan){super(type,sourceSpan);this.classExpr=classExpr;this.args=args}isEquivalent(e){return e instanceof InstantiateExpr&&this.classExpr.isEquivalent(e.classExpr)&&areAllEquivalent(this.args,e.args)}isConstant(){return false}visitExpression(visitor,context){return visitor.visitInstantiateExpr(this,context)}clone(){return new InstantiateExpr(this.classExpr.clone(),this.args.map((arg=>arg.clone())),this.type,this.sourceSpan)}}class LiteralExpr extends Expression{constructor(value,type,sourceSpan){super(type,sourceSpan);this.value=value}isEquivalent(e){return e instanceof LiteralExpr&&this.value===e.value}isConstant(){return true}visitExpression(visitor,context){return visitor.visitLiteralExpr(this,context)}clone(){return new LiteralExpr(this.value,this.type,this.sourceSpan)}}class TemplateLiteral{constructor(elements,expressions){this.elements=elements;this.expressions=expressions}clone(){return new TemplateLiteral(this.elements.map((el=>el.clone())),this.expressions.map((expr=>expr.clone())))}}class TemplateLiteralElement{constructor(text,sourceSpan,rawText){this.text=text;this.sourceSpan=sourceSpan;this.rawText=rawText??sourceSpan?.toString()??escapeForTemplateLiteral(escapeSlashes(text))}clone(){return new TemplateLiteralElement(this.text,this.sourceSpan,this.rawText)}}class LiteralPiece{constructor(text,sourceSpan){this.text=text;this.sourceSpan=sourceSpan}}class PlaceholderPiece{constructor(text,sourceSpan,associatedMessage){this.text=text;this.sourceSpan=sourceSpan;this.associatedMessage=associatedMessage}}const MEANING_SEPARATOR$1="|";const ID_SEPARATOR$1="@@";const LEGACY_ID_INDICATOR="\u241f";class LocalizedString extends Expression{constructor(metaBlock,messageParts,placeHolderNames,expressions,sourceSpan){super(STRING_TYPE,sourceSpan);this.metaBlock=metaBlock;this.messageParts=messageParts;this.placeHolderNames=placeHolderNames;this.expressions=expressions}isEquivalent(e){return false}isConstant(){return false}visitExpression(visitor,context){return visitor.visitLocalizedString(this,context)}clone(){return new LocalizedString(this.metaBlock,this.messageParts,this.placeHolderNames,this.expressions.map((expr=>expr.clone())),this.sourceSpan)}serializeI18nHead(){let metaBlock=this.metaBlock.description||"";if(this.metaBlock.meaning){metaBlock=`${this.metaBlock.meaning}${MEANING_SEPARATOR$1}${metaBlock}`}if(this.metaBlock.customId){metaBlock=`${metaBlock}${ID_SEPARATOR$1}${this.metaBlock.customId}`}if(this.metaBlock.legacyIds){this.metaBlock.legacyIds.forEach((legacyId=>{metaBlock=`${metaBlock}${LEGACY_ID_INDICATOR}${legacyId}`}))}return createCookedRawString(metaBlock,this.messageParts[0].text,this.getMessagePartSourceSpan(0))}getMessagePartSourceSpan(i){return this.messageParts[i]?.sourceSpan??this.sourceSpan}getPlaceholderSourceSpan(i){return this.placeHolderNames[i]?.sourceSpan??this.expressions[i]?.sourceSpan??this.sourceSpan}serializeI18nTemplatePart(partIndex){const placeholder=this.placeHolderNames[partIndex-1];const messagePart=this.messageParts[partIndex];let metaBlock=placeholder.text;if(placeholder.associatedMessage?.legacyIds.length===0){metaBlock+=`${ID_SEPARATOR$1}${computeMsgId(placeholder.associatedMessage.messageString,placeholder.associatedMessage.meaning)}`}return createCookedRawString(metaBlock,messagePart.text,this.getMessagePartSourceSpan(partIndex))}}const escapeSlashes=str=>str.replace(/\\/g,"\\\\");const escapeStartingColon=str=>str.replace(/^:/,"\\:");const escapeColons=str=>str.replace(/:/g,"\\:");const escapeForTemplateLiteral=str=>str.replace(/`/g,"\\`").replace(/\${/g,"$\\{");function createCookedRawString(metaBlock,messagePart,range){if(metaBlock===""){return{cooked:messagePart,raw:escapeForTemplateLiteral(escapeStartingColon(escapeSlashes(messagePart))),range:range}}else{return{cooked:`:${metaBlock}:${messagePart}`,raw:escapeForTemplateLiteral(`:${escapeColons(escapeSlashes(metaBlock))}:${escapeSlashes(messagePart)}`),range:range}}}class ExternalExpr extends Expression{constructor(value,type,typeParams=null,sourceSpan){super(type,sourceSpan);this.value=value;this.typeParams=typeParams}isEquivalent(e){return e instanceof ExternalExpr&&this.value.name===e.value.name&&this.value.moduleName===e.value.moduleName&&this.value.runtime===e.value.runtime}isConstant(){return false}visitExpression(visitor,context){return visitor.visitExternalExpr(this,context)}clone(){return new ExternalExpr(this.value,this.type,this.typeParams,this.sourceSpan)}}class ExternalReference{constructor(moduleName,name,runtime){this.moduleName=moduleName;this.name=name;this.runtime=runtime}}class ConditionalExpr extends Expression{constructor(condition,trueCase,falseCase=null,type,sourceSpan){super(type||trueCase.type,sourceSpan);this.condition=condition;this.falseCase=falseCase;this.trueCase=trueCase}isEquivalent(e){return e instanceof ConditionalExpr&&this.condition.isEquivalent(e.condition)&&this.trueCase.isEquivalent(e.trueCase)&&nullSafeIsEquivalent(this.falseCase,e.falseCase)}isConstant(){return false}visitExpression(visitor,context){return visitor.visitConditionalExpr(this,context)}clone(){return new ConditionalExpr(this.condition.clone(),this.trueCase.clone(),this.falseCase?.clone(),this.type,this.sourceSpan)}}class DynamicImportExpr extends Expression{constructor(url,sourceSpan){super(null,sourceSpan);this.url=url}isEquivalent(e){return e instanceof DynamicImportExpr&&this.url===e.url}isConstant(){return false}visitExpression(visitor,context){return visitor.visitDynamicImportExpr(this,context)}clone(){return new DynamicImportExpr(this.url,this.sourceSpan)}}class NotExpr extends Expression{constructor(condition,sourceSpan){super(BOOL_TYPE,sourceSpan);this.condition=condition}isEquivalent(e){return e instanceof NotExpr&&this.condition.isEquivalent(e.condition)}isConstant(){return false}visitExpression(visitor,context){return visitor.visitNotExpr(this,context)}clone(){return new NotExpr(this.condition.clone(),this.sourceSpan)}}class FnParam{constructor(name,type=null){this.name=name;this.type=type}isEquivalent(param){return this.name===param.name}clone(){return new FnParam(this.name,this.type)}}class FunctionExpr extends Expression{constructor(params,statements,type,sourceSpan,name){super(type,sourceSpan);this.params=params;this.statements=statements;this.name=name}isEquivalent(e){return(e instanceof FunctionExpr||e instanceof DeclareFunctionStmt)&&areAllEquivalent(this.params,e.params)&&areAllEquivalent(this.statements,e.statements)}isConstant(){return false}visitExpression(visitor,context){return visitor.visitFunctionExpr(this,context)}toDeclStmt(name,modifiers){return new DeclareFunctionStmt(name,this.params,this.statements,this.type,modifiers,this.sourceSpan)}clone(){return new FunctionExpr(this.params.map((p=>p.clone())),this.statements,this.type,this.sourceSpan,this.name)}}class ArrowFunctionExpr extends Expression{constructor(params,body,type,sourceSpan){super(type,sourceSpan);this.params=params;this.body=body}isEquivalent(e){if(!(e instanceof ArrowFunctionExpr)||!areAllEquivalent(this.params,e.params)){return false}if(this.body instanceof Expression&&e.body instanceof Expression){return this.body.isEquivalent(e.body)}if(Array.isArray(this.body)&&Array.isArray(e.body)){return areAllEquivalent(this.body,e.body)}return false}isConstant(){return false}visitExpression(visitor,context){return visitor.visitArrowFunctionExpr(this,context)}clone(){return new ArrowFunctionExpr(this.params.map((p=>p.clone())),Array.isArray(this.body)?this.body:this.body.clone(),this.type,this.sourceSpan)}toDeclStmt(name,modifiers){return new DeclareVarStmt(name,this,INFERRED_TYPE,modifiers,this.sourceSpan)}}class UnaryOperatorExpr extends Expression{constructor(operator,expr,type,sourceSpan,parens=true){super(type||NUMBER_TYPE,sourceSpan);this.operator=operator;this.expr=expr;this.parens=parens}isEquivalent(e){return e instanceof UnaryOperatorExpr&&this.operator===e.operator&&this.expr.isEquivalent(e.expr)}isConstant(){return false}visitExpression(visitor,context){return visitor.visitUnaryOperatorExpr(this,context)}clone(){return new UnaryOperatorExpr(this.operator,this.expr.clone(),this.type,this.sourceSpan,this.parens)}}class BinaryOperatorExpr extends Expression{constructor(operator,lhs,rhs,type,sourceSpan,parens=true){super(type||lhs.type,sourceSpan);this.operator=operator;this.rhs=rhs;this.parens=parens;this.lhs=lhs}isEquivalent(e){return e instanceof BinaryOperatorExpr&&this.operator===e.operator&&this.lhs.isEquivalent(e.lhs)&&this.rhs.isEquivalent(e.rhs)}isConstant(){return false}visitExpression(visitor,context){return visitor.visitBinaryOperatorExpr(this,context)}clone(){return new BinaryOperatorExpr(this.operator,this.lhs.clone(),this.rhs.clone(),this.type,this.sourceSpan,this.parens)}}class ReadPropExpr extends Expression{constructor(receiver,name,type,sourceSpan){super(type,sourceSpan);this.receiver=receiver;this.name=name}get index(){return this.name}isEquivalent(e){return e instanceof ReadPropExpr&&this.receiver.isEquivalent(e.receiver)&&this.name===e.name}isConstant(){return false}visitExpression(visitor,context){return visitor.visitReadPropExpr(this,context)}set(value){return new WritePropExpr(this.receiver,this.name,value,null,this.sourceSpan)}clone(){return new ReadPropExpr(this.receiver.clone(),this.name,this.type,this.sourceSpan)}}class ReadKeyExpr extends Expression{constructor(receiver,index,type,sourceSpan){super(type,sourceSpan);this.receiver=receiver;this.index=index}isEquivalent(e){return e instanceof ReadKeyExpr&&this.receiver.isEquivalent(e.receiver)&&this.index.isEquivalent(e.index)}isConstant(){return false}visitExpression(visitor,context){return visitor.visitReadKeyExpr(this,context)}set(value){return new WriteKeyExpr(this.receiver,this.index,value,null,this.sourceSpan)}clone(){return new ReadKeyExpr(this.receiver.clone(),this.index.clone(),this.type,this.sourceSpan)}}class LiteralArrayExpr extends Expression{constructor(entries,type,sourceSpan){super(type,sourceSpan);this.entries=entries}isConstant(){return this.entries.every((e=>e.isConstant()))}isEquivalent(e){return e instanceof LiteralArrayExpr&&areAllEquivalent(this.entries,e.entries)}visitExpression(visitor,context){return visitor.visitLiteralArrayExpr(this,context)}clone(){return new LiteralArrayExpr(this.entries.map((e=>e.clone())),this.type,this.sourceSpan)}}class LiteralMapEntry{constructor(key,value,quoted){this.key=key;this.value=value;this.quoted=quoted}isEquivalent(e){return this.key===e.key&&this.value.isEquivalent(e.value)}clone(){return new LiteralMapEntry(this.key,this.value.clone(),this.quoted)}}class LiteralMapExpr extends Expression{constructor(entries,type,sourceSpan){super(type,sourceSpan);this.entries=entries;this.valueType=null;if(type){this.valueType=type.valueType}}isEquivalent(e){return e instanceof LiteralMapExpr&&areAllEquivalent(this.entries,e.entries)}isConstant(){return this.entries.every((e=>e.value.isConstant()))}visitExpression(visitor,context){return visitor.visitLiteralMapExpr(this,context)}clone(){const entriesClone=this.entries.map((entry=>entry.clone()));return new LiteralMapExpr(entriesClone,this.type,this.sourceSpan)}}class CommaExpr extends Expression{constructor(parts,sourceSpan){super(parts[parts.length-1].type,sourceSpan);this.parts=parts}isEquivalent(e){return e instanceof CommaExpr&&areAllEquivalent(this.parts,e.parts)}isConstant(){return false}visitExpression(visitor,context){return visitor.visitCommaExpr(this,context)}clone(){return new CommaExpr(this.parts.map((p=>p.clone())))}}const NULL_EXPR=new LiteralExpr(null,null,null);const TYPED_NULL_EXPR=new LiteralExpr(null,INFERRED_TYPE,null);exports.StmtModifier=void 0;(function(StmtModifier){StmtModifier[StmtModifier["None"]=0]="None";StmtModifier[StmtModifier["Final"]=1]="Final";StmtModifier[StmtModifier["Private"]=2]="Private";StmtModifier[StmtModifier["Exported"]=4]="Exported";StmtModifier[StmtModifier["Static"]=8]="Static"})(exports.StmtModifier||(exports.StmtModifier={}));class LeadingComment{constructor(text,multiline,trailingNewline){this.text=text;this.multiline=multiline;this.trailingNewline=trailingNewline}toString(){return this.multiline?` ${this.text} `:this.text}}class JSDocComment extends LeadingComment{constructor(tags){super("",true,true);this.tags=tags}toString(){return serializeTags(this.tags)}}class Statement{constructor(modifiers=exports.StmtModifier.None,sourceSpan=null,leadingComments){this.modifiers=modifiers;this.sourceSpan=sourceSpan;this.leadingComments=leadingComments}hasModifier(modifier){return(this.modifiers&modifier)!==0}addLeadingComment(leadingComment){this.leadingComments=this.leadingComments??[];this.leadingComments.push(leadingComment)}}class DeclareVarStmt extends Statement{constructor(name,value,type,modifiers,sourceSpan,leadingComments){super(modifiers,sourceSpan,leadingComments);this.name=name;this.value=value;this.type=type||value&&value.type||null}isEquivalent(stmt){return stmt instanceof DeclareVarStmt&&this.name===stmt.name&&(this.value?!!stmt.value&&this.value.isEquivalent(stmt.value):!stmt.value)}visitStatement(visitor,context){return visitor.visitDeclareVarStmt(this,context)}}class DeclareFunctionStmt extends Statement{constructor(name,params,statements,type,modifiers,sourceSpan,leadingComments){super(modifiers,sourceSpan,leadingComments);this.name=name;this.params=params;this.statements=statements;this.type=type||null}isEquivalent(stmt){return stmt instanceof DeclareFunctionStmt&&areAllEquivalent(this.params,stmt.params)&&areAllEquivalent(this.statements,stmt.statements)}visitStatement(visitor,context){return visitor.visitDeclareFunctionStmt(this,context)}}class ExpressionStatement extends Statement{constructor(expr,sourceSpan,leadingComments){super(exports.StmtModifier.None,sourceSpan,leadingComments);this.expr=expr}isEquivalent(stmt){return stmt instanceof ExpressionStatement&&this.expr.isEquivalent(stmt.expr)}visitStatement(visitor,context){return visitor.visitExpressionStmt(this,context)}}class ReturnStatement extends Statement{constructor(value,sourceSpan=null,leadingComments){super(exports.StmtModifier.None,sourceSpan,leadingComments);this.value=value}isEquivalent(stmt){return stmt instanceof ReturnStatement&&this.value.isEquivalent(stmt.value)}visitStatement(visitor,context){return visitor.visitReturnStmt(this,context)}}class IfStmt extends Statement{constructor(condition,trueCase,falseCase=[],sourceSpan,leadingComments){super(exports.StmtModifier.None,sourceSpan,leadingComments);this.condition=condition;this.trueCase=trueCase;this.falseCase=falseCase}isEquivalent(stmt){return stmt instanceof IfStmt&&this.condition.isEquivalent(stmt.condition)&&areAllEquivalent(this.trueCase,stmt.trueCase)&&areAllEquivalent(this.falseCase,stmt.falseCase)}visitStatement(visitor,context){return visitor.visitIfStmt(this,context)}}class RecursiveAstVisitor$1{visitType(ast,context){return ast}visitExpression(ast,context){if(ast.type){ast.type.visitType(this,context)}return ast}visitBuiltinType(type,context){return this.visitType(type,context)}visitExpressionType(type,context){type.value.visitExpression(this,context);if(type.typeParams!==null){type.typeParams.forEach((param=>this.visitType(param,context)))}return this.visitType(type,context)}visitArrayType(type,context){return this.visitType(type,context)}visitMapType(type,context){return this.visitType(type,context)}visitTransplantedType(type,context){return type}visitWrappedNodeExpr(ast,context){return ast}visitTypeofExpr(ast,context){return this.visitExpression(ast,context)}visitReadVarExpr(ast,context){return this.visitExpression(ast,context)}visitWriteVarExpr(ast,context){ast.value.visitExpression(this,context);return this.visitExpression(ast,context)}visitWriteKeyExpr(ast,context){ast.receiver.visitExpression(this,context);ast.index.visitExpression(this,context);ast.value.visitExpression(this,context);return this.visitExpression(ast,context)}visitWritePropExpr(ast,context){ast.receiver.visitExpression(this,context);ast.value.visitExpression(this,context);return this.visitExpression(ast,context)}visitDynamicImportExpr(ast,context){return this.visitExpression(ast,context)}visitInvokeFunctionExpr(ast,context){ast.fn.visitExpression(this,context);this.visitAllExpressions(ast.args,context);return this.visitExpression(ast,context)}visitTaggedTemplateExpr(ast,context){ast.tag.visitExpression(this,context);this.visitAllExpressions(ast.template.expressions,context);return this.visitExpression(ast,context)}visitInstantiateExpr(ast,context){ast.classExpr.visitExpression(this,context);this.visitAllExpressions(ast.args,context);return this.visitExpression(ast,context)}visitLiteralExpr(ast,context){return this.visitExpression(ast,context)}visitLocalizedString(ast,context){return this.visitExpression(ast,context)}visitExternalExpr(ast,context){if(ast.typeParams){ast.typeParams.forEach((type=>type.visitType(this,context)))}return this.visitExpression(ast,context)}visitConditionalExpr(ast,context){ast.condition.visitExpression(this,context);ast.trueCase.visitExpression(this,context);ast.falseCase.visitExpression(this,context);return this.visitExpression(ast,context)}visitNotExpr(ast,context){ast.condition.visitExpression(this,context);return this.visitExpression(ast,context)}visitFunctionExpr(ast,context){this.visitAllStatements(ast.statements,context);return this.visitExpression(ast,context)}visitArrowFunctionExpr(ast,context){if(Array.isArray(ast.body)){this.visitAllStatements(ast.body,context)}else{this.visitExpression(ast.body,context)}return this.visitExpression(ast,context)}visitUnaryOperatorExpr(ast,context){ast.expr.visitExpression(this,context);return this.visitExpression(ast,context)}visitBinaryOperatorExpr(ast,context){ast.lhs.visitExpression(this,context);ast.rhs.visitExpression(this,context);return this.visitExpression(ast,context)}visitReadPropExpr(ast,context){ast.receiver.visitExpression(this,context);return this.visitExpression(ast,context)}visitReadKeyExpr(ast,context){ast.receiver.visitExpression(this,context);ast.index.visitExpression(this,context);return this.visitExpression(ast,context)}visitLiteralArrayExpr(ast,context){this.visitAllExpressions(ast.entries,context);return this.visitExpression(ast,context)}visitLiteralMapExpr(ast,context){ast.entries.forEach((entry=>entry.value.visitExpression(this,context)));return this.visitExpression(ast,context)}visitCommaExpr(ast,context){this.visitAllExpressions(ast.parts,context);return this.visitExpression(ast,context)}visitAllExpressions(exprs,context){exprs.forEach((expr=>expr.visitExpression(this,context)))}visitDeclareVarStmt(stmt,context){if(stmt.value){stmt.value.visitExpression(this,context)}if(stmt.type){stmt.type.visitType(this,context)}return stmt}visitDeclareFunctionStmt(stmt,context){this.visitAllStatements(stmt.statements,context);if(stmt.type){stmt.type.visitType(this,context)}return stmt}visitExpressionStmt(stmt,context){stmt.expr.visitExpression(this,context);return stmt}visitReturnStmt(stmt,context){stmt.value.visitExpression(this,context);return stmt}visitIfStmt(stmt,context){stmt.condition.visitExpression(this,context);this.visitAllStatements(stmt.trueCase,context);this.visitAllStatements(stmt.falseCase,context);return stmt}visitAllStatements(stmts,context){stmts.forEach((stmt=>stmt.visitStatement(this,context)))}}function leadingComment(text,multiline=false,trailingNewline=true){return new LeadingComment(text,multiline,trailingNewline)}function jsDocComment(tags=[]){return new JSDocComment(tags)}function variable(name,type,sourceSpan){return new ReadVarExpr(name,type,sourceSpan)}function importExpr(id,typeParams=null,sourceSpan){return new ExternalExpr(id,null,typeParams,sourceSpan)}function importType(id,typeParams,typeModifiers){return id!=null?expressionType(importExpr(id,typeParams,null),typeModifiers):null}function expressionType(expr,typeModifiers,typeParams){return new ExpressionType(expr,typeModifiers,typeParams)}function transplantedType(type,typeModifiers){return new TransplantedType(type,typeModifiers)}function typeofExpr(expr){return new TypeofExpr(expr)}function literalArr(values,type,sourceSpan){return new LiteralArrayExpr(values,type,sourceSpan)}function literalMap(values,type=null){return new LiteralMapExpr(values.map((e=>new LiteralMapEntry(e.key,e.value,e.quoted))),type,null)}function unary(operator,expr,type,sourceSpan){return new UnaryOperatorExpr(operator,expr,type,sourceSpan)}function not(expr,sourceSpan){return new NotExpr(expr,sourceSpan)}function fn(params,body,type,sourceSpan,name){return new FunctionExpr(params,body,type,sourceSpan,name)}function arrowFn(params,body,type,sourceSpan){return new ArrowFunctionExpr(params,body,type,sourceSpan)}function ifStmt(condition,thenClause,elseClause,sourceSpan,leadingComments){return new IfStmt(condition,thenClause,elseClause,sourceSpan,leadingComments)}function taggedTemplate(tag,template,type,sourceSpan){return new TaggedTemplateExpr(tag,template,type,sourceSpan)}function literal(value,type,sourceSpan){return new LiteralExpr(value,type,sourceSpan)}function localizedString(metaBlock,messageParts,placeholderNames,expressions,sourceSpan){return new LocalizedString(metaBlock,messageParts,placeholderNames,expressions,sourceSpan)}function isNull(exp){return exp instanceof LiteralExpr&&exp.value===null}function tagToString(tag){let out="";if(tag.tagName){out+=` @${tag.tagName}`}if(tag.text){if(tag.text.match(/\/\*|\*\//)){throw new Error('JSDoc text cannot contain "/*" and "*/"')}out+=" "+tag.text.replace(/@/g,"\\@")}return out}function serializeTags(tags){if(tags.length===0)return"";if(tags.length===1&&tags[0].tagName&&!tags[0].text){return`*${tagToString(tags[0])} `}let out="*\n";for(const tag of tags){out+=" *";out+=tagToString(tag).replace(/\n/g,"\n * ");out+="\n"}out+=" ";return out}var output_ast=Object.freeze({__proto__:null,get TypeModifier(){return exports.TypeModifier},Type:Type,get BuiltinTypeName(){return exports.BuiltinTypeName},BuiltinType:BuiltinType,ExpressionType:ExpressionType,ArrayType:ArrayType,MapType:MapType,TransplantedType:TransplantedType,DYNAMIC_TYPE:DYNAMIC_TYPE,INFERRED_TYPE:INFERRED_TYPE,BOOL_TYPE:BOOL_TYPE,INT_TYPE:INT_TYPE,NUMBER_TYPE:NUMBER_TYPE,STRING_TYPE:STRING_TYPE,FUNCTION_TYPE:FUNCTION_TYPE,NONE_TYPE:NONE_TYPE,get UnaryOperator(){return exports.UnaryOperator},get BinaryOperator(){return exports.BinaryOperator},nullSafeIsEquivalent:nullSafeIsEquivalent,areAllEquivalent:areAllEquivalent,Expression:Expression,ReadVarExpr:ReadVarExpr,TypeofExpr:TypeofExpr,WrappedNodeExpr:WrappedNodeExpr,WriteVarExpr:WriteVarExpr,WriteKeyExpr:WriteKeyExpr,WritePropExpr:WritePropExpr,InvokeFunctionExpr:InvokeFunctionExpr,TaggedTemplateExpr:TaggedTemplateExpr,InstantiateExpr:InstantiateExpr,LiteralExpr:LiteralExpr,TemplateLiteral:TemplateLiteral,TemplateLiteralElement:TemplateLiteralElement,LiteralPiece:LiteralPiece,PlaceholderPiece:PlaceholderPiece,LocalizedString:LocalizedString,ExternalExpr:ExternalExpr,ExternalReference:ExternalReference,ConditionalExpr:ConditionalExpr,DynamicImportExpr:DynamicImportExpr,NotExpr:NotExpr,FnParam:FnParam,FunctionExpr:FunctionExpr,ArrowFunctionExpr:ArrowFunctionExpr,UnaryOperatorExpr:UnaryOperatorExpr,BinaryOperatorExpr:BinaryOperatorExpr,ReadPropExpr:ReadPropExpr,ReadKeyExpr:ReadKeyExpr,LiteralArrayExpr:LiteralArrayExpr,LiteralMapEntry:LiteralMapEntry,LiteralMapExpr:LiteralMapExpr,CommaExpr:CommaExpr,NULL_EXPR:NULL_EXPR,TYPED_NULL_EXPR:TYPED_NULL_EXPR,get StmtModifier(){return exports.StmtModifier},LeadingComment:LeadingComment,JSDocComment:JSDocComment,Statement:Statement,DeclareVarStmt:DeclareVarStmt,DeclareFunctionStmt:DeclareFunctionStmt,ExpressionStatement:ExpressionStatement,ReturnStatement:ReturnStatement,IfStmt:IfStmt,RecursiveAstVisitor:RecursiveAstVisitor$1,leadingComment:leadingComment,jsDocComment:jsDocComment,variable:variable,importExpr:importExpr,importType:importType,expressionType:expressionType,transplantedType:transplantedType,typeofExpr:typeofExpr,literalArr:literalArr,literalMap:literalMap,unary:unary,not:not,fn:fn,arrowFn:arrowFn,ifStmt:ifStmt,taggedTemplate:taggedTemplate,literal:literal,localizedString:localizedString,isNull:isNull});const CONSTANT_PREFIX="_c";const UNKNOWN_VALUE_KEY=variable("<unknown>");const KEY_CONTEXT={};const POOL_INCLUSION_LENGTH_THRESHOLD_FOR_STRINGS=50;class FixupExpression extends Expression{constructor(resolved){super(resolved.type);this.resolved=resolved;this.shared=false;this.original=resolved}visitExpression(visitor,context){if(context===KEY_CONTEXT){return this.original.visitExpression(visitor,context)}else{return this.resolved.visitExpression(visitor,context)}}isEquivalent(e){return e instanceof FixupExpression&&this.resolved.isEquivalent(e.resolved)}isConstant(){return true}clone(){throw new Error(`Not supported.`)}fixup(expression){this.resolved=expression;this.shared=true}}class ConstantPool{constructor(isClosureCompilerEnabled=false){this.isClosureCompilerEnabled=isClosureCompilerEnabled;this.statements=[];this.literals=new Map;this.literalFactories=new Map;this.sharedConstants=new Map;this._claimedNames=new Map;this.nextNameIndex=0}getConstLiteral(literal,forceShared){if(literal instanceof LiteralExpr&&!isLongStringLiteral(literal)||literal instanceof FixupExpression){return literal}const key=GenericKeyFn.INSTANCE.keyOf(literal);let fixup=this.literals.get(key);let newValue=false;if(!fixup){fixup=new FixupExpression(literal);this.literals.set(key,fixup);newValue=true}if(!newValue&&!fixup.shared||newValue&&forceShared){const name=this.freshName();let definition;let usage;if(this.isClosureCompilerEnabled&&isLongStringLiteral(literal)){definition=variable(name).set(new FunctionExpr([],[new ReturnStatement(literal)]));usage=variable(name).callFn([])}else{definition=variable(name).set(literal);usage=variable(name)}this.statements.push(definition.toDeclStmt(INFERRED_TYPE,exports.StmtModifier.Final));fixup.fixup(usage)}return fixup}getSharedConstant(def,expr){const key=def.keyOf(expr);if(!this.sharedConstants.has(key)){const id=this.freshName();this.sharedConstants.set(key,variable(id));this.statements.push(def.toSharedConstantDeclaration(id,expr))}return this.sharedConstants.get(key)}getLiteralFactory(literal){if(literal instanceof LiteralArrayExpr){const argumentsForKey=literal.entries.map((e=>e.isConstant()?e:UNKNOWN_VALUE_KEY));const key=GenericKeyFn.INSTANCE.keyOf(literalArr(argumentsForKey));return this._getLiteralFactory(key,literal.entries,(entries=>literalArr(entries)))}else{const expressionForKey=literalMap(literal.entries.map((e=>({key:e.key,value:e.value.isConstant()?e.value:UNKNOWN_VALUE_KEY,quoted:e.quoted}))));const key=GenericKeyFn.INSTANCE.keyOf(expressionForKey);return this._getLiteralFactory(key,literal.entries.map((e=>e.value)),(entries=>literalMap(entries.map(((value,index)=>({key:literal.entries[index].key,value:value,quoted:literal.entries[index].quoted}))))))}}getSharedFunctionReference(fn,prefix,useUniqueName=true){const isArrow=fn instanceof ArrowFunctionExpr;for(const current of this.statements){if(isArrow&¤t instanceof DeclareVarStmt&¤t.value?.isEquivalent(fn)){return variable(current.name)}if(!isArrow&¤t instanceof DeclareFunctionStmt&&fn.isEquivalent(current)){return variable(current.name)}}const name=useUniqueName?this.uniqueName(prefix):prefix;this.statements.push(fn.toDeclStmt(name,exports.StmtModifier.Final));return variable(name)}_getLiteralFactory(key,values,resultMap){let literalFactory=this.literalFactories.get(key);const literalFactoryArguments=values.filter((e=>!e.isConstant()));if(!literalFactory){const resultExpressions=values.map(((e,index)=>e.isConstant()?this.getConstLiteral(e,true):variable(`a${index}`)));const parameters=resultExpressions.filter(isVariable).map((e=>new FnParam(e.name,DYNAMIC_TYPE)));const pureFunctionDeclaration=arrowFn(parameters,resultMap(resultExpressions),INFERRED_TYPE);const name=this.freshName();this.statements.push(variable(name).set(pureFunctionDeclaration).toDeclStmt(INFERRED_TYPE,exports.StmtModifier.Final));literalFactory=variable(name);this.literalFactories.set(key,literalFactory)}return{literalFactory:literalFactory,literalFactoryArguments:literalFactoryArguments}}uniqueName(name,alwaysIncludeSuffix=true){const count=this._claimedNames.get(name)??0;const result=count===0&&!alwaysIncludeSuffix?`${name}`:`${name}${count}`;this._claimedNames.set(name,count+1);return result}freshName(){return this.uniqueName(CONSTANT_PREFIX)}}class GenericKeyFn{static{this.INSTANCE=new GenericKeyFn}keyOf(expr){if(expr instanceof LiteralExpr&&typeof expr.value==="string"){return`"${expr.value}"`}else if(expr instanceof LiteralExpr){return String(expr.value)}else if(expr instanceof LiteralArrayExpr){const entries=[];for(const entry of expr.entries){entries.push(this.keyOf(entry))}return`[${entries.join(",")}]`}else if(expr instanceof LiteralMapExpr){const entries=[];for(const entry of expr.entries){let key=entry.key;if(entry.quoted){key=`"${key}"`}entries.push(key+":"+this.keyOf(entry.value))}return`{${entries.join(",")}}`}else if(expr instanceof ExternalExpr){return`import("${expr.value.moduleName}", ${expr.value.name})`}else if(expr instanceof ReadVarExpr){return`read(${expr.name})`}else if(expr instanceof TypeofExpr){return`typeof(${this.keyOf(expr.expr)})`}else{throw new Error(`${this.constructor.name} does not handle expressions of type ${expr.constructor.name}`)}}}function isVariable(e){return e instanceof ReadVarExpr}function isLongStringLiteral(expr){return expr instanceof LiteralExpr&&typeof expr.value==="string"&&expr.value.length>=POOL_INCLUSION_LENGTH_THRESHOLD_FOR_STRINGS}const CORE="@angular/core";class Identifiers{static{this.NEW_METHOD="factory"}static{this.TRANSFORM_METHOD="transform"}static{this.PATCH_DEPS="patchedDeps"}static{this.core={name:null,moduleName:CORE}}static{this.namespaceHTML={name:"\u0275\u0275namespaceHTML",moduleName:CORE}}static{this.namespaceMathML={name:"\u0275\u0275namespaceMathML",moduleName:CORE}}static{this.namespaceSVG={name:"\u0275\u0275namespaceSVG",moduleName:CORE}}static{this.element={name:"\u0275\u0275element",moduleName:CORE}}static{this.elementStart={name:"\u0275\u0275elementStart",moduleName:CORE}}static{this.elementEnd={name:"\u0275\u0275elementEnd",moduleName:CORE}}static{this.advance={name:"\u0275\u0275advance",moduleName:CORE}}static{this.syntheticHostProperty={name:"\u0275\u0275syntheticHostProperty",moduleName:CORE}}static{this.syntheticHostListener={name:"\u0275\u0275syntheticHostListener",moduleName:CORE}}static{this.attribute={name:"\u0275\u0275attribute",moduleName:CORE}}static{this.attributeInterpolate1={name:"\u0275\u0275attributeInterpolate1",moduleName:CORE}}static{this.attributeInterpolate2={name:"\u0275\u0275attributeInterpolate2",moduleName:CORE}}static{this.attributeInterpolate3={name:"\u0275\u0275attributeInterpolate3",moduleName:CORE}}static{this.attributeInterpolate4={name:"\u0275\u0275attributeInterpolate4",moduleName:CORE}}static{this.attributeInterpolate5={name:"\u0275\u0275attributeInterpolate5",moduleName:CORE}}static{this.attributeInterpolate6={name:"\u0275\u0275attributeInterpolate6",moduleName:CORE}}static{this.attributeInterpolate7={name:"\u0275\u0275attributeInterpolate7",moduleName:CORE}}static{this.attributeInterpolate8={name:"\u0275\u0275attributeInterpolate8",moduleName:CORE}}static{this.attributeInterpolateV={name:"\u0275\u0275attributeInterpolateV",moduleName:CORE}}static{this.classProp={name:"\u0275\u0275classProp",moduleName:CORE}}static{this.elementContainerStart={name:"\u0275\u0275elementContainerStart",moduleName:CORE}}static{this.elementContainerEnd={name:"\u0275\u0275elementContainerEnd",moduleName:CORE}}static{this.elementContainer={name:"\u0275\u0275elementContainer",moduleName:CORE}}static{this.styleMap={name:"\u0275\u0275styleMap",moduleName:CORE}}static{this.styleMapInterpolate1={name:"\u0275\u0275styleMapInterpolate1",moduleName:CORE}}static{this.styleMapInterpolate2={name:"\u0275\u0275styleMapInterpolate2",moduleName:CORE}}static{this.styleMapInterpolate3={name:"\u0275\u0275styleMapInterpolate3",moduleName:CORE}}static{this.styleMapInterpolate4={name:"\u0275\u0275styleMapInterpolate4",moduleName:CORE}}static{this.styleMapInterpolate5={name:"\u0275\u0275styleMapInterpolate5",moduleName:CORE}}static{this.styleMapInterpolate6={name:"\u0275\u0275styleMapInterpolate6",moduleName:CORE}}static{this.styleMapInterpolate7={name:"\u0275\u0275styleMapInterpolate7",moduleName:CORE}}static{this.styleMapInterpolate8={name:"\u0275\u0275styleMapInterpolate8",moduleName:CORE}}static{this.styleMapInterpolateV={name:"\u0275\u0275styleMapInterpolateV",moduleName:CORE}}static{this.classMap={name:"\u0275\u0275classMap",moduleName:CORE}}static{this.classMapInterpolate1={name:"\u0275\u0275classMapInterpolate1",moduleName:CORE}}static{this.classMapInterpolate2={name:"\u0275\u0275classMapInterpolate2",moduleName:CORE}}static{this.classMapInterpolate3={name:"\u0275\u0275classMapInterpolate3",moduleName:CORE}}static{this.classMapInterpolate4={name:"\u0275\u0275classMapInterpolate4",moduleName:CORE}}static{this.classMapInterpolate5={name:"\u0275\u0275classMapInterpolate5",moduleName:CORE}}static{this.classMapInterpolate6={name:"\u0275\u0275classMapInterpolate6",moduleName:CORE}}static{this.classMapInterpolate7={name:"\u0275\u0275classMapInterpolate7",moduleName:CORE}}static{this.classMapInterpolate8={name:"\u0275\u0275classMapInterpolate8",moduleName:CORE}}static{this.classMapInterpolateV={name:"\u0275\u0275classMapInterpolateV",moduleName:CORE}}static{this.styleProp={name:"\u0275\u0275styleProp",moduleName:CORE}}static{this.stylePropInterpolate1={name:"\u0275\u0275stylePropInterpolate1",moduleName:CORE}}static{this.stylePropInterpolate2={name:"\u0275\u0275stylePropInterpolate2",moduleName:CORE}}static{this.stylePropInterpolate3={name:"\u0275\u0275stylePropInterpolate3",moduleName:CORE}}static{this.stylePropInterpolate4={name:"\u0275\u0275stylePropInterpolate4",moduleName:CORE}}static{this.stylePropInterpolate5={name:"\u0275\u0275stylePropInterpolate5",moduleName:CORE}}static{this.stylePropInterpolate6={name:"\u0275\u0275stylePropInterpolate6",moduleName:CORE}}static{this.stylePropInterpolate7={name:"\u0275\u0275stylePropInterpolate7",moduleName:CORE}}static{this.stylePropInterpolate8={name:"\u0275\u0275stylePropInterpolate8",moduleName:CORE}}static{this.stylePropInterpolateV={name:"\u0275\u0275stylePropInterpolateV",moduleName:CORE}}static{this.nextContext={name:"\u0275\u0275nextContext",moduleName:CORE}}static{this.resetView={name:"\u0275\u0275resetView",moduleName:CORE}}static{this.templateCreate={name:"\u0275\u0275template",moduleName:CORE}}static{this.defer={name:"\u0275\u0275defer",moduleName:CORE}}static{this.deferWhen={name:"\u0275\u0275deferWhen",moduleName:CORE}}static{this.deferOnIdle={name:"\u0275\u0275deferOnIdle",moduleName:CORE}}static{this.deferOnImmediate={name:"\u0275\u0275deferOnImmediate",moduleName:CORE}}static{this.deferOnTimer={name:"\u0275\u0275deferOnTimer",moduleName:CORE}}static{this.deferOnHover={name:"\u0275\u0275deferOnHover",moduleName:CORE}}static{this.deferOnInteraction={name:"\u0275\u0275deferOnInteraction",moduleName:CORE}}static{this.deferOnViewport={name:"\u0275\u0275deferOnViewport",moduleName:CORE}}static{this.deferPrefetchWhen={name:"\u0275\u0275deferPrefetchWhen",moduleName:CORE}}static{this.deferPrefetchOnIdle={name:"\u0275\u0275deferPrefetchOnIdle",moduleName:CORE}}static{this.deferPrefetchOnImmediate={name:"\u0275\u0275deferPrefetchOnImmediate",moduleName:CORE}}static{this.deferPrefetchOnTimer={name:"\u0275\u0275deferPrefetchOnTimer",moduleName:CORE}}static{this.deferPrefetchOnHover={name:"\u0275\u0275deferPrefetchOnHover",moduleName:CORE}}static{this.deferPrefetchOnInteraction={name:"\u0275\u0275deferPrefetchOnInteraction",moduleName:CORE}}static{this.deferPrefetchOnViewport={name:"\u0275\u0275deferPrefetchOnViewport",moduleName:CORE}}static{this.deferEnableTimerScheduling={name:"\u0275\u0275deferEnableTimerScheduling",moduleName:CORE}}static{this.conditional={name:"\u0275\u0275conditional",moduleName:CORE}}static{this.repeater={name:"\u0275\u0275repeater",moduleName:CORE}}static{this.repeaterCreate={name:"\u0275\u0275repeaterCreate",moduleName:CORE}}static{this.repeaterTrackByIndex={name:"\u0275\u0275repeaterTrackByIndex",moduleName:CORE}}static{this.repeaterTrackByIdentity={name:"\u0275\u0275repeaterTrackByIdentity",moduleName:CORE}}static{this.componentInstance={name:"\u0275\u0275componentInstance",moduleName:CORE}}static{this.text={name:"\u0275\u0275text",moduleName:CORE}}static{this.enableBindings={name:"\u0275\u0275enableBindings",moduleName:CORE}}static{this.disableBindings={name:"\u0275\u0275disableBindings",moduleName:CORE}}static{this.getCurrentView={name:"\u0275\u0275getCurrentView",moduleName:CORE}}static{this.textInterpolate={name:"\u0275\u0275textInterpolate",moduleName:CORE}}static{this.textInterpolate1={name:"\u0275\u0275textInterpolate1",moduleName:CORE}}static{this.textInterpolate2={name:"\u0275\u0275textInterpolate2",moduleName:CORE}}static{this.textInterpolate3={name:"\u0275\u0275textInterpolate3",moduleName:CORE}}static{this.textInterpolate4={name:"\u0275\u0275textInterpolate4",moduleName:CORE}}static{this.textInterpolate5={name:"\u0275\u0275textInterpolate5",moduleName:CORE}}static{this.textInterpolate6={name:"\u0275\u0275textInterpolate6",moduleName:CORE}}static{this.textInterpolate7={name:"\u0275\u0275textInterpolate7",moduleName:CORE}}static{this.textInterpolate8={name:"\u0275\u0275textInterpolate8",moduleName:CORE}}static{this.textInterpolateV={name:"\u0275\u0275textInterpolateV",moduleName:CORE}}static{this.restoreView={name:"\u0275\u0275restoreView",moduleName:CORE}}static{this.pureFunction0={name:"\u0275\u0275pureFunction0",moduleName:CORE}}static{this.pureFunction1={name:"\u0275\u0275pureFunction1",moduleName:CORE}}static{this.pureFunction2={name:"\u0275\u0275pureFunction2",moduleName:CORE}}static{this.pureFunction3={name:"\u0275\u0275pureFunction3",moduleName:CORE}}static{this.pureFunction4={name:"\u0275\u0275pureFunction4",moduleName:CORE}}static{this.pureFunction5={name:"\u0275\u0275pureFunction5",moduleName:CORE}}static{this.pureFunction6={name:"\u0275\u0275pureFunction6",moduleName:CORE}}static{this.pureFunction7={name:"\u0275\u0275pureFunction7",moduleName:CORE}}static{this.pureFunction8={name:"\u0275\u0275pureFunction8",moduleName:CORE}}static{this.pureFunctionV={name:"\u0275\u0275pureFunctionV",moduleName:CORE}}static{this.pipeBind1={name:"\u0275\u0275pipeBind1",moduleName:CORE}}static{this.pipeBind2={name:"\u0275\u0275pipeBind2",moduleName:CORE}}static{this.pipeBind3={name:"\u0275\u0275pipeBind3",moduleName:CORE}}static{this.pipeBind4={name:"\u0275\u0275pipeBind4",moduleName:CORE}}static{this.pipeBindV={name:"\u0275\u0275pipeBindV",moduleName:CORE}}static{this.hostProperty={name:"\u0275\u0275hostProperty",moduleName:CORE}}static{this.property={name:"\u0275\u0275property",moduleName:CORE}}static{this.propertyInterpolate={name:"\u0275\u0275propertyInterpolate",moduleName:CORE}}static{this.propertyInterpolate1={name:"\u0275\u0275propertyInterpolate1",moduleName:CORE}}static{this.propertyInterpolate2={name:"\u0275\u0275propertyInterpolate2",moduleName:CORE}}static{this.propertyInterpolate3={name:"\u0275\u0275propertyInterpolate3",moduleName:CORE}}static{this.propertyInterpolate4={name:"\u0275\u0275propertyInterpolate4",moduleName:CORE}}static{this.propertyInterpolate5={name:"\u0275\u0275propertyInterpolate5",moduleName:CORE}}static{this.propertyInterpolate6={name:"\u0275\u0275propertyInterpolate6",moduleName:CORE}}static{this.propertyInterpolate7={name:"\u0275\u0275propertyInterpolate7",moduleName:CORE}}static{this.propertyInterpolate8={name:"\u0275\u0275propertyInterpolate8",moduleName:CORE}}static{this.propertyInterpolateV={name:"\u0275\u0275propertyInterpolateV",moduleName:CORE}}static{this.i18n={name:"\u0275\u0275i18n",moduleName:CORE}}static{this.i18nAttributes={name:"\u0275\u0275i18nAttributes",moduleName:CORE}}static{this.i18nExp={name:"\u0275\u0275i18nExp",moduleName:CORE}}static{this.i18nStart={name:"\u0275\u0275i18nStart",moduleName:CORE}}static{this.i18nEnd={name:"\u0275\u0275i18nEnd",moduleName:CORE}}static{this.i18nApply={name:"\u0275\u0275i18nApply",moduleName:CORE}}static{this.i18nPostprocess={name:"\u0275\u0275i18nPostprocess",moduleName:CORE}}static{this.pipe={name:"\u0275\u0275pipe",moduleName:CORE}}static{this.projection={name:"\u0275\u0275projection",moduleName:CORE}}static{this.projectionDef={name:"\u0275\u0275projectionDef",moduleName:CORE}}static{this.reference={name:"\u0275\u0275reference",moduleName:CORE}}static{this.inject={name:"\u0275\u0275inject",moduleName:CORE}}static{this.injectAttribute={name:"\u0275\u0275injectAttribute",moduleName:CORE}}static{this.directiveInject={name:"\u0275\u0275directiveInject",moduleName:CORE}}static{this.invalidFactory={name:"\u0275\u0275invalidFactory",moduleName:CORE}}static{this.invalidFactoryDep={name:"\u0275\u0275invalidFactoryDep",moduleName:CORE}}static{this.templateRefExtractor={name:"\u0275\u0275templateRefExtractor",moduleName:CORE}}static{this.forwardRef={name:"forwardRef",moduleName:CORE}}static{this.resolveForwardRef={name:"resolveForwardRef",moduleName:CORE}}static{this.\u0275\u0275defineInjectable={name:"\u0275\u0275defineInjectable",moduleName:CORE}}static{this.declareInjectable={name:"\u0275\u0275ngDeclareInjectable",moduleName:CORE}}static{this.InjectableDeclaration={name:"\u0275\u0275InjectableDeclaration",moduleName:CORE}}static{this.resolveWindow={name:"\u0275\u0275resolveWindow",moduleName:CORE}}static{this.resolveDocument={name:"\u0275\u0275resolveDocument",moduleName:CORE}}static{this.resolveBody={name:"\u0275\u0275resolveBody",moduleName:CORE}}static{this.getComponentDepsFactory={name:"\u0275\u0275getComponentDepsFactory",moduleName:CORE}}static{this.defineComponent={name:"\u0275\u0275defineComponent",moduleName:CORE}}static{this.declareComponent={name:"\u0275\u0275ngDeclareComponent",moduleName:CORE}}static{this.setComponentScope={name:"\u0275\u0275setComponentScope",moduleName:CORE}}static{this.ChangeDetectionStrategy={name:"ChangeDetectionStrategy",moduleName:CORE}}static{this.ViewEncapsulation={name:"ViewEncapsulation",moduleName:CORE}}static{this.ComponentDeclaration={name:"\u0275\u0275ComponentDeclaration",moduleName:CORE}}static{this.FactoryDeclaration={name:"\u0275\u0275FactoryDeclaration",moduleName:CORE}}static{this.declareFactory={name:"\u0275\u0275ngDeclareFactory",moduleName:CORE}}static{this.FactoryTarget={name:"\u0275\u0275FactoryTarget",moduleName:CORE}}static{this.defineDirective={name:"\u0275\u0275defineDirective",moduleName:CORE}}static{this.declareDirective={name:"\u0275\u0275ngDeclareDirective",moduleName:CORE}}static{this.DirectiveDeclaration={name:"\u0275\u0275DirectiveDeclaration",moduleName:CORE}}static{this.InjectorDef={name:"\u0275\u0275InjectorDef",moduleName:CORE}}static{this.InjectorDeclaration={name:"\u0275\u0275InjectorDeclaration",moduleName:CORE}}static{this.defineInjector={name:"\u0275\u0275defineInjector",moduleName:CORE}}static{this.declareInjector={name:"\u0275\u0275ngDeclareInjector",moduleName:CORE}}static{this.NgModuleDeclaration={name:"\u0275\u0275NgModuleDeclaration",moduleName:CORE}}static{this.ModuleWithProviders={name:"ModuleWithProviders",moduleName:CORE}}static{this.defineNgModule={name:"\u0275\u0275defineNgModule",moduleName:CORE}}static{this.declareNgModule={name:"\u0275\u0275ngDeclareNgModule",moduleName:CORE}}static{this.setNgModuleScope={name:"\u0275\u0275setNgModuleScope",moduleName:CORE}}static{this.registerNgModuleType={name:"\u0275\u0275registerNgModuleType",moduleName:CORE}}static{this.PipeDeclaration={name:"\u0275\u0275PipeDeclaration",moduleName:CORE}}static{this.definePipe={name:"\u0275\u0275definePipe",moduleName:CORE}}static{this.declarePipe={name:"\u0275\u0275ngDeclarePipe",moduleName:CORE}}static{this.declareClassMetadata={name:"\u0275\u0275ngDeclareClassMetadata",moduleName:CORE}}static{this.setClassMetadata={name:"\u0275setClassMetadata",moduleName:CORE}}static{this.setClassMetadataAsync={name:"\u0275setClassMetadataAsync",moduleName:CORE}}static{this.setClassDebugInfo={name:"\u0275setClassDebugInfo",moduleName:CORE}}static{this.queryRefresh={name:"\u0275\u0275queryRefresh",moduleName:CORE}}static{this.viewQuery={name:"\u0275\u0275viewQuery",moduleName:CORE}}static{this.loadQuery={name:"\u0275\u0275loadQuery",moduleName:CORE}}static{this.contentQuery={name:"\u0275\u0275contentQuery",moduleName:CORE}}static{this.viewQuerySignal={name:"\u0275\u0275viewQuerySignal",moduleName:CORE}}static{this.contentQuerySignal={name:"\u0275\u0275contentQuerySignal",moduleName:CORE}}static{this.queryAdvance={name:"\u0275\u0275queryAdvance",moduleName:CORE}}static{this.twoWayProperty={name:"\u0275\u0275twoWayProperty",moduleName:CORE}}static{this.twoWayBindingSet={name:"\u0275\u0275twoWayBindingSet",moduleName:CORE}}static{this.twoWayListener={name:"\u0275\u0275twoWayListener",moduleName:CORE}}static{this.NgOnChangesFeature={name:"\u0275\u0275NgOnChangesFeature",moduleName:CORE}}static{this.InheritDefinitionFeature={name:"\u0275\u0275InheritDefinitionFeature",moduleName:CORE}}static{this.CopyDefinitionFeature={name:"\u0275\u0275CopyDefinitionFeature",moduleName:CORE}}static{this.StandaloneFeature={name:"\u0275\u0275StandaloneFeature",moduleName:CORE}}static{this.ProvidersFeature={name:"\u0275\u0275ProvidersFeature",moduleName:CORE}}static{this.HostDirectivesFeature={name:"\u0275\u0275HostDirectivesFeature",moduleName:CORE}}static{this.InputTransformsFeatureFeature={name:"\u0275\u0275InputTransformsFeature",moduleName:CORE}}static{this.listener={name:"\u0275\u0275listener",moduleName:CORE}}static{this.getInheritedFactory={name:"\u0275\u0275getInheritedFactory",moduleName:CORE}}static{this.InputFlags={name:"\u0275\u0275InputFlags",moduleName:CORE}}static{this.sanitizeHtml={name:"\u0275\u0275sanitizeHtml",moduleName:CORE}}static{this.sanitizeStyle={name:"\u0275\u0275sanitizeStyle",moduleName:CORE}}static{this.sanitizeResourceUrl={name:"\u0275\u0275sanitizeResourceUrl",moduleName:CORE}}static{this.sanitizeScript={name:"\u0275\u0275sanitizeScript",moduleName:CORE}}static{this.sanitizeUrl={name:"\u0275\u0275sanitizeUrl",moduleName:CORE}}static{this.sanitizeUrlOrResourceUrl={name:"\u0275\u0275sanitizeUrlOrResourceUrl",moduleName:CORE}}static{this.trustConstantHtml={name:"\u0275\u0275trustConstantHtml",moduleName:CORE}}static{this.trustConstantResourceUrl={name:"\u0275\u0275trustConstantResourceUrl",moduleName:CORE}}static{this.validateIframeAttribute={name:"\u0275\u0275validateIframeAttribute",moduleName:CORE}}static{this.InputSignalBrandWriteType={name:"\u0275INPUT_SIGNAL_BRAND_WRITE_TYPE",moduleName:CORE}}static{this.UnwrapDirectiveSignalInputs={name:"\u0275UnwrapDirectiveSignalInputs",moduleName:CORE}}static{this.unwrapWritableSignal={name:"\u0275unwrapWritableSignal",moduleName:CORE}}}const DASH_CASE_REGEXP=/-+([a-z0-9])/g;function dashCaseToCamelCase(input){return input.replace(DASH_CASE_REGEXP,((...m)=>m[1].toUpperCase()))}function splitAtColon(input,defaultValues){return _splitAt(input,":",defaultValues)}function splitAtPeriod(input,defaultValues){return _splitAt(input,".",defaultValues)}function _splitAt(input,character,defaultValues){const characterIndex=input.indexOf(character);if(characterIndex==-1)return defaultValues;return[input.slice(0,characterIndex).trim(),input.slice(characterIndex+1).trim()]}function noUndefined(val){return val===undefined?null:val}function error(msg){throw new Error(`Internal Error: ${msg}`)}function utf8Encode(str){let encoded=[];for(let index=0;index<str.length;index++){let codePoint=str.charCodeAt(index);if(codePoint>=55296&&codePoint<=56319&&str.length>index+1){const low=str.charCodeAt(index+1);if(low>=56320&&low<=57343){index++;codePoint=(codePoint-55296<<10)+low-56320+65536}}if(codePoint<=127){encoded.push(codePoint)}else if(codePoint<=2047){encoded.push(codePoint>>6&31|192,codePoint&63|128)}else if(codePoint<=65535){encoded.push(codePoint>>12|224,codePoint>>6&63|128,codePoint&63|128)}else if(codePoint<=2097151){encoded.push(codePoint>>18&7|240,codePoint>>12&63|128,codePoint>>6&63|128,codePoint&63|128)}}return encoded}function stringify(token){if(typeof token==="string"){return token}if(Array.isArray(token)){return"["+token.map(stringify).join(", ")+"]"}if(token==null){return""+token}if(token.overriddenName){return`${token.overriddenName}`}if(token.name){return`${token.name}`}if(!token.toString){return"object"}const res=token.toString();if(res==null){return""+res}const newLineIndex=res.indexOf("\n");return newLineIndex===-1?res:res.substring(0,newLineIndex)}class Version{constructor(full){this.full=full;const splits=full.split(".");this.major=splits[0];this.minor=splits[1];this.patch=splits.slice(2).join(".")}}const _global=globalThis;function partitionArray(arr,conditionFn){const truthy=[];const falsy=[];for(const item of arr){(conditionFn(item)?truthy:falsy).push(item)}return[truthy,falsy]}const VERSION$1=3;const JS_B64_PREFIX="# sourceMappingURL=data:application/json;base64,";class SourceMapGenerator{constructor(file=null){this.file=file;this.sourcesContent=new Map;this.lines=[];this.lastCol0=0;this.hasMappings=false}addSource(url,content=null){if(!this.sourcesContent.has(url)){this.sourcesContent.set(url,content)}return this}addLine(){this.lines.push([]);this.lastCol0=0;return this}addMapping(col0,sourceUrl,sourceLine0,sourceCol0){if(!this.currentLine){throw new Error(`A line must be added before mappings can be added`)}if(sourceUrl!=null&&!this.sourcesContent.has(sourceUrl)){throw new Error(`Unknown source file "${sourceUrl}"`)}if(col0==null){throw new Error(`The column in the generated code must be provided`)}if(col0<this.lastCol0){throw new Error(`Mapping should be added in output order`)}if(sourceUrl&&(sourceLine0==null||sourceCol0==null)){throw new Error(`The source location must be provided when a source url is provided`)}this.hasMappings=true;this.lastCol0=col0;this.currentLine.push({col0:col0,sourceUrl:sourceUrl,sourceLine0:sourceLine0,sourceCol0:sourceCol0});return this}get currentLine(){return this.lines.slice(-1)[0]}toJSON(){if(!this.hasMappings){return null}const sourcesIndex=new Map;const sources=[];const sourcesContent=[];Array.from(this.sourcesContent.keys()).forEach(((url,i)=>{sourcesIndex.set(url,i);sources.push(url);sourcesContent.push(this.sourcesContent.get(url)||null)}));let mappings="";let lastCol0=0;let lastSourceIndex=0;let lastSourceLine0=0;let lastSourceCol0=0;this.lines.forEach((segments=>{lastCol0=0;mappings+=segments.map((segment=>{let segAsStr=toBase64VLQ(segment.col0-lastCol0);lastCol0=segment.col0;if(segment.sourceUrl!=null){segAsStr+=toBase64VLQ(sourcesIndex.get(segment.sourceUrl)-lastSourceIndex);lastSourceIndex=sourcesIndex.get(segment.sourceUrl);segAsStr+=toBase64VLQ(segment.sourceLine0-lastSourceLine0);lastSourceLine0=segment.sourceLine0;segAsStr+=toBase64VLQ(segment.sourceCol0-lastSourceCol0);lastSourceCol0=segment.sourceCol0}return segAsStr})).join(",");mappings+=";"}));mappings=mappings.slice(0,-1);return{file:this.file||"",version:VERSION$1,sourceRoot:"",sources:sources,sourcesContent:sourcesContent,mappings:mappings}}toJsComment(){return this.hasMappings?"//"+JS_B64_PREFIX+toBase64String(JSON.stringify(this,null,0)):""}}function toBase64String(value){let b64="";const encoded=utf8Encode(value);for(let i=0;i<encoded.length;){const i1=encoded[i++];const i2=i<encoded.length?encoded[i++]:null;const i3=i<encoded.length?encoded[i++]:null;b64+=toBase64Digit(i1>>2);b64+=toBase64Digit((i1&3)<<4|(i2===null?0:i2>>4));b64+=i2===null?"=":toBase64Digit((i2&15)<<2|(i3===null?0:i3>>6));b64+=i2===null||i3===null?"=":toBase64Digit(i3&63)}return b64}function toBase64VLQ(value){value=value<0?(-value<<1)+1:value<<1;let out="";do{let digit=value&31;value=value>>5;if(value>0){digit=digit|32}out+=toBase64Digit(digit)}while(value>0);return out}const B64_DIGITS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function toBase64Digit(value){if(value<0||value>=64){throw new Error(`Can only encode value in the range [0, 63]`)}return B64_DIGITS[value]}const _SINGLE_QUOTE_ESCAPE_STRING_RE=/'|\\|\n|\r|\$/g;const _LEGAL_IDENTIFIER_RE=/^[$A-Z_][0-9A-Z_$]*$/i;const _INDENT_WITH=" ";class _EmittedLine{constructor(indent){this.indent=indent;this.partsLength=0;this.parts=[];this.srcSpans=[]}}class EmitterVisitorContext{static createRoot(){return new EmitterVisitorContext(0)}constructor(_indent){this._indent=_indent;this._lines=[new _EmittedLine(_indent)]}get _currentLine(){return this._lines[this._lines.length-1]}println(from,lastPart=""){this.print(from||null,lastPart,true)}lineIsEmpty(){return this._currentLine.parts.length===0}lineLength(){return this._currentLine.indent*_INDENT_WITH.length+this._currentLine.partsLength}print(from,part,newLine=false){if(part.length>0){this._currentLine.parts.push(part);this._currentLine.partsLength+=part.length;this._currentLine.srcSpans.push(from&&from.sourceSpan||null)}if(newLine){this._lines.push(new _EmittedLine(this._indent))}}removeEmptyLastLine(){if(this.lineIsEmpty()){this._lines.pop()}}incIndent(){this._indent++;if(this.lineIsEmpty()){this._currentLine.indent=this._indent}}decIndent(){this._indent--;if(this.lineIsEmpty()){this._currentLine.indent=this._indent}}toSource(){return this.sourceLines.map((l=>l.parts.length>0?_createIndent(l.indent)+l.parts.join(""):"")).join("\n")}toSourceMapGenerator(genFilePath,startsAtLine=0){const map=new SourceMapGenerator(genFilePath);let firstOffsetMapped=false;const mapFirstOffsetIfNeeded=()=>{if(!firstOffsetMapped){map.addSource(genFilePath," ").addMapping(0,genFilePath,0,0);firstOffsetMapped=true}};for(let i=0;i<startsAtLine;i++){map.addLine();mapFirstOffsetIfNeeded()}this.sourceLines.forEach(((line,lineIdx)=>{map.addLine();const spans=line.srcSpans;const parts=line.parts;let col0=line.indent*_INDENT_WITH.length;let spanIdx=0;while(spanIdx<spans.length&&!spans[spanIdx]){col0+=parts[spanIdx].length;spanIdx++}if(spanIdx<spans.length&&lineIdx===0&&col0===0){firstOffsetMapped=true}else{mapFirstOffsetIfNeeded()}while(spanIdx<spans.length){const span=spans[spanIdx];const source=span.start.file;const sourceLine=span.start.line;const sourceCol=span.start.col;map.addSource(source.url,source.content).addMapping(col0,source.url,sourceLine,sourceCol);col0+=parts[spanIdx].length;spanIdx++;while(spanIdx<spans.length&&(span===spans[spanIdx]||!spans[spanIdx])){col0+=parts[spanIdx].length;spanIdx++}}}));return map}spanOf(line,column){const emittedLine=this._lines[line];if(emittedLine){let columnsLeft=column-_createIndent(emittedLine.indent).length;for(let partIndex=0;partIndex<emittedLine.parts.length;partIndex++){const part=emittedLine.parts[partIndex];if(part.length>columnsLeft){return emittedLine.srcSpans[partIndex]}columnsLeft-=part.length}}return null}get sourceLines(){if(this._lines.length&&this._lines[this._lines.length-1].parts.length===0){return this._lines.slice(0,-1)}return this._lines}}class AbstractEmitterVisitor{constructor(_escapeDollarInStrings){this._escapeDollarInStrings=_escapeDollarInStrings}printLeadingComments(stmt,ctx){if(stmt.leadingComments===undefined){return}for(const comment of stmt.leadingComments){if(comment instanceof JSDocComment){ctx.print(stmt,`/*${comment.toString()}*/`,comment.trailingNewline)}else{if(comment.multiline){ctx.print(stmt,`/* ${comment.text} */`,comment.trailingNewline)}else{comment.text.split("\n").forEach((line=>{ctx.println(stmt,`// ${line}`)}))}}}}visitExpressionStmt(stmt,ctx){this.printLeadingComments(stmt,ctx);stmt.expr.visitExpression(this,ctx);ctx.println(stmt,";");return null}visitReturnStmt(stmt,ctx){this.printLeadingComments(stmt,ctx);ctx.print(stmt,`return `);stmt.value.visitExpression(this,ctx);ctx.println(stmt,";");return null}visitIfStmt(stmt,ctx){this.printLeadingComments(stmt,ctx);ctx.print(stmt,`if (`);stmt.condition.visitExpression(this,ctx);ctx.print(stmt,`) {`);const hasElseCase=stmt.falseCase!=null&&stmt.falseCase.length>0;if(stmt.trueCase.length<=1&&!hasElseCase){ctx.print(stmt,` `);this.visitAllStatements(stmt.trueCase,ctx);ctx.removeEmptyLastLine();ctx.print(stmt,` `)}else{ctx.println();ctx.incIndent();this.visitAllStatements(stmt.trueCase,ctx);ctx.decIndent();if(hasElseCase){ctx.println(stmt,`} else {`);ctx.incIndent();this.visitAllStatements(stmt.falseCase,ctx);ctx.decIndent()}}ctx.println(stmt,`}`);return null}visitWriteVarExpr(expr,ctx){const lineWasEmpty=ctx.lineIsEmpty();if(!lineWasEmpty){ctx.print(expr,"(")}ctx.print(expr,`${expr.name} = `);expr.value.visitExpression(this,ctx);if(!lineWasEmpty){ctx.print(expr,")")}return null}visitWriteKeyExpr(expr,ctx){const lineWasEmpty=ctx.lineIsEmpty();if(!lineWasEmpty){ctx.print(expr,"(")}expr.receiver.visitExpression(this,ctx);ctx.print(expr,`[`);expr.index.visitExpression(this,ctx);ctx.print(expr,`] = `);expr.value.visitExpression(this,ctx);if(!lineWasEmpty){ctx.print(expr,")")}return null}visitWritePropExpr(expr,ctx){const lineWasEmpty=ctx.lineIsEmpty();if(!lineWasEmpty){ctx.print(expr,"(")}expr.receiver.visitExpression(this,ctx);ctx.print(expr,`.${expr.name} = `);expr.value.visitExpression(this,ctx);if(!lineWasEmpty){ctx.print(expr,")")}return null}visitInvokeFunctionExpr(expr,ctx){const shouldParenthesize=expr.fn instanceof ArrowFunctionExpr;if(shouldParenthesize){ctx.print(expr.fn,"(")}expr.fn.visitExpression(this,ctx);if(shouldParenthesize){ctx.print(expr.fn,")")}ctx.print(expr,`(`);this.visitAllExpressions(expr.args,ctx,",");ctx.print(expr,`)`);return null}visitTaggedTemplateExpr(expr,ctx){expr.tag.visitExpression(this,ctx);ctx.print(expr,"`"+expr.template.elements[0].rawText);for(let i=1;i<expr.template.elements.length;i++){ctx.print(expr,"${");expr.template.expressions[i-1].visitExpression(this,ctx);ctx.print(expr,`}${expr.template.elements[i].rawText}`)}ctx.print(expr,"`");return null}visitWrappedNodeExpr(ast,ctx){throw new Error("Abstract emitter cannot visit WrappedNodeExpr.")}visitTypeofExpr(expr,ctx){ctx.print(expr,"typeof ");expr.expr.visitExpression(this,ctx)}visitReadVarExpr(ast,ctx){ctx.print(ast,ast.name);return null}visitInstantiateExpr(ast,ctx){ctx.print(ast,`new `);ast.classExpr.visitExpression(this,ctx);ctx.print(ast,`(`);this.visitAllExpressions(ast.args,ctx,",");ctx.print(ast,`)`);return null}visitLiteralExpr(ast,ctx){const value=ast.value;if(typeof value==="string"){ctx.print(ast,escapeIdentifier(value,this._escapeDollarInStrings))}else{ctx.print(ast,`${value}`)}return null}visitLocalizedString(ast,ctx){const head=ast.serializeI18nHead();ctx.print(ast,"$localize `"+head.raw);for(let i=1;i<ast.messageParts.length;i++){ctx.print(ast,"${");ast.expressions[i-1].visitExpression(this,ctx);ctx.print(ast,`}${ast.serializeI18nTemplatePart(i).raw}`)}ctx.print(ast,"`");return null}visitConditionalExpr(ast,ctx){ctx.print(ast,`(`);ast.condition.visitExpression(this,ctx);ctx.print(ast,"? ");ast.trueCase.visitExpression(this,ctx);ctx.print(ast,": ");ast.falseCase.visitExpression(this,ctx);ctx.print(ast,`)`);return null}visitDynamicImportExpr(ast,ctx){ctx.print(ast,`import(${ast.url})`)}visitNotExpr(ast,ctx){ctx.print(ast,"!");ast.condition.visitExpression(this,ctx);return null}visitUnaryOperatorExpr(ast,ctx){let opStr;switch(ast.operator){case exports.UnaryOperator.Plus:opStr="+";break;case exports.UnaryOperator.Minus:opStr="-";break;default:throw new Error(`Unknown operator ${ast.operator}`)}if(ast.parens)ctx.print(ast,`(`);ctx.print(ast,opStr);ast.expr.visitExpression(this,ctx);if(ast.parens)ctx.print(ast,`)`);return null}visitBinaryOperatorExpr(ast,ctx){let opStr;switch(ast.operator){case exports.BinaryOperator.Equals:opStr="==";break;case exports.BinaryOperator.Identical:opStr="===";break;case exports.BinaryOperator.NotEquals:opStr="!=";break;case exports.BinaryOperator.NotIdentical:opStr="!==";break;case exports.BinaryOperator.And:opStr="&&";break;case exports.BinaryOperator.BitwiseOr:opStr="|";break;case exports.BinaryOperator.BitwiseAnd:opStr="&";break;case exports.BinaryOperator.Or:opStr="||";break;case exports.BinaryOperator.Plus:opStr="+";break;case exports.BinaryOperator.Minus:opStr="-";break;case exports.BinaryOperator.Divide:opStr="/";break;case exports.BinaryOperator.Multiply:opStr="*";break;case exports.BinaryOperator.Modulo:opStr="%";break;case exports.BinaryOperator.Lower:opStr="<";break;case exports.BinaryOperator.LowerEquals:opStr="<=";break;case exports.BinaryOperator.Bigger:opStr=">";break;case exports.BinaryOperator.BiggerEquals:opStr=">=";break;case exports.BinaryOperator.NullishCoalesce:opStr="??";break;default:throw new Error(`Unknown operator ${ast.operator}`)}if(ast.parens)ctx.print(ast,`(`);ast.lhs.visitExpression(this,ctx);ctx.print(ast,` ${opStr} `);ast.rhs.visitExpression(this,ctx);if(ast.parens)ctx.print(ast,`)`);return null}visitReadPropExpr(ast,ctx){ast.receiver.visitExpression(this,ctx);ctx.print(ast,`.`);ctx.print(ast,ast.name);return null}visitReadKeyExpr(ast,ctx){ast.receiver.visitExpression(this,ctx);ctx.print(ast,`[`);ast.index.visitExpression(this,ctx);ctx.print(ast,`]`);return null}visitLiteralArrayExpr(ast,ctx){ctx.print(ast,`[`);this.visitAllExpressions(ast.entries,ctx,",");ctx.print(ast,`]`);return null}visitLiteralMapExpr(ast,ctx){ctx.print(ast,`{`);this.visitAllObjects((entry=>{ctx.print(ast,`${escapeIdentifier(entry.key,this._escapeDollarInStrings,entry.quoted)}:`);entry.value.visitExpression(this,ctx)}),ast.entries,ctx,",");ctx.print(ast,`}`);return null}visitCommaExpr(ast,ctx){ctx.print(ast,"(");this.visitAllExpressions(ast.parts,ctx,",");ctx.print(ast,")");return null}visitAllExpressions(expressions,ctx,separator){this.visitAllObjects((expr=>expr.visitExpression(this,ctx)),expressions,ctx,separator)}visitAllObjects(handler,expressions,ctx,separator){let incrementedIndent=false;for(let i=0;i<expressions.length;i++){if(i>0){if(ctx.lineLength()>80){ctx.print(null,separator,true);if(!incrementedIndent){ctx.incIndent();ctx.incIndent();incrementedIndent=true}}else{ctx.print(null,separator,false)}}handler(expressions[i])}if(incrementedIndent){ctx.decIndent();ctx.decIndent()}}visitAllStatements(statements,ctx){statements.forEach((stmt=>stmt.visitStatement(this,ctx)))}}function escapeIdentifier(input,escapeDollar,alwaysQuote=true){if(input==null){return null}const body=input.replace(_SINGLE_QUOTE_ESCAPE_STRING_RE,((...match)=>{if(match[0]=="$"){return escapeDollar?"\\$":"$"}else if(match[0]=="\n"){return"\\n"}else if(match[0]=="\r"){return"\\r"}else{return`\\${match[0]}`}}));const requiresQuotes=alwaysQuote||!_LEGAL_IDENTIFIER_RE.test(body);return requiresQuotes?`'${body}'`:body}function _createIndent(count){let res="";for(let i=0;i<count;i++){res+=_INDENT_WITH}return res}function typeWithParameters(type,numParams){if(numParams===0){return expressionType(type)}const params=[];for(let i=0;i<numParams;i++){params.push(DYNAMIC_TYPE)}return expressionType(type,undefined,params)}const ANIMATE_SYMBOL_PREFIX="@";function prepareSyntheticPropertyName(name){return`${ANIMATE_SYMBOL_PREFIX}${name}`}function prepareSyntheticListenerName(name,phase){return`${ANIMATE_SYMBOL_PREFIX}${name}.${phase}`}function getSafePropertyAccessString(accessor,name){const escapedName=escapeIdentifier(name,false,false);return escapedName!==name?`${accessor}[${escapedName}]`:`${accessor}.${name}`}function prepareSyntheticListenerFunctionName(name,phase){return`animation_${name}_${phase}`}function jitOnlyGuardedExpression(expr){return guardedExpression("ngJitMode",expr)}function devOnlyGuardedExpression(expr){return guardedExpression("ngDevMode",expr)}function guardedExpression(guard,expr){const guardExpr=new ExternalExpr({name:guard,moduleName:null});const guardNotDefined=new BinaryOperatorExpr(exports.BinaryOperator.Identical,new TypeofExpr(guardExpr),literal("undefined"));const guardUndefinedOrTrue=new BinaryOperatorExpr(exports.BinaryOperator.Or,guardNotDefined,guardExpr,undefined,undefined,true);return new BinaryOperatorExpr(exports.BinaryOperator.And,guardUndefinedOrTrue,expr)}function wrapReference(value){const wrapped=new WrappedNodeExpr(value);return{value:wrapped,type:wrapped}}function refsToArray(refs,shouldForwardDeclare){const values=literalArr(refs.map((ref=>ref.value)));return shouldForwardDeclare?arrowFn([],values):values}function createMayBeForwardRefExpression(expression,forwardRef){return{expression:expression,forwardRef:forwardRef}}function convertFromMaybeForwardRefExpression({expression:expression,forwardRef:forwardRef}){switch(forwardRef){case 0:case 1:return expression;case 2:return generateForwardRef(expression)}}function generateForwardRef(expr){return importExpr(Identifiers.forwardRef).callFn([arrowFn([],expr)])}var R3FactoryDelegateType;(function(R3FactoryDelegateType){R3FactoryDelegateType[R3FactoryDelegateType["Class"]=0]="Class";R3FactoryDelegateType[R3FactoryDelegateType["Function"]=1]="Function"})(R3FactoryDelegateType||(R3FactoryDelegateType={}));exports.FactoryTarget=void 0;(function(FactoryTarget){FactoryTarget[FactoryTarget["Directive"]=0]="Directive";FactoryTarget[FactoryTarget["Component"]=1]="Component";FactoryTarget[FactoryTarget["Injectable"]=2]="Injectable";FactoryTarget[FactoryTarget["Pipe"]=3]="Pipe";FactoryTarget[FactoryTarget["NgModule"]=4]="NgModule"})(exports.FactoryTarget||(exports.FactoryTarget={}));function compileFactoryFunction(meta){const t=variable("t");let baseFactoryVar=null;const typeForCtor=!isDelegatedFactoryMetadata(meta)?new BinaryOperatorExpr(exports.BinaryOperator.Or,t,meta.type.value):t;let ctorExpr=null;if(meta.deps!==null){if(meta.deps!=="invalid"){ctorExpr=new InstantiateExpr(typeForCtor,injectDependencies(meta.deps,meta.target))}}else{baseFactoryVar=variable(`\u0275${meta.name}_BaseFactory`);ctorExpr=baseFactoryVar.callFn([typeForCtor])}const body=[];let retExpr=null;function makeConditionalFactory(nonCtorExpr){const r=variable("r");body.push(r.set(NULL_EXPR).toDeclStmt());const ctorStmt=ctorExpr!==null?r.set(ctorExpr).toStmt():importExpr(Identifiers.invalidFactory).callFn([]).toStmt();body.push(ifStmt(t,[ctorStmt],[r.set(nonCtorExpr).toStmt()]));return r}if(isDelegatedFactoryMetadata(meta)){const delegateArgs=injectDependencies(meta.delegateDeps,meta.target);const factoryExpr=new(meta.delegateType===R3FactoryDelegateType.Class?InstantiateExpr:InvokeFunctionExpr)(meta.delegate,delegateArgs);retExpr=makeConditionalFactory(factoryExpr)}else if(isExpressionFactoryMetadata(meta)){retExpr=makeConditionalFactory(meta.expression)}else{retExpr=ctorExpr}if(retExpr===null){body.push(importExpr(Identifiers.invalidFactory).callFn([]).toStmt())}else if(baseFactoryVar!==null){const getInheritedFactoryCall=importExpr(Identifiers.getInheritedFactory).callFn([meta.type.value]);const baseFactory=new BinaryOperatorExpr(exports.BinaryOperator.Or,baseFactoryVar,baseFactoryVar.set(getInheritedFactoryCall));body.push(new ReturnStatement(baseFactory.callFn([typeForCtor])))}else{body.push(new ReturnStatement(retExpr))}let factoryFn=fn([new FnParam("t",DYNAMIC_TYPE)],body,INFERRED_TYPE,undefined,`${meta.name}_Factory`);if(baseFactoryVar!==null){factoryFn=arrowFn([],[new DeclareVarStmt(baseFactoryVar.name),new ReturnStatement(factoryFn)]).callFn([],undefined,true)}return{expression:factoryFn,statements:[],type:createFactoryType(meta)}}function createFactoryType(meta){const ctorDepsType=meta.deps!==null&&meta.deps!=="invalid"?createCtorDepsType(meta.deps):NONE_TYPE;return expressionType(importExpr(Identifiers.FactoryDeclaration,[typeWithParameters(meta.type.type,meta.typeArgumentCount),ctorDepsType]))}function injectDependencies(deps,target){return deps.map(((dep,index)=>compileInjectDependency(dep,target,index)))}function compileInjectDependency(dep,target,index){if(dep.token===null){return importExpr(Identifiers.invalidFactoryDep).callFn([literal(index)])}else if(dep.attributeNameType===null){const flags=0|(dep.self?2:0)|(dep.skipSelf?4:0)|(dep.host?1:0)|(dep.optional?8:0)|(target===exports.FactoryTarget.Pipe?16:0);let flagsParam=flags!==0||dep.optional?literal(flags):null;const injectArgs=[dep.token];if(flagsParam){injectArgs.push(flagsParam)}const injectFn=getInjectFn(target);return importExpr(injectFn).callFn(injectArgs)}else{return importExpr(Identifiers.injectAttribute).callFn([dep.token])}}function createCtorDepsType(deps){let hasTypes=false;const attributeTypes=deps.map((dep=>{const type=createCtorDepType(dep);if(type!==null){hasTypes=true;return type}else{return literal(null)}}));if(hasTypes){return expressionType(literalArr(attributeTypes))}else{return NONE_TYPE}}function createCtorDepType(dep){const entries=[];if(dep.attributeNameType!==null){entries.push({key:"attribute",value:dep.attributeNameType,quoted:false})}if(dep.optional){entries.push({key:"optional",value:literal(true),quoted:false})}if(dep.host){entries.push({key:"host",value:literal(true),quoted:false})}if(dep.self){entries.push({key:"self",value:literal(true),quoted:false})}if(dep.skipSelf){entries.push({key:"skipSelf",value:literal(true),quoted:false})}return entries.length>0?literalMap(entries):null}function isDelegatedFactoryMetadata(meta){return meta.delegateType!==undefined}function isExpressionFactoryMetadata(meta){return meta.expression!==undefined}function getInjectFn(target){switch(target){case exports.FactoryTarget.Component:case exports.FactoryTarget.Directive:case exports.FactoryTarget.Pipe:return Identifiers.directiveInject;case exports.FactoryTarget.NgModule:case exports.FactoryTarget.Injectable:default:return Identifiers.inject}}exports.TagContentType=void 0;(function(TagContentType){TagContentType[TagContentType["RAW_TEXT"]=0]="RAW_TEXT";TagContentType[TagContentType["ESCAPABLE_RAW_TEXT"]=1]="ESCAPABLE_RAW_TEXT";TagContentType[TagContentType["PARSABLE_DATA"]=2]="PARSABLE_DATA"})(exports.TagContentType||(exports.TagContentType={}));function splitNsName(elementName,fatal=true){if(elementName[0]!=":"){return[null,elementName]}const colonIndex=elementName.indexOf(":",1);if(colonIndex===-1){if(fatal){throw new Error(`Unsupported format "${elementName}" expecting ":namespace:name"`)}else{return[null,elementName]}}return[elementName.slice(1,colonIndex),elementName.slice(colonIndex+1)]}function isNgContainer(tagName){return splitNsName(tagName)[1]==="ng-container"}function isNgContent(tagName){return splitNsName(tagName)[1]==="ng-content"}function isNgTemplate(tagName){return splitNsName(tagName)[1]==="ng-template"}function getNsPrefix(fullName){return fullName===null?null:splitNsName(fullName)[0]}function mergeNsAndName(prefix,localName){return prefix?`:${prefix}:${localName}`:localName}class Comment$1{constructor(value,sourceSpan){this.value=value;this.sourceSpan=sourceSpan}visit(_visitor){throw new Error("visit() not implemented for Comment")}}class Text$3{constructor(value,sourceSpan){this.value=value;this.sourceSpan=sourceSpan}visit(visitor){return visitor.visitText(this)}}class BoundText{constructor(value,sourceSpan,i18n){this.value=value;this.sourceSpan=sourceSpan;this.i18n=i18n}visit(visitor){return visitor.visitBoundText(this)}}class TextAttribute{constructor(name,value,sourceSpan,keySpan,valueSpan,i18n){this.name=name;this.value=value;this.sourceSpan=sourceSpan;this.keySpan=keySpan;this.valueSpan=valueSpan;this.i18n=i18n}visit(visitor){return visitor.visitTextAttribute(this)}}class BoundAttribute{constructor(name,type,securityContext,value,unit,sourceSpan,keySpan,valueSpan,i18n){this.name=name;this.type=type;this.securityContext=securityContext;this.value=value;this.unit=unit;this.sourceSpan=sourceSpan;this.keySpan=keySpan;this.valueSpan=valueSpan;this.i18n=i18n}static fromBoundElementProperty(prop,i18n){if(prop.keySpan===undefined){throw new Error(`Unexpected state: keySpan must be defined for bound attributes but was not for ${prop.name}: ${prop.sourceSpan}`)}return new BoundAttribute(prop.name,prop.type,prop.securityContext,prop.value,prop.unit,prop.sourceSpan,prop.keySpan,prop.valueSpan,i18n)}visit(visitor){return visitor.visitBoundAttribute(this)}}class BoundEvent{constructor(name,type,handler,target,phase,sourceSpan,handlerSpan,keySpan){this.name=name;this.type=type;this.handler=handler;this.target=target;this.phase=phase;this.sourceSpan=sourceSpan;this.handlerSpan=handlerSpan;this.keySpan=keySpan}static fromParsedEvent(event){const target=event.type===0?event.targetOrPhase:null;const phase=event.type===1?event.targetOrPhase:null;if(event.keySpan===undefined){throw new Error(`Unexpected state: keySpan must be defined for bound event but was not for ${event.name}: ${event.sourceSpan}`)}return new BoundEvent(event.name,event.type,event.handler,target,phase,event.sourceSpan,event.handlerSpan,event.keySpan)}visit(visitor){return visitor.visitBoundEvent(this)}}class Element$1{constructor(name,attributes,inputs,outputs,children,references,sourceSpan,startSourceSpan,endSourceSpan,i18n){this.name=name;this.attributes=attributes;this.inputs=inputs;this.outputs=outputs;this.children=children;this.references=references;this.sourceSpan=sourceSpan;this.startSourceSpan=startSourceSpan;this.endSourceSpan=endSourceSpan;this.i18n=i18n}visit(visitor){return visitor.visitElement(this)}}class DeferredTrigger{constructor(nameSpan,sourceSpan,prefetchSpan,whenOrOnSourceSpan){this.nameSpan=nameSpan;this.sourceSpan=sourceSpan;this.prefetchSpan=prefetchSpan;this.whenOrOnSourceSpan=whenOrOnSourceSpan}visit(visitor){return visitor.visitDeferredTrigger(this)}}class BoundDeferredTrigger extends DeferredTrigger{constructor(value,sourceSpan,prefetchSpan,whenSourceSpan){super(null,sourceSpan,prefetchSpan,whenSourceSpan);this.value=value}}class IdleDeferredTrigger extends DeferredTrigger{}class ImmediateDeferredTrigger extends DeferredTrigger{}class HoverDeferredTrigger extends DeferredTrigger{constructor(reference,nameSpan,sourceSpan,prefetchSpan,onSourceSpan){super(nameSpan,sourceSpan,prefetchSpan,onSourceSpan);this.reference=reference}}class TimerDeferredTrigger extends DeferredTrigger{constructor(delay,nameSpan,sourceSpan,prefetchSpan,onSourceSpan){super(nameSpan,sourceSpan,prefetchSpan,onSourceSpan);this.delay=delay}}class InteractionDeferredTrigger extends DeferredTrigger{constructor(reference,nameSpan,sourceSpan,prefetchSpan,onSourceSpan){super(nameSpan,sourceSpan,prefetchSpan,onSourceSpan);this.reference=reference}}class ViewportDeferredTrigger extends DeferredTrigger{constructor(reference,nameSpan,sourceSpan,prefetchSpan,onSourceSpan){super(nameSpan,sourceSpan,prefetchSpan,onSourceSpan);this.reference=reference}}class BlockNode{constructor(nameSpan,sourceSpan,startSourceSpan,endSourceSpan){this.nameSpan=nameSpan;this.sourceSpan=sourceSpan;this.startSourceSpan=startSourceSpan;this.endSourceSpan=endSourceSpan}}class DeferredBlockPlaceholder extends BlockNode{constructor(children,minimumTime,nameSpan,sourceSpan,startSourceSpan,endSourceSpan,i18n){super(nameSpan,sourceSpan,startSourceSpan,endSourceSpan);this.children=children;this.minimumTime=minimumTime;this.i18n=i18n}visit(visitor){return visitor.visitDeferredBlockPlaceholder(this)}}class DeferredBlockLoading extends BlockNode{constructor(children,afterTime,minimumTime,nameSpan,sourceSpan,startSourceSpan,endSourceSpan,i18n){super(nameSpan,sourceSpan,startSourceSpan,endSourceSpan);this.children=children;this.afterTime=afterTime;this.minimumTime=minimumTime;this.i18n=i18n}visit(visitor){return visitor.visitDeferredBlockLoading(this)}}class DeferredBlockError extends BlockNode{constructor(children,nameSpan,sourceSpan,startSourceSpan,endSourceSpan,i18n){super(nameSpan,sourceSpan,startSourceSpan,endSourceSpan);this.children=children;this.i18n=i18n}visit(visitor){return visitor.visitDeferredBlockError(this)}}class DeferredBlock extends BlockNode{constructor(children,triggers,prefetchTriggers,placeholder,loading,error,nameSpan,sourceSpan,mainBlockSpan,startSourceSpan,endSourceSpan,i18n){super(nameSpan,sourceSpan,startSourceSpan,endSourceSpan);this.children=children;this.placeholder=placeholder;this.loading=loading;this.error=error;this.mainBlockSpan=mainBlockSpan;this.i18n=i18n;this.triggers=triggers;this.prefetchTriggers=prefetchTriggers;this.definedTriggers=Object.keys(triggers);this.definedPrefetchTriggers=Object.keys(prefetchTriggers)}visit(visitor){return visitor.visitDeferredBlock(this)}visitAll(visitor){this.visitTriggers(this.definedTriggers,this.triggers,visitor);this.visitTriggers(this.definedPrefetchTriggers,this.prefetchTriggers,visitor);visitAll$1(visitor,this.children);const remainingBlocks=[this.placeholder,this.loading,this.error].filter((x=>x!==null));visitAll$1(visitor,remainingBlocks)}visitTriggers(keys,triggers,visitor){visitAll$1(visitor,keys.map((k=>triggers[k])))}}class SwitchBlock extends BlockNode{constructor(expression,cases,unknownBlocks,sourceSpan,startSourceSpan,endSourceSpan,nameSpan){super(nameSpan,sourceSpan,startSourceSpan,endSourceSpan);this.expression=expression;this.cases=cases;this.unknownBlocks=unknownBlocks}visit(visitor){return visitor.visitSwitchBlock(this)}}class SwitchBlockCase extends BlockNode{constructor(expression,children,sourceSpan,startSourceSpan,endSourceSpan,nameSpan,i18n){super(nameSpan,sourceSpan,startSourceSpan,endSourceSpan);this.expression=expression;this.children=children;this.i18n=i18n}visit(visitor){return visitor.visitSwitchBlockCase(this)}}class ForLoopBlock extends BlockNode{constructor(item,expression,trackBy,trackKeywordSpan,contextVariables,children,empty,sourceSpan,mainBlockSpan,startSourceSpan,endSourceSpan,nameSpan,i18n){super(nameSpan,sourceSpan,startSourceSpan,endSourceSpan);this.item=item;this.expression=expression;this.trackBy=trackBy;this.trackKeywordSpan=trackKeywordSpan;this.contextVariables=contextVariables;this.children=children;this.empty=empty;this.mainBlockSpan=mainBlockSpan;this.i18n=i18n}visit(visitor){return visitor.visitForLoopBlock(this)}}class ForLoopBlockEmpty extends BlockNode{constructor(children,sourceSpan,startSourceSpan,endSourceSpan,nameSpan,i18n){super(nameSpan,sourceSpan,startSourceSpan,endSourceSpan);this.children=children;this.i18n=i18n}visit(visitor){return visitor.visitForLoopBlockEmpty(this)}}class IfBlock extends BlockNode{constructor(branches,sourceSpan,startSourceSpan,endSourceSpan,nameSpan){super(nameSpan,sourceSpan,startSourceSpan,endSourceSpan);this.branches=branches}visit(visitor){return visitor.visitIfBlock(this)}}class IfBlockBranch extends BlockNode{constructor(expression,children,expressionAlias,sourceSpan,startSourceSpan,endSourceSpan,nameSpan,i18n){super(nameSpan,sourceSpan,startSourceSpan,endSourceSpan);this.expression=expression;this.children=children;this.expressionAlias=expressionAlias;this.i18n=i18n}visit(visitor){return visitor.visitIfBlockBranch(this)}}class UnknownBlock{constructor(name,sourceSpan,nameSpan){this.name=name;this.sourceSpan=sourceSpan;this.nameSpan=nameSpan}visit(visitor){return visitor.visitUnknownBlock(this)}}class Template{constructor(tagName,attributes,inputs,outputs,templateAttrs,children,references,variables,sourceSpan,startSourceSpan,endSourceSpan,i18n){this.tagName=tagName;this.attributes=attributes;this.inputs=inputs;this.outputs=outputs;this.templateAttrs=templateAttrs;this.children=children;this.references=references;this.variables=variables;this.sourceSpan=sourceSpan;this.startSourceSpan=startSourceSpan;this.endSourceSpan=endSourceSpan;this.i18n=i18n}visit(visitor){return visitor.visitTemplate(this)}}class Content{constructor(selector,attributes,sourceSpan,i18n){this.selector=selector;this.attributes=attributes;this.sourceSpan=sourceSpan;this.i18n=i18n;this.name="ng-content"}visit(visitor){return visitor.visitContent(this)}}class Variable{constructor(name,value,sourceSpan,keySpan,valueSpan){this.name=name;this.value=value;this.sourceSpan=sourceSpan;this.keySpan=keySpan;this.valueSpan=valueSpan}visit(visitor){return visitor.visitVariable(this)}}class Reference{constructor(name,value,sourceSpan,keySpan,valueSpan){this.name=name;this.value=value;this.sourceSpan=sourceSpan;this.keySpan=keySpan;this.valueSpan=valueSpan}visit(visitor){return visitor.visitReference(this)}}class Icu$1{constructor(vars,placeholders,sourceSpan,i18n){this.vars=vars;this.placeholders=placeholders;this.sourceSpan=sourceSpan;this.i18n=i18n}visit(visitor){return visitor.visitIcu(this)}}class RecursiveVisitor$1{visitElement(element){visitAll$1(this,element.attributes);visitAll$1(this,element.inputs);visitAll$1(this,element.outputs);visitAll$1(this,element.children);visitAll$1(this,element.references)}visitTemplate(template){visitAll$1(this,template.attributes);visitAll$1(this,template.inputs);visitAll$1(this,template.outputs);visitAll$1(this,template.children);visitAll$1(this,template.references);visitAll$1(this,template.variables)}visitDeferredBlock(deferred){deferred.visitAll(this)}visitDeferredBlockPlaceholder(block){visitAll$1(this,block.children)}visitDeferredBlockError(block){visitAll$1(this,block.children)}visitDeferredBlockLoading(block){visitAll$1(this,block.children)}visitSwitchBlock(block){visitAll$1(this,block.cases)}visitSwitchBlockCase(block){visitAll$1(this,block.children)}visitForLoopBlock(block){const blockItems=[block.item,...Object.values(block.contextVariables),...block.children];block.empty&&blockItems.push(block.empty);visitAll$1(this,blockItems)}visitForLoopBlockEmpty(block){visitAll$1(this,block.children)}visitIfBlock(block){visitAll$1(this,block.branches)}visitIfBlockBranch(block){const blockItems=block.children;block.expressionAlias&&blockItems.push(block.expressionAlias);visitAll$1(this,blockItems)}visitContent(content){}visitVariable(variable){}visitReference(reference){}visitTextAttribute(attribute){}visitBoundAttribute(attribute){}visitBoundEvent(attribute){}visitText(text){}visitBoundText(text){}visitIcu(icu){}visitDeferredTrigger(trigger){}visitUnknownBlock(block){}}function visitAll$1(visitor,nodes){const result=[];if(visitor.visit){for(const node of nodes){visitor.visit(node)||node.visit(visitor)}}else{for(const node of nodes){const newNode=node.visit(visitor);if(newNode){result.push(newNode)}}}return result}class Message{constructor(nodes,placeholders,placeholderToMessage,meaning,description,customId){this.nodes=nodes;this.placeholders=placeholders;this.placeholderToMessage=placeholderToMessage;this.meaning=meaning;this.description=description;this.customId=customId;this.legacyIds=[];this.id=this.customId;this.messageString=serializeMessage(this.nodes);if(nodes.length){this.sources=[{filePath:nodes[0].sourceSpan.start.file.url,startLine:nodes[0].sourceSpan.start.line+1,startCol:nodes[0].sourceSpan.start.col+1,endLine:nodes[nodes.length-1].sourceSpan.end.line+1,endCol:nodes[0].sourceSpan.start.col+1}]}else{this.sources=[]}}}class Text$2{constructor(value,sourceSpan){this.value=value;this.sourceSpan=sourceSpan}visit(visitor,context){return visitor.visitText(this,context)}}class Container{constructor(children,sourceSpan){this.children=children;this.sourceSpan=sourceSpan}visit(visitor,context){return visitor.visitContainer(this,context)}}class Icu{constructor(expression,type,cases,sourceSpan,expressionPlaceholder){this.expression=expression;this.type=type;this.cases=cases;this.sourceSpan=sourceSpan;this.expressionPlaceholder=expressionPlaceholder}visit(visitor,context){return visitor.visitIcu(this,context)}}class TagPlaceholder{constructor(tag,attrs,startName,closeName,children,isVoid,sourceSpan,startSourceSpan,endSourceSpan){this.tag=tag;this.attrs=attrs;this.startName=startName;this.closeName=closeName;this.children=children;this.isVoid=isVoid;this.sourceSpan=sourceSpan;this.startSourceSpan=startSourceSpan;this.endSourceSpan=endSourceSpan}visit(visitor,context){return visitor.visitTagPlaceholder(this,context)}}class Placeholder{constructor(value,name,sourceSpan){this.value=value;this.name=name;this.sourceSpan=sourceSpan}visit(visitor,context){return visitor.visitPlaceholder(this,context)}}class IcuPlaceholder{constructor(value,name,sourceSpan){this.value=value;this.name=name;this.sourceSpan=sourceSpan}visit(visitor,context){return visitor.visitIcuPlaceholder(this,context)}}class BlockPlaceholder{constructor(name,parameters,startName,closeName,children,sourceSpan,startSourceSpan,endSourceSpan){this.name=name;this.parameters=parameters;this.startName=startName;this.closeName=closeName;this.children=children;this.sourceSpan=sourceSpan;this.startSourceSpan=startSourceSpan;this.endSourceSpan=endSourceSpan}visit(visitor,context){return visitor.visitBlockPlaceholder(this,context)}}class CloneVisitor{visitText(text,context){return new Text$2(text.value,text.sourceSpan)}visitContainer(container,context){const children=container.children.map((n=>n.visit(this,context)));return new Container(children,container.sourceSpan)}visitIcu(icu,context){const cases={};Object.keys(icu.cases).forEach((key=>cases[key]=icu.cases[key].visit(this,context)));const msg=new Icu(icu.expression,icu.type,cases,icu.sourceSpan,icu.expressionPlaceholder);return msg}visitTagPlaceholder(ph,context){const children=ph.children.map((n=>n.visit(this,context)));return new TagPlaceholder(ph.tag,ph.attrs,ph.startName,ph.closeName,children,ph.isVoid,ph.sourceSpan,ph.startSourceSpan,ph.endSourceSpan)}visitPlaceholder(ph,context){return new Placeholder(ph.value,ph.name,ph.sourceSpan)}visitIcuPlaceholder(ph,context){return new IcuPlaceholder(ph.value,ph.name,ph.sourceSpan)}visitBlockPlaceholder(ph,context){const children=ph.children.map((n=>n.visit(this,context)));return new BlockPlaceholder(ph.name,ph.parameters,ph.startName,ph.closeName,children,ph.sourceSpan,ph.startSourceSpan,ph.endSourceSpan)}}class RecurseVisitor{visitText(text,context){}visitContainer(container,context){container.children.forEach((child=>child.visit(this)))}visitIcu(icu,context){Object.keys(icu.cases).forEach((k=>{icu.cases[k].visit(this)}))}visitTagPlaceholder(ph,context){ph.children.forEach((child=>child.visit(this)))}visitPlaceholder(ph,context){}visitIcuPlaceholder(ph,context){}visitBlockPlaceholder(ph,context){ph.children.forEach((child=>child.visit(this)))}}function serializeMessage(messageNodes){const visitor=new LocalizeMessageStringVisitor;const str=messageNodes.map((n=>n.visit(visitor))).join("");return str}class LocalizeMessageStringVisitor{visitText(text){return text.value}visitContainer(container){return container.children.map((child=>child.visit(this))).join("")}visitIcu(icu){const strCases=Object.keys(icu.cases).map((k=>`${k} {${icu.cases[k].visit(this)}}`));return`{${icu.expressionPlaceholder}, ${icu.type}, ${strCases.join(" ")}}`}visitTagPlaceholder(ph){const children=ph.children.map((child=>child.visit(this))).join("");return`{$${ph.startName}}${children}{$${ph.closeName}}`}visitPlaceholder(ph){return`{$${ph.name}}`}visitIcuPlaceholder(ph){return`{$${ph.name}}`}visitBlockPlaceholder(ph){const children=ph.children.map((child=>child.visit(this))).join("");return`{$${ph.startName}}${children}{$${ph.closeName}}`}}class Serializer{createNameMapper(message){return null}}class SimplePlaceholderMapper extends RecurseVisitor{constructor(message,mapName){super();this.mapName=mapName;this.internalToPublic={};this.publicToNextId={};this.publicToInternal={};message.nodes.forEach((node=>node.visit(this)))}toPublicName(internalName){return this.internalToPublic.hasOwnProperty(internalName)?this.internalToPublic[internalName]:null}toInternalName(publicName){return this.publicToInternal.hasOwnProperty(publicName)?this.publicToInternal[publicName]:null}visitText(text,context){return null}visitTagPlaceholder(ph,context){this.visitPlaceholderName(ph.startName);super.visitTagPlaceholder(ph,context);this.visitPlaceholderName(ph.closeName)}visitPlaceholder(ph,context){this.visitPlaceholderName(ph.name)}visitBlockPlaceholder(ph,context){this.visitPlaceholderName(ph.startName);super.visitBlockPlaceholder(ph,context);this.visitPlaceholderName(ph.closeName)}visitIcuPlaceholder(ph,context){this.visitPlaceholderName(ph.name)}visitPlaceholderName(internalName){if(!internalName||this.internalToPublic.hasOwnProperty(internalName)){return}let publicName=this.mapName(internalName);if(this.publicToInternal.hasOwnProperty(publicName)){const nextId=this.publicToNextId[publicName];this.publicToNextId[publicName]=nextId+1;publicName=`${publicName}_${nextId}`}else{this.publicToNextId[publicName]=1}this.internalToPublic[internalName]=publicName;this.publicToInternal[publicName]=internalName}}class _Visitor$2{visitTag(tag){const strAttrs=this._serializeAttributes(tag.attrs);if(tag.children.length==0){return`<${tag.name}${strAttrs}/>`}const strChildren=tag.children.map((node=>node.visit(this)));return`<${tag.name}${strAttrs}>${strChildren.join("")}</${tag.name}>`}visitText(text){return text.value}visitDeclaration(decl){return`<?xml${this._serializeAttributes(decl.attrs)} ?>`}_serializeAttributes(attrs){const strAttrs=Object.keys(attrs).map((name=>`${name}="${attrs[name]}"`)).join(" ");return strAttrs.length>0?" "+strAttrs:""}visitDoctype(doctype){return`<!DOCTYPE ${doctype.rootTag} [\n${doctype.dtd}\n]>`}}const _visitor=new _Visitor$2;function serialize(nodes){return nodes.map((node=>node.visit(_visitor))).join("")}class Declaration{constructor(unescapedAttrs){this.attrs={};Object.keys(unescapedAttrs).forEach((k=>{this.attrs[k]=escapeXml(unescapedAttrs[k])}))}visit(visitor){return visitor.visitDeclaration(this)}}class Doctype{constructor(rootTag,dtd){this.rootTag=rootTag;this.dtd=dtd}visit(visitor){return visitor.visitDoctype(this)}}class Tag{constructor(name,unescapedAttrs={},children=[]){this.name=name;this.children=children;this.attrs={};Object.keys(unescapedAttrs).forEach((k=>{this.attrs[k]=escapeXml(unescapedAttrs[k])}))}visit(visitor){return visitor.visitTag(this)}}class Text$1{constructor(unescapedValue){this.value=escapeXml(unescapedValue)}visit(visitor){return visitor.visitText(this)}}class CR extends Text$1{constructor(ws=0){super(`\n${new Array(ws+1).join(" ")}`)}}const _ESCAPED_CHARS=[[/&/g,"&"],[/"/g,"""],[/'/g,"'"],[/</g,"<"],[/>/g,">"]];function escapeXml(text){return _ESCAPED_CHARS.reduce(((text,entry)=>text.replace(entry[0],entry[1])),text)}const _MESSAGES_TAG="messagebundle";const _MESSAGE_TAG="msg";const _PLACEHOLDER_TAG$3="ph";const _EXAMPLE_TAG="ex";const _SOURCE_TAG$2="source";const _DOCTYPE=`<!ELEMENT messagebundle (msg)*>\n<!ATTLIST messagebundle class CDATA #IMPLIED>\n\n<!ELEMENT msg (#PCDATA|ph|source)*>\n<!ATTLIST msg id CDATA #IMPLIED>\n<!ATTLIST msg seq CDATA #IMPLIED>\n<!ATTLIST msg name CDATA #IMPLIED>\n<!ATTLIST msg desc CDATA #IMPLIED>\n<!ATTLIST msg meaning CDATA #IMPLIED>\n<!ATTLIST msg obsolete (obsolete) #IMPLIED>\n<!ATTLIST msg xml:space (default|preserve) "default">\n<!ATTLIST msg is_hidden CDATA #IMPLIED>\n\n<!ELEMENT source (#PCDATA)>\n\n<!ELEMENT ph (#PCDATA|ex)*>\n<!ATTLIST ph name CDATA #REQUIRED>\n\n<!ELEMENT ex (#PCDATA)>`;class Xmb extends Serializer{write(messages,locale){const exampleVisitor=new ExampleVisitor;const visitor=new _Visitor$1;let rootNode=new Tag(_MESSAGES_TAG);messages.forEach((message=>{const attrs={id:message.id};if(message.description){attrs["desc"]=message.description}if(message.meaning){attrs["meaning"]=message.meaning}let sourceTags=[];message.sources.forEach((source=>{sourceTags.push(new Tag(_SOURCE_TAG$2,{},[new Text$1(`${source.filePath}:${source.startLine}${source.endLine!==source.startLine?","+source.endLine:""}`)]))}));rootNode.children.push(new CR(2),new Tag(_MESSAGE_TAG,attrs,[...sourceTags,...visitor.serialize(message.nodes)]))}));rootNode.children.push(new CR);return serialize([new Declaration({version:"1.0",encoding:"UTF-8"}),new CR,new Doctype(_MESSAGES_TAG,_DOCTYPE),new CR,exampleVisitor.addDefaultExamples(rootNode),new CR])}load(content,url){throw new Error("Unsupported")}digest(message){return digest(message)}createNameMapper(message){return new SimplePlaceholderMapper(message,toPublicName)}}class _Visitor$1{visitText(text,context){return[new Text$1(text.value)]}visitContainer(container,context){const nodes=[];container.children.forEach((node=>nodes.push(...node.visit(this))));return nodes}visitIcu(icu,context){const nodes=[new Text$1(`{${icu.expressionPlaceholder}, ${icu.type}, `)];Object.keys(icu.cases).forEach((c=>{nodes.push(new Text$1(`${c} {`),...icu.cases[c].visit(this),new Text$1(`} `))}));nodes.push(new Text$1(`}`));return nodes}visitTagPlaceholder(ph,context){const startTagAsText=new Text$1(`<${ph.tag}>`);const startEx=new Tag(_EXAMPLE_TAG,{},[startTagAsText]);const startTagPh=new Tag(_PLACEHOLDER_TAG$3,{name:ph.startName},[startEx,startTagAsText]);if(ph.isVoid){return[startTagPh]}const closeTagAsText=new Text$1(`</${ph.tag}>`);const closeEx=new Tag(_EXAMPLE_TAG,{},[closeTagAsText]);const closeTagPh=new Tag(_PLACEHOLDER_TAG$3,{name:ph.closeName},[closeEx,closeTagAsText]);return[startTagPh,...this.serialize(ph.children),closeTagPh]}visitPlaceholder(ph,context){const interpolationAsText=new Text$1(`{{${ph.value}}}`);const exTag=new Tag(_EXAMPLE_TAG,{},[interpolationAsText]);return[new Tag(_PLACEHOLDER_TAG$3,{name:ph.name},[exTag,interpolationAsText])]}visitBlockPlaceholder(ph,context){const startAsText=new Text$1(`@${ph.name}`);const startEx=new Tag(_EXAMPLE_TAG,{},[startAsText]);const startTagPh=new Tag(_PLACEHOLDER_TAG$3,{name:ph.startName},[startEx,startAsText]);const closeAsText=new Text$1(`}`);const closeEx=new Tag(_EXAMPLE_TAG,{},[closeAsText]);const closeTagPh=new Tag(_PLACEHOLDER_TAG$3,{name:ph.closeName},[closeEx,closeAsText]);return[startTagPh,...this.serialize(ph.children),closeTagPh]}visitIcuPlaceholder(ph,context){const icuExpression=ph.value.expression;const icuType=ph.value.type;const icuCases=Object.keys(ph.value.cases).map((value=>value+" {...}")).join(" ");const icuAsText=new Text$1(`{${icuExpression}, ${icuType}, ${icuCases}}`);const exTag=new Tag(_EXAMPLE_TAG,{},[icuAsText]);return[new Tag(_PLACEHOLDER_TAG$3,{name:ph.name},[exTag,icuAsText])]}serialize(nodes){return[].concat(...nodes.map((node=>node.visit(this))))}}function digest(message){return decimalDigest(message)}class ExampleVisitor{addDefaultExamples(node){node.visit(this);return node}visitTag(tag){if(tag.name===_PLACEHOLDER_TAG$3){if(!tag.children||tag.children.length==0){const exText=new Text$1(tag.attrs["name"]||"...");tag.children=[new Tag(_EXAMPLE_TAG,{},[exText])]}}else if(tag.children){tag.children.forEach((node=>node.visit(this)))}}visitText(text){}visitDeclaration(decl){}visitDoctype(doctype){}}function toPublicName(internalName){return internalName.toUpperCase().replace(/[^A-Z0-9_]/g,"_")}const CLOSURE_TRANSLATION_VAR_PREFIX="MSG_";const TRANSLATION_VAR_PREFIX$1="i18n_";const I18N_ATTR="i18n";const I18N_ATTR_PREFIX="i18n-";const I18N_ICU_VAR_PREFIX="VAR_";const I18N_ICU_MAPPING_PREFIX$1="I18N_EXP_";const I18N_PLACEHOLDER_SYMBOL="\ufffd";function isI18nAttribute(name){return name===I18N_ATTR||name.startsWith(I18N_ATTR_PREFIX)}function isI18nRootNode(meta){return meta instanceof Message}function isSingleI18nIcu(meta){return isI18nRootNode(meta)&&meta.nodes.length===1&&meta.nodes[0]instanceof Icu}function hasI18nMeta(node){return!!node.i18n}function hasI18nAttrs(element){return element.attrs.some((attr=>isI18nAttribute(attr.name)))}function icuFromI18nMessage(message){return message.nodes[0]}function wrapI18nPlaceholder(content,contextId=0){const blockId=contextId>0?`:${contextId}`:"";return`${I18N_PLACEHOLDER_SYMBOL}${content}${blockId}${I18N_PLACEHOLDER_SYMBOL}`}function assembleI18nBoundString(strings,bindingStartIndex=0,contextId=0){if(!strings.length)return"";let acc="";const lastIdx=strings.length-1;for(let i=0;i<lastIdx;i++){acc+=`${strings[i]}${wrapI18nPlaceholder(bindingStartIndex+i,contextId)}`}acc+=strings[lastIdx];return acc}function getSeqNumberGenerator(startsAt=0){let current=startsAt;return()=>current++}function placeholdersToParams(placeholders){const params={};placeholders.forEach(((values,key)=>{params[key]=literal(values.length>1?`[${values.join("|")}]`:values[0])}));return params}function updatePlaceholderMap(map,name,...values){const current=map.get(name)||[];current.push(...values);map.set(name,current)}function assembleBoundTextPlaceholders(meta,bindingStartIndex=0,contextId=0){const startIdx=bindingStartIndex;const placeholders=new Map;const node=meta instanceof Message?meta.nodes.find((node=>node instanceof Container)):meta;if(node){node.children.filter((child=>child instanceof Placeholder)).forEach(((child,idx)=>{const content=wrapI18nPlaceholder(startIdx+idx,contextId);updatePlaceholderMap(placeholders,child.name,content)}))}return placeholders}function formatI18nPlaceholderNamesInMap(params={},useCamelCase){const _params={};if(params&&Object.keys(params).length){Object.keys(params).forEach((key=>_params[formatI18nPlaceholderName(key,useCamelCase)]=params[key]))}return _params}function formatI18nPlaceholderName(name,useCamelCase=true){const publicName=toPublicName(name);if(!useCamelCase){return publicName}const chunks=publicName.split("_");if(chunks.length===1){return name.toLowerCase()}let postfix;if(/^\d+$/.test(chunks[chunks.length-1])){postfix=chunks.pop()}let raw=chunks.shift().toLowerCase();if(chunks.length){raw+=chunks.map((c=>c.charAt(0).toUpperCase()+c.slice(1).toLowerCase())).join("")}return postfix?`${raw}_${postfix}`:raw}function getTranslationConstPrefix(extra){return`${CLOSURE_TRANSLATION_VAR_PREFIX}${extra}`.toUpperCase()}function declareI18nVariable(variable){return new DeclareVarStmt(variable.name,undefined,INFERRED_TYPE,undefined,variable.sourceSpan)}const UNSAFE_OBJECT_KEY_NAME_REGEXP=/[-.]/;const TEMPORARY_NAME="_t";const CONTEXT_NAME="ctx";const RENDER_FLAGS="rf";const REFERENCE_PREFIX="_r";const IMPLICIT_REFERENCE="$implicit";const NON_BINDABLE_ATTR="ngNonBindable";const RESTORED_VIEW_CONTEXT_NAME="restoredCtx";const DIRECT_CONTEXT_REFERENCE="#context";const MAX_CHAIN_LENGTH=500;const CHAINABLE_INSTRUCTIONS=new Set([Identifiers.element,Identifiers.elementStart,Identifiers.elementEnd,Identifiers.elementContainer,Identifiers.elementContainerStart,Identifiers.elementContainerEnd,Identifiers.i18nExp,Identifiers.listener,Identifiers.classProp,Identifiers.syntheticHostListener,Identifiers.hostProperty,Identifiers.syntheticHostProperty,Identifiers.property,Identifiers.propertyInterpolate1,Identifiers.propertyInterpolate2,Identifiers.propertyInterpolate3,Identifiers.propertyInterpolate4,Identifiers.propertyInterpolate5,Identifiers.propertyInterpolate6,Identifiers.propertyInterpolate7,Identifiers.propertyInterpolate8,Identifiers.propertyInterpolateV,Identifiers.attribute,Identifiers.attributeInterpolate1,Identifiers.attributeInterpolate2,Identifiers.attributeInterpolate3,Identifiers.attributeInterpolate4,Identifiers.attributeInterpolate5,Identifiers.attributeInterpolate6,Identifiers.attributeInterpolate7,Identifiers.attributeInterpolate8,Identifiers.attributeInterpolateV,Identifiers.styleProp,Identifiers.stylePropInterpolate1,Identifiers.stylePropInterpolate2,Identifiers.stylePropInterpolate3,Identifiers.stylePropInterpolate4,Identifiers.stylePropInterpolate5,Identifiers.stylePropInterpolate6,Identifiers.stylePropInterpolate7,Identifiers.stylePropInterpolate8,Identifiers.stylePropInterpolateV,Identifiers.textInterpolate,Identifiers.textInterpolate1,Identifiers.textInterpolate2,Identifiers.textInterpolate3,Identifiers.textInterpolate4,Identifiers.textInterpolate5,Identifiers.textInterpolate6,Identifiers.textInterpolate7,Identifiers.textInterpolate8,Identifiers.textInterpolateV,Identifiers.templateCreate,Identifiers.twoWayProperty,Identifiers.twoWayListener]);function invokeInstruction(span,reference,params){return importExpr(reference,null,span).callFn(params,span)}function temporaryAllocator(pushStatement,name){let temp=null;return()=>{if(!temp){pushStatement(new DeclareVarStmt(TEMPORARY_NAME,undefined,DYNAMIC_TYPE));temp=variable(name)}return temp}}function invalid(arg){throw new Error(`Invalid state: Visitor ${this.constructor.name} doesn't handle ${arg.constructor.name}`)}function asLiteral(value){if(Array.isArray(value)){return literalArr(value.map(asLiteral))}return literal(value,INFERRED_TYPE)}function conditionallyCreateDirectiveBindingLiteral(map,forInputs){const keys=Object.getOwnPropertyNames(map);if(keys.length===0){return null}return literalMap(keys.map((key=>{const value=map[key];let declaredName;let publicName;let minifiedName;let expressionValue;if(typeof value==="string"){declaredName=key;minifiedName=key;publicName=value;expressionValue=asLiteral(publicName)}else{minifiedName=key;declaredName=value.classPropertyName;publicName=value.bindingPropertyName;const differentDeclaringName=publicName!==declaredName;const hasDecoratorInputTransform=value.transformFunction!==null;let flags=null;if(value.isSignal){flags=bitwiseOrInputFlagsExpr(InputFlags.SignalBased,flags)}if(hasDecoratorInputTransform){flags=bitwiseOrInputFlagsExpr(InputFlags.HasDecoratorInputTransform,flags)}if(forInputs&&(differentDeclaringName||hasDecoratorInputTransform||flags!==null)){const flagsExpr=flags??importExpr(Identifiers.InputFlags).prop(InputFlags[InputFlags.None]);const result=[flagsExpr,asLiteral(publicName)];if(differentDeclaringName||hasDecoratorInputTransform){result.push(asLiteral(declaredName));if(hasDecoratorInputTransform){result.push(value.transformFunction)}}expressionValue=literalArr(result)}else{expressionValue=asLiteral(publicName)}}return{key:minifiedName,quoted:UNSAFE_OBJECT_KEY_NAME_REGEXP.test(minifiedName),value:expressionValue}})))}function getInputFlagExpr(flag){return importExpr(Identifiers.InputFlags).prop(InputFlags[flag])}function bitwiseOrInputFlagsExpr(flag,expr){if(expr===null){return getInputFlagExpr(flag)}return getInputFlagExpr(flag).bitwiseOr(expr)}function trimTrailingNulls(parameters){while(isNull(parameters[parameters.length-1])){parameters.pop()}return parameters}class DefinitionMap{constructor(){this.values=[]}set(key,value){if(value){const existing=this.values.find((value=>value.key===key));if(existing){existing.value=value}else{this.values.push({key:key,value:value,quoted:false})}}}toLiteralMap(){return literalMap(this.values)}}function createCssSelectorFromNode(node){const elementName=node instanceof Element$1?node.name:"ng-template";const attributes=getAttrsForDirectiveMatching(node);const cssSelector=new CssSelector;const elementNameNoNs=splitNsName(elementName)[1];cssSelector.setElement(elementNameNoNs);Object.getOwnPropertyNames(attributes).forEach((name=>{const nameNoNs=splitNsName(name)[1];const value=attributes[name];cssSelector.addAttribute(nameNoNs,value);if(name.toLowerCase()==="class"){const classes=value.trim().split(/\s+/);classes.forEach((className=>cssSelector.addClassName(className)))}}));return cssSelector}function getAttrsForDirectiveMatching(elOrTpl){const attributesMap={};if(elOrTpl instanceof Template&&elOrTpl.tagName!=="ng-template"){elOrTpl.templateAttrs.forEach((a=>attributesMap[a.name]=""))}else{elOrTpl.attributes.forEach((a=>{if(!isI18nAttribute(a.name)){attributesMap[a.name]=a.value}}));elOrTpl.inputs.forEach((i=>{if(i.type===0||i.type===5){attributesMap[i.name]=""}}));elOrTpl.outputs.forEach((o=>{attributesMap[o.name]=""}))}return attributesMap}function getInterpolationArgsLength(interpolation){const{expressions:expressions,strings:strings}=interpolation;if(expressions.length===1&&strings.length===2&&strings[0]===""&&strings[1]===""){return 1}else{return expressions.length+strings.length}}function getInstructionStatements(instructions){const statements=[];let pendingExpression=null;let pendingExpressionType=null;let chainLength=0;for(const current of instructions){const resolvedParams=(typeof current.paramsOrFn==="function"?current.paramsOrFn():current.paramsOrFn)??[];const params=Array.isArray(resolvedParams)?resolvedParams:[resolvedParams];if(chainLength<MAX_CHAIN_LENGTH&&pendingExpressionType===current.reference&&CHAINABLE_INSTRUCTIONS.has(pendingExpressionType)){pendingExpression=pendingExpression.callFn(params,pendingExpression.sourceSpan);chainLength++}else{if(pendingExpression!==null){statements.push(pendingExpression.toStmt())}pendingExpression=invokeInstruction(current.span,current.reference,params);pendingExpressionType=current.reference;chainLength=0}}if(pendingExpression!==null){statements.push(pendingExpression.toStmt())}return statements}function compileInjectable(meta,resolveForwardRefs){let result=null;const factoryMeta={name:meta.name,type:meta.type,typeArgumentCount:meta.typeArgumentCount,deps:[],target:exports.FactoryTarget.Injectable};if(meta.useClass!==undefined){const useClassOnSelf=meta.useClass.expression.isEquivalent(meta.type.value);let deps=undefined;if(meta.deps!==undefined){deps=meta.deps}if(deps!==undefined){result=compileFactoryFunction({...factoryMeta,delegate:meta.useClass.expression,delegateDeps:deps,delegateType:R3FactoryDelegateType.Class})}else if(useClassOnSelf){result=compileFactoryFunction(factoryMeta)}else{result={statements:[],expression:delegateToFactory(meta.type.value,meta.useClass.expression,resolveForwardRefs)}}}else if(meta.useFactory!==undefined){if(meta.deps!==undefined){result=compileFactoryFunction({...factoryMeta,delegate:meta.useFactory,delegateDeps:meta.deps||[],delegateType:R3FactoryDelegateType.Function})}else{result={statements:[],expression:arrowFn([],meta.useFactory.callFn([]))}}}else if(meta.useValue!==undefined){result=compileFactoryFunction({...factoryMeta,expression:meta.useValue.expression})}else if(meta.useExisting!==undefined){result=compileFactoryFunction({...factoryMeta,expression:importExpr(Identifiers.inject).callFn([meta.useExisting.expression])})}else{result={statements:[],expression:delegateToFactory(meta.type.value,meta.type.value,resolveForwardRefs)}}const token=meta.type.value;const injectableProps=new DefinitionMap;injectableProps.set("token",token);injectableProps.set("factory",result.expression);if(meta.providedIn.expression.value!==null){injectableProps.set("providedIn",convertFromMaybeForwardRefExpression(meta.providedIn))}const expression=importExpr(Identifiers.\u0275\u0275defineInjectable).callFn([injectableProps.toLiteralMap()],undefined,true);return{expression:expression,type:createInjectableType(meta),statements:result.statements}}function createInjectableType(meta){return new ExpressionType(importExpr(Identifiers.InjectableDeclaration,[typeWithParameters(meta.type.type,meta.typeArgumentCount)]))}function delegateToFactory(type,useType,unwrapForwardRefs){if(type.node===useType.node){return useType.prop("\u0275fac")}if(!unwrapForwardRefs){return createFactoryFunction(useType)}const unwrappedType=importExpr(Identifiers.resolveForwardRef).callFn([useType]);return createFactoryFunction(unwrappedType)}function createFactoryFunction(type){return arrowFn([new FnParam("t",DYNAMIC_TYPE)],type.prop("\u0275fac").callFn([variable("t")]))}const UNUSABLE_INTERPOLATION_REGEXPS=[/^\s*$/,/[<>]/,/^[{}]$/,/&(#|[a-z])/i,/^\/\//];function assertInterpolationSymbols(identifier,value){if(value!=null&&!(Array.isArray(value)&&value.length==2)){throw new Error(`Expected '${identifier}' to be an array, [start, end].`)}else if(value!=null){const start=value[0];const end=value[1];UNUSABLE_INTERPOLATION_REGEXPS.forEach((regexp=>{if(regexp.test(start)||regexp.test(end)){throw new Error(`['${start}', '${end}'] contains unusable interpolation symbol.`)}}))}}class InterpolationConfig{static fromArray(markers){if(!markers){return DEFAULT_INTERPOLATION_CONFIG}assertInterpolationSymbols("interpolation",markers);return new InterpolationConfig(markers[0],markers[1])}constructor(start,end){this.start=start;this.end=end}}const DEFAULT_INTERPOLATION_CONFIG=new InterpolationConfig("{{","}}");const DEFAULT_CONTAINER_BLOCKS=new Set(["switch"]);const $EOF=0;const $BSPACE=8;const $TAB=9;const $LF=10;const $VTAB=11;const $FF=12;const $CR=13;const $SPACE=32;const $BANG=33;const $DQ=34;const $HASH=35;const $$=36;const $PERCENT=37;const $AMPERSAND=38;const $SQ=39;const $LPAREN=40;const $RPAREN=41;const $STAR=42;const $PLUS=43;const $COMMA=44;const $MINUS=45;const $PERIOD=46;const $SLASH=47;const $COLON=58;const $SEMICOLON=59;const $LT=60;const $EQ=61;const $GT=62;const $QUESTION=63;const $0=48;const $7=55;const $9=57;const $A=65;const $E=69;const $F=70;const $X=88;const $Z=90;const $LBRACKET=91;const $BACKSLASH=92;const $RBRACKET=93;const $CARET=94;const $_=95;const $a=97;const $b=98;const $e=101;const $f=102;const $n=110;const $r=114;const $t=116;const $u=117;const $v=118;const $x=120;const $z=122;const $LBRACE=123;const $BAR=124;const $RBRACE=125;const $NBSP=160;const $AT=64;const $BT=96;function isWhitespace(code){return code>=$TAB&&code<=$SPACE||code==$NBSP}function isDigit(code){return $0<=code&&code<=$9}function isAsciiLetter(code){return code>=$a&&code<=$z||code>=$A&&code<=$Z}function isAsciiHexDigit(code){return code>=$a&&code<=$f||code>=$A&&code<=$F||isDigit(code)}function isNewLine(code){return code===$LF||code===$CR}function isOctalDigit(code){return $0<=code&&code<=$7}function isQuote(code){return code===$SQ||code===$DQ||code===$BT}class ParseLocation{constructor(file,offset,line,col){this.file=file;this.offset=offset;this.line=line;this.col=col}toString(){return this.offset!=null?`${this.file.url}@${this.line}:${this.col}`:this.file.url}moveBy(delta){const source=this.file.content;const len=source.length;let offset=this.offset;let line=this.line;let col=this.col;while(offset>0&&delta<0){offset--;delta++;const ch=source.charCodeAt(offset);if(ch==$LF){line--;const priorLine=source.substring(0,offset-1).lastIndexOf(String.fromCharCode($LF));col=priorLine>0?offset-priorLine:offset}else{col--}}while(offset<len&&delta>0){const ch=source.charCodeAt(offset);offset++;delta--;if(ch==$LF){line++;col=0}else{col++}}return new ParseLocation(this.file,offset,line,col)}getContext(maxChars,maxLines){const content=this.file.content;let startOffset=this.offset;if(startOffset!=null){if(startOffset>content.length-1){startOffset=content.length-1}let endOffset=startOffset;let ctxChars=0;let ctxLines=0;while(ctxChars<maxChars&&startOffset>0){startOffset--;ctxChars++;if(content[startOffset]=="\n"){if(++ctxLines==maxLines){break}}}ctxChars=0;ctxLines=0;while(ctxChars<maxChars&&endOffset<content.length-1){endOffset++;ctxChars++;if(content[endOffset]=="\n"){if(++ctxLines==maxLines){break}}}return{before:content.substring(startOffset,this.offset),after:content.substring(this.offset,endOffset+1)}}return null}}class ParseSourceFile{constructor(content,url){this.content=content;this.url=url}}class ParseSourceSpan{constructor(start,end,fullStart=start,details=null){this.start=start;this.end=end;this.fullStart=fullStart;this.details=details}toString(){return this.start.file.content.substring(this.start.offset,this.end.offset)}}exports.ParseErrorLevel=void 0;(function(ParseErrorLevel){ParseErrorLevel[ParseErrorLevel["WARNING"]=0]="WARNING";ParseErrorLevel[ParseErrorLevel["ERROR"]=1]="ERROR"})(exports.ParseErrorLevel||(exports.ParseErrorLevel={}));class ParseError{constructor(span,msg,level=exports.ParseErrorLevel.ERROR){this.span=span;this.msg=msg;this.level=level}contextualMessage(){const ctx=this.span.start.getContext(100,3);return ctx?`${this.msg} ("${ctx.before}[${exports.ParseErrorLevel[this.level]} ->]${ctx.after}")`:this.msg}toString(){const details=this.span.details?`, ${this.span.details}`:"";return`${this.contextualMessage()}: ${this.span.start}${details}`}}function r3JitTypeSourceSpan(kind,typeName,sourceUrl){const sourceFileName=`in ${kind} ${typeName} in ${sourceUrl}`;const sourceFile=new ParseSourceFile("",sourceFileName);return new ParseSourceSpan(new ParseLocation(sourceFile,-1,-1,-1),new ParseLocation(sourceFile,-1,-1,-1))}let _anonymousTypeIndex=0;function identifierName(compileIdentifier){if(!compileIdentifier||!compileIdentifier.reference){return null}const ref=compileIdentifier.reference;if(ref["__anonymousType"]){return ref["__anonymousType"]}if(ref["__forward_ref__"]){return"__forward_ref__"}let identifier=stringify(ref);if(identifier.indexOf("(")>=0){identifier=`anonymous_${_anonymousTypeIndex++}`;ref["__anonymousType"]=identifier}else{identifier=sanitizeIdentifier(identifier)}return identifier}function sanitizeIdentifier(name){return name.replace(/\W/g,"_")}const makeTemplateObjectPolyfill='(this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e})';class AbstractJsEmitterVisitor extends AbstractEmitterVisitor{constructor(){super(false)}visitWrappedNodeExpr(ast,ctx){throw new Error("Cannot emit a WrappedNodeExpr in Javascript.")}visitDeclareVarStmt(stmt,ctx){ctx.print(stmt,`var ${stmt.name}`);if(stmt.value){ctx.print(stmt," = ");stmt.value.visitExpression(this,ctx)}ctx.println(stmt,`;`);return null}visitTaggedTemplateExpr(ast,ctx){const elements=ast.template.elements;ast.tag.visitExpression(this,ctx);ctx.print(ast,`(${makeTemplateObjectPolyfill}(`);ctx.print(ast,`[${elements.map((part=>escapeIdentifier(part.text,false))).join(", ")}], `);ctx.print(ast,`[${elements.map((part=>escapeIdentifier(part.rawText,false))).join(", ")}])`);ast.template.expressions.forEach((expression=>{ctx.print(ast,", ");expression.visitExpression(this,ctx)}));ctx.print(ast,")");return null}visitFunctionExpr(ast,ctx){ctx.print(ast,`function${ast.name?" "+ast.name:""}(`);this._visitParams(ast.params,ctx);ctx.println(ast,`) {`);ctx.incIndent();this.visitAllStatements(ast.statements,ctx);ctx.decIndent();ctx.print(ast,`}`);return null}visitArrowFunctionExpr(ast,ctx){ctx.print(ast,"(");this._visitParams(ast.params,ctx);ctx.print(ast,") =>");if(Array.isArray(ast.body)){ctx.println(ast,`{`);ctx.incIndent();this.visitAllStatements(ast.body,ctx);ctx.decIndent();ctx.print(ast,`}`)}else{const isObjectLiteral=ast.body instanceof LiteralMapExpr;if(isObjectLiteral){ctx.print(ast,"(")}ast.body.visitExpression(this,ctx);if(isObjectLiteral){ctx.print(ast,")")}}return null}visitDeclareFunctionStmt(stmt,ctx){ctx.print(stmt,`function ${stmt.name}(`);this._visitParams(stmt.params,ctx);ctx.println(stmt,`) {`);ctx.incIndent();this.visitAllStatements(stmt.statements,ctx);ctx.decIndent();ctx.println(stmt,`}`);return null}visitLocalizedString(ast,ctx){ctx.print(ast,`$localize(${makeTemplateObjectPolyfill}(`);const parts=[ast.serializeI18nHead()];for(let i=1;i<ast.messageParts.length;i++){parts.push(ast.serializeI18nTemplatePart(i))}ctx.print(ast,`[${parts.map((part=>escapeIdentifier(part.cooked,false))).join(", ")}], `);ctx.print(ast,`[${parts.map((part=>escapeIdentifier(part.raw,false))).join(", ")}])`);ast.expressions.forEach((expression=>{ctx.print(ast,", ");expression.visitExpression(this,ctx)}));ctx.print(ast,")");return null}_visitParams(params,ctx){this.visitAllObjects((param=>ctx.print(null,param.name)),params,ctx,",")}}let policy;function getPolicy(){if(policy===undefined){const trustedTypes=_global["trustedTypes"];policy=null;if(trustedTypes){try{policy=trustedTypes.createPolicy("angular#unsafe-jit",{createScript:s=>s})}catch{}}}return policy}function trustedScriptFromString(script){return getPolicy()?.createScript(script)||script}function newTrustedFunctionForJIT(...args){if(!_global["trustedTypes"]){return new Function(...args)}const fnArgs=args.slice(0,-1).join(",");const fnBody=args[args.length-1];const body=`(function anonymous(${fnArgs}\n) { ${fnBody}\n})`;const fn=_global["eval"](trustedScriptFromString(body));if(fn.bind===undefined){return new Function(...args)}fn.toString=()=>body;return fn.bind(_global)}class JitEvaluator{evaluateStatements(sourceUrl,statements,refResolver,createSourceMaps){const converter=new JitEmitterVisitor(refResolver);const ctx=EmitterVisitorContext.createRoot();if(statements.length>0&&!isUseStrictStatement(statements[0])){statements=[literal("use strict").toStmt(),...statements]}converter.visitAllStatements(statements,ctx);converter.createReturnStmt(ctx);return this.evaluateCode(sourceUrl,ctx,converter.getArgs(),createSourceMaps)}evaluateCode(sourceUrl,ctx,vars,createSourceMap){let fnBody=`"use strict";${ctx.toSource()}\n//# sourceURL=${sourceUrl}`;const fnArgNames=[];const fnArgValues=[];for(const argName in vars){fnArgValues.push(vars[argName]);fnArgNames.push(argName)}if(createSourceMap){const emptyFn=newTrustedFunctionForJIT(...fnArgNames.concat("return null;")).toString();const headerLines=emptyFn.slice(0,emptyFn.indexOf("return null;")).split("\n").length-1;fnBody+=`\n${ctx.toSourceMapGenerator(sourceUrl,headerLines).toJsComment()}`}const fn=newTrustedFunctionForJIT(...fnArgNames.concat(fnBody));return this.executeFunction(fn,fnArgValues)}executeFunction(fn,args){return fn(...args)}}class JitEmitterVisitor extends AbstractJsEmitterVisitor{constructor(refResolver){super();this.refResolver=refResolver;this._evalArgNames=[];this._evalArgValues=[];this._evalExportedVars=[]}createReturnStmt(ctx){const stmt=new ReturnStatement(new LiteralMapExpr(this._evalExportedVars.map((resultVar=>new LiteralMapEntry(resultVar,variable(resultVar),false)))));stmt.visitStatement(this,ctx)}getArgs(){const result={};for(let i=0;i<this._evalArgNames.length;i++){result[this._evalArgNames[i]]=this._evalArgValues[i]}return result}visitExternalExpr(ast,ctx){this._emitReferenceToExternal(ast,this.refResolver.resolveExternalReference(ast.value),ctx);return null}visitWrappedNodeExpr(ast,ctx){this._emitReferenceToExternal(ast,ast.node,ctx);return null}visitDeclareVarStmt(stmt,ctx){if(stmt.hasModifier(exports.StmtModifier.Exported)){this._evalExportedVars.push(stmt.name)}return super.visitDeclareVarStmt(stmt,ctx)}visitDeclareFunctionStmt(stmt,ctx){if(stmt.hasModifier(exports.StmtModifier.Exported)){this._evalExportedVars.push(stmt.name)}return super.visitDeclareFunctionStmt(stmt,ctx)}_emitReferenceToExternal(ast,value,ctx){let id=this._evalArgValues.indexOf(value);if(id===-1){id=this._evalArgValues.length;this._evalArgValues.push(value);const name=identifierName({reference:value})||"val";this._evalArgNames.push(`jit_${name}_${id}`)}ctx.print(ast,this._evalArgNames[id])}}function isUseStrictStatement(statement){return statement.isEquivalent(literal("use strict").toStmt())}function compileInjector(meta){const definitionMap=new DefinitionMap;if(meta.providers!==null){definitionMap.set("providers",meta.providers)}if(meta.imports.length>0){definitionMap.set("imports",literalArr(meta.imports))}const expression=importExpr(Identifiers.defineInjector).callFn([definitionMap.toLiteralMap()],undefined,true);const type=createInjectorType(meta);return{expression:expression,type:type,statements:[]}}function createInjectorType(meta){return new ExpressionType(importExpr(Identifiers.InjectorDeclaration,[new ExpressionType(meta.type.type)]))}class R3JitReflector{constructor(context){this.context=context}resolveExternalReference(ref){if(ref.moduleName!=="@angular/core"){throw new Error(`Cannot resolve external reference to ${ref.moduleName}, only references to @angular/core are supported.`)}if(!this.context.hasOwnProperty(ref.name)){throw new Error(`No value provided for @angular/core symbol '${ref.name}'.`)}return this.context[ref.name]}}exports.R3SelectorScopeMode=void 0;(function(R3SelectorScopeMode){R3SelectorScopeMode[R3SelectorScopeMode["Inline"]=0]="Inline";R3SelectorScopeMode[R3SelectorScopeMode["SideEffect"]=1]="SideEffect";R3SelectorScopeMode[R3SelectorScopeMode["Omit"]=2]="Omit"})(exports.R3SelectorScopeMode||(exports.R3SelectorScopeMode={}));exports.R3NgModuleMetadataKind=void 0;(function(R3NgModuleMetadataKind){R3NgModuleMetadataKind[R3NgModuleMetadataKind["Global"]=0]="Global";R3NgModuleMetadataKind[R3NgModuleMetadataKind["Local"]=1]="Local"})(exports.R3NgModuleMetadataKind||(exports.R3NgModuleMetadataKind={}));function compileNgModule(meta){const statements=[];const definitionMap=new DefinitionMap;definitionMap.set("type",meta.type.value);if(meta.kind===exports.R3NgModuleMetadataKind.Global&&meta.bootstrap.length>0){definitionMap.set("bootstrap",refsToArray(meta.bootstrap,meta.containsForwardDecls))}if(meta.selectorScopeMode===exports.R3SelectorScopeMode.Inline){if(meta.declarations.length>0){definitionMap.set("declarations",refsToArray(meta.declarations,meta.containsForwardDecls))}if(meta.imports.length>0){definitionMap.set("imports",refsToArray(meta.imports,meta.containsForwardDecls))}if(meta.exports.length>0){definitionMap.set("exports",refsToArray(meta.exports,meta.containsForwardDecls))}}else if(meta.selectorScopeMode===exports.R3SelectorScopeMode.SideEffect){const setNgModuleScopeCall=generateSetNgModuleScopeCall(meta);if(setNgModuleScopeCall!==null){statements.push(setNgModuleScopeCall)}}else;if(meta.schemas!==null&&meta.schemas.length>0){definitionMap.set("schemas",literalArr(meta.schemas.map((ref=>ref.value))))}if(meta.id!==null){definitionMap.set("id",meta.id);statements.push(importExpr(Identifiers.registerNgModuleType).callFn([meta.type.value,meta.id]).toStmt())}const expression=importExpr(Identifiers.defineNgModule).callFn([definitionMap.toLiteralMap()],undefined,true);const type=createNgModuleType(meta);return{expression:expression,type:type,statements:statements}}function compileNgModuleDeclarationExpression(meta){const definitionMap=new DefinitionMap;definitionMap.set("type",new WrappedNodeExpr(meta.type));if(meta.bootstrap!==undefined){definitionMap.set("bootstrap",new WrappedNodeExpr(meta.bootstrap))}if(meta.declarations!==undefined){definitionMap.set("declarations",new WrappedNodeExpr(meta.declarations))}if(meta.imports!==undefined){definitionMap.set("imports",new WrappedNodeExpr(meta.imports))}if(meta.exports!==undefined){definitionMap.set("exports",new WrappedNodeExpr(meta.exports))}if(meta.schemas!==undefined){definitionMap.set("schemas",new WrappedNodeExpr(meta.schemas))}if(meta.id!==undefined){definitionMap.set("id",new WrappedNodeExpr(meta.id))}return importExpr(Identifiers.defineNgModule).callFn([definitionMap.toLiteralMap()])}function createNgModuleType(meta){if(meta.kind===exports.R3NgModuleMetadataKind.Local){return new ExpressionType(meta.type.value)}const{type:moduleType,declarations:declarations,exports:exports$1,imports:imports,includeImportTypes:includeImportTypes,publicDeclarationTypes:publicDeclarationTypes}=meta;return new ExpressionType(importExpr(Identifiers.NgModuleDeclaration,[new ExpressionType(moduleType.type),publicDeclarationTypes===null?tupleTypeOf(declarations):tupleOfTypes(publicDeclarationTypes),includeImportTypes?tupleTypeOf(imports):NONE_TYPE,tupleTypeOf(exports$1)]))}function generateSetNgModuleScopeCall(meta){const scopeMap=new DefinitionMap;if(meta.kind===exports.R3NgModuleMetadataKind.Global){if(meta.declarations.length>0){scopeMap.set("declarations",refsToArray(meta.declarations,meta.containsForwardDecls))}}else{if(meta.declarationsExpression){scopeMap.set("declarations",meta.declarationsExpression)}}if(meta.kind===exports.R3NgModuleMetadataKind.Global){if(meta.imports.length>0){scopeMap.set("imports",refsToArray(meta.imports,meta.containsForwardDecls))}}else{if(meta.importsExpression){scopeMap.set("imports",meta.importsExpression)}}if(meta.kind===exports.R3NgModuleMetadataKind.Global){if(meta.exports.length>0){scopeMap.set("exports",refsToArray(meta.exports,meta.containsForwardDecls))}}else{if(meta.exportsExpression){scopeMap.set("exports",meta.exportsExpression)}}if(meta.kind===exports.R3NgModuleMetadataKind.Local&&meta.bootstrapExpression){scopeMap.set("bootstrap",meta.bootstrapExpression)}if(Object.keys(scopeMap.values).length===0){return null}const fnCall=new InvokeFunctionExpr(importExpr(Identifiers.setNgModuleScope),[meta.type.value,scopeMap.toLiteralMap()]);const guardedCall=jitOnlyGuardedExpression(fnCall);const iife=new FunctionExpr([],[guardedCall.toStmt()]);const iifeCall=new InvokeFunctionExpr(iife,[]);return iifeCall.toStmt()}function tupleTypeOf(exp){const types=exp.map((ref=>typeofExpr(ref.type)));return exp.length>0?expressionType(literalArr(types)):NONE_TYPE}function tupleOfTypes(types){const typeofTypes=types.map((type=>typeofExpr(type)));return types.length>0?expressionType(literalArr(typeofTypes)):NONE_TYPE}function compilePipeFromMetadata(metadata){const definitionMapValues=[];definitionMapValues.push({key:"name",value:literal(metadata.pipeName),quoted:false});definitionMapValues.push({key:"type",value:metadata.type.value,quoted:false});definitionMapValues.push({key:"pure",value:literal(metadata.pure),quoted:false});if(metadata.isStandalone){definitionMapValues.push({key:"standalone",value:literal(true),quoted:false})}const expression=importExpr(Identifiers.definePipe).callFn([literalMap(definitionMapValues)],undefined,true);const type=createPipeType(metadata);return{expression:expression,type:type,statements:[]}}function createPipeType(metadata){return new ExpressionType(importExpr(Identifiers.PipeDeclaration,[typeWithParameters(metadata.type.type,metadata.typeArgumentCount),new ExpressionType(new LiteralExpr(metadata.pipeName)),new ExpressionType(new LiteralExpr(metadata.isStandalone))]))}exports.R3TemplateDependencyKind=void 0;(function(R3TemplateDependencyKind){R3TemplateDependencyKind[R3TemplateDependencyKind["Directive"]=0]="Directive";R3TemplateDependencyKind[R3TemplateDependencyKind["Pipe"]=1]="Pipe";R3TemplateDependencyKind[R3TemplateDependencyKind["NgModule"]=2]="NgModule"})(exports.R3TemplateDependencyKind||(exports.R3TemplateDependencyKind={}));class ParserError{constructor(message,input,errLocation,ctxLocation){this.input=input;this.errLocation=errLocation;this.ctxLocation=ctxLocation;this.message=`Parser Error: ${message} ${errLocation} [${input}] in ${ctxLocation}`}}class ParseSpan{constructor(start,end){this.start=start;this.end=end}toAbsolute(absoluteOffset){return new AbsoluteSourceSpan(absoluteOffset+this.start,absoluteOffset+this.end)}}class AST{constructor(span,sourceSpan){this.span=span;this.sourceSpan=sourceSpan}toString(){return"AST"}}class ASTWithName extends AST{constructor(span,sourceSpan,nameSpan){super(span,sourceSpan);this.nameSpan=nameSpan}}class EmptyExpr$1 extends AST{visit(visitor,context=null){}}class ImplicitReceiver extends AST{visit(visitor,context=null){return visitor.visitImplicitReceiver(this,context)}}class ThisReceiver extends ImplicitReceiver{visit(visitor,context=null){return visitor.visitThisReceiver?.(this,context)}}class Chain extends AST{constructor(span,sourceSpan,expressions){super(span,sourceSpan);this.expressions=expressions}visit(visitor,context=null){return visitor.visitChain(this,context)}}class Conditional extends AST{constructor(span,sourceSpan,condition,trueExp,falseExp){super(span,sourceSpan);this.condition=condition;this.trueExp=trueExp;this.falseExp=falseExp}visit(visitor,context=null){return visitor.visitConditional(this,context)}}class PropertyRead extends ASTWithName{constructor(span,sourceSpan,nameSpan,receiver,name){super(span,sourceSpan,nameSpan);this.receiver=receiver;this.name=name}visit(visitor,context=null){return visitor.visitPropertyRead(this,context)}}class PropertyWrite extends ASTWithName{constructor(span,sourceSpan,nameSpan,receiver,name,value){super(span,sourceSpan,nameSpan);this.receiver=receiver;this.name=name;this.value=value}visit(visitor,context=null){return visitor.visitPropertyWrite(this,context)}}class SafePropertyRead extends ASTWithName{constructor(span,sourceSpan,nameSpan,receiver,name){super(span,sourceSpan,nameSpan);this.receiver=receiver;this.name=name}visit(visitor,context=null){return visitor.visitSafePropertyRead(this,context)}}class KeyedRead extends AST{constructor(span,sourceSpan,receiver,key){super(span,sourceSpan);this.receiver=receiver;this.key=key}visit(visitor,context=null){return visitor.visitKeyedRead(this,context)}}class SafeKeyedRead extends AST{constructor(span,sourceSpan,receiver,key){super(span,sourceSpan);this.receiver=receiver;this.key=key}visit(visitor,context=null){return visitor.visitSafeKeyedRead(this,context)}}class KeyedWrite extends AST{constructor(span,sourceSpan,receiver,key,value){super(span,sourceSpan);this.receiver=receiver;this.key=key;this.value=value}visit(visitor,context=null){return visitor.visitKeyedWrite(this,context)}}class BindingPipe extends ASTWithName{constructor(span,sourceSpan,exp,name,args,nameSpan){super(span,sourceSpan,nameSpan);this.exp=exp;this.name=name;this.args=args}visit(visitor,context=null){return visitor.visitPipe(this,context)}}class LiteralPrimitive extends AST{constructor(span,sourceSpan,value){super(span,sourceSpan);this.value=value}visit(visitor,context=null){return visitor.visitLiteralPrimitive(this,context)}}class LiteralArray extends AST{constructor(span,sourceSpan,expressions){super(span,sourceSpan);this.expressions=expressions}visit(visitor,context=null){return visitor.visitLiteralArray(this,context)}}class LiteralMap extends AST{constructor(span,sourceSpan,keys,values){super(span,sourceSpan);this.keys=keys;this.values=values}visit(visitor,context=null){return visitor.visitLiteralMap(this,context)}}class Interpolation$1 extends AST{constructor(span,sourceSpan,strings,expressions){super(span,sourceSpan);this.strings=strings;this.expressions=expressions}visit(visitor,context=null){return visitor.visitInterpolation(this,context)}}class Binary extends AST{constructor(span,sourceSpan,operation,left,right){super(span,sourceSpan);this.operation=operation;this.left=left;this.right=right}visit(visitor,context=null){return visitor.visitBinary(this,context)}}class Unary extends Binary{static createMinus(span,sourceSpan,expr){return new Unary(span,sourceSpan,"-",expr,"-",new LiteralPrimitive(span,sourceSpan,0),expr)}static createPlus(span,sourceSpan,expr){return new Unary(span,sourceSpan,"+",expr,"-",expr,new LiteralPrimitive(span,sourceSpan,0))}constructor(span,sourceSpan,operator,expr,binaryOp,binaryLeft,binaryRight){super(span,sourceSpan,binaryOp,binaryLeft,binaryRight);this.operator=operator;this.expr=expr;this.left=null;this.right=null;this.operation=null}visit(visitor,context=null){if(visitor.visitUnary!==undefined){return visitor.visitUnary(this,context)}return visitor.visitBinary(this,context)}}class PrefixNot extends AST{constructor(span,sourceSpan,expression){super(span,sourceSpan);this.expression=expression}visit(visitor,context=null){return visitor.visitPrefixNot(this,context)}}class NonNullAssert extends AST{constructor(span,sourceSpan,expression){super(span,sourceSpan);this.expression=expression}visit(visitor,context=null){return visitor.visitNonNullAssert(this,context)}}class Call extends AST{constructor(span,sourceSpan,receiver,args,argumentSpan){super(span,sourceSpan);this.receiver=receiver;this.args=args;this.argumentSpan=argumentSpan}visit(visitor,context=null){return visitor.visitCall(this,context)}}class SafeCall extends AST{constructor(span,sourceSpan,receiver,args,argumentSpan){super(span,sourceSpan);this.receiver=receiver;this.args=args;this.argumentSpan=argumentSpan}visit(visitor,context=null){return visitor.visitSafeCall(this,context)}}class AbsoluteSourceSpan{constructor(start,end){this.start=start;this.end=end}}class ASTWithSource extends AST{constructor(ast,source,location,absoluteOffset,errors){super(new ParseSpan(0,source===null?0:source.length),new AbsoluteSourceSpan(absoluteOffset,source===null?absoluteOffset:absoluteOffset+source.length));this.ast=ast;this.source=source;this.location=location;this.errors=errors}visit(visitor,context=null){if(visitor.visitASTWithSource){return visitor.visitASTWithSource(this,context)}return this.ast.visit(visitor,context)}toString(){return`${this.source} in ${this.location}`}}class VariableBinding{constructor(sourceSpan,key,value){this.sourceSpan=sourceSpan;this.key=key;this.value=value}}class ExpressionBinding{constructor(sourceSpan,key,value){this.sourceSpan=sourceSpan;this.key=key;this.value=value}}class RecursiveAstVisitor{visit(ast,context){ast.visit(this,context)}visitUnary(ast,context){this.visit(ast.expr,context)}visitBinary(ast,context){this.visit(ast.left,context);this.visit(ast.right,context)}visitChain(ast,context){this.visitAll(ast.expressions,context)}visitConditional(ast,context){this.visit(ast.condition,context);this.visit(ast.trueExp,context);this.visit(ast.falseExp,context)}visitPipe(ast,context){this.visit(ast.exp,context);this.visitAll(ast.args,context)}visitImplicitReceiver(ast,context){}visitThisReceiver(ast,context){}visitInterpolation(ast,context){this.visitAll(ast.expressions,context)}visitKeyedRead(ast,context){this.visit(ast.receiver,context);this.visit(ast.key,context)}visitKeyedWrite(ast,context){this.visit(ast.receiver,context);this.visit(ast.key,context);this.visit(ast.value,context)}visitLiteralArray(ast,context){this.visitAll(ast.expressions,context)}visitLiteralMap(ast,context){this.visitAll(ast.values,context)}visitLiteralPrimitive(ast,context){}visitPrefixNot(ast,context){this.visit(ast.expression,context)}visitNonNullAssert(ast,context){this.visit(ast.expression,context)}visitPropertyRead(ast,context){this.visit(ast.receiver,context)}visitPropertyWrite(ast,context){this.visit(ast.receiver,context);this.visit(ast.value,context)}visitSafePropertyRead(ast,context){this.visit(ast.receiver,context)}visitSafeKeyedRead(ast,context){this.visit(ast.receiver,context);this.visit(ast.key,context)}visitCall(ast,context){this.visit(ast.receiver,context);this.visitAll(ast.args,context)}visitSafeCall(ast,context){this.visit(ast.receiver,context);this.visitAll(ast.args,context)}visitAll(asts,context){for(const ast of asts){this.visit(ast,context)}}}class AstTransformer{visitImplicitReceiver(ast,context){return ast}visitThisReceiver(ast,context){return ast}visitInterpolation(ast,context){return new Interpolation$1(ast.span,ast.sourceSpan,ast.strings,this.visitAll(ast.expressions))}visitLiteralPrimitive(ast,context){return new LiteralPrimitive(ast.span,ast.sourceSpan,ast.value)}visitPropertyRead(ast,context){return new PropertyRead(ast.span,ast.sourceSpan,ast.nameSpan,ast.receiver.visit(this),ast.name)}visitPropertyWrite(ast,context){return new PropertyWrite(ast.span,ast.sourceSpan,ast.nameSpan,ast.receiver.visit(this),ast.name,ast.value.visit(this))}visitSafePropertyRead(ast,context){return new SafePropertyRead(ast.span,ast.sourceSpan,ast.nameSpan,ast.receiver.visit(this),ast.name)}visitLiteralArray(ast,context){return new LiteralArray(ast.span,ast.sourceSpan,this.visitAll(ast.expressions))}visitLiteralMap(ast,context){return new LiteralMap(ast.span,ast.sourceSpan,ast.keys,this.visitAll(ast.values))}visitUnary(ast,context){switch(ast.operator){case"+":return Unary.createPlus(ast.span,ast.sourceSpan,ast.expr.visit(this));case"-":return Unary.createMinus(ast.span,ast.sourceSpan,ast.expr.visit(this));default:throw new Error(`Unknown unary operator ${ast.operator}`)}}visitBinary(ast,context){return new Binary(ast.span,ast.sourceSpan,ast.operation,ast.left.visit(this),ast.right.visit(this))}visitPrefixNot(ast,context){return new PrefixNot(ast.span,ast.sourceSpan,ast.expression.visit(this))}visitNonNullAssert(ast,context){return new NonNullAssert(ast.span,ast.sourceSpan,ast.expression.visit(this))}visitConditional(ast,context){return new Conditional(ast.span,ast.sourceSpan,ast.condition.visit(this),ast.trueExp.visit(this),ast.falseExp.visit(this))}visitPipe(ast,context){return new BindingPipe(ast.span,ast.sourceSpan,ast.exp.visit(this),ast.name,this.visitAll(ast.args),ast.nameSpan)}visitKeyedRead(ast,context){return new KeyedRead(ast.span,ast.sourceSpan,ast.receiver.visit(this),ast.key.visit(this))}visitKeyedWrite(ast,context){return new KeyedWrite(ast.span,ast.sourceSpan,ast.receiver.visit(this),ast.key.visit(this),ast.value.visit(this))}visitCall(ast,context){return new Call(ast.span,ast.sourceSpan,ast.receiver.visit(this),this.visitAll(ast.args),ast.argumentSpan)}visitSafeCall(ast,context){return new SafeCall(ast.span,ast.sourceSpan,ast.receiver.visit(this),this.visitAll(ast.args),ast.argumentSpan)}visitAll(asts){const res=[];for(let i=0;i<asts.length;++i){res[i]=asts[i].visit(this)}return res}visitChain(ast,context){return new Chain(ast.span,ast.sourceSpan,this.visitAll(ast.expressions))}visitSafeKeyedRead(ast,context){return new SafeKeyedRead(ast.span,ast.sourceSpan,ast.receiver.visit(this),ast.key.visit(this))}}class AstMemoryEfficientTransformer{visitImplicitReceiver(ast,context){return ast}visitThisReceiver(ast,context){return ast}visitInterpolation(ast,context){const expressions=this.visitAll(ast.expressions);if(expressions!==ast.expressions)return new Interpolation$1(ast.span,ast.sourceSpan,ast.strings,expressions);return ast}visitLiteralPrimitive(ast,context){return ast}visitPropertyRead(ast,context){const receiver=ast.receiver.visit(this);if(receiver!==ast.receiver){return new PropertyRead(ast.span,ast.sourceSpan,ast.nameSpan,receiver,ast.name)}return ast}visitPropertyWrite(ast,context){const receiver=ast.receiver.visit(this);const value=ast.value.visit(this);if(receiver!==ast.receiver||value!==ast.value){return new PropertyWrite(ast.span,ast.sourceSpan,ast.nameSpan,receiver,ast.name,value)}return ast}visitSafePropertyRead(ast,context){const receiver=ast.receiver.visit(this);if(receiver!==ast.receiver){return new SafePropertyRead(ast.span,ast.sourceSpan,ast.nameSpan,receiver,ast.name)}return ast}visitLiteralArray(ast,context){const expressions=this.visitAll(ast.expressions);if(expressions!==ast.expressions){return new LiteralArray(ast.span,ast.sourceSpan,expressions)}return ast}visitLiteralMap(ast,context){const values=this.visitAll(ast.values);if(values!==ast.values){return new LiteralMap(ast.span,ast.sourceSpan,ast.keys,values)}return ast}visitUnary(ast,context){const expr=ast.expr.visit(this);if(expr!==ast.expr){switch(ast.operator){case"+":return Unary.createPlus(ast.span,ast.sourceSpan,expr);case"-":return Unary.createMinus(ast.span,ast.sourceSpan,expr);default:throw new Error(`Unknown unary operator ${ast.operator}`)}}return ast}visitBinary(ast,context){const left=ast.left.visit(this);const right=ast.right.visit(this);if(left!==ast.left||right!==ast.right){return new Binary(ast.span,ast.sourceSpan,ast.operation,left,right)}return ast}visitPrefixNot(ast,context){const expression=ast.expression.visit(this);if(expression!==ast.expression){return new PrefixNot(ast.span,ast.sourceSpan,expression)}return ast}visitNonNullAssert(ast,context){const expression=ast.expression.visit(this);if(expression!==ast.expression){return new NonNullAssert(ast.span,ast.sourceSpan,expression)}return ast}visitConditional(ast,context){const condition=ast.condition.visit(this);const trueExp=ast.trueExp.visit(this);const falseExp=ast.falseExp.visit(this);if(condition!==ast.condition||trueExp!==ast.trueExp||falseExp!==ast.falseExp){return new Conditional(ast.span,ast.sourceSpan,condition,trueExp,falseExp)}return ast}visitPipe(ast,context){const exp=ast.exp.visit(this);const args=this.visitAll(ast.args);if(exp!==ast.exp||args!==ast.args){return new BindingPipe(ast.span,ast.sourceSpan,exp,ast.name,args,ast.nameSpan)}return ast}visitKeyedRead(ast,context){const obj=ast.receiver.visit(this);const key=ast.key.visit(this);if(obj!==ast.receiver||key!==ast.key){return new KeyedRead(ast.span,ast.sourceSpan,obj,key)}return ast}visitKeyedWrite(ast,context){const obj=ast.receiver.visit(this);const key=ast.key.visit(this);const value=ast.value.visit(this);if(obj!==ast.receiver||key!==ast.key||value!==ast.value){return new KeyedWrite(ast.span,ast.sourceSpan,obj,key,value)}return ast}visitAll(asts){const res=[];let modified=false;for(let i=0;i<asts.length;++i){const original=asts[i];const value=original.visit(this);res[i]=value;modified=modified||value!==original}return modified?res:asts}visitChain(ast,context){const expressions=this.visitAll(ast.expressions);if(expressions!==ast.expressions){return new Chain(ast.span,ast.sourceSpan,expressions)}return ast}visitCall(ast,context){const receiver=ast.receiver.visit(this);const args=this.visitAll(ast.args);if(receiver!==ast.receiver||args!==ast.args){return new Call(ast.span,ast.sourceSpan,receiver,args,ast.argumentSpan)}return ast}visitSafeCall(ast,context){const receiver=ast.receiver.visit(this);const args=this.visitAll(ast.args);if(receiver!==ast.receiver||args!==ast.args){return new SafeCall(ast.span,ast.sourceSpan,receiver,args,ast.argumentSpan)}return ast}visitSafeKeyedRead(ast,context){const obj=ast.receiver.visit(this);const key=ast.key.visit(this);if(obj!==ast.receiver||key!==ast.key){return new SafeKeyedRead(ast.span,ast.sourceSpan,obj,key)}return ast}}class ParsedProperty{constructor(name,expression,type,sourceSpan,keySpan,valueSpan){this.name=name;this.expression=expression;this.type=type;this.sourceSpan=sourceSpan;this.keySpan=keySpan;this.valueSpan=valueSpan;this.isLiteral=this.type===exports.ParsedPropertyType.LITERAL_ATTR;this.isAnimation=this.type===exports.ParsedPropertyType.ANIMATION}}exports.ParsedPropertyType=void 0;(function(ParsedPropertyType){ParsedPropertyType[ParsedPropertyType["DEFAULT"]=0]="DEFAULT";ParsedPropertyType[ParsedPropertyType["LITERAL_ATTR"]=1]="LITERAL_ATTR";ParsedPropertyType[ParsedPropertyType["ANIMATION"]=2]="ANIMATION";ParsedPropertyType[ParsedPropertyType["TWO_WAY"]=3]="TWO_WAY"})(exports.ParsedPropertyType||(exports.ParsedPropertyType={}));class ParsedEvent{constructor(name,targetOrPhase,type,handler,sourceSpan,handlerSpan,keySpan){this.name=name;this.targetOrPhase=targetOrPhase;this.type=type;this.handler=handler;this.sourceSpan=sourceSpan;this.handlerSpan=handlerSpan;this.keySpan=keySpan}}class ParsedVariable{constructor(name,value,sourceSpan,keySpan,valueSpan){this.name=name;this.value=value;this.sourceSpan=sourceSpan;this.keySpan=keySpan;this.valueSpan=valueSpan}}class BoundElementProperty{constructor(name,type,securityContext,value,unit,sourceSpan,keySpan,valueSpan){this.name=name;this.type=type;this.securityContext=securityContext;this.value=value;this.unit=unit;this.sourceSpan=sourceSpan;this.keySpan=keySpan;this.valueSpan=valueSpan}}class EventHandlerVars{static{this.event=variable("$event")}}function convertActionBinding(localResolver,implicitReceiver,action,bindingId,baseSourceSpan,implicitReceiverAccesses,globals){localResolver??=new DefaultLocalResolver(globals);const visitor=new _AstToIrVisitor(localResolver,implicitReceiver,bindingId,false,baseSourceSpan,implicitReceiverAccesses);const actionStmts=[];flattenStatements(convertActionBuiltins(action).visit(visitor,_Mode.Statement),actionStmts);prependTemporaryDecls(visitor.temporaryCount,bindingId,actionStmts);if(visitor.usesImplicitReceiver){localResolver.notifyImplicitReceiverUse()}const lastIndex=actionStmts.length-1;if(lastIndex>=0){const lastStatement=actionStmts[lastIndex];if(lastStatement instanceof ExpressionStatement){actionStmts[lastIndex]=new ReturnStatement(lastStatement.expr)}}return actionStmts}function convertAssignmentActionBinding(localResolver,implicitReceiver,action,bindingId,baseSourceSpan,implicitReceiverAccesses,globals){localResolver??=new DefaultLocalResolver(globals);const visitor=new _AstToIrVisitor(localResolver,implicitReceiver,bindingId,false,baseSourceSpan,implicitReceiverAccesses);let convertedAction=convertActionBuiltins(action).visit(visitor,_Mode.Statement);if(!(convertedAction instanceof ExpressionStatement)){throw new Error(`Illegal state: unsupported expression in two-way action binding.`)}convertedAction=wrapAssignmentAction(convertedAction.expr).toStmt();const actionStmts=[];flattenStatements(convertedAction,actionStmts);prependTemporaryDecls(visitor.temporaryCount,bindingId,actionStmts);actionStmts.push(new ReturnStatement(EventHandlerVars.event));implicitReceiverAccesses?.add(EventHandlerVars.event.name);if(visitor.usesImplicitReceiver){localResolver.notifyImplicitReceiverUse()}return actionStmts}function wrapAssignmentReadExpression(ast){return new ExternalExpr(Identifiers.twoWayBindingSet).callFn([ast,EventHandlerVars.event]).or(ast.set(EventHandlerVars.event))}function isReadExpression$1(value){return value instanceof ReadPropExpr||value instanceof ReadKeyExpr}function wrapAssignmentAction(ast){if(isReadExpression$1(ast)){return wrapAssignmentReadExpression(ast)}if(ast instanceof BinaryOperatorExpr&&isReadExpression$1(ast.rhs)){return new BinaryOperatorExpr(ast.operator,ast.lhs,wrapAssignmentReadExpression(ast.rhs))}if(ast instanceof ConditionalExpr&&isReadExpression$1(ast.falseCase)){return new ConditionalExpr(ast.condition,ast.trueCase,wrapAssignmentReadExpression(ast.falseCase))}if(ast instanceof NotExpr){let expr=ast.condition;while(true){if(expr instanceof NotExpr){expr=expr.condition}else{if(isReadExpression$1(expr)){return wrapAssignmentReadExpression(expr)}break}}}throw new Error(`Illegal state: unsupported expression in two-way action binding.`)}function convertPropertyBindingBuiltins(converterFactory,ast){return convertBuiltins(converterFactory,ast)}class ConvertPropertyBindingResult{constructor(stmts,currValExpr){this.stmts=stmts;this.currValExpr=currValExpr}}function convertPropertyBinding(localResolver,implicitReceiver,expressionWithoutBuiltins,bindingId){if(!localResolver){localResolver=new DefaultLocalResolver}const visitor=new _AstToIrVisitor(localResolver,implicitReceiver,bindingId,false);const outputExpr=expressionWithoutBuiltins.visit(visitor,_Mode.Expression);const stmts=getStatementsFromVisitor(visitor,bindingId);if(visitor.usesImplicitReceiver){localResolver.notifyImplicitReceiverUse()}return new ConvertPropertyBindingResult(stmts,outputExpr)}function convertPureComponentScopeFunction(ast,localResolver,implicitReceiver,bindingId){const converted=convertPropertyBindingBuiltins({createLiteralArrayConverter:()=>args=>literalArr(args),createLiteralMapConverter:keys=>values=>literalMap(keys.map(((key,index)=>({key:key.key,value:values[index],quoted:key.quoted})))),createPipeConverter:()=>{throw new Error("Illegal State: Pipes are not allowed in this context")}},ast);const visitor=new _AstToIrVisitor(localResolver,implicitReceiver,bindingId,false);const statements=[];flattenStatements(converted.visit(visitor,_Mode.Statement),statements);return statements}function convertUpdateArguments(localResolver,contextVariableExpression,expressionWithArgumentsToExtract,bindingId){const visitor=new _AstToIrVisitor(localResolver,contextVariableExpression,bindingId,true);const outputExpr=visitor.visitInterpolation(expressionWithArgumentsToExtract,_Mode.Expression);if(visitor.usesImplicitReceiver){localResolver.notifyImplicitReceiverUse()}const stmts=getStatementsFromVisitor(visitor,bindingId);const args=outputExpr.args;return{stmts:stmts,args:args}}function getStatementsFromVisitor(visitor,bindingId){const stmts=[];for(let i=0;i<visitor.temporaryCount;i++){stmts.push(temporaryDeclaration(bindingId,i))}return stmts}function convertBuiltins(converterFactory,ast){const visitor=new _BuiltinAstConverter(converterFactory);return ast.visit(visitor)}function convertActionBuiltins(action){const converterFactory={createLiteralArrayConverter:()=>args=>literalArr(args),createLiteralMapConverter:keys=>values=>{const entries=keys.map(((k,i)=>({key:k.key,value:values[i],quoted:k.quoted})));return literalMap(entries)},createPipeConverter:name=>{throw new Error(`Illegal State: Actions are not allowed to contain pipes. Pipe: ${name}`)}};return convertPropertyBindingBuiltins(converterFactory,action)}function temporaryName(bindingId,temporaryNumber){return`tmp_${bindingId}_${temporaryNumber}`}function temporaryDeclaration(bindingId,temporaryNumber){return new DeclareVarStmt(temporaryName(bindingId,temporaryNumber))}function prependTemporaryDecls(temporaryCount,bindingId,statements){for(let i=temporaryCount-1;i>=0;i--){statements.unshift(temporaryDeclaration(bindingId,i))}}var _Mode;(function(_Mode){_Mode[_Mode["Statement"]=0]="Statement";_Mode[_Mode["Expression"]=1]="Expression"})(_Mode||(_Mode={}));function ensureStatementMode(mode,ast){if(mode!==_Mode.Statement){throw new Error(`Expected a statement, but saw ${ast}`)}}function ensureExpressionMode(mode,ast){if(mode!==_Mode.Expression){throw new Error(`Expected an expression, but saw ${ast}`)}}function convertToStatementIfNeeded(mode,expr){if(mode===_Mode.Statement){return expr.toStmt()}else{return expr}}class _BuiltinAstConverter extends AstTransformer{constructor(_converterFactory){super();this._converterFactory=_converterFactory}visitPipe(ast,context){const args=[ast.exp,...ast.args].map((ast=>ast.visit(this,context)));return new BuiltinFunctionCall(ast.span,ast.sourceSpan,args,this._converterFactory.createPipeConverter(ast.name,args.length))}visitLiteralArray(ast,context){const args=ast.expressions.map((ast=>ast.visit(this,context)));return new BuiltinFunctionCall(ast.span,ast.sourceSpan,args,this._converterFactory.createLiteralArrayConverter(ast.expressions.length))}visitLiteralMap(ast,context){const args=ast.values.map((ast=>ast.visit(this,context)));return new BuiltinFunctionCall(ast.span,ast.sourceSpan,args,this._converterFactory.createLiteralMapConverter(ast.keys))}}class _AstToIrVisitor{constructor(_localResolver,_implicitReceiver,bindingId,supportsInterpolation,baseSourceSpan,implicitReceiverAccesses){this._localResolver=_localResolver;this._implicitReceiver=_implicitReceiver;this.bindingId=bindingId;this.supportsInterpolation=supportsInterpolation;this.baseSourceSpan=baseSourceSpan;this.implicitReceiverAccesses=implicitReceiverAccesses;this._nodeMap=new Map;this._resultMap=new Map;this._currentTemporary=0;this.temporaryCount=0;this.usesImplicitReceiver=false}visitUnary(ast,mode){let op;switch(ast.operator){case"+":op=exports.UnaryOperator.Plus;break;case"-":op=exports.UnaryOperator.Minus;break;default:throw new Error(`Unsupported operator ${ast.operator}`)}return convertToStatementIfNeeded(mode,new UnaryOperatorExpr(op,this._visit(ast.expr,_Mode.Expression),undefined,this.convertSourceSpan(ast.span)))}visitBinary(ast,mode){let op;switch(ast.operation){case"+":op=exports.BinaryOperator.Plus;break;case"-":op=exports.BinaryOperator.Minus;break;case"*":op=exports.BinaryOperator.Multiply;break;case"/":op=exports.BinaryOperator.Divide;break;case"%":op=exports.BinaryOperator.Modulo;break;case"&&":op=exports.BinaryOperator.And;break;case"||":op=exports.BinaryOperator.Or;break;case"==":op=exports.BinaryOperator.Equals;break;case"!=":op=exports.BinaryOperator.NotEquals;break;case"===":op=exports.BinaryOperator.Identical;break;case"!==":op=exports.BinaryOperator.NotIdentical;break;case"<":op=exports.BinaryOperator.Lower;break;case">":op=exports.BinaryOperator.Bigger;break;case"<=":op=exports.BinaryOperator.LowerEquals;break;case">=":op=exports.BinaryOperator.BiggerEquals;break;case"??":return this.convertNullishCoalesce(ast,mode);default:throw new Error(`Unsupported operation ${ast.operation}`)}return convertToStatementIfNeeded(mode,new BinaryOperatorExpr(op,this._visit(ast.left,_Mode.Expression),this._visit(ast.right,_Mode.Expression),undefined,this.convertSourceSpan(ast.span)))}visitChain(ast,mode){ensureStatementMode(mode,ast);return this.visitAll(ast.expressions,mode)}visitConditional(ast,mode){const value=this._visit(ast.condition,_Mode.Expression);return convertToStatementIfNeeded(mode,value.conditional(this._visit(ast.trueExp,_Mode.Expression),this._visit(ast.falseExp,_Mode.Expression),this.convertSourceSpan(ast.span)))}visitPipe(ast,mode){throw new Error(`Illegal state: Pipes should have been converted into functions. Pipe: ${ast.name}`)}visitImplicitReceiver(ast,mode){ensureExpressionMode(mode,ast);this.usesImplicitReceiver=true;return this._implicitReceiver}visitThisReceiver(ast,mode){return this.visitImplicitReceiver(ast,mode)}visitInterpolation(ast,mode){if(!this.supportsInterpolation){throw new Error("Unexpected interpolation")}ensureExpressionMode(mode,ast);let args=[];for(let i=0;i<ast.strings.length-1;i++){args.push(literal(ast.strings[i]));args.push(this._visit(ast.expressions[i],_Mode.Expression))}args.push(literal(ast.strings[ast.strings.length-1]));const strings=ast.strings;if(strings.length===2&&strings[0]===""&&strings[1]===""){args=[args[1]]}else if(ast.expressions.length>=9){args=[literalArr(args)]}return new InterpolationExpression(args)}visitKeyedRead(ast,mode){const leftMostSafe=this.leftMostSafeNode(ast);if(leftMostSafe){return this.convertSafeAccess(ast,leftMostSafe,mode)}else{return convertToStatementIfNeeded(mode,this._visit(ast.receiver,_Mode.Expression).key(this._visit(ast.key,_Mode.Expression)))}}visitKeyedWrite(ast,mode){const obj=this._visit(ast.receiver,_Mode.Expression);const key=this._visit(ast.key,_Mode.Expression);const value=this._visit(ast.value,_Mode.Expression);if(obj===this._implicitReceiver){this._localResolver.maybeRestoreView()}return convertToStatementIfNeeded(mode,obj.key(key).set(value))}visitLiteralArray(ast,mode){throw new Error(`Illegal State: literal arrays should have been converted into functions`)}visitLiteralMap(ast,mode){throw new Error(`Illegal State: literal maps should have been converted into functions`)}visitLiteralPrimitive(ast,mode){const type=ast.value===null||ast.value===undefined||ast.value===true||ast.value===true?INFERRED_TYPE:undefined;return convertToStatementIfNeeded(mode,literal(ast.value,type,this.convertSourceSpan(ast.span)))}_getLocal(name,receiver){if(this._localResolver.globals?.has(name)&&receiver instanceof ThisReceiver){return null}return this._localResolver.getLocal(name)}visitPrefixNot(ast,mode){return convertToStatementIfNeeded(mode,not(this._visit(ast.expression,_Mode.Expression)))}visitNonNullAssert(ast,mode){return convertToStatementIfNeeded(mode,this._visit(ast.expression,_Mode.Expression))}visitPropertyRead(ast,mode){const leftMostSafe=this.leftMostSafeNode(ast);if(leftMostSafe){return this.convertSafeAccess(ast,leftMostSafe,mode)}else{let result=null;const prevUsesImplicitReceiver=this.usesImplicitReceiver;const receiver=this._visit(ast.receiver,_Mode.Expression);if(receiver===this._implicitReceiver){result=this._getLocal(ast.name,ast.receiver);if(result){this.usesImplicitReceiver=prevUsesImplicitReceiver;this.addImplicitReceiverAccess(ast.name)}}if(result==null){result=receiver.prop(ast.name,this.convertSourceSpan(ast.span))}return convertToStatementIfNeeded(mode,result)}}visitPropertyWrite(ast,mode){const receiver=this._visit(ast.receiver,_Mode.Expression);const prevUsesImplicitReceiver=this.usesImplicitReceiver;let varExpr=null;if(receiver===this._implicitReceiver){const localExpr=this._getLocal(ast.name,ast.receiver);if(localExpr){if(localExpr instanceof ReadPropExpr){varExpr=localExpr;this.usesImplicitReceiver=prevUsesImplicitReceiver;this.addImplicitReceiverAccess(ast.name)}else{const receiver=ast.name;const value=ast.value instanceof PropertyRead?ast.value.name:undefined;throw new Error(`Cannot assign value "${value}" to template variable "${receiver}". Template variables are read-only.`)}}}if(varExpr===null){varExpr=receiver.prop(ast.name,this.convertSourceSpan(ast.span))}return convertToStatementIfNeeded(mode,varExpr.set(this._visit(ast.value,_Mode.Expression)))}visitSafePropertyRead(ast,mode){return this.convertSafeAccess(ast,this.leftMostSafeNode(ast),mode)}visitSafeKeyedRead(ast,mode){return this.convertSafeAccess(ast,this.leftMostSafeNode(ast),mode)}visitAll(asts,mode){return asts.map((ast=>this._visit(ast,mode)))}visitCall(ast,mode){const leftMostSafe=this.leftMostSafeNode(ast);if(leftMostSafe){return this.convertSafeAccess(ast,leftMostSafe,mode)}const convertedArgs=this.visitAll(ast.args,_Mode.Expression);if(ast instanceof BuiltinFunctionCall){return convertToStatementIfNeeded(mode,ast.converter(convertedArgs))}const receiver=ast.receiver;if(receiver instanceof PropertyRead&&receiver.receiver instanceof ImplicitReceiver&&!(receiver.receiver instanceof ThisReceiver)&&receiver.name==="$any"){if(convertedArgs.length!==1){throw new Error(`Invalid call to $any, expected 1 argument but received ${convertedArgs.length||"none"}`)}return convertToStatementIfNeeded(mode,convertedArgs[0])}const call=this._visit(receiver,_Mode.Expression).callFn(convertedArgs,this.convertSourceSpan(ast.span));return convertToStatementIfNeeded(mode,call)}visitSafeCall(ast,mode){return this.convertSafeAccess(ast,this.leftMostSafeNode(ast),mode)}_visit(ast,mode){const result=this._resultMap.get(ast);if(result)return result;return(this._nodeMap.get(ast)||ast).visit(this,mode)}convertSafeAccess(ast,leftMostSafe,mode){let guardedExpression=this._visit(leftMostSafe.receiver,_Mode.Expression);let temporary=undefined;if(this.needsTemporaryInSafeAccess(leftMostSafe.receiver)){temporary=this.allocateTemporary();guardedExpression=temporary.set(guardedExpression);this._resultMap.set(leftMostSafe.receiver,temporary)}const condition=guardedExpression.isBlank();if(leftMostSafe instanceof SafeCall){this._nodeMap.set(leftMostSafe,new Call(leftMostSafe.span,leftMostSafe.sourceSpan,leftMostSafe.receiver,leftMostSafe.args,leftMostSafe.argumentSpan))}else if(leftMostSafe instanceof SafeKeyedRead){this._nodeMap.set(leftMostSafe,new KeyedRead(leftMostSafe.span,leftMostSafe.sourceSpan,leftMostSafe.receiver,leftMostSafe.key))}else{this._nodeMap.set(leftMostSafe,new PropertyRead(leftMostSafe.span,leftMostSafe.sourceSpan,leftMostSafe.nameSpan,leftMostSafe.receiver,leftMostSafe.name))}const access=this._visit(ast,_Mode.Expression);this._nodeMap.delete(leftMostSafe);if(temporary){this.releaseTemporary(temporary)}return convertToStatementIfNeeded(mode,condition.conditional(NULL_EXPR,access))}convertNullishCoalesce(ast,mode){const left=this._visit(ast.left,_Mode.Expression);const right=this._visit(ast.right,_Mode.Expression);const temporary=this.allocateTemporary();this.releaseTemporary(temporary);return convertToStatementIfNeeded(mode,temporary.set(left).notIdentical(NULL_EXPR).and(temporary.notIdentical(literal(undefined))).conditional(temporary,right))}leftMostSafeNode(ast){const visit=(visitor,ast)=>(this._nodeMap.get(ast)||ast).visit(visitor);return ast.visit({visitUnary(ast){return null},visitBinary(ast){return null},visitChain(ast){return null},visitConditional(ast){return null},visitCall(ast){return visit(this,ast.receiver)},visitSafeCall(ast){return visit(this,ast.receiver)||ast},visitImplicitReceiver(ast){return null},visitThisReceiver(ast){return null},visitInterpolation(ast){return null},visitKeyedRead(ast){return visit(this,ast.receiver)},visitKeyedWrite(ast){return null},visitLiteralArray(ast){return null},visitLiteralMap(ast){return null},visitLiteralPrimitive(ast){return null},visitPipe(ast){return null},visitPrefixNot(ast){return null},visitNonNullAssert(ast){return visit(this,ast.expression)},visitPropertyRead(ast){return visit(this,ast.receiver)},visitPropertyWrite(ast){return null},visitSafePropertyRead(ast){return visit(this,ast.receiver)||ast},visitSafeKeyedRead(ast){return visit(this,ast.receiver)||ast}})}needsTemporaryInSafeAccess(ast){const visit=(visitor,ast)=>ast&&(this._nodeMap.get(ast)||ast).visit(visitor);const visitSome=(visitor,ast)=>ast.some((ast=>visit(visitor,ast)));return ast.visit({visitUnary(ast){return visit(this,ast.expr)},visitBinary(ast){return visit(this,ast.left)||visit(this,ast.right)},visitChain(ast){return false},visitConditional(ast){return visit(this,ast.condition)||visit(this,ast.trueExp)||visit(this,ast.falseExp)},visitCall(ast){return true},visitSafeCall(ast){return true},visitImplicitReceiver(ast){return false},visitThisReceiver(ast){return false},visitInterpolation(ast){return visitSome(this,ast.expressions)},visitKeyedRead(ast){return false},visitKeyedWrite(ast){return false},visitLiteralArray(ast){return true},visitLiteralMap(ast){return true},visitLiteralPrimitive(ast){return false},visitPipe(ast){return true},visitPrefixNot(ast){return visit(this,ast.expression)},visitNonNullAssert(ast){return visit(this,ast.expression)},visitPropertyRead(ast){return false},visitPropertyWrite(ast){return false},visitSafePropertyRead(ast){return false},visitSafeKeyedRead(ast){return false}})}allocateTemporary(){const tempNumber=this._currentTemporary++;this.temporaryCount=Math.max(this._currentTemporary,this.temporaryCount);return new ReadVarExpr(temporaryName(this.bindingId,tempNumber))}releaseTemporary(temporary){this._currentTemporary--;if(temporary.name!=temporaryName(this.bindingId,this._currentTemporary)){throw new Error(`Temporary ${temporary.name} released out of order`)}}convertSourceSpan(span){if(this.baseSourceSpan){const start=this.baseSourceSpan.start.moveBy(span.start);const end=this.baseSourceSpan.start.moveBy(span.end);const fullStart=this.baseSourceSpan.fullStart.moveBy(span.start);return new ParseSourceSpan(start,end,fullStart)}else{return null}}addImplicitReceiverAccess(name){if(this.implicitReceiverAccesses){this.implicitReceiverAccesses.add(name)}}}function flattenStatements(arg,output){if(Array.isArray(arg)){arg.forEach((entry=>flattenStatements(entry,output)))}else{output.push(arg)}}function unsupported(){throw new Error("Unsupported operation")}class InterpolationExpression extends Expression{constructor(args){super(null,null);this.args=args;this.isConstant=unsupported;this.isEquivalent=unsupported;this.visitExpression=unsupported;this.clone=unsupported}}class DefaultLocalResolver{constructor(globals){this.globals=globals}notifyImplicitReceiverUse(){}maybeRestoreView(){}getLocal(name){if(name===EventHandlerVars.event.name){return EventHandlerVars.event}return null}}class BuiltinFunctionCall extends Call{constructor(span,sourceSpan,args,converter){super(span,sourceSpan,new EmptyExpr$1(span,sourceSpan),args,null);this.converter=converter}}let _SECURITY_SCHEMA;function SECURITY_SCHEMA(){if(!_SECURITY_SCHEMA){_SECURITY_SCHEMA={};registerContext(SecurityContext.HTML,["iframe|srcdoc","*|innerHTML","*|outerHTML"]);registerContext(SecurityContext.STYLE,["*|style"]);registerContext(SecurityContext.URL,["*|formAction","area|href","area|ping","audio|src","a|href","a|ping","blockquote|cite","body|background","del|cite","form|action","img|src","input|src","ins|cite","q|cite","source|src","track|src","video|poster","video|src"]);registerContext(SecurityContext.RESOURCE_URL,["applet|code","applet|codebase","base|href","embed|src","frame|src","head|profile","html|manifest","iframe|src","link|href","media|src","object|codebase","object|data","script|src"])}return _SECURITY_SCHEMA}function registerContext(ctx,specs){for(const spec of specs)_SECURITY_SCHEMA[spec.toLowerCase()]=ctx}const IFRAME_SECURITY_SENSITIVE_ATTRS=new Set(["sandbox","allow","allowfullscreen","referrerpolicy","csp","fetchpriority"]);function isIframeSecuritySensitiveAttr(attrName){return IFRAME_SECURITY_SENSITIVE_ATTRS.has(attrName.toLowerCase())}const animationKeywords=new Set(["inherit","initial","revert","unset","alternate","alternate-reverse","normal","reverse","backwards","both","forwards","none","paused","running","ease","ease-in","ease-in-out","ease-out","linear","step-start","step-end","end","jump-both","jump-end","jump-none","jump-start","start"]);const scopedAtRuleIdentifiers=["@media","@supports","@document","@layer","@container","@scope","@starting-style"];class ShadowCss{constructor(){this._animationDeclarationKeyframesRe=/(^|\s+)(?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))(?=[,\s]|$)/g}shimCssText(cssText,selector,hostSelector=""){const comments=[];cssText=cssText.replace(_commentRe,(m=>{if(m.match(_commentWithHashRe)){comments.push(m)}else{const newLinesMatches=m.match(_newLinesRe);comments.push((newLinesMatches?.join("")??"")+"\n")}return COMMENT_PLACEHOLDER}));cssText=this._insertDirectives(cssText);const scopedCssText=this._scopeCssText(cssText,selector,hostSelector);let commentIdx=0;return scopedCssText.replace(_commentWithHashPlaceHolderRe,(()=>comments[commentIdx++]))}_insertDirectives(cssText){cssText=this._insertPolyfillDirectivesInCssText(cssText);return this._insertPolyfillRulesInCssText(cssText)}_scopeKeyframesRelatedCss(cssText,scopeSelector){const unscopedKeyframesSet=new Set;const scopedKeyframesCssText=processRules(cssText,(rule=>this._scopeLocalKeyframeDeclarations(rule,scopeSelector,unscopedKeyframesSet)));return processRules(scopedKeyframesCssText,(rule=>this._scopeAnimationRule(rule,scopeSelector,unscopedKeyframesSet)))}_scopeLocalKeyframeDeclarations(rule,scopeSelector,unscopedKeyframesSet){return{...rule,selector:rule.selector.replace(/(^@(?:-webkit-)?keyframes(?:\s+))(['"]?)(.+)\2(\s*)$/,((_,start,quote,keyframeName,endSpaces)=>{unscopedKeyframesSet.add(unescapeQuotes(keyframeName,quote));return`${start}${quote}${scopeSelector}_${keyframeName}${quote}${endSpaces}`}))}}_scopeAnimationKeyframe(keyframe,scopeSelector,unscopedKeyframesSet){return keyframe.replace(/^(\s*)(['"]?)(.+?)\2(\s*)$/,((_,spaces1,quote,name,spaces2)=>{name=`${unscopedKeyframesSet.has(unescapeQuotes(name,quote))?scopeSelector+"_":""}${name}`;return`${spaces1}${quote}${name}${quote}${spaces2}`}))}_scopeAnimationRule(rule,scopeSelector,unscopedKeyframesSet){let content=rule.content.replace(/((?:^|\s+|;)(?:-webkit-)?animation(?:\s*):(?:\s*))([^;]+)/g,((_,start,animationDeclarations)=>start+animationDeclarations.replace(this._animationDeclarationKeyframesRe,((original,leadingSpaces,quote="",quotedName,nonQuotedName)=>{if(quotedName){return`${leadingSpaces}${this._scopeAnimationKeyframe(`${quote}${quotedName}${quote}`,scopeSelector,unscopedKeyframesSet)}`}else{return animationKeywords.has(nonQuotedName)?original:`${leadingSpaces}${this._scopeAnimationKeyframe(nonQuotedName,scopeSelector,unscopedKeyframesSet)}`}}))));content=content.replace(/((?:^|\s+|;)(?:-webkit-)?animation-name(?:\s*):(?:\s*))([^;]+)/g,((_match,start,commaSeparatedKeyframes)=>`${start}${commaSeparatedKeyframes.split(",").map((keyframe=>this._scopeAnimationKeyframe(keyframe,scopeSelector,unscopedKeyframesSet))).join(",")}`));return{...rule,content:content}}_insertPolyfillDirectivesInCssText(cssText){return cssText.replace(_cssContentNextSelectorRe,(function(...m){return m[2]+"{"}))}_insertPolyfillRulesInCssText(cssText){return cssText.replace(_cssContentRuleRe,((...m)=>{const rule=m[0].replace(m[1],"").replace(m[2],"");return m[4]+rule}))}_scopeCssText(cssText,scopeSelector,hostSelector){const unscopedRules=this._extractUnscopedRulesFromCssText(cssText);cssText=this._insertPolyfillHostInCssText(cssText);cssText=this._convertColonHost(cssText);cssText=this._convertColonHostContext(cssText);cssText=this._convertShadowDOMSelectors(cssText);if(scopeSelector){cssText=this._scopeKeyframesRelatedCss(cssText,scopeSelector);cssText=this._scopeSelectors(cssText,scopeSelector,hostSelector)}cssText=cssText+"\n"+unscopedRules;return cssText.trim()}_extractUnscopedRulesFromCssText(cssText){let r="";let m;_cssContentUnscopedRuleRe.lastIndex=0;while((m=_cssContentUnscopedRuleRe.exec(cssText))!==null){const rule=m[0].replace(m[2],"").replace(m[1],m[4]);r+=rule+"\n\n"}return r}_convertColonHost(cssText){return cssText.replace(_cssColonHostRe,((_,hostSelectors,otherSelectors)=>{if(hostSelectors){const convertedSelectors=[];const hostSelectorArray=hostSelectors.split(",").map((p=>p.trim()));for(const hostSelector of hostSelectorArray){if(!hostSelector)break;const convertedSelector=_polyfillHostNoCombinator+hostSelector.replace(_polyfillHost,"")+otherSelectors;convertedSelectors.push(convertedSelector)}return convertedSelectors.join(",")}else{return _polyfillHostNoCombinator+otherSelectors}}))}_convertColonHostContext(cssText){return cssText.replace(_cssColonHostContextReGlobal,(selectorText=>{const contextSelectorGroups=[[]];let match;while(match=_cssColonHostContextRe.exec(selectorText)){const newContextSelectors=(match[1]??"").trim().split(",").map((m=>m.trim())).filter((m=>m!==""));const contextSelectorGroupsLength=contextSelectorGroups.length;repeatGroups(contextSelectorGroups,newContextSelectors.length);for(let i=0;i<newContextSelectors.length;i++){for(let j=0;j<contextSelectorGroupsLength;j++){contextSelectorGroups[j+i*contextSelectorGroupsLength].push(newContextSelectors[i])}}selectorText=match[2]}return contextSelectorGroups.map((contextSelectors=>combineHostContextSelectors(contextSelectors,selectorText))).join(", ")}))}_convertShadowDOMSelectors(cssText){return _shadowDOMSelectorsRe.reduce(((result,pattern)=>result.replace(pattern," ")),cssText)}_scopeSelectors(cssText,scopeSelector,hostSelector){return processRules(cssText,(rule=>{let selector=rule.selector;let content=rule.content;if(rule.selector[0]!=="@"){selector=this._scopeSelector(rule.selector,scopeSelector,hostSelector)}else if(scopedAtRuleIdentifiers.some((atRule=>rule.selector.startsWith(atRule)))){content=this._scopeSelectors(rule.content,scopeSelector,hostSelector)}else if(rule.selector.startsWith("@font-face")||rule.selector.startsWith("@page")){content=this._stripScopingSelectors(rule.content)}return new CssRule(selector,content)}))}_stripScopingSelectors(cssText){return processRules(cssText,(rule=>{const selector=rule.selector.replace(_shadowDeepSelectors," ").replace(_polyfillHostNoCombinatorRe," ");return new CssRule(selector,rule.content)}))}_scopeSelector(selector,scopeSelector,hostSelector){return selector.split(",").map((part=>part.trim().split(_shadowDeepSelectors))).map((deepParts=>{const[shallowPart,...otherParts]=deepParts;const applyScope=shallowPart=>{if(this._selectorNeedsScoping(shallowPart,scopeSelector)){return this._applySelectorScope(shallowPart,scopeSelector,hostSelector)}else{return shallowPart}};return[applyScope(shallowPart),...otherParts].join(" ")})).join(", ")}_selectorNeedsScoping(selector,scopeSelector){const re=this._makeScopeMatcher(scopeSelector);return!re.test(selector)}_makeScopeMatcher(scopeSelector){const lre=/\[/g;const rre=/\]/g;scopeSelector=scopeSelector.replace(lre,"\\[").replace(rre,"\\]");return new RegExp("^("+scopeSelector+")"+_selectorReSuffix,"m")}_applySimpleSelectorScope(selector,scopeSelector,hostSelector){_polyfillHostRe.lastIndex=0;if(_polyfillHostRe.test(selector)){const replaceBy=`[${hostSelector}]`;return selector.replace(_polyfillHostNoCombinatorRe,((hnc,selector)=>selector.replace(/([^:]*)(:*)(.*)/,((_,before,colon,after)=>before+replaceBy+colon+after)))).replace(_polyfillHostRe,replaceBy+" ")}return scopeSelector+" "+selector}_applySelectorScope(selector,scopeSelector,hostSelector){const isRe=/\[is=([^\]]*)\]/g;scopeSelector=scopeSelector.replace(isRe,((_,...parts)=>parts[0]));const attrName="["+scopeSelector+"]";const _scopeSelectorPart=p=>{let scopedP=p.trim();if(!scopedP){return""}if(p.indexOf(_polyfillHostNoCombinator)>-1){scopedP=this._applySimpleSelectorScope(p,scopeSelector,hostSelector)}else{const t=p.replace(_polyfillHostRe,"");if(t.length>0){const matches=t.match(/([^:]*)(:*)(.*)/);if(matches){scopedP=matches[1]+attrName+matches[2]+matches[3]}}}return scopedP};const safeContent=new SafeSelector(selector);selector=safeContent.content();let scopedSelector="";let startIndex=0;let res;const sep=/( |>|\+|~(?!=))\s*/g;const hasHost=selector.indexOf(_polyfillHostNoCombinator)>-1;let shouldScope=!hasHost;while((res=sep.exec(selector))!==null){const separator=res[1];const part=selector.slice(startIndex,res.index).trim();if(part.match(/__esc-ph-(\d+)__/)&&selector[res.index+1]?.match(/[a-fA-F\d]/)){continue}shouldScope=shouldScope||part.indexOf(_polyfillHostNoCombinator)>-1;const scopedPart=shouldScope?_scopeSelectorPart(part):part;scopedSelector+=`${scopedPart} ${separator} `;startIndex=sep.lastIndex}const part=selector.substring(startIndex);shouldScope=shouldScope||part.indexOf(_polyfillHostNoCombinator)>-1;scopedSelector+=shouldScope?_scopeSelectorPart(part):part;return safeContent.restore(scopedSelector)}_insertPolyfillHostInCssText(selector){return selector.replace(_colonHostContextRe,_polyfillHostContext).replace(_colonHostRe,_polyfillHost)}}class SafeSelector{constructor(selector){this.placeholders=[];this.index=0;selector=this._escapeRegexMatches(selector,/(\[[^\]]*\])/g);selector=selector.replace(/(\\.)/g,((_,keep)=>{const replaceBy=`__esc-ph-${this.index}__`;this.placeholders.push(keep);this.index++;return replaceBy}));this._content=selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g,((_,pseudo,exp)=>{const replaceBy=`__ph-${this.index}__`;this.placeholders.push(exp);this.index++;return pseudo+replaceBy}))}restore(content){return content.replace(/__(?:ph|esc-ph)-(\d+)__/g,((_ph,index)=>this.placeholders[+index]))}content(){return this._content}_escapeRegexMatches(content,pattern){return content.replace(pattern,((_,keep)=>{const replaceBy=`__ph-${this.index}__`;this.placeholders.push(keep);this.index++;return replaceBy}))}}const _cssContentNextSelectorRe=/polyfill-next-selector[^}]*content:[\s]*?(['"])(.*?)\1[;\s]*}([^{]*?){/gim;const _cssContentRuleRe=/(polyfill-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim;const _cssContentUnscopedRuleRe=/(polyfill-unscoped-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim;const _polyfillHost="-shadowcsshost";const _polyfillHostContext="-shadowcsscontext";const _parenSuffix="(?:\\(("+"(?:\\([^)(]*\\)|[^)(]*)+?"+")\\))?([^,{]*)";const _cssColonHostRe=new RegExp(_polyfillHost+_parenSuffix,"gim");const _cssColonHostContextReGlobal=new RegExp(_polyfillHostContext+_parenSuffix,"gim");const _cssColonHostContextRe=new RegExp(_polyfillHostContext+_parenSuffix,"im");const _polyfillHostNoCombinator=_polyfillHost+"-no-combinator";const _polyfillHostNoCombinatorRe=/-shadowcsshost-no-combinator([^\s]*)/;const _shadowDOMSelectorsRe=[/::shadow/g,/::content/g,/\/shadow-deep\//g,/\/shadow\//g];const _shadowDeepSelectors=/(?:>>>)|(?:\/deep\/)|(?:::ng-deep)/g;const _selectorReSuffix="([>\\s~+[.,{:][\\s\\S]*)?$";const _polyfillHostRe=/-shadowcsshost/gim;const _colonHostRe=/:host/gim;const _colonHostContextRe=/:host-context/gim;const _newLinesRe=/\r?\n/g;const _commentRe=/\/\*[\s\S]*?\*\//g;const _commentWithHashRe=/\/\*\s*#\s*source(Mapping)?URL=/g;const COMMENT_PLACEHOLDER="%COMMENT%";const _commentWithHashPlaceHolderRe=new RegExp(COMMENT_PLACEHOLDER,"g");const BLOCK_PLACEHOLDER="%BLOCK%";const _ruleRe=new RegExp(`(\\s*(?:${COMMENT_PLACEHOLDER}\\s*)*)([^;\\{\\}]+?)(\\s*)((?:{%BLOCK%}?\\s*;?)|(?:\\s*;))`,"g");const CONTENT_PAIRS=new Map([["{","}"]]);const COMMA_IN_PLACEHOLDER="%COMMA_IN_PLACEHOLDER%";const SEMI_IN_PLACEHOLDER="%SEMI_IN_PLACEHOLDER%";const COLON_IN_PLACEHOLDER="%COLON_IN_PLACEHOLDER%";const _cssCommaInPlaceholderReGlobal=new RegExp(COMMA_IN_PLACEHOLDER,"g");const _cssSemiInPlaceholderReGlobal=new RegExp(SEMI_IN_PLACEHOLDER,"g");const _cssColonInPlaceholderReGlobal=new RegExp(COLON_IN_PLACEHOLDER,"g");class CssRule{constructor(selector,content){this.selector=selector;this.content=content}}function processRules(input,ruleCallback){const escaped=escapeInStrings(input);const inputWithEscapedBlocks=escapeBlocks(escaped,CONTENT_PAIRS,BLOCK_PLACEHOLDER);let nextBlockIndex=0;const escapedResult=inputWithEscapedBlocks.escapedString.replace(_ruleRe,((...m)=>{const selector=m[2];let content="";let suffix=m[4];let contentPrefix="";if(suffix&&suffix.startsWith("{"+BLOCK_PLACEHOLDER)){content=inputWithEscapedBlocks.blocks[nextBlockIndex++];suffix=suffix.substring(BLOCK_PLACEHOLDER.length+1);contentPrefix="{"}const rule=ruleCallback(new CssRule(selector,content));return`${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`}));return unescapeInStrings(escapedResult)}class StringWithEscapedBlocks{constructor(escapedString,blocks){this.escapedString=escapedString;this.blocks=blocks}}function escapeBlocks(input,charPairs,placeholder){const resultParts=[];const escapedBlocks=[];let openCharCount=0;let nonBlockStartIndex=0;let blockStartIndex=-1;let openChar;let closeChar;for(let i=0;i<input.length;i++){const char=input[i];if(char==="\\"){i++}else if(char===closeChar){openCharCount--;if(openCharCount===0){escapedBlocks.push(input.substring(blockStartIndex,i));resultParts.push(placeholder);nonBlockStartIndex=i;blockStartIndex=-1;openChar=closeChar=undefined}}else if(char===openChar){openCharCount++}else if(openCharCount===0&&charPairs.has(char)){openChar=char;closeChar=charPairs.get(char);openCharCount=1;blockStartIndex=i+1;resultParts.push(input.substring(nonBlockStartIndex,blockStartIndex))}}if(blockStartIndex!==-1){escapedBlocks.push(input.substring(blockStartIndex));resultParts.push(placeholder)}else{resultParts.push(input.substring(nonBlockStartIndex))}return new StringWithEscapedBlocks(resultParts.join(""),escapedBlocks)}const ESCAPE_IN_STRING_MAP={";":SEMI_IN_PLACEHOLDER,",":COMMA_IN_PLACEHOLDER,":":COLON_IN_PLACEHOLDER};function escapeInStrings(input){let result=input;let currentQuoteChar=null;for(let i=0;i<result.length;i++){const char=result[i];if(char==="\\"){i++}else{if(currentQuoteChar!==null){if(char===currentQuoteChar){currentQuoteChar=null}else{const placeholder=ESCAPE_IN_STRING_MAP[char];if(placeholder){result=`${result.substr(0,i)}${placeholder}${result.substr(i+1)}`;i+=placeholder.length-1}}}else if(char==="'"||char==='"'){currentQuoteChar=char}}}return result}function unescapeInStrings(input){let result=input.replace(_cssCommaInPlaceholderReGlobal,",");result=result.replace(_cssSemiInPlaceholderReGlobal,";");result=result.replace(_cssColonInPlaceholderReGlobal,":");return result}function unescapeQuotes(str,isQuoted){return!isQuoted?str:str.replace(/((?:^|[^\\])(?:\\\\)*)\\(?=['"])/g,"$1")}function combineHostContextSelectors(contextSelectors,otherSelectors){const hostMarker=_polyfillHostNoCombinator;_polyfillHostRe.lastIndex=0;const otherSelectorsHasHost=_polyfillHostRe.test(otherSelectors);if(contextSelectors.length===0){return hostMarker+otherSelectors}const combined=[contextSelectors.pop()||""];while(contextSelectors.length>0){const length=combined.length;const contextSelector=contextSelectors.pop();for(let i=0;i<length;i++){const previousSelectors=combined[i];combined[length*2+i]=previousSelectors+" "+contextSelector;combined[length+i]=contextSelector+" "+previousSelectors;combined[i]=contextSelector+previousSelectors}}return combined.map((s=>otherSelectorsHasHost?`${s}${otherSelectors}`:`${s}${hostMarker}${otherSelectors}, ${s} ${hostMarker}${otherSelectors}`)).join(",")}function repeatGroups(groups,multiples){const length=groups.length;for(let i=1;i<multiples;i++){for(let j=0;j<length;j++){groups[j+i*length]=groups[j].slice(0)}}}var OpKind;(function(OpKind){OpKind[OpKind["ListEnd"]=0]="ListEnd";OpKind[OpKind["Statement"]=1]="Statement";OpKind[OpKind["Variable"]=2]="Variable";OpKind[OpKind["ElementStart"]=3]="ElementStart";OpKind[OpKind["Element"]=4]="Element";OpKind[OpKind["Template"]=5]="Template";OpKind[OpKind["ElementEnd"]=6]="ElementEnd";OpKind[OpKind["ContainerStart"]=7]="ContainerStart";OpKind[OpKind["Container"]=8]="Container";OpKind[OpKind["ContainerEnd"]=9]="ContainerEnd";OpKind[OpKind["DisableBindings"]=10]="DisableBindings";OpKind[OpKind["Conditional"]=11]="Conditional";OpKind[OpKind["EnableBindings"]=12]="EnableBindings";OpKind[OpKind["Text"]=13]="Text";OpKind[OpKind["Listener"]=14]="Listener";OpKind[OpKind["InterpolateText"]=15]="InterpolateText";OpKind[OpKind["Binding"]=16]="Binding";OpKind[OpKind["Property"]=17]="Property";OpKind[OpKind["StyleProp"]=18]="StyleProp";OpKind[OpKind["ClassProp"]=19]="ClassProp";OpKind[OpKind["StyleMap"]=20]="StyleMap";OpKind[OpKind["ClassMap"]=21]="ClassMap";OpKind[OpKind["Advance"]=22]="Advance";OpKind[OpKind["Pipe"]=23]="Pipe";OpKind[OpKind["Attribute"]=24]="Attribute";OpKind[OpKind["ExtractedAttribute"]=25]="ExtractedAttribute";OpKind[OpKind["Defer"]=26]="Defer";OpKind[OpKind["DeferOn"]=27]="DeferOn";OpKind[OpKind["DeferWhen"]=28]="DeferWhen";OpKind[OpKind["I18nMessage"]=29]="I18nMessage";OpKind[OpKind["HostProperty"]=30]="HostProperty";OpKind[OpKind["Namespace"]=31]="Namespace";OpKind[OpKind["ProjectionDef"]=32]="ProjectionDef";OpKind[OpKind["Projection"]=33]="Projection";OpKind[OpKind["RepeaterCreate"]=34]="RepeaterCreate";OpKind[OpKind["Repeater"]=35]="Repeater";OpKind[OpKind["TwoWayProperty"]=36]="TwoWayProperty";OpKind[OpKind["TwoWayListener"]=37]="TwoWayListener";OpKind[OpKind["I18nStart"]=38]="I18nStart";OpKind[OpKind["I18n"]=39]="I18n";OpKind[OpKind["I18nEnd"]=40]="I18nEnd";OpKind[OpKind["I18nExpression"]=41]="I18nExpression";OpKind[OpKind["I18nApply"]=42]="I18nApply";OpKind[OpKind["IcuStart"]=43]="IcuStart";OpKind[OpKind["IcuEnd"]=44]="IcuEnd";OpKind[OpKind["IcuPlaceholder"]=45]="IcuPlaceholder";OpKind[OpKind["I18nContext"]=46]="I18nContext";OpKind[OpKind["I18nAttributes"]=47]="I18nAttributes"})(OpKind||(OpKind={}));var ExpressionKind;(function(ExpressionKind){ExpressionKind[ExpressionKind["LexicalRead"]=0]="LexicalRead";ExpressionKind[ExpressionKind["Context"]=1]="Context";ExpressionKind[ExpressionKind["TrackContext"]=2]="TrackContext";ExpressionKind[ExpressionKind["ReadVariable"]=3]="ReadVariable";ExpressionKind[ExpressionKind["NextContext"]=4]="NextContext";ExpressionKind[ExpressionKind["Reference"]=5]="Reference";ExpressionKind[ExpressionKind["GetCurrentView"]=6]="GetCurrentView";ExpressionKind[ExpressionKind["RestoreView"]=7]="RestoreView";ExpressionKind[ExpressionKind["ResetView"]=8]="ResetView";ExpressionKind[ExpressionKind["PureFunctionExpr"]=9]="PureFunctionExpr";ExpressionKind[ExpressionKind["PureFunctionParameterExpr"]=10]="PureFunctionParameterExpr";ExpressionKind[ExpressionKind["PipeBinding"]=11]="PipeBinding";ExpressionKind[ExpressionKind["PipeBindingVariadic"]=12]="PipeBindingVariadic";ExpressionKind[ExpressionKind["SafePropertyRead"]=13]="SafePropertyRead";ExpressionKind[ExpressionKind["SafeKeyedRead"]=14]="SafeKeyedRead";ExpressionKind[ExpressionKind["SafeInvokeFunction"]=15]="SafeInvokeFunction";ExpressionKind[ExpressionKind["SafeTernaryExpr"]=16]="SafeTernaryExpr";ExpressionKind[ExpressionKind["EmptyExpr"]=17]="EmptyExpr";ExpressionKind[ExpressionKind["AssignTemporaryExpr"]=18]="AssignTemporaryExpr";ExpressionKind[ExpressionKind["ReadTemporaryExpr"]=19]="ReadTemporaryExpr";ExpressionKind[ExpressionKind["SlotLiteralExpr"]=20]="SlotLiteralExpr";ExpressionKind[ExpressionKind["ConditionalCase"]=21]="ConditionalCase";ExpressionKind[ExpressionKind["ConstCollected"]=22]="ConstCollected";ExpressionKind[ExpressionKind["TwoWayBindingSet"]=23]="TwoWayBindingSet"})(ExpressionKind||(ExpressionKind={}));var VariableFlags;(function(VariableFlags){VariableFlags[VariableFlags["None"]=0]="None";VariableFlags[VariableFlags["AlwaysInline"]=1]="AlwaysInline"})(VariableFlags||(VariableFlags={}));var SemanticVariableKind;(function(SemanticVariableKind){SemanticVariableKind[SemanticVariableKind["Context"]=0]="Context";SemanticVariableKind[SemanticVariableKind["Identifier"]=1]="Identifier";SemanticVariableKind[SemanticVariableKind["SavedView"]=2]="SavedView";SemanticVariableKind[SemanticVariableKind["Alias"]=3]="Alias"})(SemanticVariableKind||(SemanticVariableKind={}));var CompatibilityMode;(function(CompatibilityMode){CompatibilityMode[CompatibilityMode["Normal"]=0]="Normal";CompatibilityMode[CompatibilityMode["TemplateDefinitionBuilder"]=1]="TemplateDefinitionBuilder"})(CompatibilityMode||(CompatibilityMode={}));var BindingKind;(function(BindingKind){BindingKind[BindingKind["Attribute"]=0]="Attribute";BindingKind[BindingKind["ClassName"]=1]="ClassName";BindingKind[BindingKind["StyleProperty"]=2]="StyleProperty";BindingKind[BindingKind["Property"]=3]="Property";BindingKind[BindingKind["Template"]=4]="Template";BindingKind[BindingKind["I18n"]=5]="I18n";BindingKind[BindingKind["Animation"]=6]="Animation";BindingKind[BindingKind["TwoWayProperty"]=7]="TwoWayProperty"})(BindingKind||(BindingKind={}));var I18nParamResolutionTime;(function(I18nParamResolutionTime){I18nParamResolutionTime[I18nParamResolutionTime["Creation"]=0]="Creation";I18nParamResolutionTime[I18nParamResolutionTime["Postproccessing"]=1]="Postproccessing"})(I18nParamResolutionTime||(I18nParamResolutionTime={}));var I18nExpressionFor;(function(I18nExpressionFor){I18nExpressionFor[I18nExpressionFor["I18nText"]=0]="I18nText";I18nExpressionFor[I18nExpressionFor["I18nAttribute"]=1]="I18nAttribute"})(I18nExpressionFor||(I18nExpressionFor={}));var I18nParamValueFlags;(function(I18nParamValueFlags){I18nParamValueFlags[I18nParamValueFlags["None"]=0]="None";I18nParamValueFlags[I18nParamValueFlags["ElementTag"]=1]="ElementTag";I18nParamValueFlags[I18nParamValueFlags["TemplateTag"]=2]="TemplateTag";I18nParamValueFlags[I18nParamValueFlags["OpenTag"]=4]="OpenTag";I18nParamValueFlags[I18nParamValueFlags["CloseTag"]=8]="CloseTag";I18nParamValueFlags[I18nParamValueFlags["ExpressionIndex"]=16]="ExpressionIndex"})(I18nParamValueFlags||(I18nParamValueFlags={}));var Namespace;(function(Namespace){Namespace[Namespace["HTML"]=0]="HTML";Namespace[Namespace["SVG"]=1]="SVG";Namespace[Namespace["Math"]=2]="Math"})(Namespace||(Namespace={}));var DeferTriggerKind;(function(DeferTriggerKind){DeferTriggerKind[DeferTriggerKind["Idle"]=0]="Idle";DeferTriggerKind[DeferTriggerKind["Immediate"]=1]="Immediate";DeferTriggerKind[DeferTriggerKind["Timer"]=2]="Timer";DeferTriggerKind[DeferTriggerKind["Hover"]=3]="Hover";DeferTriggerKind[DeferTriggerKind["Interaction"]=4]="Interaction";DeferTriggerKind[DeferTriggerKind["Viewport"]=5]="Viewport"})(DeferTriggerKind||(DeferTriggerKind={}));var I18nContextKind;(function(I18nContextKind){I18nContextKind[I18nContextKind["RootI18n"]=0]="RootI18n";I18nContextKind[I18nContextKind["Icu"]=1]="Icu";I18nContextKind[I18nContextKind["Attr"]=2]="Attr"})(I18nContextKind||(I18nContextKind={}));var TemplateKind;(function(TemplateKind){TemplateKind[TemplateKind["NgTemplate"]=0]="NgTemplate";TemplateKind[TemplateKind["Structural"]=1]="Structural";TemplateKind[TemplateKind["Block"]=2]="Block"})(TemplateKind||(TemplateKind={}));const ConsumesSlot=Symbol("ConsumesSlot");const DependsOnSlotContext=Symbol("DependsOnSlotContext");const ConsumesVarsTrait=Symbol("ConsumesVars");const UsesVarOffset=Symbol("UsesVarOffset");const TRAIT_CONSUMES_SLOT={[ConsumesSlot]:true,numSlotsUsed:1};const TRAIT_DEPENDS_ON_SLOT_CONTEXT={[DependsOnSlotContext]:true};const TRAIT_CONSUMES_VARS={[ConsumesVarsTrait]:true};function hasConsumesSlotTrait(op){return op[ConsumesSlot]===true}function hasDependsOnSlotContextTrait(op){return op[DependsOnSlotContext]===true}function hasConsumesVarsTrait(value){return value[ConsumesVarsTrait]===true}function hasUsesVarOffsetTrait(expr){return expr[UsesVarOffset]===true}function createStatementOp(statement){return{kind:OpKind.Statement,statement:statement,...NEW_OP}}function createVariableOp(xref,variable,initializer,flags){return{kind:OpKind.Variable,xref:xref,variable:variable,initializer:initializer,flags:flags,...NEW_OP}}const NEW_OP={debugListId:null,prev:null,next:null};function createInterpolateTextOp(xref,interpolation,sourceSpan){return{kind:OpKind.InterpolateText,target:xref,interpolation:interpolation,sourceSpan:sourceSpan,...TRAIT_DEPENDS_ON_SLOT_CONTEXT,...TRAIT_CONSUMES_VARS,...NEW_OP}}class Interpolation{constructor(strings,expressions,i18nPlaceholders){this.strings=strings;this.expressions=expressions;this.i18nPlaceholders=i18nPlaceholders;if(i18nPlaceholders.length!==0&&i18nPlaceholders.length!==expressions.length){throw new Error(`Expected ${expressions.length} placeholders to match interpolation expression count, but got ${i18nPlaceholders.length}`)}}}function createBindingOp(target,kind,name,expression,unit,securityContext,isTextAttribute,isStructuralTemplateAttribute,templateKind,i18nMessage,sourceSpan){return{kind:OpKind.Binding,bindingKind:kind,target:target,name:name,expression:expression,unit:unit,securityContext:securityContext,isTextAttribute:isTextAttribute,isStructuralTemplateAttribute:isStructuralTemplateAttribute,templateKind:templateKind,i18nContext:null,i18nMessage:i18nMessage,sourceSpan:sourceSpan,...NEW_OP}}function createPropertyOp(target,name,expression,isAnimationTrigger,securityContext,isStructuralTemplateAttribute,templateKind,i18nContext,i18nMessage,sourceSpan){return{kind:OpKind.Property,target:target,name:name,expression:expression,isAnimationTrigger:isAnimationTrigger,securityContext:securityContext,sanitizer:null,isStructuralTemplateAttribute:isStructuralTemplateAttribute,templateKind:templateKind,i18nContext:i18nContext,i18nMessage:i18nMessage,sourceSpan:sourceSpan,...TRAIT_DEPENDS_ON_SLOT_CONTEXT,...TRAIT_CONSUMES_VARS,...NEW_OP}}function createTwoWayPropertyOp(target,name,expression,securityContext,isStructuralTemplateAttribute,templateKind,i18nContext,i18nMessage,sourceSpan){return{kind:OpKind.TwoWayProperty,target:target,name:name,expression:expression,securityContext:securityContext,sanitizer:null,isStructuralTemplateAttribute:isStructuralTemplateAttribute,templateKind:templateKind,i18nContext:i18nContext,i18nMessage:i18nMessage,sourceSpan:sourceSpan,...TRAIT_DEPENDS_ON_SLOT_CONTEXT,...TRAIT_CONSUMES_VARS,...NEW_OP}}function createStylePropOp(xref,name,expression,unit,sourceSpan){return{kind:OpKind.StyleProp,target:xref,name:name,expression:expression,unit:unit,sourceSpan:sourceSpan,...TRAIT_DEPENDS_ON_SLOT_CONTEXT,...TRAIT_CONSUMES_VARS,...NEW_OP}}function createClassPropOp(xref,name,expression,sourceSpan){return{kind:OpKind.ClassProp,target:xref,name:name,expression:expression,sourceSpan:sourceSpan,...TRAIT_DEPENDS_ON_SLOT_CONTEXT,...TRAIT_CONSUMES_VARS,...NEW_OP}}function createStyleMapOp(xref,expression,sourceSpan){return{kind:OpKind.StyleMap,target:xref,expression:expression,sourceSpan:sourceSpan,...TRAIT_DEPENDS_ON_SLOT_CONTEXT,...TRAIT_CONSUMES_VARS,...NEW_OP}}function createClassMapOp(xref,expression,sourceSpan){return{kind:OpKind.ClassMap,target:xref,expression:expression,sourceSpan:sourceSpan,...TRAIT_DEPENDS_ON_SLOT_CONTEXT,...TRAIT_CONSUMES_VARS,...NEW_OP}}function createAttributeOp(target,namespace,name,expression,securityContext,isTextAttribute,isStructuralTemplateAttribute,templateKind,i18nMessage,sourceSpan){return{kind:OpKind.Attribute,target:target,namespace:namespace,name:name,expression:expression,securityContext:securityContext,sanitizer:null,isTextAttribute:isTextAttribute,isStructuralTemplateAttribute:isStructuralTemplateAttribute,templateKind:templateKind,i18nContext:null,i18nMessage:i18nMessage,sourceSpan:sourceSpan,...TRAIT_DEPENDS_ON_SLOT_CONTEXT,...TRAIT_CONSUMES_VARS,...NEW_OP}}function createAdvanceOp(delta,sourceSpan){return{kind:OpKind.Advance,delta:delta,sourceSpan:sourceSpan,...NEW_OP}}function createConditionalOp(target,targetSlot,test,conditions,sourceSpan){return{kind:OpKind.Conditional,target:target,targetSlot:targetSlot,test:test,conditions:conditions,processed:null,sourceSpan:sourceSpan,contextValue:null,...NEW_OP,...TRAIT_DEPENDS_ON_SLOT_CONTEXT,...TRAIT_CONSUMES_VARS}}function createRepeaterOp(repeaterCreate,targetSlot,collection,sourceSpan){return{kind:OpKind.Repeater,target:repeaterCreate,targetSlot:targetSlot,collection:collection,sourceSpan:sourceSpan,...NEW_OP,...TRAIT_DEPENDS_ON_SLOT_CONTEXT}}function createDeferWhenOp(target,expr,prefetch,sourceSpan){return{kind:OpKind.DeferWhen,target:target,expr:expr,prefetch:prefetch,sourceSpan:sourceSpan,...NEW_OP,...TRAIT_DEPENDS_ON_SLOT_CONTEXT,...TRAIT_CONSUMES_VARS}}function createI18nExpressionOp(context,target,i18nOwner,handle,expression,icuPlaceholder,i18nPlaceholder,resolutionTime,usage,name,sourceSpan){return{kind:OpKind.I18nExpression,context:context,target:target,i18nOwner:i18nOwner,handle:handle,expression:expression,icuPlaceholder:icuPlaceholder,i18nPlaceholder:i18nPlaceholder,resolutionTime:resolutionTime,usage:usage,name:name,sourceSpan:sourceSpan,...NEW_OP,...TRAIT_CONSUMES_VARS,...TRAIT_DEPENDS_ON_SLOT_CONTEXT}}function createI18nApplyOp(owner,handle,sourceSpan){return{kind:OpKind.I18nApply,owner:owner,handle:handle,sourceSpan:sourceSpan,...NEW_OP}}var _a,_b,_c,_d,_e,_f;function isIrExpression(expr){return expr instanceof ExpressionBase}class ExpressionBase extends Expression{constructor(sourceSpan=null){super(null,sourceSpan)}}class LexicalReadExpr extends ExpressionBase{constructor(name){super();this.name=name;this.kind=ExpressionKind.LexicalRead}visitExpression(visitor,context){}isEquivalent(other){return this.name===other.name}isConstant(){return false}transformInternalExpressions(){}clone(){return new LexicalReadExpr(this.name)}}class ReferenceExpr extends ExpressionBase{constructor(target,targetSlot,offset){super();this.target=target;this.targetSlot=targetSlot;this.offset=offset;this.kind=ExpressionKind.Reference}visitExpression(){}isEquivalent(e){return e instanceof ReferenceExpr&&e.target===this.target}isConstant(){return false}transformInternalExpressions(){}clone(){return new ReferenceExpr(this.target,this.targetSlot,this.offset)}}class ContextExpr extends ExpressionBase{constructor(view){super();this.view=view;this.kind=ExpressionKind.Context}visitExpression(){}isEquivalent(e){return e instanceof ContextExpr&&e.view===this.view}isConstant(){return false}transformInternalExpressions(){}clone(){return new ContextExpr(this.view)}}class TrackContextExpr extends ExpressionBase{constructor(view){super();this.view=view;this.kind=ExpressionKind.TrackContext}visitExpression(){}isEquivalent(e){return e instanceof TrackContextExpr&&e.view===this.view}isConstant(){return false}transformInternalExpressions(){}clone(){return new TrackContextExpr(this.view)}}class NextContextExpr extends ExpressionBase{constructor(){super();this.kind=ExpressionKind.NextContext;this.steps=1}visitExpression(){}isEquivalent(e){return e instanceof NextContextExpr&&e.steps===this.steps}isConstant(){return false}transformInternalExpressions(){}clone(){const expr=new NextContextExpr;expr.steps=this.steps;return expr}}class GetCurrentViewExpr extends ExpressionBase{constructor(){super();this.kind=ExpressionKind.GetCurrentView}visitExpression(){}isEquivalent(e){return e instanceof GetCurrentViewExpr}isConstant(){return false}transformInternalExpressions(){}clone(){return new GetCurrentViewExpr}}class RestoreViewExpr extends ExpressionBase{constructor(view){super();this.view=view;this.kind=ExpressionKind.RestoreView}visitExpression(visitor,context){if(typeof this.view!=="number"){this.view.visitExpression(visitor,context)}}isEquivalent(e){if(!(e instanceof RestoreViewExpr)||typeof e.view!==typeof this.view){return false}if(typeof this.view==="number"){return this.view===e.view}else{return this.view.isEquivalent(e.view)}}isConstant(){return false}transformInternalExpressions(transform,flags){if(typeof this.view!=="number"){this.view=transformExpressionsInExpression(this.view,transform,flags)}}clone(){return new RestoreViewExpr(this.view instanceof Expression?this.view.clone():this.view)}}class ResetViewExpr extends ExpressionBase{constructor(expr){super();this.expr=expr;this.kind=ExpressionKind.ResetView}visitExpression(visitor,context){this.expr.visitExpression(visitor,context)}isEquivalent(e){return e instanceof ResetViewExpr&&this.expr.isEquivalent(e.expr)}isConstant(){return false}transformInternalExpressions(transform,flags){this.expr=transformExpressionsInExpression(this.expr,transform,flags)}clone(){return new ResetViewExpr(this.expr.clone())}}class TwoWayBindingSetExpr extends ExpressionBase{constructor(target,value){super();this.target=target;this.value=value;this.kind=ExpressionKind.TwoWayBindingSet}visitExpression(visitor,context){this.target.visitExpression(visitor,context);this.value.visitExpression(visitor,context)}isEquivalent(other){return this.target.isEquivalent(other.target)&&this.value.isEquivalent(other.value)}isConstant(){return false}transformInternalExpressions(transform,flags){this.target=transformExpressionsInExpression(this.target,transform,flags);this.value=transformExpressionsInExpression(this.value,transform,flags)}clone(){return new TwoWayBindingSetExpr(this.target,this.value)}}class ReadVariableExpr extends ExpressionBase{constructor(xref){super();this.xref=xref;this.kind=ExpressionKind.ReadVariable;this.name=null}visitExpression(){}isEquivalent(other){return other instanceof ReadVariableExpr&&other.xref===this.xref}isConstant(){return false}transformInternalExpressions(){}clone(){const expr=new ReadVariableExpr(this.xref);expr.name=this.name;return expr}}class PureFunctionExpr extends ExpressionBase{static{_a=ConsumesVarsTrait,_b=UsesVarOffset}constructor(expression,args){super();this.kind=ExpressionKind.PureFunctionExpr;this[_a]=true;this[_b]=true;this.varOffset=null;this.fn=null;this.body=expression;this.args=args}visitExpression(visitor,context){this.body?.visitExpression(visitor,context);for(const arg of this.args){arg.visitExpression(visitor,context)}}isEquivalent(other){if(!(other instanceof PureFunctionExpr)||other.args.length!==this.args.length){return false}return other.body!==null&&this.body!==null&&other.body.isEquivalent(this.body)&&other.args.every(((arg,idx)=>arg.isEquivalent(this.args[idx])))}isConstant(){return false}transformInternalExpressions(transform,flags){if(this.body!==null){this.body=transformExpressionsInExpression(this.body,transform,flags|VisitorContextFlag.InChildOperation)}else if(this.fn!==null){this.fn=transformExpressionsInExpression(this.fn,transform,flags)}for(let i=0;i<this.args.length;i++){this.args[i]=transformExpressionsInExpression(this.args[i],transform,flags)}}clone(){const expr=new PureFunctionExpr(this.body?.clone()??null,this.args.map((arg=>arg.clone())));expr.fn=this.fn?.clone()??null;expr.varOffset=this.varOffset;return expr}}class PureFunctionParameterExpr extends ExpressionBase{constructor(index){super();this.index=index;this.kind=ExpressionKind.PureFunctionParameterExpr}visitExpression(){}isEquivalent(other){return other instanceof PureFunctionParameterExpr&&other.index===this.index}isConstant(){return true}transformInternalExpressions(){}clone(){return new PureFunctionParameterExpr(this.index)}}class PipeBindingExpr extends ExpressionBase{static{_c=ConsumesVarsTrait,_d=UsesVarOffset}constructor(target,targetSlot,name,args){super();this.target=target;this.targetSlot=targetSlot;this.name=name;this.args=args;this.kind=ExpressionKind.PipeBinding;this[_c]=true;this[_d]=true;this.varOffset=null}visitExpression(visitor,context){for(const arg of this.args){arg.visitExpression(visitor,context)}}isEquivalent(){return false}isConstant(){return false}transformInternalExpressions(transform,flags){for(let idx=0;idx<this.args.length;idx++){this.args[idx]=transformExpressionsInExpression(this.args[idx],transform,flags)}}clone(){const r=new PipeBindingExpr(this.target,this.targetSlot,this.name,this.args.map((a=>a.clone())));r.varOffset=this.varOffset;return r}}class PipeBindingVariadicExpr extends ExpressionBase{static{_e=ConsumesVarsTrait,_f=UsesVarOffset}constructor(target,targetSlot,name,args,numArgs){super();this.target=target;this.targetSlot=targetSlot;this.name=name;this.args=args;this.numArgs=numArgs;this.kind=ExpressionKind.PipeBindingVariadic;this[_e]=true;this[_f]=true;this.varOffset=null}visitExpression(visitor,context){this.args.visitExpression(visitor,context)}isEquivalent(){return false}isConstant(){return false}transformInternalExpressions(transform,flags){this.args=transformExpressionsInExpression(this.args,transform,flags)}clone(){const r=new PipeBindingVariadicExpr(this.target,this.targetSlot,this.name,this.args.clone(),this.numArgs);r.varOffset=this.varOffset;return r}}class SafePropertyReadExpr extends ExpressionBase{constructor(receiver,name){super();this.receiver=receiver;this.name=name;this.kind=ExpressionKind.SafePropertyRead}get index(){return this.name}visitExpression(visitor,context){this.receiver.visitExpression(visitor,context)}isEquivalent(){return false}isConstant(){return false}transformInternalExpressions(transform,flags){this.receiver=transformExpressionsInExpression(this.receiver,transform,flags)}clone(){return new SafePropertyReadExpr(this.receiver.clone(),this.name)}}class SafeKeyedReadExpr extends ExpressionBase{constructor(receiver,index,sourceSpan){super(sourceSpan);this.receiver=receiver;this.index=index;this.kind=ExpressionKind.SafeKeyedRead}visitExpression(visitor,context){this.receiver.visitExpression(visitor,context);this.index.visitExpression(visitor,context)}isEquivalent(){return false}isConstant(){return false}transformInternalExpressions(transform,flags){this.receiver=transformExpressionsInExpression(this.receiver,transform,flags);this.index=transformExpressionsInExpression(this.index,transform,flags)}clone(){return new SafeKeyedReadExpr(this.receiver.clone(),this.index.clone(),this.sourceSpan)}}class SafeInvokeFunctionExpr extends ExpressionBase{constructor(receiver,args){super();this.receiver=receiver;this.args=args;this.kind=ExpressionKind.SafeInvokeFunction}visitExpression(visitor,context){this.receiver.visitExpression(visitor,context);for(const a of this.args){a.visitExpression(visitor,context)}}isEquivalent(){return false}isConstant(){return false}transformInternalExpressions(transform,flags){this.receiver=transformExpressionsInExpression(this.receiver,transform,flags);for(let i=0;i<this.args.length;i++){this.args[i]=transformExpressionsInExpression(this.args[i],transform,flags)}}clone(){return new SafeInvokeFunctionExpr(this.receiver.clone(),this.args.map((a=>a.clone())))}}class SafeTernaryExpr extends ExpressionBase{constructor(guard,expr){super();this.guard=guard;this.expr=expr;this.kind=ExpressionKind.SafeTernaryExpr}visitExpression(visitor,context){this.guard.visitExpression(visitor,context);this.expr.visitExpression(visitor,context)}isEquivalent(){return false}isConstant(){return false}transformInternalExpressions(transform,flags){this.guard=transformExpressionsInExpression(this.guard,transform,flags);this.expr=transformExpressionsInExpression(this.expr,transform,flags)}clone(){return new SafeTernaryExpr(this.guard.clone(),this.expr.clone())}}class EmptyExpr extends ExpressionBase{constructor(){super(...arguments);this.kind=ExpressionKind.EmptyExpr}visitExpression(visitor,context){}isEquivalent(e){return e instanceof EmptyExpr}isConstant(){return true}clone(){return new EmptyExpr}transformInternalExpressions(){}}class AssignTemporaryExpr extends ExpressionBase{constructor(expr,xref){super();this.expr=expr;this.xref=xref;this.kind=ExpressionKind.AssignTemporaryExpr;this.name=null}visitExpression(visitor,context){this.expr.visitExpression(visitor,context)}isEquivalent(){return false}isConstant(){return false}transformInternalExpressions(transform,flags){this.expr=transformExpressionsInExpression(this.expr,transform,flags)}clone(){const a=new AssignTemporaryExpr(this.expr.clone(),this.xref);a.name=this.name;return a}}class ReadTemporaryExpr extends ExpressionBase{constructor(xref){super();this.xref=xref;this.kind=ExpressionKind.ReadTemporaryExpr;this.name=null}visitExpression(visitor,context){}isEquivalent(){return this.xref===this.xref}isConstant(){return false}transformInternalExpressions(transform,flags){}clone(){const r=new ReadTemporaryExpr(this.xref);r.name=this.name;return r}}class SlotLiteralExpr extends ExpressionBase{constructor(slot){super();this.slot=slot;this.kind=ExpressionKind.SlotLiteralExpr}visitExpression(visitor,context){}isEquivalent(e){return e instanceof SlotLiteralExpr&&e.slot===this.slot}isConstant(){return true}clone(){return new SlotLiteralExpr(this.slot)}transformInternalExpressions(){}}class ConditionalCaseExpr extends ExpressionBase{constructor(expr,target,targetSlot,alias=null){super();this.expr=expr;this.target=target;this.targetSlot=targetSlot;this.alias=alias;this.kind=ExpressionKind.ConditionalCase}visitExpression(visitor,context){if(this.expr!==null){this.expr.visitExpression(visitor,context)}}isEquivalent(e){return e instanceof ConditionalCaseExpr&&e.expr===this.expr}isConstant(){return true}clone(){return new ConditionalCaseExpr(this.expr,this.target,this.targetSlot)}transformInternalExpressions(transform,flags){if(this.expr!==null){this.expr=transformExpressionsInExpression(this.expr,transform,flags)}}}class ConstCollectedExpr extends ExpressionBase{constructor(expr){super();this.expr=expr;this.kind=ExpressionKind.ConstCollected}transformInternalExpressions(transform,flags){this.expr=transform(this.expr,flags)}visitExpression(visitor,context){this.expr.visitExpression(visitor,context)}isEquivalent(e){if(!(e instanceof ConstCollectedExpr)){return false}return this.expr.isEquivalent(e.expr)}isConstant(){return this.expr.isConstant()}clone(){return new ConstCollectedExpr(this.expr)}}function visitExpressionsInOp(op,visitor){transformExpressionsInOp(op,((expr,flags)=>{visitor(expr,flags);return expr}),VisitorContextFlag.None)}var VisitorContextFlag;(function(VisitorContextFlag){VisitorContextFlag[VisitorContextFlag["None"]=0]="None";VisitorContextFlag[VisitorContextFlag["InChildOperation"]=1]="InChildOperation"})(VisitorContextFlag||(VisitorContextFlag={}));function transformExpressionsInInterpolation(interpolation,transform,flags){for(let i=0;i<interpolation.expressions.length;i++){interpolation.expressions[i]=transformExpressionsInExpression(interpolation.expressions[i],transform,flags)}}function transformExpressionsInOp(op,transform,flags){switch(op.kind){case OpKind.StyleProp:case OpKind.StyleMap:case OpKind.ClassProp:case OpKind.ClassMap:case OpKind.Binding:if(op.expression instanceof Interpolation){transformExpressionsInInterpolation(op.expression,transform,flags)}else{op.expression=transformExpressionsInExpression(op.expression,transform,flags)}break;case OpKind.Property:case OpKind.HostProperty:case OpKind.Attribute:if(op.expression instanceof Interpolation){transformExpressionsInInterpolation(op.expression,transform,flags)}else{op.expression=transformExpressionsInExpression(op.expression,transform,flags)}op.sanitizer=op.sanitizer&&transformExpressionsInExpression(op.sanitizer,transform,flags);break;case OpKind.TwoWayProperty:op.expression=transformExpressionsInExpression(op.expression,transform,flags);op.sanitizer=op.sanitizer&&transformExpressionsInExpression(op.sanitizer,transform,flags);break;case OpKind.I18nExpression:op.expression=transformExpressionsInExpression(op.expression,transform,flags);break;case OpKind.InterpolateText:transformExpressionsInInterpolation(op.interpolation,transform,flags);break;case OpKind.Statement:transformExpressionsInStatement(op.statement,transform,flags);break;case OpKind.Variable:op.initializer=transformExpressionsInExpression(op.initializer,transform,flags);break;case OpKind.Conditional:for(const condition of op.conditions){if(condition.expr===null){continue}condition.expr=transformExpressionsInExpression(condition.expr,transform,flags)}if(op.processed!==null){op.processed=transformExpressionsInExpression(op.processed,transform,flags)}if(op.contextValue!==null){op.contextValue=transformExpressionsInExpression(op.contextValue,transform,flags)}break;case OpKind.Listener:case OpKind.TwoWayListener:for(const innerOp of op.handlerOps){transformExpressionsInOp(innerOp,transform,flags|VisitorContextFlag.InChildOperation)}break;case OpKind.ExtractedAttribute:op.expression=op.expression&&transformExpressionsInExpression(op.expression,transform,flags);op.trustedValueFn=op.trustedValueFn&&transformExpressionsInExpression(op.trustedValueFn,transform,flags);break;case OpKind.RepeaterCreate:op.track=transformExpressionsInExpression(op.track,transform,flags);if(op.trackByFn!==null){op.trackByFn=transformExpressionsInExpression(op.trackByFn,transform,flags)}break;case OpKind.Repeater:op.collection=transformExpressionsInExpression(op.collection,transform,flags);break;case OpKind.Defer:if(op.loadingConfig!==null){op.loadingConfig=transformExpressionsInExpression(op.loadingConfig,transform,flags)}if(op.placeholderConfig!==null){op.placeholderConfig=transformExpressionsInExpression(op.placeholderConfig,transform,flags)}if(op.resolverFn!==null){op.resolverFn=transformExpressionsInExpression(op.resolverFn,transform,flags)}break;case OpKind.I18nMessage:for(const[placeholder,expr]of op.params){op.params.set(placeholder,transformExpressionsInExpression(expr,transform,flags))}for(const[placeholder,expr]of op.postprocessingParams){op.postprocessingParams.set(placeholder,transformExpressionsInExpression(expr,transform,flags))}break;case OpKind.DeferWhen:op.expr=transformExpressionsInExpression(op.expr,transform,flags);break;case OpKind.Advance:case OpKind.Container:case OpKind.ContainerEnd:case OpKind.ContainerStart:case OpKind.DeferOn:case OpKind.DisableBindings:case OpKind.Element:case OpKind.ElementEnd:case OpKind.ElementStart:case OpKind.EnableBindings:case OpKind.I18n:case OpKind.I18nApply:case OpKind.I18nContext:case OpKind.I18nEnd:case OpKind.I18nStart:case OpKind.IcuEnd:case OpKind.IcuStart:case OpKind.Namespace:case OpKind.Pipe:case OpKind.Projection:case OpKind.ProjectionDef:case OpKind.Template:case OpKind.Text:case OpKind.I18nAttributes:case OpKind.IcuPlaceholder:break;default:throw new Error(`AssertionError: transformExpressionsInOp doesn't handle ${OpKind[op.kind]}`)}}function transformExpressionsInExpression(expr,transform,flags){if(expr instanceof ExpressionBase){expr.transformInternalExpressions(transform,flags)}else if(expr instanceof BinaryOperatorExpr){expr.lhs=transformExpressionsInExpression(expr.lhs,transform,flags);expr.rhs=transformExpressionsInExpression(expr.rhs,transform,flags)}else if(expr instanceof UnaryOperatorExpr){expr.expr=transformExpressionsInExpression(expr.expr,transform,flags)}else if(expr instanceof ReadPropExpr){expr.receiver=transformExpressionsInExpression(expr.receiver,transform,flags)}else if(expr instanceof ReadKeyExpr){expr.receiver=transformExpressionsInExpression(expr.receiver,transform,flags);expr.index=transformExpressionsInExpression(expr.index,transform,flags)}else if(expr instanceof WritePropExpr){expr.receiver=transformExpressionsInExpression(expr.receiver,transform,flags);expr.value=transformExpressionsInExpression(expr.value,transform,flags)}else if(expr instanceof WriteKeyExpr){expr.receiver=transformExpressionsInExpression(expr.receiver,transform,flags);expr.index=transformExpressionsInExpression(expr.index,transform,flags);expr.value=transformExpressionsInExpression(expr.value,transform,flags)}else if(expr instanceof InvokeFunctionExpr){expr.fn=transformExpressionsInExpression(expr.fn,transform,flags);for(let i=0;i<expr.args.length;i++){expr.args[i]=transformExpressionsInExpression(expr.args[i],transform,flags)}}else if(expr instanceof LiteralArrayExpr){for(let i=0;i<expr.entries.length;i++){expr.entries[i]=transformExpressionsInExpression(expr.entries[i],transform,flags)}}else if(expr instanceof LiteralMapExpr){for(let i=0;i<expr.entries.length;i++){expr.entries[i].value=transformExpressionsInExpression(expr.entries[i].value,transform,flags)}}else if(expr instanceof ConditionalExpr){expr.condition=transformExpressionsInExpression(expr.condition,transform,flags);expr.trueCase=transformExpressionsInExpression(expr.trueCase,transform,flags);if(expr.falseCase!==null){expr.falseCase=transformExpressionsInExpression(expr.falseCase,transform,flags)}}else if(expr instanceof TypeofExpr){expr.expr=transformExpressionsInExpression(expr.expr,transform,flags)}else if(expr instanceof WriteVarExpr){expr.value=transformExpressionsInExpression(expr.value,transform,flags)}else if(expr instanceof LocalizedString){for(let i=0;i<expr.expressions.length;i++){expr.expressions[i]=transformExpressionsInExpression(expr.expressions[i],transform,flags)}}else if(expr instanceof NotExpr){expr.condition=transformExpressionsInExpression(expr.condition,transform,flags)}else if(expr instanceof TaggedTemplateExpr){expr.tag=transformExpressionsInExpression(expr.tag,transform,flags);expr.template.expressions=expr.template.expressions.map((e=>transformExpressionsInExpression(e,transform,flags)))}else if(expr instanceof ArrowFunctionExpr){if(Array.isArray(expr.body)){for(let i=0;i<expr.body.length;i++){transformExpressionsInStatement(expr.body[i],transform,flags)}}else{expr.body=transformExpressionsInExpression(expr.body,transform,flags)}}else if(expr instanceof WrappedNodeExpr);else if(expr instanceof ReadVarExpr||expr instanceof ExternalExpr||expr instanceof LiteralExpr);else{throw new Error(`Unhandled expression kind: ${expr.constructor.name}`)}return transform(expr,flags)}function transformExpressionsInStatement(stmt,transform,flags){if(stmt instanceof ExpressionStatement){stmt.expr=transformExpressionsInExpression(stmt.expr,transform,flags)}else if(stmt instanceof ReturnStatement){stmt.value=transformExpressionsInExpression(stmt.value,transform,flags)}else if(stmt instanceof DeclareVarStmt){if(stmt.value!==undefined){stmt.value=transformExpressionsInExpression(stmt.value,transform,flags)}}else if(stmt instanceof IfStmt){stmt.condition=transformExpressionsInExpression(stmt.condition,transform,flags);for(const caseStatement of stmt.trueCase){transformExpressionsInStatement(caseStatement,transform,flags)}for(const caseStatement of stmt.falseCase){transformExpressionsInStatement(caseStatement,transform,flags)}}else{throw new Error(`Unhandled statement kind: ${stmt.constructor.name}`)}}function isStringLiteral(expr){return expr instanceof LiteralExpr&&typeof expr.value==="string"}class OpList{static{this.nextListId=0}constructor(){this.debugListId=OpList.nextListId++;this.head={kind:OpKind.ListEnd,next:null,prev:null,debugListId:this.debugListId};this.tail={kind:OpKind.ListEnd,next:null,prev:null,debugListId:this.debugListId};this.head.next=this.tail;this.tail.prev=this.head}push(op){if(Array.isArray(op)){for(const o of op){this.push(o)}return}OpList.assertIsNotEnd(op);OpList.assertIsUnowned(op);op.debugListId=this.debugListId;const oldLast=this.tail.prev;op.prev=oldLast;oldLast.next=op;op.next=this.tail;this.tail.prev=op}prepend(ops){if(ops.length===0){return}for(const op of ops){OpList.assertIsNotEnd(op);OpList.assertIsUnowned(op);op.debugListId=this.debugListId}const first=this.head.next;let prev=this.head;for(const op of ops){prev.next=op;op.prev=prev;prev=op}prev.next=first;first.prev=prev}*[Symbol.iterator](){let current=this.head.next;while(current!==this.tail){OpList.assertIsOwned(current,this.debugListId);const next=current.next;yield current;current=next}}*reversed(){let current=this.tail.prev;while(current!==this.head){OpList.assertIsOwned(current,this.debugListId);const prev=current.prev;yield current;current=prev}}static replace(oldOp,newOp){OpList.assertIsNotEnd(oldOp);OpList.assertIsNotEnd(newOp);OpList.assertIsOwned(oldOp);OpList.assertIsUnowned(newOp);newOp.debugListId=oldOp.debugListId;if(oldOp.prev!==null){oldOp.prev.next=newOp;newOp.prev=oldOp.prev}if(oldOp.next!==null){oldOp.next.prev=newOp;newOp.next=oldOp.next}oldOp.debugListId=null;oldOp.prev=null;oldOp.next=null}static replaceWithMany(oldOp,newOps){if(newOps.length===0){OpList.remove(oldOp);return}OpList.assertIsNotEnd(oldOp);OpList.assertIsOwned(oldOp);const listId=oldOp.debugListId;oldOp.debugListId=null;for(const newOp of newOps){OpList.assertIsNotEnd(newOp);OpList.assertIsUnowned(newOp)}const{prev:oldPrev,next:oldNext}=oldOp;oldOp.prev=null;oldOp.next=null;let prev=oldPrev;for(const newOp of newOps){this.assertIsUnowned(newOp);newOp.debugListId=listId;prev.next=newOp;newOp.prev=prev;newOp.next=null;prev=newOp}const first=newOps[0];const last=prev;if(oldPrev!==null){oldPrev.next=first;first.prev=oldPrev}if(oldNext!==null){oldNext.prev=last;last.next=oldNext}}static remove(op){OpList.assertIsNotEnd(op);OpList.assertIsOwned(op);op.prev.next=op.next;op.next.prev=op.prev;op.debugListId=null;op.prev=null;op.next=null}static insertBefore(op,target){if(Array.isArray(op)){for(const o of op){this.insertBefore(o,target)}return}OpList.assertIsOwned(target);if(target.prev===null){throw new Error(`AssertionError: illegal operation on list start`)}OpList.assertIsNotEnd(op);OpList.assertIsUnowned(op);op.debugListId=target.debugListId;op.prev=null;target.prev.next=op;op.prev=target.prev;op.next=target;target.prev=op}static insertAfter(op,target){OpList.assertIsOwned(target);if(target.next===null){throw new Error(`AssertionError: illegal operation on list end`)}OpList.assertIsNotEnd(op);OpList.assertIsUnowned(op);op.debugListId=target.debugListId;target.next.prev=op;op.next=target.next;op.prev=target;target.next=op}static assertIsUnowned(op){if(op.debugListId!==null){throw new Error(`AssertionError: illegal operation on owned node: ${OpKind[op.kind]}`)}}static assertIsOwned(op,byList){if(op.debugListId===null){throw new Error(`AssertionError: illegal operation on unowned node: ${OpKind[op.kind]}`)}else if(byList!==undefined&&op.debugListId!==byList){throw new Error(`AssertionError: node belongs to the wrong list (expected ${byList}, actual ${op.debugListId})`)}}static assertIsNotEnd(op){if(op.kind===OpKind.ListEnd){throw new Error(`AssertionError: illegal operation on list head or tail`)}}}class SlotHandle{constructor(){this.slot=null}}const elementContainerOpKinds=new Set([OpKind.Element,OpKind.ElementStart,OpKind.Container,OpKind.ContainerStart,OpKind.Template,OpKind.RepeaterCreate]);function isElementOrContainerOp(op){return elementContainerOpKinds.has(op.kind)}function createElementStartOp(tag,xref,namespace,i18nPlaceholder,startSourceSpan,wholeSourceSpan){return{kind:OpKind.ElementStart,xref:xref,tag:tag,handle:new SlotHandle,attributes:null,localRefs:[],nonBindable:false,namespace:namespace,i18nPlaceholder:i18nPlaceholder,startSourceSpan:startSourceSpan,wholeSourceSpan:wholeSourceSpan,...TRAIT_CONSUMES_SLOT,...NEW_OP}}function createTemplateOp(xref,templateKind,tag,functionNameSuffix,namespace,i18nPlaceholder,startSourceSpan,wholeSourceSpan){return{kind:OpKind.Template,xref:xref,templateKind:templateKind,attributes:null,tag:tag,handle:new SlotHandle,functionNameSuffix:functionNameSuffix,decls:null,vars:null,localRefs:[],nonBindable:false,namespace:namespace,i18nPlaceholder:i18nPlaceholder,startSourceSpan:startSourceSpan,wholeSourceSpan:wholeSourceSpan,...TRAIT_CONSUMES_SLOT,...NEW_OP}}function createRepeaterCreateOp(primaryView,emptyView,tag,track,varNames,emptyTag,i18nPlaceholder,emptyI18nPlaceholder,startSourceSpan,wholeSourceSpan){return{kind:OpKind.RepeaterCreate,attributes:null,xref:primaryView,handle:new SlotHandle,emptyView:emptyView,track:track,trackByFn:null,tag:tag,emptyTag:emptyTag,emptyAttributes:null,functionNameSuffix:"For",namespace:Namespace.HTML,nonBindable:false,localRefs:[],decls:null,vars:null,varNames:varNames,usesComponentInstance:false,i18nPlaceholder:i18nPlaceholder,emptyI18nPlaceholder:emptyI18nPlaceholder,startSourceSpan:startSourceSpan,wholeSourceSpan:wholeSourceSpan,...TRAIT_CONSUMES_SLOT,...NEW_OP,...TRAIT_CONSUMES_VARS,numSlotsUsed:emptyView===null?2:3}}function createElementEndOp(xref,sourceSpan){return{kind:OpKind.ElementEnd,xref:xref,sourceSpan:sourceSpan,...NEW_OP}}function createDisableBindingsOp(xref){return{kind:OpKind.DisableBindings,xref:xref,...NEW_OP}}function createEnableBindingsOp(xref){return{kind:OpKind.EnableBindings,xref:xref,...NEW_OP}}function createTextOp(xref,initialValue,icuPlaceholder,sourceSpan){return{kind:OpKind.Text,xref:xref,handle:new SlotHandle,initialValue:initialValue,icuPlaceholder:icuPlaceholder,sourceSpan:sourceSpan,...TRAIT_CONSUMES_SLOT,...NEW_OP}}function createListenerOp(target,targetSlot,name,tag,handlerOps,animationPhase,eventTarget,hostListener,sourceSpan){const handlerList=new OpList;handlerList.push(handlerOps);return{kind:OpKind.Listener,target:target,targetSlot:targetSlot,tag:tag,hostListener:hostListener,name:name,handlerOps:handlerList,handlerFnName:null,consumesDollarEvent:false,isAnimationListener:animationPhase!==null,animationPhase:animationPhase,eventTarget:eventTarget,sourceSpan:sourceSpan,...NEW_OP}}function createTwoWayListenerOp(target,targetSlot,name,tag,handlerOps,sourceSpan){const handlerList=new OpList;handlerList.push(handlerOps);return{kind:OpKind.TwoWayListener,target:target,targetSlot:targetSlot,tag:tag,name:name,handlerOps:handlerList,handlerFnName:null,sourceSpan:sourceSpan,...NEW_OP}}function createPipeOp(xref,slot,name){return{kind:OpKind.Pipe,xref:xref,handle:slot,name:name,...NEW_OP,...TRAIT_CONSUMES_SLOT}}function createNamespaceOp(namespace){return{kind:OpKind.Namespace,active:namespace,...NEW_OP}}function createProjectionDefOp(def){return{kind:OpKind.ProjectionDef,def:def,...NEW_OP}}function createProjectionOp(xref,selector,i18nPlaceholder,sourceSpan){return{kind:OpKind.Projection,xref:xref,handle:new SlotHandle,selector:selector,i18nPlaceholder:i18nPlaceholder,projectionSlotIndex:0,attributes:null,localRefs:[],sourceSpan:sourceSpan,...NEW_OP,...TRAIT_CONSUMES_SLOT}}function createExtractedAttributeOp(target,bindingKind,namespace,name,expression,i18nContext,i18nMessage,securityContext){return{kind:OpKind.ExtractedAttribute,target:target,bindingKind:bindingKind,namespace:namespace,name:name,expression:expression,i18nContext:i18nContext,i18nMessage:i18nMessage,securityContext:securityContext,trustedValueFn:null,...NEW_OP}}function createDeferOp(xref,main,mainSlot,metadata,resolverFn,sourceSpan){return{kind:OpKind.Defer,xref:xref,handle:new SlotHandle,mainView:main,mainSlot:mainSlot,loadingView:null,loadingSlot:null,loadingConfig:null,loadingMinimumTime:null,loadingAfterTime:null,placeholderView:null,placeholderSlot:null,placeholderConfig:null,placeholderMinimumTime:null,errorView:null,errorSlot:null,metadata:metadata,resolverFn:resolverFn,sourceSpan:sourceSpan,...NEW_OP,...TRAIT_CONSUMES_SLOT,numSlotsUsed:2}}function createDeferOnOp(defer,trigger,prefetch,sourceSpan){return{kind:OpKind.DeferOn,defer:defer,trigger:trigger,prefetch:prefetch,sourceSpan:sourceSpan,...NEW_OP}}function createI18nMessageOp(xref,i18nContext,i18nBlock,message,messagePlaceholder,params,postprocessingParams,needsPostprocessing){return{kind:OpKind.I18nMessage,xref:xref,i18nContext:i18nContext,i18nBlock:i18nBlock,message:message,messagePlaceholder:messagePlaceholder,params:params,postprocessingParams:postprocessingParams,needsPostprocessing:needsPostprocessing,subMessages:[],...NEW_OP}}function createI18nStartOp(xref,message,root,sourceSpan){return{kind:OpKind.I18nStart,xref:xref,handle:new SlotHandle,root:root??xref,message:message,messageIndex:null,subTemplateIndex:null,context:null,sourceSpan:sourceSpan,...NEW_OP,...TRAIT_CONSUMES_SLOT}}function createI18nEndOp(xref,sourceSpan){return{kind:OpKind.I18nEnd,xref:xref,sourceSpan:sourceSpan,...NEW_OP}}function createIcuStartOp(xref,message,messagePlaceholder,sourceSpan){return{kind:OpKind.IcuStart,xref:xref,message:message,messagePlaceholder:messagePlaceholder,context:null,sourceSpan:sourceSpan,...NEW_OP}}function createIcuEndOp(xref){return{kind:OpKind.IcuEnd,xref:xref,...NEW_OP}}function createIcuPlaceholderOp(xref,name,strings){return{kind:OpKind.IcuPlaceholder,xref:xref,name:name,strings:strings,expressionPlaceholders:[],...NEW_OP}}function createI18nContextOp(contextKind,xref,i18nBlock,message,sourceSpan){if(i18nBlock===null&&contextKind!==I18nContextKind.Attr){throw new Error("AssertionError: i18nBlock must be provided for non-attribute contexts.")}return{kind:OpKind.I18nContext,contextKind:contextKind,xref:xref,i18nBlock:i18nBlock,message:message,sourceSpan:sourceSpan,params:new Map,postprocessingParams:new Map,...NEW_OP}}function createI18nAttributesOp(xref,handle,target){return{kind:OpKind.I18nAttributes,xref:xref,handle:handle,target:target,i18nAttributesConfig:null,...NEW_OP,...TRAIT_CONSUMES_SLOT}}function createHostPropertyOp(name,expression,isAnimationTrigger,i18nContext,securityContext,sourceSpan){return{kind:OpKind.HostProperty,name:name,expression:expression,isAnimationTrigger:isAnimationTrigger,i18nContext:i18nContext,securityContext:securityContext,sanitizer:null,sourceSpan:sourceSpan,...TRAIT_CONSUMES_VARS,...NEW_OP}}const CTX_REF="CTX_REF_MARKER";var CompilationJobKind;(function(CompilationJobKind){CompilationJobKind[CompilationJobKind["Tmpl"]=0]="Tmpl";CompilationJobKind[CompilationJobKind["Host"]=1]="Host";CompilationJobKind[CompilationJobKind["Both"]=2]="Both"})(CompilationJobKind||(CompilationJobKind={}));class CompilationJob{constructor(componentName,pool,compatibility){this.componentName=componentName;this.pool=pool;this.compatibility=compatibility;this.kind=CompilationJobKind.Both;this.nextXrefId=0}allocateXrefId(){return this.nextXrefId++}}class ComponentCompilationJob extends CompilationJob{constructor(componentName,pool,compatibility,relativeContextFilePath,i18nUseExternalIds,deferBlocksMeta,allDeferrableDepsFn){super(componentName,pool,compatibility);this.relativeContextFilePath=relativeContextFilePath;this.i18nUseExternalIds=i18nUseExternalIds;this.deferBlocksMeta=deferBlocksMeta;this.allDeferrableDepsFn=allDeferrableDepsFn;this.kind=CompilationJobKind.Tmpl;this.fnSuffix="Template";this.views=new Map;this.contentSelectors=null;this.consts=[];this.constsInitializers=[];this.root=new ViewCompilationUnit(this,this.allocateXrefId(),null);this.views.set(this.root.xref,this.root)}allocateView(parent){const view=new ViewCompilationUnit(this,this.allocateXrefId(),parent);this.views.set(view.xref,view);return view}get units(){return this.views.values()}addConst(newConst,initializers){for(let idx=0;idx<this.consts.length;idx++){if(this.consts[idx].isEquivalent(newConst)){return idx}}const idx=this.consts.length;this.consts.push(newConst);if(initializers){this.constsInitializers.push(...initializers)}return idx}}class CompilationUnit{constructor(xref){this.xref=xref;this.create=new OpList;this.update=new OpList;this.fnName=null;this.vars=null}*ops(){for(const op of this.create){yield op;if(op.kind===OpKind.Listener||op.kind===OpKind.TwoWayListener){for(const listenerOp of op.handlerOps){yield listenerOp}}}for(const op of this.update){yield op}}}class ViewCompilationUnit extends CompilationUnit{constructor(job,xref,parent){super(xref);this.job=job;this.parent=parent;this.contextVariables=new Map;this.aliases=new Set;this.decls=null}}class HostBindingCompilationJob extends CompilationJob{constructor(componentName,pool,compatibility){super(componentName,pool,compatibility);this.kind=CompilationJobKind.Host;this.fnSuffix="HostBindings";this.root=new HostBindingCompilationUnit(this)}get units(){return[this.root]}}class HostBindingCompilationUnit extends CompilationUnit{constructor(job){super(0);this.job=job;this.attributes=null}}function deleteAnyCasts(job){for(const unit of job.units){for(const op of unit.ops()){transformExpressionsInOp(op,removeAnys,VisitorContextFlag.None)}}}function removeAnys(e){if(e instanceof InvokeFunctionExpr&&e.fn instanceof LexicalReadExpr&&e.fn.name==="$any"){if(e.args.length!==1){throw new Error("The $any builtin function expects exactly one argument.")}return e.args[0]}return e}function applyI18nExpressions(job){const i18nContexts=new Map;for(const unit of job.units){for(const op of unit.create){if(op.kind===OpKind.I18nContext){i18nContexts.set(op.xref,op)}}}for(const unit of job.units){for(const op of unit.update){if(op.kind===OpKind.I18nExpression&&needsApplication(i18nContexts,op)){OpList.insertAfter(createI18nApplyOp(op.i18nOwner,op.handle,null),op)}}}}function needsApplication(i18nContexts,op){if(op.next?.kind!==OpKind.I18nExpression){return true}const context=i18nContexts.get(op.context);const nextContext=i18nContexts.get(op.next.context);if(context===undefined){throw new Error("AssertionError: expected an I18nContextOp to exist for the I18nExpressionOp's context")}if(nextContext===undefined){throw new Error("AssertionError: expected an I18nContextOp to exist for the next I18nExpressionOp's context")}if(context.i18nBlock!==null){if(context.i18nBlock!==nextContext.i18nBlock){return true}return false}if(op.i18nOwner!==op.next.i18nOwner){return true}return false}function assignI18nSlotDependencies(job){for(const unit of job.units){let updateOp=unit.update.head;let i18nExpressionsInProgress=[];let state=null;for(const createOp of unit.create){if(createOp.kind===OpKind.I18nStart){state={blockXref:createOp.xref,lastSlotConsumer:createOp.xref}}else if(createOp.kind===OpKind.I18nEnd){for(const op of i18nExpressionsInProgress){op.target=state.lastSlotConsumer;OpList.insertBefore(op,updateOp)}i18nExpressionsInProgress.length=0;state=null}if(hasConsumesSlotTrait(createOp)){if(state!==null){state.lastSlotConsumer=createOp.xref}while(true){if(updateOp.next===null){break}if(state!==null&&updateOp.kind===OpKind.I18nExpression&&updateOp.usage===I18nExpressionFor.I18nText&&updateOp.i18nOwner===state.blockXref){const opToRemove=updateOp;updateOp=updateOp.next;OpList.remove(opToRemove);i18nExpressionsInProgress.push(opToRemove);continue}if(hasDependsOnSlotContextTrait(updateOp)&&updateOp.target!==createOp.xref){break}updateOp=updateOp.next}}}}}function createOpXrefMap(unit){const map=new Map;for(const op of unit.create){if(!hasConsumesSlotTrait(op)){continue}map.set(op.xref,op);if(op.kind===OpKind.RepeaterCreate&&op.emptyView!==null){map.set(op.emptyView,op)}}return map}function extractAttributes(job){for(const unit of job.units){const elements=createOpXrefMap(unit);for(const op of unit.ops()){switch(op.kind){case OpKind.Attribute:extractAttributeOp(unit,op,elements);break;case OpKind.Property:if(!op.isAnimationTrigger){let bindingKind;if(op.i18nMessage!==null&&op.templateKind===null){bindingKind=BindingKind.I18n}else if(op.isStructuralTemplateAttribute){bindingKind=BindingKind.Template}else{bindingKind=BindingKind.Property}OpList.insertBefore(createExtractedAttributeOp(op.target,bindingKind,null,op.name,null,null,null,op.securityContext),lookupElement$2(elements,op.target))}break;case OpKind.TwoWayProperty:OpList.insertBefore(createExtractedAttributeOp(op.target,BindingKind.TwoWayProperty,null,op.name,null,null,null,op.securityContext),lookupElement$2(elements,op.target));break;case OpKind.StyleProp:case OpKind.ClassProp:if(unit.job.compatibility===CompatibilityMode.TemplateDefinitionBuilder&&op.expression instanceof EmptyExpr){OpList.insertBefore(createExtractedAttributeOp(op.target,BindingKind.Property,null,op.name,null,null,null,SecurityContext.STYLE),lookupElement$2(elements,op.target))}break;case OpKind.Listener:if(!op.isAnimationListener){const extractedAttributeOp=createExtractedAttributeOp(op.target,BindingKind.Property,null,op.name,null,null,null,SecurityContext.NONE);if(job.kind===CompilationJobKind.Host){if(job.compatibility){break}unit.create.push(extractedAttributeOp)}else{OpList.insertBefore(extractedAttributeOp,lookupElement$2(elements,op.target))}}break;case OpKind.TwoWayListener:if(job.kind!==CompilationJobKind.Host){const extractedAttributeOp=createExtractedAttributeOp(op.target,BindingKind.Property,null,op.name,null,null,null,SecurityContext.NONE);OpList.insertBefore(extractedAttributeOp,lookupElement$2(elements,op.target))}break}}}}function lookupElement$2(elements,xref){const el=elements.get(xref);if(el===undefined){throw new Error("All attributes should have an element-like target.")}return el}function extractAttributeOp(unit,op,elements){if(op.expression instanceof Interpolation){return}let extractable=op.isTextAttribute||op.expression.isConstant();if(unit.job.compatibility===CompatibilityMode.TemplateDefinitionBuilder){extractable&&=op.isTextAttribute}if(extractable){const extractedAttributeOp=createExtractedAttributeOp(op.target,op.isStructuralTemplateAttribute?BindingKind.Template:BindingKind.Attribute,op.namespace,op.name,op.expression,op.i18nContext,op.i18nMessage,op.securityContext);if(unit.job.kind===CompilationJobKind.Host){unit.create.push(extractedAttributeOp)}else{const ownerOp=lookupElement$2(elements,op.target);OpList.insertBefore(extractedAttributeOp,ownerOp)}OpList.remove(op)}}function lookupElement$1(elements,xref){const el=elements.get(xref);if(el===undefined){throw new Error("All attributes should have an element-like target.")}return el}function specializeBindings(job){const elements=new Map;for(const unit of job.units){for(const op of unit.create){if(!isElementOrContainerOp(op)){continue}elements.set(op.xref,op)}}for(const unit of job.units){for(const op of unit.ops()){if(op.kind!==OpKind.Binding){continue}switch(op.bindingKind){case BindingKind.Attribute:if(op.name==="ngNonBindable"){OpList.remove(op);const target=lookupElement$1(elements,op.target);target.nonBindable=true}else{const[namespace,name]=splitNsName(op.name);OpList.replace(op,createAttributeOp(op.target,namespace,name,op.expression,op.securityContext,op.isTextAttribute,op.isStructuralTemplateAttribute,op.templateKind,op.i18nMessage,op.sourceSpan))}break;case BindingKind.Property:case BindingKind.Animation:if(job.kind===CompilationJobKind.Host){OpList.replace(op,createHostPropertyOp(op.name,op.expression,op.bindingKind===BindingKind.Animation,op.i18nContext,op.securityContext,op.sourceSpan))}else{OpList.replace(op,createPropertyOp(op.target,op.name,op.expression,op.bindingKind===BindingKind.Animation,op.securityContext,op.isStructuralTemplateAttribute,op.templateKind,op.i18nContext,op.i18nMessage,op.sourceSpan))}break;case BindingKind.TwoWayProperty:if(!(op.expression instanceof Expression)){throw new Error(`Expected value of two-way property binding "${op.name}" to be an expression`)}OpList.replace(op,createTwoWayPropertyOp(op.target,op.name,op.expression,op.securityContext,op.isStructuralTemplateAttribute,op.templateKind,op.i18nContext,op.i18nMessage,op.sourceSpan));break;case BindingKind.I18n:case BindingKind.ClassName:case BindingKind.StyleProperty:throw new Error(`Unhandled binding of kind ${BindingKind[op.bindingKind]}`)}}}}const CHAINABLE=new Set([Identifiers.attribute,Identifiers.classProp,Identifiers.element,Identifiers.elementContainer,Identifiers.elementContainerEnd,Identifiers.elementContainerStart,Identifiers.elementEnd,Identifiers.elementStart,Identifiers.hostProperty,Identifiers.i18nExp,Identifiers.listener,Identifiers.listener,Identifiers.property,Identifiers.styleProp,Identifiers.stylePropInterpolate1,Identifiers.stylePropInterpolate2,Identifiers.stylePropInterpolate3,Identifiers.stylePropInterpolate4,Identifiers.stylePropInterpolate5,Identifiers.stylePropInterpolate6,Identifiers.stylePropInterpolate7,Identifiers.stylePropInterpolate8,Identifiers.stylePropInterpolateV,Identifiers.syntheticHostListener,Identifiers.syntheticHostProperty,Identifiers.templateCreate,Identifiers.twoWayProperty,Identifiers.twoWayListener]);function chain(job){for(const unit of job.units){chainOperationsInList(unit.create);chainOperationsInList(unit.update)}}function chainOperationsInList(opList){let chain=null;for(const op of opList){if(op.kind!==OpKind.Statement||!(op.statement instanceof ExpressionStatement)){chain=null;continue}if(!(op.statement.expr instanceof InvokeFunctionExpr)||!(op.statement.expr.fn instanceof ExternalExpr)){chain=null;continue}const instruction=op.statement.expr.fn.value;if(!CHAINABLE.has(instruction)){chain=null;continue}if(chain!==null&&chain.instruction===instruction){const expression=chain.expression.callFn(op.statement.expr.args,op.statement.expr.sourceSpan,op.statement.expr.pure);chain.expression=expression;chain.op.statement=expression.toStmt();OpList.remove(op)}else{chain={op:op,instruction:instruction,expression:op.statement.expr}}}}function collapseSingletonInterpolations(job){for(const unit of job.units){for(const op of unit.update){const eligibleOpKind=op.kind===OpKind.Attribute;if(eligibleOpKind&&op.expression instanceof Interpolation&&op.expression.strings.length===2&&op.expression.strings.every((s=>s===""))){op.expression=op.expression.expressions[0]}}}}function generateConditionalExpressions(job){for(const unit of job.units){for(const op of unit.ops()){if(op.kind!==OpKind.Conditional){continue}let test;const defaultCase=op.conditions.findIndex((cond=>cond.expr===null));if(defaultCase>=0){const slot=op.conditions.splice(defaultCase,1)[0].targetSlot;test=new SlotLiteralExpr(slot)}else{test=literal(-1)}let tmp=op.test==null?null:new AssignTemporaryExpr(op.test,job.allocateXrefId());for(let i=op.conditions.length-1;i>=0;i--){let conditionalCase=op.conditions[i];if(conditionalCase.expr===null){continue}if(tmp!==null){const useTmp=i===0?tmp:new ReadTemporaryExpr(tmp.xref);conditionalCase.expr=new BinaryOperatorExpr(exports.BinaryOperator.Identical,useTmp,conditionalCase.expr)}else if(conditionalCase.alias!==null){const caseExpressionTemporaryXref=job.allocateXrefId();conditionalCase.expr=new AssignTemporaryExpr(conditionalCase.expr,caseExpressionTemporaryXref);op.contextValue=new ReadTemporaryExpr(caseExpressionTemporaryXref)}test=new ConditionalExpr(conditionalCase.expr,new SlotLiteralExpr(conditionalCase.targetSlot),test)}op.processed=test;op.conditions=[]}}}const BINARY_OPERATORS=new Map([["&&",exports.BinaryOperator.And],[">",exports.BinaryOperator.Bigger],[">=",exports.BinaryOperator.BiggerEquals],["|",exports.BinaryOperator.BitwiseOr],["&",exports.BinaryOperator.BitwiseAnd],["/",exports.BinaryOperator.Divide],["==",exports.BinaryOperator.Equals],["===",exports.BinaryOperator.Identical],["<",exports.BinaryOperator.Lower],["<=",exports.BinaryOperator.LowerEquals],["-",exports.BinaryOperator.Minus],["%",exports.BinaryOperator.Modulo],["*",exports.BinaryOperator.Multiply],["!=",exports.BinaryOperator.NotEquals],["!==",exports.BinaryOperator.NotIdentical],["??",exports.BinaryOperator.NullishCoalesce],["||",exports.BinaryOperator.Or],["+",exports.BinaryOperator.Plus]]);function namespaceForKey(namespacePrefixKey){const NAMESPACES=new Map([["svg",Namespace.SVG],["math",Namespace.Math]]);if(namespacePrefixKey===null){return Namespace.HTML}return NAMESPACES.get(namespacePrefixKey)??Namespace.HTML}function keyForNamespace(namespace){const NAMESPACES=new Map([["svg",Namespace.SVG],["math",Namespace.Math]]);for(const[k,n]of NAMESPACES.entries()){if(n===namespace){return k}}return null}function prefixWithNamespace(strippedTag,namespace){if(namespace===Namespace.HTML){return strippedTag}return`:${keyForNamespace(namespace)}:${strippedTag}`}function literalOrArrayLiteral(value){if(Array.isArray(value)){return literalArr(value.map(literalOrArrayLiteral))}return literal(value)}function collectElementConsts(job){const allElementAttributes=new Map;for(const unit of job.units){for(const op of unit.create){if(op.kind===OpKind.ExtractedAttribute){const attributes=allElementAttributes.get(op.target)||new ElementAttributes(job.compatibility);allElementAttributes.set(op.target,attributes);attributes.add(op.bindingKind,op.name,op.expression,op.namespace,op.trustedValueFn);OpList.remove(op)}}}if(job instanceof ComponentCompilationJob){for(const unit of job.units){for(const op of unit.create){if(op.kind==OpKind.Projection){const attributes=allElementAttributes.get(op.xref);if(attributes!==undefined){const attrArray=serializeAttributes(attributes);if(attrArray.entries.length>0){op.attributes=attrArray}}}else if(isElementOrContainerOp(op)){op.attributes=getConstIndex(job,allElementAttributes,op.xref);if(op.kind===OpKind.RepeaterCreate&&op.emptyView!==null){op.emptyAttributes=getConstIndex(job,allElementAttributes,op.emptyView)}}}}}else if(job instanceof HostBindingCompilationJob){for(const[xref,attributes]of allElementAttributes.entries()){if(xref!==job.root.xref){throw new Error(`An attribute would be const collected into the host binding's template function, but is not associated with the root xref.`)}const attrArray=serializeAttributes(attributes);if(attrArray.entries.length>0){job.root.attributes=attrArray}}}}function getConstIndex(job,allElementAttributes,xref){const attributes=allElementAttributes.get(xref);if(attributes!==undefined){const attrArray=serializeAttributes(attributes);if(attrArray.entries.length>0){return job.addConst(attrArray)}}return null}const FLYWEIGHT_ARRAY=Object.freeze([]);class ElementAttributes{get attributes(){return this.byKind.get(BindingKind.Attribute)??FLYWEIGHT_ARRAY}get classes(){return this.byKind.get(BindingKind.ClassName)??FLYWEIGHT_ARRAY}get styles(){return this.byKind.get(BindingKind.StyleProperty)??FLYWEIGHT_ARRAY}get bindings(){return this.propertyBindings??FLYWEIGHT_ARRAY}get template(){return this.byKind.get(BindingKind.Template)??FLYWEIGHT_ARRAY}get i18n(){return this.byKind.get(BindingKind.I18n)??FLYWEIGHT_ARRAY}constructor(compatibility){this.compatibility=compatibility;this.known=new Map;this.byKind=new Map;this.propertyBindings=null;this.projectAs=null}isKnown(kind,name){const nameToValue=this.known.get(kind)??new Set;this.known.set(kind,nameToValue);if(nameToValue.has(name)){return true}nameToValue.add(name);return false}add(kind,name,value,namespace,trustedValueFn){const allowDuplicates=this.compatibility===CompatibilityMode.TemplateDefinitionBuilder&&(kind===BindingKind.Attribute||kind===BindingKind.ClassName||kind===BindingKind.StyleProperty);if(!allowDuplicates&&this.isKnown(kind,name)){return}if(name==="ngProjectAs"){if(value===null||!(value instanceof LiteralExpr)||value.value==null||typeof value.value?.toString()!=="string"){throw Error("ngProjectAs must have a string literal value")}this.projectAs=value.value.toString()}const array=this.arrayFor(kind);array.push(...getAttributeNameLiterals$1(namespace,name));if(kind===BindingKind.Attribute||kind===BindingKind.StyleProperty){if(value===null){throw Error("Attribute, i18n attribute, & style element attributes must have a value")}if(trustedValueFn!==null){if(!isStringLiteral(value)){throw Error("AssertionError: extracted attribute value should be string literal")}array.push(taggedTemplate(trustedValueFn,new TemplateLiteral([new TemplateLiteralElement(value.value)],[]),undefined,value.sourceSpan))}else{array.push(value)}}}arrayFor(kind){if(kind===BindingKind.Property||kind===BindingKind.TwoWayProperty){this.propertyBindings??=[];return this.propertyBindings}else{if(!this.byKind.has(kind)){this.byKind.set(kind,[])}return this.byKind.get(kind)}}}function getAttributeNameLiterals$1(namespace,name){const nameLiteral=literal(name);if(namespace){return[literal(0),literal(namespace),nameLiteral]}return[nameLiteral]}function serializeAttributes({attributes:attributes,bindings:bindings,classes:classes,i18n:i18n,projectAs:projectAs,styles:styles,template:template}){const attrArray=[...attributes];if(projectAs!==null){const parsedR3Selector=parseSelectorToR3Selector(projectAs)[0];attrArray.push(literal(5),literalOrArrayLiteral(parsedR3Selector))}if(classes.length>0){attrArray.push(literal(1),...classes)}if(styles.length>0){attrArray.push(literal(2),...styles)}if(bindings.length>0){attrArray.push(literal(3),...bindings)}if(template.length>0){attrArray.push(literal(4),...template)}if(i18n.length>0){attrArray.push(literal(6),...i18n)}return literalArr(attrArray)}function convertI18nBindings(job){const i18nAttributesByElem=new Map;for(const unit of job.units){for(const op of unit.create){if(op.kind===OpKind.I18nAttributes){i18nAttributesByElem.set(op.target,op)}}for(const op of unit.update){switch(op.kind){case OpKind.Property:case OpKind.Attribute:if(op.i18nContext===null){continue}if(!(op.expression instanceof Interpolation)){continue}const i18nAttributesForElem=i18nAttributesByElem.get(op.target);if(i18nAttributesForElem===undefined){throw new Error("AssertionError: An i18n attribute binding instruction requires the owning element to have an I18nAttributes create instruction")}if(i18nAttributesForElem.target!==op.target){throw new Error("AssertionError: Expected i18nAttributes target element to match binding target element")}const ops=[];for(let i=0;i<op.expression.expressions.length;i++){const expr=op.expression.expressions[i];if(op.expression.i18nPlaceholders.length!==op.expression.expressions.length){throw new Error(`AssertionError: An i18n attribute binding instruction requires the same number of expressions and placeholders, but found ${op.expression.i18nPlaceholders.length} placeholders and ${op.expression.expressions.length} expressions`)}ops.push(createI18nExpressionOp(op.i18nContext,i18nAttributesForElem.target,i18nAttributesForElem.xref,i18nAttributesForElem.handle,expr,null,op.expression.i18nPlaceholders[i],I18nParamResolutionTime.Creation,I18nExpressionFor.I18nAttribute,op.name,op.sourceSpan))}OpList.replaceWithMany(op,ops);break}}}}function createDeferDepsFns(job){for(const unit of job.units){for(const op of unit.create){if(op.kind===OpKind.Defer){if(op.metadata.deps.length===0){continue}if(op.resolverFn!==null){continue}const dependencies=[];for(const dep of op.metadata.deps){if(dep.isDeferrable){const innerFn=arrowFn([new FnParam("m",DYNAMIC_TYPE)],variable("m").prop(dep.isDefaultImport?"default":dep.symbolName));const importExpr=new DynamicImportExpr(dep.importPath).prop("then").callFn([innerFn]);dependencies.push(importExpr)}else{dependencies.push(dep.type)}}const depsFnExpr=arrowFn([],literalArr(dependencies));if(op.handle.slot===null){throw new Error("AssertionError: slot must be assigned bfore extracting defer deps functions")}const fullPathName=unit.fnName?.replace(`_Template`,``);op.resolverFn=job.pool.getSharedFunctionReference(depsFnExpr,`${fullPathName}_Defer_${op.handle.slot}_DepsFn`,false)}}}}function createI18nContexts(job){const attrContextByMessage=new Map;for(const unit of job.units){for(const op of unit.ops()){switch(op.kind){case OpKind.Binding:case OpKind.Property:case OpKind.Attribute:case OpKind.ExtractedAttribute:if(op.i18nMessage===null){continue}if(!attrContextByMessage.has(op.i18nMessage)){const i18nContext=createI18nContextOp(I18nContextKind.Attr,job.allocateXrefId(),null,op.i18nMessage,null);unit.create.push(i18nContext);attrContextByMessage.set(op.i18nMessage,i18nContext.xref)}op.i18nContext=attrContextByMessage.get(op.i18nMessage);break}}}const blockContextByI18nBlock=new Map;for(const unit of job.units){for(const op of unit.create){switch(op.kind){case OpKind.I18nStart:if(op.xref===op.root){const contextOp=createI18nContextOp(I18nContextKind.RootI18n,job.allocateXrefId(),op.xref,op.message,null);unit.create.push(contextOp);op.context=contextOp.xref;blockContextByI18nBlock.set(op.xref,contextOp)}break}}}for(const unit of job.units){for(const op of unit.create){if(op.kind===OpKind.I18nStart&&op.xref!==op.root){const rootContext=blockContextByI18nBlock.get(op.root);if(rootContext===undefined){throw Error("AssertionError: Root i18n block i18n context should have been created.")}op.context=rootContext.xref;blockContextByI18nBlock.set(op.xref,rootContext)}}}let currentI18nOp=null;for(const unit of job.units){for(const op of unit.create){switch(op.kind){case OpKind.I18nStart:currentI18nOp=op;break;case OpKind.I18nEnd:currentI18nOp=null;break;case OpKind.IcuStart:if(currentI18nOp===null){throw Error("AssertionError: Unexpected ICU outside of an i18n block.")}if(op.message.id!==currentI18nOp.message.id){const contextOp=createI18nContextOp(I18nContextKind.Icu,job.allocateXrefId(),currentI18nOp.root,op.message,null);unit.create.push(contextOp);op.context=contextOp.xref}else{op.context=currentI18nOp.context;blockContextByI18nBlock.get(currentI18nOp.xref).contextKind=I18nContextKind.Icu}break}}}}function deduplicateTextBindings(job){const seen=new Map;for(const unit of job.units){for(const op of unit.update.reversed()){if(op.kind===OpKind.Binding&&op.isTextAttribute){const seenForElement=seen.get(op.target)||new Set;if(seenForElement.has(op.name)){if(job.compatibility===CompatibilityMode.TemplateDefinitionBuilder){if(op.name==="style"||op.name==="class"){OpList.remove(op)}}}seenForElement.add(op.name);seen.set(op.target,seenForElement)}}}}function configureDeferInstructions(job){for(const unit of job.units){for(const op of unit.create){if(op.kind!==OpKind.Defer){continue}if(op.placeholderMinimumTime!==null){op.placeholderConfig=new ConstCollectedExpr(literalOrArrayLiteral([op.placeholderMinimumTime]))}if(op.loadingMinimumTime!==null||op.loadingAfterTime!==null){op.loadingConfig=new ConstCollectedExpr(literalOrArrayLiteral([op.loadingMinimumTime,op.loadingAfterTime]))}}}}function resolveDeferTargetNames(job){const scopes=new Map;function getScopeForView(view){if(scopes.has(view.xref)){return scopes.get(view.xref)}const scope=new Scope$1;for(const op of view.create){if(!isElementOrContainerOp(op)||op.localRefs===null){continue}if(!Array.isArray(op.localRefs)){throw new Error("LocalRefs were already processed, but were needed to resolve defer targets.")}for(const ref of op.localRefs){if(ref.target!==""){continue}scope.targets.set(ref.name,{xref:op.xref,slot:op.handle})}}scopes.set(view.xref,scope);return scope}function resolveTrigger(deferOwnerView,op,placeholderView){switch(op.trigger.kind){case DeferTriggerKind.Idle:case DeferTriggerKind.Immediate:case DeferTriggerKind.Timer:return;case DeferTriggerKind.Hover:case DeferTriggerKind.Interaction:case DeferTriggerKind.Viewport:if(op.trigger.targetName===null){if(placeholderView===null){throw new Error("defer on trigger with no target name must have a placeholder block")}const placeholder=job.views.get(placeholderView);if(placeholder==undefined){throw new Error("AssertionError: could not find placeholder view for defer on trigger")}for(const placeholderOp of placeholder.create){if(hasConsumesSlotTrait(placeholderOp)&&(isElementOrContainerOp(placeholderOp)||placeholderOp.kind===OpKind.Projection)){op.trigger.targetXref=placeholderOp.xref;op.trigger.targetView=placeholderView;op.trigger.targetSlotViewSteps=-1;op.trigger.targetSlot=placeholderOp.handle;return}}return}let view=placeholderView!==null?job.views.get(placeholderView):deferOwnerView;let step=placeholderView!==null?-1:0;while(view!==null){const scope=getScopeForView(view);if(scope.targets.has(op.trigger.targetName)){const{xref:xref,slot:slot}=scope.targets.get(op.trigger.targetName);op.trigger.targetXref=xref;op.trigger.targetView=view.xref;op.trigger.targetSlotViewSteps=step;op.trigger.targetSlot=slot;return}view=view.parent!==null?job.views.get(view.parent):null;step++}break;default:throw new Error(`Trigger kind ${op.trigger.kind} not handled`)}}for(const unit of job.units){const defers=new Map;for(const op of unit.create){switch(op.kind){case OpKind.Defer:defers.set(op.xref,op);break;case OpKind.DeferOn:const deferOp=defers.get(op.defer);resolveTrigger(unit,op,deferOp.placeholderView);break}}}}class Scope$1{constructor(){this.targets=new Map}}const REPLACEMENTS=new Map([[OpKind.ElementEnd,[OpKind.ElementStart,OpKind.Element]],[OpKind.ContainerEnd,[OpKind.ContainerStart,OpKind.Container]],[OpKind.I18nEnd,[OpKind.I18nStart,OpKind.I18n]]]);const IGNORED_OP_KINDS=new Set([OpKind.Pipe]);function collapseEmptyInstructions(job){for(const unit of job.units){for(const op of unit.create){const opReplacements=REPLACEMENTS.get(op.kind);if(opReplacements===undefined){continue}const[startKind,mergedKind]=opReplacements;let prevOp=op.prev;while(prevOp!==null&&IGNORED_OP_KINDS.has(prevOp.kind)){prevOp=prevOp.prev}if(prevOp!==null&&prevOp.kind===startKind){prevOp.kind=mergedKind;OpList.remove(op)}}}}function expandSafeReads(job){for(const unit of job.units){for(const op of unit.ops()){transformExpressionsInOp(op,(e=>safeTransform(e,{job:job})),VisitorContextFlag.None);transformExpressionsInOp(op,ternaryTransform,VisitorContextFlag.None)}}}[InvokeFunctionExpr,LiteralArrayExpr,LiteralMapExpr,SafeInvokeFunctionExpr,PipeBindingExpr].map((e=>e.constructor.name));function needsTemporaryInSafeAccess(e){if(e instanceof UnaryOperatorExpr){return needsTemporaryInSafeAccess(e.expr)}else if(e instanceof BinaryOperatorExpr){return needsTemporaryInSafeAccess(e.lhs)||needsTemporaryInSafeAccess(e.rhs)}else if(e instanceof ConditionalExpr){if(e.falseCase&&needsTemporaryInSafeAccess(e.falseCase))return true;return needsTemporaryInSafeAccess(e.condition)||needsTemporaryInSafeAccess(e.trueCase)}else if(e instanceof NotExpr){return needsTemporaryInSafeAccess(e.condition)}else if(e instanceof AssignTemporaryExpr){return needsTemporaryInSafeAccess(e.expr)}else if(e instanceof ReadPropExpr){return needsTemporaryInSafeAccess(e.receiver)}else if(e instanceof ReadKeyExpr){return needsTemporaryInSafeAccess(e.receiver)||needsTemporaryInSafeAccess(e.index)}return e instanceof InvokeFunctionExpr||e instanceof LiteralArrayExpr||e instanceof LiteralMapExpr||e instanceof SafeInvokeFunctionExpr||e instanceof PipeBindingExpr}function temporariesIn(e){const temporaries=new Set;transformExpressionsInExpression(e,(e=>{if(e instanceof AssignTemporaryExpr){temporaries.add(e.xref)}return e}),VisitorContextFlag.None);return temporaries}function eliminateTemporaryAssignments(e,tmps,ctx){transformExpressionsInExpression(e,(e=>{if(e instanceof AssignTemporaryExpr&&tmps.has(e.xref)){const read=new ReadTemporaryExpr(e.xref);return ctx.job.compatibility===CompatibilityMode.TemplateDefinitionBuilder?new AssignTemporaryExpr(read,read.xref):read}return e}),VisitorContextFlag.None);return e}function safeTernaryWithTemporary(guard,body,ctx){let result;if(needsTemporaryInSafeAccess(guard)){const xref=ctx.job.allocateXrefId();result=[new AssignTemporaryExpr(guard,xref),new ReadTemporaryExpr(xref)]}else{result=[guard,guard.clone()];eliminateTemporaryAssignments(result[1],temporariesIn(result[0]),ctx)}return new SafeTernaryExpr(result[0],body(result[1]))}function isSafeAccessExpression(e){return e instanceof SafePropertyReadExpr||e instanceof SafeKeyedReadExpr||e instanceof SafeInvokeFunctionExpr}function isUnsafeAccessExpression(e){return e instanceof ReadPropExpr||e instanceof ReadKeyExpr||e instanceof InvokeFunctionExpr}function isAccessExpression(e){return isSafeAccessExpression(e)||isUnsafeAccessExpression(e)}function deepestSafeTernary(e){if(isAccessExpression(e)&&e.receiver instanceof SafeTernaryExpr){let st=e.receiver;while(st.expr instanceof SafeTernaryExpr){st=st.expr}return st}return null}function safeTransform(e,ctx){if(!isAccessExpression(e)){return e}const dst=deepestSafeTernary(e);if(dst){if(e instanceof InvokeFunctionExpr){dst.expr=dst.expr.callFn(e.args);return e.receiver}if(e instanceof ReadPropExpr){dst.expr=dst.expr.prop(e.name);return e.receiver}if(e instanceof ReadKeyExpr){dst.expr=dst.expr.key(e.index);return e.receiver}if(e instanceof SafeInvokeFunctionExpr){dst.expr=safeTernaryWithTemporary(dst.expr,(r=>r.callFn(e.args)),ctx);return e.receiver}if(e instanceof SafePropertyReadExpr){dst.expr=safeTernaryWithTemporary(dst.expr,(r=>r.prop(e.name)),ctx);return e.receiver}if(e instanceof SafeKeyedReadExpr){dst.expr=safeTernaryWithTemporary(dst.expr,(r=>r.key(e.index)),ctx);return e.receiver}}else{if(e instanceof SafeInvokeFunctionExpr){return safeTernaryWithTemporary(e.receiver,(r=>r.callFn(e.args)),ctx)}if(e instanceof SafePropertyReadExpr){return safeTernaryWithTemporary(e.receiver,(r=>r.prop(e.name)),ctx)}if(e instanceof SafeKeyedReadExpr){return safeTernaryWithTemporary(e.receiver,(r=>r.key(e.index)),ctx)}}return e}function ternaryTransform(e){if(!(e instanceof SafeTernaryExpr)){return e}return new ConditionalExpr(new BinaryOperatorExpr(exports.BinaryOperator.Equals,e.guard,NULL_EXPR),NULL_EXPR,e.expr)}const ESCAPE$1="\ufffd";const ELEMENT_MARKER="#";const TEMPLATE_MARKER="*";const TAG_CLOSE_MARKER="/";const CONTEXT_MARKER=":";const LIST_START_MARKER="[";const LIST_END_MARKER="]";const LIST_DELIMITER="|";function extractI18nMessages(job){const i18nMessagesByContext=new Map;const i18nBlocks=new Map;const i18nContexts=new Map;for(const unit of job.units){for(const op of unit.create){switch(op.kind){case OpKind.I18nContext:const i18nMessageOp=createI18nMessage(job,op);unit.create.push(i18nMessageOp);i18nMessagesByContext.set(op.xref,i18nMessageOp);i18nContexts.set(op.xref,op);break;case OpKind.I18nStart:i18nBlocks.set(op.xref,op);break}}}let currentIcu=null;for(const unit of job.units){for(const op of unit.create){switch(op.kind){case OpKind.IcuStart:currentIcu=op;OpList.remove(op);const icuContext=i18nContexts.get(op.context);if(icuContext.contextKind!==I18nContextKind.Icu){continue}const i18nBlock=i18nBlocks.get(icuContext.i18nBlock);if(i18nBlock.context===icuContext.xref){continue}const rootI18nBlock=i18nBlocks.get(i18nBlock.root);const rootMessage=i18nMessagesByContext.get(rootI18nBlock.context);if(rootMessage===undefined){throw Error("AssertionError: ICU sub-message should belong to a root message.")}const subMessage=i18nMessagesByContext.get(icuContext.xref);subMessage.messagePlaceholder=op.messagePlaceholder;rootMessage.subMessages.push(subMessage.xref);break;case OpKind.IcuEnd:currentIcu=null;OpList.remove(op);break;case OpKind.IcuPlaceholder:if(currentIcu===null||currentIcu.context==null){throw Error("AssertionError: Unexpected ICU placeholder outside of i18n context")}const msg=i18nMessagesByContext.get(currentIcu.context);msg.postprocessingParams.set(op.name,literal(formatIcuPlaceholder(op)));OpList.remove(op);break}}}}function createI18nMessage(job,context,messagePlaceholder){let formattedParams=formatParams(context.params);const formattedPostprocessingParams=formatParams(context.postprocessingParams);let needsPostprocessing=[...context.params.values()].some((v=>v.length>1));return createI18nMessageOp(job.allocateXrefId(),context.xref,context.i18nBlock,context.message,null,formattedParams,formattedPostprocessingParams,needsPostprocessing)}function formatIcuPlaceholder(op){if(op.strings.length!==op.expressionPlaceholders.length+1){throw Error(`AssertionError: Invalid ICU placeholder with ${op.strings.length} strings and ${op.expressionPlaceholders.length} expressions`)}const values=op.expressionPlaceholders.map(formatValue);return op.strings.flatMap(((str,i)=>[str,values[i]||""])).join("")}function formatParams(params){const formattedParams=new Map;for(const[placeholder,placeholderValues]of params){const serializedValues=formatParamValues(placeholderValues);if(serializedValues!==null){formattedParams.set(placeholder,literal(serializedValues))}}return formattedParams}function formatParamValues(values){if(values.length===0){return null}const serializedValues=values.map((value=>formatValue(value)));return serializedValues.length===1?serializedValues[0]:`${LIST_START_MARKER}${serializedValues.join(LIST_DELIMITER)}${LIST_END_MARKER}`}function formatValue(value){if(value.flags&I18nParamValueFlags.ElementTag&&value.flags&I18nParamValueFlags.TemplateTag){if(typeof value.value!=="object"){throw Error("AssertionError: Expected i18n param value to have an element and template slot")}const elementValue=formatValue({...value,value:value.value.element,flags:value.flags&~I18nParamValueFlags.TemplateTag});const templateValue=formatValue({...value,value:value.value.template,flags:value.flags&~I18nParamValueFlags.ElementTag});if(value.flags&I18nParamValueFlags.OpenTag&&value.flags&I18nParamValueFlags.CloseTag){return`${templateValue}${elementValue}${templateValue}`}return value.flags&I18nParamValueFlags.CloseTag?`${elementValue}${templateValue}`:`${templateValue}${elementValue}`}if(value.flags&I18nParamValueFlags.OpenTag&&value.flags&I18nParamValueFlags.CloseTag){return`${formatValue({...value,flags:value.flags&~I18nParamValueFlags.CloseTag})}${formatValue({...value,flags:value.flags&~I18nParamValueFlags.OpenTag})}`}if(value.flags===I18nParamValueFlags.None){return`${value.value}`}let tagMarker="";let closeMarker="";if(value.flags&I18nParamValueFlags.ElementTag){tagMarker=ELEMENT_MARKER}else if(value.flags&I18nParamValueFlags.TemplateTag){tagMarker=TEMPLATE_MARKER}if(tagMarker!==""){closeMarker=value.flags&I18nParamValueFlags.CloseTag?TAG_CLOSE_MARKER:""}const context=value.subTemplateIndex===null?"":`${CONTEXT_MARKER}${value.subTemplateIndex}`;return`${ESCAPE$1}${closeMarker}${tagMarker}${value.value}${context}${ESCAPE$1}`}function generateAdvance(job){for(const unit of job.units){const slotMap=new Map;for(const op of unit.create){if(!hasConsumesSlotTrait(op)){continue}else if(op.handle.slot===null){throw new Error(`AssertionError: expected slots to have been allocated before generating advance() calls`)}slotMap.set(op.xref,op.handle.slot)}let slotContext=0;for(const op of unit.update){if(!hasDependsOnSlotContextTrait(op)){continue}else if(!slotMap.has(op.target)){throw new Error(`AssertionError: reference to unknown slot for target ${op.target}`)}const slot=slotMap.get(op.target);if(slotContext!==slot){const delta=slot-slotContext;if(delta<0){throw new Error(`AssertionError: slot counter should never need to move backwards`)}OpList.insertBefore(createAdvanceOp(delta,op.sourceSpan),op);slotContext=slot}}}}function generateProjectionDefs(job){const share=job.compatibility===CompatibilityMode.TemplateDefinitionBuilder;const selectors=[];let projectionSlotIndex=0;for(const unit of job.units){for(const op of unit.create){if(op.kind===OpKind.Projection){selectors.push(op.selector);op.projectionSlotIndex=projectionSlotIndex++}}}if(selectors.length>0){let defExpr=null;if(selectors.length>1||selectors[0]!=="*"){const def=selectors.map((s=>s==="*"?s:parseSelectorToR3Selector(s)));defExpr=job.pool.getConstLiteral(literalOrArrayLiteral(def),share)}job.contentSelectors=job.pool.getConstLiteral(literalOrArrayLiteral(selectors),share);job.root.create.prepend([createProjectionDefOp(defExpr)])}}function generateVariables(job){recursivelyProcessView(job.root,null)}function recursivelyProcessView(view,parentScope){const scope=getScopeForView(view,parentScope);for(const op of view.create){switch(op.kind){case OpKind.Template:recursivelyProcessView(view.job.views.get(op.xref),scope);break;case OpKind.RepeaterCreate:recursivelyProcessView(view.job.views.get(op.xref),scope);if(op.emptyView){recursivelyProcessView(view.job.views.get(op.emptyView),scope)}break;case OpKind.Listener:case OpKind.TwoWayListener:op.handlerOps.prepend(generateVariablesInScopeForView(view,scope));break}}const preambleOps=generateVariablesInScopeForView(view,scope);view.update.prepend(preambleOps)}function getScopeForView(view,parent){const scope={view:view.xref,viewContextVariable:{kind:SemanticVariableKind.Context,name:null,view:view.xref},contextVariables:new Map,aliases:view.aliases,references:[],parent:parent};for(const identifier of view.contextVariables.keys()){scope.contextVariables.set(identifier,{kind:SemanticVariableKind.Identifier,name:null,identifier:identifier})}for(const op of view.create){switch(op.kind){case OpKind.ElementStart:case OpKind.Template:if(!Array.isArray(op.localRefs)){throw new Error(`AssertionError: expected localRefs to be an array`)}for(let offset=0;offset<op.localRefs.length;offset++){scope.references.push({name:op.localRefs[offset].name,targetId:op.xref,targetSlot:op.handle,offset:offset,variable:{kind:SemanticVariableKind.Identifier,name:null,identifier:op.localRefs[offset].name}})}break}}return scope}function generateVariablesInScopeForView(view,scope){const newOps=[];if(scope.view!==view.xref){newOps.push(createVariableOp(view.job.allocateXrefId(),scope.viewContextVariable,new NextContextExpr,VariableFlags.None))}const scopeView=view.job.views.get(scope.view);for(const[name,value]of scopeView.contextVariables){const context=new ContextExpr(scope.view);const variable=value===CTX_REF?context:new ReadPropExpr(context,value);newOps.push(createVariableOp(view.job.allocateXrefId(),scope.contextVariables.get(name),variable,VariableFlags.None))}for(const alias of scopeView.aliases){newOps.push(createVariableOp(view.job.allocateXrefId(),alias,alias.expression.clone(),VariableFlags.AlwaysInline))}for(const ref of scope.references){newOps.push(createVariableOp(view.job.allocateXrefId(),ref.variable,new ReferenceExpr(ref.targetId,ref.targetSlot,ref.offset),VariableFlags.None))}if(scope.parent!==null){newOps.push(...generateVariablesInScopeForView(view,scope.parent))}return newOps}function collectConstExpressions(job){for(const unit of job.units){for(const op of unit.ops()){transformExpressionsInOp(op,(expr=>{if(!(expr instanceof ConstCollectedExpr)){return expr}return literal(job.addConst(expr.expr))}),VisitorContextFlag.None)}}}const STYLE_DOT="style.";const CLASS_DOT="class.";const STYLE_BANG="style!";const CLASS_BANG="class!";const BANG_IMPORTANT="!important";function parseHostStyleProperties(job){for(const op of job.root.update){if(!(op.kind===OpKind.Binding&&op.bindingKind===BindingKind.Property)){continue}if(op.name.endsWith(BANG_IMPORTANT)){op.name=op.name.substring(0,op.name.length-BANG_IMPORTANT.length)}if(op.name.startsWith(STYLE_DOT)){op.bindingKind=BindingKind.StyleProperty;op.name=op.name.substring(STYLE_DOT.length);if(!isCssCustomProperty$1(op.name)){op.name=hyphenate$1(op.name)}const{property:property,suffix:suffix}=parseProperty$1(op.name);op.name=property;op.unit=suffix}else if(op.name.startsWith(STYLE_BANG)){op.bindingKind=BindingKind.StyleProperty;op.name="style"}else if(op.name.startsWith(CLASS_DOT)){op.bindingKind=BindingKind.ClassName;op.name=parseProperty$1(op.name.substring(CLASS_DOT.length)).property}else if(op.name.startsWith(CLASS_BANG)){op.bindingKind=BindingKind.ClassName;op.name=parseProperty$1(op.name.substring(CLASS_BANG.length)).property}}}function isCssCustomProperty$1(name){return name.startsWith("--")}function hyphenate$1(value){return value.replace(/[a-z][A-Z]/g,(v=>v.charAt(0)+"-"+v.charAt(1))).toLowerCase()}function parseProperty$1(name){const overrideIndex=name.indexOf("!important");if(overrideIndex!==-1){name=overrideIndex>0?name.substring(0,overrideIndex):""}let suffix=null;let property=name;const unitIndex=name.lastIndexOf(".");if(unitIndex>0){suffix=name.slice(unitIndex+1);property=name.substring(0,unitIndex)}return{property:property,suffix:suffix}}function mapLiteral(obj,quoted=false){return literalMap(Object.keys(obj).map((key=>({key:key,quoted:quoted,value:obj[key]}))))}class IcuSerializerVisitor{visitText(text){return text.value}visitContainer(container){return container.children.map((child=>child.visit(this))).join("")}visitIcu(icu){const strCases=Object.keys(icu.cases).map((k=>`${k} {${icu.cases[k].visit(this)}}`));const result=`{${icu.expressionPlaceholder}, ${icu.type}, ${strCases.join(" ")}}`;return result}visitTagPlaceholder(ph){return ph.isVoid?this.formatPh(ph.startName):`${this.formatPh(ph.startName)}${ph.children.map((child=>child.visit(this))).join("")}${this.formatPh(ph.closeName)}`}visitPlaceholder(ph){return this.formatPh(ph.name)}visitBlockPlaceholder(ph){return`${this.formatPh(ph.startName)}${ph.children.map((child=>child.visit(this))).join("")}${this.formatPh(ph.closeName)}`}visitIcuPlaceholder(ph,context){return this.formatPh(ph.name)}formatPh(value){return`{${formatI18nPlaceholderName(value,false)}}`}}const serializer=new IcuSerializerVisitor;function serializeIcuNode(icu){return icu.visit(serializer)}exports.TokenType=void 0;(function(TokenType){TokenType[TokenType["Character"]=0]="Character";TokenType[TokenType["Identifier"]=1]="Identifier";TokenType[TokenType["PrivateIdentifier"]=2]="PrivateIdentifier";TokenType[TokenType["Keyword"]=3]="Keyword";TokenType[TokenType["String"]=4]="String";TokenType[TokenType["Operator"]=5]="Operator";TokenType[TokenType["Number"]=6]="Number";TokenType[TokenType["Error"]=7]="Error"})(exports.TokenType||(exports.TokenType={}));const KEYWORDS=["var","let","as","null","undefined","true","false","if","else","this"];class Lexer{tokenize(text){const scanner=new _Scanner(text);const tokens=[];let token=scanner.scanToken();while(token!=null){tokens.push(token);token=scanner.scanToken()}return tokens}}class Token{constructor(index,end,type,numValue,strValue){this.index=index;this.end=end;this.type=type;this.numValue=numValue;this.strValue=strValue}isCharacter(code){return this.type==exports.TokenType.Character&&this.numValue==code}isNumber(){return this.type==exports.TokenType.Number}isString(){return this.type==exports.TokenType.String}isOperator(operator){return this.type==exports.TokenType.Operator&&this.strValue==operator}isIdentifier(){return this.type==exports.TokenType.Identifier}isPrivateIdentifier(){return this.type==exports.TokenType.PrivateIdentifier}isKeyword(){return this.type==exports.TokenType.Keyword}isKeywordLet(){return this.type==exports.TokenType.Keyword&&this.strValue=="let"}isKeywordAs(){return this.type==exports.TokenType.Keyword&&this.strValue=="as"}isKeywordNull(){return this.type==exports.TokenType.Keyword&&this.strValue=="null"}isKeywordUndefined(){return this.type==exports.TokenType.Keyword&&this.strValue=="undefined"}isKeywordTrue(){return this.type==exports.TokenType.Keyword&&this.strValue=="true"}isKeywordFalse(){return this.type==exports.TokenType.Keyword&&this.strValue=="false"}isKeywordThis(){return this.type==exports.TokenType.Keyword&&this.strValue=="this"}isError(){return this.type==exports.TokenType.Error}toNumber(){return this.type==exports.TokenType.Number?this.numValue:-1}toString(){switch(this.type){case exports.TokenType.Character:case exports.TokenType.Identifier:case exports.TokenType.Keyword:case exports.TokenType.Operator:case exports.TokenType.PrivateIdentifier:case exports.TokenType.String:case exports.TokenType.Error:return this.strValue;case exports.TokenType.Number:return this.numValue.toString();default:return null}}}function newCharacterToken(index,end,code){return new Token(index,end,exports.TokenType.Character,code,String.fromCharCode(code))}function newIdentifierToken(index,end,text){return new Token(index,end,exports.TokenType.Identifier,0,text)}function newPrivateIdentifierToken(index,end,text){return new Token(index,end,exports.TokenType.PrivateIdentifier,0,text)}function newKeywordToken(index,end,text){return new Token(index,end,exports.TokenType.Keyword,0,text)}function newOperatorToken(index,end,text){return new Token(index,end,exports.TokenType.Operator,0,text)}function newStringToken(index,end,text){return new Token(index,end,exports.TokenType.String,0,text)}function newNumberToken(index,end,n){return new Token(index,end,exports.TokenType.Number,n,"")}function newErrorToken(index,end,message){return new Token(index,end,exports.TokenType.Error,0,message)}const EOF=new Token(-1,-1,exports.TokenType.Character,0,"");class _Scanner{constructor(input){this.input=input;this.peek=0;this.index=-1;this.length=input.length;this.advance()}advance(){this.peek=++this.index>=this.length?$EOF:this.input.charCodeAt(this.index)}scanToken(){const input=this.input,length=this.length;let peek=this.peek,index=this.index;while(peek<=$SPACE){if(++index>=length){peek=$EOF;break}else{peek=input.charCodeAt(index)}}this.peek=peek;this.index=index;if(index>=length){return null}if(isIdentifierStart(peek))return this.scanIdentifier();if(isDigit(peek))return this.scanNumber(index);const start=index;switch(peek){case $PERIOD:this.advance();return isDigit(this.peek)?this.scanNumber(start):newCharacterToken(start,this.index,$PERIOD);case $LPAREN:case $RPAREN:case $LBRACE:case $RBRACE:case $LBRACKET:case $RBRACKET:case $COMMA:case $COLON:case $SEMICOLON:return this.scanCharacter(start,peek);case $SQ:case $DQ:return this.scanString();case $HASH:return this.scanPrivateIdentifier();case $PLUS:case $MINUS:case $STAR:case $SLASH:case $PERCENT:case $CARET:return this.scanOperator(start,String.fromCharCode(peek));case $QUESTION:return this.scanQuestion(start);case $LT:case $GT:return this.scanComplexOperator(start,String.fromCharCode(peek),$EQ,"=");case $BANG:case $EQ:return this.scanComplexOperator(start,String.fromCharCode(peek),$EQ,"=",$EQ,"=");case $AMPERSAND:return this.scanComplexOperator(start,"&",$AMPERSAND,"&");case $BAR:return this.scanComplexOperator(start,"|",$BAR,"|");case $NBSP:while(isWhitespace(this.peek))this.advance();return this.scanToken()}this.advance();return this.error(`Unexpected character [${String.fromCharCode(peek)}]`,0)}scanCharacter(start,code){this.advance();return newCharacterToken(start,this.index,code)}scanOperator(start,str){this.advance();return newOperatorToken(start,this.index,str)}scanComplexOperator(start,one,twoCode,two,threeCode,three){this.advance();let str=one;if(this.peek==twoCode){this.advance();str+=two}if(threeCode!=null&&this.peek==threeCode){this.advance();str+=three}return newOperatorToken(start,this.index,str)}scanIdentifier(){const start=this.index;this.advance();while(isIdentifierPart(this.peek))this.advance();const str=this.input.substring(start,this.index);return KEYWORDS.indexOf(str)>-1?newKeywordToken(start,this.index,str):newIdentifierToken(start,this.index,str)}scanPrivateIdentifier(){const start=this.index;this.advance();if(!isIdentifierStart(this.peek)){return this.error("Invalid character [#]",-1)}while(isIdentifierPart(this.peek))this.advance();const identifierName=this.input.substring(start,this.index);return newPrivateIdentifierToken(start,this.index,identifierName)}scanNumber(start){let simple=this.index===start;let hasSeparators=false;this.advance();while(true){if(isDigit(this.peek));else if(this.peek===$_){if(!isDigit(this.input.charCodeAt(this.index-1))||!isDigit(this.input.charCodeAt(this.index+1))){return this.error("Invalid numeric separator",0)}hasSeparators=true}else if(this.peek===$PERIOD){simple=false}else if(isExponentStart(this.peek)){this.advance();if(isExponentSign(this.peek))this.advance();if(!isDigit(this.peek))return this.error("Invalid exponent",-1);simple=false}else{break}this.advance()}let str=this.input.substring(start,this.index);if(hasSeparators){str=str.replace(/_/g,"")}const value=simple?parseIntAutoRadix(str):parseFloat(str);return newNumberToken(start,this.index,value)}scanString(){const start=this.index;const quote=this.peek;this.advance();let buffer="";let marker=this.index;const input=this.input;while(this.peek!=quote){if(this.peek==$BACKSLASH){buffer+=input.substring(marker,this.index);let unescapedCode;this.advance();if(this.peek==$u){const hex=input.substring(this.index+1,this.index+5);if(/^[0-9a-f]+$/i.test(hex)){unescapedCode=parseInt(hex,16)}else{return this.error(`Invalid unicode escape [\\u${hex}]`,0)}for(let i=0;i<5;i++){this.advance()}}else{unescapedCode=unescape(this.peek);this.advance()}buffer+=String.fromCharCode(unescapedCode);marker=this.index}else if(this.peek==$EOF){return this.error("Unterminated quote",0)}else{this.advance()}}const last=input.substring(marker,this.index);this.advance();return newStringToken(start,this.index,buffer+last)}scanQuestion(start){this.advance();let str="?";if(this.peek===$QUESTION||this.peek===$PERIOD){str+=this.peek===$PERIOD?".":"?";this.advance()}return newOperatorToken(start,this.index,str)}error(message,offset){const position=this.index+offset;return newErrorToken(position,this.index,`Lexer Error: ${message} at column ${position} in expression [${this.input}]`)}}function isIdentifierStart(code){return $a<=code&&code<=$z||$A<=code&&code<=$Z||code==$_||code==$$}function isIdentifier(input){if(input.length==0)return false;const scanner=new _Scanner(input);if(!isIdentifierStart(scanner.peek))return false;scanner.advance();while(scanner.peek!==$EOF){if(!isIdentifierPart(scanner.peek))return false;scanner.advance()}return true}function isIdentifierPart(code){return isAsciiLetter(code)||isDigit(code)||code==$_||code==$$}function isExponentStart(code){return code==$e||code==$E}function isExponentSign(code){return code==$MINUS||code==$PLUS}function unescape(code){switch(code){case $n:return $LF;case $f:return $FF;case $r:return $CR;case $t:return $TAB;case $v:return $VTAB;default:return code}}function parseIntAutoRadix(text){const result=parseInt(text);if(isNaN(result)){throw new Error("Invalid integer literal when parsing "+text)}return result}class SplitInterpolation{constructor(strings,expressions,offsets){this.strings=strings;this.expressions=expressions;this.offsets=offsets}}class TemplateBindingParseResult{constructor(templateBindings,warnings,errors){this.templateBindings=templateBindings;this.warnings=warnings;this.errors=errors}}class Parser$1{constructor(_lexer){this._lexer=_lexer;this.errors=[]}parseAction(input,location,absoluteOffset,interpolationConfig=DEFAULT_INTERPOLATION_CONFIG){this._checkNoInterpolation(input,location,interpolationConfig);const sourceToLex=this._stripComments(input);const tokens=this._lexer.tokenize(sourceToLex);const ast=new _ParseAST(input,location,absoluteOffset,tokens,1,this.errors,0).parseChain();return new ASTWithSource(ast,input,location,absoluteOffset,this.errors)}parseBinding(input,location,absoluteOffset,interpolationConfig=DEFAULT_INTERPOLATION_CONFIG){const ast=this._parseBindingAst(input,location,absoluteOffset,interpolationConfig);return new ASTWithSource(ast,input,location,absoluteOffset,this.errors)}checkSimpleExpression(ast){const checker=new SimpleExpressionChecker;ast.visit(checker);return checker.errors}parseSimpleBinding(input,location,absoluteOffset,interpolationConfig=DEFAULT_INTERPOLATION_CONFIG){const ast=this._parseBindingAst(input,location,absoluteOffset,interpolationConfig);const errors=this.checkSimpleExpression(ast);if(errors.length>0){this._reportError(`Host binding expression cannot contain ${errors.join(" ")}`,input,location)}return new ASTWithSource(ast,input,location,absoluteOffset,this.errors)}_reportError(message,input,errLocation,ctxLocation){this.errors.push(new ParserError(message,input,errLocation,ctxLocation))}_parseBindingAst(input,location,absoluteOffset,interpolationConfig){this._checkNoInterpolation(input,location,interpolationConfig);const sourceToLex=this._stripComments(input);const tokens=this._lexer.tokenize(sourceToLex);return new _ParseAST(input,location,absoluteOffset,tokens,0,this.errors,0).parseChain()}parseTemplateBindings(templateKey,templateValue,templateUrl,absoluteKeyOffset,absoluteValueOffset){const tokens=this._lexer.tokenize(templateValue);const parser=new _ParseAST(templateValue,templateUrl,absoluteValueOffset,tokens,0,this.errors,0);return parser.parseTemplateBindings({source:templateKey,span:new AbsoluteSourceSpan(absoluteKeyOffset,absoluteKeyOffset+templateKey.length)})}parseInterpolation(input,location,absoluteOffset,interpolatedTokens,interpolationConfig=DEFAULT_INTERPOLATION_CONFIG){const{strings:strings,expressions:expressions,offsets:offsets}=this.splitInterpolation(input,location,interpolatedTokens,interpolationConfig);if(expressions.length===0)return null;const expressionNodes=[];for(let i=0;i<expressions.length;++i){const expressionText=expressions[i].text;const sourceToLex=this._stripComments(expressionText);const tokens=this._lexer.tokenize(sourceToLex);const ast=new _ParseAST(input,location,absoluteOffset,tokens,0,this.errors,offsets[i]).parseChain();expressionNodes.push(ast)}return this.createInterpolationAst(strings.map((s=>s.text)),expressionNodes,input,location,absoluteOffset)}parseInterpolationExpression(expression,location,absoluteOffset){const sourceToLex=this._stripComments(expression);const tokens=this._lexer.tokenize(sourceToLex);const ast=new _ParseAST(expression,location,absoluteOffset,tokens,0,this.errors,0).parseChain();const strings=["",""];return this.createInterpolationAst(strings,[ast],expression,location,absoluteOffset)}createInterpolationAst(strings,expressions,input,location,absoluteOffset){const span=new ParseSpan(0,input.length);const interpolation=new Interpolation$1(span,span.toAbsolute(absoluteOffset),strings,expressions);return new ASTWithSource(interpolation,input,location,absoluteOffset,this.errors)}splitInterpolation(input,location,interpolatedTokens,interpolationConfig=DEFAULT_INTERPOLATION_CONFIG){const strings=[];const expressions=[];const offsets=[];const inputToTemplateIndexMap=interpolatedTokens?getIndexMapForOriginalTemplate(interpolatedTokens):null;let i=0;let atInterpolation=false;let extendLastString=false;let{start:interpStart,end:interpEnd}=interpolationConfig;while(i<input.length){if(!atInterpolation){const start=i;i=input.indexOf(interpStart,i);if(i===-1){i=input.length}const text=input.substring(start,i);strings.push({text:text,start:start,end:i});atInterpolation=true}else{const fullStart=i;const exprStart=fullStart+interpStart.length;const exprEnd=this._getInterpolationEndIndex(input,interpEnd,exprStart);if(exprEnd===-1){atInterpolation=false;extendLastString=true;break}const fullEnd=exprEnd+interpEnd.length;const text=input.substring(exprStart,exprEnd);if(text.trim().length===0){this._reportError("Blank expressions are not allowed in interpolated strings",input,`at column ${i} in`,location)}expressions.push({text:text,start:fullStart,end:fullEnd});const startInOriginalTemplate=inputToTemplateIndexMap?.get(fullStart)??fullStart;const offset=startInOriginalTemplate+interpStart.length;offsets.push(offset);i=fullEnd;atInterpolation=false}}if(!atInterpolation){if(extendLastString){const piece=strings[strings.length-1];piece.text+=input.substring(i);piece.end=input.length}else{strings.push({text:input.substring(i),start:i,end:input.length})}}return new SplitInterpolation(strings,expressions,offsets)}wrapLiteralPrimitive(input,location,absoluteOffset){const span=new ParseSpan(0,input==null?0:input.length);return new ASTWithSource(new LiteralPrimitive(span,span.toAbsolute(absoluteOffset),input),input,location,absoluteOffset,this.errors)}_stripComments(input){const i=this._commentStart(input);return i!=null?input.substring(0,i):input}_commentStart(input){let outerQuote=null;for(let i=0;i<input.length-1;i++){const char=input.charCodeAt(i);const nextChar=input.charCodeAt(i+1);if(char===$SLASH&&nextChar==$SLASH&&outerQuote==null)return i;if(outerQuote===char){outerQuote=null}else if(outerQuote==null&&isQuote(char)){outerQuote=char}}return null}_checkNoInterpolation(input,location,{start:start,end:end}){let startIndex=-1;let endIndex=-1;for(const charIndex of this._forEachUnquotedChar(input,0)){if(startIndex===-1){if(input.startsWith(start)){startIndex=charIndex}}else{endIndex=this._getInterpolationEndIndex(input,end,charIndex);if(endIndex>-1){break}}}if(startIndex>-1&&endIndex>-1){this._reportError(`Got interpolation (${start}${end}) where expression was expected`,input,`at column ${startIndex} in`,location)}}_getInterpolationEndIndex(input,expressionEnd,start){for(const charIndex of this._forEachUnquotedChar(input,start)){if(input.startsWith(expressionEnd,charIndex)){return charIndex}if(input.startsWith("//",charIndex)){return input.indexOf(expressionEnd,charIndex)}}return-1}*_forEachUnquotedChar(input,start){let currentQuote=null;let escapeCount=0;for(let i=start;i<input.length;i++){const char=input[i];if(isQuote(input.charCodeAt(i))&&(currentQuote===null||currentQuote===char)&&escapeCount%2===0){currentQuote=currentQuote===null?char:null}else if(currentQuote===null){yield i}escapeCount=char==="\\"?escapeCount+1:0}}}var ParseContextFlags;(function(ParseContextFlags){ParseContextFlags[ParseContextFlags["None"]=0]="None";ParseContextFlags[ParseContextFlags["Writable"]=1]="Writable"})(ParseContextFlags||(ParseContextFlags={}));class _ParseAST{constructor(input,location,absoluteOffset,tokens,parseFlags,errors,offset){this.input=input;this.location=location;this.absoluteOffset=absoluteOffset;this.tokens=tokens;this.parseFlags=parseFlags;this.errors=errors;this.offset=offset;this.rparensExpected=0;this.rbracketsExpected=0;this.rbracesExpected=0;this.context=ParseContextFlags.None;this.sourceSpanCache=new Map;this.index=0}peek(offset){const i=this.index+offset;return i<this.tokens.length?this.tokens[i]:EOF}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(){if(this.index>0){const curToken=this.peek(-1);return curToken.end+this.offset}if(this.tokens.length===0){return this.input.length+this.offset}return this.next.index+this.offset}get currentAbsoluteOffset(){return this.absoluteOffset+this.inputIndex}span(start,artificialEndIndex){let endIndex=this.currentEndIndex;if(artificialEndIndex!==undefined&&artificialEndIndex>this.currentEndIndex){endIndex=artificialEndIndex}if(start>endIndex){const tmp=endIndex;endIndex=start;start=tmp}return new ParseSpan(start,endIndex)}sourceSpan(start,artificialEndIndex){const serial=`${start}@${this.inputIndex}:${artificialEndIndex}`;if(!this.sourceSpanCache.has(serial)){this.sourceSpanCache.set(serial,this.span(start,artificialEndIndex).toAbsolute(this.absoluteOffset))}return this.sourceSpanCache.get(serial)}advance(){this.index++}withContext(context,cb){this.context|=context;const ret=cb();this.context^=context;return ret}consumeOptionalCharacter(code){if(this.next.isCharacter(code)){this.advance();return true}else{return false}}peekKeywordLet(){return this.next.isKeywordLet()}peekKeywordAs(){return this.next.isKeywordAs()}expectCharacter(code){if(this.consumeOptionalCharacter(code))return;this.error(`Missing expected ${String.fromCharCode(code)}`)}consumeOptionalOperator(op){if(this.next.isOperator(op)){this.advance();return true}else{return false}}expectOperator(operator){if(this.consumeOptionalOperator(operator))return;this.error(`Missing expected operator ${operator}`)}prettyPrintToken(tok){return tok===EOF?"end of input":`token ${tok}`}expectIdentifierOrKeyword(){const n=this.next;if(!n.isIdentifier()&&!n.isKeyword()){if(n.isPrivateIdentifier()){this._reportErrorForPrivateIdentifier(n,"expected identifier or keyword")}else{this.error(`Unexpected ${this.prettyPrintToken(n)}, expected identifier or keyword`)}return null}this.advance();return n.toString()}expectIdentifierOrKeywordOrString(){const n=this.next;if(!n.isIdentifier()&&!n.isKeyword()&&!n.isString()){if(n.isPrivateIdentifier()){this._reportErrorForPrivateIdentifier(n,"expected identifier, keyword or string")}else{this.error(`Unexpected ${this.prettyPrintToken(n)}, expected identifier, keyword, or string`)}return""}this.advance();return n.toString()}parseChain(){const exprs=[];const start=this.inputIndex;while(this.index<this.tokens.length){const expr=this.parsePipe();exprs.push(expr);if(this.consumeOptionalCharacter($SEMICOLON)){if(!(this.parseFlags&1)){this.error("Binding expression cannot contain chained expression")}while(this.consumeOptionalCharacter($SEMICOLON)){}}else if(this.index<this.tokens.length){const errorIndex=this.index;this.error(`Unexpected token '${this.next}'`);if(this.index===errorIndex){break}}}if(exprs.length===0){const artificialStart=this.offset;const artificialEnd=this.offset+this.input.length;return new EmptyExpr$1(this.span(artificialStart,artificialEnd),this.sourceSpan(artificialStart,artificialEnd))}if(exprs.length==1)return exprs[0];return new Chain(this.span(start),this.sourceSpan(start),exprs)}parsePipe(){const start=this.inputIndex;let result=this.parseExpression();if(this.consumeOptionalOperator("|")){if(this.parseFlags&1){this.error(`Cannot have a pipe in an action expression`)}do{const nameStart=this.inputIndex;let nameId=this.expectIdentifierOrKeyword();let nameSpan;let fullSpanEnd=undefined;if(nameId!==null){nameSpan=this.sourceSpan(nameStart)}else{nameId="";fullSpanEnd=this.next.index!==-1?this.next.index:this.input.length+this.offset;nameSpan=new ParseSpan(fullSpanEnd,fullSpanEnd).toAbsolute(this.absoluteOffset)}const args=[];while(this.consumeOptionalCharacter($COLON)){args.push(this.parseExpression())}result=new BindingPipe(this.span(start),this.sourceSpan(start,fullSpanEnd),result,nameId,args,nameSpan)}while(this.consumeOptionalOperator("|"))}return result}parseExpression(){return this.parseConditional()}parseConditional(){const start=this.inputIndex;const result=this.parseLogicalOr();if(this.consumeOptionalOperator("?")){const yes=this.parsePipe();let no;if(!this.consumeOptionalCharacter($COLON)){const end=this.inputIndex;const expression=this.input.substring(start,end);this.error(`Conditional expression ${expression} requires all 3 expressions`);no=new EmptyExpr$1(this.span(start),this.sourceSpan(start))}else{no=this.parsePipe()}return new Conditional(this.span(start),this.sourceSpan(start),result,yes,no)}else{return result}}parseLogicalOr(){const start=this.inputIndex;let result=this.parseLogicalAnd();while(this.consumeOptionalOperator("||")){const right=this.parseLogicalAnd();result=new Binary(this.span(start),this.sourceSpan(start),"||",result,right)}return result}parseLogicalAnd(){const start=this.inputIndex;let result=this.parseNullishCoalescing();while(this.consumeOptionalOperator("&&")){const right=this.parseNullishCoalescing();result=new Binary(this.span(start),this.sourceSpan(start),"&&",result,right)}return result}parseNullishCoalescing(){const start=this.inputIndex;let result=this.parseEquality();while(this.consumeOptionalOperator("??")){const right=this.parseEquality();result=new Binary(this.span(start),this.sourceSpan(start),"??",result,right)}return result}parseEquality(){const start=this.inputIndex;let result=this.parseRelational();while(this.next.type==exports.TokenType.Operator){const operator=this.next.strValue;switch(operator){case"==":case"===":case"!=":case"!==":this.advance();const right=this.parseRelational();result=new Binary(this.span(start),this.sourceSpan(start),operator,result,right);continue}break}return result}parseRelational(){const start=this.inputIndex;let result=this.parseAdditive();while(this.next.type==exports.TokenType.Operator){const operator=this.next.strValue;switch(operator){case"<":case">":case"<=":case">=":this.advance();const right=this.parseAdditive();result=new Binary(this.span(start),this.sourceSpan(start),operator,result,right);continue}break}return result}parseAdditive(){const start=this.inputIndex;let result=this.parseMultiplicative();while(this.next.type==exports.TokenType.Operator){const operator=this.next.strValue;switch(operator){case"+":case"-":this.advance();let right=this.parseMultiplicative();result=new Binary(this.span(start),this.sourceSpan(start),operator,result,right);continue}break}return result}parseMultiplicative(){const start=this.inputIndex;let result=this.parsePrefix();while(this.next.type==exports.TokenType.Operator){const operator=this.next.strValue;switch(operator){case"*":case"%":case"/":this.advance();let right=this.parsePrefix();result=new Binary(this.span(start),this.sourceSpan(start),operator,result,right);continue}break}return result}parsePrefix(){if(this.next.type==exports.TokenType.Operator){const start=this.inputIndex;const operator=this.next.strValue;let result;switch(operator){case"+":this.advance();result=this.parsePrefix();return Unary.createPlus(this.span(start),this.sourceSpan(start),result);case"-":this.advance();result=this.parsePrefix();return Unary.createMinus(this.span(start),this.sourceSpan(start),result);case"!":this.advance();result=this.parsePrefix();return new PrefixNot(this.span(start),this.sourceSpan(start),result)}}return this.parseCallChain()}parseCallChain(){const start=this.inputIndex;let result=this.parsePrimary();while(true){if(this.consumeOptionalCharacter($PERIOD)){result=this.parseAccessMember(result,start,false)}else if(this.consumeOptionalOperator("?.")){if(this.consumeOptionalCharacter($LPAREN)){result=this.parseCall(result,start,true)}else{result=this.consumeOptionalCharacter($LBRACKET)?this.parseKeyedReadOrWrite(result,start,true):this.parseAccessMember(result,start,true)}}else if(this.consumeOptionalCharacter($LBRACKET)){result=this.parseKeyedReadOrWrite(result,start,false)}else if(this.consumeOptionalCharacter($LPAREN)){result=this.parseCall(result,start,false)}else if(this.consumeOptionalOperator("!")){result=new NonNullAssert(this.span(start),this.sourceSpan(start),result)}else{return result}}}parsePrimary(){const start=this.inputIndex;if(this.consumeOptionalCharacter($LPAREN)){this.rparensExpected++;const result=this.parsePipe();this.rparensExpected--;this.expectCharacter($RPAREN);return result}else if(this.next.isKeywordNull()){this.advance();return new LiteralPrimitive(this.span(start),this.sourceSpan(start),null)}else if(this.next.isKeywordUndefined()){this.advance();return new LiteralPrimitive(this.span(start),this.sourceSpan(start),void 0)}else if(this.next.isKeywordTrue()){this.advance();return new LiteralPrimitive(this.span(start),this.sourceSpan(start),true)}else if(this.next.isKeywordFalse()){this.advance();return new LiteralPrimitive(this.span(start),this.sourceSpan(start),false)}else if(this.next.isKeywordThis()){this.advance();return new ThisReceiver(this.span(start),this.sourceSpan(start))}else if(this.consumeOptionalCharacter($LBRACKET)){this.rbracketsExpected++;const elements=this.parseExpressionList($RBRACKET);this.rbracketsExpected--;this.expectCharacter($RBRACKET);return new LiteralArray(this.span(start),this.sourceSpan(start),elements)}else if(this.next.isCharacter($LBRACE)){return this.parseLiteralMap()}else if(this.next.isIdentifier()){return this.parseAccessMember(new ImplicitReceiver(this.span(start),this.sourceSpan(start)),start,false)}else if(this.next.isNumber()){const value=this.next.toNumber();this.advance();return new LiteralPrimitive(this.span(start),this.sourceSpan(start),value)}else if(this.next.isString()){const literalValue=this.next.toString();this.advance();return new LiteralPrimitive(this.span(start),this.sourceSpan(start),literalValue)}else if(this.next.isPrivateIdentifier()){this._reportErrorForPrivateIdentifier(this.next,null);return new EmptyExpr$1(this.span(start),this.sourceSpan(start))}else if(this.index>=this.tokens.length){this.error(`Unexpected end of expression: ${this.input}`);return new EmptyExpr$1(this.span(start),this.sourceSpan(start))}else{this.error(`Unexpected token ${this.next}`);return new EmptyExpr$1(this.span(start),this.sourceSpan(start))}}parseExpressionList(terminator){const result=[];do{if(!this.next.isCharacter(terminator)){result.push(this.parsePipe())}else{break}}while(this.consumeOptionalCharacter($COMMA));return result}parseLiteralMap(){const keys=[];const values=[];const start=this.inputIndex;this.expectCharacter($LBRACE);if(!this.consumeOptionalCharacter($RBRACE)){this.rbracesExpected++;do{const keyStart=this.inputIndex;const quoted=this.next.isString();const key=this.expectIdentifierOrKeywordOrString();keys.push({key:key,quoted:quoted});if(quoted){this.expectCharacter($COLON);values.push(this.parsePipe())}else if(this.consumeOptionalCharacter($COLON)){values.push(this.parsePipe())}else{const span=this.span(keyStart);const sourceSpan=this.sourceSpan(keyStart);values.push(new PropertyRead(span,sourceSpan,sourceSpan,new ImplicitReceiver(span,sourceSpan),key))}}while(this.consumeOptionalCharacter($COMMA)&&!this.next.isCharacter($RBRACE));this.rbracesExpected--;this.expectCharacter($RBRACE)}return new LiteralMap(this.span(start),this.sourceSpan(start),keys,values)}parseAccessMember(readReceiver,start,isSafe){const nameStart=this.inputIndex;const id=this.withContext(ParseContextFlags.Writable,(()=>{const id=this.expectIdentifierOrKeyword()??"";if(id.length===0){this.error(`Expected identifier for property access`,readReceiver.span.end)}return id}));const nameSpan=this.sourceSpan(nameStart);let receiver;if(isSafe){if(this.consumeOptionalOperator("=")){this.error("The '?.' operator cannot be used in the assignment");receiver=new EmptyExpr$1(this.span(start),this.sourceSpan(start))}else{receiver=new SafePropertyRead(this.span(start),this.sourceSpan(start),nameSpan,readReceiver,id)}}else{if(this.consumeOptionalOperator("=")){if(!(this.parseFlags&1)){this.error("Bindings cannot contain assignments");return new EmptyExpr$1(this.span(start),this.sourceSpan(start))}const value=this.parseConditional();receiver=new PropertyWrite(this.span(start),this.sourceSpan(start),nameSpan,readReceiver,id,value)}else{receiver=new PropertyRead(this.span(start),this.sourceSpan(start),nameSpan,readReceiver,id)}}return receiver}parseCall(receiver,start,isSafe){const argumentStart=this.inputIndex;this.rparensExpected++;const args=this.parseCallArguments();const argumentSpan=this.span(argumentStart,this.inputIndex).toAbsolute(this.absoluteOffset);this.expectCharacter($RPAREN);this.rparensExpected--;const span=this.span(start);const sourceSpan=this.sourceSpan(start);return isSafe?new SafeCall(span,sourceSpan,receiver,args,argumentSpan):new Call(span,sourceSpan,receiver,args,argumentSpan)}parseCallArguments(){if(this.next.isCharacter($RPAREN))return[];const positionals=[];do{positionals.push(this.parsePipe())}while(this.consumeOptionalCharacter($COMMA));return positionals}expectTemplateBindingKey(){let result="";let operatorFound=false;const start=this.currentAbsoluteOffset;do{result+=this.expectIdentifierOrKeywordOrString();operatorFound=this.consumeOptionalOperator("-");if(operatorFound){result+="-"}}while(operatorFound);return{source:result,span:new AbsoluteSourceSpan(start,start+result.length)}}parseTemplateBindings(templateKey){const bindings=[];bindings.push(...this.parseDirectiveKeywordBindings(templateKey));while(this.index<this.tokens.length){const letBinding=this.parseLetBinding();if(letBinding){bindings.push(letBinding)}else{const key=this.expectTemplateBindingKey();const binding=this.parseAsBinding(key);if(binding){bindings.push(binding)}else{key.source=templateKey.source+key.source.charAt(0).toUpperCase()+key.source.substring(1);bindings.push(...this.parseDirectiveKeywordBindings(key))}}this.consumeStatementTerminator()}return new TemplateBindingParseResult(bindings,[],this.errors)}parseKeyedReadOrWrite(receiver,start,isSafe){return this.withContext(ParseContextFlags.Writable,(()=>{this.rbracketsExpected++;const key=this.parsePipe();if(key instanceof EmptyExpr$1){this.error(`Key access cannot be empty`)}this.rbracketsExpected--;this.expectCharacter($RBRACKET);if(this.consumeOptionalOperator("=")){if(isSafe){this.error("The '?.' operator cannot be used in the assignment")}else{const value=this.parseConditional();return new KeyedWrite(this.span(start),this.sourceSpan(start),receiver,key,value)}}else{return isSafe?new SafeKeyedRead(this.span(start),this.sourceSpan(start),receiver,key):new KeyedRead(this.span(start),this.sourceSpan(start),receiver,key)}return new EmptyExpr$1(this.span(start),this.sourceSpan(start))}))}parseDirectiveKeywordBindings(key){const bindings=[];this.consumeOptionalCharacter($COLON);const value=this.getDirectiveBoundTarget();let spanEnd=this.currentAbsoluteOffset;const asBinding=this.parseAsBinding(key);if(!asBinding){this.consumeStatementTerminator();spanEnd=this.currentAbsoluteOffset}const sourceSpan=new AbsoluteSourceSpan(key.span.start,spanEnd);bindings.push(new ExpressionBinding(sourceSpan,key,value));if(asBinding){bindings.push(asBinding)}return bindings}getDirectiveBoundTarget(){if(this.next===EOF||this.peekKeywordAs()||this.peekKeywordLet()){return null}const ast=this.parsePipe();const{start:start,end:end}=ast.span;const value=this.input.substring(start,end);return new ASTWithSource(ast,value,this.location,this.absoluteOffset+start,this.errors)}parseAsBinding(value){if(!this.peekKeywordAs()){return null}this.advance();const key=this.expectTemplateBindingKey();this.consumeStatementTerminator();const sourceSpan=new AbsoluteSourceSpan(value.span.start,this.currentAbsoluteOffset);return new VariableBinding(sourceSpan,key,value)}parseLetBinding(){if(!this.peekKeywordLet()){return null}const spanStart=this.currentAbsoluteOffset;this.advance();const key=this.expectTemplateBindingKey();let value=null;if(this.consumeOptionalOperator("=")){value=this.expectTemplateBindingKey()}this.consumeStatementTerminator();const sourceSpan=new AbsoluteSourceSpan(spanStart,this.currentAbsoluteOffset);return new VariableBinding(sourceSpan,key,value)}consumeStatementTerminator(){this.consumeOptionalCharacter($SEMICOLON)||this.consumeOptionalCharacter($COMMA)}error(message,index=null){this.errors.push(new ParserError(message,this.input,this.locationText(index),this.location));this.skip()}locationText(index=null){if(index==null)index=this.index;return index<this.tokens.length?`at column ${this.tokens[index].index+1} in`:`at the end of the expression`}_reportErrorForPrivateIdentifier(token,extraMessage){let errorMessage=`Private identifiers are not supported. Unexpected private identifier: ${token}`;if(extraMessage!==null){errorMessage+=`, ${extraMessage}`}this.error(errorMessage)}skip(){let n=this.next;while(this.index<this.tokens.length&&!n.isCharacter($SEMICOLON)&&!n.isOperator("|")&&(this.rparensExpected<=0||!n.isCharacter($RPAREN))&&(this.rbracesExpected<=0||!n.isCharacter($RBRACE))&&(this.rbracketsExpected<=0||!n.isCharacter($RBRACKET))&&(!(this.context&ParseContextFlags.Writable)||!n.isOperator("="))){if(this.next.isError()){this.errors.push(new ParserError(this.next.toString(),this.input,this.locationText(),this.location))}this.advance();n=this.next}}}class SimpleExpressionChecker extends RecursiveAstVisitor{constructor(){super(...arguments);this.errors=[]}visitPipe(){this.errors.push("pipes")}}function getIndexMapForOriginalTemplate(interpolatedTokens){let offsetMap=new Map;let consumedInOriginalTemplate=0;let consumedInInput=0;let tokenIndex=0;while(tokenIndex<interpolatedTokens.length){const currentToken=interpolatedTokens[tokenIndex];if(currentToken.type===9){const[decoded,encoded]=currentToken.parts;consumedInOriginalTemplate+=encoded.length;consumedInInput+=decoded.length}else{const lengthOfParts=currentToken.parts.reduce(((sum,current)=>sum+current.length),0);consumedInInput+=lengthOfParts;consumedInOriginalTemplate+=lengthOfParts}offsetMap.set(consumedInInput,consumedInOriginalTemplate);tokenIndex++}return offsetMap}class NodeWithI18n{constructor(sourceSpan,i18n){this.sourceSpan=sourceSpan;this.i18n=i18n}}class Text extends NodeWithI18n{constructor(value,sourceSpan,tokens,i18n){super(sourceSpan,i18n);this.value=value;this.tokens=tokens}visit(visitor,context){return visitor.visitText(this,context)}}class Expansion extends NodeWithI18n{constructor(switchValue,type,cases,sourceSpan,switchValueSourceSpan,i18n){super(sourceSpan,i18n);this.switchValue=switchValue;this.type=type;this.cases=cases;this.switchValueSourceSpan=switchValueSourceSpan}visit(visitor,context){return visitor.visitExpansion(this,context)}}class ExpansionCase{constructor(value,expression,sourceSpan,valueSourceSpan,expSourceSpan){this.value=value;this.expression=expression;this.sourceSpan=sourceSpan;this.valueSourceSpan=valueSourceSpan;this.expSourceSpan=expSourceSpan}visit(visitor,context){return visitor.visitExpansionCase(this,context)}}class Attribute extends NodeWithI18n{constructor(name,value,sourceSpan,keySpan,valueSpan,valueTokens,i18n){super(sourceSpan,i18n);this.name=name;this.value=value;this.keySpan=keySpan;this.valueSpan=valueSpan;this.valueTokens=valueTokens}visit(visitor,context){return visitor.visitAttribute(this,context)}}class Element extends NodeWithI18n{constructor(name,attrs,children,sourceSpan,startSourceSpan,endSourceSpan=null,i18n){super(sourceSpan,i18n);this.name=name;this.attrs=attrs;this.children=children;this.startSourceSpan=startSourceSpan;this.endSourceSpan=endSourceSpan}visit(visitor,context){return visitor.visitElement(this,context)}}class Comment{constructor(value,sourceSpan){this.value=value;this.sourceSpan=sourceSpan}visit(visitor,context){return visitor.visitComment(this,context)}}class Block extends NodeWithI18n{constructor(name,parameters,children,sourceSpan,nameSpan,startSourceSpan,endSourceSpan=null,i18n){super(sourceSpan,i18n);this.name=name;this.parameters=parameters;this.children=children;this.nameSpan=nameSpan;this.startSourceSpan=startSourceSpan;this.endSourceSpan=endSourceSpan}visit(visitor,context){return visitor.visitBlock(this,context)}}class BlockParameter{constructor(expression,sourceSpan){this.expression=expression;this.sourceSpan=sourceSpan}visit(visitor,context){return visitor.visitBlockParameter(this,context)}}function visitAll(visitor,nodes,context=null){const result=[];const visit=visitor.visit?ast=>visitor.visit(ast,context)||ast.visit(visitor,context):ast=>ast.visit(visitor,context);nodes.forEach((ast=>{const astResult=visit(ast);if(astResult){result.push(astResult)}}));return result}class RecursiveVisitor{constructor(){}visitElement(ast,context){this.visitChildren(context,(visit=>{visit(ast.attrs);visit(ast.children)}))}visitAttribute(ast,context){}visitText(ast,context){}visitComment(ast,context){}visitExpansion(ast,context){return this.visitChildren(context,(visit=>{visit(ast.cases)}))}visitExpansionCase(ast,context){}visitBlock(block,context){this.visitChildren(context,(visit=>{visit(block.parameters);visit(block.children)}))}visitBlockParameter(ast,context){}visitChildren(context,cb){let results=[];let t=this;function visit(children){if(children)results.push(visitAll(t,children,context))}cb(visit);return Array.prototype.concat.apply([],results)}}class ElementSchemaRegistry{}const BOOLEAN="boolean";const NUMBER="number";const STRING="string";const OBJECT="object";const SCHEMA=["[Element]|textContent,%ariaAtomic,%ariaAutoComplete,%ariaBusy,%ariaChecked,%ariaColCount,%ariaColIndex,%ariaColSpan,%ariaCurrent,%ariaDescription,%ariaDisabled,%ariaExpanded,%ariaHasPopup,%ariaHidden,%ariaKeyShortcuts,%ariaLabel,%ariaLevel,%ariaLive,%ariaModal,%ariaMultiLine,%ariaMultiSelectable,%ariaOrientation,%ariaPlaceholder,%ariaPosInSet,%ariaPressed,%ariaReadOnly,%ariaRelevant,%ariaRequired,%ariaRoleDescription,%ariaRowCount,%ariaRowIndex,%ariaRowSpan,%ariaSelected,%ariaSetSize,%ariaSort,%ariaValueMax,%ariaValueMin,%ariaValueNow,%ariaValueText,%classList,className,elementTiming,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*fullscreenchange,*fullscreenerror,*search,*webkitfullscreenchange,*webkitfullscreenerror,outerHTML,%part,#scrollLeft,#scrollTop,slot"+",*message,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored","[HTMLElement]^[Element]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,!inert,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy","abbr,address,article,aside,b,bdi,bdo,cite,content,code,dd,dfn,dt,em,figcaption,figure,footer,header,hgroup,i,kbd,main,mark,nav,noscript,rb,rp,rt,rtc,ruby,s,samp,section,small,strong,sub,sup,u,var,wbr^[HTMLElement]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy","media^[HTMLElement]|!autoplay,!controls,%controlsList,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,*waitingforkey,#playbackRate,preload,!preservesPitch,src,%srcObject,#volume",":svg:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex",":svg:graphics^:svg:|",":svg:animation^:svg:|*begin,*end,*repeat",":svg:geometry^:svg:|",":svg:componentTransferFunction^:svg:|",":svg:gradient^:svg:|",":svg:textContent^:svg:graphics|",":svg:textPositioning^:svg:textContent|","a^[HTMLElement]|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,rev,search,shape,target,text,type,username","area^[HTMLElement]|alt,coords,download,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,search,shape,target,username","audio^media|","br^[HTMLElement]|clear","base^[HTMLElement]|href,target","body^[HTMLElement]|aLink,background,bgColor,link,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink","button^[HTMLElement]|!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value","canvas^[HTMLElement]|#height,#width","content^[HTMLElement]|select","dl^[HTMLElement]|!compact","data^[HTMLElement]|value","datalist^[HTMLElement]|","details^[HTMLElement]|!open","dialog^[HTMLElement]|!open,returnValue","dir^[HTMLElement]|!compact","div^[HTMLElement]|align","embed^[HTMLElement]|align,height,name,src,type,width","fieldset^[HTMLElement]|!disabled,name","font^[HTMLElement]|color,face,size","form^[HTMLElement]|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target","frame^[HTMLElement]|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src","frameset^[HTMLElement]|cols,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows","hr^[HTMLElement]|align,color,!noShade,size,width","head^[HTMLElement]|","h1,h2,h3,h4,h5,h6^[HTMLElement]|align","html^[HTMLElement]|version","iframe^[HTMLElement]|align,allow,!allowFullscreen,!allowPaymentRequest,csp,frameBorder,height,loading,longDesc,marginHeight,marginWidth,name,referrerPolicy,%sandbox,scrolling,src,srcdoc,width","img^[HTMLElement]|align,alt,border,%crossOrigin,decoding,#height,#hspace,!isMap,loading,longDesc,lowsrc,name,referrerPolicy,sizes,src,srcset,useMap,#vspace,#width","input^[HTMLElement]|accept,align,alt,autocomplete,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width","li^[HTMLElement]|type,#value","label^[HTMLElement]|htmlFor","legend^[HTMLElement]|align","link^[HTMLElement]|as,charset,%crossOrigin,!disabled,href,hreflang,imageSizes,imageSrcset,integrity,media,referrerPolicy,rel,%relList,rev,%sizes,target,type","map^[HTMLElement]|name","marquee^[HTMLElement]|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width","menu^[HTMLElement]|!compact","meta^[HTMLElement]|content,httpEquiv,media,name,scheme","meter^[HTMLElement]|#high,#low,#max,#min,#optimum,#value","ins,del^[HTMLElement]|cite,dateTime","ol^[HTMLElement]|!compact,!reversed,#start,type","object^[HTMLElement]|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width","optgroup^[HTMLElement]|!disabled,label","option^[HTMLElement]|!defaultSelected,!disabled,label,!selected,text,value","output^[HTMLElement]|defaultValue,%htmlFor,name,value","p^[HTMLElement]|align","param^[HTMLElement]|name,type,value,valueType","picture^[HTMLElement]|","pre^[HTMLElement]|#width","progress^[HTMLElement]|#max,#value","q,blockquote,cite^[HTMLElement]|","script^[HTMLElement]|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,!noModule,%referrerPolicy,src,text,type","select^[HTMLElement]|autocomplete,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value","slot^[HTMLElement]|name","source^[HTMLElement]|#height,media,sizes,src,srcset,type,#width","span^[HTMLElement]|","style^[HTMLElement]|!disabled,media,type","caption^[HTMLElement]|align","th,td^[HTMLElement]|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width","col,colgroup^[HTMLElement]|align,ch,chOff,#span,vAlign,width","table^[HTMLElement]|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width","tr^[HTMLElement]|align,bgColor,ch,chOff,vAlign","tfoot,thead,tbody^[HTMLElement]|align,ch,chOff,vAlign","template^[HTMLElement]|","textarea^[HTMLElement]|autocomplete,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap","time^[HTMLElement]|dateTime","title^[HTMLElement]|text","track^[HTMLElement]|!default,kind,label,src,srclang","ul^[HTMLElement]|!compact,type","unknown^[HTMLElement]|","video^media|!disablePictureInPicture,#height,*enterpictureinpicture,*leavepictureinpicture,!playsInline,poster,#width",":svg:a^:svg:graphics|",":svg:animate^:svg:animation|",":svg:animateMotion^:svg:animation|",":svg:animateTransform^:svg:animation|",":svg:circle^:svg:geometry|",":svg:clipPath^:svg:graphics|",":svg:defs^:svg:graphics|",":svg:desc^:svg:|",":svg:discard^:svg:|",":svg:ellipse^:svg:geometry|",":svg:feBlend^:svg:|",":svg:feColorMatrix^:svg:|",":svg:feComponentTransfer^:svg:|",":svg:feComposite^:svg:|",":svg:feConvolveMatrix^:svg:|",":svg:feDiffuseLighting^:svg:|",":svg:feDisplacementMap^:svg:|",":svg:feDistantLight^:svg:|",":svg:feDropShadow^:svg:|",":svg:feFlood^:svg:|",":svg:feFuncA^:svg:componentTransferFunction|",":svg:feFuncB^:svg:componentTransferFunction|",":svg:feFuncG^:svg:componentTransferFunction|",":svg:feFuncR^:svg:componentTransferFunction|",":svg:feGaussianBlur^:svg:|",":svg:feImage^:svg:|",":svg:feMerge^:svg:|",":svg:feMergeNode^:svg:|",":svg:feMorphology^:svg:|",":svg:feOffset^:svg:|",":svg:fePointLight^:svg:|",":svg:feSpecularLighting^:svg:|",":svg:feSpotLight^:svg:|",":svg:feTile^:svg:|",":svg:feTurbulence^:svg:|",":svg:filter^:svg:|",":svg:foreignObject^:svg:graphics|",":svg:g^:svg:graphics|",":svg:image^:svg:graphics|decoding",":svg:line^:svg:geometry|",":svg:linearGradient^:svg:gradient|",":svg:mpath^:svg:|",":svg:marker^:svg:|",":svg:mask^:svg:|",":svg:metadata^:svg:|",":svg:path^:svg:geometry|",":svg:pattern^:svg:|",":svg:polygon^:svg:geometry|",":svg:polyline^:svg:geometry|",":svg:radialGradient^:svg:gradient|",":svg:rect^:svg:geometry|",":svg:svg^:svg:graphics|#currentScale,#zoomAndPan",":svg:script^:svg:|type",":svg:set^:svg:animation|",":svg:stop^:svg:|",":svg:style^:svg:|!disabled,media,title,type",":svg:switch^:svg:graphics|",":svg:symbol^:svg:|",":svg:tspan^:svg:textPositioning|",":svg:text^:svg:textPositioning|",":svg:textPath^:svg:textContent|",":svg:title^:svg:|",":svg:use^:svg:graphics|",":svg:view^:svg:|#zoomAndPan","data^[HTMLElement]|value","keygen^[HTMLElement]|!autofocus,challenge,!disabled,form,keytype,name","menuitem^[HTMLElement]|type,label,icon,!disabled,!checked,radiogroup,!default","summary^[HTMLElement]|","time^[HTMLElement]|dateTime",":svg:cursor^:svg:|",":math:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforeinput,*beforematch,*beforetoggle,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contentvisibilityautostatechange,*contextlost,*contextmenu,*contextrestored,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*scrollend,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex",":math:math^:math:|",":math:maction^:math:|",":math:menclose^:math:|",":math:merror^:math:|",":math:mfenced^:math:|",":math:mfrac^:math:|",":math:mi^:math:|",":math:mmultiscripts^:math:|",":math:mn^:math:|",":math:mo^:math:|",":math:mover^:math:|",":math:mpadded^:math:|",":math:mphantom^:math:|",":math:mroot^:math:|",":math:mrow^:math:|",":math:ms^:math:|",":math:mspace^:math:|",":math:msqrt^:math:|",":math:mstyle^:math:|",":math:msub^:math:|",":math:msubsup^:math:|",":math:msup^:math:|",":math:mtable^:math:|",":math:mtd^:math:|",":math:mtext^:math:|",":math:mtr^:math:|",":math:munder^:math:|",":math:munderover^:math:|",":math:semantics^:math:|"];const _ATTR_TO_PROP=new Map(Object.entries({class:"className",for:"htmlFor",formaction:"formAction",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex"}));const _PROP_TO_ATTR=Array.from(_ATTR_TO_PROP).reduce(((inverted,[propertyName,attributeName])=>{inverted.set(propertyName,attributeName);return inverted}),new Map);class DomElementSchemaRegistry extends ElementSchemaRegistry{constructor(){super();this._schema=new Map;this._eventSchema=new Map;SCHEMA.forEach((encodedType=>{const type=new Map;const events=new Set;const[strType,strProperties]=encodedType.split("|");const properties=strProperties.split(",");const[typeNames,superName]=strType.split("^");typeNames.split(",").forEach((tag=>{this._schema.set(tag.toLowerCase(),type);this._eventSchema.set(tag.toLowerCase(),events)}));const superType=superName&&this._schema.get(superName.toLowerCase());if(superType){for(const[prop,value]of superType){type.set(prop,value)}for(const superEvent of this._eventSchema.get(superName.toLowerCase())){events.add(superEvent)}}properties.forEach((property=>{if(property.length>0){switch(property[0]){case"*":events.add(property.substring(1));break;case"!":type.set(property.substring(1),BOOLEAN);break;case"#":type.set(property.substring(1),NUMBER);break;case"%":type.set(property.substring(1),OBJECT);break;default:type.set(property,STRING)}}}))}))}hasProperty(tagName,propName,schemaMetas){if(schemaMetas.some((schema=>schema.name===NO_ERRORS_SCHEMA.name))){return true}if(tagName.indexOf("-")>-1){if(isNgContainer(tagName)||isNgContent(tagName)){return false}if(schemaMetas.some((schema=>schema.name===CUSTOM_ELEMENTS_SCHEMA.name))){return true}}const elementProperties=this._schema.get(tagName.toLowerCase())||this._schema.get("unknown");return elementProperties.has(propName)}hasElement(tagName,schemaMetas){if(schemaMetas.some((schema=>schema.name===NO_ERRORS_SCHEMA.name))){return true}if(tagName.indexOf("-")>-1){if(isNgContainer(tagName)||isNgContent(tagName)){return true}if(schemaMetas.some((schema=>schema.name===CUSTOM_ELEMENTS_SCHEMA.name))){return true}}return this._schema.has(tagName.toLowerCase())}securityContext(tagName,propName,isAttribute){if(isAttribute){propName=this.getMappedPropName(propName)}tagName=tagName.toLowerCase();propName=propName.toLowerCase();let ctx=SECURITY_SCHEMA()[tagName+"|"+propName];if(ctx){return ctx}ctx=SECURITY_SCHEMA()["*|"+propName];return ctx?ctx:SecurityContext.NONE}getMappedPropName(propName){return _ATTR_TO_PROP.get(propName)??propName}getDefaultComponentElementName(){return"ng-component"}validateProperty(name){if(name.toLowerCase().startsWith("on")){const msg=`Binding to event property '${name}' is disallowed for security reasons, `+`please use (${name.slice(2)})=...`+`\nIf '${name}' is a directive input, make sure the directive is imported by the`+` current module.`;return{error:true,msg:msg}}else{return{error:false}}}validateAttribute(name){if(name.toLowerCase().startsWith("on")){const msg=`Binding to event attribute '${name}' is disallowed for security reasons, `+`please use (${name.slice(2)})=...`;return{error:true,msg:msg}}else{return{error:false}}}allKnownElementNames(){return Array.from(this._schema.keys())}allKnownAttributesOfElement(tagName){const elementProperties=this._schema.get(tagName.toLowerCase())||this._schema.get("unknown");return Array.from(elementProperties.keys()).map((prop=>_PROP_TO_ATTR.get(prop)??prop))}allKnownEventsOfElement(tagName){return Array.from(this._eventSchema.get(tagName.toLowerCase())??[])}normalizeAnimationStyleProperty(propName){return dashCaseToCamelCase(propName)}normalizeAnimationStyleValue(camelCaseProp,userProvidedProp,val){let unit="";const strVal=val.toString().trim();let errorMsg=null;if(_isPixelDimensionStyle(camelCaseProp)&&val!==0&&val!=="0"){if(typeof val==="number"){unit="px"}else{const valAndSuffixMatch=val.match(/^[+-]?[\d\.]+([a-z]*)$/);if(valAndSuffixMatch&&valAndSuffixMatch[1].length==0){errorMsg=`Please provide a CSS unit value for ${userProvidedProp}:${val}`}}}return{error:errorMsg,value:strVal+unit}}}function _isPixelDimensionStyle(prop){switch(prop){case"width":case"height":case"minWidth":case"minHeight":case"maxWidth":case"maxHeight":case"left":case"top":case"bottom":case"right":case"fontSize":case"outlineWidth":case"outlineOffset":case"paddingTop":case"paddingLeft":case"paddingBottom":case"paddingRight":case"marginTop":case"marginLeft":case"marginBottom":case"marginRight":case"borderRadius":case"borderWidth":case"borderTopWidth":case"borderLeftWidth":case"borderRightWidth":case"borderBottomWidth":case"textIndent":return true;default:return false}}class HtmlTagDefinition{constructor({closedByChildren:closedByChildren,implicitNamespacePrefix:implicitNamespacePrefix,contentType:contentType=exports.TagContentType.PARSABLE_DATA,closedByParent:closedByParent=false,isVoid:isVoid=false,ignoreFirstLf:ignoreFirstLf=false,preventNamespaceInheritance:preventNamespaceInheritance=false,canSelfClose:canSelfClose=false}={}){this.closedByChildren={};this.closedByParent=false;if(closedByChildren&&closedByChildren.length>0){closedByChildren.forEach((tagName=>this.closedByChildren[tagName]=true))}this.isVoid=isVoid;this.closedByParent=closedByParent||isVoid;this.implicitNamespacePrefix=implicitNamespacePrefix||null;this.contentType=contentType;this.ignoreFirstLf=ignoreFirstLf;this.preventNamespaceInheritance=preventNamespaceInheritance;this.canSelfClose=canSelfClose??isVoid}isClosedByChild(name){return this.isVoid||name.toLowerCase()in this.closedByChildren}getContentType(prefix){if(typeof this.contentType==="object"){const overrideType=prefix===undefined?undefined:this.contentType[prefix];return overrideType??this.contentType.default}return this.contentType}}let DEFAULT_TAG_DEFINITION;let TAG_DEFINITIONS;function getHtmlTagDefinition(tagName){if(!TAG_DEFINITIONS){DEFAULT_TAG_DEFINITION=new HtmlTagDefinition({canSelfClose:true});TAG_DEFINITIONS=Object.assign(Object.create(null),{base:new HtmlTagDefinition({isVoid:true}),meta:new HtmlTagDefinition({isVoid:true}),area:new HtmlTagDefinition({isVoid:true}),embed:new HtmlTagDefinition({isVoid:true}),link:new HtmlTagDefinition({isVoid:true}),img:new HtmlTagDefinition({isVoid:true}),input:new HtmlTagDefinition({isVoid:true}),param:new HtmlTagDefinition({isVoid:true}),hr:new HtmlTagDefinition({isVoid:true}),br:new HtmlTagDefinition({isVoid:true}),source:new HtmlTagDefinition({isVoid:true}),track:new HtmlTagDefinition({isVoid:true}),wbr:new HtmlTagDefinition({isVoid:true}),p:new HtmlTagDefinition({closedByChildren:["address","article","aside","blockquote","div","dl","fieldset","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","nav","ol","p","pre","section","table","ul"],closedByParent:true}),thead:new HtmlTagDefinition({closedByChildren:["tbody","tfoot"]}),tbody:new HtmlTagDefinition({closedByChildren:["tbody","tfoot"],closedByParent:true}),tfoot:new HtmlTagDefinition({closedByChildren:["tbody"],closedByParent:true}),tr:new HtmlTagDefinition({closedByChildren:["tr"],closedByParent:true}),td:new HtmlTagDefinition({closedByChildren:["td","th"],closedByParent:true}),th:new HtmlTagDefinition({closedByChildren:["td","th"],closedByParent:true}),col:new HtmlTagDefinition({isVoid:true}),svg:new HtmlTagDefinition({implicitNamespacePrefix:"svg"}),foreignObject:new HtmlTagDefinition({implicitNamespacePrefix:"svg",preventNamespaceInheritance:true}),math:new HtmlTagDefinition({implicitNamespacePrefix:"math"}),li:new HtmlTagDefinition({closedByChildren:["li"],closedByParent:true}),dt:new HtmlTagDefinition({closedByChildren:["dt","dd"]}),dd:new HtmlTagDefinition({closedByChildren:["dt","dd"],closedByParent:true}),rb:new HtmlTagDefinition({closedByChildren:["rb","rt","rtc","rp"],closedByParent:true}),rt:new HtmlTagDefinition({closedByChildren:["rb","rt","rtc","rp"],closedByParent:true}),rtc:new HtmlTagDefinition({closedByChildren:["rb","rtc","rp"],closedByParent:true}),rp:new HtmlTagDefinition({closedByChildren:["rb","rt","rtc","rp"],closedByParent:true}),optgroup:new HtmlTagDefinition({closedByChildren:["optgroup"],closedByParent:true}),option:new HtmlTagDefinition({closedByChildren:["option","optgroup"],closedByParent:true}),pre:new HtmlTagDefinition({ignoreFirstLf:true}),listing:new HtmlTagDefinition({ignoreFirstLf:true}),style:new HtmlTagDefinition({contentType:exports.TagContentType.RAW_TEXT}),script:new HtmlTagDefinition({contentType:exports.TagContentType.RAW_TEXT}),title:new HtmlTagDefinition({contentType:{default:exports.TagContentType.ESCAPABLE_RAW_TEXT,svg:exports.TagContentType.PARSABLE_DATA}}),textarea:new HtmlTagDefinition({contentType:exports.TagContentType.ESCAPABLE_RAW_TEXT,ignoreFirstLf:true})});(new DomElementSchemaRegistry).allKnownElementNames().forEach((knownTagName=>{if(!TAG_DEFINITIONS[knownTagName]&&getNsPrefix(knownTagName)===null){TAG_DEFINITIONS[knownTagName]=new HtmlTagDefinition({canSelfClose:false})}}))}return TAG_DEFINITIONS[tagName]??TAG_DEFINITIONS[tagName.toLowerCase()]??DEFAULT_TAG_DEFINITION}const TAG_TO_PLACEHOLDER_NAMES={A:"LINK",B:"BOLD_TEXT",BR:"LINE_BREAK",EM:"EMPHASISED_TEXT",H1:"HEADING_LEVEL1",H2:"HEADING_LEVEL2",H3:"HEADING_LEVEL3",H4:"HEADING_LEVEL4",H5:"HEADING_LEVEL5",H6:"HEADING_LEVEL6",HR:"HORIZONTAL_RULE",I:"ITALIC_TEXT",LI:"LIST_ITEM",LINK:"MEDIA_LINK",OL:"ORDERED_LIST",P:"PARAGRAPH",Q:"QUOTATION",S:"STRIKETHROUGH_TEXT",SMALL:"SMALL_TEXT",SUB:"SUBSTRIPT",SUP:"SUPERSCRIPT",TBODY:"TABLE_BODY",TD:"TABLE_CELL",TFOOT:"TABLE_FOOTER",TH:"TABLE_HEADER_CELL",THEAD:"TABLE_HEADER",TR:"TABLE_ROW",TT:"MONOSPACED_TEXT",U:"UNDERLINED_TEXT",UL:"UNORDERED_LIST"};class PlaceholderRegistry{constructor(){this._placeHolderNameCounts={};this._signatureToName={}}getStartTagPlaceholderName(tag,attrs,isVoid){const signature=this._hashTag(tag,attrs,isVoid);if(this._signatureToName[signature]){return this._signatureToName[signature]}const upperTag=tag.toUpperCase();const baseName=TAG_TO_PLACEHOLDER_NAMES[upperTag]||`TAG_${upperTag}`;const name=this._generateUniqueName(isVoid?baseName:`START_${baseName}`);this._signatureToName[signature]=name;return name}getCloseTagPlaceholderName(tag){const signature=this._hashClosingTag(tag);if(this._signatureToName[signature]){return this._signatureToName[signature]}const upperTag=tag.toUpperCase();const baseName=TAG_TO_PLACEHOLDER_NAMES[upperTag]||`TAG_${upperTag}`;const name=this._generateUniqueName(`CLOSE_${baseName}`);this._signatureToName[signature]=name;return name}getPlaceholderName(name,content){const upperName=name.toUpperCase();const signature=`PH: ${upperName}=${content}`;if(this._signatureToName[signature]){return this._signatureToName[signature]}const uniqueName=this._generateUniqueName(upperName);this._signatureToName[signature]=uniqueName;return uniqueName}getUniquePlaceholder(name){return this._generateUniqueName(name.toUpperCase())}getStartBlockPlaceholderName(name,parameters){const signature=this._hashBlock(name,parameters);if(this._signatureToName[signature]){return this._signatureToName[signature]}const placeholder=this._generateUniqueName(`START_BLOCK_${this._toSnakeCase(name)}`);this._signatureToName[signature]=placeholder;return placeholder}getCloseBlockPlaceholderName(name){const signature=this._hashClosingBlock(name);if(this._signatureToName[signature]){return this._signatureToName[signature]}const placeholder=this._generateUniqueName(`CLOSE_BLOCK_${this._toSnakeCase(name)}`);this._signatureToName[signature]=placeholder;return placeholder}_hashTag(tag,attrs,isVoid){const start=`<${tag}`;const strAttrs=Object.keys(attrs).sort().map((name=>` ${name}=${attrs[name]}`)).join("");const end=isVoid?"/>":`></${tag}>`;return start+strAttrs+end}_hashClosingTag(tag){return this._hashTag(`/${tag}`,{},false)}_hashBlock(name,parameters){const params=parameters.length===0?"":` (${parameters.sort().join("; ")})`;return`@${name}${params} {}`}_hashClosingBlock(name){return this._hashBlock(`close_${name}`,[])}_toSnakeCase(name){return name.toUpperCase().replace(/[^A-Z0-9]/g,"_")}_generateUniqueName(base){const seen=this._placeHolderNameCounts.hasOwnProperty(base);if(!seen){this._placeHolderNameCounts[base]=1;return base}const id=this._placeHolderNameCounts[base];this._placeHolderNameCounts[base]=id+1;return`${base}_${id}`}}const _expParser=new Parser$1(new Lexer);function createI18nMessageFactory(interpolationConfig,containerBlocks){const visitor=new _I18nVisitor(_expParser,interpolationConfig,containerBlocks);return(nodes,meaning,description,customId,visitNodeFn)=>visitor.toI18nMessage(nodes,meaning,description,customId,visitNodeFn)}function noopVisitNodeFn(_html,i18n){return i18n}class _I18nVisitor{constructor(_expressionParser,_interpolationConfig,_containerBlocks){this._expressionParser=_expressionParser;this._interpolationConfig=_interpolationConfig;this._containerBlocks=_containerBlocks}toI18nMessage(nodes,meaning="",description="",customId="",visitNodeFn){const context={isIcu:nodes.length==1&&nodes[0]instanceof Expansion,icuDepth:0,placeholderRegistry:new PlaceholderRegistry,placeholderToContent:{},placeholderToMessage:{},visitNodeFn:visitNodeFn||noopVisitNodeFn};const i18nodes=visitAll(this,nodes,context);return new Message(i18nodes,context.placeholderToContent,context.placeholderToMessage,meaning,description,customId)}visitElement(el,context){const children=visitAll(this,el.children,context);const attrs={};el.attrs.forEach((attr=>{attrs[attr.name]=attr.value}));const isVoid=getHtmlTagDefinition(el.name).isVoid;const startPhName=context.placeholderRegistry.getStartTagPlaceholderName(el.name,attrs,isVoid);context.placeholderToContent[startPhName]={text:el.startSourceSpan.toString(),sourceSpan:el.startSourceSpan};let closePhName="";if(!isVoid){closePhName=context.placeholderRegistry.getCloseTagPlaceholderName(el.name);context.placeholderToContent[closePhName]={text:`</${el.name}>`,sourceSpan:el.endSourceSpan??el.sourceSpan}}const node=new TagPlaceholder(el.name,attrs,startPhName,closePhName,children,isVoid,el.sourceSpan,el.startSourceSpan,el.endSourceSpan);return context.visitNodeFn(el,node)}visitAttribute(attribute,context){const node=attribute.valueTokens===undefined||attribute.valueTokens.length===1?new Text$2(attribute.value,attribute.valueSpan||attribute.sourceSpan):this._visitTextWithInterpolation(attribute.valueTokens,attribute.valueSpan||attribute.sourceSpan,context,attribute.i18n);return context.visitNodeFn(attribute,node)}visitText(text,context){const node=text.tokens.length===1?new Text$2(text.value,text.sourceSpan):this._visitTextWithInterpolation(text.tokens,text.sourceSpan,context,text.i18n);return context.visitNodeFn(text,node)}visitComment(comment,context){return null}visitExpansion(icu,context){context.icuDepth++;const i18nIcuCases={};const i18nIcu=new Icu(icu.switchValue,icu.type,i18nIcuCases,icu.sourceSpan);icu.cases.forEach((caze=>{i18nIcuCases[caze.value]=new Container(caze.expression.map((node=>node.visit(this,context))),caze.expSourceSpan)}));context.icuDepth--;if(context.isIcu||context.icuDepth>0){const expPh=context.placeholderRegistry.getUniquePlaceholder(`VAR_${icu.type}`);i18nIcu.expressionPlaceholder=expPh;context.placeholderToContent[expPh]={text:icu.switchValue,sourceSpan:icu.switchValueSourceSpan};return context.visitNodeFn(icu,i18nIcu)}const phName=context.placeholderRegistry.getPlaceholderName("ICU",icu.sourceSpan.toString());context.placeholderToMessage[phName]=this.toI18nMessage([icu],"","","",undefined);const node=new IcuPlaceholder(i18nIcu,phName,icu.sourceSpan);return context.visitNodeFn(icu,node)}visitExpansionCase(_icuCase,_context){throw new Error("Unreachable code")}visitBlock(block,context){const children=visitAll(this,block.children,context);if(this._containerBlocks.has(block.name)){return new Container(children,block.sourceSpan)}const parameters=block.parameters.map((param=>param.expression));const startPhName=context.placeholderRegistry.getStartBlockPlaceholderName(block.name,parameters);const closePhName=context.placeholderRegistry.getCloseBlockPlaceholderName(block.name);context.placeholderToContent[startPhName]={text:block.startSourceSpan.toString(),sourceSpan:block.startSourceSpan};context.placeholderToContent[closePhName]={text:block.endSourceSpan?block.endSourceSpan.toString():"}",sourceSpan:block.endSourceSpan??block.sourceSpan};const node=new BlockPlaceholder(block.name,parameters,startPhName,closePhName,children,block.sourceSpan,block.startSourceSpan,block.endSourceSpan);return context.visitNodeFn(block,node)}visitBlockParameter(_parameter,_context){throw new Error("Unreachable code")}_visitTextWithInterpolation(tokens,sourceSpan,context,previousI18n){const nodes=[];let hasInterpolation=false;for(const token of tokens){switch(token.type){case 8:case 17:hasInterpolation=true;const expression=token.parts[1];const baseName=extractPlaceholderName(expression)||"INTERPOLATION";const phName=context.placeholderRegistry.getPlaceholderName(baseName,expression);context.placeholderToContent[phName]={text:token.parts.join(""),sourceSpan:token.sourceSpan};nodes.push(new Placeholder(expression,phName,token.sourceSpan));break;default:if(token.parts[0].length>0){const previous=nodes[nodes.length-1];if(previous instanceof Text$2){previous.value+=token.parts[0];previous.sourceSpan=new ParseSourceSpan(previous.sourceSpan.start,token.sourceSpan.end,previous.sourceSpan.fullStart,previous.sourceSpan.details)}else{nodes.push(new Text$2(token.parts[0],token.sourceSpan))}}break}}if(hasInterpolation){reusePreviousSourceSpans(nodes,previousI18n);return new Container(nodes,sourceSpan)}else{return nodes[0]}}}function reusePreviousSourceSpans(nodes,previousI18n){if(previousI18n instanceof Message){assertSingleContainerMessage(previousI18n);previousI18n=previousI18n.nodes[0]}if(previousI18n instanceof Container){assertEquivalentNodes(previousI18n.children,nodes);for(let i=0;i<nodes.length;i++){nodes[i].sourceSpan=previousI18n.children[i].sourceSpan}}}function assertSingleContainerMessage(message){const nodes=message.nodes;if(nodes.length!==1||!(nodes[0]instanceof Container)){throw new Error("Unexpected previous i18n message - expected it to consist of only a single `Container` node.")}}function assertEquivalentNodes(previousNodes,nodes){if(previousNodes.length!==nodes.length){throw new Error("The number of i18n message children changed between first and second pass.")}if(previousNodes.some(((node,i)=>nodes[i].constructor!==node.constructor))){throw new Error("The types of the i18n message children changed between first and second pass.")}}const _CUSTOM_PH_EXP=/\/\/[\s\S]*i18n[\s\S]*\([\s\S]*ph[\s\S]*=[\s\S]*("|')([\s\S]*?)\1[\s\S]*\)/g;function extractPlaceholderName(input){return input.split(_CUSTOM_PH_EXP)[2]}class I18nError extends ParseError{constructor(span,msg){super(span,msg)}}const NAMED_ENTITIES={AElig:"\xc6",AMP:"&",amp:"&",Aacute:"\xc1",Abreve:"\u0102",Acirc:"\xc2",Acy:"\u0410",Afr:"\ud835\udd04",Agrave:"\xc0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2a53",Aogon:"\u0104",Aopf:"\ud835\udd38",ApplyFunction:"\u2061",af:"\u2061",Aring:"\xc5",angst:"\xc5",Ascr:"\ud835\udc9c",Assign:"\u2254",colone:"\u2254",coloneq:"\u2254",Atilde:"\xc3",Auml:"\xc4",Backslash:"\u2216",setminus:"\u2216",setmn:"\u2216",smallsetminus:"\u2216",ssetmn:"\u2216",Barv:"\u2ae7",Barwed:"\u2306",doublebarwedge:"\u2306",Bcy:"\u0411",Because:"\u2235",becaus:"\u2235",because:"\u2235",Bernoullis:"\u212c",Bscr:"\u212c",bernou:"\u212c",Beta:"\u0392",Bfr:"\ud835\udd05",Bopf:"\ud835\udd39",Breve:"\u02d8",breve:"\u02d8",Bumpeq:"\u224e",HumpDownHump:"\u224e",bump:"\u224e",CHcy:"\u0427",COPY:"\xa9",copy:"\xa9",Cacute:"\u0106",Cap:"\u22d2",CapitalDifferentialD:"\u2145",DD:"\u2145",Cayleys:"\u212d",Cfr:"\u212d",Ccaron:"\u010c",Ccedil:"\xc7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010a",Cedilla:"\xb8",cedil:"\xb8",CenterDot:"\xb7",centerdot:"\xb7",middot:"\xb7",Chi:"\u03a7",CircleDot:"\u2299",odot:"\u2299",CircleMinus:"\u2296",ominus:"\u2296",CirclePlus:"\u2295",oplus:"\u2295",CircleTimes:"\u2297",otimes:"\u2297",ClockwiseContourIntegral:"\u2232",cwconint:"\u2232",CloseCurlyDoubleQuote:"\u201d",rdquo:"\u201d",rdquor:"\u201d",CloseCurlyQuote:"\u2019",rsquo:"\u2019",rsquor:"\u2019",Colon:"\u2237",Proportion:"\u2237",Colone:"\u2a74",Congruent:"\u2261",equiv:"\u2261",Conint:"\u222f",DoubleContourIntegral:"\u222f",ContourIntegral:"\u222e",conint:"\u222e",oint:"\u222e",Copf:"\u2102",complexes:"\u2102",Coproduct:"\u2210",coprod:"\u2210",CounterClockwiseContourIntegral:"\u2233",awconint:"\u2233",Cross:"\u2a2f",Cscr:"\ud835\udc9e",Cup:"\u22d3",CupCap:"\u224d",asympeq:"\u224d",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040f",Dagger:"\u2021",ddagger:"\u2021",Darr:"\u21a1",Dashv:"\u2ae4",DoubleLeftTee:"\u2ae4",Dcaron:"\u010e",Dcy:"\u0414",Del:"\u2207",nabla:"\u2207",Delta:"\u0394",Dfr:"\ud835\udd07",DiacriticalAcute:"\xb4",acute:"\xb4",DiacriticalDot:"\u02d9",dot:"\u02d9",DiacriticalDoubleAcute:"\u02dd",dblac:"\u02dd",DiacriticalGrave:"`",grave:"`",DiacriticalTilde:"\u02dc",tilde:"\u02dc",Diamond:"\u22c4",diam:"\u22c4",diamond:"\u22c4",DifferentialD:"\u2146",dd:"\u2146",Dopf:"\ud835\udd3b",Dot:"\xa8",DoubleDot:"\xa8",die:"\xa8",uml:"\xa8",DotDot:"\u20dc",DotEqual:"\u2250",doteq:"\u2250",esdot:"\u2250",DoubleDownArrow:"\u21d3",Downarrow:"\u21d3",dArr:"\u21d3",DoubleLeftArrow:"\u21d0",Leftarrow:"\u21d0",lArr:"\u21d0",DoubleLeftRightArrow:"\u21d4",Leftrightarrow:"\u21d4",hArr:"\u21d4",iff:"\u21d4",DoubleLongLeftArrow:"\u27f8",Longleftarrow:"\u27f8",xlArr:"\u27f8",DoubleLongLeftRightArrow:"\u27fa",Longleftrightarrow:"\u27fa",xhArr:"\u27fa",DoubleLongRightArrow:"\u27f9",Longrightarrow:"\u27f9",xrArr:"\u27f9",DoubleRightArrow:"\u21d2",Implies:"\u21d2",Rightarrow:"\u21d2",rArr:"\u21d2",DoubleRightTee:"\u22a8",vDash:"\u22a8",DoubleUpArrow:"\u21d1",Uparrow:"\u21d1",uArr:"\u21d1",DoubleUpDownArrow:"\u21d5",Updownarrow:"\u21d5",vArr:"\u21d5",DoubleVerticalBar:"\u2225",par:"\u2225",parallel:"\u2225",shortparallel:"\u2225",spar:"\u2225",DownArrow:"\u2193",ShortDownArrow:"\u2193",darr:"\u2193",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21f5",duarr:"\u21f5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295e",DownLeftVector:"\u21bd",leftharpoondown:"\u21bd",lhard:"\u21bd",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295f",DownRightVector:"\u21c1",rhard:"\u21c1",rightharpoondown:"\u21c1",DownRightVectorBar:"\u2957",DownTee:"\u22a4",top:"\u22a4",DownTeeArrow:"\u21a7",mapstodown:"\u21a7",Dscr:"\ud835\udc9f",Dstrok:"\u0110",ENG:"\u014a",ETH:"\xd0",Eacute:"\xc9",Ecaron:"\u011a",Ecirc:"\xca",Ecy:"\u042d",Edot:"\u0116",Efr:"\ud835\udd08",Egrave:"\xc8",Element:"\u2208",in:"\u2208",isin:"\u2208",isinv:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25fb",EmptyVerySmallSquare:"\u25ab",Eogon:"\u0118",Eopf:"\ud835\udd3c",Epsilon:"\u0395",Equal:"\u2a75",EqualTilde:"\u2242",eqsim:"\u2242",esim:"\u2242",Equilibrium:"\u21cc",rightleftharpoons:"\u21cc",rlhar:"\u21cc",Escr:"\u2130",expectation:"\u2130",Esim:"\u2a73",Eta:"\u0397",Euml:"\xcb",Exists:"\u2203",exist:"\u2203",ExponentialE:"\u2147",ee:"\u2147",exponentiale:"\u2147",Fcy:"\u0424",Ffr:"\ud835\udd09",FilledSmallSquare:"\u25fc",FilledVerySmallSquare:"\u25aa",blacksquare:"\u25aa",squarf:"\u25aa",squf:"\u25aa",Fopf:"\ud835\udd3d",ForAll:"\u2200",forall:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",GT:">",gt:">",Gamma:"\u0393",Gammad:"\u03dc",Gbreve:"\u011e",Gcedil:"\u0122",Gcirc:"\u011c",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\ud835\udd0a",Gg:"\u22d9",ggg:"\u22d9",Gopf:"\ud835\udd3e",GreaterEqual:"\u2265",ge:"\u2265",geq:"\u2265",GreaterEqualLess:"\u22db",gel:"\u22db",gtreqless:"\u22db",GreaterFullEqual:"\u2267",gE:"\u2267",geqq:"\u2267",GreaterGreater:"\u2aa2",GreaterLess:"\u2277",gl:"\u2277",gtrless:"\u2277",GreaterSlantEqual:"\u2a7e",geqslant:"\u2a7e",ges:"\u2a7e",GreaterTilde:"\u2273",gsim:"\u2273",gtrsim:"\u2273",Gscr:"\ud835\udca2",Gt:"\u226b",NestedGreaterGreater:"\u226b",gg:"\u226b",HARDcy:"\u042a",Hacek:"\u02c7",caron:"\u02c7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210c",Poincareplane:"\u210c",HilbertSpace:"\u210b",Hscr:"\u210b",hamilt:"\u210b",Hopf:"\u210d",quaternions:"\u210d",HorizontalLine:"\u2500",boxh:"\u2500",Hstrok:"\u0126",HumpEqual:"\u224f",bumpe:"\u224f",bumpeq:"\u224f",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xcd",Icirc:"\xce",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Im:"\u2111",image:"\u2111",imagpart:"\u2111",Igrave:"\xcc",Imacr:"\u012a",ImaginaryI:"\u2148",ii:"\u2148",Int:"\u222c",Integral:"\u222b",int:"\u222b",Intersection:"\u22c2",bigcap:"\u22c2",xcap:"\u22c2",InvisibleComma:"\u2063",ic:"\u2063",InvisibleTimes:"\u2062",it:"\u2062",Iogon:"\u012e",Iopf:"\ud835\udd40",Iota:"\u0399",Iscr:"\u2110",imagline:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xcf",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\ud835\udd0d",Jopf:"\ud835\udd41",Jscr:"\ud835\udca5",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040c",Kappa:"\u039a",Kcedil:"\u0136",Kcy:"\u041a",Kfr:"\ud835\udd0e",Kopf:"\ud835\udd42",Kscr:"\ud835\udca6",LJcy:"\u0409",LT:"<",lt:"<",Lacute:"\u0139",Lambda:"\u039b",Lang:"\u27ea",Laplacetrf:"\u2112",Lscr:"\u2112",lagran:"\u2112",Larr:"\u219e",twoheadleftarrow:"\u219e",Lcaron:"\u013d",Lcedil:"\u013b",Lcy:"\u041b",LeftAngleBracket:"\u27e8",lang:"\u27e8",langle:"\u27e8",LeftArrow:"\u2190",ShortLeftArrow:"\u2190",larr:"\u2190",leftarrow:"\u2190",slarr:"\u2190",LeftArrowBar:"\u21e4",larrb:"\u21e4",LeftArrowRightArrow:"\u21c6",leftrightarrows:"\u21c6",lrarr:"\u21c6",LeftCeiling:"\u2308",lceil:"\u2308",LeftDoubleBracket:"\u27e6",lobrk:"\u27e6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21c3",dharl:"\u21c3",downharpoonleft:"\u21c3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230a",lfloor:"\u230a",LeftRightArrow:"\u2194",harr:"\u2194",leftrightarrow:"\u2194",LeftRightVector:"\u294e",LeftTee:"\u22a3",dashv:"\u22a3",LeftTeeArrow:"\u21a4",mapstoleft:"\u21a4",LeftTeeVector:"\u295a",LeftTriangle:"\u22b2",vartriangleleft:"\u22b2",vltri:"\u22b2",LeftTriangleBar:"\u29cf",LeftTriangleEqual:"\u22b4",ltrie:"\u22b4",trianglelefteq:"\u22b4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21bf",uharl:"\u21bf",upharpoonleft:"\u21bf",LeftUpVectorBar:"\u2958",LeftVector:"\u21bc",leftharpoonup:"\u21bc",lharu:"\u21bc",LeftVectorBar:"\u2952",LessEqualGreater:"\u22da",leg:"\u22da",lesseqgtr:"\u22da",LessFullEqual:"\u2266",lE:"\u2266",leqq:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",lg:"\u2276",LessLess:"\u2aa1",LessSlantEqual:"\u2a7d",leqslant:"\u2a7d",les:"\u2a7d",LessTilde:"\u2272",lesssim:"\u2272",lsim:"\u2272",Lfr:"\ud835\udd0f",Ll:"\u22d8",Lleftarrow:"\u21da",lAarr:"\u21da",Lmidot:"\u013f",LongLeftArrow:"\u27f5",longleftarrow:"\u27f5",xlarr:"\u27f5",LongLeftRightArrow:"\u27f7",longleftrightarrow:"\u27f7",xharr:"\u27f7",LongRightArrow:"\u27f6",longrightarrow:"\u27f6",xrarr:"\u27f6",Lopf:"\ud835\udd43",LowerLeftArrow:"\u2199",swarr:"\u2199",swarrow:"\u2199",LowerRightArrow:"\u2198",searr:"\u2198",searrow:"\u2198",Lsh:"\u21b0",lsh:"\u21b0",Lstrok:"\u0141",Lt:"\u226a",NestedLessLess:"\u226a",ll:"\u226a",Map:"\u2905",Mcy:"\u041c",MediumSpace:"\u205f",Mellintrf:"\u2133",Mscr:"\u2133",phmmat:"\u2133",Mfr:"\ud835\udd10",MinusPlus:"\u2213",mnplus:"\u2213",mp:"\u2213",Mopf:"\ud835\udd44",Mu:"\u039c",NJcy:"\u040a",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041d",NegativeMediumSpace:"\u200b",NegativeThickSpace:"\u200b",NegativeThinSpace:"\u200b",NegativeVeryThinSpace:"\u200b",ZeroWidthSpace:"\u200b",NewLine:"\n",Nfr:"\ud835\udd11",NoBreak:"\u2060",NonBreakingSpace:"\xa0",nbsp:"\xa0",Nopf:"\u2115",naturals:"\u2115",Not:"\u2aec",NotCongruent:"\u2262",nequiv:"\u2262",NotCupCap:"\u226d",NotDoubleVerticalBar:"\u2226",npar:"\u2226",nparallel:"\u2226",nshortparallel:"\u2226",nspar:"\u2226",NotElement:"\u2209",notin:"\u2209",notinva:"\u2209",NotEqual:"\u2260",ne:"\u2260",NotEqualTilde:"\u2242\u0338",nesim:"\u2242\u0338",NotExists:"\u2204",nexist:"\u2204",nexists:"\u2204",NotGreater:"\u226f",ngt:"\u226f",ngtr:"\u226f",NotGreaterEqual:"\u2271",nge:"\u2271",ngeq:"\u2271",NotGreaterFullEqual:"\u2267\u0338",ngE:"\u2267\u0338",ngeqq:"\u2267\u0338",NotGreaterGreater:"\u226b\u0338",nGtv:"\u226b\u0338",NotGreaterLess:"\u2279",ntgl:"\u2279",NotGreaterSlantEqual:"\u2a7e\u0338",ngeqslant:"\u2a7e\u0338",nges:"\u2a7e\u0338",NotGreaterTilde:"\u2275",ngsim:"\u2275",NotHumpDownHump:"\u224e\u0338",nbump:"\u224e\u0338",NotHumpEqual:"\u224f\u0338",nbumpe:"\u224f\u0338",NotLeftTriangle:"\u22ea",nltri:"\u22ea",ntriangleleft:"\u22ea",NotLeftTriangleBar:"\u29cf\u0338",NotLeftTriangleEqual:"\u22ec",nltrie:"\u22ec",ntrianglelefteq:"\u22ec",NotLess:"\u226e",nless:"\u226e",nlt:"\u226e",NotLessEqual:"\u2270",nle:"\u2270",nleq:"\u2270",NotLessGreater:"\u2278",ntlg:"\u2278",NotLessLess:"\u226a\u0338",nLtv:"\u226a\u0338",NotLessSlantEqual:"\u2a7d\u0338",nleqslant:"\u2a7d\u0338",nles:"\u2a7d\u0338",NotLessTilde:"\u2274",nlsim:"\u2274",NotNestedGreaterGreater:"\u2aa2\u0338",NotNestedLessLess:"\u2aa1\u0338",NotPrecedes:"\u2280",npr:"\u2280",nprec:"\u2280",NotPrecedesEqual:"\u2aaf\u0338",npre:"\u2aaf\u0338",npreceq:"\u2aaf\u0338",NotPrecedesSlantEqual:"\u22e0",nprcue:"\u22e0",NotReverseElement:"\u220c",notni:"\u220c",notniva:"\u220c",NotRightTriangle:"\u22eb",nrtri:"\u22eb",ntriangleright:"\u22eb",NotRightTriangleBar:"\u29d0\u0338",NotRightTriangleEqual:"\u22ed",nrtrie:"\u22ed",ntrianglerighteq:"\u22ed",NotSquareSubset:"\u228f\u0338",NotSquareSubsetEqual:"\u22e2",nsqsube:"\u22e2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22e3",nsqsupe:"\u22e3",NotSubset:"\u2282\u20d2",nsubset:"\u2282\u20d2",vnsub:"\u2282\u20d2",NotSubsetEqual:"\u2288",nsube:"\u2288",nsubseteq:"\u2288",NotSucceeds:"\u2281",nsc:"\u2281",nsucc:"\u2281",NotSucceedsEqual:"\u2ab0\u0338",nsce:"\u2ab0\u0338",nsucceq:"\u2ab0\u0338",NotSucceedsSlantEqual:"\u22e1",nsccue:"\u22e1",NotSucceedsTilde:"\u227f\u0338",NotSuperset:"\u2283\u20d2",nsupset:"\u2283\u20d2",vnsup:"\u2283\u20d2",NotSupersetEqual:"\u2289",nsupe:"\u2289",nsupseteq:"\u2289",NotTilde:"\u2241",nsim:"\u2241",NotTildeEqual:"\u2244",nsime:"\u2244",nsimeq:"\u2244",NotTildeFullEqual:"\u2247",ncong:"\u2247",NotTildeTilde:"\u2249",nap:"\u2249",napprox:"\u2249",NotVerticalBar:"\u2224",nmid:"\u2224",nshortmid:"\u2224",nsmid:"\u2224",Nscr:"\ud835\udca9",Ntilde:"\xd1",Nu:"\u039d",OElig:"\u0152",Oacute:"\xd3",Ocirc:"\xd4",Ocy:"\u041e",Odblac:"\u0150",Ofr:"\ud835\udd12",Ograve:"\xd2",Omacr:"\u014c",Omega:"\u03a9",ohm:"\u03a9",Omicron:"\u039f",Oopf:"\ud835\udd46",OpenCurlyDoubleQuote:"\u201c",ldquo:"\u201c",OpenCurlyQuote:"\u2018",lsquo:"\u2018",Or:"\u2a54",Oscr:"\ud835\udcaa",Oslash:"\xd8",Otilde:"\xd5",Otimes:"\u2a37",Ouml:"\xd6",OverBar:"\u203e",oline:"\u203e",OverBrace:"\u23de",OverBracket:"\u23b4",tbrk:"\u23b4",OverParenthesis:"\u23dc",PartialD:"\u2202",part:"\u2202",Pcy:"\u041f",Pfr:"\ud835\udd13",Phi:"\u03a6",Pi:"\u03a0",PlusMinus:"\xb1",plusmn:"\xb1",pm:"\xb1",Popf:"\u2119",primes:"\u2119",Pr:"\u2abb",Precedes:"\u227a",pr:"\u227a",prec:"\u227a",PrecedesEqual:"\u2aaf",pre:"\u2aaf",preceq:"\u2aaf",PrecedesSlantEqual:"\u227c",prcue:"\u227c",preccurlyeq:"\u227c",PrecedesTilde:"\u227e",precsim:"\u227e",prsim:"\u227e",Prime:"\u2033",Product:"\u220f",prod:"\u220f",Proportional:"\u221d",prop:"\u221d",propto:"\u221d",varpropto:"\u221d",vprop:"\u221d",Pscr:"\ud835\udcab",Psi:"\u03a8",QUOT:'"',quot:'"',Qfr:"\ud835\udd14",Qopf:"\u211a",rationals:"\u211a",Qscr:"\ud835\udcac",RBarr:"\u2910",drbkarow:"\u2910",REG:"\xae",circledR:"\xae",reg:"\xae",Racute:"\u0154",Rang:"\u27eb",Rarr:"\u21a0",twoheadrightarrow:"\u21a0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211c",Rfr:"\u211c",real:"\u211c",realpart:"\u211c",ReverseElement:"\u220b",SuchThat:"\u220b",ni:"\u220b",niv:"\u220b",ReverseEquilibrium:"\u21cb",leftrightharpoons:"\u21cb",lrhar:"\u21cb",ReverseUpEquilibrium:"\u296f",duhar:"\u296f",Rho:"\u03a1",RightAngleBracket:"\u27e9",rang:"\u27e9",rangle:"\u27e9",RightArrow:"\u2192",ShortRightArrow:"\u2192",rarr:"\u2192",rightarrow:"\u2192",srarr:"\u2192",RightArrowBar:"\u21e5",rarrb:"\u21e5",RightArrowLeftArrow:"\u21c4",rightleftarrows:"\u21c4",rlarr:"\u21c4",RightCeiling:"\u2309",rceil:"\u2309",RightDoubleBracket:"\u27e7",robrk:"\u27e7",RightDownTeeVector:"\u295d",RightDownVector:"\u21c2",dharr:"\u21c2",downharpoonright:"\u21c2",RightDownVectorBar:"\u2955",RightFloor:"\u230b",rfloor:"\u230b",RightTee:"\u22a2",vdash:"\u22a2",RightTeeArrow:"\u21a6",map:"\u21a6",mapsto:"\u21a6",RightTeeVector:"\u295b",RightTriangle:"\u22b3",vartriangleright:"\u22b3",vrtri:"\u22b3",RightTriangleBar:"\u29d0",RightTriangleEqual:"\u22b5",rtrie:"\u22b5",trianglerighteq:"\u22b5",RightUpDownVector:"\u294f",RightUpTeeVector:"\u295c",RightUpVector:"\u21be",uharr:"\u21be",upharpoonright:"\u21be",RightUpVectorBar:"\u2954",RightVector:"\u21c0",rharu:"\u21c0",rightharpoonup:"\u21c0",RightVectorBar:"\u2953",Ropf:"\u211d",reals:"\u211d",RoundImplies:"\u2970",Rrightarrow:"\u21db",rAarr:"\u21db",Rscr:"\u211b",realine:"\u211b",Rsh:"\u21b1",rsh:"\u21b1",RuleDelayed:"\u29f4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042c",Sacute:"\u015a",Sc:"\u2abc",Scaron:"\u0160",Scedil:"\u015e",Scirc:"\u015c",Scy:"\u0421",Sfr:"\ud835\udd16",ShortUpArrow:"\u2191",UpArrow:"\u2191",uarr:"\u2191",uparrow:"\u2191",Sigma:"\u03a3",SmallCircle:"\u2218",compfn:"\u2218",Sopf:"\ud835\udd4a",Sqrt:"\u221a",radic:"\u221a",Square:"\u25a1",squ:"\u25a1",square:"\u25a1",SquareIntersection:"\u2293",sqcap:"\u2293",SquareSubset:"\u228f",sqsub:"\u228f",sqsubset:"\u228f",SquareSubsetEqual:"\u2291",sqsube:"\u2291",sqsubseteq:"\u2291",SquareSuperset:"\u2290",sqsup:"\u2290",sqsupset:"\u2290",SquareSupersetEqual:"\u2292",sqsupe:"\u2292",sqsupseteq:"\u2292",SquareUnion:"\u2294",sqcup:"\u2294",Sscr:"\ud835\udcae",Star:"\u22c6",sstarf:"\u22c6",Sub:"\u22d0",Subset:"\u22d0",SubsetEqual:"\u2286",sube:"\u2286",subseteq:"\u2286",Succeeds:"\u227b",sc:"\u227b",succ:"\u227b",SucceedsEqual:"\u2ab0",sce:"\u2ab0",succeq:"\u2ab0",SucceedsSlantEqual:"\u227d",sccue:"\u227d",succcurlyeq:"\u227d",SucceedsTilde:"\u227f",scsim:"\u227f",succsim:"\u227f",Sum:"\u2211",sum:"\u2211",Sup:"\u22d1",Supset:"\u22d1",Superset:"\u2283",sup:"\u2283",supset:"\u2283",SupersetEqual:"\u2287",supe:"\u2287",supseteq:"\u2287",THORN:"\xde",TRADE:"\u2122",trade:"\u2122",TSHcy:"\u040b",TScy:"\u0426",Tab:"\t",Tau:"\u03a4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\ud835\udd17",Therefore:"\u2234",there4:"\u2234",therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205f\u200a",ThinSpace:"\u2009",thinsp:"\u2009",Tilde:"\u223c",sim:"\u223c",thicksim:"\u223c",thksim:"\u223c",TildeEqual:"\u2243",sime:"\u2243",simeq:"\u2243",TildeFullEqual:"\u2245",cong:"\u2245",TildeTilde:"\u2248",ap:"\u2248",approx:"\u2248",asymp:"\u2248",thickapprox:"\u2248",thkap:"\u2248",Topf:"\ud835\udd4b",TripleDot:"\u20db",tdot:"\u20db",Tscr:"\ud835\udcaf",Tstrok:"\u0166",Uacute:"\xda",Uarr:"\u219f",Uarrocir:"\u2949",Ubrcy:"\u040e",Ubreve:"\u016c",Ucirc:"\xdb",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\ud835\udd18",Ugrave:"\xd9",Umacr:"\u016a",UnderBar:"_",lowbar:"_",UnderBrace:"\u23df",UnderBracket:"\u23b5",bbrk:"\u23b5",UnderParenthesis:"\u23dd",Union:"\u22c3",bigcup:"\u22c3",xcup:"\u22c3",UnionPlus:"\u228e",uplus:"\u228e",Uogon:"\u0172",Uopf:"\ud835\udd4c",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21c5",udarr:"\u21c5",UpDownArrow:"\u2195",updownarrow:"\u2195",varr:"\u2195",UpEquilibrium:"\u296e",udhar:"\u296e",UpTee:"\u22a5",bot:"\u22a5",bottom:"\u22a5",perp:"\u22a5",UpTeeArrow:"\u21a5",mapstoup:"\u21a5",UpperLeftArrow:"\u2196",nwarr:"\u2196",nwarrow:"\u2196",UpperRightArrow:"\u2197",nearr:"\u2197",nearrow:"\u2197",Upsi:"\u03d2",upsih:"\u03d2",Upsilon:"\u03a5",Uring:"\u016e",Uscr:"\ud835\udcb0",Utilde:"\u0168",Uuml:"\xdc",VDash:"\u22ab",Vbar:"\u2aeb",Vcy:"\u0412",Vdash:"\u22a9",Vdashl:"\u2ae6",Vee:"\u22c1",bigvee:"\u22c1",xvee:"\u22c1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",mid:"\u2223",shortmid:"\u2223",smid:"\u2223",VerticalLine:"|",verbar:"|",vert:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",wr:"\u2240",wreath:"\u2240",VeryThinSpace:"\u200a",hairsp:"\u200a",Vfr:"\ud835\udd19",Vopf:"\ud835\udd4d",Vscr:"\ud835\udcb1",Vvdash:"\u22aa",Wcirc:"\u0174",Wedge:"\u22c0",bigwedge:"\u22c0",xwedge:"\u22c0",Wfr:"\ud835\udd1a",Wopf:"\ud835\udd4e",Wscr:"\ud835\udcb2",Xfr:"\ud835\udd1b",Xi:"\u039e",Xopf:"\ud835\udd4f",Xscr:"\ud835\udcb3",YAcy:"\u042f",YIcy:"\u0407",YUcy:"\u042e",Yacute:"\xdd",Ycirc:"\u0176",Ycy:"\u042b",Yfr:"\ud835\udd1c",Yopf:"\ud835\udd50",Yscr:"\ud835\udcb4",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017d",Zcy:"\u0417",Zdot:"\u017b",Zeta:"\u0396",Zfr:"\u2128",zeetrf:"\u2128",Zopf:"\u2124",integers:"\u2124",Zscr:"\ud835\udcb5",aacute:"\xe1",abreve:"\u0103",ac:"\u223e",mstpos:"\u223e",acE:"\u223e\u0333",acd:"\u223f",acirc:"\xe2",acy:"\u0430",aelig:"\xe6",afr:"\ud835\udd1e",agrave:"\xe0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03b1",amacr:"\u0101",amalg:"\u2a3f",and:"\u2227",wedge:"\u2227",andand:"\u2a55",andd:"\u2a5c",andslope:"\u2a58",andv:"\u2a5a",ang:"\u2220",angle:"\u2220",ange:"\u29a4",angmsd:"\u2221",measuredangle:"\u2221",angmsdaa:"\u29a8",angmsdab:"\u29a9",angmsdac:"\u29aa",angmsdad:"\u29ab",angmsdae:"\u29ac",angmsdaf:"\u29ad",angmsdag:"\u29ae",angmsdah:"\u29af",angrt:"\u221f",angrtvb:"\u22be",angrtvbd:"\u299d",angsph:"\u2222",angzarr:"\u237c",aogon:"\u0105",aopf:"\ud835\udd52",apE:"\u2a70",apacir:"\u2a6f",ape:"\u224a",approxeq:"\u224a",apid:"\u224b",apos:"'",aring:"\xe5",ascr:"\ud835\udcb6",ast:"*",midast:"*",atilde:"\xe3",auml:"\xe4",awint:"\u2a11",bNot:"\u2aed",backcong:"\u224c",bcong:"\u224c",backepsilon:"\u03f6",bepsi:"\u03f6",backprime:"\u2035",bprime:"\u2035",backsim:"\u223d",bsim:"\u223d",backsimeq:"\u22cd",bsime:"\u22cd",barvee:"\u22bd",barwed:"\u2305",barwedge:"\u2305",bbrktbrk:"\u23b6",bcy:"\u0431",bdquo:"\u201e",ldquor:"\u201e",bemptyv:"\u29b0",beta:"\u03b2",beth:"\u2136",between:"\u226c",twixt:"\u226c",bfr:"\ud835\udd1f",bigcirc:"\u25ef",xcirc:"\u25ef",bigodot:"\u2a00",xodot:"\u2a00",bigoplus:"\u2a01",xoplus:"\u2a01",bigotimes:"\u2a02",xotime:"\u2a02",bigsqcup:"\u2a06",xsqcup:"\u2a06",bigstar:"\u2605",starf:"\u2605",bigtriangledown:"\u25bd",xdtri:"\u25bd",bigtriangleup:"\u25b3",xutri:"\u25b3",biguplus:"\u2a04",xuplus:"\u2a04",bkarow:"\u290d",rbarr:"\u290d",blacklozenge:"\u29eb",lozf:"\u29eb",blacktriangle:"\u25b4",utrif:"\u25b4",blacktriangledown:"\u25be",dtrif:"\u25be",blacktriangleleft:"\u25c2",ltrif:"\u25c2",blacktriangleright:"\u25b8",rtrif:"\u25b8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20e5",bnequiv:"\u2261\u20e5",bnot:"\u2310",bopf:"\ud835\udd53",bowtie:"\u22c8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255d",boxUR:"\u255a",boxUl:"\u255c",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256c",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256b",boxVl:"\u2562",boxVr:"\u255f",boxbox:"\u29c9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250c",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252c",boxhu:"\u2534",boxminus:"\u229f",minusb:"\u229f",boxplus:"\u229e",plusb:"\u229e",boxtimes:"\u22a0",timesb:"\u22a0",boxuL:"\u255b",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256a",boxvL:"\u2561",boxvR:"\u255e",boxvh:"\u253c",boxvl:"\u2524",boxvr:"\u251c",brvbar:"\xa6",bscr:"\ud835\udcb7",bsemi:"\u204f",bsol:"\\",bsolb:"\u29c5",bsolhsub:"\u27c8",bull:"\u2022",bullet:"\u2022",bumpE:"\u2aae",cacute:"\u0107",cap:"\u2229",capand:"\u2a44",capbrcup:"\u2a49",capcap:"\u2a4b",capcup:"\u2a47",capdot:"\u2a40",caps:"\u2229\ufe00",caret:"\u2041",ccaps:"\u2a4d",ccaron:"\u010d",ccedil:"\xe7",ccirc:"\u0109",ccups:"\u2a4c",ccupssm:"\u2a50",cdot:"\u010b",cemptyv:"\u29b2",cent:"\xa2",cfr:"\ud835\udd20",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03c7",cir:"\u25cb",cirE:"\u29c3",circ:"\u02c6",circeq:"\u2257",cire:"\u2257",circlearrowleft:"\u21ba",olarr:"\u21ba",circlearrowright:"\u21bb",orarr:"\u21bb",circledS:"\u24c8",oS:"\u24c8",circledast:"\u229b",oast:"\u229b",circledcirc:"\u229a",ocir:"\u229a",circleddash:"\u229d",odash:"\u229d",cirfnint:"\u2a10",cirmid:"\u2aef",cirscir:"\u29c2",clubs:"\u2663",clubsuit:"\u2663",colon:":",comma:",",commat:"@",comp:"\u2201",complement:"\u2201",congdot:"\u2a6d",copf:"\ud835\udd54",copysr:"\u2117",crarr:"\u21b5",cross:"\u2717",cscr:"\ud835\udcb8",csub:"\u2acf",csube:"\u2ad1",csup:"\u2ad0",csupe:"\u2ad2",ctdot:"\u22ef",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22de",curlyeqprec:"\u22de",cuesc:"\u22df",curlyeqsucc:"\u22df",cularr:"\u21b6",curvearrowleft:"\u21b6",cularrp:"\u293d",cup:"\u222a",cupbrcap:"\u2a48",cupcap:"\u2a46",cupcup:"\u2a4a",cupdot:"\u228d",cupor:"\u2a45",cups:"\u222a\ufe00",curarr:"\u21b7",curvearrowright:"\u21b7",curarrm:"\u293c",curlyvee:"\u22ce",cuvee:"\u22ce",curlywedge:"\u22cf",cuwed:"\u22cf",curren:"\xa4",cwint:"\u2231",cylcty:"\u232d",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",dash:"\u2010",hyphen:"\u2010",dbkarow:"\u290f",rBarr:"\u290f",dcaron:"\u010f",dcy:"\u0434",ddarr:"\u21ca",downdownarrows:"\u21ca",ddotseq:"\u2a77",eDDot:"\u2a77",deg:"\xb0",delta:"\u03b4",demptyv:"\u29b1",dfisht:"\u297f",dfr:"\ud835\udd21",diamondsuit:"\u2666",diams:"\u2666",digamma:"\u03dd",gammad:"\u03dd",disin:"\u22f2",div:"\xf7",divide:"\xf7",divideontimes:"\u22c7",divonx:"\u22c7",djcy:"\u0452",dlcorn:"\u231e",llcorner:"\u231e",dlcrop:"\u230d",dollar:"$",dopf:"\ud835\udd55",doteqdot:"\u2251",eDot:"\u2251",dotminus:"\u2238",minusd:"\u2238",dotplus:"\u2214",plusdo:"\u2214",dotsquare:"\u22a1",sdotb:"\u22a1",drcorn:"\u231f",lrcorner:"\u231f",drcrop:"\u230c",dscr:"\ud835\udcb9",dscy:"\u0455",dsol:"\u29f6",dstrok:"\u0111",dtdot:"\u22f1",dtri:"\u25bf",triangledown:"\u25bf",dwangle:"\u29a6",dzcy:"\u045f",dzigrarr:"\u27ff",eacute:"\xe9",easter:"\u2a6e",ecaron:"\u011b",ecir:"\u2256",eqcirc:"\u2256",ecirc:"\xea",ecolon:"\u2255",eqcolon:"\u2255",ecy:"\u044d",edot:"\u0117",efDot:"\u2252",fallingdotseq:"\u2252",efr:"\ud835\udd22",eg:"\u2a9a",egrave:"\xe8",egs:"\u2a96",eqslantgtr:"\u2a96",egsdot:"\u2a98",el:"\u2a99",elinters:"\u23e7",ell:"\u2113",els:"\u2a95",eqslantless:"\u2a95",elsdot:"\u2a97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",varnothing:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014b",ensp:"\u2002",eogon:"\u0119",eopf:"\ud835\udd56",epar:"\u22d5",eparsl:"\u29e3",eplus:"\u2a71",epsi:"\u03b5",epsilon:"\u03b5",epsiv:"\u03f5",straightepsilon:"\u03f5",varepsilon:"\u03f5",equals:"=",equest:"\u225f",questeq:"\u225f",equivDD:"\u2a78",eqvparsl:"\u29e5",erDot:"\u2253",risingdotseq:"\u2253",erarr:"\u2971",escr:"\u212f",eta:"\u03b7",eth:"\xf0",euml:"\xeb",euro:"\u20ac",excl:"!",fcy:"\u0444",female:"\u2640",ffilig:"\ufb03",fflig:"\ufb00",ffllig:"\ufb04",ffr:"\ud835\udd23",filig:"\ufb01",fjlig:"fj",flat:"\u266d",fllig:"\ufb02",fltns:"\u25b1",fnof:"\u0192",fopf:"\ud835\udd57",fork:"\u22d4",pitchfork:"\u22d4",forkv:"\u2ad9",fpartint:"\u2a0d",frac12:"\xbd",half:"\xbd",frac13:"\u2153",frac14:"\xbc",frac15:"\u2155",frac16:"\u2159",frac18:"\u215b",frac23:"\u2154",frac25:"\u2156",frac34:"\xbe",frac35:"\u2157",frac38:"\u215c",frac45:"\u2158",frac56:"\u215a",frac58:"\u215d",frac78:"\u215e",frasl:"\u2044",frown:"\u2322",sfrown:"\u2322",fscr:"\ud835\udcbb",gEl:"\u2a8c",gtreqqless:"\u2a8c",gacute:"\u01f5",gamma:"\u03b3",gap:"\u2a86",gtrapprox:"\u2a86",gbreve:"\u011f",gcirc:"\u011d",gcy:"\u0433",gdot:"\u0121",gescc:"\u2aa9",gesdot:"\u2a80",gesdoto:"\u2a82",gesdotol:"\u2a84",gesl:"\u22db\ufe00",gesles:"\u2a94",gfr:"\ud835\udd24",gimel:"\u2137",gjcy:"\u0453",glE:"\u2a92",gla:"\u2aa5",glj:"\u2aa4",gnE:"\u2269",gneqq:"\u2269",gnap:"\u2a8a",gnapprox:"\u2a8a",gne:"\u2a88",gneq:"\u2a88",gnsim:"\u22e7",gopf:"\ud835\udd58",gscr:"\u210a",gsime:"\u2a8e",gsiml:"\u2a90",gtcc:"\u2aa7",gtcir:"\u2a7a",gtdot:"\u22d7",gtrdot:"\u22d7",gtlPar:"\u2995",gtquest:"\u2a7c",gtrarr:"\u2978",gvertneqq:"\u2269\ufe00",gvnE:"\u2269\ufe00",hardcy:"\u044a",harrcir:"\u2948",harrw:"\u21ad",leftrightsquigarrow:"\u21ad",hbar:"\u210f",hslash:"\u210f",planck:"\u210f",plankv:"\u210f",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",mldr:"\u2026",hercon:"\u22b9",hfr:"\ud835\udd25",hksearow:"\u2925",searhk:"\u2925",hkswarow:"\u2926",swarhk:"\u2926",hoarr:"\u21ff",homtht:"\u223b",hookleftarrow:"\u21a9",larrhk:"\u21a9",hookrightarrow:"\u21aa",rarrhk:"\u21aa",hopf:"\ud835\udd59",horbar:"\u2015",hscr:"\ud835\udcbd",hstrok:"\u0127",hybull:"\u2043",iacute:"\xed",icirc:"\xee",icy:"\u0438",iecy:"\u0435",iexcl:"\xa1",ifr:"\ud835\udd26",igrave:"\xec",iiiint:"\u2a0c",qint:"\u2a0c",iiint:"\u222d",tint:"\u222d",iinfin:"\u29dc",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012b",imath:"\u0131",inodot:"\u0131",imof:"\u22b7",imped:"\u01b5",incare:"\u2105",infin:"\u221e",infintie:"\u29dd",intcal:"\u22ba",intercal:"\u22ba",intlarhk:"\u2a17",intprod:"\u2a3c",iprod:"\u2a3c",iocy:"\u0451",iogon:"\u012f",iopf:"\ud835\udd5a",iota:"\u03b9",iquest:"\xbf",iscr:"\ud835\udcbe",isinE:"\u22f9",isindot:"\u22f5",isins:"\u22f4",isinsv:"\u22f3",itilde:"\u0129",iukcy:"\u0456",iuml:"\xef",jcirc:"\u0135",jcy:"\u0439",jfr:"\ud835\udd27",jmath:"\u0237",jopf:"\ud835\udd5b",jscr:"\ud835\udcbf",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03ba",kappav:"\u03f0",varkappa:"\u03f0",kcedil:"\u0137",kcy:"\u043a",kfr:"\ud835\udd28",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045c",kopf:"\ud835\udd5c",kscr:"\ud835\udcc0",lAtail:"\u291b",lBarr:"\u290e",lEg:"\u2a8b",lesseqqgtr:"\u2a8b",lHar:"\u2962",lacute:"\u013a",laemptyv:"\u29b4",lambda:"\u03bb",langd:"\u2991",lap:"\u2a85",lessapprox:"\u2a85",laquo:"\xab",larrbfs:"\u291f",larrfs:"\u291d",larrlp:"\u21ab",looparrowleft:"\u21ab",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21a2",leftarrowtail:"\u21a2",lat:"\u2aab",latail:"\u2919",late:"\u2aad",lates:"\u2aad\ufe00",lbarr:"\u290c",lbbrk:"\u2772",lbrace:"{",lcub:"{",lbrack:"[",lsqb:"[",lbrke:"\u298b",lbrksld:"\u298f",lbrkslu:"\u298d",lcaron:"\u013e",lcedil:"\u013c",lcy:"\u043b",ldca:"\u2936",ldrdhar:"\u2967",ldrushar:"\u294b",ldsh:"\u21b2",le:"\u2264",leq:"\u2264",leftleftarrows:"\u21c7",llarr:"\u21c7",leftthreetimes:"\u22cb",lthree:"\u22cb",lescc:"\u2aa8",lesdot:"\u2a7f",lesdoto:"\u2a81",lesdotor:"\u2a83",lesg:"\u22da\ufe00",lesges:"\u2a93",lessdot:"\u22d6",ltdot:"\u22d6",lfisht:"\u297c",lfr:"\ud835\udd29",lgE:"\u2a91",lharul:"\u296a",lhblk:"\u2584",ljcy:"\u0459",llhard:"\u296b",lltri:"\u25fa",lmidot:"\u0140",lmoust:"\u23b0",lmoustache:"\u23b0",lnE:"\u2268",lneqq:"\u2268",lnap:"\u2a89",lnapprox:"\u2a89",lne:"\u2a87",lneq:"\u2a87",lnsim:"\u22e6",loang:"\u27ec",loarr:"\u21fd",longmapsto:"\u27fc",xmap:"\u27fc",looparrowright:"\u21ac",rarrlp:"\u21ac",lopar:"\u2985",lopf:"\ud835\udd5d",loplus:"\u2a2d",lotimes:"\u2a34",lowast:"\u2217",loz:"\u25ca",lozenge:"\u25ca",lpar:"(",lparlt:"\u2993",lrhard:"\u296d",lrm:"\u200e",lrtri:"\u22bf",lsaquo:"\u2039",lscr:"\ud835\udcc1",lsime:"\u2a8d",lsimg:"\u2a8f",lsquor:"\u201a",sbquo:"\u201a",lstrok:"\u0142",ltcc:"\u2aa6",ltcir:"\u2a79",ltimes:"\u22c9",ltlarr:"\u2976",ltquest:"\u2a7b",ltrPar:"\u2996",ltri:"\u25c3",triangleleft:"\u25c3",lurdshar:"\u294a",luruhar:"\u2966",lvertneqq:"\u2268\ufe00",lvnE:"\u2268\ufe00",mDDot:"\u223a",macr:"\xaf",strns:"\xaf",male:"\u2642",malt:"\u2720",maltese:"\u2720",marker:"\u25ae",mcomma:"\u2a29",mcy:"\u043c",mdash:"\u2014",mfr:"\ud835\udd2a",mho:"\u2127",micro:"\xb5",midcir:"\u2af0",minus:"\u2212",minusdu:"\u2a2a",mlcp:"\u2adb",models:"\u22a7",mopf:"\ud835\udd5e",mscr:"\ud835\udcc2",mu:"\u03bc",multimap:"\u22b8",mumap:"\u22b8",nGg:"\u22d9\u0338",nGt:"\u226b\u20d2",nLeftarrow:"\u21cd",nlArr:"\u21cd",nLeftrightarrow:"\u21ce",nhArr:"\u21ce",nLl:"\u22d8\u0338",nLt:"\u226a\u20d2",nRightarrow:"\u21cf",nrArr:"\u21cf",nVDash:"\u22af",nVdash:"\u22ae",nacute:"\u0144",nang:"\u2220\u20d2",napE:"\u2a70\u0338",napid:"\u224b\u0338",napos:"\u0149",natur:"\u266e",natural:"\u266e",ncap:"\u2a43",ncaron:"\u0148",ncedil:"\u0146",ncongdot:"\u2a6d\u0338",ncup:"\u2a42",ncy:"\u043d",ndash:"\u2013",neArr:"\u21d7",nearhk:"\u2924",nedot:"\u2250\u0338",nesear:"\u2928",toea:"\u2928",nfr:"\ud835\udd2b",nharr:"\u21ae",nleftrightarrow:"\u21ae",nhpar:"\u2af2",nis:"\u22fc",nisd:"\u22fa",njcy:"\u045a",nlE:"\u2266\u0338",nleqq:"\u2266\u0338",nlarr:"\u219a",nleftarrow:"\u219a",nldr:"\u2025",nopf:"\ud835\udd5f",not:"\xac",notinE:"\u22f9\u0338",notindot:"\u22f5\u0338",notinvb:"\u22f7",notinvc:"\u22f6",notnivb:"\u22fe",notnivc:"\u22fd",nparsl:"\u2afd\u20e5",npart:"\u2202\u0338",npolint:"\u2a14",nrarr:"\u219b",nrightarrow:"\u219b",nrarrc:"\u2933\u0338",nrarrw:"\u219d\u0338",nscr:"\ud835\udcc3",nsub:"\u2284",nsubE:"\u2ac5\u0338",nsubseteqq:"\u2ac5\u0338",nsup:"\u2285",nsupE:"\u2ac6\u0338",nsupseteqq:"\u2ac6\u0338",ntilde:"\xf1",nu:"\u03bd",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22ad",nvHarr:"\u2904",nvap:"\u224d\u20d2",nvdash:"\u22ac",nvge:"\u2265\u20d2",nvgt:">\u20d2",nvinfin:"\u29de",nvlArr:"\u2902",nvle:"\u2264\u20d2",nvlt:"<\u20d2",nvltrie:"\u22b4\u20d2",nvrArr:"\u2903",nvrtrie:"\u22b5\u20d2",nvsim:"\u223c\u20d2",nwArr:"\u21d6",nwarhk:"\u2923",nwnear:"\u2927",oacute:"\xf3",ocirc:"\xf4",ocy:"\u043e",odblac:"\u0151",odiv:"\u2a38",odsold:"\u29bc",oelig:"\u0153",ofcir:"\u29bf",ofr:"\ud835\udd2c",ogon:"\u02db",ograve:"\xf2",ogt:"\u29c1",ohbar:"\u29b5",olcir:"\u29be",olcross:"\u29bb",olt:"\u29c0",omacr:"\u014d",omega:"\u03c9",omicron:"\u03bf",omid:"\u29b6",oopf:"\ud835\udd60",opar:"\u29b7",operp:"\u29b9",or:"\u2228",vee:"\u2228",ord:"\u2a5d",order:"\u2134",orderof:"\u2134",oscr:"\u2134",ordf:"\xaa",ordm:"\xba",origof:"\u22b6",oror:"\u2a56",orslope:"\u2a57",orv:"\u2a5b",oslash:"\xf8",osol:"\u2298",otilde:"\xf5",otimesas:"\u2a36",ouml:"\xf6",ovbar:"\u233d",para:"\xb6",parsim:"\u2af3",parsl:"\u2afd",pcy:"\u043f",percnt:"%",period:".",permil:"\u2030",pertenk:"\u2031",pfr:"\ud835\udd2d",phi:"\u03c6",phiv:"\u03d5",straightphi:"\u03d5",varphi:"\u03d5",phone:"\u260e",pi:"\u03c0",piv:"\u03d6",varpi:"\u03d6",planckh:"\u210e",plus:"+",plusacir:"\u2a23",pluscir:"\u2a22",plusdu:"\u2a25",pluse:"\u2a72",plussim:"\u2a26",plustwo:"\u2a27",pointint:"\u2a15",popf:"\ud835\udd61",pound:"\xa3",prE:"\u2ab3",prap:"\u2ab7",precapprox:"\u2ab7",precnapprox:"\u2ab9",prnap:"\u2ab9",precneqq:"\u2ab5",prnE:"\u2ab5",precnsim:"\u22e8",prnsim:"\u22e8",prime:"\u2032",profalar:"\u232e",profline:"\u2312",profsurf:"\u2313",prurel:"\u22b0",pscr:"\ud835\udcc5",psi:"\u03c8",puncsp:"\u2008",qfr:"\ud835\udd2e",qopf:"\ud835\udd62",qprime:"\u2057",qscr:"\ud835\udcc6",quatint:"\u2a16",quest:"?",rAtail:"\u291c",rHar:"\u2964",race:"\u223d\u0331",racute:"\u0155",raemptyv:"\u29b3",rangd:"\u2992",range:"\u29a5",raquo:"\xbb",rarrap:"\u2975",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291e",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21a3",rightarrowtail:"\u21a3",rarrw:"\u219d",rightsquigarrow:"\u219d",ratail:"\u291a",ratio:"\u2236",rbbrk:"\u2773",rbrace:"}",rcub:"}",rbrack:"]",rsqb:"]",rbrke:"\u298c",rbrksld:"\u298e",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdsh:"\u21b3",rect:"\u25ad",rfisht:"\u297d",rfr:"\ud835\udd2f",rharul:"\u296c",rho:"\u03c1",rhov:"\u03f1",varrho:"\u03f1",rightrightarrows:"\u21c9",rrarr:"\u21c9",rightthreetimes:"\u22cc",rthree:"\u22cc",ring:"\u02da",rlm:"\u200f",rmoust:"\u23b1",rmoustache:"\u23b1",rnmid:"\u2aee",roang:"\u27ed",roarr:"\u21fe",ropar:"\u2986",ropf:"\ud835\udd63",roplus:"\u2a2e",rotimes:"\u2a35",rpar:")",rpargt:"\u2994",rppolint:"\u2a12",rsaquo:"\u203a",rscr:"\ud835\udcc7",rtimes:"\u22ca",rtri:"\u25b9",triangleright:"\u25b9",rtriltri:"\u29ce",ruluhar:"\u2968",rx:"\u211e",sacute:"\u015b",scE:"\u2ab4",scap:"\u2ab8",succapprox:"\u2ab8",scaron:"\u0161",scedil:"\u015f",scirc:"\u015d",scnE:"\u2ab6",succneqq:"\u2ab6",scnap:"\u2aba",succnapprox:"\u2aba",scnsim:"\u22e9",succnsim:"\u22e9",scpolint:"\u2a13",scy:"\u0441",sdot:"\u22c5",sdote:"\u2a66",seArr:"\u21d8",sect:"\xa7",semi:";",seswar:"\u2929",tosa:"\u2929",sext:"\u2736",sfr:"\ud835\udd30",sharp:"\u266f",shchcy:"\u0449",shcy:"\u0448",shy:"\xad",sigma:"\u03c3",sigmaf:"\u03c2",sigmav:"\u03c2",varsigma:"\u03c2",simdot:"\u2a6a",simg:"\u2a9e",simgE:"\u2aa0",siml:"\u2a9d",simlE:"\u2a9f",simne:"\u2246",simplus:"\u2a24",simrarr:"\u2972",smashp:"\u2a33",smeparsl:"\u29e4",smile:"\u2323",ssmile:"\u2323",smt:"\u2aaa",smte:"\u2aac",smtes:"\u2aac\ufe00",softcy:"\u044c",sol:"/",solb:"\u29c4",solbar:"\u233f",sopf:"\ud835\udd64",spades:"\u2660",spadesuit:"\u2660",sqcaps:"\u2293\ufe00",sqcups:"\u2294\ufe00",sscr:"\ud835\udcc8",star:"\u2606",sub:"\u2282",subset:"\u2282",subE:"\u2ac5",subseteqq:"\u2ac5",subdot:"\u2abd",subedot:"\u2ac3",submult:"\u2ac1",subnE:"\u2acb",subsetneqq:"\u2acb",subne:"\u228a",subsetneq:"\u228a",subplus:"\u2abf",subrarr:"\u2979",subsim:"\u2ac7",subsub:"\u2ad5",subsup:"\u2ad3",sung:"\u266a",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",supE:"\u2ac6",supseteqq:"\u2ac6",supdot:"\u2abe",supdsub:"\u2ad8",supedot:"\u2ac4",suphsol:"\u27c9",suphsub:"\u2ad7",suplarr:"\u297b",supmult:"\u2ac2",supnE:"\u2acc",supsetneqq:"\u2acc",supne:"\u228b",supsetneq:"\u228b",supplus:"\u2ac0",supsim:"\u2ac8",supsub:"\u2ad4",supsup:"\u2ad6",swArr:"\u21d9",swnwar:"\u292a",szlig:"\xdf",target:"\u2316",tau:"\u03c4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",telrec:"\u2315",tfr:"\ud835\udd31",theta:"\u03b8",thetasym:"\u03d1",thetav:"\u03d1",vartheta:"\u03d1",thorn:"\xfe",times:"\xd7",timesbar:"\u2a31",timesd:"\u2a30",topbot:"\u2336",topcir:"\u2af1",topf:"\ud835\udd65",topfork:"\u2ada",tprime:"\u2034",triangle:"\u25b5",utri:"\u25b5",triangleq:"\u225c",trie:"\u225c",tridot:"\u25ec",triminus:"\u2a3a",triplus:"\u2a39",trisb:"\u29cd",tritime:"\u2a3b",trpezium:"\u23e2",tscr:"\ud835\udcc9",tscy:"\u0446",tshcy:"\u045b",tstrok:"\u0167",uHar:"\u2963",uacute:"\xfa",ubrcy:"\u045e",ubreve:"\u016d",ucirc:"\xfb",ucy:"\u0443",udblac:"\u0171",ufisht:"\u297e",ufr:"\ud835\udd32",ugrave:"\xf9",uhblk:"\u2580",ulcorn:"\u231c",ulcorner:"\u231c",ulcrop:"\u230f",ultri:"\u25f8",umacr:"\u016b",uogon:"\u0173",uopf:"\ud835\udd66",upsi:"\u03c5",upsilon:"\u03c5",upuparrows:"\u21c8",uuarr:"\u21c8",urcorn:"\u231d",urcorner:"\u231d",urcrop:"\u230e",uring:"\u016f",urtri:"\u25f9",uscr:"\ud835\udcca",utdot:"\u22f0",utilde:"\u0169",uuml:"\xfc",uwangle:"\u29a7",vBar:"\u2ae8",vBarv:"\u2ae9",vangrt:"\u299c",varsubsetneq:"\u228a\ufe00",vsubne:"\u228a\ufe00",varsubsetneqq:"\u2acb\ufe00",vsubnE:"\u2acb\ufe00",varsupsetneq:"\u228b\ufe00",vsupne:"\u228b\ufe00",varsupsetneqq:"\u2acc\ufe00",vsupnE:"\u2acc\ufe00",vcy:"\u0432",veebar:"\u22bb",veeeq:"\u225a",vellip:"\u22ee",vfr:"\ud835\udd33",vopf:"\ud835\udd67",vscr:"\ud835\udccb",vzigzag:"\u299a",wcirc:"\u0175",wedbar:"\u2a5f",wedgeq:"\u2259",weierp:"\u2118",wp:"\u2118",wfr:"\ud835\udd34",wopf:"\ud835\udd68",wscr:"\ud835\udccc",xfr:"\ud835\udd35",xi:"\u03be",xnis:"\u22fb",xopf:"\ud835\udd69",xscr:"\ud835\udccd",yacute:"\xfd",yacy:"\u044f",ycirc:"\u0177",ycy:"\u044b",yen:"\xa5",yfr:"\ud835\udd36",yicy:"\u0457",yopf:"\ud835\udd6a",yscr:"\ud835\udcce",yucy:"\u044e",yuml:"\xff",zacute:"\u017a",zcaron:"\u017e",zcy:"\u0437",zdot:"\u017c",zeta:"\u03b6",zfr:"\ud835\udd37",zhcy:"\u0436",zigrarr:"\u21dd",zopf:"\ud835\udd6b",zscr:"\ud835\udccf",zwj:"\u200d",zwnj:"\u200c"};const NGSP_UNICODE="\ue500";NAMED_ENTITIES["ngsp"]=NGSP_UNICODE;class TokenError extends ParseError{constructor(errorMsg,tokenType,span){super(span,errorMsg);this.tokenType=tokenType}}class TokenizeResult{constructor(tokens,errors,nonNormalizedIcuExpressions){this.tokens=tokens;this.errors=errors;this.nonNormalizedIcuExpressions=nonNormalizedIcuExpressions}}function tokenize(source,url,getTagDefinition,options={}){const tokenizer=new _Tokenizer(new ParseSourceFile(source,url),getTagDefinition,options);tokenizer.tokenize();return new TokenizeResult(mergeTextTokens(tokenizer.tokens),tokenizer.errors,tokenizer.nonNormalizedIcuExpressions)}const _CR_OR_CRLF_REGEXP=/\r\n?/g;function _unexpectedCharacterErrorMsg(charCode){const char=charCode===$EOF?"EOF":String.fromCharCode(charCode);return`Unexpected character "${char}"`}function _unknownEntityErrorMsg(entitySrc){return`Unknown entity "${entitySrc}" - use the "&#<decimal>;" or "&#x<hex>;" syntax`}function _unparsableEntityErrorMsg(type,entityStr){return`Unable to parse entity "${entityStr}" - ${type} character reference entities must end with ";"`}var CharacterReferenceType;(function(CharacterReferenceType){CharacterReferenceType["HEX"]="hexadecimal";CharacterReferenceType["DEC"]="decimal"})(CharacterReferenceType||(CharacterReferenceType={}));class _ControlFlowError{constructor(error){this.error=error}}class _Tokenizer{constructor(_file,_getTagDefinition,options){this._getTagDefinition=_getTagDefinition;this._currentTokenStart=null;this._currentTokenType=null;this._expansionCaseStack=[];this._inInterpolation=false;this.tokens=[];this.errors=[];this.nonNormalizedIcuExpressions=[];this._tokenizeIcu=options.tokenizeExpansionForms||false;this._interpolationConfig=options.interpolationConfig||DEFAULT_INTERPOLATION_CONFIG;this._leadingTriviaCodePoints=options.leadingTriviaChars&&options.leadingTriviaChars.map((c=>c.codePointAt(0)||0));const range=options.range||{endPos:_file.content.length,startPos:0,startLine:0,startCol:0};this._cursor=options.escapedString?new EscapedCharacterCursor(_file,range):new PlainCharacterCursor(_file,range);this._preserveLineEndings=options.preserveLineEndings||false;this._i18nNormalizeLineEndingsInICUs=options.i18nNormalizeLineEndingsInICUs||false;this._tokenizeBlocks=options.tokenizeBlocks??true;try{this._cursor.init()}catch(e){this.handleError(e)}}_processCarriageReturns(content){if(this._preserveLineEndings){return content}return content.replace(_CR_OR_CRLF_REGEXP,"\n")}tokenize(){while(this._cursor.peek()!==$EOF){const start=this._cursor.clone();try{if(this._attemptCharCode($LT)){if(this._attemptCharCode($BANG)){if(this._attemptCharCode($LBRACKET)){this._consumeCdata(start)}else if(this._attemptCharCode($MINUS)){this._consumeComment(start)}else{this._consumeDocType(start)}}else if(this._attemptCharCode($SLASH)){this._consumeTagClose(start)}else{this._consumeTagOpen(start)}}else if(this._tokenizeBlocks&&this._attemptCharCode($AT)){this._consumeBlockStart(start)}else if(this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansionCase()&&!this._isInExpansionForm()&&this._attemptCharCode($RBRACE)){this._consumeBlockEnd(start)}else if(!(this._tokenizeIcu&&this._tokenizeExpansionForm())){this._consumeWithInterpolation(5,8,(()=>this._isTextEnd()),(()=>this._isTagStart()))}}catch(e){this.handleError(e)}}this._beginToken(29);this._endToken([])}_getBlockName(){let spacesInNameAllowed=false;const nameCursor=this._cursor.clone();this._attemptCharCodeUntilFn((code=>{if(isWhitespace(code)){return!spacesInNameAllowed}if(isBlockNameChar(code)){spacesInNameAllowed=true;return false}return true}));return this._cursor.getChars(nameCursor).trim()}_consumeBlockStart(start){this._beginToken(24,start);const startToken=this._endToken([this._getBlockName()]);if(this._cursor.peek()===$LPAREN){this._cursor.advance();this._consumeBlockParameters();this._attemptCharCodeUntilFn(isNotWhitespace);if(this._attemptCharCode($RPAREN)){this._attemptCharCodeUntilFn(isNotWhitespace)}else{startToken.type=28;return}}if(this._attemptCharCode($LBRACE)){this._beginToken(25);this._endToken([])}else{startToken.type=28}}_consumeBlockEnd(start){this._beginToken(26,start);this._endToken([])}_consumeBlockParameters(){this._attemptCharCodeUntilFn(isBlockParameterChar);while(this._cursor.peek()!==$RPAREN&&this._cursor.peek()!==$EOF){this._beginToken(27);const start=this._cursor.clone();let inQuote=null;let openParens=0;while(this._cursor.peek()!==$SEMICOLON&&this._cursor.peek()!==$EOF||inQuote!==null){const char=this._cursor.peek();if(char===$BACKSLASH){this._cursor.advance()}else if(char===inQuote){inQuote=null}else if(inQuote===null&&isQuote(char)){inQuote=char}else if(char===$LPAREN&&inQuote===null){openParens++}else if(char===$RPAREN&&inQuote===null){if(openParens===0){break}else if(openParens>0){openParens--}}this._cursor.advance()}this._endToken([this._cursor.getChars(start)]);this._attemptCharCodeUntilFn(isBlockParameterChar)}}_tokenizeExpansionForm(){if(this.isExpansionFormStart()){this._consumeExpansionFormStart();return true}if(isExpansionCaseStart(this._cursor.peek())&&this._isInExpansionForm()){this._consumeExpansionCaseStart();return true}if(this._cursor.peek()===$RBRACE){if(this._isInExpansionCase()){this._consumeExpansionCaseEnd();return true}if(this._isInExpansionForm()){this._consumeExpansionFormEnd();return true}}return false}_beginToken(type,start=this._cursor.clone()){this._currentTokenStart=start;this._currentTokenType=type}_endToken(parts,end){if(this._currentTokenStart===null){throw new TokenError("Programming error - attempted to end a token when there was no start to the token",this._currentTokenType,this._cursor.getSpan(end))}if(this._currentTokenType===null){throw new TokenError("Programming error - attempted to end a token which has no token type",null,this._cursor.getSpan(this._currentTokenStart))}const token={type:this._currentTokenType,parts:parts,sourceSpan:(end??this._cursor).getSpan(this._currentTokenStart,this._leadingTriviaCodePoints)};this.tokens.push(token);this._currentTokenStart=null;this._currentTokenType=null;return token}_createError(msg,span){if(this._isInExpansionForm()){msg+=` (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.)`}const error=new TokenError(msg,this._currentTokenType,span);this._currentTokenStart=null;this._currentTokenType=null;return new _ControlFlowError(error)}handleError(e){if(e instanceof CursorError){e=this._createError(e.msg,this._cursor.getSpan(e.cursor))}if(e instanceof _ControlFlowError){this.errors.push(e.error)}else{throw e}}_attemptCharCode(charCode){if(this._cursor.peek()===charCode){this._cursor.advance();return true}return false}_attemptCharCodeCaseInsensitive(charCode){if(compareCharCodeCaseInsensitive(this._cursor.peek(),charCode)){this._cursor.advance();return true}return false}_requireCharCode(charCode){const location=this._cursor.clone();if(!this._attemptCharCode(charCode)){throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()),this._cursor.getSpan(location))}}_attemptStr(chars){const len=chars.length;if(this._cursor.charsLeft()<len){return false}const initialPosition=this._cursor.clone();for(let i=0;i<len;i++){if(!this._attemptCharCode(chars.charCodeAt(i))){this._cursor=initialPosition;return false}}return true}_attemptStrCaseInsensitive(chars){for(let i=0;i<chars.length;i++){if(!this._attemptCharCodeCaseInsensitive(chars.charCodeAt(i))){return false}}return true}_requireStr(chars){const location=this._cursor.clone();if(!this._attemptStr(chars)){throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()),this._cursor.getSpan(location))}}_attemptCharCodeUntilFn(predicate){while(!predicate(this._cursor.peek())){this._cursor.advance()}}_requireCharCodeUntilFn(predicate,len){const start=this._cursor.clone();this._attemptCharCodeUntilFn(predicate);if(this._cursor.diff(start)<len){throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()),this._cursor.getSpan(start))}}_attemptUntilChar(char){while(this._cursor.peek()!==char){this._cursor.advance()}}_readChar(){const char=String.fromCodePoint(this._cursor.peek());this._cursor.advance();return char}_consumeEntity(textTokenType){this._beginToken(9);const start=this._cursor.clone();this._cursor.advance();if(this._attemptCharCode($HASH)){const isHex=this._attemptCharCode($x)||this._attemptCharCode($X);const codeStart=this._cursor.clone();this._attemptCharCodeUntilFn(isDigitEntityEnd);if(this._cursor.peek()!=$SEMICOLON){this._cursor.advance();const entityType=isHex?CharacterReferenceType.HEX:CharacterReferenceType.DEC;throw this._createError(_unparsableEntityErrorMsg(entityType,this._cursor.getChars(start)),this._cursor.getSpan())}const strNum=this._cursor.getChars(codeStart);this._cursor.advance();try{const charCode=parseInt(strNum,isHex?16:10);this._endToken([String.fromCharCode(charCode),this._cursor.getChars(start)])}catch{throw this._createError(_unknownEntityErrorMsg(this._cursor.getChars(start)),this._cursor.getSpan())}}else{const nameStart=this._cursor.clone();this._attemptCharCodeUntilFn(isNamedEntityEnd);if(this._cursor.peek()!=$SEMICOLON){this._beginToken(textTokenType,start);this._cursor=nameStart;this._endToken(["&"])}else{const name=this._cursor.getChars(nameStart);this._cursor.advance();const char=NAMED_ENTITIES[name];if(!char){throw this._createError(_unknownEntityErrorMsg(name),this._cursor.getSpan(start))}this._endToken([char,`&${name};`])}}}_consumeRawText(consumeEntities,endMarkerPredicate){this._beginToken(consumeEntities?6:7);const parts=[];while(true){const tagCloseStart=this._cursor.clone();const foundEndMarker=endMarkerPredicate();this._cursor=tagCloseStart;if(foundEndMarker){break}if(consumeEntities&&this._cursor.peek()===$AMPERSAND){this._endToken([this._processCarriageReturns(parts.join(""))]);parts.length=0;this._consumeEntity(6);this._beginToken(6)}else{parts.push(this._readChar())}}this._endToken([this._processCarriageReturns(parts.join(""))])}_consumeComment(start){this._beginToken(10,start);this._requireCharCode($MINUS);this._endToken([]);this._consumeRawText(false,(()=>this._attemptStr("--\x3e")));this._beginToken(11);this._requireStr("--\x3e");this._endToken([])}_consumeCdata(start){this._beginToken(12,start);this._requireStr("CDATA[");this._endToken([]);this._consumeRawText(false,(()=>this._attemptStr("]]>")));this._beginToken(13);this._requireStr("]]>");this._endToken([])}_consumeDocType(start){this._beginToken(18,start);const contentStart=this._cursor.clone();this._attemptUntilChar($GT);const content=this._cursor.getChars(contentStart);this._cursor.advance();this._endToken([content])}_consumePrefixAndName(){const nameOrPrefixStart=this._cursor.clone();let prefix="";while(this._cursor.peek()!==$COLON&&!isPrefixEnd(this._cursor.peek())){this._cursor.advance()}let nameStart;if(this._cursor.peek()===$COLON){prefix=this._cursor.getChars(nameOrPrefixStart);this._cursor.advance();nameStart=this._cursor.clone()}else{nameStart=nameOrPrefixStart}this._requireCharCodeUntilFn(isNameEnd,prefix===""?0:1);const name=this._cursor.getChars(nameStart);return[prefix,name]}_consumeTagOpen(start){let tagName;let prefix;let openTagToken;try{if(!isAsciiLetter(this._cursor.peek())){throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()),this._cursor.getSpan(start))}openTagToken=this._consumeTagOpenStart(start);prefix=openTagToken.parts[0];tagName=openTagToken.parts[1];this._attemptCharCodeUntilFn(isNotWhitespace);while(this._cursor.peek()!==$SLASH&&this._cursor.peek()!==$GT&&this._cursor.peek()!==$LT&&this._cursor.peek()!==$EOF){this._consumeAttributeName();this._attemptCharCodeUntilFn(isNotWhitespace);if(this._attemptCharCode($EQ)){this._attemptCharCodeUntilFn(isNotWhitespace);this._consumeAttributeValue()}this._attemptCharCodeUntilFn(isNotWhitespace)}this._consumeTagOpenEnd()}catch(e){if(e instanceof _ControlFlowError){if(openTagToken){openTagToken.type=4}else{this._beginToken(5,start);this._endToken(["<"])}return}throw e}const contentTokenType=this._getTagDefinition(tagName).getContentType(prefix);if(contentTokenType===exports.TagContentType.RAW_TEXT){this._consumeRawTextWithTagClose(prefix,tagName,false)}else if(contentTokenType===exports.TagContentType.ESCAPABLE_RAW_TEXT){this._consumeRawTextWithTagClose(prefix,tagName,true)}}_consumeRawTextWithTagClose(prefix,tagName,consumeEntities){this._consumeRawText(consumeEntities,(()=>{if(!this._attemptCharCode($LT))return false;if(!this._attemptCharCode($SLASH))return false;this._attemptCharCodeUntilFn(isNotWhitespace);if(!this._attemptStrCaseInsensitive(tagName))return false;this._attemptCharCodeUntilFn(isNotWhitespace);return this._attemptCharCode($GT)}));this._beginToken(3);this._requireCharCodeUntilFn((code=>code===$GT),3);this._cursor.advance();this._endToken([prefix,tagName])}_consumeTagOpenStart(start){this._beginToken(0,start);const parts=this._consumePrefixAndName();return this._endToken(parts)}_consumeAttributeName(){const attrNameStart=this._cursor.peek();if(attrNameStart===$SQ||attrNameStart===$DQ){throw this._createError(_unexpectedCharacterErrorMsg(attrNameStart),this._cursor.getSpan())}this._beginToken(14);const prefixAndName=this._consumePrefixAndName();this._endToken(prefixAndName)}_consumeAttributeValue(){if(this._cursor.peek()===$SQ||this._cursor.peek()===$DQ){const quoteChar=this._cursor.peek();this._consumeQuote(quoteChar);const endPredicate=()=>this._cursor.peek()===quoteChar;this._consumeWithInterpolation(16,17,endPredicate,endPredicate);this._consumeQuote(quoteChar)}else{const endPredicate=()=>isNameEnd(this._cursor.peek());this._consumeWithInterpolation(16,17,endPredicate,endPredicate)}}_consumeQuote(quoteChar){this._beginToken(15);this._requireCharCode(quoteChar);this._endToken([String.fromCodePoint(quoteChar)])}_consumeTagOpenEnd(){const tokenType=this._attemptCharCode($SLASH)?2:1;this._beginToken(tokenType);this._requireCharCode($GT);this._endToken([])}_consumeTagClose(start){this._beginToken(3,start);this._attemptCharCodeUntilFn(isNotWhitespace);const prefixAndName=this._consumePrefixAndName();this._attemptCharCodeUntilFn(isNotWhitespace);this._requireCharCode($GT);this._endToken(prefixAndName)}_consumeExpansionFormStart(){this._beginToken(19);this._requireCharCode($LBRACE);this._endToken([]);this._expansionCaseStack.push(19);this._beginToken(7);const condition=this._readUntil($COMMA);const normalizedCondition=this._processCarriageReturns(condition);if(this._i18nNormalizeLineEndingsInICUs){this._endToken([normalizedCondition])}else{const conditionToken=this._endToken([condition]);if(normalizedCondition!==condition){this.nonNormalizedIcuExpressions.push(conditionToken)}}this._requireCharCode($COMMA);this._attemptCharCodeUntilFn(isNotWhitespace);this._beginToken(7);const type=this._readUntil($COMMA);this._endToken([type]);this._requireCharCode($COMMA);this._attemptCharCodeUntilFn(isNotWhitespace)}_consumeExpansionCaseStart(){this._beginToken(20);const value=this._readUntil($LBRACE).trim();this._endToken([value]);this._attemptCharCodeUntilFn(isNotWhitespace);this._beginToken(21);this._requireCharCode($LBRACE);this._endToken([]);this._attemptCharCodeUntilFn(isNotWhitespace);this._expansionCaseStack.push(21)}_consumeExpansionCaseEnd(){this._beginToken(22);this._requireCharCode($RBRACE);this._endToken([]);this._attemptCharCodeUntilFn(isNotWhitespace);this._expansionCaseStack.pop()}_consumeExpansionFormEnd(){this._beginToken(23);this._requireCharCode($RBRACE);this._endToken([]);this._expansionCaseStack.pop()}_consumeWithInterpolation(textTokenType,interpolationTokenType,endPredicate,endInterpolation){this._beginToken(textTokenType);const parts=[];while(!endPredicate()){const current=this._cursor.clone();if(this._interpolationConfig&&this._attemptStr(this._interpolationConfig.start)){this._endToken([this._processCarriageReturns(parts.join(""))],current);parts.length=0;this._consumeInterpolation(interpolationTokenType,current,endInterpolation);this._beginToken(textTokenType)}else if(this._cursor.peek()===$AMPERSAND){this._endToken([this._processCarriageReturns(parts.join(""))]);parts.length=0;this._consumeEntity(textTokenType);this._beginToken(textTokenType)}else{parts.push(this._readChar())}}this._inInterpolation=false;this._endToken([this._processCarriageReturns(parts.join(""))])}_consumeInterpolation(interpolationTokenType,interpolationStart,prematureEndPredicate){const parts=[];this._beginToken(interpolationTokenType,interpolationStart);parts.push(this._interpolationConfig.start);const expressionStart=this._cursor.clone();let inQuote=null;let inComment=false;while(this._cursor.peek()!==$EOF&&(prematureEndPredicate===null||!prematureEndPredicate())){const current=this._cursor.clone();if(this._isTagStart()){this._cursor=current;parts.push(this._getProcessedChars(expressionStart,current));this._endToken(parts);return}if(inQuote===null){if(this._attemptStr(this._interpolationConfig.end)){parts.push(this._getProcessedChars(expressionStart,current));parts.push(this._interpolationConfig.end);this._endToken(parts);return}else if(this._attemptStr("//")){inComment=true}}const char=this._cursor.peek();this._cursor.advance();if(char===$BACKSLASH){this._cursor.advance()}else if(char===inQuote){inQuote=null}else if(!inComment&&inQuote===null&&isQuote(char)){inQuote=char}}parts.push(this._getProcessedChars(expressionStart,this._cursor));this._endToken(parts)}_getProcessedChars(start,end){return this._processCarriageReturns(end.getChars(start))}_isTextEnd(){if(this._isTagStart()||this._cursor.peek()===$EOF){return true}if(this._tokenizeIcu&&!this._inInterpolation){if(this.isExpansionFormStart()){return true}if(this._cursor.peek()===$RBRACE&&this._isInExpansionCase()){return true}}if(this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansion()&&(this._cursor.peek()===$AT||this._cursor.peek()===$RBRACE)){return true}return false}_isTagStart(){if(this._cursor.peek()===$LT){const tmp=this._cursor.clone();tmp.advance();const code=tmp.peek();if($a<=code&&code<=$z||$A<=code&&code<=$Z||code===$SLASH||code===$BANG){return true}}return false}_readUntil(char){const start=this._cursor.clone();this._attemptUntilChar(char);return this._cursor.getChars(start)}_isInExpansion(){return this._isInExpansionCase()||this._isInExpansionForm()}_isInExpansionCase(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===21}_isInExpansionForm(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===19}isExpansionFormStart(){if(this._cursor.peek()!==$LBRACE){return false}if(this._interpolationConfig){const start=this._cursor.clone();const isInterpolation=this._attemptStr(this._interpolationConfig.start);this._cursor=start;return!isInterpolation}return true}}function isNotWhitespace(code){return!isWhitespace(code)||code===$EOF}function isNameEnd(code){return isWhitespace(code)||code===$GT||code===$LT||code===$SLASH||code===$SQ||code===$DQ||code===$EQ||code===$EOF}function isPrefixEnd(code){return(code<$a||$z<code)&&(code<$A||$Z<code)&&(code<$0||code>$9)}function isDigitEntityEnd(code){return code===$SEMICOLON||code===$EOF||!isAsciiHexDigit(code)}function isNamedEntityEnd(code){return code===$SEMICOLON||code===$EOF||!isAsciiLetter(code)}function isExpansionCaseStart(peek){return peek!==$RBRACE}function compareCharCodeCaseInsensitive(code1,code2){return toUpperCaseCharCode(code1)===toUpperCaseCharCode(code2)}function toUpperCaseCharCode(code){return code>=$a&&code<=$z?code-$a+$A:code}function isBlockNameChar(code){return isAsciiLetter(code)||isDigit(code)||code===$_}function isBlockParameterChar(code){return code!==$SEMICOLON&&isNotWhitespace(code)}function mergeTextTokens(srcTokens){const dstTokens=[];let lastDstToken=undefined;for(let i=0;i<srcTokens.length;i++){const token=srcTokens[i];if(lastDstToken&&lastDstToken.type===5&&token.type===5||lastDstToken&&lastDstToken.type===16&&token.type===16){lastDstToken.parts[0]+=token.parts[0];lastDstToken.sourceSpan.end=token.sourceSpan.end}else{lastDstToken=token;dstTokens.push(lastDstToken)}}return dstTokens}class PlainCharacterCursor{constructor(fileOrCursor,range){if(fileOrCursor instanceof PlainCharacterCursor){this.file=fileOrCursor.file;this.input=fileOrCursor.input;this.end=fileOrCursor.end;const state=fileOrCursor.state;this.state={peek:state.peek,offset:state.offset,line:state.line,column:state.column}}else{if(!range){throw new Error("Programming error: the range argument must be provided with a file argument.")}this.file=fileOrCursor;this.input=fileOrCursor.content;this.end=range.endPos;this.state={peek:-1,offset:range.startPos,line:range.startLine,column:range.startCol}}}clone(){return new PlainCharacterCursor(this)}peek(){return this.state.peek}charsLeft(){return this.end-this.state.offset}diff(other){return this.state.offset-other.state.offset}advance(){this.advanceState(this.state)}init(){this.updatePeek(this.state)}getSpan(start,leadingTriviaCodePoints){start=start||this;let fullStart=start;if(leadingTriviaCodePoints){while(this.diff(start)>0&&leadingTriviaCodePoints.indexOf(start.peek())!==-1){if(fullStart===start){start=start.clone()}start.advance()}}const startLocation=this.locationFromCursor(start);const endLocation=this.locationFromCursor(this);const fullStartLocation=fullStart!==start?this.locationFromCursor(fullStart):startLocation;return new ParseSourceSpan(startLocation,endLocation,fullStartLocation)}getChars(start){return this.input.substring(start.state.offset,this.state.offset)}charAt(pos){return this.input.charCodeAt(pos)}advanceState(state){if(state.offset>=this.end){this.state=state;throw new CursorError('Unexpected character "EOF"',this)}const currentChar=this.charAt(state.offset);if(currentChar===$LF){state.line++;state.column=0}else if(!isNewLine(currentChar)){state.column++}state.offset++;this.updatePeek(state)}updatePeek(state){state.peek=state.offset>=this.end?$EOF:this.charAt(state.offset)}locationFromCursor(cursor){return new ParseLocation(cursor.file,cursor.state.offset,cursor.state.line,cursor.state.column)}}class EscapedCharacterCursor extends PlainCharacterCursor{constructor(fileOrCursor,range){if(fileOrCursor instanceof EscapedCharacterCursor){super(fileOrCursor);this.internalState={...fileOrCursor.internalState}}else{super(fileOrCursor,range);this.internalState=this.state}}advance(){this.state=this.internalState;super.advance();this.processEscapeSequence()}init(){super.init();this.processEscapeSequence()}clone(){return new EscapedCharacterCursor(this)}getChars(start){const cursor=start.clone();let chars="";while(cursor.internalState.offset<this.internalState.offset){chars+=String.fromCodePoint(cursor.peek());cursor.advance()}return chars}processEscapeSequence(){const peek=()=>this.internalState.peek;if(peek()===$BACKSLASH){this.internalState={...this.state};this.advanceState(this.internalState);if(peek()===$n){this.state.peek=$LF}else if(peek()===$r){this.state.peek=$CR}else if(peek()===$v){this.state.peek=$VTAB}else if(peek()===$t){this.state.peek=$TAB}else if(peek()===$b){this.state.peek=$BSPACE}else if(peek()===$f){this.state.peek=$FF}else if(peek()===$u){this.advanceState(this.internalState);if(peek()===$LBRACE){this.advanceState(this.internalState);const digitStart=this.clone();let length=0;while(peek()!==$RBRACE){this.advanceState(this.internalState);length++}this.state.peek=this.decodeHexDigits(digitStart,length)}else{const digitStart=this.clone();this.advanceState(this.internalState);this.advanceState(this.internalState);this.advanceState(this.internalState);this.state.peek=this.decodeHexDigits(digitStart,4)}}else if(peek()===$x){this.advanceState(this.internalState);const digitStart=this.clone();this.advanceState(this.internalState);this.state.peek=this.decodeHexDigits(digitStart,2)}else if(isOctalDigit(peek())){let octal="";let length=0;let previous=this.clone();while(isOctalDigit(peek())&&length<3){previous=this.clone();octal+=String.fromCodePoint(peek());this.advanceState(this.internalState);length++}this.state.peek=parseInt(octal,8);this.internalState=previous.internalState}else if(isNewLine(this.internalState.peek)){this.advanceState(this.internalState);this.state=this.internalState}else{this.state.peek=this.internalState.peek}}}decodeHexDigits(start,length){const hex=this.input.slice(start.internalState.offset,start.internalState.offset+length);const charCode=parseInt(hex,16);if(!isNaN(charCode)){return charCode}else{start.state=start.internalState;throw new CursorError("Invalid hexadecimal escape sequence",start)}}}class CursorError{constructor(msg,cursor){this.msg=msg;this.cursor=cursor}}class TreeError extends ParseError{static create(elementName,span,msg){return new TreeError(elementName,span,msg)}constructor(elementName,span,msg){super(span,msg);this.elementName=elementName}}class ParseTreeResult{constructor(rootNodes,errors){this.rootNodes=rootNodes;this.errors=errors}}class Parser{constructor(getTagDefinition){this.getTagDefinition=getTagDefinition}parse(source,url,options){const tokenizeResult=tokenize(source,url,this.getTagDefinition,options);const parser=new _TreeBuilder(tokenizeResult.tokens,this.getTagDefinition);parser.build();return new ParseTreeResult(parser.rootNodes,tokenizeResult.errors.concat(parser.errors))}}class _TreeBuilder{constructor(tokens,getTagDefinition){this.tokens=tokens;this.getTagDefinition=getTagDefinition;this._index=-1;this._containerStack=[];this.rootNodes=[];this.errors=[];this._advance()}build(){while(this._peek.type!==29){if(this._peek.type===0||this._peek.type===4){this._consumeStartTag(this._advance())}else if(this._peek.type===3){this._consumeEndTag(this._advance())}else if(this._peek.type===12){this._closeVoidElement();this._consumeCdata(this._advance())}else if(this._peek.type===10){this._closeVoidElement();this._consumeComment(this._advance())}else if(this._peek.type===5||this._peek.type===7||this._peek.type===6){this._closeVoidElement();this._consumeText(this._advance())}else if(this._peek.type===19){this._consumeExpansion(this._advance())}else if(this._peek.type===24){this._closeVoidElement();this._consumeBlockOpen(this._advance())}else if(this._peek.type===26){this._closeVoidElement();this._consumeBlockClose(this._advance())}else if(this._peek.type===28){this._closeVoidElement();this._consumeIncompleteBlock(this._advance())}else{this._advance()}}for(const leftoverContainer of this._containerStack){if(leftoverContainer instanceof Block){this.errors.push(TreeError.create(leftoverContainer.name,leftoverContainer.sourceSpan,`Unclosed block "${leftoverContainer.name}"`))}}}_advance(){const prev=this._peek;if(this._index<this.tokens.length-1){this._index++}this._peek=this.tokens[this._index];return prev}_advanceIf(type){if(this._peek.type===type){return this._advance()}return null}_consumeCdata(_startToken){this._consumeText(this._advance());this._advanceIf(13)}_consumeComment(token){const text=this._advanceIf(7);const endToken=this._advanceIf(11);const value=text!=null?text.parts[0].trim():null;const sourceSpan=endToken==null?token.sourceSpan:new ParseSourceSpan(token.sourceSpan.start,endToken.sourceSpan.end,token.sourceSpan.fullStart);this._addToParent(new Comment(value,sourceSpan))}_consumeExpansion(token){const switchValue=this._advance();const type=this._advance();const cases=[];while(this._peek.type===20){const expCase=this._parseExpansionCase();if(!expCase)return;cases.push(expCase)}if(this._peek.type!==23){this.errors.push(TreeError.create(null,this._peek.sourceSpan,`Invalid ICU message. Missing '}'.`));return}const sourceSpan=new ParseSourceSpan(token.sourceSpan.start,this._peek.sourceSpan.end,token.sourceSpan.fullStart);this._addToParent(new Expansion(switchValue.parts[0],type.parts[0],cases,sourceSpan,switchValue.sourceSpan));this._advance()}_parseExpansionCase(){const value=this._advance();if(this._peek.type!==21){this.errors.push(TreeError.create(null,this._peek.sourceSpan,`Invalid ICU message. Missing '{'.`));return null}const start=this._advance();const exp=this._collectExpansionExpTokens(start);if(!exp)return null;const end=this._advance();exp.push({type:29,parts:[],sourceSpan:end.sourceSpan});const expansionCaseParser=new _TreeBuilder(exp,this.getTagDefinition);expansionCaseParser.build();if(expansionCaseParser.errors.length>0){this.errors=this.errors.concat(expansionCaseParser.errors);return null}const sourceSpan=new ParseSourceSpan(value.sourceSpan.start,end.sourceSpan.end,value.sourceSpan.fullStart);const expSourceSpan=new ParseSourceSpan(start.sourceSpan.start,end.sourceSpan.end,start.sourceSpan.fullStart);return new ExpansionCase(value.parts[0],expansionCaseParser.rootNodes,sourceSpan,value.sourceSpan,expSourceSpan)}_collectExpansionExpTokens(start){const exp=[];const expansionFormStack=[21];while(true){if(this._peek.type===19||this._peek.type===21){expansionFormStack.push(this._peek.type)}if(this._peek.type===22){if(lastOnStack(expansionFormStack,21)){expansionFormStack.pop();if(expansionFormStack.length===0)return exp}else{this.errors.push(TreeError.create(null,start.sourceSpan,`Invalid ICU message. Missing '}'.`));return null}}if(this._peek.type===23){if(lastOnStack(expansionFormStack,19)){expansionFormStack.pop()}else{this.errors.push(TreeError.create(null,start.sourceSpan,`Invalid ICU message. Missing '}'.`));return null}}if(this._peek.type===29){this.errors.push(TreeError.create(null,start.sourceSpan,`Invalid ICU message. Missing '}'.`));return null}exp.push(this._advance())}}_consumeText(token){const tokens=[token];const startSpan=token.sourceSpan;let text=token.parts[0];if(text.length>0&&text[0]==="\n"){const parent=this._getContainer();if(parent!=null&&parent.children.length===0&&this.getTagDefinition(parent.name).ignoreFirstLf){text=text.substring(1);tokens[0]={type:token.type,sourceSpan:token.sourceSpan,parts:[text]}}}while(this._peek.type===8||this._peek.type===5||this._peek.type===9){token=this._advance();tokens.push(token);if(token.type===8){text+=token.parts.join("").replace(/&([^;]+);/g,decodeEntity)}else if(token.type===9){text+=token.parts[0]}else{text+=token.parts.join("")}}if(text.length>0){const endSpan=token.sourceSpan;this._addToParent(new Text(text,new ParseSourceSpan(startSpan.start,endSpan.end,startSpan.fullStart,startSpan.details),tokens))}}_closeVoidElement(){const el=this._getContainer();if(el instanceof Element&&this.getTagDefinition(el.name).isVoid){this._containerStack.pop()}}_consumeStartTag(startTagToken){const[prefix,name]=startTagToken.parts;const attrs=[];while(this._peek.type===14){attrs.push(this._consumeAttr(this._advance()))}const fullName=this._getElementFullName(prefix,name,this._getClosestParentElement());let selfClosing=false;if(this._peek.type===2){this._advance();selfClosing=true;const tagDef=this.getTagDefinition(fullName);if(!(tagDef.canSelfClose||getNsPrefix(fullName)!==null||tagDef.isVoid)){this.errors.push(TreeError.create(fullName,startTagToken.sourceSpan,`Only void, custom and foreign elements can be self closed "${startTagToken.parts[1]}"`))}}else if(this._peek.type===1){this._advance();selfClosing=false}const end=this._peek.sourceSpan.fullStart;const span=new ParseSourceSpan(startTagToken.sourceSpan.start,end,startTagToken.sourceSpan.fullStart);const startSpan=new ParseSourceSpan(startTagToken.sourceSpan.start,end,startTagToken.sourceSpan.fullStart);const el=new Element(fullName,attrs,[],span,startSpan,undefined);const parentEl=this._getContainer();this._pushContainer(el,parentEl instanceof Element&&this.getTagDefinition(parentEl.name).isClosedByChild(el.name));if(selfClosing){this._popContainer(fullName,Element,span)}else if(startTagToken.type===4){this._popContainer(fullName,Element,null);this.errors.push(TreeError.create(fullName,span,`Opening tag "${fullName}" not terminated.`))}}_pushContainer(node,isClosedByChild){if(isClosedByChild){this._containerStack.pop()}this._addToParent(node);this._containerStack.push(node)}_consumeEndTag(endTagToken){const fullName=this._getElementFullName(endTagToken.parts[0],endTagToken.parts[1],this._getClosestParentElement());if(this.getTagDefinition(fullName).isVoid){this.errors.push(TreeError.create(fullName,endTagToken.sourceSpan,`Void elements do not have end tags "${endTagToken.parts[1]}"`))}else if(!this._popContainer(fullName,Element,endTagToken.sourceSpan)){const errMsg=`Unexpected closing tag "${fullName}". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags`;this.errors.push(TreeError.create(fullName,endTagToken.sourceSpan,errMsg))}}_popContainer(expectedName,expectedType,endSourceSpan){let unexpectedCloseTagDetected=false;for(let stackIndex=this._containerStack.length-1;stackIndex>=0;stackIndex--){const node=this._containerStack[stackIndex];if((node.name===expectedName||expectedName===null)&&node instanceof expectedType){node.endSourceSpan=endSourceSpan;node.sourceSpan.end=endSourceSpan!==null?endSourceSpan.end:node.sourceSpan.end;this._containerStack.splice(stackIndex,this._containerStack.length-stackIndex);return!unexpectedCloseTagDetected}if(node instanceof Block||node instanceof Element&&!this.getTagDefinition(node.name).closedByParent){unexpectedCloseTagDetected=true}}return false}_consumeAttr(attrName){const fullName=mergeNsAndName(attrName.parts[0],attrName.parts[1]);let attrEnd=attrName.sourceSpan.end;if(this._peek.type===15){this._advance()}let value="";const valueTokens=[];let valueStartSpan=undefined;let valueEnd=undefined;const nextTokenType=this._peek.type;if(nextTokenType===16){valueStartSpan=this._peek.sourceSpan;valueEnd=this._peek.sourceSpan.end;while(this._peek.type===16||this._peek.type===17||this._peek.type===9){const valueToken=this._advance();valueTokens.push(valueToken);if(valueToken.type===17){value+=valueToken.parts.join("").replace(/&([^;]+);/g,decodeEntity)}else if(valueToken.type===9){value+=valueToken.parts[0]}else{value+=valueToken.parts.join("")}valueEnd=attrEnd=valueToken.sourceSpan.end}}if(this._peek.type===15){const quoteToken=this._advance();attrEnd=quoteToken.sourceSpan.end}const valueSpan=valueStartSpan&&valueEnd&&new ParseSourceSpan(valueStartSpan.start,valueEnd,valueStartSpan.fullStart);return new Attribute(fullName,value,new ParseSourceSpan(attrName.sourceSpan.start,attrEnd,attrName.sourceSpan.fullStart),attrName.sourceSpan,valueSpan,valueTokens.length>0?valueTokens:undefined,undefined)}_consumeBlockOpen(token){const parameters=[];while(this._peek.type===27){const paramToken=this._advance();parameters.push(new BlockParameter(paramToken.parts[0],paramToken.sourceSpan))}if(this._peek.type===25){this._advance()}const end=this._peek.sourceSpan.fullStart;const span=new ParseSourceSpan(token.sourceSpan.start,end,token.sourceSpan.fullStart);const startSpan=new ParseSourceSpan(token.sourceSpan.start,end,token.sourceSpan.fullStart);const block=new Block(token.parts[0],parameters,[],span,token.sourceSpan,startSpan);this._pushContainer(block,false)}_consumeBlockClose(token){if(!this._popContainer(null,Block,token.sourceSpan)){this.errors.push(TreeError.create(null,token.sourceSpan,`Unexpected closing block. The block may have been closed earlier. `+`If you meant to write the } character, you should use the "}" `+`HTML entity instead.`))}}_consumeIncompleteBlock(token){const parameters=[];while(this._peek.type===27){const paramToken=this._advance();parameters.push(new BlockParameter(paramToken.parts[0],paramToken.sourceSpan))}const end=this._peek.sourceSpan.fullStart;const span=new ParseSourceSpan(token.sourceSpan.start,end,token.sourceSpan.fullStart);const startSpan=new ParseSourceSpan(token.sourceSpan.start,end,token.sourceSpan.fullStart);const block=new Block(token.parts[0],parameters,[],span,token.sourceSpan,startSpan);this._pushContainer(block,false);this._popContainer(null,Block,null);this.errors.push(TreeError.create(token.parts[0],span,`Incomplete block "${token.parts[0]}". If you meant to write the @ character, `+`you should use the "@" HTML entity instead.`))}_getContainer(){return this._containerStack.length>0?this._containerStack[this._containerStack.length-1]:null}_getClosestParentElement(){for(let i=this._containerStack.length-1;i>-1;i--){if(this._containerStack[i]instanceof Element){return this._containerStack[i]}}return null}_addToParent(node){const parent=this._getContainer();if(parent===null){this.rootNodes.push(node)}else{parent.children.push(node)}}_getElementFullName(prefix,localName,parentElement){if(prefix===""){prefix=this.getTagDefinition(localName).implicitNamespacePrefix||"";if(prefix===""&&parentElement!=null){const parentTagName=splitNsName(parentElement.name)[1];const parentTagDefinition=this.getTagDefinition(parentTagName);if(!parentTagDefinition.preventNamespaceInheritance){prefix=getNsPrefix(parentElement.name)}}}return mergeNsAndName(prefix,localName)}}function lastOnStack(stack,element){return stack.length>0&&stack[stack.length-1]===element}function decodeEntity(match,entity){if(NAMED_ENTITIES[entity]!==undefined){return NAMED_ENTITIES[entity]||match}if(/^#x[a-f0-9]+$/i.test(entity)){return String.fromCodePoint(parseInt(entity.slice(2),16))}if(/^#\d+$/.test(entity)){return String.fromCodePoint(parseInt(entity.slice(1),10))}return match}const TRUSTED_TYPES_SINKS=new Set(["iframe|srcdoc","*|innerhtml","*|outerhtml","embed|src","object|codebase","object|data"]);function isTrustedTypesSink(tagName,propName){tagName=tagName.toLowerCase();propName=propName.toLowerCase();return TRUSTED_TYPES_SINKS.has(tagName+"|"+propName)||TRUSTED_TYPES_SINKS.has("*|"+propName)}const setI18nRefs=(htmlNode,i18nNode)=>{if(htmlNode instanceof NodeWithI18n){if(i18nNode instanceof IcuPlaceholder&&htmlNode.i18n instanceof Message){i18nNode.previousMessage=htmlNode.i18n}htmlNode.i18n=i18nNode}return i18nNode};class I18nMetaVisitor{constructor(interpolationConfig=DEFAULT_INTERPOLATION_CONFIG,keepI18nAttrs=false,enableI18nLegacyMessageIdFormat=false,containerBlocks=DEFAULT_CONTAINER_BLOCKS){this.interpolationConfig=interpolationConfig;this.keepI18nAttrs=keepI18nAttrs;this.enableI18nLegacyMessageIdFormat=enableI18nLegacyMessageIdFormat;this.containerBlocks=containerBlocks;this.hasI18nMeta=false;this._errors=[]}_generateI18nMessage(nodes,meta="",visitNodeFn){const{meaning:meaning,description:description,customId:customId}=this._parseMetadata(meta);const createI18nMessage=createI18nMessageFactory(this.interpolationConfig,this.containerBlocks);const message=createI18nMessage(nodes,meaning,description,customId,visitNodeFn);this._setMessageId(message,meta);this._setLegacyIds(message,meta);return message}visitAllWithErrors(nodes){const result=nodes.map((node=>node.visit(this,null)));return new ParseTreeResult(result,this._errors)}visitElement(element){let message=undefined;if(hasI18nAttrs(element)){this.hasI18nMeta=true;const attrs=[];const attrsMeta={};for(const attr of element.attrs){if(attr.name===I18N_ATTR){const i18n=element.i18n||attr.value;message=this._generateI18nMessage(element.children,i18n,setI18nRefs);if(message.nodes.length===0){message=undefined}element.i18n=message}else if(attr.name.startsWith(I18N_ATTR_PREFIX)){const name=attr.name.slice(I18N_ATTR_PREFIX.length);if(isTrustedTypesSink(element.name,name)){this._reportError(attr,`Translating attribute '${name}' is disallowed for security reasons.`)}else{attrsMeta[name]=attr.value}}else{attrs.push(attr)}}if(Object.keys(attrsMeta).length){for(const attr of attrs){const meta=attrsMeta[attr.name];if(meta!==undefined&&attr.value){attr.i18n=this._generateI18nMessage([attr],attr.i18n||meta)}}}if(!this.keepI18nAttrs){element.attrs=attrs}}visitAll(this,element.children,message);return element}visitExpansion(expansion,currentMessage){let message;const meta=expansion.i18n;this.hasI18nMeta=true;if(meta instanceof IcuPlaceholder){const name=meta.name;message=this._generateI18nMessage([expansion],meta);const icu=icuFromI18nMessage(message);icu.name=name;if(currentMessage!==null){currentMessage.placeholderToMessage[name]=message}}else{message=this._generateI18nMessage([expansion],currentMessage||meta)}expansion.i18n=message;return expansion}visitText(text){return text}visitAttribute(attribute){return attribute}visitComment(comment){return comment}visitExpansionCase(expansionCase){return expansionCase}visitBlock(block,context){visitAll(this,block.children,context);return block}visitBlockParameter(parameter,context){return parameter}_parseMetadata(meta){return typeof meta==="string"?parseI18nMeta(meta):meta instanceof Message?meta:{}}_setMessageId(message,meta){if(!message.id){message.id=meta instanceof Message&&meta.id||decimalDigest(message)}}_setLegacyIds(message,meta){if(this.enableI18nLegacyMessageIdFormat){message.legacyIds=[computeDigest(message),computeDecimalDigest(message)]}else if(typeof meta!=="string"){const previousMessage=meta instanceof Message?meta:meta instanceof IcuPlaceholder?meta.previousMessage:undefined;message.legacyIds=previousMessage?previousMessage.legacyIds:[]}}_reportError(node,msg){this._errors.push(new I18nError(node.sourceSpan,msg))}}const I18N_MEANING_SEPARATOR="|";const I18N_ID_SEPARATOR="@@";function parseI18nMeta(meta=""){let customId;let meaning;let description;meta=meta.trim();if(meta){const idIndex=meta.indexOf(I18N_ID_SEPARATOR);const descIndex=meta.indexOf(I18N_MEANING_SEPARATOR);let meaningAndDesc;[meaningAndDesc,customId]=idIndex>-1?[meta.slice(0,idIndex),meta.slice(idIndex+2)]:[meta,""];[meaning,description]=descIndex>-1?[meaningAndDesc.slice(0,descIndex),meaningAndDesc.slice(descIndex+1)]:["",meaningAndDesc]}return{customId:customId,meaning:meaning,description:description}}function i18nMetaToJSDoc(meta){const tags=[];if(meta.description){tags.push({tagName:"desc",text:meta.description})}else{tags.push({tagName:"suppress",text:"{msgDescriptions}"})}if(meta.meaning){tags.push({tagName:"meaning",text:meta.meaning})}return jsDocComment(tags)}const GOOG_GET_MSG="goog.getMsg";function createGoogleGetMsgStatements(variable$1,message,closureVar,placeholderValues){const messageString=serializeI18nMessageForGetMsg(message);const args=[literal(messageString)];if(Object.keys(placeholderValues).length){args.push(mapLiteral(formatI18nPlaceholderNamesInMap(placeholderValues,true),true));args.push(mapLiteral({original_code:literalMap(Object.keys(placeholderValues).map((param=>({key:formatI18nPlaceholderName(param),quoted:true,value:message.placeholders[param]?literal(message.placeholders[param].sourceSpan.toString()):literal(message.placeholderToMessage[param].nodes.map((node=>node.sourceSpan.toString())).join(""))}))))}))}const googGetMsgStmt=closureVar.set(variable(GOOG_GET_MSG).callFn(args)).toConstDecl();googGetMsgStmt.addLeadingComment(i18nMetaToJSDoc(message));const i18nAssignmentStmt=new ExpressionStatement(variable$1.set(closureVar));return[googGetMsgStmt,i18nAssignmentStmt]}class GetMsgSerializerVisitor{formatPh(value){return`{$${formatI18nPlaceholderName(value)}}`}visitText(text){return text.value}visitContainer(container){return container.children.map((child=>child.visit(this))).join("")}visitIcu(icu){return serializeIcuNode(icu)}visitTagPlaceholder(ph){return ph.isVoid?this.formatPh(ph.startName):`${this.formatPh(ph.startName)}${ph.children.map((child=>child.visit(this))).join("")}${this.formatPh(ph.closeName)}`}visitPlaceholder(ph){return this.formatPh(ph.name)}visitBlockPlaceholder(ph){return`${this.formatPh(ph.startName)}${ph.children.map((child=>child.visit(this))).join("")}${this.formatPh(ph.closeName)}`}visitIcuPlaceholder(ph,context){return this.formatPh(ph.name)}}const serializerVisitor=new GetMsgSerializerVisitor;function serializeI18nMessageForGetMsg(message){return message.nodes.map((node=>node.visit(serializerVisitor,null))).join("")}function createLocalizeStatements(variable,message,params){const{messageParts:messageParts,placeHolders:placeHolders}=serializeI18nMessageForLocalize(message);const sourceSpan=getSourceSpan(message);const expressions=placeHolders.map((ph=>params[ph.text]));const localizedString$1=localizedString(message,messageParts,placeHolders,expressions,sourceSpan);const variableInitialization=variable.set(localizedString$1);return[new ExpressionStatement(variableInitialization)]}class LocalizeSerializerVisitor{constructor(placeholderToMessage,pieces){this.placeholderToMessage=placeholderToMessage;this.pieces=pieces}visitText(text){if(this.pieces[this.pieces.length-1]instanceof LiteralPiece){this.pieces[this.pieces.length-1].text+=text.value}else{const sourceSpan=new ParseSourceSpan(text.sourceSpan.fullStart,text.sourceSpan.end,text.sourceSpan.fullStart,text.sourceSpan.details);this.pieces.push(new LiteralPiece(text.value,sourceSpan))}}visitContainer(container){container.children.forEach((child=>child.visit(this)))}visitIcu(icu){this.pieces.push(new LiteralPiece(serializeIcuNode(icu),icu.sourceSpan))}visitTagPlaceholder(ph){this.pieces.push(this.createPlaceholderPiece(ph.startName,ph.startSourceSpan??ph.sourceSpan));if(!ph.isVoid){ph.children.forEach((child=>child.visit(this)));this.pieces.push(this.createPlaceholderPiece(ph.closeName,ph.endSourceSpan??ph.sourceSpan))}}visitPlaceholder(ph){this.pieces.push(this.createPlaceholderPiece(ph.name,ph.sourceSpan))}visitBlockPlaceholder(ph){this.pieces.push(this.createPlaceholderPiece(ph.startName,ph.startSourceSpan??ph.sourceSpan));ph.children.forEach((child=>child.visit(this)));this.pieces.push(this.createPlaceholderPiece(ph.closeName,ph.endSourceSpan??ph.sourceSpan))}visitIcuPlaceholder(ph){this.pieces.push(this.createPlaceholderPiece(ph.name,ph.sourceSpan,this.placeholderToMessage[ph.name]))}createPlaceholderPiece(name,sourceSpan,associatedMessage){return new PlaceholderPiece(formatI18nPlaceholderName(name,false),sourceSpan,associatedMessage)}}function serializeI18nMessageForLocalize(message){const pieces=[];const serializerVisitor=new LocalizeSerializerVisitor(message.placeholderToMessage,pieces);message.nodes.forEach((node=>node.visit(serializerVisitor)));return processMessagePieces(pieces)}function getSourceSpan(message){const startNode=message.nodes[0];const endNode=message.nodes[message.nodes.length-1];return new ParseSourceSpan(startNode.sourceSpan.fullStart,endNode.sourceSpan.end,startNode.sourceSpan.fullStart,startNode.sourceSpan.details)}function processMessagePieces(pieces){const messageParts=[];const placeHolders=[];if(pieces[0]instanceof PlaceholderPiece){messageParts.push(createEmptyMessagePart(pieces[0].sourceSpan.start))}for(let i=0;i<pieces.length;i++){const part=pieces[i];if(part instanceof LiteralPiece){messageParts.push(part)}else{placeHolders.push(part);if(pieces[i-1]instanceof PlaceholderPiece){messageParts.push(createEmptyMessagePart(pieces[i-1].sourceSpan.end))}}}if(pieces[pieces.length-1]instanceof PlaceholderPiece){messageParts.push(createEmptyMessagePart(pieces[pieces.length-1].sourceSpan.end))}return{messageParts:messageParts,placeHolders:placeHolders}}function createEmptyMessagePart(location){return new LiteralPiece("",new ParseSourceSpan(location,location))}const NG_I18N_CLOSURE_MODE$1="ngI18nClosureMode";const TRANSLATION_VAR_PREFIX="i18n_";const I18N_ICU_MAPPING_PREFIX="I18N_EXP_";const ESCAPE="\ufffd";function collectI18nConsts(job){const fileBasedI18nSuffix=job.relativeContextFilePath.replace(/[^A-Za-z0-9]/g,"_").toUpperCase()+"_";const extractedAttributesByI18nContext=new Map;const i18nAttributesByElement=new Map;const i18nExpressionsByElement=new Map;const messages=new Map;for(const unit of job.units){for(const op of unit.ops()){if(op.kind===OpKind.ExtractedAttribute&&op.i18nContext!==null){const attributes=extractedAttributesByI18nContext.get(op.i18nContext)??[];attributes.push(op);extractedAttributesByI18nContext.set(op.i18nContext,attributes)}else if(op.kind===OpKind.I18nAttributes){i18nAttributesByElement.set(op.target,op)}else if(op.kind===OpKind.I18nExpression&&op.usage===I18nExpressionFor.I18nAttribute){const expressions=i18nExpressionsByElement.get(op.target)??[];expressions.push(op);i18nExpressionsByElement.set(op.target,expressions)}else if(op.kind===OpKind.I18nMessage){messages.set(op.xref,op)}}}const i18nValuesByContext=new Map;const messageConstIndices=new Map;for(const unit of job.units){for(const op of unit.create){if(op.kind===OpKind.I18nMessage){if(op.messagePlaceholder===null){const{mainVar:mainVar,statements:statements}=collectMessage(job,fileBasedI18nSuffix,messages,op);if(op.i18nBlock!==null){const i18nConst=job.addConst(mainVar,statements);messageConstIndices.set(op.i18nBlock,i18nConst)}else{job.constsInitializers.push(...statements);i18nValuesByContext.set(op.i18nContext,mainVar);const attributesForMessage=extractedAttributesByI18nContext.get(op.i18nContext);if(attributesForMessage!==undefined){for(const attr of attributesForMessage){attr.expression=mainVar.clone()}}}}OpList.remove(op)}}}for(const unit of job.units){for(const elem of unit.create){if(isElementOrContainerOp(elem)){const i18nAttributes=i18nAttributesByElement.get(elem.xref);if(i18nAttributes===undefined){continue}let i18nExpressions=i18nExpressionsByElement.get(elem.xref);if(i18nExpressions===undefined){throw new Error("AssertionError: Could not find any i18n expressions associated with an I18nAttributes instruction")}const seenPropertyNames=new Set;i18nExpressions=i18nExpressions.filter((i18nExpr=>{const seen=seenPropertyNames.has(i18nExpr.name);seenPropertyNames.add(i18nExpr.name);return!seen}));const i18nAttributeConfig=i18nExpressions.flatMap((i18nExpr=>{const i18nExprValue=i18nValuesByContext.get(i18nExpr.context);if(i18nExprValue===undefined){throw new Error("AssertionError: Could not find i18n expression's value")}return[literal(i18nExpr.name),i18nExprValue]}));i18nAttributes.i18nAttributesConfig=job.addConst(new LiteralArrayExpr(i18nAttributeConfig))}}}for(const unit of job.units){for(const op of unit.create){if(op.kind===OpKind.I18nStart){const msgIndex=messageConstIndices.get(op.root);if(msgIndex===undefined){throw new Error("AssertionError: Could not find corresponding i18n block index for an i18n message op; was an i18n message incorrectly assumed to correspond to an attribute?")}op.messageIndex=msgIndex}}}}function collectMessage(job,fileBasedI18nSuffix,messages,messageOp){const statements=[];const subMessagePlaceholders=new Map;for(const subMessageId of messageOp.subMessages){const subMessage=messages.get(subMessageId);const{mainVar:subMessageVar,statements:subMessageStatements}=collectMessage(job,fileBasedI18nSuffix,messages,subMessage);statements.push(...subMessageStatements);const subMessages=subMessagePlaceholders.get(subMessage.messagePlaceholder)??[];subMessages.push(subMessageVar);subMessagePlaceholders.set(subMessage.messagePlaceholder,subMessages)}addSubMessageParams(messageOp,subMessagePlaceholders);messageOp.params=new Map([...messageOp.params.entries()].sort());const mainVar=variable(job.pool.uniqueName(TRANSLATION_VAR_PREFIX));const closureVar=i18nGenerateClosureVar(job.pool,messageOp.message.id,fileBasedI18nSuffix,job.i18nUseExternalIds);let transformFn=undefined;if(messageOp.needsPostprocessing||messageOp.postprocessingParams.size>0){const postprocessingParams=Object.fromEntries([...messageOp.postprocessingParams.entries()].sort());const formattedPostprocessingParams=formatI18nPlaceholderNamesInMap(postprocessingParams,false);const extraTransformFnParams=[];if(messageOp.postprocessingParams.size>0){extraTransformFnParams.push(mapLiteral(formattedPostprocessingParams,true))}transformFn=expr=>importExpr(Identifiers.i18nPostprocess).callFn([expr,...extraTransformFnParams])}statements.push(...getTranslationDeclStmts$1(messageOp.message,mainVar,closureVar,messageOp.params,transformFn));return{mainVar:mainVar,statements:statements}}function addSubMessageParams(messageOp,subMessagePlaceholders){for(const[placeholder,subMessages]of subMessagePlaceholders){if(subMessages.length===1){messageOp.params.set(placeholder,subMessages[0])}else{messageOp.params.set(placeholder,literal(`${ESCAPE}${I18N_ICU_MAPPING_PREFIX}${placeholder}${ESCAPE}`));messageOp.postprocessingParams.set(placeholder,literalArr(subMessages))}}}function getTranslationDeclStmts$1(message,variable,closureVar,params,transformFn){const paramsObject=Object.fromEntries(params);const statements=[declareI18nVariable(variable),ifStmt(createClosureModeGuard$1(),createGoogleGetMsgStatements(variable,message,closureVar,paramsObject),createLocalizeStatements(variable,message,formatI18nPlaceholderNamesInMap(paramsObject,false)))];if(transformFn){statements.push(new ExpressionStatement(variable.set(transformFn(variable))))}return statements}function createClosureModeGuard$1(){return typeofExpr(variable(NG_I18N_CLOSURE_MODE$1)).notIdentical(literal("undefined",STRING_TYPE)).and(variable(NG_I18N_CLOSURE_MODE$1))}function i18nGenerateClosureVar(pool,messageId,fileBasedI18nSuffix,useExternalIds){let name;const suffix=fileBasedI18nSuffix;if(useExternalIds){const prefix=getTranslationConstPrefix(`EXTERNAL_`);const uniqueSuffix=pool.uniqueName(suffix);name=`${prefix}${sanitizeIdentifier(messageId)}$$${uniqueSuffix}`}else{const prefix=getTranslationConstPrefix(suffix);name=pool.uniqueName(prefix)}return variable(name)}function convertI18nText(job){for(const unit of job.units){let currentI18n=null;let currentIcu=null;const textNodeI18nBlocks=new Map;const textNodeIcus=new Map;const icuPlaceholderByText=new Map;for(const op of unit.create){switch(op.kind){case OpKind.I18nStart:if(op.context===null){throw Error("I18n op should have its context set.")}currentI18n=op;break;case OpKind.I18nEnd:currentI18n=null;break;case OpKind.IcuStart:if(op.context===null){throw Error("Icu op should have its context set.")}currentIcu=op;break;case OpKind.IcuEnd:currentIcu=null;break;case OpKind.Text:if(currentI18n!==null){textNodeI18nBlocks.set(op.xref,currentI18n);textNodeIcus.set(op.xref,currentIcu);if(op.icuPlaceholder!==null){const icuPlaceholderOp=createIcuPlaceholderOp(job.allocateXrefId(),op.icuPlaceholder,[op.initialValue]);OpList.replace(op,icuPlaceholderOp);icuPlaceholderByText.set(op.xref,icuPlaceholderOp)}else{OpList.remove(op)}}break}}for(const op of unit.update){switch(op.kind){case OpKind.InterpolateText:if(!textNodeI18nBlocks.has(op.target)){continue}const i18nOp=textNodeI18nBlocks.get(op.target);const icuOp=textNodeIcus.get(op.target);const icuPlaceholder=icuPlaceholderByText.get(op.target);const contextId=icuOp?icuOp.context:i18nOp.context;const resolutionTime=icuOp?I18nParamResolutionTime.Postproccessing:I18nParamResolutionTime.Creation;const ops=[];for(let i=0;i<op.interpolation.expressions.length;i++){const expr=op.interpolation.expressions[i];ops.push(createI18nExpressionOp(contextId,i18nOp.xref,i18nOp.xref,i18nOp.handle,expr,icuPlaceholder?.xref??null,op.interpolation.i18nPlaceholders[i]??null,resolutionTime,I18nExpressionFor.I18nText,"",expr.sourceSpan??op.sourceSpan))}OpList.replaceWithMany(op,ops);if(icuPlaceholder!==undefined){icuPlaceholder.strings=op.interpolation.strings}break}}}}function liftLocalRefs(job){for(const unit of job.units){for(const op of unit.create){switch(op.kind){case OpKind.ElementStart:case OpKind.Template:if(!Array.isArray(op.localRefs)){throw new Error(`AssertionError: expected localRefs to be an array still`)}op.numSlotsUsed+=op.localRefs.length;if(op.localRefs.length>0){const localRefs=serializeLocalRefs(op.localRefs);op.localRefs=job.addConst(localRefs)}else{op.localRefs=null}break}}}}function serializeLocalRefs(refs){const constRefs=[];for(const ref of refs){constRefs.push(literal(ref.name),literal(ref.target))}return literalArr(constRefs)}function emitNamespaceChanges(job){for(const unit of job.units){let activeNamespace=Namespace.HTML;for(const op of unit.create){if(op.kind!==OpKind.ElementStart){continue}if(op.namespace!==activeNamespace){OpList.insertBefore(createNamespaceOp(op.namespace),op);activeNamespace=op.namespace}}}}function parse(value){const styles=[];let i=0;let parenDepth=0;let quote=0;let valueStart=0;let propStart=0;let currentProp=null;while(i<value.length){const token=value.charCodeAt(i++);switch(token){case 40:parenDepth++;break;case 41:parenDepth--;break;case 39:if(quote===0){quote=39}else if(quote===39&&value.charCodeAt(i-1)!==92){quote=0}break;case 34:if(quote===0){quote=34}else if(quote===34&&value.charCodeAt(i-1)!==92){quote=0}break;case 58:if(!currentProp&&parenDepth===0&"e===0){currentProp=hyphenate(value.substring(propStart,i-1).trim());valueStart=i}break;case 59:if(currentProp&&valueStart>0&&parenDepth===0&"e===0){const styleVal=value.substring(valueStart,i-1).trim();styles.push(currentProp,styleVal);propStart=i;valueStart=0;currentProp=null}break}}if(currentProp&&valueStart){const styleVal=value.slice(valueStart).trim();styles.push(currentProp,styleVal)}return styles}function hyphenate(value){return value.replace(/[a-z][A-Z]/g,(v=>v.charAt(0)+"-"+v.charAt(1))).toLowerCase()}function nameFunctionsAndVariables(job){addNamesToView(job.root,job.componentName,{index:0},job.compatibility===CompatibilityMode.TemplateDefinitionBuilder)}function addNamesToView(unit,baseName,state,compatibility){if(unit.fnName===null){unit.fnName=unit.job.pool.uniqueName(sanitizeIdentifier(`${baseName}_${unit.job.fnSuffix}`),false)}const varNames=new Map;for(const op of unit.ops()){switch(op.kind){case OpKind.Property:case OpKind.HostProperty:if(op.isAnimationTrigger){op.name="@"+op.name}break;case OpKind.Listener:if(op.handlerFnName!==null){break}if(!op.hostListener&&op.targetSlot.slot===null){throw new Error(`Expected a slot to be assigned`)}let animation="";if(op.isAnimationListener){op.name=`@${op.name}.${op.animationPhase}`;animation="animation"}if(op.hostListener){op.handlerFnName=`${baseName}_${animation}${op.name}_HostBindingHandler`}else{op.handlerFnName=`${unit.fnName}_${op.tag.replace("-","_")}_${animation}${op.name}_${op.targetSlot.slot}_listener`}op.handlerFnName=sanitizeIdentifier(op.handlerFnName);break;case OpKind.TwoWayListener:if(op.handlerFnName!==null){break}if(op.targetSlot.slot===null){throw new Error(`Expected a slot to be assigned`)}op.handlerFnName=sanitizeIdentifier(`${unit.fnName}_${op.tag.replace("-","_")}_${op.name}_${op.targetSlot.slot}_listener`);break;case OpKind.Variable:varNames.set(op.xref,getVariableName(unit,op.variable,state));break;case OpKind.RepeaterCreate:if(!(unit instanceof ViewCompilationUnit)){throw new Error(`AssertionError: must be compiling a component`)}if(op.handle.slot===null){throw new Error(`Expected slot to be assigned`)}if(op.emptyView!==null){const emptyView=unit.job.views.get(op.emptyView);addNamesToView(emptyView,`${baseName}_${op.functionNameSuffix}Empty_${op.handle.slot+2}`,state,compatibility)}addNamesToView(unit.job.views.get(op.xref),`${baseName}_${op.functionNameSuffix}_${op.handle.slot+1}`,state,compatibility);break;case OpKind.Template:if(!(unit instanceof ViewCompilationUnit)){throw new Error(`AssertionError: must be compiling a component`)}const childView=unit.job.views.get(op.xref);if(op.handle.slot===null){throw new Error(`Expected slot to be assigned`)}const suffix=op.functionNameSuffix.length===0?"":`_${op.functionNameSuffix}`;addNamesToView(childView,`${baseName}${suffix}_${op.handle.slot}`,state,compatibility);break;case OpKind.StyleProp:op.name=normalizeStylePropName(op.name);if(compatibility){op.name=stripImportant(op.name)}break;case OpKind.ClassProp:if(compatibility){op.name=stripImportant(op.name)}break}}for(const op of unit.ops()){visitExpressionsInOp(op,(expr=>{if(!(expr instanceof ReadVariableExpr)||expr.name!==null){return}if(!varNames.has(expr.xref)){throw new Error(`Variable ${expr.xref} not yet named`)}expr.name=varNames.get(expr.xref)}))}}function getVariableName(unit,variable,state){if(variable.name===null){switch(variable.kind){case SemanticVariableKind.Context:variable.name=`ctx_r${state.index++}`;break;case SemanticVariableKind.Identifier:if(unit.job.compatibility===CompatibilityMode.TemplateDefinitionBuilder){const compatPrefix=variable.identifier==="ctx"?"i":"";variable.name=`${variable.identifier}_${compatPrefix}r${++state.index}`}else{variable.name=`${variable.identifier}_i${state.index++}`}break;default:variable.name=`_r${++state.index}`;break}}return variable.name}function normalizeStylePropName(name){return name.startsWith("--")?name:hyphenate(name)}function stripImportant(name){const importantIndex=name.indexOf("!important");if(importantIndex>-1){return name.substring(0,importantIndex)}return name}function mergeNextContextExpressions(job){for(const unit of job.units){for(const op of unit.create){if(op.kind===OpKind.Listener||op.kind===OpKind.TwoWayListener){mergeNextContextsInOps(op.handlerOps)}}mergeNextContextsInOps(unit.update)}}function mergeNextContextsInOps(ops){for(const op of ops){if(op.kind!==OpKind.Statement||!(op.statement instanceof ExpressionStatement)||!(op.statement.expr instanceof NextContextExpr)){continue}const mergeSteps=op.statement.expr.steps;let tryToMerge=true;for(let candidate=op.next;candidate.kind!==OpKind.ListEnd&&tryToMerge;candidate=candidate.next){visitExpressionsInOp(candidate,((expr,flags)=>{if(!isIrExpression(expr)){return expr}if(!tryToMerge){return}if(flags&VisitorContextFlag.InChildOperation){return}switch(expr.kind){case ExpressionKind.NextContext:expr.steps+=mergeSteps;OpList.remove(op);tryToMerge=false;break;case ExpressionKind.GetCurrentView:case ExpressionKind.Reference:tryToMerge=false;break}return}))}}}const CONTAINER_TAG="ng-container";function generateNgContainerOps(job){for(const unit of job.units){const updatedElementXrefs=new Set;for(const op of unit.create){if(op.kind===OpKind.ElementStart&&op.tag===CONTAINER_TAG){op.kind=OpKind.ContainerStart;updatedElementXrefs.add(op.xref)}if(op.kind===OpKind.ElementEnd&&updatedElementXrefs.has(op.xref)){op.kind=OpKind.ContainerEnd}}}}function lookupElement(elements,xref){const el=elements.get(xref);if(el===undefined){throw new Error("All attributes should have an element-like target.")}return el}function disableBindings$1(job){const elements=new Map;for(const view of job.units){for(const op of view.create){if(!isElementOrContainerOp(op)){continue}elements.set(op.xref,op)}}for(const unit of job.units){for(const op of unit.create){if((op.kind===OpKind.ElementStart||op.kind===OpKind.ContainerStart)&&op.nonBindable){OpList.insertAfter(createDisableBindingsOp(op.xref),op)}if((op.kind===OpKind.ElementEnd||op.kind===OpKind.ContainerEnd)&&lookupElement(elements,op.xref).nonBindable){OpList.insertBefore(createEnableBindingsOp(op.xref),op)}}}}function generateNullishCoalesceExpressions(job){for(const unit of job.units){for(const op of unit.ops()){transformExpressionsInOp(op,(expr=>{if(!(expr instanceof BinaryOperatorExpr)||expr.operator!==exports.BinaryOperator.NullishCoalesce){return expr}const assignment=new AssignTemporaryExpr(expr.lhs.clone(),job.allocateXrefId());const read=new ReadTemporaryExpr(assignment.xref);return new ConditionalExpr(new BinaryOperatorExpr(exports.BinaryOperator.And,new BinaryOperatorExpr(exports.BinaryOperator.NotIdentical,assignment,NULL_EXPR),new BinaryOperatorExpr(exports.BinaryOperator.NotIdentical,read,new LiteralExpr(undefined))),read.clone(),expr.rhs)}),VisitorContextFlag.None)}}}function kindTest(kind){return op=>op.kind===kind}function kindWithInterpolationTest(kind,interpolation){return op=>op.kind===kind&&interpolation===op.expression instanceof Interpolation}function basicListenerKindTest(op){return op.kind===OpKind.Listener&&!(op.hostListener&&op.isAnimationListener)||op.kind===OpKind.TwoWayListener}function nonInterpolationPropertyKindTest(op){return(op.kind===OpKind.Property||op.kind===OpKind.TwoWayProperty)&&!(op.expression instanceof Interpolation)}const CREATE_ORDERING=[{test:op=>op.kind===OpKind.Listener&&op.hostListener&&op.isAnimationListener},{test:basicListenerKindTest}];const UPDATE_ORDERING=[{test:kindTest(OpKind.StyleMap),transform:keepLast},{test:kindTest(OpKind.ClassMap),transform:keepLast},{test:kindTest(OpKind.StyleProp)},{test:kindTest(OpKind.ClassProp)},{test:kindWithInterpolationTest(OpKind.Attribute,true)},{test:kindWithInterpolationTest(OpKind.Property,true)},{test:nonInterpolationPropertyKindTest},{test:kindWithInterpolationTest(OpKind.Attribute,false)}];const UPDATE_HOST_ORDERING=[{test:kindWithInterpolationTest(OpKind.HostProperty,true)},{test:kindWithInterpolationTest(OpKind.HostProperty,false)},{test:kindTest(OpKind.Attribute)},{test:kindTest(OpKind.StyleMap),transform:keepLast},{test:kindTest(OpKind.ClassMap),transform:keepLast},{test:kindTest(OpKind.StyleProp)},{test:kindTest(OpKind.ClassProp)}];const handledOpKinds=new Set([OpKind.Listener,OpKind.TwoWayListener,OpKind.StyleMap,OpKind.ClassMap,OpKind.StyleProp,OpKind.ClassProp,OpKind.Property,OpKind.TwoWayProperty,OpKind.HostProperty,OpKind.Attribute]);function orderOps(job){for(const unit of job.units){orderWithin(unit.create,CREATE_ORDERING);const ordering=unit.job.kind===CompilationJobKind.Host?UPDATE_HOST_ORDERING:UPDATE_ORDERING;orderWithin(unit.update,ordering)}}function orderWithin(opList,ordering){let opsToOrder=[];let firstTargetInGroup=null;for(const op of opList){const currentTarget=hasDependsOnSlotContextTrait(op)?op.target:null;if(!handledOpKinds.has(op.kind)||currentTarget!==firstTargetInGroup&&(firstTargetInGroup!==null&¤tTarget!==null)){OpList.insertBefore(reorder(opsToOrder,ordering),op);opsToOrder=[];firstTargetInGroup=null}if(handledOpKinds.has(op.kind)){opsToOrder.push(op);OpList.remove(op);firstTargetInGroup=currentTarget??firstTargetInGroup}}opList.push(reorder(opsToOrder,ordering))}function reorder(ops,ordering){const groups=Array.from(ordering,(()=>new Array));for(const op of ops){const groupIndex=ordering.findIndex((o=>o.test(op)));groups[groupIndex].push(op)}return groups.flatMap(((group,i)=>{const transform=ordering[i].transform;return transform?transform(group):group}))}function keepLast(ops){return ops.slice(ops.length-1)}function parseExtractedStyles(job){const elements=new Map;for(const unit of job.units){for(const op of unit.create){if(isElementOrContainerOp(op)){elements.set(op.xref,op)}}}for(const unit of job.units){for(const op of unit.create){if(op.kind===OpKind.ExtractedAttribute&&op.bindingKind===BindingKind.Attribute&&isStringLiteral(op.expression)){const target=elements.get(op.target);if(target!==undefined&&target.kind===OpKind.Template&&target.templateKind===TemplateKind.Structural){continue}if(op.name==="style"){const parsedStyles=parse(op.expression.value);for(let i=0;i<parsedStyles.length-1;i+=2){OpList.insertBefore(createExtractedAttributeOp(op.target,BindingKind.StyleProperty,null,parsedStyles[i],literal(parsedStyles[i+1]),null,null,SecurityContext.STYLE),op)}OpList.remove(op)}else if(op.name==="class"){const parsedClasses=op.expression.value.trim().split(/\s+/g);for(const parsedClass of parsedClasses){OpList.insertBefore(createExtractedAttributeOp(op.target,BindingKind.ClassName,null,parsedClass,null,null,null,SecurityContext.NONE),op)}OpList.remove(op)}}}}}function removeContentSelectors(job){for(const unit of job.units){const elements=createOpXrefMap(unit);for(const op of unit.ops()){switch(op.kind){case OpKind.Binding:const target=lookupInXrefMap(elements,op.target);if(isSelectAttribute(op.name)&&target.kind===OpKind.Projection){OpList.remove(op)}break}}}}function isSelectAttribute(name){return name.toLowerCase()==="select"}function lookupInXrefMap(map,xref){const el=map.get(xref);if(el===undefined){throw new Error("All attributes should have an slottable target.")}return el}function createPipes(job){for(const unit of job.units){processPipeBindingsInView(unit)}}function processPipeBindingsInView(unit){for(const updateOp of unit.update){visitExpressionsInOp(updateOp,((expr,flags)=>{if(!isIrExpression(expr)){return}if(expr.kind!==ExpressionKind.PipeBinding){return}if(flags&VisitorContextFlag.InChildOperation){throw new Error(`AssertionError: pipe bindings should not appear in child expressions`)}if(unit.job.compatibility){const slotHandle=updateOp.target;if(slotHandle==undefined){throw new Error(`AssertionError: expected slot handle to be assigned for pipe creation`)}addPipeToCreationBlock(unit,updateOp.target,expr)}else{unit.create.push(createPipeOp(expr.target,expr.targetSlot,expr.name))}}))}}function addPipeToCreationBlock(unit,afterTargetXref,binding){for(let op=unit.create.head.next;op.kind!==OpKind.ListEnd;op=op.next){if(!hasConsumesSlotTrait(op)){continue}if(op.xref!==afterTargetXref){continue}while(op.next.kind===OpKind.Pipe){op=op.next}const pipe=createPipeOp(binding.target,binding.targetSlot,binding.name);OpList.insertBefore(pipe,op.next);return}throw new Error(`AssertionError: unable to find insertion point for pipe ${binding.name}`)}function createVariadicPipes(job){for(const unit of job.units){for(const op of unit.update){transformExpressionsInOp(op,(expr=>{if(!(expr instanceof PipeBindingExpr)){return expr}if(expr.args.length<=4){return expr}return new PipeBindingVariadicExpr(expr.target,expr.targetSlot,expr.name,literalArr(expr.args),expr.args.length)}),VisitorContextFlag.None)}}}function propagateI18nBlocks(job){propagateI18nBlocksToTemplates(job.root,0)}function propagateI18nBlocksToTemplates(unit,subTemplateIndex){let i18nBlock=null;for(const op of unit.create){switch(op.kind){case OpKind.I18nStart:op.subTemplateIndex=subTemplateIndex===0?null:subTemplateIndex;i18nBlock=op;break;case OpKind.I18nEnd:if(i18nBlock.subTemplateIndex===null){subTemplateIndex=0}i18nBlock=null;break;case OpKind.Template:subTemplateIndex=propagateI18nBlocksForView(unit.job.views.get(op.xref),i18nBlock,op.i18nPlaceholder,subTemplateIndex);break;case OpKind.RepeaterCreate:const forView=unit.job.views.get(op.xref);subTemplateIndex=propagateI18nBlocksForView(forView,i18nBlock,op.i18nPlaceholder,subTemplateIndex);if(op.emptyView!==null){subTemplateIndex=propagateI18nBlocksForView(unit.job.views.get(op.emptyView),i18nBlock,op.emptyI18nPlaceholder,subTemplateIndex)}break}}return subTemplateIndex}function propagateI18nBlocksForView(view,i18nBlock,i18nPlaceholder,subTemplateIndex){if(i18nPlaceholder!==undefined){if(i18nBlock===null){throw Error("Expected template with i18n placeholder to be in an i18n block.")}subTemplateIndex++;wrapTemplateWithI18n(view,i18nBlock)}return propagateI18nBlocksToTemplates(view,subTemplateIndex)}function wrapTemplateWithI18n(unit,parentI18n){if(unit.create.head.next?.kind!==OpKind.I18nStart){const id=unit.job.allocateXrefId();OpList.insertAfter(createI18nStartOp(id,parentI18n.message,parentI18n.root,null),unit.create.head);OpList.insertBefore(createI18nEndOp(id,null),unit.create.tail)}}function extractPureFunctions(job){for(const view of job.units){for(const op of view.ops()){visitExpressionsInOp(op,(expr=>{if(!(expr instanceof PureFunctionExpr)||expr.body===null){return}const constantDef=new PureFunctionConstant(expr.args.length);expr.fn=job.pool.getSharedConstant(constantDef,expr.body);expr.body=null}))}}}class PureFunctionConstant extends GenericKeyFn{constructor(numArgs){super();this.numArgs=numArgs}keyOf(expr){if(expr instanceof PureFunctionParameterExpr){return`param(${expr.index})`}else{return super.keyOf(expr)}}toSharedConstantDeclaration(declName,keyExpr){const fnParams=[];for(let idx=0;idx<this.numArgs;idx++){fnParams.push(new FnParam("a"+idx))}const returnExpr=transformExpressionsInExpression(keyExpr,(expr=>{if(!(expr instanceof PureFunctionParameterExpr)){return expr}return variable("a"+expr.index)}),VisitorContextFlag.None);return new DeclareVarStmt(declName,new ArrowFunctionExpr(fnParams,returnExpr),undefined,exports.StmtModifier.Final)}}function generatePureLiteralStructures(job){for(const unit of job.units){for(const op of unit.update){transformExpressionsInOp(op,((expr,flags)=>{if(flags&VisitorContextFlag.InChildOperation){return expr}if(expr instanceof LiteralArrayExpr){return transformLiteralArray(expr)}else if(expr instanceof LiteralMapExpr){return transformLiteralMap(expr)}return expr}),VisitorContextFlag.None)}}}function transformLiteralArray(expr){const derivedEntries=[];const nonConstantArgs=[];for(const entry of expr.entries){if(entry.isConstant()){derivedEntries.push(entry)}else{const idx=nonConstantArgs.length;nonConstantArgs.push(entry);derivedEntries.push(new PureFunctionParameterExpr(idx))}}return new PureFunctionExpr(literalArr(derivedEntries),nonConstantArgs)}function transformLiteralMap(expr){let derivedEntries=[];const nonConstantArgs=[];for(const entry of expr.entries){if(entry.value.isConstant()){derivedEntries.push(entry)}else{const idx=nonConstantArgs.length;nonConstantArgs.push(entry.value);derivedEntries.push(new LiteralMapEntry(entry.key,new PureFunctionParameterExpr(idx),entry.quoted))}}return new PureFunctionExpr(literalMap(derivedEntries),nonConstantArgs)}function element(slot,tag,constIndex,localRefIndex,sourceSpan){return elementOrContainerBase(Identifiers.element,slot,tag,constIndex,localRefIndex,sourceSpan)}function elementStart(slot,tag,constIndex,localRefIndex,sourceSpan){return elementOrContainerBase(Identifiers.elementStart,slot,tag,constIndex,localRefIndex,sourceSpan)}function elementOrContainerBase(instruction,slot,tag,constIndex,localRefIndex,sourceSpan){const args=[literal(slot)];if(tag!==null){args.push(literal(tag))}if(localRefIndex!==null){args.push(literal(constIndex),literal(localRefIndex))}else if(constIndex!==null){args.push(literal(constIndex))}return call(instruction,args,sourceSpan)}function elementEnd(sourceSpan){return call(Identifiers.elementEnd,[],sourceSpan)}function elementContainerStart(slot,constIndex,localRefIndex,sourceSpan){return elementOrContainerBase(Identifiers.elementContainerStart,slot,null,constIndex,localRefIndex,sourceSpan)}function elementContainer(slot,constIndex,localRefIndex,sourceSpan){return elementOrContainerBase(Identifiers.elementContainer,slot,null,constIndex,localRefIndex,sourceSpan)}function elementContainerEnd(){return call(Identifiers.elementContainerEnd,[],null)}function template(slot,templateFnRef,decls,vars,tag,constIndex,localRefs,sourceSpan){const args=[literal(slot),templateFnRef,literal(decls),literal(vars),literal(tag),literal(constIndex)];if(localRefs!==null){args.push(literal(localRefs));args.push(importExpr(Identifiers.templateRefExtractor))}while(args[args.length-1].isEquivalent(NULL_EXPR)){args.pop()}return call(Identifiers.templateCreate,args,sourceSpan)}function disableBindings(){return call(Identifiers.disableBindings,[],null)}function enableBindings(){return call(Identifiers.enableBindings,[],null)}function listener(name,handlerFn,eventTargetResolver,syntheticHost,sourceSpan){const args=[literal(name),handlerFn];if(eventTargetResolver!==null){args.push(literal(false));args.push(importExpr(eventTargetResolver))}return call(syntheticHost?Identifiers.syntheticHostListener:Identifiers.listener,args,sourceSpan)}function twoWayBindingSet(target,value){return importExpr(Identifiers.twoWayBindingSet).callFn([target,value])}function twoWayListener(name,handlerFn,sourceSpan){return call(Identifiers.twoWayListener,[literal(name),handlerFn],sourceSpan)}function pipe(slot,name){return call(Identifiers.pipe,[literal(slot),literal(name)],null)}function namespaceHTML(){return call(Identifiers.namespaceHTML,[],null)}function namespaceSVG(){return call(Identifiers.namespaceSVG,[],null)}function namespaceMath(){return call(Identifiers.namespaceMathML,[],null)}function advance(delta,sourceSpan){return call(Identifiers.advance,delta>1?[literal(delta)]:[],sourceSpan)}function reference(slot){return importExpr(Identifiers.reference).callFn([literal(slot)])}function nextContext(steps){return importExpr(Identifiers.nextContext).callFn(steps===1?[]:[literal(steps)])}function getCurrentView(){return importExpr(Identifiers.getCurrentView).callFn([])}function restoreView(savedView){return importExpr(Identifiers.restoreView).callFn([savedView])}function resetView(returnValue){return importExpr(Identifiers.resetView).callFn([returnValue])}function text(slot,initialValue,sourceSpan){const args=[literal(slot,null)];if(initialValue!==""){args.push(literal(initialValue))}return call(Identifiers.text,args,sourceSpan)}function defer(selfSlot,primarySlot,dependencyResolverFn,loadingSlot,placeholderSlot,errorSlot,loadingConfig,placeholderConfig,enableTimerScheduling,sourceSpan){const args=[literal(selfSlot),literal(primarySlot),dependencyResolverFn??literal(null),literal(loadingSlot),literal(placeholderSlot),literal(errorSlot),loadingConfig??literal(null),placeholderConfig??literal(null),enableTimerScheduling?importExpr(Identifiers.deferEnableTimerScheduling):literal(null)];let expr;while((expr=args[args.length-1])!==null&&expr instanceof LiteralExpr&&expr.value===null){args.pop()}return call(Identifiers.defer,args,sourceSpan)}const deferTriggerToR3TriggerInstructionsMap=new Map([[DeferTriggerKind.Idle,[Identifiers.deferOnIdle,Identifiers.deferPrefetchOnIdle]],[DeferTriggerKind.Immediate,[Identifiers.deferOnImmediate,Identifiers.deferPrefetchOnImmediate]],[DeferTriggerKind.Timer,[Identifiers.deferOnTimer,Identifiers.deferPrefetchOnTimer]],[DeferTriggerKind.Hover,[Identifiers.deferOnHover,Identifiers.deferPrefetchOnHover]],[DeferTriggerKind.Interaction,[Identifiers.deferOnInteraction,Identifiers.deferPrefetchOnInteraction]],[DeferTriggerKind.Viewport,[Identifiers.deferOnViewport,Identifiers.deferPrefetchOnViewport]]]);function deferOn(trigger,args,prefetch,sourceSpan){const instructions=deferTriggerToR3TriggerInstructionsMap.get(trigger);if(instructions===undefined){throw new Error(`Unable to determine instruction for trigger ${trigger}`)}const instructionToCall=prefetch?instructions[1]:instructions[0];return call(instructionToCall,args.map((a=>literal(a))),sourceSpan)}function projectionDef(def){return call(Identifiers.projectionDef,def?[def]:[],null)}function projection(slot,projectionSlotIndex,attributes,sourceSpan){const args=[literal(slot)];if(projectionSlotIndex!==0||attributes!==null){args.push(literal(projectionSlotIndex));if(attributes!==null){args.push(attributes)}}return call(Identifiers.projection,args,sourceSpan)}function i18nStart(slot,constIndex,subTemplateIndex,sourceSpan){const args=[literal(slot),literal(constIndex)];if(subTemplateIndex!==null){args.push(literal(subTemplateIndex))}return call(Identifiers.i18nStart,args,sourceSpan)}function repeaterCreate(slot,viewFnName,decls,vars,tag,constIndex,trackByFn,trackByUsesComponentInstance,emptyViewFnName,emptyDecls,emptyVars,emptyTag,emptyConstIndex,sourceSpan){const args=[literal(slot),variable(viewFnName),literal(decls),literal(vars),literal(tag),literal(constIndex),trackByFn];if(trackByUsesComponentInstance||emptyViewFnName!==null){args.push(literal(trackByUsesComponentInstance));if(emptyViewFnName!==null){args.push(variable(emptyViewFnName),literal(emptyDecls),literal(emptyVars));if(emptyTag!==null||emptyConstIndex!==null){args.push(literal(emptyTag))}if(emptyConstIndex!==null){args.push(literal(emptyConstIndex))}}}return call(Identifiers.repeaterCreate,args,sourceSpan)}function repeater(collection,sourceSpan){return call(Identifiers.repeater,[collection],sourceSpan)}function deferWhen(prefetch,expr,sourceSpan){return call(prefetch?Identifiers.deferPrefetchWhen:Identifiers.deferWhen,[expr],sourceSpan)}function i18n(slot,constIndex,subTemplateIndex,sourceSpan){const args=[literal(slot),literal(constIndex)];if(subTemplateIndex){args.push(literal(subTemplateIndex))}return call(Identifiers.i18n,args,sourceSpan)}function i18nEnd(endSourceSpan){return call(Identifiers.i18nEnd,[],endSourceSpan)}function i18nAttributes(slot,i18nAttributesConfig){const args=[literal(slot),literal(i18nAttributesConfig)];return call(Identifiers.i18nAttributes,args,null)}function property(name,expression,sanitizer,sourceSpan){const args=[literal(name),expression];if(sanitizer!==null){args.push(sanitizer)}return call(Identifiers.property,args,sourceSpan)}function twoWayProperty(name,expression,sanitizer,sourceSpan){const args=[literal(name),expression];if(sanitizer!==null){args.push(sanitizer)}return call(Identifiers.twoWayProperty,args,sourceSpan)}function attribute(name,expression,sanitizer,namespace){const args=[literal(name),expression];if(sanitizer!==null||namespace!==null){args.push(sanitizer??literal(null))}if(namespace!==null){args.push(literal(namespace))}return call(Identifiers.attribute,args,null)}function styleProp(name,expression,unit,sourceSpan){const args=[literal(name),expression];if(unit!==null){args.push(literal(unit))}return call(Identifiers.styleProp,args,sourceSpan)}function classProp(name,expression,sourceSpan){return call(Identifiers.classProp,[literal(name),expression],sourceSpan)}function styleMap(expression,sourceSpan){return call(Identifiers.styleMap,[expression],sourceSpan)}function classMap(expression,sourceSpan){return call(Identifiers.classMap,[expression],sourceSpan)}const PIPE_BINDINGS=[Identifiers.pipeBind1,Identifiers.pipeBind2,Identifiers.pipeBind3,Identifiers.pipeBind4];function pipeBind(slot,varOffset,args){if(args.length<1||args.length>PIPE_BINDINGS.length){throw new Error(`pipeBind() argument count out of bounds`)}const instruction=PIPE_BINDINGS[args.length-1];return importExpr(instruction).callFn([literal(slot),literal(varOffset),...args])}function pipeBindV(slot,varOffset,args){return importExpr(Identifiers.pipeBindV).callFn([literal(slot),literal(varOffset),args])}function textInterpolate(strings,expressions,sourceSpan){if(strings.length<1||expressions.length!==strings.length-1){throw new Error(`AssertionError: expected specific shape of args for strings/expressions in interpolation`)}const interpolationArgs=[];if(expressions.length===1&&strings[0]===""&&strings[1]===""){interpolationArgs.push(expressions[0])}else{let idx;for(idx=0;idx<expressions.length;idx++){interpolationArgs.push(literal(strings[idx]),expressions[idx])}interpolationArgs.push(literal(strings[idx]))}return callVariadicInstruction(TEXT_INTERPOLATE_CONFIG,[],interpolationArgs,[],sourceSpan)}function i18nExp(expr,sourceSpan){return call(Identifiers.i18nExp,[expr],sourceSpan)}function i18nApply(slot,sourceSpan){return call(Identifiers.i18nApply,[literal(slot)],sourceSpan)}function propertyInterpolate(name,strings,expressions,sanitizer,sourceSpan){const interpolationArgs=collateInterpolationArgs(strings,expressions);const extraArgs=[];if(sanitizer!==null){extraArgs.push(sanitizer)}return callVariadicInstruction(PROPERTY_INTERPOLATE_CONFIG,[literal(name)],interpolationArgs,extraArgs,sourceSpan)}function attributeInterpolate(name,strings,expressions,sanitizer,sourceSpan){const interpolationArgs=collateInterpolationArgs(strings,expressions);const extraArgs=[];if(sanitizer!==null){extraArgs.push(sanitizer)}return callVariadicInstruction(ATTRIBUTE_INTERPOLATE_CONFIG,[literal(name)],interpolationArgs,extraArgs,sourceSpan)}function stylePropInterpolate(name,strings,expressions,unit,sourceSpan){const interpolationArgs=collateInterpolationArgs(strings,expressions);const extraArgs=[];if(unit!==null){extraArgs.push(literal(unit))}return callVariadicInstruction(STYLE_PROP_INTERPOLATE_CONFIG,[literal(name)],interpolationArgs,extraArgs,sourceSpan)}function styleMapInterpolate(strings,expressions,sourceSpan){const interpolationArgs=collateInterpolationArgs(strings,expressions);return callVariadicInstruction(STYLE_MAP_INTERPOLATE_CONFIG,[],interpolationArgs,[],sourceSpan)}function classMapInterpolate(strings,expressions,sourceSpan){const interpolationArgs=collateInterpolationArgs(strings,expressions);return callVariadicInstruction(CLASS_MAP_INTERPOLATE_CONFIG,[],interpolationArgs,[],sourceSpan)}function hostProperty(name,expression,sanitizer,sourceSpan){const args=[literal(name),expression];if(sanitizer!==null){args.push(sanitizer)}return call(Identifiers.hostProperty,args,sourceSpan)}function syntheticHostProperty(name,expression,sourceSpan){return call(Identifiers.syntheticHostProperty,[literal(name),expression],sourceSpan)}function pureFunction(varOffset,fn,args){return callVariadicInstructionExpr(PURE_FUNCTION_CONFIG,[literal(varOffset),fn],args,[],null)}function collateInterpolationArgs(strings,expressions){if(strings.length<1||expressions.length!==strings.length-1){throw new Error(`AssertionError: expected specific shape of args for strings/expressions in interpolation`)}const interpolationArgs=[];if(expressions.length===1&&strings[0]===""&&strings[1]===""){interpolationArgs.push(expressions[0])}else{let idx;for(idx=0;idx<expressions.length;idx++){interpolationArgs.push(literal(strings[idx]),expressions[idx])}interpolationArgs.push(literal(strings[idx]))}return interpolationArgs}function call(instruction,args,sourceSpan){const expr=importExpr(instruction).callFn(args,sourceSpan);return createStatementOp(new ExpressionStatement(expr,sourceSpan))}function conditional(slot,condition,contextValue,sourceSpan){const args=[literal(slot),condition];if(contextValue!==null){args.push(contextValue)}return call(Identifiers.conditional,args,sourceSpan)}const TEXT_INTERPOLATE_CONFIG={constant:[Identifiers.textInterpolate,Identifiers.textInterpolate1,Identifiers.textInterpolate2,Identifiers.textInterpolate3,Identifiers.textInterpolate4,Identifiers.textInterpolate5,Identifiers.textInterpolate6,Identifiers.textInterpolate7,Identifiers.textInterpolate8],variable:Identifiers.textInterpolateV,mapping:n=>{if(n%2===0){throw new Error(`Expected odd number of arguments`)}return(n-1)/2}};const PROPERTY_INTERPOLATE_CONFIG={constant:[Identifiers.propertyInterpolate,Identifiers.propertyInterpolate1,Identifiers.propertyInterpolate2,Identifiers.propertyInterpolate3,Identifiers.propertyInterpolate4,Identifiers.propertyInterpolate5,Identifiers.propertyInterpolate6,Identifiers.propertyInterpolate7,Identifiers.propertyInterpolate8],variable:Identifiers.propertyInterpolateV,mapping:n=>{if(n%2===0){throw new Error(`Expected odd number of arguments`)}return(n-1)/2}};const STYLE_PROP_INTERPOLATE_CONFIG={constant:[Identifiers.styleProp,Identifiers.stylePropInterpolate1,Identifiers.stylePropInterpolate2,Identifiers.stylePropInterpolate3,Identifiers.stylePropInterpolate4,Identifiers.stylePropInterpolate5,Identifiers.stylePropInterpolate6,Identifiers.stylePropInterpolate7,Identifiers.stylePropInterpolate8],variable:Identifiers.stylePropInterpolateV,mapping:n=>{if(n%2===0){throw new Error(`Expected odd number of arguments`)}return(n-1)/2}};const ATTRIBUTE_INTERPOLATE_CONFIG={constant:[Identifiers.attribute,Identifiers.attributeInterpolate1,Identifiers.attributeInterpolate2,Identifiers.attributeInterpolate3,Identifiers.attributeInterpolate4,Identifiers.attributeInterpolate5,Identifiers.attributeInterpolate6,Identifiers.attributeInterpolate7,Identifiers.attributeInterpolate8],variable:Identifiers.attributeInterpolateV,mapping:n=>{if(n%2===0){throw new Error(`Expected odd number of arguments`)}return(n-1)/2}};const STYLE_MAP_INTERPOLATE_CONFIG={constant:[Identifiers.styleMap,Identifiers.styleMapInterpolate1,Identifiers.styleMapInterpolate2,Identifiers.styleMapInterpolate3,Identifiers.styleMapInterpolate4,Identifiers.styleMapInterpolate5,Identifiers.styleMapInterpolate6,Identifiers.styleMapInterpolate7,Identifiers.styleMapInterpolate8],variable:Identifiers.styleMapInterpolateV,mapping:n=>{if(n%2===0){throw new Error(`Expected odd number of arguments`)}return(n-1)/2}};const CLASS_MAP_INTERPOLATE_CONFIG={constant:[Identifiers.classMap,Identifiers.classMapInterpolate1,Identifiers.classMapInterpolate2,Identifiers.classMapInterpolate3,Identifiers.classMapInterpolate4,Identifiers.classMapInterpolate5,Identifiers.classMapInterpolate6,Identifiers.classMapInterpolate7,Identifiers.classMapInterpolate8],variable:Identifiers.classMapInterpolateV,mapping:n=>{if(n%2===0){throw new Error(`Expected odd number of arguments`)}return(n-1)/2}};const PURE_FUNCTION_CONFIG={constant:[Identifiers.pureFunction0,Identifiers.pureFunction1,Identifiers.pureFunction2,Identifiers.pureFunction3,Identifiers.pureFunction4,Identifiers.pureFunction5,Identifiers.pureFunction6,Identifiers.pureFunction7,Identifiers.pureFunction8],variable:Identifiers.pureFunctionV,mapping:n=>n};function callVariadicInstructionExpr(config,baseArgs,interpolationArgs,extraArgs,sourceSpan){const n=config.mapping(interpolationArgs.length);if(n<config.constant.length){return importExpr(config.constant[n]).callFn([...baseArgs,...interpolationArgs,...extraArgs],sourceSpan)}else if(config.variable!==null){return importExpr(config.variable).callFn([...baseArgs,literalArr(interpolationArgs),...extraArgs],sourceSpan)}else{throw new Error(`AssertionError: unable to call variadic function`)}}function callVariadicInstruction(config,baseArgs,interpolationArgs,extraArgs,sourceSpan){return createStatementOp(callVariadicInstructionExpr(config,baseArgs,interpolationArgs,extraArgs,sourceSpan).toStmt())}const GLOBAL_TARGET_RESOLVERS$1=new Map([["window",Identifiers.resolveWindow],["document",Identifiers.resolveDocument],["body",Identifiers.resolveBody]]);function reify(job){for(const unit of job.units){reifyCreateOperations(unit,unit.create);reifyUpdateOperations(unit,unit.update)}}function reifyCreateOperations(unit,ops){for(const op of ops){transformExpressionsInOp(op,reifyIrExpression,VisitorContextFlag.None);switch(op.kind){case OpKind.Text:OpList.replace(op,text(op.handle.slot,op.initialValue,op.sourceSpan));break;case OpKind.ElementStart:OpList.replace(op,elementStart(op.handle.slot,op.tag,op.attributes,op.localRefs,op.startSourceSpan));break;case OpKind.Element:OpList.replace(op,element(op.handle.slot,op.tag,op.attributes,op.localRefs,op.wholeSourceSpan));break;case OpKind.ElementEnd:OpList.replace(op,elementEnd(op.sourceSpan));break;case OpKind.ContainerStart:OpList.replace(op,elementContainerStart(op.handle.slot,op.attributes,op.localRefs,op.startSourceSpan));break;case OpKind.Container:OpList.replace(op,elementContainer(op.handle.slot,op.attributes,op.localRefs,op.wholeSourceSpan));break;case OpKind.ContainerEnd:OpList.replace(op,elementContainerEnd());break;case OpKind.I18nStart:OpList.replace(op,i18nStart(op.handle.slot,op.messageIndex,op.subTemplateIndex,op.sourceSpan));break;case OpKind.I18nEnd:OpList.replace(op,i18nEnd(op.sourceSpan));break;case OpKind.I18n:OpList.replace(op,i18n(op.handle.slot,op.messageIndex,op.subTemplateIndex,op.sourceSpan));break;case OpKind.I18nAttributes:if(op.i18nAttributesConfig===null){throw new Error(`AssertionError: i18nAttributesConfig was not set`)}OpList.replace(op,i18nAttributes(op.handle.slot,op.i18nAttributesConfig));break;case OpKind.Template:if(!(unit instanceof ViewCompilationUnit)){throw new Error(`AssertionError: must be compiling a component`)}if(Array.isArray(op.localRefs)){throw new Error(`AssertionError: local refs array should have been extracted into a constant`)}const childView=unit.job.views.get(op.xref);OpList.replace(op,template(op.handle.slot,variable(childView.fnName),childView.decls,childView.vars,op.tag,op.attributes,op.localRefs,op.startSourceSpan));break;case OpKind.DisableBindings:OpList.replace(op,disableBindings());break;case OpKind.EnableBindings:OpList.replace(op,enableBindings());break;case OpKind.Pipe:OpList.replace(op,pipe(op.handle.slot,op.name));break;case OpKind.Listener:const listenerFn=reifyListenerHandler(unit,op.handlerFnName,op.handlerOps,op.consumesDollarEvent);const eventTargetResolver=op.eventTarget?GLOBAL_TARGET_RESOLVERS$1.get(op.eventTarget):null;if(eventTargetResolver===undefined){throw new Error(`Unexpected global target '${op.eventTarget}' defined for '${op.name}' event. Supported list of global targets: window,document,body.`)}OpList.replace(op,listener(op.name,listenerFn,eventTargetResolver,op.hostListener&&op.isAnimationListener,op.sourceSpan));break;case OpKind.TwoWayListener:OpList.replace(op,twoWayListener(op.name,reifyListenerHandler(unit,op.handlerFnName,op.handlerOps,true),op.sourceSpan));break;case OpKind.Variable:if(op.variable.name===null){throw new Error(`AssertionError: unnamed variable ${op.xref}`)}OpList.replace(op,createStatementOp(new DeclareVarStmt(op.variable.name,op.initializer,undefined,exports.StmtModifier.Final)));break;case OpKind.Namespace:switch(op.active){case Namespace.HTML:OpList.replace(op,namespaceHTML());break;case Namespace.SVG:OpList.replace(op,namespaceSVG());break;case Namespace.Math:OpList.replace(op,namespaceMath());break}break;case OpKind.Defer:const timerScheduling=!!op.loadingMinimumTime||!!op.loadingAfterTime||!!op.placeholderMinimumTime;OpList.replace(op,defer(op.handle.slot,op.mainSlot.slot,op.resolverFn,op.loadingSlot?.slot??null,op.placeholderSlot?.slot??null,op.errorSlot?.slot??null,op.loadingConfig,op.placeholderConfig,timerScheduling,op.sourceSpan));break;case OpKind.DeferOn:let args=[];switch(op.trigger.kind){case DeferTriggerKind.Idle:case DeferTriggerKind.Immediate:break;case DeferTriggerKind.Timer:args=[op.trigger.delay];break;case DeferTriggerKind.Interaction:case DeferTriggerKind.Hover:case DeferTriggerKind.Viewport:if(op.trigger.targetSlot?.slot==null||op.trigger.targetSlotViewSteps===null){throw new Error(`Slot or view steps not set in trigger reification for trigger kind ${op.trigger.kind}`)}args=[op.trigger.targetSlot.slot];if(op.trigger.targetSlotViewSteps!==0){args.push(op.trigger.targetSlotViewSteps)}break;default:throw new Error(`AssertionError: Unsupported reification of defer trigger kind ${op.trigger.kind}`)}OpList.replace(op,deferOn(op.trigger.kind,args,op.prefetch,op.sourceSpan));break;case OpKind.ProjectionDef:OpList.replace(op,projectionDef(op.def));break;case OpKind.Projection:if(op.handle.slot===null){throw new Error("No slot was assigned for project instruction")}OpList.replace(op,projection(op.handle.slot,op.projectionSlotIndex,op.attributes,op.sourceSpan));break;case OpKind.RepeaterCreate:if(op.handle.slot===null){throw new Error("No slot was assigned for repeater instruction")}if(!(unit instanceof ViewCompilationUnit)){throw new Error(`AssertionError: must be compiling a component`)}const repeaterView=unit.job.views.get(op.xref);if(repeaterView.fnName===null){throw new Error(`AssertionError: expected repeater primary view to have been named`)}let emptyViewFnName=null;let emptyDecls=null;let emptyVars=null;if(op.emptyView!==null){const emptyView=unit.job.views.get(op.emptyView);if(emptyView===undefined){throw new Error("AssertionError: repeater had empty view xref, but empty view was not found")}if(emptyView.fnName===null||emptyView.decls===null||emptyView.vars===null){throw new Error(`AssertionError: expected repeater empty view to have been named and counted`)}emptyViewFnName=emptyView.fnName;emptyDecls=emptyView.decls;emptyVars=emptyView.vars}OpList.replace(op,repeaterCreate(op.handle.slot,repeaterView.fnName,op.decls,op.vars,op.tag,op.attributes,op.trackByFn,op.usesComponentInstance,emptyViewFnName,emptyDecls,emptyVars,op.emptyTag,op.emptyAttributes,op.wholeSourceSpan));break;case OpKind.Statement:break;default:throw new Error(`AssertionError: Unsupported reification of create op ${OpKind[op.kind]}`)}}}function reifyUpdateOperations(_unit,ops){for(const op of ops){transformExpressionsInOp(op,reifyIrExpression,VisitorContextFlag.None);switch(op.kind){case OpKind.Advance:OpList.replace(op,advance(op.delta,op.sourceSpan));break;case OpKind.Property:if(op.expression instanceof Interpolation){OpList.replace(op,propertyInterpolate(op.name,op.expression.strings,op.expression.expressions,op.sanitizer,op.sourceSpan))}else{OpList.replace(op,property(op.name,op.expression,op.sanitizer,op.sourceSpan))}break;case OpKind.TwoWayProperty:OpList.replace(op,twoWayProperty(op.name,op.expression,op.sanitizer,op.sourceSpan));break;case OpKind.StyleProp:if(op.expression instanceof Interpolation){OpList.replace(op,stylePropInterpolate(op.name,op.expression.strings,op.expression.expressions,op.unit,op.sourceSpan))}else{OpList.replace(op,styleProp(op.name,op.expression,op.unit,op.sourceSpan))}break;case OpKind.ClassProp:OpList.replace(op,classProp(op.name,op.expression,op.sourceSpan));break;case OpKind.StyleMap:if(op.expression instanceof Interpolation){OpList.replace(op,styleMapInterpolate(op.expression.strings,op.expression.expressions,op.sourceSpan))}else{OpList.replace(op,styleMap(op.expression,op.sourceSpan))}break;case OpKind.ClassMap:if(op.expression instanceof Interpolation){OpList.replace(op,classMapInterpolate(op.expression.strings,op.expression.expressions,op.sourceSpan))}else{OpList.replace(op,classMap(op.expression,op.sourceSpan))}break;case OpKind.I18nExpression:OpList.replace(op,i18nExp(op.expression,op.sourceSpan));break;case OpKind.I18nApply:OpList.replace(op,i18nApply(op.handle.slot,op.sourceSpan));break;case OpKind.InterpolateText:OpList.replace(op,textInterpolate(op.interpolation.strings,op.interpolation.expressions,op.sourceSpan));break;case OpKind.Attribute:if(op.expression instanceof Interpolation){OpList.replace(op,attributeInterpolate(op.name,op.expression.strings,op.expression.expressions,op.sanitizer,op.sourceSpan))}else{OpList.replace(op,attribute(op.name,op.expression,op.sanitizer,op.namespace))}break;case OpKind.HostProperty:if(op.expression instanceof Interpolation){throw new Error("not yet handled")}else{if(op.isAnimationTrigger){OpList.replace(op,syntheticHostProperty(op.name,op.expression,op.sourceSpan))}else{OpList.replace(op,hostProperty(op.name,op.expression,op.sanitizer,op.sourceSpan))}}break;case OpKind.Variable:if(op.variable.name===null){throw new Error(`AssertionError: unnamed variable ${op.xref}`)}OpList.replace(op,createStatementOp(new DeclareVarStmt(op.variable.name,op.initializer,undefined,exports.StmtModifier.Final)));break;case OpKind.Conditional:if(op.processed===null){throw new Error(`Conditional test was not set.`)}if(op.targetSlot.slot===null){throw new Error(`Conditional slot was not set.`)}OpList.replace(op,conditional(op.targetSlot.slot,op.processed,op.contextValue,op.sourceSpan));break;case OpKind.Repeater:OpList.replace(op,repeater(op.collection,op.sourceSpan));break;case OpKind.DeferWhen:OpList.replace(op,deferWhen(op.prefetch,op.expr,op.sourceSpan));break;case OpKind.Statement:break;default:throw new Error(`AssertionError: Unsupported reification of update op ${OpKind[op.kind]}`)}}}function reifyIrExpression(expr){if(!isIrExpression(expr)){return expr}switch(expr.kind){case ExpressionKind.NextContext:return nextContext(expr.steps);case ExpressionKind.Reference:return reference(expr.targetSlot.slot+1+expr.offset);case ExpressionKind.LexicalRead:throw new Error(`AssertionError: unresolved LexicalRead of ${expr.name}`);case ExpressionKind.TwoWayBindingSet:throw new Error(`AssertionError: unresolved TwoWayBindingSet`);case ExpressionKind.RestoreView:if(typeof expr.view==="number"){throw new Error(`AssertionError: unresolved RestoreView`)}return restoreView(expr.view);case ExpressionKind.ResetView:return resetView(expr.expr);case ExpressionKind.GetCurrentView:return getCurrentView();case ExpressionKind.ReadVariable:if(expr.name===null){throw new Error(`Read of unnamed variable ${expr.xref}`)}return variable(expr.name);case ExpressionKind.ReadTemporaryExpr:if(expr.name===null){throw new Error(`Read of unnamed temporary ${expr.xref}`)}return variable(expr.name);case ExpressionKind.AssignTemporaryExpr:if(expr.name===null){throw new Error(`Assign of unnamed temporary ${expr.xref}`)}return variable(expr.name).set(expr.expr);case ExpressionKind.PureFunctionExpr:if(expr.fn===null){throw new Error(`AssertionError: expected PureFunctions to have been extracted`)}return pureFunction(expr.varOffset,expr.fn,expr.args);case ExpressionKind.PureFunctionParameterExpr:throw new Error(`AssertionError: expected PureFunctionParameterExpr to have been extracted`);case ExpressionKind.PipeBinding:return pipeBind(expr.targetSlot.slot,expr.varOffset,expr.args);case ExpressionKind.PipeBindingVariadic:return pipeBindV(expr.targetSlot.slot,expr.varOffset,expr.args);case ExpressionKind.SlotLiteralExpr:return literal(expr.slot.slot);default:throw new Error(`AssertionError: Unsupported reification of ir.Expression kind: ${ExpressionKind[expr.kind]}`)}}function reifyListenerHandler(unit,name,handlerOps,consumesDollarEvent){reifyUpdateOperations(unit,handlerOps);const handlerStmts=[];for(const op of handlerOps){if(op.kind!==OpKind.Statement){throw new Error(`AssertionError: expected reified statements, but found op ${OpKind[op.kind]}`)}handlerStmts.push(op.statement)}const params=[];if(consumesDollarEvent){params.push(new FnParam("$event"))}return fn(params,handlerStmts,undefined,undefined,name)}function removeEmptyBindings(job){for(const unit of job.units){for(const op of unit.update){switch(op.kind){case OpKind.Attribute:case OpKind.Binding:case OpKind.ClassProp:case OpKind.ClassMap:case OpKind.Property:case OpKind.StyleProp:case OpKind.StyleMap:if(op.expression instanceof EmptyExpr){OpList.remove(op)}break}}}}function removeI18nContexts(job){for(const unit of job.units){for(const op of unit.create){switch(op.kind){case OpKind.I18nContext:OpList.remove(op);break;case OpKind.I18nStart:op.context=null;break}}}}function removeUnusedI18nAttributesOps(job){for(const unit of job.units){const ownersWithI18nExpressions=new Set;for(const op of unit.update){switch(op.kind){case OpKind.I18nExpression:ownersWithI18nExpressions.add(op.i18nOwner)}}for(const op of unit.create){switch(op.kind){case OpKind.I18nAttributes:if(ownersWithI18nExpressions.has(op.xref)){continue}OpList.remove(op)}}}}function resolveContexts(job){for(const unit of job.units){processLexicalScope$1(unit,unit.create);processLexicalScope$1(unit,unit.update)}}function processLexicalScope$1(view,ops){const scope=new Map;scope.set(view.xref,variable("ctx"));for(const op of ops){switch(op.kind){case OpKind.Variable:switch(op.variable.kind){case SemanticVariableKind.Context:scope.set(op.variable.view,new ReadVariableExpr(op.xref));break}break;case OpKind.Listener:case OpKind.TwoWayListener:processLexicalScope$1(view,op.handlerOps);break}}if(view===view.job.root){scope.set(view.xref,variable("ctx"))}for(const op of ops){transformExpressionsInOp(op,(expr=>{if(expr instanceof ContextExpr){if(!scope.has(expr.view)){throw new Error(`No context found for reference to view ${expr.view} from view ${view.xref}`)}return scope.get(expr.view)}else{return expr}}),VisitorContextFlag.None)}}function resolveDollarEvent(job){for(const unit of job.units){transformDollarEvent(unit.create);transformDollarEvent(unit.update)}}function transformDollarEvent(ops){for(const op of ops){if(op.kind===OpKind.Listener||op.kind===OpKind.TwoWayListener){transformExpressionsInOp(op,(expr=>{if(expr instanceof LexicalReadExpr&&expr.name==="$event"){if(op.kind===OpKind.Listener){op.consumesDollarEvent=true}return new ReadVarExpr(expr.name)}return expr}),VisitorContextFlag.InChildOperation)}}}function resolveI18nElementPlaceholders(job){const i18nContexts=new Map;const elements=new Map;for(const unit of job.units){for(const op of unit.create){switch(op.kind){case OpKind.I18nContext:i18nContexts.set(op.xref,op);break;case OpKind.ElementStart:elements.set(op.xref,op);break}}}resolvePlaceholdersForView(job,job.root,i18nContexts,elements)}function resolvePlaceholdersForView(job,unit,i18nContexts,elements,pendingStructuralDirective){let currentOps=null;let pendingStructuralDirectiveCloses=new Map;for(const op of unit.create){switch(op.kind){case OpKind.I18nStart:if(!op.context){throw Error("Could not find i18n context for i18n op")}currentOps={i18nBlock:op,i18nContext:i18nContexts.get(op.context)};break;case OpKind.I18nEnd:currentOps=null;break;case OpKind.ElementStart:if(op.i18nPlaceholder!==undefined){if(currentOps===null){throw Error("i18n tag placeholder should only occur inside an i18n block")}recordElementStart(op,currentOps.i18nContext,currentOps.i18nBlock,pendingStructuralDirective);if(pendingStructuralDirective&&op.i18nPlaceholder.closeName){pendingStructuralDirectiveCloses.set(op.xref,pendingStructuralDirective)}pendingStructuralDirective=undefined}break;case OpKind.ElementEnd:const startOp=elements.get(op.xref);if(startOp&&startOp.i18nPlaceholder!==undefined){if(currentOps===null){throw Error("AssertionError: i18n tag placeholder should only occur inside an i18n block")}recordElementClose(startOp,currentOps.i18nContext,currentOps.i18nBlock,pendingStructuralDirectiveCloses.get(op.xref));pendingStructuralDirectiveCloses.delete(op.xref)}break;case OpKind.Projection:if(op.i18nPlaceholder!==undefined){if(currentOps===null){throw Error("i18n tag placeholder should only occur inside an i18n block")}recordElementStart(op,currentOps.i18nContext,currentOps.i18nBlock,pendingStructuralDirective);recordElementClose(op,currentOps.i18nContext,currentOps.i18nBlock,pendingStructuralDirective);pendingStructuralDirective=undefined}break;case OpKind.Template:const view=job.views.get(op.xref);if(op.i18nPlaceholder===undefined){resolvePlaceholdersForView(job,view,i18nContexts,elements)}else{if(currentOps===null){throw Error("i18n tag placeholder should only occur inside an i18n block")}if(op.templateKind===TemplateKind.Structural){resolvePlaceholdersForView(job,view,i18nContexts,elements,op)}else{recordTemplateStart(job,view,op.handle.slot,op.i18nPlaceholder,currentOps.i18nContext,currentOps.i18nBlock,pendingStructuralDirective);resolvePlaceholdersForView(job,view,i18nContexts,elements);recordTemplateClose(job,view,op.handle.slot,op.i18nPlaceholder,currentOps.i18nContext,currentOps.i18nBlock,pendingStructuralDirective);pendingStructuralDirective=undefined}}break;case OpKind.RepeaterCreate:if(pendingStructuralDirective!==undefined){throw Error("AssertionError: Unexpected structural directive associated with @for block")}const forSlot=op.handle.slot+1;const forView=job.views.get(op.xref);if(op.i18nPlaceholder===undefined){resolvePlaceholdersForView(job,forView,i18nContexts,elements)}else{if(currentOps===null){throw Error("i18n tag placeholder should only occur inside an i18n block")}recordTemplateStart(job,forView,forSlot,op.i18nPlaceholder,currentOps.i18nContext,currentOps.i18nBlock,pendingStructuralDirective);resolvePlaceholdersForView(job,forView,i18nContexts,elements);recordTemplateClose(job,forView,forSlot,op.i18nPlaceholder,currentOps.i18nContext,currentOps.i18nBlock,pendingStructuralDirective);pendingStructuralDirective=undefined}if(op.emptyView!==null){const emptySlot=op.handle.slot+2;const emptyView=job.views.get(op.emptyView);if(op.emptyI18nPlaceholder===undefined){resolvePlaceholdersForView(job,emptyView,i18nContexts,elements)}else{if(currentOps===null){throw Error("i18n tag placeholder should only occur inside an i18n block")}recordTemplateStart(job,emptyView,emptySlot,op.emptyI18nPlaceholder,currentOps.i18nContext,currentOps.i18nBlock,pendingStructuralDirective);resolvePlaceholdersForView(job,emptyView,i18nContexts,elements);recordTemplateClose(job,emptyView,emptySlot,op.emptyI18nPlaceholder,currentOps.i18nContext,currentOps.i18nBlock,pendingStructuralDirective);pendingStructuralDirective=undefined}}break}}}function recordElementStart(op,i18nContext,i18nBlock,structuralDirective){const{startName:startName,closeName:closeName}=op.i18nPlaceholder;let flags=I18nParamValueFlags.ElementTag|I18nParamValueFlags.OpenTag;let value=op.handle.slot;if(structuralDirective!==undefined){flags|=I18nParamValueFlags.TemplateTag;value={element:value,template:structuralDirective.handle.slot}}if(!closeName){flags|=I18nParamValueFlags.CloseTag}addParam(i18nContext.params,startName,value,i18nBlock.subTemplateIndex,flags)}function recordElementClose(op,i18nContext,i18nBlock,structuralDirective){const{closeName:closeName}=op.i18nPlaceholder;if(closeName){let flags=I18nParamValueFlags.ElementTag|I18nParamValueFlags.CloseTag;let value=op.handle.slot;if(structuralDirective!==undefined){flags|=I18nParamValueFlags.TemplateTag;value={element:value,template:structuralDirective.handle.slot}}addParam(i18nContext.params,closeName,value,i18nBlock.subTemplateIndex,flags)}}function recordTemplateStart(job,view,slot,i18nPlaceholder,i18nContext,i18nBlock,structuralDirective){let{startName:startName,closeName:closeName}=i18nPlaceholder;let flags=I18nParamValueFlags.TemplateTag|I18nParamValueFlags.OpenTag;if(!closeName){flags|=I18nParamValueFlags.CloseTag}if(structuralDirective!==undefined){addParam(i18nContext.params,startName,structuralDirective.handle.slot,i18nBlock.subTemplateIndex,flags)}addParam(i18nContext.params,startName,slot,getSubTemplateIndexForTemplateTag(job,i18nBlock,view),flags)}function recordTemplateClose(job,view,slot,i18nPlaceholder,i18nContext,i18nBlock,structuralDirective){const{closeName:closeName}=i18nPlaceholder;const flags=I18nParamValueFlags.TemplateTag|I18nParamValueFlags.CloseTag;if(closeName){addParam(i18nContext.params,closeName,slot,getSubTemplateIndexForTemplateTag(job,i18nBlock,view),flags);if(structuralDirective!==undefined){addParam(i18nContext.params,closeName,structuralDirective.handle.slot,i18nBlock.subTemplateIndex,flags)}}}function getSubTemplateIndexForTemplateTag(job,i18nOp,view){for(const childOp of view.create){if(childOp.kind===OpKind.I18nStart){return childOp.subTemplateIndex}}return i18nOp.subTemplateIndex}function addParam(params,placeholder,value,subTemplateIndex,flags){const values=params.get(placeholder)??[];values.push({value:value,subTemplateIndex:subTemplateIndex,flags:flags});params.set(placeholder,values)}function resolveI18nExpressionPlaceholders(job){const subTemplateIndices=new Map;const i18nContexts=new Map;const icuPlaceholders=new Map;for(const unit of job.units){for(const op of unit.create){switch(op.kind){case OpKind.I18nStart:subTemplateIndices.set(op.xref,op.subTemplateIndex);break;case OpKind.I18nContext:i18nContexts.set(op.xref,op);break;case OpKind.IcuPlaceholder:icuPlaceholders.set(op.xref,op);break}}}const expressionIndices=new Map;const referenceIndex=op=>op.usage===I18nExpressionFor.I18nText?op.i18nOwner:op.context;for(const unit of job.units){for(const op of unit.update){if(op.kind===OpKind.I18nExpression){const index=expressionIndices.get(referenceIndex(op))||0;const subTemplateIndex=subTemplateIndices.get(op.i18nOwner)??null;const value={value:index,subTemplateIndex:subTemplateIndex,flags:I18nParamValueFlags.ExpressionIndex};updatePlaceholder(op,value,i18nContexts,icuPlaceholders);expressionIndices.set(referenceIndex(op),index+1)}}}}function updatePlaceholder(op,value,i18nContexts,icuPlaceholders){if(op.i18nPlaceholder!==null){const i18nContext=i18nContexts.get(op.context);const params=op.resolutionTime===I18nParamResolutionTime.Creation?i18nContext.params:i18nContext.postprocessingParams;const values=params.get(op.i18nPlaceholder)||[];values.push(value);params.set(op.i18nPlaceholder,values)}if(op.icuPlaceholder!==null){const icuPlaceholderOp=icuPlaceholders.get(op.icuPlaceholder);icuPlaceholderOp?.expressionPlaceholders.push(value)}}function resolveNames(job){for(const unit of job.units){processLexicalScope(unit,unit.create,null);processLexicalScope(unit,unit.update,null)}}function processLexicalScope(unit,ops,savedView){const scope=new Map;for(const op of ops){switch(op.kind){case OpKind.Variable:switch(op.variable.kind){case SemanticVariableKind.Identifier:case SemanticVariableKind.Alias:if(scope.has(op.variable.identifier)){continue}scope.set(op.variable.identifier,op.xref);break;case SemanticVariableKind.SavedView:savedView={view:op.variable.view,variable:op.xref};break}break;case OpKind.Listener:case OpKind.TwoWayListener:processLexicalScope(unit,op.handlerOps,savedView);break}}for(const op of ops){if(op.kind==OpKind.Listener||op.kind===OpKind.TwoWayListener){continue}transformExpressionsInOp(op,(expr=>{if(expr instanceof LexicalReadExpr){if(scope.has(expr.name)){return new ReadVariableExpr(scope.get(expr.name))}else{return new ReadPropExpr(new ContextExpr(unit.job.root.xref),expr.name)}}else if(expr instanceof RestoreViewExpr&&typeof expr.view==="number"){if(savedView===null||savedView.view!==expr.view){throw new Error(`AssertionError: no saved view ${expr.view} from view ${unit.xref}`)}expr.view=new ReadVariableExpr(savedView.variable);return expr}else{return expr}}),VisitorContextFlag.None)}for(const op of ops){visitExpressionsInOp(op,(expr=>{if(expr instanceof LexicalReadExpr){throw new Error(`AssertionError: no lexical reads should remain, but found read of ${expr.name}`)}}))}}const sanitizerFns=new Map([[SecurityContext.HTML,Identifiers.sanitizeHtml],[SecurityContext.RESOURCE_URL,Identifiers.sanitizeResourceUrl],[SecurityContext.SCRIPT,Identifiers.sanitizeScript],[SecurityContext.STYLE,Identifiers.sanitizeStyle],[SecurityContext.URL,Identifiers.sanitizeUrl]]);const trustedValueFns=new Map([[SecurityContext.HTML,Identifiers.trustConstantHtml],[SecurityContext.RESOURCE_URL,Identifiers.trustConstantResourceUrl]]);function resolveSanitizers(job){for(const unit of job.units){const elements=createOpXrefMap(unit);if(job.kind!==CompilationJobKind.Host){for(const op of unit.create){if(op.kind===OpKind.ExtractedAttribute){const trustedValueFn=trustedValueFns.get(getOnlySecurityContext(op.securityContext))??null;op.trustedValueFn=trustedValueFn!==null?importExpr(trustedValueFn):null}}}for(const op of unit.update){switch(op.kind){case OpKind.Property:case OpKind.Attribute:case OpKind.HostProperty:let sanitizerFn=null;if(Array.isArray(op.securityContext)&&op.securityContext.length===2&&op.securityContext.indexOf(SecurityContext.URL)>-1&&op.securityContext.indexOf(SecurityContext.RESOURCE_URL)>-1){sanitizerFn=Identifiers.sanitizeUrlOrResourceUrl}else{sanitizerFn=sanitizerFns.get(getOnlySecurityContext(op.securityContext))??null}op.sanitizer=sanitizerFn!==null?importExpr(sanitizerFn):null;if(op.sanitizer===null){let isIframe=false;if(job.kind===CompilationJobKind.Host||op.kind===OpKind.HostProperty){isIframe=true}else{const ownerOp=elements.get(op.target);if(ownerOp===undefined||!isElementOrContainerOp(ownerOp)){throw Error("Property should have an element-like owner")}isIframe=isIframeElement$1(ownerOp)}if(isIframe&&isIframeSecuritySensitiveAttr(op.name)){op.sanitizer=importExpr(Identifiers.validateIframeAttribute)}}break}}}}function isIframeElement$1(op){return op.kind===OpKind.ElementStart&&op.tag?.toLowerCase()==="iframe"}function getOnlySecurityContext(securityContext){if(Array.isArray(securityContext)){if(securityContext.length>1){throw Error(`AssertionError: Ambiguous security context`)}return securityContext[0]||SecurityContext.NONE}return securityContext}function transformTwoWayBindingSet(job){for(const unit of job.units){for(const op of unit.create){if(op.kind===OpKind.TwoWayListener){transformExpressionsInOp(op,(expr=>{if(expr instanceof TwoWayBindingSetExpr){return wrapAction(expr.target,expr.value)}return expr}),VisitorContextFlag.InChildOperation)}}}}function wrapSetOperation(target,value){if(target instanceof ReadVariableExpr){return twoWayBindingSet(target,value)}return twoWayBindingSet(target,value).or(target.set(value))}function isReadExpression(value){return value instanceof ReadPropExpr||value instanceof ReadKeyExpr||value instanceof ReadVariableExpr}function wrapAction(target,value){if(isReadExpression(target)){return wrapSetOperation(target,value)}if(target instanceof BinaryOperatorExpr&&isReadExpression(target.rhs)){return new BinaryOperatorExpr(target.operator,target.lhs,wrapSetOperation(target.rhs,value))}if(target instanceof ConditionalExpr&&isReadExpression(target.falseCase)){return new ConditionalExpr(target.condition,target.trueCase,wrapSetOperation(target.falseCase,value))}if(target instanceof NotExpr){let expr=target.condition;while(true){if(expr instanceof NotExpr){expr=expr.condition}else{if(isReadExpression(expr)){return wrapSetOperation(expr,value)}break}}}throw new Error(`Unsupported expression in two-way action binding.`)}function saveAndRestoreView(job){for(const unit of job.units){unit.create.prepend([createVariableOp(unit.job.allocateXrefId(),{kind:SemanticVariableKind.SavedView,name:null,view:unit.xref},new GetCurrentViewExpr,VariableFlags.None)]);for(const op of unit.create){if(op.kind!==OpKind.Listener&&op.kind!==OpKind.TwoWayListener){continue}let needsRestoreView=unit!==job.root;if(!needsRestoreView){for(const handlerOp of op.handlerOps){visitExpressionsInOp(handlerOp,(expr=>{if(expr instanceof ReferenceExpr){needsRestoreView=true}}))}}if(needsRestoreView){addSaveRestoreViewOperationToListener(unit,op)}}}}function addSaveRestoreViewOperationToListener(unit,op){op.handlerOps.prepend([createVariableOp(unit.job.allocateXrefId(),{kind:SemanticVariableKind.Context,name:null,view:unit.xref},new RestoreViewExpr(unit.xref),VariableFlags.None)]);for(const handlerOp of op.handlerOps){if(handlerOp.kind===OpKind.Statement&&handlerOp.statement instanceof ReturnStatement){handlerOp.statement.value=new ResetViewExpr(handlerOp.statement.value)}}}function allocateSlots(job){const slotMap=new Map;for(const unit of job.units){let slotCount=0;for(const op of unit.create){if(!hasConsumesSlotTrait(op)){continue}op.handle.slot=slotCount;slotMap.set(op.xref,op.handle.slot);slotCount+=op.numSlotsUsed}unit.decls=slotCount}for(const unit of job.units){for(const op of unit.ops()){if(op.kind===OpKind.Template||op.kind===OpKind.RepeaterCreate){const childView=job.views.get(op.xref);op.decls=childView.decls}}}}function specializeStyleBindings(job){for(const unit of job.units){for(const op of unit.update){if(op.kind!==OpKind.Binding){continue}switch(op.bindingKind){case BindingKind.ClassName:if(op.expression instanceof Interpolation){throw new Error(`Unexpected interpolation in ClassName binding`)}OpList.replace(op,createClassPropOp(op.target,op.name,op.expression,op.sourceSpan));break;case BindingKind.StyleProperty:OpList.replace(op,createStylePropOp(op.target,op.name,op.expression,op.unit,op.sourceSpan));break;case BindingKind.Property:case BindingKind.Template:if(op.name==="style"){OpList.replace(op,createStyleMapOp(op.target,op.expression,op.sourceSpan))}else if(op.name==="class"){OpList.replace(op,createClassMapOp(op.target,op.expression,op.sourceSpan))}break}}}}function generateTemporaryVariables(job){for(const unit of job.units){unit.create.prepend(generateTemporaries(unit.create));unit.update.prepend(generateTemporaries(unit.update))}}function generateTemporaries(ops){let opCount=0;let generatedStatements=[];for(const op of ops){const finalReads=new Map;visitExpressionsInOp(op,((expr,flag)=>{if(flag&VisitorContextFlag.InChildOperation){return}if(expr instanceof ReadTemporaryExpr){finalReads.set(expr.xref,expr)}}));let count=0;const assigned=new Set;const released=new Set;const defs=new Map;visitExpressionsInOp(op,((expr,flag)=>{if(flag&VisitorContextFlag.InChildOperation){return}if(expr instanceof AssignTemporaryExpr){if(!assigned.has(expr.xref)){assigned.add(expr.xref);defs.set(expr.xref,`tmp_${opCount}_${count++}`)}assignName(defs,expr)}else if(expr instanceof ReadTemporaryExpr){if(finalReads.get(expr.xref)===expr){released.add(expr.xref);count--}assignName(defs,expr)}}));generatedStatements.push(...Array.from(new Set(defs.values())).map((name=>createStatementOp(new DeclareVarStmt(name)))));opCount++;if(op.kind===OpKind.Listener||op.kind===OpKind.TwoWayListener){op.handlerOps.prepend(generateTemporaries(op.handlerOps))}}return generatedStatements}function assignName(names,expr){const name=names.get(expr.xref);if(name===undefined){throw new Error(`Found xref with unassigned name: ${expr.xref}`)}expr.name=name}function generateTrackFns(job){for(const unit of job.units){for(const op of unit.create){if(op.kind!==OpKind.RepeaterCreate){continue}if(op.trackByFn!==null){continue}let usesComponentContext=false;op.track=transformExpressionsInExpression(op.track,(expr=>{if(expr instanceof PipeBindingExpr||expr instanceof PipeBindingVariadicExpr){throw new Error(`Illegal State: Pipes are not allowed in this context`)}if(expr instanceof TrackContextExpr){usesComponentContext=true;return variable("this")}return expr}),VisitorContextFlag.None);let fn;const fnParams=[new FnParam("$index"),new FnParam("$item")];if(usesComponentContext){fn=new FunctionExpr(fnParams,[new ReturnStatement(op.track)])}else{fn=arrowFn(fnParams,op.track)}op.trackByFn=job.pool.getSharedFunctionReference(fn,"_forTrack")}}}function optimizeTrackFns(job){for(const unit of job.units){for(const op of unit.create){if(op.kind!==OpKind.RepeaterCreate){continue}if(op.track instanceof ReadVarExpr&&op.track.name==="$index"){op.trackByFn=importExpr(Identifiers.repeaterTrackByIndex)}else if(op.track instanceof ReadVarExpr&&op.track.name==="$item"){op.trackByFn=importExpr(Identifiers.repeaterTrackByIdentity)}else if(isTrackByFunctionCall(job.root.xref,op.track)){op.usesComponentInstance=true;if(op.track.receiver.receiver.view===unit.xref){op.trackByFn=op.track.receiver}else{op.trackByFn=importExpr(Identifiers.componentInstance).callFn([]).prop(op.track.receiver.name);op.track=op.trackByFn}}else{op.track=transformExpressionsInExpression(op.track,(expr=>{if(expr instanceof ContextExpr){op.usesComponentInstance=true;return new TrackContextExpr(expr.view)}return expr}),VisitorContextFlag.None)}}}}function isTrackByFunctionCall(rootView,expr){if(!(expr instanceof InvokeFunctionExpr)||expr.args.length!==2){return false}if(!(expr.receiver instanceof ReadPropExpr&&expr.receiver.receiver instanceof ContextExpr)||expr.receiver.receiver.view!==rootView){return false}const[arg0,arg1]=expr.args;if(!(arg0 instanceof ReadVarExpr)||arg0.name!=="$index"){return false}if(!(arg1 instanceof ReadVarExpr)||arg1.name!=="$item"){return false}return true}function generateTrackVariables(job){for(const unit of job.units){for(const op of unit.create){if(op.kind!==OpKind.RepeaterCreate){continue}op.track=transformExpressionsInExpression(op.track,(expr=>{if(expr instanceof LexicalReadExpr){if(expr.name===op.varNames.$index){return variable("$index")}else if(expr.name===op.varNames.$implicit){return variable("$item")}}return expr}),VisitorContextFlag.None)}}}function countVariables(job){for(const unit of job.units){let varCount=0;for(const op of unit.ops()){if(hasConsumesVarsTrait(op)){varCount+=varsUsedByOp(op)}}for(const op of unit.ops()){visitExpressionsInOp(op,(expr=>{if(!isIrExpression(expr)){return}if(job.compatibility===CompatibilityMode.TemplateDefinitionBuilder&&expr instanceof PureFunctionExpr){return}if(hasUsesVarOffsetTrait(expr)){expr.varOffset=varCount}if(hasConsumesVarsTrait(expr)){varCount+=varsUsedByIrExpression(expr)}}))}if(job.compatibility===CompatibilityMode.TemplateDefinitionBuilder){for(const op of unit.ops()){visitExpressionsInOp(op,(expr=>{if(!isIrExpression(expr)||!(expr instanceof PureFunctionExpr)){return}if(hasUsesVarOffsetTrait(expr)){expr.varOffset=varCount}if(hasConsumesVarsTrait(expr)){varCount+=varsUsedByIrExpression(expr)}}))}}unit.vars=varCount}if(job instanceof ComponentCompilationJob){for(const unit of job.units){for(const op of unit.create){if(op.kind!==OpKind.Template&&op.kind!==OpKind.RepeaterCreate){continue}const childView=job.views.get(op.xref);op.vars=childView.vars}}}}function varsUsedByOp(op){let slots;switch(op.kind){case OpKind.Property:case OpKind.HostProperty:case OpKind.Attribute:slots=1;if(op.expression instanceof Interpolation&&!isSingletonInterpolation(op.expression)){slots+=op.expression.expressions.length}return slots;case OpKind.TwoWayProperty:return 1;case OpKind.StyleProp:case OpKind.ClassProp:case OpKind.StyleMap:case OpKind.ClassMap:slots=2;if(op.expression instanceof Interpolation){slots+=op.expression.expressions.length}return slots;case OpKind.InterpolateText:return op.interpolation.expressions.length;case OpKind.I18nExpression:case OpKind.Conditional:case OpKind.DeferWhen:return 1;case OpKind.RepeaterCreate:return op.emptyView?1:0;default:throw new Error(`Unhandled op: ${OpKind[op.kind]}`)}}function varsUsedByIrExpression(expr){switch(expr.kind){case ExpressionKind.PureFunctionExpr:return 1+expr.args.length;case ExpressionKind.PipeBinding:return 1+expr.args.length;case ExpressionKind.PipeBindingVariadic:return 1+expr.numArgs;default:throw new Error(`AssertionError: unhandled ConsumesVarsTrait expression ${expr.constructor.name}`)}}function isSingletonInterpolation(expr){if(expr.expressions.length!==1||expr.strings.length!==2){return false}if(expr.strings[0]!==""||expr.strings[1]!==""){return false}return true}function optimizeVariables(job){for(const unit of job.units){inlineAlwaysInlineVariables(unit.create);inlineAlwaysInlineVariables(unit.update);for(const op of unit.create){if(op.kind===OpKind.Listener||op.kind===OpKind.TwoWayListener){inlineAlwaysInlineVariables(op.handlerOps)}}optimizeVariablesInOpList(unit.create,job.compatibility);optimizeVariablesInOpList(unit.update,job.compatibility);for(const op of unit.create){if(op.kind===OpKind.Listener||op.kind===OpKind.TwoWayListener){optimizeVariablesInOpList(op.handlerOps,job.compatibility)}}}}var Fence;(function(Fence){Fence[Fence["None"]=0]="None";Fence[Fence["ViewContextRead"]=1]="ViewContextRead";Fence[Fence["ViewContextWrite"]=2]="ViewContextWrite";Fence[Fence["SideEffectful"]=4]="SideEffectful"})(Fence||(Fence={}));function inlineAlwaysInlineVariables(ops){const vars=new Map;for(const op of ops){if(op.kind===OpKind.Variable&&op.flags&VariableFlags.AlwaysInline){visitExpressionsInOp(op,(expr=>{if(isIrExpression(expr)&&fencesForIrExpression(expr)!==Fence.None){throw new Error(`AssertionError: A context-sensitive variable was marked AlwaysInline`)}}));vars.set(op.xref,op)}transformExpressionsInOp(op,(expr=>{if(expr instanceof ReadVariableExpr&&vars.has(expr.xref)){const varOp=vars.get(expr.xref);return varOp.initializer.clone()}return expr}),VisitorContextFlag.None)}for(const op of vars.values()){OpList.remove(op)}}function optimizeVariablesInOpList(ops,compatibility){const varDecls=new Map;const varUsages=new Map;const varRemoteUsages=new Set;const opMap=new Map;for(const op of ops){if(op.kind===OpKind.Variable){if(varDecls.has(op.xref)||varUsages.has(op.xref)){throw new Error(`Should not see two declarations of the same variable: ${op.xref}`)}varDecls.set(op.xref,op);varUsages.set(op.xref,0)}opMap.set(op,collectOpInfo(op));countVariableUsages(op,varUsages,varRemoteUsages)}let contextIsUsed=false;for(const op of ops.reversed()){const opInfo=opMap.get(op);if(op.kind===OpKind.Variable&&varUsages.get(op.xref)===0){if(contextIsUsed&&opInfo.fences&Fence.ViewContextWrite||opInfo.fences&Fence.SideEffectful){const stmtOp=createStatementOp(op.initializer.toStmt());opMap.set(stmtOp,opInfo);OpList.replace(op,stmtOp)}else{uncountVariableUsages(op,varUsages);OpList.remove(op)}opMap.delete(op);varDecls.delete(op.xref);varUsages.delete(op.xref);continue}if(opInfo.fences&Fence.ViewContextRead){contextIsUsed=true}}const toInline=[];for(const[id,count]of varUsages){const decl=varDecls.get(id);const isAlwaysInline=!!(decl.flags&VariableFlags.AlwaysInline);if(count!==1||isAlwaysInline){continue}if(varRemoteUsages.has(id)){continue}toInline.push(id)}let candidate;while(candidate=toInline.pop()){const decl=varDecls.get(candidate);const varInfo=opMap.get(decl);const isAlwaysInline=!!(decl.flags&VariableFlags.AlwaysInline);if(isAlwaysInline){throw new Error(`AssertionError: Found an 'AlwaysInline' variable after the always inlining pass.`)}for(let targetOp=decl.next;targetOp.kind!==OpKind.ListEnd;targetOp=targetOp.next){const opInfo=opMap.get(targetOp);if(opInfo.variablesUsed.has(candidate)){if(compatibility===CompatibilityMode.TemplateDefinitionBuilder&&!allowConservativeInlining(decl,targetOp)){break}if(tryInlineVariableInitializer(candidate,decl.initializer,targetOp,varInfo.fences)){opInfo.variablesUsed.delete(candidate);for(const id of varInfo.variablesUsed){opInfo.variablesUsed.add(id)}opInfo.fences|=varInfo.fences;varDecls.delete(candidate);varUsages.delete(candidate);opMap.delete(decl);OpList.remove(decl)}break}if(!safeToInlinePastFences(opInfo.fences,varInfo.fences)){break}}}}function fencesForIrExpression(expr){switch(expr.kind){case ExpressionKind.NextContext:return Fence.ViewContextRead|Fence.ViewContextWrite;case ExpressionKind.RestoreView:return Fence.ViewContextRead|Fence.ViewContextWrite|Fence.SideEffectful;case ExpressionKind.Reference:return Fence.ViewContextRead;default:return Fence.None}}function collectOpInfo(op){let fences=Fence.None;const variablesUsed=new Set;visitExpressionsInOp(op,(expr=>{if(!isIrExpression(expr)){return}switch(expr.kind){case ExpressionKind.ReadVariable:variablesUsed.add(expr.xref);break;default:fences|=fencesForIrExpression(expr)}}));return{fences:fences,variablesUsed:variablesUsed}}function countVariableUsages(op,varUsages,varRemoteUsage){visitExpressionsInOp(op,((expr,flags)=>{if(!isIrExpression(expr)){return}if(expr.kind!==ExpressionKind.ReadVariable){return}const count=varUsages.get(expr.xref);if(count===undefined){return}varUsages.set(expr.xref,count+1);if(flags&VisitorContextFlag.InChildOperation){varRemoteUsage.add(expr.xref)}}))}function uncountVariableUsages(op,varUsages){visitExpressionsInOp(op,(expr=>{if(!isIrExpression(expr)){return}if(expr.kind!==ExpressionKind.ReadVariable){return}const count=varUsages.get(expr.xref);if(count===undefined){return}else if(count===0){throw new Error(`Inaccurate variable count: ${expr.xref} - found another read but count is already 0`)}varUsages.set(expr.xref,count-1)}))}function safeToInlinePastFences(fences,declFences){if(fences&Fence.ViewContextWrite){if(declFences&Fence.ViewContextRead){return false}}else if(fences&Fence.ViewContextRead){if(declFences&Fence.ViewContextWrite){return false}}return true}function tryInlineVariableInitializer(id,initializer,target,declFences){let inlined=false;let inliningAllowed=true;transformExpressionsInOp(target,((expr,flags)=>{if(!isIrExpression(expr)){return expr}if(inlined||!inliningAllowed){return expr}else if(flags&VisitorContextFlag.InChildOperation&&declFences&Fence.ViewContextRead){return expr}switch(expr.kind){case ExpressionKind.ReadVariable:if(expr.xref===id){inlined=true;return initializer}break;default:const exprFences=fencesForIrExpression(expr);inliningAllowed=inliningAllowed&&safeToInlinePastFences(exprFences,declFences);break}return expr}),VisitorContextFlag.None);return inlined}function allowConservativeInlining(decl,target){switch(decl.variable.kind){case SemanticVariableKind.Identifier:if(decl.initializer instanceof ReadVarExpr&&decl.initializer.name==="ctx"){return true}return false;case SemanticVariableKind.Context:return target.kind===OpKind.Variable;default:return true}}function wrapI18nIcus(job){for(const unit of job.units){let currentI18nOp=null;let addedI18nId=null;for(const op of unit.create){switch(op.kind){case OpKind.I18nStart:currentI18nOp=op;break;case OpKind.I18nEnd:currentI18nOp=null;break;case OpKind.IcuStart:if(currentI18nOp===null){addedI18nId=job.allocateXrefId();OpList.insertBefore(createI18nStartOp(addedI18nId,op.message,undefined,null),op)}break;case OpKind.IcuEnd:if(addedI18nId!==null){OpList.insertAfter(createI18nEndOp(addedI18nId,null),op);addedI18nId=null}break}}}}
|
|
439
439
|
/**
|
|
440
440
|
*
|
|
441
441
|
* @license
|
|
@@ -460,7 +460,7 @@
|
|
|
460
460
|
*
|
|
461
461
|
* Use of this source code is governed by an MIT-style license that can be
|
|
462
462
|
* found in the LICENSE file at https://angular.io/license
|
|
463
|
-
*/class HostAttributeToken{constructor(attributeName){this.attributeName=attributeName;this.__NG_ELEMENT_ID__=()=>\u0275\u0275injectAttribute(this.attributeName)}toString(){return`HostAttributeToken ${this.attributeName}`}}const ERROR_ORIGINAL_ERROR="ngOriginalError";function getOriginalError(error){return error[ERROR_ORIGINAL_ERROR]}class ErrorHandler{constructor(){this._console=console}handleError(error){const originalError=this._findOriginalError(error);this._console.error("ERROR",error);if(originalError){this._console.error("ORIGINAL ERROR",originalError)}}_findOriginalError(error){let e=error&&getOriginalError(error);while(e&&getOriginalError(e)){e=getOriginalError(e)}return e||null}}const INTERNAL_APPLICATION_ERROR_HANDLER=new InjectionToken(typeof ngDevMode==="undefined"||ngDevMode?"internal error handler":"",{providedIn:"root",factory:()=>{const userErrorHandler=inject(ErrorHandler);return userErrorHandler.handleError.bind(undefined)}});class DestroyRef{static{this.__NG_ELEMENT_ID__=injectDestroyRef}static{this.__NG_ENV_ID__=injector=>injector}}class NodeInjectorDestroyRef extends DestroyRef{constructor(_lView){super();this._lView=_lView}onDestroy(callback){storeLViewOnDestroy(this._lView,callback);return()=>removeLViewOnDestroy(this._lView,callback)}}function injectDestroyRef(){return new NodeInjectorDestroyRef(getLView())}class OutputEmitterRef{constructor(){this.destroyed=false;this.listeners=null;this.errorHandler=inject(ErrorHandler,{optional:true});this.destroyRef=inject(DestroyRef);this.destroyRef.onDestroy((()=>{this.destroyed=true;this.listeners=null}))}subscribe(callback){if(this.destroyed){throw new RuntimeError(953,ngDevMode&&"Unexpected subscription to destroyed `OutputRef`. "+"The owning directive/component is destroyed.")}(this.listeners??=[]).push(callback);return{unsubscribe:()=>{const idx=this.listeners?.indexOf(callback);if(idx!==undefined&&idx!==-1){this.listeners?.splice(idx,1)}}}}emit(value){if(this.destroyed){throw new RuntimeError(953,ngDevMode&&"Unexpected emit for destroyed `OutputRef`. "+"The owning directive/component is destroyed.")}if(this.listeners===null){return}const previousConsumer=signals.setActiveConsumer(null);try{for(const listenerFn of this.listeners){try{listenerFn(value)}catch(err){this.errorHandler?.handleError(err)}}}finally{signals.setActiveConsumer(previousConsumer)}}}function getOutputDestroyRef(ref){return ref.destroyRef}function output(opts){ngDevMode&&assertInInjectionContext(output);return new OutputEmitterRef}function inputFunction(initialValue,opts){ngDevMode&&assertInInjectionContext(input);return createInputSignal(initialValue,opts)}function inputRequiredFunction(opts){ngDevMode&&assertInInjectionContext(input);return createInputSignal(REQUIRED_UNSET_VALUE,opts)}const input=(()=>{inputFunction.required=inputRequiredFunction;return inputFunction})();function injectElementRef(){return createElementRef(getCurrentTNode(),getLView())}function createElementRef(tNode,lView){return new ElementRef(getNativeByTNode(tNode,lView))}class ElementRef{constructor(nativeElement){this.nativeElement=nativeElement}static{this.__NG_ELEMENT_ID__=injectElementRef}}function unwrapElementRef(value){return value instanceof ElementRef?value.nativeElement:value}class EventEmitter_ extends rxjs.Subject{constructor(isAsync=false){super();this.destroyRef=undefined;this.__isAsync=isAsync;if(isInInjectionContext()){this.destroyRef=inject(DestroyRef,{optional:true})??undefined}}emit(value){const prevConsumer=signals.setActiveConsumer(null);try{super.next(value)}finally{signals.setActiveConsumer(prevConsumer)}}subscribe(observerOrNext,error,complete){let nextFn=observerOrNext;let errorFn=error||(()=>null);let completeFn=complete;if(observerOrNext&&typeof observerOrNext==="object"){const observer=observerOrNext;nextFn=observer.next?.bind(observer);errorFn=observer.error?.bind(observer);completeFn=observer.complete?.bind(observer)}if(this.__isAsync){errorFn=_wrapInTimeout(errorFn);if(nextFn){nextFn=_wrapInTimeout(nextFn)}if(completeFn){completeFn=_wrapInTimeout(completeFn)}}const sink=super.subscribe({next:nextFn,error:errorFn,complete:completeFn});if(observerOrNext instanceof rxjs.Subscription){observerOrNext.add(sink)}return sink}}function _wrapInTimeout(fn){return value=>{setTimeout(fn,undefined,value)}}const EventEmitter=EventEmitter_;function symbolIterator(){return this._results[Symbol.iterator]()}class QueryList{static{}get changes(){return this._changes??=new EventEmitter}constructor(_emitDistinctChangesOnly=false){this._emitDistinctChangesOnly=_emitDistinctChangesOnly;this.dirty=true;this._onDirty=undefined;this._results=[];this._changesDetected=false;this._changes=undefined;this.length=0;this.first=undefined;this.last=undefined;const proto=QueryList.prototype;if(!proto[Symbol.iterator])proto[Symbol.iterator]=symbolIterator}get(index){return this._results[index]}map(fn){return this._results.map(fn)}filter(fn){return this._results.filter(fn)}find(fn){return this._results.find(fn)}reduce(fn,init){return this._results.reduce(fn,init)}forEach(fn){this._results.forEach(fn)}some(fn){return this._results.some(fn)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(resultsTree,identityAccessor){this.dirty=false;const newResultFlat=flatten(resultsTree);if(this._changesDetected=!arrayEquals(this._results,newResultFlat,identityAccessor)){this._results=newResultFlat;this.length=newResultFlat.length;this.last=newResultFlat[this.length-1];this.first=newResultFlat[0]}}notifyOnChanges(){if(this._changes!==undefined&&(this._changesDetected||!this._emitDistinctChangesOnly))this._changes.emit(this)}onDirty(cb){this._onDirty=cb}setDirty(){this.dirty=true;this._onDirty?.()}destroy(){if(this._changes!==undefined){this._changes.complete();this._changes.unsubscribe()}}}const SKIP_HYDRATION_ATTR_NAME="ngSkipHydration";const SKIP_HYDRATION_ATTR_NAME_LOWER_CASE="ngskiphydration";function hasSkipHydrationAttrOnTNode(tNode){const attrs=tNode.mergedAttrs;if(attrs===null)return false;for(let i=0;i<attrs.length;i+=2){const value=attrs[i];if(typeof value==="number")return false;if(typeof value==="string"&&value.toLowerCase()===SKIP_HYDRATION_ATTR_NAME_LOWER_CASE){return true}}return false}function hasSkipHydrationAttrOnRElement(rNode){return rNode.hasAttribute(SKIP_HYDRATION_ATTR_NAME)}function hasInSkipHydrationBlockFlag(tNode){return(tNode.flags&128)===128}function isInSkipHydrationBlock(tNode){if(hasInSkipHydrationBlockFlag(tNode)){return true}let currentTNode=tNode.parent;while(currentTNode){if(hasInSkipHydrationBlockFlag(tNode)||hasSkipHydrationAttrOnTNode(currentTNode)){return true}currentTNode=currentTNode.parent}return false}const TRACKED_LVIEWS=new Map;let uniqueIdCounter=0;function getUniqueLViewId(){return uniqueIdCounter++}function registerLView(lView){ngDevMode&&assertNumber(lView[ID],"LView must have an ID in order to be registered");TRACKED_LVIEWS.set(lView[ID],lView)}function getLViewById(id){ngDevMode&&assertNumber(id,"ID used for LView lookup must be a number");return TRACKED_LVIEWS.get(id)||null}function unregisterLView(lView){ngDevMode&&assertNumber(lView[ID],"Cannot stop tracking an LView that does not have an ID");TRACKED_LVIEWS.delete(lView[ID])}class LContext{get lView(){return getLViewById(this.lViewId)}constructor(lViewId,nodeIndex,native){this.lViewId=lViewId;this.nodeIndex=nodeIndex;this.native=native}}function getLContext(target){let mpValue=readPatchedData(target);if(mpValue){if(isLView(mpValue)){const lView=mpValue;let nodeIndex;let component=undefined;let directives=undefined;if(isComponentInstance(target)){nodeIndex=findViaComponent(lView,target);if(nodeIndex==-1){throw new Error("The provided component was not found in the application")}component=target}else if(isDirectiveInstance(target)){nodeIndex=findViaDirective(lView,target);if(nodeIndex==-1){throw new Error("The provided directive was not found in the application")}directives=getDirectivesAtNodeIndex(nodeIndex,lView)}else{nodeIndex=findViaNativeElement(lView,target);if(nodeIndex==-1){return null}}const native=unwrapRNode(lView[nodeIndex]);const existingCtx=readPatchedData(native);const context=existingCtx&&!Array.isArray(existingCtx)?existingCtx:createLContext(lView,nodeIndex,native);if(component&&context.component===undefined){context.component=component;attachPatchData(context.component,context)}if(directives&&context.directives===undefined){context.directives=directives;for(let i=0;i<directives.length;i++){attachPatchData(directives[i],context)}}attachPatchData(context.native,context);mpValue=context}}else{const rElement=target;ngDevMode&&assertDomNode(rElement);let parent=rElement;while(parent=parent.parentNode){const parentContext=readPatchedData(parent);if(parentContext){const lView=Array.isArray(parentContext)?parentContext:parentContext.lView;if(!lView){return null}const index=findViaNativeElement(lView,rElement);if(index>=0){const native=unwrapRNode(lView[index]);const context=createLContext(lView,index,native);attachPatchData(native,context);mpValue=context;break}}}}return mpValue||null}function createLContext(lView,nodeIndex,native){return new LContext(lView[ID],nodeIndex,native)}function getComponentViewByInstance(componentInstance){let patchedData=readPatchedData(componentInstance);let lView;if(isLView(patchedData)){const contextLView=patchedData;const nodeIndex=findViaComponent(contextLView,componentInstance);lView=getComponentLViewByIndex(nodeIndex,contextLView);const context=createLContext(contextLView,nodeIndex,lView[HOST]);context.component=componentInstance;attachPatchData(componentInstance,context);attachPatchData(context.native,context)}else{const context=patchedData;const contextLView=context.lView;ngDevMode&&assertLView(contextLView);lView=getComponentLViewByIndex(context.nodeIndex,contextLView)}return lView}const MONKEY_PATCH_KEY_NAME="__ngContext__";function attachPatchData(target,data){ngDevMode&&assertDefined(target,"Target expected");if(isLView(data)){target[MONKEY_PATCH_KEY_NAME]=data[ID];registerLView(data)}else{target[MONKEY_PATCH_KEY_NAME]=data}}function readPatchedData(target){ngDevMode&&assertDefined(target,"Target expected");const data=target[MONKEY_PATCH_KEY_NAME];return typeof data==="number"?getLViewById(data):data||null}function readPatchedLView(target){const value=readPatchedData(target);if(value){return isLView(value)?value:value.lView}return null}function isComponentInstance(instance){return instance&&instance.constructor&&instance.constructor.\u0275cmp}function isDirectiveInstance(instance){return instance&&instance.constructor&&instance.constructor.\u0275dir}function findViaNativeElement(lView,target){const tView=lView[TVIEW];for(let i=HEADER_OFFSET;i<tView.bindingStartIndex;i++){if(unwrapRNode(lView[i])===target){return i}}return-1}function traverseNextElement(tNode){if(tNode.child){return tNode.child}else if(tNode.next){return tNode.next}else{while(tNode.parent&&!tNode.parent.next){tNode=tNode.parent}return tNode.parent&&tNode.parent.next}}function findViaComponent(lView,componentInstance){const componentIndices=lView[TVIEW].components;if(componentIndices){for(let i=0;i<componentIndices.length;i++){const elementComponentIndex=componentIndices[i];const componentView=getComponentLViewByIndex(elementComponentIndex,lView);if(componentView[CONTEXT]===componentInstance){return elementComponentIndex}}}else{const rootComponentView=getComponentLViewByIndex(HEADER_OFFSET,lView);const rootComponent=rootComponentView[CONTEXT];if(rootComponent===componentInstance){return HEADER_OFFSET}}return-1}function findViaDirective(lView,directiveInstance){let tNode=lView[TVIEW].firstChild;while(tNode){const directiveIndexStart=tNode.directiveStart;const directiveIndexEnd=tNode.directiveEnd;for(let i=directiveIndexStart;i<directiveIndexEnd;i++){if(lView[i]===directiveInstance){return tNode.index}}tNode=traverseNextElement(tNode)}return-1}function getDirectivesAtNodeIndex(nodeIndex,lView){const tNode=lView[TVIEW].data[nodeIndex];if(tNode.directiveStart===0)return EMPTY_ARRAY;const results=[];for(let i=tNode.directiveStart;i<tNode.directiveEnd;i++){const directiveInstance=lView[i];if(!isComponentInstance(directiveInstance)){results.push(directiveInstance)}}return results}function getComponentAtNodeIndex(nodeIndex,lView){const tNode=lView[TVIEW].data[nodeIndex];const{directiveStart:directiveStart,componentOffset:componentOffset}=tNode;return componentOffset>-1?lView[directiveStart+componentOffset]:null}function discoverLocalRefs(lView,nodeIndex){const tNode=lView[TVIEW].data[nodeIndex];if(tNode&&tNode.localNames){const result={};let localIndex=tNode.index+1;for(let i=0;i<tNode.localNames.length;i+=2){result[tNode.localNames[i]]=lView[localIndex];localIndex++}return result}return null}function getRootView(componentOrLView){ngDevMode&&assertDefined(componentOrLView,"component");let lView=isLView(componentOrLView)?componentOrLView:readPatchedLView(componentOrLView);while(lView&&!(lView[FLAGS]&512)){lView=getLViewParent(lView)}ngDevMode&&assertLView(lView);return lView}function getRootContext(viewOrComponent){const rootView=getRootView(viewOrComponent);ngDevMode&&assertDefined(rootView[CONTEXT],"Root view has no context. Perhaps it is disconnected?");return rootView[CONTEXT]}function getFirstLContainer(lView){return getNearestLContainer(lView[CHILD_HEAD])}function getNextLContainer(container){return getNearestLContainer(container[NEXT])}function getNearestLContainer(viewOrContainer){while(viewOrContainer!==null&&!isLContainer(viewOrContainer)){viewOrContainer=viewOrContainer[NEXT]}return viewOrContainer}function getComponent$1(element){ngDevMode&&assertDomElement(element);const context=getLContext(element);if(context===null)return null;if(context.component===undefined){const lView=context.lView;if(lView===null){return null}context.component=getComponentAtNodeIndex(context.nodeIndex,lView)}return context.component}function getContext(element){assertDomElement(element);const context=getLContext(element);const lView=context?context.lView:null;return lView===null?null:lView[CONTEXT]}function getOwningComponent(elementOrDir){const context=getLContext(elementOrDir);let lView=context?context.lView:null;if(lView===null)return null;let parent;while(lView[TVIEW].type===2&&(parent=getLViewParent(lView))){lView=parent}return lView[FLAGS]&512?null:lView[CONTEXT]}function getRootComponents(elementOrDir){const lView=readPatchedLView(elementOrDir);return lView!==null?[getRootContext(lView)]:[]}function getInjector(elementOrDir){const context=getLContext(elementOrDir);const lView=context?context.lView:null;if(lView===null)return Injector.NULL;const tNode=lView[TVIEW].data[context.nodeIndex];return new NodeInjector(tNode,lView)}function getInjectionTokens(element){const context=getLContext(element);const lView=context?context.lView:null;if(lView===null)return[];const tView=lView[TVIEW];const tNode=tView.data[context.nodeIndex];const providerTokens=[];const startIndex=tNode.providerIndexes&1048575;const endIndex=tNode.directiveEnd;for(let i=startIndex;i<endIndex;i++){let value=tView.data[i];if(isDirectiveDefHack(value)){value=value.type}providerTokens.push(value)}return providerTokens}function getDirectives(node){if(node instanceof Text){return[]}const context=getLContext(node);const lView=context?context.lView:null;if(lView===null){return[]}const tView=lView[TVIEW];const nodeIndex=context.nodeIndex;if(!tView?.data[nodeIndex]){return[]}if(context.directives===undefined){context.directives=getDirectivesAtNodeIndex(nodeIndex,lView)}return context.directives===null?[]:[...context.directives]}function getDirectiveMetadata$1(directiveOrComponentInstance){const{constructor:constructor}=directiveOrComponentInstance;if(!constructor){throw new Error("Unable to find the instance constructor")}const componentDef=getComponentDef(constructor);if(componentDef){const inputs=extractInputDebugMetadata(componentDef.inputs);return{inputs:inputs,outputs:componentDef.outputs,encapsulation:componentDef.encapsulation,changeDetection:componentDef.onPush?exports.ChangeDetectionStrategy.OnPush:exports.ChangeDetectionStrategy.Default}}const directiveDef=getDirectiveDef(constructor);if(directiveDef){const inputs=extractInputDebugMetadata(directiveDef.inputs);return{inputs:inputs,outputs:directiveDef.outputs}}return null}function getLocalRefs(target){const context=getLContext(target);if(context===null)return{};if(context.localRefs===undefined){const lView=context.lView;if(lView===null){return{}}context.localRefs=discoverLocalRefs(lView,context.nodeIndex)}return context.localRefs||{}}function getHostElement(componentOrDirective){return getLContext(componentOrDirective).native}function getListeners(element){ngDevMode&&assertDomElement(element);const lContext=getLContext(element);const lView=lContext===null?null:lContext.lView;if(lView===null)return[];const tView=lView[TVIEW];const lCleanup=lView[CLEANUP];const tCleanup=tView.cleanup;const listeners=[];if(tCleanup&&lCleanup){for(let i=0;i<tCleanup.length;){const firstParam=tCleanup[i++];const secondParam=tCleanup[i++];if(typeof firstParam==="string"){const name=firstParam;const listenerElement=unwrapRNode(lView[secondParam]);const callback=lCleanup[tCleanup[i++]];const useCaptureOrIndx=tCleanup[i++];const type=typeof useCaptureOrIndx==="boolean"||useCaptureOrIndx>=0?"dom":"output";const useCapture=typeof useCaptureOrIndx==="boolean"?useCaptureOrIndx:false;if(element==listenerElement){listeners.push({element:element,name:name,callback:callback,useCapture:useCapture,type:type})}}}}listeners.sort(sortListeners);return listeners}function sortListeners(a,b){if(a.name==b.name)return 0;return a.name<b.name?-1:1}function isDirectiveDefHack(obj){return obj.type!==undefined&&obj.declaredInputs!==undefined&&obj.findHostDirectiveDefs!==undefined}function assertDomElement(value){if(typeof Element!=="undefined"&&!(value instanceof Element)){throw new Error("Expecting instance of DOM Element")}}function extractInputDebugMetadata(inputs){const res={};for(const key in inputs){if(!inputs.hasOwnProperty(key)){continue}const value=inputs[key];if(value===undefined){continue}let minifiedName;if(Array.isArray(value)){minifiedName=value[0]}else{minifiedName=value}res[key]=minifiedName}return res}let DOCUMENT=undefined;function setDocument(document){DOCUMENT=document}function getDocument(){if(DOCUMENT!==undefined){return DOCUMENT}else if(typeof document!=="undefined"){return document}throw new RuntimeError(210,(typeof ngDevMode==="undefined"||ngDevMode)&&`The document object is not available in this context. Make sure the DOCUMENT injection token is provided.`)}const APP_ID=new InjectionToken(ngDevMode?"AppId":"",{providedIn:"root",factory:()=>DEFAULT_APP_ID});const DEFAULT_APP_ID="ng";const PLATFORM_INITIALIZER=new InjectionToken(ngDevMode?"Platform Initializer":"");const PLATFORM_ID=new InjectionToken(ngDevMode?"Platform ID":"",{providedIn:"platform",factory:()=>"unknown"});const PACKAGE_ROOT_URL=new InjectionToken(ngDevMode?"Application Packages Root URL":"");const ANIMATION_MODULE_TYPE=new InjectionToken(ngDevMode?"AnimationModuleType":"");const CSP_NONCE=new InjectionToken(ngDevMode?"CSP nonce":"",{providedIn:"root",factory:()=>getDocument().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});const IMAGE_CONFIG_DEFAULTS={breakpoints:[16,32,48,64,96,128,256,384,640,750,828,1080,1200,1920,2048,3840],placeholderResolution:30,disableImageSizeWarning:false,disableImageLazyLoadWarning:false};const IMAGE_CONFIG=new InjectionToken(ngDevMode?"ImageConfig":"",{providedIn:"root",factory:()=>IMAGE_CONFIG_DEFAULTS});function makeStateKey(key){return key}function initTransferState(){const transferState=new TransferState;if(inject(PLATFORM_ID)==="browser"){transferState.store=retrieveTransferredState(getDocument(),inject(APP_ID))}return transferState}class TransferState{constructor(){this.store={};this.onSerializeCallbacks={}}static{this.\u0275prov=\u0275\u0275defineInjectable({token:TransferState,providedIn:"root",factory:initTransferState})}get(key,defaultValue){return this.store[key]!==undefined?this.store[key]:defaultValue}set(key,value){this.store[key]=value}remove(key){delete this.store[key]}hasKey(key){return this.store.hasOwnProperty(key)}get isEmpty(){return Object.keys(this.store).length===0}onSerialize(key,callback){this.onSerializeCallbacks[key]=callback}toJson(){for(const key in this.onSerializeCallbacks){if(this.onSerializeCallbacks.hasOwnProperty(key)){try{this.store[key]=this.onSerializeCallbacks[key]()}catch(e){console.warn("Exception in onSerialize callback: ",e)}}}return JSON.stringify(this.store).replace(/</g,"\\u003C")}}function retrieveTransferredState(doc,appId){const script=doc.getElementById(appId+"-state");if(script?.textContent){try{return JSON.parse(script.textContent)}catch(e){console.warn("Exception while restoring TransferState for app "+appId,e)}}return{}}const REFERENCE_NODE_HOST="h";const REFERENCE_NODE_BODY="b";var NodeNavigationStep;(function(NodeNavigationStep){NodeNavigationStep["FirstChild"]="f";NodeNavigationStep["NextSibling"]="n"})(NodeNavigationStep||(NodeNavigationStep={}));const ELEMENT_CONTAINERS="e";const TEMPLATES="t";const CONTAINERS="c";const MULTIPLIER="x";const NUM_ROOT_NODES="r";const TEMPLATE_ID="i";const NODES="n";const DISCONNECTED_NODES="d";const TRANSFER_STATE_TOKEN_ID="__nghData__";const NGH_DATA_KEY=makeStateKey(TRANSFER_STATE_TOKEN_ID);const NGH_ATTR_NAME="ngh";const SSR_CONTENT_INTEGRITY_MARKER="nghm";let _retrieveHydrationInfoImpl=()=>null;function retrieveHydrationInfoImpl(rNode,injector,isRootView=false){let nghAttrValue=rNode.getAttribute(NGH_ATTR_NAME);if(nghAttrValue==null)return null;const[componentViewNgh,rootViewNgh]=nghAttrValue.split("|");nghAttrValue=isRootView?rootViewNgh:componentViewNgh;if(!nghAttrValue)return null;const rootNgh=rootViewNgh?`|${rootViewNgh}`:"";const remainingNgh=isRootView?componentViewNgh:rootNgh;let data={};if(nghAttrValue!==""){const transferState=injector.get(TransferState,null,{optional:true});if(transferState!==null){const nghData=transferState.get(NGH_DATA_KEY,[]);data=nghData[Number(nghAttrValue)];ngDevMode&&assertDefined(data,"Unable to retrieve hydration info from the TransferState.")}}const dehydratedView={data:data,firstChild:rNode.firstChild??null};if(isRootView){dehydratedView.firstChild=rNode;setSegmentHead(dehydratedView,0,rNode.nextSibling)}if(remainingNgh){rNode.setAttribute(NGH_ATTR_NAME,remainingNgh)}else{rNode.removeAttribute(NGH_ATTR_NAME)}ngDevMode&&markRNodeAsClaimedByHydration(rNode,false);ngDevMode&&ngDevMode.hydratedComponents++;return dehydratedView}function enableRetrieveHydrationInfoImpl(){_retrieveHydrationInfoImpl=retrieveHydrationInfoImpl}function retrieveHydrationInfo(rNode,injector,isRootView=false){return _retrieveHydrationInfoImpl(rNode,injector,isRootView)}function getLNodeForHydration(viewRef){let lView=viewRef._lView;const tView=lView[TVIEW];if(tView.type===2){return null}if(isRootView(lView)){lView=lView[HEADER_OFFSET]}return lView}function getTextNodeContent(node){return node.textContent?.replace(/\s/gm,"")}function processTextNodeMarkersBeforeHydration(node){const doc=getDocument();const commentNodesIterator=doc.createNodeIterator(node,NodeFilter.SHOW_COMMENT,{acceptNode(node){const content=getTextNodeContent(node);const isTextNodeMarker=content==="ngetn"||content==="ngtns";return isTextNodeMarker?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});let currentNode;const nodes=[];while(currentNode=commentNodesIterator.nextNode()){nodes.push(currentNode)}for(const node of nodes){if(node.textContent==="ngetn"){node.replaceWith(doc.createTextNode(""))}else{node.remove()}}}var HydrationStatus;(function(HydrationStatus){HydrationStatus["Hydrated"]="hydrated";HydrationStatus["Skipped"]="skipped";HydrationStatus["Mismatched"]="mismatched"})(HydrationStatus||(HydrationStatus={}));const HYDRATION_INFO_KEY="__ngDebugHydrationInfo__";function patchHydrationInfo(node,info){node[HYDRATION_INFO_KEY]=info}function readHydrationInfo(node){return node[HYDRATION_INFO_KEY]??null}function markRNodeAsClaimedByHydration(node,checkIfAlreadyClaimed=true){if(!ngDevMode){throw new Error("Calling `markRNodeAsClaimedByHydration` in prod mode "+"is not supported and likely a mistake.")}if(checkIfAlreadyClaimed&&isRNodeClaimedForHydration(node)){throw new Error("Trying to claim a node, which was claimed already.")}patchHydrationInfo(node,{status:HydrationStatus.Hydrated});ngDevMode.hydratedNodes++}function markRNodeAsSkippedByHydration(node){if(!ngDevMode){throw new Error("Calling `markRNodeAsSkippedByHydration` in prod mode "+"is not supported and likely a mistake.")}patchHydrationInfo(node,{status:HydrationStatus.Skipped});ngDevMode.componentsSkippedHydration++}function markRNodeAsHavingHydrationMismatch(node,expectedNodeDetails=null,actualNodeDetails=null){if(!ngDevMode){throw new Error("Calling `markRNodeAsMismatchedByHydration` in prod mode "+"is not supported and likely a mistake.")}while(node&&!getComponent$1(node)){node=node?.parentNode}if(node){patchHydrationInfo(node,{status:HydrationStatus.Mismatched,expectedNodeDetails:expectedNodeDetails,actualNodeDetails:actualNodeDetails})}}function isRNodeClaimedForHydration(node){return readHydrationInfo(node)?.status===HydrationStatus.Hydrated}function setSegmentHead(hydrationInfo,index,node){hydrationInfo.segmentHeads??={};hydrationInfo.segmentHeads[index]=node}function getSegmentHead(hydrationInfo,index){return hydrationInfo.segmentHeads?.[index]??null}function getNgContainerSize(hydrationInfo,index){const data=hydrationInfo.data;let size=data[ELEMENT_CONTAINERS]?.[index]??null;if(size===null&&data[CONTAINERS]?.[index]){size=calcSerializedContainerSize(hydrationInfo,index)}return size}function getSerializedContainerViews(hydrationInfo,index){return hydrationInfo.data[CONTAINERS]?.[index]??null}function calcSerializedContainerSize(hydrationInfo,index){const views=getSerializedContainerViews(hydrationInfo,index)??[];let numNodes=0;for(let view of views){numNodes+=view[NUM_ROOT_NODES]*(view[MULTIPLIER]??1)}return numNodes}function isDisconnectedNode$1(hydrationInfo,index){if(typeof hydrationInfo.disconnectedNodes==="undefined"){const nodeIds=hydrationInfo.data[DISCONNECTED_NODES];hydrationInfo.disconnectedNodes=nodeIds?new Set(nodeIds):null}return!!hydrationInfo.disconnectedNodes?.has(index)}const IS_HYDRATION_DOM_REUSE_ENABLED=new InjectionToken(typeof ngDevMode==="undefined"||!!ngDevMode?"IS_HYDRATION_DOM_REUSE_ENABLED":"");const PRESERVE_HOST_CONTENT_DEFAULT=false;const PRESERVE_HOST_CONTENT=new InjectionToken(typeof ngDevMode==="undefined"||!!ngDevMode?"PRESERVE_HOST_CONTENT":"",{providedIn:"root",factory:()=>PRESERVE_HOST_CONTENT_DEFAULT});const IS_I18N_HYDRATION_ENABLED=new InjectionToken(typeof ngDevMode==="undefined"||!!ngDevMode?"IS_I18N_HYDRATION_ENABLED":"");function trustedHTMLFromString(html){return html}function trustedScriptURLFromString(url){return url}function trustedHTMLFromStringBypass(html){return html}function trustedScriptFromStringBypass(script){return script}function trustedScriptURLFromStringBypass(url){return url}class SafeValueImpl{constructor(changingThisBreaksApplicationSecurity){this.changingThisBreaksApplicationSecurity=changingThisBreaksApplicationSecurity}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity}`+` (see ${XSS_SECURITY_URL})`}}class SafeHtmlImpl extends SafeValueImpl{getTypeName(){return"HTML"}}class SafeStyleImpl extends SafeValueImpl{getTypeName(){return"Style"}}class SafeScriptImpl extends SafeValueImpl{getTypeName(){return"Script"}}class SafeUrlImpl extends SafeValueImpl{getTypeName(){return"URL"}}class SafeResourceUrlImpl extends SafeValueImpl{getTypeName(){return"ResourceURL"}}function unwrapSafeValue(value){return value instanceof SafeValueImpl?value.changingThisBreaksApplicationSecurity:value}function allowSanitizationBypassAndThrow(value,type){const actualType=getSanitizationBypassType(value);if(actualType!=null&&actualType!==type){if(actualType==="ResourceURL"&&type==="URL")return true;throw new Error(`Required a safe ${type}, got a ${actualType} (see ${XSS_SECURITY_URL})`)}return actualType===type}function getSanitizationBypassType(value){return value instanceof SafeValueImpl&&value.getTypeName()||null}function bypassSanitizationTrustHtml(trustedHtml){return new SafeHtmlImpl(trustedHtml)}function bypassSanitizationTrustStyle(trustedStyle){return new SafeStyleImpl(trustedStyle)}function bypassSanitizationTrustScript(trustedScript){return new SafeScriptImpl(trustedScript)}function bypassSanitizationTrustUrl(trustedUrl){return new SafeUrlImpl(trustedUrl)}function bypassSanitizationTrustResourceUrl(trustedResourceUrl){return new SafeResourceUrlImpl(trustedResourceUrl)}function getInertBodyHelper(defaultDoc){const inertDocumentHelper=new InertDocumentHelper(defaultDoc);return isDOMParserAvailable()?new DOMParserHelper(inertDocumentHelper):inertDocumentHelper}class DOMParserHelper{constructor(inertDocumentHelper){this.inertDocumentHelper=inertDocumentHelper}getInertBodyElement(html){html="<body><remove></remove>"+html;try{const body=(new window.DOMParser).parseFromString(trustedHTMLFromString(html),"text/html").body;if(body===null){return this.inertDocumentHelper.getInertBodyElement(html)}body.removeChild(body.firstChild);return body}catch{return null}}}class InertDocumentHelper{constructor(defaultDoc){this.defaultDoc=defaultDoc;this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert")}getInertBodyElement(html){const templateEl=this.inertDocument.createElement("template");templateEl.innerHTML=trustedHTMLFromString(html);return templateEl}}function isDOMParserAvailable(){try{return!!(new window.DOMParser).parseFromString(trustedHTMLFromString(""),"text/html")}catch{return false}}const SAFE_URL_PATTERN=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function _sanitizeUrl(url){url=String(url);if(url.match(SAFE_URL_PATTERN))return url;if(typeof ngDevMode==="undefined"||ngDevMode){console.warn(`WARNING: sanitizing unsafe URL value ${url} (see ${XSS_SECURITY_URL})`)}return"unsafe:"+url}function tagSet(tags){const res={};for(const t of tags.split(","))res[t]=true;return res}function merge(...sets){const res={};for(const s of sets){for(const v in s){if(s.hasOwnProperty(v))res[v]=true}}return res}const VOID_ELEMENTS=tagSet("area,br,col,hr,img,wbr");const OPTIONAL_END_TAG_BLOCK_ELEMENTS=tagSet("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr");const OPTIONAL_END_TAG_INLINE_ELEMENTS=tagSet("rp,rt");const OPTIONAL_END_TAG_ELEMENTS=merge(OPTIONAL_END_TAG_INLINE_ELEMENTS,OPTIONAL_END_TAG_BLOCK_ELEMENTS);const BLOCK_ELEMENTS=merge(OPTIONAL_END_TAG_BLOCK_ELEMENTS,tagSet("address,article,"+"aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,"+"h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul"));const INLINE_ELEMENTS=merge(OPTIONAL_END_TAG_INLINE_ELEMENTS,tagSet("a,abbr,acronym,audio,b,"+"bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,"+"samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video"));const VALID_ELEMENTS=merge(VOID_ELEMENTS,BLOCK_ELEMENTS,INLINE_ELEMENTS,OPTIONAL_END_TAG_ELEMENTS);const URI_ATTRS=tagSet("background,cite,href,itemtype,longdesc,poster,src,xlink:href");const HTML_ATTRS=tagSet("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,"+"compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,"+"ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,"+"scope,scrolling,shape,size,sizes,span,srclang,srcset,start,summary,tabindex,target,title,translate,type,usemap,"+"valign,value,vspace,width");const ARIA_ATTRS=tagSet("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,"+"aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,"+"aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,"+"aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,"+"aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,"+"aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,"+"aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext");const VALID_ATTRS=merge(URI_ATTRS,HTML_ATTRS,ARIA_ATTRS);const SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS=tagSet("script,style,template");class SanitizingHtmlSerializer{constructor(){this.sanitizedSomething=false;this.buf=[]}sanitizeChildren(el){let current=el.firstChild;let traverseContent=true;let parentNodes=[];while(current){if(current.nodeType===Node.ELEMENT_NODE){traverseContent=this.startElement(current)}else if(current.nodeType===Node.TEXT_NODE){this.chars(current.nodeValue)}else{this.sanitizedSomething=true}if(traverseContent&¤t.firstChild){parentNodes.push(current);current=getFirstChild(current);continue}while(current){if(current.nodeType===Node.ELEMENT_NODE){this.endElement(current)}let next=getNextSibling(current);if(next){current=next;break}current=parentNodes.pop()}}return this.buf.join("")}startElement(element){const tagName=getNodeName(element).toLowerCase();if(!VALID_ELEMENTS.hasOwnProperty(tagName)){this.sanitizedSomething=true;return!SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS.hasOwnProperty(tagName)}this.buf.push("<");this.buf.push(tagName);const elAttrs=element.attributes;for(let i=0;i<elAttrs.length;i++){const elAttr=elAttrs.item(i);const attrName=elAttr.name;const lower=attrName.toLowerCase();if(!VALID_ATTRS.hasOwnProperty(lower)){this.sanitizedSomething=true;continue}let value=elAttr.value;if(URI_ATTRS[lower])value=_sanitizeUrl(value);this.buf.push(" ",attrName,'="',encodeEntities(value),'"')}this.buf.push(">");return true}endElement(current){const tagName=getNodeName(current).toLowerCase();if(VALID_ELEMENTS.hasOwnProperty(tagName)&&!VOID_ELEMENTS.hasOwnProperty(tagName)){this.buf.push("</");this.buf.push(tagName);this.buf.push(">")}}chars(chars){this.buf.push(encodeEntities(chars))}}function isClobberedElement(parentNode,childNode){return(parentNode.compareDocumentPosition(childNode)&Node.DOCUMENT_POSITION_CONTAINED_BY)!==Node.DOCUMENT_POSITION_CONTAINED_BY}function getNextSibling(node){const nextSibling=node.nextSibling;if(nextSibling&&node!==nextSibling.previousSibling){throw clobberedElementError(nextSibling)}return nextSibling}function getFirstChild(node){const firstChild=node.firstChild;if(firstChild&&isClobberedElement(node,firstChild)){throw clobberedElementError(firstChild)}return firstChild}function getNodeName(node){const nodeName=node.nodeName;return typeof nodeName==="string"?nodeName:"FORM"}function clobberedElementError(node){return new Error(`Failed to sanitize html because the element is clobbered: ${node.outerHTML}`)}const SURROGATE_PAIR_REGEXP=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;const NON_ALPHANUMERIC_REGEXP=/([^\#-~ |!])/g;function encodeEntities(value){return value.replace(/&/g,"&").replace(SURROGATE_PAIR_REGEXP,(function(match){const hi=match.charCodeAt(0);const low=match.charCodeAt(1);return"&#"+((hi-55296)*1024+(low-56320)+65536)+";"})).replace(NON_ALPHANUMERIC_REGEXP,(function(match){return"&#"+match.charCodeAt(0)+";"})).replace(/</g,"<").replace(/>/g,">")}let inertBodyHelper;function _sanitizeHtml(defaultDoc,unsafeHtmlInput){let inertBodyElement=null;try{inertBodyHelper=inertBodyHelper||getInertBodyHelper(defaultDoc);let unsafeHtml=unsafeHtmlInput?String(unsafeHtmlInput):"";inertBodyElement=inertBodyHelper.getInertBodyElement(unsafeHtml);let mXSSAttempts=5;let parsedHtml=unsafeHtml;do{if(mXSSAttempts===0){throw new Error("Failed to sanitize html because the input is unstable")}mXSSAttempts--;unsafeHtml=parsedHtml;parsedHtml=inertBodyElement.innerHTML;inertBodyElement=inertBodyHelper.getInertBodyElement(unsafeHtml)}while(unsafeHtml!==parsedHtml);const sanitizer=new SanitizingHtmlSerializer;const safeHtml=sanitizer.sanitizeChildren(getTemplateContent(inertBodyElement)||inertBodyElement);if((typeof ngDevMode==="undefined"||ngDevMode)&&sanitizer.sanitizedSomething){console.warn(`WARNING: sanitizing HTML stripped some content, see ${XSS_SECURITY_URL}`)}return trustedHTMLFromString(safeHtml)}finally{if(inertBodyElement){const parent=getTemplateContent(inertBodyElement)||inertBodyElement;while(parent.firstChild){parent.removeChild(parent.firstChild)}}}}function getTemplateContent(el){return"content"in el&&isTemplateElement(el)?el.content:null}function isTemplateElement(el){return el.nodeType===Node.ELEMENT_NODE&&el.nodeName==="TEMPLATE"}exports.SecurityContext=void 0;(function(SecurityContext){SecurityContext[SecurityContext["NONE"]=0]="NONE";SecurityContext[SecurityContext["HTML"]=1]="HTML";SecurityContext[SecurityContext["STYLE"]=2]="STYLE";SecurityContext[SecurityContext["SCRIPT"]=3]="SCRIPT";SecurityContext[SecurityContext["URL"]=4]="URL";SecurityContext[SecurityContext["RESOURCE_URL"]=5]="RESOURCE_URL"})(exports.SecurityContext||(exports.SecurityContext={}));function \u0275\u0275sanitizeHtml(unsafeHtml){const sanitizer=getSanitizer();if(sanitizer){return trustedHTMLFromStringBypass(sanitizer.sanitize(exports.SecurityContext.HTML,unsafeHtml)||"")}if(allowSanitizationBypassAndThrow(unsafeHtml,"HTML")){return trustedHTMLFromStringBypass(unwrapSafeValue(unsafeHtml))}return _sanitizeHtml(getDocument(),renderStringify(unsafeHtml))}function \u0275\u0275sanitizeStyle(unsafeStyle){const sanitizer=getSanitizer();if(sanitizer){return sanitizer.sanitize(exports.SecurityContext.STYLE,unsafeStyle)||""}if(allowSanitizationBypassAndThrow(unsafeStyle,"Style")){return unwrapSafeValue(unsafeStyle)}return renderStringify(unsafeStyle)}function \u0275\u0275sanitizeUrl(unsafeUrl){const sanitizer=getSanitizer();if(sanitizer){return sanitizer.sanitize(exports.SecurityContext.URL,unsafeUrl)||""}if(allowSanitizationBypassAndThrow(unsafeUrl,"URL")){return unwrapSafeValue(unsafeUrl)}return _sanitizeUrl(renderStringify(unsafeUrl))}function \u0275\u0275sanitizeResourceUrl(unsafeResourceUrl){const sanitizer=getSanitizer();if(sanitizer){return trustedScriptURLFromStringBypass(sanitizer.sanitize(exports.SecurityContext.RESOURCE_URL,unsafeResourceUrl)||"")}if(allowSanitizationBypassAndThrow(unsafeResourceUrl,"ResourceURL")){return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl))}throw new RuntimeError(904,ngDevMode&&`unsafe value used in a resource URL context (see ${XSS_SECURITY_URL})`)}function \u0275\u0275sanitizeScript(unsafeScript){const sanitizer=getSanitizer();if(sanitizer){return trustedScriptFromStringBypass(sanitizer.sanitize(exports.SecurityContext.SCRIPT,unsafeScript)||"")}if(allowSanitizationBypassAndThrow(unsafeScript,"Script")){return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript))}throw new RuntimeError(905,ngDevMode&&"unsafe value used in a script context")}function \u0275\u0275trustConstantHtml(html){if(ngDevMode&&(!Array.isArray(html)||!Array.isArray(html.raw)||html.length!==1)){throw new Error(`Unexpected interpolation in trusted HTML constant: ${html.join("?")}`)}return trustedHTMLFromString(html[0])}function \u0275\u0275trustConstantResourceUrl(url){if(ngDevMode&&(!Array.isArray(url)||!Array.isArray(url.raw)||url.length!==1)){throw new Error(`Unexpected interpolation in trusted URL constant: ${url.join("?")}`)}return trustedScriptURLFromString(url[0])}function getUrlSanitizer(tag,prop){if(prop==="src"&&(tag==="embed"||tag==="frame"||tag==="iframe"||tag==="media"||tag==="script")||prop==="href"&&(tag==="base"||tag==="link")){return \u0275\u0275sanitizeResourceUrl}return \u0275\u0275sanitizeUrl}function \u0275\u0275sanitizeUrlOrResourceUrl(unsafeUrl,tag,prop){return getUrlSanitizer(tag,prop)(unsafeUrl)}function validateAgainstEventProperties(name){if(name.toLowerCase().startsWith("on")){const errorMessage=`Binding to event property '${name}' is disallowed for security reasons, `+`please use (${name.slice(2)})=...`+`\nIf '${name}' is a directive input, make sure the directive is imported by the`+` current module.`;throw new RuntimeError(306,errorMessage)}}function validateAgainstEventAttributes(name){if(name.toLowerCase().startsWith("on")){const errorMessage=`Binding to event attribute '${name}' is disallowed for security reasons, `+`please use (${name.slice(2)})=...`;throw new RuntimeError(306,errorMessage)}}function getSanitizer(){const lView=getLView();return lView&&lView[ENVIRONMENT].sanitizer}const COMMENT_DISALLOWED=/^>|^->|<!--|-->|--!>|<!-$/g;const COMMENT_DELIMITER=/(<|>)/g;const COMMENT_DELIMITER_ESCAPED="\u200b$1\u200b";function escapeCommentText(value){return value.replace(COMMENT_DISALLOWED,(text=>text.replace(COMMENT_DELIMITER,COMMENT_DELIMITER_ESCAPED)))}function normalizeDebugBindingName(name){name=camelCaseToDashCase(name.replace(/[$@]/g,"_"));return`ng-reflect-${name}`}const CAMEL_CASE_REGEXP=/([A-Z])/g;function camelCaseToDashCase(input){return input.replace(CAMEL_CASE_REGEXP,((...m)=>"-"+m[1].toLowerCase()))}function normalizeDebugBindingValue(value){try{return value!=null?value.toString().slice(0,30):value}catch(e){return"[ERROR] Exception while trying to serialize the value"}}const CUSTOM_ELEMENTS_SCHEMA={name:"custom-elements"};const NO_ERRORS_SCHEMA={name:"no-errors-schema"};let shouldThrowErrorOnUnknownElement=false;function \u0275setUnknownElementStrictMode(shouldThrow){shouldThrowErrorOnUnknownElement=shouldThrow}function \u0275getUnknownElementStrictMode(){return shouldThrowErrorOnUnknownElement}let shouldThrowErrorOnUnknownProperty=false;function \u0275setUnknownPropertyStrictMode(shouldThrow){shouldThrowErrorOnUnknownProperty=shouldThrow}function \u0275getUnknownPropertyStrictMode(){return shouldThrowErrorOnUnknownProperty}function validateElementIsKnown(element,lView,tagName,schemas,hasDirectives){if(schemas===null)return;if(!hasDirectives&&tagName!==null){const isUnknown=typeof HTMLUnknownElement!=="undefined"&&HTMLUnknownElement&&element instanceof HTMLUnknownElement||typeof customElements!=="undefined"&&tagName.indexOf("-")>-1&&!customElements.get(tagName);if(isUnknown&&!matchingSchemas(schemas,tagName)){const isHostStandalone=isHostComponentStandalone(lView);const templateLocation=getTemplateLocationDetails(lView);const schemas=`'${isHostStandalone?"@Component":"@NgModule"}.schemas'`;let message=`'${tagName}' is not a known element${templateLocation}:\n`;message+=`1. If '${tagName}' is an Angular component, then verify that it is ${isHostStandalone?"included in the '@Component.imports' of this component":"a part of an @NgModule where this component is declared"}.\n`;if(tagName&&tagName.indexOf("-")>-1){message+=`2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas} of this component to suppress this message.`}else{message+=`2. To allow any element add 'NO_ERRORS_SCHEMA' to the ${schemas} of this component.`}if(shouldThrowErrorOnUnknownElement){throw new RuntimeError(304,message)}else{console.error(formatRuntimeError(304,message))}}}}function isPropertyValid(element,propName,tagName,schemas){if(schemas===null)return true;if(matchingSchemas(schemas,tagName)||propName in element||isAnimationProp(propName)){return true}return typeof Node==="undefined"||Node===null||!(element instanceof Node)}function handleUnknownPropertyError(propName,tagName,nodeType,lView){if(!tagName&&nodeType===4){tagName="ng-template"}const isHostStandalone=isHostComponentStandalone(lView);const templateLocation=getTemplateLocationDetails(lView);let message=`Can't bind to '${propName}' since it isn't a known property of '${tagName}'${templateLocation}.`;const schemas=`'${isHostStandalone?"@Component":"@NgModule"}.schemas'`;const importLocation=isHostStandalone?"included in the '@Component.imports' of this component":"a part of an @NgModule where this component is declared";if(KNOWN_CONTROL_FLOW_DIRECTIVES.has(propName)){const correspondingImport=KNOWN_CONTROL_FLOW_DIRECTIVES.get(propName);message+=`\nIf the '${propName}' is an Angular control flow directive, `+`please make sure that either the '${correspondingImport}' directive or the 'CommonModule' is ${importLocation}.`}else{message+=`\n1. If '${tagName}' is an Angular component and it has the `+`'${propName}' input, then verify that it is ${importLocation}.`;if(tagName&&tagName.indexOf("-")>-1){message+=`\n2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' `+`to the ${schemas} of this component to suppress this message.`;message+=`\n3. To allow any property add 'NO_ERRORS_SCHEMA' to `+`the ${schemas} of this component.`}else{message+=`\n2. To allow any property add 'NO_ERRORS_SCHEMA' to `+`the ${schemas} of this component.`}}reportUnknownPropertyError(message)}function reportUnknownPropertyError(message){if(shouldThrowErrorOnUnknownProperty){throw new RuntimeError(303,message)}else{console.error(formatRuntimeError(303,message))}}function getDeclarationComponentDef(lView){!ngDevMode&&throwError("Must never be called in production mode");const declarationLView=lView[DECLARATION_COMPONENT_VIEW];const context=declarationLView[CONTEXT];if(!context)return null;return context.constructor?getComponentDef(context.constructor):null}function isHostComponentStandalone(lView){!ngDevMode&&throwError("Must never be called in production mode");const componentDef=getDeclarationComponentDef(lView);return!!componentDef?.standalone}function getTemplateLocationDetails(lView){!ngDevMode&&throwError("Must never be called in production mode");const hostComponentDef=getDeclarationComponentDef(lView);const componentClassName=hostComponentDef?.type?.name;return componentClassName?` (used in the '${componentClassName}' component template)`:""}const KNOWN_CONTROL_FLOW_DIRECTIVES=new Map([["ngIf","NgIf"],["ngFor","NgFor"],["ngSwitchCase","NgSwitchCase"],["ngSwitchDefault","NgSwitchDefault"]]);function matchingSchemas(schemas,tagName){if(schemas!==null){for(let i=0;i<schemas.length;i++){const schema=schemas[i];if(schema===NO_ERRORS_SCHEMA||schema===CUSTOM_ELEMENTS_SCHEMA&&tagName&&tagName.indexOf("-")>-1){return true}}}return false}function \u0275\u0275resolveWindow(element){return element.ownerDocument.defaultView}function \u0275\u0275resolveDocument(element){return element.ownerDocument}function \u0275\u0275resolveBody(element){return element.ownerDocument.body}const INTERPOLATION_DELIMITER=`\ufffd`;function maybeUnwrapFn(value){if(value instanceof Function){return value()}else{return value}}function isPlatformBrowser(injector){return(injector??inject(Injector)).get(PLATFORM_ID)==="browser"}const VALUE_STRING_LENGTH_LIMIT=200;function assertStandaloneComponentType(type){assertComponentDef(type);const componentDef=getComponentDef(type);if(!componentDef.standalone){throw new RuntimeError(907,`The ${stringifyForError(type)} component is not marked as standalone, `+`but Angular expects to have a standalone component here. `+`Please make sure the ${stringifyForError(type)} component has `+`the \`standalone: true\` flag in the decorator.`)}}function assertComponentDef(type){if(!getComponentDef(type)){throw new RuntimeError(906,`The ${stringifyForError(type)} is not an Angular component, `+`make sure it has the \`@Component\` decorator.`)}}function throwMultipleComponentError(tNode,first,second){throw new RuntimeError(-300,`Multiple components match node with tagname ${tNode.value}: `+`${stringifyForError(first)} and `+`${stringifyForError(second)}`)}function throwErrorIfNoChangesMode(creationMode,oldValue,currValue,propName,lView){const hostComponentDef=getDeclarationComponentDef(lView);const componentClassName=hostComponentDef?.type?.name;const field=propName?` for '${propName}'`:"";let msg=`ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value${field}: '${formatValue(oldValue)}'. Current value: '${formatValue(currValue)}'.${componentClassName?` Expression location: ${componentClassName} component`:""}`;if(creationMode){msg+=` It seems like the view has been created after its parent and its children have been dirty checked.`+` Has it been created in a change detection hook?`}throw new RuntimeError(-100,msg)}function formatValue(value){let strValue=String(value);try{if(Array.isArray(value)||strValue==="[object Object]"){strValue=JSON.stringify(value)}}catch(error){}return strValue.length>VALUE_STRING_LENGTH_LIMIT?strValue.substring(0,VALUE_STRING_LENGTH_LIMIT)+"\u2026":strValue}function constructDetailsForInterpolation(lView,rootIndex,expressionIndex,meta,changedValue){const[propName,prefix,...chunks]=meta.split(INTERPOLATION_DELIMITER);let oldValue=prefix,newValue=prefix;for(let i=0;i<chunks.length;i++){const slotIdx=rootIndex+i;oldValue+=`${lView[slotIdx]}${chunks[i]}`;newValue+=`${slotIdx===expressionIndex?changedValue:lView[slotIdx]}${chunks[i]}`}return{propName:propName,oldValue:oldValue,newValue:newValue}}function getExpressionChangedErrorDetails(lView,bindingIndex,oldValue,newValue){const tData=lView[TVIEW].data;const metadata=tData[bindingIndex];if(typeof metadata==="string"){if(metadata.indexOf(INTERPOLATION_DELIMITER)>-1){return constructDetailsForInterpolation(lView,bindingIndex,bindingIndex,metadata,newValue)}return{propName:metadata,oldValue:oldValue,newValue:newValue}}if(metadata===null){let idx=bindingIndex-1;while(typeof tData[idx]!=="string"&&tData[idx+1]===null){idx--}const meta=tData[idx];if(typeof meta==="string"){const matches=meta.match(new RegExp(INTERPOLATION_DELIMITER,"g"));if(matches&&matches.length-1>bindingIndex-idx){return constructDetailsForInterpolation(lView,idx,bindingIndex,meta,newValue)}}}return{propName:undefined,oldValue:oldValue,newValue:newValue}}exports.RendererStyleFlags2=void 0;(function(RendererStyleFlags2){RendererStyleFlags2[RendererStyleFlags2["Important"]=1]="Important";RendererStyleFlags2[RendererStyleFlags2["DashCase"]=2]="DashCase"})(exports.RendererStyleFlags2||(exports.RendererStyleFlags2={}));let _icuContainerIterate;function icuContainerIterate(tIcuContainerNode,lView){return _icuContainerIterate(tIcuContainerNode,lView)}function ensureIcuContainerVisitorLoaded(loader){if(_icuContainerIterate===undefined){_icuContainerIterate=loader()}}function applyToElementOrContainer(action,renderer,parent,lNodeToHandle,beforeNode){if(lNodeToHandle!=null){let lContainer;let isComponent=false;if(isLContainer(lNodeToHandle)){lContainer=lNodeToHandle}else if(isLView(lNodeToHandle)){isComponent=true;ngDevMode&&assertDefined(lNodeToHandle[HOST],"HOST must be defined for a component LView");lNodeToHandle=lNodeToHandle[HOST]}const rNode=unwrapRNode(lNodeToHandle);if(action===0&&parent!==null){if(beforeNode==null){nativeAppendChild(renderer,parent,rNode)}else{nativeInsertBefore(renderer,parent,rNode,beforeNode||null,true)}}else if(action===1&&parent!==null){nativeInsertBefore(renderer,parent,rNode,beforeNode||null,true)}else if(action===2){nativeRemoveNode(renderer,rNode,isComponent)}else if(action===3){ngDevMode&&ngDevMode.rendererDestroyNode++;renderer.destroyNode(rNode)}if(lContainer!=null){applyContainer(renderer,action,lContainer,parent,beforeNode)}}}function createTextNode(renderer,value){ngDevMode&&ngDevMode.rendererCreateTextNode++;ngDevMode&&ngDevMode.rendererSetText++;return renderer.createText(value)}function updateTextNode(renderer,rNode,value){ngDevMode&&ngDevMode.rendererSetText++;renderer.setValue(rNode,value)}function createCommentNode(renderer,value){ngDevMode&&ngDevMode.rendererCreateComment++;return renderer.createComment(escapeCommentText(value))}function createElementNode(renderer,name,namespace){ngDevMode&&ngDevMode.rendererCreateElement++;return renderer.createElement(name,namespace)}function removeViewFromDOM(tView,lView){detachViewFromDOM(tView,lView);lView[HOST]=null;lView[T_HOST]=null}function addViewToDOM(tView,parentTNode,renderer,lView,parentNativeNode,beforeNode){lView[HOST]=parentNativeNode;lView[T_HOST]=parentTNode;applyView(tView,lView,renderer,1,parentNativeNode,beforeNode)}function detachViewFromDOM(tView,lView){lView[ENVIRONMENT].changeDetectionScheduler?.notify(1);applyView(tView,lView,lView[RENDERER],2,null,null)}function destroyViewTree(rootView){let lViewOrLContainer=rootView[CHILD_HEAD];if(!lViewOrLContainer){return cleanUpView(rootView[TVIEW],rootView)}while(lViewOrLContainer){let next=null;if(isLView(lViewOrLContainer)){next=lViewOrLContainer[CHILD_HEAD]}else{ngDevMode&&assertLContainer(lViewOrLContainer);const firstView=lViewOrLContainer[CONTAINER_HEADER_OFFSET];if(firstView)next=firstView}if(!next){while(lViewOrLContainer&&!lViewOrLContainer[NEXT]&&lViewOrLContainer!==rootView){if(isLView(lViewOrLContainer)){cleanUpView(lViewOrLContainer[TVIEW],lViewOrLContainer)}lViewOrLContainer=lViewOrLContainer[PARENT]}if(lViewOrLContainer===null)lViewOrLContainer=rootView;if(isLView(lViewOrLContainer)){cleanUpView(lViewOrLContainer[TVIEW],lViewOrLContainer)}next=lViewOrLContainer&&lViewOrLContainer[NEXT]}lViewOrLContainer=next}}function insertView(tView,lView,lContainer,index){ngDevMode&&assertLView(lView);ngDevMode&&assertLContainer(lContainer);const indexInContainer=CONTAINER_HEADER_OFFSET+index;const containerLength=lContainer.length;if(index>0){lContainer[indexInContainer-1][NEXT]=lView}if(index<containerLength-CONTAINER_HEADER_OFFSET){lView[NEXT]=lContainer[indexInContainer];addToArray(lContainer,CONTAINER_HEADER_OFFSET+index,lView)}else{lContainer.push(lView);lView[NEXT]=null}lView[PARENT]=lContainer;const declarationLContainer=lView[DECLARATION_LCONTAINER];if(declarationLContainer!==null&&lContainer!==declarationLContainer){trackMovedView(declarationLContainer,lView)}const lQueries=lView[QUERIES];if(lQueries!==null){lQueries.insertView(tView)}updateAncestorTraversalFlagsOnAttach(lView);lView[FLAGS]|=128}function trackMovedView(declarationContainer,lView){ngDevMode&&assertDefined(lView,"LView required");ngDevMode&&assertLContainer(declarationContainer);const movedViews=declarationContainer[MOVED_VIEWS];const insertedLContainer=lView[PARENT];ngDevMode&&assertLContainer(insertedLContainer);const insertedComponentLView=insertedLContainer[PARENT][DECLARATION_COMPONENT_VIEW];ngDevMode&&assertDefined(insertedComponentLView,"Missing insertedComponentLView");const declaredComponentLView=lView[DECLARATION_COMPONENT_VIEW];ngDevMode&&assertDefined(declaredComponentLView,"Missing declaredComponentLView");if(declaredComponentLView!==insertedComponentLView){declarationContainer[FLAGS]|=LContainerFlags.HasTransplantedViews}if(movedViews===null){declarationContainer[MOVED_VIEWS]=[lView]}else{movedViews.push(lView)}}function detachMovedView(declarationContainer,lView){ngDevMode&&assertLContainer(declarationContainer);ngDevMode&&assertDefined(declarationContainer[MOVED_VIEWS],"A projected view should belong to a non-empty projected views collection");const movedViews=declarationContainer[MOVED_VIEWS];const declarationViewIndex=movedViews.indexOf(lView);ngDevMode&&assertLContainer(lView[PARENT]);movedViews.splice(declarationViewIndex,1)}function detachView(lContainer,removeIndex){if(lContainer.length<=CONTAINER_HEADER_OFFSET)return;const indexInContainer=CONTAINER_HEADER_OFFSET+removeIndex;const viewToDetach=lContainer[indexInContainer];if(viewToDetach){const declarationLContainer=viewToDetach[DECLARATION_LCONTAINER];if(declarationLContainer!==null&&declarationLContainer!==lContainer){detachMovedView(declarationLContainer,viewToDetach)}if(removeIndex>0){lContainer[indexInContainer-1][NEXT]=viewToDetach[NEXT]}const removedLView=removeFromArray(lContainer,CONTAINER_HEADER_OFFSET+removeIndex);removeViewFromDOM(viewToDetach[TVIEW],viewToDetach);const lQueries=removedLView[QUERIES];if(lQueries!==null){lQueries.detachView(removedLView[TVIEW])}viewToDetach[PARENT]=null;viewToDetach[NEXT]=null;viewToDetach[FLAGS]&=~128}return viewToDetach}function destroyLView(tView,lView){if(!(lView[FLAGS]&256)){const renderer=lView[RENDERER];if(renderer.destroyNode){applyView(tView,lView,renderer,3,null,null)}destroyViewTree(lView)}}function cleanUpView(tView,lView){if(lView[FLAGS]&256){return}const prevConsumer=signals.setActiveConsumer(null);try{lView[FLAGS]&=~128;lView[FLAGS]|=256;lView[REACTIVE_TEMPLATE_CONSUMER]&&signals.consumerDestroy(lView[REACTIVE_TEMPLATE_CONSUMER]);executeOnDestroys(tView,lView);processCleanups(tView,lView);if(lView[TVIEW].type===1){ngDevMode&&ngDevMode.rendererDestroy++;lView[RENDERER].destroy()}const declarationContainer=lView[DECLARATION_LCONTAINER];if(declarationContainer!==null&&isLContainer(lView[PARENT])){if(declarationContainer!==lView[PARENT]){detachMovedView(declarationContainer,lView)}const lQueries=lView[QUERIES];if(lQueries!==null){lQueries.detachView(tView)}}unregisterLView(lView)}finally{signals.setActiveConsumer(prevConsumer)}}function processCleanups(tView,lView){ngDevMode&&assertNotReactive(processCleanups.name);const tCleanup=tView.cleanup;const lCleanup=lView[CLEANUP];if(tCleanup!==null){for(let i=0;i<tCleanup.length-1;i+=2){if(typeof tCleanup[i]==="string"){const targetIdx=tCleanup[i+3];ngDevMode&&assertNumber(targetIdx,"cleanup target must be a number");if(targetIdx>=0){lCleanup[targetIdx]()}else{lCleanup[-targetIdx].unsubscribe()}i+=2}else{const context=lCleanup[tCleanup[i+1]];tCleanup[i].call(context)}}}if(lCleanup!==null){lView[CLEANUP]=null}const destroyHooks=lView[ON_DESTROY_HOOKS];if(destroyHooks!==null){lView[ON_DESTROY_HOOKS]=null;for(let i=0;i<destroyHooks.length;i++){const destroyHooksFn=destroyHooks[i];ngDevMode&&assertFunction(destroyHooksFn,"Expecting destroy hook to be a function.");destroyHooksFn()}}}function executeOnDestroys(tView,lView){ngDevMode&&assertNotReactive(executeOnDestroys.name);let destroyHooks;if(tView!=null&&(destroyHooks=tView.destroyHooks)!=null){for(let i=0;i<destroyHooks.length;i+=2){const context=lView[destroyHooks[i]];if(!(context instanceof NodeInjectorFactory)){const toCall=destroyHooks[i+1];if(Array.isArray(toCall)){for(let j=0;j<toCall.length;j+=2){const callContext=context[toCall[j]];const hook=toCall[j+1];profiler(4,callContext,hook);try{hook.call(callContext)}finally{profiler(5,callContext,hook)}}}else{profiler(4,context,toCall);try{toCall.call(context)}finally{profiler(5,context,toCall)}}}}}}function getParentRElement(tView,tNode,lView){return getClosestRElement(tView,tNode.parent,lView)}function getClosestRElement(tView,tNode,lView){let parentTNode=tNode;while(parentTNode!==null&&parentTNode.type&(8|32)){tNode=parentTNode;parentTNode=tNode.parent}if(parentTNode===null){return lView[HOST]}else{ngDevMode&&assertTNodeType(parentTNode,3|4);const{componentOffset:componentOffset}=parentTNode;if(componentOffset>-1){ngDevMode&&assertTNodeForLView(parentTNode,lView);const{encapsulation:encapsulation}=tView.data[parentTNode.directiveStart+componentOffset];if(encapsulation===exports.ViewEncapsulation.None||encapsulation===exports.ViewEncapsulation.Emulated){return null}}return getNativeByTNode(parentTNode,lView)}}function nativeInsertBefore(renderer,parent,child,beforeNode,isMove){ngDevMode&&ngDevMode.rendererInsertBefore++;renderer.insertBefore(parent,child,beforeNode,isMove)}function nativeAppendChild(renderer,parent,child){ngDevMode&&ngDevMode.rendererAppendChild++;ngDevMode&&assertDefined(parent,"parent node must be defined");renderer.appendChild(parent,child)}function nativeAppendOrInsertBefore(renderer,parent,child,beforeNode,isMove){if(beforeNode!==null){nativeInsertBefore(renderer,parent,child,beforeNode,isMove)}else{nativeAppendChild(renderer,parent,child)}}function nativeRemoveChild(renderer,parent,child,isHostElement){renderer.removeChild(parent,child,isHostElement)}function nativeParentNode(renderer,node){return renderer.parentNode(node)}function nativeNextSibling(renderer,node){return renderer.nextSibling(node)}function getInsertInFrontOfRNode(parentTNode,currentTNode,lView){return _getInsertInFrontOfRNodeWithI18n(parentTNode,currentTNode,lView)}function getInsertInFrontOfRNodeWithNoI18n(parentTNode,currentTNode,lView){if(parentTNode.type&(8|32)){return getNativeByTNode(parentTNode,lView)}return null}let _getInsertInFrontOfRNodeWithI18n=getInsertInFrontOfRNodeWithNoI18n;let _processI18nInsertBefore;function setI18nHandling(getInsertInFrontOfRNodeWithI18n,processI18nInsertBefore){_getInsertInFrontOfRNodeWithI18n=getInsertInFrontOfRNodeWithI18n;_processI18nInsertBefore=processI18nInsertBefore}function appendChild(tView,lView,childRNode,childTNode){const parentRNode=getParentRElement(tView,childTNode,lView);const renderer=lView[RENDERER];const parentTNode=childTNode.parent||lView[T_HOST];const anchorNode=getInsertInFrontOfRNode(parentTNode,childTNode,lView);if(parentRNode!=null){if(Array.isArray(childRNode)){for(let i=0;i<childRNode.length;i++){nativeAppendOrInsertBefore(renderer,parentRNode,childRNode[i],anchorNode,false)}}else{nativeAppendOrInsertBefore(renderer,parentRNode,childRNode,anchorNode,false)}}_processI18nInsertBefore!==undefined&&_processI18nInsertBefore(renderer,childTNode,lView,childRNode,parentRNode)}function getFirstNativeNode(lView,tNode){if(tNode!==null){ngDevMode&&assertTNodeType(tNode,3|12|32|16);const tNodeType=tNode.type;if(tNodeType&3){return getNativeByTNode(tNode,lView)}else if(tNodeType&4){return getBeforeNodeForView(-1,lView[tNode.index])}else if(tNodeType&8){const elIcuContainerChild=tNode.child;if(elIcuContainerChild!==null){return getFirstNativeNode(lView,elIcuContainerChild)}else{const rNodeOrLContainer=lView[tNode.index];if(isLContainer(rNodeOrLContainer)){return getBeforeNodeForView(-1,rNodeOrLContainer)}else{return unwrapRNode(rNodeOrLContainer)}}}else if(tNodeType&32){let nextRNode=icuContainerIterate(tNode,lView);let rNode=nextRNode();return rNode||unwrapRNode(lView[tNode.index])}else{const projectionNodes=getProjectionNodes(lView,tNode);if(projectionNodes!==null){if(Array.isArray(projectionNodes)){return projectionNodes[0]}const parentView=getLViewParent(lView[DECLARATION_COMPONENT_VIEW]);ngDevMode&&assertParentView(parentView);return getFirstNativeNode(parentView,projectionNodes)}else{return getFirstNativeNode(lView,tNode.next)}}}return null}function getProjectionNodes(lView,tNode){if(tNode!==null){const componentView=lView[DECLARATION_COMPONENT_VIEW];const componentHost=componentView[T_HOST];const slotIdx=tNode.projection;ngDevMode&&assertProjectionSlots(lView);return componentHost.projection[slotIdx]}return null}function getBeforeNodeForView(viewIndexInContainer,lContainer){const nextViewIndex=CONTAINER_HEADER_OFFSET+viewIndexInContainer+1;if(nextViewIndex<lContainer.length){const lView=lContainer[nextViewIndex];const firstTNodeOfView=lView[TVIEW].firstChild;if(firstTNodeOfView!==null){return getFirstNativeNode(lView,firstTNodeOfView)}}return lContainer[NATIVE]}function nativeRemoveNode(renderer,rNode,isHostElement){ngDevMode&&ngDevMode.rendererRemoveNode++;const nativeParent=nativeParentNode(renderer,rNode);if(nativeParent){nativeRemoveChild(renderer,nativeParent,rNode,isHostElement)}}function clearElementContents(rElement){rElement.textContent=""}function applyNodes(renderer,action,tNode,lView,parentRElement,beforeNode,isProjection){while(tNode!=null){ngDevMode&&assertTNodeForLView(tNode,lView);ngDevMode&&assertTNodeType(tNode,3|12|16|32);const rawSlotValue=lView[tNode.index];const tNodeType=tNode.type;if(isProjection){if(action===0){rawSlotValue&&attachPatchData(unwrapRNode(rawSlotValue),lView);tNode.flags|=2}}if((tNode.flags&32)!==32){if(tNodeType&8){applyNodes(renderer,action,tNode.child,lView,parentRElement,beforeNode,false);applyToElementOrContainer(action,renderer,parentRElement,rawSlotValue,beforeNode)}else if(tNodeType&32){const nextRNode=icuContainerIterate(tNode,lView);let rNode;while(rNode=nextRNode()){applyToElementOrContainer(action,renderer,parentRElement,rNode,beforeNode)}applyToElementOrContainer(action,renderer,parentRElement,rawSlotValue,beforeNode)}else if(tNodeType&16){applyProjectionRecursive(renderer,action,lView,tNode,parentRElement,beforeNode)}else{ngDevMode&&assertTNodeType(tNode,3|4);applyToElementOrContainer(action,renderer,parentRElement,rawSlotValue,beforeNode)}}tNode=isProjection?tNode.projectionNext:tNode.next}}function applyView(tView,lView,renderer,action,parentRElement,beforeNode){applyNodes(renderer,action,tView.firstChild,lView,parentRElement,beforeNode,false)}function applyProjection(tView,lView,tProjectionNode){const renderer=lView[RENDERER];const parentRNode=getParentRElement(tView,tProjectionNode,lView);const parentTNode=tProjectionNode.parent||lView[T_HOST];let beforeNode=getInsertInFrontOfRNode(parentTNode,tProjectionNode,lView);applyProjectionRecursive(renderer,0,lView,tProjectionNode,parentRNode,beforeNode)}function applyProjectionRecursive(renderer,action,lView,tProjectionNode,parentRElement,beforeNode){const componentLView=lView[DECLARATION_COMPONENT_VIEW];const componentNode=componentLView[T_HOST];ngDevMode&&assertEqual(typeof tProjectionNode.projection,"number","expecting projection index");const nodeToProjectOrRNodes=componentNode.projection[tProjectionNode.projection];if(Array.isArray(nodeToProjectOrRNodes)){for(let i=0;i<nodeToProjectOrRNodes.length;i++){const rNode=nodeToProjectOrRNodes[i];applyToElementOrContainer(action,renderer,parentRElement,rNode,beforeNode)}}else{let nodeToProject=nodeToProjectOrRNodes;const projectedComponentLView=componentLView[PARENT];if(hasInSkipHydrationBlockFlag(tProjectionNode)){nodeToProject.flags|=128}applyNodes(renderer,action,nodeToProject,projectedComponentLView,parentRElement,beforeNode,true)}}function applyContainer(renderer,action,lContainer,parentRElement,beforeNode){ngDevMode&&assertLContainer(lContainer);const anchor=lContainer[NATIVE];const native=unwrapRNode(lContainer);if(anchor!==native){applyToElementOrContainer(action,renderer,parentRElement,anchor,beforeNode)}for(let i=CONTAINER_HEADER_OFFSET;i<lContainer.length;i++){const lView=lContainer[i];applyView(lView[TVIEW],lView,renderer,action,parentRElement,anchor)}}function applyStyling(renderer,isClassBased,rNode,prop,value){if(isClassBased){if(!value){ngDevMode&&ngDevMode.rendererRemoveClass++;renderer.removeClass(rNode,prop)}else{ngDevMode&&ngDevMode.rendererAddClass++;renderer.addClass(rNode,prop)}}else{let flags=prop.indexOf("-")===-1?undefined:exports.RendererStyleFlags2.DashCase;if(value==null){ngDevMode&&ngDevMode.rendererRemoveStyle++;renderer.removeStyle(rNode,prop,flags)}else{const isImportant=typeof value==="string"?value.endsWith("!important"):false;if(isImportant){value=value.slice(0,-10);flags|=exports.RendererStyleFlags2.Important}ngDevMode&&ngDevMode.rendererSetStyle++;renderer.setStyle(rNode,prop,value,flags)}}}function writeDirectStyle(renderer,element,newValue){ngDevMode&&assertString(newValue,"'newValue' should be a string");renderer.setAttribute(element,"style",newValue);ngDevMode&&ngDevMode.rendererSetStyle++}function writeDirectClass(renderer,element,newValue){ngDevMode&&assertString(newValue,"'newValue' should be a string");if(newValue===""){renderer.removeAttribute(element,"class")}else{renderer.setAttribute(element,"class",newValue)}ngDevMode&&ngDevMode.rendererSetClassName++}function setupStaticAttributes(renderer,element,tNode){const{mergedAttrs:mergedAttrs,classes:classes,styles:styles}=tNode;if(mergedAttrs!==null){setUpAttributes(renderer,element,mergedAttrs)}if(classes!==null){writeDirectClass(renderer,element,classes)}if(styles!==null){writeDirectStyle(renderer,element,styles)}}const NO_CHANGE=typeof ngDevMode==="undefined"||ngDevMode?{__brand__:"NO_CHANGE"}:{};function \u0275\u0275advance(delta=1){ngDevMode&&assertGreaterThan(delta,0,"Can only advance forward");selectIndexInternal(getTView(),getLView(),getSelectedIndex()+delta,!!ngDevMode&&isInCheckNoChangesMode())}function selectIndexInternal(tView,lView,index,checkNoChangesMode){ngDevMode&&assertIndexInDeclRange(lView[TVIEW],index);if(!checkNoChangesMode){const hooksInitPhaseCompleted=(lView[FLAGS]&3)===3;if(hooksInitPhaseCompleted){const preOrderCheckHooks=tView.preOrderCheckHooks;if(preOrderCheckHooks!==null){executeCheckHooks(lView,preOrderCheckHooks,index)}}else{const preOrderHooks=tView.preOrderHooks;if(preOrderHooks!==null){executeInitAndCheckHooks(lView,preOrderHooks,0,index)}}}setSelectedIndex(index)}function \u0275\u0275directiveInject(token,flags=exports.InjectFlags.Default){const lView=getLView();if(lView===null){ngDevMode&&assertInjectImplementationNotEqual(\u0275\u0275directiveInject);return \u0275\u0275inject(token,flags)}const tNode=getCurrentTNode();const value=getOrCreateInjectable(tNode,lView,resolveForwardRef(token),flags);ngDevMode&&emitInjectEvent(token,value,flags);return value}function \u0275\u0275invalidFactory(){const msg=ngDevMode?`This constructor was not compatible with Dependency Injection.`:"invalid";throw new Error(msg)}function writeToDirectiveInput(def,instance,publicName,privateName,flags,value){const prevConsumer=signals.setActiveConsumer(null);try{let inputSignalNode=null;if((flags&exports.\u0275\u0275InputFlags.SignalBased)!==0){const field=instance[privateName];inputSignalNode=field[signals.SIGNAL]}if(inputSignalNode!==null&&inputSignalNode.transformFn!==undefined){value=inputSignalNode.transformFn(value)}if((flags&exports.\u0275\u0275InputFlags.HasDecoratorInputTransform)!==0){value=def.inputTransforms[privateName].call(instance,value)}if(def.setInput!==null){def.setInput(instance,inputSignalNode,value,publicName,privateName)}else{applyValueToInputField(instance,inputSignalNode,privateName,value)}}finally{signals.setActiveConsumer(prevConsumer)}}function processHostBindingOpCodes(tView,lView){const hostBindingOpCodes=tView.hostBindingOpCodes;if(hostBindingOpCodes===null)return;try{for(let i=0;i<hostBindingOpCodes.length;i++){const opCode=hostBindingOpCodes[i];if(opCode<0){setSelectedIndex(~opCode)}else{const directiveIdx=opCode;const bindingRootIndx=hostBindingOpCodes[++i];const hostBindingFn=hostBindingOpCodes[++i];setBindingRootForHostBindings(bindingRootIndx,directiveIdx);const context=lView[directiveIdx];hostBindingFn(2,context)}}}finally{setSelectedIndex(-1)}}function createLView(parentLView,tView,context,flags,host,tHostNode,environment,renderer,injector,embeddedViewInjector,hydrationInfo){const lView=tView.blueprint.slice();lView[HOST]=host;lView[FLAGS]=flags|4|128|8|64;if(embeddedViewInjector!==null||parentLView&&parentLView[FLAGS]&2048){lView[FLAGS]|=2048}resetPreOrderHookFlags(lView);ngDevMode&&tView.declTNode&&parentLView&&assertTNodeForLView(tView.declTNode,parentLView);lView[PARENT]=lView[DECLARATION_VIEW]=parentLView;lView[CONTEXT]=context;lView[ENVIRONMENT]=environment||parentLView&&parentLView[ENVIRONMENT];ngDevMode&&assertDefined(lView[ENVIRONMENT],"LViewEnvironment is required");lView[RENDERER]=renderer||parentLView&&parentLView[RENDERER];ngDevMode&&assertDefined(lView[RENDERER],"Renderer is required");lView[INJECTOR]=injector||parentLView&&parentLView[INJECTOR]||null;lView[T_HOST]=tHostNode;lView[ID]=getUniqueLViewId();lView[HYDRATION]=hydrationInfo;lView[EMBEDDED_VIEW_INJECTOR]=embeddedViewInjector;ngDevMode&&assertEqual(tView.type==2?parentLView!==null:true,true,"Embedded views must have parentLView");lView[DECLARATION_COMPONENT_VIEW]=tView.type==2?parentLView[DECLARATION_COMPONENT_VIEW]:lView;return lView}function getOrCreateTNode(tView,index,type,name,attrs){ngDevMode&&index!==0&&assertGreaterThanOrEqual(index,HEADER_OFFSET,"TNodes can't be in the LView header.");ngDevMode&&assertPureTNodeType(type);let tNode=tView.data[index];if(tNode===null){tNode=createTNodeAtIndex(tView,index,type,name,attrs);if(isInI18nBlock()){tNode.flags|=32}}else if(tNode.type&64){tNode.type=type;tNode.value=name;tNode.attrs=attrs;const parent=getCurrentParentTNode();tNode.injectorIndex=parent===null?-1:parent.injectorIndex;ngDevMode&&assertTNodeForTView(tNode,tView);ngDevMode&&assertEqual(index,tNode.index,"Expecting same index")}setCurrentTNode(tNode,true);return tNode}function createTNodeAtIndex(tView,index,type,name,attrs){const currentTNode=getCurrentTNodePlaceholderOk();const isParent=isCurrentTNodeParent();const parent=isParent?currentTNode:currentTNode&¤tTNode.parent;const tNode=tView.data[index]=createTNode(tView,parent,type,index,name,attrs);if(tView.firstChild===null){tView.firstChild=tNode}if(currentTNode!==null){if(isParent){if(currentTNode.child==null&&tNode.parent!==null){currentTNode.child=tNode}}else{if(currentTNode.next===null){currentTNode.next=tNode;tNode.prev=currentTNode}}}return tNode}function allocExpando(tView,lView,numSlotsToAlloc,initialValue){if(numSlotsToAlloc===0)return-1;if(ngDevMode){assertFirstCreatePass(tView);assertSame(tView,lView[TVIEW],"`LView` must be associated with `TView`!");assertEqual(tView.data.length,lView.length,"Expecting LView to be same size as TView");assertEqual(tView.data.length,tView.blueprint.length,"Expecting Blueprint to be same size as TView");assertFirstUpdatePass(tView)}const allocIdx=lView.length;for(let i=0;i<numSlotsToAlloc;i++){lView.push(initialValue);tView.blueprint.push(initialValue);tView.data.push(null)}return allocIdx}function executeTemplate(tView,lView,templateFn,rf,context){const prevSelectedIndex=getSelectedIndex();const isUpdatePhase=rf&2;try{setSelectedIndex(-1);if(isUpdatePhase&&lView.length>HEADER_OFFSET){selectIndexInternal(tView,lView,HEADER_OFFSET,!!ngDevMode&&isInCheckNoChangesMode())}const preHookType=isUpdatePhase?2:0;profiler(preHookType,context);templateFn(rf,context)}finally{setSelectedIndex(prevSelectedIndex);const postHookType=isUpdatePhase?3:1;profiler(postHookType,context)}}function executeContentQueries(tView,tNode,lView){if(isContentQueryHost(tNode)){const prevConsumer=signals.setActiveConsumer(null);try{const start=tNode.directiveStart;const end=tNode.directiveEnd;for(let directiveIndex=start;directiveIndex<end;directiveIndex++){const def=tView.data[directiveIndex];if(def.contentQueries){const directiveInstance=lView[directiveIndex];ngDevMode&&assertDefined(directiveIndex,"Incorrect reference to a directive defining a content query");def.contentQueries(1,directiveInstance,directiveIndex)}}}finally{signals.setActiveConsumer(prevConsumer)}}}function createDirectivesInstances(tView,lView,tNode){if(!getBindingsEnabled())return;instantiateAllDirectives(tView,lView,tNode,getNativeByTNode(tNode,lView));if((tNode.flags&64)===64){invokeDirectivesHostBindings(tView,lView,tNode)}}function saveResolvedLocalsInData(viewData,tNode,localRefExtractor=getNativeByTNode){const localNames=tNode.localNames;if(localNames!==null){let localIndex=tNode.index+1;for(let i=0;i<localNames.length;i+=2){const index=localNames[i+1];const value=index===-1?localRefExtractor(tNode,viewData):viewData[index];viewData[localIndex++]=value}}}function getOrCreateComponentTView(def){const tView=def.tView;if(tView===null||tView.incompleteFirstPass){const declTNode=null;return def.tView=createTView(1,declTNode,def.template,def.decls,def.vars,def.directiveDefs,def.pipeDefs,def.viewQuery,def.schemas,def.consts,def.id)}return tView}function createTView(type,declTNode,templateFn,decls,vars,directives,pipes,viewQuery,schemas,constsOrFactory,ssrId){ngDevMode&&ngDevMode.tView++;const bindingStartIndex=HEADER_OFFSET+decls;const initialViewLength=bindingStartIndex+vars;const blueprint=createViewBlueprint(bindingStartIndex,initialViewLength);const consts=typeof constsOrFactory==="function"?constsOrFactory():constsOrFactory;const tView=blueprint[TVIEW]={type:type,blueprint:blueprint,template:templateFn,queries:null,viewQuery:viewQuery,declTNode:declTNode,data:blueprint.slice().fill(null,bindingStartIndex),bindingStartIndex:bindingStartIndex,expandoStartIndex:initialViewLength,hostBindingOpCodes:null,firstCreatePass:true,firstUpdatePass:true,staticViewQueries:false,staticContentQueries:false,preOrderHooks:null,preOrderCheckHooks:null,contentHooks:null,contentCheckHooks:null,viewHooks:null,viewCheckHooks:null,destroyHooks:null,cleanup:null,contentQueries:null,components:null,directiveRegistry:typeof directives==="function"?directives():directives,pipeRegistry:typeof pipes==="function"?pipes():pipes,firstChild:null,schemas:schemas,consts:consts,incompleteFirstPass:false,ssrId:ssrId};if(ngDevMode){Object.seal(tView)}return tView}function createViewBlueprint(bindingStartIndex,initialViewLength){const blueprint=[];for(let i=0;i<initialViewLength;i++){blueprint.push(i<bindingStartIndex?null:NO_CHANGE)}return blueprint}function locateHostElement(renderer,elementOrSelector,encapsulation,injector){const preserveHostContent=injector.get(PRESERVE_HOST_CONTENT,PRESERVE_HOST_CONTENT_DEFAULT);const preserveContent=preserveHostContent||encapsulation===exports.ViewEncapsulation.ShadowDom;const rootElement=renderer.selectRootElement(elementOrSelector,preserveContent);applyRootElementTransform(rootElement);return rootElement}function applyRootElementTransform(rootElement){_applyRootElementTransformImpl(rootElement)}let _applyRootElementTransformImpl=()=>null;function applyRootElementTransformImpl(rootElement){if(hasSkipHydrationAttrOnRElement(rootElement)){clearElementContents(rootElement)}else{processTextNodeMarkersBeforeHydration(rootElement)}}function enableApplyRootElementTransformImpl(){_applyRootElementTransformImpl=applyRootElementTransformImpl}function storeCleanupWithContext(tView,lView,context,cleanupFn){const lCleanup=getOrCreateLViewCleanup(lView);ngDevMode&&assertDefined(context,"Cleanup context is mandatory when registering framework-level destroy hooks");lCleanup.push(context);if(tView.firstCreatePass){getOrCreateTViewCleanup(tView).push(cleanupFn,lCleanup.length-1)}else{if(ngDevMode){Object.freeze(getOrCreateTViewCleanup(tView))}}}function createTNode(tView,tParent,type,index,value,attrs){ngDevMode&&index!==0&&assertGreaterThanOrEqual(index,HEADER_OFFSET,"TNodes can't be in the LView header.");ngDevMode&&assertNotSame(attrs,undefined,"'undefined' is not valid value for 'attrs'");ngDevMode&&ngDevMode.tNode++;ngDevMode&&tParent&&assertTNodeForTView(tParent,tView);let injectorIndex=tParent?tParent.injectorIndex:-1;let flags=0;if(isInSkipHydrationBlock$1()){flags|=128}const tNode={type:type,index:index,insertBeforeIndex:null,injectorIndex:injectorIndex,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,propertyBindings:null,flags:flags,providerIndexes:0,value:value,attrs:attrs,mergedAttrs:null,localNames:null,initialInputs:undefined,inputs:null,outputs:null,tView:null,next:null,prev:null,projectionNext:null,child:null,parent:tParent,projection:null,styles:null,stylesWithoutHost:null,residualStyles:undefined,classes:null,classesWithoutHost:null,residualClasses:undefined,classBindings:0,styleBindings:0};if(ngDevMode){Object.seal(tNode)}return tNode}function captureNodeBindings(mode,aliasMap,directiveIndex,bindingsResult,hostDirectiveAliasMap){for(let publicName in aliasMap){if(!aliasMap.hasOwnProperty(publicName)){continue}const value=aliasMap[publicName];if(value===undefined){continue}bindingsResult??={};let internalName;let inputFlags=exports.\u0275\u0275InputFlags.None;if(Array.isArray(value)){internalName=value[0];inputFlags=value[1]}else{internalName=value}let finalPublicName=publicName;if(hostDirectiveAliasMap!==null){if(!hostDirectiveAliasMap.hasOwnProperty(publicName)){continue}finalPublicName=hostDirectiveAliasMap[publicName]}if(mode===0){addPropertyBinding(bindingsResult,directiveIndex,finalPublicName,internalName,inputFlags)}else{addPropertyBinding(bindingsResult,directiveIndex,finalPublicName,internalName)}}return bindingsResult}function addPropertyBinding(bindings,directiveIndex,publicName,internalName,inputFlags){let values;if(bindings.hasOwnProperty(publicName)){(values=bindings[publicName]).push(directiveIndex,internalName)}else{values=bindings[publicName]=[directiveIndex,internalName]}if(inputFlags!==undefined){values.push(inputFlags)}}function initializeInputAndOutputAliases(tView,tNode,hostDirectiveDefinitionMap){ngDevMode&&assertFirstCreatePass(tView);const start=tNode.directiveStart;const end=tNode.directiveEnd;const tViewData=tView.data;const tNodeAttrs=tNode.attrs;const inputsFromAttrs=[];let inputsStore=null;let outputsStore=null;for(let directiveIndex=start;directiveIndex<end;directiveIndex++){const directiveDef=tViewData[directiveIndex];const aliasData=hostDirectiveDefinitionMap?hostDirectiveDefinitionMap.get(directiveDef):null;const aliasedInputs=aliasData?aliasData.inputs:null;const aliasedOutputs=aliasData?aliasData.outputs:null;inputsStore=captureNodeBindings(0,directiveDef.inputs,directiveIndex,inputsStore,aliasedInputs);outputsStore=captureNodeBindings(1,directiveDef.outputs,directiveIndex,outputsStore,aliasedOutputs);const initialInputs=inputsStore!==null&&tNodeAttrs!==null&&!isInlineTemplate(tNode)?generateInitialInputs(inputsStore,directiveIndex,tNodeAttrs):null;inputsFromAttrs.push(initialInputs)}if(inputsStore!==null){if(inputsStore.hasOwnProperty("class")){tNode.flags|=8}if(inputsStore.hasOwnProperty("style")){tNode.flags|=16}}tNode.initialInputs=inputsFromAttrs;tNode.inputs=inputsStore;tNode.outputs=outputsStore}function mapPropName(name){if(name==="class")return"className";if(name==="for")return"htmlFor";if(name==="formaction")return"formAction";if(name==="innerHtml")return"innerHTML";if(name==="readonly")return"readOnly";if(name==="tabindex")return"tabIndex";return name}function elementPropertyInternal(tView,tNode,lView,propName,value,renderer,sanitizer,nativeOnly){ngDevMode&&assertNotSame(value,NO_CHANGE,"Incoming value should never be NO_CHANGE.");const element=getNativeByTNode(tNode,lView);let inputData=tNode.inputs;let dataValue;if(!nativeOnly&&inputData!=null&&(dataValue=inputData[propName])){setInputsForProperty(tView,lView,dataValue,propName,value);if(isComponentHost(tNode))markDirtyIfOnPush(lView,tNode.index);if(ngDevMode){setNgReflectProperties(lView,element,tNode.type,dataValue,value)}}else if(tNode.type&3){propName=mapPropName(propName);if(ngDevMode){validateAgainstEventProperties(propName);if(!isPropertyValid(element,propName,tNode.value,tView.schemas)){handleUnknownPropertyError(propName,tNode.value,tNode.type,lView)}ngDevMode.rendererSetProperty++}value=sanitizer!=null?sanitizer(value,tNode.value||"",propName):value;renderer.setProperty(element,propName,value)}else if(tNode.type&12){if(ngDevMode&&!matchingSchemas(tView.schemas,tNode.value)){handleUnknownPropertyError(propName,tNode.value,tNode.type,lView)}}}function markDirtyIfOnPush(lView,viewIndex){ngDevMode&&assertLView(lView);const childComponentLView=getComponentLViewByIndex(viewIndex,lView);if(!(childComponentLView[FLAGS]&16)){childComponentLView[FLAGS]|=64}}function setNgReflectProperty(lView,element,type,attrName,value){const renderer=lView[RENDERER];attrName=normalizeDebugBindingName(attrName);const debugValue=normalizeDebugBindingValue(value);if(type&3){if(value==null){renderer.removeAttribute(element,attrName)}else{renderer.setAttribute(element,attrName,debugValue)}}else{const textContent=escapeCommentText(`bindings=${JSON.stringify({[attrName]:debugValue},null,2)}`);renderer.setValue(element,textContent)}}function setNgReflectProperties(lView,element,type,dataValue,value){if(type&(3|4)){for(let i=0;i<dataValue.length;i+=3){setNgReflectProperty(lView,element,type,dataValue[i+1],value)}}}function resolveDirectives(tView,lView,tNode,localRefs){ngDevMode&&assertFirstCreatePass(tView);if(getBindingsEnabled()){const exportsMap=localRefs===null?null:{"":-1};const matchResult=findDirectiveDefMatches(tView,tNode);let directiveDefs;let hostDirectiveDefs;if(matchResult===null){directiveDefs=hostDirectiveDefs=null}else{[directiveDefs,hostDirectiveDefs]=matchResult}if(directiveDefs!==null){initializeDirectives(tView,lView,tNode,directiveDefs,exportsMap,hostDirectiveDefs)}if(exportsMap)cacheMatchingLocalNames(tNode,localRefs,exportsMap)}tNode.mergedAttrs=mergeHostAttrs(tNode.mergedAttrs,tNode.attrs)}function initializeDirectives(tView,lView,tNode,directives,exportsMap,hostDirectiveDefs){ngDevMode&&assertFirstCreatePass(tView);for(let i=0;i<directives.length;i++){diPublicInInjector(getOrCreateNodeInjectorForNode(tNode,lView),tView,directives[i].type)}initTNodeFlags(tNode,tView.data.length,directives.length);for(let i=0;i<directives.length;i++){const def=directives[i];if(def.providersResolver)def.providersResolver(def)}let preOrderHooksFound=false;let preOrderCheckHooksFound=false;let directiveIdx=allocExpando(tView,lView,directives.length,null);ngDevMode&&assertSame(directiveIdx,tNode.directiveStart,"TNode.directiveStart should point to just allocated space");for(let i=0;i<directives.length;i++){const def=directives[i];tNode.mergedAttrs=mergeHostAttrs(tNode.mergedAttrs,def.hostAttrs);configureViewWithDirective(tView,tNode,lView,directiveIdx,def);saveNameToExportMap(directiveIdx,def,exportsMap);if(def.contentQueries!==null)tNode.flags|=4;if(def.hostBindings!==null||def.hostAttrs!==null||def.hostVars!==0)tNode.flags|=64;const lifeCycleHooks=def.type.prototype;if(!preOrderHooksFound&&(lifeCycleHooks.ngOnChanges||lifeCycleHooks.ngOnInit||lifeCycleHooks.ngDoCheck)){(tView.preOrderHooks??=[]).push(tNode.index);preOrderHooksFound=true}if(!preOrderCheckHooksFound&&(lifeCycleHooks.ngOnChanges||lifeCycleHooks.ngDoCheck)){(tView.preOrderCheckHooks??=[]).push(tNode.index);preOrderCheckHooksFound=true}directiveIdx++}initializeInputAndOutputAliases(tView,tNode,hostDirectiveDefs)}function registerHostBindingOpCodes(tView,tNode,directiveIdx,directiveVarsIdx,def){ngDevMode&&assertFirstCreatePass(tView);const hostBindings=def.hostBindings;if(hostBindings){let hostBindingOpCodes=tView.hostBindingOpCodes;if(hostBindingOpCodes===null){hostBindingOpCodes=tView.hostBindingOpCodes=[]}const elementIndx=~tNode.index;if(lastSelectedElementIdx(hostBindingOpCodes)!=elementIndx){hostBindingOpCodes.push(elementIndx)}hostBindingOpCodes.push(directiveIdx,directiveVarsIdx,hostBindings)}}function lastSelectedElementIdx(hostBindingOpCodes){let i=hostBindingOpCodes.length;while(i>0){const value=hostBindingOpCodes[--i];if(typeof value==="number"&&value<0){return value}}return 0}function instantiateAllDirectives(tView,lView,tNode,native){const start=tNode.directiveStart;const end=tNode.directiveEnd;if(isComponentHost(tNode)){ngDevMode&&assertTNodeType(tNode,3);addComponentLogic(lView,tNode,tView.data[start+tNode.componentOffset])}if(!tView.firstCreatePass){getOrCreateNodeInjectorForNode(tNode,lView)}attachPatchData(native,lView);const initialInputs=tNode.initialInputs;for(let i=start;i<end;i++){const def=tView.data[i];const directive=getNodeInjectable(lView,tView,i,tNode);attachPatchData(directive,lView);if(initialInputs!==null){setInputsFromAttrs(lView,i-start,directive,def,tNode,initialInputs)}if(isComponentDef(def)){const componentView=getComponentLViewByIndex(tNode.index,lView);componentView[CONTEXT]=getNodeInjectable(lView,tView,i,tNode)}}}function invokeDirectivesHostBindings(tView,lView,tNode){const start=tNode.directiveStart;const end=tNode.directiveEnd;const elementIndex=tNode.index;const currentDirectiveIndex=getCurrentDirectiveIndex();try{setSelectedIndex(elementIndex);for(let dirIndex=start;dirIndex<end;dirIndex++){const def=tView.data[dirIndex];const directive=lView[dirIndex];setCurrentDirectiveIndex(dirIndex);if(def.hostBindings!==null||def.hostVars!==0||def.hostAttrs!==null){invokeHostBindingsInCreationMode(def,directive)}}}finally{setSelectedIndex(-1);setCurrentDirectiveIndex(currentDirectiveIndex)}}function invokeHostBindingsInCreationMode(def,directive){if(def.hostBindings!==null){def.hostBindings(1,directive)}}function findDirectiveDefMatches(tView,tNode){ngDevMode&&assertFirstCreatePass(tView);ngDevMode&&assertTNodeType(tNode,3|12);const registry=tView.directiveRegistry;let matches=null;let hostDirectiveDefs=null;if(registry){for(let i=0;i<registry.length;i++){const def=registry[i];if(isNodeMatchingSelectorList(tNode,def.selectors,false)){matches||(matches=[]);if(isComponentDef(def)){if(ngDevMode){assertTNodeType(tNode,2,`"${tNode.value}" tags cannot be used as component hosts. `+`Please use a different tag to activate the ${stringify(def.type)} component.`);if(isComponentHost(tNode)){throwMultipleComponentError(tNode,matches.find(isComponentDef).type,def.type)}}if(def.findHostDirectiveDefs!==null){const hostDirectiveMatches=[];hostDirectiveDefs=hostDirectiveDefs||new Map;def.findHostDirectiveDefs(def,hostDirectiveMatches,hostDirectiveDefs);matches.unshift(...hostDirectiveMatches,def);const componentOffset=hostDirectiveMatches.length;markAsComponentHost(tView,tNode,componentOffset)}else{matches.unshift(def);markAsComponentHost(tView,tNode,0)}}else{hostDirectiveDefs=hostDirectiveDefs||new Map;def.findHostDirectiveDefs?.(def,matches,hostDirectiveDefs);matches.push(def)}}}}ngDevMode&&matches!==null&&assertNoDuplicateDirectives(matches);return matches===null?null:[matches,hostDirectiveDefs]}function markAsComponentHost(tView,hostTNode,componentOffset){ngDevMode&&assertFirstCreatePass(tView);ngDevMode&&assertGreaterThan(componentOffset,-1,"componentOffset must be great than -1");hostTNode.componentOffset=componentOffset;(tView.components??=[]).push(hostTNode.index)}function cacheMatchingLocalNames(tNode,localRefs,exportsMap){if(localRefs){const localNames=tNode.localNames=[];for(let i=0;i<localRefs.length;i+=2){const index=exportsMap[localRefs[i+1]];if(index==null)throw new RuntimeError(-301,ngDevMode&&`Export of name '${localRefs[i+1]}' not found!`);localNames.push(localRefs[i],index)}}}function saveNameToExportMap(directiveIdx,def,exportsMap){if(exportsMap){if(def.exportAs){for(let i=0;i<def.exportAs.length;i++){exportsMap[def.exportAs[i]]=directiveIdx}}if(isComponentDef(def))exportsMap[""]=directiveIdx}}function initTNodeFlags(tNode,index,numberOfDirectives){ngDevMode&&assertNotEqual(numberOfDirectives,tNode.directiveEnd-tNode.directiveStart,"Reached the max number of directives");tNode.flags|=1;tNode.directiveStart=index;tNode.directiveEnd=index+numberOfDirectives;tNode.providerIndexes=index}function configureViewWithDirective(tView,tNode,lView,directiveIndex,def){ngDevMode&&assertGreaterThanOrEqual(directiveIndex,HEADER_OFFSET,"Must be in Expando section");tView.data[directiveIndex]=def;const directiveFactory=def.factory||(def.factory=getFactoryDef(def.type,true));const nodeInjectorFactory=new NodeInjectorFactory(directiveFactory,isComponentDef(def),\u0275\u0275directiveInject);tView.blueprint[directiveIndex]=nodeInjectorFactory;lView[directiveIndex]=nodeInjectorFactory;registerHostBindingOpCodes(tView,tNode,directiveIndex,allocExpando(tView,lView,def.hostVars,NO_CHANGE),def)}function addComponentLogic(lView,hostTNode,def){const native=getNativeByTNode(hostTNode,lView);const tView=getOrCreateComponentTView(def);const rendererFactory=lView[ENVIRONMENT].rendererFactory;let lViewFlags=16;if(def.signals){lViewFlags=4096}else if(def.onPush){lViewFlags=64}const componentView=addToViewTree(lView,createLView(lView,tView,null,lViewFlags,native,hostTNode,null,rendererFactory.createRenderer(native,def),null,null,null));lView[hostTNode.index]=componentView}function elementAttributeInternal(tNode,lView,name,value,sanitizer,namespace){if(ngDevMode){assertNotSame(value,NO_CHANGE,"Incoming value should never be NO_CHANGE.");validateAgainstEventAttributes(name);assertTNodeType(tNode,2,`Attempted to set attribute \`${name}\` on a container node. `+`Host bindings are not valid on ng-container or ng-template.`)}const element=getNativeByTNode(tNode,lView);setElementAttribute(lView[RENDERER],element,namespace,tNode.value,name,value,sanitizer)}function setElementAttribute(renderer,element,namespace,tagName,name,value,sanitizer){if(value==null){ngDevMode&&ngDevMode.rendererRemoveAttribute++;renderer.removeAttribute(element,name,namespace)}else{ngDevMode&&ngDevMode.rendererSetAttribute++;const strValue=sanitizer==null?renderStringify(value):sanitizer(value,tagName||"",name);renderer.setAttribute(element,name,strValue,namespace)}}function setInputsFromAttrs(lView,directiveIndex,instance,def,tNode,initialInputData){const initialInputs=initialInputData[directiveIndex];if(initialInputs!==null){for(let i=0;i<initialInputs.length;){const publicName=initialInputs[i++];const privateName=initialInputs[i++];const flags=initialInputs[i++];const value=initialInputs[i++];writeToDirectiveInput(def,instance,publicName,privateName,flags,value);if(ngDevMode){const nativeElement=getNativeByTNode(tNode,lView);setNgReflectProperty(lView,nativeElement,tNode.type,privateName,value)}}}}function generateInitialInputs(inputs,directiveIndex,attrs){let inputsToStore=null;let i=0;while(i<attrs.length){const attrName=attrs[i];if(attrName===0){i+=4;continue}else if(attrName===5){i+=2;continue}if(typeof attrName==="number")break;if(inputs.hasOwnProperty(attrName)){if(inputsToStore===null)inputsToStore=[];const inputConfig=inputs[attrName];for(let j=0;j<inputConfig.length;j+=3){if(inputConfig[j]===directiveIndex){inputsToStore.push(attrName,inputConfig[j+1],inputConfig[j+2],attrs[i+1]);break}}}i+=2}return inputsToStore}function createLContainer(hostNative,currentView,native,tNode){ngDevMode&&assertLView(currentView);const lContainer=[hostNative,true,0,currentView,null,tNode,null,native,null,null];ngDevMode&&assertEqual(lContainer.length,CONTAINER_HEADER_OFFSET,"Should allocate correct number of slots for LContainer header.");return lContainer}function refreshContentQueries(tView,lView){const contentQueries=tView.contentQueries;if(contentQueries!==null){const prevConsumer=signals.setActiveConsumer(null);try{for(let i=0;i<contentQueries.length;i+=2){const queryStartIdx=contentQueries[i];const directiveDefIdx=contentQueries[i+1];if(directiveDefIdx!==-1){const directiveDef=tView.data[directiveDefIdx];ngDevMode&&assertDefined(directiveDef,"DirectiveDef not found.");ngDevMode&&assertDefined(directiveDef.contentQueries,"contentQueries function should be defined");setCurrentQueryIndex(queryStartIdx);directiveDef.contentQueries(2,lView[directiveDefIdx],directiveDefIdx)}}}finally{signals.setActiveConsumer(prevConsumer)}}}function addToViewTree(lView,lViewOrLContainer){if(lView[CHILD_HEAD]){lView[CHILD_TAIL][NEXT]=lViewOrLContainer}else{lView[CHILD_HEAD]=lViewOrLContainer}lView[CHILD_TAIL]=lViewOrLContainer;return lViewOrLContainer}function executeViewQueryFn(flags,viewQueryFn,component){ngDevMode&&assertDefined(viewQueryFn,"View queries function to execute must be defined.");setCurrentQueryIndex(0);const prevConsumer=signals.setActiveConsumer(null);try{viewQueryFn(flags,component)}finally{signals.setActiveConsumer(prevConsumer)}}function storePropertyBindingMetadata(tData,tNode,propertyName,bindingIndex,...interpolationParts){if(tData[bindingIndex]===null){if(tNode.inputs==null||!tNode.inputs[propertyName]){const propBindingIdxs=tNode.propertyBindings||(tNode.propertyBindings=[]);propBindingIdxs.push(bindingIndex);let bindingMetadata=propertyName;if(interpolationParts.length>0){bindingMetadata+=INTERPOLATION_DELIMITER+interpolationParts.join(INTERPOLATION_DELIMITER)}tData[bindingIndex]=bindingMetadata}}}function getOrCreateLViewCleanup(view){return view[CLEANUP]||(view[CLEANUP]=[])}function getOrCreateTViewCleanup(tView){return tView.cleanup||(tView.cleanup=[])}function loadComponentRenderer(currentDef,tNode,lView){if(currentDef===null||isComponentDef(currentDef)){lView=unwrapLView(lView[tNode.index])}return lView[RENDERER]}function handleError(lView,error){const injector=lView[INJECTOR];const errorHandler=injector?injector.get(ErrorHandler,null):null;errorHandler&&errorHandler.handleError(error)}function setInputsForProperty(tView,lView,inputs,publicName,value){for(let i=0;i<inputs.length;){const index=inputs[i++];const privateName=inputs[i++];const flags=inputs[i++];const instance=lView[index];ngDevMode&&assertIndexInRange(lView,index);const def=tView.data[index];writeToDirectiveInput(def,instance,publicName,privateName,flags,value)}}function textBindingInternal(lView,index,value){ngDevMode&&assertString(value,"Value should be a string");ngDevMode&&assertNotSame(value,NO_CHANGE,"value should not be NO_CHANGE");ngDevMode&&assertIndexInRange(lView,index);const element=getNativeByIndex(index,lView);ngDevMode&&assertDefined(element,"native element should exist");updateTextNode(lView[RENDERER],element,value)}function renderComponent(hostLView,componentHostIdx){ngDevMode&&assertEqual(isCreationMode(hostLView),true,"Should be run in creation mode");const componentView=getComponentLViewByIndex(componentHostIdx,hostLView);const componentTView=componentView[TVIEW];syncViewWithBlueprint(componentTView,componentView);const hostRNode=componentView[HOST];if(hostRNode!==null&&componentView[HYDRATION]===null){componentView[HYDRATION]=retrieveHydrationInfo(hostRNode,componentView[INJECTOR])}renderView(componentTView,componentView,componentView[CONTEXT])}function syncViewWithBlueprint(tView,lView){for(let i=lView.length;i<tView.blueprint.length;i++){lView.push(tView.blueprint[i])}}function renderView(tView,lView,context){ngDevMode&&assertEqual(isCreationMode(lView),true,"Should be run in creation mode");ngDevMode&&assertNotReactive(renderView.name);enterView(lView);try{const viewQuery=tView.viewQuery;if(viewQuery!==null){executeViewQueryFn(1,viewQuery,context)}const templateFn=tView.template;if(templateFn!==null){executeTemplate(tView,lView,templateFn,1,context)}if(tView.firstCreatePass){tView.firstCreatePass=false}lView[QUERIES]?.finishViewCreation(tView);if(tView.staticContentQueries){refreshContentQueries(tView,lView)}if(tView.staticViewQueries){executeViewQueryFn(2,tView.viewQuery,context)}const components=tView.components;if(components!==null){renderChildComponents(lView,components)}}catch(error){if(tView.firstCreatePass){tView.incompleteFirstPass=true;tView.firstCreatePass=false}throw error}finally{lView[FLAGS]&=~4;leaveView()}}function renderChildComponents(hostLView,components){for(let i=0;i<components.length;i++){renderComponent(hostLView,components[i])}}function createAndRenderEmbeddedLView(declarationLView,templateTNode,context,options){const prevConsumer=signals.setActiveConsumer(null);try{const embeddedTView=templateTNode.tView;ngDevMode&&assertDefined(embeddedTView,"TView must be defined for a template node.");ngDevMode&&assertTNodeForLView(templateTNode,declarationLView);const isSignalView=declarationLView[FLAGS]&4096;const viewFlags=isSignalView?4096:16;const embeddedLView=createLView(declarationLView,embeddedTView,context,viewFlags,null,templateTNode,null,null,options?.injector??null,options?.embeddedViewInjector??null,options?.dehydratedView??null);const declarationLContainer=declarationLView[templateTNode.index];ngDevMode&&assertLContainer(declarationLContainer);embeddedLView[DECLARATION_LCONTAINER]=declarationLContainer;const declarationViewLQueries=declarationLView[QUERIES];if(declarationViewLQueries!==null){embeddedLView[QUERIES]=declarationViewLQueries.createEmbeddedView(embeddedTView)}renderView(embeddedTView,embeddedLView,context);return embeddedLView}finally{signals.setActiveConsumer(prevConsumer)}}function getLViewFromLContainer(lContainer,index){const adjustedIndex=CONTAINER_HEADER_OFFSET+index;if(adjustedIndex<lContainer.length){const lView=lContainer[adjustedIndex];ngDevMode&&assertLView(lView);return lView}return undefined}function shouldAddViewToDom(tNode,dehydratedView){return!dehydratedView||dehydratedView.firstChild===null||hasInSkipHydrationBlockFlag(tNode)}function addLViewToLContainer(lContainer,lView,index,addToDOM=true){const tView=lView[TVIEW];insertView(tView,lView,lContainer,index);if(addToDOM){const beforeNode=getBeforeNodeForView(index,lContainer);const renderer=lView[RENDERER];const parentRNode=nativeParentNode(renderer,lContainer[NATIVE]);if(parentRNode!==null){addViewToDOM(tView,lContainer[T_HOST],renderer,lView,parentRNode,beforeNode)}}const hydrationInfo=lView[HYDRATION];if(hydrationInfo!==null&&hydrationInfo.firstChild!==null){hydrationInfo.firstChild=null}}function removeLViewFromLContainer(lContainer,index){const lView=detachView(lContainer,index);if(lView!==undefined){destroyLView(lView[TVIEW],lView)}return lView}function collectNativeNodes(tView,lView,tNode,result,isProjection=false){while(tNode!==null){ngDevMode&&assertTNodeType(tNode,3|12|16|32);const lNode=lView[tNode.index];if(lNode!==null){result.push(unwrapRNode(lNode))}if(isLContainer(lNode)){collectNativeNodesInLContainer(lNode,result)}const tNodeType=tNode.type;if(tNodeType&8){collectNativeNodes(tView,lView,tNode.child,result)}else if(tNodeType&32){const nextRNode=icuContainerIterate(tNode,lView);let rNode;while(rNode=nextRNode()){result.push(rNode)}}else if(tNodeType&16){const nodesInSlot=getProjectionNodes(lView,tNode);if(Array.isArray(nodesInSlot)){result.push(...nodesInSlot)}else{const parentView=getLViewParent(lView[DECLARATION_COMPONENT_VIEW]);ngDevMode&&assertParentView(parentView);collectNativeNodes(parentView[TVIEW],parentView,nodesInSlot,result,true)}}tNode=isProjection?tNode.projectionNext:tNode.next}return result}function collectNativeNodesInLContainer(lContainer,result){for(let i=CONTAINER_HEADER_OFFSET;i<lContainer.length;i++){const lViewInAContainer=lContainer[i];const lViewFirstChildTNode=lViewInAContainer[TVIEW].firstChild;if(lViewFirstChildTNode!==null){collectNativeNodes(lViewInAContainer[TVIEW],lViewInAContainer,lViewFirstChildTNode,result)}}if(lContainer[NATIVE]!==lContainer[HOST]){result.push(lContainer[NATIVE])}}let freeConsumers=[];function getOrBorrowReactiveLViewConsumer(lView){return lView[REACTIVE_TEMPLATE_CONSUMER]??borrowReactiveLViewConsumer(lView)}function borrowReactiveLViewConsumer(lView){const consumer=freeConsumers.pop()??Object.create(REACTIVE_LVIEW_CONSUMER_NODE);consumer.lView=lView;return consumer}function maybeReturnReactiveLViewConsumer(consumer){if(consumer.lView[REACTIVE_TEMPLATE_CONSUMER]===consumer){return}consumer.lView=null;freeConsumers.push(consumer)}const REACTIVE_LVIEW_CONSUMER_NODE={...signals.REACTIVE_NODE,consumerIsAlwaysLive:true,consumerMarkedDirty:node=>{markAncestorsForTraversal(node.lView)},consumerOnSignalRead(){this.lView[REACTIVE_TEMPLATE_CONSUMER]=this}};const MAXIMUM_REFRESH_RERUNS=100;function detectChangesInternal(lView,notifyErrorHandler=true,mode=0){const environment=lView[ENVIRONMENT];const rendererFactory=environment.rendererFactory;const checkNoChangesMode=!!ngDevMode&&isInCheckNoChangesMode();if(!checkNoChangesMode){rendererFactory.begin?.()}try{detectChangesInViewWhileDirty(lView,mode)}catch(error){if(notifyErrorHandler){handleError(lView,error)}throw error}finally{if(!checkNoChangesMode){rendererFactory.end?.();environment.inlineEffectRunner?.flush()}}}function detectChangesInViewWhileDirty(lView,mode){detectChangesInView$1(lView,mode);let retries=0;while(requiresRefreshOrTraversal(lView)){if(retries===MAXIMUM_REFRESH_RERUNS){throw new RuntimeError(103,ngDevMode&&"Infinite change detection while trying to refresh views. "+"There may be components which each cause the other to require a refresh, "+"causing an infinite loop.")}retries++;detectChangesInView$1(lView,1)}}function checkNoChangesInternal(lView,notifyErrorHandler=true){setIsInCheckNoChangesMode(true);try{detectChangesInternal(lView,notifyErrorHandler)}finally{setIsInCheckNoChangesMode(false)}}function refreshView(tView,lView,templateFn,context){ngDevMode&&assertEqual(isCreationMode(lView),false,"Should be run in update mode");const flags=lView[FLAGS];if((flags&256)===256)return;const isInCheckNoChangesPass=ngDevMode&&isInCheckNoChangesMode();!isInCheckNoChangesPass&&lView[ENVIRONMENT].inlineEffectRunner?.flush();enterView(lView);let prevConsumer=null;let currentConsumer=null;if(!isInCheckNoChangesPass&&viewShouldHaveReactiveConsumer(tView)){currentConsumer=getOrBorrowReactiveLViewConsumer(lView);prevConsumer=signals.consumerBeforeComputation(currentConsumer)}try{resetPreOrderHookFlags(lView);setBindingIndex(tView.bindingStartIndex);if(templateFn!==null){executeTemplate(tView,lView,templateFn,2,context)}const hooksInitPhaseCompleted=(flags&3)===3;if(!isInCheckNoChangesPass){if(hooksInitPhaseCompleted){const preOrderCheckHooks=tView.preOrderCheckHooks;if(preOrderCheckHooks!==null){executeCheckHooks(lView,preOrderCheckHooks,null)}}else{const preOrderHooks=tView.preOrderHooks;if(preOrderHooks!==null){executeInitAndCheckHooks(lView,preOrderHooks,0,null)}incrementInitPhaseFlags(lView,0)}}markTransplantedViewsForRefresh(lView);detectChangesInEmbeddedViews(lView,0);if(tView.contentQueries!==null){refreshContentQueries(tView,lView)}if(!isInCheckNoChangesPass){if(hooksInitPhaseCompleted){const contentCheckHooks=tView.contentCheckHooks;if(contentCheckHooks!==null){executeCheckHooks(lView,contentCheckHooks)}}else{const contentHooks=tView.contentHooks;if(contentHooks!==null){executeInitAndCheckHooks(lView,contentHooks,1)}incrementInitPhaseFlags(lView,1)}}processHostBindingOpCodes(tView,lView);const components=tView.components;if(components!==null){detectChangesInChildComponents(lView,components,0)}const viewQuery=tView.viewQuery;if(viewQuery!==null){executeViewQueryFn(2,viewQuery,context)}if(!isInCheckNoChangesPass){if(hooksInitPhaseCompleted){const viewCheckHooks=tView.viewCheckHooks;if(viewCheckHooks!==null){executeCheckHooks(lView,viewCheckHooks)}}else{const viewHooks=tView.viewHooks;if(viewHooks!==null){executeInitAndCheckHooks(lView,viewHooks,2)}incrementInitPhaseFlags(lView,2)}}if(tView.firstUpdatePass===true){tView.firstUpdatePass=false}if(lView[EFFECTS_TO_SCHEDULE]){for(const notifyEffect of lView[EFFECTS_TO_SCHEDULE]){notifyEffect()}lView[EFFECTS_TO_SCHEDULE]=null}if(!isInCheckNoChangesPass){lView[FLAGS]&=~(64|8)}}catch(e){markAncestorsForTraversal(lView);throw e}finally{if(currentConsumer!==null){signals.consumerAfterComputation(currentConsumer,prevConsumer);maybeReturnReactiveLViewConsumer(currentConsumer)}leaveView()}}function viewShouldHaveReactiveConsumer(tView){return tView.type!==2}function detectChangesInEmbeddedViews(lView,mode){for(let lContainer=getFirstLContainer(lView);lContainer!==null;lContainer=getNextLContainer(lContainer)){for(let i=CONTAINER_HEADER_OFFSET;i<lContainer.length;i++){const embeddedLView=lContainer[i];detectChangesInViewIfAttached(embeddedLView,mode)}}}function markTransplantedViewsForRefresh(lView){for(let lContainer=getFirstLContainer(lView);lContainer!==null;lContainer=getNextLContainer(lContainer)){if(!(lContainer[FLAGS]&LContainerFlags.HasTransplantedViews))continue;const movedViews=lContainer[MOVED_VIEWS];ngDevMode&&assertDefined(movedViews,"Transplanted View flags set but missing MOVED_VIEWS");for(let i=0;i<movedViews.length;i++){const movedLView=movedViews[i];const insertionLContainer=movedLView[PARENT];ngDevMode&&assertLContainer(insertionLContainer);markViewForRefresh(movedLView)}}}function detectChangesInComponent(hostLView,componentHostIdx,mode){ngDevMode&&assertEqual(isCreationMode(hostLView),false,"Should be run in update mode");const componentView=getComponentLViewByIndex(componentHostIdx,hostLView);detectChangesInViewIfAttached(componentView,mode)}function detectChangesInViewIfAttached(lView,mode){if(!viewAttachedToChangeDetector(lView)){return}detectChangesInView$1(lView,mode)}function detectChangesInView$1(lView,mode){const isInCheckNoChangesPass=ngDevMode&&isInCheckNoChangesMode();const tView=lView[TVIEW];const flags=lView[FLAGS];const consumer=lView[REACTIVE_TEMPLATE_CONSUMER];let shouldRefreshView=!!(mode===0&&flags&16);shouldRefreshView||=!!(flags&64&&mode===0&&!isInCheckNoChangesPass);shouldRefreshView||=!!(flags&1024);shouldRefreshView||=!!(consumer?.dirty&&signals.consumerPollProducersForChange(consumer));if(consumer){consumer.dirty=false}lView[FLAGS]&=~(8192|1024);if(shouldRefreshView){refreshView(tView,lView,tView.template,lView[CONTEXT])}else if(flags&8192){detectChangesInEmbeddedViews(lView,1);const components=tView.components;if(components!==null){detectChangesInChildComponents(lView,components,1)}}}function detectChangesInChildComponents(hostLView,components,mode){for(let i=0;i<components.length;i++){detectChangesInComponent(hostLView,components[i],mode)}}function markViewDirty(lView){lView[ENVIRONMENT].changeDetectionScheduler?.notify();while(lView){lView[FLAGS]|=64;const parent=getLViewParent(lView);if(isRootView(lView)&&!parent){return lView}lView=parent}return null}class ViewRef$1{get rootNodes(){const lView=this._lView;const tView=lView[TVIEW];return collectNativeNodes(tView,lView,tView.firstChild,[])}constructor(_lView,_cdRefInjectingView,notifyErrorHandler=true){this._lView=_lView;this._cdRefInjectingView=_cdRefInjectingView;this.notifyErrorHandler=notifyErrorHandler;this._appRef=null;this._attachedToViewContainer=false}get context(){return this._lView[CONTEXT]}set context(value){if(ngDevMode){console.warn("Angular: Replacing the `context` object of an `EmbeddedViewRef` is deprecated.")}this._lView[CONTEXT]=value}get destroyed(){return(this._lView[FLAGS]&256)===256}destroy(){if(this._appRef){this._appRef.detachView(this)}else if(this._attachedToViewContainer){const parent=this._lView[PARENT];if(isLContainer(parent)){const viewRefs=parent[VIEW_REFS];const index=viewRefs?viewRefs.indexOf(this):-1;if(index>-1){ngDevMode&&assertEqual(index,parent.indexOf(this._lView)-CONTAINER_HEADER_OFFSET,"An attached view should be in the same position within its container as its ViewRef in the VIEW_REFS array.");detachView(parent,index);removeFromArray(viewRefs,index)}}this._attachedToViewContainer=false}destroyLView(this._lView[TVIEW],this._lView)}onDestroy(callback){storeLViewOnDestroy(this._lView,callback)}markForCheck(){markViewDirty(this._cdRefInjectingView||this._lView)}detach(){this._lView[FLAGS]&=~128}reattach(){updateAncestorTraversalFlagsOnAttach(this._lView);this._lView[FLAGS]|=128}detectChanges(){this._lView[FLAGS]|=1024;detectChangesInternal(this._lView,this.notifyErrorHandler)}checkNoChanges(){if(ngDevMode){checkNoChangesInternal(this._lView,this.notifyErrorHandler)}}attachToViewContainerRef(){if(this._appRef){throw new RuntimeError(902,ngDevMode&&"This view is already attached directly to the ApplicationRef!")}this._attachedToViewContainer=true}detachFromAppRef(){this._appRef=null;detachViewFromDOM(this._lView[TVIEW],this._lView)}attachToAppRef(appRef){if(this._attachedToViewContainer){throw new RuntimeError(902,ngDevMode&&"This view is already attached to a ViewContainer!")}this._appRef=appRef;updateAncestorTraversalFlagsOnAttach(this._lView)}}class TemplateRef{static{this.__NG_ELEMENT_ID__=injectTemplateRef}}const ViewEngineTemplateRef=TemplateRef;const R3TemplateRef=class TemplateRef extends ViewEngineTemplateRef{constructor(_declarationLView,_declarationTContainer,elementRef){super();this._declarationLView=_declarationLView;this._declarationTContainer=_declarationTContainer;this.elementRef=elementRef}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(context,injector){return this.createEmbeddedViewImpl(context,injector)}createEmbeddedViewImpl(context,injector,dehydratedView){const embeddedLView=createAndRenderEmbeddedLView(this._declarationLView,this._declarationTContainer,context,{embeddedViewInjector:injector,dehydratedView:dehydratedView});return new ViewRef$1(embeddedLView)}};function injectTemplateRef(){return createTemplateRef(getCurrentTNode(),getLView())}function createTemplateRef(hostTNode,hostLView){if(hostTNode.type&4){ngDevMode&&assertDefined(hostTNode.tView,"TView must be allocated");return new R3TemplateRef(hostLView,hostTNode,createElementRef(hostTNode,hostLView))}return null}const AT_THIS_LOCATION="<-- AT THIS LOCATION";function getFriendlyStringFromTNodeType(tNodeType){switch(tNodeType){case 4:return"view container";case 2:return"element";case 8:return"ng-container";case 32:return"icu";case 64:return"i18n";case 16:return"projection";case 1:return"text";default:return"<unknown>"}}function validateMatchingNode(node,nodeType,tagName,lView,tNode,isViewContainerAnchor=false){if(!node||(node.nodeType!==nodeType||node.nodeType===Node.ELEMENT_NODE&&node.tagName.toLowerCase()!==tagName?.toLowerCase())){const expectedNode=shortRNodeDescription(nodeType,tagName,null);let header=`During hydration Angular expected ${expectedNode} but `;const hostComponentDef=getDeclarationComponentDef(lView);const componentClassName=hostComponentDef?.type?.name;const expectedDom=describeExpectedDom(lView,tNode,isViewContainerAnchor);const expected=`Angular expected this DOM:\n\n${expectedDom}\n\n`;let actual="";const componentHostElement=unwrapRNode(lView[HOST]);if(!node){header+=`the node was not found.\n\n`;markRNodeAsHavingHydrationMismatch(componentHostElement,expectedDom)}else{const actualNode=shortRNodeDescription(node.nodeType,node.tagName??null,node.textContent??null);header+=`found ${actualNode}.\n\n`;const actualDom=describeDomFromNode(node);actual=`Actual DOM is:\n\n${actualDom}\n\n`;markRNodeAsHavingHydrationMismatch(componentHostElement,expectedDom,actualDom)}const footer=getHydrationErrorFooter(componentClassName);const message=header+expected+actual+getHydrationAttributeNote()+footer;throw new RuntimeError(-500,message)}}function validateSiblingNodeExists(node){validateNodeExists(node);if(!node.nextSibling){const header="During hydration Angular expected more sibling nodes to be present.\n\n";const actual=`Actual DOM is:\n\n${describeDomFromNode(node)}\n\n`;const footer=getHydrationErrorFooter();const message=header+actual+footer;markRNodeAsHavingHydrationMismatch(node,"",actual);throw new RuntimeError(-501,message)}}function validateNodeExists(node,lView=null,tNode=null){if(!node){const header="During hydration, Angular expected an element to be present at this location.\n\n";let expected="";let footer="";if(lView!==null&&tNode!==null){expected=describeExpectedDom(lView,tNode,false);footer=getHydrationErrorFooter();markRNodeAsHavingHydrationMismatch(unwrapRNode(lView[HOST]),expected,"")}throw new RuntimeError(-502,`${header}${expected}\n\n${footer}`)}}function nodeNotFoundError(lView,tNode){const header="During serialization, Angular was unable to find an element in the DOM:\n\n";const expected=`${describeExpectedDom(lView,tNode,false)}\n\n`;const footer=getHydrationErrorFooter();throw new RuntimeError(-502,header+expected+footer)}function nodeNotFoundAtPathError(host,path){const header=`During hydration Angular was unable to locate a node `+`using the "${path}" path, starting from the ${describeRNode(host)} node.\n\n`;const footer=getHydrationErrorFooter();markRNodeAsHavingHydrationMismatch(host);throw new RuntimeError(-502,header+footer)}function unsupportedProjectionOfDomNodes(rNode){const header="During serialization, Angular detected DOM nodes "+"that were created outside of Angular context and provided as projectable nodes "+"(likely via `ViewContainerRef.createComponent` or `createComponent` APIs). "+"Hydration is not supported for such cases, consider refactoring the code to avoid "+"this pattern or using `ngSkipHydration` on the host element of the component.\n\n";const actual=`${describeDomFromNode(rNode)}\n\n`;const message=header+actual+getHydrationAttributeNote();return new RuntimeError(-503,message)}function invalidSkipHydrationHost(rNode){const header="The `ngSkipHydration` flag is applied on a node "+"that doesn't act as a component host. Hydration can be "+"skipped only on per-component basis.\n\n";const actual=`${describeDomFromNode(rNode)}\n\n`;const footer="Please move the `ngSkipHydration` attribute to the component host element.\n\n";const message=header+actual+footer;return new RuntimeError(-504,message)}function stringifyTNodeAttrs(tNode){const results=[];if(tNode.attrs){for(let i=0;i<tNode.attrs.length;){const attrName=tNode.attrs[i++];if(typeof attrName=="number"){break}const attrValue=tNode.attrs[i++];results.push(`${attrName}="${shorten(attrValue)}"`)}}return results.join(" ")}const internalAttrs=new Set(["ngh","ng-version","ng-server-context"]);function stringifyRNodeAttrs(rNode){const results=[];for(let i=0;i<rNode.attributes.length;i++){const attr=rNode.attributes[i];if(internalAttrs.has(attr.name))continue;results.push(`${attr.name}="${shorten(attr.value)}"`)}return results.join(" ")}function describeTNode(tNode,innerContent="\u2026"){switch(tNode.type){case 1:const content=tNode.value?`(${tNode.value})`:"";return`#text${content}`;case 2:const attrs=stringifyTNodeAttrs(tNode);const tag=tNode.value.toLowerCase();return`<${tag}${attrs?" "+attrs:""}>${innerContent}</${tag}>`;case 8:return"\x3c!-- ng-container --\x3e";case 4:return"\x3c!-- container --\x3e";default:const typeAsString=getFriendlyStringFromTNodeType(tNode.type);return`#node(${typeAsString})`}}function describeRNode(rNode,innerContent="\u2026"){const node=rNode;switch(node.nodeType){case Node.ELEMENT_NODE:const tag=node.tagName.toLowerCase();const attrs=stringifyRNodeAttrs(node);return`<${tag}${attrs?" "+attrs:""}>${innerContent}</${tag}>`;case Node.TEXT_NODE:const content=node.textContent?shorten(node.textContent):"";return`#text${content?`(${content})`:""}`;case Node.COMMENT_NODE:return`\x3c!-- ${shorten(node.textContent??"")} --\x3e`;default:return`#node(${node.nodeType})`}}function describeExpectedDom(lView,tNode,isViewContainerAnchor){const spacer=" ";let content="";if(tNode.prev){content+=spacer+"\u2026\n";content+=spacer+describeTNode(tNode.prev)+"\n"}else if(tNode.type&&tNode.type&12){content+=spacer+"\u2026\n"}if(isViewContainerAnchor){content+=spacer+describeTNode(tNode)+"\n";content+=spacer+`\x3c!-- container --\x3e ${AT_THIS_LOCATION}\n`}else{content+=spacer+describeTNode(tNode)+` ${AT_THIS_LOCATION}\n`}content+=spacer+"\u2026\n";const parentRNode=tNode.type?getParentRElement(lView[TVIEW],tNode,lView):null;if(parentRNode){content=describeRNode(parentRNode,"\n"+content)}return content}function describeDomFromNode(node){const spacer=" ";let content="";const currentNode=node;if(currentNode.previousSibling){content+=spacer+"\u2026\n";content+=spacer+describeRNode(currentNode.previousSibling)+"\n"}content+=spacer+describeRNode(currentNode)+` ${AT_THIS_LOCATION}\n`;if(node.nextSibling){content+=spacer+"\u2026\n"}if(node.parentNode){content=describeRNode(currentNode.parentNode,"\n"+content)}return content}function shortRNodeDescription(nodeType,tagName,textContent){switch(nodeType){case Node.ELEMENT_NODE:return`<${tagName.toLowerCase()}>`;case Node.TEXT_NODE:const content=textContent?` (with the "${shorten(textContent)}" content)`:"";return`a text node${content}`;case Node.COMMENT_NODE:return"a comment node";default:return`#node(nodeType=${nodeType})`}}function getHydrationErrorFooter(componentClassName){const componentInfo=componentClassName?`the "${componentClassName}"`:"corresponding";return`To fix this problem:\n`+` * check ${componentInfo} component for hydration-related issues\n`+` * check to see if your template has valid HTML structure\n`+` * or skip hydration by adding the \`ngSkipHydration\` attribute `+`to its host node in a template\n\n`}function getHydrationAttributeNote(){return"Note: attributes are only displayed to better represent the DOM"+" but have no effect on hydration mismatches.\n\n"}function stripNewlines(input){return input.replace(/\s+/gm,"")}function shorten(input,maxLength=50){if(!input){return""}input=stripNewlines(input);return input.length>maxLength?`${input.substring(0,maxLength-1)}\u2026`:input}function removeDehydratedViews(lContainer){const views=lContainer[DEHYDRATED_VIEWS]??[];const parentLView=lContainer[PARENT];const renderer=parentLView[RENDERER];for(const view of views){removeDehydratedView(view,renderer);ngDevMode&&ngDevMode.dehydratedViewsRemoved++}lContainer[DEHYDRATED_VIEWS]=EMPTY_ARRAY}function removeDehydratedView(dehydratedView,renderer){let nodesRemoved=0;let currentRNode=dehydratedView.firstChild;if(currentRNode){const numNodes=dehydratedView.data[NUM_ROOT_NODES];while(nodesRemoved<numNodes){ngDevMode&&validateSiblingNodeExists(currentRNode);const nextSibling=currentRNode.nextSibling;nativeRemoveNode(renderer,currentRNode,false);currentRNode=nextSibling;nodesRemoved++}}}function cleanupLContainer(lContainer){removeDehydratedViews(lContainer);for(let i=CONTAINER_HEADER_OFFSET;i<lContainer.length;i++){cleanupLView(lContainer[i])}}function cleanupDehydratedI18nNodes(lView){const i18nNodes=lView[HYDRATION]?.i18nNodes;if(i18nNodes){const renderer=lView[RENDERER];for(const node of i18nNodes.values()){nativeRemoveNode(renderer,node,false)}lView[HYDRATION].i18nNodes=undefined}}function cleanupLView(lView){cleanupDehydratedI18nNodes(lView);const tView=lView[TVIEW];for(let i=HEADER_OFFSET;i<tView.bindingStartIndex;i++){if(isLContainer(lView[i])){const lContainer=lView[i];cleanupLContainer(lContainer)}else if(isLView(lView[i])){cleanupLView(lView[i])}}}function cleanupDehydratedViews(appRef){const viewRefs=appRef._views;for(const viewRef of viewRefs){const lNode=getLNodeForHydration(viewRef);if(lNode!==null&&lNode[HOST]!==null){if(isLView(lNode)){cleanupLView(lNode)}else{const componentLView=lNode[HOST];cleanupLView(componentLView);cleanupLContainer(lNode)}ngDevMode&&ngDevMode.dehydratedViewsCleanupRuns++}}}const REF_EXTRACTOR_REGEXP=new RegExp(`^(\\d+)*(${REFERENCE_NODE_BODY}|${REFERENCE_NODE_HOST})*(.*)`);function compressNodeLocation(referenceNode,path){const result=[referenceNode];for(const segment of path){const lastIdx=result.length-1;if(lastIdx>0&&result[lastIdx-1]===segment){const value=result[lastIdx]||1;result[lastIdx]=value+1}else{result.push(segment,"")}}return result.join("")}function decompressNodeLocation(path){const matches=path.match(REF_EXTRACTOR_REGEXP);const[_,refNodeId,refNodeName,rest]=matches;const ref=refNodeId?parseInt(refNodeId,10):refNodeName;const steps=[];for(const[_,step,count]of rest.matchAll(/(f|n)(\d*)/g)){const repeat=parseInt(count,10)||1;steps.push(step,repeat)}return[ref,...steps]}function isFirstElementInNgContainer(tNode){return!tNode.prev&&tNode.parent?.type===8}function getNoOffsetIndex(tNode){return tNode.index-HEADER_OFFSET}function isDisconnectedNode(tNode,lView){return!(tNode.type&16)&&!!lView[tNode.index]&&!unwrapRNode(lView[tNode.index])?.isConnected}function locateI18nRNodeByIndex(hydrationInfo,noOffsetIndex){const i18nNodes=hydrationInfo.i18nNodes;if(i18nNodes){const native=i18nNodes.get(noOffsetIndex);if(native){i18nNodes.delete(noOffsetIndex)}return native}return null}function locateNextRNode(hydrationInfo,tView,lView,tNode){const noOffsetIndex=getNoOffsetIndex(tNode);let native=locateI18nRNodeByIndex(hydrationInfo,noOffsetIndex);if(!native){const nodes=hydrationInfo.data[NODES];if(nodes?.[noOffsetIndex]){native=locateRNodeByPath(nodes[noOffsetIndex],lView)}else if(tView.firstChild===tNode){native=hydrationInfo.firstChild}else{const previousTNodeParent=tNode.prev===null;const previousTNode=tNode.prev??tNode.parent;ngDevMode&&assertDefined(previousTNode,"Unexpected state: current TNode does not have a connection "+"to the previous node or a parent node.");if(isFirstElementInNgContainer(tNode)){const noOffsetParentIndex=getNoOffsetIndex(tNode.parent);native=getSegmentHead(hydrationInfo,noOffsetParentIndex)}else{let previousRElement=getNativeByTNode(previousTNode,lView);if(previousTNodeParent){native=previousRElement.firstChild}else{const noOffsetPrevSiblingIndex=getNoOffsetIndex(previousTNode);const segmentHead=getSegmentHead(hydrationInfo,noOffsetPrevSiblingIndex);if(previousTNode.type===2&&segmentHead){const numRootNodesToSkip=calcSerializedContainerSize(hydrationInfo,noOffsetPrevSiblingIndex);const nodesToSkip=numRootNodesToSkip+1;native=siblingAfter(nodesToSkip,segmentHead)}else{native=previousRElement.nextSibling}}}}}return native}function siblingAfter(skip,from){let currentNode=from;for(let i=0;i<skip;i++){ngDevMode&&validateSiblingNodeExists(currentNode);currentNode=currentNode.nextSibling}return currentNode}function stringifyNavigationInstructions(instructions){const container=[];for(let i=0;i<instructions.length;i+=2){const step=instructions[i];const repeat=instructions[i+1];for(let r=0;r<repeat;r++){container.push(step===NodeNavigationStep.FirstChild?"firstChild":"nextSibling")}}return container.join(".")}function navigateToNode(from,instructions){let node=from;for(let i=0;i<instructions.length;i+=2){const step=instructions[i];const repeat=instructions[i+1];for(let r=0;r<repeat;r++){if(ngDevMode&&!node){throw nodeNotFoundAtPathError(from,stringifyNavigationInstructions(instructions))}switch(step){case NodeNavigationStep.FirstChild:node=node.firstChild;break;case NodeNavigationStep.NextSibling:node=node.nextSibling;break}}}if(ngDevMode&&!node){throw nodeNotFoundAtPathError(from,stringifyNavigationInstructions(instructions))}return node}function locateRNodeByPath(path,lView){const[referenceNode,...navigationInstructions]=decompressNodeLocation(path);let ref;if(referenceNode===REFERENCE_NODE_HOST){ref=lView[DECLARATION_COMPONENT_VIEW][HOST]}else if(referenceNode===REFERENCE_NODE_BODY){ref=\u0275\u0275resolveBody(lView[DECLARATION_COMPONENT_VIEW][HOST])}else{const parentElementId=Number(referenceNode);ref=unwrapRNode(lView[parentElementId+HEADER_OFFSET])}return navigateToNode(ref,navigationInstructions)}function navigateBetween(start,finish){if(start===finish){return[]}else if(start.parentElement==null||finish.parentElement==null){return null}else if(start.parentElement===finish.parentElement){return navigateBetweenSiblings(start,finish)}else{const parent=finish.parentElement;const parentPath=navigateBetween(start,parent);const childPath=navigateBetween(parent.firstChild,finish);if(!parentPath||!childPath)return null;return[...parentPath,NodeNavigationStep.FirstChild,...childPath]}}function navigateBetweenSiblings(start,finish){const nav=[];let node=null;for(node=start;node!=null&&node!==finish;node=node.nextSibling){nav.push(NodeNavigationStep.NextSibling)}return node==null?null:nav}function calcPathBetween(from,to,fromNodeName){const path=navigateBetween(from,to);return path===null?null:compressNodeLocation(fromNodeName,path)}function calcPathForNode(tNode,lView){let parentTNode=tNode.parent;let parentIndex;let parentRNode;let referenceNodeName;while(parentTNode!==null&&isDisconnectedNode(parentTNode,lView)){parentTNode=parentTNode.parent}if(parentTNode===null||!(parentTNode.type&3)){parentIndex=referenceNodeName=REFERENCE_NODE_HOST;parentRNode=lView[DECLARATION_COMPONENT_VIEW][HOST]}else{parentIndex=parentTNode.index;parentRNode=unwrapRNode(lView[parentIndex]);referenceNodeName=renderStringify(parentIndex-HEADER_OFFSET)}let rNode=unwrapRNode(lView[tNode.index]);if(tNode.type&12){const firstRNode=getFirstNativeNode(lView,tNode);if(firstRNode){rNode=firstRNode}}let path=calcPathBetween(parentRNode,rNode,referenceNodeName);if(path===null&&parentRNode!==rNode){const body=parentRNode.ownerDocument.body;path=calcPathBetween(body,rNode,REFERENCE_NODE_BODY);if(path===null){throw nodeNotFoundError(lView,tNode)}}return path}function locateDehydratedViewsInContainer(currentRNode,serializedViews){const dehydratedViews=[];for(const serializedView of serializedViews){for(let i=0;i<(serializedView[MULTIPLIER]??1);i++){const view={data:serializedView,firstChild:null};if(serializedView[NUM_ROOT_NODES]>0){view.firstChild=currentRNode;currentRNode=siblingAfter(serializedView[NUM_ROOT_NODES],currentRNode)}dehydratedViews.push(view)}}return[currentRNode,dehydratedViews]}let _findMatchingDehydratedViewImpl=()=>null;function findMatchingDehydratedViewImpl(lContainer,template){const views=lContainer[DEHYDRATED_VIEWS];if(!template||views===null||views.length===0){return null}const view=views[0];if(view.data[TEMPLATE_ID]===template){return views.shift()}else{removeDehydratedViews(lContainer);return null}}function enableFindMatchingDehydratedViewImpl(){_findMatchingDehydratedViewImpl=findMatchingDehydratedViewImpl}function findMatchingDehydratedView(lContainer,template){return _findMatchingDehydratedViewImpl(lContainer,template)}class ChangeDetectionScheduler{}class ComponentRef$1{}class ComponentFactory$1{}function noComponentFactoryError(component){const error=Error(`No component factory found for ${stringify(component)}.`);error[ERROR_COMPONENT]=component;return error}const ERROR_COMPONENT="ngComponent";class _NullComponentFactoryResolver{resolveComponentFactory(component){throw noComponentFactoryError(component)}}class ComponentFactoryResolver$1{static{this.NULL=new _NullComponentFactoryResolver}}class RendererFactory2{}class Renderer2{constructor(){this.destroyNode=null}static{this.__NG_ELEMENT_ID__=()=>injectRenderer2()}}function injectRenderer2(){const lView=getLView();const tNode=getCurrentTNode();const nodeAtIndex=getComponentLViewByIndex(tNode.index,lView);return(isLView(nodeAtIndex)?nodeAtIndex:lView)[RENDERER]}class Sanitizer{static{this.\u0275prov=\u0275\u0275defineInjectable({token:Sanitizer,providedIn:"root",factory:()=>null})}}const NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR={};function assertNotInReactiveContext(debugFn,extraContext){if(signals.getActiveConsumer()!==null){throw new RuntimeError(-602,ngDevMode&&`${debugFn.name}() cannot be called from within a reactive context.${extraContext?` ${extraContext}`:""}`)}}const markedFeatures=new Set;function performanceMarkFeature(feature){if(markedFeatures.has(feature)){return}markedFeatures.add(feature);performance?.mark?.("mark_feature_usage",{detail:{feature:feature}})}function noop(...args){}function getNativeRequestAnimationFrame(){const isBrowser=typeof _global["requestAnimationFrame"]==="function";let nativeRequestAnimationFrame=_global[isBrowser?"requestAnimationFrame":"setTimeout"];let nativeCancelAnimationFrame=_global[isBrowser?"cancelAnimationFrame":"clearTimeout"];if(typeof Zone!=="undefined"&&nativeRequestAnimationFrame&&nativeCancelAnimationFrame){const unpatchedRequestAnimationFrame=nativeRequestAnimationFrame[Zone.__symbol__("OriginalDelegate")];if(unpatchedRequestAnimationFrame){nativeRequestAnimationFrame=unpatchedRequestAnimationFrame}const unpatchedCancelAnimationFrame=nativeCancelAnimationFrame[Zone.__symbol__("OriginalDelegate")];if(unpatchedCancelAnimationFrame){nativeCancelAnimationFrame=unpatchedCancelAnimationFrame}}return{nativeRequestAnimationFrame:nativeRequestAnimationFrame,nativeCancelAnimationFrame:nativeCancelAnimationFrame}}class AsyncStackTaggingZoneSpec{constructor(namePrefix,consoleAsyncStackTaggingImpl=console){this.name="asyncStackTagging for "+namePrefix;this.createTask=consoleAsyncStackTaggingImpl?.createTask??(()=>null)}onScheduleTask(delegate,_current,target,task){task.consoleTask=this.createTask(`Zone - ${task.source||task.type}`);return delegate.scheduleTask(target,task)}onInvokeTask(delegate,_currentZone,targetZone,task,applyThis,applyArgs){let ret;if(task.consoleTask){ret=task.consoleTask.run((()=>delegate.invokeTask(targetZone,task,applyThis,applyArgs)))}else{ret=delegate.invokeTask(targetZone,task,applyThis,applyArgs)}return ret}}class NgZone{constructor({enableLongStackTrace:enableLongStackTrace=false,shouldCoalesceEventChangeDetection:shouldCoalesceEventChangeDetection=false,shouldCoalesceRunChangeDetection:shouldCoalesceRunChangeDetection=false}){this.hasPendingMacrotasks=false;this.hasPendingMicrotasks=false;this.isStable=true;this.onUnstable=new EventEmitter(false);this.onMicrotaskEmpty=new EventEmitter(false);this.onStable=new EventEmitter(false);this.onError=new EventEmitter(false);if(typeof Zone=="undefined"){throw new RuntimeError(908,ngDevMode&&`In this configuration Angular requires Zone.js`)}Zone.assertZonePatched();const self=this;self._nesting=0;self._outer=self._inner=Zone.current;if(ngDevMode){self._inner=self._inner.fork(new AsyncStackTaggingZoneSpec("Angular"))}if(Zone["TaskTrackingZoneSpec"]){self._inner=self._inner.fork(new Zone["TaskTrackingZoneSpec"])}if(enableLongStackTrace&&Zone["longStackTraceZoneSpec"]){self._inner=self._inner.fork(Zone["longStackTraceZoneSpec"])}self.shouldCoalesceEventChangeDetection=!shouldCoalesceRunChangeDetection&&shouldCoalesceEventChangeDetection;self.shouldCoalesceRunChangeDetection=shouldCoalesceRunChangeDetection;self.lastRequestAnimationFrameId=-1;self.nativeRequestAnimationFrame=getNativeRequestAnimationFrame().nativeRequestAnimationFrame;forkInnerZoneWithAngularBehavior(self)}static isInAngularZone(){return typeof Zone!=="undefined"&&Zone.current.get("isAngularZone")===true}static assertInAngularZone(){if(!NgZone.isInAngularZone()){throw new RuntimeError(909,ngDevMode&&"Expected to be in Angular Zone, but it is not!")}}static assertNotInAngularZone(){if(NgZone.isInAngularZone()){throw new RuntimeError(909,ngDevMode&&"Expected to not be in Angular Zone, but it is!")}}run(fn,applyThis,applyArgs){return this._inner.run(fn,applyThis,applyArgs)}runTask(fn,applyThis,applyArgs,name){const zone=this._inner;const task=zone.scheduleEventTask("NgZoneEvent: "+name,fn,EMPTY_PAYLOAD,noop,noop);try{return zone.runTask(task,applyThis,applyArgs)}finally{zone.cancelTask(task)}}runGuarded(fn,applyThis,applyArgs){return this._inner.runGuarded(fn,applyThis,applyArgs)}runOutsideAngular(fn){return this._outer.run(fn)}}const EMPTY_PAYLOAD={};function checkStable(zone){if(zone._nesting==0&&!zone.hasPendingMicrotasks&&!zone.isStable){try{zone._nesting++;zone.onMicrotaskEmpty.emit(null)}finally{zone._nesting--;if(!zone.hasPendingMicrotasks){try{zone.runOutsideAngular((()=>zone.onStable.emit(null)))}finally{zone.isStable=true}}}}}function delayChangeDetectionForEvents(zone){if(zone.isCheckStableRunning||zone.lastRequestAnimationFrameId!==-1){return}zone.lastRequestAnimationFrameId=zone.nativeRequestAnimationFrame.call(_global,(()=>{if(!zone.fakeTopEventTask){zone.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",(()=>{zone.lastRequestAnimationFrameId=-1;updateMicroTaskStatus(zone);zone.isCheckStableRunning=true;checkStable(zone);zone.isCheckStableRunning=false}),undefined,(()=>{}),(()=>{}))}zone.fakeTopEventTask.invoke()}));updateMicroTaskStatus(zone)}function forkInnerZoneWithAngularBehavior(zone){const delayChangeDetectionForEventsDelegate=()=>{delayChangeDetectionForEvents(zone)};zone._inner=zone._inner.fork({name:"angular",properties:{isAngularZone:true},onInvokeTask:(delegate,current,target,task,applyThis,applyArgs)=>{if(shouldBeIgnoredByZone(applyArgs)){return delegate.invokeTask(target,task,applyThis,applyArgs)}try{onEnter(zone);return delegate.invokeTask(target,task,applyThis,applyArgs)}finally{if(zone.shouldCoalesceEventChangeDetection&&task.type==="eventTask"||zone.shouldCoalesceRunChangeDetection){delayChangeDetectionForEventsDelegate()}onLeave(zone)}},onInvoke:(delegate,current,target,callback,applyThis,applyArgs,source)=>{try{onEnter(zone);return delegate.invoke(target,callback,applyThis,applyArgs,source)}finally{if(zone.shouldCoalesceRunChangeDetection){delayChangeDetectionForEventsDelegate()}onLeave(zone)}},onHasTask:(delegate,current,target,hasTaskState)=>{delegate.hasTask(target,hasTaskState);if(current===target){if(hasTaskState.change=="microTask"){zone._hasPendingMicrotasks=hasTaskState.microTask;updateMicroTaskStatus(zone);checkStable(zone)}else if(hasTaskState.change=="macroTask"){zone.hasPendingMacrotasks=hasTaskState.macroTask}}},onHandleError:(delegate,current,target,error)=>{delegate.handleError(target,error);zone.runOutsideAngular((()=>zone.onError.emit(error)));return false}})}function updateMicroTaskStatus(zone){if(zone._hasPendingMicrotasks||(zone.shouldCoalesceEventChangeDetection||zone.shouldCoalesceRunChangeDetection)&&zone.lastRequestAnimationFrameId!==-1){zone.hasPendingMicrotasks=true}else{zone.hasPendingMicrotasks=false}}function onEnter(zone){zone._nesting++;if(zone.isStable){zone.isStable=false;zone.onUnstable.emit(null)}}function onLeave(zone){zone._nesting--;checkStable(zone)}class NoopNgZone{constructor(){this.hasPendingMicrotasks=false;this.hasPendingMacrotasks=false;this.isStable=true;this.onUnstable=new EventEmitter;this.onMicrotaskEmpty=new EventEmitter;this.onStable=new EventEmitter;this.onError=new EventEmitter}run(fn,applyThis,applyArgs){return fn.apply(applyThis,applyArgs)}runGuarded(fn,applyThis,applyArgs){return fn.apply(applyThis,applyArgs)}runOutsideAngular(fn){return fn()}runTask(fn,applyThis,applyArgs,name){return fn.apply(applyThis,applyArgs)}}function shouldBeIgnoredByZone(applyArgs){if(!Array.isArray(applyArgs)){return false}if(applyArgs.length!==1){return false}return applyArgs[0].data?.["__ignore_ng_zone__"]===true}function getNgZone(ngZoneToUse="zone.js",options){if(ngZoneToUse==="noop"){return new NoopNgZone}if(ngZoneToUse==="zone.js"){return new NgZone(options)}return ngZoneToUse}exports.AfterRenderPhase=void 0;(function(AfterRenderPhase){AfterRenderPhase[AfterRenderPhase["EarlyRead"]=0]="EarlyRead";AfterRenderPhase[AfterRenderPhase["Write"]=1]="Write";AfterRenderPhase[AfterRenderPhase["MixedReadWrite"]=2]="MixedReadWrite";AfterRenderPhase[AfterRenderPhase["Read"]=3]="Read"})(exports.AfterRenderPhase||(exports.AfterRenderPhase={}));const NOOP_AFTER_RENDER_REF={destroy(){}};function internalAfterNextRender(callback,options){const injector=options?.injector??inject(Injector);if(!options?.runOnServer&&!isPlatformBrowser(injector))return;const afterRenderEventManager=injector.get(AfterRenderEventManager);afterRenderEventManager.internalCallbacks.push(callback)}function afterRender(callback,options){ngDevMode&&assertNotInReactiveContext(afterRender,"Call `afterRender` outside of a reactive context. For example, schedule the render "+"callback inside the component constructor`.");!options&&assertInInjectionContext(afterRender);const injector=options?.injector??inject(Injector);if(!isPlatformBrowser(injector)){return NOOP_AFTER_RENDER_REF}performanceMarkFeature("NgAfterRender");const afterRenderEventManager=injector.get(AfterRenderEventManager);const callbackHandler=afterRenderEventManager.handler??=new AfterRenderCallbackHandlerImpl;const phase=options?.phase??exports.AfterRenderPhase.MixedReadWrite;const destroy=()=>{callbackHandler.unregister(instance);unregisterFn()};const unregisterFn=injector.get(DestroyRef).onDestroy(destroy);const instance=runInInjectionContext(injector,(()=>new AfterRenderCallback(phase,callback)));callbackHandler.register(instance);return{destroy:destroy}}function afterNextRender(callback,options){!options&&assertInInjectionContext(afterNextRender);const injector=options?.injector??inject(Injector);if(!isPlatformBrowser(injector)){return NOOP_AFTER_RENDER_REF}performanceMarkFeature("NgAfterNextRender");const afterRenderEventManager=injector.get(AfterRenderEventManager);const callbackHandler=afterRenderEventManager.handler??=new AfterRenderCallbackHandlerImpl;const phase=options?.phase??exports.AfterRenderPhase.MixedReadWrite;const destroy=()=>{callbackHandler.unregister(instance);unregisterFn()};const unregisterFn=injector.get(DestroyRef).onDestroy(destroy);const instance=runInInjectionContext(injector,(()=>new AfterRenderCallback(phase,(()=>{destroy();callback()}))));callbackHandler.register(instance);return{destroy:destroy}}class AfterRenderCallback{constructor(phase,callbackFn){this.phase=phase;this.callbackFn=callbackFn;this.zone=inject(NgZone);this.errorHandler=inject(ErrorHandler,{optional:true});inject(ChangeDetectionScheduler,{optional:true})?.notify(1)}invoke(){try{this.zone.runOutsideAngular(this.callbackFn)}catch(err){this.errorHandler?.handleError(err)}}}class AfterRenderCallbackHandlerImpl{constructor(){this.executingCallbacks=false;this.buckets={[exports.AfterRenderPhase.EarlyRead]:new Set,[exports.AfterRenderPhase.Write]:new Set,[exports.AfterRenderPhase.MixedReadWrite]:new Set,[exports.AfterRenderPhase.Read]:new Set};this.deferredCallbacks=new Set}register(callback){const target=this.executingCallbacks?this.deferredCallbacks:this.buckets[callback.phase];target.add(callback)}unregister(callback){this.buckets[callback.phase].delete(callback);this.deferredCallbacks.delete(callback)}execute(){this.executingCallbacks=true;for(const bucket of Object.values(this.buckets)){for(const callback of bucket){callback.invoke()}}this.executingCallbacks=false;for(const callback of this.deferredCallbacks){this.buckets[callback.phase].add(callback)}this.deferredCallbacks.clear()}destroy(){for(const bucket of Object.values(this.buckets)){bucket.clear()}this.deferredCallbacks.clear()}}class AfterRenderEventManager{constructor(){this.handler=null;this.internalCallbacks=[]}execute(){this.executeInternalCallbacks();this.handler?.execute()}executeInternalCallbacks(){const callbacks=[...this.internalCallbacks];this.internalCallbacks.length=0;for(const callback of callbacks){callback()}}ngOnDestroy(){this.handler?.destroy();this.handler=null;this.internalCallbacks.length=0}static{this.\u0275prov=\u0275\u0275defineInjectable({token:AfterRenderEventManager,providedIn:"root",factory:()=>new AfterRenderEventManager})}}function isModuleWithProviders(value){return value.ngModule!==undefined}function isNgModule(value){return!!getNgModuleDef(value)}function isPipe(value){return!!getPipeDef$1(value)}function isDirective(value){return!!getDirectiveDef(value)}function isComponent(value){return!!getComponentDef(value)}function getDependencyTypeForError(type){if(getComponentDef(type))return"component";if(getDirectiveDef(type))return"directive";if(getPipeDef$1(type))return"pipe";return"type"}function verifyStandaloneImport(depType,importingType){if(isForwardRef(depType)){depType=resolveForwardRef(depType);if(!depType){throw new Error(`Expected forwardRef function, imported from "${stringifyForError(importingType)}", to return a standalone entity or NgModule but got "${stringifyForError(depType)||depType}".`)}}if(getNgModuleDef(depType)==null){const def=getComponentDef(depType)||getDirectiveDef(depType)||getPipeDef$1(depType);if(def!=null){if(!def.standalone){throw new Error(`The "${stringifyForError(depType)}" ${getDependencyTypeForError(depType)}, imported from "${stringifyForError(importingType)}", is not standalone. Did you forget to add the standalone: true flag?`)}}else{if(isModuleWithProviders(depType)){throw new Error(`A module with providers was imported from "${stringifyForError(importingType)}". Modules with providers are not supported in standalone components imports.`)}else{throw new Error(`The "${stringifyForError(depType)}" type, imported from "${stringifyForError(importingType)}", must be a standalone component / directive / pipe or an NgModule. Did you forget to add the required @Component / @Directive / @Pipe or @NgModule annotation?`)}}}}const USE_RUNTIME_DEPS_TRACKER_FOR_JIT=true;class DepsTracker{constructor(){this.ownerNgModule=new Map;this.ngModulesWithSomeUnresolvedDecls=new Set;this.ngModulesScopeCache=new Map;this.standaloneComponentsScopeCache=new Map}resolveNgModulesDecls(){if(this.ngModulesWithSomeUnresolvedDecls.size===0){return}for(const moduleType of this.ngModulesWithSomeUnresolvedDecls){const def=getNgModuleDef(moduleType);if(def?.declarations){for(const decl of maybeUnwrapFn(def.declarations)){if(isComponent(decl)){this.ownerNgModule.set(decl,moduleType)}}}}this.ngModulesWithSomeUnresolvedDecls.clear()}getComponentDependencies(type,rawImports){this.resolveNgModulesDecls();const def=getComponentDef(type);if(def===null){throw new Error(`Attempting to get component dependencies for a type that is not a component: ${type}`)}if(def.standalone){const scope=this.getStandaloneComponentScope(type,rawImports);if(scope.compilation.isPoisoned){return{dependencies:[]}}return{dependencies:[...scope.compilation.directives,...scope.compilation.pipes,...scope.compilation.ngModules]}}else{if(!this.ownerNgModule.has(type)){return{dependencies:[]}}const scope=this.getNgModuleScope(this.ownerNgModule.get(type));if(scope.compilation.isPoisoned){return{dependencies:[]}}return{dependencies:[...scope.compilation.directives,...scope.compilation.pipes]}}}registerNgModule(type,scopeInfo){if(!isNgModule(type)){throw new Error(`Attempting to register a Type which is not NgModule as NgModule: ${type}`)}this.ngModulesWithSomeUnresolvedDecls.add(type)}clearScopeCacheFor(type){this.ngModulesScopeCache.delete(type);this.standaloneComponentsScopeCache.delete(type)}getNgModuleScope(type){if(this.ngModulesScopeCache.has(type)){return this.ngModulesScopeCache.get(type)}const scope=this.computeNgModuleScope(type);this.ngModulesScopeCache.set(type,scope);return scope}computeNgModuleScope(type){const def=getNgModuleDef(type,true);const scope={exported:{directives:new Set,pipes:new Set},compilation:{directives:new Set,pipes:new Set}};for(const imported of maybeUnwrapFn(def.imports)){if(isNgModule(imported)){const importedScope=this.getNgModuleScope(imported);addSet(importedScope.exported.directives,scope.compilation.directives);addSet(importedScope.exported.pipes,scope.compilation.pipes)}else if(isStandalone(imported)){if(isDirective(imported)||isComponent(imported)){scope.compilation.directives.add(imported)}else if(isPipe(imported)){scope.compilation.pipes.add(imported)}else{throw new RuntimeError(1e3,"The standalone imported type is neither a component nor a directive nor a pipe")}}else{scope.compilation.isPoisoned=true;break}}if(!scope.compilation.isPoisoned){for(const decl of maybeUnwrapFn(def.declarations)){if(isNgModule(decl)||isStandalone(decl)){scope.compilation.isPoisoned=true;break}if(isPipe(decl)){scope.compilation.pipes.add(decl)}else{scope.compilation.directives.add(decl)}}}for(const exported of maybeUnwrapFn(def.exports)){if(isNgModule(exported)){const exportedScope=this.getNgModuleScope(exported);addSet(exportedScope.exported.directives,scope.exported.directives);addSet(exportedScope.exported.pipes,scope.exported.pipes);addSet(exportedScope.exported.directives,scope.compilation.directives);addSet(exportedScope.exported.pipes,scope.compilation.pipes)}else if(isPipe(exported)){scope.exported.pipes.add(exported)}else{scope.exported.directives.add(exported)}}return scope}getStandaloneComponentScope(type,rawImports){if(this.standaloneComponentsScopeCache.has(type)){return this.standaloneComponentsScopeCache.get(type)}const ans=this.computeStandaloneComponentScope(type,rawImports);this.standaloneComponentsScopeCache.set(type,ans);return ans}computeStandaloneComponentScope(type,rawImports){const ans={compilation:{directives:new Set([type]),pipes:new Set,ngModules:new Set}};for(const rawImport of flatten(rawImports??[])){const imported=resolveForwardRef(rawImport);try{verifyStandaloneImport(imported,type)}catch(e){ans.compilation.isPoisoned=true;return ans}if(isNgModule(imported)){ans.compilation.ngModules.add(imported);const importedScope=this.getNgModuleScope(imported);if(importedScope.exported.isPoisoned){ans.compilation.isPoisoned=true;return ans}addSet(importedScope.exported.directives,ans.compilation.directives);addSet(importedScope.exported.pipes,ans.compilation.pipes)}else if(isPipe(imported)){ans.compilation.pipes.add(imported)}else if(isDirective(imported)||isComponent(imported)){ans.compilation.directives.add(imported)}else{ans.compilation.isPoisoned=true;return ans}}return ans}isOrphanComponent(cmp){const def=getComponentDef(cmp);if(!def||def.standalone){return false}this.resolveNgModulesDecls();return!this.ownerNgModule.has(cmp)}}function addSet(sourceSet,targetSet){for(const m of sourceSet){targetSet.add(m)}}const depsTracker=new DepsTracker;function computeStaticStyling(tNode,attrs,writeToHost){ngDevMode&&assertFirstCreatePass(getTView(),"Expecting to be called in first template pass only");let styles=writeToHost?tNode.styles:null;let classes=writeToHost?tNode.classes:null;let mode=0;if(attrs!==null){for(let i=0;i<attrs.length;i++){const value=attrs[i];if(typeof value==="number"){mode=value}else if(mode==1){classes=concatStringsWithSpace(classes,value)}else if(mode==2){const style=value;const styleValue=attrs[++i];styles=concatStringsWithSpace(styles,style+": "+styleValue+";")}}}writeToHost?tNode.styles=styles:tNode.stylesWithoutHost=styles;writeToHost?tNode.classes=classes:tNode.classesWithoutHost=classes}class ComponentFactoryResolver extends ComponentFactoryResolver$1{constructor(ngModule){super();this.ngModule=ngModule}resolveComponentFactory(component){ngDevMode&&assertComponentType(component);const componentDef=getComponentDef(component);return new ComponentFactory(componentDef,this.ngModule)}}function toRefArray(map){const array=[];for(const publicName in map){if(!map.hasOwnProperty(publicName)){continue}const value=map[publicName];if(value===undefined){continue}array.push({propName:Array.isArray(value)?value[0]:value,templateName:publicName})}return array}function getNamespace(elementName){const name=elementName.toLowerCase();return name==="svg"?SVG_NAMESPACE:name==="math"?MATH_ML_NAMESPACE:null}class ChainedInjector{constructor(injector,parentInjector){this.injector=injector;this.parentInjector=parentInjector}get(token,notFoundValue,flags){flags=convertToBitFlags(flags);const value=this.injector.get(token,NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR,flags);if(value!==NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR||notFoundValue===NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR){return value}return this.parentInjector.get(token,notFoundValue,flags)}}class ComponentFactory extends ComponentFactory$1{get inputs(){const componentDef=this.componentDef;const inputTransforms=componentDef.inputTransforms;const refArray=toRefArray(componentDef.inputs);if(inputTransforms!==null){for(const input of refArray){if(inputTransforms.hasOwnProperty(input.propName)){input.transform=inputTransforms[input.propName]}}}return refArray}get outputs(){return toRefArray(this.componentDef.outputs)}constructor(componentDef,ngModule){super();this.componentDef=componentDef;this.ngModule=ngModule;this.componentType=componentDef.type;this.selector=stringifyCSSSelectorList(componentDef.selectors);this.ngContentSelectors=componentDef.ngContentSelectors?componentDef.ngContentSelectors:[];this.isBoundToModule=!!ngModule}create(injector,projectableNodes,rootSelectorOrNode,environmentInjector){const prevConsumer=signals.setActiveConsumer(null);try{if(ngDevMode&&(typeof ngJitMode==="undefined"||ngJitMode)&&this.componentDef.debugInfo?.forbidOrphanRendering){if(depsTracker.isOrphanComponent(this.componentType)){throw new RuntimeError(1001,`Orphan component found! Trying to render the component ${debugStringifyTypeForError(this.componentType)} without first loading the NgModule that declares it. It is recommended to make this component standalone in order to avoid this error. If this is not possible now, import the component's NgModule in the appropriate NgModule, or the standalone component in which you are trying to render this component. If this is a lazy import, load the NgModule lazily as well and use its module injector.`)}}environmentInjector=environmentInjector||this.ngModule;let realEnvironmentInjector=environmentInjector instanceof EnvironmentInjector?environmentInjector:environmentInjector?.injector;if(realEnvironmentInjector&&this.componentDef.getStandaloneInjector!==null){realEnvironmentInjector=this.componentDef.getStandaloneInjector(realEnvironmentInjector)||realEnvironmentInjector}const rootViewInjector=realEnvironmentInjector?new ChainedInjector(injector,realEnvironmentInjector):injector;const rendererFactory=rootViewInjector.get(RendererFactory2,null);if(rendererFactory===null){throw new RuntimeError(407,ngDevMode&&"Angular was not able to inject a renderer (RendererFactory2). "+"Likely this is due to a broken DI hierarchy. "+"Make sure that any injector used to create this component has a correct parent.")}const sanitizer=rootViewInjector.get(Sanitizer,null);const afterRenderEventManager=rootViewInjector.get(AfterRenderEventManager,null);const changeDetectionScheduler=rootViewInjector.get(ChangeDetectionScheduler,null);const environment={rendererFactory:rendererFactory,sanitizer:sanitizer,inlineEffectRunner:null,afterRenderEventManager:afterRenderEventManager,changeDetectionScheduler:changeDetectionScheduler};const hostRenderer=rendererFactory.createRenderer(null,this.componentDef);const elementName=this.componentDef.selectors[0][0]||"div";const hostRNode=rootSelectorOrNode?locateHostElement(hostRenderer,rootSelectorOrNode,this.componentDef.encapsulation,rootViewInjector):createElementNode(hostRenderer,elementName,getNamespace(elementName));let rootFlags=512;if(this.componentDef.signals){rootFlags|=4096}else if(!this.componentDef.onPush){rootFlags|=16}let hydrationInfo=null;if(hostRNode!==null){hydrationInfo=retrieveHydrationInfo(hostRNode,rootViewInjector,true)}const rootTView=createTView(0,null,null,1,0,null,null,null,null,null,null);const rootLView=createLView(null,rootTView,null,rootFlags,null,null,environment,hostRenderer,rootViewInjector,null,hydrationInfo);enterView(rootLView);let component;let tElementNode;try{const rootComponentDef=this.componentDef;let rootDirectives;let hostDirectiveDefs=null;if(rootComponentDef.findHostDirectiveDefs){rootDirectives=[];hostDirectiveDefs=new Map;rootComponentDef.findHostDirectiveDefs(rootComponentDef,rootDirectives,hostDirectiveDefs);rootDirectives.push(rootComponentDef);ngDevMode&&assertNoDuplicateDirectives(rootDirectives)}else{rootDirectives=[rootComponentDef]}const hostTNode=createRootComponentTNode(rootLView,hostRNode);const componentView=createRootComponentView(hostTNode,hostRNode,rootComponentDef,rootDirectives,rootLView,environment,hostRenderer);tElementNode=getTNode(rootTView,HEADER_OFFSET);if(hostRNode){setRootNodeAttributes(hostRenderer,rootComponentDef,hostRNode,rootSelectorOrNode)}if(projectableNodes!==undefined){projectNodes(tElementNode,this.ngContentSelectors,projectableNodes)}component=createRootComponent(componentView,rootComponentDef,rootDirectives,hostDirectiveDefs,rootLView,[LifecycleHooksFeature]);renderView(rootTView,rootLView,null)}finally{leaveView()}return new ComponentRef(this.componentType,component,createElementRef(tElementNode,rootLView),rootLView,tElementNode)}finally{signals.setActiveConsumer(prevConsumer)}}}class ComponentRef extends ComponentRef$1{constructor(componentType,instance,location,_rootLView,_tNode){super();this.location=location;this._rootLView=_rootLView;this._tNode=_tNode;this.previousInputValues=null;this.instance=instance;this.hostView=this.changeDetectorRef=new ViewRef$1(_rootLView,undefined,false);this.componentType=componentType}setInput(name,value){const inputData=this._tNode.inputs;let dataValue;if(inputData!==null&&(dataValue=inputData[name])){this.previousInputValues??=new Map;if(this.previousInputValues.has(name)&&Object.is(this.previousInputValues.get(name),value)){return}const lView=this._rootLView;setInputsForProperty(lView[TVIEW],lView,dataValue,name,value);this.previousInputValues.set(name,value);const childComponentLView=getComponentLViewByIndex(this._tNode.index,lView);markViewDirty(childComponentLView)}else{if(ngDevMode){const cmpNameForError=stringifyForError(this.componentType);let message=`Can't set value of the '${name}' input on the '${cmpNameForError}' component. `;message+=`Make sure that the '${name}' property is annotated with @Input() or a mapped @Input('${name}') exists.`;reportUnknownPropertyError(message)}}}get injector(){return new NodeInjector(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(callback){this.hostView.onDestroy(callback)}}function createRootComponentTNode(lView,rNode){const tView=lView[TVIEW];const index=HEADER_OFFSET;ngDevMode&&assertIndexInRange(lView,index);lView[index]=rNode;return getOrCreateTNode(tView,index,2,"#host",null)}function createRootComponentView(tNode,hostRNode,rootComponentDef,rootDirectives,rootView,environment,hostRenderer){const tView=rootView[TVIEW];applyRootComponentStyling(rootDirectives,tNode,hostRNode,hostRenderer);let hydrationInfo=null;if(hostRNode!==null){hydrationInfo=retrieveHydrationInfo(hostRNode,rootView[INJECTOR])}const viewRenderer=environment.rendererFactory.createRenderer(hostRNode,rootComponentDef);let lViewFlags=16;if(rootComponentDef.signals){lViewFlags=4096}else if(rootComponentDef.onPush){lViewFlags=64}const componentView=createLView(rootView,getOrCreateComponentTView(rootComponentDef),null,lViewFlags,rootView[tNode.index],tNode,environment,viewRenderer,null,null,hydrationInfo);if(tView.firstCreatePass){markAsComponentHost(tView,tNode,rootDirectives.length-1)}addToViewTree(rootView,componentView);return rootView[tNode.index]=componentView}function applyRootComponentStyling(rootDirectives,tNode,rNode,hostRenderer){for(const def of rootDirectives){tNode.mergedAttrs=mergeHostAttrs(tNode.mergedAttrs,def.hostAttrs)}if(tNode.mergedAttrs!==null){computeStaticStyling(tNode,tNode.mergedAttrs,true);if(rNode!==null){setupStaticAttributes(hostRenderer,rNode,tNode)}}}function createRootComponent(componentView,rootComponentDef,rootDirectives,hostDirectiveDefs,rootLView,hostFeatures){const rootTNode=getCurrentTNode();ngDevMode&&assertDefined(rootTNode,"tNode should have been already created");const tView=rootLView[TVIEW];const native=getNativeByTNode(rootTNode,rootLView);initializeDirectives(tView,rootLView,rootTNode,rootDirectives,null,hostDirectiveDefs);for(let i=0;i<rootDirectives.length;i++){const directiveIndex=rootTNode.directiveStart+i;const directiveInstance=getNodeInjectable(rootLView,tView,directiveIndex,rootTNode);attachPatchData(directiveInstance,rootLView)}invokeDirectivesHostBindings(tView,rootLView,rootTNode);if(native){attachPatchData(native,rootLView)}ngDevMode&&assertGreaterThan(rootTNode.componentOffset,-1,"componentOffset must be great than -1");const component=getNodeInjectable(rootLView,tView,rootTNode.directiveStart+rootTNode.componentOffset,rootTNode);componentView[CONTEXT]=rootLView[CONTEXT]=component;if(hostFeatures!==null){for(const feature of hostFeatures){feature(component,rootComponentDef)}}executeContentQueries(tView,rootTNode,rootLView);return component}function setRootNodeAttributes(hostRenderer,componentDef,hostRNode,rootSelectorOrNode){if(rootSelectorOrNode){setUpAttributes(hostRenderer,hostRNode,["ng-version","17.3.11"])}else{const{attrs:attrs,classes:classes}=extractAttrsAndClassesFromSelector(componentDef.selectors[0]);if(attrs){setUpAttributes(hostRenderer,hostRNode,attrs)}if(classes&&classes.length>0){writeDirectClass(hostRenderer,hostRNode,classes.join(" "))}}}function projectNodes(tNode,ngContentSelectors,projectableNodes){const projection=tNode.projection=[];for(let i=0;i<ngContentSelectors.length;i++){const nodesforSlot=projectableNodes[i];projection.push(nodesforSlot!=null?Array.from(nodesforSlot):null)}}function LifecycleHooksFeature(){const tNode=getCurrentTNode();ngDevMode&&assertDefined(tNode,"TNode is required");registerPostOrderHooks(getLView()[TVIEW],tNode)}class ViewContainerRef{static{this.__NG_ELEMENT_ID__=injectViewContainerRef}}function injectViewContainerRef(){const previousTNode=getCurrentTNode();return createContainerRef(previousTNode,getLView())}const VE_ViewContainerRef=ViewContainerRef;const R3ViewContainerRef=class ViewContainerRef extends VE_ViewContainerRef{constructor(_lContainer,_hostTNode,_hostLView){super();this._lContainer=_lContainer;this._hostTNode=_hostTNode;this._hostLView=_hostLView}get element(){return createElementRef(this._hostTNode,this._hostLView)}get injector(){return new NodeInjector(this._hostTNode,this._hostLView)}get parentInjector(){const parentLocation=getParentInjectorLocation(this._hostTNode,this._hostLView);if(hasParentInjector(parentLocation)){const parentView=getParentInjectorView(parentLocation,this._hostLView);const injectorIndex=getParentInjectorIndex(parentLocation);ngDevMode&&assertNodeInjector(parentView,injectorIndex);const parentTNode=parentView[TVIEW].data[injectorIndex+8];return new NodeInjector(parentTNode,parentView)}else{return new NodeInjector(null,this._hostLView)}}clear(){while(this.length>0){this.remove(this.length-1)}}get(index){const viewRefs=getViewRefs(this._lContainer);return viewRefs!==null&&viewRefs[index]||null}get length(){return this._lContainer.length-CONTAINER_HEADER_OFFSET}createEmbeddedView(templateRef,context,indexOrOptions){let index;let injector;if(typeof indexOrOptions==="number"){index=indexOrOptions}else if(indexOrOptions!=null){index=indexOrOptions.index;injector=indexOrOptions.injector}const dehydratedView=findMatchingDehydratedView(this._lContainer,templateRef.ssrId);const viewRef=templateRef.createEmbeddedViewImpl(context||{},injector,dehydratedView);this.insertImpl(viewRef,index,shouldAddViewToDom(this._hostTNode,dehydratedView));return viewRef}createComponent(componentFactoryOrType,indexOrOptions,injector,projectableNodes,environmentInjector){const isComponentFactory=componentFactoryOrType&&!isType(componentFactoryOrType);let index;if(isComponentFactory){if(ngDevMode){assertEqual(typeof indexOrOptions!=="object",true,"It looks like Component factory was provided as the first argument "+"and an options object as the second argument. This combination of arguments "+"is incompatible. You can either change the first argument to provide Component "+"type or change the second argument to be a number (representing an index at "+"which to insert the new component's host view into this container)")}index=indexOrOptions}else{if(ngDevMode){assertDefined(getComponentDef(componentFactoryOrType),`Provided Component class doesn't contain Component definition. `+`Please check whether provided class has @Component decorator.`);assertEqual(typeof indexOrOptions!=="number",true,"It looks like Component type was provided as the first argument "+"and a number (representing an index at which to insert the new component's "+"host view into this container as the second argument. This combination of arguments "+"is incompatible. Please use an object as the second argument instead.")}const options=indexOrOptions||{};if(ngDevMode&&options.environmentInjector&&options.ngModuleRef){throwError(`Cannot pass both environmentInjector and ngModuleRef options to createComponent().`)}index=options.index;injector=options.injector;projectableNodes=options.projectableNodes;environmentInjector=options.environmentInjector||options.ngModuleRef}const componentFactory=isComponentFactory?componentFactoryOrType:new ComponentFactory(getComponentDef(componentFactoryOrType));const contextInjector=injector||this.parentInjector;if(!environmentInjector&&componentFactory.ngModule==null){const _injector=isComponentFactory?contextInjector:this.parentInjector;const result=_injector.get(EnvironmentInjector,null);if(result){environmentInjector=result}}const componentDef=getComponentDef(componentFactory.componentType??{});const dehydratedView=findMatchingDehydratedView(this._lContainer,componentDef?.id??null);const rNode=dehydratedView?.firstChild??null;const componentRef=componentFactory.create(contextInjector,projectableNodes,rNode,environmentInjector);this.insertImpl(componentRef.hostView,index,shouldAddViewToDom(this._hostTNode,dehydratedView));return componentRef}insert(viewRef,index){return this.insertImpl(viewRef,index,true)}insertImpl(viewRef,index,addToDOM){const lView=viewRef._lView;if(ngDevMode&&viewRef.destroyed){throw new Error("Cannot insert a destroyed View in a ViewContainer!")}if(viewAttachedToContainer(lView)){const prevIdx=this.indexOf(viewRef);if(prevIdx!==-1){this.detach(prevIdx)}else{const prevLContainer=lView[PARENT];ngDevMode&&assertEqual(isLContainer(prevLContainer),true,"An attached view should have its PARENT point to a container.");const prevVCRef=new R3ViewContainerRef(prevLContainer,prevLContainer[T_HOST],prevLContainer[PARENT]);prevVCRef.detach(prevVCRef.indexOf(viewRef))}}const adjustedIdx=this._adjustIndex(index);const lContainer=this._lContainer;addLViewToLContainer(lContainer,lView,adjustedIdx,addToDOM);viewRef.attachToViewContainerRef();addToArray(getOrCreateViewRefs(lContainer),adjustedIdx,viewRef);return viewRef}move(viewRef,newIndex){if(ngDevMode&&viewRef.destroyed){throw new Error("Cannot move a destroyed View in a ViewContainer!")}return this.insert(viewRef,newIndex)}indexOf(viewRef){const viewRefsArr=getViewRefs(this._lContainer);return viewRefsArr!==null?viewRefsArr.indexOf(viewRef):-1}remove(index){const adjustedIdx=this._adjustIndex(index,-1);const detachedView=detachView(this._lContainer,adjustedIdx);if(detachedView){removeFromArray(getOrCreateViewRefs(this._lContainer),adjustedIdx);destroyLView(detachedView[TVIEW],detachedView)}}detach(index){const adjustedIdx=this._adjustIndex(index,-1);const view=detachView(this._lContainer,adjustedIdx);const wasDetached=view&&removeFromArray(getOrCreateViewRefs(this._lContainer),adjustedIdx)!=null;return wasDetached?new ViewRef$1(view):null}_adjustIndex(index,shift=0){if(index==null){return this.length+shift}if(ngDevMode){assertGreaterThan(index,-1,`ViewRef index must be positive, got ${index}`);assertLessThan(index,this.length+1+shift,"index")}return index}};function getViewRefs(lContainer){return lContainer[VIEW_REFS]}function getOrCreateViewRefs(lContainer){return lContainer[VIEW_REFS]||(lContainer[VIEW_REFS]=[])}function createContainerRef(hostTNode,hostLView){ngDevMode&&assertTNodeType(hostTNode,12|3);let lContainer;const slotValue=hostLView[hostTNode.index];if(isLContainer(slotValue)){lContainer=slotValue}else{lContainer=createLContainer(slotValue,hostLView,null,hostTNode);hostLView[hostTNode.index]=lContainer;addToViewTree(hostLView,lContainer)}_locateOrCreateAnchorNode(lContainer,hostLView,hostTNode,slotValue);return new R3ViewContainerRef(lContainer,hostTNode,hostLView)}function insertAnchorNode(hostLView,hostTNode){const renderer=hostLView[RENDERER];ngDevMode&&ngDevMode.rendererCreateComment++;const commentNode=renderer.createComment(ngDevMode?"container":"");const hostNative=getNativeByTNode(hostTNode,hostLView);const parentOfHostNative=nativeParentNode(renderer,hostNative);nativeInsertBefore(renderer,parentOfHostNative,commentNode,nativeNextSibling(renderer,hostNative),false);return commentNode}let _locateOrCreateAnchorNode=createAnchorNode;let _populateDehydratedViewsInLContainer=()=>false;function populateDehydratedViewsInLContainer(lContainer,tNode,hostLView){return _populateDehydratedViewsInLContainer(lContainer,tNode,hostLView)}function createAnchorNode(lContainer,hostLView,hostTNode,slotValue){if(lContainer[NATIVE])return;let commentNode;if(hostTNode.type&8){commentNode=unwrapRNode(slotValue)}else{commentNode=insertAnchorNode(hostLView,hostTNode)}lContainer[NATIVE]=commentNode}function populateDehydratedViewsInLContainerImpl(lContainer,tNode,hostLView){if(lContainer[NATIVE]&&lContainer[DEHYDRATED_VIEWS]){return true}const hydrationInfo=hostLView[HYDRATION];const noOffsetIndex=tNode.index-HEADER_OFFSET;const isNodeCreationMode=!hydrationInfo||isInSkipHydrationBlock(tNode)||isDisconnectedNode$1(hydrationInfo,noOffsetIndex);if(isNodeCreationMode){return false}const currentRNode=getSegmentHead(hydrationInfo,noOffsetIndex);const serializedViews=hydrationInfo.data[CONTAINERS]?.[noOffsetIndex];ngDevMode&&assertDefined(serializedViews,"Unexpected state: no hydration info available for a given TNode, "+"which represents a view container.");const[commentNode,dehydratedViews]=locateDehydratedViewsInContainer(currentRNode,serializedViews);if(ngDevMode){validateMatchingNode(commentNode,Node.COMMENT_NODE,null,hostLView,tNode,true);markRNodeAsClaimedByHydration(commentNode,false)}lContainer[NATIVE]=commentNode;lContainer[DEHYDRATED_VIEWS]=dehydratedViews;return true}function locateOrCreateAnchorNode(lContainer,hostLView,hostTNode,slotValue){if(!_populateDehydratedViewsInLContainer(lContainer,hostTNode,hostLView)){createAnchorNode(lContainer,hostLView,hostTNode,slotValue)}}function enableLocateOrCreateContainerRefImpl(){_locateOrCreateAnchorNode=locateOrCreateAnchorNode;_populateDehydratedViewsInLContainer=populateDehydratedViewsInLContainerImpl}class LQuery_{constructor(queryList){this.queryList=queryList;this.matches=null}clone(){return new LQuery_(this.queryList)}setDirty(){this.queryList.setDirty()}}class LQueries_{constructor(queries=[]){this.queries=queries}createEmbeddedView(tView){const tQueries=tView.queries;if(tQueries!==null){const noOfInheritedQueries=tView.contentQueries!==null?tView.contentQueries[0]:tQueries.length;const viewLQueries=[];for(let i=0;i<noOfInheritedQueries;i++){const tQuery=tQueries.getByIndex(i);const parentLQuery=this.queries[tQuery.indexInDeclarationView];viewLQueries.push(parentLQuery.clone())}return new LQueries_(viewLQueries)}return null}insertView(tView){this.dirtyQueriesWithMatches(tView)}detachView(tView){this.dirtyQueriesWithMatches(tView)}finishViewCreation(tView){this.dirtyQueriesWithMatches(tView)}dirtyQueriesWithMatches(tView){for(let i=0;i<this.queries.length;i++){if(getTQuery(tView,i).matches!==null){this.queries[i].setDirty()}}}}class TQueryMetadata_{constructor(predicate,flags,read=null){this.flags=flags;this.read=read;if(typeof predicate==="string"){this.predicate=splitQueryMultiSelectors(predicate)}else{this.predicate=predicate}}}class TQueries_{constructor(queries=[]){this.queries=queries}elementStart(tView,tNode){ngDevMode&&assertFirstCreatePass(tView,"Queries should collect results on the first template pass only");for(let i=0;i<this.queries.length;i++){this.queries[i].elementStart(tView,tNode)}}elementEnd(tNode){for(let i=0;i<this.queries.length;i++){this.queries[i].elementEnd(tNode)}}embeddedTView(tNode){let queriesForTemplateRef=null;for(let i=0;i<this.length;i++){const childQueryIndex=queriesForTemplateRef!==null?queriesForTemplateRef.length:0;const tqueryClone=this.getByIndex(i).embeddedTView(tNode,childQueryIndex);if(tqueryClone){tqueryClone.indexInDeclarationView=i;if(queriesForTemplateRef!==null){queriesForTemplateRef.push(tqueryClone)}else{queriesForTemplateRef=[tqueryClone]}}}return queriesForTemplateRef!==null?new TQueries_(queriesForTemplateRef):null}template(tView,tNode){ngDevMode&&assertFirstCreatePass(tView,"Queries should collect results on the first template pass only");for(let i=0;i<this.queries.length;i++){this.queries[i].template(tView,tNode)}}getByIndex(index){ngDevMode&&assertIndexInRange(this.queries,index);return this.queries[index]}get length(){return this.queries.length}track(tquery){this.queries.push(tquery)}}class TQuery_{constructor(metadata,nodeIndex=-1){this.metadata=metadata;this.matches=null;this.indexInDeclarationView=-1;this.crossesNgTemplate=false;this._appliesToNextNode=true;this._declarationNodeIndex=nodeIndex}elementStart(tView,tNode){if(this.isApplyingToNode(tNode)){this.matchTNode(tView,tNode)}}elementEnd(tNode){if(this._declarationNodeIndex===tNode.index){this._appliesToNextNode=false}}template(tView,tNode){this.elementStart(tView,tNode)}embeddedTView(tNode,childQueryIndex){if(this.isApplyingToNode(tNode)){this.crossesNgTemplate=true;this.addMatch(-tNode.index,childQueryIndex);return new TQuery_(this.metadata)}return null}isApplyingToNode(tNode){if(this._appliesToNextNode&&(this.metadata.flags&1)!==1){const declarationNodeIdx=this._declarationNodeIndex;let parent=tNode.parent;while(parent!==null&&parent.type&8&&parent.index!==declarationNodeIdx){parent=parent.parent}return declarationNodeIdx===(parent!==null?parent.index:-1)}return this._appliesToNextNode}matchTNode(tView,tNode){const predicate=this.metadata.predicate;if(Array.isArray(predicate)){for(let i=0;i<predicate.length;i++){const name=predicate[i];this.matchTNodeWithReadOption(tView,tNode,getIdxOfMatchingSelector(tNode,name));this.matchTNodeWithReadOption(tView,tNode,locateDirectiveOrProvider(tNode,tView,name,false,false))}}else{if(predicate===TemplateRef){if(tNode.type&4){this.matchTNodeWithReadOption(tView,tNode,-1)}}else{this.matchTNodeWithReadOption(tView,tNode,locateDirectiveOrProvider(tNode,tView,predicate,false,false))}}}matchTNodeWithReadOption(tView,tNode,nodeMatchIdx){if(nodeMatchIdx!==null){const read=this.metadata.read;if(read!==null){if(read===ElementRef||read===ViewContainerRef||read===TemplateRef&&tNode.type&4){this.addMatch(tNode.index,-2)}else{const directiveOrProviderIdx=locateDirectiveOrProvider(tNode,tView,read,false,false);if(directiveOrProviderIdx!==null){this.addMatch(tNode.index,directiveOrProviderIdx)}}}else{this.addMatch(tNode.index,nodeMatchIdx)}}}addMatch(tNodeIdx,matchIdx){if(this.matches===null){this.matches=[tNodeIdx,matchIdx]}else{this.matches.push(tNodeIdx,matchIdx)}}}function getIdxOfMatchingSelector(tNode,selector){const localNames=tNode.localNames;if(localNames!==null){for(let i=0;i<localNames.length;i+=2){if(localNames[i]===selector){return localNames[i+1]}}}return null}function createResultByTNodeType(tNode,currentView){if(tNode.type&(3|8)){return createElementRef(tNode,currentView)}else if(tNode.type&4){return createTemplateRef(tNode,currentView)}return null}function createResultForNode(lView,tNode,matchingIdx,read){if(matchingIdx===-1){return createResultByTNodeType(tNode,lView)}else if(matchingIdx===-2){return createSpecialToken(lView,tNode,read)}else{return getNodeInjectable(lView,lView[TVIEW],matchingIdx,tNode)}}function createSpecialToken(lView,tNode,read){if(read===ElementRef){return createElementRef(tNode,lView)}else if(read===TemplateRef){return createTemplateRef(tNode,lView)}else if(read===ViewContainerRef){ngDevMode&&assertTNodeType(tNode,3|12);return createContainerRef(tNode,lView)}else{ngDevMode&&throwError(`Special token to read should be one of ElementRef, TemplateRef or ViewContainerRef but got ${stringify(read)}.`)}}function materializeViewResults(tView,lView,tQuery,queryIndex){const lQuery=lView[QUERIES].queries[queryIndex];if(lQuery.matches===null){const tViewData=tView.data;const tQueryMatches=tQuery.matches;const result=[];for(let i=0;tQueryMatches!==null&&i<tQueryMatches.length;i+=2){const matchedNodeIdx=tQueryMatches[i];if(matchedNodeIdx<0){result.push(null)}else{ngDevMode&&assertIndexInRange(tViewData,matchedNodeIdx);const tNode=tViewData[matchedNodeIdx];result.push(createResultForNode(lView,tNode,tQueryMatches[i+1],tQuery.metadata.read))}}lQuery.matches=result}return lQuery.matches}function collectQueryResults(tView,lView,queryIndex,result){const tQuery=tView.queries.getByIndex(queryIndex);const tQueryMatches=tQuery.matches;if(tQueryMatches!==null){const lViewResults=materializeViewResults(tView,lView,tQuery,queryIndex);for(let i=0;i<tQueryMatches.length;i+=2){const tNodeIdx=tQueryMatches[i];if(tNodeIdx>0){result.push(lViewResults[i/2])}else{const childQueryIndex=tQueryMatches[i+1];const declarationLContainer=lView[-tNodeIdx];ngDevMode&&assertLContainer(declarationLContainer);for(let i=CONTAINER_HEADER_OFFSET;i<declarationLContainer.length;i++){const embeddedLView=declarationLContainer[i];if(embeddedLView[DECLARATION_LCONTAINER]===embeddedLView[PARENT]){collectQueryResults(embeddedLView[TVIEW],embeddedLView,childQueryIndex,result)}}if(declarationLContainer[MOVED_VIEWS]!==null){const embeddedLViews=declarationLContainer[MOVED_VIEWS];for(let i=0;i<embeddedLViews.length;i++){const embeddedLView=embeddedLViews[i];collectQueryResults(embeddedLView[TVIEW],embeddedLView,childQueryIndex,result)}}}}}return result}function loadQueryInternal(lView,queryIndex){ngDevMode&&assertDefined(lView[QUERIES],"LQueries should be defined when trying to load a query");ngDevMode&&assertIndexInRange(lView[QUERIES].queries,queryIndex);return lView[QUERIES].queries[queryIndex].queryList}function createLQuery(tView,lView,flags){const queryList=new QueryList((flags&4)===4);storeCleanupWithContext(tView,lView,queryList,queryList.destroy);const lQueries=(lView[QUERIES]??=new LQueries_).queries;return lQueries.push(new LQuery_(queryList))-1}function createViewQuery(predicate,flags,read){ngDevMode&&assertNumber(flags,"Expecting flags");const tView=getTView();if(tView.firstCreatePass){createTQuery(tView,new TQueryMetadata_(predicate,flags,read),-1);if((flags&2)===2){tView.staticViewQueries=true}}return createLQuery(tView,getLView(),flags)}function createContentQuery(directiveIndex,predicate,flags,read){ngDevMode&&assertNumber(flags,"Expecting flags");const tView=getTView();if(tView.firstCreatePass){const tNode=getCurrentTNode();createTQuery(tView,new TQueryMetadata_(predicate,flags,read),tNode.index);saveContentQueryAndDirectiveIndex(tView,directiveIndex);if((flags&2)===2){tView.staticContentQueries=true}}return createLQuery(tView,getLView(),flags)}function splitQueryMultiSelectors(locator){return locator.split(",").map((s=>s.trim()))}function createTQuery(tView,metadata,nodeIndex){if(tView.queries===null)tView.queries=new TQueries_;tView.queries.track(new TQuery_(metadata,nodeIndex))}function saveContentQueryAndDirectiveIndex(tView,directiveIndex){const tViewContentQueries=tView.contentQueries||(tView.contentQueries=[]);const lastSavedDirectiveIndex=tViewContentQueries.length?tViewContentQueries[tViewContentQueries.length-1]:-1;if(directiveIndex!==lastSavedDirectiveIndex){tViewContentQueries.push(tView.queries.length-1,directiveIndex)}}function getTQuery(tView,index){ngDevMode&&assertDefined(tView.queries,"TQueries must be defined to retrieve a TQuery");return tView.queries.getByIndex(index)}function getQueryResults(lView,queryIndex){const tView=lView[TVIEW];const tQuery=getTQuery(tView,queryIndex);return tQuery.crossesNgTemplate?collectQueryResults(tView,lView,queryIndex,[]):materializeViewResults(tView,lView,tQuery,queryIndex)}function isSignal(value){return typeof value==="function"&&value[signals.SIGNAL]!==undefined}function \u0275unwrapWritableSignal(value){return null}function signal(initialValue,options){performanceMarkFeature("NgSignals");const signalFn=signals.createSignal(initialValue);const node=signalFn[signals.SIGNAL];if(options?.equal){node.equal=options.equal}signalFn.set=newValue=>signals.signalSetFn(node,newValue);signalFn.update=updateFn=>signals.signalUpdateFn(node,updateFn);signalFn.asReadonly=signalAsReadonlyFn.bind(signalFn);if(ngDevMode){signalFn.toString=()=>`[Signal: ${signalFn()}]`}return signalFn}function signalAsReadonlyFn(){const node=this[signals.SIGNAL];if(node.readonlyFn===undefined){const readonlyFn=()=>this();readonlyFn[signals.SIGNAL]=node;node.readonlyFn=readonlyFn}return node.readonlyFn}function isWritableSignal(value){return isSignal(value)&&typeof value.set==="function"}function createQuerySignalFn(firstOnly,required){let node;const signalFn=signals.createComputed((()=>{node._dirtyCounter();const value=refreshSignalQuery(node,firstOnly);if(required&&value===undefined){throw new RuntimeError(-951,ngDevMode&&"Child query result is required but no value is available.")}return value}));node=signalFn[signals.SIGNAL];node._dirtyCounter=signal(0);node._flatValue=undefined;if(ngDevMode){signalFn.toString=()=>`[Query Signal]`}return signalFn}function createSingleResultOptionalQuerySignalFn(){return createQuerySignalFn(true,false)}function createSingleResultRequiredQuerySignalFn(){return createQuerySignalFn(true,true)}function createMultiResultQuerySignalFn(){return createQuerySignalFn(false,false)}function bindQueryToSignal(target,queryIndex){const node=target[signals.SIGNAL];node._lView=getLView();node._queryIndex=queryIndex;node._queryList=loadQueryInternal(node._lView,queryIndex);node._queryList.onDirty((()=>node._dirtyCounter.update((v=>v+1))))}function refreshSignalQuery(node,firstOnly){const lView=node._lView;const queryIndex=node._queryIndex;if(lView===undefined||queryIndex===undefined||lView[FLAGS]&4){return firstOnly?undefined:EMPTY_ARRAY}const queryList=loadQueryInternal(lView,queryIndex);const results=getQueryResults(lView,queryIndex);queryList.reset(results,unwrapElementRef);if(firstOnly){return queryList.first}else{const resultChanged=queryList._changesDetected;if(resultChanged||node._flatValue===undefined){return node._flatValue=queryList.toArray()}return node._flatValue}}function viewChildFn(locator,opts){ngDevMode&&assertInInjectionContext(viewChild);return createSingleResultOptionalQuerySignalFn()}function viewChildRequiredFn(locator,opts){ngDevMode&&assertInInjectionContext(viewChild);return createSingleResultRequiredQuerySignalFn()}const viewChild=(()=>{viewChildFn.required=viewChildRequiredFn;return viewChildFn})();function viewChildren(locator,opts){ngDevMode&&assertInInjectionContext(viewChildren);return createMultiResultQuerySignalFn()}function contentChildFn(locator,opts){ngDevMode&&assertInInjectionContext(contentChild);return createSingleResultOptionalQuerySignalFn()}function contentChildRequiredFn(locator,opts){ngDevMode&&assertInInjectionContext(contentChildren);return createSingleResultRequiredQuerySignalFn()}const contentChild=(()=>{contentChildFn.required=contentChildRequiredFn;return contentChildFn})();function contentChildren(locator,opts){return createMultiResultQuerySignalFn()}function createModelSignal(initialValue){const node=Object.create(INPUT_SIGNAL_NODE);const emitterRef=new OutputEmitterRef;node.value=initialValue;function getter(){signals.producerAccessed(node);assertModelSet(node.value);return node.value}getter[signals.SIGNAL]=node;getter.asReadonly=signalAsReadonlyFn.bind(getter);getter.set=newValue=>{if(!node.equal(node.value,newValue)){signals.signalSetFn(node,newValue);emitterRef.emit(newValue)}};getter.update=updateFn=>{assertModelSet(node.value);getter.set(updateFn(node.value))};getter.subscribe=emitterRef.subscribe.bind(emitterRef);getter.destroyRef=emitterRef.destroyRef;if(ngDevMode){getter.toString=()=>`[Model Signal: ${getter()}]`}return getter}function assertModelSet(value){if(value===REQUIRED_UNSET_VALUE){throw new RuntimeError(-952,ngDevMode&&"Model is required but no value is available yet.")}}function modelFunction(initialValue){ngDevMode&&assertInInjectionContext(model);return createModelSignal(initialValue)}function modelRequiredFunction(){ngDevMode&&assertInInjectionContext(model);return createModelSignal(REQUIRED_UNSET_VALUE)}const model=(()=>{modelFunction.required=modelRequiredFunction;return modelFunction})();const emitDistinctChangesOnlyDefaultValue=true;class Query{}const ContentChildren=makePropDecorator("ContentChildren",((selector,opts={})=>({selector:selector,first:false,isViewQuery:false,descendants:false,emitDistinctChangesOnly:emitDistinctChangesOnlyDefaultValue,...opts})),Query);const ContentChild=makePropDecorator("ContentChild",((selector,opts={})=>({selector:selector,first:true,isViewQuery:false,descendants:true,...opts})),Query);const ViewChildren=makePropDecorator("ViewChildren",((selector,opts={})=>({selector:selector,first:false,isViewQuery:true,descendants:true,emitDistinctChangesOnly:emitDistinctChangesOnlyDefaultValue,...opts})),Query);const ViewChild=makePropDecorator("ViewChild",((selector,opts)=>({selector:selector,first:true,isViewQuery:true,descendants:true,...opts})),Query);function resolveComponentResources(resourceResolver){const componentResolved=[];const urlMap=new Map;function cachedResourceResolve(url){let promise=urlMap.get(url);if(!promise){const resp=resourceResolver(url);urlMap.set(url,promise=resp.then(unwrapResponse))}return promise}componentResourceResolutionQueue.forEach(((component,type)=>{const promises=[];if(component.templateUrl){promises.push(cachedResourceResolve(component.templateUrl).then((template=>{component.template=template})))}const styles=typeof component.styles==="string"?[component.styles]:component.styles||[];component.styles=styles;if(component.styleUrl&&component.styleUrls?.length){throw new Error("@Component cannot define both `styleUrl` and `styleUrls`. "+"Use `styleUrl` if the component has one stylesheet, or `styleUrls` if it has multiple")}else if(component.styleUrls?.length){const styleOffset=component.styles.length;const styleUrls=component.styleUrls;component.styleUrls.forEach(((styleUrl,index)=>{styles.push("");promises.push(cachedResourceResolve(styleUrl).then((style=>{styles[styleOffset+index]=style;styleUrls.splice(styleUrls.indexOf(styleUrl),1);if(styleUrls.length==0){component.styleUrls=undefined}})))}))}else if(component.styleUrl){promises.push(cachedResourceResolve(component.styleUrl).then((style=>{styles.push(style);component.styleUrl=undefined})))}const fullyResolved=Promise.all(promises).then((()=>componentDefResolved(type)));componentResolved.push(fullyResolved)}));clearResolutionOfComponentResourcesQueue();return Promise.all(componentResolved).then((()=>undefined))}let componentResourceResolutionQueue=new Map;const componentDefPendingResolution=new Set;function maybeQueueResolutionOfComponentResources(type,metadata){if(componentNeedsResolution(metadata)){componentResourceResolutionQueue.set(type,metadata);componentDefPendingResolution.add(type)}}function isComponentDefPendingResolution(type){return componentDefPendingResolution.has(type)}function componentNeedsResolution(component){return!!(component.templateUrl&&!component.hasOwnProperty("template")||component.styleUrls&&component.styleUrls.length||component.styleUrl)}function clearResolutionOfComponentResourcesQueue(){const old=componentResourceResolutionQueue;componentResourceResolutionQueue=new Map;return old}function restoreComponentResolutionQueue(queue){componentDefPendingResolution.clear();queue.forEach(((_,type)=>componentDefPendingResolution.add(type)));componentResourceResolutionQueue=queue}function isComponentResourceResolutionQueueEmpty(){return componentResourceResolutionQueue.size===0}function unwrapResponse(response){return typeof response=="string"?response:response.text()}function componentDefResolved(type){componentDefPendingResolution.delete(type)}const modules=new Map;let checkForDuplicateNgModules=true;function assertSameOrNotExisting(id,type,incoming){if(type&&type!==incoming&&checkForDuplicateNgModules){throw new Error(`Duplicate module registered for ${id} - ${stringify(type)} vs ${stringify(type.name)}`)}}function registerNgModuleType(ngModuleType,id){const existing=modules.get(id)||null;assertSameOrNotExisting(id,existing,ngModuleType);modules.set(id,ngModuleType)}function getRegisteredNgModuleType(id){return modules.get(id)}function setAllowDuplicateNgModuleIdsForTest(allowDuplicates){checkForDuplicateNgModules=!allowDuplicates}function \u0275\u0275validateIframeAttribute(attrValue,tagName,attrName){const lView=getLView();const tNode=getSelectedTNode();const element=getNativeByTNode(tNode,lView);if(tNode.type===2&&tagName.toLowerCase()==="iframe"){const iframe=element;iframe.src="";iframe.srcdoc=trustedHTMLFromString("");nativeRemoveNode(lView[RENDERER],iframe);const errorMessage=ngDevMode&&`Angular has detected that the \`${attrName}\` was applied `+`as a binding to an <iframe>${getTemplateLocationDetails(lView)}. `+`For security reasons, the \`${attrName}\` can be set on an <iframe> `+`as a static attribute only. \n`+`To fix this, switch the \`${attrName}\` binding to a static attribute `+`in a template or in host bindings section.`;throw new RuntimeError(-910,errorMessage)}return attrValue}function getSuperType(type){return Object.getPrototypeOf(type.prototype).constructor}function \u0275\u0275InheritDefinitionFeature(definition){let superType=getSuperType(definition.type);let shouldInheritFields=true;const inheritanceChain=[definition];while(superType){let superDef=undefined;if(isComponentDef(definition)){superDef=superType.\u0275cmp||superType.\u0275dir}else{if(superType.\u0275cmp){throw new RuntimeError(903,ngDevMode&&`Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}`)}superDef=superType.\u0275dir}if(superDef){if(shouldInheritFields){inheritanceChain.push(superDef);const writeableDef=definition;writeableDef.inputs=maybeUnwrapEmpty(definition.inputs);writeableDef.inputTransforms=maybeUnwrapEmpty(definition.inputTransforms);writeableDef.declaredInputs=maybeUnwrapEmpty(definition.declaredInputs);writeableDef.outputs=maybeUnwrapEmpty(definition.outputs);const superHostBindings=superDef.hostBindings;superHostBindings&&inheritHostBindings(definition,superHostBindings);const superViewQuery=superDef.viewQuery;const superContentQueries=superDef.contentQueries;superViewQuery&&inheritViewQuery(definition,superViewQuery);superContentQueries&&inheritContentQueries(definition,superContentQueries);mergeInputsWithTransforms(definition,superDef);fillProperties(definition.outputs,superDef.outputs);if(isComponentDef(superDef)&&superDef.data.animation){const defData=definition.data;defData.animation=(defData.animation||[]).concat(superDef.data.animation)}}const features=superDef.features;if(features){for(let i=0;i<features.length;i++){const feature=features[i];if(feature&&feature.ngInherit){feature(definition)}if(feature===\u0275\u0275InheritDefinitionFeature){shouldInheritFields=false}}}}superType=Object.getPrototypeOf(superType)}mergeHostAttrsAcrossInheritance(inheritanceChain)}function mergeInputsWithTransforms(target,source){for(const key in source.inputs){if(!source.inputs.hasOwnProperty(key)){continue}if(target.inputs.hasOwnProperty(key)){continue}const value=source.inputs[key];if(value===undefined){continue}target.inputs[key]=value;target.declaredInputs[key]=source.declaredInputs[key];if(source.inputTransforms!==null){const minifiedName=Array.isArray(value)?value[0]:value;if(!source.inputTransforms.hasOwnProperty(minifiedName)){continue}target.inputTransforms??={};target.inputTransforms[minifiedName]=source.inputTransforms[minifiedName]}}}function mergeHostAttrsAcrossInheritance(inheritanceChain){let hostVars=0;let hostAttrs=null;for(let i=inheritanceChain.length-1;i>=0;i--){const def=inheritanceChain[i];def.hostVars=hostVars+=def.hostVars;def.hostAttrs=mergeHostAttrs(def.hostAttrs,hostAttrs=mergeHostAttrs(hostAttrs,def.hostAttrs))}}function maybeUnwrapEmpty(value){if(value===EMPTY_OBJ){return{}}else if(value===EMPTY_ARRAY){return[]}else{return value}}function inheritViewQuery(definition,superViewQuery){const prevViewQuery=definition.viewQuery;if(prevViewQuery){definition.viewQuery=(rf,ctx)=>{superViewQuery(rf,ctx);prevViewQuery(rf,ctx)}}else{definition.viewQuery=superViewQuery}}function inheritContentQueries(definition,superContentQueries){const prevContentQueries=definition.contentQueries;if(prevContentQueries){definition.contentQueries=(rf,ctx,directiveIndex)=>{superContentQueries(rf,ctx,directiveIndex);prevContentQueries(rf,ctx,directiveIndex)}}else{definition.contentQueries=superContentQueries}}function inheritHostBindings(definition,superHostBindings){const prevHostBindings=definition.hostBindings;if(prevHostBindings){definition.hostBindings=(rf,ctx)=>{superHostBindings(rf,ctx);prevHostBindings(rf,ctx)}}else{definition.hostBindings=superHostBindings}}const COPY_DIRECTIVE_FIELDS=["providersResolver"];const COPY_COMPONENT_FIELDS=["template","decls","consts","vars","onPush","ngContentSelectors","styles","encapsulation","schemas"];function \u0275\u0275CopyDefinitionFeature(definition){let superType=getSuperType(definition.type);let superDef=undefined;if(isComponentDef(definition)){superDef=superType.\u0275cmp}else{superDef=superType.\u0275dir}const defAny=definition;for(const field of COPY_DIRECTIVE_FIELDS){defAny[field]=superDef[field]}if(isComponentDef(superDef)){for(const field of COPY_COMPONENT_FIELDS){defAny[field]=superDef[field]}}}function \u0275\u0275HostDirectivesFeature(rawHostDirectives){const feature=definition=>{const resolved=(Array.isArray(rawHostDirectives)?rawHostDirectives:rawHostDirectives()).map((dir=>typeof dir==="function"?{directive:resolveForwardRef(dir),inputs:EMPTY_OBJ,outputs:EMPTY_OBJ}:{directive:resolveForwardRef(dir.directive),inputs:bindingArrayToMap(dir.inputs),outputs:bindingArrayToMap(dir.outputs)}));if(definition.hostDirectives===null){definition.findHostDirectiveDefs=findHostDirectiveDefs;definition.hostDirectives=resolved}else{definition.hostDirectives.unshift(...resolved)}};feature.ngInherit=true;return feature}function findHostDirectiveDefs(currentDef,matchedDefs,hostDirectiveDefs){if(currentDef.hostDirectives!==null){for(const hostDirectiveConfig of currentDef.hostDirectives){const hostDirectiveDef=getDirectiveDef(hostDirectiveConfig.directive);if(typeof ngDevMode==="undefined"||ngDevMode){validateHostDirective(hostDirectiveConfig,hostDirectiveDef)}patchDeclaredInputs(hostDirectiveDef.declaredInputs,hostDirectiveConfig.inputs);findHostDirectiveDefs(hostDirectiveDef,matchedDefs,hostDirectiveDefs);hostDirectiveDefs.set(hostDirectiveDef,hostDirectiveConfig);matchedDefs.push(hostDirectiveDef)}}}function bindingArrayToMap(bindings){if(bindings===undefined||bindings.length===0){return EMPTY_OBJ}const result={};for(let i=0;i<bindings.length;i+=2){result[bindings[i]]=bindings[i+1]}return result}function patchDeclaredInputs(declaredInputs,exposedInputs){for(const publicName in exposedInputs){if(exposedInputs.hasOwnProperty(publicName)){const remappedPublicName=exposedInputs[publicName];const privateName=declaredInputs[publicName];if((typeof ngDevMode==="undefined"||ngDevMode)&&declaredInputs.hasOwnProperty(remappedPublicName)){assertEqual(declaredInputs[remappedPublicName],declaredInputs[publicName],`Conflicting host directive input alias ${publicName}.`)}declaredInputs[remappedPublicName]=privateName}}}function validateHostDirective(hostDirectiveConfig,directiveDef){const type=hostDirectiveConfig.directive;if(directiveDef===null){if(getComponentDef(type)!==null){throw new RuntimeError(310,`Host directive ${type.name} cannot be a component.`)}throw new RuntimeError(307,`Could not resolve metadata for host directive ${type.name}. `+`Make sure that the ${type.name} class is annotated with an @Directive decorator.`)}if(!directiveDef.standalone){throw new RuntimeError(308,`Host directive ${directiveDef.type.name} must be standalone.`)}validateMappings("input",directiveDef,hostDirectiveConfig.inputs);validateMappings("output",directiveDef,hostDirectiveConfig.outputs)}function validateMappings(bindingType,def,hostDirectiveBindings){const className=def.type.name;const bindings=bindingType==="input"?def.inputs:def.outputs;for(const publicName in hostDirectiveBindings){if(hostDirectiveBindings.hasOwnProperty(publicName)){if(!bindings.hasOwnProperty(publicName)){throw new RuntimeError(311,`Directive ${className} does not have an ${bindingType} with a public name of ${publicName}.`)}const remappedPublicName=hostDirectiveBindings[publicName];if(bindings.hasOwnProperty(remappedPublicName)&&remappedPublicName!==publicName){throw new RuntimeError(312,`Cannot alias ${bindingType} ${publicName} of host directive ${className} to ${remappedPublicName}, because it already has a different ${bindingType} with the same public name.`)}}}}function \u0275\u0275InputTransformsFeature(definition){const inputs=definition.inputConfig;const inputTransforms={};for(const minifiedKey in inputs){if(inputs.hasOwnProperty(minifiedKey)){const value=inputs[minifiedKey];if(Array.isArray(value)&&value[3]){inputTransforms[minifiedKey]=value[3]}}}definition.inputTransforms=inputTransforms}class NgModuleRef$1{}class NgModuleFactory$1{}function createNgModule(ngModule,parentInjector){return new NgModuleRef(ngModule,parentInjector??null,[])}const createNgModuleRef=createNgModule;class NgModuleRef extends NgModuleRef$1{constructor(ngModuleType,_parent,additionalProviders){super();this._parent=_parent;this._bootstrapComponents=[];this.destroyCbs=[];this.componentFactoryResolver=new ComponentFactoryResolver(this);const ngModuleDef=getNgModuleDef(ngModuleType);ngDevMode&&assertDefined(ngModuleDef,`NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`);this._bootstrapComponents=maybeUnwrapFn(ngModuleDef.bootstrap);this._r3Injector=createInjectorWithoutInjectorInstances(ngModuleType,_parent,[{provide:NgModuleRef$1,useValue:this},{provide:ComponentFactoryResolver$1,useValue:this.componentFactoryResolver},...additionalProviders],stringify(ngModuleType),new Set(["environment"]));this._r3Injector.resolveInjectorInitializers();this.instance=this._r3Injector.get(ngModuleType)}get injector(){return this._r3Injector}destroy(){ngDevMode&&assertDefined(this.destroyCbs,"NgModule already destroyed");const injector=this._r3Injector;!injector.destroyed&&injector.destroy();this.destroyCbs.forEach((fn=>fn()));this.destroyCbs=null}onDestroy(callback){ngDevMode&&assertDefined(this.destroyCbs,"NgModule already destroyed");this.destroyCbs.push(callback)}}class NgModuleFactory extends NgModuleFactory$1{constructor(moduleType){super();this.moduleType=moduleType}create(parentInjector){return new NgModuleRef(this.moduleType,parentInjector,[])}}function createNgModuleRefWithProviders(moduleType,parentInjector,additionalProviders){return new NgModuleRef(moduleType,parentInjector,additionalProviders)}class EnvironmentNgModuleRefAdapter extends NgModuleRef$1{constructor(config){super();this.componentFactoryResolver=new ComponentFactoryResolver(this);this.instance=null;const injector=new R3Injector([...config.providers,{provide:NgModuleRef$1,useValue:this},{provide:ComponentFactoryResolver$1,useValue:this.componentFactoryResolver}],config.parent||getNullInjector(),config.debugName,new Set(["environment"]));this.injector=injector;if(config.runEnvironmentInitializers){injector.resolveInjectorInitializers()}}destroy(){this.injector.destroy()}onDestroy(callback){this.injector.onDestroy(callback)}}function createEnvironmentInjector(providers,parent,debugName=null){const adapter=new EnvironmentNgModuleRefAdapter({providers:providers,parent:parent,debugName:debugName,runEnvironmentInitializers:true});return adapter.injector}class CachedInjectorService{constructor(){this.cachedInjectors=new Map}getOrCreateInjector(key,parentInjector,providers,debugName){if(!this.cachedInjectors.has(key)){const injector=providers.length>0?createEnvironmentInjector(providers,parentInjector,debugName):null;this.cachedInjectors.set(key,injector)}return this.cachedInjectors.get(key)}ngOnDestroy(){try{for(const injector of this.cachedInjectors.values()){if(injector!==null){injector.destroy()}}}finally{this.cachedInjectors.clear()}}static{this.\u0275prov=\u0275\u0275defineInjectable({token:CachedInjectorService,providedIn:"environment",factory:()=>new CachedInjectorService})}}const ASYNC_COMPONENT_METADATA_FN="__ngAsyncComponentMetadataFn__";function getAsyncClassMetadataFn(type){const componentClass=type;return componentClass[ASYNC_COMPONENT_METADATA_FN]??null}function setClassMetadataAsync(type,dependencyLoaderFn,metadataSetterFn){const componentClass=type;componentClass[ASYNC_COMPONENT_METADATA_FN]=()=>Promise.all(dependencyLoaderFn()).then((dependencies=>{metadataSetterFn(...dependencies);componentClass[ASYNC_COMPONENT_METADATA_FN]=null;return dependencies}));return componentClass[ASYNC_COMPONENT_METADATA_FN]}function setClassMetadata(type,decorators,ctorParameters,propDecorators){return noSideEffects((()=>{const clazz=type;if(decorators!==null){if(clazz.hasOwnProperty("decorators")&&clazz.decorators!==undefined){clazz.decorators.push(...decorators)}else{clazz.decorators=decorators}}if(ctorParameters!==null){clazz.ctorParameters=ctorParameters}if(propDecorators!==null){if(clazz.hasOwnProperty("propDecorators")&&clazz.propDecorators!==undefined){clazz.propDecorators={...clazz.propDecorators,...propDecorators}}else{clazz.propDecorators=propDecorators}}}))}class PendingTasks{constructor(){this.taskId=0;this.pendingTasks=new Set;this.hasPendingTasks=new rxjs.BehaviorSubject(false)}get _hasPendingTasks(){return this.hasPendingTasks.value}add(){if(!this._hasPendingTasks){this.hasPendingTasks.next(true)}const taskId=this.taskId++;this.pendingTasks.add(taskId);return taskId}remove(taskId){this.pendingTasks.delete(taskId);if(this.pendingTasks.size===0&&this._hasPendingTasks){this.hasPendingTasks.next(false)}}ngOnDestroy(){this.pendingTasks.clear();if(this._hasPendingTasks){this.hasPendingTasks.next(false)}}static{this.\u0275fac=function PendingTasks_Factory(t){return new(t||PendingTasks)}}static{this.\u0275prov=\u0275\u0275defineInjectable({token:PendingTasks,factory:PendingTasks.\u0275fac,providedIn:"root"})}}(()=>{(typeof ngDevMode==="undefined"||ngDevMode)&&setClassMetadata(PendingTasks,[{type:Injectable,args:[{providedIn:"root"}]}],null,null)})();function isListLikeIterable(obj){if(!isJsObject(obj))return false;return Array.isArray(obj)||!(obj instanceof Map)&&Symbol.iterator in obj}function areIterablesEqual(a,b,comparator){const iterator1=a[Symbol.iterator]();const iterator2=b[Symbol.iterator]();while(true){const item1=iterator1.next();const item2=iterator2.next();if(item1.done&&item2.done)return true;if(item1.done||item2.done)return false;if(!comparator(item1.value,item2.value))return false}}function iterateListLike(obj,fn){if(Array.isArray(obj)){for(let i=0;i<obj.length;i++){fn(obj[i])}}else{const iterator=obj[Symbol.iterator]();let item;while(!(item=iterator.next()).done){fn(item.value)}}}function isJsObject(o){return o!==null&&(typeof o==="function"||typeof o==="object")}function devModeEqual(a,b){const isListLikeIterableA=isListLikeIterable(a);const isListLikeIterableB=isListLikeIterable(b);if(isListLikeIterableA&&isListLikeIterableB){return areIterablesEqual(a,b,devModeEqual)}else{const isAObject=a&&(typeof a==="object"||typeof a==="function");const isBObject=b&&(typeof b==="object"||typeof b==="function");if(!isListLikeIterableA&&isAObject&&!isListLikeIterableB&&isBObject){return true}else{return Object.is(a,b)}}}function updateBinding(lView,bindingIndex,value){return lView[bindingIndex]=value}function getBinding(lView,bindingIndex){ngDevMode&&assertIndexInRange(lView,bindingIndex);ngDevMode&&assertNotSame(lView[bindingIndex],NO_CHANGE,"Stored value should never be NO_CHANGE.");return lView[bindingIndex]}function bindingUpdated(lView,bindingIndex,value){ngDevMode&&assertNotSame(value,NO_CHANGE,"Incoming value should never be NO_CHANGE.");ngDevMode&&assertLessThan(bindingIndex,lView.length,`Slot should have been initialized to NO_CHANGE`);const oldValue=lView[bindingIndex];if(Object.is(oldValue,value)){return false}else{if(ngDevMode&&isInCheckNoChangesMode()){const oldValueToCompare=oldValue!==NO_CHANGE?oldValue:undefined;if(!devModeEqual(oldValueToCompare,value)){const details=getExpressionChangedErrorDetails(lView,bindingIndex,oldValueToCompare,value);throwErrorIfNoChangesMode(oldValue===NO_CHANGE,details.oldValue,details.newValue,details.propName,lView)}return false}lView[bindingIndex]=value;return true}}function bindingUpdated2(lView,bindingIndex,exp1,exp2){const different=bindingUpdated(lView,bindingIndex,exp1);return bindingUpdated(lView,bindingIndex+1,exp2)||different}function bindingUpdated3(lView,bindingIndex,exp1,exp2,exp3){const different=bindingUpdated2(lView,bindingIndex,exp1,exp2);return bindingUpdated(lView,bindingIndex+2,exp3)||different}function bindingUpdated4(lView,bindingIndex,exp1,exp2,exp3,exp4){const different=bindingUpdated2(lView,bindingIndex,exp1,exp2);return bindingUpdated2(lView,bindingIndex+2,exp3,exp4)||different}function isDetachedByI18n(tNode){return(tNode.flags&32)===32}function templateFirstCreatePass(index,tView,lView,templateFn,decls,vars,tagName,attrsIndex,localRefsIndex){ngDevMode&&assertFirstCreatePass(tView);ngDevMode&&ngDevMode.firstCreatePass++;const tViewConsts=tView.consts;const tNode=getOrCreateTNode(tView,index,4,tagName||null,getConstant(tViewConsts,attrsIndex));resolveDirectives(tView,lView,tNode,getConstant(tViewConsts,localRefsIndex));registerPostOrderHooks(tView,tNode);const embeddedTView=tNode.tView=createTView(2,tNode,templateFn,decls,vars,tView.directiveRegistry,tView.pipeRegistry,null,tView.schemas,tViewConsts,null);if(tView.queries!==null){tView.queries.template(tView,tNode);embeddedTView.queries=tView.queries.embeddedTView(tNode)}return tNode}function \u0275\u0275template(index,templateFn,decls,vars,tagName,attrsIndex,localRefsIndex,localRefExtractor){const lView=getLView();const tView=getTView();const adjustedIndex=index+HEADER_OFFSET;const tNode=tView.firstCreatePass?templateFirstCreatePass(adjustedIndex,tView,lView,templateFn,decls,vars,tagName,attrsIndex,localRefsIndex):tView.data[adjustedIndex];setCurrentTNode(tNode,false);const comment=_locateOrCreateContainerAnchor(tView,lView,tNode,index);if(wasLastNodeCreated()){appendChild(tView,lView,comment,tNode)}attachPatchData(comment,lView);const lContainer=createLContainer(comment,lView,comment,tNode);lView[adjustedIndex]=lContainer;addToViewTree(lView,lContainer);populateDehydratedViewsInLContainer(lContainer,tNode,lView);if(isDirectiveHost(tNode)){createDirectivesInstances(tView,lView,tNode)}if(localRefsIndex!=null){saveResolvedLocalsInData(lView,tNode,localRefExtractor)}return \u0275\u0275template}let _locateOrCreateContainerAnchor=createContainerAnchorImpl;function createContainerAnchorImpl(tView,lView,tNode,index){lastNodeWasCreated(true);return lView[RENDERER].createComment(ngDevMode?"container":"")}function locateOrCreateContainerAnchorImpl(tView,lView,tNode,index){const hydrationInfo=lView[HYDRATION];const isNodeCreationMode=!hydrationInfo||isInSkipHydrationBlock$1()||isDetachedByI18n(tNode)||isDisconnectedNode$1(hydrationInfo,index);lastNodeWasCreated(isNodeCreationMode);if(isNodeCreationMode){return createContainerAnchorImpl(tView,lView)}const ssrId=hydrationInfo.data[TEMPLATES]?.[index]??null;if(ssrId!==null&&tNode.tView!==null){if(tNode.tView.ssrId===null){tNode.tView.ssrId=ssrId}else{ngDevMode&&assertEqual(tNode.tView.ssrId,ssrId,"Unexpected value of the `ssrId` for this TView")}}const currentRNode=locateNextRNode(hydrationInfo,tView,lView,tNode);ngDevMode&&validateNodeExists(currentRNode,lView,tNode);setSegmentHead(hydrationInfo,index,currentRNode);const viewContainerSize=calcSerializedContainerSize(hydrationInfo,index);const comment=siblingAfter(viewContainerSize,currentRNode);if(ngDevMode){validateMatchingNode(comment,Node.COMMENT_NODE,null,lView,tNode);markRNodeAsClaimedByHydration(comment)}return comment}function enableLocateOrCreateContainerAnchorImpl(){_locateOrCreateContainerAnchor=locateOrCreateContainerAnchorImpl}var DeferDependenciesLoadingState;(function(DeferDependenciesLoadingState){DeferDependenciesLoadingState[DeferDependenciesLoadingState["NOT_STARTED"]=0]="NOT_STARTED";DeferDependenciesLoadingState[DeferDependenciesLoadingState["IN_PROGRESS"]=1]="IN_PROGRESS";DeferDependenciesLoadingState[DeferDependenciesLoadingState["COMPLETE"]=2]="COMPLETE";DeferDependenciesLoadingState[DeferDependenciesLoadingState["FAILED"]=3]="FAILED"})(DeferDependenciesLoadingState||(DeferDependenciesLoadingState={}));const MINIMUM_SLOT=0;const LOADING_AFTER_SLOT=1;exports.\u0275DeferBlockState=void 0;(function(DeferBlockState){DeferBlockState[DeferBlockState["Placeholder"]=0]="Placeholder";DeferBlockState[DeferBlockState["Loading"]=1]="Loading";DeferBlockState[DeferBlockState["Complete"]=2]="Complete";DeferBlockState[DeferBlockState["Error"]=3]="Error"})(exports.\u0275DeferBlockState||(exports.\u0275DeferBlockState={}));var DeferBlockInternalState;(function(DeferBlockInternalState){DeferBlockInternalState[DeferBlockInternalState["Initial"]=-1]="Initial"})(DeferBlockInternalState||(DeferBlockInternalState={}));const NEXT_DEFER_BLOCK_STATE=0;const DEFER_BLOCK_STATE=1;const STATE_IS_FROZEN_UNTIL=2;const LOADING_AFTER_CLEANUP_FN=3;const TRIGGER_CLEANUP_FNS=4;const PREFETCH_TRIGGER_CLEANUP_FNS=5;exports.\u0275DeferBlockBehavior=void 0;(function(DeferBlockBehavior){DeferBlockBehavior[DeferBlockBehavior["Manual"]=0]="Manual";DeferBlockBehavior[DeferBlockBehavior["Playthrough"]=1]="Playthrough"})(exports.\u0275DeferBlockBehavior||(exports.\u0275DeferBlockBehavior={}));
|
|
463
|
+
*/class HostAttributeToken{constructor(attributeName){this.attributeName=attributeName;this.__NG_ELEMENT_ID__=()=>\u0275\u0275injectAttribute(this.attributeName)}toString(){return`HostAttributeToken ${this.attributeName}`}}const ERROR_ORIGINAL_ERROR="ngOriginalError";function getOriginalError(error){return error[ERROR_ORIGINAL_ERROR]}class ErrorHandler{constructor(){this._console=console}handleError(error){const originalError=this._findOriginalError(error);this._console.error("ERROR",error);if(originalError){this._console.error("ORIGINAL ERROR",originalError)}}_findOriginalError(error){let e=error&&getOriginalError(error);while(e&&getOriginalError(e)){e=getOriginalError(e)}return e||null}}const INTERNAL_APPLICATION_ERROR_HANDLER=new InjectionToken(typeof ngDevMode==="undefined"||ngDevMode?"internal error handler":"",{providedIn:"root",factory:()=>{const userErrorHandler=inject(ErrorHandler);return userErrorHandler.handleError.bind(undefined)}});class DestroyRef{static{this.__NG_ELEMENT_ID__=injectDestroyRef}static{this.__NG_ENV_ID__=injector=>injector}}class NodeInjectorDestroyRef extends DestroyRef{constructor(_lView){super();this._lView=_lView}onDestroy(callback){storeLViewOnDestroy(this._lView,callback);return()=>removeLViewOnDestroy(this._lView,callback)}}function injectDestroyRef(){return new NodeInjectorDestroyRef(getLView())}class OutputEmitterRef{constructor(){this.destroyed=false;this.listeners=null;this.errorHandler=inject(ErrorHandler,{optional:true});this.destroyRef=inject(DestroyRef);this.destroyRef.onDestroy((()=>{this.destroyed=true;this.listeners=null}))}subscribe(callback){if(this.destroyed){throw new RuntimeError(953,ngDevMode&&"Unexpected subscription to destroyed `OutputRef`. "+"The owning directive/component is destroyed.")}(this.listeners??=[]).push(callback);return{unsubscribe:()=>{const idx=this.listeners?.indexOf(callback);if(idx!==undefined&&idx!==-1){this.listeners?.splice(idx,1)}}}}emit(value){if(this.destroyed){throw new RuntimeError(953,ngDevMode&&"Unexpected emit for destroyed `OutputRef`. "+"The owning directive/component is destroyed.")}if(this.listeners===null){return}const previousConsumer=signals.setActiveConsumer(null);try{for(const listenerFn of this.listeners){try{listenerFn(value)}catch(err){this.errorHandler?.handleError(err)}}}finally{signals.setActiveConsumer(previousConsumer)}}}function getOutputDestroyRef(ref){return ref.destroyRef}function output(opts){ngDevMode&&assertInInjectionContext(output);return new OutputEmitterRef}function inputFunction(initialValue,opts){ngDevMode&&assertInInjectionContext(input);return createInputSignal(initialValue,opts)}function inputRequiredFunction(opts){ngDevMode&&assertInInjectionContext(input);return createInputSignal(REQUIRED_UNSET_VALUE,opts)}const input=(()=>{inputFunction.required=inputRequiredFunction;return inputFunction})();function injectElementRef(){return createElementRef(getCurrentTNode(),getLView())}function createElementRef(tNode,lView){return new ElementRef(getNativeByTNode(tNode,lView))}class ElementRef{constructor(nativeElement){this.nativeElement=nativeElement}static{this.__NG_ELEMENT_ID__=injectElementRef}}function unwrapElementRef(value){return value instanceof ElementRef?value.nativeElement:value}class EventEmitter_ extends rxjs.Subject{constructor(isAsync=false){super();this.destroyRef=undefined;this.__isAsync=isAsync;if(isInInjectionContext()){this.destroyRef=inject(DestroyRef,{optional:true})??undefined}}emit(value){const prevConsumer=signals.setActiveConsumer(null);try{super.next(value)}finally{signals.setActiveConsumer(prevConsumer)}}subscribe(observerOrNext,error,complete){let nextFn=observerOrNext;let errorFn=error||(()=>null);let completeFn=complete;if(observerOrNext&&typeof observerOrNext==="object"){const observer=observerOrNext;nextFn=observer.next?.bind(observer);errorFn=observer.error?.bind(observer);completeFn=observer.complete?.bind(observer)}if(this.__isAsync){errorFn=_wrapInTimeout(errorFn);if(nextFn){nextFn=_wrapInTimeout(nextFn)}if(completeFn){completeFn=_wrapInTimeout(completeFn)}}const sink=super.subscribe({next:nextFn,error:errorFn,complete:completeFn});if(observerOrNext instanceof rxjs.Subscription){observerOrNext.add(sink)}return sink}}function _wrapInTimeout(fn){return value=>{setTimeout(fn,undefined,value)}}const EventEmitter=EventEmitter_;function symbolIterator(){return this._results[Symbol.iterator]()}class QueryList{static{}get changes(){return this._changes??=new EventEmitter}constructor(_emitDistinctChangesOnly=false){this._emitDistinctChangesOnly=_emitDistinctChangesOnly;this.dirty=true;this._onDirty=undefined;this._results=[];this._changesDetected=false;this._changes=undefined;this.length=0;this.first=undefined;this.last=undefined;const proto=QueryList.prototype;if(!proto[Symbol.iterator])proto[Symbol.iterator]=symbolIterator}get(index){return this._results[index]}map(fn){return this._results.map(fn)}filter(fn){return this._results.filter(fn)}find(fn){return this._results.find(fn)}reduce(fn,init){return this._results.reduce(fn,init)}forEach(fn){this._results.forEach(fn)}some(fn){return this._results.some(fn)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(resultsTree,identityAccessor){this.dirty=false;const newResultFlat=flatten(resultsTree);if(this._changesDetected=!arrayEquals(this._results,newResultFlat,identityAccessor)){this._results=newResultFlat;this.length=newResultFlat.length;this.last=newResultFlat[this.length-1];this.first=newResultFlat[0]}}notifyOnChanges(){if(this._changes!==undefined&&(this._changesDetected||!this._emitDistinctChangesOnly))this._changes.emit(this)}onDirty(cb){this._onDirty=cb}setDirty(){this.dirty=true;this._onDirty?.()}destroy(){if(this._changes!==undefined){this._changes.complete();this._changes.unsubscribe()}}}const SKIP_HYDRATION_ATTR_NAME="ngSkipHydration";const SKIP_HYDRATION_ATTR_NAME_LOWER_CASE="ngskiphydration";function hasSkipHydrationAttrOnTNode(tNode){const attrs=tNode.mergedAttrs;if(attrs===null)return false;for(let i=0;i<attrs.length;i+=2){const value=attrs[i];if(typeof value==="number")return false;if(typeof value==="string"&&value.toLowerCase()===SKIP_HYDRATION_ATTR_NAME_LOWER_CASE){return true}}return false}function hasSkipHydrationAttrOnRElement(rNode){return rNode.hasAttribute(SKIP_HYDRATION_ATTR_NAME)}function hasInSkipHydrationBlockFlag(tNode){return(tNode.flags&128)===128}function isInSkipHydrationBlock(tNode){if(hasInSkipHydrationBlockFlag(tNode)){return true}let currentTNode=tNode.parent;while(currentTNode){if(hasInSkipHydrationBlockFlag(tNode)||hasSkipHydrationAttrOnTNode(currentTNode)){return true}currentTNode=currentTNode.parent}return false}const TRACKED_LVIEWS=new Map;let uniqueIdCounter=0;function getUniqueLViewId(){return uniqueIdCounter++}function registerLView(lView){ngDevMode&&assertNumber(lView[ID],"LView must have an ID in order to be registered");TRACKED_LVIEWS.set(lView[ID],lView)}function getLViewById(id){ngDevMode&&assertNumber(id,"ID used for LView lookup must be a number");return TRACKED_LVIEWS.get(id)||null}function unregisterLView(lView){ngDevMode&&assertNumber(lView[ID],"Cannot stop tracking an LView that does not have an ID");TRACKED_LVIEWS.delete(lView[ID])}class LContext{get lView(){return getLViewById(this.lViewId)}constructor(lViewId,nodeIndex,native){this.lViewId=lViewId;this.nodeIndex=nodeIndex;this.native=native}}function getLContext(target){let mpValue=readPatchedData(target);if(mpValue){if(isLView(mpValue)){const lView=mpValue;let nodeIndex;let component=undefined;let directives=undefined;if(isComponentInstance(target)){nodeIndex=findViaComponent(lView,target);if(nodeIndex==-1){throw new Error("The provided component was not found in the application")}component=target}else if(isDirectiveInstance(target)){nodeIndex=findViaDirective(lView,target);if(nodeIndex==-1){throw new Error("The provided directive was not found in the application")}directives=getDirectivesAtNodeIndex(nodeIndex,lView)}else{nodeIndex=findViaNativeElement(lView,target);if(nodeIndex==-1){return null}}const native=unwrapRNode(lView[nodeIndex]);const existingCtx=readPatchedData(native);const context=existingCtx&&!Array.isArray(existingCtx)?existingCtx:createLContext(lView,nodeIndex,native);if(component&&context.component===undefined){context.component=component;attachPatchData(context.component,context)}if(directives&&context.directives===undefined){context.directives=directives;for(let i=0;i<directives.length;i++){attachPatchData(directives[i],context)}}attachPatchData(context.native,context);mpValue=context}}else{const rElement=target;ngDevMode&&assertDomNode(rElement);let parent=rElement;while(parent=parent.parentNode){const parentContext=readPatchedData(parent);if(parentContext){const lView=Array.isArray(parentContext)?parentContext:parentContext.lView;if(!lView){return null}const index=findViaNativeElement(lView,rElement);if(index>=0){const native=unwrapRNode(lView[index]);const context=createLContext(lView,index,native);attachPatchData(native,context);mpValue=context;break}}}}return mpValue||null}function createLContext(lView,nodeIndex,native){return new LContext(lView[ID],nodeIndex,native)}function getComponentViewByInstance(componentInstance){let patchedData=readPatchedData(componentInstance);let lView;if(isLView(patchedData)){const contextLView=patchedData;const nodeIndex=findViaComponent(contextLView,componentInstance);lView=getComponentLViewByIndex(nodeIndex,contextLView);const context=createLContext(contextLView,nodeIndex,lView[HOST]);context.component=componentInstance;attachPatchData(componentInstance,context);attachPatchData(context.native,context)}else{const context=patchedData;const contextLView=context.lView;ngDevMode&&assertLView(contextLView);lView=getComponentLViewByIndex(context.nodeIndex,contextLView)}return lView}const MONKEY_PATCH_KEY_NAME="__ngContext__";function attachPatchData(target,data){ngDevMode&&assertDefined(target,"Target expected");if(isLView(data)){target[MONKEY_PATCH_KEY_NAME]=data[ID];registerLView(data)}else{target[MONKEY_PATCH_KEY_NAME]=data}}function readPatchedData(target){ngDevMode&&assertDefined(target,"Target expected");const data=target[MONKEY_PATCH_KEY_NAME];return typeof data==="number"?getLViewById(data):data||null}function readPatchedLView(target){const value=readPatchedData(target);if(value){return isLView(value)?value:value.lView}return null}function isComponentInstance(instance){return instance&&instance.constructor&&instance.constructor.\u0275cmp}function isDirectiveInstance(instance){return instance&&instance.constructor&&instance.constructor.\u0275dir}function findViaNativeElement(lView,target){const tView=lView[TVIEW];for(let i=HEADER_OFFSET;i<tView.bindingStartIndex;i++){if(unwrapRNode(lView[i])===target){return i}}return-1}function traverseNextElement(tNode){if(tNode.child){return tNode.child}else if(tNode.next){return tNode.next}else{while(tNode.parent&&!tNode.parent.next){tNode=tNode.parent}return tNode.parent&&tNode.parent.next}}function findViaComponent(lView,componentInstance){const componentIndices=lView[TVIEW].components;if(componentIndices){for(let i=0;i<componentIndices.length;i++){const elementComponentIndex=componentIndices[i];const componentView=getComponentLViewByIndex(elementComponentIndex,lView);if(componentView[CONTEXT]===componentInstance){return elementComponentIndex}}}else{const rootComponentView=getComponentLViewByIndex(HEADER_OFFSET,lView);const rootComponent=rootComponentView[CONTEXT];if(rootComponent===componentInstance){return HEADER_OFFSET}}return-1}function findViaDirective(lView,directiveInstance){let tNode=lView[TVIEW].firstChild;while(tNode){const directiveIndexStart=tNode.directiveStart;const directiveIndexEnd=tNode.directiveEnd;for(let i=directiveIndexStart;i<directiveIndexEnd;i++){if(lView[i]===directiveInstance){return tNode.index}}tNode=traverseNextElement(tNode)}return-1}function getDirectivesAtNodeIndex(nodeIndex,lView){const tNode=lView[TVIEW].data[nodeIndex];if(tNode.directiveStart===0)return EMPTY_ARRAY;const results=[];for(let i=tNode.directiveStart;i<tNode.directiveEnd;i++){const directiveInstance=lView[i];if(!isComponentInstance(directiveInstance)){results.push(directiveInstance)}}return results}function getComponentAtNodeIndex(nodeIndex,lView){const tNode=lView[TVIEW].data[nodeIndex];const{directiveStart:directiveStart,componentOffset:componentOffset}=tNode;return componentOffset>-1?lView[directiveStart+componentOffset]:null}function discoverLocalRefs(lView,nodeIndex){const tNode=lView[TVIEW].data[nodeIndex];if(tNode&&tNode.localNames){const result={};let localIndex=tNode.index+1;for(let i=0;i<tNode.localNames.length;i+=2){result[tNode.localNames[i]]=lView[localIndex];localIndex++}return result}return null}function getRootView(componentOrLView){ngDevMode&&assertDefined(componentOrLView,"component");let lView=isLView(componentOrLView)?componentOrLView:readPatchedLView(componentOrLView);while(lView&&!(lView[FLAGS]&512)){lView=getLViewParent(lView)}ngDevMode&&assertLView(lView);return lView}function getRootContext(viewOrComponent){const rootView=getRootView(viewOrComponent);ngDevMode&&assertDefined(rootView[CONTEXT],"Root view has no context. Perhaps it is disconnected?");return rootView[CONTEXT]}function getFirstLContainer(lView){return getNearestLContainer(lView[CHILD_HEAD])}function getNextLContainer(container){return getNearestLContainer(container[NEXT])}function getNearestLContainer(viewOrContainer){while(viewOrContainer!==null&&!isLContainer(viewOrContainer)){viewOrContainer=viewOrContainer[NEXT]}return viewOrContainer}function getComponent$1(element){ngDevMode&&assertDomElement(element);const context=getLContext(element);if(context===null)return null;if(context.component===undefined){const lView=context.lView;if(lView===null){return null}context.component=getComponentAtNodeIndex(context.nodeIndex,lView)}return context.component}function getContext(element){assertDomElement(element);const context=getLContext(element);const lView=context?context.lView:null;return lView===null?null:lView[CONTEXT]}function getOwningComponent(elementOrDir){const context=getLContext(elementOrDir);let lView=context?context.lView:null;if(lView===null)return null;let parent;while(lView[TVIEW].type===2&&(parent=getLViewParent(lView))){lView=parent}return lView[FLAGS]&512?null:lView[CONTEXT]}function getRootComponents(elementOrDir){const lView=readPatchedLView(elementOrDir);return lView!==null?[getRootContext(lView)]:[]}function getInjector(elementOrDir){const context=getLContext(elementOrDir);const lView=context?context.lView:null;if(lView===null)return Injector.NULL;const tNode=lView[TVIEW].data[context.nodeIndex];return new NodeInjector(tNode,lView)}function getInjectionTokens(element){const context=getLContext(element);const lView=context?context.lView:null;if(lView===null)return[];const tView=lView[TVIEW];const tNode=tView.data[context.nodeIndex];const providerTokens=[];const startIndex=tNode.providerIndexes&1048575;const endIndex=tNode.directiveEnd;for(let i=startIndex;i<endIndex;i++){let value=tView.data[i];if(isDirectiveDefHack(value)){value=value.type}providerTokens.push(value)}return providerTokens}function getDirectives(node){if(node instanceof Text){return[]}const context=getLContext(node);const lView=context?context.lView:null;if(lView===null){return[]}const tView=lView[TVIEW];const nodeIndex=context.nodeIndex;if(!tView?.data[nodeIndex]){return[]}if(context.directives===undefined){context.directives=getDirectivesAtNodeIndex(nodeIndex,lView)}return context.directives===null?[]:[...context.directives]}function getDirectiveMetadata$1(directiveOrComponentInstance){const{constructor:constructor}=directiveOrComponentInstance;if(!constructor){throw new Error("Unable to find the instance constructor")}const componentDef=getComponentDef(constructor);if(componentDef){const inputs=extractInputDebugMetadata(componentDef.inputs);return{inputs:inputs,outputs:componentDef.outputs,encapsulation:componentDef.encapsulation,changeDetection:componentDef.onPush?exports.ChangeDetectionStrategy.OnPush:exports.ChangeDetectionStrategy.Default}}const directiveDef=getDirectiveDef(constructor);if(directiveDef){const inputs=extractInputDebugMetadata(directiveDef.inputs);return{inputs:inputs,outputs:directiveDef.outputs}}return null}function getLocalRefs(target){const context=getLContext(target);if(context===null)return{};if(context.localRefs===undefined){const lView=context.lView;if(lView===null){return{}}context.localRefs=discoverLocalRefs(lView,context.nodeIndex)}return context.localRefs||{}}function getHostElement(componentOrDirective){return getLContext(componentOrDirective).native}function getListeners(element){ngDevMode&&assertDomElement(element);const lContext=getLContext(element);const lView=lContext===null?null:lContext.lView;if(lView===null)return[];const tView=lView[TVIEW];const lCleanup=lView[CLEANUP];const tCleanup=tView.cleanup;const listeners=[];if(tCleanup&&lCleanup){for(let i=0;i<tCleanup.length;){const firstParam=tCleanup[i++];const secondParam=tCleanup[i++];if(typeof firstParam==="string"){const name=firstParam;const listenerElement=unwrapRNode(lView[secondParam]);const callback=lCleanup[tCleanup[i++]];const useCaptureOrIndx=tCleanup[i++];const type=typeof useCaptureOrIndx==="boolean"||useCaptureOrIndx>=0?"dom":"output";const useCapture=typeof useCaptureOrIndx==="boolean"?useCaptureOrIndx:false;if(element==listenerElement){listeners.push({element:element,name:name,callback:callback,useCapture:useCapture,type:type})}}}}listeners.sort(sortListeners);return listeners}function sortListeners(a,b){if(a.name==b.name)return 0;return a.name<b.name?-1:1}function isDirectiveDefHack(obj){return obj.type!==undefined&&obj.declaredInputs!==undefined&&obj.findHostDirectiveDefs!==undefined}function assertDomElement(value){if(typeof Element!=="undefined"&&!(value instanceof Element)){throw new Error("Expecting instance of DOM Element")}}function extractInputDebugMetadata(inputs){const res={};for(const key in inputs){if(!inputs.hasOwnProperty(key)){continue}const value=inputs[key];if(value===undefined){continue}let minifiedName;if(Array.isArray(value)){minifiedName=value[0]}else{minifiedName=value}res[key]=minifiedName}return res}let DOCUMENT=undefined;function setDocument(document){DOCUMENT=document}function getDocument(){if(DOCUMENT!==undefined){return DOCUMENT}else if(typeof document!=="undefined"){return document}throw new RuntimeError(210,(typeof ngDevMode==="undefined"||ngDevMode)&&`The document object is not available in this context. Make sure the DOCUMENT injection token is provided.`)}const APP_ID=new InjectionToken(ngDevMode?"AppId":"",{providedIn:"root",factory:()=>DEFAULT_APP_ID});const DEFAULT_APP_ID="ng";const PLATFORM_INITIALIZER=new InjectionToken(ngDevMode?"Platform Initializer":"");const PLATFORM_ID=new InjectionToken(ngDevMode?"Platform ID":"",{providedIn:"platform",factory:()=>"unknown"});const PACKAGE_ROOT_URL=new InjectionToken(ngDevMode?"Application Packages Root URL":"");const ANIMATION_MODULE_TYPE=new InjectionToken(ngDevMode?"AnimationModuleType":"");const CSP_NONCE=new InjectionToken(ngDevMode?"CSP nonce":"",{providedIn:"root",factory:()=>getDocument().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});const IMAGE_CONFIG_DEFAULTS={breakpoints:[16,32,48,64,96,128,256,384,640,750,828,1080,1200,1920,2048,3840],placeholderResolution:30,disableImageSizeWarning:false,disableImageLazyLoadWarning:false};const IMAGE_CONFIG=new InjectionToken(ngDevMode?"ImageConfig":"",{providedIn:"root",factory:()=>IMAGE_CONFIG_DEFAULTS});function makeStateKey(key){return key}function initTransferState(){const transferState=new TransferState;if(inject(PLATFORM_ID)==="browser"){transferState.store=retrieveTransferredState(getDocument(),inject(APP_ID))}return transferState}class TransferState{constructor(){this.store={};this.onSerializeCallbacks={}}static{this.\u0275prov=\u0275\u0275defineInjectable({token:TransferState,providedIn:"root",factory:initTransferState})}get(key,defaultValue){return this.store[key]!==undefined?this.store[key]:defaultValue}set(key,value){this.store[key]=value}remove(key){delete this.store[key]}hasKey(key){return this.store.hasOwnProperty(key)}get isEmpty(){return Object.keys(this.store).length===0}onSerialize(key,callback){this.onSerializeCallbacks[key]=callback}toJson(){for(const key in this.onSerializeCallbacks){if(this.onSerializeCallbacks.hasOwnProperty(key)){try{this.store[key]=this.onSerializeCallbacks[key]()}catch(e){console.warn("Exception in onSerialize callback: ",e)}}}return JSON.stringify(this.store).replace(/</g,"\\u003C")}}function retrieveTransferredState(doc,appId){const script=doc.getElementById(appId+"-state");if(script?.textContent){try{return JSON.parse(script.textContent)}catch(e){console.warn("Exception while restoring TransferState for app "+appId,e)}}return{}}const REFERENCE_NODE_HOST="h";const REFERENCE_NODE_BODY="b";var NodeNavigationStep;(function(NodeNavigationStep){NodeNavigationStep["FirstChild"]="f";NodeNavigationStep["NextSibling"]="n"})(NodeNavigationStep||(NodeNavigationStep={}));const ELEMENT_CONTAINERS="e";const TEMPLATES="t";const CONTAINERS="c";const MULTIPLIER="x";const NUM_ROOT_NODES="r";const TEMPLATE_ID="i";const NODES="n";const DISCONNECTED_NODES="d";const TRANSFER_STATE_TOKEN_ID="__nghData__";const NGH_DATA_KEY=makeStateKey(TRANSFER_STATE_TOKEN_ID);const NGH_ATTR_NAME="ngh";const SSR_CONTENT_INTEGRITY_MARKER="nghm";let _retrieveHydrationInfoImpl=()=>null;function retrieveHydrationInfoImpl(rNode,injector,isRootView=false){let nghAttrValue=rNode.getAttribute(NGH_ATTR_NAME);if(nghAttrValue==null)return null;const[componentViewNgh,rootViewNgh]=nghAttrValue.split("|");nghAttrValue=isRootView?rootViewNgh:componentViewNgh;if(!nghAttrValue)return null;const rootNgh=rootViewNgh?`|${rootViewNgh}`:"";const remainingNgh=isRootView?componentViewNgh:rootNgh;let data={};if(nghAttrValue!==""){const transferState=injector.get(TransferState,null,{optional:true});if(transferState!==null){const nghData=transferState.get(NGH_DATA_KEY,[]);data=nghData[Number(nghAttrValue)];ngDevMode&&assertDefined(data,"Unable to retrieve hydration info from the TransferState.")}}const dehydratedView={data:data,firstChild:rNode.firstChild??null};if(isRootView){dehydratedView.firstChild=rNode;setSegmentHead(dehydratedView,0,rNode.nextSibling)}if(remainingNgh){rNode.setAttribute(NGH_ATTR_NAME,remainingNgh)}else{rNode.removeAttribute(NGH_ATTR_NAME)}ngDevMode&&markRNodeAsClaimedByHydration(rNode,false);ngDevMode&&ngDevMode.hydratedComponents++;return dehydratedView}function enableRetrieveHydrationInfoImpl(){_retrieveHydrationInfoImpl=retrieveHydrationInfoImpl}function retrieveHydrationInfo(rNode,injector,isRootView=false){return _retrieveHydrationInfoImpl(rNode,injector,isRootView)}function getLNodeForHydration(viewRef){let lView=viewRef._lView;const tView=lView[TVIEW];if(tView.type===2){return null}if(isRootView(lView)){lView=lView[HEADER_OFFSET]}return lView}function getTextNodeContent(node){return node.textContent?.replace(/\s/gm,"")}function processTextNodeMarkersBeforeHydration(node){const doc=getDocument();const commentNodesIterator=doc.createNodeIterator(node,NodeFilter.SHOW_COMMENT,{acceptNode(node){const content=getTextNodeContent(node);const isTextNodeMarker=content==="ngetn"||content==="ngtns";return isTextNodeMarker?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});let currentNode;const nodes=[];while(currentNode=commentNodesIterator.nextNode()){nodes.push(currentNode)}for(const node of nodes){if(node.textContent==="ngetn"){node.replaceWith(doc.createTextNode(""))}else{node.remove()}}}var HydrationStatus;(function(HydrationStatus){HydrationStatus["Hydrated"]="hydrated";HydrationStatus["Skipped"]="skipped";HydrationStatus["Mismatched"]="mismatched"})(HydrationStatus||(HydrationStatus={}));const HYDRATION_INFO_KEY="__ngDebugHydrationInfo__";function patchHydrationInfo(node,info){node[HYDRATION_INFO_KEY]=info}function readHydrationInfo(node){return node[HYDRATION_INFO_KEY]??null}function markRNodeAsClaimedByHydration(node,checkIfAlreadyClaimed=true){if(!ngDevMode){throw new Error("Calling `markRNodeAsClaimedByHydration` in prod mode "+"is not supported and likely a mistake.")}if(checkIfAlreadyClaimed&&isRNodeClaimedForHydration(node)){throw new Error("Trying to claim a node, which was claimed already.")}patchHydrationInfo(node,{status:HydrationStatus.Hydrated});ngDevMode.hydratedNodes++}function markRNodeAsSkippedByHydration(node){if(!ngDevMode){throw new Error("Calling `markRNodeAsSkippedByHydration` in prod mode "+"is not supported and likely a mistake.")}patchHydrationInfo(node,{status:HydrationStatus.Skipped});ngDevMode.componentsSkippedHydration++}function markRNodeAsHavingHydrationMismatch(node,expectedNodeDetails=null,actualNodeDetails=null){if(!ngDevMode){throw new Error("Calling `markRNodeAsMismatchedByHydration` in prod mode "+"is not supported and likely a mistake.")}while(node&&!getComponent$1(node)){node=node?.parentNode}if(node){patchHydrationInfo(node,{status:HydrationStatus.Mismatched,expectedNodeDetails:expectedNodeDetails,actualNodeDetails:actualNodeDetails})}}function isRNodeClaimedForHydration(node){return readHydrationInfo(node)?.status===HydrationStatus.Hydrated}function setSegmentHead(hydrationInfo,index,node){hydrationInfo.segmentHeads??={};hydrationInfo.segmentHeads[index]=node}function getSegmentHead(hydrationInfo,index){return hydrationInfo.segmentHeads?.[index]??null}function getNgContainerSize(hydrationInfo,index){const data=hydrationInfo.data;let size=data[ELEMENT_CONTAINERS]?.[index]??null;if(size===null&&data[CONTAINERS]?.[index]){size=calcSerializedContainerSize(hydrationInfo,index)}return size}function getSerializedContainerViews(hydrationInfo,index){return hydrationInfo.data[CONTAINERS]?.[index]??null}function calcSerializedContainerSize(hydrationInfo,index){const views=getSerializedContainerViews(hydrationInfo,index)??[];let numNodes=0;for(let view of views){numNodes+=view[NUM_ROOT_NODES]*(view[MULTIPLIER]??1)}return numNodes}function isDisconnectedNode$1(hydrationInfo,index){if(typeof hydrationInfo.disconnectedNodes==="undefined"){const nodeIds=hydrationInfo.data[DISCONNECTED_NODES];hydrationInfo.disconnectedNodes=nodeIds?new Set(nodeIds):null}return!!hydrationInfo.disconnectedNodes?.has(index)}const IS_HYDRATION_DOM_REUSE_ENABLED=new InjectionToken(typeof ngDevMode==="undefined"||!!ngDevMode?"IS_HYDRATION_DOM_REUSE_ENABLED":"");const PRESERVE_HOST_CONTENT_DEFAULT=false;const PRESERVE_HOST_CONTENT=new InjectionToken(typeof ngDevMode==="undefined"||!!ngDevMode?"PRESERVE_HOST_CONTENT":"",{providedIn:"root",factory:()=>PRESERVE_HOST_CONTENT_DEFAULT});const IS_I18N_HYDRATION_ENABLED=new InjectionToken(typeof ngDevMode==="undefined"||!!ngDevMode?"IS_I18N_HYDRATION_ENABLED":"");let policy$1;function getPolicy$1(){if(policy$1===undefined){policy$1=null;if(_global.trustedTypes){try{policy$1=_global.trustedTypes.createPolicy("angular",{createHTML:s=>s,createScript:s=>s,createScriptURL:s=>s})}catch{}}}return policy$1}function trustedHTMLFromString(html){return getPolicy$1()?.createHTML(html)||html}function trustedScriptURLFromString(url){return getPolicy$1()?.createScriptURL(url)||url}let policy;function getPolicy(){if(policy===undefined){policy=null;if(_global.trustedTypes){try{policy=_global.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:s=>s,createScript:s=>s,createScriptURL:s=>s})}catch{}}}return policy}function trustedHTMLFromStringBypass(html){return getPolicy()?.createHTML(html)||html}function trustedScriptFromStringBypass(script){return getPolicy()?.createScript(script)||script}function trustedScriptURLFromStringBypass(url){return getPolicy()?.createScriptURL(url)||url}class SafeValueImpl{constructor(changingThisBreaksApplicationSecurity){this.changingThisBreaksApplicationSecurity=changingThisBreaksApplicationSecurity}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity}`+` (see ${XSS_SECURITY_URL})`}}class SafeHtmlImpl extends SafeValueImpl{getTypeName(){return"HTML"}}class SafeStyleImpl extends SafeValueImpl{getTypeName(){return"Style"}}class SafeScriptImpl extends SafeValueImpl{getTypeName(){return"Script"}}class SafeUrlImpl extends SafeValueImpl{getTypeName(){return"URL"}}class SafeResourceUrlImpl extends SafeValueImpl{getTypeName(){return"ResourceURL"}}function unwrapSafeValue(value){return value instanceof SafeValueImpl?value.changingThisBreaksApplicationSecurity:value}function allowSanitizationBypassAndThrow(value,type){const actualType=getSanitizationBypassType(value);if(actualType!=null&&actualType!==type){if(actualType==="ResourceURL"&&type==="URL")return true;throw new Error(`Required a safe ${type}, got a ${actualType} (see ${XSS_SECURITY_URL})`)}return actualType===type}function getSanitizationBypassType(value){return value instanceof SafeValueImpl&&value.getTypeName()||null}function bypassSanitizationTrustHtml(trustedHtml){return new SafeHtmlImpl(trustedHtml)}function bypassSanitizationTrustStyle(trustedStyle){return new SafeStyleImpl(trustedStyle)}function bypassSanitizationTrustScript(trustedScript){return new SafeScriptImpl(trustedScript)}function bypassSanitizationTrustUrl(trustedUrl){return new SafeUrlImpl(trustedUrl)}function bypassSanitizationTrustResourceUrl(trustedResourceUrl){return new SafeResourceUrlImpl(trustedResourceUrl)}function getInertBodyHelper(defaultDoc){const inertDocumentHelper=new InertDocumentHelper(defaultDoc);return isDOMParserAvailable()?new DOMParserHelper(inertDocumentHelper):inertDocumentHelper}class DOMParserHelper{constructor(inertDocumentHelper){this.inertDocumentHelper=inertDocumentHelper}getInertBodyElement(html){html="<body><remove></remove>"+html;try{const body=(new window.DOMParser).parseFromString(trustedHTMLFromString(html),"text/html").body;if(body===null){return this.inertDocumentHelper.getInertBodyElement(html)}body.removeChild(body.firstChild);return body}catch{return null}}}class InertDocumentHelper{constructor(defaultDoc){this.defaultDoc=defaultDoc;this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert")}getInertBodyElement(html){const templateEl=this.inertDocument.createElement("template");templateEl.innerHTML=trustedHTMLFromString(html);return templateEl}}function isDOMParserAvailable(){try{return!!(new window.DOMParser).parseFromString(trustedHTMLFromString(""),"text/html")}catch{return false}}const SAFE_URL_PATTERN=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function _sanitizeUrl(url){url=String(url);if(url.match(SAFE_URL_PATTERN))return url;if(typeof ngDevMode==="undefined"||ngDevMode){console.warn(`WARNING: sanitizing unsafe URL value ${url} (see ${XSS_SECURITY_URL})`)}return"unsafe:"+url}function tagSet(tags){const res={};for(const t of tags.split(","))res[t]=true;return res}function merge(...sets){const res={};for(const s of sets){for(const v in s){if(s.hasOwnProperty(v))res[v]=true}}return res}const VOID_ELEMENTS=tagSet("area,br,col,hr,img,wbr");const OPTIONAL_END_TAG_BLOCK_ELEMENTS=tagSet("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr");const OPTIONAL_END_TAG_INLINE_ELEMENTS=tagSet("rp,rt");const OPTIONAL_END_TAG_ELEMENTS=merge(OPTIONAL_END_TAG_INLINE_ELEMENTS,OPTIONAL_END_TAG_BLOCK_ELEMENTS);const BLOCK_ELEMENTS=merge(OPTIONAL_END_TAG_BLOCK_ELEMENTS,tagSet("address,article,"+"aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,"+"h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul"));const INLINE_ELEMENTS=merge(OPTIONAL_END_TAG_INLINE_ELEMENTS,tagSet("a,abbr,acronym,audio,b,"+"bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,"+"samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video"));const VALID_ELEMENTS=merge(VOID_ELEMENTS,BLOCK_ELEMENTS,INLINE_ELEMENTS,OPTIONAL_END_TAG_ELEMENTS);const URI_ATTRS=tagSet("background,cite,href,itemtype,longdesc,poster,src,xlink:href");const HTML_ATTRS=tagSet("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,"+"compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,"+"ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,"+"scope,scrolling,shape,size,sizes,span,srclang,srcset,start,summary,tabindex,target,title,translate,type,usemap,"+"valign,value,vspace,width");const ARIA_ATTRS=tagSet("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,"+"aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,"+"aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,"+"aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,"+"aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,"+"aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,"+"aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext");const VALID_ATTRS=merge(URI_ATTRS,HTML_ATTRS,ARIA_ATTRS);const SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS=tagSet("script,style,template");class SanitizingHtmlSerializer{constructor(){this.sanitizedSomething=false;this.buf=[]}sanitizeChildren(el){let current=el.firstChild;let traverseContent=true;let parentNodes=[];while(current){if(current.nodeType===Node.ELEMENT_NODE){traverseContent=this.startElement(current)}else if(current.nodeType===Node.TEXT_NODE){this.chars(current.nodeValue)}else{this.sanitizedSomething=true}if(traverseContent&¤t.firstChild){parentNodes.push(current);current=getFirstChild(current);continue}while(current){if(current.nodeType===Node.ELEMENT_NODE){this.endElement(current)}let next=getNextSibling(current);if(next){current=next;break}current=parentNodes.pop()}}return this.buf.join("")}startElement(element){const tagName=getNodeName(element).toLowerCase();if(!VALID_ELEMENTS.hasOwnProperty(tagName)){this.sanitizedSomething=true;return!SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS.hasOwnProperty(tagName)}this.buf.push("<");this.buf.push(tagName);const elAttrs=element.attributes;for(let i=0;i<elAttrs.length;i++){const elAttr=elAttrs.item(i);const attrName=elAttr.name;const lower=attrName.toLowerCase();if(!VALID_ATTRS.hasOwnProperty(lower)){this.sanitizedSomething=true;continue}let value=elAttr.value;if(URI_ATTRS[lower])value=_sanitizeUrl(value);this.buf.push(" ",attrName,'="',encodeEntities(value),'"')}this.buf.push(">");return true}endElement(current){const tagName=getNodeName(current).toLowerCase();if(VALID_ELEMENTS.hasOwnProperty(tagName)&&!VOID_ELEMENTS.hasOwnProperty(tagName)){this.buf.push("</");this.buf.push(tagName);this.buf.push(">")}}chars(chars){this.buf.push(encodeEntities(chars))}}function isClobberedElement(parentNode,childNode){return(parentNode.compareDocumentPosition(childNode)&Node.DOCUMENT_POSITION_CONTAINED_BY)!==Node.DOCUMENT_POSITION_CONTAINED_BY}function getNextSibling(node){const nextSibling=node.nextSibling;if(nextSibling&&node!==nextSibling.previousSibling){throw clobberedElementError(nextSibling)}return nextSibling}function getFirstChild(node){const firstChild=node.firstChild;if(firstChild&&isClobberedElement(node,firstChild)){throw clobberedElementError(firstChild)}return firstChild}function getNodeName(node){const nodeName=node.nodeName;return typeof nodeName==="string"?nodeName:"FORM"}function clobberedElementError(node){return new Error(`Failed to sanitize html because the element is clobbered: ${node.outerHTML}`)}const SURROGATE_PAIR_REGEXP=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;const NON_ALPHANUMERIC_REGEXP=/([^\#-~ |!])/g;function encodeEntities(value){return value.replace(/&/g,"&").replace(SURROGATE_PAIR_REGEXP,(function(match){const hi=match.charCodeAt(0);const low=match.charCodeAt(1);return"&#"+((hi-55296)*1024+(low-56320)+65536)+";"})).replace(NON_ALPHANUMERIC_REGEXP,(function(match){return"&#"+match.charCodeAt(0)+";"})).replace(/</g,"<").replace(/>/g,">")}let inertBodyHelper;function _sanitizeHtml(defaultDoc,unsafeHtmlInput){let inertBodyElement=null;try{inertBodyHelper=inertBodyHelper||getInertBodyHelper(defaultDoc);let unsafeHtml=unsafeHtmlInput?String(unsafeHtmlInput):"";inertBodyElement=inertBodyHelper.getInertBodyElement(unsafeHtml);let mXSSAttempts=5;let parsedHtml=unsafeHtml;do{if(mXSSAttempts===0){throw new Error("Failed to sanitize html because the input is unstable")}mXSSAttempts--;unsafeHtml=parsedHtml;parsedHtml=inertBodyElement.innerHTML;inertBodyElement=inertBodyHelper.getInertBodyElement(unsafeHtml)}while(unsafeHtml!==parsedHtml);const sanitizer=new SanitizingHtmlSerializer;const safeHtml=sanitizer.sanitizeChildren(getTemplateContent(inertBodyElement)||inertBodyElement);if((typeof ngDevMode==="undefined"||ngDevMode)&&sanitizer.sanitizedSomething){console.warn(`WARNING: sanitizing HTML stripped some content, see ${XSS_SECURITY_URL}`)}return trustedHTMLFromString(safeHtml)}finally{if(inertBodyElement){const parent=getTemplateContent(inertBodyElement)||inertBodyElement;while(parent.firstChild){parent.removeChild(parent.firstChild)}}}}function getTemplateContent(el){return"content"in el&&isTemplateElement(el)?el.content:null}function isTemplateElement(el){return el.nodeType===Node.ELEMENT_NODE&&el.nodeName==="TEMPLATE"}exports.SecurityContext=void 0;(function(SecurityContext){SecurityContext[SecurityContext["NONE"]=0]="NONE";SecurityContext[SecurityContext["HTML"]=1]="HTML";SecurityContext[SecurityContext["STYLE"]=2]="STYLE";SecurityContext[SecurityContext["SCRIPT"]=3]="SCRIPT";SecurityContext[SecurityContext["URL"]=4]="URL";SecurityContext[SecurityContext["RESOURCE_URL"]=5]="RESOURCE_URL"})(exports.SecurityContext||(exports.SecurityContext={}));function \u0275\u0275sanitizeHtml(unsafeHtml){const sanitizer=getSanitizer();if(sanitizer){return trustedHTMLFromStringBypass(sanitizer.sanitize(exports.SecurityContext.HTML,unsafeHtml)||"")}if(allowSanitizationBypassAndThrow(unsafeHtml,"HTML")){return trustedHTMLFromStringBypass(unwrapSafeValue(unsafeHtml))}return _sanitizeHtml(getDocument(),renderStringify(unsafeHtml))}function \u0275\u0275sanitizeStyle(unsafeStyle){const sanitizer=getSanitizer();if(sanitizer){return sanitizer.sanitize(exports.SecurityContext.STYLE,unsafeStyle)||""}if(allowSanitizationBypassAndThrow(unsafeStyle,"Style")){return unwrapSafeValue(unsafeStyle)}return renderStringify(unsafeStyle)}function \u0275\u0275sanitizeUrl(unsafeUrl){const sanitizer=getSanitizer();if(sanitizer){return sanitizer.sanitize(exports.SecurityContext.URL,unsafeUrl)||""}if(allowSanitizationBypassAndThrow(unsafeUrl,"URL")){return unwrapSafeValue(unsafeUrl)}return _sanitizeUrl(renderStringify(unsafeUrl))}function \u0275\u0275sanitizeResourceUrl(unsafeResourceUrl){const sanitizer=getSanitizer();if(sanitizer){return trustedScriptURLFromStringBypass(sanitizer.sanitize(exports.SecurityContext.RESOURCE_URL,unsafeResourceUrl)||"")}if(allowSanitizationBypassAndThrow(unsafeResourceUrl,"ResourceURL")){return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl))}throw new RuntimeError(904,ngDevMode&&`unsafe value used in a resource URL context (see ${XSS_SECURITY_URL})`)}function \u0275\u0275sanitizeScript(unsafeScript){const sanitizer=getSanitizer();if(sanitizer){return trustedScriptFromStringBypass(sanitizer.sanitize(exports.SecurityContext.SCRIPT,unsafeScript)||"")}if(allowSanitizationBypassAndThrow(unsafeScript,"Script")){return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript))}throw new RuntimeError(905,ngDevMode&&"unsafe value used in a script context")}function \u0275\u0275trustConstantHtml(html){if(ngDevMode&&(!Array.isArray(html)||!Array.isArray(html.raw)||html.length!==1)){throw new Error(`Unexpected interpolation in trusted HTML constant: ${html.join("?")}`)}return trustedHTMLFromString(html[0])}function \u0275\u0275trustConstantResourceUrl(url){if(ngDevMode&&(!Array.isArray(url)||!Array.isArray(url.raw)||url.length!==1)){throw new Error(`Unexpected interpolation in trusted URL constant: ${url.join("?")}`)}return trustedScriptURLFromString(url[0])}function getUrlSanitizer(tag,prop){if(prop==="src"&&(tag==="embed"||tag==="frame"||tag==="iframe"||tag==="media"||tag==="script")||prop==="href"&&(tag==="base"||tag==="link")){return \u0275\u0275sanitizeResourceUrl}return \u0275\u0275sanitizeUrl}function \u0275\u0275sanitizeUrlOrResourceUrl(unsafeUrl,tag,prop){return getUrlSanitizer(tag,prop)(unsafeUrl)}function validateAgainstEventProperties(name){if(name.toLowerCase().startsWith("on")){const errorMessage=`Binding to event property '${name}' is disallowed for security reasons, `+`please use (${name.slice(2)})=...`+`\nIf '${name}' is a directive input, make sure the directive is imported by the`+` current module.`;throw new RuntimeError(306,errorMessage)}}function validateAgainstEventAttributes(name){if(name.toLowerCase().startsWith("on")){const errorMessage=`Binding to event attribute '${name}' is disallowed for security reasons, `+`please use (${name.slice(2)})=...`;throw new RuntimeError(306,errorMessage)}}function getSanitizer(){const lView=getLView();return lView&&lView[ENVIRONMENT].sanitizer}const COMMENT_DISALLOWED=/^>|^->|<!--|-->|--!>|<!-$/g;const COMMENT_DELIMITER=/(<|>)/g;const COMMENT_DELIMITER_ESCAPED="\u200b$1\u200b";function escapeCommentText(value){return value.replace(COMMENT_DISALLOWED,(text=>text.replace(COMMENT_DELIMITER,COMMENT_DELIMITER_ESCAPED)))}function normalizeDebugBindingName(name){name=camelCaseToDashCase(name.replace(/[$@]/g,"_"));return`ng-reflect-${name}`}const CAMEL_CASE_REGEXP=/([A-Z])/g;function camelCaseToDashCase(input){return input.replace(CAMEL_CASE_REGEXP,((...m)=>"-"+m[1].toLowerCase()))}function normalizeDebugBindingValue(value){try{return value!=null?value.toString().slice(0,30):value}catch(e){return"[ERROR] Exception while trying to serialize the value"}}const CUSTOM_ELEMENTS_SCHEMA={name:"custom-elements"};const NO_ERRORS_SCHEMA={name:"no-errors-schema"};let shouldThrowErrorOnUnknownElement=false;function \u0275setUnknownElementStrictMode(shouldThrow){shouldThrowErrorOnUnknownElement=shouldThrow}function \u0275getUnknownElementStrictMode(){return shouldThrowErrorOnUnknownElement}let shouldThrowErrorOnUnknownProperty=false;function \u0275setUnknownPropertyStrictMode(shouldThrow){shouldThrowErrorOnUnknownProperty=shouldThrow}function \u0275getUnknownPropertyStrictMode(){return shouldThrowErrorOnUnknownProperty}function validateElementIsKnown(element,lView,tagName,schemas,hasDirectives){if(schemas===null)return;if(!hasDirectives&&tagName!==null){const isUnknown=typeof HTMLUnknownElement!=="undefined"&&HTMLUnknownElement&&element instanceof HTMLUnknownElement||typeof customElements!=="undefined"&&tagName.indexOf("-")>-1&&!customElements.get(tagName);if(isUnknown&&!matchingSchemas(schemas,tagName)){const isHostStandalone=isHostComponentStandalone(lView);const templateLocation=getTemplateLocationDetails(lView);const schemas=`'${isHostStandalone?"@Component":"@NgModule"}.schemas'`;let message=`'${tagName}' is not a known element${templateLocation}:\n`;message+=`1. If '${tagName}' is an Angular component, then verify that it is ${isHostStandalone?"included in the '@Component.imports' of this component":"a part of an @NgModule where this component is declared"}.\n`;if(tagName&&tagName.indexOf("-")>-1){message+=`2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas} of this component to suppress this message.`}else{message+=`2. To allow any element add 'NO_ERRORS_SCHEMA' to the ${schemas} of this component.`}if(shouldThrowErrorOnUnknownElement){throw new RuntimeError(304,message)}else{console.error(formatRuntimeError(304,message))}}}}function isPropertyValid(element,propName,tagName,schemas){if(schemas===null)return true;if(matchingSchemas(schemas,tagName)||propName in element||isAnimationProp(propName)){return true}return typeof Node==="undefined"||Node===null||!(element instanceof Node)}function handleUnknownPropertyError(propName,tagName,nodeType,lView){if(!tagName&&nodeType===4){tagName="ng-template"}const isHostStandalone=isHostComponentStandalone(lView);const templateLocation=getTemplateLocationDetails(lView);let message=`Can't bind to '${propName}' since it isn't a known property of '${tagName}'${templateLocation}.`;const schemas=`'${isHostStandalone?"@Component":"@NgModule"}.schemas'`;const importLocation=isHostStandalone?"included in the '@Component.imports' of this component":"a part of an @NgModule where this component is declared";if(KNOWN_CONTROL_FLOW_DIRECTIVES.has(propName)){const correspondingImport=KNOWN_CONTROL_FLOW_DIRECTIVES.get(propName);message+=`\nIf the '${propName}' is an Angular control flow directive, `+`please make sure that either the '${correspondingImport}' directive or the 'CommonModule' is ${importLocation}.`}else{message+=`\n1. If '${tagName}' is an Angular component and it has the `+`'${propName}' input, then verify that it is ${importLocation}.`;if(tagName&&tagName.indexOf("-")>-1){message+=`\n2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' `+`to the ${schemas} of this component to suppress this message.`;message+=`\n3. To allow any property add 'NO_ERRORS_SCHEMA' to `+`the ${schemas} of this component.`}else{message+=`\n2. To allow any property add 'NO_ERRORS_SCHEMA' to `+`the ${schemas} of this component.`}}reportUnknownPropertyError(message)}function reportUnknownPropertyError(message){if(shouldThrowErrorOnUnknownProperty){throw new RuntimeError(303,message)}else{console.error(formatRuntimeError(303,message))}}function getDeclarationComponentDef(lView){!ngDevMode&&throwError("Must never be called in production mode");const declarationLView=lView[DECLARATION_COMPONENT_VIEW];const context=declarationLView[CONTEXT];if(!context)return null;return context.constructor?getComponentDef(context.constructor):null}function isHostComponentStandalone(lView){!ngDevMode&&throwError("Must never be called in production mode");const componentDef=getDeclarationComponentDef(lView);return!!componentDef?.standalone}function getTemplateLocationDetails(lView){!ngDevMode&&throwError("Must never be called in production mode");const hostComponentDef=getDeclarationComponentDef(lView);const componentClassName=hostComponentDef?.type?.name;return componentClassName?` (used in the '${componentClassName}' component template)`:""}const KNOWN_CONTROL_FLOW_DIRECTIVES=new Map([["ngIf","NgIf"],["ngFor","NgFor"],["ngSwitchCase","NgSwitchCase"],["ngSwitchDefault","NgSwitchDefault"]]);function matchingSchemas(schemas,tagName){if(schemas!==null){for(let i=0;i<schemas.length;i++){const schema=schemas[i];if(schema===NO_ERRORS_SCHEMA||schema===CUSTOM_ELEMENTS_SCHEMA&&tagName&&tagName.indexOf("-")>-1){return true}}}return false}function \u0275\u0275resolveWindow(element){return element.ownerDocument.defaultView}function \u0275\u0275resolveDocument(element){return element.ownerDocument}function \u0275\u0275resolveBody(element){return element.ownerDocument.body}const INTERPOLATION_DELIMITER=`\ufffd`;function maybeUnwrapFn(value){if(value instanceof Function){return value()}else{return value}}function isPlatformBrowser(injector){return(injector??inject(Injector)).get(PLATFORM_ID)==="browser"}const VALUE_STRING_LENGTH_LIMIT=200;function assertStandaloneComponentType(type){assertComponentDef(type);const componentDef=getComponentDef(type);if(!componentDef.standalone){throw new RuntimeError(907,`The ${stringifyForError(type)} component is not marked as standalone, `+`but Angular expects to have a standalone component here. `+`Please make sure the ${stringifyForError(type)} component has `+`the \`standalone: true\` flag in the decorator.`)}}function assertComponentDef(type){if(!getComponentDef(type)){throw new RuntimeError(906,`The ${stringifyForError(type)} is not an Angular component, `+`make sure it has the \`@Component\` decorator.`)}}function throwMultipleComponentError(tNode,first,second){throw new RuntimeError(-300,`Multiple components match node with tagname ${tNode.value}: `+`${stringifyForError(first)} and `+`${stringifyForError(second)}`)}function throwErrorIfNoChangesMode(creationMode,oldValue,currValue,propName,lView){const hostComponentDef=getDeclarationComponentDef(lView);const componentClassName=hostComponentDef?.type?.name;const field=propName?` for '${propName}'`:"";let msg=`ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value${field}: '${formatValue(oldValue)}'. Current value: '${formatValue(currValue)}'.${componentClassName?` Expression location: ${componentClassName} component`:""}`;if(creationMode){msg+=` It seems like the view has been created after its parent and its children have been dirty checked.`+` Has it been created in a change detection hook?`}throw new RuntimeError(-100,msg)}function formatValue(value){let strValue=String(value);try{if(Array.isArray(value)||strValue==="[object Object]"){strValue=JSON.stringify(value)}}catch(error){}return strValue.length>VALUE_STRING_LENGTH_LIMIT?strValue.substring(0,VALUE_STRING_LENGTH_LIMIT)+"\u2026":strValue}function constructDetailsForInterpolation(lView,rootIndex,expressionIndex,meta,changedValue){const[propName,prefix,...chunks]=meta.split(INTERPOLATION_DELIMITER);let oldValue=prefix,newValue=prefix;for(let i=0;i<chunks.length;i++){const slotIdx=rootIndex+i;oldValue+=`${lView[slotIdx]}${chunks[i]}`;newValue+=`${slotIdx===expressionIndex?changedValue:lView[slotIdx]}${chunks[i]}`}return{propName:propName,oldValue:oldValue,newValue:newValue}}function getExpressionChangedErrorDetails(lView,bindingIndex,oldValue,newValue){const tData=lView[TVIEW].data;const metadata=tData[bindingIndex];if(typeof metadata==="string"){if(metadata.indexOf(INTERPOLATION_DELIMITER)>-1){return constructDetailsForInterpolation(lView,bindingIndex,bindingIndex,metadata,newValue)}return{propName:metadata,oldValue:oldValue,newValue:newValue}}if(metadata===null){let idx=bindingIndex-1;while(typeof tData[idx]!=="string"&&tData[idx+1]===null){idx--}const meta=tData[idx];if(typeof meta==="string"){const matches=meta.match(new RegExp(INTERPOLATION_DELIMITER,"g"));if(matches&&matches.length-1>bindingIndex-idx){return constructDetailsForInterpolation(lView,idx,bindingIndex,meta,newValue)}}}return{propName:undefined,oldValue:oldValue,newValue:newValue}}exports.RendererStyleFlags2=void 0;(function(RendererStyleFlags2){RendererStyleFlags2[RendererStyleFlags2["Important"]=1]="Important";RendererStyleFlags2[RendererStyleFlags2["DashCase"]=2]="DashCase"})(exports.RendererStyleFlags2||(exports.RendererStyleFlags2={}));let _icuContainerIterate;function icuContainerIterate(tIcuContainerNode,lView){return _icuContainerIterate(tIcuContainerNode,lView)}function ensureIcuContainerVisitorLoaded(loader){if(_icuContainerIterate===undefined){_icuContainerIterate=loader()}}function applyToElementOrContainer(action,renderer,parent,lNodeToHandle,beforeNode){if(lNodeToHandle!=null){let lContainer;let isComponent=false;if(isLContainer(lNodeToHandle)){lContainer=lNodeToHandle}else if(isLView(lNodeToHandle)){isComponent=true;ngDevMode&&assertDefined(lNodeToHandle[HOST],"HOST must be defined for a component LView");lNodeToHandle=lNodeToHandle[HOST]}const rNode=unwrapRNode(lNodeToHandle);if(action===0&&parent!==null){if(beforeNode==null){nativeAppendChild(renderer,parent,rNode)}else{nativeInsertBefore(renderer,parent,rNode,beforeNode||null,true)}}else if(action===1&&parent!==null){nativeInsertBefore(renderer,parent,rNode,beforeNode||null,true)}else if(action===2){nativeRemoveNode(renderer,rNode,isComponent)}else if(action===3){ngDevMode&&ngDevMode.rendererDestroyNode++;renderer.destroyNode(rNode)}if(lContainer!=null){applyContainer(renderer,action,lContainer,parent,beforeNode)}}}function createTextNode(renderer,value){ngDevMode&&ngDevMode.rendererCreateTextNode++;ngDevMode&&ngDevMode.rendererSetText++;return renderer.createText(value)}function updateTextNode(renderer,rNode,value){ngDevMode&&ngDevMode.rendererSetText++;renderer.setValue(rNode,value)}function createCommentNode(renderer,value){ngDevMode&&ngDevMode.rendererCreateComment++;return renderer.createComment(escapeCommentText(value))}function createElementNode(renderer,name,namespace){ngDevMode&&ngDevMode.rendererCreateElement++;return renderer.createElement(name,namespace)}function removeViewFromDOM(tView,lView){detachViewFromDOM(tView,lView);lView[HOST]=null;lView[T_HOST]=null}function addViewToDOM(tView,parentTNode,renderer,lView,parentNativeNode,beforeNode){lView[HOST]=parentNativeNode;lView[T_HOST]=parentTNode;applyView(tView,lView,renderer,1,parentNativeNode,beforeNode)}function detachViewFromDOM(tView,lView){lView[ENVIRONMENT].changeDetectionScheduler?.notify(1);applyView(tView,lView,lView[RENDERER],2,null,null)}function destroyViewTree(rootView){let lViewOrLContainer=rootView[CHILD_HEAD];if(!lViewOrLContainer){return cleanUpView(rootView[TVIEW],rootView)}while(lViewOrLContainer){let next=null;if(isLView(lViewOrLContainer)){next=lViewOrLContainer[CHILD_HEAD]}else{ngDevMode&&assertLContainer(lViewOrLContainer);const firstView=lViewOrLContainer[CONTAINER_HEADER_OFFSET];if(firstView)next=firstView}if(!next){while(lViewOrLContainer&&!lViewOrLContainer[NEXT]&&lViewOrLContainer!==rootView){if(isLView(lViewOrLContainer)){cleanUpView(lViewOrLContainer[TVIEW],lViewOrLContainer)}lViewOrLContainer=lViewOrLContainer[PARENT]}if(lViewOrLContainer===null)lViewOrLContainer=rootView;if(isLView(lViewOrLContainer)){cleanUpView(lViewOrLContainer[TVIEW],lViewOrLContainer)}next=lViewOrLContainer&&lViewOrLContainer[NEXT]}lViewOrLContainer=next}}function insertView(tView,lView,lContainer,index){ngDevMode&&assertLView(lView);ngDevMode&&assertLContainer(lContainer);const indexInContainer=CONTAINER_HEADER_OFFSET+index;const containerLength=lContainer.length;if(index>0){lContainer[indexInContainer-1][NEXT]=lView}if(index<containerLength-CONTAINER_HEADER_OFFSET){lView[NEXT]=lContainer[indexInContainer];addToArray(lContainer,CONTAINER_HEADER_OFFSET+index,lView)}else{lContainer.push(lView);lView[NEXT]=null}lView[PARENT]=lContainer;const declarationLContainer=lView[DECLARATION_LCONTAINER];if(declarationLContainer!==null&&lContainer!==declarationLContainer){trackMovedView(declarationLContainer,lView)}const lQueries=lView[QUERIES];if(lQueries!==null){lQueries.insertView(tView)}updateAncestorTraversalFlagsOnAttach(lView);lView[FLAGS]|=128}function trackMovedView(declarationContainer,lView){ngDevMode&&assertDefined(lView,"LView required");ngDevMode&&assertLContainer(declarationContainer);const movedViews=declarationContainer[MOVED_VIEWS];const insertedLContainer=lView[PARENT];ngDevMode&&assertLContainer(insertedLContainer);const insertedComponentLView=insertedLContainer[PARENT][DECLARATION_COMPONENT_VIEW];ngDevMode&&assertDefined(insertedComponentLView,"Missing insertedComponentLView");const declaredComponentLView=lView[DECLARATION_COMPONENT_VIEW];ngDevMode&&assertDefined(declaredComponentLView,"Missing declaredComponentLView");if(declaredComponentLView!==insertedComponentLView){declarationContainer[FLAGS]|=LContainerFlags.HasTransplantedViews}if(movedViews===null){declarationContainer[MOVED_VIEWS]=[lView]}else{movedViews.push(lView)}}function detachMovedView(declarationContainer,lView){ngDevMode&&assertLContainer(declarationContainer);ngDevMode&&assertDefined(declarationContainer[MOVED_VIEWS],"A projected view should belong to a non-empty projected views collection");const movedViews=declarationContainer[MOVED_VIEWS];const declarationViewIndex=movedViews.indexOf(lView);ngDevMode&&assertLContainer(lView[PARENT]);movedViews.splice(declarationViewIndex,1)}function detachView(lContainer,removeIndex){if(lContainer.length<=CONTAINER_HEADER_OFFSET)return;const indexInContainer=CONTAINER_HEADER_OFFSET+removeIndex;const viewToDetach=lContainer[indexInContainer];if(viewToDetach){const declarationLContainer=viewToDetach[DECLARATION_LCONTAINER];if(declarationLContainer!==null&&declarationLContainer!==lContainer){detachMovedView(declarationLContainer,viewToDetach)}if(removeIndex>0){lContainer[indexInContainer-1][NEXT]=viewToDetach[NEXT]}const removedLView=removeFromArray(lContainer,CONTAINER_HEADER_OFFSET+removeIndex);removeViewFromDOM(viewToDetach[TVIEW],viewToDetach);const lQueries=removedLView[QUERIES];if(lQueries!==null){lQueries.detachView(removedLView[TVIEW])}viewToDetach[PARENT]=null;viewToDetach[NEXT]=null;viewToDetach[FLAGS]&=~128}return viewToDetach}function destroyLView(tView,lView){if(!(lView[FLAGS]&256)){const renderer=lView[RENDERER];if(renderer.destroyNode){applyView(tView,lView,renderer,3,null,null)}destroyViewTree(lView)}}function cleanUpView(tView,lView){if(lView[FLAGS]&256){return}const prevConsumer=signals.setActiveConsumer(null);try{lView[FLAGS]&=~128;lView[FLAGS]|=256;lView[REACTIVE_TEMPLATE_CONSUMER]&&signals.consumerDestroy(lView[REACTIVE_TEMPLATE_CONSUMER]);executeOnDestroys(tView,lView);processCleanups(tView,lView);if(lView[TVIEW].type===1){ngDevMode&&ngDevMode.rendererDestroy++;lView[RENDERER].destroy()}const declarationContainer=lView[DECLARATION_LCONTAINER];if(declarationContainer!==null&&isLContainer(lView[PARENT])){if(declarationContainer!==lView[PARENT]){detachMovedView(declarationContainer,lView)}const lQueries=lView[QUERIES];if(lQueries!==null){lQueries.detachView(tView)}}unregisterLView(lView)}finally{signals.setActiveConsumer(prevConsumer)}}function processCleanups(tView,lView){ngDevMode&&assertNotReactive(processCleanups.name);const tCleanup=tView.cleanup;const lCleanup=lView[CLEANUP];if(tCleanup!==null){for(let i=0;i<tCleanup.length-1;i+=2){if(typeof tCleanup[i]==="string"){const targetIdx=tCleanup[i+3];ngDevMode&&assertNumber(targetIdx,"cleanup target must be a number");if(targetIdx>=0){lCleanup[targetIdx]()}else{lCleanup[-targetIdx].unsubscribe()}i+=2}else{const context=lCleanup[tCleanup[i+1]];tCleanup[i].call(context)}}}if(lCleanup!==null){lView[CLEANUP]=null}const destroyHooks=lView[ON_DESTROY_HOOKS];if(destroyHooks!==null){lView[ON_DESTROY_HOOKS]=null;for(let i=0;i<destroyHooks.length;i++){const destroyHooksFn=destroyHooks[i];ngDevMode&&assertFunction(destroyHooksFn,"Expecting destroy hook to be a function.");destroyHooksFn()}}}function executeOnDestroys(tView,lView){ngDevMode&&assertNotReactive(executeOnDestroys.name);let destroyHooks;if(tView!=null&&(destroyHooks=tView.destroyHooks)!=null){for(let i=0;i<destroyHooks.length;i+=2){const context=lView[destroyHooks[i]];if(!(context instanceof NodeInjectorFactory)){const toCall=destroyHooks[i+1];if(Array.isArray(toCall)){for(let j=0;j<toCall.length;j+=2){const callContext=context[toCall[j]];const hook=toCall[j+1];profiler(4,callContext,hook);try{hook.call(callContext)}finally{profiler(5,callContext,hook)}}}else{profiler(4,context,toCall);try{toCall.call(context)}finally{profiler(5,context,toCall)}}}}}}function getParentRElement(tView,tNode,lView){return getClosestRElement(tView,tNode.parent,lView)}function getClosestRElement(tView,tNode,lView){let parentTNode=tNode;while(parentTNode!==null&&parentTNode.type&(8|32)){tNode=parentTNode;parentTNode=tNode.parent}if(parentTNode===null){return lView[HOST]}else{ngDevMode&&assertTNodeType(parentTNode,3|4);const{componentOffset:componentOffset}=parentTNode;if(componentOffset>-1){ngDevMode&&assertTNodeForLView(parentTNode,lView);const{encapsulation:encapsulation}=tView.data[parentTNode.directiveStart+componentOffset];if(encapsulation===exports.ViewEncapsulation.None||encapsulation===exports.ViewEncapsulation.Emulated){return null}}return getNativeByTNode(parentTNode,lView)}}function nativeInsertBefore(renderer,parent,child,beforeNode,isMove){ngDevMode&&ngDevMode.rendererInsertBefore++;renderer.insertBefore(parent,child,beforeNode,isMove)}function nativeAppendChild(renderer,parent,child){ngDevMode&&ngDevMode.rendererAppendChild++;ngDevMode&&assertDefined(parent,"parent node must be defined");renderer.appendChild(parent,child)}function nativeAppendOrInsertBefore(renderer,parent,child,beforeNode,isMove){if(beforeNode!==null){nativeInsertBefore(renderer,parent,child,beforeNode,isMove)}else{nativeAppendChild(renderer,parent,child)}}function nativeRemoveChild(renderer,parent,child,isHostElement){renderer.removeChild(parent,child,isHostElement)}function nativeParentNode(renderer,node){return renderer.parentNode(node)}function nativeNextSibling(renderer,node){return renderer.nextSibling(node)}function getInsertInFrontOfRNode(parentTNode,currentTNode,lView){return _getInsertInFrontOfRNodeWithI18n(parentTNode,currentTNode,lView)}function getInsertInFrontOfRNodeWithNoI18n(parentTNode,currentTNode,lView){if(parentTNode.type&(8|32)){return getNativeByTNode(parentTNode,lView)}return null}let _getInsertInFrontOfRNodeWithI18n=getInsertInFrontOfRNodeWithNoI18n;let _processI18nInsertBefore;function setI18nHandling(getInsertInFrontOfRNodeWithI18n,processI18nInsertBefore){_getInsertInFrontOfRNodeWithI18n=getInsertInFrontOfRNodeWithI18n;_processI18nInsertBefore=processI18nInsertBefore}function appendChild(tView,lView,childRNode,childTNode){const parentRNode=getParentRElement(tView,childTNode,lView);const renderer=lView[RENDERER];const parentTNode=childTNode.parent||lView[T_HOST];const anchorNode=getInsertInFrontOfRNode(parentTNode,childTNode,lView);if(parentRNode!=null){if(Array.isArray(childRNode)){for(let i=0;i<childRNode.length;i++){nativeAppendOrInsertBefore(renderer,parentRNode,childRNode[i],anchorNode,false)}}else{nativeAppendOrInsertBefore(renderer,parentRNode,childRNode,anchorNode,false)}}_processI18nInsertBefore!==undefined&&_processI18nInsertBefore(renderer,childTNode,lView,childRNode,parentRNode)}function getFirstNativeNode(lView,tNode){if(tNode!==null){ngDevMode&&assertTNodeType(tNode,3|12|32|16);const tNodeType=tNode.type;if(tNodeType&3){return getNativeByTNode(tNode,lView)}else if(tNodeType&4){return getBeforeNodeForView(-1,lView[tNode.index])}else if(tNodeType&8){const elIcuContainerChild=tNode.child;if(elIcuContainerChild!==null){return getFirstNativeNode(lView,elIcuContainerChild)}else{const rNodeOrLContainer=lView[tNode.index];if(isLContainer(rNodeOrLContainer)){return getBeforeNodeForView(-1,rNodeOrLContainer)}else{return unwrapRNode(rNodeOrLContainer)}}}else if(tNodeType&32){let nextRNode=icuContainerIterate(tNode,lView);let rNode=nextRNode();return rNode||unwrapRNode(lView[tNode.index])}else{const projectionNodes=getProjectionNodes(lView,tNode);if(projectionNodes!==null){if(Array.isArray(projectionNodes)){return projectionNodes[0]}const parentView=getLViewParent(lView[DECLARATION_COMPONENT_VIEW]);ngDevMode&&assertParentView(parentView);return getFirstNativeNode(parentView,projectionNodes)}else{return getFirstNativeNode(lView,tNode.next)}}}return null}function getProjectionNodes(lView,tNode){if(tNode!==null){const componentView=lView[DECLARATION_COMPONENT_VIEW];const componentHost=componentView[T_HOST];const slotIdx=tNode.projection;ngDevMode&&assertProjectionSlots(lView);return componentHost.projection[slotIdx]}return null}function getBeforeNodeForView(viewIndexInContainer,lContainer){const nextViewIndex=CONTAINER_HEADER_OFFSET+viewIndexInContainer+1;if(nextViewIndex<lContainer.length){const lView=lContainer[nextViewIndex];const firstTNodeOfView=lView[TVIEW].firstChild;if(firstTNodeOfView!==null){return getFirstNativeNode(lView,firstTNodeOfView)}}return lContainer[NATIVE]}function nativeRemoveNode(renderer,rNode,isHostElement){ngDevMode&&ngDevMode.rendererRemoveNode++;const nativeParent=nativeParentNode(renderer,rNode);if(nativeParent){nativeRemoveChild(renderer,nativeParent,rNode,isHostElement)}}function clearElementContents(rElement){rElement.textContent=""}function applyNodes(renderer,action,tNode,lView,parentRElement,beforeNode,isProjection){while(tNode!=null){ngDevMode&&assertTNodeForLView(tNode,lView);ngDevMode&&assertTNodeType(tNode,3|12|16|32);const rawSlotValue=lView[tNode.index];const tNodeType=tNode.type;if(isProjection){if(action===0){rawSlotValue&&attachPatchData(unwrapRNode(rawSlotValue),lView);tNode.flags|=2}}if((tNode.flags&32)!==32){if(tNodeType&8){applyNodes(renderer,action,tNode.child,lView,parentRElement,beforeNode,false);applyToElementOrContainer(action,renderer,parentRElement,rawSlotValue,beforeNode)}else if(tNodeType&32){const nextRNode=icuContainerIterate(tNode,lView);let rNode;while(rNode=nextRNode()){applyToElementOrContainer(action,renderer,parentRElement,rNode,beforeNode)}applyToElementOrContainer(action,renderer,parentRElement,rawSlotValue,beforeNode)}else if(tNodeType&16){applyProjectionRecursive(renderer,action,lView,tNode,parentRElement,beforeNode)}else{ngDevMode&&assertTNodeType(tNode,3|4);applyToElementOrContainer(action,renderer,parentRElement,rawSlotValue,beforeNode)}}tNode=isProjection?tNode.projectionNext:tNode.next}}function applyView(tView,lView,renderer,action,parentRElement,beforeNode){applyNodes(renderer,action,tView.firstChild,lView,parentRElement,beforeNode,false)}function applyProjection(tView,lView,tProjectionNode){const renderer=lView[RENDERER];const parentRNode=getParentRElement(tView,tProjectionNode,lView);const parentTNode=tProjectionNode.parent||lView[T_HOST];let beforeNode=getInsertInFrontOfRNode(parentTNode,tProjectionNode,lView);applyProjectionRecursive(renderer,0,lView,tProjectionNode,parentRNode,beforeNode)}function applyProjectionRecursive(renderer,action,lView,tProjectionNode,parentRElement,beforeNode){const componentLView=lView[DECLARATION_COMPONENT_VIEW];const componentNode=componentLView[T_HOST];ngDevMode&&assertEqual(typeof tProjectionNode.projection,"number","expecting projection index");const nodeToProjectOrRNodes=componentNode.projection[tProjectionNode.projection];if(Array.isArray(nodeToProjectOrRNodes)){for(let i=0;i<nodeToProjectOrRNodes.length;i++){const rNode=nodeToProjectOrRNodes[i];applyToElementOrContainer(action,renderer,parentRElement,rNode,beforeNode)}}else{let nodeToProject=nodeToProjectOrRNodes;const projectedComponentLView=componentLView[PARENT];if(hasInSkipHydrationBlockFlag(tProjectionNode)){nodeToProject.flags|=128}applyNodes(renderer,action,nodeToProject,projectedComponentLView,parentRElement,beforeNode,true)}}function applyContainer(renderer,action,lContainer,parentRElement,beforeNode){ngDevMode&&assertLContainer(lContainer);const anchor=lContainer[NATIVE];const native=unwrapRNode(lContainer);if(anchor!==native){applyToElementOrContainer(action,renderer,parentRElement,anchor,beforeNode)}for(let i=CONTAINER_HEADER_OFFSET;i<lContainer.length;i++){const lView=lContainer[i];applyView(lView[TVIEW],lView,renderer,action,parentRElement,anchor)}}function applyStyling(renderer,isClassBased,rNode,prop,value){if(isClassBased){if(!value){ngDevMode&&ngDevMode.rendererRemoveClass++;renderer.removeClass(rNode,prop)}else{ngDevMode&&ngDevMode.rendererAddClass++;renderer.addClass(rNode,prop)}}else{let flags=prop.indexOf("-")===-1?undefined:exports.RendererStyleFlags2.DashCase;if(value==null){ngDevMode&&ngDevMode.rendererRemoveStyle++;renderer.removeStyle(rNode,prop,flags)}else{const isImportant=typeof value==="string"?value.endsWith("!important"):false;if(isImportant){value=value.slice(0,-10);flags|=exports.RendererStyleFlags2.Important}ngDevMode&&ngDevMode.rendererSetStyle++;renderer.setStyle(rNode,prop,value,flags)}}}function writeDirectStyle(renderer,element,newValue){ngDevMode&&assertString(newValue,"'newValue' should be a string");renderer.setAttribute(element,"style",newValue);ngDevMode&&ngDevMode.rendererSetStyle++}function writeDirectClass(renderer,element,newValue){ngDevMode&&assertString(newValue,"'newValue' should be a string");if(newValue===""){renderer.removeAttribute(element,"class")}else{renderer.setAttribute(element,"class",newValue)}ngDevMode&&ngDevMode.rendererSetClassName++}function setupStaticAttributes(renderer,element,tNode){const{mergedAttrs:mergedAttrs,classes:classes,styles:styles}=tNode;if(mergedAttrs!==null){setUpAttributes(renderer,element,mergedAttrs)}if(classes!==null){writeDirectClass(renderer,element,classes)}if(styles!==null){writeDirectStyle(renderer,element,styles)}}const NO_CHANGE=typeof ngDevMode==="undefined"||ngDevMode?{__brand__:"NO_CHANGE"}:{};function \u0275\u0275advance(delta=1){ngDevMode&&assertGreaterThan(delta,0,"Can only advance forward");selectIndexInternal(getTView(),getLView(),getSelectedIndex()+delta,!!ngDevMode&&isInCheckNoChangesMode())}function selectIndexInternal(tView,lView,index,checkNoChangesMode){ngDevMode&&assertIndexInDeclRange(lView[TVIEW],index);if(!checkNoChangesMode){const hooksInitPhaseCompleted=(lView[FLAGS]&3)===3;if(hooksInitPhaseCompleted){const preOrderCheckHooks=tView.preOrderCheckHooks;if(preOrderCheckHooks!==null){executeCheckHooks(lView,preOrderCheckHooks,index)}}else{const preOrderHooks=tView.preOrderHooks;if(preOrderHooks!==null){executeInitAndCheckHooks(lView,preOrderHooks,0,index)}}}setSelectedIndex(index)}function \u0275\u0275directiveInject(token,flags=exports.InjectFlags.Default){const lView=getLView();if(lView===null){ngDevMode&&assertInjectImplementationNotEqual(\u0275\u0275directiveInject);return \u0275\u0275inject(token,flags)}const tNode=getCurrentTNode();const value=getOrCreateInjectable(tNode,lView,resolveForwardRef(token),flags);ngDevMode&&emitInjectEvent(token,value,flags);return value}function \u0275\u0275invalidFactory(){const msg=ngDevMode?`This constructor was not compatible with Dependency Injection.`:"invalid";throw new Error(msg)}function writeToDirectiveInput(def,instance,publicName,privateName,flags,value){const prevConsumer=signals.setActiveConsumer(null);try{let inputSignalNode=null;if((flags&exports.\u0275\u0275InputFlags.SignalBased)!==0){const field=instance[privateName];inputSignalNode=field[signals.SIGNAL]}if(inputSignalNode!==null&&inputSignalNode.transformFn!==undefined){value=inputSignalNode.transformFn(value)}if((flags&exports.\u0275\u0275InputFlags.HasDecoratorInputTransform)!==0){value=def.inputTransforms[privateName].call(instance,value)}if(def.setInput!==null){def.setInput(instance,inputSignalNode,value,publicName,privateName)}else{applyValueToInputField(instance,inputSignalNode,privateName,value)}}finally{signals.setActiveConsumer(prevConsumer)}}function processHostBindingOpCodes(tView,lView){const hostBindingOpCodes=tView.hostBindingOpCodes;if(hostBindingOpCodes===null)return;try{for(let i=0;i<hostBindingOpCodes.length;i++){const opCode=hostBindingOpCodes[i];if(opCode<0){setSelectedIndex(~opCode)}else{const directiveIdx=opCode;const bindingRootIndx=hostBindingOpCodes[++i];const hostBindingFn=hostBindingOpCodes[++i];setBindingRootForHostBindings(bindingRootIndx,directiveIdx);const context=lView[directiveIdx];hostBindingFn(2,context)}}}finally{setSelectedIndex(-1)}}function createLView(parentLView,tView,context,flags,host,tHostNode,environment,renderer,injector,embeddedViewInjector,hydrationInfo){const lView=tView.blueprint.slice();lView[HOST]=host;lView[FLAGS]=flags|4|128|8|64;if(embeddedViewInjector!==null||parentLView&&parentLView[FLAGS]&2048){lView[FLAGS]|=2048}resetPreOrderHookFlags(lView);ngDevMode&&tView.declTNode&&parentLView&&assertTNodeForLView(tView.declTNode,parentLView);lView[PARENT]=lView[DECLARATION_VIEW]=parentLView;lView[CONTEXT]=context;lView[ENVIRONMENT]=environment||parentLView&&parentLView[ENVIRONMENT];ngDevMode&&assertDefined(lView[ENVIRONMENT],"LViewEnvironment is required");lView[RENDERER]=renderer||parentLView&&parentLView[RENDERER];ngDevMode&&assertDefined(lView[RENDERER],"Renderer is required");lView[INJECTOR]=injector||parentLView&&parentLView[INJECTOR]||null;lView[T_HOST]=tHostNode;lView[ID]=getUniqueLViewId();lView[HYDRATION]=hydrationInfo;lView[EMBEDDED_VIEW_INJECTOR]=embeddedViewInjector;ngDevMode&&assertEqual(tView.type==2?parentLView!==null:true,true,"Embedded views must have parentLView");lView[DECLARATION_COMPONENT_VIEW]=tView.type==2?parentLView[DECLARATION_COMPONENT_VIEW]:lView;return lView}function getOrCreateTNode(tView,index,type,name,attrs){ngDevMode&&index!==0&&assertGreaterThanOrEqual(index,HEADER_OFFSET,"TNodes can't be in the LView header.");ngDevMode&&assertPureTNodeType(type);let tNode=tView.data[index];if(tNode===null){tNode=createTNodeAtIndex(tView,index,type,name,attrs);if(isInI18nBlock()){tNode.flags|=32}}else if(tNode.type&64){tNode.type=type;tNode.value=name;tNode.attrs=attrs;const parent=getCurrentParentTNode();tNode.injectorIndex=parent===null?-1:parent.injectorIndex;ngDevMode&&assertTNodeForTView(tNode,tView);ngDevMode&&assertEqual(index,tNode.index,"Expecting same index")}setCurrentTNode(tNode,true);return tNode}function createTNodeAtIndex(tView,index,type,name,attrs){const currentTNode=getCurrentTNodePlaceholderOk();const isParent=isCurrentTNodeParent();const parent=isParent?currentTNode:currentTNode&¤tTNode.parent;const tNode=tView.data[index]=createTNode(tView,parent,type,index,name,attrs);if(tView.firstChild===null){tView.firstChild=tNode}if(currentTNode!==null){if(isParent){if(currentTNode.child==null&&tNode.parent!==null){currentTNode.child=tNode}}else{if(currentTNode.next===null){currentTNode.next=tNode;tNode.prev=currentTNode}}}return tNode}function allocExpando(tView,lView,numSlotsToAlloc,initialValue){if(numSlotsToAlloc===0)return-1;if(ngDevMode){assertFirstCreatePass(tView);assertSame(tView,lView[TVIEW],"`LView` must be associated with `TView`!");assertEqual(tView.data.length,lView.length,"Expecting LView to be same size as TView");assertEqual(tView.data.length,tView.blueprint.length,"Expecting Blueprint to be same size as TView");assertFirstUpdatePass(tView)}const allocIdx=lView.length;for(let i=0;i<numSlotsToAlloc;i++){lView.push(initialValue);tView.blueprint.push(initialValue);tView.data.push(null)}return allocIdx}function executeTemplate(tView,lView,templateFn,rf,context){const prevSelectedIndex=getSelectedIndex();const isUpdatePhase=rf&2;try{setSelectedIndex(-1);if(isUpdatePhase&&lView.length>HEADER_OFFSET){selectIndexInternal(tView,lView,HEADER_OFFSET,!!ngDevMode&&isInCheckNoChangesMode())}const preHookType=isUpdatePhase?2:0;profiler(preHookType,context);templateFn(rf,context)}finally{setSelectedIndex(prevSelectedIndex);const postHookType=isUpdatePhase?3:1;profiler(postHookType,context)}}function executeContentQueries(tView,tNode,lView){if(isContentQueryHost(tNode)){const prevConsumer=signals.setActiveConsumer(null);try{const start=tNode.directiveStart;const end=tNode.directiveEnd;for(let directiveIndex=start;directiveIndex<end;directiveIndex++){const def=tView.data[directiveIndex];if(def.contentQueries){const directiveInstance=lView[directiveIndex];ngDevMode&&assertDefined(directiveIndex,"Incorrect reference to a directive defining a content query");def.contentQueries(1,directiveInstance,directiveIndex)}}}finally{signals.setActiveConsumer(prevConsumer)}}}function createDirectivesInstances(tView,lView,tNode){if(!getBindingsEnabled())return;instantiateAllDirectives(tView,lView,tNode,getNativeByTNode(tNode,lView));if((tNode.flags&64)===64){invokeDirectivesHostBindings(tView,lView,tNode)}}function saveResolvedLocalsInData(viewData,tNode,localRefExtractor=getNativeByTNode){const localNames=tNode.localNames;if(localNames!==null){let localIndex=tNode.index+1;for(let i=0;i<localNames.length;i+=2){const index=localNames[i+1];const value=index===-1?localRefExtractor(tNode,viewData):viewData[index];viewData[localIndex++]=value}}}function getOrCreateComponentTView(def){const tView=def.tView;if(tView===null||tView.incompleteFirstPass){const declTNode=null;return def.tView=createTView(1,declTNode,def.template,def.decls,def.vars,def.directiveDefs,def.pipeDefs,def.viewQuery,def.schemas,def.consts,def.id)}return tView}function createTView(type,declTNode,templateFn,decls,vars,directives,pipes,viewQuery,schemas,constsOrFactory,ssrId){ngDevMode&&ngDevMode.tView++;const bindingStartIndex=HEADER_OFFSET+decls;const initialViewLength=bindingStartIndex+vars;const blueprint=createViewBlueprint(bindingStartIndex,initialViewLength);const consts=typeof constsOrFactory==="function"?constsOrFactory():constsOrFactory;const tView=blueprint[TVIEW]={type:type,blueprint:blueprint,template:templateFn,queries:null,viewQuery:viewQuery,declTNode:declTNode,data:blueprint.slice().fill(null,bindingStartIndex),bindingStartIndex:bindingStartIndex,expandoStartIndex:initialViewLength,hostBindingOpCodes:null,firstCreatePass:true,firstUpdatePass:true,staticViewQueries:false,staticContentQueries:false,preOrderHooks:null,preOrderCheckHooks:null,contentHooks:null,contentCheckHooks:null,viewHooks:null,viewCheckHooks:null,destroyHooks:null,cleanup:null,contentQueries:null,components:null,directiveRegistry:typeof directives==="function"?directives():directives,pipeRegistry:typeof pipes==="function"?pipes():pipes,firstChild:null,schemas:schemas,consts:consts,incompleteFirstPass:false,ssrId:ssrId};if(ngDevMode){Object.seal(tView)}return tView}function createViewBlueprint(bindingStartIndex,initialViewLength){const blueprint=[];for(let i=0;i<initialViewLength;i++){blueprint.push(i<bindingStartIndex?null:NO_CHANGE)}return blueprint}function locateHostElement(renderer,elementOrSelector,encapsulation,injector){const preserveHostContent=injector.get(PRESERVE_HOST_CONTENT,PRESERVE_HOST_CONTENT_DEFAULT);const preserveContent=preserveHostContent||encapsulation===exports.ViewEncapsulation.ShadowDom;const rootElement=renderer.selectRootElement(elementOrSelector,preserveContent);applyRootElementTransform(rootElement);return rootElement}function applyRootElementTransform(rootElement){_applyRootElementTransformImpl(rootElement)}let _applyRootElementTransformImpl=()=>null;function applyRootElementTransformImpl(rootElement){if(hasSkipHydrationAttrOnRElement(rootElement)){clearElementContents(rootElement)}else{processTextNodeMarkersBeforeHydration(rootElement)}}function enableApplyRootElementTransformImpl(){_applyRootElementTransformImpl=applyRootElementTransformImpl}function storeCleanupWithContext(tView,lView,context,cleanupFn){const lCleanup=getOrCreateLViewCleanup(lView);ngDevMode&&assertDefined(context,"Cleanup context is mandatory when registering framework-level destroy hooks");lCleanup.push(context);if(tView.firstCreatePass){getOrCreateTViewCleanup(tView).push(cleanupFn,lCleanup.length-1)}else{if(ngDevMode){Object.freeze(getOrCreateTViewCleanup(tView))}}}function createTNode(tView,tParent,type,index,value,attrs){ngDevMode&&index!==0&&assertGreaterThanOrEqual(index,HEADER_OFFSET,"TNodes can't be in the LView header.");ngDevMode&&assertNotSame(attrs,undefined,"'undefined' is not valid value for 'attrs'");ngDevMode&&ngDevMode.tNode++;ngDevMode&&tParent&&assertTNodeForTView(tParent,tView);let injectorIndex=tParent?tParent.injectorIndex:-1;let flags=0;if(isInSkipHydrationBlock$1()){flags|=128}const tNode={type:type,index:index,insertBeforeIndex:null,injectorIndex:injectorIndex,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,propertyBindings:null,flags:flags,providerIndexes:0,value:value,attrs:attrs,mergedAttrs:null,localNames:null,initialInputs:undefined,inputs:null,outputs:null,tView:null,next:null,prev:null,projectionNext:null,child:null,parent:tParent,projection:null,styles:null,stylesWithoutHost:null,residualStyles:undefined,classes:null,classesWithoutHost:null,residualClasses:undefined,classBindings:0,styleBindings:0};if(ngDevMode){Object.seal(tNode)}return tNode}function captureNodeBindings(mode,aliasMap,directiveIndex,bindingsResult,hostDirectiveAliasMap){for(let publicName in aliasMap){if(!aliasMap.hasOwnProperty(publicName)){continue}const value=aliasMap[publicName];if(value===undefined){continue}bindingsResult??={};let internalName;let inputFlags=exports.\u0275\u0275InputFlags.None;if(Array.isArray(value)){internalName=value[0];inputFlags=value[1]}else{internalName=value}let finalPublicName=publicName;if(hostDirectiveAliasMap!==null){if(!hostDirectiveAliasMap.hasOwnProperty(publicName)){continue}finalPublicName=hostDirectiveAliasMap[publicName]}if(mode===0){addPropertyBinding(bindingsResult,directiveIndex,finalPublicName,internalName,inputFlags)}else{addPropertyBinding(bindingsResult,directiveIndex,finalPublicName,internalName)}}return bindingsResult}function addPropertyBinding(bindings,directiveIndex,publicName,internalName,inputFlags){let values;if(bindings.hasOwnProperty(publicName)){(values=bindings[publicName]).push(directiveIndex,internalName)}else{values=bindings[publicName]=[directiveIndex,internalName]}if(inputFlags!==undefined){values.push(inputFlags)}}function initializeInputAndOutputAliases(tView,tNode,hostDirectiveDefinitionMap){ngDevMode&&assertFirstCreatePass(tView);const start=tNode.directiveStart;const end=tNode.directiveEnd;const tViewData=tView.data;const tNodeAttrs=tNode.attrs;const inputsFromAttrs=[];let inputsStore=null;let outputsStore=null;for(let directiveIndex=start;directiveIndex<end;directiveIndex++){const directiveDef=tViewData[directiveIndex];const aliasData=hostDirectiveDefinitionMap?hostDirectiveDefinitionMap.get(directiveDef):null;const aliasedInputs=aliasData?aliasData.inputs:null;const aliasedOutputs=aliasData?aliasData.outputs:null;inputsStore=captureNodeBindings(0,directiveDef.inputs,directiveIndex,inputsStore,aliasedInputs);outputsStore=captureNodeBindings(1,directiveDef.outputs,directiveIndex,outputsStore,aliasedOutputs);const initialInputs=inputsStore!==null&&tNodeAttrs!==null&&!isInlineTemplate(tNode)?generateInitialInputs(inputsStore,directiveIndex,tNodeAttrs):null;inputsFromAttrs.push(initialInputs)}if(inputsStore!==null){if(inputsStore.hasOwnProperty("class")){tNode.flags|=8}if(inputsStore.hasOwnProperty("style")){tNode.flags|=16}}tNode.initialInputs=inputsFromAttrs;tNode.inputs=inputsStore;tNode.outputs=outputsStore}function mapPropName(name){if(name==="class")return"className";if(name==="for")return"htmlFor";if(name==="formaction")return"formAction";if(name==="innerHtml")return"innerHTML";if(name==="readonly")return"readOnly";if(name==="tabindex")return"tabIndex";return name}function elementPropertyInternal(tView,tNode,lView,propName,value,renderer,sanitizer,nativeOnly){ngDevMode&&assertNotSame(value,NO_CHANGE,"Incoming value should never be NO_CHANGE.");const element=getNativeByTNode(tNode,lView);let inputData=tNode.inputs;let dataValue;if(!nativeOnly&&inputData!=null&&(dataValue=inputData[propName])){setInputsForProperty(tView,lView,dataValue,propName,value);if(isComponentHost(tNode))markDirtyIfOnPush(lView,tNode.index);if(ngDevMode){setNgReflectProperties(lView,element,tNode.type,dataValue,value)}}else if(tNode.type&3){propName=mapPropName(propName);if(ngDevMode){validateAgainstEventProperties(propName);if(!isPropertyValid(element,propName,tNode.value,tView.schemas)){handleUnknownPropertyError(propName,tNode.value,tNode.type,lView)}ngDevMode.rendererSetProperty++}value=sanitizer!=null?sanitizer(value,tNode.value||"",propName):value;renderer.setProperty(element,propName,value)}else if(tNode.type&12){if(ngDevMode&&!matchingSchemas(tView.schemas,tNode.value)){handleUnknownPropertyError(propName,tNode.value,tNode.type,lView)}}}function markDirtyIfOnPush(lView,viewIndex){ngDevMode&&assertLView(lView);const childComponentLView=getComponentLViewByIndex(viewIndex,lView);if(!(childComponentLView[FLAGS]&16)){childComponentLView[FLAGS]|=64}}function setNgReflectProperty(lView,element,type,attrName,value){const renderer=lView[RENDERER];attrName=normalizeDebugBindingName(attrName);const debugValue=normalizeDebugBindingValue(value);if(type&3){if(value==null){renderer.removeAttribute(element,attrName)}else{renderer.setAttribute(element,attrName,debugValue)}}else{const textContent=escapeCommentText(`bindings=${JSON.stringify({[attrName]:debugValue},null,2)}`);renderer.setValue(element,textContent)}}function setNgReflectProperties(lView,element,type,dataValue,value){if(type&(3|4)){for(let i=0;i<dataValue.length;i+=3){setNgReflectProperty(lView,element,type,dataValue[i+1],value)}}}function resolveDirectives(tView,lView,tNode,localRefs){ngDevMode&&assertFirstCreatePass(tView);if(getBindingsEnabled()){const exportsMap=localRefs===null?null:{"":-1};const matchResult=findDirectiveDefMatches(tView,tNode);let directiveDefs;let hostDirectiveDefs;if(matchResult===null){directiveDefs=hostDirectiveDefs=null}else{[directiveDefs,hostDirectiveDefs]=matchResult}if(directiveDefs!==null){initializeDirectives(tView,lView,tNode,directiveDefs,exportsMap,hostDirectiveDefs)}if(exportsMap)cacheMatchingLocalNames(tNode,localRefs,exportsMap)}tNode.mergedAttrs=mergeHostAttrs(tNode.mergedAttrs,tNode.attrs)}function initializeDirectives(tView,lView,tNode,directives,exportsMap,hostDirectiveDefs){ngDevMode&&assertFirstCreatePass(tView);for(let i=0;i<directives.length;i++){diPublicInInjector(getOrCreateNodeInjectorForNode(tNode,lView),tView,directives[i].type)}initTNodeFlags(tNode,tView.data.length,directives.length);for(let i=0;i<directives.length;i++){const def=directives[i];if(def.providersResolver)def.providersResolver(def)}let preOrderHooksFound=false;let preOrderCheckHooksFound=false;let directiveIdx=allocExpando(tView,lView,directives.length,null);ngDevMode&&assertSame(directiveIdx,tNode.directiveStart,"TNode.directiveStart should point to just allocated space");for(let i=0;i<directives.length;i++){const def=directives[i];tNode.mergedAttrs=mergeHostAttrs(tNode.mergedAttrs,def.hostAttrs);configureViewWithDirective(tView,tNode,lView,directiveIdx,def);saveNameToExportMap(directiveIdx,def,exportsMap);if(def.contentQueries!==null)tNode.flags|=4;if(def.hostBindings!==null||def.hostAttrs!==null||def.hostVars!==0)tNode.flags|=64;const lifeCycleHooks=def.type.prototype;if(!preOrderHooksFound&&(lifeCycleHooks.ngOnChanges||lifeCycleHooks.ngOnInit||lifeCycleHooks.ngDoCheck)){(tView.preOrderHooks??=[]).push(tNode.index);preOrderHooksFound=true}if(!preOrderCheckHooksFound&&(lifeCycleHooks.ngOnChanges||lifeCycleHooks.ngDoCheck)){(tView.preOrderCheckHooks??=[]).push(tNode.index);preOrderCheckHooksFound=true}directiveIdx++}initializeInputAndOutputAliases(tView,tNode,hostDirectiveDefs)}function registerHostBindingOpCodes(tView,tNode,directiveIdx,directiveVarsIdx,def){ngDevMode&&assertFirstCreatePass(tView);const hostBindings=def.hostBindings;if(hostBindings){let hostBindingOpCodes=tView.hostBindingOpCodes;if(hostBindingOpCodes===null){hostBindingOpCodes=tView.hostBindingOpCodes=[]}const elementIndx=~tNode.index;if(lastSelectedElementIdx(hostBindingOpCodes)!=elementIndx){hostBindingOpCodes.push(elementIndx)}hostBindingOpCodes.push(directiveIdx,directiveVarsIdx,hostBindings)}}function lastSelectedElementIdx(hostBindingOpCodes){let i=hostBindingOpCodes.length;while(i>0){const value=hostBindingOpCodes[--i];if(typeof value==="number"&&value<0){return value}}return 0}function instantiateAllDirectives(tView,lView,tNode,native){const start=tNode.directiveStart;const end=tNode.directiveEnd;if(isComponentHost(tNode)){ngDevMode&&assertTNodeType(tNode,3);addComponentLogic(lView,tNode,tView.data[start+tNode.componentOffset])}if(!tView.firstCreatePass){getOrCreateNodeInjectorForNode(tNode,lView)}attachPatchData(native,lView);const initialInputs=tNode.initialInputs;for(let i=start;i<end;i++){const def=tView.data[i];const directive=getNodeInjectable(lView,tView,i,tNode);attachPatchData(directive,lView);if(initialInputs!==null){setInputsFromAttrs(lView,i-start,directive,def,tNode,initialInputs)}if(isComponentDef(def)){const componentView=getComponentLViewByIndex(tNode.index,lView);componentView[CONTEXT]=getNodeInjectable(lView,tView,i,tNode)}}}function invokeDirectivesHostBindings(tView,lView,tNode){const start=tNode.directiveStart;const end=tNode.directiveEnd;const elementIndex=tNode.index;const currentDirectiveIndex=getCurrentDirectiveIndex();try{setSelectedIndex(elementIndex);for(let dirIndex=start;dirIndex<end;dirIndex++){const def=tView.data[dirIndex];const directive=lView[dirIndex];setCurrentDirectiveIndex(dirIndex);if(def.hostBindings!==null||def.hostVars!==0||def.hostAttrs!==null){invokeHostBindingsInCreationMode(def,directive)}}}finally{setSelectedIndex(-1);setCurrentDirectiveIndex(currentDirectiveIndex)}}function invokeHostBindingsInCreationMode(def,directive){if(def.hostBindings!==null){def.hostBindings(1,directive)}}function findDirectiveDefMatches(tView,tNode){ngDevMode&&assertFirstCreatePass(tView);ngDevMode&&assertTNodeType(tNode,3|12);const registry=tView.directiveRegistry;let matches=null;let hostDirectiveDefs=null;if(registry){for(let i=0;i<registry.length;i++){const def=registry[i];if(isNodeMatchingSelectorList(tNode,def.selectors,false)){matches||(matches=[]);if(isComponentDef(def)){if(ngDevMode){assertTNodeType(tNode,2,`"${tNode.value}" tags cannot be used as component hosts. `+`Please use a different tag to activate the ${stringify(def.type)} component.`);if(isComponentHost(tNode)){throwMultipleComponentError(tNode,matches.find(isComponentDef).type,def.type)}}if(def.findHostDirectiveDefs!==null){const hostDirectiveMatches=[];hostDirectiveDefs=hostDirectiveDefs||new Map;def.findHostDirectiveDefs(def,hostDirectiveMatches,hostDirectiveDefs);matches.unshift(...hostDirectiveMatches,def);const componentOffset=hostDirectiveMatches.length;markAsComponentHost(tView,tNode,componentOffset)}else{matches.unshift(def);markAsComponentHost(tView,tNode,0)}}else{hostDirectiveDefs=hostDirectiveDefs||new Map;def.findHostDirectiveDefs?.(def,matches,hostDirectiveDefs);matches.push(def)}}}}ngDevMode&&matches!==null&&assertNoDuplicateDirectives(matches);return matches===null?null:[matches,hostDirectiveDefs]}function markAsComponentHost(tView,hostTNode,componentOffset){ngDevMode&&assertFirstCreatePass(tView);ngDevMode&&assertGreaterThan(componentOffset,-1,"componentOffset must be great than -1");hostTNode.componentOffset=componentOffset;(tView.components??=[]).push(hostTNode.index)}function cacheMatchingLocalNames(tNode,localRefs,exportsMap){if(localRefs){const localNames=tNode.localNames=[];for(let i=0;i<localRefs.length;i+=2){const index=exportsMap[localRefs[i+1]];if(index==null)throw new RuntimeError(-301,ngDevMode&&`Export of name '${localRefs[i+1]}' not found!`);localNames.push(localRefs[i],index)}}}function saveNameToExportMap(directiveIdx,def,exportsMap){if(exportsMap){if(def.exportAs){for(let i=0;i<def.exportAs.length;i++){exportsMap[def.exportAs[i]]=directiveIdx}}if(isComponentDef(def))exportsMap[""]=directiveIdx}}function initTNodeFlags(tNode,index,numberOfDirectives){ngDevMode&&assertNotEqual(numberOfDirectives,tNode.directiveEnd-tNode.directiveStart,"Reached the max number of directives");tNode.flags|=1;tNode.directiveStart=index;tNode.directiveEnd=index+numberOfDirectives;tNode.providerIndexes=index}function configureViewWithDirective(tView,tNode,lView,directiveIndex,def){ngDevMode&&assertGreaterThanOrEqual(directiveIndex,HEADER_OFFSET,"Must be in Expando section");tView.data[directiveIndex]=def;const directiveFactory=def.factory||(def.factory=getFactoryDef(def.type,true));const nodeInjectorFactory=new NodeInjectorFactory(directiveFactory,isComponentDef(def),\u0275\u0275directiveInject);tView.blueprint[directiveIndex]=nodeInjectorFactory;lView[directiveIndex]=nodeInjectorFactory;registerHostBindingOpCodes(tView,tNode,directiveIndex,allocExpando(tView,lView,def.hostVars,NO_CHANGE),def)}function addComponentLogic(lView,hostTNode,def){const native=getNativeByTNode(hostTNode,lView);const tView=getOrCreateComponentTView(def);const rendererFactory=lView[ENVIRONMENT].rendererFactory;let lViewFlags=16;if(def.signals){lViewFlags=4096}else if(def.onPush){lViewFlags=64}const componentView=addToViewTree(lView,createLView(lView,tView,null,lViewFlags,native,hostTNode,null,rendererFactory.createRenderer(native,def),null,null,null));lView[hostTNode.index]=componentView}function elementAttributeInternal(tNode,lView,name,value,sanitizer,namespace){if(ngDevMode){assertNotSame(value,NO_CHANGE,"Incoming value should never be NO_CHANGE.");validateAgainstEventAttributes(name);assertTNodeType(tNode,2,`Attempted to set attribute \`${name}\` on a container node. `+`Host bindings are not valid on ng-container or ng-template.`)}const element=getNativeByTNode(tNode,lView);setElementAttribute(lView[RENDERER],element,namespace,tNode.value,name,value,sanitizer)}function setElementAttribute(renderer,element,namespace,tagName,name,value,sanitizer){if(value==null){ngDevMode&&ngDevMode.rendererRemoveAttribute++;renderer.removeAttribute(element,name,namespace)}else{ngDevMode&&ngDevMode.rendererSetAttribute++;const strValue=sanitizer==null?renderStringify(value):sanitizer(value,tagName||"",name);renderer.setAttribute(element,name,strValue,namespace)}}function setInputsFromAttrs(lView,directiveIndex,instance,def,tNode,initialInputData){const initialInputs=initialInputData[directiveIndex];if(initialInputs!==null){for(let i=0;i<initialInputs.length;){const publicName=initialInputs[i++];const privateName=initialInputs[i++];const flags=initialInputs[i++];const value=initialInputs[i++];writeToDirectiveInput(def,instance,publicName,privateName,flags,value);if(ngDevMode){const nativeElement=getNativeByTNode(tNode,lView);setNgReflectProperty(lView,nativeElement,tNode.type,privateName,value)}}}}function generateInitialInputs(inputs,directiveIndex,attrs){let inputsToStore=null;let i=0;while(i<attrs.length){const attrName=attrs[i];if(attrName===0){i+=4;continue}else if(attrName===5){i+=2;continue}if(typeof attrName==="number")break;if(inputs.hasOwnProperty(attrName)){if(inputsToStore===null)inputsToStore=[];const inputConfig=inputs[attrName];for(let j=0;j<inputConfig.length;j+=3){if(inputConfig[j]===directiveIndex){inputsToStore.push(attrName,inputConfig[j+1],inputConfig[j+2],attrs[i+1]);break}}}i+=2}return inputsToStore}function createLContainer(hostNative,currentView,native,tNode){ngDevMode&&assertLView(currentView);const lContainer=[hostNative,true,0,currentView,null,tNode,null,native,null,null];ngDevMode&&assertEqual(lContainer.length,CONTAINER_HEADER_OFFSET,"Should allocate correct number of slots for LContainer header.");return lContainer}function refreshContentQueries(tView,lView){const contentQueries=tView.contentQueries;if(contentQueries!==null){const prevConsumer=signals.setActiveConsumer(null);try{for(let i=0;i<contentQueries.length;i+=2){const queryStartIdx=contentQueries[i];const directiveDefIdx=contentQueries[i+1];if(directiveDefIdx!==-1){const directiveDef=tView.data[directiveDefIdx];ngDevMode&&assertDefined(directiveDef,"DirectiveDef not found.");ngDevMode&&assertDefined(directiveDef.contentQueries,"contentQueries function should be defined");setCurrentQueryIndex(queryStartIdx);directiveDef.contentQueries(2,lView[directiveDefIdx],directiveDefIdx)}}}finally{signals.setActiveConsumer(prevConsumer)}}}function addToViewTree(lView,lViewOrLContainer){if(lView[CHILD_HEAD]){lView[CHILD_TAIL][NEXT]=lViewOrLContainer}else{lView[CHILD_HEAD]=lViewOrLContainer}lView[CHILD_TAIL]=lViewOrLContainer;return lViewOrLContainer}function executeViewQueryFn(flags,viewQueryFn,component){ngDevMode&&assertDefined(viewQueryFn,"View queries function to execute must be defined.");setCurrentQueryIndex(0);const prevConsumer=signals.setActiveConsumer(null);try{viewQueryFn(flags,component)}finally{signals.setActiveConsumer(prevConsumer)}}function storePropertyBindingMetadata(tData,tNode,propertyName,bindingIndex,...interpolationParts){if(tData[bindingIndex]===null){if(tNode.inputs==null||!tNode.inputs[propertyName]){const propBindingIdxs=tNode.propertyBindings||(tNode.propertyBindings=[]);propBindingIdxs.push(bindingIndex);let bindingMetadata=propertyName;if(interpolationParts.length>0){bindingMetadata+=INTERPOLATION_DELIMITER+interpolationParts.join(INTERPOLATION_DELIMITER)}tData[bindingIndex]=bindingMetadata}}}function getOrCreateLViewCleanup(view){return view[CLEANUP]||(view[CLEANUP]=[])}function getOrCreateTViewCleanup(tView){return tView.cleanup||(tView.cleanup=[])}function loadComponentRenderer(currentDef,tNode,lView){if(currentDef===null||isComponentDef(currentDef)){lView=unwrapLView(lView[tNode.index])}return lView[RENDERER]}function handleError(lView,error){const injector=lView[INJECTOR];const errorHandler=injector?injector.get(ErrorHandler,null):null;errorHandler&&errorHandler.handleError(error)}function setInputsForProperty(tView,lView,inputs,publicName,value){for(let i=0;i<inputs.length;){const index=inputs[i++];const privateName=inputs[i++];const flags=inputs[i++];const instance=lView[index];ngDevMode&&assertIndexInRange(lView,index);const def=tView.data[index];writeToDirectiveInput(def,instance,publicName,privateName,flags,value)}}function textBindingInternal(lView,index,value){ngDevMode&&assertString(value,"Value should be a string");ngDevMode&&assertNotSame(value,NO_CHANGE,"value should not be NO_CHANGE");ngDevMode&&assertIndexInRange(lView,index);const element=getNativeByIndex(index,lView);ngDevMode&&assertDefined(element,"native element should exist");updateTextNode(lView[RENDERER],element,value)}function renderComponent(hostLView,componentHostIdx){ngDevMode&&assertEqual(isCreationMode(hostLView),true,"Should be run in creation mode");const componentView=getComponentLViewByIndex(componentHostIdx,hostLView);const componentTView=componentView[TVIEW];syncViewWithBlueprint(componentTView,componentView);const hostRNode=componentView[HOST];if(hostRNode!==null&&componentView[HYDRATION]===null){componentView[HYDRATION]=retrieveHydrationInfo(hostRNode,componentView[INJECTOR])}renderView(componentTView,componentView,componentView[CONTEXT])}function syncViewWithBlueprint(tView,lView){for(let i=lView.length;i<tView.blueprint.length;i++){lView.push(tView.blueprint[i])}}function renderView(tView,lView,context){ngDevMode&&assertEqual(isCreationMode(lView),true,"Should be run in creation mode");ngDevMode&&assertNotReactive(renderView.name);enterView(lView);try{const viewQuery=tView.viewQuery;if(viewQuery!==null){executeViewQueryFn(1,viewQuery,context)}const templateFn=tView.template;if(templateFn!==null){executeTemplate(tView,lView,templateFn,1,context)}if(tView.firstCreatePass){tView.firstCreatePass=false}lView[QUERIES]?.finishViewCreation(tView);if(tView.staticContentQueries){refreshContentQueries(tView,lView)}if(tView.staticViewQueries){executeViewQueryFn(2,tView.viewQuery,context)}const components=tView.components;if(components!==null){renderChildComponents(lView,components)}}catch(error){if(tView.firstCreatePass){tView.incompleteFirstPass=true;tView.firstCreatePass=false}throw error}finally{lView[FLAGS]&=~4;leaveView()}}function renderChildComponents(hostLView,components){for(let i=0;i<components.length;i++){renderComponent(hostLView,components[i])}}function createAndRenderEmbeddedLView(declarationLView,templateTNode,context,options){const prevConsumer=signals.setActiveConsumer(null);try{const embeddedTView=templateTNode.tView;ngDevMode&&assertDefined(embeddedTView,"TView must be defined for a template node.");ngDevMode&&assertTNodeForLView(templateTNode,declarationLView);const isSignalView=declarationLView[FLAGS]&4096;const viewFlags=isSignalView?4096:16;const embeddedLView=createLView(declarationLView,embeddedTView,context,viewFlags,null,templateTNode,null,null,options?.injector??null,options?.embeddedViewInjector??null,options?.dehydratedView??null);const declarationLContainer=declarationLView[templateTNode.index];ngDevMode&&assertLContainer(declarationLContainer);embeddedLView[DECLARATION_LCONTAINER]=declarationLContainer;const declarationViewLQueries=declarationLView[QUERIES];if(declarationViewLQueries!==null){embeddedLView[QUERIES]=declarationViewLQueries.createEmbeddedView(embeddedTView)}renderView(embeddedTView,embeddedLView,context);return embeddedLView}finally{signals.setActiveConsumer(prevConsumer)}}function getLViewFromLContainer(lContainer,index){const adjustedIndex=CONTAINER_HEADER_OFFSET+index;if(adjustedIndex<lContainer.length){const lView=lContainer[adjustedIndex];ngDevMode&&assertLView(lView);return lView}return undefined}function shouldAddViewToDom(tNode,dehydratedView){return!dehydratedView||dehydratedView.firstChild===null||hasInSkipHydrationBlockFlag(tNode)}function addLViewToLContainer(lContainer,lView,index,addToDOM=true){const tView=lView[TVIEW];insertView(tView,lView,lContainer,index);if(addToDOM){const beforeNode=getBeforeNodeForView(index,lContainer);const renderer=lView[RENDERER];const parentRNode=nativeParentNode(renderer,lContainer[NATIVE]);if(parentRNode!==null){addViewToDOM(tView,lContainer[T_HOST],renderer,lView,parentRNode,beforeNode)}}const hydrationInfo=lView[HYDRATION];if(hydrationInfo!==null&&hydrationInfo.firstChild!==null){hydrationInfo.firstChild=null}}function removeLViewFromLContainer(lContainer,index){const lView=detachView(lContainer,index);if(lView!==undefined){destroyLView(lView[TVIEW],lView)}return lView}function collectNativeNodes(tView,lView,tNode,result,isProjection=false){while(tNode!==null){ngDevMode&&assertTNodeType(tNode,3|12|16|32);const lNode=lView[tNode.index];if(lNode!==null){result.push(unwrapRNode(lNode))}if(isLContainer(lNode)){collectNativeNodesInLContainer(lNode,result)}const tNodeType=tNode.type;if(tNodeType&8){collectNativeNodes(tView,lView,tNode.child,result)}else if(tNodeType&32){const nextRNode=icuContainerIterate(tNode,lView);let rNode;while(rNode=nextRNode()){result.push(rNode)}}else if(tNodeType&16){const nodesInSlot=getProjectionNodes(lView,tNode);if(Array.isArray(nodesInSlot)){result.push(...nodesInSlot)}else{const parentView=getLViewParent(lView[DECLARATION_COMPONENT_VIEW]);ngDevMode&&assertParentView(parentView);collectNativeNodes(parentView[TVIEW],parentView,nodesInSlot,result,true)}}tNode=isProjection?tNode.projectionNext:tNode.next}return result}function collectNativeNodesInLContainer(lContainer,result){for(let i=CONTAINER_HEADER_OFFSET;i<lContainer.length;i++){const lViewInAContainer=lContainer[i];const lViewFirstChildTNode=lViewInAContainer[TVIEW].firstChild;if(lViewFirstChildTNode!==null){collectNativeNodes(lViewInAContainer[TVIEW],lViewInAContainer,lViewFirstChildTNode,result)}}if(lContainer[NATIVE]!==lContainer[HOST]){result.push(lContainer[NATIVE])}}let freeConsumers=[];function getOrBorrowReactiveLViewConsumer(lView){return lView[REACTIVE_TEMPLATE_CONSUMER]??borrowReactiveLViewConsumer(lView)}function borrowReactiveLViewConsumer(lView){const consumer=freeConsumers.pop()??Object.create(REACTIVE_LVIEW_CONSUMER_NODE);consumer.lView=lView;return consumer}function maybeReturnReactiveLViewConsumer(consumer){if(consumer.lView[REACTIVE_TEMPLATE_CONSUMER]===consumer){return}consumer.lView=null;freeConsumers.push(consumer)}const REACTIVE_LVIEW_CONSUMER_NODE={...signals.REACTIVE_NODE,consumerIsAlwaysLive:true,consumerMarkedDirty:node=>{markAncestorsForTraversal(node.lView)},consumerOnSignalRead(){this.lView[REACTIVE_TEMPLATE_CONSUMER]=this}};const MAXIMUM_REFRESH_RERUNS=100;function detectChangesInternal(lView,notifyErrorHandler=true,mode=0){const environment=lView[ENVIRONMENT];const rendererFactory=environment.rendererFactory;const checkNoChangesMode=!!ngDevMode&&isInCheckNoChangesMode();if(!checkNoChangesMode){rendererFactory.begin?.()}try{detectChangesInViewWhileDirty(lView,mode)}catch(error){if(notifyErrorHandler){handleError(lView,error)}throw error}finally{if(!checkNoChangesMode){rendererFactory.end?.();environment.inlineEffectRunner?.flush()}}}function detectChangesInViewWhileDirty(lView,mode){detectChangesInView$1(lView,mode);let retries=0;while(requiresRefreshOrTraversal(lView)){if(retries===MAXIMUM_REFRESH_RERUNS){throw new RuntimeError(103,ngDevMode&&"Infinite change detection while trying to refresh views. "+"There may be components which each cause the other to require a refresh, "+"causing an infinite loop.")}retries++;detectChangesInView$1(lView,1)}}function checkNoChangesInternal(lView,notifyErrorHandler=true){setIsInCheckNoChangesMode(true);try{detectChangesInternal(lView,notifyErrorHandler)}finally{setIsInCheckNoChangesMode(false)}}function refreshView(tView,lView,templateFn,context){ngDevMode&&assertEqual(isCreationMode(lView),false,"Should be run in update mode");const flags=lView[FLAGS];if((flags&256)===256)return;const isInCheckNoChangesPass=ngDevMode&&isInCheckNoChangesMode();!isInCheckNoChangesPass&&lView[ENVIRONMENT].inlineEffectRunner?.flush();enterView(lView);let prevConsumer=null;let currentConsumer=null;if(!isInCheckNoChangesPass&&viewShouldHaveReactiveConsumer(tView)){currentConsumer=getOrBorrowReactiveLViewConsumer(lView);prevConsumer=signals.consumerBeforeComputation(currentConsumer)}try{resetPreOrderHookFlags(lView);setBindingIndex(tView.bindingStartIndex);if(templateFn!==null){executeTemplate(tView,lView,templateFn,2,context)}const hooksInitPhaseCompleted=(flags&3)===3;if(!isInCheckNoChangesPass){if(hooksInitPhaseCompleted){const preOrderCheckHooks=tView.preOrderCheckHooks;if(preOrderCheckHooks!==null){executeCheckHooks(lView,preOrderCheckHooks,null)}}else{const preOrderHooks=tView.preOrderHooks;if(preOrderHooks!==null){executeInitAndCheckHooks(lView,preOrderHooks,0,null)}incrementInitPhaseFlags(lView,0)}}markTransplantedViewsForRefresh(lView);detectChangesInEmbeddedViews(lView,0);if(tView.contentQueries!==null){refreshContentQueries(tView,lView)}if(!isInCheckNoChangesPass){if(hooksInitPhaseCompleted){const contentCheckHooks=tView.contentCheckHooks;if(contentCheckHooks!==null){executeCheckHooks(lView,contentCheckHooks)}}else{const contentHooks=tView.contentHooks;if(contentHooks!==null){executeInitAndCheckHooks(lView,contentHooks,1)}incrementInitPhaseFlags(lView,1)}}processHostBindingOpCodes(tView,lView);const components=tView.components;if(components!==null){detectChangesInChildComponents(lView,components,0)}const viewQuery=tView.viewQuery;if(viewQuery!==null){executeViewQueryFn(2,viewQuery,context)}if(!isInCheckNoChangesPass){if(hooksInitPhaseCompleted){const viewCheckHooks=tView.viewCheckHooks;if(viewCheckHooks!==null){executeCheckHooks(lView,viewCheckHooks)}}else{const viewHooks=tView.viewHooks;if(viewHooks!==null){executeInitAndCheckHooks(lView,viewHooks,2)}incrementInitPhaseFlags(lView,2)}}if(tView.firstUpdatePass===true){tView.firstUpdatePass=false}if(lView[EFFECTS_TO_SCHEDULE]){for(const notifyEffect of lView[EFFECTS_TO_SCHEDULE]){notifyEffect()}lView[EFFECTS_TO_SCHEDULE]=null}if(!isInCheckNoChangesPass){lView[FLAGS]&=~(64|8)}}catch(e){markAncestorsForTraversal(lView);throw e}finally{if(currentConsumer!==null){signals.consumerAfterComputation(currentConsumer,prevConsumer);maybeReturnReactiveLViewConsumer(currentConsumer)}leaveView()}}function viewShouldHaveReactiveConsumer(tView){return tView.type!==2}function detectChangesInEmbeddedViews(lView,mode){for(let lContainer=getFirstLContainer(lView);lContainer!==null;lContainer=getNextLContainer(lContainer)){for(let i=CONTAINER_HEADER_OFFSET;i<lContainer.length;i++){const embeddedLView=lContainer[i];detectChangesInViewIfAttached(embeddedLView,mode)}}}function markTransplantedViewsForRefresh(lView){for(let lContainer=getFirstLContainer(lView);lContainer!==null;lContainer=getNextLContainer(lContainer)){if(!(lContainer[FLAGS]&LContainerFlags.HasTransplantedViews))continue;const movedViews=lContainer[MOVED_VIEWS];ngDevMode&&assertDefined(movedViews,"Transplanted View flags set but missing MOVED_VIEWS");for(let i=0;i<movedViews.length;i++){const movedLView=movedViews[i];const insertionLContainer=movedLView[PARENT];ngDevMode&&assertLContainer(insertionLContainer);markViewForRefresh(movedLView)}}}function detectChangesInComponent(hostLView,componentHostIdx,mode){ngDevMode&&assertEqual(isCreationMode(hostLView),false,"Should be run in update mode");const componentView=getComponentLViewByIndex(componentHostIdx,hostLView);detectChangesInViewIfAttached(componentView,mode)}function detectChangesInViewIfAttached(lView,mode){if(!viewAttachedToChangeDetector(lView)){return}detectChangesInView$1(lView,mode)}function detectChangesInView$1(lView,mode){const isInCheckNoChangesPass=ngDevMode&&isInCheckNoChangesMode();const tView=lView[TVIEW];const flags=lView[FLAGS];const consumer=lView[REACTIVE_TEMPLATE_CONSUMER];let shouldRefreshView=!!(mode===0&&flags&16);shouldRefreshView||=!!(flags&64&&mode===0&&!isInCheckNoChangesPass);shouldRefreshView||=!!(flags&1024);shouldRefreshView||=!!(consumer?.dirty&&signals.consumerPollProducersForChange(consumer));if(consumer){consumer.dirty=false}lView[FLAGS]&=~(8192|1024);if(shouldRefreshView){refreshView(tView,lView,tView.template,lView[CONTEXT])}else if(flags&8192){detectChangesInEmbeddedViews(lView,1);const components=tView.components;if(components!==null){detectChangesInChildComponents(lView,components,1)}}}function detectChangesInChildComponents(hostLView,components,mode){for(let i=0;i<components.length;i++){detectChangesInComponent(hostLView,components[i],mode)}}function markViewDirty(lView){lView[ENVIRONMENT].changeDetectionScheduler?.notify();while(lView){lView[FLAGS]|=64;const parent=getLViewParent(lView);if(isRootView(lView)&&!parent){return lView}lView=parent}return null}class ViewRef$1{get rootNodes(){const lView=this._lView;const tView=lView[TVIEW];return collectNativeNodes(tView,lView,tView.firstChild,[])}constructor(_lView,_cdRefInjectingView,notifyErrorHandler=true){this._lView=_lView;this._cdRefInjectingView=_cdRefInjectingView;this.notifyErrorHandler=notifyErrorHandler;this._appRef=null;this._attachedToViewContainer=false}get context(){return this._lView[CONTEXT]}set context(value){if(ngDevMode){console.warn("Angular: Replacing the `context` object of an `EmbeddedViewRef` is deprecated.")}this._lView[CONTEXT]=value}get destroyed(){return(this._lView[FLAGS]&256)===256}destroy(){if(this._appRef){this._appRef.detachView(this)}else if(this._attachedToViewContainer){const parent=this._lView[PARENT];if(isLContainer(parent)){const viewRefs=parent[VIEW_REFS];const index=viewRefs?viewRefs.indexOf(this):-1;if(index>-1){ngDevMode&&assertEqual(index,parent.indexOf(this._lView)-CONTAINER_HEADER_OFFSET,"An attached view should be in the same position within its container as its ViewRef in the VIEW_REFS array.");detachView(parent,index);removeFromArray(viewRefs,index)}}this._attachedToViewContainer=false}destroyLView(this._lView[TVIEW],this._lView)}onDestroy(callback){storeLViewOnDestroy(this._lView,callback)}markForCheck(){markViewDirty(this._cdRefInjectingView||this._lView)}detach(){this._lView[FLAGS]&=~128}reattach(){updateAncestorTraversalFlagsOnAttach(this._lView);this._lView[FLAGS]|=128}detectChanges(){this._lView[FLAGS]|=1024;detectChangesInternal(this._lView,this.notifyErrorHandler)}checkNoChanges(){if(ngDevMode){checkNoChangesInternal(this._lView,this.notifyErrorHandler)}}attachToViewContainerRef(){if(this._appRef){throw new RuntimeError(902,ngDevMode&&"This view is already attached directly to the ApplicationRef!")}this._attachedToViewContainer=true}detachFromAppRef(){this._appRef=null;detachViewFromDOM(this._lView[TVIEW],this._lView)}attachToAppRef(appRef){if(this._attachedToViewContainer){throw new RuntimeError(902,ngDevMode&&"This view is already attached to a ViewContainer!")}this._appRef=appRef;updateAncestorTraversalFlagsOnAttach(this._lView)}}class TemplateRef{static{this.__NG_ELEMENT_ID__=injectTemplateRef}}const ViewEngineTemplateRef=TemplateRef;const R3TemplateRef=class TemplateRef extends ViewEngineTemplateRef{constructor(_declarationLView,_declarationTContainer,elementRef){super();this._declarationLView=_declarationLView;this._declarationTContainer=_declarationTContainer;this.elementRef=elementRef}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(context,injector){return this.createEmbeddedViewImpl(context,injector)}createEmbeddedViewImpl(context,injector,dehydratedView){const embeddedLView=createAndRenderEmbeddedLView(this._declarationLView,this._declarationTContainer,context,{embeddedViewInjector:injector,dehydratedView:dehydratedView});return new ViewRef$1(embeddedLView)}};function injectTemplateRef(){return createTemplateRef(getCurrentTNode(),getLView())}function createTemplateRef(hostTNode,hostLView){if(hostTNode.type&4){ngDevMode&&assertDefined(hostTNode.tView,"TView must be allocated");return new R3TemplateRef(hostLView,hostTNode,createElementRef(hostTNode,hostLView))}return null}const AT_THIS_LOCATION="<-- AT THIS LOCATION";function getFriendlyStringFromTNodeType(tNodeType){switch(tNodeType){case 4:return"view container";case 2:return"element";case 8:return"ng-container";case 32:return"icu";case 64:return"i18n";case 16:return"projection";case 1:return"text";default:return"<unknown>"}}function validateMatchingNode(node,nodeType,tagName,lView,tNode,isViewContainerAnchor=false){if(!node||(node.nodeType!==nodeType||node.nodeType===Node.ELEMENT_NODE&&node.tagName.toLowerCase()!==tagName?.toLowerCase())){const expectedNode=shortRNodeDescription(nodeType,tagName,null);let header=`During hydration Angular expected ${expectedNode} but `;const hostComponentDef=getDeclarationComponentDef(lView);const componentClassName=hostComponentDef?.type?.name;const expectedDom=describeExpectedDom(lView,tNode,isViewContainerAnchor);const expected=`Angular expected this DOM:\n\n${expectedDom}\n\n`;let actual="";const componentHostElement=unwrapRNode(lView[HOST]);if(!node){header+=`the node was not found.\n\n`;markRNodeAsHavingHydrationMismatch(componentHostElement,expectedDom)}else{const actualNode=shortRNodeDescription(node.nodeType,node.tagName??null,node.textContent??null);header+=`found ${actualNode}.\n\n`;const actualDom=describeDomFromNode(node);actual=`Actual DOM is:\n\n${actualDom}\n\n`;markRNodeAsHavingHydrationMismatch(componentHostElement,expectedDom,actualDom)}const footer=getHydrationErrorFooter(componentClassName);const message=header+expected+actual+getHydrationAttributeNote()+footer;throw new RuntimeError(-500,message)}}function validateSiblingNodeExists(node){validateNodeExists(node);if(!node.nextSibling){const header="During hydration Angular expected more sibling nodes to be present.\n\n";const actual=`Actual DOM is:\n\n${describeDomFromNode(node)}\n\n`;const footer=getHydrationErrorFooter();const message=header+actual+footer;markRNodeAsHavingHydrationMismatch(node,"",actual);throw new RuntimeError(-501,message)}}function validateNodeExists(node,lView=null,tNode=null){if(!node){const header="During hydration, Angular expected an element to be present at this location.\n\n";let expected="";let footer="";if(lView!==null&&tNode!==null){expected=describeExpectedDom(lView,tNode,false);footer=getHydrationErrorFooter();markRNodeAsHavingHydrationMismatch(unwrapRNode(lView[HOST]),expected,"")}throw new RuntimeError(-502,`${header}${expected}\n\n${footer}`)}}function nodeNotFoundError(lView,tNode){const header="During serialization, Angular was unable to find an element in the DOM:\n\n";const expected=`${describeExpectedDom(lView,tNode,false)}\n\n`;const footer=getHydrationErrorFooter();throw new RuntimeError(-502,header+expected+footer)}function nodeNotFoundAtPathError(host,path){const header=`During hydration Angular was unable to locate a node `+`using the "${path}" path, starting from the ${describeRNode(host)} node.\n\n`;const footer=getHydrationErrorFooter();markRNodeAsHavingHydrationMismatch(host);throw new RuntimeError(-502,header+footer)}function unsupportedProjectionOfDomNodes(rNode){const header="During serialization, Angular detected DOM nodes "+"that were created outside of Angular context and provided as projectable nodes "+"(likely via `ViewContainerRef.createComponent` or `createComponent` APIs). "+"Hydration is not supported for such cases, consider refactoring the code to avoid "+"this pattern or using `ngSkipHydration` on the host element of the component.\n\n";const actual=`${describeDomFromNode(rNode)}\n\n`;const message=header+actual+getHydrationAttributeNote();return new RuntimeError(-503,message)}function invalidSkipHydrationHost(rNode){const header="The `ngSkipHydration` flag is applied on a node "+"that doesn't act as a component host. Hydration can be "+"skipped only on per-component basis.\n\n";const actual=`${describeDomFromNode(rNode)}\n\n`;const footer="Please move the `ngSkipHydration` attribute to the component host element.\n\n";const message=header+actual+footer;return new RuntimeError(-504,message)}function stringifyTNodeAttrs(tNode){const results=[];if(tNode.attrs){for(let i=0;i<tNode.attrs.length;){const attrName=tNode.attrs[i++];if(typeof attrName=="number"){break}const attrValue=tNode.attrs[i++];results.push(`${attrName}="${shorten(attrValue)}"`)}}return results.join(" ")}const internalAttrs=new Set(["ngh","ng-version","ng-server-context"]);function stringifyRNodeAttrs(rNode){const results=[];for(let i=0;i<rNode.attributes.length;i++){const attr=rNode.attributes[i];if(internalAttrs.has(attr.name))continue;results.push(`${attr.name}="${shorten(attr.value)}"`)}return results.join(" ")}function describeTNode(tNode,innerContent="\u2026"){switch(tNode.type){case 1:const content=tNode.value?`(${tNode.value})`:"";return`#text${content}`;case 2:const attrs=stringifyTNodeAttrs(tNode);const tag=tNode.value.toLowerCase();return`<${tag}${attrs?" "+attrs:""}>${innerContent}</${tag}>`;case 8:return"\x3c!-- ng-container --\x3e";case 4:return"\x3c!-- container --\x3e";default:const typeAsString=getFriendlyStringFromTNodeType(tNode.type);return`#node(${typeAsString})`}}function describeRNode(rNode,innerContent="\u2026"){const node=rNode;switch(node.nodeType){case Node.ELEMENT_NODE:const tag=node.tagName.toLowerCase();const attrs=stringifyRNodeAttrs(node);return`<${tag}${attrs?" "+attrs:""}>${innerContent}</${tag}>`;case Node.TEXT_NODE:const content=node.textContent?shorten(node.textContent):"";return`#text${content?`(${content})`:""}`;case Node.COMMENT_NODE:return`\x3c!-- ${shorten(node.textContent??"")} --\x3e`;default:return`#node(${node.nodeType})`}}function describeExpectedDom(lView,tNode,isViewContainerAnchor){const spacer=" ";let content="";if(tNode.prev){content+=spacer+"\u2026\n";content+=spacer+describeTNode(tNode.prev)+"\n"}else if(tNode.type&&tNode.type&12){content+=spacer+"\u2026\n"}if(isViewContainerAnchor){content+=spacer+describeTNode(tNode)+"\n";content+=spacer+`\x3c!-- container --\x3e ${AT_THIS_LOCATION}\n`}else{content+=spacer+describeTNode(tNode)+` ${AT_THIS_LOCATION}\n`}content+=spacer+"\u2026\n";const parentRNode=tNode.type?getParentRElement(lView[TVIEW],tNode,lView):null;if(parentRNode){content=describeRNode(parentRNode,"\n"+content)}return content}function describeDomFromNode(node){const spacer=" ";let content="";const currentNode=node;if(currentNode.previousSibling){content+=spacer+"\u2026\n";content+=spacer+describeRNode(currentNode.previousSibling)+"\n"}content+=spacer+describeRNode(currentNode)+` ${AT_THIS_LOCATION}\n`;if(node.nextSibling){content+=spacer+"\u2026\n"}if(node.parentNode){content=describeRNode(currentNode.parentNode,"\n"+content)}return content}function shortRNodeDescription(nodeType,tagName,textContent){switch(nodeType){case Node.ELEMENT_NODE:return`<${tagName.toLowerCase()}>`;case Node.TEXT_NODE:const content=textContent?` (with the "${shorten(textContent)}" content)`:"";return`a text node${content}`;case Node.COMMENT_NODE:return"a comment node";default:return`#node(nodeType=${nodeType})`}}function getHydrationErrorFooter(componentClassName){const componentInfo=componentClassName?`the "${componentClassName}"`:"corresponding";return`To fix this problem:\n`+` * check ${componentInfo} component for hydration-related issues\n`+` * check to see if your template has valid HTML structure\n`+` * or skip hydration by adding the \`ngSkipHydration\` attribute `+`to its host node in a template\n\n`}function getHydrationAttributeNote(){return"Note: attributes are only displayed to better represent the DOM"+" but have no effect on hydration mismatches.\n\n"}function stripNewlines(input){return input.replace(/\s+/gm,"")}function shorten(input,maxLength=50){if(!input){return""}input=stripNewlines(input);return input.length>maxLength?`${input.substring(0,maxLength-1)}\u2026`:input}function removeDehydratedViews(lContainer){const views=lContainer[DEHYDRATED_VIEWS]??[];const parentLView=lContainer[PARENT];const renderer=parentLView[RENDERER];for(const view of views){removeDehydratedView(view,renderer);ngDevMode&&ngDevMode.dehydratedViewsRemoved++}lContainer[DEHYDRATED_VIEWS]=EMPTY_ARRAY}function removeDehydratedView(dehydratedView,renderer){let nodesRemoved=0;let currentRNode=dehydratedView.firstChild;if(currentRNode){const numNodes=dehydratedView.data[NUM_ROOT_NODES];while(nodesRemoved<numNodes){ngDevMode&&validateSiblingNodeExists(currentRNode);const nextSibling=currentRNode.nextSibling;nativeRemoveNode(renderer,currentRNode,false);currentRNode=nextSibling;nodesRemoved++}}}function cleanupLContainer(lContainer){removeDehydratedViews(lContainer);for(let i=CONTAINER_HEADER_OFFSET;i<lContainer.length;i++){cleanupLView(lContainer[i])}}function cleanupDehydratedI18nNodes(lView){const i18nNodes=lView[HYDRATION]?.i18nNodes;if(i18nNodes){const renderer=lView[RENDERER];for(const node of i18nNodes.values()){nativeRemoveNode(renderer,node,false)}lView[HYDRATION].i18nNodes=undefined}}function cleanupLView(lView){cleanupDehydratedI18nNodes(lView);const tView=lView[TVIEW];for(let i=HEADER_OFFSET;i<tView.bindingStartIndex;i++){if(isLContainer(lView[i])){const lContainer=lView[i];cleanupLContainer(lContainer)}else if(isLView(lView[i])){cleanupLView(lView[i])}}}function cleanupDehydratedViews(appRef){const viewRefs=appRef._views;for(const viewRef of viewRefs){const lNode=getLNodeForHydration(viewRef);if(lNode!==null&&lNode[HOST]!==null){if(isLView(lNode)){cleanupLView(lNode)}else{const componentLView=lNode[HOST];cleanupLView(componentLView);cleanupLContainer(lNode)}ngDevMode&&ngDevMode.dehydratedViewsCleanupRuns++}}}const REF_EXTRACTOR_REGEXP=new RegExp(`^(\\d+)*(${REFERENCE_NODE_BODY}|${REFERENCE_NODE_HOST})*(.*)`);function compressNodeLocation(referenceNode,path){const result=[referenceNode];for(const segment of path){const lastIdx=result.length-1;if(lastIdx>0&&result[lastIdx-1]===segment){const value=result[lastIdx]||1;result[lastIdx]=value+1}else{result.push(segment,"")}}return result.join("")}function decompressNodeLocation(path){const matches=path.match(REF_EXTRACTOR_REGEXP);const[_,refNodeId,refNodeName,rest]=matches;const ref=refNodeId?parseInt(refNodeId,10):refNodeName;const steps=[];for(const[_,step,count]of rest.matchAll(/(f|n)(\d*)/g)){const repeat=parseInt(count,10)||1;steps.push(step,repeat)}return[ref,...steps]}function isFirstElementInNgContainer(tNode){return!tNode.prev&&tNode.parent?.type===8}function getNoOffsetIndex(tNode){return tNode.index-HEADER_OFFSET}function isDisconnectedNode(tNode,lView){return!(tNode.type&16)&&!!lView[tNode.index]&&!unwrapRNode(lView[tNode.index])?.isConnected}function locateI18nRNodeByIndex(hydrationInfo,noOffsetIndex){const i18nNodes=hydrationInfo.i18nNodes;if(i18nNodes){const native=i18nNodes.get(noOffsetIndex);if(native){i18nNodes.delete(noOffsetIndex)}return native}return null}function locateNextRNode(hydrationInfo,tView,lView,tNode){const noOffsetIndex=getNoOffsetIndex(tNode);let native=locateI18nRNodeByIndex(hydrationInfo,noOffsetIndex);if(!native){const nodes=hydrationInfo.data[NODES];if(nodes?.[noOffsetIndex]){native=locateRNodeByPath(nodes[noOffsetIndex],lView)}else if(tView.firstChild===tNode){native=hydrationInfo.firstChild}else{const previousTNodeParent=tNode.prev===null;const previousTNode=tNode.prev??tNode.parent;ngDevMode&&assertDefined(previousTNode,"Unexpected state: current TNode does not have a connection "+"to the previous node or a parent node.");if(isFirstElementInNgContainer(tNode)){const noOffsetParentIndex=getNoOffsetIndex(tNode.parent);native=getSegmentHead(hydrationInfo,noOffsetParentIndex)}else{let previousRElement=getNativeByTNode(previousTNode,lView);if(previousTNodeParent){native=previousRElement.firstChild}else{const noOffsetPrevSiblingIndex=getNoOffsetIndex(previousTNode);const segmentHead=getSegmentHead(hydrationInfo,noOffsetPrevSiblingIndex);if(previousTNode.type===2&&segmentHead){const numRootNodesToSkip=calcSerializedContainerSize(hydrationInfo,noOffsetPrevSiblingIndex);const nodesToSkip=numRootNodesToSkip+1;native=siblingAfter(nodesToSkip,segmentHead)}else{native=previousRElement.nextSibling}}}}}return native}function siblingAfter(skip,from){let currentNode=from;for(let i=0;i<skip;i++){ngDevMode&&validateSiblingNodeExists(currentNode);currentNode=currentNode.nextSibling}return currentNode}function stringifyNavigationInstructions(instructions){const container=[];for(let i=0;i<instructions.length;i+=2){const step=instructions[i];const repeat=instructions[i+1];for(let r=0;r<repeat;r++){container.push(step===NodeNavigationStep.FirstChild?"firstChild":"nextSibling")}}return container.join(".")}function navigateToNode(from,instructions){let node=from;for(let i=0;i<instructions.length;i+=2){const step=instructions[i];const repeat=instructions[i+1];for(let r=0;r<repeat;r++){if(ngDevMode&&!node){throw nodeNotFoundAtPathError(from,stringifyNavigationInstructions(instructions))}switch(step){case NodeNavigationStep.FirstChild:node=node.firstChild;break;case NodeNavigationStep.NextSibling:node=node.nextSibling;break}}}if(ngDevMode&&!node){throw nodeNotFoundAtPathError(from,stringifyNavigationInstructions(instructions))}return node}function locateRNodeByPath(path,lView){const[referenceNode,...navigationInstructions]=decompressNodeLocation(path);let ref;if(referenceNode===REFERENCE_NODE_HOST){ref=lView[DECLARATION_COMPONENT_VIEW][HOST]}else if(referenceNode===REFERENCE_NODE_BODY){ref=\u0275\u0275resolveBody(lView[DECLARATION_COMPONENT_VIEW][HOST])}else{const parentElementId=Number(referenceNode);ref=unwrapRNode(lView[parentElementId+HEADER_OFFSET])}return navigateToNode(ref,navigationInstructions)}function navigateBetween(start,finish){if(start===finish){return[]}else if(start.parentElement==null||finish.parentElement==null){return null}else if(start.parentElement===finish.parentElement){return navigateBetweenSiblings(start,finish)}else{const parent=finish.parentElement;const parentPath=navigateBetween(start,parent);const childPath=navigateBetween(parent.firstChild,finish);if(!parentPath||!childPath)return null;return[...parentPath,NodeNavigationStep.FirstChild,...childPath]}}function navigateBetweenSiblings(start,finish){const nav=[];let node=null;for(node=start;node!=null&&node!==finish;node=node.nextSibling){nav.push(NodeNavigationStep.NextSibling)}return node==null?null:nav}function calcPathBetween(from,to,fromNodeName){const path=navigateBetween(from,to);return path===null?null:compressNodeLocation(fromNodeName,path)}function calcPathForNode(tNode,lView){let parentTNode=tNode.parent;let parentIndex;let parentRNode;let referenceNodeName;while(parentTNode!==null&&isDisconnectedNode(parentTNode,lView)){parentTNode=parentTNode.parent}if(parentTNode===null||!(parentTNode.type&3)){parentIndex=referenceNodeName=REFERENCE_NODE_HOST;parentRNode=lView[DECLARATION_COMPONENT_VIEW][HOST]}else{parentIndex=parentTNode.index;parentRNode=unwrapRNode(lView[parentIndex]);referenceNodeName=renderStringify(parentIndex-HEADER_OFFSET)}let rNode=unwrapRNode(lView[tNode.index]);if(tNode.type&12){const firstRNode=getFirstNativeNode(lView,tNode);if(firstRNode){rNode=firstRNode}}let path=calcPathBetween(parentRNode,rNode,referenceNodeName);if(path===null&&parentRNode!==rNode){const body=parentRNode.ownerDocument.body;path=calcPathBetween(body,rNode,REFERENCE_NODE_BODY);if(path===null){throw nodeNotFoundError(lView,tNode)}}return path}function locateDehydratedViewsInContainer(currentRNode,serializedViews){const dehydratedViews=[];for(const serializedView of serializedViews){for(let i=0;i<(serializedView[MULTIPLIER]??1);i++){const view={data:serializedView,firstChild:null};if(serializedView[NUM_ROOT_NODES]>0){view.firstChild=currentRNode;currentRNode=siblingAfter(serializedView[NUM_ROOT_NODES],currentRNode)}dehydratedViews.push(view)}}return[currentRNode,dehydratedViews]}let _findMatchingDehydratedViewImpl=()=>null;function findMatchingDehydratedViewImpl(lContainer,template){const views=lContainer[DEHYDRATED_VIEWS];if(!template||views===null||views.length===0){return null}const view=views[0];if(view.data[TEMPLATE_ID]===template){return views.shift()}else{removeDehydratedViews(lContainer);return null}}function enableFindMatchingDehydratedViewImpl(){_findMatchingDehydratedViewImpl=findMatchingDehydratedViewImpl}function findMatchingDehydratedView(lContainer,template){return _findMatchingDehydratedViewImpl(lContainer,template)}class ChangeDetectionScheduler{}class ComponentRef$1{}class ComponentFactory$1{}function noComponentFactoryError(component){const error=Error(`No component factory found for ${stringify(component)}.`);error[ERROR_COMPONENT]=component;return error}const ERROR_COMPONENT="ngComponent";class _NullComponentFactoryResolver{resolveComponentFactory(component){throw noComponentFactoryError(component)}}class ComponentFactoryResolver$1{static{this.NULL=new _NullComponentFactoryResolver}}class RendererFactory2{}class Renderer2{constructor(){this.destroyNode=null}static{this.__NG_ELEMENT_ID__=()=>injectRenderer2()}}function injectRenderer2(){const lView=getLView();const tNode=getCurrentTNode();const nodeAtIndex=getComponentLViewByIndex(tNode.index,lView);return(isLView(nodeAtIndex)?nodeAtIndex:lView)[RENDERER]}class Sanitizer{static{this.\u0275prov=\u0275\u0275defineInjectable({token:Sanitizer,providedIn:"root",factory:()=>null})}}const NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR={};function assertNotInReactiveContext(debugFn,extraContext){if(signals.getActiveConsumer()!==null){throw new RuntimeError(-602,ngDevMode&&`${debugFn.name}() cannot be called from within a reactive context.${extraContext?` ${extraContext}`:""}`)}}const markedFeatures=new Set;function performanceMarkFeature(feature){if(markedFeatures.has(feature)){return}markedFeatures.add(feature);performance?.mark?.("mark_feature_usage",{detail:{feature:feature}})}function noop(...args){}function getNativeRequestAnimationFrame(){const isBrowser=typeof _global["requestAnimationFrame"]==="function";let nativeRequestAnimationFrame=_global[isBrowser?"requestAnimationFrame":"setTimeout"];let nativeCancelAnimationFrame=_global[isBrowser?"cancelAnimationFrame":"clearTimeout"];if(typeof Zone!=="undefined"&&nativeRequestAnimationFrame&&nativeCancelAnimationFrame){const unpatchedRequestAnimationFrame=nativeRequestAnimationFrame[Zone.__symbol__("OriginalDelegate")];if(unpatchedRequestAnimationFrame){nativeRequestAnimationFrame=unpatchedRequestAnimationFrame}const unpatchedCancelAnimationFrame=nativeCancelAnimationFrame[Zone.__symbol__("OriginalDelegate")];if(unpatchedCancelAnimationFrame){nativeCancelAnimationFrame=unpatchedCancelAnimationFrame}}return{nativeRequestAnimationFrame:nativeRequestAnimationFrame,nativeCancelAnimationFrame:nativeCancelAnimationFrame}}class AsyncStackTaggingZoneSpec{constructor(namePrefix,consoleAsyncStackTaggingImpl=console){this.name="asyncStackTagging for "+namePrefix;this.createTask=consoleAsyncStackTaggingImpl?.createTask??(()=>null)}onScheduleTask(delegate,_current,target,task){task.consoleTask=this.createTask(`Zone - ${task.source||task.type}`);return delegate.scheduleTask(target,task)}onInvokeTask(delegate,_currentZone,targetZone,task,applyThis,applyArgs){let ret;if(task.consoleTask){ret=task.consoleTask.run((()=>delegate.invokeTask(targetZone,task,applyThis,applyArgs)))}else{ret=delegate.invokeTask(targetZone,task,applyThis,applyArgs)}return ret}}class NgZone{constructor({enableLongStackTrace:enableLongStackTrace=false,shouldCoalesceEventChangeDetection:shouldCoalesceEventChangeDetection=false,shouldCoalesceRunChangeDetection:shouldCoalesceRunChangeDetection=false}){this.hasPendingMacrotasks=false;this.hasPendingMicrotasks=false;this.isStable=true;this.onUnstable=new EventEmitter(false);this.onMicrotaskEmpty=new EventEmitter(false);this.onStable=new EventEmitter(false);this.onError=new EventEmitter(false);if(typeof Zone=="undefined"){throw new RuntimeError(908,ngDevMode&&`In this configuration Angular requires Zone.js`)}Zone.assertZonePatched();const self=this;self._nesting=0;self._outer=self._inner=Zone.current;if(ngDevMode){self._inner=self._inner.fork(new AsyncStackTaggingZoneSpec("Angular"))}if(Zone["TaskTrackingZoneSpec"]){self._inner=self._inner.fork(new Zone["TaskTrackingZoneSpec"])}if(enableLongStackTrace&&Zone["longStackTraceZoneSpec"]){self._inner=self._inner.fork(Zone["longStackTraceZoneSpec"])}self.shouldCoalesceEventChangeDetection=!shouldCoalesceRunChangeDetection&&shouldCoalesceEventChangeDetection;self.shouldCoalesceRunChangeDetection=shouldCoalesceRunChangeDetection;self.lastRequestAnimationFrameId=-1;self.nativeRequestAnimationFrame=getNativeRequestAnimationFrame().nativeRequestAnimationFrame;forkInnerZoneWithAngularBehavior(self)}static isInAngularZone(){return typeof Zone!=="undefined"&&Zone.current.get("isAngularZone")===true}static assertInAngularZone(){if(!NgZone.isInAngularZone()){throw new RuntimeError(909,ngDevMode&&"Expected to be in Angular Zone, but it is not!")}}static assertNotInAngularZone(){if(NgZone.isInAngularZone()){throw new RuntimeError(909,ngDevMode&&"Expected to not be in Angular Zone, but it is!")}}run(fn,applyThis,applyArgs){return this._inner.run(fn,applyThis,applyArgs)}runTask(fn,applyThis,applyArgs,name){const zone=this._inner;const task=zone.scheduleEventTask("NgZoneEvent: "+name,fn,EMPTY_PAYLOAD,noop,noop);try{return zone.runTask(task,applyThis,applyArgs)}finally{zone.cancelTask(task)}}runGuarded(fn,applyThis,applyArgs){return this._inner.runGuarded(fn,applyThis,applyArgs)}runOutsideAngular(fn){return this._outer.run(fn)}}const EMPTY_PAYLOAD={};function checkStable(zone){if(zone._nesting==0&&!zone.hasPendingMicrotasks&&!zone.isStable){try{zone._nesting++;zone.onMicrotaskEmpty.emit(null)}finally{zone._nesting--;if(!zone.hasPendingMicrotasks){try{zone.runOutsideAngular((()=>zone.onStable.emit(null)))}finally{zone.isStable=true}}}}}function delayChangeDetectionForEvents(zone){if(zone.isCheckStableRunning||zone.lastRequestAnimationFrameId!==-1){return}zone.lastRequestAnimationFrameId=zone.nativeRequestAnimationFrame.call(_global,(()=>{if(!zone.fakeTopEventTask){zone.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",(()=>{zone.lastRequestAnimationFrameId=-1;updateMicroTaskStatus(zone);zone.isCheckStableRunning=true;checkStable(zone);zone.isCheckStableRunning=false}),undefined,(()=>{}),(()=>{}))}zone.fakeTopEventTask.invoke()}));updateMicroTaskStatus(zone)}function forkInnerZoneWithAngularBehavior(zone){const delayChangeDetectionForEventsDelegate=()=>{delayChangeDetectionForEvents(zone)};zone._inner=zone._inner.fork({name:"angular",properties:{isAngularZone:true},onInvokeTask:(delegate,current,target,task,applyThis,applyArgs)=>{if(shouldBeIgnoredByZone(applyArgs)){return delegate.invokeTask(target,task,applyThis,applyArgs)}try{onEnter(zone);return delegate.invokeTask(target,task,applyThis,applyArgs)}finally{if(zone.shouldCoalesceEventChangeDetection&&task.type==="eventTask"||zone.shouldCoalesceRunChangeDetection){delayChangeDetectionForEventsDelegate()}onLeave(zone)}},onInvoke:(delegate,current,target,callback,applyThis,applyArgs,source)=>{try{onEnter(zone);return delegate.invoke(target,callback,applyThis,applyArgs,source)}finally{if(zone.shouldCoalesceRunChangeDetection){delayChangeDetectionForEventsDelegate()}onLeave(zone)}},onHasTask:(delegate,current,target,hasTaskState)=>{delegate.hasTask(target,hasTaskState);if(current===target){if(hasTaskState.change=="microTask"){zone._hasPendingMicrotasks=hasTaskState.microTask;updateMicroTaskStatus(zone);checkStable(zone)}else if(hasTaskState.change=="macroTask"){zone.hasPendingMacrotasks=hasTaskState.macroTask}}},onHandleError:(delegate,current,target,error)=>{delegate.handleError(target,error);zone.runOutsideAngular((()=>zone.onError.emit(error)));return false}})}function updateMicroTaskStatus(zone){if(zone._hasPendingMicrotasks||(zone.shouldCoalesceEventChangeDetection||zone.shouldCoalesceRunChangeDetection)&&zone.lastRequestAnimationFrameId!==-1){zone.hasPendingMicrotasks=true}else{zone.hasPendingMicrotasks=false}}function onEnter(zone){zone._nesting++;if(zone.isStable){zone.isStable=false;zone.onUnstable.emit(null)}}function onLeave(zone){zone._nesting--;checkStable(zone)}class NoopNgZone{constructor(){this.hasPendingMicrotasks=false;this.hasPendingMacrotasks=false;this.isStable=true;this.onUnstable=new EventEmitter;this.onMicrotaskEmpty=new EventEmitter;this.onStable=new EventEmitter;this.onError=new EventEmitter}run(fn,applyThis,applyArgs){return fn.apply(applyThis,applyArgs)}runGuarded(fn,applyThis,applyArgs){return fn.apply(applyThis,applyArgs)}runOutsideAngular(fn){return fn()}runTask(fn,applyThis,applyArgs,name){return fn.apply(applyThis,applyArgs)}}function shouldBeIgnoredByZone(applyArgs){if(!Array.isArray(applyArgs)){return false}if(applyArgs.length!==1){return false}return applyArgs[0].data?.["__ignore_ng_zone__"]===true}function getNgZone(ngZoneToUse="zone.js",options){if(ngZoneToUse==="noop"){return new NoopNgZone}if(ngZoneToUse==="zone.js"){return new NgZone(options)}return ngZoneToUse}exports.AfterRenderPhase=void 0;(function(AfterRenderPhase){AfterRenderPhase[AfterRenderPhase["EarlyRead"]=0]="EarlyRead";AfterRenderPhase[AfterRenderPhase["Write"]=1]="Write";AfterRenderPhase[AfterRenderPhase["MixedReadWrite"]=2]="MixedReadWrite";AfterRenderPhase[AfterRenderPhase["Read"]=3]="Read"})(exports.AfterRenderPhase||(exports.AfterRenderPhase={}));const NOOP_AFTER_RENDER_REF={destroy(){}};function internalAfterNextRender(callback,options){const injector=options?.injector??inject(Injector);if(!options?.runOnServer&&!isPlatformBrowser(injector))return;const afterRenderEventManager=injector.get(AfterRenderEventManager);afterRenderEventManager.internalCallbacks.push(callback)}function afterRender(callback,options){ngDevMode&&assertNotInReactiveContext(afterRender,"Call `afterRender` outside of a reactive context. For example, schedule the render "+"callback inside the component constructor`.");!options&&assertInInjectionContext(afterRender);const injector=options?.injector??inject(Injector);if(!isPlatformBrowser(injector)){return NOOP_AFTER_RENDER_REF}performanceMarkFeature("NgAfterRender");const afterRenderEventManager=injector.get(AfterRenderEventManager);const callbackHandler=afterRenderEventManager.handler??=new AfterRenderCallbackHandlerImpl;const phase=options?.phase??exports.AfterRenderPhase.MixedReadWrite;const destroy=()=>{callbackHandler.unregister(instance);unregisterFn()};const unregisterFn=injector.get(DestroyRef).onDestroy(destroy);const instance=runInInjectionContext(injector,(()=>new AfterRenderCallback(phase,callback)));callbackHandler.register(instance);return{destroy:destroy}}function afterNextRender(callback,options){!options&&assertInInjectionContext(afterNextRender);const injector=options?.injector??inject(Injector);if(!isPlatformBrowser(injector)){return NOOP_AFTER_RENDER_REF}performanceMarkFeature("NgAfterNextRender");const afterRenderEventManager=injector.get(AfterRenderEventManager);const callbackHandler=afterRenderEventManager.handler??=new AfterRenderCallbackHandlerImpl;const phase=options?.phase??exports.AfterRenderPhase.MixedReadWrite;const destroy=()=>{callbackHandler.unregister(instance);unregisterFn()};const unregisterFn=injector.get(DestroyRef).onDestroy(destroy);const instance=runInInjectionContext(injector,(()=>new AfterRenderCallback(phase,(()=>{destroy();callback()}))));callbackHandler.register(instance);return{destroy:destroy}}class AfterRenderCallback{constructor(phase,callbackFn){this.phase=phase;this.callbackFn=callbackFn;this.zone=inject(NgZone);this.errorHandler=inject(ErrorHandler,{optional:true});inject(ChangeDetectionScheduler,{optional:true})?.notify(1)}invoke(){try{this.zone.runOutsideAngular(this.callbackFn)}catch(err){this.errorHandler?.handleError(err)}}}class AfterRenderCallbackHandlerImpl{constructor(){this.executingCallbacks=false;this.buckets={[exports.AfterRenderPhase.EarlyRead]:new Set,[exports.AfterRenderPhase.Write]:new Set,[exports.AfterRenderPhase.MixedReadWrite]:new Set,[exports.AfterRenderPhase.Read]:new Set};this.deferredCallbacks=new Set}register(callback){const target=this.executingCallbacks?this.deferredCallbacks:this.buckets[callback.phase];target.add(callback)}unregister(callback){this.buckets[callback.phase].delete(callback);this.deferredCallbacks.delete(callback)}execute(){this.executingCallbacks=true;for(const bucket of Object.values(this.buckets)){for(const callback of bucket){callback.invoke()}}this.executingCallbacks=false;for(const callback of this.deferredCallbacks){this.buckets[callback.phase].add(callback)}this.deferredCallbacks.clear()}destroy(){for(const bucket of Object.values(this.buckets)){bucket.clear()}this.deferredCallbacks.clear()}}class AfterRenderEventManager{constructor(){this.handler=null;this.internalCallbacks=[]}execute(){this.executeInternalCallbacks();this.handler?.execute()}executeInternalCallbacks(){const callbacks=[...this.internalCallbacks];this.internalCallbacks.length=0;for(const callback of callbacks){callback()}}ngOnDestroy(){this.handler?.destroy();this.handler=null;this.internalCallbacks.length=0}static{this.\u0275prov=\u0275\u0275defineInjectable({token:AfterRenderEventManager,providedIn:"root",factory:()=>new AfterRenderEventManager})}}function isModuleWithProviders(value){return value.ngModule!==undefined}function isNgModule(value){return!!getNgModuleDef(value)}function isPipe(value){return!!getPipeDef$1(value)}function isDirective(value){return!!getDirectiveDef(value)}function isComponent(value){return!!getComponentDef(value)}function getDependencyTypeForError(type){if(getComponentDef(type))return"component";if(getDirectiveDef(type))return"directive";if(getPipeDef$1(type))return"pipe";return"type"}function verifyStandaloneImport(depType,importingType){if(isForwardRef(depType)){depType=resolveForwardRef(depType);if(!depType){throw new Error(`Expected forwardRef function, imported from "${stringifyForError(importingType)}", to return a standalone entity or NgModule but got "${stringifyForError(depType)||depType}".`)}}if(getNgModuleDef(depType)==null){const def=getComponentDef(depType)||getDirectiveDef(depType)||getPipeDef$1(depType);if(def!=null){if(!def.standalone){throw new Error(`The "${stringifyForError(depType)}" ${getDependencyTypeForError(depType)}, imported from "${stringifyForError(importingType)}", is not standalone. Did you forget to add the standalone: true flag?`)}}else{if(isModuleWithProviders(depType)){throw new Error(`A module with providers was imported from "${stringifyForError(importingType)}". Modules with providers are not supported in standalone components imports.`)}else{throw new Error(`The "${stringifyForError(depType)}" type, imported from "${stringifyForError(importingType)}", must be a standalone component / directive / pipe or an NgModule. Did you forget to add the required @Component / @Directive / @Pipe or @NgModule annotation?`)}}}}const USE_RUNTIME_DEPS_TRACKER_FOR_JIT=true;class DepsTracker{constructor(){this.ownerNgModule=new Map;this.ngModulesWithSomeUnresolvedDecls=new Set;this.ngModulesScopeCache=new Map;this.standaloneComponentsScopeCache=new Map}resolveNgModulesDecls(){if(this.ngModulesWithSomeUnresolvedDecls.size===0){return}for(const moduleType of this.ngModulesWithSomeUnresolvedDecls){const def=getNgModuleDef(moduleType);if(def?.declarations){for(const decl of maybeUnwrapFn(def.declarations)){if(isComponent(decl)){this.ownerNgModule.set(decl,moduleType)}}}}this.ngModulesWithSomeUnresolvedDecls.clear()}getComponentDependencies(type,rawImports){this.resolveNgModulesDecls();const def=getComponentDef(type);if(def===null){throw new Error(`Attempting to get component dependencies for a type that is not a component: ${type}`)}if(def.standalone){const scope=this.getStandaloneComponentScope(type,rawImports);if(scope.compilation.isPoisoned){return{dependencies:[]}}return{dependencies:[...scope.compilation.directives,...scope.compilation.pipes,...scope.compilation.ngModules]}}else{if(!this.ownerNgModule.has(type)){return{dependencies:[]}}const scope=this.getNgModuleScope(this.ownerNgModule.get(type));if(scope.compilation.isPoisoned){return{dependencies:[]}}return{dependencies:[...scope.compilation.directives,...scope.compilation.pipes]}}}registerNgModule(type,scopeInfo){if(!isNgModule(type)){throw new Error(`Attempting to register a Type which is not NgModule as NgModule: ${type}`)}this.ngModulesWithSomeUnresolvedDecls.add(type)}clearScopeCacheFor(type){this.ngModulesScopeCache.delete(type);this.standaloneComponentsScopeCache.delete(type)}getNgModuleScope(type){if(this.ngModulesScopeCache.has(type)){return this.ngModulesScopeCache.get(type)}const scope=this.computeNgModuleScope(type);this.ngModulesScopeCache.set(type,scope);return scope}computeNgModuleScope(type){const def=getNgModuleDef(type,true);const scope={exported:{directives:new Set,pipes:new Set},compilation:{directives:new Set,pipes:new Set}};for(const imported of maybeUnwrapFn(def.imports)){if(isNgModule(imported)){const importedScope=this.getNgModuleScope(imported);addSet(importedScope.exported.directives,scope.compilation.directives);addSet(importedScope.exported.pipes,scope.compilation.pipes)}else if(isStandalone(imported)){if(isDirective(imported)||isComponent(imported)){scope.compilation.directives.add(imported)}else if(isPipe(imported)){scope.compilation.pipes.add(imported)}else{throw new RuntimeError(1e3,"The standalone imported type is neither a component nor a directive nor a pipe")}}else{scope.compilation.isPoisoned=true;break}}if(!scope.compilation.isPoisoned){for(const decl of maybeUnwrapFn(def.declarations)){if(isNgModule(decl)||isStandalone(decl)){scope.compilation.isPoisoned=true;break}if(isPipe(decl)){scope.compilation.pipes.add(decl)}else{scope.compilation.directives.add(decl)}}}for(const exported of maybeUnwrapFn(def.exports)){if(isNgModule(exported)){const exportedScope=this.getNgModuleScope(exported);addSet(exportedScope.exported.directives,scope.exported.directives);addSet(exportedScope.exported.pipes,scope.exported.pipes);addSet(exportedScope.exported.directives,scope.compilation.directives);addSet(exportedScope.exported.pipes,scope.compilation.pipes)}else if(isPipe(exported)){scope.exported.pipes.add(exported)}else{scope.exported.directives.add(exported)}}return scope}getStandaloneComponentScope(type,rawImports){if(this.standaloneComponentsScopeCache.has(type)){return this.standaloneComponentsScopeCache.get(type)}const ans=this.computeStandaloneComponentScope(type,rawImports);this.standaloneComponentsScopeCache.set(type,ans);return ans}computeStandaloneComponentScope(type,rawImports){const ans={compilation:{directives:new Set([type]),pipes:new Set,ngModules:new Set}};for(const rawImport of flatten(rawImports??[])){const imported=resolveForwardRef(rawImport);try{verifyStandaloneImport(imported,type)}catch(e){ans.compilation.isPoisoned=true;return ans}if(isNgModule(imported)){ans.compilation.ngModules.add(imported);const importedScope=this.getNgModuleScope(imported);if(importedScope.exported.isPoisoned){ans.compilation.isPoisoned=true;return ans}addSet(importedScope.exported.directives,ans.compilation.directives);addSet(importedScope.exported.pipes,ans.compilation.pipes)}else if(isPipe(imported)){ans.compilation.pipes.add(imported)}else if(isDirective(imported)||isComponent(imported)){ans.compilation.directives.add(imported)}else{ans.compilation.isPoisoned=true;return ans}}return ans}isOrphanComponent(cmp){const def=getComponentDef(cmp);if(!def||def.standalone){return false}this.resolveNgModulesDecls();return!this.ownerNgModule.has(cmp)}}function addSet(sourceSet,targetSet){for(const m of sourceSet){targetSet.add(m)}}const depsTracker=new DepsTracker;function computeStaticStyling(tNode,attrs,writeToHost){ngDevMode&&assertFirstCreatePass(getTView(),"Expecting to be called in first template pass only");let styles=writeToHost?tNode.styles:null;let classes=writeToHost?tNode.classes:null;let mode=0;if(attrs!==null){for(let i=0;i<attrs.length;i++){const value=attrs[i];if(typeof value==="number"){mode=value}else if(mode==1){classes=concatStringsWithSpace(classes,value)}else if(mode==2){const style=value;const styleValue=attrs[++i];styles=concatStringsWithSpace(styles,style+": "+styleValue+";")}}}writeToHost?tNode.styles=styles:tNode.stylesWithoutHost=styles;writeToHost?tNode.classes=classes:tNode.classesWithoutHost=classes}class ComponentFactoryResolver extends ComponentFactoryResolver$1{constructor(ngModule){super();this.ngModule=ngModule}resolveComponentFactory(component){ngDevMode&&assertComponentType(component);const componentDef=getComponentDef(component);return new ComponentFactory(componentDef,this.ngModule)}}function toRefArray(map){const array=[];for(const publicName in map){if(!map.hasOwnProperty(publicName)){continue}const value=map[publicName];if(value===undefined){continue}array.push({propName:Array.isArray(value)?value[0]:value,templateName:publicName})}return array}function getNamespace(elementName){const name=elementName.toLowerCase();return name==="svg"?SVG_NAMESPACE:name==="math"?MATH_ML_NAMESPACE:null}class ChainedInjector{constructor(injector,parentInjector){this.injector=injector;this.parentInjector=parentInjector}get(token,notFoundValue,flags){flags=convertToBitFlags(flags);const value=this.injector.get(token,NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR,flags);if(value!==NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR||notFoundValue===NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR){return value}return this.parentInjector.get(token,notFoundValue,flags)}}class ComponentFactory extends ComponentFactory$1{get inputs(){const componentDef=this.componentDef;const inputTransforms=componentDef.inputTransforms;const refArray=toRefArray(componentDef.inputs);if(inputTransforms!==null){for(const input of refArray){if(inputTransforms.hasOwnProperty(input.propName)){input.transform=inputTransforms[input.propName]}}}return refArray}get outputs(){return toRefArray(this.componentDef.outputs)}constructor(componentDef,ngModule){super();this.componentDef=componentDef;this.ngModule=ngModule;this.componentType=componentDef.type;this.selector=stringifyCSSSelectorList(componentDef.selectors);this.ngContentSelectors=componentDef.ngContentSelectors?componentDef.ngContentSelectors:[];this.isBoundToModule=!!ngModule}create(injector,projectableNodes,rootSelectorOrNode,environmentInjector){const prevConsumer=signals.setActiveConsumer(null);try{if(ngDevMode&&(typeof ngJitMode==="undefined"||ngJitMode)&&this.componentDef.debugInfo?.forbidOrphanRendering){if(depsTracker.isOrphanComponent(this.componentType)){throw new RuntimeError(1001,`Orphan component found! Trying to render the component ${debugStringifyTypeForError(this.componentType)} without first loading the NgModule that declares it. It is recommended to make this component standalone in order to avoid this error. If this is not possible now, import the component's NgModule in the appropriate NgModule, or the standalone component in which you are trying to render this component. If this is a lazy import, load the NgModule lazily as well and use its module injector.`)}}environmentInjector=environmentInjector||this.ngModule;let realEnvironmentInjector=environmentInjector instanceof EnvironmentInjector?environmentInjector:environmentInjector?.injector;if(realEnvironmentInjector&&this.componentDef.getStandaloneInjector!==null){realEnvironmentInjector=this.componentDef.getStandaloneInjector(realEnvironmentInjector)||realEnvironmentInjector}const rootViewInjector=realEnvironmentInjector?new ChainedInjector(injector,realEnvironmentInjector):injector;const rendererFactory=rootViewInjector.get(RendererFactory2,null);if(rendererFactory===null){throw new RuntimeError(407,ngDevMode&&"Angular was not able to inject a renderer (RendererFactory2). "+"Likely this is due to a broken DI hierarchy. "+"Make sure that any injector used to create this component has a correct parent.")}const sanitizer=rootViewInjector.get(Sanitizer,null);const afterRenderEventManager=rootViewInjector.get(AfterRenderEventManager,null);const changeDetectionScheduler=rootViewInjector.get(ChangeDetectionScheduler,null);const environment={rendererFactory:rendererFactory,sanitizer:sanitizer,inlineEffectRunner:null,afterRenderEventManager:afterRenderEventManager,changeDetectionScheduler:changeDetectionScheduler};const hostRenderer=rendererFactory.createRenderer(null,this.componentDef);const elementName=this.componentDef.selectors[0][0]||"div";const hostRNode=rootSelectorOrNode?locateHostElement(hostRenderer,rootSelectorOrNode,this.componentDef.encapsulation,rootViewInjector):createElementNode(hostRenderer,elementName,getNamespace(elementName));let rootFlags=512;if(this.componentDef.signals){rootFlags|=4096}else if(!this.componentDef.onPush){rootFlags|=16}let hydrationInfo=null;if(hostRNode!==null){hydrationInfo=retrieveHydrationInfo(hostRNode,rootViewInjector,true)}const rootTView=createTView(0,null,null,1,0,null,null,null,null,null,null);const rootLView=createLView(null,rootTView,null,rootFlags,null,null,environment,hostRenderer,rootViewInjector,null,hydrationInfo);enterView(rootLView);let component;let tElementNode;try{const rootComponentDef=this.componentDef;let rootDirectives;let hostDirectiveDefs=null;if(rootComponentDef.findHostDirectiveDefs){rootDirectives=[];hostDirectiveDefs=new Map;rootComponentDef.findHostDirectiveDefs(rootComponentDef,rootDirectives,hostDirectiveDefs);rootDirectives.push(rootComponentDef);ngDevMode&&assertNoDuplicateDirectives(rootDirectives)}else{rootDirectives=[rootComponentDef]}const hostTNode=createRootComponentTNode(rootLView,hostRNode);const componentView=createRootComponentView(hostTNode,hostRNode,rootComponentDef,rootDirectives,rootLView,environment,hostRenderer);tElementNode=getTNode(rootTView,HEADER_OFFSET);if(hostRNode){setRootNodeAttributes(hostRenderer,rootComponentDef,hostRNode,rootSelectorOrNode)}if(projectableNodes!==undefined){projectNodes(tElementNode,this.ngContentSelectors,projectableNodes)}component=createRootComponent(componentView,rootComponentDef,rootDirectives,hostDirectiveDefs,rootLView,[LifecycleHooksFeature]);renderView(rootTView,rootLView,null)}finally{leaveView()}return new ComponentRef(this.componentType,component,createElementRef(tElementNode,rootLView),rootLView,tElementNode)}finally{signals.setActiveConsumer(prevConsumer)}}}class ComponentRef extends ComponentRef$1{constructor(componentType,instance,location,_rootLView,_tNode){super();this.location=location;this._rootLView=_rootLView;this._tNode=_tNode;this.previousInputValues=null;this.instance=instance;this.hostView=this.changeDetectorRef=new ViewRef$1(_rootLView,undefined,false);this.componentType=componentType}setInput(name,value){const inputData=this._tNode.inputs;let dataValue;if(inputData!==null&&(dataValue=inputData[name])){this.previousInputValues??=new Map;if(this.previousInputValues.has(name)&&Object.is(this.previousInputValues.get(name),value)){return}const lView=this._rootLView;setInputsForProperty(lView[TVIEW],lView,dataValue,name,value);this.previousInputValues.set(name,value);const childComponentLView=getComponentLViewByIndex(this._tNode.index,lView);markViewDirty(childComponentLView)}else{if(ngDevMode){const cmpNameForError=stringifyForError(this.componentType);let message=`Can't set value of the '${name}' input on the '${cmpNameForError}' component. `;message+=`Make sure that the '${name}' property is annotated with @Input() or a mapped @Input('${name}') exists.`;reportUnknownPropertyError(message)}}}get injector(){return new NodeInjector(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(callback){this.hostView.onDestroy(callback)}}function createRootComponentTNode(lView,rNode){const tView=lView[TVIEW];const index=HEADER_OFFSET;ngDevMode&&assertIndexInRange(lView,index);lView[index]=rNode;return getOrCreateTNode(tView,index,2,"#host",null)}function createRootComponentView(tNode,hostRNode,rootComponentDef,rootDirectives,rootView,environment,hostRenderer){const tView=rootView[TVIEW];applyRootComponentStyling(rootDirectives,tNode,hostRNode,hostRenderer);let hydrationInfo=null;if(hostRNode!==null){hydrationInfo=retrieveHydrationInfo(hostRNode,rootView[INJECTOR])}const viewRenderer=environment.rendererFactory.createRenderer(hostRNode,rootComponentDef);let lViewFlags=16;if(rootComponentDef.signals){lViewFlags=4096}else if(rootComponentDef.onPush){lViewFlags=64}const componentView=createLView(rootView,getOrCreateComponentTView(rootComponentDef),null,lViewFlags,rootView[tNode.index],tNode,environment,viewRenderer,null,null,hydrationInfo);if(tView.firstCreatePass){markAsComponentHost(tView,tNode,rootDirectives.length-1)}addToViewTree(rootView,componentView);return rootView[tNode.index]=componentView}function applyRootComponentStyling(rootDirectives,tNode,rNode,hostRenderer){for(const def of rootDirectives){tNode.mergedAttrs=mergeHostAttrs(tNode.mergedAttrs,def.hostAttrs)}if(tNode.mergedAttrs!==null){computeStaticStyling(tNode,tNode.mergedAttrs,true);if(rNode!==null){setupStaticAttributes(hostRenderer,rNode,tNode)}}}function createRootComponent(componentView,rootComponentDef,rootDirectives,hostDirectiveDefs,rootLView,hostFeatures){const rootTNode=getCurrentTNode();ngDevMode&&assertDefined(rootTNode,"tNode should have been already created");const tView=rootLView[TVIEW];const native=getNativeByTNode(rootTNode,rootLView);initializeDirectives(tView,rootLView,rootTNode,rootDirectives,null,hostDirectiveDefs);for(let i=0;i<rootDirectives.length;i++){const directiveIndex=rootTNode.directiveStart+i;const directiveInstance=getNodeInjectable(rootLView,tView,directiveIndex,rootTNode);attachPatchData(directiveInstance,rootLView)}invokeDirectivesHostBindings(tView,rootLView,rootTNode);if(native){attachPatchData(native,rootLView)}ngDevMode&&assertGreaterThan(rootTNode.componentOffset,-1,"componentOffset must be great than -1");const component=getNodeInjectable(rootLView,tView,rootTNode.directiveStart+rootTNode.componentOffset,rootTNode);componentView[CONTEXT]=rootLView[CONTEXT]=component;if(hostFeatures!==null){for(const feature of hostFeatures){feature(component,rootComponentDef)}}executeContentQueries(tView,rootTNode,rootLView);return component}function setRootNodeAttributes(hostRenderer,componentDef,hostRNode,rootSelectorOrNode){if(rootSelectorOrNode){setUpAttributes(hostRenderer,hostRNode,["ng-version","17.3.11"])}else{const{attrs:attrs,classes:classes}=extractAttrsAndClassesFromSelector(componentDef.selectors[0]);if(attrs){setUpAttributes(hostRenderer,hostRNode,attrs)}if(classes&&classes.length>0){writeDirectClass(hostRenderer,hostRNode,classes.join(" "))}}}function projectNodes(tNode,ngContentSelectors,projectableNodes){const projection=tNode.projection=[];for(let i=0;i<ngContentSelectors.length;i++){const nodesforSlot=projectableNodes[i];projection.push(nodesforSlot!=null?Array.from(nodesforSlot):null)}}function LifecycleHooksFeature(){const tNode=getCurrentTNode();ngDevMode&&assertDefined(tNode,"TNode is required");registerPostOrderHooks(getLView()[TVIEW],tNode)}class ViewContainerRef{static{this.__NG_ELEMENT_ID__=injectViewContainerRef}}function injectViewContainerRef(){const previousTNode=getCurrentTNode();return createContainerRef(previousTNode,getLView())}const VE_ViewContainerRef=ViewContainerRef;const R3ViewContainerRef=class ViewContainerRef extends VE_ViewContainerRef{constructor(_lContainer,_hostTNode,_hostLView){super();this._lContainer=_lContainer;this._hostTNode=_hostTNode;this._hostLView=_hostLView}get element(){return createElementRef(this._hostTNode,this._hostLView)}get injector(){return new NodeInjector(this._hostTNode,this._hostLView)}get parentInjector(){const parentLocation=getParentInjectorLocation(this._hostTNode,this._hostLView);if(hasParentInjector(parentLocation)){const parentView=getParentInjectorView(parentLocation,this._hostLView);const injectorIndex=getParentInjectorIndex(parentLocation);ngDevMode&&assertNodeInjector(parentView,injectorIndex);const parentTNode=parentView[TVIEW].data[injectorIndex+8];return new NodeInjector(parentTNode,parentView)}else{return new NodeInjector(null,this._hostLView)}}clear(){while(this.length>0){this.remove(this.length-1)}}get(index){const viewRefs=getViewRefs(this._lContainer);return viewRefs!==null&&viewRefs[index]||null}get length(){return this._lContainer.length-CONTAINER_HEADER_OFFSET}createEmbeddedView(templateRef,context,indexOrOptions){let index;let injector;if(typeof indexOrOptions==="number"){index=indexOrOptions}else if(indexOrOptions!=null){index=indexOrOptions.index;injector=indexOrOptions.injector}const dehydratedView=findMatchingDehydratedView(this._lContainer,templateRef.ssrId);const viewRef=templateRef.createEmbeddedViewImpl(context||{},injector,dehydratedView);this.insertImpl(viewRef,index,shouldAddViewToDom(this._hostTNode,dehydratedView));return viewRef}createComponent(componentFactoryOrType,indexOrOptions,injector,projectableNodes,environmentInjector){const isComponentFactory=componentFactoryOrType&&!isType(componentFactoryOrType);let index;if(isComponentFactory){if(ngDevMode){assertEqual(typeof indexOrOptions!=="object",true,"It looks like Component factory was provided as the first argument "+"and an options object as the second argument. This combination of arguments "+"is incompatible. You can either change the first argument to provide Component "+"type or change the second argument to be a number (representing an index at "+"which to insert the new component's host view into this container)")}index=indexOrOptions}else{if(ngDevMode){assertDefined(getComponentDef(componentFactoryOrType),`Provided Component class doesn't contain Component definition. `+`Please check whether provided class has @Component decorator.`);assertEqual(typeof indexOrOptions!=="number",true,"It looks like Component type was provided as the first argument "+"and a number (representing an index at which to insert the new component's "+"host view into this container as the second argument. This combination of arguments "+"is incompatible. Please use an object as the second argument instead.")}const options=indexOrOptions||{};if(ngDevMode&&options.environmentInjector&&options.ngModuleRef){throwError(`Cannot pass both environmentInjector and ngModuleRef options to createComponent().`)}index=options.index;injector=options.injector;projectableNodes=options.projectableNodes;environmentInjector=options.environmentInjector||options.ngModuleRef}const componentFactory=isComponentFactory?componentFactoryOrType:new ComponentFactory(getComponentDef(componentFactoryOrType));const contextInjector=injector||this.parentInjector;if(!environmentInjector&&componentFactory.ngModule==null){const _injector=isComponentFactory?contextInjector:this.parentInjector;const result=_injector.get(EnvironmentInjector,null);if(result){environmentInjector=result}}const componentDef=getComponentDef(componentFactory.componentType??{});const dehydratedView=findMatchingDehydratedView(this._lContainer,componentDef?.id??null);const rNode=dehydratedView?.firstChild??null;const componentRef=componentFactory.create(contextInjector,projectableNodes,rNode,environmentInjector);this.insertImpl(componentRef.hostView,index,shouldAddViewToDom(this._hostTNode,dehydratedView));return componentRef}insert(viewRef,index){return this.insertImpl(viewRef,index,true)}insertImpl(viewRef,index,addToDOM){const lView=viewRef._lView;if(ngDevMode&&viewRef.destroyed){throw new Error("Cannot insert a destroyed View in a ViewContainer!")}if(viewAttachedToContainer(lView)){const prevIdx=this.indexOf(viewRef);if(prevIdx!==-1){this.detach(prevIdx)}else{const prevLContainer=lView[PARENT];ngDevMode&&assertEqual(isLContainer(prevLContainer),true,"An attached view should have its PARENT point to a container.");const prevVCRef=new R3ViewContainerRef(prevLContainer,prevLContainer[T_HOST],prevLContainer[PARENT]);prevVCRef.detach(prevVCRef.indexOf(viewRef))}}const adjustedIdx=this._adjustIndex(index);const lContainer=this._lContainer;addLViewToLContainer(lContainer,lView,adjustedIdx,addToDOM);viewRef.attachToViewContainerRef();addToArray(getOrCreateViewRefs(lContainer),adjustedIdx,viewRef);return viewRef}move(viewRef,newIndex){if(ngDevMode&&viewRef.destroyed){throw new Error("Cannot move a destroyed View in a ViewContainer!")}return this.insert(viewRef,newIndex)}indexOf(viewRef){const viewRefsArr=getViewRefs(this._lContainer);return viewRefsArr!==null?viewRefsArr.indexOf(viewRef):-1}remove(index){const adjustedIdx=this._adjustIndex(index,-1);const detachedView=detachView(this._lContainer,adjustedIdx);if(detachedView){removeFromArray(getOrCreateViewRefs(this._lContainer),adjustedIdx);destroyLView(detachedView[TVIEW],detachedView)}}detach(index){const adjustedIdx=this._adjustIndex(index,-1);const view=detachView(this._lContainer,adjustedIdx);const wasDetached=view&&removeFromArray(getOrCreateViewRefs(this._lContainer),adjustedIdx)!=null;return wasDetached?new ViewRef$1(view):null}_adjustIndex(index,shift=0){if(index==null){return this.length+shift}if(ngDevMode){assertGreaterThan(index,-1,`ViewRef index must be positive, got ${index}`);assertLessThan(index,this.length+1+shift,"index")}return index}};function getViewRefs(lContainer){return lContainer[VIEW_REFS]}function getOrCreateViewRefs(lContainer){return lContainer[VIEW_REFS]||(lContainer[VIEW_REFS]=[])}function createContainerRef(hostTNode,hostLView){ngDevMode&&assertTNodeType(hostTNode,12|3);let lContainer;const slotValue=hostLView[hostTNode.index];if(isLContainer(slotValue)){lContainer=slotValue}else{lContainer=createLContainer(slotValue,hostLView,null,hostTNode);hostLView[hostTNode.index]=lContainer;addToViewTree(hostLView,lContainer)}_locateOrCreateAnchorNode(lContainer,hostLView,hostTNode,slotValue);return new R3ViewContainerRef(lContainer,hostTNode,hostLView)}function insertAnchorNode(hostLView,hostTNode){const renderer=hostLView[RENDERER];ngDevMode&&ngDevMode.rendererCreateComment++;const commentNode=renderer.createComment(ngDevMode?"container":"");const hostNative=getNativeByTNode(hostTNode,hostLView);const parentOfHostNative=nativeParentNode(renderer,hostNative);nativeInsertBefore(renderer,parentOfHostNative,commentNode,nativeNextSibling(renderer,hostNative),false);return commentNode}let _locateOrCreateAnchorNode=createAnchorNode;let _populateDehydratedViewsInLContainer=()=>false;function populateDehydratedViewsInLContainer(lContainer,tNode,hostLView){return _populateDehydratedViewsInLContainer(lContainer,tNode,hostLView)}function createAnchorNode(lContainer,hostLView,hostTNode,slotValue){if(lContainer[NATIVE])return;let commentNode;if(hostTNode.type&8){commentNode=unwrapRNode(slotValue)}else{commentNode=insertAnchorNode(hostLView,hostTNode)}lContainer[NATIVE]=commentNode}function populateDehydratedViewsInLContainerImpl(lContainer,tNode,hostLView){if(lContainer[NATIVE]&&lContainer[DEHYDRATED_VIEWS]){return true}const hydrationInfo=hostLView[HYDRATION];const noOffsetIndex=tNode.index-HEADER_OFFSET;const isNodeCreationMode=!hydrationInfo||isInSkipHydrationBlock(tNode)||isDisconnectedNode$1(hydrationInfo,noOffsetIndex);if(isNodeCreationMode){return false}const currentRNode=getSegmentHead(hydrationInfo,noOffsetIndex);const serializedViews=hydrationInfo.data[CONTAINERS]?.[noOffsetIndex];ngDevMode&&assertDefined(serializedViews,"Unexpected state: no hydration info available for a given TNode, "+"which represents a view container.");const[commentNode,dehydratedViews]=locateDehydratedViewsInContainer(currentRNode,serializedViews);if(ngDevMode){validateMatchingNode(commentNode,Node.COMMENT_NODE,null,hostLView,tNode,true);markRNodeAsClaimedByHydration(commentNode,false)}lContainer[NATIVE]=commentNode;lContainer[DEHYDRATED_VIEWS]=dehydratedViews;return true}function locateOrCreateAnchorNode(lContainer,hostLView,hostTNode,slotValue){if(!_populateDehydratedViewsInLContainer(lContainer,hostTNode,hostLView)){createAnchorNode(lContainer,hostLView,hostTNode,slotValue)}}function enableLocateOrCreateContainerRefImpl(){_locateOrCreateAnchorNode=locateOrCreateAnchorNode;_populateDehydratedViewsInLContainer=populateDehydratedViewsInLContainerImpl}class LQuery_{constructor(queryList){this.queryList=queryList;this.matches=null}clone(){return new LQuery_(this.queryList)}setDirty(){this.queryList.setDirty()}}class LQueries_{constructor(queries=[]){this.queries=queries}createEmbeddedView(tView){const tQueries=tView.queries;if(tQueries!==null){const noOfInheritedQueries=tView.contentQueries!==null?tView.contentQueries[0]:tQueries.length;const viewLQueries=[];for(let i=0;i<noOfInheritedQueries;i++){const tQuery=tQueries.getByIndex(i);const parentLQuery=this.queries[tQuery.indexInDeclarationView];viewLQueries.push(parentLQuery.clone())}return new LQueries_(viewLQueries)}return null}insertView(tView){this.dirtyQueriesWithMatches(tView)}detachView(tView){this.dirtyQueriesWithMatches(tView)}finishViewCreation(tView){this.dirtyQueriesWithMatches(tView)}dirtyQueriesWithMatches(tView){for(let i=0;i<this.queries.length;i++){if(getTQuery(tView,i).matches!==null){this.queries[i].setDirty()}}}}class TQueryMetadata_{constructor(predicate,flags,read=null){this.flags=flags;this.read=read;if(typeof predicate==="string"){this.predicate=splitQueryMultiSelectors(predicate)}else{this.predicate=predicate}}}class TQueries_{constructor(queries=[]){this.queries=queries}elementStart(tView,tNode){ngDevMode&&assertFirstCreatePass(tView,"Queries should collect results on the first template pass only");for(let i=0;i<this.queries.length;i++){this.queries[i].elementStart(tView,tNode)}}elementEnd(tNode){for(let i=0;i<this.queries.length;i++){this.queries[i].elementEnd(tNode)}}embeddedTView(tNode){let queriesForTemplateRef=null;for(let i=0;i<this.length;i++){const childQueryIndex=queriesForTemplateRef!==null?queriesForTemplateRef.length:0;const tqueryClone=this.getByIndex(i).embeddedTView(tNode,childQueryIndex);if(tqueryClone){tqueryClone.indexInDeclarationView=i;if(queriesForTemplateRef!==null){queriesForTemplateRef.push(tqueryClone)}else{queriesForTemplateRef=[tqueryClone]}}}return queriesForTemplateRef!==null?new TQueries_(queriesForTemplateRef):null}template(tView,tNode){ngDevMode&&assertFirstCreatePass(tView,"Queries should collect results on the first template pass only");for(let i=0;i<this.queries.length;i++){this.queries[i].template(tView,tNode)}}getByIndex(index){ngDevMode&&assertIndexInRange(this.queries,index);return this.queries[index]}get length(){return this.queries.length}track(tquery){this.queries.push(tquery)}}class TQuery_{constructor(metadata,nodeIndex=-1){this.metadata=metadata;this.matches=null;this.indexInDeclarationView=-1;this.crossesNgTemplate=false;this._appliesToNextNode=true;this._declarationNodeIndex=nodeIndex}elementStart(tView,tNode){if(this.isApplyingToNode(tNode)){this.matchTNode(tView,tNode)}}elementEnd(tNode){if(this._declarationNodeIndex===tNode.index){this._appliesToNextNode=false}}template(tView,tNode){this.elementStart(tView,tNode)}embeddedTView(tNode,childQueryIndex){if(this.isApplyingToNode(tNode)){this.crossesNgTemplate=true;this.addMatch(-tNode.index,childQueryIndex);return new TQuery_(this.metadata)}return null}isApplyingToNode(tNode){if(this._appliesToNextNode&&(this.metadata.flags&1)!==1){const declarationNodeIdx=this._declarationNodeIndex;let parent=tNode.parent;while(parent!==null&&parent.type&8&&parent.index!==declarationNodeIdx){parent=parent.parent}return declarationNodeIdx===(parent!==null?parent.index:-1)}return this._appliesToNextNode}matchTNode(tView,tNode){const predicate=this.metadata.predicate;if(Array.isArray(predicate)){for(let i=0;i<predicate.length;i++){const name=predicate[i];this.matchTNodeWithReadOption(tView,tNode,getIdxOfMatchingSelector(tNode,name));this.matchTNodeWithReadOption(tView,tNode,locateDirectiveOrProvider(tNode,tView,name,false,false))}}else{if(predicate===TemplateRef){if(tNode.type&4){this.matchTNodeWithReadOption(tView,tNode,-1)}}else{this.matchTNodeWithReadOption(tView,tNode,locateDirectiveOrProvider(tNode,tView,predicate,false,false))}}}matchTNodeWithReadOption(tView,tNode,nodeMatchIdx){if(nodeMatchIdx!==null){const read=this.metadata.read;if(read!==null){if(read===ElementRef||read===ViewContainerRef||read===TemplateRef&&tNode.type&4){this.addMatch(tNode.index,-2)}else{const directiveOrProviderIdx=locateDirectiveOrProvider(tNode,tView,read,false,false);if(directiveOrProviderIdx!==null){this.addMatch(tNode.index,directiveOrProviderIdx)}}}else{this.addMatch(tNode.index,nodeMatchIdx)}}}addMatch(tNodeIdx,matchIdx){if(this.matches===null){this.matches=[tNodeIdx,matchIdx]}else{this.matches.push(tNodeIdx,matchIdx)}}}function getIdxOfMatchingSelector(tNode,selector){const localNames=tNode.localNames;if(localNames!==null){for(let i=0;i<localNames.length;i+=2){if(localNames[i]===selector){return localNames[i+1]}}}return null}function createResultByTNodeType(tNode,currentView){if(tNode.type&(3|8)){return createElementRef(tNode,currentView)}else if(tNode.type&4){return createTemplateRef(tNode,currentView)}return null}function createResultForNode(lView,tNode,matchingIdx,read){if(matchingIdx===-1){return createResultByTNodeType(tNode,lView)}else if(matchingIdx===-2){return createSpecialToken(lView,tNode,read)}else{return getNodeInjectable(lView,lView[TVIEW],matchingIdx,tNode)}}function createSpecialToken(lView,tNode,read){if(read===ElementRef){return createElementRef(tNode,lView)}else if(read===TemplateRef){return createTemplateRef(tNode,lView)}else if(read===ViewContainerRef){ngDevMode&&assertTNodeType(tNode,3|12);return createContainerRef(tNode,lView)}else{ngDevMode&&throwError(`Special token to read should be one of ElementRef, TemplateRef or ViewContainerRef but got ${stringify(read)}.`)}}function materializeViewResults(tView,lView,tQuery,queryIndex){const lQuery=lView[QUERIES].queries[queryIndex];if(lQuery.matches===null){const tViewData=tView.data;const tQueryMatches=tQuery.matches;const result=[];for(let i=0;tQueryMatches!==null&&i<tQueryMatches.length;i+=2){const matchedNodeIdx=tQueryMatches[i];if(matchedNodeIdx<0){result.push(null)}else{ngDevMode&&assertIndexInRange(tViewData,matchedNodeIdx);const tNode=tViewData[matchedNodeIdx];result.push(createResultForNode(lView,tNode,tQueryMatches[i+1],tQuery.metadata.read))}}lQuery.matches=result}return lQuery.matches}function collectQueryResults(tView,lView,queryIndex,result){const tQuery=tView.queries.getByIndex(queryIndex);const tQueryMatches=tQuery.matches;if(tQueryMatches!==null){const lViewResults=materializeViewResults(tView,lView,tQuery,queryIndex);for(let i=0;i<tQueryMatches.length;i+=2){const tNodeIdx=tQueryMatches[i];if(tNodeIdx>0){result.push(lViewResults[i/2])}else{const childQueryIndex=tQueryMatches[i+1];const declarationLContainer=lView[-tNodeIdx];ngDevMode&&assertLContainer(declarationLContainer);for(let i=CONTAINER_HEADER_OFFSET;i<declarationLContainer.length;i++){const embeddedLView=declarationLContainer[i];if(embeddedLView[DECLARATION_LCONTAINER]===embeddedLView[PARENT]){collectQueryResults(embeddedLView[TVIEW],embeddedLView,childQueryIndex,result)}}if(declarationLContainer[MOVED_VIEWS]!==null){const embeddedLViews=declarationLContainer[MOVED_VIEWS];for(let i=0;i<embeddedLViews.length;i++){const embeddedLView=embeddedLViews[i];collectQueryResults(embeddedLView[TVIEW],embeddedLView,childQueryIndex,result)}}}}}return result}function loadQueryInternal(lView,queryIndex){ngDevMode&&assertDefined(lView[QUERIES],"LQueries should be defined when trying to load a query");ngDevMode&&assertIndexInRange(lView[QUERIES].queries,queryIndex);return lView[QUERIES].queries[queryIndex].queryList}function createLQuery(tView,lView,flags){const queryList=new QueryList((flags&4)===4);storeCleanupWithContext(tView,lView,queryList,queryList.destroy);const lQueries=(lView[QUERIES]??=new LQueries_).queries;return lQueries.push(new LQuery_(queryList))-1}function createViewQuery(predicate,flags,read){ngDevMode&&assertNumber(flags,"Expecting flags");const tView=getTView();if(tView.firstCreatePass){createTQuery(tView,new TQueryMetadata_(predicate,flags,read),-1);if((flags&2)===2){tView.staticViewQueries=true}}return createLQuery(tView,getLView(),flags)}function createContentQuery(directiveIndex,predicate,flags,read){ngDevMode&&assertNumber(flags,"Expecting flags");const tView=getTView();if(tView.firstCreatePass){const tNode=getCurrentTNode();createTQuery(tView,new TQueryMetadata_(predicate,flags,read),tNode.index);saveContentQueryAndDirectiveIndex(tView,directiveIndex);if((flags&2)===2){tView.staticContentQueries=true}}return createLQuery(tView,getLView(),flags)}function splitQueryMultiSelectors(locator){return locator.split(",").map((s=>s.trim()))}function createTQuery(tView,metadata,nodeIndex){if(tView.queries===null)tView.queries=new TQueries_;tView.queries.track(new TQuery_(metadata,nodeIndex))}function saveContentQueryAndDirectiveIndex(tView,directiveIndex){const tViewContentQueries=tView.contentQueries||(tView.contentQueries=[]);const lastSavedDirectiveIndex=tViewContentQueries.length?tViewContentQueries[tViewContentQueries.length-1]:-1;if(directiveIndex!==lastSavedDirectiveIndex){tViewContentQueries.push(tView.queries.length-1,directiveIndex)}}function getTQuery(tView,index){ngDevMode&&assertDefined(tView.queries,"TQueries must be defined to retrieve a TQuery");return tView.queries.getByIndex(index)}function getQueryResults(lView,queryIndex){const tView=lView[TVIEW];const tQuery=getTQuery(tView,queryIndex);return tQuery.crossesNgTemplate?collectQueryResults(tView,lView,queryIndex,[]):materializeViewResults(tView,lView,tQuery,queryIndex)}function isSignal(value){return typeof value==="function"&&value[signals.SIGNAL]!==undefined}function \u0275unwrapWritableSignal(value){return null}function signal(initialValue,options){performanceMarkFeature("NgSignals");const signalFn=signals.createSignal(initialValue);const node=signalFn[signals.SIGNAL];if(options?.equal){node.equal=options.equal}signalFn.set=newValue=>signals.signalSetFn(node,newValue);signalFn.update=updateFn=>signals.signalUpdateFn(node,updateFn);signalFn.asReadonly=signalAsReadonlyFn.bind(signalFn);if(ngDevMode){signalFn.toString=()=>`[Signal: ${signalFn()}]`}return signalFn}function signalAsReadonlyFn(){const node=this[signals.SIGNAL];if(node.readonlyFn===undefined){const readonlyFn=()=>this();readonlyFn[signals.SIGNAL]=node;node.readonlyFn=readonlyFn}return node.readonlyFn}function isWritableSignal(value){return isSignal(value)&&typeof value.set==="function"}function createQuerySignalFn(firstOnly,required){let node;const signalFn=signals.createComputed((()=>{node._dirtyCounter();const value=refreshSignalQuery(node,firstOnly);if(required&&value===undefined){throw new RuntimeError(-951,ngDevMode&&"Child query result is required but no value is available.")}return value}));node=signalFn[signals.SIGNAL];node._dirtyCounter=signal(0);node._flatValue=undefined;if(ngDevMode){signalFn.toString=()=>`[Query Signal]`}return signalFn}function createSingleResultOptionalQuerySignalFn(){return createQuerySignalFn(true,false)}function createSingleResultRequiredQuerySignalFn(){return createQuerySignalFn(true,true)}function createMultiResultQuerySignalFn(){return createQuerySignalFn(false,false)}function bindQueryToSignal(target,queryIndex){const node=target[signals.SIGNAL];node._lView=getLView();node._queryIndex=queryIndex;node._queryList=loadQueryInternal(node._lView,queryIndex);node._queryList.onDirty((()=>node._dirtyCounter.update((v=>v+1))))}function refreshSignalQuery(node,firstOnly){const lView=node._lView;const queryIndex=node._queryIndex;if(lView===undefined||queryIndex===undefined||lView[FLAGS]&4){return firstOnly?undefined:EMPTY_ARRAY}const queryList=loadQueryInternal(lView,queryIndex);const results=getQueryResults(lView,queryIndex);queryList.reset(results,unwrapElementRef);if(firstOnly){return queryList.first}else{const resultChanged=queryList._changesDetected;if(resultChanged||node._flatValue===undefined){return node._flatValue=queryList.toArray()}return node._flatValue}}function viewChildFn(locator,opts){ngDevMode&&assertInInjectionContext(viewChild);return createSingleResultOptionalQuerySignalFn()}function viewChildRequiredFn(locator,opts){ngDevMode&&assertInInjectionContext(viewChild);return createSingleResultRequiredQuerySignalFn()}const viewChild=(()=>{viewChildFn.required=viewChildRequiredFn;return viewChildFn})();function viewChildren(locator,opts){ngDevMode&&assertInInjectionContext(viewChildren);return createMultiResultQuerySignalFn()}function contentChildFn(locator,opts){ngDevMode&&assertInInjectionContext(contentChild);return createSingleResultOptionalQuerySignalFn()}function contentChildRequiredFn(locator,opts){ngDevMode&&assertInInjectionContext(contentChildren);return createSingleResultRequiredQuerySignalFn()}const contentChild=(()=>{contentChildFn.required=contentChildRequiredFn;return contentChildFn})();function contentChildren(locator,opts){return createMultiResultQuerySignalFn()}function createModelSignal(initialValue){const node=Object.create(INPUT_SIGNAL_NODE);const emitterRef=new OutputEmitterRef;node.value=initialValue;function getter(){signals.producerAccessed(node);assertModelSet(node.value);return node.value}getter[signals.SIGNAL]=node;getter.asReadonly=signalAsReadonlyFn.bind(getter);getter.set=newValue=>{if(!node.equal(node.value,newValue)){signals.signalSetFn(node,newValue);emitterRef.emit(newValue)}};getter.update=updateFn=>{assertModelSet(node.value);getter.set(updateFn(node.value))};getter.subscribe=emitterRef.subscribe.bind(emitterRef);getter.destroyRef=emitterRef.destroyRef;if(ngDevMode){getter.toString=()=>`[Model Signal: ${getter()}]`}return getter}function assertModelSet(value){if(value===REQUIRED_UNSET_VALUE){throw new RuntimeError(-952,ngDevMode&&"Model is required but no value is available yet.")}}function modelFunction(initialValue){ngDevMode&&assertInInjectionContext(model);return createModelSignal(initialValue)}function modelRequiredFunction(){ngDevMode&&assertInInjectionContext(model);return createModelSignal(REQUIRED_UNSET_VALUE)}const model=(()=>{modelFunction.required=modelRequiredFunction;return modelFunction})();const emitDistinctChangesOnlyDefaultValue=true;class Query{}const ContentChildren=makePropDecorator("ContentChildren",((selector,opts={})=>({selector:selector,first:false,isViewQuery:false,descendants:false,emitDistinctChangesOnly:emitDistinctChangesOnlyDefaultValue,...opts})),Query);const ContentChild=makePropDecorator("ContentChild",((selector,opts={})=>({selector:selector,first:true,isViewQuery:false,descendants:true,...opts})),Query);const ViewChildren=makePropDecorator("ViewChildren",((selector,opts={})=>({selector:selector,first:false,isViewQuery:true,descendants:true,emitDistinctChangesOnly:emitDistinctChangesOnlyDefaultValue,...opts})),Query);const ViewChild=makePropDecorator("ViewChild",((selector,opts)=>({selector:selector,first:true,isViewQuery:true,descendants:true,...opts})),Query);function resolveComponentResources(resourceResolver){const componentResolved=[];const urlMap=new Map;function cachedResourceResolve(url){let promise=urlMap.get(url);if(!promise){const resp=resourceResolver(url);urlMap.set(url,promise=resp.then(unwrapResponse))}return promise}componentResourceResolutionQueue.forEach(((component,type)=>{const promises=[];if(component.templateUrl){promises.push(cachedResourceResolve(component.templateUrl).then((template=>{component.template=template})))}const styles=typeof component.styles==="string"?[component.styles]:component.styles||[];component.styles=styles;if(component.styleUrl&&component.styleUrls?.length){throw new Error("@Component cannot define both `styleUrl` and `styleUrls`. "+"Use `styleUrl` if the component has one stylesheet, or `styleUrls` if it has multiple")}else if(component.styleUrls?.length){const styleOffset=component.styles.length;const styleUrls=component.styleUrls;component.styleUrls.forEach(((styleUrl,index)=>{styles.push("");promises.push(cachedResourceResolve(styleUrl).then((style=>{styles[styleOffset+index]=style;styleUrls.splice(styleUrls.indexOf(styleUrl),1);if(styleUrls.length==0){component.styleUrls=undefined}})))}))}else if(component.styleUrl){promises.push(cachedResourceResolve(component.styleUrl).then((style=>{styles.push(style);component.styleUrl=undefined})))}const fullyResolved=Promise.all(promises).then((()=>componentDefResolved(type)));componentResolved.push(fullyResolved)}));clearResolutionOfComponentResourcesQueue();return Promise.all(componentResolved).then((()=>undefined))}let componentResourceResolutionQueue=new Map;const componentDefPendingResolution=new Set;function maybeQueueResolutionOfComponentResources(type,metadata){if(componentNeedsResolution(metadata)){componentResourceResolutionQueue.set(type,metadata);componentDefPendingResolution.add(type)}}function isComponentDefPendingResolution(type){return componentDefPendingResolution.has(type)}function componentNeedsResolution(component){return!!(component.templateUrl&&!component.hasOwnProperty("template")||component.styleUrls&&component.styleUrls.length||component.styleUrl)}function clearResolutionOfComponentResourcesQueue(){const old=componentResourceResolutionQueue;componentResourceResolutionQueue=new Map;return old}function restoreComponentResolutionQueue(queue){componentDefPendingResolution.clear();queue.forEach(((_,type)=>componentDefPendingResolution.add(type)));componentResourceResolutionQueue=queue}function isComponentResourceResolutionQueueEmpty(){return componentResourceResolutionQueue.size===0}function unwrapResponse(response){return typeof response=="string"?response:response.text()}function componentDefResolved(type){componentDefPendingResolution.delete(type)}const modules=new Map;let checkForDuplicateNgModules=true;function assertSameOrNotExisting(id,type,incoming){if(type&&type!==incoming&&checkForDuplicateNgModules){throw new Error(`Duplicate module registered for ${id} - ${stringify(type)} vs ${stringify(type.name)}`)}}function registerNgModuleType(ngModuleType,id){const existing=modules.get(id)||null;assertSameOrNotExisting(id,existing,ngModuleType);modules.set(id,ngModuleType)}function getRegisteredNgModuleType(id){return modules.get(id)}function setAllowDuplicateNgModuleIdsForTest(allowDuplicates){checkForDuplicateNgModules=!allowDuplicates}function \u0275\u0275validateIframeAttribute(attrValue,tagName,attrName){const lView=getLView();const tNode=getSelectedTNode();const element=getNativeByTNode(tNode,lView);if(tNode.type===2&&tagName.toLowerCase()==="iframe"){const iframe=element;iframe.src="";iframe.srcdoc=trustedHTMLFromString("");nativeRemoveNode(lView[RENDERER],iframe);const errorMessage=ngDevMode&&`Angular has detected that the \`${attrName}\` was applied `+`as a binding to an <iframe>${getTemplateLocationDetails(lView)}. `+`For security reasons, the \`${attrName}\` can be set on an <iframe> `+`as a static attribute only. \n`+`To fix this, switch the \`${attrName}\` binding to a static attribute `+`in a template or in host bindings section.`;throw new RuntimeError(-910,errorMessage)}return attrValue}function getSuperType(type){return Object.getPrototypeOf(type.prototype).constructor}function \u0275\u0275InheritDefinitionFeature(definition){let superType=getSuperType(definition.type);let shouldInheritFields=true;const inheritanceChain=[definition];while(superType){let superDef=undefined;if(isComponentDef(definition)){superDef=superType.\u0275cmp||superType.\u0275dir}else{if(superType.\u0275cmp){throw new RuntimeError(903,ngDevMode&&`Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}`)}superDef=superType.\u0275dir}if(superDef){if(shouldInheritFields){inheritanceChain.push(superDef);const writeableDef=definition;writeableDef.inputs=maybeUnwrapEmpty(definition.inputs);writeableDef.inputTransforms=maybeUnwrapEmpty(definition.inputTransforms);writeableDef.declaredInputs=maybeUnwrapEmpty(definition.declaredInputs);writeableDef.outputs=maybeUnwrapEmpty(definition.outputs);const superHostBindings=superDef.hostBindings;superHostBindings&&inheritHostBindings(definition,superHostBindings);const superViewQuery=superDef.viewQuery;const superContentQueries=superDef.contentQueries;superViewQuery&&inheritViewQuery(definition,superViewQuery);superContentQueries&&inheritContentQueries(definition,superContentQueries);mergeInputsWithTransforms(definition,superDef);fillProperties(definition.outputs,superDef.outputs);if(isComponentDef(superDef)&&superDef.data.animation){const defData=definition.data;defData.animation=(defData.animation||[]).concat(superDef.data.animation)}}const features=superDef.features;if(features){for(let i=0;i<features.length;i++){const feature=features[i];if(feature&&feature.ngInherit){feature(definition)}if(feature===\u0275\u0275InheritDefinitionFeature){shouldInheritFields=false}}}}superType=Object.getPrototypeOf(superType)}mergeHostAttrsAcrossInheritance(inheritanceChain)}function mergeInputsWithTransforms(target,source){for(const key in source.inputs){if(!source.inputs.hasOwnProperty(key)){continue}if(target.inputs.hasOwnProperty(key)){continue}const value=source.inputs[key];if(value===undefined){continue}target.inputs[key]=value;target.declaredInputs[key]=source.declaredInputs[key];if(source.inputTransforms!==null){const minifiedName=Array.isArray(value)?value[0]:value;if(!source.inputTransforms.hasOwnProperty(minifiedName)){continue}target.inputTransforms??={};target.inputTransforms[minifiedName]=source.inputTransforms[minifiedName]}}}function mergeHostAttrsAcrossInheritance(inheritanceChain){let hostVars=0;let hostAttrs=null;for(let i=inheritanceChain.length-1;i>=0;i--){const def=inheritanceChain[i];def.hostVars=hostVars+=def.hostVars;def.hostAttrs=mergeHostAttrs(def.hostAttrs,hostAttrs=mergeHostAttrs(hostAttrs,def.hostAttrs))}}function maybeUnwrapEmpty(value){if(value===EMPTY_OBJ){return{}}else if(value===EMPTY_ARRAY){return[]}else{return value}}function inheritViewQuery(definition,superViewQuery){const prevViewQuery=definition.viewQuery;if(prevViewQuery){definition.viewQuery=(rf,ctx)=>{superViewQuery(rf,ctx);prevViewQuery(rf,ctx)}}else{definition.viewQuery=superViewQuery}}function inheritContentQueries(definition,superContentQueries){const prevContentQueries=definition.contentQueries;if(prevContentQueries){definition.contentQueries=(rf,ctx,directiveIndex)=>{superContentQueries(rf,ctx,directiveIndex);prevContentQueries(rf,ctx,directiveIndex)}}else{definition.contentQueries=superContentQueries}}function inheritHostBindings(definition,superHostBindings){const prevHostBindings=definition.hostBindings;if(prevHostBindings){definition.hostBindings=(rf,ctx)=>{superHostBindings(rf,ctx);prevHostBindings(rf,ctx)}}else{definition.hostBindings=superHostBindings}}const COPY_DIRECTIVE_FIELDS=["providersResolver"];const COPY_COMPONENT_FIELDS=["template","decls","consts","vars","onPush","ngContentSelectors","styles","encapsulation","schemas"];function \u0275\u0275CopyDefinitionFeature(definition){let superType=getSuperType(definition.type);let superDef=undefined;if(isComponentDef(definition)){superDef=superType.\u0275cmp}else{superDef=superType.\u0275dir}const defAny=definition;for(const field of COPY_DIRECTIVE_FIELDS){defAny[field]=superDef[field]}if(isComponentDef(superDef)){for(const field of COPY_COMPONENT_FIELDS){defAny[field]=superDef[field]}}}function \u0275\u0275HostDirectivesFeature(rawHostDirectives){const feature=definition=>{const resolved=(Array.isArray(rawHostDirectives)?rawHostDirectives:rawHostDirectives()).map((dir=>typeof dir==="function"?{directive:resolveForwardRef(dir),inputs:EMPTY_OBJ,outputs:EMPTY_OBJ}:{directive:resolveForwardRef(dir.directive),inputs:bindingArrayToMap(dir.inputs),outputs:bindingArrayToMap(dir.outputs)}));if(definition.hostDirectives===null){definition.findHostDirectiveDefs=findHostDirectiveDefs;definition.hostDirectives=resolved}else{definition.hostDirectives.unshift(...resolved)}};feature.ngInherit=true;return feature}function findHostDirectiveDefs(currentDef,matchedDefs,hostDirectiveDefs){if(currentDef.hostDirectives!==null){for(const hostDirectiveConfig of currentDef.hostDirectives){const hostDirectiveDef=getDirectiveDef(hostDirectiveConfig.directive);if(typeof ngDevMode==="undefined"||ngDevMode){validateHostDirective(hostDirectiveConfig,hostDirectiveDef)}patchDeclaredInputs(hostDirectiveDef.declaredInputs,hostDirectiveConfig.inputs);findHostDirectiveDefs(hostDirectiveDef,matchedDefs,hostDirectiveDefs);hostDirectiveDefs.set(hostDirectiveDef,hostDirectiveConfig);matchedDefs.push(hostDirectiveDef)}}}function bindingArrayToMap(bindings){if(bindings===undefined||bindings.length===0){return EMPTY_OBJ}const result={};for(let i=0;i<bindings.length;i+=2){result[bindings[i]]=bindings[i+1]}return result}function patchDeclaredInputs(declaredInputs,exposedInputs){for(const publicName in exposedInputs){if(exposedInputs.hasOwnProperty(publicName)){const remappedPublicName=exposedInputs[publicName];const privateName=declaredInputs[publicName];if((typeof ngDevMode==="undefined"||ngDevMode)&&declaredInputs.hasOwnProperty(remappedPublicName)){assertEqual(declaredInputs[remappedPublicName],declaredInputs[publicName],`Conflicting host directive input alias ${publicName}.`)}declaredInputs[remappedPublicName]=privateName}}}function validateHostDirective(hostDirectiveConfig,directiveDef){const type=hostDirectiveConfig.directive;if(directiveDef===null){if(getComponentDef(type)!==null){throw new RuntimeError(310,`Host directive ${type.name} cannot be a component.`)}throw new RuntimeError(307,`Could not resolve metadata for host directive ${type.name}. `+`Make sure that the ${type.name} class is annotated with an @Directive decorator.`)}if(!directiveDef.standalone){throw new RuntimeError(308,`Host directive ${directiveDef.type.name} must be standalone.`)}validateMappings("input",directiveDef,hostDirectiveConfig.inputs);validateMappings("output",directiveDef,hostDirectiveConfig.outputs)}function validateMappings(bindingType,def,hostDirectiveBindings){const className=def.type.name;const bindings=bindingType==="input"?def.inputs:def.outputs;for(const publicName in hostDirectiveBindings){if(hostDirectiveBindings.hasOwnProperty(publicName)){if(!bindings.hasOwnProperty(publicName)){throw new RuntimeError(311,`Directive ${className} does not have an ${bindingType} with a public name of ${publicName}.`)}const remappedPublicName=hostDirectiveBindings[publicName];if(bindings.hasOwnProperty(remappedPublicName)&&remappedPublicName!==publicName){throw new RuntimeError(312,`Cannot alias ${bindingType} ${publicName} of host directive ${className} to ${remappedPublicName}, because it already has a different ${bindingType} with the same public name.`)}}}}function \u0275\u0275InputTransformsFeature(definition){const inputs=definition.inputConfig;const inputTransforms={};for(const minifiedKey in inputs){if(inputs.hasOwnProperty(minifiedKey)){const value=inputs[minifiedKey];if(Array.isArray(value)&&value[3]){inputTransforms[minifiedKey]=value[3]}}}definition.inputTransforms=inputTransforms}class NgModuleRef$1{}class NgModuleFactory$1{}function createNgModule(ngModule,parentInjector){return new NgModuleRef(ngModule,parentInjector??null,[])}const createNgModuleRef=createNgModule;class NgModuleRef extends NgModuleRef$1{constructor(ngModuleType,_parent,additionalProviders){super();this._parent=_parent;this._bootstrapComponents=[];this.destroyCbs=[];this.componentFactoryResolver=new ComponentFactoryResolver(this);const ngModuleDef=getNgModuleDef(ngModuleType);ngDevMode&&assertDefined(ngModuleDef,`NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`);this._bootstrapComponents=maybeUnwrapFn(ngModuleDef.bootstrap);this._r3Injector=createInjectorWithoutInjectorInstances(ngModuleType,_parent,[{provide:NgModuleRef$1,useValue:this},{provide:ComponentFactoryResolver$1,useValue:this.componentFactoryResolver},...additionalProviders],stringify(ngModuleType),new Set(["environment"]));this._r3Injector.resolveInjectorInitializers();this.instance=this._r3Injector.get(ngModuleType)}get injector(){return this._r3Injector}destroy(){ngDevMode&&assertDefined(this.destroyCbs,"NgModule already destroyed");const injector=this._r3Injector;!injector.destroyed&&injector.destroy();this.destroyCbs.forEach((fn=>fn()));this.destroyCbs=null}onDestroy(callback){ngDevMode&&assertDefined(this.destroyCbs,"NgModule already destroyed");this.destroyCbs.push(callback)}}class NgModuleFactory extends NgModuleFactory$1{constructor(moduleType){super();this.moduleType=moduleType}create(parentInjector){return new NgModuleRef(this.moduleType,parentInjector,[])}}function createNgModuleRefWithProviders(moduleType,parentInjector,additionalProviders){return new NgModuleRef(moduleType,parentInjector,additionalProviders)}class EnvironmentNgModuleRefAdapter extends NgModuleRef$1{constructor(config){super();this.componentFactoryResolver=new ComponentFactoryResolver(this);this.instance=null;const injector=new R3Injector([...config.providers,{provide:NgModuleRef$1,useValue:this},{provide:ComponentFactoryResolver$1,useValue:this.componentFactoryResolver}],config.parent||getNullInjector(),config.debugName,new Set(["environment"]));this.injector=injector;if(config.runEnvironmentInitializers){injector.resolveInjectorInitializers()}}destroy(){this.injector.destroy()}onDestroy(callback){this.injector.onDestroy(callback)}}function createEnvironmentInjector(providers,parent,debugName=null){const adapter=new EnvironmentNgModuleRefAdapter({providers:providers,parent:parent,debugName:debugName,runEnvironmentInitializers:true});return adapter.injector}class CachedInjectorService{constructor(){this.cachedInjectors=new Map}getOrCreateInjector(key,parentInjector,providers,debugName){if(!this.cachedInjectors.has(key)){const injector=providers.length>0?createEnvironmentInjector(providers,parentInjector,debugName):null;this.cachedInjectors.set(key,injector)}return this.cachedInjectors.get(key)}ngOnDestroy(){try{for(const injector of this.cachedInjectors.values()){if(injector!==null){injector.destroy()}}}finally{this.cachedInjectors.clear()}}static{this.\u0275prov=\u0275\u0275defineInjectable({token:CachedInjectorService,providedIn:"environment",factory:()=>new CachedInjectorService})}}const ASYNC_COMPONENT_METADATA_FN="__ngAsyncComponentMetadataFn__";function getAsyncClassMetadataFn(type){const componentClass=type;return componentClass[ASYNC_COMPONENT_METADATA_FN]??null}function setClassMetadataAsync(type,dependencyLoaderFn,metadataSetterFn){const componentClass=type;componentClass[ASYNC_COMPONENT_METADATA_FN]=()=>Promise.all(dependencyLoaderFn()).then((dependencies=>{metadataSetterFn(...dependencies);componentClass[ASYNC_COMPONENT_METADATA_FN]=null;return dependencies}));return componentClass[ASYNC_COMPONENT_METADATA_FN]}function setClassMetadata(type,decorators,ctorParameters,propDecorators){return noSideEffects((()=>{const clazz=type;if(decorators!==null){if(clazz.hasOwnProperty("decorators")&&clazz.decorators!==undefined){clazz.decorators.push(...decorators)}else{clazz.decorators=decorators}}if(ctorParameters!==null){clazz.ctorParameters=ctorParameters}if(propDecorators!==null){if(clazz.hasOwnProperty("propDecorators")&&clazz.propDecorators!==undefined){clazz.propDecorators={...clazz.propDecorators,...propDecorators}}else{clazz.propDecorators=propDecorators}}}))}class PendingTasks{constructor(){this.taskId=0;this.pendingTasks=new Set;this.hasPendingTasks=new rxjs.BehaviorSubject(false)}get _hasPendingTasks(){return this.hasPendingTasks.value}add(){if(!this._hasPendingTasks){this.hasPendingTasks.next(true)}const taskId=this.taskId++;this.pendingTasks.add(taskId);return taskId}remove(taskId){this.pendingTasks.delete(taskId);if(this.pendingTasks.size===0&&this._hasPendingTasks){this.hasPendingTasks.next(false)}}ngOnDestroy(){this.pendingTasks.clear();if(this._hasPendingTasks){this.hasPendingTasks.next(false)}}static{this.\u0275fac=function PendingTasks_Factory(t){return new(t||PendingTasks)}}static{this.\u0275prov=\u0275\u0275defineInjectable({token:PendingTasks,factory:PendingTasks.\u0275fac,providedIn:"root"})}}(()=>{(typeof ngDevMode==="undefined"||ngDevMode)&&setClassMetadata(PendingTasks,[{type:Injectable,args:[{providedIn:"root"}]}],null,null)})();function isListLikeIterable(obj){if(!isJsObject(obj))return false;return Array.isArray(obj)||!(obj instanceof Map)&&Symbol.iterator in obj}function areIterablesEqual(a,b,comparator){const iterator1=a[Symbol.iterator]();const iterator2=b[Symbol.iterator]();while(true){const item1=iterator1.next();const item2=iterator2.next();if(item1.done&&item2.done)return true;if(item1.done||item2.done)return false;if(!comparator(item1.value,item2.value))return false}}function iterateListLike(obj,fn){if(Array.isArray(obj)){for(let i=0;i<obj.length;i++){fn(obj[i])}}else{const iterator=obj[Symbol.iterator]();let item;while(!(item=iterator.next()).done){fn(item.value)}}}function isJsObject(o){return o!==null&&(typeof o==="function"||typeof o==="object")}function devModeEqual(a,b){const isListLikeIterableA=isListLikeIterable(a);const isListLikeIterableB=isListLikeIterable(b);if(isListLikeIterableA&&isListLikeIterableB){return areIterablesEqual(a,b,devModeEqual)}else{const isAObject=a&&(typeof a==="object"||typeof a==="function");const isBObject=b&&(typeof b==="object"||typeof b==="function");if(!isListLikeIterableA&&isAObject&&!isListLikeIterableB&&isBObject){return true}else{return Object.is(a,b)}}}function updateBinding(lView,bindingIndex,value){return lView[bindingIndex]=value}function getBinding(lView,bindingIndex){ngDevMode&&assertIndexInRange(lView,bindingIndex);ngDevMode&&assertNotSame(lView[bindingIndex],NO_CHANGE,"Stored value should never be NO_CHANGE.");return lView[bindingIndex]}function bindingUpdated(lView,bindingIndex,value){ngDevMode&&assertNotSame(value,NO_CHANGE,"Incoming value should never be NO_CHANGE.");ngDevMode&&assertLessThan(bindingIndex,lView.length,`Slot should have been initialized to NO_CHANGE`);const oldValue=lView[bindingIndex];if(Object.is(oldValue,value)){return false}else{if(ngDevMode&&isInCheckNoChangesMode()){const oldValueToCompare=oldValue!==NO_CHANGE?oldValue:undefined;if(!devModeEqual(oldValueToCompare,value)){const details=getExpressionChangedErrorDetails(lView,bindingIndex,oldValueToCompare,value);throwErrorIfNoChangesMode(oldValue===NO_CHANGE,details.oldValue,details.newValue,details.propName,lView)}return false}lView[bindingIndex]=value;return true}}function bindingUpdated2(lView,bindingIndex,exp1,exp2){const different=bindingUpdated(lView,bindingIndex,exp1);return bindingUpdated(lView,bindingIndex+1,exp2)||different}function bindingUpdated3(lView,bindingIndex,exp1,exp2,exp3){const different=bindingUpdated2(lView,bindingIndex,exp1,exp2);return bindingUpdated(lView,bindingIndex+2,exp3)||different}function bindingUpdated4(lView,bindingIndex,exp1,exp2,exp3,exp4){const different=bindingUpdated2(lView,bindingIndex,exp1,exp2);return bindingUpdated2(lView,bindingIndex+2,exp3,exp4)||different}function isDetachedByI18n(tNode){return(tNode.flags&32)===32}function templateFirstCreatePass(index,tView,lView,templateFn,decls,vars,tagName,attrsIndex,localRefsIndex){ngDevMode&&assertFirstCreatePass(tView);ngDevMode&&ngDevMode.firstCreatePass++;const tViewConsts=tView.consts;const tNode=getOrCreateTNode(tView,index,4,tagName||null,getConstant(tViewConsts,attrsIndex));resolveDirectives(tView,lView,tNode,getConstant(tViewConsts,localRefsIndex));registerPostOrderHooks(tView,tNode);const embeddedTView=tNode.tView=createTView(2,tNode,templateFn,decls,vars,tView.directiveRegistry,tView.pipeRegistry,null,tView.schemas,tViewConsts,null);if(tView.queries!==null){tView.queries.template(tView,tNode);embeddedTView.queries=tView.queries.embeddedTView(tNode)}return tNode}function \u0275\u0275template(index,templateFn,decls,vars,tagName,attrsIndex,localRefsIndex,localRefExtractor){const lView=getLView();const tView=getTView();const adjustedIndex=index+HEADER_OFFSET;const tNode=tView.firstCreatePass?templateFirstCreatePass(adjustedIndex,tView,lView,templateFn,decls,vars,tagName,attrsIndex,localRefsIndex):tView.data[adjustedIndex];setCurrentTNode(tNode,false);const comment=_locateOrCreateContainerAnchor(tView,lView,tNode,index);if(wasLastNodeCreated()){appendChild(tView,lView,comment,tNode)}attachPatchData(comment,lView);const lContainer=createLContainer(comment,lView,comment,tNode);lView[adjustedIndex]=lContainer;addToViewTree(lView,lContainer);populateDehydratedViewsInLContainer(lContainer,tNode,lView);if(isDirectiveHost(tNode)){createDirectivesInstances(tView,lView,tNode)}if(localRefsIndex!=null){saveResolvedLocalsInData(lView,tNode,localRefExtractor)}return \u0275\u0275template}let _locateOrCreateContainerAnchor=createContainerAnchorImpl;function createContainerAnchorImpl(tView,lView,tNode,index){lastNodeWasCreated(true);return lView[RENDERER].createComment(ngDevMode?"container":"")}function locateOrCreateContainerAnchorImpl(tView,lView,tNode,index){const hydrationInfo=lView[HYDRATION];const isNodeCreationMode=!hydrationInfo||isInSkipHydrationBlock$1()||isDetachedByI18n(tNode)||isDisconnectedNode$1(hydrationInfo,index);lastNodeWasCreated(isNodeCreationMode);if(isNodeCreationMode){return createContainerAnchorImpl(tView,lView)}const ssrId=hydrationInfo.data[TEMPLATES]?.[index]??null;if(ssrId!==null&&tNode.tView!==null){if(tNode.tView.ssrId===null){tNode.tView.ssrId=ssrId}else{ngDevMode&&assertEqual(tNode.tView.ssrId,ssrId,"Unexpected value of the `ssrId` for this TView")}}const currentRNode=locateNextRNode(hydrationInfo,tView,lView,tNode);ngDevMode&&validateNodeExists(currentRNode,lView,tNode);setSegmentHead(hydrationInfo,index,currentRNode);const viewContainerSize=calcSerializedContainerSize(hydrationInfo,index);const comment=siblingAfter(viewContainerSize,currentRNode);if(ngDevMode){validateMatchingNode(comment,Node.COMMENT_NODE,null,lView,tNode);markRNodeAsClaimedByHydration(comment)}return comment}function enableLocateOrCreateContainerAnchorImpl(){_locateOrCreateContainerAnchor=locateOrCreateContainerAnchorImpl}var DeferDependenciesLoadingState;(function(DeferDependenciesLoadingState){DeferDependenciesLoadingState[DeferDependenciesLoadingState["NOT_STARTED"]=0]="NOT_STARTED";DeferDependenciesLoadingState[DeferDependenciesLoadingState["IN_PROGRESS"]=1]="IN_PROGRESS";DeferDependenciesLoadingState[DeferDependenciesLoadingState["COMPLETE"]=2]="COMPLETE";DeferDependenciesLoadingState[DeferDependenciesLoadingState["FAILED"]=3]="FAILED"})(DeferDependenciesLoadingState||(DeferDependenciesLoadingState={}));const MINIMUM_SLOT=0;const LOADING_AFTER_SLOT=1;exports.\u0275DeferBlockState=void 0;(function(DeferBlockState){DeferBlockState[DeferBlockState["Placeholder"]=0]="Placeholder";DeferBlockState[DeferBlockState["Loading"]=1]="Loading";DeferBlockState[DeferBlockState["Complete"]=2]="Complete";DeferBlockState[DeferBlockState["Error"]=3]="Error"})(exports.\u0275DeferBlockState||(exports.\u0275DeferBlockState={}));var DeferBlockInternalState;(function(DeferBlockInternalState){DeferBlockInternalState[DeferBlockInternalState["Initial"]=-1]="Initial"})(DeferBlockInternalState||(DeferBlockInternalState={}));const NEXT_DEFER_BLOCK_STATE=0;const DEFER_BLOCK_STATE=1;const STATE_IS_FROZEN_UNTIL=2;const LOADING_AFTER_CLEANUP_FN=3;const TRIGGER_CLEANUP_FNS=4;const PREFETCH_TRIGGER_CLEANUP_FNS=5;exports.\u0275DeferBlockBehavior=void 0;(function(DeferBlockBehavior){DeferBlockBehavior[DeferBlockBehavior["Manual"]=0]="Manual";DeferBlockBehavior[DeferBlockBehavior["Playthrough"]=1]="Playthrough"})(exports.\u0275DeferBlockBehavior||(exports.\u0275DeferBlockBehavior={}));
|
|
464
464
|
/*!
|
|
465
465
|
* @license
|
|
466
466
|
* Copyright Google LLC All Rights Reserved.
|