Anvil/sb-manager/formatter-2WMMO6ZP-JI7RHVTW.js

59 lines
219 KiB
JavaScript
Raw Normal View History

2024-06-16 17:30:30 +02:00
import{__toESM,require_memoizerific}from"./chunk-ZR5JZWHI.js";var import_memoizerific=__toESM(require_memoizerific(),1),Ks=Object.defineProperty,Yr=(t8,e)=>{for(var r in e)Ks(t8,r,{get:e[r],enumerable:!0})},jr=(t8,e,r)=>{if(!e.has(t8))throw TypeError("Cannot "+r)},Q=(t8,e,r)=>(jr(t8,e,"read from private field"),r?r.call(t8):e.get(t8)),Kr=(t8,e,r)=>{if(e.has(t8))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t8):e.set(t8,r)},Qr=(t8,e,r,n)=>(jr(t8,e,"write to private field"),n?n.call(t8,r):e.set(t8,r),r),Ur={};Yr(Ur,{languages:()=>zs,options:()=>Ys,parsers:()=>Hr,printers:()=>To});var Qs=(t8,e,r,n)=>{if(!(t8&&e==null))return e.replaceAll?e.replaceAll(r,n):r.global?e.replace(r,n):e.split(r).join(n)},v=Qs,we="string",be="array",Te="cursor",oe="indent",ue="align",xe="trim",ee="group",le="fill",ce="if-break",pe="indent-if-break",ke="line-suffix",Be="line-suffix-boundary",G="line",Le="label",he="break-parent",ft=new Set([Te,oe,ue,xe,ee,le,ce,pe,ke,Be,G,Le,he]);function Xs(t8){if(typeof t8=="string")return we;if(Array.isArray(t8))return be;if(!t8)return;let{type:e}=t8;if(ft.has(e))return e}var Fe=Xs,Js=t8=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(t8);function Zs(t8){let e=t8===null?"null":typeof t8;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}',
Expected it to be 'string' or 'object'.`;if(Fe(t8))throw new Error("doc is valid.");let r=Object.prototype.toString.call(t8);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=Js([...ft].map(s=>`'${s}'`));return`Unexpected doc.type '${t8.type}'.
Expected it to be ${n}.`}var rr=class extends Error{name="InvalidDocError";constructor(e){super(Zs(e)),this.doc=e}},mt=rr,Xr=()=>{},dt=Xr;function R(t8){return{type:oe,contents:t8}}function Jr(t8,e){return{type:ue,contents:e,n:t8}}function E(t8,e={}){return dt(e.expandedStates),{type:ee,id:e.id,contents:t8,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function Zr(t8){return Jr(Number.NEGATIVE_INFINITY,t8)}function en(t8){return Jr({type:"root"},t8)}function gt(t8){return{type:le,parts:t8}}function fe(t8,e="",r={}){return{type:ce,breakContents:t8,flatContents:e,groupId:r.groupId}}function tn(t8,e){return{type:pe,contents:t8,groupId:e.groupId,negate:e.negate}}var re={type:he},ei={type:G,hard:!0},ti={type:G,hard:!0,literal:!0},A={type:G},b={type:G,soft:!0},S=[ei,re],rn=[ti,re];function Y(t8,e){let r=[];for(let n=0;n<e.length;n++)n!==0&&r.push(t8),r.push(e[n]);return r}var ri=(t8,e,r)=>{if(!(t8&&e==null))return Array.isArray(e)||typeof e=="string"?e[r<0?e.length+r:r]:e.at(r)},me=ri;function Ct(t8,e){if(typeof t8=="string")return e(t8);let r=new Map;return n(t8);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(Fe(i)){case be:return e(i.map(n));case le:return e({...i,parts:i.parts.map(n)});case ce:return e({...i,breakContents:n(i.breakContents),flatContents:n(i.flatContents)});case ee:{let{expandedStates:a,contents:o}=i;return a?(a=a.map(n),o=a[0]):o=n(o),e({...i,contents:o,expandedStates:a})}case ue:case oe:case pe:case Le:case ke:return e({...i,contents:n(i.contents)});case we:case Te:case xe:case Be:case G:case he:return e(i);default:throw new mt(i)}}}function ni(t8){switch(Fe(t8)){case le:if(t8.parts.every(e=>e===""))return"";break;case ee:if(!t8.contents&&!t8.id&&!t8.break&&!t8.expandedStates)return"";if(t8.contents.type===ee&&t8.contents.id===t8.id&&t8.contents.break===t8.break&&t8.contents.expandedStates===t8.expandedStates)return t8.contents;break;case ue:case oe:case pe:case ke:if(!t8.contents)return"";break;case ce:if(!t8.flatContents&&!t8.breakContents)return"";break;case be:{let e=[];for(let r of t8){if(!r)continue;let[n,...s]=Array.isArray(r)?r:[r];typeof n=="string"&&typeof me(!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 we:case Te:case xe:case Be:case G:case Le:case he:break;default:throw new mt(t8)}return t8}function nn(t8){return Ct(t8,e=>ni(e))}function T(t8,e=rn){return Ct(t8,r=>typeof r=="string"?Y(e,r.split(`
`)):r)}var nr=class extends Error{name="UnexpectedNodeError";constructor(e,r,n="type"){super(`Unexpected ${r} node ${n}: ${JSON.stringify(e[n])}.`),this.node=e}},sn=nr,St="'",an='"';function si(t8,e){let r=e===!0||e===St?St:an,n=r===St?an:St,s=0,i=0;for(let a of t8)a===r?s++:a===n&&i++;return s>i?n:r}var on=si;function sr(t8){if(typeof t8!="string")throw new TypeError("Expected a string");return t8.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var O,ir=class{constructor(e){Kr(this,O,void 0),Qr(this,O,new Set(e))}getLeadingWhitespaceCount(e){let r=Q(this,O),n=0;for(let s=0;s<e.length&&r.has(e.charAt(s));s++)n++;return n}getTrailingWhitespaceCount(e){let r=Q(this,O),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 Q(this,O).has(e.charAt(0))}hasTrailingWhitespace(e){return Q(this,O).has(me(!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=`[${sr([...Q(this,O)].join(""))}]+`,s=new RegExp(r?`(${n})`:n);return e.split(s)}hasWhitespaceCharacter(e){let r=Q(this,O);return Array.prototype.some.call(e,n=>r.has(n))}hasNonWhitespaceCharacter(e){let r=Q(this,O);return Array.prototype.some.call(e,n=>!r.has(n))}isWhitespaceOnly(e){let r=Q(this,O);return Array.prototype.every.call(e,n=>r.has(n))}};O=new WeakMap;var un=ir,ii=[" ",`
`,"\f","\r"," "],ai=new un(ii),H=ai;function oi(t8){return t8?.type==="front-matter"}var Pe=oi,ui=new Set(["sourceSpan","startSourceSpan","endSourceSpan","nameSpan","valueSpan","keySpan","tagDefinition","tokens","valueTokens"]),li=new Set(["if","else if","for","switch","case"]);function ln(t8,e){var r;if(t8.type==="text"||t8.type==="comment"||Pe(t8)||t8.type==="yaml"||t8.type==="toml")return null;if(t8.type==="attribute"&&delete e.value,t8.type==="docType"&&delete e.value,t8.type==="angularControlFlowBlock"&&(r=e.parameters)!=null&&r.children)for(let n of e.parameters.children)li.has(t8.name)?delete n.expression:n.expression=n.expression.trim()}ln.ignoredProperties=ui;var cn=ln,ci=t8=>String(t8).split(/[/\\]/).pop();function pn(t8,e){if(!e)return;let r=ci(e).toLowerCase();return t8.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 pi(t8,e){if(e)return t8.find(({name:r})=>r.toLowerCase()===e)??t8.find(({aliases:r})=>r?.includes(e))??t8.find(({extensions:r})=>r?.includes(`.${e}`))}function hi(t8,e){let r=t8.plugins.flatMap(s=>s.languages??[]);return(pi(r,e.language)??pn(r,e.physicalFile)??pn(r,e.file)??(e.physicalFile,void 0))?.parsers[0]}var Ne=hi,hn="inline",fn={area:"none",base:"none",basefont:"none",datalist:"none",head:"none",link:"none",meta:"none",noembed:"none",noframes:"none",param:"block",rp:"none",script:"block",style:"none",template:"inline",title:"none",html:"block",body:"block",address:"block",blockquote:"block",center:"block",dialog:"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",search:"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",menu:"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",input:"inline-block",button:"inline-block",fieldset:"block",marquee:"inline-block",source:"block",track:"block",details:"block",summary:"block",meter:"inline-block",progress:"inline-block",object:"inline-block",video:"inline-block",audio:"inline-block",select:"inline-block",option:"block",optgroup:"block"},mn="normal",dn={listing:"pre",plaintext:"pre",pre:"pre",xmp:"pre",nobr:"nowrap",table:"initial",textarea:"pre-wrap"};function fi(t8){return t8.type==="element"&&!t8.hasExplicitNamespace&&!["html","svg"].includes(t8.namespace)}var de=fi,mi=t8=>v(!1,t8,/^[\t\f\r ]*\n/g,""),ar=t8=>mi(H.trimEnd(t8)),gn=t8=>{let e=t8,r=H.getLeadingWhitespace(e);r&&(e=e.slice(r.length));let n=H.getTrailingWhitespace(e);return n&&(e=e.slice(0,-n.length)),{leadingWhitespace:r,trailingWhitespace:n,text:e}};function _t(t8,e){return!!(t8.type==="ieConditionalComment"&&t8.lastChild&&!t8.lastChild.isSelfClosing&&!t8.lastChild.endSourceSpan||t8.type==="ieConditionalComment"&&!t8.complete||ge(t8)&&t8.children.some(r=>r.type!=="text"&&r.type!=="interpolation")||Dt(t8,e)&&!V(t8)&&t8.type!=="interpolation")}function Ge(t8){return t8.type==="attribute"||!t8.parent||!t8.prev?!1:di(t8.prev)}function di(t8){return t8.type==="comment"&&t8.value.trim()==="prettier-ignore"}function N(t8){return t8.type==="text"||t8.type==="comment"}function V(t8){return t8.type==="element"&&(t8.fullName==="script"||t8.fullName==="style"||t8.fullName==="svg:style"||t8.fullName==="svg:script"||de(t8)&&(t8.name==="script"||t8.name==="style"))}function Cn(t8){return t8.children&&!V(t8)}function Sn(t8){return V(t8)||t8.type==="interpolation"||or(t8)}function or(t8){return kn(t8).startsWith("pre")}function _n(t8,e){var s,i;let r=n();if(r&&!t8.prev&&(i=(s=t8.parent)==null?void 0:s.tagDefinition)!=null&&i.ignoreFirstLf)return t8.type==="interpola
`)){if(r.length===0)continue;let n=H.getLeadingWhitespaceCount(r);if(n===0)return 0;r.length!==n&&n<e&&(e=n)}return e===Number.POSITIVE_INFINITY?0:e}function cr(t8,e=Ti(t8)){return e===0?t8:t8.split(`
`).map(r=>r.slice(e)).join(`
`)}function pr(t8){return v(!1,v(!1,t8,"&apos;","'"),"&quot;",'"')}function L(t8){return pr(t8.value)}var xi=new Set(["template","style","script"]);function Ke(t8,e){return Ce(t8,e)&&!xi.has(t8.fullName)}function Ce(t8,e){return e.parser==="vue"&&t8.type==="element"&&t8.parent.type==="root"&&t8.fullName.toLowerCase()!=="html"}function Dt(t8,e){return Ce(t8,e)&&(Ke(t8,e)||t8.attrMap.lang&&t8.attrMap.lang!=="html")}function Bn(t8){let e=t8.fullName;return e.charAt(0)==="#"||e==="slot-scope"||e==="v-slot"||e.startsWith("v-slot:")}function Ln(t8,e){let r=t8.parent;if(!Ce(r,e))return!1;let n=r.fullName,s=t8.fullName;return n==="script"&&s==="setup"||n==="style"&&s==="vars"}function vt(t8,e=t8.value){return t8.parent.isWhitespaceSensitive?t8.parent.isIndentationSensitive?T(e):T(cr(ar(e)),S):Y(A,H.split(e))}function yt(t8,e){return Ce(t8,e)&&t8.name==="script"}function wt(t8){return t8>=9&&t8<=32||t8==160}function hr(t8){return 48<=t8&&t8<=57}function bt(t8){return t8>=97&&t8<=122||t8>=65&&t8<=90}function Fn(t8){return t8>=97&&t8<=102||t8>=65&&t8<=70||hr(t8)}function fr(t8){return t8===10||t8===13}function mr(t8){return 48<=t8&&t8<=55}function dr(t8){return t8===39||t8===34||t8===96}var ki=/-+([a-z0-9])/g;function Nn(t8){return t8.replace(ki,(...e)=>e[1].toUpperCase())}var ne=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 u=r.substring(0,s-1).lastIndexOf(`
`);a=u>0?s-u:s}else a--;for(;s<n&&e>0;){let o=r.charCodeAt(s);s++,e--,o==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,o=0;for(;a<e&&s>0&&(s--,a++,!(n[s]==`
`&&++o==r)););for(a=0,o=0;a<e&&i<n.length-1&&(i++,a++,!(n[i]==`
`&&++o==r)););return{before:n.substring(s,this.offset),after:n.substring(this.offset,i+1)}}return null}},Se=class{constructor(e,r){this.content=e,this.url=r}},f=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)}},Tt;(function(t8){t8[t8.WARNING=0]="WARNING",t8[t8.ERROR=1]="ERROR"})(Tt||(Tt={}));var Re=class{constructor(e,r,n=Tt.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}[${Tt[this.level]} ->]${e.after}")`:this.msg}toString(){let e=this.span.details?`, ${this.span.details}`:"";return`${this.contextualMessage()}: ${this.span.start}${e}`}},Bi=[Fi,Pi,Ii,$i,Oi,Hi,Mi,qi,Vi,Ri];function Li(t8,e){for(let r of Bi)r(t8,e);return t8}function Fi(t8){t8.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 Pi(t8){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};t8.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 o=new f(i.sourceSpan.start,a.sourceSpan.end),u=new f(o.start,s.sourceSpan.end);s.condition=i.condition,s.sourceSpan=u,s.startSourceSpan=o,s.removeChild(a)}})}function Ni(t8,e,r){t8.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 f(a.sourceSpan.start,i.sourceSpan.end),n.removeChild(i),s--)}})}function Ii(t8){return Ni(t8,e=>e.type==="cdata",e=>`<![CDATA[${e.value}]]>`)}function Ri(t8){let e=r=>{var n,s;return r.type==="element"&&r.attrs.length===0&&r.children.length===1&&r.firstChild.type==="text"&&!H.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"};t8.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 f(i.sourceSpan.start,a.sourceSpan.end),i.isTrailingSpaceSensitive=a.isTrailingSpaceSensitive,i.hasTrailingSpaces=a.hasTrailingSpaces,r.removeChild(s),n--,r.removeChild(a)}})}function $i(t8,e){if(e.parser==="html")return;let r=/{{(.+?)}}/s;t8.walk(n=>{if(Cn(n))for(let s of n.children){if(s.type!=="text")continue;let i=s.sourceSpan.start,a=null,o=s.value.split(r);for(let u=0;u<o.length;u++,i=a){let p=o[u];if(u%2===0){a=i.moveBy(p.length),p.length>0&&n.insertChildBefore(s,{type:"text",value:p,sourceSpan:new f(i,a)});continue}a=i.moveBy(p.length+4),n.insertChildBefore(s,{type:"interpolation",sourceSpan:new f(i,a),children:p.length===0?[]:[{type:"text",value:p,sourceSpan:new f(i.moveBy(2),a.moveBy(-2))}]})}n.removeChild(s)}})}function Oi(t8){t8.walk(e=>{if(!e.children)return;if(e.children.length===0||e.children.length===1&&e.children[0].type==="text"&&H.trim(e.children[0].value).length===0){e.hasDanglingSpaces=e.children.length>0,e.children=[];return}let r=Sn(e),n=or(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:o,trailingWhitespace:u}=gn(i.value),p=i.prev,l=i.next;o?(i.value=o,i.sourceSpan=new f(i.sourceSpan.start.moveBy(a.length),i.sourceSpan.end.moveBy(-u.length)),a&&(p&&(p.hasTrailingSpaces=!0),i.hasLeadingSpaces=!0),u&&(i.hasTrailingSpaces=!0,l&&(l.hasLeadingSpaces=!0))):(e.removeChild(i),s--,(a||u)&&(p&&(p.hasTrailingSpaces=!0),l&&(l.hasLeadingSpaces=!0)))}e.isWhitespaceSensitive=r,e.isIndentationSensitive=n})}function Mi(t8){t8.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 qi(t8,e){t8.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 Hi(t8,e){t8.walk(r=>{r.cssDisplay=xn(r,e)})}function Vi(t8,e){t8.walk(r=>{let{children:n}=r;if(n){if(n.length===0){r.isDanglingSpaceSensitive=An(r);return}for(let s of n)s.isLeadingSpaceSensitive=_n(s,e),s.isTrailingSpaceSensitive=En(s,e);for(let s=0;s<n.length;s++){let i=n[s];i.isLeadingSpaceSensitive=(s===0||i.prev.isTrailingSpaceSensitive)&&i.isLeadingSpaceSensitive,i.isTrailingSpaceSensitiv
`+t8}function se(t8){return t8.sourceSpan.start.offset}function ie(t8){return t8.sourceSpan.end.offset}async function Ui(t8,e){if(t8.lang==="yaml"){let r=t8.value.trim(),n=r?await e(r,{parser:"yaml"}):"";return en([t8.startDelimiter,S,n,n?S:"",t8.endDelimiter])}}var On=Ui,Mn=new Proxy(()=>{},{get:()=>Mn}),gr=Mn;function Wi(t8){return Array.isArray(t8)&&t8.length>0}var xt=Wi;function Qe(t8,e){return[t8.isSelfClosing?"":zi(t8,e),Xe(t8,e)]}function zi(t8,e){return t8.lastChild&&Ae(t8.lastChild)?"":[Gi(t8,e),kt(t8,e)]}function Xe(t8,e){return(t8.next?j(t8.next):Ee(t8.parent))?"":[_e(t8,e),U(t8,e)]}function Gi(t8,e){return Ee(t8)?_e(t8.lastChild,e):""}function U(t8,e){return Ae(t8)?kt(t8.parent,e):Je(t8)?Bt(t8.next):""}function kt(t8,e){if(gr(!t8.isSelfClosing),qn(t8,e))return"";switch(t8.type){case"ieConditionalComment":return"<!";case"element":if(t8.hasHtmComponentClosingTag)return"<//";default:return`</${t8.rawName}`}}function _e(t8,e){if(qn(t8,e))return"";switch(t8.type){case"ieConditionalComment":case"ieConditionalEndComment":return"[endif]-->";case"ieConditionalStartComment":return"]><!-->";case"interpolation":return"}}";case"element":if(t8.isSelfClosing)return"/>";default:return">"}}function qn(t8,e){return!t8.isSelfClosing&&!t8.endSourceSpan&&(Ge(t8)||_t(t8.parent,e))}function j(t8){return t8.prev&&t8.prev.type!=="docType"&&t8.type!=="angularControlFlowBlock"&&!N(t8.prev)&&t8.isLeadingSpaceSensitive&&!t8.hasLeadingSpaces}function Ee(t8){var e;return((e=t8.lastChild)==null?void 0:e.isTrailingSpaceSensitive)&&!t8.lastChild.hasTrailingSpaces&&!N(At(t8.lastChild))&&!ge(t8)}function Ae(t8){return!t8.next&&!t8.hasTrailingSpaces&&t8.isTrailingSpaceSensitive&&N(At(t8))}function Je(t8){return t8.next&&!N(t8.next)&&N(t8)&&t8.isTrailingSpaceSensitive&&!t8.hasTrailingSpaces}function Yi(t8){let e=t8.trim().match(/^prettier-ignore-attribute(?:\s+(.+))?$/s);return e?e[1]?e[1].split(/\s+/):!0:!1}function Ze(t8){return!t8.prev&&t8.isLeadingSpaceSensitive&&!t8.hasLeadingSpaces}function ji(t8,e,r){var m;let{node:n}=t8;if(!xt(n.attrs))return n.isSelfClosing?" ":"";let s=((m=n.prev)==null?void 0:m.type)==="comment"&&Yi(n.prev.value),i=typeof s=="boolean"?()=>s:Array.isArray(s)?d=>s.includes(d.rawName):()=>!1,a=t8.map(({node:d})=>i(d)?T(e.originalText.slice(se(d),ie(d))):r(),"attrs"),o=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&&!Ce(n,e)?S:A,l=[R([o?" ":A,Y(p,a)])];return n.firstChild&&Ze(n.firstChild)||n.isSelfClosing&&Ee(n.parent)||o?l.push(n.isSelfClosing?" ":""):l.push(e.bracketSameLine?n.isSelfClosing?" ":"":n.isSelfClosing?A:b),l}function Ki(t8){return t8.firstChild&&Ze(t8.firstChild)?"":Lt(t8)}function et(t8,e,r){let{node:n}=t8;return[tt(n,e),ji(t8,e,r),n.isSelfClosing?"":Ki(n)]}function tt(t8,e){return t8.prev&&Je(t8.prev)?"":[W(t8,e),Bt(t8)]}function W(t8,e){return Ze(t8)?Lt(t8.parent):j(t8)?_e(t8.prev,e):""}function Bt(t8){switch(t8.type){case"ieConditionalComment":case"ieConditionalStartComment":return`<!--[if ${t8.condition}`;case"ieConditionalEndComment":return"<!--<!";case"interpolation":return"{{";case"docType":return t8.value==="html"?"<!doctype":"<!DOCTYPE";case"element":if(t8.condition)return`<!--[if ${t8.condition}]><!--><${t8.rawName}`;default:return`<${t8.rawName}`}}function Lt(t8){switch(gr(!t8.isSelfClosing),t8.type){case"ieConditionalComment":return"]>";case"element":if(t8.condition)return"><!--<![endif]-->";default:return">"}}var Cr=new WeakMap;function Qi(t8,e){let{root:r}=t8;return Cr.has(r)||Cr.set(r,r.children.some(n=>yt(n,e)&&["ts","typescript"].includes(n.attrMap.lang))),Cr.get(r)}var $e=Qi;function Xi(t8,e){if(!t8.endSourceSpan)return"";let r=t8.startSourceSpan.end.offset;t8.firstChild&&Ze(t8.firstChild)&&(r-=Lt(t8).length);let n=t8.endSourceSpan.start.offset;return t8.lastChild&&Ae(t8.lastChild)?n+=kt(t8,e).length:Ee(t8)&&(n-=_e(t8.lastChild,e).length),e.originalText.slice(r,n)}var Ft=Xi;function Hn(t8){return t8===" "||t8===`
`||t8==="\f"||t8==="\r"||t8===" "}var Ji=/^[ \t\n\r\u000c]+/,Zi=/^[, \t\n\r\u000c]+/,ea=/^[^ \t\n\r\u000c]+/,ta=/[,]+$/,Vn=/^\d+$/,ra=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/;function na(t8){let e=t8.length,r,n,s,i,a,o=0,u;function p(C){let _2,D=C.exec(t8.substring(o));if(D)return[_2]=D,o+=_2.length,_2}let l=[];for(;;){if(p(Zi),o>=e){if(l.length===0)throw new Error("Must contain one or more image candidate strings.");return l}u=o,r=p(ea),n=[],r.slice(-1)===","?(r=r.replace(ta,""),d()):m()}function m(){for(p(Ji),s="",i="in descriptor";;){if(a=t8.charAt(o),i==="in descriptor")if(Hn(a))s&&(n.push(s),s="",i="after descriptor");else if(a===","){o+=1,s&&n.push(s),d();return}else if(a==="(")s+=a,i="in parens";else if(a===""){s&&n.push(s),d();return}else s+=a;else if(i==="in parens")if(a===")")s+=a,i="in descriptor";else if(a===""){n.push(s),d();return}else s+=a;else if(i==="after descriptor"&&!Hn(a))if(a===""){d();return}else i="in descriptor",o-=1;o+=1}}function d(){let C=!1,_2,D,P2,B,c={},g,y2,$,w2,q2;for(B=0;B<n.length;B++)g=n[B],y2=g[g.length-1],$=g.substring(0,g.length-1),w2=parseInt($,10),q2=parseFloat($),Vn.test($)&&y2==="w"?((_2||D)&&(C=!0),w2===0?C=!0:_2=w2):ra.test($)&&y2==="x"?((_2||D||P2)&&(C=!0),q2<0?C=!0:D=q2):Vn.test($)&&y2==="h"?((P2||D)&&(C=!0),w2===0?C=!0:P2=w2):C=!0;if(!C)c.source={value:r,startOffset:u},_2&&(c.width={value:_2}),D&&(c.density={value:D}),P2&&(c.height={value:P2}),l.push(c);else throw new Error(`Invalid srcset descriptor found in "${t8}" at "${g}".`)}}var Un=na;function De(t8,e=!0){return[R([b,t8]),e?b:""]}function K(t8,e){let r=t8.type==="NGRoot"?t8.node.type==="NGMicrosyntax"&&t8.node.body.length===1&&t8.node.body[0].type==="NGMicrosyntaxExpression"?t8.node.body[0].expression:t8.node:t8.type==="JsExpressionRoot"?t8.node:t8;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 x(t8,e,r,n){r={__isInHtmlAttribute:!0,__embeddedInHtml:!0,...r};let s=!0;n&&(r.__onHtmlBindingRoot=(a,o)=>{s=n(a,o)});let i=await e(t8,r,e);return s?E(i):De(i)}function sa(t8){if(t8.node.fullName==="srcset"&&(t8.parent.fullName==="img"||t8.parent.fullName==="source"))return()=>aa(L(t8.node))}var Wn={width:"w",height:"h",density:"x"},ia=Object.keys(Wn);function aa(t8){let e=Un(t8),r=ia.filter(l=>e.some(m=>Object.prototype.hasOwnProperty.call(m,l)));if(r.length>1)throw new Error("Mixed descriptor in srcset is not supported");let[n]=r,s=Wn[n],i=e.map(l=>l.source.value),a=Math.max(...i.map(l=>l.length)),o=e.map(l=>l[n]?String(l[n].value):""),u=o.map(l=>{let m=l.indexOf(".");return m===-1?l.length:m}),p=Math.max(...u);return De(Y([",",A],i.map((l,m)=>{let d=[l],C=o[m];if(C){let _2=a-l.length+1,D=p-u[m],P2=" ".repeat(_2+D);d.push(fe(P2," "),C+s)}return d})))}var zn=sa;function oa(t8,e){let{node:r}=t8,n=L(r);if(r.fullName==="class"&&!e.parentParser&&!n.includes("{{"))return()=>n.trim().split(/\s+/).join(" ")}var Gn=oa;function Yn(t8,e){let{node:r}=t8,n=L(t8.node).trim();if(r.fullName==="style"&&!e.parentParser&&!n.includes("{{"))return async s=>De(await s(n,{parser:"css",__isHTMLStyleAttribute:!0}))}async function jn(t8,e,r,n){let s=L(r.node),{left:i,operator:a,right:o}=ua(s),u=$e(r,n);return[E(await x(`function _(${i}) {}`,t8,{parser:u?"babel-ts":"babel",__isVueForBindingLeft:!0}))," ",a," ",await x(o,t8,{parser:u?"__ts_expression":"__js_expression"})]}function ua(t8){let e=/(.*?)\s+(in|of)\s+(.*)/s,r=/,([^,\]}]*)(?:,([^,\]}]*))?$/,n=/^\(|\)$/g,s=t8.match(e);if(!s)return;let i={};if(i.for=s[3].trim(),!i.for)return;let a=v(!1,s[1].trim(),n,""),o=a.match(r);o?(i.alias=a.replace(r,""),i.iterator1=o[1].trim(),o[2]&&(i.iterator2=o[2].trim())):i.alias=a;let u=[i.alias,i.iterator1,i.iterator2];if(!u.some((p,l)=>!p&&(l===0||u.slice(l+1).some(Boolean))))return{left:u.filter(Boolean).join(","),operator:s[2],right:i.for}}function Kn(t8,e,r){let{node:n}=r,s=L(n);return x(`type T<${s}> = any`,t8,{parser:"babel-ts",__isEmbeddedTypescriptGenericParameters:!0},K)}function Qn(t8,e,{
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=>Pa.get(n)??n)}allKnownEventsOfElement(e){return Array.from(this._eventSchema.get(e.toLowerCase())??[])}normalizeAnimationStyleProperty(e){return Nn(e)}normalizeAnimationStyleValue(e,r,n){let s="",i=n.toString().trim(),a=null;if(Na(e)&&n!==0&&n!=="0")if(typeof n=="number")s="px";else{let o=n.match(/^[+-]?[\d\.]+([a-z]*)$/);o&&o[1].length==0&&(a=`Please provide a CSS unit value for ${r}:${n}`)}return{error:a,value:i+s}}};function Na(t8){switch(t8){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 h=class{constructor({closedByChildren:e,implicitNamespacePrefix:r,contentType:n=F.PARSABLE_DATA,closedByParent:s=!1,isVoid:i=!1,ignoreFirstLf:a=!1,preventNamespaceInheritance:o=!1,canSelfClose:u=!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=o,this.canSelfClose=u??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}},Ss,at;function He(t8){return at||(Ss=new h({canSelfClose:!0}),at=Object.assign(Object.create(null),{base:new h({isVoid:!0}),meta:new h({isVoid:!0}),area:new h({isVoid:!0}),embed:new h({isVoid:!0}),link:new h({isVoid:!0}),img:new h({isVoid:!0}),input:new h({isVoid:!0}),param:new h({isVoid:!0}),hr:new h({isVoid:!0}),br:new h({isVoid:!0}),source:new h({isVoid:!0}),track:new h({isVoid:!0}),wbr:new h({isVoid:!0}),p:new h({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 h({closedByChildren:["tbody","tfoot"]}),tbody:new h({closedByChildren:["tbody","tfoot"],closedByParent:!0}),tfoot:new h({closedByChildren:["tbody"],closedByParent:!0}),tr:new h({closedByChildren:["tr"],closedByParent:!0}),td:new h({closedByChildren:["td","th"],closedByParent:!0}),th:new h({closedByChildren:["td","th"],closedByParent:!0}),col:new h({isVoid:!0}),svg:new h({implicitNamespacePrefix:"svg"}),foreignObject:new h({implicitNamespacePrefix:"svg",preventNamespaceInheritance:!0}),math:new h({implicitNamespacePrefix:"math"}),li:new h({closedByChildren:["li"],closedByParent:!0}),dt:new h({closedByChildren:["dt","dd"]}),dd:new h({closedByChildren:["dt","dd"],closedByParent:!0}),rb:new h({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rt:new h({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rtc:new h({closedByChildren:["rb","rtc","rp"],closedByParent:!0}),rp:new h({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),optgroup:new h({closedByChildren:["optgroup"],closedByParent:!0}),option:new h({closedByChildren:["option","optgroup"],closedByParent:!0}),pre:new h({ignoreFirstLf:!0}),listing:new h({ignoreFirstLf:!0}),style:new h({contentType:F.RAW_TEXT}),script:new h({contentType:F.RAW_TEXT}),title:new h({contentType:{default:F.ESCAPABLE
`,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._tokenizeBlocks&&this._attemptCharCode(64)?this._consumeBlockStart(e):this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansionCase()&&!this._isInExpansionForm()&&this._attemptCharCode(125)?this._consumeBlockEnd(e):this._tokenizeIcu&&this._tokenizeExpansionForm()||this._consumeWithInterpolation(5,8,()=>this._isTextEnd(),()=>this._isTagStart())}catch(r){this.handleError(r)}}this._beginToken(30),this._endToken([])}_getBlockName(){let e=!1,r=this._cursor.clone();return this._attemptCharCodeUntilFn(n=>wt(n)?!e:xs(n)?(e=!0,!1):!0),this._cursor.getChars(r).trim()}_consumeBlockStart(e){this._beginToken(25,e);let r=this._endToken([this._getBlockName()]);if(this._cursor.peek()===40)if(this._cursor.advance(),this._consumeBlockParameters(),this._attemptCharCodeUntilFn(k),this._attemptCharCode(41))this._attemptCharCodeUntilFn(k);else{r.type=29;return}this._attemptCharCode(123)?(this._beginToken(26),this._endToken([])):r.type=29}_consumeBlockEnd(e){this._beginToken(27,e),this._endToken([])}_consumeBlockParameters(){for(this._attemptCharCodeUntilFn(ks);this._cursor.peek()!==41&&this._cursor.peek()!==0;){this._beginToken(28);let e=this._cursor.clone(),r=null,n=0;for(;this._cursor.peek()!==59&&this._cursor.peek()!==0||r!==null;){let s=this._cursor.peek();if(s===92)this._cursor.advance();else if(s===r)r=null;else if(r===null&&dr(s))r=s;else if(s===40&&r===null)n++;else if(s===41&&r===null){if(n===0)break;n>0&&n--}this._cursor.advance()}this._endToken([this._cursor.getChars(e)]),this._attemptCharCodeUntilFn(ks)}}_tokenizeExpansionForm(){if(this.isExpansionFormStart())return this._consumeExpansionFormStart(),!0;if(oo(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 ct("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 ct("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 ct(e,this._currentTokenType,r);return this._currentTokenStart=null,this._currentTokenType=null,new pt(n)}handleError(e){if(e instanceof ht&&(e=this._createError(e.msg,this._cursor.getSpan(e.cursor))),e instanceof pt)this.errors.push(e.error);else throw e}_attemptCharCode(e){return this._cursor.peek()===e?(this._cursor.advance(),!0):!1}_attemptCharCodeCaseInsensitive(e){return uo(this._cursor.peek(),e)?(this._cursor.advance(),!0):!1}_requireCharCode(e){let r=this._cursor.clone();if(!this._attemptCharCode(e))throw this._createError(Ue(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._a
`){let n=this._getClosestParentElement();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._getContainer();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,Is):e.type===9?s+=e.parts[0]:s+=e.parts.join("");if(s.length>0){let i=e.sourceSpan;this._addToParent(new Ot(s,new f(n.start,i.end,n.fullStart,n.details),r))}}_closeVoidElement(){let e=this._getContainer();e instanceof z&&this.getTagDefinition(e.name).isVoid&&this._containerStack.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._getClosestParentElement()),a=!1;if(this._peek.type===2){this._advance(),a=!0;let C=this.getTagDefinition(i);this.canSelfClose||C.canSelfClose||Me(i)!==null||C.isVoid||this.errors.push(I.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 o=this._peek.sourceSpan.fullStart,u=new f(e.sourceSpan.start,o,e.sourceSpan.fullStart),p=new f(e.sourceSpan.start,o,e.sourceSpan.fullStart),l=new f(e.sourceSpan.start.moveBy(1),e.sourceSpan.end),m=new z(i,s,[],u,p,void 0,l),d=this._getContainer();this._pushContainer(m,d instanceof z&&this.getTagDefinition(d.name).isClosedByChild(m.name)),a?this._popContainer(i,z,u):e.type===4&&(this._popContainer(i,z,null),this.errors.push(I.create(i,u,`Opening tag "${i}" not terminated.`)))}_pushContainer(e,r){r&&this._containerStack.pop(),this._addToParent(e),this._containerStack.push(e)}_consumeEndTag(e){let r=this.allowHtmComponentClosingTags&&e.parts.length===0?null:this._getElementFullName(e.parts[0],e.parts[1],this._getClosestParentElement());if(r&&this.getTagDefinition(r).isVoid)this.errors.push(I.create(r,e.sourceSpan,`Void elements do not have end tags "${e.parts[1]}"`));else if(!this._popContainer(r,z,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(I.create(r,e.sourceSpan,n))}}_popContainer(e,r,n){let s=!1;for(let i=this._containerStack.length-1;i>=0;i--){let a=this._containerStack[i];if(Me(a.name)?a.name===e:(e==null||a.name.toLowerCase()===e.toLowerCase())&&a instanceof r)return a.endSourceSpan=n,a.sourceSpan.end=n!==null?n.end:a.sourceSpan.end,this._containerStack.splice(i,this._containerStack.length-i),!s;(a instanceof J||a instanceof z&&!this.getTagDefinition(a.name).closedByParent)&&(s=!0)}return!1}_consumeAttr(e){let r=qe(e.parts[0],e.parts[1]),n=e.sourceSpan.end,s;this._peek.type===15&&(s=this._advance());let i="",a=[],o,u;if(this._peek.type===16)for(o=this._peek.sourceSpan,u=this._peek.sourceSpan.end;this._peek.type===16||this._peek.type===17||this._peek.type===9;){let m=this._advance();a.push(m),m.type===17?i+=m.parts.join("").replace(/&([^;]+);/g,Is):m.type===9?i+=m.parts[0]:i+=m.parts.join(""),u=n=m.sourceSpan.end}this._peek.type===15&&(u=n=this._advance().sourceSpan.end);let l=o&&u&&new f(s?.sourceSpan.start??o.start,u,s?.sourceSpan.fullStart??o.fullStart);return new Vt(r,i,new f(e.sourceSpan.start,n,e.sourceSpan.fullStart),e.sourceSpan,l,a.length>0?a:void 0,void 0)}_consumeBlockOpen(e){let r=[];for(;this._peek.type===28;){let o=this._advance();r.push(new ot(o.parts[0],o.sourceSpan))}this._peek.type===26&&this._advance();let n=this._peek.sourceSpan.fullStart,s=new f(e.sourceSpan.start,n,e.sourceSpan.fullStart),i=new f(e.sourceSpan.start,n,e.sourceSpan.fullStart),a=new J(e.parts[0],r,[],s,i);this._pushContainer(a,!1)}_consumeBlockClose(e){this._popContainer(null,J,e.sourceSpan)||this.errors.push(I.create(null,e.sourceSpan,'Unexpected closing block. The block may have been closed earlier. If you meant to write the } character, you should use the "&#125;" HTML entity instead.'))}_consumeIncompleteBlock(e){let r=[];for(;this._peek.type===28;){le
`,i(u.gutter,g.replace(/\d/g," "))," ",$,i(u.marker,"^").repeat(Q2)].join(""),B&&r.message&&(Z+=" "+i(u.message,r.message))}return[i(u.marker,">"),i(u.gutter,g),F2.length>0?` ${F2}`:"",Z].join("")}else return` ${i(u.gutter,g)}${F2.length>0?` ${F2}`:""}`}).join(`
`);return r.message&&!d&&(l=`${" ".repeat(f2+1)}${r.message}
${l}`),n?o.reset(l):l}function ao2(e,t8,r,n={}){if(!En2){En2=!0;let u="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";{let i=new Error(u);i.name="DeprecationWarning",console.warn(new Error(u))}}return r=Math.max(r,0),gn2(e,{start:{column:r,line:t8}},n)}}),tr2={};We(tr2,{__debug:()=>ri2,check:()=>ei2,doc:()=>er2,format:()=>cu,formatWithCursor:()=>au,getSupportInfo:()=>ti2,util:()=>Qt2,version:()=>Du});var hu=(e,t8,r,n)=>{if(!(e&&t8==null))return t8.replaceAll?t8.replaceAll(r,n):r.global?t8.replace(r,n):t8.split(r).join(n)},ee2=hu,Kn2=he2(ir2(),1),M="string",j2="array",W2="cursor",T2="indent",S2="align",v2="trim",_="group",k2="fill",x2="if-break",P="indent-if-break",L2="line-suffix",I2="line-suffix-boundary",A2="line",O2="label",b2="break-parent",Ue2=new Set([W2,T2,S2,v2,_,k2,x2,P,L2,I2,A2,O2,b2]);function xu(e){if(typeof e=="string")return M;if(Array.isArray(e))return j2;if(!e)return;let{type:t8}=e;if(Ue2.has(t8))return t8}var U2=xu,ku=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function bu(e){let t8=e===null?"null":typeof e;if(t8!=="string"&&t8!=="object")return`Unexpected doc '${t8}',
Expected it to be 'string' or 'object'.`;if(U2(e))throw new Error("doc is valid.");let r=Object.prototype.toString.call(e);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=ku([...Ue2].map(o=>`'${o}'`));return`Unexpected doc.type '${e.type}'.
Expected it to be ${n}.`}var yt2=class extends Error{name="InvalidDocError";constructor(t8){super(bu(t8)),this.doc=t8}},q=yt2,sr2={};function wu(e,t8,r,n){let o=[e];for(;o.length>0;){let u=o.pop();if(u===sr2){r(o.pop());continue}r&&o.push(u,sr2);let i=U2(u);if(!i)throw new q(u);if(t8?.(u)!==!1)switch(i){case j2:case k2:{let s=i===j2?u:u.parts;for(let D=s.length,a=D-1;a>=0;--a)o.push(s[a]);break}case x2:o.push(u.flatContents,u.breakContents);break;case _:if(n&&u.expandedStates)for(let s=u.expandedStates.length,D=s-1;D>=0;--D)o.push(u.expandedStates[D]);else o.push(u.contents);break;case S2:case T2:case P:case O2:case L2:o.push(u.contents);break;case M:case W2:case v2:case I2:case A2:case b2:break;default:throw new q(u)}}}var Ae2=wu,Dr2=()=>{},ze=Dr2;function ie2(e){return{type:T2,contents:e}}function oe2(e,t8){return{type:S2,contents:t8,n:e}}function At2(e,t8={}){return ze(t8.expandedStates),{type:_,id:t8.id,contents:e,break:!!t8.shouldBreak,expandedStates:t8.expandedStates}}function ar2(e){return oe2(Number.NEGATIVE_INFINITY,e)}function cr2(e){return oe2({type:"root"},e)}function lr2(e){return oe2(-1,e)}function fr2(e,t8){return At2(e[0],{...t8,expandedStates:e})}function Ge2(e){return{type:k2,parts:e}}function Fr2(e,t8="",r={}){return{type:x2,breakContents:e,flatContents:t8,groupId:r.groupId}}function pr2(e,t8){return{type:P,contents:e,groupId:t8.groupId,negate:t8.negate}}function Be2(e){return{type:L2,contents:e}}var dr2={type:I2},le2={type:b2},mr2={type:v2},_e2={type:A2,hard:!0},Bt2={type:A2,hard:!0,literal:!0},Ke2={type:A2},Er2={type:A2,soft:!0},G2=[_e2,le2],He2=[Bt2,le2],xe2={type:W2};function ke2(e,t8){let r=[];for(let n=0;n<t8.length;n++)n!==0&&r.push(e),r.push(t8[n]);return r}function qe2(e,t8,r){let n=e;if(t8>0){for(let o=0;o<Math.floor(t8/r);++o)n=ie2(n);n=oe2(t8%r,n),n=oe2(Number.NEGATIVE_INFINITY,n)}return n}function Cr2(e,t8){return e?{type:O2,label:e,contents:t8}:t8}var Ou=(e,t8,r)=>{if(!(e&&t8==null))return Array.isArray(t8)||typeof t8=="string"?t8[r<0?t8.length+r:r]:t8.at(r)},y=Ou;function hr2(e){let t8=e.indexOf("\r");return t8>=0?e.charAt(t8+1)===`
`?"crlf":"cr":"lf"}function be2(e){switch(e){case"cr":return"\r";case"crlf":return`\r
`;default:return`
`}}function _t2(e,t8){let r;switch(t8){case`
`:r=/\n/g;break;case"\r":r=/\r/g;break;case`\r
`:r=/\r\n/g;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(t8)}.`)}let n=e.match(r);return n?n.length:0}function gr2(e){return ee2(!1,e,/\r\n?/g,`
`)}var yr2=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uD
`)):r)}function Iu(e){if(e.type===A2)return!0}function Sr2(e){return Je2(e,Iu,!1)}function Ze2(e,t8){return e.type===O2?{...e,contents:t8(e.contents)}:t8(e)}var R2=Symbol("MODE_BREAK"),K2=Symbol("MODE_FLAT"),Te2=Symbol("cursor");function vr2(){return{value:"",length:0,queue:[]}}function Ru(e,t8){return xt2(e,{type:"indent"},t8)}function Yu(e,t8,r){return t8===Number.NEGATIVE_INFINITY?e.root||vr2():t8<0?xt2(e,{type:"dedent"},r):t8?t8.type==="root"?{...e,root:e}:xt2(e,{type:typeof t8=="string"?"stringAlign":"numberAlign",n:t8},r):e}function xt2(e,t8,r){let n=t8.type==="dedent"?e.queue.slice(0,-1):[...e.queue,t8],o="",u=0,i=0,s=0;for(let l of n)switch(l.type){case"indent":c(),r.useTabs?D(1):a(r.tabWidth);break;case"stringAlign":c(),o+=l.n,u+=l.n.length;break;case"numberAlign":i+=1,s+=l.n;break;default:throw new Error(`Unexpected type '${l.type}'`)}return f2(),{...e,value:o,length:u,queue:n};function D(l){o+=" ".repeat(l),u+=r.tabWidth*l}function a(l){o+=" ".repeat(l),u+=l}function c(){r.useTabs?d():f2()}function d(){i>0&&D(i),p()}function f2(){s>0&&a(s),p()}function p(){i=0,s=0}}function kt2(e){let t8=0,r=0,n=e.length;e:for(;n--;){let o=e[n];if(o===Te2){r++;continue}for(let u=o.length-1;u>=0;u--){let i=o[u];if(i===" "||i===" ")t8++;else{e[n]=o.slice(0,u+1);break e}}}if(t8>0||r>0)for(e.length=n+1;r-- >0;)e.push(Te2);return t8}function Qe2(e,t8,r,n,o,u){if(r===Number.POSITIVE_INFINITY)return!0;let i=t8.length,s=[e],D=[];for(;r>=0;){if(s.length===0){if(i===0)return!0;s.push(t8[--i]);continue}let{mode:a,doc:c}=s.pop();switch(U2(c)){case M:D.push(c),r-=we2(c);break;case j2:case k2:{let d=br2(c);for(let f2=d.length-1;f2>=0;f2--)s.push({mode:a,doc:d[f2]});break}case T2:case S2:case P:case O2:s.push({mode:a,doc:c.contents});break;case v2:r+=kt2(D);break;case _:{if(u&&c.break)return!1;let d=c.break?R2:a,f2=c.expandedStates&&d===R2?y(!1,c.expandedStates,-1):c.contents;s.push({mode:d,doc:f2});break}case x2:{let f2=(c.groupId?o[c.groupId]||K2:a)===R2?c.breakContents:c.flatContents;f2&&s.push({mode:a,doc:f2});break}case A2:if(a===R2||c.hard)return!0;c.soft||(D.push(" "),r--);break;case L2:n=!0;break;case I2:if(n)return!1;break}}return!1}function fe2(e,t8){let r={},n=t8.printWidth,o=be2(t8.endOfLine),u=0,i=[{ind:vr2(),mode:R2,doc:e}],s=[],D=!1,a=[],c=0;for(Or2(e);i.length>0;){let{ind:f2,mode:p,doc:l}=i.pop();switch(U2(l)){case M:{let F2=o!==`
`?ee2(!1,l,`
`,o):l;s.push(F2),i.length>0&&(u+=we2(F2));break}case j2:for(let F2=l.length-1;F2>=0;F2--)i.push({ind:f2,mode:p,doc:l[F2]});break;case W2:if(c>=2)throw new Error("There are too many 'cursor' in doc.");s.push(Te2),c++;break;case T2:i.push({ind:Ru(f2,t8),mode:p,doc:l.contents});break;case S2:i.push({ind:Yu(f2,l.n,t8),mode:p,doc:l.contents});break;case v2:u-=kt2(s);break;case _:switch(p){case K2:if(!D){i.push({ind:f2,mode:l.break?R2:K2,doc:l.contents});break}case R2:{D=!1;let F2={ind:f2,mode:K2,doc:l.contents},m=n-u,E2=a.length>0;if(!l.break&&Qe2(F2,i,m,E2,r))i.push(F2);else if(l.expandedStates){let C=y(!1,l.expandedStates,-1);if(l.break){i.push({ind:f2,mode:R2,doc:C});break}else for(let g=1;g<l.expandedStates.length+1;g++)if(g>=l.expandedStates.length){i.push({ind:f2,mode:R2,doc:C});break}else{let h2=l.expandedStates[g],B={ind:f2,mode:K2,doc:h2};if(Qe2(B,i,m,E2,r)){i.push(B);break}}}else i.push({ind:f2,mode:R2,doc:l.contents});break}}l.id&&(r[l.id]=y(!1,i,-1).mode);break;case k2:{let F2=n-u,{parts:m}=l;if(m.length===0)break;let[E2,C]=m,g={ind:f2,mode:K2,doc:E2},h2={ind:f2,mode:R2,doc:E2},B=Qe2(g,[],F2,a.length>0,r,!0);if(m.length===1){B?i.push(g):i.push(h2);break}let Z={ind:f2,mode:K2,doc:C},$={ind:f2,mode:R2,doc:C};if(m.length===2){B?i.push(Z,g):i.push($,h2);break}m.splice(0,2);let Q2={ind:f2,mode:p,doc:Ge2(m)},rr2=m[0];Qe2({ind:f2,mode:K2,doc:[E2,C,rr2]},[],F2,a.length>0,r,!0)?i.push(Q2,Z,g):B?i.push(Q2,$,g):i.push(Q2,$,h2);break}case x2:case P:{let F2=l.groupId?r[l.groupId]:p;if(F2===R2){let m=l.type===x2?l.breakContents:l.negate?l.contents:ie2(l.contents);m&&i.push({ind:f2,mode:p,doc:m})}if(F2===K2){let m=l.type===x2?l.flatContents:l.negate?ie2(l.contents):l.contents;m&&i.push({ind:f2,mode:p,doc:m})}break}case L2:a.push({ind:f2,mode:p,doc:l.contents});break;case I2:a.length>0&&i.push({ind:f2,mode:p,doc:_e2});break;case A2:switch(p){case K2:if(l.hard)D=!0;else{l.soft||(s.push(" "),u+=1);break}case R2:if(a.length>0){i.push({ind:f2,mode:p,doc:l},...a.reverse()),a.length=0;break}l.literal?f2.root?(s.push(o,f2.root.value),u=f2.root.length):(s.push(o),u=0):(u-=kt2(s),s.push(o+f2.value),u=f2.length);break}break;case O2:i.push({ind:f2,mode:p,doc:l.contents});break;case b2:break;default:throw new q(l)}i.length===0&&a.length>0&&(i.push(...a.reverse()),a.length=0)}let d=s.indexOf(Te2);if(d!==-1){let f2=s.indexOf(Te2,d+1),p=s.slice(0,d).join(""),l=s.slice(d+1,f2).join(""),F2=s.slice(f2+1).join("");return{formatted:p+l+F2,cursorNodeStart:p.length,cursorNodeText:l}}return{formatted:s.join("")}}function J2(e){var t8;if(!e)return"";if(Array.isArray(e)){let r=[];for(let n of e)if(Array.isArray(n))r.push(...J2(n));else{let o=J2(n);o!==""&&r.push(o)}return r}return e.type===x2?{...e,breakContents:J2(e.breakContents),flatContents:J2(e.flatContents)}:e.type===_?{...e,contents:J2(e.contents),expandedStates:(t8=e.expandedStates)==null?void 0:t8.map(J2)}:e.type===k2?{type:"fill",parts:e.parts.map(J2)}:e.contents?{...e,contents:J2(e.contents)}:e}function Pr2(e){let t8=Object.create(null),r=new Set;return n(J2(e));function n(u,i,s){var D,a;if(typeof u=="string")return JSON.stringify(u);if(Array.isArray(u)){let c=u.map(n).filter(Boolean);return c.length===1?c[0]:`[${c.join(", ")}]`}if(u.type===A2){let c=((D=s?.[i+1])==null?void 0:D.type)===b2;return u.literal?c?"literalline":"literallineWithoutBreakParent":u.hard?c?"hardline":"hardlineWithoutBreakParent":u.soft?"softline":"line"}if(u.type===b2)return((a=s?.[i-1])==null?void 0:a.type)===A2&&s[i-1].hard?void 0:"breakParent";if(u.type===v2)return"trim";if(u.type===T2)return"indent("+n(u.contents)+")";if(u.type===S2)return u.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+n(u.contents)+")":u.n<0?"dedent("+n(u.contents)+")":u.n.type==="root"?"markAsRoot("+n(u.contents)+")":"align("+JSON.stringify(u.n)+", "+n(u.contents)+")";if(u.type===x2)return"ifBreak("+n(u.breakContents)+(u.flatContents?", "+n(u.flatContents):"")+(u.groupId?(u.flatContents?"":', ""')+`, { groupId: ${o(u.groupId)} }`:"")+")";if(u.type===P){let c=[];u.negate&&c.push("negate: true"),u.groupId&&c.push(`groupId: ${o(u.groupId)}`);let d=c
(mixed values within one file are normalised by looking at what's used after the first line)`}]},filepath:{category:"Special",type:"path",description:"Specify the input filepath. This will be used to do parser inference.",cliName:"stdin-filepath",cliCategory:"Other",cliDescription:"Path to the file to pretend that stdin comes from."},insertPragma:{category:"Special",type:"boolean",default:!1,description:"Insert @format pragma into file's first docblock comment.",cliCategory:"Other"},parser:{category:"Global",type:"choice",default:void 0,description:"Which parser to use.",exception:e=>typeof e=="string"||typeof e=="function",choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>typeof e=="string"||typeof e=="object",cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:`Format code ending at a given character offset (exclusive).
The range will extend forwards to the end of the selected statement.`,cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:`Format code starting at a given character offset.
The range will extend backwards to the start of the first line containing the selected statement.`,cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:`Require either '@prettier' or '@format' to be present in the file's first docblock comment
in order for it to be formatted.`,cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function et2({plugins:e=[],showDeprecated:t8=!1}={}){let r=e.flatMap(o=>o.languages??[]),n=[];for(let o of $u(Object.assign({},...e.map(({options:u})=>u),Lr)))!t8&&o.deprecated||(Array.isArray(o.choices)&&(t8||(o.choices=o.choices.filter(u=>!u.deprecated)),o.name==="parser"&&(o.choices=[...o.choices,...Vu(o.choices,r,e)])),o.pluginDefaults=Object.fromEntries(e.filter(u=>{var i;return((i=u.defaultOptions)==null?void 0:i[o.name])!==void 0}).map(u=>[u.name,u.defaultOptions[o.name]])),n.push(o));return{languages:r,options:n}}function*Vu(e,t8,r){let n=new Set(e.map(o=>o.value));for(let o of t8)if(o.parsers){for(let u of o.parsers)if(!n.has(u)){n.add(u);let i=r.find(D=>D.parsers&&Object.prototype.hasOwnProperty.call(D.parsers,u)),s=o.name;i!=null&&i.name&&(s+=` (plugin: ${i.name})`),yield{value:u,description:s}}}}function $u(e){let t8=[];for(let[r,n]of Object.entries(e)){let o={name:r,...n};Array.isArray(o.default)&&(o.default=y(!1,o.default,-1).value),t8.push(o)}return t8}var Mu=e=>String(e).split(/[/\\]/).pop();function Ir(e,t8){if(!t8)return;let r=Mu(t8).toLowerCase();return e.find(n=>{var o,u;return((o=n.extensions)==null?void 0:o.some(i=>r.endsWith(i)))||((u=n.filenames)==null?void 0:u.some(i=>i.toLowerCase()===r))})}function Wu(e,t8){if(t8)return e.find(({name:r})=>r.toLowerCase()===t8)??e.find(({aliases:r})=>r?.includes(t8))??e.find(({extensions:r})=>r?.includes(`.${t8}`))}function Uu(e,t8){let r=e.plugins.flatMap(o=>o.languages??[]);return(Wu(r,t8.language)??Ir(r,t8.physicalFile)??Ir(r,t8.file)??(t8.physicalFile,void 0))?.parsers[0]}var Rr=Uu,te2={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(e===null||typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(r=>te2.value(r)).join(", ")}]`;let t8=Object.keys(e);return t8.length===0?"{}":`{ ${t8.map(r=>`${te2.key(r)}: ${te2.value(e[r])}`).join(", ")} }`},pair:({key:e,value:t8})=>te2.value({[e]:t8})},bt2=he2(Pe2(),1),Vr2=(e,t8,{descriptor:r})=>{let n=[`${bt2.default.yellow(typeof e=="string"?r.key(e):r.pair(e))} is deprecated`];return t8&&n.push(`we now treat it as ${bt2.default.blue(typeof t8=="string"?r.key(t8):r.pair(t8))}`),n.join("; ")+"."},se2=he2(Pe2(),1),tt2=Symbol.for("vnopts.VALUE_NOT_EXIST"),pe2=Symbol.for("vnopts.VALUE_UNCHANGED"),$r2=" ".repeat(2),Wr=(e,t8,r)=>{let{text:n,list:o}=r.normalizeExpectedResult(r.schemas[e].expected(r)),u=[];return n&&u.push(Mr2(e,t8,n,r.descriptor)),o&&u.push([Mr2(e,t8,o.title,r.descriptor)].concat(o.values.map(i=>Ur2(i,r.loggerPrintWidth))).join(`
`)),zr(u,r.loggerPrintWidth)};function Mr2(e,t8,r,n){return[`Invalid ${se2.default.red(n.key(e))} value.`,`Expected ${se2.default.blue(r)},`,`but received ${t8===tt2?se2.default.gray("nothing"):se2.default.red(n.value(t8))}.`].join(" ")}function Ur2({text:e,list:t8},r){let n=[];return e&&n.push(`- ${se2.default.blue(e)}`),t8&&n.push([`- ${se2.default.blue(t8.title)}:`].concat(t8.values.map(o=>Ur2(o,r-$r2.length).replace(/^|\n/g,`$&${$r2}`))).join(`
`)),zr(n,r)}function zr(e,t8){if(e.length===1)return e[0];let[r,n]=e,[o,u]=e.map(i=>i.split(`
`,1)[0].length);return o>t8&&o>u?n:r}var Nt2=he2(Pe2(),1),wt2=[],Gr=[];function Ot2(e,t8){if(e===t8)return 0;let r=e;e.length>t8.length&&(e=t8,t8=r);let n=e.length,o=t8.length;for(;n>0&&e.charCodeAt(~-n)===t8.charCodeAt(~-o);)n--,o--;let u=0;for(;u<n&&e.charCodeAt(u)===t8.charCodeAt(u);)u++;if(n-=u,o-=u,n===0)return o;let i,s,D,a,c=0,d=0;for(;c<n;)Gr[c]=e.charCodeAt(u+c),wt2[c]=++c;for(;d<o;)for(i=t8.charCodeAt(u+d),D=d++,s=d,c=0;c<n;c++)a=i===Gr[c]?D:D+1,D=wt2[c],s=wt2[c]=D>s?a>s?s+1:a:a>D?D+1:a;return s}var rt2=(e,t8,{descriptor:r,logger:n,schemas:o})=>{let u=[`Ignored unknown option ${Nt2.default.yellow(r.pair({key:e,value:t8}))}.`],i=Object.keys(o).sort().find(s=>Ot2(e,s)<3);i&&u.push(`Did you mean ${Nt2.default.blue(r.key(i))}?`),n.warn(u.join(" "))},zu=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"];function Gu(e,t8){let r=new e(t8),n=Object.create(r);for(let o of zu)o in t8&&(n[o]=Ku(t8[o],r,w.prototype[o].length));return n}var w=class{static create(t8){return Gu(this,t8)}constructor(t8){this.name=t8.name}default(t8){}expected(t8){return"nothing"}validate(t8,r){return!1}deprecated(t8,r){return!1}forward(t8,r){}redirect(t8,r){}overlap(t8,r,n){return t8}preprocess(t8,r){return t8}postprocess(t8,r){return pe2}};function Ku(e,t8,r){return typeof e=="function"?(...n)=>e(...n.slice(0,r-1),t8,...n.slice(r-1)):()=>e}var nt2=class extends w{constructor(t8){super(t8),this._sourceName=t8.sourceName}expected(t8){return t8.schemas[this._sourceName].expected(t8)}validate(t8,r){return r.schemas[this._sourceName].validate(t8,r)}redirect(t8,r){return this._sourceName}},ut2=class extends w{expected(){return"anything"}validate(){return!0}},ot2=class extends w{constructor({valueSchema:t8,name:r=t8.name,...n}){super({...n,name:r}),this._valueSchema=t8}expected(t8){let{text:r,list:n}=t8.normalizeExpectedResult(this._valueSchema.expected(t8));return{text:r&&`an array of ${r}`,list:n&&{title:"an array of the following values",values:[{list:n}]}}}validate(t8,r){if(!Array.isArray(t8))return!1;let n=[];for(let o of t8){let u=r.normalizeValidateResult(this._valueSchema.validate(o,r),o);u!==!0&&n.push(u.value)}return n.length===0?!0:{value:n}}deprecated(t8,r){let n=[];for(let o of t8){let u=r.normalizeDeprecatedResult(this._valueSchema.deprecated(o,r),o);u!==!1&&n.push(...u.map(({value:i})=>({value:[i]})))}return n}forward(t8,r){let n=[];for(let o of t8){let u=r.normalizeForwardResult(this._valueSchema.forward(o,r),o);n.push(...u.map(Kr2))}return n}redirect(t8,r){let n=[],o=[];for(let u of t8){let i=r.normalizeRedirectResult(this._valueSchema.redirect(u,r),u);"remain"in i&&n.push(i.remain),o.push(...i.redirect.map(Kr2))}return n.length===0?{redirect:o}:{redirect:o,remain:n}}overlap(t8,r){return t8.concat(r)}};function Kr2({from:e,to:t8}){return{from:[e],to:t8}}var it2=class extends w{expected(){return"true or false"}validate(t8){return typeof t8=="boolean"}};function qr2(e,t8){let r=Object.create(null);for(let n of e){let o=n[t8];if(r[o])throw new Error(`Duplicate ${t8} ${JSON.stringify(o)}`);r[o]=n}return r}function Jr2(e,t8){let r=new Map;for(let n of e){let o=n[t8];if(r.has(o))throw new Error(`Duplicate ${t8} ${JSON.stringify(o)}`);r.set(o,n)}return r}function Xr2(){let e=Object.create(null);return t8=>{let r=JSON.stringify(t8);return e[r]?!0:(e[r]=!0,!1)}}function Zr2(e,t8){let r=[],n=[];for(let o of e)t8(o)?r.push(o):n.push(o);return[r,n]}function Qr2(e){return e===Math.floor(e)}function en2(e,t8){if(e===t8)return 0;let r=typeof e,n=typeof t8,o=["undefined","object","boolean","number","string"];return r!==n?o.indexOf(r)-o.indexOf(n):r!=="string"?Number(e)-Number(t8):e.localeCompare(t8)}function tn2(e){return(...t8)=>{let r=e(...t8);return typeof r=="string"?new Error(r):r}}function Tt2(e){return e===void 0?{}:e}function St2(e){if(typeof e=="string")return{text:e};let{text:t8,list:r}=e;return Hu((t8||r)!==void 0,"Unexpected `expected` result, there should be at least one field."),r?{text:t8,list:{title:r.title,values:r.values.map(St2)}}:{text:t8}}function vt2(e,t8){return e===!0?!0
`+n,e.codeFrame=n,e}throw e}var De2=co2,Ie,$t2,de2,pt2,Vt2=class{constructor(t8){ht2(this,Ie),ht2(this,de2),this.stack=[t8]}get key(){let{stack:t8,siblings:r}=this;return y(!1,t8,r===null?-2:-4)??null}get index(){return this.siblings===null?null:y(!1,this.stack,-2)}get node(){return y(!1,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return this.siblings!==null}get siblings(){let{stack:t8}=this,r=y(!1,t8,-3);return Array.isArray(r)?r:null}get next(){let{siblings:t8}=this;return t8===null?null:t8[this.index+1]}get previous(){let{siblings:t8}=this;return t8===null?null:t8[this.index-1]}get isFirst(){return this.index===0}get isLast(){let{siblings:t8,index:r}=this;return t8!==null&&r===t8.length-1}get isRoot(){return this.stack.length===1}get root(){return this.stack[0]}get ancestors(){return[...ce2(this,de2,pt2).call(this)]}getName(){let{stack:t8}=this,{length:r}=t8;return r>1?y(!1,t8,-2):null}getValue(){return y(!1,this.stack,-1)}getNode(t8=0){let r=ce2(this,Ie,$t2).call(this,t8);return r===-1?null:this.stack[r]}getParentNode(t8=0){return this.getNode(t8+1)}call(t8,...r){let{stack:n}=this,{length:o}=n,u=y(!1,n,-1);for(let i of r)u=u[i],n.push(i,u);try{return t8(this)}finally{n.length=o}}callParent(t8,r=0){let n=ce2(this,Ie,$t2).call(this,r+1),o=this.stack.splice(n+1);try{return t8(this)}finally{this.stack.push(...o)}}each(t8,...r){let{stack:n}=this,{length:o}=n,u=y(!1,n,-1);for(let i of r)u=u[i],n.push(i,u);try{for(let i=0;i<u.length;++i)n.push(i,u[i]),t8(this,i,u),n.length-=2}finally{n.length=o}}map(t8,...r){let n=[];return this.each((o,u,i)=>{n[u]=t8(o,u,i)},...r),n}match(...t8){let r=this.stack.length-1,n=null,o=this.stack[r--];for(let u of t8){if(o===void 0)return!1;let i=null;if(typeof n=="number"&&(i=n,n=this.stack[r--],o=this.stack[r--]),u&&!u(o,n,i))return!1;n=this.stack[r--],o=this.stack[r--]}return!0}findAncestor(t8){for(let r of ce2(this,de2,pt2).call(this))if(t8(r))return r}hasAncestor(t8){for(let r of ce2(this,de2,pt2).call(this))if(t8(r))return!0;return!1}};Ie=new WeakSet,$t2=function(t8){let{stack:r}=this;for(let n=r.length-1;n>=0;n-=2)if(!Array.isArray(r[n])&&--t8<0)return n;return-1},de2=new WeakSet,pt2=function*(){let{stack:t8}=this;for(let r=t8.length-3;r>=0;r-=2){let n=t8[r];Array.isArray(n)||(yield n)}};var Bn2=Vt2,_n2=new Proxy(()=>{},{get:()=>_n2}),Re2=_n2;function me2(e){return(t8,r,n)=>{let o=!!(n!=null&&n.backwards);if(r===!1)return!1;let{length:u}=t8,i=r;for(;i>=0&&i<u;){let s=t8.charAt(i);if(e instanceof RegExp){if(!e.test(s))return i}else if(!e.includes(s))return i;o?i--:i++}return i===-1||i===u?i:!1}}var xn2=me2(/\s/),N2=me2(" "),dt2=me2(",; "),mt2=me2(/[^\n\r]/);function fo2(e,t8,r){let n=!!(r!=null&&r.backwards);if(t8===!1)return!1;let o=e.charAt(t8);if(n){if(e.charAt(t8-1)==="\r"&&o===`
`)return t8-2;if(o===`
`||o==="\r"||o==="\u2028"||o==="\u2029")return t8-1}else{if(o==="\r"&&e.charAt(t8+1)===`
`)return t8+2;if(o===`
`||o==="\r"||o==="\u2028"||o==="\u2029")return t8+1}return t8}var Y2=fo2;function Fo(e,t8,r={}){let n=N2(e,r.backwards?t8-1:t8,r),o=Y2(e,n,r);return n!==o}var V2=Fo;function po2(e){return Array.isArray(e)&&e.length>0}var Mt2=po2;function mo2(e){return e!==null&&typeof e=="object"}var kn2=mo2;function*Wt2(e,t8){let{getVisitorKeys:r,filter:n=()=>!0}=t8,o=u=>kn2(u)&&n(u);for(let u of r(e)){let i=e[u];if(Array.isArray(i))for(let s of i)o(s)&&(yield s);else o(i)&&(yield i)}}function*bn2(e,t8){let r=[e];for(let n=0;n<r.length;n++){let o=r[n];for(let u of Wt2(o,t8))yield u,r.push(u)}}function Eo2(e){let t8=e.type||e.kind||"(unknown type)",r=String(e.name||e.id&&(typeof e.id=="object"?e.id.name:e.id)||e.key&&(typeof e.key=="object"?e.key.name:e.key)||e.value&&(typeof e.value=="object"?"":String(e.value))||e.operator||"");return r.length>20&&(r=r.slice(0,19)+"\u2026"),t8+(r?" "+r:"")}function Ut2(e,t8){(e.comments??(e.comments=[])).push(t8),t8.printed=!1,t8.nodeDescription=Eo2(e)}function ne2(e,t8){t8.leading=!0,t8.trailing=!1,Ut2(e,t8)}function X2(e,t8,r){t8.leading=!1,t8.trailing=!1,r&&(t8.marker=r),Ut2(e,t8)}function ue2(e,t8){t8.leading=!1,t8.trailing=!0,Ut2(e,t8)}var zt2=new WeakMap;function Et2(e,t8){if(zt2.has(e))return zt2.get(e);let{printer:{getCommentChildNodes:r,canAttachComment:n,getVisitorKeys:o},locStart:u,locEnd:i}=t8;if(!n)return[];let s=(r?.(e,t8)??[...Wt2(e,{getVisitorKeys:H2(o)})]).flatMap(D=>n(D)?[D]:Et2(D,t8));return s.sort((D,a)=>u(D)-u(a)||i(D)-i(a)),zt2.set(e,s),s}function On2(e,t8,r,n){let{locStart:o,locEnd:u}=r,i=o(t8),s=u(t8),D=Et2(e,r),a,c,d=0,f2=D.length;for(;d<f2;){let p=d+f2>>1,l=D[p],F2=o(l),m=u(l);if(F2<=i&&s<=m)return On2(l,t8,r,l);if(m<=i){a=l,d=p+1;continue}if(s<=F2){c=l,f2=p;continue}throw new Error("Comment location overlaps with node location")}if(n?.type==="TemplateLiteral"){let{quasis:p}=n,l=Kt2(p,t8,r);a&&Kt2(p,a,r)!==l&&(a=null),c&&Kt2(p,c,r)!==l&&(c=null)}return{enclosingNode:n,precedingNode:a,followingNode:c}}var Gt=()=>!1;function Nn2(e,t8){let{comments:r}=e;if(delete e.comments,!Mt2(r)||!t8.printer.canAttachComment)return;let n=[],{locStart:o,locEnd:u,printer:{experimentalFeatures:{avoidAstMutation:i=!1}={},handleComments:s={}},originalText:D}=t8,{ownLine:a=Gt,endOfLine:c=Gt,remaining:d=Gt}=s,f2=r.map((p,l)=>({...On2(e,p,t8),comment:p,text:D,options:t8,ast:e,isLastComment:r.length-1===l}));for(let[p,l]of f2.entries()){let{comment:F2,precedingNode:m,enclosingNode:E2,followingNode:C,text:g,options:h2,ast:B,isLastComment:Z}=l;if(h2.parser==="json"||h2.parser==="json5"||h2.parser==="__js_expression"||h2.parser==="__ts_expression"||h2.parser==="__vue_expression"||h2.parser==="__vue_ts_expression"){if(o(F2)-o(B)<=0){ne2(B,F2);continue}if(u(F2)-u(B)>=0){ue2(B,F2);continue}}let $;if(i?$=[l]:(F2.enclosingNode=E2,F2.precedingNode=m,F2.followingNode=C,$=[F2,g,h2,B,Z]),Co2(g,h2,f2,p))F2.placement="ownLine",a(...$)||(C?ne2(C,F2):m?ue2(m,F2):X2(E2||B,F2));else if(ho2(g,h2,f2,p))F2.placement="endOfLine",c(...$)||(m?ue2(m,F2):C?ne2(C,F2):X2(E2||B,F2));else if(F2.placement="remaining",!d(...$))if(m&&C){let Q2=n.length;Q2>0&&n[Q2-1].followingNode!==C&&wn2(n,h2),n.push(l)}else m?ue2(m,F2):C?ne2(C,F2):X2(E2||B,F2)}if(wn2(n,t8),!i)for(let p of r)delete p.precedingNode,delete p.enclosingNode,delete p.followingNode}var Tn2=e=>!/[\S\n\u2028\u2029]/.test(e);function Co2(e,t8,r,n){let{comment:o,precedingNode:u}=r[n],{locStart:i,locEnd:s}=t8,D=i(o);if(u)for(let a=n-1;a>=0;a--){let{comment:c,precedingNode:d}=r[a];if(d!==u||!Tn2(e.slice(s(c),D)))break;D=i(c)}return V2(e,D,{backwards:!0})}function ho2(e,t8,r,n){let{comment:o,followingNode:u}=r[n],{locStart:i,locEnd:s}=t8,D=s(o);if(u)for(let a=n+1;a<r.length;a++){let{comment:c,followingNode:d}=r[a];if(d!==u||!Tn2(e.slice(D,i(c))))break;D=s(c)}return V2(e,D)}function wn2(e,t8){var s,D;let r=e.length;if(r===0)return;let{precedingNode:n,followingNode:o}=e[0],u=t8.locStart(o),i;for(i=r;i>0;--i){let{comment:a,precedingNode:c,followingNode:d}=e[i-1];Re2.strictEqual(c,n),Re2.strictEqual(d,o);let f2=t8.originalText.slice(t8.locEnd(a),u);if(((D=(s=t8.printer).isGap)==null
`,o)+1),D=n.slice(s,o).match(/^\s*/)[0],a=Fe2(D,t8.tabWidth),c=await qn2(i,{...t8,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:t8.cursorOffset>o&&t8.cursorOffset<=u?t8.cursorOffset-o:-1,endOfLine:"lf"},a),d=c.formatted.trimEnd(),{cursorOffset:f2}=t8;f2>u?f2+=d.length-i.length:c.cursorOffset>=0&&(f2=c.cursorOffset+o);let p=n.slice(0,o)+d+n.slice(u);if(t8.endOfLine!=="lf"){let l=be2(t8.endOfLine);f2>=0&&l===`\r
`&&(f2+=_t2(p.slice(0,f2),`
`)),p=ee2(!1,p,`
`,l)}return{formatted:p,cursorOffset:f2,comments:c.comments}}function Jt2(e,t8,r){return typeof t8!="number"||Number.isNaN(t8)||t8<0||t8>e.length?r:t8}function zn2(e,t8){let{cursorOffset:r,rangeStart:n,rangeEnd:o}=t8;return r=Jt2(e,r,-1),n=Jt2(e,n,0),o=Jt2(e,o,e.length),{...t8,cursorOffset:r,rangeStart:n,rangeEnd:o}}function Jn2(e,t8){let{cursorOffset:r,rangeStart:n,rangeEnd:o,endOfLine:u}=zn2(e,t8),i=e.charAt(0)===Hn2;if(i&&(e=e.slice(1),r--,n--,o--),u==="auto"&&(u=hr2(e)),e.includes("\r")){let s=D=>_t2(e.slice(0,Math.max(D,0)),`\r
`);r-=s(r),n-=s(n),o-=s(o),e=gr2(e)}return{hasBOM:i,text:e,options:zn2(e,{...t8,cursorOffset:r,rangeStart:n,rangeEnd:o,endOfLine:u})}}async function Gn2(e,t8){let r=await ft2(t8);return!r.hasPragma||r.hasPragma(e)}async function Xt2(e,t8){let{hasBOM:r,text:n,options:o}=Jn2(e,await re2(t8));if(o.rangeStart>=o.rangeEnd&&n!==""||o.requirePragma&&!await Gn2(n,o))return{formatted:e,cursorOffset:t8.cursorOffset,comments:[]};let u;return o.rangeStart>0||o.rangeEnd<n.length?u=await vo2(n,o):(!o.requirePragma&&o.insertPragma&&o.printer.insertPragma&&!await Gn2(n,o)&&(n=o.printer.insertPragma(n)),u=await qn2(n,o)),r&&(u.formatted=Hn2+u.formatted,u.cursorOffset>=0&&u.cursorOffset++),u}async function Xn2(e,t8,r){let{text:n,options:o}=Jn2(e,await re2(t8)),u=await De2(n,o);return r&&(r.preprocessForPrint&&(u.ast=await Ht2(u.ast,o)),r.massage&&(u.ast=fn2(u.ast,o))),u}async function Zn2(e,t8){t8=await re2(t8);let r=await je2(e,t8);return fe2(r,t8)}async function Qn2(e,t8){let r=Pr2(e),{formatted:n}=await Xt2(r,{...t8,parser:"__js_expression"});return n}async function eu(e,t8){t8=await re2(t8);let{ast:r}=await De2(e,t8);return je2(r,t8)}async function tu(e,t8){return fe2(e,await re2(t8))}var Qt2={};We(Qt2,{addDanglingComment:()=>X2,addLeadingComment:()=>ne2,addTrailingComment:()=>ue2,getAlignmentSize:()=>Fe2,getIndentSize:()=>nu,getMaxContinuousCount:()=>ru,getNextNonSpaceNonCommentCharacter:()=>iu,getNextNonSpaceNonCommentCharacterIndex:()=>Go,getStringWidth:()=>we2,hasNewline:()=>V2,hasNewlineInRange:()=>uu,hasSpaces:()=>ou,isNextLineEmpty:()=>Jo,isNextLineEmptyAfterIndex:()=>Ct2,isPreviousLineEmpty:()=>Ho,makeString:()=>su,skip:()=>me2,skipEverythingButNewLine:()=>mt2,skipInlineComment:()=>Ee2,skipNewline:()=>Y2,skipSpaces:()=>N2,skipToLineEnd:()=>dt2,skipTrailingComment:()=>Ce2,skipWhitespace:()=>xn2});function Lo(e,t8){if(t8===!1)return!1;if(e.charAt(t8)==="/"&&e.charAt(t8+1)==="*"){for(let r=t8+2;r<e.length;++r)if(e.charAt(r)==="*"&&e.charAt(r+1)==="/")return r+2}return t8}var Ee2=Lo;function Io(e,t8){return t8===!1?!1:e.charAt(t8)==="/"&&e.charAt(t8+1)==="/"?mt2(e,t8):t8}var Ce2=Io;function Ro(e,t8){let r=null,n=t8;for(;n!==r;)r=n,n=N2(e,n),n=Ee2(e,n),n=Ce2(e,n),n=Y2(e,n);return n}var Ve2=Ro;function Yo(e,t8){let r=null,n=t8;for(;n!==r;)r=n,n=dt2(e,n),n=Ee2(e,n),n=N2(e,n);return n=Ce2(e,n),n=Y2(e,n),n!==!1&&V2(e,n)}var Ct2=Yo;function Zt2(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function jo(e,t8){let r=e.match(new RegExp(`(${Zt2(t8)})+`,"g"));return r===null?0:r.reduce((n,o)=>Math.max(n,o.length/t8.length),0)}var ru=jo;function Vo(e,t8){let r=e.lastIndexOf(`
`);return r===-1?0:Fe2(e.slice(r+1).match(/^[\t ]*/)[0],t8)}var nu=Vo;function $o(e,t8,r){for(let n=t8;n<r;++n)if(e.charAt(n)===`
`)return!0;return!1}var uu=$o;function Mo(e,t8,r={}){return N2(e,r.backwards?t8-1:t8,r)!==t8}var ou=Mo;function Wo(e,t8){let r=Ve2(e,t8);return r===!1?"":e.charAt(r)}var iu=Wo;function Uo(e,t8,r){let n=t8==='"'?"'":'"',u=ee2(!1,e,/\\(.)|(["'])/gs,(i,s,D)=>s===n?s:D===t8?"\\"+D:D||(r&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/.test(s)?s:"\\"+s));return t8+u+t8}var su=Uo;function zo(e,t8,r){return Ve2(e,r(t8))}function Go(e,t8){return arguments.length===2||typeof t8=="number"?Ve2(e,t8):zo(...arguments)}function Ko(e,t8,r){return Ye2(e,r(t8))}function Ho(e,t8){return arguments.length===2||typeof t8=="number"?Ye2(e,t8):Ko(...arguments)}function qo(e,t8,r){return Ct2(e,r(t8))}function Jo(e,t8){return arguments.length===2||typeof t8=="number"?Ct2(e,t8):qo(...arguments)}var er2={};We(er2,{builders:()=>Xo,printer:()=>Zo,utils:()=>Qo});var Xo={join:ke2,line:Ke2,softline:Er2,hardline:G2,literalline:He2,group:At2,conditionalGroup:fr2,fill:Ge2,lineSuffix:Be2,lineSuffixBoundary:dr2,cursor:xe2,breakParent:le2,ifBreak:Fr2,trim:mr2,indent:ie2,indentIfBreak:pr2,align:oe2,addAlignmentToDoc:qe2,markAsRoot:cr2,dedentToRoot:ar2,dedent:lr2,hardlineWithoutBreakParent:_e2,literallineWithoutBreakParent:Bt2,label:Cr2,concat:e=>e},Zo={printDocToString:fe2},Qo={willBreak:wr2,traverseDoc:Ae2,findInDoc:Je2,mapDoc:Ne2,removeLines:Nr2,stripTrailingHardline:Xe2,replaceEndOfLine:Tr2,canBreak:Sr2},Du="3.1.1";function ae(e,t8=1){return async(...r)=>{let n=r[t8]??{},o=n.plugins??[];return r[t8]={...n,plugins:Array.isArray(o)?o:Object.values(o)},e(...r)}}var au=ae(Xt2);async function cu(e,t8){let{formatted:r}=await au(e,{...t8,cursorOffset:-1});return r}async function ei2(e,t8){return await cu(e,t8)===e}var ti2=ae(et2,0),ri2={parse:ae(Xn2),formatAST:ae(Zn2),formatDoc:ae(Qn2),printToDoc:ae(eu),printDocToString:ae(tu)},qc=tr2;function dedent(templ){for(var values=[],_i2=1;_i2<arguments.length;_i2++)values[_i2-1]=arguments[_i2];var strings=Array.from(typeof templ=="string"?[templ]:templ);strings[strings.length-1]=strings[strings.length-1].replace(/\r?\n([\t ]*)$/,"");var indentLengths=strings.reduce(function(arr,str){var matches=str.match(/\n([\t ]+|(?!\s).)/g);return matches?arr.concat(matches.map(function(match){var _a2,_b;return(_b=(_a2=match.match(/[\t ]/g))===null||_a2===void 0?void 0:_a2.length)!==null&&_b!==void 0?_b:0})):arr},[]);if(indentLengths.length){var pattern_1=new RegExp(`
[ ]{`+Math.min.apply(Math,indentLengths)+"}","g");strings=strings.map(function(str){return str.replace(pattern_1,`
`)})}strings[0]=strings[0].replace(/^\r?\n/,"");var string=strings[0];return values.forEach(function(value,i){var endentations=string.match(/(?:^|\n)( *)$/),endentation=endentations?endentations[1]:"",indentedValue=value;typeof value=="string"&&value.includes(`
`)&&(indentedValue=String(value).split(`
`).map(function(str,i2){return i2===0?str:""+endentation+str}).join(`
`)),string+=indentedValue+strings[i+1]}),string}var formatter=(0,import_memoizerific.default)(2)(async(type,source)=>type===!1?source:type==="dedent"||type===!0?dedent(source):(await qc.format(source,{parser:type,plugins:[dh],htmlWhitespaceSensitivity:"ignore"})).trim());export{formatter};