(("undefined"!==typeof self?self:this)["webpackChunkharvester_1_0_2"]=("undefined"!==typeof self?self:this)["webpackChunkharvester_1_0_2"]||[]).push([[851],{37021:function(e,t,n){var s=n(9776);(function(t,n){e.exports=n()})(globalThis,(()=>(()=>{"use strict";var e={794:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CronParser=void 0;var s=n(586),i=function(){function e(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!1),this.expression=e,this.dayOfWeekStartIndexZero=t,this.monthStartIndexZero=n}return e.prototype.parse=function(){var e,t,n=null!==(e=this.expression)&&void 0!==e?e:"";if(n.startsWith("@")){var s=this.parseSpecial(this.expression);t=this.extractParts(s)}else t=this.extractParts(this.expression);return this.normalize(t),this.validate(t),t},e.prototype.parseSpecial=function(e){var t={"@yearly":"0 0 1 1 *","@annually":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@midnight":"0 0 * * *","@hourly":"0 * * * *"},n=t[e];if(!n)throw new Error("Unknown special expression.");return n},e.prototype.extractParts=function(e){if(!this.expression)throw new Error("cron expression is empty");for(var t=e.trim().split(/[ ]+/),n=0;n7)throw new Error("Expression has ".concat(t.length," parts; too many!"));return t},e.prototype.normalize=function(e){var t=this;if(e[3]=e[3].replace("?","*"),e[5]=e[5].replace("?","*"),e[2]=e[2].replace("?","*"),0==e[0].indexOf("0/")&&(e[0]=e[0].replace("0/","*/")),0==e[1].indexOf("0/")&&(e[1]=e[1].replace("0/","*/")),0==e[2].indexOf("0/")&&(e[2]=e[2].replace("0/","*/")),0==e[3].indexOf("1/")&&(e[3]=e[3].replace("1/","*/")),0==e[4].indexOf("1/")&&(e[4]=e[4].replace("1/","*/")),0==e[6].indexOf("1/")&&(e[6]=e[6].replace("1/","*/")),e[5]=e[5].replace(/(^\d)|([^#/\s]\d)/g,(function(e){var n=e.replace(/\D/,""),s=n;return t.dayOfWeekStartIndexZero?"7"==n&&(s="0"):s=(parseInt(n)-1).toString(),e.replace(n,s)})),"L"==e[5]&&(e[5]="6"),"?"==e[3]&&(e[3]="*"),e[3].indexOf("W")>-1&&(e[3].indexOf(",")>-1||e[3].indexOf("-")>-1))throw new Error("The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.");var n={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var s in n)e[5]=e[5].replace(new RegExp(s,"gi"),n[s].toString());e[4]=e[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,(function(e){var n=e.replace(/\D/,""),s=n;return t.monthStartIndexZero&&(s=(parseInt(n)+1).toString()),e.replace(n,s)}));var i={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var r in i)e[4]=e[4].replace(new RegExp(r,"gi"),i[r].toString());"0"==e[0]&&(e[0]=""),/\*|\-|\,|\//.test(e[2])||!/\*|\//.test(e[1])&&!/\*|\//.test(e[0])||(e[2]+="-".concat(e[2]));for(var o=0;o-1&&!/^\*|\-|\,/.test(e[o])){var a=null;switch(o){case 4:a="12";break;case 5:a="6";break;case 6:a="9999";break;default:a=null;break}if(null!==a){var c=e[o].split("/");e[o]="".concat(c[0],"-").concat(a,"/").concat(c[1])}}},e.prototype.validate=function(e){this.assertNoInvalidCharacters("DOW",e[5]),this.assertNoInvalidCharacters("DOM",e[3]),this.validateRange(e)},e.prototype.validateRange=function(e){s.default.secondRange(e[0]),s.default.minuteRange(e[1]),s.default.hourRange(e[2]),s.default.dayOfMonthRange(e[3]),s.default.monthRange(e[4],this.monthStartIndexZero),s.default.dayOfWeekRange(e[5],this.dayOfWeekStartIndexZero)},e.prototype.assertNoInvalidCharacters=function(e,t){var n=t.match(/[A-KM-VX-Z]+/gi);if(n&&n.length)throw new Error("".concat(e," part contains invalid values: '").concat(n.toString(),"'"))},e}();t.CronParser=i},728:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionDescriptor=void 0;var i=n(910),r=n(794),o=function(){function e(t,n){if(this.expression=t,this.options=n,this.expressionParts=new Array(5),!this.options.locale&&e.defaultLocale&&(this.options.locale=e.defaultLocale),!e.locales[this.options.locale]){var i=Object.keys(e.locales)[0];s.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(i,"'.")),this.options.locale=i}this.i18n=e.locales[this.options.locale],void 0===n.use24HourTimeFormat&&(n.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return e.toString=function(t,n){var s=void 0===n?{}:n,i=s.throwExceptionOnParseError,r=void 0===i||i,o=s.verbose,a=void 0!==o&&o,c=s.dayOfWeekStartIndexZero,l=void 0===c||c,u=s.monthStartIndexZero,f=void 0!==u&&u,h=s.use24HourTimeFormat,p=s.locale,d=void 0===p?null:p,m=s.tzOffset,y=void 0===m?0:m,g={throwExceptionOnParseError:r,verbose:a,dayOfWeekStartIndexZero:l,monthStartIndexZero:f,use24HourTimeFormat:h,locale:d,tzOffset:y},b=new e(t,g);return b.getFullDescription()},e.initialize=function(t,n){void 0===n&&(n="en"),e.specialCharacters=["/","-",",","*"],e.defaultLocale=n,t.load(e.locales)},e.prototype.getFullDescription=function(){var e="";try{var t=new r.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);this.expressionParts=t.parse();var n=this.getTimeOfDayDescription(),s=this.getDayOfMonthDescription(),i=this.getMonthDescription(),o=this.getDayOfWeekDescription(),a=this.getYearDescription();e+=n+s+o+i+a,e=this.transformVerbosity(e,!!this.options.verbose),e=e.charAt(0).toLocaleUpperCase()+e.substr(1)}catch(c){if(this.options.throwExceptionOnParseError)throw"".concat(c);e=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD()}return e},e.prototype.getTimeOfDayDescription=function(){var t=this.expressionParts[0],n=this.expressionParts[1],s=this.expressionParts[2],r="";if(i.StringUtilities.containsAny(n,e.specialCharacters)||i.StringUtilities.containsAny(s,e.specialCharacters)||i.StringUtilities.containsAny(t,e.specialCharacters))if(t||!(n.indexOf("-")>-1)||n.indexOf(",")>-1||n.indexOf("/")>-1||i.StringUtilities.containsAny(s,e.specialCharacters))if(!t&&s.indexOf(",")>-1&&-1==s.indexOf("-")&&-1==s.indexOf("/")&&!i.StringUtilities.containsAny(n,e.specialCharacters)){var o=s.split(",");r+=this.i18n.at();for(var a=0;a1){var r=s[s.length-1].index;n=n.substring(0,r)+":59"+n.substring(r+3)}}return n},e.prototype.getDayOfWeekDescription=function(){var e=this,t=this.i18n.daysOfTheWeek(),n=null;return n="*"==this.expressionParts[5]?"":this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),(function(n,s){var i=n;n.indexOf("#")>-1?i=n.substring(0,n.indexOf("#")):n.indexOf("L")>-1&&(i=i.replace("L",""));var r=parseInt(i);if(e.options.tzOffset){var o=e.expressionParts[2],a=parseInt(o)+(e.options.tzOffset?e.options.tzOffset:0);a>=24?r++:a<0&&r--,r>6?r=0:r<0&&(r=6)}var c=e.i18n.daysOfTheWeekInCase?e.i18n.daysOfTheWeekInCase(s)[r]:t[r];if(n.indexOf("#")>-1){var l=null,u=n.substring(n.indexOf("#")+1),f=n.substring(0,n.indexOf("#"));switch(u){case"1":l=e.i18n.first(f);break;case"2":l=e.i18n.second(f);break;case"3":l=e.i18n.third(f);break;case"4":l=e.i18n.fourth(f);break;case"5":l=e.i18n.fifth(f);break}c=l+" "+c}return c}),(function(t){return 1==parseInt(t)?"":i.StringUtilities.format(e.i18n.commaEveryX0DaysOfTheWeek(t),t)}),(function(t){var n=t.substring(0,t.indexOf("-")),s="*"!=e.expressionParts[3];return s?e.i18n.commaAndX0ThroughX1(n):e.i18n.commaX0ThroughX1(n)}),(function(t){var n=null;if(t.indexOf("#")>-1){var s=t.substring(t.indexOf("#")+1);n=e.i18n.commaOnThe(s).trim()+e.i18n.spaceX0OfTheMonth()}else if(t.indexOf("L")>-1)n=e.i18n.commaOnTheLastX0OfTheMonth(t.replace("L",""));else{var i="*"!=e.expressionParts[3];n=i?e.i18n.commaAndOnX0():e.i18n.commaOnlyOnX0(t)}return n})),n},e.prototype.getMonthDescription=function(){var e=this,t=this.i18n.monthsOfTheYear(),n=this.getSegmentDescription(this.expressionParts[4],"",(function(n,s){return s&&e.i18n.monthsOfTheYearInCase?e.i18n.monthsOfTheYearInCase(s)[parseInt(n)-1]:t[parseInt(n)-1]}),(function(t){return 1==parseInt(t)?"":i.StringUtilities.format(e.i18n.commaEveryX0Months(t),t)}),(function(t){return e.i18n.commaMonthX0ThroughMonthX1()||e.i18n.commaX0ThroughX1()}),(function(t){return e.i18n.commaOnlyInMonthX0?e.i18n.commaOnlyInMonthX0():e.i18n.commaOnlyInX0()}));return n},e.prototype.getDayOfMonthDescription=function(){var e=this,t=null,n=this.expressionParts[3];switch(n){case"L":t=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":t=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var s=n.match(/(\d{1,2}W)|(W\d{1,2})/);if(s){var r=parseInt(s[0].replace("W","")),o=1==r?this.i18n.firstWeekday():i.StringUtilities.format(this.i18n.weekdayNearestDayX0(),r.toString());t=i.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),o);break}var a=n.match(/L-(\d{1,2})/);if(a){var c=a[1];t=i.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(c),c);break}if("*"==n&&"*"!=this.expressionParts[5])return"";t=this.getSegmentDescription(n,this.i18n.commaEveryDay(),(function(t){return"L"==t?e.i18n.lastDay():e.i18n.dayX0?i.StringUtilities.format(e.i18n.dayX0(),t):t}),(function(t){return"1"==t?e.i18n.commaEveryDay():e.i18n.commaEveryX0Days(t)}),(function(t){return e.i18n.commaBetweenDayX0AndX1OfTheMonth(t)}),(function(t){return e.i18n.commaOnDayX0OfTheMonth(t)}));break}return t},e.prototype.getYearDescription=function(){var e=this,t=this.getSegmentDescription(this.expressionParts[6],"",(function(e){return/^\d+$/.test(e)?new Date(parseInt(e),1).getFullYear().toString():e}),(function(t){return i.StringUtilities.format(e.i18n.commaEveryX0Years(t),t)}),(function(t){return e.i18n.commaYearX0ThroughYearX1()||e.i18n.commaX0ThroughX1()}),(function(t){return e.i18n.commaOnlyInYearX0?e.i18n.commaOnlyInYearX0():e.i18n.commaOnlyInX0()}));return t},e.prototype.getSegmentDescription=function(e,t,n,s,r,o){var a=null,c=e.indexOf("/")>-1,l=e.indexOf("-")>-1,u=e.indexOf(",")>-1;if(e)if("*"===e)a=t;else if(c||l||u)if(u){for(var f=e.split(","),h="",p=0;p0&&f.length>2&&(h+=",",p0&&f.length>1&&(p==f.length-1||2==f.length)&&(h+="".concat(this.i18n.spaceAnd()," ")),f[p].indexOf("/")>-1||f[p].indexOf("-")>-1){var d=f[p].indexOf("-")>-1&&-1==f[p].indexOf("/"),m=this.getSegmentDescription(f[p],t,n,s,d?this.i18n.commaX0ThroughX1:r,o);d&&(m=m.replace(", ","")),h+=m}else h+=c?this.getSegmentDescription(f[p],t,n,s,r,o):n(f[p]);a=c?h:i.StringUtilities.format(o(e),h)}else if(c){f=e.split("/");if(a=i.StringUtilities.format(s(f[1]),f[1]),f[0].indexOf("-")>-1){var y=this.generateRangeSegmentDescription(f[0],r,n);0!=y.indexOf(", ")&&(a+=", "),a+=y}else if(-1==f[0].indexOf("*")){var g=i.StringUtilities.format(o(f[0]),n(f[0]));g=g.replace(", ",""),a+=i.StringUtilities.format(this.i18n.commaStartingX0(),g)}}else l&&(a=this.generateRangeSegmentDescription(e,r,n));else a=i.StringUtilities.format(o(e),n(e));else a="";return a},e.prototype.generateRangeSegmentDescription=function(e,t,n){var s="",r=e.split("-"),o=n(r[0],1),a=n(r[1],2),c=t(e);return s+=i.StringUtilities.format(c,o,a),s},e.prototype.formatTime=function(e,t,n){var s=0,i=0;this.options.tzOffset&&(s=this.options.tzOffset>0?Math.floor(this.options.tzOffset):Math.ceil(this.options.tzOffset),i=parseFloat((this.options.tzOffset%1).toFixed(2)),0!=i&&(i*=60));var r=parseInt(e)+s,o=parseInt(t)+i;o>=60?(o-=60,r+=1):o<0&&(o+=60,r-=1),r>=24?r-=24:r<0&&(r=24+r);var a="",c=!1;this.options.use24HourTimeFormat||(c=!(!this.i18n.setPeriodBeforeTime||!this.i18n.setPeriodBeforeTime()),a=c?"".concat(this.getPeriod(r)," "):" ".concat(this.getPeriod(r)),r>12&&(r-=12),0===r&&(r=12));var l="";return n&&(l=":".concat(("00"+n).substring(n.length))),"".concat(c?a:"").concat(("00"+r.toString()).substring(r.toString().length),":").concat(("00"+o.toString()).substring(o.toString().length)).concat(l).concat(c?"":a)},e.prototype.transformVerbosity=function(e,t){return t||(e=e.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),e=e.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),e=e.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),e=e.replace(/\, ?$/,"")),e},e.prototype.getPeriod=function(e){return e>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},e.locales={},e}();t.ExpressionDescriptor=o},336:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.enLocaleLoader=void 0;var s=n(751),i=function(){function e(){}return e.prototype.load=function(e){e["en"]=new s.en},e}();t.enLocaleLoader=i},751:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.en=void 0;var n=function(){function e(){}return e.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},e.prototype.atX0MinutesPastTheHourGt20=function(){return null},e.prototype.commaMonthX0ThroughMonthX1=function(){return null},e.prototype.commaYearX0ThroughYearX1=function(){return null},e.prototype.use24HourTimeFormatByDefault=function(){return!1},e.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occured when generating the expression description. Check the cron expression syntax."},e.prototype.everyMinute=function(){return"every minute"},e.prototype.everyHour=function(){return"every hour"},e.prototype.atSpace=function(){return"At "},e.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},e.prototype.at=function(){return"At"},e.prototype.spaceAnd=function(){return" and"},e.prototype.everySecond=function(){return"every second"},e.prototype.everyX0Seconds=function(){return"every %s seconds"},e.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},e.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},e.prototype.everyX0Minutes=function(){return"every %s minutes"},e.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},e.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},e.prototype.everyX0Hours=function(){return"every %s hours"},e.prototype.betweenX0AndX1=function(){return"between %s and %s"},e.prototype.atX0=function(){return"at %s"},e.prototype.commaEveryDay=function(){return", every day"},e.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},e.prototype.commaX0ThroughX1=function(){return", %s through %s"},e.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},e.prototype.first=function(){return"first"},e.prototype.second=function(){return"second"},e.prototype.third=function(){return"third"},e.prototype.fourth=function(){return"fourth"},e.prototype.fifth=function(){return"fifth"},e.prototype.commaOnThe=function(){return", on the "},e.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},e.prototype.lastDay=function(){return"the last day"},e.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},e.prototype.commaOnlyOnX0=function(){return", only on %s"},e.prototype.commaAndOnX0=function(){return", and on %s"},e.prototype.commaEveryX0Months=function(){return", every %s months"},e.prototype.commaOnlyInX0=function(){return", only in %s"},e.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},e.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},e.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},e.prototype.firstWeekday=function(){return"first weekday"},e.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},e.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},e.prototype.commaEveryX0Days=function(){return", every %s days"},e.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},e.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},e.prototype.commaEveryHour=function(){return", every hour"},e.prototype.commaEveryX0Years=function(){return", every %s years"},e.prototype.commaStartingX0=function(){return", starting %s"},e.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},e.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},e}();t.en=n},586:(e,t)=>{function n(e,t){if(!e)throw new Error(t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(){}return e.secondRange=function(e){for(var t=e.split(","),s=0;s=0&&i<=59,"seconds part must be >= 0 and <= 59")}},e.minuteRange=function(e){for(var t=e.split(","),s=0;s=0&&i<=59,"minutes part must be >= 0 and <= 59")}},e.hourRange=function(e){for(var t=e.split(","),s=0;s=0&&i<=23,"hours part must be >= 0 and <= 23")}},e.dayOfMonthRange=function(e){for(var t=e.split(","),s=0;s=1&&i<=31,"DOM part must be >= 1 and <= 31")}},e.monthRange=function(e,t){for(var s=e.split(","),i=0;i=1&&r<=12,t?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},e.dayOfWeekRange=function(e,t){for(var s=e.split(","),i=0;i=0&&r<=6,t?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},e}();t["default"]=s},910:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StringUtilities=void 0;var n=function(){function e(){}return e.format=function(e){for(var t=[],n=1;n-1}))},e}();t.StringUtilities=n}},t={};function n(s){var i=t[s];if(void 0!==i)return i.exports;var r=t[s]={exports:{}};return e[s](r,r.exports,n),r.exports}var i={};return(()=>{var e=i;Object.defineProperty(e,"__esModule",{value:!0}),e.toString=void 0;var t=n(728),s=n(336);t.ExpressionDescriptor.initialize(new s.enLocaleLoader),e["default"]=t.ExpressionDescriptor;var r=t.ExpressionDescriptor.toString;e.toString=r})(),i})()))},59756:function(e,t,n){var s=n(2478);function i(e,t){var n=null==e?0:e.length;return!!n&&s(e,t,0)>-1}e.exports=i},43316:function(e){function t(e,t,n){var s=-1,i=null==e?0:e.length;while(++s=l&&(h=c,p=!1,t=new s(t));e:while(++f!!e&&"object"===typeof e&&e[f]===r,p=e=>!!e&&"object"===typeof e&&e[f]===o,d=e=>!!e&&"object"===typeof e&&e[f]===a,m=e=>!!e&&"object"===typeof e&&e[f]===c,y=e=>!!e&&"object"===typeof e&&e[f]===l,g=e=>!!e&&"object"===typeof e&&e[f]===u;function b(e){if(e&&"object"===typeof e)switch(e[f]){case a:case u:return!0}return!1}function v(e){if(e&&"object"===typeof e)switch(e[f]){case r:case a:case l:case u:return!0}return!1}const w=e=>(y(e)||b(e))&&!!e.anchor,k=Symbol("break visit"),S=Symbol("skip children"),O=Symbol("remove node");function E(e,t){const n=A(t);if(p(e)){const t=N(null,e.contents,n,Object.freeze([e]));t===O&&(e.contents=null)}else N(null,e,n,Object.freeze([]))}function N(e,t,n,s){const i=I(e,t,n,s);if(v(i)||m(i))return L(e,s,i),N(e,i,n,s);if("symbol"!==typeof i)if(b(t)){s=Object.freeze(s.concat(t));for(let e=0;ee.replace(/[!,[\]{}]/g,(e=>C[e]));class D{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},D.defaultYaml,e),this.tags=Object.assign({},D.defaultTags,t)}clone(){const e=new D(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new D(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:D.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},D.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:D.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},D.defaultTags),this.atNextDocument=!1);const n=e.trim().split(/[ \t]+/),s=n.shift();switch(s){case"%TAG":{if(2!==n.length&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;const[e,s]=n;return this.tags[e]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,1!==n.length)return t(0,"%YAML directive should contain exactly one part"),!1;const[e]=n;if("1.1"===e||"1.2"===e)return this.yaml.version=e,!0;{const n=/^\d+\.\d+$/.test(e);return t(6,`Unsupported YAML version ${e}`,n),!1}}default:return t(0,`Unknown directive ${s}`,!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+$(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&&v(e.contents)){const t={};E(e.contents,((e,n)=>{v(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")}}function M(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=JSON.stringify(e),n=`Anchor must not contain whitespace or control characters: ${t}`;throw new Error(n)}return!0}function _(e){const t=new Set;return E(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function P(e,t){for(let n=1;1;++n){const s=`${e}${n}`;if(!t.has(s))return s}}function B(e,t){const n=[],s=new Map;let i=null;return{onAnchor:s=>{n.push(s),i||(i=_(e));const r=P(t,i);return i.add(r),r},setAnchors:()=>{for(const e of n){const t=s.get(e);if("object"!==typeof t||!t.anchor||!y(t.node)&&!b(t.node)){const t=new Error("Failed to resolve repeated object (this should not happen)");throw t.source=e,t}t.node.anchor=t.anchor}},sourceObjects:s}}function j(e,t,n,s){if(s&&"object"===typeof s)if(Array.isArray(s))for(let i=0,r=s.length;iK(e,String(t),n)));if(e&&"function"===typeof e.toJSON){if(!n||!w(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)}D.defaultYaml={explicit:!1,version:"1.2"},D.defaultTags={"!!":"tag:yaml.org,2002:"};class U{constructor(e){Object.defineProperty(this,f,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:s,reviver:i}={}){if(!p(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=K(this,"",r);if("function"===typeof s)for(const{count:a,res:c}of r.anchors.values())s(c,a);return"function"===typeof i?j(i,{"":o},"",o):o}}class X extends U{constructor(e){super(r),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let t;return E(e,{Node:(e,n)=>{if(n===this)return E.BREAK;n.anchor===this.source&&(t=n)}}),t}toJSON(e,t){if(!t)return{source:this.source};const{anchors:n,doc:s,maxAliasCount:i}=t,r=this.resolve(s);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||(K(r,null,t),o=n.get(r)),!o||void 0===o.res){const e="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(e)}if(i>=0&&(o.count+=1,0===o.aliasCount&&(o.aliasCount=q(s,r,n)),o.count*o.aliasCount>i)){const e="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(e)}return o.res}toString(e,t,n){const s=`*${this.source}`;if(e){if(M(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}}function q(e,t,n){if(h(t)){const s=t.resolve(e),i=n&&s&&n.get(s);return i?i.count*i.aliasCount:0}if(b(t)){let s=0;for(const i of t.items){const t=q(e,i,n);t>s&&(s=t)}return s}if(m(t)){const s=q(e,t.key,n),i=q(e,t.value,n);return Math.max(s,i)}return 1}const R=e=>!e||"function"!==typeof e&&"object"!==typeof e;class F extends U{constructor(e){super(l),this.value=e}toJSON(e,t){return t?.keep?this.value:K(this.value,e,t)}toString(){return String(this.value)}}F.BLOCK_FOLDED="BLOCK_FOLDED",F.BLOCK_LITERAL="BLOCK_LITERAL",F.PLAIN="PLAIN",F.QUOTE_DOUBLE="QUOTE_DOUBLE",F.QUOTE_SINGLE="QUOTE_SINGLE";const W="tag:yaml.org,2002:";function Y(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))}function V(e,t,n){if(p(e)&&(e=e.contents),v(e))return e;if(m(e)){const t=n.schema[a].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:c}=n;let l;if(s&&e&&"object"===typeof e){if(l=c.get(e),l)return l.anchor||(l.anchor=i(e)),new X(l.anchor);l={anchor:null,node:null},c.set(e,l)}t?.startsWith("!!")&&(t=W+t.slice(2));let f=Y(e,t,o.tags);if(!f){if(e&&"function"===typeof e.toJSON&&(e=e.toJSON()),!e||"object"!==typeof e){const t=new F(e);return l&&(l.node=t),t}f=e instanceof Map?o[a]:Symbol.iterator in Object(e)?o[u]:o[a]}r&&(r(f),delete n.onTagObj);const h=f?.createNode?f.createNode(n.schema,e,n):"function"===typeof f?.nodeClass?.from?f.nodeClass.from(n.schema,e,n):new F(e);return t?h.tag=t:f.default||(h.tag=f.tag),l&&(l.node=h),h}function H(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 V(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const J=e=>null==e||"object"===typeof e&&!!e[Symbol.iterator]().next().done;class G extends U{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=>v(t)||m(t)?t.clone(e):t)),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(J(e))this.add(t);else{const[n,...s]=e,i=this.get(n,!0);if(b(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,H(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(b(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&&y(i)?i.value:i:b(i)?i.getIn(s,t):void 0}hasAllNullValues(e){return this.items.every((t=>{if(!m(t))return!1;const n=t.value;return null==n||e&&y(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!!b(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(b(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,H(this.schema,s,t))}}}}const Q=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function z(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Z=(e,t,n)=>e.endsWith("\n")?z(n,t):n.includes("\n")?"\n"+z(n,t):(e.endsWith(" ")?"":" ")+n,ee="flow",te="block",ne="quoted";function se(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,y=-1,g=-1;n===te&&(m=ie(e,m,t.length),-1!==m&&(p=m+c));for(let v;v=e[m+=1];){if(n===ne&&"\\"===v){switch(y=m,e[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}g=m}if("\n"===v)n===te&&(m=ie(e,m,t.length)),p=m+t.length+c,f=void 0;else{if(" "===v&&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(n===ne){while(" "===h||"\t"===h)h=v,v=e[m+=1],d=!0;const t=m>g+1?m-2:y-1;if(u[t])return e;l.push(t),u[t]=!0,p=t+c,f=void 0}else d=!0}h=v}if(d&&a&&a(),0===l.length)return e;o&&o();let b=e.slice(0,l[0]);for(let v=0;v({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),oe=e=>/^(%|---|\.\.\.)/m.test(e);function ae(e,t,n){if(!t||t<0)return!1;const s=t-n,i=e.length;if(i<=s)return!1;for(let r=0,o=0;rs)return!0;if(o=r+1,i-o<=s)return!1}return!0}function ce(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:s}=t,i=t.options.doubleQuotedMinMultiLineLength,r=t.indent||(oe(e)?" ":"");let o="",a=0;for(let c=0,l=n[c];l;l=n[++c])if(" "===l&&"\\"===n[c+1]&&"n"===n[c+2]&&(o+=n.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),"\\"===l)switch(n[c+1]){case"u":{o+=n.slice(a,c);const e=n.substr(c+2,4);switch(e){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:"00"===e.substr(0,2)?o+="\\x"+e.substr(2):o+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(s||'"'===n[c+2]||n.length\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(fe,`$&${l}`));let m,y=!1,g=-1;for(m=0;m")+(y?v:"")+f;if(e&&(w+=" "+a(e.replace(/ ?[\r\n]+/g," ")),i&&i()),u)return n=n.replace(/\n+/g,`$&${l}`),`${w}\n${l}${b}${n}${p}`;n=n.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`);const k=se(`${b}${n}${p}`,l,te,re(s,!0));return`${w}\n${l}${k}`}function pe(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 ue(r,t);if(!r||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||u||!r.includes("\n")?ue(r,t):he(e,t,n,s);if(!a&&!u&&i!==F.PLAIN&&r.includes("\n"))return he(e,t,n,s);if(oe(r)){if(""===c)return t.forceBlockIndent=!0,he(e,t,n,s);if(a&&c===l)return ue(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 ue(r,t)}return a?f:se(f,c,ee,re(t,!1))}function de(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!==F.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=F.QUOTE_DOUBLE);const c=e=>{switch(e){case F.BLOCK_FOLDED:case F.BLOCK_LITERAL:return i||r?ue(o.value,t):he(o,t,n,s);case F.QUOTE_DOUBLE:return ce(o.value,t);case F.QUOTE_SINGLE:return le(o.value,t);case F.PLAIN:return pe(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 me(e,t){const n=Object.assign({blockQuote:!0,commentString:Q,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let 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 ye(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(y(t)){s=t.value;const i=e.filter((e=>e.identify?.(s)));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){const e=s?.constructor?.name??typeof s;throw new Error(`Tag not resolved for ${e} value`)}return n}function ge(e,t,{anchors:n,doc:s}){if(!s.directives)return"";const i=[],r=(y(e)||b(e))&&e.anchor;r&&M(r)&&(n.add(r),i.push(`&${r}`));const o=e.tag?e.tag:t.default?null:t.tag;return o&&i.push(s.directives.tagString(o)),i.join(" ")}function be(e,t,n,s){if(m(e))return e.toString(t,n,s);if(h(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i;const r=v(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i||(i=ye(t.doc.schema.tags,r));const o=ge(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):y(r)?de(r,t,n,s):r.toString(t,n,s);return o?y(r)||"{"===a[0]||"["===a[0]?`${o} ${a}`:`${o}\n${t.indent}${a}`:a}function ve({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=v(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(b(e)||!v(e)&&"object"===typeof e){const e="With simple keys, collection cannot be used as a key value";throw new Error(e)}}let p=!f&&(!e||h&&null==t&&!n.inFlow||b(e)||(y(e)?e.type===F.BLOCK_FOLDED||e.type===F.BLOCK_LITERAL:"object"===typeof e));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!r),indent:a+c});let d,m,w,k=!1,S=!1,O=be(e,n,(()=>k=!0),(()=>S=!0));if(!p&&!n.inFlow&&O.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 k&&s&&s(),""===O?"?":p?`? ${O}`:O}else if(r&&!f||null==t&&p)return O=`? ${O}`,h&&!k?O+=Z(O,n.indent,l(h)):S&&i&&i(),O;k&&(h=null),p?(h&&(O+=Z(O,n.indent,l(h))),O=`? ${O}\n${a}:`):(O=`${O}:`,h&&(O+=Z(O,n.indent,l(h)))),v(t)?(d=!!t.spaceBefore,m=t.commentBefore,w=t.comment):(d=!1,m=null,w=null,t&&"object"===typeof t&&(t=o.createNode(t))),n.implicitKey=!1,p||h||!y(t)||(n.indentAtStart=O.length+1),S=!1,u||!(c.length>=2)||n.inFlow||p||!g(t)||t.flow||t.tag||t.anchor||(n.indent=n.indent.substring(2));let E=!1;const N=be(t,n,(()=>E=!0),(()=>S=!0));let T=" ";if(h||d||m){if(T=d?"\n":"",m){const e=l(m);T+=`\n${z(e,n.indent)}`}""!==N||n.inFlow?T+=`\n${n.indent}`:"\n"===T&&(T="\n\n")}else if(!p&&b(t)){const e=N[0],s=N.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=N.indexOf(" ");"&"===e&&-1!==n&&ne===Oe||y(e)&&e.value===Oe&&(!e.type||e.type===F.PLAIN);function Te(e,t,n){const s=e&&h(n)?n.resolve(e.doc):n;if(!d(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 xe(e,t,n){if(null===t)return"";if("object"!==typeof t)return String(t);if(v(e)&&n?.doc){const t=me(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)+'..."'),Se(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)}function Ae(e,t,n){const s=V(e,void 0,n),i=V(t,void 0,n);return new Ie(s,i)}class Ie{constructor(e,t=null){Object.defineProperty(this,f,{value:c}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return v(t)&&(t=t.clone(e)),v(n)&&(n=n.clone(e)),new Ie(t,n)}toJSON(e,t){const n=t?.mapAsMap?new Map:{};return Ee(t,n,this)}toString(e,t,n){return e?.doc?ve(this,e,t,n):JSON.stringify(this)}}function Le(e,t,n){const s=t.inFlow??e.flow,i=s?$e:Ce;return i(e,t,n)}function Ce({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+=Z(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));du||r.includes("\n"))&&(l=!0),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 De({indent:e,options:{commentString:t}},n,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){const i=z(t(s),e);n.push(i.trimStart())}}function Me(e,t){const n=y(t)?t.value:t;for(const s of e)if(m(s)){if(s.key===t||s.key===n)return s;if(y(s.key)&&s.key.value===n)return s}}class _e extends G{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(a,e),this.items=[]}static from(e,t,n){const{keepUndefined:s,replacer:i}=n,r=new this(e),o=(e,o)=>{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(Ae(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=m(e)?e:e&&"object"===typeof e&&"key"in e?new Ie(e.key,e.value):new Ie(e,e?.value);const s=Me(this.items,n.key),i=this.schema?.sortMapEntries;if(s){if(!t)throw new Error(`Key ${n.key} already set`);y(s.value)&&R(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=Me(this.items,e);if(!t)return!1;const n=this.items.splice(this.items.indexOf(t),1);return n.length>0}get(e,t){const n=Me(this.items,e),s=n?.value;return(!t&&y(s)?s.value:s)??void 0}has(e){return!!Me(this.items,e)}set(e,t){this.add(new Ie(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)Ee(t,s,i);return s}toString(e,t,n){if(!e)return JSON.stringify(this);for(const s of this.items)if(!m(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})),Le(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}}const Pe={collection:"map",default:!0,nodeClass:_e,tag:"tag:yaml.org,2002:map",resolve(e,t){return d(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>_e.from(e,t,n)};class Be extends G{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(u,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=je(e);if("number"!==typeof t)return!1;const n=this.items.splice(t,1);return n.length>0}get(e,t){const n=je(e);if("number"!==typeof n)return;const s=this.items[n];return!t&&y(s)?s.value:s}has(e){const t=je(e);return"number"===typeof t&&t=0?t:null}const Ke={collection:"seq",default:!0,nodeClass:Be,tag:"tag:yaml.org,2002:seq",resolve(e,t){return g(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Be.from(e,t,n)},Ue={identify:e=>"string"===typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,s){return t=Object.assign({actualString:!0},t),de(e,t,n,s)}},Xe={identify:e=>null==e,createNode:()=>new F(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new F(null),stringify:({source:e},t)=>"string"===typeof e&&Xe.test.test(e)?e:t.options.nullStr},qe={identify:e=>"boolean"===typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new F("t"===e[0]||"T"===e[0]),stringify({source:e,value:t},n){if(e&&qe.test.test(e)){const n="t"===e[0]||"T"===e[0];if(t===n)return e}return t?n.options.trueStr:n.options.falseStr}};function Re({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=JSON.stringify(s);if(!e&&t&&(!n||"tag:yaml.org,2002:float"===n)&&/^\d/.test(r)){let e=r.indexOf(".");e<0&&(e=r.length,r+=".");let n=t-(r.length-e-1);while(n-- >0)r+="0"}return r}const Fe={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:Re},We={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():Re(e)}},Ye={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 F(parseFloat(e)),n=e.indexOf(".");return-1!==n&&"0"===e[e.length-1]&&(t.minFractionDigits=e.length-n-1),t},stringify:Re},Ve=e=>"bigint"===typeof e||Number.isInteger(e),He=(e,t,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),n);function Je(e,t,n){const{value:s}=e;return Ve(s)&&s>=0?n+s.toString(t):Re(e)}const Ge={identify:e=>Ve(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>He(e,2,8,n),stringify:e=>Je(e,8,"0o")},Qe={identify:Ve,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>He(e,0,10,n),stringify:Re},ze={identify:e=>Ve(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>He(e,2,16,n),stringify:e=>Je(e,16,"0x")},Ze=[Pe,Ke,Ue,Xe,qe,Ge,Qe,ze,Fe,We,Ye];function et(e){return"bigint"===typeof e||Number.isInteger(e)}const tt=({value:e})=>JSON.stringify(e),nt=[{identify:e=>"string"===typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:tt},{identify:e=>null==e,createNode:()=>new F(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:tt},{identify:e=>"boolean"===typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:e=>"true"===e,stringify:tt},{identify:et,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})=>et(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:tt}],st={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},it=[Pe,Ke].concat(nt,st);var rt=n(93322)["hp"];const ot={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if("function"===typeof rt)return rt.from(e,"base64");if("function"===typeof atob){const t=atob(e.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let e=0;e1&&t("Each pair must have its own sequence indicator");const e=s.items[0]||new Ie(new F(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]=m(s)?s:new Ie(s)}}else t("Expected a sequence for this tag");return e}function ct(e,t,n){const{replacer:s}=n,i=new Be(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(Ae(e,a,n))}return i}const lt={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:at,createNode:ct};class ut extends Be{constructor(){super(),this.add=_e.prototype.add.bind(this),this.delete=_e.prototype.delete.bind(this),this.get=_e.prototype.get.bind(this),this.has=_e.prototype.has.bind(this),this.set=_e.prototype.set.bind(this),this.tag=ut.tag}toJSON(e,t){if(!t)return super.toJSON(e);const n=new Map;t?.onCreate&&t.onCreate(n);for(const s of this.items){let e,i;if(m(s)?(e=K(s.key,"",t),i=K(s.value,e,t)):e=K(s,"",t),n.has(e))throw new Error("Ordered maps must not include duplicate keys");n.set(e,i)}return n}static from(e,t,n){const s=ct(e,t,n),i=new this;return i.items=s.items,i}}ut.tag="tag:yaml.org,2002:omap";const ft={collection:"seq",identify:e=>e instanceof Map,nodeClass:ut,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=at(e,t),s=[];for(const{key:i}of n.items)y(i)&&(s.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):s.push(i.value));return Object.assign(new ut,n)},createNode:(e,t,n)=>ut.from(e,t,n)};function ht({value:e,source:t},n){const s=e?pt:dt;return t&&s.test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const pt={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 F(!0),stringify:ht},dt={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 F(!1),stringify:ht},mt={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:Re},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.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Re(e)}},gt={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 F(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:Re},bt=e=>"bigint"===typeof e||Number.isInteger(e);function vt(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}`;break}const t=BigInt(e);return"-"===i?BigInt(-1)*t:t}const r=parseInt(e,n);return"-"===i?-1*r:r}function wt(e,t,n){const{value:s}=e;if(bt(s)){const e=s.toString(t);return s<0?"-"+n+e.substr(1):n+e}return Re(e)}const kt={identify:bt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>vt(e,2,2,n),stringify:e=>wt(e,2,"0b")},St={identify:bt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>vt(e,1,8,n),stringify:e=>wt(e,8,"0")},Ot={identify:bt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>vt(e,0,10,n),stringify:Re},Et={identify:bt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>vt(e,2,16,n),stringify:e=>wt(e,16,"0x")};class Nt extends _e{constructor(e){super(e),this.tag=Nt.tag}add(e){let t;t=m(e)?e:e&&"object"===typeof e&&"key"in e&&"value"in e&&null===e.value?new Ie(e.key,null):new Ie(e,null);const n=Me(this.items,t.key);n||this.items.push(t)}get(e,t){const n=Me(this.items,e);return!t&&m(n)?y(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=Me(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Ie(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(Ae(r,null,n));return i}}Nt.tag="tag:yaml.org,2002:set";const Tt={collection:"map",identify:e=>e instanceof Set,nodeClass:Nt,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Nt.from(e,t,n),resolve(e,t){if(d(e)){if(e.hasAllNullValues(!0))return Object.assign(new Nt,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function xt(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 At(e){let{value:t}=e,n=e=>e;if("bigint"===typeof t)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return Re(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*$/,"")}const It={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})=>xt(e,n),stringify:At},Lt={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=>xt(e,!1),stringify:At},Ct={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(Ct.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=xt(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$/,"")},$t=[Pe,Ke,Ue,Xe,pt,dt,kt,St,Ot,Et,mt,yt,gt,ot,ft,lt,Tt,It,Lt,Ct],Dt=new Map([["core",Ze],["failsafe",[Pe,Ke,Ue]],["json",it],["yaml11",$t],["yaml-1.1",$t]]),Mt={binary:ot,bool:qe,float:Ye,floatExp:We,floatNaN:Fe,floatTime:Lt,int:Qe,intHex:ze,intOct:Ge,intTime:It,map:Pe,null:Xe,omap:ft,pairs:lt,seq:Ke,set:Tt,timestamp:Ct},_t={"tag:yaml.org,2002:binary":ot,"tag:yaml.org,2002:omap":ft,"tag:yaml.org,2002:pairs":lt,"tag:yaml.org,2002:set":Tt,"tag:yaml.org,2002:timestamp":Ct};function Pt(e,t){let n=Dt.get(t);if(!n){if(!Array.isArray(e)){const e=Array.from(Dt.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`)}n=[]}if(Array.isArray(e))for(const s of e)n=n.concat(s);else"function"===typeof e&&(n=e(n.slice()));return n.map((e=>{if("string"!==typeof e)return e;const t=Mt[e];if(t)return t;const n=Object.keys(Mt).map((e=>JSON.stringify(e))).join(", ");throw new Error(`Unknown custom tag "${e}"; use one of ${n}`)}))}const Bt=(e,t)=>e.keyt.key?1:0;class jt{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:s,schema:i,sortMapEntries:r,toStringDefaults:o}){this.compat=Array.isArray(e)?Pt(e,"compat"):e?Pt(null,e):null,this.merge=!!n,this.name="string"===typeof i&&i||"core",this.knownTags=s?_t:{},this.tags=Pt(t,this.name),this.toStringOptions=o??null,Object.defineProperty(this,a,{value:Pe}),Object.defineProperty(this,l,{value:Ue}),Object.defineProperty(this,u,{value:Ke}),this.sortMapEntries="function"===typeof r?r:!0===r?Bt:null}clone(){const e=Object.create(jt.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function Kt(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=me(e,t),{commentString:r}=i.options;if(e.commentBefore){1!==n.length&&n.unshift("");const t=r(e.commentBefore);n.unshift(z(t,""))}let o=!1,a=null;if(e.contents){if(v(e.contents)){if(e.contents.spaceBefore&&s&&n.push(""),e.contents.commentBefore){const t=r(e.contents.commentBefore);n.push(z(t,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}const t=a?void 0:()=>o=!0;let c=be(e.contents,i,(()=>a=null),t);a&&(c+=Z(c,"",r(a))),"|"!==c[0]&&">"!==c[0]||"---"!==n[n.length-1]?n.push(c):n[n.length-1]=`--- ${c}`}else n.push(be(e.contents,i));if(e.directives?.docEnd)if(e.comment){const t=r(e.comment);t.includes("\n")?(n.push("..."),n.push(z(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(z(r(t),"")))}return n.join("\n")+"\n"}class Ut{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,f,{value:o});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,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 D({version:r}),this.setSchema(r,n),this.contents=void 0===e?null:this.createNode(e,s,n)}clone(){const e=Object.create(Ut.prototype,{[f]:{value:o}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=v(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Xt(this.contents)&&this.contents.add(e)}addIn(e,t){Xt(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const n=_(this);e.anchor=!t||n.has(t)?P(t||"a",n):t}return new X(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}=B(this,r||"a"),p={aliasDuplicateObjects:i??!0,keepUndefined:a??!1,onAnchor:u,onTagObj:c,replacer:s,schema:this.schema,sourceObjects:h},d=V(e,l,p);return o&&b(d)&&(d.flow=!0),f(),d}createPair(e,t,n={}){const s=this.createNode(e,null,n),i=this.createNode(t,null,n);return new Ie(s,i)}delete(e){return!!Xt(this.contents)&&this.contents.delete(e)}deleteIn(e){return J(e)?null!=this.contents&&(this.contents=null,!0):!!Xt(this.contents)&&this.contents.deleteIn(e)}get(e,t){return b(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return J(e)?!t&&y(this.contents)?this.contents.value:this.contents:b(this.contents)?this.contents.getIn(e,t):void 0}has(e){return!!b(this.contents)&&this.contents.has(e)}hasIn(e){return J(e)?void 0!==this.contents:!!b(this.contents)&&this.contents.hasIn(e)}set(e,t){null==this.contents?this.contents=H(this.schema,[e],t):Xt(this.contents)&&this.contents.set(e,t)}setIn(e,t){J(e)?this.contents=t:null==this.contents?this.contents=H(this.schema,Array.from(e),t):Xt(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 D({version:"1.1"}),n={merge:!0,resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new D({version:e}),n={merge:!1,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 jt(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=K(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?j(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 Kt(this,e)}}function Xt(e){if(b(e))return!0;throw new Error("Expected a YAML collection as document contents")}class qt extends Error{constructor(e,t,n,s){super(),this.name=e,this.code=n,this.message=s,this.pos=t}}class Rt extends qt{constructor(e,t,n){super("YAMLParseError",e,t,n)}}class Ft extends qt{constructor(e,t,n){super("YAMLWarning",e,t,n)}}const Wt=(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&&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`}};function Yt(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,y=null,g=null,b=null,v=null,w=null,k=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:c=!0:h+=E.source,l=!0,p=!0,(y||g)&&(b=E),u=!0;break;case"anchor":y&&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),y=E,null===k&&(k=E.offset),l=!1,u=!1,d=!0;break;case"tag":g&&r(E,"MULTIPLE_TAGS","A node can have at most one tag"),g=E,null===k&&(k=E.offset),l=!1,u=!1,d=!0;break;case n:(y||g)&&r(E,"BAD_PROP_ORDER",`Anchors and tags must be after the ${E.source} indicator`),w&&r(E,"UNEXPECTED_TOKEN",`Unexpected ${E.source} in ${t??"collection"}`),w=E,l="seq-item-ind"===n||"explicit-key-ind"===n,u=!1;break;case"comma":if(t){v&&r(E,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),v=E,l=!1,u=!1;break}default:r(E,"UNEXPECTED_TOKEN",`Unexpected ${E.type} token`),l=!1,u=!1}const S=e[e.length-1],O=S?S.offset+S.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:v,found:w,spaceBefore:c,comment:f,hasNewline:p,anchor:y,tag:g,newlineAfterProp:b,end:O,start:k??O}}function Vt(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(Vt(t.key)||Vt(t.value))return!0}return!1;default:return!0}}function Ht(e,t,n){if("flow-collection"===t?.type){const s=t.end[0];if(s.indent===e&&("]"===s.source||"}"===s.source)&&Vt(t)){const e="Flow end indicator should be more indented than parent";n(s,"BAD_INDENT",e,!0)}}}function Jt(e,t,n){const{uniqueKeys:s}=e.options;if(!1===s)return!1;const i="function"===typeof s?s:(t,n)=>t===n||y(t)&&y(n)&&t.value===n.value&&!("<<"===t.value&&e.schema.merge);return t.some((e=>i(e.key,n)))}const Gt="All mapping items must start at the same column";function Qt({composeNode:e,composeEmptyNode:t},n,s,i,r){const o=r?.nodeClass??_e,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=s.offset,l=null;for(const u of s.items){const{start:r,key:o,sep:f,value:h}=u,p=Yt(r,{indicator:"explicit-key-ind",next:o??f?.[0],offset:c,onError:i,parentIndent:s.indent,startOnNewline:!0}),d=!p.found;if(d){if(o&&("block-seq"===o.type?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in o&&o.indent!==s.indent&&i(c,"BAD_INDENT",Gt)),!p.anchor&&!p.tag&&!f){l=p.end,p.comment&&(a.comment?a.comment+="\n"+p.comment:a.comment=p.comment);continue}(p.newlineAfterProp||Vt(o))&&i(o??r[r.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==s.indent&&i(c,"BAD_INDENT",Gt);const m=p.end,y=o?e(n,o,p,i):t(n,m,r,null,p,i);n.schema.compat&&Ht(s.indent,o,i),Jt(n,a.items,y)&&i(m,"DUPLICATE_KEY","Map keys must be unique");const g=Yt(f??[],{indicator:"map-value-ind",next:h,offset:y.range[2],onError:i,parentIndent:s.indent,startOnNewline:!o||"block-scalar"===o.type});if(c=g.end,g.found){d&&("block-map"!==h?.type||g.hasNewline||i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&p.starte&&("block-map"===e.type||"block-seq"===e.type);function nn({composeNode:e,composeEmptyNode:t},n,s,i,r){const o="{"===s.start.source,a=o?"flow map":"flow sequence",c=r?.nodeClass??(o?_e:Be),l=new c(n.schema);l.flow=!0;const u=n.atRoot;u&&(n.atRoot=!1);let f=s.offset+s.start.source.length;for(let g=0;g0){const e=Zt(d,y,n.options.strict,i);e.comment&&(l.comment?l.comment+="\n"+e.comment:l.comment=e.comment),l.range=[s.offset,y,e.offset]}else l.range=[s.offset,y,y];return l}function sn(e,t,n,s,i,r){const o="block-map"===n.type?Qt(e,t,n,s,r):"block-seq"===n.type?zt(e,t,n,s,r):nn(e,t,n,s,r),a=o.constructor;return"!"===i||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function rn(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;if(n&&(!t||t.offsete.tag===o&&e.collection===a));if(!c){const s=t.schema.knownTags[o];if(!s||s.collection!==a)return s?.collection?i(r,"BAD_COLLECTION_TYPE",`${s.tag} used for ${a} collection, but expects ${s.collection}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),sn(e,t,n,i,o);t.schema.tags.push(Object.assign({},s,{default:!1})),c=s}const l=sn(e,t,n,i,o,c),u=c.resolve?.(l,(e=>i(r,"TAG_RESOLVE_FAILED",e)),t.options)??l,f=v(u)?u:new F(u);return f.range=l.range,f.tag=o,c?.format&&(f.format=c.format),f}function on(e,t,n){const s=t.offset,i=an(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[s,s,s]};const r=">"===i.mode?F.BLOCK_FOLDED:F.BLOCK_LITERAL,o=t.source?cn(t.source):[];let a=o.length;for(let m=o.length-1;m>=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=F.PLAIN,c=un(r,l);break;case"single-quoted-scalar":a=F.QUOTE_SINGLE,c=fn(r,l);break;case"double-quoted-scalar":a=F.QUOTE_DOUBLE,c=pn(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=Zt(o,u,t,n);return{value:c,type:a,comment:f.comment,range:[s,u,f.offset]}}function un(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]}`;break}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),hn(e)}function fn(e,t){return"'"===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR","Missing closing 'quote"),hn(e.slice(1,-1)).replace(/''/g,"'")}function hn(e){let t,n;try{t=new RegExp("(.*?)(?t?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}function dn(e,t){let n="",s=e[t+1];while(" "===s||"\t"===s||"\n"===s||"\r"===s){if("\r"===s&&"\n"!==e[t+2])break;"\n"===s&&(n+="\n"),t+=1,s=e[t+1]}return n||(n=" "),{fold:n,offset:t}}const mn={0:"\0",a:"",b:"\b",e:"",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function yn(e,t,n,s){const i=e.substr(t,n),r=i.length===n&&/^[0-9a-fA-F]+$/.test(i),o=r?parseInt(i,16):NaN;if(isNaN(o)){const i=e.substr(t-2,n+2);return s(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${i}`),i}return String.fromCodePoint(o)}function gn(e,t,n,s){const{value:i,type:r,comment:o,range:a}="block-scalar"===t.type?on(e,t,s):ln(t,e.options.strict,s),c=n?e.directives.tagName(n.source,(e=>s(n,"TAG_RESOLVE_FAILED",e))):null,u=n&&c?bn(e.schema,i,c,n,s):"scalar"===t.type?vn(e,i,t,s):e.schema[l];let f;try{const r=u.resolve(i,(e=>s(n??t,"TAG_RESOLVE_FAILED",e)),e.options);f=y(r)?r:new F(r)}catch(h){const e=h instanceof Error?h.message:String(h);s(n??t,"TAG_RESOLVE_FAILED",e),f=new F(i)}return f.range=a,f.source=i,r&&(f.type=r),c&&(f.tag=c),u.format&&(f.format=u.format),o&&(f.comment=o),f}function bn(e,t,n,s,i){if("!"===n)return e[l];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[l])}function vn({directives:e,schema:t},n,s,i){const r=t.tags.find((e=>e.default&&e.test?.test(n)))||t[l];if(t.compat){const o=t.compat.find((e=>e.default&&e.test?.test(n)))??t[l];if(r.tag!==o.tag){const t=e.tagString(r.tag),n=e.tagString(o.tag),a=`Value may be parsed as either ${t} or ${n}`;i(s,"TAG_RESOLVE_FAILED",a,!0)}}return r}function wn(e,t,n){if(t){null===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}n=t[++s];while("space"===n?.type)e+=n.source.length,n=t[++s];break}}return e}const kn={composeNode:Sn,composeEmptyNode:On};function Sn(e,t,n,s){const{spaceBefore:i,comment:r,anchor:o,tag:a}=n;let c,l=!0;switch(t.type){case"alias":c=En(e,t,s),(o||a)&&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":c=gn(e,t,a,s),o&&(c.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":c=rn(kn,e,t,n,s),o&&(c.anchor=o.source.substring(1));break;default:{const i="error"===t.type?t.message:`Unsupported token (type: ${t.type})`;s(t,"UNEXPECTED_TOKEN",i),c=On(e,t.offset,void 0,null,n,s),l=!1}}return o&&""===c.anchor&&s(o,"BAD_ALIAS","Anchor cannot be an empty string"),i&&(c.spaceBefore=!0),r&&("scalar"===t.type&&""===t.source?c.comment=r:c.commentBefore=r),e.options.keepSourceTokens&&l&&(c.srcToken=t),c}function On(e,t,n,s,{spaceBefore:i,comment:r,anchor:o,tag:a,end:c},l){const u={type:"scalar",offset:wn(t,n,s),indent:-1,source:""},f=gn(e,u,a,l);return o&&(f.anchor=o.source.substring(1),""===f.anchor&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=c),f}function En({options:e},{offset:t,source:n,end:s},i){const r=new X(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=Zt(s,o,e.strict,i);return r.range=[t,o,a.offset],a.comment&&(r.comment=a.comment),r}function Nn(e,t,{offset:n,start:s,value:i,end:r},o){const a=Object.assign({_directives:t},e),c=new Ut(void 0,a),l={atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Yt(s,{indicator:"doc-start",next:i??r?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,!i||"block-map"!==i.type&&"block-seq"!==i.type||u.hasNewline||o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?Sn(l,i,u,o):On(l,u.end,s,null,u,o);const f=c.contents.range[2],h=Zt(r,f,!1,o);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}function Tn(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 xn(e){let t="",n=!1,s=!1;for(let i=0;i{const i=Tn(e);s?this.warnings.push(new Ft(i,t,n)):this.errors.push(new Rt(i,t,n))},this.directives=new D({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:n,afterEmptyLine:s}=xn(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(b(i)&&!i.flow&&i.items.length>0){let e=i.items[0];m(e)&&(e=e.key);const t=e.commentBefore;e.commentBefore=t?`${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:xn(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=Tn(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",n,s)})),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=Nn(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 Rt(Tn(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const t="Unexpected doc-end without preceding document";this.errors.push(new Rt(Tn(e),"UNEXPECTED_TOKEN",t));break}this.doc.directives.docEnd=!0;const t=Zt(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 Rt(Tn(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const e=Object.assign({_directives:this.directives},this.options),n=new Ut(void 0,e);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,t,t],this.decorate(n,!1),yield n}}}function In(e,t=!0,n){if(e){const s=(e,t,s)=>{const i="number"===typeof e?e:Array.isArray(e)?e[0]:e.offset;if(!n)throw new Rt([i,i+1],t,s);n(i,t,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return ln(e,t,s);case"block-scalar":return on({options:{strict:t}},e,s)}}return null}function Ln(e,t){const{implicitKey:n=!1,indent:s,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=t,a=de({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 Dn(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 Cn(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=de({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">":$n(e,c);break;case'"':Mn(e,c,"double-quoted-scalar");break;case"'":Mn(e,c,"single-quoted-scalar");break;default:Mn(e,c,"scalar")}}function $n(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}];Dn(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})}}function Dn(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 Mn(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=e.offset+t.length,i={type:"newline",offset:s,indent:e.indent,source:"\n"};delete e.items,Object.assign(e,{type:n,source:t,end:[i]});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})}}}const _n=e=>"type"in e?Pn(e):Bn(e);function Pn(e){switch(e.type){case"block-scalar":{let t="";for(const n of e.props)t+=Pn(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(const n of e.items)t+=Bn(n);return t}case"flow-collection":{let t=e.start.source;for(const n of e.items)t+=Bn(n);for(const n of e.end)t+=n.source;return t}case"document":{let t=Bn(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 Bn({start:e,key:t,sep:n,value:s}){let i="";for(const r of e)i+=r.source;if(t&&(i+=Pn(t)),n)for(const r of n)i+=r.source;return s&&(i+=Pn(s)),i}const jn=Symbol("break visit"),Kn=Symbol("skip children"),Un=Symbol("remove item");function Xn(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),qn(Object.freeze([]),e,t)}function qn(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{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},Xn.parentCollection=(e,t)=>{const n=Xn.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")};const Rn="\ufeff",Fn="",Wn="",Yn="",Vn=e=>!!e&&"items"in e,Hn=e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type);function Jn(e){switch(e){case Rn:return"";case Fn:return"";case Wn:return"";case Yn:return"";default:return JSON.stringify(e)}}function Gn(e){switch(e){case Rn:return"byte-order-mark";case Fn:return"doc-mode";case Wn:return"flow-error-end";case Yn: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 Qn(e){switch(e){case void 0:case" ":case"\n":case"\r":case"\t":return!0;default:return!1}}const zn=new Set("0123456789ABCDEFabcdef"),Zn=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),es=new Set(",[]{}"),ts=new Set(" ,[]{}\n\r\t"),ns=e=>!e||ts.has(e);class ss{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";while(n&&(t||this.hasChars(1)))n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];while(" "===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;while(" "===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)&&Qn(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return("number"!==typeof e||-1!==e&&ethis.indentValue&&!Qn(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)&&Qn(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(ns),"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=>Qn(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;e=this.buffer[s];while(" "===e)e=this.buffer[++s];if("\t"===e){while("\t"===e||" "===e||"\r"===e||"\n"===e)e=this.buffer[++s];t=s-1}else if(!this.blockScalarKeep)do{let e=t-1,s=this.buffer[e];"\r"===s&&(s=this.buffer[--e]);const i=e;while(" "===s)s=this.buffer[--e];if(!("\n"===s&&e>=this.pos&&e+1+n>i))break;t=e}while(1);return yield Yn,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;while(t=this.buffer[++s])if(":"===t){const t=this.buffer[s+1];if(Qn(t)||e&&es.has(t))break;n=s}else if(Qn(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&&es.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&&es.has(t))break;n=s}return t||this.atEnd?(yield Yn,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(ns))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,t=this.charAt(1);if(Qn(t)||e&&es.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];while(!Qn(t)&&">"!==t)t=this.buffer[++e];return yield*this.pushToIndex(">"===t?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];while(t)if(Zn.has(t))t=this.buffer[++e];else{if("%"!==t||!zn.has(this.buffer[e+1])||!zn.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];while(!e(n))n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}class is{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;while(t>1;this.lineStarts[s]=0)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}while("space"===e[++t]?.type);return e.splice(t,e.length)}function us(e){if("flow-seq-start"===e.start.type)for(const t of e.items)!t.sep||t.value||rs(t.start,"explicit-key-ind")||rs(t.sep,"map-value-ind")||(t.key&&(t.value=t.key),delete t.key,as(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}class fs{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new ss,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&0===this.offset&&this.onNewLine(0);for(const n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar)return this.atScalar=!1,yield*this.step(),void(this.offset+=e.length);const t=Gn(e);if(t)if("scalar"===t)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&" "===e[0]&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const t=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:t,source:e}),this.offset+=e.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){const e={type:this.type,offset:this.offset,indent:this.indent,source:this.source};return e}*step(){const e=this.peek(1);if("doc-end"!==this.type||e&&"doc-end"===e.type){if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}else{while(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&&us(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===os(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(rs(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(as(t.key)&&!rs(t.sep,"newline")){const e=ls(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(rs(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const e=ls(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]}):rs(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 t=this.startBlockValue(e);if(t)return n&&"block-seq"!==t.type&&e.items.push({start:i}),void this.stack.push(t)}}}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,s=Array.isArray(n)?n[n.length-1]:void 0;"comment"===s?.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],s=n?.value?.end;if(Array.isArray(s))return Array.prototype.push.apply(s,t.start),s.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||rs(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken))}if(this.indent>e.indent){const t=this.startBlockValue(e);if(t)return void this.stack.push(t)}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if("flow-error-end"===this.type){let e;do{yield*this.pop(),e=this.peek(1)}while(e&&"flow-collection"===e.type)}else if(0===e.end.length){switch(this.type){case"comma":case"explicit-key-ind":return void(!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken));case"map-value-ind":return void(!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]}));case"space":case"comment":case"newline":case"anchor":case"tag":return void(!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken));case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const 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=cs(t),s=ls(n);us(e);const i=e.end.splice(1,e.end.length);i.push(this.sourceToken);const r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;while(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=cs(e),n=ls(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=cs(e),n=ls(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return"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;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}}function hs(e){const t=!1!==e.prettyErrors,n=e.lineCounter||t&&new is||null;return{lineCounter:n,prettyErrors:t}}function ps(e,t={}){const{lineCounter:n,prettyErrors:s}=hs(t),i=new fs(n?.addNewLine),r=new An(t),o=Array.from(r.compose(i.parse(e)));if(s&&n)for(const a of o)a.errors.forEach(Wt(e,n)),a.warnings.forEach(Wt(e,n));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function ds(e,t={}){const{lineCounter:n,prettyErrors:s}=hs(t),i=new fs(n?.addNewLine),r=new An(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 Rt(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(Wt(e,n)),o.warnings.forEach(Wt(e,n))),o}function ms(e,t,n){let s;"function"===typeof t?s=t:void 0===n&&t&&"object"===typeof t&&(n=t);const i=ds(e,n);if(!i)return null;if(i.warnings.forEach((e=>Se(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 ys(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 new Ut(e,s,n).toString(n)}var gs=i}}]); //# sourceMappingURL=harvester-1.0.2.umd.min.851.js.map