textlint-plugin-typst 1.2.0 → 1.3.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/README.md +3 -3
- package/lib/index.js +109 -102
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ bun add textlint-plugin-typst
|
|
|
40
40
|
|
|
41
41
|
## Syntax support
|
|
42
42
|
|
|
43
|
-
This plugin supports the syntax of Typst [v0.13.
|
|
43
|
+
This plugin supports the syntax of Typst [v0.13.1](https://github.com/typst/typst/releases/tag/v0.13.1).
|
|
44
44
|
|
|
45
45
|
Legend for syntax support:
|
|
46
46
|
|
|
@@ -59,8 +59,8 @@ Legend for syntax support:
|
|
|
59
59
|
| Label | | 🚫 | 🚫 |
|
|
60
60
|
| Reference | | 🚫 | 🚫 |
|
|
61
61
|
| Heading | Header | ✅ | 🚫 |
|
|
62
|
-
| Bullet list | List / ListItem |
|
|
63
|
-
| Numbered list | List / ListItem |
|
|
62
|
+
| Bullet list | List / ListItem | ✅ | 🚫 |
|
|
63
|
+
| Numbered list | List / ListItem | ✅ | 🚫 |
|
|
64
64
|
| Term list | | 🚫 | 🚫 |
|
|
65
65
|
| Math | | 🚫 | 🚫 |
|
|
66
66
|
| Line break | Break | ✅ | 🚫 |
|
package/lib/index.js
CHANGED
|
@@ -1,149 +1,156 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
`)}};ve.defaultYaml={explicit:!1,version:"1.2"};ve.defaultTags={"!!":"tag:yaml.org,2002:"};
|
|
3
|
-
`)?
|
|
1
|
+
"use strict";var Ua=Object.create;var We=Object.defineProperty;var Ya=Object.getOwnPropertyDescriptor;var Va=Object.getOwnPropertyNames;var Ja=Object.getPrototypeOf,Ha=Object.prototype.hasOwnProperty;var b=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),Qa=(s,e)=>{for(var t in e)We(s,t,{get:e[t],enumerable:!0})},Rn=(s,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Va(e))!Ha.call(s,i)&&i!==t&&We(s,i,{get:()=>e[i],enumerable:!(n=Ya(e,i))||n.enumerable});return s};var Ge=(s,e,t)=>(t=s!=null?Ua(Ja(s)):{},Rn(e||!s||!s.__esModule?We(t,"default",{value:s,enumerable:!0}):t,s)),Wa=s=>Rn(We({},"__esModule",{value:!0}),s);var Zn=b(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.ASTNodeTypes=void 0;var zn;(function(s){s.Document="Document",s.DocumentExit="Document:exit",s.Paragraph="Paragraph",s.ParagraphExit="Paragraph:exit",s.BlockQuote="BlockQuote",s.BlockQuoteExit="BlockQuote:exit",s.ListItem="ListItem",s.ListItemExit="ListItem:exit",s.List="List",s.ListExit="List:exit",s.Header="Header",s.HeaderExit="Header:exit",s.CodeBlock="CodeBlock",s.CodeBlockExit="CodeBlock:exit",s.HtmlBlock="HtmlBlock",s.HtmlBlockExit="HtmlBlock:exit",s.HorizontalRule="HorizontalRule",s.HorizontalRuleExit="HorizontalRule:exit",s.Comment="Comment",s.CommentExit="Comment:exit",s.ReferenceDef="ReferenceDef",s.ReferenceDefExit="ReferenceDef:exit",s.Str="Str",s.StrExit="Str:exit",s.Break="Break",s.BreakExit="Break:exit",s.Emphasis="Emphasis",s.EmphasisExit="Emphasis:exit",s.Strong="Strong",s.StrongExit="Strong:exit",s.Html="Html",s.HtmlExit="Html:exit",s.Link="Link",s.LinkExit="Link:exit",s.Image="Image",s.ImageExit="Image:exit",s.Code="Code",s.CodeExit="Code:exit",s.Delete="Delete",s.DeleteExit="Delete:exit",s.Table="Table",s.TableExit="Table:exit",s.TableRow="TableRow",s.TableRowExit="TableRow:exit",s.TableCell="TableCell",s.TableCellExit="TableCell:exit"})(zn||(et.ASTNodeTypes=zn={}))});var ei=b(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.ASTNodeTypes=void 0;var ho=Zn();Object.defineProperty(tt,"ASTNodeTypes",{enumerable:!0,get:function(){return ho.ASTNodeTypes}})});var C=b(_=>{"use strict";var as=Symbol.for("yaml.alias"),ti=Symbol.for("yaml.document"),st=Symbol.for("yaml.map"),si=Symbol.for("yaml.pair"),os=Symbol.for("yaml.scalar"),nt=Symbol.for("yaml.seq"),K=Symbol.for("yaml.node.type"),po=s=>!!s&&typeof s=="object"&&s[K]===as,mo=s=>!!s&&typeof s=="object"&&s[K]===ti,go=s=>!!s&&typeof s=="object"&&s[K]===st,yo=s=>!!s&&typeof s=="object"&&s[K]===si,ni=s=>!!s&&typeof s=="object"&&s[K]===os,bo=s=>!!s&&typeof s=="object"&&s[K]===nt;function ii(s){if(s&&typeof s=="object")switch(s[K]){case st:case nt:return!0}return!1}function wo(s){if(s&&typeof s=="object")switch(s[K]){case as:case st:case os:case nt:return!0}return!1}var So=s=>(ni(s)||ii(s))&&!!s.anchor;_.ALIAS=as;_.DOC=ti;_.MAP=st;_.NODE_TYPE=K;_.PAIR=si;_.SCALAR=os;_.SEQ=nt;_.hasAnchor=So;_.isAlias=po;_.isCollection=ii;_.isDocument=mo;_.isMap=go;_.isNode=wo;_.isPair=yo;_.isScalar=ni;_.isSeq=bo});var Se=b(ls=>{"use strict";var P=C(),B=Symbol("break visit"),ri=Symbol("skip children"),j=Symbol("remove node");function it(s,e){let t=ai(e);P.isDocument(s)?le(null,s.contents,t,Object.freeze([s]))===j&&(s.contents=null):le(null,s,t,Object.freeze([]))}it.BREAK=B;it.SKIP=ri;it.REMOVE=j;function le(s,e,t,n){let i=oi(s,e,t,n);if(P.isNode(i)||P.isPair(i))return li(s,n,i),le(s,i,t,n);if(typeof i!="symbol"){if(P.isCollection(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let a=le(r,e.items[r],t,n);if(typeof a=="number")r=a-1;else{if(a===B)return B;a===j&&(e.items.splice(r,1),r-=1)}}}else if(P.isPair(e)){n=Object.freeze(n.concat(e));let r=le("key",e.key,t,n);if(r===B)return B;r===j&&(e.key=null);let a=le("value",e.value,t,n);if(a===B)return B;a===j&&(e.value=null)}}return i}async function rt(s,e){let t=ai(e);P.isDocument(s)?await ce(null,s.contents,t,Object.freeze([s]))===j&&(s.contents=null):await ce(null,s,t,Object.freeze([]))}rt.BREAK=B;rt.SKIP=ri;rt.REMOVE=j;async function ce(s,e,t,n){let i=await oi(s,e,t,n);if(P.isNode(i)||P.isPair(i))return li(s,n,i),ce(s,i,t,n);if(typeof i!="symbol"){if(P.isCollection(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let a=await ce(r,e.items[r],t,n);if(typeof a=="number")r=a-1;else{if(a===B)return B;a===j&&(e.items.splice(r,1),r-=1)}}}else if(P.isPair(e)){n=Object.freeze(n.concat(e));let r=await ce("key",e.key,t,n);if(r===B)return B;r===j&&(e.key=null);let a=await ce("value",e.value,t,n);if(a===B)return B;a===j&&(e.value=null)}}return i}function ai(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}function oi(s,e,t,n){if(typeof t=="function")return t(s,e,n);if(P.isMap(e))return t.Map?.(s,e,n);if(P.isSeq(e))return t.Seq?.(s,e,n);if(P.isPair(e))return t.Pair?.(s,e,n);if(P.isScalar(e))return t.Scalar?.(s,e,n);if(P.isAlias(e))return t.Alias?.(s,e,n)}function li(s,e,t){let n=e[e.length-1];if(P.isCollection(n))n.items[s]=t;else if(P.isPair(n))s==="key"?n.key=t:n.value=t;else if(P.isDocument(n))n.contents=t;else{let i=P.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}ls.visit=it;ls.visitAsync=rt});var cs=b(fi=>{"use strict";var ci=C(),vo=Se(),ko={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},No=s=>s.replace(/[!,[\]{}]/g,e=>ko[e]),ve=class s{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,t)}clone(){let e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new s(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[r,a]=n;return this.tags[r]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=n;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let a=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,a),!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]==="<"){let a=e.slice(2,-1);return a==="!"||a==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),a)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);let r=this.tags[n];if(r)try{return r+decodeURIComponent(i)}catch(a){return t(String(a)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+No(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&ci.isNode(e.contents)){let r={};vo.visit(e.contents,(a,o)=>{ci.isNode(o)&&o.tag&&(r[o.tag]=!0)}),i=Object.keys(r)}else i=[];for(let[r,a]of n)r==="!!"&&a==="tag:yaml.org,2002:"||(!e||i.some(o=>o.startsWith(a)))&&t.push(`%TAG ${r} ${a}`);return t.join(`
|
|
2
|
+
`)}};ve.defaultYaml={explicit:!1,version:"1.2"};ve.defaultTags={"!!":"tag:yaml.org,2002:"};fi.Directives=ve});var at=b(ke=>{"use strict";var ui=C(),Lo=Se();function Ao(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}function hi(s){let e=new Set;return Lo.visit(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function di(s,e){for(let t=1;;++t){let n=`${s}${t}`;if(!e.has(n))return n}}function Eo(s,e){let t=[],n=new Map,i=null;return{onAnchor:r=>{t.push(r),i||(i=hi(s));let a=di(e,i);return i.add(a),a},setAnchors:()=>{for(let r of t){let a=n.get(r);if(typeof a=="object"&&a.anchor&&(ui.isScalar(a.node)||ui.isCollection(a.node)))a.node.anchor=a.anchor;else{let o=new Error("Failed to resolve repeated object (this should not happen)");throw o.source=r,o}}},sourceObjects:n}}ke.anchorIsValid=Ao;ke.anchorNames=hi;ke.createNodeAnchors=Eo;ke.findNewAnchor=di});var fs=b(pi=>{"use strict";function Ne(s,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,r=n.length;i<r;++i){let a=n[i],o=Ne(s,n,String(i),a);o===void 0?delete n[i]:o!==a&&(n[i]=o)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let r=n.get(i),a=Ne(s,n,i,r);a===void 0?n.delete(i):a!==r&&n.set(i,a)}else if(n instanceof Set)for(let i of Array.from(n)){let r=Ne(s,n,i,i);r===void 0?n.delete(i):r!==i&&(n.delete(i),n.add(r))}else for(let[i,r]of Object.entries(n)){let a=Ne(s,n,i,r);a===void 0?delete n[i]:a!==r&&(n[i]=a)}return s.call(e,t,n)}pi.applyReviver=Ne});var J=b(gi=>{"use strict";var Oo=C();function mi(s,e,t){if(Array.isArray(s))return s.map((n,i)=>mi(n,String(i),t));if(s&&typeof s.toJSON=="function"){if(!t||!Oo.hasAnchor(s))return s.toJSON(e,t);let n={aliasCount:0,count:1,res:void 0};t.anchors.set(s,n),t.onCreate=r=>{n.res=r,delete t.onCreate};let i=s.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof s=="bigint"&&!t?.keep?Number(s):s}gi.toJS=mi});var ot=b(bi=>{"use strict";var Co=fs(),yi=C(),qo=J(),us=class{constructor(e){Object.defineProperty(this,yi.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:i,reviver:r}={}){if(!yi.isDocument(e))throw new TypeError("A document argument is required");let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},o=qo.toJS(this,"",a);if(typeof i=="function")for(let{count:l,res:c}of a.anchors.values())i(c,l);return typeof r=="function"?Co.applyReviver(r,{"":o},"",o):o}};bi.NodeBase=us});var Le=b(Si=>{"use strict";var Io=at(),wi=Se(),lt=C(),To=ot(),Po=J(),hs=class extends To.NodeBase{constructor(e){super(lt.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let t;return wi.visit(e,{Node:(n,i)=>{if(i===this)return wi.visit.BREAK;i.anchor===this.source&&(t=i)}}),t}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:r}=t,a=this.resolve(i);if(!a){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let o=n.get(a);if(o||(Po.toJS(a,null,t),o=n.get(a)),!o||o.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(r>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=ct(i,a,n)),o.count*o.aliasCount>r)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return o.res}toString(e,t,n){let i=`*${this.source}`;if(e){if(Io.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let 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 ct(s,e,t){if(lt.isAlias(e)){let n=e.resolve(s),i=t&&n&&t.get(n);return i?i.count*i.aliasCount:0}else if(lt.isCollection(e)){let n=0;for(let i of e.items){let r=ct(s,i,t);r>n&&(n=r)}return n}else if(lt.isPair(e)){let n=ct(s,e.key,t),i=ct(s,e.value,t);return Math.max(n,i)}return 1}Si.Alias=hs});var T=b(ds=>{"use strict";var Mo=C(),_o=ot(),Bo=J(),Do=s=>!s||typeof s!="function"&&typeof s!="object",H=class extends _o.NodeBase{constructor(e){super(Mo.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:Bo.toJS(this.value,e,t)}toString(){return String(this.value)}};H.BLOCK_FOLDED="BLOCK_FOLDED";H.BLOCK_LITERAL="BLOCK_LITERAL";H.PLAIN="PLAIN";H.QUOTE_DOUBLE="QUOTE_DOUBLE";H.QUOTE_SINGLE="QUOTE_SINGLE";ds.Scalar=H;ds.isScalarValue=Do});var Ae=b(ki=>{"use strict";var $o=Le(),se=C(),vi=T(),xo="tag:yaml.org,2002:";function jo(s,e,t){if(e){let n=t.filter(r=>r.tag===e),i=n.find(r=>!r.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(n=>n.identify?.(s)&&!n.format)}function Fo(s,e,t){if(se.isDocument(s)&&(s=s.contents),se.isNode(s))return s;if(se.isPair(s)){let f=t.schema[se.MAP].createNode?.(t.schema,null,t);return f.items.push(s),f}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)&&(s=s.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:a,sourceObjects:o}=t,l;if(n&&s&&typeof s=="object"){if(l=o.get(s),l)return l.anchor||(l.anchor=i(s)),new $o.Alias(l.anchor);l={anchor:null,node:null},o.set(s,l)}e?.startsWith("!!")&&(e=xo+e.slice(2));let c=jo(s,e,a.tags);if(!c){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){let f=new vi.Scalar(s);return l&&(l.node=f),f}c=s instanceof Map?a[se.MAP]:Symbol.iterator in Object(s)?a[se.SEQ]:a[se.MAP]}r&&(r(c),delete t.onTagObj);let d=c?.createNode?c.createNode(t.schema,s,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,s,t):new vi.Scalar(s);return e?d.tag=e:c.default||(d.tag=c.tag),l&&(l.node=d),d}ki.createNode=Fo});var ut=b(ft=>{"use strict";var Ro=Ae(),F=C(),Ko=ot();function ps(s,e,t){let n=t;for(let i=e.length-1;i>=0;--i){let r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let a=[];a[r]=n,n=a}else n=new Map([[r,n]])}return Ro.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}var Ni=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done,ms=class extends Ko.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>F.isNode(n)||F.isPair(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Ni(e))this.add(t);else{let[n,...i]=e,r=this.get(n,!0);if(F.isCollection(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(n,ps(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let i=this.get(t,!0);if(F.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...i]=e,r=this.get(n,!0);return i.length===0?!t&&F.isScalar(r)?r.value:r:F.isCollection(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!F.isPair(t))return!1;let n=t.value;return n==null||e&&F.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let i=this.get(t,!0);return F.isCollection(i)?i.hasIn(n):!1}setIn(e,t){let[n,...i]=e;if(i.length===0)this.set(n,t);else{let r=this.get(n,!0);if(F.isCollection(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(n,ps(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};ft.Collection=ms;ft.collectionFromPath=ps;ft.isEmptyPath=Ni});var Ee=b(ht=>{"use strict";var Uo=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function gs(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}var Yo=(s,e,t)=>s.endsWith(`
|
|
3
|
+
`)?gs(t,e):t.includes(`
|
|
4
4
|
`)?`
|
|
5
|
-
`+
|
|
6
|
-
`)t===
|
|
7
|
-
`&&m!==" "){let
|
|
8
|
-
`&&
|
|
9
|
-
${e}${s.slice(0,A)}`:(t===
|
|
10
|
-
${e}${s.slice(
|
|
11
|
-
`);n=e,i=e+1,r=s[i]}return n}Oe.FOLD_BLOCK=
|
|
12
|
-
`){if(r-
|
|
5
|
+
`+gs(t,e):(s.endsWith(" ")?"":" ")+t;ht.indentComment=gs;ht.lineComment=Yo;ht.stringifyComment=Uo});var Ai=b(Oe=>{"use strict";var Vo="flow",ys="block",dt="quoted";function Jo(s,e,t="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:r=20,onFold:a,onOverflow:o}={}){if(!i||i<0)return s;i<r&&(r=0);let l=Math.max(1+r,1+i-e.length);if(s.length<=l)return s;let c=[],d={},f=i-e.length;typeof n=="number"&&(n>i-Math.max(2,r)?c.push(0):f=i-n);let u,m,y=!1,h=-1,p=-1,v=-1;t===ys&&(h=Li(s,h,e.length),h!==-1&&(f=h+l));for(let N;N=s[h+=1];){if(t===dt&&N==="\\"){switch(p=h,s[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}v=h}if(N===`
|
|
6
|
+
`)t===ys&&(h=Li(s,h,e.length)),f=h+e.length+l,u=void 0;else{if(N===" "&&m&&m!==" "&&m!==`
|
|
7
|
+
`&&m!==" "){let L=s[h+1];L&&L!==" "&&L!==`
|
|
8
|
+
`&&L!==" "&&(u=h)}if(h>=f)if(u)c.push(u),f=u+l,u=void 0;else if(t===dt){for(;m===" "||m===" ";)m=N,N=s[h+=1],y=!0;let L=h>v+1?h-2:p-1;if(d[L])return s;c.push(L),d[L]=!0,f=L+l,u=void 0}else y=!0}m=N}if(y&&o&&o(),c.length===0)return s;a&&a();let S=s.slice(0,c[0]);for(let N=0;N<c.length;++N){let L=c[N],A=c[N+1]||s.length;L===0?S=`
|
|
9
|
+
${e}${s.slice(0,A)}`:(t===dt&&d[L]&&(S+=`${s[L]}\\`),S+=`
|
|
10
|
+
${e}${s.slice(L+1,A)}`)}return S}function Li(s,e,t){let n=e,i=e+1,r=s[i];for(;r===" "||r===" ";)if(e<i+t)r=s[++e];else{do r=s[++e];while(r&&r!==`
|
|
11
|
+
`);n=e,i=e+1,r=s[i]}return n}Oe.FOLD_BLOCK=ys;Oe.FOLD_FLOW=Vo;Oe.FOLD_QUOTED=dt;Oe.foldFlowLines=Jo});var qe=b(Ei=>{"use strict";var R=T(),Q=Ai(),mt=(s,e)=>({indentAtStart:e?s.indent.length:s.indentAtStart,lineWidth:s.options.lineWidth,minContentWidth:s.options.minContentWidth}),gt=s=>/^(%|---|\.\.\.)/m.test(s);function Ho(s,e,t){if(!e||e<0)return!1;let n=e-t,i=s.length;if(i<=n)return!1;for(let r=0,a=0;r<i;++r)if(s[r]===`
|
|
12
|
+
`){if(r-a>n)return!0;if(a=r+1,i-a<=n)return!1}return!0}function Ce(s,e){let t=JSON.stringify(s);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(gt(s)?" ":""),a="",o=0;for(let l=0,c=t[l];c;c=t[++l])if(c===" "&&t[l+1]==="\\"&&t[l+2]==="n"&&(a+=t.slice(o,l)+"\\ ",l+=1,o=l,c="\\"),c==="\\")switch(t[l+1]){case"u":{a+=t.slice(o,l);let d=t.substr(l+2,4);switch(d){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:d.substr(0,2)==="00"?a+="\\x"+d.substr(2):a+=t.substr(l,6)}l+=5,o=l+1}break;case"n":if(n||t[l+2]==='"'||t.length<i)l+=1;else{for(a+=t.slice(o,l)+`
|
|
13
13
|
|
|
14
|
-
`;t[l+2]==="\\"&&t[l+3]==="n"&&t[l+4]!=='"';)
|
|
15
|
-
`,l+=2;
|
|
16
|
-
`)||/[ \t]\n|\n[ \t]/.test(s))return
|
|
17
|
-
${t}`)+"'";return e.implicitKey?n:
|
|
14
|
+
`;t[l+2]==="\\"&&t[l+3]==="n"&&t[l+4]!=='"';)a+=`
|
|
15
|
+
`,l+=2;a+=r,t[l+2]===" "&&(a+="\\"),l+=1,o=l+1}break;default:l+=1}return a=o?a+t.slice(o):t,n?a:Q.foldFlowLines(a,r,Q.FOLD_QUOTED,mt(e,!1))}function bs(s,e){if(e.options.singleQuote===!1||e.implicitKey&&s.includes(`
|
|
16
|
+
`)||/[ \t]\n|\n[ \t]/.test(s))return Ce(s,e);let t=e.indent||(gt(s)?" ":""),n="'"+s.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
17
|
+
${t}`)+"'";return e.implicitKey?n:Q.foldFlowLines(n,t,Q.FOLD_FLOW,mt(e,!1))}function fe(s,e){let{singleQuote:t}=e.options,n;if(t===!1)n=Ce;else{let i=s.includes('"'),r=s.includes("'");i&&!r?n=bs:r&&!i?n=Ce:n=t?bs:Ce}return n(s,e)}var ws;try{ws=new RegExp(`(^|(?<!
|
|
18
18
|
))
|
|
19
19
|
+(?!
|
|
20
|
-
|$)`,"g")}catch{
|
|
20
|
+
|$)`,"g")}catch{ws=/\n+(?!\n|$)/g}function pt({comment:s,type:e,value:t},n,i,r){let{blockQuote:a,commentString:o,lineWidth:l}=n.options;if(!a||/\n[\t ]+$/.test(t)||/^\s*$/.test(t))return fe(t,n);let c=n.indent||(n.forceBlockIndent||gt(t)?" ":""),d=a==="literal"?!0:a==="folded"||e===R.Scalar.BLOCK_FOLDED?!1:e===R.Scalar.BLOCK_LITERAL?!0:!Ho(t,l,c.length);if(!t)return d?`|
|
|
21
21
|
`:`>
|
|
22
22
|
`;let f,u;for(u=t.length;u>0;--u){let k=t[u-1];if(k!==`
|
|
23
|
-
`&&k!==" "&&k!==" ")break}let m=t.substring(u),
|
|
24
|
-
`);
|
|
25
|
-
`&&(m=m.slice(0,-1)),m=m.replace(
|
|
26
|
-
`)
|
|
27
|
-
${c}${
|
|
28
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let A=
|
|
29
|
-
${c}${A}`}function
|
|
30
|
-
`)||d&&/[[\]{},]/.test(r))return
|
|
31
|
-
`)?
|
|
32
|
-
`))return
|
|
33
|
-
${l}`);if(
|
|
34
|
-
${e.indent}${
|
|
35
|
-
${
|
|
36
|
-
`:"",
|
|
37
|
-
${Te.indentComment(
|
|
23
|
+
`&&k!==" "&&k!==" ")break}let m=t.substring(u),y=m.indexOf(`
|
|
24
|
+
`);y===-1?f="-":t===m||y!==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(ws,`$&${c}`));let h=!1,p,v=-1;for(p=0;p<t.length;++p){let k=t[p];if(k===" ")h=!0;else if(k===`
|
|
26
|
+
`)v=p;else break}let S=t.substring(0,v<p?v+1:p);S&&(t=t.substring(S.length),S=S.replace(/\n+/g,`$&${c}`));let L=(d?"|":">")+(h?c?"2":"1":"")+f;if(s&&(L+=" "+o(s.replace(/ ?[\r\n]+/g," ")),i&&i()),d)return t=t.replace(/\n+/g,`$&${c}`),`${L}
|
|
27
|
+
${c}${S}${t}${m}`;t=t.replace(/\n+/g,`
|
|
28
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let A=Q.foldFlowLines(`${S}${t}${m}`,c,Q.FOLD_BLOCK,mt(n,!0));return`${L}
|
|
29
|
+
${c}${A}`}function Qo(s,e,t,n){let{type:i,value:r}=s,{actualString:a,implicitKey:o,indent:l,indentStep:c,inFlow:d}=e;if(o&&r.includes(`
|
|
30
|
+
`)||d&&/[[\]{},]/.test(r))return fe(r,e);if(!r||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return o||d||!r.includes(`
|
|
31
|
+
`)?fe(r,e):pt(s,e,t,n);if(!o&&!d&&i!==R.Scalar.PLAIN&&r.includes(`
|
|
32
|
+
`))return pt(s,e,t,n);if(gt(r)){if(l==="")return e.forceBlockIndent=!0,pt(s,e,t,n);if(o&&l===c)return fe(r,e)}let f=r.replace(/\n+/g,`$&
|
|
33
|
+
${l}`);if(a){let u=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(f),{compat:m,tags:y}=e.doc.schema;if(y.some(u)||m?.some(u))return fe(r,e)}return o?f:Q.foldFlowLines(f,l,Q.FOLD_FLOW,mt(e,!1))}function Wo(s,e,t,n){let{implicitKey:i,inFlow:r}=e,a=typeof s.value=="string"?s:Object.assign({},s,{value:String(s.value)}),{type:o}=s;o!==R.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(o=R.Scalar.QUOTE_DOUBLE);let l=d=>{switch(d){case R.Scalar.BLOCK_FOLDED:case R.Scalar.BLOCK_LITERAL:return i||r?fe(a.value,e):pt(a,e,t,n);case R.Scalar.QUOTE_DOUBLE:return Ce(a.value,e);case R.Scalar.QUOTE_SINGLE:return bs(a.value,e);case R.Scalar.PLAIN:return Qo(a,e,t,n);default:return null}},c=l(o);if(c===null){let{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}Ei.stringifyString=Wo});var Ie=b(Ss=>{"use strict";var Go=at(),W=C(),Xo=Ee(),zo=qe();function Zo(s,e){let t=Object.assign({blockQuote:!0,commentString:Xo.stringifyComment,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},s.schema.toStringOptions,e),n;switch(t.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:s,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:n,options:t}}function el(s,e){if(e.tag){let i=s.filter(r=>r.tag===e.tag);if(i.length>0)return i.find(r=>r.format===e.format)??i[0]}let t,n;if(W.isScalar(e)){n=e.value;let i=s.filter(r=>r.identify?.(n));t=i.find(r=>r.format===e.format)??i.find(r=>!r.format)}else n=e,t=s.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!t){let i=n?.constructor?.name??typeof n;throw new Error(`Tag not resolved for ${i} value`)}return t}function tl(s,e,{anchors:t,doc:n}){if(!n.directives)return"";let i=[],r=(W.isScalar(s)||W.isCollection(s))&&s.anchor;r&&Go.anchorIsValid(r)&&(t.add(r),i.push(`&${r}`));let a=s.tag?s.tag:e.default?null:e.tag;return a&&i.push(n.directives.tagString(a)),i.join(" ")}function sl(s,e,t,n){if(W.isPair(s))return s.toString(e,t,n);if(W.isAlias(s)){if(e.doc.directives)return s.toString(e);if(e.resolvedAliases?.has(s))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(s):e.resolvedAliases=new Set([s]),s=s.resolve(e.doc)}let i,r=W.isNode(s)?s:e.doc.createNode(s,{onTagObj:l=>i=l});i||(i=el(e.doc.schema.tags,r));let a=tl(r,i,e);a.length>0&&(e.indentAtStart=(e.indentAtStart??0)+a.length+1);let o=typeof i.stringify=="function"?i.stringify(r,e,t,n):W.isScalar(r)?zo.stringifyString(r,e,t,n):r.toString(e,t,n);return a?W.isScalar(r)||o[0]==="{"||o[0]==="["?`${a} ${o}`:`${a}
|
|
34
|
+
${e.indent}${o}`:o}Ss.createStringifyContext=Zo;Ss.stringify=sl});var Ii=b(qi=>{"use strict";var U=C(),Oi=T(),Ci=Ie(),Te=Ee();function nl({key:s,value:e},t,n,i){let{allNullValues:r,doc:a,indent:o,indentStep:l,options:{commentString:c,indentSeq:d,simpleKeys:f}}=t,u=U.isNode(s)&&s.comment||null;if(f){if(u)throw new Error("With simple keys, key nodes cannot have comments");if(U.isCollection(s)||!U.isNode(s)&&typeof s=="object"){let w="With simple keys, collection cannot be used as a key value";throw new Error(w)}}let m=!f&&(!s||u&&e==null&&!t.inFlow||U.isCollection(s)||(U.isScalar(s)?s.type===Oi.Scalar.BLOCK_FOLDED||s.type===Oi.Scalar.BLOCK_LITERAL:typeof s=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!m&&(f||!r),indent:o+l});let y=!1,h=!1,p=Ci.stringify(s,t,()=>y=!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 y&&n&&n(),p===""?"?":m?`? ${p}`:p}else if(r&&!f||e==null&&m)return p=`? ${p}`,u&&!y?p+=Te.lineComment(p,t.indent,c(u)):h&&i&&i(),p;y&&(u=null),m?(u&&(p+=Te.lineComment(p,t.indent,c(u))),p=`? ${p}
|
|
35
|
+
${o}:`):(p=`${p}:`,u&&(p+=Te.lineComment(p,t.indent,c(u))));let v,S,N;U.isNode(e)?(v=!!e.spaceBefore,S=e.commentBefore,N=e.comment):(v=!1,S=null,N=null,e&&typeof e=="object"&&(e=a.createNode(e))),t.implicitKey=!1,!m&&!u&&U.isScalar(e)&&(t.indentAtStart=p.length+1),h=!1,!d&&l.length>=2&&!t.inFlow&&!m&&U.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let L=!1,A=Ci.stringify(e,t,()=>L=!0,()=>h=!0),k=" ";if(u||v||S){if(k=v?`
|
|
36
|
+
`:"",S){let w=c(S);k+=`
|
|
37
|
+
${Te.indentComment(w,t.indent)}`}A===""&&!t.inFlow?k===`
|
|
38
38
|
`&&(k=`
|
|
39
39
|
|
|
40
40
|
`):k+=`
|
|
41
|
-
${t.indent}`}else if(!m&&
|
|
42
|
-
`),
|
|
41
|
+
${t.indent}`}else if(!m&&U.isCollection(e)){let w=A[0],g=A.indexOf(`
|
|
42
|
+
`),O=g!==-1,M=t.inFlow??e.flow??e.items.length===0;if(O||!M){let Y=!1;if(O&&(w==="&"||w==="!")){let I=A.indexOf(" ");w==="&"&&I!==-1&&I<g&&A[I+1]==="!"&&(I=A.indexOf(" ",I+1)),(I===-1||g<I)&&(Y=!0)}Y||(k=`
|
|
43
43
|
${t.indent}`)}}else(A===""||A[0]===`
|
|
44
|
-
`)&&(k="");return p+=k+A,t.inFlow?
|
|
44
|
+
`)&&(k="");return p+=k+A,t.inFlow?L&&n&&n():N&&!L?p+=Te.lineComment(p,t.indent,c(N)):h&&i&&i(),p}qi.stringifyPair=nl});var ks=b(vs=>{"use strict";function il(s,...e){s==="debug"&&console.log(...e)}function rl(s,e){(s==="debug"||s==="warn")&&(typeof process<"u"&&process.emitWarning?process.emitWarning(e):console.warn(e))}vs.debug=il;vs.warn=rl});var As=b(Pi=>{"use strict";var al=ks(),ol=Ie(),ue=C(),ll=T(),Ns=J(),Ti="<<";function cl(s,e,{key:t,value:n}){if(s?.doc.schema.merge&&fl(t))if(n=ue.isAlias(n)?n.resolve(s.doc):n,ue.isSeq(n))for(let i of n.items)Ls(s,e,i);else if(Array.isArray(n))for(let i of n)Ls(s,e,i);else Ls(s,e,n);else{let i=Ns.toJS(t,"",s);if(e instanceof Map)e.set(i,Ns.toJS(n,i,s));else if(e instanceof Set)e.add(i);else{let r=ul(t,i,s),a=Ns.toJS(n,r,s);r in e?Object.defineProperty(e,r,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[r]=a}}return e}var fl=s=>s===Ti||ue.isScalar(s)&&s.value===Ti&&(!s.type||s.type===ll.Scalar.PLAIN);function Ls(s,e,t){let n=s&&ue.isAlias(t)?t.resolve(s.doc):t;if(!ue.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,s,Map);for(let[r,a]of i)e instanceof Map?e.has(r)||e.set(r,a):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:a,writable:!0,enumerable:!0,configurable:!0});return e}function ul(s,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(ue.isNode(s)&&t?.doc){let n=ol.createStringifyContext(t.doc,{});n.anchors=new Set;for(let r of t.anchors.keys())n.anchors.add(r.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=s.toString(n);if(!t.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),al.warn(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)}Pi.addPairToJSMap=cl});var G=b(Es=>{"use strict";var Mi=Ae(),hl=Ii(),dl=As(),yt=C();function pl(s,e,t){let n=Mi.createNode(s,void 0,t),i=Mi.createNode(e,void 0,t);return new bt(n,i)}var bt=class s{constructor(e,t=null){Object.defineProperty(this,yt.NODE_TYPE,{value:yt.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return yt.isNode(t)&&(t=t.clone(e)),yt.isNode(n)&&(n=n.clone(e)),new s(t,n)}toJSON(e,t){let n=t?.mapAsMap?new Map:{};return dl.addPairToJSMap(t,n,this)}toString(e,t,n){return e?.doc?hl.stringifyPair(this,e,t,n):JSON.stringify(this)}};Es.Pair=bt;Es.createPair=pl});var Os=b(Bi=>{"use strict";var ne=C(),_i=Ie(),wt=Ee();function ml(s,e,t){return(e.inFlow??s.flow?yl:gl)(s,e,t)}function gl({comment:s,items:e},t,{blockItemPrefix:n,flowChars:i,itemIndent:r,onChompKeep:a,onComment:o}){let{indent:l,options:{commentString:c}}=t,d=Object.assign({},t,{indent:r,type:null}),f=!1,u=[];for(let y=0;y<e.length;++y){let h=e[y],p=null;if(ne.isNode(h))!f&&h.spaceBefore&&u.push(""),St(t,u,h.commentBefore,f),h.comment&&(p=h.comment);else if(ne.isPair(h)){let S=ne.isNode(h.key)?h.key:null;S&&(!f&&S.spaceBefore&&u.push(""),St(t,u,S.commentBefore,f))}f=!1;let v=_i.stringify(h,d,()=>p=null,()=>f=!0);p&&(v+=wt.lineComment(v,r,c(p))),f&&p&&(f=!1),u.push(n+v)}let m;if(u.length===0)m=i.start+i.end;else{m=u[0];for(let y=1;y<u.length;++y){let h=u[y];m+=h?`
|
|
45
45
|
${l}${h}`:`
|
|
46
46
|
`}}return s?(m+=`
|
|
47
|
-
`+
|
|
48
|
-
`))&&(c=!0),f.push(
|
|
47
|
+
`+wt.indentComment(c(s),l),o&&o()):f&&a&&a(),m}function yl({items:s},e,{flowChars:t,itemIndent:n}){let{indent:i,indentStep:r,flowCollectionPadding:a,options:{commentString:o}}=e;n+=r;let l=Object.assign({},e,{indent:n,inFlow:!0,type:null}),c=!1,d=0,f=[];for(let y=0;y<s.length;++y){let h=s[y],p=null;if(ne.isNode(h))h.spaceBefore&&f.push(""),St(e,f,h.commentBefore,!1),h.comment&&(p=h.comment);else if(ne.isPair(h)){let S=ne.isNode(h.key)?h.key:null;S&&(S.spaceBefore&&f.push(""),St(e,f,S.commentBefore,!1),S.comment&&(c=!0));let N=ne.isNode(h.value)?h.value:null;N?(N.comment&&(p=N.comment),N.commentBefore&&(c=!0)):h.value==null&&S?.comment&&(p=S.comment)}p&&(c=!0);let v=_i.stringify(h,l,()=>p=null);y<s.length-1&&(v+=","),p&&(v+=wt.lineComment(v,n,o(p))),!c&&(f.length>d||v.includes(`
|
|
48
|
+
`))&&(c=!0),f.push(v),d=f.length}let{start:u,end:m}=t;if(f.length===0)return u+m;if(!c){let y=f.reduce((h,p)=>h+p.length+2,2);c=e.options.lineWidth>0&&y>e.options.lineWidth}if(c){let y=u;for(let h of f)y+=h?`
|
|
49
49
|
${r}${i}${h}`:`
|
|
50
|
-
`;return`${
|
|
51
|
-
${i}${m}`}else return`${u}${
|
|
52
|
-
`:" ")}return
|
|
50
|
+
`;return`${y}
|
|
51
|
+
${i}${m}`}else return`${u}${a}${f.join(" ")}${a}${m}`}function St({indent:s,options:{commentString:e}},t,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let r=wt.indentComment(e(n),s);t.push(r.trimStart())}}Bi.stringifyCollection=ml});var z=b(qs=>{"use strict";var bl=Os(),wl=As(),Sl=ut(),X=C(),vt=G(),vl=T();function Pe(s,e){let t=X.isScalar(e)?e.value:e;for(let n of s)if(X.isPair(n)&&(n.key===e||n.key===t||X.isScalar(n.key)&&n.key.value===t))return n}var Cs=class extends Sl.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(X.MAP,e),this.items=[]}static from(e,t,n){let{keepUndefined:i,replacer:r}=n,a=new this(e),o=(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)&&a.items.push(vt.createPair(l,c,n))};if(t instanceof Map)for(let[l,c]of t)o(l,c);else if(t&&typeof t=="object")for(let l of Object.keys(t))o(l,t[l]);return typeof e.sortMapEntries=="function"&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;X.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new vt.Pair(e,e?.value):n=new vt.Pair(e.key,e.value);let i=Pe(this.items,n.key),r=this.schema?.sortMapEntries;if(i){if(!t)throw new Error(`Key ${n.key} already set`);X.isScalar(i.value)&&vl.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(r){let a=this.items.findIndex(o=>r(n,o)<0);a===-1?this.items.push(n):this.items.splice(a,0,n)}else this.items.push(n)}delete(e){let t=Pe(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let i=Pe(this.items,e)?.value;return(!t&&X.isScalar(i)?i.value:i)??void 0}has(e){return!!Pe(this.items,e)}set(e,t){this.add(new vt.Pair(e,t),!0)}toJSON(e,t,n){let i=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(let r of this.items)wl.addPairToJSMap(t,i,r);return i}toString(e,t,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!X.isPair(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})),bl.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}};qs.YAMLMap=Cs;qs.findPair=Pe});var he=b($i=>{"use strict";var kl=C(),Di=z(),Nl={collection:"map",default:!0,nodeClass:Di.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(s,e){return kl.isMap(s)||e("Expected a mapping for this tag"),s},createNode:(s,e,t)=>Di.YAMLMap.from(s,e,t)};$i.map=Nl});var Z=b(xi=>{"use strict";var Ll=Ae(),Al=Os(),El=ut(),Nt=C(),Ol=T(),Cl=J(),Is=class extends El.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Nt.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=kt(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let n=kt(e);if(typeof n!="number")return;let i=this.items[n];return!t&&Nt.isScalar(i)?i.value:i}has(e){let t=kt(e);return typeof t=="number"&&t<this.items.length}set(e,t){let n=kt(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];Nt.isScalar(i)&&Ol.isScalarValue(t)?i.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let i=0;for(let r of this.items)n.push(Cl.toJS(r,String(i++),t));return n}toString(e,t,n){return e?Al.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t)){let a=0;for(let o of t){if(typeof i=="function"){let l=t instanceof Set?o:String(a++);o=i.call(t,l,o)}r.items.push(Ll.createNode(o,void 0,n))}}return r}};function kt(s){let e=Nt.isScalar(s)?s.value:s;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}xi.YAMLSeq=Is});var de=b(Fi=>{"use strict";var ql=C(),ji=Z(),Il={collection:"seq",default:!0,nodeClass:ji.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(s,e){return ql.isSeq(s)||e("Expected a sequence for this tag"),s},createNode:(s,e,t)=>ji.YAMLSeq.from(s,e,t)};Fi.seq=Il});var Me=b(Ri=>{"use strict";var Tl=qe(),Pl={identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify(s,e,t,n){return e=Object.assign({actualString:!0},e),Tl.stringifyString(s,e,t,n)}};Ri.string=Pl});var Lt=b(Yi=>{"use strict";var Ki=T(),Ui={identify:s=>s==null,createNode:()=>new Ki.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ki.Scalar(null),stringify:({source:s},e)=>typeof s=="string"&&Ui.test.test(s)?s:e.options.nullStr};Yi.nullTag=Ui});var Ts=b(Ji=>{"use strict";var Ml=T(),Vi={identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:s=>new Ml.Scalar(s[0]==="t"||s[0]==="T"),stringify({source:s,value:e},t){if(s&&Vi.test.test(s)){let n=s[0]==="t"||s[0]==="T";if(e===n)return s}return e?t.options.trueStr:t.options.falseStr}};Ji.boolTag=Vi});var pe=b(Hi=>{"use strict";function _l({format:s,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=JSON.stringify(n);if(!s&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(r)){let a=r.indexOf(".");a<0&&(a=r.length,r+=".");let o=e-(r.length-a-1);for(;o-- >0;)r+="0"}return r}Hi.stringifyNumber=_l});var Ms=b(At=>{"use strict";var Bl=T(),Ps=pe(),Dl={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ps.stringifyNumber},$l={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():Ps.stringifyNumber(s)}},xl={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(s){let e=new Bl.Scalar(parseFloat(s)),t=s.indexOf(".");return t!==-1&&s[s.length-1]==="0"&&(e.minFractionDigits=s.length-t-1),e},stringify:Ps.stringifyNumber};At.float=xl;At.floatExp=$l;At.floatNaN=Dl});var Bs=b(Ot=>{"use strict";var Qi=pe(),Et=s=>typeof s=="bigint"||Number.isInteger(s),_s=(s,e,t,{intAsBigInt:n})=>n?BigInt(s):parseInt(s.substring(e),t);function Wi(s,e,t){let{value:n}=s;return Et(n)&&n>=0?t+n.toString(e):Qi.stringifyNumber(s)}var jl={identify:s=>Et(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(s,e,t)=>_s(s,2,8,t),stringify:s=>Wi(s,8,"0o")},Fl={identify:Et,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(s,e,t)=>_s(s,0,10,t),stringify:Qi.stringifyNumber},Rl={identify:s=>Et(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(s,e,t)=>_s(s,2,16,t),stringify:s=>Wi(s,16,"0x")};Ot.int=Fl;Ot.intHex=Rl;Ot.intOct=jl});var Xi=b(Gi=>{"use strict";var Kl=he(),Ul=Lt(),Yl=de(),Vl=Me(),Jl=Ts(),Ds=Ms(),$s=Bs(),Hl=[Kl.map,Yl.seq,Vl.string,Ul.nullTag,Jl.boolTag,$s.intOct,$s.int,$s.intHex,Ds.floatNaN,Ds.floatExp,Ds.float];Gi.schema=Hl});var er=b(Zi=>{"use strict";var Ql=T(),Wl=he(),Gl=de();function zi(s){return typeof s=="bigint"||Number.isInteger(s)}var Ct=({value:s})=>JSON.stringify(s),Xl=[{identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify:Ct},{identify:s=>s==null,createNode:()=>new Ql.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ct},{identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:s=>s==="true",stringify:Ct},{identify:zi,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(s,e,{intAsBigInt:t})=>t?BigInt(s):parseInt(s,10),stringify:({value:s})=>zi(s)?s.toString():JSON.stringify(s)},{identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:s=>parseFloat(s),stringify:Ct}],zl={default:!0,tag:"",test:/^/,resolve(s,e){return e(`Unresolved plain scalar ${JSON.stringify(s)}`),s}},Zl=[Wl.map,Gl.seq].concat(Xl,zl);Zi.schema=Zl});var js=b(tr=>{"use strict";var xs=T(),ec=qe(),tc={identify:s=>s instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(s,e){if(typeof Buffer=="function")return Buffer.from(s,"base64");if(typeof atob=="function"){let t=atob(s.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),s},stringify({comment:s,type:e,value:t},n,i,r){let a=t,o;if(typeof Buffer=="function")o=a instanceof Buffer?a.toString("base64"):Buffer.from(a.buffer).toString("base64");else if(typeof btoa=="function"){let l="";for(let c=0;c<a.length;++c)l+=String.fromCharCode(a[c]);o=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e||(e=xs.Scalar.BLOCK_LITERAL),e!==xs.Scalar.QUOTE_DOUBLE){let l=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(o.length/l),d=new Array(c);for(let f=0,u=0;f<c;++f,u+=l)d[f]=o.substr(u,l);o=d.join(e===xs.Scalar.BLOCK_LITERAL?`
|
|
52
|
+
`:" ")}return ec.stringifyString({comment:s,type:e,value:o},n,i,r)}};tr.binary=tc});var Tt=b(It=>{"use strict";var qt=C(),Fs=G(),sc=T(),nc=Z();function sr(s,e){if(qt.isSeq(s))for(let t=0;t<s.items.length;++t){let n=s.items[t];if(!qt.isPair(n)){if(qt.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new Fs.Pair(new sc.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
|
|
53
53
|
${i.key.commentBefore}`:n.commentBefore),n.comment){let r=i.value??i.key;r.comment=r.comment?`${n.comment}
|
|
54
|
-
${r.comment}`:n.comment}n=i}s.items[t]=Ot.isPair(n)?n:new $s.Pair(n)}}else e("Expected a sequence for this tag");return s}function nr(s,e,t){let{replacer:n}=t,i=new tc.YAMLSeq(s);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.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){let 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($s.createPair(a,l,t))}return i}var sc={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:sr,createNode:nr};qt.createPairs=nr;qt.pairs=sc;qt.resolvePairs=sr});var Fs=y(js=>{"use strict";var ir=L(),xs=V(),_e=X(),nc=z(),rr=Ct(),ne=class s extends nc.YAMLSeq{constructor(){super(),this.add=_e.YAMLMap.prototype.add.bind(this),this.delete=_e.YAMLMap.prototype.delete.bind(this),this.get=_e.YAMLMap.prototype.get.bind(this),this.has=_e.YAMLMap.prototype.has.bind(this),this.set=_e.YAMLMap.prototype.set.bind(this),this.tag=s.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let i of this.items){let r,o;if(ir.isPair(i)?(r=xs.toJS(i.key,"",t),o=xs.toJS(i.value,r,t)):r=xs.toJS(i,"",t),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,o)}return n}static from(e,t,n){let i=rr.createPairs(e,t,n),r=new this;return r.items=i.items,r}};ne.tag="tag:yaml.org,2002:omap";var ic={collection:"seq",identify:s=>s instanceof Map,nodeClass:ne,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){let t=rr.resolvePairs(s,e),n=[];for(let{key:i}of t.items)ir.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new ne,t)},createNode:(s,e,t)=>ne.from(s,e,t)};js.YAMLOMap=ne;js.omap=ic});var ur=y(Rs=>{"use strict";var or=C();function ar({value:s,source:e},t){return e&&(s?lr:cr).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}var lr={identify:s=>s===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new or.Scalar(!0),stringify:ar},cr={identify:s=>s===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new or.Scalar(!1),stringify:ar};Rs.falseTag=cr;Rs.trueTag=lr});var fr=y(It=>{"use strict";var rc=C(),Ks=pe(),oc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ks.stringifyNumber},ac={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s.replace(/_/g,"")),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():Ks.stringifyNumber(s)}},lc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(s){let e=new rc.Scalar(parseFloat(s.replace(/_/g,""))),t=s.indexOf(".");if(t!==-1){let n=s.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:Ks.stringifyNumber};It.float=lc;It.floatExp=ac;It.floatNaN=oc});var dr=y(De=>{"use strict";var hr=pe(),Be=s=>typeof s=="bigint"||Number.isInteger(s);function Tt(s,e,t,{intAsBigInt:n}){let i=s[0];if((i==="-"||i==="+")&&(e+=1),s=s.substring(e).replace(/_/g,""),n){switch(t){case 2:s=`0b${s}`;break;case 8:s=`0o${s}`;break;case 16:s=`0x${s}`;break}let o=BigInt(s);return i==="-"?BigInt(-1)*o:o}let r=parseInt(s,t);return i==="-"?-1*r:r}function Us(s,e,t){let{value:n}=s;if(Be(n)){let i=n.toString(e);return n<0?"-"+t+i.substr(1):t+i}return hr.stringifyNumber(s)}var cc={identify:Be,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,e,t)=>Tt(s,2,2,t),stringify:s=>Us(s,2,"0b")},uc={identify:Be,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,e,t)=>Tt(s,1,8,t),stringify:s=>Us(s,8,"0")},fc={identify:Be,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,e,t)=>Tt(s,0,10,t),stringify:hr.stringifyNumber},hc={identify:Be,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,e,t)=>Tt(s,2,16,t),stringify:s=>Us(s,16,"0x")};De.int=fc;De.intBin=cc;De.intHex=hc;De.intOct=uc});var Vs=y(Ys=>{"use strict";var _t=L(),Pt=W(),Mt=X(),ie=class s extends Mt.YAMLMap{constructor(e){super(e),this.tag=s.tag}add(e){let t;_t.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Pt.Pair(e.key,null):t=new Pt.Pair(e,null),Mt.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let n=Mt.findPair(this.items,e);return!t&&_t.isPair(n)?_t.isScalar(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Mt.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Pt.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){let{replacer:i}=n,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(Pt.createPair(o,null,n));return r}};ie.tag="tag:yaml.org,2002:set";var dc={collection:"map",identify:s=>s instanceof Set,nodeClass:ie,default:!1,tag:"tag:yaml.org,2002:set",createNode:(s,e,t)=>ie.from(s,e,t),resolve(s,e){if(_t.isMap(s)){if(s.hasAllNullValues(!0))return Object.assign(new ie,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};Ys.YAMLSet=ie;Ys.set=dc});var Hs=y(Bt=>{"use strict";var pc=pe();function Js(s,e){let t=s[0],n=t==="-"||t==="+"?s.substring(1):s,i=o=>e?BigInt(o):Number(o),r=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return t==="-"?i(-1)*r:r}function pr(s){let{value:e}=s,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return pc.stringifyNumber(s);let n="";e<0&&(n="-",e*=t(-1));let 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))),n+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var mc={identify:s=>typeof s=="bigint"||Number.isInteger(s),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(s,e,{intAsBigInt:t})=>Js(s,t),stringify:pr},gc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:s=>Js(s,!1),stringify:pr},mr={identify:s=>s 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(s){let e=s.match(mr.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,i,r,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(t,n-1,i,r||0,o||0,a||0,l),d=e[8];if(d&&d!=="Z"){let f=Js(d,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:s})=>s.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};Bt.floatTime=gc;Bt.intTime=mc;Bt.timestamp=mr});var br=y(yr=>{"use strict";var yc=he(),bc=kt(),wc=de(),Sc=Me(),vc=Ds(),gr=ur(),Qs=fr(),Dt=dr(),kc=Fs(),Nc=Ct(),Ac=Vs(),Ws=Hs(),Lc=[yc.map,wc.seq,Sc.string,bc.nullTag,gr.trueTag,gr.falseTag,Dt.intBin,Dt.intOct,Dt.int,Dt.intHex,Qs.floatNaN,Qs.floatExp,Qs.float,vc.binary,kc.omap,Nc.pairs,Ac.set,Ws.intTime,Ws.floatTime,Ws.timestamp];yr.schema=Lc});var qr=y(zs=>{"use strict";var kr=he(),Ec=kt(),Nr=de(),Oc=Me(),qc=qs(),Gs=Is(),Xs=Ps(),Cc=Xi(),Ic=er(),Ar=Ds(),Lr=Fs(),Er=Ct(),wr=br(),Or=Vs(),$t=Hs(),Sr=new Map([["core",Cc.schema],["failsafe",[kr.map,Nr.seq,Oc.string]],["json",Ic.schema],["yaml11",wr.schema],["yaml-1.1",wr.schema]]),vr={binary:Ar.binary,bool:qc.boolTag,float:Gs.float,floatExp:Gs.floatExp,floatNaN:Gs.floatNaN,floatTime:$t.floatTime,int:Xs.int,intHex:Xs.intHex,intOct:Xs.intOct,intTime:$t.intTime,map:kr.map,null:Ec.nullTag,omap:Lr.omap,pairs:Er.pairs,seq:Nr.seq,set:Or.set,timestamp:$t.timestamp},Tc={"tag:yaml.org,2002:binary":Ar.binary,"tag:yaml.org,2002:omap":Lr.omap,"tag:yaml.org,2002:pairs":Er.pairs,"tag:yaml.org,2002:set":Or.set,"tag:yaml.org,2002:timestamp":$t.timestamp};function Pc(s,e){let t=Sr.get(e);if(!t)if(Array.isArray(s))t=[];else{let n=Array.from(Sr.keys()).filter(i=>i!=="yaml11").map(i=>JSON.stringify(i)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${n} or define customTags array`)}if(Array.isArray(s))for(let n of s)t=t.concat(n);else typeof s=="function"&&(t=s(t.slice()));return t.map(n=>{if(typeof n!="string")return n;let i=vr[n];if(i)return i;let r=Object.keys(vr).map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown custom tag "${n}"; use one of ${r}`)})}zs.coreKnownTags=Tc;zs.getTags=Pc});var tn=y(Cr=>{"use strict";var Zs=L(),Mc=he(),_c=de(),Bc=Me(),xt=qr(),Dc=(s,e)=>s.key<e.key?-1:s.key>e.key?1:0,en=class s{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?xt.getTags(e,"compat"):e?xt.getTags(null,e):null,this.merge=!!n,this.name=typeof r=="string"&&r||"core",this.knownTags=i?xt.coreKnownTags:{},this.tags=xt.getTags(t,this.name),this.toStringOptions=a??null,Object.defineProperty(this,Zs.MAP,{value:Mc.map}),Object.defineProperty(this,Zs.SCALAR,{value:Bc.string}),Object.defineProperty(this,Zs.SEQ,{value:_c.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Dc:null}clone(){let e=Object.create(s.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Cr.Schema=en});var Tr=y(Ir=>{"use strict";var $c=L(),sn=Ie(),$e=Ee();function xc(s,e){let t=[],n=e.directives===!0;if(e.directives!==!1&&s.directives){let l=s.directives.toString(s);l?(t.push(l),n=!0):s.directives.docStart&&(n=!0)}n&&t.push("---");let i=sn.createStringifyContext(s,e),{commentString:r}=i.options;if(s.commentBefore){t.length!==1&&t.unshift("");let l=r(s.commentBefore);t.unshift($e.indentComment(l,""))}let o=!1,a=null;if(s.contents){if($c.isNode(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){let d=r(s.contents.commentBefore);t.push($e.indentComment(d,""))}i.forceBlockIndent=!!s.comment,a=s.contents.comment}let l=a?void 0:()=>o=!0,c=sn.stringify(s.contents,i,()=>a=null,l);a&&(c+=$e.lineComment(c,"",r(a))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(sn.stringify(s.contents,i));if(s.directives?.docEnd)if(s.comment){let l=r(s.comment);l.includes(`
|
|
55
|
-
`)?(t.push("..."),t.push($e.indentComment(l,""))):t.push(`... ${l}`)}else t.push("...");else{let l=s.comment;l&&
|
|
54
|
+
${r.comment}`:n.comment}n=i}s.items[t]=qt.isPair(n)?n:new Fs.Pair(n)}}else e("Expected a sequence for this tag");return s}function nr(s,e,t){let{replacer:n}=t,i=new nc.YAMLSeq(s);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let a of e){typeof n=="function"&&(a=n.call(e,String(r++),a));let o,l;if(Array.isArray(a))if(a.length===2)o=a[0],l=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let c=Object.keys(a);if(c.length===1)o=c[0],l=a[o];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else o=a;i.items.push(Fs.createPair(o,l,t))}return i}var ic={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:sr,createNode:nr};It.createPairs=nr;It.pairs=ic;It.resolvePairs=sr});var Us=b(Ks=>{"use strict";var ir=C(),Rs=J(),_e=z(),rc=Z(),rr=Tt(),ie=class s extends rc.YAMLSeq{constructor(){super(),this.add=_e.YAMLMap.prototype.add.bind(this),this.delete=_e.YAMLMap.prototype.delete.bind(this),this.get=_e.YAMLMap.prototype.get.bind(this),this.has=_e.YAMLMap.prototype.has.bind(this),this.set=_e.YAMLMap.prototype.set.bind(this),this.tag=s.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let i of this.items){let r,a;if(ir.isPair(i)?(r=Rs.toJS(i.key,"",t),a=Rs.toJS(i.value,r,t)):r=Rs.toJS(i,"",t),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,a)}return n}static from(e,t,n){let i=rr.createPairs(e,t,n),r=new this;return r.items=i.items,r}};ie.tag="tag:yaml.org,2002:omap";var ac={collection:"seq",identify:s=>s instanceof Map,nodeClass:ie,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){let t=rr.resolvePairs(s,e),n=[];for(let{key:i}of t.items)ir.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new ie,t)},createNode:(s,e,t)=>ie.from(s,e,t)};Ks.YAMLOMap=ie;Ks.omap=ac});var fr=b(Ys=>{"use strict";var ar=T();function or({value:s,source:e},t){return e&&(s?lr:cr).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}var lr={identify:s=>s===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ar.Scalar(!0),stringify:or},cr={identify:s=>s===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ar.Scalar(!1),stringify:or};Ys.falseTag=cr;Ys.trueTag=lr});var ur=b(Pt=>{"use strict";var oc=T(),Vs=pe(),lc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Vs.stringifyNumber},cc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s.replace(/_/g,"")),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():Vs.stringifyNumber(s)}},fc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(s){let e=new oc.Scalar(parseFloat(s.replace(/_/g,""))),t=s.indexOf(".");if(t!==-1){let n=s.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:Vs.stringifyNumber};Pt.float=fc;Pt.floatExp=cc;Pt.floatNaN=lc});var dr=b(De=>{"use strict";var hr=pe(),Be=s=>typeof s=="bigint"||Number.isInteger(s);function Mt(s,e,t,{intAsBigInt:n}){let i=s[0];if((i==="-"||i==="+")&&(e+=1),s=s.substring(e).replace(/_/g,""),n){switch(t){case 2:s=`0b${s}`;break;case 8:s=`0o${s}`;break;case 16:s=`0x${s}`;break}let a=BigInt(s);return i==="-"?BigInt(-1)*a:a}let r=parseInt(s,t);return i==="-"?-1*r:r}function Js(s,e,t){let{value:n}=s;if(Be(n)){let i=n.toString(e);return n<0?"-"+t+i.substr(1):t+i}return hr.stringifyNumber(s)}var uc={identify:Be,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,e,t)=>Mt(s,2,2,t),stringify:s=>Js(s,2,"0b")},hc={identify:Be,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,e,t)=>Mt(s,1,8,t),stringify:s=>Js(s,8,"0")},dc={identify:Be,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,e,t)=>Mt(s,0,10,t),stringify:hr.stringifyNumber},pc={identify:Be,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,e,t)=>Mt(s,2,16,t),stringify:s=>Js(s,16,"0x")};De.int=dc;De.intBin=uc;De.intHex=pc;De.intOct=hc});var Qs=b(Hs=>{"use strict";var Dt=C(),_t=G(),Bt=z(),re=class s extends Bt.YAMLMap{constructor(e){super(e),this.tag=s.tag}add(e){let t;Dt.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new _t.Pair(e.key,null):t=new _t.Pair(e,null),Bt.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let n=Bt.findPair(this.items,e);return!t&&Dt.isPair(n)?Dt.isScalar(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Bt.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new _t.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){let{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let a of t)typeof i=="function"&&(a=i.call(t,a,a)),r.items.push(_t.createPair(a,null,n));return r}};re.tag="tag:yaml.org,2002:set";var mc={collection:"map",identify:s=>s instanceof Set,nodeClass:re,default:!1,tag:"tag:yaml.org,2002:set",createNode:(s,e,t)=>re.from(s,e,t),resolve(s,e){if(Dt.isMap(s)){if(s.hasAllNullValues(!0))return Object.assign(new re,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};Hs.YAMLSet=re;Hs.set=mc});var Gs=b($t=>{"use strict";var gc=pe();function Ws(s,e){let t=s[0],n=t==="-"||t==="+"?s.substring(1):s,i=a=>e?BigInt(a):Number(a),r=n.replace(/_/g,"").split(":").reduce((a,o)=>a*i(60)+i(o),i(0));return t==="-"?i(-1)*r:r}function pr(s){let{value:e}=s,t=a=>a;if(typeof e=="bigint")t=a=>BigInt(a);else if(isNaN(e)||!isFinite(e))return gc.stringifyNumber(s);let n="";e<0&&(n="-",e*=t(-1));let 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))),n+r.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var yc={identify:s=>typeof s=="bigint"||Number.isInteger(s),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(s,e,{intAsBigInt:t})=>Ws(s,t),stringify:pr},bc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:s=>Ws(s,!1),stringify:pr},mr={identify:s=>s 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(s){let e=s.match(mr.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,i,r,a,o]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(t,n-1,i,r||0,a||0,o||0,l),d=e[8];if(d&&d!=="Z"){let f=Ws(d,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:s})=>s.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};$t.floatTime=bc;$t.intTime=yc;$t.timestamp=mr});var br=b(yr=>{"use strict";var wc=he(),Sc=Lt(),vc=de(),kc=Me(),Nc=js(),gr=fr(),Xs=ur(),xt=dr(),Lc=Us(),Ac=Tt(),Ec=Qs(),zs=Gs(),Oc=[wc.map,vc.seq,kc.string,Sc.nullTag,gr.trueTag,gr.falseTag,xt.intBin,xt.intOct,xt.int,xt.intHex,Xs.floatNaN,Xs.floatExp,Xs.float,Nc.binary,Lc.omap,Ac.pairs,Ec.set,zs.intTime,zs.floatTime,zs.timestamp];yr.schema=Oc});var Cr=b(tn=>{"use strict";var kr=he(),Cc=Lt(),Nr=de(),qc=Me(),Ic=Ts(),Zs=Ms(),en=Bs(),Tc=Xi(),Pc=er(),Lr=js(),Ar=Us(),Er=Tt(),wr=br(),Or=Qs(),jt=Gs(),Sr=new Map([["core",Tc.schema],["failsafe",[kr.map,Nr.seq,qc.string]],["json",Pc.schema],["yaml11",wr.schema],["yaml-1.1",wr.schema]]),vr={binary:Lr.binary,bool:Ic.boolTag,float:Zs.float,floatExp:Zs.floatExp,floatNaN:Zs.floatNaN,floatTime:jt.floatTime,int:en.int,intHex:en.intHex,intOct:en.intOct,intTime:jt.intTime,map:kr.map,null:Cc.nullTag,omap:Ar.omap,pairs:Er.pairs,seq:Nr.seq,set:Or.set,timestamp:jt.timestamp},Mc={"tag:yaml.org,2002:binary":Lr.binary,"tag:yaml.org,2002:omap":Ar.omap,"tag:yaml.org,2002:pairs":Er.pairs,"tag:yaml.org,2002:set":Or.set,"tag:yaml.org,2002:timestamp":jt.timestamp};function _c(s,e){let t=Sr.get(e);if(!t)if(Array.isArray(s))t=[];else{let n=Array.from(Sr.keys()).filter(i=>i!=="yaml11").map(i=>JSON.stringify(i)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${n} or define customTags array`)}if(Array.isArray(s))for(let n of s)t=t.concat(n);else typeof s=="function"&&(t=s(t.slice()));return t.map(n=>{if(typeof n!="string")return n;let i=vr[n];if(i)return i;let r=Object.keys(vr).map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown custom tag "${n}"; use one of ${r}`)})}tn.coreKnownTags=Mc;tn.getTags=_c});var rn=b(qr=>{"use strict";var sn=C(),Bc=he(),Dc=de(),$c=Me(),Ft=Cr(),xc=(s,e)=>s.key<e.key?-1:s.key>e.key?1:0,nn=class s{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:r,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?Ft.getTags(e,"compat"):e?Ft.getTags(null,e):null,this.merge=!!n,this.name=typeof r=="string"&&r||"core",this.knownTags=i?Ft.coreKnownTags:{},this.tags=Ft.getTags(t,this.name),this.toStringOptions=o??null,Object.defineProperty(this,sn.MAP,{value:Bc.map}),Object.defineProperty(this,sn.SCALAR,{value:$c.string}),Object.defineProperty(this,sn.SEQ,{value:Dc.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?xc:null}clone(){let e=Object.create(s.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};qr.Schema=nn});var Tr=b(Ir=>{"use strict";var jc=C(),an=Ie(),$e=Ee();function Fc(s,e){let t=[],n=e.directives===!0;if(e.directives!==!1&&s.directives){let l=s.directives.toString(s);l?(t.push(l),n=!0):s.directives.docStart&&(n=!0)}n&&t.push("---");let i=an.createStringifyContext(s,e),{commentString:r}=i.options;if(s.commentBefore){t.length!==1&&t.unshift("");let l=r(s.commentBefore);t.unshift($e.indentComment(l,""))}let a=!1,o=null;if(s.contents){if(jc.isNode(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){let d=r(s.contents.commentBefore);t.push($e.indentComment(d,""))}i.forceBlockIndent=!!s.comment,o=s.contents.comment}let l=o?void 0:()=>a=!0,c=an.stringify(s.contents,i,()=>o=null,l);o&&(c+=$e.lineComment(c,"",r(o))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(an.stringify(s.contents,i));if(s.directives?.docEnd)if(s.comment){let l=r(s.comment);l.includes(`
|
|
55
|
+
`)?(t.push("..."),t.push($e.indentComment(l,""))):t.push(`... ${l}`)}else t.push("...");else{let l=s.comment;l&&a&&(l=l.replace(/^\n+/,"")),l&&((!a||o)&&t[t.length-1]!==""&&t.push(""),t.push($e.indentComment(r(l),"")))}return t.join(`
|
|
56
56
|
`)+`
|
|
57
|
-
`}Ir.stringifyDocument=
|
|
58
|
-
`),o
|
|
57
|
+
`}Ir.stringifyDocument=Fc});var xe=b(Pr=>{"use strict";var Rc=Le(),me=ut(),$=C(),Kc=G(),Uc=J(),Yc=rn(),Vc=Tr(),on=at(),Jc=fs(),Hc=Ae(),ln=cs(),cn=class s{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,$.NODE_TYPE,{value:$.DOC});let i=null;typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);let r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,uniqueKeys:!0,version:"1.2"},n);this.options=r;let{version:a}=r;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new ln.Directives({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(s.prototype,{[$.NODE_TYPE]:{value:$.DOC}});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=$.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){ge(this.contents)&&this.contents.add(e)}addIn(e,t){ge(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=on.anchorNames(this);e.anchor=!t||n.has(t)?on.findNewAnchor(t||"a",n):t}return new Rc.Alias(e.anchor)}createNode(e,t,n){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){let p=S=>typeof S=="number"||S instanceof String||S instanceof Number,v=t.filter(p).map(String);v.length>0&&(t=t.concat(v)),i=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:r,anchorPrefix:a,flow:o,keepUndefined:l,onTagObj:c,tag:d}=n??{},{onAnchor:f,setAnchors:u,sourceObjects:m}=on.createNodeAnchors(this,a||"a"),y={aliasDuplicateObjects:r??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:m},h=Hc.createNode(e,d,y);return o&&$.isCollection(h)&&(h.flow=!0),u(),h}createPair(e,t,n={}){let i=this.createNode(e,null,n),r=this.createNode(t,null,n);return new Kc.Pair(i,r)}delete(e){return ge(this.contents)?this.contents.delete(e):!1}deleteIn(e){return me.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):ge(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return $.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return me.isEmptyPath(e)?!t&&$.isScalar(this.contents)?this.contents.value:this.contents:$.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return $.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return me.isEmptyPath(e)?this.contents!==void 0:$.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=me.collectionFromPath(this.schema,[e],t):ge(this.contents)&&this.contents.set(e,t)}setIn(e,t){me.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=me.collectionFromPath(this.schema,Array.from(e),t):ge(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ln.Directives({version:"1.1"}),n={merge:!0,resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new ln.Directives({version:e}),n={merge:!1,resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let 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(n)this.schema=new Yc.Schema(Object.assign(n,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=Uc.toJS(this.contents,t??"",o);if(typeof r=="function")for(let{count:c,res:d}of o.anchors.values())r(d,c);return typeof a=="function"?Jc.applyReviver(a,{"":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)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return Vc.stringifyDocument(this,e)}};function ge(s){if($.isCollection(s))return!0;throw new Error("Expected a YAML collection as document contents")}Pr.Document=cn});var Re=b(Fe=>{"use strict";var je=class extends Error{constructor(e,t,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=t}},fn=class extends je{constructor(e,t,n){super("YAMLParseError",e,t,n)}},un=class extends je{constructor(e,t,n){super("YAMLWarning",e,t,n)}},Qc=(s,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(o=>e.linePos(o));let{line:n,col:i}=t.linePos[0];t.message+=` at line ${n}, column ${i}`;let r=i-1,a=s.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(r>=60&&a.length>80){let o=Math.min(r-39,a.length-79);a="\u2026"+a.substring(o),r-=o-1}if(a.length>80&&(a=a.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(a.substring(0,r))){let o=s.substring(e.lineStarts[n-2],e.lineStarts[n-1]);o.length>80&&(o=o.substring(0,79)+`\u2026
|
|
58
|
+
`),a=o+a}if(/[^ ]/.test(a)){let o=1,l=t.linePos[1];l&&l.line===n&&l.col>i&&(o=Math.max(1,Math.min(l.col-i,80-r)));let c=" ".repeat(r)+"^".repeat(o);t.message+=`:
|
|
59
59
|
|
|
60
|
-
${
|
|
60
|
+
${a}
|
|
61
61
|
${c}
|
|
62
|
-
`}};Fe.YAMLError=je;Fe.YAMLParseError=
|
|
63
|
-
`))return!0;if(s.end){for(let e of s.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of s.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(
|
|
64
|
-
`+h.comment:
|
|
65
|
-
`+
|
|
66
|
-
`+k.comment:c.comment=k.comment),f=k.end;continue}!
|
|
67
|
-
`+
|
|
68
|
-
`+
|
|
69
|
-
`+p.comment:c.comment=p.comment),c.range=[n.offset,h,p.offset]}else c.range=[n.offset,h,h];return c}Wr.resolveFlowCollection=
|
|
70
|
-
`.repeat(Math.max(1,
|
|
71
|
-
`;for(let h=d;h<
|
|
72
|
-
`):p.length>l||
|
|
62
|
+
`}};Fe.YAMLError=je;Fe.YAMLParseError=fn;Fe.YAMLWarning=un;Fe.prettifyError=Qc});var Ke=b(Mr=>{"use strict";function Wc(s,{flow:e,indicator:t,next:n,offset:i,onError:r,parentIndent:a,startOnNewline:o}){let l=!1,c=o,d=o,f="",u="",m=!1,y=!1,h=null,p=null,v=null,S=null,N=null,L=null,A=null;for(let g of s)switch(y&&(g.type!=="space"&&g.type!=="newline"&&g.type!=="comma"&&r(g.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),h&&(c&&g.type!=="comment"&&g.type!=="newline"&&r(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),g.type){case"space":!e&&(t!=="doc-start"||n?.type!=="flow-collection")&&g.source.includes(" ")&&(h=g),d=!0;break;case"comment":{d||r(g,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let O=g.source.substring(1)||" ";f?f+=u+O:f=O,u="",c=!1;break}case"newline":c?f?f+=g.source:l=!0:u+=g.source,c=!0,m=!0,(p||v)&&(S=g),d=!0;break;case"anchor":p&&r(g,"MULTIPLE_ANCHORS","A node can have at most one anchor"),g.source.endsWith(":")&&r(g.offset+g.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),p=g,A===null&&(A=g.offset),c=!1,d=!1,y=!0;break;case"tag":{v&&r(g,"MULTIPLE_TAGS","A node can have at most one tag"),v=g,A===null&&(A=g.offset),c=!1,d=!1,y=!0;break}case t:(p||v)&&r(g,"BAD_PROP_ORDER",`Anchors and tags must be after the ${g.source} indicator`),L&&r(g,"UNEXPECTED_TOKEN",`Unexpected ${g.source} in ${e??"collection"}`),L=g,c=t==="seq-item-ind"||t==="explicit-key-ind",d=!1;break;case"comma":if(e){N&&r(g,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),N=g,c=!1,d=!1;break}default:r(g,"UNEXPECTED_TOKEN",`Unexpected ${g.type} token`),c=!1,d=!1}let k=s[s.length-1],w=k?k.offset+k.source.length:i;return y&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&r(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(c&&h.indent<=a||n?.type==="block-map"||n?.type==="block-seq")&&r(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:N,found:L,spaceBefore:l,comment:f,hasNewline:m,anchor:p,tag:v,newlineAfterProp:S,end:w,start:A??w}}Mr.resolveProps=Wc});var Rt=b(_r=>{"use strict";function hn(s){if(!s)return null;switch(s.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(s.source.includes(`
|
|
63
|
+
`))return!0;if(s.end){for(let e of s.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of s.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(hn(e.key)||hn(e.value))return!0}return!1;default:return!0}}_r.containsNewline=hn});var dn=b(Br=>{"use strict";var Gc=Rt();function Xc(s,e,t){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===s&&(n.source==="]"||n.source==="}")&&Gc.containsNewline(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Br.flowIndentCheck=Xc});var pn=b($r=>{"use strict";var Dr=C();function zc(s,e,t){let{uniqueKeys:n}=s.options;if(n===!1)return!1;let i=typeof n=="function"?n:(r,a)=>r===a||Dr.isScalar(r)&&Dr.isScalar(a)&&r.value===a.value&&!(r.value==="<<"&&s.schema.merge);return e.some(r=>i(r.key,t))}$r.mapIncludes=zc});var Ur=b(Kr=>{"use strict";var xr=G(),Zc=z(),jr=Ke(),ef=Rt(),Fr=dn(),tf=pn(),Rr="All mapping items must start at the same column";function sf({composeNode:s,composeEmptyNode:e},t,n,i,r){let a=r?.nodeClass??Zc.YAMLMap,o=new a(t.schema);t.atRoot&&(t.atRoot=!1);let l=n.offset,c=null;for(let d of n.items){let{start:f,key:u,sep:m,value:y}=d,h=jr.resolveProps(f,{indicator:"explicit-key-ind",next:u??m?.[0],offset:l,onError:i,parentIndent:n.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!==n.indent&&i(l,"BAD_INDENT",Rr)),!h.anchor&&!h.tag&&!m){c=h.end,h.comment&&(o.comment?o.comment+=`
|
|
64
|
+
`+h.comment:o.comment=h.comment);continue}(h.newlineAfterProp||ef.containsNewline(u))&&i(u??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==n.indent&&i(l,"BAD_INDENT",Rr);let v=h.end,S=u?s(t,u,h,i):e(t,v,f,null,h,i);t.schema.compat&&Fr.flowIndentCheck(n.indent,u,i),tf.mapIncludes(t,o.items,S)&&i(v,"DUPLICATE_KEY","Map keys must be unique");let N=jr.resolveProps(m??[],{indicator:"map-value-ind",next:y,offset:S.range[2],onError:i,parentIndent:n.indent,startOnNewline:!u||u.type==="block-scalar"});if(l=N.end,N.found){p&&(y?.type==="block-map"&&!N.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&h.start<N.found.offset-1024&&i(S.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let L=y?s(t,y,N,i):e(t,l,m,null,N,i);t.schema.compat&&Fr.flowIndentCheck(n.indent,y,i),l=L.range[2];let A=new xr.Pair(S,L);t.options.keepSourceTokens&&(A.srcToken=d),o.items.push(A)}else{p&&i(S.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),N.comment&&(S.comment?S.comment+=`
|
|
65
|
+
`+N.comment:S.comment=N.comment);let L=new xr.Pair(S);t.options.keepSourceTokens&&(L.srcToken=d),o.items.push(L)}}return c&&c<l&&i(c,"IMPOSSIBLE","Map comment with trailing content"),o.range=[n.offset,l,c??l],o}Kr.resolveBlockMap=sf});var Vr=b(Yr=>{"use strict";var nf=Z(),rf=Ke(),af=dn();function of({composeNode:s,composeEmptyNode:e},t,n,i,r){let a=r?.nodeClass??nf.YAMLSeq,o=new a(t.schema);t.atRoot&&(t.atRoot=!1);let l=n.offset,c=null;for(let{start:d,value:f}of n.items){let u=rf.resolveProps(d,{indicator:"seq-item-ind",next:f,offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||f)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&&(o.comment=u.comment);continue}let m=f?s(t,f,u,i):e(t,u.end,d,null,u,i);t.schema.compat&&af.flowIndentCheck(n.indent,f,i),l=m.range[2],o.items.push(m)}return o.range=[n.offset,l,c??l],o}Yr.resolveBlockSeq=of});var ye=b(Jr=>{"use strict";function lf(s,e,t,n){let i="";if(s){let r=!1,a="";for(let o of s){let{source:l,type:c}=o;switch(c){case"space":r=!0;break;case"comment":{t&&!r&&n(o,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let d=l.substring(1)||" ";i?i+=a+d:i=d,a="";break}case"newline":i&&(a+=l),r=!0;break;default:n(o,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:i,offset:e}}Jr.resolveEnd=lf});var Gr=b(Wr=>{"use strict";var cf=C(),ff=G(),Hr=z(),uf=Z(),hf=ye(),Qr=Ke(),df=Rt(),pf=pn(),mn="Block collections are not allowed within flow collections",gn=s=>s&&(s.type==="block-map"||s.type==="block-seq");function mf({composeNode:s,composeEmptyNode:e},t,n,i,r){let a=n.start.source==="{",o=a?"flow map":"flow sequence",l=r?.nodeClass??(a?Hr.YAMLMap:uf.YAMLSeq),c=new l(t.schema);c.flow=!0;let d=t.atRoot;d&&(t.atRoot=!1);let f=n.offset+n.start.source.length;for(let p=0;p<n.items.length;++p){let v=n.items[p],{start:S,key:N,sep:L,value:A}=v,k=Qr.resolveProps(S,{flow:o,indicator:"explicit-key-ind",next:N??L?.[0],offset:f,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!k.found){if(!k.anchor&&!k.tag&&!L&&!A){p===0&&k.comma?i(k.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`):p<n.items.length-1&&i(k.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${o}`),k.comment&&(c.comment?c.comment+=`
|
|
66
|
+
`+k.comment:c.comment=k.comment),f=k.end;continue}!a&&t.options.strict&&df.containsNewline(N)&&i(N,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(p===0)k.comma&&i(k.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`);else if(k.comma||i(k.start,"MISSING_CHAR",`Missing , between ${o} items`),k.comment){let w="";e:for(let g of S)switch(g.type){case"comma":case"space":break;case"comment":w=g.source.substring(1);break e;default:break e}if(w){let g=c.items[c.items.length-1];cf.isPair(g)&&(g=g.value??g.key),g.comment?g.comment+=`
|
|
67
|
+
`+w:g.comment=w,k.comment=k.comment.substring(w.length+1)}}if(!a&&!L&&!k.found){let w=A?s(t,A,k,i):e(t,k.end,L,null,k,i);c.items.push(w),f=w.range[2],gn(A)&&i(w.range,"BLOCK_IN_FLOW",mn)}else{let w=k.end,g=N?s(t,N,k,i):e(t,w,S,null,k,i);gn(N)&&i(g.range,"BLOCK_IN_FLOW",mn);let O=Qr.resolveProps(L??[],{flow:o,indicator:"map-value-ind",next:A,offset:g.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(O.found){if(!a&&!k.found&&t.options.strict){if(L)for(let I of L){if(I===O.found)break;if(I.type==="newline"){i(I,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}k.start<O.found.offset-1024&&i(O.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else A&&("source"in A&&A.source&&A.source[0]===":"?i(A,"MISSING_CHAR",`Missing space after : in ${o}`):i(O.start,"MISSING_CHAR",`Missing , or : between ${o} items`));let M=A?s(t,A,O,i):O.found?e(t,O.end,L,null,O,i):null;M?gn(A)&&i(M.range,"BLOCK_IN_FLOW",mn):O.comment&&(g.comment?g.comment+=`
|
|
68
|
+
`+O.comment:g.comment=O.comment);let Y=new ff.Pair(g,M);if(t.options.keepSourceTokens&&(Y.srcToken=v),a){let I=c;pf.mapIncludes(t,I.items,g)&&i(w,"DUPLICATE_KEY","Map keys must be unique"),I.items.push(Y)}else{let I=new Hr.YAMLMap(t.schema);I.flow=!0,I.items.push(Y);let Qe=(M??g).range;I.range=[g.range[0],Qe[1],Qe[2]],c.items.push(I)}f=M?M.range[2]:O.end}}let u=a?"}":"]",[m,...y]=n.end,h=f;if(m&&m.source===u)h=m.offset+m.source.length;else{let p=o[0].toUpperCase()+o.substring(1),v=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",v),m&&m.source.length!==1&&y.unshift(m)}if(y.length>0){let p=hf.resolveEnd(y,h,t.options.strict,i);p.comment&&(c.comment?c.comment+=`
|
|
69
|
+
`+p.comment:c.comment=p.comment),c.range=[n.offset,h,p.offset]}else c.range=[n.offset,h,h];return c}Wr.resolveFlowCollection=mf});var zr=b(Xr=>{"use strict";var gf=C(),yf=T(),bf=z(),wf=Z(),Sf=Ur(),vf=Vr(),kf=Gr();function yn(s,e,t,n,i,r){let a=t.type==="block-map"?Sf.resolveBlockMap(s,e,t,n,r):t.type==="block-seq"?vf.resolveBlockSeq(s,e,t,n,r):kf.resolveFlowCollection(s,e,t,n,r),o=a.constructor;return i==="!"||i===o.tagName?(a.tag=o.tagName,a):(i&&(a.tag=i),a)}function Nf(s,e,t,n,i){let r=n.tag,a=r?e.directives.tagName(r.source,u=>i(r,"TAG_RESOLVE_FAILED",u)):null;if(t.type==="block-seq"){let{anchor:u,newlineAfterProp:m}=n,y=u&&r?u.offset>r.offset?u:r:u??r;y&&(!m||m.offset<y.offset)&&i(y,"MISSING_CHAR","Missing newline after block sequence props")}let o=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!r||!a||a==="!"||a===bf.YAMLMap.tagName&&o==="map"||a===wf.YAMLSeq.tagName&&o==="seq")return yn(s,e,t,i,a);let l=e.schema.tags.find(u=>u.tag===a&&u.collection===o);if(!l){let u=e.schema.knownTags[a];if(u&&u.collection===o)e.schema.tags.push(Object.assign({},u,{default:!1})),l=u;else return u?.collection?i(r,"BAD_COLLECTION_TYPE",`${u.tag} used for ${o} collection, but expects ${u.collection}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),yn(s,e,t,i,a)}let c=yn(s,e,t,i,a,l),d=l.resolve?.(c,u=>i(r,"TAG_RESOLVE_FAILED",u),e.options)??c,f=gf.isNode(d)?d:new yf.Scalar(d);return f.range=c.range,f.tag=a,l?.format&&(f.format=l.format),f}Xr.composeCollection=Nf});var wn=b(Zr=>{"use strict";var bn=T();function Lf(s,e,t){let n=e.offset,i=Af(e,s.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let r=i.mode===">"?bn.Scalar.BLOCK_FOLDED:bn.Scalar.BLOCK_LITERAL,a=e.source?Ef(e.source):[],o=a.length;for(let h=a.length-1;h>=0;--h){let p=a[h][1];if(p===""||p==="\r")o=h;else break}if(o===0){let h=i.chomp==="+"&&a.length>0?`
|
|
70
|
+
`.repeat(Math.max(1,a.length-1)):"",p=n+i.length;return e.source&&(p+=e.source.length),{value:h,type:r,comment:i.comment,range:[n,p,p]}}let l=e.indent+i.indent,c=e.offset+i.length,d=0;for(let h=0;h<o;++h){let[p,v]=a[h];if(v===""||v==="\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&&!s.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=p.length+v.length+1}for(let h=a.length-1;h>=o;--h)a[h][0].length>l&&(o=h+1);let f="",u="",m=!1;for(let h=0;h<d;++h)f+=a[h][0].slice(l)+`
|
|
71
|
+
`;for(let h=d;h<o;++h){let[p,v]=a[h];c+=p.length+v.length+1;let S=v[v.length-1]==="\r";if(S&&(v=v.slice(0,-1)),v&&p.length<l){let L=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(c-v.length-(S?2:1),"BAD_INDENT",L),p=""}r===bn.Scalar.BLOCK_LITERAL?(f+=u+p.slice(l)+v,u=`
|
|
72
|
+
`):p.length>l||v[0]===" "?(u===" "?u=`
|
|
73
73
|
`:!m&&u===`
|
|
74
74
|
`&&(u=`
|
|
75
75
|
|
|
76
|
-
`),f+=u+p.slice(l)+
|
|
77
|
-
`,m=!0):
|
|
76
|
+
`),f+=u+p.slice(l)+v,u=`
|
|
77
|
+
`,m=!0):v===""?u===`
|
|
78
78
|
`?f+=`
|
|
79
79
|
`:u=`
|
|
80
|
-
`:(f+=u+
|
|
81
|
-
`+
|
|
80
|
+
`:(f+=u+v,u=" ",m=!1)}switch(i.chomp){case"-":break;case"+":for(let h=o;h<a.length;++h)f+=`
|
|
81
|
+
`+a[h][0].slice(l);f[f.length-1]!==`
|
|
82
82
|
`&&(f+=`
|
|
83
83
|
`);break;default:f+=`
|
|
84
|
-
`}let
|
|
84
|
+
`}let y=n+i.length+e.source.length;return{value:f,type:r,comment:i.comment,range:[n,y,y]}}function Af({offset:s,props:e},t,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],r=i[0],a=0,o="",l=-1;for(let u=1;u<i.length;++u){let m=i[u];if(!o&&(m==="-"||m==="+"))o=m;else{let y=Number(m);!a&&y?a=y:l===-1&&(l=s+u)}}l!==-1&&n(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){let m=e[u];switch(m.type){case"space":c=!0;case"newline":f+=m.source.length;break;case"comment":t&&!c&&n(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":n(m,"UNEXPECTED_TOKEN",m.message),f+=m.source.length;break;default:{let y=`Unexpected token in block scalar header: ${m.type}`;n(m,"UNEXPECTED_TOKEN",y);let h=m.source;h&&typeof h=="string"&&(f+=h.length)}}}return{mode:r,indent:a,chomp:o,comment:d,length:f}}function Ef(s){let e=s.split(/\n( *)/),t=e[0],n=t.match(/^( *)/),r=[n?.[1]?[n[1],t.slice(n[1].length)]:["",t]];for(let a=1;a<e.length;a+=2)r.push([e[a],e[a+1]]);return r}Zr.resolveBlockScalar=Lf});var vn=b(ta=>{"use strict";var Sn=T(),Of=ye();function Cf(s,e,t){let{offset:n,type:i,source:r,end:a}=s,o,l,c=(u,m,y)=>t(n+u,m,y);switch(i){case"scalar":o=Sn.Scalar.PLAIN,l=qf(r,c);break;case"single-quoted-scalar":o=Sn.Scalar.QUOTE_SINGLE,l=If(r,c);break;case"double-quoted-scalar":o=Sn.Scalar.QUOTE_DOUBLE,l=Tf(r,c);break;default:return t(s,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+r.length,n+r.length]}}let d=n+r.length,f=Of.resolveEnd(a,d,e,t);return{value:l,type:o,comment:f.comment,range:[n,d,f.offset]}}function qf(s,e){let t="";switch(s[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 ${s[0]}`;break}case"@":case"`":{t=`reserved character ${s[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),ea(s)}function If(s,e){return(s[s.length-1]!=="'"||s.length===1)&&e(s.length,"MISSING_CHAR","Missing closing 'quote"),ea(s.slice(1,-1)).replace(/''/g,"'")}function ea(s){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
85
85
|
`,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
86
|
-
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(s);if(!n)return s;let i=n[1],r=" ",
|
|
86
|
+
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(s);if(!n)return s;let i=n[1],r=" ",a=e.lastIndex;for(t.lastIndex=a;n=t.exec(s);)n[1]===""?r===`
|
|
87
87
|
`?i+=r:r=`
|
|
88
|
-
`:(i+=r+n[1],r=" "),
|
|
88
|
+
`:(i+=r+n[1],r=" "),a=t.lastIndex;let o=/[ \t]*(.*)/sy;return o.lastIndex=a,n=o.exec(s),i+r+(n?.[1]??"")}function Tf(s,e){let t="";for(let n=1;n<s.length-1;++n){let i=s[n];if(!(i==="\r"&&s[n+1]===`
|
|
89
89
|
`))if(i===`
|
|
90
|
-
`){let{fold:r,offset:
|
|
90
|
+
`){let{fold:r,offset:a}=Pf(s,n);t+=r,n=a}else if(i==="\\"){let r=s[++n],a=Mf[r];if(a)t+=a;else if(r===`
|
|
91
91
|
`)for(r=s[n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="\r"&&s[n+1]===`
|
|
92
|
-
`)for(r=s[++n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="x"||r==="u"||r==="U"){let
|
|
93
|
-
`&&!(
|
|
94
|
-
`)&&(t+=n>r?s.slice(r,n+1):i)}else t+=i}return(s[s.length-1]!=='"'||s.length===1)&&e(s.length,"MISSING_CHAR",'Missing closing "quote'),t}function
|
|
92
|
+
`)for(r=s[++n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="x"||r==="u"||r==="U"){let o={x:2,u:4,U:8}[r];t+=_f(s,n+1,o,e),n+=o}else{let o=s.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),t+=o}}else if(i===" "||i===" "){let r=n,a=s[n+1];for(;a===" "||a===" ";)a=s[++n+1];a!==`
|
|
93
|
+
`&&!(a==="\r"&&s[n+2]===`
|
|
94
|
+
`)&&(t+=n>r?s.slice(r,n+1):i)}else t+=i}return(s[s.length-1]!=='"'||s.length===1)&&e(s.length,"MISSING_CHAR",'Missing closing "quote'),t}function Pf(s,e){let t="",n=s[e+1];for(;(n===" "||n===" "||n===`
|
|
95
95
|
`||n==="\r")&&!(n==="\r"&&s[e+2]!==`
|
|
96
96
|
`);)n===`
|
|
97
97
|
`&&(t+=`
|
|
98
|
-
`),e+=1,n=s[e+1];return t||(t=" "),{fold:t,offset:e}}var
|
|
99
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
98
|
+
`),e+=1,n=s[e+1];return t||(t=" "),{fold:t,offset:e}}var Mf={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
99
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function _f(s,e,t,n){let i=s.substr(e,t),a=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(a)){let o=s.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),o}return String.fromCodePoint(a)}ta.resolveFlowScalar=Cf});var ia=b(na=>{"use strict";var be=C(),sa=T(),Bf=wn(),Df=vn();function $f(s,e,t,n){let{value:i,type:r,comment:a,range:o}=e.type==="block-scalar"?Bf.resolveBlockScalar(s,e,n):Df.resolveFlowScalar(e,s.options.strict,n),l=t?s.directives.tagName(t.source,f=>n(t,"TAG_RESOLVE_FAILED",f)):null,c=t&&l?xf(s.schema,i,l,t,n):e.type==="scalar"?jf(s,i,e,n):s.schema[be.SCALAR],d;try{let f=c.resolve(i,u=>n(t??e,"TAG_RESOLVE_FAILED",u),s.options);d=be.isScalar(f)?f:new sa.Scalar(f)}catch(f){let u=f instanceof Error?f.message:String(f);n(t??e,"TAG_RESOLVE_FAILED",u),d=new sa.Scalar(i)}return d.range=o,d.source=i,r&&(d.type=r),l&&(d.tag=l),c.format&&(d.format=c.format),a&&(d.comment=a),d}function xf(s,e,t,n,i){if(t==="!")return s[be.SCALAR];let r=[];for(let o of s.tags)if(!o.collection&&o.tag===t)if(o.default&&o.test)r.push(o);else return o;for(let o of r)if(o.test?.test(e))return o;let a=s.knownTags[t];return a&&!a.collection?(s.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),s[be.SCALAR])}function jf({directives:s,schema:e},t,n,i){let r=e.tags.find(a=>a.default&&a.test?.test(t))||e[be.SCALAR];if(e.compat){let a=e.compat.find(o=>o.default&&o.test?.test(t))??e[be.SCALAR];if(r.tag!==a.tag){let o=s.tagString(r.tag),l=s.tagString(a.tag),c=`Value may be parsed as either ${o} or ${l}`;i(n,"TAG_RESOLVE_FAILED",c,!0)}}return r}na.composeScalar=$f});var aa=b(ra=>{"use strict";function Ff(s,e,t){if(e){t===null&&(t=e.length);for(let n=t-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":s-=i.source.length;continue}for(i=e[++n];i?.type==="space";)s+=i.source.length,i=e[++n];break}}return s}ra.emptyScalarPosition=Ff});var ca=b(Nn=>{"use strict";var Rf=Le(),Kf=zr(),oa=ia(),Uf=ye(),Yf=aa(),Vf={composeNode:la,composeEmptyNode:kn};function la(s,e,t,n){let{spaceBefore:i,comment:r,anchor:a,tag:o}=t,l,c=!0;switch(e.type){case"alias":l=Jf(s,e,n),(a||o)&&n(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":l=oa.composeScalar(s,e,o,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=Kf.composeCollection(Vf,s,e,t,n),a&&(l.anchor=a.source.substring(1));break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",d),l=kn(s,e.offset,void 0,null,t,n),c=!1}}return a&&l.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&(l.spaceBefore=!0),r&&(e.type==="scalar"&&e.source===""?l.comment=r:l.commentBefore=r),s.options.keepSourceTokens&&c&&(l.srcToken=e),l}function kn(s,e,t,n,{spaceBefore:i,comment:r,anchor:a,tag:o,end:l},c){let d={type:"scalar",offset:Yf.emptyScalarPosition(e,t,n),indent:-1,source:""},f=oa.composeScalar(s,d,o,c);return a&&(f.anchor=a.source.substring(1),f.anchor===""&&c(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=l),f}function Jf({options:s},{offset:e,source:t,end:n},i){let r=new Rf.Alias(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);let a=e+t.length,o=Uf.resolveEnd(n,a,s.strict,i);return r.range=[e,a,o.offset],o.comment&&(r.comment=o.comment),r}Nn.composeEmptyNode=kn;Nn.composeNode=la});var ha=b(ua=>{"use strict";var Hf=xe(),fa=ca(),Qf=ye(),Wf=Ke();function Gf(s,e,{offset:t,start:n,value:i,end:r},a){let o=Object.assign({_directives:e},s),l=new Hf.Document(void 0,o),c={atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},d=Wf.resolveProps(n,{indicator:"doc-start",next:i??r?.[0],offset:t,onError:a,parentIndent:0,startOnNewline:!0});d.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!d.hasNewline&&a(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?fa.composeNode(c,i,d,a):fa.composeEmptyNode(c,d.end,n,null,d,a);let f=l.contents.range[2],u=Qf.resolveEnd(r,f,!1,a);return u.comment&&(l.comment=u.comment),l.range=[t,f,u.offset],l}ua.composeDoc=Gf});var An=b(ma=>{"use strict";var Xf=cs(),zf=xe(),Ue=Re(),da=C(),Zf=ha(),eu=ye();function Ye(s){if(typeof s=="number")return[s,s+1];if(Array.isArray(s))return s.length===2?s:[s[0],s[1]];let{offset:e,source:t}=s;return[e,e+(typeof t=="string"?t.length:1)]}function pa(s){let e="",t=!1,n=!1;for(let i=0;i<s.length;++i){let r=s[i];switch(r[0]){case"#":e+=(e===""?"":n?`
|
|
100
100
|
|
|
101
101
|
`:`
|
|
102
|
-
`)+(r.substring(1)||" "),t=!0,n=!1;break;case"%":s[i+1]?.[0]!=="#"&&(i+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}var
|
|
103
|
-
${n}`:n;else if(i||e.directives.docStart||!r)e.commentBefore=n;else if(
|
|
104
|
-
${
|
|
105
|
-
${
|
|
106
|
-
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Ue.YAMLParseError(Ye(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){let n=Object.assign({_directives:this.directives},this.options),i=new
|
|
107
|
-
`}];switch(
|
|
108
|
-
`),d=
|
|
109
|
-
`,u=[{type:"block-scalar-header",offset:r,indent:n,source:d}];return
|
|
110
|
-
`}),{type:"block-scalar",offset:r,indent:n,props:u,source:f}}case'"':return{type:"double-quoted-scalar",offset:r,indent:n,source:
|
|
102
|
+
`)+(r.substring(1)||" "),t=!0,n=!1;break;case"%":s[i+1]?.[0]!=="#"&&(i+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}var Ln=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,i,r)=>{let a=Ye(t);r?this.warnings.push(new Ue.YAMLWarning(a,n,i)):this.errors.push(new Ue.YAMLParseError(a,n,i))},this.directives=new Xf.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:i}=pa(this.prelude);if(n){let r=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
103
|
+
${n}`:n;else if(i||e.directives.docStart||!r)e.commentBefore=n;else if(da.isCollection(r)&&!r.flow&&r.items.length>0){let a=r.items[0];da.isPair(a)&&(a=a.key);let o=a.commentBefore;a.commentBefore=o?`${n}
|
|
104
|
+
${o}`:n}else{let a=r.commentBefore;r.commentBefore=a?`${n}
|
|
105
|
+
${a}`:n}}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:pa(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(t,n)}*next(e){switch(process.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,n,i)=>{let r=Ye(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=Zf.composeDoc(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":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Ue.YAMLParseError(Ye(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Ue.YAMLParseError(Ye(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let t=eu.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
|
|
106
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Ue.YAMLParseError(Ye(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){let n=Object.assign({_directives:this.directives},this.options),i=new zf.Document(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}};ma.Composer=Ln});var ba=b(Kt=>{"use strict";var tu=wn(),su=vn(),nu=Re(),ga=qe();function iu(s,e=!0,t){if(s){let n=(i,r,a)=>{let o=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(t)t(o,r,a);else throw new nu.YAMLParseError([o,o+1],r,a)};switch(s.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return su.resolveFlowScalar(s,e,n);case"block-scalar":return tu.resolveBlockScalar({options:{strict:e}},s,n)}}return null}function ru(s,e){let{implicitKey:t=!1,indent:n,inFlow:i=!1,offset:r=-1,type:a="PLAIN"}=e,o=ga.stringifyString({type:a,value:s},{implicitKey:t,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:n,source:`
|
|
107
|
+
`}];switch(o[0]){case"|":case">":{let c=o.indexOf(`
|
|
108
|
+
`),d=o.substring(0,c),f=o.substring(c+1)+`
|
|
109
|
+
`,u=[{type:"block-scalar-header",offset:r,indent:n,source:d}];return ya(u,l)||u.push({type:"newline",offset:-1,indent:n,source:`
|
|
110
|
+
`}),{type:"block-scalar",offset:r,indent:n,props:u,source:f}}case'"':return{type:"double-quoted-scalar",offset:r,indent:n,source:o,end:l};case"'":return{type:"single-quoted-scalar",offset:r,indent:n,source:o,end:l};default:return{type:"scalar",offset:r,indent:n,source:o,end:l}}}function au(s,e,t={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:r=!1,type:a}=t,o="indent"in s?s.indent:null;if(n&&typeof o=="number"&&(o+=2),!a)switch(s.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{let c=s.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}let l=ga.stringifyString({type:a,value:e},{implicitKey:i||o===null,indent:o!==null&&o>0?" ".repeat(o):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":ou(s,l);break;case'"':En(s,l,"double-quoted-scalar");break;case"'":En(s,l,"single-quoted-scalar");break;default:En(s,l,"scalar")}}function ou(s,e){let t=e.indexOf(`
|
|
111
111
|
`),n=e.substring(0,t),i=e.substring(t+1)+`
|
|
112
|
-
`;if(s.type==="block-scalar"){let r=s.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=n,s.source=i}else{let{offset:r}=s,
|
|
113
|
-
`});for(let l of Object.keys(s))l!=="type"&&l!=="offset"&&delete s[l];Object.assign(s,{type:"block-scalar",indent:
|
|
114
|
-
`};delete s.items,Object.assign(s,{type:t,source:e,end:[i]});break}default:{let n="indent"in s?s.indent:-1,i="end"in s&&Array.isArray(s.end)?s.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(let r of Object.keys(s))r!=="type"&&r!=="offset"&&delete s[r];Object.assign(s,{type:t,indent:n,source:e,end:i})}}}
|
|
112
|
+
`;if(s.type==="block-scalar"){let r=s.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=n,s.source=i}else{let{offset:r}=s,a="indent"in s?s.indent:-1,o=[{type:"block-scalar-header",offset:r,indent:a,source:n}];ya(o,"end"in s?s.end:void 0)||o.push({type:"newline",offset:-1,indent:a,source:`
|
|
113
|
+
`});for(let l of Object.keys(s))l!=="type"&&l!=="offset"&&delete s[l];Object.assign(s,{type:"block-scalar",indent:a,props:o,source:i})}}function ya(s,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":s.push(t);break;case"newline":return s.push(t),!0}return!1}function En(s,e,t){switch(s.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":s.type=t,s.source=e;break;case"block-scalar":{let n=s.props.slice(1),i=e.length;s.props[0].type==="block-scalar-header"&&(i-=s.props[0].source.length);for(let r of n)r.offset+=i;delete s.props,Object.assign(s,{type:t,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:s.offset+e.length,indent:s.indent,source:`
|
|
114
|
+
`};delete s.items,Object.assign(s,{type:t,source:e,end:[i]});break}default:{let n="indent"in s?s.indent:-1,i="end"in s&&Array.isArray(s.end)?s.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(let r of Object.keys(s))r!=="type"&&r!=="offset"&&delete s[r];Object.assign(s,{type:t,indent:n,source:e,end:i})}}}Kt.createScalarToken=ru;Kt.resolveAsScalar=iu;Kt.setScalarValue=au});var Sa=b(wa=>{"use strict";var lu=s=>"type"in s?Yt(s):Ut(s);function Yt(s){switch(s.type){case"block-scalar":{let e="";for(let t of s.props)e+=Yt(t);return e+s.source}case"block-map":case"block-seq":{let e="";for(let t of s.items)e+=Ut(t);return e}case"flow-collection":{let e=s.start.source;for(let t of s.items)e+=Ut(t);for(let t of s.end)e+=t.source;return e}case"document":{let e=Ut(s);if(s.end)for(let t of s.end)e+=t.source;return e}default:{let e=s.source;if("end"in s&&s.end)for(let t of s.end)e+=t.source;return e}}}function Ut({start:s,key:e,sep:t,value:n}){let i="";for(let r of s)i+=r.source;if(e&&(i+=Yt(e)),t)for(let r of t)i+=r.source;return n&&(i+=Yt(n)),i}wa.stringify=lu});var La=b(Na=>{"use strict";var On=Symbol("break visit"),cu=Symbol("skip children"),va=Symbol("remove item");function ae(s,e){"type"in s&&s.type==="document"&&(s={start:s.start,value:s.value}),ka(Object.freeze([]),s,e)}ae.BREAK=On;ae.SKIP=cu;ae.REMOVE=va;ae.itemAtPath=(s,e)=>{let t=s;for(let[n,i]of e){let r=t?.[n];if(r&&"items"in r)t=r.items[i];else return}return t};ae.parentCollection=(s,e)=>{let t=ae.itemAtPath(s,e.slice(0,-1)),n=e[e.length-1][0],i=t?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function ka(s,e,t){let n=t(e,s);if(typeof n=="symbol")return n;for(let i of["key","value"]){let r=e[i];if(r&&"items"in r){for(let a=0;a<r.items.length;++a){let o=ka(Object.freeze(s.concat([[i,a]])),r.items[a],t);if(typeof o=="number")a=o-1;else{if(o===On)return On;o===va&&(r.items.splice(a,1),a-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,s))}}return typeof n=="function"?n(e,s):n}Na.visit=ae});var Vt=b(D=>{"use strict";var Cn=ba(),fu=Sa(),uu=La(),qn="\uFEFF",In="",Tn="",Pn="",hu=s=>!!s&&"items"in s,du=s=>!!s&&(s.type==="scalar"||s.type==="single-quoted-scalar"||s.type==="double-quoted-scalar"||s.type==="block-scalar");function pu(s){switch(s){case qn:return"<BOM>";case In:return"<DOC>";case Tn:return"<FLOW_END>";case Pn:return"<SCALAR>";default:return JSON.stringify(s)}}function mu(s){switch(s){case qn:return"byte-order-mark";case In:return"doc-mode";case Tn:return"flow-error-end";case Pn:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
115
115
|
`:case`\r
|
|
116
|
-
`: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(s[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}
|
|
117
|
-
`:case"\r":case" ":return!0;default:return!1}}var
|
|
118
|
-
\r `),
|
|
116
|
+
`: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(s[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}D.createScalarToken=Cn.createScalarToken;D.resolveAsScalar=Cn.resolveAsScalar;D.setScalarValue=Cn.setScalarValue;D.stringify=fu.stringify;D.visit=uu.visit;D.BOM=qn;D.DOCUMENT=In;D.FLOW_END=Tn;D.SCALAR=Pn;D.isCollection=hu;D.isScalar=du;D.prettyToken=pu;D.tokenType=mu});var Bn=b(Ea=>{"use strict";var Ve=Vt();function x(s){switch(s){case void 0:case" ":case`
|
|
117
|
+
`:case"\r":case" ":return!0;default:return!1}}var Aa=new Set("0123456789ABCDEFabcdef"),gu=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Jt=new Set(",[]{}"),yu=new Set(` ,[]{}
|
|
118
|
+
\r `),Mn=s=>!s||yu.has(s),_n=class{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 n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
|
|
119
119
|
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
120
120
|
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===" ";)t=this.buffer[++n+e];if(t==="\r"){let i=this.buffer[n+e+1];if(i===`
|
|
121
121
|
`||!i&&!this.atEnd)return e+n+1}return t===`
|
|
122
|
-
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")
|
|
123
|
-
`,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]===Ve.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,n=e.indexOf("#");for(;n!==-1;){let r=e[n-1];if(r===" "||r===" "){t=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let r=e[t-1];if(r===" "||r===" ")t-=1;else break}let i=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield Ve.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let 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");let t=this.peek(3);if((t==="---"||t==="...")
|
|
122
|
+
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&x(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(`
|
|
123
|
+
`,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]===Ve.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,n=e.indexOf("#");for(;n!==-1;){let r=e[n-1];if(r===" "||r===" "){t=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let r=e[t-1];if(r===" "||r===" ")t-=1;else break}let i=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield Ve.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let 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");let t=this.peek(3);if((t==="---"||t==="...")&&x(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&&!x(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&x(t)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let 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(Mn),"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,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&x(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield Ve.FLOW_END,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(Mn),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let a=this.charAt(1);if(this.flowKey||x(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),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)}let n=this.buffer.substring(0,t),i=n.indexOf(`
|
|
124
124
|
`,this.pos);if(i!==-1){for(;i!==-1;){let r=this.continueScalar(i+1);if(r===-1)break;i=n.indexOf(`
|
|
125
|
-
`,r)}i!==-1&&(t=i-(n[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(;;){let 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
|
|
126
|
-
`:e=r,t=0;break;case"\r":{let
|
|
125
|
+
`,r)}i!==-1&&(t=i-(n[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(;;){let 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=>x(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case" ":t+=1;break;case`
|
|
126
|
+
`:e=r,t=0;break;case"\r":{let a=this.buffer[r+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
|
|
127
127
|
`)break}default:break e}if(!n&&!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{let r=this.continueScalar(e+1);if(r===-1)break;e=this.buffer.indexOf(`
|
|
128
128
|
`,r)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
|
|
129
|
-
`;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,
|
|
130
|
-
`&&r>=this.pos&&r+1+t>
|
|
129
|
+
`;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,a=this.buffer[r];a==="\r"&&(a=this.buffer[--r]);let o=r;for(;a===" ";)a=this.buffer[--r];if(a===`
|
|
130
|
+
`&&r>=this.pos&&r+1+t>o)e=r;else break}while(!0);return yield Ve.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let r=this.buffer[n+1];if(x(r)||e&&Jt.has(r))break;t=n}else if(x(i)){let r=this.buffer[n+1];if(i==="\r"&&(r===`
|
|
131
131
|
`?(n+=1,i=`
|
|
132
|
-
`,r=this.buffer[n+1]):t=n),r==="#"||e&&
|
|
133
|
-
`){let
|
|
132
|
+
`,r=this.buffer[n+1]):t=n),r==="#"||e&&Jt.has(r))break;if(i===`
|
|
133
|
+
`){let a=this.continueScalar(n+1);if(a===-1)break;n=Math.max(n,a-2)}}else{if(e&&Jt.has(i))break;t=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Ve.SCALAR,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){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.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(Mn))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,t=this.charAt(1);if(x(t)||e&&Jt.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(;!x(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(gu.has(t))t=this.buffer[++e];else if(t==="%"&&Aa.has(this.buffer[e+1])&&Aa.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
134
134
|
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
135
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");let i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};
|
|
135
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");let i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};Ea.Lexer=_n});var $n=b(Oa=>{"use strict";var Dn=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let i=this.lineStarts[t-1];return{line:t,col:e-i+1}}}};Oa.LineCounter=Dn});var jn=b(Pa=>{"use strict";var Ca=Vt(),bu=Bn();function oe(s,e){for(let t=0;t<s.length;++t)if(s[t].type===e)return!0;return!1}function qa(s){for(let e=0;e<s.length;++e)switch(s[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Ta(s){switch(s?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Ht(s){switch(s.type){case"document":return s.start;case"block-map":{let e=s.items[s.items.length-1];return e.sep??e.start}case"block-seq":return s.items[s.items.length-1].start;default:return[]}}function we(s){if(s.length===0)return[];let e=s.length;e:for(;--e>=0;)switch(s[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;s[++e]?.type==="space";);return s.splice(e,s.length)}function Ia(s){if(s.start.type==="flow-seq-start")for(let e of s.items)e.sep&&!e.value&&!oe(e.start,"explicit-key-ind")&&!oe(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Ta(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)}var xn=class{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 bu.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,process.env.LOG_TOKENS&&console.log("|",Ca.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Ca.tokenType(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{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,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(){let e=this.peek(1);if(this.type==="doc-end"&&(!e||e.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let 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{let n=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in n?n.indent:0:t.type==="flow-collection"&&n.type==="document"&&(t.indent=0),t.type==="flow-collection"&&Ia(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.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":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.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((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&qa(i.start)===-1&&(t.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<t.indent))&&(n.type==="document"?n.end=i.start:n.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":{let 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":{qa(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}let 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"){let t=Ht(this.peek(2)),n=we(t),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,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(`
|
|
136
136
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
137
|
-
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.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)){let 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){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",r=[];if(i&&t.sep&&!t.value){let
|
|
137
|
+
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.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)){let 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){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",r=[];if(i&&t.sep&&!t.value){let a=[];for(let o=0;o<t.sep.length;++o){let l=t.sep[o];switch(l.type){case"newline":a.push(o);break;case"space":break;case"comment":l.indent>e.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(r=t.sep.splice(a[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(oe(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(Ta(t.key)&&!oe(t.sep,"newline")){let a=we(t.start),o=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:a,key:o,sep:l}]})}else r.length>0?t.sep=t.sep.concat(r,this.sourceToken):t.sep.push(this.sourceToken);else if(oe(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let a=we(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||i?e.items.push({start:r,key:null,sep:[this.sourceToken]}):oe(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":{let a=this.flowScalar(this.type);i||t.value?(e.items.push({start:r,key:a,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(a):(Object.assign(t,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{let a=this.startBlockValue(e);if(a){n&&a.type!=="block-seq"&&e.items.push({start:r}),this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.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)){let 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||oe(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n&&n.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":{let 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}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=Ht(n),r=we(i);Ia(e);let a=e.end.splice(1,e.end.length);a.push(this.sourceToken);let o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
138
138
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
139
|
-
`,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;let t=Vt(e),n=we(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Vt(e),n=we(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Mo.Parser=Bn});var xo=y(He=>{"use strict";var _o=kn(),yf=xe(),Je=Re(),bf=ws(),wf=_n(),Bo=Dn();function Do(s){let e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new wf.LineCounter||null,prettyErrors:e}}function Sf(s,e={}){let{lineCounter:t,prettyErrors:n}=Do(e),i=new Bo.Parser(t?.addNewLine),r=new _o.Composer(e),o=Array.from(r.compose(i.parse(s)));if(n&&t)for(let a of o)a.errors.forEach(Je.prettifyError(s,t)),a.warnings.forEach(Je.prettifyError(s,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function $o(s,e={}){let{lineCounter:t,prettyErrors:n}=Do(e),i=new Bo.Parser(t?.addNewLine),r=new _o.Composer(e),o=null;for(let a of r.compose(i.parse(s),!0,s.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Je.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(o.errors.forEach(Je.prettifyError(s,t)),o.warnings.forEach(Je.prettifyError(s,t))),o}function vf(s,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);let i=$o(s,t);if(!i)return null;if(i.warnings.forEach(r=>bf.warn(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},t))}function kf(s,e,t){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let i=Math.round(t);t=i<1?void 0:i>8?{indent:8}:{indent:i}}if(s===void 0){let{keepUndefined:i}=t??e??{};if(!i)return}return new yf.Document(s,n,t).toString(t)}He.parse=vf;He.parseAllDocuments=Sf;He.parseDocument=$o;He.stringify=kf});var Fo=y(E=>{"use strict";var Nf=kn(),Af=xe(),Lf=tn(),$n=Re(),Ef=Ae(),Z=L(),Of=W(),qf=C(),Cf=X(),If=z(),Tf=Ut(),Pf=Pn(),Mf=_n(),_f=Dn(),Jt=xo(),jo=Se();E.Composer=Nf.Composer;E.Document=Af.Document;E.Schema=Lf.Schema;E.YAMLError=$n.YAMLError;E.YAMLParseError=$n.YAMLParseError;E.YAMLWarning=$n.YAMLWarning;E.Alias=Ef.Alias;E.isAlias=Z.isAlias;E.isCollection=Z.isCollection;E.isDocument=Z.isDocument;E.isMap=Z.isMap;E.isNode=Z.isNode;E.isPair=Z.isPair;E.isScalar=Z.isScalar;E.isSeq=Z.isSeq;E.Pair=Of.Pair;E.Scalar=qf.Scalar;E.YAMLMap=Cf.YAMLMap;E.YAMLSeq=If.YAMLSeq;E.CST=Tf;E.Lexer=Pf.Lexer;E.LineCounter=Mf.LineCounter;E.Parser=_f.Parser;E.parse=Jt.parse;E.parseAllDocuments=Jt.parseAllDocuments;E.parseDocument=Jt.parseDocument;E.stringify=Jt.stringify;E.visit=jo.visit;E.visitAsync=jo.visitAsync});var Ff={};Qo(Ff,{default:()=>jf});module.exports=Wo(Ff);var Go=(s,e)=>e.some(t=>s instanceof t),Rn,Kn;function Xo(){return Rn||(Rn=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function zo(){return Kn||(Kn=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}var Un=new WeakMap,Wt=new WeakMap,Yn=new WeakMap,Qt=new WeakMap,Xt=new WeakMap;function Zo(s){let e=new Promise((t,n)=>{let i=()=>{s.removeEventListener("success",r),s.removeEventListener("error",o)},r=()=>{t(ee(s.result)),i()},o=()=>{n(s.error),i()};s.addEventListener("success",r),s.addEventListener("error",o)});return e.then(t=>{t instanceof IDBCursor&&Un.set(t,s)}).catch(()=>{}),Xt.set(e,s),e}function ea(s){if(Wt.has(s))return;let e=new Promise((t,n)=>{let i=()=>{s.removeEventListener("complete",r),s.removeEventListener("error",o),s.removeEventListener("abort",o)},r=()=>{t(),i()},o=()=>{n(s.error||new DOMException("AbortError","AbortError")),i()};s.addEventListener("complete",r),s.addEventListener("error",o),s.addEventListener("abort",o)});Wt.set(s,e)}var Gt={get(s,e,t){if(s instanceof IDBTransaction){if(e==="done")return Wt.get(s);if(e==="objectStoreNames")return s.objectStoreNames||Yn.get(s);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return ee(s[e])},set(s,e,t){return s[e]=t,!0},has(s,e){return s instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in s}};function Vn(s){Gt=s(Gt)}function ta(s){return s===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){let n=s.call(Ge(this),e,...t);return Yn.set(n,e.sort?e.sort():[e]),ee(n)}:zo().includes(s)?function(...e){return s.apply(Ge(this),e),ee(Un.get(this))}:function(...e){return ee(s.apply(Ge(this),e))}}function sa(s){return typeof s=="function"?ta(s):(s instanceof IDBTransaction&&ea(s),Go(s,Xo())?new Proxy(s,Gt):s)}function ee(s){if(s instanceof IDBRequest)return Zo(s);if(Qt.has(s))return Qt.get(s);let e=sa(s);return e!==s&&(Qt.set(s,e),Xt.set(e,s)),e}var Ge=s=>Xt.get(s);var na=["get","getKey","getAll","getAllKeys","count"],ia=["put","add","delete","clear"],zt=new Map;function Jn(s,e){if(!(s instanceof IDBDatabase&&!(e in s)&&typeof e=="string"))return;if(zt.get(e))return zt.get(e);let t=e.replace(/FromIndex$/,""),n=e!==t,i=ia.includes(t);if(!(t in(n?IDBIndex:IDBObjectStore).prototype)||!(i||na.includes(t)))return;let r=async function(o,...a){let l=this.transaction(o,i?"readwrite":"readonly"),c=l.store;return n&&(c=c.index(a.shift())),(await Promise.all([c[t](...a),i&&l.done]))[0]};return zt.set(e,r),r}Vn(s=>({...s,get:(e,t,n)=>Jn(e,t)||s.get(e,t,n),has:(e,t)=>!!Jn(e,t)||s.has(e,t)}));var Zt=class{loadedFonts=new Set;fetcher=fetch;setFetcher(e){this.fetcher=e}async loadFonts(e,t){let n=new Function("m","return import(m)"),i=this.fetcher||=await async function(){let{fetchBuilder:a,FileSystemCache:l}=await n("node-fetch-cache"),c=new l({cacheDirectory:".cache/typst/fonts"}),d=a.withCache(c);return function(f,u){let m=setTimeout(()=>{console.warn("font fetching is stucking:",f)},15e3);return d(f,u).finally(()=>{clearTimeout(m)})}}(),r=t.filter(a=>a instanceof Uint8Array?!0:this.loadedFonts.has(a)?!1:(this.loadedFonts.add(a),!0)),o=await Promise.all(r.map(async a=>{if(a instanceof Uint8Array){await e.add_raw_font(a);return}return new Uint8Array(await(await i(a)).arrayBuffer())}));for(let a of o)a&&await e.add_raw_font(a)}async build(e,t,n){let i={ref:this,builder:t,hooks:n};for(let o of e?.beforeBuild??[])await o(void 0,i);return n.latelyBuild&&n.latelyBuild(i),await t.build()}};async function Hn(s,e,t,n){return await e.init(s?.getModule?.()),await new Zt().build(s,new t,n)}var Y=Symbol.for("reflexo-obj");var Qn;(function(s){s[s.PIXEL_PER_PT=3]="PIXEL_PER_PT"})(Qn||(Qn={}));var Qf=Symbol("beforeBuild"),oa=["LinLibertine_R.ttf","LinLibertine_RB.ttf","LinLibertine_RBI.ttf","LinLibertine_RI.ttf","NewCMMath-Book.otf","NewCMMath-Regular.otf","NewCM10-Regular.otf","NewCM10-Bold.otf","NewCM10-Italic.otf","NewCM10-BoldItalic.otf","DejaVuSansMono.ttf","DejaVuSansMono-Bold.ttf","DejaVuSansMono-Oblique.ttf","DejaVuSansMono-BoldOblique.ttf"],aa=["InriaSerif-Bold.ttf","InriaSerif-BoldItalic.ttf","InriaSerif-Italic.ttf","InriaSerif-Regular.ttf","Roboto-Regular.ttf","NotoSerifCJKsc-Regular.otf"],la=["TwitterColorEmoji.ttf","NotoColorEmoji.ttf"];function Wn(s,e){let t=[...s];if(e&&e?.assets!==!1&&e?.assets?.length&&e?.assets?.length>0){let i=e.assetUrlPrefix??"https://raw.githubusercontent.com/Myriad-Dreamin/typst/assets-fonts";i[i.length-1]!=="/"&&(i+="/");let r=o=>o.map(a=>i+a);for(let o of e.assets)switch(o){case"text":t.push(...r(oa));break;case"cjk":t.push(...r(aa));break;case"emoji":t.push(...r(la));break}}let n=async(i,{ref:r,builder:o})=>{e?.fetcher&&r.setFetcher(e.fetcher),await r.loadFonts(o,t)};return n._preloadRemoteFontOptions=e,n}var ca=s=>{let e=!1,t;return()=>e?t:(e=!0,t=s())},Xe=class{wasmBin;initOnce;constructor(e){if(typeof e!="function")throw new Error("initFn is not a function");this.initOnce=ca(async()=>{await e(this.wasmBin)})}async init(e){this.wasmBin=e,await this.initOnce()}};var ts=class{[Y];constructor(e){this[Y]=e}reset(){this[Y].reset()}current(){return this[Y].current()}setAttachDebugInfo(e){this[Y].set_attach_debug_info(e)}},ua=new Xe(async s=>await(await import("@myriaddreamin/typst-ts-web-compiler/pkg/wasm-pack-shim.mjs")).default(s));function Xn(){return new ss}var ss=class{compiler;compilerJs;constructor(){}async init(e){this.compilerJs=await import("@myriaddreamin/typst-ts-web-compiler/pkg/wasm-pack-shim.mjs");let t=this.compilerJs.TypstCompilerBuilder,n={...e||{}},i=n.beforeBuild?.some(a=>a._preloadRemoteFontOptions!==void 0),r=n.beforeBuild?.some(a=>a._preloadRemoteFontOptions?.assets!==void 0),o=n.beforeBuild?.some(a=>a._preloadRemoteFontOptions?.assets===!1);(!i||!r&&!o)&&n.beforeBuild?.push(Wn([],{assets:["text"]})),this.compiler=await Hn(e,ua,t,{})}compile(e){return new Promise(t=>{if("incrementalServer"in e){t(this.compiler.incr_compile(e.mainFilePath,es(e.inputs),e.incrementalServer[Y],Gn(e.diagnostics)));return}t(this.compiler.compile(e.mainFilePath,es(e.inputs),e.format||"vector",Gn(e.diagnostics)))})}query(e){return new Promise(t=>{t(JSON.parse(this.compiler.query(e.mainFilePath,es(e.inputs),e.selector,e.field)))})}getSemanticTokenLegend(){return new Promise(e=>{e(this.compiler.get_semantic_token_legend())})}getSemanticTokens(e){return new Promise(t=>{this.compiler.reset(),t(this.compiler.get_semantic_tokens(e.offsetEncoding||"utf-16",e.mainFilePath,e.resultId))})}async withIncrementalServer(e){let t=new ts(this.compiler.create_incr_server());try{return await e(t)}finally{t[Y].free()}}async getAst(e){return this.compiler.get_ast(e)}async reset(){await new Promise(e=>{this.compiler.reset(),e(void 0)})}addSource(e,t){if(arguments.length>2)throw new Error("use of addSource(path, source, isMain) is deprecated, please use addSource(path, source) instead");this.compiler.add_source(e,t)}mapShadow(e,t){this.compiler.map_shadow(e,t)}unmapShadow(e){this.compiler.unmap_shadow(e)}resetShadow(){this.compiler.reset_shadow()}renderPageToCanvas(){throw new Error("Please use the api TypstRenderer.renderToCanvas in v0.4.0")}};function es(s){return s?Object.entries(s):void 0}function Gn(s){switch(s){case"none":return 1;case"unix":return 2;case"full":return 3;default:return 0}}var q=We(ei()),Ro=We(Fo()),Bf=async s=>{let e=Xn();return await e.init(),e.addSource("/main.typ",s),await e.getAst("/main.typ")},Df=s=>{let n=(r=>r.split(`
|
|
140
|
-
`).reduce((o
|
|
141
|
-
`))((r=>{let
|
|
142
|
-
`);return
|
|
143
|
-
`)})(s)),i=(0,
|
|
144
|
-
`).slice(t.line-1,n.line),
|
|
145
|
-
${
|
|
139
|
+
`,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;let t=Ht(e),n=we(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Ht(e),n=we(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Pa.Parser=xn});var $a=b(He=>{"use strict";var Ma=An(),wu=xe(),Je=Re(),Su=ks(),vu=$n(),_a=jn();function Ba(s){let e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new vu.LineCounter||null,prettyErrors:e}}function ku(s,e={}){let{lineCounter:t,prettyErrors:n}=Ba(e),i=new _a.Parser(t?.addNewLine),r=new Ma.Composer(e),a=Array.from(r.compose(i.parse(s)));if(n&&t)for(let o of a)o.errors.forEach(Je.prettifyError(s,t)),o.warnings.forEach(Je.prettifyError(s,t));return a.length>0?a:Object.assign([],{empty:!0},r.streamInfo())}function Da(s,e={}){let{lineCounter:t,prettyErrors:n}=Ba(e),i=new _a.Parser(t?.addNewLine),r=new Ma.Composer(e),a=null;for(let o of r.compose(i.parse(s),!0,s.length))if(!a)a=o;else if(a.options.logLevel!=="silent"){a.errors.push(new Je.YAMLParseError(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(a.errors.forEach(Je.prettifyError(s,t)),a.warnings.forEach(Je.prettifyError(s,t))),a}function Nu(s,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);let i=Da(s,t);if(!i)return null;if(i.warnings.forEach(r=>Su.warn(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},t))}function Lu(s,e,t){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let i=Math.round(t);t=i<1?void 0:i>8?{indent:8}:{indent:i}}if(s===void 0){let{keepUndefined:i}=t??e??{};if(!i)return}return new wu.Document(s,n,t).toString(t)}He.parse=Nu;He.parseAllDocuments=ku;He.parseDocument=Da;He.stringify=Lu});var ja=b(q=>{"use strict";var Au=An(),Eu=xe(),Ou=rn(),Fn=Re(),Cu=Le(),ee=C(),qu=G(),Iu=T(),Tu=z(),Pu=Z(),Mu=Vt(),_u=Bn(),Bu=$n(),Du=jn(),Qt=$a(),xa=Se();q.Composer=Au.Composer;q.Document=Eu.Document;q.Schema=Ou.Schema;q.YAMLError=Fn.YAMLError;q.YAMLParseError=Fn.YAMLParseError;q.YAMLWarning=Fn.YAMLWarning;q.Alias=Cu.Alias;q.isAlias=ee.isAlias;q.isCollection=ee.isCollection;q.isDocument=ee.isDocument;q.isMap=ee.isMap;q.isNode=ee.isNode;q.isPair=ee.isPair;q.isScalar=ee.isScalar;q.isSeq=ee.isSeq;q.Pair=qu.Pair;q.Scalar=Iu.Scalar;q.YAMLMap=Tu.YAMLMap;q.YAMLSeq=Pu.YAMLSeq;q.CST=Mu;q.Lexer=_u.Lexer;q.LineCounter=Bu.LineCounter;q.Parser=Du.Parser;q.parse=Qt.parse;q.parseAllDocuments=Qt.parseAllDocuments;q.parseDocument=Qt.parseDocument;q.stringify=Qt.stringify;q.visit=xa.visit;q.visitAsync=xa.visitAsync});var Ku={};Qa(Ku,{default:()=>Ru});module.exports=Wa(Ku);var Ga=(s,e)=>e.some(t=>s instanceof t),Kn,Un;function Xa(){return Kn||(Kn=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function za(){return Un||(Un=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}var Yn=new WeakMap,zt=new WeakMap,Vn=new WeakMap,Xt=new WeakMap,es=new WeakMap;function Za(s){let e=new Promise((t,n)=>{let i=()=>{s.removeEventListener("success",r),s.removeEventListener("error",a)},r=()=>{t(te(s.result)),i()},a=()=>{n(s.error),i()};s.addEventListener("success",r),s.addEventListener("error",a)});return e.then(t=>{t instanceof IDBCursor&&Yn.set(t,s)}).catch(()=>{}),es.set(e,s),e}function eo(s){if(zt.has(s))return;let e=new Promise((t,n)=>{let i=()=>{s.removeEventListener("complete",r),s.removeEventListener("error",a),s.removeEventListener("abort",a)},r=()=>{t(),i()},a=()=>{n(s.error||new DOMException("AbortError","AbortError")),i()};s.addEventListener("complete",r),s.addEventListener("error",a),s.addEventListener("abort",a)});zt.set(s,e)}var Zt={get(s,e,t){if(s instanceof IDBTransaction){if(e==="done")return zt.get(s);if(e==="objectStoreNames")return s.objectStoreNames||Vn.get(s);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return te(s[e])},set(s,e,t){return s[e]=t,!0},has(s,e){return s instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in s}};function Jn(s){Zt=s(Zt)}function to(s){return s===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){let n=s.call(Xe(this),e,...t);return Vn.set(n,e.sort?e.sort():[e]),te(n)}:za().includes(s)?function(...e){return s.apply(Xe(this),e),te(Yn.get(this))}:function(...e){return te(s.apply(Xe(this),e))}}function so(s){return typeof s=="function"?to(s):(s instanceof IDBTransaction&&eo(s),Ga(s,Xa())?new Proxy(s,Zt):s)}function te(s){if(s instanceof IDBRequest)return Za(s);if(Xt.has(s))return Xt.get(s);let e=so(s);return e!==s&&(Xt.set(s,e),es.set(e,s)),e}var Xe=s=>es.get(s);var no=["get","getKey","getAll","getAllKeys","count"],io=["put","add","delete","clear"],ts=new Map;function Hn(s,e){if(!(s instanceof IDBDatabase&&!(e in s)&&typeof e=="string"))return;if(ts.get(e))return ts.get(e);let t=e.replace(/FromIndex$/,""),n=e!==t,i=io.includes(t);if(!(t in(n?IDBIndex:IDBObjectStore).prototype)||!(i||no.includes(t)))return;let r=async function(a,...o){let l=this.transaction(a,i?"readwrite":"readonly"),c=l.store;return n&&(c=c.index(o.shift())),(await Promise.all([c[t](...o),i&&l.done]))[0]};return ts.set(e,r),r}Jn(s=>({...s,get:(e,t,n)=>Hn(e,t)||s.get(e,t,n),has:(e,t)=>!!Hn(e,t)||s.has(e,t)}));var ss=class{loadedFonts=new Set;fetcher=fetch;setFetcher(e){this.fetcher=e}async loadFonts(e,t){let n=new Function("m","return import(m)"),i=this.fetcher||=await async function(){let{fetchBuilder:o,FileSystemCache:l}=await n("node-fetch-cache"),c=new l({cacheDirectory:".cache/typst/fonts"}),d=o.withCache(c);return function(f,u){let m=setTimeout(()=>{console.warn("font fetching is stucking:",f)},15e3);return d(f,u).finally(()=>{clearTimeout(m)})}}(),r=t.filter(o=>o instanceof Uint8Array?!0:this.loadedFonts.has(o)?!1:(this.loadedFonts.add(o),!0)),a=await Promise.all(r.map(async o=>{if(o instanceof Uint8Array){await e.add_raw_font(o);return}return new Uint8Array(await(await i(o)).arrayBuffer())}));for(let o of a)o&&await e.add_raw_font(o)}async build(e,t,n){let i={ref:this,builder:t,hooks:n};for(let a of e?.beforeBuild??[])await a(void 0,i);return n.latelyBuild&&n.latelyBuild(i),await t.build()}};async function Qn(s,e,t,n){return await e.init(s?.getModule?.()),await new ss().build(s,new t,n)}var V=Symbol.for("reflexo-obj");var Wn;(function(s){s[s.PIXEL_PER_PT=3]="PIXEL_PER_PT"})(Wn||(Wn={}));var Gu=Symbol("beforeBuild"),ao=["DejaVuSansMono-Bold.ttf","DejaVuSansMono-BoldOblique.ttf","DejaVuSansMono-Oblique.ttf","DejaVuSansMono.ttf","LibertinusSerif-Bold.otf","LibertinusSerif-BoldItalic.otf","LibertinusSerif-Italic.otf","LibertinusSerif-Regular.otf","LibertinusSerif-Semibold.otf","LibertinusSerif-SemiboldItalic.otf","NewCM10-Bold.otf","NewCM10-BoldItalic.otf","NewCM10-Italic.otf","NewCM10-Regular.otf","NewCMMath-Bold.otf","NewCMMath-Book.otf","NewCMMath-Regular.otf"],oo=["InriaSerif-Bold.ttf","InriaSerif-BoldItalic.ttf","InriaSerif-Italic.ttf","InriaSerif-Regular.ttf","Roboto-Regular.ttf","NotoSerifCJKsc-Regular.otf"],lo=["TwitterColorEmoji.ttf","NotoColorEmoji.ttf"];function co(s){let e=[];if(s&&s?.assets!==!1&&s?.assets?.length&&s?.assets?.length>0){let t={text:"https://cdn.jsdelivr.net/gh/typst/typst-assets@v0.13.1/files/fonts/",_:"https://cdn.jsdelivr.net/gh/typst/typst-dev-assets@v0.13.1/files/fonts/"},n=s.assetUrlPrefix??t;typeof n=="string"?n={_:n}:n={...t,...n};for(let r of Object.keys(n)){let a=n[r];a[a.length-1]!=="/"&&(n[r]=a+"/")}let i=(r,a)=>a.map(o=>(n[r]||n._)+o);for(let r of s.assets)switch(r){case"text":e.push(...i(r,ao));break;case"cjk":e.push(...i(r,oo));break;case"emoji":e.push(...i(r,lo));break}}return e}function Gn(s,e){let t=co(e),n=async(i,{ref:r,builder:a})=>{e?.fetcher&&r.setFetcher(e.fetcher),await r.loadFonts(a,[...s,...t])};return n._preloadRemoteFontOptions=e,n._kind="fontLoader",n}var fo=s=>{let e=!1,t;return()=>e?t:(e=!0,t=s())},ze=class{wasmBin;initOnce;constructor(e){if(typeof e!="function")throw new Error("initFn is not a function");this.initOnce=fo(async()=>{await e(this.wasmBin)})}async init(e){this.wasmBin=e,await this.initOnce()}};var is=class{[V];constructor(e){this[V]=e}reset(){this[V].reset()}current(){return this[V].current()}setAttachDebugInfo(e){this[V].set_attach_debug_info(e)}},uo=new ze(async s=>await(await import("@myriaddreamin/typst-ts-web-compiler")).default(s));function rs(){return new Ze}var Ze=class s{compiler;compilerJs;static defaultAssets=["text"];constructor(){}async init(e){this.compilerJs=await import("@myriaddreamin/typst-ts-web-compiler");let t=this.compilerJs.TypstCompilerBuilder,n={...e||{}},i=n.beforeBuild??=[],r=i.some(c=>c._preloadRemoteFontOptions!==void 0),a=i.some(c=>c._preloadRemoteFontOptions?.assets!==void 0),o=i.some(c=>c._preloadRemoteFontOptions?.assets===!1);if((!r||!a&&!o)&&i.push(Gn([],{assets:s.defaultAssets})),!i.some(c=>c._kind==="fontLoader"))throw new Error("TypstCompiler: no font loader found, please use font loaders, e.g. preloadRemoteFonts or preloadSystemFonts");this.compiler=await Qn(e,uo,t,{})}compile(e){return new Promise(t=>{if("incrementalServer"in e){t(this.compiler.incr_compile(e.mainFilePath,ns(e.inputs),e.incrementalServer[V],Xn(e.diagnostics)));return}t(this.compiler.compile(e.mainFilePath,ns(e.inputs),e.format||"vector",Xn(e.diagnostics)))})}query(e){return new Promise(t=>{t(JSON.parse(this.compiler.query(e.mainFilePath,ns(e.inputs),e.selector,e.field)))})}getSemanticTokenLegend(){return new Promise(e=>{e(this.compiler.get_semantic_token_legend())})}getSemanticTokens(e){return new Promise(t=>{this.compiler.reset(),t(this.compiler.get_semantic_tokens(e.offsetEncoding||"utf-16",e.mainFilePath,e.resultId))})}async withIncrementalServer(e){let t=new is(this.compiler.create_incr_server());try{return await e(t)}finally{t[V].free()}}async getAst(e){return this.compiler.get_ast(e)}async reset(){await new Promise(e=>{this.compiler.reset(),e(void 0)})}addSource(e,t){if(arguments.length>2)throw new Error("use of addSource(path, source, isMain) is deprecated, please use addSource(path, source) instead");this.compiler.add_source(e,t)}mapShadow(e,t){this.compiler.map_shadow(e,t)}unmapShadow(e){this.compiler.unmap_shadow(e)}resetShadow(){this.compiler.reset_shadow()}renderPageToCanvas(){throw new Error("Please use the api TypstRenderer.renderToCanvas in v0.4.0")}};rs._impl=Ze;function ns(s){return s?Object.entries(s):void 0}function Xn(s){switch(s){case"none":return 1;case"unix":return 2;case"full":default:return 3}}var E=Ge(ei()),Fa=Ge(ja()),$u=async s=>{let e=rs();return await e.init(),e.addSource("/main.typ",s),await e.getAst("/main.typ")},xu=s=>{let n=(r=>r.split(`
|
|
140
|
+
`).reduce((a,o)=>{if(!/^\s*(path:|ast:|- s: |s: |c:)/.test(o))return a.length>0&&(a[a.length-1]=`${a[a.length-1].slice(0,-1)}\\n${o}"`),a;let[l,...c]=o.split(":");if(c[0]==="")return a.push(o),a;let d=c.join(":").trim();return a.push(`${l}: "${d}"`),a},[]).join(`
|
|
141
|
+
`))((r=>{let a=r.split(`
|
|
142
|
+
`);return a.shift(),a.join(`
|
|
143
|
+
`)})(s)),i=(0,Fa.parse)(n);return i.ast.c===null&&(i.ast.c=[]),i.ast},Wt=(s,e)=>{let{start:t,end:n}=e,r=s.split(`
|
|
144
|
+
`).slice(t.line-1,n.line),a=r[0].slice(t.column),o=r.slice(1,-1),l=r[r.length-1].slice(0,n.column),c;return t.line===n.line?c=a.slice(0,n.column-t.column):(c=a,o.length>0&&(c+=`
|
|
145
|
+
${o.join(`
|
|
146
146
|
`)}`),c+=`
|
|
147
|
-
${l}`),c}
|
|
147
|
+
${l}`),c},ju=(s,e)=>{let t=JSON.parse(JSON.stringify(s)),n=o=>{let[l,c]=o.split(":").map(Number);return{line:l,column:c}},i=o=>{let l=o.match(/(?:<span style='color:[^']+'>([^<]+)<\/span>|([^<]+))/);if(!l)throw new Error("Invalid format");return l[1]||l[2]},r=(o,l)=>{let c=o.match(/<(\d+:\d+)~(\d+:\d+)>/);if(!c){if(l!==void 0){if(l.length===0)return{start:{line:1,column:0},end:{line:1,column:0}};let u=r(l[0].s,l[0].c),m=r(l[l.length-1].s,l[l.length-1].c);return{start:u.start,end:m.end}}throw new Error("Invalid format")}let d=n(c[1]),f=n(c[2]);return{start:d,end:f}},a=(o,l=0)=>{let c=h=>{let p=e.split(`
|
|
148
|
+
`),v=0;for(let S=0;S<h.start.line-1;S++)v+=p[S].length+1;return v+=h.start.column,v},d=r(o.s,o.c),u=Wt(e,d).length,m=c(d);if(o.c){let h=m,p=[],v=[];for(let S=0;S<o.c.length;S++){let N=o.c[S];if(h=a(N,h),S<o.c.length-1){let L=o.c[S+1],A=N.loc.end.line,k=N.loc.end.column,w=r(L.s,L.c).start.line,g=r(L.s,L.c).start.column;if(A===w&&k!==g){let O={type:"Str",raw:" ".repeat(g-k),value:" ".repeat(g-k),range:[h,h+1],loc:{start:{line:A,column:k},end:{line:w,column:g}}};p.push(O),h+=1}if(A!==w&&N.type!==E.ASTNodeTypes.Break&&L.type!==E.ASTNodeTypes.Break){let O={type:"Str",raw:`
|
|
148
149
|
`,value:`
|
|
149
|
-
`,range:[
|
|
150
|
+
`,range:[h,h+1],loc:{start:{line:A,column:k},end:{line:w,column:g}}};v.push(O),h+=1}}}o.c=o.c.concat(v).concat(p).sort((S,N)=>S.range[0]-N.range[0]),o.children=o.c}else o.value=Wt(e,d);let y=m+u;if(o.raw=Wt(e,d),o.range=[m,y],o.loc=d,o.type=i(o.s),/^Marked::Heading$/.test(o.type)&&(o.type=E.ASTNodeTypes.Header),/^Marked::Text/.test(o.type)&&(o.type=E.ASTNodeTypes.Str),/^Marked::Parbreak/.test(o.type)&&(o.type=E.ASTNodeTypes.Break),/^Escape::Linebreak/.test(o.type)&&(o.type=E.ASTNodeTypes.Break),/^Marked::(ListItem|EnumItem)$/.test(o.type)&&(o.type=E.ASTNodeTypes.ListItem,o.spread=!1,o.checked=null,o.children&&o.children.length>0)){let h=o.range,p=o.loc,v=o.raw,S=o.children.filter(w=>!["Marked::ListMarker","Marked::EnumMarker"].includes(w.type)),N=[];for(let w of S)w.type==="Marked::Markup"&&w.children?N.push(...w.children):N.push(w);let L=[],A=[];for(let w of N)w.type===E.ASTNodeTypes.ListItem?A.push(w):L.push(w);let k=[];if(L.length>0){let w=L.filter(g=>!(g.type===E.ASTNodeTypes.Str&&g.raw?.trim()===""));if(w.length>0){let g=w[0],O=w[w.length-1];k.push({type:E.ASTNodeTypes.Paragraph,children:w,loc:{start:g.loc.start,end:O.loc.end},range:[g.range[0],O.range[1]],raw:w.map(M=>M.raw).join("")})}}if(A.length>0){let w=A.some(M=>/^\d+\./.test(M.raw?.trim()||"")),g=A[0],O=A[A.length-1];k.push({type:E.ASTNodeTypes.List,ordered:w,start:w?1:null,spread:!1,children:A,loc:{start:g.loc.start,end:O.loc.end},range:[g.range[0],O.range[1]],raw:A.map(M=>M.raw).join(`
|
|
151
|
+
`)})}for(let w of k)if(w.type===E.ASTNodeTypes.Paragraph){if(w.children&&w.children.length>0){let g=w.children[0],O=w.children[w.children.length-1],M=c(g.loc),Y=c({start:O.loc.end,end:O.loc.end});w.range=[M,Y];for(let I of w.children)if(I.type===E.ASTNodeTypes.Str){let Qe=c(I.loc),Ka=c({start:I.loc.end,end:I.loc.end});I.range=[Qe,Ka]}}}else if(w.type===E.ASTNodeTypes.List&&w.children&&w.children.length>0){let g=w.children[0],O=w.children[w.children.length-1];g&&O&&(w.range=[g.range[0],O.range[1]])}if(o.children=k,k.length>0){let w=k[0],g=k[k.length-1],O=c(p),M=g.range[1];o.range=[O,M],o.loc={start:p.start,end:g.loc.end},o.raw=Wt(e,o.loc)}else{let w=c(p),g=w+v.length;o.range=[w,g],o.loc=p,o.raw=v}return delete o.s,delete o.c,o.range[1]}if(o.type==="Marked::Raw"){if(o.loc.start.line===o.loc.end.line)if(o.type=E.ASTNodeTypes.Code,/^```([\s\S]*?)```$/.test(o.raw)){let h=/^```(\w+)?\s([\s\S]*?)\s*```$/,p=o.raw.match(h);o.value=p?p[2].trim():""}else o.value=o.raw.replace(/`([\s\S]*?)`/,"$1");else o.type=E.ASTNodeTypes.CodeBlock,o.value=o.raw.replace(/```(?:\w*)\n([\s\S]*?)\n```/,"$1"),o.lang=o.children[1].type==="Marked::RawLang"?o.children[1].value:null;delete o.children}return o.type==="Marked::Link"&&(o.type=E.ASTNodeTypes.Link,o.title=null,o.url=o.value,o.children=[{type:E.ASTNodeTypes.Str,value:o.raw,loc:o.loc,range:o.range,raw:o.raw}],delete o.value),o.type==="Marked::Strong"&&(o.type=E.ASTNodeTypes.Strong,o.children[1].type=E.ASTNodeTypes.Str,o.children[1].value=o.children[1].children[0].value,delete o.children[1].children),o.type==="Marked::Emph"&&(o.type=E.ASTNodeTypes.Emphasis,o.children[1].type=E.ASTNodeTypes.Str,o.children[1].value=o.children[1].children[0].value,delete o.children[1].children),o.type==="Ct::LineComment"&&(o.type=E.ASTNodeTypes.Comment,o.value=o.raw.replace(/^\/\/\s*/,"")),o.type==="Ct::BlockComment"&&(o.type=E.ASTNodeTypes.Comment,o.value=o.raw.replace(/^\/\*\s*/,"").replace(/\s*\*\/$/,"")),delete o.s,delete o.c,y};return t.c&&t.c.length>0&&r(t.c[0].s,t.c[0].c).start.line===2&&t.c.unshift({s:"<span style='color:#7dcfff'>Marked::Parbreak</span> <1:0~2:0>"}),a(t),t.type=E.ASTNodeTypes.Document,t},Fu=s=>{let e=[],t=0;for(;t<s.children.length;){let n=s.children[t];if(n.type===E.ASTNodeTypes.ListItem){let i=[n];t++;let r=/^\d+\./.test(n.raw?.trim()||"");for(;t<s.children.length;){let l=s.children[t];if(l.type===E.ASTNodeTypes.ListItem){if(/^\d+\./.test(l.raw?.trim()||"")===r){i.push(l),t++;continue}break}if(l.type===E.ASTNodeTypes.Str&&l.raw===`
|
|
152
|
+
`&&t+1<s.children.length&&s.children[t+1].type===E.ASTNodeTypes.ListItem&&/^\d+\./.test(s.children[t+1].raw?.trim()||"")===r){t++;continue}if(l.type===E.ASTNodeTypes.Paragraph&&l.children.length===1&&l.children[0].type===E.ASTNodeTypes.Str&&l.children[0].raw===`
|
|
153
|
+
`&&t+1<s.children.length&&s.children[t+1].type===E.ASTNodeTypes.ListItem&&/^\d+\./.test(s.children[t+1].raw?.trim()||"")===r){t++;continue}break}let a=i[0],o=i[i.length-1];e.push({type:E.ASTNodeTypes.List,ordered:r,start:r?1:null,spread:!1,children:[...i],loc:{start:a.loc.start,end:o.loc.end},range:[a.range[0],o.range[1]],raw:i.map(l=>l.raw).join(`
|
|
154
|
+
`)})}else if(n.type===E.ASTNodeTypes.Paragraph&&n.children.length===1&&n.children[0].type===E.ASTNodeTypes.Str&&n.children[0].raw===`
|
|
155
|
+
`)t++;else{let i=[];if(n.type===E.ASTNodeTypes.Header||n.type===E.ASTNodeTypes.CodeBlock||n.type===E.ASTNodeTypes.Break)e.push(n),t++;else{if(n.type===E.ASTNodeTypes.Paragraph){let r=n.children?.filter(a=>a.type==="Marked::EnumItem")||[];if(r.length>0){let a=r.map(c=>{let d=c.children?.filter(y=>y.type!=="Marked::EnumMarker"&&!(y.type==="Str"&&y.raw?.trim()===""))||[],f=[];for(let y of d)y.type==="Marked::Markup"&&y.children?f.push(...y.children):f.push(y);let u=f[0],m=f[f.length-1];return{type:E.ASTNodeTypes.ListItem,spread:!1,checked:null,children:f.length>0?[{type:E.ASTNodeTypes.Paragraph,children:f,loc:{start:u?.loc?.start||c.loc.start,end:m?.loc?.end||c.loc.end},range:[u?.range?.[0]||c.range[0],m?.range?.[1]||c.range[1]],raw:f.map(y=>y.raw).join("")}]:[],loc:c.loc,range:c.range,raw:c.raw}}),o=a[0],l=a[a.length-1];e.push({type:E.ASTNodeTypes.List,ordered:!0,start:1,spread:!1,children:a,loc:{start:o.loc.start,end:l.loc.end},range:[o.range[0],l.range[1]],raw:a.map(c=>c.raw).join(`
|
|
156
|
+
`)}),t++;continue}}for(i.push(n),t++;t<s.children.length;){let r=s.children[t];if(r.type===E.ASTNodeTypes.Header||r.type===E.ASTNodeTypes.CodeBlock||r.type===E.ASTNodeTypes.Break||r.type===E.ASTNodeTypes.ListItem)break;i.push(r),t++}if(i.length>0){let r=i[0],a=i[i.length-1];["Kw::Hash","Fn::(Hash: "#")"].includes(r.type)?e.push(...i):e.push({loc:{start:r.loc.start,end:a.loc.end},range:[r.range[0],a.range[1]],raw:i.map(o=>o.raw).join(""),type:E.ASTNodeTypes.Paragraph,children:i})}}}}return{...s,children:e}},Ra=async s=>{let e=await $u(s),t=xu(e),n=ju(t,s);return Fu(n)};var Gt=class{config;extensions;constructor(e={}){this.config=e,this.extensions=this.config.extensions?this.config.extensions:[]}availableExtensions(){return[".typ"].concat(this.extensions)}processor(e){return{async preProcess(t,n){return await Ra(t)},postProcess(t,n){return{messages:t,filePath:n||"<typst>"}}}}};var Ru={Processor:Gt};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "textlint-plugin-typst",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "textlint plugin to lint Typst",
|
|
5
5
|
"keywords": ["textlint", "textlintplugin", "plugin", "lint", "typst"],
|
|
6
6
|
"repository": "https://github.com/3w36zj6/textlint-plugin-typst",
|
|
@@ -26,17 +26,19 @@
|
|
|
26
26
|
"update-fixtures": "bun ./test/update-fixtures.ts && biome check --write ./test/fixtures"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@myriaddreamin/typst-ts-web-compiler": "
|
|
29
|
+
"@myriaddreamin/typst-ts-web-compiler": "0.6.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@biomejs/biome": "^1.9.2",
|
|
33
|
-
"@myriaddreamin/typst.ts": "
|
|
33
|
+
"@myriaddreamin/typst.ts": "0.6.0",
|
|
34
34
|
"@textlint/ast-node-types": "^14.0.4",
|
|
35
35
|
"@textlint/ast-tester": "^14.0.4",
|
|
36
36
|
"@textlint/types": "^14.0.4",
|
|
37
37
|
"@types/node": "^20.12.2",
|
|
38
38
|
"bun-types": "latest",
|
|
39
39
|
"esbuild": "^0.20.2",
|
|
40
|
+
"textlint-rule-period-in-list-item": "^1.0.1",
|
|
41
|
+
"textlint-rule-preset-ja-technical-writing": "^12.0.2",
|
|
40
42
|
"textlint-scripts": "^14.0.4",
|
|
41
43
|
"textlint-tester": "^14.0.4",
|
|
42
44
|
"typescript": "^5.4.3",
|