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