!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e.prettierPlugins=e.prettierPlugins||{},e.prettierPlugins.html=t())}(this,function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;ne.sourceSpan.end.line:"root"===e.parent.type||e.parent.endSourceSpan.start.line>e.sourceSpan.end.line)}function lt(e){switch(e.type){case"ieConditionalComment":case"comment":case"directive":return!0;case"element":return-1!==["script","select"].indexOf(e.name)}return!1}function ut(e){return"block"===e||"list-item"===e||e.startsWith("table")}function ht(e){return pt(e).startsWith("pre")}function pt(e){return"element"===e.type&&!e.namespace&&We[e.name]||Qe}var dt={HTML_ELEMENT_ATTRIBUTES:function(e,t){for(var n=Object.create(null),i=Object.keys(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:function(){return!0},i=0,r=t.stack.length-1;r>=0;r--){var o=t.stack[r];o&&"object"===e(o)&&!Array.isArray(o)&&n(o)&&i++}return i},dedentString:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){var t=1/0,n=!0,i=!1,r=void 0;try{for(var o,a=e.split("\n")[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;if(0!==s.length){if(/\S/.test(s[0]))return 0;var c=s.match(/^\s*/)[0].length;s.length!==c&&c/.test(e)};var mt=function(e,t){var n=new SyntaxError(e+" ("+t.start.line+":"+t.start.column+")");return n.loc=t,n},_t={attrs:!0,children:!0},vt=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t(this,e);for(var i=Object.keys(n),r=0;r)([\s\S]*?)",harr:"↔",hArr:"⇔",hearts:"♥",hellip:"…",Iacute:"Í",iacute:"í",Icirc:"Î",icirc:"î",iexcl:"¡",Igrave:"Ì",igrave:"ì",image:"ℑ",infin:"∞",int:"∫",Iota:"Ι",iota:"ι",iquest:"¿",isin:"∈",Iuml:"Ï",iuml:"ï",Kappa:"Κ",kappa:"κ",Lambda:"Λ",lambda:"λ",lang:"⟨",laquo:"«",larr:"←",lArr:"⇐",lceil:"⌈",ldquo:"“",le:"≤",lfloor:"⌊",lowast:"∗",loz:"◊",lrm:"‎",lsaquo:"‹",lsquo:"‘",lt:"<",macr:"¯",mdash:"—",micro:"µ",middot:"·",minus:"−",Mu:"Μ",mu:"μ",nabla:"∇",nbsp:" ",ndash:"–",ne:"≠",ni:"∋",not:"¬",notin:"∉",nsub:"⊄",Ntilde:"Ñ",ntilde:"ñ",Nu:"Ν",nu:"ν",Oacute:"Ó",oacute:"ó",Ocirc:"Ô",ocirc:"ô",OElig:"Œ",oelig:"œ",Ograve:"Ò",ograve:"ò",oline:"‾",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",oplus:"⊕",or:"∨",ordf:"ª",ordm:"º",Oslash:"Ø",oslash:"ø",Otilde:"Õ",otilde:"õ",otimes:"⊗",Ouml:"Ö",ouml:"ö",para:"¶",permil:"‰",perp:"⊥",Phi:"Φ",phi:"φ",Pi:"Π",pi:"π",piv:"ϖ",plusmn:"±",pound:"£",prime:"′",Prime:"″",prod:"∏",prop:"∝",Psi:"Ψ",psi:"ψ",quot:'"',radic:"√",rang:"⟩",raquo:"»",rarr:"→",rArr:"⇒",rceil:"⌉",rdquo:"”",real:"ℜ",reg:"®",rfloor:"⌋",Rho:"Ρ",rho:"ρ",rlm:"‏",rsaquo:"›",rsquo:"’",sbquo:"‚",Scaron:"Š",scaron:"š",sdot:"⋅",sect:"§",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sim:"∼",spades:"♠",sub:"⊂",sube:"⊆",sum:"∑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supe:"⊇",szlig:"ß",Tau:"Τ",tau:"τ",there4:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thinsp:" ",THORN:"Þ",thorn:"þ",tilde:"˜",times:"×",trade:"™",Uacute:"Ú",uacute:"ú",uarr:"↑",uArr:"⇑",Ucirc:"Û",ucirc:"û",Ugrave:"Ù",ugrave:"ù",uml:"¨",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",Uuml:"Ü",uuml:"ü",weierp:"℘",Xi:"Ξ",xi:"ξ",Yacute:"Ý",yacute:"ý",yen:"¥",yuml:"ÿ",Yuml:"Ÿ",Zeta:"Ζ",zeta:"ζ",zwj:"‍",zwnj:"‌"},t.NGSP_UNICODE="",t.NAMED_ENTITIES.ngsp=t.NGSP_UNICODE});kt(bt);var At=Et(function(e,n){Object.defineProperty(n,"__esModule",{value:!0});var r,o,a=function(){function e(){var n=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=i.closedByChildren,o=i.requiredParents,a=i.implicitNamespacePrefix,s=i.contentType,c=void 0===s?bt.TagContentType.PARSABLE_DATA:s,l=i.closedByParent,u=void 0!==l&&l,h=i.isVoid,p=void 0!==h&&h,d=i.ignoreFirstLf,f=void 0!==d&&d;t(this,e),this.closedByChildren={},this.closedByParent=!1,this.canSelfClose=!1,r&&r.length>0&&r.forEach(function(e){return n.closedByChildren[e]=!0}),this.isVoid=p,this.closedByParent=u||p,o&&o.length>0&&(this.requiredParents={},this.parentToAdd=o[0],o.forEach(function(e){return n.requiredParents[e]=!0})),this.implicitNamespacePrefix=a||null,this.contentType=c,this.ignoreFirstLf=f}return i(e,[{key:"requireExtraParent",value:function(e){if(!this.requiredParents)return!1;if(!e)return!0;var t=e.toLowerCase();return!("template"===t||"ng-template"===e)&&1!=this.requiredParents[t]}},{key:"isClosedByChild",value:function(e){return this.isVoid||e.toLowerCase()in this.closedByChildren}}]),e}();n.HtmlTagDefinition=a,n.getHtmlTagDefinition=function(e){return o||(r=new a,o={base:new a({isVoid:!0}),meta:new a({isVoid:!0}),area:new a({isVoid:!0}),embed:new a({isVoid:!0}),link:new a({isVoid:!0}),img:new a({isVoid:!0}),input:new a({isVoid:!0}),param:new a({isVoid:!0}),hr:new a({isVoid:!0}),br:new a({isVoid:!0}),source:new a({isVoid:!0}),track:new a({isVoid:!0}),wbr:new a({isVoid:!0}),p:new a({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:!0}),thead:new a({closedByChildren:["tbody","tfoot"]}),tbody:new a({closedByChildren:["tbody","tfoot"],closedByParent:!0}),tfoot:new a({closedByChildren:["tbody"],closedByParent:!0}),tr:new a({closedByChildren:["tr"],requiredParents:["tbody","tfoot","thead"],closedByParent:!0}),td:new a({closedByChildren:["td","th"],closedByParent:!0}),th:new a({closedByChildren:["td","th"],closedByParent:!0}),col:new a({requiredParents:["colgroup"],isVoid:!0}),svg:new a({implicitNamespacePrefix:"svg"}),math:new a({implicitNamespacePrefix:"math"}),li:new a({closedByChildren:["li"],closedByParent:!0}),dt:new a({closedByChildren:["dt","dd"]}),dd:new a({closedByChildren:["dt","dd"],closedByParent:!0}),rb:new a({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rt:new a({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rtc:new a({closedByChildren:["rb","rtc","rp"],closedByParent:!0}),rp:new a({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),optgroup:new a({closedByChildren:["optgroup"],closedByParent:!0}),option:new a({closedByChildren:["option","optgroup"],closedByParent:!0}),pre:new a({ignoreFirstLf:!0}),listing:new a({ignoreFirstLf:!0}),style:new a({contentType:bt.TagContentType.RAW_TEXT}),script:new a({contentType:bt.TagContentType.RAW_TEXT}),title:new a({contentType:bt.TagContentType.ESCAPABLE_RAW_TEXT}),textarea:new a({contentType:bt.TagContentType.ESCAPABLE_RAW_TEXT,ignoreFirstLf:!0})}),o[e]||r}});kt(At);var Pt=Et(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.assertArrayOfStrings=function(e,t){if(null!=t){if(!Array.isArray(t))throw new Error("Expected '".concat(e,"' to be an array of strings."));for(var n=0;n]/,/^[{}]$/,/&(#|[a-z])/i,/^\/\//];t.assertInterpolationSymbols=function(e,t){if(!(null==t||Array.isArray(t)&&2==t.length))throw new Error("Expected '".concat(e,"' to be an array, [start, end]."));if(null!=t){var i=t[0],r=t[1];n.forEach(function(e){if(e.test(i)||e.test(r))throw new Error("['".concat(i,"', '").concat(r,"'] contains unusable interpolation symbol."))})}}});kt(Pt);var Nt=Et(function(e,n){Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(n,i){t(this,e),this.start=n,this.end=i}return i(e,null,[{key:"fromArray",value:function(t){return t?(Pt.assertInterpolationSymbols("interpolation",t),new e(t[0],t[1])):n.DEFAULT_INTERPOLATION_CONFIG}}]),e}();n.InterpolationConfig=r,n.DEFAULT_INTERPOLATION_CONFIG=new r("{{","}}")});kt(Nt);var xt=Et(function(e,t){function n(e){return t.$0<=e&&e<=t.$9}Object.defineProperty(t,"__esModule",{value:!0}),t.$EOF=0,t.$TAB=9,t.$LF=10,t.$VTAB=11,t.$FF=12,t.$CR=13,t.$SPACE=32,t.$BANG=33,t.$DQ=34,t.$HASH=35,t.$$=36,t.$PERCENT=37,t.$AMPERSAND=38,t.$SQ=39,t.$LPAREN=40,t.$RPAREN=41,t.$STAR=42,t.$PLUS=43,t.$COMMA=44,t.$MINUS=45,t.$PERIOD=46,t.$SLASH=47,t.$COLON=58,t.$SEMICOLON=59,t.$LT=60,t.$EQ=61,t.$GT=62,t.$QUESTION=63,t.$0=48,t.$9=57,t.$A=65,t.$E=69,t.$F=70,t.$X=88,t.$Z=90,t.$LBRACKET=91,t.$BACKSLASH=92,t.$RBRACKET=93,t.$CARET=94,t.$_=95,t.$a=97,t.$e=101,t.$f=102,t.$n=110,t.$r=114,t.$t=116,t.$u=117,t.$v=118,t.$x=120,t.$z=122,t.$LBRACE=123,t.$BAR=124,t.$RBRACE=125,t.$NBSP=160,t.$PIPE=124,t.$TILDA=126,t.$AT=64,t.$BT=96,t.isWhitespace=function(e){return e>=t.$TAB&&e<=t.$SPACE||e==t.$NBSP},t.isDigit=n,t.isAsciiLetter=function(e){return e>=t.$a&&e<=t.$z||e>=t.$A&&e<=t.$Z},t.isAsciiHexDigit=function(e){return e>=t.$a&&e<=t.$f||e>=t.$A&&e<=t.$F||n(e)}});kt(xt);var wt=Et(function(e,n){Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(n,i,r){t(this,e),this.filePath=n,this.name=i,this.members=r}return i(e,[{key:"assertNoMembers",value:function(){if(this.members.length)throw new Error("Illegal state: symbol without members expected, but got ".concat(JSON.stringify(this),"."))}}]),e}();n.StaticSymbol=r;var o=function(){function e(){t(this,e),this.cache=new Map}return i(e,[{key:"get",value:function(e,t,n){var i=(n=n||[]).length?".".concat(n.join(".")):"",o='"'.concat(e,'".').concat(t).concat(i),a=this.cache.get(o);return a||(a=new r(e,t,n),this.cache.set(o,a)),a}}]),e}();n.StaticSymbolCache=o});kt(wt);var Ot=Et(function(n,r){Object.defineProperty(r,"__esModule",{value:!0});var o=/-+([a-z0-9])/g;function a(e,t,n){var i=e.indexOf(t);return-1==i?n:[e.slice(0,i).trim(),e.slice(i+1).trim()]}function s(t,n,i){return Array.isArray(t)?n.visitArray(t,i):"object"===e(r=t)&&null!==r&&Object.getPrototypeOf(r)===h?n.visitStringMap(t,i):null==t||"string"==typeof t||"number"==typeof t||"boolean"==typeof t?n.visitPrimitive(t,i):n.visitOther(t,i);var r}r.dashCaseToCamelCase=function(e){return e.replace(o,function(){for(var e=arguments.length,t=new Array(e),n=0;n=55296&&i<=56319&&e.length>n+1){var r=e.charCodeAt(n+1);r>=56320&&r<=57343&&(n++,i=(i-55296<<10)+r-56320+65536)}i<=127?t+=String.fromCharCode(i):i<=2047?t+=String.fromCharCode(i>>6&31|192,63&i|128):i<=65535?t+=String.fromCharCode(i>>12|224,i>>6&63|128,63&i|128):i<=2097151&&(t+=String.fromCharCode(i>>18&7|240,i>>12&63|128,i>>6&63|128,63&i|128))}return t},r.stringify=function e(t){if("string"==typeof t)return t;if(t instanceof Array)return"["+t.map(e).join(", ")+"]";if(null==t)return""+t;if(t.overriddenName)return"".concat(t.overriddenName);if(t.name)return"".concat(t.name);var n=t.toString();if(null==n)return""+n;var i=n.indexOf("\n");return-1===i?n:n.substring(0,i)},r.resolveForwardRef=function(e){return"function"==typeof e&&e.hasOwnProperty("__forward_ref__")?e():e},r.isPromise=p;r.Version=function e(n){t(this,e),this.full=n;var i=n.split(".");this.major=i[0],this.minor=i[1],this.patch=i.slice(2).join(".")}});kt(Ot);var Rt=Et(function(e,n){Object.defineProperty(n,"__esModule",{value:!0});var r=/^(?:(?:\[([^\]]+)\])|(?:\(([^\)]+)\)))|(\@[-\w]+)$/;function o(e){return e.replace(/\W/g,"_")}n.sanitizeIdentifier=o;var a,s=0;function c(e){if(!e||!e.reference)return null;var t=e.reference;if(t instanceof wt.StaticSymbol)return t.name;if(t.__anonymousType)return t.__anonymousType;var n=Ot.stringify(t);return n.indexOf("(")>=0?(n="anonymous_".concat(s++),t.__anonymousType=n):n=o(n),n}n.identifierName=c,n.identifierModuleUrl=function(e){var t=e.reference;return t instanceof wt.StaticSymbol?t.filePath:"./".concat(Ot.stringify(t))},n.viewClassName=function(e,t){return"View_".concat(c({reference:e}),"_").concat(t)},n.rendererTypeName=function(e){return"RenderType_".concat(c({reference:e}))},n.hostViewClassName=function(e){return"HostView_".concat(c({reference:e}))},n.componentFactoryName=function(e){return"".concat(c({reference:e}),"NgFactory")},function(e){e[e.Pipe=0]="Pipe",e[e.Directive=1]="Directive",e[e.NgModule=2]="NgModule",e[e.Injectable=3]="Injectable"}(a=n.CompileSummaryKind||(n.CompileSummaryKind={})),n.tokenName=function(e){return null!=e.value?o(e.value):c(e.identifier)},n.tokenReference=function(e){return null!=e.identifier?e.identifier.reference:e.value};n.CompileStylesheetMetadata=function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.moduleUrl,r=n.styles,o=n.styleUrls;t(this,e),this.moduleUrl=i||null,this.styles=f(r),this.styleUrls=f(o)};var l=function(){function e(n){var i=n.encapsulation,r=n.template,o=n.templateUrl,a=n.htmlAst,s=n.styles,c=n.styleUrls,l=n.externalStylesheets,u=n.animations,h=n.ngContentSelectors,p=n.interpolation,d=n.isInline,_=n.preserveWhitespaces;if(t(this,e),this.encapsulation=i,this.template=r,this.templateUrl=o,this.htmlAst=a,this.styles=f(s),this.styleUrls=f(c),this.externalStylesheets=f(l),this.animations=u?m(u):[],this.ngContentSelectors=h||[],p&&2!=p.length)throw new Error("'interpolation' should have a start and an end symbol.");this.interpolation=p,this.isInline=d,this.preserveWhitespaces=_}return i(e,[{key:"toSummary",value:function(){return{ngContentSelectors:this.ngContentSelectors,encapsulation:this.encapsulation,styles:this.styles,animations:this.animations}}}]),e}();n.CompileTemplateMetadata=l;var u=function(){function e(n){var i=n.isHost,r=n.type,o=n.isComponent,a=n.selector,s=n.exportAs,c=n.changeDetection,l=n.inputs,u=n.outputs,h=n.hostListeners,p=n.hostProperties,d=n.hostAttributes,m=n.providers,_=n.viewProviders,v=n.queries,g=n.guards,y=n.viewQueries,T=n.entryComponents,S=n.template,C=n.componentViewType,k=n.rendererType,E=n.componentFactory;t(this,e),this.isHost=!!i,this.type=r,this.isComponent=o,this.selector=a,this.exportAs=s,this.changeDetection=c,this.inputs=l,this.outputs=u,this.hostListeners=h,this.hostProperties=p,this.hostAttributes=d,this.providers=f(m),this.viewProviders=f(_),this.queries=f(v),this.guards=g,this.viewQueries=f(y),this.entryComponents=f(T),this.template=S,this.componentViewType=C,this.rendererType=k,this.componentFactory=E}return i(e,null,[{key:"create",value:function(t){var n=t.isHost,i=t.type,o=t.isComponent,a=t.selector,s=t.exportAs,c=t.changeDetection,l=t.inputs,u=t.outputs,h=t.host,p=t.providers,d=t.viewProviders,f=t.queries,m=t.guards,_=t.viewQueries,v=t.entryComponents,g=t.template,y=t.componentViewType,T=t.rendererType,S=t.componentFactory,C={},k={},E={};null!=h&&Object.keys(h).forEach(function(e){var t=h[e],n=e.match(r);null===n?E[e]=t:null!=n[1]?k[n[1]]=t:null!=n[2]&&(C[n[2]]=t)});var b={};null!=l&&l.forEach(function(e){var t=Ot.splitAtColon(e,[e,e]);b[t[0]]=t[1]});var A={};return null!=u&&u.forEach(function(e){var t=Ot.splitAtColon(e,[e,e]);A[t[0]]=t[1]}),new e({isHost:n,type:i,isComponent:!!o,selector:a,exportAs:s,changeDetection:c,inputs:b,outputs:A,hostListeners:C,hostProperties:k,hostAttributes:E,providers:p,viewProviders:d,queries:f,guards:m,viewQueries:_,entryComponents:v,template:g,componentViewType:y,rendererType:T,componentFactory:S})}}]),i(e,[{key:"toSummary",value:function(){return{summaryKind:a.Directive,type:this.type,isComponent:this.isComponent,selector:this.selector,exportAs:this.exportAs,inputs:this.inputs,outputs:this.outputs,hostListeners:this.hostListeners,hostProperties:this.hostProperties,hostAttributes:this.hostAttributes,providers:this.providers,viewProviders:this.viewProviders,queries:this.queries,guards:this.guards,viewQueries:this.viewQueries,entryComponents:this.entryComponents,changeDetection:this.changeDetection,template:this.template&&this.template.toSummary(),componentViewType:this.componentViewType,rendererType:this.rendererType,componentFactory:this.componentFactory}}}]),e}();n.CompileDirectiveMetadata=u;var h=function(){function e(n){var i=n.type,r=n.name,o=n.pure;t(this,e),this.type=i,this.name=r,this.pure=!!o}return i(e,[{key:"toSummary",value:function(){return{summaryKind:a.Pipe,type:this.type,name:this.name,pure:this.pure}}}]),e}();n.CompilePipeMetadata=h;n.CompileShallowModuleMetadata=function e(){t(this,e)};var p=function(){function e(n){var i=n.type,r=n.providers,o=n.declaredDirectives,a=n.exportedDirectives,s=n.declaredPipes,c=n.exportedPipes,l=n.entryComponents,u=n.bootstrapComponents,h=n.importedModules,p=n.exportedModules,d=n.schemas,m=n.transitiveModule,_=n.id;t(this,e),this.type=i||null,this.declaredDirectives=f(o),this.exportedDirectives=f(a),this.declaredPipes=f(s),this.exportedPipes=f(c),this.providers=f(r),this.entryComponents=f(l),this.bootstrapComponents=f(u),this.importedModules=f(h),this.exportedModules=f(p),this.schemas=f(d),this.id=_||null,this.transitiveModule=m||null}return i(e,[{key:"toSummary",value:function(){var e=this.transitiveModule;return{summaryKind:a.NgModule,type:this.type,entryComponents:e.entryComponents,providers:e.providers,modules:e.modules,exportedDirectives:e.exportedDirectives,exportedPipes:e.exportedPipes}}}]),e}();n.CompileNgModuleMetadata=p;var d=function(){function e(){t(this,e),this.directivesSet=new Set,this.directives=[],this.exportedDirectivesSet=new Set,this.exportedDirectives=[],this.pipesSet=new Set,this.pipes=[],this.exportedPipesSet=new Set,this.exportedPipes=[],this.modulesSet=new Set,this.modules=[],this.entryComponentsSet=new Set,this.entryComponents=[],this.providers=[]}return i(e,[{key:"addProvider",value:function(e,t){this.providers.push({provider:e,module:t})}},{key:"addDirective",value:function(e){this.directivesSet.has(e.reference)||(this.directivesSet.add(e.reference),this.directives.push(e))}},{key:"addExportedDirective",value:function(e){this.exportedDirectivesSet.has(e.reference)||(this.exportedDirectivesSet.add(e.reference),this.exportedDirectives.push(e))}},{key:"addPipe",value:function(e){this.pipesSet.has(e.reference)||(this.pipesSet.add(e.reference),this.pipes.push(e))}},{key:"addExportedPipe",value:function(e){this.exportedPipesSet.has(e.reference)||(this.exportedPipesSet.add(e.reference),this.exportedPipes.push(e))}},{key:"addModule",value:function(e){this.modulesSet.has(e.reference)||(this.modulesSet.add(e.reference),this.modules.push(e))}},{key:"addEntryComponent",value:function(e){this.entryComponentsSet.has(e.componentType)||(this.entryComponentsSet.add(e.componentType),this.entryComponents.push(e))}}]),e}();function f(e){return e||[]}n.TransitiveCompileNgModuleMetadata=d;function m(e){return e.reduce(function(e,t){var n=Array.isArray(t)?m(t):t;return e.concat(n)},[])}function _(e){return e.replace(/(\w+:\/\/[\w:-]+)?(\/+)?/,"ng:///")}n.ProviderMeta=function e(n,i){var r=i.useClass,o=i.useValue,a=i.useExisting,s=i.useFactory,c=i.deps,l=i.multi;t(this,e),this.token=n,this.useClass=r||null,this.useValue=o,this.useExisting=a,this.useFactory=s||null,this.dependencies=c||null,this.multi=!!l},n.flatten=m,n.templateSourceUrl=function(e,t,n){var i;return i=n.isInline?t.type.reference instanceof wt.StaticSymbol?"".concat(t.type.reference.filePath,".").concat(t.type.reference.name,".html"):"".concat(c(e),"/").concat(c(t.type),".html"):n.templateUrl,t.type.reference instanceof wt.StaticSymbol?i:_(i)},n.sharedStylesheetJitUrl=function(e,t){var n=e.moduleUrl.split(/\/\\/g),i=n[n.length-1];return _("css/".concat(t).concat(i,".ngstyle.js"))},n.ngModuleJitUrl=function(e){return _("".concat(c(e.type),"/module.ngfactory.js"))},n.templateJitUrl=function(e,t){return _("".concat(c(e),"/").concat(c(t.type),".ngfactory.js"))}});kt(Rt);var $t=Et(function(e,n){Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(n,i,r,o){t(this,e),this.file=n,this.offset=i,this.line=r,this.col=o}return i(e,[{key:"toString",value:function(){return null!=this.offset?"".concat(this.file.url,"@").concat(this.line,":").concat(this.col):this.file.url}},{key:"moveBy",value:function(t){for(var n=this.file.content,i=n.length,r=this.offset,o=this.line,a=this.col;r>0&&t<0;){if(r--,t++,n.charCodeAt(r)==xt.$LF){o--;var s=n.substr(0,r-1).lastIndexOf(String.fromCharCode(xt.$LF));a=s>0?r-s:r}else a--}for(;r0;){var c=n.charCodeAt(r);r++,t--,c==xt.$LF?(o++,a=0):a++}return new e(this.file,r,o,a)}},{key:"getContext",value:function(e,t){var n=this.file.content,i=this.offset;if(null!=i){i>n.length-1&&(i=n.length-1);for(var r=i,o=0,a=0;o0&&(o++,"\n"!=n[--i]||++a!=t););for(o=0,a=0;o2&&void 0!==arguments[2]?arguments[2]:null;t(this,e),this.start=n,this.end=i,this.details=r}return i(e,[{key:"toString",value:function(){return this.start.file.content.substring(this.start.offset,this.end.offset)}}]),e}();n.ParseSourceSpan=s,function(e){e[e.WARNING=0]="WARNING",e[e.ERROR=1]="ERROR"}(a=n.ParseErrorLevel||(n.ParseErrorLevel={}));var c=function(){function e(n,i){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.ERROR;t(this,e),this.span=n,this.msg=i,this.level=r}return i(e,[{key:"contextualMessage",value:function(){var e=this.span.start.getContext(100,3);return e?"".concat(this.msg,' ("').concat(e.before,"[").concat(a[this.level]," ->]").concat(e.after,'")'):this.msg}},{key:"toString",value:function(){var e=this.span.details?", ".concat(this.span.details):"";return"".concat(this.contextualMessage(),": ").concat(this.span.start).concat(e)}}]),e}();n.ParseError=c,n.typeSourceSpan=function(e,t){var n=Rt.identifierModuleUrl(t),i=null!=n?"in ".concat(e," ").concat(Rt.identifierName(t)," in ").concat(n):"in ".concat(e," ").concat(Rt.identifierName(t)),a=new o("",i);return new s(new r(a,-1,-1,-1),new r(a,-1,-1,-1))}});kt($t);var Dt=Et(function(e,n){Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;t(this,e),this.path=n,this.position=i}return i(e,[{key:"parentOf",value:function(e){return e&&this.path[this.path.indexOf(e)-1]}},{key:"childOf",value:function(e){return this.path[this.path.indexOf(e)+1]}},{key:"first",value:function(e){for(var t=this.path.length-1;t>=0;t--){var n=this.path[t];if(n instanceof e)return n}}},{key:"push",value:function(e){this.path.push(e)}},{key:"pop",value:function(){return this.path.pop()}},{key:"empty",get:function(){return!this.path||!this.path.length}},{key:"head",get:function(){return this.path[0]}},{key:"tail",get:function(){return this.path[this.path.length-1]}}]),e}();n.AstPath=r});kt(Dt);var Lt=Et(function(e,n){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(n,i){t(this,e),this.value=n,this.sourceSpan=i}return i(e,[{key:"visit",value:function(e,t){return e.visitText(this,t)}}]),e}();n.Text=a;var c=function(){function e(n,i){t(this,e),this.value=n,this.sourceSpan=i}return i(e,[{key:"visit",value:function(e,t){return e.visitCdata(this,t)}}]),e}();n.CDATA=c;var l=function(){function e(n,i,r,o,a){t(this,e),this.switchValue=n,this.type=i,this.cases=r,this.sourceSpan=o,this.switchValueSourceSpan=a}return i(e,[{key:"visit",value:function(e,t){return e.visitExpansion(this,t)}}]),e}();n.Expansion=l;var u=function(){function e(n,i,r,o,a){t(this,e),this.value=n,this.expression=i,this.sourceSpan=r,this.valueSourceSpan=o,this.expSourceSpan=a}return i(e,[{key:"visit",value:function(e,t){return e.visitExpansionCase(this,t)}}]),e}();n.ExpansionCase=u;var h=function(){function e(n,i,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;t(this,e),this.name=n,this.value=i,this.sourceSpan=r,this.valueSpan=o,this.nameSpan=a}return i(e,[{key:"visit",value:function(e,t){return e.visitAttribute(this,t)}}]),e}();n.Attribute=h;var p=function(){function e(n,i,r,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null;t(this,e),this.name=n,this.attrs=i,this.children=r,this.sourceSpan=o,this.startSourceSpan=a,this.endSourceSpan=s,this.nameSpan=c}return i(e,[{key:"visit",value:function(e,t){return e.visitElement(this,t)}}]),e}();n.Element=p;var d=function(){function e(n,i){t(this,e),this.value=n,this.sourceSpan=i}return i(e,[{key:"visit",value:function(e,t){return e.visitComment(this,t)}}]),e}();n.Comment=d;var f=function(){function e(n,i){t(this,e),this.value=n,this.sourceSpan=i}return i(e,[{key:"visit",value:function(e,t){return e.visitDocType(this,t)}}]),e}();function m(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=[],r=e.visit?function(t){return e.visit(t,n)||t.visit(e,n)}:function(t){return t.visit(e,n)};return t.forEach(function(e){var t=r(e);t&&i.push(t)}),i}n.DocType=f,n.visitAll=m;var _=function(){function e(){t(this,e)}return i(e,[{key:"visitElement",value:function(e,t){this.visitChildren(t,function(t){t(e.attrs),t(e.children)})}},{key:"visitAttribute",value:function(e,t){}},{key:"visitText",value:function(e,t){}},{key:"visitCdata",value:function(e,t){}},{key:"visitComment",value:function(e,t){}},{key:"visitDocType",value:function(e,t){}},{key:"visitExpansion",value:function(e,t){return this.visitChildren(t,function(t){t(e.cases)})}},{key:"visitExpansionCase",value:function(e,t){}},{key:"visitChildren",value:function(e,t){var n=[],i=this;return t(function(t){t&&n.push(m(i,t,e))}),[].concat.apply([],n)}}]),e}();n.RecursiveVisitor=_,n.findNode=function(e,n){var a=[];return m(new(function(e){function c(){return t(this,c),s(this,o(c).apply(this,arguments))}return r(c,_),i(c,[{key:"visit",value:function(e,t){var i=function e(t){var n=t.sourceSpan.start.offset,i=t.sourceSpan.end.offset;return t instanceof p&&(t.endSourceSpan?i=t.endSourceSpan.end.offset:t.children&&t.children.length&&(i=e(t.children[t.children.length-1]).end)),{start:n,end:i}}(e);if(!(i.start<=n&&n3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Nt.DEFAULT_INTERPOLATION_CONFIG,o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return new m(new $t.ParseSourceFile(e,t),n,i,r,o,a).tokenize()};var h=/\r\n?/g;function p(e){var t=e===xt.$EOF?"EOF":String.fromCharCode(e);return'Unexpected character "'.concat(t,'"')}function d(e){return'Unknown entity "'.concat(e,'" - use the "&#;" or "&#x;" syntax')}var f=function e(n){t(this,e),this.error=n},m=function(){function e(n,i,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Nt.DEFAULT_INTERPOLATION_CONFIG,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5&&void 0!==arguments[5]&&arguments[5];t(this,e),this._file=n,this._getTagDefinition=i,this._tokenizeIcu=r,this._interpolationConfig=o,this.canSelfClose=a,this.allowHtmComponentClosingTags=s,this._peek=-1,this._nextPeek=-1,this._index=-1,this._line=0,this._column=-1,this._expansionCaseStack=[],this._inInterpolation=!1,this.tokens=[],this.errors=[],this._input=n.content,this._length=n.content.length,this._advance()}return i(e,[{key:"_processCarriageReturns",value:function(e){return e.replace(h,"\n")}},{key:"tokenize",value:function(){for(;this._peek!==xt.$EOF;){var e=this._getLocation();try{if(this._attemptCharCode(xt.$LT))if(this._attemptCharCode(xt.$BANG))this._attemptStr("[CDATA[")?this._consumeCdata(e):this._attemptStr("--")?this._consumeComment(e):this._attemptStrCaseInsensitive("doctype")?this._consumeDocType(e):this._consumeBogusComment(e);else if(this._attemptCharCode(xt.$SLASH))this._consumeTagClose(e);else{var t=this._savePosition();this._attemptCharCode(xt.$QUESTION)?(this._restorePosition(t),this._consumeBogusComment(e)):this._consumeTagOpen(e)}else this._tokenizeIcu&&this._tokenizeExpansionForm()||this._consumeText()}catch(e){if(!(e instanceof f))throw e;this.errors.push(e.error)}}return this._beginToken(a.EOF),this._endToken([]),new u(function(e){for(var t=[],n=void 0,i=0;i0&&void 0!==arguments[0]?arguments[0]:this._getLocation(),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getLocation();return new $t.ParseSourceSpan(e,t)}},{key:"_beginToken",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getLocation();this._currentTokenStart=t,this._currentTokenType=e}},{key:"_endToken",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getLocation(),n=new c(this._currentTokenType,e,new $t.ParseSourceSpan(this._currentTokenStart,t));return this.tokens.push(n),this._currentTokenStart=null,this._currentTokenType=null,n}},{key:"_createError",value:function(e,t){this._isInExpansionForm()&&(e+=' (Do you have an unescaped "{" in your template? Use "{{ \'{\' }}") to escape it.)');var n=new l(e,this._currentTokenType,t);return this._currentTokenStart=null,this._currentTokenType=null,new f(n)}},{key:"_advance",value:function(){if(this._index>=this._length)throw this._createError(p(xt.$EOF),this._getSpan());this._peek===xt.$LF?(this._line++,this._column=0):this._peek!==xt.$LF&&this._peek!==xt.$CR&&this._column++,this._index++,this._peek=this._index>=this._length?xt.$EOF:this._input.charCodeAt(this._index),this._nextPeek=this._index+1>=this._length?xt.$EOF:this._input.charCodeAt(this._index+1)}},{key:"_attemptCharCode",value:function(e){return this._peek===e&&(this._advance(),!0)}},{key:"_attemptCharCodeCaseInsensitive",value:function(e){return t=this._peek,n=e,S(t)==S(n)&&(this._advance(),!0);var t,n}},{key:"_requireCharCode",value:function(e){var t=this._getLocation();if(!this._attemptCharCode(e))throw this._createError(p(this._peek),this._getSpan(t,t))}},{key:"_attemptStr",value:function(e){var t=e.length;if(this._index+t>this._length)return!1;for(var n=this._savePosition(),i=0;ii.offset&&o.push(this._input.substring(i.offset,this._index));this._peek!==t;)o.push(this._readChar(e));return this._endToken([this._processCarriageReturns(o.join(""))],i)}},{key:"_consumeComment",value:function(e){var t=this;this._beginToken(a.COMMENT_START,e),this._endToken([]);var n=this._consumeRawText(!1,xt.$MINUS,function(){return t._attemptStr("->")});this._beginToken(a.COMMENT_END,n.sourceSpan.end),this._endToken([])}},{key:"_consumeBogusComment",value:function(e){this._beginToken(a.COMMENT_START,e),this._endToken([]);var t=this._consumeRawText(!1,xt.$GT,function(){return!0});this._beginToken(a.COMMENT_END,t.sourceSpan.end),this._endToken([])}},{key:"_consumeCdata",value:function(e){var t=this;this._beginToken(a.CDATA_START,e),this._endToken([]);var n=this._consumeRawText(!1,xt.$RBRACKET,function(){return t._attemptStr("]>")});this._beginToken(a.CDATA_END,n.sourceSpan.end),this._endToken([])}},{key:"_consumeDocType",value:function(e){this._beginToken(a.DOC_TYPE_START,e),this._endToken([]);var t=this._consumeRawText(!1,xt.$GT,function(){return!0});this._beginToken(a.DOC_TYPE_END,t.sourceSpan.end),this._endToken([])}},{key:"_consumePrefixAndName",value:function(){for(var e,t,n=this._index,i=null;this._peek!==xt.$COLON&&!(((e=this._peek)xt.$9));)this._advance();return this._peek===xt.$COLON?(this._advance(),i=this._input.substring(n,this._index-1),t=this._index):t=n,this._requireCharCodeUntilFn(v,this._index===t?1:0),[i,this._input.substring(t,this._index)]}},{key:"_consumeTagOpen",value:function(e){var t,n,i=this._savePosition();try{if(!xt.isAsciiLetter(this._peek))throw this._createError(p(this._peek),this._getSpan());var r=this._index;for(this._consumeTagOpenStart(e),n=(t=this._input.substring(r,this._index)).toLowerCase(),this._attemptCharCodeUntilFn(_);this._peek!==xt.$SLASH&&this._peek!==xt.$GT;)this._consumeAttributeName(),this._attemptCharCodeUntilFn(_),this._attemptCharCode(xt.$EQ)&&(this._attemptCharCodeUntilFn(_),this._consumeAttributeValue()),this._attemptCharCodeUntilFn(_);this._consumeTagOpenEnd()}catch(t){if(t instanceof f)return this._restorePosition(i),this._beginToken(a.TEXT,e),void this._endToken(["<"]);throw t}if(!this.canSelfClose||this.tokens[this.tokens.length-1].type!==a.TAG_OPEN_END_VOID){var o=this._getTagDefinition(t).contentType;o===bt.TagContentType.RAW_TEXT?this._consumeRawTextWithTagClose(n,!1):o===bt.TagContentType.ESCAPABLE_RAW_TEXT&&this._consumeRawTextWithTagClose(n,!0)}}},{key:"_consumeRawTextWithTagClose",value:function(e,t){var n=this,i=this._consumeRawText(t,xt.$LT,function(){return!!n._attemptCharCode(xt.$SLASH)&&(n._attemptCharCodeUntilFn(_),!!n._attemptStrCaseInsensitive(e)&&(n._attemptCharCodeUntilFn(_),n._attemptCharCode(xt.$GT)))});this._beginToken(a.TAG_CLOSE,i.sourceSpan.end),this._endToken([null,e])}},{key:"_consumeTagOpenStart",value:function(e){this._beginToken(a.TAG_OPEN_START,e);var t=this._consumePrefixAndName();this._endToken(t)}},{key:"_consumeAttributeName",value:function(){this._beginToken(a.ATTR_NAME);var e=this._consumePrefixAndName();this._endToken(e)}},{key:"_consumeAttributeValue",value:function(){var e;if(this._beginToken(a.ATTR_VALUE),this._peek===xt.$SQ||this._peek===xt.$DQ){var t=this._peek;this._advance();for(var n=[];this._peek!==t;)n.push(this._readChar(!0));e=n.join(""),this._advance()}else{var i=this._index;this._requireCharCodeUntilFn(v,1),e=this._input.substring(i,this._index)}this._endToken([this._processCarriageReturns(e)])}},{key:"_consumeTagOpenEnd",value:function(){var e=this._attemptCharCode(xt.$SLASH)?a.TAG_OPEN_END_VOID:a.TAG_OPEN_END;this._beginToken(e),this._requireCharCode(xt.$GT),this._endToken([])}},{key:"_consumeTagClose",value:function(e){if(this._beginToken(a.TAG_CLOSE,e),this._attemptCharCodeUntilFn(_),this.allowHtmComponentClosingTags&&this._attemptCharCode(xt.$SLASH))this._attemptCharCodeUntilFn(_),this._requireCharCode(xt.$GT),this._endToken([]);else{var t=this._consumePrefixAndName();this._attemptCharCodeUntilFn(_),this._requireCharCode(xt.$GT),this._endToken(t)}}},{key:"_consumeExpansionFormStart",value:function(){this._beginToken(a.EXPANSION_FORM_START,this._getLocation()),this._requireCharCode(xt.$LBRACE),this._endToken([]),this._expansionCaseStack.push(a.EXPANSION_FORM_START),this._beginToken(a.RAW_TEXT,this._getLocation());var e=this._readUntil(xt.$COMMA);this._endToken([e],this._getLocation()),this._requireCharCode(xt.$COMMA),this._attemptCharCodeUntilFn(_),this._beginToken(a.RAW_TEXT,this._getLocation());var t=this._readUntil(xt.$COMMA);this._endToken([t],this._getLocation()),this._requireCharCode(xt.$COMMA),this._attemptCharCodeUntilFn(_)}},{key:"_consumeExpansionCaseStart",value:function(){this._beginToken(a.EXPANSION_CASE_VALUE,this._getLocation());var e=this._readUntil(xt.$LBRACE).trim();this._endToken([e],this._getLocation()),this._attemptCharCodeUntilFn(_),this._beginToken(a.EXPANSION_CASE_EXP_START,this._getLocation()),this._requireCharCode(xt.$LBRACE),this._endToken([],this._getLocation()),this._attemptCharCodeUntilFn(_),this._expansionCaseStack.push(a.EXPANSION_CASE_EXP_START)}},{key:"_consumeExpansionCaseEnd",value:function(){this._beginToken(a.EXPANSION_CASE_EXP_END,this._getLocation()),this._requireCharCode(xt.$RBRACE),this._endToken([],this._getLocation()),this._attemptCharCodeUntilFn(_),this._expansionCaseStack.pop()}},{key:"_consumeExpansionFormEnd",value:function(){this._beginToken(a.EXPANSION_FORM_END,this._getLocation()),this._requireCharCode(xt.$RBRACE),this._endToken([]),this._expansionCaseStack.pop()}},{key:"_consumeText",value:function(){var e=this._getLocation();this._beginToken(a.TEXT,e);var t=[];do{this._interpolationConfig&&this._attemptStr(this._interpolationConfig.start)?(t.push(this._interpolationConfig.start),this._inInterpolation=!0):this._interpolationConfig&&this._inInterpolation&&this._attemptStr(this._interpolationConfig.end)?(t.push(this._interpolationConfig.end),this._inInterpolation=!1):t.push(this._readChar(!0))}while(!this._isTextEnd());this._endToken([this._processCarriageReturns(t.join(""))])}},{key:"_isTextEnd",value:function(){if(this._peek===xt.$LT||this._peek===xt.$EOF)return!0;if(this._tokenizeIcu&&!this._inInterpolation){if(T(this._input,this._index,this._interpolationConfig))return!0;if(this._peek===xt.$RBRACE&&this._isInExpansionCase())return!0}return!1}},{key:"_savePosition",value:function(){return[this._peek,this._index,this._column,this._line,this.tokens.length]}},{key:"_readUntil",value:function(e){var t=this._index;return this._attemptUntilChar(e),this._input.substring(t,this._index)}},{key:"_restorePosition",value:function(e){this._peek=e[0],this._index=e[1],this._column=e[2],this._line=e[3];var t=e[4];t0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===a.EXPANSION_CASE_EXP_START}},{key:"_isInExpansionForm",value:function(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===a.EXPANSION_FORM_START}}]),e}();function _(e){return!xt.isWhitespace(e)||e===xt.$EOF}function v(e){return xt.isWhitespace(e)||e===xt.$GT||e===xt.$SLASH||e===xt.$SQ||e===xt.$DQ||e===xt.$EQ}function g(e){return e==xt.$SEMICOLON||e==xt.$EOF||!xt.isAsciiHexDigit(e)}function y(e){return e==xt.$SEMICOLON||e==xt.$EOF||!xt.isAsciiLetter(e)}function T(e,t,n){var i=!!n&&e.indexOf(n.start,t)==t;return e.charCodeAt(t)==xt.$LBRACE&&!i}function S(e){return e>=xt.$a&&e<=xt.$z?e-xt.$a+xt.$A:e}});kt(Mt);var It=Et(function(e,n){Object.defineProperty(n,"__esModule",{value:!0});var a=function(e){function n(e,i,r){var a;return t(this,n),(a=s(this,o(n).call(this,i,r))).elementName=e,a}return r(n,$t.ParseError),i(n,null,[{key:"create",value:function(e,t,i){return new n(e,t,i)}}]),n}();n.TreeError=a;var c=function e(n,i){t(this,e),this.rootNodes=n,this.errors=i};n.ParseTreeResult=c;var l=function(){function e(n){t(this,e),this.getTagDefinition=n}return i(e,[{key:"parse",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Nt.DEFAULT_INTERPOLATION_CONFIG,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],l=s?this.getTagDefinition:function(e){return n.getTagDefinition(e.toLowerCase())},h=Mt.tokenize(e,t,l,i,r,o,a),p=new u(h.tokens,l,o,a,s).build();return new c(p.rootNodes,h.errors.concat(p.errors))}}]),e}();n.Parser=l;var u=function(){function e(n,i,r,o,a){t(this,e),this.tokens=n,this.getTagDefinition=i,this.canSelfClose=r,this.allowHtmComponentClosingTags=o,this.isTagNameCaseSensitive=a,this._index=-1,this._rootNodes=[],this._errors=[],this._elementStack=[],this._advance()}return i(e,[{key:"build",value:function(){for(;this._peek.type!==Mt.TokenType.EOF;)this._peek.type===Mt.TokenType.TAG_OPEN_START?this._consumeStartTag(this._advance()):this._peek.type===Mt.TokenType.TAG_CLOSE?this._consumeEndTag(this._advance()):this._peek.type===Mt.TokenType.CDATA_START?(this._closeVoidElement(),this._consumeCdata(this._advance())):this._peek.type===Mt.TokenType.COMMENT_START?(this._closeVoidElement(),this._consumeComment(this._advance())):this._peek.type===Mt.TokenType.TEXT||this._peek.type===Mt.TokenType.RAW_TEXT||this._peek.type===Mt.TokenType.ESCAPABLE_RAW_TEXT?(this._closeVoidElement(),this._consumeText(this._advance())):this._peek.type===Mt.TokenType.EXPANSION_FORM_START?this._consumeExpansion(this._advance()):this._peek.type===Mt.TokenType.DOC_TYPE_START?this._consumeDocType(this._advance()):this._advance();return new c(this._rootNodes,this._errors)}},{key:"_advance",value:function(){var e=this._peek;return this._index0)return this._errors=this._errors.concat(o.errors),null;var s=new $t.ParseSourceSpan(t.sourceSpan.start,r.sourceSpan.end),c=new $t.ParseSourceSpan(n.sourceSpan.start,r.sourceSpan.end);return new Lt.ExpansionCase(t.parts[0],o.rootNodes,s,t.sourceSpan,c)}},{key:"_collectExpansionExpTokens",value:function(e){for(var t=[],n=[Mt.TokenType.EXPANSION_CASE_EXP_START];;){if(this._peek.type!==Mt.TokenType.EXPANSION_FORM_START&&this._peek.type!==Mt.TokenType.EXPANSION_CASE_EXP_START||n.push(this._peek.type),this._peek.type===Mt.TokenType.EXPANSION_CASE_EXP_END){if(!h(n,Mt.TokenType.EXPANSION_CASE_EXP_START))return this._errors.push(a.create(null,e.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(n.pop(),0==n.length)return t}if(this._peek.type===Mt.TokenType.EXPANSION_FORM_END){if(!h(n,Mt.TokenType.EXPANSION_FORM_START))return this._errors.push(a.create(null,e.sourceSpan,"Invalid ICU message. Missing '}'.")),null;n.pop()}if(this._peek.type===Mt.TokenType.EOF)return this._errors.push(a.create(null,e.sourceSpan,"Invalid ICU message. Missing '}'.")),null;t.push(this._advance())}}},{key:"_getText",value:function(e){var t=e.parts[0];if(t.length>0&&"\n"==t[0]){var n=this._getParentElement();null!=n&&0==n.children.length&&this.getTagDefinition(n.name).ignoreFirstLf&&(t=t.substring(1))}return t}},{key:"_consumeText",value:function(e){var t=this._getText(e);t.length>0&&this._addToParent(new Lt.Text(t,e.sourceSpan))}},{key:"_closeVoidElement",value:function(){var e=this._getParentElement();e&&this.getTagDefinition(e.name).isVoid&&this._elementStack.pop()}},{key:"_consumeStartTag",value:function(e){for(var t=e.parts[0],n=e.parts[1],i=[];this._peek.type===Mt.TokenType.ATTR_NAME;)i.push(this._consumeAttr(this._advance()));var r=this._getElementFullName(t,n,this._getParentElement()),o=!1;if(this._peek.type===Mt.TokenType.TAG_OPEN_END_VOID){this._advance(),o=!0;var s=this.getTagDefinition(r);this.canSelfClose||s.canSelfClose||null!==bt.getNsPrefix(r)||s.isVoid||this._errors.push(a.create(r,e.sourceSpan,'Only void and foreign elements can be self closed "'.concat(e.parts[1],'"')))}else this._peek.type===Mt.TokenType.TAG_OPEN_END&&(this._advance(),o=!1);var c=this._peek.sourceSpan.start,l=new $t.ParseSourceSpan(e.sourceSpan.start,c),u=new $t.ParseSourceSpan(e.sourceSpan.start.moveBy(1),e.sourceSpan.end),h=new Lt.Element(r,i,[],l,l,void 0,u);this._pushElement(h),o&&(this._popElement(r),h.endSourceSpan=l)}},{key:"_pushElement",value:function(e){var t=this._getParentElement();t&&this.getTagDefinition(t.name).isClosedByChild(e.name)&&this._elementStack.pop();var n=this.getTagDefinition(e.name),i=this._getParentElementSkippingContainers(),r=i.parent,o=i.container;if(r&&n.requireExtraParent(r.name)){var a=new Lt.Element(n.parentToAdd,[],[],e.sourceSpan,e.startSourceSpan,e.endSourceSpan);this._insertBeforeContainer(r,o,a)}this._addToParent(e),this._elementStack.push(e)}},{key:"_consumeEndTag",value:function(e){var t=this.allowHtmComponentClosingTags&&0===e.parts.length?null:this._getElementFullName(e.parts[0],e.parts[1],this._getParentElement());if(this._getParentElement()&&(this._getParentElement().endSourceSpan=e.sourceSpan),t&&this.getTagDefinition(t).isVoid)this._errors.push(a.create(t,e.sourceSpan,'Void elements do not have end tags "'.concat(e.parts[1],'"')));else if(!this._popElement(t)){var n='Unexpected closing tag "'.concat(t,'". 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(a.create(t,e.sourceSpan,n))}}},{key:"_popElement",value:function(e){for(var t=this._elementStack.length-1;t>=0;t--){var n=this._elementStack[t];if(!e||(bt.getNsPrefix(n.name)?n.name==e:n.name.toLowerCase()==e.toLowerCase()))return this._elementStack.splice(t,this._elementStack.length-t),!0;if(!this.getTagDefinition(n.name).closedByParent)return!1}return!1}},{key:"_consumeAttr",value:function(e){var t=bt.mergeNsAndName(e.parts[0],e.parts[1]),n=e.sourceSpan.end,i="",r=void 0;if(this._peek.type===Mt.TokenType.ATTR_VALUE){var o=this._advance();i=o.parts[0],n=o.sourceSpan.end,r=o.sourceSpan}return new Lt.Attribute(t,i,new $t.ParseSourceSpan(e.sourceSpan.start,n),r,e.sourceSpan)}},{key:"_getParentElement",value:function(){return this._elementStack.length>0?this._elementStack[this._elementStack.length-1]:null}},{key:"_getParentElementSkippingContainers",value:function(){for(var e=null,t=this._elementStack.length-1;t>=0;t--){if(!bt.isNgContainer(this._elementStack[t].name))return{parent:this._elementStack[t],container:e};e=this._elementStack[t]}return{parent:null,container:e}}},{key:"_addToParent",value:function(e){var t=this._getParentElement();null!=t?t.children.push(e):this._rootNodes.push(e)}},{key:"_insertBeforeContainer",value:function(e,t,n){if(t){if(e){var i=e.children.indexOf(t);e.children[i]=n}else this._rootNodes.push(n);n.children.push(t),this._elementStack.splice(this._elementStack.indexOf(t),0,n)}else this._addToParent(n),this._elementStack.push(n)}},{key:"_getElementFullName",value:function(e,t,n){return null==e&&null==(e=this.getTagDefinition(t).implicitNamespacePrefix)&&null!=n&&(e=bt.getNsPrefix(n.name)),bt.mergeNsAndName(e,t)}}]),e}();function h(e,t){return e.length>0&&e[e.length-1]===t}});kt(It);var Ft=Et(function(e,n){Object.defineProperty(n,"__esModule",{value:!0});var a=It;n.ParseTreeResult=a.ParseTreeResult,n.TreeError=a.TreeError;var l=function(e){function n(){return t(this,n),s(this,o(n).call(this,At.getHtmlTagDefinition))}return r(n,It.Parser),i(n,[{key:"parse",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Nt.DEFAULT_INTERPOLATION_CONFIG,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],l=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return c(o(n.prototype),"parse",this).call(this,e,t,i,r,a,s,l)}}]),n}();n.HtmlParser=l});kt(Ft);var Bt=Et(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=null,i=function(){return n||(n=new Ft.HtmlParser),n};t.parse=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.canSelfClose,r=void 0!==n&&n,o=t.allowHtmComponentClosingTags,a=void 0!==o&&o,s=t.isTagNameCaseSensitive,c=void 0!==s&&s;return i().parse(e,"angular-html-parser",!1,void 0,r,a,c)}});kt(Bt);var Ut=dt.HTML_ELEMENT_ATTRIBUTES,Xt=dt.HTML_TAGS,jt=ft,Vt=Tt.Node,qt=Ct;function zt(e,n){var a=n.recognizeSelfClosing,c=n.normalizeTagName,l=n.normalizeAttributeName,u=n.allowHtmComponentClosingTags,h=n.isTagNameCaseSensitive,p=Bt,d=Lt.RecursiveVisitor,f=Lt.visitAll,m=Lt.Attribute,_=Lt.CDATA,v=Lt.Comment,g=Lt.DocType,y=Lt.Element,T=Lt.Text,S=$t.ParseSourceSpan,C=At.getHtmlTagDefinition,k=p.parse(e,{canSelfClose:a,allowHtmComponentClosingTags:u,isTagNameCaseSensitive:h}),E=k.rootNodes,b=k.errors;if(0!==b.length){var A=b[0],P=A.msg,N=A.span.start,x=N.line,w=N.col;throw mt(P,{start:{line:x+1,column:w+1}})}var O=function(e){var t=e.name.startsWith(":")?e.name.slice(1).split(":")[0]:null,n=e.nameSpan?e.nameSpan.toString():e.name,i=n.startsWith("".concat(t,":")),r=i?n.slice(t.length+1):n;e.name=r,e.namespace=t,e.hasExplicitNamespace=i},R=function(e,t){var n=e.toLowerCase();return t(n)?n:e};return f(new(function(e){function n(){return t(this,n),s(this,o(n).apply(this,arguments))}return r(n,d),i(n,[{key:"visit",value:function(e){!function(e){if(e instanceof m)e.type="attribute";else if(e instanceof _)e.type="cdata";else if(e instanceof v)e.type="comment";else if(e instanceof g)e.type="docType";else if(e instanceof y)e.type="element";else{if(!(e instanceof T))throw new Error("Unexpected node ".concat(JSON.stringify(e)));e.type="text"}}(e),function(e){e instanceof y?(O(e),e.attrs.forEach(function(e){O(e),e.valueSpan?(e.value=e.valueSpan.toString(),/['"]/.test(e.value[0])&&(e.value=e.value.slice(1,-1))):e.value=null})):e instanceof v?e.value=e.sourceSpan.toString().slice("\x3c!--".length,-"--\x3e".length):e instanceof T&&(e.value=e.sourceSpan.toString())}(e),function(e){if(e instanceof y){var t=C(h?e.name:e.name.toLowerCase());e.namespace&&e.namespace!==t.implicitNamespacePrefix?e.tagDefinition=C(""):e.tagDefinition=t}}(e),function(e){if(e instanceof y&&(!c||e.namespace&&e.namespace!==e.tagDefinition.implicitNamespacePrefix||(e.name=R(e.name,function(e){return e in Xt})),l)){var t=Ut[e.name]||Object.create(null);e.attrs.forEach(function(n){n.namespace||(n.name=R(n.name,function(n){return e.name in Ut&&(n in Ut["*"]||n in t)}))})}}(e),function(e){e.sourceSpan&&e.endSourceSpan&&(e.sourceSpan=new S(e.sourceSpan.start,e.endSourceSpan.end))}(e)}}]),n}()),E),E}function Ht(e){return e.sourceSpan.start.offset}function Gt(e){return e.sourceSpan.end.offset}function Wt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.recognizeSelfClosing,n=void 0!==t&&t,i=e.normalizeTagName,r=void 0!==i&&i,o=e.normalizeAttributeName,a=void 0!==o&&o,s=e.allowHtmComponentClosingTags,c=void 0!==s&&s,l=e.isTagNameCaseSensitive,u=void 0!==l&&l;return{parse:function(e,t,i){return function e(t,n,i){var r=arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?{frontMatter:null,content:t}:m(t),o=r.frontMatter,a=r.content,s={type:"root",sourceSpan:{start:{offset:0},end:{offset:t.length}},children:zt(a,i)};o&&s.children.unshift(o);var c=function(r,o){var a=o.offset,s=e(t.slice(0,a).replace(/[^\r\n]/g," ")+r,n,i,!1),c=s.children[0].sourceSpan.constructor;s.sourceSpan=new c(o,s.children[s.children.length-1].sourceSpan.end);var l=s.children[0];return l.length===a?s.children.shift():(l.sourceSpan=new c(l.sourceSpan.start.moveBy(a),l.sourceSpan.end),l.value=l.value.slice(a)),s},l=function(e){return"element"===e.type&&!e.nameSpan};return new Vt(s).map(function(e){if(e.children&&e.children.some(l)){var t=[],n=!0,i=!1,r=void 0;try{for(var o,a=e.children[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;l(s)?Array.prototype.push.apply(t,s.children):t.push(s)}}catch(e){i=!0,r=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw r}}return e.clone({children:t})}if("comment"===e.type){var u=qt(e,c);if(u)return u}return e})}(e,i,{recognizeSelfClosing:n,normalizeTagName:r,normalizeAttributeName:a,allowHtmComponentClosingTags:c,isTagNameCaseSensitive:u})},hasPragma:jt,astFormat:"html",locStart:Ht,locEnd:Gt}}return{parsers:{html:Wt({recognizeSelfClosing:!0,normalizeTagName:!0,normalizeAttributeName:!0,allowHtmComponentClosingTags:!0}),angular:Wt(),vue:Wt({recognizeSelfClosing:!0,isTagNameCaseSensitive:!0})}}});