radiolise
Version:
Radiolise is a web app that lets you enjoy your favorite TV and radio stations.
58 lines (56 loc) • 107 kB
JavaScript
var nt=(s,e)=>{if(e=Symbol[s])return e;throw Error("Symbol."+s+" is not defined")};var Ps=function(s,e){this[0]=s,this[1]=e};var d=s=>{var e=s[nt("asyncIterator")],t=!1,n,i={};return e==null?(e=s[nt("iterator")](),n=r=>i[r]=o=>e[r](o)):(e=e.call(s),n=r=>i[r]=o=>{if(t){if(t=!1,r==="throw")throw o;return o}return t=!0,{done:!1,value:new Ps(new Promise(l=>{var a=e[r](o);if(!(a instanceof Object))throw TypeError("Object expected");l(a)}),1)}}),i[nt("iterator")]=()=>i,n("next"),"throw"in e?n("throw"):i.throw=r=>{throw r},"return"in e&&n("return"),i};const gt=Symbol.for("yaml.alias"),ut=Symbol.for("yaml.document"),W=Symbol.for("yaml.map"),Vt=Symbol.for("yaml.pair"),Y=Symbol.for("yaml.scalar"),me=Symbol.for("yaml.seq"),F=Symbol.for("yaml.node.type"),se=s=>!!s&&typeof s=="object"&&s[F]===gt,ne=s=>!!s&&typeof s=="object"&&s[F]===ut,ye=s=>!!s&&typeof s=="object"&&s[F]===W,$=s=>!!s&&typeof s=="object"&&s[F]===Vt,E=s=>!!s&&typeof s=="object"&&s[F]===Y,ge=s=>!!s&&typeof s=="object"&&s[F]===me;function C(s){if(s&&typeof s=="object")switch(s[F]){case W:case me:return!0}return!1}function B(s){if(s&&typeof s=="object")switch(s[F]){case gt:case W:case Y:case me:return!0}return!1}const js=s=>(E(s)||C(s))&&!!s.anchor,j=Symbol("break visit"),Jt=Symbol("skip children"),J=Symbol("remove node");function H(s,e){const t=Yt(e);ne(s)?le(null,s.contents,t,Object.freeze([s]))===J&&(s.contents=null):le(null,s,t,Object.freeze([]))}H.BREAK=j;H.SKIP=Jt;H.REMOVE=J;function le(s,e,t,n){const i=Gt(s,e,t,n);if(B(i)||$(i))return Qt(s,n,i),le(s,i,t,n);if(typeof i!="symbol"){if(C(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){const o=le(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===j)return j;o===J&&(e.items.splice(r,1),r-=1)}}}else if($(e)){n=Object.freeze(n.concat(e));const r=le("key",e.key,t,n);if(r===j)return j;r===J&&(e.key=null);const o=le("value",e.value,t,n);if(o===j)return j;o===J&&(e.value=null)}}return i}async function Ve(s,e){const t=Yt(e);ne(s)?await ae(null,s.contents,t,Object.freeze([s]))===J&&(s.contents=null):await ae(null,s,t,Object.freeze([]))}Ve.BREAK=j;Ve.SKIP=Jt;Ve.REMOVE=J;async function ae(s,e,t,n){const i=await Gt(s,e,t,n);if(B(i)||$(i))return Qt(s,n,i),ae(s,i,t,n);if(typeof i!="symbol"){if(C(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){const o=await ae(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===j)return j;o===J&&(e.items.splice(r,1),r-=1)}}}else if($(e)){n=Object.freeze(n.concat(e));const r=await ae("key",e.key,t,n);if(r===j)return j;r===J&&(e.key=null);const o=await ae("value",e.value,t,n);if(o===j)return j;o===J&&(e.value=null)}}return i}function Yt(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 Gt(s,e,t,n){var i,r,o,l,a;if(typeof t=="function")return t(s,e,n);if(ye(e))return(i=t.Map)==null?void 0:i.call(t,s,e,n);if(ge(e))return(r=t.Seq)==null?void 0:r.call(t,s,e,n);if($(e))return(o=t.Pair)==null?void 0:o.call(t,s,e,n);if(E(e))return(l=t.Scalar)==null?void 0:l.call(t,s,e,n);if(se(e))return(a=t.Alias)==null?void 0:a.call(t,s,e,n)}function Qt(s,e,t){const n=e[e.length-1];if(C(n))n.items[s]=t;else if($(n))s==="key"?n.key=t:n.value=t;else if(ne(n))n.contents=t;else{const i=se(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const Ds={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},qs=s=>s.replace(/[!,[\]{}]/g,e=>Ds[e]);class P{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},P.defaultYaml,e),this.tags=Object.assign({},P.defaultTags,t)}clone(){const e=new P(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new P(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:P.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},P.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:P.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},P.defaultTags),this.atNextDocument=!1);const 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;const[r,o]=n;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;const[r]=n;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{const o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}const[,n,i]=e.match(new RegExp("^(.*!)([^!]*)$","s"));i||t(`The ${e} tag has no suffix`);const r=this.tags[n];if(r)try{return r+decodeURIComponent(i)}catch(o){return t(String(o)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+qs(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let i;if(e&&n.length>0&&B(e.contents)){const r={};H(e.contents,(o,l)=>{B(l)&&l.tag&&(r[l.tag]=!0)}),i=Object.keys(r)}else i=[];for(const[r,o]of n)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(l=>l.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
`)}}P.defaultYaml={explicit:!1,version:"1.2"};P.defaultTags={"!!":"tag:yaml.org,2002:"};function Wt(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){const t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}function Ht(s){const e=new Set;return H(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function Xt(s,e){for(let t=1;;++t){const n=`${s}${t}`;if(!e.has(n))return n}}function Fs(s,e){const t=[],n=new Map;let i=null;return{onAnchor:r=>{t.push(r),i||(i=Ht(s));const o=Xt(e,i);return i.add(o),o},setAnchors:()=>{for(const r of t){const o=n.get(r);if(typeof o=="object"&&o.anchor&&(E(o.node)||C(o.node)))o.node.anchor=o.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=r,l}}},sourceObjects:n}}function ce(s,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,r=n.length;i<r;++i){const o=n[i],l=ce(s,n,String(i),o);l===void 0?delete n[i]:l!==o&&(n[i]=l)}else if(n instanceof Map)for(const i of Array.from(n.keys())){const r=n.get(i),o=ce(s,n,i,r);o===void 0?n.delete(i):o!==r&&n.set(i,o)}else if(n instanceof Set)for(const i of Array.from(n)){const r=ce(s,n,i,i);r===void 0?n.delete(i):r!==i&&(n.delete(i),n.add(r))}else for(const[i,r]of Object.entries(n)){const o=ce(s,n,i,r);o===void 0?delete n[i]:o!==r&&(n[i]=o)}return s.call(e,t,n)}function q(s,e,t){if(Array.isArray(s))return s.map((n,i)=>q(n,String(i),t));if(s&&typeof s.toJSON=="function"){if(!t||!js(s))return s.toJSON(e,t);const n={aliasCount:0,count:1,res:void 0};t.anchors.set(s,n),t.onCreate=r=>{n.res=r,delete t.onCreate};const i=s.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof s=="bigint"&&!(t!=null&&t.keep)?Number(s):s}class bt{constructor(e){Object.defineProperty(this,F,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:i,reviver:r}={}){if(!ne(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=q(this,"",o);if(typeof i=="function")for(const{count:a,res:c}of o.anchors.values())i(c,a);return typeof r=="function"?ce(r,{"":l},"",l):l}}class Je extends bt{constructor(e){super(gt),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let t;return H(e,{Node:(n,i)=>{if(i===this)return H.BREAK;i.anchor===this.source&&(t=i)}}),t}toJSON(e,t){if(!t)return{source:this.source};const{anchors:n,doc:i,maxAliasCount:r}=t,o=this.resolve(i);if(!o){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(a)}let l=n.get(o);if(l||(q(o,null,t),l=n.get(o)),!l||l.res===void 0){const a="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(a)}if(r>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=Ke(i,o,n)),l.count*l.aliasCount>r)){const a="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(a)}return l.res}toString(e,t,n){const i=`*${this.source}`;if(e){if(Wt(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}}function Ke(s,e,t){if(se(e)){const n=e.resolve(s),i=t&&n&&t.get(n);return i?i.count*i.aliasCount:0}else if(C(e)){let n=0;for(const i of e.items){const r=Ke(s,i,t);r>n&&(n=r)}return n}else if($(e)){const n=Ke(s,e.key,t),i=Ke(s,e.value,t);return Math.max(n,i)}return 1}const zt=s=>!s||typeof s!="function"&&typeof s!="object";class N extends bt{constructor(e){super(Y),this.value=e}toJSON(e,t){return t!=null&&t.keep?this.value:q(this.value,e,t)}toString(){return String(this.value)}}N.BLOCK_FOLDED="BLOCK_FOLDED";N.BLOCK_LITERAL="BLOCK_LITERAL";N.PLAIN="PLAIN";N.QUOTE_DOUBLE="QUOTE_DOUBLE";N.QUOTE_SINGLE="QUOTE_SINGLE";const Rs="tag:yaml.org,2002:";function Us(s,e,t){var n;if(e){const i=t.filter(o=>o.tag===e),r=(n=i.find(o=>!o.format))!=null?n:i[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return t.find(i=>{var r;return((r=i.identify)==null?void 0:r.call(i,s))&&!i.format})}function Ae(s,e,t){var f,p,m;if(ne(s)&&(s=s.contents),B(s))return s;if($(s)){const y=(p=(f=t.schema[W]).createNode)==null?void 0:p.call(f,t.schema,null,t);return y.items.push(s),y}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt!="undefined"&&s instanceof BigInt)&&(s=s.valueOf());const{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:o,sourceObjects:l}=t;let a;if(n&&s&&typeof s=="object"){if(a=l.get(s),a)return a.anchor||(a.anchor=i(s)),new Je(a.anchor);a={anchor:null,node:null},l.set(s,a)}e!=null&&e.startsWith("!!")&&(e=Rs+e.slice(2));let c=Us(s,e,o.tags);if(!c){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){const y=new N(s);return a&&(a.node=y),y}c=s instanceof Map?o[W]:Symbol.iterator in Object(s)?o[me]:o[W]}r&&(r(c),delete t.onTagObj);const h=c!=null&&c.createNode?c.createNode(t.schema,s,t):typeof((m=c==null?void 0:c.nodeClass)==null?void 0:m.from)=="function"?c.nodeClass.from(t.schema,s,t):new N(s);return e?h.tag=e:c.default||(h.tag=c.tag),a&&(a.node=h),h}function qe(s,e,t){let n=t;for(let i=e.length-1;i>=0;--i){const r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){const o=[];o[r]=n,n=o}else n=new Map([[r,n]])}return Ae(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}const Ne=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done;class Zt extends bt{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>B(n)||$(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Ne(e))this.add(t);else{const[n,...i]=e,r=this.get(n,!0);if(C(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(n,qe(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){const[t,...n]=e;if(n.length===0)return this.delete(t);const i=this.get(t,!0);if(C(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){const[n,...i]=e,r=this.get(n,!0);return i.length===0?!t&&E(r)?r.value:r:C(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!$(t))return!1;const n=t.value;return n==null||e&&E(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){const[t,...n]=e;if(n.length===0)return this.has(t);const i=this.get(t,!0);return C(i)?i.hasIn(n):!1}setIn(e,t){const[n,...i]=e;if(i.length===0)this.set(n,t);else{const r=this.get(n,!0);if(C(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(n,qe(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}}const Vs=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function G(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}const Z=(s,e,t)=>s.endsWith(`
`)?G(t,e):t.includes(`
`)?`
`+G(t,e):(s.endsWith(" ")?"":" ")+t,xt="flow",ht="block",Pe="quoted";function Ye(s,e,t="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:l}={}){if(!i||i<0)return s;i<r&&(r=0);const a=Math.max(1+r,1+i-e.length);if(s.length<=a)return s;const c=[],h={};let f=i-e.length;typeof n=="number"&&(n>i-Math.max(2,r)?c.push(0):f=i-n);let p,m,y=!1,u=-1,g=-1,b=-1;t===ht&&(u=vt(s,u,e.length),u!==-1&&(f=u+a));for(let A;A=s[u+=1];){if(t===Pe&&A==="\\"){switch(g=u,s[u+1]){case"x":u+=3;break;case"u":u+=5;break;case"U":u+=9;break;default:u+=1}b=u}if(A===`
`)t===ht&&(u=vt(s,u,e.length)),f=u+e.length+a,p=void 0;else{if(A===" "&&m&&m!==" "&&m!==`
`&&m!==" "){const O=s[u+1];O&&O!==" "&&O!==`
`&&O!==" "&&(p=u)}if(u>=f)if(p)c.push(p),f=p+a,p=void 0;else if(t===Pe){for(;m===" "||m===" ";)m=A,A=s[u+=1],y=!0;const O=u>b+1?u-2:g-1;if(h[O])return s;c.push(O),h[O]=!0,f=O+a,p=void 0}else y=!0}m=A}if(y&&l&&l(),c.length===0)return s;o&&o();let S=s.slice(0,c[0]);for(let A=0;A<c.length;++A){const O=c[A],k=c[A+1]||s.length;O===0?S=`
${e}${s.slice(0,k)}`:(t===Pe&&h[O]&&(S+=`${s[O]}\\`),S+=`
${e}${s.slice(O+1,k)}`)}return S}function vt(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!==`
`);n=e,i=e+1,r=s[i]}return n}const Ge=(s,e)=>({indentAtStart:e?s.indent.length:s.indentAtStart,lineWidth:s.options.lineWidth,minContentWidth:s.options.minContentWidth}),Qe=s=>/^(%|---|\.\.\.)/m.test(s);function Js(s,e,t){if(!e||e<0)return!1;const n=e-t,i=s.length;if(i<=n)return!1;for(let r=0,o=0;r<i;++r)if(s[r]===`
`){if(r-o>n)return!0;if(o=r+1,i-o<=n)return!1}return!0}function Oe(s,e){const t=JSON.stringify(s);if(e.options.doubleQuotedAsJSON)return t;const{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(Qe(s)?" ":"");let o="",l=0;for(let a=0,c=t[a];c;c=t[++a])if(c===" "&&t[a+1]==="\\"&&t[a+2]==="n"&&(o+=t.slice(l,a)+"\\ ",a+=1,l=a,c="\\"),c==="\\")switch(t[a+1]){case"u":{o+=t.slice(l,a);const h=t.substr(a+2,4);switch(h){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:h.substr(0,2)==="00"?o+="\\x"+h.substr(2):o+=t.substr(a,6)}a+=5,l=a+1}break;case"n":if(n||t[a+2]==='"'||t.length<i)a+=1;else{for(o+=t.slice(l,a)+`
`;t[a+2]==="\\"&&t[a+3]==="n"&&t[a+4]!=='"';)o+=`
`,a+=2;o+=r,t[a+2]===" "&&(o+="\\"),a+=1,l=a+1}break;default:a+=1}return o=l?o+t.slice(l):t,n?o:Ye(o,r,Pe,Ge(e,!1))}function dt(s,e){if(e.options.singleQuote===!1||e.implicitKey&&s.includes(`
`)||/[ \t]\n|\n[ \t]/.test(s))return Oe(s,e);const t=e.indent||(Qe(s)?" ":""),n="'"+s.replace(/'/g,"''").replace(/\n+/g,`$&
${t}`)+"'";return e.implicitKey?n:Ye(n,t,xt,Ge(e,!1))}function fe(s,e){const{singleQuote:t}=e.options;let n;if(t===!1)n=Oe;else{const i=s.includes('"'),r=s.includes("'");i&&!r?n=dt:r&&!i?n=Oe:n=t?dt:Oe}return n(s,e)}let pt;try{pt=new RegExp(`(^|(?<!
))
+(?!
|$)`,"g")}catch(s){pt=/\n+(?!\n|$)/g}function je({comment:s,type:e,value:t},n,i,r){const{blockQuote:o,commentString:l,lineWidth:a}=n.options;if(!o||/\n[\t ]+$/.test(t)||/^\s*$/.test(t))return fe(t,n);const c=n.indent||(n.forceBlockIndent||Qe(t)?" ":""),h=o==="literal"?!0:o==="folded"||e===N.BLOCK_FOLDED?!1:e===N.BLOCK_LITERAL?!0:!Js(t,a,c.length);if(!t)return h?`|
`:`>
`;let f,p;for(p=t.length;p>0;--p){const k=t[p-1];if(k!==`
`&&k!==" "&&k!==" ")break}let m=t.substring(p);const y=m.indexOf(`
`);y===-1?f="-":t===m||y!==m.length-1?(f="+",r&&r()):f="",m&&(t=t.slice(0,-m.length),m[m.length-1]===`
`&&(m=m.slice(0,-1)),m=m.replace(pt,`$&${c}`));let u=!1,g,b=-1;for(g=0;g<t.length;++g){const k=t[g];if(k===" ")u=!0;else if(k===`
`)b=g;else break}let S=t.substring(0,b<g?b+1:g);S&&(t=t.substring(S.length),S=S.replace(/\n+/g,`$&${c}`));let O=(u?c?"2":"1":"")+f;if(s&&(O+=" "+l(s.replace(/ ?[\r\n]+/g," ")),i&&i()),!h){const k=t.replace(/\n+/g,`
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let I=!1;const T=Ge(n,!0);o!=="folded"&&e!==N.BLOCK_FOLDED&&(T.onOverflow=()=>{I=!0});const w=Ye(`${S}${k}${m}`,c,ht,T);if(!I)return`>${O}
${c}${w}`}return t=t.replace(/\n+/g,`$&${c}`),`|${O}
${c}${S}${t}${m}`}function Ys(s,e,t,n){const{type:i,value:r}=s,{actualString:o,implicitKey:l,indent:a,indentStep:c,inFlow:h}=e;if(l&&r.includes(`
`)||h&&/[[\]{},]/.test(r))return fe(r,e);if(!r||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return l||h||!r.includes(`
`)?fe(r,e):je(s,e,t,n);if(!l&&!h&&i!==N.PLAIN&&r.includes(`
`))return je(s,e,t,n);if(Qe(r)){if(a==="")return e.forceBlockIndent=!0,je(s,e,t,n);if(l&&a===c)return fe(r,e)}const f=r.replace(/\n+/g,`$&
${a}`);if(o){const p=u=>{var g;return u.default&&u.tag!=="tag:yaml.org,2002:str"&&((g=u.test)==null?void 0:g.test(f))},{compat:m,tags:y}=e.doc.schema;if(y.some(p)||m!=null&&m.some(p))return fe(r,e)}return l?f:Ye(f,a,xt,Ge(e,!1))}function Te(s,e,t,n){const{implicitKey:i,inFlow:r}=e,o=typeof s.value=="string"?s:Object.assign({},s,{value:String(s.value)});let{type:l}=s;l!==N.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=N.QUOTE_DOUBLE);const a=h=>{switch(h){case N.BLOCK_FOLDED:case N.BLOCK_LITERAL:return i||r?fe(o.value,e):je(o,e,t,n);case N.QUOTE_DOUBLE:return Oe(o.value,e);case N.QUOTE_SINGLE:return dt(o.value,e);case N.PLAIN:return Ys(o,e,t,n);default:return null}};let c=a(l);if(c===null){const{defaultKeyType:h,defaultStringType:f}=e.options,p=i&&h||f;if(c=a(p),c===null)throw new Error(`Unsupported default string type ${p}`)}return c}function es(s,e){const t=Object.assign({blockQuote:!0,commentString:Vs,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);let 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 Gs(s,e){var i,r,o,l;if(e.tag){const a=s.filter(c=>c.tag===e.tag);if(a.length>0)return(i=a.find(c=>c.format===e.format))!=null?i:a[0]}let t,n;if(E(e)){n=e.value;let a=s.filter(c=>{var h;return(h=c.identify)==null?void 0:h.call(c,n)});if(a.length>1){const c=a.filter(h=>h.test);c.length>0&&(a=c)}t=(r=a.find(c=>c.format===e.format))!=null?r:a.find(c=>!c.format)}else n=e,t=s.find(a=>a.nodeClass&&n instanceof a.nodeClass);if(!t){const a=(l=(o=n==null?void 0:n.constructor)==null?void 0:o.name)!=null?l:typeof n;throw new Error(`Tag not resolved for ${a} value`)}return t}function Qs(s,e,{anchors:t,doc:n}){if(!n.directives)return"";const i=[],r=(E(s)||C(s))&&s.anchor;r&&Wt(r)&&(t.add(r),i.push(`&${r}`));const o=s.tag?s.tag:e.default?null:e.tag;return o&&i.push(n.directives.tagString(o)),i.join(" ")}function de(s,e,t,n){var a,c;if($(s))return s.toString(e,t,n);if(se(s)){if(e.doc.directives)return s.toString(e);if((a=e.resolvedAliases)!=null&&a.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;const r=B(s)?s:e.doc.createNode(s,{onTagObj:h=>i=h});i||(i=Gs(e.doc.schema.tags,r));const o=Qs(r,i,e);o.length>0&&(e.indentAtStart=((c=e.indentAtStart)!=null?c:0)+o.length+1);const l=typeof i.stringify=="function"?i.stringify(r,e,t,n):E(r)?Te(r,e,t,n):r.toString(e,t,n);return o?E(r)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}
${e.indent}${l}`:l}function Ws({key:s,value:e},t,n,i){var T,w;const{allNullValues:r,doc:o,indent:l,indentStep:a,options:{commentString:c,indentSeq:h,simpleKeys:f}}=t;let p=B(s)&&s.comment||null;if(f){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(C(s)||!B(s)&&typeof s=="object"){const _="With simple keys, collection cannot be used as a key value";throw new Error(_)}}let m=!f&&(!s||p&&e==null&&!t.inFlow||C(s)||(E(s)?s.type===N.BLOCK_FOLDED||s.type===N.BLOCK_LITERAL:typeof s=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!m&&(f||!r),indent:l+a});let y=!1,u=!1,g=de(s,t,()=>y=!0,()=>u=!0);if(!m&&!t.inFlow&&g.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(),g===""?"?":m?`? ${g}`:g}else if(r&&!f||e==null&&m)return g=`? ${g}`,p&&!y?g+=Z(g,t.indent,c(p)):u&&i&&i(),g;y&&(p=null),m?(p&&(g+=Z(g,t.indent,c(p))),g=`? ${g}
${l}:`):(g=`${g}:`,p&&(g+=Z(g,t.indent,c(p))));let b,S,A;B(e)?(b=!!e.spaceBefore,S=e.commentBefore,A=e.comment):(b=!1,S=null,A=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!m&&!p&&E(e)&&(t.indentAtStart=g.length+1),u=!1,!h&&a.length>=2&&!t.inFlow&&!m&&ge(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let O=!1;const k=de(e,t,()=>O=!0,()=>u=!0);let I=" ";if(p||b||S){if(I=b?`
`:"",S){const _=c(S);I+=`
${G(_,t.indent)}`}k===""&&!t.inFlow?I===`
`&&(I=`
`):I+=`
${t.indent}`}else if(!m&&C(e)){const _=k[0],L=k.indexOf(`
`),M=L!==-1,V=(w=(T=t.inFlow)!=null?T:e.flow)!=null?w:e.items.length===0;if(M||!V){let ie=!1;if(M&&(_==="&"||_==="!")){let v=k.indexOf(" ");_==="&"&&v!==-1&&v<L&&k[v+1]==="!"&&(v=k.indexOf(" ",v+1)),(v===-1||L<v)&&(ie=!0)}ie||(I=`
${t.indent}`)}}else(k===""||k[0]===`
`)&&(I="");return g+=I+k,t.inFlow?O&&n&&n():A&&!O?g+=Z(g,t.indent,c(A)):u&&i&&i(),g}function ts(s,e){(s==="debug"||s==="warn")&&console.warn(e)}const _e="<<",Q={identify:s=>s===_e||typeof s=="symbol"&&s.description===_e,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new N(Symbol(_e)),{addToJSMap:ss}),stringify:()=>_e},Hs=(s,e)=>(Q.identify(e)||E(e)&&(!e.type||e.type===N.PLAIN)&&Q.identify(e.value))&&(s==null?void 0:s.doc.schema.tags.some(t=>t.tag===Q.tag&&t.default));function ss(s,e,t){if(t=s&&se(t)?t.resolve(s.doc):t,ge(t))for(const n of t.items)it(s,e,n);else if(Array.isArray(t))for(const n of t)it(s,e,n);else it(s,e,t)}function it(s,e,t){const n=s&&se(t)?t.resolve(s.doc):t;if(!ye(n))throw new Error("Merge sources must be maps or map aliases");const i=n.toJSON(null,s,Map);for(const[r,o]of i)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function ns(s,e,{key:t,value:n}){if(B(t)&&t.addToJSMap)t.addToJSMap(s,e,n);else if(Hs(s,t))ss(s,e,n);else{const i=q(t,"",s);if(e instanceof Map)e.set(i,q(n,i,s));else if(e instanceof Set)e.add(i);else{const r=Xs(t,i,s),o=q(n,r,s);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}function Xs(s,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(B(s)&&(t!=null&&t.doc)){const n=es(t.doc,{});n.anchors=new Set;for(const r of t.anchors.keys())n.anchors.add(r.anchor);n.inFlow=!0,n.inStringifyKey=!0;const i=s.toString(n);if(!t.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),ts(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}function wt(s,e,t){const n=Ae(s,void 0,t),i=Ae(e,void 0,t);return new K(n,i)}class K{constructor(e,t=null){Object.defineProperty(this,F,{value:Vt}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return B(t)&&(t=t.clone(e)),B(n)&&(n=n.clone(e)),new K(t,n)}toJSON(e,t){const n=t!=null&&t.mapAsMap?new Map:{};return ns(t,n,this)}toString(e,t,n){return e!=null&&e.doc?Ws(this,e,t,n):JSON.stringify(this)}}function is(s,e,t){var r;return(((r=e.inFlow)!=null?r:s.flow)?Zs:zs)(s,e,t)}function zs({comment:s,items:e},t,{blockItemPrefix:n,flowChars:i,itemIndent:r,onChompKeep:o,onComment:l}){const{indent:a,options:{commentString:c}}=t,h=Object.assign({},t,{indent:r,type:null});let f=!1;const p=[];for(let y=0;y<e.length;++y){const u=e[y];let g=null;if(B(u))!f&&u.spaceBefore&&p.push(""),Fe(t,p,u.commentBefore,f),u.comment&&(g=u.comment);else if($(u)){const S=B(u.key)?u.key:null;S&&(!f&&S.spaceBefore&&p.push(""),Fe(t,p,S.commentBefore,f))}f=!1;let b=de(u,h,()=>g=null,()=>f=!0);g&&(b+=Z(b,r,c(g))),f&&g&&(f=!1),p.push(n+b)}let m;if(p.length===0)m=i.start+i.end;else{m=p[0];for(let y=1;y<p.length;++y){const u=p[y];m+=u?`
${a}${u}`:`
`}}return s?(m+=`
`+G(c(s),a),l&&l()):f&&o&&o(),m}function Zs({items:s},e,{flowChars:t,itemIndent:n}){const{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:l}}=e;n+=r;const a=Object.assign({},e,{indent:n,inFlow:!0,type:null});let c=!1,h=0;const f=[];for(let y=0;y<s.length;++y){const u=s[y];let g=null;if(B(u))u.spaceBefore&&f.push(""),Fe(e,f,u.commentBefore,!1),u.comment&&(g=u.comment);else if($(u)){const S=B(u.key)?u.key:null;S&&(S.spaceBefore&&f.push(""),Fe(e,f,S.commentBefore,!1),S.comment&&(c=!0));const A=B(u.value)?u.value:null;A?(A.comment&&(g=A.comment),A.commentBefore&&(c=!0)):u.value==null&&(S!=null&&S.comment)&&(g=S.comment)}g&&(c=!0);let b=de(u,a,()=>g=null);y<s.length-1&&(b+=","),g&&(b+=Z(b,n,l(g))),!c&&(f.length>h||b.includes(`
`))&&(c=!0),f.push(b),h=f.length}const{start:p,end:m}=t;if(f.length===0)return p+m;if(!c){const y=f.reduce((u,g)=>u+g.length+2,2);c=e.options.lineWidth>0&&y>e.options.lineWidth}if(c){let y=p;for(const u of f)y+=u?`
${r}${i}${u}`:`
`;return`${y}
${i}${m}`}else return`${p}${o}${f.join(" ")}${o}${m}`}function Fe({indent:s,options:{commentString:e}},t,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){const r=G(e(n),s);t.push(r.trimStart())}}function x(s,e){const t=E(e)?e.value:e;for(const n of s)if($(n)&&(n.key===e||n.key===t||E(n.key)&&n.key.value===t))return n}class D extends Zt{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(W,e),this.items=[]}static from(e,t,n){const{keepUndefined:i,replacer:r}=n,o=new this(e),l=(a,c)=>{if(typeof r=="function")c=r.call(t,a,c);else if(Array.isArray(r)&&!r.includes(a))return;(c!==void 0||i)&&o.items.push(wt(a,c,n))};if(t instanceof Map)for(const[a,c]of t)l(a,c);else if(t&&typeof t=="object")for(const a of Object.keys(t))l(a,t[a]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){var o;let n;$(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new K(e,e==null?void 0:e.value):n=new K(e.key,e.value);const i=x(this.items,n.key),r=(o=this.schema)==null?void 0:o.sortMapEntries;if(i){if(!t)throw new Error(`Key ${n.key} already set`);E(i.value)&&zt(n.value)?i.value.value=n.value:i.value=n.value}else if(r){const l=this.items.findIndex(a=>r(n,a)<0);l===-1?this.items.push(n):this.items.splice(l,0,n)}else this.items.push(n)}delete(e){const t=x(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){var r;const n=x(this.items,e),i=n==null?void 0:n.value;return(r=!t&&E(i)?i.value:i)!=null?r:void 0}has(e){return!!x(this.items,e)}set(e,t){this.add(new K(e,t),!0)}toJSON(e,t,n){const i=n?new n:t!=null&&t.mapAsMap?new Map:{};t!=null&&t.onCreate&&t.onCreate(i);for(const r of this.items)ns(t,i,r);return i}toString(e,t,n){if(!e)return JSON.stringify(this);for(const i of this.items)if(!$(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),is(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}}const be={collection:"map",default:!0,nodeClass:D,tag:"tag:yaml.org,2002:map",resolve(s,e){return ye(s)||e("Expected a mapping for this tag"),s},createNode:(s,e,t)=>D.from(s,e,t)};class X extends Zt{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(me,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=Ce(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){const n=Ce(e);if(typeof n!="number")return;const i=this.items[n];return!t&&E(i)?i.value:i}has(e){const t=Ce(e);return typeof t=="number"&&t<this.items.length}set(e,t){const n=Ce(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);const i=this.items[n];E(i)&&zt(t)?i.value=t:this.items[n]=t}toJSON(e,t){const n=[];t!=null&&t.onCreate&&t.onCreate(n);let i=0;for(const r of this.items)n.push(q(r,String(i++),t));return n}toString(e,t,n){return e?is(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){const{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let l of t){if(typeof i=="function"){const a=t instanceof Set?l:String(o++);l=i.call(t,a,l)}r.items.push(Ae(l,void 0,n))}}return r}}function Ce(s){let e=E(s)?s.value:s;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const we={collection:"seq",default:!0,nodeClass:X,tag:"tag:yaml.org,2002:seq",resolve(s,e){return ge(s)||e("Expected a sequence for this tag"),s},createNode:(s,e,t)=>X.from(s,e,t)},We={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),Te(s,e,t,n)}},He={identify:s=>s==null,createNode:()=>new N(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new N(null),stringify:({source:s},e)=>typeof s=="string"&&He.test.test(s)?s:e.options.nullStr},St={identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:s=>new N(s[0]==="t"||s[0]==="T"),stringify({source:s,value:e},t){if(s&&St.test.test(s)){const n=s[0]==="t"||s[0]==="T";if(e===n)return s}return e?t.options.trueStr:t.options.falseStr}};function U({format:s,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);const 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 o=r.indexOf(".");o<0&&(o=r.length,r+=".");let l=e-(r.length-o-1);for(;l-- >0;)r+="0"}return r}const rs={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:U},os={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){const e=Number(s.value);return isFinite(e)?e.toExponential():U(s)}},ls={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(s){const e=new N(parseFloat(s)),t=s.indexOf(".");return t!==-1&&s[s.length-1]==="0"&&(e.minFractionDigits=s.length-t-1),e},stringify:U},Xe=s=>typeof s=="bigint"||Number.isInteger(s),kt=(s,e,t,{intAsBigInt:n})=>n?BigInt(s):parseInt(s.substring(e),t);function as(s,e,t){const{value:n}=s;return Xe(n)&&n>=0?t+n.toString(e):U(s)}const cs={identify:s=>Xe(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(s,e,t)=>kt(s,2,8,t),stringify:s=>as(s,8,"0o")},fs={identify:Xe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(s,e,t)=>kt(s,0,10,t),stringify:U},us={identify:s=>Xe(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(s,e,t)=>kt(s,2,16,t),stringify:s=>as(s,16,"0x")},xs=[be,we,We,He,St,cs,fs,us,rs,os,ls];function Mt(s){return typeof s=="bigint"||Number.isInteger(s)}const Be=({value:s})=>JSON.stringify(s),en=[{identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify:Be},{identify:s=>s==null,createNode:()=>new N(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Be},{identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:s=>s==="true",stringify:Be},{identify:Mt,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})=>Mt(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:Be}],tn={default:!0,tag:"",test:/^/,resolve(s,e){return e(`Unresolved plain scalar ${JSON.stringify(s)}`),s}},sn=[be,we].concat(en,tn),Nt={identify:s=>s instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(s,e){if(typeof atob=="function"){const 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){const o=t;let l;if(typeof btoa=="function"){let a="";for(let c=0;c<o.length;++c)a+=String.fromCharCode(o[c]);l=btoa(a)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e||(e=N.BLOCK_LITERAL),e!==N.QUOTE_DOUBLE){const a=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(l.length/a),h=new Array(c);for(let f=0,p=0;f<c;++f,p+=a)h[f]=l.substr(p,a);l=h.join(e===N.BLOCK_LITERAL?`
`:" ")}return Te({comment:s,type:e,value:l},n,i,r)}};function hs(s,e){var t;if(ge(s))for(let n=0;n<s.items.length;++n){let i=s.items[n];if(!$(i)){if(ye(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");const r=i.items[0]||new K(new N(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
${r.key.commentBefore}`:i.commentBefore),i.comment){const o=(t=r.value)!=null?t:r.key;o.comment=o.comment?`${i.comment}
${o.comment}`:i.comment}i=r}s.items[n]=$(i)?i:new K(i)}}else e("Expected a sequence for this tag");return s}function ds(s,e,t){const{replacer:n}=t,i=new X(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 l,a;if(Array.isArray(o))if(o.length===2)l=o[0],a=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const c=Object.keys(o);if(c.length===1)l=c[0],a=o[l];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else l=o;i.items.push(wt(l,a,t))}return i}const Ot={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:hs,createNode:ds};class ue extends X{constructor(){super(),this.add=D.prototype.add.bind(this),this.delete=D.prototype.delete.bind(this),this.get=D.prototype.get.bind(this),this.has=D.prototype.has.bind(this),this.set=D.prototype.set.bind(this),this.tag=ue.tag}toJSON(e,t){if(!t)return super.toJSON(e);const n=new Map;t!=null&&t.onCreate&&t.onCreate(n);for(const i of this.items){let r,o;if($(i)?(r=q(i.key,"",t),o=q(i.value,r,t)):r=q(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){const i=ds(e,t,n),r=new this;return r.items=i.items,r}}ue.tag="tag:yaml.org,2002:omap";const At={collection:"seq",identify:s=>s instanceof Map,nodeClass:ue,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){const t=hs(s,e),n=[];for(const{key:i}of t.items)E(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new ue,t)},createNode:(s,e,t)=>ue.from(s,e,t)};function ps({value:s,source:e},t){return e&&(s?ms:ys).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}const ms={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 N(!0),stringify:ps},ys={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 N(!1),stringify:ps},nn={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:U},rn={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){const e=Number(s.value);return isFinite(e)?e.toExponential():U(s)}},on={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(s){const e=new N(parseFloat(s.replace(/_/g,""))),t=s.indexOf(".");if(t!==-1){const n=s.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:U},Le=s=>typeof s=="bigint"||Number.isInteger(s);function ze(s,e,t,{intAsBigInt:n}){const 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}const o=BigInt(s);return i==="-"?BigInt(-1)*o:o}const r=parseInt(s,t);return i==="-"?-1*r:r}function It(s,e,t){const{value:n}=s;if(Le(n)){const i=n.toString(e);return n<0?"-"+t+i.substr(1):t+i}return U(s)}const ln={identify:Le,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,e,t)=>ze(s,2,2,t),stringify:s=>It(s,2,"0b")},an={identify:Le,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,e,t)=>ze(s,1,8,t),stringify:s=>It(s,8,"0")},cn={identify:Le,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,e,t)=>ze(s,0,10,t),stringify:U},fn={identify:Le,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,e,t)=>ze(s,2,16,t),stringify:s=>It(s,16,"0x")};class he extends D{constructor(e){super(e),this.tag=he.tag}add(e){let t;$(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new K(e.key,null):t=new K(e,null),x(this.items,t.key)||this.items.push(t)}get(e,t){const n=x(this.items,e);return!t&&$(n)?E(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}`);const n=x(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new K(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){const{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(wt(o,null,n));return r}}he.tag="tag:yaml.org,2002:set";const Et={collection:"map",identify:s=>s instanceof Set,nodeClass:he,default:!1,tag:"tag:yaml.org,2002:set",createNode:(s,e,t)=>he.from(s,e,t),resolve(s,e){if(ye(s)){if(s.hasAllNullValues(!0))return Object.assign(new he,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};function Tt(s,e){const t=s[0],n=t==="-"||t==="+"?s.substring(1):s,i=o=>e?BigInt(o):Number(o),r=n.replace(/_/g,"").split(":").reduce((o,l)=>o*i(60)+i(l),i(0));return t==="-"?i(-1)*r:r}function gs(s){let{value:e}=s,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return U(s);let n="";e<0&&(n="-",e*=t(-1));const i=t(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),n+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const bs={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})=>Tt(s,t),stringify:gs},ws={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=>Tt(s,!1),stringify:gs},Ze={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){const e=s.match(Ze.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,t,n,i,r,o,l]=e.map(Number),a=e[7]?Number((e[7]+"00").substr(1,3)):0;let c=Date.UTC(t,n-1,i,r||0,o||0,l||0,a);const h=e[8];if(h&&h!=="Z"){let f=Tt(h,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:s})=>s.toISOString().replace(/(T00:00:00)?\.000Z$/,"")},Kt=[be,we,We,He,ms,ys,ln,an,cn,fn,nn,rn,on,Nt,Q,At,Ot,Et,bs,ws,Ze],Pt=new Map([["core",xs],["failsafe",[be,we,We]],["json",sn],["yaml11",Kt],["yaml-1.1",Kt]]),jt={binary:Nt,bool:St,float:ls,floatExp:os,floatNaN:rs,floatTime:ws,int:fs,intHex:us,intOct:cs,intTime:bs,map:be,merge:Q,null:He,omap:At,pairs:Ot,seq:we,set:Et,timestamp:Ze},un={"tag:yaml.org,2002:binary":Nt,"tag:yaml.org,2002:merge":Q,"tag:yaml.org,2002:omap":At,"tag:yaml.org,2002:pairs":Ot,"tag:yaml.org,2002:set":Et,"tag:yaml.org,2002:timestamp":Ze};function rt(s,e,t){const n=Pt.get(e);if(n&&!s)return t&&!n.includes(Q)?n.concat(Q):n.slice();let i=n;if(!i)if(Array.isArray(s))i=[];else{const r=Array.from(Pt.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(s))for(const r of s)i=i.concat(r);else typeof s=="function"&&(i=s(i.slice()));return t&&(i=i.concat(Q)),i.reduce((r,o)=>{const l=typeof o=="string"?jt[o]:o;if(!l){const a=JSON.stringify(o),c=Object.keys(jt).map(h=>JSON.stringify(h)).join(", ");throw new Error(`Unknown custom tag ${a}; use one of ${c}`)}return r.includes(l)||r.push(l),r},[])}const hn=(s,e)=>s.key<e.key?-1:s.key>e.key?1:0;class xe{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(e)?rt(e,"compat"):e?rt(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?un:{},this.tags=rt(t,this.name,n),this.toStringOptions=l!=null?l:null,Object.defineProperty(this,W,{value:be}),Object.defineProperty(this,Y,{value:We}),Object.defineProperty(this,me,{value:we}),this.sortMapEntries=typeof o=="function"?o:o===!0?hn:null}clone(){const e=Object.create(xe.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function dn(s,e){var a;const t=[];let n=e.directives===!0;if(e.directives!==!1&&s.directives){const c=s.directives.toString(s);c?(t.push(c),n=!0):s.directives.docStart&&(n=!0)}n&&t.push("---");const i=es(s,e),{commentString:r}=i.options;if(s.commentBefore){t.length!==1&&t.unshift("");const c=r(s.commentBefore);t.unshift(G(c,""))}let o=!1,l=null;if(s.contents){if(B(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){const f=r(s.contents.commentBefore);t.push(G(f,""))}i.forceBlockIndent=!!s.comment,l=s.contents.comment}const c=l?void 0:()=>o=!0;let h=de(s.contents,i,()=>l=null,c);l&&(h+=Z(h,"",r(l))),(h[0]==="|"||h[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${h}`:t.push(h)}else t.push(de(s.contents,i));if((a=s.directives)!=null&&a.docEnd)if(s.comment){const c=r(s.comment);c.includes(`
`)?(t.push("..."),t.push(G(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=s.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||l)&&t[t.length-1]!==""&&t.push(""),t.push(G(r(c),"")))}return t.join(`
`)+`
`}class Se{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,F,{value:ut});let i=null;typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=r;let{version:o}=r;n!=null&&n._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new P({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){const e=Object.create(Se.prototype,{[F]:{value:ut}});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=B(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){re(this.contents)&&this.contents.add(e)}addIn(e,t){re(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const n=Ht(this);e.anchor=!t||n.has(t)?Xt(t||"a",n):t}return new Je(e.anchor)}createNode(e,t,n){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){const g=S=>typeof S=="number"||S instanceof String||S instanceof Number,b=t.filter(g).map(String);b.length>0&&(t=t.concat(b)),i=t}else n===void 0&&t&&(n=t,t=void 0);const{aliasDuplicateObjects:r,anchorPrefix:o,flow:l,keepUndefined:a,onTagObj:c,tag:h}=n!=null?n:{},{onAnchor:f,setAnchors:p,sourceObjects:m}=Fs(this,o||"a"),y={aliasDuplicateObjects:r!=null?r:!0,keepUndefined:a!=null?a:!1,onAnchor:f,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:m},u=Ae(e,h,y);return l&&C(u)&&(u.flow=!0),p(),u}createPair(e,t,n={}){const i=this.createNode(e,null,n),r=this.createNode(t,null,n);return new K(i,r)}delete(e){return re(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ne(e)?this.contents==null?!1:(this.contents=null,!0):re(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return C(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Ne(e)?!t&&E(this.contents)?this.contents.value:this.contents:C(this.contents)?this.contents.getIn(e,t):void 0}has(e){return C(this.contents)?this.contents.has(e):!1}hasIn(e){return Ne(e)?this.contents!==void 0:C(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=qe(this.schema,[e],t):re(this.contents)&&this.contents.set(e,t)}setIn(e,t){Ne(e)?this.contents=t:this.contents==null?this.contents=qe(this.schema,Array.from(e),t):re(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 P({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new P({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new xe(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:o}={}){const l={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},a=q(this.contents,t!=null?t:"",l);if(typeof r=="function")for(const{count:c,res:h}of l.anchors.values())r(h,c);return typeof o=="function"?ce(o,{"":a},"",a):a}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return dn(this,e)}}function re(s){if(C(s))return!0;throw new Error("Expected a YAML collection as document contents")}class Lt extends Error{constructor(e,t,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=t}}class ee extends Lt{constructor(e,t,n){super("YAMLParseError",e,t,n)}}class Ss extends Lt{constructor(e,t,n){super("YAMLWarning",e,t,n)}}const Re=(s,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(l=>e.linePos(l));const{line:n,col:i}=t.linePos[0];t.message+=` at line ${n}, column ${i}`;let r=i-1,o=s.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){const l=Math.min(r-39,o.length-79);o="…"+o.substring(l),r-=l-1}if(o.length>80&&(o=o.substring(0,79)+"…"),n>1&&/^ *$/.test(o.substring(0,r))){let l=s.substring(e.lineStarts[n-2],e.lineStarts[n-1]);l.length>80&&(l=l.substring(0,79)+`…
`),o=l+o}if(/[^ ]/.test(o)){let l=1;const a=t.linePos[1];a&&a.line===n&&a.col>i&&(l=Math.max(1,Math