PageSourceSearch

https://developers.vendr.com/assets/index-DmNq2fbN-Wnz-YQFi.js

js vendr.com collected 2026-09-24 08:43:44 UTC 98,745 bytes, 132 lines download raw bytes

1const st=Symbol.for("yaml.alias"),He=Symbol.for("yaml.document"),Y=Symbol.for("yaml.map"),Lt=Symbol.for("yaml.pair"),U=Symbol.for("yaml.scalar"),ce=Symbol.for("yaml.seq"),M=Symbol.for("yaml.node.type"),Q=n=>!!n&&typeof n=="object"&&n[M]===st,we=n=>!!n&&typeof n=="object"&&n[M]===He,ke=n=>!!n&&typeof n=="object"&&n[M]===Y,I=n=>!!n&&typeof n=="object"&&n[M]===Lt,O=n=>!!n&&typeof n=="object"&&n[M]===U,ve=n=>!!n&&typeof n=="object"&&n[M]===ce;function T(n){if(n&&typeof n=="object")switch(n[M]){case Y:case ce:return!0}return!1}function x(n){if(n&&typeof n=="object")switch(n[M]){case st:case Y:case U:case ce:return!0}return!1}const $t=n=>(O(n)||T(n))&&!!n.anchor,K=Symbol("break visit"),Ct=Symbol("skip children"),q=Symbol("remove node");function ue(n,e){const t=_t(e);we(n)?ee(null,n.contents,t,Object.freeze([n]))===q&&(n.contents=null):ee(null,n,t,Object.freeze([]))}ue.BREAK=K;ue.SKIP=Ct;ue.REMOVE=q;function ee(n,e,t,s){const r=Kt(n,e,t,s);if(x(r)||I(r))return jt(n,s,r),ee(n,r,t,s);if(typeof r!="symbol"){if(T(e)){s=Object.freeze(s.concat(e));for(let i=0;i<e.items.length;++i){const o=ee(i,e.items[i],t,s);if(typeof o=="number")i=o-1;else{if(o===K)return K;o===q&&(e.items.splice(i,1),i-=1)}}}else if(I(e)){s=Object.freeze(s.concat(e));const i=ee("key",e.key,t,s);if(i===K)return K;i===q&&(e.key=null);const o=ee("value",e.value,t,s);if(o===K)return K;o===q&&(e.value=null)}}return r}async function nt(n,e){const t=_t(e);we(n)?await te(null,n.contents,t,Object.freeze([n]))===q&&(n.contents=null):await te(null,n,t,Object.freeze([]))}nt.BREAK=K;nt.SKIP=Ct;nt.REMOVE=q;async function te(n,e,t,s){const r=await Kt(n,e,t,s);if(x(r)||I(r))return jt(n,s,r),te(n,r,t,s);if(typeof r!="symbol"){if(T(e)){s=Object.freeze(s.concat(e));for(let i=0;i<e.items.length;++i){const o=await te(i,e.items[i],t,s);if(typeof o=="number")i=o-1;else{if(o===K)return K;o===q&&(e.items.splice(i,1),i-=1)}}}else if(I(e)){s=Object.freeze(s.concat(e));const i=await te("key",e.key,t,s);if(i===K)return K;i===q&&(e.key=null);const o=await te("value",e.value,t,s);if(o===K)return K;o===q&&(e.value=null)}}return r}function _t(n){return typeof n=="object"&&(n.Collection||n.Node||n.Value)?Object.assign({Alias:n.Node,Map:n.Node,Scalar:n.Node,Seq:n.Node},n.Value&&{Map:n.Value,Scalar:n.Value,Seq:n.Value},n.Collection&&{Map:n.Collection,Seq:n.Collection},n):n}function Kt(n,e,t,s){if(typeof t=="function")return t(n,e,s);if(ke(e))return t.Map?.(n,e,s);if(ve(e))return t.Seq?.(n,e,s);if(I(e))return t.Pair?.(n,e,s);if(O(e))return t.Scalar?.(n,e,s);if(Q(e))return t.Alias?.(n,e,s)}function jt(n,e,t){const s=e[e.length-1];if(T(s))s.items[n]=t;else if(I(s))n==="key"?s.key=t:s.value=t;else if(we(s))s.contents=t;else{const r=Q(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const ws={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},ks=n=>n.replace(/[!,[\]{}]/g,e=>ws[e]);class C{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},C.defaultYaml,e),this.tags=Object.assign({},C.defaultTags,t)}clone(){const e=new C(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new C(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:C.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},C.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:C.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},C.defaultTags),this.atNextDocument=!1);const s=e.trim().split(/[ \t]+/),r=s.shift();switch(r){case"%TAG":{if(s.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;const[i,o]=s;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;const[i]=s;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{const o=/^\d+\.\d+$/.test(i);return t(6,`Unsupported YAML version ${i}`,o),!1}}default:return t(0,`Unknown directive ${r}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e}
1 is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}const[,s,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);const i=this.tags[s];if(i)try{return i+decodeURIComponent(r)}catch(o){return t(String(o)),null}return s==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,s]of Object.entries(this.tags))if(e.startsWith(s))return t+ks(e.substring(s.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let r;if(e&&s.length>0&&x(e.contents)){const i={};ue(e.contents,(o,a)=>{x(a)&&a.tag&&(i[a.tag]=!0)}),r=Object.keys(i)}else r=[];for(const[i,o]of s)i==="!!"&&o==="tag:yaml.org,2002:"||(!e||r.some(a=>a.startsWith(o)))&&t.push(`%TAG ${i} ${o}`);return t.join(`
2`)}}C.defaultYaml={explicit:!1,version:"1.2"};C.defaultTags={"!!":"tag:yaml.org,2002:"};function Bt(n){if(/[\x00-\x19\s,[\]{}]/.test(n)){const e=`Anchor must not contain whitespace or control characters: ${JSON.stringify(n)}`;throw new Error(e)}return!0}function Mt(n){const e=new Set;return ue(n,{Value(t,s){s.anchor&&e.add(s.anchor)}}),e}function Dt(n,e){for(let t=1;;++t){const s=`${n}${t}`;if(!e.has(s))return s}}function vs(n,e){const t=[],s=new Map;let r=null;return{onAnchor:i=>{t.push(i),r??(r=Mt(n));const o=Dt(e,r);return r.add(o),o},setAnchors:()=>{for(const i of t){const o=s.get(i);if(typeof o=="object"&&o.anchor&&(O(o.node)||T(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=i,a}}},sourceObjects:s}}function se(n,e,t,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let r=0,i=s.length;r<i;++r){const o=s[r],a=se(n,s,String(r),o);a===void 0?delete s[r]:a!==o&&(s[r]=a)}else if(s instanceof Map)for(const r of Array.from(s.keys())){const i=s.get(r),o=se(n,s,r,i);o===void 0?s.delete(r):o!==i&&s.set(r,o)}else if(s instanceof Set)for(const r of Array.from(s)){const i=se(n,s,r,r);i===void 0?s.delete(r):i!==r&&(s.delete(r),s.add(i))}else for(const[r,i]of Object.entries(s)){const o=se(n,s,r,i);o===void 0?delete s[r]:o!==i&&(s[r]=o)}return n.call(e,t,s)}function B(n,e,t){if(Array.isArray(n))return n.map((s,r)=>B(s,String(r),t));if(n&&typeof n.toJSON=="function"){if(!t||!$t(n))return n.toJSON(e,t);const s={aliasCount:0,count:1,res:void 0};t.anchors.set(n,s),t.onCreate=i=>{s.res=i,delete t.onCreate};const r=n.toJSON(e,t);return t.onCreate&&t.onCreate(r),r}return typeof n=="bigint"&&!t?.keep?Number(n):n}class rt{constructor(e){Object.defineProperty(this,M,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:s,onAnchor:r,reviver:i}={}){if(!we(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},a=B(this,"",o);if(typeof r=="function")for(const{count:l,res:c}of o.anchors.values())r(c,l);return typeof i=="function"?se(i,{"":a},"",a):a}}class it extends rt{constructor(e){super(st),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){let s;t?.aliasResolveCache?s=t.aliasResolveCache:(s=[],ue(e,{Node:(i,o)=>{(Q(o)||$t(o))&&s.push(o)}}),t&&(t.aliasResolveCache=s));let r;for(const i of s){if(i===this)break;i.anchor===this.source&&(r=i)}return r}toJSON(e,t){if(!t)return{source:this.source};const{anchors:s,doc:r,maxAliasCount:i}=t,o=this.resolve(r,t);if(!o){const 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,t),a=s.get(o)),!a||a.res===void 0){const 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=xe(r,o,s)),a.count*a.aliasCount>
2i)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,t,s){const r=`*${this.source}`;if(e){if(Bt(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const 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 xe(n,e,t){if(Q(e)){const s=e.resolve(n),r=t&&s&&t.get(s);return r?r.count*r.aliasCount:0}else if(T(e)){let s=0;for(const r of e.items){const i=xe(n,r,t);i>s&&(s=i)}return s}else if(I(e)){const s=xe(n,e.key,t),r=xe(n,e.value,t);return Math.max(s,r)}return 1}const Pt=n=>!n||typeof n!="function"&&typeof n!="object";class S extends rt{constructor(e){super(U),this.value=e}toJSON(e,t){return t?.keep?this.value:B(this.value,e,t)}toString(){return String(this.value)}}S.BLOCK_FOLDED="BLOCK_FOLDED";S.BLOCK_LITERAL="BLOCK_LITERAL";S.PLAIN="PLAIN";S.QUOTE_DOUBLE="QUOTE_DOUBLE";S.QUOTE_SINGLE="QUOTE_SINGLE";const Ss="tag:yaml.org,2002:";function Es(n,e,t){if(e){const s=t.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 t.find(s=>s.identify?.(n)&&!s.format)}function ge(n,e,t){if(we(n)&&(n=n.contents),x(n))return n;if(I(n)){const u=t.schema[Y].createNode?.(t.schema,null,t);return u.items.push(n),u}(n instanceof String||n instanceof Number||n instanceof Boolean||typeof BigInt<"u"&&n instanceof BigInt)&&(n=n.valueOf());const{aliasDuplicateObjects:s,onAnchor:r,onTagObj:i,schema:o,sourceObjects:a}=t;let l;if(s&&n&&typeof n=="object"){if(l=a.get(n),l)return l.anchor??(l.anchor=r(n)),new it(l.anchor);l={anchor:null,node:null},a.set(n,l)}e?.startsWith("!!")&&(e=Ss+e.slice(2));let c=Es(n,e,o.tags);if(!c){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){const u=new S(n);return l&&(l.node=u),u}c=n instanceof Map?o[Y]:Symbol.iterator in Object(n)?o[ce]:o[Y]}i&&(i(c),delete t.onTagObj);const d=c?.createNode?c.createNode(t.schema,n,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,n,t):new S(n);return e?d.tag=e:c.default||(d.tag=c.tag),l&&(l.node=d),d}function Ce(n,e,t){let s=t;for(let r=e.length-1;r>=0;--r){const i=e[r];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){const o=[];o[i]=s,s=o}else s=new Map([[i,s]])}return ge(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:n,sourceObjects:new Map})}const pe=n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done;class qt extends rt{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(s=>x(s)||I(s)?s.clone(e):s),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(pe(e))this.add(t);else{const[s,...r]=e,i=this.get(s,!0);if(T(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(s,Ce(this.schema,r,t));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}deleteIn(e){const[t,...s]=e;if(s.length===0)return this.delete(t);const r=this.get(t,!0);if(T(r))return r.deleteIn(s);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${s}`)}getIn(e,t){const[s,...r]=e,i=this.get(s,!0);return r.length===0?!t&&O(i)?i.value:i:T(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!I(t))return!1;const s=t.value;return s==null||e&&O(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){const[t,...s]=e;if(s.length===0)return this.has(t);const r=this.get(t,!0);return T(r)?r.hasIn(s):!1}setIn(e,t){const[s,...r]=e;if(r.length===0)this.set(s,t);else{const i=this.get(s,!0);if(T(i))i.setIn(r,t);else if(i===void 0&&this.schema)this.set(s,Ce(this.schema,r,t));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}}const Ns=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function R(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}const G=(n,e,t)=>n.endsWith(`
3`)?R(t,e):t.includes(`
4`)?`
5`+R(t,e):(n.endsWith(" ")?"":" ")+t,Ut="flow",Qe="block",Le="quoted";function Ke(n,e,t="flow",{indentAtStart:s,lineWidth:r=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!r||r<0)return n;r<i&&(i=0);const l=Math.max(1+i,1+r-e.length);if(n.length<=l)return n;const c=[],d={};let u=r-e.length;typeof s=="number"&&(s>r-Math.max(2,i)?c.push(0):u=r-s);let f,m,y=!1,h=-1,p=-1,b=-1;t===Qe&&(h=wt(n,h,e.length),h!==-1&&(u=h+l));for(let k;k=n[h+=1];){if(t===Le&&k==="\\"){switch(p=h,n[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}b=h}if(k===`
6`)t===Qe&&(h=wt(n,h,e.length)),u=h+e.length+l,f=void 0;else{if(k===" "&&m&&m!==" "&&m!==`
7`&&m!=="	"){const v=n[h+1];v&&v!==" "&&v!==`
8`&&v!=="	"&&(f=h)}if(h>=u)if(f)c.push(f),u=f+l,f=void 0;else if(t===Le){for(;m===" "||m==="	";)m=k,k=n[h+=1],y=!0;const v=h>b+1?h-2:p-1;if(d[v])return n;c.push(v),d[v]=!0,u=v+l,f=void 0}else y=!0}m=k}if(y&&a&&a(),c.length===0)return n;o&&o();let w=n.slice(0,c[0]);for(let k=0;k<c.length;++k){const v=c[k],N=c[k+1]||n.length;v===0?w=`
9${e}${n.slice(0,N)}`:(t===Le&&d[v]&&(w+=`${n[v]}\\`),w+=`
10${e}${n.slice(v+1,N)}`)}return w}function wt(n,e,t){let s=e,r=e+1,i=n[r];for(;i===" "||i==="	";)if(e<r+t)i=n[++e];else{do i=n[++e];while(i&&i!==`
11`);s=e,r=e+1,i=n[r]}return s}const je=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),Be=n=>/^(%|---|\.\.\.)/m.test(n);function Os(n,e,t){if(!e||e<0)return!1;const s=e-t,r=n.length;if(r<=s)return!1;for(let i=0,o=0;i<r;++i)if(n[i]===`
12`){if(i-o>s)return!0;if(o=i+1,r-o<=s)return!1}return!0}function ye(n,e){const t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;const{implicitKey:s}=e,r=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(Be(n)?"  ":"");let o="",a=0;for(let l=0,c=t[l];c;c=t[++l])if(c===" "&&t[l+1]==="\\"&&t[l+2]==="n"&&(o+=t.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(t[l+1]){case"u":{o+=t.slice(a,l);const d=t.substr(l+2,4);switch(d){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:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=t.substr(l,6)}l+=5,a=l+1}break;case"n":if(s||t[l+2]==='"'||t.length<r)l+=1;else{for(o+=t.slice(a,l)+`
13
14`;t[l+2]==="\\"&&t[l+3]==="n"&&t[l+4]!=='"';)o+=`
15`,l+=2;o+=i,t[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+t.slice(a):t,s?o:Ke(o,i,Le,je(e,!1))}function Xe(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
16`)||/[ \t]\n|\n[ \t]/.test(n))return ye(n,e);const t=e.indent||(Be(n)?"  ":""),s="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
17${t}`)+"'";return e.implicitKey?s:Ke(s,t,Ut,je(e,!1))}function ne(n,e){const{singleQuote:t}=e.options;let s;if(t===!1)s=ye;else{const r=n.includes('"'),i=n.includes("'");r&&!i?s=Xe:i&&!r?s=ye:s=t?Xe:ye}return s(n,e)}let ze;try{ze=new RegExp(`(^|(?<!
18))
19+(?!
20|$)`,"g")}catch{ze=/\n+(?!\n|$)/g}function $e({comment:n,type:e,value:t},s,r,i){const{blockQuote:o,commentString:a,lineWidth:l}=s.options;if(!o||/\n[\t ]+$/.test(t)||/^\s*$/.test(t))return ne(t,s);const c=s.indent||(s.forceBlockIndent||Be(t)?"  ":""),d=o==="literal"?!0:o==="folded"||e===S.BLOCK_FOLDED?!1:e===S.BLOCK_LITERAL?!0:!Os(t,l,c.length);if(!t)return d?`|
21`:`>
22`;let u,f;for(f=t.length;f>0;--f){const v=t[f-1];if(v!==`
23`&&v!=="	"&&v!==" ")break}let m=t.substring(f);const y=m.indexOf(`
24`);y===-1?u="-":t===m||y!==m.length-1?(u="+",i&&i()):u="",m&&(t=t.slice(0,-m.length),m[m.length-1]===`
25`&&(m=m.slice(0,-1)),m=m.replace(ze,`$&${c}`));let h=!1,p,b=-1;for(p=0;p<t.length;++p){const v=t[p];if(v===" ")h=!0;else if(v===`
26`)b=p;else break}let w=t.substring(0,b<p?b+1:p);w&&(t=t.substring(w.length),w=w.replace(/\n+/g,`$&${c}`));let k=(h?c?"2":"1":"")+u;if(n&&(k+=" "+a(n.replace(/ ?[\r\n]+/g," ")),r&&r()),!d){const v=t.replace(/\n+/g,`
27$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let N=!1;const E=je(s,!0);o!=="folded"&&e!==S.BLOCK_FOLDED&&(E.onOverflow=()=>{N=!0});const A=Ke(`${w}${v}${m}`,c,Qe,E);if(!N)return`>${k}
28${c}${A}`}return t=t.replace(/\n+/g,`$&${c}`),`|${k}
29${c}${w}${t}${m}`}function As(n,e,t,s){const{type:r,value:i}=n,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:d}=e;if(a&&i.includes(`
30`)||d&&/[[\]{},]/.test(i))return ne(i,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||d||!i.includes(`
31`)?ne(i,e):$e(n,e,t,s);if(!a&&!d&&r!==S.PLAIN&&i.includes(`
32`))return $e(n,e,t,s);if(Be(i)){if(l==="")return e.forceBlockIndent=!0,$e(n,e,t,s);if(a&&l===c)return ne(i,e)}const u=i.replace(/\n+/g,`$&
33${l}`);if(o){const f=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(u),{compat:m,tags:y}=e.doc.schema;if(y.some(f)||m?.some(f))return ne(i,e)}return a?u:Ke(u,l,Ut,je(e,!1))}function ot(n,e,t,s){const{implicitKey:r,inFlow:i}=e,o=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)});let{type:a}=n;a!==S.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=S.QUOTE_DOUBLE);const l=d=>{switch(d){case S.BLOCK_FOLDED:case S.BLOCK_LITERAL:return r||i?ne(o.value,e):$e(o,e,t,s);case S.QUOTE_DOUBLE:return ye(o.value,e);case S.QUOTE_SINGLE:return Xe(o.value,e);case S.PLAIN:return As(o,e,t,s);default:return null}};let c=l(a);if(c===null){const{defaultKeyType:d,defaultStringType:u}=e.options,f=r&&d||u;if(c=l(f),c===null)throw new Error(`Unsupported default string type ${f}`)}return c}function Rt(n,e){const t=Object.assign({blockQuote:!0,commentString:Ns,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,trueStr:"true",verifyAliasOrder:!0},n.schema.toStringOptions,e);let s;switch(t.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:n,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):"  ",inFlow:s,options:t}}function Is(n,e){if(e.tag){const r=n.filter(i=>i.tag===e.tag);if(r.length>0)return r.find(i=>i.format===e.format)??r[0]}let t,s;if(O(e)){s=e.value;let r=n.filter(i=>i.identify?.(s));if(r.length>1){const i=r.filter(o=>o.test);i.length>0&&(r=i)}t=r.find(i=>i.format===e.format)??r.find(i=>!i.format)}else s=e,t=n.find(r=>
33r.nodeClass&&s instanceof r.nodeClass);if(!t){const r=s?.constructor?.name??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${r} value`)}return t}function Ts(n,e,{anchors:t,doc:s}){if(!s.directives)return"";const r=[],i=(O(n)||T(n))&&n.anchor;i&&Bt(i)&&(t.add(i),r.push(`&${i}`));const o=n.tag??(e.default?null:e.tag);return o&&r.push(s.directives.tagString(o)),r.join(" ")}function oe(n,e,t,s){if(I(n))return n.toString(e,t,s);if(Q(n)){if(e.doc.directives)return n.toString(e);if(e.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(n):e.resolvedAliases=new Set([n]),n=n.resolve(e.doc)}let r;const i=x(n)?n:e.doc.createNode(n,{onTagObj:l=>r=l});r??(r=Is(e.doc.schema.tags,i));const o=Ts(i,r,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);const a=typeof r.stringify=="function"?r.stringify(i,e,t,s):O(i)?ot(i,e,t,s):i.toString(e,t,s);return o?O(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
34${e.indent}${a}`:a}function xs({key:n,value:e},t,s,r){const{allNullValues:i,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:d,simpleKeys:u}}=t;let f=x(n)&&n.comment||null;if(u){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(T(n)||!x(n)&&typeof n=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let m=!u&&(!n||f&&e==null&&!t.inFlow||T(n)||(O(n)?n.type===S.BLOCK_FOLDED||n.type===S.BLOCK_LITERAL:typeof n=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!m&&(u||!i),indent:a+l});let y=!1,h=!1,p=oe(n,t,()=>y=!0,()=>h=!0);if(!m&&!t.inFlow&&p.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(t.inFlow){if(i||e==null)return y&&s&&s(),p===""?"?":m?`? ${p}`:p}else if(i&&!u||e==null&&m)return p=`? ${p}`,f&&!y?p+=G(p,t.indent,c(f)):h&&r&&r(),p;y&&(f=null),m?(f&&(p+=G(p,t.indent,c(f))),p=`? ${p}
35${a}:`):(p=`${p}:`,f&&(p+=G(p,t.indent,c(f))));let b,w,k;x(e)?(b=!!e.spaceBefore,w=e.commentBefore,k=e.comment):(b=!1,w=null,k=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!m&&!f&&O(e)&&(t.indentAtStart=p.length+1),h=!1,!d&&l.length>=2&&!t.inFlow&&!m&&ve(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let v=!1;const N=oe(e,t,()=>v=!0,()=>h=!0);let E=" ";if(f||b||w){if(E=b?`
36`:"",w){const A=c(w);E+=`
37${R(A,t.indent)}`}
37N===""&&!t.inFlow?E===`
38`&&(E=`
39
40`):E+=`
41${t.indent}`}else if(!m&&T(e)){const A=N[0],g=N.indexOf(`
42`),L=g!==-1,V=t.inFlow??e.flow??e.items.length===0;if(L||!V){let X=!1;if(L&&(A==="&"||A==="!")){let $=N.indexOf(" ");A==="&"&&$!==-1&&$<g&&N[$+1]==="!"&&($=N.indexOf(" ",$+1)),($===-1||g<$)&&(X=!0)}X||(E=`
43${t.indent}`)}}else(N===""||N[0]===`
44`)&&(E="");return p+=E+N,t.inFlow?v&&s&&s():k&&!v?p+=G(p,t.indent,c(k)):h&&r&&r(),p}function Ft(n,e){(n==="debug"||n==="warn")&&console.warn(e)}const Ne="<<",F={identify:n=>n===Ne||typeof n=="symbol"&&n.description===Ne,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new S(Symbol(Ne)),{addToJSMap:Vt}),stringify:()=>Ne},Ls=(n,e)=>(F.identify(e)||O(e)&&(!e.type||e.type===S.PLAIN)&&F.identify(e.value))&&n?.doc.schema.tags.some(t=>t.tag===F.tag&&t.default);function Vt(n,e,t){if(t=n&&Q(t)?t.resolve(n.doc):t,ve(t))for(const s of t.items)Fe(n,e,s);else if(Array.isArray(t))for(const s of t)Fe(n,e,s);else Fe(n,e,t)}function Fe(n,e,t){const s=n&&Q(t)?t.resolve(n.doc):t;if(!ke(s))throw new Error("Merge sources must be maps or map aliases");const r=s.toJSON(null,n,Map);for(const[i,o]of r)e instanceof Map?e.has(i)||e.set(i,o):e instanceof Set?e.add(i):Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Jt(n,e,{key:t,value:s}){if(x(t)&&t.addToJSMap)t.addToJSMap(n,e,s);else if(Ls(n,t))Vt(n,e,s);else{const r=B(t,"",n);if(e instanceof Map)e.set(r,B(s,r,n));else if(e instanceof Set)e.add(r);else{const i=$s(t,r,n),o=B(s,i,n);i in e?Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[i]=o}}return e}function $s(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(x(n)&&t?.doc){const s=Rt(t.doc,{});s.anchors=new Set;for(const i of t.anchors.keys())s.anchors.add(i.anchor);s.inFlow=!0,s.inStringifyKey=!0;const r=n.toString(s);if(!t.mapKeyWarned){let i=JSON.stringify(r);i.length>40&&(i=i.substring(0,36)+'..."'),Ft(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return r}return JSON.stringify(e)}function at(n,e,t){const s=ge(n,void 0,t),r=ge(e,void 0,t);return new _(s,r)}class _{constructor(e,t=null){Object.defineProperty(this,M,{value:Lt}),this.key=e,this.value=t}clone(e){let{key:t,value:s}=this;return x(t)&&(t=t.clone(e)),x(s)&&(s=s.clone(e)),new _(t,s)}toJSON(e,t){const s=t?.mapAsMap?new Map:{};return Jt(t,s,this)}toString(e,t,s){return e?.doc?xs(this,e,t,s):JSON.stringify(this)}}function Yt(n,e,t){return(e.inFlow??n.flow?_s:Cs)(n,e,t)}function Cs({comment:n,items:e},t,{blockItemPrefix:s,flowChars:r,itemIndent:i,onChompKeep:o,onComment:a}){const{indent:l,options:{commentString:c}}=t,d=Object.assign({},t,{indent:i,type:null});let u=!1;const f=[];for(let y=0;y<e.length;++y){const h=e[y];let p=null;if(x(h))!u&&h.spaceBefore&&f.push(""),_e(t,f,h.commentBefore,u),h.comment&&(p=h.comment);else if(I(h)){const w=x(h.key)?h.key:null;w&&(!u&&w.spaceBefore&&f.push(""),_e(t,f,w.commentBefore,u))}u=!1;let b=oe(h,d,()=>p=null,()=>u=!0);p&&(b+=G(b,i,c(p))),u&&p&&(u=!1),f.push(s+b)}let m;if(f.length===0)m=r.start+r.end;else{m=f[0];for(let y=1;y<f.length;++y){const h=f[y];m+=h?`
45${l}${h}`:`
46`}}return n?(m+=`
47`+R(c(n),l),a&&a()):u&&o&&o(),m}function _s({items:n},e,{flowChars:t,itemIndent:s}){const{indent:r,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=e;s+=i;const l=Object.assign({},e,{indent:s,inFlow:!0,type:null});let c=!1,d=0;const u=[];for(let y=0;y<n.length;++y){const h=n[y];let p=null;if(x(h))h.spaceBefore&&u.push(""),_e(e,u,h.commentBefore,!1),h.comment&&(p=h.comment);else if(I(h)){const w=x(h.key)?h.key:null;w&&(w.spaceBefore&&u.push(""),_e(e,u,w.commentBefore,!1),w.comment&&(c=!0));const k=x(h.value)?h.value:null;k?(k.comment&&(p=k.comment),k.commentBefore&&(c=!0)):h.value==null&&w?.comment&&(p=w.comment)}p&&(c=!0);let b=oe(h,l,()=>p=null);y<n.length-1&&(b+=","),p&&(b+=G(b,s,a(p))),!c&&(u.length>d||b.includes(`
48`))&&(c=!0),u.push(b),d=u.length}const{start:f,end:m}=t;if(u.length===0)return f+m;if(!c){const y=u.reduce((h,p)=>h+p.length+2,2);c=e.options.lineWidth>0&&y>e.options.lineWidth}if(c){let y=f;for(const h of u)y+=h?`
49${i}${r}${h}`:`
50`;return`${y}
51${r}${m}`}else return`${f}${o}${u.join(" ")}${o}${m}`}function _e({indent:n,options:{commentString:e}},t,s,r){if(s&&r&&(s=s.replace(/^\n+/,"")),s){const i=R(e(s),n);t.push(i.trimStart())}}function W(n,e){const t=O(e)?e.value:e;for(const s of n)if(I(s)&&(s.key===e||s.key===t||O(s.key)&&s.key.value===t))return s}class j extends qt{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Y,e),this.items=[]}static from(e,t,s){const{keepUndefined:r,replacer:i}=s,o=new this(e),a=(l,c)=>{if(typeof i=="function")c=i.call(t,l,c);else if(Array.isArray(i)&&!i.includes(l))return;(c!==void 0||r)&&o.items.push(at(l,c,s))};if(t instanceof Map)for(const[l,c]of t)a(l,c);else if(t&&typeof t=="object")for(const l of Object.keys(t))a(l,t[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let s;I(e)?s=e:!e||typeof e!="object"||!("key"in e)?s=new _(e,e?.value):s=new _(e.key,e.value);const r=W(this.items,s.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw new Error(`Key ${s.key} already set`);O(r.value)&&Pt(s.value)?r.value.value=s.value:r.value=s.value}else if(i){const o=this.items.findIndex(a=>i(s,a)<0);o===-1?this.items.push(s):this.items.splice(o,0,s)}else this.items.push(s)}delete(e){const t=W(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){const s=W(this.items,e)?.value;return(!t&&O(s)?s.value:s)??void 0}has(e){return!!W(this.items,e)}set(e,t){this.add(new _(e,t),!0)}toJSON(e,t,s){const r=s?new s:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(const i of this.items)Jt(t,r,i);return r}
51toString(e,t,s){if(!e)return JSON.stringify(this);for(const r of this.items)if(!I(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Yt(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:t})}}const fe={collection:"map",default:!0,nodeClass:j,tag:"tag:yaml.org,2002:map",resolve(n,e){return ke(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>j.from(n,e,t)};class H extends qt{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(ce,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=Oe(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){const s=Oe(e);if(typeof s!="number")return;const r=this.items[s];return!t&&O(r)?r.value:r}has(e){const t=Oe(e);return typeof t=="number"&&t<this.items.length}set(e,t){const s=Oe(e);if(typeof s!="number")throw new Error(`Expected a valid index, not ${e}.`);const r=this.items[s];O(r)&&Pt(t)?r.value=t:this.items[s]=t}toJSON(e,t){const s=[];t?.onCreate&&t.onCreate(s);let r=0;for(const i of this.items)s.push(B(i,String(r++),t));return s}toString(e,t,s){return e?Yt(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+"  ",onChompKeep:s,onComment:t}):JSON.stringify(this)}static from(e,t,s){const{replacer:r}=s,i=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof r=="function"){const l=t instanceof Set?a:String(o++);a=r.call(t,l,a)}i.items.push(ge(a,void 0,s))}}return i}}function Oe(n){let e=O(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const he={collection:"seq",default:!0,nodeClass:H,tag:"tag:yaml.org,2002:seq",resolve(n,e){return ve(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>H.from(n,e,t)},Me={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,e,t,s){return e=Object.assign({actualString:!0},e),ot(n,e,t,s)}},De={identify:n=>n==null,createNode:()=>new S(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new S(null),stringify:({source:n},e)=>typeof n=="string"&&De.test.test(n)?n:e.options.nullStr},lt={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new S(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},t){if(n&&lt.test.test(n)){const s=n[0]==="t"||n[0]==="T";if(e===s)return n}return e?t.options.trueStr:t.options.falseStr}};function P({format:n,minFractionDigits:e,tag:t,value:s}){if(typeof s=="bigint")return String(s);const r=typeof s=="number"?s:Number(s);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let i=JSON.stringify(s);if(!n&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(i)){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let a=e-(i.length-o-1);for(;a-- >0;)i+="0"}return i}const Gt={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:P},Wt={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n),stringify(n){const e=Number(n.value);return isFinite(e)?e.toExponential():P(n)}},Ht={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){const e=new S(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:P},Pe=n=>typeof n=="bigint"||Number.isInteger(n),ct=(n,e,t,{intAsBigInt:s})=>s?BigInt(n):parseInt(n.substring(e),t);function Qt(n,e,t){const{value:s}=n;return Pe(s)&&s>=0?t+s.toString(e):P(n)}const Xt={identify:n=>Pe(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>ct(n,2,8,t),stringify:n=>
51Qt(n,8,"0o")},zt={identify:Pe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>ct(n,0,10,t),stringify:P},Zt={identify:n=>Pe(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>ct(n,2,16,t),stringify:n=>Qt(n,16,"0x")},Ks=[fe,he,Me,De,lt,Xt,zt,Zt,Gt,Wt,Ht];function kt(n){return typeof n=="bigint"||Number.isInteger(n)}const Ae=({value:n})=>JSON.stringify(n),js=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:Ae},{identify:n=>n==null,createNode:()=>new S(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ae},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:Ae},{identify:kt,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(n,e,{intAsBigInt:t})=>t?BigInt(n):parseInt(n,10),stringify:({value:n})=>kt(n)?n.toString():JSON.stringify(n)},{identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:n=>parseFloat(n),stringify:Ae}],Bs={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},Ms=[fe,he].concat(js,Bs),ut={identify:n=>n instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof atob=="function"){const t=atob(n.replace(/[\n\r]/g,"")),s=new Uint8Array(t.length);for(let r=0;r<t.length;++r)s[r]=t.charCodeAt(r);return s}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),n},stringify({comment:n,type:e,value:t},s,r,i){if(!t)return"";const o=t;let a;if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=S.BLOCK_LITERAL),e!==S.QUOTE_DOUBLE){const l=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),c=Math.ceil(a.length/l),d=new Array(c);for(let u=0,f=0;u<c;++u,f+=l)d[u]=a.substr(f,l);a=d.join(e===S.BLOCK_LITERAL?`
52`:" ")}return ot({comment:n,type:e,value:a},s,r,i)}};function es(n,e){if(ve(n))for(let t=0;t<n.items.length;++t){let s=n.items[t];if(!I(s)){if(ke(s)){s.items.length>1&&e("Each pair must have its own sequence indicator");const r=s.items[0]||new _(new S(null));if(s.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${s.commentBefore}
53${r.key.commentBefore}`:s.commentBefore),s.comment){const i=r.value??r.key;i.comment=i.comment?`${s.comment}
54${i.comment}`:s.comment}s=r}n.items[t]=I(s)?s:new _(s)}}else e("Expected a sequence for this tag");return n}function ts(n,e,t){const{replacer:s}=t,r=new H(n);r.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof s=="function"&&(o=s.call(e,String(i++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;r.items.push(at(a,l,t))}return r}const ft={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:es,createNode:ts};class re extends H{constructor(){super(),this.add=j.prototype.add.bind(this),this.delete=j.prototype.delete.bind(this),this.get=j.prototype.get.bind(this),this.has=j.prototype.has.bind(this),this.set=j.prototype.set.bind(this),this.tag=re.tag}toJSON(e,t){if(!t)return super.toJSON(e);const s=new Map;t?.onCreate&&t.onCreate(s);for(const r of this.items){let i,o;if(I(r)?(i=B(r.key,"",t),o=B(r.value,i,t)):i=B(r,"",t),s.has(i))throw new Error("Ordered maps must not include duplicate keys");s.set(i,o)}return s}static from(e,t,s){const r=ts(e,t,s),i=new this;return i.items=r.items,i}}re.tag="tag:yaml.org,2002:omap";const ht={collection:"seq",identify:n=>n instanceof Map,nodeClass:re,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){const t=es(n,e),s=[];for(const{key:r}of t.items)O(r)&&(s.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):s.push(r.value));return Object.assign(new re,t)},createNode:(n,e,t)=>re.from(n,e,t)};function ss({value:n,source:e},t){return e&&(n?ns:rs).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}const ns={identify:n=>n===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>
54new S(!0),stringify:ss},rs={identify:n=>n===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new S(!1),stringify:ss},Ds={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:P},Ps={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){const e=Number(n.value);return isFinite(e)?e.toExponential():P(n)}},qs={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){const e=new S(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){const s=n.substring(t+1).replace(/_/g,"");s[s.length-1]==="0"&&(e.minFractionDigits=s.length)}return e},stringify:P},Se=n=>typeof n=="bigint"||Number.isInteger(n);function qe(n,e,t,{intAsBigInt:s}){const r=n[0];if((r==="-"||r==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),s){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}const o=BigInt(n);return r==="-"?BigInt(-1)*o:o}const i=parseInt(n,t);return r==="-"?-1*i:i}function dt(n,e,t){const{value:s}=n;if(Se(s)){const r=s.toString(e);return s<0?"-"+t+r.substr(1):t+r}return P(n)}const Us={identify:Se,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>qe(n,2,2,t),stringify:n=>dt(n,2,"0b")},Rs={identify:Se,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>qe(n,1,8,t),stringify:n=>dt(n,8,"0")},Fs={identify:Se,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>qe(n,0,10,t),stringify:P},Vs={identify:Se,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>qe(n,2,16,t),stringify:n=>dt(n,16,"0x")};class ie extends j{constructor(e){super(e),this.tag=ie.tag}add(e){let t;I(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new _(e.key,null):t=new _(e,null),W(this.items,t.key)||this.items.push(t)}get(e,t){const s=W(this.items,e);return!t&&I(s)?O(s.key)?s.key.value:s.key:s}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);const s=W(this.items,e);s&&!t?this.items.splice(this.items.indexOf(s),1):!s&&t&&this.items.push(new _(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,s);throw new Error("Set items must all have null values")}static from(e,t,s){const{replacer:r}=s,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof r=="function"&&(o=r.call(t,o,o)),i.items.push(at(o,null,s));return i}}ie.tag="tag:yaml.org,2002:set";const pt={collection:"map",identify:n=>n instanceof Set,nodeClass:ie,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>ie.from(n,e,t),resolve(n,e){if(ke(n)){if(n.hasAllNullValues(!0))return Object.assign(new ie,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};function mt(n,e){const t=n[0],s=t==="-"||t==="+"?n.substring(1):n,r=o=>e?BigInt(o):Number(o),i=s.replace(/_/g,"").split(":").reduce((o,a)=>o*r(60)+r(a),r(0));return t==="-"?r(-1)*i:i}function is(n){let{value:e}=n,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return P(n);let s="";e<0&&(s="-",e*=t(-1));const r=t(60),i=[e%r];return e<60?i.unshift(0):(e=(e-i[0])/r,i.unshift(e%r),e>=60&&(e=(e-i[0])/r,i.unshift(e))),s+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const os={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:t})=>mt(n,t),stringify:is},as={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>mt(n,!1),stringify:is},Ue={identify:n=>n instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(n){const e=n.match(Ue.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,t,s,r,i,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0;let c=Date.UTC(t,s-1,r,i||0,o||0,a||0,l);const d=e[8];if(d&&d!=="Z"){let u=mt(d,!1);Math.abs(u)<30&&(u*=60),c-=6e4*u}return new Date(c)}
54,stringify:({value:n})=>n?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},vt=[fe,he,Me,De,ns,rs,Us,Rs,Fs,Vs,Ds,Ps,qs,ut,F,ht,ft,pt,os,as,Ue],St=new Map([["core",Ks],["failsafe",[fe,he,Me]],["json",Ms],["yaml11",vt],["yaml-1.1",vt]]),Et={binary:ut,bool:lt,float:Ht,floatExp:Wt,floatNaN:Gt,floatTime:as,int:zt,intHex:Zt,intOct:Xt,intTime:os,map:fe,merge:F,null:De,omap:ht,pairs:ft,seq:he,set:pt,timestamp:Ue},Js={"tag:yaml.org,2002:binary":ut,"tag:yaml.org,2002:merge":F,"tag:yaml.org,2002:omap":ht,"tag:yaml.org,2002:pairs":ft,"tag:yaml.org,2002:set":pt,"tag:yaml.org,2002:timestamp":Ue};function Ve(n,e,t){const s=St.get(e);if(s&&!n)return t&&!s.includes(F)?s.concat(F):s.slice();let r=s;if(!r)if(Array.isArray(n))r=[];else{const i=Array.from(St.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(n))for(const i of n)r=r.concat(i);else typeof n=="function"&&(r=n(r.slice()));return t&&(r=r.concat(F)),r.reduce((i,o)=>{const a=typeof o=="string"?Et[o]:o;if(!a){const l=JSON.stringify(o),c=Object.keys(Et).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return i.includes(a)||i.push(a),i},[])}const Ys=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0;class yt{constructor({compat:e,customTags:t,merge:s,resolveKnownTags:r,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Ve(e,"compat"):e?Ve(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=r?Js:{},this.tags=Ve(t,this.name,s),this.toStringOptions=a??null,Object.defineProperty(this,Y,{value:fe}),Object.defineProperty(this,U,{value:Me}),Object.defineProperty(this,ce,{value:he}),this.sortMapEntries=typeof o=="function"?o:o===!0?Ys:null}clone(){const e=Object.create(yt.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function Gs(n,e){const t=[];let s=e.directives===!0;if(e.directives!==!1&&n.directives){const l=n.directives.toString(n);l?(t.push(l),s=!0):n.directives.docStart&&(s=!0)}s&&t.push("---");const r=Rt(n,e),{commentString:i}=r.options;if(n.commentBefore){t.length!==1&&t.unshift("");const l=i(n.commentBefore);t.unshift(R(l,""))}let o=!1,a=null;if(n.contents){if(x(n.contents)){if(n.contents.spaceBefore&&s&&t.push(""),n.contents.commentBefore){const d=i(n.contents.commentBefore);t.push(R(d,""))}r.forceBlockIndent=!!n.comment,a=n.contents.comment}const l=a?void 0:()=>o=!0;let c=oe(n.contents,r,()=>a=null,l);a&&(c+=G(c,"",i(a))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(oe(n.contents,r));if(n.directives?.docEnd)if(n.comment){const l=i(n.comment);l.includes(`
55`)?(t.push("..."),t.push(R(l,""))):t.push(`... ${l}`)}else t.push("...");else{let l=n.comment;l&&o&&(l=l.replace(/^\n+/,"")),l&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.pu
55sh(R(i(l),"")))}return t.join(`
56`)+`
57`}class Re{constructor(e,t,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,M,{value:He});let r=null;typeof t=="function"||Array.isArray(t)?r=t:s===void 0&&t&&(s=t,t=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=i;let{version:o}=i;s?._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new C({version:o}),this.setSchema(o,s),this.contents=e===void 0?null:this.createNode(e,r,s)}clone(){const e=Object.create(Re.prototype,{[M]:{value:He}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=x(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){z(this.contents)&&this.contents.add(e)}addIn(e,t){z(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const s=Mt(this);e.anchor=!t||s.has(t)?Dt(t||"a",s):t}return new it(e.anchor)}createNode(e,t,s){let r;if(typeof t=="function")e=t.call({"":e},"",e),r=t;else if(Array.isArray(t)){const p=w=>typeof w=="number"||w instanceof String||w instanceof Number,b=t.filter(p).map(String);b.length>0&&(t=t.concat(b)),r=t}else s===void 0&&t&&(s=t,t=void 0);const{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:d}=s??{},{onAnchor:u,setAnchors:f,sourceObjects:m}=vs(this,o||"a"),y={aliasDuplicateObjects:i??!0,keepUndefined:l??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:m},h=ge(e,d,y);return a&&T(h)&&(h.flow=!0),f(),h}createPair(e,t,s={}){const r=this.createNode(e,null,s),i=this.createNode(t,null,s);return new _(r,i)}delete(e){return z(this.contents)?this.contents.delete(e):!1}deleteIn(e){return pe(e)?this.contents==null?!1:(this.contents=null,!0):z(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return T(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return pe(e)?!t&&O(this.contents)?this.contents.value:this.contents:T(this.contents)?this.contents.getIn(e,t):void 0}has(e){return T(this.contents)?this.contents.has(e):!1}hasIn(e){return pe(e)?this.contents!==void 0:T(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Ce(this.schema,[e],t):z(this.contents)&&this.contents.set(e,t)}setIn(e,t){pe(e)?this.contents=t:this.contents==null?this.contents=Ce(this.schema,Array.from(e),t):z(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let s;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new C({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new C({version:e}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{const r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(s)this.schema=new yt(Object.assign(s,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:s,maxAliasCount:r,onAnchor:i,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!e,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},l=B(this.contents,t??"",a);if(typeof i=="function")for(const{count:c,res:d}
57of a.anchors.values())i(d,c);return typeof o=="function"?se(o,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return Gs(this,e)}}function z(n){if(T(n))return!0;throw new Error("Expected a YAML collection as document contents")}class ls extends Error{constructor(e,t,s,r){super(),this.name=e,this.code=s,this.message=r,this.pos=t}}class me extends ls{constructor(e,t,s){super("YAMLParseError",e,t,s)}}class Ws extends ls{constructor(e,t,s){super("YAMLWarning",e,t,s)}}const Nt=(n,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));const{line:s,col:r}=t.linePos[0];t.message+=` at line ${s}, column ${r}`;let i=r-1,o=n.substring(e.lineStarts[s-1],e.lineStarts[s]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){const a=Math.min(i-39,o.length-79);o="…"+o.substring(a),i-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),s>1&&/^ *$/.test(o.substring(0,i))){let a=n.substring(e.lineStarts[s-2],e.lineStarts[s-1]);a.length>80&&(a=a.substring(0,79)+`…
58`),o=a+o}if(/[^ ]/.test(o)){let a=1;const l=t.linePos[1];l&&l.line===s&&l.col>r&&(a=Math.max(1,Math.min(l.col-r,80-i)));const c=" ".repeat(i)+"^".repeat(a);t.message+=`:
59
60${o}
61${c}
62`}};function ae(n,{flow:e,indicator:t,next:s,offset:r,onError:i,parentIndent:o,startOnNewline:a}){let l=!1,c=a,d=a,u="",f="",m=!1,y=!1,h=null,p=null,b=null,w=null,k=null,v=null,N=null;for(const g of n)switch(y&&(g.type!=="space"&&g.type!=="newline"&&g.type!=="comma"&&i(g.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),h&&(c&&g.type!=="comment"&&g.type!=="newline"&&i(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),g.type){case"space":!e&&(t!=="doc-start"||s?.type!=="flow-collection")&&g.source.includes("	")&&(h=g),d=!0;break;case"comment":{d||i(g,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const L=g.source.substring(1)||" ";u?u+=f+L:u=L,f="",c=!1;break}case"newline":c?u?u+=g.source:(!v||t!=="seq-item-ind")&&(l=!0):f+=g.source,c=!0,m=!0,(p||b)&&(w=g),d=!0;break;case"anchor":p&&i(g,"MULTIPLE_ANCHORS","A node can have at most one anchor"),g.source.endsWith(":")&&i(g.offset+g.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),p=g,N??(N=g.offset),c=!1,d=!1,y=!0;break;case"tag":{b&&i(g,"MULTIPLE_TAGS","A node can have at most one tag"),b=g,N??(N=g.offset),c=!1,d=!1,y=!0;break}case t:(p||b)&&i(g,"BAD_PROP_ORDER",`Anchors and tags must be after the ${g.source} indicator`),v&&i(g,"UNEXPECTED_TOKEN",`Unexpected ${g.source} in ${e??"collection"}`),v=g,c=t==="seq-item-ind"||t==="explicit-key-ind",d=!1;break;case"comma":if(e){k&&i(g,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=g,c=!1,d=!1;break}default:i(g,"UNEXPECTED_TOKEN",`Unexpected ${g.type} token`),c=!1,d=!1}const E=n[n.length-1],A=E?E.offset+E.source.length:r;return y&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&i(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(c&&h.indent<=o||s?.type==="block-map"||s?.type==="block-seq")&&i(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:v,spaceBefore:l,comment:u,hasNewline:m,anchor:p,tag:b,newlineAfterProp:w,end:A,start:N??A}}function be(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
63`))return!0;if(n.end){for(const e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of n.items){for(const t of e.start)if(t.type==="newline")return!0;if(e.sep){for(const t of e.sep)if(t.type==="newline")return!0}if(be(e.key)||be(e.value))return!0}return!1;default:return!0}}function Ze(n,e,t){if(e?.type==="flow-collection"){const s=e.end[0];s.indent===n&&(s.source==="]"||s.source==="}")&&be(e)&&t(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function cs(n,e,t){const{uniqueKeys:s}=n.options;if(s===!1)return!1;const r=typeof s=="function"?s:(i,o)=>i===o||O(i)&&O(o)&&i.value===o.value;return e.some(i=>r(i.key,t))}const Ot="All mapping items must start at the same column";function Hs({composeNode:n,composeEmptyNode:e},t,s,r,i){const o=i?.nodeClass??j,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let l=s.offset,c=null;for(const d of s.items){const{start:u,key:f,sep:m,value:y}=d,h=ae(u,{indicator:"explicit-key-ind",next:f??m?.[0],offset:l,onError:r,parentIndent:s.indent,startOnNewline:!0}),p=!h.found;if(p){if(f&&(f.type==="block-seq"?r(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==s.indent&&r(l,"BAD_INDENT",Ot)),!h.anchor&&!h.tag&&!m){c=h.end,h.comment&&(a.comment?a.comment+=`
64`+h.comment:a.comment=h.comment);continue}(h.newlineAfterProp||be(f))&&r(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==s.indent&&r(l,"BAD_INDENT",Ot);t.atKey=!0;const b=h.end,w=f?n(t,f,h,r):e(t,b,u,null,h,r);t.schema.compat&&Ze(s.indent,f,r),t.atKey=!1,cs(t,a.items,w)&&r(b,"DUPLICATE_KEY","Map ke
64ys must be unique");const k=ae(m??[],{indicator:"map-value-ind",next:y,offset:w.range[2],onError:r,parentIndent:s.indent,startOnNewline:!f||f.type==="block-scalar"});if(l=k.end,k.found){p&&(y?.type==="block-map"&&!k.hasNewline&&r(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&h.start<k.found.offset-1024&&r(w.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const v=y?n(t,y,k,r):e(t,l,m,null,k,r);t.schema.compat&&Ze(s.indent,y,r),l=v.range[2];const N=new _(w,v);t.options.keepSourceTokens&&(N.srcToken=d),a.items.push(N)}else{p&&r(w.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(w.comment?w.comment+=`
65`+k.comment:w.comment=k.comment);const v=new _(w);t.options.keepSourceTokens&&(v.srcToken=d),a.items.push(v)}}return c&&c<l&&r(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[s.offset,l,c??l],a}function Qs({composeNode:n,composeEmptyNode:e},t,s,r,i){const o=i?.nodeClass??H,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let l=s.offset,c=null;for(const{start:d,value:u}of s.items){const f=ae(d,{indicator:"seq-item-ind",next:u,offset:l,onError:r,parentIndent:s.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||u)u&&u.type==="block-seq"?r(f.end,"BAD_INDENT","All sequence items must start at the same column"):r(l,"MISSING_CHAR","Sequence item without - indicator");else{c=f.end,f.comment&&(a.comment=f.comment);continue}const m=u?n(t,u,f,r):e(t,f.end,d,null,f,r);t.schema.compat&&Ze(s.indent,u,r),l=m.range[2],a.items.push(m)}return a.range=[s.offset,l,c??l],a}function Ee(n,e,t,s){let r="";if(n){let i=!1,o="";for(const a of n){const{source:l,type:c}=a;switch(c){case"space":i=!0;break;case"comment":{t&&!i&&s(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const d=l.substring(1)||" ";r?r+=o+d:r=d,o="";break}case"newline":r&&(o+=l),i=!0;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:r,offset:e}}const Je="Block collections are not allowed within flow collections",Ye=n=>n&&(n.type==="block-map"||n.type==="block-seq");function Xs({composeNode:n,composeEmptyNode:e},t,s,r,i){const o=s.start.source==="{",a=o?"flow map":"flow sequence",l=i?.nodeClass??(o?j:H),c=new l(t.schema);c.flow=!0;const d=t.atRoot;d&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let u=s.offset+s.start.source.length;for(let p=0;p<s.items.length;++p){const b=s.items[p],{start:w,key:k,sep:v,value:N}=b,E=ae(w,{flow:a,indicator:"explicit-key-ind",next:k??v?.[0],offset:u,onError:r,parentIndent:s.indent,startOnNewline:!1});if(!E.found){if(!E.anchor&&!E.tag&&!v&&!N){p===0&&E.comma?r(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):p<s.items.length-1&&r(E.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),E.comment&&(c.comment?c.comment+=`
66`+E.comment:c.comment=E.comment),u=E.end;continue}!o&&t.options.strict&&be(k)&&r(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(p===0)E.comma&&r(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(E.comma||r(E.start,"MISSING_CHAR",`Missing , between ${a} items`),E.comment){let A="";e:for(const g of w)switch(g.type){case"comma":case"space":break;case"comment":A=g.source.substring(1);break e;default:break e}if(A){let g=c.items[c.items.length-1];I(g)&&(g=g.value??g.key),g.comment?g.comment+=`
67`+A:g.comment=A,E.comment=E.comment.substring(A.length+1)}}if(!o&&!v&&!E.found){const A=N?n(t,N,E,r):e(t,E.end,v,null,E,r);c.items.push(A),u=A.range[2],Ye(N)&&r(A.range,"BLOCK_IN_FLOW",Je)}else{t.atKey=!0;const A=E.end,g=k?n(t,k,E,r):e(t,A,w,null,E,r);Ye(k)&&r(g.range,"BLOCK_IN_FLOW",Je),t.atKey=!1;const L=ae(v??[],{flow:a,indicator:"map-value-ind",next:N,offset:g.range[2],onError:r,parentIndent:s.indent,startOnNewline:!1});if(L.found){if(!o&&!E.found&&t.options.strict){if(v)for(const $ of v){if($===L.found)break;if($.type==="newline"){r($,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}E.start<L.found.offset-1024&&r(L.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else N&&("source"in N&&N.source&&N.source[0]===":"?r(N,"MISSING_CHAR",`Missing space after : in ${a}`):r(L.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const V=N?n(t,N,L,r):L.found?e(t,L.end,v,null,L,r):null;V?Ye(N)&&r(V.range,"BLOCK_IN_FLOW",Je):L.comment&&(g.comment?g.comment+=`
68`+L.comment:g.comment=L.comment);const X=new _(g,V);if(t.options.keepSourceTokens&&(X.srcToken=b),o){const $=c;
68cs(t,$.items,g)&&r(A,"DUPLICATE_KEY","Map keys must be unique"),$.items.push(X)}else{const $=new j(t.schema);$.flow=!0,$.items.push(X);const bt=(V??g).range;$.range=[g.range[0],bt[1],bt[2]],c.items.push($)}u=V?V.range[2]:L.end}}const f=o?"}":"]",[m,...y]=s.end;let h=u;if(m&&m.source===f)h=m.offset+m.source.length;else{const p=a[0].toUpperCase()+a.substring(1),b=d?`${p} must end with a ${f}`:`${p} in block collection must be sufficiently indented and end with a ${f}`;r(u,d?"MISSING_CHAR":"BAD_INDENT",b),m&&m.source.length!==1&&y.unshift(m)}if(y.length>0){const p=Ee(y,h,t.options.strict,r);p.comment&&(c.comment?c.comment+=`
69`+p.comment:c.comment=p.comment),c.range=[s.offset,h,p.offset]}else c.range=[s.offset,h,h];return c}function Ge(n,e,t,s,r,i){const o=t.type==="block-map"?Hs(n,e,t,s,i):t.type==="block-seq"?Qs(n,e,t,s,i):Xs(n,e,t,s,i),a=o.constructor;return r==="!"||r===a.tagName?(o.tag=a.tagName,o):(r&&(o.tag=r),o)}function zs(n,e,t,s,r){const i=s.tag,o=i?e.directives.tagName(i.source,f=>r(i,"TAG_RESOLVE_FAILED",f)):null;if(t.type==="block-seq"){const{anchor:f,newlineAfterProp:m}=s,y=f&&i?f.offset>i.offset?f:i:f??i;y&&(!m||m.offset<y.offset)&&r(y,"MISSING_CHAR","Missing newline after block sequence props")}const a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!i||!o||o==="!"||o===j.tagName&&a==="map"||o===H.tagName&&a==="seq")return Ge(n,e,t,r,o);let l=e.schema.tags.find(f=>f.tag===o&&f.collection===a);if(!l){const f=e.schema.knownTags[o];if(f&&f.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),l=f;else return f?r(i,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Ge(n,e,t,r,o)}const c=Ge(n,e,t,r,o,l),d=l.resolve?.(c,f=>r(i,"TAG_RESOLVE_FAILED",f),e.options)??c,u=x(d)?d:new S(d);return u.range=c.range,u.tag=o,l?.format&&(u.format=l.format),u}function Zs(n,e,t){const s=e.offset,r=en(e,n.options.strict,t);if(!r)return{value:"",type:null,comment:"",range:[s,s,s]};const i=r.mode===">"?S.BLOCK_FOLDED:S.BLOCK_LITERAL,o=e.source?tn(e.source):[];let a=o.length;for(let h=o.length-1;h>=0;--h){const p=o[h][1];if(p===""||p==="\r")a=h;else break}if(a===0){const h=r.chomp==="+"&&o.length>0?`
70`.repeat(Math.max(1,o.length-1)):"";let p=s+r.length;return e.source&&(p+=e.source.length),{value:h,type:i,comment:r.comment,range:[s,p,p]}}let l=e.indent+r.indent,c=e.offset+r.length,d=0;for(let h=0;h<a;++h){const[p,b]=o[h];if(b===""||b==="\r")r.indent===0&&p.length>l&&(l=p.length);else{p.length<l&&t(c+p.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(l=p.length),d=h,l===0&&!n.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=p.length+b.length+1}for(let h=o.length-1;h>=a;--h)o[h][0].length>l&&(a=h+1);let u="",f="",m=!1;for(let h=0;h<d;++h)u+=o[h][0].slice(l)+`
71`;for(let h=d;h<a;++h){let[p,b]=o[h];c+=p.length+b.length+1;const w=b[b.length-1]==="\r";if(w&&(b=b.slice(0,-1)),b&&p.length<l){const k=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;t(c-b.length-(w?2:1),"BAD_INDENT",k),p=""}i===S.BLOCK_LITERAL?(u+=f+p.slice(l)+b,f=`
72`):p.length>l||b[0]==="	"?(f===" "?f=`
73`:!m&&f===`
74`&&(f=`
75
76`),u+=f+p.slice(l)+b,f=`
77`,m=!0):b===""?f===`
78`?u+=`
79`:f=`
80`:(u+=f+b,f=" ",m=!1)}switch(r.chomp){case"-":break;case"+":for(let h=a;h<o.length;++h)u+=`
81`+o[h][0].slice(l);u[u.length-1]!==`
82`&&(u+=`
83`);break;default:u+=`
84`}const y=s+r.length+e.source.length;return{value:u,type:i,comment:r.comment,range:[s,y,y]}}function en({offset:n,props:e},t,s){if(e[0].type!=="block-scalar-header")return s(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=e[0],i=r[0];let o=0,a="",l=-1;for(let f=1;f<r.length;++f){const m=r[f];if(!a&&(m==="-"||m==="+"))a=m;else{const y=Number(m);!o&&y?o=y:l===-1&&(l=n+f)}}l!==-1&&s(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let c=!1,d="",u=r.length;for(let f=1;f<e.length;++f){const m=e[f];switch(m.type){case"space":c=!0;case"newline":u+=m.source.length;break;case"comment":t&&!c&&s(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u
84+=m.source.length,d=m.source.substring(1);break;case"error":s(m,"UNEXPECTED_TOKEN",m.message),u+=m.source.length;break;default:{const y=`Unexpected token in block scalar header: ${m.type}`;s(m,"UNEXPECTED_TOKEN",y);const h=m.source;h&&typeof h=="string"&&(u+=h.length)}}}return{mode:i,indent:o,chomp:a,comment:d,length:u}}function tn(n){const e=n.split(/\n( *)/),t=e[0],s=t.match(/^( *)/),r=[s?.[1]?[s[1],t.slice(s[1].length)]:["",t]];for(let i=1;i<e.length;i+=2)r.push([e[i],e[i+1]]);return r}function sn(n,e,t){const{offset:s,type:r,source:i,end:o}=n;let a,l;const c=(f,m,y)=>t(s+f,m,y);switch(r){case"scalar":a=S.PLAIN,l=nn(i,c);break;case"single-quoted-scalar":a=S.QUOTE_SINGLE,l=rn(i,c);break;case"double-quoted-scalar":a=S.QUOTE_DOUBLE,l=on(i,c);break;default:return t(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[s,s+i.length,s+i.length]}}const d=s+i.length,u=Ee(o,d,e,t);return{value:l,type:a,comment:u.comment,range:[s,d,u.offset]}}function nn(n,e){let t="";switch(n[0]){case"	":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${n[0]}`;break}case"@":case"`":{t=`reserved character ${n[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),us(n)}function rn(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),us(n.slice(1,-1)).replace(/''/g,"'")}function us(n){let e,t;try{e=new RegExp(`(.*?)(?<![ 	])[ 	]*\r?
85`,"sy"),t=new RegExp(`[ 	]*(.*?)(?:(?<![ 	])[ 	]*)?\r?
86`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let s=e.exec(n);if(!s)return n;let r=s[1],i=" ",o=e.lastIndex;for(t.lastIndex=o;s=t.exec(n);)s[1]===""?i===`
87`?r+=i:i=`
88`:(r+=i+s[1],i=" "),o=t.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=o,s=a.exec(n),r+i+(s?.[1]??"")}function on(n,e){let t="";for(let s=1;s<n.length-1;++s){const r=n[s];if(!(r==="\r"&&n[s+1]===`
89`))if(r===`
90`){const{fold:i,offset:o}=an(n,s);t+=i,s=o}else if(r==="\\"){let i=n[++s];const o=ln[i];if(o)t+=o;else if(i===`
91`)for(i=n[s+1];i===" "||i==="	";)i=n[++s+1];else if(i==="\r"&&n[s+1]===`
92`)for(i=n[++s+1];i===" "||i==="	";)i=n[++s+1];else if(i==="x"||i==="u"||i==="U"){const a={x:2,u:4,U:8}[i];t+=cn(n,s+1,a,e),s+=a}else{const a=n.substr(s-1,2);e(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(r===" "||r==="	"){const i=s;let o=n[s+1];for(;o===" "||o==="	";)o=n[++s+1];o!==`
93`&&!(o==="\r"&&n[s+2]===`
94`)&&(t+=s>i?n.slice(i,s+1):r)}else t+=r}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}function an(n,e){let t="",s=n[e+1];for(;(s===" "||s==="	"||s===`
95`||s==="\r")&&!(s==="\r"&&n[e+2]!==`
96`);)s===`
97`&&(t+=`
98`),e+=1,s=n[e+1];return t||(t=" "),{fold:t,offset:e}}const ln={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
99`,r:"\r",t:"	",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","	":"	"};function cn(n,e,t,s){const r=n.substr(e,t),i=r.length===t&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;if(isNaN(i)){const o=n.substr(e-2,t+2);return s(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),o}return String.fromCodePoint(i)}function fs(n,e,t,s){const{value:r,type:i,comment:o,range:a}=e.type==="block-scalar"?Zs(n,e,s):sn(e,n.options.strict,s),l=t?n.directives.tagName(t.source,u=>s(t,"TAG_RESOLVE_FAILED",u)):null;let c;n.options.stringKeys&&n.atKey?c=n.schema[U]:l?c=un(n.schema,r,l,t,s):e.type==="scalar"?c=fn(n,r,e,s):c=n.schema[U];let d;try{const u=c.resolve(r,f=>s(t??e,"TAG_RESOLVE_FAILED",f),n.options);d=O(u)?u:new S(u)}catch(u){const f=u instanceof Error?u.message:String(u);s(t??e,"TAG_RESOLVE_FAILED",f),d=new S(r)}return d.range=a,d.source=r,i&&(d.type=i),l&&(d.tag=l),c.format&&(d.format=c.format),o&&(d.comment=o),d}function un(n,e,t,s,r){if(t==="!")return n[U];const i=[];for(const a of n.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)i.push(a);else return a;for(const a of i)if(a.test?.test(e))return a;const o=n.knownTags[t];return o&&!o.collection?(n.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),n[U])}function fn({atKey:n,directives:e,schema:t},s,r,i){const o=t.tags.find(a=>
99(a.default===!0||n&&a.default==="key")&&a.test?.test(s))||t[U];if(t.compat){const a=t.compat.find(l=>l.default&&l.test?.test(s))??t[U];if(o.tag!==a.tag){const l=e.tagString(o.tag),c=e.tagString(a.tag),d=`Value may be parsed as either ${l} or ${c}`;i(r,"TAG_RESOLVE_FAILED",d,!0)}}return o}function hn(n,e,t){if(e){t??(t=e.length);for(let s=t-1;s>=0;--s){let r=e[s];switch(r.type){case"space":case"comment":case"newline":n-=r.source.length;continue}for(r=e[++s];r?.type==="space";)n+=r.source.length,r=e[++s];break}}return n}const dn={composeNode:hs,composeEmptyNode:gt};function hs(n,e,t,s){const r=n.atKey,{spaceBefore:i,comment:o,anchor:a,tag:l}=t;let c,d=!0;switch(e.type){case"alias":c=pn(n,e,s),(a||l)&&s(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=fs(n,e,l,s),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":c=zs(dn,n,e,t,s),a&&(c.anchor=a.source.substring(1));break;default:{const u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;s(e,"UNEXPECTED_TOKEN",u),c=gt(n,e.offset,void 0,null,t,s),d=!1}}return a&&c.anchor===""&&s(a,"BAD_ALIAS","Anchor cannot be an empty string"),r&&n.options.stringKeys&&(!O(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&s(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),n.options.keepSourceTokens&&d&&(c.srcToken=e),c}function gt(n,e,t,s,{spaceBefore:r,comment:i,anchor:o,tag:a,end:l},c){const d={type:"scalar",offset:hn(e,t,s),indent:-1,source:""},u=fs(n,d,a,c);return o&&(u.anchor=o.source.substring(1),u.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(u.spaceBefore=!0),i&&(u.comment=i,u.range[2]=l),u}function pn({options:n},{offset:e,source:t,end:s},r){const i=new it(t.substring(1));i.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&r(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=e+t.length,a=Ee(s,o,n.strict,r);return i.range=[e,o,a.offset],a.comment&&(i.comment=a.comment),i}function mn(n,e,{offset:t,start:s,value:r,end:i},o){const a=Object.assign({_directives:e},n),l=new Re(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},d=ae(s,{indicator:"doc-start",next:r??i?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(l.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=r?hs(c,r,d,o):gt(c,d.end,s,null,d,o);const u=l.contents.range[2],f=Ee(i,u,!1,o);return f.comment&&(l.comment=f.comment),l.range=[t,u,f.offset],l}function de(n){if(typeof n=="number")return[n,n+1];if(Array.isArray(n))return n.length===2?n:[n[0],n[1]];const{offset:e,source:t}=n;return[e,e+(typeof t=="string"?t.length:1)]}function At(n){let e="",t=!1,s=!1;for(let r=0;r<n.length;++r){const i=n[r];switch(i[0]){case"#":e+=(e===""?"":s?`
100
101`:`
102`)+(i.substring(1)||" "),t=!0,s=!1;break;case"%":n[r+1]?.[0]!=="#"&&(r+=1),t=!1;break;default:t||(s=!0),t=!1}}return{comment:e,afterEmptyLine:s}}class yn{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,s,r,i)=>{const o=de(t);i?this.warnings.push(new Ws(o,s,r)):this.errors.push(new me(o,s,r))},this.directives=new C({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:s,afterEmptyLine:r}=At(this.prelude);if(s){const i=e.contents;if(t)e.comment=e.comment?`${e.comment}
103${s}`:s;else if(r||e.directives.docStart||!i)e.commentBefore=s;else if(T(i)&&!i.flow&&i.items.length>0){let o=i.items[0];I(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${s}
104${a}`:s}else{const o=i.commentBefore;i.commentBefore=o?`${s}
105${o}`:s}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:At(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,s=-1){for(const r of e)yield*this.next(r);yield*this.end(t,s)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,s,r)=>{const i=de(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",s,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=mn(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,s=new me(de(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){const s="Unexpected doc-end without preceding document";this.errors.push(new me(de(e),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const t=Ee(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const s=this.doc.comment;this.doc.comment=s?`${s}
106${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new me(de(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const s=Object.assign({_directives:this.directives},this.options),r=new Re(void 0,s);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,t,t],this.decorate(r,!1),yield r}}}const et=Symbol("break visit"),gn=Symbol("skip children"),ds=Symbol("remove item");function le(n,e){"type"in n&&n.type==="document"&&(n={start:n.start,value:n.value}),ps(Object.freeze([]),n,e)}le.BREAK=et;le.SKIP=gn;le.REMOVE=ds;le.itemAtPath=(n,e)=>{let t=n;for(const[s,r]of e){const i=t?.[s];if(i&&"items"in i)t=i.items[r];else return}return t};le.parentCollection=(n,e)=>{const t=le.itemAtPath(n,e.slice(0,-1)),s=e[e.length-1][0],r=t?.[s];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function ps(n,e,t){let s=t(e,n);if(typeof s=="symbol")return s;for(const r of["key","value"]){const i=e[r];if(i&&"items"in i){for(let o=0;o<i.items.length;++o){const a=ps(Object.freeze(n.concat([[r,o]])),i.items[o],t);if(typeof a=="number")o=a-1;else{if(a===et)return et;a===ds&&(i.items.splice(o,1),o-=1)}}typeof s=="function"&&r==="key"&&(s=s(e,n))}}return typeof s=="function"?s(e,n):s}const ms="\uFEFF",ys="�",gs="�",tt="�";function bn(n){switch(n){case ms:return"byte-order-mark";case ys:return"doc-mode";case gs:return"flow-error-end";case tt:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
107`:case`\r
108`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(n[0]){case" ":case"	":return"space";case"#":return"comment";
108case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function D(n){switch(n){case void 0:case" ":case`
109`:case"\r":case"	":return!0;default:return!1}}const It=new Set("0123456789ABCDEFabcdef"),wn=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Ie=new Set(",[]{}"),kn=new Set(` ,[]{}
110\r	`),We=n=>!n||kn.has(n);class vn{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let s=this.next??"stream";for(;s&&(t||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t==="	";)t=this.buffer[++e];return!t||t==="#"||t===`
111`?!0:t==="\r"?this.buffer[e+1]===`
112`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let s=0;for(;t===" ";)t=this.buffer[++s+e];if(t==="\r"){const r=this.buffer[s+e+1];if(r===`
113`||!r&&!this.atEnd)return e+s+1}return t===`
114`||s>=this.indentNext||!t&&!this.atEnd?e+s:-1}if(t==="-"||t==="."){const s=this.buffer.substr(e,3);if((s==="---"||s==="...")&&D(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
115`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===ms&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,s=e.indexOf("#");for(;s!==-1;){const i=e[s-1];if(i===" "||i==="	"){t=s-1;break}else s=e.indexOf("#",s+1)}for(;;){const i=e[t-1];if(i===" "||i==="	")t-=1;else break}const r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield ys,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const t=this.peek(3);if((t==="---"||t==="...")&&D(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!D(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&D(t)){const s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";
115case"*":return yield*this.pushUntil(We),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,s=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=s=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&r[0]!=="#"||s===0&&(r.startsWith("---")||r.startsWith("..."))&&D(r[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield gs,yield*this.parseLineStart();let i=0;for(;r[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-i),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(We),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||D(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let i=0;for(;this.buffer[t-1-i]==="\\";)i+=1;if(i%2===0)break;t=this.buffer.indexOf('"',t+1)}const s=this.buffer.substring(0,t);let r=s.indexOf(`
116`,this.pos);if(r!==-1){for(;r!==-1;){const i=this.continueScalar(r+1);if(i===-1)break;r=s.indexOf(`
117`,i)}r!==-1&&(t=r-(s[r-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>D(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,s;e:for(let i=this.pos;s=this.buffer[i];++i)switch(s){case" ":t+=1;break;case`
118`:e=i,t=0;break;case"\r":{const o=this.buffer[i+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
119`)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
120`,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(s=this.buffer[r];s===" ";)s=this.buffer[++r];if(s==="	"){for(;s==="	"||s===" "||s==="\r"||s===`
121`;)s=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let i=e-1,o=this.buffer[i];o==="\r"&&(o=this.buffer[--i]);const a=i;for(;o===" ";)o=this.buffer[--i];if(o===`
122`&&i>=this.pos&&i+1+t>a)e=i;else break}while(!0);return yield tt,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t=this.pos-1,s=this.pos-1,r;for(;r=this.buffer[++s];)if(r===":"){const i=this.buffer[s+1];if(D(i)||e&&Ie.has(i))break;t=s}else if(D(r)){let i=this.buffer[s+1];if(r==="\r"&&(i===`
123`?(s+=1,r=`
124`,i=this.buffer[s+1]):t=s),i==="#"||e&&Ie.has(i))break;if(r===`
125`){const o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(e&&Ie.has(r))break;t=s}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield tt,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const s=this.buffer.slice(this.pos,e);return s?(yield s,this.pos+=s.length,s.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(We))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,t=this.charAt(1);if(D(t)||e&&Ie.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!D(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(wn.has(t))t=this.buffer[++e];else if(t==="%"&&It.has(this.buffer[e+1])&&It.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===`
126`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
127`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,s;do s=this.buffer[++t];while(s===" "||e&&s==="	");const r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,s=this.buffer[t];for(;!e(s);)s=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}class Sn{constructor(){this.lineStarts=[],this.addNewLine=e=>
127this.lineStarts.push(e),this.linePos=e=>{let t=0,s=this.lineStarts.length;for(;t<s;){const i=t+s>>1;this.lineStarts[i]<e?t=i+1:s=i}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};const r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}}function J(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}function Tt(n){for(let e=0;e<n.length;++e)switch(n[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function bs(n){switch(n?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Te(n){switch(n.type){case"document":return n.start;case"block-map":{const e=n.items[n.items.length-1];return e.sep??e.start}case"block-seq":return n.items[n.items.length-1].start;default:return[]}}function Z(n){if(n.length===0)return[];let e=n.length;e:for(;--e>=0;)switch(n[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;n[++e]?.type==="space";);return n.splice(e,n.length)}function xt(n){if(n.start.type==="flow-seq-start")for(const e of n.items)e.sep&&!e.value&&!J(e.start,"explicit-key-ind")&&!J(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,bs(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class En{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new vn,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const s of this.lexer.lex(e,t))yield*this.next(s);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const t=bn(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const s=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&(!e||e.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{const s=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in s?s.indent:0:t.type==="flow-collection"&&s.type==="document"&&(t.indent=0),t.type==="flow-collection"&&xt(t),s.type){case"document":s.value=t;break;case"block-scalar":s.props.push(t);break;case"block-map":{const r=s.items[s.items.length-1];if(r.value){s.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=t;else{Object.assign(r,{key:t,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=s.items[s.items.length-1];r.value?s.items.push({start:[],value:t}):r.value=t;break}case"flow-collection":{const r=s.items[s.items.length-1];!r||r.value?s.items.push({start:[],key:t,sep:[]}
127):r.sep?r.value=t:Object.assign(r,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){const r=t.items[t.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Tt(r.start)===-1&&(t.indent===0||r.start.every(i=>i.type!=="comment"||i.indent<t.indent))&&(s.type==="document"?s.end=r.start:s.items.push({start:r.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Tt(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}const t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){const t=Te(this.peek(2)),s=Z(t);let r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];const i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
128`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
129`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){const s="end"in t.value?t.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){const s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Array.prototype.push.apply(s,t.start),s.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const s=!this.onKeyLine&&this.indent===e.indent,r=s&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind";let i=[];if(r&&t.sep&&!t.value){const o=[];for(let a=0;a<t.sep.length;++a){const l=t.sep[a];switch(l.type){case"newline":o.push(a);break;case"space":break;case"comment":l.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(i=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(J(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(bs(t.key)&&!J(t.sep,"newline")){const o=Z(t.start),a=t.key,l=t.sep;l.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:l}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);
129else if(J(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const o=Z(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):J(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!J(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else s&&e.items.push({start:i});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const s="end"in t.value?t.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){const s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Array.prototype.push.apply(s,t.start),s.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||J(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){const s=this.startBlockValue(e);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s&&s.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:r,sep:[]}):t.sep?this.stack.push(r):Object.assign(t,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{const s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===e.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){const r=Te(s),i=Z(r);xt(e);const o=e.end.splice(1,e.end.length);o.push(this.sourceToken);const a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
130`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
131`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.t
131ype);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const t=Te(e),s=Z(t);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=Te(e),s=Z(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Nn(n){const e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new Sn||null,prettyErrors:e}}function On(n,e={}){const{lineCounter:t,prettyErrors:s}=Nn(e),r=new En(t?.addNewLine),i=new yn(e);let o=null;for(const a of i.compose(r.parse(n),!0,n.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new me(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}
131return s&&t&&(o.errors.forEach(Nt(n,t)),o.warnings.forEach(Nt(n,t))),o}function An(n,e,t){let s;typeof e=="function"?s=e:t===void 0&&e&&typeof e=="object"&&(t=e);const r=On(n,t);if(!r)return null;if(r.warnings.forEach(i=>Ft(r.options.logLevel,i)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:s},t))}export{it as Alias,yn as Composer,Re as Document,vn as Lexer,Sn as LineCounter,_ as Pair,En as Parser,S as Scalar,yt as Schema,ls as YAMLError,j as YAMLMap,me as YAMLParseError,H as YAMLSeq,Ws as YAMLWarning,Q as isAlias,T as isCollection,we as isDocument,ke as isMap,x as isNode,I as isPair,O as isScalar,ve as isSeq,An as parse,On as parseDocument,ue as visit,nt as visitAsync};
132//# sourceMappingURL=index-DmNq2fbN-Wnz-YQFi.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.