System.register(["./rolldown-runtime-legacy-C7CQ20b7.js"],function(e,t){var n,s,i,r,o,a,c,l,u,f,h,p,d,m,g,y,b,w,k,v,A,S,E,N,O,I,x,T,C,L,j,$,_,M,K,B,D,q,F,P,U,R,Y,V,W,J,G,Q,H,X,z,Z,ee,te,ne,se,ie,re,oe,ae,ce,le,ue,fe,he,pe,de,me,ge,ye,be,we,ke,ve,Ae,Se,Ee,Ne,Oe,Ie,xe,Te,Ce,Le,je,$e,_e,Me,Ke,Be,De,qe,Fe,Pe,Ue,Re,Ye,Ve,We,Je,Ge,Qe,He,Xe,ze,Ze,et,tt,nt,st,it,rt,ot,at,ct,lt,ut,ft,ht,pt,dt,mt,gt,yt,bt,wt,kt,vt,At,St,Et,Nt,Ot,It,xt,Tt,Ct,Lt,jt,$t,_t,Mt,Kt,Bt,Dt,qt,Ft,Pt,Ut,Rt,Yt,Vt,Wt,Jt,Gt,Qt,Ht,Xt,zt,Zt,en,tn,nn,sn,rn,on,an,cn,ln,un,fn,hn,pn,dn,mn,gn,yn,bn,wn,kn,vn,An,Sn,En,Nn,On,In,xn,Tn,Cn,Ln,jn,$n,_n,Mn,Kn,Bn,Dn,qn,Fn,Pn,Un,Rn,Yn,Vn,Wn,Jn,Gn,Qn,Hn,Xn,zn;function Zn(e){return null==e}function es(e){return"object"==typeof e&&null!==e}function ts(e){return Array.isArray(e)?e:Zn(e)?[]:[e]}function ns(e,t){var n,s,i,r;if(t)for(n=0,s=(r=Object.keys(t)).length;na&&(t=s-a+(r=" ... ").length),n-s>a&&(n=s+a-(o=" ...").length),{str:r+e.slice(t,n).replace(/\t/g,"→")+o,pos:s-t+r.length}}function cs(e,t){return s.repeat(" ",t-e.length)+e}function ls(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var n,i=/\r?\n|\r|\0/g,r=[0],o=[],a=-1;n=i.exec(e.buffer);)o.push(n.index),r.push(n.index+n[0].length),e.position<=n.index&&a<0&&(a=r.length-2);a<0&&(a=r.length-1);var c,l,u="",f=Math.min(e.line+t.linesAfter,o.length).toString().length,h=t.maxLength-(t.indent+f+3);for(c=1;c<=t.linesBefore&&!(a-c<0);c++)l=as(e.buffer,r[a-c],o[a-c],e.position-(r[a]-r[a-c]),h),u=s.repeat(" ",t.indent)+cs((e.line-c+1).toString(),f)+" | "+l.str+"\n"+u;for(l=as(e.buffer,r[a],o[a],e.position,h),u+=s.repeat(" ",t.indent)+cs((e.line+1).toString(),f)+" | "+l.str+"\n",u+=s.repeat("-",t.indent+f+3+l.pos)+"^\n",c=1;c<=t.linesAfter&&!(a+c>=o.length);c++)l=as(e.buffer,r[a+c],o[a+c],e.position-(r[a]-r[a+c]),h),u+=s.repeat(" ",t.indent)+cs((e.line+c+1).toString(),f)+" | "+l.str+"\n";return u.replace(/\n$/,"")}function us(e,t){if(t=t||{},Object.keys(t).forEach(function(t){if(-1===o.indexOf(t))throw new i('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=function(e){var t={};return null!==e&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}(t.styleAliases||null),-1===a.indexOf(this.kind))throw new i('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}function fs(e,t){var n=[];return e[t].forEach(function(e){var t=n.length;n.forEach(function(n,s){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=s)}),n[t]=e}),n}function hs(e){return this.extend(e)}function ps(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)}function ds(){return null}function ms(e){return null===e}function gs(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)}function ys(e){return"true"===e||"True"===e||"TRUE"===e}function bs(e){return"[object Boolean]"===Object.prototype.toString.call(e)}function ws(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function ks(e){return 48<=e&&e<=55}function vs(e){return 48<=e&&e<=57}function As(e){if(null===e)return!1;var t,n=e.length,s=0,i=!1;if(!n)return!1;if("-"!==(t=e[s])&&"+"!==t||(t=e[++s]),"0"===t){if(s+1===n)return!0;if("b"===(t=e[++s])){for(s++;s=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)}function Is(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(s.isNegativeZero(e))return"-0.0";return n=e.toString(10),b.test(n)?n.replace("e",".e"):n}function xs(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||s.isNegativeZero(e))}function Ts(e){return null!==e&&(null!==A.exec(e)||null!==S.exec(e))}function Cs(e){var t,n,s,i,r,o,a,c,l=0,u=null;if(null===(t=A.exec(e))&&(t=S.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],s=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,s,i));if(r=+t[4],o=+t[5],a=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(u=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(u=-u)),c=new Date(Date.UTC(n,s,i,r,o,a,l)),u&&c.setTime(c.getTime()-u),c}function Ls(e){return e.toISOString()}function js(e){return"<<"===e||null===e}function $s(e){if(null===e)return!1;var t,n,s=0,i=e.length,r=O;for(n=0;n64)){if(t<0)return!1;s+=6}return s%8==0}function _s(e){var t,n,s=e.replace(/[\r\n=]/g,""),i=s.length,r=O,o=0,a=[];for(t=0;t>16&255),a.push(o>>8&255),a.push(255&o)),o=o<<6|r.indexOf(s.charAt(t));return 0==(n=i%4*6)?(a.push(o>>16&255),a.push(o>>8&255),a.push(255&o)):18===n?(a.push(o>>10&255),a.push(o>>2&255)):12===n&&a.push(o>>4&255),new Uint8Array(a)}function Ms(e){var t,n,s="",i=0,r=e.length,o=O;for(t=0;t>18&63],s+=o[i>>12&63],s+=o[i>>6&63],s+=o[63&i]),i=(i<<8)+e[t];return 0==(n=r%3)?(s+=o[i>>18&63],s+=o[i>>12&63],s+=o[i>>6&63],s+=o[63&i]):2===n?(s+=o[i>>10&63],s+=o[i>>4&63],s+=o[i<<2&63],s+=o[64]):1===n&&(s+=o[i>>2&63],s+=o[i<<4&63],s+=o[64],s+=o[64]),s}function Ks(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)}function Bs(e){if(null===e)return!0;var t,n,s,i,r,o=[],a=e;for(t=0,n=a.length;t>10),56320+(e-65536&1023))}function Zs(e,t,n){"__proto__"===t?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}function ei(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||M,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function ti(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=r(n),new i(t,n)}function ni(e,t){throw ti(e,t)}function si(e,t){e.onWarning&&e.onWarning.call(null,ti(e,t))}function ii(e,t,n,s){var i,r,o,a;if(t1&&(e.result+=s.repeat("\n",t-1))}function fi(e,t){var n,s,i=e.tag,r=e.anchor,o=[],a=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=o),s=e.input.charCodeAt(e.position);0!==s&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,ni(e,"tab characters must not be used in indentation")),45===s)&&Ws(e.input.charCodeAt(e.position+1));)if(a=!0,e.position++,ci(e,!0,-1)&&e.lineIndent<=t)o.push(null),s=e.input.charCodeAt(e.position);else if(n=e.line,di(e,t,q,!1,!0),o.push(e.result),ci(e,!0,-1),s=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==s)ni(e,"bad indentation of a sequence entry");else if(e.lineIndentt?m=1:e.lineIndent===t?m=0:e.lineIndentt?m=1:e.lineIndent===t?m=0:e.lineIndentt)&&(y&&(o=e.line,a=e.lineStart,c=e.position),di(e,t,F,!0,i)&&(y?m=e.result:g=e.result),y||(oi(e,h,p,d,m,g,o,a,c),d=m=g=null),ci(e,!0,-1),l=e.input.charCodeAt(e.position)),(e.line===r||e.lineIndent>t)&&0!==l)ni(e,"bad indentation of a mapping entry");else if(e.lineIndent=0))break;0===r?ni(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?ni(e,"repeat of an indentation width identifier"):(l=t+r-1,c=!0)}if(Vs(h)){do{h=e.input.charCodeAt(++e.position)}while(Vs(h));if(35===h)do{h=e.input.charCodeAt(++e.position)}while(!Ys(h)&&0!==h)}for(;0!==h;){for(ai(e),e.lineIndent=0,h=e.input.charCodeAt(e.position);(!c||e.lineIndentl&&(l=e.lineIndent),Ys(h))u++;else{if(e.lineIndent0){for(i=o,r=0;i>0;i--)(o=Gs(a=e.input.charCodeAt(++e.position)))>=0?r=(r<<4)+o:ni(e,"expected hexadecimal character");e.result+=zs(r),e.position++}else ni(e,"unknown escape sequence");n=s=e.position}else Ys(a)?(ii(e,n,s,!0),ui(e,ci(e,!1,t)),n=s=e.position):e.position===e.lineStart&&li(e)?ni(e,"unexpected end of the document within a double quoted scalar"):(e.position++,s=e.position)}ni(e,"unexpected end of the stream within a double quoted scalar")}(e,p)?y=!0:function(e){var t,n,s=e.input.charCodeAt(e.position);if(42!==s)return!1;for(s=e.input.charCodeAt(++e.position),t=e.position;0!==s&&!Ws(s)&&!Js(s);)s=e.input.charCodeAt(++e.position);return e.position===t&&ni(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),K.call(e.anchorMap,n)||ni(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],ci(e,!0,-1),!0}(e)?(y=!0,null===e.tag&&null===e.anchor||ni(e,"alias node should not have any properties")):function(e,t,n){var s,i,r,o,a,c,l,u=e.kind,f=e.result,h=e.input.charCodeAt(e.position);if(Ws(h)||Js(h)||35===h||38===h||42===h||33===h||124===h||62===h||39===h||34===h||37===h||64===h||96===h)return!1;if((63===h||45===h)&&(Ws(s=e.input.charCodeAt(e.position+1))||n&&Js(s)))return!1;for(e.kind="scalar",e.result="",i=r=e.position,o=!1;0!==h;){if(58===h){if(Ws(s=e.input.charCodeAt(e.position+1))||n&&Js(s))break}else if(35===h){if(Ws(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&li(e)||n&&Js(h))break;if(Ys(h)){if(a=e.line,c=e.lineStart,l=e.lineIndent,ci(e,!1,-1),e.lineIndent>=t){o=!0,h=e.input.charCodeAt(e.position);continue}e.position=r,e.line=a,e.lineStart=c,e.lineIndent=l;break}}o&&(ii(e,i,r,!1),ui(e,e.line-a),i=r=e.position,o=!1),Vs(h)||(r=e.position+1),h=e.input.charCodeAt(++e.position)}return ii(e,i,r,!1),!!e.result||(e.kind=u,e.result=f,!1)}(e,p,B===n)&&(y=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===m&&(y=c&&fi(e,d))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&ni(e,'unacceptable node kind for ! tag; it should be "scalar", not "'+e.kind+'"'),l=0,u=e.implicitTypes.length;l"),null!==e.result&&h.kind!==e.kind&&ni(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+h.kind+'", not "'+e.kind+'"'),h.resolve(e.result,e.tag)?(e.result=h.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):ni(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||y}function mi(e){var t,n,s,i,r=e.position,o=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(i=e.input.charCodeAt(e.position))&&(ci(e,!0,-1),i=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==i));){for(o=!0,i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!Ws(i);)i=e.input.charCodeAt(++e.position);for(s=[],(n=e.input.slice(t,e.position)).length<1&&ni(e,"directive name must not be less than one character in length");0!==i;){for(;Vs(i);)i=e.input.charCodeAt(++e.position);if(35===i){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&!Ys(i));break}if(Ys(i))break;for(t=e.position;0!==i&&!Ws(i);)i=e.input.charCodeAt(++e.position);s.push(e.input.slice(t,e.position))}0!==i&&ai(e),K.call(z,n)?z[n](e,n,s):si(e,'unknown document directive "'+n+'"')}ci(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,ci(e,!0,-1)):o&&ni(e,"directives end mark is expected"),di(e,e.lineIndent-1,F,!1,!0),ci(e,!0,-1),e.checkLineBreaks&&V.test(e.input.slice(r,e.position))&&si(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&li(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,ci(e,!0,-1)):e.position=55296&&s<=56319&&t+1=56320&&n<=57343?1024*(s-55296)+n-56320+65536:s}function xi(e){return/^\n* /.test(e)}function Ti(e,t,n,s,i,r,o,a){var c,l,u=0,f=null,h=!1,p=!1,d=-1!==s,m=-1,g=Ei(l=Ii(e,0))&&l!==ne&&!Si(l)&&l!==me&&l!==we&&l!==ge&&l!==de&&l!==ve&&l!==Ae&&l!==Ee&&l!==Oe&&l!==le&&l!==fe&&l!==pe&&l!==ae&&l!==Ne&&l!==ye&&l!==be&&l!==he&&l!==ce&&l!==ue&&l!==ke&&l!==Se&&function(e){return!Si(e)&&e!==ge}(Ii(e,e.length-1));if(t||o)for(c=0;c=65536?c+=2:c++){if(!Ei(u=Ii(e,c)))return Ke;g=g&&Oi(u,f,a),f=u}else{for(c=0;c=65536?c+=2:c++){if((u=Ii(e,c))===ie)h=!0,d&&(p=p||c-m-1>s&&" "!==e[m+1],m=c);else if(!Ei(u))return Ke;g=g&&Oi(u,f,a),f=u}p=p||d&&c-m-1>s&&" "!==e[m+1]}return h||p?n>9&&xi(e)?Ke:o?r===Le?Ke:$e:p?Me:_e:!g||o||i(e)?r===Le?Ke:$e:je}function Ci(e,t,n,s,r){e.dump=function(){if(0===t.length)return e.quotingType===Le?'""':"''";if(!e.noCompatMode&&(-1!==xe.indexOf(t)||Te.test(t)))return e.quotingType===Le?'"'+t+'"':"'"+t+"'";var o=e.indent*Math.max(1,n),a=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),c=s||e.flowLevel>-1&&n>=e.flowLevel;switch(Ti(t,c,e.indent,a,function(t){return function(e,t){var n,s;for(n=0,s=e.implicitTypes.length;n"+Li(t,e.indent)+ji(vi(function(e,t){for(var n,s,i,r=/(\n+)([^\n]*)/g,o=(i=-1!==(i=e.indexOf("\n"))?i:e.length,r.lastIndex=i,$i(e.slice(0,i),t)),a="\n"===e[0]||" "===e[0];s=r.exec(e);){var c=s[1],l=s[2];n=" "===l[0],o+=c+(a||n||""===l?"":"\n")+$i(l,t),a=n}return o}(t,a),o));case Ke:return'"'+function(e){for(var t,n="",s=0,i=0;i=65536?i+=2:i++)s=Ii(e,i),!(t=Ie[s])&&Ei(s)?(n+=e[i],s>=65536&&(n+=e[i+1])):n+=t||wi(s);return n}(t)+'"';default:throw new i("impossible error: invalid scalar style")}}()}function Li(e,t){var n=xi(e)?String(t):"",s="\n"===e[e.length-1];return n+(!s||"\n"!==e[e.length-2]&&"\n"!==e?s?"":"-":"+")+"\n"}function ji(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function $i(e,t){if(""===e||" "===e[0])return e;for(var n,s,i=/ [^ ]/g,r=0,o=0,a=0,c="";n=i.exec(e);)(a=n.index)-r>t&&(s=o>r?o:a,c+="\n"+e.slice(r,s),r=s+1),o=a;return c+="\n",e.length-r>t&&o>r?c+=e.slice(r,o)+"\n"+e.slice(o+1):c+=e.slice(r),c.slice(1)}function _i(e,t,n,s){var i,r,o,a="",c=e.tag;for(i=0,r=n.length;i tag resolver accepts not "'+c+'" style');s=a.represent[c](t,c)}e.dump=s}return!0}return!1}function Ki(e,t,n,s,r,o,a){e.tag=null,e.dump=n,Mi(e,n,!1)||Mi(e,n,!0);var c,l=ee.call(e.dump),u=s;s&&(s=e.flowLevel<0||e.flowLevel>t);var f,h,p="[object Object]"===l||"[object Array]"===l;if(p&&(h=-1!==(f=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||h||2!==e.indent&&t>0)&&(r=!1),h&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(p&&h&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),"[object Object]"===l)s&&0!==Object.keys(e.dump).length?(function(e,t,n,s){var r,o,a,c,l,u,f="",h=e.tag,p=Object.keys(n);if(!0===e.sortKeys)p.sort();else if("function"==typeof e.sortKeys)p.sort(e.sortKeys);else if(e.sortKeys)throw new i("sortKeys must be a boolean or a function");for(r=0,o=p.length;r1024)&&(e.dump&&ie===e.dump.charCodeAt(0)?u+="?":u+="? "),u+=e.dump,l&&(u+=Ai(e,t)),Ki(e,t+1,c,!0,l)&&(e.dump&&ie===e.dump.charCodeAt(0)?u+=":":u+=": ",f+=u+=e.dump));e.tag=h,e.dump=f||"{}"}(e,t,e.dump,r),h&&(e.dump="&ref_"+f+e.dump)):(function(e,t,n){var s,i,r,o,a,c="",l=e.tag,u=Object.keys(n);for(s=0,i=u.length;s1024&&(a+="? "),a+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ki(e,t,o,!1,!1)&&(c+=a+=e.dump));e.tag=l,e.dump="{"+c+"}"}(e,t,e.dump),h&&(e.dump="&ref_"+f+" "+e.dump));else if("[object Array]"===l)s&&0!==e.dump.length?(e.noArrayIndent&&!a&&t>0?_i(e,t-1,e.dump,r):_i(e,t,e.dump,r),h&&(e.dump="&ref_"+f+e.dump)):(function(e,t,n){var s,i,r,o="",a=e.tag;for(s=0,i=n.length;s",e.dump=c+" "+e.dump)}return!0}function Bi(e,t){var n,s,i=[],r=[];for(Di(e,i,r),n=0,s=r.length;ner(e,String(t),n));if(e&&"function"==typeof e.toJSON){if(!n||!ut(e))return e.toJSON(t,n);const s={aliasCount:0,count:1,res:void 0};n.anchors.set(e,s),n.onCreate=e=>{s.res=e,delete n.onCreate};const i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return"bigint"!=typeof e||n?.keep?e:Number(e)}function tr(e,t,n){if(it(t)){const s=t.resolve(e),i=n&&s&&n.get(s);return i?i.count*i.aliasCount:0}if(Pi(t)){let s=0;for(const i of t.items){const t=tr(e,i,n);t>s&&(s=t)}return s}if(at(t)){const s=tr(e,t.key,n),i=tr(e,t.value,n);return Math.max(s,i)}return 1}function nr(e,t,n){if(rt(e)&&(e=e.contents),Ui(e))return e;if(at(e)){const t=n.schema[Ze].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||"undefined"!=typeof BigInt&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:s,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=n;let c;if(s&&e&&"object"==typeof e){if(c=a.get(e),c)return c.anchor??(c.anchor=i(e)),new bt(c.anchor);c={anchor:null,node:null},a.set(e,c)}t?.startsWith("!!")&&(t=vt+t.slice(2));let l=function(e,t,n){if(t){const e=n.filter(e=>e.tag===t),s=e.find(e=>!e.format)??e[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return n.find(t=>t.identify?.(e)&&!t.format)}(e,t,o.tags);if(!l){if(e&&"function"==typeof e.toJSON&&(e=e.toJSON()),!e||"object"!=typeof e){const t=new kt(e);return c&&(c.node=t),t}l=e instanceof Map?o[Ze]:Symbol.iterator in Object(e)?o[nt]:o[Ze]}r&&(r(l),delete n.onTagObj);const u=l?.createNode?l.createNode(n.schema,e,n):"function"==typeof l?.nodeClass?.from?l.nodeClass.from(n.schema,e,n):new kt(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function sr(e,t,n){let s=n;for(let i=t.length-1;i>=0;--i){const e=t[i];if("number"==typeof e&&Number.isInteger(e)&&e>=0){const t=[];t[e]=s,s=t}else s=new Map([[e,s]])}return nr(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}function ir(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}function rr(e,t,n="flow",{indentAtStart:s,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return e;ii-Math.max(2,r)?l.push(0):p=i-s);let d=!1,m=-1,g=-1,y=-1;"block"===n&&(m=or(e,m,t.length),-1!==m&&(p=m+c));for(let w;w=e[m+=1];){if("quoted"===n&&"\\"===w){switch(g=m,e[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}y=m}if("\n"===w)"block"===n&&(m=or(e,m,t.length)),p=m+t.length+c,f=void 0;else{if(" "===w&&h&&" "!==h&&"\n"!==h&&"\t"!==h){const t=e[m+1];t&&" "!==t&&"\n"!==t&&"\t"!==t&&(f=m)}if(m>=p)if(f)l.push(f),p=f+c,f=void 0;else if("quoted"===n){for(;" "===h||"\t"===h;)h=w,w=e[m+=1],d=!0;const t=m>y+1?m-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,p=t+c,f=void 0}else d=!0}h=w}if(d&&a&&a(),0===l.length)return e;o&&o();let b=e.slice(0,l[0]);for(let w=0;ws)return!0;if(o=r+1,i-o<=s)return!1}return!0}(n,c,l.length));if(!n)return u?"|\n":">\n";let f,h;for(h=n.length;h>0;--h){const e=n[h-1];if("\n"!==e&&"\t"!==e&&" "!==e)break}let p=n.substring(h);const d=p.indexOf("\n");-1===d?f="-":n===p||d!==p.length-1?(f="+",r&&r()):f="",p&&(n=n.slice(0,-p.length),"\n"===p[p.length-1]&&(p=p.slice(0,-1)),p=p.replace(Lt,`$&${l}`));let m,g=!1,y=-1;for(m=0;m{i=!0});const a=rr(`${b}${e}${p}`,l,It,r);if(!i)return`>${w}\n${l}${a}`}return`|${w}\n${l}${b}${n=n.replace(/\n+/g,`$&${l}`)}${p}`}function fr(e,t,n,s){const{implicitKey:i,inFlow:r}=t,o="string"==typeof e.value?e:Object.assign({},e,{value:String(e.value)});let{type:a}=e;a!==kt.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=kt.QUOTE_DOUBLE);const c=e=>{switch(e){case kt.BLOCK_FOLDED:case kt.BLOCK_LITERAL:return i||r?lr(o.value,t):ur(o,t,n,s);case kt.QUOTE_DOUBLE:return ar(o.value,t);case kt.QUOTE_SINGLE:return cr(o.value,t);case kt.PLAIN:return function(e,t,n,s){const{type:i,value:r}=e,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:u}=t;if(a&&r.includes("\n")||u&&/[[\]{},]/.test(r))return lr(r,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||u||!r.includes("\n")?lr(r,t):ur(e,t,n,s);if(!a&&!u&&i!==kt.PLAIN&&r.includes("\n"))return ur(e,t,n,s);if(Ct(r)){if(""===c)return t.forceBlockIndent=!0,ur(e,t,n,s);if(a&&c===l)return lr(r,t)}const f=r.replace(/\n+/g,`$&\n${c}`);if(o){const e=e=>e.default&&"tag:yaml.org,2002:str"!==e.tag&&e.test?.test(f),{compat:n,tags:s}=t.doc.schema;if(s.some(e)||n?.some(e))return lr(r,t)}return a?f:rr(f,c,Ot,Tt(t,!1))}(o,t,n,s);default:return null}};let l=c(a);if(null===l){const{defaultKeyType:e,defaultStringType:n}=t.options,s=i&&e||n;if(l=c(s),null===l)throw new Error(`Unsupported default string type ${s}`)}return l}function hr(e,t){const n=Object.assign({blockQuote:!0,commentString:Et,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,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let s;switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof n.indent?" ".repeat(n.indent):" ",inFlow:s,options:n}}function pr(e,t,n,s){if(at(e))return e.toString(t,n,s);if(it(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i;const r=Ui(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??(i=function(e,t){if(t.tag){const n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,s;if(ct(t)){s=t.value;let i=e.filter(e=>e.identify?.(s));if(i.length>1){const e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else s=t,n=e.find(e=>e.nodeClass&&s instanceof e.nodeClass);if(!n)throw new Error(`Tag not resolved for ${s?.constructor?.name??(null===s?"null":typeof s)} value`);return n}(t.doc.schema.tags,r));const o=function(e,t,{anchors:n,doc:s}){if(!s.directives)return"";const i=[],r=(ct(e)||Pi(e))&&e.anchor;r&&Hi(r)&&(n.add(r),i.push(`&${r}`));const o=e.tag??(t.default?null:t.tag);return o&&i.push(s.directives.tagString(o)),i.join(" ")}(r,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const a="function"==typeof i.stringify?i.stringify(r,t,n,s):ct(r)?fr(r,t,n,s):r.toString(t,n,s);return o?ct(r)||"{"===a[0]||"["===a[0]?`${o} ${a}`:`${o}\n${t.indent}${a}`:a}function dr(e,t){"debug"!==e&&"warn"!==e||console.warn(t)}function mr(e,t,n){const s=yr(e,n);if(lt(s))for(const i of s.items)gr(e,t,i);else if(Array.isArray(s))for(const i of s)gr(e,t,i);else gr(e,t,s)}function gr(e,t,n){const s=yr(e,n);if(!ot(s))throw new Error("Merge sources must be maps or map aliases");const i=s.toJSON(null,e,Map);for(const[r,o]of i)t instanceof Map?t.has(r)||t.set(r,o):t instanceof Set?t.add(r):Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function yr(e,t){return e&&it(t)?t.resolve(e.doc,e):t}function br(e,t,{key:n,value:s}){if(Ui(n)&&n.addToJSMap)n.addToJSMap(e,t,s);else if(_t(e,n))mr(e,t,s);else{const i=er(n,"",e);if(t instanceof Map)t.set(i,er(s,i,e));else if(t instanceof Set)t.add(i);else{const r=function(e,t,n){if(null===t)return"";if("object"!=typeof t)return String(t);if(Ui(e)&&n?.doc){const t=hr(n.doc,{});t.anchors=new Set;for(const e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;const s=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(s);e.length>40&&(e=e.substring(0,36)+'..."'),dr(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(t)}(n,i,e),o=er(s,r,e);r in t?Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[r]=o}}return t}function wr(e,t,n){return new Mt(nr(e,void 0,n),nr(t,void 0,n))}function kr(e,t,n){return(t.inFlow??e.flow?Ar:vr)(e,t,n)}function vr({comment:e,items:t},n,{blockItemPrefix:s,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){const{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:r,type:null});let f=!1;const h=[];for(let d=0;di=null,()=>f=!0);i&&(o+=Nt(o,r,l(i))),f&&i&&(f=!1),h.push(s+o)}let p;if(0===h.length)p=i.start+i.end;else{p=h[0];for(let e=1;ei=null);l||(l=f.length>u||r.includes("\n")),d0&&(l||(l=f.reduce((e,t)=>e+t.length+2,2)+(r.length+2)>t.options.lineWidth)),l&&(r+=",")),i&&(r+=Nt(r,s,a(i))),f.push(r),u=f.length}const{start:h,end:p}=n;if(0===f.length)return h+p;if(!l){const e=f.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=h;for(const t of f)e+=t?`\n${r}${i}${t}`:"\n";return`${e}\n${i}${p}`}return`${h}${o}${f.join(" ")}${o}${p}`}function Sr({indent:e,options:{commentString:t}},n,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){const i=ir(t(s),e);n.push(i.trimStart())}}function Er(e,t){const n=ct(t)?t.value:t;for(const s of e)if(at(s)){if(s.key===t||s.key===n)return s;if(ct(s.key)&&s.key.value===n)return s}}function Nr(e){let t=ct(e)?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),"number"==typeof t&&Number.isInteger(t)&&t>=0?t:null}function Or({format:e,minFractionDigits:t,tag:n,value:s}){if("bigint"==typeof s)return String(s);const i="number"==typeof s?s:Number(s);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(s,-0)?"-0":JSON.stringify(s);if(!e&&t&&(!n||"tag:yaml.org,2002:float"===n)&&/^-?\d/.test(r)&&!r.includes("e")){let e=r.indexOf(".");e<0&&(e=r.length,r+=".");let n=t-(r.length-e-1);for(;n-- >0;)r+="0"}return r}function Ir(e,t,n){const{value:s}=e;return Wt(s)&&s>=0?n+s.toString(t):Or(e)}function xr(e){return"bigint"==typeof e||Number.isInteger(e)}function Tr(e,t){if(lt(e))for(let n=0;n1&&t("Each pair must have its own sequence indicator");const e=s.items[0]||new Mt(new kt(null));if(s.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${s.commentBefore}\n${e.key.commentBefore}`:s.commentBefore),s.comment){const t=e.value??e.key;t.comment=t.comment?`${s.comment}\n${t.comment}`:s.comment}s=e}e.items[n]=at(s)?s:new Mt(s)}}else t("Expected a sequence for this tag");return e}function Cr(e,t,n){const{replacer:s}=n,i=new Dt(e);i.tag="tag:yaml.org,2002:pairs";let r=0;if(t&&Symbol.iterator in Object(t))for(let o of t){let e,a;if("function"==typeof s&&(o=s.call(t,String(r++),o)),Array.isArray(o)){if(2!==o.length)throw new TypeError(`Expected [key, value] tuple: ${o}`);e=o[0],a=o[1]}else if(o&&o instanceof Object){const t=Object.keys(o);if(1!==t.length)throw new TypeError(`Expected tuple with one key, not ${t.length} keys`);e=t[0],a=o[e]}else e=o;i.items.push(wr(e,a,n))}return i}function Lr({value:e,source:t},n){return t&&(e?on:an).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}function jr(e,t,n,{intAsBigInt:s}){const i=e[0];if("-"!==i&&"+"!==i||(t+=1),e=e.substring(t).replace(/_/g,""),s){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}const t=BigInt(e);return"-"===i?BigInt(-1)*t:t}const r=parseInt(e,n);return"-"===i?-1*r:r}function $r(e,t,n){const{value:s}=e;if(fn(s)){const e=s.toString(t);return s<0?"-"+n+e.substr(1):n+e}return Or(e)}function _r(e,t){const n=e[0],s="-"===n||"+"===n?e.substring(1):e,i=e=>t?BigInt(e):Number(e),r=s.replace(/_/g,"").split(":").reduce((e,t)=>e*i(60)+i(t),i(0));return"-"===n?i(-1)*r:r}function Mr(e){let{value:t}=e,n=e=>e;if("bigint"==typeof t)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return Or(e);let s="";t<0&&(s="-",t*=n(-1));const i=n(60),r=[t%i];return t<60?r.unshift(0):(t=(t-r[0])/i,r.unshift(t%i),t>=60&&(t=(t-r[0])/i,r.unshift(t))),s+r.map(e=>String(e).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}function Kr(e,t,n){const s=An.get(t);if(s&&!e)return n&&!s.includes($t)?s.concat($t):s.slice();let i=s;if(!i){if(!Array.isArray(e)){const e=Array.from(An.keys()).filter(e=>"yaml11"!==e).map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}i=[]}if(Array.isArray(e))for(const r of e)i=i.concat(r);else"function"==typeof e&&(i=e(i.slice()));return n&&(i=i.concat($t)),i.reduce((e,t)=>{const n="string"==typeof t?Sn[t]:t;if(!n){const e=JSON.stringify(t),n=Object.keys(Sn).map(e=>JSON.stringify(e)).join(", ");throw new Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}function Br(e){if(Pi(e))return!0;throw new Error("Expected a YAML collection as document contents")}function Dr(e,{flow:t,indicator:n,next:s,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let c=!1,l=a,u=a,f="",h="",p=!1,d=!1,m=null,g=null,y=null,b=null,w=null,k=null,v=null;for(const E of e)switch(d&&("space"!==E.type&&"newline"!==E.type&&"comma"!==E.type&&r(E.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d=!1),m&&(l&&"comment"!==E.type&&"newline"!==E.type&&r(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),E.type){case"space":t||"doc-start"===n&&"flow-collection"===s?.type||!E.source.includes("\t")||(m=E),u=!0;break;case"comment":{u||r(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const e=E.source.substring(1)||" ";f?f+=h+e:f=e,h="",l=!1;break}case"newline":l?f?f+=E.source:k&&"seq-item-ind"===n||(c=!0):h+=E.source,l=!0,p=!0,(g||y)&&(b=E),u=!0;break;case"anchor":g&&r(E,"MULTIPLE_ANCHORS","A node can have at most one anchor"),E.source.endsWith(":")&&r(E.offset+E.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=E,v??(v=E.offset),l=!1,u=!1,d=!0;break;case"tag":y&&r(E,"MULTIPLE_TAGS","A node can have at most one tag"),y=E,v??(v=E.offset),l=!1,u=!1,d=!0;break;case n:(g||y)&&r(E,"BAD_PROP_ORDER",`Anchors and tags must be after the ${E.source} indicator`),k&&r(E,"UNEXPECTED_TOKEN",`Unexpected ${E.source} in ${t??"collection"}`),k=E,l="seq-item-ind"===n||"explicit-key-ind"===n,u=!1;break;case"comma":if(t){w&&r(E,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),w=E,l=!1,u=!1;break}default:r(E,"UNEXPECTED_TOKEN",`Unexpected ${E.type} token`),l=!1,u=!1}const A=e[e.length-1],S=A?A.offset+A.source.length:i;return d&&s&&"space"!==s.type&&"newline"!==s.type&&"comma"!==s.type&&("scalar"!==s.type||""!==s.source)&&r(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(l&&m.indent<=o||"block-map"===s?.type||"block-seq"===s?.type)&&r(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:w,found:k,spaceBefore:c,comment:f,hasNewline:p,anchor:g,tag:y,newlineAfterProp:b,end:S,start:v??S}}function qr(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes("\n"))return!0;if(e.end)for(const t of e.end)if("newline"===t.type)return!0;return!1;case"flow-collection":for(const t of e.items){for(const e of t.start)if("newline"===e.type)return!0;if(t.sep)for(const e of t.sep)if("newline"===e.type)return!0;if(qr(t.key)||qr(t.value))return!0}return!1;default:return!0}}function Fr(e,t,n){if("flow-collection"===t?.type){const s=t.end[0];s.indent!==e||"]"!==s.source&&"}"!==s.source||!qr(t)||n(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Pr(e,t,n){const{uniqueKeys:s}=e.options;if(!1===s)return!1;const i="function"==typeof s?s:(e,t)=>e===t||ct(e)&&ct(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}function Ur(e,t,n,s){let i="";if(e){let r=!1,o="";for(const a of e){const{source:e,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{n&&!r&&s(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const t=e.substring(1)||" ";i?i+=o+t:i=t,o="";break}case"newline":i&&(o+=e),r=!0;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}function Rr(e,t,n,s,i,r){const o="block-map"===n.type?function({composeNode:e,composeEmptyNode:t},n,s,i,r){const o=new(r?.nodeClass??Kt)(n.schema);n.atRoot&&(n.atRoot=!1);let a=s.offset,c=null;for(const l of s.items){const{start:r,key:u,sep:f,value:h}=l,p=Dr(r,{indicator:"explicit-key-ind",next:u??f?.[0],offset:a,onError:i,parentIndent:s.indent,startOnNewline:!0}),d=!p.found;if(d){if(u&&("block-seq"===u.type?i(a,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in u&&u.indent!==s.indent&&i(a,"BAD_INDENT",jn)),!p.anchor&&!p.tag&&!f){c=p.end,p.comment&&(o.comment?o.comment+="\n"+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||qr(u))&&i(u??r[r.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==s.indent&&i(a,"BAD_INDENT",jn);n.atKey=!0;const m=p.end,g=u?e(n,u,p,i):t(n,m,r,null,p,i);n.schema.compat&&Fr(s.indent,u,i),n.atKey=!1,Pr(n,o.items,g)&&i(m,"DUPLICATE_KEY","Map keys must be unique");const y=Dr(f??[],{indicator:"map-value-ind",next:h,offset:g.range[2],onError:i,parentIndent:s.indent,startOnNewline:!u||"block-scalar"===u.type});if(a=y.end,y.found){d&&("block-map"!==h?.type||y.hasNewline||i(a,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&p.start0){const e=Ur(p,d,n.options.strict,i);e.comment&&(c.comment?c.comment+="\n"+e.comment:c.comment=e.comment),c.range=[s.offset,d,e.offset]}else c.range=[s.offset,d,d];return c}(e,t,n,s,r),a=o.constructor;return"!"===i||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function Yr(e,t,n){const s=t.offset,i=function({offset:e,props:t},n,s){if("block-scalar-header"!==t[0].type)return s(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=t[0],r=i[0];let o=0,a="",c=-1;for(let h=1;h=0;--m){const e=o[m][1];if(""!==e&&"\r"!==e)break;a=m}if(0===a){const e="+"===i.chomp&&o.length>0?"\n".repeat(Math.max(1,o.length-1)):"";let n=s+i.length;return t.source&&(n+=t.source.length),{value:e,type:r,comment:i.comment,range:[s,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let m=0;mc&&(c=t.length),l+=t.length+s.length+1}for(let m=o.length-1;m>=a;--m)o[m][0].length>c&&(a=m+1);let f="",h="",p=!1;for(let m=0;mc||"\t"===t[0]?(" "===h?h="\n":p||"\n"!==h||(h="\n\n"),f+=h+e.slice(c)+t,h="\n",p=!0):""===t?"\n"===h?f+="\n":h="\n":(f+=h+t,h=" ",p=!1)}switch(i.chomp){case"-":break;case"+":for(let e=a;en(s+e,t,i);switch(i){case"scalar":a=kt.PLAIN,c=function(e,t){let n="";switch(e[0]){case"\t":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":n=`block scalar indicator ${e[0]}`;break;case"@":case"`":n=`reserved character ${e[0]}`}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Wr(e)}(r,l);break;case"single-quoted-scalar":a=kt.QUOTE_SINGLE,c=function(e,t){return"'"===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR","Missing closing 'quote"),Wr(e.slice(1,-1)).replace(/''/g,"'")}(r,l);break;case"double-quoted-scalar":a=kt.QUOTE_DOUBLE,c=function(e,t){let n="";for(let s=1;st?e.slice(t,s+1):i)}else n+=i}return'"'===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}(r,l);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[s,s+r.length,s+r.length]}}const u=s+r.length,f=Ur(o,u,t,n);return{value:c,type:a,comment:f.comment,range:[s,u,f.offset]}}function Wr(e){let t,n;try{t=new RegExp("(.*?)(?s(n,"TAG_RESOLVE_FAILED",e)):null;let l,u;l=e.options.stringKeys&&e.atKey?e.schema[tt]:c?function(e,t,n,s,i){if("!"===n)return e[tt];const r=[];for(const a of e.tags)if(!a.collection&&a.tag===n){if(!a.default||!a.test)return a;r.push(a)}for(const a of r)if(a.test?.test(t))return a;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,"tag:yaml.org,2002:str"!==n),e[tt])}(e.schema,i,c,n,s):"scalar"===t.type?function({atKey:e,directives:t,schema:n},s,i,r){const o=n.tags.find(t=>(!0===t.default||e&&"key"===t.default)&&t.test?.test(s))||n[tt];if(n.compat){const e=n.compat.find(e=>e.default&&e.test?.test(s))??n[tt];o.tag!==e.tag&&r(i,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}(e,i,t,s):e.schema[tt];try{const r=l.resolve(i,e=>s(n??t,"TAG_RESOLVE_FAILED",e),e.options);u=ct(r)?r:new kt(r)}catch(f){const e=f instanceof Error?f.message:String(f);s(n??t,"TAG_RESOLVE_FAILED",e),u=new kt(i)}return u.range=a,u.source=i,r&&(u.type=r),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function Hr(e,t,n){if(t){n??(n=t.length);for(let s=n-1;s>=0;--s){let n=t[s];switch(n.type){case"space":case"comment":case"newline":e-=n.source.length;continue}for(n=t[++s];"space"===n?.type;)e+=n.source.length,n=t[++s];break}}return e}function Xr(e,t,n,s){const i=e.atKey,{spaceBefore:r,comment:o,anchor:a,tag:c}=n;let l,u=!0;switch(t.type){case"alias":l=function({options:e},{offset:t,source:n,end:s},i){const r=new bt(n.substring(1));""===r.source&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,a=Ur(s,o,e.strict,i);return r.range=[t,o,a.offset],a.comment&&(r.comment=a.comment),r}(e,t,s),(a||c)&&s(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=Qr(e,t,c,s),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=function(e,t,n,s,i){const r=s.tag,o=r?t.directives.tagName(r.source,e=>i(r,"TAG_RESOLVE_FAILED",e)):null;if("block-seq"===n.type){const{anchor:e,newlineAfterProp:t}=s,n=e&&r?e.offset>r.offset?e:r:e??r;n&&(!t||t.offsete.tag===o&&e.collection===a);if(!c){const s=t.schema.knownTags[o];if(s?.collection!==a)return s?i(r,"BAD_COLLECTION_TYPE",`${s.tag} used for ${a} collection, but expects ${s.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Rr(e,t,n,i,o);t.schema.tags.push(Object.assign({},s,{default:!1})),c=s}const l=Rr(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(r,"TAG_RESOLVE_FAILED",e),t.options)??l,f=Ui(u)?u:new kt(u);return f.range=l.range,f.tag=o,c?.format&&(f.format=c.format),f}(Kn,e,t,n,s),a&&(l.anchor=a.source.substring(1))}catch(f){s(t,"RESOURCE_EXHAUSTION",f instanceof Error?f.message:String(f))}break;default:s(t,"UNEXPECTED_TOKEN","error"===t.type?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??(l=zr(e,t.offset,void 0,null,n,s)),a&&""===l.anchor&&s(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!ct(l)||"string"!=typeof l.value||l.tag&&"tag:yaml.org,2002:str"!==l.tag)&&s(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(l.spaceBefore=!0),o&&("scalar"===t.type&&""===t.source?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function zr(e,t,n,s,{spaceBefore:i,comment:r,anchor:o,tag:a,end:c},l){const u=Qr(e,{type:"scalar",offset:Hr(t,n,s),indent:-1,source:""},a,l);return o&&(u.anchor=o.source.substring(1),""===u.anchor&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(u.spaceBefore=!0),r&&(u.comment=r,u.range[2]=c),u}function Zr(e){if("number"==typeof e)return[e,e+1];if(Array.isArray(e))return 2===e.length?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+("string"==typeof n?n.length:1)]}function eo(e){let t="",n=!1,s=!1;for(let i=0;i{const i="number"==typeof e?e:Array.isArray(e)?e[0]:e.offset;if(!n)throw new Tn([i,i+1],t,s);n(i,t,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Vr(e,t,s);case"block-scalar":return Yr({options:{strict:t}},e,s)}}return null}function no(e,t){const{implicitKey:n=!1,indent:s,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=t,a=fr({type:o,value:e},{implicitKey:n,indent:s>0?" ".repeat(s):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:"newline",offset:-1,indent:s,source:"\n"}];switch(a[0]){case"|":case">":{const e=a.indexOf("\n"),t=a.substring(0,e),n=a.substring(e+1)+"\n",i=[{type:"block-scalar-header",offset:r,indent:s,source:t}];return io(i,c)||i.push({type:"newline",offset:-1,indent:s,source:"\n"}),{type:"block-scalar",offset:r,indent:s,props:i,source:n}}case'"':return{type:"double-quoted-scalar",offset:r,indent:s,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:r,indent:s,source:a,end:c};default:return{type:"scalar",offset:r,indent:s,source:a,end:c}}}function so(e,t,n={}){let{afterKey:s=!1,implicitKey:i=!1,inFlow:r=!1,type:o}=n,a="indent"in e?e.indent:null;if(s&&"number"==typeof a&&(a+=2),!o)switch(e.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{const t=e.props[0];if("block-scalar-header"!==t.type)throw new Error("Invalid block scalar header");o=">"===t.source[0]?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}const c=fr({type:o,value:t},{implicitKey:i||null===a,indent:null!==a&&a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":!function(e,t){const n=t.indexOf("\n"),s=t.substring(0,n),i=t.substring(n+1)+"\n";if("block-scalar"===e.type){const t=e.props[0];if("block-scalar-header"!==t.type)throw new Error("Invalid block scalar header");t.source=s,e.source=i}else{const{offset:t}=e,n="indent"in e?e.indent:-1,r=[{type:"block-scalar-header",offset:t,indent:n,source:s}];io(r,"end"in e?e.end:void 0)||r.push({type:"newline",offset:-1,indent:n,source:"\n"});for(const s of Object.keys(e))"type"!==s&&"offset"!==s&&delete e[s];Object.assign(e,{type:"block-scalar",indent:n,props:r,source:i})}}(e,c);break;case'"':ro(e,c,"double-quoted-scalar");break;case"'":ro(e,c,"single-quoted-scalar");break;default:ro(e,c,"scalar")}}function io(e,t){if(t)for(const n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function ro(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{const s=e.props.slice(1);let i=t.length;"block-scalar-header"===e.props[0].type&&(i-=e.props[0].source.length);for(const e of s)e.offset+=i;delete e.props,Object.assign(e,{type:n,source:t,end:s});break}case"block-map":case"block-seq":{const s={type:"newline",offset:e.offset+t.length,indent:e.indent,source:"\n"};delete e.items,Object.assign(e,{type:n,source:t,end:[s]});break}default:{const s="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter(e=>"space"===e.type||"comment"===e.type||"newline"===e.type):[];for(const t of Object.keys(e))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:n,indent:s,source:t,end:i})}}}function oo(e){switch(e.type){case"block-scalar":{let t="";for(const n of e.props)t+=oo(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(const n of e.items)t+=ao(n);return t}case"flow-collection":{let t=e.start.source;for(const n of e.items)t+=ao(n);for(const n of e.end)t+=n.source;return t}case"document":{let t=ao(e);if(e.end)for(const n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const n of e.end)t+=n.source;return t}}}function ao({start:e,key:t,sep:n,value:s}){let i="";for(const r of e)i+=r.source;if(t&&(i+=oo(t)),n)for(const r of n)i+=r.source;return s&&(i+=oo(s)),i}function co(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),lo(Object.freeze([]),e,t)}function lo(e,t,n){let s=n(t,e);if("symbol"==typeof s)return s;for(const i of["key","value"]){const r=t[i];if(r&&"items"in r){for(let t=0;t";case"":return"";case"":return"";case"":return"";default:return JSON.stringify(e)}}function fo(e){switch(e){case"\ufeff":return"byte-order-mark";case"":return"doc-mode";case"":return"flow-error-end";case"":return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function ho(e){switch(e){case void 0:case" ":case"\n":case"\r":case"\t":return!0;default:return!1}}function po(e,t){for(let n=0;n=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;"space"===e[++t]?.type;);return e.splice(t,e.length)}function wo(e){if("flow-seq-start"===e.start.type)for(const t of e.items)!t.sep||t.value||po(t.start,"explicit-key-ind")||po(t.sep,"map-value-ind")||(t.key&&(t.value=t.key),delete t.key,go(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}function ko(e){const t=!1!==e.prettyErrors;return{lineCounter:e.lineCounter||t&&new Xn||null,prettyErrors:t}}function vo(e,t={}){const{lineCounter:n,prettyErrors:s}=ko(t),i=new zn(n?.addNewLine),r=new Bn(t),o=Array.from(r.compose(i.parse(e)));if(s&&n)for(const a of o)a.errors.forEach(Ln(e,n)),a.warnings.forEach(Ln(e,n));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function Ao(e,t={}){const{lineCounter:n,prettyErrors:s}=ko(t),i=new zn(n?.addNewLine),r=new Bn(t);let o=null;for(const a of r.compose(i.parse(e),!0,e.length))if(o){if("silent"!==o.options.logLevel){o.errors.push(new Tn(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else o=a;return s&&n&&(o.errors.forEach(Ln(e,n)),o.warnings.forEach(Ln(e,n))),o}function So(e,t,n){let s;"function"==typeof t?s=t:void 0===n&&t&&"object"==typeof t&&(n=t);const i=Ao(e,n);if(!i)return null;if(i.warnings.forEach(e=>dr(i.options.logLevel,e)),i.errors.length>0){if("silent"!==i.options.logLevel)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:s},n))}function Eo(e,t,n){let s=null;if("function"==typeof t||Array.isArray(t)?s=t:void 0===n&&t&&(n=t),"string"==typeof n&&(n=n.length),"number"==typeof n){const e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(void 0===e){const{keepUndefined:e}=n??t??{};if(!e)return}return rt(e)&&!s?e.toString(n):new In(e,s,n).toString(n)}return{setters:[function(e){n=e.n}],execute:function(){for(s={isNothing:Zn,isObject:es,toArray:ts,repeat:ss,isNegativeZero:is,extend:ns},os.prototype=Object.create(Error.prototype),os.prototype.constructor=os,os.prototype.toString=function(e){return this.name+": "+rs(this,e)},i=os,r=ls,o=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],a=["scalar","sequence","mapping"],c=us,hs.prototype.extend=function(e){var t=[],n=[];if(e instanceof c)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new i("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach(function(e){if(!(e instanceof c))throw new i("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new i("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new i("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(e){if(!(e instanceof c))throw new i("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var s=Object.create(hs.prototype);return s.implicit=(this.implicit||[]).concat(t),s.explicit=(this.explicit||[]).concat(n),s.compiledImplicit=fs(s,"implicit"),s.compiledExplicit=fs(s,"explicit"),s.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function s(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),y=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),b=/^[-+]?[0-9]+e/,w=new c("tag:yaml.org,2002:float",{kind:"scalar",resolve:Ns,construct:Os,predicate:xs,represent:Is,defaultStyle:"lowercase"}),k=p.extend({implicit:[d,m,g,w]}),v=k,A=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),S=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"),E=new c("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Ts,construct:Cs,instanceOf:Date,represent:Ls}),N=new c("tag:yaml.org,2002:merge",{kind:"scalar",resolve:js}),O="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r",I=new c("tag:yaml.org,2002:binary",{kind:"scalar",resolve:$s,construct:_s,predicate:Ks,represent:Ms}),x=Object.prototype.hasOwnProperty,T=Object.prototype.toString,C=new c("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Bs,construct:Ds}),L=Object.prototype.toString,j=new c("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:qs,construct:Fs}),$=Object.prototype.hasOwnProperty,_=new c("tag:yaml.org,2002:set",{kind:"mapping",resolve:Ps,construct:Us}),M=v.extend({implicit:[E,N],explicit:[I,C,j,_]}),K=Object.prototype.hasOwnProperty,B=1,D=2,q=3,F=4,P=1,U=2,R=3,Y=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,V=/[\x85\u2028\u2029]/,W=/[,\[\]\{\}]/,J=/^(?:!|!!|![a-z\-]+!)$/i,G=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i,Q=new Array(256),H=new Array(256),X=0;X<256;X++)Q[X]=Xs(X)?1:0,H[X]=Xs(X);z={YAML:function(e,t,n){var s,i,r;null!==e.version&&ni(e,"duplication of %YAML directive"),1!==n.length&&ni(e,"YAML directive accepts exactly one argument"),null===(s=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&ni(e,"ill-formed argument of the YAML directive"),i=parseInt(s[1],10),r=parseInt(s[2],10),1!==i&&ni(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=r<2,1!==r&&2!==r&&si(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var s,i;2!==n.length&&ni(e,"TAG directive accepts exactly two arguments"),s=n[0],i=n[1],J.test(s)||ni(e,"ill-formed tag handle (first argument) of the TAG directive"),K.call(e.tagMap,s)&&ni(e,'there is a previously declared suffix for "'+s+'" tag handle'),G.test(i)||ni(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch(r){ni(e,"tag prefix is malformed: "+i)}e.tagMap[s]=i}},Z={loadAll:yi,load:bi},ee=Object.prototype.toString,te=Object.prototype.hasOwnProperty,ne=65279,se=9,ie=10,re=13,oe=32,ae=33,ce=34,le=35,ue=37,fe=38,he=39,pe=42,de=44,me=45,ge=58,ye=61,be=62,we=63,ke=64,ve=91,Ae=93,Se=96,Ee=123,Ne=124,Oe=125,(Ie={})[0]="\\0",Ie[7]="\\a",Ie[8]="\\b",Ie[9]="\\t",Ie[10]="\\n",Ie[11]="\\v",Ie[12]="\\f",Ie[13]="\\r",Ie[27]="\\e",Ie[34]='\\"',Ie[92]="\\\\",Ie[133]="\\N",Ie[160]="\\_",Ie[8232]="\\L",Ie[8233]="\\P",xe=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Te=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/,Ce=1,Le=2,je=1,$e=2,_e=3,Me=4,Ke=5,Be=c,De=l,qe=p,Fe=k,Pe=v,Ue=M,Re=Z.load,Ye=Z.loadAll,Ve=qi,We=i,Je={binary:I,float:w,map:h,null:d,pairs:j,set:_,timestamp:E,bool:m,int:g,merge:N,omap:C,seq:f,str:u},Ge=Fi("safeLoad","load"),Qe=Fi("safeLoadAll","loadAll"),He=Fi("safeDump","dump"),e("a",{Type:Be,Schema:De,FAILSAFE_SCHEMA:qe,JSON_SCHEMA:Fe,CORE_SCHEMA:Pe,DEFAULT_SCHEMA:Ue,load:Re,loadAll:Ye,dump:Ve,YAMLException:We,types:Je,safeLoad:Ge,safeLoadAll:Qe,safeDump:He}),Xe=Symbol.for("yaml.alias"),ze=Symbol.for("yaml.document"),Ze=Symbol.for("yaml.map"),et=Symbol.for("yaml.pair"),tt=Symbol.for("yaml.scalar"),nt=Symbol.for("yaml.seq"),st=Symbol.for("yaml.node.type"),it=e=>!!e&&"object"==typeof e&&e[st]===Xe,rt=e=>!!e&&"object"==typeof e&&e[st]===ze,ot=e=>!!e&&"object"==typeof e&&e[st]===Ze,at=e=>!!e&&"object"==typeof e&&e[st]===et,ct=e=>!!e&&"object"==typeof e&&e[st]===tt,lt=e=>!!e&&"object"==typeof e&&e[st]===nt,ut=e=>(ct(e)||Pi(e))&&!!e.anchor,ft=Symbol("break visit"),ht=Symbol("skip children"),pt=Symbol("remove node"),Ri.BREAK=ft,Ri.SKIP=ht,Ri.REMOVE=pt,Vi.BREAK=ft,Vi.SKIP=ht,Vi.REMOVE=pt,dt={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},mt=e=>e.replace(/[!,[\]{}]/g,e=>dt[e]),(gt=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){const t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);const s=t.trim().split(/[ \t]+/),i=s.shift();switch(i){case"%TAG":{if(2!==s.length&&(n(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;const[e,t]=s;return this.tags[e]=t,!0}case"%YAML":{if(this.yaml.explicit=!0,1!==s.length)return n(0,"%YAML directive should contain exactly one part"),!1;const[e]=s;return"1.1"===e||"1.2"===e?(this.yaml.version=e,!0):(n(6,`Unsupported YAML version ${e}`,/^\d+\.\d+$/.test(e)),!1)}default:return n(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 n=e.slice(2,-1);return"!"===n||"!!"===n?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(">"!==e[e.length-1]&&t("Verbatim tags must end with a >"),n)}const[,n,s]=e.match(/^(.*!)([^!]*)$/s);s||t(`The ${e} tag has no suffix`);const i=this.tags[n];if(i)try{return i+decodeURIComponent(s)}catch(r){return t(String(r)),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+mt(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 s;if(e&&n.length>0&&Ui(e.contents)){const t={};Ri(e.contents,(e,n)=>{Ui(n)&&n.tag&&(t[n.tag]=!0)}),s=Object.keys(t)}else s=[];for(const[i,r]of n)"!!"===i&&"tag:yaml.org,2002:"===r||e&&!s.some(e=>e.startsWith(r))||t.push(`%TAG ${i} ${r}`);return t.join("\n")}}).defaultYaml={explicit:!1,version:"1.2"},gt.defaultTags={"!!":"tag:yaml.org,2002:"},yt=class{constructor(e){Object.defineProperty(this,st,{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:s,reviver:i}={}){if(!rt(e))throw new TypeError("A document argument is required");const r={anchors:new Map,doc:e,keep:!0,mapAsMap:!0===t,mapKeyWarned:!1,maxAliasCount:"number"==typeof n?n:100},o=er(this,"",r);if("function"==typeof s)for(const{count:a,res:c}of r.anchors.values())s(c,a);return"function"==typeof i?Zi(i,{"":o},"",o):o}},bt=class extends yt{constructor(e){super(Xe),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(0===t?.maxAliasCount)throw new ReferenceError("Alias resolution is disabled");let n,s;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],Ri(e,{Node:(e,t)=>{(it(t)||ut(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));for(const i of n){if(i===this)break;i.anchor===this.source&&(s=i)}return s}toJSON(e,t){if(!t)return{source:this.source};const{anchors:n,doc:s,maxAliasCount:i}=t,r=this.resolve(s,t);if(!r){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(e)}let o=n.get(r);if(o||(er(r,null,t),o=n.get(r)),void 0===o?.res)throw new ReferenceError("This should not happen: Alias anchor was not resolved?");if(i>=0&&(o.count+=1,0===o.aliasCount&&(o.aliasCount=tr(s,r,n)),o.count*o.aliasCount>i))throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack");return o.res}toString(e,t,n){const s=`*${this.source}`;if(e){if(Hi(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(e)}if(e.implicitKey)return`${s} `}return s}},wt=e=>!e||"function"!=typeof e&&"object"!=typeof e,e("i",kt=class extends yt{constructor(e){super(tt),this.value=e}toJSON(e,t){return t?.keep?this.value:er(this.value,e,t)}toString(){return String(this.value)}}),kt.BLOCK_FOLDED="BLOCK_FOLDED",kt.BLOCK_LITERAL="BLOCK_LITERAL",kt.PLAIN="PLAIN",kt.QUOTE_DOUBLE="QUOTE_DOUBLE",kt.QUOTE_SINGLE="QUOTE_SINGLE",vt="tag:yaml.org,2002:",At=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done,St=class extends yt{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>Ui(t)||at(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(At(e))this.add(t);else{const[n,...s]=e,i=this.get(n,!0);if(Pi(i))i.addIn(s,t);else{if(void 0!==i||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`);this.set(n,sr(this.schema,s,t))}}}deleteIn(e){const[t,...n]=e;if(0===n.length)return this.delete(t);const s=this.get(t,!0);if(Pi(s))return s.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){const[n,...s]=e,i=this.get(n,!0);return 0===s.length?!t&&ct(i)?i.value:i:Pi(i)?i.getIn(s,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!at(t))return!1;const n=t.value;return null==n||e&&ct(n)&&null==n.value&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){const[t,...n]=e;if(0===n.length)return this.has(t);const s=this.get(t,!0);return!!Pi(s)&&s.hasIn(n)}setIn(e,t){const[n,...s]=e;if(0===s.length)this.set(n,t);else{const e=this.get(n,!0);if(Pi(e))e.setIn(s,t);else{if(void 0!==e||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`);this.set(n,sr(this.schema,s,t))}}}},Et=e=>e.replace(/^(?!$)(?: $)?/gm,"#"),Nt=(e,t,n)=>e.endsWith("\n")?ir(n,t):n.includes("\n")?"\n"+ir(n,t):(e.endsWith(" ")?"":" ")+n,Ot="flow",It="block",xt="quoted",Tt=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Ct=e=>/^(%|---|\.\.\.)/m.test(e);try{Lt=new RegExp("(^|(?e===jt||"symbol"==typeof e&&e.description===jt,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new kt(Symbol(jt)),{addToJSMap:mr}),stringify:()=>jt},_t=(e,t)=>($t.identify(t)||ct(t)&&(!t.type||t.type===kt.PLAIN)&&$t.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===$t.tag&&e.default),Mt=class e{constructor(e,t=null){Object.defineProperty(this,st,{value:et}),this.key=e,this.value=t}clone(t){let{key:n,value:s}=this;return Ui(n)&&(n=n.clone(t)),Ui(s)&&(s=s.clone(t)),new e(n,s)}toJSON(e,t){return br(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?function({key:e,value:t},n,s,i){const{allNullValues:r,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:f}}=n;let h=Ui(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(Pi(e)||!Ui(e)&&"object"==typeof e)throw new Error("With simple keys, collection cannot be used as a key value")}let p=!f&&(!e||h&&null==t&&!n.inFlow||Pi(e)||(ct(e)?e.type===kt.BLOCK_FOLDED||e.type===kt.BLOCK_LITERAL:"object"==typeof e));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!r),indent:a+c});let d,m,g,y=!1,b=!1,w=pr(e,n,()=>y=!0,()=>b=!0);if(!p&&!n.inFlow&&w.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(r||null==t)return y&&s&&s(),""===w?"?":p?`? ${w}`:w}else if(r&&!f||null==t&&p)return w=`? ${w}`,h&&!y?w+=Nt(w,n.indent,l(h)):b&&i&&i(),w;y&&(h=null),p?(h&&(w+=Nt(w,n.indent,l(h))),w=`? ${w}\n${a}:`):(w=`${w}:`,h&&(w+=Nt(w,n.indent,l(h)))),Ui(t)?(d=!!t.spaceBefore,m=t.commentBefore,g=t.comment):(d=!1,m=null,g=null,t&&"object"==typeof t&&(t=o.createNode(t))),n.implicitKey=!1,p||h||!ct(t)||(n.indentAtStart=w.length+1),b=!1,u||!(c.length>=2)||n.inFlow||p||!lt(t)||t.flow||t.tag||t.anchor||(n.indent=n.indent.substring(2));let k=!1;const v=pr(t,n,()=>k=!0,()=>b=!0);let A=" ";if(h||d||m)A=d?"\n":"",m&&(A+=`\n${ir(l(m),n.indent)}`),""!==v||n.inFlow?A+=`\n${n.indent}`:"\n"===A&&g&&(A="\n\n");else if(!p&&Pi(t)){const e=v[0],s=v.indexOf("\n"),i=-1!==s,r=n.inFlow??t.flow??0===t.items.length;if(i||!r){let t=!1;if(i&&("&"===e||"!"===e)){let n=v.indexOf(" ");"&"===e&&-1!==n&&n{if("function"==typeof i)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(void 0!==o||s)&&r.items.push(wr(e,o,n))};if(t instanceof Map)for(const[a,c]of t)o(a,c);else if(t&&"object"==typeof t)for(const a of Object.keys(t))o(a,t[a]);return"function"==typeof e.sortMapEntries&&r.items.sort(e.sortMapEntries),r}add(e,t){let n;n=at(e)?e:e&&"object"==typeof e&&"key"in e?new Mt(e.key,e.value):new Mt(e,e?.value);const s=Er(this.items,n.key),i=this.schema?.sortMapEntries;if(s){if(!t)throw new Error(`Key ${n.key} already set`);ct(s.value)&&wt(n.value)?s.value.value=n.value:s.value=n.value}else if(i){const e=this.items.findIndex(e=>i(n,e)<0);-1===e?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){const t=Er(this.items,e);return!!t&&this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){const n=Er(this.items,e)?.value;return(!t&&ct(n)?n.value:n)??void 0}has(e){return!!Er(this.items,e)}set(e,t){this.add(new Mt(e,t),!0)}toJSON(e,t,n){const s=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(s);for(const i of this.items)br(t,s,i);return s}toString(e,t,n){if(!e)return JSON.stringify(this);for(const s of this.items)if(!at(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),kr(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}}),Bt={collection:"map",default:!0,nodeClass:Kt,tag:"tag:yaml.org,2002:map",resolve:(e,t)=>(ot(e)||t("Expected a mapping for this tag"),e),createNode:(e,t,n)=>Kt.from(e,t,n)},e("n",Dt=class extends St{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(nt,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=Nr(e);return"number"==typeof t&&this.items.splice(t,1).length>0}get(e,t){const n=Nr(e);if("number"!=typeof n)return;const s=this.items[n];return!t&&ct(s)?s.value:s}has(e){const t=Nr(e);return"number"==typeof t&&t(lt(e)||t("Expected a sequence for this tag"),e),createNode:(e,t,n)=>Dt.from(e,t,n)},Ft={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(e,t,n,s)=>fr(e,t=Object.assign({actualString:!0},t),n,s)},Pt={identify:e=>null==e,createNode:()=>new kt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new kt(null),stringify:({source:e},t)=>"string"==typeof e&&Pt.test.test(e)?e:t.options.nullStr},Ut={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new kt("t"===e[0]||"T"===e[0]),stringify:({source:e,value:t},n)=>e&&Ut.test.test(e)&&t===("t"===e[0]||"T"===e[0])?e:t?n.options.trueStr:n.options.falseStr},Rt={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Or},Yt={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Or(e)}},Vt={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new kt(parseFloat(e)),n=e.indexOf(".");return-1!==n&&"0"===e[e.length-1]&&(t.minFractionDigits=e.length-n-1),t},stringify:Or},Jt=(e,t,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),n),Gt={identify:e=>Wt(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Jt(e,2,8,n),stringify:e=>Ir(e,8,"0o")},Qt={identify:Wt=e=>"bigint"==typeof e||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Jt(e,0,10,n),stringify:Or},Ht={identify:e=>Wt(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Jt(e,2,16,n),stringify:e=>Ir(e,16,"0x")},Xt=[Bt,qt,Ft,Pt,Ut,Gt,Qt,Ht,Rt,Yt,Vt],Zt=[{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:zt=({value:e})=>JSON.stringify(e)},{identify:e=>null==e,createNode:()=>new kt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:zt},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>"true"===e,stringify:zt},{identify:xr,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>xr(e)?e.toString():JSON.stringify(e)},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:zt}],en=[Bt,qt].concat(Zt,{default:!0,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)}),tn={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if("function"==typeof atob){const t=atob(e.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let e=0;ee instanceof Map,nodeClass:sn,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=Tr(e,t),s=[];for(const{key:i}of n.items)ct(i)&&(s.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):s.push(i.value));return Object.assign(new sn,n)},createNode:(e,t,n)=>sn.from(e,t,n)},on={identify:e=>!0===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new kt(!0),stringify:Lr},an={identify:e=>!1===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new kt(!1),stringify:Lr},cn={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Or},ln={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Or(e)}},un={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new kt(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(-1!==n){const s=e.substring(n+1).replace(/_/g,"");"0"===s[s.length-1]&&(t.minFractionDigits=s.length)}return t},stringify:Or},hn={identify:fn=e=>"bigint"==typeof e||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>jr(e,2,2,n),stringify:e=>$r(e,2,"0b")},pn={identify:fn,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>jr(e,1,8,n),stringify:e=>$r(e,8,"0")},dn={identify:fn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>jr(e,0,10,n),stringify:Or},mn={identify:fn,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>jr(e,2,16,n),stringify:e=>$r(e,16,"0x")},gn=class e extends Kt{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=at(e)?e:e&&"object"==typeof e&&"key"in e&&"value"in e&&null===e.value?new Mt(e.key,null):new Mt(e,null),Er(this.items,t.key)||this.items.push(t)}get(e,t){const n=Er(this.items,e);return!t&&at(n)?ct(n.key)?n.key.value:n.key:n}set(e,t){if("boolean"!=typeof t)throw new Error("Expected boolean value for set(key, value) in a YAML set, not "+typeof t);const n=Er(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Mt(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:s}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let r of t)"function"==typeof s&&(r=s.call(t,r,r)),i.items.push(wr(r,null,n));return i}},gn.tag="tag:yaml.org,2002:set",yn={collection:"map",identify:e=>e instanceof Set,nodeClass:gn,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>gn.from(e,t,n),resolve(e,t){if(ot(e)){if(e.hasAllNullValues(!0))return Object.assign(new gn,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}},bn={identify:e=>"bigint"==typeof e||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>_r(e,n),stringify:Mr},wn={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>_r(e,!1),stringify:Mr},kn={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(kn.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,s,i,r,o,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let l=Date.UTC(n,s-1,i,r||0,o||0,a||0,c);const u=t[8];if(u&&"Z"!==u){let e=_r(u,!1);Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},vn=[Bt,qt,Ft,Pt,on,an,hn,pn,dn,mn,cn,ln,un,tn,$t,rn,nn,yn,bn,wn,kn],An=new Map([["core",Xt],["failsafe",[Bt,qt,Ft]],["json",en],["yaml11",vn],["yaml-1.1",vn]]),Sn={binary:tn,bool:Ut,float:Vt,floatExp:Yt,floatNaN:Rt,floatTime:wn,int:Qt,intHex:Ht,intOct:Gt,intTime:bn,map:Bt,merge:$t,null:Pt,omap:rn,pairs:nn,seq:qt,set:yn,timestamp:kn},En={"tag:yaml.org,2002:binary":tn,"tag:yaml.org,2002:merge":$t,"tag:yaml.org,2002:omap":rn,"tag:yaml.org,2002:pairs":nn,"tag:yaml.org,2002:set":yn,"tag:yaml.org,2002:timestamp":kn},Nn=(e,t)=>e.keyt.key?1:0,On=class e{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:s,schema:i,sortMapEntries:r,toStringDefaults:o}){this.compat=Array.isArray(e)?Kr(e,"compat"):e?Kr(null,e):null,this.name="string"==typeof i&&i||"core",this.knownTags=s?En:{},this.tags=Kr(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,Ze,{value:Bt}),Object.defineProperty(this,tt,{value:Ft}),Object.defineProperty(this,nt,{value:qt}),this.sortMapEntries="function"==typeof r?r:!0===r?Nn:null}clone(){const t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}},In=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,st,{value:ze});let s=null;"function"==typeof t||Array.isArray(t)?s=t:void 0===n&&t&&(n=t,t=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=i;let{version:r}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(r=this.directives.yaml.version)):this.directives=new gt({version:r}),this.setSchema(r,n),this.contents=void 0===e?null:this.createNode(e,s,n)}clone(){const t=Object.create(e.prototype,{[st]:{value:ze}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Ui(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){Br(this.contents)&&this.contents.add(e)}addIn(e,t){Br(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const n=Xi(this);e.anchor=!t||n.has(t)?zi(t||"a",n):t}return new bt(e.anchor)}createNode(e,t,n){let s;if("function"==typeof t)e=t.call({"":e},"",e),s=t;else if(Array.isArray(t)){const e=e=>"number"==typeof e||e instanceof String||e instanceof Number,n=t.filter(e).map(String);n.length>0&&(t=t.concat(n)),s=t}else void 0===n&&t&&(n=t,t=void 0);const{aliasDuplicateObjects:i,anchorPrefix:r,flow:o,keepUndefined:a,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:f,sourceObjects:h}=function(e,t){const n=[],s=new Map;let i=null;return{onAnchor:s=>{n.push(s),i??(i=Xi(e));const r=zi(t,i);return i.add(r),r},setAnchors:()=>{for(const e of n){const t=s.get(e);if("object"!=typeof t||!t.anchor||!ct(t.node)&&!Pi(t.node)){const t=new Error("Failed to resolve repeated object (this should not happen)");throw t.source=e,t}t.node.anchor=t.anchor}},sourceObjects:s}}(this,r||"a"),p=nr(e,l,{aliasDuplicateObjects:i??!0,keepUndefined:a??!1,onAnchor:u,onTagObj:c,replacer:s,schema:this.schema,sourceObjects:h});return o&&Pi(p)&&(p.flow=!0),f(),p}createPair(e,t,n={}){return new Mt(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return!!Br(this.contents)&&this.contents.delete(e)}deleteIn(e){return At(e)?null!=this.contents&&(this.contents=null,!0):!!Br(this.contents)&&this.contents.deleteIn(e)}get(e,t){return Pi(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return At(e)?!t&&ct(this.contents)?this.contents.value:this.contents:Pi(this.contents)?this.contents.getIn(e,t):void 0}has(e){return!!Pi(this.contents)&&this.contents.has(e)}hasIn(e){return At(e)?void 0!==this.contents:!!Pi(this.contents)&&this.contents.hasIn(e)}set(e,t){null==this.contents?this.contents=sr(this.schema,[e],t):Br(this.contents)&&this.contents.set(e,t)}setIn(e,t){At(e)?this.contents=t:null==this.contents?this.contents=sr(this.schema,Array.from(e),t):Br(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){let n;switch("number"==typeof e&&(e=String(e)),e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new gt({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 gt({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const t=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else{if(!n)throw new Error("With a null YAML version, the { schema: Schema } option is required");this.schema=new On(Object.assign(n,t))}}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:s,onAnchor:i,reviver:r}={}){const o={anchors:new Map,doc:this,keep:!e,mapAsMap:!0===n,mapKeyWarned:!1,maxAliasCount:"number"==typeof s?s:100},a=er(this.contents,t??"",o);if("function"==typeof i)for(const{count:c,res:l}of o.anchors.values())i(l,c);return"function"==typeof r?Zi(r,{"":a},"",a):a}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return function(e,t){const n=[];let s=!0===t.directives;if(!1!==t.directives&&e.directives){const t=e.directives.toString(e);t?(n.push(t),s=!0):e.directives.docStart&&(s=!0)}s&&n.push("---");const i=hr(e,t),{commentString:r}=i.options;if(e.commentBefore){1!==n.length&&n.unshift("");const t=r(e.commentBefore);n.unshift(ir(t,""))}let o=!1,a=null;if(e.contents){if(Ui(e.contents)){if(e.contents.spaceBefore&&s&&n.push(""),e.contents.commentBefore){const t=r(e.contents.commentBefore);n.push(ir(t,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}const t=a?void 0:()=>o=!0;let c=pr(e.contents,i,()=>a=null,t);a&&(c+=Nt(c,"",r(a))),"|"!==c[0]&&">"!==c[0]||"---"!==n[n.length-1]?n.push(c):n[n.length-1]=`--- ${c}`}else n.push(pr(e.contents,i));if(e.directives?.docEnd)if(e.comment){const t=r(e.comment);t.includes("\n")?(n.push("..."),n.push(ir(t,""))):n.push(`... ${t}`)}else n.push("...");else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,"")),t&&(o&&!a||""===n[n.length-1]||n.push(""),n.push(ir(r(t),"")))}return n.join("\n")+"\n"}(this,e)}},xn=class extends Error{constructor(e,t,n,s){super(),this.name=e,this.code=n,this.message=s,this.pos=t}},Tn=class extends xn{constructor(e,t,n){super("YAMLParseError",e,t,n)}},Cn=class extends xn{constructor(e,t,n){super("YAMLWarning",e,t,n)}},Ln=(e,t)=>n=>{if(-1===n.pos[0])return;n.linePos=n.pos.map(e=>t.linePos(e));const{line:s,col:i}=n.linePos[0];n.message+=` at line ${s}, column ${i}`;let r=i-1,o=e.substring(t.lineStarts[s-1],t.lineStarts[s]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){const e=Math.min(r-39,o.length-79);o="…"+o.substring(e),r-=e-1}if(o.length>80&&(o=o.substring(0,79)+"…"),s>1&&/^ *$/.test(o.substring(0,r))){let n=e.substring(t.lineStarts[s-2],t.lineStarts[s-1]);n.length>80&&(n=n.substring(0,79)+"…\n"),o=n+o}if(/[^ ]/.test(o)){let e=1;const t=n.linePos[1];t?.line===s&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-r)));const a=" ".repeat(r)+"^".repeat(e);n.message+=`:\n\n${o}\n${a}\n`}},jn="All mapping items must start at the same column",$n="Block collections are not allowed within flow collections",_n=e=>e&&("block-map"===e.type||"block-seq"===e.type),Mn={0:"\0",a:"",b:"\b",e:"",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"},Kn={composeNode:Xr,composeEmptyNode:zr},Bn=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,s)=>{const i=Zr(e);s?this.warnings.push(new Cn(i,t,n)):this.errors.push(new Tn(i,t,n))},this.directives=new gt({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:n,afterEmptyLine:s}=eo(this.prelude);if(n){const i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(s||e.directives.docStart||!i)e.commentBefore=n;else if(Pi(i)&&!i.flow&&i.items.length>0){let e=i.items[0];at(e)&&(e=e.key);const t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{const e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`: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:eo(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(const s of e)yield*this.next(s);yield*this.end(t,n)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,n,s)=>{const i=Zr(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",n,s)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=function(e,t,{offset:n,start:s,value:i,end:r},o){const a=new In(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:a.directives,options:a.options,schema:a.schema},l=Dr(s,{indicator:"doc-start",next:i??r?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(a.directives.docStart=!0,!i||"block-map"!==i.type&&"block-seq"!==i.type||l.hasNewline||o(l.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),a.contents=i?Xr(c,i,l,o):zr(c,l.end,s,null,l,o);const u=a.contents.range[2],f=Ur(r,u,!1,o);return f.comment&&(a.comment=f.comment),a.range=[n,u,f.offset],a}(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Tn(Zr(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){this.errors.push(new Tn(Zr(e),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;const t=Ur(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Tn(Zr(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const e=new In(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),e.range=[0,t,t],this.decorate(e,!1),yield e}}},Dn=e=>"type"in e?oo(e):ao(e),qn=Symbol("break visit"),Fn=Symbol("skip children"),Pn=Symbol("remove item"),co.BREAK=qn,co.SKIP=Fn,co.REMOVE=Pn,co.itemAtPath=(e,t)=>{let n=e;for(const[s,i]of t){const e=n?.[s];if(!e||!("items"in e))return;n=e.items[i]}return n},co.parentCollection=(e,t)=>{const n=co.itemAtPath(e,t.slice(0,-1)),s=t[t.length-1][0],i=n?.[s];if(i&&"items"in i)return i;throw new Error("Parent collection not found")},Un=n({BOM:()=>"\ufeff",DOCUMENT:()=>"",FLOW_END:()=>"",SCALAR:()=>"",createScalarToken:()=>no,isCollection:()=>Rn,isScalar:()=>Yn,prettyToken:()=>uo,resolveAsScalar:()=>to,setScalarValue:()=>so,stringify:()=>Dn,tokenType:()=>fo,visit:()=>co}),Rn=e=>!!e&&"items"in e,Yn=e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type),Vn=new Set("0123456789ABCDEFabcdef"),Wn=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Jn=new Set(",[]{}"),Gn=new Set(" ,[]{}\n\r\t"),Qn=e=>!e||Gn.has(e),Hn=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("string"!=typeof e)throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let 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;)t=this.buffer[++e];return!t||"#"===t||"\n"===t||"\r"===t&&"\n"===this.buffer[e+1]}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;" "===t;)t=this.buffer[++n+e];if("\r"===t){const t=this.buffer[n+e+1];if("\n"===t||!t&&!this.atEnd)return e+n+1}return"\n"===t||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if("-"===t||"."===t){const t=this.buffer.substr(e,3);if(("---"===t||"..."===t)&&ho(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return("number"!=typeof e||-1!==e&&ethis.indentValue&&!ho(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if(("-"===e||"?"===e||":"===e)&&ho(t)){const e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(null===e)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Qn),"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);const s=this.getLine();if(null===s)return this.setNext("flow");if((-1!==n&&n"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if("-"!==t)break}return yield*this.pushUntil(e=>ho(e)||"#"===e)}*parseBlockScalar(){let e,t=this.pos-1,n=0;e:for(let i=this.pos;e=this.buffer[i];++i)switch(e){case" ":n+=1;break;case"\n":t=i,n=0;break;case"\r":{const e=this.buffer[i+1];if(!e&&!this.atEnd)return this.setNext("block-scalar");if("\n"===e)break}default:break e}if(!e&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=n:this.indentNext=this.blockScalarIndent+(0===this.indentNext?1:this.indentNext);do{const e=this.continueScalar(t+1);if(-1===e)break;t=this.buffer.indexOf("\n",e)}while(-1!==t);if(-1===t){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let s=t+1;for(e=this.buffer[s];" "===e;)e=this.buffer[++s];if("\t"===e){for(;"\t"===e||" "===e||"\r"===e||"\n"===e;)e=this.buffer[++s];t=s-1}else if(!this.blockScalarKeep)for(;;){let e=t-1,s=this.buffer[e];"\r"===s&&(s=this.buffer[--e]);const i=e;for(;" "===s;)s=this.buffer[--e];if(!("\n"===s&&e>=this.pos&&e+1+n>i))break;t=e}return yield"",yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t,n=this.pos-1,s=this.pos-1;for(;t=this.buffer[++s];)if(":"===t){const t=this.buffer[s+1];if(ho(t)||e&&Jn.has(t))break;n=s}else if(ho(t)){let i=this.buffer[s+1];if("\r"===t&&("\n"===i?(s+=1,t="\n",i=this.buffer[s+1]):n=s),"#"===i||e&&Jn.has(i))break;if("\n"===t){const e=this.continueScalar(s+1);if(-1===e)break;s=Math.max(s,e-2)}}else{if(e&&Jn.has(t))break;n=s}return t||this.atEnd?(yield"",yield*this.pushToIndex(n+1,!0),e?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const 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(Qn))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,t=this.charAt(1);if(ho(t)||e&&Jn.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(;!ho(t)&&">"!==t;)t=this.buffer[++e];return yield*this.pushToIndex(">"===t?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Wn.has(t))t=this.buffer[++e];else{if("%"!==t||!Vn.has(this.buffer[e+1])||!Vn.has(this.buffer[e+2]))break;t=this.buffer[e+=3]}return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return"\n"===e?yield*this.pushCount(1):"\r"===e&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(e){let t,n=this.pos-1;do{t=this.buffer[++n]}while(" "===t||e&&"\t"===t);const s=n-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},Xn=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t>1;this.lineStarts[s]0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if("doc-end"!==this.type||"doc-end"===e?.type){if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}else{for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source})}}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(t)if(0===this.stack.length)yield t;else{const e=this.peek(1);switch("block-scalar"===t.type?t.indent="indent"in e?e.indent:0:"flow-collection"===t.type&&"document"===e.type&&(t.indent=0),"flow-collection"===t.type&&wo(t),e.type){case"document":e.value=t;break;case"block-scalar":e.props.push(t);break;case"block-map":{const n=e.items[e.items.length-1];if(n.value)return e.items.push({start:[],key:t,sep:[]}),void(this.onKeyLine=!0);if(!n.sep)return Object.assign(n,{key:t,sep:[]}),void(this.onKeyLine=!n.explicitKey);n.value=t;break}case"block-seq":{const n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case"flow-collection":{const n=e.items[e.items.length-1];return void(!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]}))}default:yield*this.pop(),yield*this.pop(t)}if(!("document"!==e.type&&"block-map"!==e.type&&"block-seq"!==e.type||"block-map"!==t.type&&"block-seq"!==t.type)){const n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&-1===mo(n.start)&&(0===t.indent||n.start.every(e=>"comment"!==e.type||e.indent=e.indent){const n=!this.onKeyLine&&this.indent===e.indent,s=n&&(t.sep||t.explicitKey)&&"seq-item-ind"!==this.type;let i=[];if(s&&t.sep&&!t.value){const n=[];for(let s=0;se.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case"anchor":case"tag":return void(s||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken));case"explicit-key-ind":return t.sep||t.explicitKey?s||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}):(t.start.push(this.sourceToken),t.explicitKey=!0),void(this.onKeyLine=!0);case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(po(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(go(t.key)&&!po(t.sep,"newline")){const e=bo(t.start),n=t.key,s=t.sep;s.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:s}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else if(po(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const e=bo(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||s?e.items.push({start:i,key:null,sep:[this.sourceToken]}):po(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return void(this.onKeyLine=!0);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);return void(s||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0))}default:{const s=this.startBlockValue(e);if(s){if("block-seq"===s.type){if(!t.explicitKey&&t.sep&&!po(t.sep,"newline"))return void(yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source}))}else n&&e.items.push({start:i});return void this.stack.push(s)}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const n="end"in t.value?t.value.end:void 0;"comment"===(Array.isArray(n)?n[n.length-1]:void 0)?.type?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)){const n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n))return Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),void e.items.pop()}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;return void t.start.push(this.sourceToken);case"seq-item-ind":if(this.indent!==e.indent)break;return void(t.value||po(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken))}if(this.indent>e.indent){const t=this.startBlockValue(e);if(t)return void this.stack.push(t)}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if("flow-error-end"===this.type){let e;do{yield*this.pop(),e=this.peek(1)}while("flow-collection"===e?.type)}else if(0===e.end.length){switch(this.type){case"comma":case"explicit-key-ind":return void(!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken));case"map-value-ind":return void(!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]}));case"space":case"comment":case"newline":case"anchor":case"tag":return void(!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken));case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);return void(!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]}))}case"flow-map-end":case"flow-seq-end":return void e.end.push(this.sourceToken)}const n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{const t=this.peek(2);if("block-map"===t.type&&("map-value-ind"===this.type&&t.indent===e.indent||"newline"===this.type&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if("map-value-ind"===this.type&&"flow-collection"!==t.type){const n=bo(yo(t));wo(e);const s=e.end.splice(1,e.end.length);s.push(this.sourceToken);const i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const t=bo(yo(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=bo(yo(e));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return"comment"===this.type&&!(this.indent<=t)&&e.every(e=>"newline"===e.type||"space"===e.type)}*documentEnd(e){"doc-mode"!==this.type&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}},e("t",n({Alias:()=>bt,CST:()=>Un,Composer:()=>Bn,Document:()=>In,Lexer:()=>Hn,LineCounter:()=>Xn,Pair:()=>Mt,Parser:()=>zn,Scalar:()=>kt,Schema:()=>On,YAMLError:()=>xn,YAMLMap:()=>Kt,YAMLParseError:()=>Tn,YAMLSeq:()=>Dt,YAMLWarning:()=>Cn,isAlias:()=>it,isCollection:()=>Pi,isDocument:()=>rt,isMap:()=>ot,isNode:()=>Ui,isPair:()=>at,isScalar:()=>ct,isSeq:()=>lt,parse:()=>So,parseAllDocuments:()=>vo,parseDocument:()=>Ao,stringify:()=>Eo,visit:()=>Ri,visitAsync:()=>Vi}))}}});