@next-bricks/vs 1.16.7 → 1.16.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bricks.json +1 -1
- package/dist/chunks/2939.08859fb0.js +2 -0
- package/dist/chunks/2939.08859fb0.js.map +1 -0
- package/dist/chunks/{5552.01d3b722.js → 3171.93dbb105.js} +2 -2
- package/dist/chunks/{5552.01d3b722.js.map → 3171.93dbb105.js.map} +1 -1
- package/dist/chunks/{4539.e571397e.js → 4539.46bb2a19.js} +3 -3
- package/dist/chunks/{4539.e571397e.js.map → 4539.46bb2a19.js.map} +1 -1
- package/dist/chunks/4765.2ea21257.js +2 -0
- package/dist/chunks/4765.2ea21257.js.map +1 -0
- package/dist/chunks/{4837.84976d7d.js → 4837.f426429e.js} +2 -2
- package/dist/chunks/4837.f426429e.js.map +1 -0
- package/dist/chunks/{3171.73656b72.js → 5552.eee150ed.js} +2 -2
- package/dist/chunks/{3171.73656b72.js.map → 5552.eee150ed.js.map} +1 -1
- package/dist/chunks/7146.07b85c3f.js +2 -0
- package/dist/chunks/7146.07b85c3f.js.map +1 -0
- package/dist/chunks/{7218.a66d381f.js → 7218.4cd038f2.js} +2 -2
- package/dist/chunks/7218.4cd038f2.js.map +1 -0
- package/dist/chunks/{7242.057e2fe0.js → 7242.6d2e41d5.js} +2 -2
- package/dist/chunks/{7242.057e2fe0.js.map → 7242.6d2e41d5.js.map} +1 -1
- package/dist/chunks/7815.a5d51a5a.js +2 -0
- package/dist/chunks/{7094.55027c1e.js.map → 7815.a5d51a5a.js.map} +1 -1
- package/dist/chunks/9140.0f6af18f.js +3 -0
- package/dist/chunks/9140.0f6af18f.js.map +1 -0
- package/dist/chunks/{code-editor.a7f1eca7.js → code-editor.1052746f.js} +2 -2
- package/dist/chunks/{code-editor.a7f1eca7.js.map → code-editor.1052746f.js.map} +1 -1
- package/dist/chunks/main.ccc87e23.js +2 -0
- package/dist/chunks/main.ccc87e23.js.map +1 -0
- package/dist/index.f7be9073.js +2 -0
- package/dist/index.f7be9073.js.map +1 -0
- package/package.json +2 -2
- package/dist/chunks/1419.4075ce17.js +0 -2
- package/dist/chunks/1419.4075ce17.js.map +0 -1
- package/dist/chunks/3933.ef8099f3.js +0 -2
- package/dist/chunks/3933.ef8099f3.js.map +0 -1
- package/dist/chunks/4837.84976d7d.js.map +0 -1
- package/dist/chunks/6314.0c419cba.js +0 -2
- package/dist/chunks/6314.0c419cba.js.map +0 -1
- package/dist/chunks/7094.55027c1e.js +0 -2
- package/dist/chunks/7218.a66d381f.js.map +0 -1
- package/dist/chunks/9140.dc58d876.js +0 -3
- package/dist/chunks/9140.dc58d876.js.map +0 -1
- package/dist/chunks/main.10e09668.js +0 -2
- package/dist/chunks/main.10e09668.js.map +0 -1
- package/dist/index.7df8e225.js +0 -2
- package/dist/index.7df8e225.js.map +0 -1
- /package/dist/chunks/{4539.e571397e.js.LICENSE.txt → 4539.46bb2a19.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{9140.dc58d876.js.LICENSE.txt → 9140.0f6af18f.js.LICENSE.txt} +0 -0
package/dist/bricks.json
CHANGED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_next_bricks_vs=globalThis.webpackChunk_next_bricks_vs||[]).push([[2939],{2939:(e,t,s)=>{s.r(t),s.d(t,{Alias:()=>q,CST:()=>n,Composer:()=>Zt,Document:()=>Ot,Lexer:()=>Ts,LineCounter:()=>Is,Pair:()=>be,Parser:()=>Bs,Scalar:()=>R,Schema:()=>Nt,YAMLError:()=>Tt,YAMLMap:()=>Ne,YAMLParseError:()=>It,YAMLSeq:()=>Ae,YAMLWarning:()=>Lt,default:()=>Us,isAlias:()=>h,isCollection:()=>b,isDocument:()=>d,isMap:()=>p,isNode:()=>k,isPair:()=>m,isScalar:()=>y,isSeq:()=>g,parse:()=>qs,parseAllDocuments:()=>js,parseDocument:()=>Ds,stringify:()=>Ps,visit:()=>N,visitAsync:()=>A});var n={};s.r(n),s.d(n,{BOM:()=>ds,DOCUMENT:()=>ps,FLOW_END:()=>ms,SCALAR:()=>ys,createScalarToken:()=>ts,isCollection:()=>gs,isScalar:()=>bs,prettyToken:()=>ks,resolveAsScalar:()=>es,setScalarValue:()=>ss,stringify:()=>os,tokenType:()=>ws,visit:()=>fs});var i={};s.r(i),s.d(i,{Alias:()=>q,CST:()=>n,Composer:()=>Zt,Document:()=>Ot,Lexer:()=>Ts,LineCounter:()=>Is,Pair:()=>be,Parser:()=>Bs,Scalar:()=>R,Schema:()=>Nt,YAMLError:()=>Tt,YAMLMap:()=>Ne,YAMLParseError:()=>It,YAMLSeq:()=>Ae,YAMLWarning:()=>Lt,isAlias:()=>h,isCollection:()=>b,isDocument:()=>d,isMap:()=>p,isNode:()=>k,isPair:()=>m,isScalar:()=>y,isSeq:()=>g,parse:()=>qs,parseAllDocuments:()=>js,parseDocument:()=>Ds,stringify:()=>Ps,visit:()=>N,visitAsync:()=>A});const o=Symbol.for("yaml.alias"),r=Symbol.for("yaml.document"),a=Symbol.for("yaml.map"),c=Symbol.for("yaml.pair"),l=Symbol.for("yaml.scalar"),u=Symbol.for("yaml.seq"),f=Symbol.for("yaml.node.type"),h=e=>!!e&&"object"==typeof e&&e[f]===o,d=e=>!!e&&"object"==typeof e&&e[f]===r,p=e=>!!e&&"object"==typeof e&&e[f]===a,m=e=>!!e&&"object"==typeof e&&e[f]===c,y=e=>!!e&&"object"==typeof e&&e[f]===l,g=e=>!!e&&"object"==typeof e&&e[f]===u;function b(e){if(e&&"object"==typeof e)switch(e[f]){case a:case u:return!0}return!1}function k(e){if(e&&"object"==typeof e)switch(e[f]){case o:case a:case l:case u:return!0}return!1}const w=e=>(y(e)||b(e))&&!!e.anchor,v=Symbol("break visit"),S=Symbol("skip children"),E=Symbol("remove node");function N(e,t){const s=I(t);d(e)?O(null,e.contents,s,Object.freeze([e]))===E&&(e.contents=null):O(null,e,s,Object.freeze([]))}function O(e,t,s,n){const i=L(e,t,s,n);if(k(i)||m(i))return x(e,n,i),O(e,i,s,n);if("symbol"!=typeof i)if(b(t)){n=Object.freeze(n.concat(t));for(let e=0;e<t.items.length;++e){const i=O(e,t.items[e],s,n);if("number"==typeof i)e=i-1;else{if(i===v)return v;i===E&&(t.items.splice(e,1),e-=1)}}}else if(m(t)){n=Object.freeze(n.concat(t));const e=O("key",t.key,s,n);if(e===v)return v;e===E&&(t.key=null);const i=O("value",t.value,s,n);if(i===v)return v;i===E&&(t.value=null)}return i}async function A(e,t){const s=I(t);d(e)?await T(null,e.contents,s,Object.freeze([e]))===E&&(e.contents=null):await T(null,e,s,Object.freeze([]))}async function T(e,t,s,n){const i=await L(e,t,s,n);if(k(i)||m(i))return x(e,n,i),T(e,i,s,n);if("symbol"!=typeof i)if(b(t)){n=Object.freeze(n.concat(t));for(let e=0;e<t.items.length;++e){const i=await T(e,t.items[e],s,n);if("number"==typeof i)e=i-1;else{if(i===v)return v;i===E&&(t.items.splice(e,1),e-=1)}}}else if(m(t)){n=Object.freeze(n.concat(t));const e=await T("key",t.key,s,n);if(e===v)return v;e===E&&(t.key=null);const i=await T("value",t.value,s,n);if(i===v)return v;i===E&&(t.value=null)}return i}function I(e){return"object"==typeof e&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function L(e,t,s,n){return"function"==typeof s?s(e,t,n):p(t)?s.Map?.(e,t,n):g(t)?s.Seq?.(e,t,n):m(t)?s.Pair?.(e,t,n):y(t)?s.Scalar?.(e,t,n):h(t)?s.Alias?.(e,t,n):void 0}function x(e,t,s){const n=t[t.length-1];if(b(n))n.items[e]=s;else if(m(n))"key"===e?n.key=s:n.value=s;else{if(!d(n)){const e=h(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${e} parent`)}n.contents=s}}N.BREAK=v,N.SKIP=S,N.REMOVE=E,A.BREAK=v,A.SKIP=S,A.REMOVE=E;const $={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"};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)}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]+/),n=s.shift();switch(n){case"%TAG":{if(2!==s.length&&(t(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;const[e,n]=s;return this.tags[e]=n,!0}case"%YAML":{if(this.yaml.explicit=!0,1!==s.length)return t(0,"%YAML directive should contain exactly one part"),!1;const[e]=s;return"1.1"===e||"1.2"===e?(this.yaml.version=e,!0):(t(6,`Unsupported YAML version ${e}`,/^\d+\.\d+$/.test(e)),!1)}default:return t(0,`Unknown directive ${n}`,!0),!1}}tagName(e,t){if("!"===e)return"!";if("!"!==e[0])return t(`Not a valid tag: ${e}`),null;if("<"===e[1]){const s=e.slice(2,-1);return"!"===s||"!!"===s?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(">"!==e[e.length-1]&&t("Verbatim tags must end with a >"),s)}const[,s,n]=e.match(/^(.*!)([^!]*)$/s);n||t(`The ${e} tag has no suffix`);const i=this.tags[s];if(i)try{return i+decodeURIComponent(n)}catch(e){return t(String(e)),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+e.substring(s.length).replace(/[!,[\]{}]/g,(e=>$[e]));return"!"===e[0]?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let n;if(e&&s.length>0&&k(e.contents)){const t={};N(e.contents,((e,s)=>{k(s)&&s.tag&&(t[s.tag]=!0)})),n=Object.keys(t)}else n=[];for(const[i,o]of s)"!!"===i&&"tag:yaml.org,2002:"===o||e&&!n.some((e=>e.startsWith(o)))||t.push(`%TAG ${i} ${o}`);return t.join("\n")}}function _(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=JSON.stringify(e);throw new Error(`Anchor must not contain whitespace or control characters: ${t}`)}return!0}function K(e){const t=new Set;return N(e,{Value(e,s){s.anchor&&t.add(s.anchor)}}),t}function B(e,t){for(let s=1;;++s){const n=`${e}${s}`;if(!t.has(n))return n}}function M(e,t,s,n){if(n&&"object"==typeof n)if(Array.isArray(n))for(let t=0,s=n.length;t<s;++t){const s=n[t],i=M(e,n,String(t),s);void 0===i?delete n[t]:i!==s&&(n[t]=i)}else if(n instanceof Map)for(const t of Array.from(n.keys())){const s=n.get(t),i=M(e,n,t,s);void 0===i?n.delete(t):i!==s&&n.set(t,i)}else if(n instanceof Set)for(const t of Array.from(n)){const s=M(e,n,t,t);void 0===s?n.delete(t):s!==t&&(n.delete(t),n.add(s))}else for(const[t,s]of Object.entries(n)){const i=M(e,n,t,s);void 0===i?delete n[t]:i!==s&&(n[t]=i)}return e.call(t,s,n)}function j(e,t,s){if(Array.isArray(e))return e.map(((e,t)=>j(e,String(t),s)));if(e&&"function"==typeof e.toJSON){if(!s||!w(e))return e.toJSON(t,s);const n={aliasCount:0,count:1,res:void 0};s.anchors.set(e,n),s.onCreate=e=>{n.res=e,delete s.onCreate};const i=e.toJSON(t,s);return s.onCreate&&s.onCreate(i),i}return"bigint"!=typeof e||s?.keep?e:Number(e)}C.defaultYaml={explicit:!1,version:"1.2"},C.defaultTags={"!!":"tag:yaml.org,2002:"};class D{constructor(e){Object.defineProperty(this,f,{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:n,reviver:i}={}){if(!d(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:!0,mapAsMap:!0===t,mapKeyWarned:!1,maxAliasCount:"number"==typeof s?s:100},r=j(this,"",o);if("function"==typeof n)for(const{count:e,res:t}of o.anchors.values())n(t,e);return"function"==typeof i?M(i,{"":r},"",r):r}}class q extends D{constructor(e){super(o),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){let s,n;t?.aliasResolveCache?s=t.aliasResolveCache:(s=[],N(e,{Node:(e,t)=>{(h(t)||w(t))&&s.push(t)}}),t&&(t.aliasResolveCache=s));for(const e of s){if(e===this)break;e.anchor===this.source&&(n=e)}return n}toJSON(e,t){if(!t)return{source:this.source};const{anchors:s,doc:n,maxAliasCount:i}=t,o=this.resolve(n,t);if(!o){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(e)}let r=s.get(o);if(r||(j(o,null,t),r=s.get(o)),!r||void 0===r.res)throw new ReferenceError("This should not happen: Alias anchor was not resolved?");if(i>=0&&(r.count+=1,0===r.aliasCount&&(r.aliasCount=P(n,o,s)),r.count*r.aliasCount>i))throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack");return r.res}toString(e,t,s){const n=`*${this.source}`;if(e){if(_(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(e)}if(e.implicitKey)return`${n} `}return n}}function P(e,t,s){if(h(t)){const n=t.resolve(e),i=s&&n&&s.get(n);return i?i.count*i.aliasCount:0}if(b(t)){let n=0;for(const i of t.items){const t=P(e,i,s);t>n&&(n=t)}return n}if(m(t)){const n=P(e,t.key,s),i=P(e,t.value,s);return Math.max(n,i)}return 1}const U=e=>!e||"function"!=typeof e&&"object"!=typeof e;class R extends D{constructor(e){super(l),this.value=e}toJSON(e,t){return t?.keep?this.value:j(this.value,e,t)}toString(){return String(this.value)}}function F(e,t,s){if(d(e)&&(e=e.contents),k(e))return e;if(m(e)){const t=s.schema[a].createNode?.(s.schema,null,s);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||"undefined"!=typeof BigInt&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:n,onAnchor:i,onTagObj:o,schema:r,sourceObjects:c}=s;let l;if(n&&e&&"object"==typeof e){if(l=c.get(e),l)return l.anchor??(l.anchor=i(e)),new q(l.anchor);l={anchor:null,node:null},c.set(e,l)}t?.startsWith("!!")&&(t="tag:yaml.org,2002:"+t.slice(2));let f=function(e,t,s){if(t){const e=s.filter((e=>e.tag===t)),n=e.find((e=>!e.format))??e[0];if(!n)throw new Error(`Tag ${t} not found`);return n}return s.find((t=>t.identify?.(e)&&!t.format))}(e,t,r.tags);if(!f){if(e&&"function"==typeof e.toJSON&&(e=e.toJSON()),!e||"object"!=typeof e){const t=new R(e);return l&&(l.node=t),t}f=e instanceof Map?r[a]:Symbol.iterator in Object(e)?r[u]:r[a]}o&&(o(f),delete s.onTagObj);const h=f?.createNode?f.createNode(s.schema,e,s):"function"==typeof f?.nodeClass?.from?f.nodeClass.from(s.schema,e,s):new R(e);return t?h.tag=t:f.default||(h.tag=f.tag),l&&(l.node=h),h}function V(e,t,s){let n=s;for(let e=t.length-1;e>=0;--e){const s=t[e];if("number"==typeof s&&Number.isInteger(s)&&s>=0){const e=[];e[s]=n,n=e}else n=new Map([[s,n]])}return F(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}R.BLOCK_FOLDED="BLOCK_FOLDED",R.BLOCK_LITERAL="BLOCK_LITERAL",R.PLAIN="PLAIN",R.QUOTE_DOUBLE="QUOTE_DOUBLE",R.QUOTE_SINGLE="QUOTE_SINGLE";const Y=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;class J extends D{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((t=>k(t)||m(t)?t.clone(e):t)),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Y(e))this.add(t);else{const[s,...n]=e,i=this.get(s,!0);if(b(i))i.addIn(n,t);else{if(void 0!==i||!this.schema)throw new Error(`Expected YAML collection at ${s}. Remaining path: ${n}`);this.set(s,V(this.schema,n,t))}}}deleteIn(e){const[t,...s]=e;if(0===s.length)return this.delete(t);const n=this.get(t,!0);if(b(n))return n.deleteIn(s);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${s}`)}getIn(e,t){const[s,...n]=e,i=this.get(s,!0);return 0===n.length?!t&&y(i)?i.value:i:b(i)?i.getIn(n,t):void 0}hasAllNullValues(e){return this.items.every((t=>{if(!m(t))return!1;const s=t.value;return null==s||e&&y(s)&&null==s.value&&!s.commentBefore&&!s.comment&&!s.tag}))}hasIn(e){const[t,...s]=e;if(0===s.length)return this.has(t);const n=this.get(t,!0);return!!b(n)&&n.hasIn(s)}setIn(e,t){const[s,...n]=e;if(0===n.length)this.set(s,t);else{const e=this.get(s,!0);if(b(e))e.setIn(n,t);else{if(void 0!==e||!this.schema)throw new Error(`Expected YAML collection at ${s}. Remaining path: ${n}`);this.set(s,V(this.schema,n,t))}}}}const W=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function G(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Q=(e,t,s)=>e.endsWith("\n")?G(s,t):s.includes("\n")?"\n"+G(s,t):(e.endsWith(" ")?"":" ")+s,H="flow",X="block",z="quoted";function Z(e,t,s="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:o=20,onFold:r,onOverflow:a}={}){if(!i||i<0)return e;i<o&&(o=0);const c=Math.max(1+o,1+i-t.length);if(e.length<=c)return e;const l=[],u={};let f,h,d=i-t.length;"number"==typeof n&&(n>i-Math.max(2,o)?l.push(0):d=i-n);let p=!1,m=-1,y=-1,g=-1;s===X&&(m=ee(e,m,t.length),-1!==m&&(d=m+c));for(let n;n=e[m+=1];){if(s===z&&"\\"===n){switch(y=m,e[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}g=m}if("\n"===n)s===X&&(m=ee(e,m,t.length)),d=m+t.length+c,f=void 0;else{if(" "===n&&h&&" "!==h&&"\n"!==h&&"\t"!==h){const t=e[m+1];t&&" "!==t&&"\n"!==t&&"\t"!==t&&(f=m)}if(m>=d)if(f)l.push(f),d=f+c,f=void 0;else if(s===z){for(;" "===h||"\t"===h;)h=n,n=e[m+=1],p=!0;const t=m>g+1?m-2:y-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else p=!0}h=n}if(p&&a&&a(),0===l.length)return e;r&&r();let b=e.slice(0,l[0]);for(let n=0;n<l.length;++n){const i=l[n],o=l[n+1]||e.length;0===i?b=`\n${t}${e.slice(0,o)}`:(s===z&&u[i]&&(b+=`${e[i]}\\`),b+=`\n${t}${e.slice(i+1,o)}`)}return b}function ee(e,t,s){let n=t,i=t+1,o=e[i];for(;" "===o||"\t"===o;)if(t<i+s)o=e[++t];else{do{o=e[++t]}while(o&&"\n"!==o);n=t,i=t+1,o=e[i]}return n}const te=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),se=e=>/^(%|---|\.\.\.)/m.test(e);function ne(e,t){const s=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return s;const{implicitKey:n}=t,i=t.options.doubleQuotedMinMultiLineLength,o=t.indent||(se(e)?" ":"");let r="",a=0;for(let e=0,t=s[e];t;t=s[++e])if(" "===t&&"\\"===s[e+1]&&"n"===s[e+2]&&(r+=s.slice(a,e)+"\\ ",e+=1,a=e,t="\\"),"\\"===t)switch(s[e+1]){case"u":{r+=s.slice(a,e);const t=s.substr(e+2,4);switch(t){case"0000":r+="\\0";break;case"0007":r+="\\a";break;case"000b":r+="\\v";break;case"001b":r+="\\e";break;case"0085":r+="\\N";break;case"00a0":r+="\\_";break;case"2028":r+="\\L";break;case"2029":r+="\\P";break;default:"00"===t.substr(0,2)?r+="\\x"+t.substr(2):r+=s.substr(e,6)}e+=5,a=e+1}break;case"n":if(n||'"'===s[e+2]||s.length<i)e+=1;else{for(r+=s.slice(a,e)+"\n\n";"\\"===s[e+2]&&"n"===s[e+3]&&'"'!==s[e+4];)r+="\n",e+=2;r+=o," "===s[e+2]&&(r+="\\"),e+=1,a=e+1}break;default:e+=1}return r=a?r+s.slice(a):s,n?r:Z(r,o,z,te(t,!1))}function ie(e,t){if(!1===t.options.singleQuote||t.implicitKey&&e.includes("\n")||/[ \t]\n|\n[ \t]/.test(e))return ne(e,t);const s=t.indent||(se(e)?" ":""),n="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&\n${s}`)+"'";return t.implicitKey?n:Z(n,s,H,te(t,!1))}function oe(e,t){const{singleQuote:s}=t.options;let n;if(!1===s)n=ne;else{const t=e.includes('"'),i=e.includes("'");n=t&&!i?ie:i&&!t?ne:s?ie:ne}return n(e,t)}let re;try{re=new RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch{re=/\n+(?!\n|$)/g}function ae({comment:e,type:t,value:s},n,i,o){const{blockQuote:r,commentString:a,lineWidth:c}=n.options;if(!r||/\n[\t ]+$/.test(s)||/^\s*$/.test(s))return oe(s,n);const l=n.indent||(n.forceBlockIndent||se(s)?" ":""),u="literal"===r||"folded"!==r&&t!==R.BLOCK_FOLDED&&(t===R.BLOCK_LITERAL||!function(e,t,s){if(!t||t<0)return!1;const n=t-s,i=e.length;if(i<=n)return!1;for(let t=0,s=0;t<i;++t)if("\n"===e[t]){if(t-s>n)return!0;if(s=t+1,i-s<=n)return!1}return!0}(s,c,l.length));if(!s)return u?"|\n":">\n";let f,h;for(h=s.length;h>0;--h){const e=s[h-1];if("\n"!==e&&"\t"!==e&&" "!==e)break}let d=s.substring(h);const p=d.indexOf("\n");-1===p?f="-":s===d||p!==d.length-1?(f="+",o&&o()):f="",d&&(s=s.slice(0,-d.length),"\n"===d[d.length-1]&&(d=d.slice(0,-1)),d=d.replace(re,`$&${l}`));let m,y=!1,g=-1;for(m=0;m<s.length;++m){const e=s[m];if(" "===e)y=!0;else{if("\n"!==e)break;g=m}}let b=s.substring(0,g<m?g+1:m);b&&(s=s.substring(b.length),b=b.replace(/\n+/g,`$&${l}`));let k=(y?l?"2":"1":"")+f;if(e&&(k+=" "+a(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!u){const e=s.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`);let i=!1;const o=te(n,!0);"folded"!==r&&t!==R.BLOCK_FOLDED&&(o.onOverflow=()=>{i=!0});const a=Z(`${b}${e}${d}`,l,X,o);if(!i)return`>${k}\n${l}${a}`}return`|${k}\n${l}${b}${s=s.replace(/\n+/g,`$&${l}`)}${d}`}function ce(e,t,s,n){const{implicitKey:i,inFlow:o}=t,r="string"==typeof e.value?e:Object.assign({},e,{value:String(e.value)});let{type:a}=e;a!==R.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(r.value)&&(a=R.QUOTE_DOUBLE);const c=e=>{switch(e){case R.BLOCK_FOLDED:case R.BLOCK_LITERAL:return i||o?oe(r.value,t):ae(r,t,s,n);case R.QUOTE_DOUBLE:return ne(r.value,t);case R.QUOTE_SINGLE:return ie(r.value,t);case R.PLAIN:return function(e,t,s,n){const{type:i,value:o}=e,{actualString:r,implicitKey:a,indent:c,indentStep:l,inFlow:u}=t;if(a&&o.includes("\n")||u&&/[[\]{},]/.test(o))return oe(o,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes("\n")?oe(o,t):ae(e,t,s,n);if(!a&&!u&&i!==R.PLAIN&&o.includes("\n"))return ae(e,t,s,n);if(se(o)){if(""===c)return t.forceBlockIndent=!0,ae(e,t,s,n);if(a&&c===l)return oe(o,t)}const f=o.replace(/\n+/g,`$&\n${c}`);if(r){const e=e=>e.default&&"tag:yaml.org,2002:str"!==e.tag&&e.test?.test(f),{compat:s,tags:n}=t.doc.schema;if(n.some(e)||s?.some(e))return oe(o,t)}return a?f:Z(f,c,H,te(t,!1))}(r,t,s,n);default:return null}};let l=c(a);if(null===l){const{defaultKeyType:e,defaultStringType:s}=t.options,n=i&&e||s;if(l=c(n),null===l)throw new Error(`Unsupported default string type ${n}`)}return l}function le(e,t){const s=Object.assign({blockQuote:!0,commentString:W,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},e.schema.toStringOptions,t);let n;switch(s.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:e,flowCollectionPadding:s.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof s.indent?" ".repeat(s.indent):" ",inFlow:n,options:s}}function ue(e,t,s,n){if(m(e))return e.toString(t,s,n);if(h(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i;const o=k(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??(i=function(e,t){if(t.tag){const s=e.filter((e=>e.tag===t.tag));if(s.length>0)return s.find((e=>e.format===t.format))??s[0]}let s,n;if(y(t)){n=t.value;let i=e.filter((e=>e.identify?.(n)));if(i.length>1){const e=i.filter((e=>e.test));e.length>0&&(i=e)}s=i.find((e=>e.format===t.format))??i.find((e=>!e.format))}else n=t,s=e.find((e=>e.nodeClass&&n instanceof e.nodeClass));if(!s)throw new Error(`Tag not resolved for ${n?.constructor?.name??(null===n?"null":typeof n)} value`);return s}(t.doc.schema.tags,o));const r=function(e,t,{anchors:s,doc:n}){if(!n.directives)return"";const i=[],o=(y(e)||b(e))&&e.anchor;o&&_(o)&&(s.add(o),i.push(`&${o}`));const r=e.tag??(t.default?null:t.tag);return r&&i.push(n.directives.tagString(r)),i.join(" ")}(o,i,t);r.length>0&&(t.indentAtStart=(t.indentAtStart??0)+r.length+1);const a="function"==typeof i.stringify?i.stringify(o,t,s,n):y(o)?ce(o,t,s,n):o.toString(t,s,n);return r?y(o)||"{"===a[0]||"["===a[0]?`${r} ${a}`:`${r}\n${t.indent}${a}`:a}function fe(e,t){"debug"!==e&&"warn"!==e||console.warn(t)}const he="<<",de={identify:e=>e===he||"symbol"==typeof e&&e.description===he,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new R(Symbol(he)),{addToJSMap:pe}),stringify:()=>he};function pe(e,t,s){if(s=e&&h(s)?s.resolve(e.doc):s,g(s))for(const n of s.items)me(e,t,n);else if(Array.isArray(s))for(const n of s)me(e,t,n);else me(e,t,s)}function me(e,t,s){const n=e&&h(s)?s.resolve(e.doc):s;if(!p(n))throw new Error("Merge sources must be maps or map aliases");const i=n.toJSON(null,e,Map);for(const[e,s]of i)t instanceof Map?t.has(e)||t.set(e,s):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:s,writable:!0,enumerable:!0,configurable:!0});return t}function ye(e,t,{key:s,value:n}){if(k(s)&&s.addToJSMap)s.addToJSMap(e,t,n);else if(((e,t)=>(de.identify(t)||y(t)&&(!t.type||t.type===R.PLAIN)&&de.identify(t.value))&&e?.doc.schema.tags.some((e=>e.tag===de.tag&&e.default)))(e,s))pe(e,t,n);else{const i=j(s,"",e);if(t instanceof Map)t.set(i,j(n,i,e));else if(t instanceof Set)t.add(i);else{const o=function(e,t,s){if(null===t)return"";if("object"!=typeof t)return String(t);if(k(e)&&s?.doc){const t=le(s.doc,{});t.anchors=new Set;for(const e of s.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;const n=e.toString(t);if(!s.mapKeyWarned){let e=JSON.stringify(n);e.length>40&&(e=e.substring(0,36)+'..."'),fe(s.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),s.mapKeyWarned=!0}return n}return JSON.stringify(t)}(s,i,e),r=j(n,o,e);o in t?Object.defineProperty(t,o,{value:r,writable:!0,enumerable:!0,configurable:!0}):t[o]=r}}return t}function ge(e,t,s){const n=F(e,void 0,s),i=F(t,void 0,s);return new be(n,i)}class be{constructor(e,t=null){Object.defineProperty(this,f,{value:c}),this.key=e,this.value=t}clone(e){let{key:t,value:s}=this;return k(t)&&(t=t.clone(e)),k(s)&&(s=s.clone(e)),new be(t,s)}toJSON(e,t){return ye(t,t?.mapAsMap?new Map:{},this)}toString(e,t,s){return e?.doc?function({key:e,value:t},s,n,i){const{allNullValues:o,doc:r,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:f}}=s;let h=k(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(b(e)||!k(e)&&"object"==typeof e)throw new Error("With simple keys, collection cannot be used as a key value")}let d=!f&&(!e||h&&null==t&&!s.inFlow||b(e)||(y(e)?e.type===R.BLOCK_FOLDED||e.type===R.BLOCK_LITERAL:"object"==typeof e));s=Object.assign({},s,{allNullValues:!1,implicitKey:!d&&(f||!o),indent:a+c});let p,m,w,v=!1,S=!1,E=ue(e,s,(()=>v=!0),(()=>S=!0));if(!d&&!s.inFlow&&E.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");d=!0}if(s.inFlow){if(o||null==t)return v&&n&&n(),""===E?"?":d?`? ${E}`:E}else if(o&&!f||null==t&&d)return E=`? ${E}`,h&&!v?E+=Q(E,s.indent,l(h)):S&&i&&i(),E;v&&(h=null),d?(h&&(E+=Q(E,s.indent,l(h))),E=`? ${E}\n${a}:`):(E=`${E}:`,h&&(E+=Q(E,s.indent,l(h)))),k(t)?(p=!!t.spaceBefore,m=t.commentBefore,w=t.comment):(p=!1,m=null,w=null,t&&"object"==typeof t&&(t=r.createNode(t))),s.implicitKey=!1,d||h||!y(t)||(s.indentAtStart=E.length+1),S=!1,u||!(c.length>=2)||s.inFlow||d||!g(t)||t.flow||t.tag||t.anchor||(s.indent=s.indent.substring(2));let N=!1;const O=ue(t,s,(()=>N=!0),(()=>S=!0));let A=" ";if(h||p||m)A=p?"\n":"",m&&(A+=`\n${G(l(m),s.indent)}`),""!==O||s.inFlow?A+=`\n${s.indent}`:"\n"===A&&(A="\n\n");else if(!d&&b(t)){const e=O[0],n=O.indexOf("\n"),i=-1!==n,o=s.inFlow??t.flow??0===t.items.length;if(i||!o){let t=!1;if(i&&("&"===e||"!"===e)){let s=O.indexOf(" ");"&"===e&&-1!==s&&s<n&&"!"===O[s+1]&&(s=O.indexOf(" ",s+1)),(-1===s||n<s)&&(t=!0)}t||(A=`\n${s.indent}`)}}else""!==O&&"\n"!==O[0]||(A="");return E+=A+O,s.inFlow?N&&n&&n():w&&!N?E+=Q(E,s.indent,l(w)):S&&i&&i(),E}(this,e,t,s):JSON.stringify(this)}}function ke(e,t,s){return(t.inFlow??e.flow?ve:we)(e,t,s)}function we({comment:e,items:t},s,{blockItemPrefix:n,flowChars:i,itemIndent:o,onChompKeep:r,onComment:a}){const{indent:c,options:{commentString:l}}=s,u=Object.assign({},s,{indent:o,type:null});let f=!1;const h=[];for(let e=0;e<t.length;++e){const i=t[e];let r=null;if(k(i))!f&&i.spaceBefore&&h.push(""),Se(s,h,i.commentBefore,f),i.comment&&(r=i.comment);else if(m(i)){const e=k(i.key)?i.key:null;e&&(!f&&e.spaceBefore&&h.push(""),Se(s,h,e.commentBefore,f))}f=!1;let a=ue(i,u,(()=>r=null),(()=>f=!0));r&&(a+=Q(a,o,l(r))),f&&r&&(f=!1),h.push(n+a)}let d;if(0===h.length)d=i.start+i.end;else{d=h[0];for(let e=1;e<h.length;++e){const t=h[e];d+=t?`\n${c}${t}`:"\n"}}return e?(d+="\n"+G(l(e),c),a&&a()):f&&r&&r(),d}function ve({items:e},t,{flowChars:s,itemIndent:n}){const{indent:i,indentStep:o,flowCollectionPadding:r,options:{commentString:a}}=t;n+=o;const c=Object.assign({},t,{indent:n,inFlow:!0,type:null});let l=!1,u=0;const f=[];for(let s=0;s<e.length;++s){const i=e[s];let o=null;if(k(i))i.spaceBefore&&f.push(""),Se(t,f,i.commentBefore,!1),i.comment&&(o=i.comment);else if(m(i)){const e=k(i.key)?i.key:null;e&&(e.spaceBefore&&f.push(""),Se(t,f,e.commentBefore,!1),e.comment&&(l=!0));const s=k(i.value)?i.value:null;s?(s.comment&&(o=s.comment),s.commentBefore&&(l=!0)):null==i.value&&e?.comment&&(o=e.comment)}o&&(l=!0);let r=ue(i,c,(()=>o=null));s<e.length-1&&(r+=","),o&&(r+=Q(r,n,a(o))),!l&&(f.length>u||r.includes("\n"))&&(l=!0),f.push(r),u=f.length}const{start:h,end:d}=s;if(0===f.length)return h+d;if(!l){const e=f.reduce(((e,t)=>e+t.length+2),2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=h;for(const t of f)e+=t?`\n${o}${i}${t}`:"\n";return`${e}\n${i}${d}`}return`${h}${r}${f.join(" ")}${r}${d}`}function Se({indent:e,options:{commentString:t}},s,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){const i=G(t(n),e);s.push(i.trimStart())}}function Ee(e,t){const s=y(t)?t.value:t;for(const n of e)if(m(n)){if(n.key===t||n.key===s)return n;if(y(n.key)&&n.key.value===s)return n}}class Ne extends J{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(a,e),this.items=[]}static from(e,t,s){const{keepUndefined:n,replacer:i}=s,o=new this(e),r=(e,r)=>{if("function"==typeof i)r=i.call(t,e,r);else if(Array.isArray(i)&&!i.includes(e))return;(void 0!==r||n)&&o.items.push(ge(e,r,s))};if(t instanceof Map)for(const[e,s]of t)r(e,s);else if(t&&"object"==typeof t)for(const e of Object.keys(t))r(e,t[e]);return"function"==typeof e.sortMapEntries&&o.items.sort(e.sortMapEntries),o}add(e,t){let s;s=m(e)?e:e&&"object"==typeof e&&"key"in e?new be(e.key,e.value):new be(e,e?.value);const n=Ee(this.items,s.key),i=this.schema?.sortMapEntries;if(n){if(!t)throw new Error(`Key ${s.key} already set`);y(n.value)&&U(s.value)?n.value.value=s.value:n.value=s.value}else if(i){const e=this.items.findIndex((e=>i(s,e)<0));-1===e?this.items.push(s):this.items.splice(e,0,s)}else this.items.push(s)}delete(e){const t=Ee(this.items,e);return!!t&&this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){const s=Ee(this.items,e),n=s?.value;return(!t&&y(n)?n.value:n)??void 0}has(e){return!!Ee(this.items,e)}set(e,t){this.add(new be(e,t),!0)}toJSON(e,t,s){const n=s?new s:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(n);for(const e of this.items)ye(t,n,e);return n}toString(e,t,s){if(!e)return JSON.stringify(this);for(const e of this.items)if(!m(e))throw new Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),ke(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:t})}}const Oe={collection:"map",default:!0,nodeClass:Ne,tag:"tag:yaml.org,2002:map",resolve:(e,t)=>(p(e)||t("Expected a mapping for this tag"),e),createNode:(e,t,s)=>Ne.from(e,t,s)};class Ae extends J{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(u,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=Te(e);return"number"==typeof t&&this.items.splice(t,1).length>0}get(e,t){const s=Te(e);if("number"!=typeof s)return;const n=this.items[s];return!t&&y(n)?n.value:n}has(e){const t=Te(e);return"number"==typeof t&&t<this.items.length}set(e,t){const s=Te(e);if("number"!=typeof s)throw new Error(`Expected a valid index, not ${e}.`);const n=this.items[s];y(n)&&U(t)?n.value=t:this.items[s]=t}toJSON(e,t){const s=[];t?.onCreate&&t.onCreate(s);let n=0;for(const e of this.items)s.push(j(e,String(n++),t));return s}toString(e,t,s){return e?ke(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:s,onComment:t}):JSON.stringify(this)}static from(e,t,s){const{replacer:n}=s,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let o of t){if("function"==typeof n){const s=t instanceof Set?o:String(e++);o=n.call(t,s,o)}i.items.push(F(o,void 0,s))}}return i}}function Te(e){let t=y(e)?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),"number"==typeof t&&Number.isInteger(t)&&t>=0?t:null}const Ie={collection:"seq",default:!0,nodeClass:Ae,tag:"tag:yaml.org,2002:seq",resolve:(e,t)=>(g(e)||t("Expected a sequence for this tag"),e),createNode:(e,t,s)=>Ae.from(e,t,s)},Le={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(e,t,s,n)=>ce(e,t=Object.assign({actualString:!0},t),s,n)},xe={identify:e=>null==e,createNode:()=>new R(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new R(null),stringify:({source:e},t)=>"string"==typeof e&&xe.test.test(e)?e:t.options.nullStr},$e={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new R("t"===e[0]||"T"===e[0]),stringify:({source:e,value:t},s)=>e&&$e.test.test(e)&&t===("t"===e[0]||"T"===e[0])?e:t?s.options.trueStr:s.options.falseStr};function Ce({format:e,minFractionDigits:t,tag:s,value:n}){if("bigint"==typeof n)return String(n);const i="number"==typeof n?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=JSON.stringify(n);if(!e&&t&&(!s||"tag:yaml.org,2002:float"===s)&&/^\d/.test(o)){let e=o.indexOf(".");e<0&&(e=o.length,o+=".");let s=t-(o.length-e-1);for(;s-- >0;)o+="0"}return o}const _e={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ce},Ke={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Ce(e)}},Be={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new R(parseFloat(e)),s=e.indexOf(".");return-1!==s&&"0"===e[e.length-1]&&(t.minFractionDigits=e.length-s-1),t},stringify:Ce},Me=e=>"bigint"==typeof e||Number.isInteger(e),je=(e,t,s,{intAsBigInt:n})=>n?BigInt(e):parseInt(e.substring(t),s);function De(e,t,s){const{value:n}=e;return Me(n)&&n>=0?s+n.toString(t):Ce(e)}const qe={identify:e=>Me(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,s)=>je(e,2,8,s),stringify:e=>De(e,8,"0o")},Pe={identify:Me,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,s)=>je(e,0,10,s),stringify:Ce},Ue={identify:e=>Me(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,s)=>je(e,2,16,s),stringify:e=>De(e,16,"0x")},Re=[Oe,Ie,Le,xe,$e,qe,Pe,Ue,_e,Ke,Be];function Fe(e){return"bigint"==typeof e||Number.isInteger(e)}const Ve=({value:e})=>JSON.stringify(e),Ye=[Oe,Ie].concat([{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Ve},{identify:e=>null==e,createNode:()=>new R(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ve},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>"true"===e,stringify:Ve},{identify:Fe,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:s})=>s?BigInt(e):parseInt(e,10),stringify:({value:e})=>Fe(e)?e.toString():JSON.stringify(e)},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Ve}],{default:!0,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)}),Je={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if("function"==typeof atob){const t=atob(e.replace(/[\n\r]/g,"")),s=new Uint8Array(t.length);for(let e=0;e<t.length;++e)s[e]=t.charCodeAt(e);return s}return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:s},n,i,o){if(!s)return"";const r=s;let a;if("function"!=typeof btoa)throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");{let e="";for(let t=0;t<r.length;++t)e+=String.fromCharCode(r[t]);a=btoa(e)}if(t??(t=R.BLOCK_LITERAL),t!==R.QUOTE_DOUBLE){const e=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),s=Math.ceil(a.length/e),i=new Array(s);for(let t=0,n=0;t<s;++t,n+=e)i[t]=a.substr(n,e);a=i.join(t===R.BLOCK_LITERAL?"\n":" ")}return ce({comment:e,type:t,value:a},n,i,o)}};function We(e,t){if(g(e))for(let s=0;s<e.items.length;++s){let n=e.items[s];if(!m(n)){if(p(n)){n.items.length>1&&t("Each pair must have its own sequence indicator");const e=n.items[0]||new be(new R(null));if(n.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${n.commentBefore}\n${e.key.commentBefore}`:n.commentBefore),n.comment){const t=e.value??e.key;t.comment=t.comment?`${n.comment}\n${t.comment}`:n.comment}n=e}e.items[s]=m(n)?n:new be(n)}}else t("Expected a sequence for this tag");return e}function Ge(e,t,s){const{replacer:n}=s,i=new Ae(e);i.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let e of t){let r,a;if("function"==typeof n&&(e=n.call(t,String(o++),e)),Array.isArray(e)){if(2!==e.length)throw new TypeError(`Expected [key, value] tuple: ${e}`);r=e[0],a=e[1]}else if(e&&e instanceof Object){const t=Object.keys(e);if(1!==t.length)throw new TypeError(`Expected tuple with one key, not ${t.length} keys`);r=t[0],a=e[r]}else r=e;i.items.push(ge(r,a,s))}return i}const Qe={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:We,createNode:Ge};class He extends Ae{constructor(){super(),this.add=Ne.prototype.add.bind(this),this.delete=Ne.prototype.delete.bind(this),this.get=Ne.prototype.get.bind(this),this.has=Ne.prototype.has.bind(this),this.set=Ne.prototype.set.bind(this),this.tag=He.tag}toJSON(e,t){if(!t)return super.toJSON(e);const s=new Map;t?.onCreate&&t.onCreate(s);for(const e of this.items){let n,i;if(m(e)?(n=j(e.key,"",t),i=j(e.value,n,t)):n=j(e,"",t),s.has(n))throw new Error("Ordered maps must not include duplicate keys");s.set(n,i)}return s}static from(e,t,s){const n=Ge(e,t,s),i=new this;return i.items=n.items,i}}He.tag="tag:yaml.org,2002:omap";const Xe={collection:"seq",identify:e=>e instanceof Map,nodeClass:He,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const s=We(e,t),n=[];for(const{key:e}of s.items)y(e)&&(n.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):n.push(e.value));return Object.assign(new He,s)},createNode:(e,t,s)=>He.from(e,t,s)};function ze({value:e,source:t},s){return t&&(e?Ze:et).test.test(t)?t:e?s.options.trueStr:s.options.falseStr}const Ze={identify:e=>!0===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new R(!0),stringify:ze},et={identify:e=>!1===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new R(!1),stringify:ze},tt={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ce},st={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Ce(e)}},nt={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new R(parseFloat(e.replace(/_/g,""))),s=e.indexOf(".");if(-1!==s){const n=e.substring(s+1).replace(/_/g,"");"0"===n[n.length-1]&&(t.minFractionDigits=n.length)}return t},stringify:Ce},it=e=>"bigint"==typeof e||Number.isInteger(e);function ot(e,t,s,{intAsBigInt:n}){const i=e[0];if("-"!==i&&"+"!==i||(t+=1),e=e.substring(t).replace(/_/g,""),n){switch(s){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}const t=BigInt(e);return"-"===i?BigInt(-1)*t:t}const o=parseInt(e,s);return"-"===i?-1*o:o}function rt(e,t,s){const{value:n}=e;if(it(n)){const e=n.toString(t);return n<0?"-"+s+e.substr(1):s+e}return Ce(e)}const at={identify:it,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,s)=>ot(e,2,2,s),stringify:e=>rt(e,2,"0b")},ct={identify:it,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,s)=>ot(e,1,8,s),stringify:e=>rt(e,8,"0")},lt={identify:it,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,s)=>ot(e,0,10,s),stringify:Ce},ut={identify:it,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,s)=>ot(e,2,16,s),stringify:e=>rt(e,16,"0x")};class ft extends Ne{constructor(e){super(e),this.tag=ft.tag}add(e){let t;t=m(e)?e:e&&"object"==typeof e&&"key"in e&&"value"in e&&null===e.value?new be(e.key,null):new be(e,null),Ee(this.items,t.key)||this.items.push(t)}get(e,t){const s=Ee(this.items,e);return!t&&m(s)?y(s.key)?s.key.value:s.key:s}set(e,t){if("boolean"!=typeof t)throw new Error("Expected boolean value for set(key, value) in a YAML set, not "+typeof t);const s=Ee(this.items,e);s&&!t?this.items.splice(this.items.indexOf(s),1):!s&&t&&this.items.push(new be(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:n}=s,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)"function"==typeof n&&(e=n.call(t,e,e)),i.items.push(ge(e,null,s));return i}}ft.tag="tag:yaml.org,2002:set";const ht={collection:"map",identify:e=>e instanceof Set,nodeClass:ft,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,s)=>ft.from(e,t,s),resolve(e,t){if(p(e)){if(e.hasAllNullValues(!0))return Object.assign(new ft,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function dt(e,t){const s=e[0],n="-"===s||"+"===s?e.substring(1):e,i=e=>t?BigInt(e):Number(e),o=n.replace(/_/g,"").split(":").reduce(((e,t)=>e*i(60)+i(t)),i(0));return"-"===s?i(-1)*o:o}function pt(e){let{value:t}=e,s=e=>e;if("bigint"==typeof t)s=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return Ce(e);let n="";t<0&&(n="-",t*=s(-1));const i=s(60),o=[t%i];return t<60?o.unshift(0):(t=(t-o[0])/i,o.unshift(t%i),t>=60&&(t=(t-o[0])/i,o.unshift(t))),n+o.map((e=>String(e).padStart(2,"0"))).join(":").replace(/000000\d*$/,"")}const mt={identify:e=>"bigint"==typeof e||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:s})=>dt(e,s),stringify:pt},yt={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>dt(e,!1),stringify:pt},gt={identify:e=>e 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(e){const t=e.match(gt.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,s,n,i,o,r,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let l=Date.UTC(s,n-1,i,o||0,r||0,a||0,c);const u=t[8];if(u&&"Z"!==u){let e=dt(u,!1);Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},bt=[Oe,Ie,Le,xe,Ze,et,at,ct,lt,ut,tt,st,nt,Je,de,Xe,Qe,ht,mt,yt,gt],kt=new Map([["core",Re],["failsafe",[Oe,Ie,Le]],["json",Ye],["yaml11",bt],["yaml-1.1",bt]]),wt={binary:Je,bool:$e,float:Be,floatExp:Ke,floatNaN:_e,floatTime:yt,int:Pe,intHex:Ue,intOct:qe,intTime:mt,map:Oe,merge:de,null:xe,omap:Xe,pairs:Qe,seq:Ie,set:ht,timestamp:gt},vt={"tag:yaml.org,2002:binary":Je,"tag:yaml.org,2002:merge":de,"tag:yaml.org,2002:omap":Xe,"tag:yaml.org,2002:pairs":Qe,"tag:yaml.org,2002:set":ht,"tag:yaml.org,2002:timestamp":gt};function St(e,t,s){const n=kt.get(t);if(n&&!e)return s&&!n.includes(de)?n.concat(de):n.slice();let i=n;if(!i){if(!Array.isArray(e)){const e=Array.from(kt.keys()).filter((e=>"yaml11"!==e)).map((e=>JSON.stringify(e))).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}i=[]}if(Array.isArray(e))for(const t of e)i=i.concat(t);else"function"==typeof e&&(i=e(i.slice()));return s&&(i=i.concat(de)),i.reduce(((e,t)=>{const s="string"==typeof t?wt[t]:t;if(!s){const e=JSON.stringify(t),s=Object.keys(wt).map((e=>JSON.stringify(e))).join(", ");throw new Error(`Unknown custom tag ${e}; use one of ${s}`)}return e.includes(s)||e.push(s),e}),[])}const Et=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Nt{constructor({compat:e,customTags:t,merge:s,resolveKnownTags:n,schema:i,sortMapEntries:o,toStringDefaults:r}){this.compat=Array.isArray(e)?St(e,"compat"):e?St(null,e):null,this.name="string"==typeof i&&i||"core",this.knownTags=n?vt:{},this.tags=St(t,this.name,s),this.toStringOptions=r??null,Object.defineProperty(this,a,{value:Oe}),Object.defineProperty(this,l,{value:Le}),Object.defineProperty(this,u,{value:Ie}),this.sortMapEntries="function"==typeof o?o:!0===o?Et:null}clone(){const e=Object.create(Nt.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}class Ot{constructor(e,t,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,f,{value:r});let n=null;"function"==typeof t||Array.isArray(t)?n=t:void 0===s&&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=void 0===e?null:this.createNode(e,n,s)}clone(){const e=Object.create(Ot.prototype,{[f]:{value:r}});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=k(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){At(this.contents)&&this.contents.add(e)}addIn(e,t){At(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const s=K(this);e.anchor=!t||s.has(t)?B(t||"a",s):t}return new q(e.anchor)}createNode(e,t,s){let n;if("function"==typeof t)e=t.call({"":e},"",e),n=t;else if(Array.isArray(t)){const e=e=>"number"==typeof e||e instanceof String||e instanceof Number,s=t.filter(e).map(String);s.length>0&&(t=t.concat(s)),n=t}else void 0===s&&t&&(s=t,t=void 0);const{aliasDuplicateObjects:i,anchorPrefix:o,flow:r,keepUndefined:a,onTagObj:c,tag:l}=s??{},{onAnchor:u,setAnchors:f,sourceObjects:h}=function(e,t){const s=[],n=new Map;let i=null;return{onAnchor:n=>{s.push(n),i??(i=K(e));const o=B(t,i);return i.add(o),o},setAnchors:()=>{for(const e of s){const t=n.get(e);if("object"!=typeof t||!t.anchor||!y(t.node)&&!b(t.node)){const t=new Error("Failed to resolve repeated object (this should not happen)");throw t.source=e,t}t.node.anchor=t.anchor}},sourceObjects:n}}(this,o||"a"),d=F(e,l,{aliasDuplicateObjects:i??!0,keepUndefined:a??!1,onAnchor:u,onTagObj:c,replacer:n,schema:this.schema,sourceObjects:h});return r&&b(d)&&(d.flow=!0),f(),d}createPair(e,t,s={}){const n=this.createNode(e,null,s),i=this.createNode(t,null,s);return new be(n,i)}delete(e){return!!At(this.contents)&&this.contents.delete(e)}deleteIn(e){return Y(e)?null!=this.contents&&(this.contents=null,!0):!!At(this.contents)&&this.contents.deleteIn(e)}get(e,t){return b(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Y(e)?!t&&y(this.contents)?this.contents.value:this.contents:b(this.contents)?this.contents.getIn(e,t):void 0}has(e){return!!b(this.contents)&&this.contents.has(e)}hasIn(e){return Y(e)?void 0!==this.contents:!!b(this.contents)&&this.contents.hasIn(e)}set(e,t){null==this.contents?this.contents=V(this.schema,[e],t):At(this.contents)&&this.contents.set(e,t)}setIn(e,t){Y(e)?this.contents=t:null==this.contents?this.contents=V(this.schema,Array.from(e),t):At(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){let s;switch("number"==typeof e&&(e=String(e)),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 t=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else{if(!s)throw new Error("With a null YAML version, the { schema: Schema } option is required");this.schema=new Nt(Object.assign(s,t))}}toJS({json:e,jsonArg:t,mapAsMap:s,maxAliasCount:n,onAnchor:i,reviver:o}={}){const r={anchors:new Map,doc:this,keep:!e,mapAsMap:!0===s,mapKeyWarned:!1,maxAliasCount:"number"==typeof n?n:100},a=j(this.contents,t??"",r);if("function"==typeof i)for(const{count:e,res:t}of r.anchors.values())i(t,e);return"function"==typeof o?M(o,{"":a},"",a):a}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 function(e,t){const s=[];let n=!0===t.directives;if(!1!==t.directives&&e.directives){const t=e.directives.toString(e);t?(s.push(t),n=!0):e.directives.docStart&&(n=!0)}n&&s.push("---");const i=le(e,t),{commentString:o}=i.options;if(e.commentBefore){1!==s.length&&s.unshift("");const t=o(e.commentBefore);s.unshift(G(t,""))}let r=!1,a=null;if(e.contents){if(k(e.contents)){if(e.contents.spaceBefore&&n&&s.push(""),e.contents.commentBefore){const t=o(e.contents.commentBefore);s.push(G(t,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}const t=a?void 0:()=>r=!0;let c=ue(e.contents,i,(()=>a=null),t);a&&(c+=Q(c,"",o(a))),"|"!==c[0]&&">"!==c[0]||"---"!==s[s.length-1]?s.push(c):s[s.length-1]=`--- ${c}`}else s.push(ue(e.contents,i));if(e.directives?.docEnd)if(e.comment){const t=o(e.comment);t.includes("\n")?(s.push("..."),s.push(G(t,""))):s.push(`... ${t}`)}else s.push("...");else{let t=e.comment;t&&r&&(t=t.replace(/^\n+/,"")),t&&(r&&!a||""===s[s.length-1]||s.push(""),s.push(G(o(t),"")))}return s.join("\n")+"\n"}(this,e)}}function At(e){if(b(e))return!0;throw new Error("Expected a YAML collection as document contents")}class Tt extends Error{constructor(e,t,s,n){super(),this.name=e,this.code=s,this.message=n,this.pos=t}}class It extends Tt{constructor(e,t,s){super("YAMLParseError",e,t,s)}}class Lt extends Tt{constructor(e,t,s){super("YAMLWarning",e,t,s)}}const xt=(e,t)=>s=>{if(-1===s.pos[0])return;s.linePos=s.pos.map((e=>t.linePos(e)));const{line:n,col:i}=s.linePos[0];s.message+=` at line ${n}, column ${i}`;let o=i-1,r=e.substring(t.lineStarts[n-1],t.lineStarts[n]).replace(/[\n\r]+$/,"");if(o>=60&&r.length>80){const e=Math.min(o-39,r.length-79);r="…"+r.substring(e),o-=e-1}if(r.length>80&&(r=r.substring(0,79)+"…"),n>1&&/^ *$/.test(r.substring(0,o))){let s=e.substring(t.lineStarts[n-2],t.lineStarts[n-1]);s.length>80&&(s=s.substring(0,79)+"…\n"),r=s+r}if(/[^ ]/.test(r)){let e=1;const t=s.linePos[1];t&&t.line===n&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-o)));const a=" ".repeat(o)+"^".repeat(e);s.message+=`:\n\n${r}\n${a}\n`}};function $t(e,{flow:t,indicator:s,next:n,offset:i,onError:o,parentIndent:r,startOnNewline:a}){let c=!1,l=a,u=a,f="",h="",d=!1,p=!1,m=null,y=null,g=null,b=null,k=null,w=null,v=null;for(const i of e)switch(p&&("space"!==i.type&&"newline"!==i.type&&"comma"!==i.type&&o(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p=!1),m&&(l&&"comment"!==i.type&&"newline"!==i.type&&o(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),i.type){case"space":t||"doc-start"===s&&"flow-collection"===n?.type||!i.source.includes("\t")||(m=i),u=!0;break;case"comment":{u||o(i,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const e=i.source.substring(1)||" ";f?f+=h+e:f=e,h="",l=!1;break}case"newline":l?f?f+=i.source:w&&"seq-item-ind"===s||(c=!0):h+=i.source,l=!0,d=!0,(y||g)&&(b=i),u=!0;break;case"anchor":y&&o(i,"MULTIPLE_ANCHORS","A node can have at most one anchor"),i.source.endsWith(":")&&o(i.offset+i.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),y=i,v??(v=i.offset),l=!1,u=!1,p=!0;break;case"tag":g&&o(i,"MULTIPLE_TAGS","A node can have at most one tag"),g=i,v??(v=i.offset),l=!1,u=!1,p=!0;break;case s:(y||g)&&o(i,"BAD_PROP_ORDER",`Anchors and tags must be after the ${i.source} indicator`),w&&o(i,"UNEXPECTED_TOKEN",`Unexpected ${i.source} in ${t??"collection"}`),w=i,l="seq-item-ind"===s||"explicit-key-ind"===s,u=!1;break;case"comma":if(t){k&&o(i,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),k=i,l=!1,u=!1;break}default:o(i,"UNEXPECTED_TOKEN",`Unexpected ${i.type} token`),l=!1,u=!1}const S=e[e.length-1],E=S?S.offset+S.source.length:i;return p&&n&&"space"!==n.type&&"newline"!==n.type&&"comma"!==n.type&&("scalar"!==n.type||""!==n.source)&&o(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(l&&m.indent<=r||"block-map"===n?.type||"block-seq"===n?.type)&&o(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:w,spaceBefore:c,comment:f,hasNewline:d,anchor:y,tag:g,newlineAfterProp:b,end:E,start:v??E}}function Ct(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes("\n"))return!0;if(e.end)for(const t of e.end)if("newline"===t.type)return!0;return!1;case"flow-collection":for(const t of e.items){for(const e of t.start)if("newline"===e.type)return!0;if(t.sep)for(const e of t.sep)if("newline"===e.type)return!0;if(Ct(t.key)||Ct(t.value))return!0}return!1;default:return!0}}function _t(e,t,s){if("flow-collection"===t?.type){const n=t.end[0];n.indent!==e||"]"!==n.source&&"}"!==n.source||!Ct(t)||s(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Kt(e,t,s){const{uniqueKeys:n}=e.options;if(!1===n)return!1;const i="function"==typeof n?n:(e,t)=>e===t||y(e)&&y(t)&&e.value===t.value;return t.some((e=>i(e.key,s)))}const Bt="All mapping items must start at the same column";function Mt(e,t,s,n){let i="";if(e){let o=!1,r="";for(const a of e){const{source:e,type:c}=a;switch(c){case"space":o=!0;break;case"comment":{s&&!o&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const t=e.substring(1)||" ";i?i+=r+t:i=t,r="";break}case"newline":i&&(r+=e),o=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}const jt="Block collections are not allowed within flow collections",Dt=e=>e&&("block-map"===e.type||"block-seq"===e.type);function qt(e,t,s,n,i,o){const r="block-map"===s.type?function({composeNode:e,composeEmptyNode:t},s,n,i,o){const r=new(o?.nodeClass??Ne)(s.schema);s.atRoot&&(s.atRoot=!1);let a=n.offset,c=null;for(const o of n.items){const{start:l,key:u,sep:f,value:h}=o,d=$t(l,{indicator:"explicit-key-ind",next:u??f?.[0],offset:a,onError:i,parentIndent:n.indent,startOnNewline:!0}),p=!d.found;if(p){if(u&&("block-seq"===u.type?i(a,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in u&&u.indent!==n.indent&&i(a,"BAD_INDENT",Bt)),!d.anchor&&!d.tag&&!f){c=d.end,d.comment&&(r.comment?r.comment+="\n"+d.comment:r.comment=d.comment);continue}(d.newlineAfterProp||Ct(u))&&i(u??l[l.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else d.found?.indent!==n.indent&&i(a,"BAD_INDENT",Bt);s.atKey=!0;const m=d.end,y=u?e(s,u,d,i):t(s,m,l,null,d,i);s.schema.compat&&_t(n.indent,u,i),s.atKey=!1,Kt(s,r.items,y)&&i(m,"DUPLICATE_KEY","Map keys must be unique");const g=$t(f??[],{indicator:"map-value-ind",next:h,offset:y.range[2],onError:i,parentIndent:n.indent,startOnNewline:!u||"block-scalar"===u.type});if(a=g.end,g.found){p&&("block-map"!==h?.type||g.hasNewline||i(a,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&d.start<g.found.offset-1024&&i(y.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const c=h?e(s,h,g,i):t(s,a,f,null,g,i);s.schema.compat&&_t(n.indent,h,i),a=c.range[2];const l=new be(y,c);s.options.keepSourceTokens&&(l.srcToken=o),r.items.push(l)}else{p&&i(y.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),g.comment&&(y.comment?y.comment+="\n"+g.comment:y.comment=g.comment);const e=new be(y);s.options.keepSourceTokens&&(e.srcToken=o),r.items.push(e)}}return c&&c<a&&i(c,"IMPOSSIBLE","Map comment with trailing content"),r.range=[n.offset,a,c??a],r}(e,t,s,n,o):"block-seq"===s.type?function({composeNode:e,composeEmptyNode:t},s,n,i,o){const r=new(o?.nodeClass??Ae)(s.schema);s.atRoot&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let a=n.offset,c=null;for(const{start:o,value:l}of n.items){const u=$t(o,{indicator:"seq-item-ind",next:l,offset:a,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!u.found){if(!(u.anchor||u.tag||l)){c=u.end,u.comment&&(r.comment=u.comment);continue}l&&"block-seq"===l.type?i(u.end,"BAD_INDENT","All sequence items must start at the same column"):i(a,"MISSING_CHAR","Sequence item without - indicator")}const f=l?e(s,l,u,i):t(s,u.end,o,null,u,i);s.schema.compat&&_t(n.indent,l,i),a=f.range[2],r.items.push(f)}return r.range=[n.offset,a,c??a],r}(e,t,s,n,o):function({composeNode:e,composeEmptyNode:t},s,n,i,o){const r="{"===n.start.source,a=r?"flow map":"flow sequence",c=new(o?.nodeClass??(r?Ne:Ae))(s.schema);c.flow=!0;const l=s.atRoot;l&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let u=n.offset+n.start.source.length;for(let o=0;o<n.items.length;++o){const l=n.items[o],{start:f,key:h,sep:d,value:p}=l,y=$t(f,{flow:a,indicator:"explicit-key-ind",next:h??d?.[0],offset:u,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!y.found){if(!(y.anchor||y.tag||d||p)){0===o&&y.comma?i(y.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):o<n.items.length-1&&i(y.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),y.comment&&(c.comment?c.comment+="\n"+y.comment:c.comment=y.comment),u=y.end;continue}!r&&s.options.strict&&Ct(h)&&i(h,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(0===o)y.comma&&i(y.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(y.comma||i(y.start,"MISSING_CHAR",`Missing , between ${a} items`),y.comment){let e="";e:for(const t of f)switch(t.type){case"comma":case"space":break;case"comment":e=t.source.substring(1);break e;default:break e}if(e){let t=c.items[c.items.length-1];m(t)&&(t=t.value??t.key),t.comment?t.comment+="\n"+e:t.comment=e,y.comment=y.comment.substring(e.length+1)}}if(r||d||y.found){s.atKey=!0;const o=y.end,m=h?e(s,h,y,i):t(s,o,f,null,y,i);Dt(h)&&i(m.range,"BLOCK_IN_FLOW",jt),s.atKey=!1;const g=$t(d??[],{flow:a,indicator:"map-value-ind",next:p,offset:m.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(g.found){if(!r&&!y.found&&s.options.strict){if(d)for(const e of d){if(e===g.found)break;if("newline"===e.type){i(e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}y.start<g.found.offset-1024&&i(g.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else p&&("source"in p&&p.source&&":"===p.source[0]?i(p,"MISSING_CHAR",`Missing space after : in ${a}`):i(g.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const b=p?e(s,p,g,i):g.found?t(s,g.end,d,null,g,i):null;b?Dt(p)&&i(b.range,"BLOCK_IN_FLOW",jt):g.comment&&(m.comment?m.comment+="\n"+g.comment:m.comment=g.comment);const k=new be(m,b);if(s.options.keepSourceTokens&&(k.srcToken=l),r){const e=c;Kt(s,e.items,m)&&i(o,"DUPLICATE_KEY","Map keys must be unique"),e.items.push(k)}else{const e=new Ne(s.schema);e.flow=!0,e.items.push(k);const t=(b??m).range;e.range=[m.range[0],t[1],t[2]],c.items.push(e)}u=b?b.range[2]:g.end}else{const n=p?e(s,p,y,i):t(s,y.end,d,null,y,i);c.items.push(n),u=n.range[2],Dt(p)&&i(n.range,"BLOCK_IN_FLOW",jt)}}const f=r?"}":"]",[h,...d]=n.end;let p=u;if(h&&h.source===f)p=h.offset+h.source.length;else{const e=a[0].toUpperCase()+a.substring(1);i(u,l?"MISSING_CHAR":"BAD_INDENT",l?`${e} must end with a ${f}`:`${e} in block collection must be sufficiently indented and end with a ${f}`),h&&1!==h.source.length&&d.unshift(h)}if(d.length>0){const e=Mt(d,p,s.options.strict,i);e.comment&&(c.comment?c.comment+="\n"+e.comment:c.comment=e.comment),c.range=[n.offset,p,e.offset]}else c.range=[n.offset,p,p];return c}(e,t,s,n,o),a=r.constructor;return"!"===i||i===a.tagName?(r.tag=a.tagName,r):(i&&(r.tag=i),r)}function Pt(e,t,s){const n=t.offset,i=function({offset:e,props:t},s,n){if("block-scalar-header"!==t[0].type)return n(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=t[0],o=i[0];let r=0,a="",c=-1;for(let t=1;t<i.length;++t){const s=i[t];if(a||"-"!==s&&"+"!==s){const n=Number(s);!r&&n?r=n:-1===c&&(c=e+t)}else a=s}-1!==c&&n(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,u="",f=i.length;for(let e=1;e<t.length;++e){const i=t[e];switch(i.type){case"space":l=!0;case"newline":f+=i.source.length;break;case"comment":s&&!l&&n(i,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=i.source.length,u=i.source.substring(1);break;case"error":n(i,"UNEXPECTED_TOKEN",i.message),f+=i.source.length;break;default:{n(i,"UNEXPECTED_TOKEN",`Unexpected token in block scalar header: ${i.type}`);const e=i.source;e&&"string"==typeof e&&(f+=e.length)}}}return{mode:o,indent:r,chomp:a,comment:u,length:f}}(t,e.options.strict,s);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};const o=">"===i.mode?R.BLOCK_FOLDED:R.BLOCK_LITERAL,r=t.source?function(e){const t=e.split(/\n( *)/),s=t[0],n=s.match(/^( *)/),i=[n?.[1]?[n[1],s.slice(n[1].length)]:["",s]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}(t.source):[];let a=r.length;for(let e=r.length-1;e>=0;--e){const t=r[e][1];if(""!==t&&"\r"!==t)break;a=e}if(0===a){const e="+"===i.chomp&&r.length>0?"\n".repeat(Math.max(1,r.length-1)):"";let s=n+i.length;return t.source&&(s+=t.source.length),{value:e,type:o,comment:i.comment,range:[n,s,s]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<a;++t){const[n,o]=r[t];if(""!==o&&"\r"!==o){if(n.length<c){const e="Block scalars with more-indented leading empty lines must use an explicit indentation indicator";s(l+n.length,"MISSING_CHAR",e)}0===i.indent&&(c=n.length),u=t,0!==c||e.atRoot||s(l,"BAD_INDENT","Block scalar values in collections must be indented");break}0===i.indent&&n.length>c&&(c=n.length),l+=n.length+o.length+1}for(let e=r.length-1;e>=a;--e)r[e][0].length>c&&(a=e+1);let f="",h="",d=!1;for(let e=0;e<u;++e)f+=r[e][0].slice(c)+"\n";for(let e=u;e<a;++e){let[t,n]=r[e];l+=t.length+n.length+1;const a="\r"===n[n.length-1];if(a&&(n=n.slice(0,-1)),n&&t.length<c){const e="Block scalar lines must not be less indented than their "+(i.indent?"explicit indentation indicator":"first line");s(l-n.length-(a?2:1),"BAD_INDENT",e),t=""}o===R.BLOCK_LITERAL?(f+=h+t.slice(c)+n,h="\n"):t.length>c||"\t"===n[0]?(" "===h?h="\n":d||"\n"!==h||(h="\n\n"),f+=h+t.slice(c)+n,h="\n",d=!0):""===n?"\n"===h?f+="\n":h="\n":(f+=h+n,h=" ",d=!1)}switch(i.chomp){case"-":break;case"+":for(let e=a;e<r.length;++e)f+="\n"+r[e][0].slice(c);"\n"!==f[f.length-1]&&(f+="\n");break;default:f+="\n"}const p=n+i.length+t.source.length;return{value:f,type:o,comment:i.comment,range:[n,p,p]}}function Ut(e,t,s){const{offset:n,type:i,source:o,end:r}=e;let a,c;const l=(e,t,i)=>s(n+e,t,i);switch(i){case"scalar":a=R.PLAIN,c=function(e,t){let s="";switch(e[0]){case"\t":s="a tab character";break;case",":s="flow indicator character ,";break;case"%":s="directive indicator character %";break;case"|":case">":s=`block scalar indicator ${e[0]}`;break;case"@":case"`":s=`reserved character ${e[0]}`}return s&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${s}`),Rt(e)}(o,l);break;case"single-quoted-scalar":a=R.QUOTE_SINGLE,c=function(e,t){return"'"===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR","Missing closing 'quote"),Rt(e.slice(1,-1)).replace(/''/g,"'")}(o,l);break;case"double-quoted-scalar":a=R.QUOTE_DOUBLE,c=function(e,t){let s="";for(let n=1;n<e.length-1;++n){const i=e[n];if("\r"!==i||"\n"!==e[n+1])if("\n"===i){const{fold:t,offset:i}=Ft(e,n);s+=t,n=i}else if("\\"===i){let i=e[++n];const o=Vt[i];if(o)s+=o;else if("\n"===i)for(i=e[n+1];" "===i||"\t"===i;)i=e[1+ ++n];else if("\r"===i&&"\n"===e[n+1])for(i=e[1+ ++n];" "===i||"\t"===i;)i=e[1+ ++n];else if("x"===i||"u"===i||"U"===i){const o={x:2,u:4,U:8}[i];s+=Yt(e,n+1,o,t),n+=o}else{const i=e.substr(n-1,2);t(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${i}`),s+=i}}else if(" "===i||"\t"===i){const t=n;let o=e[n+1];for(;" "===o||"\t"===o;)o=e[1+ ++n];"\n"===o||"\r"===o&&"\n"===e[n+2]||(s+=n>t?e.slice(t,n+1):i)}else s+=i}return'"'===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR",'Missing closing "quote'),s}(o,l);break;default:return s(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+o.length,n+o.length]}}const u=n+o.length,f=Mt(r,u,t,s);return{value:c,type:a,comment:f.comment,range:[n,u,f.offset]}}function Rt(e){let t,s;try{t=new RegExp("(.*?)(?<![ \t])[ \t]*\r?\n","sy"),s=new RegExp("[ \t]*(.*?)(?:(?<![ \t])[ \t]*)?\r?\n","sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,s=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=t.exec(e);if(!n)return e;let i=n[1],o=" ",r=t.lastIndex;for(s.lastIndex=r;n=s.exec(e);)""===n[1]?"\n"===o?i+=o:o="\n":(i+=o+n[1],o=" "),r=s.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=r,n=a.exec(e),i+o+(n?.[1]??"")}function Ft(e,t){let s="",n=e[t+1];for(;!(" "!==n&&"\t"!==n&&"\n"!==n&&"\r"!==n||"\r"===n&&"\n"!==e[t+2]);)"\n"===n&&(s+="\n"),n=e[(t+=1)+1];return s||(s=" "),{fold:s,offset:t}}const Vt={0:"\0",a:"",b:"\b",e:"",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function Yt(e,t,s,n){const i=e.substr(t,s),o=i.length===s&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){const i=e.substr(t-2,s+2);return n(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${i}`),i}return String.fromCodePoint(o)}function Jt(e,t,s,n){const{value:i,type:o,comment:r,range:a}="block-scalar"===t.type?Pt(e,t,n):Ut(t,e.options.strict,n),c=s?e.directives.tagName(s.source,(e=>n(s,"TAG_RESOLVE_FAILED",e))):null;let u,f;u=e.options.stringKeys&&e.atKey?e.schema[l]:c?function(e,t,s,n,i){if("!"===s)return e[l];const o=[];for(const t of e.tags)if(!t.collection&&t.tag===s){if(!t.default||!t.test)return t;o.push(t)}for(const e of o)if(e.test?.test(t))return e;const r=e.knownTags[s];return r&&!r.collection?(e.tags.push(Object.assign({},r,{default:!1,test:void 0})),r):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,"tag:yaml.org,2002:str"!==s),e[l])}(e.schema,i,c,s,n):"scalar"===t.type?function({atKey:e,directives:t,schema:s},n,i,o){const r=s.tags.find((t=>(!0===t.default||e&&"key"===t.default)&&t.test?.test(n)))||s[l];if(s.compat){const e=s.compat.find((e=>e.default&&e.test?.test(n)))??s[l];r.tag!==e.tag&&o(i,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${t.tagString(r.tag)} or ${t.tagString(e.tag)}`,!0)}return r}(e,i,t,n):e.schema[l];try{const o=u.resolve(i,(e=>n(s??t,"TAG_RESOLVE_FAILED",e)),e.options);f=y(o)?o:new R(o)}catch(e){const o=e instanceof Error?e.message:String(e);n(s??t,"TAG_RESOLVE_FAILED",o),f=new R(i)}return f.range=a,f.source=i,o&&(f.type=o),c&&(f.tag=c),u.format&&(f.format=u.format),r&&(f.comment=r),f}function Wt(e,t,s){if(t){s??(s=t.length);for(let n=s-1;n>=0;--n){let s=t[n];switch(s.type){case"space":case"comment":case"newline":e-=s.source.length;continue}for(s=t[++n];"space"===s?.type;)e+=s.source.length,s=t[++n];break}}return e}const Gt={composeNode:Qt,composeEmptyNode:Ht};function Qt(e,t,s,n){const i=e.atKey,{spaceBefore:o,comment:r,anchor:a,tag:c}=s;let l,u=!0;switch(t.type){case"alias":l=function({options:e},{offset:t,source:s,end:n},i){const o=new q(s.substring(1));""===o.source&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(t+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const r=t+s.length,a=Mt(n,r,e.strict,i);return o.range=[t,r,a.offset],a.comment&&(o.comment=a.comment),o}(e,t,n),(a||c)&&n(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=Jt(e,t,c,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=function(e,t,s,n,i){const o=n.tag,r=o?t.directives.tagName(o.source,(e=>i(o,"TAG_RESOLVE_FAILED",e))):null;if("block-seq"===s.type){const{anchor:e,newlineAfterProp:t}=n,s=e&&o?e.offset>o.offset?e:o:e??o;s&&(!t||t.offset<s.offset)&&i(s,"MISSING_CHAR","Missing newline after block sequence props")}const a="block-map"===s.type?"map":"block-seq"===s.type?"seq":"{"===s.start.source?"map":"seq";if(!o||!r||"!"===r||r===Ne.tagName&&"map"===a||r===Ae.tagName&&"seq"===a)return qt(e,t,s,i,r);let c=t.schema.tags.find((e=>e.tag===r&&e.collection===a));if(!c){const n=t.schema.knownTags[r];if(!n||n.collection!==a)return n?i(o,"BAD_COLLECTION_TYPE",`${n.tag} used for ${a} collection, but expects ${n.collection??"scalar"}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,!0),qt(e,t,s,i,r);t.schema.tags.push(Object.assign({},n,{default:!1})),c=n}const l=qt(e,t,s,i,r,c),u=c.resolve?.(l,(e=>i(o,"TAG_RESOLVE_FAILED",e)),t.options)??l,f=k(u)?u:new R(u);return f.range=l.range,f.tag=r,c?.format&&(f.format=c.format),f}(Gt,e,t,s,n),a&&(l.anchor=a.source.substring(1));break;default:n(t,"UNEXPECTED_TOKEN","error"===t.type?t.message:`Unsupported token (type: ${t.type})`),l=Ht(e,t.offset,void 0,null,s,n),u=!1}return a&&""===l.anchor&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!y(l)||"string"!=typeof l.value||l.tag&&"tag:yaml.org,2002:str"!==l.tag)&&n(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),r&&("scalar"===t.type&&""===t.source?l.comment=r:l.commentBefore=r),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function Ht(e,t,s,n,{spaceBefore:i,comment:o,anchor:r,tag:a,end:c},l){const u=Jt(e,{type:"scalar",offset:Wt(t,s,n),indent:-1,source:""},a,l);return r&&(u.anchor=r.source.substring(1),""===u.anchor&&l(r,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(u.spaceBefore=!0),o&&(u.comment=o,u.range[2]=c),u}function Xt(e){if("number"==typeof e)return[e,e+1];if(Array.isArray(e))return 2===e.length?e:[e[0],e[1]];const{offset:t,source:s}=e;return[t,t+("string"==typeof s?s.length:1)]}function zt(e){let t="",s=!1,n=!1;for(let i=0;i<e.length;++i){const o=e[i];switch(o[0]){case"#":t+=(""===t?"":n?"\n\n":"\n")+(o.substring(1)||" "),s=!0,n=!1;break;case"%":"#"!==e[i+1]?.[0]&&(i+=1),s=!1;break;default:s||(n=!0),s=!1}}return{comment:t,afterEmptyLine:n}}class Zt{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,s,n)=>{const i=Xt(e);n?this.warnings.push(new Lt(i,t,s)):this.errors.push(new It(i,t,s))},this.directives=new C({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:s,afterEmptyLine:n}=zt(this.prelude);if(s){const i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${s}`:s;else if(n||e.directives.docStart||!i)e.commentBefore=s;else if(b(i)&&!i.flow&&i.items.length>0){let e=i.items[0];m(e)&&(e=e.key);const t=e.commentBefore;e.commentBefore=t?`${s}\n${t}`:s}else{const e=i.commentBefore;i.commentBefore=e?`${s}\n${e}`: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:zt(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,s=-1){for(const t of e)yield*this.next(t);yield*this.end(t,s)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,((t,s,n)=>{const i=Xt(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",s,n)})),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=function(e,t,{offset:s,start:n,value:i,end:o},r){const a=Object.assign({_directives:t},e),c=new Ot(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=$t(n,{indicator:"doc-start",next:i??o?.[0],offset:s,onError:r,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,!i||"block-map"!==i.type&&"block-seq"!==i.type||u.hasNewline||r(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?Qt(l,i,u,r):Ht(l,u.end,n,null,u,r);const f=c.contents.range[2],h=Mt(o,f,!1,r);return h.comment&&(c.comment=h.comment),c.range=[s,f,h.offset],c}(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 It(Xt(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 t="Unexpected doc-end without preceding document";this.errors.push(new It(Xt(e),"UNEXPECTED_TOKEN",t));break}this.doc.directives.docEnd=!0;const t=Mt(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new It(Xt(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 e=Object.assign({_directives:this.directives},this.options),s=new Ot(void 0,e);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,t,t],this.decorate(s,!1),yield s}}}function es(e,t=!0,s){if(e){const n=(e,t,n)=>{const i="number"==typeof e?e:Array.isArray(e)?e[0]:e.offset;if(!s)throw new It([i,i+1],t,n);s(i,t,n)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Ut(e,t,n);case"block-scalar":return Pt({options:{strict:t}},e,n)}}return null}function ts(e,t){const{implicitKey:s=!1,indent:n,inFlow:i=!1,offset:o=-1,type:r="PLAIN"}=t,a=ce({type:r,value:e},{implicitKey:s,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:"newline",offset:-1,indent:n,source:"\n"}];switch(a[0]){case"|":case">":{const e=a.indexOf("\n"),t=a.substring(0,e),s=a.substring(e+1)+"\n",i=[{type:"block-scalar-header",offset:o,indent:n,source:t}];return ns(i,c)||i.push({type:"newline",offset:-1,indent:n,source:"\n"}),{type:"block-scalar",offset:o,indent:n,props:i,source:s}}case'"':return{type:"double-quoted-scalar",offset:o,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:n,source:a,end:c};default:return{type:"scalar",offset:o,indent:n,source:a,end:c}}}function ss(e,t,s={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:o=!1,type:r}=s,a="indent"in e?e.indent:null;if(n&&"number"==typeof a&&(a+=2),!r)switch(e.type){case"single-quoted-scalar":r="QUOTE_SINGLE";break;case"double-quoted-scalar":r="QUOTE_DOUBLE";break;case"block-scalar":{const t=e.props[0];if("block-scalar-header"!==t.type)throw new Error("Invalid block scalar header");r=">"===t.source[0]?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:r="PLAIN"}const c=ce({type:r,value:t},{implicitKey:i||null===a,indent:null!==a&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":!function(e,t){const s=t.indexOf("\n"),n=t.substring(0,s),i=t.substring(s+1)+"\n";if("block-scalar"===e.type){const t=e.props[0];if("block-scalar-header"!==t.type)throw new Error("Invalid block scalar header");t.source=n,e.source=i}else{const{offset:t}=e,s="indent"in e?e.indent:-1,o=[{type:"block-scalar-header",offset:t,indent:s,source:n}];ns(o,"end"in e?e.end:void 0)||o.push({type:"newline",offset:-1,indent:s,source:"\n"});for(const t of Object.keys(e))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:"block-scalar",indent:s,props:o,source:i})}}(e,c);break;case'"':is(e,c,"double-quoted-scalar");break;case"'":is(e,c,"single-quoted-scalar");break;default:is(e,c,"scalar")}}function ns(e,t){if(t)for(const s of t)switch(s.type){case"space":case"comment":e.push(s);break;case"newline":return e.push(s),!0}return!1}function is(e,t,s){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=s,e.source=t;break;case"block-scalar":{const n=e.props.slice(1);let i=t.length;"block-scalar-header"===e.props[0].type&&(i-=e.props[0].source.length);for(const e of n)e.offset+=i;delete e.props,Object.assign(e,{type:s,source:t,end:n});break}case"block-map":case"block-seq":{const n={type:"newline",offset:e.offset+t.length,indent:e.indent,source:"\n"};delete e.items,Object.assign(e,{type:s,source:t,end:[n]});break}default:{const n="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter((e=>"space"===e.type||"comment"===e.type||"newline"===e.type)):[];for(const t of Object.keys(e))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:s,indent:n,source:t,end:i})}}}const os=e=>"type"in e?rs(e):as(e);function rs(e){switch(e.type){case"block-scalar":{let t="";for(const s of e.props)t+=rs(s);return t+e.source}case"block-map":case"block-seq":{let t="";for(const s of e.items)t+=as(s);return t}case"flow-collection":{let t=e.start.source;for(const s of e.items)t+=as(s);for(const s of e.end)t+=s.source;return t}case"document":{let t=as(e);if(e.end)for(const s of e.end)t+=s.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const s of e.end)t+=s.source;return t}}}function as({start:e,key:t,sep:s,value:n}){let i="";for(const t of e)i+=t.source;if(t&&(i+=rs(t)),s)for(const e of s)i+=e.source;return n&&(i+=rs(n)),i}const cs=Symbol("break visit"),ls=Symbol("skip children"),us=Symbol("remove item");function fs(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),hs(Object.freeze([]),e,t)}function hs(e,t,s){let n=s(t,e);if("symbol"==typeof n)return n;for(const i of["key","value"]){const o=t[i];if(o&&"items"in o){for(let t=0;t<o.items.length;++t){const n=hs(Object.freeze(e.concat([[i,t]])),o.items[t],s);if("number"==typeof n)t=n-1;else{if(n===cs)return cs;n===us&&(o.items.splice(t,1),t-=1)}}"function"==typeof n&&"key"===i&&(n=n(t,e))}}return"function"==typeof n?n(t,e):n}fs.BREAK=cs,fs.SKIP=ls,fs.REMOVE=us,fs.itemAtPath=(e,t)=>{let s=e;for(const[e,n]of t){const t=s?.[e];if(!t||!("items"in t))return;s=t.items[n]}return s},fs.parentCollection=(e,t)=>{const s=fs.itemAtPath(e,t.slice(0,-1)),n=t[t.length-1][0],i=s?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};const ds="\ufeff",ps="",ms="",ys="",gs=e=>!!e&&"items"in e,bs=e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type);function ks(e){switch(e){case ds:return"<BOM>";case ps:return"<DOC>";case ms:return"<FLOW_END>";case ys:return"<SCALAR>";default:return JSON.stringify(e)}}function ws(e){switch(e){case ds:return"byte-order-mark";case ps:return"doc-mode";case ms:return"flow-error-end";case ys:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":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(e[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":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 vs(e){switch(e){case void 0:case" ":case"\n":case"\r":case"\t":return!0;default:return!1}}const Ss=new Set("0123456789ABCDEFabcdef"),Es=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Ns=new Set(",[]{}"),Os=new Set(" ,[]{}\n\r\t"),As=e=>!e||Os.has(e);class Ts{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("string"!=typeof e)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;)t=this.buffer[++e];return!t||"#"===t||"\n"===t||"\r"===t&&"\n"===this.buffer[e+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("\r"===t){const t=this.buffer[s+e+1];if("\n"===t||!t&&!this.atEnd)return e+s+1}return"\n"===t||s>=this.indentNext||!t&&!this.atEnd?e+s:-1}if("-"===t||"."===t){const t=this.buffer.substr(e,3);if(("---"===t||"..."===t)&&vs(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return("number"!=typeof e||-1!==e&&e<this.pos)&&(e=this.buffer.indexOf("\n",this.pos),this.lineEndPos=e),-1===e?this.atEnd?this.buffer.substring(this.pos):null:("\r"===this.buffer[e-1]&&(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(null===e)return this.setNext("stream");if(e[0]===ds&&(yield*this.pushCount(1),e=e.substring(1)),"%"===e[0]){let t=e.length,s=e.indexOf("#");for(;-1!==s;){const n=e[s-1];if(" "===n||"\t"===n){t=s-1;break}s=e.indexOf("#",s+1)}for(;;){const s=e[t-1];if(" "!==s&&"\t"!==s)break;t-=1}const n=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-n),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 ps,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 e=this.peek(3);if(("---"===e||"..."===e)&&vs(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,"---"===e?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!vs(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)&&vs(t)){const e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(null===e)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";case"*":return yield*this.pushUntil(As),"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 n=this.getLine();if(null===n)return this.setNext("flow");if((-1!==s&&s<this.indentNext&&"#"!==n[0]||0===s&&(n.startsWith("---")||n.startsWith("..."))&&vs(n[3]))&&(s!==this.indentNext-1||1!==this.flowLevel||"]"!==n[0]&&"}"!==n[0]))return this.flowLevel=0,yield ms,yield*this.parseLineStart();let i=0;for(;","===n[i];)i+=(yield*this.pushCount(1)),i+=(yield*this.pushSpaces(!0)),this.flowKey=!1;switch(i+=(yield*this.pushIndicators()),n[i]){case void 0:return"flow";case"#":return yield*this.pushCount(n.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(As),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const e=this.charAt(1);if(this.flowKey||vs(e)||","===e)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(;-1!==t&&"'"===this.buffer[t+1];)t=this.buffer.indexOf("'",t+2);else for(;-1!==t;){let e=0;for(;"\\"===this.buffer[t-1-e];)e+=1;if(e%2==0)break;t=this.buffer.indexOf('"',t+1)}const s=this.buffer.substring(0,t);let n=s.indexOf("\n",this.pos);if(-1!==n){for(;-1!==n;){const e=this.continueScalar(n+1);if(-1===e)break;n=s.indexOf("\n",e)}-1!==n&&(t=n-("\r"===s[n-1]?2:1))}if(-1===t){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((e=>vs(e)||"#"===e))}*parseBlockScalar(){let e,t=this.pos-1,s=0;e:for(let n=this.pos;e=this.buffer[n];++n)switch(e){case" ":s+=1;break;case"\n":t=n,s=0;break;case"\r":{const e=this.buffer[n+1];if(!e&&!this.atEnd)return this.setNext("block-scalar");if("\n"===e)break}default:break e}if(!e&&!this.atEnd)return this.setNext("block-scalar");if(s>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=s:this.indentNext=this.blockScalarIndent+(0===this.indentNext?1:this.indentNext);do{const e=this.continueScalar(t+1);if(-1===e)break;t=this.buffer.indexOf("\n",e)}while(-1!==t);if(-1===t){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let n=t+1;for(e=this.buffer[n];" "===e;)e=this.buffer[++n];if("\t"===e){for(;"\t"===e||" "===e||"\r"===e||"\n"===e;)e=this.buffer[++n];t=n-1}else if(!this.blockScalarKeep)for(;;){let e=t-1,n=this.buffer[e];"\r"===n&&(n=this.buffer[--e]);const i=e;for(;" "===n;)n=this.buffer[--e];if(!("\n"===n&&e>=this.pos&&e+1+s>i))break;t=e}return yield ys,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t,s=this.pos-1,n=this.pos-1;for(;t=this.buffer[++n];)if(":"===t){const t=this.buffer[n+1];if(vs(t)||e&&Ns.has(t))break;s=n}else if(vs(t)){let i=this.buffer[n+1];if("\r"===t&&("\n"===i?(n+=1,t="\n",i=this.buffer[n+1]):s=n),"#"===i||e&&Ns.has(i))break;if("\n"===t){const e=this.continueScalar(n+1);if(-1===e)break;n=Math.max(n,e-2)}}else{if(e&&Ns.has(t))break;s=n}return t||this.atEnd?(yield ys,yield*this.pushToIndex(s+1,!0),e?"flow":"doc"):this.setNext("plain-scalar")}*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(As))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,t=this.charAt(1);if(vs(t)||e&&Ns.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(;!vs(t)&&">"!==t;)t=this.buffer[++e];return yield*this.pushToIndex(">"===t?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Es.has(t))t=this.buffer[++e];else{if("%"!==t||!Ss.has(this.buffer[e+1])||!Ss.has(this.buffer[e+2]))break;t=this.buffer[e+=3]}return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return"\n"===e?yield*this.pushCount(1):"\r"===e&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(e){let t,s=this.pos-1;do{t=this.buffer[++s]}while(" "===t||e&&"\t"===t);const n=s-this.pos;return n>0&&(yield this.buffer.substr(this.pos,n),this.pos=s),n}*pushUntil(e){let t=this.pos,s=this.buffer[t];for(;!e(s);)s=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}class Is{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,s=this.lineStarts.length;for(;t<s;){const n=t+s>>1;this.lineStarts[n]<e?t=n+1:s=n}return this.lineStarts[t]===e?{line:t+1,col:1}:0===t?{line:0,col:e}:{line:t,col:e-this.lineStarts[t-1]+1}}}}function Ls(e,t){for(let s=0;s<e.length;++s)if(e[s].type===t)return!0;return!1}function xs(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function $s(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Cs(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function _s(e){if(0===e.length)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;"space"===e[++t]?.type;);return e.splice(t,e.length)}function Ks(e){if("flow-seq-start"===e.start.type)for(const t of e.items)!t.sep||t.value||Ls(t.start,"explicit-key-ind")||Ls(t.sep,"map-value-ind")||(t.key&&(t.value=t.key),delete t.key,$s(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}class Bs{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 Ts,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&0===this.offset&&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)return this.atScalar=!1,yield*this.step(),void(this.offset+=e.length);const t=ws(e);if(t)if("scalar"===t)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 t=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:t,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("doc-end"!==this.type||e&&"doc-end"===e.type){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()}else{for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source})}}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(t)if(0===this.stack.length)yield t;else{const e=this.peek(1);switch("block-scalar"===t.type?t.indent="indent"in e?e.indent:0:"flow-collection"===t.type&&"document"===e.type&&(t.indent=0),"flow-collection"===t.type&&Ks(t),e.type){case"document":e.value=t;break;case"block-scalar":e.props.push(t);break;case"block-map":{const s=e.items[e.items.length-1];if(s.value)return e.items.push({start:[],key:t,sep:[]}),void(this.onKeyLine=!0);if(!s.sep)return Object.assign(s,{key:t,sep:[]}),void(this.onKeyLine=!s.explicitKey);s.value=t;break}case"block-seq":{const s=e.items[e.items.length-1];s.value?e.items.push({start:[],value:t}):s.value=t;break}case"flow-collection":{const s=e.items[e.items.length-1];return void(!s||s.value?e.items.push({start:[],key:t,sep:[]}):s.sep?s.value=t:Object.assign(s,{key:t,sep:[]}))}default:yield*this.pop(),yield*this.pop(t)}if(!("document"!==e.type&&"block-map"!==e.type&&"block-seq"!==e.type||"block-map"!==t.type&&"block-seq"!==t.type)){const s=t.items[t.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&-1===xs(s.start)&&(0===t.indent||s.start.every((e=>"comment"!==e.type||e.indent<t.indent)))&&("document"===e.type?e.end=s.start:e.items.push({start:s.start}),t.items.splice(-1,1))}}else{const e="Tried to pop an empty stack";yield{type:"error",offset:this.offset,source:"",message:e}}}*stream(){switch(this.type){case"directive-line":return void(yield{type:"directive",offset:this.offset,source:this.source});case"byte-order-mark":case"space":case"comment":case"newline":return void(yield this.sourceToken);case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};return"doc-start"===this.type&&e.start.push(this.sourceToken),void this.stack.push(e)}}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":return void(-1!==xs(e.start)?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken));case"anchor":case"tag":case"space":case"comment":case"newline":return void e.start.push(this.sourceToken)}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("map-value-ind"===this.type){const t=_s(Cs(this.peek(2)));let s;e.end?(s=e.end,s.push(this.sourceToken),delete e.end):s=[this.sourceToken];const n={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=n}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":return void e.props.push(this.sourceToken);case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+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,n=Array.isArray(s)?s[s.length-1]:void 0;"comment"===n?.type?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],n=s?.value?.end;if(Array.isArray(n))return Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),void e.items.pop()}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const s=!this.onKeyLine&&this.indent===e.indent,n=s&&(t.sep||t.explicitKey)&&"seq-item-ind"!==this.type;let i=[];if(n&&t.sep&&!t.value){const s=[];for(let n=0;n<t.sep.length;++n){const i=t.sep[n];switch(i.type){case"newline":s.push(n);break;case"space":break;case"comment":i.indent>e.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(i=t.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":return void(n||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));case"explicit-key-ind":return t.sep||t.explicitKey?n||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}]}):(t.start.push(this.sourceToken),t.explicitKey=!0),void(this.onKeyLine=!0);case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ls(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($s(t.key)&&!Ls(t.sep,"newline")){const e=_s(t.start),s=t.key,n=t.sep;n.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:s,sep:n}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else if(Ls(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const e=_s(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||n?e.items.push({start:i,key:null,sep:[this.sourceToken]}):Ls(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]});return void(this.onKeyLine=!0);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);return void(n||t.value?(e.items.push({start:i,key:s,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(s):(Object.assign(t,{key:s,sep:[]}),this.onKeyLine=!0))}default:{const n=this.startBlockValue(e);if(n){if("block-seq"===n.type){if(!t.explicitKey&&t.sep&&!Ls(t.sep,"newline"))return void(yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source}))}else s&&e.items.push({start:i});return void this.stack.push(n)}}}}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,n=Array.isArray(s)?s[s.length-1]:void 0;"comment"===n?.type?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],n=s?.value?.end;if(Array.isArray(n))return Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),void e.items.pop()}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;return void t.start.push(this.sourceToken);case"seq-item-ind":if(this.indent!==e.indent)break;return void(t.value||Ls(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken))}if(this.indent>e.indent){const t=this.startBlockValue(e);if(t)return void this.stack.push(t)}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if("flow-error-end"===this.type){let e;do{yield*this.pop(),e=this.peek(1)}while(e&&"flow-collection"===e.type)}else if(0===e.end.length){switch(this.type){case"comma":case"explicit-key-ind":return void(!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken));case"map-value-ind":return void(!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]}));case"space":case"comment":case"newline":case"anchor":case"tag":return void(!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken));case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);return void(!t||t.value?e.items.push({start:[],key:s,sep:[]}):t.sep?this.stack.push(s):Object.assign(t,{key:s,sep:[]}))}case"flow-map-end":case"flow-seq-end":return void e.end.push(this.sourceToken)}const s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{const t=this.peek(2);if("block-map"===t.type&&("map-value-ind"===this.type&&t.indent===e.indent||"newline"===this.type&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if("map-value-ind"===this.type&&"flow-collection"!==t.type){const s=_s(Cs(t));Ks(e);const n=e.end.splice(1,e.end.length);n.push(this.sourceToken);const i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+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.type);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=_s(Cs(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=_s(Cs(e));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return"comment"===this.type&&!(this.indent<=t)&&e.every((e=>"newline"===e.type||"space"===e.type))}*documentEnd(e){"doc-mode"!==this.type&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(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;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}}function Ms(e){const t=!1!==e.prettyErrors;return{lineCounter:e.lineCounter||t&&new Is||null,prettyErrors:t}}function js(e,t={}){const{lineCounter:s,prettyErrors:n}=Ms(t),i=new Bs(s?.addNewLine),o=new Zt(t),r=Array.from(o.compose(i.parse(e)));if(n&&s)for(const t of r)t.errors.forEach(xt(e,s)),t.warnings.forEach(xt(e,s));return r.length>0?r:Object.assign([],{empty:!0},o.streamInfo())}function Ds(e,t={}){const{lineCounter:s,prettyErrors:n}=Ms(t),i=new Bs(s?.addNewLine),o=new Zt(t);let r=null;for(const t of o.compose(i.parse(e),!0,e.length))if(r){if("silent"!==r.options.logLevel){r.errors.push(new It(t.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else r=t;return n&&s&&(r.errors.forEach(xt(e,s)),r.warnings.forEach(xt(e,s))),r}function qs(e,t,s){let n;"function"==typeof t?n=t:void 0===s&&t&&"object"==typeof t&&(s=t);const i=Ds(e,s);if(!i)return null;if(i.warnings.forEach((e=>fe(i.options.logLevel,e))),i.errors.length>0){if("silent"!==i.options.logLevel)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},s))}function Ps(e,t,s){let n=null;if("function"==typeof t||Array.isArray(t)?n=t:void 0===s&&t&&(s=t),"string"==typeof s&&(s=s.length),"number"==typeof s){const e=Math.round(s);s=e<1?void 0:e>8?{indent:8}:{indent:e}}if(void 0===e){const{keepUndefined:e}=s??t??{};if(!e)return}return d(e)&&!n?e.toString(s):new Ot(e,n,s).toString(s)}const Us=i}}]);
|
|
2
|
+
//# sourceMappingURL=2939.08859fb0.js.map
|