1){var E=v.slice(0,w.index);var S=v.slice(w.index+w.length);x=E.join(":")+"::"+S.join(":")}else{x=v.join(":")}if(s){x+="%"+s}return x}else{return e}}var N=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;var R="".match(/(){0}/)[1]===undefined;function parse(e){var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var i={};var n=a.iri!==false?r:t;if(a.reference==="suffix")e=(a.scheme?a.scheme+":":"")+"//"+e;var s=e.match(N);if(s){if(R){i.scheme=s[1];i.userinfo=s[3];i.host=s[4];i.port=parseInt(s[5],10);i.path=s[6]||"";i.query=s[7];i.fragment=s[8];if(isNaN(i.port)){i.port=s[5]}}else{i.scheme=s[1]||undefined;i.userinfo=e.indexOf("@")!==-1?s[3]:undefined;i.host=e.indexOf("//")!==-1?s[4]:undefined;i.port=parseInt(s[5],10);i.path=s[6]||"";i.query=e.indexOf("?")!==-1?s[7]:undefined;i.fragment=e.indexOf("#")!==-1?s[8]:undefined;if(isNaN(i.port)){i.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?s[4]:undefined}}if(i.host){i.host=_normalizeIPv6(_normalizeIPv4(i.host,n),n)}if(i.scheme===undefined&&i.userinfo===undefined&&i.host===undefined&&i.port===undefined&&!i.path&&i.query===undefined){i.reference="same-document"}else if(i.scheme===undefined){i.reference="relative"}else if(i.fragment===undefined){i.reference="absolute"}else{i.reference="uri"}if(a.reference&&a.reference!=="suffix"&&a.reference!==i.reference){i.error=i.error||"URI is not a "+a.reference+" reference."}var o=D[(a.scheme||i.scheme||"").toLowerCase()];if(!a.unicodeSupport&&(!o||!o.unicodeSupport)){if(i.host&&(a.domainHost||o&&o.domainHost)){try{i.host=A.toASCII(i.host.replace(n.PCT_ENCODED,pctDecChars).toLowerCase())}catch(e){i.error=i.error||"Host's domain name can not be converted to ASCII via punycode: "+e}}_normalizeComponentEncoding(i,t)}else{_normalizeComponentEncoding(i,n)}if(o&&o.parse){o.parse(i,a)}}else{i.error=i.error||"URI can not be parsed."}return i}function _recomposeAuthority(e,a){var i=a.iri!==false?r:t;var n=[];if(e.userinfo!==undefined){n.push(e.userinfo);n.push("@")}if(e.host!==undefined){n.push(_normalizeIPv6(_normalizeIPv4(String(e.host),i),i).replace(i.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"})))}if(typeof e.port==="number"||typeof e.port==="string"){n.push(":");n.push(String(e.port))}return n.length?n.join(""):undefined}var j=/^\.\.?\//;var F=/^\/\.(\/|$)/;var I=/^\/\.\.(\/|$)/;var $=/^\/?(?:.|\n)*?(?=\/|$)/;function removeDotSegments(e){var t=[];while(e.length){if(e.match(j)){e=e.replace(j,"")}else if(e.match(F)){e=e.replace(F,"/")}else if(e.match(I)){e=e.replace(I,"/");t.pop()}else if(e==="."||e===".."){e=""}else{var r=e.match($);if(r){var a=r[0];e=e.slice(a.length);t.push(a)}else{throw new Error("Unexpected dot segment condition")}}}return t.join("")}function serialize(e){var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var i=a.iri?r:t;var n=[];var s=D[(a.scheme||e.scheme||"").toLowerCase()];if(s&&s.serialize)s.serialize(e,a);if(e.host){if(i.IPV6ADDRESS.test(e.host)){}else if(a.domainHost||s&&s.domainHost){try{e.host=!a.iri?A.toASCII(e.host.replace(i.PCT_ENCODED,pctDecChars).toLowerCase()):A.toUnicode(e.host)}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(!a.iri?"ASCII":"Unicode")+" via punycode: "+t}}}_normalizeComponentEncoding(e,i);if(a.reference!=="suffix"&&e.scheme){n.push(e.scheme);n.push(":")}var o=_recomposeAuthority(e,a);if(o!==undefined){if(a.reference!=="suffix"){n.push("//")}n.push(o);if(e.path&&e.path.charAt(0)!=="/"){n.push("/")}}if(e.path!==undefined){var p=e.path;if(!a.absolutePath&&(!s||!s.absolutePath)){p=removeDotSegments(p)}if(o===undefined){p=p.replace(/^\/\//,"/%2F")}n.push(p)}if(e.query!==undefined){n.push("?");n.push(e.query)}if(e.fragment!==undefined){n.push("#");n.push(e.fragment)}return n.join("")}function resolveComponents(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var a=arguments[3];var i={};if(!a){e=parse(serialize(e,r),r);t=parse(serialize(t,r),r)}r=r||{};if(!r.tolerant&&t.scheme){i.scheme=t.scheme;i.userinfo=t.userinfo;i.host=t.host;i.port=t.port;i.path=removeDotSegments(t.path||"");i.query=t.query}else{if(t.userinfo!==undefined||t.host!==undefined||t.port!==undefined){i.userinfo=t.userinfo;i.host=t.host;i.port=t.port;i.path=removeDotSegments(t.path||"");i.query=t.query}else{if(!t.path){i.path=e.path;if(t.query!==undefined){i.query=t.query}else{i.query=e.query}}else{if(t.path.charAt(0)==="/"){i.path=removeDotSegments(t.path)}else{if((e.userinfo!==undefined||e.host!==undefined||e.port!==undefined)&&!e.path){i.path="/"+t.path}else if(!e.path){i.path=t.path}else{i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path}i.path=removeDotSegments(i.path)}i.query=t.query}i.userinfo=e.userinfo;i.host=e.host;i.port=e.port}i.scheme=e.scheme}i.fragment=t.fragment;return i}function resolve(e,t,r){var a=assign({scheme:"null"},r);return serialize(resolveComponents(parse(e,a),parse(t,a),a,true),a)}function normalize(e,t){if(typeof e==="string"){e=serialize(parse(e,t),t)}else if(typeOf(e)==="object"){e=parse(serialize(e,t),t)}return e}function equal(e,t,r){if(typeof e==="string"){e=serialize(parse(e,r),r)}else if(typeOf(e)==="object"){e=serialize(e,r)}if(typeof t==="string"){t=serialize(parse(t,r),r)}else if(typeOf(t)==="object"){t=serialize(t,r)}return e===t}function escapeComponent(e,a){return e&&e.toString().replace(!a||!a.iri?t.ESCAPE:r.ESCAPE,pctEncChar)}function unescapeComponent(e,a){return e&&e.toString().replace(!a||!a.iri?t.PCT_ENCODED:r.PCT_ENCODED,pctDecChars)}var B={scheme:"http",domainHost:true,parse:function parse(e,t){if(!e.host){e.error=e.error||"HTTP URIs must have a host."}return e},serialize:function serialize(e,t){var r=String(e.scheme).toLowerCase()==="https";if(e.port===(r?443:80)||e.port===""){e.port=undefined}if(!e.path){e.path="/"}return e}};var L={scheme:"https",domainHost:B.domainHost,parse:B.parse,serialize:B.serialize};function isSecure(e){return typeof e.secure==="boolean"?e.secure:String(e.scheme).toLowerCase()==="wss"}var M={scheme:"ws",domainHost:true,parse:function parse(e,t){var r=e;r.secure=isSecure(r);r.resourceName=(r.path||"/")+(r.query?"?"+r.query:"");r.path=undefined;r.query=undefined;return r},serialize:function serialize(e,t){if(e.port===(isSecure(e)?443:80)||e.port===""){e.port=undefined}if(typeof e.secure==="boolean"){e.scheme=e.secure?"wss":"ws";e.secure=undefined}if(e.resourceName){var r=e.resourceName.split("?"),i=a(r,2),n=i[0],s=i[1];e.path=n&&n!=="/"?n:undefined;e.query=s;e.resourceName=undefined}e.fragment=undefined;return e}};var U={scheme:"wss",domainHost:M.domainHost,parse:M.parse,serialize:M.serialize};var G={};var V=true;var q="[A-Za-z0-9\\-\\.\\_\\~"+(V?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]";var z="[0-9A-Fa-f]";var H=subexp(subexp("%[EFef]"+z+"%"+z+z+"%"+z+z)+"|"+subexp("%[89A-Fa-f]"+z+"%"+z+z)+"|"+subexp("%"+z+z));var K="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]";var W="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]";var J=merge(W,'[\\"\\\\]');var Y="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]";var Q=new RegExp(q,"g");var X=new RegExp(H,"g");var Z=new RegExp(merge("[^]",K,"[\\.]",'[\\"]',J),"g");var ee=new RegExp(merge("[^]",q,Y),"g");var te=ee;function decodeUnreserved(e){var t=pctDecChars(e);return!t.match(Q)?e:t}var re={scheme:"mailto",parse:function parse$$1(e,t){var r=e;var a=r.to=r.path?r.path.split(","):[];r.path=undefined;if(r.query){var i=false;var n={};var s=r.query.split("&");for(var o=0,p=s.length;o{"use strict";Object.defineProperty(t,"__esModule",{value:true});Object.defineProperty(t,"v1",{enumerable:true,get:function(){return a.default}});Object.defineProperty(t,"v3",{enumerable:true,get:function(){return i.default}});Object.defineProperty(t,"v4",{enumerable:true,get:function(){return n.default}});Object.defineProperty(t,"v5",{enumerable:true,get:function(){return s.default}});Object.defineProperty(t,"NIL",{enumerable:true,get:function(){return o.default}});Object.defineProperty(t,"version",{enumerable:true,get:function(){return p.default}});Object.defineProperty(t,"validate",{enumerable:true,get:function(){return c.default}});Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return l.default}});Object.defineProperty(t,"parse",{enumerable:true,get:function(){return d.default}});var a=_interopRequireDefault(r(8628));var i=_interopRequireDefault(r(6409));var n=_interopRequireDefault(r(5122));var s=_interopRequireDefault(r(9120));var o=_interopRequireDefault(r(5332));var p=_interopRequireDefault(r(1595));var c=_interopRequireDefault(r(6900));var l=_interopRequireDefault(r(8950));var d=_interopRequireDefault(r(2746));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},4569:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var a=_interopRequireDefault(r(6113));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function md5(e){if(Array.isArray(e)){e=Buffer.from(e)}else if(typeof e==="string"){e=Buffer.from(e,"utf8")}return a.default.createHash("md5").update(e).digest()}var i=md5;t["default"]=i},5332:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var r="00000000-0000-0000-0000-000000000000";t["default"]=r},2746:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var a=_interopRequireDefault(r(6900));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function parse(e){if(!(0,a.default)(e)){throw TypeError("Invalid UUID")}let t;const r=new Uint8Array(16);r[0]=(t=parseInt(e.slice(0,8),16))>>>24;r[1]=t>>>16&255;r[2]=t>>>8&255;r[3]=t&255;r[4]=(t=parseInt(e.slice(9,13),16))>>>8;r[5]=t&255;r[6]=(t=parseInt(e.slice(14,18),16))>>>8;r[7]=t&255;r[8]=(t=parseInt(e.slice(19,23),16))>>>8;r[9]=t&255;r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255;r[11]=t/4294967296&255;r[12]=t>>>24&255;r[13]=t>>>16&255;r[14]=t>>>8&255;r[15]=t&255;return r}var i=parse;t["default"]=i},814:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var r=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;t["default"]=r},807:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=rng;var a=_interopRequireDefault(r(6113));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const i=new Uint8Array(256);let n=i.length;function rng(){if(n>i.length-16){a.default.randomFillSync(i);n=0}return i.slice(n,n+=16)}},5274:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var a=_interopRequireDefault(r(6113));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function sha1(e){if(Array.isArray(e)){e=Buffer.from(e)}else if(typeof e==="string"){e=Buffer.from(e,"utf8")}return a.default.createHash("sha1").update(e).digest()}var i=sha1;t["default"]=i},8950:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var a=_interopRequireDefault(r(6900));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const i=[];for(let e=0;e<256;++e){i.push((e+256).toString(16).substr(1))}function stringify(e,t=0){const r=(i[e[t+0]]+i[e[t+1]]+i[e[t+2]]+i[e[t+3]]+"-"+i[e[t+4]]+i[e[t+5]]+"-"+i[e[t+6]]+i[e[t+7]]+"-"+i[e[t+8]]+i[e[t+9]]+"-"+i[e[t+10]]+i[e[t+11]]+i[e[t+12]]+i[e[t+13]]+i[e[t+14]]+i[e[t+15]]).toLowerCase();if(!(0,a.default)(r)){throw TypeError("Stringified UUID is invalid")}return r}var n=stringify;t["default"]=n},8628:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var a=_interopRequireDefault(r(807));var i=_interopRequireDefault(r(8950));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let n;let s;let o=0;let p=0;function v1(e,t,r){let c=t&&r||0;const l=t||new Array(16);e=e||{};let d=e.node||n;let u=e.clockseq!==undefined?e.clockseq:s;if(d==null||u==null){const t=e.random||(e.rng||a.default)();if(d==null){d=n=[t[0]|1,t[1],t[2],t[3],t[4],t[5]]}if(u==null){u=s=(t[6]<<8|t[7])&16383}}let m=e.msecs!==undefined?e.msecs:Date.now();let h=e.nsecs!==undefined?e.nsecs:p+1;const g=m-o+(h-p)/1e4;if(g<0&&e.clockseq===undefined){u=u+1&16383}if((g<0||m>o)&&e.nsecs===undefined){h=0}if(h>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}o=m;p=h;s=u;m+=122192928e5;const v=((m&268435455)*1e4+h)%4294967296;l[c++]=v>>>24&255;l[c++]=v>>>16&255;l[c++]=v>>>8&255;l[c++]=v&255;const y=m/4294967296*1e4&268435455;l[c++]=y>>>8&255;l[c++]=y&255;l[c++]=y>>>24&15|16;l[c++]=y>>>16&255;l[c++]=u>>>8|128;l[c++]=u&255;for(let e=0;e<6;++e){l[c+e]=d[e]}return t||(0,i.default)(l)}var c=v1;t["default"]=c},6409:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var a=_interopRequireDefault(r(5998));var i=_interopRequireDefault(r(4569));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const n=(0,a.default)("v3",48,i.default);var s=n;t["default"]=s},5998:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=_default;t.URL=t.DNS=void 0;var a=_interopRequireDefault(r(8950));var i=_interopRequireDefault(r(2746));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function stringToBytes(e){e=unescape(encodeURIComponent(e));const t=[];for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var a=_interopRequireDefault(r(807));var i=_interopRequireDefault(r(8950));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function v4(e,t,r){e=e||{};const n=e.random||(e.rng||a.default)();n[6]=n[6]&15|64;n[8]=n[8]&63|128;if(t){r=r||0;for(let e=0;e<16;++e){t[r+e]=n[e]}return t}return(0,i.default)(n)}var n=v4;t["default"]=n},9120:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var a=_interopRequireDefault(r(5998));var i=_interopRequireDefault(r(5274));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const n=(0,a.default)("v5",80,i.default);var s=n;t["default"]=s},6900:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var a=_interopRequireDefault(r(814));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function validate(e){return typeof e==="string"&&a.default.test(e)}var i=validate;t["default"]=i},1595:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var a=_interopRequireDefault(r(6900));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function version(e){if(!(0,a.default)(e)){throw TypeError("Invalid UUID")}return parseInt(e.substr(14,1),16)}var i=version;t["default"]=i},4886:e=>{"use strict";var t={};e.exports=t;function sign(e){return e<0?-1:1}function evenRound(e){if(e%1===.5&&(e&1)===0){return Math.floor(e)}else{return Math.round(e)}}function createNumberConversion(e,t){if(!t.unsigned){--e}const r=t.unsigned?0:-Math.pow(2,e);const a=Math.pow(2,e)-1;const i=t.moduloBitLength?Math.pow(2,t.moduloBitLength):Math.pow(2,e);const n=t.moduloBitLength?Math.pow(2,t.moduloBitLength-1):Math.pow(2,e-1);return function(e,s){if(!s)s={};let o=+e;if(s.enforceRange){if(!Number.isFinite(o)){throw new TypeError("Argument is not a finite number")}o=sign(o)*Math.floor(Math.abs(o));if(oa){throw new TypeError("Argument is not in byte range")}return o}if(!isNaN(o)&&s.clamp){o=evenRound(o);if(oa)o=a;return o}if(!Number.isFinite(o)||o===0){return 0}o=sign(o)*Math.floor(Math.abs(o));o=o%i;if(!t.unsigned&&o>=n){return o-i}else if(t.unsigned){if(o<0){o+=i}else if(o===-0){return 0}}return o}}t["void"]=function(){return undefined};t["boolean"]=function(e){return!!e};t["byte"]=createNumberConversion(8,{unsigned:false});t["octet"]=createNumberConversion(8,{unsigned:true});t["short"]=createNumberConversion(16,{unsigned:false});t["unsigned short"]=createNumberConversion(16,{unsigned:true});t["long"]=createNumberConversion(32,{unsigned:false});t["unsigned long"]=createNumberConversion(32,{unsigned:true});t["long long"]=createNumberConversion(32,{unsigned:false,moduloBitLength:64});t["unsigned long long"]=createNumberConversion(32,{unsigned:true,moduloBitLength:64});t["double"]=function(e){const t=+e;if(!Number.isFinite(t)){throw new TypeError("Argument is not a finite floating-point value")}return t};t["unrestricted double"]=function(e){const t=+e;if(isNaN(t)){throw new TypeError("Argument is NaN")}return t};t["float"]=t["double"];t["unrestricted float"]=t["unrestricted double"];t["DOMString"]=function(e,t){if(!t)t={};if(t.treatNullAsEmptyString&&e===null){return""}return String(e)};t["ByteString"]=function(e,t){const r=String(e);let a=undefined;for(let e=0;(a=r.codePointAt(e))!==undefined;++e){if(a>255){throw new TypeError("Argument is not a valid bytestring")}}return r};t["USVString"]=function(e){const t=String(e);const r=t.length;const a=[];for(let e=0;e57343){a.push(String.fromCodePoint(i))}else if(56320<=i&&i<=57343){a.push(String.fromCodePoint(65533))}else{if(e===r-1){a.push(String.fromCodePoint(65533))}else{const r=t.charCodeAt(e+1);if(56320<=r&&r<=57343){const t=i&1023;const n=r&1023;a.push(String.fromCodePoint((2<<15)+(2<<9)*t+n));++e}else{a.push(String.fromCodePoint(65533))}}}}return a.join("")};t["Date"]=function(e,t){if(!(e instanceof Date)){throw new TypeError("Argument is not a Date object")}if(isNaN(e)){return undefined}return e};t["RegExp"]=function(e,t){if(!(e instanceof RegExp)){e=new RegExp(e)}return e}},7537:(e,t,r)=>{"use strict";const a=r(5996);t.implementation=class URLImpl{constructor(e){const t=e[0];const r=e[1];let i=null;if(r!==undefined){i=a.basicURLParse(r);if(i==="failure"){throw new TypeError("Invalid base URL")}}const n=a.basicURLParse(t,{baseURL:i});if(n==="failure"){throw new TypeError("Invalid URL")}this._url=n}get href(){return a.serializeURL(this._url)}set href(e){const t=a.basicURLParse(e);if(t==="failure"){throw new TypeError("Invalid URL")}this._url=t}get origin(){return a.serializeURLOrigin(this._url)}get protocol(){return this._url.scheme+":"}set protocol(e){a.basicURLParse(e+":",{url:this._url,stateOverride:"scheme start"})}get username(){return this._url.username}set username(e){if(a.cannotHaveAUsernamePasswordPort(this._url)){return}a.setTheUsername(this._url,e)}get password(){return this._url.password}set password(e){if(a.cannotHaveAUsernamePasswordPort(this._url)){return}a.setThePassword(this._url,e)}get host(){const e=this._url;if(e.host===null){return""}if(e.port===null){return a.serializeHost(e.host)}return a.serializeHost(e.host)+":"+a.serializeInteger(e.port)}set host(e){if(this._url.cannotBeABaseURL){return}a.basicURLParse(e,{url:this._url,stateOverride:"host"})}get hostname(){if(this._url.host===null){return""}return a.serializeHost(this._url.host)}set hostname(e){if(this._url.cannotBeABaseURL){return}a.basicURLParse(e,{url:this._url,stateOverride:"hostname"})}get port(){if(this._url.port===null){return""}return a.serializeInteger(this._url.port)}set port(e){if(a.cannotHaveAUsernamePasswordPort(this._url)){return}if(e===""){this._url.port=null}else{a.basicURLParse(e,{url:this._url,stateOverride:"port"})}}get pathname(){if(this._url.cannotBeABaseURL){return this._url.path[0]}if(this._url.path.length===0){return""}return"/"+this._url.path.join("/")}set pathname(e){if(this._url.cannotBeABaseURL){return}this._url.path=[];a.basicURLParse(e,{url:this._url,stateOverride:"path start"})}get search(){if(this._url.query===null||this._url.query===""){return""}return"?"+this._url.query}set search(e){const t=this._url;if(e===""){t.query=null;return}const r=e[0]==="?"?e.substring(1):e;t.query="";a.basicURLParse(r,{url:t,stateOverride:"query"})}get hash(){if(this._url.fragment===null||this._url.fragment===""){return""}return"#"+this._url.fragment}set hash(e){if(e===""){this._url.fragment=null;return}const t=e[0]==="#"?e.substring(1):e;this._url.fragment="";a.basicURLParse(t,{url:this._url,stateOverride:"fragment"})}toJSON(){return this.href}}},3394:(e,t,r)=>{"use strict";const a=r(4886);const i=r(3185);const n=r(7537);const s=i.implSymbol;function URL(t){if(!this||this[s]||!(this instanceof URL)){throw new TypeError("Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function.")}if(arguments.length<1){throw new TypeError("Failed to construct 'URL': 1 argument required, but only "+arguments.length+" present.")}const r=[];for(let e=0;e{"use strict";t.URL=r(3394)["interface"];t.serializeURL=r(5996).serializeURL;t.serializeURLOrigin=r(5996).serializeURLOrigin;t.basicURLParse=r(5996).basicURLParse;t.setTheUsername=r(5996).setTheUsername;t.setThePassword=r(5996).setThePassword;t.serializeHost=r(5996).serializeHost;t.serializeInteger=r(5996).serializeInteger;t.parseURL=r(5996).parseURL},5996:(e,t,r)=>{"use strict";const a=r(5477);const i=r(4256);const n={ftp:21,file:null,gopher:70,http:80,https:443,ws:80,wss:443};const s=Symbol("failure");function countSymbols(e){return a.ucs2.decode(e).length}function at(e,t){const r=e[t];return isNaN(r)?undefined:String.fromCodePoint(r)}function isASCIIDigit(e){return e>=48&&e<=57}function isASCIIAlpha(e){return e>=65&&e<=90||e>=97&&e<=122}function isASCIIAlphanumeric(e){return isASCIIAlpha(e)||isASCIIDigit(e)}function isASCIIHex(e){return isASCIIDigit(e)||e>=65&&e<=70||e>=97&&e<=102}function isSingleDot(e){return e==="."||e.toLowerCase()==="%2e"}function isDoubleDot(e){e=e.toLowerCase();return e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"}function isWindowsDriveLetterCodePoints(e,t){return isASCIIAlpha(e)&&(t===58||t===124)}function isWindowsDriveLetterString(e){return e.length===2&&isASCIIAlpha(e.codePointAt(0))&&(e[1]===":"||e[1]==="|")}function isNormalizedWindowsDriveLetterString(e){return e.length===2&&isASCIIAlpha(e.codePointAt(0))&&e[1]===":"}function containsForbiddenHostCodePoint(e){return e.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/)!==-1}function containsForbiddenHostCodePointExcludingPercent(e){return e.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/)!==-1}function isSpecialScheme(e){return n[e]!==undefined}function isSpecial(e){return isSpecialScheme(e.scheme)}function defaultPort(e){return n[e]}function percentEncode(e){let t=e.toString(16).toUpperCase();if(t.length===1){t="0"+t}return"%"+t}function utf8PercentEncode(e){const t=new Buffer(e);let r="";for(let e=0;e126}const o=new Set([32,34,35,60,62,63,96,123,125]);function isPathPercentEncode(e){return isC0ControlPercentEncode(e)||o.has(e)}const p=new Set([47,58,59,61,64,91,92,93,94,124]);function isUserinfoPercentEncode(e){return isPathPercentEncode(e)||p.has(e)}function percentEncodeChar(e,t){const r=String.fromCodePoint(e);if(t(e)){return utf8PercentEncode(r)}return r}function parseIPv4Number(e){let t=10;if(e.length>=2&&e.charAt(0)==="0"&&e.charAt(1).toLowerCase()==="x"){e=e.substring(2);t=16}else if(e.length>=2&&e.charAt(0)==="0"){e=e.substring(1);t=8}if(e===""){return 0}const r=t===10?/[^0-9]/:t===16?/[^0-9A-Fa-f]/:/[^0-7]/;if(r.test(e)){return s}return parseInt(e,t)}function parseIPv4(e){const t=e.split(".");if(t[t.length-1]===""){if(t.length>1){t.pop()}}if(t.length>4){return e}const r=[];for(const a of t){if(a===""){return e}const t=parseIPv4Number(a);if(t===s){return e}r.push(t)}for(let e=0;e255){return s}}if(r[r.length-1]>=Math.pow(256,5-r.length)){return s}let a=r.pop();let i=0;for(const e of r){a+=e*Math.pow(256,3-i);++i}return a}function serializeIPv4(e){let t="";let r=e;for(let e=1;e<=4;++e){t=String(r%256)+t;if(e!==4){t="."+t}r=Math.floor(r/256)}return t}function parseIPv6(e){const t=[0,0,0,0,0,0,0,0];let r=0;let i=null;let n=0;e=a.ucs2.decode(e);if(e[n]===58){if(e[n+1]!==58){return s}n+=2;++r;i=r}while(n6){return s}let a=0;while(e[n]!==undefined){let i=null;if(a>0){if(e[n]===46&&a<4){++n}else{return s}}if(!isASCIIDigit(e[n])){return s}while(isASCIIDigit(e[n])){const t=parseInt(at(e,n));if(i===null){i=t}else if(i===0){return s}else{i=i*10+t}if(i>255){return s}++n}t[r]=t[r]*256+i;++a;if(a===2||a===4){++r}}if(a!==4){return s}break}else if(e[n]===58){++n;if(e[n]===undefined){return s}}else if(e[n]!==undefined){return s}t[r]=a;++r}if(i!==null){let e=r-i;r=7;while(r!==0&&e>0){const a=t[i+e-1];t[i+e-1]=t[r];t[r]=a;--r;--e}}else if(i===null&&r!==8){return s}return t}function serializeIPv6(e){let t="";const r=findLongestZeroSequence(e);const a=r.idx;let i=false;for(let r=0;r<=7;++r){if(i&&e[r]===0){continue}else if(i){i=false}if(a===r){const e=r===0?"::":":";t+=e;i=true;continue}t+=e[r].toString(16);if(r!==7){t+=":"}}return t}function parseHost(e,t){if(e[0]==="["){if(e[e.length-1]!=="]"){return s}return parseIPv6(e.substring(1,e.length-1))}if(!t){return parseOpaqueHost(e)}const r=utf8PercentDecode(e);const a=i.toASCII(r,false,i.PROCESSING_OPTIONS.NONTRANSITIONAL,false);if(a===null){return s}if(containsForbiddenHostCodePoint(a)){return s}const n=parseIPv4(a);if(typeof n==="number"||n===s){return n}return a}function parseOpaqueHost(e){if(containsForbiddenHostCodePointExcludingPercent(e)){return s}let t="";const r=a.ucs2.decode(e);for(let e=0;er){t=a;r=i}a=null;i=0}else{if(a===null){a=n}++i}}if(i>r){t=a;r=i}return{idx:t,len:r}}function serializeHost(e){if(typeof e==="number"){return serializeIPv4(e)}if(e instanceof Array){return"["+serializeIPv6(e)+"]"}return e}function trimControlChars(e){return e.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g,"")}function trimTabAndNewline(e){return e.replace(/\u0009|\u000A|\u000D/g,"")}function shortenPath(e){const t=e.path;if(t.length===0){return}if(e.scheme==="file"&&t.length===1&&isNormalizedWindowsDriveLetter(t[0])){return}t.pop()}function includesCredentials(e){return e.username!==""||e.password!==""}function cannotHaveAUsernamePasswordPort(e){return e.host===null||e.host===""||e.cannotBeABaseURL||e.scheme==="file"}function isNormalizedWindowsDriveLetter(e){return/^[A-Za-z]:$/.test(e)}function URLStateMachine(e,t,r,i,n){this.pointer=0;this.input=e;this.base=t||null;this.encodingOverride=r||"utf-8";this.stateOverride=n;this.url=i;this.failure=false;this.parseError=false;if(!this.url){this.url={scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null,cannotBeABaseURL:false};const e=trimControlChars(this.input);if(e!==this.input){this.parseError=true}this.input=e}const o=trimTabAndNewline(this.input);if(o!==this.input){this.parseError=true}this.input=o;this.state=n||"scheme start";this.buffer="";this.atFlag=false;this.arrFlag=false;this.passwordTokenSeenFlag=false;this.input=a.ucs2.decode(this.input);for(;this.pointer<=this.input.length;++this.pointer){const e=this.input[this.pointer];const t=isNaN(e)?undefined:String.fromCodePoint(e);const r=this["parse "+this.state](e,t);if(!r){break}else if(r===s){this.failure=true;break}}}URLStateMachine.prototype["parse scheme start"]=function parseSchemeStart(e,t){if(isASCIIAlpha(e)){this.buffer+=t.toLowerCase();this.state="scheme"}else if(!this.stateOverride){this.state="no scheme";--this.pointer}else{this.parseError=true;return s}return true};URLStateMachine.prototype["parse scheme"]=function parseScheme(e,t){if(isASCIIAlphanumeric(e)||e===43||e===45||e===46){this.buffer+=t.toLowerCase()}else if(e===58){if(this.stateOverride){if(isSpecial(this.url)&&!isSpecialScheme(this.buffer)){return false}if(!isSpecial(this.url)&&isSpecialScheme(this.buffer)){return false}if((includesCredentials(this.url)||this.url.port!==null)&&this.buffer==="file"){return false}if(this.url.scheme==="file"&&(this.url.host===""||this.url.host===null)){return false}}this.url.scheme=this.buffer;this.buffer="";if(this.stateOverride){return false}if(this.url.scheme==="file"){if(this.input[this.pointer+1]!==47||this.input[this.pointer+2]!==47){this.parseError=true}this.state="file"}else if(isSpecial(this.url)&&this.base!==null&&this.base.scheme===this.url.scheme){this.state="special relative or authority"}else if(isSpecial(this.url)){this.state="special authority slashes"}else if(this.input[this.pointer+1]===47){this.state="path or authority";++this.pointer}else{this.url.cannotBeABaseURL=true;this.url.path.push("");this.state="cannot-be-a-base-URL path"}}else if(!this.stateOverride){this.buffer="";this.state="no scheme";this.pointer=-1}else{this.parseError=true;return s}return true};URLStateMachine.prototype["parse no scheme"]=function parseNoScheme(e){if(this.base===null||this.base.cannotBeABaseURL&&e!==35){return s}else if(this.base.cannotBeABaseURL&&e===35){this.url.scheme=this.base.scheme;this.url.path=this.base.path.slice();this.url.query=this.base.query;this.url.fragment="";this.url.cannotBeABaseURL=true;this.state="fragment"}else if(this.base.scheme==="file"){this.state="file";--this.pointer}else{this.state="relative";--this.pointer}return true};URLStateMachine.prototype["parse special relative or authority"]=function parseSpecialRelativeOrAuthority(e){if(e===47&&this.input[this.pointer+1]===47){this.state="special authority ignore slashes";++this.pointer}else{this.parseError=true;this.state="relative";--this.pointer}return true};URLStateMachine.prototype["parse path or authority"]=function parsePathOrAuthority(e){if(e===47){this.state="authority"}else{this.state="path";--this.pointer}return true};URLStateMachine.prototype["parse relative"]=function parseRelative(e){this.url.scheme=this.base.scheme;if(isNaN(e)){this.url.username=this.base.username;this.url.password=this.base.password;this.url.host=this.base.host;this.url.port=this.base.port;this.url.path=this.base.path.slice();this.url.query=this.base.query}else if(e===47){this.state="relative slash"}else if(e===63){this.url.username=this.base.username;this.url.password=this.base.password;this.url.host=this.base.host;this.url.port=this.base.port;this.url.path=this.base.path.slice();this.url.query="";this.state="query"}else if(e===35){this.url.username=this.base.username;this.url.password=this.base.password;this.url.host=this.base.host;this.url.port=this.base.port;this.url.path=this.base.path.slice();this.url.query=this.base.query;this.url.fragment="";this.state="fragment"}else if(isSpecial(this.url)&&e===92){this.parseError=true;this.state="relative slash"}else{this.url.username=this.base.username;this.url.password=this.base.password;this.url.host=this.base.host;this.url.port=this.base.port;this.url.path=this.base.path.slice(0,this.base.path.length-1);this.state="path";--this.pointer}return true};URLStateMachine.prototype["parse relative slash"]=function parseRelativeSlash(e){if(isSpecial(this.url)&&(e===47||e===92)){if(e===92){this.parseError=true}this.state="special authority ignore slashes"}else if(e===47){this.state="authority"}else{this.url.username=this.base.username;this.url.password=this.base.password;this.url.host=this.base.host;this.url.port=this.base.port;this.state="path";--this.pointer}return true};URLStateMachine.prototype["parse special authority slashes"]=function parseSpecialAuthoritySlashes(e){if(e===47&&this.input[this.pointer+1]===47){this.state="special authority ignore slashes";++this.pointer}else{this.parseError=true;this.state="special authority ignore slashes";--this.pointer}return true};URLStateMachine.prototype["parse special authority ignore slashes"]=function parseSpecialAuthorityIgnoreSlashes(e){if(e!==47&&e!==92){this.state="authority";--this.pointer}else{this.parseError=true}return true};URLStateMachine.prototype["parse authority"]=function parseAuthority(e,t){if(e===64){this.parseError=true;if(this.atFlag){this.buffer="%40"+this.buffer}this.atFlag=true;const e=countSymbols(this.buffer);for(let t=0;tMath.pow(2,16)-1){this.parseError=true;return s}this.url.port=e===defaultPort(this.url.scheme)?null:e;this.buffer=""}if(this.stateOverride){return false}this.state="path start";--this.pointer}else{this.parseError=true;return s}return true};const c=new Set([47,92,63,35]);URLStateMachine.prototype["parse file"]=function parseFile(e){this.url.scheme="file";if(e===47||e===92){if(e===92){this.parseError=true}this.state="file slash"}else if(this.base!==null&&this.base.scheme==="file"){if(isNaN(e)){this.url.host=this.base.host;this.url.path=this.base.path.slice();this.url.query=this.base.query}else if(e===63){this.url.host=this.base.host;this.url.path=this.base.path.slice();this.url.query="";this.state="query"}else if(e===35){this.url.host=this.base.host;this.url.path=this.base.path.slice();this.url.query=this.base.query;this.url.fragment="";this.state="fragment"}else{if(this.input.length-this.pointer-1===0||!isWindowsDriveLetterCodePoints(e,this.input[this.pointer+1])||this.input.length-this.pointer-1>=2&&!c.has(this.input[this.pointer+2])){this.url.host=this.base.host;this.url.path=this.base.path.slice();shortenPath(this.url)}else{this.parseError=true}this.state="path";--this.pointer}}else{this.state="path";--this.pointer}return true};URLStateMachine.prototype["parse file slash"]=function parseFileSlash(e){if(e===47||e===92){if(e===92){this.parseError=true}this.state="file host"}else{if(this.base!==null&&this.base.scheme==="file"){if(isNormalizedWindowsDriveLetterString(this.base.path[0])){this.url.path.push(this.base.path[0])}else{this.url.host=this.base.host}}this.state="path";--this.pointer}return true};URLStateMachine.prototype["parse file host"]=function parseFileHost(e,t){if(isNaN(e)||e===47||e===92||e===63||e===35){--this.pointer;if(!this.stateOverride&&isWindowsDriveLetterString(this.buffer)){this.parseError=true;this.state="path"}else if(this.buffer===""){this.url.host="";if(this.stateOverride){return false}this.state="path start"}else{let e=parseHost(this.buffer,isSpecial(this.url));if(e===s){return s}if(e==="localhost"){e=""}this.url.host=e;if(this.stateOverride){return false}this.buffer="";this.state="path start"}}else{this.buffer+=t}return true};URLStateMachine.prototype["parse path start"]=function parsePathStart(e){if(isSpecial(this.url)){if(e===92){this.parseError=true}this.state="path";if(e!==47&&e!==92){--this.pointer}}else if(!this.stateOverride&&e===63){this.url.query="";this.state="query"}else if(!this.stateOverride&&e===35){this.url.fragment="";this.state="fragment"}else if(e!==undefined){this.state="path";if(e!==47){--this.pointer}}return true};URLStateMachine.prototype["parse path"]=function parsePath(e){if(isNaN(e)||e===47||isSpecial(this.url)&&e===92||!this.stateOverride&&(e===63||e===35)){if(isSpecial(this.url)&&e===92){this.parseError=true}if(isDoubleDot(this.buffer)){shortenPath(this.url);if(e!==47&&!(isSpecial(this.url)&&e===92)){this.url.path.push("")}}else if(isSingleDot(this.buffer)&&e!==47&&!(isSpecial(this.url)&&e===92)){this.url.path.push("")}else if(!isSingleDot(this.buffer)){if(this.url.scheme==="file"&&this.url.path.length===0&&isWindowsDriveLetterString(this.buffer)){if(this.url.host!==""&&this.url.host!==null){this.parseError=true;this.url.host=""}this.buffer=this.buffer[0]+":"}this.url.path.push(this.buffer)}this.buffer="";if(this.url.scheme==="file"&&(e===undefined||e===63||e===35)){while(this.url.path.length>1&&this.url.path[0]===""){this.parseError=true;this.url.path.shift()}}if(e===63){this.url.query="";this.state="query"}if(e===35){this.url.fragment="";this.state="fragment"}}else{if(e===37&&(!isASCIIHex(this.input[this.pointer+1])||!isASCIIHex(this.input[this.pointer+2]))){this.parseError=true}this.buffer+=percentEncodeChar(e,isPathPercentEncode)}return true};URLStateMachine.prototype["parse cannot-be-a-base-URL path"]=function parseCannotBeABaseURLPath(e){if(e===63){this.url.query="";this.state="query"}else if(e===35){this.url.fragment="";this.state="fragment"}else{if(!isNaN(e)&&e!==37){this.parseError=true}if(e===37&&(!isASCIIHex(this.input[this.pointer+1])||!isASCIIHex(this.input[this.pointer+2]))){this.parseError=true}if(!isNaN(e)){this.url.path[0]=this.url.path[0]+percentEncodeChar(e,isC0ControlPercentEncode)}}return true};URLStateMachine.prototype["parse query"]=function parseQuery(e,t){if(isNaN(e)||!this.stateOverride&&e===35){if(!isSpecial(this.url)||this.url.scheme==="ws"||this.url.scheme==="wss"){this.encodingOverride="utf-8"}const t=new Buffer(this.buffer);for(let e=0;e126||t[e]===34||t[e]===35||t[e]===60||t[e]===62){this.url.query+=percentEncode(t[e])}else{this.url.query+=String.fromCodePoint(t[e])}}this.buffer="";if(e===35){this.url.fragment="";this.state="fragment"}}else{if(e===37&&(!isASCIIHex(this.input[this.pointer+1])||!isASCIIHex(this.input[this.pointer+2]))){this.parseError=true}this.buffer+=t}return true};URLStateMachine.prototype["parse fragment"]=function parseFragment(e){if(isNaN(e)){}else if(e===0){this.parseError=true}else{if(e===37&&(!isASCIIHex(this.input[this.pointer+1])||!isASCIIHex(this.input[this.pointer+2]))){this.parseError=true}this.url.fragment+=percentEncodeChar(e,isC0ControlPercentEncode)}return true};function serializeURL(e,t){let r=e.scheme+":";if(e.host!==null){r+="//";if(e.username!==""||e.password!==""){r+=e.username;if(e.password!==""){r+=":"+e.password}r+="@"}r+=serializeHost(e.host);if(e.port!==null){r+=":"+e.port}}else if(e.host===null&&e.scheme==="file"){r+="//"}if(e.cannotBeABaseURL){r+=e.path[0]}else{for(const t of e.path){r+="/"+t}}if(e.query!==null){r+="?"+e.query}if(!t&&e.fragment!==null){r+="#"+e.fragment}return r}function serializeOrigin(e){let t=e.scheme+"://";t+=serializeHost(e.host);if(e.port!==null){t+=":"+e.port}return t}e.exports.serializeURL=serializeURL;e.exports.serializeURLOrigin=function(t){switch(t.scheme){case"blob":try{return e.exports.serializeURLOrigin(e.exports.parseURL(t.path[0]))}catch(e){return"null"}case"ftp":case"gopher":case"http":case"https":case"ws":case"wss":return serializeOrigin({scheme:t.scheme,host:t.host,port:t.port});case"file":return"file://";default:return"null"}};e.exports.basicURLParse=function(e,t){if(t===undefined){t={}}const r=new URLStateMachine(e,t.baseURL,t.encodingOverride,t.url,t.stateOverride);if(r.failure){return"failure"}return r.url};e.exports.setTheUsername=function(e,t){e.username="";const r=a.ucs2.decode(t);for(let t=0;t{"use strict";e.exports.mixin=function mixin(e,t){const r=Object.getOwnPropertyNames(t);for(let a=0;a{e.exports=wrappy;function wrappy(e,t){if(e&&t)return wrappy(e)(t);if(typeof e!=="function")throw new TypeError("need wrapper function");Object.keys(e).forEach((function(t){wrapper[t]=e[t]}));return wrapper;function wrapper(){var t=new Array(arguments.length);for(var r=0;r{if(e.result===l.ExecutionResult.NOT_OK){this.logger.error(`Failed to execute ${e.command} :`);e.errorMessage.split("\n").forEach((e=>this.logger.error(e)))}}))}printNodeExecutionFailure(e){e.forEach((e=>{if(this.commandExecutionFailure(e.executeCommandResults)){this.logger.error(`Failed to execute commands for ${e.node.project}`);this.printExecutionFailure(e.executeCommandResults)}}))}archiveArtifactsFailure(e){return!!e.find((e=>e.status==="rejected"))}nodeExecutionFailure(e){return e.reduce(((e,t)=>e||this.commandExecutionFailure(t.executeCommandResults)),false)}commandExecutionFailure(e){return!!e.find((e=>e.result===l.ExecutionResult.NOT_OK))}}t.Runner=Runner},6759:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.constants=void 0;t.constants={CONTAINER:{ENTRY_POINT:"entry-point"},GITHUB:{TOKEN:"token"}}},6848:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.EntryPoint=void 0;var r;(function(e){e[e["CLI"]=0]="CLI";e[e["GITHUB_EVENT"]=1]="GITHUB_EVENT"})(r=t.EntryPoint||(t.EntryPoint={}))},293:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.InvalidInput=t.NotFoundError=void 0;class NotFoundError extends Error{}t.NotFoundError=NotFoundError;class InvalidInput extends Error{}t.InvalidInput=InvalidInput},4396:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ExecutionResult=void 0;var r;(function(e){e["OK"]="OK";e["NOT_OK"]="NOT OK";e["SKIP"]="SKIP"})(r=t.ExecutionResult||(t.ExecutionResult={}))},6696:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ExecutionPhase=void 0;var r;(function(e){e["BEFORE"]="before";e["CURRENT"]="commands";e["AFTER"]="after"})(r=t.ExecutionPhase||(t.ExecutionPhase={}))},3947:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.defaultFlowResult=void 0;t.defaultFlowResult={checkoutInfo:[],artifactUploadResults:[],executionResult:{before:[],after:[],commands:[]}}},8373:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.defaultInputValues=t.LoggerLevel=t.FlowType=void 0;var r;(function(e){e["CROSS_PULL_REQUEST"]="cross_pr";e["FULL_DOWNSTREAM"]="full_downstream";e["SINGLE_PULL_REQUEST"]="single_pr";e["BRANCH"]="branch"})(r=t.FlowType||(t.FlowType={}));var a;(function(e){e[e["INFO"]=0]="INFO";e[e["TRACE"]=1]="TRACE";e[e["DEBUG"]=2]="DEBUG"})(a=t.LoggerLevel||(t.LoggerLevel={}));t.defaultInputValues={definitionFile:"",skipExecution:false,skipCheckout:false,skipParallelCheckout:false,loggerLevel:a.INFO}},6196:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.NodeExecutionLevel=void 0;var r;(function(e){e["UPSTREAM"]="upstream";e["CURRENT"]="current";e["DOWNSTREAM"]="downstream"})(r=t.NodeExecutionLevel||(t.NodeExecutionLevel={}))},5129:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,i)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__decorate||function(e,t,r,a){var i=arguments.length,n=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])n=(i<3?s(n):i>3?s(t,r,n):s(t,r))||n;return i>3&&n&&Object.defineProperty(t,r,n),n};var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))a(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.ActionArguments=void 0;const o=r(8373);const p=s(r(2186));const c=s(r(3802));const l=r(8081);const d=r(293);let u=class ActionArguments{getFlowType(e){switch(e){case"pull-request":return o.FlowType.CROSS_PULL_REQUEST;case"fdb":return o.FlowType.FULL_DOWNSTREAM;case"single":return o.FlowType.SINGLE_PULL_REQUEST;case"branch":return o.FlowType.BRANCH;default:throw new d.InvalidInput("Invalid flow-type")}}getLoggerLevel(e){switch(e){case"info":case"":return o.LoggerLevel.INFO;case"debug":return o.LoggerLevel.DEBUG;case"trace":return o.LoggerLevel.TRACE;default:throw new d.InvalidInput("Invalid logger-level")}}getAdditionalFlags(e){if(e===""){return{}}const t={};e.trim().split(";").forEach((e=>{const r=e.trim().split(" ");if(r[0].startsWith("--")){r[0]=r[0].substring(2)}else if(r[0].startsWith("-")){r[0]=r[0].substring(1)}if(r.length===1){t[r[0]]=true}else{t[r[0]]=r.slice(1).join(" ")}}));return t}parse(){const e={definitionFile:p.getInput("definition-file"),flowType:this.getFlowType(p.getInput("flow-type")),skipExecution:p.getBooleanInput("skip-execution"),skipParallelCheckout:p.getBooleanInput("skip-parallel-checkout"),skipProjectCheckout:p.getInput("skip-project-checkout").split(",").map((e=>e.trim())),skipProjectExecution:p.getInput("skip-project-execution").split(",").map((e=>e.trim())),skipCheckout:p.getBooleanInput("skip-checkout"),startProject:p.getInput("starting-project"),loggerLevel:this.getLoggerLevel(p.getInput("logger-level")),annotationsPrefix:p.getInput("annotations-prefix"),customCommandTreatment:p.getInput("custom-command-treatment")===""?[]:p.getInput("custom-command-treatment").split(","),...this.getAdditionalFlags(p.getInput("additional-flags"))};c.default.get(l.InputService).updateInputs(e)}};u=n([(0,c.Service)()],u);t.ActionArguments=u},7774:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,i)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__decorate||function(e,t,r,a){var i=arguments.length,n=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])n=(i<3?s(n):i>3?s(t,r,n):s(t,r))||n;return i>3&&n&&Object.defineProperty(t,r,n),n};var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))a(t,e,r);i(t,e);return t};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});t.ArtifactService=void 0;const p=s(r(3802));const c=r(8114);const l=r(8501);const d=r(9837);let u=class ArtifactService{constructor(){this.uploadService=p.default.get(l.UploadService);this.logger=p.default.get(d.LoggerService).logger}getNodesToArchive(e,t){const r=t.archiveArtifacts?.dependencies??c.ArchiveDependencies.NONE;let a;switch(r){case c.ArchiveDependencies.NONE:a=t.archiveArtifacts?[t]:[];break;case c.ArchiveDependencies.ALL:a=e.filter((e=>!!e.archiveArtifacts));break;default:a=e.filter((e=>e.archiveArtifacts&&(r.includes(e.project)||e.project===t.project)))}return a}async uploadNodes(e,t){const r=this.getNodesToArchive(e,t);this.logger.info(r.length>0?`Archiving artifacts for ${r.map((e=>e.project))}`:"No artifacts to archive");const a=r.map((async e=>{this.logger.info(`Project [${e.project}]. Uploading artifacts...`);return this.uploadService.upload(e.archiveArtifacts,e.project)}));const i=await Promise.allSettled(a);i.forEach((e=>{if(e.status==="fulfilled"){if(e.value.artifactItems.length>0){this.logger.info(`Artifact ${e.value.artifactName} uploaded ${e.value.artifactItems.length} files: ${e.value.artifactItems}`)}if(e.value.failedItems.length>0){this.logger.info(`Artifact ${e.value.artifactName} failed to upload ${e.value.failedItems.length} files: ${e.value.failedItems}`)}}else{this.logger.info(`Failure in uploading artifacts for one or more nodes: ${e.reason}`)}}));return i}};u=n([(0,p.Service)(),o("design:paramtypes",[])],u);t.ArtifactService=u},8501:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,i)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__decorate||function(e,t,r,a){var i=arguments.length,n=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])n=(i<3?s(n):i>3?s(t,r,n):s(t,r))||n;return i>3&&n&&Object.defineProperty(t,r,n),n};var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))a(t,e,r);i(t,e);return t};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};var p=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.UploadService=void 0;const c=r(8090);const l=p(r(1017));const d=s(r(3802));const u=r(7147);const m=r(3837);const h=r(9837);const g=r(8114);const v=s(r(2605));const y=r(8410);const b=(0,m.promisify)(u.stat);let w=class UploadService{constructor(){this.logger=d.default.get(h.LoggerService).logger}validateArtifactName(e){return e.replace(/[/\s":<>*?\\]/g,"_")}getMultiPathLCA(e){if(e.length<2){throw new Error("At least two search paths must be provided")}const t=[];const r=[];let a=Number.MAX_SAFE_INTEGER;for(const t of e){const e=l.default.normalize(t).split(l.default.sep);a=Math.min(a,e.length);r.push(e)}if(e[0].startsWith(l.default.sep)){t.push(l.default.sep)}for(let e=0;e1){this.logger.info("Multiple search paths detected. Calculating the least common ancestor of all paths");const t=this.getMultiPathLCA(e);this.logger.info(`The least common ancestor is ${t}. This will be the root directory of the artifact`);return t}if(t.length===1&&e[0]===t[0]){return l.default.dirname(t[0])}return e[0]}async findFilesToUpload(e,t={followSymbolicLinks:true,implicitDescendants:true,omitBrokenSymbolicLinks:true}){const r=[];const a=await(0,c.create)(e,t);const i=await a.glob();const n=new Set;for(const e of i){const t=await b(e);if(!t.isDirectory()){r.push(e);if(n.has(e.toLowerCase())){this.logger.info(`Uploads are case insensitive: ${e} was detected that it will be overwritten by another file with the same path`)}else{n.add(e.toLowerCase())}}}const s=this.getRootDir(a.getSearchPaths(),r);return{filesToUpload:r,rootDirectory:s}}noFileFound(e,t){switch(e["if-no-files-found"]){case g.IfNoFile.ERROR:throw(0,y.logAndThrow)(`No files were found with the provided path: ${t}. No artifacts will be uploaded.`);case g.IfNoFile.IGNORE:this.logger.info(`No files were found with the provided path: ${t}. No artifacts will be uploaded.`);break;case g.IfNoFile.WARN:default:this.logger.warn(`No files were found with the provided path: ${t}. No artifacts will be uploaded.`)}}async upload(e,t){const r=e.paths.filter((e=>e.path)).reduce(((e,t)=>e.concat(t.path,"\n")),"");const{filesToUpload:a,rootDirectory:i}=await this.findFilesToUpload(r);const n=this.validateArtifactName(e.name??t);if(a.length===0){this.noFileFound(e,r);return{artifactName:n,artifactItems:[],failedItems:[],size:0}}else{this.logger.debug(`With the provided path (${r}), there will be ${a.length} file(s) uploaded`);this.logger.debug(`Root artifact directory is ${i}`);return v.create().uploadArtifact(n,a,i,{continueOnError:false})}}};w=n([(0,d.Service)(),o("design:paramtypes",[])],w);t.UploadService=w},5173:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,i)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__decorate||function(e,t,r,a){var i=arguments.length,n=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])n=(i<3?s(n):i>3?s(t,r,n):s(t,r))||n;return i>3&&n&&Object.defineProperty(t,r,n),n};var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))a(t,e,r);i(t,e);return t};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};var p=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.CheckoutService=void 0;const c=r(6229);const l=r(9837);const d=r(8114);const u=s(r(3802));const m=r(5630);const h=p(r(1017));const g=r(8031);const v=r(7616);const y=r(8410);const b=r(293);let w=class CheckoutService{constructor(){this.config=u.default.get(c.ConfigurationService);this.logger=u.default.get(l.LoggerService).logger}getProjectDir(e){return h.default.join(this.config.getRootFolder(),e.project.replace(/[/\s]/g,"_"))}async cloneNode(e){const t=[];e.clone?.forEach((r=>{t.push((0,m.copy)(this.getProjectDir(e),h.default.join(this.config.getRootFolder(),r)))}));await Promise.all(t)}async checkoutNode(e){if(this.config.skipCheckout(e)){this.logger.debug(`[${e.project}] Checkout skipped`);return undefined}const t=await this.getCheckoutInfo(e);this.logger.debug(`[${e.project}] CheckoutInfo - ${JSON.stringify(t)}`);const r=u.default.get(v.GitCLIService);const a=this.config.getCloneUrl(t.targetGroup,t.targetName);await r.clone(a,t.repoDir,t.targetBranch).catch((r=>{this.logger.debug(JSON.stringify(r));(0,y.logAndThrow)(`[${e.project}] Error cloning ${t.targetGroup}/${t.targetName} and switching to target branch ${t.targetBranch}`)}));if(t.merge){this.logger.debug(`[${e.project}] Merging ${t.sourceGroup}/${t.sourceName}:${t.sourceBranch}\n into ${t.targetGroup}/${t.targetName}:${t.targetBranch}`);const a=this.config.getCloneUrl(t.sourceGroup,t.sourceName);await r.merge(t.repoDir,a,t.sourceBranch).catch((r=>{this.logger.debug(JSON.stringify(r));(0,y.logAndThrow)(`[${e.project}] Error merging ${t.sourceGroup}/${t.sourceName}:${t.sourceBranch}\n into ${t.targetGroup}/${t.targetName}:${t.targetBranch}`)}))}await this.cloneNode(e);this.logger.debug(`[${e.project}] Checked out`);return t}async getCheckoutInfo(e){const t=u.default.get(g.GithubAPIService);const r=this.config.getStarterNode();const a=this.config.getTargetProject();const i={mappedBranch:(0,d.getMappedTarget)(r.project,r.mapping,e.project,e.mapping,a.branch),name:e.project.split("/")[1],group:e.project.split("/")[0]};const n=this.config.getSourceProject();const s=await t.getForkName(i.group,n.group,i.name).then((async e=>{const r=await t.hasPullRequest(i.group,i.name,`${n.group}/${e}:${n.branch}`,i.mappedBranch);return{forkName:e,hasPullRequest:r}})).catch((e=>{if(e instanceof b.NotFoundError){return{forkName:"",hasPullRequest:false}}throw e}));if(s.hasPullRequest){return{sourceBranch:n.branch,sourceGroup:n.group,sourceName:s.forkName,targetBranch:i.mappedBranch,targetGroup:i.group,targetName:i.name,repoDir:this.getProjectDir(e),merge:true}}const o=await t.hasPullRequest(i.group,i.name,`${i.group}:${n.branch}`,i.mappedBranch);if(o){return{sourceBranch:n.branch,sourceGroup:i.group,sourceName:i.name,targetBranch:i.mappedBranch,targetGroup:i.group,targetName:i.name,repoDir:this.getProjectDir(e),merge:true}}return{sourceBranch:i.mappedBranch,sourceGroup:i.group,sourceName:i.name,targetBranch:i.mappedBranch,targetGroup:i.group,targetName:i.name,repoDir:this.getProjectDir(e),merge:false}}async checkoutDefinitionTreeSequential(){const e=[];for(const t of this.config.nodeChain){const r=await this.checkoutNode(t);e.push({node:t,checkoutInfo:r})}return e}async checkoutDefinitionTreeParallel(){return Promise.all(this.config.nodeChain.map((async e=>this.checkoutNode(e).then((t=>({node:e,checkoutInfo:t}))))))}async checkoutDefinitionTree(){return this.config.skipParallelCheckout()?this.checkoutDefinitionTreeSequential():this.checkoutDefinitionTreeParallel()}};w=n([(0,u.Service)(),o("design:paramtypes",[])],w);t.CheckoutService=w},4303:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,i)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__decorate||function(e,t,r,a){var i=arguments.length,n=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])n=(i<3?s(n):i>3?s(t,r,n):s(t,r))||n;return i>3&&n&&Object.defineProperty(t,r,n),n};var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))a(t,e,r);i(t,e);return t};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});t.ExecuteCommandService=void 0;const p=s(r(3802));const c=r(4396);const l=r(5676);const d=r(9425);const u=r(9837);const m=r(6229);const h=r(6196);let g=class ExecuteCommandService{constructor(e,t,r){this._commandTreatmentDelegator=e;this._commandExecutorDelegator=t;this._configurationService=r}async executeCommand(e,t){const r=this._commandTreatmentDelegator.treatCommand(e,this._configurationService.getTreatmentOptions());return this._commandExecutorDelegator.executeCommand(r,t)}async executeChainCommands(e,t){const r=[];for(const{node:a,cwd:i}of e){const e=this.getNodeCommands(a,t,this._configurationService.getNodeExecutionLevel(a));r.push(await this.executeNodeCommands(a,e??[],this._configurationService.skipExecution(a),i))}return r}getNodeCommands(e,t,r){const a=e[`${t}`];let i;if(a){i=a[`${r}`].length?a[`${r}`]:a[`${h.NodeExecutionLevel.CURRENT}`]}if(!a){p.default.get(u.LoggerService).logger.debug(`No commands defined for project ${e.project} and phase ${t}`)}else if(!i||!i.length){const a=r!==h.NodeExecutionLevel.CURRENT?`${r} or ${h.NodeExecutionLevel.CURRENT}`:h.NodeExecutionLevel.CURRENT;p.default.get(u.LoggerService).logger.debug(`No commands defined for project ${e.project} phase ${t} and level ${a}`)}return i}async executeNodeCommands(e,t,r,a){const i={node:e,executeCommandResults:[]};for(const e of t){i.executeCommandResults.push(r?{startingDate:Date.now(),endingDate:Date.now(),command:e,result:c.ExecutionResult.SKIP,errorMessage:"",time:0}:await this.executeCommand(e,a))}return i}};g=n([(0,p.Service)(),o("design:paramtypes",[l.CommandTreatmentDelegator,d.CommandExecutorDelegator,m.ConfigurationService])],g);t.ExecuteCommandService=g},652:function(e,t,r){"use strict";var a=this&&this.__decorate||function(e,t,r,a){var i=arguments.length,n=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])n=(i<3?s(n):i>3?s(t,r,n):s(t,r))||n;return i>3&&n&&Object.defineProperty(t,r,n),n};Object.defineProperty(t,"__esModule",{value:true});t.BashExecutor=void 0;const i=r(1514);const n=r(3802);let s=class BashExecutor{async execute(e,t){await(0,i.exec)(e,[],{cwd:t})}};s=a([(0,n.Service)()],s);t.BashExecutor=s},9425:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,i)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__decorate||function(e,t,r,a){var i=arguments.length,n=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])n=(i<3?s(n):i>3?s(t,r,n):s(t,r))||n;return i>3&&n&&Object.defineProperty(t,r,n),n};var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))a(t,e,r);i(t,e);return t};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});t.CommandExecutorDelegator=void 0;const p=s(r(3802));const c=r(652);const l=r(7019);const d=r(4396);const u=r(9837);const m=r(3678);let h=class CommandExecutorDelegator{constructor(e,t){this._bashExecutor=e;this._exportExecutor=t}async executeCommand(e,t){const r=process.hrtime();const a=Date.now();let i;let n="";try{this.isExport(e)?await this._exportExecutor.execute(e,t):await this._bashExecutor.execute(e,t);i=d.ExecutionResult.OK}catch(t){n=t instanceof Error?t.message:"unknown";p.default.get(u.LoggerService).logger.error(`Error executing command ${e}. ${n}`);i=d.ExecutionResult.NOT_OK}return{startingDate:a,command:e,result:i,errorMessage:n,endingDate:Date.now(),time:(0,m.hrtimeToMs)(r)}}isExport(e){return e.trim().match(/^export .*=/)!==null}};h=n([(0,p.Service)(),o("design:paramtypes",[c.BashExecutor,l.ExportExecutor])],h);t.CommandExecutorDelegator=h},7019:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,i)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__decorate||function(e,t,r,a){var i=arguments.length,n=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])n=(i<3?s(n):i>3?s(t,r,n):s(t,r))||n;return i>3&&n&&Object.defineProperty(t,r,n),n};var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))a(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.ExportExecutor=void 0;const o=r(1514);const p=s(r(3802));const c=r(9837);let l=class ExportExecutor{async execute(e,t){const r=new ExpressionCommand(e);process.env[r.variable]=await this.executeExpression(r.expression,t);p.default.get(c.LoggerService).logger.debug(`The variable \`${r.variable}\` has been set to the env with the value \`${process.env[r.variable]}\``)}async executeExpression(e,t){const r=e.match(/`(.*)`/);const a=r?r[1]:undefined;if(a){let e="";const r={listeners:{stdout:t=>{e+=t.toString()}},cwd:t};await(0,o.exec)(a,[],r);return e}return e.replace(/['"]+/g,"")}};l=n([(0,p.Service)()],l);t.ExportExecutor=l;class ExpressionCommand{constructor(e){const t=this.getCommandArray(e);this._variable=t[1];this._expression=t[2]}getCommandArray(e){const t=e.match(/^export (\w+)=(.*)/);if(!t||t.length!==3){const t=`The export command ${e} is not properly defined. It should be something like "export VARIBLE=expression". Please fix it an try again.`;p.default.get(c.LoggerService).logger.error(t);throw new Error(t)}return t}get variable(){return this._variable}get expression(){return this._expression}}},4191:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.CommandBuilder=void 0;class CommandBuilder{constructor(e,t){this.treatedCommand=e;this.options=t}treat(e){this.treatedCommand=e.treat(this.treatedCommand,this.options);return this}build(){return this.treatedCommand}}t.CommandBuilder=CommandBuilder},5676:function(e,t,r){"use strict";var a=this&&this.__decorate||function(e,t,r,a){var i=arguments.length,n=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])n=(i<3?s(n):i>3?s(t,r,n):s(t,r))||n;return i>3&&n&&Object.defineProperty(t,r,n),n};var i=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});t.CommandTreatmentDelegator=void 0;const n=r(3802);const s=r(4191);const o=r(3735);const p=r(6741);const c=r(6495);let l=class CommandTreatmentDelegator{constructor(e,t,r){this._environmentCommandTreatment=e;this._mavenCommandTreatment=t;this._regexCommandTreatment=r}treatCommand(e,t){return new s.CommandBuilder(e,t).treat(this._environmentCommandTreatment).treat(this._mavenCommandTreatment).treat(this._regexCommandTreatment).build()}};l=a([(0,n.Service)(),i("design:paramtypes",[o.EnvironmentCommandTreatment,p.MavenCommandTreatment,c.RegexCommandTreatment])],l);t.CommandTreatmentDelegator=l},3735:function(e,t,r){"use strict";var a=this&&this.__decorate||function(e,t,r,a){var i=arguments.length,n=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])n=(i<3?s(n):i>3?s(t,r,n):s(t,r))||n;return i>3&&n&&Object.defineProperty(t,r,n),n};Object.defineProperty(t,"__esModule",{value:true});t.EnvironmentCommandTreatment=void 0;const i=r(3802);let n=class EnvironmentCommandTreatment{treat(e,t){const r=this.getVariablesFromCommand(e);return r?.length>0?r.reduce(((e,t)=>e.replace(t[0],process.env[t[1]]??"")),e):e}getVariablesFromCommand(e){return[...e.matchAll(/\${{ env\.(\w+) }}/g)]}};n=a([(0,i.Service)()],n);t.EnvironmentCommandTreatment=n},6741:function(e,t,r){"use strict";var a=this&&this.__decorate||function(e,t,r,a){var i=arguments.length,n=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])n=(i<3?s(n):i>3?s(t,r,n):s(t,r))||n;return i>3&&n&&Object.defineProperty(t,r,n),n};Object.defineProperty(t,"__esModule",{value:true});t.MavenCommandTreatment=void 0;const i=r(3802);let n=class MavenCommandTreatment{treat(e,t){return!this.isMavenCommand(e,t?.mavenBinary)?e:`${e} -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B`}isMavenCommand(e,t="mvn"){return new RegExp(`.*${t} .*`).test(e)}};n=a([(0,i.Service)()],n);t.MavenCommandTreatment=n},6495:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,i)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__decorate||function(e,t,r,a){var i=arguments.length,n=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])n=(i<3?s(n):i>3?s(t,r,n):s(t,r))||n;return i>3&&n&&Object.defineProperty(t,r,n),n};var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))a(t,e,r);i(t,e);return t};var o;Object.defineProperty(t,"__esModule",{value:true});t.RegexCommandTreatment=void 0;const p=s(r(3802));const c=r(9837);let l=o=class RegexCommandTreatment{treat(e,t){if(t?.replaceExpressions){p.default.get(c.LoggerService).logger.debug(`[${o.name}] Replacing command: \`${e}\` by expressions: '${t.replaceExpressions}'`);const r=t.replaceExpressions.reduce(((e,t)=>this.treatReplaceEx(e,t)),e);p.default.get(c.LoggerService).logger.debug(r===e?`[${o.name}] No replacement for \`${e}\``:`[${o.name}] Replaced to: \`${r}\``);return r}else{return e}}treatReplaceEx(e,t){const r=this.getReplacementExpression(t);return e.replace(r.regEx,r.replace)}getReplacementExpression(e){const t=e.split("||");return new ReplacementExpression(this.createRegex(t[0]),t[1])}createRegex(e){const[,t,r]=e.split("/");if(t){return r?new RegExp(t,r):new RegExp(t)}return new RegExp(e)}};l=o=n([(0,p.Service)()],l);t.RegexCommandTreatment=l;class ReplacementExpression{constructor(e,t){this._regEx=e;this._replace=t}get regEx(){return this._regEx}get replace(){return this._replace}}},1055:function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.ActionConfiguration=void 0;const i=r(6759);const n=r(332);const s=r(8410);const o=a(r(3802));const p=r(3977);const c=r(8373);class ActionConfiguration extends n.BaseConfiguration{loadProject(){if(this.parsedInputs.flowType===c.FlowType.BRANCH){const e=this.parsedInputs.startProject??this.gitConfiguration.repository;const t=e.split("/");const r={branch:this.parsedInputs.branch??this.gitConfiguration.ref,repository:e,name:t[t.length-1],group:this.parsedInputs.group??t[0]};return{source:r,target:r}}else{return super.loadProject()}}loadGitConfiguration(){const e=process.env.GITHUB_SERVER_URL?process.env.GITHUB_SERVER_URL.replace(/\/$/,""):"https://github.com";return{action:process.env.GITHUB_ACTION,actor:process.env.GITHUB_ACTOR,author:process.env.GITHUB_AUTHOR,serverUrl:e,serverUrlWithToken:e.replace("://",`://${o.default.get(i.constants.GITHUB.TOKEN)}@`),jobId:process.env.GITHUB_JOB,ref:process.env.GITHUB_REF,workflow:process.env.GITHUB_WORKFLOW,repository:process.env.GITHUB_REPOSITORY}}async loadGitEvent(){if(this.parsedInputs.flowType===c.FlowType.BRANCH){return{}}if(process.env.GITHUB_EVENT_PATH){this.logger.debug("Getting pull request information");const e=await(0,p.readFile)(process.env.GITHUB_EVENT_PATH,{encoding:"utf8"});return JSON.parse(e).pull_request}(0,s.logAndThrow)("Make sure you are running it in a github environment")}loadToken(){if(process.env.GITHUB_TOKEN){o.default.set(i.constants.GITHUB.TOKEN,process.env.GITHUB_TOKEN)}else{(0,s.logAndThrow)("A github token is needed")}}getFlowType(){return this.parsedInputs.flowType}}t.ActionConfiguration=ActionConfiguration},332:function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.BaseConfiguration=void 0;const i=r(8373);const n=r(8081);const s=r(9837);const o=r(8410);const p=a(r(3802));class BaseConfiguration{constructor(){this.logger=p.default.get(s.LoggerService).logger;this._parsedInputs=i.defaultInputValues;this._gitEventData={};this._gitConfiguration={};this._sourceProject={};this._targetProject={}}async init(){this._parsedInputs=this.loadParsedInput();this.loadToken();this._gitEventData=await this.loadGitEvent();this._gitConfiguration=this.loadGitConfiguration();const{source:e,target:t}=this.loadProject();this._sourceProject=e;this._targetProject=t}get gitEventData(){return this._gitEventData}get gitConfiguration(){return this._gitConfiguration}get sourceProject(){return this._sourceProject}get targetProject(){return this._targetProject}get parsedInputs(){return this._parsedInputs}loadProject(){return{source:{branch:this.gitEventData.head.ref,repository:this.gitEventData.head.repo?.full_name,name:this.gitEventData.head.repo?.name,group:this.gitEventData.head.repo?.owner.login},target:{branch:this.gitEventData.base.ref,repository:this.gitEventData.base.repo.full_name,name:this.gitEventData.base.repo.name,group:this.gitEventData.base.repo.owner.login}}}loadParsedInput(){const e=p.default.get(n.InputService).inputs;e.customCommandTreatment?.forEach((e=>{if(e.split("||").length!==2){(0,o.logAndThrow)("Invalid format for custom command treatment. Required format: Regex||ReplaceRegex")}}));if(e.startProject&&e.startProject.split("/").length!==2){(0,o.logAndThrow)("Invalid start project. Start project must be of the form OWNER/PROJECT")}this.logger.debug(`Received input: ${JSON.stringify(e)}`);return e}}t.BaseConfiguration=BaseConfiguration},2336:function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.CLIConfiguration=void 0;const i=r(6759);const n=r(8373);const s=r(332);const o=r(2322);const p=r(8410);const c=a(r(3802));class CLIConfiguration extends s.BaseConfiguration{loadProject(){if(this.parsedInputs.CLISubCommand===n.FlowType.BRANCH){const e=this.parsedInputs.startProject.split("/");const t={branch:this.parsedInputs.branch,name:e[e.length-1],group:this.parsedInputs.group??e[0],repository:this.parsedInputs.startProject};return{source:t,target:t}}else{return super.loadProject()}}loadGitConfiguration(){const e=process.env.GITHUB_SERVER_URL?process.env.GITHUB_SERVER_URL.replace(/\/$/,""):"https://github.com";let t={serverUrl:e,serverUrlWithToken:e.replace("://",`://${c.default.get(i.constants.GITHUB.TOKEN)}@`)};if(this.parsedInputs.CLISubCommand===n.FlowType.BRANCH){const e=this.parsedInputs.group??this.parsedInputs.startProject?.split("/")[0];if(!e){(0,p.logAndThrow)("Specify group option or set project name as GROUP_NAME/REPO_NAME")}t={...t,actor:e,ref:this.parsedInputs.branch}}return t}async loadGitEvent(){if(this.parsedInputs.CLISubCommand===n.FlowType.BRANCH){return{}}if(!this.parsedInputs.url){(0,p.logAndThrow)("If running from the CLI, event url needs to be defined")}const e=/^https?:\/\/.+\/([^/\s]+)\/([^/\s]+)\/pull\/(\d+)$/;const t=this.parsedInputs.url.match(e);if(t){this.logger.debug("Getting pull request information");try{const{data:e}=await c.default.get(o.OctokitService).octokit.pulls.get({owner:t[1],repo:t[2],pull_number:parseInt(t[3])});return e}catch(e){(0,p.logAndThrow)(`Invalid event url ${this.parsedInputs.url}`)}}(0,p.logAndThrow)(`Invalid event url ${this.parsedInputs.url}. URL must be a github pull request event url or a github tree url`)}loadToken(){if(this.parsedInputs.token){c.default.set(i.constants.GITHUB.TOKEN,this.parsedInputs.token)}else if(process.env.GITHUB_TOKEN){c.default.set(i.constants.GITHUB.TOKEN,process.env.GITHUB_TOKEN)}else{(0,p.logAndThrow)("A github token is needed")}}getFlowType(){const e=this.parsedInputs.CLISubCommand;if(Object.values(n.FlowType).includes(e)){return e}(0,p.logAndThrow)("The CLI subcommand is a tool commaand. No flow defined")}}t.CLIConfiguration=CLIConfiguration},6229:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,i)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__decorate||function(e,t,r,a){var i=arguments.length,n=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])n=(i<3?s(n):i>3?s(t,r,n):s(t,r))||n;return i>3&&n&&Object.defineProperty(t,r,n),n};var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))a(t,e,r);i(t,e);return t};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});t.ConfigurationService=void 0;const p=s(r(3802));const c=r(6196);const l=r(6759);const d=r(6848);const u=r(2336);const m=r(1055);const h=r(8410);const g=r(8373);const v=r(6012);let y=class ConfigurationService{constructor(){switch(p.default.get(l.constants.CONTAINER.ENTRY_POINT)){case d.EntryPoint.CLI:this.configuration=new u.CLIConfiguration;break;case d.EntryPoint.GITHUB_EVENT:this.configuration=new m.ActionConfiguration;break;default:(0,h.logAndThrow)("Invalid entrypoint. Please contact with the administrator or report and issue to build-chain tool repository")}this._nodeChain=[];this._definitionFile={version:"2.1"}}get nodeChain(){return this._nodeChain}get definitionFile(){return this._definitionFile}async init(){await this.configuration.init();const e=new v.DefinitionFileReader(this.configuration);this._definitionFile=await e.getDefinitionFile();this._nodeChain=await e.generateNodeChain(this.getStarterProjectName())}getStarterProjectName(){const e=this.configuration.parsedInputs.startProject??process.env.GITHUB_REPOSITORY;if(!e){(0,h.logAndThrow)("Start project needs to be defined or build chain must be run in a Github environment")}return e}isNodeStarter(e){return e.project===this.getStarterProjectName()}getStarterNode(){const e=this.nodeChain.find((e=>this.isNodeStarter(e)));if(!e){(0,h.logAndThrow)(`There's no project ${this.getStarterProjectName()} in the chain\n This is normally due the project starting the job (or the one selected to behave like so it's not in the project tree information.\n Please choose a different project like starter or define the project ${this.getStarterProjectName()} in the tree.`)}return e}getNodeExecutionLevel(e){const t=this.nodeChain.indexOf(this.getStarterNode());const r=this.nodeChain.indexOf(e);if(rt){return c.NodeExecutionLevel.DOWNSTREAM}else{return c.NodeExecutionLevel.CURRENT}}skipExecution(e){if(this.configuration.parsedInputs.skipExecution){return true}return this.configuration.parsedInputs.skipProjectExecution?this.configuration.parsedInputs.skipProjectExecution.includes(e.project):false}skipCheckout(e){if(this.configuration.parsedInputs.skipCheckout){return true}return this.configuration.parsedInputs.skipProjectCheckout?this.configuration.parsedInputs.skipProjectCheckout.includes(e.project):false}skipParallelCheckout(){return this.configuration.parsedInputs.skipParallelCheckout}getTreatmentOptions(){if(this.configuration.parsedInputs.customCommandTreatment){return{replaceExpressions:this.configuration.parsedInputs.customCommandTreatment}}return{}}getTargetProject(){return this.configuration.targetProject}getSourceProject(){return this.configuration.sourceProject}getRootFolder(){return this.configuration.parsedInputs.outputFolder??process.env.GITHUB_WORKSPACE??process.cwd()}getFlowType(){return this.configuration.getFlowType()}getCloneUrl(e,t){if(process.env.ACT){return`${process.env.ACT_REPO}${e}/${t}`}return`${this.configuration.gitConfiguration.serverUrlWithToken}/${e}/${t}`}getPre(){return this.definitionFile.pre}getPost(){return this.definitionFile.post}getDefinitionFileUrl(){return this.configuration.parsedInputs.definitionFile}getEventUrl(){return this.getFlowType()===g.FlowType.BRANCH?"":this.configuration.gitEventData.html_url}};y=n([(0,p.Service)(),o("design:paramtypes",[])],y);t.ConfigurationService=y},6012:function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.DefinitionFileReader=void 0;const i=r(6759);const n=r(8373);const s=r(9837);const o=r(8410);const p=r(8114);const c=a(r(3802));class DefinitionFileReader{constructor(e){this.configuration=e;this.logger=c.default.get(s.LoggerService).logger}async generateNodeChainWithOptions(e,t){let r;switch(this.configuration.getFlowType()){case n.FlowType.BRANCH:{if(this.configuration.parsedInputs.fullProjectDependencyTree){r=await(0,p.getOrderedListForProject)(this.configuration.parsedInputs.definitionFile,e,t)}else{const a=await(0,p.getTreeForProject)(this.configuration.parsedInputs.definitionFile,e,t);if(!a){throw new Error("Starting project not found")}r=(0,p.parentChainFromNode)(a)}break}case n.FlowType.CROSS_PULL_REQUEST:{const t=await(0,p.getTreeForProject)(this.configuration.parsedInputs.definitionFile,e);if(!t){throw new Error("Starting project not found")}r=(0,p.parentChainFromNode)(t);break}case n.FlowType.FULL_DOWNSTREAM:{r=await(0,p.getOrderedListForProject)(this.configuration.parsedInputs.definitionFile,e,t);break}case n.FlowType.SINGLE_PULL_REQUEST:{const a=await(0,p.getTreeForProject)(this.configuration.parsedInputs.definitionFile,e,t);if(!a){throw new Error("Starting project not found")}r=[a]}}return r}async getDefinitionFile(){try{return(0,p.readDefinitionFile)(this.configuration.parsedInputs.definitionFile,{...this.configuration.sourceProject,token:c.default.get(i.constants.GITHUB.TOKEN)})}catch(e){this.logger.debug("Did not find correct definition on file, trying target")}try{return(0,p.readDefinitionFile)(this.configuration.parsedInputs.definitionFile,{...this.configuration.targetProject,token:c.default.get(i.constants.GITHUB.TOKEN)})}catch(e){(0,o.logAndThrow)("Invalid definition file")}}async generateNodeChain(e){try{return await this.generateNodeChainWithOptions(e,{...this.configuration.sourceProject,token:c.default.get(i.constants.GITHUB.TOKEN)})}catch(e){this.logger.debug("Did not find correct definition on file, trying target")}try{return await this.generateNodeChainWithOptions(e,{...this.configuration.targetProject,token:c.default.get(i.constants.GITHUB.TOKEN)})}catch(e){(0,o.logAndThrow)("Invalid definition file")}}}t.DefinitionFileReader=DefinitionFileReader},6298:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,i)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__decorate||function(e,t,r,a){var i=arguments.length,n=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])n=(i<3?s(n):i>3?s(t,r,n):s(t,r))||n;return i>3&&n&&Object.defineProperty(t,r,n),n};var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))a(t,e,r);i(t,e);return t};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});t.FlowService=void 0;const p=r(4396);const c=r(6696);const l=r(7774);const d=r(5173);const u=r(4303);const m=r(6229);const h=r(9837);const g=s(r(3802));let v=class FlowService{constructor(){this.configService=g.default.get(m.ConfigurationService);this.checkoutService=g.default.get(d.CheckoutService);this.executor=g.default.get(u.ExecuteCommandService);this.artifactService=g.default.get(l.ArtifactService);this.logger=g.default.get(h.LoggerService).logger}async run(){this.logger.startGroup("Execution Plan");this.printExecutionPlan();this.logger.endGroup();this.logger.startGroup(`Checking out ${this.configService.getStarterProjectName()} and its dependencies`);const e=await this.checkoutService.checkoutDefinitionTree();this.logger.info("Checkout summary");this.printCheckoutSummary(e);this.logger.endGroup();const t=this.configService.nodeChain.map((t=>({node:t,cwd:e.find((e=>e.node.project===t.project)).checkoutInfo?.repoDir})));const r=await this.executeAndPrint(t,c.ExecutionPhase.BEFORE);const a=await this.executeAndPrint(t,c.ExecutionPhase.CURRENT);const i=await this.executeAndPrint(t,c.ExecutionPhase.AFTER);this.logger.startGroup("Uploading artifacts");const n=await this.artifactService.uploadNodes(this.configService.nodeChain,this.configService.getStarterNode());this.logger.endGroup();return{checkoutInfo:e,artifactUploadResults:n,executionResult:{after:i,commands:a,before:r}}}printExecutionPlan(){this.logger.info(`${this.configService.nodeChain.length} projects will be executed`);this.configService.nodeChain.forEach((e=>{const t=this.configService.getNodeExecutionLevel(e);this.logger.info(`[${e.project}]`);this.logger.info(`\t Level type: ${t}`);if(this.configService.skipExecution(e)){this.logger.info("\t No command will be executed (this project will be skipped)")}else{const r=this.executor.getNodeCommands(e,c.ExecutionPhase.BEFORE,t);const a=this.executor.getNodeCommands(e,c.ExecutionPhase.CURRENT,t);const i=this.executor.getNodeCommands(e,c.ExecutionPhase.AFTER,t);if(r?.length){this.logger.info(`\t [${c.ExecutionPhase.BEFORE}]`);this.logger.info(`\t\t ${r.join("\n")}`)}if(a?.length){this.logger.info(`\t [${c.ExecutionPhase.CURRENT}]`);this.logger.info(`\t\t ${a.join("\n")}`)}if(i?.length){this.logger.info(`\t [${c.ExecutionPhase.AFTER}]`);this.logger.info(`\t\t ${i.join("\n")}`)}}}))}printCheckoutSummary(e){e.forEach((e=>{this.logger.info(`[${e.node.project}]`);if(e.checkoutInfo){this.logger.info(`\t Project taken from ${e.checkoutInfo.targetGroup}/${e.checkoutInfo.targetName}:${e.checkoutInfo.targetBranch}`);if(e.checkoutInfo.merge){this.logger.info(`\t Merged ${e.checkoutInfo.sourceGroup}/${e.checkoutInfo.sourceName}:${e.checkoutInfo.sourceBranch} into branch ${e.checkoutInfo.targetBranch}`)}}else{this.logger.info("\t This project wasn't checked out")}}))}printExecutionSummary(e){e.forEach((e=>{this.logger.info(`[${e.node.project}]`);if(!e.executeCommandResults.length){this.logger.info("\t No commands were found for this project")}e.executeCommandResults.forEach((e=>{this.logger.info(`\t [${e.result}] ${e.command} [Executed in ${e.time} ms]`);if(e.result===p.ExecutionResult.NOT_OK){this.logger.info(`\t\t Error: ${e.errorMessage}`)}}))}))}async executeAndPrint(e,t){this.logger.startGroup(`Executing ${t}`);const r=await this.executor.executeChainCommands(e,t);this.logger.info(`Execution summary for phase ${t}`);this.printExecutionSummary(r);this.logger.endGroup();return r}};v=n([(0,g.Service)(),o("design:paramtypes",[])],v);t.FlowService=v},7616:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,i)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__decorate||function(e,t,r,a){var i=arguments.length,n=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])n=(i<3?s(n):i>3?s(t,r,n):s(t,r))||n;return i>3&&n&&Object.defineProperty(t,r,n),n};var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))a(t,e,r);i(t,e);return t};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};var p=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.GitCLIService=void 0;const c=p(r(9103));const l=s(r(3802));const d=p(r(7147));const u=r(9837);let m=class GitCLIService{constructor(){this.logger=l.default.get(u.LoggerService).logger}git(e,t){const r={...e?{baseDir:e}:{},...t?{errors:t}:{}};return(0,c.default)(r).addConfig("user.name","Github").addConfig("user.email","noreply@github.com")}async version(){const e=await(0,c.default)().raw("version");const t=e.match(/(\d+\.\d+(\.\d+)?)/);return t?t[1]:undefined}async clone(e,t,r){if(!d.default.existsSync(t)){await(0,c.default)().clone(e,t,["--quiet","--shallow-submodules","--no-tags","--branch",r])}else{this.logger.warn(`Folder ${t} already exist. Won't clone`)}}async fetch(e,t){await this.git(e).fetch("origin",t,["--quiet"])}async getCommonAncestor(e,...t){if(t.length===1){return t[0]}else if(t.length<1){throw new Error("empty refs!")}const errorHandler=(e,t)=>{if(t.exitCode===1||t.exitCode===0){return}if(e){return e}return Buffer.concat([...t.stdOut,...t.stdErr])};return(await this.git(e,errorHandler).raw("merge-base","--octopus",...t)).trim()}async getReachableParentCommits(e,t){return(await this.git(e).raw("rev-list","--parents",`${t}..HEAD`)).split(/\n/g).map((e=>e.split(/ /g).slice(1))).flat()}async merge(e,t,r){await this.git(e).pull(t,r,["--no-rebase","--allow-unrelated-histories"])}async head(e){return this.git(e).raw("show-ref","--head","-s","/HEAD")}async sha(e,t){return this.git(e).raw("show-ref","-s",`refs/remotes/origin/${t}`)}async rename(e,t){await this.git(e).branch(["--move",t])}async rebase(e,t){await this.git(e).rebase(["--quiet","--autosquash",t])}async push(e,t,r){const a=["--quiet"];if(t){a.push("--force-with-lease")}await this.git(e).push("origin",r,a)}};m=n([(0,l.Service)(),o("design:paramtypes",[])],m);t.GitCLIService=m},8031:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,i)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__decorate||function(e,t,r,a){var i=arguments.length,n=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])n=(i<3?s(n):i>3?s(t,r,n):s(t,r))||n;return i>3&&n&&Object.defineProperty(t,r,n),n};var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))a(t,e,r);i(t,e);return t};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});t.GithubAPIService=void 0;const p=r(293);const c=r(2322);const l=r(9837);const d=r(8410);const u=s(r(3802));let m=class GithubAPIService{constructor(){this.logger=u.default.get(l.LoggerService).logger;this.octokit=u.default.get(c.OctokitService).octokit}async doesBranchExist(e,t,r){try{await this.octokit.repos.getBranch({owner:e,repo:t,branch:r});return true}catch(a){this.logger.warn(`project github.com/${e}/${t}:${r} does not exist. It's not necessarily an error.`);return false}}async hasPullRequest(e,t,r,a){let i={owner:e,repo:t,state:"open"};if(!a&&!r){(0,d.logAndThrow)(`[${e}/${t}] Either head or base needs to be defined while requesting pull request information`)}if(a){i={...i,base:a}}if(r){i={...i,head:r}}try{const{status:e,data:t}=await this.octokit.pulls.list(i);return e===200&&t.length>0}catch(i){let n=`Error getting pull request list from https://api.github.com/repos/${e}/${t}/pulls?state=open`;if(a){n+=`&base=${a}`}if(r){n+=`&head=${r}`}this.logger.error(n);throw i}}async getForkName(e,t,r){try{if(e===t){await this.octokit.repos.get({owner:t,repo:r});return r}else{for await(const a of this.octokit.paginate.iterator(this.octokit.repos.listForks,{owner:e,repo:r})){const e=a.data.find((e=>e.owner.login===t));if(e){return e.name}}throw new p.NotFoundError}}catch(a){this.logger.error(`Error getting fork name for ${e}/${r} where owner is ${t}`);throw a}}};m=n([(0,u.Service)(),o("design:paramtypes",[])],m);t.GithubAPIService=m},2322:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,i)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__decorate||function(e,t,r,a){var i=arguments.length,n=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])n=(i<3?s(n):i>3?s(t,r,n):s(t,r))||n;return i>3&&n&&Object.defineProperty(t,r,n),n};var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))a(t,e,r);i(t,e);return t};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});t.OctokitService=void 0;const p=r(6759);const c=r(5375);const l=s(r(3802));const d=r(3764);let u=class OctokitService{constructor(){const e=process.env["http_proxy"];this._octokit=new c.Octokit({auth:l.default.get(p.constants.GITHUB.TOKEN),userAgent:"kiegroup/github-build-chain-action",request:{agent:e?new d.HttpProxyAgent(e):undefined}})}get octokit(){return this._octokit}};u=n([(0,l.Service)(),o("design:paramtypes",[])],u);t.OctokitService=u},8081:function(e,t,r){"use strict";var a=this&&this.__decorate||function(e,t,r,a){var i=arguments.length,n=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])n=(i<3?s(n):i>3?s(t,r,n):s(t,r))||n;return i>3&&n&&Object.defineProperty(t,r,n),n};Object.defineProperty(t,"__esModule",{value:true});t.InputService=void 0;const i=r(8373);const n=r(3802);let s=class InputService{constructor(){this._inputs=i.defaultInputValues}get inputs(){return this._inputs}updateInputs(e){this._inputs={...this.inputs,...e}}};s=a([(0,n.Service)()],s);t.InputService=s},361:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,i)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__decorate||function(e,t,r,a){var i=arguments.length,n=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])n=(i<3?s(n):i>3?s(t,r,n):s(t,r))||n;return i>3&&n&&Object.defineProperty(t,r,n),n};var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))a(t,e,r);i(t,e);return t};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});t.JobSummaryService=void 0;const p=s(r(3802));const c=s(r(2186));const l=r(6229);const d=r(8373);const u=r(7616);const m=r(4396);const h=r(6696);let g=class JobSummaryService{constructor(){this.configService=p.default.get(l.ConfigurationService);this.gitService=p.default.get(u.GitCLIService)}async generateSummary(e,t,r){const a=this.configService.getFlowType();if(a===d.FlowType.BRANCH){return}const i=c.summary.emptyBuffer().addRaw("You can copy paste the following commands to locally execute build chain tool.",true).addCodeBlock(`npm i ${process.env.npm_package_name}@${process.env.npm_package_version} -g build-chain-action -f ${this.configService.getDefinitionFileUrl()} build ${a} -u ${this.configService.getEventUrl()}`).addEOL().addRaw(`**Git Version**: \`${await this.gitService.version()}\``,true).addRaw("> **_Notice_**: The `GITHUB_TOKEN` should be set in the environment.",true).stringify();const n=this.constructExecutionResult(e.executionResult.before,e.checkoutInfo);const s=this.constructExecutionResult(e.executionResult.commands,e.checkoutInfo);const o=this.constructExecutionResult(e.executionResult.after,e.checkoutInfo);const p=this.constructPrePostResult(t);const l=this.constructPrePostResult(r);await c.summary.emptyBuffer().addHeading("Build Chain Execution Summary").addEOL().addRaw(`**Project Starting the Job:** [${this.configService.getStarterProjectName()}](https://github.com/${this.configService.getStarterProjectName()})`,true).addRaw(`Pre
${p} `,true).addRaw(`Execution phase: ${h.ExecutionPhase.BEFORE}
${n} `,true).addRaw(`Execution phase: ${h.ExecutionPhase.CURRENT}
${s} `,true).addRaw(`Execution phase: ${h.ExecutionPhase.AFTER}
${o} `,true).addRaw(`Post
${l} `,true).addRaw(`Local Execution
${i} `,true).write()}constructPrePostResult(e){const t=[{data:"Command",header:true},{data:"Execution Result",header:true},{data:"Execution Time",header:true}];const r=e.map((e=>[e.command,this.getExecutionResultString(e.result),`${e.time}`]));return c.summary.emptyBuffer().addTable([t,...r]).stringify()}constructExecutionResult(e,t){const r=[{data:"Project",header:true},{data:"Source",header:true},{data:"Target",header:true},{data:"Merged",header:true},{data:"Execution Result",header:true},{data:"Avg Execution Time",header:true}];return c.summary.emptyBuffer().addTable([r,...this.getExecutionResultData(e,t)]).addEOL().addRaw("```mermaid",true).addRaw(this.constructGraph(e),true).addRaw("```",true).stringify()}getExecutionResult(e){return e.find((e=>e.result!==m.ExecutionResult.OK))?.result??m.ExecutionResult.OK}getExecutionResultString(e){switch(e){case m.ExecutionResult.NOT_OK:return"❌";case m.ExecutionResult.SKIP:return"⛔";default:return"✅"}}getExecutionResultData(e,t){return e.map((e=>{const r=t.find((t=>t.node.project===e.node.project)).checkoutInfo;const a=this.getExecutionResultString(this.getExecutionResult(e.executeCommandResults));return[e.node.project,r?`${r.targetGroup}/${r.targetName}:${r.targetBranch}`:"checkout skipped",r?`${r.sourceGroup}/${r.sourceName}:${r.sourceBranch}`:"checkout skipped",r?.merge?"✅":"❌",a,e.executeCommandResults.length>0?`${e.executeCommandResults.reduce(((e,t)=>e+t.time),0)/e.executeCommandResults.length}`:"0"]}))}constructGraph(e){return`flowchart LR;\n ${e.map((e=>{const t=this.getExecutionResult(e.executeCommandResults);let r="okClass";switch(t){case m.ExecutionResult.NOT_OK:r="errorClass";break;case m.ExecutionResult.SKIP:r="noEntry";break}return`${e.node.project}:::${r}`})).join("==>")}\n ${e.map((e=>`click ${e.node.project} 'https://github.com/${e.node.project}'`)).join("\n\t\t\t\t")}\n classDef okClass fill:#218838,stroke:#1e7e34,color: #fff,border-radius: 4px\n classDef errorClass fill:#dc3545,stroke:#dc3545,color: #fff,border-radius: 4px\n classDef noEntry fill:#6c757d,stroke:#6c757d,color: #fff,border-radius: 4px`}};g=n([(0,p.Service)(),o("design:paramtypes",[])],g);t.JobSummaryService=g},8140:function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.BaseLoggerService=void 0;const i=r(8373);const n=r(8081);const s=r(8416);const o=a(r(3802));class BaseLoggerService{constructor(){this._logger=new s.Logger;this.input=o.default.get(n.InputService)}debug(e){if(this.input.inputs.loggerLevel==i.LoggerLevel.DEBUG){this._logger.log("[DEBUG]",e)}}info(e){this._logger.log("[INFO]",e)}trace(e){if(this.input.inputs.loggerLevel==i.LoggerLevel.TRACE){this._logger.log("[TRACE]",e)}}warn(e){this._logger.log("[WARN]",e)}error(e){this._logger.log("[ERROR]",e)}get logger(){return this._logger}}t.BaseLoggerService=BaseLoggerService},8625:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.CLILoggerService=void 0;const a=r(8140);class CLILoggerService extends a.BaseLoggerService{constructor(){super()}endGroup(){super.logger.emptyLine()}startGroup(e){super.logger.log("#",e)}}t.CLILoggerService=CLILoggerService},418:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,i)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))a(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.GithubActionLoggerService=void 0;const s=r(8140);const o=n(r(2186));class GithubActionLoggerService extends s.BaseLoggerService{constructor(){super()}endGroup(){o.endGroup()}startGroup(e){o.startGroup(e)}}t.GithubActionLoggerService=GithubActionLoggerService},9837:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,i)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__decorate||function(e,t,r,a){var i=arguments.length,n=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])n=(i<3?s(n):i>3?s(t,r,n):s(t,r))||n;return i>3&&n&&Object.defineProperty(t,r,n),n};var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))a(t,e,r);i(t,e);return t};var o=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:true});t.LoggerService=void 0;const p=r(6759);const c=r(6848);const l=r(8625);const d=r(418);const u=s(r(3802));let m=class LoggerService{constructor(){const e=u.default.get(p.constants.CONTAINER.ENTRY_POINT);switch(e){case c.EntryPoint.CLI:this._logger=new l.CLILoggerService;break;case c.EntryPoint.GITHUB_EVENT:this._logger=new d.GithubActionLoggerService;break;default:throw new Error(`No LoggerService defined for ${e}`)}}get logger(){return this._logger}};m=n([(0,u.Service)(),o("design:paramtypes",[])],m);t.LoggerService=m},8416:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Logger=void 0;class Logger{log(e,...t){console.log.apply(console,[e,...t])}emptyLine(){this.log("","")}}t.Logger=Logger},3063:function(e,t,r){"use strict";var a=this&&this.__decorate||function(e,t,r,a){var i=arguments.length,n=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])n=(i<3?s(n):i>3?s(t,r,n):s(t,r))||n;return i>3&&n&&Object.defineProperty(t,r,n),n};var i=this&&this.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};var n=this&&this.__param||function(e,t){return function(r,a){t(r,a,e)}};Object.defineProperty(t,"__esModule",{value:true});t.PostExecutor=void 0;const s=r(6165);const o=r(3802);let p=class PostExecutor extends s.PrePostExecutor{constructor(e){super();this.executionSuccess=e}async run(){const e=this.configService.getPost();let t=[];if(e){this.logger.startGroup("Executing post section");if(this.executionSuccess){this.logger.info("execution result is OK, so 'success' and 'always' sections will be executed");if(e.success){t=await this.execute(e.success)}}else{this.logger.info("execution result is NOT OK, so 'failure' and 'always' sections will be executed");if(e.failure){t=await this.execute(e.failure)}}if(e.always){t=[...t,...await this.execute(e.always)]}this.logger.endGroup()}return t}};p=a([(0,o.Service)(),n(0,(0,o.Inject)("post.executionSuccess")),i("design:paramtypes",[Boolean])],p);t.PostExecutor=p},6165:function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.PrePostExecutor=void 0;const i=r(4303);const n=r(6229);const s=r(9837);const o=a(r(3802));class PrePostExecutor{constructor(){this.configService=o.default.get(n.ConfigurationService);this.logger=o.default.get(s.LoggerService).logger;this.executeService=o.default.get(i.ExecuteCommandService)}async execute(e){const t=[];if(Array.isArray(e)){for(const r of e){t.push(await this.executeService.executeCommand(r,process.cwd()))}}else{t.push(await this.executeService.executeCommand(e,process.cwd()))}return t}}t.PrePostExecutor=PrePostExecutor},7814:function(e,t,r){"use strict";var a=this&&this.__decorate||function(e,t,r,a){var i=arguments.length,n=i<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])n=(i<3?s(n):i>3?s(t,r,n):s(t,r))||n;return i>3&&n&&Object.defineProperty(t,r,n),n};Object.defineProperty(t,"__esModule",{value:true});t.PreExecutor=void 0;const i=r(6165);const n=r(3802);let s=class PreExecutor extends i.PrePostExecutor{async run(){const e=this.configService.getPre();let t=[];if(e){this.logger.startGroup("Executing pre section");t=await this.execute(e);this.logger.endGroup()}return t}};s=a([(0,n.Service)()],s);t.PreExecutor=s},3678:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.hrtimeToMs=t.formatDate=void 0;function formatDate(e){return`${e.getFullYear()}${e.getMonth()}${e.getDate()}${e.getHours()}${e.getMinutes()}${e.getSeconds()}`}t.formatDate=formatDate;function hrtimeToMs(e,t=process.hrtime(e)){return t[0]*1e3+t[1]/1e6}t.hrtimeToMs=hrtimeToMs},8410:function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.logAndThrow=void 0;const i=r(9837);const n=a(r(3802));function logAndThrow(e){n.default.get(i.LoggerService).logger.error(e);throw new Error(e)}t.logAndThrow=logAndThrow},2877:module=>{module.exports=eval("require")("encoding")},9491:e=>{"use strict";e.exports=require("assert")},2081:e=>{"use strict";e.exports=require("child_process")},2057:e=>{"use strict";e.exports=require("constants")},6113:e=>{"use strict";e.exports=require("crypto")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},3292:e=>{"use strict";e.exports=require("fs/promises")},3685:e=>{"use strict";e.exports=require("http")},5687:e=>{"use strict";e.exports=require("https")},1808:e=>{"use strict";e.exports=require("net")},3977:e=>{"use strict";e.exports=require("node:fs/promises")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},4074:e=>{"use strict";e.exports=require("perf_hooks")},5477:e=>{"use strict";e.exports=require("punycode")},2781:e=>{"use strict";e.exports=require("stream")},1576:e=>{"use strict";e.exports=require("string_decoder")},9512:e=>{"use strict";e.exports=require("timers")},4404:e=>{"use strict";e.exports=require("tls")},6224:e=>{"use strict";e.exports=require("tty")},7310:e=>{"use strict";e.exports=require("url")},3837:e=>{"use strict";e.exports=require("util")},9796:e=>{"use strict";e.exports=require("zlib")},8109:(e,t,r)=>{"use strict";var a=r(1399);var i=r(9338);var n=r(2986);var s=r(2289);var o=r(45);function composeCollection(e,t,r,p,c){let l;switch(r.type){case"block-map":{l=n.resolveBlockMap(e,t,r,c);break}case"block-seq":{l=s.resolveBlockSeq(e,t,r,c);break}case"flow-collection":{l=o.resolveFlowCollection(e,t,r,c);break}}if(!p)return l;const d=t.directives.tagName(p.source,(e=>c(p,"TAG_RESOLVE_FAILED",e)));if(!d)return l;const u=l.constructor;if(d==="!"||d===u.tagName){l.tag=u.tagName;return l}const m=a.isMap(l)?"map":"seq";let h=t.schema.tags.find((e=>e.collection===m&&e.tag===d));if(!h){const e=t.schema.knownTags[d];if(e&&e.collection===m){t.schema.tags.push(Object.assign({},e,{default:false}));h=e}else{c(p,"TAG_RESOLVE_FAILED",`Unresolved tag: ${d}`,true);l.tag=d;return l}}const g=h.resolve(l,(e=>c(p,"TAG_RESOLVE_FAILED",e)),t.options);const v=a.isNode(g)?g:new i.Scalar(g);v.range=l.range;v.tag=d;if(h?.format)v.format=h.format;return v}t.composeCollection=composeCollection},5050:(e,t,r)=>{"use strict";var a=r(42);var i=r(8676);var n=r(1250);var s=r(6985);function composeDoc(e,t,{offset:r,start:o,value:p,end:c},l){const d=Object.assign({_directives:t},e);const u=new a.Document(undefined,d);const m={atRoot:true,directives:u.directives,options:u.options,schema:u.schema};const h=s.resolveProps(o,{indicator:"doc-start",next:p??c?.[0],offset:r,onError:l,startOnNewline:true});if(h.found){u.directives.docStart=true;if(p&&(p.type==="block-map"||p.type==="block-seq")&&!h.hasNewline)l(h.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}u.contents=p?i.composeNode(m,p,h,l):i.composeEmptyNode(m,h.end,o,null,h,l);const g=u.contents.range[2];const v=n.resolveEnd(c,g,false,l);if(v.comment)u.comment=v.comment;u.range=[r,g,v.offset];return u}t.composeDoc=composeDoc},8676:(e,t,r)=>{"use strict";var a=r(5639);var i=r(8109);var n=r(4766);var s=r(1250);var o=r(8781);const p={composeNode:composeNode,composeEmptyNode:composeEmptyNode};function composeNode(e,t,r,a){const{spaceBefore:s,comment:o,anchor:c,tag:l}=r;let d;let u=true;switch(t.type){case"alias":d=composeAlias(e,t,a);if(c||l)a(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":d=n.composeScalar(e,t,l,a);if(c)d.anchor=c.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":d=i.composeCollection(p,e,t,l,a);if(c)d.anchor=c.source.substring(1);break;default:{const i=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;a(t,"UNEXPECTED_TOKEN",i);d=composeEmptyNode(e,t.offset,undefined,null,r,a);u=false}}if(c&&d.anchor==="")a(c,"BAD_ALIAS","Anchor cannot be an empty string");if(s)d.spaceBefore=true;if(o){if(t.type==="scalar"&&t.source==="")d.comment=o;else d.commentBefore=o}if(e.options.keepSourceTokens&&u)d.srcToken=t;return d}function composeEmptyNode(e,t,r,a,{spaceBefore:i,comment:s,anchor:p,tag:c,end:l},d){const u={type:"scalar",offset:o.emptyScalarPosition(t,r,a),indent:-1,source:""};const m=n.composeScalar(e,u,c,d);if(p){m.anchor=p.source.substring(1);if(m.anchor==="")d(p,"BAD_ALIAS","Anchor cannot be an empty string")}if(i)m.spaceBefore=true;if(s){m.comment=s;m.range[2]=l}return m}function composeAlias({options:e},{offset:t,source:r,end:i},n){const o=new a.Alias(r.substring(1));if(o.source==="")n(t,"BAD_ALIAS","Alias cannot be an empty string");if(o.source.endsWith(":"))n(t+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",true);const p=t+r.length;const c=s.resolveEnd(i,p,e.strict,n);o.range=[t,p,c.offset];if(c.comment)o.comment=c.comment;return o}t.composeEmptyNode=composeEmptyNode;t.composeNode=composeNode},4766:(e,t,r)=>{"use strict";var a=r(1399);var i=r(9338);var n=r(9485);var s=r(7578);function composeScalar(e,t,r,o){const{value:p,type:c,comment:l,range:d}=t.type==="block-scalar"?n.resolveBlockScalar(t,e.options.strict,o):s.resolveFlowScalar(t,e.options.strict,o);const u=r?e.directives.tagName(r.source,(e=>o(r,"TAG_RESOLVE_FAILED",e))):null;const m=r&&u?findScalarTagByName(e.schema,p,u,r,o):t.type==="scalar"?findScalarTagByTest(e,p,t,o):e.schema[a.SCALAR];let h;try{const n=m.resolve(p,(e=>o(r??t,"TAG_RESOLVE_FAILED",e)),e.options);h=a.isScalar(n)?n:new i.Scalar(n)}catch(e){const a=e instanceof Error?e.message:String(e);o(r??t,"TAG_RESOLVE_FAILED",a);h=new i.Scalar(p)}h.range=d;h.source=p;if(c)h.type=c;if(u)h.tag=u;if(m.format)h.format=m.format;if(l)h.comment=l;return h}function findScalarTagByName(e,t,r,i,n){if(r==="!")return e[a.SCALAR];const s=[];for(const t of e.tags){if(!t.collection&&t.tag===r){if(t.default&&t.test)s.push(t);else return t}}for(const e of s)if(e.test?.test(t))return e;const o=e.knownTags[r];if(o&&!o.collection){e.tags.push(Object.assign({},o,{default:false,test:undefined}));return o}n(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str");return e[a.SCALAR]}function findScalarTagByTest({directives:e,schema:t},r,i,n){const s=t.tags.find((e=>e.default&&e.test?.test(r)))||t[a.SCALAR];if(t.compat){const o=t.compat.find((e=>e.default&&e.test?.test(r)))??t[a.SCALAR];if(s.tag!==o.tag){const t=e.tagString(s.tag);const r=e.tagString(o.tag);const a=`Value may be parsed as either ${t} or ${r}`;n(i,"TAG_RESOLVE_FAILED",a,true)}}return s}t.composeScalar=composeScalar},9493:(e,t,r)=>{"use strict";var a=r(5400);var i=r(42);var n=r(4236);var s=r(1399);var o=r(5050);var p=r(1250);function getErrorPos(e){if(typeof e==="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:r}=e;return[t,t+(typeof r==="string"?r.length:1)]}function parsePrelude(e){let t="";let r=false;let a=false;for(let i=0;i{const i=getErrorPos(e);if(a)this.warnings.push(new n.YAMLWarning(i,t,r));else this.errors.push(new n.YAMLParseError(i,t,r))};this.directives=new a.Directives({version:e.version||"1.2"});this.options=e}decorate(e,t){const{comment:r,afterEmptyLine:a}=parsePrelude(this.prelude);if(r){const i=e.contents;if(t){e.comment=e.comment?`${e.comment}\n${r}`:r}else if(a||e.directives.docStart||!i){e.commentBefore=r}else if(s.isCollection(i)&&!i.flow&&i.items.length>0){let e=i.items[0];if(s.isPair(e))e=e.key;const t=e.commentBefore;e.commentBefore=t?`${r}\n${t}`:r}else{const e=i.commentBefore;i.commentBefore=e?`${r}\n${e}`:r}}if(t){Array.prototype.push.apply(e.errors,this.errors);Array.prototype.push.apply(e.warnings,this.warnings)}else{e.errors=this.errors;e.warnings=this.warnings}this.prelude=[];this.errors=[];this.warnings=[]}streamInfo(){return{comment:parsePrelude(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=false,r=-1){for(const t of e)yield*this.next(t);yield*this.end(t,r)}*next(e){if(process.env.LOG_STREAM)console.dir(e,{depth:null});switch(e.type){case"directive":this.directives.add(e.source,((t,r,a)=>{const i=getErrorPos(e);i[0]+=t;this.onError(i,"BAD_DIRECTIVE",r,a)}));this.prelude.push(e.source);this.atDirectives=true;break;case"document":{const t=o.composeDoc(this.options,this.directives,e,this.onError);if(this.atDirectives&&!t.directives.docStart)this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line");this.decorate(t,false);if(this.doc)yield this.doc;this.doc=t;this.atDirectives=false;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;const r=new n.YAMLParseError(getErrorPos(e),"UNEXPECTED_TOKEN",t);if(this.atDirectives||!this.doc)this.errors.push(r);else this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const t="Unexpected doc-end without preceding document";this.errors.push(new n.YAMLParseError(getErrorPos(e),"UNEXPECTED_TOKEN",t));break}this.doc.directives.docEnd=true;const t=p.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);this.decorate(this.doc,true);if(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 n.YAMLParseError(getErrorPos(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=false,t=-1){if(this.doc){this.decorate(this.doc,true);yield this.doc;this.doc=null}else if(e){const e=Object.assign({_directives:this.directives},this.options);const r=new i.Document(undefined,e);if(this.atDirectives)this.onError(t,"MISSING_CHAR","Missing directives-end indicator line");r.range=[0,t,t];this.decorate(r,false);yield r}}}t.Composer=Composer},2986:(e,t,r)=>{"use strict";var a=r(246);var i=r(6011);var n=r(6985);var s=r(976);var o=r(3669);var p=r(6899);const c="All mapping items must start at the same column";function resolveBlockMap({composeNode:e,composeEmptyNode:t},r,l,d){const u=new i.YAMLMap(r.schema);if(r.atRoot)r.atRoot=false;let m=l.offset;let h=null;for(const i of l.items){const{start:g,key:v,sep:y,value:b}=i;const w=n.resolveProps(g,{indicator:"explicit-key-ind",next:v??y?.[0],offset:m,onError:d,startOnNewline:true});const x=!w.found;if(x){if(v){if(v.type==="block-seq")d(m,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in v&&v.indent!==l.indent)d(m,"BAD_INDENT",c)}if(!w.anchor&&!w.tag&&!y){h=w.end;if(w.comment){if(u.comment)u.comment+="\n"+w.comment;else u.comment=w.comment}continue}if(w.hasNewlineAfterProp||s.containsNewline(v)){d(v??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}}else if(w.found?.indent!==l.indent){d(m,"BAD_INDENT",c)}const E=w.end;const S=v?e(r,v,w,d):t(r,E,g,null,w,d);if(r.schema.compat)o.flowIndentCheck(l.indent,v,d);if(p.mapIncludes(r,u.items,S))d(E,"DUPLICATE_KEY","Map keys must be unique");const T=n.resolveProps(y??[],{indicator:"map-value-ind",next:b,offset:S.range[2],onError:d,startOnNewline:!v||v.type==="block-scalar"});m=T.end;if(T.found){if(x){if(b?.type==="block-map"&&!T.hasNewline)d(m,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(r.options.strict&&w.start{"use strict";var a=r(9338);function resolveBlockScalar(e,t,r){const i=e.offset;const n=parseBlockScalarHeader(e,t,r);if(!n)return{value:"",type:null,comment:"",range:[i,i,i]};const s=n.mode===">"?a.Scalar.BLOCK_FOLDED:a.Scalar.BLOCK_LITERAL;const o=e.source?splitLines(e.source):[];let p=o.length;for(let e=o.length-1;e>=0;--e){const t=o[e][1];if(t===""||t==="\r")p=e;else break}if(p===0){const t=n.chomp==="+"&&o.length>0?"\n".repeat(Math.max(1,o.length-1)):"";let r=i+n.length;if(e.source)r+=e.source.length;return{value:t,type:s,comment:n.comment,range:[i,r,r]}}let c=e.indent+n.indent;let l=e.offset+n.length;let d=0;for(let e=0;ec)c=t.length}else{if(t.length=p;--e){if(o[e][0].length>c)p=e+1}let u="";let m="";let h=false;for(let e=0;ec||i[0]==="\t"){if(m===" ")m="\n";else if(!h&&m==="\n")m="\n\n";u+=m+t.slice(c)+i;m="\n";h=true}else if(i===""){if(m==="\n")u+="\n";else m="\n"}else{u+=m+i;m=" ";h=false}}switch(n.chomp){case"-":break;case"+":for(let e=p;e{"use strict";var a=r(5161);var i=r(6985);var n=r(3669);function resolveBlockSeq({composeNode:e,composeEmptyNode:t},r,s,o){const p=new a.YAMLSeq(r.schema);if(r.atRoot)r.atRoot=false;let c=s.offset;let l=null;for(const{start:a,value:d}of s.items){const u=i.resolveProps(a,{indicator:"seq-item-ind",next:d,offset:c,onError:o,startOnNewline:true});if(!u.found){if(u.anchor||u.tag||d){if(d&&d.type==="block-seq")o(u.end,"BAD_INDENT","All sequence items must start at the same column");else o(c,"MISSING_CHAR","Sequence item without - indicator")}else{l=u.end;if(u.comment)p.comment=u.comment;continue}}const m=d?e(r,d,u,o):t(r,u.end,a,null,u,o);if(r.schema.compat)n.flowIndentCheck(s.indent,d,o);c=m.range[2];p.items.push(m)}p.range=[s.offset,c,l??c];return p}t.resolveBlockSeq=resolveBlockSeq},1250:(e,t)=>{"use strict";function resolveEnd(e,t,r,a){let i="";if(e){let n=false;let s="";for(const o of e){const{source:e,type:p}=o;switch(p){case"space":n=true;break;case"comment":{if(r&&!n)a(o,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const t=e.substring(1)||" ";if(!i)i=t;else i+=s+t;s="";break}case"newline":if(i)s+=e;n=true;break;default:a(o,"UNEXPECTED_TOKEN",`Unexpected ${p} at node end`)}t+=e.length}}return{comment:i,offset:t}}t.resolveEnd=resolveEnd},45:(e,t,r)=>{"use strict";var a=r(1399);var i=r(246);var n=r(6011);var s=r(5161);var o=r(1250);var p=r(6985);var c=r(976);var l=r(6899);const d="Block collections are not allowed within flow collections";const isBlock=e=>e&&(e.type==="block-map"||e.type==="block-seq");function resolveFlowCollection({composeNode:e,composeEmptyNode:t},r,u,m){const h=u.start.source==="{";const g=h?"flow map":"flow sequence";const v=h?new n.YAMLMap(r.schema):new s.YAMLSeq(r.schema);v.flow=true;const y=r.atRoot;if(y)r.atRoot=false;let b=u.offset+u.start.source.length;for(let s=0;s0){const e=o.resolveEnd(E,S,r.options.strict,m);if(e.comment){if(v.comment)v.comment+="\n"+e.comment;else v.comment=e.comment}v.range=[u.offset,S,e.offset]}else{v.range=[u.offset,S,S]}return v}t.resolveFlowCollection=resolveFlowCollection},7578:(e,t,r)=>{"use strict";var a=r(9338);var i=r(1250);function resolveFlowScalar(e,t,r){const{offset:n,type:s,source:o,end:p}=e;let c;let l;const _onError=(e,t,a)=>r(n+e,t,a);switch(s){case"scalar":c=a.Scalar.PLAIN;l=plainValue(o,_onError);break;case"single-quoted-scalar":c=a.Scalar.QUOTE_SINGLE;l=singleQuotedValue(o,_onError);break;case"double-quoted-scalar":c=a.Scalar.QUOTE_DOUBLE;l=doubleQuotedValue(o,_onError);break;default:r(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`);return{value:"",type:null,comment:"",range:[n,n+o.length,n+o.length]}}const d=n+o.length;const u=i.resolveEnd(p,d,t,r);return{value:l,type:c,comment:u.comment,range:[n,d,u.offset]}}function plainValue(e,t){let r="";switch(e[0]){case"\t":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${e[0]}`;break}case"@":case"`":{r=`reserved character ${e[0]}`;break}}if(r)t(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`);return foldLines(e)}function singleQuotedValue(e,t){if(e[e.length-1]!=="'"||e.length===1)t(e.length,"MISSING_CHAR","Missing closing 'quote");return foldLines(e.slice(1,-1)).replace(/''/g,"'")}function foldLines(e){let t,r;try{t=new RegExp("(.*?)(?t?e.slice(t,a+1):i}else{r+=i}}if(e[e.length-1]!=='"'||e.length===1)t(e.length,"MISSING_CHAR",'Missing closing "quote');return r}function foldNewline(e,t){let r="";let a=e[t+1];while(a===" "||a==="\t"||a==="\n"||a==="\r"){if(a==="\r"&&e[t+2]!=="\n")break;if(a==="\n")r+="\n";t+=1;a=e[t+1]}if(!r)r=" ";return{fold:r,offset:t}}const n={0:"\0",a:"",b:"\b",e:"",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function parseCharCode(e,t,r,a){const i=e.substr(t,r);const n=i.length===r&&/^[0-9a-fA-F]+$/.test(i);const s=n?parseInt(i,16):NaN;if(isNaN(s)){const i=e.substr(t-2,r+2);a(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${i}`);return i}return String.fromCodePoint(s)}t.resolveFlowScalar=resolveFlowScalar},6985:(e,t)=>{"use strict";function resolveProps(e,{flow:t,indicator:r,next:a,offset:i,onError:n,startOnNewline:s}){let o=false;let p=s;let c=s;let l="";let d="";let u=false;let m=false;let h=false;let g=null;let v=null;let y=null;let b=null;let w=null;for(const a of e){if(h){if(a.type!=="space"&&a.type!=="newline"&&a.type!=="comma")n(a.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");h=false}switch(a.type){case"space":if(!t&&p&&r!=="doc-start"&&a.source[0]==="\t")n(a,"TAB_AS_INDENT","Tabs are not allowed as indentation");c=true;break;case"comment":{if(!c)n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const e=a.source.substring(1)||" ";if(!l)l=e;else l+=d+e;d="";p=false;break}case"newline":if(p){if(l)l+=a.source;else o=true}else d+=a.source;p=true;u=true;if(g||v)m=true;c=true;break;case"anchor":if(g)n(a,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(a.source.endsWith(":"))n(a.offset+a.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",true);g=a;if(w===null)w=a.offset;p=false;c=false;h=true;break;case"tag":{if(v)n(a,"MULTIPLE_TAGS","A node can have at most one tag");v=a;if(w===null)w=a.offset;p=false;c=false;h=true;break}case r:if(g||v)n(a,"BAD_PROP_ORDER",`Anchors and tags must be after the ${a.source} indicator`);if(b)n(a,"UNEXPECTED_TOKEN",`Unexpected ${a.source} in ${t??"collection"}`);b=a;p=false;c=false;break;case"comma":if(t){if(y)n(a,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`);y=a;p=false;c=false;break}default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${a.type} token`);p=false;c=false}}const x=e[e.length-1];const E=x?x.offset+x.source.length:i;if(h&&a&&a.type!=="space"&&a.type!=="newline"&&a.type!=="comma"&&(a.type!=="scalar"||a.source!==""))n(a.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");return{comma:y,found:b,spaceBefore:o,comment:l,hasNewline:u,hasNewlineAfterProp:m,anchor:g,tag:v,end:E,start:w??E}}t.resolveProps=resolveProps},976:(e,t)=>{"use strict";function containsNewline(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 true;if(e.end)for(const t of e.end)if(t.type==="newline")return true;return false;case"flow-collection":for(const t of e.items){for(const e of t.start)if(e.type==="newline")return true;if(t.sep)for(const e of t.sep)if(e.type==="newline")return true;if(containsNewline(t.key)||containsNewline(t.value))return true}return false;default:return true}}t.containsNewline=containsNewline},8781:(e,t)=>{"use strict";function emptyScalarPosition(e,t,r){if(t){if(r===null)r=t.length;for(let a=r-1;a>=0;--a){let r=t[a];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}r=t[++a];while(r?.type==="space"){e+=r.source.length;r=t[++a]}break}}return e}t.emptyScalarPosition=emptyScalarPosition},3669:(e,t,r)=>{"use strict";var a=r(976);function flowIndentCheck(e,t,r){if(t?.type==="flow-collection"){const i=t.end[0];if(i.indent===e&&(i.source==="]"||i.source==="}")&&a.containsNewline(t)){const e="Flow end indicator should be more indented than parent";r(i,"BAD_INDENT",e,true)}}}t.flowIndentCheck=flowIndentCheck},6899:(e,t,r)=>{"use strict";var a=r(1399);function mapIncludes(e,t,r){const{uniqueKeys:i}=e.options;if(i===false)return false;const n=typeof i==="function"?i:(t,r)=>t===r||a.isScalar(t)&&a.isScalar(r)&&t.value===r.value&&!(t.value==="<<"&&e.schema.merge);return t.some((e=>n(e.key,r)))}t.mapIncludes=mapIncludes},42:(e,t,r)=>{"use strict";var a=r(5639);var i=r(3466);var n=r(1399);var s=r(246);var o=r(2463);var p=r(6831);var c=r(8409);var l=r(5225);var d=r(8459);var u=r(3412);var m=r(9652);var h=r(5400);class Document{constructor(e,t,r){this.commentBefore=null;this.comment=null;this.errors=[];this.warnings=[];Object.defineProperty(this,n.NODE_TYPE,{value:n.DOC});let a=null;if(typeof t==="function"||Array.isArray(t)){a=t}else if(r===undefined&&t){r=t;t=undefined}const i=Object.assign({intAsBigInt:false,keepSourceTokens:false,logLevel:"warn",prettyErrors:true,strict:true,uniqueKeys:true,version:"1.2"},r);this.options=i;let{version:s}=i;if(r?._directives){this.directives=r._directives.atDocument();if(this.directives.yaml.explicit)s=this.directives.yaml.version}else this.directives=new h.Directives({version:s});this.setSchema(s,r);if(e===undefined)this.contents=null;else{this.contents=this.createNode(e,a,r)}}clone(){const e=Object.create(Document.prototype,{[n.NODE_TYPE]:{value:n.DOC}});e.commentBefore=this.commentBefore;e.comment=this.comment;e.errors=this.errors.slice();e.warnings=this.warnings.slice();e.options=Object.assign({},this.options);if(this.directives)e.directives=this.directives.clone();e.schema=this.schema.clone();e.contents=n.isNode(this.contents)?this.contents.clone(e.schema):this.contents;if(this.range)e.range=this.range.slice();return e}add(e){if(assertCollection(this.contents))this.contents.add(e)}addIn(e,t){if(assertCollection(this.contents))this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const r=d.anchorNames(this);e.anchor=!t||r.has(t)?d.findNewAnchor(t||"a",r):t}return new a.Alias(e.anchor)}createNode(e,t,r){let a=undefined;if(typeof t==="function"){e=t.call({"":e},"",e);a=t}else if(Array.isArray(t)){const keyToStr=e=>typeof e==="number"||e instanceof String||e instanceof Number;const e=t.filter(keyToStr).map(String);if(e.length>0)t=t.concat(e);a=t}else if(r===undefined&&t){r=t;t=undefined}const{aliasDuplicateObjects:i,anchorPrefix:s,flow:o,keepUndefined:p,onTagObj:c,tag:l}=r??{};const{onAnchor:u,setAnchors:h,sourceObjects:g}=d.createNodeAnchors(this,s||"a");const v={aliasDuplicateObjects:i??true,keepUndefined:p??false,onAnchor:u,onTagObj:c,replacer:a,schema:this.schema,sourceObjects:g};const y=m.createNode(e,l,v);if(o&&n.isCollection(y))y.flow=true;h();return y}createPair(e,t,r={}){const a=this.createNode(e,null,r);const i=this.createNode(t,null,r);return new s.Pair(a,i)}delete(e){return assertCollection(this.contents)?this.contents.delete(e):false}deleteIn(e){if(i.isEmptyPath(e)){if(this.contents==null)return false;this.contents=null;return true}return assertCollection(this.contents)?this.contents.deleteIn(e):false}get(e,t){return n.isCollection(this.contents)?this.contents.get(e,t):undefined}getIn(e,t){if(i.isEmptyPath(e))return!t&&n.isScalar(this.contents)?this.contents.value:this.contents;return n.isCollection(this.contents)?this.contents.getIn(e,t):undefined}has(e){return n.isCollection(this.contents)?this.contents.has(e):false}hasIn(e){if(i.isEmptyPath(e))return this.contents!==undefined;return n.isCollection(this.contents)?this.contents.hasIn(e):false}set(e,t){if(this.contents==null){this.contents=i.collectionFromPath(this.schema,[e],t)}else if(assertCollection(this.contents)){this.contents.set(e,t)}}setIn(e,t){if(i.isEmptyPath(e))this.contents=t;else if(this.contents==null){this.contents=i.collectionFromPath(this.schema,Array.from(e),t)}else if(assertCollection(this.contents)){this.contents.setIn(e,t)}}setSchema(e,t={}){if(typeof e==="number")e=String(e);let r;switch(e){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new h.Directives({version:"1.1"});r={merge:true,resolveKnownTags:false,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=e;else this.directives=new h.Directives({version:e});r={merge:false,resolveKnownTags:true,schema:"core"};break;case null:if(this.directives)delete this.directives;r=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(r)this.schema=new p.Schema(Object.assign(r,t));else throw new Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:r,maxAliasCount:a,onAnchor:i,reviver:n}={}){const s={anchors:new Map,doc:this,keep:!e,mapAsMap:r===true,mapKeyWarned:false,maxAliasCount:typeof a==="number"?a:100,stringify:c.stringify};const p=o.toJS(this.contents,t??"",s);if(typeof i==="function")for(const{count:e,res:t}of s.anchors.values())i(t,e);return typeof n==="function"?u.applyReviver(n,{"":p},"",p):p}toJSON(e,t){return this.toJS({json:true,jsonArg:e,mapAsMap:false,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 l.stringifyDocument(this,e)}}function assertCollection(e){if(n.isCollection(e))return true;throw new Error("Expected a YAML collection as document contents")}t.Document=Document},8459:(e,t,r)=>{"use strict";var a=r(1399);var i=r(6796);function anchorIsValid(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=JSON.stringify(e);const r=`Anchor must not contain whitespace or control characters: ${t}`;throw new Error(r)}return true}function anchorNames(e){const t=new Set;i.visit(e,{Value(e,r){if(r.anchor)t.add(r.anchor)}});return t}function findNewAnchor(e,t){for(let r=1;true;++r){const a=`${e}${r}`;if(!t.has(a))return a}}function createNodeAnchors(e,t){const r=[];const i=new Map;let n=null;return{onAnchor:a=>{r.push(a);if(!n)n=anchorNames(e);const i=findNewAnchor(t,n);n.add(i);return i},setAnchors:()=>{for(const e of r){const t=i.get(e);if(typeof t==="object"&&t.anchor&&(a.isScalar(t.node)||a.isCollection(t.node))){t.node.anchor=t.anchor}else{const t=new Error("Failed to resolve repeated object (this should not happen)");t.source=e;throw t}}},sourceObjects:i}}t.anchorIsValid=anchorIsValid;t.anchorNames=anchorNames;t.createNodeAnchors=createNodeAnchors;t.findNewAnchor=findNewAnchor},3412:(e,t)=>{"use strict";function applyReviver(e,t,r,a){if(a&&typeof a==="object"){if(Array.isArray(a)){for(let t=0,r=a.length;t{"use strict";var a=r(5639);var i=r(1399);var n=r(9338);const s="tag:yaml.org,2002:";function findTagObject(e,t,r){if(t){const e=r.filter((e=>e.tag===t));const a=e.find((e=>!e.format))??e[0];if(!a)throw new Error(`Tag ${t} not found`);return a}return r.find((t=>t.identify?.(e)&&!t.format))}function createNode(e,t,r){if(i.isDocument(e))e=e.contents;if(i.isNode(e))return e;if(i.isPair(e)){const t=r.schema[i.MAP].createNode?.(r.schema,null,r);t.items.push(e);return t}if(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt!=="undefined"&&e instanceof BigInt){e=e.valueOf()}const{aliasDuplicateObjects:o,onAnchor:p,onTagObj:c,schema:l,sourceObjects:d}=r;let u=undefined;if(o&&e&&typeof e==="object"){u=d.get(e);if(u){if(!u.anchor)u.anchor=p(e);return new a.Alias(u.anchor)}else{u={anchor:null,node:null};d.set(e,u)}}if(t?.startsWith("!!"))t=s+t.slice(2);let m=findTagObject(e,t,l.tags);if(!m){if(e&&typeof e.toJSON==="function"){e=e.toJSON()}if(!e||typeof e!=="object"){const t=new n.Scalar(e);if(u)u.node=t;return t}m=e instanceof Map?l[i.MAP]:Symbol.iterator in Object(e)?l[i.SEQ]:l[i.MAP]}if(c){c(m);delete r.onTagObj}const h=m?.createNode?m.createNode(r.schema,e,r):new n.Scalar(e);if(t)h.tag=t;if(u)u.node=h;return h}t.createNode=createNode},5400:(e,t,r)=>{"use strict";var a=r(1399);var i=r(6796);const n={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"};const escapeTagName=e=>e.replace(/[!,[\]{}]/g,(e=>n[e]));class Directives{constructor(e,t){this.docStart=null;this.docEnd=false;this.yaml=Object.assign({},Directives.defaultYaml,e);this.tags=Object.assign({},Directives.defaultTags,t)}clone(){const e=new Directives(this.yaml,this.tags);e.docStart=this.docStart;return e}atDocument(){const e=new Directives(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=true;break;case"1.2":this.atNextDocument=false;this.yaml={explicit:Directives.defaultYaml.explicit,version:"1.2"};this.tags=Object.assign({},Directives.defaultTags);break}return e}add(e,t){if(this.atNextDocument){this.yaml={explicit:Directives.defaultYaml.explicit,version:"1.1"};this.tags=Object.assign({},Directives.defaultTags);this.atNextDocument=false}const r=e.trim().split(/[ \t]+/);const a=r.shift();switch(a){case"%TAG":{if(r.length!==2){t(0,"%TAG directive should contain exactly two parts");if(r.length<2)return false}const[e,a]=r;this.tags[e]=a;return true}case"%YAML":{this.yaml.explicit=true;if(r.length!==1){t(0,"%YAML directive should contain exactly one part");return false}const[e]=r;if(e==="1.1"||e==="1.2"){this.yaml.version=e;return true}else{const r=/^\d+\.\d+$/.test(e);t(6,`Unsupported YAML version ${e}`,r);return false}}default:t(0,`Unknown directive ${a}`,true);return false}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!"){t(`Not a valid tag: ${e}`);return null}if(e[1]==="<"){const r=e.slice(2,-1);if(r==="!"||r==="!!"){t(`Verbatim tags aren't resolved, so ${e} is invalid.`);return null}if(e[e.length-1]!==">")t("Verbatim tags must end with a >");return r}const[,r,a]=e.match(/^(.*!)([^!]*)$/);if(!a)t(`The ${e} tag has no suffix`);const i=this.tags[r];if(i)return i+decodeURIComponent(a);if(r==="!")return e;t(`Could not resolve tag: ${e}`);return null}tagString(e){for(const[t,r]of Object.entries(this.tags)){if(e.startsWith(r))return t+escapeTagName(e.substring(r.length))}return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[];const r=Object.entries(this.tags);let n;if(e&&r.length>0&&a.isNode(e.contents)){const t={};i.visit(e.contents,((e,r)=>{if(a.isNode(r)&&r.tag)t[r.tag]=true}));n=Object.keys(t)}else n=[];for(const[a,i]of r){if(a==="!!"&&i==="tag:yaml.org,2002:")continue;if(!e||n.some((e=>e.startsWith(i))))t.push(`%TAG ${a} ${i}`)}return t.join("\n")}}Directives.defaultYaml={explicit:false,version:"1.2"};Directives.defaultTags={"!!":"tag:yaml.org,2002:"};t.Directives=Directives},4236:(e,t)=>{"use strict";class YAMLError extends Error{constructor(e,t,r,a){super();this.name=e;this.code=r;this.message=a;this.pos=t}}class YAMLParseError extends YAMLError{constructor(e,t,r){super("YAMLParseError",e,t,r)}}class YAMLWarning extends YAMLError{constructor(e,t,r){super("YAMLWarning",e,t,r)}}const prettifyError=(e,t)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map((e=>t.linePos(e)));const{line:a,col:i}=r.linePos[0];r.message+=` at line ${a}, column ${i}`;let n=i-1;let s=e.substring(t.lineStarts[a-1],t.lineStarts[a]).replace(/[\n\r]+$/,"");if(n>=60&&s.length>80){const e=Math.min(n-39,s.length-79);s="…"+s.substring(e);n-=e-1}if(s.length>80)s=s.substring(0,79)+"…";if(a>1&&/^ *$/.test(s.substring(0,n))){let r=e.substring(t.lineStarts[a-2],t.lineStarts[a-1]);if(r.length>80)r=r.substring(0,79)+"…\n";s=r+s}if(/[^ ]/.test(s)){let e=1;const t=r.linePos[1];if(t&&t.line===a&&t.col>i){e=Math.min(t.col-i,80-n)}const o=" ".repeat(n)+"^".repeat(e);r.message+=`:\n\n${s}\n${o}\n`}};t.YAMLError=YAMLError;t.YAMLParseError=YAMLParseError;t.YAMLWarning=YAMLWarning;t.prettifyError=prettifyError},4083:(e,t,r)=>{"use strict";var a=r(9493);var i=r(42);var n=r(6831);var s=r(4236);var o=r(5639);var p=r(1399);var c=r(246);var l=r(9338);var d=r(6011);var u=r(5161);var m=r(9169);var h=r(5976);var g=r(1929);var v=r(3328);var y=r(8649);var b=r(6796);t.Composer=a.Composer;t.Document=i.Document;t.Schema=n.Schema;t.YAMLError=s.YAMLError;t.YAMLParseError=s.YAMLParseError;t.YAMLWarning=s.YAMLWarning;t.Alias=o.Alias;t.isAlias=p.isAlias;t.isCollection=p.isCollection;t.isDocument=p.isDocument;t.isMap=p.isMap;t.isNode=p.isNode;t.isPair=p.isPair;t.isScalar=p.isScalar;t.isSeq=p.isSeq;t.Pair=c.Pair;t.Scalar=l.Scalar;t.YAMLMap=d.YAMLMap;t.YAMLSeq=u.YAMLSeq;t.CST=m;t.Lexer=h.Lexer;t.LineCounter=g.LineCounter;t.Parser=v.Parser;t.parse=y.parse;t.parseAllDocuments=y.parseAllDocuments;t.parseDocument=y.parseDocument;t.stringify=y.stringify;t.visit=b.visit;t.visitAsync=b.visitAsync},6909:(e,t)=>{"use strict";function debug(e,...t){if(e==="debug")console.log(...t)}function warn(e,t){if(e==="debug"||e==="warn"){if(typeof process!=="undefined"&&process.emitWarning)process.emitWarning(t);else console.warn(t)}}t.debug=debug;t.warn=warn},5639:(e,t,r)=>{"use strict";var a=r(8459);var i=r(6796);var n=r(1399);class Alias extends n.NodeBase{constructor(e){super(n.ALIAS);this.source=e;Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let t=undefined;i.visit(e,{Node:(e,r)=>{if(r===this)return i.visit.BREAK;if(r.anchor===this.source)t=r}});return t}toJSON(e,t){if(!t)return{source:this.source};const{anchors:r,doc:a,maxAliasCount:i}=t;const n=this.resolve(a);if(!n){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(e)}const s=r.get(n);if(!s||s.res===undefined){const e="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(e)}if(i>=0){s.count+=1;if(s.aliasCount===0)s.aliasCount=getAliasCount(a,n,r);if(s.count*s.aliasCount>i){const e="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(e)}}return s.res}toString(e,t,r){const i=`*${this.source}`;if(e){a.anchorIsValid(this.source);if(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`${i} `}return i}}function getAliasCount(e,t,r){if(n.isAlias(t)){const a=t.resolve(e);const i=r&&a&&r.get(a);return i?i.count*i.aliasCount:0}else if(n.isCollection(t)){let a=0;for(const i of t.items){const t=getAliasCount(e,i,r);if(t>a)a=t}return a}else if(n.isPair(t)){const a=getAliasCount(e,t.key,r);const i=getAliasCount(e,t.value,r);return Math.max(a,i)}return 1}t.Alias=Alias},3466:(e,t,r)=>{"use strict";var a=r(9652);var i=r(1399);function collectionFromPath(e,t,r){let i=r;for(let e=t.length-1;e>=0;--e){const r=t[e];if(typeof r==="number"&&Number.isInteger(r)&&r>=0){const e=[];e[r]=i;i=e}else{i=new Map([[r,i]])}}return a.createNode(i,undefined,{aliasDuplicateObjects:false,keepUndefined:false,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const isEmptyPath=e=>e==null||typeof e==="object"&&!!e[Symbol.iterator]().next().done;class Collection extends i.NodeBase{constructor(e,t){super(e);Object.defineProperty(this,"schema",{value:t,configurable:true,enumerable:false,writable:true})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(e)t.schema=e;t.items=t.items.map((t=>i.isNode(t)||i.isPair(t)?t.clone(e):t));if(this.range)t.range=this.range.slice();return t}addIn(e,t){if(isEmptyPath(e))this.add(t);else{const[r,...a]=e;const n=this.get(r,true);if(i.isCollection(n))n.addIn(a,t);else if(n===undefined&&this.schema)this.set(r,collectionFromPath(this.schema,a,t));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}deleteIn(e){const[t,...r]=e;if(r.length===0)return this.delete(t);const a=this.get(t,true);if(i.isCollection(a))return a.deleteIn(r);else throw new Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){const[r,...a]=e;const n=this.get(r,true);if(a.length===0)return!t&&i.isScalar(n)?n.value:n;else return i.isCollection(n)?n.getIn(a,t):undefined}hasAllNullValues(e){return this.items.every((t=>{if(!i.isPair(t))return false;const r=t.value;return r==null||e&&i.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag}))}hasIn(e){const[t,...r]=e;if(r.length===0)return this.has(t);const a=this.get(t,true);return i.isCollection(a)?a.hasIn(r):false}setIn(e,t){const[r,...a]=e;if(a.length===0){this.set(r,t)}else{const e=this.get(r,true);if(i.isCollection(e))e.setIn(a,t);else if(e===undefined&&this.schema)this.set(r,collectionFromPath(this.schema,a,t));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}}Collection.maxFlowStringSingleLineLength=60;t.Collection=Collection;t.collectionFromPath=collectionFromPath;t.isEmptyPath=isEmptyPath},1399:(e,t)=>{"use strict";const r=Symbol.for("yaml.alias");const a=Symbol.for("yaml.document");const i=Symbol.for("yaml.map");const n=Symbol.for("yaml.pair");const s=Symbol.for("yaml.scalar");const o=Symbol.for("yaml.seq");const p=Symbol.for("yaml.node.type");const isAlias=e=>!!e&&typeof e==="object"&&e[p]===r;const isDocument=e=>!!e&&typeof e==="object"&&e[p]===a;const isMap=e=>!!e&&typeof e==="object"&&e[p]===i;const isPair=e=>!!e&&typeof e==="object"&&e[p]===n;const isScalar=e=>!!e&&typeof e==="object"&&e[p]===s;const isSeq=e=>!!e&&typeof e==="object"&&e[p]===o;function isCollection(e){if(e&&typeof e==="object")switch(e[p]){case i:case o:return true}return false}function isNode(e){if(e&&typeof e==="object")switch(e[p]){case r:case i:case s:case o:return true}return false}const hasAnchor=e=>(isScalar(e)||isCollection(e))&&!!e.anchor;class NodeBase{constructor(e){Object.defineProperty(this,p,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)e.range=this.range.slice();return e}}t.ALIAS=r;t.DOC=a;t.MAP=i;t.NODE_TYPE=p;t.NodeBase=NodeBase;t.PAIR=n;t.SCALAR=s;t.SEQ=o;t.hasAnchor=hasAnchor;t.isAlias=isAlias;t.isCollection=isCollection;t.isDocument=isDocument;t.isMap=isMap;t.isNode=isNode;t.isPair=isPair;t.isScalar=isScalar;t.isSeq=isSeq},246:(e,t,r)=>{"use strict";var a=r(9652);var i=r(4875);var n=r(4676);var s=r(1399);function createPair(e,t,r){const i=a.createNode(e,undefined,r);const n=a.createNode(t,undefined,r);return new Pair(i,n)}class Pair{constructor(e,t=null){Object.defineProperty(this,s.NODE_TYPE,{value:s.PAIR});this.key=e;this.value=t}clone(e){let{key:t,value:r}=this;if(s.isNode(t))t=t.clone(e);if(s.isNode(r))r=r.clone(e);return new Pair(t,r)}toJSON(e,t){const r=t?.mapAsMap?new Map:{};return n.addPairToJSMap(t,r,this)}toString(e,t,r){return e?.doc?i.stringifyPair(this,e,t,r):JSON.stringify(this)}}t.Pair=Pair;t.createPair=createPair},9338:(e,t,r)=>{"use strict";var a=r(1399);var i=r(2463);const isScalarValue=e=>!e||typeof e!=="function"&&typeof e!=="object";class Scalar extends a.NodeBase{constructor(e){super(a.SCALAR);this.value=e}toJSON(e,t){return t?.keep?this.value:i.toJS(this.value,e,t)}toString(){return String(this.value)}}Scalar.BLOCK_FOLDED="BLOCK_FOLDED";Scalar.BLOCK_LITERAL="BLOCK_LITERAL";Scalar.PLAIN="PLAIN";Scalar.QUOTE_DOUBLE="QUOTE_DOUBLE";Scalar.QUOTE_SINGLE="QUOTE_SINGLE";t.Scalar=Scalar;t.isScalarValue=isScalarValue},6011:(e,t,r)=>{"use strict";var a=r(2466);var i=r(4676);var n=r(3466);var s=r(1399);var o=r(246);var p=r(9338);function findPair(e,t){const r=s.isScalar(t)?t.value:t;for(const a of e){if(s.isPair(a)){if(a.key===t||a.key===r)return a;if(s.isScalar(a.key)&&a.key.value===r)return a}}return undefined}class YAMLMap extends n.Collection{constructor(e){super(s.MAP,e);this.items=[]}static get tagName(){return"tag:yaml.org,2002:map"}add(e,t){let r;if(s.isPair(e))r=e;else if(!e||typeof e!=="object"||!("key"in e)){r=new o.Pair(e,e?.value)}else r=new o.Pair(e.key,e.value);const a=findPair(this.items,r.key);const i=this.schema?.sortMapEntries;if(a){if(!t)throw new Error(`Key ${r.key} already set`);if(s.isScalar(a.value)&&p.isScalarValue(r.value))a.value.value=r.value;else a.value=r.value}else if(i){const e=this.items.findIndex((e=>i(r,e)<0));if(e===-1)this.items.push(r);else this.items.splice(e,0,r)}else{this.items.push(r)}}delete(e){const t=findPair(this.items,e);if(!t)return false;const r=this.items.splice(this.items.indexOf(t),1);return r.length>0}get(e,t){const r=findPair(this.items,e);const a=r?.value;return(!t&&s.isScalar(a)?a.value:a)??undefined}has(e){return!!findPair(this.items,e)}set(e,t){this.add(new o.Pair(e,t),true)}toJSON(e,t,r){const a=r?new r:t?.mapAsMap?new Map:{};if(t?.onCreate)t.onCreate(a);for(const e of this.items)i.addPairToJSMap(t,a,e);return a}toString(e,t,r){if(!e)return JSON.stringify(this);for(const e of this.items){if(!s.isPair(e))throw new Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`)}if(!e.allNullValues&&this.hasAllNullValues(false))e=Object.assign({},e,{allNullValues:true});return a.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:t})}}t.YAMLMap=YAMLMap;t.findPair=findPair},5161:(e,t,r)=>{"use strict";var a=r(2466);var i=r(3466);var n=r(1399);var s=r(9338);var o=r(2463);class YAMLSeq extends i.Collection{constructor(e){super(n.SEQ,e);this.items=[]}static get tagName(){return"tag:yaml.org,2002:seq"}add(e){this.items.push(e)}delete(e){const t=asItemIndex(e);if(typeof t!=="number")return false;const r=this.items.splice(t,1);return r.length>0}get(e,t){const r=asItemIndex(e);if(typeof r!=="number")return undefined;const a=this.items[r];return!t&&n.isScalar(a)?a.value:a}has(e){const t=asItemIndex(e);return typeof t==="number"&&t=0?t:null}t.YAMLSeq=YAMLSeq},4676:(e,t,r)=>{"use strict";var a=r(6909);var i=r(8409);var n=r(1399);var s=r(9338);var o=r(2463);const p="<<";function addPairToJSMap(e,t,{key:r,value:a}){if(e?.doc.schema.merge&&isMergeKey(r)){a=n.isAlias(a)?a.resolve(e.doc):a;if(n.isSeq(a))for(const r of a.items)mergeToJSMap(e,t,r);else if(Array.isArray(a))for(const r of a)mergeToJSMap(e,t,r);else mergeToJSMap(e,t,a)}else{const i=o.toJS(r,"",e);if(t instanceof Map){t.set(i,o.toJS(a,i,e))}else if(t instanceof Set){t.add(i)}else{const n=stringifyKey(r,i,e);const s=o.toJS(a,n,e);if(n in t)Object.defineProperty(t,n,{value:s,writable:true,enumerable:true,configurable:true});else t[n]=s}}return t}const isMergeKey=e=>e===p||n.isScalar(e)&&e.value===p&&(!e.type||e.type===s.Scalar.PLAIN);function mergeToJSMap(e,t,r){const a=e&&n.isAlias(r)?r.resolve(e.doc):r;if(!n.isMap(a))throw new Error("Merge sources must be maps or map aliases");const i=a.toJSON(null,e,Map);for(const[e,r]of i){if(t instanceof Map){if(!t.has(e))t.set(e,r)}else if(t instanceof Set){t.add(e)}else if(!Object.prototype.hasOwnProperty.call(t,e)){Object.defineProperty(t,e,{value:r,writable:true,enumerable:true,configurable:true})}}return t}function stringifyKey(e,t,r){if(t===null)return"";if(typeof t!=="object")return String(t);if(n.isNode(e)&&r&&r.doc){const t=i.createStringifyContext(r.doc,{});t.anchors=new Set;for(const e of r.anchors.keys())t.anchors.add(e.anchor);t.inFlow=true;t.inStringifyKey=true;const n=e.toString(t);if(!r.mapKeyWarned){let e=JSON.stringify(n);if(e.length>40)e=e.substring(0,36)+'..."';a.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`);r.mapKeyWarned=true}return n}return JSON.stringify(t)}t.addPairToJSMap=addPairToJSMap},2463:(e,t,r)=>{"use strict";var a=r(1399);function toJS(e,t,r){if(Array.isArray(e))return e.map(((e,t)=>toJS(e,String(t),r)));if(e&&typeof e.toJSON==="function"){if(!r||!a.hasAnchor(e))return e.toJSON(t,r);const i={aliasCount:0,count:1,res:undefined};r.anchors.set(e,i);r.onCreate=e=>{i.res=e;delete r.onCreate};const n=e.toJSON(t,r);if(r.onCreate)r.onCreate(n);return n}if(typeof e==="bigint"&&!r?.keep)return Number(e);return e}t.toJS=toJS},9027:(e,t,r)=>{"use strict";var a=r(9485);var i=r(7578);var n=r(4236);var s=r(6226);function resolveAsScalar(e,t=true,r){if(e){const _onError=(e,t,a)=>{const i=typeof e==="number"?e:Array.isArray(e)?e[0]:e.offset;if(r)r(i,t,a);else throw new n.YAMLParseError([i,i+1],t,a)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return i.resolveFlowScalar(e,t,_onError);case"block-scalar":return a.resolveBlockScalar(e,t,_onError)}}return null}function createScalarToken(e,t){const{implicitKey:r=false,indent:a,inFlow:i=false,offset:n=-1,type:o="PLAIN"}=t;const p=s.stringifyString({type:o,value:e},{implicitKey:r,indent:a>0?" ".repeat(a):"",inFlow:i,options:{blockQuote:true,lineWidth:-1}});const c=t.end??[{type:"newline",offset:-1,indent:a,source:"\n"}];switch(p[0]){case"|":case">":{const e=p.indexOf("\n");const t=p.substring(0,e);const r=p.substring(e+1)+"\n";const i=[{type:"block-scalar-header",offset:n,indent:a,source:t}];if(!addEndtoBlockProps(i,c))i.push({type:"newline",offset:-1,indent:a,source:"\n"});return{type:"block-scalar",offset:n,indent:a,props:i,source:r}}case'"':return{type:"double-quoted-scalar",offset:n,indent:a,source:p,end:c};case"'":return{type:"single-quoted-scalar",offset:n,indent:a,source:p,end:c};default:return{type:"scalar",offset:n,indent:a,source:p,end:c}}}function setScalarValue(e,t,r={}){let{afterKey:a=false,implicitKey:i=false,inFlow:n=false,type:o}=r;let p="indent"in e?e.indent:null;if(a&&typeof p==="number")p+=2;if(!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(t.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=t.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}const c=s.stringifyString({type:o,value:t},{implicitKey:i||p===null,indent:p!==null&&p>0?" ".repeat(p):"",inFlow:n,options:{blockQuote:true,lineWidth:-1}});switch(c[0]){case"|":case">":setBlockScalarValue(e,c);break;case'"':setFlowScalarValue(e,c,"double-quoted-scalar");break;case"'":setFlowScalarValue(e,c,"single-quoted-scalar");break;default:setFlowScalarValue(e,c,"scalar")}}function setBlockScalarValue(e,t){const r=t.indexOf("\n");const a=t.substring(0,r);const i=t.substring(r+1)+"\n";if(e.type==="block-scalar"){const t=e.props[0];if(t.type!=="block-scalar-header")throw new Error("Invalid block scalar header");t.source=a;e.source=i}else{const{offset:t}=e;const r="indent"in e?e.indent:-1;const n=[{type:"block-scalar-header",offset:t,indent:r,source:a}];if(!addEndtoBlockProps(n,"end"in e?e.end:undefined))n.push({type:"newline",offset:-1,indent:r,source:"\n"});for(const t of Object.keys(e))if(t!=="type"&&t!=="offset")delete e[t];Object.assign(e,{type:"block-scalar",indent:r,props:n,source:i})}}function addEndtoBlockProps(e,t){if(t)for(const r of t)switch(r.type){case"space":case"comment":e.push(r);break;case"newline":e.push(r);return true}return false}function setFlowScalarValue(e,t,r){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=r;e.source=t;break;case"block-scalar":{const a=e.props.slice(1);let i=t.length;if(e.props[0].type==="block-scalar-header")i-=e.props[0].source.length;for(const e of a)e.offset+=i;delete e.props;Object.assign(e,{type:r,source:t,end:a});break}case"block-map":case"block-seq":{const a=e.offset+t.length;const i={type:"newline",offset:a,indent:e.indent,source:"\n"};delete e.items;Object.assign(e,{type:r,source:t,end:[i]});break}default:{const a="indent"in e?e.indent:-1;const i="end"in e&&Array.isArray(e.end)?e.end.filter((e=>e.type==="space"||e.type==="comment"||e.type==="newline")):[];for(const t of Object.keys(e))if(t!=="type"&&t!=="offset")delete e[t];Object.assign(e,{type:r,indent:a,source:t,end:i})}}}t.createScalarToken=createScalarToken;t.resolveAsScalar=resolveAsScalar;t.setScalarValue=setScalarValue},6307:(e,t)=>{"use strict";const stringify=e=>"type"in e?stringifyToken(e):stringifyItem(e);function stringifyToken(e){switch(e.type){case"block-scalar":{let t="";for(const r of e.props)t+=stringifyToken(r);return t+e.source}case"block-map":case"block-seq":{let t="";for(const r of e.items)t+=stringifyItem(r);return t}case"flow-collection":{let t=e.start.source;for(const r of e.items)t+=stringifyItem(r);for(const r of e.end)t+=r.source;return t}case"document":{let t=stringifyItem(e);if(e.end)for(const r of e.end)t+=r.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const r of e.end)t+=r.source;return t}}}function stringifyItem({start:e,key:t,sep:r,value:a}){let i="";for(const t of e)i+=t.source;if(t)i+=stringifyToken(t);if(r)for(const e of r)i+=e.source;if(a)i+=stringifyToken(a);return i}t.stringify=stringify},8497:(e,t)=>{"use strict";const r=Symbol("break visit");const a=Symbol("skip children");const i=Symbol("remove item");function visit(e,t){if("type"in e&&e.type==="document")e={start:e.start,value:e.value};_visit(Object.freeze([]),e,t)}visit.BREAK=r;visit.SKIP=a;visit.REMOVE=i;visit.itemAtPath=(e,t)=>{let r=e;for(const[e,a]of t){const t=r?.[e];if(t&&"items"in t){r=t.items[a]}else return undefined}return r};visit.parentCollection=(e,t)=>{const r=visit.itemAtPath(e,t.slice(0,-1));const a=t[t.length-1][0];const i=r?.[a];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function _visit(e,t,a){let n=a(t,e);if(typeof n==="symbol")return n;for(const s of["key","value"]){const o=t[s];if(o&&"items"in o){for(let t=0;t{"use strict";var a=r(9027);var i=r(6307);var n=r(8497);const s="\ufeff";const o="";const p="";const c="";const isCollection=e=>!!e&&"items"in e;const isScalar=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function prettyToken(e){switch(e){case s:return"";case o:return"";case p:return"";case c:return"";default:return JSON.stringify(e)}}function tokenType(e){switch(e){case s:return"byte-order-mark";case o:return"doc-mode";case p:return"flow-error-end";case c: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}t.createScalarToken=a.createScalarToken;t.resolveAsScalar=a.resolveAsScalar;t.setScalarValue=a.setScalarValue;t.stringify=i.stringify;t.visit=n.visit;t.BOM=s;t.DOCUMENT=o;t.FLOW_END=p;t.SCALAR=c;t.isCollection=isCollection;t.isScalar=isScalar;t.prettyToken=prettyToken;t.tokenType=tokenType},5976:(e,t,r)=>{"use strict";var a=r(9169);function isEmpty(e){switch(e){case undefined:case" ":case"\n":case"\r":case"\t":return true;default:return false}}const i="0123456789ABCDEFabcdef".split("");const n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()".split("");const s=",[]{}".split("");const o=" ,[]{}\n\r\t".split("");const isNotAnchorChar=e=>!e||o.includes(e);class Lexer{constructor(){this.atEnd=false;this.blockScalarIndent=-1;this.blockScalarKeep=false;this.buffer="";this.flowKey=false;this.flowLevel=0;this.indentNext=0;this.indentValue=0;this.lineEndPos=null;this.next=null;this.pos=0}*lex(e,t=false){if(e){this.buffer=this.buffer?this.buffer+e:e;this.lineEndPos=null}this.atEnd=!t;let r=this.next??"stream";while(r&&(t||this.hasChars(1)))r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos;let t=this.buffer[e];while(t===" "||t==="\t")t=this.buffer[++e];if(!t||t==="#"||t==="\n")return true;if(t==="\r")return this.buffer[e+1]==="\n";return false}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let r=0;while(t===" ")t=this.buffer[++r+e];if(t==="\r"){const t=this.buffer[r+e+1];if(t==="\n"||!t&&!this.atEnd)return e+r+1}return t==="\n"||r>=this.indentNext||!t&&!this.atEnd?e+r:-1}if(t==="-"||t==="."){const t=this.buffer.substr(e,3);if((t==="---"||t==="...")&&isEmpty(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;if(typeof e!=="number"||e!==-1&ðis.indentValue&&!isEmpty(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&isEmpty(t)){const e=(yield*this.pushCount(1))+(yield*this.pushSpaces(true));this.indentNext=this.indentValue+1;this.indentValue+=e;return yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(true);const e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case undefined:yield*this.pushNewline();return yield*this.parseLineStart();case"{":case"[":yield*this.pushCount(1);this.flowKey=false;this.flowLevel=1;return"flow";case"}":case"]":yield*this.pushCount(1);return"doc";case"*":yield*this.pushUntil(isNotAnchorChar);return"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":t+=(yield*this.parseBlockScalarHeader());t+=(yield*this.pushSpaces(true));yield*this.pushCount(e.length-t);yield*this.pushNewline();return yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t;let r=-1;do{e=yield*this.pushNewline();if(e>0){t=yield*this.pushSpaces(false);this.indentValue=r=t}else{t=0}t+=(yield*this.pushSpaces(true))}while(e+t>0);const i=this.getLine();if(i===null)return this.setNext("flow");if(r!==-1&&r"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil((e=>isEmpty(e)||e==="#"))}*parseBlockScalar(){let e=this.pos-1;let t=0;let r;e:for(let a=this.pos;r=this.buffer[a];++a){switch(r){case" ":t+=1;break;case"\n":e=a;t=0;break;case"\r":{const e=this.buffer[a+1];if(!e&&!this.atEnd)return this.setNext("block-scalar");if(e==="\n")break}default:break e}}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=t;else this.indentNext+=this.blockScalarIndent;do{const t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf("\n",t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}if(!this.blockScalarKeep){do{let r=e-1;let a=this.buffer[r];if(a==="\r")a=this.buffer[--r];const i=r;while(a===" "||a==="\t")a=this.buffer[--r];if(a==="\n"&&r>=this.pos&&r+1+t>i)e=r;else break}while(true)}yield a.SCALAR;yield*this.pushToIndex(e+1,true);return yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t=this.pos-1;let r=this.pos-1;let i;while(i=this.buffer[++r]){if(i===":"){const a=this.buffer[r+1];if(isEmpty(a)||e&&a===",")break;t=r}else if(isEmpty(i)){let a=this.buffer[r+1];if(i==="\r"){if(a==="\n"){r+=1;i="\n";a=this.buffer[r+1]}else t=r}if(a==="#"||e&&s.includes(a))break;if(i==="\n"){const e=this.continueScalar(r+1);if(e===-1)break;r=Math.max(r,e-2)}}else{if(e&&s.includes(i))break;t=r}}if(!i&&!this.atEnd)return this.setNext("plain-scalar");yield a.SCALAR;yield*this.pushToIndex(t+1,true);return e?"flow":"doc"}*pushCount(e){if(e>0){yield this.buffer.substr(this.pos,e);this.pos+=e;return e}return 0}*pushToIndex(e,t){const r=this.buffer.slice(this.pos,e);if(r){yield r;this.pos+=r.length;return r.length}else if(t)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(true))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(isNotAnchorChar))+(yield*this.pushSpaces(true))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0;const t=this.charAt(1);if(isEmpty(t)||e&&s.includes(t)){if(!e)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=false;return(yield*this.pushCount(1))+(yield*this.pushSpaces(true))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2;let t=this.buffer[e];while(!isEmpty(t)&&t!==">")t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,false)}else{let e=this.pos+1;let t=this.buffer[e];while(t){if(n.includes(t))t=this.buffer[++e];else if(t==="%"&&i.includes(this.buffer[e+1])&&i.includes(this.buffer[e+2])){t=this.buffer[e+=3]}else break}return yield*this.pushToIndex(e,false)}}*pushNewline(){const e=this.buffer[this.pos];if(e==="\n")return yield*this.pushCount(1);else if(e==="\r"&&this.charAt(1)==="\n")return yield*this.pushCount(2);else return 0}*pushSpaces(e){let t=this.pos-1;let r;do{r=this.buffer[++t]}while(r===" "||e&&r==="\t");const a=t-this.pos;if(a>0){yield this.buffer.substr(this.pos,a);this.pos=t}return a}*pushUntil(e){let t=this.pos;let r=this.buffer[t];while(!e(r))r=this.buffer[++t];return yield*this.pushToIndex(t,false)}}t.Lexer=Lexer},1929:(e,t)=>{"use strict";class LineCounter{constructor(){this.lineStarts=[];this.addNewLine=e=>this.lineStarts.push(e);this.linePos=e=>{let t=0;let r=this.lineStarts.length;while(t>1;if(this.lineStarts[a]