wrangler-action/node_modules/prettier/plugins/html.js

19 lines
135 KiB
JavaScript
Raw Normal View History

2023-08-07 22:11:15 +02:00
(function(f){function e(){var i=f();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.html=e()}})(function(){"use strict";var Jt=Object.defineProperty;var Ps=Object.getOwnPropertyDescriptor;var Is=Object.getOwnPropertyNames;var Rs=Object.prototype.hasOwnProperty;var qr=(t,e)=>{for(var r in e)Jt(t,r,{get:e[r],enumerable:!0})},$s=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Is(e))!Rs.call(t,s)&&s!==r&&Jt(t,s,{get:()=>e[s],enumerable:!(n=Ps(e,s))||n.enumerable});return t};var Ms=t=>$s(Jt({},"__esModule",{value:!0}),t);var Hr=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var z=(t,e,r)=>(Hr(t,e,"read from private field"),r?r.call(t):e.get(t)),Vr=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},Ur=(t,e,r,n)=>(Hr(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r);var cu={};qr(cu,{languages:()=>Bs,options:()=>Fs,parsers:()=>Qt,printers:()=>lu});var Os=(t,e,r,n)=>{if(!(t&&e==null))return e.replaceAll?e.replaceAll(r,n):r.global?e.replace(r,n):e.split(r).join(n)},v=Os;var Ae="string",_e="array",De="cursor",ne="indent",se="align",ve="trim",X="group",ie="fill",ae="if-break",ue="indent-if-break",ye="line-suffix",be="line-suffix-boundary",V="line",we="label",oe="break-parent",lt=new Set([De,ne,se,ve,X,ie,ae,ue,ye,be,V,we,oe]);function qs(t){if(typeof t=="string")return Ae;if(Array.isArray(t))return _e;if(!t)return;let{type:e}=t;if(lt.has(e))return e}var Te=qs;var Hs=t=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(t);function Vs(t){let e=t===null?"null":typeof t;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}',
Expected it to be 'string' or 'object'.`;if(Te(t))throw new Error("doc is valid.");let r=Object.prototype.toString.call(t);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=Hs([...lt].map(s=>`'${s}'`));return`Unexpected doc.type '${t.type}'.
Expected it to be ${n}.`}var Zt=class extends Error{name="InvalidDocError";constructor(e){super(Vs(e)),this.doc=e}},ct=Zt;var Wr=()=>{},Q=Wr,pt=Wr;function U(t){return Q(t),{type:ne,contents:t}}function Gr(t,e){return Q(e),{type:se,contents:e,n:t}}function D(t,e={}){return Q(t),pt(e.expandedStates,!0),{type:X,id:e.id,contents:t,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function zr(t){return Gr(Number.NEGATIVE_INFINITY,t)}function Yr(t){return Gr({type:"root"},t)}function ht(t){return pt(t),{type:ie,parts:t}}function le(t,e="",r={}){return Q(t),e!==""&&Q(e),{type:ae,breakContents:t,flatContents:e,groupId:r.groupId}}function jr(t,e){return Q(t),{type:ue,contents:t,groupId:e.groupId,negate:e.negate}}var J={type:oe};var Us={type:V,hard:!0},Ws={type:V,hard:!0,literal:!0},_={type:V},x={type:V,soft:!0},S=[Us,J],Kr=[Ws,J];function Z(t,e){Q(t),pt(e);let r=[];for(let n=0;n<e.length;n++)n!==0&&r.push(t),r.push(e[n]);return r}var Gs=(t,e,r)=>{if(!(t&&e==null))return Array.isArray(e)||typeof e=="string"?e[r<0?e.length+r:r]:e.at(r)},xe=Gs;function ft(t,e){if(typeof t=="string")return e(t);let r=new Map;return n(t);function n(i){if(r.has(i))return r.get(i);let a=s(i);return r.set(i,a),a}function s(i){switch(Te(i)){case _e:return e(i.map(n));case ie:return e({...i,parts:i.parts.map(n)});case ae:return e({...i,breakContents:n(i.breakContents),flatContents:n(i.flatContents)});case X:{let{expandedStates:a,contents:u}=i;return a?(a=a.map(n),u=a[0]):u=n(u),e({...i,contents:u,expandedStates:a})}case se:case ne:case ue:case we:case ye:return e({...i,contents:n(i.contents)});case Ae:case De:case ve:case be:case V:case oe:return e(i);default:throw new ct(i)}}}function zs(t){switch(Te(t)){case ie:if(t.parts.every(e=>e===""))return"";break;case X:if(!t.contents&&!t.id&&!t.break&&!t.expandedStates)return"";if(t.contents.type===X&&t.contents.id===t.id&&t.contents.break===t.break&&t.contents.expandedStates===t.expandedStates)return t.contents;break;case se:case ne:case ue:case ye:if(!t.contents)return"";break;case ae:if(!t.flatContents&&!t.breakContents)return"";break;case _e:{let e=[];for(let r of t){if(!r)continue;let[n,...s]=Array.isArray(r)?r:[r];typeof n=="string"&&typeof xe(!1,e,-1)=="string"?e[e.length-1]+=n:e.push(n),e.push(...s)}return e.length===0?"":e.length===1?e[0]:e}case Ae:case De:case ve:case be:case V:case we:case oe:break;default:throw new ct(t)}return t}function Xr(t){return ft(t,e=>zs(e))}function T(t,e=Kr){return ft(t,r=>typeof r=="string"?Z(e,r.split(`
`)):r)}var er=class extends Error{name="UnexpectedNodeError";constructor(e,r,n="type"){super(`Unexpected ${r} node ${n}: ${JSON.stringify(e[n])}.`),this.node=e}},Qr=er;var mt="'",Jr='"';function Ys(t,e){let r=e===!0||e===mt?mt:Jr,n=r===mt?Jr:mt,s=0,i=0;for(let a of t)a===r?s++:a===n&&i++;return s>i?n:r}var Zr=Ys;function js(t){return(t==null?void 0:t.type)==="front-matter"}var ke=js;var Ks=new Set(["sourceSpan","startSourceSpan","endSourceSpan","nameSpan","valueSpan","keySpan","tagDefinition","tokens","valueTokens"]);function en(t,e){if(t.type==="text"||t.type==="comment"||ke(t)||t.type==="yaml"||t.type==="toml")return null;t.type==="attribute"&&delete e.value,t.type==="docType"&&delete e.value}en.ignoredProperties=Ks;var tn=en;var Xs=t=>t.split(/[/\\]/).pop();function rn(t,e){if(!e)return;let r=Xs(e).toLowerCase();return t.find(n=>{var s,i;return((s=n.extensions)==null?void 0:s.some(a=>r.endsWith(a)))||((i=n.filenames)==null?void 0:i.some(a=>a.toLowerCase()===r))})}function Qs(t,e){if(e)return t.find(({name:r})=>r.toLowerCase()===e)??t.find(({aliases:r})=>r==null?void 0:r.includes(e))??t.find(({extensions:r})=>r==null?void 0:r.includes(`.${e}`))}function Js(t,e){let r=t.plugins.flatMap(s=>s.languages??[]),n=Qs(r,e.language)??rn(r,e.physicalFile)??rn(r,e.file)??(e.physicalFile,void 0);return n==null?void 0:n.parsers[0]}var Be=Js;var nn="inline",sn={area:"none",base:"none",basefont:"none",datalist:"none",head:"none",link:"none",meta:"none",noembed:"none",noframes:"none",param:"block",rp:"none",script:"block",source:"block",style:"none",template:"inline",track:"block",title:"none",html:"block",body:"block",address:"block",blockquote:"block",center:"block",div:"block",figure:"block",figcaption:"block",footer:"block",form:"block",header:"block",hr:"block",legend:"block",listing:"block",main:"block",p:"block",plaintext:"block",pre:"block",xmp:"block",slot:"contents",ruby:"ruby",rt:"ruby-text",article:"block",aside:"block",h1:"block",h2:"block",h3:"block",h4:"block",h5:"block",h6:"block",hgroup:"block",nav:"block",section:"block",dir:"block",dd:"block",dl:"block",dt:"block",ol:"block",ul:"block",li:"list-item",table:"table",caption:"table-caption",colgroup:"table-column-group",col:"table-column",thead:"table-header-group",tbody:"table-row-group",tfoot:"table-footer-group",tr:"table-row",td:"table-cell",th:"table-cell",fieldset:"block",button:"inline-block",details:"block",summary:"block",dialog:"block",meter:"inline-block",progress:"inline-block",object:"inline-block",video:"inline-block",audio:"inline-block",select:"inline-block",option:"block",optgroup:"block",search:"block"},an="normal",un={listing:"pre",plaintext:"pre",pre:"pre",xmp:"pre",nobr:"nowrap",table:"initial",textarea:"pre-wrap"};function tr(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var R,rr=class{constructor(e){Vr(this,R,void 0);Ur(this,R,new Set(e))}getLeadingWhitespaceCount(e){let r=z(this,R),n=0;for(let s=0;s<e.length&&r.has(e.charAt(s));s++)n++;return n}getTrailingWhitespaceCount(e){let r=z(this,R),n=0;for(let s=e.length-1;s>=0&&r.has(e.charAt(s));s--)n++;return n}getLeadingWhitespace(e){let r=this.getLeadingWhitespaceCount(e);return e.slice(0,r)}getTrailingWhitespace(e){let r=this.getTrailingWhitespaceCount(e);return e.slice(e.length-r)}hasLeadingWhitespace(e){return z(this,R).has(e.charAt(0))}hasTrailingWhitespace(e){return z(this,R).has(xe(!1,e,-1))}trimStart(e){let r=this.getLeadingWhitespaceCount(e);return e.slice(r)}trimEnd(e){let r=this.getTrailingWhitespaceCount(e);return e.slice(0,e.length-r)}trim(e){return this.trimEnd(this.trimStart(e))}split(e,r=!1){let n=`[${tr([...z(this,R)].join(""))}]+`,s=new RegExp(r?`(${n})`:n);return e.split(s)}hasWhitespaceCharacter(e){let r=z(this,R);return Array.prototype.some.call(e,n=>r.has(n))}hasNonWhitespaceCharacter(e){let r=z(this,R);return Array.prototype.some.call(e,n=>!r.has(n))}isWhitespaceOnly(e){let r=z(this,R);return Array.prototype.every.call(e,n=>r.has(n))}};R=new WeakMap;var on=rr;var Zs=[" ",`
`,"\f","\r"," "],ei=new on(Zs),Y=ei;function ti(t){return t.type==="element"&&!t.hasExplicitNamespace&&!["html","svg"].includes(t.namespace)}var ce=ti;var ri=t=>v(!1,t,/^[\t\f\r ]*\n/g,""),nr=t=>ri(Y.trimEnd(t)),ln=t=>{let e=t,r=Y.getLeadingWhitespace(e);r&&(e=e.slice(r.length));let n=Y.getTrailingWhitespace(e);return n&&(e=e.slice(0,-n.length)),{leadingWhitespace:r,trailingWhitespace:n,text:e}};function dt(t,e){return!!(t.type==="ieConditionalComment"&&t.lastChild&&!t.lastChild.isSelfClosing&&!t.lastChild.endSourceSpan||t.type==="ieConditionalComment"&&!t.complete||pe(t)&&t.children.some(r=>r.type!=="text"&&r.type!=="interpolation")||St(t,e)&&!M(t)&&t.type!=="interpolation")}function He(t){return t.type==="attribute"||!t.parent||!t.prev?!1:ni(t.prev)}function ni(t){return t.type==="comment"&&t.value.trim()==="prettier-ignore"}function L(t){return t.type==="text"||t.type==="comment"}function M(t){return t.type==="element"&&(t.fullName==="script"||t.fullName==="style"||t.fullName==="svg:style"||t.fullName==="svg:script"||ce(t)&&(t.name==="script"||t.name==="style"))}function cn(t){return t.children&&!M(t)}function pn(t){return M(t)||t.type==="interpolation"||sr(t)}function sr(t){return Dn(t).startsWith("pre")}function hn(t,e){var s,i;let r=n();if(r&&!t.prev&&((i=(s=t.parent)==null?void 0:s.tagDefinition)!=null&&i.ignoreFirstLf))return t.type==="interpolation";return r;function n(){return ke(t)?!1:(t.type==="text"||t.type==="interpolation")&&t.prev&&(t.prev.type==="text"||t.prev.type==="interpolation")?!0:!t.parent||t.parent.cssDisplay==="none"?!1:pe(t.parent)?!0:!(!t.prev&&(t.parent.type==="root"||pe(t)&&t.parent||M(t.parent)||We(t.parent,e)||!li(t.parent.cssDisplay))||t.prev&&!hi(t.prev.cssDisplay))}}function fn(t,e){return ke(t)?!1:(t.type==="text"||t.type==="interpolation")&&t.next&&(t.next.type==="text"||t.next.type==="interpolation")?!0:!t.parent||t.parent.cssDisplay==="none"?!1:pe(t.parent)?!0:!(!t.next&&(t.parent.type==="root"||pe(t)&&t.parent||M(t.parent)||We(t.parent,e)||!ci(t.parent.cssDisplay))||t.next&&!pi(t.next.cssDisplay))}function mn(t){return fi(t.cssDisplay)&&!M(t)}function Ve(t){return ke(t)||t.next&&t.sourceSpan.end&&t.sourceSpan.end.line+1<t.next.sourceSpan.start.line}function dn(t){return ir(t)||t.type==="element"&&t.children.length>0&&(["body","script","style"].includes(t.name)||t.children.some(e=>ii(e)))||t.firstChild&&t.firstChild===t.lastChild&&t.firstChild.type!=="text"&&Cn(t.firstChild)&&(!t.lastChild.isTrailingSpaceSensitive||Sn(t.lastChild))}function ir(t){return t.type==="element"&&t.children.length>0&&(["html","head","ul","ol","select"].includes(t.name)||t.cssDisplay.startsWith("table")&&t.cssDisplay!=="table-cell")}function gt(t){return En(t)||t.prev&&si(t.prev)||gn(t)}function si(t){return En(t)||t.type==="element"&&t.fullName==="br"||gn(t)}function gn(t){return Cn(t)&&Sn(t)}function Cn(t){return t.hasLeadingSpaces&&(t.prev?t.prev.sourceSpan.end.line<t.sourceSpan.start.line:t.parent.type==="root"||t.parent.startSourceSpan.end.line<t.sourceSpan.start.line)}function Sn(t){return t.hasTrailingSpaces&&(t.next?t.next.sourceSpan.start.line>t.sourceSpan.end.line:t.parent.type==="root"||t.parent.endSourceSpan&&t.parent.endSourceSpan.start.line>t.sourceSpan.end.line)}function En(t){switch(t.type){case"ieConditionalComment":case"comment":case"directive":return!0;case"element":return["script","select"].includes(t.name)}return!1}function Ct(t){return t.lastChild?Ct(t.lastChild):t}function ii(t){var e;return(e=t.children)==null?void 0:e.some(r=>r.type!=="text")}function An(t){if(t)switch(t){case"module":case"text/javascript":case"text/babel":case"application/javascript":return"babel";case"application/x-typescript":return"typescript";case"text/markdown":return"markdown";case"text/html":return"html";case"text/x-handlebars-template":return"glimmer";default:if(t.endsWith("json")||t.endsWith("importmap")||t==="speculationrules")return"json"}}function ai(t,e){let{name:r,attrMap:n}=t;if(r!=="script"||Object.prototype.hasOwnProperty.call(n,"src"))return;let{type:s,lang:i}=t.attrMap;return!i&&!s?"babel":Be(e,
`)){if(r.length===0)continue;let n=Y.getLeadingWhitespaceCount(r);if(n===0)return 0;r.length!==n&&n<e&&(e=n)}return e===Number.POSITIVE_INFINITY?0:e}function ur(t,e=di(t)){return e===0?t:t.split(`
`).map(r=>r.slice(e)).join(`
`)}function or(t){return v(!1,v(!1,t,"&apos;","'"),"&quot;",'"')}function N(t){return or(t.value)}var gi=new Set(["template","style","script"]);function We(t,e){return he(t,e)&&!gi.has(t.fullName)}function he(t,e){return e.parser==="vue"&&t.type==="element"&&t.parent.type==="root"&&t.fullName.toLowerCase()!=="html"}function St(t,e){return he(t,e)&&(We(t,e)||t.attrMap.lang&&t.attrMap.lang!=="html")}function vn(t){let e=t.fullName;return e.charAt(0)==="#"||e==="slot-scope"||e==="v-slot"||e.startsWith("v-slot:")}function yn(t,e){let r=t.parent;if(!he(r,e))return!1;let n=r.fullName,s=t.fullName;return n==="script"&&s==="setup"||n==="style"&&s==="vars"}function Et(t,e=t.value){return t.parent.isWhitespaceSensitive?t.parent.isIndentationSensitive?T(e):T(ur(nr(e)),S):Z(_,Y.split(e))}function bn(t,e){return he(t,e)&&t.name==="script"}function lr(t){return t>=9&&t<=32||t==160}function Ci(t){return 48<=t&&t<=57}function cr(t){return t>=97&&t<=122||t>=65&&t<=90}function wn(t){return t>=97&&t<=102||t>=65&&t<=70||Ci(t)}function pr(t){return t===10||t===13}function hr(t){return 48<=t&&t<=55}function Tn(t){return t===39||t===34||t===96}var Si=/-+([a-z0-9])/g;function kn(t){return t.replace(Si,(...e)=>e[1].toUpperCase())}var ee=class t{constructor(e,r,n,s){this.file=e,this.offset=r,this.line=n,this.col=s}toString(){return this.offset!=null?`${this.file.url}@${this.line}:${this.col}`:this.file.url}moveBy(e){let r=this.file.content,n=r.length,s=this.offset,i=this.line,a=this.col;for(;s>0&&e<0;)if(s--,e++,r.charCodeAt(s)==10){i--;let o=r.substring(0,s-1).lastIndexOf(String.fromCharCode(10));a=o>0?s-o:s}else a--;for(;s<n&&e>0;){let u=r.charCodeAt(s);s++,e--,u==10?(i++,a=0):a++}return new t(this.file,s,i,a)}getContext(e,r){let n=this.file.content,s=this.offset;if(s!=null){s>n.length-1&&(s=n.length-1);let i=s,a=0,u=0;for(;a<e&&s>0&&(s--,a++,!(n[s]==`
`&&++u==r)););for(a=0,u=0;a<e&&i<n.length-1&&(i++,a++,!(n[i]==`
`&&++u==r)););return{before:n.substring(s,this.offset),after:n.substring(this.offset,i+1)}}return null}},fe=class{constructor(e,r){this.content=e,this.url=r}},m=class{constructor(e,r,n=e,s=null){this.start=e,this.end=r,this.fullStart=n,this.details=s}toString(){return this.start.file.content.substring(this.start.offset,this.end.offset)}},At;(function(t){t[t.WARNING=0]="WARNING",t[t.ERROR=1]="ERROR"})(At||(At={}));var Fe=class{constructor(e,r,n=At.ERROR){this.span=e,this.msg=r,this.level=n}contextualMessage(){let e=this.span.start.getContext(100,3);return e?`${this.msg} ("${e.before}[${At[this.level]} ->]${e.after}")`:this.msg}toString(){let e=this.span.details?`, ${this.span.details}`:"";return`${this.contextualMessage()}: ${this.span.start}${e}`}};var Ei=[_i,Di,yi,wi,Ti,Bi,xi,ki,Li,bi];function Ai(t,e){for(let r of Ei)r(t,e);return t}function _i(t){t.walk(e=>{if(e.type==="element"&&e.tagDefinition.ignoreFirstLf&&e.children.length>0&&e.children[0].type==="text"&&e.children[0].value[0]===`
`){let r=e.children[0];r.value.length===1?e.removeChild(r):r.value=r.value.slice(1)}})}function Di(t){let e=r=>{var n,s;return r.type==="element"&&((n=r.prev)==null?void 0:n.type)==="ieConditionalStartComment"&&r.prev.sourceSpan.end.offset===r.startSourceSpan.start.offset&&((s=r.firstChild)==null?void 0:s.type)==="ieConditionalEndComment"&&r.firstChild.sourceSpan.start.offset===r.startSourceSpan.end.offset};t.walk(r=>{if(r.children)for(let n=0;n<r.children.length;n++){let s=r.children[n];if(!e(s))continue;let i=s.prev,a=s.firstChild;r.removeChild(i),n--;let u=new m(i.sourceSpan.start,a.sourceSpan.end),o=new m(u.start,s.sourceSpan.end);s.condition=i.condition,s.sourceSpan=o,s.startSourceSpan=u,s.removeChild(a)}})}function vi(t,e,r){t.walk(n=>{if(n.children)for(let s=0;s<n.children.length;s++){let i=n.children[s];if(i.type!=="text"&&!e(i))continue;i.type!=="text"&&(i.type="text",i.value=r(i));let a=i.prev;!a||a.type!=="text"||(a.value+=i.value,a.sourceSpan=new m(a.sourceSpan.start,i.sourceSpan.end),n.removeChild(i),s--)}})}function yi(t){return vi(t,e=>e.type==="cdata",e=>`<![CDATA[${e.value}]]>`)}function bi(t){let e=r=>{var n,s;return r.type==="element"&&r.attrs.length===0&&r.children.length===1&&r.firstChild.type==="text"&&!Y.hasWhitespaceCharacter(r.children[0].value)&&!r.firstChild.hasLeadingSpaces&&!r.firstChild.hasTrailingSpaces&&r.isLeadingSpaceSensitive&&!r.hasLeadingSpaces&&r.isTrailingSpaceSensitive&&!r.hasTrailingSpaces&&((n=r.prev)==null?void 0:n.type)==="text"&&((s=r.next)==null?void 0:s.type)==="text"};t.walk(r=>{if(r.children)for(let n=0;n<r.children.length;n++){let s=r.children[n];if(!e(s))continue;let i=s.prev,a=s.next;i.value+=`<${s.rawName}>`+s.firstChild.value+`</${s.rawName}>`+a.value,i.sourceSpan=new m(i.sourceSpan.start,a.sourceSpan.end),i.isTrailingSpaceSensitive=a.isTrailingSpaceSensitive,i.hasTrailingSpaces=a.hasTrailingSpaces,r.removeChild(s),n--,r.removeChild(a)}})}function wi(t,e){if(e.parser==="html")return;let r=/{{(.+?)}}/s;t.walk(n=>{if(cn(n))for(let s of n.children){if(s.type!=="text")continue;let i=s.sourceSpan.start,a=null,u=s.value.split(r);for(let o=0;o<u.length;o++,i=a){let p=u[o];if(o%2===0){a=i.moveBy(p.length),p.length>0&&n.insertChildBefore(s,{type:"text",value:p,sourceSpan:new m(i,a)});continue}a=i.moveBy(p.length+4),n.insertChildBefore(s,{type:"interpolation",sourceSpan:new m(i,a),children:p.length===0?[]:[{type:"text",value:p,sourceSpan:new m(i.moveBy(2),a.moveBy(-2))}]})}n.removeChild(s)}})}function Ti(t){t.walk(e=>{if(!e.children)return;if(e.children.length===0||e.children.length===1&&e.children[0].type==="text"&&Y.trim(e.children[0].value).length===0){e.hasDanglingSpaces=e.children.length>0,e.children=[];return}let r=pn(e),n=sr(e);if(!r)for(let s=0;s<e.children.length;s++){let i=e.children[s];if(i.type!=="text")continue;let{leadingWhitespace:a,text:u,trailingWhitespace:o}=ln(i.value),p=i.prev,c=i.next;u?(i.value=u,i.sourceSpan=new m(i.sourceSpan.start.moveBy(a.length),i.sourceSpan.end.moveBy(-o.length)),a&&(p&&(p.hasTrailingSpaces=!0),i.hasLeadingSpaces=!0),o&&(i.hasTrailingSpaces=!0,c&&(c.hasLeadingSpaces=!0))):(e.removeChild(i),s--,(a||o)&&(p&&(p.hasTrailingSpaces=!0),c&&(c.hasLeadingSpaces=!0)))}e.isWhitespaceSensitive=r,e.isIndentationSensitive=n})}function xi(t){t.walk(e=>{e.isSelfClosing=!e.children||e.type==="element"&&(e.tagDefinition.isVoid||e.endSourceSpan&&e.startSourceSpan.start===e.endSourceSpan.start&&e.startSourceSpan.end===e.endSourceSpan.end)})}function ki(t,e){t.walk(r=>{r.type==="element"&&(r.hasHtmComponentClosingTag=r.endSourceSpan&&/^<\s*\/\s*\/\s*>$/.test(e.originalText.slice(r.endSourceSpan.start.offset,r.endSourceSpan.end.offset)))})}function Bi(t,e){t.walk(r=>{r.cssDisplay=_n(r,e)})}function Li(t,e){t.walk(r=>{let{children:n}=r;if(n){if(n.length===0){r.isDanglingSpaceSensitive=mn(r);return}for(let s of n)s.isLeadingSpaceSensitive=hn(s,e),s.isTrailingSpaceSensitive=fn(s,e);for(let s=0;s<n.length;s++){let i=n[s];i.isLeadingSpaceSensitive=(s===0||i.prev.isTrailingSpaceSensitive)&&i.isLeadingSpaceSensitive,i.isTrailingSpaceSensitive=(s===n.length-1||i
`+t}function te(t){return t.sourceSpan.start.offset}function re(t){return t.sourceSpan.end.offset}async function Fi(t,e){if(t.lang==="yaml"){let r=t.value.trim(),n=r?await e(r,{parser:"yaml"}):"";return Yr([t.startDelimiter,S,n,n?S:"",t.endDelimiter])}}var Nn=Fi;var Ge=()=>{};Ge.ok=Ge;Ge.strictEqual=Ge;var fr=Ge;function Ni(t){return Array.isArray(t)&&t.length>0}var Pn=Ni;function ze(t,e){return[t.isSelfClosing?"":Pi(t,e),Ye(t,e)]}function Pi(t,e){return t.lastChild&&ge(t.lastChild)?"":[Ii(t,e),_t(t,e)]}function Ye(t,e){return(t.next?W(t.next):de(t.parent))?"":[me(t,e),O(t,e)]}function Ii(t,e){return de(t)?me(t.lastChild,e):""}function O(t,e){return ge(t)?_t(t.parent,e):je(t)?Dt(t.next):""}function _t(t,e){if(fr(!t.isSelfClosing),In(t,e))return"";switch(t.type){case"ieConditionalComment":return"<!";case"element":if(t.hasHtmComponentClosingTag)return"<//";default:return`</${t.rawName}`}}function me(t,e){if(In(t,e))return"";switch(t.type){case"ieConditionalComment":case"ieConditionalEndComment":return"[endif]-->";case"ieConditionalStartComment":return"]><!-->";case"interpolation":return"}}";case"element":if(t.isSelfClosing)return"/>";default:return">"}}function In(t,e){return!t.isSelfClosing&&!t.endSourceSpan&&(He(t)||dt(t.parent,e))}function W(t){return t.prev&&t.prev.type!=="docType"&&!L(t.prev)&&t.isLeadingSpaceSensitive&&!t.hasLeadingSpaces}function de(t){var e;return((e=t.lastChild)==null?void 0:e.isTrailingSpaceSensitive)&&!t.lastChild.hasTrailingSpaces&&!L(Ct(t.lastChild))&&!pe(t)}function ge(t){return!t.next&&!t.hasTrailingSpaces&&t.isTrailingSpaceSensitive&&L(Ct(t))}function je(t){return t.next&&!L(t.next)&&L(t)&&t.isTrailingSpaceSensitive&&!t.hasTrailingSpaces}function Ri(t){let e=t.trim().match(/^prettier-ignore-attribute(?:\s+(.+))?$/s);return e?e[1]?e[1].split(/\s+/):!0:!1}function Ke(t){return!t.prev&&t.isLeadingSpaceSensitive&&!t.hasLeadingSpaces}function $i(t,e,r){var g;let{node:n}=t;if(!Pn(n.attrs))return n.isSelfClosing?" ":"";let s=((g=n.prev)==null?void 0:g.type)==="comment"&&Ri(n.prev.value),i=typeof s=="boolean"?()=>s:Array.isArray(s)?h=>s.includes(h.rawName):()=>!1,a=t.map(({node:h})=>i(h)?T(e.originalText.slice(te(h),re(h))):r(),"attrs"),u=n.type==="element"&&n.fullName==="script"&&n.attrs.length===1&&n.attrs[0].fullName==="src"&&n.children.length===0,p=e.singleAttributePerLine&&n.attrs.length>1&&!he(n,e)?S:_,c=[U([u?" ":_,Z(p,a)])];return n.firstChild&&Ke(n.firstChild)||n.isSelfClosing&&de(n.parent)||u?c.push(n.isSelfClosing?" ":""):c.push(e.bracketSameLine?n.isSelfClosing?" ":"":n.isSelfClosing?_:x),c}function Mi(t){return t.firstChild&&Ke(t.firstChild)?"":vt(t)}function Xe(t,e,r){let{node:n}=t;return[Qe(n,e),$i(t,e,r),n.isSelfClosing?"":Mi(n)]}function Qe(t,e){return t.prev&&je(t.prev)?"":[q(t,e),Dt(t)]}function q(t,e){return Ke(t)?vt(t.parent):W(t)?me(t.prev,e):""}function Dt(t){switch(t.type){case"ieConditionalComment":case"ieConditionalStartComment":return`<!--[if ${t.condition}`;case"ieConditionalEndComment":return"<!--<!";case"interpolation":return"{{";case"docType":return t.value==="html"?"<!doctype":"<!DOCTYPE";case"element":if(t.condition)return`<!--[if ${t.condition}]><!--><${t.rawName}`;default:return`<${t.rawName}`}}function vt(t){switch(fr(!t.isSelfClosing),t.type){case"ieConditionalComment":return"]>";case"element":if(t.condition)return"><!--<![endif]-->";default:return">"}}var mr=new WeakMap;function Oi(t,e){let{root:r}=t;return mr.has(r)||mr.set(r,r.children.some(n=>bn(n,e)&&["ts","typescript"].includes(n.attrMap.lang))),mr.get(r)}var Ne=Oi;function qi(t,e){if(!t.endSourceSpan)return"";let r=t.startSourceSpan.end.offset;t.firstChild&&Ke(t.firstChild)&&(r-=vt(t).length);let n=t.endSourceSpan.start.offset;return t.lastChild&&ge(t.lastChild)?n+=_t(t,e).length:de(t)&&(n-=me(t.lastChild,e).length),e.originalText.slice(r,n)}var yt=qi;function Rn(t){return t===" "||t===`
`||t==="\f"||t==="\r"||t===" "}var Hi=/^[ \t\n\r\u000c]+/,Vi=/^[, \t\n\r\u000c]+/,Ui=/^[^ \t\n\r\u000c]+/,Wi=/[,]+$/,$n=/^\d+$/,Gi=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/;function zi(t){let e=t.length,r,n,s,i,a,u=0,o;function p(C){let E,A=C.exec(t.substring(u));if(A)return[E]=A,u+=E.length,E}let c=[];for(;;){if(p(Vi),u>=e){if(c.length===0)throw new Error("Must contain one or more image candidate strings.");return c}o=u,r=p(Ui),n=[],r.slice(-1)===","?(r=r.replace(Wi,""),h()):g()}function g(){for(p(Hi),s="",i="in descriptor";;){if(a=t.charAt(u),i==="in descriptor")if(Rn(a))s&&(n.push(s),s="",i="after descriptor");else if(a===","){u+=1,s&&n.push(s),h();return}else if(a==="(")s+=a,i="in parens";else if(a===""){s&&n.push(s),h();return}else s+=a;else if(i==="in parens")if(a===")")s+=a,i="in descriptor";else if(a===""){n.push(s),h();return}else s+=a;else if(i==="after descriptor"&&!Rn(a))if(a===""){h();return}else i="in descriptor",u-=1;u+=1}}function h(){let C=!1,E,A,B,y,l={},d,b,I,w,$;for(y=0;y<n.length;y++)d=n[y],b=d[d.length-1],I=d.substring(0,d.length-1),w=parseInt(I,10),$=parseFloat(I),$n.test(I)&&b==="w"?((E||A)&&(C=!0),w===0?C=!0:E=w):Gi.test(I)&&b==="x"?((E||A||B)&&(C=!0),$<0?C=!0:A=$):$n.test(I)&&b==="h"?((B||A)&&(C=!0),w===0?C=!0:B=w):C=!0;if(!C)l.source={value:r,startOffset:o},E&&(l.width={value:E}),A&&(l.density={value:A}),B&&(l.height={value:B}),c.push(l);else throw new Error(`Invalid srcset descriptor found in "${t}" at "${d}".`)}}var Mn=zi;function Ce(t,e=!0){return[U([x,t]),e?x:""]}function Pe(t,e){let r=t.type==="NGRoot"?t.node.type==="NGMicrosyntax"&&t.node.body.length===1&&t.node.body[0].type==="NGMicrosyntaxExpression"?t.node.body[0].expression:t.node:t.type==="JsExpressionRoot"?t.node:t;return r&&(r.type==="ObjectExpression"||r.type==="ArrayExpression"||(e.parser==="__vue_expression"||e.parser==="__vue_ts_expression")&&(r.type==="TemplateLiteral"||r.type==="StringLiteral"))}async function P(t,e,r,n){r={__isInHtmlAttribute:!0,__embeddedInHtml:!0,...r};let s=!0;n&&(r.__onHtmlBindingRoot=(a,u)=>{s=n(a,u)});let i=await e(t,r,e);return s?D(i):Ce(i)}function Yi(t){if(t.node.fullName==="srcset"&&(t.parent.fullName==="img"||t.parent.fullName==="source"))return()=>ji(N(t.node))}function ji(t){let e=Mn(t),r=e.some(({width:h})=>h),n=e.some(({height:h})=>h),s=e.some(({density:h})=>h);if(r+n+s>1)throw new Error("Mixed descriptor in srcset is not supported");let i=r?"width":n?"height":"density",a=r?"w":n?"h":"x",u=e.map(h=>h.source.value),o=Math.max(...u.map(h=>h.length)),p=e.map(h=>h[i]?String(h[i].value):""),c=p.map(h=>{let C=h.indexOf(".");return C===-1?h.length:C}),g=Math.max(...c);return Ce(Z([",",_],u.map((h,C)=>{let E=[h],A=p[C];if(A){let B=o-h.length+1,y=g-c[C],l=" ".repeat(B+y);E.push(le(l," "),A+a)}return E})))}var On=Yi;function Ki(t,e){let{node:r}=t,n=N(r);if(r.fullName==="class"&&!e.parentParser&&!n.includes("{{"))return()=>n.trim().split(/\s+/).join(" ")}var qn=Ki;function Hn(t,e){let{node:r}=t,n=N(t.node).trim();if(r.fullName==="style"&&!e.parentParser&&!n.includes("{{"))return async s=>Ce(await s(n,{parser:"css",__isHTMLStyleAttribute:!0}))}async function Vn(t,e,r,n){let s=N(r.node),{left:i,operator:a,right:u}=Xi(s),o=Ne(r,n);return[D(await P(`function _(${i}) {}`,t,{parser:o?"babel-ts":"babel",__isVueForBindingLeft:!0}))," ",a," ",await P(u,t,{parser:o?"__ts_expression":"__js_expression"})]}function Xi(t){let e=/(.*?)\s+(in|of)\s+(.*)/s,r=/,([^,\]}]*)(?:,([^,\]}]*))?$/,n=/^\(|\)$/g,s=t.match(e);if(!s)return;let i={};if(i.for=s[3].trim(),!i.for)return;let a=v(!1,s[1].trim(),n,""),u=a.match(r);u?(i.alias=a.replace(r,""),i.iterator1=u[1].trim(),u[2]&&(i.iterator2=u[2].trim())):i.alias=a;let o=[i.alias,i.iterator1,i.iterator2];if(!o.some((p,c)=>!p&&(c===0||o.slice(c+1).some(Boolean))))return{left:o.filter(Boolean).join(","),operator:s[2],right:i.for}}function Un(t,e,{parseWithTs:r}){return P(`function _(${t}) {}`,e,{parser:r?"babel-ts":"babel",__isVueBindings:!0})}function Wn(t){let e=/^(?:[\w$]+|\([^)]*\))\s*=>|^function\s*\(/,r=/^[$A-Z_a-z][\w$]*(?:\.[$A-Z_a-z][\w$]*|\['[^']*']|\["[^"]*"]|\[\
If '${e}' is a directive input, make sure the directive is imported by the current module.`}:{error:!1}}validateAttribute(e){return e.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event attribute '${e}' is disallowed for security reasons, please use (${e.slice(2)})=...`}:{error:!1}}allKnownElementNames(){return Array.from(this._schema.keys())}allKnownAttributesOfElement(e){let r=this._schema.get(e.toLowerCase())||this._schema.get("unknown");return Array.from(r.keys()).map(n=>Sa.get(n)??n)}allKnownEventsOfElement(e){return Array.from(this._eventSchema.get(e.toLowerCase())??[])}normalizeAnimationStyleProperty(e){return kn(e)}normalizeAnimationStyleValue(e,r,n){let s="",i=n.toString().trim(),a=null;if(Ea(e)&&n!==0&&n!=="0")if(typeof n=="number")s="px";else{let u=n.match(/^[+-]?[\d\.]+([a-z]*)$/);u&&u[1].length==0&&(a=`Please provide a CSS unit value for ${r}:${n}`)}return{error:a,value:i+s}}};function Ea(t){switch(t){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!0;default:return!1}}var f=class{constructor({closedByChildren:e,implicitNamespacePrefix:r,contentType:n=k.PARSABLE_DATA,closedByParent:s=!1,isVoid:i=!1,ignoreFirstLf:a=!1,preventNamespaceInheritance:u=!1,canSelfClose:o=!1}={}){this.closedByChildren={},this.closedByParent=!1,e&&e.length>0&&e.forEach(p=>this.closedByChildren[p]=!0),this.isVoid=i,this.closedByParent=s||i,this.implicitNamespacePrefix=r||null,this.contentType=n,this.ignoreFirstLf=a,this.preventNamespaceInheritance=u,this.canSelfClose=o??i}isClosedByChild(e){return this.isVoid||e.toLowerCase()in this.closedByChildren}getContentType(e){return typeof this.contentType=="object"?(e===void 0?void 0:this.contentType[e])??this.contentType.default:this.contentType}},as,rt;function $e(t){return rt||(as=new f({canSelfClose:!0}),rt={base:new f({isVoid:!0}),meta:new f({isVoid:!0}),area:new f({isVoid:!0}),embed:new f({isVoid:!0}),link:new f({isVoid:!0}),img:new f({isVoid:!0}),input:new f({isVoid:!0}),param:new f({isVoid:!0}),hr:new f({isVoid:!0}),br:new f({isVoid:!0}),source:new f({isVoid:!0}),track:new f({isVoid:!0}),wbr:new f({isVoid:!0}),p:new f({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 f({closedByChildren:["tbody","tfoot"]}),tbody:new f({closedByChildren:["tbody","tfoot"],closedByParent:!0}),tfoot:new f({closedByChildren:["tbody"],closedByParent:!0}),tr:new f({closedByChildren:["tr"],closedByParent:!0}),td:new f({closedByChildren:["td","th"],closedByParent:!0}),th:new f({closedByChildren:["td","th"],closedByParent:!0}),col:new f({isVoid:!0}),svg:new f({implicitNamespacePrefix:"svg"}),foreignObject:new f({implicitNamespacePrefix:"svg",preventNamespaceInheritance:!0}),math:new f({implicitNamespacePrefix:"math"}),li:new f({closedByChildren:["li"],closedByParent:!0}),dt:new f({closedByChildren:["dt","dd"]}),dd:new f({closedByChildren:["dt","dd"],closedByParent:!0}),rb:new f({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rt:new f({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rtc:new f({closedByChildren:["rb","rtc","rp"],closedByParent:!0}),rp:new f({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),optgroup:new f({closedByChildren:["optgroup"],closedByParent:!0}),option:new f({closedByChildren:["option","optgroup"],closedByParent:!0}),pre:new f({ignoreFirstLf:!0}),listing:new f({ignoreFirstLf:!0}),style:new f({contentType:k.RAW_TEXT}),script:new f({contentType:k.RAW_TEXT}),title:new f({contentType:{default:k.ESCAPABLE_RAW_TEXT,svg:k.PARSABLE_DATA}}),text
`,Nfr:"\u{1D511}",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:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",ohm:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",ldquo:"\u201C",OpenCurlyQuote:"\u2018",lsquo:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",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:"\u{1D513}",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:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',quot:'"',Qfr:"\u{1D514}",Qopf:"\u211A",rationals:"\u211A",Qscr:"\u{1D4AC}",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:
`)}tokenize(){for(;this._cursor.peek()!==0;){let e=this._cursor.clone();try{if(this._attemptCharCode(60))if(this._attemptCharCode(33))this._attemptStr("[CDATA[")?this._consumeCdata(e):this._attemptStr("--")?this._consumeComment(e):this._attemptStrCaseInsensitive("doctype")?this._consumeDocType(e):this._consumeBogusComment(e);else if(this._attemptCharCode(47))this._consumeTagClose(e);else{let r=this._cursor.clone();this._attemptCharCode(63)?(this._cursor=r,this._consumeBogusComment(e)):this._consumeTagOpen(e)}else this._tokenizeIcu&&this._tokenizeExpansionForm()||this._consumeWithInterpolation(5,8,()=>this._isTextEnd(),()=>this._isTagStart())}catch(r){this.handleError(r)}}this._beginToken(25),this._endToken([])}_tokenizeExpansionForm(){if(this.isExpansionFormStart())return this._consumeExpansionFormStart(),!0;if(Ga(this._cursor.peek())&&this._isInExpansionForm())return this._consumeExpansionCaseStart(),!0;if(this._cursor.peek()===125){if(this._isInExpansionCase())return this._consumeExpansionCaseEnd(),!0;if(this._isInExpansionForm())return this._consumeExpansionFormEnd(),!0}return!1}_beginToken(e,r=this._cursor.clone()){this._currentTokenStart=r,this._currentTokenType=e}_endToken(e,r){if(this._currentTokenStart===null)throw new at("Programming error - attempted to end a token when there was no start to the token",this._currentTokenType,this._cursor.getSpan(r));if(this._currentTokenType===null)throw new at("Programming error - attempted to end a token which has no token type",null,this._cursor.getSpan(this._currentTokenStart));let n={type:this._currentTokenType,parts:e,sourceSpan:(r??this._cursor).getSpan(this._currentTokenStart,this._leadingTriviaCodePoints)};return this.tokens.push(n),this._currentTokenStart=null,this._currentTokenType=null,n}_createError(e,r){this._isInExpansionForm()&&(e+=` (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.)`);let n=new at(e,this._currentTokenType,r);return this._currentTokenStart=null,this._currentTokenType=null,new ut(n)}handleError(e){if(e instanceof ot&&(e=this._createError(e.msg,this._cursor.getSpan(e.cursor))),e instanceof ut)this.errors.push(e.error);else throw e}_attemptCharCode(e){return this._cursor.peek()===e?(this._cursor.advance(),!0):!1}_attemptCharCodeCaseInsensitive(e){return za(this._cursor.peek(),e)?(this._cursor.advance(),!0):!1}_requireCharCode(e){let r=this._cursor.clone();if(!this._attemptCharCode(e))throw this._createError(Oe(this._cursor.peek()),this._cursor.getSpan(r))}_attemptStr(e){let r=e.length;if(this._cursor.charsLeft()<r)return!1;let n=this._cursor.clone();for(let s=0;s<r;s++)if(!this._attemptCharCode(e.charCodeAt(s)))return this._cursor=n,!1;return!0}_attemptStrCaseInsensitive(e){for(let r=0;r<e.length;r++)if(!this._attemptCharCodeCaseInsensitive(e.charCodeAt(r)))return!1;return!0}_requireStr(e){let r=this._cursor.clone();if(!this._attemptStr(e))throw this._createError(Oe(this._cursor.peek()),this._cursor.getSpan(r))}_requireStrCaseInsensitive(e){let r=this._cursor.clone();if(!this._attemptStrCaseInsensitive(e))throw this._createError(Oe(this._cursor.peek()),this._cursor.getSpan(r))}_attemptCharCodeUntilFn(e){for(;!e(this._cursor.peek());)this._cursor.advance()}_requireCharCodeUntilFn(e,r){let n=this._cursor.clone();if(this._attemptCharCodeUntilFn(e),this._cursor.diff(n)<r)throw this._createError(Oe(this._cursor.peek()),this._cursor.getSpan(n))}_attemptUntilChar(e){for(;this._cursor.peek()!==e;)this._cursor.advance()}_readChar(){let e=String.fromCodePoint(this._cursor.peek());return this._cursor.advance(),e}_consumeEntity(e){this._beginToken(9);let r=this._cursor.clone();if(this._cursor.advance(),this._attemptCharCode(35)){let n=this._attemptCharCode(120)||this._attemptCharCode(88),s=this._cursor.clone();if(this._attemptCharCodeUntilFn(Ua),this._cursor.peek()!=59){this._cursor.advance();let a=n?Ut.HEX:Ut.DEC;throw this._createError(Ha(a,this._cursor.getChars(r)),this._cursor.getSpan())}let i=this._cursor.getChars(s);this._cursor.advance();try{let a=parseInt(i,n?16:10);this._endToken([String.fromCharCode(a),this._cursor.getCh
`){let n=this._getParentElement();n!=null&&n.children.length==0&&this.getTagDefinition(n.name).ignoreFirstLf&&(r=r.substring(1))}return r}_consumeText(e){let r=[e],n=e.sourceSpan,s=e.parts[0];if(s.length>0&&s[0]===`
`){let i=this._getParentElement();i!=null&&i.children.length===0&&this.getTagDefinition(i.name).ignoreFirstLf&&(s=s.substring(1),r[0]={type:e.type,sourceSpan:e.sourceSpan,parts:[s]})}for(;this._peek.type===8||this._peek.type===5||this._peek.type===9;)e=this._advance(),r.push(e),e.type===8?s+=e.parts.join("").replace(/&([^;]+);/g,As):e.type===9?s+=e.parts[0]:s+=e.parts.join("");if(s.length>0){let i=e.sourceSpan;this._addToParent(new Lt(s,new m(n.start,i.end,n.fullStart,n.details),r))}}_closeVoidElement(){let e=this._getParentElement();e&&this.getTagDefinition(e.name).isVoid&&this._elementStack.pop()}_consumeStartTag(e){let[r,n]=e.parts,s=[];for(;this._peek.type===14;)s.push(this._consumeAttr(this._advance()));let i=this._getElementFullName(r,n,this._getParentElement()),a=!1;if(this._peek.type===2){this._advance(),a=!0;let h=this.getTagDefinition(i);this.canSelfClose||h.canSelfClose||Ie(i)!==null||h.isVoid||this.errors.push(H.create(i,e.sourceSpan,`Only void, custom and foreign elements can be self closed "${e.parts[1]}"`))}else this._peek.type===1&&(this._advance(),a=!1);let u=this._peek.sourceSpan.fullStart,o=new m(e.sourceSpan.start,u,e.sourceSpan.fullStart),p=new m(e.sourceSpan.start,u,e.sourceSpan.fullStart),c=new m(e.sourceSpan.start.moveBy(1),e.sourceSpan.end),g=new Rt(i,s,[],o,p,void 0,c);this._pushElement(g),a?this._popElement(i,o):e.type===4&&(this._popElement(i,null),this.errors.push(H.create(i,o,`Opening tag "${i}" not terminated.`)))}_pushElement(e){let r=this._getParentElement();r&&this.getTagDefinition(r.name).isClosedByChild(e.name)&&this._elementStack.pop(),this._addToParent(e),this._elementStack.push(e)}_consumeEndTag(e){let r=this.allowHtmComponentClosingTags&&e.parts.length===0?null:this._getElementFullName(e.parts[0],e.parts[1],this._getParentElement());if(r&&this.getTagDefinition(r).isVoid)this.errors.push(H.create(r,e.sourceSpan,`Void elements do not have end tags "${e.parts[1]}"`));else if(!this._popElement(r,e.sourceSpan)){let n=`Unexpected closing tag "${r}". 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(H.create(r,e.sourceSpan,n))}}_popElement(e,r){let n=!1;for(let s=this._elementStack.length-1;s>=0;s--){let i=this._elementStack[s];if(!e||(Ie(i.name)?i.name==e:i.name.toLowerCase()==e.toLowerCase()))return i.endSourceSpan=r,i.sourceSpan.end=r!==null?r.end:i.sourceSpan.end,this._elementStack.splice(s,this._elementStack.length-s),!n;this.getTagDefinition(i.name).closedByParent||(n=!0)}return!1}_consumeAttr(e){let r=Re(e.parts[0],e.parts[1]),n=e.sourceSpan.end,s;this._peek.type===15&&(s=this._advance());let i="",a=[],u,o;if(this._peek.type===16)for(u=this._peek.sourceSpan,o=this._peek.sourceSpan.end;this._peek.type===16||this._peek.type===17||this._peek.type===9;){let g=this._advance();a.push(g),g.type===17?i+=g.parts.join("").replace(/&([^;]+);/g,As):g.type===9?i+=g.parts[0]:i+=g.parts.join(""),o=n=g.sourceSpan.end}this._peek.type===15&&(o=n=this._advance().sourceSpan.end);let c=u&&o&&new m((s==null?void 0:s.sourceSpan.start)??u.start,o,(s==null?void 0:s.sourceSpan.fullStart)??u.fullStart);return new It(r,i,new m(e.sourceSpan.start,n,e.sourceSpan.fullStart),e.sourceSpan,c,a.length>0?a:void 0,void 0)}_getParentElement(){return this._elementStack.length>0?this._elementStack[this._elementStack.length-1]:null}_addToParent(e){let r=this._getParentElement();r!=null?r.children.push(e):this.rootNodes.push(e)}_getElementFullName(e,r,n){if(e===""&&(e=this.getTagDefinition(r).implicitNamespacePrefix||"",e===""&&n!=null)){let s=tt(n.name)[1];this.getTagDefinition(s).preventNamespaceInheritance||(e=Ie(n.name))}return Re(e,r)}};function Es(t,e){return t.length>0&&t[t.length-1]===e}function As(t,e){return Me[e]!==void 0?Me[e]||t:/^#x[a-f0-9]+$/i.test(e)?String.fromCodePoint(parseInt(e.slice(2),16)):/^#\d+$/.test(e)?String.fromCodePoint(parseInt(e.slice(1),10)):t}var zt=class extends Gt{constructor(){super($e)}parse(e,r,n,s=!1,i){return super.parse(e,r,n,s,i)}};var Pr=null,ja