@certd/pipeline 1.1.3 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.1.5](https://github.com/certd/certd/compare/v1.1.4...v1.1.5) (2023-07-03)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @certd/pipeline
|
|
9
|
+
|
|
10
|
+
## [1.1.4](https://github.com/certd/certd/compare/v1.1.3...v1.1.4) (2023-07-03)
|
|
11
|
+
|
|
12
|
+
### Performance Improvements
|
|
13
|
+
|
|
14
|
+
* cancel task ([bc65c0a](https://github.com/certd/certd/commit/bc65c0a786360c087fe95cad93ec6a87804cc5ee))
|
|
15
|
+
* flush log ([891a43a](https://github.com/certd/certd/commit/891a43ae6716ff98ed06643f7da2e35199ee195c))
|
|
16
|
+
* flush logger ([91be682](https://github.com/certd/certd/commit/91be6826b902e0f302b1a6cbdb1d24e15914c18d))
|
|
17
|
+
* timeout ([3eeb1f7](https://github.com/certd/certd/commit/3eeb1f77aa2922f3545f3d2067f561d95621d54f))
|
|
18
|
+
|
|
6
19
|
## [1.1.3](https://github.com/certd/certd/compare/v1.1.2...v1.1.3) (2023-07-03)
|
|
7
20
|
|
|
8
21
|
**Note:** Version bump only for package @certd/pipeline
|
package/dist/bundle.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";var e,n,t,i,a,o=require("util"),s=require("lodash"),r=require("tty"),c=require("fs"),p=require("os"),l=require("path"),u=require("url"),d=require("constants"),m=require("stream"),f=require("assert"),h=require("zlib"),x=require("net"),v=require("http"),y=require("https"),g=require("events"),b=require("dayjs");exports.RunStrategy=void 0,(e=exports.RunStrategy||(exports.RunStrategy={}))[e.AlwaysRun=0]="AlwaysRun",e[e.SkipWhenSucceed=1]="SkipWhenSucceed",exports.ConcurrencyStrategy=void 0,(n=exports.ConcurrencyStrategy||(exports.ConcurrencyStrategy={}))[n.Serial=0]="Serial",n[n.Parallel=1]="Parallel",exports.NextStrategy=void 0,(t=exports.NextStrategy||(exports.NextStrategy={}))[t.AllSuccess=0]="AllSuccess",t[t.OneSuccess=1]="OneSuccess",exports.HandlerType=void 0,(i=exports.HandlerType||(exports.HandlerType={}))[i.ClearFollowStatus=0]="ClearFollowStatus",i[i.SendEmail=1]="SendEmail",exports.ResultType=void 0,(a=exports.ResultType||(exports.ResultType={})).start="start",a.success="success",a.error="error",a.skip="skip",a.none="none";var w,S,k,E,j,_="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},O={},T={},F={get exports(){return T},set exports(e){T=e}};function A(){if(S)return w;S=1;var e=1e3,n=60*e,t=60*n,i=24*t,a=7*i,o=365.25*i;function s(e,n,t,i){var a=n>=1.5*t;return Math.round(e/t)+" "+i+(a?"s":"")}return w=function(r,c){c=c||{};var p=typeof r;if("string"===p&&r.length>0)return function(s){if((s=String(s)).length>100)return;var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(s);if(!r)return;var c=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*a;case"days":case"day":case"d":return c*i;case"hours":case"hour":case"hrs":case"hr":case"h":return c*t;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(r);if("number"===p&&isFinite(r))return c.long?function(a){var o=Math.abs(a);if(o>=i)return s(a,o,i,"day");if(o>=t)return s(a,o,t,"hour");if(o>=n)return s(a,o,n,"minute");if(o>=e)return s(a,o,e,"second");return a+" ms"}(r):function(a){var o=Math.abs(a);if(o>=i)return Math.round(a/i)+"d";if(o>=t)return Math.round(a/t)+"h";if(o>=n)return Math.round(a/n)+"m";if(o>=e)return Math.round(a/e)+"s";return a+"ms"}(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))}}function C(){if(E)return k;return E=1,k=function(e){function n(e){let i,a,o,s=null;function r(...e){if(!r.enabled)return;const t=r,a=Number(new Date),o=a-(i||a);t.diff=o,t.prev=i,t.curr=a,i=a,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((i,a)=>{if("%%"===i)return"%";s++;const o=n.formatters[a];if("function"==typeof o){const n=e[s];i=o.call(t,n),e.splice(s,1),s--}return i})),n.formatArgs.call(t,e);(t.log||n.log).apply(t,e)}return r.namespace=e,r.useColors=n.useColors(),r.color=n.selectColor(e),r.extend=t,r.destroy=n.destroy,Object.defineProperty(r,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o),set:e=>{s=e}}),"function"==typeof n.init&&n.init(r),r}function t(e,t){const i=n(this.namespace+(void 0===t?":":t)+e);return i.log=this.log,i}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},n.disable=function(){const e=[...n.names.map(i),...n.skips.map(i).map((e=>"-"+e))].join(",");return n.enable(""),e},n.enable=function(e){let t;n.save(e),n.namespaces=e,n.names=[],n.skips=[];const i=("string"==typeof e?e:"").split(/[\s,]+/),a=i.length;for(t=0;t<a;t++)i[t]&&("-"===(e=i[t].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+e.slice(1)+"$")):n.names.push(new RegExp("^"+e+"$")))},n.enabled=function(e){if("*"===e[e.length-1])return!0;let t,i;for(t=0,i=n.skips.length;t<i;t++)if(n.skips[t].test(e))return!1;for(t=0,i=n.names.length;t<i;t++)if(n.names[t].test(e))return!0;return!1},n.humanize=A(),n.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((t=>{n[t]=e[t]})),n.names=[],n.skips=[],n.formatters={},n.selectColor=function(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]},n.enable(n.load()),n},k}var R,P,N,L,D={},I={get exports(){return D},set exports(e){D=e}};function z(){return N||(N=1,function(e,n){const t=r,i=o;n.init=function(e){e.inspectOpts={};const t=Object.keys(n.inspectOpts);for(let i=0;i<t.length;i++)e.inspectOpts[t[i]]=n.inspectOpts[t[i]]},n.log=function(...e){return process.stderr.write(i.format(...e)+"\n")},n.formatArgs=function(t){const{namespace:i,useColors:a}=this;if(a){const n=this.color,a="[3"+(n<8?n:"8;5;"+n),o=` ${a};1m${i} [0m`;t[0]=o+t[0].split("\n").join("\n"+o),t.push(a+"m+"+e.exports.humanize(this.diff)+"[0m")}else t[0]=function(){if(n.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+i+" "+t[0]},n.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},n.load=function(){return process.env.DEBUG},n.useColors=function(){return"colors"in n.inspectOpts?Boolean(n.inspectOpts.colors):t.isatty(process.stderr.fd)},n.destroy=i.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),n.colors=[6,2,3,4,5,1];try{const e=function(){if(P)return R;P=1;const e=function(){const e=/(Chrome|Chromium)\/(?<chromeVersion>\d+)\./.exec(navigator.userAgent);if(e)return Number.parseInt(e.groups.chromeVersion,10)}()>=69&&{level:1,hasBasic:!0,has256:!1,has16m:!1};return R={stdout:e,stderr:e}}();e&&(e.stderr||e).level>=2&&(n.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}n.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,n)=>{const t=n.substring(6).toLowerCase().replace(/_([a-z])/g,((e,n)=>n.toUpperCase()));let i=process.env[n];return i=!!/^(yes|on|true|enabled)$/i.test(i)||!/^(no|off|false|disabled)$/i.test(i)&&("null"===i?null:Number(i)),e[t]=i,e}),{}),e.exports=C()(n);const{formatters:a}=e.exports;a.o=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},a.O=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts)}}(I,D)),D}L={get exports(){return O},set exports(e){O=e}},"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?L.exports=(j||(j=1,function(e,n){n.formatArgs=function(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const t="color: "+this.color;n.splice(1,0,t,"color: inherit");let i=0,a=0;n[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(i++,"%c"===e&&(a=i))})),n.splice(a,0,t)},n.save=function(e){try{e?n.storage.setItem("debug",e):n.storage.removeItem("debug")}catch(e){}},n.load=function(){let e;try{e=n.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},n.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},n.storage=function(){try{return localStorage}catch(e){}}(),n.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],n.log=console.debug||console.log||(()=>{}),e.exports=C()(n);const{formatters:t}=e.exports;t.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(F,T)),T):L.exports=z();var M=function(e){return(e=e||{}).circles?function(e){var n=[],t=[];return e.proto?function e(a){if("object"!=typeof a||null===a)return a;if(a instanceof Date)return new Date(a);if(Array.isArray(a))return i(a,e);if(a instanceof Map)return new Map(i(Array.from(a),e));if(a instanceof Set)return new Set(i(Array.from(a),e));var o={};for(var s in n.push(a),t.push(o),a){var r=a[s];if("object"!=typeof r||null===r)o[s]=r;else if(r instanceof Date)o[s]=new Date(r);else if(r instanceof Map)o[s]=new Map(i(Array.from(r),e));else if(r instanceof Set)o[s]=new Set(i(Array.from(r),e));else if(ArrayBuffer.isView(r))o[s]=B(r);else{var c=n.indexOf(r);o[s]=-1!==c?t[c]:e(r)}}return n.pop(),t.pop(),o}:function e(a){if("object"!=typeof a||null===a)return a;if(a instanceof Date)return new Date(a);if(Array.isArray(a))return i(a,e);if(a instanceof Map)return new Map(i(Array.from(a),e));if(a instanceof Set)return new Set(i(Array.from(a),e));var o={};for(var s in n.push(a),t.push(o),a)if(!1!==Object.hasOwnProperty.call(a,s)){var r=a[s];if("object"!=typeof r||null===r)o[s]=r;else if(r instanceof Date)o[s]=new Date(r);else if(r instanceof Map)o[s]=new Map(i(Array.from(r),e));else if(r instanceof Set)o[s]=new Set(i(Array.from(r),e));else if(ArrayBuffer.isView(r))o[s]=B(r);else{var c=n.indexOf(r);o[s]=-1!==c?t[c]:e(r)}}return n.pop(),t.pop(),o};function i(e,i){for(var a=Object.keys(e),o=new Array(a.length),s=0;s<a.length;s++){var r=a[s],c=e[r];if("object"!=typeof c||null===c)o[r]=c;else if(c instanceof Date)o[r]=new Date(c);else if(ArrayBuffer.isView(c))o[r]=B(c);else{var p=n.indexOf(c);o[r]=-1!==p?t[p]:i(c)}}return o}}(e):e.proto?function e(t){if("object"!=typeof t||null===t)return t;if(t instanceof Date)return new Date(t);if(Array.isArray(t))return n(t,e);if(t instanceof Map)return new Map(n(Array.from(t),e));if(t instanceof Set)return new Set(n(Array.from(t),e));var i={};for(var a in t){var o=t[a];"object"!=typeof o||null===o?i[a]=o:o instanceof Date?i[a]=new Date(o):o instanceof Map?i[a]=new Map(n(Array.from(o),e)):o instanceof Set?i[a]=new Set(n(Array.from(o),e)):ArrayBuffer.isView(o)?i[a]=B(o):i[a]=e(o)}return i}:t;function n(e,n){for(var t=Object.keys(e),i=new Array(t.length),a=0;a<t.length;a++){var o=t[a],s=e[o];"object"!=typeof s||null===s?i[o]=s:s instanceof Date?i[o]=new Date(s):ArrayBuffer.isView(s)?i[o]=B(s):i[o]=n(s)}return i}function t(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return n(e,t);if(e instanceof Map)return new Map(n(Array.from(e),t));if(e instanceof Set)return new Set(n(Array.from(e),t));var i={};for(var a in e)if(!1!==Object.hasOwnProperty.call(e,a)){var o=e[a];"object"!=typeof o||null===o?i[a]=o:o instanceof Date?i[a]=new Date(o):o instanceof Map?i[a]=new Map(n(Array.from(o),t)):o instanceof Set?i[a]=new Set(n(Array.from(o),t)):ArrayBuffer.isView(o)?i[a]=B(o):i[a]=t(o)}return i}};function B(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const U=o,$=O("log4js:configuration"),q=[],W=[],H=e=>!e,J=e=>e&&"object"==typeof e&&!Array.isArray(e),K=(e,n,t)=>{(Array.isArray(n)?n:[n]).forEach((n=>{if(n)throw new Error(`Problem with log4js configuration: (${U.inspect(e,{depth:5})}) - ${t}`)}))};var G={configure:e=>{$("New configuration to be validated: ",e),K(e,H(J(e)),"must be an object."),$(`Calling pre-processing listeners (${q.length})`),q.forEach((n=>n(e))),$("Configuration pre-processing finished."),$(`Calling configuration listeners (${W.length})`),W.forEach((n=>n(e))),$("Configuration finished.")},addListener:e=>{W.push(e),$(`Added listener, now ${W.length} listeners`)},addPreProcessingListener:e=>{q.push(e),$(`Added pre-processing listener, now ${q.length} listeners`)},throwExceptionIf:K,anObject:J,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:H},V={};!function(e){function n(e,n){for(var t=e.toString();t.length<n;)t="0"+t;return t}function t(e){return n(e,2)}function i(i,a){"string"!=typeof i&&(a=i,i=e.exports.ISO8601_FORMAT),a||(a=e.exports.now());var o=t(a.getDate()),s=t(a.getMonth()+1),r=t(a.getFullYear()),c=t(r.substring(2,4)),p=i.indexOf("yyyy")>-1?r:c,l=t(a.getHours()),u=t(a.getMinutes()),d=t(a.getSeconds()),m=n(a.getMilliseconds(),3),f=function(e){var n=Math.abs(e),t=String(Math.floor(n/60)),i=String(n%60);return t=("0"+t).slice(-2),i=("0"+i).slice(-2),0===e?"Z":(e<0?"+":"-")+t+":"+i}(a.getTimezoneOffset());return i.replace(/dd/g,o).replace(/MM/g,s).replace(/y{1,4}/g,p).replace(/hh/g,l).replace(/mm/g,u).replace(/ss/g,d).replace(/SSS/g,m).replace(/O/g,f)}function a(e,n,t,i){e["set"+(i?"":"UTC")+n](t)}e.exports=i,e.exports.asString=i,e.exports.parse=function(n,t,i){if(!n)throw new Error("pattern must be supplied");return function(n,t,i){var o=n.indexOf("O")<0,s=!1,r=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,n){a(e,"FullYear",n,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,n){a(e,"Month",n-1,o),e.getMonth()!==n-1&&(s=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,n){s&&a(e,"Month",e.getMonth()-1,o),a(e,"Date",n,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,n){a(e,"Hours",n,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,n){a(e,"Minutes",n,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,n){a(e,"Seconds",n,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,n){a(e,"Milliseconds",n,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,n){n="Z"===n?0:n.replace(":","");var t=Math.abs(n),i=(n>0?-1:1)*(t%100+60*Math.floor(t/100));e.setUTCMinutes(e.getUTCMinutes()+i)}}],c=r.reduce((function(e,n){return n.pattern.test(e.regexp)?(n.index=e.regexp.match(n.pattern).index,e.regexp=e.regexp.replace(n.pattern,"("+n.regexp+")")):n.index=-1,e}),{regexp:n,index:[]}),p=r.filter((function(e){return e.index>-1}));p.sort((function(e,n){return e.index-n.index}));var l=new RegExp(c.regexp).exec(t);if(l){var u=i||e.exports.now();return p.forEach((function(e,n){e.fn(u,l[n+1])})),u}throw new Error("String '"+t+"' could not be parsed as '"+n+"'")}(n,t,i)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}({get exports(){return V},set exports(e){V=e}});const Y=V,X=p,Q=o,Z=l,ee=u,ne=O("log4js:layouts"),te={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function ie(e){return e?`[${te[e][0]}m`:""}function ae(e){return e?`[${te[e][1]}m`:""}function oe(e,n){return t=Q.format("[%s] [%s] %s - ",Y.asString(e.startTime),e.level.toString(),e.categoryName),ie(i=n)+t+ae(i);var t,i}function se(e){return oe(e)+Q.format(...e.data)}function re(e){return oe(e,e.level.colour)+Q.format(...e.data)}function ce(e){return Q.format(...e.data)}function pe(e){return e.data[0]}function le(e,n){const t=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function i(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const a={c:function(e,n){let t=e.categoryName;if(n){const e=parseInt(n,10),i=t.split(".");e<i.length&&(t=i.slice(i.length-e).join("."))}return t},d:function(e,n){let t=Y.ISO8601_FORMAT;if(n)switch(t=n,t){case"ISO8601":case"ISO8601_FORMAT":t=Y.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":t=Y.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ne("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":t=Y.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ne("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":t=Y.DATETIME_FORMAT}return Y.asString(t,e.startTime)},h:function(){return X.hostname().toString()},m:function(e,n){let t=e.data;if(n){const[e,i]=n.split(",");t=t.slice(e,i)}return Q.format(...t)},n:function(){return X.EOL},p:function(e){return e.level.toString()},r:function(e){return Y.asString("hh:mm:ss",e.startTime)},"[":function(e){return ie(e.level.colour)},"]":function(e){return ae(e.level.colour)},y:function(){return i()},z:i,"%":function(){return"%"},x:function(e,t){return void 0!==n[t]?"function"==typeof n[t]?n[t](e):n[t]:null},X:function(e,n){const t=e.context[n];return void 0!==t?"function"==typeof t?t(e):t:null},f:function(e,n){let t=e.fileName||"";if(t=function(e){const n="file://";return e.startsWith(n)&&("function"==typeof ee.fileURLToPath?e=ee.fileURLToPath(e):(e=Z.normalize(e.replace(new RegExp(`^${n}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Z.sep+Z.sep+e))),e}(t),n){const e=parseInt(n,10),i=t.split(Z.sep);i.length>e&&(t=i.slice(-e).join(Z.sep))}return t},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,n,t){return a[e](n,t)}function s(e,n,t){let i=e;return i=function(e,n){let t;return e?(t=parseInt(e.slice(1),10),t>0?n.slice(0,t):n.slice(t)):n}(n,i),i=function(e,n){let t;if(e)if("-"===e.charAt(0))for(t=parseInt(e.slice(1),10);n.length<t;)n+=" ";else for(t=parseInt(e,10);n.length<t;)n=` ${n}`;return n}(t,i),i}return function(n){let i,a="",r=e;for(;null!==(i=t.exec(r));){const e=i[1],t=i[2],c=i[3],p=i[5],l=i[6];if(l)a+=l.toString();else{a+=s(o(c,n,p),t,e)}r=r.slice(i.index+i[0].length)}return a}}const ue={messagePassThrough:()=>ce,basic:()=>se,colored:()=>re,coloured:()=>re,pattern:e=>le(e&&e.pattern,e&&e.tokens),dummy:()=>pe};var de={basicLayout:se,messagePassThroughLayout:ce,patternLayout:le,colouredLayout:re,coloredLayout:re,dummyLayout:pe,addLayout(e,n){ue[e]=n},layout:(e,n)=>ue[e]&&ue[e](n)};const me=G,fe=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class he{constructor(e,n,t){this.level=e,this.levelStr=n,this.colour=t}toString(){return this.levelStr}static getLevel(e,n){return e?e instanceof he?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),he[e.toString().toUpperCase()]||n):n}static addLevels(e){if(e){Object.keys(e).forEach((n=>{const t=n.toUpperCase();he[t]=new he(e[n].value,t,e[n].colour);const i=he.levels.findIndex((e=>e.levelStr===t));i>-1?he.levels[i]=he[t]:he.levels.push(he[t])})),he.levels.sort(((e,n)=>e.level-n.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=he.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=he.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=he.getLevel(e)),this.level===e.level}}he.levels=[],he.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),me.addListener((e=>{const n=e.levels;if(n){me.throwExceptionIf(e,me.not(me.anObject(n)),"levels must be an object");Object.keys(n).forEach((t=>{me.throwExceptionIf(e,me.not(me.validIdentifier(t)),`level name "${t}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),me.throwExceptionIf(e,me.not(me.anObject(n[t])),`level "${t}" must be an object`),me.throwExceptionIf(e,me.not(n[t].value),`level "${t}" must have a 'value' property`),me.throwExceptionIf(e,me.not(me.anInteger(n[t].value)),`level "${t}".value must have an integer value`),me.throwExceptionIf(e,me.not(n[t].colour),`level "${t}" must have a 'colour' property`),me.throwExceptionIf(e,me.not(fe.indexOf(n[t].colour)>-1),`level "${t}".colour must be one of ${fe.join(", ")}`)}))}})),me.addListener((e=>{he.addLevels(e.levels)}));var xe=he;var ve={},ye={get exports(){return ve},set exports(e){ve=e}},ge={};
|
|
1
|
+
"use strict";var e,n,t,i,a,o=require("util"),s=require("lodash"),r=require("tty"),c=require("fs"),p=require("os"),l=require("path"),u=require("url"),d=require("constants"),m=require("stream"),f=require("assert"),h=require("zlib"),x=require("net"),v=require("http"),y=require("https"),g=require("events"),b=require("dayjs");exports.RunStrategy=void 0,(e=exports.RunStrategy||(exports.RunStrategy={}))[e.AlwaysRun=0]="AlwaysRun",e[e.SkipWhenSucceed=1]="SkipWhenSucceed",exports.ConcurrencyStrategy=void 0,(n=exports.ConcurrencyStrategy||(exports.ConcurrencyStrategy={}))[n.Serial=0]="Serial",n[n.Parallel=1]="Parallel",exports.NextStrategy=void 0,(t=exports.NextStrategy||(exports.NextStrategy={}))[t.AllSuccess=0]="AllSuccess",t[t.OneSuccess=1]="OneSuccess",exports.HandlerType=void 0,(i=exports.HandlerType||(exports.HandlerType={}))[i.ClearFollowStatus=0]="ClearFollowStatus",i[i.SendEmail=1]="SendEmail",exports.ResultType=void 0,(a=exports.ResultType||(exports.ResultType={})).start="start",a.success="success",a.error="error",a.canceled="canceled",a.skip="skip",a.none="none";var w,S,k,E,j,_="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},O={},T={},F={get exports(){return T},set exports(e){T=e}};function A(){if(S)return w;S=1;var e=1e3,n=60*e,t=60*n,i=24*t,a=7*i,o=365.25*i;function s(e,n,t,i){var a=n>=1.5*t;return Math.round(e/t)+" "+i+(a?"s":"")}return w=function(r,c){c=c||{};var p=typeof r;if("string"===p&&r.length>0)return function(s){if((s=String(s)).length>100)return;var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(s);if(!r)return;var c=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*a;case"days":case"day":case"d":return c*i;case"hours":case"hour":case"hrs":case"hr":case"h":return c*t;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(r);if("number"===p&&isFinite(r))return c.long?function(a){var o=Math.abs(a);if(o>=i)return s(a,o,i,"day");if(o>=t)return s(a,o,t,"hour");if(o>=n)return s(a,o,n,"minute");if(o>=e)return s(a,o,e,"second");return a+" ms"}(r):function(a){var o=Math.abs(a);if(o>=i)return Math.round(a/i)+"d";if(o>=t)return Math.round(a/t)+"h";if(o>=n)return Math.round(a/n)+"m";if(o>=e)return Math.round(a/e)+"s";return a+"ms"}(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))}}function C(){if(E)return k;return E=1,k=function(e){function n(e){let i,a,o,s=null;function r(...e){if(!r.enabled)return;const t=r,a=Number(new Date),o=a-(i||a);t.diff=o,t.prev=i,t.curr=a,i=a,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((i,a)=>{if("%%"===i)return"%";s++;const o=n.formatters[a];if("function"==typeof o){const n=e[s];i=o.call(t,n),e.splice(s,1),s--}return i})),n.formatArgs.call(t,e);(t.log||n.log).apply(t,e)}return r.namespace=e,r.useColors=n.useColors(),r.color=n.selectColor(e),r.extend=t,r.destroy=n.destroy,Object.defineProperty(r,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o),set:e=>{s=e}}),"function"==typeof n.init&&n.init(r),r}function t(e,t){const i=n(this.namespace+(void 0===t?":":t)+e);return i.log=this.log,i}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},n.disable=function(){const e=[...n.names.map(i),...n.skips.map(i).map((e=>"-"+e))].join(",");return n.enable(""),e},n.enable=function(e){let t;n.save(e),n.namespaces=e,n.names=[],n.skips=[];const i=("string"==typeof e?e:"").split(/[\s,]+/),a=i.length;for(t=0;t<a;t++)i[t]&&("-"===(e=i[t].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+e.slice(1)+"$")):n.names.push(new RegExp("^"+e+"$")))},n.enabled=function(e){if("*"===e[e.length-1])return!0;let t,i;for(t=0,i=n.skips.length;t<i;t++)if(n.skips[t].test(e))return!1;for(t=0,i=n.names.length;t<i;t++)if(n.names[t].test(e))return!0;return!1},n.humanize=A(),n.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((t=>{n[t]=e[t]})),n.names=[],n.skips=[],n.formatters={},n.selectColor=function(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]},n.enable(n.load()),n},k}var R,P,N,L,D={},I={get exports(){return D},set exports(e){D=e}};function z(){return N||(N=1,function(e,n){const t=r,i=o;n.init=function(e){e.inspectOpts={};const t=Object.keys(n.inspectOpts);for(let i=0;i<t.length;i++)e.inspectOpts[t[i]]=n.inspectOpts[t[i]]},n.log=function(...e){return process.stderr.write(i.format(...e)+"\n")},n.formatArgs=function(t){const{namespace:i,useColors:a}=this;if(a){const n=this.color,a="[3"+(n<8?n:"8;5;"+n),o=` ${a};1m${i} [0m`;t[0]=o+t[0].split("\n").join("\n"+o),t.push(a+"m+"+e.exports.humanize(this.diff)+"[0m")}else t[0]=function(){if(n.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+i+" "+t[0]},n.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},n.load=function(){return process.env.DEBUG},n.useColors=function(){return"colors"in n.inspectOpts?Boolean(n.inspectOpts.colors):t.isatty(process.stderr.fd)},n.destroy=i.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),n.colors=[6,2,3,4,5,1];try{const e=function(){if(P)return R;P=1;const e=function(){const e=/(Chrome|Chromium)\/(?<chromeVersion>\d+)\./.exec(navigator.userAgent);if(e)return Number.parseInt(e.groups.chromeVersion,10)}()>=69&&{level:1,hasBasic:!0,has256:!1,has16m:!1};return R={stdout:e,stderr:e}}();e&&(e.stderr||e).level>=2&&(n.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}n.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,n)=>{const t=n.substring(6).toLowerCase().replace(/_([a-z])/g,((e,n)=>n.toUpperCase()));let i=process.env[n];return i=!!/^(yes|on|true|enabled)$/i.test(i)||!/^(no|off|false|disabled)$/i.test(i)&&("null"===i?null:Number(i)),e[t]=i,e}),{}),e.exports=C()(n);const{formatters:a}=e.exports;a.o=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},a.O=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts)}}(I,D)),D}L={get exports(){return O},set exports(e){O=e}},"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?L.exports=(j||(j=1,function(e,n){n.formatArgs=function(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const t="color: "+this.color;n.splice(1,0,t,"color: inherit");let i=0,a=0;n[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(i++,"%c"===e&&(a=i))})),n.splice(a,0,t)},n.save=function(e){try{e?n.storage.setItem("debug",e):n.storage.removeItem("debug")}catch(e){}},n.load=function(){let e;try{e=n.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},n.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},n.storage=function(){try{return localStorage}catch(e){}}(),n.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],n.log=console.debug||console.log||(()=>{}),e.exports=C()(n);const{formatters:t}=e.exports;t.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(F,T)),T):L.exports=z();var M=function(e){return(e=e||{}).circles?function(e){var n=[],t=[];return e.proto?function e(a){if("object"!=typeof a||null===a)return a;if(a instanceof Date)return new Date(a);if(Array.isArray(a))return i(a,e);if(a instanceof Map)return new Map(i(Array.from(a),e));if(a instanceof Set)return new Set(i(Array.from(a),e));var o={};for(var s in n.push(a),t.push(o),a){var r=a[s];if("object"!=typeof r||null===r)o[s]=r;else if(r instanceof Date)o[s]=new Date(r);else if(r instanceof Map)o[s]=new Map(i(Array.from(r),e));else if(r instanceof Set)o[s]=new Set(i(Array.from(r),e));else if(ArrayBuffer.isView(r))o[s]=B(r);else{var c=n.indexOf(r);o[s]=-1!==c?t[c]:e(r)}}return n.pop(),t.pop(),o}:function e(a){if("object"!=typeof a||null===a)return a;if(a instanceof Date)return new Date(a);if(Array.isArray(a))return i(a,e);if(a instanceof Map)return new Map(i(Array.from(a),e));if(a instanceof Set)return new Set(i(Array.from(a),e));var o={};for(var s in n.push(a),t.push(o),a)if(!1!==Object.hasOwnProperty.call(a,s)){var r=a[s];if("object"!=typeof r||null===r)o[s]=r;else if(r instanceof Date)o[s]=new Date(r);else if(r instanceof Map)o[s]=new Map(i(Array.from(r),e));else if(r instanceof Set)o[s]=new Set(i(Array.from(r),e));else if(ArrayBuffer.isView(r))o[s]=B(r);else{var c=n.indexOf(r);o[s]=-1!==c?t[c]:e(r)}}return n.pop(),t.pop(),o};function i(e,i){for(var a=Object.keys(e),o=new Array(a.length),s=0;s<a.length;s++){var r=a[s],c=e[r];if("object"!=typeof c||null===c)o[r]=c;else if(c instanceof Date)o[r]=new Date(c);else if(ArrayBuffer.isView(c))o[r]=B(c);else{var p=n.indexOf(c);o[r]=-1!==p?t[p]:i(c)}}return o}}(e):e.proto?function e(t){if("object"!=typeof t||null===t)return t;if(t instanceof Date)return new Date(t);if(Array.isArray(t))return n(t,e);if(t instanceof Map)return new Map(n(Array.from(t),e));if(t instanceof Set)return new Set(n(Array.from(t),e));var i={};for(var a in t){var o=t[a];"object"!=typeof o||null===o?i[a]=o:o instanceof Date?i[a]=new Date(o):o instanceof Map?i[a]=new Map(n(Array.from(o),e)):o instanceof Set?i[a]=new Set(n(Array.from(o),e)):ArrayBuffer.isView(o)?i[a]=B(o):i[a]=e(o)}return i}:t;function n(e,n){for(var t=Object.keys(e),i=new Array(t.length),a=0;a<t.length;a++){var o=t[a],s=e[o];"object"!=typeof s||null===s?i[o]=s:s instanceof Date?i[o]=new Date(s):ArrayBuffer.isView(s)?i[o]=B(s):i[o]=n(s)}return i}function t(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return n(e,t);if(e instanceof Map)return new Map(n(Array.from(e),t));if(e instanceof Set)return new Set(n(Array.from(e),t));var i={};for(var a in e)if(!1!==Object.hasOwnProperty.call(e,a)){var o=e[a];"object"!=typeof o||null===o?i[a]=o:o instanceof Date?i[a]=new Date(o):o instanceof Map?i[a]=new Map(n(Array.from(o),t)):o instanceof Set?i[a]=new Set(n(Array.from(o),t)):ArrayBuffer.isView(o)?i[a]=B(o):i[a]=t(o)}return i}};function B(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const U=o,$=O("log4js:configuration"),q=[],W=[],H=e=>!e,J=e=>e&&"object"==typeof e&&!Array.isArray(e),K=(e,n,t)=>{(Array.isArray(n)?n:[n]).forEach((n=>{if(n)throw new Error(`Problem with log4js configuration: (${U.inspect(e,{depth:5})}) - ${t}`)}))};var G={configure:e=>{$("New configuration to be validated: ",e),K(e,H(J(e)),"must be an object."),$(`Calling pre-processing listeners (${q.length})`),q.forEach((n=>n(e))),$("Configuration pre-processing finished."),$(`Calling configuration listeners (${W.length})`),W.forEach((n=>n(e))),$("Configuration finished.")},addListener:e=>{W.push(e),$(`Added listener, now ${W.length} listeners`)},addPreProcessingListener:e=>{q.push(e),$(`Added pre-processing listener, now ${q.length} listeners`)},throwExceptionIf:K,anObject:J,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:H},V={};!function(e){function n(e,n){for(var t=e.toString();t.length<n;)t="0"+t;return t}function t(e){return n(e,2)}function i(i,a){"string"!=typeof i&&(a=i,i=e.exports.ISO8601_FORMAT),a||(a=e.exports.now());var o=t(a.getDate()),s=t(a.getMonth()+1),r=t(a.getFullYear()),c=t(r.substring(2,4)),p=i.indexOf("yyyy")>-1?r:c,l=t(a.getHours()),u=t(a.getMinutes()),d=t(a.getSeconds()),m=n(a.getMilliseconds(),3),f=function(e){var n=Math.abs(e),t=String(Math.floor(n/60)),i=String(n%60);return t=("0"+t).slice(-2),i=("0"+i).slice(-2),0===e?"Z":(e<0?"+":"-")+t+":"+i}(a.getTimezoneOffset());return i.replace(/dd/g,o).replace(/MM/g,s).replace(/y{1,4}/g,p).replace(/hh/g,l).replace(/mm/g,u).replace(/ss/g,d).replace(/SSS/g,m).replace(/O/g,f)}function a(e,n,t,i){e["set"+(i?"":"UTC")+n](t)}e.exports=i,e.exports.asString=i,e.exports.parse=function(n,t,i){if(!n)throw new Error("pattern must be supplied");return function(n,t,i){var o=n.indexOf("O")<0,s=!1,r=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,n){a(e,"FullYear",n,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,n){a(e,"Month",n-1,o),e.getMonth()!==n-1&&(s=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,n){s&&a(e,"Month",e.getMonth()-1,o),a(e,"Date",n,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,n){a(e,"Hours",n,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,n){a(e,"Minutes",n,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,n){a(e,"Seconds",n,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,n){a(e,"Milliseconds",n,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,n){n="Z"===n?0:n.replace(":","");var t=Math.abs(n),i=(n>0?-1:1)*(t%100+60*Math.floor(t/100));e.setUTCMinutes(e.getUTCMinutes()+i)}}],c=r.reduce((function(e,n){return n.pattern.test(e.regexp)?(n.index=e.regexp.match(n.pattern).index,e.regexp=e.regexp.replace(n.pattern,"("+n.regexp+")")):n.index=-1,e}),{regexp:n,index:[]}),p=r.filter((function(e){return e.index>-1}));p.sort((function(e,n){return e.index-n.index}));var l=new RegExp(c.regexp).exec(t);if(l){var u=i||e.exports.now();return p.forEach((function(e,n){e.fn(u,l[n+1])})),u}throw new Error("String '"+t+"' could not be parsed as '"+n+"'")}(n,t,i)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}({get exports(){return V},set exports(e){V=e}});const Y=V,X=p,Q=o,Z=l,ee=u,ne=O("log4js:layouts"),te={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function ie(e){return e?`[${te[e][0]}m`:""}function ae(e){return e?`[${te[e][1]}m`:""}function oe(e,n){return t=Q.format("[%s] [%s] %s - ",Y.asString(e.startTime),e.level.toString(),e.categoryName),ie(i=n)+t+ae(i);var t,i}function se(e){return oe(e)+Q.format(...e.data)}function re(e){return oe(e,e.level.colour)+Q.format(...e.data)}function ce(e){return Q.format(...e.data)}function pe(e){return e.data[0]}function le(e,n){const t=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function i(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const a={c:function(e,n){let t=e.categoryName;if(n){const e=parseInt(n,10),i=t.split(".");e<i.length&&(t=i.slice(i.length-e).join("."))}return t},d:function(e,n){let t=Y.ISO8601_FORMAT;if(n)switch(t=n,t){case"ISO8601":case"ISO8601_FORMAT":t=Y.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":t=Y.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ne("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":t=Y.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ne("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":t=Y.DATETIME_FORMAT}return Y.asString(t,e.startTime)},h:function(){return X.hostname().toString()},m:function(e,n){let t=e.data;if(n){const[e,i]=n.split(",");t=t.slice(e,i)}return Q.format(...t)},n:function(){return X.EOL},p:function(e){return e.level.toString()},r:function(e){return Y.asString("hh:mm:ss",e.startTime)},"[":function(e){return ie(e.level.colour)},"]":function(e){return ae(e.level.colour)},y:function(){return i()},z:i,"%":function(){return"%"},x:function(e,t){return void 0!==n[t]?"function"==typeof n[t]?n[t](e):n[t]:null},X:function(e,n){const t=e.context[n];return void 0!==t?"function"==typeof t?t(e):t:null},f:function(e,n){let t=e.fileName||"";if(t=function(e){const n="file://";return e.startsWith(n)&&("function"==typeof ee.fileURLToPath?e=ee.fileURLToPath(e):(e=Z.normalize(e.replace(new RegExp(`^${n}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Z.sep+Z.sep+e))),e}(t),n){const e=parseInt(n,10),i=t.split(Z.sep);i.length>e&&(t=i.slice(-e).join(Z.sep))}return t},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,n,t){return a[e](n,t)}function s(e,n,t){let i=e;return i=function(e,n){let t;return e?(t=parseInt(e.slice(1),10),t>0?n.slice(0,t):n.slice(t)):n}(n,i),i=function(e,n){let t;if(e)if("-"===e.charAt(0))for(t=parseInt(e.slice(1),10);n.length<t;)n+=" ";else for(t=parseInt(e,10);n.length<t;)n=` ${n}`;return n}(t,i),i}return function(n){let i,a="",r=e;for(;null!==(i=t.exec(r));){const e=i[1],t=i[2],c=i[3],p=i[5],l=i[6];if(l)a+=l.toString();else{a+=s(o(c,n,p),t,e)}r=r.slice(i.index+i[0].length)}return a}}const ue={messagePassThrough:()=>ce,basic:()=>se,colored:()=>re,coloured:()=>re,pattern:e=>le(e&&e.pattern,e&&e.tokens),dummy:()=>pe};var de={basicLayout:se,messagePassThroughLayout:ce,patternLayout:le,colouredLayout:re,coloredLayout:re,dummyLayout:pe,addLayout(e,n){ue[e]=n},layout:(e,n)=>ue[e]&&ue[e](n)};const me=G,fe=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class he{constructor(e,n,t){this.level=e,this.levelStr=n,this.colour=t}toString(){return this.levelStr}static getLevel(e,n){return e?e instanceof he?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),he[e.toString().toUpperCase()]||n):n}static addLevels(e){if(e){Object.keys(e).forEach((n=>{const t=n.toUpperCase();he[t]=new he(e[n].value,t,e[n].colour);const i=he.levels.findIndex((e=>e.levelStr===t));i>-1?he.levels[i]=he[t]:he.levels.push(he[t])})),he.levels.sort(((e,n)=>e.level-n.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=he.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=he.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=he.getLevel(e)),this.level===e.level}}he.levels=[],he.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),me.addListener((e=>{const n=e.levels;if(n){me.throwExceptionIf(e,me.not(me.anObject(n)),"levels must be an object");Object.keys(n).forEach((t=>{me.throwExceptionIf(e,me.not(me.validIdentifier(t)),`level name "${t}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),me.throwExceptionIf(e,me.not(me.anObject(n[t])),`level "${t}" must be an object`),me.throwExceptionIf(e,me.not(n[t].value),`level "${t}" must have a 'value' property`),me.throwExceptionIf(e,me.not(me.anInteger(n[t].value)),`level "${t}".value must have an integer value`),me.throwExceptionIf(e,me.not(n[t].colour),`level "${t}" must have a 'colour' property`),me.throwExceptionIf(e,me.not(fe.indexOf(n[t].colour)>-1),`level "${t}".colour must be one of ${fe.join(", ")}`)}))}})),me.addListener((e=>{he.addLevels(e.levels)}));var xe=he;var ve={},ye={get exports(){return ve},set exports(e){ve=e}},ge={};
|
|
2
2
|
/*! (c) 2020 Andrea Giammarchi */
|
|
3
|
-
const{parse:be,stringify:we}=JSON,{keys:Se}=Object,ke=String,Ee="string",je={},_e="object",Oe=(e,n)=>n,Te=e=>e instanceof ke?ke(e):e,Fe=(e,n)=>typeof n===Ee?new ke(n):n,Ae=(e,n,t,i)=>{const a=[];for(let o=Se(t),{length:s}=o,r=0;r<s;r++){const s=o[r],c=t[s];if(c instanceof ke){const o=e[c];typeof o!==_e||n.has(o)?t[s]=i.call(t,s,o):(n.add(o),t[s]=je,a.push({k:s,a:[e,n,o,i]}))}else t[s]!==je&&(t[s]=i.call(t,s,c))}for(let{length:e}=a,n=0;n<e;n++){const{k:e,a:o}=a[n];t[e]=i.call(t,e,Ae.apply(null,o))}return t},Ce=(e,n,t)=>{const i=ke(n.push(t)-1);return e.set(t,i),i},Re=(e,n)=>{const t=be(e,Fe).map(Te),i=t[0],a=n||Oe,o=typeof i===_e&&i?Ae(t,new Set,i,a):i;return a.call({"":o},"",o)};ge.parse=Re;const Pe=(e,n,t)=>{const i=n&&typeof n===_e?(e,t)=>""===e||-1<n.indexOf(e)?t:void 0:n||Oe,a=new Map,o=[],s=[];let r=+Ce(a,o,i.call({"":e},"",e)),c=!r;for(;r<o.length;)c=!0,s[r]=we(o[r++],p,t);return"["+s.join(",")+"]";function p(e,n){if(c)return c=!c,n;const t=i.call(this,e,n);switch(typeof t){case _e:if(null===t)return t;case Ee:return a.get(t)||Ce(a,o,t)}return t}};ge.stringify=Pe;ge.toJSON=e=>be(Pe(e));ge.fromJSON=e=>Re(we(e));const Ne=ge,Le=xe;const De=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const n=this.deMap[e];this.serMap[n]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};var Ie=class e{constructor(e,n,t,i,a,o){if(this.startTime=new Date,this.categoryName=e,this.data=t,this.level=n,this.context=Object.assign({},i),this.pid=process.pid,this.error=o,void 0!==a){if(!a||"object"!=typeof a||Array.isArray(a))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==a[e]&&(this[e]=a[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ne.stringify(this,((e,n)=>(n instanceof Error&&(n=Object.assign({message:n.message,stack:n.stack},n)),De.serialise(n))))}static deserialise(n){let t;try{const i=Ne.parse(n,((e,n)=>{if(n&&n.message&&n.stack){const e=new Error(n);Object.keys(n).forEach((t=>{e[t]=n[t]})),n=e}return De.deserialise(n)}));this._getLocationKeys().forEach((e=>{void 0!==i[e]&&(i.location||(i.location={}),i.location[e]=i[e])})),t=new e(i.categoryName,Le.getLevel(i.level.levelStr),i.data,i.context,i.location,i.error),t.startTime=new Date(i.startTime),t.pid=i.pid,i.cluster&&(t.cluster=i.cluster)}catch(i){t=new e("log4js",Le.ERROR,["Unable to parse log:",n,"because: ",i])}return t}};const ze=O("log4js:clustering"),Me=Ie,Be=G;let Ue=!1,$e=null;try{$e=require("cluster")}catch(e){ze("cluster module not present"),Ue=!0}const qe=[];let We=!1,He="NODE_APP_INSTANCE";const Je=()=>We&&"0"===process.env[He],Ke=()=>Ue||$e&&$e.isMaster||Je(),Ge=e=>{qe.forEach((n=>n(e)))},Ve=(e,n)=>{if(ze("cluster message received from worker ",e,": ",n),e.topic&&e.data&&(n=e,e=void 0),n&&n.topic&&"log4js:message"===n.topic){ze("received message: ",n.data);const e=Me.deserialise(n.data);Ge(e)}};Ue||Be.addListener((e=>{qe.length=0,({pm2:We,disableClustering:Ue,pm2InstanceVar:He="NODE_APP_INSTANCE"}=e),ze(`clustering disabled ? ${Ue}`),ze(`cluster.isMaster ? ${$e&&$e.isMaster}`),ze(`pm2 enabled ? ${We}`),ze(`pm2InstanceVar = ${He}`),ze(`process.env[${He}] = ${process.env[He]}`),We&&process.removeListener("message",Ve),$e&&$e.removeListener&&$e.removeListener("message",Ve),Ue||e.disableClustering?ze("Not listening for cluster messages, because clustering disabled."):Je()?(ze("listening for PM2 broadcast messages"),process.on("message",Ve)):$e&&$e.isMaster?(ze("listening for cluster messages"),$e.on("message",Ve)):ze("not listening for messages, because we are not a master process")}));var Ye={onlyOnMaster:(e,n)=>Ke()?e():n,isMaster:Ke,send:e=>{Ke()?Ge(e):(We||(e.cluster={workerId:$e.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{qe.push(e)}},Xe={};function Qe(e){if("number"==typeof e&&Number.isInteger(e))return e;const n={K:1024,M:1048576,G:1073741824},t=Object.keys(n),i=e.slice(-1).toLocaleUpperCase(),a=e.slice(0,-1).trim();if(t.indexOf(i)<0||!Number.isInteger(Number(a)))throw Error(`maxLogSize: "${e}" is invalid`);return a*n[i]}function Ze(e){return function(e,n){const t=Object.assign({},n);return Object.keys(e).forEach((i=>{t[i]&&(t[i]=e[i](n[i]))})),t}({maxLogSize:Qe},e)}const en={dateFile:Ze,file:Ze,fileSync:Ze};Xe.modifyConfig=e=>en[e.type]?en[e.type](e):e;var nn={};const tn=console.log.bind(console);nn.configure=function(e,n){let t=n.colouredLayout;return e.layout&&(t=n.layout(e.layout.type,e.layout)),function(e,n){return t=>{tn(e(t,n))}}(t,e.timezoneOffset)};var an={};an.configure=function(e,n){let t=n.colouredLayout;return e.layout&&(t=n.layout(e.layout.type,e.layout)),function(e,n){return t=>{process.stdout.write(`${e(t,n)}\n`)}}(t,e.timezoneOffset)};var on={};on.configure=function(e,n){let t=n.colouredLayout;return e.layout&&(t=n.layout(e.layout.type,e.layout)),function(e,n){return t=>{process.stderr.write(`${e(t,n)}\n`)}}(t,e.timezoneOffset)};var sn={};sn.configure=function(e,n,t,i){const a=t(e.appender);return function(e,n,t,i){const a=i.getLevel(e),o=i.getLevel(n,i.FATAL);return e=>{const n=e.level;a.isLessThanOrEqualTo(n)&&o.isGreaterThanOrEqualTo(n)&&t(e)}}(e.level,e.maxLevel,a,i)};var rn={};const cn=O("log4js:categoryFilter");rn.configure=function(e,n,t){const i=t(e.appender);return function(e,n){return"string"==typeof e&&(e=[e]),t=>{cn(`Checking ${t.categoryName} against ${e}`),-1===e.indexOf(t.categoryName)&&(cn("Not excluded, sending to appender"),n(t))}}(e.exclude,i)};var pn={};const ln=O("log4js:noLogFilter");pn.configure=function(e,n,t){const i=t(e.appender);return function(e,n){return t=>{ln(`Checking data: ${t.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const i=new RegExp(e.join("|"),"i");(0===e.length||t.data.findIndex((e=>i.test(e)))<0)&&(ln("Not excluded, sending to appender"),n(t))}}(e.exclude,i)};var un={},dn={},mn={get exports(){return dn},set exports(e){dn=e}},fn={},hn={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((n,t)=>{arguments[arguments.length]=(e,i)=>{if(e)return t(e);n(i)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const n=arguments[arguments.length-1];if("function"!=typeof n)return e.apply(this,arguments);e.apply(this,arguments).then((e=>n(null,e)),n)}),"name",{value:e.name})}},xn=d,vn=process.cwd,yn=null,gn=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return yn||(yn=vn.call(process)),yn};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var bn=process.chdir;process.chdir=function(e){yn=null,bn.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,bn)}var wn=function(e){xn.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(n,t,i){e.open(n,xn.O_WRONLY|xn.O_SYMLINK,t,(function(n,a){n?i&&i(n):e.fchmod(a,t,(function(n){e.close(a,(function(e){i&&i(n||e)}))}))}))},e.lchmodSync=function(n,t){var i,a=e.openSync(n,xn.O_WRONLY|xn.O_SYMLINK,t),o=!0;try{i=e.fchmodSync(a,t),o=!1}finally{if(o)try{e.closeSync(a)}catch(e){}else e.closeSync(a)}return i}}(e);e.lutimes||function(e){xn.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(n,t,i,a){e.open(n,xn.O_SYMLINK,(function(n,o){n?a&&a(n):e.futimes(o,t,i,(function(n){e.close(o,(function(e){a&&a(n||e)}))}))}))},e.lutimesSync=function(n,t,i){var a,o=e.openSync(n,xn.O_SYMLINK),s=!0;try{a=e.futimesSync(o,t,i),s=!1}finally{if(s)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return a}):e.futimes&&(e.lutimes=function(e,n,t,i){i&&process.nextTick(i)},e.lutimesSync=function(){})}(e);e.chown=i(e.chown),e.fchown=i(e.fchown),e.lchown=i(e.lchown),e.chmod=n(e.chmod),e.fchmod=n(e.fchmod),e.lchmod=n(e.lchmod),e.chownSync=a(e.chownSync),e.fchownSync=a(e.fchownSync),e.lchownSync=a(e.lchownSync),e.chmodSync=t(e.chmodSync),e.fchmodSync=t(e.fchmodSync),e.lchmodSync=t(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=s(e.statSync),e.fstatSync=s(e.fstatSync),e.lstatSync=s(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,n,t){t&&process.nextTick(t)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,n,t,i){i&&process.nextTick(i)},e.lchownSync=function(){});"win32"===gn&&(e.rename="function"!=typeof e.rename?e.rename:function(n){function t(t,i,a){var o=Date.now(),s=0;n(t,i,(function r(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(i,(function(e,o){e&&"ENOENT"===e.code?n(t,i,r):a(c)}))}),s),void(s<100&&(s+=10));a&&a(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(t,n),t}(e.rename));function n(n){return n?function(t,i,a){return n.call(e,t,i,(function(e){r(e)&&(e=null),a&&a.apply(this,arguments)}))}:n}function t(n){return n?function(t,i){try{return n.call(e,t,i)}catch(e){if(!r(e))throw e}}:n}function i(n){return n?function(t,i,a,o){return n.call(e,t,i,a,(function(e){r(e)&&(e=null),o&&o.apply(this,arguments)}))}:n}function a(n){return n?function(t,i,a){try{return n.call(e,t,i,a)}catch(e){if(!r(e))throw e}}:n}function o(n){return n?function(t,i,a){function o(e,n){n&&(n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296)),a&&a.apply(this,arguments)}return"function"==typeof i&&(a=i,i=null),i?n.call(e,t,i,o):n.call(e,t,o)}:n}function s(n){return n?function(t,i){var a=i?n.call(e,t,i):n.call(e,t);return a&&(a.uid<0&&(a.uid+=4294967296),a.gid<0&&(a.gid+=4294967296)),a}:n}function r(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(n){function t(t,i,a,o,s,r){var c;if(r&&"function"==typeof r){var p=0;c=function(l,u,d){if(l&&"EAGAIN"===l.code&&p<10)return p++,n.call(e,t,i,a,o,s,c);r.apply(this,arguments)}}return n.call(e,t,i,a,o,s,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(t,n),t}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(n,t,i,a,o){for(var s=0;;)try{return c.call(e,n,t,i,a,o)}catch(e){if("EAGAIN"===e.code&&s<10){s++;continue}throw e}});var c};var Sn=m.Stream,kn=function(e){return{ReadStream:function n(t,i){if(!(this instanceof n))return new n(t,i);Sn.call(this);var a=this;this.path=t,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,i=i||{};for(var o=Object.keys(i),s=0,r=o.length;s<r;s++){var c=o[s];this[c]=i[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){a._read()}));e.open(this.path,this.flags,this.mode,(function(e,n){if(e)return a.emit("error",e),void(a.readable=!1);a.fd=n,a.emit("open",n),a._read()}))},WriteStream:function n(t,i){if(!(this instanceof n))return new n(t,i);Sn.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var a=Object.keys(i),o=0,s=a.length;o<s;o++){var r=a[o];this[r]=i[r]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var En=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var n={__proto__:jn(e)};else n=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))})),n},jn=Object.getPrototypeOf||function(e){return e.__proto__};var _n,On,Tn=c,Fn=wn,An=kn,Cn=En,Rn=o;function Pn(e,n){Object.defineProperty(e,_n,{get:function(){return n}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(_n=Symbol.for("graceful-fs.queue"),On=Symbol.for("graceful-fs.previous")):(_n="___graceful-fs.queue",On="___graceful-fs.previous");var Nn=function(){};if(Rn.debuglog?Nn=Rn.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Nn=function(){var e=Rn.format.apply(Rn,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Tn[_n]){var Ln=_[_n]||[];Pn(Tn,Ln),Tn.close=function(e){function n(n,t){return e.call(Tn,n,(function(e){e||Bn(),"function"==typeof t&&t.apply(this,arguments)}))}return Object.defineProperty(n,On,{value:e}),n}(Tn.close),Tn.closeSync=function(e){function n(n){e.apply(Tn,arguments),Bn()}return Object.defineProperty(n,On,{value:e}),n}(Tn.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Nn(Tn[_n]),f.equal(Tn[_n].length,0)}))}_[_n]||Pn(_,Tn[_n]);var Dn,In=zn(Cn(Tn));function zn(e){Fn(e),e.gracefulify=zn,e.createReadStream=function(n,t){return new e.ReadStream(n,t)},e.createWriteStream=function(n,t){return new e.WriteStream(n,t)};var n=e.readFile;e.readFile=function(e,t,i){"function"==typeof t&&(i=t,t=null);return function e(t,i,a,o){return n(t,i,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof a&&a.apply(this,arguments):Mn([e,[t,i,a],n,o||Date.now(),Date.now()])}))}(e,t,i)};var t=e.writeFile;e.writeFile=function(e,n,i,a){"function"==typeof i&&(a=i,i=null);return function e(n,i,a,o,s){return t(n,i,a,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof o&&o.apply(this,arguments):Mn([e,[n,i,a,o],t,s||Date.now(),Date.now()])}))}(e,n,i,a)};var i=e.appendFile;i&&(e.appendFile=function(e,n,t,a){"function"==typeof t&&(a=t,t=null);return function e(n,t,a,o,s){return i(n,t,a,(function(i){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof o&&o.apply(this,arguments):Mn([e,[n,t,a,o],i,s||Date.now(),Date.now()])}))}(e,n,t,a)});var a=e.copyFile;a&&(e.copyFile=function(e,n,t,i){"function"==typeof t&&(i=t,t=0);return function e(n,t,i,o,s){return a(n,t,i,(function(a){!a||"EMFILE"!==a.code&&"ENFILE"!==a.code?"function"==typeof o&&o.apply(this,arguments):Mn([e,[n,t,i,o],a,s||Date.now(),Date.now()])}))}(e,n,t,i)});var o=e.readdir;e.readdir=function(e,n,t){"function"==typeof n&&(t=n,n=null);var i=s.test(process.version)?function(e,n,t,i){return o(e,a(e,n,t,i))}:function(e,n,t,i){return o(e,n,a(e,n,t,i))};return i(e,n,t);function a(e,n,t,a){return function(o,s){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(s&&s.sort&&s.sort(),"function"==typeof t&&t.call(this,o,s)):Mn([i,[e,n,t],o,a||Date.now(),Date.now()])}}};var s=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var r=An(e);d=r.ReadStream,m=r.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(n,t){n?(e.autoClose&&e.destroy(),e.emit("error",n)):(e.fd=t,e.emit("open",t),e.read())}))});var p=e.WriteStream;p&&(m.prototype=Object.create(p.prototype),m.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(n,t){n?(e.destroy(),e.emit("error",n)):(e.fd=t,e.emit("open",t))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return m},set:function(e){m=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var u=m;function d(e,n){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function m(e,n){return this instanceof m?(p.apply(this,arguments),this):m.apply(Object.create(m.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return u},set:function(e){u=e},enumerable:!0,configurable:!0});var f=e.open;function h(e,n,t,i){return"function"==typeof t&&(i=t,t=null),function e(n,t,i,a,o){return f(n,t,i,(function(s,r){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?"function"==typeof a&&a.apply(this,arguments):Mn([e,[n,t,i,a],s,o||Date.now(),Date.now()])}))}(e,n,t,i)}return e.open=h,e}function Mn(e){Nn("ENQUEUE",e[0].name,e[1]),Tn[_n].push(e),Un()}function Bn(){for(var e=Date.now(),n=0;n<Tn[_n].length;++n)Tn[_n][n].length>2&&(Tn[_n][n][3]=e,Tn[_n][n][4]=e);Un()}function Un(){if(clearTimeout(Dn),Dn=void 0,0!==Tn[_n].length){var e=Tn[_n].shift(),n=e[0],t=e[1],i=e[2],a=e[3],o=e[4];if(void 0===a)Nn("RETRY",n.name,t),n.apply(null,t);else if(Date.now()-a>=6e4){Nn("TIMEOUT",n.name,t);var s=t.pop();"function"==typeof s&&s.call(null,i)}else{var r=Date.now()-o,c=Math.max(o-a,1);r>=Math.min(1.2*c,100)?(Nn("RETRY",n.name,t),n.apply(null,t.concat([a]))):Tn[_n].push(e)}void 0===Dn&&(Dn=setTimeout(Un,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Tn.__patched&&(In=zn(Tn),Tn.__patched=!0),function(e){const n=hn.fromCallback,t=In,i=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof t[e]));Object.keys(t).forEach((n=>{"promises"!==n&&(e[n]=t[n])})),i.forEach((i=>{e[i]=n(t[i])})),e.exists=function(e,n){return"function"==typeof n?t.exists(e,n):new Promise((n=>t.exists(e,n)))},e.read=function(e,n,i,a,o,s){return"function"==typeof s?t.read(e,n,i,a,o,s):new Promise(((s,r)=>{t.read(e,n,i,a,o,((e,n,t)=>{if(e)return r(e);s({bytesRead:n,buffer:t})}))}))},e.write=function(e,n,...i){return"function"==typeof i[i.length-1]?t.write(e,n,...i):new Promise(((a,o)=>{t.write(e,n,...i,((e,n,t)=>{if(e)return o(e);a({bytesWritten:n,buffer:t})}))}))},"function"==typeof t.realpath.native&&(e.realpath.native=n(t.realpath.native))}(fn);const $n=l;function qn(e){return(e=$n.normalize($n.resolve(e)).split($n.sep)).length>0?e[0]:null}const Wn=/[<>:"|?*]/;var Hn=function(e){const n=qn(e);return e=e.replace(n,""),Wn.test(e)};const Jn=In,Kn=l,Gn=Hn,Vn=parseInt("0777",8);var Yn=function e(n,t,i,a){if("function"==typeof t?(i=t,t={}):t&&"object"==typeof t||(t={mode:t}),"win32"===process.platform&&Gn(n)){const e=new Error(n+" contains invalid WIN32 path characters.");return e.code="EINVAL",i(e)}let o=t.mode;const s=t.fs||Jn;void 0===o&&(o=Vn&~process.umask()),a||(a=null),i=i||function(){},n=Kn.resolve(n),s.mkdir(n,o,(o=>{if(!o)return i(null,a=a||n);if("ENOENT"===o.code){if(Kn.dirname(n)===n)return i(o);e(Kn.dirname(n),t,((a,o)=>{a?i(a,o):e(n,t,i,o)}))}else s.stat(n,((e,n)=>{e||!n.isDirectory()?i(o,a):i(null,a)}))}))};const Xn=In,Qn=l,Zn=Hn,et=parseInt("0777",8);var nt=function e(n,t,i){t&&"object"==typeof t||(t={mode:t});let a=t.mode;const o=t.fs||Xn;if("win32"===process.platform&&Zn(n)){const e=new Error(n+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===a&&(a=et&~process.umask()),i||(i=null),n=Qn.resolve(n);try{o.mkdirSync(n,a),i=i||n}catch(a){if("ENOENT"===a.code){if(Qn.dirname(n)===n)throw a;i=e(Qn.dirname(n),t,i),e(n,t,i)}else{let e;try{e=o.statSync(n)}catch(e){throw a}if(!e.isDirectory())throw a}}return i};const tt=(0,hn.fromCallback)(Yn);var it={mkdirs:tt,mkdirsSync:nt,mkdirp:tt,mkdirpSync:nt,ensureDir:tt,ensureDirSync:nt};const at=In;var ot=function(e,n,t,i){at.open(e,"r+",((e,a)=>{if(e)return i(e);at.futimes(a,n,t,(e=>{at.close(a,(n=>{i&&i(e||n)}))}))}))},st=function(e,n,t){const i=at.openSync(e,"r+");return at.futimesSync(i,n,t),at.closeSync(i)};const rt=In,ct=l,pt=10,lt=5,ut=0,dt=process.versions.node.split("."),mt=Number.parseInt(dt[0],10),ft=Number.parseInt(dt[1],10),ht=Number.parseInt(dt[2],10);function xt(){if(mt>pt)return!0;if(mt===pt){if(ft>lt)return!0;if(ft===lt&&ht>=ut)return!0}return!1}function vt(e,n){const t=ct.resolve(e).split(ct.sep).filter((e=>e)),i=ct.resolve(n).split(ct.sep).filter((e=>e));return t.reduce(((e,n,t)=>e&&i[t]===n),!0)}function yt(e,n,t){return`Cannot ${t} '${e}' to a subdirectory of itself, '${n}'.`}var gt,bt,wt={checkPaths:function(e,n,t,i){!function(e,n,t){xt()?rt.stat(e,{bigint:!0},((e,i)=>{if(e)return t(e);rt.stat(n,{bigint:!0},((e,n)=>e?"ENOENT"===e.code?t(null,{srcStat:i,destStat:null}):t(e):t(null,{srcStat:i,destStat:n})))})):rt.stat(e,((e,i)=>{if(e)return t(e);rt.stat(n,((e,n)=>e?"ENOENT"===e.code?t(null,{srcStat:i,destStat:null}):t(e):t(null,{srcStat:i,destStat:n})))}))}(e,n,((a,o)=>{if(a)return i(a);const{srcStat:s,destStat:r}=o;return r&&r.ino&&r.dev&&r.ino===s.ino&&r.dev===s.dev?i(new Error("Source and destination must not be the same.")):s.isDirectory()&&vt(e,n)?i(new Error(yt(e,n,t))):i(null,{srcStat:s,destStat:r})}))},checkPathsSync:function(e,n,t){const{srcStat:i,destStat:a}=function(e,n){let t,i;t=xt()?rt.statSync(e,{bigint:!0}):rt.statSync(e);try{i=xt()?rt.statSync(n,{bigint:!0}):rt.statSync(n)}catch(e){if("ENOENT"===e.code)return{srcStat:t,destStat:null};throw e}return{srcStat:t,destStat:i}}(e,n);if(a&&a.ino&&a.dev&&a.ino===i.ino&&a.dev===i.dev)throw new Error("Source and destination must not be the same.");if(i.isDirectory()&&vt(e,n))throw new Error(yt(e,n,t));return{srcStat:i,destStat:a}},checkParentPaths:function e(n,t,i,a,o){const s=ct.resolve(ct.dirname(n)),r=ct.resolve(ct.dirname(i));if(r===s||r===ct.parse(r).root)return o();xt()?rt.stat(r,{bigint:!0},((s,c)=>s?"ENOENT"===s.code?o():o(s):c.ino&&c.dev&&c.ino===t.ino&&c.dev===t.dev?o(new Error(yt(n,i,a))):e(n,t,r,a,o))):rt.stat(r,((s,c)=>s?"ENOENT"===s.code?o():o(s):c.ino&&c.dev&&c.ino===t.ino&&c.dev===t.dev?o(new Error(yt(n,i,a))):e(n,t,r,a,o)))},checkParentPathsSync:function e(n,t,i,a){const o=ct.resolve(ct.dirname(n)),s=ct.resolve(ct.dirname(i));if(s===o||s===ct.parse(s).root)return;let r;try{r=xt()?rt.statSync(s,{bigint:!0}):rt.statSync(s)}catch(e){if("ENOENT"===e.code)return;throw e}if(r.ino&&r.dev&&r.ino===t.ino&&r.dev===t.dev)throw new Error(yt(n,i,a));return e(n,t,s,a)},isSrcSubdir:vt};const St=In,kt=l,Et=it.mkdirsSync,jt=st,_t=wt;function Ot(e,n,t,i){if(!i.filter||i.filter(n,t))return function(e,n,t,i){const a=i.dereference?St.statSync:St.lstatSync,o=a(n);if(o.isDirectory())return function(e,n,t,i,a){if(!n)return function(e,n,t,i){return St.mkdirSync(t),Ft(n,t,i),St.chmodSync(t,e.mode)}(e,t,i,a);if(n&&!n.isDirectory())throw new Error(`Cannot overwrite non-directory '${i}' with directory '${t}'.`);return Ft(t,i,a)}(o,e,n,t,i);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,n,t,i,a){return n?function(e,n,t,i){if(i.overwrite)return St.unlinkSync(t),Tt(e,n,t,i);if(i.errorOnExist)throw new Error(`'${t}' already exists`)}(e,t,i,a):Tt(e,t,i,a)}(o,e,n,t,i);if(o.isSymbolicLink())return function(e,n,t,i){let a=St.readlinkSync(n);i.dereference&&(a=kt.resolve(process.cwd(),a));if(e){let e;try{e=St.readlinkSync(t)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return St.symlinkSync(a,t);throw e}if(i.dereference&&(e=kt.resolve(process.cwd(),e)),_t.isSrcSubdir(a,e))throw new Error(`Cannot copy '${a}' to a subdirectory of itself, '${e}'.`);if(St.statSync(t).isDirectory()&&_t.isSrcSubdir(e,a))throw new Error(`Cannot overwrite '${e}' with '${a}'.`);return function(e,n){return St.unlinkSync(n),St.symlinkSync(e,n)}(a,t)}return St.symlinkSync(a,t)}(e,n,t,i)}(e,n,t,i)}function Tt(e,n,t,i){return"function"==typeof St.copyFileSync?(St.copyFileSync(n,t),St.chmodSync(t,e.mode),i.preserveTimestamps?jt(t,e.atime,e.mtime):void 0):function(e,n,t,i){const a=65536,o=(bt?gt:(bt=1,gt=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(n){return new Buffer(e)}return new Buffer(e)}))(a),s=St.openSync(n,"r"),r=St.openSync(t,"w",e.mode);let c=0;for(;c<e.size;){const e=St.readSync(s,o,0,a,c);St.writeSync(r,o,0,e),c+=e}i.preserveTimestamps&&St.futimesSync(r,e.atime,e.mtime);St.closeSync(s),St.closeSync(r)}(e,n,t,i)}function Ft(e,n,t){St.readdirSync(e).forEach((i=>function(e,n,t,i){const a=kt.join(n,e),o=kt.join(t,e),{destStat:s}=_t.checkPathsSync(a,o,"copy");return Ot(s,a,o,i)}(i,e,n,t)))}var At=function(e,n,t){"function"==typeof t&&(t={filter:t}),(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:i,destStat:a}=_t.checkPathsSync(e,n,"copy");return _t.checkParentPathsSync(e,i,n,"copy"),function(e,n,t,i){if(i.filter&&!i.filter(n,t))return;const a=kt.dirname(t);St.existsSync(a)||Et(a);return Ot(e,n,t,i)}(a,e,n,t)},Ct={copySync:At};const Rt=hn.fromPromise,Pt=fn;var Nt={pathExists:Rt((function(e){return Pt.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:Pt.existsSync};const Lt=In,Dt=l,It=it.mkdirs,zt=Nt.pathExists,Mt=ot,Bt=wt;function Ut(e,n,t,i,a){const o=Dt.dirname(t);zt(o,((s,r)=>s?a(s):r?qt(e,n,t,i,a):void It(o,(o=>o?a(o):qt(e,n,t,i,a)))))}function $t(e,n,t,i,a,o){Promise.resolve(a.filter(t,i)).then((s=>s?e(n,t,i,a,o):o()),(e=>o(e)))}function qt(e,n,t,i,a){return i.filter?$t(Wt,e,n,t,i,a):Wt(e,n,t,i,a)}function Wt(e,n,t,i,a){(i.dereference?Lt.stat:Lt.lstat)(n,((o,s)=>o?a(o):s.isDirectory()?function(e,n,t,i,a,o){if(!n)return function(e,n,t,i,a){Lt.mkdir(t,(o=>{if(o)return a(o);Kt(n,t,i,(n=>n?a(n):Lt.chmod(t,e.mode,a)))}))}(e,t,i,a,o);if(n&&!n.isDirectory())return o(new Error(`Cannot overwrite non-directory '${i}' with directory '${t}'.`));return Kt(t,i,a,o)}(s,e,n,t,i,a):s.isFile()||s.isCharacterDevice()||s.isBlockDevice()?function(e,n,t,i,a,o){return n?function(e,n,t,i,a){if(!i.overwrite)return i.errorOnExist?a(new Error(`'${t}' already exists`)):a();Lt.unlink(t,(o=>o?a(o):Ht(e,n,t,i,a)))}(e,t,i,a,o):Ht(e,t,i,a,o)}(s,e,n,t,i,a):s.isSymbolicLink()?function(e,n,t,i,a){Lt.readlink(n,((n,o)=>n?a(n):(i.dereference&&(o=Dt.resolve(process.cwd(),o)),e?void Lt.readlink(t,((n,s)=>n?"EINVAL"===n.code||"UNKNOWN"===n.code?Lt.symlink(o,t,a):a(n):(i.dereference&&(s=Dt.resolve(process.cwd(),s)),Bt.isSrcSubdir(o,s)?a(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${s}'.`)):e.isDirectory()&&Bt.isSrcSubdir(s,o)?a(new Error(`Cannot overwrite '${s}' with '${o}'.`)):function(e,n,t){Lt.unlink(n,(i=>i?t(i):Lt.symlink(e,n,t)))}(o,t,a)))):Lt.symlink(o,t,a))))}(e,n,t,i,a):void 0))}function Ht(e,n,t,i,a){return"function"==typeof Lt.copyFile?Lt.copyFile(n,t,(n=>n?a(n):Jt(e,t,i,a))):function(e,n,t,i,a){const o=Lt.createReadStream(n);o.on("error",(e=>a(e))).once("open",(()=>{const n=Lt.createWriteStream(t,{mode:e.mode});n.on("error",(e=>a(e))).on("open",(()=>o.pipe(n))).once("close",(()=>Jt(e,t,i,a)))}))}(e,n,t,i,a)}function Jt(e,n,t,i){Lt.chmod(n,e.mode,(a=>a?i(a):t.preserveTimestamps?Mt(n,e.atime,e.mtime,i):i()))}function Kt(e,n,t,i){Lt.readdir(e,((a,o)=>a?i(a):Gt(o,e,n,t,i)))}function Gt(e,n,t,i,a){const o=e.pop();return o?function(e,n,t,i,a,o){const s=Dt.join(t,n),r=Dt.join(i,n);Bt.checkPaths(s,r,"copy",((n,c)=>{if(n)return o(n);const{destStat:p}=c;qt(p,s,r,a,(n=>n?o(n):Gt(e,t,i,a,o)))}))}(e,o,n,t,i,a):a()}var Vt=function(e,n,t,i){"function"!=typeof t||i?"function"==typeof t&&(t={filter:t}):(i=t,t={}),i=i||function(){},(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),Bt.checkPaths(e,n,"copy",((a,o)=>{if(a)return i(a);const{srcStat:s,destStat:r}=o;Bt.checkParentPaths(e,s,n,"copy",(a=>a?i(a):t.filter?$t(Ut,r,e,n,t,i):Ut(r,e,n,t,i)))}))};var Yt={copy:(0,hn.fromCallback)(Vt)};const Xt=In,Qt=l,Zt=f,ei="win32"===process.platform;function ni(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((n=>{e[n]=e[n]||Xt[n],e[n+="Sync"]=e[n]||Xt[n]})),e.maxBusyTries=e.maxBusyTries||3}function ti(e,n,t){let i=0;"function"==typeof n&&(t=n,n={}),Zt(e,"rimraf: missing path"),Zt.strictEqual(typeof e,"string","rimraf: path should be a string"),Zt.strictEqual(typeof t,"function","rimraf: callback function required"),Zt(n,"rimraf: invalid options argument provided"),Zt.strictEqual(typeof n,"object","rimraf: options should be object"),ni(n),ii(e,n,(function a(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&i<n.maxBusyTries){i++;return setTimeout((()=>ii(e,n,a)),100*i)}"ENOENT"===o.code&&(o=null)}t(o)}))}function ii(e,n,t){Zt(e),Zt(n),Zt("function"==typeof t),n.lstat(e,((i,a)=>i&&"ENOENT"===i.code?t(null):i&&"EPERM"===i.code&&ei?ai(e,n,i,t):a&&a.isDirectory()?si(e,n,i,t):void n.unlink(e,(i=>{if(i){if("ENOENT"===i.code)return t(null);if("EPERM"===i.code)return ei?ai(e,n,i,t):si(e,n,i,t);if("EISDIR"===i.code)return si(e,n,i,t)}return t(i)}))))}function ai(e,n,t,i){Zt(e),Zt(n),Zt("function"==typeof i),t&&Zt(t instanceof Error),n.chmod(e,438,(a=>{a?i("ENOENT"===a.code?null:t):n.stat(e,((a,o)=>{a?i("ENOENT"===a.code?null:t):o.isDirectory()?si(e,n,t,i):n.unlink(e,i)}))}))}function oi(e,n,t){let i;Zt(e),Zt(n),t&&Zt(t instanceof Error);try{n.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw t}try{i=n.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw t}i.isDirectory()?ci(e,n,t):n.unlinkSync(e)}function si(e,n,t,i){Zt(e),Zt(n),t&&Zt(t instanceof Error),Zt("function"==typeof i),n.rmdir(e,(a=>{!a||"ENOTEMPTY"!==a.code&&"EEXIST"!==a.code&&"EPERM"!==a.code?a&&"ENOTDIR"===a.code?i(t):i(a):function(e,n,t){Zt(e),Zt(n),Zt("function"==typeof t),n.readdir(e,((i,a)=>{if(i)return t(i);let o,s=a.length;if(0===s)return n.rmdir(e,t);a.forEach((i=>{ti(Qt.join(e,i),n,(i=>{if(!o)return i?t(o=i):void(0==--s&&n.rmdir(e,t))}))}))}))}(e,n,i)}))}function ri(e,n){let t;ni(n=n||{}),Zt(e,"rimraf: missing path"),Zt.strictEqual(typeof e,"string","rimraf: path should be a string"),Zt(n,"rimraf: missing options"),Zt.strictEqual(typeof n,"object","rimraf: options should be object");try{t=n.lstatSync(e)}catch(t){if("ENOENT"===t.code)return;"EPERM"===t.code&&ei&&oi(e,n,t)}try{t&&t.isDirectory()?ci(e,n,null):n.unlinkSync(e)}catch(t){if("ENOENT"===t.code)return;if("EPERM"===t.code)return ei?oi(e,n,t):ci(e,n,t);if("EISDIR"!==t.code)throw t;ci(e,n,t)}}function ci(e,n,t){Zt(e),Zt(n),t&&Zt(t instanceof Error);try{n.rmdirSync(e)}catch(i){if("ENOTDIR"===i.code)throw t;if("ENOTEMPTY"===i.code||"EEXIST"===i.code||"EPERM"===i.code)!function(e,n){if(Zt(e),Zt(n),n.readdirSync(e).forEach((t=>ri(Qt.join(e,t),n))),!ei){return n.rmdirSync(e,n)}{const t=Date.now();do{try{return n.rmdirSync(e,n)}catch(e){}}while(Date.now()-t<500)}}(e,n);else if("ENOENT"!==i.code)throw i}}var pi=ti;ti.sync=ri;const li=pi;var ui={remove:(0,hn.fromCallback)(li),removeSync:li.sync};const di=hn.fromCallback,mi=In,fi=l,hi=it,xi=ui,vi=di((function(e,n){n=n||function(){},mi.readdir(e,((t,i)=>{if(t)return hi.mkdirs(e,n);i=i.map((n=>fi.join(e,n))),function e(){const t=i.pop();if(!t)return n();xi.remove(t,(t=>{if(t)return n(t);e()}))}()}))}));function yi(e){let n;try{n=mi.readdirSync(e)}catch(n){return hi.mkdirsSync(e)}n.forEach((n=>{n=fi.join(e,n),xi.removeSync(n)}))}var gi={emptyDirSync:yi,emptydirSync:yi,emptyDir:vi,emptydir:vi};const bi=hn.fromCallback,wi=l,Si=In,ki=it,Ei=Nt.pathExists;var ji={createFile:bi((function(e,n){function t(){Si.writeFile(e,"",(e=>{if(e)return n(e);n()}))}Si.stat(e,((i,a)=>{if(!i&&a.isFile())return n();const o=wi.dirname(e);Ei(o,((e,i)=>e?n(e):i?t():void ki.mkdirs(o,(e=>{if(e)return n(e);t()}))))}))})),createFileSync:function(e){let n;try{n=Si.statSync(e)}catch(e){}if(n&&n.isFile())return;const t=wi.dirname(e);Si.existsSync(t)||ki.mkdirsSync(t),Si.writeFileSync(e,"")}};const _i=hn.fromCallback,Oi=l,Ti=In,Fi=it,Ai=Nt.pathExists;var Ci={createLink:_i((function(e,n,t){function i(e,n){Ti.link(e,n,(e=>{if(e)return t(e);t(null)}))}Ai(n,((a,o)=>a?t(a):o?t(null):void Ti.lstat(e,(a=>{if(a)return a.message=a.message.replace("lstat","ensureLink"),t(a);const o=Oi.dirname(n);Ai(o,((a,s)=>a?t(a):s?i(e,n):void Fi.mkdirs(o,(a=>{if(a)return t(a);i(e,n)}))))}))))})),createLinkSync:function(e,n){if(Ti.existsSync(n))return;try{Ti.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const t=Oi.dirname(n);return Ti.existsSync(t)||Fi.mkdirsSync(t),Ti.linkSync(e,n)}};const Ri=l,Pi=In,Ni=Nt.pathExists;var Li={symlinkPaths:function(e,n,t){if(Ri.isAbsolute(e))return Pi.lstat(e,(n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),t(n)):t(null,{toCwd:e,toDst:e})));{const i=Ri.dirname(n),a=Ri.join(i,e);return Ni(a,((n,o)=>n?t(n):o?t(null,{toCwd:a,toDst:e}):Pi.lstat(e,(n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),t(n)):t(null,{toCwd:e,toDst:Ri.relative(i,e)})))))}},symlinkPathsSync:function(e,n){let t;if(Ri.isAbsolute(e)){if(t=Pi.existsSync(e),!t)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const i=Ri.dirname(n),a=Ri.join(i,e);if(t=Pi.existsSync(a),t)return{toCwd:a,toDst:e};if(t=Pi.existsSync(e),!t)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Ri.relative(i,e)}}}};const Di=In;var Ii={symlinkType:function(e,n,t){if(t="function"==typeof n?n:t,n="function"!=typeof n&&n)return t(null,n);Di.lstat(e,((e,i)=>{if(e)return t(null,"file");n=i&&i.isDirectory()?"dir":"file",t(null,n)}))},symlinkTypeSync:function(e,n){let t;if(n)return n;try{t=Di.lstatSync(e)}catch(e){return"file"}return t&&t.isDirectory()?"dir":"file"}};const zi=hn.fromCallback,Mi=l,Bi=In,Ui=it.mkdirs,$i=it.mkdirsSync,qi=Li.symlinkPaths,Wi=Li.symlinkPathsSync,Hi=Ii.symlinkType,Ji=Ii.symlinkTypeSync,Ki=Nt.pathExists;var Gi={createSymlink:zi((function(e,n,t,i){i="function"==typeof t?t:i,t="function"!=typeof t&&t,Ki(n,((a,o)=>a?i(a):o?i(null):void qi(e,n,((a,o)=>{if(a)return i(a);e=o.toDst,Hi(o.toCwd,t,((t,a)=>{if(t)return i(t);const o=Mi.dirname(n);Ki(o,((t,s)=>t?i(t):s?Bi.symlink(e,n,a,i):void Ui(o,(t=>{if(t)return i(t);Bi.symlink(e,n,a,i)}))))}))}))))})),createSymlinkSync:function(e,n,t){if(Bi.existsSync(n))return;const i=Wi(e,n);e=i.toDst,t=Ji(i.toCwd,t);const a=Mi.dirname(n);return Bi.existsSync(a)||$i(a),Bi.symlinkSync(e,n,t)}};var Vi,Yi={createFile:ji.createFile,createFileSync:ji.createFileSync,ensureFile:ji.createFile,ensureFileSync:ji.createFileSync,createLink:Ci.createLink,createLinkSync:Ci.createLinkSync,ensureLink:Ci.createLink,ensureLinkSync:Ci.createLinkSync,createSymlink:Gi.createSymlink,createSymlinkSync:Gi.createSymlinkSync,ensureSymlink:Gi.createSymlink,ensureSymlinkSync:Gi.createSymlinkSync};try{Vi=In}catch(s){Vi=c}function Xi(e,n){var t,i="\n";return"object"==typeof n&&null!==n&&(n.spaces&&(t=n.spaces),n.EOL&&(i=n.EOL)),JSON.stringify(e,n?n.replacer:null,t).replace(/\n/g,i)+i}function Qi(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var Zi={readFile:function(e,n,t){null==t&&(t=n,n={}),"string"==typeof n&&(n={encoding:n});var i=(n=n||{}).fs||Vi,a=!0;"throws"in n&&(a=n.throws),i.readFile(e,n,(function(i,o){if(i)return t(i);var s;o=Qi(o);try{s=JSON.parse(o,n?n.reviver:null)}catch(n){return a?(n.message=e+": "+n.message,t(n)):t(null,null)}t(null,s)}))},readFileSync:function(e,n){"string"==typeof(n=n||{})&&(n={encoding:n});var t=n.fs||Vi,i=!0;"throws"in n&&(i=n.throws);try{var a=t.readFileSync(e,n);return a=Qi(a),JSON.parse(a,n.reviver)}catch(n){if(i)throw n.message=e+": "+n.message,n;return null}},writeFile:function(e,n,t,i){null==i&&(i=t,t={});var a=(t=t||{}).fs||Vi,o="";try{o=Xi(n,t)}catch(e){return void(i&&i(e,null))}a.writeFile(e,o,t,i)},writeFileSync:function(e,n,t){var i=(t=t||{}).fs||Vi,a=Xi(n,t);return i.writeFileSync(e,a,t)}},ea=Zi;const na=hn.fromCallback,ta=ea;var ia={readJson:na(ta.readFile),readJsonSync:ta.readFileSync,writeJson:na(ta.writeFile),writeJsonSync:ta.writeFileSync};const aa=l,oa=it,sa=Nt.pathExists,ra=ia;var ca=function(e,n,t,i){"function"==typeof t&&(i=t,t={});const a=aa.dirname(e);sa(a,((o,s)=>o?i(o):s?ra.writeJson(e,n,t,i):void oa.mkdirs(a,(a=>{if(a)return i(a);ra.writeJson(e,n,t,i)}))))};const pa=In,la=l,ua=it,da=ia;var ma=function(e,n,t){const i=la.dirname(e);pa.existsSync(i)||ua.mkdirsSync(i),da.writeJsonSync(e,n,t)};const fa=hn.fromCallback,ha=ia;ha.outputJson=fa(ca),ha.outputJsonSync=ma,ha.outputJSON=ha.outputJson,ha.outputJSONSync=ha.outputJsonSync,ha.writeJSON=ha.writeJson,ha.writeJSONSync=ha.writeJsonSync,ha.readJSON=ha.readJson,ha.readJSONSync=ha.readJsonSync;var xa=ha;const va=In,ya=l,ga=Ct.copySync,ba=ui.removeSync,wa=it.mkdirpSync,Sa=wt;function ka(e,n,t){try{va.renameSync(e,n)}catch(i){if("EXDEV"!==i.code)throw i;return function(e,n,t){const i={overwrite:t,errorOnExist:!0};return ga(e,n,i),ba(e)}(e,n,t)}}var Ea=function(e,n,t){const i=(t=t||{}).overwrite||t.clobber||!1,{srcStat:a}=Sa.checkPathsSync(e,n,"move");return Sa.checkParentPathsSync(e,a,n,"move"),wa(ya.dirname(n)),function(e,n,t){if(t)return ba(n),ka(e,n,t);if(va.existsSync(n))throw new Error("dest already exists.");return ka(e,n,t)}(e,n,i)},ja={moveSync:Ea};const _a=In,Oa=l,Ta=Yt.copy,Fa=ui.remove,Aa=it.mkdirp,Ca=Nt.pathExists,Ra=wt;function Pa(e,n,t,i){_a.rename(e,n,(a=>a?"EXDEV"!==a.code?i(a):function(e,n,t,i){const a={overwrite:t,errorOnExist:!0};Ta(e,n,a,(n=>n?i(n):Fa(e,i)))}(e,n,t,i):i()))}var Na=function(e,n,t,i){"function"==typeof t&&(i=t,t={});const a=t.overwrite||t.clobber||!1;Ra.checkPaths(e,n,"move",((t,o)=>{if(t)return i(t);const{srcStat:s}=o;Ra.checkParentPaths(e,s,n,"move",(t=>{if(t)return i(t);Aa(Oa.dirname(n),(t=>t?i(t):function(e,n,t,i){if(t)return Fa(n,(a=>a?i(a):Pa(e,n,t,i)));Ca(n,((a,o)=>a?i(a):o?i(new Error("dest already exists.")):Pa(e,n,t,i)))}(e,n,a,i)))}))}))};var La={move:(0,hn.fromCallback)(Na)};const Da=hn.fromCallback,Ia=In,za=l,Ma=it,Ba=Nt.pathExists;var Ua={outputFile:Da((function(e,n,t,i){"function"==typeof t&&(i=t,t="utf8");const a=za.dirname(e);Ba(a,((o,s)=>o?i(o):s?Ia.writeFile(e,n,t,i):void Ma.mkdirs(a,(a=>{if(a)return i(a);Ia.writeFile(e,n,t,i)}))))})),outputFileSync:function(e,...n){const t=za.dirname(e);if(Ia.existsSync(t))return Ia.writeFileSync(e,...n);Ma.mkdirsSync(t),Ia.writeFileSync(e,...n)}};!function(e){e.exports=Object.assign({},fn,Ct,Yt,gi,Yi,xa,it,ja,La,Ua,Nt,ui);const n=c;Object.getOwnPropertyDescriptor(n,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>n.promises})}(mn);const $a=O("streamroller:fileNameFormatter"),qa=l;const Wa=O("streamroller:fileNameParser"),Ha=V;const Ja=O("streamroller:moveAndMaybeCompressFile"),Ka=dn,Ga=h;var Va=async(e,n,t)=>{if(t=function(e){const n={mode:parseInt("0600",8),compress:!1},t=Object.assign({},n,e);return Ja(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(t)}`),t}(t),e!==n){if(await Ka.pathExists(e))if(Ja(`moveAndMaybeCompressFile: moving file from ${e} to ${n} ${t.compress?"with":"without"} compress`),t.compress)await new Promise(((i,a)=>{let o=!1;const s=Ka.createWriteStream(n,{mode:t.mode,flags:"wx"}).on("open",(()=>{o=!0;const n=Ka.createReadStream(e).on("open",(()=>{n.pipe(Ga.createGzip()).pipe(s)})).on("error",(n=>{Ja(`moveAndMaybeCompressFile: error reading ${e}`,n),s.destroy(n)}))})).on("finish",(()=>{Ja(`moveAndMaybeCompressFile: finished compressing ${n}, deleting ${e}`),Ka.unlink(e).then(i).catch((n=>{Ja(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,n),Ka.truncate(e).then(i).catch((n=>{Ja(`moveAndMaybeCompressFile: error truncating ${e}`,n),a(n)}))}))})).on("error",(e=>{o?(Ja(`moveAndMaybeCompressFile: error writing ${n}, deleting`,e),Ka.unlink(n).then((()=>{a(e)})).catch((e=>{Ja(`moveAndMaybeCompressFile: error deleting ${n}`,e),a(e)}))):(Ja(`moveAndMaybeCompressFile: error creating ${n}`,e),a(e))}))})).catch((()=>{}));else{Ja(`moveAndMaybeCompressFile: renaming ${e} to ${n}`);try{await Ka.move(e,n,{overwrite:!0})}catch(t){if(Ja(`moveAndMaybeCompressFile: error renaming ${e} to ${n}`,t),"ENOENT"!==t.code){Ja("moveAndMaybeCompressFile: trying copy+truncate instead");try{await Ka.copy(e,n,{overwrite:!0}),await Ka.truncate(e)}catch(e){Ja("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else Ja("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Ya=O("streamroller:RollingFileWriteStream"),Xa=dn,Qa=l,Za=p,eo=()=>new Date,no=V,{Writable:to}=m,io=({file:e,keepFileExt:n,needsIndex:t,alwaysIncludeDate:i,compress:a,fileNameSep:o})=>{let s=o||".";const r=qa.join(e.dir,e.name),c=n=>n+e.ext,p=(e,n,i)=>!t&&i||!n?e:e+s+n,l=(e,n,t)=>(n>0||i)&&t?e+s+t:e,u=(e,n)=>n&&a?e+".gz":e,d=n?[l,p,c,u]:[c,l,p,u];return({date:e,index:n})=>($a(`_formatFileName: date=${e}, index=${n}`),d.reduce(((t,i)=>i(t,n,e)),r))},ao=({file:e,keepFileExt:n,pattern:t,fileNameSep:i})=>{let a=i||".";const o="__NOT_MATCHING__";let s=[(e,n)=>e.endsWith(".gz")?(Wa("it is gzipped"),n.isCompressed=!0,e.slice(0,-3)):e,n?n=>n.startsWith(e.name)&&n.endsWith(e.ext)?(Wa("it starts and ends with the right things"),n.slice(e.name.length+1,-1*e.ext.length)):o:n=>n.startsWith(e.base)?(Wa("it starts with the right things"),n.slice(e.base.length+1)):o,t?(e,n)=>{const i=e.split(a);let o=i[i.length-1];Wa("items: ",i,", indexStr: ",o);let s=e;void 0!==o&&o.match(/^\d+$/)?(s=e.slice(0,-1*(o.length+1)),Wa(`dateStr is ${s}`),t&&!s&&(s=o,o="0")):o="0";try{const i=Ha.parse(t,s,new Date(0,0));return Ha.asString(t,i)!==s?e:(n.index=parseInt(o,10),n.date=s,n.timestamp=i.getTime(),"")}catch(n){return Wa(`Problem parsing ${s} as ${t}, error was: `,n),e}}:(e,n)=>e.match(/^\d+$/)?(Wa("it has an index"),n.index=parseInt(e,10),""):e];return e=>{let n={filename:e,index:0,isCompressed:!1};return s.reduce(((e,t)=>t(e,n)),e)?null:n}},oo=Va;var so=class extends to{constructor(e,n){if(Ya(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(Qa.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${Qa.sep}`)&&(e=e.replace("~",Za.homedir())),super(n),this.options=this._parseOption(n),this.fileObject=Qa.parse(e),""===this.fileObject.dir&&(this.fileObject=Qa.parse(Qa.join(process.cwd(),e))),this.fileFormatter=io({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=ao({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=no(this.options.pattern,eo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Ya(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=Xa.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=no(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const n={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},t=Object.assign({},n,e);if(t.maxSize){if(t.maxSize<=0)throw new Error(`options.maxSize (${t.maxSize}) should be > 0`)}else delete t.maxSize;if(t.numBackups||0===t.numBackups){if(t.numBackups<0)throw new Error(`options.numBackups (${t.numBackups}) should be >= 0`);if(t.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${t.numBackups}) should be < Number.MAX_SAFE_INTEGER`);t.numToKeep=t.numBackups+1}else if(t.numToKeep<=0)throw new Error(`options.numToKeep (${t.numToKeep}) should be > 0`);return Ya(`_parseOption: creating stream with option=${JSON.stringify(t)}`),t}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,n,t){this._shouldRoll().then((()=>{Ya(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,n,(n=>{this.state.currentSize+=e.length,t(n)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Ya(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==no(this.options.pattern,eo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Ya("_roll: closing the current stream"),new Promise(((e,n)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(n)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let n=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;n>=0;n--){Ya(`_moveOldFiles: i = ${n}`);const e=this.fileFormatter({date:this.state.currentDate,index:n}),t=this.fileFormatter({date:this.state.currentDate,index:n+1}),i={compress:this.options.compress&&0===n,mode:this.options.mode};await oo(e,t,i)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?no(this.options.pattern,eo()):null,Ya(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,n)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(n)}))}))}async _getExistingFiles(){const e=await Xa.readdir(this.fileObject.dir).catch((()=>[]));Ya(`_getExistingFiles: files=${e}`);const n=e.map((e=>this.fileNameParser(e))).filter((e=>e)),t=e=>(e.timestamp?e.timestamp:eo().getTime())-e.index;return n.sort(((e,n)=>t(e)-t(n))),n}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),n=e=>{try{return Xa.mkdirSync(e,{recursive:!0})}catch(t){if("ENOENT"===t.code)return n(Qa.dirname(e)),n(e);if("EEXIST"!==t.code&&"EROFS"!==t.code)throw t;try{if(Xa.statSync(e).isDirectory())return e;throw t}catch(e){throw t}}};n(this.fileObject.dir);const t={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var i,a;Xa.appendFileSync(e,"",(i={...t},a="flags",i["flag"]=i[a],delete i[a],i)),this.currentFileStream=Xa.createWriteStream(e,t),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await this._getExistingFiles();if(Ya(`_clean: numToKeep = ${this.options.numToKeep}, existingFiles = ${e.length}`),Ya("_clean: existing files are: ",e),this._tooManyFiles(e.length)){const t=e.slice(0,e.length-this.options.numToKeep).map((e=>Qa.format({dir:this.fileObject.dir,base:e.filename})));await(n=t,Ya(`deleteFiles: files to delete: ${n}`),Promise.all(n.map((e=>Xa.unlink(e).catch((n=>{Ya(`deleteFiles: error when unlinking ${e}, ignoring. Error was ${n}`)}))))))}var n}_tooManyFiles(e){return this.options.numToKeep>0&&e>this.options.numToKeep}};const ro=so;var co=class extends ro{constructor(e,n,t,i){i||(i={}),n&&(i.maxSize=n),i.numBackups||0===i.numBackups||(t||0===t||(t=1),i.numBackups=t),super(e,i),this.backups=i.numBackups,this.size=this.options.maxSize}get theStream(){return this.currentFileStream}};const po=so;var lo={RollingFileWriteStream:so,RollingFileStream:co,DateRollingFileStream:class extends po{constructor(e,n,t){n&&"object"==typeof n&&(t=n,n=null),t||(t={}),n||(n="yyyy-MM-dd"),t.pattern=n,t.numBackups||0===t.numBackups?t.daysToKeep=t.numBackups:(t.daysToKeep||0===t.daysToKeep?process.emitWarning("options.daysToKeep is deprecated due to the confusion it causes when used together with file size rolling. Please use options.numBackups instead.","DeprecationWarning","streamroller-DEP0001"):t.daysToKeep=1,t.numBackups=t.daysToKeep),super(e,t),this.mode=this.options.mode}get theStream(){return this.currentFileStream}}};const uo=O("log4js:file"),mo=l,fo=lo,ho=p,xo=ho.EOL;let vo=!1;const yo=new Set;function go(){yo.forEach((e=>{e.sighupHandler()}))}un.configure=function(e,n){let t=n.basicLayout;return e.layout&&(t=n.layout(e.layout.type,e.layout)),e.mode=e.mode||384,function(e,n,t,i,a,o){if("string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(mo.sep))throw new Error(`Filename is a directory: ${e}`);function s(e,n,t,i){const a=new fo.RollingFileStream(e,n,t,i);return a.on("error",(n=>{console.error("log4js.fileAppender - Writing to file %s, error happened ",e,n)})),a.on("drain",(()=>{process.emit("log4js:pause",!1)})),a}0===e.indexOf(`~${mo.sep}`)&&(e=e.replace("~",ho.homedir())),e=mo.normalize(e),uo("Creating file appender (",e,", ",t,", ",i=i||0===i?i:5,", ",a,", ",o,")");let r=s(e,t,i,a);const c=function(e){if(r.writable){if(!0===a.removeColor){const n=/\x1b[[0-9;]*m/g;e.data=e.data.map((e=>"string"==typeof e?e.replace(n,""):e))}r.write(n(e,o)+xo,"utf8")||process.emit("log4js:pause",!0)}};return c.reopen=function(){r.end((()=>{r=s(e,t,i,a)}))},c.sighupHandler=function(){uo("SIGHUP handler called."),c.reopen()},c.shutdown=function(e){yo.delete(c),0===yo.size&&vo&&(process.removeListener("SIGHUP",go),vo=!1),r.end("","utf-8",e)},yo.add(c),vo||(process.on("SIGHUP",go),vo=!0),c}(e.filename,t,e.maxLogSize,e.backups,e,e.timezoneOffset)};var bo={};const wo=lo,So=p.EOL;function ko(e,n,t,i,a){i.maxSize=i.maxLogSize;const o=function(e,n,t){const i=new wo.DateRollingFileStream(e,n,t);return i.on("error",(n=>{console.error("log4js.dateFileAppender - Writing to file %s, error happened ",e,n)})),i.on("drain",(()=>{process.emit("log4js:pause",!1)})),i}(e,n,i),s=function(e){o.writable&&(o.write(t(e,a)+So,"utf8")||process.emit("log4js:pause",!0))};return s.shutdown=function(e){o.end("","utf-8",e)},s}bo.configure=function(e,n){let t=n.basicLayout;return e.layout&&(t=n.layout(e.layout.type,e.layout)),e.alwaysIncludePattern||(e.alwaysIncludePattern=!1),e.mode=e.mode||384,ko(e.filename,e.pattern,t,e,e.timezoneOffset)};var Eo={};const jo=O("log4js:fileSync"),_o=l,Oo=c,To=p,Fo=To.EOL;function Ao(e,n){const t=e=>{try{return Oo.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(_o.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(Oo.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(_o.dirname(e)),Oo.appendFileSync(e,"",{mode:n.mode,flag:n.flags})}class Co{constructor(e,n,t,i){if(jo("In RollingFileStream"),n<0)throw new Error(`maxLogSize (${n}) should be > 0`);this.filename=e,this.size=n,this.backups=t,this.options=i,this.currentSize=0,this.currentSize=function(e){let n=0;try{n=Oo.statSync(e).size}catch(n){Ao(e,i)}return n}(this.filename)}shouldRoll(){return jo("should roll with current size %d, and max size %d",this.currentSize,this.size),this.currentSize>=this.size}roll(e){const n=this,t=new RegExp(`^${_o.basename(e)}`);function i(e){return t.test(e)}function a(n){return parseInt(n.slice(`${_o.basename(e)}.`.length),10)||0}function o(e,n){return a(e)-a(n)}function s(t){const i=a(t);if(jo(`Index of ${t} is ${i}`),0===n.backups)Oo.truncateSync(e,0);else if(i<n.backups){try{Oo.unlinkSync(`${e}.${i+1}`)}catch(e){}jo(`Renaming ${t} -> ${e}.${i+1}`),Oo.renameSync(_o.join(_o.dirname(e),t),`${e}.${i+1}`)}}jo("Rolling, rolling, rolling"),jo("Renaming the old files"),Oo.readdirSync(_o.dirname(e)).filter(i).sort(o).reverse().forEach(s)}write(e,n){const t=this;jo("in write"),this.shouldRoll()&&(this.currentSize=0,this.roll(this.filename)),jo("writing the chunk to the file"),t.currentSize+=e.length,Oo.appendFileSync(t.filename,e)}}Eo.configure=function(e,n){let t=n.basicLayout;e.layout&&(t=n.layout(e.layout.type,e.layout));const i={flags:e.flags||"a",encoding:e.encoding||"utf8",mode:e.mode||384};return function(e,n,t,i,a,o){if("string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(_o.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${_o.sep}`)&&(e=e.replace("~",To.homedir())),e=_o.normalize(e),jo("Creating fileSync appender (",e,", ",t,", ",i=i||0===i?i:5,", ",a,", ",o,")");const s=function(e,n,t){let i;var o;return n?i=new Co(e,n,t,a):(Ao(o=e,a),i={write(e){Oo.appendFileSync(o,e)}}),i}(e,t,i);return e=>{s.write(n(e,o)+Fo)}}(e.filename,t,e.maxLogSize,e.backups,i,e.timezoneOffset)};var Ro={};const Po=O("log4js:tcp"),No=x;Ro.configure=function(e,n){Po(`configure with config = ${e}`);let t=function(e){return e.serialise()};return e.layout&&(t=n.layout(e.layout.type,e.layout)),function(e,n){let t=!1;const i=[];let a,o=3,s="__LOG4JS__";function r(e){Po("Writing log event to socket"),t=a.write(`${n(e)}${s}`,"utf8")}function c(){let e;for(Po("emptying buffer");e=i.shift();)r(e)}function p(e){t?r(e):(Po("buffering log event because it cannot write at the moment"),i.push(e))}return function n(){Po(`appender creating socket to ${e.host||"localhost"}:${e.port||5e3}`),s=`${e.endMsg||"__LOG4JS__"}`,a=No.createConnection(e.port||5e3,e.host||"localhost"),a.on("connect",(()=>{Po("socket connected"),c(),t=!0})),a.on("drain",(()=>{Po("drain event received, emptying buffer"),t=!0,c()})),a.on("timeout",a.end.bind(a)),a.on("error",(e=>{Po("connection error",e),t=!1,c()})),a.on("close",n)}(),p.shutdown=function(e){Po("shutdown called"),i.length&&o?(Po("buffer has items, waiting 100ms to empty"),o-=1,setTimeout((()=>{p.shutdown(e)}),100)):(a.removeAllListeners("close"),a.end(e))},p}(e,t)};const Lo=l,Do=O("log4js:appenders"),Io=G,zo=Ye,Mo=xe,Bo=de,Uo=Xe,$o=new Map;$o.set("console",nn),$o.set("stdout",an),$o.set("stderr",on),$o.set("logLevelFilter",sn),$o.set("categoryFilter",rn),$o.set("noLogFilter",pn),$o.set("file",un),$o.set("dateFile",bo),$o.set("fileSync",Eo),$o.set("tcp",Ro);const qo=new Map,Wo=(e,n)=>{let t;try{const n=`${e}.cjs`;t=require.resolve(n),Do("Loading module from ",n)}catch(n){t=e,Do("Loading module from ",e)}try{return function(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}(t)}catch(t){return void Io.throwExceptionIf(n,"MODULE_NOT_FOUND"!==t.code,`appender "${e}" could not be loaded (error was: ${t})`)}},Ho=new Set,Jo=(e,n)=>{if(qo.has(e))return qo.get(e);if(!n.appenders[e])return!1;if(Ho.has(e))throw new Error(`Dependency loop detected for appender ${e}.`);Ho.add(e),Do(`Creating appender ${e}`);const t=Ko(e,n);return Ho.delete(e),qo.set(e,t),t},Ko=(e,n)=>{const t=n.appenders[e],i=t.type.configure?t.type:((e,n)=>$o.get(e)||Wo(`./${e}`,n)||Wo(e,n)||require.main&&require.main.filename&&Wo(Lo.join(Lo.dirname(require.main.filename),e),n)||Wo(Lo.join(process.cwd(),e),n))(t.type,n);return Io.throwExceptionIf(n,Io.not(i),`appender "${e}" is not valid (type "${t.type}" could not be found)`),i.appender&&(process.emitWarning(`Appender ${t.type} exports an appender function.`,"DeprecationWarning","log4js-node-DEP0001"),Do("[log4js-node-DEP0001]",`DEPRECATION: Appender ${t.type} exports an appender function.`)),i.shutdown&&(process.emitWarning(`Appender ${t.type} exports a shutdown function.`,"DeprecationWarning","log4js-node-DEP0002"),Do("[log4js-node-DEP0002]",`DEPRECATION: Appender ${t.type} exports a shutdown function.`)),Do(`${e}: clustering.isMaster ? ${zo.isMaster()}`),Do(`${e}: appenderModule is ${o.inspect(i)}`),zo.onlyOnMaster((()=>(Do(`calling appenderModule.configure for ${e} / ${t.type}`),i.configure(Uo.modifyConfig(t),Bo,(e=>Jo(e,n)),Mo))),(()=>{}))},Go=e=>{if(qo.clear(),Ho.clear(),!e)return;const n=[];Object.values(e.categories).forEach((e=>{n.push(...e.appenders)})),Object.keys(e.appenders).forEach((t=>{(n.includes(t)||"tcp-server"===e.appenders[t].type||"multiprocess"===e.appenders[t].type)&&Jo(t,e)}))},Vo=()=>{Go()};Vo(),Io.addListener((e=>{Io.throwExceptionIf(e,Io.not(Io.anObject(e.appenders)),'must have a property "appenders" of type object.');const n=Object.keys(e.appenders);Io.throwExceptionIf(e,Io.not(n.length),"must define at least one appender."),n.forEach((n=>{Io.throwExceptionIf(e,Io.not(e.appenders[n].type),`appender "${n}" is not valid (must be an object with property "type")`)}))})),Io.addListener(Go),ye.exports=qo,ve.init=Vo;var Yo={};!function(e){const n=O("log4js:categories"),t=G,i=xe,a=ve,o=new Map;function s(e,n,t){if(!1===n.inherit)return;const i=t.lastIndexOf(".");if(i<0)return;const a=t.slice(0,i);let o=e.categories[a];o||(o={inherit:!0,appenders:[]}),s(e,o,a),!e.categories[a]&&o.appenders&&o.appenders.length&&o.level&&(e.categories[a]=o),n.appenders=n.appenders||[],n.level=n.level||o.level,o.appenders.forEach((e=>{n.appenders.includes(e)||n.appenders.push(e)})),n.parent=o}function r(e){if(!e.categories)return;Object.keys(e.categories).forEach((n=>{const t=e.categories[n];s(e,t,n)}))}t.addPreProcessingListener((e=>r(e))),t.addListener((e=>{t.throwExceptionIf(e,t.not(t.anObject(e.categories)),'must have a property "categories" of type object.');const n=Object.keys(e.categories);t.throwExceptionIf(e,t.not(n.length),"must define at least one category."),n.forEach((n=>{const o=e.categories[n];t.throwExceptionIf(e,[t.not(o.appenders),t.not(o.level)],`category "${n}" is not valid (must be an object with properties "appenders" and "level")`),t.throwExceptionIf(e,t.not(Array.isArray(o.appenders)),`category "${n}" is not valid (appenders must be an array of appender names)`),t.throwExceptionIf(e,t.not(o.appenders.length),`category "${n}" is not valid (appenders must contain at least one appender name)`),Object.prototype.hasOwnProperty.call(o,"enableCallStack")&&t.throwExceptionIf(e,"boolean"!=typeof o.enableCallStack,`category "${n}" is not valid (enableCallStack must be boolean type)`),o.appenders.forEach((i=>{t.throwExceptionIf(e,t.not(a.get(i)),`category "${n}" is not valid (appender "${i}" is not defined)`)})),t.throwExceptionIf(e,t.not(i.getLevel(o.level)),`category "${n}" is not valid (level "${o.level}" not recognised; valid levels are ${i.levels.join(", ")})`)})),t.throwExceptionIf(e,t.not(e.categories.default),'must define a "default" category.')}));const c=e=>{if(o.clear(),!e)return;Object.keys(e.categories).forEach((t=>{const s=e.categories[t],r=[];s.appenders.forEach((e=>{r.push(a.get(e)),n(`Creating category ${t}`),o.set(t,{appenders:r,level:i.getLevel(s.level),enableCallStack:s.enableCallStack||!1})}))}))},p=()=>{c()};p(),t.addListener(c);const l=e=>{if(n(`configForCategory: searching for config for ${e}`),o.has(e))return n(`configForCategory: ${e} exists in config, returning it`),o.get(e);let t;return e.indexOf(".")>0?(n(`configForCategory: ${e} has hierarchy, cloning from parents`),t={...l(e.slice(0,e.lastIndexOf(".")))}):(o.has("default")||c({categories:{default:{appenders:["out"],level:"OFF"}}}),n("configForCategory: cloning default category"),t={...o.get("default")}),o.set(e,t),t};e.exports=o,e.exports=Object.assign(e.exports,{appendersForCategory:e=>l(e).appenders,getLevelForCategory:e=>l(e).level,setLevelForCategory:(e,n)=>{l(e).level=n},getEnableCallStackForCategory:e=>!0===l(e).enableCallStack,setEnableCallStackForCategory:(e,n)=>{l(e).enableCallStack=n},init:p})}({get exports(){return Yo},set exports(e){Yo=e}});const Xo=O("log4js:logger"),Qo=Ie,Zo=xe,es=Ye,ns=Yo,ts=G,is=/^(?:\s*)at (?:(.+) \()?(?:([^(]+?):(\d+):(\d+))\)?$/;function as(e,n=4){try{const t=e.stack.split("\n").slice(n);if(!t.length)return null;const i=is.exec(t[0]);if(i&&5===i.length){let e="",n="",a="";return i[1]&&""!==i[1]&&([n,a]=i[1].replace(/[[\]]/g,"").split(" as "),a=a||"",n.includes(".")&&([e,n]=n.split("."))),{fileName:i[2],lineNumber:parseInt(i[3],10),columnNumber:parseInt(i[4],10),callStack:t.join("\n"),className:e,functionName:n,functionAlias:a,callerName:i[1]||""}}console.error("log4js.logger - defaultParseCallStack error")}catch(e){console.error("log4js.logger - defaultParseCallStack error",e)}return null}let os=class{constructor(e){if(!e)throw new Error("No category provided.");this.category=e,this.context={},this.callStackSkipIndex=0,this.parseCallStack=as,Xo(`Logger created (${this.category}, ${this.level})`)}get level(){return Zo.getLevel(ns.getLevelForCategory(this.category),Zo.OFF)}set level(e){ns.setLevelForCategory(this.category,Zo.getLevel(e,this.level))}get useCallStack(){return ns.getEnableCallStackForCategory(this.category)}set useCallStack(e){ns.setEnableCallStackForCategory(this.category,!0===e)}get callStackLinesToSkip(){return this.callStackSkipIndex}set callStackLinesToSkip(e){if("number"!=typeof e)throw new TypeError("Must be a number");if(e<0)throw new RangeError("Must be >= 0");this.callStackSkipIndex=e}log(e,...n){const t=Zo.getLevel(e);t?this.isLevelEnabled(t)&&this._log(t,n):ts.validIdentifier(e)&&n.length>0?(this.log(Zo.WARN,"log4js:logger.log: valid log-level not found as first parameter given:",e),this.log(Zo.INFO,`[${e}]`,...n)):this.log(Zo.INFO,e,...n)}isLevelEnabled(e){return this.level.isLessThanOrEqualTo(e)}_log(e,n){Xo(`sending log data (${e}) to appenders`);const t=n.find((e=>e instanceof Error));let i;if(this.useCallStack){try{t&&(i=this.parseCallStack(t,this.callStackSkipIndex+1))}catch(e){}i=i||this.parseCallStack(new Error,this.callStackSkipIndex+3+1)}const a=new Qo(this.category,e,n,this.context,i,t);es.send(a)}addContext(e,n){this.context[e]=n}removeContext(e){delete this.context[e]}clearContext(){this.context={}}setParseCallStackFunction(e){if("function"==typeof e)this.parseCallStack=e;else{if(void 0!==e)throw new TypeError("Invalid type passed to setParseCallStackFunction");this.parseCallStack=as}}};function ss(e){const n=Zo.getLevel(e),t=n.toString().toLowerCase().replace(/_([a-z])/g,(e=>e[1].toUpperCase())),i=t[0].toUpperCase()+t.slice(1);os.prototype[`is${i}Enabled`]=function(){return this.isLevelEnabled(n)},os.prototype[t]=function(...e){this.log(n,...e)}}Zo.levels.forEach(ss),ts.addListener((()=>{Zo.levels.forEach(ss)}));var rs=os;const cs=xe;function ps(e){return e.originalUrl||e.url}function ls(e,n){for(let t=0;t<n.length;t++)e=e.replace(n[t].token,n[t].replacement);return e}const us=O("log4js:recording"),ds=[];function ms(){return ds.slice()}function fs(){ds.length=0}var hs={configure:function(){return function(e){us(`received logEvent, number of events now ${ds.length+1}`),us("log event was ",e),ds.push(e)}},replay:ms,playback:ms,reset:fs,erase:fs};const xs=O("log4js:main"),vs=c,ys=M({proto:!0}),gs=G,bs=ve,ws=Yo,Ss=rs,ks=Ye,Es=hs;let js=!1;function _s(e){if(!js)return;xs("Received log event ",e);ws.appendersForCategory(e.categoryName).forEach((n=>{n(e)}))}function Os(e){js&&Ts();let n=e;return"string"==typeof n&&(n=function(e){xs(`Loading configuration from ${e}`);try{return JSON.parse(vs.readFileSync(e,"utf8"))}catch(n){throw new Error(`Problem reading config from file "${e}". Error was ${n.message}`,n)}}(e)),xs(`Configuration is ${n}`),gs.configure(ys(n)),ks.onMessage(_s),js=!0,Fs}function Ts(e=(()=>{})){if("function"!=typeof e)throw new TypeError("Invalid callback passed to shutdown");xs("Shutdown called. Disabling all log writing."),js=!1;const n=Array.from(bs.values());bs.init(),ws.init();const t=n.reduce(((e,n)=>n.shutdown?e+1:e),0);0===t&&(xs("No appenders with shutdown functions found."),e());let i,a=0;function o(n){i=i||n,a+=1,xs(`Appender shutdowns complete: ${a} / ${t}`),a>=t&&(xs("All shutdown functions completed."),e(i))}xs(`Found ${t} appenders with shutdown functions.`),n.filter((e=>e.shutdown)).forEach((e=>e.shutdown(o)))}const Fs={getLogger:function(e){return js||Os(process.env.LOG4JS_CONFIG||{appenders:{out:{type:"stdout"}},categories:{default:{appenders:["out"],level:"OFF"}}}),new Ss(e||"default")},configure:Os,isConfigured:function(){return js},shutdown:Ts,connectLogger:function(e,n){n="string"==typeof n||"function"==typeof n?{format:n}:n||{};const t=e;let i=cs.getLevel(n.level,cs.INFO);const a=n.format||':remote-addr - - ":method :url HTTP/:http-version" :status :content-length ":referrer" ":user-agent"';return(e,o,s)=>{if(void 0!==e._logging)return s();if("function"!=typeof n.nolog){const t=function(e){let n=null;if(e instanceof RegExp&&(n=e),"string"==typeof e&&(n=new RegExp(e)),Array.isArray(e)){const t=e.map((e=>e.source?e.source:e));n=new RegExp(t.join("|"))}return n}(n.nolog);if(t&&t.test(e.originalUrl))return s()}if(t.isLevelEnabled(i)||"auto"===n.level){const s=new Date,{writeHead:r}=o;e._logging=!0,o.writeHead=(e,n)=>{o.writeHead=r,o.writeHead(e,n),o.__statusCode=e,o.__headers=n||{}};let c=!1;const p=()=>{if(c)return;if(c=!0,"function"==typeof n.nolog&&!0===n.nolog(e,o))return void(e._logging=!1);o.responseTime=new Date-s,o.statusCode&&"auto"===n.level&&(i=cs.INFO,o.statusCode>=300&&(i=cs.WARN),o.statusCode>=400&&(i=cs.ERROR)),i=function(e,n,t){let i=n;if(t){const n=t.find((n=>{let t=!1;return t=n.from&&n.to?e>=n.from&&e<=n.to:-1!==n.codes.indexOf(e),t}));n&&(i=cs.getLevel(n.level,i))}return i}(o.statusCode,i,n.statusRules);const r=function(e,n,t){const i=[];return i.push({token:":url",replacement:ps(e)}),i.push({token:":protocol",replacement:e.protocol}),i.push({token:":hostname",replacement:e.hostname}),i.push({token:":method",replacement:e.method}),i.push({token:":status",replacement:n.__statusCode||n.statusCode}),i.push({token:":response-time",replacement:n.responseTime}),i.push({token:":date",replacement:(new Date).toUTCString()}),i.push({token:":referrer",replacement:e.headers.referer||e.headers.referrer||""}),i.push({token:":http-version",replacement:`${e.httpVersionMajor}.${e.httpVersionMinor}`}),i.push({token:":remote-addr",replacement:e.headers["x-forwarded-for"]||e.ip||e._remoteAddress||e.socket&&(e.socket.remoteAddress||e.socket.socket&&e.socket.socket.remoteAddress)}),i.push({token:":user-agent",replacement:e.headers["user-agent"]}),i.push({token:":content-length",replacement:n.getHeader("content-length")||n.__headers&&n.__headers["Content-Length"]||"-"}),i.push({token:/:req\[([^\]]+)]/g,replacement:(n,t)=>e.headers[t.toLowerCase()]}),i.push({token:/:res\[([^\]]+)]/g,replacement:(e,t)=>n.getHeader(t.toLowerCase())||n.__headers&&n.__headers[t]}),(e=>{const n=e.concat();for(let e=0;e<n.length;++e)for(let t=e+1;t<n.length;++t)n[e].token==n[t].token&&n.splice(t--,1);return n})(t.concat(i))}(e,o,n.tokens||[]);if(n.context&&t.addContext("res",o),"function"==typeof a){const n=a(e,o,(e=>ls(e,r)));n&&t.log(i,n)}else t.log(i,ls(a,r));n.context&&t.removeContext("res")};o.on("end",p),o.on("finish",p),o.on("error",p),o.on("close",p)}return s()}},levels:xe,addLayout:de.addLayout,recording:function(){return Es}};var As=Fs;As.configure({appenders:{std:{type:"stdout"},output:{type:{configure:(e,n,t,i)=>{let a=n.basicLayout;return e.layout&&(a=n.layout(e.layout.type,e.layout)),function(e,n){return t=>{if(t.context.outputHandler?.write){const i=`${e(t,n)}\n`;t.context.outputHandler.write(i)}}}(a,e.timezoneOffset)}}}},categories:{default:{appenders:["std"],level:"info"},pipeline:{appenders:["std","output"],level:"info"}}});const Cs=As.getLogger("default");function Rs(e){const n=As.getLogger("pipeline");return n.addContext("outputHandler",{write:e}),n}class Ps{id;context={};pipeline;logs={};_loggers={};trigger;constructor(e,n,t){this.id=e,this.pipeline=t,this.trigger=n}start(e){const n=(new Date).getTime();this.logs[e.id]=[],this._loggers[e.id]=Rs((n=>{this.logs[e.id].push(n)}));const t=e.input,i={output:{},input:s.cloneDeep(t),status:exports.ResultType.start,startTime:n,result:exports.ResultType.start};return e.status=i,this.log(e,"开始执行"),i}success(e){const n=(new Date).getTime(),t=e.status;s.merge(t,{status:"success",endTime:n,result:"success"}),this.log(e,"执行成功")}skip(e){const n=(new Date).getTime(),t=e.status;s.merge(t,{status:"success",endTime:n,result:"skip"}),this.log(e,"跳过")}error(e,n){const t=(new Date).getTime(),i=e.status;s.merge(i,{status:exports.ResultType.error,endTime:t,result:exports.ResultType.error,message:n.message}),this.logError(e,n)}log(e,n){this._loggers[e.id].info(`[${e.title}]<id:${e.id}> [${e.runnableType}]`,n)}logError(e,n){this._loggers[e.id].error(`[${e.title}]<id:${e.id}> [${e.runnableType}]`,n)}finally(e){}}class Ns{collection={};pipeline;constructor(e){if(!e)return;this.pipeline=e;const n=this.toMap(e);this.collection=n}static each(e,n){e.forEach((e=>{n(e),"pipeline"===e.runnableType?Ns.each(e.stages,n):"stage"===e.runnableType?Ns.each(e.tasks,n):"task"===e.runnableType&&Ns.each(e.steps,n)}))}toMap(e){const n={};return Ns.each(e.stages,(e=>{n[e.id]=e})),n}get(e){return this.collection[e]}clear(){this.pipeline&&Ns.each(this.pipeline.stages,(e=>{e.status=void 0}))}}var Ls;exports.ContextScope=void 0,(Ls=exports.ContextScope||(exports.ContextScope={}))[Ls.global=0]="global",Ls[Ls.pipeline=1]="pipeline",Ls[Ls.runtime=2]="runtime";class Ds{storage={};register(e,n){e&&null!=n&&(this.storage[e]=n)}get(e){if(!e)throw new Error("插件名称不能为空");const n=this.storage[e];if(!n)throw new Error(`插件${e}还未注册`);return n}getStorage(){return this.storage}getDefineList(){const e=[];for(const n in this.storage){const t=this.getDefine(n);t&&e.push({...t,key:n})}return e}getDefine(e){const n=this.storage[e];if(n)return n.define}}const Is=new Ds,zs={};function Ms(e,n){let t=zs[e];null==t&&(t={},zs[e]=t),t[n]=!0}const Bs={target:function(e,n){return"object"==typeof e&&e.constructor&&(e=e.constructor),null!=n&&Ms(e,n),e},attachProperty:Ms,getClassProperties:function(e){return zs[e]||{}},inject:function(e,n,t,i){s.forEach(e,((e,a)=>{i&&i(e,a,n,t),null!=t[a]&&(n[a]=t[a])}))}},Us="pipeline:autowire";
|
|
3
|
+
const{parse:be,stringify:we}=JSON,{keys:Se}=Object,ke=String,Ee="string",je={},_e="object",Oe=(e,n)=>n,Te=e=>e instanceof ke?ke(e):e,Fe=(e,n)=>typeof n===Ee?new ke(n):n,Ae=(e,n,t,i)=>{const a=[];for(let o=Se(t),{length:s}=o,r=0;r<s;r++){const s=o[r],c=t[s];if(c instanceof ke){const o=e[c];typeof o!==_e||n.has(o)?t[s]=i.call(t,s,o):(n.add(o),t[s]=je,a.push({k:s,a:[e,n,o,i]}))}else t[s]!==je&&(t[s]=i.call(t,s,c))}for(let{length:e}=a,n=0;n<e;n++){const{k:e,a:o}=a[n];t[e]=i.call(t,e,Ae.apply(null,o))}return t},Ce=(e,n,t)=>{const i=ke(n.push(t)-1);return e.set(t,i),i},Re=(e,n)=>{const t=be(e,Fe).map(Te),i=t[0],a=n||Oe,o=typeof i===_e&&i?Ae(t,new Set,i,a):i;return a.call({"":o},"",o)};ge.parse=Re;const Pe=(e,n,t)=>{const i=n&&typeof n===_e?(e,t)=>""===e||-1<n.indexOf(e)?t:void 0:n||Oe,a=new Map,o=[],s=[];let r=+Ce(a,o,i.call({"":e},"",e)),c=!r;for(;r<o.length;)c=!0,s[r]=we(o[r++],p,t);return"["+s.join(",")+"]";function p(e,n){if(c)return c=!c,n;const t=i.call(this,e,n);switch(typeof t){case _e:if(null===t)return t;case Ee:return a.get(t)||Ce(a,o,t)}return t}};ge.stringify=Pe;ge.toJSON=e=>be(Pe(e));ge.fromJSON=e=>Re(we(e));const Ne=ge,Le=xe;const De=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const n=this.deMap[e];this.serMap[n]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};var Ie=class e{constructor(e,n,t,i,a,o){if(this.startTime=new Date,this.categoryName=e,this.data=t,this.level=n,this.context=Object.assign({},i),this.pid=process.pid,this.error=o,void 0!==a){if(!a||"object"!=typeof a||Array.isArray(a))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==a[e]&&(this[e]=a[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ne.stringify(this,((e,n)=>(n instanceof Error&&(n=Object.assign({message:n.message,stack:n.stack},n)),De.serialise(n))))}static deserialise(n){let t;try{const i=Ne.parse(n,((e,n)=>{if(n&&n.message&&n.stack){const e=new Error(n);Object.keys(n).forEach((t=>{e[t]=n[t]})),n=e}return De.deserialise(n)}));this._getLocationKeys().forEach((e=>{void 0!==i[e]&&(i.location||(i.location={}),i.location[e]=i[e])})),t=new e(i.categoryName,Le.getLevel(i.level.levelStr),i.data,i.context,i.location,i.error),t.startTime=new Date(i.startTime),t.pid=i.pid,i.cluster&&(t.cluster=i.cluster)}catch(i){t=new e("log4js",Le.ERROR,["Unable to parse log:",n,"because: ",i])}return t}};const ze=O("log4js:clustering"),Me=Ie,Be=G;let Ue=!1,$e=null;try{$e=require("cluster")}catch(e){ze("cluster module not present"),Ue=!0}const qe=[];let We=!1,He="NODE_APP_INSTANCE";const Je=()=>We&&"0"===process.env[He],Ke=()=>Ue||$e&&$e.isMaster||Je(),Ge=e=>{qe.forEach((n=>n(e)))},Ve=(e,n)=>{if(ze("cluster message received from worker ",e,": ",n),e.topic&&e.data&&(n=e,e=void 0),n&&n.topic&&"log4js:message"===n.topic){ze("received message: ",n.data);const e=Me.deserialise(n.data);Ge(e)}};Ue||Be.addListener((e=>{qe.length=0,({pm2:We,disableClustering:Ue,pm2InstanceVar:He="NODE_APP_INSTANCE"}=e),ze(`clustering disabled ? ${Ue}`),ze(`cluster.isMaster ? ${$e&&$e.isMaster}`),ze(`pm2 enabled ? ${We}`),ze(`pm2InstanceVar = ${He}`),ze(`process.env[${He}] = ${process.env[He]}`),We&&process.removeListener("message",Ve),$e&&$e.removeListener&&$e.removeListener("message",Ve),Ue||e.disableClustering?ze("Not listening for cluster messages, because clustering disabled."):Je()?(ze("listening for PM2 broadcast messages"),process.on("message",Ve)):$e&&$e.isMaster?(ze("listening for cluster messages"),$e.on("message",Ve)):ze("not listening for messages, because we are not a master process")}));var Ye={onlyOnMaster:(e,n)=>Ke()?e():n,isMaster:Ke,send:e=>{Ke()?Ge(e):(We||(e.cluster={workerId:$e.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{qe.push(e)}},Xe={};function Qe(e){if("number"==typeof e&&Number.isInteger(e))return e;const n={K:1024,M:1048576,G:1073741824},t=Object.keys(n),i=e.slice(-1).toLocaleUpperCase(),a=e.slice(0,-1).trim();if(t.indexOf(i)<0||!Number.isInteger(Number(a)))throw Error(`maxLogSize: "${e}" is invalid`);return a*n[i]}function Ze(e){return function(e,n){const t=Object.assign({},n);return Object.keys(e).forEach((i=>{t[i]&&(t[i]=e[i](n[i]))})),t}({maxLogSize:Qe},e)}const en={dateFile:Ze,file:Ze,fileSync:Ze};Xe.modifyConfig=e=>en[e.type]?en[e.type](e):e;var nn={};const tn=console.log.bind(console);nn.configure=function(e,n){let t=n.colouredLayout;return e.layout&&(t=n.layout(e.layout.type,e.layout)),function(e,n){return t=>{tn(e(t,n))}}(t,e.timezoneOffset)};var an={};an.configure=function(e,n){let t=n.colouredLayout;return e.layout&&(t=n.layout(e.layout.type,e.layout)),function(e,n){return t=>{process.stdout.write(`${e(t,n)}\n`)}}(t,e.timezoneOffset)};var on={};on.configure=function(e,n){let t=n.colouredLayout;return e.layout&&(t=n.layout(e.layout.type,e.layout)),function(e,n){return t=>{process.stderr.write(`${e(t,n)}\n`)}}(t,e.timezoneOffset)};var sn={};sn.configure=function(e,n,t,i){const a=t(e.appender);return function(e,n,t,i){const a=i.getLevel(e),o=i.getLevel(n,i.FATAL);return e=>{const n=e.level;a.isLessThanOrEqualTo(n)&&o.isGreaterThanOrEqualTo(n)&&t(e)}}(e.level,e.maxLevel,a,i)};var rn={};const cn=O("log4js:categoryFilter");rn.configure=function(e,n,t){const i=t(e.appender);return function(e,n){return"string"==typeof e&&(e=[e]),t=>{cn(`Checking ${t.categoryName} against ${e}`),-1===e.indexOf(t.categoryName)&&(cn("Not excluded, sending to appender"),n(t))}}(e.exclude,i)};var pn={};const ln=O("log4js:noLogFilter");pn.configure=function(e,n,t){const i=t(e.appender);return function(e,n){return t=>{ln(`Checking data: ${t.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const i=new RegExp(e.join("|"),"i");(0===e.length||t.data.findIndex((e=>i.test(e)))<0)&&(ln("Not excluded, sending to appender"),n(t))}}(e.exclude,i)};var un={},dn={},mn={get exports(){return dn},set exports(e){dn=e}},fn={},hn={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((n,t)=>{arguments[arguments.length]=(e,i)=>{if(e)return t(e);n(i)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const n=arguments[arguments.length-1];if("function"!=typeof n)return e.apply(this,arguments);e.apply(this,arguments).then((e=>n(null,e)),n)}),"name",{value:e.name})}},xn=d,vn=process.cwd,yn=null,gn=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return yn||(yn=vn.call(process)),yn};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var bn=process.chdir;process.chdir=function(e){yn=null,bn.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,bn)}var wn=function(e){xn.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(n,t,i){e.open(n,xn.O_WRONLY|xn.O_SYMLINK,t,(function(n,a){n?i&&i(n):e.fchmod(a,t,(function(n){e.close(a,(function(e){i&&i(n||e)}))}))}))},e.lchmodSync=function(n,t){var i,a=e.openSync(n,xn.O_WRONLY|xn.O_SYMLINK,t),o=!0;try{i=e.fchmodSync(a,t),o=!1}finally{if(o)try{e.closeSync(a)}catch(e){}else e.closeSync(a)}return i}}(e);e.lutimes||function(e){xn.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(n,t,i,a){e.open(n,xn.O_SYMLINK,(function(n,o){n?a&&a(n):e.futimes(o,t,i,(function(n){e.close(o,(function(e){a&&a(n||e)}))}))}))},e.lutimesSync=function(n,t,i){var a,o=e.openSync(n,xn.O_SYMLINK),s=!0;try{a=e.futimesSync(o,t,i),s=!1}finally{if(s)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return a}):e.futimes&&(e.lutimes=function(e,n,t,i){i&&process.nextTick(i)},e.lutimesSync=function(){})}(e);e.chown=i(e.chown),e.fchown=i(e.fchown),e.lchown=i(e.lchown),e.chmod=n(e.chmod),e.fchmod=n(e.fchmod),e.lchmod=n(e.lchmod),e.chownSync=a(e.chownSync),e.fchownSync=a(e.fchownSync),e.lchownSync=a(e.lchownSync),e.chmodSync=t(e.chmodSync),e.fchmodSync=t(e.fchmodSync),e.lchmodSync=t(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=s(e.statSync),e.fstatSync=s(e.fstatSync),e.lstatSync=s(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,n,t){t&&process.nextTick(t)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,n,t,i){i&&process.nextTick(i)},e.lchownSync=function(){});"win32"===gn&&(e.rename="function"!=typeof e.rename?e.rename:function(n){function t(t,i,a){var o=Date.now(),s=0;n(t,i,(function r(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(i,(function(e,o){e&&"ENOENT"===e.code?n(t,i,r):a(c)}))}),s),void(s<100&&(s+=10));a&&a(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(t,n),t}(e.rename));function n(n){return n?function(t,i,a){return n.call(e,t,i,(function(e){r(e)&&(e=null),a&&a.apply(this,arguments)}))}:n}function t(n){return n?function(t,i){try{return n.call(e,t,i)}catch(e){if(!r(e))throw e}}:n}function i(n){return n?function(t,i,a,o){return n.call(e,t,i,a,(function(e){r(e)&&(e=null),o&&o.apply(this,arguments)}))}:n}function a(n){return n?function(t,i,a){try{return n.call(e,t,i,a)}catch(e){if(!r(e))throw e}}:n}function o(n){return n?function(t,i,a){function o(e,n){n&&(n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296)),a&&a.apply(this,arguments)}return"function"==typeof i&&(a=i,i=null),i?n.call(e,t,i,o):n.call(e,t,o)}:n}function s(n){return n?function(t,i){var a=i?n.call(e,t,i):n.call(e,t);return a&&(a.uid<0&&(a.uid+=4294967296),a.gid<0&&(a.gid+=4294967296)),a}:n}function r(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(n){function t(t,i,a,o,s,r){var c;if(r&&"function"==typeof r){var p=0;c=function(l,u,d){if(l&&"EAGAIN"===l.code&&p<10)return p++,n.call(e,t,i,a,o,s,c);r.apply(this,arguments)}}return n.call(e,t,i,a,o,s,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(t,n),t}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(n,t,i,a,o){for(var s=0;;)try{return c.call(e,n,t,i,a,o)}catch(e){if("EAGAIN"===e.code&&s<10){s++;continue}throw e}});var c};var Sn=m.Stream,kn=function(e){return{ReadStream:function n(t,i){if(!(this instanceof n))return new n(t,i);Sn.call(this);var a=this;this.path=t,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,i=i||{};for(var o=Object.keys(i),s=0,r=o.length;s<r;s++){var c=o[s];this[c]=i[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){a._read()}));e.open(this.path,this.flags,this.mode,(function(e,n){if(e)return a.emit("error",e),void(a.readable=!1);a.fd=n,a.emit("open",n),a._read()}))},WriteStream:function n(t,i){if(!(this instanceof n))return new n(t,i);Sn.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var a=Object.keys(i),o=0,s=a.length;o<s;o++){var r=a[o];this[r]=i[r]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var En=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var n={__proto__:jn(e)};else n=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))})),n},jn=Object.getPrototypeOf||function(e){return e.__proto__};var _n,On,Tn=c,Fn=wn,An=kn,Cn=En,Rn=o;function Pn(e,n){Object.defineProperty(e,_n,{get:function(){return n}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(_n=Symbol.for("graceful-fs.queue"),On=Symbol.for("graceful-fs.previous")):(_n="___graceful-fs.queue",On="___graceful-fs.previous");var Nn=function(){};if(Rn.debuglog?Nn=Rn.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Nn=function(){var e=Rn.format.apply(Rn,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Tn[_n]){var Ln=_[_n]||[];Pn(Tn,Ln),Tn.close=function(e){function n(n,t){return e.call(Tn,n,(function(e){e||Bn(),"function"==typeof t&&t.apply(this,arguments)}))}return Object.defineProperty(n,On,{value:e}),n}(Tn.close),Tn.closeSync=function(e){function n(n){e.apply(Tn,arguments),Bn()}return Object.defineProperty(n,On,{value:e}),n}(Tn.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Nn(Tn[_n]),f.equal(Tn[_n].length,0)}))}_[_n]||Pn(_,Tn[_n]);var Dn,In=zn(Cn(Tn));function zn(e){Fn(e),e.gracefulify=zn,e.createReadStream=function(n,t){return new e.ReadStream(n,t)},e.createWriteStream=function(n,t){return new e.WriteStream(n,t)};var n=e.readFile;e.readFile=function(e,t,i){"function"==typeof t&&(i=t,t=null);return function e(t,i,a,o){return n(t,i,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof a&&a.apply(this,arguments):Mn([e,[t,i,a],n,o||Date.now(),Date.now()])}))}(e,t,i)};var t=e.writeFile;e.writeFile=function(e,n,i,a){"function"==typeof i&&(a=i,i=null);return function e(n,i,a,o,s){return t(n,i,a,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof o&&o.apply(this,arguments):Mn([e,[n,i,a,o],t,s||Date.now(),Date.now()])}))}(e,n,i,a)};var i=e.appendFile;i&&(e.appendFile=function(e,n,t,a){"function"==typeof t&&(a=t,t=null);return function e(n,t,a,o,s){return i(n,t,a,(function(i){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof o&&o.apply(this,arguments):Mn([e,[n,t,a,o],i,s||Date.now(),Date.now()])}))}(e,n,t,a)});var a=e.copyFile;a&&(e.copyFile=function(e,n,t,i){"function"==typeof t&&(i=t,t=0);return function e(n,t,i,o,s){return a(n,t,i,(function(a){!a||"EMFILE"!==a.code&&"ENFILE"!==a.code?"function"==typeof o&&o.apply(this,arguments):Mn([e,[n,t,i,o],a,s||Date.now(),Date.now()])}))}(e,n,t,i)});var o=e.readdir;e.readdir=function(e,n,t){"function"==typeof n&&(t=n,n=null);var i=s.test(process.version)?function(e,n,t,i){return o(e,a(e,n,t,i))}:function(e,n,t,i){return o(e,n,a(e,n,t,i))};return i(e,n,t);function a(e,n,t,a){return function(o,s){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(s&&s.sort&&s.sort(),"function"==typeof t&&t.call(this,o,s)):Mn([i,[e,n,t],o,a||Date.now(),Date.now()])}}};var s=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var r=An(e);d=r.ReadStream,m=r.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(n,t){n?(e.autoClose&&e.destroy(),e.emit("error",n)):(e.fd=t,e.emit("open",t),e.read())}))});var p=e.WriteStream;p&&(m.prototype=Object.create(p.prototype),m.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(n,t){n?(e.destroy(),e.emit("error",n)):(e.fd=t,e.emit("open",t))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return m},set:function(e){m=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var u=m;function d(e,n){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function m(e,n){return this instanceof m?(p.apply(this,arguments),this):m.apply(Object.create(m.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return u},set:function(e){u=e},enumerable:!0,configurable:!0});var f=e.open;function h(e,n,t,i){return"function"==typeof t&&(i=t,t=null),function e(n,t,i,a,o){return f(n,t,i,(function(s,r){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?"function"==typeof a&&a.apply(this,arguments):Mn([e,[n,t,i,a],s,o||Date.now(),Date.now()])}))}(e,n,t,i)}return e.open=h,e}function Mn(e){Nn("ENQUEUE",e[0].name,e[1]),Tn[_n].push(e),Un()}function Bn(){for(var e=Date.now(),n=0;n<Tn[_n].length;++n)Tn[_n][n].length>2&&(Tn[_n][n][3]=e,Tn[_n][n][4]=e);Un()}function Un(){if(clearTimeout(Dn),Dn=void 0,0!==Tn[_n].length){var e=Tn[_n].shift(),n=e[0],t=e[1],i=e[2],a=e[3],o=e[4];if(void 0===a)Nn("RETRY",n.name,t),n.apply(null,t);else if(Date.now()-a>=6e4){Nn("TIMEOUT",n.name,t);var s=t.pop();"function"==typeof s&&s.call(null,i)}else{var r=Date.now()-o,c=Math.max(o-a,1);r>=Math.min(1.2*c,100)?(Nn("RETRY",n.name,t),n.apply(null,t.concat([a]))):Tn[_n].push(e)}void 0===Dn&&(Dn=setTimeout(Un,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Tn.__patched&&(In=zn(Tn),Tn.__patched=!0),function(e){const n=hn.fromCallback,t=In,i=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof t[e]));Object.keys(t).forEach((n=>{"promises"!==n&&(e[n]=t[n])})),i.forEach((i=>{e[i]=n(t[i])})),e.exists=function(e,n){return"function"==typeof n?t.exists(e,n):new Promise((n=>t.exists(e,n)))},e.read=function(e,n,i,a,o,s){return"function"==typeof s?t.read(e,n,i,a,o,s):new Promise(((s,r)=>{t.read(e,n,i,a,o,((e,n,t)=>{if(e)return r(e);s({bytesRead:n,buffer:t})}))}))},e.write=function(e,n,...i){return"function"==typeof i[i.length-1]?t.write(e,n,...i):new Promise(((a,o)=>{t.write(e,n,...i,((e,n,t)=>{if(e)return o(e);a({bytesWritten:n,buffer:t})}))}))},"function"==typeof t.realpath.native&&(e.realpath.native=n(t.realpath.native))}(fn);const $n=l;function qn(e){return(e=$n.normalize($n.resolve(e)).split($n.sep)).length>0?e[0]:null}const Wn=/[<>:"|?*]/;var Hn=function(e){const n=qn(e);return e=e.replace(n,""),Wn.test(e)};const Jn=In,Kn=l,Gn=Hn,Vn=parseInt("0777",8);var Yn=function e(n,t,i,a){if("function"==typeof t?(i=t,t={}):t&&"object"==typeof t||(t={mode:t}),"win32"===process.platform&&Gn(n)){const e=new Error(n+" contains invalid WIN32 path characters.");return e.code="EINVAL",i(e)}let o=t.mode;const s=t.fs||Jn;void 0===o&&(o=Vn&~process.umask()),a||(a=null),i=i||function(){},n=Kn.resolve(n),s.mkdir(n,o,(o=>{if(!o)return i(null,a=a||n);if("ENOENT"===o.code){if(Kn.dirname(n)===n)return i(o);e(Kn.dirname(n),t,((a,o)=>{a?i(a,o):e(n,t,i,o)}))}else s.stat(n,((e,n)=>{e||!n.isDirectory()?i(o,a):i(null,a)}))}))};const Xn=In,Qn=l,Zn=Hn,et=parseInt("0777",8);var nt=function e(n,t,i){t&&"object"==typeof t||(t={mode:t});let a=t.mode;const o=t.fs||Xn;if("win32"===process.platform&&Zn(n)){const e=new Error(n+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===a&&(a=et&~process.umask()),i||(i=null),n=Qn.resolve(n);try{o.mkdirSync(n,a),i=i||n}catch(a){if("ENOENT"===a.code){if(Qn.dirname(n)===n)throw a;i=e(Qn.dirname(n),t,i),e(n,t,i)}else{let e;try{e=o.statSync(n)}catch(e){throw a}if(!e.isDirectory())throw a}}return i};const tt=(0,hn.fromCallback)(Yn);var it={mkdirs:tt,mkdirsSync:nt,mkdirp:tt,mkdirpSync:nt,ensureDir:tt,ensureDirSync:nt};const at=In;var ot=function(e,n,t,i){at.open(e,"r+",((e,a)=>{if(e)return i(e);at.futimes(a,n,t,(e=>{at.close(a,(n=>{i&&i(e||n)}))}))}))},st=function(e,n,t){const i=at.openSync(e,"r+");return at.futimesSync(i,n,t),at.closeSync(i)};const rt=In,ct=l,pt=10,lt=5,ut=0,dt=process.versions.node.split("."),mt=Number.parseInt(dt[0],10),ft=Number.parseInt(dt[1],10),ht=Number.parseInt(dt[2],10);function xt(){if(mt>pt)return!0;if(mt===pt){if(ft>lt)return!0;if(ft===lt&&ht>=ut)return!0}return!1}function vt(e,n){const t=ct.resolve(e).split(ct.sep).filter((e=>e)),i=ct.resolve(n).split(ct.sep).filter((e=>e));return t.reduce(((e,n,t)=>e&&i[t]===n),!0)}function yt(e,n,t){return`Cannot ${t} '${e}' to a subdirectory of itself, '${n}'.`}var gt,bt,wt={checkPaths:function(e,n,t,i){!function(e,n,t){xt()?rt.stat(e,{bigint:!0},((e,i)=>{if(e)return t(e);rt.stat(n,{bigint:!0},((e,n)=>e?"ENOENT"===e.code?t(null,{srcStat:i,destStat:null}):t(e):t(null,{srcStat:i,destStat:n})))})):rt.stat(e,((e,i)=>{if(e)return t(e);rt.stat(n,((e,n)=>e?"ENOENT"===e.code?t(null,{srcStat:i,destStat:null}):t(e):t(null,{srcStat:i,destStat:n})))}))}(e,n,((a,o)=>{if(a)return i(a);const{srcStat:s,destStat:r}=o;return r&&r.ino&&r.dev&&r.ino===s.ino&&r.dev===s.dev?i(new Error("Source and destination must not be the same.")):s.isDirectory()&&vt(e,n)?i(new Error(yt(e,n,t))):i(null,{srcStat:s,destStat:r})}))},checkPathsSync:function(e,n,t){const{srcStat:i,destStat:a}=function(e,n){let t,i;t=xt()?rt.statSync(e,{bigint:!0}):rt.statSync(e);try{i=xt()?rt.statSync(n,{bigint:!0}):rt.statSync(n)}catch(e){if("ENOENT"===e.code)return{srcStat:t,destStat:null};throw e}return{srcStat:t,destStat:i}}(e,n);if(a&&a.ino&&a.dev&&a.ino===i.ino&&a.dev===i.dev)throw new Error("Source and destination must not be the same.");if(i.isDirectory()&&vt(e,n))throw new Error(yt(e,n,t));return{srcStat:i,destStat:a}},checkParentPaths:function e(n,t,i,a,o){const s=ct.resolve(ct.dirname(n)),r=ct.resolve(ct.dirname(i));if(r===s||r===ct.parse(r).root)return o();xt()?rt.stat(r,{bigint:!0},((s,c)=>s?"ENOENT"===s.code?o():o(s):c.ino&&c.dev&&c.ino===t.ino&&c.dev===t.dev?o(new Error(yt(n,i,a))):e(n,t,r,a,o))):rt.stat(r,((s,c)=>s?"ENOENT"===s.code?o():o(s):c.ino&&c.dev&&c.ino===t.ino&&c.dev===t.dev?o(new Error(yt(n,i,a))):e(n,t,r,a,o)))},checkParentPathsSync:function e(n,t,i,a){const o=ct.resolve(ct.dirname(n)),s=ct.resolve(ct.dirname(i));if(s===o||s===ct.parse(s).root)return;let r;try{r=xt()?rt.statSync(s,{bigint:!0}):rt.statSync(s)}catch(e){if("ENOENT"===e.code)return;throw e}if(r.ino&&r.dev&&r.ino===t.ino&&r.dev===t.dev)throw new Error(yt(n,i,a));return e(n,t,s,a)},isSrcSubdir:vt};const St=In,kt=l,Et=it.mkdirsSync,jt=st,_t=wt;function Ot(e,n,t,i){if(!i.filter||i.filter(n,t))return function(e,n,t,i){const a=i.dereference?St.statSync:St.lstatSync,o=a(n);if(o.isDirectory())return function(e,n,t,i,a){if(!n)return function(e,n,t,i){return St.mkdirSync(t),Ft(n,t,i),St.chmodSync(t,e.mode)}(e,t,i,a);if(n&&!n.isDirectory())throw new Error(`Cannot overwrite non-directory '${i}' with directory '${t}'.`);return Ft(t,i,a)}(o,e,n,t,i);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,n,t,i,a){return n?function(e,n,t,i){if(i.overwrite)return St.unlinkSync(t),Tt(e,n,t,i);if(i.errorOnExist)throw new Error(`'${t}' already exists`)}(e,t,i,a):Tt(e,t,i,a)}(o,e,n,t,i);if(o.isSymbolicLink())return function(e,n,t,i){let a=St.readlinkSync(n);i.dereference&&(a=kt.resolve(process.cwd(),a));if(e){let e;try{e=St.readlinkSync(t)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return St.symlinkSync(a,t);throw e}if(i.dereference&&(e=kt.resolve(process.cwd(),e)),_t.isSrcSubdir(a,e))throw new Error(`Cannot copy '${a}' to a subdirectory of itself, '${e}'.`);if(St.statSync(t).isDirectory()&&_t.isSrcSubdir(e,a))throw new Error(`Cannot overwrite '${e}' with '${a}'.`);return function(e,n){return St.unlinkSync(n),St.symlinkSync(e,n)}(a,t)}return St.symlinkSync(a,t)}(e,n,t,i)}(e,n,t,i)}function Tt(e,n,t,i){return"function"==typeof St.copyFileSync?(St.copyFileSync(n,t),St.chmodSync(t,e.mode),i.preserveTimestamps?jt(t,e.atime,e.mtime):void 0):function(e,n,t,i){const a=65536,o=(bt?gt:(bt=1,gt=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(n){return new Buffer(e)}return new Buffer(e)}))(a),s=St.openSync(n,"r"),r=St.openSync(t,"w",e.mode);let c=0;for(;c<e.size;){const e=St.readSync(s,o,0,a,c);St.writeSync(r,o,0,e),c+=e}i.preserveTimestamps&&St.futimesSync(r,e.atime,e.mtime);St.closeSync(s),St.closeSync(r)}(e,n,t,i)}function Ft(e,n,t){St.readdirSync(e).forEach((i=>function(e,n,t,i){const a=kt.join(n,e),o=kt.join(t,e),{destStat:s}=_t.checkPathsSync(a,o,"copy");return Ot(s,a,o,i)}(i,e,n,t)))}var At=function(e,n,t){"function"==typeof t&&(t={filter:t}),(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:i,destStat:a}=_t.checkPathsSync(e,n,"copy");return _t.checkParentPathsSync(e,i,n,"copy"),function(e,n,t,i){if(i.filter&&!i.filter(n,t))return;const a=kt.dirname(t);St.existsSync(a)||Et(a);return Ot(e,n,t,i)}(a,e,n,t)},Ct={copySync:At};const Rt=hn.fromPromise,Pt=fn;var Nt={pathExists:Rt((function(e){return Pt.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:Pt.existsSync};const Lt=In,Dt=l,It=it.mkdirs,zt=Nt.pathExists,Mt=ot,Bt=wt;function Ut(e,n,t,i,a){const o=Dt.dirname(t);zt(o,((s,r)=>s?a(s):r?qt(e,n,t,i,a):void It(o,(o=>o?a(o):qt(e,n,t,i,a)))))}function $t(e,n,t,i,a,o){Promise.resolve(a.filter(t,i)).then((s=>s?e(n,t,i,a,o):o()),(e=>o(e)))}function qt(e,n,t,i,a){return i.filter?$t(Wt,e,n,t,i,a):Wt(e,n,t,i,a)}function Wt(e,n,t,i,a){(i.dereference?Lt.stat:Lt.lstat)(n,((o,s)=>o?a(o):s.isDirectory()?function(e,n,t,i,a,o){if(!n)return function(e,n,t,i,a){Lt.mkdir(t,(o=>{if(o)return a(o);Kt(n,t,i,(n=>n?a(n):Lt.chmod(t,e.mode,a)))}))}(e,t,i,a,o);if(n&&!n.isDirectory())return o(new Error(`Cannot overwrite non-directory '${i}' with directory '${t}'.`));return Kt(t,i,a,o)}(s,e,n,t,i,a):s.isFile()||s.isCharacterDevice()||s.isBlockDevice()?function(e,n,t,i,a,o){return n?function(e,n,t,i,a){if(!i.overwrite)return i.errorOnExist?a(new Error(`'${t}' already exists`)):a();Lt.unlink(t,(o=>o?a(o):Ht(e,n,t,i,a)))}(e,t,i,a,o):Ht(e,t,i,a,o)}(s,e,n,t,i,a):s.isSymbolicLink()?function(e,n,t,i,a){Lt.readlink(n,((n,o)=>n?a(n):(i.dereference&&(o=Dt.resolve(process.cwd(),o)),e?void Lt.readlink(t,((n,s)=>n?"EINVAL"===n.code||"UNKNOWN"===n.code?Lt.symlink(o,t,a):a(n):(i.dereference&&(s=Dt.resolve(process.cwd(),s)),Bt.isSrcSubdir(o,s)?a(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${s}'.`)):e.isDirectory()&&Bt.isSrcSubdir(s,o)?a(new Error(`Cannot overwrite '${s}' with '${o}'.`)):function(e,n,t){Lt.unlink(n,(i=>i?t(i):Lt.symlink(e,n,t)))}(o,t,a)))):Lt.symlink(o,t,a))))}(e,n,t,i,a):void 0))}function Ht(e,n,t,i,a){return"function"==typeof Lt.copyFile?Lt.copyFile(n,t,(n=>n?a(n):Jt(e,t,i,a))):function(e,n,t,i,a){const o=Lt.createReadStream(n);o.on("error",(e=>a(e))).once("open",(()=>{const n=Lt.createWriteStream(t,{mode:e.mode});n.on("error",(e=>a(e))).on("open",(()=>o.pipe(n))).once("close",(()=>Jt(e,t,i,a)))}))}(e,n,t,i,a)}function Jt(e,n,t,i){Lt.chmod(n,e.mode,(a=>a?i(a):t.preserveTimestamps?Mt(n,e.atime,e.mtime,i):i()))}function Kt(e,n,t,i){Lt.readdir(e,((a,o)=>a?i(a):Gt(o,e,n,t,i)))}function Gt(e,n,t,i,a){const o=e.pop();return o?function(e,n,t,i,a,o){const s=Dt.join(t,n),r=Dt.join(i,n);Bt.checkPaths(s,r,"copy",((n,c)=>{if(n)return o(n);const{destStat:p}=c;qt(p,s,r,a,(n=>n?o(n):Gt(e,t,i,a,o)))}))}(e,o,n,t,i,a):a()}var Vt=function(e,n,t,i){"function"!=typeof t||i?"function"==typeof t&&(t={filter:t}):(i=t,t={}),i=i||function(){},(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),Bt.checkPaths(e,n,"copy",((a,o)=>{if(a)return i(a);const{srcStat:s,destStat:r}=o;Bt.checkParentPaths(e,s,n,"copy",(a=>a?i(a):t.filter?$t(Ut,r,e,n,t,i):Ut(r,e,n,t,i)))}))};var Yt={copy:(0,hn.fromCallback)(Vt)};const Xt=In,Qt=l,Zt=f,ei="win32"===process.platform;function ni(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((n=>{e[n]=e[n]||Xt[n],e[n+="Sync"]=e[n]||Xt[n]})),e.maxBusyTries=e.maxBusyTries||3}function ti(e,n,t){let i=0;"function"==typeof n&&(t=n,n={}),Zt(e,"rimraf: missing path"),Zt.strictEqual(typeof e,"string","rimraf: path should be a string"),Zt.strictEqual(typeof t,"function","rimraf: callback function required"),Zt(n,"rimraf: invalid options argument provided"),Zt.strictEqual(typeof n,"object","rimraf: options should be object"),ni(n),ii(e,n,(function a(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&i<n.maxBusyTries){i++;return setTimeout((()=>ii(e,n,a)),100*i)}"ENOENT"===o.code&&(o=null)}t(o)}))}function ii(e,n,t){Zt(e),Zt(n),Zt("function"==typeof t),n.lstat(e,((i,a)=>i&&"ENOENT"===i.code?t(null):i&&"EPERM"===i.code&&ei?ai(e,n,i,t):a&&a.isDirectory()?si(e,n,i,t):void n.unlink(e,(i=>{if(i){if("ENOENT"===i.code)return t(null);if("EPERM"===i.code)return ei?ai(e,n,i,t):si(e,n,i,t);if("EISDIR"===i.code)return si(e,n,i,t)}return t(i)}))))}function ai(e,n,t,i){Zt(e),Zt(n),Zt("function"==typeof i),t&&Zt(t instanceof Error),n.chmod(e,438,(a=>{a?i("ENOENT"===a.code?null:t):n.stat(e,((a,o)=>{a?i("ENOENT"===a.code?null:t):o.isDirectory()?si(e,n,t,i):n.unlink(e,i)}))}))}function oi(e,n,t){let i;Zt(e),Zt(n),t&&Zt(t instanceof Error);try{n.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw t}try{i=n.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw t}i.isDirectory()?ci(e,n,t):n.unlinkSync(e)}function si(e,n,t,i){Zt(e),Zt(n),t&&Zt(t instanceof Error),Zt("function"==typeof i),n.rmdir(e,(a=>{!a||"ENOTEMPTY"!==a.code&&"EEXIST"!==a.code&&"EPERM"!==a.code?a&&"ENOTDIR"===a.code?i(t):i(a):function(e,n,t){Zt(e),Zt(n),Zt("function"==typeof t),n.readdir(e,((i,a)=>{if(i)return t(i);let o,s=a.length;if(0===s)return n.rmdir(e,t);a.forEach((i=>{ti(Qt.join(e,i),n,(i=>{if(!o)return i?t(o=i):void(0==--s&&n.rmdir(e,t))}))}))}))}(e,n,i)}))}function ri(e,n){let t;ni(n=n||{}),Zt(e,"rimraf: missing path"),Zt.strictEqual(typeof e,"string","rimraf: path should be a string"),Zt(n,"rimraf: missing options"),Zt.strictEqual(typeof n,"object","rimraf: options should be object");try{t=n.lstatSync(e)}catch(t){if("ENOENT"===t.code)return;"EPERM"===t.code&&ei&&oi(e,n,t)}try{t&&t.isDirectory()?ci(e,n,null):n.unlinkSync(e)}catch(t){if("ENOENT"===t.code)return;if("EPERM"===t.code)return ei?oi(e,n,t):ci(e,n,t);if("EISDIR"!==t.code)throw t;ci(e,n,t)}}function ci(e,n,t){Zt(e),Zt(n),t&&Zt(t instanceof Error);try{n.rmdirSync(e)}catch(i){if("ENOTDIR"===i.code)throw t;if("ENOTEMPTY"===i.code||"EEXIST"===i.code||"EPERM"===i.code)!function(e,n){if(Zt(e),Zt(n),n.readdirSync(e).forEach((t=>ri(Qt.join(e,t),n))),!ei){return n.rmdirSync(e,n)}{const t=Date.now();do{try{return n.rmdirSync(e,n)}catch(e){}}while(Date.now()-t<500)}}(e,n);else if("ENOENT"!==i.code)throw i}}var pi=ti;ti.sync=ri;const li=pi;var ui={remove:(0,hn.fromCallback)(li),removeSync:li.sync};const di=hn.fromCallback,mi=In,fi=l,hi=it,xi=ui,vi=di((function(e,n){n=n||function(){},mi.readdir(e,((t,i)=>{if(t)return hi.mkdirs(e,n);i=i.map((n=>fi.join(e,n))),function e(){const t=i.pop();if(!t)return n();xi.remove(t,(t=>{if(t)return n(t);e()}))}()}))}));function yi(e){let n;try{n=mi.readdirSync(e)}catch(n){return hi.mkdirsSync(e)}n.forEach((n=>{n=fi.join(e,n),xi.removeSync(n)}))}var gi={emptyDirSync:yi,emptydirSync:yi,emptyDir:vi,emptydir:vi};const bi=hn.fromCallback,wi=l,Si=In,ki=it,Ei=Nt.pathExists;var ji={createFile:bi((function(e,n){function t(){Si.writeFile(e,"",(e=>{if(e)return n(e);n()}))}Si.stat(e,((i,a)=>{if(!i&&a.isFile())return n();const o=wi.dirname(e);Ei(o,((e,i)=>e?n(e):i?t():void ki.mkdirs(o,(e=>{if(e)return n(e);t()}))))}))})),createFileSync:function(e){let n;try{n=Si.statSync(e)}catch(e){}if(n&&n.isFile())return;const t=wi.dirname(e);Si.existsSync(t)||ki.mkdirsSync(t),Si.writeFileSync(e,"")}};const _i=hn.fromCallback,Oi=l,Ti=In,Fi=it,Ai=Nt.pathExists;var Ci={createLink:_i((function(e,n,t){function i(e,n){Ti.link(e,n,(e=>{if(e)return t(e);t(null)}))}Ai(n,((a,o)=>a?t(a):o?t(null):void Ti.lstat(e,(a=>{if(a)return a.message=a.message.replace("lstat","ensureLink"),t(a);const o=Oi.dirname(n);Ai(o,((a,s)=>a?t(a):s?i(e,n):void Fi.mkdirs(o,(a=>{if(a)return t(a);i(e,n)}))))}))))})),createLinkSync:function(e,n){if(Ti.existsSync(n))return;try{Ti.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const t=Oi.dirname(n);return Ti.existsSync(t)||Fi.mkdirsSync(t),Ti.linkSync(e,n)}};const Ri=l,Pi=In,Ni=Nt.pathExists;var Li={symlinkPaths:function(e,n,t){if(Ri.isAbsolute(e))return Pi.lstat(e,(n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),t(n)):t(null,{toCwd:e,toDst:e})));{const i=Ri.dirname(n),a=Ri.join(i,e);return Ni(a,((n,o)=>n?t(n):o?t(null,{toCwd:a,toDst:e}):Pi.lstat(e,(n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),t(n)):t(null,{toCwd:e,toDst:Ri.relative(i,e)})))))}},symlinkPathsSync:function(e,n){let t;if(Ri.isAbsolute(e)){if(t=Pi.existsSync(e),!t)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const i=Ri.dirname(n),a=Ri.join(i,e);if(t=Pi.existsSync(a),t)return{toCwd:a,toDst:e};if(t=Pi.existsSync(e),!t)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Ri.relative(i,e)}}}};const Di=In;var Ii={symlinkType:function(e,n,t){if(t="function"==typeof n?n:t,n="function"!=typeof n&&n)return t(null,n);Di.lstat(e,((e,i)=>{if(e)return t(null,"file");n=i&&i.isDirectory()?"dir":"file",t(null,n)}))},symlinkTypeSync:function(e,n){let t;if(n)return n;try{t=Di.lstatSync(e)}catch(e){return"file"}return t&&t.isDirectory()?"dir":"file"}};const zi=hn.fromCallback,Mi=l,Bi=In,Ui=it.mkdirs,$i=it.mkdirsSync,qi=Li.symlinkPaths,Wi=Li.symlinkPathsSync,Hi=Ii.symlinkType,Ji=Ii.symlinkTypeSync,Ki=Nt.pathExists;var Gi={createSymlink:zi((function(e,n,t,i){i="function"==typeof t?t:i,t="function"!=typeof t&&t,Ki(n,((a,o)=>a?i(a):o?i(null):void qi(e,n,((a,o)=>{if(a)return i(a);e=o.toDst,Hi(o.toCwd,t,((t,a)=>{if(t)return i(t);const o=Mi.dirname(n);Ki(o,((t,s)=>t?i(t):s?Bi.symlink(e,n,a,i):void Ui(o,(t=>{if(t)return i(t);Bi.symlink(e,n,a,i)}))))}))}))))})),createSymlinkSync:function(e,n,t){if(Bi.existsSync(n))return;const i=Wi(e,n);e=i.toDst,t=Ji(i.toCwd,t);const a=Mi.dirname(n);return Bi.existsSync(a)||$i(a),Bi.symlinkSync(e,n,t)}};var Vi,Yi={createFile:ji.createFile,createFileSync:ji.createFileSync,ensureFile:ji.createFile,ensureFileSync:ji.createFileSync,createLink:Ci.createLink,createLinkSync:Ci.createLinkSync,ensureLink:Ci.createLink,ensureLinkSync:Ci.createLinkSync,createSymlink:Gi.createSymlink,createSymlinkSync:Gi.createSymlinkSync,ensureSymlink:Gi.createSymlink,ensureSymlinkSync:Gi.createSymlinkSync};try{Vi=In}catch(s){Vi=c}function Xi(e,n){var t,i="\n";return"object"==typeof n&&null!==n&&(n.spaces&&(t=n.spaces),n.EOL&&(i=n.EOL)),JSON.stringify(e,n?n.replacer:null,t).replace(/\n/g,i)+i}function Qi(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var Zi={readFile:function(e,n,t){null==t&&(t=n,n={}),"string"==typeof n&&(n={encoding:n});var i=(n=n||{}).fs||Vi,a=!0;"throws"in n&&(a=n.throws),i.readFile(e,n,(function(i,o){if(i)return t(i);var s;o=Qi(o);try{s=JSON.parse(o,n?n.reviver:null)}catch(n){return a?(n.message=e+": "+n.message,t(n)):t(null,null)}t(null,s)}))},readFileSync:function(e,n){"string"==typeof(n=n||{})&&(n={encoding:n});var t=n.fs||Vi,i=!0;"throws"in n&&(i=n.throws);try{var a=t.readFileSync(e,n);return a=Qi(a),JSON.parse(a,n.reviver)}catch(n){if(i)throw n.message=e+": "+n.message,n;return null}},writeFile:function(e,n,t,i){null==i&&(i=t,t={});var a=(t=t||{}).fs||Vi,o="";try{o=Xi(n,t)}catch(e){return void(i&&i(e,null))}a.writeFile(e,o,t,i)},writeFileSync:function(e,n,t){var i=(t=t||{}).fs||Vi,a=Xi(n,t);return i.writeFileSync(e,a,t)}},ea=Zi;const na=hn.fromCallback,ta=ea;var ia={readJson:na(ta.readFile),readJsonSync:ta.readFileSync,writeJson:na(ta.writeFile),writeJsonSync:ta.writeFileSync};const aa=l,oa=it,sa=Nt.pathExists,ra=ia;var ca=function(e,n,t,i){"function"==typeof t&&(i=t,t={});const a=aa.dirname(e);sa(a,((o,s)=>o?i(o):s?ra.writeJson(e,n,t,i):void oa.mkdirs(a,(a=>{if(a)return i(a);ra.writeJson(e,n,t,i)}))))};const pa=In,la=l,ua=it,da=ia;var ma=function(e,n,t){const i=la.dirname(e);pa.existsSync(i)||ua.mkdirsSync(i),da.writeJsonSync(e,n,t)};const fa=hn.fromCallback,ha=ia;ha.outputJson=fa(ca),ha.outputJsonSync=ma,ha.outputJSON=ha.outputJson,ha.outputJSONSync=ha.outputJsonSync,ha.writeJSON=ha.writeJson,ha.writeJSONSync=ha.writeJsonSync,ha.readJSON=ha.readJson,ha.readJSONSync=ha.readJsonSync;var xa=ha;const va=In,ya=l,ga=Ct.copySync,ba=ui.removeSync,wa=it.mkdirpSync,Sa=wt;function ka(e,n,t){try{va.renameSync(e,n)}catch(i){if("EXDEV"!==i.code)throw i;return function(e,n,t){const i={overwrite:t,errorOnExist:!0};return ga(e,n,i),ba(e)}(e,n,t)}}var Ea=function(e,n,t){const i=(t=t||{}).overwrite||t.clobber||!1,{srcStat:a}=Sa.checkPathsSync(e,n,"move");return Sa.checkParentPathsSync(e,a,n,"move"),wa(ya.dirname(n)),function(e,n,t){if(t)return ba(n),ka(e,n,t);if(va.existsSync(n))throw new Error("dest already exists.");return ka(e,n,t)}(e,n,i)},ja={moveSync:Ea};const _a=In,Oa=l,Ta=Yt.copy,Fa=ui.remove,Aa=it.mkdirp,Ca=Nt.pathExists,Ra=wt;function Pa(e,n,t,i){_a.rename(e,n,(a=>a?"EXDEV"!==a.code?i(a):function(e,n,t,i){const a={overwrite:t,errorOnExist:!0};Ta(e,n,a,(n=>n?i(n):Fa(e,i)))}(e,n,t,i):i()))}var Na=function(e,n,t,i){"function"==typeof t&&(i=t,t={});const a=t.overwrite||t.clobber||!1;Ra.checkPaths(e,n,"move",((t,o)=>{if(t)return i(t);const{srcStat:s}=o;Ra.checkParentPaths(e,s,n,"move",(t=>{if(t)return i(t);Aa(Oa.dirname(n),(t=>t?i(t):function(e,n,t,i){if(t)return Fa(n,(a=>a?i(a):Pa(e,n,t,i)));Ca(n,((a,o)=>a?i(a):o?i(new Error("dest already exists.")):Pa(e,n,t,i)))}(e,n,a,i)))}))}))};var La={move:(0,hn.fromCallback)(Na)};const Da=hn.fromCallback,Ia=In,za=l,Ma=it,Ba=Nt.pathExists;var Ua={outputFile:Da((function(e,n,t,i){"function"==typeof t&&(i=t,t="utf8");const a=za.dirname(e);Ba(a,((o,s)=>o?i(o):s?Ia.writeFile(e,n,t,i):void Ma.mkdirs(a,(a=>{if(a)return i(a);Ia.writeFile(e,n,t,i)}))))})),outputFileSync:function(e,...n){const t=za.dirname(e);if(Ia.existsSync(t))return Ia.writeFileSync(e,...n);Ma.mkdirsSync(t),Ia.writeFileSync(e,...n)}};!function(e){e.exports=Object.assign({},fn,Ct,Yt,gi,Yi,xa,it,ja,La,Ua,Nt,ui);const n=c;Object.getOwnPropertyDescriptor(n,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>n.promises})}(mn);const $a=O("streamroller:fileNameFormatter"),qa=l;const Wa=O("streamroller:fileNameParser"),Ha=V;const Ja=O("streamroller:moveAndMaybeCompressFile"),Ka=dn,Ga=h;var Va=async(e,n,t)=>{if(t=function(e){const n={mode:parseInt("0600",8),compress:!1},t=Object.assign({},n,e);return Ja(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(t)}`),t}(t),e!==n){if(await Ka.pathExists(e))if(Ja(`moveAndMaybeCompressFile: moving file from ${e} to ${n} ${t.compress?"with":"without"} compress`),t.compress)await new Promise(((i,a)=>{let o=!1;const s=Ka.createWriteStream(n,{mode:t.mode,flags:"wx"}).on("open",(()=>{o=!0;const n=Ka.createReadStream(e).on("open",(()=>{n.pipe(Ga.createGzip()).pipe(s)})).on("error",(n=>{Ja(`moveAndMaybeCompressFile: error reading ${e}`,n),s.destroy(n)}))})).on("finish",(()=>{Ja(`moveAndMaybeCompressFile: finished compressing ${n}, deleting ${e}`),Ka.unlink(e).then(i).catch((n=>{Ja(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,n),Ka.truncate(e).then(i).catch((n=>{Ja(`moveAndMaybeCompressFile: error truncating ${e}`,n),a(n)}))}))})).on("error",(e=>{o?(Ja(`moveAndMaybeCompressFile: error writing ${n}, deleting`,e),Ka.unlink(n).then((()=>{a(e)})).catch((e=>{Ja(`moveAndMaybeCompressFile: error deleting ${n}`,e),a(e)}))):(Ja(`moveAndMaybeCompressFile: error creating ${n}`,e),a(e))}))})).catch((()=>{}));else{Ja(`moveAndMaybeCompressFile: renaming ${e} to ${n}`);try{await Ka.move(e,n,{overwrite:!0})}catch(t){if(Ja(`moveAndMaybeCompressFile: error renaming ${e} to ${n}`,t),"ENOENT"!==t.code){Ja("moveAndMaybeCompressFile: trying copy+truncate instead");try{await Ka.copy(e,n,{overwrite:!0}),await Ka.truncate(e)}catch(e){Ja("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else Ja("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Ya=O("streamroller:RollingFileWriteStream"),Xa=dn,Qa=l,Za=p,eo=()=>new Date,no=V,{Writable:to}=m,io=({file:e,keepFileExt:n,needsIndex:t,alwaysIncludeDate:i,compress:a,fileNameSep:o})=>{let s=o||".";const r=qa.join(e.dir,e.name),c=n=>n+e.ext,p=(e,n,i)=>!t&&i||!n?e:e+s+n,l=(e,n,t)=>(n>0||i)&&t?e+s+t:e,u=(e,n)=>n&&a?e+".gz":e,d=n?[l,p,c,u]:[c,l,p,u];return({date:e,index:n})=>($a(`_formatFileName: date=${e}, index=${n}`),d.reduce(((t,i)=>i(t,n,e)),r))},ao=({file:e,keepFileExt:n,pattern:t,fileNameSep:i})=>{let a=i||".";const o="__NOT_MATCHING__";let s=[(e,n)=>e.endsWith(".gz")?(Wa("it is gzipped"),n.isCompressed=!0,e.slice(0,-3)):e,n?n=>n.startsWith(e.name)&&n.endsWith(e.ext)?(Wa("it starts and ends with the right things"),n.slice(e.name.length+1,-1*e.ext.length)):o:n=>n.startsWith(e.base)?(Wa("it starts with the right things"),n.slice(e.base.length+1)):o,t?(e,n)=>{const i=e.split(a);let o=i[i.length-1];Wa("items: ",i,", indexStr: ",o);let s=e;void 0!==o&&o.match(/^\d+$/)?(s=e.slice(0,-1*(o.length+1)),Wa(`dateStr is ${s}`),t&&!s&&(s=o,o="0")):o="0";try{const i=Ha.parse(t,s,new Date(0,0));return Ha.asString(t,i)!==s?e:(n.index=parseInt(o,10),n.date=s,n.timestamp=i.getTime(),"")}catch(n){return Wa(`Problem parsing ${s} as ${t}, error was: `,n),e}}:(e,n)=>e.match(/^\d+$/)?(Wa("it has an index"),n.index=parseInt(e,10),""):e];return e=>{let n={filename:e,index:0,isCompressed:!1};return s.reduce(((e,t)=>t(e,n)),e)?null:n}},oo=Va;var so=class extends to{constructor(e,n){if(Ya(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(Qa.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${Qa.sep}`)&&(e=e.replace("~",Za.homedir())),super(n),this.options=this._parseOption(n),this.fileObject=Qa.parse(e),""===this.fileObject.dir&&(this.fileObject=Qa.parse(Qa.join(process.cwd(),e))),this.fileFormatter=io({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=ao({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=no(this.options.pattern,eo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Ya(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=Xa.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=no(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const n={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},t=Object.assign({},n,e);if(t.maxSize){if(t.maxSize<=0)throw new Error(`options.maxSize (${t.maxSize}) should be > 0`)}else delete t.maxSize;if(t.numBackups||0===t.numBackups){if(t.numBackups<0)throw new Error(`options.numBackups (${t.numBackups}) should be >= 0`);if(t.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${t.numBackups}) should be < Number.MAX_SAFE_INTEGER`);t.numToKeep=t.numBackups+1}else if(t.numToKeep<=0)throw new Error(`options.numToKeep (${t.numToKeep}) should be > 0`);return Ya(`_parseOption: creating stream with option=${JSON.stringify(t)}`),t}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,n,t){this._shouldRoll().then((()=>{Ya(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,n,(n=>{this.state.currentSize+=e.length,t(n)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Ya(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==no(this.options.pattern,eo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Ya("_roll: closing the current stream"),new Promise(((e,n)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(n)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let n=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;n>=0;n--){Ya(`_moveOldFiles: i = ${n}`);const e=this.fileFormatter({date:this.state.currentDate,index:n}),t=this.fileFormatter({date:this.state.currentDate,index:n+1}),i={compress:this.options.compress&&0===n,mode:this.options.mode};await oo(e,t,i)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?no(this.options.pattern,eo()):null,Ya(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,n)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(n)}))}))}async _getExistingFiles(){const e=await Xa.readdir(this.fileObject.dir).catch((()=>[]));Ya(`_getExistingFiles: files=${e}`);const n=e.map((e=>this.fileNameParser(e))).filter((e=>e)),t=e=>(e.timestamp?e.timestamp:eo().getTime())-e.index;return n.sort(((e,n)=>t(e)-t(n))),n}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),n=e=>{try{return Xa.mkdirSync(e,{recursive:!0})}catch(t){if("ENOENT"===t.code)return n(Qa.dirname(e)),n(e);if("EEXIST"!==t.code&&"EROFS"!==t.code)throw t;try{if(Xa.statSync(e).isDirectory())return e;throw t}catch(e){throw t}}};n(this.fileObject.dir);const t={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var i,a;Xa.appendFileSync(e,"",(i={...t},a="flags",i["flag"]=i[a],delete i[a],i)),this.currentFileStream=Xa.createWriteStream(e,t),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await this._getExistingFiles();if(Ya(`_clean: numToKeep = ${this.options.numToKeep}, existingFiles = ${e.length}`),Ya("_clean: existing files are: ",e),this._tooManyFiles(e.length)){const t=e.slice(0,e.length-this.options.numToKeep).map((e=>Qa.format({dir:this.fileObject.dir,base:e.filename})));await(n=t,Ya(`deleteFiles: files to delete: ${n}`),Promise.all(n.map((e=>Xa.unlink(e).catch((n=>{Ya(`deleteFiles: error when unlinking ${e}, ignoring. Error was ${n}`)}))))))}var n}_tooManyFiles(e){return this.options.numToKeep>0&&e>this.options.numToKeep}};const ro=so;var co=class extends ro{constructor(e,n,t,i){i||(i={}),n&&(i.maxSize=n),i.numBackups||0===i.numBackups||(t||0===t||(t=1),i.numBackups=t),super(e,i),this.backups=i.numBackups,this.size=this.options.maxSize}get theStream(){return this.currentFileStream}};const po=so;var lo={RollingFileWriteStream:so,RollingFileStream:co,DateRollingFileStream:class extends po{constructor(e,n,t){n&&"object"==typeof n&&(t=n,n=null),t||(t={}),n||(n="yyyy-MM-dd"),t.pattern=n,t.numBackups||0===t.numBackups?t.daysToKeep=t.numBackups:(t.daysToKeep||0===t.daysToKeep?process.emitWarning("options.daysToKeep is deprecated due to the confusion it causes when used together with file size rolling. Please use options.numBackups instead.","DeprecationWarning","streamroller-DEP0001"):t.daysToKeep=1,t.numBackups=t.daysToKeep),super(e,t),this.mode=this.options.mode}get theStream(){return this.currentFileStream}}};const uo=O("log4js:file"),mo=l,fo=lo,ho=p,xo=ho.EOL;let vo=!1;const yo=new Set;function go(){yo.forEach((e=>{e.sighupHandler()}))}un.configure=function(e,n){let t=n.basicLayout;return e.layout&&(t=n.layout(e.layout.type,e.layout)),e.mode=e.mode||384,function(e,n,t,i,a,o){if("string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(mo.sep))throw new Error(`Filename is a directory: ${e}`);function s(e,n,t,i){const a=new fo.RollingFileStream(e,n,t,i);return a.on("error",(n=>{console.error("log4js.fileAppender - Writing to file %s, error happened ",e,n)})),a.on("drain",(()=>{process.emit("log4js:pause",!1)})),a}0===e.indexOf(`~${mo.sep}`)&&(e=e.replace("~",ho.homedir())),e=mo.normalize(e),uo("Creating file appender (",e,", ",t,", ",i=i||0===i?i:5,", ",a,", ",o,")");let r=s(e,t,i,a);const c=function(e){if(r.writable){if(!0===a.removeColor){const n=/\x1b[[0-9;]*m/g;e.data=e.data.map((e=>"string"==typeof e?e.replace(n,""):e))}r.write(n(e,o)+xo,"utf8")||process.emit("log4js:pause",!0)}};return c.reopen=function(){r.end((()=>{r=s(e,t,i,a)}))},c.sighupHandler=function(){uo("SIGHUP handler called."),c.reopen()},c.shutdown=function(e){yo.delete(c),0===yo.size&&vo&&(process.removeListener("SIGHUP",go),vo=!1),r.end("","utf-8",e)},yo.add(c),vo||(process.on("SIGHUP",go),vo=!0),c}(e.filename,t,e.maxLogSize,e.backups,e,e.timezoneOffset)};var bo={};const wo=lo,So=p.EOL;function ko(e,n,t,i,a){i.maxSize=i.maxLogSize;const o=function(e,n,t){const i=new wo.DateRollingFileStream(e,n,t);return i.on("error",(n=>{console.error("log4js.dateFileAppender - Writing to file %s, error happened ",e,n)})),i.on("drain",(()=>{process.emit("log4js:pause",!1)})),i}(e,n,i),s=function(e){o.writable&&(o.write(t(e,a)+So,"utf8")||process.emit("log4js:pause",!0))};return s.shutdown=function(e){o.end("","utf-8",e)},s}bo.configure=function(e,n){let t=n.basicLayout;return e.layout&&(t=n.layout(e.layout.type,e.layout)),e.alwaysIncludePattern||(e.alwaysIncludePattern=!1),e.mode=e.mode||384,ko(e.filename,e.pattern,t,e,e.timezoneOffset)};var Eo={};const jo=O("log4js:fileSync"),_o=l,Oo=c,To=p,Fo=To.EOL;function Ao(e,n){const t=e=>{try{return Oo.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(_o.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(Oo.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(_o.dirname(e)),Oo.appendFileSync(e,"",{mode:n.mode,flag:n.flags})}class Co{constructor(e,n,t,i){if(jo("In RollingFileStream"),n<0)throw new Error(`maxLogSize (${n}) should be > 0`);this.filename=e,this.size=n,this.backups=t,this.options=i,this.currentSize=0,this.currentSize=function(e){let n=0;try{n=Oo.statSync(e).size}catch(n){Ao(e,i)}return n}(this.filename)}shouldRoll(){return jo("should roll with current size %d, and max size %d",this.currentSize,this.size),this.currentSize>=this.size}roll(e){const n=this,t=new RegExp(`^${_o.basename(e)}`);function i(e){return t.test(e)}function a(n){return parseInt(n.slice(`${_o.basename(e)}.`.length),10)||0}function o(e,n){return a(e)-a(n)}function s(t){const i=a(t);if(jo(`Index of ${t} is ${i}`),0===n.backups)Oo.truncateSync(e,0);else if(i<n.backups){try{Oo.unlinkSync(`${e}.${i+1}`)}catch(e){}jo(`Renaming ${t} -> ${e}.${i+1}`),Oo.renameSync(_o.join(_o.dirname(e),t),`${e}.${i+1}`)}}jo("Rolling, rolling, rolling"),jo("Renaming the old files"),Oo.readdirSync(_o.dirname(e)).filter(i).sort(o).reverse().forEach(s)}write(e,n){const t=this;jo("in write"),this.shouldRoll()&&(this.currentSize=0,this.roll(this.filename)),jo("writing the chunk to the file"),t.currentSize+=e.length,Oo.appendFileSync(t.filename,e)}}Eo.configure=function(e,n){let t=n.basicLayout;e.layout&&(t=n.layout(e.layout.type,e.layout));const i={flags:e.flags||"a",encoding:e.encoding||"utf8",mode:e.mode||384};return function(e,n,t,i,a,o){if("string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(_o.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${_o.sep}`)&&(e=e.replace("~",To.homedir())),e=_o.normalize(e),jo("Creating fileSync appender (",e,", ",t,", ",i=i||0===i?i:5,", ",a,", ",o,")");const s=function(e,n,t){let i;var o;return n?i=new Co(e,n,t,a):(Ao(o=e,a),i={write(e){Oo.appendFileSync(o,e)}}),i}(e,t,i);return e=>{s.write(n(e,o)+Fo)}}(e.filename,t,e.maxLogSize,e.backups,i,e.timezoneOffset)};var Ro={};const Po=O("log4js:tcp"),No=x;Ro.configure=function(e,n){Po(`configure with config = ${e}`);let t=function(e){return e.serialise()};return e.layout&&(t=n.layout(e.layout.type,e.layout)),function(e,n){let t=!1;const i=[];let a,o=3,s="__LOG4JS__";function r(e){Po("Writing log event to socket"),t=a.write(`${n(e)}${s}`,"utf8")}function c(){let e;for(Po("emptying buffer");e=i.shift();)r(e)}function p(e){t?r(e):(Po("buffering log event because it cannot write at the moment"),i.push(e))}return function n(){Po(`appender creating socket to ${e.host||"localhost"}:${e.port||5e3}`),s=`${e.endMsg||"__LOG4JS__"}`,a=No.createConnection(e.port||5e3,e.host||"localhost"),a.on("connect",(()=>{Po("socket connected"),c(),t=!0})),a.on("drain",(()=>{Po("drain event received, emptying buffer"),t=!0,c()})),a.on("timeout",a.end.bind(a)),a.on("error",(e=>{Po("connection error",e),t=!1,c()})),a.on("close",n)}(),p.shutdown=function(e){Po("shutdown called"),i.length&&o?(Po("buffer has items, waiting 100ms to empty"),o-=1,setTimeout((()=>{p.shutdown(e)}),100)):(a.removeAllListeners("close"),a.end(e))},p}(e,t)};const Lo=l,Do=O("log4js:appenders"),Io=G,zo=Ye,Mo=xe,Bo=de,Uo=Xe,$o=new Map;$o.set("console",nn),$o.set("stdout",an),$o.set("stderr",on),$o.set("logLevelFilter",sn),$o.set("categoryFilter",rn),$o.set("noLogFilter",pn),$o.set("file",un),$o.set("dateFile",bo),$o.set("fileSync",Eo),$o.set("tcp",Ro);const qo=new Map,Wo=(e,n)=>{let t;try{const n=`${e}.cjs`;t=require.resolve(n),Do("Loading module from ",n)}catch(n){t=e,Do("Loading module from ",e)}try{return function(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}(t)}catch(t){return void Io.throwExceptionIf(n,"MODULE_NOT_FOUND"!==t.code,`appender "${e}" could not be loaded (error was: ${t})`)}},Ho=new Set,Jo=(e,n)=>{if(qo.has(e))return qo.get(e);if(!n.appenders[e])return!1;if(Ho.has(e))throw new Error(`Dependency loop detected for appender ${e}.`);Ho.add(e),Do(`Creating appender ${e}`);const t=Ko(e,n);return Ho.delete(e),qo.set(e,t),t},Ko=(e,n)=>{const t=n.appenders[e],i=t.type.configure?t.type:((e,n)=>$o.get(e)||Wo(`./${e}`,n)||Wo(e,n)||require.main&&require.main.filename&&Wo(Lo.join(Lo.dirname(require.main.filename),e),n)||Wo(Lo.join(process.cwd(),e),n))(t.type,n);return Io.throwExceptionIf(n,Io.not(i),`appender "${e}" is not valid (type "${t.type}" could not be found)`),i.appender&&(process.emitWarning(`Appender ${t.type} exports an appender function.`,"DeprecationWarning","log4js-node-DEP0001"),Do("[log4js-node-DEP0001]",`DEPRECATION: Appender ${t.type} exports an appender function.`)),i.shutdown&&(process.emitWarning(`Appender ${t.type} exports a shutdown function.`,"DeprecationWarning","log4js-node-DEP0002"),Do("[log4js-node-DEP0002]",`DEPRECATION: Appender ${t.type} exports a shutdown function.`)),Do(`${e}: clustering.isMaster ? ${zo.isMaster()}`),Do(`${e}: appenderModule is ${o.inspect(i)}`),zo.onlyOnMaster((()=>(Do(`calling appenderModule.configure for ${e} / ${t.type}`),i.configure(Uo.modifyConfig(t),Bo,(e=>Jo(e,n)),Mo))),(()=>{}))},Go=e=>{if(qo.clear(),Ho.clear(),!e)return;const n=[];Object.values(e.categories).forEach((e=>{n.push(...e.appenders)})),Object.keys(e.appenders).forEach((t=>{(n.includes(t)||"tcp-server"===e.appenders[t].type||"multiprocess"===e.appenders[t].type)&&Jo(t,e)}))},Vo=()=>{Go()};Vo(),Io.addListener((e=>{Io.throwExceptionIf(e,Io.not(Io.anObject(e.appenders)),'must have a property "appenders" of type object.');const n=Object.keys(e.appenders);Io.throwExceptionIf(e,Io.not(n.length),"must define at least one appender."),n.forEach((n=>{Io.throwExceptionIf(e,Io.not(e.appenders[n].type),`appender "${n}" is not valid (must be an object with property "type")`)}))})),Io.addListener(Go),ye.exports=qo,ve.init=Vo;var Yo={};!function(e){const n=O("log4js:categories"),t=G,i=xe,a=ve,o=new Map;function s(e,n,t){if(!1===n.inherit)return;const i=t.lastIndexOf(".");if(i<0)return;const a=t.slice(0,i);let o=e.categories[a];o||(o={inherit:!0,appenders:[]}),s(e,o,a),!e.categories[a]&&o.appenders&&o.appenders.length&&o.level&&(e.categories[a]=o),n.appenders=n.appenders||[],n.level=n.level||o.level,o.appenders.forEach((e=>{n.appenders.includes(e)||n.appenders.push(e)})),n.parent=o}function r(e){if(!e.categories)return;Object.keys(e.categories).forEach((n=>{const t=e.categories[n];s(e,t,n)}))}t.addPreProcessingListener((e=>r(e))),t.addListener((e=>{t.throwExceptionIf(e,t.not(t.anObject(e.categories)),'must have a property "categories" of type object.');const n=Object.keys(e.categories);t.throwExceptionIf(e,t.not(n.length),"must define at least one category."),n.forEach((n=>{const o=e.categories[n];t.throwExceptionIf(e,[t.not(o.appenders),t.not(o.level)],`category "${n}" is not valid (must be an object with properties "appenders" and "level")`),t.throwExceptionIf(e,t.not(Array.isArray(o.appenders)),`category "${n}" is not valid (appenders must be an array of appender names)`),t.throwExceptionIf(e,t.not(o.appenders.length),`category "${n}" is not valid (appenders must contain at least one appender name)`),Object.prototype.hasOwnProperty.call(o,"enableCallStack")&&t.throwExceptionIf(e,"boolean"!=typeof o.enableCallStack,`category "${n}" is not valid (enableCallStack must be boolean type)`),o.appenders.forEach((i=>{t.throwExceptionIf(e,t.not(a.get(i)),`category "${n}" is not valid (appender "${i}" is not defined)`)})),t.throwExceptionIf(e,t.not(i.getLevel(o.level)),`category "${n}" is not valid (level "${o.level}" not recognised; valid levels are ${i.levels.join(", ")})`)})),t.throwExceptionIf(e,t.not(e.categories.default),'must define a "default" category.')}));const c=e=>{if(o.clear(),!e)return;Object.keys(e.categories).forEach((t=>{const s=e.categories[t],r=[];s.appenders.forEach((e=>{r.push(a.get(e)),n(`Creating category ${t}`),o.set(t,{appenders:r,level:i.getLevel(s.level),enableCallStack:s.enableCallStack||!1})}))}))},p=()=>{c()};p(),t.addListener(c);const l=e=>{if(n(`configForCategory: searching for config for ${e}`),o.has(e))return n(`configForCategory: ${e} exists in config, returning it`),o.get(e);let t;return e.indexOf(".")>0?(n(`configForCategory: ${e} has hierarchy, cloning from parents`),t={...l(e.slice(0,e.lastIndexOf(".")))}):(o.has("default")||c({categories:{default:{appenders:["out"],level:"OFF"}}}),n("configForCategory: cloning default category"),t={...o.get("default")}),o.set(e,t),t};e.exports=o,e.exports=Object.assign(e.exports,{appendersForCategory:e=>l(e).appenders,getLevelForCategory:e=>l(e).level,setLevelForCategory:(e,n)=>{l(e).level=n},getEnableCallStackForCategory:e=>!0===l(e).enableCallStack,setEnableCallStackForCategory:(e,n)=>{l(e).enableCallStack=n},init:p})}({get exports(){return Yo},set exports(e){Yo=e}});const Xo=O("log4js:logger"),Qo=Ie,Zo=xe,es=Ye,ns=Yo,ts=G,is=/^(?:\s*)at (?:(.+) \()?(?:([^(]+?):(\d+):(\d+))\)?$/;function as(e,n=4){try{const t=e.stack.split("\n").slice(n);if(!t.length)return null;const i=is.exec(t[0]);if(i&&5===i.length){let e="",n="",a="";return i[1]&&""!==i[1]&&([n,a]=i[1].replace(/[[\]]/g,"").split(" as "),a=a||"",n.includes(".")&&([e,n]=n.split("."))),{fileName:i[2],lineNumber:parseInt(i[3],10),columnNumber:parseInt(i[4],10),callStack:t.join("\n"),className:e,functionName:n,functionAlias:a,callerName:i[1]||""}}console.error("log4js.logger - defaultParseCallStack error")}catch(e){console.error("log4js.logger - defaultParseCallStack error",e)}return null}let os=class{constructor(e){if(!e)throw new Error("No category provided.");this.category=e,this.context={},this.callStackSkipIndex=0,this.parseCallStack=as,Xo(`Logger created (${this.category}, ${this.level})`)}get level(){return Zo.getLevel(ns.getLevelForCategory(this.category),Zo.OFF)}set level(e){ns.setLevelForCategory(this.category,Zo.getLevel(e,this.level))}get useCallStack(){return ns.getEnableCallStackForCategory(this.category)}set useCallStack(e){ns.setEnableCallStackForCategory(this.category,!0===e)}get callStackLinesToSkip(){return this.callStackSkipIndex}set callStackLinesToSkip(e){if("number"!=typeof e)throw new TypeError("Must be a number");if(e<0)throw new RangeError("Must be >= 0");this.callStackSkipIndex=e}log(e,...n){const t=Zo.getLevel(e);t?this.isLevelEnabled(t)&&this._log(t,n):ts.validIdentifier(e)&&n.length>0?(this.log(Zo.WARN,"log4js:logger.log: valid log-level not found as first parameter given:",e),this.log(Zo.INFO,`[${e}]`,...n)):this.log(Zo.INFO,e,...n)}isLevelEnabled(e){return this.level.isLessThanOrEqualTo(e)}_log(e,n){Xo(`sending log data (${e}) to appenders`);const t=n.find((e=>e instanceof Error));let i;if(this.useCallStack){try{t&&(i=this.parseCallStack(t,this.callStackSkipIndex+1))}catch(e){}i=i||this.parseCallStack(new Error,this.callStackSkipIndex+3+1)}const a=new Qo(this.category,e,n,this.context,i,t);es.send(a)}addContext(e,n){this.context[e]=n}removeContext(e){delete this.context[e]}clearContext(){this.context={}}setParseCallStackFunction(e){if("function"==typeof e)this.parseCallStack=e;else{if(void 0!==e)throw new TypeError("Invalid type passed to setParseCallStackFunction");this.parseCallStack=as}}};function ss(e){const n=Zo.getLevel(e),t=n.toString().toLowerCase().replace(/_([a-z])/g,(e=>e[1].toUpperCase())),i=t[0].toUpperCase()+t.slice(1);os.prototype[`is${i}Enabled`]=function(){return this.isLevelEnabled(n)},os.prototype[t]=function(...e){this.log(n,...e)}}Zo.levels.forEach(ss),ts.addListener((()=>{Zo.levels.forEach(ss)}));var rs=os;const cs=xe;function ps(e){return e.originalUrl||e.url}function ls(e,n){for(let t=0;t<n.length;t++)e=e.replace(n[t].token,n[t].replacement);return e}const us=O("log4js:recording"),ds=[];function ms(){return ds.slice()}function fs(){ds.length=0}var hs={configure:function(){return function(e){us(`received logEvent, number of events now ${ds.length+1}`),us("log event was ",e),ds.push(e)}},replay:ms,playback:ms,reset:fs,erase:fs};const xs=O("log4js:main"),vs=c,ys=M({proto:!0}),gs=G,bs=ve,ws=Yo,Ss=rs,ks=Ye,Es=hs;let js=!1;function _s(e){if(!js)return;xs("Received log event ",e);ws.appendersForCategory(e.categoryName).forEach((n=>{n(e)}))}function Os(e){js&&Ts();let n=e;return"string"==typeof n&&(n=function(e){xs(`Loading configuration from ${e}`);try{return JSON.parse(vs.readFileSync(e,"utf8"))}catch(n){throw new Error(`Problem reading config from file "${e}". Error was ${n.message}`,n)}}(e)),xs(`Configuration is ${n}`),gs.configure(ys(n)),ks.onMessage(_s),js=!0,Fs}function Ts(e=(()=>{})){if("function"!=typeof e)throw new TypeError("Invalid callback passed to shutdown");xs("Shutdown called. Disabling all log writing."),js=!1;const n=Array.from(bs.values());bs.init(),ws.init();const t=n.reduce(((e,n)=>n.shutdown?e+1:e),0);0===t&&(xs("No appenders with shutdown functions found."),e());let i,a=0;function o(n){i=i||n,a+=1,xs(`Appender shutdowns complete: ${a} / ${t}`),a>=t&&(xs("All shutdown functions completed."),e(i))}xs(`Found ${t} appenders with shutdown functions.`),n.filter((e=>e.shutdown)).forEach((e=>e.shutdown(o)))}const Fs={getLogger:function(e){return js||Os(process.env.LOG4JS_CONFIG||{appenders:{out:{type:"stdout"}},categories:{default:{appenders:["out"],level:"OFF"}}}),new Ss(e||"default")},configure:Os,isConfigured:function(){return js},shutdown:Ts,connectLogger:function(e,n){n="string"==typeof n||"function"==typeof n?{format:n}:n||{};const t=e;let i=cs.getLevel(n.level,cs.INFO);const a=n.format||':remote-addr - - ":method :url HTTP/:http-version" :status :content-length ":referrer" ":user-agent"';return(e,o,s)=>{if(void 0!==e._logging)return s();if("function"!=typeof n.nolog){const t=function(e){let n=null;if(e instanceof RegExp&&(n=e),"string"==typeof e&&(n=new RegExp(e)),Array.isArray(e)){const t=e.map((e=>e.source?e.source:e));n=new RegExp(t.join("|"))}return n}(n.nolog);if(t&&t.test(e.originalUrl))return s()}if(t.isLevelEnabled(i)||"auto"===n.level){const s=new Date,{writeHead:r}=o;e._logging=!0,o.writeHead=(e,n)=>{o.writeHead=r,o.writeHead(e,n),o.__statusCode=e,o.__headers=n||{}};let c=!1;const p=()=>{if(c)return;if(c=!0,"function"==typeof n.nolog&&!0===n.nolog(e,o))return void(e._logging=!1);o.responseTime=new Date-s,o.statusCode&&"auto"===n.level&&(i=cs.INFO,o.statusCode>=300&&(i=cs.WARN),o.statusCode>=400&&(i=cs.ERROR)),i=function(e,n,t){let i=n;if(t){const n=t.find((n=>{let t=!1;return t=n.from&&n.to?e>=n.from&&e<=n.to:-1!==n.codes.indexOf(e),t}));n&&(i=cs.getLevel(n.level,i))}return i}(o.statusCode,i,n.statusRules);const r=function(e,n,t){const i=[];return i.push({token:":url",replacement:ps(e)}),i.push({token:":protocol",replacement:e.protocol}),i.push({token:":hostname",replacement:e.hostname}),i.push({token:":method",replacement:e.method}),i.push({token:":status",replacement:n.__statusCode||n.statusCode}),i.push({token:":response-time",replacement:n.responseTime}),i.push({token:":date",replacement:(new Date).toUTCString()}),i.push({token:":referrer",replacement:e.headers.referer||e.headers.referrer||""}),i.push({token:":http-version",replacement:`${e.httpVersionMajor}.${e.httpVersionMinor}`}),i.push({token:":remote-addr",replacement:e.headers["x-forwarded-for"]||e.ip||e._remoteAddress||e.socket&&(e.socket.remoteAddress||e.socket.socket&&e.socket.socket.remoteAddress)}),i.push({token:":user-agent",replacement:e.headers["user-agent"]}),i.push({token:":content-length",replacement:n.getHeader("content-length")||n.__headers&&n.__headers["Content-Length"]||"-"}),i.push({token:/:req\[([^\]]+)]/g,replacement:(n,t)=>e.headers[t.toLowerCase()]}),i.push({token:/:res\[([^\]]+)]/g,replacement:(e,t)=>n.getHeader(t.toLowerCase())||n.__headers&&n.__headers[t]}),(e=>{const n=e.concat();for(let e=0;e<n.length;++e)for(let t=e+1;t<n.length;++t)n[e].token==n[t].token&&n.splice(t--,1);return n})(t.concat(i))}(e,o,n.tokens||[]);if(n.context&&t.addContext("res",o),"function"==typeof a){const n=a(e,o,(e=>ls(e,r)));n&&t.log(i,n)}else t.log(i,ls(a,r));n.context&&t.removeContext("res")};o.on("end",p),o.on("finish",p),o.on("error",p),o.on("close",p)}return s()}},levels:xe,addLayout:de.addLayout,recording:function(){return Es}};var As=Fs;As.configure({appenders:{std:{type:"stdout"},output:{type:{configure:(e,n,t,i)=>{let a=n.basicLayout;return e.layout&&(a=n.layout(e.layout.type,e.layout)),function(e,n){return t=>{if(t.context.outputHandler?.write){const i=`${e(t,n)}\n`;t.context.outputHandler.write(i)}}}(a,e.timezoneOffset)}}}},categories:{default:{appenders:["std"],level:"info"},pipeline:{appenders:["std","output"],level:"info"}}});const Cs=As.getLogger("default");function Rs(e){const n=As.getLogger("pipeline");return n.addContext("outputHandler",{write:e}),n}class Ps{id;context={};pipeline;logs={};_loggers={};trigger;constructor(e,n,t){this.id=e,this.pipeline=t,this.trigger=n}start(e){const n=(new Date).getTime();this.logs[e.id]=[],this._loggers[e.id]=Rs((n=>{this.logs[e.id].push(n)}));const t=e.input,i={output:{},input:s.cloneDeep(t),status:exports.ResultType.start,startTime:n,result:exports.ResultType.start};return e.status=i,this.log(e,"开始执行"),i}success(e){const n=(new Date).getTime(),t=e.status;s.merge(t,{status:"success",endTime:n,result:"success"}),this.log(e,"执行成功")}skip(e){const n=(new Date).getTime(),t=e.status;s.merge(t,{status:"success",endTime:n,result:"skip"}),this.log(e,"跳过")}error(e,n){const t=(new Date).getTime(),i=e.status;s.merge(i,{status:exports.ResultType.error,endTime:t,result:exports.ResultType.error,message:n.message}),this.logError(e,n)}cancel(e){const n=(new Date).getTime(),t=e.status;s.merge(t,{status:exports.ResultType.canceled,endTime:n,result:exports.ResultType.canceled,message:"用户取消"}),this.log(e,"任务取消")}log(e,n){this._loggers[e.id].info(`[${e.title}]<id:${e.id}> [${e.runnableType}]`,n)}logError(e,n){this._loggers[e.id].error(`[${e.title}]<id:${e.id}> [${e.runnableType}]`,n)}finally(e){}}class Ns{collection={};pipeline;constructor(e){if(!e)return;this.pipeline=e;const n=this.toMap(e);this.collection=n}static each(e,n){e.forEach((e=>{n(e),"pipeline"===e.runnableType?Ns.each(e.stages,n):"stage"===e.runnableType?Ns.each(e.tasks,n):"task"===e.runnableType&&Ns.each(e.steps,n)}))}toMap(e){const n={};return Ns.each(e.stages,(e=>{n[e.id]=e})),n}get(e){return this.collection[e]}clear(){this.pipeline&&Ns.each(this.pipeline.stages,(e=>{e.status=void 0}))}}var Ls;exports.ContextScope=void 0,(Ls=exports.ContextScope||(exports.ContextScope={}))[Ls.global=0]="global",Ls[Ls.pipeline=1]="pipeline",Ls[Ls.runtime=2]="runtime";class Ds{storage={};register(e,n){e&&null!=n&&(this.storage[e]=n)}get(e){if(!e)throw new Error("插件名称不能为空");const n=this.storage[e];if(!n)throw new Error(`插件${e}还未注册`);return n}getStorage(){return this.storage}getDefineList(){const e=[];for(const n in this.storage){const t=this.getDefine(n);t&&e.push({...t,key:n})}return e}getDefine(e){const n=this.storage[e];if(n)return n.define}}const Is=new Ds,zs={};function Ms(e,n){let t=zs[e];null==t&&(t={},zs[e]=t),t[n]=!0}const Bs={target:function(e,n){return"object"==typeof e&&e.constructor&&(e=e.constructor),null!=n&&Ms(e,n),e},attachProperty:Ms,getClassProperties:function(e){return zs[e]||{}},inject:function(e,n,t,i){s.forEach(e,((e,a)=>{i&&i(e,a,n,t),null!=t[a]&&(n[a]=t[a])}))}},Us="pipeline:autowire";
|
|
4
4
|
/*! *****************************************************************************
|
|
5
5
|
Copyright (C) Microsoft. All rights reserved.
|
|
6
6
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
@@ -22,4 +22,4 @@ var $s;!function(e){!function(n){var t="object"==typeof _?_:"object"==typeof sel
|
|
|
22
22
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
23
23
|
* MIT Licensed
|
|
24
24
|
*/
|
|
25
|
-
function(e){var n,t,i,a=Wr,o=l.extname,s=/^\s*([^;\s]*)(?:;|\s|$)/,r=/^text\//i;function c(e){if(!e||"string"!=typeof e)return!1;var n=s.exec(e),t=n&&a[n[1].toLowerCase()];return t&&t.charset?t.charset:!(!n||!r.test(n[1]))&&"UTF-8"}e.charset=c,e.charsets={lookup:c},e.contentType=function(n){if(!n||"string"!=typeof n)return!1;var t=-1===n.indexOf("/")?e.lookup(n):n;if(!t)return!1;if(-1===t.indexOf("charset")){var i=e.charset(t);i&&(t+="; charset="+i.toLowerCase())}return t},e.extension=function(n){if(!n||"string"!=typeof n)return!1;var t=s.exec(n),i=t&&e.extensions[t[1].toLowerCase()];if(!i||!i.length)return!1;return i[0]},e.extensions=Object.create(null),e.lookup=function(n){if(!n||"string"!=typeof n)return!1;var t=o("x."+n).toLowerCase().substr(1);if(!t)return!1;return e.types[t]||!1},e.types=Object.create(null),n=e.extensions,t=e.types,i=["nginx","apache",void 0,"iana"],Object.keys(a).forEach((function(e){var o=a[e],s=o.extensions;if(s&&s.length){n[e]=s;for(var r=0;r<s.length;r++){var c=s[r];if(t[c]){var p=i.indexOf(a[t[c]].source),l=i.indexOf(o.source);if("application/octet-stream"!==t[c]&&(p>l||p===l&&"application/"===t[c].substr(0,12)))continue}t[c]=e}}}))}(qr);var Jr=function(e){var n="function"==typeof setImmediate?setImmediate:"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:null;n?n(e):setTimeout(e,0)},Kr=function(e){var n=!1;return Jr((function(){n=!0})),function(t,i){n?e(t,i):Jr((function(){e(t,i)}))}};var Gr=function(e){Object.keys(e.jobs).forEach(Vr.bind(e)),e.jobs={}};function Vr(e){"function"==typeof this.jobs[e]&&this.jobs[e]()}var Yr=Kr,Xr=Gr,Qr=function(e,n,t,i){var a=t.keyedList?t.keyedList[t.index]:t.index;t.jobs[a]=function(e,n,t,i){var a;a=2==e.length?e(t,Yr(i)):e(t,n,Yr(i));return a}(n,a,e[a],(function(e,n){a in t.jobs&&(delete t.jobs[a],e?Xr(t):t.results[a]=n,i(e,t.results))}))};var Zr=function(e,n){var t=!Array.isArray(e),i={index:0,keyedList:t||n?Object.keys(e):null,jobs:{},results:t?{}:[],size:t?Object.keys(e).length:e.length};n&&i.keyedList.sort(t?n:function(t,i){return n(e[t],e[i])});return i};var ec=Gr,nc=Kr,tc=function(e){if(!Object.keys(this.jobs).length)return;this.index=this.size,ec(this),nc(e)(null,this.results)};var ic=Qr,ac=Zr,oc=tc,sc=function(e,n,t){var i=ac(e);for(;i.index<(i.keyedList||e).length;)ic(e,n,i,(function(e,n){e?t(e,n):0!==Object.keys(i.jobs).length||t(null,i.results)})),i.index++;return oc.bind(i,t)};var rc={},cc=Qr,pc=Zr,lc=tc;function uc(e,n){return e<n?-1:e>n?1:0}({get exports(){return rc},set exports(e){rc=e}}).exports=function(e,n,t,i){var a=pc(e,t);return cc(e,n,a,(function t(o,s){o?i(o,s):(a.index++,a.index<(a.keyedList||e).length?cc(e,n,a,t):i(null,a.results))})),lc.bind(a,i)},rc.ascending=uc,rc.descending=function(e,n){return-1*uc(e,n)};var dc=rc;var mc={parallel:sc,serial:function(e,n,t){return dc(e,n,null,t)},serialOrdered:rc},fc=Ur,hc=o,xc=l,vc=v,yc=y,gc=u.parse,bc=c,wc=m.Stream,Sc=qr,kc=mc,Ec=function(e,n){return Object.keys(n).forEach((function(t){e[t]=e[t]||n[t]})),e},jc=_c;function _c(e){if(!(this instanceof _c))return new _c(e);for(var n in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],fc.call(this),e=e||{})this[n]=e[n]}hc.inherits(_c,fc),_c.LINE_BREAK="\r\n",_c.DEFAULT_CONTENT_TYPE="application/octet-stream",_c.prototype.append=function(e,n,t){"string"==typeof(t=t||{})&&(t={filename:t});var i=fc.prototype.append.bind(this);if("number"==typeof n&&(n=""+n),hc.isArray(n))this._error(new Error("Arrays are not supported."));else{var a=this._multiPartHeader(e,n,t),o=this._multiPartFooter();i(a),i(n),i(o),this._trackLength(a,n,t)}},_c.prototype._trackLength=function(e,n,t){var i=0;null!=t.knownLength?i+=+t.knownLength:Buffer.isBuffer(n)?i=n.length:"string"==typeof n&&(i=Buffer.byteLength(n)),this._valueLength+=i,this._overheadLength+=Buffer.byteLength(e)+_c.LINE_BREAK.length,n&&(n.path||n.readable&&n.hasOwnProperty("httpVersion")||n instanceof wc)&&(t.knownLength||this._valuesToMeasure.push(n))},_c.prototype._lengthRetriever=function(e,n){e.hasOwnProperty("fd")?null!=e.end&&e.end!=1/0&&null!=e.start?n(null,e.end+1-(e.start?e.start:0)):bc.stat(e.path,(function(t,i){var a;t?n(t):(a=i.size-(e.start?e.start:0),n(null,a))})):e.hasOwnProperty("httpVersion")?n(null,+e.headers["content-length"]):e.hasOwnProperty("httpModule")?(e.on("response",(function(t){e.pause(),n(null,+t.headers["content-length"])})),e.resume()):n("Unknown stream")},_c.prototype._multiPartHeader=function(e,n,t){if("string"==typeof t.header)return t.header;var i,a=this._getContentDisposition(n,t),o=this._getContentType(n,t),s="",r={"Content-Disposition":["form-data",'name="'+e+'"'].concat(a||[]),"Content-Type":[].concat(o||[])};for(var c in"object"==typeof t.header&&Ec(r,t.header),r)r.hasOwnProperty(c)&&null!=(i=r[c])&&(Array.isArray(i)||(i=[i]),i.length&&(s+=c+": "+i.join("; ")+_c.LINE_BREAK));return"--"+this.getBoundary()+_c.LINE_BREAK+s+_c.LINE_BREAK},_c.prototype._getContentDisposition=function(e,n){var t,i;return"string"==typeof n.filepath?t=xc.normalize(n.filepath).replace(/\\/g,"/"):n.filename||e.name||e.path?t=xc.basename(n.filename||e.name||e.path):e.readable&&e.hasOwnProperty("httpVersion")&&(t=xc.basename(e.client._httpMessage.path||"")),t&&(i='filename="'+t+'"'),i},_c.prototype._getContentType=function(e,n){var t=n.contentType;return!t&&e.name&&(t=Sc.lookup(e.name)),!t&&e.path&&(t=Sc.lookup(e.path)),!t&&e.readable&&e.hasOwnProperty("httpVersion")&&(t=e.headers["content-type"]),t||!n.filepath&&!n.filename||(t=Sc.lookup(n.filepath||n.filename)),t||"object"!=typeof e||(t=_c.DEFAULT_CONTENT_TYPE),t},_c.prototype._multiPartFooter=function(){return function(e){var n=_c.LINE_BREAK;0===this._streams.length&&(n+=this._lastBoundary()),e(n)}.bind(this)},_c.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+_c.LINE_BREAK},_c.prototype.getHeaders=function(e){var n,t={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t},_c.prototype.setBoundary=function(e){this._boundary=e},_c.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},_c.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),n=this.getBoundary(),t=0,i=this._streams.length;t<i;t++)"function"!=typeof this._streams[t]&&(e=Buffer.isBuffer(this._streams[t])?Buffer.concat([e,this._streams[t]]):Buffer.concat([e,Buffer.from(this._streams[t])]),"string"==typeof this._streams[t]&&this._streams[t].substring(2,n.length+2)===n||(e=Buffer.concat([e,Buffer.from(_c.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},_c.prototype._generateBoundary=function(){for(var e="--------------------------",n=0;n<24;n++)e+=Math.floor(10*Math.random()).toString(16);this._boundary=e},_c.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},_c.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},_c.prototype.getLength=function(e){var n=this._overheadLength+this._valueLength;this._streams.length&&(n+=this._lastBoundary().length),this._valuesToMeasure.length?kc.parallel(this._valuesToMeasure,this._lengthRetriever,(function(t,i){t?e(t):(i.forEach((function(e){n+=e})),e(null,n))})):process.nextTick(e.bind(this,null,n))},_c.prototype.submit=function(e,n){var t,i,a={method:"post"};return"string"==typeof e?(e=gc(e),i=Ec({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},a)):(i=Ec(e,a)).port||(i.port="https:"==i.protocol?443:80),i.headers=this.getHeaders(e.headers),t="https:"==i.protocol?yc.request(i):vc.request(i),this.getLength(function(e,i){if(e&&"Unknown stream"!==e)this._error(e);else if(i&&t.setHeader("Content-Length",i),this.pipe(t),n){var a,o=function(e,i){return t.removeListener("error",o),t.removeListener("response",a),n.call(this,e,i)};a=o.bind(this,null),t.on("error",o),t.on("response",a)}}.bind(this)),t},_c.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},_c.prototype.toString=function(){return"[object FormData]"};var Oc=jc;function Tc(e){return Cr.isPlainObject(e)||Cr.isArray(e)}function Fc(e){return Cr.endsWith(e,"[]")?e.slice(0,-2):e}function Ac(e,n,t){return e?e.concat(n).map((function(e,n){return e=Fc(e),!t&&n?"["+e+"]":e})).join(t?".":""):n}const Cc=Cr.toFlatObject(Cr,{},null,(function(e){return/^is[A-Z]/.test(e)}));function Rc(e,n,t){if(!Cr.isObject(e))throw new TypeError("target must be an object");n=n||new(Oc||FormData);const i=(t=Cr.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,n){return!Cr.isUndefined(n[e])}))).metaTokens,a=t.visitor||p,o=t.dots,s=t.indexes,r=(t.Blob||"undefined"!=typeof Blob&&Blob)&&Cr.isSpecCompliantForm(n);if(!Cr.isFunction(a))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Cr.isDate(e))return e.toISOString();if(!r&&Cr.isBlob(e))throw new Rr("Blob is not supported. Use a Buffer instead.");return Cr.isArrayBuffer(e)||Cr.isTypedArray(e)?r&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function p(e,t,a){let r=e;if(e&&!a&&"object"==typeof e)if(Cr.endsWith(t,"{}"))t=i?t:t.slice(0,-2),e=JSON.stringify(e);else if(Cr.isArray(e)&&function(e){return Cr.isArray(e)&&!e.some(Tc)}(e)||(Cr.isFileList(e)||Cr.endsWith(t,"[]"))&&(r=Cr.toArray(e)))return t=Fc(t),r.forEach((function(e,i){!Cr.isUndefined(e)&&null!==e&&n.append(!0===s?Ac([t],i,o):null===s?t:t+"[]",c(e))})),!1;return!!Tc(e)||(n.append(Ac(a,t,o),c(e)),!1)}const l=[],u=Object.assign(Cc,{defaultVisitor:p,convertValue:c,isVisitable:Tc});if(!Cr.isObject(e))throw new TypeError("data must be an object");return function e(t,i){if(!Cr.isUndefined(t)){if(-1!==l.indexOf(t))throw Error("Circular reference detected in "+i.join("."));l.push(t),Cr.forEach(t,(function(t,o){!0===(!(Cr.isUndefined(t)||null===t)&&a.call(n,t,Cr.isString(o)?o.trim():o,i,u))&&e(t,i?i.concat(o):[o])})),l.pop()}}(e),n}function Pc(e){const n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return n[e]}))}function Nc(e,n){this._pairs=[],e&&Rc(e,this,n)}const Lc=Nc.prototype;function Dc(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ic(e,n,t){if(!n)return e;const i=t&&t.encode||Dc,a=t&&t.serialize;let o;if(o=a?a(n,t):Cr.isURLSearchParams(n)?n.toString():new Nc(n,t).toString(i),o){const n=e.indexOf("#");-1!==n&&(e=e.slice(0,n)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}Lc.append=function(e,n){this._pairs.push([e,n])},Lc.toString=function(e){const n=e?function(n){return e.call(this,n,Pc)}:Pc;return this._pairs.map((function(e){return n(e[0])+"="+n(e[1])}),"").join("&")};var zc=class{constructor(){this.handlers=[]}use(e,n,t){return this.handlers.push({fulfilled:e,rejected:n,synchronous:!!t&&t.synchronous,runWhen:t?t.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Cr.forEach(this.handlers,(function(n){null!==n&&e(n)}))}},Mc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Bc={isNode:!0,classes:{URLSearchParams:u.URLSearchParams,FormData:Oc,Blob:"undefined"!=typeof Blob&&Blob||null},protocols:["http","https","file","data"]};function Uc(e){function n(e,t,i,a){let o=e[a++];const s=Number.isFinite(+o),r=a>=e.length;if(o=!o&&Cr.isArray(i)?i.length:o,r)return Cr.hasOwnProp(i,o)?i[o]=[i[o],t]:i[o]=t,!s;i[o]&&Cr.isObject(i[o])||(i[o]=[]);return n(e,t,i[o],a)&&Cr.isArray(i[o])&&(i[o]=function(e){const n={},t=Object.keys(e);let i;const a=t.length;let o;for(i=0;i<a;i++)o=t[i],n[o]=e[o];return n}(i[o])),!s}if(Cr.isFormData(e)&&Cr.isFunction(e.entries)){const t={};return Cr.forEachEntry(e,((e,i)=>{n(function(e){return Cr.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),i,t,0)})),t}return null}const $c={"Content-Type":void 0};const qc={transitional:Mc,adapter:["xhr","http"],transformRequest:[function(e,n){const t=n.getContentType()||"",i=t.indexOf("application/json")>-1,a=Cr.isObject(e);a&&Cr.isHTMLForm(e)&&(e=new FormData(e));if(Cr.isFormData(e))return i&&i?JSON.stringify(Uc(e)):e;if(Cr.isArrayBuffer(e)||Cr.isBuffer(e)||Cr.isStream(e)||Cr.isFile(e)||Cr.isBlob(e))return e;if(Cr.isArrayBufferView(e))return e.buffer;if(Cr.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(a){if(t.indexOf("application/x-www-form-urlencoded")>-1)return function(e,n){return Rc(e,new Bc.classes.URLSearchParams,Object.assign({visitor:function(e,n,t,i){return Cr.isBuffer(e)?(this.append(n,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},n))}(e,this.formSerializer).toString();if((o=Cr.isFileList(e))||t.indexOf("multipart/form-data")>-1){const n=this.env&&this.env.FormData;return Rc(o?{"files[]":e}:e,n&&new n,this.formSerializer)}}return a||i?(n.setContentType("application/json",!1),function(e,n,t){if(Cr.isString(e))try{return(n||JSON.parse)(e),Cr.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(t||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const n=this.transitional||qc.transitional,t=n&&n.forcedJSONParsing,i="json"===this.responseType;if(e&&Cr.isString(e)&&(t&&!this.responseType||i)){const t=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(e){if(t){if("SyntaxError"===e.name)throw Rr.from(e,Rr.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Bc.classes.FormData,Blob:Bc.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Cr.forEach(["delete","get","head"],(function(e){qc.headers[e]={}})),Cr.forEach(["post","put","patch"],(function(e){qc.headers[e]=Cr.merge($c)}));var Wc=qc;const Hc=Cr.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Jc=Symbol("internals");function Kc(e){return e&&String(e).trim().toLowerCase()}function Gc(e){return!1===e||null==e?e:Cr.isArray(e)?e.map(Gc):String(e)}function Vc(e,n,t,i,a){return Cr.isFunction(i)?i.call(this,n,t):(a&&(n=t),Cr.isString(n)?Cr.isString(i)?-1!==n.indexOf(i):Cr.isRegExp(i)?i.test(n):void 0:void 0)}class Yc{constructor(e){e&&this.set(e)}set(e,n,t){const i=this;function a(e,n,t){const a=Kc(n);if(!a)throw new Error("header name must be a non-empty string");const o=Cr.findKey(i,a);(!o||void 0===i[o]||!0===t||void 0===t&&!1!==i[o])&&(i[o||n]=Gc(e))}const o=(e,n)=>Cr.forEach(e,((e,t)=>a(e,t,n)));return Cr.isPlainObject(e)||e instanceof this.constructor?o(e,n):Cr.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?o((e=>{const n={};let t,i,a;return e&&e.split("\n").forEach((function(e){a=e.indexOf(":"),t=e.substring(0,a).trim().toLowerCase(),i=e.substring(a+1).trim(),!t||n[t]&&Hc[t]||("set-cookie"===t?n[t]?n[t].push(i):n[t]=[i]:n[t]=n[t]?n[t]+", "+i:i)})),n})(e),n):null!=e&&a(n,e,t),this}get(e,n){if(e=Kc(e)){const t=Cr.findKey(this,e);if(t){const e=this[t];if(!n)return e;if(!0===n)return function(e){const n=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=t.exec(e);)n[i[1]]=i[2];return n}(e);if(Cr.isFunction(n))return n.call(this,e,t);if(Cr.isRegExp(n))return n.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Kc(e)){const t=Cr.findKey(this,e);return!(!t||void 0===this[t]||n&&!Vc(0,this[t],t,n))}return!1}delete(e,n){const t=this;let i=!1;function a(e){if(e=Kc(e)){const a=Cr.findKey(t,e);!a||n&&!Vc(0,t[a],a,n)||(delete t[a],i=!0)}}return Cr.isArray(e)?e.forEach(a):a(e),i}clear(e){const n=Object.keys(this);let t=n.length,i=!1;for(;t--;){const a=n[t];e&&!Vc(0,this[a],a,e,!0)||(delete this[a],i=!0)}return i}normalize(e){const n=this,t={};return Cr.forEach(this,((i,a)=>{const o=Cr.findKey(t,a);if(o)return n[o]=Gc(i),void delete n[a];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,n,t)=>n.toUpperCase()+t))}(a):String(a).trim();s!==a&&delete n[a],n[s]=Gc(i),t[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return Cr.forEach(this,((t,i)=>{null!=t&&!1!==t&&(n[i]=e&&Cr.isArray(t)?t.join(", "):t)})),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,n])=>e+": "+n)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const t=new this(e);return n.forEach((e=>t.set(e))),t}static accessor(e){const n=(this[Jc]=this[Jc]={accessors:{}}).accessors,t=this.prototype;function i(e){const i=Kc(e);n[i]||(!function(e,n){const t=Cr.toCamelCase(" "+n);["get","set","has"].forEach((i=>{Object.defineProperty(e,i+t,{value:function(e,t,a){return this[i].call(this,n,e,t,a)},configurable:!0})}))}(t,e),n[i]=!0)}return Cr.isArray(e)?e.forEach(i):i(e),this}}Yc.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Cr.freezeMethods(Yc.prototype),Cr.freezeMethods(Yc);var Xc=Yc;function Qc(e,n){const t=this||Wc,i=n||t,a=Xc.from(i.headers);let o=i.data;return Cr.forEach(e,(function(e){o=e.call(t,o,a.normalize(),n?n.status:void 0)})),a.normalize(),o}function Zc(e){return!(!e||!e.__CANCEL__)}function ep(e,n,t){Rr.call(this,null==e?"canceled":e,Rr.ERR_CANCELED,n,t),this.name="CanceledError"}function np(e,n,t){const i=t.config.validateStatus;t.status&&i&&!i(t.status)?n(new Rr("Request failed with status code "+t.status,[Rr.ERR_BAD_REQUEST,Rr.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t)):e(t)}function tp(e,n){return e&&!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(n)?function(e,n){return n?e.replace(/\/+$/,"")+"/"+n.replace(/^\/+/,""):e}(e,n):n}Cr.inherits(ep,Rr,{__CANCEL__:!0});var ip=u.parse,ap={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},op=String.prototype.endsWith||function(e){return e.length<=this.length&&-1!==this.indexOf(e,this.length-e.length)};function sp(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}var rp,cp=function(e){var n="string"==typeof e?ip(e):e||{},t=n.protocol,i=n.host,a=n.port;if("string"!=typeof i||!i||"string"!=typeof t)return"";if(t=t.split(":",1)[0],!function(e,n){var t=(sp("npm_config_no_proxy")||sp("no_proxy")).toLowerCase();if(!t)return!0;if("*"===t)return!1;return t.split(/[,\s]/).every((function(t){if(!t)return!0;var i=t.match(/^(.+):(\d+)$/),a=i?i[1]:t,o=i?parseInt(i[2]):0;return!(!o||o===n)||(/^[.*]/.test(a)?("*"===a.charAt(0)&&(a=a.slice(1)),!op.call(e,a)):e!==a)}))}(i=i.replace(/:\d*$/,""),a=parseInt(a)||ap[t]||0))return"";var o=sp("npm_config_"+t+"_proxy")||sp(t+"_proxy")||sp("npm_config_proxy")||sp("all_proxy");return o&&-1===o.indexOf("://")&&(o=t+"://"+o),o},pp={},lp={get exports(){return pp},set exports(e){pp=e}},up=u,dp=up.URL,mp=v,fp=y,hp=m.Writable,xp=f,vp=function(){if(!rp){try{rp=O("follow-redirects")}catch(e){}"function"!=typeof rp&&(rp=function(){})}rp.apply(null,arguments)},yp=["abort","aborted","connect","error","socket","timeout"],gp=Object.create(null);yp.forEach((function(e){gp[e]=function(n,t,i){this._redirectable.emit(e,n,t,i)}}));var bp=Ap("ERR_INVALID_URL","Invalid URL",TypeError),wp=Ap("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Sp=Ap("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),kp=Ap("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Ep=Ap("ERR_STREAM_WRITE_AFTER_END","write after end");function jp(e,n){hp.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],n&&this.on("response",n);var t=this;this._onNativeResponse=function(e){t._processResponse(e)},this._performRequest()}function _p(e){var n={maxRedirects:21,maxBodyLength:10485760},t={};return Object.keys(e).forEach((function(i){var a=i+":",o=t[a]=e[i],s=n[i]=Object.create(o);Object.defineProperties(s,{request:{value:function(e,i,o){if(Rp(e)){var s;try{s=Tp(new dp(e))}catch(n){s=up.parse(e)}if(!Rp(s.protocol))throw new bp({input:e});e=s}else dp&&e instanceof dp?e=Tp(e):(o=i,i=e,e={protocol:a});return Pp(i)&&(o=i,i=null),(i=Object.assign({maxRedirects:n.maxRedirects,maxBodyLength:n.maxBodyLength},e,i)).nativeProtocols=t,Rp(i.host)||Rp(i.hostname)||(i.hostname="::1"),xp.equal(i.protocol,a,"protocol mismatch"),vp("options",i),new jp(i,o)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(e,n,t){var i=s.request(e,n,t);return i.end(),i},configurable:!0,enumerable:!0,writable:!0}})})),n}function Op(){}function Tp(e){var n={protocol:e.protocol,hostname:e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,hash:e.hash,search:e.search,pathname:e.pathname,path:e.pathname+e.search,href:e.href};return""!==e.port&&(n.port=Number(e.port)),n}function Fp(e,n){var t;for(var i in n)e.test(i)&&(t=n[i],delete n[i]);return null==t?void 0:String(t).trim()}function Ap(e,n,t){function i(t){Error.captureStackTrace(this,this.constructor),Object.assign(this,t||{}),this.code=e,this.message=this.cause?n+": "+this.cause.message:n}return i.prototype=new(t||Error),i.prototype.constructor=i,i.prototype.name="Error ["+e+"]",i}function Cp(e){for(var n of yp)e.removeListener(n,gp[n]);e.on("error",Op),e.abort()}function Rp(e){return"string"==typeof e||e instanceof String}function Pp(e){return"function"==typeof e}jp.prototype=Object.create(hp.prototype),jp.prototype.abort=function(){Cp(this._currentRequest),this.emit("abort")},jp.prototype.write=function(e,n,t){if(this._ending)throw new Ep;if(!Rp(e)&&("object"!=typeof(i=e)||!("length"in i)))throw new TypeError("data should be a string, Buffer or Uint8Array");var i;Pp(n)&&(t=n,n=null),0!==e.length?this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:n}),this._currentRequest.write(e,n,t)):(this.emit("error",new kp),this.abort()):t&&t()},jp.prototype.end=function(e,n,t){if(Pp(e)?(t=e,e=n=null):Pp(n)&&(t=n,n=null),e){var i=this,a=this._currentRequest;this.write(e,n,(function(){i._ended=!0,a.end(null,null,t)})),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,t)},jp.prototype.setHeader=function(e,n){this._options.headers[e]=n,this._currentRequest.setHeader(e,n)},jp.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},jp.prototype.setTimeout=function(e,n){var t=this;function i(n){n.setTimeout(e),n.removeListener("timeout",n.destroy),n.addListener("timeout",n.destroy)}function a(n){t._timeout&&clearTimeout(t._timeout),t._timeout=setTimeout((function(){t.emit("timeout"),o()}),e),i(n)}function o(){t._timeout&&(clearTimeout(t._timeout),t._timeout=null),t.removeListener("abort",o),t.removeListener("error",o),t.removeListener("response",o),n&&t.removeListener("timeout",n),t.socket||t._currentRequest.removeListener("socket",a)}return n&&this.on("timeout",n),this.socket?a(this.socket):this._currentRequest.once("socket",a),this.on("socket",i),this.on("abort",o),this.on("error",o),this.on("response",o),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach((function(e){jp.prototype[e]=function(n,t){return this._currentRequest[e](n,t)}})),["aborted","connection","socket"].forEach((function(e){Object.defineProperty(jp.prototype,e,{get:function(){return this._currentRequest[e]}})})),jp.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var n=e.path.indexOf("?");n<0?e.pathname=e.path:(e.pathname=e.path.substring(0,n),e.search=e.path.substring(n))}},jp.prototype._performRequest=function(){var e=this._options.protocol,n=this._options.nativeProtocols[e];if(n){if(this._options.agents){var t=e.slice(0,-1);this._options.agent=this._options.agents[t]}var i=this._currentRequest=n.request(this._options,this._onNativeResponse);for(var a of(i._redirectable=this,yp))i.on(a,gp[a]);if(this._currentUrl=/^\//.test(this._options.path)?up.format(this._options):this._options.path,this._isRedirect){var o=0,s=this,r=this._requestBodyBuffers;!function e(n){if(i===s._currentRequest)if(n)s.emit("error",n);else if(o<r.length){var t=r[o++];i.finished||i.write(t.data,t.encoding,e)}else s._ended&&i.end()}()}}else this.emit("error",new TypeError("Unsupported protocol "+e))},jp.prototype._processResponse=function(e){var n=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:n});var t=e.headers.location;if(!t||!1===this._options.followRedirects||n<300||n>=400)return e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),void(this._requestBodyBuffers=[]);if(Cp(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)this.emit("error",new Sp);else{var i,a=this._options.beforeRedirect;a&&(i=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var o=this._options.method;((301===n||302===n)&&"POST"===this._options.method||303===n&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],Fp(/^content-/i,this._options.headers));var s,r=Fp(/^host$/i,this._options.headers),c=up.parse(this._currentUrl),p=r||c.host,l=/^\w+:/.test(t)?this._currentUrl:up.format(Object.assign(c,{host:p}));try{s=up.resolve(l,t)}catch(e){return void this.emit("error",new wp({cause:e}))}vp("redirecting to",s),this._isRedirect=!0;var u=up.parse(s);if(Object.assign(this._options,u),(u.protocol!==c.protocol&&"https:"!==u.protocol||u.host!==p&&!function(e,n){xp(Rp(e)&&Rp(n));var t=e.length-n.length-1;return t>0&&"."===e[t]&&e.endsWith(n)}(u.host,p))&&Fp(/^(?:authorization|cookie)$/i,this._options.headers),Pp(a)){var d={headers:e.headers,statusCode:n},m={url:l,method:o,headers:i};try{a(this._options,d,m)}catch(e){return void this.emit("error",e)}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(e){this.emit("error",new wp({cause:e}))}}},lp.exports=_p({http:mp,https:fp}),pp.wrap=_p;const Np="1.4.0";function Lp(e){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return n&&n[1]||""}const Dp=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function Ip(e,n){e=e||10;const t=new Array(e),i=new Array(e);let a,o=0,s=0;return n=void 0!==n?n:1e3,function(r){const c=Date.now(),p=i[s];a||(a=c),t[o]=r,i[o]=c;let l=s,u=0;for(;l!==o;)u+=t[l++],l%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-a<n)return;const d=p&&c-p;return d?Math.round(1e3*u/d):void 0}}const zp=Symbol("internals");class Mp extends m.Transform{constructor(e){super({readableHighWaterMark:(e=Cr.toFlatObject(e,{maxRate:0,chunkSize:65536,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,((e,n)=>!Cr.isUndefined(n[e])))).chunkSize});const n=this,t=this[zp]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null},i=Ip(t.ticksRate*e.samplesCount,t.timeWindow);this.on("newListener",(e=>{"progress"===e&&(t.isCaptured||(t.isCaptured=!0))}));let a=0;t.updateProgress=function(e,n){let t=0;const i=1e3/n;let a=null;return function(n,o){const s=Date.now();if(n||s-t>i)return a&&(clearTimeout(a),a=null),t=s,e.apply(null,o);a||(a=setTimeout((()=>(a=null,t=Date.now(),e.apply(null,o))),i-(s-t)))}}((function(){const e=t.length,o=t.bytesSeen,s=o-a;if(!s||n.destroyed)return;const r=i(s);a=o,process.nextTick((()=>{n.emit("progress",{loaded:o,total:e,progress:e?o/e:void 0,bytes:s,rate:r||void 0,estimated:r&&e&&o<=e?(e-o)/r:void 0})}))}),t.ticksRate);const o=()=>{t.updateProgress(!0)};this.once("end",o),this.once("error",o)}_read(e){const n=this[zp];return n.onReadCallback&&n.onReadCallback(),super._read(e)}_transform(e,n,t){const i=this,a=this[zp],o=a.maxRate,s=this.readableHighWaterMark,r=a.timeWindow,c=o/(1e3/r),p=!1!==a.minChunkSize?Math.max(a.minChunkSize,.01*c):0;const l=(e,n)=>{const t=Buffer.byteLength(e);let l,u=null,d=s,m=0;if(o){const e=Date.now();(!a.ts||(m=e-a.ts)>=r)&&(a.ts=e,l=c-a.bytes,a.bytes=l<0?-l:0,m=0),l=c-a.bytes}if(o){if(l<=0)return setTimeout((()=>{n(null,e)}),r-m);l<d&&(d=l)}d&&t>d&&t-d>p&&(u=e.subarray(d),e=e.subarray(0,d)),function(e,n){const t=Buffer.byteLength(e);a.bytesSeen+=t,a.bytes+=t,a.isCaptured&&a.updateProgress(),i.push(e)?process.nextTick(n):a.onReadCallback=()=>{a.onReadCallback=null,process.nextTick(n)}}(e,u?()=>{process.nextTick(n,null,u)}:n)};l(e,(function e(n,i){if(n)return t(n);i?l(i,e):t(null)}))}setLength(e){return this[zp].length=+e,this}}var Bp=Mp;const{asyncIterator:Up}=Symbol;var $p=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[Up]?yield*e[Up]():yield e};const qp=Cr.ALPHABET.ALPHA_DIGIT+"-_",Wp=new o.TextEncoder,Hp="\r\n",Jp=Wp.encode(Hp);class Kp{constructor(e,n){const{escapeName:t}=this.constructor,i=Cr.isString(n);let a=`Content-Disposition: form-data; name="${t(e)}"${!i&&n.name?`; filename="${t(n.name)}"`:""}${Hp}`;i?n=Wp.encode(String(n).replace(/\r?\n|\r\n?/g,Hp)):a+=`Content-Type: ${n.type||"application/octet-stream"}${Hp}`,this.headers=Wp.encode(a+Hp),this.contentLength=i?n.byteLength:n.size,this.size=this.headers.byteLength+this.contentLength+2,this.name=e,this.value=n}async*encode(){yield this.headers;const{value:e}=this;Cr.isTypedArray(e)?yield e:yield*$p(e),yield Jp}static escapeName(e){return String(e).replace(/[\r\n"]/g,(e=>({"\r":"%0D","\n":"%0A",'"':"%22"}[e])))}}var Gp=(e,n,t)=>{const{tag:i="form-data-boundary",size:a=25,boundary:o=i+"-"+Cr.generateString(a,qp)}=t||{};if(!Cr.isFormData(e))throw TypeError("FormData instance required");if(o.length<1||o.length>70)throw Error("boundary must be 10-70 characters long");const s=Wp.encode("--"+o+Hp),r=Wp.encode("--"+o+"--"+Hp+Hp);let c=r.byteLength;const p=Array.from(e.entries()).map((([e,n])=>{const t=new Kp(e,n);return c+=t.size,t}));c+=s.byteLength*p.length,c=Cr.toFiniteNumber(c);const l={"Content-Type":`multipart/form-data; boundary=${o}`};return Number.isFinite(c)&&(l["Content-Length"]=c),n&&n(l),m.Readable.from(async function*(){for(const e of p)yield s,yield*e.encode();yield r}())};class Vp extends m.Transform{__transform(e,n,t){this.push(e),t()}_transform(e,n,t){if(0!==e.length&&(this._transform=this.__transform,120!==e[0])){const e=Buffer.alloc(2);e[0]=120,e[1]=156,this.push(e,n)}this.__transform(e,n,t)}}var Yp=Vp;var Xp=(e,n)=>Cr.isAsyncFn(e)?function(...t){const i=t.pop();e.apply(this,t).then((e=>{try{n?i(null,...n(e)):i(null,e)}catch(e){i(e)}}),i)}:e;const Qp={flush:h.constants.Z_SYNC_FLUSH,finishFlush:h.constants.Z_SYNC_FLUSH},Zp={flush:h.constants.BROTLI_OPERATION_FLUSH,finishFlush:h.constants.BROTLI_OPERATION_FLUSH},el=Cr.isFunction(h.createBrotliDecompress),{http:nl,https:tl}=pp,il=/https:?/,al=Bc.protocols.map((e=>e+":"));function ol(e){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e)}function sl(e,n,t){let i=n;if(!i&&!1!==i){const e=cp(t);e&&(i=new URL(e))}if(i){if(i.username&&(i.auth=(i.username||"")+":"+(i.password||"")),i.auth){(i.auth.username||i.auth.password)&&(i.auth=(i.auth.username||"")+":"+(i.auth.password||""));const n=Buffer.from(i.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+n}e.headers.host=e.hostname+(e.port?":"+e.port:"");const n=i.hostname||i.host;e.hostname=n,e.host=n,e.port=i.port,e.path=t,i.protocol&&(e.protocol=i.protocol.includes(":")?i.protocol:`${i.protocol}:`)}e.beforeRedirects.proxy=function(e){sl(e,n,e.href)}}const rl="undefined"!=typeof process&&"process"===Cr.kindOf(process);var cl=rl&&function(e){return n=async function(n,t,i){let{data:a,lookup:s,family:r}=e;const{responseType:c,responseEncoding:p}=e,l=e.method.toUpperCase();let u,d,f=!1;s&&Cr.isAsyncFn(s)&&(s=Xp(s,(e=>{if(Cr.isString(e))e=[e,e.indexOf(".")<0?6:4];else if(!Cr.isArray(e))throw new TypeError("lookup async function must return an array [ip: string, family: number]]");return e})));const x=new g,b=()=>{e.cancelToken&&e.cancelToken.unsubscribe(w),e.signal&&e.signal.removeEventListener("abort",w),x.removeAllListeners()};function w(n){x.emit("abort",!n||n.type?new ep(null,e,d):n)}i(((e,n)=>{u=!0,n&&(f=!0,b())})),x.once("abort",t),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(w),e.signal&&(e.signal.aborted?w():e.signal.addEventListener("abort",w)));const S=tp(e.baseURL,e.url),k=new URL(S,"http://localhost"),E=k.protocol||al[0];if("data:"===E){let i;if("GET"!==l)return np(n,t,{status:405,statusText:"method not allowed",headers:{},config:e});try{i=function(e,n,t){const i=t&&t.Blob||Bc.classes.Blob,a=Lp(e);if(void 0===n&&i&&(n=!0),"data"===a){e=a.length?e.slice(a.length+1):e;const t=Dp.exec(e);if(!t)throw new Rr("Invalid URL",Rr.ERR_INVALID_URL);const o=t[1],s=t[2],r=t[3],c=Buffer.from(decodeURIComponent(r),s?"base64":"utf8");if(n){if(!i)throw new Rr("Blob is not supported",Rr.ERR_NOT_SUPPORT);return new i([c],{type:o})}return c}throw new Rr("Unsupported protocol "+a,Rr.ERR_NOT_SUPPORT)}(e.url,"blob"===c,{Blob:e.env&&e.env.Blob})}catch(n){throw Rr.from(n,Rr.ERR_BAD_REQUEST,e)}return"text"===c?(i=i.toString(p),p&&"utf8"!==p||(i=Cr.stripBOM(i))):"stream"===c&&(i=m.Readable.from(i)),np(n,t,{data:i,status:200,statusText:"OK",headers:new Xc,config:e})}if(-1===al.indexOf(E))return t(new Rr("Unsupported protocol "+E,Rr.ERR_BAD_REQUEST,e));const j=Xc.from(e.headers).normalize();j.set("User-Agent","axios/"+Np,!1);const _=e.onDownloadProgress,O=e.onUploadProgress,T=e.maxRate;let F,A;if(Cr.isSpecCompliantForm(a)){const e=j.getContentType(/boundary=([-_\w\d]{10,70})/i);a=Gp(a,(e=>{j.set(e)}),{tag:`axios-${Np}-boundary`,boundary:e&&e[1]||void 0})}else if(Cr.isFormData(a)&&Cr.isFunction(a.getHeaders)){if(j.set(a.getHeaders()),!j.hasContentLength())try{const e=await o.promisify(a.getLength).call(a);Number.isFinite(e)&&e>=0&&j.setContentLength(e)}catch(e){}}else if(Cr.isBlob(a))a.size&&j.setContentType(a.type||"application/octet-stream"),j.setContentLength(a.size||0),a=m.Readable.from($p(a));else if(a&&!Cr.isStream(a)){if(Buffer.isBuffer(a));else if(Cr.isArrayBuffer(a))a=Buffer.from(new Uint8Array(a));else{if(!Cr.isString(a))return t(new Rr("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",Rr.ERR_BAD_REQUEST,e));a=Buffer.from(a,"utf-8")}if(j.setContentLength(a.length,!1),e.maxBodyLength>-1&&a.length>e.maxBodyLength)return t(new Rr("Request body larger than maxBodyLength limit",Rr.ERR_BAD_REQUEST,e))}const C=Cr.toFiniteNumber(j.getContentLength());let R,P;Cr.isArray(T)?(F=T[0],A=T[1]):F=A=T,a&&(O||F)&&(Cr.isStream(a)||(a=m.Readable.from(a,{objectMode:!1})),a=m.pipeline([a,new Bp({length:C,maxRate:Cr.toFiniteNumber(F)})],Cr.noop),O&&a.on("progress",(e=>{O(Object.assign(e,{upload:!0}))}))),e.auth&&(R=(e.auth.username||"")+":"+(e.auth.password||"")),!R&&k.username&&(R=k.username+":"+k.password),R&&j.delete("authorization");try{P=Ic(k.pathname+k.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(n){const i=new Error(n.message);return i.config=e,i.url=e.url,i.exists=!0,t(i)}j.set("Accept-Encoding","gzip, compress, deflate"+(el?", br":""),!1);const N={path:P,method:l,headers:j.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:R,protocol:E,family:r,lookup:s,beforeRedirect:ol,beforeRedirects:{}};let L;e.socketPath?N.socketPath=e.socketPath:(N.hostname=k.hostname,N.port=k.port,sl(N,e.proxy,E+"//"+k.hostname+(k.port?":"+k.port:"")+N.path));const D=il.test(N.protocol);if(N.agent=D?e.httpsAgent:e.httpAgent,e.transport?L=e.transport:0===e.maxRedirects?L=D?y:v:(e.maxRedirects&&(N.maxRedirects=e.maxRedirects),e.beforeRedirect&&(N.beforeRedirects.config=e.beforeRedirect),L=D?tl:nl),e.maxBodyLength>-1?N.maxBodyLength=e.maxBodyLength:N.maxBodyLength=1/0,e.insecureHTTPParser&&(N.insecureHTTPParser=e.insecureHTTPParser),d=L.request(N,(function(i){if(d.destroyed)return;const a=[i],o=+i.headers["content-length"];if(_){const e=new Bp({length:Cr.toFiniteNumber(o),maxRate:Cr.toFiniteNumber(A)});_&&e.on("progress",(e=>{_(Object.assign(e,{download:!0}))})),a.push(e)}let s=i;const r=i.req||d;if(!1!==e.decompress&&i.headers["content-encoding"])switch("HEAD"!==l&&204!==i.statusCode||delete i.headers["content-encoding"],i.headers["content-encoding"]){case"gzip":case"x-gzip":case"compress":case"x-compress":a.push(h.createUnzip(Qp)),delete i.headers["content-encoding"];break;case"deflate":a.push(new Yp),a.push(h.createUnzip(Qp)),delete i.headers["content-encoding"];break;case"br":el&&(a.push(h.createBrotliDecompress(Zp)),delete i.headers["content-encoding"])}s=a.length>1?m.pipeline(a,Cr.noop):a[0];const u=m.finished(s,(()=>{u(),b()})),v={status:i.statusCode,statusText:i.statusMessage,headers:new Xc(i.headers),config:e,request:r};if("stream"===c)v.data=s,np(n,t,v);else{const i=[];let a=0;s.on("data",(function(n){i.push(n),a+=n.length,e.maxContentLength>-1&&a>e.maxContentLength&&(f=!0,s.destroy(),t(new Rr("maxContentLength size of "+e.maxContentLength+" exceeded",Rr.ERR_BAD_RESPONSE,e,r)))})),s.on("aborted",(function(){if(f)return;const n=new Rr("maxContentLength size of "+e.maxContentLength+" exceeded",Rr.ERR_BAD_RESPONSE,e,r);s.destroy(n),t(n)})),s.on("error",(function(n){d.destroyed||t(Rr.from(n,null,e,r))})),s.on("end",(function(){try{let e=1===i.length?i[0]:Buffer.concat(i);"arraybuffer"!==c&&(e=e.toString(p),p&&"utf8"!==p||(e=Cr.stripBOM(e))),v.data=e}catch(n){t(Rr.from(n,null,e,v.request,v))}np(n,t,v)}))}x.once("abort",(e=>{s.destroyed||(s.emit("error",e),s.destroy())}))})),x.once("abort",(e=>{t(e),d.destroy(e)})),d.on("error",(function(n){t(Rr.from(n,null,e,d))})),d.on("socket",(function(e){e.setKeepAlive(!0,6e4)})),e.timeout){const n=parseInt(e.timeout,10);if(isNaN(n))return void t(new Rr("error trying to parse `config.timeout` to int",Rr.ERR_BAD_OPTION_VALUE,e,d));d.setTimeout(n,(function(){if(u)return;let n=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const i=e.transitional||Mc;e.timeoutErrorMessage&&(n=e.timeoutErrorMessage),t(new Rr(n,i.clarifyTimeoutError?Rr.ETIMEDOUT:Rr.ECONNABORTED,e,d)),w()}))}if(Cr.isStream(a)){let n=!1,t=!1;a.on("end",(()=>{n=!0})),a.once("error",(e=>{t=!0,d.destroy(e)})),a.on("close",(()=>{n||t||w(new ep("Request stream has been aborted",e,d))})),a.pipe(d)}else d.end(a)},new Promise(((e,t)=>{let i,a;const o=(e,n)=>{a||(a=!0,i&&i(e,n))},s=e=>{o(e,!0),t(e)};n((n=>{o(n),e(n)}),s,(e=>i=e)).catch(s)}));var n},pl=Bc.isStandardBrowserEnv?{write:function(e,n,t,i,a,o){const s=[];s.push(e+"="+encodeURIComponent(n)),Cr.isNumber(t)&&s.push("expires="+new Date(t).toGMTString()),Cr.isString(i)&&s.push("path="+i),Cr.isString(a)&&s.push("domain="+a),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){const n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},ll=Bc.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let t;function i(t){let i=t;return e&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=i(window.location.href),function(e){const n=Cr.isString(e)?i(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0};function ul(e,n){let t=0;const i=Ip(50,250);return a=>{const o=a.loaded,s=a.lengthComputable?a.total:void 0,r=o-t,c=i(r);t=o;const p={loaded:o,total:s,progress:s?o/s:void 0,bytes:r,rate:c||void 0,estimated:c&&s&&o<=s?(s-o)/c:void 0,event:a};p[n?"download":"upload"]=!0,e(p)}}var dl="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(n,t){let i=e.data;const a=Xc.from(e.headers).normalize(),o=e.responseType;let s;function r(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}Cr.isFormData(i)&&(Bc.isStandardBrowserEnv||Bc.isStandardBrowserWebWorkerEnv?a.setContentType(!1):a.setContentType("multipart/form-data;",!1));let c=new XMLHttpRequest;if(e.auth){const n=e.auth.username||"",t=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.set("Authorization","Basic "+btoa(n+":"+t))}const p=tp(e.baseURL,e.url);function l(){if(!c)return;const i=Xc.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());np((function(e){n(e),r()}),(function(e){t(e),r()}),{data:o&&"text"!==o&&"json"!==o?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:i,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),Ic(p,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=l:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(l)},c.onabort=function(){c&&(t(new Rr("Request aborted",Rr.ECONNABORTED,e,c)),c=null)},c.onerror=function(){t(new Rr("Network Error",Rr.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let n=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const i=e.transitional||Mc;e.timeoutErrorMessage&&(n=e.timeoutErrorMessage),t(new Rr(n,i.clarifyTimeoutError?Rr.ETIMEDOUT:Rr.ECONNABORTED,e,c)),c=null},Bc.isStandardBrowserEnv){const n=(e.withCredentials||ll(p))&&e.xsrfCookieName&&pl.read(e.xsrfCookieName);n&&a.set(e.xsrfHeaderName,n)}void 0===i&&a.setContentType(null),"setRequestHeader"in c&&Cr.forEach(a.toJSON(),(function(e,n){c.setRequestHeader(n,e)})),Cr.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),o&&"json"!==o&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",ul(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",ul(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=n=>{c&&(t(!n||n.type?new ep(null,e,c):n),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const u=Lp(p);u&&-1===Bc.protocols.indexOf(u)?t(new Rr("Unsupported protocol "+u+":",Rr.ERR_BAD_REQUEST,e)):c.send(i||null)}))};const ml={http:cl,xhr:dl};Cr.forEach(ml,((e,n)=>{if(e){try{Object.defineProperty(e,"name",{value:n})}catch(e){}Object.defineProperty(e,"adapterName",{value:n})}}));var fl=e=>{e=Cr.isArray(e)?e:[e];const{length:n}=e;let t,i;for(let a=0;a<n&&(t=e[a],!(i=Cr.isString(t)?ml[t.toLowerCase()]:t));a++);if(!i){if(!1===i)throw new Rr(`Adapter ${t} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(Cr.hasOwnProp(ml,t)?`Adapter '${t}' is not available in the build`:`Unknown adapter '${t}'`)}if(!Cr.isFunction(i))throw new TypeError("adapter is not a function");return i};function hl(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ep(null,e)}function xl(e){hl(e),e.headers=Xc.from(e.headers),e.data=Qc.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return fl(e.adapter||Wc.adapter)(e).then((function(n){return hl(e),n.data=Qc.call(e,e.transformResponse,n),n.headers=Xc.from(n.headers),n}),(function(n){return Zc(n)||(hl(e),n&&n.response&&(n.response.data=Qc.call(e,e.transformResponse,n.response),n.response.headers=Xc.from(n.response.headers))),Promise.reject(n)}))}const vl=e=>e instanceof Xc?e.toJSON():e;function yl(e,n){n=n||{};const t={};function i(e,n,t){return Cr.isPlainObject(e)&&Cr.isPlainObject(n)?Cr.merge.call({caseless:t},e,n):Cr.isPlainObject(n)?Cr.merge({},n):Cr.isArray(n)?n.slice():n}function a(e,n,t){return Cr.isUndefined(n)?Cr.isUndefined(e)?void 0:i(void 0,e,t):i(e,n,t)}function o(e,n){if(!Cr.isUndefined(n))return i(void 0,n)}function s(e,n){return Cr.isUndefined(n)?Cr.isUndefined(e)?void 0:i(void 0,e):i(void 0,n)}function r(t,a,o){return o in n?i(t,a):o in e?i(void 0,t):void 0}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:r,headers:(e,n)=>a(vl(e),vl(n),!0)};return Cr.forEach(Object.keys(Object.assign({},e,n)),(function(i){const o=c[i]||a,s=o(e[i],n[i],i);Cr.isUndefined(s)&&o!==r||(t[i]=s)})),t}const gl={};["object","boolean","number","function","string","symbol"].forEach(((e,n)=>{gl[e]=function(t){return typeof t===e||"a"+(n<1?"n ":" ")+e}}));const bl={};gl.transitional=function(e,n,t){function i(e,n){return"[Axios v1.4.0] Transitional option '"+e+"'"+n+(t?". "+t:"")}return(t,a,o)=>{if(!1===e)throw new Rr(i(a," has been removed"+(n?" in "+n:"")),Rr.ERR_DEPRECATED);return n&&!bl[a]&&(bl[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),!e||e(t,a,o)}};var wl={assertOptions:function(e,n,t){if("object"!=typeof e)throw new Rr("options must be an object",Rr.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let a=i.length;for(;a-- >0;){const o=i[a],s=n[o];if(s){const n=e[o],t=void 0===n||s(n,o,e);if(!0!==t)throw new Rr("option "+o+" must be "+t,Rr.ERR_BAD_OPTION_VALUE)}else if(!0!==t)throw new Rr("Unknown option "+o,Rr.ERR_BAD_OPTION)}},validators:gl};const Sl=wl.validators;class kl{constructor(e){this.defaults=e,this.interceptors={request:new zc,response:new zc}}request(e,n){"string"==typeof e?(n=n||{}).url=e:n=e||{},n=yl(this.defaults,n);const{transitional:t,paramsSerializer:i,headers:a}=n;let o;void 0!==t&&wl.assertOptions(t,{silentJSONParsing:Sl.transitional(Sl.boolean),forcedJSONParsing:Sl.transitional(Sl.boolean),clarifyTimeoutError:Sl.transitional(Sl.boolean)},!1),null!=i&&(Cr.isFunction(i)?n.paramsSerializer={serialize:i}:wl.assertOptions(i,{encode:Sl.function,serialize:Sl.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase(),o=a&&Cr.merge(a.common,a[n.method]),o&&Cr.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete a[e]})),n.headers=Xc.concat(o,a);const s=[];let r=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(n)||(r=r&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const c=[];let p;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,u=0;if(!r){const e=[xl.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,c),l=e.length,p=Promise.resolve(n);u<l;)p=p.then(e[u++],e[u++]);return p}l=s.length;let d=n;for(u=0;u<l;){const e=s[u++],n=s[u++];try{d=e(d)}catch(e){n.call(this,e);break}}try{p=xl.call(this,d)}catch(e){return Promise.reject(e)}for(u=0,l=c.length;u<l;)p=p.then(c[u++],c[u++]);return p}getUri(e){return Ic(tp((e=yl(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}Cr.forEach(["delete","get","head","options"],(function(e){kl.prototype[e]=function(n,t){return this.request(yl(t||{},{method:e,url:n,data:(t||{}).data}))}})),Cr.forEach(["post","put","patch"],(function(e){function n(n){return function(t,i,a){return this.request(yl(a||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:t,data:i}))}}kl.prototype[e]=n(),kl.prototype[e+"Form"]=n(!0)}));var El=kl;class jl{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let n;this.promise=new Promise((function(e){n=e}));const t=this;this.promise.then((e=>{if(!t._listeners)return;let n=t._listeners.length;for(;n-- >0;)t._listeners[n](e);t._listeners=null})),this.promise.then=e=>{let n;const i=new Promise((e=>{t.subscribe(e),n=e})).then(e);return i.cancel=function(){t.unsubscribe(n)},i},e((function(e,i,a){t.reason||(t.reason=new ep(e,i,a),n(t.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);-1!==n&&this._listeners.splice(n,1)}static source(){let e;return{token:new jl((function(n){e=n})),cancel:e}}}var _l=jl;const Ol={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ol).forEach((([e,n])=>{Ol[n]=e}));var Tl=Ol;const Fl=function e(n){const t=new El(n),i=Qs(El.prototype.request,t);return Cr.extend(i,El.prototype,t,{allOwnKeys:!0}),Cr.extend(i,t,null,{allOwnKeys:!0}),i.create=function(t){return e(yl(n,t))},i}(Wc);Fl.Axios=El,Fl.CanceledError=ep,Fl.CancelToken=_l,Fl.isCancel=Zc,Fl.VERSION=Np,Fl.toFormData=Rc,Fl.AxiosError=Rr,Fl.Cancel=Fl.CanceledError,Fl.all=function(e){return Promise.all(e)},Fl.spread=function(e){return function(n){return e.apply(null,n)}},Fl.isAxiosError=function(e){return Cr.isObject(e)&&!0===e.isAxiosError},Fl.mergeConfig=yl,Fl.AxiosHeaders=Xc,Fl.formToJSON=e=>Uc(Cr.isHTMLForm(e)?new FormData(e):e),Fl.HttpStatusCode=Tl,Fl.default=Fl;var Al,Cl=Fl,Rl="undefined"!=typeof Symbol&&Symbol,Pl=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},n=Symbol("test"),t=Object(n);if("string"==typeof n)return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;for(n in e[n]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==n)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(e,n);if(42!==a.value||!0!==a.enumerable)return!1}return!0},Nl=Array.prototype.slice,Ll=Object.prototype.toString,Dl=function(e){var n=this;if("function"!=typeof n||"[object Function]"!==Ll.call(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var t,i=Nl.call(arguments,1),a=Math.max(0,n.length-i.length),o=[],s=0;s<a;s++)o.push("$"+s);if(t=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof t){var a=n.apply(this,i.concat(Nl.call(arguments)));return Object(a)===a?a:this}return n.apply(e,i.concat(Nl.call(arguments)))})),n.prototype){var r=function(){};r.prototype=n.prototype,t.prototype=new r,r.prototype=null}return t},Il=Function.prototype.bind||Dl,zl=Il.call(Function.call,Object.prototype.hasOwnProperty),Ml=SyntaxError,Bl=Function,Ul=TypeError,$l=function(e){try{return Bl('"use strict"; return ('+e+").constructor;")()}catch(e){}},ql=Object.getOwnPropertyDescriptor;if(ql)try{ql({},"")}catch(e){ql=null}var Wl=function(){throw new Ul},Hl=ql?function(){try{return Wl}catch(e){try{return ql(arguments,"callee").get}catch(e){return Wl}}}():Wl,Jl="function"==typeof Rl&&"function"==typeof Symbol&&"symbol"==typeof Rl("foo")&&"symbol"==typeof Symbol("bar")&&Pl(),Kl=Object.getPrototypeOf||function(e){return e.__proto__},Gl={},Vl="undefined"==typeof Uint8Array?Al:Kl(Uint8Array),Yl={"%AggregateError%":"undefined"==typeof AggregateError?Al:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?Al:ArrayBuffer,"%ArrayIteratorPrototype%":Jl?Kl([][Symbol.iterator]()):Al,"%AsyncFromSyncIteratorPrototype%":Al,"%AsyncFunction%":Gl,"%AsyncGenerator%":Gl,"%AsyncGeneratorFunction%":Gl,"%AsyncIteratorPrototype%":Gl,"%Atomics%":"undefined"==typeof Atomics?Al:Atomics,"%BigInt%":"undefined"==typeof BigInt?Al:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?Al:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?Al:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?Al:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?Al:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?Al:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?Al:FinalizationRegistry,"%Function%":Bl,"%GeneratorFunction%":Gl,"%Int8Array%":"undefined"==typeof Int8Array?Al:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?Al:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?Al:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Jl?Kl(Kl([][Symbol.iterator]())):Al,"%JSON%":"object"==typeof JSON?JSON:Al,"%Map%":"undefined"==typeof Map?Al:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&Jl?Kl((new Map)[Symbol.iterator]()):Al,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?Al:Promise,"%Proxy%":"undefined"==typeof Proxy?Al:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?Al:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?Al:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&Jl?Kl((new Set)[Symbol.iterator]()):Al,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?Al:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Jl?Kl(""[Symbol.iterator]()):Al,"%Symbol%":Jl?Symbol:Al,"%SyntaxError%":Ml,"%ThrowTypeError%":Hl,"%TypedArray%":Vl,"%TypeError%":Ul,"%Uint8Array%":"undefined"==typeof Uint8Array?Al:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?Al:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?Al:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?Al:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?Al:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?Al:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?Al:WeakSet};try{null.error}catch(e){var Xl=Kl(Kl(e));Yl["%Error.prototype%"]=Xl}var Ql=function e(n){var t;if("%AsyncFunction%"===n)t=$l("async function () {}");else if("%GeneratorFunction%"===n)t=$l("function* () {}");else if("%AsyncGeneratorFunction%"===n)t=$l("async function* () {}");else if("%AsyncGenerator%"===n){var i=e("%AsyncGeneratorFunction%");i&&(t=i.prototype)}else if("%AsyncIteratorPrototype%"===n){var a=e("%AsyncGenerator%");a&&(t=Kl(a.prototype))}return Yl[n]=t,t},Zl={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},eu=Il,nu=zl,tu=eu.call(Function.call,Array.prototype.concat),iu=eu.call(Function.apply,Array.prototype.splice),au=eu.call(Function.call,String.prototype.replace),ou=eu.call(Function.call,String.prototype.slice),su=eu.call(Function.call,RegExp.prototype.exec),ru=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,cu=/\\(\\)?/g,pu=function(e,n){var t,i=e;if(nu(Zl,i)&&(i="%"+(t=Zl[i])[0]+"%"),nu(Yl,i)){var a=Yl[i];if(a===Gl&&(a=Ql(i)),void 0===a&&!n)throw new Ul("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:t,name:i,value:a}}throw new Ml("intrinsic "+e+" does not exist!")},lu=function(e,n){if("string"!=typeof e||0===e.length)throw new Ul("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof n)throw new Ul('"allowMissing" argument must be a boolean');if(null===su(/^%?[^%]*%?$/,e))throw new Ml("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var t=function(e){var n=ou(e,0,1),t=ou(e,-1);if("%"===n&&"%"!==t)throw new Ml("invalid intrinsic syntax, expected closing `%`");if("%"===t&&"%"!==n)throw new Ml("invalid intrinsic syntax, expected opening `%`");var i=[];return au(e,ru,(function(e,n,t,a){i[i.length]=t?au(a,cu,"$1"):n||e})),i}(e),i=t.length>0?t[0]:"",a=pu("%"+i+"%",n),o=a.name,s=a.value,r=!1,c=a.alias;c&&(i=c[0],iu(t,tu([0,1],c)));for(var p=1,l=!0;p<t.length;p+=1){var u=t[p],d=ou(u,0,1),m=ou(u,-1);if(('"'===d||"'"===d||"`"===d||'"'===m||"'"===m||"`"===m)&&d!==m)throw new Ml("property names with quotes must have matching quotes");if("constructor"!==u&&l||(r=!0),nu(Yl,o="%"+(i+="."+u)+"%"))s=Yl[o];else if(null!=s){if(!(u in s)){if(!n)throw new Ul("base intrinsic for "+e+" exists, but the property is not available.");return}if(ql&&p+1>=t.length){var f=ql(s,u);s=(l=!!f)&&"get"in f&&!("originalValue"in f.get)?f.get:s[u]}else l=nu(s,u),s=s[u];l&&!r&&(Yl[o]=s)}}return s},uu={};!function(e){var n=Il,t=lu,i=t("%Function.prototype.apply%"),a=t("%Function.prototype.call%"),o=t("%Reflect.apply%",!0)||n.call(a,i),s=t("%Object.getOwnPropertyDescriptor%",!0),r=t("%Object.defineProperty%",!0),c=t("%Math.max%");if(r)try{r({},"a",{value:1})}catch(e){r=null}e.exports=function(e){var t=o(n,a,arguments);s&&r&&(s(t,"length").configurable&&r(t,"length",{value:1+c(0,e.length-(arguments.length-1))}));return t};var p=function(){return o(n,i,arguments)};r?r(e.exports,"apply",{value:p}):e.exports.apply=p}({get exports(){return uu},set exports(e){uu=e}});var du=lu,mu=uu,fu=mu(du("String.prototype.indexOf")),hu=o.inspect,xu="function"==typeof Map&&Map.prototype,vu=Object.getOwnPropertyDescriptor&&xu?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,yu=xu&&vu&&"function"==typeof vu.get?vu.get:null,gu=xu&&Map.prototype.forEach,bu="function"==typeof Set&&Set.prototype,wu=Object.getOwnPropertyDescriptor&&bu?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Su=bu&&wu&&"function"==typeof wu.get?wu.get:null,ku=bu&&Set.prototype.forEach,Eu="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,ju="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,_u="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,Ou=Boolean.prototype.valueOf,Tu=Object.prototype.toString,Fu=Function.prototype.toString,Au=String.prototype.match,Cu=String.prototype.slice,Ru=String.prototype.replace,Pu=String.prototype.toUpperCase,Nu=String.prototype.toLowerCase,Lu=RegExp.prototype.test,Du=Array.prototype.concat,Iu=Array.prototype.join,zu=Array.prototype.slice,Mu=Math.floor,Bu="function"==typeof BigInt?BigInt.prototype.valueOf:null,Uu=Object.getOwnPropertySymbols,$u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,qu="function"==typeof Symbol&&"object"==typeof Symbol.iterator,Wu="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===qu||"symbol")?Symbol.toStringTag:null,Hu=Object.prototype.propertyIsEnumerable,Ju=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function Ku(e,n){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||Lu.call(/e/,n))return n;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var i=e<0?-Mu(-e):Mu(e);if(i!==e){var a=String(i),o=Cu.call(n,a.length+1);return Ru.call(a,t,"$&_")+"."+Ru.call(Ru.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ru.call(n,t,"$&_")}var Gu=hu,Vu=Gu.custom,Yu=nd(Vu)?Vu:null;function Xu(e,n,t){var i="double"===(t.quoteStyle||n)?'"':"'";return i+e+i}function Qu(e){return Ru.call(String(e),/"/g,""")}function Zu(e){return!("[object Array]"!==ad(e)||Wu&&"object"==typeof e&&Wu in e)}function ed(e){return!("[object RegExp]"!==ad(e)||Wu&&"object"==typeof e&&Wu in e)}function nd(e){if(qu)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!$u)return!1;try{return $u.call(e),!0}catch(e){}return!1}var td=Object.prototype.hasOwnProperty||function(e){return e in this};function id(e,n){return td.call(e,n)}function ad(e){return Tu.call(e)}function od(e,n){if(e.indexOf)return e.indexOf(n);for(var t=0,i=e.length;t<i;t++)if(e[t]===n)return t;return-1}function sd(e,n){if(e.length>n.maxStringLength){var t=e.length-n.maxStringLength,i="... "+t+" more character"+(t>1?"s":"");return sd(Cu.call(e,0,n.maxStringLength),n)+i}return Xu(Ru.call(Ru.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,rd),"single",n)}function rd(e){var n=e.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[n];return t?"\\"+t:"\\x"+(n<16?"0":"")+Pu.call(n.toString(16))}function cd(e){return"Object("+e+")"}function pd(e){return e+" { ? }"}function ld(e,n,t,i){return e+" ("+n+") {"+(i?ud(t,i):Iu.call(t,", "))+"}"}function ud(e,n){if(0===e.length)return"";var t="\n"+n.prev+n.base;return t+Iu.call(e,","+t)+"\n"+n.prev}function dd(e,n){var t=Zu(e),i=[];if(t){i.length=e.length;for(var a=0;a<e.length;a++)i[a]=id(e,a)?n(e[a],e):""}var o,s="function"==typeof Uu?Uu(e):[];if(qu){o={};for(var r=0;r<s.length;r++)o["$"+s[r]]=s[r]}for(var c in e)id(e,c)&&(t&&String(Number(c))===c&&c<e.length||qu&&o["$"+c]instanceof Symbol||(Lu.call(/[^\w$]/,c)?i.push(n(c,e)+": "+n(e[c],e)):i.push(c+": "+n(e[c],e))));if("function"==typeof Uu)for(var p=0;p<s.length;p++)Hu.call(e,s[p])&&i.push("["+n(s[p])+"]: "+n(e[s[p]],e));return i}var md=lu,fd=function(e,n){var t=du(e,!!n);return"function"==typeof t&&fu(e,".prototype.")>-1?mu(t):t},hd=function e(n,t,i,a){var o=t||{};if(id(o,"quoteStyle")&&"single"!==o.quoteStyle&&"double"!==o.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(id(o,"maxStringLength")&&("number"==typeof o.maxStringLength?o.maxStringLength<0&&o.maxStringLength!==1/0:null!==o.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=!id(o,"customInspect")||o.customInspect;if("boolean"!=typeof s&&"symbol"!==s)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(id(o,"indent")&&null!==o.indent&&"\t"!==o.indent&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(id(o,"numericSeparator")&&"boolean"!=typeof o.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var r=o.numericSeparator;if(void 0===n)return"undefined";if(null===n)return"null";if("boolean"==typeof n)return n?"true":"false";if("string"==typeof n)return sd(n,o);if("number"==typeof n){if(0===n)return 1/0/n>0?"0":"-0";var c=String(n);return r?Ku(n,c):c}if("bigint"==typeof n){var p=String(n)+"n";return r?Ku(n,p):p}var l=void 0===o.depth?5:o.depth;if(void 0===i&&(i=0),i>=l&&l>0&&"object"==typeof n)return Zu(n)?"[Array]":"[Object]";var u=function(e,n){var t;if("\t"===e.indent)t="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;t=Iu.call(Array(e.indent+1)," ")}return{base:t,prev:Iu.call(Array(n+1),t)}}(o,i);if(void 0===a)a=[];else if(od(a,n)>=0)return"[Circular]";function d(n,t,s){if(t&&(a=zu.call(a)).push(t),s){var r={depth:o.depth};return id(o,"quoteStyle")&&(r.quoteStyle=o.quoteStyle),e(n,r,i+1,a)}return e(n,o,i+1,a)}if("function"==typeof n&&!ed(n)){var m=function(e){if(e.name)return e.name;var n=Au.call(Fu.call(e),/^function\s*([\w$]+)/);if(n)return n[1];return null}(n),f=dd(n,d);return"[Function"+(m?": "+m:" (anonymous)")+"]"+(f.length>0?" { "+Iu.call(f,", ")+" }":"")}if(nd(n)){var h=qu?Ru.call(String(n),/^(Symbol\(.*\))_[^)]*$/,"$1"):$u.call(n);return"object"!=typeof n||qu?h:cd(h)}if(function(e){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"==typeof e.nodeName&&"function"==typeof e.getAttribute}(n)){for(var x="<"+Nu.call(String(n.nodeName)),v=n.attributes||[],y=0;y<v.length;y++)x+=" "+v[y].name+"="+Xu(Qu(v[y].value),"double",o);return x+=">",n.childNodes&&n.childNodes.length&&(x+="..."),x+="</"+Nu.call(String(n.nodeName))+">"}if(Zu(n)){if(0===n.length)return"[]";var g=dd(n,d);return u&&!function(e){for(var n=0;n<e.length;n++)if(od(e[n],"\n")>=0)return!1;return!0}(g)?"["+ud(g,u)+"]":"[ "+Iu.call(g,", ")+" ]"}if(function(e){return!("[object Error]"!==ad(e)||Wu&&"object"==typeof e&&Wu in e)}(n)){var b=dd(n,d);return"cause"in Error.prototype||!("cause"in n)||Hu.call(n,"cause")?0===b.length?"["+String(n)+"]":"{ ["+String(n)+"] "+Iu.call(b,", ")+" }":"{ ["+String(n)+"] "+Iu.call(Du.call("[cause]: "+d(n.cause),b),", ")+" }"}if("object"==typeof n&&s){if(Yu&&"function"==typeof n[Yu]&&Gu)return Gu(n,{depth:l-i});if("symbol"!==s&&"function"==typeof n.inspect)return n.inspect()}if(function(e){if(!yu||!e||"object"!=typeof e)return!1;try{yu.call(e);try{Su.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(n)){var w=[];return gu&&gu.call(n,(function(e,t){w.push(d(t,n,!0)+" => "+d(e,n))})),ld("Map",yu.call(n),w,u)}if(function(e){if(!Su||!e||"object"!=typeof e)return!1;try{Su.call(e);try{yu.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(n)){var S=[];return ku&&ku.call(n,(function(e){S.push(d(e,n))})),ld("Set",Su.call(n),S,u)}if(function(e){if(!Eu||!e||"object"!=typeof e)return!1;try{Eu.call(e,Eu);try{ju.call(e,ju)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(n))return pd("WeakMap");if(function(e){if(!ju||!e||"object"!=typeof e)return!1;try{ju.call(e,ju);try{Eu.call(e,Eu)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(n))return pd("WeakSet");if(function(e){if(!_u||!e||"object"!=typeof e)return!1;try{return _u.call(e),!0}catch(e){}return!1}(n))return pd("WeakRef");if(function(e){return!("[object Number]"!==ad(e)||Wu&&"object"==typeof e&&Wu in e)}(n))return cd(d(Number(n)));if(function(e){if(!e||"object"!=typeof e||!Bu)return!1;try{return Bu.call(e),!0}catch(e){}return!1}(n))return cd(d(Bu.call(n)));if(function(e){return!("[object Boolean]"!==ad(e)||Wu&&"object"==typeof e&&Wu in e)}(n))return cd(Ou.call(n));if(function(e){return!("[object String]"!==ad(e)||Wu&&"object"==typeof e&&Wu in e)}(n))return cd(d(String(n)));if(!function(e){return!("[object Date]"!==ad(e)||Wu&&"object"==typeof e&&Wu in e)}(n)&&!ed(n)){var k=dd(n,d),E=Ju?Ju(n)===Object.prototype:n instanceof Object||n.constructor===Object,j=n instanceof Object?"":"null prototype",_=!E&&Wu&&Object(n)===n&&Wu in n?Cu.call(ad(n),8,-1):j?"Object":"",O=(E||"function"!=typeof n.constructor?"":n.constructor.name?n.constructor.name+" ":"")+(_||j?"["+Iu.call(Du.call([],_||[],j||[]),": ")+"] ":"");return 0===k.length?O+"{}":u?O+"{"+ud(k,u)+"}":O+"{ "+Iu.call(k,", ")+" }"}return String(n)},xd=md("%TypeError%"),vd=md("%WeakMap%",!0),yd=md("%Map%",!0),gd=fd("WeakMap.prototype.get",!0),bd=fd("WeakMap.prototype.set",!0),wd=fd("WeakMap.prototype.has",!0),Sd=fd("Map.prototype.get",!0),kd=fd("Map.prototype.set",!0),Ed=fd("Map.prototype.has",!0),jd=function(e,n){for(var t,i=e;null!==(t=i.next);i=t)if(t.key===n)return i.next=t.next,t.next=e.next,e.next=t,t},_d=String.prototype.replace,Od=/%20/g,Td="RFC3986",Fd={default:Td,formatters:{RFC1738:function(e){return _d.call(e,Od,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:Td},Ad=Fd,Cd=Object.prototype.hasOwnProperty,Rd=Array.isArray,Pd=function(){for(var e=[],n=0;n<256;++n)e.push("%"+((n<16?"0":"")+n.toString(16)).toUpperCase());return e}(),Nd=function(e,n){for(var t=n&&n.plainObjects?Object.create(null):{},i=0;i<e.length;++i)void 0!==e[i]&&(t[i]=e[i]);return t},Ld={arrayToObject:Nd,assign:function(e,n){return Object.keys(n).reduce((function(e,t){return e[t]=n[t],e}),e)},combine:function(e,n){return[].concat(e,n)},compact:function(e){for(var n=[{obj:{o:e},prop:"o"}],t=[],i=0;i<n.length;++i)for(var a=n[i],o=a.obj[a.prop],s=Object.keys(o),r=0;r<s.length;++r){var c=s[r],p=o[c];"object"==typeof p&&null!==p&&-1===t.indexOf(p)&&(n.push({obj:o,prop:c}),t.push(p))}return function(e){for(;e.length>1;){var n=e.pop(),t=n.obj[n.prop];if(Rd(t)){for(var i=[],a=0;a<t.length;++a)void 0!==t[a]&&i.push(t[a]);n.obj[n.prop]=i}}}(n),e},decode:function(e,n,t){var i=e.replace(/\+/g," ");if("iso-8859-1"===t)return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch(e){return i}},encode:function(e,n,t,i,a){if(0===e.length)return e;var o=e;if("symbol"==typeof e?o=Symbol.prototype.toString.call(e):"string"!=typeof e&&(o=String(e)),"iso-8859-1"===t)return escape(o).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var s="",r=0;r<o.length;++r){var c=o.charCodeAt(r);45===c||46===c||95===c||126===c||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||a===Ad.RFC1738&&(40===c||41===c)?s+=o.charAt(r):c<128?s+=Pd[c]:c<2048?s+=Pd[192|c>>6]+Pd[128|63&c]:c<55296||c>=57344?s+=Pd[224|c>>12]+Pd[128|c>>6&63]+Pd[128|63&c]:(r+=1,c=65536+((1023&c)<<10|1023&o.charCodeAt(r)),s+=Pd[240|c>>18]+Pd[128|c>>12&63]+Pd[128|c>>6&63]+Pd[128|63&c])}return s},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,n){if(Rd(e)){for(var t=[],i=0;i<e.length;i+=1)t.push(n(e[i]));return t}return n(e)},merge:function e(n,t,i){if(!t)return n;if("object"!=typeof t){if(Rd(n))n.push(t);else{if(!n||"object"!=typeof n)return[n,t];(i&&(i.plainObjects||i.allowPrototypes)||!Cd.call(Object.prototype,t))&&(n[t]=!0)}return n}if(!n||"object"!=typeof n)return[n].concat(t);var a=n;return Rd(n)&&!Rd(t)&&(a=Nd(n,i)),Rd(n)&&Rd(t)?(t.forEach((function(t,a){if(Cd.call(n,a)){var o=n[a];o&&"object"==typeof o&&t&&"object"==typeof t?n[a]=e(o,t,i):n.push(t)}else n[a]=t})),n):Object.keys(t).reduce((function(n,a){var o=t[a];return Cd.call(n,a)?n[a]=e(n[a],o,i):n[a]=o,n}),a)}},Dd=function(){var e,n,t,i={assert:function(e){if(!i.has(e))throw new xd("Side channel does not contain "+hd(e))},get:function(i){if(vd&&i&&("object"==typeof i||"function"==typeof i)){if(e)return gd(e,i)}else if(yd){if(n)return Sd(n,i)}else if(t)return function(e,n){var t=jd(e,n);return t&&t.value}(t,i)},has:function(i){if(vd&&i&&("object"==typeof i||"function"==typeof i)){if(e)return wd(e,i)}else if(yd){if(n)return Ed(n,i)}else if(t)return function(e,n){return!!jd(e,n)}(t,i);return!1},set:function(i,a){vd&&i&&("object"==typeof i||"function"==typeof i)?(e||(e=new vd),bd(e,i,a)):yd?(n||(n=new yd),kd(n,i,a)):(t||(t={key:{},next:null}),function(e,n,t){var i=jd(e,n);i?i.value=t:e.next={key:n,next:e.next,value:t}}(t,i,a))}};return i},Id=Ld,zd=Fd,Md=Object.prototype.hasOwnProperty,Bd={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,n){return e+"["+n+"]"},repeat:function(e){return e}},Ud=Array.isArray,$d=Array.prototype.push,qd=function(e,n){$d.apply(e,Ud(n)?n:[n])},Wd=Date.prototype.toISOString,Hd=zd.default,Jd={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Id.encode,encodeValuesOnly:!1,format:Hd,formatter:zd.formatters[Hd],indices:!1,serializeDate:function(e){return Wd.call(e)},skipNulls:!1,strictNullHandling:!1},Kd={},Gd=function e(n,t,i,a,o,s,r,c,p,l,u,d,m,f,h,x){for(var v,y=n,g=x,b=0,w=!1;void 0!==(g=g.get(Kd))&&!w;){var S=g.get(n);if(b+=1,void 0!==S){if(S===b)throw new RangeError("Cyclic object value");w=!0}void 0===g.get(Kd)&&(b=0)}if("function"==typeof c?y=c(t,y):y instanceof Date?y=u(y):"comma"===i&&Ud(y)&&(y=Id.maybeMap(y,(function(e){return e instanceof Date?u(e):e}))),null===y){if(o)return r&&!f?r(t,Jd.encoder,h,"key",d):t;y=""}if("string"==typeof(v=y)||"number"==typeof v||"boolean"==typeof v||"symbol"==typeof v||"bigint"==typeof v||Id.isBuffer(y))return r?[m(f?t:r(t,Jd.encoder,h,"key",d))+"="+m(r(y,Jd.encoder,h,"value",d))]:[m(t)+"="+m(String(y))];var k,E=[];if(void 0===y)return E;if("comma"===i&&Ud(y))f&&r&&(y=Id.maybeMap(y,r)),k=[{value:y.length>0?y.join(",")||null:void 0}];else if(Ud(c))k=c;else{var j=Object.keys(y);k=p?j.sort(p):j}for(var _=a&&Ud(y)&&1===y.length?t+"[]":t,O=0;O<k.length;++O){var T=k[O],F="object"==typeof T&&void 0!==T.value?T.value:y[T];if(!s||null!==F){var A=Ud(y)?"function"==typeof i?i(_,T):_:_+(l?"."+T:"["+T+"]");x.set(n,b);var C=Dd();C.set(Kd,x),qd(E,e(F,A,i,a,o,s,"comma"===i&&f&&Ud(y)?null:r,c,p,l,u,d,m,f,h,C))}}return E},Vd=Ld,Yd=Object.prototype.hasOwnProperty,Xd=Array.isArray,Qd={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Vd.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Zd=function(e){return e.replace(/&#(\d+);/g,(function(e,n){return String.fromCharCode(parseInt(n,10))}))},em=function(e,n){return e&&"string"==typeof e&&n.comma&&e.indexOf(",")>-1?e.split(","):e},nm=function(e,n,t,i){if(e){var a=t.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/g,s=t.depth>0&&/(\[[^[\]]*])/.exec(a),r=s?a.slice(0,s.index):a,c=[];if(r){if(!t.plainObjects&&Yd.call(Object.prototype,r)&&!t.allowPrototypes)return;c.push(r)}for(var p=0;t.depth>0&&null!==(s=o.exec(a))&&p<t.depth;){if(p+=1,!t.plainObjects&&Yd.call(Object.prototype,s[1].slice(1,-1))&&!t.allowPrototypes)return;c.push(s[1])}return s&&c.push("["+a.slice(s.index)+"]"),function(e,n,t,i){for(var a=i?n:em(n,t),o=e.length-1;o>=0;--o){var s,r=e[o];if("[]"===r&&t.parseArrays)s=[].concat(a);else{s=t.plainObjects?Object.create(null):{};var c="["===r.charAt(0)&&"]"===r.charAt(r.length-1)?r.slice(1,-1):r,p=parseInt(c,10);t.parseArrays||""!==c?!isNaN(p)&&r!==c&&String(p)===c&&p>=0&&t.parseArrays&&p<=t.arrayLimit?(s=[])[p]=a:"__proto__"!==c&&(s[c]=a):s={0:a}}a=s}return a}(c,n,t,i)}},tm=function(e,n){var t,i=e,a=function(e){if(!e)return Jd;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var n=e.charset||Jd.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=zd.default;if(void 0!==e.format){if(!Md.call(zd.formatters,e.format))throw new TypeError("Unknown format option provided.");t=e.format}var i=zd.formatters[t],a=Jd.filter;return("function"==typeof e.filter||Ud(e.filter))&&(a=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:Jd.addQueryPrefix,allowDots:void 0===e.allowDots?Jd.allowDots:!!e.allowDots,charset:n,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:Jd.charsetSentinel,delimiter:void 0===e.delimiter?Jd.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:Jd.encode,encoder:"function"==typeof e.encoder?e.encoder:Jd.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:Jd.encodeValuesOnly,filter:a,format:t,formatter:i,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:Jd.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:Jd.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:Jd.strictNullHandling}}(n);"function"==typeof a.filter?i=(0,a.filter)("",i):Ud(a.filter)&&(t=a.filter);var o,s=[];if("object"!=typeof i||null===i)return"";o=n&&n.arrayFormat in Bd?n.arrayFormat:n&&"indices"in n?n.indices?"indices":"repeat":"indices";var r=Bd[o];if(n&&"commaRoundTrip"in n&&"boolean"!=typeof n.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c="comma"===r&&n&&n.commaRoundTrip;t||(t=Object.keys(i)),a.sort&&t.sort(a.sort);for(var p=Dd(),l=0;l<t.length;++l){var u=t[l];a.skipNulls&&null===i[u]||qd(s,Gd(i[u],u,r,c,a.strictNullHandling,a.skipNulls,a.encode?a.encoder:null,a.filter,a.sort,a.allowDots,a.serializeDate,a.format,a.formatter,a.encodeValuesOnly,a.charset,p))}var d=s.join(a.delimiter),m=!0===a.addQueryPrefix?"?":"";return a.charsetSentinel&&("iso-8859-1"===a.charset?m+="utf8=%26%2310003%3B&":m+="utf8=%E2%9C%93&"),d.length>0?m+d:""},im=function(e,n){var t=function(e){if(!e)return Qd;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=void 0===e.charset?Qd.charset:e.charset;return{allowDots:void 0===e.allowDots?Qd.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:Qd.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:Qd.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:Qd.arrayLimit,charset:n,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:Qd.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:Qd.comma,decoder:"function"==typeof e.decoder?e.decoder:Qd.decoder,delimiter:"string"==typeof e.delimiter||Vd.isRegExp(e.delimiter)?e.delimiter:Qd.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:Qd.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:Qd.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:Qd.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:Qd.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:Qd.strictNullHandling}}(n);if(""===e||null==e)return t.plainObjects?Object.create(null):{};for(var i="string"==typeof e?function(e,n){var t,i={__proto__:null},a=n.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=n.parameterLimit===1/0?void 0:n.parameterLimit,s=a.split(n.delimiter,o),r=-1,c=n.charset;if(n.charsetSentinel)for(t=0;t<s.length;++t)0===s[t].indexOf("utf8=")&&("utf8=%E2%9C%93"===s[t]?c="utf-8":"utf8=%26%2310003%3B"===s[t]&&(c="iso-8859-1"),r=t,t=s.length);for(t=0;t<s.length;++t)if(t!==r){var p,l,u=s[t],d=u.indexOf("]="),m=-1===d?u.indexOf("="):d+1;-1===m?(p=n.decoder(u,Qd.decoder,c,"key"),l=n.strictNullHandling?null:""):(p=n.decoder(u.slice(0,m),Qd.decoder,c,"key"),l=Vd.maybeMap(em(u.slice(m+1),n),(function(e){return n.decoder(e,Qd.decoder,c,"value")}))),l&&n.interpretNumericEntities&&"iso-8859-1"===c&&(l=Zd(l)),u.indexOf("[]=")>-1&&(l=Xd(l)?[l]:l),Yd.call(i,p)?i[p]=Vd.combine(i[p],l):i[p]=l}return i}(e,t):e,a=t.plainObjects?Object.create(null):{},o=Object.keys(i),s=0;s<o.length;++s){var r=o[s],c=nm(r,i[r],t,"string"==typeof e);a=Vd.merge(a,c,t)}return!0===t.allowSparse?a:Vd.compact(a)},am={formats:Fd,parse:im,stringify:tm};const om=function(){const e=Cl.create();return e.interceptors.request.use((e=>(e.formData&&(e.data=am.stringify(e.formData,{arrayFormat:"indices",allowDots:!0}),delete e.formData),e)),(e=>(Cs.error(e),Promise.reject(e)))),e.interceptors.response.use((e=>(Cs.info("http response:",JSON.stringify(e.data)),e.data)),(e=>(Cs.error("请求出错:",e.response.config.url,e),Promise.reject(e)))),e}();class sm{rootDir;scope;parent;constructor(e){this.rootDir=Ks.getFileRootDir(e?.rootDir),this.scope=e?.scope||"0",this.parent=e?.parent||"0"}readFile(e){return c.existsSync(e)?c.readFileSync(e):null}writeFile(e,n){const t=this.buildFilePath(e);return c.writeFileSync(t,n),t}buildFilePath(e){const n=l.join(this.rootDir,this.scope+"",this.parent+"",b().format("YYYY-MM-DD"));return c.existsSync(n)||c.mkdirSync(n,{recursive:!0}),l.join(n,e)}deleteByParent(e,n){const t=l.join(this.rootDir,e,n);c.existsSync(t)&&c.unlinkSync(t)}}const rm=new Ds,cm="pipeline:access",pm="pipeline:access:input";const lm={sleep:function(e){return new Promise((n=>{setTimeout((()=>{n({})}),e)}))},http:om};exports.ACCESS_CLASS_KEY=cm,exports.ACCESS_INPUT_KEY=pm,exports.AUTOWIRE_KEY=Us,exports.AbstractTaskPlugin=class{_result={clearLastStatus:!1,files:[]};ctx;clearLastStatus(){this._result.clearLastStatus=!0}getFiles(){return this._result.files}setCtx(e){this.ctx=e}randomFileId(){return Math.random().toString(36).substring(2,9)}linkFile(e){this._result.files.push({...e,id:this.randomFileId()})}saveFile(e,n){const t=this.ctx.fileStore.writeFile(e,n);this._result.files.push({id:this.randomFileId(),filename:e,path:t})}get pipeline(){return this.ctx.pipeline}get step(){return this.ctx.step}async onInstance(){}},exports.AccessInput=function(e){return(n,t)=>{n=Bs.target(n,t),Reflect.defineMetadata(pm,e,n,t)}},exports.Autowire=function(e){return(n,t)=>{const i=Reflect.getMetadata("design:type",n,t);n=Bs.target(n,t),(e=e||{}).type=i,Reflect.defineMetadata(Us,e||{},n,t)}},exports.ContextFactory=Ys,exports.Decorator=Bs,exports.Executor=class{pipeline;runtime;contextFactory;logger;pipelineContext;lastStatusMap;lastRuntime;options;onChanged;constructor(e){this.options=e,this.pipeline=s.cloneDeep(e.pipeline),this.onChanged=async n=>{await e.onChanged(n)},this.pipeline.userId=e.userId,this.contextFactory=new Ys(e.storage),this.logger=Cs,this.pipelineContext=this.contextFactory.getContext("pipeline",this.pipeline.id)}async init(){const e=await this.pipelineContext.getObj("lastRuntime");this.lastRuntime=e,this.lastStatusMap=new Ns(e?.pipeline)}async run(e=0,n){try{await this.init();const t={type:n};this.runtime=new Ps(e,t,this.pipeline),this.logger.info(`pipeline.${this.pipeline.id} start`),await this.notification("start"),await this.runWithHistory(this.pipeline,"pipeline",(async()=>{await this.runStages(this.pipeline)})),this.lastRuntime&&this.lastRuntime.pipeline.status?.status===exports.ResultType.error&&await this.notification("turnToSuccess"),await this.notification("success")}catch(e){await this.notification("error",e),this.logger.error("pipeline 执行失败",e)}finally{await this.pipelineContext.setObj("lastRuntime",this.runtime),this.logger.info(`pipeline.${this.pipeline.id} end`)}}async runWithHistory(e,n,t){if(e.runnableType=n,this.runtime.start(e),await this.onChanged(this.runtime),e.strategy?.runStrategy===exports.RunStrategy.SkipWhenSucceed){const t=this.lastStatusMap.get(e.id),i=t?.status?.status,a=JSON.stringify(t?.status?.input);let o=!1;if("step"===n){const n=e,t=JSON.stringify(n.input);null!=t&&a!==t&&(o=!0)}if(null!=i&&i===exports.ResultType.success&&!o)return this.runtime.skip(e),await this.onChanged(this.runtime),exports.ResultType.skip}try{return await t(),this.runtime.success(e),await this.onChanged(this.runtime),exports.ResultType.success}catch(n){throw this.runtime.error(e,n),await this.onChanged(this.runtime),n}finally{this.runtime.finally(e)}}async runStages(e){const n=[];for(const t of e.stages){const e=await this.runWithHistory(t,"stage",(async()=>{await this.runStage(t)}));n.push(e)}return this.compositionResultType(n)}async runStage(e){const n=[];for(const t of e.tasks){const e=this.runWithHistory(t,"task",(async()=>{await this.runTask(t)}));n.push(e)}let t=[];if(e.concurrency===exports.ConcurrencyStrategy.Parallel)t=await Promise.all(n);else for(let e=0;e<n.length;e++){const i=n[e];t[e]=await i}return this.compositionResultType(t)}compositionResultType(e){let n=!1;for(const t of e){if(t===exports.ResultType.error)return exports.ResultType.error;t===exports.ResultType.success&&(n=!0)}return n?exports.ResultType.success:exports.ResultType.error}async runTask(e){const n=[];for(const t of e.steps){t.runnableType="step";const e=await this.runWithHistory(t,"step",(async()=>{await this.runStep(t)}));n.push(e)}return this.compositionResultType(n)}async runStep(e){const n=this.lastStatusMap.get(e.id),t=Is.get(e.type),i=new t.target,a=t.define;Bs.inject(a.input,i,e.input,((n,t)=>{if("pi-output-selector"===n.component?.name){const n=e.input[t];null!=n&&(e.input[t]=this.runtime.context[n])}}));const o={pipeline:this.pipeline,step:e,lastStatus:n,http:om,logger:this.runtime._loggers[e.id],accessService:this.options.accessService,emailService:this.options.emailService,pipelineContext:this.pipelineContext,userContext:this.contextFactory.getContext("user",this.options.userId),fileStore:new sm({scope:this.pipeline.id,parent:this.runtime.id,rootDir:this.options.fileRootDir})};i.setCtx(o),await i.onInstance(),await i.execute(),i._result.clearLastStatus&&this.lastStatusMap.clear(),s.forEach(a.output,((n,t)=>{e.status.output[t]=i[t];const a=`step.${e.id}.${t}`;this.runtime.context[a]=i[t]})),e.status.files=i.getFiles()}async notification(e,n){if(!this.pipeline.notifications)return;let t="",i="";if("start"===e)t=`【CertD】开始执行,${this.pipeline.title}, buildId:${this.runtime.id}`,i=t;else if("success"===e)t=`【CertD】执行成功,${this.pipeline.title}, buildId:${this.runtime.id}`,i=t;else if("turnToSuccess"===e)t=`【CertD】执行成功(错误转成功),${this.pipeline.title}, buildId:${this.runtime.id}`,i=t;else{if("error"!==e)return;t=`【CertD】执行失败,${this.pipeline.title}, buildId:${this.runtime.id}`,i=`<pre>${n.message}</pre>`}for(const n of this.pipeline.notifications)n.when.includes(e)&&"email"===n.type&&this.options.emailService?.send({userId:this.pipeline.userId,subject:t,content:i,receivers:n.options.receivers})}},exports.FileStorage=class{root;constructor(e){this.root=Ks.getFileRootDir(e)}async remove(e,n,t,i){i?c.unlinkSync(this.buildPath(e,n,t,i)):t?c.rmdirSync(this.buildPath(e,n,t)):n?c.rmdirSync(this.buildPath(e,n)):c.rmdirSync(this.buildPath(e))}writeFile(e,n){const t=l.dirname(e);return c.existsSync(t)||c.mkdirSync(t,{recursive:!0}),c.writeFileSync(e,n),e}readFile(e){return c.existsSync(e)?c.readFileSync(e).toString():null}async get(e,n,t,i){const a=this.buildPath(e,n,t,i);return this.readFile(a)}async set(e,n,t,i,a){const o=this.buildPath(e,n,t,i);this.writeFile(o,a)}buildPath(e,n,t,i){return i?`${this.root}/${e}/${n}/${t}/${i}`:t?`${this.root}/${e}/${n}/${t}`:n?`${this.root}/${e}/${n}`:`${this.root}/${e}`}},exports.FileStore=sm,exports.IsAccess=function(e){return n=>{n=Bs.target(n);const t={},i=Bs.getClassProperties(n);for(const e in i){const i=Reflect.getMetadata(pm,n,e);i&&(t[e]=i)}s.merge(e,{input:t}),Reflect.defineMetadata(cm,e,n),n.define=e,rm.register(e.name,{define:e,target:n})}},exports.IsTaskPlugin=function(e){return n=>{n=Bs.target(n);const t={},i={},a={},o=Bs.getClassProperties(n);for(const e in o){const o=Reflect.getMetadata(Ws,n,e);o&&(t[e]=o);const s=Reflect.getMetadata(Us,n,e);s&&(i[e]=s);const r=Reflect.getMetadata(Hs,n,e);r&&(a[e]=r)}s.merge(e,{input:t,autowire:i,output:a}),Reflect.defineMetadata(qs,e,n),n.define=e,Is.register(e.name,{define:e,target:n})}},exports.MemoryStorage=Gs,exports.NewRunHistory=function(e){const n=new Ps(e.id,e.trigger,e.pipeline);return n.context=e.context,n.logs=e.logs,n._loggers=e.loggers,n},exports.PLUGIN_CLASS_KEY=qs,exports.PLUGIN_DOWNLOAD_KEY=Js,exports.PLUGIN_INPUT_KEY=Ws,exports.PLUGIN_OUTPUT_KEY=Hs,exports.Registry=Ds,exports.RunHistory=Ps,exports.RunnableCollection=Ns,exports.StorageContext=Xs,exports.TaskDownload=function(e){return(n,t)=>{n=Bs.target(n,t),Reflect.defineMetadata(Js,e,n,t)}},exports.TaskInput=function(e){return(n,t)=>{n=Bs.target(n,t),Reflect.defineMetadata(Ws,e,n,t)}},exports.TaskOutput=function(e){return(n,t)=>{n=Bs.target(n,t),Reflect.defineMetadata(Hs,e,n,t)}},exports.accessRegistry=rm,exports.buildLogger=Rs,exports.logger=Cs,exports.pluginRegistry=Is,exports.utils=lm;
|
|
25
|
+
function(e){var n,t,i,a=Wr,o=l.extname,s=/^\s*([^;\s]*)(?:;|\s|$)/,r=/^text\//i;function c(e){if(!e||"string"!=typeof e)return!1;var n=s.exec(e),t=n&&a[n[1].toLowerCase()];return t&&t.charset?t.charset:!(!n||!r.test(n[1]))&&"UTF-8"}e.charset=c,e.charsets={lookup:c},e.contentType=function(n){if(!n||"string"!=typeof n)return!1;var t=-1===n.indexOf("/")?e.lookup(n):n;if(!t)return!1;if(-1===t.indexOf("charset")){var i=e.charset(t);i&&(t+="; charset="+i.toLowerCase())}return t},e.extension=function(n){if(!n||"string"!=typeof n)return!1;var t=s.exec(n),i=t&&e.extensions[t[1].toLowerCase()];if(!i||!i.length)return!1;return i[0]},e.extensions=Object.create(null),e.lookup=function(n){if(!n||"string"!=typeof n)return!1;var t=o("x."+n).toLowerCase().substr(1);if(!t)return!1;return e.types[t]||!1},e.types=Object.create(null),n=e.extensions,t=e.types,i=["nginx","apache",void 0,"iana"],Object.keys(a).forEach((function(e){var o=a[e],s=o.extensions;if(s&&s.length){n[e]=s;for(var r=0;r<s.length;r++){var c=s[r];if(t[c]){var p=i.indexOf(a[t[c]].source),l=i.indexOf(o.source);if("application/octet-stream"!==t[c]&&(p>l||p===l&&"application/"===t[c].substr(0,12)))continue}t[c]=e}}}))}(qr);var Jr=function(e){var n="function"==typeof setImmediate?setImmediate:"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:null;n?n(e):setTimeout(e,0)},Kr=function(e){var n=!1;return Jr((function(){n=!0})),function(t,i){n?e(t,i):Jr((function(){e(t,i)}))}};var Gr=function(e){Object.keys(e.jobs).forEach(Vr.bind(e)),e.jobs={}};function Vr(e){"function"==typeof this.jobs[e]&&this.jobs[e]()}var Yr=Kr,Xr=Gr,Qr=function(e,n,t,i){var a=t.keyedList?t.keyedList[t.index]:t.index;t.jobs[a]=function(e,n,t,i){var a;a=2==e.length?e(t,Yr(i)):e(t,n,Yr(i));return a}(n,a,e[a],(function(e,n){a in t.jobs&&(delete t.jobs[a],e?Xr(t):t.results[a]=n,i(e,t.results))}))};var Zr=function(e,n){var t=!Array.isArray(e),i={index:0,keyedList:t||n?Object.keys(e):null,jobs:{},results:t?{}:[],size:t?Object.keys(e).length:e.length};n&&i.keyedList.sort(t?n:function(t,i){return n(e[t],e[i])});return i};var ec=Gr,nc=Kr,tc=function(e){if(!Object.keys(this.jobs).length)return;this.index=this.size,ec(this),nc(e)(null,this.results)};var ic=Qr,ac=Zr,oc=tc,sc=function(e,n,t){var i=ac(e);for(;i.index<(i.keyedList||e).length;)ic(e,n,i,(function(e,n){e?t(e,n):0!==Object.keys(i.jobs).length||t(null,i.results)})),i.index++;return oc.bind(i,t)};var rc={},cc=Qr,pc=Zr,lc=tc;function uc(e,n){return e<n?-1:e>n?1:0}({get exports(){return rc},set exports(e){rc=e}}).exports=function(e,n,t,i){var a=pc(e,t);return cc(e,n,a,(function t(o,s){o?i(o,s):(a.index++,a.index<(a.keyedList||e).length?cc(e,n,a,t):i(null,a.results))})),lc.bind(a,i)},rc.ascending=uc,rc.descending=function(e,n){return-1*uc(e,n)};var dc=rc;var mc={parallel:sc,serial:function(e,n,t){return dc(e,n,null,t)},serialOrdered:rc},fc=Ur,hc=o,xc=l,vc=v,yc=y,gc=u.parse,bc=c,wc=m.Stream,Sc=qr,kc=mc,Ec=function(e,n){return Object.keys(n).forEach((function(t){e[t]=e[t]||n[t]})),e},jc=_c;function _c(e){if(!(this instanceof _c))return new _c(e);for(var n in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],fc.call(this),e=e||{})this[n]=e[n]}hc.inherits(_c,fc),_c.LINE_BREAK="\r\n",_c.DEFAULT_CONTENT_TYPE="application/octet-stream",_c.prototype.append=function(e,n,t){"string"==typeof(t=t||{})&&(t={filename:t});var i=fc.prototype.append.bind(this);if("number"==typeof n&&(n=""+n),hc.isArray(n))this._error(new Error("Arrays are not supported."));else{var a=this._multiPartHeader(e,n,t),o=this._multiPartFooter();i(a),i(n),i(o),this._trackLength(a,n,t)}},_c.prototype._trackLength=function(e,n,t){var i=0;null!=t.knownLength?i+=+t.knownLength:Buffer.isBuffer(n)?i=n.length:"string"==typeof n&&(i=Buffer.byteLength(n)),this._valueLength+=i,this._overheadLength+=Buffer.byteLength(e)+_c.LINE_BREAK.length,n&&(n.path||n.readable&&n.hasOwnProperty("httpVersion")||n instanceof wc)&&(t.knownLength||this._valuesToMeasure.push(n))},_c.prototype._lengthRetriever=function(e,n){e.hasOwnProperty("fd")?null!=e.end&&e.end!=1/0&&null!=e.start?n(null,e.end+1-(e.start?e.start:0)):bc.stat(e.path,(function(t,i){var a;t?n(t):(a=i.size-(e.start?e.start:0),n(null,a))})):e.hasOwnProperty("httpVersion")?n(null,+e.headers["content-length"]):e.hasOwnProperty("httpModule")?(e.on("response",(function(t){e.pause(),n(null,+t.headers["content-length"])})),e.resume()):n("Unknown stream")},_c.prototype._multiPartHeader=function(e,n,t){if("string"==typeof t.header)return t.header;var i,a=this._getContentDisposition(n,t),o=this._getContentType(n,t),s="",r={"Content-Disposition":["form-data",'name="'+e+'"'].concat(a||[]),"Content-Type":[].concat(o||[])};for(var c in"object"==typeof t.header&&Ec(r,t.header),r)r.hasOwnProperty(c)&&null!=(i=r[c])&&(Array.isArray(i)||(i=[i]),i.length&&(s+=c+": "+i.join("; ")+_c.LINE_BREAK));return"--"+this.getBoundary()+_c.LINE_BREAK+s+_c.LINE_BREAK},_c.prototype._getContentDisposition=function(e,n){var t,i;return"string"==typeof n.filepath?t=xc.normalize(n.filepath).replace(/\\/g,"/"):n.filename||e.name||e.path?t=xc.basename(n.filename||e.name||e.path):e.readable&&e.hasOwnProperty("httpVersion")&&(t=xc.basename(e.client._httpMessage.path||"")),t&&(i='filename="'+t+'"'),i},_c.prototype._getContentType=function(e,n){var t=n.contentType;return!t&&e.name&&(t=Sc.lookup(e.name)),!t&&e.path&&(t=Sc.lookup(e.path)),!t&&e.readable&&e.hasOwnProperty("httpVersion")&&(t=e.headers["content-type"]),t||!n.filepath&&!n.filename||(t=Sc.lookup(n.filepath||n.filename)),t||"object"!=typeof e||(t=_c.DEFAULT_CONTENT_TYPE),t},_c.prototype._multiPartFooter=function(){return function(e){var n=_c.LINE_BREAK;0===this._streams.length&&(n+=this._lastBoundary()),e(n)}.bind(this)},_c.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+_c.LINE_BREAK},_c.prototype.getHeaders=function(e){var n,t={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t},_c.prototype.setBoundary=function(e){this._boundary=e},_c.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},_c.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),n=this.getBoundary(),t=0,i=this._streams.length;t<i;t++)"function"!=typeof this._streams[t]&&(e=Buffer.isBuffer(this._streams[t])?Buffer.concat([e,this._streams[t]]):Buffer.concat([e,Buffer.from(this._streams[t])]),"string"==typeof this._streams[t]&&this._streams[t].substring(2,n.length+2)===n||(e=Buffer.concat([e,Buffer.from(_c.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},_c.prototype._generateBoundary=function(){for(var e="--------------------------",n=0;n<24;n++)e+=Math.floor(10*Math.random()).toString(16);this._boundary=e},_c.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},_c.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},_c.prototype.getLength=function(e){var n=this._overheadLength+this._valueLength;this._streams.length&&(n+=this._lastBoundary().length),this._valuesToMeasure.length?kc.parallel(this._valuesToMeasure,this._lengthRetriever,(function(t,i){t?e(t):(i.forEach((function(e){n+=e})),e(null,n))})):process.nextTick(e.bind(this,null,n))},_c.prototype.submit=function(e,n){var t,i,a={method:"post"};return"string"==typeof e?(e=gc(e),i=Ec({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},a)):(i=Ec(e,a)).port||(i.port="https:"==i.protocol?443:80),i.headers=this.getHeaders(e.headers),t="https:"==i.protocol?yc.request(i):vc.request(i),this.getLength(function(e,i){if(e&&"Unknown stream"!==e)this._error(e);else if(i&&t.setHeader("Content-Length",i),this.pipe(t),n){var a,o=function(e,i){return t.removeListener("error",o),t.removeListener("response",a),n.call(this,e,i)};a=o.bind(this,null),t.on("error",o),t.on("response",a)}}.bind(this)),t},_c.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},_c.prototype.toString=function(){return"[object FormData]"};var Oc=jc;function Tc(e){return Cr.isPlainObject(e)||Cr.isArray(e)}function Fc(e){return Cr.endsWith(e,"[]")?e.slice(0,-2):e}function Ac(e,n,t){return e?e.concat(n).map((function(e,n){return e=Fc(e),!t&&n?"["+e+"]":e})).join(t?".":""):n}const Cc=Cr.toFlatObject(Cr,{},null,(function(e){return/^is[A-Z]/.test(e)}));function Rc(e,n,t){if(!Cr.isObject(e))throw new TypeError("target must be an object");n=n||new(Oc||FormData);const i=(t=Cr.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,n){return!Cr.isUndefined(n[e])}))).metaTokens,a=t.visitor||p,o=t.dots,s=t.indexes,r=(t.Blob||"undefined"!=typeof Blob&&Blob)&&Cr.isSpecCompliantForm(n);if(!Cr.isFunction(a))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Cr.isDate(e))return e.toISOString();if(!r&&Cr.isBlob(e))throw new Rr("Blob is not supported. Use a Buffer instead.");return Cr.isArrayBuffer(e)||Cr.isTypedArray(e)?r&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function p(e,t,a){let r=e;if(e&&!a&&"object"==typeof e)if(Cr.endsWith(t,"{}"))t=i?t:t.slice(0,-2),e=JSON.stringify(e);else if(Cr.isArray(e)&&function(e){return Cr.isArray(e)&&!e.some(Tc)}(e)||(Cr.isFileList(e)||Cr.endsWith(t,"[]"))&&(r=Cr.toArray(e)))return t=Fc(t),r.forEach((function(e,i){!Cr.isUndefined(e)&&null!==e&&n.append(!0===s?Ac([t],i,o):null===s?t:t+"[]",c(e))})),!1;return!!Tc(e)||(n.append(Ac(a,t,o),c(e)),!1)}const l=[],u=Object.assign(Cc,{defaultVisitor:p,convertValue:c,isVisitable:Tc});if(!Cr.isObject(e))throw new TypeError("data must be an object");return function e(t,i){if(!Cr.isUndefined(t)){if(-1!==l.indexOf(t))throw Error("Circular reference detected in "+i.join("."));l.push(t),Cr.forEach(t,(function(t,o){!0===(!(Cr.isUndefined(t)||null===t)&&a.call(n,t,Cr.isString(o)?o.trim():o,i,u))&&e(t,i?i.concat(o):[o])})),l.pop()}}(e),n}function Pc(e){const n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return n[e]}))}function Nc(e,n){this._pairs=[],e&&Rc(e,this,n)}const Lc=Nc.prototype;function Dc(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ic(e,n,t){if(!n)return e;const i=t&&t.encode||Dc,a=t&&t.serialize;let o;if(o=a?a(n,t):Cr.isURLSearchParams(n)?n.toString():new Nc(n,t).toString(i),o){const n=e.indexOf("#");-1!==n&&(e=e.slice(0,n)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}Lc.append=function(e,n){this._pairs.push([e,n])},Lc.toString=function(e){const n=e?function(n){return e.call(this,n,Pc)}:Pc;return this._pairs.map((function(e){return n(e[0])+"="+n(e[1])}),"").join("&")};var zc=class{constructor(){this.handlers=[]}use(e,n,t){return this.handlers.push({fulfilled:e,rejected:n,synchronous:!!t&&t.synchronous,runWhen:t?t.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Cr.forEach(this.handlers,(function(n){null!==n&&e(n)}))}},Mc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Bc={isNode:!0,classes:{URLSearchParams:u.URLSearchParams,FormData:Oc,Blob:"undefined"!=typeof Blob&&Blob||null},protocols:["http","https","file","data"]};function Uc(e){function n(e,t,i,a){let o=e[a++];const s=Number.isFinite(+o),r=a>=e.length;if(o=!o&&Cr.isArray(i)?i.length:o,r)return Cr.hasOwnProp(i,o)?i[o]=[i[o],t]:i[o]=t,!s;i[o]&&Cr.isObject(i[o])||(i[o]=[]);return n(e,t,i[o],a)&&Cr.isArray(i[o])&&(i[o]=function(e){const n={},t=Object.keys(e);let i;const a=t.length;let o;for(i=0;i<a;i++)o=t[i],n[o]=e[o];return n}(i[o])),!s}if(Cr.isFormData(e)&&Cr.isFunction(e.entries)){const t={};return Cr.forEachEntry(e,((e,i)=>{n(function(e){return Cr.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),i,t,0)})),t}return null}const $c={"Content-Type":void 0};const qc={transitional:Mc,adapter:["xhr","http"],transformRequest:[function(e,n){const t=n.getContentType()||"",i=t.indexOf("application/json")>-1,a=Cr.isObject(e);a&&Cr.isHTMLForm(e)&&(e=new FormData(e));if(Cr.isFormData(e))return i&&i?JSON.stringify(Uc(e)):e;if(Cr.isArrayBuffer(e)||Cr.isBuffer(e)||Cr.isStream(e)||Cr.isFile(e)||Cr.isBlob(e))return e;if(Cr.isArrayBufferView(e))return e.buffer;if(Cr.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(a){if(t.indexOf("application/x-www-form-urlencoded")>-1)return function(e,n){return Rc(e,new Bc.classes.URLSearchParams,Object.assign({visitor:function(e,n,t,i){return Cr.isBuffer(e)?(this.append(n,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},n))}(e,this.formSerializer).toString();if((o=Cr.isFileList(e))||t.indexOf("multipart/form-data")>-1){const n=this.env&&this.env.FormData;return Rc(o?{"files[]":e}:e,n&&new n,this.formSerializer)}}return a||i?(n.setContentType("application/json",!1),function(e,n,t){if(Cr.isString(e))try{return(n||JSON.parse)(e),Cr.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(t||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const n=this.transitional||qc.transitional,t=n&&n.forcedJSONParsing,i="json"===this.responseType;if(e&&Cr.isString(e)&&(t&&!this.responseType||i)){const t=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(e){if(t){if("SyntaxError"===e.name)throw Rr.from(e,Rr.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Bc.classes.FormData,Blob:Bc.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Cr.forEach(["delete","get","head"],(function(e){qc.headers[e]={}})),Cr.forEach(["post","put","patch"],(function(e){qc.headers[e]=Cr.merge($c)}));var Wc=qc;const Hc=Cr.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Jc=Symbol("internals");function Kc(e){return e&&String(e).trim().toLowerCase()}function Gc(e){return!1===e||null==e?e:Cr.isArray(e)?e.map(Gc):String(e)}function Vc(e,n,t,i,a){return Cr.isFunction(i)?i.call(this,n,t):(a&&(n=t),Cr.isString(n)?Cr.isString(i)?-1!==n.indexOf(i):Cr.isRegExp(i)?i.test(n):void 0:void 0)}class Yc{constructor(e){e&&this.set(e)}set(e,n,t){const i=this;function a(e,n,t){const a=Kc(n);if(!a)throw new Error("header name must be a non-empty string");const o=Cr.findKey(i,a);(!o||void 0===i[o]||!0===t||void 0===t&&!1!==i[o])&&(i[o||n]=Gc(e))}const o=(e,n)=>Cr.forEach(e,((e,t)=>a(e,t,n)));return Cr.isPlainObject(e)||e instanceof this.constructor?o(e,n):Cr.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?o((e=>{const n={};let t,i,a;return e&&e.split("\n").forEach((function(e){a=e.indexOf(":"),t=e.substring(0,a).trim().toLowerCase(),i=e.substring(a+1).trim(),!t||n[t]&&Hc[t]||("set-cookie"===t?n[t]?n[t].push(i):n[t]=[i]:n[t]=n[t]?n[t]+", "+i:i)})),n})(e),n):null!=e&&a(n,e,t),this}get(e,n){if(e=Kc(e)){const t=Cr.findKey(this,e);if(t){const e=this[t];if(!n)return e;if(!0===n)return function(e){const n=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=t.exec(e);)n[i[1]]=i[2];return n}(e);if(Cr.isFunction(n))return n.call(this,e,t);if(Cr.isRegExp(n))return n.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Kc(e)){const t=Cr.findKey(this,e);return!(!t||void 0===this[t]||n&&!Vc(0,this[t],t,n))}return!1}delete(e,n){const t=this;let i=!1;function a(e){if(e=Kc(e)){const a=Cr.findKey(t,e);!a||n&&!Vc(0,t[a],a,n)||(delete t[a],i=!0)}}return Cr.isArray(e)?e.forEach(a):a(e),i}clear(e){const n=Object.keys(this);let t=n.length,i=!1;for(;t--;){const a=n[t];e&&!Vc(0,this[a],a,e,!0)||(delete this[a],i=!0)}return i}normalize(e){const n=this,t={};return Cr.forEach(this,((i,a)=>{const o=Cr.findKey(t,a);if(o)return n[o]=Gc(i),void delete n[a];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,n,t)=>n.toUpperCase()+t))}(a):String(a).trim();s!==a&&delete n[a],n[s]=Gc(i),t[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return Cr.forEach(this,((t,i)=>{null!=t&&!1!==t&&(n[i]=e&&Cr.isArray(t)?t.join(", "):t)})),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,n])=>e+": "+n)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const t=new this(e);return n.forEach((e=>t.set(e))),t}static accessor(e){const n=(this[Jc]=this[Jc]={accessors:{}}).accessors,t=this.prototype;function i(e){const i=Kc(e);n[i]||(!function(e,n){const t=Cr.toCamelCase(" "+n);["get","set","has"].forEach((i=>{Object.defineProperty(e,i+t,{value:function(e,t,a){return this[i].call(this,n,e,t,a)},configurable:!0})}))}(t,e),n[i]=!0)}return Cr.isArray(e)?e.forEach(i):i(e),this}}Yc.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Cr.freezeMethods(Yc.prototype),Cr.freezeMethods(Yc);var Xc=Yc;function Qc(e,n){const t=this||Wc,i=n||t,a=Xc.from(i.headers);let o=i.data;return Cr.forEach(e,(function(e){o=e.call(t,o,a.normalize(),n?n.status:void 0)})),a.normalize(),o}function Zc(e){return!(!e||!e.__CANCEL__)}function ep(e,n,t){Rr.call(this,null==e?"canceled":e,Rr.ERR_CANCELED,n,t),this.name="CanceledError"}function np(e,n,t){const i=t.config.validateStatus;t.status&&i&&!i(t.status)?n(new Rr("Request failed with status code "+t.status,[Rr.ERR_BAD_REQUEST,Rr.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t)):e(t)}function tp(e,n){return e&&!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(n)?function(e,n){return n?e.replace(/\/+$/,"")+"/"+n.replace(/^\/+/,""):e}(e,n):n}Cr.inherits(ep,Rr,{__CANCEL__:!0});var ip=u.parse,ap={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},op=String.prototype.endsWith||function(e){return e.length<=this.length&&-1!==this.indexOf(e,this.length-e.length)};function sp(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}var rp,cp=function(e){var n="string"==typeof e?ip(e):e||{},t=n.protocol,i=n.host,a=n.port;if("string"!=typeof i||!i||"string"!=typeof t)return"";if(t=t.split(":",1)[0],!function(e,n){var t=(sp("npm_config_no_proxy")||sp("no_proxy")).toLowerCase();if(!t)return!0;if("*"===t)return!1;return t.split(/[,\s]/).every((function(t){if(!t)return!0;var i=t.match(/^(.+):(\d+)$/),a=i?i[1]:t,o=i?parseInt(i[2]):0;return!(!o||o===n)||(/^[.*]/.test(a)?("*"===a.charAt(0)&&(a=a.slice(1)),!op.call(e,a)):e!==a)}))}(i=i.replace(/:\d*$/,""),a=parseInt(a)||ap[t]||0))return"";var o=sp("npm_config_"+t+"_proxy")||sp(t+"_proxy")||sp("npm_config_proxy")||sp("all_proxy");return o&&-1===o.indexOf("://")&&(o=t+"://"+o),o},pp={},lp={get exports(){return pp},set exports(e){pp=e}},up=u,dp=up.URL,mp=v,fp=y,hp=m.Writable,xp=f,vp=function(){if(!rp){try{rp=O("follow-redirects")}catch(e){}"function"!=typeof rp&&(rp=function(){})}rp.apply(null,arguments)},yp=["abort","aborted","connect","error","socket","timeout"],gp=Object.create(null);yp.forEach((function(e){gp[e]=function(n,t,i){this._redirectable.emit(e,n,t,i)}}));var bp=Ap("ERR_INVALID_URL","Invalid URL",TypeError),wp=Ap("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Sp=Ap("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),kp=Ap("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Ep=Ap("ERR_STREAM_WRITE_AFTER_END","write after end");function jp(e,n){hp.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],n&&this.on("response",n);var t=this;this._onNativeResponse=function(e){t._processResponse(e)},this._performRequest()}function _p(e){var n={maxRedirects:21,maxBodyLength:10485760},t={};return Object.keys(e).forEach((function(i){var a=i+":",o=t[a]=e[i],s=n[i]=Object.create(o);Object.defineProperties(s,{request:{value:function(e,i,o){if(Rp(e)){var s;try{s=Tp(new dp(e))}catch(n){s=up.parse(e)}if(!Rp(s.protocol))throw new bp({input:e});e=s}else dp&&e instanceof dp?e=Tp(e):(o=i,i=e,e={protocol:a});return Pp(i)&&(o=i,i=null),(i=Object.assign({maxRedirects:n.maxRedirects,maxBodyLength:n.maxBodyLength},e,i)).nativeProtocols=t,Rp(i.host)||Rp(i.hostname)||(i.hostname="::1"),xp.equal(i.protocol,a,"protocol mismatch"),vp("options",i),new jp(i,o)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(e,n,t){var i=s.request(e,n,t);return i.end(),i},configurable:!0,enumerable:!0,writable:!0}})})),n}function Op(){}function Tp(e){var n={protocol:e.protocol,hostname:e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,hash:e.hash,search:e.search,pathname:e.pathname,path:e.pathname+e.search,href:e.href};return""!==e.port&&(n.port=Number(e.port)),n}function Fp(e,n){var t;for(var i in n)e.test(i)&&(t=n[i],delete n[i]);return null==t?void 0:String(t).trim()}function Ap(e,n,t){function i(t){Error.captureStackTrace(this,this.constructor),Object.assign(this,t||{}),this.code=e,this.message=this.cause?n+": "+this.cause.message:n}return i.prototype=new(t||Error),i.prototype.constructor=i,i.prototype.name="Error ["+e+"]",i}function Cp(e){for(var n of yp)e.removeListener(n,gp[n]);e.on("error",Op),e.abort()}function Rp(e){return"string"==typeof e||e instanceof String}function Pp(e){return"function"==typeof e}jp.prototype=Object.create(hp.prototype),jp.prototype.abort=function(){Cp(this._currentRequest),this.emit("abort")},jp.prototype.write=function(e,n,t){if(this._ending)throw new Ep;if(!Rp(e)&&("object"!=typeof(i=e)||!("length"in i)))throw new TypeError("data should be a string, Buffer or Uint8Array");var i;Pp(n)&&(t=n,n=null),0!==e.length?this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:n}),this._currentRequest.write(e,n,t)):(this.emit("error",new kp),this.abort()):t&&t()},jp.prototype.end=function(e,n,t){if(Pp(e)?(t=e,e=n=null):Pp(n)&&(t=n,n=null),e){var i=this,a=this._currentRequest;this.write(e,n,(function(){i._ended=!0,a.end(null,null,t)})),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,t)},jp.prototype.setHeader=function(e,n){this._options.headers[e]=n,this._currentRequest.setHeader(e,n)},jp.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},jp.prototype.setTimeout=function(e,n){var t=this;function i(n){n.setTimeout(e),n.removeListener("timeout",n.destroy),n.addListener("timeout",n.destroy)}function a(n){t._timeout&&clearTimeout(t._timeout),t._timeout=setTimeout((function(){t.emit("timeout"),o()}),e),i(n)}function o(){t._timeout&&(clearTimeout(t._timeout),t._timeout=null),t.removeListener("abort",o),t.removeListener("error",o),t.removeListener("response",o),n&&t.removeListener("timeout",n),t.socket||t._currentRequest.removeListener("socket",a)}return n&&this.on("timeout",n),this.socket?a(this.socket):this._currentRequest.once("socket",a),this.on("socket",i),this.on("abort",o),this.on("error",o),this.on("response",o),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach((function(e){jp.prototype[e]=function(n,t){return this._currentRequest[e](n,t)}})),["aborted","connection","socket"].forEach((function(e){Object.defineProperty(jp.prototype,e,{get:function(){return this._currentRequest[e]}})})),jp.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var n=e.path.indexOf("?");n<0?e.pathname=e.path:(e.pathname=e.path.substring(0,n),e.search=e.path.substring(n))}},jp.prototype._performRequest=function(){var e=this._options.protocol,n=this._options.nativeProtocols[e];if(n){if(this._options.agents){var t=e.slice(0,-1);this._options.agent=this._options.agents[t]}var i=this._currentRequest=n.request(this._options,this._onNativeResponse);for(var a of(i._redirectable=this,yp))i.on(a,gp[a]);if(this._currentUrl=/^\//.test(this._options.path)?up.format(this._options):this._options.path,this._isRedirect){var o=0,s=this,r=this._requestBodyBuffers;!function e(n){if(i===s._currentRequest)if(n)s.emit("error",n);else if(o<r.length){var t=r[o++];i.finished||i.write(t.data,t.encoding,e)}else s._ended&&i.end()}()}}else this.emit("error",new TypeError("Unsupported protocol "+e))},jp.prototype._processResponse=function(e){var n=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:n});var t=e.headers.location;if(!t||!1===this._options.followRedirects||n<300||n>=400)return e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),void(this._requestBodyBuffers=[]);if(Cp(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)this.emit("error",new Sp);else{var i,a=this._options.beforeRedirect;a&&(i=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var o=this._options.method;((301===n||302===n)&&"POST"===this._options.method||303===n&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],Fp(/^content-/i,this._options.headers));var s,r=Fp(/^host$/i,this._options.headers),c=up.parse(this._currentUrl),p=r||c.host,l=/^\w+:/.test(t)?this._currentUrl:up.format(Object.assign(c,{host:p}));try{s=up.resolve(l,t)}catch(e){return void this.emit("error",new wp({cause:e}))}vp("redirecting to",s),this._isRedirect=!0;var u=up.parse(s);if(Object.assign(this._options,u),(u.protocol!==c.protocol&&"https:"!==u.protocol||u.host!==p&&!function(e,n){xp(Rp(e)&&Rp(n));var t=e.length-n.length-1;return t>0&&"."===e[t]&&e.endsWith(n)}(u.host,p))&&Fp(/^(?:authorization|cookie)$/i,this._options.headers),Pp(a)){var d={headers:e.headers,statusCode:n},m={url:l,method:o,headers:i};try{a(this._options,d,m)}catch(e){return void this.emit("error",e)}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(e){this.emit("error",new wp({cause:e}))}}},lp.exports=_p({http:mp,https:fp}),pp.wrap=_p;const Np="1.4.0";function Lp(e){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return n&&n[1]||""}const Dp=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function Ip(e,n){e=e||10;const t=new Array(e),i=new Array(e);let a,o=0,s=0;return n=void 0!==n?n:1e3,function(r){const c=Date.now(),p=i[s];a||(a=c),t[o]=r,i[o]=c;let l=s,u=0;for(;l!==o;)u+=t[l++],l%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-a<n)return;const d=p&&c-p;return d?Math.round(1e3*u/d):void 0}}const zp=Symbol("internals");class Mp extends m.Transform{constructor(e){super({readableHighWaterMark:(e=Cr.toFlatObject(e,{maxRate:0,chunkSize:65536,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,((e,n)=>!Cr.isUndefined(n[e])))).chunkSize});const n=this,t=this[zp]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null},i=Ip(t.ticksRate*e.samplesCount,t.timeWindow);this.on("newListener",(e=>{"progress"===e&&(t.isCaptured||(t.isCaptured=!0))}));let a=0;t.updateProgress=function(e,n){let t=0;const i=1e3/n;let a=null;return function(n,o){const s=Date.now();if(n||s-t>i)return a&&(clearTimeout(a),a=null),t=s,e.apply(null,o);a||(a=setTimeout((()=>(a=null,t=Date.now(),e.apply(null,o))),i-(s-t)))}}((function(){const e=t.length,o=t.bytesSeen,s=o-a;if(!s||n.destroyed)return;const r=i(s);a=o,process.nextTick((()=>{n.emit("progress",{loaded:o,total:e,progress:e?o/e:void 0,bytes:s,rate:r||void 0,estimated:r&&e&&o<=e?(e-o)/r:void 0})}))}),t.ticksRate);const o=()=>{t.updateProgress(!0)};this.once("end",o),this.once("error",o)}_read(e){const n=this[zp];return n.onReadCallback&&n.onReadCallback(),super._read(e)}_transform(e,n,t){const i=this,a=this[zp],o=a.maxRate,s=this.readableHighWaterMark,r=a.timeWindow,c=o/(1e3/r),p=!1!==a.minChunkSize?Math.max(a.minChunkSize,.01*c):0;const l=(e,n)=>{const t=Buffer.byteLength(e);let l,u=null,d=s,m=0;if(o){const e=Date.now();(!a.ts||(m=e-a.ts)>=r)&&(a.ts=e,l=c-a.bytes,a.bytes=l<0?-l:0,m=0),l=c-a.bytes}if(o){if(l<=0)return setTimeout((()=>{n(null,e)}),r-m);l<d&&(d=l)}d&&t>d&&t-d>p&&(u=e.subarray(d),e=e.subarray(0,d)),function(e,n){const t=Buffer.byteLength(e);a.bytesSeen+=t,a.bytes+=t,a.isCaptured&&a.updateProgress(),i.push(e)?process.nextTick(n):a.onReadCallback=()=>{a.onReadCallback=null,process.nextTick(n)}}(e,u?()=>{process.nextTick(n,null,u)}:n)};l(e,(function e(n,i){if(n)return t(n);i?l(i,e):t(null)}))}setLength(e){return this[zp].length=+e,this}}var Bp=Mp;const{asyncIterator:Up}=Symbol;var $p=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[Up]?yield*e[Up]():yield e};const qp=Cr.ALPHABET.ALPHA_DIGIT+"-_",Wp=new o.TextEncoder,Hp="\r\n",Jp=Wp.encode(Hp);class Kp{constructor(e,n){const{escapeName:t}=this.constructor,i=Cr.isString(n);let a=`Content-Disposition: form-data; name="${t(e)}"${!i&&n.name?`; filename="${t(n.name)}"`:""}${Hp}`;i?n=Wp.encode(String(n).replace(/\r?\n|\r\n?/g,Hp)):a+=`Content-Type: ${n.type||"application/octet-stream"}${Hp}`,this.headers=Wp.encode(a+Hp),this.contentLength=i?n.byteLength:n.size,this.size=this.headers.byteLength+this.contentLength+2,this.name=e,this.value=n}async*encode(){yield this.headers;const{value:e}=this;Cr.isTypedArray(e)?yield e:yield*$p(e),yield Jp}static escapeName(e){return String(e).replace(/[\r\n"]/g,(e=>({"\r":"%0D","\n":"%0A",'"':"%22"}[e])))}}var Gp=(e,n,t)=>{const{tag:i="form-data-boundary",size:a=25,boundary:o=i+"-"+Cr.generateString(a,qp)}=t||{};if(!Cr.isFormData(e))throw TypeError("FormData instance required");if(o.length<1||o.length>70)throw Error("boundary must be 10-70 characters long");const s=Wp.encode("--"+o+Hp),r=Wp.encode("--"+o+"--"+Hp+Hp);let c=r.byteLength;const p=Array.from(e.entries()).map((([e,n])=>{const t=new Kp(e,n);return c+=t.size,t}));c+=s.byteLength*p.length,c=Cr.toFiniteNumber(c);const l={"Content-Type":`multipart/form-data; boundary=${o}`};return Number.isFinite(c)&&(l["Content-Length"]=c),n&&n(l),m.Readable.from(async function*(){for(const e of p)yield s,yield*e.encode();yield r}())};class Vp extends m.Transform{__transform(e,n,t){this.push(e),t()}_transform(e,n,t){if(0!==e.length&&(this._transform=this.__transform,120!==e[0])){const e=Buffer.alloc(2);e[0]=120,e[1]=156,this.push(e,n)}this.__transform(e,n,t)}}var Yp=Vp;var Xp=(e,n)=>Cr.isAsyncFn(e)?function(...t){const i=t.pop();e.apply(this,t).then((e=>{try{n?i(null,...n(e)):i(null,e)}catch(e){i(e)}}),i)}:e;const Qp={flush:h.constants.Z_SYNC_FLUSH,finishFlush:h.constants.Z_SYNC_FLUSH},Zp={flush:h.constants.BROTLI_OPERATION_FLUSH,finishFlush:h.constants.BROTLI_OPERATION_FLUSH},el=Cr.isFunction(h.createBrotliDecompress),{http:nl,https:tl}=pp,il=/https:?/,al=Bc.protocols.map((e=>e+":"));function ol(e){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e)}function sl(e,n,t){let i=n;if(!i&&!1!==i){const e=cp(t);e&&(i=new URL(e))}if(i){if(i.username&&(i.auth=(i.username||"")+":"+(i.password||"")),i.auth){(i.auth.username||i.auth.password)&&(i.auth=(i.auth.username||"")+":"+(i.auth.password||""));const n=Buffer.from(i.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+n}e.headers.host=e.hostname+(e.port?":"+e.port:"");const n=i.hostname||i.host;e.hostname=n,e.host=n,e.port=i.port,e.path=t,i.protocol&&(e.protocol=i.protocol.includes(":")?i.protocol:`${i.protocol}:`)}e.beforeRedirects.proxy=function(e){sl(e,n,e.href)}}const rl="undefined"!=typeof process&&"process"===Cr.kindOf(process);var cl=rl&&function(e){return n=async function(n,t,i){let{data:a,lookup:s,family:r}=e;const{responseType:c,responseEncoding:p}=e,l=e.method.toUpperCase();let u,d,f=!1;s&&Cr.isAsyncFn(s)&&(s=Xp(s,(e=>{if(Cr.isString(e))e=[e,e.indexOf(".")<0?6:4];else if(!Cr.isArray(e))throw new TypeError("lookup async function must return an array [ip: string, family: number]]");return e})));const x=new g,b=()=>{e.cancelToken&&e.cancelToken.unsubscribe(w),e.signal&&e.signal.removeEventListener("abort",w),x.removeAllListeners()};function w(n){x.emit("abort",!n||n.type?new ep(null,e,d):n)}i(((e,n)=>{u=!0,n&&(f=!0,b())})),x.once("abort",t),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(w),e.signal&&(e.signal.aborted?w():e.signal.addEventListener("abort",w)));const S=tp(e.baseURL,e.url),k=new URL(S,"http://localhost"),E=k.protocol||al[0];if("data:"===E){let i;if("GET"!==l)return np(n,t,{status:405,statusText:"method not allowed",headers:{},config:e});try{i=function(e,n,t){const i=t&&t.Blob||Bc.classes.Blob,a=Lp(e);if(void 0===n&&i&&(n=!0),"data"===a){e=a.length?e.slice(a.length+1):e;const t=Dp.exec(e);if(!t)throw new Rr("Invalid URL",Rr.ERR_INVALID_URL);const o=t[1],s=t[2],r=t[3],c=Buffer.from(decodeURIComponent(r),s?"base64":"utf8");if(n){if(!i)throw new Rr("Blob is not supported",Rr.ERR_NOT_SUPPORT);return new i([c],{type:o})}return c}throw new Rr("Unsupported protocol "+a,Rr.ERR_NOT_SUPPORT)}(e.url,"blob"===c,{Blob:e.env&&e.env.Blob})}catch(n){throw Rr.from(n,Rr.ERR_BAD_REQUEST,e)}return"text"===c?(i=i.toString(p),p&&"utf8"!==p||(i=Cr.stripBOM(i))):"stream"===c&&(i=m.Readable.from(i)),np(n,t,{data:i,status:200,statusText:"OK",headers:new Xc,config:e})}if(-1===al.indexOf(E))return t(new Rr("Unsupported protocol "+E,Rr.ERR_BAD_REQUEST,e));const j=Xc.from(e.headers).normalize();j.set("User-Agent","axios/"+Np,!1);const _=e.onDownloadProgress,O=e.onUploadProgress,T=e.maxRate;let F,A;if(Cr.isSpecCompliantForm(a)){const e=j.getContentType(/boundary=([-_\w\d]{10,70})/i);a=Gp(a,(e=>{j.set(e)}),{tag:`axios-${Np}-boundary`,boundary:e&&e[1]||void 0})}else if(Cr.isFormData(a)&&Cr.isFunction(a.getHeaders)){if(j.set(a.getHeaders()),!j.hasContentLength())try{const e=await o.promisify(a.getLength).call(a);Number.isFinite(e)&&e>=0&&j.setContentLength(e)}catch(e){}}else if(Cr.isBlob(a))a.size&&j.setContentType(a.type||"application/octet-stream"),j.setContentLength(a.size||0),a=m.Readable.from($p(a));else if(a&&!Cr.isStream(a)){if(Buffer.isBuffer(a));else if(Cr.isArrayBuffer(a))a=Buffer.from(new Uint8Array(a));else{if(!Cr.isString(a))return t(new Rr("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",Rr.ERR_BAD_REQUEST,e));a=Buffer.from(a,"utf-8")}if(j.setContentLength(a.length,!1),e.maxBodyLength>-1&&a.length>e.maxBodyLength)return t(new Rr("Request body larger than maxBodyLength limit",Rr.ERR_BAD_REQUEST,e))}const C=Cr.toFiniteNumber(j.getContentLength());let R,P;Cr.isArray(T)?(F=T[0],A=T[1]):F=A=T,a&&(O||F)&&(Cr.isStream(a)||(a=m.Readable.from(a,{objectMode:!1})),a=m.pipeline([a,new Bp({length:C,maxRate:Cr.toFiniteNumber(F)})],Cr.noop),O&&a.on("progress",(e=>{O(Object.assign(e,{upload:!0}))}))),e.auth&&(R=(e.auth.username||"")+":"+(e.auth.password||"")),!R&&k.username&&(R=k.username+":"+k.password),R&&j.delete("authorization");try{P=Ic(k.pathname+k.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(n){const i=new Error(n.message);return i.config=e,i.url=e.url,i.exists=!0,t(i)}j.set("Accept-Encoding","gzip, compress, deflate"+(el?", br":""),!1);const N={path:P,method:l,headers:j.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:R,protocol:E,family:r,lookup:s,beforeRedirect:ol,beforeRedirects:{}};let L;e.socketPath?N.socketPath=e.socketPath:(N.hostname=k.hostname,N.port=k.port,sl(N,e.proxy,E+"//"+k.hostname+(k.port?":"+k.port:"")+N.path));const D=il.test(N.protocol);if(N.agent=D?e.httpsAgent:e.httpAgent,e.transport?L=e.transport:0===e.maxRedirects?L=D?y:v:(e.maxRedirects&&(N.maxRedirects=e.maxRedirects),e.beforeRedirect&&(N.beforeRedirects.config=e.beforeRedirect),L=D?tl:nl),e.maxBodyLength>-1?N.maxBodyLength=e.maxBodyLength:N.maxBodyLength=1/0,e.insecureHTTPParser&&(N.insecureHTTPParser=e.insecureHTTPParser),d=L.request(N,(function(i){if(d.destroyed)return;const a=[i],o=+i.headers["content-length"];if(_){const e=new Bp({length:Cr.toFiniteNumber(o),maxRate:Cr.toFiniteNumber(A)});_&&e.on("progress",(e=>{_(Object.assign(e,{download:!0}))})),a.push(e)}let s=i;const r=i.req||d;if(!1!==e.decompress&&i.headers["content-encoding"])switch("HEAD"!==l&&204!==i.statusCode||delete i.headers["content-encoding"],i.headers["content-encoding"]){case"gzip":case"x-gzip":case"compress":case"x-compress":a.push(h.createUnzip(Qp)),delete i.headers["content-encoding"];break;case"deflate":a.push(new Yp),a.push(h.createUnzip(Qp)),delete i.headers["content-encoding"];break;case"br":el&&(a.push(h.createBrotliDecompress(Zp)),delete i.headers["content-encoding"])}s=a.length>1?m.pipeline(a,Cr.noop):a[0];const u=m.finished(s,(()=>{u(),b()})),v={status:i.statusCode,statusText:i.statusMessage,headers:new Xc(i.headers),config:e,request:r};if("stream"===c)v.data=s,np(n,t,v);else{const i=[];let a=0;s.on("data",(function(n){i.push(n),a+=n.length,e.maxContentLength>-1&&a>e.maxContentLength&&(f=!0,s.destroy(),t(new Rr("maxContentLength size of "+e.maxContentLength+" exceeded",Rr.ERR_BAD_RESPONSE,e,r)))})),s.on("aborted",(function(){if(f)return;const n=new Rr("maxContentLength size of "+e.maxContentLength+" exceeded",Rr.ERR_BAD_RESPONSE,e,r);s.destroy(n),t(n)})),s.on("error",(function(n){d.destroyed||t(Rr.from(n,null,e,r))})),s.on("end",(function(){try{let e=1===i.length?i[0]:Buffer.concat(i);"arraybuffer"!==c&&(e=e.toString(p),p&&"utf8"!==p||(e=Cr.stripBOM(e))),v.data=e}catch(n){t(Rr.from(n,null,e,v.request,v))}np(n,t,v)}))}x.once("abort",(e=>{s.destroyed||(s.emit("error",e),s.destroy())}))})),x.once("abort",(e=>{t(e),d.destroy(e)})),d.on("error",(function(n){t(Rr.from(n,null,e,d))})),d.on("socket",(function(e){e.setKeepAlive(!0,6e4)})),e.timeout){const n=parseInt(e.timeout,10);if(isNaN(n))return void t(new Rr("error trying to parse `config.timeout` to int",Rr.ERR_BAD_OPTION_VALUE,e,d));d.setTimeout(n,(function(){if(u)return;let n=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const i=e.transitional||Mc;e.timeoutErrorMessage&&(n=e.timeoutErrorMessage),t(new Rr(n,i.clarifyTimeoutError?Rr.ETIMEDOUT:Rr.ECONNABORTED,e,d)),w()}))}if(Cr.isStream(a)){let n=!1,t=!1;a.on("end",(()=>{n=!0})),a.once("error",(e=>{t=!0,d.destroy(e)})),a.on("close",(()=>{n||t||w(new ep("Request stream has been aborted",e,d))})),a.pipe(d)}else d.end(a)},new Promise(((e,t)=>{let i,a;const o=(e,n)=>{a||(a=!0,i&&i(e,n))},s=e=>{o(e,!0),t(e)};n((n=>{o(n),e(n)}),s,(e=>i=e)).catch(s)}));var n},pl=Bc.isStandardBrowserEnv?{write:function(e,n,t,i,a,o){const s=[];s.push(e+"="+encodeURIComponent(n)),Cr.isNumber(t)&&s.push("expires="+new Date(t).toGMTString()),Cr.isString(i)&&s.push("path="+i),Cr.isString(a)&&s.push("domain="+a),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){const n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},ll=Bc.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let t;function i(t){let i=t;return e&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=i(window.location.href),function(e){const n=Cr.isString(e)?i(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0};function ul(e,n){let t=0;const i=Ip(50,250);return a=>{const o=a.loaded,s=a.lengthComputable?a.total:void 0,r=o-t,c=i(r);t=o;const p={loaded:o,total:s,progress:s?o/s:void 0,bytes:r,rate:c||void 0,estimated:c&&s&&o<=s?(s-o)/c:void 0,event:a};p[n?"download":"upload"]=!0,e(p)}}var dl="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(n,t){let i=e.data;const a=Xc.from(e.headers).normalize(),o=e.responseType;let s;function r(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}Cr.isFormData(i)&&(Bc.isStandardBrowserEnv||Bc.isStandardBrowserWebWorkerEnv?a.setContentType(!1):a.setContentType("multipart/form-data;",!1));let c=new XMLHttpRequest;if(e.auth){const n=e.auth.username||"",t=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.set("Authorization","Basic "+btoa(n+":"+t))}const p=tp(e.baseURL,e.url);function l(){if(!c)return;const i=Xc.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());np((function(e){n(e),r()}),(function(e){t(e),r()}),{data:o&&"text"!==o&&"json"!==o?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:i,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),Ic(p,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=l:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(l)},c.onabort=function(){c&&(t(new Rr("Request aborted",Rr.ECONNABORTED,e,c)),c=null)},c.onerror=function(){t(new Rr("Network Error",Rr.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let n=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const i=e.transitional||Mc;e.timeoutErrorMessage&&(n=e.timeoutErrorMessage),t(new Rr(n,i.clarifyTimeoutError?Rr.ETIMEDOUT:Rr.ECONNABORTED,e,c)),c=null},Bc.isStandardBrowserEnv){const n=(e.withCredentials||ll(p))&&e.xsrfCookieName&&pl.read(e.xsrfCookieName);n&&a.set(e.xsrfHeaderName,n)}void 0===i&&a.setContentType(null),"setRequestHeader"in c&&Cr.forEach(a.toJSON(),(function(e,n){c.setRequestHeader(n,e)})),Cr.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),o&&"json"!==o&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",ul(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",ul(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=n=>{c&&(t(!n||n.type?new ep(null,e,c):n),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const u=Lp(p);u&&-1===Bc.protocols.indexOf(u)?t(new Rr("Unsupported protocol "+u+":",Rr.ERR_BAD_REQUEST,e)):c.send(i||null)}))};const ml={http:cl,xhr:dl};Cr.forEach(ml,((e,n)=>{if(e){try{Object.defineProperty(e,"name",{value:n})}catch(e){}Object.defineProperty(e,"adapterName",{value:n})}}));var fl=e=>{e=Cr.isArray(e)?e:[e];const{length:n}=e;let t,i;for(let a=0;a<n&&(t=e[a],!(i=Cr.isString(t)?ml[t.toLowerCase()]:t));a++);if(!i){if(!1===i)throw new Rr(`Adapter ${t} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(Cr.hasOwnProp(ml,t)?`Adapter '${t}' is not available in the build`:`Unknown adapter '${t}'`)}if(!Cr.isFunction(i))throw new TypeError("adapter is not a function");return i};function hl(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ep(null,e)}function xl(e){hl(e),e.headers=Xc.from(e.headers),e.data=Qc.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return fl(e.adapter||Wc.adapter)(e).then((function(n){return hl(e),n.data=Qc.call(e,e.transformResponse,n),n.headers=Xc.from(n.headers),n}),(function(n){return Zc(n)||(hl(e),n&&n.response&&(n.response.data=Qc.call(e,e.transformResponse,n.response),n.response.headers=Xc.from(n.response.headers))),Promise.reject(n)}))}const vl=e=>e instanceof Xc?e.toJSON():e;function yl(e,n){n=n||{};const t={};function i(e,n,t){return Cr.isPlainObject(e)&&Cr.isPlainObject(n)?Cr.merge.call({caseless:t},e,n):Cr.isPlainObject(n)?Cr.merge({},n):Cr.isArray(n)?n.slice():n}function a(e,n,t){return Cr.isUndefined(n)?Cr.isUndefined(e)?void 0:i(void 0,e,t):i(e,n,t)}function o(e,n){if(!Cr.isUndefined(n))return i(void 0,n)}function s(e,n){return Cr.isUndefined(n)?Cr.isUndefined(e)?void 0:i(void 0,e):i(void 0,n)}function r(t,a,o){return o in n?i(t,a):o in e?i(void 0,t):void 0}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:r,headers:(e,n)=>a(vl(e),vl(n),!0)};return Cr.forEach(Object.keys(Object.assign({},e,n)),(function(i){const o=c[i]||a,s=o(e[i],n[i],i);Cr.isUndefined(s)&&o!==r||(t[i]=s)})),t}const gl={};["object","boolean","number","function","string","symbol"].forEach(((e,n)=>{gl[e]=function(t){return typeof t===e||"a"+(n<1?"n ":" ")+e}}));const bl={};gl.transitional=function(e,n,t){function i(e,n){return"[Axios v1.4.0] Transitional option '"+e+"'"+n+(t?". "+t:"")}return(t,a,o)=>{if(!1===e)throw new Rr(i(a," has been removed"+(n?" in "+n:"")),Rr.ERR_DEPRECATED);return n&&!bl[a]&&(bl[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),!e||e(t,a,o)}};var wl={assertOptions:function(e,n,t){if("object"!=typeof e)throw new Rr("options must be an object",Rr.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let a=i.length;for(;a-- >0;){const o=i[a],s=n[o];if(s){const n=e[o],t=void 0===n||s(n,o,e);if(!0!==t)throw new Rr("option "+o+" must be "+t,Rr.ERR_BAD_OPTION_VALUE)}else if(!0!==t)throw new Rr("Unknown option "+o,Rr.ERR_BAD_OPTION)}},validators:gl};const Sl=wl.validators;class kl{constructor(e){this.defaults=e,this.interceptors={request:new zc,response:new zc}}request(e,n){"string"==typeof e?(n=n||{}).url=e:n=e||{},n=yl(this.defaults,n);const{transitional:t,paramsSerializer:i,headers:a}=n;let o;void 0!==t&&wl.assertOptions(t,{silentJSONParsing:Sl.transitional(Sl.boolean),forcedJSONParsing:Sl.transitional(Sl.boolean),clarifyTimeoutError:Sl.transitional(Sl.boolean)},!1),null!=i&&(Cr.isFunction(i)?n.paramsSerializer={serialize:i}:wl.assertOptions(i,{encode:Sl.function,serialize:Sl.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase(),o=a&&Cr.merge(a.common,a[n.method]),o&&Cr.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete a[e]})),n.headers=Xc.concat(o,a);const s=[];let r=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(n)||(r=r&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const c=[];let p;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,u=0;if(!r){const e=[xl.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,c),l=e.length,p=Promise.resolve(n);u<l;)p=p.then(e[u++],e[u++]);return p}l=s.length;let d=n;for(u=0;u<l;){const e=s[u++],n=s[u++];try{d=e(d)}catch(e){n.call(this,e);break}}try{p=xl.call(this,d)}catch(e){return Promise.reject(e)}for(u=0,l=c.length;u<l;)p=p.then(c[u++],c[u++]);return p}getUri(e){return Ic(tp((e=yl(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}Cr.forEach(["delete","get","head","options"],(function(e){kl.prototype[e]=function(n,t){return this.request(yl(t||{},{method:e,url:n,data:(t||{}).data}))}})),Cr.forEach(["post","put","patch"],(function(e){function n(n){return function(t,i,a){return this.request(yl(a||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:t,data:i}))}}kl.prototype[e]=n(),kl.prototype[e+"Form"]=n(!0)}));var El=kl;class jl{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let n;this.promise=new Promise((function(e){n=e}));const t=this;this.promise.then((e=>{if(!t._listeners)return;let n=t._listeners.length;for(;n-- >0;)t._listeners[n](e);t._listeners=null})),this.promise.then=e=>{let n;const i=new Promise((e=>{t.subscribe(e),n=e})).then(e);return i.cancel=function(){t.unsubscribe(n)},i},e((function(e,i,a){t.reason||(t.reason=new ep(e,i,a),n(t.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);-1!==n&&this._listeners.splice(n,1)}static source(){let e;return{token:new jl((function(n){e=n})),cancel:e}}}var _l=jl;const Ol={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ol).forEach((([e,n])=>{Ol[n]=e}));var Tl=Ol;const Fl=function e(n){const t=new El(n),i=Qs(El.prototype.request,t);return Cr.extend(i,El.prototype,t,{allOwnKeys:!0}),Cr.extend(i,t,null,{allOwnKeys:!0}),i.create=function(t){return e(yl(n,t))},i}(Wc);Fl.Axios=El,Fl.CanceledError=ep,Fl.CancelToken=_l,Fl.isCancel=Zc,Fl.VERSION=Np,Fl.toFormData=Rc,Fl.AxiosError=Rr,Fl.Cancel=Fl.CanceledError,Fl.all=function(e){return Promise.all(e)},Fl.spread=function(e){return function(n){return e.apply(null,n)}},Fl.isAxiosError=function(e){return Cr.isObject(e)&&!0===e.isAxiosError},Fl.mergeConfig=yl,Fl.AxiosHeaders=Xc,Fl.formToJSON=e=>Uc(Cr.isHTMLForm(e)?new FormData(e):e),Fl.HttpStatusCode=Tl,Fl.default=Fl;var Al,Cl=Fl,Rl="undefined"!=typeof Symbol&&Symbol,Pl=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},n=Symbol("test"),t=Object(n);if("string"==typeof n)return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;for(n in e[n]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==n)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(e,n);if(42!==a.value||!0!==a.enumerable)return!1}return!0},Nl=Array.prototype.slice,Ll=Object.prototype.toString,Dl=function(e){var n=this;if("function"!=typeof n||"[object Function]"!==Ll.call(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var t,i=Nl.call(arguments,1),a=Math.max(0,n.length-i.length),o=[],s=0;s<a;s++)o.push("$"+s);if(t=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof t){var a=n.apply(this,i.concat(Nl.call(arguments)));return Object(a)===a?a:this}return n.apply(e,i.concat(Nl.call(arguments)))})),n.prototype){var r=function(){};r.prototype=n.prototype,t.prototype=new r,r.prototype=null}return t},Il=Function.prototype.bind||Dl,zl=Il.call(Function.call,Object.prototype.hasOwnProperty),Ml=SyntaxError,Bl=Function,Ul=TypeError,$l=function(e){try{return Bl('"use strict"; return ('+e+").constructor;")()}catch(e){}},ql=Object.getOwnPropertyDescriptor;if(ql)try{ql({},"")}catch(e){ql=null}var Wl=function(){throw new Ul},Hl=ql?function(){try{return Wl}catch(e){try{return ql(arguments,"callee").get}catch(e){return Wl}}}():Wl,Jl="function"==typeof Rl&&"function"==typeof Symbol&&"symbol"==typeof Rl("foo")&&"symbol"==typeof Symbol("bar")&&Pl(),Kl=Object.getPrototypeOf||function(e){return e.__proto__},Gl={},Vl="undefined"==typeof Uint8Array?Al:Kl(Uint8Array),Yl={"%AggregateError%":"undefined"==typeof AggregateError?Al:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?Al:ArrayBuffer,"%ArrayIteratorPrototype%":Jl?Kl([][Symbol.iterator]()):Al,"%AsyncFromSyncIteratorPrototype%":Al,"%AsyncFunction%":Gl,"%AsyncGenerator%":Gl,"%AsyncGeneratorFunction%":Gl,"%AsyncIteratorPrototype%":Gl,"%Atomics%":"undefined"==typeof Atomics?Al:Atomics,"%BigInt%":"undefined"==typeof BigInt?Al:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?Al:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?Al:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?Al:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?Al:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?Al:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?Al:FinalizationRegistry,"%Function%":Bl,"%GeneratorFunction%":Gl,"%Int8Array%":"undefined"==typeof Int8Array?Al:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?Al:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?Al:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Jl?Kl(Kl([][Symbol.iterator]())):Al,"%JSON%":"object"==typeof JSON?JSON:Al,"%Map%":"undefined"==typeof Map?Al:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&Jl?Kl((new Map)[Symbol.iterator]()):Al,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?Al:Promise,"%Proxy%":"undefined"==typeof Proxy?Al:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?Al:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?Al:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&Jl?Kl((new Set)[Symbol.iterator]()):Al,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?Al:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Jl?Kl(""[Symbol.iterator]()):Al,"%Symbol%":Jl?Symbol:Al,"%SyntaxError%":Ml,"%ThrowTypeError%":Hl,"%TypedArray%":Vl,"%TypeError%":Ul,"%Uint8Array%":"undefined"==typeof Uint8Array?Al:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?Al:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?Al:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?Al:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?Al:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?Al:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?Al:WeakSet};try{null.error}catch(e){var Xl=Kl(Kl(e));Yl["%Error.prototype%"]=Xl}var Ql=function e(n){var t;if("%AsyncFunction%"===n)t=$l("async function () {}");else if("%GeneratorFunction%"===n)t=$l("function* () {}");else if("%AsyncGeneratorFunction%"===n)t=$l("async function* () {}");else if("%AsyncGenerator%"===n){var i=e("%AsyncGeneratorFunction%");i&&(t=i.prototype)}else if("%AsyncIteratorPrototype%"===n){var a=e("%AsyncGenerator%");a&&(t=Kl(a.prototype))}return Yl[n]=t,t},Zl={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},eu=Il,nu=zl,tu=eu.call(Function.call,Array.prototype.concat),iu=eu.call(Function.apply,Array.prototype.splice),au=eu.call(Function.call,String.prototype.replace),ou=eu.call(Function.call,String.prototype.slice),su=eu.call(Function.call,RegExp.prototype.exec),ru=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,cu=/\\(\\)?/g,pu=function(e,n){var t,i=e;if(nu(Zl,i)&&(i="%"+(t=Zl[i])[0]+"%"),nu(Yl,i)){var a=Yl[i];if(a===Gl&&(a=Ql(i)),void 0===a&&!n)throw new Ul("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:t,name:i,value:a}}throw new Ml("intrinsic "+e+" does not exist!")},lu=function(e,n){if("string"!=typeof e||0===e.length)throw new Ul("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof n)throw new Ul('"allowMissing" argument must be a boolean');if(null===su(/^%?[^%]*%?$/,e))throw new Ml("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var t=function(e){var n=ou(e,0,1),t=ou(e,-1);if("%"===n&&"%"!==t)throw new Ml("invalid intrinsic syntax, expected closing `%`");if("%"===t&&"%"!==n)throw new Ml("invalid intrinsic syntax, expected opening `%`");var i=[];return au(e,ru,(function(e,n,t,a){i[i.length]=t?au(a,cu,"$1"):n||e})),i}(e),i=t.length>0?t[0]:"",a=pu("%"+i+"%",n),o=a.name,s=a.value,r=!1,c=a.alias;c&&(i=c[0],iu(t,tu([0,1],c)));for(var p=1,l=!0;p<t.length;p+=1){var u=t[p],d=ou(u,0,1),m=ou(u,-1);if(('"'===d||"'"===d||"`"===d||'"'===m||"'"===m||"`"===m)&&d!==m)throw new Ml("property names with quotes must have matching quotes");if("constructor"!==u&&l||(r=!0),nu(Yl,o="%"+(i+="."+u)+"%"))s=Yl[o];else if(null!=s){if(!(u in s)){if(!n)throw new Ul("base intrinsic for "+e+" exists, but the property is not available.");return}if(ql&&p+1>=t.length){var f=ql(s,u);s=(l=!!f)&&"get"in f&&!("originalValue"in f.get)?f.get:s[u]}else l=nu(s,u),s=s[u];l&&!r&&(Yl[o]=s)}}return s},uu={};!function(e){var n=Il,t=lu,i=t("%Function.prototype.apply%"),a=t("%Function.prototype.call%"),o=t("%Reflect.apply%",!0)||n.call(a,i),s=t("%Object.getOwnPropertyDescriptor%",!0),r=t("%Object.defineProperty%",!0),c=t("%Math.max%");if(r)try{r({},"a",{value:1})}catch(e){r=null}e.exports=function(e){var t=o(n,a,arguments);s&&r&&(s(t,"length").configurable&&r(t,"length",{value:1+c(0,e.length-(arguments.length-1))}));return t};var p=function(){return o(n,i,arguments)};r?r(e.exports,"apply",{value:p}):e.exports.apply=p}({get exports(){return uu},set exports(e){uu=e}});var du=lu,mu=uu,fu=mu(du("String.prototype.indexOf")),hu=o.inspect,xu="function"==typeof Map&&Map.prototype,vu=Object.getOwnPropertyDescriptor&&xu?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,yu=xu&&vu&&"function"==typeof vu.get?vu.get:null,gu=xu&&Map.prototype.forEach,bu="function"==typeof Set&&Set.prototype,wu=Object.getOwnPropertyDescriptor&&bu?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Su=bu&&wu&&"function"==typeof wu.get?wu.get:null,ku=bu&&Set.prototype.forEach,Eu="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,ju="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,_u="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,Ou=Boolean.prototype.valueOf,Tu=Object.prototype.toString,Fu=Function.prototype.toString,Au=String.prototype.match,Cu=String.prototype.slice,Ru=String.prototype.replace,Pu=String.prototype.toUpperCase,Nu=String.prototype.toLowerCase,Lu=RegExp.prototype.test,Du=Array.prototype.concat,Iu=Array.prototype.join,zu=Array.prototype.slice,Mu=Math.floor,Bu="function"==typeof BigInt?BigInt.prototype.valueOf:null,Uu=Object.getOwnPropertySymbols,$u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,qu="function"==typeof Symbol&&"object"==typeof Symbol.iterator,Wu="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===qu||"symbol")?Symbol.toStringTag:null,Hu=Object.prototype.propertyIsEnumerable,Ju=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function Ku(e,n){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||Lu.call(/e/,n))return n;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var i=e<0?-Mu(-e):Mu(e);if(i!==e){var a=String(i),o=Cu.call(n,a.length+1);return Ru.call(a,t,"$&_")+"."+Ru.call(Ru.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ru.call(n,t,"$&_")}var Gu=hu,Vu=Gu.custom,Yu=nd(Vu)?Vu:null;function Xu(e,n,t){var i="double"===(t.quoteStyle||n)?'"':"'";return i+e+i}function Qu(e){return Ru.call(String(e),/"/g,""")}function Zu(e){return!("[object Array]"!==ad(e)||Wu&&"object"==typeof e&&Wu in e)}function ed(e){return!("[object RegExp]"!==ad(e)||Wu&&"object"==typeof e&&Wu in e)}function nd(e){if(qu)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!$u)return!1;try{return $u.call(e),!0}catch(e){}return!1}var td=Object.prototype.hasOwnProperty||function(e){return e in this};function id(e,n){return td.call(e,n)}function ad(e){return Tu.call(e)}function od(e,n){if(e.indexOf)return e.indexOf(n);for(var t=0,i=e.length;t<i;t++)if(e[t]===n)return t;return-1}function sd(e,n){if(e.length>n.maxStringLength){var t=e.length-n.maxStringLength,i="... "+t+" more character"+(t>1?"s":"");return sd(Cu.call(e,0,n.maxStringLength),n)+i}return Xu(Ru.call(Ru.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,rd),"single",n)}function rd(e){var n=e.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[n];return t?"\\"+t:"\\x"+(n<16?"0":"")+Pu.call(n.toString(16))}function cd(e){return"Object("+e+")"}function pd(e){return e+" { ? }"}function ld(e,n,t,i){return e+" ("+n+") {"+(i?ud(t,i):Iu.call(t,", "))+"}"}function ud(e,n){if(0===e.length)return"";var t="\n"+n.prev+n.base;return t+Iu.call(e,","+t)+"\n"+n.prev}function dd(e,n){var t=Zu(e),i=[];if(t){i.length=e.length;for(var a=0;a<e.length;a++)i[a]=id(e,a)?n(e[a],e):""}var o,s="function"==typeof Uu?Uu(e):[];if(qu){o={};for(var r=0;r<s.length;r++)o["$"+s[r]]=s[r]}for(var c in e)id(e,c)&&(t&&String(Number(c))===c&&c<e.length||qu&&o["$"+c]instanceof Symbol||(Lu.call(/[^\w$]/,c)?i.push(n(c,e)+": "+n(e[c],e)):i.push(c+": "+n(e[c],e))));if("function"==typeof Uu)for(var p=0;p<s.length;p++)Hu.call(e,s[p])&&i.push("["+n(s[p])+"]: "+n(e[s[p]],e));return i}var md=lu,fd=function(e,n){var t=du(e,!!n);return"function"==typeof t&&fu(e,".prototype.")>-1?mu(t):t},hd=function e(n,t,i,a){var o=t||{};if(id(o,"quoteStyle")&&"single"!==o.quoteStyle&&"double"!==o.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(id(o,"maxStringLength")&&("number"==typeof o.maxStringLength?o.maxStringLength<0&&o.maxStringLength!==1/0:null!==o.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=!id(o,"customInspect")||o.customInspect;if("boolean"!=typeof s&&"symbol"!==s)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(id(o,"indent")&&null!==o.indent&&"\t"!==o.indent&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(id(o,"numericSeparator")&&"boolean"!=typeof o.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var r=o.numericSeparator;if(void 0===n)return"undefined";if(null===n)return"null";if("boolean"==typeof n)return n?"true":"false";if("string"==typeof n)return sd(n,o);if("number"==typeof n){if(0===n)return 1/0/n>0?"0":"-0";var c=String(n);return r?Ku(n,c):c}if("bigint"==typeof n){var p=String(n)+"n";return r?Ku(n,p):p}var l=void 0===o.depth?5:o.depth;if(void 0===i&&(i=0),i>=l&&l>0&&"object"==typeof n)return Zu(n)?"[Array]":"[Object]";var u=function(e,n){var t;if("\t"===e.indent)t="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;t=Iu.call(Array(e.indent+1)," ")}return{base:t,prev:Iu.call(Array(n+1),t)}}(o,i);if(void 0===a)a=[];else if(od(a,n)>=0)return"[Circular]";function d(n,t,s){if(t&&(a=zu.call(a)).push(t),s){var r={depth:o.depth};return id(o,"quoteStyle")&&(r.quoteStyle=o.quoteStyle),e(n,r,i+1,a)}return e(n,o,i+1,a)}if("function"==typeof n&&!ed(n)){var m=function(e){if(e.name)return e.name;var n=Au.call(Fu.call(e),/^function\s*([\w$]+)/);if(n)return n[1];return null}(n),f=dd(n,d);return"[Function"+(m?": "+m:" (anonymous)")+"]"+(f.length>0?" { "+Iu.call(f,", ")+" }":"")}if(nd(n)){var h=qu?Ru.call(String(n),/^(Symbol\(.*\))_[^)]*$/,"$1"):$u.call(n);return"object"!=typeof n||qu?h:cd(h)}if(function(e){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"==typeof e.nodeName&&"function"==typeof e.getAttribute}(n)){for(var x="<"+Nu.call(String(n.nodeName)),v=n.attributes||[],y=0;y<v.length;y++)x+=" "+v[y].name+"="+Xu(Qu(v[y].value),"double",o);return x+=">",n.childNodes&&n.childNodes.length&&(x+="..."),x+="</"+Nu.call(String(n.nodeName))+">"}if(Zu(n)){if(0===n.length)return"[]";var g=dd(n,d);return u&&!function(e){for(var n=0;n<e.length;n++)if(od(e[n],"\n")>=0)return!1;return!0}(g)?"["+ud(g,u)+"]":"[ "+Iu.call(g,", ")+" ]"}if(function(e){return!("[object Error]"!==ad(e)||Wu&&"object"==typeof e&&Wu in e)}(n)){var b=dd(n,d);return"cause"in Error.prototype||!("cause"in n)||Hu.call(n,"cause")?0===b.length?"["+String(n)+"]":"{ ["+String(n)+"] "+Iu.call(b,", ")+" }":"{ ["+String(n)+"] "+Iu.call(Du.call("[cause]: "+d(n.cause),b),", ")+" }"}if("object"==typeof n&&s){if(Yu&&"function"==typeof n[Yu]&&Gu)return Gu(n,{depth:l-i});if("symbol"!==s&&"function"==typeof n.inspect)return n.inspect()}if(function(e){if(!yu||!e||"object"!=typeof e)return!1;try{yu.call(e);try{Su.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(n)){var w=[];return gu&&gu.call(n,(function(e,t){w.push(d(t,n,!0)+" => "+d(e,n))})),ld("Map",yu.call(n),w,u)}if(function(e){if(!Su||!e||"object"!=typeof e)return!1;try{Su.call(e);try{yu.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(n)){var S=[];return ku&&ku.call(n,(function(e){S.push(d(e,n))})),ld("Set",Su.call(n),S,u)}if(function(e){if(!Eu||!e||"object"!=typeof e)return!1;try{Eu.call(e,Eu);try{ju.call(e,ju)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(n))return pd("WeakMap");if(function(e){if(!ju||!e||"object"!=typeof e)return!1;try{ju.call(e,ju);try{Eu.call(e,Eu)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(n))return pd("WeakSet");if(function(e){if(!_u||!e||"object"!=typeof e)return!1;try{return _u.call(e),!0}catch(e){}return!1}(n))return pd("WeakRef");if(function(e){return!("[object Number]"!==ad(e)||Wu&&"object"==typeof e&&Wu in e)}(n))return cd(d(Number(n)));if(function(e){if(!e||"object"!=typeof e||!Bu)return!1;try{return Bu.call(e),!0}catch(e){}return!1}(n))return cd(d(Bu.call(n)));if(function(e){return!("[object Boolean]"!==ad(e)||Wu&&"object"==typeof e&&Wu in e)}(n))return cd(Ou.call(n));if(function(e){return!("[object String]"!==ad(e)||Wu&&"object"==typeof e&&Wu in e)}(n))return cd(d(String(n)));if(!function(e){return!("[object Date]"!==ad(e)||Wu&&"object"==typeof e&&Wu in e)}(n)&&!ed(n)){var k=dd(n,d),E=Ju?Ju(n)===Object.prototype:n instanceof Object||n.constructor===Object,j=n instanceof Object?"":"null prototype",_=!E&&Wu&&Object(n)===n&&Wu in n?Cu.call(ad(n),8,-1):j?"Object":"",O=(E||"function"!=typeof n.constructor?"":n.constructor.name?n.constructor.name+" ":"")+(_||j?"["+Iu.call(Du.call([],_||[],j||[]),": ")+"] ":"");return 0===k.length?O+"{}":u?O+"{"+ud(k,u)+"}":O+"{ "+Iu.call(k,", ")+" }"}return String(n)},xd=md("%TypeError%"),vd=md("%WeakMap%",!0),yd=md("%Map%",!0),gd=fd("WeakMap.prototype.get",!0),bd=fd("WeakMap.prototype.set",!0),wd=fd("WeakMap.prototype.has",!0),Sd=fd("Map.prototype.get",!0),kd=fd("Map.prototype.set",!0),Ed=fd("Map.prototype.has",!0),jd=function(e,n){for(var t,i=e;null!==(t=i.next);i=t)if(t.key===n)return i.next=t.next,t.next=e.next,e.next=t,t},_d=String.prototype.replace,Od=/%20/g,Td="RFC3986",Fd={default:Td,formatters:{RFC1738:function(e){return _d.call(e,Od,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:Td},Ad=Fd,Cd=Object.prototype.hasOwnProperty,Rd=Array.isArray,Pd=function(){for(var e=[],n=0;n<256;++n)e.push("%"+((n<16?"0":"")+n.toString(16)).toUpperCase());return e}(),Nd=function(e,n){for(var t=n&&n.plainObjects?Object.create(null):{},i=0;i<e.length;++i)void 0!==e[i]&&(t[i]=e[i]);return t},Ld={arrayToObject:Nd,assign:function(e,n){return Object.keys(n).reduce((function(e,t){return e[t]=n[t],e}),e)},combine:function(e,n){return[].concat(e,n)},compact:function(e){for(var n=[{obj:{o:e},prop:"o"}],t=[],i=0;i<n.length;++i)for(var a=n[i],o=a.obj[a.prop],s=Object.keys(o),r=0;r<s.length;++r){var c=s[r],p=o[c];"object"==typeof p&&null!==p&&-1===t.indexOf(p)&&(n.push({obj:o,prop:c}),t.push(p))}return function(e){for(;e.length>1;){var n=e.pop(),t=n.obj[n.prop];if(Rd(t)){for(var i=[],a=0;a<t.length;++a)void 0!==t[a]&&i.push(t[a]);n.obj[n.prop]=i}}}(n),e},decode:function(e,n,t){var i=e.replace(/\+/g," ");if("iso-8859-1"===t)return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch(e){return i}},encode:function(e,n,t,i,a){if(0===e.length)return e;var o=e;if("symbol"==typeof e?o=Symbol.prototype.toString.call(e):"string"!=typeof e&&(o=String(e)),"iso-8859-1"===t)return escape(o).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var s="",r=0;r<o.length;++r){var c=o.charCodeAt(r);45===c||46===c||95===c||126===c||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||a===Ad.RFC1738&&(40===c||41===c)?s+=o.charAt(r):c<128?s+=Pd[c]:c<2048?s+=Pd[192|c>>6]+Pd[128|63&c]:c<55296||c>=57344?s+=Pd[224|c>>12]+Pd[128|c>>6&63]+Pd[128|63&c]:(r+=1,c=65536+((1023&c)<<10|1023&o.charCodeAt(r)),s+=Pd[240|c>>18]+Pd[128|c>>12&63]+Pd[128|c>>6&63]+Pd[128|63&c])}return s},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,n){if(Rd(e)){for(var t=[],i=0;i<e.length;i+=1)t.push(n(e[i]));return t}return n(e)},merge:function e(n,t,i){if(!t)return n;if("object"!=typeof t){if(Rd(n))n.push(t);else{if(!n||"object"!=typeof n)return[n,t];(i&&(i.plainObjects||i.allowPrototypes)||!Cd.call(Object.prototype,t))&&(n[t]=!0)}return n}if(!n||"object"!=typeof n)return[n].concat(t);var a=n;return Rd(n)&&!Rd(t)&&(a=Nd(n,i)),Rd(n)&&Rd(t)?(t.forEach((function(t,a){if(Cd.call(n,a)){var o=n[a];o&&"object"==typeof o&&t&&"object"==typeof t?n[a]=e(o,t,i):n.push(t)}else n[a]=t})),n):Object.keys(t).reduce((function(n,a){var o=t[a];return Cd.call(n,a)?n[a]=e(n[a],o,i):n[a]=o,n}),a)}},Dd=function(){var e,n,t,i={assert:function(e){if(!i.has(e))throw new xd("Side channel does not contain "+hd(e))},get:function(i){if(vd&&i&&("object"==typeof i||"function"==typeof i)){if(e)return gd(e,i)}else if(yd){if(n)return Sd(n,i)}else if(t)return function(e,n){var t=jd(e,n);return t&&t.value}(t,i)},has:function(i){if(vd&&i&&("object"==typeof i||"function"==typeof i)){if(e)return wd(e,i)}else if(yd){if(n)return Ed(n,i)}else if(t)return function(e,n){return!!jd(e,n)}(t,i);return!1},set:function(i,a){vd&&i&&("object"==typeof i||"function"==typeof i)?(e||(e=new vd),bd(e,i,a)):yd?(n||(n=new yd),kd(n,i,a)):(t||(t={key:{},next:null}),function(e,n,t){var i=jd(e,n);i?i.value=t:e.next={key:n,next:e.next,value:t}}(t,i,a))}};return i},Id=Ld,zd=Fd,Md=Object.prototype.hasOwnProperty,Bd={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,n){return e+"["+n+"]"},repeat:function(e){return e}},Ud=Array.isArray,$d=Array.prototype.push,qd=function(e,n){$d.apply(e,Ud(n)?n:[n])},Wd=Date.prototype.toISOString,Hd=zd.default,Jd={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Id.encode,encodeValuesOnly:!1,format:Hd,formatter:zd.formatters[Hd],indices:!1,serializeDate:function(e){return Wd.call(e)},skipNulls:!1,strictNullHandling:!1},Kd={},Gd=function e(n,t,i,a,o,s,r,c,p,l,u,d,m,f,h,x){for(var v,y=n,g=x,b=0,w=!1;void 0!==(g=g.get(Kd))&&!w;){var S=g.get(n);if(b+=1,void 0!==S){if(S===b)throw new RangeError("Cyclic object value");w=!0}void 0===g.get(Kd)&&(b=0)}if("function"==typeof c?y=c(t,y):y instanceof Date?y=u(y):"comma"===i&&Ud(y)&&(y=Id.maybeMap(y,(function(e){return e instanceof Date?u(e):e}))),null===y){if(o)return r&&!f?r(t,Jd.encoder,h,"key",d):t;y=""}if("string"==typeof(v=y)||"number"==typeof v||"boolean"==typeof v||"symbol"==typeof v||"bigint"==typeof v||Id.isBuffer(y))return r?[m(f?t:r(t,Jd.encoder,h,"key",d))+"="+m(r(y,Jd.encoder,h,"value",d))]:[m(t)+"="+m(String(y))];var k,E=[];if(void 0===y)return E;if("comma"===i&&Ud(y))f&&r&&(y=Id.maybeMap(y,r)),k=[{value:y.length>0?y.join(",")||null:void 0}];else if(Ud(c))k=c;else{var j=Object.keys(y);k=p?j.sort(p):j}for(var _=a&&Ud(y)&&1===y.length?t+"[]":t,O=0;O<k.length;++O){var T=k[O],F="object"==typeof T&&void 0!==T.value?T.value:y[T];if(!s||null!==F){var A=Ud(y)?"function"==typeof i?i(_,T):_:_+(l?"."+T:"["+T+"]");x.set(n,b);var C=Dd();C.set(Kd,x),qd(E,e(F,A,i,a,o,s,"comma"===i&&f&&Ud(y)?null:r,c,p,l,u,d,m,f,h,C))}}return E},Vd=Ld,Yd=Object.prototype.hasOwnProperty,Xd=Array.isArray,Qd={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Vd.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Zd=function(e){return e.replace(/&#(\d+);/g,(function(e,n){return String.fromCharCode(parseInt(n,10))}))},em=function(e,n){return e&&"string"==typeof e&&n.comma&&e.indexOf(",")>-1?e.split(","):e},nm=function(e,n,t,i){if(e){var a=t.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/g,s=t.depth>0&&/(\[[^[\]]*])/.exec(a),r=s?a.slice(0,s.index):a,c=[];if(r){if(!t.plainObjects&&Yd.call(Object.prototype,r)&&!t.allowPrototypes)return;c.push(r)}for(var p=0;t.depth>0&&null!==(s=o.exec(a))&&p<t.depth;){if(p+=1,!t.plainObjects&&Yd.call(Object.prototype,s[1].slice(1,-1))&&!t.allowPrototypes)return;c.push(s[1])}return s&&c.push("["+a.slice(s.index)+"]"),function(e,n,t,i){for(var a=i?n:em(n,t),o=e.length-1;o>=0;--o){var s,r=e[o];if("[]"===r&&t.parseArrays)s=[].concat(a);else{s=t.plainObjects?Object.create(null):{};var c="["===r.charAt(0)&&"]"===r.charAt(r.length-1)?r.slice(1,-1):r,p=parseInt(c,10);t.parseArrays||""!==c?!isNaN(p)&&r!==c&&String(p)===c&&p>=0&&t.parseArrays&&p<=t.arrayLimit?(s=[])[p]=a:"__proto__"!==c&&(s[c]=a):s={0:a}}a=s}return a}(c,n,t,i)}},tm=function(e,n){var t,i=e,a=function(e){if(!e)return Jd;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var n=e.charset||Jd.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=zd.default;if(void 0!==e.format){if(!Md.call(zd.formatters,e.format))throw new TypeError("Unknown format option provided.");t=e.format}var i=zd.formatters[t],a=Jd.filter;return("function"==typeof e.filter||Ud(e.filter))&&(a=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:Jd.addQueryPrefix,allowDots:void 0===e.allowDots?Jd.allowDots:!!e.allowDots,charset:n,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:Jd.charsetSentinel,delimiter:void 0===e.delimiter?Jd.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:Jd.encode,encoder:"function"==typeof e.encoder?e.encoder:Jd.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:Jd.encodeValuesOnly,filter:a,format:t,formatter:i,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:Jd.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:Jd.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:Jd.strictNullHandling}}(n);"function"==typeof a.filter?i=(0,a.filter)("",i):Ud(a.filter)&&(t=a.filter);var o,s=[];if("object"!=typeof i||null===i)return"";o=n&&n.arrayFormat in Bd?n.arrayFormat:n&&"indices"in n?n.indices?"indices":"repeat":"indices";var r=Bd[o];if(n&&"commaRoundTrip"in n&&"boolean"!=typeof n.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c="comma"===r&&n&&n.commaRoundTrip;t||(t=Object.keys(i)),a.sort&&t.sort(a.sort);for(var p=Dd(),l=0;l<t.length;++l){var u=t[l];a.skipNulls&&null===i[u]||qd(s,Gd(i[u],u,r,c,a.strictNullHandling,a.skipNulls,a.encode?a.encoder:null,a.filter,a.sort,a.allowDots,a.serializeDate,a.format,a.formatter,a.encodeValuesOnly,a.charset,p))}var d=s.join(a.delimiter),m=!0===a.addQueryPrefix?"?":"";return a.charsetSentinel&&("iso-8859-1"===a.charset?m+="utf8=%26%2310003%3B&":m+="utf8=%E2%9C%93&"),d.length>0?m+d:""},im=function(e,n){var t=function(e){if(!e)return Qd;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=void 0===e.charset?Qd.charset:e.charset;return{allowDots:void 0===e.allowDots?Qd.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:Qd.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:Qd.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:Qd.arrayLimit,charset:n,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:Qd.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:Qd.comma,decoder:"function"==typeof e.decoder?e.decoder:Qd.decoder,delimiter:"string"==typeof e.delimiter||Vd.isRegExp(e.delimiter)?e.delimiter:Qd.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:Qd.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:Qd.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:Qd.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:Qd.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:Qd.strictNullHandling}}(n);if(""===e||null==e)return t.plainObjects?Object.create(null):{};for(var i="string"==typeof e?function(e,n){var t,i={__proto__:null},a=n.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=n.parameterLimit===1/0?void 0:n.parameterLimit,s=a.split(n.delimiter,o),r=-1,c=n.charset;if(n.charsetSentinel)for(t=0;t<s.length;++t)0===s[t].indexOf("utf8=")&&("utf8=%E2%9C%93"===s[t]?c="utf-8":"utf8=%26%2310003%3B"===s[t]&&(c="iso-8859-1"),r=t,t=s.length);for(t=0;t<s.length;++t)if(t!==r){var p,l,u=s[t],d=u.indexOf("]="),m=-1===d?u.indexOf("="):d+1;-1===m?(p=n.decoder(u,Qd.decoder,c,"key"),l=n.strictNullHandling?null:""):(p=n.decoder(u.slice(0,m),Qd.decoder,c,"key"),l=Vd.maybeMap(em(u.slice(m+1),n),(function(e){return n.decoder(e,Qd.decoder,c,"value")}))),l&&n.interpretNumericEntities&&"iso-8859-1"===c&&(l=Zd(l)),u.indexOf("[]=")>-1&&(l=Xd(l)?[l]:l),Yd.call(i,p)?i[p]=Vd.combine(i[p],l):i[p]=l}return i}(e,t):e,a=t.plainObjects?Object.create(null):{},o=Object.keys(i),s=0;s<o.length;++s){var r=o[s],c=nm(r,i[r],t,"string"==typeof e);a=Vd.merge(a,c,t)}return!0===t.allowSparse?a:Vd.compact(a)},am={formats:Fd,parse:im,stringify:tm};const om=function(){const e=Cl.create();return e.interceptors.request.use((e=>(e.formData&&(e.data=am.stringify(e.formData,{arrayFormat:"indices",allowDots:!0}),delete e.formData),e)),(e=>(Cs.error(e),Promise.reject(e)))),e.interceptors.response.use((e=>(Cs.info("http response:",JSON.stringify(e.data)),e.data)),(e=>(Cs.error("请求出错:",e.response.config.url,e),Promise.reject(e)))),e}();class sm{rootDir;scope;parent;constructor(e){this.rootDir=Ks.getFileRootDir(e?.rootDir),this.scope=e?.scope||"0",this.parent=e?.parent||"0"}readFile(e){return c.existsSync(e)?c.readFileSync(e):null}writeFile(e,n){const t=this.buildFilePath(e);return c.writeFileSync(t,n),t}buildFilePath(e){const n=l.join(this.rootDir,this.scope+"",this.parent+"",b().format("YYYY-MM-DD"));return c.existsSync(n)||c.mkdirSync(n,{recursive:!0}),l.join(n,e)}deleteByParent(e,n){const t=l.join(this.rootDir,e,n);c.existsSync(t)&&c.unlinkSync(t)}}const rm=new Ds,cm="pipeline:access",pm="pipeline:access:input";const lm={sleep:function(e){return new Promise((n=>{setTimeout((()=>{n({})}),e)}))},http:om};exports.ACCESS_CLASS_KEY=cm,exports.ACCESS_INPUT_KEY=pm,exports.AUTOWIRE_KEY=Us,exports.AbstractTaskPlugin=class{_result={clearLastStatus:!1,files:[]};ctx;clearLastStatus(){this._result.clearLastStatus=!0}getFiles(){return this._result.files}setCtx(e){this.ctx=e}randomFileId(){return Math.random().toString(36).substring(2,9)}linkFile(e){this._result.files.push({...e,id:this.randomFileId()})}saveFile(e,n){const t=this.ctx.fileStore.writeFile(e,n);this._result.files.push({id:this.randomFileId(),filename:e,path:t})}get pipeline(){return this.ctx.pipeline}get step(){return this.ctx.step}async onInstance(){}},exports.AccessInput=function(e){return(n,t)=>{n=Bs.target(n,t),Reflect.defineMetadata(pm,e,n,t)}},exports.Autowire=function(e){return(n,t)=>{const i=Reflect.getMetadata("design:type",n,t);n=Bs.target(n,t),(e=e||{}).type=i,Reflect.defineMetadata(Us,e||{},n,t)}},exports.ContextFactory=Ys,exports.Decorator=Bs,exports.Executor=class{pipeline;runtime;contextFactory;logger;pipelineContext;lastStatusMap;lastRuntime;options;canceled=!1;onChanged;constructor(e){this.options=e,this.pipeline=s.cloneDeep(e.pipeline),this.onChanged=async n=>{await e.onChanged(n)},this.pipeline.userId=e.userId,this.contextFactory=new Ys(e.storage),this.logger=Cs,this.pipelineContext=this.contextFactory.getContext("pipeline",this.pipeline.id)}async init(){const e=await this.pipelineContext.getObj("lastRuntime");this.lastRuntime=e,this.lastStatusMap=new Ns(e?.pipeline)}async cancel(){this.canceled=!0,this.runtime?.cancel(this.pipeline),await this.onChanged(this.runtime)}async run(e=0,n){try{await this.init();const t={type:n};this.runtime=new Ps(e,t,this.pipeline),this.logger.info(`pipeline.${this.pipeline.id} start`),await this.notification("start"),await this.runWithHistory(this.pipeline,"pipeline",(async()=>{await this.runStages(this.pipeline)})),this.lastRuntime&&this.lastRuntime.pipeline.status?.status===exports.ResultType.error&&await this.notification("turnToSuccess"),await this.notification("success")}catch(e){await this.notification("error",e),this.logger.error("pipeline 执行失败",e)}finally{await this.pipelineContext.setObj("lastRuntime",this.runtime),this.logger.info(`pipeline.${this.pipeline.id} end`)}}async runWithHistory(e,n,t){if(e.runnableType=n,this.runtime.start(e),await this.onChanged(this.runtime),e.strategy?.runStrategy===exports.RunStrategy.SkipWhenSucceed){const t=this.lastStatusMap.get(e.id),i=t?.status?.status,a=JSON.stringify(t?.status?.input);let o=!1;if("step"===n){const n=e,t=JSON.stringify(n.input);null!=t&&a!==t&&(o=!0)}if(null!=i&&i===exports.ResultType.success&&!o)return this.runtime.skip(e),await this.onChanged(this.runtime),exports.ResultType.skip}const i=setInterval((async()=>{await this.onChanged(this.runtime)}),5e3),a=e.timeout??12e5;try{if(this.canceled)throw new Error("task canceled");return await function(e,n=3e4){let t;return Promise.race([e(),new Promise(((e,i)=>{t=setTimeout((()=>{i(new Error(`Task timeout in ${n} ms`))}),n)}))]).finally((()=>{clearTimeout(t)}))}(t,a),this.runtime.success(e),exports.ResultType.success}catch(n){throw this.runtime.error(e,n),n}finally{this.runtime.finally(e),clearInterval(i),await this.onChanged(this.runtime)}}async runStages(e){const n=[];for(const t of e.stages){const e=await this.runWithHistory(t,"stage",(async()=>{await this.runStage(t)}));n.push(e)}return this.compositionResultType(n)}async runStage(e){const n=[];for(const t of e.tasks){const e=this.runWithHistory(t,"task",(async()=>{await this.runTask(t)}));n.push(e)}let t=[];if(e.concurrency===exports.ConcurrencyStrategy.Parallel)t=await Promise.all(n);else for(let e=0;e<n.length;e++){const i=n[e];t[e]=await i}return this.compositionResultType(t)}compositionResultType(e){let n=!1;for(const t of e){if(t===exports.ResultType.error)return exports.ResultType.error;t===exports.ResultType.success&&(n=!0)}return n?exports.ResultType.success:exports.ResultType.error}async runTask(e){const n=[];for(const t of e.steps){t.runnableType="step";const e=await this.runWithHistory(t,"step",(async()=>{await this.runStep(t)}));n.push(e)}return this.compositionResultType(n)}async runStep(e){const n=this.lastStatusMap.get(e.id),t=Is.get(e.type),i=new t.target,a=t.define;Bs.inject(a.input,i,e.input,((n,t)=>{if("pi-output-selector"===n.component?.name){const n=e.input[t];null!=n&&(e.input[t]=this.runtime.context[n])}}));const o={pipeline:this.pipeline,step:e,lastStatus:n,http:om,logger:this.runtime._loggers[e.id],accessService:this.options.accessService,emailService:this.options.emailService,pipelineContext:this.pipelineContext,userContext:this.contextFactory.getContext("user",this.options.userId),fileStore:new sm({scope:this.pipeline.id,parent:this.runtime.id,rootDir:this.options.fileRootDir})};i.setCtx(o),await i.onInstance(),await i.execute(),i._result.clearLastStatus&&this.lastStatusMap.clear(),s.forEach(a.output,((n,t)=>{e.status.output[t]=i[t];const a=`step.${e.id}.${t}`;this.runtime.context[a]=i[t]})),e.status.files=i.getFiles()}async notification(e,n){if(!this.pipeline.notifications)return;let t="",i="";if("start"===e)t=`【CertD】开始执行,${this.pipeline.title}, buildId:${this.runtime.id}`,i=t;else if("success"===e)t=`【CertD】执行成功,${this.pipeline.title}, buildId:${this.runtime.id}`,i=t;else if("turnToSuccess"===e)t=`【CertD】执行成功(错误转成功),${this.pipeline.title}, buildId:${this.runtime.id}`,i=t;else{if("error"!==e)return;t=`【CertD】执行失败,${this.pipeline.title}, buildId:${this.runtime.id}`,i=`<pre>${n.message}</pre>`}for(const n of this.pipeline.notifications)n.when.includes(e)&&"email"===n.type&&this.options.emailService?.send({userId:this.pipeline.userId,subject:t,content:i,receivers:n.options.receivers})}},exports.FileStorage=class{root;constructor(e){this.root=Ks.getFileRootDir(e)}async remove(e,n,t,i){i?c.unlinkSync(this.buildPath(e,n,t,i)):t?c.rmdirSync(this.buildPath(e,n,t)):n?c.rmdirSync(this.buildPath(e,n)):c.rmdirSync(this.buildPath(e))}writeFile(e,n){const t=l.dirname(e);return c.existsSync(t)||c.mkdirSync(t,{recursive:!0}),c.writeFileSync(e,n),e}readFile(e){return c.existsSync(e)?c.readFileSync(e).toString():null}async get(e,n,t,i){const a=this.buildPath(e,n,t,i);return this.readFile(a)}async set(e,n,t,i,a){const o=this.buildPath(e,n,t,i);this.writeFile(o,a)}buildPath(e,n,t,i){return i?`${this.root}/${e}/${n}/${t}/${i}`:t?`${this.root}/${e}/${n}/${t}`:n?`${this.root}/${e}/${n}`:`${this.root}/${e}`}},exports.FileStore=sm,exports.IsAccess=function(e){return n=>{n=Bs.target(n);const t={},i=Bs.getClassProperties(n);for(const e in i){const i=Reflect.getMetadata(pm,n,e);i&&(t[e]=i)}s.merge(e,{input:t}),Reflect.defineMetadata(cm,e,n),n.define=e,rm.register(e.name,{define:e,target:n})}},exports.IsTaskPlugin=function(e){return n=>{n=Bs.target(n);const t={},i={},a={},o=Bs.getClassProperties(n);for(const e in o){const o=Reflect.getMetadata(Ws,n,e);o&&(t[e]=o);const s=Reflect.getMetadata(Us,n,e);s&&(i[e]=s);const r=Reflect.getMetadata(Hs,n,e);r&&(a[e]=r)}s.merge(e,{input:t,autowire:i,output:a}),Reflect.defineMetadata(qs,e,n),n.define=e,Is.register(e.name,{define:e,target:n})}},exports.MemoryStorage=Gs,exports.NewRunHistory=function(e){const n=new Ps(e.id,e.trigger,e.pipeline);return n.context=e.context,n.logs=e.logs,n._loggers=e.loggers,n},exports.PLUGIN_CLASS_KEY=qs,exports.PLUGIN_DOWNLOAD_KEY=Js,exports.PLUGIN_INPUT_KEY=Ws,exports.PLUGIN_OUTPUT_KEY=Hs,exports.Registry=Ds,exports.RunHistory=Ps,exports.RunnableCollection=Ns,exports.StorageContext=Xs,exports.TaskDownload=function(e){return(n,t)=>{n=Bs.target(n,t),Reflect.defineMetadata(Js,e,n,t)}},exports.TaskInput=function(e){return(n,t)=>{n=Bs.target(n,t),Reflect.defineMetadata(Ws,e,n,t)}},exports.TaskOutput=function(e){return(n,t)=>{n=Bs.target(n,t),Reflect.defineMetadata(Hs,e,n,t)}},exports.accessRegistry=rm,exports.buildLogger=Rs,exports.logger=Cs,exports.pluginRegistry=Is,exports.utils=lm;
|
|
@@ -23,9 +23,11 @@ export declare class Executor {
|
|
|
23
23
|
lastStatusMap: RunnableCollection;
|
|
24
24
|
lastRuntime: RunHistory;
|
|
25
25
|
options: ExecutorOptions;
|
|
26
|
+
canceled: boolean;
|
|
26
27
|
onChanged: (history: RunHistory) => void;
|
|
27
28
|
constructor(options: ExecutorOptions);
|
|
28
29
|
init(): Promise<void>;
|
|
30
|
+
cancel(): Promise<void>;
|
|
29
31
|
run(runtimeId: any, triggerType: string): Promise<void>;
|
|
30
32
|
runWithHistory(runnable: Runnable, runnableType: string, run: () => Promise<void>): Promise<ResultType.success | ResultType.skip>;
|
|
31
33
|
private runStages;
|
|
@@ -24,6 +24,7 @@ export declare class RunHistory {
|
|
|
24
24
|
success(runnable: Runnable): void;
|
|
25
25
|
skip(runnable: Runnable): void;
|
|
26
26
|
error(runnable: Runnable, e: Error): void;
|
|
27
|
+
cancel(runnable: Runnable): void;
|
|
27
28
|
log(runnable: Runnable, text: string): void;
|
|
28
29
|
logError(runnable: Runnable, e: Error): void;
|
|
29
30
|
finally(runnable: Runnable): void;
|
|
@@ -56,6 +56,7 @@ export type Runnable = {
|
|
|
56
56
|
strategy?: RunnableStrategy;
|
|
57
57
|
runnableType?: string;
|
|
58
58
|
status?: HistoryResult;
|
|
59
|
+
timeout?: number;
|
|
59
60
|
default?: {
|
|
60
61
|
[key: string]: any;
|
|
61
62
|
};
|
|
@@ -90,6 +91,7 @@ export declare enum ResultType {
|
|
|
90
91
|
start = "start",
|
|
91
92
|
success = "success",
|
|
92
93
|
error = "error",
|
|
94
|
+
canceled = "canceled",
|
|
93
95
|
skip = "skip",
|
|
94
96
|
none = "none"
|
|
95
97
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function TimeoutPromise(callback: () => Promise<void>, ms?: number): Promise<unknown>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@certd/pipeline",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.5",
|
|
5
5
|
"main": "./dist/bundle.js",
|
|
6
6
|
"module": "./dist/bundle.mjs",
|
|
7
7
|
"types": "./dist/d/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"qs": "^6.11.2"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@certd/acme-client": "^1.1.
|
|
21
|
+
"@certd/acme-client": "^1.1.5",
|
|
22
22
|
"@rollup/plugin-commonjs": "^23.0.4",
|
|
23
23
|
"@rollup/plugin-json": "^6.0.0",
|
|
24
24
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"vite": "^4.3.8",
|
|
52
52
|
"vue-tsc": "^1.6.5"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "a096a43c568cf8ca4fc06f52ce577442837d8903"
|
|
55
55
|
}
|