UNPKG

prettier

Version:

Prettier is an opinionated code formatter

59 lines (56 loc) 136 kB
(function(f){function e(){var i=f();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.yaml=e()}})(function(){"use strict";var Wn=Object.defineProperty;var co=Object.getOwnPropertyDescriptor;var fo=Object.getOwnPropertyNames;var uo=Object.prototype.hasOwnProperty;var Vs=(t,e)=>{for(var n in e)Wn(t,n,{get:e[n],enumerable:!0})},po=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of fo(e))!uo.call(t,r)&&r!==n&&Wn(t,r,{get:()=>e[r],enumerable:!(s=co(e,r))||s.enumerable});return t};var mo=t=>po(Wn({},"__esModule",{value:!0}),t);var Ja={};Vs(Ja,{languages:()=>Ar,options:()=>Tr,parsers:()=>Us,printers:()=>Ha});var Kt=(t,e)=>(n,s,...r)=>n|1&&s==null?void 0:(e.call(s)??s[t]).apply(s,r);function ho(t){return this[t<0?this.length+t:t]}var go=Kt("at",function(){if(Array.isArray(this)||typeof this=="string")return ho}),j=go;var yo=String.prototype.replaceAll??function(t,e){return t.global?this.replace(t,e):this.split(t).join(e)},wo=Kt("replaceAll",function(){if(typeof this=="string")return yo}),Yt=wo;var bo=()=>{},ft=bo;var ut="string",pt="array",Ut="cursor",jt="indent",Fe="align",Vt="trim",Ke="group",Ye="fill",Ue="if-break",Gt="indent-if-break",je="line-suffix",Qt="line-suffix-boundary",we="line",Ht="label",Ve="break-parent",Jt=new Set([Ut,jt,Fe,Vt,Ke,Ye,Ue,Gt,je,Qt,we,Ht,Ve]);function Wt(t,e,n){if(!t.has(e)){let s=n(e);t.set(e,s)}return t.get(e)}function ko(t){if(typeof t=="string")return ut;if(Array.isArray(t))return pt;if(!t)return;let{type:e}=t;if(Jt.has(e))return e}var Xt=ko;var So=t=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(t);function Eo(t){let e=t===null?"null":typeof t;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}', Expected it to be 'string' or 'object'.`;if(Xt(t))throw new Error("doc is valid.");let n=Object.prototype.toString.call(t);if(n!=="[object Object]")return`Unexpected doc '${n}'.`;let s=So([...Jt].map(r=>`'${r}'`));return`Unexpected doc.type '${t.type}'. Expected it to be ${s}.`}var Xn=class extends Error{name="InvalidDocError";constructor(e){super(Eo(e)),this.doc=e}},Gs=Xn;function Co(t,e){if(typeof t=="string")return e(t);let n=new Map;return s(t);function s(i){return Wt(n,i,r)}function r(i){switch(Xt(i)){case pt:return e(i.map(s));case Ye:return e({...i,parts:i.parts.map(s)});case Ue:return e({...i,breakContents:s(i.breakContents),flatContents:s(i.flatContents)});case Ke:{let{expandedStates:o,contents:a}=i;return o?(o=o.map(s),a=o[0]):a=s(a),e({...i,contents:a,expandedStates:o})}case Fe:case jt:case Gt:case Ht:case je:return e({...i,contents:s(i.contents)});case ut:case Ut:case Vt:case Qt:case we:case Ve:return e(i);default:throw new Gs(i)}}}function Qs(t,e=mt){return Co(t,n=>typeof n=="string"?R(e,n.split(` `)):n)}var ne=ft,zt=ft,Hs=ft,Js=ft;function ht(t,e){return Js(t),ne(e),{type:Fe,contents:e,n:t}}function zn(t){return ht(Number.NEGATIVE_INFINITY,t)}function Ws(t){return ht({type:"root"},t)}function Xs(t){return ht(-1,t)}var dt={type:Ve};function Zt(t){return Hs(t),{type:Ye,parts:t}}function Ge(t,e={}){return ne(t),zt(e.expandedStates,!0),{type:Ke,id:e.id,contents:t,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function Zn(t,e){return Ge(t[0],{...e,expandedStates:t})}function gt(t,e="",n={}){return ne(t),e!==""&&ne(e),{type:Ue,breakContents:t,flatContents:e,groupId:n.groupId}}function R(t,e){ne(t),zt(e);let n=[];for(let s=0;s<e.length;s++)s!==0&&n.push(t),n.push(e[s]);return n}var be={type:we},en={type:we,soft:!0},No={type:we,hard:!0},O=[No,dt],Ao={type:we,hard:!0,literal:!0},mt=[Ao,dt];function zs(t){return ne(t),{type:je,contents:t}}function tn(t){return(e,n,s)=>{if(n===!1)return!1;let r=!!s?.backwards,{length:i}=e,o=n;for(;o>=0&&o<i;){let a=e.charAt(o);if(t instanceof RegExp){if(!t.test(a))return o}else if(!t.includes(a))return o;r?o--:o++}return o===-1||o===i?o:!1}}var rc=tn(/\s/),es=tn(" "),ic=tn(",; "),oc=tn(/[^\n\r]/);var Zs=t=>t===` `||t==="\r"||t==="\u2028"||t==="\u2029";function To(t,e,n){if(e===!1)return!1;let s=!!n?.backwards,r=t.charAt(e);if(s){if(t.charAt(e-1)==="\r"&&r===` `)return e-2;if(Zs(r))return e-1}else{if(r==="\r"&&t.charAt(e+1)===` `)return e+2;if(Zs(r))return e+1}return e}var ts=To;function Oo(t,e){let n=e-1;n=es(t,n,{backwards:!0}),n=ts(t,n,{backwards:!0}),n=es(t,n,{backwards:!0});let s=ts(t,n,{backwards:!0});return n!==s}var ns=Oo;var ss=class extends Error{name="UnexpectedNodeError";constructor(e,n,s="type"){super(`Unexpected ${n} node ${s}: ${JSON.stringify(e[s])}.`),this.node=e}},er=ss;function tr(t,e){let{node:n}=t;if(n.type==="root"&&e.filepath&&/(?:[/\\]|^)\.(?:prettier|stylelint|lintstaged)rc$/.test(e.filepath))return async s=>{let r=await s(e.originalText,{parser:"json"});return r?[r,O]:void 0}}tr.getVisitorKeys=()=>[];var nr=tr;var yt=null;function wt(t){if(yt!==null&&typeof yt.property){let e=yt;return yt=wt.prototype=null,e}return yt=wt.prototype=t??Object.create(null),new wt}var _o=10;for(let t=0;t<=_o;t++)wt();function rs(t){return wt(t)}function Io(t,e="type"){rs(t);function n(s){let r=s[e],i=t[r];if(!Array.isArray(i))throw Object.assign(new Error(`Missing visitor keys for '${r}'.`),{node:s});return i}return n}var sr=Io;var P=[["children","anchor","tag","indicatorComment","leadingComments","middleComments","trailingComment","endComments"],["anchor","tag","indicatorComment","leadingComments","middleComments","trailingComment","endComments"],["key","value","children","anchor","tag","indicatorComment","leadingComments","middleComments","trailingComment","endComments"],["content","children","anchor","tag","indicatorComment","leadingComments","middleComments","trailingComment","endComments"],["indicatorComment","leadingComments","middleComments","trailingComment","endComments"]],rr={root:P[0],document:["head","body","children","anchor","tag","indicatorComment","leadingComments","middleComments","trailingComment","endComments"],documentHead:P[0],documentBody:P[0],directive:P[1],alias:P[1],blockLiteral:P[1],blockFolded:P[0],plain:P[0],quoteSingle:P[1],quoteDouble:P[1],mapping:P[0],mappingItem:P[2],mappingKey:P[3],mappingValue:P[3],sequence:P[0],sequenceItem:P[3],flowMapping:P[0],flowMappingItem:P[2],flowSequence:P[0],flowSequenceItem:P[3],comment:P[1],tag:P[4],anchor:P[4]};var Lo=sr(rr),ir=Lo;var bt=t=>t.position.start.offset,or=t=>t.position.end.offset;var ar="format";var lr=/^\s*#[^\S\n]*@(?:noformat|noprettier)\s*?(?:\n|$)/,cr=/^\s*#[^\S\n]*@(?:format|prettier)\s*?(?:\n|$)/,fr=/^\s*@(?:format|prettier)\s*$/;var ur=t=>fr.test(t),pr=t=>cr.test(t),mr=t=>lr.test(t),hr=t=>`# @${ar} ${t}`;function is(t,e){switch(t.type){case"comment":if(ur(t.value))return null;break;case"quoteDouble":case"quoteSingle":e.type="quote";break;case"document":e.directivesEndMarker||delete e.directivesEndMarker,e.documentEndMarker||delete e.documentEndMarker;break;case"blockLiteral":case"blockFolded":t.chomping==="keep"?e.value=t.value.split(` `).map(n=>n.replace(/[ \t]+$/,"")).join(` `):(t.chomping==="clip"||t.chomping==="strip")&&(e.value=t.value.trimEnd());break}}is.ignoredProperties=new Set(["position"]);function Po(t){return Array.isArray(t)&&t.length>0}var Qe=Po;function J(t,e){return typeof t?.type=="string"&&e.includes(t.type)}function os(t,e,n){return e("children"in t?{...t,children:t.children.map(s=>os(s,e,t))}:t,n)}function He(t,e,n){Object.defineProperty(t,e,{get:n,enumerable:!1})}function gr(t,e){let n=0,s=e.length;for(let r=t.position.end.offset-1;r<s;r++){let i=e[r];if(i===` `&&n++,n===1&&/\S/.test(i))return!1;if(n===2)return!0}return!1}function nn(t){let{node:e}=t;switch(e.type){case"tag":case"anchor":case"comment":return!1}let n=t.stack.length;for(let s=1;s<n;s++){let r=t.stack[s],i=t.stack[s-1];if(Array.isArray(i)&&typeof r=="number"&&r!==i.length-1)return!1}return!0}function sn(t){return Qe(t.children)?sn(j(0,t.children,-1)):t}function dr(t){return t.value.trim()==="prettier-ignore"}function yr(t){let{node:e}=t;if(e.type==="documentBody"){let n=t.parent.head;return F(n)&&dr(j(0,n.endComments,-1))}return ce(e)&&dr(j(0,e.leadingComments,-1))}function Je(t){return!Qe(t.children)&&!vo(t)}function vo(t){return ce(t)||Oe(t)||as(t)||W(t)||F(t)}function ce(t){return Qe(t?.leadingComments)}function Oe(t){return Qe(t?.middleComments)}function as(t){return t?.indicatorComment}function W(t){return t?.trailingComment}function F(t){return Qe(t?.endComments)}function wr(t){return t?t.split(/(?<!^| ) (?! |$)/):[]}function br(t,e,n){let s=e.split(` `).map((i,o,a)=>o===0&&o===a.length-1?i:o!==0&&o!==a.length-1?i.trim():o===0?i.trimEnd():i.trimStart());if(n.proseWrap==="preserve")return s.map(i=>i?[i]:[]);let r=[];for(let[i,o]of s.entries()){let a=wr(o);i>0&&s[i-1].length>0&&a.length>0&&!(t==="quoteDouble"&&j(0,j(0,r,-1),-1).endsWith("\\"))?r[r.length-1]=[...j(0,r,-1),...a]:r.push(a)}return n.proseWrap==="never"?r.map(i=>[i.join(" ")]):r}function kr(t,{parentIndent:e,isLastDescendant:n,options:s}){let r=t.position.start.line===t.position.end.line?"":s.originalText.slice(t.position.start.offset,t.position.end.offset).match(/^[^\n]*\n(.*)$/s)[1];if(r==="")return[];let i;if(t.indent===null){let c=r.match(/^(?<leadingSpace> *)[^\n\r ]/m);i=c?c.groups.leadingSpace.length:Number.POSITIVE_INFINITY}else i=t.indent-1+e;let o=r.split(` `).map(c=>c.slice(i));if(s.proseWrap==="preserve"||t.type==="blockLiteral")return l(o.map(c=>c?[c]:[]));let a=[];for(let[c,u]of o.entries()){let f=wr(u);c>0&&f.length>0&&o[c-1].length>0&&!/^\s/.test(f[0])&&!/^\s|\s$/.test(j(0,a,-1))?a[a.length-1]=[...j(0,a,-1),...f]:a.push(f)}return a=a.map(c=>{let u=[];for(let f of c)u.length>0&&/\s$/.test(j(0,u,-1))?u[u.length-1]+=" "+f:u.push(f);return u}),s.proseWrap==="never"&&(a=a.map(c=>[c.join(" ")])),l(a);function l(c){if(t.chomping==="keep")return r.endsWith(` `)&&j(0,c,-1).length===0?c.slice(0,-1):c;let u=0;for(let f=c.length-1;f>=0&&c[f].every(p=>p.replace(/[ \t]+$/,"")==="");f--)u++;return u===0?c:u>=2&&!n?c.slice(0,-(u-1)):c.slice(0,-u)}}function kt(t){if(!t)return!0;switch(t.type){case"plain":case"quoteDouble":case"quoteSingle":case"alias":case"flowMapping":case"flowSequence":return!0;default:return!1}}var Do=new WeakMap;function rn(t,e){let{node:n,root:s}=t,r=Wt(Do,s,()=>new Set);return!r.has(n.position.end.offset)&&(r.add(n.position.end.offset),gr(n,e)&&!ls(t.parent))?en:""}function ls(t){return F(t)&&!J(t,["documentHead","documentBody","flowMapping","flowSequence"])}function K(t,e){return ht(" ".repeat(t),e)}function xo(t,e,n){let{node:s}=t,r=t.ancestors.filter(c=>c.type==="sequence"||c.type==="mapping").length,i=nn(t),o=[s.type==="blockFolded"?">":"|"];s.indent!==null&&o.push(s.indent.toString()),s.chomping!=="clip"&&o.push(s.chomping==="keep"?"+":"-"),as(s)&&o.push(" ",n("indicatorComment"));let a=kr(s,{parentIndent:r,isLastDescendant:i,options:e}),l=[];for(let[c,u]of a.entries())c===0&&l.push(O),l.push(Zt(R(be,u))),c!==a.length-1?l.push(u.length===0?O:Ws(mt)):s.chomping==="keep"&&i&&l.push(zn(u.length===0?O:mt));return s.indent===null?o.push(Xs(K(e.tabWidth,l))):o.push(zn(K(s.indent-1+r,l))),o}var Sr=xo;function on(t,e,n){let{node:s}=t,r=s.type==="flowMapping",i=r?"{":"[",o=r?"}":"]",a=en;r&&s.children.length>0&&e.bracketSpacing&&(a=be);let l=j(0,s.children,-1),c=l?.type==="flowMappingItem"&&Je(l.key)&&Je(l.value);return[i,K(e.tabWidth,[a,Mo(t,e,n),e.trailingComma==="none"?"":gt(","),F(s)?[O,R(O,t.map(n,"endComments"))]:""]),c?"":a,o]}function Mo(t,e,n){return t.map(({isLast:s,node:r,next:i})=>[n(),s?"":[",",be,r.position.start.line!==i.position.start.line?rn(t,e.originalText):""]],"children")}function $o(t,e,n){let{node:s,parent:r}=t,{key:i,value:o}=s,a=Je(i),l=Je(o);if(a&&l)return": ";let c=n("key"),u=Bo(s)?" ":"";if(l)return s.type==="flowMappingItem"&&r.type==="flowMapping"?c:s.type==="mappingItem"&&an(i.content,e)&&!W(i.content)&&r.tag?.value!=="tag:yaml.org,2002:set"?[c,u,":"]:["? ",K(2,c)];let f=n("value");if(a)return[": ",K(2,f)];if(ce(o)||!kt(i.content))return["? ",K(2,c),O,...t.map(()=>[n(),O],"value","leadingComments"),": ",K(2,f)];if(Ro(i.content)&&!ce(i.content)&&!Oe(i.content)&&!W(i.content)&&!F(i)&&!ce(o.content)&&!Oe(o.content)&&!F(o)&&an(o.content,e)&&an(i.content,e))return[c,u,": ",f];let p=Symbol("mappingKey"),h=Ge([gt("? "),Ge(K(2,c),{id:p})]),g=[O,": ",K(2,f)],m=[u,":"];F(o)&&o.content&&J(o.content,["flowMapping","flowSequence"])&&o.content.children.length===0?m.push(" "):ce(o.content)||F(o)&&o.content&&!J(o.content,["mapping","sequence"])||r.type==="mapping"&&W(i.content)&&kt(o.content)||J(o.content,["mapping","sequence"])&&o.content.tag===null&&o.content.anchor===null?m.push(O):o.content?m.push(be):W(o)&&m.push(" "),m.push(f);let d=K(e.tabWidth,m);return an(i.content,e)&&!ce(i.content)&&!Oe(i.content)&&!W(i.content)&&!F(i)?Zn([[c,d]]):Zn([[h,gt(g,d,{groupId:p})]])}function an(t,e){if(!t)return!0;switch(t.type){case"plain":case"quoteSingle":case"quoteDouble":break;case"alias":return!0;default:return!1}if(e.proseWrap==="preserve")return t.position.start.line===t.position.end.line;if(/\\$/m.test(e.originalText.slice(t.position.start.offset,t.position.end.offset)))return!1;switch(e.proseWrap){case"never":return!t.value.includes(` `);case"always":return!/[\n ]/.test(t.value);default:return!1}}function Bo(t){return t.key.content?.type==="alias"}function Ro(t){if(!t)return!0;switch(t.type){case"plain":case"quoteDouble":case"quoteSingle":return t.position.start.line===t.position.end.line;case"alias":return!0;default:return!1}}var Er=$o;function qo(t){return os(t,Fo)}function Fo(t){switch(t.type){case"document":He(t,"head",()=>t.children[0]),He(t,"body",()=>t.children[1]);break;case"documentBody":case"sequenceItem":case"flowSequenceItem":case"mappingKey":case"mappingValue":He(t,"content",()=>t.children[0]);break;case"mappingItem":case"flowMappingItem":He(t,"key",()=>t.children[0]),He(t,"value",()=>t.children[1]);break}return t}var Cr=qo;function Ko(t,e,n){let{node:s}=t,r=[];s.type!=="mappingValue"&&ce(s)&&r.push([R(O,t.map(n,"leadingComments")),O]);let{tag:i,anchor:o}=s;i&&r.push(n("tag")),i&&o&&r.push(" "),o&&r.push(n("anchor"));let a="";return J(s,["mapping","sequence","comment","directive","mappingItem","sequenceItem"])&&!nn(t)&&(a=rn(t,e.originalText)),(i||o)&&(J(s,["sequence","mapping"])&&!Oe(s)?r.push(O):r.push(" ")),Oe(s)&&r.push([s.middleComments.length===1?"":O,R(O,t.map(n,"middleComments")),O]),yr(t)?r.push(Qs(e.originalText.slice(s.position.start.offset,s.position.end.offset).trimEnd())):r.push(Ge(Yo(t,e,n))),W(s)&&!J(s,["document","documentHead"])&&r.push(zs([s.type==="mappingValue"&&!s.content?"":" ",t.parent.type==="mappingKey"&&t.getParentNode(2).type==="mapping"&&kt(s)?"":dt,n("trailingComment")])),ls(s)&&r.push(K(s.type==="sequenceItem"?2:0,[O,R(O,t.map(({node:l})=>[ns(e.originalText,bt(l))?O:"",n()],"endComments"))])),r.push(a),r}function Yo(t,e,n){let{node:s}=t;switch(s.type){case"root":{let r=sn(s),i=!(J(r,["blockLiteral","blockFolded"])&&r.chomping==="keep"),o=[];return t.each(({node:a,isFirst:l})=>{l||o.push(O),o.push(n()),jo(t)&&(i&&o.push(O),o.push("..."),W(a)&&o.push(" ",n("trailingComment")))},"children"),i&&o.push(O),o}case"document":{let r=[];return Vo(t)&&((s.head.children.length>0||s.head.endComments.length>0)&&r.push(n("head")),W(s.head)?r.push(["---"," ",n(["head","trailingComment"])]):r.push("---")),Uo(s)&&r.push(n("body")),R(O,r)}case"documentHead":return R(O,[...t.map(n,"children"),...t.map(n,"endComments")]);case"documentBody":{let{children:r,endComments:i}=s,o="";if(r.length>0&&i.length>0){let a=sn(s);if(J(a,["blockFolded","blockLiteral"]))a.chomping!=="keep"&&(o=[O,O]);else{let l=j(0,r,-1);o=J(l,["mapping"])&&ns(e.originalText,bt(i[0]))?[O,O]:O}}return[R(O,t.map(n,"children")),o,R(O,t.map(n,"endComments"))]}case"directive":return["%",R(" ",[s.name,...s.parameters])];case"comment":return["#",s.value];case"alias":return["*",s.value];case"tag":return e.originalText.slice(s.position.start.offset,s.position.end.offset);case"anchor":return["&",s.value];case"plain":return St(s.type,e.originalText.slice(s.position.start.offset,s.position.end.offset),e);case"quoteDouble":case"quoteSingle":{let o=e.originalText.slice(s.position.start.offset+1,s.position.end.offset-1);if(s.type==="quoteSingle"&&o.includes("\\")||s.type==="quoteDouble"&&/\\[^"]/.test(o)){let l=s.type==="quoteDouble"?'"':"'";return[l,St(s.type,o,e),l]}if(o.includes('"'))return["'",St(s.type,s.type==="quoteDouble"?Yt(0,Yt(0,o,'\\"','"'),"'","'".repeat(2)):o,e),"'"];if(o.includes("'"))return['"',St(s.type,s.type==="quoteSingle"?Yt(0,o,"''","'"):o,e),'"'];let a=e.singleQuote?"'":'"';return[a,St(s.type,o,e),a]}case"blockFolded":case"blockLiteral":return Sr(t,e,n);case"mapping":case"sequence":return R(O,t.map(n,"children"));case"sequenceItem":return["- ",K(2,s.content?n("content"):"")];case"mappingKey":case"mappingValue":return s.content?n("content"):"";case"mappingItem":case"flowMappingItem":return Er(t,e,n);case"flowMapping":return on(t,e,n);case"flowSequence":return on(t,e,n);case"flowSequenceItem":return n("content");default:throw new er(s,"YAML")}}function Uo(t){return t.body.children.length>0||F(t.body)}function jo(t){let e=t.node;if(e.documentEndMarker||W(e))return!0;if(t.isLast)return!1;let n=t.next;return n.head.children.length>0||F(n.head)}function Vo(t){let e=t.node;return e.directivesEndMarker||e.head.children.length>0||F(e.head)||W(e.head)}function St(t,e,n){let s=br(t,e,n);return R(O,s.map(r=>Zt(R(be,r))))}var Go={preprocess:Cr,embed:nr,print:Ko,massageAstNode:is,insertPragma:hr,getVisitorKeys:ir},Nr=Go;var Ar=[{name:"YAML",type:"data",aceMode:"yaml",extensions:[".yml",".mir",".reek",".rviz",".sublime-syntax",".syntax",".yaml",".yaml-tmlanguage",".yaml.sed",".yml.mysql"],filenames:[".clang-format",".clang-tidy",".clangd",".gemrc","CITATION.cff","glide.lock","pixi.lock",".prettierrc",".stylelintrc",".lintstagedrc"],tmScope:"source.yaml",aliases:["yml"],codemirrorMode:"yaml",codemirrorMimeType:"text/x-yaml",parsers:["yaml"],vscodeLanguageIds:["yaml","ansible","dockercompose","github-actions-workflow","home-assistant"],linguistLanguageId:407}];var ln={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},objectWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap object literals.",choices:[{value:"preserve",description:"Keep as multi-line, if there is a newline between the opening brace and first property."},{value:"collapse",description:"Fit to a single line when possible."}]},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}};var Qo={bracketSpacing:ln.bracketSpacing,singleQuote:ln.singleQuote,proseWrap:ln.proseWrap},Tr=Qo;var Us={};Vs(Us,{yaml:()=>Qa});var Et=class extends SyntaxError{name="YAMLSyntaxError";code;source;position;constructor(t,e){super(e.message,{cause:e}),this.cause??(this.cause=e),this.code=e.code,this.source=t.text,this.position=t.transformRange(e.pos)}};function Q(t,e=null){"children"in t&&t.children.forEach(n=>Q(n,t)),"anchor"in t&&t.anchor&&Q(t.anchor,t),"tag"in t&&t.tag&&Q(t.tag,t);"leadingComments"in t&&t.leadingComments.forEach(n=>Q(n,t)),"middleComments"in t&&t.middleComments.forEach(n=>Q(n,t)),"indicatorComment"in t&&t.indicatorComment&&Q(t.indicatorComment,t),"trailingComment"in t&&t.trailingComment&&Q(t.trailingComment,t),"endComments"in t&&t.endComments.forEach(n=>Q(n,t)),Object.defineProperty(t,"_parent",{value:e,enumerable:!1})}function _e(t){return`${t.line}:${t.column}`}function Or(t){Q(t);let e=Ho(t),n=t.children.slice();t.comments.filter(s=>!s._parent).forEach(s=>{for(;n.length>1&&s.position.start.line>n[0].position.end.line;)n.shift();Jo(s,e,n[0])})}function Ho(t){let e=Array.from(new Array(t.position.end.line),()=>({}));for(let n of t.comments)e[n.position.start.line-1].comment=n;return _r(e,t),e}function _r(t,e){if(e.position.start.offset!==e.position.end.offset){if("leadingComments"in e){let{start:n}=e.position,{leadingAttachableNode:s}=t[n.line-1];(!s||n.column<s.position.start.column)&&(t[n.line-1].leadingAttachableNode=e)}if("trailingComment"in e&&e.position.end.column>1&&e.type!=="document"&&e.type!=="documentHead"){let{end:n}=e.position,{trailingAttachableNode:s}=t[n.line-1];(!s||n.column>=s.position.end.column)&&(t[n.line-1].trailingAttachableNode=e)}if(e.type!=="root"&&e.type!=="document"&&e.type!=="documentHead"&&e.type!=="documentBody"){let{start:n,end:s}=e.position,r=[s.line].concat(n.line===s.line?[]:n.line);for(let i of r){let o=t[i-1].trailingNode;(!o||s.column>=o.position.end.column)&&(t[i-1].trailingNode=e)}}"children"in e&&e.children.forEach(n=>{_r(t,n)})}}function Jo(t,e,n){let s=t.position.start.line,{trailingAttachableNode:r}=e[s-1];if(r){if(r.trailingComment)throw new Error(`Unexpected multiple trailing comment at ${_e(t.position.start)}`);Q(t,r),r.trailingComment=t;return}for(let o=s;o>=n.position.start.line;o--){let{trailingNode:a}=e[o-1],l;if(a)l=a;else if(o!==s&&e[o-1].comment)l=e[o-1].comment._parent;else continue;if((l.type==="sequence"||l.type==="mapping")&&(l=l.children[0]),l.type==="mappingItem"){let[c,u]=l.children;l=Ir(c)?c:u}for(;;){if(Wo(l,t)){Q(t,l),l.endComments.push(t);return}if(!l._parent)break;l=l._parent}break}for(let o=s+1;o<=n.position.end.line;o++){let{leadingAttachableNode:a}=e[o-1];if(a){Q(t,a),a.leadingComments.push(t);return}}let i=n.children[1];Q(t,i),i.endComments.push(t)}function Wo(t,e){if(t.position.start.offset<e.position.start.offset&&t.position.end.offset>e.position.end.offset)switch(t.type){case"flowMapping":case"flowSequence":return t.children.length===0||e.position.start.line>t.children[t.children.length-1].position.end.line}if(e.position.end.offset<t.position.end.offset)return!1;switch(t.type){case"sequenceItem":return e.position.start.column>t.position.start.column;case"mappingKey":case"mappingValue":return e.position.start.column>t._parent.position.start.column&&(t.children.length===0||t.children.length===1&&t.children[0].type!=="blockFolded"&&t.children[0].type!=="blockLiteral")&&(t.type==="mappingValue"||Ir(t));default:return!1}}function Ir(t){return t.position.start!==t.position.end&&(t.children.length===0||t.position.start.offset!==t.children[0].position.start.offset)}function Lr(t,e,n){return{type:"root",position:t,children:e,comments:n}}function X(t,e){return{start:t,end:e}}function Pr(t){return{start:t,end:t}}function vr(t,e){return{type:"comment",position:e.transformRange([t.offset,t.offset+t.source.length]),value:t.source.slice(1)}}function Dr(t,e){return{type:"anchor",position:t,value:e}}function xr(t,e,n){return{anchor:e,tag:t,middleComments:n}}function Mr(t,e){return{type:"tag",position:t,value:e}}function $r(t,e,n){let s=[],r=null,i=null,o=null;for(let a of e){let l=[a.offset,a.offset+a.source.length];switch(a.type){case"tag":{r??(r=l);let c=t.tag??a.source.slice(a.source.startsWith("!!")?2:1);c==="!"&&(c="tag:yaml.org,2002:str"),i=Mr(n.transformRange(l),c)}break;case"anchor":r??(r=l),o=Dr(n.transformRange(l),t.anchor);break;case"comment":{let c=n.transformComment(a);r&&r[0]<=l[0]&&l[1]<=t.range[0]&&s.push(c);break}default:throw new Error(`Unexpected content property token type: ${a.type}`)}}return xr(i,o,s)}function Br(t,e,n){return{type:"alias",position:t,leadingComments:[],trailingComment:null,...e,value:n}}function*q(...t){for(let e of t)if(e)for(let n of e)Xo(n)||(yield n)}function Xo(t){return t.type==="space"||t.type==="newline"}function ke(t){return t.type==="comment"||t.type==="tag"||t.type==="anchor"}function v(t,e){let n=[];for(let s of q(t))s.type==="comment"?e.transformComment(s):n.push(s);return n}function Rr(t,e,n){let s=t.srcToken;for(let r of v(s.end,e))throw new Error(`Unexpected token type in alias end: ${r.type}`);return Br(e.transformRange(t.range),e.transformContentProperties(t,n.tokens),t.source)}function qr(t){return{...t,type:"blockFolded"}}function Fr(t,e,n,s,r,i){return{type:"blockValue",position:t,leadingComments:[],...e,chomping:n,indent:s,value:r,indicatorComment:i}}function cn(t,e,n,s){let r=null,i=null;for(let a of q(e.props))if(a.type==="comment")i=n.transformComment(a);else if(a.type==="block-scalar-header")r=a;else throw new Error(`Unexpected token type in block value end: ${a.type}`);if(!r)throw new Error("Expected block scalar header token");let o=zo(r.source);return Fr(n.transformRange(t.range),n.transformContentProperties(t,s.tokens),o.chomping,o.indent,t.source,i)}function zo(t){let e=/([+-]?)(\d*)([+-]?)$/u.exec(t),n=null,s="clip";if(e){n=e[2]?Number(e[2]):null;let r=e[3]||e[1];s=r==="+"?"keep":r==="-"?"strip":"clip"}return{chomping:s,indent:n}}function Kr(t,e,n){let s=t.srcToken;if(!s||s.type!=="block-scalar")throw new Error("Expected block scalar srcToken");return qr(cn(t,s,e,n))}function Yr(t){return{...t,type:"blockLiteral"}}function Ur(t,e,n){let s=t.srcToken;if(!s||s.type!=="block-scalar")throw new Error("Expected block scalar srcToken");return Yr(cn(t,s,e,n))}function fn(t,e,n){return{type:"flowCollection",position:t,leadingComments:[],trailingComment:null,endComments:[],...e,children:n}}function jr(t,e,n){return{...fn(t,e,n),type:"flowMapping"}}function Ct(t,e,n){return{type:"flowMappingItem",position:t,leadingComments:[],children:[e,n]}}function Vr(t,e){return{type:"mappingKey",position:t,trailingComment:null,endComments:[],children:e?[e]:[]}}function cs(t,e){return{type:"mappingValue",position:t,leadingComments:[],trailingComment:null,endComments:[],children:e?[e]:[]}}function Se(t,e,n,s){var r;let i=[],o=null;for(let h of q(e.start)){if(ke(h)){i.push(h);continue}if(h.type==="explicit-key-ind"){o=h;continue}if(h.type==="comma")continue;throw new Error(`Unexpected token type in collection item start: ${h.type}`)}let a=[],l=null;for(let h of q(e.sep)){if(ke(h)){a.push(h);continue}if(h.type==="map-value-ind"){l=h;continue}throw new Error(`Unexpected token type in collection item sep: ${h.type}`)}let c=o?.offset??((r=e.key)===null||r===void 0?void 0:r.offset)??l?.offset??e.value.offset,u=[c,e.key?t.key.range[1]:o?o.offset+o.source.length:c],f=null;if(t.value){var p;let h=l?.offset??((p=e.value)===null||p===void 0?void 0:p.offset)??t.value.range[0];f=[h,e.value?t.value.range[1]:l?l.offset+l.source.length:h]}return Zo(t,n,s,{range:u,props:{tokens:i}},{range:f,props:{tokens:a}})}function Zo(t,e,n,s,r){let i=null;Nt(t.key,s.props)?v(s.props.tokens,e):i=e.transformNode(t.key,s.props);let o=null;Nt(t.value,r.props)?v(r.props.tokens,e):o=e.transformNode(t.value,r.props);let a=Vr(e.transformRange([s.range?s.range[0]:i.position.start.offset,i?i.position.end.offset:s.range[1]]),i),l=o||r.range?cs(e.transformRange([r.range?r.range[0]:o.position.start.offset,o?o.position.end.offset:r.range[0]+1]),o):null;return n(X(a.position.start,l?l.position.end:a.position.end),a,l||cs(Pr(a.position.end),null))}function Gr(t,e,n){let s=t.srcToken;if(!s||s.type!=="flow-collection")throw new Error("Expected flow-collection CST node for flow map");let r=t.items.map((o,a)=>{let l=s.items[a];return Se(o,l,e,Ct)});if(t.items.length<s.items.length)for(let o=t.items.length;o<s.items.length;o++){let a=s.items[o];for(let l of v(a.start,e)){if(l.type==="comma")continue;throw new Error(`Unexpected token type in collection item start: ${l.type}`)}}let i=null;for(let o of v(s.end,e)){if(o.type==="flow-map-end"){i=o;continue}throw new Error(`Unexpected token type in flow map end: ${o.type}`)}if(!i)throw new Error("Expected flow-map-end token");return jr(e.transformRange([s.start.offset,i.offset+i.source.length]),e.transformContentProperties(t,n.tokens),r)}function Qr(t,e,n){return{...fn(t,e,n),type:"flowSequence"}}function Hr(t,e){return{type:"flowSequenceItem",position:t,children:[e]}}function se(t){return t[t.length-1]}var un=Symbol.for("yaml.alias"),pn=Symbol.for("yaml.document"),re=Symbol.for("yaml.map"),fs=Symbol.for("yaml.pair"),z=Symbol.for("yaml.scalar"),Ee=Symbol.for("yaml.seq"),V=Symbol.for("yaml.node.type"),Z=t=>!!t&&typeof t=="object"&&t[V]===un,fe=t=>!!t&&typeof t=="object"&&t[V]===pn,G=t=>!!t&&typeof t=="object"&&t[V]===re,T=t=>!!t&&typeof t=="object"&&t[V]===fs,N=t=>!!t&&typeof t=="object"&&t[V]===z,ee=t=>!!t&&typeof t=="object"&&t[V]===Ee;function I(t){if(t&&typeof t=="object")switch(t[V]){case re:case Ee:return!0}return!1}function _(t){if(t&&typeof t=="object")switch(t[V]){case un:case re:case z:case Ee:return!0}return!1}var mn=t=>(N(t)||I(t))&&!!t.anchor;var H=Symbol("break visit"),Jr=Symbol("skip children"),ue=Symbol("remove node");function pe(t,e){let n=Wr(e);fe(t)?We(null,t.contents,n,Object.freeze([t]))===ue&&(t.contents=null):We(null,t,n,Object.freeze([]))}pe.BREAK=H;pe.SKIP=Jr;pe.REMOVE=ue;function We(t,e,n,s){let r=Xr(t,e,n,s);if(_(r)||T(r))return zr(t,s,r),We(t,r,n,s);if(typeof r!="symbol"){if(I(e)){s=Object.freeze(s.concat(e));for(let i=0;i<e.items.length;++i){let o=We(i,e.items[i],n,s);if(typeof o=="number")i=o-1;else{if(o===H)return H;o===ue&&(e.items.splice(i,1),i-=1)}}}else if(T(e)){s=Object.freeze(s.concat(e));let i=We("key",e.key,n,s);if(i===H)return H;i===ue&&(e.key=null);let o=We("value",e.value,n,s);if(o===H)return H;o===ue&&(e.value=null)}}return r}async function hn(t,e){let n=Wr(e);fe(t)?await Xe(null,t.contents,n,Object.freeze([t]))===ue&&(t.contents=null):await Xe(null,t,n,Object.freeze([]))}hn.BREAK=H;hn.SKIP=Jr;hn.REMOVE=ue;async function Xe(t,e,n,s){let r=await Xr(t,e,n,s);if(_(r)||T(r))return zr(t,s,r),Xe(t,r,n,s);if(typeof r!="symbol"){if(I(e)){s=Object.freeze(s.concat(e));for(let i=0;i<e.items.length;++i){let o=await Xe(i,e.items[i],n,s);if(typeof o=="number")i=o-1;else{if(o===H)return H;o===ue&&(e.items.splice(i,1),i-=1)}}}else if(T(e)){s=Object.freeze(s.concat(e));let i=await Xe("key",e.key,n,s);if(i===H)return H;i===ue&&(e.key=null);let o=await Xe("value",e.value,n,s);if(o===H)return H;o===ue&&(e.value=null)}}return r}function Wr(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function Xr(t,e,n,s){if(typeof n=="function")return n(t,e,s);if(G(e))return n.Map?.(t,e,s);if(ee(e))return n.Seq?.(t,e,s);if(T(e))return n.Pair?.(t,e,s);if(N(e))return n.Scalar?.(t,e,s);if(Z(e))return n.Alias?.(t,e,s)}function zr(t,e,n){let s=e[e.length-1];if(I(s))s.items[t]=n;else if(T(s))t==="key"?s.key=n:s.value=n;else if(fe(s))s.contents=n;else{let r=Z(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}var ea={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},ta=t=>t.replace(/[!,[\]{}]/g,e=>ea[e]),me=class t{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let s=e.trim().split(/[ \t]+/),r=s.shift();switch(r){case"%TAG":{if(s.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;let[i,o]=s;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[i]=s;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{let o=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,o),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}let[,s,r]=e.match(/^(.*!)([^!]*)$/s);r||n(`The ${e} tag has no suffix`);let i=this.tags[s];if(i)try{return i+decodeURIComponent(r)}catch(o){return n(String(o)),null}return s==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,s]of Object.entries(this.tags))if(e.startsWith(s))return n+ta(e.substring(s.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags),r;if(e&&s.length>0&&_(e.contents)){let i={};pe(e.contents,(o,a)=>{_(a)&&a.tag&&(i[a.tag]=!0)}),r=Object.keys(i)}else r=[];for(let[i,o]of s)i==="!!"&&o==="tag:yaml.org,2002:"||(!e||r.some(a=>a.startsWith(o)))&&n.push(`%TAG ${i} ${o}`);return n.join(` `)}};me.defaultYaml={explicit:!1,version:"1.2"};me.defaultTags={"!!":"tag:yaml.org,2002:"};function dn(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function us(t){let e=new Set;return pe(t,{Value(n,s){s.anchor&&e.add(s.anchor)}}),e}function ps(t,e){for(let n=1;;++n){let s=`${t}${n}`;if(!e.has(s))return s}}function Zr(t,e){let n=[],s=new Map,r=null;return{onAnchor:i=>{n.push(i),r??(r=us(t));let o=ps(e,r);return r.add(o),o},setAnchors:()=>{for(let i of n){let o=s.get(i);if(typeof o=="object"&&o.anchor&&(N(o.node)||I(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=i,a}}},sourceObjects:s}}function Ie(t,e,n,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let r=0,i=s.length;r<i;++r){let o=s[r],a=Ie(t,s,String(r),o);a===void 0?delete s[r]:a!==o&&(s[r]=a)}else if(s instanceof Map)for(let r of Array.from(s.keys())){let i=s.get(r),o=Ie(t,s,r,i);o===void 0?s.delete(r):o!==i&&s.set(r,o)}else if(s instanceof Set)for(let r of Array.from(s)){let i=Ie(t,s,r,r);i===void 0?s.delete(r):i!==r&&(s.delete(r),s.add(i))}else for(let[r,i]of Object.entries(s)){let o=Ie(t,s,r,i);o===void 0?delete s[r]:o!==i&&(s[r]=o)}return t.call(e,n,s)}function B(t,e,n){if(Array.isArray(t))return t.map((s,r)=>B(s,String(r),n));if(t&&typeof t.toJSON=="function"){if(!n||!mn(t))return t.toJSON(e,n);let s={aliasCount:0,count:1,res:void 0};n.anchors.set(t,s),n.onCreate=i=>{s.res=i,delete n.onCreate};let r=t.toJSON(e,n);return n.onCreate&&n.onCreate(r),r}return typeof t=="bigint"&&!n?.keep?Number(t):t}var Le=class{constructor(e){Object.defineProperty(this,V,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:s,onAnchor:r,reviver:i}={}){if(!fe(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},a=B(this,"",o);if(typeof r=="function")for(let{count:l,res:c}of o.anchors.values())r(c,l);return typeof i=="function"?Ie(i,{"":a},"",a):a}};var Ce=class extends Le{constructor(e){super(un),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let s;n?.aliasResolveCache?s=n.aliasResolveCache:(s=[],pe(e,{Node:(i,o)=>{(Z(o)||mn(o))&&s.push(o)}}),n&&(n.aliasResolveCache=s));let r;for(let i of s){if(i===this)break;i.anchor===this.source&&(r=i)}return r}toJSON(e,n){if(!n)return{source:this.source};let{anchors:s,doc:r,maxAliasCount:i}=n,o=this.resolve(r,n);if(!o){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=s.get(o);if(a||(B(o,null,n),a=s.get(o)),a?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=gn(r,o,s)),a.count*a.aliasCount>i)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,n,s){let r=`*${this.source}`;if(e){if(dn(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(e.implicitKey)return`${r} `}return r}};function gn(t,e,n){if(Z(e)){let s=e.resolve(t),r=n&&s&&n.get(s);return r?r.count*r.aliasCount:0}else if(I(e)){let s=0;for(let r of e.items){let i=gn(t,r,n);i>s&&(s=i)}return s}else if(T(e)){let s=gn(t,e.key,n),r=gn(t,e.value,n);return Math.max(s,r)}return 1}var yn=t=>!t||typeof t!="function"&&typeof t!="object",y=class extends Le{constructor(e){super(z),this.value=e}toJSON(e,n){return n?.keep?this.value:B(this.value,e,n)}toString(){return String(this.value)}};y.BLOCK_FOLDED="BLOCK_FOLDED";y.BLOCK_LITERAL="BLOCK_LITERAL";y.PLAIN="PLAIN";y.QUOTE_DOUBLE="QUOTE_DOUBLE";y.QUOTE_SINGLE="QUOTE_SINGLE";var na="tag:yaml.org,2002:";function sa(t,e,n){if(e){let s=n.filter(i=>i.tag===e),r=s.find(i=>!i.format)??s[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return n.find(s=>s.identify?.(t)&&!s.format)}function Ne(t,e,n){if(fe(t)&&(t=t.contents),_(t))return t;if(T(t)){let f=n.schema[re].createNode?.(n.schema,null,n);return f.items.push(t),f}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:s,onAnchor:r,onTagObj:i,schema:o,sourceObjects:a}=n,l;if(s&&t&&typeof t=="object"){if(l=a.get(t),l)return l.anchor??(l.anchor=r(t)),new Ce(l.anchor);l={anchor:null,node:null},a.set(t,l)}e?.startsWith("!!")&&(e=na+e.slice(2));let c=sa(t,e,o.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let f=new y(t);return l&&(l.node=f),f}c=t instanceof Map?o[re]:Symbol.iterator in Object(t)?o[Ee]:o[re]}i&&(i(c),delete n.onTagObj);let u=c?.createNode?c.createNode(n.schema,t,n):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(n.schema,t,n):new y(t);return e?u.tag=e:c.default||(u.tag=c.tag),l&&(l.node=u),u}function At(t,e,n){let s=n;for(let r=e.length-1;r>=0;--r){let i=e[r];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){let o=[];o[i]=s,s=o}else s=new Map([[i,s]])}return Ne(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var Ze=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,ze=class extends Le{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(s=>_(s)||T(s)?s.clone(e):s),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(Ze(e))this.add(n);else{let[s,...r]=e,i=this.get(s,!0);if(I(i))i.addIn(r,n);else if(i===void 0&&this.schema)this.set(s,At(this.schema,r,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}deleteIn(e){let[n,...s]=e;if(s.length===0)return this.delete(n);let r=this.get(n,!0);if(I(r))return r.deleteIn(s);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}getIn(e,n){let[s,...r]=e,i=this.get(s,!0);return r.length===0?!n&&N(i)?i.value:i:I(i)?i.getIn(r,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!T(n))return!1;let s=n.value;return s==null||e&&N(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){let[n,...s]=e;if(s.length===0)return this.has(n);let r=this.get(n,!0);return I(r)?r.hasIn(s):!1}setIn(e,n){let[s,...r]=e;if(r.length===0)this.set(s,n);else{let i=this.get(s,!0);if(I(i))i.setIn(r,n);else if(i===void 0&&this.schema)this.set(s,At(this.schema,r,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}};var ei=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function te(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var he=(t,e,n)=>t.endsWith(` `)?te(n,e):n.includes(` `)?` `+te(n,e):(t.endsWith(" ")?"":" ")+n;var ms="flow",wn="block",Tt="quoted";function Ot(t,e,n="flow",{indentAtStart:s,lineWidth:r=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!r||r<0)return t;r<i&&(i=0);let l=Math.max(1+i,1+r-e.length);if(t.length<=l)return t;let c=[],u={},f=r-e.length;typeof s=="number"&&(s>r-Math.max(2,i)?c.push(0):f=r-s);let p,h,g=!1,m=-1,d=-1,b=-1;n===wn&&(m=ti(t,m,e.length),m!==-1&&(f=m+l));for(let S;S=t[m+=1];){if(n===Tt&&S==="\\"){switch(d=m,t[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}b=m}if(S===` `)n===wn&&(m=ti(t,m,e.length)),f=m+e.length+l,p=void 0;else{if(S===" "&&h&&h!==" "&&h!==` `&&h!==" "){let E=t[m+1];E&&E!==" "&&E!==` `&&E!==" "&&(p=m)}if(m>=f)if(p)c.push(p),f=p+l,p=void 0;else if(n===Tt){for(;h===" "||h===" ";)h=S,S=t[m+=1],g=!0;let E=m>b+1?m-2:d-1;if(u[E])return t;c.push(E),u[E]=!0,f=E+l,p=void 0}else g=!0}h=S}if(g&&a&&a(),c.length===0)return t;o&&o();let k=t.slice(0,c[0]);for(let S=0;S<c.length;++S){let E=c[S],C=c[S+1]||t.length;E===0?k=` ${e}${t.slice(0,C)}`:(n===Tt&&u[E]&&(k+=`${t[E]}\\`),k+=` ${e}${t.slice(E+1,C)}`)}return k}function ti(t,e,n){let s=e,r=e+1,i=t[r];for(;i===" "||i===" ";)if(e<r+n)i=t[++e];else{do i=t[++e];while(i&&i!==` `);s=e,r=e+1,i=t[r]}return s}var kn=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Sn=t=>/^(%|---|\.\.\.)/m.test(t);function ra(t,e,n){if(!e||e<0)return!1;let s=e-n,r=t.length;if(r<=s)return!1;for(let i=0,o=0;i<r;++i)if(t[i]===` `){if(i-o>s)return!0;if(o=i+1,r-o<=s)return!1}return!0}function _t(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:s}=e,r=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(Sn(t)?" ":""),o="",a=0;for(let l=0,c=n[l];c;c=n[++l])if(c===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(o+=n.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(n[l+1]){case"u":{o+=n.slice(a,l);let u=n.substr(l+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=n.substr(l,6)}l+=5,a=l+1}break;case"n":if(s||n[l+2]==='"'||n.length<r)l+=1;else{for(o+=n.slice(a,l)+` `;n[l+2]==="\\"&&n[l+3]==="n"&&n[l+4]!=='"';)o+=` `,l+=2;o+=i,n[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+n.slice(a):n,s?o:Ot(o,i,Tt,kn(e,!1))}function hs(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(` `)||/[ \t]\n|\n[ \t]/.test(t))return _t(t,e);let n=e.indent||(Sn(t)?" ":""),s="'"+t.replace(/'/g,"''").replace(/\n+/g,`$& ${n}`)+"'";return e.implicitKey?s:Ot(s,n,ms,kn(e,!1))}function et(t,e){let{singleQuote:n}=e.options,s;if(n===!1)s=_t;else{let r=t.includes('"'),i=t.includes("'");r&&!i?s=hs:i&&!r?s=_t:s=n?hs:_t}return s(t,e)}var ds;try{ds=new RegExp(`(^|(?<! )) +(?! |$)`,"g")}catch{ds=/\n+(?!\n|$)/g}function bn({comment:t,type:e,value:n},s,r,i){let{blockQuote:o,commentString:a,lineWidth:l}=s.options;if(!o||/\n[\t ]+$/.test(n))return et(n,s);let c=s.indent||(s.forceBlockIndent||Sn(n)?" ":""),u=o==="literal"?!0:o==="folded"||e===y.BLOCK_FOLDED?!1:e===y.BLOCK_LITERAL?!0:!ra(n,l,c.length);if(!n)return u?`| `:`> `;let f,p;for(p=n.length;p>0;--p){let C=n[p-1];if(C!==` `&&C!==" "&&C!==" ")break}let h=n.substring(p),g=h.indexOf(` `);g===-1?f="-":n===h||g!==h.length-1?(f="+",i&&i()):f="",h&&(n=n.slice(0,-h.length),h[h.length-1]===` `&&(h=h.slice(0,-1)),h=h.replace(ds,`$&${c}`));let m=!1,d,b=-1;for(d=0;d<n.length;++d){let C=n[d];if(C===" ")m=!0;else if(C===` `)b=d;else break}let k=n.substring(0,b<d?b+1:d);k&&(n=n.substring(k.length),k=k.replace(/\n+/g,`$&${c}`));let E=(m?c?"2":"1":"")+f;if(t&&(E+=" "+a(t.replace(/ ?[\r\n]+/g," ")),r&&r()),!u){let C=n.replace(/\n+/g,` $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),A=!1,L=kn(s,!0);o!=="folded"&&e!==y.BLOCK_FOLDED&&(L.onOverflow=()=>{A=!0});let w=Ot(`${k}${C}${h}`,c,wn,L);if(!A)return`>${E} ${c}${w}`}return n=n.replace(/\n+/g,`$&${c}`),`|${E} ${c}${k}${n}${h}`}function ia(t,e,n,s){let{type:r,value:i}=t,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:u}=e;if(a&&i.includes(` `)||u&&/[[\]{},]/.test(i))return et(i,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||u||!i.includes(` `)?et(i,e):bn(t,e,n,s);if(!a&&!u&&r!==y.PLAIN&&i.includes(` `))return bn(t,e,n,s);if(Sn(i)){if(l==="")return e.forceBlockIndent=!0,bn(t,e,n,s);if(a&&l===c)return et(i,e)}let f=i.replace(/\n+/g,`$& ${l}`);if(o){let p=m=>m.default&&m.tag!=="tag:yaml.org,2002:str"&&m.test?.test(f),{compat:h,tags:g}=e.doc.schema;if(g.some(p)||h?.some(p))return et(i,e)}return a?f:Ot(f,l,ms,kn(e,!1))}function $e(t,e,n,s){let{implicitKey:r,inFlow:i}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==y.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=y.QUOTE_DOUBLE);let l=u=>{switch(u){case y.BLOCK_FOLDED:case y.BLOCK_LITERAL:return r||i?et(o.value,e):bn(o,e,n,s);case y.QUOTE_DOUBLE:return _t(o.value,e);case y.QUOTE_SINGLE:return hs(o.value,e);case y.PLAIN:return ia(o,e,n,s);default:return null}},c=l(a);if(c===null){let{defaultKeyType:u,defaultStringType:f}=e.options,p=r&&u||f;if(c=l(p),c===null)throw new Error(`Unsupported default string type ${p}`)}return c}function En(t,e){let n=Object.assign({blockQuote:!0,commentString:ei,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),s;switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:s,options:n}}function oa(t,e){if(e.tag){let r=t.filter(i=>i.tag===e.tag);if(r.length>0)return r.find(i=>i.format===e.format)??r[0]}let n,s;if(N(e)){s=e.value;let r=t.filter(i=>i.identify?.(s));if(r.length>1){let i=r.filter(o=>o.test);i.length>0&&(r=i)}n=r.find(i=>i.format===e.format)??r.find(i=>!i.format)}else s=e,n=t.find(r=>r.nodeClass&&s instanceof r.nodeClass);if(!n){let r=s?.constructor?.name??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${r} value`)}return n}function aa(t,e,{anchors:n,doc:s}){if(!s.directives)return"";let r=[],i=(N(t)||I(t))&&t.anchor;i&&dn(i)&&(n.add(i),r.push(`&${i}`));let o=t.tag??(e.default?null:e.tag);return o&&r.push(s.directives.tagString(o)),r.join(" ")}function Ae(t,e,n,s){if(T(t))return t.toString(e,n,s);if(Z(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let r,i=_(t)?t:e.doc.createNode(t,{onTagObj:l=>r=l});r??(r=oa(e.doc.schema.tags,i));let o=aa(i,r,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof r.stringify=="function"?r.stringify(i,e,n,s):N(i)?$e(i,e,n,s):i.toString(e,n,s);return o?N(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o} ${e.indent}${a}`:a}function ni({key:t,value:e},n,s,r){let{allNullValues:i,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:f}}=n,p=_(t)&&t.comment||null;if(f){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(I(t)||!_(t)&&typeof t=="object"){let L="With simple keys, collection cannot be used as a key value";throw new Error(L)}}let h=!f&&(!t||p&&e==null&&!n.inFlow||I(t)||(N(t)?t.type===y.BLOCK_FOLDED||t.type===y.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!h&&(f||!i),indent:a+l});let g=!1,m=!1,d=Ae(t,n,()=>g=!0,()=>m=!0);if(!h&&!n.inFlow&&d.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(n.inFlow){if(i||e==null)return g&&s&&s(),d===""?"?":h?`? ${d}`:d}else if(i&&!f||e==null&&h)return d=`? ${d}`,p&&!g?d+=he(d,n.indent,c(p)):m&&r&&r(),d;g&&(p=null),h?(p&&(d+=he(d,n.indent,c(p))),d=`? ${d} ${a}:`):(d=`${d}:`,p&&(d+=he(d,n.indent,c(p))));let b,k,S;_(e)?(b=!!e.spaceBefore,k=e.commentBefore,S=e.comment):(b=!1,k=null,S=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!h&&!p&&N(e)&&(n.indentAtStart=d.length+1),m=!1,!u&&l.length>=2&&!n.inFlow&&!h&&ee(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let E=!1,C=Ae(e,n,()=>E=!0,()=>m=!0),A=" ";if(p||b||k){if(A=b?` `:"",k){let L=c(k);A+=` ${te(L,n.indent)}`}C===""&&!n.inFlow?A===` `&&S&&(A=` `):A+=` ${n.indent}`}else if(!h&&I(e)){let L=C[0],w=C.indexOf(` `),M=w!==-1,Te=n.inFlow??e.flow??e.items.length===0;if(M||!Te){let qe=!1;if(M&&(L==="&"||L==="!")){let $=C.indexOf(" ");L==="&"&&$!==-1&&$<w&&C[$+1]==="!"&&($=C.indexOf(" ",$+1)),($===-1||w<$)&&(qe=!0)}qe||(A=` ${n.indent}`)}}else(C===""||C[0]===` `)&&(A="");return d+=A+C,n.inFlow?E&&s&&