prettier 3.7.0 → 3.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,7 +29,7 @@ https://evilmartians.com/chronicles/postcss-8-plugin-migration`));let u=s(...o);
29
29
  `,a+2);c=C!==-1?C-1:i}p=n.slice(a,c+1),_=p.split(`
30
30
  `),d=_.length-1,d>0?(y=u+d,v=c-_[d].length):(y=u,v=o),r.push(["comment",p,u,a-o,y,c-v,a]),o=v,u=y,a=c}else if(h===35&&!uy.test(n.slice(a+1,a+2)))c=a+1,r.push(["#",n.slice(a,c),u,a-o,u,c-o,a]),a=c-1;else if((h===117||h===85)&&n.charCodeAt(a+1)===43){c=a+2;do c+=1,h=n.charCodeAt(c);while(c<i&&ly.test(n.slice(c,c+1)));r.push(["unicoderange",n.slice(a,c),u,a-o,u,c-o,a]),a=c-1}else if(h===47)c=a+1,r.push(["operator",n.slice(a,c),u,a-o,u,c-o,a]),a=c-1;else{let S=ay;if(h>=48&&h<=57&&(S=Ye),S.lastIndex=a+1,S.test(n),S.lastIndex===0?c=n.length-1:c=S.lastIndex-2,S===Ye||h===46){let C=n.charCodeAt(c),Zs=n.charCodeAt(c+1),en=n.charCodeAt(c+2);(C===101||C===69)&&(Zs===45||Zs===43)&&en>=48&&en<=57&&(Ye.lastIndex=c+2,Ye.test(n),Ye.lastIndex===0?c=n.length-1:c=Ye.lastIndex-2)}r.push(["word",n.slice(a,c+1),u,a-o,u,c-o,a]),a=c}break}a++}return r}});var Xu=w((H_,Qu)=>{"use strict";var Ks=class extends Error{constructor(e){super(e),this.name=this.constructor.name,this.message=e||"An error ocurred while parsing.",typeof Error.captureStackTrace=="function"?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack}};Qu.exports=Ks});var tl=w((K_,el)=>{"use strict";var cy=wu(),fy=xu(),py=Eu(),hy=ku(),dy=Au(),my=Cu(),yy=Ru(),gy=qu(),wy=Du(),Ju=Bu(),vy=Uu(),Zu=Wu(),xy=Yu(),_y=Ku(),by=Ms(),Ey=Bs(),Sy=Fs(),ky=Xu();function Ty(t){return t.sort((e,s)=>e-s)}el.exports=class{constructor(e,s){let r={loose:!1};this.cache=[],this.input=e,this.options=Object.assign({},r,s),this.position=0,this.unbalanced=0,this.root=new cy;let n=new fy;this.root.append(n),this.current=n,this.tokens=_y(e,this.options)}parse(){return this.loop()}colon(){let e=this.currToken;this.newNode(new hy({value:e[1],source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6]})),this.position++}comma(){let e=this.currToken;this.newNode(new dy({value:e[1],source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6]})),this.position++}comment(){let e=!1,s=this.currToken[1].replace(/\/\*|\*\//g,""),r;this.options.loose&&s.startsWith("//")&&(s=s.substring(2),e=!0),r=new my({value:s,inline:e,source:{start:{line:this.currToken[2],column:this.currToken[3]},end:{line:this.currToken[4],column:this.currToken[5]}},sourceIndex:this.currToken[6]}),this.newNode(r),this.position++}error(e,s){throw new ky(e+` at line: ${s[2]}, column ${s[3]}`)}loop(){for(;this.position<this.tokens.length;)this.parseTokens();return!this.current.last&&this.spaces?this.current.raws.before+=this.spaces:this.spaces&&(this.current.last.raws.after+=this.spaces),this.spaces="",this.root}operator(){let e=this.currToken[1],s;if(e==="+"||e==="-"){if(this.options.loose||this.position>0&&(this.current.type==="func"&&this.current.value==="calc"?this.prevToken[0]!=="space"&&this.prevToken[0]!=="("?this.error("Syntax Error",this.currToken):this.nextToken[0]!=="space"&&this.nextToken[0]!=="word"?this.error("Syntax Error",this.currToken):this.nextToken[0]==="word"&&this.current.last.type!=="operator"&&this.current.last.value!=="("&&this.error("Syntax Error",this.currToken):(this.nextToken[0]==="space"||this.nextToken[0]==="operator"||this.prevToken[0]==="operator")&&this.error("Syntax Error",this.currToken)),this.options.loose){if((!this.current.nodes.length||this.current.last&&this.current.last.type==="operator")&&this.nextToken[0]==="word")return this.word()}else if(this.nextToken[0]==="word")return this.word()}return s=new wy({value:this.currToken[1],source:{start:{line:this.currToken[2],column:this.currToken[3]},end:{line:this.currToken[2],column:this.currToken[3]}},sourceIndex:this.currToken[4]}),this.position++,this.newNode(s)}parseTokens(){switch(this.currToken[0]){case"space":this.space();break;case"colon":this.colon();break;case"comma":this.comma();break;case"comment":this.comment();break;case"(":this.parenOpen();break;case")":this.parenClose();break;case"atword":case"word":this.word();break;case"operator":this.operator();break;case"string":this.string();break;case"unicoderange":this.unicodeRange();break;default:this.word();break}}parenOpen(){let e=1,s=this.position+1,r=this.currToken,n;for(;s<this.tokens.length&&e;){let i=this.tokens[s];i[0]==="("&&e++,i[0]===")"&&e--,s++}if(e&&this.error("Expected closing parenthesis",r),n=this.current.last,n&&n.type==="func"&&n.unbalanced<0&&(n.unbalanced=0,this.current=n),this.current.unbalanced++,this.newNode(new Ju({value:r[1],source:{start:{line:r[2],column:r[3]},end:{line:r[4],column:r[5]}},sourceIndex:r[6]})),this.position++,this.current.type==="func"&&this.current.unbalanced&&this.current.value==="url"&&this.currToken[0]!=="string"&&this.currToken[0]!==")"&&!this.options.loose){let i=this.nextToken,o=this.currToken[1],u={line:this.currToken[2],column:this.currToken[3]};for(;i&&i[0]!==")"&&this.current.unbalanced;)this.position++,o+=this.currToken[1],i=this.nextToken;this.position!==this.tokens.length-1&&(this.position++,this.newNode(new Zu({value:o,source:{start:u,end:{line:this.currToken[4],column:this.currToken[5]}},sourceIndex:this.currToken[6]})))}}parenClose(){let e=this.currToken;this.newNode(new Ju({value:e[1],source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6]})),this.position++,!(this.position>=this.tokens.length-1&&!this.current.unbalanced)&&(this.current.unbalanced--,this.current.unbalanced<0&&this.error("Expected opening parenthesis",e),!this.current.unbalanced&&this.cache.length&&(this.current=this.cache.pop()))}space(){let e=this.currToken;this.position===this.tokens.length-1||this.nextToken[0]===","||this.nextToken[0]===")"?(this.current.last.raws.after+=e[1],this.position++):(this.spaces=e[1],this.position++)}unicodeRange(){let e=this.currToken;this.newNode(new xy({value:e[1],source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6]})),this.position++}splitWord(){let e=this.nextToken,s=this.currToken[1],r=/^[\+\-]?((\d+(\.\d*)?)|(\.\d+))([eE][\+\-]?\d+)?/,n=/^(?!\#([a-z0-9]+))[\#\{\}]/gi,i,o;if(!n.test(s))for(;e&&e[0]==="word";){this.position++;let u=this.currToken[1];s+=u,e=this.nextToken}i=Ey(s,"@"),o=Ty(Sy(by([[0],i]))),o.forEach((u,a)=>{let l=o[a+1]||s.length,f=s.slice(u,l),h;if(~i.indexOf(u))h=new py({value:f.slice(1),source:{start:{line:this.currToken[2],column:this.currToken[3]+u},end:{line:this.currToken[4],column:this.currToken[3]+(l-1)}},sourceIndex:this.currToken[6]+o[a]});else if(r.test(this.currToken[1])){let c=f.replace(r,"");h=new gy({value:f.replace(c,""),source:{start:{line:this.currToken[2],column:this.currToken[3]+u},end:{line:this.currToken[4],column:this.currToken[3]+(l-1)}},sourceIndex:this.currToken[6]+o[a],unit:c})}else h=new(e&&e[0]==="("?yy:Zu)({value:f,source:{start:{line:this.currToken[2],column:this.currToken[3]+u},end:{line:this.currToken[4],column:this.currToken[3]+(l-1)}},sourceIndex:this.currToken[6]+o[a]}),h.type==="word"?(h.isHex=/^#(.+)/.test(f),h.isColor=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(f)):this.cache.push(this.current);this.newNode(h)}),this.position++}string(){let e=this.currToken,s=this.currToken[1],r=/^(\"|\')/,n=r.test(s),i="",o;n&&(i=s.match(r)[0],s=s.slice(1,s.length-1)),o=new vy({value:s,source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6],quoted:n}),o.raws.quote=i,this.newNode(o),this.position++}word(){return this.splitWord()}newNode(e){return this.spaces&&(e.raws.before+=this.spaces,this.spaces=""),this.current.append(e)}get currToken(){return this.tokens[this.position]}get nextToken(){return this.tokens[this.position+1]}get prevToken(){return this.tokens[this.position-1]}}});var Gy={};tn(Gy,{languages:()=>_i,options:()=>Ei,parsers:()=>Js,printers:()=>Wy});var _t=(t,e)=>(s,r,...n)=>s|1&&r==null?void 0:(e.call(r)??r[t]).apply(r,n);var Sl=String.prototype.replaceAll??function(t,e){return t.global?this.replace(t,e):this.split(t).join(e)},kl=_t("replaceAll",function(){if(typeof this=="string")return Sl}),b=kl;function Tl(t){return this[t<0?this.length+t:t]}var Al=_t("at",function(){if(Array.isArray(this)||typeof this=="string")return Tl}),W=Al;var Ol=()=>{},j=Ol;var Ve="string",ze="array",bt="cursor",ne="indent",ke="align",Et="trim",ie="group",oe="fill",de="if-break",St="indent-if-break",Te="line-suffix",kt="line-suffix-boundary",Q="line",Tt="label",Ae="break-parent",At=new Set([bt,ne,ke,Et,ie,oe,de,St,Te,kt,Q,Tt,Ae]);function Cl(t){if(typeof t=="string")return Ve;if(Array.isArray(t))return ze;if(!t)return;let{type:e}=t;if(At.has(e))return e}var ae=Cl;var Nl=t=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(t);function Pl(t){let e=t===null?"null":typeof t;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}',
31
31
  Expected it to be 'string' or 'object'.`;if(ae(t))throw new Error("doc is valid.");let s=Object.prototype.toString.call(t);if(s!=="[object Object]")return`Unexpected doc '${s}'.`;let r=Nl([...At].map(n=>`'${n}'`));return`Unexpected doc.type '${t.type}'.
32
- Expected it to be ${r}.`}var Yr=class extends Error{name="InvalidDocError";constructor(e){super(Pl(e)),this.doc=e}},sn=Yr;function Rl(t,e){if(typeof t=="string")return e(t);let s=new Map;return r(t);function r(i){if(s.has(i))return s.get(i);let o=n(i);return s.set(i,o),o}function n(i){switch(ae(i)){case ze:return e(i.map(r));case oe:return e({...i,parts:i.parts.map(r)});case de:return e({...i,breakContents:r(i.breakContents),flatContents:r(i.flatContents)});case ie:{let{expandedStates:o,contents:u}=i;return o?(o=o.map(r),u=o[0]):u=r(u),e({...i,contents:u,expandedStates:o})}case ke:case ne:case St:case Tt:case Te:return e({...i,contents:r(i.contents)});case Ve:case bt:case Et:case kt:case Q:case Ae:return e(i);default:throw new sn(i)}}}function Il(t){return t.type===Q&&!t.hard?t.soft?"":" ":t.type===de?t.flatContents:t}function nn(t){return Rl(t,Il)}var U=j,me=j,on=j,an=j;function q(t){return U(t),{type:ne,contents:t}}function ql(t,e){return an(t),U(e),{type:ke,contents:e,n:t}}function ue(t){return ql(-1,t)}var Oe={type:Ae};function Ce(t){return on(t),{type:oe,parts:t}}function L(t,e={}){return U(t),me(e.expandedStates,!0),{type:ie,id:e.id,contents:t,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function Ot(t,e="",s={}){return U(t),e!==""&&U(e),{type:de,breakContents:t,flatContents:e,groupId:s.groupId}}function G(t,e){U(t),me(e);let s=[];for(let r=0;r<e.length;r++)r!==0&&s.push(t),s.push(e[r]);return s}var O={type:Q},D={type:Q,soft:!0},Ll={type:Q,hard:!0},k=[Ll,Oe];function un(t){return U(t),{type:Te,contents:t}}function Dl(t){return Array.isArray(t)&&t.length>0}var le=Dl;function Bl(t,e){let s=e===!0||e==="'"?"'":'"',r=s==="'"?'"':"'",n=0,i=0;for(let o of t)o===s?n++:o===r&&i++;return n>i?r:s}var ln=Bl;var Fl=/\\?(?<quote>["'])/gu;function Ul(t,e){return e+b(0,t,Fl,(s,r)=>(r===e?"\\":"")+r)+e}var cn=Ul;function $l(t,e){j(/^(?<quote>["']).*\k<quote>$/su.test(t));let s=t.slice(1,-1),r=e.parser==="json"||e.parser==="jsonc"||e.parser==="json5"&&e.quoteProps==="preserve"&&!e.singleQuote?'"':e.__isInHtmlAttribute?"'":ln(s,e.singleQuote);return t.charAt(0)===r?t:cn(s,r)}var Ct=$l;var Vr=class extends Error{name="UnexpectedNodeError";constructor(e,s,r="type"){super(`Unexpected ${s} node ${r}: ${JSON.stringify(e[r])}.`),this.node=e}},fn=Vr;var Nt=Symbol.for("PRETTIER_IS_FRONT_MATTER");function Wl(t){return!!t?.[Nt]}var Ne=Wl;var He=3;function Gl(t){let e=t.slice(0,He);if(e!=="---"&&e!=="+++")return;let s=t.indexOf(`
32
+ Expected it to be ${r}.`}var Yr=class extends Error{name="InvalidDocError";constructor(e){super(Pl(e)),this.doc=e}},sn=Yr;function Rl(t,e){if(typeof t=="string")return e(t);let s=new Map;return r(t);function r(i){if(s.has(i))return s.get(i);let o=n(i);return s.set(i,o),o}function n(i){switch(ae(i)){case ze:return e(i.map(r));case oe:return e({...i,parts:i.parts.map(r)});case de:return e({...i,breakContents:r(i.breakContents),flatContents:r(i.flatContents)});case ie:{let{expandedStates:o,contents:u}=i;return o?(o=o.map(r),u=o[0]):u=r(u),e({...i,contents:u,expandedStates:o})}case ke:case ne:case St:case Tt:case Te:return e({...i,contents:r(i.contents)});case Ve:case bt:case Et:case kt:case Q:case Ae:return e(i);default:throw new sn(i)}}}function Il(t){return t.type===Q&&!t.hard?t.soft?"":" ":t.type===de?t.flatContents:t}function nn(t){return Rl(t,Il)}var U=j,me=j,on=j,an=j;function q(t){return U(t),{type:ne,contents:t}}function ql(t,e){return an(t),U(e),{type:ke,contents:e,n:t}}function ue(t){return ql(-1,t)}var Oe={type:Ae};function Ce(t){return on(t),{type:oe,parts:t}}function L(t,e={}){return U(t),me(e.expandedStates,!0),{type:ie,id:e.id,contents:t,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function Ot(t,e="",s={}){return U(t),e!==""&&U(e),{type:de,breakContents:t,flatContents:e,groupId:s.groupId}}function G(t,e){U(t),me(e);let s=[];for(let r=0;r<e.length;r++)r!==0&&s.push(t),s.push(e[r]);return s}var O={type:Q},D={type:Q,soft:!0},Ll={type:Q,hard:!0},k=[Ll,Oe];function un(t){return U(t),{type:Te,contents:t}}function Dl(t){return Array.isArray(t)&&t.length>0}var le=Dl;function Bl(t,e){let s=e===!0||e==="'"?"'":'"',r=s==="'"?'"':"'",n=0,i=0;for(let o of t)o===s?n++:o===r&&i++;return n>i?r:s}var ln=Bl;var Fl=/\\(["'\\])|(["'])/gu;function Ul(t,e){let s=e==='"'?"'":'"',r=b(0,t,Fl,(n,i,o)=>i?i===s?s:n:o===e?"\\"+o:o);return e+r+e}var cn=Ul;function $l(t,e){j(/^(?<quote>["']).*\k<quote>$/su.test(t));let s=t.slice(1,-1),r=e.parser==="json"||e.parser==="jsonc"||e.parser==="json5"&&e.quoteProps==="preserve"&&!e.singleQuote?'"':e.__isInHtmlAttribute?"'":ln(s,e.singleQuote);return t.charAt(0)===r?t:cn(s,r)}var Ct=$l;var Vr=class extends Error{name="UnexpectedNodeError";constructor(e,s,r="type"){super(`Unexpected ${s} node ${r}: ${JSON.stringify(e[r])}.`),this.node=e}},fn=Vr;var Nt=Symbol.for("PRETTIER_IS_FRONT_MATTER");function Wl(t){return!!t?.[Nt]}var Ne=Wl;var He=3;function Gl(t){let e=t.slice(0,He);if(e!=="---"&&e!=="+++")return;let s=t.indexOf(`
33
33
  `,He);if(s===-1)return;let r=t.slice(He,s).trim(),n=t.indexOf(`
34
34
  ${e}`,s),i=r;if(i||(i=e==="+++"?"toml":"yaml"),n===-1&&e==="---"&&i==="yaml"&&(n=t.indexOf(`
35
35
  ...`,s)),n===-1)return;let o=n+1+He,u=t.charAt(o+1);if(!/\s?/u.test(u))return;let a=t.slice(0,o),l;return{language:i,explicitLanguage:r||null,value:t.slice(s+1,n),startDelimiter:e,endDelimiter:a.slice(-He),raw:a,start:{line:1,column:0,index:0},end:{index:a.length,get line(){return l??(l=a.split(`
@@ -29,7 +29,7 @@ https://evilmartians.com/chronicles/postcss-8-plugin-migration`));let u=s(...o);
29
29
  `,a+2);c=C!==-1?C-1:i}p=n.slice(a,c+1),_=p.split(`
30
30
  `),d=_.length-1,d>0?(y=u+d,v=c-_[d].length):(y=u,v=o),r.push(["comment",p,u,a-o,y,c-v,a]),o=v,u=y,a=c}else if(h===35&&!uy.test(n.slice(a+1,a+2)))c=a+1,r.push(["#",n.slice(a,c),u,a-o,u,c-o,a]),a=c-1;else if((h===117||h===85)&&n.charCodeAt(a+1)===43){c=a+2;do c+=1,h=n.charCodeAt(c);while(c<i&&ly.test(n.slice(c,c+1)));r.push(["unicoderange",n.slice(a,c),u,a-o,u,c-o,a]),a=c-1}else if(h===47)c=a+1,r.push(["operator",n.slice(a,c),u,a-o,u,c-o,a]),a=c-1;else{let S=ay;if(h>=48&&h<=57&&(S=Ye),S.lastIndex=a+1,S.test(n),S.lastIndex===0?c=n.length-1:c=S.lastIndex-2,S===Ye||h===46){let C=n.charCodeAt(c),Zs=n.charCodeAt(c+1),en=n.charCodeAt(c+2);(C===101||C===69)&&(Zs===45||Zs===43)&&en>=48&&en<=57&&(Ye.lastIndex=c+2,Ye.test(n),Ye.lastIndex===0?c=n.length-1:c=Ye.lastIndex-2)}r.push(["word",n.slice(a,c+1),u,a-o,u,c-o,a]),a=c}break}a++}return r}});var Qu=w((z_,Ku)=>{"use strict";var Ks=class extends Error{constructor(e){super(e),this.name=this.constructor.name,this.message=e||"An error ocurred while parsing.",typeof Error.captureStackTrace=="function"?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack}};Ku.exports=Ks});var el=w((j_,Zu)=>{"use strict";var cy=gu(),fy=vu(),py=bu(),hy=Su(),dy=Tu(),my=Ou(),yy=Pu(),gy=Iu(),wy=Lu(),Xu=Mu(),vy=Fu(),Ju=$u(),xy=Gu(),_y=ju(),by=Ms(),Ey=Bs(),Sy=Fs(),ky=Qu();function Ty(t){return t.sort((e,s)=>e-s)}Zu.exports=class{constructor(e,s){let r={loose:!1};this.cache=[],this.input=e,this.options=Object.assign({},r,s),this.position=0,this.unbalanced=0,this.root=new cy;let n=new fy;this.root.append(n),this.current=n,this.tokens=_y(e,this.options)}parse(){return this.loop()}colon(){let e=this.currToken;this.newNode(new hy({value:e[1],source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6]})),this.position++}comma(){let e=this.currToken;this.newNode(new dy({value:e[1],source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6]})),this.position++}comment(){let e=!1,s=this.currToken[1].replace(/\/\*|\*\//g,""),r;this.options.loose&&s.startsWith("//")&&(s=s.substring(2),e=!0),r=new my({value:s,inline:e,source:{start:{line:this.currToken[2],column:this.currToken[3]},end:{line:this.currToken[4],column:this.currToken[5]}},sourceIndex:this.currToken[6]}),this.newNode(r),this.position++}error(e,s){throw new ky(e+` at line: ${s[2]}, column ${s[3]}`)}loop(){for(;this.position<this.tokens.length;)this.parseTokens();return!this.current.last&&this.spaces?this.current.raws.before+=this.spaces:this.spaces&&(this.current.last.raws.after+=this.spaces),this.spaces="",this.root}operator(){let e=this.currToken[1],s;if(e==="+"||e==="-"){if(this.options.loose||this.position>0&&(this.current.type==="func"&&this.current.value==="calc"?this.prevToken[0]!=="space"&&this.prevToken[0]!=="("?this.error("Syntax Error",this.currToken):this.nextToken[0]!=="space"&&this.nextToken[0]!=="word"?this.error("Syntax Error",this.currToken):this.nextToken[0]==="word"&&this.current.last.type!=="operator"&&this.current.last.value!=="("&&this.error("Syntax Error",this.currToken):(this.nextToken[0]==="space"||this.nextToken[0]==="operator"||this.prevToken[0]==="operator")&&this.error("Syntax Error",this.currToken)),this.options.loose){if((!this.current.nodes.length||this.current.last&&this.current.last.type==="operator")&&this.nextToken[0]==="word")return this.word()}else if(this.nextToken[0]==="word")return this.word()}return s=new wy({value:this.currToken[1],source:{start:{line:this.currToken[2],column:this.currToken[3]},end:{line:this.currToken[2],column:this.currToken[3]}},sourceIndex:this.currToken[4]}),this.position++,this.newNode(s)}parseTokens(){switch(this.currToken[0]){case"space":this.space();break;case"colon":this.colon();break;case"comma":this.comma();break;case"comment":this.comment();break;case"(":this.parenOpen();break;case")":this.parenClose();break;case"atword":case"word":this.word();break;case"operator":this.operator();break;case"string":this.string();break;case"unicoderange":this.unicodeRange();break;default:this.word();break}}parenOpen(){let e=1,s=this.position+1,r=this.currToken,n;for(;s<this.tokens.length&&e;){let i=this.tokens[s];i[0]==="("&&e++,i[0]===")"&&e--,s++}if(e&&this.error("Expected closing parenthesis",r),n=this.current.last,n&&n.type==="func"&&n.unbalanced<0&&(n.unbalanced=0,this.current=n),this.current.unbalanced++,this.newNode(new Xu({value:r[1],source:{start:{line:r[2],column:r[3]},end:{line:r[4],column:r[5]}},sourceIndex:r[6]})),this.position++,this.current.type==="func"&&this.current.unbalanced&&this.current.value==="url"&&this.currToken[0]!=="string"&&this.currToken[0]!==")"&&!this.options.loose){let i=this.nextToken,o=this.currToken[1],u={line:this.currToken[2],column:this.currToken[3]};for(;i&&i[0]!==")"&&this.current.unbalanced;)this.position++,o+=this.currToken[1],i=this.nextToken;this.position!==this.tokens.length-1&&(this.position++,this.newNode(new Ju({value:o,source:{start:u,end:{line:this.currToken[4],column:this.currToken[5]}},sourceIndex:this.currToken[6]})))}}parenClose(){let e=this.currToken;this.newNode(new Xu({value:e[1],source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6]})),this.position++,!(this.position>=this.tokens.length-1&&!this.current.unbalanced)&&(this.current.unbalanced--,this.current.unbalanced<0&&this.error("Expected opening parenthesis",e),!this.current.unbalanced&&this.cache.length&&(this.current=this.cache.pop()))}space(){let e=this.currToken;this.position===this.tokens.length-1||this.nextToken[0]===","||this.nextToken[0]===")"?(this.current.last.raws.after+=e[1],this.position++):(this.spaces=e[1],this.position++)}unicodeRange(){let e=this.currToken;this.newNode(new xy({value:e[1],source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6]})),this.position++}splitWord(){let e=this.nextToken,s=this.currToken[1],r=/^[\+\-]?((\d+(\.\d*)?)|(\.\d+))([eE][\+\-]?\d+)?/,n=/^(?!\#([a-z0-9]+))[\#\{\}]/gi,i,o;if(!n.test(s))for(;e&&e[0]==="word";){this.position++;let u=this.currToken[1];s+=u,e=this.nextToken}i=Ey(s,"@"),o=Ty(Sy(by([[0],i]))),o.forEach((u,a)=>{let l=o[a+1]||s.length,f=s.slice(u,l),h;if(~i.indexOf(u))h=new py({value:f.slice(1),source:{start:{line:this.currToken[2],column:this.currToken[3]+u},end:{line:this.currToken[4],column:this.currToken[3]+(l-1)}},sourceIndex:this.currToken[6]+o[a]});else if(r.test(this.currToken[1])){let c=f.replace(r,"");h=new gy({value:f.replace(c,""),source:{start:{line:this.currToken[2],column:this.currToken[3]+u},end:{line:this.currToken[4],column:this.currToken[3]+(l-1)}},sourceIndex:this.currToken[6]+o[a],unit:c})}else h=new(e&&e[0]==="("?yy:Ju)({value:f,source:{start:{line:this.currToken[2],column:this.currToken[3]+u},end:{line:this.currToken[4],column:this.currToken[3]+(l-1)}},sourceIndex:this.currToken[6]+o[a]}),h.type==="word"?(h.isHex=/^#(.+)/.test(f),h.isColor=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(f)):this.cache.push(this.current);this.newNode(h)}),this.position++}string(){let e=this.currToken,s=this.currToken[1],r=/^(\"|\')/,n=r.test(s),i="",o;n&&(i=s.match(r)[0],s=s.slice(1,s.length-1)),o=new vy({value:s,source:{start:{line:e[2],column:e[3]},end:{line:e[4],column:e[5]}},sourceIndex:e[6],quoted:n}),o.raws.quote=i,this.newNode(o),this.position++}word(){return this.splitWord()}newNode(e){return this.spaces&&(e.raws.before+=this.spaces,this.spaces=""),this.current.append(e)}get currToken(){return this.tokens[this.position]}get nextToken(){return this.tokens[this.position+1]}get prevToken(){return this.tokens[this.position-1]}}});var gl={};tn(gl,{languages:()=>xi,options:()=>bi,parsers:()=>Js,printers:()=>Wy});var xt=(t,e)=>(s,r,...n)=>s|1&&r==null?void 0:(e.call(r)??r[t]).apply(r,n);var Sl=String.prototype.replaceAll??function(t,e){return t.global?this.replace(t,e):this.split(t).join(e)},kl=xt("replaceAll",function(){if(typeof this=="string")return Sl}),b=kl;function Tl(t){return this[t<0?this.length+t:t]}var Al=xt("at",function(){if(Array.isArray(this)||typeof this=="string")return Tl}),W=Al;var Ol=()=>{},j=Ol;var Ve="string",ze="array",_t="cursor",ne="indent",ke="align",bt="trim",ie="group",oe="fill",de="if-break",Et="indent-if-break",Te="line-suffix",St="line-suffix-boundary",Q="line",kt="label",Ae="break-parent",Tt=new Set([_t,ne,ke,bt,ie,oe,de,Et,Te,St,Q,kt,Ae]);function Cl(t){if(typeof t=="string")return Ve;if(Array.isArray(t))return ze;if(!t)return;let{type:e}=t;if(Tt.has(e))return e}var ae=Cl;var Nl=t=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(t);function Pl(t){let e=t===null?"null":typeof t;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}',
31
31
  Expected it to be 'string' or 'object'.`;if(ae(t))throw new Error("doc is valid.");let s=Object.prototype.toString.call(t);if(s!=="[object Object]")return`Unexpected doc '${s}'.`;let r=Nl([...Tt].map(n=>`'${n}'`));return`Unexpected doc.type '${t.type}'.
32
- Expected it to be ${r}.`}var Yr=class extends Error{name="InvalidDocError";constructor(e){super(Pl(e)),this.doc=e}},rn=Yr;function Rl(t,e){if(typeof t=="string")return e(t);let s=new Map;return r(t);function r(i){if(s.has(i))return s.get(i);let o=n(i);return s.set(i,o),o}function n(i){switch(ae(i)){case ze:return e(i.map(r));case oe:return e({...i,parts:i.parts.map(r)});case de:return e({...i,breakContents:r(i.breakContents),flatContents:r(i.flatContents)});case ie:{let{expandedStates:o,contents:u}=i;return o?(o=o.map(r),u=o[0]):u=r(u),e({...i,contents:u,expandedStates:o})}case ke:case ne:case Et:case kt:case Te:return e({...i,contents:r(i.contents)});case Ve:case _t:case bt:case St:case Q:case Ae:return e(i);default:throw new rn(i)}}}function Il(t){return t.type===Q&&!t.hard?t.soft?"":" ":t.type===de?t.flatContents:t}function sn(t){return Rl(t,Il)}var U=j,me=j,nn=j,on=j;function q(t){return U(t),{type:ne,contents:t}}function ql(t,e){return on(t),U(e),{type:ke,contents:e,n:t}}function ue(t){return ql(-1,t)}var Oe={type:Ae};function Ce(t){return nn(t),{type:oe,parts:t}}function L(t,e={}){return U(t),me(e.expandedStates,!0),{type:ie,id:e.id,contents:t,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function At(t,e="",s={}){return U(t),e!==""&&U(e),{type:de,breakContents:t,flatContents:e,groupId:s.groupId}}function G(t,e){U(t),me(e);let s=[];for(let r=0;r<e.length;r++)r!==0&&s.push(t),s.push(e[r]);return s}var O={type:Q},D={type:Q,soft:!0},Ll={type:Q,hard:!0},k=[Ll,Oe];function an(t){return U(t),{type:Te,contents:t}}function Dl(t){return Array.isArray(t)&&t.length>0}var le=Dl;function Bl(t,e){let s=e===!0||e==="'"?"'":'"',r=s==="'"?'"':"'",n=0,i=0;for(let o of t)o===s?n++:o===r&&i++;return n>i?r:s}var un=Bl;var Fl=/\\?(?<quote>["'])/gu;function Ul(t,e){return e+b(0,t,Fl,(s,r)=>(r===e?"\\":"")+r)+e}var ln=Ul;function $l(t,e){j(/^(?<quote>["']).*\k<quote>$/su.test(t));let s=t.slice(1,-1),r=e.parser==="json"||e.parser==="jsonc"||e.parser==="json5"&&e.quoteProps==="preserve"&&!e.singleQuote?'"':e.__isInHtmlAttribute?"'":un(s,e.singleQuote);return t.charAt(0)===r?t:ln(s,r)}var Ot=$l;var Vr=class extends Error{name="UnexpectedNodeError";constructor(e,s,r="type"){super(`Unexpected ${s} node ${r}: ${JSON.stringify(e[r])}.`),this.node=e}},cn=Vr;var Ct=Symbol.for("PRETTIER_IS_FRONT_MATTER");function Wl(t){return!!t?.[Ct]}var Ne=Wl;var He=3;function Gl(t){let e=t.slice(0,He);if(e!=="---"&&e!=="+++")return;let s=t.indexOf(`
32
+ Expected it to be ${r}.`}var Yr=class extends Error{name="InvalidDocError";constructor(e){super(Pl(e)),this.doc=e}},rn=Yr;function Rl(t,e){if(typeof t=="string")return e(t);let s=new Map;return r(t);function r(i){if(s.has(i))return s.get(i);let o=n(i);return s.set(i,o),o}function n(i){switch(ae(i)){case ze:return e(i.map(r));case oe:return e({...i,parts:i.parts.map(r)});case de:return e({...i,breakContents:r(i.breakContents),flatContents:r(i.flatContents)});case ie:{let{expandedStates:o,contents:u}=i;return o?(o=o.map(r),u=o[0]):u=r(u),e({...i,contents:u,expandedStates:o})}case ke:case ne:case Et:case kt:case Te:return e({...i,contents:r(i.contents)});case Ve:case _t:case bt:case St:case Q:case Ae:return e(i);default:throw new rn(i)}}}function Il(t){return t.type===Q&&!t.hard?t.soft?"":" ":t.type===de?t.flatContents:t}function sn(t){return Rl(t,Il)}var U=j,me=j,nn=j,on=j;function q(t){return U(t),{type:ne,contents:t}}function ql(t,e){return on(t),U(e),{type:ke,contents:e,n:t}}function ue(t){return ql(-1,t)}var Oe={type:Ae};function Ce(t){return nn(t),{type:oe,parts:t}}function L(t,e={}){return U(t),me(e.expandedStates,!0),{type:ie,id:e.id,contents:t,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function At(t,e="",s={}){return U(t),e!==""&&U(e),{type:de,breakContents:t,flatContents:e,groupId:s.groupId}}function G(t,e){U(t),me(e);let s=[];for(let r=0;r<e.length;r++)r!==0&&s.push(t),s.push(e[r]);return s}var O={type:Q},D={type:Q,soft:!0},Ll={type:Q,hard:!0},k=[Ll,Oe];function an(t){return U(t),{type:Te,contents:t}}function Dl(t){return Array.isArray(t)&&t.length>0}var le=Dl;function Bl(t,e){let s=e===!0||e==="'"?"'":'"',r=s==="'"?'"':"'",n=0,i=0;for(let o of t)o===s?n++:o===r&&i++;return n>i?r:s}var un=Bl;var Fl=/\\(["'\\])|(["'])/gu;function Ul(t,e){let s=e==='"'?"'":'"',r=b(0,t,Fl,(n,i,o)=>i?i===s?s:n:o===e?"\\"+o:o);return e+r+e}var ln=Ul;function $l(t,e){j(/^(?<quote>["']).*\k<quote>$/su.test(t));let s=t.slice(1,-1),r=e.parser==="json"||e.parser==="jsonc"||e.parser==="json5"&&e.quoteProps==="preserve"&&!e.singleQuote?'"':e.__isInHtmlAttribute?"'":un(s,e.singleQuote);return t.charAt(0)===r?t:ln(s,r)}var Ot=$l;var Vr=class extends Error{name="UnexpectedNodeError";constructor(e,s,r="type"){super(`Unexpected ${s} node ${r}: ${JSON.stringify(e[r])}.`),this.node=e}},cn=Vr;var Ct=Symbol.for("PRETTIER_IS_FRONT_MATTER");function Wl(t){return!!t?.[Ct]}var Ne=Wl;var He=3;function Gl(t){let e=t.slice(0,He);if(e!=="---"&&e!=="+++")return;let s=t.indexOf(`
33
33
  `,He);if(s===-1)return;let r=t.slice(He,s).trim(),n=t.indexOf(`
34
34
  ${e}`,s),i=r;if(i||(i=e==="+++"?"toml":"yaml"),n===-1&&e==="---"&&i==="yaml"&&(n=t.indexOf(`
35
35
  ...`,s)),n===-1)return;let o=n+1+He,u=t.charAt(o+1);if(!/\s?/u.test(u))return;let a=t.slice(0,o),l;return{language:i,explicitLanguage:r||null,value:t.slice(s+1,n),startDelimiter:e,endDelimiter:a.slice(-He),raw:a,start:{line:1,column:0,index:0},end:{index:a.length,get line(){return l??(l=a.split(`