@longzai-intelligence-dependencies/cli 0.0.25 → 0.0.26

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.
Files changed (2) hide show
  1. package/dist/index.js +61 -61
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -126,70 +126,70 @@ e.destroyed||(t===`beforeExit`?(e.flush(),e.on(`drain`,function(){e.end()})):
126
126
  /* istanbul ignore next */
127
127
  e.flushSync())}function ae(e){return function(t,n,r={},i){if(typeof r==`string`)i=j({dest:r}),r={};else if(typeof i==`string`){if(r&&r.transport)throw Error(`only one of option.transport or stream can be specified`);i=j({dest:i})}else if(r instanceof o||r.writable||r._writableState)i=r,r={};else if(r.transport){if(r.transport instanceof o||r.transport.writable||r.transport._writableState)throw Error(`option.transport do not allow stream, please pass to option directly. e.g. pino(transport)`);if(r.transport.targets&&r.transport.targets.length&&r.formatters&&typeof r.formatters.level==`function`)throw Error(`option.transport.targets do not allow custom level formatters`);let e;r.customLevels&&(e=r.useOnlyCustomLevels?r.customLevels:Object.assign({},r.levels,r.customLevels)),i=T({caller:n,...r.transport,levels:e})}if(r=Object.assign({},e,r),r.serializers=Object.assign(Object.create(null),e.serializers,r.serializers),r.formatters=Object.assign({},e.formatters,r.formatters),r.prettyPrint)throw Error(`prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)`);let{enabled:a,onChild:s}=r;return a===!1&&(r.level=`silent`),s||(r.onChild=k),i||=ie(process.stdout)?process.stdout:j({fd:process.stdout.fd||1}),{opts:r,stream:i}}}function oe(e,t){try{return JSON.stringify(e)}catch{try{return(t||this[g])(e)}catch{return`"[unable to serialize, circular reference is too complex to analyze]"`}}}function se(e,t,n){return{level:e,bindings:t,log:n}}function N(e){let t=Number(e);return typeof e==`string`&&Number.isFinite(t)?t:e===void 0?1:e}t.exports={noop:k,buildSafeSonicBoom:j,asChindings:re,asJson:te,genLog:A,createArgsNormalizer:ae,stringify:oe,buildFormatters:se,normalizeDestFileDescriptor:N}})),Jl=/* @__PURE__ */ L(((e,t)=>{t.exports={DEFAULT_LEVELS:{trace:10,debug:20,info:30,warn:40,error:50,fatal:60},SORTING_ORDER:{ASC:`ASC`,DESC:`DESC`}}})),Yl=/* @__PURE__ */ L(((e,t)=>{let{lsCacheSym:n,levelValSym:r,useOnlyCustomLevelsSym:i,streamSym:a,formattersSym:o,hooksSym:s,levelCompSym:c}=Fl(),{noop:l,genLog:u}=ql(),{DEFAULT_LEVELS:d,SORTING_ORDER:f}=Jl(),p={fatal:e=>{let t=u(d.fatal,e);return function(...e){let n=this[a];if(t.call(this,...e),typeof n.flushSync==`function`)try{n.flushSync()}catch{}}},error:e=>u(d.error,e),warn:e=>u(d.warn,e),info:e=>u(d.info,e),debug:e=>u(d.debug,e),trace:e=>u(d.trace,e)},m=Object.keys(d).reduce((e,t)=>(e[d[t]]=t,e),{}),h=Object.keys(m).reduce((e,t)=>(e[t]=`{"level":`+Number(t),e),{});function g(e){let t=e[o].level,{labels:r}=e.levels,i={};for(let e in r){let n=t(r[e],Number(e));i[e]=JSON.stringify(n).slice(0,-1)}return e[n]=i,e}function _(e,t){if(t)return!1;switch(e){case`fatal`:case`error`:case`warn`:case`info`:case`debug`:case`trace`:return!0;default:return!1}}function v(e){let{labels:t,values:n}=this.levels;if(typeof e==`number`){if(t[e]===void 0)throw Error(`unknown level value`+e);e=t[e]}if(n[e]===void 0)throw Error(`unknown level `+e);let a=this[r],o=this[r]=n[e],d=this[i],f=this[c],m=this[s].logMethod;for(let e in n)this[e]=f(n[e],o)===!1?l:_(e,d)?p[e](m):u(n[e],m);this.emit(`level-change`,e,o,t[a],a,this)}function y(e){let{levels:t,levelVal:n}=this;return t&&t.labels?t.labels[n]:``}function b(e){let{values:t}=this.levels,n=t[e];return n!==void 0&&this[c](n,this[r])}function x(e,t,n){return e===f.DESC?t<=n:t>=n}function S(e){return typeof e==`string`?x.bind(null,e):e}function C(e=null,t=!1){let n=e?Object.keys(e).reduce((t,n)=>(t[e[n]]=n,t),{}):null;return{labels:Object.assign(Object.create(Object.prototype,{Infinity:{value:`silent`}}),t?null:m,n),values:Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),t?null:d,e)}}function w(e,t,n){if(typeof e==`number`){if(![].concat(Object.keys(t||{}).map(e=>t[e]),n?[]:Object.keys(m).map(e=>+e),1/0).includes(e))throw Error(`default level:${e} must be included in custom levels`)}else if(!(e in Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),n?null:d,t)))throw Error(`default level:${e} must be included in custom levels`)}function T(e,t){let{labels:n,values:r}=e;for(let e in t){if(e in r)throw Error(`levels cannot be overridden`);if(t[e]in n)throw Error(`pre-existing level values cannot be used for new levels`)}}function E(e){if(typeof e!=`function`&&!(typeof e==`string`&&Object.values(f).includes(e)))throw Error(`Levels comparison should be one of "ASC", "DESC" or "function" type`)}t.exports={initialLsCache:h,genLsCache:g,levelMethods:p,getLevel:y,setLevel:v,isLevelEnabled:b,mappings:C,assertNoLevelCollisions:T,assertDefaultLevelFound:w,genLevelComparison:S,assertLevelComparison:E}})),Xl=/* @__PURE__ */ L(((e,t)=>{t.exports={version:`10.4.0`}})),Zl=/* @__PURE__ */ L(((e,t)=>{let{EventEmitter:n}=z(`node:events`),{lsCacheSym:r,levelValSym:i,setLevelSym:a,getLevelSym:o,chindingsSym:s,mixinSym:c,asJsonSym:l,writeSym:u,mixinMergeStrategySym:d,timeSym:f,timeSliceIndexSym:p,streamSym:m,serializersSym:h,formattersSym:g,errorKeySym:_,messageKeySym:v,useOnlyCustomLevelsSym:y,needsMetadataGsym:b,redactFmtSym:x,stringifySym:S,formatOptsSym:C,stringifiersSym:w,msgPrefixSym:T,hooksSym:E}=Fl(),{getLevel:D,setLevel:O,isLevelEnabled:k,mappings:A,initialLsCache:ee,genLsCache:te,assertNoLevelCollisions:ne}=Yl(),{asChindings:re,asJson:ie,buildFormatters:j,stringify:M,noop:ae}=ql(),{version:oe}=Xl(),se=Il(),N={constructor:class{},child:F,bindings:ce,setBindings:le,flush:de,isLevelEnabled:k,version:oe,get level(){return this[o]()},set level(e){this[a](e)},get levelVal(){return this[i]},set levelVal(e){throw Error(`levelVal is read-only`)},get msgPrefix(){return this[T]},get[Symbol.toStringTag](){return`Pino`},[r]:ee,[u]:I,[l]:ie,[o]:D,[a]:O};Object.setPrototypeOf(N,n.prototype),t.exports=function(){return Object.create(N)};let P=e=>e;function F(e,t){if(!e)throw Error(`missing bindings for child Pino`);let n=this[h],r=this[g],i=Object.create(this);if(t==null)return i[g].bindings!==P&&(i[g]=j(r.level,P,r.log)),i[s]=re(i,e),this.onChild!==ae&&this.onChild(i),i;if(t.hasOwnProperty(`serializers`)===!0){i[h]=Object.create(null);for(let e in n)i[h][e]=n[e];let e=Object.getOwnPropertySymbols(n);for(var o=0;o<e.length;o++){let t=e[o];i[h][t]=n[t]}for(let e in t.serializers)i[h][e]=t.serializers[e];let r=Object.getOwnPropertySymbols(t.serializers);for(var c=0;c<r.length;c++){let e=r[c];i[h][e]=t.serializers[e]}}else i[h]=n;if(t.hasOwnProperty(`formatters`)){let{level:e,bindings:n,log:a}=t.formatters;i[g]=j(e||r.level,n||P,a||r.log)}else i[g]=j(r.level,P,r.log);if(t.hasOwnProperty(`customLevels`)===!0&&(ne(this.levels,t.customLevels),i.levels=A(t.customLevels,i[y]),te(i)),typeof t.redact==`object`&&t.redact!==null||Array.isArray(t.redact)){i.redact=t.redact;let e=se(i.redact,M),n={stringify:e[x]};i[S]=M,i[w]=e,i[C]=n}if(typeof t.msgPrefix==`string`&&(i[T]=(this[T]||``)+t.msgPrefix),i[s]=re(i,e),t.level!==void 0&&t.level!==this.level||t.hasOwnProperty(`customLevels`)){let e=t.level||this.level;i[a](e)}return this.onChild(i),i}function ce(){let e=`{${this[s].substr(1)}}`,t=JSON.parse(e);return delete t.pid,delete t.hostname,t}function le(e){let t=re(this,e);this[s]=t}function ue(e,t){return Object.assign(t,e)}function I(e,t,n){let r=this[f](),i=this[c],a=this[_],o=this[v],s=this[d]||ue,u,h=this[E].streamWrite;e==null?u={}:e instanceof Error?(u={[a]:e},t===void 0&&(t=e.message)):(u=e,t===void 0&&e[o]===void 0&&e[a]&&(t=e[a].message)),i&&(u=s(u,i(u,n,this)));let g=this[l](u,t,n,r),y=this[m];y[b]===!0&&(y.lastLevel=n,y.lastObj=u,y.lastMsg=t,y.lastTime=r.slice(this[p]),y.lastLogger=this),y.write(h?h(g):g)}function de(e){if(e!=null&&typeof e!=`function`)throw Error(`callback must be a function`);let t=this[m];typeof t.flush==`function`?t.flush(e||ae):e&&e()}})),Ql=/* @__PURE__ */ L(((e,t)=>{let{hasOwnProperty:n}=Object.prototype,r=_();r.configure=_,r.stringify=r,r.default=r,e.stringify=r,e.configure=_,t.exports=r;let i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function a(e){return e.length<5e3&&!i.test(e)?`"${e}"`:JSON.stringify(e)}function o(e,t){if(e.length>200||t)return e.sort(t);for(let t=1;t<e.length;t++){let n=e[t],r=t;for(;r!==0&&e[r-1]>n;)e[r]=e[r-1],r--;e[r]=n}return e}let s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(/* @__PURE__ */ new Int8Array)),Symbol.toStringTag).get;function c(e){return s.call(e)!==void 0&&e.length!==0}function l(e,t,n){e.length<n&&(n=e.length);let r=t===`,`?``:` `,i=`"0":${r}${e[0]}`;for(let a=1;a<n;a++)i+=`${t}"${a}":${r}${e[a]}`;return i}function u(e){if(n.call(e,`circularValue`)){let t=e.circularValue;if(typeof t==`string`)return`"${t}"`;if(t==null)return t;if(t===Error||t===TypeError)return{toString(){throw TypeError(`Converting circular structure to JSON`)}};throw TypeError(`The "circularValue" argument must be of type string or the value null or undefined`)}return`"[Circular]"`}function d(e){let t;if(n.call(e,`deterministic`)&&(t=e.deterministic,typeof t!=`boolean`&&typeof t!=`function`))throw TypeError(`The "deterministic" argument must be of type boolean or comparator function`);return t===void 0||t}function f(e,t){let r;if(n.call(e,t)&&(r=e[t],typeof r!=`boolean`))throw TypeError(`The "${t}" argument must be of type boolean`);return r===void 0||r}function p(e,t){let r;if(n.call(e,t)){if(r=e[t],typeof r!=`number`)throw TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(r))throw TypeError(`The "${t}" argument must be an integer`);if(r<1)throw RangeError(`The "${t}" argument must be >= 1`)}return r===void 0?1/0:r}function m(e){return e===1?`1 item`:`${e} items`}function h(e){let t=/* @__PURE__ */ new Set;for(let n of e)(typeof n==`string`||typeof n==`number`)&&t.add(String(n));return t}function g(e){if(n.call(e,`strict`)){let t=e.strict;if(typeof t!=`boolean`)throw TypeError(`The "strict" argument must be of type boolean`);if(t)return e=>{let t=`Object can not safely be stringified. Received type ${typeof e}`;throw typeof e!=`function`&&(t+=` (${e.toString()})`),Error(t)}}}function _(e){e={...e};let t=g(e);t&&(e.bigint===void 0&&(e.bigint=!1),`circularValue`in e||(e.circularValue=Error));let n=u(e),r=f(e,`bigint`),i=d(e),s=typeof i==`function`?i:void 0,_=p(e,`maximumDepth`),v=p(e,`maximumBreadth`);function y(e,l,u,d,f,p){let h=l[e];switch(typeof h==`object`&&h&&typeof h.toJSON==`function`&&(h=h.toJSON(e)),h=d.call(l,e,h),typeof h){case`string`:return a(h);case`object`:{if(h===null)return`null`;if(u.indexOf(h)!==-1)return n;let e=``,t=`,`,r=p;if(Array.isArray(h)){if(h.length===0)return`[]`;if(_<u.length+1)return`"[Array]"`;u.push(h),f!==``&&(p+=f,e+=`\n${p}`,t=`,\n${p}`);let n=Math.min(h.length,v),i=0;for(;i<n-1;i++){let n=y(String(i),h,u,d,f,p);e+=n===void 0?`null`:n,e+=t}let a=y(String(i),h,u,d,f,p);if(e+=a===void 0?`null`:a,h.length-1>v){let n=h.length-v-1;e+=`${t}"... ${m(n)} not stringified"`}return f!==``&&(e+=`\n${r}`),u.pop(),`[${e}]`}let l=Object.keys(h),g=l.length;if(g===0)return`{}`;if(_<u.length+1)return`"[Object]"`;let b=``,x=``;f!==``&&(p+=f,t=`,\n${p}`,b=` `);let S=Math.min(g,v);i&&!c(h)&&(l=o(l,s)),u.push(h);for(let n=0;n<S;n++){let r=l[n],i=y(r,h,u,d,f,p);i!==void 0&&(e+=`${x}${a(r)}:${b}${i}`,x=t)}if(g>v){let n=g-v;e+=`${x}"...":${b}"${m(n)} not stringified"`,x=t}return f!==``&&x.length>1&&(e=`\n${p}${e}\n${r}`),u.pop(),`{${e}}`}case`number`:return isFinite(h)?String(h):t?t(h):`null`;case`boolean`:return h===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(h);default:return t?t(h):void 0}}function b(e,i,o,s,c,l){switch(typeof i==`object`&&i&&typeof i.toJSON==`function`&&(i=i.toJSON(e)),typeof i){case`string`:return a(i);case`object`:{if(i===null)return`null`;if(o.indexOf(i)!==-1)return n;let e=l,t=``,r=`,`;if(Array.isArray(i)){if(i.length===0)return`[]`;if(_<o.length+1)return`"[Array]"`;o.push(i),c!==``&&(l+=c,t+=`\n${l}`,r=`,\n${l}`);let n=Math.min(i.length,v),a=0;for(;a<n-1;a++){let e=b(String(a),i[a],o,s,c,l);t+=e===void 0?`null`:e,t+=r}let u=b(String(a),i[a],o,s,c,l);if(t+=u===void 0?`null`:u,i.length-1>v){let e=i.length-v-1;t+=`${r}"... ${m(e)} not stringified"`}return c!==``&&(t+=`\n${e}`),o.pop(),`[${t}]`}o.push(i);let u=``;c!==``&&(l+=c,r=`,\n${l}`,u=` `);let d=``;for(let e of s){let n=b(e,i[e],o,s,c,l);n!==void 0&&(t+=`${d}${a(e)}:${u}${n}`,d=r)}return c!==``&&d.length>1&&(t=`\n${l}${t}\n${e}`),o.pop(),`{${t}}`}case`number`:return isFinite(i)?String(i):t?t(i):`null`;case`boolean`:return i===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(i);default:return t?t(i):void 0}}function x(e,u,d,f,p){switch(typeof u){case`string`:return a(u);case`object`:{if(u===null)return`null`;if(typeof u.toJSON==`function`){if(u=u.toJSON(e),typeof u!=`object`)return x(e,u,d,f,p);if(u===null)return`null`}if(d.indexOf(u)!==-1)return n;let t=p;if(Array.isArray(u)){if(u.length===0)return`[]`;if(_<d.length+1)return`"[Array]"`;d.push(u),p+=f;let e=`\n${p}`,n=`,\n${p}`,r=Math.min(u.length,v),i=0;for(;i<r-1;i++){let t=x(String(i),u[i],d,f,p);e+=t===void 0?`null`:t,e+=n}let a=x(String(i),u[i],d,f,p);if(e+=a===void 0?`null`:a,u.length-1>v){let t=u.length-v-1;e+=`${n}"... ${m(t)} not stringified"`}return e+=`\n${t}`,d.pop(),`[${e}]`}let r=Object.keys(u),h=r.length;if(h===0)return`{}`;if(_<d.length+1)return`"[Object]"`;p+=f;let g=`,\n${p}`,y=``,b=``,S=Math.min(h,v);c(u)&&(y+=l(u,g,v),r=r.slice(u.length),S-=u.length,b=g),i&&(r=o(r,s)),d.push(u);for(let e=0;e<S;e++){let t=r[e],n=x(t,u[t],d,f,p);n!==void 0&&(y+=`${b}${a(t)}: ${n}`,b=g)}if(h>v){let e=h-v;y+=`${b}"...": "${m(e)} not stringified"`,b=g}return b!==``&&(y=`\n${p}${y}\n${t}`),d.pop(),`{${y}}`}case`number`:return isFinite(u)?String(u):t?t(u):`null`;case`boolean`:return u===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(u);default:return t?t(u):void 0}}function S(e,u,d){switch(typeof u){case`string`:return a(u);case`object`:{if(u===null)return`null`;if(typeof u.toJSON==`function`){if(u=u.toJSON(e),typeof u!=`object`)return S(e,u,d);if(u===null)return`null`}if(d.indexOf(u)!==-1)return n;let t=``,r=u.length!==void 0;if(r&&Array.isArray(u)){if(u.length===0)return`[]`;if(_<d.length+1)return`"[Array]"`;d.push(u);let e=Math.min(u.length,v),n=0;for(;n<e-1;n++){let e=S(String(n),u[n],d);t+=e===void 0?`null`:e,t+=`,`}let r=S(String(n),u[n],d);if(t+=r===void 0?`null`:r,u.length-1>v){let e=u.length-v-1;t+=`,"... ${m(e)} not stringified"`}return d.pop(),`[${t}]`}let f=Object.keys(u),p=f.length;if(p===0)return`{}`;if(_<d.length+1)return`"[Object]"`;let h=``,g=Math.min(p,v);r&&c(u)&&(t+=l(u,`,`,v),f=f.slice(u.length),g-=u.length,h=`,`),i&&(f=o(f,s)),d.push(u);for(let e=0;e<g;e++){let n=f[e],r=S(n,u[n],d);r!==void 0&&(t+=`${h}${a(n)}:${r}`,h=`,`)}if(p>v){let e=p-v;t+=`${h}"...":"${m(e)} not stringified"`}return d.pop(),`{${t}}`}case`number`:return isFinite(u)?String(u):t?t(u):`null`;case`boolean`:return u===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(u);default:return t?t(u):void 0}}function C(e,t,n){if(arguments.length>1){let r=``;if(typeof n==`number`?r=` `.repeat(Math.min(n,10)):typeof n==`string`&&(r=n.slice(0,10)),t!=null){if(typeof t==`function`)return y(``,{"":e},[],t,r,``);if(Array.isArray(t))return b(``,e,[],h(t),r,``)}if(r.length!==0)return x(``,e,[],r,``)}return S(``,e,[])}return C}})),$l=/* @__PURE__ */ L(((e,t)=>{let n=Symbol.for(`pino.metadata`),{DEFAULT_LEVELS:r}=Jl(),i=r.info;function a(e,t){return e.level-t.level}function o(e,t){return t?e-1:0}function s(e,t){return t?e-1:e+1}function c(e,t,n){return n?e>=0:e<t}t.exports=function(e,t){e||=[],t||={dedupe:!1};let l=Object.create(r);l.silent=1/0,t.levels&&typeof t.levels==`object`&&Object.keys(t.levels).forEach(e=>{l[e]=t.levels[e]});let u={write:d,add:m,remove:h,emit:f,flushSync:p,end:g,minLevel:0,lastId:0,streams:[],clone:_,[n]:!0,streamLevels:l};return Array.isArray(e)?e.forEach(m,u):m.call(u,e),e=null,u;function d(e){let r,i=typeof this.lastLevel==`string`?(this.streamLevels||l)[this.lastLevel]:this.lastLevel,{streams:a}=this,u=0,d;for(let l=o(a.length,t.dedupe);c(l,a.length,t.dedupe);l=s(l,t.dedupe))if(r=a[l],r.level<=i){if(u!==0&&u!==r.level)break;if(d=r.stream,d[n]){let{lastTime:e,lastMsg:t,lastObj:n,lastLogger:r}=this;d.lastLevel=i,d.lastTime=e,d.lastMsg=t,d.lastObj=n,d.lastLogger=r}d.write(e),t.dedupe&&(u=r.level)}else if(!t.dedupe)break}function f(...e){for(let{stream:t}of this.streams)typeof t.emit==`function`&&t.emit(...e)}function p(){for(let{stream:e}of this.streams)typeof e.flushSync==`function`&&e.flushSync()}function m(e){if(!e)return this;let t=typeof e.write==`function`||e.stream,n=e.write?e:e.stream;if(!t)throw Error(`stream object needs to implement either StreamEntry or DestinationStream interface`);let{streams:r,streamLevels:o}=this,s;s=typeof e.levelVal==`number`?e.levelVal:typeof e.level==`string`?o[e.level]:typeof e.level==`number`?e.level:i;let c={stream:n,level:s,levelVal:void 0,id:++u.lastId};return r.unshift(c),r.sort(a),this.minLevel=r[0].level,this}function h(e){let{streams:t}=this,n=t.findIndex(t=>t.id===e);return n>=0&&(t.splice(n,1),t.sort(a),this.minLevel=t.length>0?t[0].level:-1),this}function g(){for(let{stream:e}of this.streams)typeof e.flushSync==`function`&&e.flushSync(),e.end()}function _(e){let t=Array(this.streams.length);for(let n=0;n<t.length;n++)t[n]={level:e,stream:this.streams[n].stream};return{write:d,add:m,remove:h,emit:f,flushSync:p,end:g,minLevel:e,streams:t,clone:_,[n]:!0,streamLevels:l}}}})),eu=/* @__PURE__ */ pe((/* @__PURE__ */ L(((e,t)=>{let n=z(`node:os`),r=Ml(),i=Nl(),a=Il(),o=Ll(),s=Zl(),c=Fl(),{configure:l}=Ql(),{assertDefaultLevelFound:u,mappings:d,genLsCache:f,genLevelComparison:p,assertLevelComparison:m}=Yl(),{DEFAULT_LEVELS:h,SORTING_ORDER:g}=Jl(),{createArgsNormalizer:_,asChindings:v,buildSafeSonicBoom:y,buildFormatters:b,stringify:x,normalizeDestFileDescriptor:S,noop:C}=ql(),{version:w}=Xl(),{chindingsSym:T,redactFmtSym:E,serializersSym:D,timeSym:O,timeSliceIndexSym:k,streamSym:A,stringifySym:ee,stringifySafeSym:te,stringifiersSym:ne,setLevelSym:re,endSym:ie,formatOptsSym:j,messageKeySym:M,errorKeySym:ae,nestedKeySym:oe,mixinSym:se,levelCompSym:N,useOnlyCustomLevelsSym:P,formattersSym:F,hooksSym:ce,nestedKeyStrSym:le,mixinMergeStrategySym:ue,msgPrefixSym:I,transportUsesMultistreamSym:de}=c,{epochTime:fe,nullTime:pe}=o,{pid:L}=process,R=n.hostname(),me=r.err,he=_({level:`info`,levelComparison:g.ASC,levels:h,messageKey:`msg`,errorKey:`err`,nestedKey:null,enabled:!0,base:{pid:L,hostname:R},serializers:Object.assign(Object.create(null),{err:me}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:fe,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100}),ge=Object.assign(Object.create(null),r);function _e(...e){let t={},{opts:n,stream:r}=he(t,i(),...e);n.level&&typeof n.level==`string`&&h[n.level.toLowerCase()]!==void 0&&(n.level=n.level.toLowerCase());let{redact:o,crlf:c,serializers:g,timestamp:_,messageKey:y,errorKey:S,nestedKey:w,base:L,name:R,level:me,customLevels:z,levelComparison:ge,mixin:_e,mixinMergeStrategy:ve,useOnlyCustomLevels:ye,formatters:be,hooks:xe,depthLimit:Se,edgeLimit:Ce,onChild:we,msgPrefix:Te}=n,Ee=l({maximumDepth:Se,maximumBreadth:Ce}),De=b(be.level,be.bindings,be.log),Oe=x.bind({[te]:Ee}),ke=o?Object.assign(Object.create(null),a(o,Oe)):Object.create(null),Ae=o?{stringify:ke[E]}:{stringify:Oe},je=`}`+(c?`\r
128
128
  `:`
129
- `),Me=v.bind(null,{[T]:``,[D]:g,[ne]:ke,[ee]:x,[te]:Ee,[F]:De}),Ne=``;L!==null&&(Ne=Me(R===void 0?L:Object.assign({},L,{name:R})));let Pe=_ instanceof Function?_:_?fe:pe,Fe=Pe().indexOf(`:`)+1;if(ye&&!z)throw Error(`customLevels is required if useOnlyCustomLevels is set true`);if(_e&&typeof _e!=`function`)throw Error(`Unknown mixin type "${typeof _e}" - expected "function"`);if(Te&&typeof Te!=`string`)throw Error(`Unknown msgPrefix type "${typeof Te}" - expected "string"`);u(me,z,ye);let Ie=d(z,ye);if(r&&r[de]===!0){let e=typeof me==`string`?me:void 0;e&&Ie[e]!==void 0||(e=Object.keys(Ie)[0]);let t=Ie[e],n=!1;try{let r=be.level(e,t);n=r&&typeof r==`object`&&r.level===t}catch{n=!1}n||process.emitWarning(`custom formatters.level detected with multiple transport targets/pipelines; ensure logs include a numeric "level" field or they may be dropped`,{code:`PINO_TRANSPORT_MULTI_TARGETS_LEVEL_FORMATTER`})}typeof r.emit==`function`&&r.emit(`message`,{code:`PINO_CONFIG`,config:{levels:Ie,messageKey:y,errorKey:S}}),m(ge);let Le=p(ge);return Object.assign(t,{levels:Ie,[N]:Le,[P]:ye,[A]:r,[O]:Pe,[k]:Fe,[ee]:x,[te]:Ee,[ne]:ke,[ie]:je,[j]:Ae,[M]:y,[ae]:S,[oe]:w,[le]:w?`,${JSON.stringify(w)}:{`:``,[D]:g,[se]:_e,[ue]:ve,[T]:Ne,[F]:De,[ce]:xe,silent:C,onChild:we,[I]:Te}),Object.setPrototypeOf(t,s()),f(t),t[re](me),t}t.exports=_e,t.exports.destination=(e=process.stdout.fd)=>typeof e==`object`?(e.dest=S(e.dest||process.stdout.fd),y(e)):y({dest:S(e),minLength:0}),t.exports.transport=Kl(),t.exports.multistream=$l(),t.exports.levels=d(),t.exports.stdSerializers=ge,t.exports.stdTimeFunctions=Object.assign({},o),t.exports.symbols=c,t.exports.version=w,t.exports.default=_e,t.exports.pino=_e})))(),1);function tu(e){return{level:e}}function nu(){return`,"time":"${(/* @__PURE__ */ new Date()).toISOString()}"`}let ru={minLevel:`info`,enableConsole:!0,autoTracing:!1,pinoOptions:{level:`info`,base:{},formatters:{level:tu},timestamp:nu}},iu=0;function au(e){ru=e,iu+=1}function ou(){return ru}function su(){return iu}const cu={debug:`debug`,info:`info`,warn:`warn`,error:`error`};function lu(e){return{level:e}}function uu(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function du(){return`,"time":"${(/* @__PURE__ */ new Date()).toISOString()}"`}const fu={minLevel:`info`,enableConsole:!0,autoTracing:!1,pinoOptions:{level:`info`,formatters:{level:lu},timestamp:du}};var pu=class e{context;config;hasExplicitConfig;builtConfigVersion;pinoLogger;constructor(e,t={},n,r){this.context={module:e,operation:n,trace:r};let i=Object.keys(t).length===0,a=t===ou();this.hasExplicitConfig=!i&&!a,this.config=this.hasExplicitConfig?{...fu,...t}:{...fu,...ou()},this.builtConfigVersion=su(),this.pinoLogger=this.buildPinoLogger(this.config)}buildPinoLogger(e){let t={...e.pinoOptions,level:e.minLevel},n=e.pinoOptions?.base;return t.base={...uu(n)?n:{},module:this.context.module},e.transport&&(t.transport=e.transport),e.stream&&!e.transport?(0,eu.default)(t,e.stream):(0,eu.default)(t)}getActivePinoLogger(){if(this.hasExplicitConfig)return this.pinoLogger;let e=su();return e!==this.builtConfigVersion&&(this.config.minLevel=ou().minLevel??fu.minLevel,this.config.transport=ou().transport,this.config.stream=ou().stream,this.pinoLogger=this.buildPinoLogger(this.config),this.builtConfigVersion=e),this.pinoLogger}debug(e,t){this.log(`debug`,e,t)}info(e,t){this.log(`info`,e,t)}warn(e,t){this.log(`warn`,e,t)}error(e,t,n){let r=t===void 0?void 0:gl(t);this.log(`error`,e,n,r)}withOperation(t){return this.hasExplicitConfig?new e(this.context.module,this.config,t,this.context.trace):new e(this.context.module,{},t,this.context.trace)}withTrace(t){return this.hasExplicitConfig?new e(this.context.module,this.config,this.context.operation,t):new e(this.context.module,{},this.context.operation,t)}flush(){return new Promise(e=>{this.getActivePinoLogger().flush(()=>e())})}log(e,t,n,r){if(!this.shouldLog(e))return;let i={...n},a=this.context.operation;a&&(i.operation=a);let o=this.context.trace;if(o&&(i.traceId=o.traceId,i.spanId=o.spanId),r){let e=xl(r).slice(1);i.error={name:r.name,message:r.message,stack:r.stack,...e.length>0?{causeChain:e}:{}}}let s=cu[e],c=`[${this.context.module}${a?`:${a}`:``}] ${t}`;Object.keys(i).length>0?this.getActivePinoLogger()[s](i,c):this.getActivePinoLogger()[s](c)}shouldLog(e){let t=Cl[e],n=this.hasExplicitConfig?this.config.minLevel:ou().minLevel??fu.minLevel;return t>=Cl[n]}getPinoLogger(){return this.getActivePinoLogger()}};function mu(e){return new pu(e,ou())}mu(`App`);const hu=new t;var gu=class{getCurrentContext(){return hu.getStore()}getCurrentTraceId(){return hu.getStore()?.traceId}getCurrentSpanId(){return hu.getStore()?.spanId}createNewContext(){return{traceId:wl(),spanId:Tl()}}createChildContext(e){return{traceId:e.traceId,spanId:Tl(),parentSpanId:e.spanId}}runWithContext(e,t){return hu.run(e,t)}runWithNewTrace(e){let t=this.createNewContext();return hu.run(t,e)}runWithChildSpan(e){let t=this.getCurrentContext();if(!t)return this.runWithNewTrace(e);let n=this.createChildContext(t);return hu.run(n,e)}};let _u;function vu(e){_u=e}function yu(){return _u?.getCurrentContext()}function bu(){return new gu}var xu=/* @__PURE__ */ L((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=z(`tty`);function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if(n!=="default"){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var r=/*#__PURE__*/ n(t);let{env:i={},argv:a=[],platform:o=``}=typeof process>`u`?{}:process,s=`NO_COLOR`in i||a.includes(`--no-color`),c=`FORCE_COLOR`in i||a.includes(`--color`),l=o===`win32`,u=i.TERM===`dumb`,d=r&&r.isatty&&r.isatty(1)&&i.TERM&&!u,f=`CI`in i&&(`GITHUB_ACTIONS`in i||`GITLAB_CI`in i||`CIRCLECI`in i),p=!s&&(c||l&&!u||d||f),m=(e,t,n,r,i=t.substring(0,e)+r,a=t.substring(e+n.length),o=a.indexOf(n))=>i+(o<0?a:m(o,a,n,r)),h=(e,t,n,r,i)=>e<0?n+t+r:n+m(e,t,r,i)+r,g=(e,t,n=e,r=e.length+1)=>i=>i||i!==``&&i!==void 0?h((``+i).indexOf(t,r),i,e,t,n):``,_=(e,t,n)=>g(`\x1b[${e}m`,`\x1b[${t}m`,n),v={reset:_(0,0),bold:_(1,22,`\x1B[22m\x1B[1m`),dim:_(2,22,`\x1B[22m\x1B[2m`),italic:_(3,23),underline:_(4,24),inverse:_(7,27),hidden:_(8,28),strikethrough:_(9,29),black:_(30,39),red:_(31,39),green:_(32,39),yellow:_(33,39),blue:_(34,39),magenta:_(35,39),cyan:_(36,39),white:_(37,39),gray:_(90,39),bgBlack:_(40,49),bgRed:_(41,49),bgGreen:_(42,49),bgYellow:_(43,49),bgBlue:_(44,49),bgMagenta:_(45,49),bgCyan:_(46,49),bgWhite:_(47,49),blackBright:_(90,39),redBright:_(91,39),greenBright:_(92,39),yellowBright:_(93,39),blueBright:_(94,39),magentaBright:_(95,39),cyanBright:_(96,39),whiteBright:_(97,39),bgBlackBright:_(100,49),bgRedBright:_(101,49),bgGreenBright:_(102,49),bgYellowBright:_(103,49),bgBlueBright:_(104,49),bgMagentaBright:_(105,49),bgCyanBright:_(106,49),bgWhiteBright:_(107,49)},y=({useColor:e=p}={})=>e?v:Object.keys(v).reduce((e,t)=>({...e,[t]:String}),{}),{reset:b,bold:x,dim:S,italic:C,underline:w,inverse:T,hidden:E,strikethrough:D,black:O,red:k,green:A,yellow:ee,blue:te,magenta:ne,cyan:re,white:ie,gray:j,bgBlack:M,bgRed:ae,bgGreen:oe,bgYellow:se,bgBlue:N,bgMagenta:P,bgCyan:F,bgWhite:ce,blackBright:le,redBright:ue,greenBright:I,yellowBright:de,blueBright:fe,magentaBright:pe,cyanBright:L,whiteBright:R,bgBlackBright:me,bgRedBright:he,bgGreenBright:ge,bgYellowBright:_e,bgBlueBright:ve,bgMagentaBright:ye,bgCyanBright:be,bgWhiteBright:xe}=y();e.bgBlack=M,e.bgBlackBright=me,e.bgBlue=N,e.bgBlueBright=ve,e.bgCyan=F,e.bgCyanBright=be,e.bgGreen=oe,e.bgGreenBright=ge,e.bgMagenta=P,e.bgMagentaBright=ye,e.bgRed=ae,e.bgRedBright=he,e.bgWhite=ce,e.bgWhiteBright=xe,e.bgYellow=se,e.bgYellowBright=_e,e.black=O,e.blackBright=le,e.blue=te,e.blueBright=fe,e.bold=x,e.createColors=y,e.cyan=re,e.cyanBright=L,e.dim=S,e.gray=j,e.green=A,e.greenBright=I,e.hidden=E,e.inverse=T,e.isColorSupported=p,e.italic=C,e.magenta=ne,e.magentaBright=pe,e.red=k,e.redBright=ue,e.reset=b,e.strikethrough=D,e.underline=w,e.white=ie,e.whiteBright=R,e.yellow=ee,e.yellowBright=de})),Su=/* @__PURE__ */ L(((e,t)=>{t.exports=n;function n(e,t){if(e&&t)return n(e)(t);if(typeof e!=`function`)throw TypeError(`need wrapper function`);return Object.keys(e).forEach(function(t){r[t]=e[t]}),r;function r(){for(var t=Array(arguments.length),n=0;n<t.length;n++)t[n]=arguments[n];var r=e.apply(this,t),i=t[t.length-1];return typeof r==`function`&&r!==i&&Object.keys(i).forEach(function(e){r[e]=i[e]}),r}}})),Cu=/* @__PURE__ */ L(((e,t)=>{var n=Su();t.exports=n(r),t.exports.strict=n(i),r.proto=r(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return r(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return i(this)},configurable:!0})});function r(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function i(e){var t=function(){if(t.called)throw Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)};return t.onceError=(e.name||"Function wrapped with `once`")+` shouldn't be called more than once`,t.called=!1,t}})),wu=/* @__PURE__ */ L(((e,t)=>{var n=Cu(),r=function(){},i=global.Bare?queueMicrotask:process.nextTick.bind(process),a=function(e){return e.setHeader&&typeof e.abort==`function`},o=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},s=function(e,t,c){if(typeof t==`function`)return s(e,null,t);t||={},c=n(c||r);var l=e._writableState,u=e._readableState,d=t.readable||t.readable!==!1&&e.readable,f=t.writable||t.writable!==!1&&e.writable,p=!1,m=function(){e.writable||h()},h=function(){f=!1,d||c.call(e)},g=function(){d=!1,f||c.call(e)},_=function(t){c.call(e,t?/* @__PURE__ */ Error(`exited with error code: `+t):null)},v=function(t){c.call(e,t)},y=function(){i(b)},b=function(){if(!p&&(d&&!(u&&u.ended&&!u.destroyed)||f&&!(l&&l.ended&&!l.destroyed)))return c.call(e,/* @__PURE__ */ Error(`premature close`))},x=function(){e.req.on(`finish`,h)};return a(e)?(e.on(`complete`,h),e.on(`abort`,y),e.req?x():e.on(`request`,x)):f&&!l&&(e.on(`end`,m),e.on(`close`,m)),o(e)&&e.on(`exit`,_),e.on(`end`,g),e.on(`finish`,h),t.error!==!1&&e.on(`error`,v),e.on(`close`,y),function(){p=!0,e.removeListener(`complete`,h),e.removeListener(`abort`,y),e.removeListener(`request`,x),e.req&&e.req.removeListener(`finish`,h),e.removeListener(`end`,m),e.removeListener(`close`,m),e.removeListener(`finish`,h),e.removeListener(`exit`,_),e.removeListener(`end`,g),e.removeListener(`error`,v),e.removeListener(`close`,y)}};t.exports=s})),Tu=/* @__PURE__ */ L(((e,t)=>{var n=Cu(),r=wu(),i;try{i=z(`fs`)}catch{}var a=function(){},o=typeof process>`u`?!1:/^v?\.0/.test(process.version),s=function(e){return typeof e==`function`},c=function(e){return!o||!i?!1:(e instanceof(i.ReadStream||a)||e instanceof(i.WriteStream||a))&&s(e.close)},l=function(e){return e.setHeader&&s(e.abort)},u=function(e,t,i,o){o=n(o);var u=!1;e.on(`close`,function(){u=!0}),r(e,{readable:t,writable:i},function(e){if(e)return o(e);u=!0,o()});var d=!1;return function(t){if(!u&&!d){if(d=!0,c(e))return e.close(a);if(l(e))return e.abort();if(s(e.destroy))return e.destroy();o(t||/* @__PURE__ */ Error(`stream was destroyed`))}}},d=function(e){e()},f=function(e,t){return e.pipe(t)};t.exports=function(){var e=Array.prototype.slice.call(arguments),t=s(e[e.length-1]||a)&&e.pop()||a;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw Error(`pump requires two streams per minimum`);var n,r=e.map(function(i,a){var o=a<e.length-1;return u(i,o,a>0,function(e){n||=e,e&&r.forEach(d),o||(r.forEach(d),t(n))})});return e.reduce(f)}})),Eu=/* @__PURE__ */ L(((e,t)=>{let{Transform:n}=z(`stream`),{StringDecoder:r}=z(`string_decoder`),i=Symbol(`last`),a=Symbol(`decoder`);function o(e,t,n){let r;if(this.overflow){if(r=this[a].write(e).split(this.matcher),r.length===1)return n();r.shift(),this.overflow=!1}else this[i]+=this[a].write(e),r=this[i].split(this.matcher);this[i]=r.pop();for(let e=0;e<r.length;e++)try{c(this,this.mapper(r[e]))}catch(e){return n(e)}this.overflow=this[i].length>this.maxLength,this.overflow&&!this.skipOverflow?n(/* @__PURE__ */ Error(`maximum buffer reached`)):n()}function s(e){if(this[i]+=this[a].end(),this[i])try{c(this,this.mapper(this[i]))}catch(t){return e(t)}e()}function c(e,t){t!==void 0&&e.push(t)}function l(e){return e}t.exports=function(e,t,c){switch(e||=/\r?\n/,t||=l,c||={},arguments.length){case 1:typeof e==`function`?(t=e,e=/\r?\n/):typeof e==`object`&&!(e instanceof RegExp)&&!e[Symbol.split]&&(c=e,e=/\r?\n/);break;case 2:typeof e==`function`?(c=t,t=e,e=/\r?\n/):typeof t==`object`&&(c=t,t=l)}c=Object.assign({},c),c.autoDestroy=!0,c.transform=o,c.flush=s,c.readableObjectMode=!0;let u=new n(c);return u[i]=``,u[a]=new r(`utf8`),u.matcher=e,u.mapper=t,u.maxLength=c.maxLength,u.skipOverflow=c.skipOverflow||!1,u.overflow=!1,u._destroy=function(e,t){this._writableState.errorEmitted=!1,t(e)},u}})),Du=/* @__PURE__ */ L(((e,t)=>{let n=Symbol.for(`pino.metadata`),r=Eu(),{Duplex:i}=z(`stream`),{parentPort:a,workerData:o}=z(`worker_threads`);function s(){let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}t.exports=function(e,t={}){let l=t.expectPinoConfig===!0&&o?.workerData?.pinoWillSendConfig===!0,u=t.parse===`lines`,d=typeof t.parseLine==`function`?t.parseLine:JSON.parse,f=t.close||c,p=r(function(e){let t;try{t=d(e)}catch(t){this.emit(`unknown`,e,t);return}if(t===null)this.emit(`unknown`,e,`Null value ignored`);else return typeof t!=`object`&&(t={data:t,time:Date.now()}),p[n]&&(p.lastTime=t.time,p.lastLevel=t.level,p.lastObj=t),u?e:t},{autoDestroy:!0});if(p._destroy=function(e,t){let n=f(e,t);n&&typeof n.then==`function`&&n.then(t,t)},t.expectPinoConfig===!0&&o?.workerData?.pinoWillSendConfig!==!0&&setImmediate(()=>{p.emit(`error`,/* @__PURE__ */ Error(`This transport is not compatible with the current version of pino. Please upgrade pino to the latest version.`))}),t.metadata!==!1&&(p[n]=!0,p.lastTime=0,p.lastLevel=0,p.lastObj=null),l){let e={},t=s();return a.on(`message`,function n(r){r.code===`PINO_CONFIG`&&(e=r.config,t.resolve(),a.off(`message`,n))}),Object.defineProperties(p,{levels:{get(){return e.levels}},messageKey:{get(){return e.messageKey}},errorKey:{get(){return e.errorKey}}}),t.then(m)}return m();function m(){let n=e(p);if(n&&typeof n.catch==`function`)n.catch(e=>{p.destroy(e)}),n=null;else if(t.enablePipelining&&n)return i.from({writable:p,readable:n});return p}};function c(e,t){process.nextTick(t,e)}})),Ou=/* @__PURE__ */ L(((e,t)=>{t.exports={DATE_FORMAT:`yyyy-mm-dd HH:MM:ss.l o`,DATE_FORMAT_SIMPLE:`HH:MM:ss.l`,ERROR_LIKE_KEYS:[`err`,`error`],MESSAGE_KEY:`msg`,LEVEL_KEY:`level`,LEVEL_LABEL:`levelLabel`,TIMESTAMP_KEY:`time`,LEVELS:{default:`USERLVL`,60:`FATAL`,50:`ERROR`,40:`WARN`,30:`INFO`,20:`DEBUG`,10:`TRACE`},LEVEL_NAMES:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},LOGGER_KEYS:[`pid`,`hostname`,`name`,`level`,`time`,`timestamp`,`caller`]}})),ku=/* @__PURE__ */ L(((e,t)=>{t.exports=i;let{LEVELS:n,LEVEL_NAMES:r}=Ou();function i(e,t,i){let a=e?t||n:Object.assign({},n,t),o=e?i||r:Object.assign({},r,i);return function(e){let t=`default`;return t=Number.isInteger(+e)?Object.prototype.hasOwnProperty.call(a,e)?e:t:Object.prototype.hasOwnProperty.call(o,e.toLowerCase())?o[e.toLowerCase()]:t,[a[t],t]}}})),Au=/* @__PURE__ */ L(((e,t)=>{let n=e=>e,r={default:n,60:n,50:n,40:n,30:n,20:n,10:n,message:n,greyMessage:n,property:n},{createColors:i}=xu(),a=ku(),o=i({useColor:!0}),{white:s,bgRed:c,red:l,yellow:u,green:d,blue:f,gray:p,cyan:m,magenta:h}=o,g={default:s,60:c,50:l,40:u,30:d,20:f,10:p,message:m,greyMessage:p,property:h};function _(e){return e.reduce(function(e,[t,n]){return e[t]=typeof o[n]==`function`?o[n]:s,e},{default:s,message:m,greyMessage:p,property:h})}function v(e){return function(t,n,{customLevels:r,customLevelNames:i}={}){let[o,s]=a(e,r,i)(t);return Object.prototype.hasOwnProperty.call(n,s)?n[s](o):n.default(o)}}function y(e){let t=v(e),n=function(e,n){return t(e,r,n)};return n.message=r.message,n.greyMessage=r.greyMessage,n.property=r.property,n.colors=i({useColor:!1}),n}function b(e){let t=v(e),n=function(e,n){return t(e,g,n)};return n.message=g.message,n.property=g.property,n.greyMessage=g.greyMessage,n.colors=o,n}function x(e,t){let n=_(e),r=t?n:Object.assign({},g,n),i=v(t),a=function(e,t){return i(e,r,t)};return a.colors=o,a.message=a.message||r.message,a.property=a.property||r.property,a.greyMessage=a.greyMessage||r.greyMessage,a}t.exports=function(e=!1,t,n){return e&&t!==void 0?x(t,n):e?b(n):y(n)}})),ju=/* @__PURE__ */ L(((e,t)=>{let n=z(`node:fs`),r=z(`node:events`),i=z(`node:util`).inherits,a=z(`node:path`),o=z(`node:assert`),s=zl(),c=Buffer.allocUnsafe(0),l=`buffer`,u=`utf8`,d=Symbol(`kFlush`);function f(e){switch(e?.code){case`EBADF`:case`EINVAL`:case`ENOTSUP`:case`EOPNOTSUPP`:case`EROFS`:return!0;default:return!1}}let[p,m]=(process.versions.node||`0.0`).split(`.`).map(Number),h=p>=22&&m>=7;function g(e,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function r(n,r){if(n){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount(`error`)>0&&t.emit(`error`,n)}):t.emit(`error`,n);return}let i=t._reopening;t.fd=r,t.file=e,t._reopening=!1,t._opening=!1,t._writing=!1,t.sync?process.nextTick(()=>t.emit(`ready`)):t.emit(`ready`),t.destroyed||(!t._writing&&(t._len>t.minLength||t._flushPending)?t._actualWrite():i&&!t._writing&&process.nextTick(b,t))}let i=t.append?`a`:`w`,o=t.mode;if(t.sync)try{t.mkdir&&n.mkdirSync(a.dirname(e),{recursive:!0}),r(null,n.openSync(e,i,o))}catch(e){throw r(e),e}else t.mkdir?n.mkdir(a.dirname(e),{recursive:!0},t=>{if(t)return r(t);n.open(e,i,o,r)}):n.open(e,i,o,r)}function _(e){if(!(this instanceof _))return new _(e);let{fd:t,dest:r,minLength:i,maxLength:a,maxWrite:o,periodicFlush:f,sync:p,append:m=!0,mkdir:h,retryEAGAIN:b,maxWriteRetries:x,fsync:C,contentMode:E,mode:k}=e||{};t||=r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=0,this._flushInProgress=0,this._emittingFlush=!1,this._emittingWrite=!1,this._retryTimer=null,this._hwm=Math.max(i||0,16387),this.file=null,this.destroyed=!1,this.minLength=i||0,this.maxLength=a||0,this.maxWrite=o||16384,this._periodicFlush=f||0,this._periodicFlushTimer=void 0,this.sync=p||!1,this.writable=!0,this._fsync=C||!1,this.append=m||!1,this.mode=k,this.retryEAGAIN=b||(()=>!0),this.maxWriteRetries=x||0,this._writeRetries=0,this.mkdir=h||!1;let A,ie;if(E===l)this._writingBuf=c,this.write=T,this.flush=O,this.flushSync=te,this._actualWrite=re,A=()=>n.writeSync(this.fd,this._writingBuf),ie=()=>n.write(this.fd,this._writingBuf,this.release);else if(E===void 0||E===u)this._writingBuf=``,this.write=w,this.flush=D,this.flushSync=ee,this._actualWrite=ne,A=()=>Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`),ie=()=>Buffer.isBuffer(this._writingBuf)?n.write(this.fd,this._writingBuf,this.release):n.write(this.fd,this._writingBuf,`utf8`,this.release);else throw Error(`SonicBoom supports "${u}" and "${l}", but passed ${E}`);if(typeof t==`number`)this.fd=t,process.nextTick(()=>this.emit(`ready`));else if(typeof t==`string`)g(t,this);else throw Error(`SonicBoom supports only file descriptors and files`);if(this.minLength>=this.maxWrite)throw Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(e,t)=>{if(e){let t=e.code===`EAGAIN`||e.code===`EBUSY`;t&&this._writeRetries++;let n=this.maxWriteRetries>0&&this._writeRetries>this.maxWriteRetries;if(t&&!n&&this.retryEAGAIN(e,this._writingBuf.length,this._len-this._writingBuf.length)){if(this.sync)try{s(100),this.release(void 0,0)}catch(e){this.release(e)}else this._retryTimer=setTimeout(()=>{this._retryTimer=null,ie()},100)}else this._writing=!1,this.emit(`error`,e);return}t>0&&(this._writeRetries=0);let r=v(this._writingBuf,this._len,t);this._len=r.len,this._writingBuf=r.writingBuf,this._emittingWrite=!0;try{this.emit(`write`,t)}finally{this._emittingWrite=!1}if(this.destroyed){this._writing=!1,this._flushPending>0&&(this._len===0?y(this):this.emit(d,/* @__PURE__ */ Error(`SonicBoom destroyed`)));return}if(this._writingBuf.length){if(!this.sync){ie();return}try{do{let e=A(),t=v(this._writingBuf,this._len,e);this._len=t.len,this._writingBuf=t.writingBuf}while(this._writingBuf.length)}catch(e){this.release(e);return}}this._fsync&&n.fsyncSync(this.fd);let i=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):i>0&&(i>this.minLength||this._flushPending)?this._actualWrite():this._ending?i>0?this._actualWrite():(this._writing=!1,S(this)):(this._writing=!1,y(this))},this.on(`newListener`,function(e){(e===`drain`||e===d)&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>{this._flushPending===0&&this._flushInProgress===0&&this.flush(null)},this._periodicFlush),this._periodicFlushTimer.unref())}function v(e,t,n){return typeof e==`string`&&(e=Buffer.from(e)),t=Math.max(t-n,0),e=e.subarray(n),{writingBuf:e,len:t}}function y(e){e.sync?e._asyncDrainScheduled||(e._asyncDrainScheduled=!0,process.nextTick(b,e)):b(e)}function b(e){(e.listenerCount(`drain`)>0||e.listenerCount(d)>0)&&(e._asyncDrainScheduled=!1,e._writing||(x(e),e._writing||e.destroyed||e.listenerCount(`drain`)>0&&e.emit(`drain`)))}function x(e){if(!e._emittingFlush){e._emittingFlush=!0;try{e.emit(d)}finally{e._emittingFlush=!1}}}function S(e){!e._ending||e._writing||e.destroyed||(e._len>0?e._actualWrite():(e._flushPending>0&&x(e),e._flushPending===0&&e._flushInProgress===0&&!e._writing&&e._len===0&&ie(e)))}i(_,r);function C(e,t){return e.length===0?c:e.length===1?e[0]:Buffer.concat(e,t)}function w(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);e=``+e;let t=Buffer.byteLength(e),n=this._len+t,r=this._bufs;return this.maxLength&&n>this.maxLength?(this.emit(`drop`,e),this._len<this._hwm):(r.length===0||Buffer.byteLength(r[r.length-1])+t>this.maxWrite?r.push(e):r[r.length-1]+=e,this._len=n,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function T(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);let t=this._len+e.length,n=this._bufs,r=this._lens;return this.maxLength&&t>this.maxLength?(this.emit(`drop`,e),this._len<this._hwm):(n.length===0||r[r.length-1]+e.length>this.maxWrite?(n.push([e]),r.push(e.length)):(n[n.length-1].push(e),r[r.length-1]+=e.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function E(e){this._flushPending++;let t=!0,r=!1,i=!1,a=()=>t?(t=!1,this.off(d,s),this.off(`error`,c),!0):!1,o=(t,n=!0)=>{if(!r){r=!0,i&&this._flushInProgress--;try{e(t)}finally{n&&S(this)}}},s=e=>{if(a()){if(this._flushPending--,e)o(e,!1);else if(this._flushInProgress++,i=!0,!this._fsync&&!this.destroyed)try{n.fsync(this.fd,e=>{f(e)?o():o(e)})}catch(e){o(e)}else o()}},c=e=>{a()&&(this._flushPending--,o(e,!1))};this.once(d,s),this.once(`error`,c)}function D(e){if(e!=null&&typeof e!=`function`)throw Error(`flush cb must be a function`);if(this.destroyed){let t=/* @__PURE__ */ Error(`SonicBoom destroyed`);if(e){e(t);return}throw t}this.minLength<=0&&!this._writing&&this._len===0?e?.():(e&&E.call(this,e),this._writing||(this._bufs.length===0&&this._bufs.push(``),this._actualWrite()))}function O(e){if(e!=null&&typeof e!=`function`)throw Error(`flush cb must be a function`);if(this.destroyed){let t=/* @__PURE__ */ Error(`SonicBoom destroyed`);if(e){e(t);return}throw t}this.minLength<=0&&!this._writing&&this._len===0?e?.():(e&&E.call(this,e),this._writing||(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite()))}_.prototype.reopen=function(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this._opening){this.once(`ready`,()=>{this.destroyed||this.reopen(e)});return}if(this._ending)return;if(!this.file)throw Error(`Unable to reopen a file descriptor, you must pass a file to SonicBoom`);if(e&&(this.file=e),this._reopening=!0,this._writing)return;let t=this.fd;this.once(`ready`,()=>{t!==this.fd&&n.close(t,e=>{if(e)return this.emit(`error`,e)})}),g(this.file,this)},_.prototype.end=function(){if(this.destroyed)throw Error(`SonicBoom destroyed`);this._opening?this.once(`ready`,()=>{this.destroyed||this.end()}):this._ending||(this._ending=!0,this._writing||(this._len>0&&this.fd>=0?this._actualWrite():S(this)))};function k(e){if(e.destroyed)throw Error(`SonicBoom destroyed`);if(e.fd<0)throw Error(`sonic boom is not ready yet`);return!e._writing||e._opening?0:e._retryTimer===null?e._emittingWrite?2:3:(clearTimeout(e._retryTimer),e._retryTimer=null,1)}function A(e){e._writing=!1,process.nextTick(()=>{e.destroyed||e._writing||(e._reopening?(e._reopening=!1,e.reopen()):e._ending?S(e):e._len>0&&(e._len>e.minLength||e._flushPending)?e._actualWrite():b(e))})}function ee(){let e=k(this);try{e!==3&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf=``);let t=``;for(;this._bufs.length||t.length;){t.length<=0&&(t=this._bufs[0]);try{let e=Buffer.isBuffer(t)?n.writeSync(this.fd,t):n.writeSync(this.fd,t,`utf8`);this._writeRetries=0;let r=v(t,this._len,e);t=r.writingBuf,this._len=r.len,t.length<=0&&this._bufs.shift()}catch(e){let n=e.code===`EAGAIN`||e.code===`EBUSY`;n&&this._writeRetries++;let r=this.maxWriteRetries>0&&this._writeRetries>this.maxWriteRetries;if(!n||r||!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;s(100)}}}finally{e===1&&A(this)}try{n.fsyncSync(this.fd)}catch{}}function te(){let e=k(this);try{e!==3&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._lens.unshift(this._writingBuf.length),this._writingBuf=c);let t=c;for(;this._bufs.length||t.length;){t.length<=0&&(t=C(this._bufs[0],this._lens[0]));try{let e=n.writeSync(this.fd,t);this._writeRetries=0,t=t.subarray(e),this._len=Math.max(this._len-e,0),t.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(e){let n=e.code===`EAGAIN`||e.code===`EBUSY`;n&&this._writeRetries++;let r=this.maxWriteRetries>0&&this._writeRetries>this.maxWriteRetries;if(!n||r||!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;s(100)}}}finally{e===1&&A(this)}}_.prototype.destroy=function(){if(this.destroyed)return;let e=this._opening;ie(this),e&&this._flushPending>0&&this.emit(`error`,/* @__PURE__ */ Error(`SonicBoom destroyed`))};function ne(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||``,this.sync)try{e(null,Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`))}catch(t){e(t)}else n.write(this.fd,this._writingBuf,e)}function re(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:C(this._bufs.shift(),this._lens.shift()),this.sync)try{e(null,n.writeSync(this.fd,this._writingBuf))}catch(t){e(t)}else h&&(this._writingBuf=Buffer.from(this._writingBuf)),n.write(this.fd,this._writingBuf,e)}function ie(e){if(e.destroyed)return;if(e.fd===-1){e.destroyed=!0,e.once(`ready`,()=>{e.destroyed=!1,ie(e)});return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],e._retryTimer!==null&&(clearTimeout(e._retryTimer),e._retryTimer=null,e._writing=!1),e._flushPending>0&&!e._writing&&e.emit(d,/* @__PURE__ */ Error(`SonicBoom destroyed`)),o(typeof e.fd==`number`,`sonic.fd must be a number, got ${typeof e.fd}`);try{n.fsync(e.fd,t)}catch{}function t(){e.fd!==1&&e.fd!==2?n.close(e.fd,r):r()}function r(t){t?e.emit(`error`,t):(e._ending&&!e._writing&&e.emit(`finish`),e.emit(`close`))}}_.SonicBoom=_,_.default=_,t.exports=_})),Mu=/* @__PURE__ */ L(((e,t)=>{t.exports=function(){}})),Nu=/* @__PURE__ */ L(((e,t)=>{t.exports=a;let{isMainThread:n}=z(`node:worker_threads`),r=ju(),i=Mu();function a(e){let t=new r(e);return t.on(`error`,a),!e.sync&&n&&o(t),t;function a(e){e.code===`EPIPE`?(t.write=i,t.end=i,t.flushSync=i,t.destroy=i):t.removeListener(`error`,a)}}function o(e){
129
+ `),Me=v.bind(null,{[T]:``,[D]:g,[ne]:ke,[ee]:x,[te]:Ee,[F]:De}),Ne=``;L!==null&&(Ne=Me(R===void 0?L:Object.assign({},L,{name:R})));let Pe=_ instanceof Function?_:_?fe:pe,Fe=Pe().indexOf(`:`)+1;if(ye&&!z)throw Error(`customLevels is required if useOnlyCustomLevels is set true`);if(_e&&typeof _e!=`function`)throw Error(`Unknown mixin type "${typeof _e}" - expected "function"`);if(Te&&typeof Te!=`string`)throw Error(`Unknown msgPrefix type "${typeof Te}" - expected "string"`);u(me,z,ye);let Ie=d(z,ye);if(r&&r[de]===!0){let e=typeof me==`string`?me:void 0;e&&Ie[e]!==void 0||(e=Object.keys(Ie)[0]);let t=Ie[e],n=!1;try{let r=be.level(e,t);n=r&&typeof r==`object`&&r.level===t}catch{n=!1}n||process.emitWarning(`custom formatters.level detected with multiple transport targets/pipelines; ensure logs include a numeric "level" field or they may be dropped`,{code:`PINO_TRANSPORT_MULTI_TARGETS_LEVEL_FORMATTER`})}typeof r.emit==`function`&&r.emit(`message`,{code:`PINO_CONFIG`,config:{levels:Ie,messageKey:y,errorKey:S}}),m(ge);let Le=p(ge);return Object.assign(t,{levels:Ie,[N]:Le,[P]:ye,[A]:r,[O]:Pe,[k]:Fe,[ee]:x,[te]:Ee,[ne]:ke,[ie]:je,[j]:Ae,[M]:y,[ae]:S,[oe]:w,[le]:w?`,${JSON.stringify(w)}:{`:``,[D]:g,[se]:_e,[ue]:ve,[T]:Ne,[F]:De,[ce]:xe,silent:C,onChild:we,[I]:Te}),Object.setPrototypeOf(t,s()),f(t),t[re](me),t}t.exports=_e,t.exports.destination=(e=process.stdout.fd)=>typeof e==`object`?(e.dest=S(e.dest||process.stdout.fd),y(e)):y({dest:S(e),minLength:0}),t.exports.transport=Kl(),t.exports.multistream=$l(),t.exports.levels=d(),t.exports.stdSerializers=ge,t.exports.stdTimeFunctions=Object.assign({},o),t.exports.symbols=c,t.exports.version=w,t.exports.default=_e,t.exports.pino=_e})))(),1);function tu(e){return{level:e}}function nu(){return`,"time":"${(/* @__PURE__ */ new Date()).toISOString()}"`}let ru={minLevel:`info`,enableConsole:!0,autoTracing:!1,pinoOptions:{level:`info`,base:{},formatters:{level:tu},timestamp:nu}},iu=0;function au(e){ru=e,iu+=1}function ou(){return ru}function su(){return iu}const cu={debug:`debug`,info:`info`,warn:`warn`,error:`error`};function lu(e){return{level:e}}function uu(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function du(e){return`targets`in e&&Array.isArray(e.targets)&&e.targets.length>0}function fu(){return`,"time":"${(/* @__PURE__ */ new Date()).toISOString()}"`}const pu={minLevel:`info`,enableConsole:!0,autoTracing:!1,pinoOptions:{level:`info`,formatters:{level:lu},timestamp:fu}};var mu=class e{context;config;hasExplicitConfig;builtConfigVersion;pinoLogger;constructor(e,t={},n,r){this.context={module:e,operation:n,trace:r};let i=Object.keys(t).length===0,a=t===ou();this.hasExplicitConfig=!i&&!a,this.config=this.hasExplicitConfig?{...pu,...t}:{...pu,...ou()},this.builtConfigVersion=su(),this.pinoLogger=this.buildPinoLogger(this.config)}buildPinoLogger(e){let t={...e.pinoOptions,level:e.minLevel},n=e.pinoOptions?.base;if(t.base={...uu(n)?n:{},module:this.context.module},e.transport&&(t.transport=e.transport,du(e.transport)&&typeof t.formatters?.level==`function`)){let e={...t.formatters};delete e.level,t.formatters=e}return e.stream&&!e.transport?(0,eu.default)(t,e.stream):(0,eu.default)(t)}getActivePinoLogger(){if(this.hasExplicitConfig)return this.pinoLogger;let e=su();return e!==this.builtConfigVersion&&(this.config.minLevel=ou().minLevel??pu.minLevel,this.config.transport=ou().transport,this.config.stream=ou().stream,this.pinoLogger=this.buildPinoLogger(this.config),this.builtConfigVersion=e),this.pinoLogger}debug(e,t){this.log(`debug`,e,t)}info(e,t){this.log(`info`,e,t)}warn(e,t){this.log(`warn`,e,t)}error(e,t,n){let r=t===void 0?void 0:gl(t);this.log(`error`,e,n,r)}withOperation(t){return this.hasExplicitConfig?new e(this.context.module,this.config,t,this.context.trace):new e(this.context.module,{},t,this.context.trace)}withTrace(t){return this.hasExplicitConfig?new e(this.context.module,this.config,this.context.operation,t):new e(this.context.module,{},this.context.operation,t)}flush(){return new Promise(e=>{this.getActivePinoLogger().flush(()=>e())})}log(e,t,n,r){if(!this.shouldLog(e))return;let i={...n},a=this.context.operation;a&&(i.operation=a);let o=this.context.trace;if(o&&(i.traceId=o.traceId,i.spanId=o.spanId),r){let e=xl(r).slice(1);i.error={name:r.name,message:r.message,stack:r.stack,...e.length>0?{causeChain:e}:{}}}let s=cu[e],c=`[${this.context.module}${a?`:${a}`:``}] ${t}`;Object.keys(i).length>0?this.getActivePinoLogger()[s](i,c):this.getActivePinoLogger()[s](c)}shouldLog(e){let t=Cl[e],n=this.hasExplicitConfig?this.config.minLevel:ou().minLevel??pu.minLevel;return t>=Cl[n]}getPinoLogger(){return this.getActivePinoLogger()}};function hu(e){return new mu(e,ou())}hu(`App`);const gu=new t;var _u=class{getCurrentContext(){return gu.getStore()}getCurrentTraceId(){return gu.getStore()?.traceId}getCurrentSpanId(){return gu.getStore()?.spanId}createNewContext(){return{traceId:wl(),spanId:Tl()}}createChildContext(e){return{traceId:e.traceId,spanId:Tl(),parentSpanId:e.spanId}}runWithContext(e,t){return gu.run(e,t)}runWithNewTrace(e){let t=this.createNewContext();return gu.run(t,e)}runWithChildSpan(e){let t=this.getCurrentContext();if(!t)return this.runWithNewTrace(e);let n=this.createChildContext(t);return gu.run(n,e)}};let vu;function yu(e){vu=e}function bu(){return vu?.getCurrentContext()}function xu(){return new _u}var Su=/* @__PURE__ */ L((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=z(`tty`);function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if(n!=="default"){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var r=/*#__PURE__*/ n(t);let{env:i={},argv:a=[],platform:o=``}=typeof process>`u`?{}:process,s=`NO_COLOR`in i||a.includes(`--no-color`),c=`FORCE_COLOR`in i||a.includes(`--color`),l=o===`win32`,u=i.TERM===`dumb`,d=r&&r.isatty&&r.isatty(1)&&i.TERM&&!u,f=`CI`in i&&(`GITHUB_ACTIONS`in i||`GITLAB_CI`in i||`CIRCLECI`in i),p=!s&&(c||l&&!u||d||f),m=(e,t,n,r,i=t.substring(0,e)+r,a=t.substring(e+n.length),o=a.indexOf(n))=>i+(o<0?a:m(o,a,n,r)),h=(e,t,n,r,i)=>e<0?n+t+r:n+m(e,t,r,i)+r,g=(e,t,n=e,r=e.length+1)=>i=>i||i!==``&&i!==void 0?h((``+i).indexOf(t,r),i,e,t,n):``,_=(e,t,n)=>g(`\x1b[${e}m`,`\x1b[${t}m`,n),v={reset:_(0,0),bold:_(1,22,`\x1B[22m\x1B[1m`),dim:_(2,22,`\x1B[22m\x1B[2m`),italic:_(3,23),underline:_(4,24),inverse:_(7,27),hidden:_(8,28),strikethrough:_(9,29),black:_(30,39),red:_(31,39),green:_(32,39),yellow:_(33,39),blue:_(34,39),magenta:_(35,39),cyan:_(36,39),white:_(37,39),gray:_(90,39),bgBlack:_(40,49),bgRed:_(41,49),bgGreen:_(42,49),bgYellow:_(43,49),bgBlue:_(44,49),bgMagenta:_(45,49),bgCyan:_(46,49),bgWhite:_(47,49),blackBright:_(90,39),redBright:_(91,39),greenBright:_(92,39),yellowBright:_(93,39),blueBright:_(94,39),magentaBright:_(95,39),cyanBright:_(96,39),whiteBright:_(97,39),bgBlackBright:_(100,49),bgRedBright:_(101,49),bgGreenBright:_(102,49),bgYellowBright:_(103,49),bgBlueBright:_(104,49),bgMagentaBright:_(105,49),bgCyanBright:_(106,49),bgWhiteBright:_(107,49)},y=({useColor:e=p}={})=>e?v:Object.keys(v).reduce((e,t)=>({...e,[t]:String}),{}),{reset:b,bold:x,dim:S,italic:C,underline:w,inverse:T,hidden:E,strikethrough:D,black:O,red:k,green:A,yellow:ee,blue:te,magenta:ne,cyan:re,white:ie,gray:j,bgBlack:M,bgRed:ae,bgGreen:oe,bgYellow:se,bgBlue:N,bgMagenta:P,bgCyan:F,bgWhite:ce,blackBright:le,redBright:ue,greenBright:I,yellowBright:de,blueBright:fe,magentaBright:pe,cyanBright:L,whiteBright:R,bgBlackBright:me,bgRedBright:he,bgGreenBright:ge,bgYellowBright:_e,bgBlueBright:ve,bgMagentaBright:ye,bgCyanBright:be,bgWhiteBright:xe}=y();e.bgBlack=M,e.bgBlackBright=me,e.bgBlue=N,e.bgBlueBright=ve,e.bgCyan=F,e.bgCyanBright=be,e.bgGreen=oe,e.bgGreenBright=ge,e.bgMagenta=P,e.bgMagentaBright=ye,e.bgRed=ae,e.bgRedBright=he,e.bgWhite=ce,e.bgWhiteBright=xe,e.bgYellow=se,e.bgYellowBright=_e,e.black=O,e.blackBright=le,e.blue=te,e.blueBright=fe,e.bold=x,e.createColors=y,e.cyan=re,e.cyanBright=L,e.dim=S,e.gray=j,e.green=A,e.greenBright=I,e.hidden=E,e.inverse=T,e.isColorSupported=p,e.italic=C,e.magenta=ne,e.magentaBright=pe,e.red=k,e.redBright=ue,e.reset=b,e.strikethrough=D,e.underline=w,e.white=ie,e.whiteBright=R,e.yellow=ee,e.yellowBright=de})),Cu=/* @__PURE__ */ L(((e,t)=>{t.exports=n;function n(e,t){if(e&&t)return n(e)(t);if(typeof e!=`function`)throw TypeError(`need wrapper function`);return Object.keys(e).forEach(function(t){r[t]=e[t]}),r;function r(){for(var t=Array(arguments.length),n=0;n<t.length;n++)t[n]=arguments[n];var r=e.apply(this,t),i=t[t.length-1];return typeof r==`function`&&r!==i&&Object.keys(i).forEach(function(e){r[e]=i[e]}),r}}})),wu=/* @__PURE__ */ L(((e,t)=>{var n=Cu();t.exports=n(r),t.exports.strict=n(i),r.proto=r(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return r(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return i(this)},configurable:!0})});function r(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function i(e){var t=function(){if(t.called)throw Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)};return t.onceError=(e.name||"Function wrapped with `once`")+` shouldn't be called more than once`,t.called=!1,t}})),Tu=/* @__PURE__ */ L(((e,t)=>{var n=wu(),r=function(){},i=global.Bare?queueMicrotask:process.nextTick.bind(process),a=function(e){return e.setHeader&&typeof e.abort==`function`},o=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},s=function(e,t,c){if(typeof t==`function`)return s(e,null,t);t||={},c=n(c||r);var l=e._writableState,u=e._readableState,d=t.readable||t.readable!==!1&&e.readable,f=t.writable||t.writable!==!1&&e.writable,p=!1,m=function(){e.writable||h()},h=function(){f=!1,d||c.call(e)},g=function(){d=!1,f||c.call(e)},_=function(t){c.call(e,t?/* @__PURE__ */ Error(`exited with error code: `+t):null)},v=function(t){c.call(e,t)},y=function(){i(b)},b=function(){if(!p&&(d&&!(u&&u.ended&&!u.destroyed)||f&&!(l&&l.ended&&!l.destroyed)))return c.call(e,/* @__PURE__ */ Error(`premature close`))},x=function(){e.req.on(`finish`,h)};return a(e)?(e.on(`complete`,h),e.on(`abort`,y),e.req?x():e.on(`request`,x)):f&&!l&&(e.on(`end`,m),e.on(`close`,m)),o(e)&&e.on(`exit`,_),e.on(`end`,g),e.on(`finish`,h),t.error!==!1&&e.on(`error`,v),e.on(`close`,y),function(){p=!0,e.removeListener(`complete`,h),e.removeListener(`abort`,y),e.removeListener(`request`,x),e.req&&e.req.removeListener(`finish`,h),e.removeListener(`end`,m),e.removeListener(`close`,m),e.removeListener(`finish`,h),e.removeListener(`exit`,_),e.removeListener(`end`,g),e.removeListener(`error`,v),e.removeListener(`close`,y)}};t.exports=s})),Eu=/* @__PURE__ */ L(((e,t)=>{var n=wu(),r=Tu(),i;try{i=z(`fs`)}catch{}var a=function(){},o=typeof process>`u`?!1:/^v?\.0/.test(process.version),s=function(e){return typeof e==`function`},c=function(e){return!o||!i?!1:(e instanceof(i.ReadStream||a)||e instanceof(i.WriteStream||a))&&s(e.close)},l=function(e){return e.setHeader&&s(e.abort)},u=function(e,t,i,o){o=n(o);var u=!1;e.on(`close`,function(){u=!0}),r(e,{readable:t,writable:i},function(e){if(e)return o(e);u=!0,o()});var d=!1;return function(t){if(!u&&!d){if(d=!0,c(e))return e.close(a);if(l(e))return e.abort();if(s(e.destroy))return e.destroy();o(t||/* @__PURE__ */ Error(`stream was destroyed`))}}},d=function(e){e()},f=function(e,t){return e.pipe(t)};t.exports=function(){var e=Array.prototype.slice.call(arguments),t=s(e[e.length-1]||a)&&e.pop()||a;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw Error(`pump requires two streams per minimum`);var n,r=e.map(function(i,a){var o=a<e.length-1;return u(i,o,a>0,function(e){n||=e,e&&r.forEach(d),o||(r.forEach(d),t(n))})});return e.reduce(f)}})),Du=/* @__PURE__ */ L(((e,t)=>{let{Transform:n}=z(`stream`),{StringDecoder:r}=z(`string_decoder`),i=Symbol(`last`),a=Symbol(`decoder`);function o(e,t,n){let r;if(this.overflow){if(r=this[a].write(e).split(this.matcher),r.length===1)return n();r.shift(),this.overflow=!1}else this[i]+=this[a].write(e),r=this[i].split(this.matcher);this[i]=r.pop();for(let e=0;e<r.length;e++)try{c(this,this.mapper(r[e]))}catch(e){return n(e)}this.overflow=this[i].length>this.maxLength,this.overflow&&!this.skipOverflow?n(/* @__PURE__ */ Error(`maximum buffer reached`)):n()}function s(e){if(this[i]+=this[a].end(),this[i])try{c(this,this.mapper(this[i]))}catch(t){return e(t)}e()}function c(e,t){t!==void 0&&e.push(t)}function l(e){return e}t.exports=function(e,t,c){switch(e||=/\r?\n/,t||=l,c||={},arguments.length){case 1:typeof e==`function`?(t=e,e=/\r?\n/):typeof e==`object`&&!(e instanceof RegExp)&&!e[Symbol.split]&&(c=e,e=/\r?\n/);break;case 2:typeof e==`function`?(c=t,t=e,e=/\r?\n/):typeof t==`object`&&(c=t,t=l)}c=Object.assign({},c),c.autoDestroy=!0,c.transform=o,c.flush=s,c.readableObjectMode=!0;let u=new n(c);return u[i]=``,u[a]=new r(`utf8`),u.matcher=e,u.mapper=t,u.maxLength=c.maxLength,u.skipOverflow=c.skipOverflow||!1,u.overflow=!1,u._destroy=function(e,t){this._writableState.errorEmitted=!1,t(e)},u}})),Ou=/* @__PURE__ */ L(((e,t)=>{let n=Symbol.for(`pino.metadata`),r=Du(),{Duplex:i}=z(`stream`),{parentPort:a,workerData:o}=z(`worker_threads`);function s(){let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}t.exports=function(e,t={}){let l=t.expectPinoConfig===!0&&o?.workerData?.pinoWillSendConfig===!0,u=t.parse===`lines`,d=typeof t.parseLine==`function`?t.parseLine:JSON.parse,f=t.close||c,p=r(function(e){let t;try{t=d(e)}catch(t){this.emit(`unknown`,e,t);return}if(t===null)this.emit(`unknown`,e,`Null value ignored`);else return typeof t!=`object`&&(t={data:t,time:Date.now()}),p[n]&&(p.lastTime=t.time,p.lastLevel=t.level,p.lastObj=t),u?e:t},{autoDestroy:!0});if(p._destroy=function(e,t){let n=f(e,t);n&&typeof n.then==`function`&&n.then(t,t)},t.expectPinoConfig===!0&&o?.workerData?.pinoWillSendConfig!==!0&&setImmediate(()=>{p.emit(`error`,/* @__PURE__ */ Error(`This transport is not compatible with the current version of pino. Please upgrade pino to the latest version.`))}),t.metadata!==!1&&(p[n]=!0,p.lastTime=0,p.lastLevel=0,p.lastObj=null),l){let e={},t=s();return a.on(`message`,function n(r){r.code===`PINO_CONFIG`&&(e=r.config,t.resolve(),a.off(`message`,n))}),Object.defineProperties(p,{levels:{get(){return e.levels}},messageKey:{get(){return e.messageKey}},errorKey:{get(){return e.errorKey}}}),t.then(m)}return m();function m(){let n=e(p);if(n&&typeof n.catch==`function`)n.catch(e=>{p.destroy(e)}),n=null;else if(t.enablePipelining&&n)return i.from({writable:p,readable:n});return p}};function c(e,t){process.nextTick(t,e)}})),ku=/* @__PURE__ */ L(((e,t)=>{t.exports={DATE_FORMAT:`yyyy-mm-dd HH:MM:ss.l o`,DATE_FORMAT_SIMPLE:`HH:MM:ss.l`,ERROR_LIKE_KEYS:[`err`,`error`],MESSAGE_KEY:`msg`,LEVEL_KEY:`level`,LEVEL_LABEL:`levelLabel`,TIMESTAMP_KEY:`time`,LEVELS:{default:`USERLVL`,60:`FATAL`,50:`ERROR`,40:`WARN`,30:`INFO`,20:`DEBUG`,10:`TRACE`},LEVEL_NAMES:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},LOGGER_KEYS:[`pid`,`hostname`,`name`,`level`,`time`,`timestamp`,`caller`]}})),Au=/* @__PURE__ */ L(((e,t)=>{t.exports=i;let{LEVELS:n,LEVEL_NAMES:r}=ku();function i(e,t,i){let a=e?t||n:Object.assign({},n,t),o=e?i||r:Object.assign({},r,i);return function(e){let t=`default`;return t=Number.isInteger(+e)?Object.prototype.hasOwnProperty.call(a,e)?e:t:Object.prototype.hasOwnProperty.call(o,e.toLowerCase())?o[e.toLowerCase()]:t,[a[t],t]}}})),ju=/* @__PURE__ */ L(((e,t)=>{let n=e=>e,r={default:n,60:n,50:n,40:n,30:n,20:n,10:n,message:n,greyMessage:n,property:n},{createColors:i}=Su(),a=Au(),o=i({useColor:!0}),{white:s,bgRed:c,red:l,yellow:u,green:d,blue:f,gray:p,cyan:m,magenta:h}=o,g={default:s,60:c,50:l,40:u,30:d,20:f,10:p,message:m,greyMessage:p,property:h};function _(e){return e.reduce(function(e,[t,n]){return e[t]=typeof o[n]==`function`?o[n]:s,e},{default:s,message:m,greyMessage:p,property:h})}function v(e){return function(t,n,{customLevels:r,customLevelNames:i}={}){let[o,s]=a(e,r,i)(t);return Object.prototype.hasOwnProperty.call(n,s)?n[s](o):n.default(o)}}function y(e){let t=v(e),n=function(e,n){return t(e,r,n)};return n.message=r.message,n.greyMessage=r.greyMessage,n.property=r.property,n.colors=i({useColor:!1}),n}function b(e){let t=v(e),n=function(e,n){return t(e,g,n)};return n.message=g.message,n.property=g.property,n.greyMessage=g.greyMessage,n.colors=o,n}function x(e,t){let n=_(e),r=t?n:Object.assign({},g,n),i=v(t),a=function(e,t){return i(e,r,t)};return a.colors=o,a.message=a.message||r.message,a.property=a.property||r.property,a.greyMessage=a.greyMessage||r.greyMessage,a}t.exports=function(e=!1,t,n){return e&&t!==void 0?x(t,n):e?b(n):y(n)}})),Mu=/* @__PURE__ */ L(((e,t)=>{let n=z(`node:fs`),r=z(`node:events`),i=z(`node:util`).inherits,a=z(`node:path`),o=z(`node:assert`),s=zl(),c=Buffer.allocUnsafe(0),l=`buffer`,u=`utf8`,d=Symbol(`kFlush`);function f(e){switch(e?.code){case`EBADF`:case`EINVAL`:case`ENOTSUP`:case`EOPNOTSUPP`:case`EROFS`:return!0;default:return!1}}let[p,m]=(process.versions.node||`0.0`).split(`.`).map(Number),h=p>=22&&m>=7;function g(e,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function r(n,r){if(n){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount(`error`)>0&&t.emit(`error`,n)}):t.emit(`error`,n);return}let i=t._reopening;t.fd=r,t.file=e,t._reopening=!1,t._opening=!1,t._writing=!1,t.sync?process.nextTick(()=>t.emit(`ready`)):t.emit(`ready`),t.destroyed||(!t._writing&&(t._len>t.minLength||t._flushPending)?t._actualWrite():i&&!t._writing&&process.nextTick(b,t))}let i=t.append?`a`:`w`,o=t.mode;if(t.sync)try{t.mkdir&&n.mkdirSync(a.dirname(e),{recursive:!0}),r(null,n.openSync(e,i,o))}catch(e){throw r(e),e}else t.mkdir?n.mkdir(a.dirname(e),{recursive:!0},t=>{if(t)return r(t);n.open(e,i,o,r)}):n.open(e,i,o,r)}function _(e){if(!(this instanceof _))return new _(e);let{fd:t,dest:r,minLength:i,maxLength:a,maxWrite:o,periodicFlush:f,sync:p,append:m=!0,mkdir:h,retryEAGAIN:b,maxWriteRetries:x,fsync:C,contentMode:E,mode:k}=e||{};t||=r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=0,this._flushInProgress=0,this._emittingFlush=!1,this._emittingWrite=!1,this._retryTimer=null,this._hwm=Math.max(i||0,16387),this.file=null,this.destroyed=!1,this.minLength=i||0,this.maxLength=a||0,this.maxWrite=o||16384,this._periodicFlush=f||0,this._periodicFlushTimer=void 0,this.sync=p||!1,this.writable=!0,this._fsync=C||!1,this.append=m||!1,this.mode=k,this.retryEAGAIN=b||(()=>!0),this.maxWriteRetries=x||0,this._writeRetries=0,this.mkdir=h||!1;let A,ie;if(E===l)this._writingBuf=c,this.write=T,this.flush=O,this.flushSync=te,this._actualWrite=re,A=()=>n.writeSync(this.fd,this._writingBuf),ie=()=>n.write(this.fd,this._writingBuf,this.release);else if(E===void 0||E===u)this._writingBuf=``,this.write=w,this.flush=D,this.flushSync=ee,this._actualWrite=ne,A=()=>Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`),ie=()=>Buffer.isBuffer(this._writingBuf)?n.write(this.fd,this._writingBuf,this.release):n.write(this.fd,this._writingBuf,`utf8`,this.release);else throw Error(`SonicBoom supports "${u}" and "${l}", but passed ${E}`);if(typeof t==`number`)this.fd=t,process.nextTick(()=>this.emit(`ready`));else if(typeof t==`string`)g(t,this);else throw Error(`SonicBoom supports only file descriptors and files`);if(this.minLength>=this.maxWrite)throw Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(e,t)=>{if(e){let t=e.code===`EAGAIN`||e.code===`EBUSY`;t&&this._writeRetries++;let n=this.maxWriteRetries>0&&this._writeRetries>this.maxWriteRetries;if(t&&!n&&this.retryEAGAIN(e,this._writingBuf.length,this._len-this._writingBuf.length)){if(this.sync)try{s(100),this.release(void 0,0)}catch(e){this.release(e)}else this._retryTimer=setTimeout(()=>{this._retryTimer=null,ie()},100)}else this._writing=!1,this.emit(`error`,e);return}t>0&&(this._writeRetries=0);let r=v(this._writingBuf,this._len,t);this._len=r.len,this._writingBuf=r.writingBuf,this._emittingWrite=!0;try{this.emit(`write`,t)}finally{this._emittingWrite=!1}if(this.destroyed){this._writing=!1,this._flushPending>0&&(this._len===0?y(this):this.emit(d,/* @__PURE__ */ Error(`SonicBoom destroyed`)));return}if(this._writingBuf.length){if(!this.sync){ie();return}try{do{let e=A(),t=v(this._writingBuf,this._len,e);this._len=t.len,this._writingBuf=t.writingBuf}while(this._writingBuf.length)}catch(e){this.release(e);return}}this._fsync&&n.fsyncSync(this.fd);let i=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):i>0&&(i>this.minLength||this._flushPending)?this._actualWrite():this._ending?i>0?this._actualWrite():(this._writing=!1,S(this)):(this._writing=!1,y(this))},this.on(`newListener`,function(e){(e===`drain`||e===d)&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>{this._flushPending===0&&this._flushInProgress===0&&this.flush(null)},this._periodicFlush),this._periodicFlushTimer.unref())}function v(e,t,n){return typeof e==`string`&&(e=Buffer.from(e)),t=Math.max(t-n,0),e=e.subarray(n),{writingBuf:e,len:t}}function y(e){e.sync?e._asyncDrainScheduled||(e._asyncDrainScheduled=!0,process.nextTick(b,e)):b(e)}function b(e){(e.listenerCount(`drain`)>0||e.listenerCount(d)>0)&&(e._asyncDrainScheduled=!1,e._writing||(x(e),e._writing||e.destroyed||e.listenerCount(`drain`)>0&&e.emit(`drain`)))}function x(e){if(!e._emittingFlush){e._emittingFlush=!0;try{e.emit(d)}finally{e._emittingFlush=!1}}}function S(e){!e._ending||e._writing||e.destroyed||(e._len>0?e._actualWrite():(e._flushPending>0&&x(e),e._flushPending===0&&e._flushInProgress===0&&!e._writing&&e._len===0&&ie(e)))}i(_,r);function C(e,t){return e.length===0?c:e.length===1?e[0]:Buffer.concat(e,t)}function w(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);e=``+e;let t=Buffer.byteLength(e),n=this._len+t,r=this._bufs;return this.maxLength&&n>this.maxLength?(this.emit(`drop`,e),this._len<this._hwm):(r.length===0||Buffer.byteLength(r[r.length-1])+t>this.maxWrite?r.push(e):r[r.length-1]+=e,this._len=n,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function T(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);let t=this._len+e.length,n=this._bufs,r=this._lens;return this.maxLength&&t>this.maxLength?(this.emit(`drop`,e),this._len<this._hwm):(n.length===0||r[r.length-1]+e.length>this.maxWrite?(n.push([e]),r.push(e.length)):(n[n.length-1].push(e),r[r.length-1]+=e.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function E(e){this._flushPending++;let t=!0,r=!1,i=!1,a=()=>t?(t=!1,this.off(d,s),this.off(`error`,c),!0):!1,o=(t,n=!0)=>{if(!r){r=!0,i&&this._flushInProgress--;try{e(t)}finally{n&&S(this)}}},s=e=>{if(a()){if(this._flushPending--,e)o(e,!1);else if(this._flushInProgress++,i=!0,!this._fsync&&!this.destroyed)try{n.fsync(this.fd,e=>{f(e)?o():o(e)})}catch(e){o(e)}else o()}},c=e=>{a()&&(this._flushPending--,o(e,!1))};this.once(d,s),this.once(`error`,c)}function D(e){if(e!=null&&typeof e!=`function`)throw Error(`flush cb must be a function`);if(this.destroyed){let t=/* @__PURE__ */ Error(`SonicBoom destroyed`);if(e){e(t);return}throw t}this.minLength<=0&&!this._writing&&this._len===0?e?.():(e&&E.call(this,e),this._writing||(this._bufs.length===0&&this._bufs.push(``),this._actualWrite()))}function O(e){if(e!=null&&typeof e!=`function`)throw Error(`flush cb must be a function`);if(this.destroyed){let t=/* @__PURE__ */ Error(`SonicBoom destroyed`);if(e){e(t);return}throw t}this.minLength<=0&&!this._writing&&this._len===0?e?.():(e&&E.call(this,e),this._writing||(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite()))}_.prototype.reopen=function(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this._opening){this.once(`ready`,()=>{this.destroyed||this.reopen(e)});return}if(this._ending)return;if(!this.file)throw Error(`Unable to reopen a file descriptor, you must pass a file to SonicBoom`);if(e&&(this.file=e),this._reopening=!0,this._writing)return;let t=this.fd;this.once(`ready`,()=>{t!==this.fd&&n.close(t,e=>{if(e)return this.emit(`error`,e)})}),g(this.file,this)},_.prototype.end=function(){if(this.destroyed)throw Error(`SonicBoom destroyed`);this._opening?this.once(`ready`,()=>{this.destroyed||this.end()}):this._ending||(this._ending=!0,this._writing||(this._len>0&&this.fd>=0?this._actualWrite():S(this)))};function k(e){if(e.destroyed)throw Error(`SonicBoom destroyed`);if(e.fd<0)throw Error(`sonic boom is not ready yet`);return!e._writing||e._opening?0:e._retryTimer===null?e._emittingWrite?2:3:(clearTimeout(e._retryTimer),e._retryTimer=null,1)}function A(e){e._writing=!1,process.nextTick(()=>{e.destroyed||e._writing||(e._reopening?(e._reopening=!1,e.reopen()):e._ending?S(e):e._len>0&&(e._len>e.minLength||e._flushPending)?e._actualWrite():b(e))})}function ee(){let e=k(this);try{e!==3&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf=``);let t=``;for(;this._bufs.length||t.length;){t.length<=0&&(t=this._bufs[0]);try{let e=Buffer.isBuffer(t)?n.writeSync(this.fd,t):n.writeSync(this.fd,t,`utf8`);this._writeRetries=0;let r=v(t,this._len,e);t=r.writingBuf,this._len=r.len,t.length<=0&&this._bufs.shift()}catch(e){let n=e.code===`EAGAIN`||e.code===`EBUSY`;n&&this._writeRetries++;let r=this.maxWriteRetries>0&&this._writeRetries>this.maxWriteRetries;if(!n||r||!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;s(100)}}}finally{e===1&&A(this)}try{n.fsyncSync(this.fd)}catch{}}function te(){let e=k(this);try{e!==3&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._lens.unshift(this._writingBuf.length),this._writingBuf=c);let t=c;for(;this._bufs.length||t.length;){t.length<=0&&(t=C(this._bufs[0],this._lens[0]));try{let e=n.writeSync(this.fd,t);this._writeRetries=0,t=t.subarray(e),this._len=Math.max(this._len-e,0),t.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(e){let n=e.code===`EAGAIN`||e.code===`EBUSY`;n&&this._writeRetries++;let r=this.maxWriteRetries>0&&this._writeRetries>this.maxWriteRetries;if(!n||r||!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;s(100)}}}finally{e===1&&A(this)}}_.prototype.destroy=function(){if(this.destroyed)return;let e=this._opening;ie(this),e&&this._flushPending>0&&this.emit(`error`,/* @__PURE__ */ Error(`SonicBoom destroyed`))};function ne(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||``,this.sync)try{e(null,Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`))}catch(t){e(t)}else n.write(this.fd,this._writingBuf,e)}function re(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:C(this._bufs.shift(),this._lens.shift()),this.sync)try{e(null,n.writeSync(this.fd,this._writingBuf))}catch(t){e(t)}else h&&(this._writingBuf=Buffer.from(this._writingBuf)),n.write(this.fd,this._writingBuf,e)}function ie(e){if(e.destroyed)return;if(e.fd===-1){e.destroyed=!0,e.once(`ready`,()=>{e.destroyed=!1,ie(e)});return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],e._retryTimer!==null&&(clearTimeout(e._retryTimer),e._retryTimer=null,e._writing=!1),e._flushPending>0&&!e._writing&&e.emit(d,/* @__PURE__ */ Error(`SonicBoom destroyed`)),o(typeof e.fd==`number`,`sonic.fd must be a number, got ${typeof e.fd}`);try{n.fsync(e.fd,t)}catch{}function t(){e.fd!==1&&e.fd!==2?n.close(e.fd,r):r()}function r(t){t?e.emit(`error`,t):(e._ending&&!e._writing&&e.emit(`finish`),e.emit(`close`))}}_.SonicBoom=_,_.default=_,t.exports=_})),Nu=/* @__PURE__ */ L(((e,t)=>{t.exports=function(){}})),Pu=/* @__PURE__ */ L(((e,t)=>{t.exports=a;let{isMainThread:n}=z(`node:worker_threads`),r=Mu(),i=Nu();function a(e){let t=new r(e);return t.on(`error`,a),!e.sync&&n&&o(t),t;function a(e){e.code===`EPIPE`?(t.write=i,t.end=i,t.flushSync=i,t.destroy=i):t.removeListener(`error`,a)}}function o(e){
130
130
  /* istanbul ignore next */
131
131
  if(global.WeakRef&&global.WeakMap&&global.FinalizationRegistry){let t=Vl();t.register(e,s),e.on(`close`,function(){t.unregister(e)})}}
132
132
  /* istanbul ignore next */
133
- function s(e,t){e.destroyed||(t===`beforeExit`?(e.flush(),e.on(`drain`,function(){e.end()})):e.flushSync())}})),Pu=/* @__PURE__ */ L(((e,t)=>{t.exports=n;function n(e){return e instanceof Date&&!Number.isNaN(e.getTime())}})),Fu=/* @__PURE__ */ L(((e,t)=>{t.exports=r;let n=Pu();function r(e){let t=new Date(e);return n(t)||(t=/* @__PURE__ */ new Date(+e)),t}})),Iu=/* @__PURE__ */ L(((e,t)=>{t.exports=n;function n(e){let t=[],n=!1,r=``;for(let i=0;i<e.length;i++){let a=e.charAt(i);a===`\\`?n=!0:n?(n=!1,r+=a):a===`.`?(t.push(r),r=``):r+=a}return r.length&&t.push(r),t}})),Lu=/* @__PURE__ */ L(((e,t)=>{t.exports=r;let n=Iu();function r(e,t){let r=Array.isArray(t)?t:n(t);for(let t of r){if(!Object.prototype.hasOwnProperty.call(e,t))return;e=e[t]}return e}})),Ru=/* @__PURE__ */ L(((e,t)=>{t.exports=i;let n=Lu(),r=Iu();function i(e,t){let i=r(t),a=i.pop();
133
+ function s(e,t){e.destroyed||(t===`beforeExit`?(e.flush(),e.on(`drain`,function(){e.end()})):e.flushSync())}})),Fu=/* @__PURE__ */ L(((e,t)=>{t.exports=n;function n(e){return e instanceof Date&&!Number.isNaN(e.getTime())}})),Iu=/* @__PURE__ */ L(((e,t)=>{t.exports=r;let n=Fu();function r(e){let t=new Date(e);return n(t)||(t=/* @__PURE__ */ new Date(+e)),t}})),Lu=/* @__PURE__ */ L(((e,t)=>{t.exports=n;function n(e){let t=[],n=!1,r=``;for(let i=0;i<e.length;i++){let a=e.charAt(i);a===`\\`?n=!0:n?(n=!1,r+=a):a===`.`?(t.push(r),r=``):r+=a}return r.length&&t.push(r),t}})),Ru=/* @__PURE__ */ L(((e,t)=>{t.exports=r;let n=Lu();function r(e,t){let r=Array.isArray(t)?t:n(t);for(let t of r){if(!Object.prototype.hasOwnProperty.call(e,t))return;e=e[t]}return e}})),zu=/* @__PURE__ */ L(((e,t)=>{t.exports=i;let n=Ru(),r=Lu();function i(e,t){let i=r(t),a=i.pop();
134
134
  /* istanbul ignore else */
135
- e=n(e,i),typeof e==`object`&&e&&Object.prototype.hasOwnProperty.call(e,a)&&delete e[a]}})),zu=/* @__PURE__ */ L((e=>{var t=class extends RangeError{constructor(e){super(`Maximum copy depth of ${String(e)} exceeded; the value copied is nested too deeply.`),this.maxDepth=e,this.name=`MaxDepthExceededError`}};let n=Function.prototype.toString,r=Object.prototype.toString;function i(e){if(!e)return Object.create(null);let t=e.constructor;if(t===Object)return e===Object.prototype?{}:Object.create(e);if(typeof t==`function`&&~n.call(t).indexOf(`[native code]`))try{return new t}catch{}return Object.create(e)}function a(e){let t=e[Symbol.toStringTag];if(t)return t;let n=r.call(e);return n.substring(8,n.length-1)}let o=Object.getPrototypeOf(Int8Array.prototype).slice;function s(e,t,n,r){let i=Object.getOwnPropertyDescriptor(e,n)||{configurable:!0,enumerable:!0,value:e[n],writable:!0},a=i.get||i.set?i:{configurable:i.configurable,enumerable:i.enumerable,value:r.copier(i.value,r),writable:i.writable};try{Object.defineProperty(t,n,a)}catch{t[n]=a.get?a.get():a.value}}function c(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0})}function l(e,t,n,r,i){for(let a=i;a<r.length;++a)s(e,t,r[a],n);for(let r of Object.getOwnPropertySymbols(e))s(e,t,r,n);return t}function u(e,t){let n=new t.Constructor;t.cache.set(e,n);for(let r=0;r<e.length;++r)n[r]=t.copier(e[r],t);return n}function d(e,t){let n=new t.Constructor;return t.cache.set(e,n),l(e,n,t,Object.getOwnPropertyNames(e),0)}function f(e,t){if(ArrayBuffer.isView(e))return o.call(e,0);if(e.resizable||e.growable){let n=e.maxByteLength,r=new t.Constructor(e.byteLength,{maxByteLength:n});return new Uint8Array(r).set(new Uint8Array(e)),r}return!e.byteLength&&a(e)===`SharedArrayBuffer`?new t.Constructor(0):e.slice(0)}function p(e,t){let n=f(e,t);t.cache.set(e,n);let r=ArrayBuffer.isView(n)&&n.length||0;return l(e,n,t,Object.getOwnPropertyNames(e),r)}function m(e,t){return e.slice(0,e.size,e.type)}let h=ee(m);function g(e,t){return new t.Constructor(t.copier(e.buffer,t),e.byteOffset,e.byteLength)}function _(e,t){let{buffer:n}=e,{cache:r,Constructor:i}=t,a=r.has(n),o=a?r.get(n):t.copier(n,t);if(!a&&r.has(e))return r.get(e);let s=new i(o,e.byteOffset,e.byteLength);return t.cache.set(e,s),l(e,s,t,Object.getOwnPropertyNames(e),0)}function v(e,t){return new t.Constructor(e.getTime())}let y=ee(v);function b(e,t){let n=new t.Constructor;t.cache.set(e,n);for(let[r,i]of e)n.set(r,t.copier(i,t));return n}function x(e,t){return l(e,b(e,t),t,Object.getOwnPropertyNames(e),0)}function S(e,t){let n=i(t.prototype);t.cache.set(e,n);for(let r of Object.keys(e)){let i=t.copier(e[r],t);if(r===`__proto__`)c(n,r,i);else try{n[r]=i}catch{c(n,r,i)}}for(let r of Object.getOwnPropertySymbols(e))if(Object.prototype.propertyIsEnumerable.call(e,r)){let i=t.copier(e[r],t);try{n[r]=i}catch{c(n,r,i)}}return n}function C(e,t){let n=i(t.prototype);return t.cache.set(e,n),l(e,n,t,Object.getOwnPropertyNames(e),0)}function w(e,t){return new t.Constructor(e.valueOf())}let T=ee(w);function E(e,t){let n=new t.Constructor(e.source,e.flags);return n.lastIndex=e.lastIndex,n}let D=ee(E);function O(e,t){return e}function k(e,t){let n=new t.Constructor;t.cache.set(e,n);for(let r of e)n.add(t.copier(r,t));return n}function A(e,t){return l(e,k(e,t),t,Object.getOwnPropertyNames(e),0)}function ee(e){return(t,n)=>{let r=e(t,n);return n.cache.set(t,r),l(t,r,n,Object.getOwnPropertyNames(t),0)}}function te(e,t){let n=w(e,t);t.cache.set(e,n);let{length:r}=e,i=Object.getOwnPropertyNames(e);return l(e,n,t,i,i[r]===`length`?r+1:r)}function ne(){return/* @__PURE__ */ new WeakMap}function re({createCache:e,maxDepth:t,methods:n,strict:r}){let i={array:r?d:u,arrayBuffer:r?p:f,asyncGenerator:O,blob:r?h:m,dataView:r?_:g,date:r?y:v,error:O,generator:O,map:r?x:b,object:r?C:S,regExp:r?D:E,set:r?A:k},a=n?Object.assign(i,n):i,o=ie(a,r),s=e||ne;if(!o.Object||!o.Array)throw Error(`An object and array copier must be provided.`);return{createCache:s,copiers:o,maxDepth:t??1e3,methods:a,strict:!!r}}function ie(e,t){let n=t?T:w;return Object.assign(Object.create(null),{Arguments:e.object,Array:e.array,ArrayBuffer:e.arrayBuffer,AsyncGenerator:e.asyncGenerator,BigInt64Array:e.arrayBuffer,BigUint64Array:e.arrayBuffer,Blob:e.blob,Boolean:n,DataView:e.dataView,Date:e.date,Error:e.error,Float32Array:e.arrayBuffer,Float64Array:e.arrayBuffer,Generator:e.generator,Int8Array:e.arrayBuffer,Int16Array:e.arrayBuffer,Int32Array:e.arrayBuffer,Map:e.map,Number:n,Object:e.object,Promise:O,RegExp:e.regExp,Set:e.set,SharedArrayBuffer:e.arrayBuffer,String:t?te:w,WeakMap:O,WeakSet:O,Uint8Array:e.arrayBuffer,Uint8ClampedArray:e.arrayBuffer,Uint16Array:e.arrayBuffer,Uint32Array:e.arrayBuffer})}function j(e={}){let{createCache:n,copiers:r,maxDepth:i}=re(e),{Array:o,Object:s}=r;function c(e,n){if(n.prototype=n.Constructor=void 0,!e||typeof e!=`object`)return e;if(n.cache.has(e))return n.cache.get(e);if(++n.depth>i)throw new t(i);n.prototype=Object.getPrototypeOf(e),n.Constructor=n.prototype&&n.prototype.constructor;let c;if(!n.Constructor||n.Constructor===Object)c=s(e,n);else if(Array.isArray(e))c=o(e,n);else{let t=r[a(e)];c=t?t(e,n):typeof e.then==`function`?e:s(e,n)}return--n.depth,c}return function(e){return c(e,{Constructor:void 0,cache:n(),copier:c,depth:0,prototype:void 0})}}let M=j({strict:!0}),ae=j();e.MaxDepthExceededError=t,e.copy=ae,e.copyStrict=M,e.createCopier=j})),Bu=/* @__PURE__ */ L(((e,t)=>{t.exports=l;let{createCopier:n}=zu(),r=n({}),i=Ru(),a=Lu(),o=Iu();function s(e,t){let n=o(t);if(n.length===0)return!1;let r=e;for(let e of n){if(typeof r!=`object`||!r||!Object.prototype.hasOwnProperty.call(r,e))return!1;r=r[e]}return!0}function c(e,t,n){let r=o(t),i=r.pop(),a=e;for(let e of r)(a[e]===null||typeof a[e]!=`object`)&&(a[e]={}),a=a[e];a[i]=n}function l({log:e,context:t}){let{ignoreKeys:n,includeKeys:o}=t,l=r(e);if(o){let e={};return o.forEach(t=>{s(l,t)&&c(e,t,a(l,t))}),e}return n.forEach(e=>{i(l,e)}),l}})),Vu=/* @__PURE__ */ L(((e,t)=>{var n;function r(e){"@babel/helpers - typeof";return r=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},r(e)}(function(i){var a=arguments,o=function(){var e=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,t=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,n=/[^-+\dA-Z]/g;return function(r,i,f,p){if(a.length===1&&d(r)===`string`&&!/\d/.test(r)&&(i=r,r=void 0),r=r||r===0?r:/* @__PURE__ */ new Date,r instanceof Date||(r=new Date(r)),isNaN(r))throw TypeError(`Invalid date`);i=String(o.masks[i]||i||o.masks.default);var m=i.slice(0,4);(m===`UTC:`||m===`GMT:`)&&(i=i.slice(4),f=!0,m===`GMT:`&&(p=!0));var h=function(){return f?`getUTC`:`get`},g=function(){return r[h()+`Date`]()},_=function(){return r[h()+`Day`]()},v=function(){return r[h()+`Month`]()},y=function(){return r[h()+`FullYear`]()},b=function(){return r[h()+`Hours`]()},x=function(){return r[h()+`Minutes`]()},S=function(){return r[h()+`Seconds`]()},C=function(){return r[h()+`Milliseconds`]()},w=function(){return f?0:r.getTimezoneOffset()},T=function(){return l(r)},E=function(){return u(r)},D={d:function(){return g()},dd:function(){return s(g())},ddd:function(){return o.i18n.dayNames[_()]},DDD:function(){return c({y:y(),m:v(),d:g(),_:h(),dayName:o.i18n.dayNames[_()],short:!0})},dddd:function(){return o.i18n.dayNames[_()+7]},DDDD:function(){return c({y:y(),m:v(),d:g(),_:h(),dayName:o.i18n.dayNames[_()+7]})},m:function(){return v()+1},mm:function(){return s(v()+1)},mmm:function(){return o.i18n.monthNames[v()]},mmmm:function(){return o.i18n.monthNames[v()+12]},yy:function(){return String(y()).slice(2)},yyyy:function(){return s(y(),4)},h:function(){return b()%12||12},hh:function(){return s(b()%12||12)},H:function(){return b()},HH:function(){return s(b())},M:function(){return x()},MM:function(){return s(x())},s:function(){return S()},ss:function(){return s(S())},l:function(){return s(C(),3)},L:function(){return s(Math.floor(C()/10))},t:function(){return b()<12?o.i18n.timeNames[0]:o.i18n.timeNames[1]},tt:function(){return b()<12?o.i18n.timeNames[2]:o.i18n.timeNames[3]},T:function(){return b()<12?o.i18n.timeNames[4]:o.i18n.timeNames[5]},TT:function(){return b()<12?o.i18n.timeNames[6]:o.i18n.timeNames[7]},Z:function(){return p?`GMT`:f?`UTC`:(String(r).match(t)||[``]).pop().replace(n,``).replace(/GMT\+0000/g,`UTC`)},o:function(){return(w()>0?`-`:`+`)+s(Math.floor(Math.abs(w())/60)*100+Math.abs(w())%60,4)},p:function(){return(w()>0?`-`:`+`)+s(Math.floor(Math.abs(w())/60),2)+`:`+s(Math.floor(Math.abs(w())%60),2)},S:function(){return[`th`,`st`,`nd`,`rd`][g()%10>3?0:(g()%100-g()%10!=10)*g()%10]},W:function(){return T()},WW:function(){return s(T())},N:function(){return E()}};return i.replace(e,function(e){return e in D?D[e]():e.slice(1,e.length-1)})}}();o.masks={default:`ddd mmm dd yyyy HH:MM:ss`,shortDate:`m/d/yy`,paddedShortDate:`mm/dd/yyyy`,mediumDate:`mmm d, yyyy`,longDate:`mmmm d, yyyy`,fullDate:`dddd, mmmm d, yyyy`,shortTime:`h:MM TT`,mediumTime:`h:MM:ss TT`,longTime:`h:MM:ss TT Z`,isoDate:`yyyy-mm-dd`,isoTime:`HH:MM:ss`,isoDateTime:`yyyy-mm-dd'T'HH:MM:sso`,isoUtcDateTime:`UTC:yyyy-mm-dd'T'HH:MM:ss'Z'`,expiresHeaderFormat:`ddd, dd mmm yyyy HH:MM:ss Z`},o.i18n={dayNames:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],monthNames:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`,`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],timeNames:[`a`,`p`,`am`,`pm`,`A`,`P`,`AM`,`PM`]};var s=function(e,t){for(e=String(e),t||=2;e.length<t;)e=`0`+e;return e},c=function(e){var t=e.y,n=e.m,r=e.d,i=e._,a=e.dayName,o=e.short,s=o!==void 0&&o,c=/* @__PURE__ */ new Date,l=/* @__PURE__ */ new Date;l.setDate(l[i+`Date`]()-1);var u=/* @__PURE__ */ new Date;return u.setDate(u[i+`Date`]()+1),function(){return c[i+`FullYear`]()}()===t&&function(){return c[i+`Month`]()}()===n&&function(){return c[i+`Date`]()}()===r?s?`Tdy`:`Today`:function(){return l[i+`FullYear`]()}()===t&&function(){return l[i+`Month`]()}()===n&&function(){return l[i+`Date`]()}()===r?s?`Ysd`:`Yesterday`:function(){return u[i+`FullYear`]()}()===t&&function(){return u[i+`Month`]()}()===n&&function(){return u[i+`Date`]()}()===r?s?`Tmw`:`Tomorrow`:a},l=function(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate());t.setDate(t.getDate()-(t.getDay()+6)%7+3);var n=new Date(t.getFullYear(),0,4);n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=t.getTimezoneOffset()-n.getTimezoneOffset();t.setHours(t.getHours()-r);var i=(t-n)/6048e5;return 1+Math.floor(i)},u=function(e){var t=e.getDay();return t===0&&(t=7),t},d=function(e){return e===null?`null`:e===void 0?`undefined`:r(e)===`object`?Array.isArray(e)?`array`:{}.toString.call(e).slice(8,-1).toLowerCase():r(e)};typeof n==`function`&&n.amd?n(function(){return o}):(e===void 0?`undefined`:r(e))===`object`?t.exports=o:i.dateFormat=o})(void 0)})),Hu=/* @__PURE__ */ L(((e,t)=>{t.exports=s;let{DATE_FORMAT:n,DATE_FORMAT_SIMPLE:r}=Ou(),i=Vu(),a=Fu(),o=Pu();function s(e,t=!1){if(t===!1)return e;let s=a(e);if(!o(s))return e;if(t===!0)return i(s,r);let c=t.toUpperCase();if(c===`SYS:STANDARD`)return i(s,n);let l=c.substr(0,4);return l===`SYS:`||l===`UTC:`?l===`UTC:`?i(s,t):i(s,t.slice(4)):i(s,`UTC:${t}`)}})),Uu=/* @__PURE__ */ L(((e,t)=>{t.exports=n;function n(e){return e?typeof e==`string`?e.split(`,`).reduce((e,t,n)=>{let[r,i=n]=t.split(`:`);return e[r.toLowerCase()]=i,e},{}):Object.prototype.toString.call(e)===`[object Object]`?Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{}):{}:{}}})),Wu=/* @__PURE__ */ L(((e,t)=>{t.exports=n;function n(e){return e?typeof e==`string`?e.split(`,`).reduce((e,t,n)=>{let[r,i=n]=t.split(`:`);return e[i]=r.toUpperCase(),e},{default:`USERLVL`}):Object.prototype.toString.call(e)===`[object Object]`?Object.keys(e).reduce((t,n)=>(t[e[n]]=n.toUpperCase(),t),{default:`USERLVL`}):{}:{}}})),Gu=/* @__PURE__ */ L(((e,t)=>{t.exports=r;let n=Lu();function r(e,t){return e=e.replace(/{if (.*?)}([\s\S]*?){end}/g,r),e=e.replace(/{if (.*?)}/g,``),e=e.replace(/{end}/g,``),e=e.replace(/[^\S\r\n]+/g,` `),e=e.replace(/\n[^\S\r\n]*\n/g,`
136
- `),e.trim();function r(e,r,i){let a=n(t,r);return a&&i.includes(r)?i.replace(RegExp(`{`+r+`}`,`g`),a):``}}})),Ku=/* @__PURE__ */ L(((e,t)=>{t.exports=n;function n(e){return Object.prototype.toString.apply(e)===`[object Object]`}})),qu=/* @__PURE__ */ L(((e,t)=>{t.exports=n;function n({input:e,ident:t=` `,eol:n=`
137
- `}){let r=e.split(/\r?\n/);for(let e=1;e<r.length;e+=1)r[e]=t+r[e];return r.join(n)}})),Ju=/* @__PURE__ */ L(((e,t)=>{t.exports=s;let{LEVEL_NAMES:n}=Ou(),r=Au(),i=Wu(),a=Uu(),o=ku();function s(e){let t=e.crlf?`\r
135
+ e=n(e,i),typeof e==`object`&&e&&Object.prototype.hasOwnProperty.call(e,a)&&delete e[a]}})),Bu=/* @__PURE__ */ L((e=>{var t=class extends RangeError{constructor(e){super(`Maximum copy depth of ${String(e)} exceeded; the value copied is nested too deeply.`),this.maxDepth=e,this.name=`MaxDepthExceededError`}};let n=Function.prototype.toString,r=Object.prototype.toString;function i(e){if(!e)return Object.create(null);let t=e.constructor;if(t===Object)return e===Object.prototype?{}:Object.create(e);if(typeof t==`function`&&~n.call(t).indexOf(`[native code]`))try{return new t}catch{}return Object.create(e)}function a(e){let t=e[Symbol.toStringTag];if(t)return t;let n=r.call(e);return n.substring(8,n.length-1)}let o=Object.getPrototypeOf(Int8Array.prototype).slice,s=Object.getPrototypeOf(Array.prototype)===Object.prototype;function c(e,t,n,r,i){let a=Object.getOwnPropertyDescriptor(e,n)||{configurable:!0,enumerable:!0,value:e[n],writable:!0},o;if(a.writable===void 0||a.get||a.set)o=a;else{let{configurable:e,enumerable:s,writable:c}=a,l=r.copier(a.value,r);if(i){if(e&&s&&c&&!(n in t)){t[n]=l;return}if(n===`length`&&c&&Array.isArray(t)&&t.length===l)return}o={configurable:e,enumerable:s,value:l,writable:c}}try{Object.defineProperty(t,n,o)}catch{try{Object.defineProperty(t,n,Object.setPrototypeOf(o,null))}catch{t[n]=o.get?o.get():o.value}}}function l(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0})}function u(e,t,n,r,i,a){for(let o=i;o<r.length;++o)c(e,t,r[o],n,a);for(let r of Object.getOwnPropertySymbols(e))c(e,t,r,n,a);return t}function d(e,t){let n=new t.Constructor;t.cache.set(e,n);for(let r=0;r<e.length;++r)n[r]=t.copier(e[r],t);return n}function f(e,t){let n=new t.Constructor;return t.cache.set(e,n),u(e,n,t,Object.getOwnPropertyNames(e),0,s&&t.Constructor===Array)}function p(e,t){if(ArrayBuffer.isView(e))return o.call(e,0);if(e.resizable||e.growable){let n=e.maxByteLength,r=new t.Constructor(e.byteLength,{maxByteLength:n});return new Uint8Array(r).set(new Uint8Array(e)),r}return!e.byteLength&&a(e)===`SharedArrayBuffer`?new t.Constructor(0):e.slice(0)}function m(e,t){let n=p(e,t);t.cache.set(e,n);let r=ArrayBuffer.isView(n)&&n.length||0;return u(e,n,t,Object.getOwnPropertyNames(e),r,!1)}function h(e,t){return e.slice(0,e.size,e.type)}let g=te(h);function _(e,t){return new t.Constructor(t.copier(e.buffer,t),e.byteOffset,e.byteLength)}function v(e,t){let{buffer:n}=e,{cache:r,Constructor:i}=t,a=r.has(n),o=a?r.get(n):t.copier(n,t);if(!a&&r.has(e))return r.get(e);let s=new i(o,e.byteOffset,e.byteLength);return t.cache.set(e,s),u(e,s,t,Object.getOwnPropertyNames(e),0,!1)}function y(e,t){return new t.Constructor(e.getTime())}let b=te(y);function x(e,t){let n=new t.Constructor;t.cache.set(e,n);for(let[r,i]of e)n.set(typeof r==`object`&&r?t.copier(r,t):r,t.copier(i,t));return n}function S(e,t){return u(e,x(e,t),t,Object.getOwnPropertyNames(e),0,!1)}function C(e,t){let n=i(t.prototype);t.cache.set(e,n);for(let r of Object.keys(e)){let i=t.copier(e[r],t);if(r===`__proto__`)l(n,r,i);else try{n[r]=i}catch{l(n,r,i)}}for(let r of Object.getOwnPropertySymbols(e))if(Object.prototype.propertyIsEnumerable.call(e,r)){let i=t.copier(e[r],t);try{n[r]=i}catch{l(n,r,i)}}return n}function w(e,t){let{prototype:n}=t,r=i(n);return t.cache.set(e,r),u(e,r,t,Object.getOwnPropertyNames(e),0,n===Object.prototype||n===null)}function T(e,t){return new t.Constructor(e.valueOf())}let E=te(T);function D(e,t){let n=new t.Constructor(e.source,e.flags);return n.lastIndex=e.lastIndex,n}let O=te(D);function k(e,t){return e}function A(e,t){let n=new t.Constructor;t.cache.set(e,n);for(let r of e)n.add(t.copier(r,t));return n}function ee(e,t){return u(e,A(e,t),t,Object.getOwnPropertyNames(e),0,!1)}function te(e){return(t,n)=>{let r=e(t,n);return n.cache.set(t,r),u(t,r,n,Object.getOwnPropertyNames(t),0,!1)}}function ne(e,t){let n=T(e,t);t.cache.set(e,n);let{length:r}=e,i=Object.getOwnPropertyNames(e);return u(e,n,t,i,i[r]===`length`?r+1:r,!1)}function re(){return/* @__PURE__ */ new WeakMap}function ie({createCache:e,maxDepth:t,methods:n,strict:r}){let i={array:r?f:d,arrayBuffer:r?m:p,asyncGenerator:k,blob:r?g:h,dataView:r?v:_,date:r?b:y,error:k,generator:k,map:r?S:x,object:r?w:C,regExp:r?O:D,set:r?ee:A},a=n?Object.assign(i,n):i,o=j(a,r),s=e||re;if(!o.Object||!o.Array)throw Error(`An object and array copier must be provided.`);return{createCache:s,copiers:o,maxDepth:t??1e3,methods:a,strict:!!r}}function j(e,t){let n=t?E:T;return Object.assign(Object.create(null),{Arguments:e.object,Array:e.array,ArrayBuffer:e.arrayBuffer,AsyncGenerator:e.asyncGenerator,BigInt64Array:e.arrayBuffer,BigUint64Array:e.arrayBuffer,Blob:e.blob,Boolean:n,DataView:e.dataView,Date:e.date,Error:e.error,Float32Array:e.arrayBuffer,Float64Array:e.arrayBuffer,Generator:e.generator,Int8Array:e.arrayBuffer,Int16Array:e.arrayBuffer,Int32Array:e.arrayBuffer,Map:e.map,Number:n,Object:e.object,Promise:k,RegExp:e.regExp,Set:e.set,SharedArrayBuffer:e.arrayBuffer,String:t?ne:T,WeakMap:k,WeakSet:k,Uint8Array:e.arrayBuffer,Uint8ClampedArray:e.arrayBuffer,Uint16Array:e.arrayBuffer,Uint32Array:e.arrayBuffer})}function M(e={}){let{createCache:n,copiers:r,maxDepth:i}=ie(e),{Array:o,Object:s}=r;function c(e,n){if(n.prototype=n.Constructor=void 0,!e||typeof e!=`object`)return e;if(n.cache.has(e))return n.cache.get(e);if(++n.depth>i)throw new t(i);n.prototype=Object.getPrototypeOf(e),n.Constructor=n.prototype&&n.prototype.constructor;let c;if(!n.Constructor||n.Constructor===Object)c=s(e,n);else if(Array.isArray(e))c=o(e,n);else{let t=r[a(e)];c=t?t(e,n):typeof e.then==`function`?e:s(e,n)}return--n.depth,c}return function(e){return c(e,{Constructor:void 0,cache:n(),copier:c,depth:0,prototype:void 0})}}let ae=M({strict:!0}),oe=M();e.MaxDepthExceededError=t,e.copy=oe,e.copyStrict=ae,e.createCopier=M})),Vu=/* @__PURE__ */ L(((e,t)=>{t.exports=l;let{createCopier:n}=Bu(),r=n({}),i=zu(),a=Ru(),o=Lu();function s(e,t){let n=o(t);if(n.length===0)return!1;let r=e;for(let e of n){if(typeof r!=`object`||!r||!Object.prototype.hasOwnProperty.call(r,e))return!1;r=r[e]}return!0}function c(e,t,n){let r=o(t),i=r.pop(),a=e;for(let e of r)(a[e]===null||typeof a[e]!=`object`)&&(a[e]={}),a=a[e];a[i]=n}function l({log:e,context:t}){let{ignoreKeys:n,includeKeys:o}=t,l=r(e);if(o){let e={};return o.forEach(t=>{s(l,t)&&c(e,t,a(l,t))}),e}return n.forEach(e=>{i(l,e)}),l}})),Hu=/* @__PURE__ */ L(((e,t)=>{var n;function r(e){"@babel/helpers - typeof";return r=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},r(e)}(function(i){var a=arguments,o=function(){var e=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,t=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,n=/[^-+\dA-Z]/g;return function(r,i,f,p){if(a.length===1&&d(r)===`string`&&!/\d/.test(r)&&(i=r,r=void 0),r=r||r===0?r:/* @__PURE__ */ new Date,r instanceof Date||(r=new Date(r)),isNaN(r))throw TypeError(`Invalid date`);i=String(o.masks[i]||i||o.masks.default);var m=i.slice(0,4);(m===`UTC:`||m===`GMT:`)&&(i=i.slice(4),f=!0,m===`GMT:`&&(p=!0));var h=function(){return f?`getUTC`:`get`},g=function(){return r[h()+`Date`]()},_=function(){return r[h()+`Day`]()},v=function(){return r[h()+`Month`]()},y=function(){return r[h()+`FullYear`]()},b=function(){return r[h()+`Hours`]()},x=function(){return r[h()+`Minutes`]()},S=function(){return r[h()+`Seconds`]()},C=function(){return r[h()+`Milliseconds`]()},w=function(){return f?0:r.getTimezoneOffset()},T=function(){return l(r)},E=function(){return u(r)},D={d:function(){return g()},dd:function(){return s(g())},ddd:function(){return o.i18n.dayNames[_()]},DDD:function(){return c({y:y(),m:v(),d:g(),_:h(),dayName:o.i18n.dayNames[_()],short:!0})},dddd:function(){return o.i18n.dayNames[_()+7]},DDDD:function(){return c({y:y(),m:v(),d:g(),_:h(),dayName:o.i18n.dayNames[_()+7]})},m:function(){return v()+1},mm:function(){return s(v()+1)},mmm:function(){return o.i18n.monthNames[v()]},mmmm:function(){return o.i18n.monthNames[v()+12]},yy:function(){return String(y()).slice(2)},yyyy:function(){return s(y(),4)},h:function(){return b()%12||12},hh:function(){return s(b()%12||12)},H:function(){return b()},HH:function(){return s(b())},M:function(){return x()},MM:function(){return s(x())},s:function(){return S()},ss:function(){return s(S())},l:function(){return s(C(),3)},L:function(){return s(Math.floor(C()/10))},t:function(){return b()<12?o.i18n.timeNames[0]:o.i18n.timeNames[1]},tt:function(){return b()<12?o.i18n.timeNames[2]:o.i18n.timeNames[3]},T:function(){return b()<12?o.i18n.timeNames[4]:o.i18n.timeNames[5]},TT:function(){return b()<12?o.i18n.timeNames[6]:o.i18n.timeNames[7]},Z:function(){return p?`GMT`:f?`UTC`:(String(r).match(t)||[``]).pop().replace(n,``).replace(/GMT\+0000/g,`UTC`)},o:function(){return(w()>0?`-`:`+`)+s(Math.floor(Math.abs(w())/60)*100+Math.abs(w())%60,4)},p:function(){return(w()>0?`-`:`+`)+s(Math.floor(Math.abs(w())/60),2)+`:`+s(Math.floor(Math.abs(w())%60),2)},S:function(){return[`th`,`st`,`nd`,`rd`][g()%10>3?0:(g()%100-g()%10!=10)*g()%10]},W:function(){return T()},WW:function(){return s(T())},N:function(){return E()}};return i.replace(e,function(e){return e in D?D[e]():e.slice(1,e.length-1)})}}();o.masks={default:`ddd mmm dd yyyy HH:MM:ss`,shortDate:`m/d/yy`,paddedShortDate:`mm/dd/yyyy`,mediumDate:`mmm d, yyyy`,longDate:`mmmm d, yyyy`,fullDate:`dddd, mmmm d, yyyy`,shortTime:`h:MM TT`,mediumTime:`h:MM:ss TT`,longTime:`h:MM:ss TT Z`,isoDate:`yyyy-mm-dd`,isoTime:`HH:MM:ss`,isoDateTime:`yyyy-mm-dd'T'HH:MM:sso`,isoUtcDateTime:`UTC:yyyy-mm-dd'T'HH:MM:ss'Z'`,expiresHeaderFormat:`ddd, dd mmm yyyy HH:MM:ss Z`},o.i18n={dayNames:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],monthNames:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`,`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],timeNames:[`a`,`p`,`am`,`pm`,`A`,`P`,`AM`,`PM`]};var s=function(e,t){for(e=String(e),t||=2;e.length<t;)e=`0`+e;return e},c=function(e){var t=e.y,n=e.m,r=e.d,i=e._,a=e.dayName,o=e.short,s=o!==void 0&&o,c=/* @__PURE__ */ new Date,l=/* @__PURE__ */ new Date;l.setDate(l[i+`Date`]()-1);var u=/* @__PURE__ */ new Date;return u.setDate(u[i+`Date`]()+1),function(){return c[i+`FullYear`]()}()===t&&function(){return c[i+`Month`]()}()===n&&function(){return c[i+`Date`]()}()===r?s?`Tdy`:`Today`:function(){return l[i+`FullYear`]()}()===t&&function(){return l[i+`Month`]()}()===n&&function(){return l[i+`Date`]()}()===r?s?`Ysd`:`Yesterday`:function(){return u[i+`FullYear`]()}()===t&&function(){return u[i+`Month`]()}()===n&&function(){return u[i+`Date`]()}()===r?s?`Tmw`:`Tomorrow`:a},l=function(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate());t.setDate(t.getDate()-(t.getDay()+6)%7+3);var n=new Date(t.getFullYear(),0,4);n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=t.getTimezoneOffset()-n.getTimezoneOffset();t.setHours(t.getHours()-r);var i=(t-n)/6048e5;return 1+Math.floor(i)},u=function(e){var t=e.getDay();return t===0&&(t=7),t},d=function(e){return e===null?`null`:e===void 0?`undefined`:r(e)===`object`?Array.isArray(e)?`array`:{}.toString.call(e).slice(8,-1).toLowerCase():r(e)};typeof n==`function`&&n.amd?n(function(){return o}):(e===void 0?`undefined`:r(e))===`object`?t.exports=o:i.dateFormat=o})(void 0)})),Uu=/* @__PURE__ */ L(((e,t)=>{t.exports=s;let{DATE_FORMAT:n,DATE_FORMAT_SIMPLE:r}=ku(),i=Hu(),a=Iu(),o=Fu();function s(e,t=!1){if(t===!1)return e;let s=a(e);if(!o(s))return e;if(t===!0)return i(s,r);let c=t.toUpperCase();if(c===`SYS:STANDARD`)return i(s,n);let l=c.substr(0,4);return l===`SYS:`||l===`UTC:`?l===`UTC:`?i(s,t):i(s,t.slice(4)):i(s,`UTC:${t}`)}})),Wu=/* @__PURE__ */ L(((e,t)=>{t.exports=n;function n(e){return e?typeof e==`string`?e.split(`,`).reduce((e,t,n)=>{let[r,i=n]=t.split(`:`);return e[r.toLowerCase()]=i,e},{}):Object.prototype.toString.call(e)===`[object Object]`?Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{}):{}:{}}})),Gu=/* @__PURE__ */ L(((e,t)=>{t.exports=n;function n(e){return e?typeof e==`string`?e.split(`,`).reduce((e,t,n)=>{let[r,i=n]=t.split(`:`);return e[i]=r.toUpperCase(),e},{default:`USERLVL`}):Object.prototype.toString.call(e)===`[object Object]`?Object.keys(e).reduce((t,n)=>(t[e[n]]=n.toUpperCase(),t),{default:`USERLVL`}):{}:{}}})),Ku=/* @__PURE__ */ L(((e,t)=>{t.exports=r;let n=Ru();function r(e,t){return e=e.replace(/{if (.*?)}([\s\S]*?){end}/g,r),e=e.replace(/{if (.*?)}/g,``),e=e.replace(/{end}/g,``),e=e.replace(/[^\S\r\n]+/g,` `),e=e.replace(/\n[^\S\r\n]*\n/g,`
136
+ `),e.trim();function r(e,r,i){let a=n(t,r);return a&&i.includes(r)?i.replace(RegExp(`{`+r+`}`,`g`),a):``}}})),qu=/* @__PURE__ */ L(((e,t)=>{t.exports=n;function n(e){return Object.prototype.toString.apply(e)===`[object Object]`}})),Ju=/* @__PURE__ */ L(((e,t)=>{t.exports=n;function n({input:e,ident:t=` `,eol:n=`
137
+ `}){let r=e.split(/\r?\n/);for(let e=1;e<r.length;e+=1)r[e]=t+r[e];return r.join(n)}})),Yu=/* @__PURE__ */ L(((e,t)=>{t.exports=s;let{LEVEL_NAMES:n}=ku(),r=ju(),i=Gu(),a=Wu(),o=Au();function s(e){let t=e.crlf?`\r
138
138
  `:`
139
- `,{customPrettifiers:s,errorLikeObjectKeys:c,hideObject:l,levelFirst:u,levelKey:d,levelLabel:f,messageFormat:p,messageKey:m,minimumLevel:h,singleLine:g,timestampKey:_,translateTime:v}=e,y=e.errorProps.split(`,`),b=e.useOnlyCustomProps,x=i(e.customLevels),S=a(e.customLevels),C=o(b,x,S),w;if(e.customColors){if(typeof e.customColors==`string`)w=e.customColors.split(`,`).reduce((t,r)=>{let[i,a]=r.split(`:`),o=(b?e.customLevels:S[i]!==void 0)?S[i]:n[i],s=o===void 0?i:o;return t.push([s,a]),t},[]);else if(typeof e.customColors==`object`)w=Object.keys(e.customColors).reduce((t,r)=>{let[i,a]=[r,e.customColors[r]],o=(b?e.customLevels:S[i]!==void 0)?S[i]:n[i],s=o===void 0?i:o;return t.push([s,a]),t},[]);else throw Error(`options.customColors must be of type string or object.`)}let T={customLevels:x,customLevelNames:S};b===!0&&!e.customLevels&&(T.customLevels=void 0,T.customLevelNames=void 0);let E=e.include===void 0?void 0:new Set(e.include.split(`,`)),D=!E&&e.ignore?new Set(e.ignore.split(`,`)):void 0,O=r(e.colorize,w,b),k=e.colorizeObjects?O:r(!1,[],!1);return{EOL:t,IDENT:` `,colorizer:O,customColors:w,customLevelNames:S,customLevels:x,customPrettifiers:s,customProperties:T,errorLikeObjectKeys:c,errorProps:y,getLevelLabelData:C,hideObject:l,ignoreKeys:D,includeKeys:E,levelFirst:u,levelKey:d,levelLabel:f,messageFormat:p,messageKey:m,minimumLevel:h,objectColorizer:k,singleLine:g,timestampKey:_,translateTime:v,useOnlyCustomProps:b}}})),Yu=/* @__PURE__ */ L(((e,t)=>{t.exports=s,s.default=s,s.stable=d,s.stableStringify=d;var n=`[...]`,r=`[Circular]`,i=[],a=[];function o(){return{depthLimit:2**53-1,edgesLimit:2**53-1}}function s(e,t,n,r){r===void 0&&(r=o()),l(e,``,0,[],void 0,0,r);var s;try{s=a.length===0?JSON.stringify(e,t,n):JSON.stringify(e,p(t),n)}catch{return JSON.stringify(`[unable to serialize, circular reference is too complex to analyze]`)}finally{for(;i.length!==0;){var c=i.pop();c.length===4?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function c(e,t,n,r){var o=Object.getOwnPropertyDescriptor(r,n);o.get===void 0?(r[n]=e,i.push([r,n,t])):o.configurable?(Object.defineProperty(r,n,{value:e}),i.push([r,n,t,o])):a.push([t,n,e])}function l(e,t,i,a,o,s,u){s+=1;var d;if(typeof e==`object`&&e){for(d=0;d<a.length;d++)if(a[d]===e){c(r,e,t,o);return}if(u.depthLimit!==void 0&&s>u.depthLimit||u.edgesLimit!==void 0&&i+1>u.edgesLimit){c(n,e,t,o);return}if(a.push(e),Array.isArray(e))for(d=0;d<e.length;d++)l(e[d],d,d,a,e,s,u);else{var f=Object.keys(e);for(d=0;d<f.length;d++){var p=f[d];l(e[p],p,d,a,e,s,u)}}a.pop()}}function u(e,t){return e<t?-1:+(e>t)}function d(e,t,n,r){r===void 0&&(r=o());var s=f(e,``,0,[],void 0,0,r)||e,c;try{c=a.length===0?JSON.stringify(s,t,n):JSON.stringify(s,p(t),n)}catch{return JSON.stringify(`[unable to serialize, circular reference is too complex to analyze]`)}finally{for(;i.length!==0;){var l=i.pop();l.length===4?Object.defineProperty(l[0],l[1],l[3]):l[0][l[1]]=l[2]}}return c}function f(e,t,a,o,s,l,d){l+=1;var p;if(typeof e==`object`&&e){for(p=0;p<o.length;p++)if(o[p]===e){c(r,e,t,s);return}try{if(typeof e.toJSON==`function`)return}catch{return}if(d.depthLimit!==void 0&&l>d.depthLimit||d.edgesLimit!==void 0&&a+1>d.edgesLimit){c(n,e,t,s);return}if(o.push(e),Array.isArray(e))for(p=0;p<e.length;p++)f(e[p],p,p,o,e,l,d);else{var m={},h=Object.keys(e).sort(u);for(p=0;p<h.length;p++){var g=h[p];f(e[g],g,p,o,e,l,d),m[g]=e[g]}if(s!==void 0)i.push([s,t,e]),s[t]=m;else return m}o.pop()}}function p(e){return e=e===void 0?function(e,t){return t}:e,function(t,n){if(a.length>0)for(var r=0;r<a.length;r++){var i=a[r];if(i[1]===t&&i[0]===n){n=i[2],a.splice(r,1);break}}return e.call(this,t,n)}}})),Xu=/* @__PURE__ */ L(((e,t)=>{t.exports=r;let n=/[\u0000-\u0008\u000B-\u001F\u007F-\u009F]/g;function r(e){return String(e).replace(n,``)}})),Zu=/* @__PURE__ */ L(((e,t)=>{t.exports=i;let n=qu(),r=Xu();function i({keyName:e,lines:t,eol:i,ident:a,sanitizeStack:o=!0}){let s=``,c=n({input:t,ident:a,eol:i}),l=`${a}${r(e)}: ${c}${i}`.split(i);for(let e=0;e<l.length;e+=1){e!==0&&(s+=i);let t=l[e];if(/^\s*"stack"/.test(t)){let e=/^(\s*"stack":)\s*(".*"),?$/.exec(t);
139
+ `,{customPrettifiers:s,errorLikeObjectKeys:c,hideObject:l,levelFirst:u,levelKey:d,levelLabel:f,messageFormat:p,messageKey:m,minimumLevel:h,singleLine:g,timestampKey:_,translateTime:v}=e,y=e.errorProps.split(`,`),b=e.useOnlyCustomProps,x=i(e.customLevels),S=a(e.customLevels),C=o(b,x,S),w;if(e.customColors){if(typeof e.customColors==`string`)w=e.customColors.split(`,`).reduce((t,r)=>{let[i,a]=r.split(`:`),o=(b?e.customLevels:S[i]!==void 0)?S[i]:n[i],s=o===void 0?i:o;return t.push([s,a]),t},[]);else if(typeof e.customColors==`object`)w=Object.keys(e.customColors).reduce((t,r)=>{let[i,a]=[r,e.customColors[r]],o=(b?e.customLevels:S[i]!==void 0)?S[i]:n[i],s=o===void 0?i:o;return t.push([s,a]),t},[]);else throw Error(`options.customColors must be of type string or object.`)}let T={customLevels:x,customLevelNames:S};b===!0&&!e.customLevels&&(T.customLevels=void 0,T.customLevelNames=void 0);let E=e.include===void 0?void 0:new Set(e.include.split(`,`)),D=!E&&e.ignore?new Set(e.ignore.split(`,`)):void 0,O=r(e.colorize,w,b),k=e.colorizeObjects?O:r(!1,[],!1);return{EOL:t,IDENT:` `,colorizer:O,customColors:w,customLevelNames:S,customLevels:x,customPrettifiers:s,customProperties:T,errorLikeObjectKeys:c,errorProps:y,getLevelLabelData:C,hideObject:l,ignoreKeys:D,includeKeys:E,levelFirst:u,levelKey:d,levelLabel:f,messageFormat:p,messageKey:m,minimumLevel:h,objectColorizer:k,singleLine:g,timestampKey:_,translateTime:v,useOnlyCustomProps:b}}})),Xu=/* @__PURE__ */ L(((e,t)=>{t.exports=s,s.default=s,s.stable=d,s.stableStringify=d;var n=`[...]`,r=`[Circular]`,i=[],a=[];function o(){return{depthLimit:2**53-1,edgesLimit:2**53-1}}function s(e,t,n,r){r===void 0&&(r=o()),l(e,``,0,[],void 0,0,r);var s;try{s=a.length===0?JSON.stringify(e,t,n):JSON.stringify(e,p(t),n)}catch{return JSON.stringify(`[unable to serialize, circular reference is too complex to analyze]`)}finally{for(;i.length!==0;){var c=i.pop();c.length===4?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function c(e,t,n,r){var o=Object.getOwnPropertyDescriptor(r,n);o.get===void 0?(r[n]=e,i.push([r,n,t])):o.configurable?(Object.defineProperty(r,n,{value:e}),i.push([r,n,t,o])):a.push([t,n,e])}function l(e,t,i,a,o,s,u){s+=1;var d;if(typeof e==`object`&&e){for(d=0;d<a.length;d++)if(a[d]===e){c(r,e,t,o);return}if(u.depthLimit!==void 0&&s>u.depthLimit||u.edgesLimit!==void 0&&i+1>u.edgesLimit){c(n,e,t,o);return}if(a.push(e),Array.isArray(e))for(d=0;d<e.length;d++)l(e[d],d,d,a,e,s,u);else{var f=Object.keys(e);for(d=0;d<f.length;d++){var p=f[d];l(e[p],p,d,a,e,s,u)}}a.pop()}}function u(e,t){return e<t?-1:+(e>t)}function d(e,t,n,r){r===void 0&&(r=o());var s=f(e,``,0,[],void 0,0,r)||e,c;try{c=a.length===0?JSON.stringify(s,t,n):JSON.stringify(s,p(t),n)}catch{return JSON.stringify(`[unable to serialize, circular reference is too complex to analyze]`)}finally{for(;i.length!==0;){var l=i.pop();l.length===4?Object.defineProperty(l[0],l[1],l[3]):l[0][l[1]]=l[2]}}return c}function f(e,t,a,o,s,l,d){l+=1;var p;if(typeof e==`object`&&e){for(p=0;p<o.length;p++)if(o[p]===e){c(r,e,t,s);return}try{if(typeof e.toJSON==`function`)return}catch{return}if(d.depthLimit!==void 0&&l>d.depthLimit||d.edgesLimit!==void 0&&a+1>d.edgesLimit){c(n,e,t,s);return}if(o.push(e),Array.isArray(e))for(p=0;p<e.length;p++)f(e[p],p,p,o,e,l,d);else{var m={},h=Object.keys(e).sort(u);for(p=0;p<h.length;p++){var g=h[p];f(e[g],g,p,o,e,l,d),m[g]=e[g]}if(s!==void 0)i.push([s,t,e]),s[t]=m;else return m}o.pop()}}function p(e){return e=e===void 0?function(e,t){return t}:e,function(t,n){if(a.length>0)for(var r=0;r<a.length;r++){var i=a[r];if(i[1]===t&&i[0]===n){n=i[2],a.splice(r,1);break}}return e.call(this,t,n)}}})),Zu=/* @__PURE__ */ L(((e,t)=>{t.exports=r;let n=/[\u0000-\u0008\u000B-\u001F\u007F-\u009F]/g;function r(e){return String(e).replace(n,``)}})),Qu=/* @__PURE__ */ L(((e,t)=>{t.exports=i;let n=Ju(),r=Zu();function i({keyName:e,lines:t,eol:i,ident:a,sanitizeStack:o=!0}){let s=``,c=n({input:t,ident:a,eol:i}),l=`${a}${r(e)}: ${c}${i}`.split(i);for(let e=0;e<l.length;e+=1){e!==0&&(s+=i);let t=l[e];if(/^\s*"stack"/.test(t)){let e=/^(\s*"stack":)\s*(".*"),?$/.exec(t);
140
140
  /* istanbul ignore else */
141
- if(e&&e.length===3){let n=/^\s*/.exec(t)[0].length+4,a=` `.repeat(n),c=e[2],l=JSON.parse(c),u=o?r(l):l;s+=e[1]+i+a+u.replace(/\n/g,i+a)}else s+=t}else s+=t}return s}})),Qu=/* @__PURE__ */ L(((e,t)=>{t.exports=s;let{LOGGER_KEYS:n}=Ou(),r=Yu(),i=qu(),a=Zu(),o=Xu();function s({log:e,excludeLoggerKeys:t=!0,skipKeys:s=[],context:c}){let{EOL:l,IDENT:u,customPrettifiers:d,errorLikeObjectKeys:f,objectColorizer:p,singleLine:m,colorizer:h}=c,g=[].concat(s);
141
+ if(e&&e.length===3){let n=/^\s*/.exec(t)[0].length+4,a=` `.repeat(n),c=e[2],l=JSON.parse(c),u=o?r(l):l;s+=e[1]+i+a+u.replace(/\n/g,i+a)}else s+=t}else s+=t}return s}})),$u=/* @__PURE__ */ L(((e,t)=>{t.exports=s;let{LOGGER_KEYS:n}=ku(),r=Xu(),i=Ju(),a=Qu(),o=Zu();function s({log:e,excludeLoggerKeys:t=!0,skipKeys:s=[],context:c}){let{EOL:l,IDENT:u,customPrettifiers:d,errorLikeObjectKeys:f,objectColorizer:p,singleLine:m,colorizer:h}=c,g=[].concat(s);
142
142
  /* istanbul ignore else */
143
- t===!0&&Array.prototype.push.apply(g,n);let _=``,{plain:v,errors:y}=Object.entries(e).reduce(({plain:t,errors:n},[r,i])=>{if(g.includes(r)===!1){let a=typeof d[r]==`function`?d[r](i,r,e,{colors:h.colors}):i;f.includes(r)?n[r]=a:t[r]=a}return{plain:t,errors:n}},{plain:{},errors:{}});return m?(Object.keys(v).length>0&&(_+=p.greyMessage(r(v))),_+=l,_=_.replace(/\\\\/gi,`\\`)):Object.entries(v).forEach(([e,t])=>{let n=typeof d[e]==`function`?t:r(t,null,2);if(n===void 0)return;n=n.replace(/\\\\/gi,`\\`);let a=i({input:n,ident:u,eol:l}),s=o(e);_+=`${u}${p.property(s)}:${a.startsWith(l)?``:` `}${a}${l}`}),Object.entries(y).forEach(([e,t])=>{let n=typeof d[e]==`function`,i=n?t:r(t,null,2);i!==void 0&&(_+=a({keyName:e,lines:i,eol:l,ident:u,sanitizeStack:!n}))}),_}})),$u=/* @__PURE__ */ L(((e,t)=>{t.exports=s;let{LOGGER_KEYS:n}=Ou(),r=Ku(),i=qu(),a=Qu(),o=Xu();function s({log:e,context:t}){let{EOL:s,IDENT:c,errorProps:l,messageKey:u}=t,d=o(e.stack),f=`${c}${i({input:d,ident:c,eol:s})}${s}`;if(l.length>0){let i=n.concat(u,`type`,`stack`),d;d=l[0]===`*`?Object.keys(e).filter(e=>i.includes(e)===!1):l.filter(e=>i.includes(e)===!1);for(let n=0;n<d.length;n+=1){let i=d[n];if(!(i in e))continue;let l=o(i);if(r(e[i])){let n=a({log:e[i],excludeLoggerKeys:!1,context:{...t,IDENT:c+c}});f=`${f}${c}${l}: {${s}${n}${c}}${s}`;continue}let u=o(e[i]);f=`${f}${c}${l}: ${u}${s}`}}return f}})),ed=/* @__PURE__ */ L(((e,t)=>{t.exports=r;let n=Lu();function r({log:e,context:t}){let{colorizer:r,customLevels:i,customLevelNames:a,levelKey:o,getLevelLabelData:s}=t,c=t.customPrettifiers?.level,l=n(e,o);if(l===void 0)return;let u=r(l,{customLevels:i,customLevelNames:a});if(c){let[t]=s(l);return c(l,o,e,{label:t,labelColorized:u,colors:r.colors})}return u}})),td=/* @__PURE__ */ L(((e,t)=>{t.exports=o;let{LEVELS:n}=Ou(),r=Lu(),i=Gu(),a=Xu();function o({log:e,context:t}){let{colorizer:o,customLevels:s,levelKey:c,levelLabel:l,messageFormat:u,messageKey:d,useOnlyCustomProps:f}=t;if(u&&typeof u==`string`){let t=i(u,e),d=String(t).replace(/{([^{}]+)}/g,function(t,i){let a;if(i===l&&(a=r(e,c))!==void 0)return(f?s===void 0:s[a]===void 0)?n[a]:s[a];let o=r(e,i);return o===void 0?``:o});return o.message(a(d))}if(u&&typeof u==`function`){let t=u(e,d,l,{colors:o.colors});return o.message(t)}if(d in e&&(typeof e[d]==`string`||typeof e[d]==`number`||typeof e[d]==`boolean`))return o.message(a(e[d]))}})),nd=/* @__PURE__ */ L(((e,t)=>{t.exports=r;let n=Xu();function r({log:e,context:t}){let{customPrettifiers:r,colorizer:i}=t,a=``;if(e.name||e.pid||e.hostname){if(a+=`(`,e.name&&(a+=r.name?r.name(e.name,`name`,e,{colors:i.colors}):n(e.name)),e.pid){let t=r.pid?r.pid(e.pid,`pid`,e,{colors:i.colors}):n(e.pid);e.name&&e.pid?a+=`/`+t:a+=t}if(e.hostname){let t=r.hostname?r.hostname(e.hostname,`hostname`,e,{colors:i.colors}):n(e.hostname);a+=`${a===`(`?`on`:` on`} ${t}`}a+=`)`}if(e.caller){let t=r.caller?r.caller(e.caller,`caller`,e,{colors:i.colors}):n(e.caller);a+=`${a===``?``:` `}<${t}>`}if(a!==``)return a}})),rd=/* @__PURE__ */ L(((e,t)=>{t.exports=i;let n=Hu(),r=Xu();function i({log:e,context:t}){let{timestampKey:i,translateTime:a}=t,o=t.customPrettifiers?.time,s=null;if(i in e?s=e[i]:`timestamp`in e&&(s=e.timestamp),s===null)return;let c=a?n(s,a):s;return o?o(c):`[${r(c)}]`}})),id=/* @__PURE__ */ L(((e,t)=>{t.exports={buildSafeSonicBoom:Nu(),createDate:Fu(),deleteLogProperty:Ru(),filterLog:Bu(),formatTime:Hu(),getPropertyValue:Lu(),handleCustomLevelsNamesOpts:Uu(),handleCustomLevelsOpts:Wu(),interpretConditionals:Gu(),isObject:Ku(),isValidDate:Pu(),joinLinesWithIndentation:qu(),noop:Mu(),parseFactoryOptions:Ju(),prettifyErrorLog:$u(),prettifyError:Zu(),prettifyLevel:ed(),prettifyMessage:td(),prettifyMetadata:nd(),prettifyObject:Qu(),prettifyTime:rd(),splitPropertyKey:Iu(),stripUnsafeControlChars:Xu(),getLevelLabelData:ku()}})),ad=/* @__PURE__ */ L(((e,t)=>{let n=typeof Buffer<`u`,r=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,i=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function a(e,t,a){a==null&&typeof t==`object`&&t&&(a=t,t=void 0),n&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));let s=JSON.parse(e,t);if(typeof s!=`object`||!s)return s;let c=a&&a.protoAction||`error`,l=a&&a.constructorAction||`error`;if(c===`ignore`&&l===`ignore`)return s;if(c!==`ignore`&&l!==`ignore`){if(r.test(e)===!1&&i.test(e)===!1)return s}else if(c!==`ignore`&&l===`ignore`){if(r.test(e)===!1)return s}else if(i.test(e)===!1)return s;return o(s,{protoAction:c,constructorAction:l,safe:a&&a.safe})}function o(e,{protoAction:t=`error`,constructorAction:n=`error`,safe:r}={}){let i=[e];for(;i.length;){let e=i;i=[];for(let a of e){if(t!==`ignore`&&Object.prototype.hasOwnProperty.call(a,`__proto__`)){if(r===!0)return null;if(t===`error`)throw SyntaxError(`Object contains forbidden prototype property`);delete a.__proto__}if(n!==`ignore`&&Object.prototype.hasOwnProperty.call(a,`constructor`)&&a.constructor!==null&&typeof a.constructor==`object`&&Object.prototype.hasOwnProperty.call(a.constructor,`prototype`)){if(r===!0)return null;if(n===`error`)throw SyntaxError(`Object contains forbidden prototype property`);delete a.constructor}for(let e in a){let t=a[e];t&&typeof t==`object`&&i.push(t)}}}return e}function s(e,t,n){let{stackTraceLimit:r}=Error;Error.stackTraceLimit=0;try{return a(e,t,n)}finally{Error.stackTraceLimit=r}}t.exports=s,t.exports.default=s,t.exports.parse=s,t.exports.safeParse=function(e,t){let{stackTraceLimit:n}=Error;Error.stackTraceLimit=0;let r;try{r=a(e,t,{safe:!0})}catch{r=void 0}finally{Error.stackTraceLimit=n}return r},t.exports.scan=o})),od=/* @__PURE__ */ L(((e,t)=>{t.exports=h;let n=ad(),r=Ku(),i=$u(),a=ed(),o=td(),s=nd(),c=Qu(),l=rd(),u=Bu(),{LEVELS:d,LEVEL_KEY:f,LEVEL_NAMES:p}=Ou(),m=e=>{try{return{value:n.parse(e,{protoAction:`remove`})}}catch(e){return{err:e}}};function h(e){let t;if(r(e))t=e;else{let n=m(e);if(n.err||!r(n.value))return e+this.EOL;t=n.value}if(this.minimumLevel){let e;e=this.useOnlyCustomProps?this.customLevels:this.customLevelNames[this.minimumLevel]!==void 0;let n;if(n=e?this.customLevelNames[this.minimumLevel]:p[this.minimumLevel],n||=typeof this.minimumLevel==`string`?p[this.minimumLevel]:p[d[this.minimumLevel].toLowerCase()],t[this.levelKey===void 0?f:this.levelKey]<n)return}let n=o({log:t,context:this.context});(this.ignoreKeys||this.includeKeys)&&(t=u({log:t,context:this.context}));let h=a({log:t,context:{...this.context,...this.context.customProperties}}),g=s({log:t,context:this.context}),_=l({log:t,context:this.context}),v=``;if(this.levelFirst&&h&&(v=`${h}`),_&&v===``?v=`${_}`:_&&(v=`${v} ${_}`),!this.levelFirst&&h&&(v=v.length>0?`${v} ${h}`:h),g&&(v=v.length>0?`${v} ${g}:`:g),v.endsWith(`:`)===!1&&v!==``&&(v+=`:`),n!==void 0&&(v=v.length>0?`${v} ${n}`:n),v.length>0&&!this.singleLine&&(v+=this.EOL),t.type===`Error`&&typeof t.stack==`string`){let e=i({log:t,context:this.context});this.singleLine&&(v+=this.EOL),v+=e}else if(this.hideObject===!1){let e=[this.messageKey,this.levelKey,this.timestampKey].map(e=>e.replaceAll(/\\/g,``)).filter(e=>typeof t[e]==`string`||typeof t[e]==`number`||typeof t[e]==`boolean`),n=c({log:t,skipKeys:e,context:this.context});this.singleLine&&!/^\s$/.test(n)&&(v+=` `),v+=n}return v}})),sd=/* @__PURE__ */ pe((/* @__PURE__ */ L(((e,t)=>{let{isColorSupported:n}=xu(),r=Tu(),{Transform:i}=z(`node:stream`),a=Du(),o=Au(),{ERROR_LIKE_KEYS:s,LEVEL_KEY:c,LEVEL_LABEL:l,MESSAGE_KEY:u,TIMESTAMP_KEY:d}=Ou(),{buildSafeSonicBoom:f,parseFactoryOptions:p}=id(),m=od(),h={colorize:n,colorizeObjects:!0,crlf:!1,customColors:null,customLevels:null,customPrettifiers:{},errorLikeObjectKeys:s,errorProps:``,hideObject:!1,ignore:`hostname`,include:void 0,levelFirst:!1,levelKey:c,levelLabel:l,messageFormat:null,messageKey:u,minimumLevel:void 0,singleLine:!1,timestampKey:d,translateTime:!0,useOnlyCustomProps:!0};function g(e){return e===`true`||e!==`false`&&e}function _(e){let t={...e};for(let e of[`colorize`,`colorizeObjects`,`crlf`,`hideObject`,`levelFirst`,`singleLine`,`useOnlyCustomProps`])e in t&&(t[e]=g(t[e]));return`translateTime`in t&&(t.translateTime===`true`||t.translateTime===`false`)&&(t.translateTime=g(t.translateTime)),t}function v(e){let t=_(Object.assign({},h,e)),n=p(t);return m.bind({...n,context:n})}function y(e={}){let t=v(e),n;return a(function(a){a.on(`message`,function n(r){r&&r.code===`PINO_CONFIG`&&(Object.assign(e,{messageKey:r.config.messageKey,errorLikeObjectKeys:Array.from(/* @__PURE__ */ new Set([...e.errorLikeObjectKeys||s,r.config.errorKey])),customLevels:r.config.levels.values}),t=v(e),a.off(`message`,n))});let o=new i({objectMode:!0,autoDestroy:!0,transform(e,n,r){r(null,t(e))}});return n=typeof e.destination==`object`&&typeof e.destination.write==`function`?e.destination:f({dest:e.destination||1,append:e.append,mkdir:e.mkdir,sync:e.sync}),a.on(`unknown`,function(e){n.write(e+`
144
- `)}),r(a,o,n),o},{parse:`lines`,close(e,t){n.on(`close`,()=>{t(e)})}})}t.exports=y,t.exports.build=y,t.exports.PinoPretty=y,t.exports.prettyFactory=v,t.exports.colorizerFactory=o,t.exports.isColorSupported=n,t.exports.default=y})))(),1),cd=class{module;constructor(e=`Noop`){this.module=e}debug(e,t){}info(e,t){}warn(e,t){}error(e,t,n){}withOperation(e){return this}withTrace(e){return this}flush(){return Promise.resolve()}getModule(){return this.module}};function ld(e=`Noop`){return new cd(e)}ld(`App`);const ud={colorize:!0,translateTime:`SYS:HH:MM:ss`,ignore:`pid,hostname,module`,messageFormat:`{msg}`,singleLine:!0};let dd=!1;function fd(){return e(import.meta.url).resolve(`pino-pretty`)}function pd(e){return(0,sd.default)({...ud,...e})}function md(e){return{target:fd(),options:{...ud,...e}}}const hd={enableTracing:!0,prettyMode:`stream`,output:`stdout`};function gd(){return dd}function _d(){dd=!0}function vd(e={}){let t={...hd,...e},n=process.env.NODE_ENV!==`production`,r=t.output===`stderr`,i=r?{...e.prettyOptions,destination:2}:e.prettyOptions,a=e.transport??(n&&t.prettyMode===`transport`?md(i):void 0),o=n&&!e.transport&&t.prettyMode===`stream`?pd(i):void 0,s=o===void 0&&a===void 0&&r?process.stderr:void 0;au({minLevel:e.minLevel??(n?`debug`:`info`),enableConsole:!0,autoTracing:t.enableTracing,transport:a,stream:o??s}),t.enableTracing&&vu(bu())}function yd(){gd()||(_d(),vd())}function bd(e={}){_d(),vd(e)}function xd(e){yd();let t=mu(e),n=yu();return n?t.withTrace(n):t}bd();var Sd=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},Cd=class extends Sd{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}},wd=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new Cd(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,t):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Td(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}var Ed=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description).helpGroup(n.helpGroupHeading)):n.short&&!r&&t.push(e.createOption(n.short,n.description).helpGroup(n.helpGroupHeading))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(e=>Td(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(t?` `+t:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=/* @__PURE__ */ new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
143
+ t===!0&&Array.prototype.push.apply(g,n);let _=``,{plain:v,errors:y}=Object.entries(e).reduce(({plain:t,errors:n},[r,i])=>{if(g.includes(r)===!1){let a=typeof d[r]==`function`?d[r](i,r,e,{colors:h.colors}):i;f.includes(r)?n[r]=a:t[r]=a}return{plain:t,errors:n}},{plain:{},errors:{}});return m?(Object.keys(v).length>0&&(_+=p.greyMessage(r(v))),_+=l,_=_.replace(/\\\\/gi,`\\`)):Object.entries(v).forEach(([e,t])=>{let n=typeof d[e]==`function`?t:r(t,null,2);if(n===void 0)return;n=n.replace(/\\\\/gi,`\\`);let a=i({input:n,ident:u,eol:l}),s=o(e);_+=`${u}${p.property(s)}:${a.startsWith(l)?``:` `}${a}${l}`}),Object.entries(y).forEach(([e,t])=>{let n=typeof d[e]==`function`,i=n?t:r(t,null,2);i!==void 0&&(_+=a({keyName:e,lines:i,eol:l,ident:u,sanitizeStack:!n}))}),_}})),ed=/* @__PURE__ */ L(((e,t)=>{t.exports=s;let{LOGGER_KEYS:n}=ku(),r=qu(),i=Ju(),a=$u(),o=Zu();function s({log:e,context:t}){let{EOL:s,IDENT:c,errorProps:l,messageKey:u}=t,d=o(e.stack),f=`${c}${i({input:d,ident:c,eol:s})}${s}`;if(l.length>0){let i=n.concat(u,`type`,`stack`),d;d=l[0]===`*`?Object.keys(e).filter(e=>i.includes(e)===!1):l.filter(e=>i.includes(e)===!1);for(let n=0;n<d.length;n+=1){let i=d[n];if(!(i in e))continue;let l=o(i);if(r(e[i])){let n=a({log:e[i],excludeLoggerKeys:!1,context:{...t,IDENT:c+c}});f=`${f}${c}${l}: {${s}${n}${c}}${s}`;continue}let u=o(e[i]);f=`${f}${c}${l}: ${u}${s}`}}return f}})),td=/* @__PURE__ */ L(((e,t)=>{t.exports=r;let n=Ru();function r({log:e,context:t}){let{colorizer:r,customLevels:i,customLevelNames:a,levelKey:o,getLevelLabelData:s}=t,c=t.customPrettifiers?.level,l=n(e,o);if(l===void 0)return;let u=r(l,{customLevels:i,customLevelNames:a});if(c){let[t]=s(l);return c(l,o,e,{label:t,labelColorized:u,colors:r.colors})}return u}})),nd=/* @__PURE__ */ L(((e,t)=>{t.exports=o;let{LEVELS:n}=ku(),r=Ru(),i=Ku(),a=Zu();function o({log:e,context:t}){let{colorizer:o,customLevels:s,levelKey:c,levelLabel:l,messageFormat:u,messageKey:d,useOnlyCustomProps:f}=t;if(u&&typeof u==`string`){let t=i(u,e),d=String(t).replace(/{([^{}]+)}/g,function(t,i){let a;if(i===l&&(a=r(e,c))!==void 0)return(f?s===void 0:s[a]===void 0)?n[a]:s[a];let o=r(e,i);return o===void 0?``:o});return o.message(a(d))}if(u&&typeof u==`function`){let t=u(e,d,l,{colors:o.colors});return o.message(t)}if(d in e&&(typeof e[d]==`string`||typeof e[d]==`number`||typeof e[d]==`boolean`))return o.message(a(e[d]))}})),rd=/* @__PURE__ */ L(((e,t)=>{t.exports=r;let n=Zu();function r({log:e,context:t}){let{customPrettifiers:r,colorizer:i}=t,a=``;if(e.name||e.pid||e.hostname){if(a+=`(`,e.name&&(a+=r.name?r.name(e.name,`name`,e,{colors:i.colors}):n(e.name)),e.pid){let t=r.pid?r.pid(e.pid,`pid`,e,{colors:i.colors}):n(e.pid);e.name&&e.pid?a+=`/`+t:a+=t}if(e.hostname){let t=r.hostname?r.hostname(e.hostname,`hostname`,e,{colors:i.colors}):n(e.hostname);a+=`${a===`(`?`on`:` on`} ${t}`}a+=`)`}if(e.caller){let t=r.caller?r.caller(e.caller,`caller`,e,{colors:i.colors}):n(e.caller);a+=`${a===``?``:` `}<${t}>`}if(a!==``)return a}})),id=/* @__PURE__ */ L(((e,t)=>{t.exports=i;let n=Uu(),r=Zu();function i({log:e,context:t}){let{timestampKey:i,translateTime:a}=t,o=t.customPrettifiers?.time,s=null;if(i in e?s=e[i]:`timestamp`in e&&(s=e.timestamp),s===null)return;let c=a?n(s,a):s;return o?o(c):`[${r(c)}]`}})),ad=/* @__PURE__ */ L(((e,t)=>{t.exports={buildSafeSonicBoom:Pu(),createDate:Iu(),deleteLogProperty:zu(),filterLog:Vu(),formatTime:Uu(),getPropertyValue:Ru(),handleCustomLevelsNamesOpts:Wu(),handleCustomLevelsOpts:Gu(),interpretConditionals:Ku(),isObject:qu(),isValidDate:Fu(),joinLinesWithIndentation:Ju(),noop:Nu(),parseFactoryOptions:Yu(),prettifyErrorLog:ed(),prettifyError:Qu(),prettifyLevel:td(),prettifyMessage:nd(),prettifyMetadata:rd(),prettifyObject:$u(),prettifyTime:id(),splitPropertyKey:Lu(),stripUnsafeControlChars:Zu(),getLevelLabelData:Au()}})),od=/* @__PURE__ */ L(((e,t)=>{let n=typeof Buffer<`u`,r=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,i=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function a(e,t,a){a==null&&typeof t==`object`&&t&&(a=t,t=void 0),n&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));let s=JSON.parse(e,t);if(typeof s!=`object`||!s)return s;let c=a&&a.protoAction||`error`,l=a&&a.constructorAction||`error`;if(c===`ignore`&&l===`ignore`)return s;if(c!==`ignore`&&l!==`ignore`){if(r.test(e)===!1&&i.test(e)===!1)return s}else if(c!==`ignore`&&l===`ignore`){if(r.test(e)===!1)return s}else if(i.test(e)===!1)return s;return o(s,{protoAction:c,constructorAction:l,safe:a&&a.safe})}function o(e,{protoAction:t=`error`,constructorAction:n=`error`,safe:r}={}){let i=[e];for(;i.length;){let e=i;i=[];for(let a of e){if(t!==`ignore`&&Object.prototype.hasOwnProperty.call(a,`__proto__`)){if(r===!0)return null;if(t===`error`)throw SyntaxError(`Object contains forbidden prototype property`);delete a.__proto__}if(n!==`ignore`&&Object.prototype.hasOwnProperty.call(a,`constructor`)&&a.constructor!==null&&typeof a.constructor==`object`&&Object.prototype.hasOwnProperty.call(a.constructor,`prototype`)){if(r===!0)return null;if(n===`error`)throw SyntaxError(`Object contains forbidden prototype property`);delete a.constructor}for(let e in a){let t=a[e];t&&typeof t==`object`&&i.push(t)}}}return e}function s(e,t,n){let{stackTraceLimit:r}=Error;Error.stackTraceLimit=0;try{return a(e,t,n)}finally{Error.stackTraceLimit=r}}t.exports=s,t.exports.default=s,t.exports.parse=s,t.exports.safeParse=function(e,t){let{stackTraceLimit:n}=Error;Error.stackTraceLimit=0;let r;try{r=a(e,t,{safe:!0})}catch{r=void 0}finally{Error.stackTraceLimit=n}return r},t.exports.scan=o})),sd=/* @__PURE__ */ L(((e,t)=>{t.exports=h;let n=od(),r=qu(),i=ed(),a=td(),o=nd(),s=rd(),c=$u(),l=id(),u=Vu(),{LEVELS:d,LEVEL_KEY:f,LEVEL_NAMES:p}=ku(),m=e=>{try{return{value:n.parse(e,{protoAction:`remove`})}}catch(e){return{err:e}}};function h(e){let t;if(r(e))t=e;else{let n=m(e);if(n.err||!r(n.value))return e+this.EOL;t=n.value}if(this.minimumLevel){let e;e=this.useOnlyCustomProps?this.customLevels:this.customLevelNames[this.minimumLevel]!==void 0;let n;if(n=e?this.customLevelNames[this.minimumLevel]:p[this.minimumLevel],n||=typeof this.minimumLevel==`string`?p[this.minimumLevel]:p[d[this.minimumLevel].toLowerCase()],t[this.levelKey===void 0?f:this.levelKey]<n)return}let n=o({log:t,context:this.context});(this.ignoreKeys||this.includeKeys)&&(t=u({log:t,context:this.context}));let h=a({log:t,context:{...this.context,...this.context.customProperties}}),g=s({log:t,context:this.context}),_=l({log:t,context:this.context}),v=``;if(this.levelFirst&&h&&(v=`${h}`),_&&v===``?v=`${_}`:_&&(v=`${v} ${_}`),!this.levelFirst&&h&&(v=v.length>0?`${v} ${h}`:h),g&&(v=v.length>0?`${v} ${g}:`:g),v.endsWith(`:`)===!1&&v!==``&&(v+=`:`),n!==void 0&&(v=v.length>0?`${v} ${n}`:n),v.length>0&&!this.singleLine&&(v+=this.EOL),t.type===`Error`&&typeof t.stack==`string`){let e=i({log:t,context:this.context});this.singleLine&&(v+=this.EOL),v+=e}else if(this.hideObject===!1){let e=[this.messageKey,this.levelKey,this.timestampKey].map(e=>e.replaceAll(/\\/g,``)).filter(e=>typeof t[e]==`string`||typeof t[e]==`number`||typeof t[e]==`boolean`),n=c({log:t,skipKeys:e,context:this.context});this.singleLine&&!/^\s$/.test(n)&&(v+=` `),v+=n}return v}})),cd=/* @__PURE__ */ pe((/* @__PURE__ */ L(((e,t)=>{let{isColorSupported:n}=Su(),r=Eu(),{Transform:i}=z(`node:stream`),a=Ou(),o=ju(),{ERROR_LIKE_KEYS:s,LEVEL_KEY:c,LEVEL_LABEL:l,MESSAGE_KEY:u,TIMESTAMP_KEY:d}=ku(),{buildSafeSonicBoom:f,parseFactoryOptions:p}=ad(),m=sd(),h={colorize:n,colorizeObjects:!0,crlf:!1,customColors:null,customLevels:null,customPrettifiers:{},errorLikeObjectKeys:s,errorProps:``,hideObject:!1,ignore:`hostname`,include:void 0,levelFirst:!1,levelKey:c,levelLabel:l,messageFormat:null,messageKey:u,minimumLevel:void 0,singleLine:!1,timestampKey:d,translateTime:!0,useOnlyCustomProps:!0};function g(e){return e===`true`||e!==`false`&&e}function _(e){let t={...e};for(let e of[`colorize`,`colorizeObjects`,`crlf`,`hideObject`,`levelFirst`,`singleLine`,`useOnlyCustomProps`])e in t&&(t[e]=g(t[e]));return`translateTime`in t&&(t.translateTime===`true`||t.translateTime===`false`)&&(t.translateTime=g(t.translateTime)),t}function v(e){let t=_(Object.assign({},h,e)),n=p(t);return m.bind({...n,context:n})}function y(e={}){let t=v(e),n;return a(function(a){a.on(`message`,function n(r){r&&r.code===`PINO_CONFIG`&&(Object.assign(e,{messageKey:r.config.messageKey,errorLikeObjectKeys:Array.from(/* @__PURE__ */ new Set([...e.errorLikeObjectKeys||s,r.config.errorKey])),customLevels:r.config.levels.values}),t=v(e),a.off(`message`,n))});let o=new i({objectMode:!0,autoDestroy:!0,transform(e,n,r){r(null,t(e))}});return n=typeof e.destination==`object`&&typeof e.destination.write==`function`?e.destination:f({dest:e.destination||1,append:e.append,mkdir:e.mkdir,sync:e.sync}),a.on(`unknown`,function(e){n.write(e+`
144
+ `)}),r(a,o,n),o},{parse:`lines`,close(e,t){n.on(`close`,()=>{t(e)})}})}t.exports=y,t.exports.build=y,t.exports.PinoPretty=y,t.exports.prettyFactory=v,t.exports.colorizerFactory=o,t.exports.isColorSupported=n,t.exports.default=y})))(),1),ld=class{module;constructor(e=`Noop`){this.module=e}debug(e,t){}info(e,t){}warn(e,t){}error(e,t,n){}withOperation(e){return this}withTrace(e){return this}flush(){return Promise.resolve()}getModule(){return this.module}};function ud(e=`Noop`){return new ld(e)}ud(`App`);const dd={colorize:!0,translateTime:`SYS:HH:MM:ss`,ignore:`pid,hostname,module`,messageFormat:`{msg}`,singleLine:!0};let fd=!1;function pd(){return e(import.meta.url).resolve(`pino-pretty`)}function md(e){return(0,cd.default)({...dd,...e})}function hd(e){return{target:pd(),options:{...dd,...e}}}const gd={enableTracing:!0,prettyMode:`stream`,output:`stdout`};function _d(){return fd}function vd(){fd=!0}function yd(e={}){let t={...gd,...e},n=process.env.NODE_ENV!==`production`,r=t.output===`stderr`,i=r?{...e.prettyOptions,destination:2}:e.prettyOptions,a=e.transport??(n&&t.prettyMode===`transport`?hd(i):void 0),o=n&&!e.transport&&t.prettyMode===`stream`?md(i):void 0,s=o===void 0&&a===void 0&&r?process.stderr:void 0;au({minLevel:e.minLevel??(n?`debug`:`info`),enableConsole:!0,autoTracing:t.enableTracing,transport:a,stream:o??s}),t.enableTracing&&yu(xu())}function bd(){_d()||(vd(),yd())}function xd(e={}){vd(),yd(e)}function Sd(e){bd();let t=hu(e),n=bu();return n?t.withTrace(n):t}xd();var Cd=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},wd=class extends Cd{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}},Td=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new wd(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,t):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Ed(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}var Dd=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description).helpGroup(n.helpGroupHeading)):n.short&&!r&&t.push(e.createOption(n.short,n.description).helpGroup(n.helpGroupHeading))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(e=>Ed(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(t?` `+t:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=/* @__PURE__ */ new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
145
145
  `)}displayWidth(e){return x(e).length}styleTitle(e){return e}styleUsage(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e===`[command]`?this.styleSubcommandText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleCommandText(e)).join(` `)}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleSubcommandText(e)).join(` `)}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,r){let i=` `.repeat(2);if(!n)return i+e;let a=e.padEnd(t+e.length-r.displayWidth(e)),o=(this.helpWidth??80)-t-2-2,s;return s=o<this.minWidthToWrap||r.preformatted(n)?n:r.boxWrap(n,o).replace(/\n/g,`
146
146
  `+` `.repeat(t+2)),i+a+` `.repeat(2)+s.replace(/\n/g,`\n${i}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,i=[];return n.forEach(e=>{let n=e.match(r);if(n===null){i.push(``);return}let a=[n.shift()],o=this.displayWidth(a[0]);n.forEach(e=>{let n=this.displayWidth(e);if(o+n<=t){a.push(e),o+=n;return}i.push(a.join(``));let r=e.trimStart();a=[r],o=this.displayWidth(r)}),i.push(a.join(``))}),i.join(`
147
- `)}},Dd=class{constructor(e,t){this.flags=e,this.description=t||``,this.required=e.includes(`<`),this.optional=e.includes(`[`),this.variadic=/\p{ID_Continue}\.\.\.[>\]]$/u.test(e),this.mandatory=!1;let n=Ad(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith(`--no-`)),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e==`string`&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new Cd(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,t):e},this}name(){return this.long?this.long.replace(/^--/,``):this.short.replace(/^-/,``)}attributeName(){return this.negate?kd(this.name().replace(/^no-/,``)):kd(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Od=class{constructor(e){this.positiveOptions=/* @__PURE__ */ new Map,this.negativeOptions=/* @__PURE__ */ new Map,this.dualOptions=/* @__PURE__ */ new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let r=this.negativeOptions.get(n).presetArg,i=r!==void 0&&r;return t.negate===(i===e)}};function kd(e){return e.split(`-`).reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function Ad(e){let t,n,r=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat(`guard`);if(r.test(a[0])&&(t=a.shift()),i.test(a[0])&&(n=a.shift()),!t&&r.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=n,n=a.shift()),a[0].startsWith(`-`)){let t=a[0],n=`option creation failed due to '${t}' in option flags '${e}'`;throw/^-[^-][^-]/.test(t)?Error(`${n}
147
+ `)}},Od=class{constructor(e,t){this.flags=e,this.description=t||``,this.required=e.includes(`<`),this.optional=e.includes(`[`),this.variadic=/\p{ID_Continue}\.\.\.[>\]]$/u.test(e),this.mandatory=!1;let n=jd(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith(`--no-`)),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e==`string`&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new wd(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,t):e},this}name(){return this.long?this.long.replace(/^--/,``):this.short.replace(/^-/,``)}attributeName(){return this.negate?Ad(this.name().replace(/^no-/,``)):Ad(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},kd=class{constructor(e){this.positiveOptions=/* @__PURE__ */ new Map,this.negativeOptions=/* @__PURE__ */ new Map,this.dualOptions=/* @__PURE__ */ new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let r=this.negativeOptions.get(n).presetArg,i=r!==void 0&&r;return t.negate===(i===e)}};function Ad(e){return e.split(`-`).reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function jd(e){let t,n,r=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat(`guard`);if(r.test(a[0])&&(t=a.shift()),i.test(a[0])&&(n=a.shift()),!t&&r.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=n,n=a.shift()),a[0].startsWith(`-`)){let t=a[0],n=`option creation failed due to '${t}' in option flags '${e}'`;throw/^-[^-][^-]/.test(t)?Error(`${n}
148
148
  - a short flag is a single dash and a single character
149
149
  - either use a single dash and a single character (for a short flag)
150
150
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):r.test(t)?Error(`${n}
151
151
  - too many short flags`):i.test(t)?Error(`${n}
152
152
  - too many long flags`):Error(`${n}
153
- - unrecognised flag format`)}if(t===void 0&&n===void 0)throw Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:n}}function jd(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let n=[];for(let t=0;t<=e.length;t++)n[t]=[t];for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=t.length;r++)for(let i=1;i<=e.length;i++){let a;a=e[i-1]===t[r-1]?0:1,n[i][r]=Math.min(n[i-1][r]+1,n[i][r-1]+1,n[i-1][r-1]+a),i>1&&r>1&&e[i-1]===t[r-2]&&e[i-2]===t[r-1]&&(n[i][r]=Math.min(n[i][r],n[i-2][r-2]+1))}return n[e.length][t.length]}function Md(e,t){if(!t||t.length===0)return``;t=Array.from(new Set(t));let n=e.startsWith(`--`);n&&(e=e.slice(2),t=t.map(e=>e.slice(2)));let r=[],i=3;return t.forEach(t=>{if(t.length<=1)return;let n=jd(e,t),a=Math.max(e.length,t.length);(a-n)/a>.4&&(n<i?(i=n,r=[t]):n===i&&r.push(t))}),r.sort((e,t)=>e.localeCompare(t)),n&&(r=r.map(e=>`--${e}`)),r.length>1?`\n(Did you mean one of ${r.join(`, `)}?)`:r.length===1?`\n(Did you mean ${r[0]}?)`:``}var Nd=class e extends n{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||``,this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description=``,this._summary=``,this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:e=>y.stdout.write(e),writeErr:e=>y.stderr.write(e),outputError:(e,t)=>t(e),getOutHelpWidth:()=>y.stdout.isTTY?y.stdout.columns:void 0,getErrHelpWidth:()=>y.stderr.isTTY?y.stderr.columns:void 0,getOutHasColors:()=>Fd()??(y.stdout.isTTY&&y.stdout.hasColors?.()),getErrHasColors:()=>Fd()??(y.stderr.isTTY&&y.stderr.hasColors?.()),stripColor:e=>x(e)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let r=t,i=n;typeof r==`object`&&r&&(i=r,r=null),i||={};let[,a,o]=e.match(/([^ ]+) *(.*)/),s=this.createCommand(a);return r&&(s.description(r),s._executableHandler=!0),i.isDefault&&(this._defaultCommandName=s._name),s._hidden=!!(i.noHelp||i.hidden),s._executableFile=i.executableFile||null,o&&s.arguments(o),this._registerCommand(s),s.parent=this,s.copyInheritedSettings(this),r?this:s}createCommand(t){return new e(t)}createHelp(){return Object.assign(new Ed,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!=`string`&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw Error(`Command passed to .addCommand() must have a name
154
- - specify the name in Command constructor or using .name()`);return t||={},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new wd(e,t)}argument(e,t,n,r){let i=this.createArgument(e,t);return typeof n==`function`?i.default(r).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t?.variadic)throw Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e==`boolean`)return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let[,n,r]=(e??`help [command]`).match(/([^ ]+) *(.*)/),i=t??`display help for command`,a=this.createCommand(n);return a.helpOption(!1),r&&a.arguments(r),i&&a.description(i),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||t)&&this._initCommandGroup(a),this}addHelpCommand(e,t){return typeof e==`object`?(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this):(this.helpCommand(e,t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand(`help`))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let n=[`preSubcommand`,`preAction`,`postAction`];if(!n.includes(e))throw Error(`Unexpected value for event passed to hook : '${e}'.
155
- Expecting one of '${n.join(`', '`)}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return this._exitCallback=e||(e=>{if(e.code!==`commander.executeSubCommandAsync`)throw e}),this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new Sd(e,t,n)),y.exit(e)}action(e){let t=t=>{let n=this.registeredArguments.length,r=t.slice(0,n);return r[n]=this._storeOptionsAsProperties?this:this.opts(),r.push(this),e.apply(this,r)};return this._actionHandler=t,this}createOption(e,t){return new Dd(e,t)}_callParseArg(e,t,n,r){try{return e.parseArg(t,n)}catch(e){if(e.code===`commander.invalidArgument`){let t=`${r} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
156
- - already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=e=>[e.name()].concat(e.aliases()),n=t(e).find(e=>this._findCommand(e));if(n){let r=t(this._findCommand(n)).join(`|`),i=t(e).join(`|`);throw Error(`cannot add command '${i}' as already have command '${r}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),n=e.attributeName();e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,`default`);let r=(t,r,i)=>{t==null&&e.presetArg!==void 0&&(t=e.presetArg);let a=this.getOptionValue(n);t!==null&&e.parseArg?t=this._callParseArg(e,t,a,r):t!==null&&e.variadic&&(t=e._collectValue(t,a)),t??=e.negate?!1:e.isBoolean()||e.optional?!0:``,this.setOptionValueWithSource(n,t,i)};return this.on(`option:`+t,t=>{let n=`error: option '${e.flags}' argument '${t}' is invalid.`;r(t,n,`cli`)}),e.envVar&&this.on(`optionEnv:`+t,t=>{let n=`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`;r(t,n,`env`)}),this}_optionEx(e,t,n,r,i){if(typeof t==`object`&&t instanceof Dd)throw Error(`To add an Option object use addOption() instead of option() or requiredOption()`);let a=this.createOption(t,n);if(a.makeOptionMandatory(!!e.mandatory),typeof r==`function`)a.default(i).argParser(r);else if(r instanceof RegExp){let e=r;r=(t,n)=>{let r=e.exec(t);return r?r[0]:n},a.default(i).argParser(r)}else a.default(r);return this.addOption(a)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:!0},e,t,n,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw Error(`call .storeOptionsAsProperties() before adding options`);if(Object.keys(this._optionValues).length)throw Error(`call .storeOptionsAsProperties() before setting option values`);return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{Object.hasOwn(n._optionValueSources,e)&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw Error(`first parameter to parse must be array or undefined`);if(t||={},e===void 0&&t.from===void 0){y.versions?.electron&&(t.from=`electron`);let e=y.execArgv??[];(e.includes(`-e`)||e.includes(`--eval`)||e.includes(`-p`)||e.includes(`--print`))&&(t.from=`eval`)}e===void 0&&(e=y.argv),this.rawArgs=e.slice();let n;switch(t.from){case void 0:case`node`:this._scriptPath=e[1],n=e.slice(2);break;case`electron`:y.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case`user`:n=e.slice(0);break;case`eval`:n=e.slice(1);break;default:throw Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||`program`,n}parse(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?(this.options.filter(e=>e.negate&&e.defaultValue===void 0&&this.getOptionValue(e.attributeName())===void 0).forEach(e=>{let t=e.long.replace(/^--no-/,`--`);this._findOption(t)||this.setOptionValueWithSource(e.attributeName(),!0,`default`)}),this.saveStateBeforeParse()):this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
153
+ - unrecognised flag format`)}if(t===void 0&&n===void 0)throw Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:n}}function Md(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let n=[];for(let t=0;t<=e.length;t++)n[t]=[t];for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=t.length;r++)for(let i=1;i<=e.length;i++){let a;a=e[i-1]===t[r-1]?0:1,n[i][r]=Math.min(n[i-1][r]+1,n[i][r-1]+1,n[i-1][r-1]+a),i>1&&r>1&&e[i-1]===t[r-2]&&e[i-2]===t[r-1]&&(n[i][r]=Math.min(n[i][r],n[i-2][r-2]+1))}return n[e.length][t.length]}function Nd(e,t){if(!t||t.length===0)return``;t=Array.from(new Set(t));let n=e.startsWith(`--`);n&&(e=e.slice(2),t=t.map(e=>e.slice(2)));let r=[],i=3;return t.forEach(t=>{if(t.length<=1)return;let n=Md(e,t),a=Math.max(e.length,t.length);(a-n)/a>.4&&(n<i?(i=n,r=[t]):n===i&&r.push(t))}),r.sort((e,t)=>e.localeCompare(t)),n&&(r=r.map(e=>`--${e}`)),r.length>1?`\n(Did you mean one of ${r.join(`, `)}?)`:r.length===1?`\n(Did you mean ${r[0]}?)`:``}var Pd=class e extends n{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||``,this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description=``,this._summary=``,this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:e=>y.stdout.write(e),writeErr:e=>y.stderr.write(e),outputError:(e,t)=>t(e),getOutHelpWidth:()=>y.stdout.isTTY?y.stdout.columns:void 0,getErrHelpWidth:()=>y.stderr.isTTY?y.stderr.columns:void 0,getOutHasColors:()=>Id()??(y.stdout.isTTY&&y.stdout.hasColors?.()),getErrHasColors:()=>Id()??(y.stderr.isTTY&&y.stderr.hasColors?.()),stripColor:e=>x(e)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let r=t,i=n;typeof r==`object`&&r&&(i=r,r=null),i||={};let[,a,o]=e.match(/([^ ]+) *(.*)/),s=this.createCommand(a);return r&&(s.description(r),s._executableHandler=!0),i.isDefault&&(this._defaultCommandName=s._name),s._hidden=!!(i.noHelp||i.hidden),s._executableFile=i.executableFile||null,o&&s.arguments(o),this._registerCommand(s),s.parent=this,s.copyInheritedSettings(this),r?this:s}createCommand(t){return new e(t)}createHelp(){return Object.assign(new Dd,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!=`string`&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw Error(`Command passed to .addCommand() must have a name
154
+ - specify the name in Command constructor or using .name()`);return t||={},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new Td(e,t)}argument(e,t,n,r){let i=this.createArgument(e,t);return typeof n==`function`?i.default(r).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t?.variadic)throw Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e==`boolean`)return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let[,n,r]=(e??`help [command]`).match(/([^ ]+) *(.*)/),i=t??`display help for command`,a=this.createCommand(n);return a.helpOption(!1),r&&a.arguments(r),i&&a.description(i),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||t)&&this._initCommandGroup(a),this}addHelpCommand(e,t){return typeof e==`object`?(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this):(this.helpCommand(e,t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand(`help`))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let n=[`preSubcommand`,`preAction`,`postAction`];if(!n.includes(e))throw Error(`Unexpected value for event passed to hook : '${e}'.
155
+ Expecting one of '${n.join(`', '`)}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return this._exitCallback=e||(e=>{if(e.code!==`commander.executeSubCommandAsync`)throw e}),this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new Cd(e,t,n)),y.exit(e)}action(e){let t=t=>{let n=this.registeredArguments.length,r=t.slice(0,n);return r[n]=this._storeOptionsAsProperties?this:this.opts(),r.push(this),e.apply(this,r)};return this._actionHandler=t,this}createOption(e,t){return new Od(e,t)}_callParseArg(e,t,n,r){try{return e.parseArg(t,n)}catch(e){if(e.code===`commander.invalidArgument`){let t=`${r} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
156
+ - already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=e=>[e.name()].concat(e.aliases()),n=t(e).find(e=>this._findCommand(e));if(n){let r=t(this._findCommand(n)).join(`|`),i=t(e).join(`|`);throw Error(`cannot add command '${i}' as already have command '${r}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),n=e.attributeName();e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,`default`);let r=(t,r,i)=>{t==null&&e.presetArg!==void 0&&(t=e.presetArg);let a=this.getOptionValue(n);t!==null&&e.parseArg?t=this._callParseArg(e,t,a,r):t!==null&&e.variadic&&(t=e._collectValue(t,a)),t??=e.negate?!1:e.isBoolean()||e.optional?!0:``,this.setOptionValueWithSource(n,t,i)};return this.on(`option:`+t,t=>{let n=`error: option '${e.flags}' argument '${t}' is invalid.`;r(t,n,`cli`)}),e.envVar&&this.on(`optionEnv:`+t,t=>{let n=`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`;r(t,n,`env`)}),this}_optionEx(e,t,n,r,i){if(typeof t==`object`&&t instanceof Od)throw Error(`To add an Option object use addOption() instead of option() or requiredOption()`);let a=this.createOption(t,n);if(a.makeOptionMandatory(!!e.mandatory),typeof r==`function`)a.default(i).argParser(r);else if(r instanceof RegExp){let e=r;r=(t,n)=>{let r=e.exec(t);return r?r[0]:n},a.default(i).argParser(r)}else a.default(r);return this.addOption(a)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:!0},e,t,n,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw Error(`call .storeOptionsAsProperties() before adding options`);if(Object.keys(this._optionValues).length)throw Error(`call .storeOptionsAsProperties() before setting option values`);return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{Object.hasOwn(n._optionValueSources,e)&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw Error(`first parameter to parse must be array or undefined`);if(t||={},e===void 0&&t.from===void 0){y.versions?.electron&&(t.from=`electron`);let e=y.execArgv??[];(e.includes(`-e`)||e.includes(`--eval`)||e.includes(`-p`)||e.includes(`--print`))&&(t.from=`eval`)}e===void 0&&(e=y.argv),this.rawArgs=e.slice();let n;switch(t.from){case void 0:case`node`:this._scriptPath=e[1],n=e.slice(2);break;case`electron`:y.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case`user`:n=e.slice(0);break;case`eval`:n=e.slice(1);break;default:throw Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||`program`,n}parse(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?(this.options.filter(e=>e.negate&&e.defaultValue===void 0&&this.getOptionValue(e.attributeName())===void 0).forEach(e=>{let t=e.long.replace(/^--no-/,`--`);this._findOption(t)||this.setOptionValueWithSource(e.attributeName(),!0,`default`)}),this.saveStateBeforeParse()):this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
157
157
  - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,n){if(f.existsSync(e))return;let r=`'${e}' does not exist
158
158
  - if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
159
159
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
160
- - ${t?`searched for local subcommand relative to directory '${t}'`:`no directory for search for local subcommand, use .executableDir() to supply a custom directory`}`;throw Error(r)}_executeSubCommand(e,t){t=t.slice();let n=[`.js`,`.ts`,`.tsx`,`.mjs`,`.cjs`];function i(e,t){let r=a.resolve(e,t);if(f.existsSync(r))return r;if(n.includes(a.extname(t)))return;let i=n.find(e=>f.existsSync(`${r}${e}`));if(i)return`${r}${i}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=e._executableFile||`${this._name}-${e._name}`,s=this._executableDir||``;if(this._scriptPath){let e;try{e=f.realpathSync(this._scriptPath)}catch{e=this._scriptPath}s=a.resolve(a.dirname(e),s)}if(s){let t=i(s,o);if(!t&&!e._executableFile&&this._scriptPath){let n=a.basename(this._scriptPath,a.extname(this._scriptPath));n!==this._name&&(t=i(s,`${n}-${e._name}`))}o=t||o}let c=n.includes(a.extname(o)),l;y.platform===`win32`?(this._checkForMissingExecutable(o,s,e._name),t.unshift(o),t=Pd(y.execArgv).concat(t),l=r.spawn(y.execPath,t,{stdio:`inherit`})):c?(t.unshift(o),t=Pd(y.execArgv).concat(t),l=r.spawn(y.argv[0],t,{stdio:`inherit`})):l=r.spawn(o,t,{stdio:`inherit`}),l.killed||[`SIGUSR1`,`SIGUSR2`,`SIGTERM`,`SIGINT`,`SIGHUP`].forEach(e=>{y.on(e,()=>{l.killed===!1&&l.exitCode===null&&l.kill(e)})});let u=this._exitCallback;l.on(`close`,e=>{e??=1,u?u(new Sd(e,`commander.executeSubCommandAsync`,`(close)`)):y.exit(e)}),l.on(`error`,t=>{if(t.code===`ENOENT`)this._checkForMissingExecutable(o,s,e._name);else if(t.code===`EACCES`)throw Error(`'${o}' not executable`);if(!u)y.exit(1);else{let e=new Sd(1,`commander.executeSubCommandAsync`,`(error)`);e.nestedError=t,u(e)}}),this.runningCommand=l}_dispatchSubcommand(e,t,n){let r=this._findCommand(e);r||this.help({error:!0}),r._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,r,`preSubcommand`),i=this._chainOrCall(i,()=>{if(r._executableHandler)this._executeSubCommand(r,t.concat(n));else return r._parseCommand(t,n)}),i}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??`--help`])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic||this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(e,t,n)=>{let r=t;if(t!==null&&e.parseArg){let i=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;r=this._callParseArg(e,t,n,i)}return r};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,r)=>{let i=n.defaultValue;n.variadic?r<this.args.length?(i=this.args.slice(r),n.parseArg&&(i=i.reduce((t,r)=>e(n,r,t),n.defaultValue))):i===void 0&&(i=[]):r<this.args.length&&(i=this.args[r],n.parseArg&&(i=e(n,i,n.defaultValue))),t[r]=i}),this.processedArgs=t}_chainOrCall(e,t){return e?.then&&typeof e.then==`function`?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e,r=[];return this._getCommandAndAncestors().reverse().filter(e=>e._lifeCycleHooks[t]!==void 0).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{r.push({hookedCommand:e,callback:t})})}),t===`postAction`&&r.reverse(),r.forEach(e=>{n=this._chainOrCall(n,()=>e.callback(e.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let r=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(e=>{r=this._chainOrCall(r,()=>e(this,t))}),r}_parseCommand(e,t){let n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){r(),this._processArguments();let n;return n=this._chainOrCallHooks(n,`preAction`),n=this._chainOrCall(n,()=>this._actionHandler(this.processedArgs)),this.parent&&(n=this._chainOrCall(n,()=>{this.parent.emit(i,e,t)})),n=this._chainOrCallHooks(n,`postAction`),n}if(this.parent?.listenerCount(i))r(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand(`*`))return this._dispatchSubcommand(`*`,e,t);this.listenerCount(`command:*`)?this.emit(`command:*`,e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(e=>{let t=e.attributeName();return this.getOptionValue(t)!==void 0&&this.getOptionValueSource(t)!=="default"});e.filter(e=>e.conflictsWith.length>0).forEach(t=>{let n=e.find(e=>t.conflictsWith.includes(e.attributeName()));n&&this._conflictingOption(t,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],n=[],r=t;function i(e){return e.length>1&&e[0]===`-`}let a=e=>/^-(\d+|\d*\.\d+)([eE][+-]?\d+)?$/.test(e)?!this._getCommandAndAncestors().some(e=>e.options.map(e=>e.short).some(e=>/^-\d$/.test(e))):!1,o=null,s=null,c=0;for(;c<e.length||s;){let l=s??e[c++];if(s=null,l===`--`){r===n&&r.push(l),r.push(...e.slice(c));break}if(o&&(!i(l)||a(l)))this.emit(`option:${o.name()}`,l);else{if(o=null,i(l)){let t=this._findOption(l);if(t){if(t.required){let n=e[c++];n===void 0&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,n)}else if(t.optional){let n=null;c<e.length&&(!i(e[c])||a(e[c]))&&(n=e[c++]),this.emit(`option:${t.name()}`,n)}else this.emit(`option:${t.name()}`);o=t.variadic?t:null;continue}}if(l.length>2&&l[0]===`-`&&l[1]!==`-`){let e=this._findOption(`-${l[1]}`);if(e){e.required||e.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${e.name()}`,l.slice(2)):(this.emit(`option:${e.name()}`),s=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let e=l.indexOf(`=`),t=this._findOption(l.slice(0,e));if(t&&(t.required||t.optional)){this.emit(`option:${t.name()}`,l.slice(e+1));continue}}if(r===t&&i(l)&&!(this.commands.length===0&&a(l))&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(l)){t.push(l),n.push(...e.slice(c));break}if(this._getHelpCommand()&&l===this._getHelpCommand().name()){t.push(l,...e.slice(c));break}if(this._defaultCommandName){n.push(l,...e.slice(c));break}}if(this._passThroughOptions){r.push(l,...e.slice(c));break}r.push(l)}}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let n=0;n<t;n++){let t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==`string`?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
161
- `),this.outputHelp({error:!0}));let n=t||{},r=n.exitCode||1,i=n.code||`commander.error`;this._exit(r,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in y.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||[`default`,`config`,`env`].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,y.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new Od(this.options),t=e=>this.getOptionValue(e)!==void 0&&![`default`,`implied`].includes(this.getOptionValueSource(e));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(e=>{Object.keys(e.implied).filter(e=>!t(e)).forEach(t=>{this.setOptionValueWithSource(t,e.implied[t],`implied`)})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:`commander.missingArgument`})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:`commander.optionMissingArgument`})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:`commander.missingMandatoryOptionValue`})}_conflictingOption(e,t){let n=e=>{let t=e.attributeName(),n=this.getOptionValue(t),r=this.options.find(e=>e.negate&&t===e.attributeName()),i=this.options.find(e=>!e.negate&&t===e.attributeName());return r&&(r.presetArg===void 0&&n===!1||r.presetArg!==void 0&&n===r.presetArg)?r:i||e},r=e=>{let t=n(e),r=t.attributeName();return this.getOptionValueSource(r)===`env`?`environment variable '${t.envVar}'`:`option '${t.flags}'`},i=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(i,{code:`commander.conflictingOption`})}unknownOption(e){if(this._allowUnknownOption)return;let t=``;if(e.startsWith(`--`)&&this._showSuggestionAfterError){let n=[],r=this;do{let e=r.createHelp().visibleOptions(r).filter(e=>e.long).map(e=>e.long);n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=Md(e,n)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:`commander.unknownOption`})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?``:`s`,r=e.length,i=`error: too many arguments${this.parent?` for '${this.name()}'`:``}. Expected ${t} argument${n} but got ${r}: ${e.join(`, `)}.`;this.error(i,{code:`commander.excessArguments`})}unknownCommand(){let e=this.args[0],t=``;if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(e=>{n.push(e.name()),e.alias()&&n.push(e.alias())}),t=Md(e,n)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:`commander.unknownCommand`})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t||=`-V, --version`,n||=`output the version number`;let r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on(`option:`+r.name(),()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,`commander.version`,e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw Error(`Command alias can't be the same as its name`);let n=this.parent?._findCommand(e);if(n){let t=[n.name()].concat(n.aliases()).join(`|`);throw Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${t}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let e=this.registeredArguments.map(e=>Td(e));return[].concat(this.options.length||this._helpOption!==null?`[options]`:[],this.commands.length?`[command]`:[],this.registeredArguments.length?e:[]).join(` `)}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??``:(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??``:(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??``:(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=a.basename(e,a.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),n=this._getOutputContext(e);t.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let r=t.formatHelp(this,t);return n.hasColors?r:this._outputConfiguration.stripColor(r)}_getOutputContext(e){e||={};let t=!!e.error,n,r,i;return t?(n=e=>this._outputConfiguration.writeErr(e),r=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(n=e=>this._outputConfiguration.writeOut(e),r=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:t,write:e=>(r||(e=this._outputConfiguration.stripColor(e)),n(e)),hasColors:r,helpWidth:i}}outputHelp(e){let t;typeof e==`function`&&(t=e,e=void 0);let n=this._getOutputContext(e),r={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(e=>e.emit(`beforeAllHelp`,r)),this.emit(`beforeHelp`,r);let i=this.helpInformation({error:n.error});if(t&&(i=t(i),typeof i!=`string`&&!Buffer.isBuffer(i)))throw Error(`outputHelp callback must return a string or a Buffer`);n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit(`afterHelp`,r),this._getCommandAndAncestors().forEach(e=>e.emit(`afterAllHelp`,r))}helpOption(e,t){return typeof e==`boolean`?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??`-h, --help`,t??`display help for command`),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(y.exitCode??0);t===0&&e&&typeof e!=`function`&&e.error&&(t=1),this._exit(t,`commander.help`,`(outputHelp)`)}addHelpText(e,t){let n=[`beforeAll`,`before`,`after`,`afterAll`];if(!n.includes(e))throw Error(`Unexpected value for position to addHelpText.
162
- Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let n;n=typeof t==`function`?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,`commander.helpDisplayed`,`(outputHelp)`))}};function Pd(e){return e.map(e=>{if(!e.startsWith(`--inspect`))return e;let t,n=`127.0.0.1`,r=`9229`,i;return(i=e.match(/^(--inspect(-brk|-wait)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port|-wait)?)=(\[[^\]]+\]|[^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port|-wait)?)=(\[[^\]]+\]|[^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],r=i[4]):(t=i[1],/^\d+$/.test(i[3])?r=i[3]:n=i[3]):t=i[1],t&&r!==`0`?`${t}=${n}:${parseInt(r)+1}`:e})}function Fd(){if(y.env.NO_COLOR||y.env.FORCE_COLOR===`0`||y.env.FORCE_COLOR===`false`)return!1;if(y.env.FORCE_COLOR||y.env.CLICOLOR_FORCE!==void 0)return!0}new Nd;let Id;function Ld(){return Id??=xd(`@longzai-intelligence-cli/core/provider`),Id}const Rd={red:e=>e,green:e=>e,yellow:e=>e,blue:e=>e,cyan:e=>e,magenta:e=>e,gray:e=>e,bold:e=>e,dim:e=>e};let zd={select:async(e,t)=>t[0]?.value??``,textInput:async(e,t)=>t?.defaultValue??``,confirm:async(e,t)=>t?.defaultValue??!1,spinner:()=>({start:e=>Ld().info(e),stop:e=>Ld().info(e)}),note:(e,t)=>{t?Ld().info(`${t}: ${e}`):Ld().info(e)},log:{info:e=>Ld().info(e),success:e=>Ld().info(e),warn:e=>Ld().warn(e),error:e=>Ld().error(e),step:e=>Ld().info(e)}},Bd=Rd;function Vd(e){zd=e}function Hd(e){Bd=e}function Ud(){return zd}function Wd(){return Bd}const Gd=()=>`0.0.25`;function Kd(e){let t=e.version??Gd();e.interaction&&Vd(e.interaction),e.color&&Hd(e.color);let n=new Nd;return n.name(e.name).version(t,`-v, --version`,`输出 ${e.name} 的版本号`),e.description&&n.description(e.description),n}let qd;function Jd(){return qd??=xd(`@longzai-intelligence-cli/core/define-command`),qd}function Yd(e,t){let n=e.commands.find(e=>e.name()===t);return n===void 0?e.command(t):n}function Xd(e,t){if(t.length===1){let n=t[0];if(n===void 0)throw Error(`defineCommand: segments 为空,无法解析命令名`);return e.command(n)}let[n,...r]=t;if(n===void 0)throw Error(`defineCommand: segments 首段为空,无法解析父命令名`);let i=r.pop();if(i===void 0)throw Error(`defineCommand: segments 末段为空,无法解析子命令名`);let a=Yd(e,n);for(let e of r)a=Yd(a,e);return a.command(i)}function Zd(e){return typeof e==`object`&&!!e&&`opts`in e&&typeof e.opts==`function`&&`args`in e&&Array.isArray(e.args)}function Qd(e,t){let n=Xd(e,t.name.split(` `).filter(e=>e.length>0));t.description&&n.description(t.description);for(let e of t.arguments??[])e.description?n.argument(e.signature,e.description):n.argument(e.signature);for(let e of t.options??[])e.defaultValue===void 0?n.option(e.flags,e.description??``):n.option(e.flags,e.description??``,e.defaultValue);n.action(async(...e)=>{let n=e[e.length-1];if(!Zd(n))return;let r=n.opts(),i=n.args,a=t.schema.safeParse(r);if(!a.success){let e=a.error.issues.map(e=>e.message).join(`, `);Jd().error(Wd().red(`参数校验失败: ${e}`)),Ud().log.error(`参数校验失败: ${e}`),process.exit(1)}await t.action(a.data,i)})}var $d=/* @__PURE__ */ oe(import.meta.url);function ef(e){let t=ne(e);return t.length>1&&t[t.length-1]===M&&(t=t.substring(0,t.length-1)),t}const tf=/[\\/]/g;function nf(e,t){return e.replace(tf,t)}const rf=/^[a-z]:[\\/]$/i;function af(e){return e===`/`||rf.test(e)}function of(e,t){let{resolvePaths:n,normalizePath:r,pathSeparator:i}=t,a=process.platform===`win32`&&e.includes(`/`)||e.startsWith(`.`);return n&&(e=j(e)),(r||a)&&(e=ef(e)),e===`.`?``:nf(e[e.length-1]===i?e:e+i,i)}function sf(e,t){return t+e}function cf(e,t){return function(n,r){return r.startsWith(e)?r.slice(e.length)+n:nf(ie(e,r),t.pathSeparator)+t.pathSeparator+n}}function lf(e){return e}function uf(e,t,n){return t+e+n}function df(e,t){let{relativePaths:n,includeBasePath:r}=t;return n&&e?cf(e,t):r?sf:lf}function ff(e){return function(t,n){n.push(t.substring(e.length)||`.`)}}function pf(e){return function(t,n,r){let i=t.substring(e.length)||`.`;r.every(e=>e(i,!0))&&n.push(i)}}const mf=(e,t)=>{t.push(e||`.`)},hf=(e,t,n)=>{let r=e||`.`;n.every(e=>e(r,!0))&&t.push(r)},gf=()=>{};function _f(e,t){let{includeDirs:n,filters:r,relativePaths:i}=t;return n?i?r&&r.length?pf(e):ff(e):r&&r.length?hf:mf:gf}const vf=(e,t,n,r)=>{r.every(t=>t(e,!1))&&n.files++},yf=(e,t,n,r)=>{r.every(t=>t(e,!1))&&t.push(e)},bf=(e,t,n,r)=>{n.files++},xf=(e,t)=>{t.push(e)},Sf=()=>{};function Cf(e){let{excludeFiles:t,filters:n,onlyCounts:r}=e;return t?Sf:n&&n.length?r?vf:yf:r?bf:xf}const wf=e=>e,Tf=()=>[``].slice(0,0);function Ef(e){return e.group?Tf:wf}const Df=(e,t,n)=>{e.push({directory:t,files:n,dir:t})},Of=()=>{};function kf(e){return e.group?Df:Of}const Af=function(e,t,n){let{queue:r,fs:i,options:{suppressErrors:a}}=t;r.enqueue(),i.realpath(e,(o,s)=>{if(o)return r.dequeue(a?null:o,t);i.stat(s,(i,o)=>{if(i)return r.dequeue(a?null:i,t);if(o.isDirectory()&&Nf(e,s,t))return r.dequeue(null,t);n(o,s),r.dequeue(null,t)})})},jf=function(e,t,n){let{queue:r,fs:i,options:{suppressErrors:a}}=t;r.enqueue();try{let r=i.realpathSync(e),a=i.statSync(r);if(a.isDirectory()&&Nf(e,r,t))return;n(a,r)}catch(e){if(!a)throw e}};function Mf(e,t){return!e.resolveSymlinks||e.excludeSymlinks?null:t?jf:Af}function Nf(e,t,n){if(n.options.useRealPaths)return Pf(t,n);let r=ee(e),i=1;for(;r!==n.root&&i<2;){let e=n.symlinks.get(r);e&&(e===t||e.startsWith(t)||t.startsWith(e))?i++:r=ee(r)}return n.symlinks.set(e,t),i>1}function Pf(e,t){return t.visited.includes(e+t.options.pathSeparator)}const Ff=e=>e.counts,If=e=>e.groups,Lf=e=>e.paths,Rf=e=>e.paths.slice(0,e.options.maxFiles),zf=(e,t,n)=>(Uf(t,n,e.counts,e.options.suppressErrors),null),Bf=(e,t,n)=>(Uf(t,n,e.paths,e.options.suppressErrors),null),Vf=(e,t,n)=>(Uf(t,n,e.paths.slice(0,e.options.maxFiles),e.options.suppressErrors),null),Hf=(e,t,n)=>(Uf(t,n,e.groups,e.options.suppressErrors),null);function Uf(e,t,n,r){t(e&&!r?e:null,n)}function Wf(e,t){let{onlyCounts:n,group:r,maxFiles:i}=e;return n?t?Ff:zf:r?t?If:Hf:i?t?Rf:Vf:t?Lf:Bf}const Gf={withFileTypes:!0},Kf=(e,t,n,r,i)=>{if(e.queue.enqueue(),r<0)return e.queue.dequeue(null,e);let{fs:a}=e;e.visited.push(t),e.counts.directories++,a.readdir(t||`.`,Gf,(t,a=[])=>{i(a,n,r),e.queue.dequeue(e.options.suppressErrors?null:t,e)})},qf=(e,t,n,r,i)=>{let{fs:a}=e;if(r<0)return;e.visited.push(t),e.counts.directories++;let o=[];try{o=a.readdirSync(t||`.`,Gf)}catch(t){if(!e.options.suppressErrors)throw t}i(o,n,r)};function Jf(e){return e?qf:Kf}var Yf=class{count=0;constructor(e){this.onQueueEmpty=e}enqueue(){return this.count++,this.count}dequeue(e,t){this.onQueueEmpty&&(--this.count<=0||e)&&(this.onQueueEmpty(e,t),e&&(t.controller.abort(),this.onQueueEmpty=void 0))}},Xf=class{_files=0;_directories=0;set files(e){this._files=e}get files(){return this._files}set directories(e){this._directories=e}get directories(){return this._directories}
160
+ - ${t?`searched for local subcommand relative to directory '${t}'`:`no directory for search for local subcommand, use .executableDir() to supply a custom directory`}`;throw Error(r)}_executeSubCommand(e,t){t=t.slice();let n=[`.js`,`.ts`,`.tsx`,`.mjs`,`.cjs`];function i(e,t){let r=a.resolve(e,t);if(f.existsSync(r))return r;if(n.includes(a.extname(t)))return;let i=n.find(e=>f.existsSync(`${r}${e}`));if(i)return`${r}${i}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=e._executableFile||`${this._name}-${e._name}`,s=this._executableDir||``;if(this._scriptPath){let e;try{e=f.realpathSync(this._scriptPath)}catch{e=this._scriptPath}s=a.resolve(a.dirname(e),s)}if(s){let t=i(s,o);if(!t&&!e._executableFile&&this._scriptPath){let n=a.basename(this._scriptPath,a.extname(this._scriptPath));n!==this._name&&(t=i(s,`${n}-${e._name}`))}o=t||o}let c=n.includes(a.extname(o)),l;y.platform===`win32`?(this._checkForMissingExecutable(o,s,e._name),t.unshift(o),t=Fd(y.execArgv).concat(t),l=r.spawn(y.execPath,t,{stdio:`inherit`})):c?(t.unshift(o),t=Fd(y.execArgv).concat(t),l=r.spawn(y.argv[0],t,{stdio:`inherit`})):l=r.spawn(o,t,{stdio:`inherit`}),l.killed||[`SIGUSR1`,`SIGUSR2`,`SIGTERM`,`SIGINT`,`SIGHUP`].forEach(e=>{y.on(e,()=>{l.killed===!1&&l.exitCode===null&&l.kill(e)})});let u=this._exitCallback;l.on(`close`,e=>{e??=1,u?u(new Cd(e,`commander.executeSubCommandAsync`,`(close)`)):y.exit(e)}),l.on(`error`,t=>{if(t.code===`ENOENT`)this._checkForMissingExecutable(o,s,e._name);else if(t.code===`EACCES`)throw Error(`'${o}' not executable`);if(!u)y.exit(1);else{let e=new Cd(1,`commander.executeSubCommandAsync`,`(error)`);e.nestedError=t,u(e)}}),this.runningCommand=l}_dispatchSubcommand(e,t,n){let r=this._findCommand(e);r||this.help({error:!0}),r._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,r,`preSubcommand`),i=this._chainOrCall(i,()=>{if(r._executableHandler)this._executeSubCommand(r,t.concat(n));else return r._parseCommand(t,n)}),i}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??`--help`])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic||this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(e,t,n)=>{let r=t;if(t!==null&&e.parseArg){let i=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;r=this._callParseArg(e,t,n,i)}return r};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,r)=>{let i=n.defaultValue;n.variadic?r<this.args.length?(i=this.args.slice(r),n.parseArg&&(i=i.reduce((t,r)=>e(n,r,t),n.defaultValue))):i===void 0&&(i=[]):r<this.args.length&&(i=this.args[r],n.parseArg&&(i=e(n,i,n.defaultValue))),t[r]=i}),this.processedArgs=t}_chainOrCall(e,t){return e?.then&&typeof e.then==`function`?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e,r=[];return this._getCommandAndAncestors().reverse().filter(e=>e._lifeCycleHooks[t]!==void 0).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{r.push({hookedCommand:e,callback:t})})}),t===`postAction`&&r.reverse(),r.forEach(e=>{n=this._chainOrCall(n,()=>e.callback(e.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let r=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(e=>{r=this._chainOrCall(r,()=>e(this,t))}),r}_parseCommand(e,t){let n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){r(),this._processArguments();let n;return n=this._chainOrCallHooks(n,`preAction`),n=this._chainOrCall(n,()=>this._actionHandler(this.processedArgs)),this.parent&&(n=this._chainOrCall(n,()=>{this.parent.emit(i,e,t)})),n=this._chainOrCallHooks(n,`postAction`),n}if(this.parent?.listenerCount(i))r(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand(`*`))return this._dispatchSubcommand(`*`,e,t);this.listenerCount(`command:*`)?this.emit(`command:*`,e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(e=>{let t=e.attributeName();return this.getOptionValue(t)!==void 0&&this.getOptionValueSource(t)!=="default"});e.filter(e=>e.conflictsWith.length>0).forEach(t=>{let n=e.find(e=>t.conflictsWith.includes(e.attributeName()));n&&this._conflictingOption(t,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],n=[],r=t;function i(e){return e.length>1&&e[0]===`-`}let a=e=>/^-(\d+|\d*\.\d+)([eE][+-]?\d+)?$/.test(e)?!this._getCommandAndAncestors().some(e=>e.options.map(e=>e.short).some(e=>/^-\d$/.test(e))):!1,o=null,s=null,c=0;for(;c<e.length||s;){let l=s??e[c++];if(s=null,l===`--`){r===n&&r.push(l),r.push(...e.slice(c));break}if(o&&(!i(l)||a(l)))this.emit(`option:${o.name()}`,l);else{if(o=null,i(l)){let t=this._findOption(l);if(t){if(t.required){let n=e[c++];n===void 0&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,n)}else if(t.optional){let n=null;c<e.length&&(!i(e[c])||a(e[c]))&&(n=e[c++]),this.emit(`option:${t.name()}`,n)}else this.emit(`option:${t.name()}`);o=t.variadic?t:null;continue}}if(l.length>2&&l[0]===`-`&&l[1]!==`-`){let e=this._findOption(`-${l[1]}`);if(e){e.required||e.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${e.name()}`,l.slice(2)):(this.emit(`option:${e.name()}`),s=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let e=l.indexOf(`=`),t=this._findOption(l.slice(0,e));if(t&&(t.required||t.optional)){this.emit(`option:${t.name()}`,l.slice(e+1));continue}}if(r===t&&i(l)&&!(this.commands.length===0&&a(l))&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(l)){t.push(l),n.push(...e.slice(c));break}if(this._getHelpCommand()&&l===this._getHelpCommand().name()){t.push(l,...e.slice(c));break}if(this._defaultCommandName){n.push(l,...e.slice(c));break}}if(this._passThroughOptions){r.push(l,...e.slice(c));break}r.push(l)}}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let n=0;n<t;n++){let t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==`string`?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
161
+ `),this.outputHelp({error:!0}));let n=t||{},r=n.exitCode||1,i=n.code||`commander.error`;this._exit(r,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in y.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||[`default`,`config`,`env`].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,y.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new kd(this.options),t=e=>this.getOptionValue(e)!==void 0&&![`default`,`implied`].includes(this.getOptionValueSource(e));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(e=>{Object.keys(e.implied).filter(e=>!t(e)).forEach(t=>{this.setOptionValueWithSource(t,e.implied[t],`implied`)})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:`commander.missingArgument`})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:`commander.optionMissingArgument`})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:`commander.missingMandatoryOptionValue`})}_conflictingOption(e,t){let n=e=>{let t=e.attributeName(),n=this.getOptionValue(t),r=this.options.find(e=>e.negate&&t===e.attributeName()),i=this.options.find(e=>!e.negate&&t===e.attributeName());return r&&(r.presetArg===void 0&&n===!1||r.presetArg!==void 0&&n===r.presetArg)?r:i||e},r=e=>{let t=n(e),r=t.attributeName();return this.getOptionValueSource(r)===`env`?`environment variable '${t.envVar}'`:`option '${t.flags}'`},i=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(i,{code:`commander.conflictingOption`})}unknownOption(e){if(this._allowUnknownOption)return;let t=``;if(e.startsWith(`--`)&&this._showSuggestionAfterError){let n=[],r=this;do{let e=r.createHelp().visibleOptions(r).filter(e=>e.long).map(e=>e.long);n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=Nd(e,n)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:`commander.unknownOption`})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?``:`s`,r=e.length,i=`error: too many arguments${this.parent?` for '${this.name()}'`:``}. Expected ${t} argument${n} but got ${r}: ${e.join(`, `)}.`;this.error(i,{code:`commander.excessArguments`})}unknownCommand(){let e=this.args[0],t=``;if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(e=>{n.push(e.name()),e.alias()&&n.push(e.alias())}),t=Nd(e,n)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:`commander.unknownCommand`})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t||=`-V, --version`,n||=`output the version number`;let r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on(`option:`+r.name(),()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,`commander.version`,e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw Error(`Command alias can't be the same as its name`);let n=this.parent?._findCommand(e);if(n){let t=[n.name()].concat(n.aliases()).join(`|`);throw Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${t}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let e=this.registeredArguments.map(e=>Ed(e));return[].concat(this.options.length||this._helpOption!==null?`[options]`:[],this.commands.length?`[command]`:[],this.registeredArguments.length?e:[]).join(` `)}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??``:(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??``:(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??``:(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=a.basename(e,a.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),n=this._getOutputContext(e);t.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let r=t.formatHelp(this,t);return n.hasColors?r:this._outputConfiguration.stripColor(r)}_getOutputContext(e){e||={};let t=!!e.error,n,r,i;return t?(n=e=>this._outputConfiguration.writeErr(e),r=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(n=e=>this._outputConfiguration.writeOut(e),r=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:t,write:e=>(r||(e=this._outputConfiguration.stripColor(e)),n(e)),hasColors:r,helpWidth:i}}outputHelp(e){let t;typeof e==`function`&&(t=e,e=void 0);let n=this._getOutputContext(e),r={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(e=>e.emit(`beforeAllHelp`,r)),this.emit(`beforeHelp`,r);let i=this.helpInformation({error:n.error});if(t&&(i=t(i),typeof i!=`string`&&!Buffer.isBuffer(i)))throw Error(`outputHelp callback must return a string or a Buffer`);n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit(`afterHelp`,r),this._getCommandAndAncestors().forEach(e=>e.emit(`afterAllHelp`,r))}helpOption(e,t){return typeof e==`boolean`?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??`-h, --help`,t??`display help for command`),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(y.exitCode??0);t===0&&e&&typeof e!=`function`&&e.error&&(t=1),this._exit(t,`commander.help`,`(outputHelp)`)}addHelpText(e,t){let n=[`beforeAll`,`before`,`after`,`afterAll`];if(!n.includes(e))throw Error(`Unexpected value for position to addHelpText.
162
+ Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let n;n=typeof t==`function`?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,`commander.helpDisplayed`,`(outputHelp)`))}};function Fd(e){return e.map(e=>{if(!e.startsWith(`--inspect`))return e;let t,n=`127.0.0.1`,r=`9229`,i;return(i=e.match(/^(--inspect(-brk|-wait)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port|-wait)?)=(\[[^\]]+\]|[^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port|-wait)?)=(\[[^\]]+\]|[^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],r=i[4]):(t=i[1],/^\d+$/.test(i[3])?r=i[3]:n=i[3]):t=i[1],t&&r!==`0`?`${t}=${n}:${parseInt(r)+1}`:e})}function Id(){if(y.env.NO_COLOR||y.env.FORCE_COLOR===`0`||y.env.FORCE_COLOR===`false`)return!1;if(y.env.FORCE_COLOR||y.env.CLICOLOR_FORCE!==void 0)return!0}new Pd;let Ld;function Rd(){return Ld??=Sd(`@longzai-intelligence-cli/core/provider`),Ld}const zd={red:e=>e,green:e=>e,yellow:e=>e,blue:e=>e,cyan:e=>e,magenta:e=>e,gray:e=>e,bold:e=>e,dim:e=>e};let Bd={select:async(e,t)=>t[0]?.value??``,textInput:async(e,t)=>t?.defaultValue??``,confirm:async(e,t)=>t?.defaultValue??!1,spinner:()=>({start:e=>Rd().info(e),stop:e=>Rd().info(e)}),note:(e,t)=>{t?Rd().info(`${t}: ${e}`):Rd().info(e)},log:{info:e=>Rd().info(e),success:e=>Rd().info(e),warn:e=>Rd().warn(e),error:e=>Rd().error(e),step:e=>Rd().info(e)}},Vd=zd;function Hd(e){Bd=e}function Ud(e){Vd=e}function Wd(){return Bd}function Gd(){return Vd}const Kd=()=>`0.0.26`;function qd(e){let t=e.version??Kd();e.interaction&&Hd(e.interaction),e.color&&Ud(e.color);let n=new Pd;return n.name(e.name).version(t,`-v, --version`,`输出 ${e.name} 的版本号`),e.description&&n.description(e.description),n}let Jd;function Yd(){return Jd??=Sd(`@longzai-intelligence-cli/core/define-command`),Jd}function Xd(e,t){let n=e.commands.find(e=>e.name()===t);return n===void 0?e.command(t):n}function Zd(e,t){if(t.length===1){let n=t[0];if(n===void 0)throw Error(`defineCommand: segments 为空,无法解析命令名`);return e.command(n)}let[n,...r]=t;if(n===void 0)throw Error(`defineCommand: segments 首段为空,无法解析父命令名`);let i=r.pop();if(i===void 0)throw Error(`defineCommand: segments 末段为空,无法解析子命令名`);let a=Xd(e,n);for(let e of r)a=Xd(a,e);return a.command(i)}function Qd(e){return typeof e==`object`&&!!e&&`opts`in e&&typeof e.opts==`function`&&`args`in e&&Array.isArray(e.args)}function $d(e,t){let n=Zd(e,t.name.split(` `).filter(e=>e.length>0));t.description&&n.description(t.description);for(let e of t.arguments??[])e.description?n.argument(e.signature,e.description):n.argument(e.signature);for(let e of t.options??[])e.defaultValue===void 0?n.option(e.flags,e.description??``):n.option(e.flags,e.description??``,e.defaultValue);n.action(async(...e)=>{let n=e[e.length-1];if(!Qd(n))return;let r=n.opts(),i=n.args,a=t.schema.safeParse(r);if(!a.success){let e=a.error.issues.map(e=>e.message).join(`, `);Yd().error(Gd().red(`参数校验失败: ${e}`)),Wd().log.error(`参数校验失败: ${e}`),process.exit(1)}await t.action(a.data,i)})}var ef=/* @__PURE__ */ oe(import.meta.url);function tf(e){let t=ne(e);return t.length>1&&t[t.length-1]===M&&(t=t.substring(0,t.length-1)),t}const nf=/[\\/]/g;function rf(e,t){return e.replace(nf,t)}const af=/^[a-z]:[\\/]$/i;function of(e){return e===`/`||af.test(e)}function sf(e,t){let{resolvePaths:n,normalizePath:r,pathSeparator:i}=t,a=process.platform===`win32`&&e.includes(`/`)||e.startsWith(`.`);return n&&(e=j(e)),(r||a)&&(e=tf(e)),e===`.`?``:rf(e[e.length-1]===i?e:e+i,i)}function cf(e,t){return t+e}function lf(e,t){return function(n,r){return r.startsWith(e)?r.slice(e.length)+n:rf(ie(e,r),t.pathSeparator)+t.pathSeparator+n}}function uf(e){return e}function df(e,t,n){return t+e+n}function ff(e,t){let{relativePaths:n,includeBasePath:r}=t;return n&&e?lf(e,t):r?cf:uf}function pf(e){return function(t,n){n.push(t.substring(e.length)||`.`)}}function mf(e){return function(t,n,r){let i=t.substring(e.length)||`.`;r.every(e=>e(i,!0))&&n.push(i)}}const hf=(e,t)=>{t.push(e||`.`)},gf=(e,t,n)=>{let r=e||`.`;n.every(e=>e(r,!0))&&t.push(r)},_f=()=>{};function vf(e,t){let{includeDirs:n,filters:r,relativePaths:i}=t;return n?i?r&&r.length?mf(e):pf(e):r&&r.length?gf:hf:_f}const yf=(e,t,n,r)=>{r.every(t=>t(e,!1))&&n.files++},bf=(e,t,n,r)=>{r.every(t=>t(e,!1))&&t.push(e)},xf=(e,t,n,r)=>{n.files++},Sf=(e,t)=>{t.push(e)},Cf=()=>{};function wf(e){let{excludeFiles:t,filters:n,onlyCounts:r}=e;return t?Cf:n&&n.length?r?yf:bf:r?xf:Sf}const Tf=e=>e,Ef=()=>[``].slice(0,0);function Df(e){return e.group?Ef:Tf}const Of=(e,t,n)=>{e.push({directory:t,files:n,dir:t})},kf=()=>{};function Af(e){return e.group?Of:kf}const jf=function(e,t,n){let{queue:r,fs:i,options:{suppressErrors:a}}=t;r.enqueue(),i.realpath(e,(o,s)=>{if(o)return r.dequeue(a?null:o,t);i.stat(s,(i,o)=>{if(i)return r.dequeue(a?null:i,t);if(o.isDirectory()&&Pf(e,s,t))return r.dequeue(null,t);n(o,s),r.dequeue(null,t)})})},Mf=function(e,t,n){let{queue:r,fs:i,options:{suppressErrors:a}}=t;r.enqueue();try{let r=i.realpathSync(e),a=i.statSync(r);if(a.isDirectory()&&Pf(e,r,t))return;n(a,r)}catch(e){if(!a)throw e}};function Nf(e,t){return!e.resolveSymlinks||e.excludeSymlinks?null:t?Mf:jf}function Pf(e,t,n){if(n.options.useRealPaths)return Ff(t,n);let r=ee(e),i=1;for(;r!==n.root&&i<2;){let e=n.symlinks.get(r);e&&(e===t||e.startsWith(t)||t.startsWith(e))?i++:r=ee(r)}return n.symlinks.set(e,t),i>1}function Ff(e,t){return t.visited.includes(e+t.options.pathSeparator)}const If=e=>e.counts,Lf=e=>e.groups,Rf=e=>e.paths,zf=e=>e.paths.slice(0,e.options.maxFiles),Bf=(e,t,n)=>(Wf(t,n,e.counts,e.options.suppressErrors),null),Vf=(e,t,n)=>(Wf(t,n,e.paths,e.options.suppressErrors),null),Hf=(e,t,n)=>(Wf(t,n,e.paths.slice(0,e.options.maxFiles),e.options.suppressErrors),null),Uf=(e,t,n)=>(Wf(t,n,e.groups,e.options.suppressErrors),null);function Wf(e,t,n,r){t(e&&!r?e:null,n)}function Gf(e,t){let{onlyCounts:n,group:r,maxFiles:i}=e;return n?t?If:Bf:r?t?Lf:Uf:i?t?zf:Hf:t?Rf:Vf}const Kf={withFileTypes:!0},qf=(e,t,n,r,i)=>{if(e.queue.enqueue(),r<0)return e.queue.dequeue(null,e);let{fs:a}=e;e.visited.push(t),e.counts.directories++,a.readdir(t||`.`,Kf,(t,a=[])=>{i(a,n,r),e.queue.dequeue(e.options.suppressErrors?null:t,e)})},Jf=(e,t,n,r,i)=>{let{fs:a}=e;if(r<0)return;e.visited.push(t),e.counts.directories++;let o=[];try{o=a.readdirSync(t||`.`,Kf)}catch(t){if(!e.options.suppressErrors)throw t}i(o,n,r)};function Yf(e){return e?Jf:qf}var Xf=class{count=0;constructor(e){this.onQueueEmpty=e}enqueue(){return this.count++,this.count}dequeue(e,t){this.onQueueEmpty&&(--this.count<=0||e)&&(this.onQueueEmpty(e,t),e&&(t.controller.abort(),this.onQueueEmpty=void 0))}},Zf=class{_files=0;_directories=0;set files(e){this._files=e}get files(){return this._files}set directories(e){this._directories=e}get directories(){return this._directories}
163
163
  /* c8 ignore next 3 */
164
- get dirs(){return this._directories}},Zf=class{aborted=!1;abort(){this.aborted=!0}},Qf=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(e,t,n){this.isSynchronous=!n,this.callbackInvoker=Wf(t,this.isSynchronous),this.root=of(e,t),this.state={root:af(this.root)?this.root:this.root.slice(0,-1),paths:[``].slice(0,0),groups:[],counts:new Xf,options:t,queue:new Yf((e,t)=>this.callbackInvoker(t,e,n)),symlinks:/* @__PURE__ */ new Map,visited:[``].slice(0,0),controller:new Zf,fs:t.fs||C},this.joinPath=df(this.root,t),this.pushDirectory=_f(this.root,t),this.pushFile=Cf(t),this.getArray=Ef(t),this.groupFiles=kf(t),this.resolveSymlink=Mf(t,this.isSynchronous),this.walkDirectory=Jf(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(e,t,n)=>{let{paths:r,options:{filters:i,resolveSymlinks:a,excludeSymlinks:o,exclude:s,maxFiles:c,signal:l,useRealPaths:u,pathSeparator:d},controller:f}=this.state;if(f.aborted||l&&l.aborted||c&&r.length>c)return;let p=this.getArray(this.state.paths);for(let c=0;c<e.length;++c){let l=e[c];if(l.isFile()||l.isSymbolicLink()&&!a&&!o){let e=this.joinPath(l.name,t);this.pushFile(e,p,this.state.counts,i)}else if(l.isDirectory()){let e=uf(l.name,t,this.state.options.pathSeparator);if(s&&s(l.name,e))continue;this.pushDirectory(e,r,i),this.walkDirectory(this.state,e,e,n-1,this.walk)}else if(this.resolveSymlink&&l.isSymbolicLink()){let e=sf(l.name,t);this.resolveSymlink(e,this.state,(t,r)=>{if(t.isDirectory()){if(r=of(r,this.state.options),s&&s(l.name,u?r:e+d))return;this.walkDirectory(this.state,r,u?r:e+d,n-1,this.walk)}else{r=u?r:e;let t=A(r),n=of(ee(r),this.state.options);r=this.joinPath(t,n),this.pushFile(r,p,this.state.counts,i)}})}}this.groupFiles(this.state.groups,t,p)}};function $f(e,t){return new Promise((n,r)=>{ep(e,t,(e,t)=>{if(e)return r(e);n(t)})})}function ep(e,t,n){new Qf(e,t,n).start()}function tp(e,t){return new Qf(e,t).start()}var np=class{constructor(e,t){this.root=e,this.options=t}withPromise(){return $f(this.root,this.options)}withCallback(e){ep(this.root,this.options,e)}sync(){return tp(this.root,this.options)}};let rp=null;
164
+ get dirs(){return this._directories}},Qf=class{aborted=!1;abort(){this.aborted=!0}},$f=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(e,t,n){this.isSynchronous=!n,this.callbackInvoker=Gf(t,this.isSynchronous),this.root=sf(e,t),this.state={root:of(this.root)?this.root:this.root.slice(0,-1),paths:[``].slice(0,0),groups:[],counts:new Zf,options:t,queue:new Xf((e,t)=>this.callbackInvoker(t,e,n)),symlinks:/* @__PURE__ */ new Map,visited:[``].slice(0,0),controller:new Qf,fs:t.fs||C},this.joinPath=ff(this.root,t),this.pushDirectory=vf(this.root,t),this.pushFile=wf(t),this.getArray=Df(t),this.groupFiles=Af(t),this.resolveSymlink=Nf(t,this.isSynchronous),this.walkDirectory=Yf(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(e,t,n)=>{let{paths:r,options:{filters:i,resolveSymlinks:a,excludeSymlinks:o,exclude:s,maxFiles:c,signal:l,useRealPaths:u,pathSeparator:d},controller:f}=this.state;if(f.aborted||l&&l.aborted||c&&r.length>c)return;let p=this.getArray(this.state.paths);for(let c=0;c<e.length;++c){let l=e[c];if(l.isFile()||l.isSymbolicLink()&&!a&&!o){let e=this.joinPath(l.name,t);this.pushFile(e,p,this.state.counts,i)}else if(l.isDirectory()){let e=df(l.name,t,this.state.options.pathSeparator);if(s&&s(l.name,e))continue;this.pushDirectory(e,r,i),this.walkDirectory(this.state,e,e,n-1,this.walk)}else if(this.resolveSymlink&&l.isSymbolicLink()){let e=cf(l.name,t);this.resolveSymlink(e,this.state,(t,r)=>{if(t.isDirectory()){if(r=sf(r,this.state.options),s&&s(l.name,u?r:e+d))return;this.walkDirectory(this.state,r,u?r:e+d,n-1,this.walk)}else{r=u?r:e;let t=A(r),n=sf(ee(r),this.state.options);r=this.joinPath(t,n),this.pushFile(r,p,this.state.counts,i)}})}}this.groupFiles(this.state.groups,t,p)}};function ep(e,t){return new Promise((n,r)=>{tp(e,t,(e,t)=>{if(e)return r(e);n(t)})})}function tp(e,t,n){new $f(e,t,n).start()}function np(e,t){return new $f(e,t).start()}var rp=class{constructor(e,t){this.root=e,this.options=t}withPromise(){return ep(this.root,this.options)}withCallback(e){tp(this.root,this.options,e)}sync(){return np(this.root,this.options)}};let ip=null;
165
165
  /* c8 ignore next 6 */
166
- try{$d.resolve(`picomatch`),rp=$d(`picomatch`)}catch{}var ip=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:M,filters:[]};globFunction;constructor(e){this.options={...this.options,...e},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(e){return this.options.pathSeparator=e,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(e){return this.options.maxDepth=e,this}withMaxFiles(e){return this.options.maxFiles=e,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:e=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=e,this.withFullPaths()}withAbortSignal(e){return this.options.signal=e,this}normalize(){return this.options.normalizePath=!0,this}filter(e){return this.options.filters.push(e),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(e){return this.options.exclude=e,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(e){return new np(e||`.`,this.options)}withGlobFunction(e){return this.globFunction=e,this}
166
+ try{ef.resolve(`picomatch`),ip=ef(`picomatch`)}catch{}var ap=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:M,filters:[]};globFunction;constructor(e){this.options={...this.options,...e},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(e){return this.options.pathSeparator=e,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(e){return this.options.maxDepth=e,this}withMaxFiles(e){return this.options.maxFiles=e,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:e=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=e,this.withFullPaths()}withAbortSignal(e){return this.options.signal=e,this}normalize(){return this.options.normalizePath=!0,this}filter(e){return this.options.filters.push(e),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(e){return this.options.exclude=e,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(e){return new rp(e||`.`,this.options)}withGlobFunction(e){return this.globFunction=e,this}
167
167
  /* c8 ignore next 4 */
168
- crawlWithOptions(e,t){return this.options={...this.options,...t},new np(e||`.`,this.options)}glob(...e){return this.globFunction?this.globWithOptions(e):this.globWithOptions(e,{dot:!0})}globWithOptions(e,...t){let n=this.globFunction||rp;
168
+ crawlWithOptions(e,t){return this.options={...this.options,...t},new rp(e||`.`,this.options)}glob(...e){return this.globFunction?this.globWithOptions(e):this.globWithOptions(e,{dot:!0})}globWithOptions(e,...t){let n=this.globFunction||ip;
169
169
  /* c8 ignore next 5 */
170
- if(!n)throw Error(`Please specify a glob function to use glob matching.`);var r=this.globCache[e.join(`\0`)];return r||(r=n(e,...t),this.globCache[e.join(`\0`)]=r),this.options.filters.push(e=>r(e)),this}},ap=/* @__PURE__ */ L(((e,t)=>{let n=`[^\\\\/]`,r=`[^/]`,i=`(?:\\/|$)`,a=`(?:^|\\/)`,o=`\\.{1,2}${i}`,s={DOT_LITERAL:`\\.`,PLUS_LITERAL:`\\+`,QMARK_LITERAL:`\\?`,SLASH_LITERAL:`\\/`,ONE_CHAR:`(?=.)`,QMARK:r,END_ANCHOR:i,DOTS_SLASH:o,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!${a}${o})`,NO_DOT_SLASH:`(?!\\.{0,1}${i})`,NO_DOTS_SLASH:`(?!${o})`,QMARK_NO_DOT:`[^.\\/]`,STAR:`${r}*?`,START_ANCHOR:a,SEP:`/`},c={...s,SLASH_LITERAL:`[\\\\/]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`\\.{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!\\.{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!\\.{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:`[^.\\\\/]`,START_ANCHOR:`(?:^|[\\\\/])`,END_ANCHOR:`(?:[\\\\/]|$)`,SEP:`\\`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?c:s}}})),op=/* @__PURE__ */ L((e=>{let{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=ap();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),sp=/* @__PURE__ */ L(((e,t)=>{let n=op(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:_}=ap(),v=e=>e===l||e===a,y=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let b=t||{},x=e.length-1,S=b.parts===!0||b.tokens===!0||b.scanToEnd===!0,C=[],w=[],T=[],E=e,D=-1,O=0,k=0,A=!1,ee=!1,te=!1,ne=!1,re=!1,ie=!1,j=!1,M=!1,ae=!1,oe=!1,se=0,N,P,F={value:``,depth:0,isGlob:!1},ce=()=>D>=x,le=()=>E.charCodeAt(D+1),ue=()=>(N=P,E.charCodeAt(++D));for(;D<x;){P=ue();let e;if(P===a)j=F.backslashes=!0,P=ue(),P===u&&(ie=!0);else{if(ie===!0||P===u){for(se++;ce()!==!0&&(P=ue());)if(P===a)j=F.backslashes=!0,ue();else if(P===u)se++;else{if(ie!==!0&&P===s&&(P=ue())===s||ie!==!0&&P===o){if(A=F.isBrace=!0,te=F.isGlob=!0,oe=!0,S===!0)continue;break}if(P===h&&(se--,se===0)){ie=!1,A=F.isBrace=!0,oe=!0;break}}if(S===!0)continue;break}if(P===l){if(C.push(D),w.push(F),F={value:``,depth:0,isGlob:!1},oe===!0)continue;if(N===s&&D===O+1){O+=2;continue}k=D+1}else{if(b.noext!==!0&&(P===p||P===i||P===r||P===m||P===c)&&le()===d){if(te=F.isGlob=!0,ne=F.isExtglob=!0,oe=!0,P===c&&D===O&&(ae=!0),S===!0){let e=0;for(;ce()!==!0&&(P=ue());)if(P===a)j=F.backslashes=!0,ue();else if(P===d)e++;else if(P===g&&--e===0){oe=!0;break}continue}break}if(P===r){if(N===r&&(re=F.isGlobstar=!0),te=F.isGlob=!0,oe=!0,S===!0)continue;break}if(P===m){if(te=F.isGlob=!0,oe=!0,S===!0)continue;break}if(P===f){for(;ce()!==!0&&(e=ue());)if(e===a)j=F.backslashes=!0,ue();else if(e===_){ee=F.isBracket=!0,te=F.isGlob=!0,oe=!0;break}if(S===!0)continue;break}if(b.nonegate!==!0&&P===c&&D===O)M=F.negated=!0,O++;else{if(b.noparen!==!0&&P===d){if(te=F.isGlob=!0,S===!0){let e=1;for(;ce()!==!0&&(P=ue());)if(P===a)j=F.backslashes=!0,ue();else if(P===d)e++;else if(P===g&&--e===0){oe=!0;break}continue}break}if(te===!0){if(oe=!0,S===!0)continue;break}}}}}b.noext===!0&&(ne=!1,te=!1);let I=E,de=``,fe=``;O>0&&(de=E.slice(0,O),E=E.slice(O),k-=O),I&&te===!0&&k>0?(I=E.slice(0,k),fe=E.slice(k)):te===!0?(I=``,fe=E):I=E,I&&I!==``&&I!==`/`&&I!==E&&v(I.charCodeAt(I.length-1))&&(I=I.slice(0,-1)),b.unescape===!0&&(fe&&=n.removeBackslashes(fe),I&&j===!0&&(I=n.removeBackslashes(I)));let pe={prefix:de,input:e,start:O,base:I,glob:fe,isBrace:A,isBracket:ee,isGlob:te,isExtglob:ne,isGlobstar:re,negated:M,negatedExtglob:ae};if(b.tokens===!0&&(pe.maxDepth=0,v(P)||w.push(F),pe.tokens=w),b.parts===!0||b.tokens===!0){let t;for(let n=0;n<C.length;n++){let r=t===void 0?O:t+1,i=C[n],a=e.slice(r,i);b.tokens&&(n===0&&O!==0?(w[n].isPrefix=!0,w[n].value=de):w[n].value=a,y(w[n]),pe.maxDepth+=w[n].depth),i>=O&&(T.push(a),t=i)}let n=t===void 0?O:t+1,r=e.slice(n);T.push(r),b.tokens&&t&&t+1<e.length&&(w[w.length-1].value=r,y(w[w.length-1]),pe.maxDepth+=w[w.length-1].depth),pe.slashes=C,pe.parts=T}return pe}})),cp=/* @__PURE__ */ L(((e,t)=>{let n=ap(),r=op(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e)if(o===!0)a+=s,o=!1;else if(s===`\\`)a+=s,o=!0;else if(s===`"`)i=i===1?0:1,a+=s;else{if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},f=e=>{let t=!1;for(let n of e)if(t===!0)t=!1;else if(n===`\\`)t=!0;else if(/[?*+@!()[\]{}]/.test(n))return!1;return!0},p=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(f(t))return t.replace(/\\(.)/g,`$1`)},m=e=>{let t=e.map(p).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(a&&r===a.repeat(r.length)&&i===a.repeat(i.length)&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},h=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0)a=!1;else if(s===`\\`)a=!0;else if(s===`"`)i=i===1?0:1;else if(i!==1){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(!(n>0)){if(s===`(`)r++;else if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},g=e=>`${e.length===1?r.escapeRegex(e[0]):`[${e.map(e=>r.escapeRegex(e)).join(``)}]`}*`,_=e=>{let t=0,n=[];for(;t<e.length;){let r=h(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=d(r.body).map(e=>e.trim());if(i.length!==1)return;let a=p(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return n},v=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},y=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=d(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||m(i)))return{risky:!0};let a=[],o=!1,s=!0;for(let e of i){let t=_(e);if(t){o=!0,a.push(...t);continue}let n=p(e);if(n&&n.length===1)a.push(n);else if(s=!1,v(e)>r)return{risky:!0}}return o?s?{risky:!0,safeOutput:g([...new Set(a)])}:{risky:!0}:{risky:!1}},b=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let d={...t},f=typeof d.maxLength==`number`?Math.min(i,d.maxLength):i,p=e.length;if(p>f)throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${f}`);let m={type:`bos`,value:``,output:d.prepend||``},h=[m],g=d.capture?``:`?:`,_=n.globChars(d.windows),v=n.extglobChars(_),{DOT_LITERAL:x,PLUS_LITERAL:S,SLASH_LITERAL:C,ONE_CHAR:w,DOTS_SLASH:T,NO_DOT:E,NO_DOT_SLASH:D,NO_DOTS_SLASH:O,QMARK:k,QMARK_NO_DOT:A,STAR:ee,START_ANCHOR:te}=_,ne=e=>`(${g}(?:(?!${te}${e.dot?T:x}).)*?)`,re=d.dot?``:E,ie=d.dot?k:A,j=d.bash===!0?ne(d):ee;d.capture&&(j=`(${j})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let M={input:e,index:-1,start:0,dot:d.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};e=r.removePrefix(e,M),p=e.length;let ae=[],oe=[],se=[],N=m,P,F=()=>M.index===p-1,ce=M.peek=(t=1)=>e[M.index+t],le=M.advance=()=>e[++M.index]||``,ue=()=>e.slice(M.index+1),I=(e=``,t=0)=>{M.consumed+=e,M.index+=t},de=e=>{M.output+=e.output==null?e.value:e.output,I(e.value)},fe=()=>{let e=1;for(;ce()===`!`&&(ce(2)!==`(`||ce(3)===`?`);)le(),M.start++,e++;return e%2!=0&&(M.negated=!0,M.start++,!0)},pe=e=>{M[e]++,se.push(e)},L=e=>{M[e]--,se.pop()},R=e=>{if(N.type===`globstar`){let t=M.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||ae.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(M.output=M.output.slice(0,-N.output.length),N.type=`star`,N.value=`*`,N.output=j,M.output+=N.output)}ae.length&&e.type!==`paren`&&(ae[ae.length-1].inner+=e.value),(e.value||e.output)&&de(e),N&&N.type===`text`&&e.type===`text`?(N.output=(N.output||N.value)+e.value,N.value+=e.value):(e.prev=N,h.push(e),N=e)},me=(e,t)=>{let n={...v[t],conditions:1,inner:``};n.prev=N,n.parens=M.parens,n.output=M.output,n.startIndex=M.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;pe(`parens`),R({type:e,value:t,output:M.output?``:w}),R({type:`paren`,extglob:!0,value:le(),output:r}),ae.push(n)},z=n=>{let i=e.slice(n.startIndex,M.index+1),a=e.slice(n.startIndex+2,M.index),o=y(a,d);if((n.type===`plus`||n.type===`star`)&&o.risky){let e=o.safeOutput?(n.output?``:w)+(d.capture?`(${o.safeOutput})`:o.safeOutput):void 0,t=h[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<h.length;e++)h[e].value=``,h[e].output=``,delete h[e].suffix;M.output=n.output+t.output,M.backtrack=!0,R({type:`paren`,extglob:!0,value:P,output:``}),L(`parens`);return}let s=n.close+(d.capture?`)`:``),c;if(n.type===`negate`){let e=j;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=ne(d)),(e!==j||F()||/^\)+$/.test(ue()))&&(s=n.close=`)$))${e}`),n.inner.includes(`*`)&&(c=ue())&&/^\.[^\\/.]+$/.test(c)&&(s=n.close=`)${b(c,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(M.negatedExtglob=!0)}R({type:`paren`,extglob:!0,value:P,output:s}),L(`parens`)};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?k.repeat(a.length):``):o===0?ie+(a?k.repeat(a.length):``):k.repeat(r.length):i===`.`?x.repeat(r.length):i===`*`?t?t+i+(a?j:``):j:t?e:`\\${e}`);return n===!0&&(i=d.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&d.contains===!0?(M.output=e,M):(M.output=r.wrapOutput(i,M,t),M)}for(;!F();){if(P=le(),P===`\0`)continue;if(P===`\\`){let e=ce();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){P+=`\\`,R({type:`text`,value:P});continue}let t=/^\\+/.exec(ue()),n=0;if(t&&t[0].length>2&&(n=t[0].length,M.index+=n,n%2!=0&&(P+=`\\`)),d.unescape===!0?P=le():P+=le(),M.brackets===0){R({type:`text`,value:P});continue}}if(M.brackets>0&&(P!==`]`||N.value===`[`||N.value===`[^`)){if(d.posix!==!1&&P===`:`){let e=N.value.slice(1);if(e.includes(`[`)&&(N.posix=!0,e.includes(`:`))){let e=N.value.lastIndexOf(`[`),t=N.value.slice(0,e),n=N.value.slice(e+2),r=a[n];if(r){N.value=t+r,M.backtrack=!0,le(),!m.output&&h.indexOf(N)===1&&(m.output=w);continue}}}(P===`[`&&ce()!==`:`||P===`-`&&ce()===`]`)&&(P=`\\${P}`),P===`]`&&(N.value===`[`||N.value===`[^`)&&(P=`\\${P}`),d.posix===!0&&P===`!`&&N.value===`[`&&(P=`^`),N.value+=P,de({value:P});continue}if(M.quotes===1&&P!==`"`){P=r.escapeRegex(P),N.value+=P,de({value:P});continue}if(P===`"`){M.quotes=M.quotes===1?0:1,d.keepQuotes===!0&&R({type:`text`,value:P});continue}if(P===`(`){pe(`parens`),R({type:`paren`,value:P});continue}if(P===`)`){if(M.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=ae[ae.length-1];if(e&&M.parens===e.parens+1){z(ae.pop());continue}R({type:`paren`,value:P,output:M.parens?`)`:`\\)`}),L(`parens`);continue}if(P===`[`){if(d.nobracket===!0||!ue().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));P=`\\${P}`}else pe(`brackets`);R({type:`bracket`,value:P});continue}if(P===`]`){if(d.nobracket===!0||N&&N.type===`bracket`&&N.value.length===1){R({type:`text`,value:P,output:`\\${P}`});continue}if(M.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));R({type:`text`,value:P,output:`\\${P}`});continue}L(`brackets`);let e=N.value.slice(1);if(N.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(P=`/${P}`),N.value+=P,de({value:P}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(N.value);if(M.output=M.output.slice(0,-N.value.length),d.literalBrackets===!0){M.output+=t,N.value=t;continue}N.value=`(${g}${t}|${N.value})`,M.output+=N.value;continue}if(P===`{`&&d.nobrace!==!0){pe(`braces`);let e={type:`brace`,value:P,output:`(`,outputIndex:M.output.length,tokensIndex:M.tokens.length};oe.push(e),R(e);continue}if(P===`}`){let e=oe[oe.length-1];if(d.nobrace===!0||!e){R({type:`text`,value:P,output:P});continue}let t=`)`;if(e.dots===!0){let e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,d),M.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=M.output.slice(0,e.outputIndex),r=M.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,P=t=`\\}`,M.output=n;for(let e of r)M.output+=e.output||e.value}R({type:`brace`,value:P,output:t}),L(`braces`),oe.pop();continue}if(P===`|`){ae.length>0&&ae[ae.length-1].conditions++,R({type:`text`,value:P});continue}if(P===`,`){let e=P,t=oe[oe.length-1];t&&se[se.length-1]===`braces`&&(t.comma=!0,e=`|`),R({type:`comma`,value:P,output:e});continue}if(P===`/`){if(N.type===`dot`&&M.index===M.start+1){M.start=M.index+1,M.consumed=``,M.output=``,h.pop(),N=m;continue}R({type:`slash`,value:P,output:C});continue}if(P===`.`){if(M.braces>0&&N.type===`dot`){N.value===`.`&&(N.output=x);let e=oe[oe.length-1];N.type=`dots`,N.output+=P,N.value+=P,e.dots=!0;continue}if(M.braces+M.parens===0&&N.type!==`bos`&&N.type!==`slash`){R({type:`text`,value:P,output:x});continue}R({type:`dot`,value:P,output:x});continue}if(P===`?`){if(!(N&&N.value===`(`)&&d.noextglob!==!0&&ce()===`(`&&ce(2)!==`?`){me(`qmark`,P);continue}if(N&&N.type===`paren`){let e=ce(),t=P;(N.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(ue()))&&(t=`\\${P}`),R({type:`text`,value:P,output:t});continue}if(d.dot!==!0&&(N.type===`slash`||N.type===`bos`)){R({type:`qmark`,value:P,output:A});continue}R({type:`qmark`,value:P,output:k});continue}if(P===`!`){if(d.noextglob!==!0&&ce()===`(`&&(ce(2)!==`?`||!/[!=<:]/.test(ce(3)))){me(`negate`,P);continue}if(d.nonegate!==!0&&M.index===0){fe();continue}}if(P===`+`){if(d.noextglob!==!0&&ce()===`(`&&ce(2)!==`?`){me(`plus`,P);continue}if(N&&N.value===`(`||d.regex===!1){R({type:`plus`,value:P,output:S});continue}if(N&&(N.type===`bracket`||N.type===`paren`||N.type===`brace`)||M.parens>0){R({type:`plus`,value:P});continue}R({type:`plus`,value:S});continue}if(P===`@`){if(d.noextglob!==!0&&ce()===`(`&&ce(2)!==`?`){R({type:`at`,extglob:!0,value:P,output:``});continue}R({type:`text`,value:P});continue}if(P!==`*`){(P===`$`||P===`^`)&&(P=`\\${P}`);let e=o.exec(ue());e&&(P+=e[0],M.index+=e[0].length),R({type:`text`,value:P});continue}if(N&&(N.type===`globstar`||N.star===!0)){N.type=`star`,N.star=!0,N.value+=P,N.output=j,M.backtrack=!0,M.globstar=!0,I(P);continue}let t=ue();if(d.noextglob!==!0&&/^\([^?]/.test(t)){me(`star`,P);continue}if(N.type===`star`){if(d.noglobstar===!0){I(P);continue}let n=N.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(d.bash===!0&&(!i||t[0]&&t[0]!==`/`)){R({type:`star`,value:P,output:``});continue}let o=M.braces>0&&(n.type===`comma`||n.type===`brace`),s=ae.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){R({type:`star`,value:P,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[M.index+4];if(n&&n!==`/`)break;t=t.slice(3),I(`/**`,3)}let c=F()||M.parens>0&&t===`)`.repeat(M.parens)&&!ae.some(e=>e.type===`negate`);if(n.type===`bos`&&F()){N.type=`globstar`,N.value+=P,N.output=ne(d),M.output=N.output,M.globstar=!0,I(P);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&c){M.output=M.output.slice(0,-(n.output+N.output).length),n.output=`(?:${n.output}`,N.type=`globstar`,N.output=ne(d)+(d.strictSlashes?`)`:`|$)`),N.value+=P,M.globstar=!0,M.output+=n.output+N.output,I(P);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;M.output=M.output.slice(0,-(n.output+N.output).length),n.output=`(?:${n.output}`,N.type=`globstar`,N.output=`${ne(d)}${C}|${C}${e})`,N.value+=P,M.output+=n.output+N.output,M.globstar=!0,I(P+le()),R({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){N.type=`globstar`,N.value+=P,N.output=`(?:^|${C}|${ne(d)}${C})`,M.output=N.output,M.globstar=!0,I(P+le()),R({type:`slash`,value:`/`,output:``});continue}M.output=M.output.slice(0,-N.output.length),N.type=`globstar`,N.output=ne(d),N.value+=P,M.output+=N.output,M.globstar=!0,I(P);continue}let n={type:`star`,value:P,output:j};d.bash===!0?(n.output=`.*?`,(N.type===`bos`||N.type===`slash`)&&(n.output=re+n.output),R(n)):N&&(N.type===`bracket`||N.type===`paren`)&&d.regex===!0?(n.output=P,R(n)):((M.index===M.start||N.type===`slash`||N.type===`dot`)&&(N.type===`dot`?(M.output+=D,N.output+=D):d.dot===!0?(M.output+=O,N.output+=O):(M.output+=re,N.output+=re),ce()!==`*`&&(M.output+=w,N.output+=w)),R(n))}for(;M.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));M.output=r.escapeLast(M.output,`[`),L(`brackets`)}for(;M.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));M.output=r.escapeLast(M.output,`(`),L(`parens`)}for(;M.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));M.output=r.escapeLast(M.output,`{`),L(`braces`)}if(d.strictSlashes!==!0&&(N.type===`star`||N.type===`bracket`)&&R({type:`maybe_slash`,value:``,output:`${C}?`}),M.backtrack===!0){M.output=``;for(let e of M.tokens)M.output+=e.output==null?e.value:e.output,e.suffix&&(M.output+=e.suffix)}return M};b.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:_}=n.globChars(a.windows),v=a.dot?m:p,y=a.dot?h:p,b=a.capture?``:`?:`,x={negated:!1,prefix:``},S=a.bash===!0?`.*?`:g;a.capture&&(S=`(${S})`);let C=e=>e.noglobstar===!0?S:`(${b}(?:(?!${_}${e.dot?f:l}).)*?)`,w=e=>{switch(e){case`*`:return`${v}${d}${S}`;case`.*`:return`${l}${d}${S}`;case`*.*`:return`${v}${S}${l}${d}${S}`;case`*/*`:return`${v}${S}${u}${d}${y}${S}`;case`**`:return v+C(a);case`**/*`:return`(?:${v}${C(a)}${u})?${y}${d}${S}`;case`**/*.*`:return`(?:${v}${C(a)}${u})?${y}${S}${l}${d}${S}`;case`**/.*`:return`(?:${v}${C(a)}${u})?${l}${d}${S}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=w(t[1]);return n?n+l+t[2]:void 0}}},T=w(r.removePrefix(e,x));return T&&a.strictSlashes!==!0&&(T+=`${u}?`),T},t.exports=b})),lp=/* @__PURE__ */ L(((e,t)=>{let n=sp(),r=cp(),i=op(),a=ap(),o=e=>e&&typeof e==`object`&&!Array.isArray(e),s=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>s(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=o(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=c.state;delete c.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=s(i.ignore,e,n)}let d=(n,r=!1)=>{let{isMatch:o,match:d,output:f}=s.test(n,c,t,{glob:e,posix:a}),p={glob:e,state:l,regex:c,posix:a,input:n,output:f,match:d,isMatch:o};return typeof i.onResult==`function`&&i.onResult(p),o===!1?(p.isMatch=!1,r?p:!1):u(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),!r||p)};return n&&(d.state=l),d};s.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},c=o.format||(a?i.toPosixSlashes:null),l=e===r,u=l&&c?c(e):e;return l===!1&&(u=c?c(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?s.matchBase(e,t,n,a):t.exec(u)),{isMatch:!!l,match:l,output:u}},s.matchBase=(e,t,n,r=n&&n.windows)=>(t instanceof RegExp?t:s.makeRe(t,n)).test(i.basename(e,{windows:r})),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map(e=>s.parse(e,t)):r(e,{...t,fastpaths:!1}),s.scan=(e,t)=>n(e,t),s.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,c=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(c=`^(?!${c}).*$`);let l=s.toRegex(c,t);return r===!0&&(l.state=e),l},s.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),s.compileRe(a,t,n,i)},s.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},s.constants=a,t.exports=s})),up=/* @__PURE__ */ pe((/* @__PURE__ */ L(((e,t)=>{let n=lp(),r=op();function i(e,t,i=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:r.isWindows()}),n(e,t,i)}Object.assign(i,n),t.exports=i})))(),1);const dp=Array.isArray,fp=/\\/g,pp=/^[A-Za-z]:$/,mp=process.platform===`win32`,hp=/^(\/?\.\.)+$/;function gp(e,t={}){let n=e.length,r=Array(n),i=Array(n),a,o;for(a=0;a<n;a++){let n=Cp(e[a]);r[a]=n;let s=n.length,c=Array(s);for(o=0;o<s;o++)c[o]=(0,up.default)(n[o],t);i[a]=c}return e=>{let s=e.split(`/`);if(s[0]===`..`&&hp.test(e))return!0;for(a=0;a<n;a++){let e=r[a],n=i[a],c=s.length,l=Math.min(c,e.length);for(o=0;o<l;){let r=e[o];if(r.includes(`/`))return!0;if(!n[o](s[o]))break;if(!t.noglobstar&&r===`**`)return!0;o++}if(o===c)return!0}return!1}}
170
+ if(!n)throw Error(`Please specify a glob function to use glob matching.`);var r=this.globCache[e.join(`\0`)];return r||(r=n(e,...t),this.globCache[e.join(`\0`)]=r),this.options.filters.push(e=>r(e)),this}},op=/* @__PURE__ */ L(((e,t)=>{let n=`[^\\\\/]`,r=`[^/]`,i=`(?:\\/|$)`,a=`(?:^|\\/)`,o=`\\.{1,2}${i}`,s={DOT_LITERAL:`\\.`,PLUS_LITERAL:`\\+`,QMARK_LITERAL:`\\?`,SLASH_LITERAL:`\\/`,ONE_CHAR:`(?=.)`,QMARK:r,END_ANCHOR:i,DOTS_SLASH:o,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!${a}${o})`,NO_DOT_SLASH:`(?!\\.{0,1}${i})`,NO_DOTS_SLASH:`(?!${o})`,QMARK_NO_DOT:`[^.\\/]`,STAR:`${r}*?`,START_ANCHOR:a,SEP:`/`},c={...s,SLASH_LITERAL:`[\\\\/]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`\\.{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!\\.{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!\\.{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:`[^.\\\\/]`,START_ANCHOR:`(?:^|[\\\\/])`,END_ANCHOR:`(?:[\\\\/]|$)`,SEP:`\\`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?c:s}}})),sp=/* @__PURE__ */ L((e=>{let{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=op();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),cp=/* @__PURE__ */ L(((e,t)=>{let n=sp(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:_}=op(),v=e=>e===l||e===a,y=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let b=t||{},x=e.length-1,S=b.parts===!0||b.tokens===!0||b.scanToEnd===!0,C=[],w=[],T=[],E=e,D=-1,O=0,k=0,A=!1,ee=!1,te=!1,ne=!1,re=!1,ie=!1,j=!1,M=!1,ae=!1,oe=!1,se=0,N,P,F={value:``,depth:0,isGlob:!1},ce=()=>D>=x,le=()=>E.charCodeAt(D+1),ue=()=>(N=P,E.charCodeAt(++D));for(;D<x;){P=ue();let e;if(P===a)j=F.backslashes=!0,P=ue(),P===u&&(ie=!0);else{if(ie===!0||P===u){for(se++;ce()!==!0&&(P=ue());)if(P===a)j=F.backslashes=!0,ue();else if(P===u)se++;else{if(ie!==!0&&P===s&&(P=ue())===s||ie!==!0&&P===o){if(A=F.isBrace=!0,te=F.isGlob=!0,oe=!0,S===!0)continue;break}if(P===h&&(se--,se===0)){ie=!1,A=F.isBrace=!0,oe=!0;break}}if(S===!0)continue;break}if(P===l){if(C.push(D),w.push(F),F={value:``,depth:0,isGlob:!1},oe===!0)continue;if(N===s&&D===O+1){O+=2;continue}k=D+1}else{if(b.noext!==!0&&(P===p||P===i||P===r||P===m||P===c)&&le()===d){if(te=F.isGlob=!0,ne=F.isExtglob=!0,oe=!0,P===c&&D===O&&(ae=!0),S===!0){let e=0;for(;ce()!==!0&&(P=ue());)if(P===a)j=F.backslashes=!0,ue();else if(P===d)e++;else if(P===g&&--e===0){oe=!0;break}continue}break}if(P===r){if(N===r&&(re=F.isGlobstar=!0),te=F.isGlob=!0,oe=!0,S===!0)continue;break}if(P===m){if(te=F.isGlob=!0,oe=!0,S===!0)continue;break}if(P===f){for(;ce()!==!0&&(e=ue());)if(e===a)j=F.backslashes=!0,ue();else if(e===_){ee=F.isBracket=!0,te=F.isGlob=!0,oe=!0;break}if(S===!0)continue;break}if(b.nonegate!==!0&&P===c&&D===O)M=F.negated=!0,O++;else{if(b.noparen!==!0&&P===d){if(te=F.isGlob=!0,S===!0){let e=1;for(;ce()!==!0&&(P=ue());)if(P===a)j=F.backslashes=!0,ue();else if(P===d)e++;else if(P===g&&--e===0){oe=!0;break}continue}break}if(te===!0){if(oe=!0,S===!0)continue;break}}}}}b.noext===!0&&(ne=!1,te=!1);let I=E,de=``,fe=``;O>0&&(de=E.slice(0,O),E=E.slice(O),k-=O),I&&te===!0&&k>0?(I=E.slice(0,k),fe=E.slice(k)):te===!0?(I=``,fe=E):I=E,I&&I!==``&&I!==`/`&&I!==E&&v(I.charCodeAt(I.length-1))&&(I=I.slice(0,-1)),b.unescape===!0&&(fe&&=n.removeBackslashes(fe),I&&j===!0&&(I=n.removeBackslashes(I)));let pe={prefix:de,input:e,start:O,base:I,glob:fe,isBrace:A,isBracket:ee,isGlob:te,isExtglob:ne,isGlobstar:re,negated:M,negatedExtglob:ae};if(b.tokens===!0&&(pe.maxDepth=0,v(P)||w.push(F),pe.tokens=w),b.parts===!0||b.tokens===!0){let t;for(let n=0;n<C.length;n++){let r=t===void 0?O:t+1,i=C[n],a=e.slice(r,i);b.tokens&&(n===0&&O!==0?(w[n].isPrefix=!0,w[n].value=de):w[n].value=a,y(w[n]),pe.maxDepth+=w[n].depth),i>=O&&(T.push(a),t=i)}let n=t===void 0?O:t+1,r=e.slice(n);T.push(r),b.tokens&&t&&t+1<e.length&&(w[w.length-1].value=r,y(w[w.length-1]),pe.maxDepth+=w[w.length-1].depth),pe.slashes=C,pe.parts=T}return pe}})),lp=/* @__PURE__ */ L(((e,t)=>{let n=op(),r=sp(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e)if(o===!0)a+=s,o=!1;else if(s===`\\`)a+=s,o=!0;else if(s===`"`)i=i===1?0:1,a+=s;else{if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},f=e=>{let t=!1;for(let n of e)if(t===!0)t=!1;else if(n===`\\`)t=!0;else if(/[?*+@!()[\]{}]/.test(n))return!1;return!0},p=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(f(t))return t.replace(/\\(.)/g,`$1`)},m=e=>{let t=e.map(p).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(a&&r===a.repeat(r.length)&&i===a.repeat(i.length)&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},h=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0)a=!1;else if(s===`\\`)a=!0;else if(s===`"`)i=i===1?0:1;else if(i!==1){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(!(n>0)){if(s===`(`)r++;else if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},g=e=>`${e.length===1?r.escapeRegex(e[0]):`[${e.map(e=>r.escapeRegex(e)).join(``)}]`}*`,_=e=>{let t=0,n=[];for(;t<e.length;){let r=h(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=d(r.body).map(e=>e.trim());if(i.length!==1)return;let a=p(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return n},v=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},y=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=d(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||m(i)))return{risky:!0};let a=[],o=!1,s=!0;for(let e of i){let t=_(e);if(t){o=!0,a.push(...t);continue}let n=p(e);if(n&&n.length===1)a.push(n);else if(s=!1,v(e)>r)return{risky:!0}}return o?s?{risky:!0,safeOutput:g([...new Set(a)])}:{risky:!0}:{risky:!1}},b=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let d={...t},f=typeof d.maxLength==`number`?Math.min(i,d.maxLength):i,p=e.length;if(p>f)throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${f}`);let m={type:`bos`,value:``,output:d.prepend||``},h=[m],g=d.capture?``:`?:`,_=n.globChars(d.windows),v=n.extglobChars(_),{DOT_LITERAL:x,PLUS_LITERAL:S,SLASH_LITERAL:C,ONE_CHAR:w,DOTS_SLASH:T,NO_DOT:E,NO_DOT_SLASH:D,NO_DOTS_SLASH:O,QMARK:k,QMARK_NO_DOT:A,STAR:ee,START_ANCHOR:te}=_,ne=e=>`(${g}(?:(?!${te}${e.dot?T:x}).)*?)`,re=d.dot?``:E,ie=d.dot?k:A,j=d.bash===!0?ne(d):ee;d.capture&&(j=`(${j})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let M={input:e,index:-1,start:0,dot:d.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};e=r.removePrefix(e,M),p=e.length;let ae=[],oe=[],se=[],N=m,P,F=()=>M.index===p-1,ce=M.peek=(t=1)=>e[M.index+t],le=M.advance=()=>e[++M.index]||``,ue=()=>e.slice(M.index+1),I=(e=``,t=0)=>{M.consumed+=e,M.index+=t},de=e=>{M.output+=e.output==null?e.value:e.output,I(e.value)},fe=()=>{let e=1;for(;ce()===`!`&&(ce(2)!==`(`||ce(3)===`?`);)le(),M.start++,e++;return e%2!=0&&(M.negated=!0,M.start++,!0)},pe=e=>{M[e]++,se.push(e)},L=e=>{M[e]--,se.pop()},R=e=>{if(N.type===`globstar`){let t=M.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||ae.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(M.output=M.output.slice(0,-N.output.length),N.type=`star`,N.value=`*`,N.output=j,M.output+=N.output)}ae.length&&e.type!==`paren`&&(ae[ae.length-1].inner+=e.value),(e.value||e.output)&&de(e),N&&N.type===`text`&&e.type===`text`?(N.output=(N.output||N.value)+e.value,N.value+=e.value):(e.prev=N,h.push(e),N=e)},me=(e,t)=>{let n={...v[t],conditions:1,inner:``};n.prev=N,n.parens=M.parens,n.output=M.output,n.startIndex=M.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;pe(`parens`),R({type:e,value:t,output:M.output?``:w}),R({type:`paren`,extglob:!0,value:le(),output:r}),ae.push(n)},z=n=>{let i=e.slice(n.startIndex,M.index+1),a=e.slice(n.startIndex+2,M.index),o=y(a,d);if((n.type===`plus`||n.type===`star`)&&o.risky){let e=o.safeOutput?(n.output?``:w)+(d.capture?`(${o.safeOutput})`:o.safeOutput):void 0,t=h[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<h.length;e++)h[e].value=``,h[e].output=``,delete h[e].suffix;M.output=n.output+t.output,M.backtrack=!0,R({type:`paren`,extglob:!0,value:P,output:``}),L(`parens`);return}let s=n.close+(d.capture?`)`:``),c;if(n.type===`negate`){let e=j;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=ne(d)),(e!==j||F()||/^\)+$/.test(ue()))&&(s=n.close=`)$))${e}`),n.inner.includes(`*`)&&(c=ue())&&/^\.[^\\/.]+$/.test(c)&&(s=n.close=`)${b(c,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(M.negatedExtglob=!0)}R({type:`paren`,extglob:!0,value:P,output:s}),L(`parens`)};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?k.repeat(a.length):``):o===0?ie+(a?k.repeat(a.length):``):k.repeat(r.length):i===`.`?x.repeat(r.length):i===`*`?t?t+i+(a?j:``):j:t?e:`\\${e}`);return n===!0&&(i=d.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&d.contains===!0?(M.output=e,M):(M.output=r.wrapOutput(i,M,t),M)}for(;!F();){if(P=le(),P===`\0`)continue;if(P===`\\`){let e=ce();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){P+=`\\`,R({type:`text`,value:P});continue}let t=/^\\+/.exec(ue()),n=0;if(t&&t[0].length>2&&(n=t[0].length,M.index+=n,n%2!=0&&(P+=`\\`)),d.unescape===!0?P=le():P+=le(),M.brackets===0){R({type:`text`,value:P});continue}}if(M.brackets>0&&(P!==`]`||N.value===`[`||N.value===`[^`)){if(d.posix!==!1&&P===`:`){let e=N.value.slice(1);if(e.includes(`[`)&&(N.posix=!0,e.includes(`:`))){let e=N.value.lastIndexOf(`[`),t=N.value.slice(0,e),n=N.value.slice(e+2),r=a[n];if(r){N.value=t+r,M.backtrack=!0,le(),!m.output&&h.indexOf(N)===1&&(m.output=w);continue}}}(P===`[`&&ce()!==`:`||P===`-`&&ce()===`]`)&&(P=`\\${P}`),P===`]`&&(N.value===`[`||N.value===`[^`)&&(P=`\\${P}`),d.posix===!0&&P===`!`&&N.value===`[`&&(P=`^`),N.value+=P,de({value:P});continue}if(M.quotes===1&&P!==`"`){P=r.escapeRegex(P),N.value+=P,de({value:P});continue}if(P===`"`){M.quotes=M.quotes===1?0:1,d.keepQuotes===!0&&R({type:`text`,value:P});continue}if(P===`(`){pe(`parens`),R({type:`paren`,value:P});continue}if(P===`)`){if(M.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=ae[ae.length-1];if(e&&M.parens===e.parens+1){z(ae.pop());continue}R({type:`paren`,value:P,output:M.parens?`)`:`\\)`}),L(`parens`);continue}if(P===`[`){if(d.nobracket===!0||!ue().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));P=`\\${P}`}else pe(`brackets`);R({type:`bracket`,value:P});continue}if(P===`]`){if(d.nobracket===!0||N&&N.type===`bracket`&&N.value.length===1){R({type:`text`,value:P,output:`\\${P}`});continue}if(M.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));R({type:`text`,value:P,output:`\\${P}`});continue}L(`brackets`);let e=N.value.slice(1);if(N.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(P=`/${P}`),N.value+=P,de({value:P}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(N.value);if(M.output=M.output.slice(0,-N.value.length),d.literalBrackets===!0){M.output+=t,N.value=t;continue}N.value=`(${g}${t}|${N.value})`,M.output+=N.value;continue}if(P===`{`&&d.nobrace!==!0){pe(`braces`);let e={type:`brace`,value:P,output:`(`,outputIndex:M.output.length,tokensIndex:M.tokens.length};oe.push(e),R(e);continue}if(P===`}`){let e=oe[oe.length-1];if(d.nobrace===!0||!e){R({type:`text`,value:P,output:P});continue}let t=`)`;if(e.dots===!0){let e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,d),M.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=M.output.slice(0,e.outputIndex),r=M.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,P=t=`\\}`,M.output=n;for(let e of r)M.output+=e.output||e.value}R({type:`brace`,value:P,output:t}),L(`braces`),oe.pop();continue}if(P===`|`){ae.length>0&&ae[ae.length-1].conditions++,R({type:`text`,value:P});continue}if(P===`,`){let e=P,t=oe[oe.length-1];t&&se[se.length-1]===`braces`&&(t.comma=!0,e=`|`),R({type:`comma`,value:P,output:e});continue}if(P===`/`){if(N.type===`dot`&&M.index===M.start+1){M.start=M.index+1,M.consumed=``,M.output=``,h.pop(),N=m;continue}R({type:`slash`,value:P,output:C});continue}if(P===`.`){if(M.braces>0&&N.type===`dot`){N.value===`.`&&(N.output=x);let e=oe[oe.length-1];N.type=`dots`,N.output+=P,N.value+=P,e.dots=!0;continue}if(M.braces+M.parens===0&&N.type!==`bos`&&N.type!==`slash`){R({type:`text`,value:P,output:x});continue}R({type:`dot`,value:P,output:x});continue}if(P===`?`){if(!(N&&N.value===`(`)&&d.noextglob!==!0&&ce()===`(`&&ce(2)!==`?`){me(`qmark`,P);continue}if(N&&N.type===`paren`){let e=ce(),t=P;(N.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(ue()))&&(t=`\\${P}`),R({type:`text`,value:P,output:t});continue}if(d.dot!==!0&&(N.type===`slash`||N.type===`bos`)){R({type:`qmark`,value:P,output:A});continue}R({type:`qmark`,value:P,output:k});continue}if(P===`!`){if(d.noextglob!==!0&&ce()===`(`&&(ce(2)!==`?`||!/[!=<:]/.test(ce(3)))){me(`negate`,P);continue}if(d.nonegate!==!0&&M.index===0){fe();continue}}if(P===`+`){if(d.noextglob!==!0&&ce()===`(`&&ce(2)!==`?`){me(`plus`,P);continue}if(N&&N.value===`(`||d.regex===!1){R({type:`plus`,value:P,output:S});continue}if(N&&(N.type===`bracket`||N.type===`paren`||N.type===`brace`)||M.parens>0){R({type:`plus`,value:P});continue}R({type:`plus`,value:S});continue}if(P===`@`){if(d.noextglob!==!0&&ce()===`(`&&ce(2)!==`?`){R({type:`at`,extglob:!0,value:P,output:``});continue}R({type:`text`,value:P});continue}if(P!==`*`){(P===`$`||P===`^`)&&(P=`\\${P}`);let e=o.exec(ue());e&&(P+=e[0],M.index+=e[0].length),R({type:`text`,value:P});continue}if(N&&(N.type===`globstar`||N.star===!0)){N.type=`star`,N.star=!0,N.value+=P,N.output=j,M.backtrack=!0,M.globstar=!0,I(P);continue}let t=ue();if(d.noextglob!==!0&&/^\([^?]/.test(t)){me(`star`,P);continue}if(N.type===`star`){if(d.noglobstar===!0){I(P);continue}let n=N.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(d.bash===!0&&(!i||t[0]&&t[0]!==`/`)){R({type:`star`,value:P,output:``});continue}let o=M.braces>0&&(n.type===`comma`||n.type===`brace`),s=ae.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){R({type:`star`,value:P,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[M.index+4];if(n&&n!==`/`)break;t=t.slice(3),I(`/**`,3)}let c=F()||M.parens>0&&t===`)`.repeat(M.parens)&&!ae.some(e=>e.type===`negate`);if(n.type===`bos`&&F()){N.type=`globstar`,N.value+=P,N.output=ne(d),M.output=N.output,M.globstar=!0,I(P);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&c){M.output=M.output.slice(0,-(n.output+N.output).length),n.output=`(?:${n.output}`,N.type=`globstar`,N.output=ne(d)+(d.strictSlashes?`)`:`|$)`),N.value+=P,M.globstar=!0,M.output+=n.output+N.output,I(P);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;M.output=M.output.slice(0,-(n.output+N.output).length),n.output=`(?:${n.output}`,N.type=`globstar`,N.output=`${ne(d)}${C}|${C}${e})`,N.value+=P,M.output+=n.output+N.output,M.globstar=!0,I(P+le()),R({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){N.type=`globstar`,N.value+=P,N.output=`(?:^|${C}|${ne(d)}${C})`,M.output=N.output,M.globstar=!0,I(P+le()),R({type:`slash`,value:`/`,output:``});continue}M.output=M.output.slice(0,-N.output.length),N.type=`globstar`,N.output=ne(d),N.value+=P,M.output+=N.output,M.globstar=!0,I(P);continue}let n={type:`star`,value:P,output:j};d.bash===!0?(n.output=`.*?`,(N.type===`bos`||N.type===`slash`)&&(n.output=re+n.output),R(n)):N&&(N.type===`bracket`||N.type===`paren`)&&d.regex===!0?(n.output=P,R(n)):((M.index===M.start||N.type===`slash`||N.type===`dot`)&&(N.type===`dot`?(M.output+=D,N.output+=D):d.dot===!0?(M.output+=O,N.output+=O):(M.output+=re,N.output+=re),ce()!==`*`&&(M.output+=w,N.output+=w)),R(n))}for(;M.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));M.output=r.escapeLast(M.output,`[`),L(`brackets`)}for(;M.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));M.output=r.escapeLast(M.output,`(`),L(`parens`)}for(;M.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));M.output=r.escapeLast(M.output,`{`),L(`braces`)}if(d.strictSlashes!==!0&&(N.type===`star`||N.type===`bracket`)&&R({type:`maybe_slash`,value:``,output:`${C}?`}),M.backtrack===!0){M.output=``;for(let e of M.tokens)M.output+=e.output==null?e.value:e.output,e.suffix&&(M.output+=e.suffix)}return M};b.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:_}=n.globChars(a.windows),v=a.dot?m:p,y=a.dot?h:p,b=a.capture?``:`?:`,x={negated:!1,prefix:``},S=a.bash===!0?`.*?`:g;a.capture&&(S=`(${S})`);let C=e=>e.noglobstar===!0?S:`(${b}(?:(?!${_}${e.dot?f:l}).)*?)`,w=e=>{switch(e){case`*`:return`${v}${d}${S}`;case`.*`:return`${l}${d}${S}`;case`*.*`:return`${v}${S}${l}${d}${S}`;case`*/*`:return`${v}${S}${u}${d}${y}${S}`;case`**`:return v+C(a);case`**/*`:return`(?:${v}${C(a)}${u})?${y}${d}${S}`;case`**/*.*`:return`(?:${v}${C(a)}${u})?${y}${S}${l}${d}${S}`;case`**/.*`:return`(?:${v}${C(a)}${u})?${l}${d}${S}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=w(t[1]);return n?n+l+t[2]:void 0}}},T=w(r.removePrefix(e,x));return T&&a.strictSlashes!==!0&&(T+=`${u}?`),T},t.exports=b})),up=/* @__PURE__ */ L(((e,t)=>{let n=cp(),r=lp(),i=sp(),a=op(),o=e=>e&&typeof e==`object`&&!Array.isArray(e),s=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>s(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=o(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=c.state;delete c.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=s(i.ignore,e,n)}let d=(n,r=!1)=>{let{isMatch:o,match:d,output:f}=s.test(n,c,t,{glob:e,posix:a}),p={glob:e,state:l,regex:c,posix:a,input:n,output:f,match:d,isMatch:o};return typeof i.onResult==`function`&&i.onResult(p),o===!1?(p.isMatch=!1,r?p:!1):u(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),!r||p)};return n&&(d.state=l),d};s.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},c=o.format||(a?i.toPosixSlashes:null),l=e===r,u=l&&c?c(e):e;return l===!1&&(u=c?c(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?s.matchBase(e,t,n,a):t.exec(u)),{isMatch:!!l,match:l,output:u}},s.matchBase=(e,t,n,r=n&&n.windows)=>(t instanceof RegExp?t:s.makeRe(t,n)).test(i.basename(e,{windows:r})),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map(e=>s.parse(e,t)):r(e,{...t,fastpaths:!1}),s.scan=(e,t)=>n(e,t),s.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,c=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(c=`^(?!${c}).*$`);let l=s.toRegex(c,t);return r===!0&&(l.state=e),l},s.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),s.compileRe(a,t,n,i)},s.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},s.constants=a,t.exports=s})),dp=/* @__PURE__ */ pe((/* @__PURE__ */ L(((e,t)=>{let n=up(),r=sp();function i(e,t,i=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:r.isWindows()}),n(e,t,i)}Object.assign(i,n),t.exports=i})))(),1);const fp=Array.isArray,pp=/\\/g,mp=/^[A-Za-z]:$/,hp=process.platform===`win32`,gp=/^(\/?\.\.)+$/;function _p(e,t={}){let n=e.length,r=Array(n),i=Array(n),a,o;for(a=0;a<n;a++){let n=wp(e[a]);r[a]=n;let s=n.length,c=Array(s);for(o=0;o<s;o++)c[o]=(0,dp.default)(n[o],t);i[a]=c}return e=>{let s=e.split(`/`);if(s[0]===`..`&&gp.test(e))return!0;for(a=0;a<n;a++){let e=r[a],n=i[a],c=s.length,l=Math.min(c,e.length);for(o=0;o<l;){let r=e[o];if(r.includes(`/`))return!0;if(!n[o](s[o]))break;if(!t.noglobstar&&r===`**`)return!0;o++}if(o===c)return!0}return!1}}
171
171
  /* node:coverage ignore next 2 */
172
- const _p=/^[A-Z]:\/$/i,vp=mp?e=>_p.test(e):e=>e===`/`;function yp(e,t,n){if(e===t||t.startsWith(`${e}/`)){if(n){let t=e.length+ +!vp(e);return(e,n)=>e.slice(t,n?-1:void 0)||`.`}let r=t.slice(e.length+1);return r?(e,t)=>{if(e===`.`)return r;let n=`${r}/${e}`;return t?n.slice(0,-1):n}:(e,t)=>t&&e!==`.`?e.slice(0,-1):e}return n?t=>re.relative(e,t)||`.`:n=>re.relative(e,`${t}/${n}`)||`.`}function bp(e,t){if(t.startsWith(`${e}/`)){let n=t.slice(e.length+1);return e=>`${n}/${e}`}return n=>{let r=re.relative(e,`${t}/${n}`);return n[n.length-1]===`/`&&r!==``?`${r}/`:r||`.`}}function xp(e){return e.replace(pp,e=>`${e}/`)}const Sp={parts:!0};function Cp(e){let t=up.default.scan(e,Sp);return t.parts?.length?t.parts:[e]}const wp=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,Tp=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,Ep=mp?e=>e.replace(Tp,`\\$&`):e=>e.replace(wp,`\\$&`);function Dp(e,t){if(t?.caseSensitiveMatch===!1)return!0;let n=up.default.scan(e);return n.isGlob||n.negated}function Op(...e){console.log(`[tinyglobby ${(/* @__PURE__ */ new Date()).toLocaleTimeString(`es`)}]`,...e)}function kp(e){return typeof e==`string`?[e]:e??[]}const Ap=/^(\/?\.\.)+/,jp=/\\(?=[()[\]{}!*+?@|])/g;function Mp(e,t,n,r){let i=t.cwd,a=e;e[e.length-1]===`/`&&(a=e.slice(0,-1)),a[a.length-1]!==`*`&&t.expandDirectories&&(a+=`/**`);let o=Ep(i);a=te(a.replace(jp,``))?re.relative(o,a):re.normalize(a);let s=Ap.exec(a)?.[0],c=Cp(a);if(s){let e=(s.length+1)/3,t=0,r=o.split(`/`);for(;t<e&&c[t+e]===r[r.length+t-e];)a=a.slice(0,(e-t-1)*3)+a.slice((e-t)*3+c[t+e].length+1)||`.`,t++;let l=re.join(i,s.slice(t*3));l[0]!==`.`&&n.root.length>l.length&&(n.root=xp(l),n.depthOffset=-e+t)}if(!r&&n.depthOffset>=0){n.commonPath??=c;let e=[],t=Math.min(n.commonPath.length,c.length);for(let r=0;r<t;r++){let t=c[r];if(t===`**`&&!c[r+1]){e.pop();break}if(r===c.length-1||t!==n.commonPath[r]||Dp(t))break;e.push(t)}n.depthOffset=e.length,n.commonPath=e,n.root=xp(e.length>0?re.join(i,...e):i)}return a}function Np(e,t,n){let r=[],i=[];for(let t of e.ignore)t&&(t[0]!==`!`||t[1]===`(`)&&i.push(Mp(t,e,n,!0));for(let a of t)a&&(a[0]!==`!`||a[1]===`(`?r.push(Mp(a,e,n,!1)):(a[1]!==`!`||a[2]===`(`)&&i.push(Mp(a.slice(1),e,n,!0)));return{match:r,ignore:i}}function Pp(e,t){let n=e.cwd,r={root:n,depthOffset:0},i=Np(e,t,r);e.debug&&Op(`internal processing patterns:`,i);let{absolute:a,caseSensitiveMatch:o,debug:s,dot:c,followSymbolicLinks:l,onlyDirectories:u}=e,d=r.root.replace(fp,``),f={dot:c,nobrace:e.braceExpansion===!1,nocase:!o,noextglob:e.extglob===!1,noglobstar:e.globstar===!1,posix:!0},p=(0,up.default)(i.match,f),m=(0,up.default)(i.ignore,f),h=gp(i.match,f),g=yp(n,d,a),_=a?g:yp(n,d,!0),v=(e,t)=>{let n=_(t,!0);return n!==`.`&&!h(n)||m(n)},y;e.deep!==void 0&&(y=Math.round(e.deep-r.depthOffset));let b=new ip({filters:[s?(e,t)=>{let n=g(e,t),r=p(n)&&!m(n);return r&&Op(`matched ${n}`),r}:(e,t)=>{let n=g(e,t);return p(n)&&!m(n)}],exclude:s?(e,t)=>{let n=v(e,t);return Op(`${n?`skipped`:`crawling`} ${t}`),n}:v,fs:e.fs,pathSeparator:`/`,relativePaths:!a,resolvePaths:a,includeBasePath:a,resolveSymlinks:l,excludeSymlinks:!l,excludeFiles:u,includeDirs:u||!e.onlyFiles,maxDepth:y,signal:e.signal}).crawl(d);return e.debug&&Op(`internal properties:`,{...r,root:d}),[b,n!==d&&!a&&bp(n,d)]}function Fp(e,t){if(t)for(let n=e.length-1;n>=0;n--)e[n]=t(e[n]);return e}const Ip={caseSensitiveMatch:!0,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function Lp(e){let t=Object.assign({},e);for(let e in Ip)t[e]===void 0&&Object.assign(t,{[e]:Ip[e]});return t.cwd=(t.cwd instanceof URL?ae(t.cwd):j(t.cwd||process.cwd())).replace(fp,`/`),t.ignore=kp(t.ignore),t.fs&&={readdir:t.fs.readdir||w,readdirSync:t.fs.readdirSync||T,realpath:t.fs.realpath||E,realpathSync:t.fs.realpathSync||D,stat:t.fs.stat||O,statSync:t.fs.statSync||k},t.debug&&Op(`globbing with options:`,t),t}function Rp(e,t={}){if(e&&t?.patterns)throw Error(`Cannot pass patterns as both an argument and an option`);let n=dp(e)||typeof e==`string`,r=kp((n?e:e.patterns)??`**/*`),i=Lp(n?t:e);return r.length>0?Pp(i,r):[]}async function zp(e,t){let[n,r]=Rp(e,t);return n?Fp(await n.withPromise(),r):[]}var Bp=class extends Error{configPath;constructor(e,t,n){super(e,n),this.name=`SharedConfigError`,this.configPath=t}},Vp=class extends Bp{searchFrom;constructor(e){super(`未在 ${e} 找到配置文件`,e),this.name=`SharedConfigNotFoundError`,this.searchFrom=e}},Hp=class extends Bp{issues;constructor(e,t){super(`配置校验失败,共 ${e.length} 个问题`,t),this.name=`SharedConfigValidationError`,this.issues=e}};function Up(e,t,n,r){let i=e;if(r.schema!==void 0){let e=r.schema.safeParse(i);if(!e.success)throw new Hp(e.error.issues,t);i=e.data}return r.transform!==void 0&&(i=r.transform(i,n)),i}function Wp(e){return e instanceof Error&&e.message.length>0?`,底层原因为 ${e.name}: ${e.message}`:``}var Gp=class extends Bp{cause;constructor(e,t){super(`加载配置文件 ${e} 失败${Wp(t)}`,e,{cause:t}),this.name=`SharedConfigLoadError`,this.cause=t}};function Kp(e){return typeof e==`object`&&!!e}function qp(e){return typeof e==`object`&&!!e}async function Jp(e,t={}){let n=d(e);if(!p(n))throw new Vp(n);let r;try{let e=await import(n);r=Kp(e)?e.default:void 0}catch(e){throw new Gp(n,e)}if(r===void 0)throw new Gp(n,TypeError(`配置文件缺少默认导出`));if(!qp(r))throw new Gp(n,TypeError(`配置文件的默认导出必须是对象`));return{config:Up(r,n,s(n),t),configFilePath:n}}function Yp(e=process.cwd()){let t=d(e);for(;;){let e=l(t,`lzi.config.ts`);if(p(e))return e;let n=s(t);if(n===t)return null;t=n}}async function Xp(e={}){let t=e.cwd??process.cwd(),n=Yp(t);if(n===null)throw new Vp(t);let r=d(n,`..`),{config:i}=await Jp(n);return{config:i,configPath:r,configFilePath:n}}function Zp(e){return typeof e==`object`&&!!e}async function Qp(e){let t;try{t=await P(e)}catch(t){throw new Gp(e,t)}let n=t.filter(e=>e.endsWith(`.config.ts`)).sort();if(n.length===0)throw new Gp(e,Error(`配置目录内没有 .config.ts 分片文件`));let r={};for(let t of n){let n=await Jp(l(e,t));r={...r,...n.config}}let i=r;if(!Zp(i))throw new Gp(e,Error(`配置目录合并结果不是对象形态`));return i}function $p(e,t=process.cwd()){let n=Array.isArray(e)?e:[e],r=d(t);for(;;){for(let e of n){let t=l(r,e);if(em(t))return t}let e=s(r);if(e===r)return null;r=e}}function em(e){try{return v(e).isDirectory()}catch{return!1}}function tm(e,t=process.cwd()){let n=Array.isArray(e)?e:[e],r=d(t);for(;;){for(let e of n){let t=l(r,e);if(p(t))return t}let e=s(r);if(e===r)return null;r=e}}function nm(e){return typeof e==`object`&&!!e}function rm(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}async function im(e={}){let t=e.cwd??d(process.cwd());if(e.explicitPath!==void 0){let t=await Jp(e.explicitPath,{schema:e.schema,transform:e.transform});return{success:!0,config:t.config,source:`explicit`,configFilePath:t.configFilePath}}if(e.standaloneFile!==void 0){let n=tm(e.standaloneFile,t);if(n!==null){let{config:t}=await Jp(n);return{success:!0,config:Up(t,n,s(n),e),source:`standalone`,configFilePath:n}}}if(e.standaloneDir!==void 0){let n=$p(e.standaloneDir,t);if(n!==null)return{success:!0,config:Up(await Qp(n),n,n,e),source:`standalone`,configFilePath:n}}if(e.unifiedField!==void 0){let n,r;try{let{config:i,configFilePath:a}=await Xp({cwd:t}),o=i;n=rm(o)?o[e.unifiedField]:void 0,r=a}catch(e){if(!(e instanceof Vp))throw e}if(r!==void 0&&n!==void 0&&nm(n))return{success:!0,config:Up(n,r,s(r),e),source:`unified`,configFilePath:r}}return{success:!1,configFilePath:null}}const am=`lzi-dependencies.config.ts`,om=`lzi-dev.config.ts`,sm=()=>tm(am)??tm(om),cm=async e=>{let t=sm();if(!t)return null;let n=await im({standaloneFile:am,unifiedField:`dependencies`,cwd:e});if(n.success)return{config:n.config,configPath:t,source:`dependencies`};let r=await im({standaloneFile:om,unifiedField:`devTools`,cwd:e});return r.success&&(r.config.versionUpgrade!==void 0||r.config.hoisting!==void 0)&&r.success?{config:{upgrade:r.config.versionUpgrade,hoisting:r.config.hoisting},configPath:t,source:`legacy-dev-tools`}:{config:{},configPath:t,source:`dependencies`}};let lm=Promise,um=e=>{let t=0,n=0,r,i,a,o,s,c=()=>{t--,--n?l():o=a?.()},l=()=>{if(r&&t<e){t++;let e=r;r=r.a,e.p().then(t=>(e.c(t),c()),t=>(e.b(t),c()))}};return s={add(e){let t={p:e},a=new lm((e,n)=>{t.c=e,t.b=n});return i=r?i.a=t:r=t,n++,l(),a},done:()=>n?o||=new lm(e=>a=e):lm.resolve(),clear(){for(let e=r;e;e=e.a)e.b(/* @__PURE__ */ Error(`Queue cleared`));r=i=null,n=t},active:()=>t,size:()=>n,all:e=>lm.all(e.map(e=>s.add(typeof e==`function`?e:()=>e)))}};var dm=/* @__PURE__ */ L(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}})),fm=/* @__PURE__ */ L(((e,t)=>{t.exports=function(e){t.debug=t,t.default=t,t.coerce=s,t.disable=a,t.enable=r,t.enabled=o,t.humanize=dm(),t.destroy=c,Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]};function t(e){let r,i=null,a,o;function s(...e){if(!s.enabled)return;let n=s,i=Number(/* @__PURE__ */ new Date);n.diff=i-(r||i),n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),typeof e[0]!=`string`&&e.unshift(`%O`);let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,i)=>{if(r===`%%`)return`%`;a++;let o=t.formatters[i];if(typeof o==`function`){let t=e[a];r=o.call(n,t),e.splice(a,1),a--}return r}),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>i===null?(a!==t.namespaces&&(a=t.namespaces,o=t.enabled(e)),o):i,set:e=>{i=e}}),typeof t.init==`function`&&t.init(s),s}function n(e,n){let r=t(this.namespace+(n===void 0?`:`:n)+e);return r.log=this.log,r}function r(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];let n=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of n)e[0]===`-`?t.skips.push(e.slice(1)):t.names.push(e)}function i(e,t){let n=0,r=0,i=-1,a=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||t[r]===`*`))t[r]===`*`?(i=r,a=n,r++):(n++,r++);else if(i!==-1)r=i+1,a++,n=a;else return!1;for(;r<t.length&&t[r]===`*`;)r++;return r===t.length}function a(){let e=[...t.names,...t.skips.map(e=>`-`+e)].join(`,`);return t.enable(``),e}function o(e){for(let n of t.skips)if(i(e,n))return!1;for(let n of t.names)if(i(e,n))return!0;return!1}function s(e){return e instanceof Error?e.stack||e.message:e}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}})),pm=/* @__PURE__ */ L(((e,t)=>{e.formatArgs=r,e.save=i,e.load=a,e.useColors=n,e.storage=o(),e.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`."))}})(),e.colors=/* @__PURE__ */ `#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`.split(`.`);function n(){if(typeof window<`u`&&window.process&&(window.process.type===`renderer`||window.process.__nwjs))return!0;if(typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(e){if(e[0]=(this.useColors?`%c`:``)+this.namespace+(this.useColors?` %c`:` `)+e[0]+(this.useColors?`%c `:` `)+`+`+t.exports.humanize(this.diff),!this.useColors)return;let n=`color: `+this.color;e.splice(1,0,n,`color: inherit`);let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{e!==`%%`&&(r++,e===`%c`&&(i=r))}),e.splice(i,0,n)}e.log=console.debug||console.log||(()=>{});function i(t){try{t?e.storage.setItem(`debug`,t):e.storage.removeItem(`debug`)}catch{}}function a(){let t;try{t=e.storage.getItem(`debug`)||e.storage.getItem(`DEBUG`)}catch{}return!t&&typeof process<`u`&&`env`in process&&(t=process.env.DEBUG),t}function o(){try{return localStorage}catch{}}t.exports=fm()(e);let{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}})),mm=/* @__PURE__ */ L(((e,t)=>{let n=z(`tty`),r=z(`util`);e.init=u,e.log=s,e.formatArgs=a,e.save=c,e.load=l,e.useColors=i,e.destroy=r.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),e.colors=[6,2,3,4,5,1];try{let t=z(`supports-color`);t&&(t.stderr||t).level>=2&&(e.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.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),r=process.env[t];return r=/^(yes|on|true|enabled)$/i.test(r)?!0:/^(no|off|false|disabled)$/i.test(r)?!1:r===`null`?null:Number(r),e[n]=r,e},{});function i(){return`colors`in e.inspectOpts?!!e.inspectOpts.colors:n.isatty(process.stderr.fd)}function a(e){let{namespace:n,useColors:r}=this;if(r){let r=this.color,i=`\x1B[3`+(r<8?r:`8;5;`+r),a=` ${i};1m${n} \u001B[0m`;e[0]=a+e[0].split(`
172
+ const vp=/^[A-Z]:\/$/i,yp=hp?e=>vp.test(e):e=>e===`/`;function bp(e,t,n){if(e===t||t.startsWith(`${e}/`)){if(n){let t=e.length+ +!yp(e);return(e,n)=>e.slice(t,n?-1:void 0)||`.`}let r=t.slice(e.length+1);return r?(e,t)=>{if(e===`.`)return r;let n=`${r}/${e}`;return t?n.slice(0,-1):n}:(e,t)=>t&&e!==`.`?e.slice(0,-1):e}return n?t=>re.relative(e,t)||`.`:n=>re.relative(e,`${t}/${n}`)||`.`}function xp(e,t){if(t.startsWith(`${e}/`)){let n=t.slice(e.length+1);return e=>`${n}/${e}`}return n=>{let r=re.relative(e,`${t}/${n}`);return n[n.length-1]===`/`&&r!==``?`${r}/`:r||`.`}}function Sp(e){return e.replace(mp,e=>`${e}/`)}const Cp={parts:!0};function wp(e){let t=dp.default.scan(e,Cp);return t.parts?.length?t.parts:[e]}const Tp=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,Ep=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,Dp=hp?e=>e.replace(Ep,`\\$&`):e=>e.replace(Tp,`\\$&`);function Op(e,t){if(t?.caseSensitiveMatch===!1)return!0;let n=dp.default.scan(e);return n.isGlob||n.negated}function kp(...e){console.log(`[tinyglobby ${(/* @__PURE__ */ new Date()).toLocaleTimeString(`es`)}]`,...e)}function Ap(e){return typeof e==`string`?[e]:e??[]}const jp=/^(\/?\.\.)+/,Mp=/\\(?=[()[\]{}!*+?@|])/g;function Np(e,t,n,r){let i=t.cwd,a=e;e[e.length-1]===`/`&&(a=e.slice(0,-1)),a[a.length-1]!==`*`&&t.expandDirectories&&(a+=`/**`);let o=Dp(i);a=te(a.replace(Mp,``))?re.relative(o,a):re.normalize(a);let s=jp.exec(a)?.[0],c=wp(a);if(s){let e=(s.length+1)/3,t=0,r=o.split(`/`);for(;t<e&&c[t+e]===r[r.length+t-e];)a=a.slice(0,(e-t-1)*3)+a.slice((e-t)*3+c[t+e].length+1)||`.`,t++;let l=re.join(i,s.slice(t*3));l[0]!==`.`&&n.root.length>l.length&&(n.root=Sp(l),n.depthOffset=-e+t)}if(!r&&n.depthOffset>=0){n.commonPath??=c;let e=[],t=Math.min(n.commonPath.length,c.length);for(let r=0;r<t;r++){let t=c[r];if(t===`**`&&!c[r+1]){e.pop();break}if(r===c.length-1||t!==n.commonPath[r]||Op(t))break;e.push(t)}n.depthOffset=e.length,n.commonPath=e,n.root=Sp(e.length>0?re.join(i,...e):i)}return a}function Pp(e,t,n){let r=[],i=[];for(let t of e.ignore)t&&(t[0]!==`!`||t[1]===`(`)&&i.push(Np(t,e,n,!0));for(let a of t)a&&(a[0]!==`!`||a[1]===`(`?r.push(Np(a,e,n,!1)):(a[1]!==`!`||a[2]===`(`)&&i.push(Np(a.slice(1),e,n,!0)));return{match:r,ignore:i}}function Fp(e,t){let n=e.cwd,r={root:n,depthOffset:0},i=Pp(e,t,r);e.debug&&kp(`internal processing patterns:`,i);let{absolute:a,caseSensitiveMatch:o,debug:s,dot:c,followSymbolicLinks:l,onlyDirectories:u}=e,d=r.root.replace(pp,``),f={dot:c,nobrace:e.braceExpansion===!1,nocase:!o,noextglob:e.extglob===!1,noglobstar:e.globstar===!1,posix:!0},p=(0,dp.default)(i.match,f),m=(0,dp.default)(i.ignore,f),h=_p(i.match,f),g=bp(n,d,a),_=a?g:bp(n,d,!0),v=(e,t)=>{let n=_(t,!0);return n!==`.`&&!h(n)||m(n)},y;e.deep!==void 0&&(y=Math.round(e.deep-r.depthOffset));let b=new ap({filters:[s?(e,t)=>{let n=g(e,t),r=p(n)&&!m(n);return r&&kp(`matched ${n}`),r}:(e,t)=>{let n=g(e,t);return p(n)&&!m(n)}],exclude:s?(e,t)=>{let n=v(e,t);return kp(`${n?`skipped`:`crawling`} ${t}`),n}:v,fs:e.fs,pathSeparator:`/`,relativePaths:!a,resolvePaths:a,includeBasePath:a,resolveSymlinks:l,excludeSymlinks:!l,excludeFiles:u,includeDirs:u||!e.onlyFiles,maxDepth:y,signal:e.signal}).crawl(d);return e.debug&&kp(`internal properties:`,{...r,root:d}),[b,n!==d&&!a&&xp(n,d)]}function Ip(e,t){if(t)for(let n=e.length-1;n>=0;n--)e[n]=t(e[n]);return e}const Lp={caseSensitiveMatch:!0,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function Rp(e){let t=Object.assign({},e);for(let e in Lp)t[e]===void 0&&Object.assign(t,{[e]:Lp[e]});return t.cwd=(t.cwd instanceof URL?ae(t.cwd):j(t.cwd||process.cwd())).replace(pp,`/`),t.ignore=Ap(t.ignore),t.fs&&={readdir:t.fs.readdir||w,readdirSync:t.fs.readdirSync||T,realpath:t.fs.realpath||E,realpathSync:t.fs.realpathSync||D,stat:t.fs.stat||O,statSync:t.fs.statSync||k},t.debug&&kp(`globbing with options:`,t),t}function zp(e,t={}){if(e&&t?.patterns)throw Error(`Cannot pass patterns as both an argument and an option`);let n=fp(e)||typeof e==`string`,r=Ap((n?e:e.patterns)??`**/*`),i=Rp(n?t:e);return r.length>0?Fp(i,r):[]}async function Bp(e,t){let[n,r]=zp(e,t);return n?Ip(await n.withPromise(),r):[]}var Vp=class extends Error{configPath;constructor(e,t,n){super(e,n),this.name=`SharedConfigError`,this.configPath=t}},Hp=class extends Vp{searchFrom;constructor(e){super(`未在 ${e} 找到配置文件`,e),this.name=`SharedConfigNotFoundError`,this.searchFrom=e}},Up=class extends Vp{issues;constructor(e,t){super(`配置校验失败,共 ${e.length} 个问题`,t),this.name=`SharedConfigValidationError`,this.issues=e}};function Wp(e,t,n,r){let i=e;if(r.schema!==void 0){let e=r.schema.safeParse(i);if(!e.success)throw new Up(e.error.issues,t);i=e.data}return r.transform!==void 0&&(i=r.transform(i,n)),i}function Gp(e){return e instanceof Error&&e.message.length>0?`,底层原因为 ${e.name}: ${e.message}`:``}var Kp=class extends Vp{cause;constructor(e,t){super(`加载配置文件 ${e} 失败${Gp(t)}`,e,{cause:t}),this.name=`SharedConfigLoadError`,this.cause=t}};function qp(e){return typeof e==`object`&&!!e}function Jp(e){return typeof e==`object`&&!!e}async function Yp(e,t={}){let n=d(e);if(!p(n))throw new Hp(n);let r;try{let e=await import(n);r=qp(e)?e.default:void 0}catch(e){throw new Kp(n,e)}if(r===void 0)throw new Kp(n,TypeError(`配置文件缺少默认导出`));if(!Jp(r))throw new Kp(n,TypeError(`配置文件的默认导出必须是对象`));return{config:Wp(r,n,s(n),t),configFilePath:n}}function Xp(e=process.cwd()){let t=d(e);for(;;){let e=l(t,`lzi.config.ts`);if(p(e))return e;let n=s(t);if(n===t)return null;t=n}}async function Zp(e={}){let t=e.cwd??process.cwd(),n=Xp(t);if(n===null)throw new Hp(t);let r=d(n,`..`),{config:i}=await Yp(n);return{config:i,configPath:r,configFilePath:n}}function Qp(e){return typeof e==`object`&&!!e}async function $p(e){let t;try{t=await P(e)}catch(t){throw new Kp(e,t)}let n=t.filter(e=>e.endsWith(`.config.ts`)).sort();if(n.length===0)throw new Kp(e,Error(`配置目录内没有 .config.ts 分片文件`));let r={};for(let t of n){let n=await Yp(l(e,t));r={...r,...n.config}}let i=r;if(!Qp(i))throw new Kp(e,Error(`配置目录合并结果不是对象形态`));return i}function em(e,t=process.cwd()){let n=Array.isArray(e)?e:[e],r=d(t);for(;;){for(let e of n){let t=l(r,e);if(tm(t))return t}let e=s(r);if(e===r)return null;r=e}}function tm(e){try{return v(e).isDirectory()}catch{return!1}}function nm(e,t=process.cwd()){let n=Array.isArray(e)?e:[e],r=d(t);for(;;){for(let e of n){let t=l(r,e);if(p(t))return t}let e=s(r);if(e===r)return null;r=e}}function rm(e){return typeof e==`object`&&!!e}function im(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}async function am(e={}){let t=e.cwd??d(process.cwd());if(e.explicitPath!==void 0){let t=await Yp(e.explicitPath,{schema:e.schema,transform:e.transform});return{success:!0,config:t.config,source:`explicit`,configFilePath:t.configFilePath}}if(e.standaloneFile!==void 0){let n=nm(e.standaloneFile,t);if(n!==null){let{config:t}=await Yp(n);return{success:!0,config:Wp(t,n,s(n),e),source:`standalone`,configFilePath:n}}}if(e.standaloneDir!==void 0){let n=em(e.standaloneDir,t);if(n!==null)return{success:!0,config:Wp(await $p(n),n,n,e),source:`standalone`,configFilePath:n}}if(e.unifiedField!==void 0){let n,r;try{let{config:i,configFilePath:a}=await Zp({cwd:t}),o=i;n=im(o)?o[e.unifiedField]:void 0,r=a}catch(e){if(!(e instanceof Hp))throw e}if(r!==void 0&&n!==void 0&&rm(n))return{success:!0,config:Wp(n,r,s(r),e),source:`unified`,configFilePath:r}}return{success:!1,configFilePath:null}}const om=`lzi-dependencies.config.ts`,sm=`lzi-dev.config.ts`,cm=()=>nm(om)??nm(sm),lm=async e=>{let t=cm();if(!t)return null;let n=await am({standaloneFile:om,unifiedField:`dependencies`,cwd:e});if(n.success)return{config:n.config,configPath:t,source:`dependencies`};let r=await am({standaloneFile:sm,unifiedField:`devTools`,cwd:e});return r.success&&(r.config.versionUpgrade!==void 0||r.config.hoisting!==void 0)&&r.success?{config:{upgrade:r.config.versionUpgrade,hoisting:r.config.hoisting},configPath:t,source:`legacy-dev-tools`}:{config:{},configPath:t,source:`dependencies`}};let um=Promise,dm=e=>{let t=0,n=0,r,i,a,o,s,c=()=>{t--,--n?l():o=a?.()},l=()=>{if(r&&t<e){t++;let e=r;r=r.a,e.p().then(t=>(e.c(t),c()),t=>(e.b(t),c()))}};return s={add(e){let t={p:e},a=new um((e,n)=>{t.c=e,t.b=n});return i=r?i.a=t:r=t,n++,l(),a},done:()=>n?o||=new um(e=>a=e):um.resolve(),clear(){for(let e=r;e;e=e.a)e.b(/* @__PURE__ */ Error(`Queue cleared`));r=i=null,n=t},active:()=>t,size:()=>n,all:e=>um.all(e.map(e=>s.add(typeof e==`function`?e:()=>e)))}};var fm=/* @__PURE__ */ L(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}})),pm=/* @__PURE__ */ L(((e,t)=>{t.exports=function(e){t.debug=t,t.default=t,t.coerce=s,t.disable=a,t.enable=r,t.enabled=o,t.humanize=fm(),t.destroy=c,Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]};function t(e){let r,i=null,a,o;function s(...e){if(!s.enabled)return;let n=s,i=Number(/* @__PURE__ */ new Date);n.diff=i-(r||i),n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),typeof e[0]!=`string`&&e.unshift(`%O`);let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,i)=>{if(r===`%%`)return`%`;a++;let o=t.formatters[i];if(typeof o==`function`){let t=e[a];r=o.call(n,t),e.splice(a,1),a--}return r}),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>i===null?(a!==t.namespaces&&(a=t.namespaces,o=t.enabled(e)),o):i,set:e=>{i=e}}),typeof t.init==`function`&&t.init(s),s}function n(e,n){let r=t(this.namespace+(n===void 0?`:`:n)+e);return r.log=this.log,r}function r(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];let n=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of n)e[0]===`-`?t.skips.push(e.slice(1)):t.names.push(e)}function i(e,t){let n=0,r=0,i=-1,a=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||t[r]===`*`))t[r]===`*`?(i=r,a=n,r++):(n++,r++);else if(i!==-1)r=i+1,a++,n=a;else return!1;for(;r<t.length&&t[r]===`*`;)r++;return r===t.length}function a(){let e=[...t.names,...t.skips.map(e=>`-`+e)].join(`,`);return t.enable(``),e}function o(e){for(let n of t.skips)if(i(e,n))return!1;for(let n of t.names)if(i(e,n))return!0;return!1}function s(e){return e instanceof Error?e.stack||e.message:e}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}})),mm=/* @__PURE__ */ L(((e,t)=>{e.formatArgs=r,e.save=i,e.load=a,e.useColors=n,e.storage=o(),e.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`."))}})(),e.colors=/* @__PURE__ */ `#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`.split(`.`);function n(){if(typeof window<`u`&&window.process&&(window.process.type===`renderer`||window.process.__nwjs))return!0;if(typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(e){if(e[0]=(this.useColors?`%c`:``)+this.namespace+(this.useColors?` %c`:` `)+e[0]+(this.useColors?`%c `:` `)+`+`+t.exports.humanize(this.diff),!this.useColors)return;let n=`color: `+this.color;e.splice(1,0,n,`color: inherit`);let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{e!==`%%`&&(r++,e===`%c`&&(i=r))}),e.splice(i,0,n)}e.log=console.debug||console.log||(()=>{});function i(t){try{t?e.storage.setItem(`debug`,t):e.storage.removeItem(`debug`)}catch{}}function a(){let t;try{t=e.storage.getItem(`debug`)||e.storage.getItem(`DEBUG`)}catch{}return!t&&typeof process<`u`&&`env`in process&&(t=process.env.DEBUG),t}function o(){try{return localStorage}catch{}}t.exports=pm()(e);let{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}})),hm=/* @__PURE__ */ L(((e,t)=>{let n=z(`tty`),r=z(`util`);e.init=u,e.log=s,e.formatArgs=a,e.save=c,e.load=l,e.useColors=i,e.destroy=r.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),e.colors=[6,2,3,4,5,1];try{let t=z(`supports-color`);t&&(t.stderr||t).level>=2&&(e.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.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),r=process.env[t];return r=/^(yes|on|true|enabled)$/i.test(r)?!0:/^(no|off|false|disabled)$/i.test(r)?!1:r===`null`?null:Number(r),e[n]=r,e},{});function i(){return`colors`in e.inspectOpts?!!e.inspectOpts.colors:n.isatty(process.stderr.fd)}function a(e){let{namespace:n,useColors:r}=this;if(r){let r=this.color,i=`\x1B[3`+(r<8?r:`8;5;`+r),a=` ${i};1m${n} \u001B[0m`;e[0]=a+e[0].split(`
173
173
  `).join(`
174
174
  `+a),e.push(i+`m+`+t.exports.humanize(this.diff)+`\x1B[0m`)}else e[0]=o()+n+` `+e[0]}function o(){return e.inspectOpts.hideDate?``:(/* @__PURE__ */ new Date()).toISOString()+` `}function s(...t){return process.stderr.write(r.formatWithOptions(e.inspectOpts,...t)+`
175
- `)}function c(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function l(){return process.env.DEBUG}function u(t){t.inspectOpts={};let n=Object.keys(e.inspectOpts);for(let r=0;r<n.length;r++)t.inspectOpts[n[r]]=e.inspectOpts[n[r]]}t.exports=fm()(e);let{formatters:d}=t.exports;d.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split(`
176
- `).map(e=>e.trim()).join(` `)},d.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}})),hm=/* @__PURE__ */ L(((e,t)=>{t.exports=typeof process>`u`||process.type===`renderer`||process.browser===!0||process.__nwjs?pm():mm()}));const gm=/^[A-Za-z]:\//;function _m(e=``){return e&&e.replace(/\\/g,`/`).replace(gm,e=>e.toUpperCase())}const vm=/^[/\\]{2}/,ym=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,bm=/^[A-Za-z]:$/,xm=function(e){if(e.length===0)return`.`;e=_m(e);let t=e.match(vm),n=Em(e),r=e[e.length-1]===`/`;return e=Tm(e,!n),e.length===0?n?`/`:r?`./`:`.`:(r&&(e+=`/`),bm.test(e)&&(e+=`/`),t?n?`//${e}`:`//./${e}`:n&&!Em(e)?`/${e}`:e)},Sm=function(...e){let t=``;for(let n of e)if(n){if(t.length>0){let e=t[t.length-1]===`/`,r=n[0]===`/`;t+=e&&r?n.slice(1):e||r?n:`/${n}`}else t+=n}return xm(t)};function Cm(){return typeof process<`u`&&typeof process.cwd==`function`?process.cwd().replace(/\\/g,`/`):`/`}const wm=function(...e){e=e.map(e=>_m(e));let t=``,n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:Cm();i&&i.length!==0&&(t=`${i}/${t}`,n=Em(i))}return t=Tm(t,!n),n&&!Em(t)?`/${t}`:t.length>0?t:`.`};function Tm(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else if(o===`/`)break;else o=`/`;if(o===`/`){if(i!==s-1&&a!==1){if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1}i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}const Em=function(e){return ym.test(e)},Dm=function(e){let t=_m(e).replace(/\/$/,``).split(`/`).slice(0,-1);return t.length===1&&bm.test(t[0])&&(t[0]+=`/`),t.join(`/`)||(Em(e)?`/`:`.`)};var Om=/* @__PURE__ */ pe(hm(),1);const km=Object.prototype.toString,Am=e=>km.call(e)===`[object Error]`,jm=/* @__PURE__ */ new Set([`network error`,`Failed to fetch`,`NetworkError when attempting to fetch resource.`,`The Internet connection appears to be offline.`,`Network request failed`,`fetch failed`,`terminated`,` A network error occurred.`,`Network connection lost`]);function Mm(e){if(!(e&&Am(e)&&e.name===`TypeError`&&typeof e.message==`string`))return!1;let{message:t,stack:n}=e;return t===`Load failed`?n===void 0||`__sentry_captured__`in e:t.startsWith(`error sending request for url`)?!0:jm.has(t)}function Nm(e){if(typeof e==`number`){if(e<0)throw TypeError("Expected `retries` to be a non-negative number.");if(Number.isNaN(e))throw TypeError("Expected `retries` to be a valid number or Infinity, got NaN.")}else if(e!==void 0)throw TypeError("Expected `retries` to be a number or Infinity.")}function Pm(e,t,{min:n=0,allowInfinity:r=!1}={}){if(t!==void 0){if(typeof t!=`number`||Number.isNaN(t))throw TypeError(`Expected \`${e}\` to be a number${r?` or Infinity`:``}.`);if(!r&&!Number.isFinite(t))throw TypeError(`Expected \`${e}\` to be a finite number.`);if(t<n)throw TypeError(`Expected \`${e}\` to be \u2265 ${n}.`)}}function Fm(e,t){if(t!==void 0&&typeof t!=`function`)throw TypeError(`Expected \`${e}\` to be a function.`)}var Im=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=Error(e),this.originalError.stack=this.stack),this.name=`AbortError`,this.message=e}};function Lm(e,t){let n=Math.max(1,e+1),r=t.randomize?Math.random()+1:1,i=Math.round(r*t.minTimeout*t.factor**(n-1));return i=Math.min(i,t.maxTimeout),i}function Rm(e,t){return Number.isFinite(t)?t-(performance.now()-e):t}async function zm(e,t){e<=0||await new Promise((n,r)=>{let i=()=>{clearTimeout(a),t.signal?.removeEventListener(`abort`,i),r(t.signal.reason)},a=setTimeout(()=>{t.signal?.removeEventListener(`abort`,i),n()},e);t.unref&&a.unref?.(),t.signal?.addEventListener(`abort`,i,{once:!0})})}async function Bm({error:e,attemptNumber:t,retriesConsumed:n,startTime:r,options:i}){let a=e instanceof Error?e:/* @__PURE__ */ TypeError(`Non-error was thrown: "${e}". You should only throw errors.`);if(a instanceof Im)throw a.originalError;let o=Number.isFinite(i.retries)?Math.max(0,i.retries-n):i.retries,s=i.maxRetryTime??1/0,c=Lm(n,i);if(Rm(r,s)<=0){let e=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:0});throw await i.onFailedAttempt(e),a}let l=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:o>0?c:0}),u=await i.shouldConsumeRetry(l),d=u&&o>0?c:0,f=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:d});if(await i.onFailedAttempt(f),Rm(r,s)<=0||Rm(r,s)<=0||o<=0||a instanceof TypeError&&!Mm(a)||!await i.shouldRetry(f))throw a;let p=Rm(r,s);if(p<=0)throw a;if(!u)return i.signal?.throwIfAborted(),!1;let m=Math.min(d,p);return i.signal?.throwIfAborted(),await zm(m,i),i.signal?.throwIfAborted(),!0}async function Vm(e,t={}){if(t={...t},Nm(t.retries),Object.hasOwn(t,`forever`))throw Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");t.retries??=10,t.factor??=2,t.minTimeout??=1e3,t.maxTimeout??=1/0,t.maxRetryTime??=1/0,t.randomize??=!1,t.onFailedAttempt??=()=>{},t.shouldRetry??=()=>!0,t.shouldConsumeRetry??=()=>!0,Fm(`onFailedAttempt`,t.onFailedAttempt),Fm(`shouldRetry`,t.shouldRetry),Fm(`shouldConsumeRetry`,t.shouldConsumeRetry),Pm(`factor`,t.factor,{min:0,allowInfinity:!1}),Pm(`minTimeout`,t.minTimeout,{min:0,allowInfinity:!1}),Pm(`maxTimeout`,t.maxTimeout,{min:0,allowInfinity:!0}),Pm(`maxRetryTime`,t.maxRetryTime,{min:0,allowInfinity:!0}),t.factor>0||(t.factor=1),t.signal?.throwIfAborted();let n=0,r=0,i=performance.now();for(;!Number.isFinite(t.retries)||r<=t.retries;){n++;try{t.signal?.throwIfAborted();let r=await e(n);return t.signal?.throwIfAborted(),r}catch(e){await Bm({error:e,attemptNumber:n,retriesConsumed:r,startTime:i,options:t})&&r++}}throw Error(`Retry attempts exhausted without throwing an error.`)}const Hm={retries:5,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1},Um={apiEndpoint:`https://npm.antfu.dev/`};async function Wm(e,t={}){let{apiEndpoint:n=Um.apiEndpoint,fetch:r=fetch,throw:i=!0,retry:a=Hm}=t,o=[t.force?`force=true`:``,t.loose?`loose=true`:``,t.metadata?`metadata=true`:``,t.after?`after=${encodeURIComponent(t.after)}`:``,i?``:`throw=false`].filter(Boolean).join(`&`);o&&=`?${o}`;let s=()=>r(new URL(`/versions/${e.join(`+`)}${o}`,n)).then(e=>e.json()),c=qm(await(a===!1?s():Vm(s,typeof a==`number`?{...Hm,retries:a}:a)));return i?Km(c):c}async function Gm(e,t={}){let[n]=await Wm([e],t);return n}function Km(e){for(let t of qm(e))if(t&&`error`in t)throw Error(t.message||t.error);return e}function qm(e){return Array.isArray(e)?e:[e]}const Jm=`https://registry.npmjs.org/`;function Ym(e,t,n=Jm){let r=e?t[`${e.replace(/^@?/,`@`)}:registry`]:void 0;return!r&&typeof t.scope==`string`&&(r=t[`${t.scope.replace(/^@?/,`@`)}:registry`]),r||=t.registry||n,r}var Xm=Object.create,Zm=Object.defineProperty,Qm=Object.getOwnPropertyDescriptor,$m=Object.getOwnPropertyNames,eh=Object.getPrototypeOf,th=Object.prototype.hasOwnProperty,nh=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),rh=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=$m(t),a=0,o=i.length,s;a<o;a++)s=i[a],!th.call(e,s)&&s!==n&&Zm(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Qm(t,s))||r.enumerable});return e},ih=(e,t,n)=>(n=e==null?{}:Xm(eh(e)),rh(t||!e||!e.__esModule?Zm(n,`default`,{value:e,enumerable:!0}):n,e));const ah={retries:5,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};function oh(e){if(e.provenance!==void 0)return e.provenance;if(e.dist?.provenance!==void 0)return e.dist.provenance;if(e.dist?.attestations?.provenance)return!0}const sh=/(?!^)_/gu,ch=/\r?\n/u,lh=/\$\{([^}]+)\}/g;function uh(e){return dh(e,`npm_config_userconfig`)||l(e.HOME||le(),`.npmrc`)}function dh(e,t){let n=t.toLowerCase();for(let[t,r]of Object.entries(e))if(t.toLowerCase()===n&&r!==void 0&&r!==``)return r}function fh(e,t=y.env){if(!p(e))return{};let n={},r=g(e,`utf8`).split(ch);for(let e of r){let r=e.trim();if(!r||r.startsWith(`#`)||r.startsWith(`;`))continue;let i=r.indexOf(`=`);i!==-1&&mh(n,r.slice(0,i).trim(),gh(r.slice(i+1).trim()).replace(lh,(e,n)=>t[n]??``))}return n}function ph(e){let t={};for(let[n,r]of Object.entries(e)){if(!n.toLowerCase().startsWith(`npm_config_`)||r===void 0||r===``)continue;let e=n.slice(11);e.startsWith(`//`)||(e=e.replace(sh,`-`).toLowerCase()),mh(t,e,r)}return t}function mh(e,t,n){if(t.endsWith(`[]`)){let r=t.slice(0,-2),i=e[r];Array.isArray(i)?i.push(n):e[r]=typeof i==`string`?[i,n]:[n]}else e[t]=n}function hh(e,t){for(let[n,r]of Object.entries(t))e[n]=r}function gh(e){if(e.length<2)return e;let t=e[0],n=e.at(-1);return t===`"`&&n===`"`||t===`'`&&n===`'`?e.slice(1,-1):e}function _h(e,t){let n=vh(e);return n===void 0?t:n===``||n.toLowerCase()!==`false`}function vh(e){if(typeof e==`string`)return e}function yh(e){return Array.isArray(e)?e:typeof e==`string`&&e.length>0?e.split(`
175
+ `)}function c(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function l(){return process.env.DEBUG}function u(t){t.inspectOpts={};let n=Object.keys(e.inspectOpts);for(let r=0;r<n.length;r++)t.inspectOpts[n[r]]=e.inspectOpts[n[r]]}t.exports=pm()(e);let{formatters:d}=t.exports;d.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split(`
176
+ `).map(e=>e.trim()).join(` `)},d.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}})),gm=/* @__PURE__ */ L(((e,t)=>{t.exports=typeof process>`u`||process.type===`renderer`||process.browser===!0||process.__nwjs?mm():hm()}));const _m=/^[A-Za-z]:\//;function vm(e=``){return e&&e.replace(/\\/g,`/`).replace(_m,e=>e.toUpperCase())}const ym=/^[/\\]{2}/,bm=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,xm=/^[A-Za-z]:$/,Sm=function(e){if(e.length===0)return`.`;e=vm(e);let t=e.match(ym),n=Dm(e),r=e[e.length-1]===`/`;return e=Em(e,!n),e.length===0?n?`/`:r?`./`:`.`:(r&&(e+=`/`),xm.test(e)&&(e+=`/`),t?n?`//${e}`:`//./${e}`:n&&!Dm(e)?`/${e}`:e)},Cm=function(...e){let t=``;for(let n of e)if(n){if(t.length>0){let e=t[t.length-1]===`/`,r=n[0]===`/`;t+=e&&r?n.slice(1):e||r?n:`/${n}`}else t+=n}return Sm(t)};function wm(){return typeof process<`u`&&typeof process.cwd==`function`?process.cwd().replace(/\\/g,`/`):`/`}const Tm=function(...e){e=e.map(e=>vm(e));let t=``,n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:wm();i&&i.length!==0&&(t=`${i}/${t}`,n=Dm(i))}return t=Em(t,!n),n&&!Dm(t)?`/${t}`:t.length>0?t:`.`};function Em(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else if(o===`/`)break;else o=`/`;if(o===`/`){if(i!==s-1&&a!==1){if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1}i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}const Dm=function(e){return bm.test(e)},Om=function(e){let t=vm(e).replace(/\/$/,``).split(`/`).slice(0,-1);return t.length===1&&xm.test(t[0])&&(t[0]+=`/`),t.join(`/`)||(Dm(e)?`/`:`.`)};var km=/* @__PURE__ */ pe(gm(),1);const Am=Object.prototype.toString,jm=e=>Am.call(e)===`[object Error]`,Mm=/* @__PURE__ */ new Set([`network error`,`Failed to fetch`,`NetworkError when attempting to fetch resource.`,`The Internet connection appears to be offline.`,`Network request failed`,`fetch failed`,`terminated`,` A network error occurred.`,`Network connection lost`]);function Nm(e){if(!(e&&jm(e)&&e.name===`TypeError`&&typeof e.message==`string`))return!1;let{message:t,stack:n}=e;return t===`Load failed`?n===void 0||`__sentry_captured__`in e:t.startsWith(`error sending request for url`)?!0:Mm.has(t)}function Pm(e){if(typeof e==`number`){if(e<0)throw TypeError("Expected `retries` to be a non-negative number.");if(Number.isNaN(e))throw TypeError("Expected `retries` to be a valid number or Infinity, got NaN.")}else if(e!==void 0)throw TypeError("Expected `retries` to be a number or Infinity.")}function Fm(e,t,{min:n=0,allowInfinity:r=!1}={}){if(t!==void 0){if(typeof t!=`number`||Number.isNaN(t))throw TypeError(`Expected \`${e}\` to be a number${r?` or Infinity`:``}.`);if(!r&&!Number.isFinite(t))throw TypeError(`Expected \`${e}\` to be a finite number.`);if(t<n)throw TypeError(`Expected \`${e}\` to be \u2265 ${n}.`)}}function Im(e,t){if(t!==void 0&&typeof t!=`function`)throw TypeError(`Expected \`${e}\` to be a function.`)}var Lm=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=Error(e),this.originalError.stack=this.stack),this.name=`AbortError`,this.message=e}};function Rm(e,t){let n=Math.max(1,e+1),r=t.randomize?Math.random()+1:1,i=Math.round(r*t.minTimeout*t.factor**(n-1));return i=Math.min(i,t.maxTimeout),i}function zm(e,t){return Number.isFinite(t)?t-(performance.now()-e):t}async function Bm(e,t){e<=0||await new Promise((n,r)=>{let i=()=>{clearTimeout(a),t.signal?.removeEventListener(`abort`,i),r(t.signal.reason)},a=setTimeout(()=>{t.signal?.removeEventListener(`abort`,i),n()},e);t.unref&&a.unref?.(),t.signal?.addEventListener(`abort`,i,{once:!0})})}async function Vm({error:e,attemptNumber:t,retriesConsumed:n,startTime:r,options:i}){let a=e instanceof Error?e:/* @__PURE__ */ TypeError(`Non-error was thrown: "${e}". You should only throw errors.`);if(a instanceof Lm)throw a.originalError;let o=Number.isFinite(i.retries)?Math.max(0,i.retries-n):i.retries,s=i.maxRetryTime??1/0,c=Rm(n,i);if(zm(r,s)<=0){let e=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:0});throw await i.onFailedAttempt(e),a}let l=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:o>0?c:0}),u=await i.shouldConsumeRetry(l),d=u&&o>0?c:0,f=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:d});if(await i.onFailedAttempt(f),zm(r,s)<=0||zm(r,s)<=0||o<=0||a instanceof TypeError&&!Nm(a)||!await i.shouldRetry(f))throw a;let p=zm(r,s);if(p<=0)throw a;if(!u)return i.signal?.throwIfAborted(),!1;let m=Math.min(d,p);return i.signal?.throwIfAborted(),await Bm(m,i),i.signal?.throwIfAborted(),!0}async function Hm(e,t={}){if(t={...t},Pm(t.retries),Object.hasOwn(t,`forever`))throw Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");t.retries??=10,t.factor??=2,t.minTimeout??=1e3,t.maxTimeout??=1/0,t.maxRetryTime??=1/0,t.randomize??=!1,t.onFailedAttempt??=()=>{},t.shouldRetry??=()=>!0,t.shouldConsumeRetry??=()=>!0,Im(`onFailedAttempt`,t.onFailedAttempt),Im(`shouldRetry`,t.shouldRetry),Im(`shouldConsumeRetry`,t.shouldConsumeRetry),Fm(`factor`,t.factor,{min:0,allowInfinity:!1}),Fm(`minTimeout`,t.minTimeout,{min:0,allowInfinity:!1}),Fm(`maxTimeout`,t.maxTimeout,{min:0,allowInfinity:!0}),Fm(`maxRetryTime`,t.maxRetryTime,{min:0,allowInfinity:!0}),t.factor>0||(t.factor=1),t.signal?.throwIfAborted();let n=0,r=0,i=performance.now();for(;!Number.isFinite(t.retries)||r<=t.retries;){n++;try{t.signal?.throwIfAborted();let r=await e(n);return t.signal?.throwIfAborted(),r}catch(e){await Vm({error:e,attemptNumber:n,retriesConsumed:r,startTime:i,options:t})&&r++}}throw Error(`Retry attempts exhausted without throwing an error.`)}const Um={retries:5,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1},Wm={apiEndpoint:`https://npm.antfu.dev/`};async function Gm(e,t={}){let{apiEndpoint:n=Wm.apiEndpoint,fetch:r=fetch,throw:i=!0,retry:a=Um}=t,o=[t.force?`force=true`:``,t.loose?`loose=true`:``,t.metadata?`metadata=true`:``,t.after?`after=${encodeURIComponent(t.after)}`:``,i?``:`throw=false`].filter(Boolean).join(`&`);o&&=`?${o}`;let s=()=>r(new URL(`/versions/${e.join(`+`)}${o}`,n)).then(e=>e.json()),c=Jm(await(a===!1?s():Hm(s,typeof a==`number`?{...Um,retries:a}:a)));return i?qm(c):c}async function Km(e,t={}){let[n]=await Gm([e],t);return n}function qm(e){for(let t of Jm(e))if(t&&`error`in t)throw Error(t.message||t.error);return e}function Jm(e){return Array.isArray(e)?e:[e]}const Ym=`https://registry.npmjs.org/`;function Xm(e,t,n=Ym){let r=e?t[`${e.replace(/^@?/,`@`)}:registry`]:void 0;return!r&&typeof t.scope==`string`&&(r=t[`${t.scope.replace(/^@?/,`@`)}:registry`]),r||=t.registry||n,r}var Zm=Object.create,Qm=Object.defineProperty,$m=Object.getOwnPropertyDescriptor,eh=Object.getOwnPropertyNames,th=Object.getPrototypeOf,nh=Object.prototype.hasOwnProperty,rh=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ih=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=eh(t),a=0,o=i.length,s;a<o;a++)s=i[a],!nh.call(e,s)&&s!==n&&Qm(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=$m(t,s))||r.enumerable});return e},ah=(e,t,n)=>(n=e==null?{}:Zm(th(e)),ih(t||!e||!e.__esModule?Qm(n,`default`,{value:e,enumerable:!0}):n,e));const oh={retries:5,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};function sh(e){if(e.provenance!==void 0)return e.provenance;if(e.dist?.provenance!==void 0)return e.dist.provenance;if(e.dist?.attestations?.provenance)return!0}const ch=/(?!^)_/gu,lh=/\r?\n/u,uh=/\$\{([^}]+)\}/g;function dh(e){return fh(e,`npm_config_userconfig`)||l(e.HOME||le(),`.npmrc`)}function fh(e,t){let n=t.toLowerCase();for(let[t,r]of Object.entries(e))if(t.toLowerCase()===n&&r!==void 0&&r!==``)return r}function ph(e,t=y.env){if(!p(e))return{};let n={},r=g(e,`utf8`).split(lh);for(let e of r){let r=e.trim();if(!r||r.startsWith(`#`)||r.startsWith(`;`))continue;let i=r.indexOf(`=`);i!==-1&&hh(n,r.slice(0,i).trim(),_h(r.slice(i+1).trim()).replace(uh,(e,n)=>t[n]??``))}return n}function mh(e){let t={};for(let[n,r]of Object.entries(e)){if(!n.toLowerCase().startsWith(`npm_config_`)||r===void 0||r===``)continue;let e=n.slice(11);e.startsWith(`//`)||(e=e.replace(ch,`-`).toLowerCase()),hh(t,e,r)}return t}function hh(e,t,n){if(t.endsWith(`[]`)){let r=t.slice(0,-2),i=e[r];Array.isArray(i)?i.push(n):e[r]=typeof i==`string`?[i,n]:[n]}else e[t]=n}function gh(e,t){for(let[n,r]of Object.entries(t))e[n]=r}function _h(e){if(e.length<2)return e;let t=e[0],n=e.at(-1);return t===`"`&&n===`"`||t===`'`&&n===`'`?e.slice(1,-1):e}function vh(e,t){let n=yh(e);return n===void 0?t:n===``||n.toLowerCase()!==`false`}function yh(e){if(typeof e==`string`)return e}function bh(e){return Array.isArray(e)?e:typeof e==`string`&&e.length>0?e.split(`
177
177
 
178
- `):[]}const bh=/^(\/\/.+):(_authToken|_auth|username|_password|certfile|keyfile)$/u,xh=/^@[^:]+:registry$/u;function Sh(e){let t={};for(let[n,r]of Object.entries(e)){if(!xh.test(n))continue;let e=vh(r);e&&(t[n.slice(0,-9)]=Eh(e))}return t}function Ch(e,t,n){let r={registry:e};for(let[e,n]of Object.entries(t))r[`${e}:registry`]=n;return n&&(r.scope=n),r}function wh(e){let t={};for(let[n,r]of Object.entries(e)){let e=n.match(bh);if(!e)continue;let[,i,a]=e,o=Dh(i),s=t[o]??{},c=vh(r);if(c!==void 0)switch(a){case`_auth`:s._auth=c;break;case`_authToken`:s._authToken=c;break;case`username`:s.username=c;break;case`_password`:s._password=c;break;case`certfile`:s.certfile=c;break;case`keyfile`:s.keyfile=c}t[o]=s}return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Th(t)]).filter(e=>Object.keys(e[1]).length>0))}function Th(e){let t={};if(e._authToken)t.token=e._authToken;else if(e._auth)t.basicAuth=e._auth;else if(e.username&&e._password){let n=ue.from(e._password,`base64`).toString(`utf8`);t.basicAuth=ue.from(`${e.username}:${n}`,`utf8`).toString(`base64`)}return e.certfile&&(t.certFile=e.certfile),e.keyfile&&(t.keyFile=e.keyfile),t}function Eh(e){return e.endsWith(`/`)?e:`${e}/`}function Dh(e){return e.endsWith(`/`)?e:`${e}/`}function Oh(e){let t=new URL(Eh(e)),n=t.pathname.endsWith(`/`)?t.pathname:`${t.pathname}/`;return`//${t.host}${n}`}function kh(e,t){let n=Oh(e),r;for(let e of Object.keys(t))n.startsWith(e)&&(!r||e.length>r.length)&&(r=e);return r?t[r]:void 0}function Ah(e={}){let t=e.env??y.env,n=e.cwd??y.cwd(),r=e.userConfigPath??uh(t),i=e.projectConfigPath===!1?void 0:e.projectConfigPath??l(n,`.npmrc`),a={registry:Jm,"strict-ssl":`true`};hh(a,fh(r,t)),i&&hh(a,fh(i,t)),hh(a,ph(t));let o=Eh(vh(a.registry)??`https://registry.npmjs.org/`),s=vh(a.scope),c=Sh(a);return{registry:o,npmConfigs:Ch(o,c,s),scopeRegistries:c,authByRegistry:wh(a),strictSSL:_h(a[`strict-ssl`],!0),ca:yh(a.ca),caFile:vh(a.cafile),userAgent:vh(a[`user-agent`]),proxy:vh(a.proxy),httpsProxy:vh(a[`https-proxy`]),noProxy:vh(a.noproxy),userConfigPath:r,projectConfigPath:i}}var jh=/* @__PURE__ */ nh(((e,t)=>{t.exports=/* @__PURE__ */ `_http_agent._http_client._http_common._http_incoming._http_outgoing._http_server._stream_duplex._stream_passthrough._stream_readable._stream_transform._stream_wrap._stream_writable._tls_common._tls_wrap.assert.assert/strict.async_hooks.buffer.child_process.cluster.console.constants.crypto.dgram.diagnostics_channel.dns.dns/promises.domain.events.fs.fs/promises.http.http2.https.inspector.inspector/promises.module.net.os.path.path/posix.path/win32.perf_hooks.process.punycode.querystring.readline.readline/promises.repl.stream.stream/consumers.stream/promises.stream/web.string_decoder.sys.timers.timers/promises.tls.trace_events.tty.url.util.util/types.v8.vm.wasi.worker_threads.zlib.node:sea.node:sqlite.node:test.node:test/reporters`.split(`.`)})),Mh=/* @__PURE__ */ ih((/* @__PURE__ */ nh(((e,t)=>{let n=jh();var r=/* @__PURE__ */ RegExp(`^(?:@([^/]+?)[/])?([^/]+?)$`),i=[`node_modules`,`favicon.ico`],a=function(e,t){var n={validForNewPackages:t.length===0&&e.length===0,validForOldPackages:t.length===0,warnings:e,errors:t};return n.warnings.length||delete n.warnings,n.errors.length||delete n.errors,n};t.exports=function(e){var t=[],o=[];if(e===null)return o.push(`name cannot be null`),a(t,o);if(e===void 0)return o.push(`name cannot be undefined`),a(t,o);if(typeof e!=`string`)return o.push(`name must be a string`),a(t,o);if(e.length||o.push(`name length must be greater than zero`),e.startsWith(`.`)&&o.push(`name cannot start with a period`),e.startsWith(`-`)&&o.push(`name cannot start with a hyphen`),e.match(/^_/)&&o.push(`name cannot start with an underscore`),e.trim()!==e&&o.push(`name cannot contain leading or trailing spaces`),i.forEach(function(t){e.toLowerCase()===t&&o.push(t+` is not a valid package name`)}),n.includes(e.toLowerCase())&&t.push(e+` is a core module name`),e.length>214&&t.push(`name can no longer contain more than 214 characters`),e.toLowerCase()!==e&&t.push(`name can no longer contain capital letters`),/[~'!()*]/.test(e.split(`/`).slice(-1)[0])&&t.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(e)!==e){var s=e.match(r);if(s){var c=s[1],l=s[2];if(l.startsWith(`.`)&&o.push(`name cannot start with a period`),encodeURIComponent(c)===c&&encodeURIComponent(l)===l)return a(t,o)}o.push(`name can only contain URL-friendly characters`)}return a(t,o)}})))(),1);const Nh=/^file:/iu,Ph=/^npm:/iu,Fh=/^(?:git\+)?[a-z]+:/iu,Ih=/^[^@]+@[^:.]+\.[^:]+:.+$/u,Lh=/^(?:\.{1,2}(?:[/\\]|$)|[/\\]|~[/\\]|[A-Za-z]:[/\\])/u;function Rh(e){let t=e.spec.trim();if(!t)throw Gh(`Package spec must be a non-empty string.`,`EINVALIDPACKAGESPEC`);zh(t);let n=t.startsWith(`@`)?Bh(t):Vh(t);return Hh(n.name,t),{raw:t,name:n.name,escapedName:n.name.replace(`/`,`%2f`),scope:Uh(n.name),rawSpec:n.rawSpec}}function zh(e){if(Nh.test(e))throw Wh(e,`file`);if(Ph.test(e))throw Wh(e,`npm alias`);if(Lh.test(e))throw Wh(e,`local path`);if(Ih.test(e))throw Wh(e,`git`);if(Fh.test(e))throw Wh(e,`url`)}function Bh(e){let t=e.indexOf(`/`);if(t<=1||t===e.length-1)throw Gh(`Invalid scoped package spec "${e}".`,`EINVALIDPACKAGESPEC`);let n=e.indexOf(`@`,t+1);return n===-1?{name:e,rawSpec:``}:{name:e.slice(0,n),rawSpec:e.slice(n+1)}}function Vh(e){let t=e.indexOf(`@`);return t===-1?{name:e,rawSpec:``}:{name:e.slice(0,t),rawSpec:e.slice(t+1)}}function Hh(e,t){if(!e)throw Gh(`Invalid package spec "${t}".`,`EINVALIDPACKAGESPEC`);if(!e.startsWith(`@`)&&e.includes(`/`))throw Wh(t,`local path`);if(!(0,Mh.default)(e).validForNewPackages)throw Gh(`Invalid package name "${e}" in "${t}".`,`EINVALIDPACKAGENAME`)}function Uh(e){if(e.startsWith(`@`))return e.slice(0,e.indexOf(`/`))}function Wh(e,t){return Gh(`Unsupported ${t} package spec "${e}" for get-npm-meta.`,`EUNSUPPORTEDPACKAGESPEC`)}function Gh(e,t){return Object.assign(Error(e),{code:t})}function Kh(e){return Eh(e)===Jm}function qh(e,t){let n=Ah(t);return e.map(e=>Jh(e,n))}function Jh(e,t){let n=Rh({spec:e}),r=Eh(Ym(n.scope,t.npmConfigs));return{auth:kh(r,t.authByRegistry),config:t,parsed:n,registry:r}}const Yh=Object.prototype.toString,Xh=e=>Yh.call(e)===`[object Error]`,Zh=/* @__PURE__ */ new Set([`network error`,`NetworkError when attempting to fetch resource.`,`The Internet connection appears to be offline.`,`Network request failed`,`fetch failed`,`terminated`,` A network error occurred.`,`Network connection lost`]);function Qh(e){if(!(e&&Xh(e)&&e.name===`TypeError`&&typeof e.message==`string`))return!1;let{message:t,stack:n}=e;return t===`Load failed`?n===void 0||`__sentry_captured__`in e:t.startsWith(`error sending request for url`)||t===`Failed to fetch`||t.startsWith(`Failed to fetch (`)&&t.endsWith(`)`)?!0:Zh.has(t)}function $h(e){if(typeof e==`number`){if(e<0)throw TypeError("Expected `retries` to be a non-negative number.");if(Number.isNaN(e))throw TypeError("Expected `retries` to be a valid number or Infinity, got NaN.")}else if(e!==void 0)throw TypeError("Expected `retries` to be a number or Infinity.")}function eg(e,t,{min:n=0,allowInfinity:r=!1}={}){if(t!==void 0){if(typeof t!=`number`||Number.isNaN(t))throw TypeError(`Expected \`${e}\` to be a number${r?` or Infinity`:``}.`);if(!r&&!Number.isFinite(t))throw TypeError(`Expected \`${e}\` to be a finite number.`);if(t<n)throw TypeError(`Expected \`${e}\` to be \u2265 ${n}.`)}}function tg(e,t){if(t!==void 0&&typeof t!=`function`)throw TypeError(`Expected \`${e}\` to be a function.`)}var ng=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=Error(e),this.originalError.stack=this.stack),this.name=`AbortError`,this.message=e}};function rg(e,t){let n=Math.max(1,e+1),r=t.randomize?Math.random()+1:1,i=Math.round(r*t.minTimeout*t.factor**(n-1));return i=Math.min(i,t.maxTimeout),i}function ig(e,t){return Number.isFinite(t)?t-(performance.now()-e):t}async function ag(e,t){e<=0||await new Promise((n,r)=>{let i=()=>{clearTimeout(a),t.signal?.removeEventListener(`abort`,i),r(t.signal.reason)},a=setTimeout(()=>{t.signal?.removeEventListener(`abort`,i),n()},e);t.unref&&a.unref?.(),t.signal?.addEventListener(`abort`,i,{once:!0})})}async function og({error:e,attemptNumber:t,retriesConsumed:n,startTime:r,options:i}){let a=e instanceof Error?e:/* @__PURE__ */ TypeError(`Non-error was thrown: "${e}". You should only throw errors.`);if(a instanceof ng)throw a.originalError;let o=Number.isFinite(i.retries)?Math.max(0,i.retries-n):i.retries,s=i.maxRetryTime??1/0,c=rg(n,i);if(ig(r,s)<=0){let e=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:0});throw await i.onFailedAttempt(e),a}let l=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:o>0?c:0}),u=await i.shouldConsumeRetry(l),d=u&&o>0?c:0,f=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:d});if(await i.onFailedAttempt(f),ig(r,s)<=0||ig(r,s)<=0||o<=0||a instanceof TypeError&&!Qh(a)||!await i.shouldRetry(f))throw a;let p=ig(r,s);if(p<=0)throw a;if(!u)return i.signal?.throwIfAborted(),!1;let m=Math.min(d,p);return i.signal?.throwIfAborted(),await ag(m,i),i.signal?.throwIfAborted(),!0}async function sg(e,t={}){if(t={...t},$h(t.retries),Object.hasOwn(t,`forever`))throw Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");t.retries??=10,t.factor??=2,t.minTimeout??=1e3,t.maxTimeout??=1/0,t.maxRetryTime??=1/0,t.randomize??=!1,t.onFailedAttempt??=()=>{},t.shouldRetry??=()=>!0,t.shouldConsumeRetry??=()=>!0,tg(`onFailedAttempt`,t.onFailedAttempt),tg(`shouldRetry`,t.shouldRetry),tg(`shouldConsumeRetry`,t.shouldConsumeRetry),eg(`factor`,t.factor,{min:0,allowInfinity:!1}),eg(`minTimeout`,t.minTimeout,{min:0,allowInfinity:!1}),eg(`maxTimeout`,t.maxTimeout,{min:0,allowInfinity:!0}),eg(`maxRetryTime`,t.maxRetryTime,{min:0,allowInfinity:!0}),t.factor>0||(t.factor=1),t.signal?.throwIfAborted();let n=0,r=0,i=performance.now();for(;!Number.isFinite(t.retries)||r<=t.retries;){n++;try{t.signal?.throwIfAborted();let r=await e(n);return t.signal?.throwIfAborted(),r}catch(e){await og({error:e,attemptNumber:n,retriesConsumed:r,startTime:i,options:t})&&r++}}throw Error(`Retry attempts exhausted without throwing an error.`)}
178
+ `):[]}const xh=/^(\/\/.+):(_authToken|_auth|username|_password|certfile|keyfile)$/u,Sh=/^@[^:]+:registry$/u;function Ch(e){let t={};for(let[n,r]of Object.entries(e)){if(!Sh.test(n))continue;let e=yh(r);e&&(t[n.slice(0,-9)]=Dh(e))}return t}function wh(e,t,n){let r={registry:e};for(let[e,n]of Object.entries(t))r[`${e}:registry`]=n;return n&&(r.scope=n),r}function Th(e){let t={};for(let[n,r]of Object.entries(e)){let e=n.match(xh);if(!e)continue;let[,i,a]=e,o=Oh(i),s=t[o]??{},c=yh(r);if(c!==void 0)switch(a){case`_auth`:s._auth=c;break;case`_authToken`:s._authToken=c;break;case`username`:s.username=c;break;case`_password`:s._password=c;break;case`certfile`:s.certfile=c;break;case`keyfile`:s.keyfile=c}t[o]=s}return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Eh(t)]).filter(e=>Object.keys(e[1]).length>0))}function Eh(e){let t={};if(e._authToken)t.token=e._authToken;else if(e._auth)t.basicAuth=e._auth;else if(e.username&&e._password){let n=ue.from(e._password,`base64`).toString(`utf8`);t.basicAuth=ue.from(`${e.username}:${n}`,`utf8`).toString(`base64`)}return e.certfile&&(t.certFile=e.certfile),e.keyfile&&(t.keyFile=e.keyfile),t}function Dh(e){return e.endsWith(`/`)?e:`${e}/`}function Oh(e){return e.endsWith(`/`)?e:`${e}/`}function kh(e){let t=new URL(Dh(e)),n=t.pathname.endsWith(`/`)?t.pathname:`${t.pathname}/`;return`//${t.host}${n}`}function Ah(e,t){let n=kh(e),r;for(let e of Object.keys(t))n.startsWith(e)&&(!r||e.length>r.length)&&(r=e);return r?t[r]:void 0}function jh(e={}){let t=e.env??y.env,n=e.cwd??y.cwd(),r=e.userConfigPath??dh(t),i=e.projectConfigPath===!1?void 0:e.projectConfigPath??l(n,`.npmrc`),a={registry:Ym,"strict-ssl":`true`};gh(a,ph(r,t)),i&&gh(a,ph(i,t)),gh(a,mh(t));let o=Dh(yh(a.registry)??`https://registry.npmjs.org/`),s=yh(a.scope),c=Ch(a);return{registry:o,npmConfigs:wh(o,c,s),scopeRegistries:c,authByRegistry:Th(a),strictSSL:vh(a[`strict-ssl`],!0),ca:bh(a.ca),caFile:yh(a.cafile),userAgent:yh(a[`user-agent`]),proxy:yh(a.proxy),httpsProxy:yh(a[`https-proxy`]),noProxy:yh(a.noproxy),userConfigPath:r,projectConfigPath:i}}var Mh=/* @__PURE__ */ rh(((e,t)=>{t.exports=/* @__PURE__ */ `_http_agent._http_client._http_common._http_incoming._http_outgoing._http_server._stream_duplex._stream_passthrough._stream_readable._stream_transform._stream_wrap._stream_writable._tls_common._tls_wrap.assert.assert/strict.async_hooks.buffer.child_process.cluster.console.constants.crypto.dgram.diagnostics_channel.dns.dns/promises.domain.events.fs.fs/promises.http.http2.https.inspector.inspector/promises.module.net.os.path.path/posix.path/win32.perf_hooks.process.punycode.querystring.readline.readline/promises.repl.stream.stream/consumers.stream/promises.stream/web.string_decoder.sys.timers.timers/promises.tls.trace_events.tty.url.util.util/types.v8.vm.wasi.worker_threads.zlib.node:sea.node:sqlite.node:test.node:test/reporters`.split(`.`)})),Nh=/* @__PURE__ */ ah((/* @__PURE__ */ rh(((e,t)=>{let n=Mh();var r=/* @__PURE__ */ RegExp(`^(?:@([^/]+?)[/])?([^/]+?)$`),i=[`node_modules`,`favicon.ico`],a=function(e,t){var n={validForNewPackages:t.length===0&&e.length===0,validForOldPackages:t.length===0,warnings:e,errors:t};return n.warnings.length||delete n.warnings,n.errors.length||delete n.errors,n};t.exports=function(e){var t=[],o=[];if(e===null)return o.push(`name cannot be null`),a(t,o);if(e===void 0)return o.push(`name cannot be undefined`),a(t,o);if(typeof e!=`string`)return o.push(`name must be a string`),a(t,o);if(e.length||o.push(`name length must be greater than zero`),e.startsWith(`.`)&&o.push(`name cannot start with a period`),e.startsWith(`-`)&&o.push(`name cannot start with a hyphen`),e.match(/^_/)&&o.push(`name cannot start with an underscore`),e.trim()!==e&&o.push(`name cannot contain leading or trailing spaces`),i.forEach(function(t){e.toLowerCase()===t&&o.push(t+` is not a valid package name`)}),n.includes(e.toLowerCase())&&t.push(e+` is a core module name`),e.length>214&&t.push(`name can no longer contain more than 214 characters`),e.toLowerCase()!==e&&t.push(`name can no longer contain capital letters`),/[~'!()*]/.test(e.split(`/`).slice(-1)[0])&&t.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(e)!==e){var s=e.match(r);if(s){var c=s[1],l=s[2];if(l.startsWith(`.`)&&o.push(`name cannot start with a period`),encodeURIComponent(c)===c&&encodeURIComponent(l)===l)return a(t,o)}o.push(`name can only contain URL-friendly characters`)}return a(t,o)}})))(),1);const Ph=/^file:/iu,Fh=/^npm:/iu,Ih=/^(?:git\+)?[a-z]+:/iu,Lh=/^[^@]+@[^:.]+\.[^:]+:.+$/u,Rh=/^(?:\.{1,2}(?:[/\\]|$)|[/\\]|~[/\\]|[A-Za-z]:[/\\])/u;function zh(e){let t=e.spec.trim();if(!t)throw Kh(`Package spec must be a non-empty string.`,`EINVALIDPACKAGESPEC`);Bh(t);let n=t.startsWith(`@`)?Vh(t):Hh(t);return Uh(n.name,t),{raw:t,name:n.name,escapedName:n.name.replace(`/`,`%2f`),scope:Wh(n.name),rawSpec:n.rawSpec}}function Bh(e){if(Ph.test(e))throw Gh(e,`file`);if(Fh.test(e))throw Gh(e,`npm alias`);if(Rh.test(e))throw Gh(e,`local path`);if(Lh.test(e))throw Gh(e,`git`);if(Ih.test(e))throw Gh(e,`url`)}function Vh(e){let t=e.indexOf(`/`);if(t<=1||t===e.length-1)throw Kh(`Invalid scoped package spec "${e}".`,`EINVALIDPACKAGESPEC`);let n=e.indexOf(`@`,t+1);return n===-1?{name:e,rawSpec:``}:{name:e.slice(0,n),rawSpec:e.slice(n+1)}}function Hh(e){let t=e.indexOf(`@`);return t===-1?{name:e,rawSpec:``}:{name:e.slice(0,t),rawSpec:e.slice(t+1)}}function Uh(e,t){if(!e)throw Kh(`Invalid package spec "${t}".`,`EINVALIDPACKAGESPEC`);if(!e.startsWith(`@`)&&e.includes(`/`))throw Gh(t,`local path`);if(!(0,Nh.default)(e).validForNewPackages)throw Kh(`Invalid package name "${e}" in "${t}".`,`EINVALIDPACKAGENAME`)}function Wh(e){if(e.startsWith(`@`))return e.slice(0,e.indexOf(`/`))}function Gh(e,t){return Kh(`Unsupported ${t} package spec "${e}" for get-npm-meta.`,`EUNSUPPORTEDPACKAGESPEC`)}function Kh(e,t){return Object.assign(Error(e),{code:t})}function qh(e){return Dh(e)===Ym}function Jh(e,t){let n=jh(t);return e.map(e=>Yh(e,n))}function Yh(e,t){let n=zh({spec:e}),r=Dh(Xm(n.scope,t.npmConfigs));return{auth:Ah(r,t.authByRegistry),config:t,parsed:n,registry:r}}const Xh=Object.prototype.toString,Zh=e=>Xh.call(e)===`[object Error]`,Qh=/* @__PURE__ */ new Set([`network error`,`NetworkError when attempting to fetch resource.`,`The Internet connection appears to be offline.`,`Network request failed`,`fetch failed`,`terminated`,` A network error occurred.`,`Network connection lost`]);function $h(e){if(!(e&&Zh(e)&&e.name===`TypeError`&&typeof e.message==`string`))return!1;let{message:t,stack:n}=e;return t===`Load failed`?n===void 0||`__sentry_captured__`in e:t.startsWith(`error sending request for url`)||t===`Failed to fetch`||t.startsWith(`Failed to fetch (`)&&t.endsWith(`)`)?!0:Qh.has(t)}function eg(e){if(typeof e==`number`){if(e<0)throw TypeError("Expected `retries` to be a non-negative number.");if(Number.isNaN(e))throw TypeError("Expected `retries` to be a valid number or Infinity, got NaN.")}else if(e!==void 0)throw TypeError("Expected `retries` to be a number or Infinity.")}function tg(e,t,{min:n=0,allowInfinity:r=!1}={}){if(t!==void 0){if(typeof t!=`number`||Number.isNaN(t))throw TypeError(`Expected \`${e}\` to be a number${r?` or Infinity`:``}.`);if(!r&&!Number.isFinite(t))throw TypeError(`Expected \`${e}\` to be a finite number.`);if(t<n)throw TypeError(`Expected \`${e}\` to be \u2265 ${n}.`)}}function ng(e,t){if(t!==void 0&&typeof t!=`function`)throw TypeError(`Expected \`${e}\` to be a function.`)}var rg=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=Error(e),this.originalError.stack=this.stack),this.name=`AbortError`,this.message=e}};function ig(e,t){let n=Math.max(1,e+1),r=t.randomize?Math.random()+1:1,i=Math.round(r*t.minTimeout*t.factor**(n-1));return i=Math.min(i,t.maxTimeout),i}function ag(e,t){return Number.isFinite(t)?t-(performance.now()-e):t}async function og(e,t){e<=0||await new Promise((n,r)=>{let i=()=>{clearTimeout(a),t.signal?.removeEventListener(`abort`,i),r(t.signal.reason)},a=setTimeout(()=>{t.signal?.removeEventListener(`abort`,i),n()},e);t.unref&&a.unref?.(),t.signal?.addEventListener(`abort`,i,{once:!0})})}async function sg({error:e,attemptNumber:t,retriesConsumed:n,startTime:r,options:i}){let a=e instanceof Error?e:/* @__PURE__ */ TypeError(`Non-error was thrown: "${e}". You should only throw errors.`);if(a instanceof rg)throw a.originalError;let o=Number.isFinite(i.retries)?Math.max(0,i.retries-n):i.retries,s=i.maxRetryTime??1/0,c=ig(n,i);if(ag(r,s)<=0){let e=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:0});throw await i.onFailedAttempt(e),a}let l=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:o>0?c:0}),u=await i.shouldConsumeRetry(l),d=u&&o>0?c:0,f=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:d});if(await i.onFailedAttempt(f),ag(r,s)<=0||ag(r,s)<=0||o<=0||a instanceof TypeError&&!$h(a)||!await i.shouldRetry(f))throw a;let p=ag(r,s);if(p<=0)throw a;if(!u)return i.signal?.throwIfAborted(),!1;let m=Math.min(d,p);return i.signal?.throwIfAborted(),await og(m,i),i.signal?.throwIfAborted(),!0}async function cg(e,t={}){if(t={...t},eg(t.retries),Object.hasOwn(t,`forever`))throw Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");t.retries??=10,t.factor??=2,t.minTimeout??=1e3,t.maxTimeout??=1/0,t.maxRetryTime??=1/0,t.randomize??=!1,t.onFailedAttempt??=()=>{},t.shouldRetry??=()=>!0,t.shouldConsumeRetry??=()=>!0,ng(`onFailedAttempt`,t.onFailedAttempt),ng(`shouldRetry`,t.shouldRetry),ng(`shouldConsumeRetry`,t.shouldConsumeRetry),tg(`factor`,t.factor,{min:0,allowInfinity:!1}),tg(`minTimeout`,t.minTimeout,{min:0,allowInfinity:!1}),tg(`maxTimeout`,t.maxTimeout,{min:0,allowInfinity:!0}),tg(`maxRetryTime`,t.maxRetryTime,{min:0,allowInfinity:!0}),t.factor>0||(t.factor=1),t.signal?.throwIfAborted();let n=0,r=0,i=performance.now();for(;!Number.isFinite(t.retries)||r<=t.retries;){n++;try{t.signal?.throwIfAborted();let r=await e(n);return t.signal?.throwIfAborted(),r}catch(e){await sg({error:e,attemptNumber:n,retriesConsumed:r,startTime:i,options:t})&&r++}}throw Error(`Retry attempts exhausted without throwing an error.`)}
179
179
  /* istanbul ignore next */
180
- const cg=2**53-1||0x1fffffffffffff,lg=/^\d+$/;function ug(e,t){if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let n=lg.test(String(e)),r=lg.test(String(t));return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1}const W=typeof y==`object`&&y.env&&y.env.NODE_DEBUG&&/\bsemver\b/i.test(y.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{},dg=[],fg=[],G=[],pg=[],K={};let mg=0;const hg=`[a-zA-Z0-9-]`,gg=[[`\\s`,1],[`\\d`,256],[hg,250]];function _g(e){for(let[t,n]of gg)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e}function q(e,t,n=!1){let r=_g(t),i=mg++;W(e,i,t),K[e]=i,G[i]=t,pg[i]=r,dg[i]=new RegExp(t,n?`g`:void 0),fg[i]=new RegExp(r,n?`g`:void 0)}q(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),q(`NUMERICIDENTIFIERLOOSE`,`\\d+`),q(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${hg}*`),q(`MAINVERSION`,`(${G[K.NUMERICIDENTIFIER]})\\.(${G[K.NUMERICIDENTIFIER]})\\.(${G[K.NUMERICIDENTIFIER]})`),q(`MAINVERSIONLOOSE`,`(${G[K.NUMERICIDENTIFIERLOOSE]})\\.(${G[K.NUMERICIDENTIFIERLOOSE]})\\.(${G[K.NUMERICIDENTIFIERLOOSE]})`),q(`PRERELEASEIDENTIFIER`,`(?:${G[K.NONNUMERICIDENTIFIER]}|${G[K.NUMERICIDENTIFIER]})`),q(`PRERELEASEIDENTIFIERLOOSE`,`(?:${G[K.NONNUMERICIDENTIFIER]}|${G[K.NUMERICIDENTIFIERLOOSE]})`),q(`PRERELEASE`,`(?:-(${G[K.PRERELEASEIDENTIFIER]}(?:\\.${G[K.PRERELEASEIDENTIFIER]})*))`),q(`PRERELEASELOOSE`,`(?:-?(${G[K.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${G[K.PRERELEASEIDENTIFIERLOOSE]})*))`),q(`BUILDIDENTIFIER`,`${hg}+`),q(`BUILD`,`(?:\\+(${G[K.BUILDIDENTIFIER]}(?:\\.${G[K.BUILDIDENTIFIER]})*))`),q(`FULLPLAIN`,`v?${G[K.MAINVERSION]}${G[K.PRERELEASE]}?${G[K.BUILD]}?`),q(`FULL`,`^${G[K.FULLPLAIN]}$`),q(`LOOSEPLAIN`,`[v=\\s]*${G[K.MAINVERSIONLOOSE]}${G[K.PRERELEASELOOSE]}?${G[K.BUILD]}?`),q(`LOOSE`,`^${G[K.LOOSEPLAIN]}$`),q(`GTLT`,`((?:<|>)?=?)`),q(`XRANGEIDENTIFIERLOOSE`,`${G[K.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),q(`XRANGEIDENTIFIER`,`${G[K.NUMERICIDENTIFIER]}|x|X|\\*`),q(`XRANGEPLAIN`,`[v=\\s]*(${G[K.XRANGEIDENTIFIER]})(?:\\.(${G[K.XRANGEIDENTIFIER]})(?:\\.(${G[K.XRANGEIDENTIFIER]})(?:${G[K.PRERELEASE]})?${G[K.BUILD]}?)?)?`),q(`XRANGEPLAINLOOSE`,`[v=\\s]*(${G[K.XRANGEIDENTIFIERLOOSE]})(?:\\.(${G[K.XRANGEIDENTIFIERLOOSE]})(?:\\.(${G[K.XRANGEIDENTIFIERLOOSE]})(?:${G[K.PRERELEASELOOSE]})?${G[K.BUILD]}?)?)?`),q(`XRANGE`,`^${G[K.GTLT]}\\s*${G[K.XRANGEPLAIN]}$`),q(`XRANGELOOSE`,`^${G[K.GTLT]}\\s*${G[K.XRANGEPLAINLOOSE]}$`),q(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?`),q(`COERCE`,`${G[K.COERCEPLAIN]}(?:$|[^\\d])`),q(`COERCEFULL`,`${G[K.COERCEPLAIN]}(?:${G[K.PRERELEASE]})?(?:${G[K.BUILD]})?(?:$|[^\\d])`),q(`COERCERTL`,G[K.COERCE],!0),q(`COERCERTLFULL`,G[K.COERCEFULL],!0),q(`LONETILDE`,`(?:~>?)`),q(`TILDETRIM`,`(\\s*)${G[K.LONETILDE]}\\s+`,!0),q(`TILDE`,`^${G[K.LONETILDE]}${G[K.XRANGEPLAIN]}$`),q(`TILDELOOSE`,`^${G[K.LONETILDE]}${G[K.XRANGEPLAINLOOSE]}$`),q(`LONECARET`,`(?:\\^)`),q(`CARETTRIM`,`(\\s*)${G[K.LONECARET]}\\s+`,!0),q(`CARET`,`^${G[K.LONECARET]}${G[K.XRANGEPLAIN]}$`),q(`CARETLOOSE`,`^${G[K.LONECARET]}${G[K.XRANGEPLAINLOOSE]}$`),q(`COMPARATORLOOSE`,`^${G[K.GTLT]}\\s*(${G[K.LOOSEPLAIN]})$|^$`),q(`COMPARATOR`,`^${G[K.GTLT]}\\s*(${G[K.FULLPLAIN]})$|^$`),q(`COMPARATORTRIM`,`(\\s*)${G[K.GTLT]}\\s*(${G[K.LOOSEPLAIN]}|${G[K.XRANGEPLAIN]})`,!0),q(`HYPHENRANGE`,`^\\s*(${G[K.XRANGEPLAIN]})\\s+-\\s+(${G[K.XRANGEPLAIN]})\\s*$`),q(`HYPHENRANGELOOSE`,`^\\s*(${G[K.XRANGEPLAINLOOSE]})\\s+-\\s+(${G[K.XRANGEPLAINLOOSE]})\\s*$`),q(`STAR`,`(<|>)?=?\\s*\\*`),q(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),q(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`);const vg=Object.freeze({loose:!0}),yg=Object.freeze({});function bg(e){return e?typeof e==`object`?e:vg:yg}const xg=/^\d+$/;var Sg=class e{raw=``;loose=!1;options={};includePrerelease=!1;major=0;minor=0;patch=0;version=``;build=[];prerelease=[];constructor(t,n){let r=bg(n),i;if(t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;i=t.version}else if(typeof t==`string`)i=t;else throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(i.length>256)throw TypeError(`version is longer than 256 characters`);W(`SemVer`,i,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let a=i.trim().match(r.loose?fg[K.LOOSE]:fg[K.FULL]);if(!a)throw TypeError(`Invalid Version: ${i}`);if(this.raw=i,this.major=+a[1],this.minor=+a[2],this.patch=+a[3],this.major>cg||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>cg||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>cg||this.patch<0)throw TypeError(`Invalid patch version`);this.prerelease=a[4]?a[4].split(`.`).map(e=>{if(xg.test(e)){let t=+e;if(t>=0&&t<cg)return t}return e}):[],this.build=a[5]?a[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}inspect(){return`<SemVer "${this.version}">`}asSemVer(t){return t instanceof e?t:new e(t,this.options)}compare(t){W(`SemVer.compare`,this.version,this.options,t);let n;if(t instanceof e)n=t;else{if(typeof t==`string`&&t===this.version)return 0;n=this.asSemVer(t)}return n.version===this.version?0:this.compareMain(n)||this.comparePre(n)}compareMain(e){let t=this.asSemVer(e);return this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:+(this.patch>t.patch)}comparePre(e){let t=this.asSemVer(e);if(this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{let e=this.prerelease[n],r=t.prerelease[n];if(W(`prerelease compare`,n,e,r),e===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(e===void 0)return-1;if(e!==r)return ug(e,r)}while(++n);return 0}compareBuild(e){let t=this.asSemVer(e),n=0;do{let e=this.build[n],r=t.build[n];if(W(`build compare`,n,e,r),e===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(e===void 0)return-1;if(e!==r)return ug(e,r)}while(++n);return 0}inc(e,t,n){let r=e,i=t;if(r.startsWith(`pre`)){if(!i&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(i){let e=`-${i}`.match(this.options.loose?fg[K.PRERELEASELOOSE]:fg[K.PRERELEASE]);if(!e||e[1]!==i)throw Error(`invalid identifier: ${i}`)}}switch(r){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,i,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,i,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,i,n),this.inc(`pre`,i,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,i,n),this.inc(`pre`,i,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(this.prerelease.length===0)this.prerelease=[e];else{let t=this.prerelease.length;for(;--t>=0;)typeof this.prerelease[t]==`number`&&(this.prerelease[t]=this.prerelease[t]+1,t=-2);if(t===-1){if(i===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(i){let t=[i,e];n===!1&&(t=[i]),ug(this.prerelease[0],i)===0?Number.isNaN(Number(this.prerelease[1]))&&(this.prerelease=t):this.prerelease=t}break}default:throw Error(`invalid increment argument: ${r}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}};function Cg(e,t,n){return new Sg(e,n).compare(new Sg(t,n))}function wg(e,t,n){return Cg(e,t,n)===0}function Tg(e,t,n){return Cg(e,t,n)>0}function Eg(e,t,n){return Cg(e,t,n)>=0}function Dg(e,t,n){return Cg(e,t,n)<0}function Og(e,t,n){return Cg(e,t,n)<=0}function kg(e,t,n){return Cg(e,t,n)!==0}function Ag(e,t,n,r){let i=e=>e instanceof Sg?e.version:e;switch(t){case`===`:return e=i(e),n=i(n),e===n;case`!==`:return e=i(e),n=i(n),e!==n;case``:case`=`:case`==`:return wg(e,n,r);case`!=`:return kg(e,n,r);case`>`:return Tg(e,n,r);case`>=`:return Eg(e,n,r);case`<`:return Dg(e,n,r);case`<=`:return Og(e,n,r);default:throw TypeError(`Invalid operator: ${t}`)}}var jg=class{max;map;constructor(){this.max=1e3,this.map=/* @__PURE__ */ new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;e!==void 0&&this.delete(e)}this.map.set(e,t)}return this}};const Mg=Symbol(`SemVer ANY`),Ng=/\s+/;var Pg=class e{options={};loose=!1;operator=``;semver=Mg;value=``;static get ANY(){return Mg}constructor(t,n){let r=bg(n);if(t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}let i=String(t).trim().split(Ng).join(` `);W(`comparator`,i,r),this.options=r,this.loose=!!r.loose,this.parse(i),this.value=this.semver===Mg?``:this.operator+this.semver.version,W(`comp`,this)}parse(e){let t=this.options.loose?fg[K.COMPARATORLOOSE]:fg[K.COMPARATOR],n=e.match(t);if(!n)throw TypeError(`Invalid comparator: ${e}`);this.operator=n[1]===void 0?``:n[1],this.operator===`=`&&(this.operator=``),this.semver=n[2]?new Sg(n[2],this.options.loose):Mg}toString(){return this.value}test(e){if(W(`Comparator.test`,e,this.options.loose),this.semver===Mg||e===Mg)return!0;if(typeof e==`string`)try{e=new Sg(e,this.options)}catch{return!1}return Ag(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);if(this.operator===``)return this.value===``||new Vg(t.value,n).test(this.value);if(t.operator===``)return t.value===``||new Vg(this.value,n).test(t.semver);let r=bg(n);return r.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!r.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver!==Mg&&t.semver!==Mg&&this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||Ag(this.semver,`<`,t.semver,r)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||Ag(this.semver,`>`,t.semver,r)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`))}};const Fg=/\s+/g,Ig=/\s+/,Lg=new jg,Rg=e=>e.value===`<0.0.0-0`,zg=e=>e.value===``,Bg=e=>e!==Pg.ANY;var Vg=class e{raw=``;loose=!1;options={};includePrerelease=!1;set=[];formatted;constructor(t,n){let r=bg(n);if(t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof Pg)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=(typeof t==`string`?t:String(t)).trim().replace(Fg,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length>0),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!Rg(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&zg(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}inspect(){return`<SemVer Range "${this.range}">`}parseRange(e){let t=`${+!!this.options.includePrerelease|(this.options.loose?2:0)}:${e}`,n=Lg.get(t);if(n)return n;let r=this.options.loose,i=r?fg[K.HYPHENRANGELOOSE]:fg[K.HYPHENRANGE];e=e.replace(i,$g(!!this.options.includePrerelease)),W(`hyphen replace`,e),e=e.replace(fg[K.COMPARATORTRIM],`$1$2$3`),W(`comparator trim`,e),e=e.replace(fg[K.TILDETRIM],`$1~`),W(`tilde trim`,e),e=e.replace(fg[K.CARETTRIM],`$1^`),W(`caret trim`,e);let a=e.split(` `).map(e=>Ug(e,this.options)).join(` `).split(Ig).map(e=>Qg(e,this.options));r&&(a=a.filter(e=>(W(`loose invalid filter`,e,this.options),!!e.match(fg[K.COMPARATORLOOSE])))),W(`range list`,a);let o=/* @__PURE__ */ new Map,s=a.map(e=>new Pg(e,this.options));for(let e of s){if(Rg(e))return[e];o.set(e.value,e)}o.size>1&&o.has(``)&&o.delete(``);let c=[...o.values()];return Lg.set(t,c),c}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>Hg(e,n)&&t.set.some(t=>Hg(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;let t;if(typeof e==`string`)try{t=new Sg(e,this.options)}catch{return!1}else if(e instanceof Sg)t=e;else return!1;for(let e=0;e<this.set.length;e++)if(e_(this.set[e],t,this.options))return!0;return!1}};function Hg(e,t){let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;){let e=i;if(!e)break;n=r.every(n=>e.intersects(n,t)),i=r.pop()}return n}function Ug(e,t){return e=e.replace(fg[K.BUILD],``),W(`comp`,e,t),e=qg(e,t),W(`caret`,e),e=Gg(e,t),W(`tildes`,e),e=Yg(e,t),W(`xrange`,e),e=Zg(e,t),W(`stars`,e),e}function Wg(e){return!e||e.toLowerCase()===`x`||e===`*`}function Gg(e,t){return e.trim().split(Ig).map(e=>Kg(e,t)).join(` `)}function Kg(e,t){let n=t.loose?fg[K.TILDELOOSE]:fg[K.TILDE];return e.replace(n,(t,n,r,i,a)=>{W(`tilde`,e,t,n,r,i,a);let o,s=String(n),c=String(r),l=String(i);return Wg(n)?o=``:Wg(r)?o=`>=${s}.0.0 <${Number(s)+1}.0.0-0`:Wg(i)?o=`>=${s}.${c}.0 <${s}.${Number(c)+1}.0-0`:a?(W(`replaceTilde pr`,a),o=`>=${s}.${c}.${l}-${a} <${s}.${Number(c)+1}.0-0`):o=`>=${s}.${c}.${l} <${s}.${Number(c)+1}.0-0`,W(`tilde return`,o),o})}function qg(e,t){return e.trim().split(Ig).map(e=>Jg(e,t)).join(` `)}function Jg(e,t){W(`caret`,e,t);let n=t.loose?fg[K.CARETLOOSE]:fg[K.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{W(`caret`,e,t,n,i,a,o);let s,c=String(n),l=String(i),u=String(a);return Wg(n)?s=``:Wg(i)?s=`>=${c}.0.0${r} <${Number(c)+1}.0.0-0`:Wg(a)?s=c===`0`?`>=${c}.${l}.0${r} <${c}.${Number(l)+1}.0-0`:`>=${c}.${l}.0${r} <${Number(c)+1}.0.0-0`:o?(W(`replaceCaret pr`,o),s=c===`0`?l===`0`?`>=${c}.${l}.${u}-${o} <${c}.${l}.${Number(u)+1}-0`:`>=${c}.${l}.${u}-${o} <${c}.${Number(l)+1}.0-0`:`>=${c}.${l}.${u}-${o} <${Number(c)+1}.0.0-0`):(W(`no pr`),s=c===`0`?l===`0`?`>=${c}.${l}.${u}${r} <${c}.${l}.${Number(u)+1}-0`:`>=${c}.${l}.${u}${r} <${c}.${Number(l)+1}.0-0`:`>=${c}.${l}.${u} <${Number(c)+1}.0.0-0`),W(`caret return`,s),s})}function Yg(e,t){return W(`replaceXRanges`,e,t),e.split(Ig).map(e=>Xg(e,t)).join(` `)}function Xg(e,t){e=e.trim();let n=t.loose?fg[K.XRANGELOOSE]:fg[K.XRANGE];return e.replace(n,(n,r,i,a,o,s)=>{W(`xRange`,e,n,r,i,a,o,s);let c=Wg(i),l=c||Wg(a),u=l||Wg(o),d=u,f=r,p=String(i),m=String(a),h=String(o),g=s??``;return f===`=`&&d&&(f=``),g=t.includePrerelease?`-0`:``,c?n=f===`>`||f===`<`?`<0.0.0-0`:`*`:f&&d?(l&&(m=0),h=0,f===`>`?(f=`>=`,l?(p=Number(p)+1,m=0,h=0):(m=Number(m)+1,h=0)):f===`<=`&&(f=`<`,l?p=Number(p)+1:m=Number(m)+1),f===`<`&&(g=`-0`),n=`${f+p}.${m}.${h}${g}`):l?n=`>=${p}.0.0${g} <${Number(p)+1}.0.0-0`:u&&(n=`>=${p}.${m}.0${g} <${p}.${Number(m)+1}.0-0`),W(`xRange return`,n),n})}function Zg(e,t){return W(`replaceStars`,e,t),e.trim().replace(fg[K.STAR],``)}function Qg(e,t){return W(`replaceGTE0`,e,t),e.trim().replace(fg[t.includePrerelease?K.GTE0PRE:K.GTE0],``)}function $g(e){return(t,n,r,i,a,o,s,c,l,u,d,f)=>{let p=n??``,m=c??``;return p=Wg(r)?``:Wg(i)?`>=${String(r)}.0.0${e?`-0`:``}`:Wg(a)?`>=${String(r)}.${String(i)}.0${e?`-0`:``}`:o?`>=${p}`:`>=${p}${e?`-0`:``}`,m=Wg(l)?``:Wg(u)?`<${Number(l)+1}.0.0-0`:Wg(d)?`<${String(l)}.${Number(u)+1}.0-0`:f?`<=${String(l)}.${String(u)}.${String(d)}-${f}`:e?`<${String(l)}.${String(u)}.${Number(d)+1}-0`:`<=${m}`,`${p} ${m}`.trim()}}function e_(e,t,n){for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++){let r=e[n];if(W(r.semver),!Bg(r.semver))continue;let i=r.semver;if(i.prerelease.length>0&&i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function t_(e,t,n=!1){if(e instanceof Sg)return e;try{return new Sg(e,t)}catch(e){if(!n)return null;throw e}}function n_(e,t,n){try{return new Vg(t,n).test(e)}catch{return!1}}function r_(e,t){let n=t_(e,t);return n?n.version:null}function i_(e,t){try{return new Vg(e,t).range||`*`}catch{return null}}async function a_(e,t={}){let n=await s_(e,t);if(u_(n)){if(t.throw===!1)return n;throw Error(n.error)}let r=n.versions??{},i=f_(n[`dist-tags`]),a=n.time??{},o=e.parsed.rawSpec||`*`,s=Date.now(),c=c_(l_(Object.keys(r),i,o,t.loose),a,t.after);return t.metadata?{name:n.name??e.parsed.name,distTags:i,lastSynced:s,specifier:o,timeCreated:a.created??``,timeModified:a.modified??``,versionsMeta:Object.fromEntries(c.filter(e=>!!r[e]).map(e=>[e,m_(r[e],a[e])]))}:{name:n.name??e.parsed.name,distTags:i,lastSynced:s,specifier:o,versions:c,time:{created:a.created??``,modified:a.modified??``,...Object.fromEntries(c.filter(e=>!!a[e]).map(e=>[e,a[e]]))}}}async function o_(e,t){let n=t.fetch??fetch,r=new URL(e.parsed.escapedName,e.registry),i=new Headers({accept:`application/json`});e.auth?.token?i.set(`authorization`,`Bearer ${e.auth.token}`):e.auth?.basicAuth&&i.set(`authorization`,`Basic ${e.auth.basicAuth}`),e.config.userAgent&&i.set(`user-agent`,e.config.userAgent);let a=await n(r,{headers:i});return a.ok?a.json():p_(e.parsed.name,r,a.status,a.statusText)}async function s_(e,t){let n=d_(t.retry),r=()=>o_(e,t);return n===!1?r():sg(r,n)}function c_(e,t,n){if(!n)return e;let r=Date.parse(n);return Number.isNaN(r)?e:e.filter(e=>{let n=t[e];return n?Date.parse(n)>r:!1})}function l_(e,t,n,r){if(n===`*`)return e;let i=t[n];return i?e.includes(i)?[i]:[]:r_(n)?e:i_(n)?e.filter(e=>n_(e,n,{includePrerelease:!0,loose:r??!1})):e}function u_(e){return`error`in e}function d_(e){return e===!1?!1:typeof e==`number`?{...ah,retries:e}:e??ah}function f_(e){return{latest:e?.latest??``,...e??{}}}function p_(e,t,n,r){return{status:n,name:e,error:`[GET] "${t}": ${n} ${r}`}}function m_(e,t){return{time:t,engines:e.engines,deprecated:e.deprecated,provenance:oh(e),integrity:e.integrity??e.dist?.integrity}}async function h_(e,t={}){let[n]=qh([e],t);return g_(n,t)}function g_(e,t){return Kh(e.registry)?Gm(e.parsed.raw,__(t)):a_(e,t)}function __(e){let{cwd:t,env:n,userConfigPath:r,projectConfigPath:i,...a}=e;return a}const v_=!!globalThis.process?.env?.FORCE_NODE_FETCH,y_=!v_&&globalThis.fetch||me;!v_&&globalThis.Blob,!v_&&globalThis.File,!v_&&globalThis.FormData;const b_=!v_&&globalThis.Headers||fe;!v_&&globalThis.Request,!v_&&globalThis.Response;const x_=!v_&&globalThis.AbortController||R,S_=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,C_=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,w_=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function T_(e,t){if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t)E_(e);else return t}function E_(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function D_(e,t={}){if(typeof e!=`string`)return e;if(e[0]===`"`&&e[e.length-1]===`"`&&e.indexOf(`\\`)===-1)return e.slice(1,-1);let n=e.trim();if(n.length<=9)switch(n.toLowerCase()){case`true`:return!0;case`false`:return!1;case`undefined`:return;case`null`:return null;case`nan`:return NaN;case`infinity`:return 1/0;case`-infinity`:return-1/0}if(!w_.test(e)){if(t.strict)throw SyntaxError(`[destr] Invalid JSON`);return e}try{if(S_.test(e)||C_.test(e)){if(t.strict)throw Error(`[destr] Possible prototype pollution`);return JSON.parse(e,T_)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}String.fromCharCode;const O_=/#/g,k_=/&/g,A_=/\//g,j_=/=/g,M_=/\+/g,N_=/%5e/gi,P_=/%60/gi,F_=/%7c/gi,I_=/%20/gi;function L_(e){return encodeURI(``+e).replace(F_,`|`)}function R_(e){return L_(typeof e==`string`?e:JSON.stringify(e)).replace(M_,`%2B`).replace(I_,`+`).replace(O_,`%23`).replace(k_,`%26`).replace(P_,"`").replace(N_,`^`).replace(A_,`%2F`)}function z_(e){return R_(e).replace(j_,`%3D`)}function B_(e=``){try{return decodeURIComponent(``+e)}catch{return``+e}}function V_(e){return B_(e.replace(M_,` `))}function H_(e){return B_(e.replace(M_,` `))}function U_(e=``){let t=/* @__PURE__ */ Object.create(null);e[0]===`?`&&(e=e.slice(1));for(let n of e.split(`&`)){let e=n.match(/([^=]+)=?(.*)/)||[];if(e.length<2)continue;let r=V_(e[1]);if(r===`__proto__`||r===`constructor`)continue;let i=H_(e[2]||``);t[r]===void 0?t[r]=i:Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]}return t}function W_(e,t){return(typeof t==`number`||typeof t==`boolean`)&&(t=String(t)),t?Array.isArray(t)?t.map(t=>`${z_(e)}=${R_(t)}`).join(`&`):`${z_(e)}=${R_(t)}`:z_(e)}function G_(e){return Object.keys(e).filter(t=>e[t]!==void 0).map(t=>W_(t,e[t])).filter(Boolean).join(`&`)}const K_=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,q_=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,J_=/^([/\\]\s*){2,}[^/\\]/,Y_=/\/$|\/\?|\/#/,X_=/^\.?\//;function Z_(e,t={}){return typeof t==`boolean`&&(t={acceptRelative:t}),t.strict?K_.test(e):q_.test(e)||(t.acceptRelative?J_.test(e):!1)}function Q_(e=``,t){return t?Y_.test(e):e.endsWith(`/`)}function $_(e=``,t){if(!t)return(Q_(e)?e.slice(0,-1):e)||`/`;if(!Q_(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);i!==-1&&(n=e.slice(0,i),r=e.slice(i));let[a,...o]=n.split(`?`);return((a.endsWith(`/`)?a.slice(0,-1):a)||`/`)+(o.length>0?`?${o.join(`?`)}`:``)+r}function ev(e=``,t){if(!t)return e.endsWith(`/`)?e:e+`/`;if(Q_(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);if(i!==-1&&(n=e.slice(0,i),r=e.slice(i),!n))return r;let[a,...o]=n.split(`?`);return a+`/`+(o.length>0?`?${o.join(`?`)}`:``)+r}function tv(e,t){if(rv(t)||Z_(e))return e;let n=$_(t);if(e.startsWith(n)){let t=e[n.length];if(!t||t===`/`||t===`?`)return e}return av(n,e)}function nv(e,t){let n=sv(e);return n.search=G_({...U_(n.search),...t}),lv(n)}function rv(e){return!e||e===`/`}function iv(e){return e&&e!==`/`}function av(e,...t){let n=e||``;for(let e of t.filter(e=>iv(e)))if(n){let t=e.replace(X_,``);n=ev(n)+t}else n=e;return n}const ov=Symbol.for(`ufo:protocolRelative`);function sv(e=``,t){let n=e.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){let[,e,t=``]=n;return{protocol:e.toLowerCase(),pathname:t,href:e+t,auth:``,host:``,search:``,hash:``}}if(!Z_(e,{acceptRelative:!0}))return t?sv(t+e):cv(e);let[,r=``,i,a=``]=e.replace(/\\/g,`/`).match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,o=``,s=``]=a.match(/([^#/?]*)(.*)?/)||[];r===`file:`&&(s=s.replace(/\/(?=[A-Za-z]:)/,``));let{pathname:c,search:l,hash:u}=cv(s);return{protocol:r.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):``,host:o,pathname:c,search:l,hash:u,[ov]:!r}}function cv(e=``){let[t=``,n=``,r=``]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:n,hash:r}}function lv(e){let t=e.pathname||``,n=e.search?(e.search.startsWith(`?`)?``:`?`)+e.search:``,r=e.hash||``,i=e.auth?e.auth+`@`:``,a=e.host||``;return(e.protocol||e[ov]?(e.protocol||``)+`//`:``)+i+a+t+n+r}var uv=class extends Error{constructor(e,t){super(e,t),this.name=`FetchError`,t?.cause&&!this.cause&&(this.cause=t.cause)}};function dv(e){let t=e.error?.message||e.error?.toString()||``,n=e.request?.method||e.options?.method||`GET`,r=e.request?.url||String(e.request)||`/`,i=new uv(`${`[${n}] ${JSON.stringify(r)}`}: ${e.response?`${e.response.status} ${e.response.statusText}`:`<no response>`}${t?` ${t}`:``}`,e.error?{cause:e.error}:void 0);for(let t of[`request`,`options`,`response`])Object.defineProperty(i,t,{get(){return e[t]}});for(let[t,n]of[[`data`,`_data`],[`status`,`status`],[`statusCode`,`status`],[`statusText`,`statusText`],[`statusMessage`,`statusText`]])Object.defineProperty(i,t,{get(){return e.response&&e.response[n]}});return i}const fv=new Set(Object.freeze([`PATCH`,`POST`,`PUT`,`DELETE`]));function pv(e=`GET`){return fv.has(e.toUpperCase())}function mv(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer||e instanceof FormData||e instanceof URLSearchParams?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}const hv=/* @__PURE__ */ new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]),gv=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function _v(e=``){if(!e)return`json`;let t=e.split(`;`).shift()||``;return gv.test(t)?`json`:t===`text/event-stream`?`stream`:hv.has(t)||t.startsWith(`text/`)?`text`:`blob`}function vv(e,t,n,r){let i=yv(t?.headers??e?.headers,n?.headers,r),a;return(n?.query||n?.params||t?.params||t?.query)&&(a={...n?.params,...n?.query,...t?.params,...t?.query}),{...n,...t,query:a,params:a,headers:i}}function yv(e,t,n){if(!t)return new n(e);let r=new n(t);if(e)for(let[t,i]of Symbol.iterator in e||Array.isArray(e)?e:new n(e))r.set(t,i);return r}async function bv(e,t){if(t){if(Array.isArray(t))for(let n of t)await n(e);else await t(e)}}const xv=/* @__PURE__ */ new Set([408,409,425,429,500,502,503,504]),Sv=/* @__PURE__ */ new Set([101,204,205,304]);function Cv(e={}){let{fetch:t=globalThis.fetch,Headers:n=globalThis.Headers,AbortController:r=globalThis.AbortController}=e;async function i(e){let t=e.error&&e.error.name===`AbortError`&&!e.options.timeout||!1;if(e.options.retry!==!1&&!t){let t;t=typeof e.options.retry==`number`?e.options.retry:+!pv(e.options.method);let n=e.response&&e.response.status||500;if(t>0&&(Array.isArray(e.options.retryStatusCodes)?e.options.retryStatusCodes.includes(n):xv.has(n))){let n=typeof e.options.retryDelay==`function`?e.options.retryDelay(e):e.options.retryDelay||0;return n>0&&await new Promise(e=>setTimeout(e,n)),a(e.request,{...e.options,retry:t-1})}}let n=dv(e);throw Error.captureStackTrace&&Error.captureStackTrace(n,a),n}let a=async function(a,o={}){let s={request:a,options:vv(a,o,e.defaults,n),response:void 0,error:void 0};if(s.options.method&&(s.options.method=s.options.method.toUpperCase()),s.options.onRequest&&(await bv(s,s.options.onRequest),s.options.headers instanceof n||(s.options.headers=new n(s.options.headers||{}))),typeof s.request==`string`&&(s.options.baseURL&&(s.request=tv(s.request,s.options.baseURL)),s.options.query&&(s.request=nv(s.request,s.options.query),delete s.options.query),`query`in s.options&&delete s.options.query,`params`in s.options&&delete s.options.params),s.options.body&&pv(s.options.method)){if(mv(s.options.body)){let e=s.options.headers.get(`content-type`);typeof s.options.body!=`string`&&(s.options.body=e===`application/x-www-form-urlencoded`?new URLSearchParams(s.options.body).toString():JSON.stringify(s.options.body)),e||s.options.headers.set(`content-type`,`application/json`),s.options.headers.has(`accept`)||s.options.headers.set(`accept`,`application/json`)}else(`pipeTo`in s.options.body&&typeof s.options.body.pipeTo==`function`||typeof s.options.body.pipe==`function`)&&(`duplex`in s.options||(s.options.duplex=`half`))}let c;if(!s.options.signal&&s.options.timeout){let e=new r;c=setTimeout(()=>{let t=/* @__PURE__ */ Error(`[TimeoutError]: The operation was aborted due to timeout`);t.name=`TimeoutError`,t.code=23,e.abort(t)},s.options.timeout),s.options.signal=e.signal}try{s.response=await t(s.request,s.options)}catch(e){return s.error=e,s.options.onRequestError&&await bv(s,s.options.onRequestError),await i(s)}finally{c&&clearTimeout(c)}if((s.response.body||s.response._bodyInit)&&!Sv.has(s.response.status)&&s.options.method!==`HEAD`){let e=(s.options.parseResponse?`json`:s.options.responseType)||_v(s.response.headers.get(`content-type`)||``);switch(e){case`json`:{let e=await s.response.text(),t=s.options.parseResponse||D_;s.response._data=t(e);break}case`stream`:s.response._data=s.response.body||s.response._bodyInit;break;default:s.response._data=await s.response[e]()}}return s.options.onResponse&&await bv(s,s.options.onResponse),!s.options.ignoreResponseError&&s.response.status>=400&&s.response.status<600?(s.options.onResponseError&&await bv(s,s.options.onResponseError),await i(s)):s.response},o=async function(e,t){return(await a(e,t))._data};return o.raw=a,o.native=(...e)=>t(...e),o.create=(t={},n={})=>Cv({...e,...n,defaults:{...e.defaults,...n.defaults,...t}}),o}function wv(){if(!JSON.parse(process.env.FETCH_KEEP_ALIVE||`false`))return y_;let e={keepAlive:!0},t=new I.Agent(e),n=new de.Agent(e),r={agent(e){return e.protocol===`http:`?t:n}};return function(e,t){return y_(e,{...r,...t})}}const Tv=globalThis.fetch?(...e)=>globalThis.fetch(...e):wv();Cv({fetch:Tv,Headers:globalThis.Headers||b_,AbortController:globalThis.AbortController||x_});const Ev=/^(?:( )+|\t+)/,Dv=`space`;function Ov(e,t,n){return e&&t===Dv&&n===1}function kv(e,t){let n=/* @__PURE__ */ new Map,r=0,i,a;for(let o of e.split(/\n/g)){if(!o)continue;let e=o.match(Ev);if(e===null)r=0,i=``;else{let o=e[0].length,s=e[1]?Dv:`tab`;if(Ov(t,s,o))continue;s!==i&&(r=0),i=s;let c=1,l=0,u=o-r;if(r=o,u===0)c=0,l=1;else{let e=Math.abs(u);if(Ov(t,s,e))continue;a=Av(s,e)}let d=n.get(a);n.set(a,d===void 0?[1,0]:[d[0]+c,d[1]+l])}}return n}function Av(e,t){return(e===Dv?`s`:`t`)+String(t)}function jv(e){return{type:e[0]===`s`?Dv:`tab`,amount:Number(e.slice(1))}}function Mv(e){let t,n=0,r=0;for(let[i,[a,o]]of e)(a>n||a===n&&o>r)&&(n=a,r=o,t=i);return t}function Nv(e,t){return(e===Dv?` `:` `).repeat(t)}function Pv(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);let t=kv(e,!0);t.size===0&&(t=kv(e,!1));let n=Mv(t),r,i=0,a=``;return n!==void 0&&({type:r,amount:i}=jv(n),a=Nv(r,i)),{amount:i,type:r,indent:a}}function Fv(e,t){return c(e)?e:d(t||`.`,e)}function Iv(e,t){let{last:n,cwd:r}=t||{},i=Fv(e,r),a=Fv(n||`/`,r),o,c=[];for(;o!==a&&(c.push(i),i=s(o=i),i!==o););return c}function Lv(e,t){let n,r;for(n of Iv(t&&t.cwd||``,t))if(r=l(n,e),p(r))return r}
180
+ const lg=2**53-1||0x1fffffffffffff,ug=/^\d+$/;function dg(e,t){if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let n=ug.test(String(e)),r=ug.test(String(t));return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1}const W=typeof y==`object`&&y.env&&y.env.NODE_DEBUG&&/\bsemver\b/i.test(y.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{},fg=[],pg=[],G=[],mg=[],K={};let hg=0;const gg=`[a-zA-Z0-9-]`,_g=[[`\\s`,1],[`\\d`,256],[gg,250]];function vg(e){for(let[t,n]of _g)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e}function q(e,t,n=!1){let r=vg(t),i=hg++;W(e,i,t),K[e]=i,G[i]=t,mg[i]=r,fg[i]=new RegExp(t,n?`g`:void 0),pg[i]=new RegExp(r,n?`g`:void 0)}q(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),q(`NUMERICIDENTIFIERLOOSE`,`\\d+`),q(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${gg}*`),q(`MAINVERSION`,`(${G[K.NUMERICIDENTIFIER]})\\.(${G[K.NUMERICIDENTIFIER]})\\.(${G[K.NUMERICIDENTIFIER]})`),q(`MAINVERSIONLOOSE`,`(${G[K.NUMERICIDENTIFIERLOOSE]})\\.(${G[K.NUMERICIDENTIFIERLOOSE]})\\.(${G[K.NUMERICIDENTIFIERLOOSE]})`),q(`PRERELEASEIDENTIFIER`,`(?:${G[K.NONNUMERICIDENTIFIER]}|${G[K.NUMERICIDENTIFIER]})`),q(`PRERELEASEIDENTIFIERLOOSE`,`(?:${G[K.NONNUMERICIDENTIFIER]}|${G[K.NUMERICIDENTIFIERLOOSE]})`),q(`PRERELEASE`,`(?:-(${G[K.PRERELEASEIDENTIFIER]}(?:\\.${G[K.PRERELEASEIDENTIFIER]})*))`),q(`PRERELEASELOOSE`,`(?:-?(${G[K.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${G[K.PRERELEASEIDENTIFIERLOOSE]})*))`),q(`BUILDIDENTIFIER`,`${gg}+`),q(`BUILD`,`(?:\\+(${G[K.BUILDIDENTIFIER]}(?:\\.${G[K.BUILDIDENTIFIER]})*))`),q(`FULLPLAIN`,`v?${G[K.MAINVERSION]}${G[K.PRERELEASE]}?${G[K.BUILD]}?`),q(`FULL`,`^${G[K.FULLPLAIN]}$`),q(`LOOSEPLAIN`,`[v=\\s]*${G[K.MAINVERSIONLOOSE]}${G[K.PRERELEASELOOSE]}?${G[K.BUILD]}?`),q(`LOOSE`,`^${G[K.LOOSEPLAIN]}$`),q(`GTLT`,`((?:<|>)?=?)`),q(`XRANGEIDENTIFIERLOOSE`,`${G[K.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),q(`XRANGEIDENTIFIER`,`${G[K.NUMERICIDENTIFIER]}|x|X|\\*`),q(`XRANGEPLAIN`,`[v=\\s]*(${G[K.XRANGEIDENTIFIER]})(?:\\.(${G[K.XRANGEIDENTIFIER]})(?:\\.(${G[K.XRANGEIDENTIFIER]})(?:${G[K.PRERELEASE]})?${G[K.BUILD]}?)?)?`),q(`XRANGEPLAINLOOSE`,`[v=\\s]*(${G[K.XRANGEIDENTIFIERLOOSE]})(?:\\.(${G[K.XRANGEIDENTIFIERLOOSE]})(?:\\.(${G[K.XRANGEIDENTIFIERLOOSE]})(?:${G[K.PRERELEASELOOSE]})?${G[K.BUILD]}?)?)?`),q(`XRANGE`,`^${G[K.GTLT]}\\s*${G[K.XRANGEPLAIN]}$`),q(`XRANGELOOSE`,`^${G[K.GTLT]}\\s*${G[K.XRANGEPLAINLOOSE]}$`),q(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?`),q(`COERCE`,`${G[K.COERCEPLAIN]}(?:$|[^\\d])`),q(`COERCEFULL`,`${G[K.COERCEPLAIN]}(?:${G[K.PRERELEASE]})?(?:${G[K.BUILD]})?(?:$|[^\\d])`),q(`COERCERTL`,G[K.COERCE],!0),q(`COERCERTLFULL`,G[K.COERCEFULL],!0),q(`LONETILDE`,`(?:~>?)`),q(`TILDETRIM`,`(\\s*)${G[K.LONETILDE]}\\s+`,!0),q(`TILDE`,`^${G[K.LONETILDE]}${G[K.XRANGEPLAIN]}$`),q(`TILDELOOSE`,`^${G[K.LONETILDE]}${G[K.XRANGEPLAINLOOSE]}$`),q(`LONECARET`,`(?:\\^)`),q(`CARETTRIM`,`(\\s*)${G[K.LONECARET]}\\s+`,!0),q(`CARET`,`^${G[K.LONECARET]}${G[K.XRANGEPLAIN]}$`),q(`CARETLOOSE`,`^${G[K.LONECARET]}${G[K.XRANGEPLAINLOOSE]}$`),q(`COMPARATORLOOSE`,`^${G[K.GTLT]}\\s*(${G[K.LOOSEPLAIN]})$|^$`),q(`COMPARATOR`,`^${G[K.GTLT]}\\s*(${G[K.FULLPLAIN]})$|^$`),q(`COMPARATORTRIM`,`(\\s*)${G[K.GTLT]}\\s*(${G[K.LOOSEPLAIN]}|${G[K.XRANGEPLAIN]})`,!0),q(`HYPHENRANGE`,`^\\s*(${G[K.XRANGEPLAIN]})\\s+-\\s+(${G[K.XRANGEPLAIN]})\\s*$`),q(`HYPHENRANGELOOSE`,`^\\s*(${G[K.XRANGEPLAINLOOSE]})\\s+-\\s+(${G[K.XRANGEPLAINLOOSE]})\\s*$`),q(`STAR`,`(<|>)?=?\\s*\\*`),q(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),q(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`);const yg=Object.freeze({loose:!0}),bg=Object.freeze({});function xg(e){return e?typeof e==`object`?e:yg:bg}const Sg=/^\d+$/;var Cg=class e{raw=``;loose=!1;options={};includePrerelease=!1;major=0;minor=0;patch=0;version=``;build=[];prerelease=[];constructor(t,n){let r=xg(n),i;if(t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;i=t.version}else if(typeof t==`string`)i=t;else throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(i.length>256)throw TypeError(`version is longer than 256 characters`);W(`SemVer`,i,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let a=i.trim().match(r.loose?pg[K.LOOSE]:pg[K.FULL]);if(!a)throw TypeError(`Invalid Version: ${i}`);if(this.raw=i,this.major=+a[1],this.minor=+a[2],this.patch=+a[3],this.major>lg||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>lg||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>lg||this.patch<0)throw TypeError(`Invalid patch version`);this.prerelease=a[4]?a[4].split(`.`).map(e=>{if(Sg.test(e)){let t=+e;if(t>=0&&t<lg)return t}return e}):[],this.build=a[5]?a[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}inspect(){return`<SemVer "${this.version}">`}asSemVer(t){return t instanceof e?t:new e(t,this.options)}compare(t){W(`SemVer.compare`,this.version,this.options,t);let n;if(t instanceof e)n=t;else{if(typeof t==`string`&&t===this.version)return 0;n=this.asSemVer(t)}return n.version===this.version?0:this.compareMain(n)||this.comparePre(n)}compareMain(e){let t=this.asSemVer(e);return this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:+(this.patch>t.patch)}comparePre(e){let t=this.asSemVer(e);if(this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{let e=this.prerelease[n],r=t.prerelease[n];if(W(`prerelease compare`,n,e,r),e===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(e===void 0)return-1;if(e!==r)return dg(e,r)}while(++n);return 0}compareBuild(e){let t=this.asSemVer(e),n=0;do{let e=this.build[n],r=t.build[n];if(W(`build compare`,n,e,r),e===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(e===void 0)return-1;if(e!==r)return dg(e,r)}while(++n);return 0}inc(e,t,n){let r=e,i=t;if(r.startsWith(`pre`)){if(!i&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(i){let e=`-${i}`.match(this.options.loose?pg[K.PRERELEASELOOSE]:pg[K.PRERELEASE]);if(!e||e[1]!==i)throw Error(`invalid identifier: ${i}`)}}switch(r){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,i,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,i,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,i,n),this.inc(`pre`,i,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,i,n),this.inc(`pre`,i,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(this.prerelease.length===0)this.prerelease=[e];else{let t=this.prerelease.length;for(;--t>=0;)typeof this.prerelease[t]==`number`&&(this.prerelease[t]=this.prerelease[t]+1,t=-2);if(t===-1){if(i===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(i){let t=[i,e];n===!1&&(t=[i]),dg(this.prerelease[0],i)===0?Number.isNaN(Number(this.prerelease[1]))&&(this.prerelease=t):this.prerelease=t}break}default:throw Error(`invalid increment argument: ${r}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}};function wg(e,t,n){return new Cg(e,n).compare(new Cg(t,n))}function Tg(e,t,n){return wg(e,t,n)===0}function Eg(e,t,n){return wg(e,t,n)>0}function Dg(e,t,n){return wg(e,t,n)>=0}function Og(e,t,n){return wg(e,t,n)<0}function kg(e,t,n){return wg(e,t,n)<=0}function Ag(e,t,n){return wg(e,t,n)!==0}function jg(e,t,n,r){let i=e=>e instanceof Cg?e.version:e;switch(t){case`===`:return e=i(e),n=i(n),e===n;case`!==`:return e=i(e),n=i(n),e!==n;case``:case`=`:case`==`:return Tg(e,n,r);case`!=`:return Ag(e,n,r);case`>`:return Eg(e,n,r);case`>=`:return Dg(e,n,r);case`<`:return Og(e,n,r);case`<=`:return kg(e,n,r);default:throw TypeError(`Invalid operator: ${t}`)}}var Mg=class{max;map;constructor(){this.max=1e3,this.map=/* @__PURE__ */ new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;e!==void 0&&this.delete(e)}this.map.set(e,t)}return this}};const Ng=Symbol(`SemVer ANY`),Pg=/\s+/;var Fg=class e{options={};loose=!1;operator=``;semver=Ng;value=``;static get ANY(){return Ng}constructor(t,n){let r=xg(n);if(t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}let i=String(t).trim().split(Pg).join(` `);W(`comparator`,i,r),this.options=r,this.loose=!!r.loose,this.parse(i),this.value=this.semver===Ng?``:this.operator+this.semver.version,W(`comp`,this)}parse(e){let t=this.options.loose?pg[K.COMPARATORLOOSE]:pg[K.COMPARATOR],n=e.match(t);if(!n)throw TypeError(`Invalid comparator: ${e}`);this.operator=n[1]===void 0?``:n[1],this.operator===`=`&&(this.operator=``),this.semver=n[2]?new Cg(n[2],this.options.loose):Ng}toString(){return this.value}test(e){if(W(`Comparator.test`,e,this.options.loose),this.semver===Ng||e===Ng)return!0;if(typeof e==`string`)try{e=new Cg(e,this.options)}catch{return!1}return jg(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);if(this.operator===``)return this.value===``||new Hg(t.value,n).test(this.value);if(t.operator===``)return t.value===``||new Hg(this.value,n).test(t.semver);let r=xg(n);return r.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!r.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver!==Ng&&t.semver!==Ng&&this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||jg(this.semver,`<`,t.semver,r)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||jg(this.semver,`>`,t.semver,r)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`))}};const Ig=/\s+/g,Lg=/\s+/,Rg=new Mg,zg=e=>e.value===`<0.0.0-0`,Bg=e=>e.value===``,Vg=e=>e!==Fg.ANY;var Hg=class e{raw=``;loose=!1;options={};includePrerelease=!1;set=[];formatted;constructor(t,n){let r=xg(n);if(t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof Fg)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=(typeof t==`string`?t:String(t)).trim().replace(Ig,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length>0),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!zg(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&Bg(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}inspect(){return`<SemVer Range "${this.range}">`}parseRange(e){let t=`${+!!this.options.includePrerelease|(this.options.loose?2:0)}:${e}`,n=Rg.get(t);if(n)return n;let r=this.options.loose,i=r?pg[K.HYPHENRANGELOOSE]:pg[K.HYPHENRANGE];e=e.replace(i,e_(!!this.options.includePrerelease)),W(`hyphen replace`,e),e=e.replace(pg[K.COMPARATORTRIM],`$1$2$3`),W(`comparator trim`,e),e=e.replace(pg[K.TILDETRIM],`$1~`),W(`tilde trim`,e),e=e.replace(pg[K.CARETTRIM],`$1^`),W(`caret trim`,e);let a=e.split(` `).map(e=>Wg(e,this.options)).join(` `).split(Lg).map(e=>$g(e,this.options));r&&(a=a.filter(e=>(W(`loose invalid filter`,e,this.options),!!e.match(pg[K.COMPARATORLOOSE])))),W(`range list`,a);let o=/* @__PURE__ */ new Map,s=a.map(e=>new Fg(e,this.options));for(let e of s){if(zg(e))return[e];o.set(e.value,e)}o.size>1&&o.has(``)&&o.delete(``);let c=[...o.values()];return Rg.set(t,c),c}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>Ug(e,n)&&t.set.some(t=>Ug(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;let t;if(typeof e==`string`)try{t=new Cg(e,this.options)}catch{return!1}else if(e instanceof Cg)t=e;else return!1;for(let e=0;e<this.set.length;e++)if(t_(this.set[e],t,this.options))return!0;return!1}};function Ug(e,t){let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;){let e=i;if(!e)break;n=r.every(n=>e.intersects(n,t)),i=r.pop()}return n}function Wg(e,t){return e=e.replace(pg[K.BUILD],``),W(`comp`,e,t),e=Jg(e,t),W(`caret`,e),e=Kg(e,t),W(`tildes`,e),e=Xg(e,t),W(`xrange`,e),e=Qg(e,t),W(`stars`,e),e}function Gg(e){return!e||e.toLowerCase()===`x`||e===`*`}function Kg(e,t){return e.trim().split(Lg).map(e=>qg(e,t)).join(` `)}function qg(e,t){let n=t.loose?pg[K.TILDELOOSE]:pg[K.TILDE];return e.replace(n,(t,n,r,i,a)=>{W(`tilde`,e,t,n,r,i,a);let o,s=String(n),c=String(r),l=String(i);return Gg(n)?o=``:Gg(r)?o=`>=${s}.0.0 <${Number(s)+1}.0.0-0`:Gg(i)?o=`>=${s}.${c}.0 <${s}.${Number(c)+1}.0-0`:a?(W(`replaceTilde pr`,a),o=`>=${s}.${c}.${l}-${a} <${s}.${Number(c)+1}.0-0`):o=`>=${s}.${c}.${l} <${s}.${Number(c)+1}.0-0`,W(`tilde return`,o),o})}function Jg(e,t){return e.trim().split(Lg).map(e=>Yg(e,t)).join(` `)}function Yg(e,t){W(`caret`,e,t);let n=t.loose?pg[K.CARETLOOSE]:pg[K.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{W(`caret`,e,t,n,i,a,o);let s,c=String(n),l=String(i),u=String(a);return Gg(n)?s=``:Gg(i)?s=`>=${c}.0.0${r} <${Number(c)+1}.0.0-0`:Gg(a)?s=c===`0`?`>=${c}.${l}.0${r} <${c}.${Number(l)+1}.0-0`:`>=${c}.${l}.0${r} <${Number(c)+1}.0.0-0`:o?(W(`replaceCaret pr`,o),s=c===`0`?l===`0`?`>=${c}.${l}.${u}-${o} <${c}.${l}.${Number(u)+1}-0`:`>=${c}.${l}.${u}-${o} <${c}.${Number(l)+1}.0-0`:`>=${c}.${l}.${u}-${o} <${Number(c)+1}.0.0-0`):(W(`no pr`),s=c===`0`?l===`0`?`>=${c}.${l}.${u}${r} <${c}.${l}.${Number(u)+1}-0`:`>=${c}.${l}.${u}${r} <${c}.${Number(l)+1}.0-0`:`>=${c}.${l}.${u} <${Number(c)+1}.0.0-0`),W(`caret return`,s),s})}function Xg(e,t){return W(`replaceXRanges`,e,t),e.split(Lg).map(e=>Zg(e,t)).join(` `)}function Zg(e,t){e=e.trim();let n=t.loose?pg[K.XRANGELOOSE]:pg[K.XRANGE];return e.replace(n,(n,r,i,a,o,s)=>{W(`xRange`,e,n,r,i,a,o,s);let c=Gg(i),l=c||Gg(a),u=l||Gg(o),d=u,f=r,p=String(i),m=String(a),h=String(o),g=s??``;return f===`=`&&d&&(f=``),g=t.includePrerelease?`-0`:``,c?n=f===`>`||f===`<`?`<0.0.0-0`:`*`:f&&d?(l&&(m=0),h=0,f===`>`?(f=`>=`,l?(p=Number(p)+1,m=0,h=0):(m=Number(m)+1,h=0)):f===`<=`&&(f=`<`,l?p=Number(p)+1:m=Number(m)+1),f===`<`&&(g=`-0`),n=`${f+p}.${m}.${h}${g}`):l?n=`>=${p}.0.0${g} <${Number(p)+1}.0.0-0`:u&&(n=`>=${p}.${m}.0${g} <${p}.${Number(m)+1}.0-0`),W(`xRange return`,n),n})}function Qg(e,t){return W(`replaceStars`,e,t),e.trim().replace(pg[K.STAR],``)}function $g(e,t){return W(`replaceGTE0`,e,t),e.trim().replace(pg[t.includePrerelease?K.GTE0PRE:K.GTE0],``)}function e_(e){return(t,n,r,i,a,o,s,c,l,u,d,f)=>{let p=n??``,m=c??``;return p=Gg(r)?``:Gg(i)?`>=${String(r)}.0.0${e?`-0`:``}`:Gg(a)?`>=${String(r)}.${String(i)}.0${e?`-0`:``}`:o?`>=${p}`:`>=${p}${e?`-0`:``}`,m=Gg(l)?``:Gg(u)?`<${Number(l)+1}.0.0-0`:Gg(d)?`<${String(l)}.${Number(u)+1}.0-0`:f?`<=${String(l)}.${String(u)}.${String(d)}-${f}`:e?`<${String(l)}.${String(u)}.${Number(d)+1}-0`:`<=${m}`,`${p} ${m}`.trim()}}function t_(e,t,n){for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++){let r=e[n];if(W(r.semver),!Vg(r.semver))continue;let i=r.semver;if(i.prerelease.length>0&&i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function n_(e,t,n=!1){if(e instanceof Cg)return e;try{return new Cg(e,t)}catch(e){if(!n)return null;throw e}}function r_(e,t,n){try{return new Hg(t,n).test(e)}catch{return!1}}function i_(e,t){let n=n_(e,t);return n?n.version:null}function a_(e,t){try{return new Hg(e,t).range||`*`}catch{return null}}async function o_(e,t={}){let n=await c_(e,t);if(d_(n)){if(t.throw===!1)return n;throw Error(n.error)}let r=n.versions??{},i=p_(n[`dist-tags`]),a=n.time??{},o=e.parsed.rawSpec||`*`,s=Date.now(),c=l_(u_(Object.keys(r),i,o,t.loose),a,t.after);return t.metadata?{name:n.name??e.parsed.name,distTags:i,lastSynced:s,specifier:o,timeCreated:a.created??``,timeModified:a.modified??``,versionsMeta:Object.fromEntries(c.filter(e=>!!r[e]).map(e=>[e,h_(r[e],a[e])]))}:{name:n.name??e.parsed.name,distTags:i,lastSynced:s,specifier:o,versions:c,time:{created:a.created??``,modified:a.modified??``,...Object.fromEntries(c.filter(e=>!!a[e]).map(e=>[e,a[e]]))}}}async function s_(e,t){let n=t.fetch??fetch,r=new URL(e.parsed.escapedName,e.registry),i=new Headers({accept:`application/json`});e.auth?.token?i.set(`authorization`,`Bearer ${e.auth.token}`):e.auth?.basicAuth&&i.set(`authorization`,`Basic ${e.auth.basicAuth}`),e.config.userAgent&&i.set(`user-agent`,e.config.userAgent);let a=await n(r,{headers:i});return a.ok?a.json():m_(e.parsed.name,r,a.status,a.statusText)}async function c_(e,t){let n=f_(t.retry),r=()=>s_(e,t);return n===!1?r():cg(r,n)}function l_(e,t,n){if(!n)return e;let r=Date.parse(n);return Number.isNaN(r)?e:e.filter(e=>{let n=t[e];return n?Date.parse(n)>r:!1})}function u_(e,t,n,r){if(n===`*`)return e;let i=t[n];return i?e.includes(i)?[i]:[]:i_(n)?e:a_(n)?e.filter(e=>r_(e,n,{includePrerelease:!0,loose:r??!1})):e}function d_(e){return`error`in e}function f_(e){return e===!1?!1:typeof e==`number`?{...oh,retries:e}:e??oh}function p_(e){return{latest:e?.latest??``,...e??{}}}function m_(e,t,n,r){return{status:n,name:e,error:`[GET] "${t}": ${n} ${r}`}}function h_(e,t){return{time:t,engines:e.engines,deprecated:e.deprecated,provenance:sh(e),integrity:e.integrity??e.dist?.integrity}}async function g_(e,t={}){let[n]=Jh([e],t);return __(n,t)}function __(e,t){return qh(e.registry)?Km(e.parsed.raw,v_(t)):o_(e,t)}function v_(e){let{cwd:t,env:n,userConfigPath:r,projectConfigPath:i,...a}=e;return a}const y_=!!globalThis.process?.env?.FORCE_NODE_FETCH,b_=!y_&&globalThis.fetch||me;!y_&&globalThis.Blob,!y_&&globalThis.File,!y_&&globalThis.FormData;const x_=!y_&&globalThis.Headers||fe;!y_&&globalThis.Request,!y_&&globalThis.Response;const S_=!y_&&globalThis.AbortController||R,C_=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,w_=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,T_=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function E_(e,t){if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t)D_(e);else return t}function D_(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function O_(e,t={}){if(typeof e!=`string`)return e;if(e[0]===`"`&&e[e.length-1]===`"`&&e.indexOf(`\\`)===-1)return e.slice(1,-1);let n=e.trim();if(n.length<=9)switch(n.toLowerCase()){case`true`:return!0;case`false`:return!1;case`undefined`:return;case`null`:return null;case`nan`:return NaN;case`infinity`:return 1/0;case`-infinity`:return-1/0}if(!T_.test(e)){if(t.strict)throw SyntaxError(`[destr] Invalid JSON`);return e}try{if(C_.test(e)||w_.test(e)){if(t.strict)throw Error(`[destr] Possible prototype pollution`);return JSON.parse(e,E_)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}String.fromCharCode;const k_=/#/g,A_=/&/g,j_=/\//g,M_=/=/g,N_=/\+/g,P_=/%5e/gi,F_=/%60/gi,I_=/%7c/gi,L_=/%20/gi;function R_(e){return encodeURI(``+e).replace(I_,`|`)}function z_(e){return R_(typeof e==`string`?e:JSON.stringify(e)).replace(N_,`%2B`).replace(L_,`+`).replace(k_,`%23`).replace(A_,`%26`).replace(F_,"`").replace(P_,`^`).replace(j_,`%2F`)}function B_(e){return z_(e).replace(M_,`%3D`)}function V_(e=``){try{return decodeURIComponent(``+e)}catch{return``+e}}function H_(e){return V_(e.replace(N_,` `))}function U_(e){return V_(e.replace(N_,` `))}function W_(e=``){let t=/* @__PURE__ */ Object.create(null);e[0]===`?`&&(e=e.slice(1));for(let n of e.split(`&`)){let e=n.match(/([^=]+)=?(.*)/)||[];if(e.length<2)continue;let r=H_(e[1]);if(r===`__proto__`||r===`constructor`)continue;let i=U_(e[2]||``);t[r]===void 0?t[r]=i:Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]}return t}function G_(e,t){return(typeof t==`number`||typeof t==`boolean`)&&(t=String(t)),t?Array.isArray(t)?t.map(t=>`${B_(e)}=${z_(t)}`).join(`&`):`${B_(e)}=${z_(t)}`:B_(e)}function K_(e){return Object.keys(e).filter(t=>e[t]!==void 0).map(t=>G_(t,e[t])).filter(Boolean).join(`&`)}const q_=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,J_=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,Y_=/^([/\\]\s*){2,}[^/\\]/,X_=/\/$|\/\?|\/#/,Z_=/^\.?\//;function Q_(e,t={}){return typeof t==`boolean`&&(t={acceptRelative:t}),t.strict?q_.test(e):J_.test(e)||(t.acceptRelative?Y_.test(e):!1)}function $_(e=``,t){return t?X_.test(e):e.endsWith(`/`)}function ev(e=``,t){if(!t)return($_(e)?e.slice(0,-1):e)||`/`;if(!$_(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);i!==-1&&(n=e.slice(0,i),r=e.slice(i));let[a,...o]=n.split(`?`);return((a.endsWith(`/`)?a.slice(0,-1):a)||`/`)+(o.length>0?`?${o.join(`?`)}`:``)+r}function tv(e=``,t){if(!t)return e.endsWith(`/`)?e:e+`/`;if($_(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);if(i!==-1&&(n=e.slice(0,i),r=e.slice(i),!n))return r;let[a,...o]=n.split(`?`);return a+`/`+(o.length>0?`?${o.join(`?`)}`:``)+r}function nv(e,t){if(iv(t)||Q_(e))return e;let n=ev(t);if(e.startsWith(n)){let t=e[n.length];if(!t||t===`/`||t===`?`)return e}return ov(n,e)}function rv(e,t){let n=cv(e);return n.search=K_({...W_(n.search),...t}),uv(n)}function iv(e){return!e||e===`/`}function av(e){return e&&e!==`/`}function ov(e,...t){let n=e||``;for(let e of t.filter(e=>av(e)))if(n){let t=e.replace(Z_,``);n=tv(n)+t}else n=e;return n}const sv=Symbol.for(`ufo:protocolRelative`);function cv(e=``,t){let n=e.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){let[,e,t=``]=n;return{protocol:e.toLowerCase(),pathname:t,href:e+t,auth:``,host:``,search:``,hash:``}}if(!Q_(e,{acceptRelative:!0}))return t?cv(t+e):lv(e);let[,r=``,i,a=``]=e.replace(/\\/g,`/`).match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,o=``,s=``]=a.match(/([^#/?]*)(.*)?/)||[];r===`file:`&&(s=s.replace(/\/(?=[A-Za-z]:)/,``));let{pathname:c,search:l,hash:u}=lv(s);return{protocol:r.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):``,host:o,pathname:c,search:l,hash:u,[sv]:!r}}function lv(e=``){let[t=``,n=``,r=``]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:n,hash:r}}function uv(e){let t=e.pathname||``,n=e.search?(e.search.startsWith(`?`)?``:`?`)+e.search:``,r=e.hash||``,i=e.auth?e.auth+`@`:``,a=e.host||``;return(e.protocol||e[sv]?(e.protocol||``)+`//`:``)+i+a+t+n+r}var dv=class extends Error{constructor(e,t){super(e,t),this.name=`FetchError`,t?.cause&&!this.cause&&(this.cause=t.cause)}};function fv(e){let t=e.error?.message||e.error?.toString()||``,n=e.request?.method||e.options?.method||`GET`,r=e.request?.url||String(e.request)||`/`,i=new dv(`${`[${n}] ${JSON.stringify(r)}`}: ${e.response?`${e.response.status} ${e.response.statusText}`:`<no response>`}${t?` ${t}`:``}`,e.error?{cause:e.error}:void 0);for(let t of[`request`,`options`,`response`])Object.defineProperty(i,t,{get(){return e[t]}});for(let[t,n]of[[`data`,`_data`],[`status`,`status`],[`statusCode`,`status`],[`statusText`,`statusText`],[`statusMessage`,`statusText`]])Object.defineProperty(i,t,{get(){return e.response&&e.response[n]}});return i}const pv=new Set(Object.freeze([`PATCH`,`POST`,`PUT`,`DELETE`]));function mv(e=`GET`){return pv.has(e.toUpperCase())}function hv(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer||e instanceof FormData||e instanceof URLSearchParams?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}const gv=/* @__PURE__ */ new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]),_v=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function vv(e=``){if(!e)return`json`;let t=e.split(`;`).shift()||``;return _v.test(t)?`json`:t===`text/event-stream`?`stream`:gv.has(t)||t.startsWith(`text/`)?`text`:`blob`}function yv(e,t,n,r){let i=bv(t?.headers??e?.headers,n?.headers,r),a;return(n?.query||n?.params||t?.params||t?.query)&&(a={...n?.params,...n?.query,...t?.params,...t?.query}),{...n,...t,query:a,params:a,headers:i}}function bv(e,t,n){if(!t)return new n(e);let r=new n(t);if(e)for(let[t,i]of Symbol.iterator in e||Array.isArray(e)?e:new n(e))r.set(t,i);return r}async function xv(e,t){if(t){if(Array.isArray(t))for(let n of t)await n(e);else await t(e)}}const Sv=/* @__PURE__ */ new Set([408,409,425,429,500,502,503,504]),Cv=/* @__PURE__ */ new Set([101,204,205,304]);function wv(e={}){let{fetch:t=globalThis.fetch,Headers:n=globalThis.Headers,AbortController:r=globalThis.AbortController}=e;async function i(e){let t=e.error&&e.error.name===`AbortError`&&!e.options.timeout||!1;if(e.options.retry!==!1&&!t){let t;t=typeof e.options.retry==`number`?e.options.retry:+!mv(e.options.method);let n=e.response&&e.response.status||500;if(t>0&&(Array.isArray(e.options.retryStatusCodes)?e.options.retryStatusCodes.includes(n):Sv.has(n))){let n=typeof e.options.retryDelay==`function`?e.options.retryDelay(e):e.options.retryDelay||0;return n>0&&await new Promise(e=>setTimeout(e,n)),a(e.request,{...e.options,retry:t-1})}}let n=fv(e);throw Error.captureStackTrace&&Error.captureStackTrace(n,a),n}let a=async function(a,o={}){let s={request:a,options:yv(a,o,e.defaults,n),response:void 0,error:void 0};if(s.options.method&&(s.options.method=s.options.method.toUpperCase()),s.options.onRequest&&(await xv(s,s.options.onRequest),s.options.headers instanceof n||(s.options.headers=new n(s.options.headers||{}))),typeof s.request==`string`&&(s.options.baseURL&&(s.request=nv(s.request,s.options.baseURL)),s.options.query&&(s.request=rv(s.request,s.options.query),delete s.options.query),`query`in s.options&&delete s.options.query,`params`in s.options&&delete s.options.params),s.options.body&&mv(s.options.method)){if(hv(s.options.body)){let e=s.options.headers.get(`content-type`);typeof s.options.body!=`string`&&(s.options.body=e===`application/x-www-form-urlencoded`?new URLSearchParams(s.options.body).toString():JSON.stringify(s.options.body)),e||s.options.headers.set(`content-type`,`application/json`),s.options.headers.has(`accept`)||s.options.headers.set(`accept`,`application/json`)}else(`pipeTo`in s.options.body&&typeof s.options.body.pipeTo==`function`||typeof s.options.body.pipe==`function`)&&(`duplex`in s.options||(s.options.duplex=`half`))}let c;if(!s.options.signal&&s.options.timeout){let e=new r;c=setTimeout(()=>{let t=/* @__PURE__ */ Error(`[TimeoutError]: The operation was aborted due to timeout`);t.name=`TimeoutError`,t.code=23,e.abort(t)},s.options.timeout),s.options.signal=e.signal}try{s.response=await t(s.request,s.options)}catch(e){return s.error=e,s.options.onRequestError&&await xv(s,s.options.onRequestError),await i(s)}finally{c&&clearTimeout(c)}if((s.response.body||s.response._bodyInit)&&!Cv.has(s.response.status)&&s.options.method!==`HEAD`){let e=(s.options.parseResponse?`json`:s.options.responseType)||vv(s.response.headers.get(`content-type`)||``);switch(e){case`json`:{let e=await s.response.text(),t=s.options.parseResponse||O_;s.response._data=t(e);break}case`stream`:s.response._data=s.response.body||s.response._bodyInit;break;default:s.response._data=await s.response[e]()}}return s.options.onResponse&&await xv(s,s.options.onResponse),!s.options.ignoreResponseError&&s.response.status>=400&&s.response.status<600?(s.options.onResponseError&&await xv(s,s.options.onResponseError),await i(s)):s.response},o=async function(e,t){return(await a(e,t))._data};return o.raw=a,o.native=(...e)=>t(...e),o.create=(t={},n={})=>wv({...e,...n,defaults:{...e.defaults,...n.defaults,...t}}),o}function Tv(){if(!JSON.parse(process.env.FETCH_KEEP_ALIVE||`false`))return b_;let e={keepAlive:!0},t=new I.Agent(e),n=new de.Agent(e),r={agent(e){return e.protocol===`http:`?t:n}};return function(e,t){return b_(e,{...r,...t})}}const Ev=globalThis.fetch?(...e)=>globalThis.fetch(...e):Tv();wv({fetch:Ev,Headers:globalThis.Headers||x_,AbortController:globalThis.AbortController||S_});const Dv=/^(?:( )+|\t+)/,Ov=`space`;function kv(e,t,n){return e&&t===Ov&&n===1}function Av(e,t){let n=/* @__PURE__ */ new Map,r=0,i,a;for(let o of e.split(/\n/g)){if(!o)continue;let e=o.match(Dv);if(e===null)r=0,i=``;else{let o=e[0].length,s=e[1]?Ov:`tab`;if(kv(t,s,o))continue;s!==i&&(r=0),i=s;let c=1,l=0,u=o-r;if(r=o,u===0)c=0,l=1;else{let e=Math.abs(u);if(kv(t,s,e))continue;a=jv(s,e)}let d=n.get(a);n.set(a,d===void 0?[1,0]:[d[0]+c,d[1]+l])}}return n}function jv(e,t){return(e===Ov?`s`:`t`)+String(t)}function Mv(e){return{type:e[0]===`s`?Ov:`tab`,amount:Number(e.slice(1))}}function Nv(e){let t,n=0,r=0;for(let[i,[a,o]]of e)(a>n||a===n&&o>r)&&(n=a,r=o,t=i);return t}function Pv(e,t){return(e===Ov?` `:` `).repeat(t)}function Fv(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);let t=Av(e,!0);t.size===0&&(t=Av(e,!1));let n=Nv(t),r,i=0,a=``;return n!==void 0&&({type:r,amount:i}=Mv(n),a=Pv(r,i)),{amount:i,type:r,indent:a}}function Iv(e,t){return c(e)?e:d(t||`.`,e)}function Lv(e,t){let{last:n,cwd:r}=t||{},i=Iv(e,r),a=Iv(n||`/`,r),o,c=[];for(;o!==a&&(c.push(i),i=s(o=i),i!==o););return c}function Rv(e,t){let n,r;for(n of Lv(t&&t.cwd||``,t))if(r=l(n,e),p(r))return r}
181
181
  /* istanbul ignore next */
182
- const Rv=2**53-1||0x1fffffffffffff,zv=/^\d+$/;function Bv(e,t){if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let n=zv.test(String(e)),r=zv.test(String(t));return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1}const J=typeof y==`object`&&y.env&&y.env.NODE_DEBUG&&/\bsemver\b/i.test(y.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{},Vv=[],Hv=[],Y=[],Uv=[],X={};let Wv=0;const Gv=`[a-zA-Z0-9-]`,Kv=[[`\\s`,1],[`\\d`,256],[Gv,250]];function qv(e){for(let[t,n]of Kv)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e}function Z(e,t,n=!1){let r=qv(t),i=Wv++;J(e,i,t),X[e]=i,Y[i]=t,Uv[i]=r,Vv[i]=new RegExp(t,n?`g`:void 0),Hv[i]=new RegExp(r,n?`g`:void 0)}Z(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),Z(`NUMERICIDENTIFIERLOOSE`,`\\d+`),Z(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${Gv}*`),Z(`MAINVERSION`,`(${Y[X.NUMERICIDENTIFIER]})\\.(${Y[X.NUMERICIDENTIFIER]})\\.(${Y[X.NUMERICIDENTIFIER]})`),Z(`MAINVERSIONLOOSE`,`(${Y[X.NUMERICIDENTIFIERLOOSE]})\\.(${Y[X.NUMERICIDENTIFIERLOOSE]})\\.(${Y[X.NUMERICIDENTIFIERLOOSE]})`),Z(`PRERELEASEIDENTIFIER`,`(?:${Y[X.NONNUMERICIDENTIFIER]}|${Y[X.NUMERICIDENTIFIER]})`),Z(`PRERELEASEIDENTIFIERLOOSE`,`(?:${Y[X.NONNUMERICIDENTIFIER]}|${Y[X.NUMERICIDENTIFIERLOOSE]})`),Z(`PRERELEASE`,`(?:-(${Y[X.PRERELEASEIDENTIFIER]}(?:\\.${Y[X.PRERELEASEIDENTIFIER]})*))`),Z(`PRERELEASELOOSE`,`(?:-?(${Y[X.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Y[X.PRERELEASEIDENTIFIERLOOSE]})*))`),Z(`BUILDIDENTIFIER`,`${Gv}+`),Z(`BUILD`,`(?:\\+(${Y[X.BUILDIDENTIFIER]}(?:\\.${Y[X.BUILDIDENTIFIER]})*))`),Z(`FULLPLAIN`,`v?${Y[X.MAINVERSION]}${Y[X.PRERELEASE]}?${Y[X.BUILD]}?`),Z(`FULL`,`^${Y[X.FULLPLAIN]}$`),Z(`LOOSEPLAIN`,`[v=\\s]*${Y[X.MAINVERSIONLOOSE]}${Y[X.PRERELEASELOOSE]}?${Y[X.BUILD]}?`),Z(`LOOSE`,`^${Y[X.LOOSEPLAIN]}$`),Z(`GTLT`,`((?:<|>)?=?)`),Z(`XRANGEIDENTIFIERLOOSE`,`${Y[X.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),Z(`XRANGEIDENTIFIER`,`${Y[X.NUMERICIDENTIFIER]}|x|X|\\*`),Z(`XRANGEPLAIN`,`[v=\\s]*(${Y[X.XRANGEIDENTIFIER]})(?:\\.(${Y[X.XRANGEIDENTIFIER]})(?:\\.(${Y[X.XRANGEIDENTIFIER]})(?:${Y[X.PRERELEASE]})?${Y[X.BUILD]}?)?)?`),Z(`XRANGEPLAINLOOSE`,`[v=\\s]*(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:${Y[X.PRERELEASELOOSE]})?${Y[X.BUILD]}?)?)?`),Z(`XRANGE`,`^${Y[X.GTLT]}\\s*${Y[X.XRANGEPLAIN]}$`),Z(`XRANGELOOSE`,`^${Y[X.GTLT]}\\s*${Y[X.XRANGEPLAINLOOSE]}$`),Z(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?`),Z(`COERCE`,`${Y[X.COERCEPLAIN]}(?:$|[^\\d])`),Z(`COERCEFULL`,`${Y[X.COERCEPLAIN]}(?:${Y[X.PRERELEASE]})?(?:${Y[X.BUILD]})?(?:$|[^\\d])`),Z(`COERCERTL`,Y[X.COERCE],!0),Z(`COERCERTLFULL`,Y[X.COERCEFULL],!0),Z(`LONETILDE`,`(?:~>?)`),Z(`TILDETRIM`,`(\\s*)${Y[X.LONETILDE]}\\s+`,!0),Z(`TILDE`,`^${Y[X.LONETILDE]}${Y[X.XRANGEPLAIN]}$`),Z(`TILDELOOSE`,`^${Y[X.LONETILDE]}${Y[X.XRANGEPLAINLOOSE]}$`),Z(`LONECARET`,`(?:\\^)`),Z(`CARETTRIM`,`(\\s*)${Y[X.LONECARET]}\\s+`,!0),Z(`CARET`,`^${Y[X.LONECARET]}${Y[X.XRANGEPLAIN]}$`),Z(`CARETLOOSE`,`^${Y[X.LONECARET]}${Y[X.XRANGEPLAINLOOSE]}$`),Z(`COMPARATORLOOSE`,`^${Y[X.GTLT]}\\s*(${Y[X.LOOSEPLAIN]})$|^$`),Z(`COMPARATOR`,`^${Y[X.GTLT]}\\s*(${Y[X.FULLPLAIN]})$|^$`),Z(`COMPARATORTRIM`,`(\\s*)${Y[X.GTLT]}\\s*(${Y[X.LOOSEPLAIN]}|${Y[X.XRANGEPLAIN]})`,!0),Z(`HYPHENRANGE`,`^\\s*(${Y[X.XRANGEPLAIN]})\\s+-\\s+(${Y[X.XRANGEPLAIN]})\\s*$`),Z(`HYPHENRANGELOOSE`,`^\\s*(${Y[X.XRANGEPLAINLOOSE]})\\s+-\\s+(${Y[X.XRANGEPLAINLOOSE]})\\s*$`),Z(`STAR`,`(<|>)?=?\\s*\\*`),Z(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),Z(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`);const Jv=Object.freeze({loose:!0}),Yv=Object.freeze({});function Xv(e){return e?typeof e==`object`?e:Jv:Yv}const Zv=/^\d+$/;var Qv=class e{raw=``;loose=!1;options={};includePrerelease=!1;major=0;minor=0;patch=0;version=``;build=[];prerelease=[];constructor(t,n){let r=Xv(n),i;if(t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;i=t.version}else if(typeof t==`string`)i=t;else throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(i.length>256)throw TypeError(`version is longer than 256 characters`);J(`SemVer`,i,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let a=i.trim().match(r.loose?Hv[X.LOOSE]:Hv[X.FULL]);if(!a)throw TypeError(`Invalid Version: ${i}`);if(this.raw=i,this.major=+a[1],this.minor=+a[2],this.patch=+a[3],this.major>Rv||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>Rv||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>Rv||this.patch<0)throw TypeError(`Invalid patch version`);this.prerelease=a[4]?a[4].split(`.`).map(e=>{if(Zv.test(e)){let t=+e;if(t>=0&&t<Rv)return t}return e}):[],this.build=a[5]?a[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}inspect(){return`<SemVer "${this.version}">`}asSemVer(t){return t instanceof e?t:new e(t,this.options)}compare(t){J(`SemVer.compare`,this.version,this.options,t);let n;if(t instanceof e)n=t;else{if(typeof t==`string`&&t===this.version)return 0;n=this.asSemVer(t)}return n.version===this.version?0:this.compareMain(n)||this.comparePre(n)}compareMain(e){let t=this.asSemVer(e);return this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:+(this.patch>t.patch)}comparePre(e){let t=this.asSemVer(e);if(this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{let e=this.prerelease[n],r=t.prerelease[n];if(J(`prerelease compare`,n,e,r),e===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(e===void 0)return-1;if(e!==r)return Bv(e,r)}while(++n);return 0}compareBuild(e){let t=this.asSemVer(e),n=0;do{let e=this.build[n],r=t.build[n];if(J(`build compare`,n,e,r),e===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(e===void 0)return-1;if(e!==r)return Bv(e,r)}while(++n);return 0}inc(e,t,n){let r=e,i=t;if(r.startsWith(`pre`)){if(!i&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(i){let e=`-${i}`.match(this.options.loose?Hv[X.PRERELEASELOOSE]:Hv[X.PRERELEASE]);if(!e||e[1]!==i)throw Error(`invalid identifier: ${i}`)}}switch(r){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,i,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,i,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,i,n),this.inc(`pre`,i,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,i,n),this.inc(`pre`,i,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(this.prerelease.length===0)this.prerelease=[e];else{let t=this.prerelease.length;for(;--t>=0;)typeof this.prerelease[t]==`number`&&(this.prerelease[t]=this.prerelease[t]+1,t=-2);if(t===-1){if(i===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(i){let t=[i,e];n===!1&&(t=[i]),Bv(this.prerelease[0],i)===0?Number.isNaN(Number(this.prerelease[1]))&&(this.prerelease=t):this.prerelease=t}break}default:throw Error(`invalid increment argument: ${r}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}};function $v(e,t,n){return new Qv(e,n).compare(new Qv(t,n))}function ey(e,t,n){return $v(e,t,n)===0}function ty(e,t,n){return $v(e,t,n)>0}function ny(e,t,n){return $v(e,t,n)>=0}function ry(e,t,n){return $v(e,t,n)<0}function iy(e,t,n){return $v(e,t,n)<=0}function ay(e,t,n){return $v(e,t,n)!==0}function oy(e,t,n,r){let i=e=>e instanceof Qv?e.version:e;switch(t){case`===`:return e=i(e),n=i(n),e===n;case`!==`:return e=i(e),n=i(n),e!==n;case``:case`=`:case`==`:return ey(e,n,r);case`!=`:return ay(e,n,r);case`>`:return ty(e,n,r);case`>=`:return ny(e,n,r);case`<`:return ry(e,n,r);case`<=`:return iy(e,n,r);default:throw TypeError(`Invalid operator: ${t}`)}}var sy=class{max;map;constructor(){this.max=1e3,this.map=/* @__PURE__ */ new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;e!==void 0&&this.delete(e)}this.map.set(e,t)}return this}};const cy=Symbol(`SemVer ANY`),ly=/\s+/;var uy=class e{options={};loose=!1;operator=``;semver=cy;value=``;static get ANY(){return cy}constructor(t,n){let r=Xv(n);if(t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}let i=String(t).trim().split(ly).join(` `);J(`comparator`,i,r),this.options=r,this.loose=!!r.loose,this.parse(i),this.value=this.semver===cy?``:this.operator+this.semver.version,J(`comp`,this)}parse(e){let t=this.options.loose?Hv[X.COMPARATORLOOSE]:Hv[X.COMPARATOR],n=e.match(t);if(!n)throw TypeError(`Invalid comparator: ${e}`);this.operator=n[1]===void 0?``:n[1],this.operator===`=`&&(this.operator=``),this.semver=n[2]?new Qv(n[2],this.options.loose):cy}toString(){return this.value}test(e){if(J(`Comparator.test`,e,this.options.loose),this.semver===cy||e===cy)return!0;if(typeof e==`string`)try{e=new Qv(e,this.options)}catch{return!1}return oy(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);if(this.operator===``)return this.value===``||new _y(t.value,n).test(this.value);if(t.operator===``)return t.value===``||new _y(this.value,n).test(t.semver);let r=Xv(n);return r.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!r.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver!==cy&&t.semver!==cy&&this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||oy(this.semver,`<`,t.semver,r)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||oy(this.semver,`>`,t.semver,r)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`))}};const dy=/\s+/g,fy=/\s+/,py=new sy,my=e=>e.value===`<0.0.0-0`,hy=e=>e.value===``,gy=e=>e!==uy.ANY;var _y=class e{raw=``;loose=!1;options={};includePrerelease=!1;set=[];formatted;constructor(t,n){let r=Xv(n);if(t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof uy)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=(typeof t==`string`?t:String(t)).trim().replace(dy,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length>0),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!my(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&hy(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}inspect(){return`<SemVer Range "${this.range}">`}parseRange(e){let t=`${+!!this.options.includePrerelease|(this.options.loose?2:0)}:${e}`,n=py.get(t);if(n)return n;let r=this.options.loose,i=r?Hv[X.HYPHENRANGELOOSE]:Hv[X.HYPHENRANGE];e=e.replace(i,ky(!!this.options.includePrerelease)),J(`hyphen replace`,e),e=e.replace(Hv[X.COMPARATORTRIM],`$1$2$3`),J(`comparator trim`,e),e=e.replace(Hv[X.TILDETRIM],`$1~`),J(`tilde trim`,e),e=e.replace(Hv[X.CARETTRIM],`$1^`),J(`caret trim`,e);let a=e.split(` `).map(e=>yy(e,this.options)).join(` `).split(fy).map(e=>Oy(e,this.options));r&&(a=a.filter(e=>(J(`loose invalid filter`,e,this.options),!!e.match(Hv[X.COMPARATORLOOSE])))),J(`range list`,a);let o=/* @__PURE__ */ new Map,s=a.map(e=>new uy(e,this.options));for(let e of s){if(my(e))return[e];o.set(e.value,e)}o.size>1&&o.has(``)&&o.delete(``);let c=[...o.values()];return py.set(t,c),c}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>vy(e,n)&&t.set.some(t=>vy(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;let t;if(typeof e==`string`)try{t=new Qv(e,this.options)}catch{return!1}else if(e instanceof Qv)t=e;else return!1;for(let e=0;e<this.set.length;e++)if(Ay(this.set[e],t,this.options))return!0;return!1}};function vy(e,t){let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;){let e=i;if(!e)break;n=r.every(n=>e.intersects(n,t)),i=r.pop()}return n}function yy(e,t){return e=e.replace(Hv[X.BUILD],``),J(`comp`,e,t),e=Cy(e,t),J(`caret`,e),e=xy(e,t),J(`tildes`,e),e=Ty(e,t),J(`xrange`,e),e=Dy(e,t),J(`stars`,e),e}function by(e){return!e||e.toLowerCase()===`x`||e===`*`}function xy(e,t){return e.trim().split(fy).map(e=>Sy(e,t)).join(` `)}function Sy(e,t){let n=t.loose?Hv[X.TILDELOOSE]:Hv[X.TILDE];return e.replace(n,(t,n,r,i,a)=>{J(`tilde`,e,t,n,r,i,a);let o,s=String(n),c=String(r),l=String(i);return by(n)?o=``:by(r)?o=`>=${s}.0.0 <${Number(s)+1}.0.0-0`:by(i)?o=`>=${s}.${c}.0 <${s}.${Number(c)+1}.0-0`:a?(J(`replaceTilde pr`,a),o=`>=${s}.${c}.${l}-${a} <${s}.${Number(c)+1}.0-0`):o=`>=${s}.${c}.${l} <${s}.${Number(c)+1}.0-0`,J(`tilde return`,o),o})}function Cy(e,t){return e.trim().split(fy).map(e=>wy(e,t)).join(` `)}function wy(e,t){J(`caret`,e,t);let n=t.loose?Hv[X.CARETLOOSE]:Hv[X.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{J(`caret`,e,t,n,i,a,o);let s,c=String(n),l=String(i),u=String(a);return by(n)?s=``:by(i)?s=`>=${c}.0.0${r} <${Number(c)+1}.0.0-0`:by(a)?s=c===`0`?`>=${c}.${l}.0${r} <${c}.${Number(l)+1}.0-0`:`>=${c}.${l}.0${r} <${Number(c)+1}.0.0-0`:o?(J(`replaceCaret pr`,o),s=c===`0`?l===`0`?`>=${c}.${l}.${u}-${o} <${c}.${l}.${Number(u)+1}-0`:`>=${c}.${l}.${u}-${o} <${c}.${Number(l)+1}.0-0`:`>=${c}.${l}.${u}-${o} <${Number(c)+1}.0.0-0`):(J(`no pr`),s=c===`0`?l===`0`?`>=${c}.${l}.${u}${r} <${c}.${l}.${Number(u)+1}-0`:`>=${c}.${l}.${u}${r} <${c}.${Number(l)+1}.0-0`:`>=${c}.${l}.${u} <${Number(c)+1}.0.0-0`),J(`caret return`,s),s})}function Ty(e,t){return J(`replaceXRanges`,e,t),e.split(fy).map(e=>Ey(e,t)).join(` `)}function Ey(e,t){e=e.trim();let n=t.loose?Hv[X.XRANGELOOSE]:Hv[X.XRANGE];return e.replace(n,(n,r,i,a,o,s)=>{J(`xRange`,e,n,r,i,a,o,s);let c=by(i),l=c||by(a),u=l||by(o),d=u,f=r,p=String(i),m=String(a),h=String(o),g=s??``;return f===`=`&&d&&(f=``),g=t.includePrerelease?`-0`:``,c?n=f===`>`||f===`<`?`<0.0.0-0`:`*`:f&&d?(l&&(m=0),h=0,f===`>`?(f=`>=`,l?(p=Number(p)+1,m=0,h=0):(m=Number(m)+1,h=0)):f===`<=`&&(f=`<`,l?p=Number(p)+1:m=Number(m)+1),f===`<`&&(g=`-0`),n=`${f+p}.${m}.${h}${g}`):l?n=`>=${p}.0.0${g} <${Number(p)+1}.0.0-0`:u&&(n=`>=${p}.${m}.0${g} <${p}.${Number(m)+1}.0-0`),J(`xRange return`,n),n})}function Dy(e,t){return J(`replaceStars`,e,t),e.trim().replace(Hv[X.STAR],``)}function Oy(e,t){return J(`replaceGTE0`,e,t),e.trim().replace(Hv[t.includePrerelease?X.GTE0PRE:X.GTE0],``)}function ky(e){return(t,n,r,i,a,o,s,c,l,u,d,f)=>{let p=n??``,m=c??``;return p=by(r)?``:by(i)?`>=${String(r)}.0.0${e?`-0`:``}`:by(a)?`>=${String(r)}.${String(i)}.0${e?`-0`:``}`:o?`>=${p}`:`>=${p}${e?`-0`:``}`,m=by(l)?``:by(u)?`<${Number(l)+1}.0.0-0`:by(d)?`<${String(l)}.${Number(u)+1}.0-0`:f?`<=${String(l)}.${String(u)}.${String(d)}-${f}`:e?`<${String(l)}.${String(u)}.${Number(d)+1}-0`:`<=${m}`,`${p} ${m}`.trim()}}function Ay(e,t,n){for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++){let r=e[n];if(J(r.semver),!gy(r.semver))continue;let i=r.semver;if(i.prerelease.length>0&&i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function jy(e,t,n){try{return new _y(t,n).test(e)}catch{return!1}}function My(e,t){let n=new _y(e,t),r=new Qv(`0.0.0`);if(n.test(r)||(r=new Qv(`0.0.0-0`),n.test(r)))return r;r=null;for(let e=0;e<n.set.length;++e){let t=n.set[e],i=null;t.forEach(e=>{let t=new Qv(e.semver instanceof Qv?e.semver.version:`0.0.0`);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!i||ty(t,i))&&(i=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),i&&(!r||ty(r,i))&&(r=i)}return r&&n.test(r)?r:null}function Ny(e,t){try{return new _y(e,t).range||`*`}catch{return null}}var Q=/* @__PURE__ */ L((e=>{let t=Symbol.for(`yaml.alias`),n=Symbol.for(`yaml.document`),r=Symbol.for(`yaml.map`),i=Symbol.for(`yaml.pair`),a=Symbol.for(`yaml.scalar`),o=Symbol.for(`yaml.seq`),s=Symbol.for(`yaml.node.type`),c=e=>!!e&&typeof e==`object`&&e[s]===t,l=e=>!!e&&typeof e==`object`&&e[s]===n,u=e=>!!e&&typeof e==`object`&&e[s]===r,d=e=>!!e&&typeof e==`object`&&e[s]===i,f=e=>!!e&&typeof e==`object`&&e[s]===a,p=e=>!!e&&typeof e==`object`&&e[s]===o;function m(e){if(e&&typeof e==`object`)switch(e[s]){case r:case o:return!0}return!1}e.ALIAS=t,e.DOC=n,e.MAP=r,e.NODE_TYPE=s,e.PAIR=i,e.SCALAR=a,e.SEQ=o,e.hasAnchor=e=>(f(e)||m(e))&&!!e.anchor,e.isAlias=c,e.isCollection=m,e.isDocument=l,e.isMap=u,e.isNode=function(e){if(e&&typeof e==`object`)switch(e[s]){case t:case r:case a:case o:return!0}return!1},e.isPair=d,e.isScalar=f,e.isSeq=p})),Py=/* @__PURE__ */ L((e=>{var t=Q();let n=Symbol(`break visit`),r=Symbol(`skip children`),i=Symbol(`remove node`);function a(e,n){let r=l(n);t.isDocument(e)?o(null,e.contents,r,Object.freeze([e]))===i&&(e.contents=null):o(null,e,r,Object.freeze([]))}a.BREAK=n,a.SKIP=r,a.REMOVE=i;function o(e,r,a,s){let c=u(e,r,a,s);if(t.isNode(c)||t.isPair(c))return d(e,s,c),o(e,c,a,s);if(typeof c!=`symbol`){if(t.isCollection(r)){s=Object.freeze(s.concat(r));for(let e=0;e<r.items.length;++e){let t=o(e,r.items[e],a,s);if(typeof t==`number`)e=t-1;else if(t===n)return n;else t===i&&(r.items.splice(e,1),--e)}}else if(t.isPair(r)){s=Object.freeze(s.concat(r));let e=o(`key`,r.key,a,s);if(e===n)return n;e===i&&(r.key=null);let t=o(`value`,r.value,a,s);if(t===n)return n;t===i&&(r.value=null)}}return c}async function s(e,n){let r=l(n);t.isDocument(e)?await c(null,e.contents,r,Object.freeze([e]))===i&&(e.contents=null):await c(null,e,r,Object.freeze([]))}s.BREAK=n,s.SKIP=r,s.REMOVE=i;async function c(e,r,a,o){let s=await u(e,r,a,o);if(t.isNode(s)||t.isPair(s))return d(e,o,s),c(e,s,a,o);if(typeof s!=`symbol`){if(t.isCollection(r)){o=Object.freeze(o.concat(r));for(let e=0;e<r.items.length;++e){let t=await c(e,r.items[e],a,o);if(typeof t==`number`)e=t-1;else if(t===n)return n;else t===i&&(r.items.splice(e,1),--e)}}else if(t.isPair(r)){o=Object.freeze(o.concat(r));let e=await c(`key`,r.key,a,o);if(e===n)return n;e===i&&(r.key=null);let t=await c(`value`,r.value,a,o);if(t===n)return n;t===i&&(r.value=null)}}return s}function l(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function u(e,n,r,i){if(typeof r==`function`)return r(e,n,i);if(t.isMap(n))return r.Map?.(e,n,i);if(t.isSeq(n))return r.Seq?.(e,n,i);if(t.isPair(n))return r.Pair?.(e,n,i);if(t.isScalar(n))return r.Scalar?.(e,n,i);if(t.isAlias(n))return r.Alias?.(e,n,i)}function d(e,n,r){let i=n[n.length-1];if(t.isCollection(i))i.items[e]=r;else if(t.isPair(i))e===`key`?i.key=r:i.value=r;else if(t.isDocument(i))i.contents=r;else{let e=t.isAlias(i)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}e.visit=a,e.visitAsync=s})),Fy=/* @__PURE__ */ L((e=>{var t=Q(),n=Py();let r={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},i=e=>e.replace(/[!,[\]{}]/g,e=>r[e]);var a=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+i(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],i=Object.entries(this.tags),a;if(e&&i.length>0&&t.isNode(e.contents)){let r={};n.visit(e.contents,(e,n)=>{t.isNode(n)&&n.tag&&(r[n.tag]=!0)}),a=Object.keys(r)}else a=[];for(let[t,n]of i)t===`!!`&&n===`tag:yaml.org,2002:`||e&&!a.some(e=>e.startsWith(n))||r.push(`%TAG ${t} ${n}`);return r.join(`
183
- `)}};a.defaultYaml={explicit:!1,version:`1.2`},a.defaultTags={"!!":`tag:yaml.org,2002:`},e.Directives=a})),Iy=/* @__PURE__ */ L((e=>{var t=Q(),n=Py();function r(e){let t=/* @__PURE__ */ new Set;return n.visit(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function i(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}e.anchorIsValid=function(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0},e.anchorNames=r,e.createNodeAnchors=function(e,n){let a=[],o=/* @__PURE__ */ new Map,s=null;return{onAnchor:t=>{a.push(t),s??=r(e);let o=i(n,s);return s.add(o),o},setAnchors:()=>{for(let e of a){let n=o.get(e);if(typeof n==`object`&&n.anchor&&(t.isScalar(n.node)||t.isCollection(n.node)))n.node.anchor=n.anchor;else{let t=/* @__PURE__ */ Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:o}},e.findNewAnchor=i})),Ly=/* @__PURE__ */ L((e=>{function t(e,n,r,i){if(i&&typeof i==`object`){if(Array.isArray(i))for(let n=0,r=i.length;n<r;++n){let r=i[n],a=t(e,i,String(n),r);a===void 0?delete i[n]:a!==r&&(i[n]=a)}else if(i instanceof Map)for(let n of Array.from(i.keys())){let r=i.get(n),a=t(e,i,n,r);a===void 0?i.delete(n):a!==r&&i.set(n,a)}else if(i instanceof Set)for(let n of Array.from(i)){let r=t(e,i,n,n);r===void 0?i.delete(n):r!==n&&(i.delete(n),i.add(r))}else for(let[n,r]of Object.entries(i)){let a=t(e,i,n,r);a===void 0?delete i[n]:a!==r&&(i[n]=a)}}return e.call(n,r,i)}e.applyReviver=t})),Ry=/* @__PURE__ */ L((e=>{var t=Q();function n(e,r,i){if(Array.isArray(e))return e.map((e,t)=>n(e,String(t),i));if(e&&typeof e.toJSON==`function`){if(!i||!t.hasAnchor(e))return e.toJSON(r,i);let n={aliasCount:0,count:1,res:void 0};i.anchors.set(e,n),i.onCreate=e=>{n.res=e,delete i.onCreate};let a=e.toJSON(r,i);return i.onCreate&&i.onCreate(a),a}return typeof e==`bigint`&&!i?.keep?Number(e):e}e.toJS=n})),zy=/* @__PURE__ */ L((e=>{var t=Ly(),n=Q(),r=Ry();e.NodeBase=class{constructor(e){Object.defineProperty(this,n.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:i,maxAliasCount:a,onAnchor:o,reviver:s}={}){if(!n.isDocument(e))throw TypeError(`A document argument is required`);let c={anchors:/* @__PURE__ */ new Map,doc:e,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof a==`number`?a:100},l=r.toJS(this,``,c);if(typeof o==`function`)for(let{count:e,res:t}of c.anchors.values())o(t,e);return typeof s==`function`?t.applyReviver(s,{"":l},``,l):l}}})),By=/* @__PURE__ */ L((e=>{var t=Iy(),n=Py(),r=Q(),i=zy(),a=Ry(),o=class extends i.NodeBase{constructor(e){super(r.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let i;t?.aliasResolveCache?i=t.aliasResolveCache:(i=[],n.visit(e,{Node:(e,t)=>{(r.isAlias(t)||r.hasAnchor(t))&&i.push(t)}}),t&&(t.aliasResolveCache=i));let o;for(let e of i){if(e===this)break;e.anchor===this.source&&(o=e)}if(o&&t){let{anchors:e,doc:n,maxAliasCount:r}=t,i=e.get(o);
182
+ const zv=2**53-1||0x1fffffffffffff,Bv=/^\d+$/;function Vv(e,t){if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let n=Bv.test(String(e)),r=Bv.test(String(t));return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1}const J=typeof y==`object`&&y.env&&y.env.NODE_DEBUG&&/\bsemver\b/i.test(y.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{},Hv=[],Uv=[],Y=[],Wv=[],X={};let Gv=0;const Kv=`[a-zA-Z0-9-]`,qv=[[`\\s`,1],[`\\d`,256],[Kv,250]];function Jv(e){for(let[t,n]of qv)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e}function Z(e,t,n=!1){let r=Jv(t),i=Gv++;J(e,i,t),X[e]=i,Y[i]=t,Wv[i]=r,Hv[i]=new RegExp(t,n?`g`:void 0),Uv[i]=new RegExp(r,n?`g`:void 0)}Z(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),Z(`NUMERICIDENTIFIERLOOSE`,`\\d+`),Z(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${Kv}*`),Z(`MAINVERSION`,`(${Y[X.NUMERICIDENTIFIER]})\\.(${Y[X.NUMERICIDENTIFIER]})\\.(${Y[X.NUMERICIDENTIFIER]})`),Z(`MAINVERSIONLOOSE`,`(${Y[X.NUMERICIDENTIFIERLOOSE]})\\.(${Y[X.NUMERICIDENTIFIERLOOSE]})\\.(${Y[X.NUMERICIDENTIFIERLOOSE]})`),Z(`PRERELEASEIDENTIFIER`,`(?:${Y[X.NONNUMERICIDENTIFIER]}|${Y[X.NUMERICIDENTIFIER]})`),Z(`PRERELEASEIDENTIFIERLOOSE`,`(?:${Y[X.NONNUMERICIDENTIFIER]}|${Y[X.NUMERICIDENTIFIERLOOSE]})`),Z(`PRERELEASE`,`(?:-(${Y[X.PRERELEASEIDENTIFIER]}(?:\\.${Y[X.PRERELEASEIDENTIFIER]})*))`),Z(`PRERELEASELOOSE`,`(?:-?(${Y[X.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Y[X.PRERELEASEIDENTIFIERLOOSE]})*))`),Z(`BUILDIDENTIFIER`,`${Kv}+`),Z(`BUILD`,`(?:\\+(${Y[X.BUILDIDENTIFIER]}(?:\\.${Y[X.BUILDIDENTIFIER]})*))`),Z(`FULLPLAIN`,`v?${Y[X.MAINVERSION]}${Y[X.PRERELEASE]}?${Y[X.BUILD]}?`),Z(`FULL`,`^${Y[X.FULLPLAIN]}$`),Z(`LOOSEPLAIN`,`[v=\\s]*${Y[X.MAINVERSIONLOOSE]}${Y[X.PRERELEASELOOSE]}?${Y[X.BUILD]}?`),Z(`LOOSE`,`^${Y[X.LOOSEPLAIN]}$`),Z(`GTLT`,`((?:<|>)?=?)`),Z(`XRANGEIDENTIFIERLOOSE`,`${Y[X.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),Z(`XRANGEIDENTIFIER`,`${Y[X.NUMERICIDENTIFIER]}|x|X|\\*`),Z(`XRANGEPLAIN`,`[v=\\s]*(${Y[X.XRANGEIDENTIFIER]})(?:\\.(${Y[X.XRANGEIDENTIFIER]})(?:\\.(${Y[X.XRANGEIDENTIFIER]})(?:${Y[X.PRERELEASE]})?${Y[X.BUILD]}?)?)?`),Z(`XRANGEPLAINLOOSE`,`[v=\\s]*(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:${Y[X.PRERELEASELOOSE]})?${Y[X.BUILD]}?)?)?`),Z(`XRANGE`,`^${Y[X.GTLT]}\\s*${Y[X.XRANGEPLAIN]}$`),Z(`XRANGELOOSE`,`^${Y[X.GTLT]}\\s*${Y[X.XRANGEPLAINLOOSE]}$`),Z(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?`),Z(`COERCE`,`${Y[X.COERCEPLAIN]}(?:$|[^\\d])`),Z(`COERCEFULL`,`${Y[X.COERCEPLAIN]}(?:${Y[X.PRERELEASE]})?(?:${Y[X.BUILD]})?(?:$|[^\\d])`),Z(`COERCERTL`,Y[X.COERCE],!0),Z(`COERCERTLFULL`,Y[X.COERCEFULL],!0),Z(`LONETILDE`,`(?:~>?)`),Z(`TILDETRIM`,`(\\s*)${Y[X.LONETILDE]}\\s+`,!0),Z(`TILDE`,`^${Y[X.LONETILDE]}${Y[X.XRANGEPLAIN]}$`),Z(`TILDELOOSE`,`^${Y[X.LONETILDE]}${Y[X.XRANGEPLAINLOOSE]}$`),Z(`LONECARET`,`(?:\\^)`),Z(`CARETTRIM`,`(\\s*)${Y[X.LONECARET]}\\s+`,!0),Z(`CARET`,`^${Y[X.LONECARET]}${Y[X.XRANGEPLAIN]}$`),Z(`CARETLOOSE`,`^${Y[X.LONECARET]}${Y[X.XRANGEPLAINLOOSE]}$`),Z(`COMPARATORLOOSE`,`^${Y[X.GTLT]}\\s*(${Y[X.LOOSEPLAIN]})$|^$`),Z(`COMPARATOR`,`^${Y[X.GTLT]}\\s*(${Y[X.FULLPLAIN]})$|^$`),Z(`COMPARATORTRIM`,`(\\s*)${Y[X.GTLT]}\\s*(${Y[X.LOOSEPLAIN]}|${Y[X.XRANGEPLAIN]})`,!0),Z(`HYPHENRANGE`,`^\\s*(${Y[X.XRANGEPLAIN]})\\s+-\\s+(${Y[X.XRANGEPLAIN]})\\s*$`),Z(`HYPHENRANGELOOSE`,`^\\s*(${Y[X.XRANGEPLAINLOOSE]})\\s+-\\s+(${Y[X.XRANGEPLAINLOOSE]})\\s*$`),Z(`STAR`,`(<|>)?=?\\s*\\*`),Z(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),Z(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`);const Yv=Object.freeze({loose:!0}),Xv=Object.freeze({});function Zv(e){return e?typeof e==`object`?e:Yv:Xv}const Qv=/^\d+$/;var $v=class e{raw=``;loose=!1;options={};includePrerelease=!1;major=0;minor=0;patch=0;version=``;build=[];prerelease=[];constructor(t,n){let r=Zv(n),i;if(t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;i=t.version}else if(typeof t==`string`)i=t;else throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(i.length>256)throw TypeError(`version is longer than 256 characters`);J(`SemVer`,i,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let a=i.trim().match(r.loose?Uv[X.LOOSE]:Uv[X.FULL]);if(!a)throw TypeError(`Invalid Version: ${i}`);if(this.raw=i,this.major=+a[1],this.minor=+a[2],this.patch=+a[3],this.major>zv||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>zv||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>zv||this.patch<0)throw TypeError(`Invalid patch version`);this.prerelease=a[4]?a[4].split(`.`).map(e=>{if(Qv.test(e)){let t=+e;if(t>=0&&t<zv)return t}return e}):[],this.build=a[5]?a[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}inspect(){return`<SemVer "${this.version}">`}asSemVer(t){return t instanceof e?t:new e(t,this.options)}compare(t){J(`SemVer.compare`,this.version,this.options,t);let n;if(t instanceof e)n=t;else{if(typeof t==`string`&&t===this.version)return 0;n=this.asSemVer(t)}return n.version===this.version?0:this.compareMain(n)||this.comparePre(n)}compareMain(e){let t=this.asSemVer(e);return this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:+(this.patch>t.patch)}comparePre(e){let t=this.asSemVer(e);if(this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{let e=this.prerelease[n],r=t.prerelease[n];if(J(`prerelease compare`,n,e,r),e===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(e===void 0)return-1;if(e!==r)return Vv(e,r)}while(++n);return 0}compareBuild(e){let t=this.asSemVer(e),n=0;do{let e=this.build[n],r=t.build[n];if(J(`build compare`,n,e,r),e===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(e===void 0)return-1;if(e!==r)return Vv(e,r)}while(++n);return 0}inc(e,t,n){let r=e,i=t;if(r.startsWith(`pre`)){if(!i&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(i){let e=`-${i}`.match(this.options.loose?Uv[X.PRERELEASELOOSE]:Uv[X.PRERELEASE]);if(!e||e[1]!==i)throw Error(`invalid identifier: ${i}`)}}switch(r){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,i,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,i,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,i,n),this.inc(`pre`,i,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,i,n),this.inc(`pre`,i,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(this.prerelease.length===0)this.prerelease=[e];else{let t=this.prerelease.length;for(;--t>=0;)typeof this.prerelease[t]==`number`&&(this.prerelease[t]=this.prerelease[t]+1,t=-2);if(t===-1){if(i===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(i){let t=[i,e];n===!1&&(t=[i]),Vv(this.prerelease[0],i)===0?Number.isNaN(Number(this.prerelease[1]))&&(this.prerelease=t):this.prerelease=t}break}default:throw Error(`invalid increment argument: ${r}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}};function ey(e,t,n){return new $v(e,n).compare(new $v(t,n))}function ty(e,t,n){return ey(e,t,n)===0}function ny(e,t,n){return ey(e,t,n)>0}function ry(e,t,n){return ey(e,t,n)>=0}function iy(e,t,n){return ey(e,t,n)<0}function ay(e,t,n){return ey(e,t,n)<=0}function oy(e,t,n){return ey(e,t,n)!==0}function sy(e,t,n,r){let i=e=>e instanceof $v?e.version:e;switch(t){case`===`:return e=i(e),n=i(n),e===n;case`!==`:return e=i(e),n=i(n),e!==n;case``:case`=`:case`==`:return ty(e,n,r);case`!=`:return oy(e,n,r);case`>`:return ny(e,n,r);case`>=`:return ry(e,n,r);case`<`:return iy(e,n,r);case`<=`:return ay(e,n,r);default:throw TypeError(`Invalid operator: ${t}`)}}var cy=class{max;map;constructor(){this.max=1e3,this.map=/* @__PURE__ */ new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;e!==void 0&&this.delete(e)}this.map.set(e,t)}return this}};const ly=Symbol(`SemVer ANY`),uy=/\s+/;var dy=class e{options={};loose=!1;operator=``;semver=ly;value=``;static get ANY(){return ly}constructor(t,n){let r=Zv(n);if(t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}let i=String(t).trim().split(uy).join(` `);J(`comparator`,i,r),this.options=r,this.loose=!!r.loose,this.parse(i),this.value=this.semver===ly?``:this.operator+this.semver.version,J(`comp`,this)}parse(e){let t=this.options.loose?Uv[X.COMPARATORLOOSE]:Uv[X.COMPARATOR],n=e.match(t);if(!n)throw TypeError(`Invalid comparator: ${e}`);this.operator=n[1]===void 0?``:n[1],this.operator===`=`&&(this.operator=``),this.semver=n[2]?new $v(n[2],this.options.loose):ly}toString(){return this.value}test(e){if(J(`Comparator.test`,e,this.options.loose),this.semver===ly||e===ly)return!0;if(typeof e==`string`)try{e=new $v(e,this.options)}catch{return!1}return sy(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);if(this.operator===``)return this.value===``||new vy(t.value,n).test(this.value);if(t.operator===``)return t.value===``||new vy(this.value,n).test(t.semver);let r=Zv(n);return r.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!r.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver!==ly&&t.semver!==ly&&this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||sy(this.semver,`<`,t.semver,r)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||sy(this.semver,`>`,t.semver,r)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`))}};const fy=/\s+/g,py=/\s+/,my=new cy,hy=e=>e.value===`<0.0.0-0`,gy=e=>e.value===``,_y=e=>e!==dy.ANY;var vy=class e{raw=``;loose=!1;options={};includePrerelease=!1;set=[];formatted;constructor(t,n){let r=Zv(n);if(t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof dy)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=(typeof t==`string`?t:String(t)).trim().replace(fy,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length>0),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!hy(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&gy(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}inspect(){return`<SemVer Range "${this.range}">`}parseRange(e){let t=`${+!!this.options.includePrerelease|(this.options.loose?2:0)}:${e}`,n=my.get(t);if(n)return n;let r=this.options.loose,i=r?Uv[X.HYPHENRANGELOOSE]:Uv[X.HYPHENRANGE];e=e.replace(i,Ay(!!this.options.includePrerelease)),J(`hyphen replace`,e),e=e.replace(Uv[X.COMPARATORTRIM],`$1$2$3`),J(`comparator trim`,e),e=e.replace(Uv[X.TILDETRIM],`$1~`),J(`tilde trim`,e),e=e.replace(Uv[X.CARETTRIM],`$1^`),J(`caret trim`,e);let a=e.split(` `).map(e=>by(e,this.options)).join(` `).split(py).map(e=>ky(e,this.options));r&&(a=a.filter(e=>(J(`loose invalid filter`,e,this.options),!!e.match(Uv[X.COMPARATORLOOSE])))),J(`range list`,a);let o=/* @__PURE__ */ new Map,s=a.map(e=>new dy(e,this.options));for(let e of s){if(hy(e))return[e];o.set(e.value,e)}o.size>1&&o.has(``)&&o.delete(``);let c=[...o.values()];return my.set(t,c),c}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>yy(e,n)&&t.set.some(t=>yy(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;let t;if(typeof e==`string`)try{t=new $v(e,this.options)}catch{return!1}else if(e instanceof $v)t=e;else return!1;for(let e=0;e<this.set.length;e++)if(jy(this.set[e],t,this.options))return!0;return!1}};function yy(e,t){let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;){let e=i;if(!e)break;n=r.every(n=>e.intersects(n,t)),i=r.pop()}return n}function by(e,t){return e=e.replace(Uv[X.BUILD],``),J(`comp`,e,t),e=wy(e,t),J(`caret`,e),e=Sy(e,t),J(`tildes`,e),e=Ey(e,t),J(`xrange`,e),e=Oy(e,t),J(`stars`,e),e}function xy(e){return!e||e.toLowerCase()===`x`||e===`*`}function Sy(e,t){return e.trim().split(py).map(e=>Cy(e,t)).join(` `)}function Cy(e,t){let n=t.loose?Uv[X.TILDELOOSE]:Uv[X.TILDE];return e.replace(n,(t,n,r,i,a)=>{J(`tilde`,e,t,n,r,i,a);let o,s=String(n),c=String(r),l=String(i);return xy(n)?o=``:xy(r)?o=`>=${s}.0.0 <${Number(s)+1}.0.0-0`:xy(i)?o=`>=${s}.${c}.0 <${s}.${Number(c)+1}.0-0`:a?(J(`replaceTilde pr`,a),o=`>=${s}.${c}.${l}-${a} <${s}.${Number(c)+1}.0-0`):o=`>=${s}.${c}.${l} <${s}.${Number(c)+1}.0-0`,J(`tilde return`,o),o})}function wy(e,t){return e.trim().split(py).map(e=>Ty(e,t)).join(` `)}function Ty(e,t){J(`caret`,e,t);let n=t.loose?Uv[X.CARETLOOSE]:Uv[X.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{J(`caret`,e,t,n,i,a,o);let s,c=String(n),l=String(i),u=String(a);return xy(n)?s=``:xy(i)?s=`>=${c}.0.0${r} <${Number(c)+1}.0.0-0`:xy(a)?s=c===`0`?`>=${c}.${l}.0${r} <${c}.${Number(l)+1}.0-0`:`>=${c}.${l}.0${r} <${Number(c)+1}.0.0-0`:o?(J(`replaceCaret pr`,o),s=c===`0`?l===`0`?`>=${c}.${l}.${u}-${o} <${c}.${l}.${Number(u)+1}-0`:`>=${c}.${l}.${u}-${o} <${c}.${Number(l)+1}.0-0`:`>=${c}.${l}.${u}-${o} <${Number(c)+1}.0.0-0`):(J(`no pr`),s=c===`0`?l===`0`?`>=${c}.${l}.${u}${r} <${c}.${l}.${Number(u)+1}-0`:`>=${c}.${l}.${u}${r} <${c}.${Number(l)+1}.0-0`:`>=${c}.${l}.${u} <${Number(c)+1}.0.0-0`),J(`caret return`,s),s})}function Ey(e,t){return J(`replaceXRanges`,e,t),e.split(py).map(e=>Dy(e,t)).join(` `)}function Dy(e,t){e=e.trim();let n=t.loose?Uv[X.XRANGELOOSE]:Uv[X.XRANGE];return e.replace(n,(n,r,i,a,o,s)=>{J(`xRange`,e,n,r,i,a,o,s);let c=xy(i),l=c||xy(a),u=l||xy(o),d=u,f=r,p=String(i),m=String(a),h=String(o),g=s??``;return f===`=`&&d&&(f=``),g=t.includePrerelease?`-0`:``,c?n=f===`>`||f===`<`?`<0.0.0-0`:`*`:f&&d?(l&&(m=0),h=0,f===`>`?(f=`>=`,l?(p=Number(p)+1,m=0,h=0):(m=Number(m)+1,h=0)):f===`<=`&&(f=`<`,l?p=Number(p)+1:m=Number(m)+1),f===`<`&&(g=`-0`),n=`${f+p}.${m}.${h}${g}`):l?n=`>=${p}.0.0${g} <${Number(p)+1}.0.0-0`:u&&(n=`>=${p}.${m}.0${g} <${p}.${Number(m)+1}.0-0`),J(`xRange return`,n),n})}function Oy(e,t){return J(`replaceStars`,e,t),e.trim().replace(Uv[X.STAR],``)}function ky(e,t){return J(`replaceGTE0`,e,t),e.trim().replace(Uv[t.includePrerelease?X.GTE0PRE:X.GTE0],``)}function Ay(e){return(t,n,r,i,a,o,s,c,l,u,d,f)=>{let p=n??``,m=c??``;return p=xy(r)?``:xy(i)?`>=${String(r)}.0.0${e?`-0`:``}`:xy(a)?`>=${String(r)}.${String(i)}.0${e?`-0`:``}`:o?`>=${p}`:`>=${p}${e?`-0`:``}`,m=xy(l)?``:xy(u)?`<${Number(l)+1}.0.0-0`:xy(d)?`<${String(l)}.${Number(u)+1}.0-0`:f?`<=${String(l)}.${String(u)}.${String(d)}-${f}`:e?`<${String(l)}.${String(u)}.${Number(d)+1}-0`:`<=${m}`,`${p} ${m}`.trim()}}function jy(e,t,n){for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++){let r=e[n];if(J(r.semver),!_y(r.semver))continue;let i=r.semver;if(i.prerelease.length>0&&i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function My(e,t,n){try{return new vy(t,n).test(e)}catch{return!1}}function Ny(e,t){let n=new vy(e,t),r=new $v(`0.0.0`);if(n.test(r)||(r=new $v(`0.0.0-0`),n.test(r)))return r;r=null;for(let e=0;e<n.set.length;++e){let t=n.set[e],i=null;t.forEach(e=>{let t=new $v(e.semver instanceof $v?e.semver.version:`0.0.0`);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!i||ny(t,i))&&(i=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),i&&(!r||ny(r,i))&&(r=i)}return r&&n.test(r)?r:null}function Py(e,t){try{return new vy(e,t).range||`*`}catch{return null}}var Q=/* @__PURE__ */ L((e=>{let t=Symbol.for(`yaml.alias`),n=Symbol.for(`yaml.document`),r=Symbol.for(`yaml.map`),i=Symbol.for(`yaml.pair`),a=Symbol.for(`yaml.scalar`),o=Symbol.for(`yaml.seq`),s=Symbol.for(`yaml.node.type`),c=e=>!!e&&typeof e==`object`&&e[s]===t,l=e=>!!e&&typeof e==`object`&&e[s]===n,u=e=>!!e&&typeof e==`object`&&e[s]===r,d=e=>!!e&&typeof e==`object`&&e[s]===i,f=e=>!!e&&typeof e==`object`&&e[s]===a,p=e=>!!e&&typeof e==`object`&&e[s]===o;function m(e){if(e&&typeof e==`object`)switch(e[s]){case r:case o:return!0}return!1}e.ALIAS=t,e.DOC=n,e.MAP=r,e.NODE_TYPE=s,e.PAIR=i,e.SCALAR=a,e.SEQ=o,e.hasAnchor=e=>(f(e)||m(e))&&!!e.anchor,e.isAlias=c,e.isCollection=m,e.isDocument=l,e.isMap=u,e.isNode=function(e){if(e&&typeof e==`object`)switch(e[s]){case t:case r:case a:case o:return!0}return!1},e.isPair=d,e.isScalar=f,e.isSeq=p})),Fy=/* @__PURE__ */ L((e=>{var t=Q();let n=Symbol(`break visit`),r=Symbol(`skip children`),i=Symbol(`remove node`);function a(e,n){let r=l(n);t.isDocument(e)?o(null,e.contents,r,Object.freeze([e]))===i&&(e.contents=null):o(null,e,r,Object.freeze([]))}a.BREAK=n,a.SKIP=r,a.REMOVE=i;function o(e,r,a,s){let c=u(e,r,a,s);if(t.isNode(c)||t.isPair(c))return d(e,s,c),o(e,c,a,s);if(typeof c!=`symbol`){if(t.isCollection(r)){s=Object.freeze(s.concat(r));for(let e=0;e<r.items.length;++e){let t=o(e,r.items[e],a,s);if(typeof t==`number`)e=t-1;else if(t===n)return n;else t===i&&(r.items.splice(e,1),--e)}}else if(t.isPair(r)){s=Object.freeze(s.concat(r));let e=o(`key`,r.key,a,s);if(e===n)return n;e===i&&(r.key=null);let t=o(`value`,r.value,a,s);if(t===n)return n;t===i&&(r.value=null)}}return c}async function s(e,n){let r=l(n);t.isDocument(e)?await c(null,e.contents,r,Object.freeze([e]))===i&&(e.contents=null):await c(null,e,r,Object.freeze([]))}s.BREAK=n,s.SKIP=r,s.REMOVE=i;async function c(e,r,a,o){let s=await u(e,r,a,o);if(t.isNode(s)||t.isPair(s))return d(e,o,s),c(e,s,a,o);if(typeof s!=`symbol`){if(t.isCollection(r)){o=Object.freeze(o.concat(r));for(let e=0;e<r.items.length;++e){let t=await c(e,r.items[e],a,o);if(typeof t==`number`)e=t-1;else if(t===n)return n;else t===i&&(r.items.splice(e,1),--e)}}else if(t.isPair(r)){o=Object.freeze(o.concat(r));let e=await c(`key`,r.key,a,o);if(e===n)return n;e===i&&(r.key=null);let t=await c(`value`,r.value,a,o);if(t===n)return n;t===i&&(r.value=null)}}return s}function l(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function u(e,n,r,i){if(typeof r==`function`)return r(e,n,i);if(t.isMap(n))return r.Map?.(e,n,i);if(t.isSeq(n))return r.Seq?.(e,n,i);if(t.isPair(n))return r.Pair?.(e,n,i);if(t.isScalar(n))return r.Scalar?.(e,n,i);if(t.isAlias(n))return r.Alias?.(e,n,i)}function d(e,n,r){let i=n[n.length-1];if(t.isCollection(i))i.items[e]=r;else if(t.isPair(i))e===`key`?i.key=r:i.value=r;else if(t.isDocument(i))i.contents=r;else{let e=t.isAlias(i)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}e.visit=a,e.visitAsync=s})),Iy=/* @__PURE__ */ L((e=>{var t=Q(),n=Fy();let r={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},i=e=>e.replace(/[!,[\]{}]/g,e=>r[e]);var a=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+i(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],i=Object.entries(this.tags),a;if(e&&i.length>0&&t.isNode(e.contents)){let r={};n.visit(e.contents,(e,n)=>{t.isNode(n)&&n.tag&&(r[n.tag]=!0)}),a=Object.keys(r)}else a=[];for(let[t,n]of i)t===`!!`&&n===`tag:yaml.org,2002:`||e&&!a.some(e=>e.startsWith(n))||r.push(`%TAG ${t} ${n}`);return r.join(`
183
+ `)}};a.defaultYaml={explicit:!1,version:`1.2`},a.defaultTags={"!!":`tag:yaml.org,2002:`},e.Directives=a})),Ly=/* @__PURE__ */ L((e=>{var t=Q(),n=Fy();function r(e){let t=/* @__PURE__ */ new Set;return n.visit(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function i(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}e.anchorIsValid=function(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0},e.anchorNames=r,e.createNodeAnchors=function(e,n){let a=[],o=/* @__PURE__ */ new Map,s=null;return{onAnchor:t=>{a.push(t),s??=r(e);let o=i(n,s);return s.add(o),o},setAnchors:()=>{for(let e of a){let n=o.get(e);if(typeof n==`object`&&n.anchor&&(t.isScalar(n.node)||t.isCollection(n.node)))n.node.anchor=n.anchor;else{let t=/* @__PURE__ */ Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:o}},e.findNewAnchor=i})),Ry=/* @__PURE__ */ L((e=>{function t(e,n,r,i){if(i&&typeof i==`object`){if(Array.isArray(i))for(let n=0,r=i.length;n<r;++n){let r=i[n],a=t(e,i,String(n),r);a===void 0?delete i[n]:a!==r&&(i[n]=a)}else if(i instanceof Map)for(let n of Array.from(i.keys())){let r=i.get(n),a=t(e,i,n,r);a===void 0?i.delete(n):a!==r&&i.set(n,a)}else if(i instanceof Set)for(let n of Array.from(i)){let r=t(e,i,n,n);r===void 0?i.delete(n):r!==n&&(i.delete(n),i.add(r))}else for(let[n,r]of Object.entries(i)){let a=t(e,i,n,r);a===void 0?delete i[n]:a!==r&&(i[n]=a)}}return e.call(n,r,i)}e.applyReviver=t})),zy=/* @__PURE__ */ L((e=>{var t=Q();function n(e,r,i){if(Array.isArray(e))return e.map((e,t)=>n(e,String(t),i));if(e&&typeof e.toJSON==`function`){if(!i||!t.hasAnchor(e))return e.toJSON(r,i);let n={aliasCount:0,count:1,res:void 0};i.anchors.set(e,n),i.onCreate=e=>{n.res=e,delete i.onCreate};let a=e.toJSON(r,i);return i.onCreate&&i.onCreate(a),a}return typeof e==`bigint`&&!i?.keep?Number(e):e}e.toJS=n})),By=/* @__PURE__ */ L((e=>{var t=Ry(),n=Q(),r=zy();e.NodeBase=class{constructor(e){Object.defineProperty(this,n.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:i,maxAliasCount:a,onAnchor:o,reviver:s}={}){if(!n.isDocument(e))throw TypeError(`A document argument is required`);let c={anchors:/* @__PURE__ */ new Map,doc:e,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof a==`number`?a:100},l=r.toJS(this,``,c);if(typeof o==`function`)for(let{count:e,res:t}of c.anchors.values())o(t,e);return typeof s==`function`?t.applyReviver(s,{"":l},``,l):l}}})),Vy=/* @__PURE__ */ L((e=>{var t=Ly(),n=Fy(),r=Q(),i=By(),a=zy(),o=class extends i.NodeBase{constructor(e){super(r.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let i;t?.aliasResolveCache?i=t.aliasResolveCache:(i=[],n.visit(e,{Node:(e,t)=>{(r.isAlias(t)||r.hasAnchor(t))&&i.push(t)}}),t&&(t.aliasResolveCache=i));let o;for(let e of i){if(e===this)break;e.anchor===this.source&&(o=e)}if(o&&t){let{anchors:e,doc:n,maxAliasCount:r}=t,i=e.get(o);
184
184
  /* istanbul ignore if */
185
- if(i||=(a.toJS(o,null,t),e.get(o)),i?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(r>=0&&(i.count+=1,i.aliasCount===0&&(i.aliasCount=s(n,o,e)),i.count*i.aliasCount>r))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return o}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,n,r){let i=`*${this.source}`;if(e){if(t.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${i} `}return i}};function s(e,t,n){if(r.isAlias(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(r.isCollection(t)){let r=0;for(let i of t.items){let t=s(e,i,n);t>r&&(r=t)}return r}if(r.isPair(t)){let r=s(e,t.key,n),i=s(e,t.value,n);return Math.max(r,i)}return 1}e.Alias=o})),Vy=/* @__PURE__ */ L((e=>{var t=Q(),n=zy(),r=Ry();let i=e=>!e||typeof e!=`function`&&typeof e!=`object`;var a=class extends n.NodeBase{constructor(e){super(t.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:r.toJS(this.value,e,t)}toString(){return String(this.value)}};a.BLOCK_FOLDED=`BLOCK_FOLDED`,a.BLOCK_LITERAL=`BLOCK_LITERAL`,a.PLAIN=`PLAIN`,a.QUOTE_DOUBLE=`QUOTE_DOUBLE`,a.QUOTE_SINGLE=`QUOTE_SINGLE`,e.Scalar=a,e.isScalarValue=i})),Hy=/* @__PURE__ */ L((e=>{var t=By(),n=Q(),r=Vy();function i(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}e.createNode=function(e,a,o){if(n.isDocument(e)&&(e=e.contents),n.isNode(e))return e;if(n.isPair(e)){let t=o.schema[n.MAP].createNode?.(o.schema,null,o);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:s,onAnchor:c,onTagObj:l,schema:u,sourceObjects:d}=o,f;if(s&&e&&typeof e==`object`){if(f=d.get(e),f)return f.anchor??(f.anchor=c(e)),new t.Alias(f.anchor);f={anchor:null,node:null},d.set(e,f)}a?.startsWith(`!!`)&&(a=`tag:yaml.org,2002:`+a.slice(2));let p=i(e,a,u.tags);if(!p){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new r.Scalar(e);return f&&(f.node=t),t}p=e instanceof Map?u[n.MAP]:Symbol.iterator in Object(e)?u[n.SEQ]:u[n.MAP]}l&&(l(p),delete o.onTagObj);let m=p?.createNode?p.createNode(o.schema,e,o):typeof p?.nodeClass?.from==`function`?p.nodeClass.from(o.schema,e,o):new r.Scalar(e);return a?m.tag=a:p.default||(m.tag=p.tag),f&&(f.node=m),m}})),Uy=/* @__PURE__ */ L((e=>{var t=Hy(),n=Q(),r=zy();function i(e,n,r){let i=r;for(let e=n.length-1;e>=0;--e){let t=n[e];if(typeof t==`number`&&Number.isInteger(t)&&t>=0){let e=[];e[t]=i,i=e}else i=/* @__PURE__ */ new Map([[t,i]])}return t.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:/* @__PURE__ */ new Map})}let a=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done;e.Collection=class extends r.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>n.isNode(t)||n.isPair(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(a(e))this.add(t);else{let[r,...a]=e,o=this.get(r,!0);if(n.isCollection(o))o.addIn(a,t);else if(o===void 0&&this.schema)this.set(r,i(this.schema,a,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}deleteIn(e){let[t,...r]=e;if(r.length===0)return this.delete(t);let i=this.get(t,!0);if(n.isCollection(i))return i.deleteIn(r);throw Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...i]=e,a=this.get(r,!0);return i.length===0?!t&&n.isScalar(a)?a.value:a:n.isCollection(a)?a.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!n.isPair(t))return!1;let r=t.value;return r==null||e&&n.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(r.length===0)return this.has(t);let i=this.get(t,!0);return n.isCollection(i)?i.hasIn(r):!1}setIn(e,t){let[r,...a]=e;if(a.length===0)this.set(r,t);else{let e=this.get(r,!0);if(n.isCollection(e))e.setIn(a,t);else if(e===void 0&&this.schema)this.set(r,i(this.schema,a,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}},e.collectionFromPath=i,e.isEmptyPath=a})),Wy=/* @__PURE__ */ L((e=>{let t=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function n(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}e.indentComment=n,e.lineComment=(e,t,r)=>e.endsWith(`
185
+ if(i||=(a.toJS(o,null,t),e.get(o)),i?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(r>=0&&(i.count+=1,i.aliasCount===0&&(i.aliasCount=s(n,o,e)),i.count*i.aliasCount>r))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return o}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,n,r){let i=`*${this.source}`;if(e){if(t.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${i} `}return i}};function s(e,t,n){if(r.isAlias(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(r.isCollection(t)){let r=0;for(let i of t.items){let t=s(e,i,n);t>r&&(r=t)}return r}if(r.isPair(t)){let r=s(e,t.key,n),i=s(e,t.value,n);return Math.max(r,i)}return 1}e.Alias=o})),Hy=/* @__PURE__ */ L((e=>{var t=Q(),n=By(),r=zy();let i=e=>!e||typeof e!=`function`&&typeof e!=`object`;var a=class extends n.NodeBase{constructor(e){super(t.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:r.toJS(this.value,e,t)}toString(){return String(this.value)}};a.BLOCK_FOLDED=`BLOCK_FOLDED`,a.BLOCK_LITERAL=`BLOCK_LITERAL`,a.PLAIN=`PLAIN`,a.QUOTE_DOUBLE=`QUOTE_DOUBLE`,a.QUOTE_SINGLE=`QUOTE_SINGLE`,e.Scalar=a,e.isScalarValue=i})),Uy=/* @__PURE__ */ L((e=>{var t=Vy(),n=Q(),r=Hy();function i(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}e.createNode=function(e,a,o){if(n.isDocument(e)&&(e=e.contents),n.isNode(e))return e;if(n.isPair(e)){let t=o.schema[n.MAP].createNode?.(o.schema,null,o);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:s,onAnchor:c,onTagObj:l,schema:u,sourceObjects:d}=o,f;if(s&&e&&typeof e==`object`){if(f=d.get(e),f)return f.anchor??(f.anchor=c(e)),new t.Alias(f.anchor);f={anchor:null,node:null},d.set(e,f)}a?.startsWith(`!!`)&&(a=`tag:yaml.org,2002:`+a.slice(2));let p=i(e,a,u.tags);if(!p){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new r.Scalar(e);return f&&(f.node=t),t}p=e instanceof Map?u[n.MAP]:Symbol.iterator in Object(e)?u[n.SEQ]:u[n.MAP]}l&&(l(p),delete o.onTagObj);let m=p?.createNode?p.createNode(o.schema,e,o):typeof p?.nodeClass?.from==`function`?p.nodeClass.from(o.schema,e,o):new r.Scalar(e);return a?m.tag=a:p.default||(m.tag=p.tag),f&&(f.node=m),m}})),Wy=/* @__PURE__ */ L((e=>{var t=Uy(),n=Q(),r=By();function i(e,n,r){let i=r;for(let e=n.length-1;e>=0;--e){let t=n[e];if(typeof t==`number`&&Number.isInteger(t)&&t>=0){let e=[];e[t]=i,i=e}else i=/* @__PURE__ */ new Map([[t,i]])}return t.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:/* @__PURE__ */ new Map})}let a=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done;e.Collection=class extends r.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>n.isNode(t)||n.isPair(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(a(e))this.add(t);else{let[r,...a]=e,o=this.get(r,!0);if(n.isCollection(o))o.addIn(a,t);else if(o===void 0&&this.schema)this.set(r,i(this.schema,a,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}deleteIn(e){let[t,...r]=e;if(r.length===0)return this.delete(t);let i=this.get(t,!0);if(n.isCollection(i))return i.deleteIn(r);throw Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...i]=e,a=this.get(r,!0);return i.length===0?!t&&n.isScalar(a)?a.value:a:n.isCollection(a)?a.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!n.isPair(t))return!1;let r=t.value;return r==null||e&&n.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(r.length===0)return this.has(t);let i=this.get(t,!0);return n.isCollection(i)?i.hasIn(r):!1}setIn(e,t){let[r,...a]=e;if(a.length===0)this.set(r,t);else{let e=this.get(r,!0);if(n.isCollection(e))e.setIn(a,t);else if(e===void 0&&this.schema)this.set(r,i(this.schema,a,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}},e.collectionFromPath=i,e.isEmptyPath=a})),Gy=/* @__PURE__ */ L((e=>{let t=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function n(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}e.indentComment=n,e.lineComment=(e,t,r)=>e.endsWith(`
186
186
  `)?n(r,t):r.includes(`
187
187
  `)?`
188
- `+n(r,t):(e.endsWith(` `)?``:` `)+r,e.stringifyComment=t})),Gy=/* @__PURE__ */ L((e=>{let t=`block`,n=`quoted`;function r(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
188
+ `+n(r,t):(e.endsWith(` `)?``:` `)+r,e.stringifyComment=t})),Ky=/* @__PURE__ */ L((e=>{let t=`block`,n=`quoted`;function r(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
189
189
  `);r=t,i=t+1,a=e[i]}return r}e.FOLD_BLOCK=t,e.FOLD_FLOW=`flow`,e.FOLD_QUOTED=n,e.foldFlowLines=function(e,i,a=`flow`,{indentAtStart:o,lineWidth:s=80,minContentWidth:c=20,onFold:l,onOverflow:u}={}){if(!s||s<0)return e;s<c&&(c=0);let d=Math.max(1+c,1+s-i.length);if(e.length<=d)return e;let f=[],p={},m=s-i.length;typeof o==`number`&&(o>s-Math.max(2,c)?f.push(0):m=s-o);let h,g,_=!1,v=-1,y=-1,b=-1;a===t&&(v=r(e,v,i.length),v!==-1&&(m=v+d));for(let o;o=e[v+=1];){if(a===n&&o===`\\`){switch(y=v,e[v+1]){case`x`:v+=3;break;case`u`:v+=5;break;case`U`:v+=9;break;default:v+=1}b=v}if(o===`
190
190
  `)a===t&&(v=r(e,v,i.length)),m=v+i.length+d,h=void 0;else{if(o===` `&&g&&g!==` `&&g!==`
191
191
  `&&g!==` `){let t=e[v+1];t&&t!==` `&&t!==`
192
- `&&t!==` `&&(h=v)}if(v>=m){if(h)f.push(h),m=h+d,h=void 0;else if(a===n){for(;g===` `||g===` `;)g=o,o=e[v+=1],_=!0;let t=v>b+1?v-2:y-1;if(p[t])return e;f.push(t),p[t]=!0,m=t+d,h=void 0}else _=!0}}g=o}if(_&&u&&u(),f.length===0)return e;l&&l();let x=e.slice(0,f[0]);for(let t=0;t<f.length;++t){let r=f[t],o=f[t+1]||e.length;r===0?x=`\n${i}${e.slice(0,o)}`:(a===n&&p[r]&&(x+=`${e[r]}\\`),x+=`\n${i}${e.slice(r+1,o)}`)}return x}})),Ky=/* @__PURE__ */ L((e=>{var t=Vy(),n=Gy();let r=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),i=e=>/^(%|---|\.\.\.)/m.test(e);function a(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
192
+ `&&t!==` `&&(h=v)}if(v>=m){if(h)f.push(h),m=h+d,h=void 0;else if(a===n){for(;g===` `||g===` `;)g=o,o=e[v+=1],_=!0;let t=v>b+1?v-2:y-1;if(p[t])return e;f.push(t),p[t]=!0,m=t+d,h=void 0}else _=!0}}g=o}if(_&&u&&u(),f.length===0)return e;l&&l();let x=e.slice(0,f[0]);for(let t=0;t<f.length;++t){let r=f[t],o=f[t+1]||e.length;r===0?x=`\n${i}${e.slice(0,o)}`:(a===n&&p[r]&&(x+=`${e[r]}\\`),x+=`\n${i}${e.slice(r+1,o)}`)}return x}})),qy=/* @__PURE__ */ L((e=>{var t=Hy(),n=Ky();let r=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),i=e=>/^(%|---|\.\.\.)/m.test(e);function a(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
193
193
  `){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function o(e,t){let a=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return a;let{implicitKey:o}=t,s=t.options.doubleQuotedMinMultiLineLength,c=t.indent||(i(e)?` `:``),l=``,u=0;for(let e=0,t=a[e];t;t=a[++e])if(t===` `&&a[e+1]===`\\`&&a[e+2]===`n`&&(l+=a.slice(u,e)+`\\ `,e+=1,u=e,t=`\\`),t===`\\`)switch(a[e+1]){case`u`:{l+=a.slice(u,e);let t=a.substr(e+2,4);switch(t){case`0000`:l+=`\\0`;break;case`0007`:l+=`\\a`;break;case`000b`:l+=`\\v`;break;case`001b`:l+=`\\e`;break;case`0085`:l+=`\\N`;break;case`00a0`:l+=`\\_`;break;case`2028`:l+=`\\L`;break;case`2029`:l+=`\\P`;break;default:t.substr(0,2)===`00`?l+=`\\x`+t.substr(2):l+=a.substr(e,6)}e+=5,u=e+1}break;case`n`:if(o||a[e+2]===`"`||a.length<s)e+=1;else{for(l+=a.slice(u,e)+`
194
194
 
195
195
  `;a[e+2]===`\\`&&a[e+3]===`n`&&a[e+4]!==`"`;)l+=`
@@ -207,29 +207,29 @@ if(i||=(a.toJS(o,null,t),e.get(o)),i?.res===void 0)throw ReferenceError(`This sh
207
207
  $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${g}`),i=!1,a=r(u,!0);p!==`folded`&&o!==t.Scalar.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let c=n.foldFlowLines(`${T}${e}${b}`,g,n.FOLD_BLOCK,a);if(!i)return`>${E}\n${g}${c}`}return s=s.replace(/\n+/g,`$&${g}`),`|${E}\n${g}${T}${s}${b}`}function d(e,a,o,s){let{type:l,value:d}=e,{actualString:f,implicitKey:p,indent:m,indentStep:h,inFlow:g}=a;if(p&&d.includes(`
208
208
  `)||g&&/[[\]{},]/.test(d))return c(d,a);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(d))return p||g||!d.includes(`
209
209
  `)?c(d,a):u(e,a,o,s);if(!p&&!g&&l!==t.Scalar.PLAIN&&d.includes(`
210
- `))return u(e,a,o,s);if(i(d)){if(m===``)return a.forceBlockIndent=!0,u(e,a,o,s);if(p&&m===h)return c(d,a)}let _=d.replace(/\n+/g,`$&\n${m}`);if(f){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(_),{compat:t,tags:n}=a.doc.schema;if(n.some(e)||t?.some(e))return c(d,a)}return p?_:n.foldFlowLines(_,m,n.FOLD_FLOW,r(a,!1))}e.stringifyString=function(e,n,r,i){let{implicitKey:a,inFlow:l}=n,f=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:p}=e;p!==t.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(f.value)&&(p=t.Scalar.QUOTE_DOUBLE);let m=e=>{switch(e){case t.Scalar.BLOCK_FOLDED:case t.Scalar.BLOCK_LITERAL:return a||l?c(f.value,n):u(f,n,r,i);case t.Scalar.QUOTE_DOUBLE:return o(f.value,n);case t.Scalar.QUOTE_SINGLE:return s(f.value,n);case t.Scalar.PLAIN:return d(f,n,r,i);default:return null}},h=m(p);if(h===null){let{defaultKeyType:e,defaultStringType:t}=n.options,r=a&&e||t;if(h=m(r),h===null)throw Error(`Unsupported default string type ${r}`)}return h}})),qy=/* @__PURE__ */ L((e=>{var t=Iy(),n=Q(),r=Wy(),i=Ky();function a(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let r,i;if(n.isScalar(t)){i=t.value;let n=e.filter(e=>e.identify?.(i));if(n.length>1){let e=n.filter(e=>e.test);e.length>0&&(n=e)}r=n.find(e=>e.format===t.format)??n.find(e=>!e.format)}else i=t,r=e.find(e=>e.nodeClass&&i instanceof e.nodeClass);if(!r){let e=i?.constructor?.name??(i===null?`null`:typeof i);throw Error(`Tag not resolved for ${e} value`)}return r}function o(e,r,{anchors:i,doc:a}){if(!a.directives)return``;let o=[],s=(n.isScalar(e)||n.isCollection(e))&&e.anchor;s&&t.anchorIsValid(s)&&(i.add(s),o.push(`&${s}`));let c=e.tag??(r.default?null:r.tag);return c&&o.push(a.directives.tagString(c)),o.join(` `)}e.createStringifyContext=function(e,t){let n=Object.assign({blockQuote:!0,commentString:r.stringifyComment,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),i;switch(n.collectionStyle){case`block`:i=!1;break;case`flow`:i=!0;break;default:i=null}return{anchors:/* @__PURE__ */ new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:i,options:n}},e.stringify=function(e,t,r,s){if(n.isPair(e))return e.toString(t,r,s);if(n.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=/* @__PURE__ */ new Set([e]),e=e.resolve(t.doc)}let c,l=n.isNode(e)?e:t.doc.createNode(e,{onTagObj:e=>c=e});c??=a(t.doc.schema.tags,l);let u=o(l,c,t);u.length>0&&(t.indentAtStart=(t.indentAtStart??0)+u.length+1);let d=typeof c.stringify==`function`?c.stringify(l,t,r,s):n.isScalar(l)?i.stringifyString(l,t,r,s):l.toString(t,r,s);return u?n.isScalar(l)||d[0]===`{`||d[0]===`[`?`${u} ${d}`:`${u}\n${t.indent}${d}`:d}})),Jy=/* @__PURE__ */ L((e=>{var t=Q(),n=Vy(),r=qy(),i=Wy();e.stringifyPair=function({key:e,value:a},o,s,c){let{allNullValues:l,doc:u,indent:d,indentStep:f,options:{commentString:p,indentSeq:m,simpleKeys:h}}=o,g=t.isNode(e)&&e.comment||null;if(h){if(g)throw Error(`With simple keys, key nodes cannot have comments`);if(t.isCollection(e)||!t.isNode(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let _=!h&&(!e||g&&a==null&&!o.inFlow||t.isCollection(e)||(t.isScalar(e)?e.type===n.Scalar.BLOCK_FOLDED||e.type===n.Scalar.BLOCK_LITERAL:typeof e==`object`));o=Object.assign({},o,{allNullValues:!1,implicitKey:!_&&(h||!l),indent:d+f});let v=!1,y=!1,b=r.stringify(e,o,()=>v=!0,()=>y=!0);if(!_&&!o.inFlow&&b.length>1024){if(h)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);_=!0}if(o.inFlow){if(l||a==null)return v&&s&&s(),b===``?`?`:_?`? ${b}`:b}else if(l&&!h||a==null&&_)return b=`? ${b}`,g&&!v?b+=i.lineComment(b,o.indent,p(g)):y&&c&&c(),b;v&&(g=null),_?(g&&(b+=i.lineComment(b,o.indent,p(g))),b=`? ${b}\n${d}:`):(b=`${b}:`,g&&(b+=i.lineComment(b,o.indent,p(g))));let x,S,C;t.isNode(a)?(x=!!a.spaceBefore,S=a.commentBefore,C=a.comment):(x=!1,S=null,C=null,a&&typeof a==`object`&&(a=u.createNode(a))),o.implicitKey=!1,!_&&!g&&t.isScalar(a)&&(o.indentAtStart=b.length+1),y=!1,!m&&f.length>=2&&!o.inFlow&&!_&&t.isSeq(a)&&!a.flow&&!a.tag&&!a.anchor&&(o.indent=o.indent.substring(2));let w=!1,T=r.stringify(a,o,()=>w=!0,()=>y=!0),E=` `;if(g||x||S){if(E=x?`
210
+ `))return u(e,a,o,s);if(i(d)){if(m===``)return a.forceBlockIndent=!0,u(e,a,o,s);if(p&&m===h)return c(d,a)}let _=d.replace(/\n+/g,`$&\n${m}`);if(f){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(_),{compat:t,tags:n}=a.doc.schema;if(n.some(e)||t?.some(e))return c(d,a)}return p?_:n.foldFlowLines(_,m,n.FOLD_FLOW,r(a,!1))}e.stringifyString=function(e,n,r,i){let{implicitKey:a,inFlow:l}=n,f=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:p}=e;p!==t.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(f.value)&&(p=t.Scalar.QUOTE_DOUBLE);let m=e=>{switch(e){case t.Scalar.BLOCK_FOLDED:case t.Scalar.BLOCK_LITERAL:return a||l?c(f.value,n):u(f,n,r,i);case t.Scalar.QUOTE_DOUBLE:return o(f.value,n);case t.Scalar.QUOTE_SINGLE:return s(f.value,n);case t.Scalar.PLAIN:return d(f,n,r,i);default:return null}},h=m(p);if(h===null){let{defaultKeyType:e,defaultStringType:t}=n.options,r=a&&e||t;if(h=m(r),h===null)throw Error(`Unsupported default string type ${r}`)}return h}})),Jy=/* @__PURE__ */ L((e=>{var t=Ly(),n=Q(),r=Gy(),i=qy();function a(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let r,i;if(n.isScalar(t)){i=t.value;let n=e.filter(e=>e.identify?.(i));if(n.length>1){let e=n.filter(e=>e.test);e.length>0&&(n=e)}r=n.find(e=>e.format===t.format)??n.find(e=>!e.format)}else i=t,r=e.find(e=>e.nodeClass&&i instanceof e.nodeClass);if(!r){let e=i?.constructor?.name??(i===null?`null`:typeof i);throw Error(`Tag not resolved for ${e} value`)}return r}function o(e,r,{anchors:i,doc:a}){if(!a.directives)return``;let o=[],s=(n.isScalar(e)||n.isCollection(e))&&e.anchor;s&&t.anchorIsValid(s)&&(i.add(s),o.push(`&${s}`));let c=e.tag??(r.default?null:r.tag);return c&&o.push(a.directives.tagString(c)),o.join(` `)}e.createStringifyContext=function(e,t){let n=Object.assign({blockQuote:!0,commentString:r.stringifyComment,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),i;switch(n.collectionStyle){case`block`:i=!1;break;case`flow`:i=!0;break;default:i=null}return{anchors:/* @__PURE__ */ new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:i,options:n}},e.stringify=function(e,t,r,s){if(n.isPair(e))return e.toString(t,r,s);if(n.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=/* @__PURE__ */ new Set([e]),e=e.resolve(t.doc)}let c,l=n.isNode(e)?e:t.doc.createNode(e,{onTagObj:e=>c=e});c??=a(t.doc.schema.tags,l);let u=o(l,c,t);u.length>0&&(t.indentAtStart=(t.indentAtStart??0)+u.length+1);let d=typeof c.stringify==`function`?c.stringify(l,t,r,s):n.isScalar(l)?i.stringifyString(l,t,r,s):l.toString(t,r,s);return u?n.isScalar(l)||d[0]===`{`||d[0]===`[`?`${u} ${d}`:`${u}\n${t.indent}${d}`:d}})),Yy=/* @__PURE__ */ L((e=>{var t=Q(),n=Hy(),r=Jy(),i=Gy();e.stringifyPair=function({key:e,value:a},o,s,c){let{allNullValues:l,doc:u,indent:d,indentStep:f,options:{commentString:p,indentSeq:m,simpleKeys:h}}=o,g=t.isNode(e)&&e.comment||null;if(h){if(g)throw Error(`With simple keys, key nodes cannot have comments`);if(t.isCollection(e)||!t.isNode(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let _=!h&&(!e||g&&a==null&&!o.inFlow||t.isCollection(e)||(t.isScalar(e)?e.type===n.Scalar.BLOCK_FOLDED||e.type===n.Scalar.BLOCK_LITERAL:typeof e==`object`));o=Object.assign({},o,{allNullValues:!1,implicitKey:!_&&(h||!l),indent:d+f});let v=!1,y=!1,b=r.stringify(e,o,()=>v=!0,()=>y=!0);if(!_&&!o.inFlow&&b.length>1024){if(h)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);_=!0}if(o.inFlow){if(l||a==null)return v&&s&&s(),b===``?`?`:_?`? ${b}`:b}else if(l&&!h||a==null&&_)return b=`? ${b}`,g&&!v?b+=i.lineComment(b,o.indent,p(g)):y&&c&&c(),b;v&&(g=null),_?(g&&(b+=i.lineComment(b,o.indent,p(g))),b=`? ${b}\n${d}:`):(b=`${b}:`,g&&(b+=i.lineComment(b,o.indent,p(g))));let x,S,C;t.isNode(a)?(x=!!a.spaceBefore,S=a.commentBefore,C=a.comment):(x=!1,S=null,C=null,a&&typeof a==`object`&&(a=u.createNode(a))),o.implicitKey=!1,!_&&!g&&t.isScalar(a)&&(o.indentAtStart=b.length+1),y=!1,!m&&f.length>=2&&!o.inFlow&&!_&&t.isSeq(a)&&!a.flow&&!a.tag&&!a.anchor&&(o.indent=o.indent.substring(2));let w=!1,T=r.stringify(a,o,()=>w=!0,()=>y=!0),E=` `;if(g||x||S){if(E=x?`
211
211
  `:``,S){let e=p(S);E+=`\n${i.indentComment(e,o.indent)}`}T===``&&!o.inFlow?E===`
212
212
  `&&C&&(E=`
213
213
 
214
214
  `):E+=`\n${o.indent}`}else if(!_&&t.isCollection(a)){let e=T[0],t=T.indexOf(`
215
215
  `),n=t!==-1,r=o.inFlow??a.flow??a.items.length===0;if(n||!r){let r=!1;if(n&&(e===`&`||e===`!`)){let n=T.indexOf(` `);e===`&`&&n!==-1&&n<t&&T[n+1]===`!`&&(n=T.indexOf(` `,n+1)),(n===-1||t<n)&&(r=!0)}r||(E=`\n${o.indent}`)}}else(T===``||T[0]===`
216
- `)&&(E=``);return b+=E+T,o.inFlow?w&&s&&s():C&&!w?b+=i.lineComment(b,o.indent,p(C)):y&&c&&c(),b}})),Yy=/* @__PURE__ */ L((e=>{var t=z(`process`);e.debug=function(e,...t){e===`debug`&&console.log(...t)},e.warn=function(e,n){(e===`debug`||e===`warn`)&&(typeof t.emitWarning==`function`?t.emitWarning(n):console.warn(n))}})),Xy=/* @__PURE__ */ L((e=>{var t=Q(),n=Vy();let r={identify:e=>e===`<<`||typeof e==`symbol`&&e.description===`<<`,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new n.Scalar(Symbol(`<<`)),{addToJSMap:a}),stringify:()=>`<<`},i=(e,i)=>(r.identify(i)||t.isScalar(i)&&(!i.type||i.type===n.Scalar.PLAIN)&&r.identify(i.value))&&e?.doc.schema.tags.some(e=>e.tag===r.tag&&e.default);function a(e,n,r){let i=s(e,r);if(t.isSeq(i))for(let t of i.items)o(e,n,t);else if(Array.isArray(i))for(let t of i)o(e,n,t);else o(e,n,i)}function o(e,n,r){let i=s(e,r);if(!t.isMap(i))throw Error(`Merge sources must be maps or map aliases`);let a=i.toJSON(null,e,Map);for(let[e,t]of a)n instanceof Map?n.has(e)||n.set(e,t):n instanceof Set?n.add(e):Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(n,e,{value:t,writable:!0,enumerable:!0,configurable:!0});return n}function s(e,n){return e&&t.isAlias(n)?n.resolve(e.doc,e):n}e.addMergeToJSMap=a,e.isMergeKey=i,e.merge=r})),Zy=/* @__PURE__ */ L((e=>{var t=Yy(),n=Xy(),r=qy(),i=Q(),a=Ry();function o(e,n,a){if(n===null)return``;if(typeof n!=`object`)return String(n);if(i.isNode(e)&&a?.doc){let n=r.createStringifyContext(a.doc,{});n.anchors=/* @__PURE__ */ new Set;for(let e of a.anchors.keys())n.anchors.add(e.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=e.toString(n);if(!a.mapKeyWarned){let e=JSON.stringify(i);e.length>40&&(e=e.substring(0,36)+`..."`),t.warn(a.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),a.mapKeyWarned=!0}return i}return JSON.stringify(n)}e.addPairToJSMap=function(e,t,{key:r,value:s}){if(i.isNode(r)&&r.addToJSMap)r.addToJSMap(e,t,s);else if(n.isMergeKey(e,r))n.addMergeToJSMap(e,t,s);else{let n=a.toJS(r,``,e);if(t instanceof Map)t.set(n,a.toJS(s,n,e));else if(t instanceof Set)t.add(n);else{let i=o(r,n,e),c=a.toJS(s,i,e);i in t?Object.defineProperty(t,i,{value:c,writable:!0,enumerable:!0,configurable:!0}):t[i]=c}}return t}})),Qy=/* @__PURE__ */ L((e=>{var t=Hy(),n=Jy(),r=Zy(),i=Q(),a=class e{constructor(e,t=null){Object.defineProperty(this,i.NODE_TYPE,{value:i.PAIR}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return i.isNode(n)&&(n=n.clone(t)),i.isNode(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){let n=t?.mapAsMap?/* @__PURE__ */ new Map:{};return r.addPairToJSMap(t,n,this)}toString(e,t,r){return e?.doc?n.stringifyPair(this,e,t,r):JSON.stringify(this)}};e.Pair=a,e.createPair=function(e,n,r){return new a(t.createNode(e,void 0,r),t.createNode(n,void 0,r))}})),$y=/* @__PURE__ */ L((e=>{var t=Q(),n=qy(),r=Wy();function i({comment:e,items:i},a,{blockItemPrefix:s,flowChars:c,itemIndent:l,onChompKeep:u,onComment:d}){let{indent:f,options:{commentString:p}}=a,m=Object.assign({},a,{indent:l,type:null}),h=!1,g=[];for(let e=0;e<i.length;++e){let c=i[e],u=null;if(t.isNode(c))!h&&c.spaceBefore&&g.push(``),o(a,g,c.commentBefore,h),c.comment&&(u=c.comment);else if(t.isPair(c)){let e=t.isNode(c.key)?c.key:null;e&&(!h&&e.spaceBefore&&g.push(``),o(a,g,e.commentBefore,h))}h=!1;let d=n.stringify(c,m,()=>u=null,()=>h=!0);u&&(d+=r.lineComment(d,l,p(u))),h&&u&&(h=!1),g.push(s+d)}let _;if(g.length===0)_=c.start+c.end;else{_=g[0];for(let e=1;e<g.length;++e){let t=g[e];_+=t?`\n${f}${t}`:`
216
+ `)&&(E=``);return b+=E+T,o.inFlow?w&&s&&s():C&&!w?b+=i.lineComment(b,o.indent,p(C)):y&&c&&c(),b}})),Xy=/* @__PURE__ */ L((e=>{var t=z(`process`);e.debug=function(e,...t){e===`debug`&&console.log(...t)},e.warn=function(e,n){(e===`debug`||e===`warn`)&&(typeof t.emitWarning==`function`?t.emitWarning(n):console.warn(n))}})),Zy=/* @__PURE__ */ L((e=>{var t=Q(),n=Hy();let r={identify:e=>e===`<<`||typeof e==`symbol`&&e.description===`<<`,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new n.Scalar(Symbol(`<<`)),{addToJSMap:a}),stringify:()=>`<<`},i=(e,i)=>(r.identify(i)||t.isScalar(i)&&(!i.type||i.type===n.Scalar.PLAIN)&&r.identify(i.value))&&e?.doc.schema.tags.some(e=>e.tag===r.tag&&e.default);function a(e,n,r){let i=s(e,r);if(t.isSeq(i))for(let t of i.items)o(e,n,t);else if(Array.isArray(i))for(let t of i)o(e,n,t);else o(e,n,i)}function o(e,n,r){let i=s(e,r);if(!t.isMap(i))throw Error(`Merge sources must be maps or map aliases`);let a=i.toJSON(null,e,Map);for(let[e,t]of a)n instanceof Map?n.has(e)||n.set(e,t):n instanceof Set?n.add(e):Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(n,e,{value:t,writable:!0,enumerable:!0,configurable:!0});return n}function s(e,n){return e&&t.isAlias(n)?n.resolve(e.doc,e):n}e.addMergeToJSMap=a,e.isMergeKey=i,e.merge=r})),Qy=/* @__PURE__ */ L((e=>{var t=Xy(),n=Zy(),r=Jy(),i=Q(),a=zy();function o(e,n,a){if(n===null)return``;if(typeof n!=`object`)return String(n);if(i.isNode(e)&&a?.doc){let n=r.createStringifyContext(a.doc,{});n.anchors=/* @__PURE__ */ new Set;for(let e of a.anchors.keys())n.anchors.add(e.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=e.toString(n);if(!a.mapKeyWarned){let e=JSON.stringify(i);e.length>40&&(e=e.substring(0,36)+`..."`),t.warn(a.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),a.mapKeyWarned=!0}return i}return JSON.stringify(n)}e.addPairToJSMap=function(e,t,{key:r,value:s}){if(i.isNode(r)&&r.addToJSMap)r.addToJSMap(e,t,s);else if(n.isMergeKey(e,r))n.addMergeToJSMap(e,t,s);else{let n=a.toJS(r,``,e);if(t instanceof Map)t.set(n,a.toJS(s,n,e));else if(t instanceof Set)t.add(n);else{let i=o(r,n,e),c=a.toJS(s,i,e);i in t?Object.defineProperty(t,i,{value:c,writable:!0,enumerable:!0,configurable:!0}):t[i]=c}}return t}})),$y=/* @__PURE__ */ L((e=>{var t=Uy(),n=Yy(),r=Qy(),i=Q(),a=class e{constructor(e,t=null){Object.defineProperty(this,i.NODE_TYPE,{value:i.PAIR}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return i.isNode(n)&&(n=n.clone(t)),i.isNode(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){let n=t?.mapAsMap?/* @__PURE__ */ new Map:{};return r.addPairToJSMap(t,n,this)}toString(e,t,r){return e?.doc?n.stringifyPair(this,e,t,r):JSON.stringify(this)}};e.Pair=a,e.createPair=function(e,n,r){return new a(t.createNode(e,void 0,r),t.createNode(n,void 0,r))}})),eb=/* @__PURE__ */ L((e=>{var t=Q(),n=Jy(),r=Gy();function i({comment:e,items:i},a,{blockItemPrefix:s,flowChars:c,itemIndent:l,onChompKeep:u,onComment:d}){let{indent:f,options:{commentString:p}}=a,m=Object.assign({},a,{indent:l,type:null}),h=!1,g=[];for(let e=0;e<i.length;++e){let c=i[e],u=null;if(t.isNode(c))!h&&c.spaceBefore&&g.push(``),o(a,g,c.commentBefore,h),c.comment&&(u=c.comment);else if(t.isPair(c)){let e=t.isNode(c.key)?c.key:null;e&&(!h&&e.spaceBefore&&g.push(``),o(a,g,e.commentBefore,h))}h=!1;let d=n.stringify(c,m,()=>u=null,()=>h=!0);u&&(d+=r.lineComment(d,l,p(u))),h&&u&&(h=!1),g.push(s+d)}let _;if(g.length===0)_=c.start+c.end;else{_=g[0];for(let e=1;e<g.length;++e){let t=g[e];_+=t?`\n${f}${t}`:`
217
217
  `}}return e?(_+=`
218
218
  `+r.indentComment(p(e),f),d&&d()):h&&u&&u(),_}function a({items:e},i,{flowChars:a,itemIndent:s}){let{indent:c,indentStep:l,flowCollectionPadding:u,options:{commentString:d}}=i;s+=l;let f=Object.assign({},i,{indent:s,inFlow:!0,type:null}),p=!1,m=0,h=[];for(let a=0;a<e.length;++a){let c=e[a],l=null;if(t.isNode(c))c.spaceBefore&&h.push(``),o(i,h,c.commentBefore,!1),c.comment&&(l=c.comment);else if(t.isPair(c)){let e=t.isNode(c.key)?c.key:null;e&&(e.spaceBefore&&h.push(``),o(i,h,e.commentBefore,!1),e.comment&&(p=!0));let n=t.isNode(c.value)?c.value:null;n?(n.comment&&(l=n.comment),n.commentBefore&&(p=!0)):c.value==null&&e?.comment&&(l=e.comment)}l&&(p=!0);let u=n.stringify(c,f,()=>l=null);p||=h.length>m||u.includes(`
219
219
  `),a<e.length-1?u+=`,`:i.options.trailingComma&&(i.options.lineWidth>0&&(p||=h.reduce((e,t)=>e+t.length+2,2)+(u.length+2)>i.options.lineWidth),p&&(u+=`,`)),l&&(u+=r.lineComment(u,s,d(l))),h.push(u),m=h.length}let{start:g,end:_}=a;if(h.length===0)return g+_;if(!p){let e=h.reduce((e,t)=>e+t.length+2,2);p=i.options.lineWidth>0&&e>i.options.lineWidth}if(p){let e=g;for(let t of h)e+=t?`\n${l}${c}${t}`:`
220
- `;return`${e}\n${c}${_}`}return`${g}${u}${h.join(` `)}${u}${_}`}function o({indent:e,options:{commentString:t}},n,i,a){if(i&&a&&(i=i.replace(/^\n+/,``)),i){let a=r.indentComment(t(i),e);n.push(a.trimStart())}}e.stringifyCollection=function(e,t,n){return(t.inFlow??e.flow?a:i)(e,t,n)}})),eb=/* @__PURE__ */ L((e=>{var t=$y(),n=Zy(),r=Uy(),i=Q(),a=Qy(),o=Vy();function s(e,t){let n=i.isScalar(t)?t.value:t;for(let r of e)if(i.isPair(r)&&(r.key===t||r.key===n||i.isScalar(r.key)&&r.key.value===n))return r}e.YAMLMap=class extends r.Collection{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(i.MAP,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,o=new this(e),s=(e,s)=>{if(typeof i==`function`)s=i.call(t,e,s);else if(Array.isArray(i)&&!i.includes(e))return;(s!==void 0||r)&&o.items.push(a.createPair(e,s,n))};if(t instanceof Map)for(let[e,n]of t)s(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))s(e,t[e]);return typeof e.sortMapEntries==`function`&&o.items.sort(e.sortMapEntries),o}add(e,t){let n;n=i.isPair(e)?e:!e||typeof e!=`object`||!(`key`in e)?new a.Pair(e,e?.value):new a.Pair(e.key,e.value);let r=s(this.items,n.key),c=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);i.isScalar(r.value)&&o.isScalarValue(n.value)?r.value.value=n.value:r.value=n.value}else if(c){let e=this.items.findIndex(e=>c(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=s(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=s(this.items,e)?.value;return(!t&&i.isScalar(n)?n.value:n)??void 0}has(e){return!!s(this.items,e)}set(e,t){this.add(new a.Pair(e,t),!0)}toJSON(e,t,r){let i=r?new r:t?.mapAsMap?/* @__PURE__ */ new Map:{};t?.onCreate&&t.onCreate(i);for(let e of this.items)n.addPairToJSMap(t,i,e);return i}toString(e,n,r){if(!e)return JSON.stringify(this);for(let e of this.items)if(!i.isPair(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),t.stringifyCollection(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:r,onComment:n})}},e.findPair=s})),tb=/* @__PURE__ */ L((e=>{var t=Q(),n=eb();e.map={collection:`map`,default:!0,nodeClass:n.YAMLMap,tag:`tag:yaml.org,2002:map`,resolve(e,n){return t.isMap(e)||n(`Expected a mapping for this tag`),e},createNode:(e,t,r)=>n.YAMLMap.from(e,t,r)}})),nb=/* @__PURE__ */ L((e=>{var t=Hy(),n=$y(),r=Uy(),i=Q(),a=Vy(),o=Ry(),s=class extends r.Collection{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(i.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=c(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=c(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&i.isScalar(r)?r.value:r}has(e){let t=c(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=c(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];i.isScalar(r)&&a.isScalarValue(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(o.toJS(e,String(r++),t));return n}toString(e,t,r){return e?n.stringifyCollection(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:r,onComment:t}):JSON.stringify(this)}static from(e,n,r){let{replacer:i}=r,a=new this(e);if(n&&Symbol.iterator in Object(n)){let e=0;for(let o of n){if(typeof i==`function`){let t=n instanceof Set?o:String(e++);o=i.call(n,t,o)}a.items.push(t.createNode(o,void 0,r))}}return a}};function c(e){let t=i.isScalar(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}e.YAMLSeq=s})),rb=/* @__PURE__ */ L((e=>{var t=Q(),n=nb();e.seq={collection:`seq`,default:!0,nodeClass:n.YAMLSeq,tag:`tag:yaml.org,2002:seq`,resolve(e,n){return t.isSeq(e)||n(`Expected a sequence for this tag`),e},createNode:(e,t,r)=>n.YAMLSeq.from(e,t,r)}})),ib=/* @__PURE__ */ L((e=>{var t=Ky();e.string={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,n,r,i){return n=Object.assign({actualString:!0},n),t.stringifyString(e,n,r,i)}}})),ab=/* @__PURE__ */ L((e=>{var t=Vy();let n={identify:e=>e==null,createNode:()=>new t.Scalar(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new t.Scalar(null),stringify:({source:e},t)=>typeof e==`string`&&n.test.test(e)?e:t.options.nullStr};e.nullTag=n})),ob=/* @__PURE__ */ L((e=>{var t=Vy();let n={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new t.Scalar(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},r){return e&&n.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?r.options.trueStr:r.options.falseStr}};e.boolTag=n})),sb=/* @__PURE__ */ L((e=>{e.stringifyNumber=function({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}})),cb=/* @__PURE__ */ L((e=>{var t=Vy(),n=sb();let r={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:n.stringifyNumber};e.float={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let n=new t.Scalar(parseFloat(e)),r=e.indexOf(`.`);return r!==-1&&e[e.length-1]===`0`&&(n.minFractionDigits=e.length-r-1),n},stringify:n.stringifyNumber},e.floatExp={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}},e.floatNaN=r})),lb=/* @__PURE__ */ L((e=>{var t=sb();let n=e=>typeof e==`bigint`||Number.isInteger(e),r=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function i(e,r,i){let{value:a}=e;return n(a)&&a>=0?i+a.toString(r):t.stringifyNumber(e)}e.int={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>r(e,0,10,n),stringify:t.stringifyNumber},e.intHex={identify:e=>n(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>r(e,2,16,n),stringify:e=>i(e,16,`0x`)},e.intOct={identify:e=>n(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>r(e,2,8,n),stringify:e=>i(e,8,`0o`)}})),ub=/* @__PURE__ */ L((e=>{var t=tb(),n=ab(),r=rb(),i=ib(),a=ob(),o=cb(),s=lb();e.schema=[t.map,r.seq,i.string,n.nullTag,a.boolTag,s.intOct,s.int,s.intHex,o.floatNaN,o.floatExp,o.float]})),db=/* @__PURE__ */ L((e=>{var t=Vy(),n=tb(),r=rb();function i(e){return typeof e==`bigint`||Number.isInteger(e)}let a=({value:e})=>JSON.stringify(e),o=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:a},{identify:e=>e==null,createNode:()=>new t.Scalar(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:a},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:a},{identify:i,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>i(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:a}];e.schema=[n.map,r.seq].concat(o,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}})})),fb=/* @__PURE__ */ L((e=>{var t=z(`buffer`),n=Vy(),r=Ky();e.binary={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,n){if(typeof t.Buffer==`function`)return t.Buffer.from(e,`base64`);if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}return n(`This environment does not support reading binary tags; either Buffer or atob is required`),e},stringify({comment:e,type:i,value:a},o,s,c){if(!a)return``;let l=a,u;if(typeof t.Buffer==`function`)u=l instanceof t.Buffer?l.toString(`base64`):t.Buffer.from(l.buffer).toString(`base64`);else if(typeof btoa==`function`){let e=``;for(let t=0;t<l.length;++t)e+=String.fromCharCode(l[t]);u=btoa(e)}else throw Error(`This environment does not support writing binary tags; either Buffer or btoa is required`);if(i??=n.Scalar.BLOCK_LITERAL,i!==n.Scalar.QUOTE_DOUBLE){let e=Math.max(o.options.lineWidth-o.indent.length,o.options.minContentWidth),t=Math.ceil(u.length/e),r=Array(t);for(let n=0,i=0;n<t;++n,i+=e)r[n]=u.substr(i,e);u=r.join(i===n.Scalar.BLOCK_LITERAL?`
221
- `:` `)}return r.stringifyString({comment:e,type:i,value:u},o,s,c)}}})),pb=/* @__PURE__ */ L((e=>{var t=Q(),n=Qy(),r=Vy(),i=nb();function a(e,i){if(t.isSeq(e))for(let a=0;a<e.items.length;++a){let o=e.items[a];if(!t.isPair(o)){if(t.isMap(o)){o.items.length>1&&i(`Each pair must have its own sequence indicator`);let e=o.items[0]||new n.Pair(new r.Scalar(null));if(o.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${o.commentBefore}\n${e.key.commentBefore}`:o.commentBefore),o.comment){let t=e.value??e.key;t.comment=t.comment?`${o.comment}\n${t.comment}`:o.comment}o=e}e.items[a]=t.isPair(o)?o:new n.Pair(o)}}else i(`Expected a sequence for this tag`);return e}function o(e,t,r){let{replacer:a}=r,o=new i.YAMLSeq(e);o.tag=`tag:yaml.org,2002:pairs`;let s=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof a==`function`&&(e=a.call(t,String(s++),e));let i,c;if(Array.isArray(e)){if(e.length===2)i=e[0],c=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)i=t[0],c=e[i];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else i=e;o.items.push(n.createPair(i,c,r))}return o}let s={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:a,createNode:o};e.createPairs=o,e.pairs=s,e.resolvePairs=a})),mb=/* @__PURE__ */ L((e=>{var t=Q(),n=Ry(),r=eb(),i=nb(),a=pb(),o=class e extends i.YAMLSeq{constructor(){super(),this.add=r.YAMLMap.prototype.add.bind(this),this.delete=r.YAMLMap.prototype.delete.bind(this),this.get=r.YAMLMap.prototype.get.bind(this),this.has=r.YAMLMap.prototype.has.bind(this),this.set=r.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(e,r){if(!r)return super.toJSON(e);let i=/* @__PURE__ */ new Map;r?.onCreate&&r.onCreate(i);for(let e of this.items){let a,o;if(t.isPair(e)?(a=n.toJS(e.key,``,r),o=n.toJS(e.value,a,r)):a=n.toJS(e,``,r),i.has(a))throw Error(`Ordered maps must not include duplicate keys`);i.set(a,o)}return i}static from(e,t,n){let r=a.createPairs(e,t,n),i=new this;return i.items=r.items,i}};o.tag=`tag:yaml.org,2002:omap`;let s={collection:`seq`,identify:e=>e instanceof Map,nodeClass:o,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,n){let r=a.resolvePairs(e,n),i=[];for(let{key:e}of r.items)t.isScalar(e)&&(i.includes(e.value)?n(`Ordered maps must not include duplicate keys: ${e.value}`):i.push(e.value));return Object.assign(new o,r)},createNode:(e,t,n)=>o.from(e,t,n)};e.YAMLOMap=o,e.omap=s})),hb=/* @__PURE__ */ L((e=>{var t=Vy();function n({value:e,source:t},n){return t&&(e?r:i).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}let r={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new t.Scalar(!0),stringify:n},i={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new t.Scalar(!1),stringify:n};e.falseTag=i,e.trueTag=r})),gb=/* @__PURE__ */ L((e=>{var t=Vy(),n=sb();let r={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:n.stringifyNumber};e.float={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let n=new t.Scalar(parseFloat(e.replace(/_/g,``))),r=e.indexOf(`.`);if(r!==-1){let t=e.substring(r+1).replace(/_/g,``);t[t.length-1]===`0`&&(n.minFractionDigits=t.length)}return n},stringify:n.stringifyNumber},e.floatExp={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}},e.floatNaN=r})),_b=/* @__PURE__ */ L((e=>{var t=sb();let n=e=>typeof e==`bigint`||Number.isInteger(e);function r(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function i(e,r,i){let{value:a}=e;if(n(a)){let e=a.toString(r);return a<0?`-`+i+e.substr(1):i+e}return t.stringifyNumber(e)}let a={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>r(e,2,2,n),stringify:e=>i(e,2,`0b`)},o={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>r(e,1,8,n),stringify:e=>i(e,8,`0`)},s={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>r(e,0,10,n),stringify:t.stringifyNumber},c={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>r(e,2,16,n),stringify:e=>i(e,16,`0x`)};e.int=s,e.intBin=a,e.intHex=c,e.intOct=o})),vb=/* @__PURE__ */ L((e=>{var t=Q(),n=Qy(),r=eb(),i=class e extends r.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(e){let i;i=t.isPair(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new n.Pair(e.key,null):new n.Pair(e,null),r.findPair(this.items,i.key)||this.items.push(i)}get(e,n){let i=r.findPair(this.items,e);return!n&&t.isPair(i)?t.isScalar(i.key)?i.key.value:i.key:i}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let i=r.findPair(this.items,e);i&&!t?this.items.splice(this.items.indexOf(i),1):!i&&t&&this.items.push(new n.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,r){let{replacer:i}=r,a=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof i==`function`&&(e=i.call(t,e,e)),a.items.push(n.createPair(e,null,r));return a}};i.tag=`tag:yaml.org,2002:set`;let a={collection:`map`,identify:e=>e instanceof Set,nodeClass:i,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>i.from(e,t,n),resolve(e,n){if(t.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new i,e);n(`Set items must all have null values`)}else n(`Expected a mapping for this tag`);return e}};e.YAMLSet=i,e.set=a})),yb=/* @__PURE__ */ L((e=>{var t=sb();function n(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function r(e){let{value:n}=e,r=e=>e;if(typeof n==`bigint`)r=e=>BigInt(e);else if(isNaN(n)||!isFinite(n))return t.stringifyNumber(e);let i=``;n<0&&(i=`-`,n*=r(-1));let a=r(60),o=[n%a];return n<60?o.unshift(0):(n=(n-o[0])/a,o.unshift(n%a),n>=60&&(n=(n-o[0])/a,o.unshift(n))),i+o.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}let i={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:r})=>n(e,r),stringify:r},a={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>n(e,!1),stringify:r},o={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(o.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,r,i,a,s,c,l]=t.map(Number),u=t[7]?Number((t[7]+`00`).substr(1,3)):0,d=Date.UTC(r,i-1,a,s||0,c||0,l||0,u),f=t[8];if(f&&f!==`Z`){let e=n(f,!1);Math.abs(e)<30&&(e*=60),d-=6e4*e}return new Date(d)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``};e.floatTime=a,e.intTime=i,e.timestamp=o})),bb=/* @__PURE__ */ L((e=>{var t=tb(),n=ab(),r=rb(),i=ib(),a=fb(),o=hb(),s=gb(),c=_b(),l=Xy(),u=mb(),d=pb(),f=vb(),p=yb();e.schema=[t.map,r.seq,i.string,n.nullTag,o.trueTag,o.falseTag,c.intBin,c.intOct,c.int,c.intHex,s.floatNaN,s.floatExp,s.float,a.binary,l.merge,u.omap,d.pairs,f.set,p.intTime,p.floatTime,p.timestamp]})),xb=/* @__PURE__ */ L((e=>{var t=tb(),n=ab(),r=rb(),i=ib(),a=ob(),o=cb(),s=lb(),c=ub(),l=db(),u=fb(),d=Xy(),f=mb(),p=pb(),m=bb(),h=vb(),g=yb();let _=/* @__PURE__ */ new Map([[`core`,c.schema],[`failsafe`,[t.map,r.seq,i.string]],[`json`,l.schema],[`yaml11`,m.schema],[`yaml-1.1`,m.schema]]),v={binary:u.binary,bool:a.boolTag,float:o.float,floatExp:o.floatExp,floatNaN:o.floatNaN,floatTime:g.floatTime,int:s.int,intHex:s.intHex,intOct:s.intOct,intTime:g.intTime,map:t.map,merge:d.merge,null:n.nullTag,omap:f.omap,pairs:p.pairs,seq:r.seq,set:h.set,timestamp:g.timestamp};e.coreKnownTags={"tag:yaml.org,2002:binary":u.binary,"tag:yaml.org,2002:merge":d.merge,"tag:yaml.org,2002:omap":f.omap,"tag:yaml.org,2002:pairs":p.pairs,"tag:yaml.org,2002:set":h.set,"tag:yaml.org,2002:timestamp":g.timestamp},e.getTags=function(e,t,n){let r=_.get(t);if(r&&!e)return n&&!r.includes(d.merge)?r.concat(d.merge):r.slice();let i=r;if(!i){if(Array.isArray(e))i=[];else{let e=Array.from(_.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(d.merge)),i.reduce((e,t)=>{let n=typeof t==`string`?v[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(v).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}})),Sb=/* @__PURE__ */ L((e=>{var t=Q(),n=tb(),r=rb(),i=ib(),a=xb();let o=(e,t)=>e.key<t.key?-1:+(e.key>t.key);e.Schema=class e{constructor({compat:e,customTags:s,merge:c,resolveKnownTags:l,schema:u,sortMapEntries:d,toStringDefaults:f}){this.compat=Array.isArray(e)?a.getTags(e,`compat`):e?a.getTags(null,e):null,this.name=typeof u==`string`&&u||`core`,this.knownTags=l?a.coreKnownTags:{},this.tags=a.getTags(s,this.name,c),this.toStringOptions=f??null,Object.defineProperty(this,t.MAP,{value:n.map}),Object.defineProperty(this,t.SCALAR,{value:i.string}),Object.defineProperty(this,t.SEQ,{value:r.seq}),this.sortMapEntries=typeof d==`function`?d:d===!0?o:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}})),Cb=/* @__PURE__ */ L((e=>{var t=Q(),n=qy(),r=Wy();e.stringifyDocument=function(e,i){let a=[],o=i.directives===!0;if(i.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(a.push(t),o=!0):e.directives.docStart&&(o=!0)}o&&a.push(`---`);let s=n.createStringifyContext(e,i),{commentString:c}=s.options;if(e.commentBefore){a.length!==1&&a.unshift(``);let t=c(e.commentBefore);a.unshift(r.indentComment(t,``))}let l=!1,u=null;if(e.contents){if(t.isNode(e.contents)){if(e.contents.spaceBefore&&o&&a.push(``),e.contents.commentBefore){let t=c(e.contents.commentBefore);a.push(r.indentComment(t,``))}s.forceBlockIndent=!!e.comment,u=e.contents.comment}let i=u?void 0:()=>l=!0,d=n.stringify(e.contents,s,()=>u=null,i);u&&(d+=r.lineComment(d,``,c(u))),(d[0]===`|`||d[0]===`>`)&&a[a.length-1]===`---`?a[a.length-1]=`--- ${d}`:a.push(d)}else a.push(n.stringify(e.contents,s));if(e.directives?.docEnd){if(e.comment){let t=c(e.comment);t.includes(`
220
+ `;return`${e}\n${c}${_}`}return`${g}${u}${h.join(` `)}${u}${_}`}function o({indent:e,options:{commentString:t}},n,i,a){if(i&&a&&(i=i.replace(/^\n+/,``)),i){let a=r.indentComment(t(i),e);n.push(a.trimStart())}}e.stringifyCollection=function(e,t,n){return(t.inFlow??e.flow?a:i)(e,t,n)}})),tb=/* @__PURE__ */ L((e=>{var t=eb(),n=Qy(),r=Wy(),i=Q(),a=$y(),o=Hy();function s(e,t){let n=i.isScalar(t)?t.value:t;for(let r of e)if(i.isPair(r)&&(r.key===t||r.key===n||i.isScalar(r.key)&&r.key.value===n))return r}e.YAMLMap=class extends r.Collection{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(i.MAP,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,o=new this(e),s=(e,s)=>{if(typeof i==`function`)s=i.call(t,e,s);else if(Array.isArray(i)&&!i.includes(e))return;(s!==void 0||r)&&o.items.push(a.createPair(e,s,n))};if(t instanceof Map)for(let[e,n]of t)s(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))s(e,t[e]);return typeof e.sortMapEntries==`function`&&o.items.sort(e.sortMapEntries),o}add(e,t){let n;n=i.isPair(e)?e:!e||typeof e!=`object`||!(`key`in e)?new a.Pair(e,e?.value):new a.Pair(e.key,e.value);let r=s(this.items,n.key),c=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);i.isScalar(r.value)&&o.isScalarValue(n.value)?r.value.value=n.value:r.value=n.value}else if(c){let e=this.items.findIndex(e=>c(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=s(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=s(this.items,e)?.value;return(!t&&i.isScalar(n)?n.value:n)??void 0}has(e){return!!s(this.items,e)}set(e,t){this.add(new a.Pair(e,t),!0)}toJSON(e,t,r){let i=r?new r:t?.mapAsMap?/* @__PURE__ */ new Map:{};t?.onCreate&&t.onCreate(i);for(let e of this.items)n.addPairToJSMap(t,i,e);return i}toString(e,n,r){if(!e)return JSON.stringify(this);for(let e of this.items)if(!i.isPair(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),t.stringifyCollection(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:r,onComment:n})}},e.findPair=s})),nb=/* @__PURE__ */ L((e=>{var t=Q(),n=tb();e.map={collection:`map`,default:!0,nodeClass:n.YAMLMap,tag:`tag:yaml.org,2002:map`,resolve(e,n){return t.isMap(e)||n(`Expected a mapping for this tag`),e},createNode:(e,t,r)=>n.YAMLMap.from(e,t,r)}})),rb=/* @__PURE__ */ L((e=>{var t=Uy(),n=eb(),r=Wy(),i=Q(),a=Hy(),o=zy(),s=class extends r.Collection{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(i.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=c(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=c(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&i.isScalar(r)?r.value:r}has(e){let t=c(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=c(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];i.isScalar(r)&&a.isScalarValue(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(o.toJS(e,String(r++),t));return n}toString(e,t,r){return e?n.stringifyCollection(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:r,onComment:t}):JSON.stringify(this)}static from(e,n,r){let{replacer:i}=r,a=new this(e);if(n&&Symbol.iterator in Object(n)){let e=0;for(let o of n){if(typeof i==`function`){let t=n instanceof Set?o:String(e++);o=i.call(n,t,o)}a.items.push(t.createNode(o,void 0,r))}}return a}};function c(e){let t=i.isScalar(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}e.YAMLSeq=s})),ib=/* @__PURE__ */ L((e=>{var t=Q(),n=rb();e.seq={collection:`seq`,default:!0,nodeClass:n.YAMLSeq,tag:`tag:yaml.org,2002:seq`,resolve(e,n){return t.isSeq(e)||n(`Expected a sequence for this tag`),e},createNode:(e,t,r)=>n.YAMLSeq.from(e,t,r)}})),ab=/* @__PURE__ */ L((e=>{var t=qy();e.string={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,n,r,i){return n=Object.assign({actualString:!0},n),t.stringifyString(e,n,r,i)}}})),ob=/* @__PURE__ */ L((e=>{var t=Hy();let n={identify:e=>e==null,createNode:()=>new t.Scalar(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new t.Scalar(null),stringify:({source:e},t)=>typeof e==`string`&&n.test.test(e)?e:t.options.nullStr};e.nullTag=n})),sb=/* @__PURE__ */ L((e=>{var t=Hy();let n={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new t.Scalar(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},r){return e&&n.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?r.options.trueStr:r.options.falseStr}};e.boolTag=n})),cb=/* @__PURE__ */ L((e=>{e.stringifyNumber=function({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}})),lb=/* @__PURE__ */ L((e=>{var t=Hy(),n=cb();let r={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:n.stringifyNumber};e.float={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let n=new t.Scalar(parseFloat(e)),r=e.indexOf(`.`);return r!==-1&&e[e.length-1]===`0`&&(n.minFractionDigits=e.length-r-1),n},stringify:n.stringifyNumber},e.floatExp={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}},e.floatNaN=r})),ub=/* @__PURE__ */ L((e=>{var t=cb();let n=e=>typeof e==`bigint`||Number.isInteger(e),r=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function i(e,r,i){let{value:a}=e;return n(a)&&a>=0?i+a.toString(r):t.stringifyNumber(e)}e.int={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>r(e,0,10,n),stringify:t.stringifyNumber},e.intHex={identify:e=>n(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>r(e,2,16,n),stringify:e=>i(e,16,`0x`)},e.intOct={identify:e=>n(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>r(e,2,8,n),stringify:e=>i(e,8,`0o`)}})),db=/* @__PURE__ */ L((e=>{var t=nb(),n=ob(),r=ib(),i=ab(),a=sb(),o=lb(),s=ub();e.schema=[t.map,r.seq,i.string,n.nullTag,a.boolTag,s.intOct,s.int,s.intHex,o.floatNaN,o.floatExp,o.float]})),fb=/* @__PURE__ */ L((e=>{var t=Hy(),n=nb(),r=ib();function i(e){return typeof e==`bigint`||Number.isInteger(e)}let a=({value:e})=>JSON.stringify(e),o=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:a},{identify:e=>e==null,createNode:()=>new t.Scalar(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:a},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:a},{identify:i,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>i(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:a}];e.schema=[n.map,r.seq].concat(o,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}})})),pb=/* @__PURE__ */ L((e=>{var t=z(`buffer`),n=Hy(),r=qy();e.binary={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,n){if(typeof t.Buffer==`function`)return t.Buffer.from(e,`base64`);if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}return n(`This environment does not support reading binary tags; either Buffer or atob is required`),e},stringify({comment:e,type:i,value:a},o,s,c){if(!a)return``;let l=a,u;if(typeof t.Buffer==`function`)u=l instanceof t.Buffer?l.toString(`base64`):t.Buffer.from(l.buffer).toString(`base64`);else if(typeof btoa==`function`){let e=``;for(let t=0;t<l.length;++t)e+=String.fromCharCode(l[t]);u=btoa(e)}else throw Error(`This environment does not support writing binary tags; either Buffer or btoa is required`);if(i??=n.Scalar.BLOCK_LITERAL,i!==n.Scalar.QUOTE_DOUBLE){let e=Math.max(o.options.lineWidth-o.indent.length,o.options.minContentWidth),t=Math.ceil(u.length/e),r=Array(t);for(let n=0,i=0;n<t;++n,i+=e)r[n]=u.substr(i,e);u=r.join(i===n.Scalar.BLOCK_LITERAL?`
221
+ `:` `)}return r.stringifyString({comment:e,type:i,value:u},o,s,c)}}})),mb=/* @__PURE__ */ L((e=>{var t=Q(),n=$y(),r=Hy(),i=rb();function a(e,i){if(t.isSeq(e))for(let a=0;a<e.items.length;++a){let o=e.items[a];if(!t.isPair(o)){if(t.isMap(o)){o.items.length>1&&i(`Each pair must have its own sequence indicator`);let e=o.items[0]||new n.Pair(new r.Scalar(null));if(o.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${o.commentBefore}\n${e.key.commentBefore}`:o.commentBefore),o.comment){let t=e.value??e.key;t.comment=t.comment?`${o.comment}\n${t.comment}`:o.comment}o=e}e.items[a]=t.isPair(o)?o:new n.Pair(o)}}else i(`Expected a sequence for this tag`);return e}function o(e,t,r){let{replacer:a}=r,o=new i.YAMLSeq(e);o.tag=`tag:yaml.org,2002:pairs`;let s=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof a==`function`&&(e=a.call(t,String(s++),e));let i,c;if(Array.isArray(e)){if(e.length===2)i=e[0],c=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)i=t[0],c=e[i];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else i=e;o.items.push(n.createPair(i,c,r))}return o}let s={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:a,createNode:o};e.createPairs=o,e.pairs=s,e.resolvePairs=a})),hb=/* @__PURE__ */ L((e=>{var t=Q(),n=zy(),r=tb(),i=rb(),a=mb(),o=class e extends i.YAMLSeq{constructor(){super(),this.add=r.YAMLMap.prototype.add.bind(this),this.delete=r.YAMLMap.prototype.delete.bind(this),this.get=r.YAMLMap.prototype.get.bind(this),this.has=r.YAMLMap.prototype.has.bind(this),this.set=r.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(e,r){if(!r)return super.toJSON(e);let i=/* @__PURE__ */ new Map;r?.onCreate&&r.onCreate(i);for(let e of this.items){let a,o;if(t.isPair(e)?(a=n.toJS(e.key,``,r),o=n.toJS(e.value,a,r)):a=n.toJS(e,``,r),i.has(a))throw Error(`Ordered maps must not include duplicate keys`);i.set(a,o)}return i}static from(e,t,n){let r=a.createPairs(e,t,n),i=new this;return i.items=r.items,i}};o.tag=`tag:yaml.org,2002:omap`;let s={collection:`seq`,identify:e=>e instanceof Map,nodeClass:o,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,n){let r=a.resolvePairs(e,n),i=[];for(let{key:e}of r.items)t.isScalar(e)&&(i.includes(e.value)?n(`Ordered maps must not include duplicate keys: ${e.value}`):i.push(e.value));return Object.assign(new o,r)},createNode:(e,t,n)=>o.from(e,t,n)};e.YAMLOMap=o,e.omap=s})),gb=/* @__PURE__ */ L((e=>{var t=Hy();function n({value:e,source:t},n){return t&&(e?r:i).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}let r={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new t.Scalar(!0),stringify:n},i={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new t.Scalar(!1),stringify:n};e.falseTag=i,e.trueTag=r})),_b=/* @__PURE__ */ L((e=>{var t=Hy(),n=cb();let r={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:n.stringifyNumber};e.float={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let n=new t.Scalar(parseFloat(e.replace(/_/g,``))),r=e.indexOf(`.`);if(r!==-1){let t=e.substring(r+1).replace(/_/g,``);t[t.length-1]===`0`&&(n.minFractionDigits=t.length)}return n},stringify:n.stringifyNumber},e.floatExp={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}},e.floatNaN=r})),vb=/* @__PURE__ */ L((e=>{var t=cb();let n=e=>typeof e==`bigint`||Number.isInteger(e);function r(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function i(e,r,i){let{value:a}=e;if(n(a)){let e=a.toString(r);return a<0?`-`+i+e.substr(1):i+e}return t.stringifyNumber(e)}let a={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>r(e,2,2,n),stringify:e=>i(e,2,`0b`)},o={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>r(e,1,8,n),stringify:e=>i(e,8,`0`)},s={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>r(e,0,10,n),stringify:t.stringifyNumber},c={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>r(e,2,16,n),stringify:e=>i(e,16,`0x`)};e.int=s,e.intBin=a,e.intHex=c,e.intOct=o})),yb=/* @__PURE__ */ L((e=>{var t=Q(),n=$y(),r=tb(),i=class e extends r.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(e){let i;i=t.isPair(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new n.Pair(e.key,null):new n.Pair(e,null),r.findPair(this.items,i.key)||this.items.push(i)}get(e,n){let i=r.findPair(this.items,e);return!n&&t.isPair(i)?t.isScalar(i.key)?i.key.value:i.key:i}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let i=r.findPair(this.items,e);i&&!t?this.items.splice(this.items.indexOf(i),1):!i&&t&&this.items.push(new n.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,r){let{replacer:i}=r,a=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof i==`function`&&(e=i.call(t,e,e)),a.items.push(n.createPair(e,null,r));return a}};i.tag=`tag:yaml.org,2002:set`;let a={collection:`map`,identify:e=>e instanceof Set,nodeClass:i,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>i.from(e,t,n),resolve(e,n){if(t.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new i,e);n(`Set items must all have null values`)}else n(`Expected a mapping for this tag`);return e}};e.YAMLSet=i,e.set=a})),bb=/* @__PURE__ */ L((e=>{var t=cb();function n(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function r(e){let{value:n}=e,r=e=>e;if(typeof n==`bigint`)r=e=>BigInt(e);else if(isNaN(n)||!isFinite(n))return t.stringifyNumber(e);let i=``;n<0&&(i=`-`,n*=r(-1));let a=r(60),o=[n%a];return n<60?o.unshift(0):(n=(n-o[0])/a,o.unshift(n%a),n>=60&&(n=(n-o[0])/a,o.unshift(n))),i+o.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}let i={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:r})=>n(e,r),stringify:r},a={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>n(e,!1),stringify:r},o={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(o.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,r,i,a,s,c,l]=t.map(Number),u=t[7]?Number((t[7]+`00`).substr(1,3)):0,d=Date.UTC(r,i-1,a,s||0,c||0,l||0,u),f=t[8];if(f&&f!==`Z`){let e=n(f,!1);Math.abs(e)<30&&(e*=60),d-=6e4*e}return new Date(d)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``};e.floatTime=a,e.intTime=i,e.timestamp=o})),xb=/* @__PURE__ */ L((e=>{var t=nb(),n=ob(),r=ib(),i=ab(),a=pb(),o=gb(),s=_b(),c=vb(),l=Zy(),u=hb(),d=mb(),f=yb(),p=bb();e.schema=[t.map,r.seq,i.string,n.nullTag,o.trueTag,o.falseTag,c.intBin,c.intOct,c.int,c.intHex,s.floatNaN,s.floatExp,s.float,a.binary,l.merge,u.omap,d.pairs,f.set,p.intTime,p.floatTime,p.timestamp]})),Sb=/* @__PURE__ */ L((e=>{var t=nb(),n=ob(),r=ib(),i=ab(),a=sb(),o=lb(),s=ub(),c=db(),l=fb(),u=pb(),d=Zy(),f=hb(),p=mb(),m=xb(),h=yb(),g=bb();let _=/* @__PURE__ */ new Map([[`core`,c.schema],[`failsafe`,[t.map,r.seq,i.string]],[`json`,l.schema],[`yaml11`,m.schema],[`yaml-1.1`,m.schema]]),v={binary:u.binary,bool:a.boolTag,float:o.float,floatExp:o.floatExp,floatNaN:o.floatNaN,floatTime:g.floatTime,int:s.int,intHex:s.intHex,intOct:s.intOct,intTime:g.intTime,map:t.map,merge:d.merge,null:n.nullTag,omap:f.omap,pairs:p.pairs,seq:r.seq,set:h.set,timestamp:g.timestamp};e.coreKnownTags={"tag:yaml.org,2002:binary":u.binary,"tag:yaml.org,2002:merge":d.merge,"tag:yaml.org,2002:omap":f.omap,"tag:yaml.org,2002:pairs":p.pairs,"tag:yaml.org,2002:set":h.set,"tag:yaml.org,2002:timestamp":g.timestamp},e.getTags=function(e,t,n){let r=_.get(t);if(r&&!e)return n&&!r.includes(d.merge)?r.concat(d.merge):r.slice();let i=r;if(!i){if(Array.isArray(e))i=[];else{let e=Array.from(_.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(d.merge)),i.reduce((e,t)=>{let n=typeof t==`string`?v[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(v).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}})),Cb=/* @__PURE__ */ L((e=>{var t=Q(),n=nb(),r=ib(),i=ab(),a=Sb();let o=(e,t)=>e.key<t.key?-1:+(e.key>t.key);e.Schema=class e{constructor({compat:e,customTags:s,merge:c,resolveKnownTags:l,schema:u,sortMapEntries:d,toStringDefaults:f}){this.compat=Array.isArray(e)?a.getTags(e,`compat`):e?a.getTags(null,e):null,this.name=typeof u==`string`&&u||`core`,this.knownTags=l?a.coreKnownTags:{},this.tags=a.getTags(s,this.name,c),this.toStringOptions=f??null,Object.defineProperty(this,t.MAP,{value:n.map}),Object.defineProperty(this,t.SCALAR,{value:i.string}),Object.defineProperty(this,t.SEQ,{value:r.seq}),this.sortMapEntries=typeof d==`function`?d:d===!0?o:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}})),wb=/* @__PURE__ */ L((e=>{var t=Q(),n=Jy(),r=Gy();e.stringifyDocument=function(e,i){let a=[],o=i.directives===!0;if(i.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(a.push(t),o=!0):e.directives.docStart&&(o=!0)}o&&a.push(`---`);let s=n.createStringifyContext(e,i),{commentString:c}=s.options;if(e.commentBefore){a.length!==1&&a.unshift(``);let t=c(e.commentBefore);a.unshift(r.indentComment(t,``))}let l=!1,u=null;if(e.contents){if(t.isNode(e.contents)){if(e.contents.spaceBefore&&o&&a.push(``),e.contents.commentBefore){let t=c(e.contents.commentBefore);a.push(r.indentComment(t,``))}s.forceBlockIndent=!!e.comment,u=e.contents.comment}let i=u?void 0:()=>l=!0,d=n.stringify(e.contents,s,()=>u=null,i);u&&(d+=r.lineComment(d,``,c(u))),(d[0]===`|`||d[0]===`>`)&&a[a.length-1]===`---`?a[a.length-1]=`--- ${d}`:a.push(d)}else a.push(n.stringify(e.contents,s));if(e.directives?.docEnd){if(e.comment){let t=c(e.comment);t.includes(`
222
222
  `)?(a.push(`...`),a.push(r.indentComment(t,``))):a.push(`... ${t}`)}else a.push(`...`)}else{let t=e.comment;t&&l&&(t=t.replace(/^\n+/,``)),t&&((!l||u)&&a[a.length-1]!==``&&a.push(``),a.push(r.indentComment(c(t),``)))}return a.join(`
223
223
  `)+`
224
- `}})),wb=/* @__PURE__ */ L((e=>{var t=By(),n=Uy(),r=Q(),i=Qy(),a=Ry(),o=Sb(),s=Cb(),c=Iy(),l=Ly(),u=Hy(),d=Fy(),f=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,r.NODE_TYPE,{value:r.DOC});let i=null;typeof t==`function`||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);let a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=a;let{version:o}=a;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new d.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let t=Object.create(e.prototype,{[r.NODE_TYPE]:{value:r.DOC}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=r.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){p(this.contents)&&this.contents.add(e)}addIn(e,t){p(this.contents)&&this.contents.addIn(e,t)}createAlias(e,n){if(!e.anchor){let t=c.anchorNames(this);e.anchor=!n||t.has(n)?c.findNewAnchor(n||`a`,t):n}return new t.Alias(e.anchor)}createNode(e,t,n){let i;if(typeof t==`function`)e=t.call({"":e},``,e),i=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),i=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:a,anchorPrefix:o,flow:s,keepUndefined:l,onTagObj:d,tag:f}=n??{},{onAnchor:p,setAnchors:m,sourceObjects:h}=c.createNodeAnchors(this,o||`a`),g={aliasDuplicateObjects:a??!0,keepUndefined:l??!1,onAnchor:p,onTagObj:d,replacer:i,schema:this.schema,sourceObjects:h},_=u.createNode(e,f,g);return s&&r.isCollection(_)&&(_.flow=!0),m(),_}createPair(e,t,n={}){let r=this.createNode(e,null,n),a=this.createNode(t,null,n);return new i.Pair(r,a)}delete(e){return p(this.contents)?this.contents.delete(e):!1}deleteIn(e){return n.isEmptyPath(e)?this.contents!=null&&(this.contents=null,!0):p(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return r.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return n.isEmptyPath(e)?!t&&r.isScalar(this.contents)?this.contents.value:this.contents:r.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return r.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return n.isEmptyPath(e)?this.contents!==void 0:r.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=n.collectionFromPath(this.schema,[e],t):p(this.contents)&&this.contents.set(e,t)}setIn(e,t){n.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=n.collectionFromPath(this.schema,Array.from(e),t):p(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new d.Directives({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new d.Directives({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new o.Schema(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){let s={anchors:/* @__PURE__ */ new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},c=a.toJS(this.contents,t??``,s);if(typeof i==`function`)for(let{count:e,res:t}of s.anchors.values())i(t,e);return typeof o==`function`?l.applyReviver(o,{"":c},``,c):c}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return s.stringifyDocument(this,e)}};function p(e){if(r.isCollection(e))return!0;throw Error(`Expected a YAML collection as document contents`)}e.Document=f})),Tb=/* @__PURE__ */ L((e=>{var t=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},n=class extends t{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},r=class extends t{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}};e.YAMLError=t,e.YAMLParseError=n,e.YAMLWarning=r,e.prettifyError=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
225
- `),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}}})),Eb=/* @__PURE__ */ L((e=>{e.resolveProps=function(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:b&&n===`seq-item-ind`||(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}})),Db=/* @__PURE__ */ L((e=>{function t(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
226
- `))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let n of e.items){for(let e of n.start)if(e.type===`newline`)return!0;if(n.sep){for(let e of n.sep)if(e.type===`newline`)return!0}if(t(n.key)||t(n.value))return!0}return!1;default:return!0}}e.containsNewline=t})),Ob=/* @__PURE__ */ L((e=>{var t=Db();e.flowIndentCheck=function(e,n,r){if(n?.type===`flow-collection`){let i=n.end[0];i.indent===e&&(i.source===`]`||i.source===`}`)&&t.containsNewline(n)&&r(i,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}})),kb=/* @__PURE__ */ L((e=>{var t=Q();e.mapIncludes=function(e,n,r){let{uniqueKeys:i}=e.options;if(i===!1)return!1;let a=typeof i==`function`?i:(e,n)=>e===n||t.isScalar(e)&&t.isScalar(n)&&e.value===n.value;return n.some(e=>a(e.key,r))}})),Ab=/* @__PURE__ */ L((e=>{var t=Qy(),n=eb(),r=Eb(),i=Db(),a=Ob(),o=kb();let s=`All mapping items must start at the same column`;e.resolveBlockMap=function({composeNode:e,composeEmptyNode:c},l,u,d,f){let p=new((f?.nodeClass)??n.YAMLMap)(l.schema);l.atRoot&&=!1;let m=u.offset,h=null;for(let n of u.items){let{start:f,key:g,sep:_,value:v}=n,y=r.resolveProps(f,{indicator:`explicit-key-ind`,next:g??_?.[0],offset:m,onError:d,parentIndent:u.indent,startOnNewline:!0}),b=!y.found;if(b){if(g&&(g.type===`block-seq`?d(m,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in g&&g.indent!==u.indent&&d(m,`BAD_INDENT`,s)),!y.anchor&&!y.tag&&!_){h=y.end,y.comment&&(p.comment?p.comment+=`
224
+ `}})),Tb=/* @__PURE__ */ L((e=>{var t=Vy(),n=Wy(),r=Q(),i=$y(),a=zy(),o=Cb(),s=wb(),c=Ly(),l=Ry(),u=Uy(),d=Iy(),f=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,r.NODE_TYPE,{value:r.DOC});let i=null;typeof t==`function`||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);let a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=a;let{version:o}=a;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new d.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let t=Object.create(e.prototype,{[r.NODE_TYPE]:{value:r.DOC}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=r.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){p(this.contents)&&this.contents.add(e)}addIn(e,t){p(this.contents)&&this.contents.addIn(e,t)}createAlias(e,n){if(!e.anchor){let t=c.anchorNames(this);e.anchor=!n||t.has(n)?c.findNewAnchor(n||`a`,t):n}return new t.Alias(e.anchor)}createNode(e,t,n){let i;if(typeof t==`function`)e=t.call({"":e},``,e),i=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),i=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:a,anchorPrefix:o,flow:s,keepUndefined:l,onTagObj:d,tag:f}=n??{},{onAnchor:p,setAnchors:m,sourceObjects:h}=c.createNodeAnchors(this,o||`a`),g={aliasDuplicateObjects:a??!0,keepUndefined:l??!1,onAnchor:p,onTagObj:d,replacer:i,schema:this.schema,sourceObjects:h},_=u.createNode(e,f,g);return s&&r.isCollection(_)&&(_.flow=!0),m(),_}createPair(e,t,n={}){let r=this.createNode(e,null,n),a=this.createNode(t,null,n);return new i.Pair(r,a)}delete(e){return p(this.contents)?this.contents.delete(e):!1}deleteIn(e){return n.isEmptyPath(e)?this.contents!=null&&(this.contents=null,!0):p(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return r.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return n.isEmptyPath(e)?!t&&r.isScalar(this.contents)?this.contents.value:this.contents:r.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return r.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return n.isEmptyPath(e)?this.contents!==void 0:r.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=n.collectionFromPath(this.schema,[e],t):p(this.contents)&&this.contents.set(e,t)}setIn(e,t){n.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=n.collectionFromPath(this.schema,Array.from(e),t):p(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new d.Directives({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new d.Directives({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new o.Schema(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){let s={anchors:/* @__PURE__ */ new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},c=a.toJS(this.contents,t??``,s);if(typeof i==`function`)for(let{count:e,res:t}of s.anchors.values())i(t,e);return typeof o==`function`?l.applyReviver(o,{"":c},``,c):c}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return s.stringifyDocument(this,e)}};function p(e){if(r.isCollection(e))return!0;throw Error(`Expected a YAML collection as document contents`)}e.Document=f})),Eb=/* @__PURE__ */ L((e=>{var t=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},n=class extends t{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},r=class extends t{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}};e.YAMLError=t,e.YAMLParseError=n,e.YAMLWarning=r,e.prettifyError=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
225
+ `),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}}})),Db=/* @__PURE__ */ L((e=>{e.resolveProps=function(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:b&&n===`seq-item-ind`||(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}})),Ob=/* @__PURE__ */ L((e=>{function t(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
226
+ `))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let n of e.items){for(let e of n.start)if(e.type===`newline`)return!0;if(n.sep){for(let e of n.sep)if(e.type===`newline`)return!0}if(t(n.key)||t(n.value))return!0}return!1;default:return!0}}e.containsNewline=t})),kb=/* @__PURE__ */ L((e=>{var t=Ob();e.flowIndentCheck=function(e,n,r){if(n?.type===`flow-collection`){let i=n.end[0];i.indent===e&&(i.source===`]`||i.source===`}`)&&t.containsNewline(n)&&r(i,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}})),Ab=/* @__PURE__ */ L((e=>{var t=Q();e.mapIncludes=function(e,n,r){let{uniqueKeys:i}=e.options;if(i===!1)return!1;let a=typeof i==`function`?i:(e,n)=>e===n||t.isScalar(e)&&t.isScalar(n)&&e.value===n.value;return n.some(e=>a(e.key,r))}})),jb=/* @__PURE__ */ L((e=>{var t=$y(),n=tb(),r=Db(),i=Ob(),a=kb(),o=Ab();let s=`All mapping items must start at the same column`;e.resolveBlockMap=function({composeNode:e,composeEmptyNode:c},l,u,d,f){let p=new((f?.nodeClass)??n.YAMLMap)(l.schema);l.atRoot&&=!1;let m=u.offset,h=null;for(let n of u.items){let{start:f,key:g,sep:_,value:v}=n,y=r.resolveProps(f,{indicator:`explicit-key-ind`,next:g??_?.[0],offset:m,onError:d,parentIndent:u.indent,startOnNewline:!0}),b=!y.found;if(b){if(g&&(g.type===`block-seq`?d(m,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in g&&g.indent!==u.indent&&d(m,`BAD_INDENT`,s)),!y.anchor&&!y.tag&&!_){h=y.end,y.comment&&(p.comment?p.comment+=`
227
227
  `+y.comment:p.comment=y.comment);continue}(y.newlineAfterProp||i.containsNewline(g))&&d(g??f[f.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else y.found?.indent!==u.indent&&d(m,`BAD_INDENT`,s);l.atKey=!0;let x=y.end,S=g?e(l,g,y,d):c(l,x,f,null,y,d);l.schema.compat&&a.flowIndentCheck(u.indent,g,d),l.atKey=!1,o.mapIncludes(l,p.items,S)&&d(x,`DUPLICATE_KEY`,`Map keys must be unique`);let C=r.resolveProps(_??[],{indicator:`map-value-ind`,next:v,offset:S.range[2],onError:d,parentIndent:u.indent,startOnNewline:!g||g.type===`block-scalar`});if(m=C.end,C.found){b&&(v?.type===`block-map`&&!C.hasNewline&&d(m,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),l.options.strict&&y.start<C.found.offset-1024&&d(S.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let r=v?e(l,v,C,d):c(l,m,_,null,C,d);l.schema.compat&&a.flowIndentCheck(u.indent,v,d),m=r.range[2];let i=new t.Pair(S,r);l.options.keepSourceTokens&&(i.srcToken=n),p.items.push(i)}else{b&&d(S.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),C.comment&&(S.comment?S.comment+=`
228
- `+C.comment:S.comment=C.comment);let e=new t.Pair(S);l.options.keepSourceTokens&&(e.srcToken=n),p.items.push(e)}}return h&&h<m&&d(h,`IMPOSSIBLE`,`Map comment with trailing content`),p.range=[u.offset,m,h??m],p}})),jb=/* @__PURE__ */ L((e=>{var t=nb(),n=Eb(),r=Ob();e.resolveBlockSeq=function({composeNode:e,composeEmptyNode:i},a,o,s,c){let l=new((c?.nodeClass)??t.YAMLSeq)(a.schema);a.atRoot&&=!1,a.atKey&&=!1;let u=o.offset,d=null;for(let{start:t,value:c}of o.items){let f=n.resolveProps(t,{indicator:`seq-item-ind`,next:c,offset:u,onError:s,parentIndent:o.indent,startOnNewline:!0});if(!f.found){if(f.anchor||f.tag||c)c?.type===`block-seq`?s(f.end,`BAD_INDENT`,`All sequence items must start at the same column`):s(u,`MISSING_CHAR`,`Sequence item without - indicator`);else{d=f.end,f.comment&&(l.comment=f.comment);continue}}let p=c?e(a,c,f,s):i(a,f.end,t,null,f,s);a.schema.compat&&r.flowIndentCheck(o.indent,c,s),u=p.range[2],l.items.push(p)}return l.range=[o.offset,u,d??u],l}})),Mb=/* @__PURE__ */ L((e=>{e.resolveEnd=function(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}})),Nb=/* @__PURE__ */ L((e=>{var t=Q(),n=Qy(),r=eb(),i=nb(),a=Mb(),o=Eb(),s=Db(),c=kb();let l=`Block collections are not allowed within flow collections`,u=e=>e&&(e.type===`block-map`||e.type===`block-seq`);e.resolveFlowCollection=function({composeNode:e,composeEmptyNode:d},f,p,m,h){let g=p.start.source===`{`,_=g?`flow map`:`flow sequence`,v=new((h?.nodeClass)??(g?r.YAMLMap:i.YAMLSeq))(f.schema);v.flow=!0;let y=f.atRoot;y&&(f.atRoot=!1),f.atKey&&=!1;let b=p.offset+p.start.source.length;for(let i=0;i<p.items.length;++i){let a=p.items[i],{start:h,key:y,sep:x,value:S}=a,C=o.resolveProps(h,{flow:_,indicator:`explicit-key-ind`,next:y??x?.[0],offset:b,onError:m,parentIndent:p.indent,startOnNewline:!1});if(!C.found){if(!C.anchor&&!C.tag&&!x&&!S){i===0&&C.comma?m(C.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${_}`):i<p.items.length-1&&m(C.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${_}`),C.comment&&(v.comment?v.comment+=`
228
+ `+C.comment:S.comment=C.comment);let e=new t.Pair(S);l.options.keepSourceTokens&&(e.srcToken=n),p.items.push(e)}}return h&&h<m&&d(h,`IMPOSSIBLE`,`Map comment with trailing content`),p.range=[u.offset,m,h??m],p}})),Mb=/* @__PURE__ */ L((e=>{var t=rb(),n=Db(),r=kb();e.resolveBlockSeq=function({composeNode:e,composeEmptyNode:i},a,o,s,c){let l=new((c?.nodeClass)??t.YAMLSeq)(a.schema);a.atRoot&&=!1,a.atKey&&=!1;let u=o.offset,d=null;for(let{start:t,value:c}of o.items){let f=n.resolveProps(t,{indicator:`seq-item-ind`,next:c,offset:u,onError:s,parentIndent:o.indent,startOnNewline:!0});if(!f.found){if(f.anchor||f.tag||c)c?.type===`block-seq`?s(f.end,`BAD_INDENT`,`All sequence items must start at the same column`):s(u,`MISSING_CHAR`,`Sequence item without - indicator`);else{d=f.end,f.comment&&(l.comment=f.comment);continue}}let p=c?e(a,c,f,s):i(a,f.end,t,null,f,s);a.schema.compat&&r.flowIndentCheck(o.indent,c,s),u=p.range[2],l.items.push(p)}return l.range=[o.offset,u,d??u],l}})),Nb=/* @__PURE__ */ L((e=>{e.resolveEnd=function(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}})),Pb=/* @__PURE__ */ L((e=>{var t=Q(),n=$y(),r=tb(),i=rb(),a=Nb(),o=Db(),s=Ob(),c=Ab();let l=`Block collections are not allowed within flow collections`,u=e=>e&&(e.type===`block-map`||e.type===`block-seq`);e.resolveFlowCollection=function({composeNode:e,composeEmptyNode:d},f,p,m,h){let g=p.start.source===`{`,_=g?`flow map`:`flow sequence`,v=new((h?.nodeClass)??(g?r.YAMLMap:i.YAMLSeq))(f.schema);v.flow=!0;let y=f.atRoot;y&&(f.atRoot=!1),f.atKey&&=!1;let b=p.offset+p.start.source.length;for(let i=0;i<p.items.length;++i){let a=p.items[i],{start:h,key:y,sep:x,value:S}=a,C=o.resolveProps(h,{flow:_,indicator:`explicit-key-ind`,next:y??x?.[0],offset:b,onError:m,parentIndent:p.indent,startOnNewline:!1});if(!C.found){if(!C.anchor&&!C.tag&&!x&&!S){i===0&&C.comma?m(C.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${_}`):i<p.items.length-1&&m(C.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${_}`),C.comment&&(v.comment?v.comment+=`
229
229
  `+C.comment:v.comment=C.comment),b=C.end;continue}!g&&f.options.strict&&s.containsNewline(y)&&m(y,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(i===0)C.comma&&m(C.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${_}`);else if(C.comma||m(C.start,`MISSING_CHAR`,`Missing , between ${_} items`),C.comment){let e=``;e:for(let t of h)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break e;default:break e}if(e){let n=v.items[v.items.length-1];t.isPair(n)&&(n=n.value??n.key),n.comment?n.comment+=`
230
230
  `+e:n.comment=e,C.comment=C.comment.substring(e.length+1)}}if(!g&&!x&&!C.found){let t=S?e(f,S,C,m):d(f,C.end,x,null,C,m);v.items.push(t),b=t.range[2],u(S)&&m(t.range,`BLOCK_IN_FLOW`,l)}else{f.atKey=!0;let t=C.end,i=y?e(f,y,C,m):d(f,t,h,null,C,m);u(y)&&m(i.range,`BLOCK_IN_FLOW`,l),f.atKey=!1;let s=o.resolveProps(x??[],{flow:_,indicator:`map-value-ind`,next:S,offset:i.range[2],onError:m,parentIndent:p.indent,startOnNewline:!1});if(s.found){if(!g&&!C.found&&f.options.strict){if(x)for(let e of x){if(e===s.found)break;if(e.type===`newline`){m(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}C.start<s.found.offset-1024&&m(s.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else S&&(`source`in S&&S.source?.[0]===`:`?m(S,`MISSING_CHAR`,`Missing space after : in ${_}`):m(s.start,`MISSING_CHAR`,`Missing , or : between ${_} items`));let w=S?e(f,S,s,m):s.found?d(f,s.end,x,null,s,m):null;w?u(S)&&m(w.range,`BLOCK_IN_FLOW`,l):s.comment&&(i.comment?i.comment+=`
231
231
  `+s.comment:i.comment=s.comment);let T=new n.Pair(i,w);if(f.options.keepSourceTokens&&(T.srcToken=a),g){let e=v;c.mapIncludes(f,e.items,i)&&m(t,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(T)}else{let e=new r.YAMLMap(f.schema);e.flow=!0,e.items.push(T);let t=(w??i).range;e.range=[i.range[0],t[1],t[2]],v.items.push(e)}b=w?w.range[2]:s.end}}let x=g?`}`:`]`,[S,...C]=p.end,w=b;if(S?.source===x)w=S.offset+S.source.length;else{let e=_[0].toUpperCase()+_.substring(1),t=y?`${e} must end with a ${x}`:`${e} in block collection must be sufficiently indented and end with a ${x}`;m(b,y?`MISSING_CHAR`:`BAD_INDENT`,t),S&&S.source.length!==1&&C.unshift(S)}if(C.length>0){let e=a.resolveEnd(C,w,f.options.strict,m);e.comment&&(v.comment?v.comment+=`
232
- `+e.comment:v.comment=e.comment),v.range=[p.offset,w,e.offset]}else v.range=[p.offset,w,w];return v}})),Pb=/* @__PURE__ */ L((e=>{var t=Q(),n=Vy(),r=eb(),i=nb(),a=Ab(),o=jb(),s=Nb();function c(e,t,n,r,i,c){let l=n.type===`block-map`?a.resolveBlockMap(e,t,n,r,c):n.type===`block-seq`?o.resolveBlockSeq(e,t,n,r,c):s.resolveFlowCollection(e,t,n,r,c),u=l.constructor;return i===`!`||i===u.tagName?(l.tag=u.tagName,l):(i&&(l.tag=i),l)}e.composeCollection=function(e,a,o,s,l){let u=s.tag,d=u?a.directives.tagName(u.source,e=>l(u,`TAG_RESOLVE_FAILED`,e)):null;if(o.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=s,n=e&&u?e.offset>u.offset?e:u:e??u;n&&(!t||t.offset<n.offset)&&l(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let f=o.type===`block-map`?`map`:o.type===`block-seq`?`seq`:o.start.source===`{`?`map`:`seq`;if(!u||!d||d===`!`||d===r.YAMLMap.tagName&&f===`map`||d===i.YAMLSeq.tagName&&f===`seq`)return c(e,a,o,l,d);let p=a.schema.tags.find(e=>e.tag===d&&e.collection===f);if(!p){let t=a.schema.knownTags[d];if(t?.collection===f)a.schema.tags.push(Object.assign({},t,{default:!1})),p=t;else return t?l(u,`BAD_COLLECTION_TYPE`,`${t.tag} used for ${f} collection, but expects ${t.collection??`scalar`}`,!0):l(u,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${d}`,!0),c(e,a,o,l,d)}let m=c(e,a,o,l,d,p),h=p.resolve?.(m,e=>l(u,`TAG_RESOLVE_FAILED`,e),a.options)??m,g=t.isNode(h)?h:new n.Scalar(h);return g.range=m.range,g.tag=d,p?.format&&(g.format=p.format),g}})),Fb=/* @__PURE__ */ L((e=>{var t=Vy();function n({offset:e,props:t},n,r){
232
+ `+e.comment:v.comment=e.comment),v.range=[p.offset,w,e.offset]}else v.range=[p.offset,w,w];return v}})),Fb=/* @__PURE__ */ L((e=>{var t=Q(),n=Hy(),r=tb(),i=rb(),a=jb(),o=Mb(),s=Pb();function c(e,t,n,r,i,c){let l=n.type===`block-map`?a.resolveBlockMap(e,t,n,r,c):n.type===`block-seq`?o.resolveBlockSeq(e,t,n,r,c):s.resolveFlowCollection(e,t,n,r,c),u=l.constructor;return i===`!`||i===u.tagName?(l.tag=u.tagName,l):(i&&(l.tag=i),l)}e.composeCollection=function(e,a,o,s,l){let u=s.tag,d=u?a.directives.tagName(u.source,e=>l(u,`TAG_RESOLVE_FAILED`,e)):null;if(o.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=s,n=e&&u?e.offset>u.offset?e:u:e??u;n&&(!t||t.offset<n.offset)&&l(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let f=o.type===`block-map`?`map`:o.type===`block-seq`?`seq`:o.start.source===`{`?`map`:`seq`;if(!u||!d||d===`!`||d===r.YAMLMap.tagName&&f===`map`||d===i.YAMLSeq.tagName&&f===`seq`)return c(e,a,o,l,d);let p=a.schema.tags.find(e=>e.tag===d&&e.collection===f);if(!p){let t=a.schema.knownTags[d];if(t?.collection===f)a.schema.tags.push(Object.assign({},t,{default:!1})),p=t;else return t?l(u,`BAD_COLLECTION_TYPE`,`${t.tag} used for ${f} collection, but expects ${t.collection??`scalar`}`,!0):l(u,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${d}`,!0),c(e,a,o,l,d)}let m=c(e,a,o,l,d,p),h=p.resolve?.(m,e=>l(u,`TAG_RESOLVE_FAILED`,e),a.options)??m,g=t.isNode(h)?h:new n.Scalar(h);return g.range=m.range,g.tag=d,p?.format&&(g.format=p.format),g}})),Ib=/* @__PURE__ */ L((e=>{var t=Hy();function n({offset:e,props:t},n,r){
233
233
  /* istanbul ignore if should not happen */
234
234
  if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;
235
235
  /* istanbul ignore next should not happen */
@@ -250,7 +250,7 @@ if(i&&(r=r.slice(0,-1)),r&&n.length<d){let e=`Block scalar lines must not be les
250
250
  `+l[e][0].slice(d);m[m.length-1]!==`
251
251
  `&&(m+=`
252
252
  `);break;default:m+=`
253
- `}let _=o+s.length+i.source.length;return{value:m,type:c,comment:s.comment,range:[o,_,_]}}})),Ib=/* @__PURE__ */ L((e=>{var t=Vy(),n=Mb();function r(e,t){let n=``;switch(e[0]){
253
+ `}let _=o+s.length+i.source.length;return{value:m,type:c,comment:s.comment,range:[o,_,_]}}})),Lb=/* @__PURE__ */ L((e=>{var t=Hy(),n=Nb();function r(e,t){let n=``;switch(e[0]){
254
254
  /* istanbul ignore next should not happen */
255
255
  case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),a(e)}function i(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),a(e.slice(1,-1)).replace(/''/g,`'`)}function a(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
256
256
  `?a+=o:o=`
@@ -267,10 +267,10 @@ case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;c
267
267
  `),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}let c={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
268
268
  `,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function l(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}e.resolveFlowScalar=function(e,a,s){let{offset:c,type:l,source:u,end:d}=e,f,p,m=(e,t,n)=>s(c+e,t,n);switch(l){case`scalar`:f=t.Scalar.PLAIN,p=r(u,m);break;case`single-quoted-scalar`:f=t.Scalar.QUOTE_SINGLE,p=i(u,m);break;case`double-quoted-scalar`:f=t.Scalar.QUOTE_DOUBLE,p=o(u,m);break;
269
269
  /* istanbul ignore next should not happen */
270
- default:return s(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${l}`),{value:``,type:null,comment:``,range:[c,c+u.length,c+u.length]}}let h=c+u.length,g=n.resolveEnd(d,h,a,s);return{value:p,type:f,comment:g.comment,range:[c,h,g.offset]}}})),Lb=/* @__PURE__ */ L((e=>{var t=Q(),n=Vy(),r=Fb(),i=Ib();function a(e,n,r,i,a){if(r===`!`)return e[t.SCALAR];let o=[];for(let t of e.tags)if(!t.collection&&t.tag===r){if(t.default&&t.test)o.push(t);else return t}for(let e of o)if(e.test?.test(n))return e;let s=e.knownTags[r];return s&&!s.collection?(e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(a(i,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${r}`,r!==`tag:yaml.org,2002:str`),e[t.SCALAR])}function o({atKey:e,directives:n,schema:r},i,a,o){let s=r.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(i))||r[t.SCALAR];if(r.compat){let e=r.compat.find(e=>e.default&&e.test?.test(i))??r[t.SCALAR];s.tag!==e.tag&&o(a,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${n.tagString(s.tag)} or ${n.tagString(e.tag)}`,!0)}return s}e.composeScalar=function(e,s,c,l){let{value:u,type:d,comment:f,range:p}=s.type===`block-scalar`?r.resolveBlockScalar(e,s,l):i.resolveFlowScalar(s,e.options.strict,l),m=c?e.directives.tagName(c.source,e=>l(c,`TAG_RESOLVE_FAILED`,e)):null,h;h=e.options.stringKeys&&e.atKey?e.schema[t.SCALAR]:m?a(e.schema,u,m,c,l):s.type===`scalar`?o(e,u,s,l):e.schema[t.SCALAR];let g;try{let r=h.resolve(u,e=>l(c??s,`TAG_RESOLVE_FAILED`,e),e.options);g=t.isScalar(r)?r:new n.Scalar(r)}catch(e){let t=e instanceof Error?e.message:String(e);l(c??s,`TAG_RESOLVE_FAILED`,t),g=new n.Scalar(u)}return g.range=p,g.source=u,d&&(g.type=d),m&&(g.tag=m),h.format&&(g.format=h.format),f&&(g.comment=f),g}})),Rb=/* @__PURE__ */ L((e=>{e.emptyScalarPosition=function(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}})),zb=/* @__PURE__ */ L((e=>{var t=By(),n=Q(),r=Pb(),i=Lb(),a=Mb(),o=Rb();let s={composeNode:c,composeEmptyNode:l};function c(e,t,a,o){let c=e.atKey,{spaceBefore:d,comment:f,anchor:p,tag:m}=a,h,g=!0;switch(t.type){case`alias`:h=u(e,t,o),(p||m)&&o(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:h=i.composeScalar(e,t,m,o),p&&(h.anchor=p.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{h=r.composeCollection(s,e,t,a,o),p&&(h.anchor=p.source.substring(1))}catch(e){o(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:o(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),g=!1}return h??=l(e,t.offset,void 0,null,a,o),p&&h.anchor===``&&o(p,`BAD_ALIAS`,`Anchor cannot be an empty string`),c&&e.options.stringKeys&&(!n.isScalar(h)||typeof h.value!=`string`||h.tag&&h.tag!==`tag:yaml.org,2002:str`)&&o(m??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),d&&(h.spaceBefore=!0),f&&(t.type===`scalar`&&t.source===``?h.comment=f:h.commentBefore=f),e.options.keepSourceTokens&&g&&(h.srcToken=t),h}function l(e,t,n,r,{spaceBefore:a,comment:s,anchor:c,tag:l,end:u},d){let f={type:`scalar`,offset:o.emptyScalarPosition(t,n,r),indent:-1,source:``},p=i.composeScalar(e,f,l,d);return c&&(p.anchor=c.source.substring(1),p.anchor===``&&d(c,`BAD_ALIAS`,`Anchor cannot be an empty string`)),a&&(p.spaceBefore=!0),s&&(p.comment=s,p.range[2]=u),p}function u({options:e},{offset:n,source:r,end:i},o){let s=new t.Alias(r.substring(1));s.source===``&&o(n,`BAD_ALIAS`,`Alias cannot be an empty string`),s.source.endsWith(`:`)&&o(n+r.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let c=n+r.length,l=a.resolveEnd(i,c,e.strict,o);return s.range=[n,c,l.offset],l.comment&&(s.comment=l.comment),s}e.composeEmptyNode=l,e.composeNode=c})),Bb=/* @__PURE__ */ L((e=>{var t=wb(),n=zb(),r=Mb(),i=Eb();e.composeDoc=function(e,a,{offset:o,start:s,value:c,end:l},u){let d=Object.assign({_directives:a},e),f=new t.Document(void 0,d),p={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},m=i.resolveProps(s,{indicator:`doc-start`,next:c??l?.[0],offset:o,onError:u,parentIndent:0,startOnNewline:!0});m.found&&(f.directives.docStart=!0,c&&(c.type===`block-map`||c.type===`block-seq`)&&!m.hasNewline&&u(m.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),f.contents=c?n.composeNode(p,c,m,u):n.composeEmptyNode(p,m.end,s,null,m,u);let h=f.contents.range[2],g=r.resolveEnd(l,h,!1,u);return g.comment&&(f.comment=g.comment),f.range=[o,h,g.offset],f}})),Vb=/* @__PURE__ */ L((e=>{var t=z(`process`),n=Fy(),r=wb(),i=Tb(),a=Q(),o=Bb(),s=Mb();function c(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function l(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
270
+ default:return s(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${l}`),{value:``,type:null,comment:``,range:[c,c+u.length,c+u.length]}}let h=c+u.length,g=n.resolveEnd(d,h,a,s);return{value:p,type:f,comment:g.comment,range:[c,h,g.offset]}}})),Rb=/* @__PURE__ */ L((e=>{var t=Q(),n=Hy(),r=Ib(),i=Lb();function a(e,n,r,i,a){if(r===`!`)return e[t.SCALAR];let o=[];for(let t of e.tags)if(!t.collection&&t.tag===r){if(t.default&&t.test)o.push(t);else return t}for(let e of o)if(e.test?.test(n))return e;let s=e.knownTags[r];return s&&!s.collection?(e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(a(i,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${r}`,r!==`tag:yaml.org,2002:str`),e[t.SCALAR])}function o({atKey:e,directives:n,schema:r},i,a,o){let s=r.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(i))||r[t.SCALAR];if(r.compat){let e=r.compat.find(e=>e.default&&e.test?.test(i))??r[t.SCALAR];s.tag!==e.tag&&o(a,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${n.tagString(s.tag)} or ${n.tagString(e.tag)}`,!0)}return s}e.composeScalar=function(e,s,c,l){let{value:u,type:d,comment:f,range:p}=s.type===`block-scalar`?r.resolveBlockScalar(e,s,l):i.resolveFlowScalar(s,e.options.strict,l),m=c?e.directives.tagName(c.source,e=>l(c,`TAG_RESOLVE_FAILED`,e)):null,h;h=e.options.stringKeys&&e.atKey?e.schema[t.SCALAR]:m?a(e.schema,u,m,c,l):s.type===`scalar`?o(e,u,s,l):e.schema[t.SCALAR];let g;try{let r=h.resolve(u,e=>l(c??s,`TAG_RESOLVE_FAILED`,e),e.options);g=t.isScalar(r)?r:new n.Scalar(r)}catch(e){let t=e instanceof Error?e.message:String(e);l(c??s,`TAG_RESOLVE_FAILED`,t),g=new n.Scalar(u)}return g.range=p,g.source=u,d&&(g.type=d),m&&(g.tag=m),h.format&&(g.format=h.format),f&&(g.comment=f),g}})),zb=/* @__PURE__ */ L((e=>{e.emptyScalarPosition=function(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}})),Bb=/* @__PURE__ */ L((e=>{var t=Vy(),n=Q(),r=Fb(),i=Rb(),a=Nb(),o=zb();let s={composeNode:c,composeEmptyNode:l};function c(e,t,a,o){let c=e.atKey,{spaceBefore:d,comment:f,anchor:p,tag:m}=a,h,g=!0;switch(t.type){case`alias`:h=u(e,t,o),(p||m)&&o(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:h=i.composeScalar(e,t,m,o),p&&(h.anchor=p.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{h=r.composeCollection(s,e,t,a,o),p&&(h.anchor=p.source.substring(1))}catch(e){o(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:o(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),g=!1}return h??=l(e,t.offset,void 0,null,a,o),p&&h.anchor===``&&o(p,`BAD_ALIAS`,`Anchor cannot be an empty string`),c&&e.options.stringKeys&&(!n.isScalar(h)||typeof h.value!=`string`||h.tag&&h.tag!==`tag:yaml.org,2002:str`)&&o(m??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),d&&(h.spaceBefore=!0),f&&(t.type===`scalar`&&t.source===``?h.comment=f:h.commentBefore=f),e.options.keepSourceTokens&&g&&(h.srcToken=t),h}function l(e,t,n,r,{spaceBefore:a,comment:s,anchor:c,tag:l,end:u},d){let f={type:`scalar`,offset:o.emptyScalarPosition(t,n,r),indent:-1,source:``},p=i.composeScalar(e,f,l,d);return c&&(p.anchor=c.source.substring(1),p.anchor===``&&d(c,`BAD_ALIAS`,`Anchor cannot be an empty string`)),a&&(p.spaceBefore=!0),s&&(p.comment=s,p.range[2]=u),p}function u({options:e},{offset:n,source:r,end:i},o){let s=new t.Alias(r.substring(1));s.source===``&&o(n,`BAD_ALIAS`,`Alias cannot be an empty string`),s.source.endsWith(`:`)&&o(n+r.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let c=n+r.length,l=a.resolveEnd(i,c,e.strict,o);return s.range=[n,c,l.offset],l.comment&&(s.comment=l.comment),s}e.composeEmptyNode=l,e.composeNode=c})),Vb=/* @__PURE__ */ L((e=>{var t=Tb(),n=Bb(),r=Nb(),i=Db();e.composeDoc=function(e,a,{offset:o,start:s,value:c,end:l},u){let d=Object.assign({_directives:a},e),f=new t.Document(void 0,d),p={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},m=i.resolveProps(s,{indicator:`doc-start`,next:c??l?.[0],offset:o,onError:u,parentIndent:0,startOnNewline:!0});m.found&&(f.directives.docStart=!0,c&&(c.type===`block-map`||c.type===`block-seq`)&&!m.hasNewline&&u(m.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),f.contents=c?n.composeNode(p,c,m,u):n.composeEmptyNode(p,m.end,s,null,m,u);let h=f.contents.range[2],g=r.resolveEnd(l,h,!1,u);return g.comment&&(f.comment=g.comment),f.range=[o,h,g.offset],f}})),Hb=/* @__PURE__ */ L((e=>{var t=z(`process`),n=Iy(),r=Tb(),i=Eb(),a=Q(),o=Vb(),s=Nb();function c(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function l(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
271
271
 
272
272
  `:`
273
- `)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}e.Composer=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let a=c(e);r?this.warnings.push(new i.YAMLWarning(a,t,n)):this.errors.push(new i.YAMLParseError(a,t,n))},this.directives=new n.Directives({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=l(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(a.isCollection(i)&&!i.flow&&i.items.length>0){let e=i.items[0];a.isPair(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:l(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(t.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=c(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=o.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new i.YAMLParseError(c(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new i.YAMLParseError(c(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=s.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new i.YAMLParseError(c(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=Object.assign({_directives:this.directives},this.options),n=new r.Document(void 0,e);this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),n.range=[0,t,t],this.decorate(n,!1),yield n}}}})),Hb=/* @__PURE__ */ L((e=>{var t=Fb(),n=Ib(),r=Tb(),i=Ky();function a(e,t){let n=t.indexOf(`
273
+ `)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}e.Composer=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let a=c(e);r?this.warnings.push(new i.YAMLWarning(a,t,n)):this.errors.push(new i.YAMLParseError(a,t,n))},this.directives=new n.Directives({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=l(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(a.isCollection(i)&&!i.flow&&i.items.length>0){let e=i.items[0];a.isPair(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:l(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(t.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=c(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=o.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new i.YAMLParseError(c(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new i.YAMLParseError(c(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=s.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new i.YAMLParseError(c(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=Object.assign({_directives:this.directives},this.options),n=new r.Document(void 0,e);this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),n.range=[0,t,t],this.decorate(n,!1),yield n}}}})),Ub=/* @__PURE__ */ L((e=>{var t=Ib(),n=Lb(),r=Eb(),i=qy();function a(e,t){let n=t.indexOf(`
274
274
  `),r=t.substring(0,n),i=t.substring(n+1)+`
275
275
  `;if(e.type===`block-scalar`){let t=e.props[0];if(t.type!==`block-scalar-header`)throw Error(`Invalid block scalar header`);t.source=r,e.source=i}else{let{offset:t}=e,n=`indent`in e?e.indent:-1,a=[{type:`block-scalar-header`,offset:t,indent:n,source:r}];o(a,`end`in e?e.end:void 0)||a.push({type:`newline`,offset:-1,indent:n,source:`
276
276
  `});for(let t of Object.keys(e))t!==`type`&&t!==`offset`&&delete e[t];Object.assign(e,{type:`block-scalar`,indent:n,props:a,source:i})}}function o(e,t){if(t)for(let n of t)switch(n.type){case`space`:case`comment`:e.push(n);break;case`newline`:return e.push(n),!0}return!1}function s(e,t,n){switch(e.type){case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:e.type=n,e.source=t;break;case`block-scalar`:{let r=e.props.slice(1),i=t.length;e.props[0].type===`block-scalar-header`&&(i-=e.props[0].source.length);for(let e of r)e.offset+=i;delete e.props,Object.assign(e,{type:n,source:t,end:r});break}case`block-map`:case`block-seq`:{let r={type:`newline`,offset:e.offset+t.length,indent:e.indent,source:`
@@ -278,9 +278,9 @@ default:return s(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found:
278
278
  `}];switch(l[0]){case`|`:case`>`:{let e=l.indexOf(`
279
279
  `),t=l.substring(0,e),n=l.substring(e+1)+`
280
280
  `,i=[{type:`block-scalar-header`,offset:s,indent:r,source:t}];return o(i,u)||i.push({type:`newline`,offset:-1,indent:r,source:`
281
- `}),{type:`block-scalar`,offset:s,indent:r,props:i,source:n}}case`"`:return{type:`double-quoted-scalar`,offset:s,indent:r,source:l,end:u};case`'`:return{type:`single-quoted-scalar`,offset:s,indent:r,source:l,end:u};default:return{type:`scalar`,offset:s,indent:r,source:l,end:u}}},e.resolveAsScalar=function(e,i=!0,a){if(e){let o=(e,t,n)=>{let i=typeof e==`number`?e:Array.isArray(e)?e[0]:e.offset;if(a)a(i,t,n);else throw new r.YAMLParseError([i,i+1],t,n)};switch(e.type){case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return n.resolveFlowScalar(e,i,o);case`block-scalar`:return t.resolveBlockScalar({options:{strict:i}},e,o)}}return null},e.setScalarValue=function(e,t,n={}){let{afterKey:r=!1,implicitKey:o=!1,inFlow:c=!1,type:l}=n,u=`indent`in e?e.indent:null;if(r&&typeof u==`number`&&(u+=2),!l)switch(e.type){case`single-quoted-scalar`:l=`QUOTE_SINGLE`;break;case`double-quoted-scalar`:l=`QUOTE_DOUBLE`;break;case`block-scalar`:{let t=e.props[0];if(t.type!==`block-scalar-header`)throw Error(`Invalid block scalar header`);l=t.source[0]===`>`?`BLOCK_FOLDED`:`BLOCK_LITERAL`;break}default:l=`PLAIN`}let d=i.stringifyString({type:l,value:t},{implicitKey:o||u===null,indent:u!==null&&u>0?` `.repeat(u):``,inFlow:c,options:{blockQuote:!0,lineWidth:-1}});switch(d[0]){case`|`:case`>`:a(e,d);break;case`"`:s(e,d,`double-quoted-scalar`);break;case`'`:s(e,d,`single-quoted-scalar`);break;default:s(e,d,`scalar`)}}})),Ub=/* @__PURE__ */ L((e=>{let t=e=>`type`in e?n(e):r(e);function n(e){switch(e.type){case`block-scalar`:{let t=``;for(let r of e.props)t+=n(r);return t+e.source}case`block-map`:case`block-seq`:{let t=``;for(let n of e.items)t+=r(n);return t}case`flow-collection`:{let t=e.start.source;for(let n of e.items)t+=r(n);for(let n of e.end)t+=n.source;return t}case`document`:{let t=r(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if(`end`in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function r({start:e,key:t,sep:r,value:i}){let a=``;for(let t of e)a+=t.source;if(t&&(a+=n(t)),r)for(let e of r)a+=e.source;return i&&(a+=n(i)),a}e.stringify=t})),Wb=/* @__PURE__ */ L((e=>{let t=Symbol(`break visit`),n=Symbol(`skip children`),r=Symbol(`remove item`);function i(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),a(Object.freeze([]),e,t)}i.BREAK=t,i.SKIP=n,i.REMOVE=r,i.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},i.parentCollection=(e,t)=>{let n=i.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],a=n?.[r];if(a&&`items`in a)return a;throw Error(`Parent collection not found`)};function a(e,n,i){let o=i(n,e);if(typeof o==`symbol`)return o;for(let s of[`key`,`value`]){let c=n[s];if(c&&`items`in c){for(let n=0;n<c.items.length;++n){let o=a(Object.freeze(e.concat([[s,n]])),c.items[n],i);if(typeof o==`number`)n=o-1;else if(o===t)return t;else o===r&&(c.items.splice(n,1),--n)}typeof o==`function`&&s===`key`&&(o=o(n,e))}}return typeof o==`function`?o(n,e):o}e.visit=i})),Gb=/* @__PURE__ */ L((e=>{var t=Hb(),n=Ub(),r=Wb();e.createScalarToken=t.createScalarToken,e.resolveAsScalar=t.resolveAsScalar,e.setScalarValue=t.setScalarValue,e.stringify=n.stringify,e.visit=r.visit,e.BOM=``,e.DOCUMENT=``,e.FLOW_END=``,e.SCALAR=``,e.isCollection=e=>!!e&&`items`in e,e.isScalar=e=>!!e&&(e.type===`scalar`||e.type===`single-quoted-scalar`||e.type===`double-quoted-scalar`||e.type===`block-scalar`),e.prettyToken=function(e){switch(e){case``:return`<BOM>`;case``:return`<DOC>`;case``:return`<FLOW_END>`;case``:return`<SCALAR>`;default:return JSON.stringify(e)}},e.tokenType=function(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
281
+ `}),{type:`block-scalar`,offset:s,indent:r,props:i,source:n}}case`"`:return{type:`double-quoted-scalar`,offset:s,indent:r,source:l,end:u};case`'`:return{type:`single-quoted-scalar`,offset:s,indent:r,source:l,end:u};default:return{type:`scalar`,offset:s,indent:r,source:l,end:u}}},e.resolveAsScalar=function(e,i=!0,a){if(e){let o=(e,t,n)=>{let i=typeof e==`number`?e:Array.isArray(e)?e[0]:e.offset;if(a)a(i,t,n);else throw new r.YAMLParseError([i,i+1],t,n)};switch(e.type){case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return n.resolveFlowScalar(e,i,o);case`block-scalar`:return t.resolveBlockScalar({options:{strict:i}},e,o)}}return null},e.setScalarValue=function(e,t,n={}){let{afterKey:r=!1,implicitKey:o=!1,inFlow:c=!1,type:l}=n,u=`indent`in e?e.indent:null;if(r&&typeof u==`number`&&(u+=2),!l)switch(e.type){case`single-quoted-scalar`:l=`QUOTE_SINGLE`;break;case`double-quoted-scalar`:l=`QUOTE_DOUBLE`;break;case`block-scalar`:{let t=e.props[0];if(t.type!==`block-scalar-header`)throw Error(`Invalid block scalar header`);l=t.source[0]===`>`?`BLOCK_FOLDED`:`BLOCK_LITERAL`;break}default:l=`PLAIN`}let d=i.stringifyString({type:l,value:t},{implicitKey:o||u===null,indent:u!==null&&u>0?` `.repeat(u):``,inFlow:c,options:{blockQuote:!0,lineWidth:-1}});switch(d[0]){case`|`:case`>`:a(e,d);break;case`"`:s(e,d,`double-quoted-scalar`);break;case`'`:s(e,d,`single-quoted-scalar`);break;default:s(e,d,`scalar`)}}})),Wb=/* @__PURE__ */ L((e=>{let t=e=>`type`in e?n(e):r(e);function n(e){switch(e.type){case`block-scalar`:{let t=``;for(let r of e.props)t+=n(r);return t+e.source}case`block-map`:case`block-seq`:{let t=``;for(let n of e.items)t+=r(n);return t}case`flow-collection`:{let t=e.start.source;for(let n of e.items)t+=r(n);for(let n of e.end)t+=n.source;return t}case`document`:{let t=r(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if(`end`in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function r({start:e,key:t,sep:r,value:i}){let a=``;for(let t of e)a+=t.source;if(t&&(a+=n(t)),r)for(let e of r)a+=e.source;return i&&(a+=n(i)),a}e.stringify=t})),Gb=/* @__PURE__ */ L((e=>{let t=Symbol(`break visit`),n=Symbol(`skip children`),r=Symbol(`remove item`);function i(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),a(Object.freeze([]),e,t)}i.BREAK=t,i.SKIP=n,i.REMOVE=r,i.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},i.parentCollection=(e,t)=>{let n=i.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],a=n?.[r];if(a&&`items`in a)return a;throw Error(`Parent collection not found`)};function a(e,n,i){let o=i(n,e);if(typeof o==`symbol`)return o;for(let s of[`key`,`value`]){let c=n[s];if(c&&`items`in c){for(let n=0;n<c.items.length;++n){let o=a(Object.freeze(e.concat([[s,n]])),c.items[n],i);if(typeof o==`number`)n=o-1;else if(o===t)return t;else o===r&&(c.items.splice(n,1),--n)}typeof o==`function`&&s===`key`&&(o=o(n,e))}}return typeof o==`function`?o(n,e):o}e.visit=i})),Kb=/* @__PURE__ */ L((e=>{var t=Ub(),n=Wb(),r=Gb();e.createScalarToken=t.createScalarToken,e.resolveAsScalar=t.resolveAsScalar,e.setScalarValue=t.setScalarValue,e.stringify=n.stringify,e.visit=r.visit,e.BOM=``,e.DOCUMENT=``,e.FLOW_END=``,e.SCALAR=``,e.isCollection=e=>!!e&&`items`in e,e.isScalar=e=>!!e&&(e.type===`scalar`||e.type===`single-quoted-scalar`||e.type===`double-quoted-scalar`||e.type===`block-scalar`),e.prettyToken=function(e){switch(e){case``:return`<BOM>`;case``:return`<DOC>`;case``:return`<FLOW_END>`;case``:return`<SCALAR>`;default:return JSON.stringify(e)}},e.tokenType=function(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
282
282
  `:case`\r
283
- `:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}})),Kb=/* @__PURE__ */ L((e=>{var t=Gb();function n(e){switch(e){case void 0:case` `:case`
283
+ `:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}})),qb=/* @__PURE__ */ L((e=>{var t=Kb();function n(e){switch(e){case void 0:case` `:case`
284
284
  `:case`\r`:case` `:return!0;default:return!1}}let r=/* @__PURE__ */ new Set(`0123456789ABCDEFabcdef`),i=/* @__PURE__ */ new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),a=/* @__PURE__ */ new Set(`,[]{}`),o=/* @__PURE__ */ new Set(` ,[]{}
285
285
  \r `),s=e=>!e||o.has(e);e.Lexer=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
286
286
  `||t===`\r`&&this.buffer[e+1]===`
@@ -299,7 +299,7 @@ default:return s(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found:
299
299
  `,t=this.buffer[i+1]):r=i),t===`#`||e&&a.has(t))break;if(o===`
300
300
  `){let e=this.continueScalar(i+1);if(e===-1)break;i=Math.max(i,e-2)}}else{if(e&&a.has(o))break;r=i}return!o&&!this.atEnd?this.setNext(`plain-scalar`):(yield t.SCALAR,yield*this.pushToIndex(r+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue;case`&`:e+=yield*this.pushUntil(s),e+=yield*this.pushSpaces(!0);continue;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,r=this.charAt(1);if(n(r)||t&&a.has(r)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue}}}break}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!n(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(i.has(t))t=this.buffer[++e];else if(t===`%`&&r.has(this.buffer[e+1])&&r.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
301
301
  `?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
302
- `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}})),qb=/* @__PURE__ */ L((e=>{e.LineCounter=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}}})),Jb=/* @__PURE__ */ L((e=>{var t=z(`process`),n=Gb(),r=Kb();function i(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function a(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function o(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function s(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;
302
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}})),Jb=/* @__PURE__ */ L((e=>{e.LineCounter=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}}})),Yb=/* @__PURE__ */ L((e=>{var t=z(`process`),n=Kb(),r=qb();function i(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function a(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function o(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function s(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;
303
303
  /* istanbul ignore next should not happen */
304
304
  default:return[]}}function c(e){if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break e}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function l(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function u(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!i(t.start,`explicit-key-ind`)&&!i(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,o(t.value)?t.value.end?l(t.value.end,t.sep):t.value.end=t.sep:l(t.start,t.sep),delete t.sep)}e.Parser=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new r.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,t.env.LOG_TOKENS&&console.log(`|`,n.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=n.tokenType(e);if(!r){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(r===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=r,yield*this.step(),r){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source})}else{if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}
305
305
  /* istanbul ignore next should not happen */
@@ -315,19 +315,19 @@ default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.l
315
315
  /* istanbul ignore else should not happen */
316
316
  n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=c(s(t));u(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
317
317
  `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
318
- `,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=c(s(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=c(s(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}}})),Yb=/* @__PURE__ */ L((e=>{var t=Vb(),n=wb(),r=Tb(),i=Yy(),a=Q(),o=qb(),s=Jb();function c(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new o.LineCounter||null,prettyErrors:t}}function l(e,n={}){let{lineCounter:i,prettyErrors:a}=c(n),o=new s.Parser(i?.addNewLine),l=new t.Composer(n),u=null;for(let t of l.compose(o.parse(e),!0,e.length))if(!u)u=t;else if(u.options.logLevel!==`silent`){u.errors.push(new r.YAMLParseError(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return a&&i&&(u.errors.forEach(r.prettifyError(e,i)),u.warnings.forEach(r.prettifyError(e,i))),u}e.parse=function(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let a=l(e,n);if(!a)return null;if(a.warnings.forEach(e=>i.warn(a.options.logLevel,e)),a.errors.length>0){if(a.options.logLevel!==`silent`)throw a.errors[0];a.errors=[]}return a.toJS(Object.assign({reviver:r},n))},e.parseAllDocuments=function(e,n={}){let{lineCounter:i,prettyErrors:a}=c(n),o=new s.Parser(i?.addNewLine),l=new t.Composer(n),u=Array.from(l.compose(o.parse(e)));if(a&&i)for(let t of u)t.errors.forEach(r.prettifyError(e,i)),t.warnings.forEach(r.prettifyError(e,i));return u.length>0?u:Object.assign([],{empty:!0},l.streamInfo())},e.parseDocument=l,e.stringify=function(e,t,r){let i=null;if(typeof t==`function`||Array.isArray(t)?i=t:r===void 0&&t&&(r=t),typeof r==`string`&&(r=r.length),typeof r==`number`){let e=Math.round(r);r=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=r??t??{};if(!e)return}return a.isDocument(e)&&!i?e.toString(r):new n.Document(e,i,r).toString(r)}})),Xb=(/* @__PURE__ */ L((e=>{var t=Vb(),n=wb(),r=Sb(),i=Tb(),a=By(),o=Q(),s=Qy(),c=Vy(),l=eb(),u=nb();Gb();var d=Kb(),f=qb(),p=Jb(),m=Yb(),h=Py();e.Composer=t.Composer,e.Document=n.Document,e.Schema=r.Schema,e.YAMLError=i.YAMLError,e.YAMLParseError=i.YAMLParseError,e.YAMLWarning=i.YAMLWarning,e.Alias=a.Alias,e.isAlias=o.isAlias,e.isCollection=o.isCollection,e.isDocument=o.isDocument,e.isMap=o.isMap,e.isNode=o.isNode,e.isPair=o.isPair,e.isScalar=o.isScalar,e.isSeq=o.isSeq,e.Pair=s.Pair,e.Scalar=c.Scalar,e.YAMLMap=l.YAMLMap,e.YAMLSeq=u.YAMLSeq,e.Lexer=d.Lexer,e.LineCounter=f.LineCounter,e.Parser=p.Parser,e.parse=m.parse,e.parseAllDocuments=m.parseAllDocuments,e.parseDocument=m.parseDocument,e.stringify=m.stringify,e.visit=h.visit,e.visitAsync=h.visitAsync})))();function Zb(e){let t=(0,Xb.parseDocument)(e),n=!1;function r(r){e=r,t=(0,Xb.parseDocument)(e),n=!1}function i(e,r){let i=e.length===1?t.contents:t.getIn(e.slice(0,-1));i||(i=t.createNode({}),t.setIn(e.slice(0,-1),i));let a=e[e.length-1],o=i.items.find(e=>typeof e.key==`string`?e.key===a:e.key.value===a),s=i.items.map(e=>typeof e.key==`string`?e.key:String(e.key.value));if(!o){let e=0;for(;e<s.length&&!(s[e].localeCompare(a)>0);e++);o=new Xb.Pair(a,r),i.items.splice(e,0,o),n=!0}else if((0,Xb.isAlias)(o.value)){let e=Qb(t,o.value);e&&e.value!==r&&(e.value=r,n=!0)}else!o.value||typeof o.value==`string`?o.value!==r&&(o.value=r,n=!0):o.value.value!==r&&(o.value.value=r,n=!0)}function a(e,n,r){let i=t.toJSON()||{},a=e==="default"?i.catalog?.[n]:i.catalogs?.[e]?.[n];if(a===r)return{conflicts:!1,newCatalogName:e,existingSpecifier:a};if(a){let t=$b(r);return{conflicts:!0,existingSpecifier:a,newCatalogName:e==="default"?`conflicts_${n}_${t}`:`conflicts_${e}_${t}`}}return{conflicts:!1,newCatalogName:e}}function o(e,t,n){let{newCatalogName:r}=a(e,t,n);s(r,t,n)}function s(e,n,r){let a=t.toJSON()?.catalogs?.default!==void 0;i(e==="default"&&!a?[`catalog`,n]:[`catalogs`,e,n],r)}function c(e){let n=[],r=t.toJSON()||{};if(r.catalogs)for(let t of Object.keys(r.catalogs))r.catalogs[t]?.[e]&&n.push(t);return r.catalog&&r.catalog[e]&&n.push(`default`),n}return{getDocument(){return t},setContent:r,hasChanged:()=>n,toJSON:()=>t.toJSON(),toString:n=>{let r=e.split(`'`).length>=e.split(`"`).length;return t.toString({singleQuote:r,...n})},setPath:i,setPackage:s,setPackageNoConflicts:o,getPackageCatalogs:c,hasSpecifierConflicts:a}}function Qb(e,t){let n;return(0,Xb.visit)(e,{Scalar:(e,r,i)=>{r.anchor===t.source&&typeof r.value==`string`&&(n=r)}}),n}function $b(e){return e.replace(/\^/g,`h`).replace(/~/g,`t`).replace(/\./g,`_`).replace(/</g,`l`).replace(/>/g,`g`).replace(/=/g,`e`).replace(/\*/g,`s`).replace(/@/g,`a`).replace(/\|/g,`p`).replace(/&/g,`n`).replace(/-/g,`m`).replace(/\+/g,`u`).replace(/\s/g,`_`)}function ex(e){return e??=[],Array.isArray(e)?e:[e]}function tx(e){return typeof e==`object`&&!!e&&`json`in e&&typeof e.json==`function`}function nx(e){if(tx(e))return e.json();throw TypeError(`response does not implement json()`)}const rx=3e4,ix=`version-upgrade@npm node/${y.version}`,ax=Object.assign((e,t)=>{let n=new Headers(t?.headers);return n.set(`user-agent`,ix),Tv(e,{...t,headers:n})},{preconnect:()=>{}});async function ox(e,t,n,r){let i;for(let a=0;a<=r;a++)try{return await Promise.race([e(),new Promise((e,i)=>setTimeout(()=>i(/* @__PURE__ */ Error(`Timeout requesting "${t}" (attempt ${a+1}/${r+1})`)),n))])}catch(e){if(i=e instanceof Error?e:Error(String(e)),a<r){let e=Math.min(1e3*2**a,1e4);await new Promise(t=>setTimeout(t,e))}}throw i??Error(`Unexpected state: all retries exhausted for "${t}" but no error captured`)}async function sx(e,t=!1,n,r=rx,i=3){let a=await ox(()=>h_(e,{cwd:n,force:t,fetch:ax,metadata:!0,throw:!1}),e,r,i);if(!ux(a))throw Error(`Invalid package metadata received for "${e}"`);let o=a;if(`error`in o)throw Error(`Failed to fetch package "${e}": ${o.error}`);return lx(o)}async function cx(e,t=rx,n=3){let r=await ox(()=>ax(new URL(`${e}/meta.json`,`https://jsr.io/`),{headers:{accept:`application/json`}}).then(e=>nx(e)),e,t,n);if(!dx(r))throw Error(`Invalid JSR package metadata received for "${e}"`);let i=r;return{versions:Object.keys(i.versions),tags:{latest:i.latest}}}function lx(e){let t=Object.keys(e.versionsMeta),n=Object.fromEntries(Object.entries(e.versionsMeta).flatMap(([e,t])=>t.deprecated==null?[]:[[e,t.deprecated]])),r=Object.fromEntries(Object.entries(e.versionsMeta).map(([e,t])=>[e,t.engines?.node]).filter(([,e])=>e)),i=Object.fromEntries(Object.entries(e.versionsMeta).map(([e,t])=>[e,t.provenance]).filter(([,e])=>e)),a=Object.fromEntries(Object.entries(e.versionsMeta).map(([e,t])=>[e,t.integrity]).filter(([,e])=>e));return{tags:e.distTags,versions:t,time:{...Object.fromEntries(Object.entries(e.versionsMeta).filter(([,e])=>e.time).map(([e,t])=>[e,t.time])),created:e.timeCreated,modified:e.timeModified},nodeSemver:r,provenance:i,deprecated:Object.keys(n).length>0?n:void 0,integrity:a}}function ux(e){return typeof e==`object`&&!!e&&`versionsMeta`in e&&`distTags`in e}function dx(e){return typeof e==`object`&&!!e&&`scope`in e&&`name`in e&&`latest`in e&&`versions`in e}let fx=null;const px=()=>(fx===null&&(fx=xd(`packages/version-upgrade/src/io/cache`)),fx),mx=(0,Om.default)(`version-upgrade:cache`);let hx={},gx=!1;const _x=wm(ce.tmpdir(),`version-upgrade`),vx=wm(_x,`cache.json`),yx=18e5;function bx(){return Date.now()}function xx(e){return bx()-e}async function Sx(){p(vx)&&xx(m(vx).mtimeMs)<yx?(mx(`cache loaded from ${vx}`),hx=JSON.parse(await h.readFile(vx,`utf-8`))):mx(`no cache found`)}async function Cx(){if(gx)try{await h.mkdir(_x,{recursive:!0}),await h.writeFile(vx,JSON.stringify(hx),`utf-8`),mx(`cache saved to ${vx}`)}catch(e){px().error(`Failed to save cache`,e instanceof Error?e:Error(String(e)))}}async function wx(e,t=`npm`,n,r,i){let a,o=`${t}:${e}`;if(hx[o]){if(xx(hx[o].cacheTime)<yx)return mx(`cache hit for ${o}`),hx[o].data;delete hx[o]}try{let a=t===`jsr`?await cx(e,r,i):await sx(e,!1,n,r,i);if(a)return hx[o]={data:a,cacheTime:bx()},gx=!0,a}catch(e){a=e}return{tags:{},versions:[],error:a instanceof Error&&a.message||String(a),deprecated:{}}}const Tx=[`**/node_modules/**`,`**/dist/**`,`**/public/**`,`**/fixture/**`,`**/fixtures/**`];function Ex(e,t=[]){if(!e)return{};let n={};for(let[r,i]of Object.entries(e))if(typeof i==`object`&&i){let e={};for(let[t,n]of Object.entries(i))e[t]=n;n={...n,...Ex(e,[...t,r])}}else typeof i==`string`&&(n[r]={version:i,parents:t});return n}function Dx(e,t){let n=t.split(`.`).reduce((e,t)=>{if(typeof e==`object`&&e){let n={};for(let[t,r]of Object.entries(e))n[t]=r;return n[t]}},e);if(typeof n==`object`&&n){let e={};for(let[t,r]of Object.entries(n))e[t]=r;return Ex(e)}return{}}function Ox(e){if(typeof e==`object`&&e&&!Array.isArray(e)){let t={};for(let[n,r]of Object.entries(e))t[n]=r;return t}return{}}function kx(e,t,n){let r=t.split(`.`),i=r.pop();if(i===void 0)return;let a=e;for(let e of r){(typeof a[e]!=`object`||a[e]===null)&&(a[e]={});let t=Ox(a[e]);a[e]=t,a=t}a[i]=n}function Ax(e,t,n){return Object.entries(Dx(e,t)||{}).map(([e,{version:r,parents:i}])=>jx({name:e,version:r,type:t,shouldUpdate:n,parents:i}))}function jx({name:e,version:t,type:n,shouldUpdate:r,parents:i,hexHash:a}){let o={name:e,currentVersion:t,parents:i,source:n,update:r(e)};return a&&(o.hexHash=a),o}function Mx(e,t){let n={};return e.filter(e=>e.source===t).sort((e,t)=>(e.aliasName||e.name).localeCompare(t.aliasName||t.name)).forEach(e=>{let t=e.update?e.targetVersion:e.currentVersion,r=n;if(e.parents&&e.parents.length>0){let t=n;for(let n of e.parents){(typeof t[n]!=`object`||t[n]===null)&&(t[n]={});let e=Ox(t[n]);t[n]=e,t=e}r=t}if(e.aliasName===void 0)r[e.name]=t;else{let n=e.protocol?`${e.protocol}:`:``;r[e.aliasName]=`${n}${e.protocol===`jsr`?t:Nx(e,t)}`}}),n}function Nx(e,t){let n=t?`@${t}`:``;return`${e.name}${n}`}async function Px(e,t,n,r){let i=wm(t.cwd??``,e),a=r??JSON.parse(await N(i,`utf-8`)),o=[];function s(t,r){let o=Object.entries(r).map(([e,t])=>jx({name:e,version:t,type:`bun-workspace`,shouldUpdate:n}));return{name:t,private:!0,version:``,type:`bun-workspace`,relative:e,filepath:i,raw:a,deps:o,resolved:[]}}let c=a?.workspaces;if(c&&typeof c==`object`){let e=Lx(c);if(e.catalog&&typeof e.catalog==`object`&&o.push(s(`bun-catalog:default`,Rx(e.catalog))),e.catalogs&&typeof e.catalogs==`object`){let t=zx(e.catalogs);for(let e of Object.keys(t)){let n=t[e];n&&o.push(s(`bun-catalog:${e}`,n))}}}return o}async function Fx(e,t){let n=Mx(e.resolved,`bun-workspace`);if(Object.keys(n).length&&e.name.startsWith(`bun-catalog:`)){let t=e.name.replace(`bun-catalog:`,``),r=Lx(e.raw.workspaces??{});if(e.raw.workspaces=r,t==="default")r.catalog={...Rx(r.catalog??{}),...Rx(n)};else{let e=zx(r.catalogs??{});r.catalogs=e,e[t]||(e[t]={}),e[t]={...e[t],...Rx(n)}}await Ix(e.filepath,e.raw)}}async function Ix(e,t){let n;try{n=Pv(await N(e,`utf-8`)).indent}catch{}let r=JSON.stringify(t,null,n||` `);await F(e,`${r}\n`,`utf-8`)}function Lx(e){if(typeof e==`object`&&e&&!Array.isArray(e)){let t={};for(let[n,r]of Object.entries(e))t[n]=r;return t}return{}}function Rx(e){if(typeof e==`object`&&e&&!Array.isArray(e)){let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}return{}}function zx(e){if(typeof e==`object`&&e&&!Array.isArray(e)){let t={};for(let[n,r]of Object.entries(e))if(typeof r==`object`&&r&&!Array.isArray(r)){let e={};for(let[t,n]of Object.entries(r))typeof n==`string`&&(e[t]=n);t[n]=e}return t}return{}}let Bx=null;const Vx=()=>(Bx===null&&(Bx=xd(`packages/version-upgrade/src/addons/vscode`)),Bx);function Hx(e,t){if(typeof e==`object`&&e){for(let[n,r]of Object.entries(e))if(n===t&&typeof r==`string`)return r}}function Ux(e){return e!=null&&Hx(e.engines,`vscode`)!==void 0}function Wx(e){for(let t of[`dependencies`,`devDependencies`,`peerDependencies`]){let n=Hx(e[t],`@types/vscode`);if(n!==void 0)return n}return``}const Gx=[{beforeWrite(e){if(!Ux(e.raw)||e.raw==null)return;let t=e.raw,n=Wx(t);if(!n||n.includes(`:`))return;let r=t.engines,i=Hx(r,`vscode`);if(!i)return;let a=My(i),o=My(n);if(a&&o&&ty(o,a)){Vx().info(`[taze addon] Updated VS Code engine field to ${n}`);let e=/[>^<:~]/.test(n)?n:`^${n}`;if(typeof r==`object`&&r){let n={};for(let[t,i]of Object.entries(r))n[t]=t===`vscode`?e:i;t.engines=n}}}}];function Kx(e){return ue.from(e.slice(7),`base64`).toString(`hex`)}function qx(e){return typeof e==`object`&&!!e&&`version`in e&&typeof e.version==`string`}const Jx=[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`,`packageManager`,`pnpm.overrides`,`resolutions`,`overrides`];function Yx(e,t){return t.depFields?.[e]===!1?!1:e!==`peerDependencies`||!!t.peer}async function Xx(e,t,n,r){let i=wm(t.cwd??``,e),a=r??await hS(i),o=[];for(let e of Jx)if(Yx(e,t)){if(e===`packageManager`){let e=a.packageManager;if(typeof e==`string`){let t=e.indexOf(`@`),r=t>0?e.slice(0,t):``,i=t>0?e.slice(t+1):``,a=i.indexOf(`+`),s=a>=0?i.slice(0,a):i,c=a>=0?i.slice(a+1):``,l=c.indexOf(`.`),u=l>=0?c.slice(l+1):void 0;o.push(jx({name:r,version:`^${s}`,type:`packageManager`,shouldUpdate:n,hexHash:u}))}}else o.push(...Ax(a,e,n))}let s=typeof a.name==`string`?a.name:``,c=typeof a.version==`string`?a.version:``;return[{name:s,private:!!a.private,version:c,type:`package.json`,relative:e,filepath:i,raw:a,deps:o,resolved:[]}]}async function Zx(e,t){let n=!1;for(let r of Jx)if(Yx(r,t)){if(r===`packageManager`){let t=Object.entries(Mx(e.resolved,`packageManager`))[0];if(t){e.raw||={};let[r,i]=t,a=typeof i==`string`?i.replace(`^`,``):String(i),o=`${r}@${a}`,s=e.resolved.find(e=>e.source===`packageManager`&&e.name===r);if(s?.hexHash){let e=s.pkgData?.integrity?.[a];if(e){let t=Kx(e);o=`${o}+sha512.${t}`}}e.raw.packageManager=o,n=!0}}else{let t=Dx(e.raw,r),i=Mx(e.resolved,r),a={};for(let[e,n]of Object.entries(t||{}))qx(n)&&(a[e]=n.version);for(let[e,t]of Object.entries(i||{}))a[e]=t;Object.keys(a).length>0&&(kx(e.raw,r,a),n=!0)}}if(n){for(let n of t.addons||Gx)await n.beforeWrite?.(e,t);await gS(e.filepath,e.raw||{})}}const Qx=[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`,`packageManager`,`pnpm.overrides`,`resolutions`,`overrides`];function $x(e,t){return e===`peerDependencies`?!!t.peer:t.depFields?.[e]!==!1}async function eS(e){let t=await se.readFile(e,`utf-8`);if(!t)return new Xb.Document({});let n=(0,Xb.parseDocument)(t,{merge:!0}),r=n.toJS();if(n.errors.length||typeof r!=`object`||Array.isArray(r))throw TypeError(`Invalid package.yaml structure in ${e}`);return n}async function tS(e,t){let{amount:n,type:r}=await se.readFile(e,`utf-8`).then(Pv).catch(()=>({amount:2,type:`space`})),i=(0,Xb.stringify)(t,{indent:(r===`tab`?2:n)??2,aliasDuplicateObjects:!1,lineWidth:0}).replace(/^(\s*)"(@[^":]+)":/gm,`$1'$2':`);await se.writeFile(e,i,`utf-8`)}async function nS(e,t,n){let r=wm(t.cwd??``,e),i=await eS(r),a=[];for(let e of Qx)if($x(e,t)){if(e===`packageManager`){let t=i.get(e);if(typeof t==`string`){let e=t.split(`@`),r=e[0]??``,i=(e[1]??``).split(`+`)[0];a.push(jx({name:r,version:`^${i??``}`,type:`packageManager`,shouldUpdate:n}))}}else{let t={},r=i.toJS();if(typeof r==`object`&&r&&!Array.isArray(r))for(let[e,n]of Object.entries(r))t[e]=n;a.push(...Ax(t,e,n))}}let o=i.get(`name`),s=i.get(`version`);return[{name:typeof o==`string`?o:``,private:!!i.get(`private`),version:typeof s==`string`?s:``,type:`package.yaml`,relative:e,filepath:r,get raw(){return i.toJS()},deps:a,yamlDocument:i,resolved:[]}]}async function rS(e,t){let n=!1;if(e.type!==`package.yaml`)throw Error(`Package type is not supported`);let r=e.yamlDocument||new Xb.Document(e.raw);for(let i of Qx)if($x(i,t)){if(i===`packageManager`){let t=Object.entries(Mx(e.resolved,`packageManager`))[0];if(t){let[e,i]=t,a=typeof i==`string`?i.replace(`^`,``):``;r.set(`packageManager`,`${e}@${a}`),n=!0}}else{let t=Dx(iS(r),i);t&&Object.keys(t).length>0&&(Object.entries(Mx(e.resolved,i)).forEach(([e,t])=>r.setIn([...i.split(`.`),e],t)),n=!0)}}if(n){for(let n of t.addons||Gx)await n.beforeWrite?.(e,t);await tS(e.filepath,r)}}function iS(e){let t=e.toJS();if(typeof t==`object`&&t&&!Array.isArray(t)){let e={};for(let[n,r]of Object.entries(t))e[n]=r;return e}return{}}async function aS(e,t,n){let r=wm(t.cwd??``,e),i=Zb(await N(r,`utf-8`)),a=i.getDocument().toJSON(),o=[];function s(t,o){let s=Object.entries(o).map(([e,t])=>jx({name:e,version:t,type:`pnpm-workspace`,shouldUpdate:n}));return{name:t,private:!0,version:``,type:`pnpm-workspace.yaml`,relative:e,filepath:r,raw:a,context:i,deps:s,resolved:[]}}if(a?.catalog&&o.push(s(`pnpm-catalog:default`,a.catalog)),a?.catalogs)for(let e of Object.keys(a.catalogs))o.push(s(`pnpm-catalog:${e}`,a.catalogs[e]));return a?.overrides&&o.push(s(`pnpm-workspace:overrides`,a.overrides)),o}async function oS(e,t){let n=Mx(e.resolved,`pnpm-workspace`);if(Object.keys(n).length){if(e.name.startsWith(`pnpm-catalog:`)){let t=e.name.replace(`pnpm-catalog:`,``);for(let[r,i]of Object.entries(n))typeof i==`string`&&e.context.setPackage(t,r,i)}else{let t=e.name.replace(`pnpm-workspace:`,``).split(/\./g);for(let[r,i]of Object.entries(n))e.context.setPath([...t,r],i)}e.context.hasChanged()&&await sS(e,e.context)}}function sS(e,t){return F(e.filepath,t.toString(),`utf8`)}async function cS(e,t,n){let r=wm(t.cwd??``,e),i=Zb(await N(r,`utf-8`)),a=i.getDocument().toJSON(),o=[];function s(t,o){let s=Object.entries(o).map(([e,t])=>jx({name:e,version:t,type:`yarn-workspace`,shouldUpdate:n}));return{name:t,private:!0,version:``,type:`.yarnrc.yml`,relative:e,filepath:r,raw:a,context:i,deps:s,resolved:[]}}if(a?.catalog&&o.push(s(`yarn-catalog:default`,a.catalog)),a?.catalogs)for(let e of Object.keys(a.catalogs))o.push(s(`yarn-catalog:${e}`,a.catalogs[e]));return o}async function lS(e,t){let n=Mx(e.resolved,`yarn-workspace`);if(Object.keys(n).length){if(e.name.startsWith(`yarn-catalog:`)){let t=e.name.replace(`yarn-catalog:`,``);for(let[r,i]of Object.entries(n))typeof i==`string`&&e.context.setPackage(t,r,i)}else{let t=e.name.replace(`yarn-workspace:`,``).split(/\./g);for(let[r,i]of Object.entries(n))e.context.setPath([...t,r],i)}e.context.hasChanged()&&await uS(e,e.context)}}function uS(e,t){return F(e.filepath,t.toString(),`utf8`)}function dS(e){return e.replace(/[.+?^${}()|[\]\\]/g,`\\$&`)}function fS(e){if(e.startsWith(`/`)){let t=e.lastIndexOf(`/`),n=e.substring(1,t),r=e.substring(t+1,e.length);return new RegExp(n,r)}return RegExp(`^${dS(e).replace(/\*+/g,`.*?`)}$`)}function pS(e,t=!0){if(!e||e.length===0)return()=>t;let n=ex(e).flatMap(e=>e.split(`,`)).map(fS);return e=>{for(let t of n)if(t.test(e))return!0;return!1}}function mS(e,t){let n=pS(e,!0),r=pS(t,!1);return e=>!r(e)&&n(e)}async function hS(e){return JSON.parse(await h.readFile(e,`utf-8`))}async function gS(e,t){let n=Pv(await h.readFile(e,`utf-8`)).indent||` `;await h.writeFile(e,`${JSON.stringify(t,null,n)}\n`,`utf-8`)}async function _S(e,t){switch(e.type){case`package.json`:return Zx(e,t);case`package.yaml`:return rS(e,t);case`pnpm-workspace.yaml`:return oS(e,t);case`bun-workspace`:return Fx(e,t);case`.yarnrc.yml`:return lS(e,t);default:throw Error(`Unsupported package type: ${e.type}`)}}async function vS(e,t,n){if(e.endsWith(`pnpm-workspace.yaml`))return aS(e,t,n);if(e.endsWith(`.yarnrc.yml`))return cS(e,t,n);if(e.endsWith(`package.yaml`))return nS(e,t,n);if(e.endsWith(`package.json`)){let r=wm(t.cwd??``,e);try{let i=await hS(r),a=i?.workspaces;if(a&&typeof a==`object`&&(`catalog`in a||`catalogs`in a)){let r=wm(t.cwd||y.cwd());if(p(Sm(r,`bun.lockb`))||p(Sm(r,`bun.lock`))){let r=await Px(e,t,n,i),a=await Xx(e,t,n,i);return[...r,...a]}}return Xx(e,t,n,i)}catch{}}return Xx(e,t,n)}async function yS(e){let t=[],n=wm(e.cwd||y.cwd()),r=mS(e.include,e.exclude);if(e.recursive){let n=await zp(`**/package.yaml`,{ignore:Tx.concat(e.ignorePaths||[]),cwd:e.cwd,onlyFiles:!0,dot:!1,expandDirectories:!1}),r=await zp(`**/package.json`,{ignore:Tx.concat(e.ignorePaths||[]),cwd:e.cwd,onlyFiles:!0,dot:!1,expandDirectories:!1}),i=/* @__PURE__ */ new Set;for(let e of n){t.push(e);let n=Dm(e);i.add(n)}for(let e of r){let n=Dm(e);i.has(n)||t.push(e)}}else t=await zp(`package.{yaml,json}`,{cwd:n});return t=t.sort((e,t)=>e.localeCompare(t)),e.ignoreOtherWorkspaces&&(t=(await Promise.all(t.map(async e=>{if(!e.includes(`/`))return[e];let t=Sm(n,e),r=Lv(`.git`,{cwd:t,last:n});if(r&&Dm(r)!==n)return[];let i=Lv(`pnpm-workspace.yaml`,{cwd:t,last:n});if(i&&Dm(i)!==n)return[];let a=Lv(`.yarnrc.yml`,{cwd:t,last:n});if(a&&Dm(a)!==n)return[];let o=Lv(`bun.lockb`,{cwd:t,last:n})||Lv(`bun.lock`,{cwd:t,last:n});return o&&Dm(o)!==n?[]:[e]}))).flat()),p(Sm(n,`pnpm-workspace.yaml`))&&t.unshift(`pnpm-workspace.yaml`),p(Sm(n,`.yarnrc.yml`))&&t.unshift(`.yarnrc.yml`),(await Promise.all(t.map(t=>vS(t,e,r)))).flat()}const bS={error:-1,major:0,minor:1,patch:2,"":3};function xS(e){return e.sort((e,t)=>bS[e.diff||``]-bS[t.diff||``])}function SS(e,t){if(t.packageMode){for(let n of Object.keys(t.packageMode))if(fS(n).test(e))return t.packageMode[n]}}function CS(e,t){let n=[];for(let r of ex(t.maturityPeriodExclude).flatMap(e=>e.split(`,`))){let t=r.trim();if(!t)continue;let i=t.startsWith(`/`)?-1:t.lastIndexOf(`@`);if(!fS(i>0?t.slice(0,i):t).test(e))continue;if(i<=0)return!0;let a=t.slice(i+1).split(`||`).map(e=>e.trim()).filter(Boolean);n.push(...a)}return n}function wS(e,t){for(let n of t)if(jy(e,n,{includePrerelease:!0}))return!0;return!1}const TS=new t;function ES(e){return e.match(/(@[^/]+\/)?([^/]+)/g)||[]}function DS(e){return e.match(/[^>]+/g)||[]}function OS(e){return/^(?:https?:|git\+|github:)/.test(e)}function kS(e){return/^(?:link|file|workspace|catalog):/.test(e)}function AS(e){return/^(?:npm|jsr):/.test(e)}function jS(e){return e===`npm`?`npm`:e===`jsr`?`jsr`:`npm`}function MS(e){let t=e.indexOf(`:`),n=jS(e.slice(0,t)),r=e.slice(t+1);if(n===`npm`){let e=r.lastIndexOf(`@`);return e>0?{protocol:n,name:r.substring(0,e),version:r.substring(e+1)}:{protocol:n,name:r,version:``}}return{protocol:n,name:``,version:r}}function NS(e){let t=[`>=`,`<=`,`>`,`<`,`~`,`^`],n=e.trim();if(n===`*`||n===``)return`*`;if(n[0]===`~`||n[0]===`^`)return n[0];for(let e of t)if(n.startsWith(e))return e;if(n.includes(`x`)){let e=n.split(`.`);if(e[0]===`x`)return`*`;if(e[1]===`x`)return`^`;if(e[2]===`x`)return`~`}return n.length>0&&n.charCodeAt(0)>=48&&n.charCodeAt(0)<=57?``:null}function PS(e,t){if(!Ny(e))return null;if(t==="default")return e;let n=My(e);return n?{major:`>=`,minor:`^`,patch:`~`}[t]+n:null}function FS(e,t){return e==null||t==null?null:t===`*`?`*`:t+e}function IS(e,t){return FS(t,NS(e))}function LS(e,t,n,r){let i=null;if(n===`latest`){let t=r.latest;i=t!=null&&e.includes(t)?t:e.at(-1)??null}else if(n===`newest`)i=e.at(-1)??null;else if(n===`next`){let t=r.next;i=t!=null&&e.includes(t)?t:e.at(-1)??null}else if(n===`stable`){let n=PS(t,`default`);if(!n)return;e.filter(e=>!e.includes(`-`)).forEach(e=>{jy(e,n)&&(!i||ty(e,i))&&(i=e)})}else if(n==="default"&&(t===`*`||t.trim()===``))return;else{let a=PS(t,n);if(!a)throw Error(`invalid_range`);let o=r.latest??null;o&&!jy(o,a)&&(o=null),e.forEach(e=>{jy(e,a)&&(o&&!iy(e,o)||i&&!ty(e,i)||(i=e))})}if(i)return i}function RS(e,t){return e.filter(e=>!t[e])}function zS(e,t,n){if(!t||n<=0)return e;let r=/* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).getTime()-n*24*60*60*1e3);return e.filter(e=>{let n=t[e];return!n||new Date(n)<r})}function BS(e,t,n){let{tags:r}=e.pkgData,i=VS(e,n);if(i.length!==0)return e.filteredVersions=i,LS(i,e.currentVersion,t,r)}function VS(e,t){let{versions:n,deprecated:r,time:i}=e.pkgData,a=n;r&&Object.keys(r).length>0&&(a=RS(a,r));let o=CS(e.name,t);if(t.maturityPeriod&&t.maturityPeriod>0&&o!==!0){let e=a;if(a=zS(e,i,t.maturityPeriod),o.length>0){let t=new Set(a);a=e.filter(e=>t.has(e)||wS(e,o))}}return a}function HS(e,t,n){let r=BS(e,`latest`,n);return r&&ty(r,t)?r:void 0}function US(e,t,n=!0,r=!1){let i=/^\d+/.test(e.currentVersion);if(i&&!r)e.targetVersion=e.currentVersion,e.targetVersionTime=e.currentVersionTime,e.diff=null,e.update=!1;else{if(e.targetVersion=IS(e.currentVersion,t)||e.currentVersion,e.targetVersionTime=e.pkgData.time?.[t],e.currentProvenance=e.pkgData.provenance?.[e.currentVersion],e.targetProvenance=e.pkgData.provenance?.[e.targetVersion],e.provenanceDowngraded=!(!e.currentProvenance||e.targetProvenance)||e.currentProvenance===`trustedPublisher`&&e.targetProvenance===!0,i&&ey(e.currentVersion,e.targetVersion)){let{versions:t,time:n={},tags:r}=e.pkgData,i=LS(e.filteredVersions??t,e.currentVersion,`minor`,r);i&&(e.targetVersion=i,e.targetVersionTime=n[e.targetVersion])}try{let t=My(e.currentVersion),n=My(e.targetVersion);if(!t||!n)throw Error(`invalid_version`);e.currentVersionTime=e.pkgData.time?.[t.toString()],e.diff=WS(t,n),e.update=e.diff!==null&&ry(t,n)}catch(t){if(!n)throw t;e.targetVersion=e.currentVersion,e.diff=`error`,e.update=!1}}}function WS(e,t){if(ey(e,t))return null;let n=jy(t,`~${e}`,{includePrerelease:!0}),r=jy(t,`^${e}`,{includePrerelease:!0}),i=jy(t,`>=${e}`,{includePrerelease:!0});return n?r?`patch`:`major`:r?`minor`:i?`major`:`error`}function GS(e,t){return{...e,diff:null,targetVersion:e.currentVersion,update:!1,provenanceDowngraded:!1,pkgData:{tags:{},versions:[]},...t}}function KS(e){return e!=null&&e!==`ignore`?e:`default`}async function qS(e,t,n=()=>!0){let r={...e,diff:null,targetVersion:e.currentVersion,update:e.update,provenanceDowngraded:!1,pkgData:{tags:{},versions:[]}},i=SS(r.name,t),a=t.mode,o=i?i===a?a:a==="default"?i:`ignore`:a;if(kS(e.currentVersion)||OS(e.currentVersion)||!e.update||!await Promise.resolve(n(e))||o===`ignore`)return GS(e);if(AS(e.currentVersion)){let{name:t,version:n,protocol:i}=MS(e.currentVersion);if(r.name=t||r.name,r.currentVersion=n,r.aliasName=e.name,r.protocol=i,!n)return GS(e,{name:r.name,currentVersion:n,aliasName:e.name,protocol:i})}let s=r.name;r.source===`resolutions`?s=ES(r.name).pop()??r.name:r.source===`pnpm.overrides`&&(s=DS(r.name).pop()??r.name);let c=await wx(s,r.protocol,t.cwd,t.timeout,t.retries),{error:l,deprecated:u}=c;r.pkgData=c;let d=null,f;if(l==null)try{if(u&&typeof u==`object`&&r.currentVersion&&u[r.currentVersion])return GS(e,{name:r.name,currentVersion:r.currentVersion,aliasName:r.aliasName,protocol:r.protocol});if(f=BS(r,KS(o),t),!f)return GS(e,{name:r.name,currentVersion:r.currentVersion,aliasName:r.aliasName,protocol:r.protocol,pkgData:c})}catch(e){d=e instanceof Error?e.message:String(e)}else d=l;f?US(r,f,void 0,t.includeLocked):r.targetVersion=r.currentVersion,r.targetVersion===r.currentVersion&&(r.diff=null,r.update=!1);try{let e=My(f||r.targetVersion||``);e&&(r.latestVersionAvailable=HS(r,e,t));let{nodecompat:n=!0}=t;if(n){let t=y.version,{nodeSemver:n}=r.pkgData;if(n&&e?.version&&e?.version in n){let i=n[e.version];r.nodeCompatibleVersion={compatible:i!=null&&jy(t,i),semver:i??``}}}}catch{}return d&&(r.diff=`error`,r.update=!1,r.resolveError=d),r}async function JS(e,t,n=()=>!0,r=()=>{}){let i=e.length,a=0,{concurrency:o=10}=t,s=TS.getStore()||um(o);return Promise.all(e.map(e=>s.add(async()=>{let o=await qS(e,t,n);return a+=1,r(e.name,a,i),o})))}async function YS(e,t,n,r){let i=await JS(e.deps,t,n,(t,n,i)=>r?.(e.name,t,n,i));return xS(i),e.resolved=i,e}async function XS(e,t={}){e.force||await Sx();let n=await yS(e);t.afterPackagesLoaded?.(n);let r=n.filter(e=>e.private).map(e=>e.name).filter(e=>e),i=e=>!r.includes(e.name),a=0,o=(e,n,r,i)=>{a++,t.onDependencyResolved?.(e,n,a,i)},s=um(e.concurrency||10);return await TS.run(s,()=>Promise.all(n.map(async n=>{t.beforePackageStart?.(n),await ZS(n,e,i,{...t,onDependencyResolved:o}),t.afterPackageEnd?.(n)}))),t.afterPackagesEnd?.(n),await Cx(),{packages:n}}async function ZS(e,t,n=()=>!0,r={}){await YS(e,t,n,r.onDependencyResolved);let{resolved:i}=e,a=i.filter(e=>e.update);return t.write&&a.length&&await Promise.resolve(r.beforePackageWrite?.(e))!==!1&&(await _S(e,t),r.afterPackageWrite?.(e)),e}function QS(e){return{ok:!0,value:e}}function $S(e){return{ok:!1,error:e}}const eC=/^[a-z][a-z0-9-]*$/,tC=[`edition-root`,`customer-root`,`single-repo`],nC=Lc([`high`,`normal`,`low`]),rC=Lc(tC),iC=/\S/,aC=Ec({id:U().regex(eC,`范围 id 非法(应为小写字母开头的字母数字连字符)`),kind:rC,remotes:Cc(U().regex(iC,`远程位置非法(不得为空串或纯空白)`)).default([]),tags:Cc(U().regex(iC,`标签非法(不得为空串或纯空白)`)).default([]),priority:nC.default(`normal`),excludes:Cc(U().min(1)).default([]),projectPriorities:Fc(U(),nC).default({})}).check(e=>{e.value.kind===`single-repo`&&(e.value.excludes.length>0&&e.issues.push({code:`custom`,input:e.value,path:[`excludes`],message:`single-repo 范围禁用 excludes(声明的即唯一项目,如需排除请改用 edition-root/customer-root)`}),Object.keys(e.value.projectPriorities).length>0&&e.issues.push({code:`custom`,input:e.value,path:[`projectPriorities`],message:`single-repo 范围禁用 projectPriorities(优先级直接设于 scope 级)`}))}),oC=`scopes`,sC=/^[a-z][a-z0-9-]*\.scope\.ts$/;async function cC(e){let t=l(e,oC);if(!p(t))return $S({code:`SCOPES_DIR_MISSING`,message:`声明域目录缺失:${t}(应为 project-registry 仓根下 ${oC}/,含 *.scope.ts 声明文件)`});let n=_(t).filter(e=>sC.test(e)).sort((e,t)=>e<t?-1:1);if(n.length===0)return $S({code:`SCOPE_REGISTRY_EMPTY`,message:`范围声明域为空:${t}(无 *.scope.ts——范围消失属配置事故,如需清空请显式移除 registryRoot 配置)`});let r=/* @__PURE__ */ new Set,i=[];for(let e of n){let n=l(t,e),a=await import(S(n).href),o=aC.safeParse(a.default);if(!o.success){let e=o.error.issues[0];return $S({code:`SCOPE_DECLARATION_INVALID`,message:`范围声明结构非法:${n}(${e?.path.join(`.`)??``} ${e?.message??``})`})}let s=e.replace(/\.scope\.ts$/,``);if(o.data.id!==s)return $S({code:`SCOPE_ID_MISMATCH`,message:`范围 id 与文件名不一致:${n}(id=${o.data.id},应为 ${s}——命名即身份)`});if(r.has(o.data.id))return $S({code:`SCOPE_ID_CONFLICT`,message:`范围 id 重复:${o.data.id}(声明域内同 id 即同范围,不得重复声明)`});r.add(o.data.id),i.push(o.data)}return QS(i)}const lC=`LZI_PROJECT_REGISTRY_ROOT`,uC=`LZI_PROJECT_MARKDOWN_REGISTRY_ROOT`,dC=`LZI_PROJECT_SCOPE_ROOTS`,fC=`LZI_PROJECT_MARKDOWN_SCOPE_ROOTS`,pC=/^[a-z][a-z0-9-]*=\/\S+$/;function mC(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e!==``)}function hC(e){let t=/* @__PURE__ */ new Map;for(let n of mC(e)){if(!pC.test(n))return $S({message:`范围根映射段非法:${n}(应为 id=绝对路径 形态,id 为小写字母开头的字母数字连字符)`});let e=n.indexOf(`=`),r=n.slice(0,e),i=d(n.slice(e+1));if(t.has(r))return $S({message:`范围根映射 id 重复:${r}(同一范围不得重复映射)`});t.set(r,i)}return QS(t)}function gC(e,t,n,r){return e!==void 0&&t!==void 0&&e.trim()!==t.trim()?$S({code:`ACQUISITION_ENV_INVALID`,message:`环境变量双名冲突:${n} 与 ${r} 同时在场且值不一致(请统一使用新名 ${n})`,variables:[n,r]}):QS({value:e??t,variables:e===void 0?t===void 0?[]:[r]:[n]})}function _C(e=process.env){let t=gC(e[lC],e[uC],lC,uC);if(!t.ok)return $S(t.error);let n=gC(e[dC],e[fC],dC,fC);if(!n.ok)return $S(n.error);let r;if(n.value.value!==void 0){let e=hC(n.value.value);if(!e.ok)return $S({code:`ACQUISITION_ENV_INVALID`,message:e.error.message,variables:[...n.value.variables]});r=e.value}return QS({registryRoot:t.value.value===void 0?void 0:d(t.value.value.trim()),scopeRoots:r})}const vC=/^[A-Za-z0-9_][A-Za-z0-9._-]*$/;function yC(e,t){return e.name<t.name?-1:+(e.name>t.name)}function bC(e){return p(l(e,`.git`))}function xC(e,t){return t.get(e.id)}function SC(e,t,n,r){if(n.has(e.id))return $S({code:`SCOPE_ID_CONFLICT`,message:`范围 id 冲突:${e.id}(声明域内不得重复)`});n.add(e.id);let i=xC(e,t);return i===void 0?$S({code:`SCOPE_ROOT_UNMAPPED`,message:`范围根未映射:${e.id}(声明零本地路径,请在 .env 的 LZI_PROJECT_SCOPE_ROOTS 或 LZI_PROJECT_MARKDOWN_SCOPE_ROOTS 补 id=绝对路径 映射)`}):p(i)?QS({def:e,root:i,sourceId:r}):$S({code:`DIR_NOT_FOUND`,message:`范围根不存在:${i}(范围 ${e.id} 机内映射目标)`})}function CC(e,t){let n=[],r=[];for(let i of[..._(e.root,{withFileTypes:!0})].sort(yC)){if(i.name.startsWith(`.`))continue;if(!i.isDirectory()){r.push({scope:e.def.id,entry:i.name,reason:`ROOT_FILE`});continue}if(e.def.excludes.includes(i.name)){r.push({scope:e.def.id,entry:i.name,reason:`EXCLUDED`});continue}let a=l(e.root,i.name);t!==void 0&&d(a)===d(t)?r.push({scope:e.def.id,entry:i.name,reason:`EXCLUDED_PATH`}):!bC(a)||!vC.test(i.name)?r.push({scope:e.def.id,entry:i.name,reason:`NOT_A_REPO`}):n.push({scope:e.def.id,scopeKind:e.def.kind,priority:e.def.projectPriorities[i.name]??e.def.priority,sourceId:e.sourceId,project:i.name,path:a})}return{scope:e.def.id,scopeKind:e.def.kind,priority:e.def.priority,scopeRoot:e.root,sourceId:e.sourceId,projects:n,skipped:r}}function wC(e,t){let n=o(e.root);return t!==void 0&&d(e.root)===d(t)||!bC(e.root)||!vC.test(n)?$S({code:`SCOPE_ROOT_INVALID`,message:`single-repo 范围根非法:${e.root}(应为含 .git 的合规项目目录,且不得为排除路径)`}):QS({scope:e.def.id,scopeKind:`single-repo`,priority:e.def.priority,scopeRoot:e.root,sourceId:e.sourceId,projects:[{scope:e.def.id,scopeKind:`single-repo`,priority:e.def.priority,sourceId:e.sourceId,project:n,path:e.root}]})}function TC(e,t,n){let r=[],i=[],a=/* @__PURE__ */ new Set,o=/* @__PURE__ */ new Map;for(let s of e){let e=SC(s,n.scopeRoots,a,n.sourceId);if(!e.ok)return $S(e.error);let c,l=[];if(s.kind===`single-repo`){let n=wC(e.value,t);if(!n.ok)return $S(n.error);c=n.value}else{let n=CC(e.value,t);c=n,l=n.skipped}for(let e of c.projects){let t=o.get(e.project);if(t!==void 0)return $S({code:`PROJECT_NAME_CONFLICT`,message:`项目名跨范围冲突:${e.project}(${t} 与 ${e.scope} 均含此名;归档平铺要求项目名全局唯一,可在后登记范围的 excludes 中显式排除)`});o.set(e.project,e.scope)}r.push(c),i.push(...l)}return r.sort((e,t)=>e.scope<t.scope?-1:+(e.scope>t.scope)),i.sort((e,t)=>e.scope===t.scope?e.entry<t.entry?-1:+(e.entry>t.entry):e.scope<t.scope?-1:1),QS({scopes:r,skipped:i})}const EC=b(i);function DC(e){return typeof e==`object`&&!!e&&`stderr`in e}async function OC(e,t){try{let{stdout:n}=await EC(`git`,[`-C`,e,...t],{encoding:`utf8`});return{ok:!0,stdout:n.trim()}}catch(e){let t=DC(e)?e.stderr:void 0;return{ok:!1,stderr:typeof t==`string`?t:String(e)}}}function kC(e){return typeof e==`object`&&!!e}function AC(e){let t=l(e,`package.json`);if(!p(t))return{packageName:null,description:null};let n;try{n=JSON.parse(g(t,`utf8`))}catch{return{packageName:null,description:null}}if(!kC(n))return{packageName:null,description:null};let r=n.name,i=n.description;return{packageName:typeof r==`string`&&r!==``?r:null,description:typeof i==`string`&&i!==``?i:null}}async function jC(e){let t=await OC(e.path,[`rev-parse`,`--git-dir`]);if(!t.ok)return $S({code:`INSPECT_FAILED`,scope:e.scope,project:e.project,message:`仓库健康探测失败:${e.path}(${t.stderr})`});let n=await OC(e.path,[`remote`,`get-url`,`origin`]),r=n.ok&&n.stdout!==``?n.stdout:null,i=AC(e.path);return QS({scope:e.scope,scopeKind:e.scopeKind,priority:e.priority,sourceId:e.sourceId,project:e.project,projectPath:e.path,remoteUrl:r,packageName:i.packageName,description:i.description})}async function MC(e,t,n){let r=Math.max(1,Math.floor(t)),i=[],a=0;for(;a<e.length;){let t=e.slice(a,a+r),o=await Promise.all(t.map((e,t)=>n(e,a+t)));i.push(...o),a+=r}return i}async function NC(e={}){let t=_C(e.processEnv??process.env);if(!t.ok)return $S(t.error);let n=e.registryRoot??t.value.registryRoot;if(n===void 0)return $S({code:`ACQUISITION_ENV_INVALID`,message:`未定位 registry 仓根(请在 .env 配置 LZI_PROJECT_REGISTRY_ROOT 或显式传入 registryRoot)`});let r=await cC(n);if(!r.ok)return $S(r.error);let i=e.scopeRoots??t.value.scopeRoots??/* @__PURE__ */ new Map,a=e.scopeIds===void 0?void 0:new Set(e.scopeIds),o=a===void 0?[]:[...a].filter(e=>!r.value.some(t=>t.id===e));if(o.length>0)return $S({code:`SCOPE_SELECTOR_UNKNOWN`,message:`圈定的范围 id 不在声明域:${o.join(`、`)}(合法范围 id:${r.value.map(e=>e.id).join(`、`)})`});let s=r.value,c=[];if(a!==void 0){s=r.value.filter(e=>a.has(e.id));let e=s.filter(e=>!i.has(e.id)).map(e=>e.id);if(e.length>0)return $S({code:`SCOPE_ROOT_UNMAPPED`,message:`范围根未映射:${e.join(`、`)}(声明零本地路径,请在 .env 的 LZI_PROJECT_SCOPE_ROOTS 补 id=绝对路径 映射)`})}else if(s=r.value.filter(e=>i.has(e.id)),c=r.value.filter(e=>!i.has(e.id)).map(e=>e.id),s.length===0)return $S({code:`SCOPE_ROOT_UNMAPPED`,message:`范围根未映射:${r.value.map(e=>e.id).join(`、`)}(本机未配置任何范围根映射,请在 .env 的 LZI_PROJECT_SCOPE_ROOTS 补 id=绝对路径 映射)`});let l=TC(s,e.excludePath,{scopeRoots:i,sourceId:`scope-declarations`});if(!l.ok)return $S(l.error);let u=l.value.scopes.flatMap(e=>[...e.projects]),d=[],f=/* @__PURE__ */ new Map;if(e.inspect===!0){let e=await MC(u,16,async e=>jC(e));for(let t of e)t.ok?f.set(t.value.project,t.value):d.push({scope:t.error.scope,project:t.error.project,message:t.error.message})}let p=u.map(e=>{let t=f.get(e.project);return{scope:e.scope,scopeKind:e.scopeKind,priority:e.priority,sourceId:e.sourceId,project:e.project,path:e.path,remoteUrl:t?.remoteUrl??null,packageName:t?.packageName??null,description:t?.description??null}});return QS({registryRoot:n,scopes:l.value.scopes,projects:p,skipped:l.value.skipped,unmappedScopes:c,inspectFailures:d,inspected:e.inspect===!0})}const PC={RED:`\x1B[0;31m`,GREEN:`\x1B[0;32m`,YELLOW:`\x1B[1;33m`,BLUE:`\x1B[0;34m`,RESET:`\x1B[0m`};function FC(e){return e.map(e=>{if(typeof e==`string`)return e;if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}).join(` `)}function $(...e){process.stdout.write(`${FC(e)}\n`)}function IC(...e){process.stderr.write(`${FC(e)}\n`)}const LC=async()=>{let e=await cm();return e?(e.source===`legacy-dev-tools`&&$(`提示: 经 lzi-dev.config.ts 共享读取依赖工具配置,建议补建 lzi-dependencies.config.ts`),e.config):($(`提示: 未找到配置文件 lzi-dependencies.config.ts,使用默认配置`),{})},RC=[`**/node_modules/**`,`**/oh_modules/**`,`**/target/**`,`**/dist/**`,`**/build/**`,`**/.turbo/**`],zC=e=>!e||e.length===0?RC:[...RC,...e],BC=[`-contract`,`-implementation`,`-infrastructure`,`-main`,`-domain`],VC=[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`],HC=[`api`,`contract`,`implementation`,`infrastructure`,`main`,`ui`,`testing`],UC=Tc({name:U().optional(),dependencies:Fc(U(),yc()).optional(),devDependencies:Fc(U(),yc()).optional(),peerDependencies:Fc(U(),yc()).optional(),optionalDependencies:Fc(U(),yc()).optional()}),WC=(e,t)=>t.includes(`/domains/`)?!0:BC.some(t=>e.endsWith(t)),GC=async()=>{let e=process.cwd();$(`正在扫描 ${e} 的分层边界...`);let t=await LC(),n=zC(t.boundary?.ignorePaths),r=new Set(t.boundary?.allowlist??[]),i=await KC(e,n,r)+qC(e,r);i===0?$(`分层边界检查通过,packages 层无领域契约依赖且领域目录层名合规`):(IC(`共 ${i} 处分层边界违例,处置口径见 Packages 与 Domains 边界指南 BOUNDARY-001,豁免须经特别申请登记于 lzi-dependencies.config.ts 的 boundary.allowlist`),process.exit(Math.min(i,255)))},KC=async(e,t,n)=>{$(`
319
- --- 依赖方向 ---`);let r=await zp(`packages/**/package.json`,{cwd:e,ignore:t,onlyFiles:!0,dot:!1}),i=0,a=0;for(let t of r){let r=null;try{let n=UC.safeParse(await Bun.file(l(e,t)).json());r=n.success?n.data:null}catch{r=null}if(r!==null){i+=1;for(let e of VC){let i=r[e];if(i!==void 0)for(let[o,s]of Object.entries(i)){let i=typeof s==`string`?s:`非字符串取值`;WC(o,i)&&!n.has(o)&&(a+=1,$(` ${r.name??t} ${t}`),$(` ${e} ${o} ${i}`))}}}}return $(`扫描到 ${i} 个 packages 层清单,登记豁免条目 ${n.size} 项`),a===0?($(`packages 层清单未依赖 domains 层领域契约包`),0):($(`共 ${a} 处 packages 层依赖领域契约包`),a)},qC=(e,t)=>{$(`
320
- --- 领域目录形态 ---`);let n=l(e,`domains`);if(!p(n))return $(`未发现 domains 目录,本段跳过`),0;let r=0,i=0;for(let e of _(n,{withFileTypes:!0})){if(!e.isDirectory())continue;r+=1;let a=_(l(n,e.name),{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name);for(let n of a){if(HC.includes(n))continue;let r=`${e.name}/${n}`;t.has(r)||(i+=1,$(` ${e.name} ${r}`))}}return $(`扫描到 ${r} 个领域目录`),i===0?($(`全部领域目录层名合规`),0):($(`共 ${i} 处领域目录层名不合规`),i)},JC=[`electron`,`electron-vite`],YC=`@longzai-intelligence-electron/cli`,XC=[`lzi-electron`,`electron-vite`],ZC=[`electron-vite`],QC=(e,t)=>{if(t.endsWith(`/*`)){let n=t.slice(0,-1);return e.startsWith(n)}return e===t},$C=(e,t)=>{let n=[];for(let[r,i]of Object.entries(e)){if(t.has(r))continue;let e=JC.find(e=>QC(r,e));e!==void 0&&n.push({dependency:r,rootRange:i,pattern:e})}return n},ew=(e,t)=>{let n=[];for(let[r,i]of Object.entries(t??{}))for(let t of XC)i.includes(t)&&n.push({relPath:e,detail:`脚本 ${r} 含 ${t}`});return n},tw=e=>{let t=e??{};return ZC.some(e=>t[e]!==void 0)},nw=e=>(e??{})[YC]!==void 0,rw=Tc({name:U().optional(),workspaces:yc().optional(),scripts:Fc(U(),U()).optional(),devDependencies:Fc(U(),U()).optional()}),iw=async()=>{let e=process.cwd();$(`正在扫描 ${e} 下的 package.json 文件...`);let t=null;try{let n=rw.safeParse(await Bun.file(`${e}/package.json`).json());t=n.success?n.data:null}catch{t=null}t===null&&($(`未找到可解析的 workspace 根 package.json,请在仓库根目录执行本命令`),process.exit(1));let n=await LC(),r=zC(n.hoisting?.ignorePaths),i=new Set(n.hoisting?.allowlist??[]),a=new Set(n.hoisting?.rootAllowlist??[]),o=t.devDependencies??{},s=await zp(`**/package.json`,{cwd:e,ignore:r,onlyFiles:!0,dot:!1}),c=0,l=[],d=[...ew(`package.json`,t.scripts),...tw(t.devDependencies)?[{relPath:`package.json`,detail:`开发依赖 electron-vite`}]:[]],f=nw(t.devDependencies);for(let t of s){if(t===`package.json`)continue;let n=null;try{let r=rw.safeParse(await Bun.file(`${e}/${t}`).json());n=r.success?r.data:null}catch{n=null}if(n===null||n.workspaces!==void 0)continue;let r=n.devDependencies??{};if(d.push(...ew(t,n.scripts)),tw(r)&&d.push({relPath:t,detail:`开发依赖 electron-vite`}),nw(r)&&(f=!0),Object.keys(r).length!==0){c+=1;for(let[a,s]of Object.entries(r)){let r=o[a];r===void 0||i.has(a)||l.push({packageName:n.name??t,relPath:u(e,`${e}/${t}`),dependency:a,subRange:s,rootRange:r,drifted:s!==r})}}}$(`找到 ${c} 个子包,根声明开发依赖 ${Object.keys(o).length} 项`);let p=l.length;if(p===0)$(`所有子包均未重复声明根已有的开发依赖`);else{$(`
321
- 以下子包重复声明根已有的开发依赖:`);for(let e of l){let t=e.drifted?` 版本漂移`:``;$(` ${e.packageName} ${e.relPath}`),$(` ${e.dependency} 子声明 ${e.subRange} 根声明 ${e.rootRange}${t}`)}$(`共 ${p} 处重复声明,处置口径见 ADR 0036`)}let m=$C(o,a);if(m.length>0){$(`
322
- 以下 workspace 根声明了技术栈专属依赖,判定口径 ADR 0036 第 3 节:`);for(let e of m)$(` ${e.dependency} 根声明 ${e.rootRange} 命中禁入模式 ${e.pattern}`);$(`共 ${m.length} 处根禁入声明,处置口径:迁移至栈子包 devDependencies 或径直移除`)}let h=d.length>0&&!f;if(h){$(`\n仓内存在 electron 构建面痕迹但全仓未声明 ${YC}:`);for(let e of d)$(` ${e.relPath} ${e.detail}`);$(`处置口径:在 workspace 根 devDependencies 声明 ${YC}`)}p+m.length+ +!!h!==0&&($(`\n归位汇总: 重复声明 ${p} 处,根禁入 ${m.length} 处,栈引擎缺失 ${+!!h} 项`),process.exit(1))},aw=Tc({name:U().optional(),overrides:Fc(U(),yc()).optional(),pnpm:Tc({overrides:Fc(U(),yc()).optional()}).optional(),resolutions:Fc(U(),yc()).optional()}),ow=e=>typeof e==`string`?e:`嵌套对象`,sw=async()=>{let e=process.cwd();$(`正在扫描 ${e} 下的 package.json 文件...`);let t=null;try{let n=aw.safeParse(await Bun.file(`${e}/package.json`).json());t=n.success?n.data:null}catch{t=null}t===null&&($(`未找到可解析的仓库根 package.json,请在仓库根目录执行本命令`),process.exit(1));let n=await LC(),r=zC(n.overrides?.ignorePaths),i=new Set(n.overrides?.allowlist??[]),a=await zp(`**/package.json`,{cwd:e,ignore:r,onlyFiles:!0,dot:!1}),o=0,s=[];for(let t of a){let n=null;try{let r=aw.safeParse(await Bun.file(`${e}/${t}`).json());n=r.success?r.data:null}catch{n=null}if(n===null)continue;o+=1;let r=[[`overrides`,n.overrides??{}],[`pnpm.overrides`,n.pnpm?.overrides??{}],[`resolutions`,n.resolutions??{}]];for(let[a,o]of r)for(let[r,c]of Object.entries(o))i.has(r)||s.push({packageName:n.name??t,relPath:u(e,`${e}/${t}`),field:a,entry:r,value:ow(c)})}if($(`扫描到 ${o} 个清单,登记豁免条目 ${i.size} 项`),s.length===0)$(`全部清单均未声明未豁免的 overrides 族强制版本字段`);else{$(`
323
- 以下清单声明了未豁免的 overrides 族强制版本字段:`);for(let e of s)$(` ${e.packageName} ${e.relPath}`),$(` ${e.field} ${e.entry} ${e.value}`);$(`共 ${s.length} 处强制版本条目,处置口径见 ADR 0153,豁免须经特别申请登记于 lzi-dependencies.config.ts 的 overrides.allowlist`),process.exit(1)}},cw=(e,t)=>{let n=e.filter(e=>e.relativePath.startsWith(`apps/`));if(n.length===0)return{inScope:!1,violations:[]};let r=[];for(let e of n){let n=e.name??e.relativePath;if(t.has(n))continue;let i=Object.keys(e.exports??{}).filter(e=>e!==`.`);i.length!==0&&r.push({packageName:n,relPath:e.relativePath,extraExits:i})}return{inScope:!0,violations:r}},lw=/* @__PURE__ */ new Set(/* @__PURE__ */ `@longzai-intelligence-agent-tools/cli.@longzai-intelligence-agent-tools/config.@longzai-intelligence-api/cli.@longzai-intelligence-api/config.@longzai-intelligence-api/core.@longzai-intelligence-builder/cli.@longzai-intelligence-builder/config.@longzai-intelligence-builder/core.@longzai-intelligence-builder/dual.@longzai-intelligence-builder/esm.@longzai-intelligence-builder/utils.@longzai-intelligence-bun/cli.@longzai-intelligence-bun/config.@longzai-intelligence-bun/presets.@longzai-intelligence-changelog/cli.@longzai-intelligence-changelog/config.@longzai-intelligence-decision/cli.@longzai-intelligence-decision/config.@longzai-intelligence-debts/cli.@longzai-intelligence-debts/config.@longzai-intelligence-dependencies/cli.@longzai-intelligence-dependencies/config.@longzai-intelligence-dev-tools/cli.@longzai-intelligence-dev-tools/config.@longzai-intelligence-dev-tools/vite-plugin.@longzai-intelligence-env/cli.@longzai-intelligence-env/config.@longzai-intelligence-env/core.@longzai-intelligence-features/cli.@longzai-intelligence-features/config.@longzai-intelligence-features/ledger.@longzai-intelligence-globals/cli.@longzai-intelligence-git/cli.@longzai-intelligence-git/config.@longzai-intelligence-issues/cli.@longzai-intelligence-issues/config.@longzai-intelligence-ledger/cli.@longzai-intelligence-ledger/config.@longzai-intelligence-ledger/core.@longzai-intelligence-markdown/cli.@longzai-intelligence-markdown/config.@longzai-intelligence-oxfmt/config.@longzai-intelligence-oxlint/architecture-core-plugin.@longzai-intelligence-oxlint/architecture-domain-plugin.@longzai-intelligence-oxlint/architecture-electron-plugin.@longzai-intelligence-oxlint/architecture-library-plugin.@longzai-intelligence-oxlint/architecture-plugin.@longzai-intelligence-oxlint/cli.@longzai-intelligence-oxlint/code-style-plugin.@longzai-intelligence-oxlint/composer-plugin.@longzai-intelligence-oxlint/core.@longzai-intelligence-oxlint/design-rules-plugin.@longzai-intelligence-oxlint/elysia-route-plugin.@longzai-intelligence-oxlint/eslint-config-plugin.@longzai-intelligence-oxlint/file-naming-plugin.@longzai-intelligence-oxlint/lzi-builder-config-plugin.@longzai-intelligence-oxlint/lzi-config-plugin.@longzai-intelligence-oxlint/nestjs-route-plugin.@longzai-intelligence-oxlint/oxlint-config.@longzai-intelligence-oxlint/package-json-plugin.@longzai-intelligence-oxlint/perfectionist-plugin.@longzai-intelligence-oxlint/presets.@longzai-intelligence-oxlint/react-plugin.@longzai-intelligence-oxlint/schema-type-separation-plugin.@longzai-intelligence-oxlint/stylistic-plugin.@longzai-intelligence-oxlint/testing.@longzai-intelligence-oxlint/tsconfig-plugin.@longzai-intelligence-oxlint/tsdoc-plugin.@longzai-intelligence-oxlint/tsdown-config-plugin.@longzai-intelligence-oxlint/tsup-config-plugin.@longzai-intelligence-oxlint/typeorm-plugin.@longzai-intelligence-oxlint/typescript-eslint-plugin.@longzai-intelligence-oxlint/utils.@longzai-intelligence-oxlint/vitest-config-plugin.@longzai-intelligence-oxlint/zod-plugin.@longzai-intelligence-release/cli.@longzai-intelligence-release/config.@longzai-intelligence-screenshots/cli.@longzai-intelligence-screenshots/config.@longzai-intelligence-screenshots/ledger.@longzai-intelligence-shared-config/core.@longzai-intelligence-standards/cli.@longzai-intelligence-standards/config.@longzai-intelligence-taro/cli.@longzai-intelligence-tsconfig/cli.@longzai-intelligence-tsconfig/config.@longzai-intelligence-tsconfig/core.@longzai-intelligence-tsgo/cli.@longzai-intelligence-typescript/bun-config.@longzai-intelligence-version/cli.@longzai-intelligence-version/config.@longzai-intelligence-vitest/config.@longzai-intelligence-vscode/cli.@longzai-intelligence-vscode/config.@longzai-intelligence-assignments/cli.@longzai-intelligence-assignments/config.@longzai-intelligence-changeset/core.@longzai-intelligence-cli/cli.@longzai-intelligence-cli/core.@longzai-intelligence-cli/standard.@longzai-intelligence-config/cli.@longzai-intelligence-config/core.@longzai-intelligence-config/registry.@longzai-intelligence-deploy/cli.@longzai-intelligence-deploy/config.@longzai-intelligence-dimensions/cli.@longzai-intelligence-dimensions/config.@longzai-intelligence-dimensions/core.@longzai-intelligence-docs/cli.@longzai-intelligence-docs/compile-plugin.@longzai-intelligence-docs/config.@longzai-intelligence-docs/core.@longzai-intelligence-docs/eslint-plugin-markdown-links.@longzai-intelligence-docs/numbering-plugin.@longzai-intelligence-electron/cli.@longzai-intelligence-electron/config.@longzai-intelligence-evaluations/config.@longzai-intelligence-findings/cli.@longzai-intelligence-findings/config.@longzai-intelligence-findings/ledger.@longzai-intelligence-git-commit/cli.@longzai-intelligence-git-commit/config.@longzai-intelligence-git-swarm/cli.@longzai-intelligence-git-swarm/config.@longzai-intelligence-lint/cli.@longzai-intelligence-mechanisms/cli.@longzai-intelligence-mechanisms/config.@longzai-intelligence-mechanisms/core.@longzai-intelligence-npm-registry/cli.@longzai-intelligence-npm-registry/config.@longzai-intelligence-pitfalls/cli.@longzai-intelligence-pitfalls/config.@longzai-intelligence-pitfalls/ledger.@longzai-intelligence-plans/cli.@longzai-intelligence-plans/config.@longzai-intelligence-port/cli.@longzai-intelligence-port/core.@longzai-intelligence-port/registry.@longzai-intelligence-prettier/config.@longzai-intelligence-prettier/markdown-plugin.@longzai-intelligence-progress-board/cli.@longzai-intelligence-progress-board/config.@longzai-intelligence-project-registry/core.@longzai-intelligence-readme/cli.@longzai-intelligence-readme/config.@longzai-intelligence-readme/core.@longzai-intelligence-records/cli.@longzai-intelligence-records/config.@longzai-intelligence-records/ledger.@longzai-intelligence-reflections/cli.@longzai-intelligence-reflections/config.@longzai-intelligence-reflections/ledger.@longzai-intelligence-remote-machine/config.@longzai-intelligence-report-markdown/cli.@longzai-intelligence-report-markdown/config.@longzai-intelligence-runtime-registry/cli.@longzai-intelligence-runtime/cli.@longzai-intelligence-runtime/config.@longzai-intelligence-scripts/cli.@longzai-intelligence-scripts/config.@longzai-intelligence-scripts/core.@longzai-intelligence-specs/cli.@longzai-intelligence-specs/config.@longzai-intelligence-specs/ledger.@longzai-intelligence-stories/cli.@longzai-intelligence-stories/config.@longzai-intelligence-testing/cli.@longzai-intelligence-testing/config.@longzai-intelligence-testing/registry.@longzai-intelligence-typecheck/cli.@longzai-intelligence-typecheck/presets.@longzai-intelligence-toolchain/cli.@longzai-intelligence-toolchain/config.@longzai-intelligence-tsdoc/cli.@longzai-intelligence-tsdoc/config.@longzai-intelligence-vite/cli.@longzai-intelligence-wifi/cli.@longzai-intelligence-wifi/config.@longzai-intelligence-growth/cli.@longzai-intelligence-growth/config.@longzai-intelligence-growth/core.@longzai-intelligence-inbox/cli.@longzai-intelligence-inbox/config.@longzai-intelligence-inbox/core.@longzai-intelligence-kol/cli.@longzai-intelligence-kol/config.@longzai-intelligence-kol/core.@longzai-intelligence-one-digest/cli.@longzai-intelligence-one-digest/config.@longzai-intelligence-one-digest/core.@longzai-intelligence-closed-loop-markdown/cli.@longzai-intelligence-closed-loop-markdown/config.@longzai-intelligence-code-report/config.@longzai-intelligence-competition-registry/registry.@longzai-intelligence-crossref-markdown/cli.@longzai-intelligence-crossref-markdown/config.@longzai-intelligence-disk-space-markdown/config.@longzai-intelligence-github-trending-markdown/cli.@longzai-intelligence-github-trending-markdown/config.@longzai-intelligence-input-markdown/cli.@longzai-intelligence-input-markdown/config.@longzai-intelligence-journals-markdown/cli.@longzai-intelligence-journals-markdown/config.@longzai-intelligence-journals/config.@longzai-intelligence-knowledge-markdown/cli.@longzai-intelligence-knowledge-markdown/config.@longzai-intelligence-kol-markdown/cli.@longzai-intelligence-kol-markdown/config.@longzai-intelligence-music-video/config.@longzai-intelligence-nation/config.@longzai-intelligence-okr-markdown/config.@longzai-intelligence-open-router-markdown/cli.@longzai-intelligence-open-router-markdown/config.@longzai-intelligence-paper-report/cli.@longzai-intelligence-paper-report/config.@longzai-intelligence-philosophy-markdown/config.@longzai-intelligence-project-markdown/config.@longzai-intelligence-roadmap-markdown/config.@longzai-intelligence-rss-markdown/cli.@longzai-intelligence-rss-markdown/config.@longzai-intelligence-schedule-markdown/config.@longzai-intelligence-task-markdown/config.@longzai-intelligence-workflow-markdown/config.@longzai-intelligence-bilibili-markdown-private/cli.@longzai-intelligence-bilibili-markdown-private/config.@longzai-intelligence-douyin-markdown-private/cli.@longzai-intelligence-douyin-markdown-private/config.@longzai-intelligence-law-markdown-private/cli.@longzai-intelligence-law-markdown-private/config.@longzai-intelligence-release-workflow-private/publish-repository-plugin.@longzai-intelligence-release-workflow-private/workflow-repository-plugin.@longzai-intelligence-research-report-markdown-private/cli.@longzai-intelligence-research-report-markdown-private/config.@longzai-intelligence-research-report-private/core.@longzai-intelligence-runtime-registry-private/data.@longzai-intelligence-strategy-consulting-markdown-private/cli.@longzai-intelligence-strategy-consulting-markdown-private/config.@longzai-intelligence-twitter-markdown-private/cli.@longzai-intelligence-twitter-markdown-private/config.@longzai-intelligence-xiaohongshu-markdown-private/cli.@longzai-intelligence-xiaohongshu-markdown-private/config.@longzai-intelligence-youtube-markdown-private/cli.@longzai-intelligence-youtube-markdown-private/config.@longzai-intelligence-youtube-private/config.@longzai-intelligence-zhihu-markdown-private/config`.split(`.`)),uw=[`dependencies`,`devDependencies`],dw=(e,t)=>{if(e.workspaces===void 0)return{inScope:!1,violations:[]};let n=[];for(let r of uw){let i=e[r]??{};for(let[e]of Object.entries(i))e.startsWith(`@longzai-intelligence-`)&&!t.has(e)&&(lw.has(e)||n.push({dependency:e,field:r}))}return{inScope:!0,violations:n}},fw=[`dependencies`,`devDependencies`],pw=e=>e.startsWith(`@longzai-intelligence`)&&e.includes(`/`),mw=e=>e.slice(0,e.lastIndexOf(`/`)),hw=(e,t)=>{let n=[];for(let r of e){let e=/* @__PURE__ */ new Map;for(let n of fw){let i=r[n]??{};for(let[r,a]of Object.entries(i)){if(!pw(r)||a.startsWith(`workspace:`))continue;let i=mw(r);if(t.has(i))continue;let o=e.get(i)??[];o.push({dependency:r,field:n,specifier:a}),e.set(i,o)}}for(let[t,i]of e)new Set(i.map(e=>e.specifier)).size<=1||n.push({manifest:r.relativePath,scope:t,members:i})}return n},gw=[`dependencies`,`devDependencies`],_w=e=>typeof e==`string`&&e.length>0,vw=e=>{if(typeof e!=`object`||!e)return;let t=Reflect.get(e,`packages`);return Array.isArray(t)?t:void 0},yw=e=>{if(Array.isArray(e))return e.filter(_w);let t=vw(e);return t===void 0?null:t.filter(_w)},bw=(e,t)=>{let n=[];for(let r of e)for(let e of gw){let i=r[e]??{};for(let[a,o]of Object.entries(i))t.has(a)&&!o.startsWith(`workspace:`)&&n.push({manifest:r.relativePath,dependency:a,field:e,currentVersion:o})}return n},xw=async(e,t,n=process.cwd())=>{let r=[...new Set(e.map(e=>`${e}/package.json`))],i=[...new Set(await zp(r,{cwd:n,ignore:[`**/node_modules/**`],onlyFiles:!0,dot:!1}))],a=[];for(let e of i){let r=null;try{let i=t.safeParse(await Bun.file(`${n}/${e}`).json());r=i.success?i.data:null}catch{r=null}r!==null&&a.push({relativePath:e,...r})}return a},Sw=Tc({workspaces:yc().optional()}),Cw=Tc({name:U().optional()}),ww=async e=>{let t=null;try{let n=Sw.safeParse(await Bun.file(`${e}/package.json`).json());if(!n.success)return/* @__PURE__ */ new Set;t=n.data}catch{return/* @__PURE__ */ new Set}let n=yw(t?.workspaces);if(n===null||n.length===0)return/* @__PURE__ */ new Set;let r=await xw(n,Cw,e);return new Set(r.map(e=>e.name).filter(e=>typeof e==`string`))},Tw=`@longzai-intelligence`,Ew=Tc({workspaces:yc().optional(),dependencies:Fc(U(),U()).optional(),devDependencies:Fc(U(),U()).optional()}),Dw=Tc({name:U().optional(),dependencies:Fc(U(),U()).optional(),devDependencies:Fc(U(),U()).optional()}),Ow=Tc({name:U().optional(),exports:Fc(U(),yc()).optional()}),kw=Tc({dependencies:Fc(U(),U()).optional(),devDependencies:Fc(U(),U()).optional()}),Aw=async()=>{let e=await jw(),t=await Nw(),n=await Pw(),r=await Iw(),i=process.env.npm_config_registry;process.env.npm_config_registry=`https://registry.npmjs.org/`;let a;try{a=await Rw(void 0)}finally{i===void 0?delete process.env.npm_config_registry:process.env.npm_config_registry=i}let o=zw(a);$(`
324
- --- 检查结果 ---`);let s=0;if(s+=Bw(a,new Set(o),!1),o.length>0){$(`\n回退基线:${o.length} 个内部包在 npm 无记录,按本机 registry 配置复查`);let e=await Rw(o);s+=Bw(e,new Set(o),!0)}s===0?$(`全部 Longzai Intelligence 包依赖均为最新版`):IC(`\n共 ${s} 个内部包依赖非最新版,修复指引: 在仓根执行 lzi-dependencies upgrade --write 或 bun run version:upgrade`);let c=e+t+n+r+s;c!==0&&process.exit(Math.min(c,255))},jw=async()=>{let e=null;try{let t=Ew.safeParse(await Bun.file(`${process.cwd()}/package.json`).json());e=t.success?t.data:null}catch{e=null}if(e===null)return 0;let t=dw(e,await Mw());if(!t.inScope)return 0;if($(`
325
- --- 根清单依赖准入 ---`),t.violations.length===0)return $(`工作区根清单未发现业务依赖`),0;for(let e of t.violations)$(` ${e.dependency} ${e.field}`);return $(`共 ${t.violations.length} 处业务依赖出现在工作区根清单,业务依赖应下沉到实际使用的子包,处置口径见 ADR 0182`),t.violations.length},Mw=async()=>{let e=await LC();return new Set(e.rootManifest?.allowlist??[])},Nw=async()=>{let e=null;try{let t=Ew.safeParse(await Bun.file(`${process.cwd()}/package.json`).json());e=t.success?t.data:null}catch{e=null}if(e===null)return 0;let t=yw(e.workspaces);if(t===null||t.length===0)return 0;let n=await xw(t,Dw),r=new Set(n.map(e=>e.name).filter(e=>typeof e==`string`));if(r.size===0)return 0;$(`
326
- --- 自仓引用协议 ---`);let i={relativePath:`package.json`,dependencies:e.dependencies,devDependencies:e.devDependencies},a=bw([i,...n],r);if(a.length===0)return $(`全部自仓引用均使用 workspace 协议`),0;for(let e of a)$(` ${e.manifest} ${e.dependency} ${e.field} ${e.currentVersion}`);return $(`共 ${a.length} 处自仓引用未使用 workspace 协议,修复指引:将引用值恢复为 workspace:* 后执行 bun install`),a.length},Pw=async()=>{let e=null;try{let t=Ew.safeParse(await Bun.file(`${process.cwd()}/package.json`).json());e=t.success?t.data:null}catch{e=null}if(e===null)return 0;let t=yw(e.workspaces);if(t===null||t.length===0)return 0;let n=await xw(t,Ow),r=cw(n,await Fw());if(!r.inScope)return 0;if($(`
327
- --- 应用包出口形态 ---`),r.violations.length===0)return $(`apps 层应用包 exports 形态全部合规`),0;for(let e of r.violations)$(` ${e.relPath} ${e.extraExits.join(` `)}`);return $(`共 ${r.violations.length} 个 apps 层应用包存在多出口 exports,应用包 exports 只允许无或单一根出口,跨应用复用一律经根出口取件,处置口径见 ADR 0198`),r.violations.length},Fw=async()=>{let e=await LC();return new Set(e.appExports?.allowlist??[])},Iw=async()=>{let e=null;try{let t=Ew.safeParse(await Bun.file(`${process.cwd()}/package.json`).json());e=t.success?t.data:null}catch{e=null}if(e===null)return 0;let t=yw(e.workspaces),n=t===null||t.length===0?[]:await xw(t,kw);$(`
328
- --- 同 scope 版本锁步 ---`);let r={relativePath:`package.json`,dependencies:e.dependencies,devDependencies:e.devDependencies},i=hw([r,...n],await Lw());if(i.length===0)return $(`同 scope 内部分包声明取值全部一致`),0;for(let e of i){$(` ${e.manifest} ${e.scope}`);for(let t of e.members)$(` ${t.dependency} ${t.field} ${t.specifier}`)}return $(`共 ${i.length} 组同 scope 分包声明版本不一致,同 scope 各分包声明取值应完全一致,对齐后执行 bun install,豁免须经特别申请登记于 lzi-dependencies.config.ts 的 lockstep.allowlist`),i.length},Lw=async()=>{let e=await LC();return new Set(e.lockstep?.allowlist??[])},Rw=async e=>{let t=(await LC()).upgrade??{},{packages:n}=await XS({cwd:process.cwd(),mode:`latest`,write:!1,recursive:t.recursive??!0,timeout:t.timeout??3e4,retries:t.retries??3,exclude:t.exclude??[],include:e===void 0?t.include??[]:[...e],depFields:t.depFields,ignorePaths:t.ignorePaths??[],concurrency:t.concurrency??10,force:!1,all:!1,install:!1,update:!1,interactive:!1,group:!0,includeLocked:!1,timediff:!0,nodecompat:!0,loglevel:`silent`,silent:!0,failOnOutdated:!1},{afterPackagesLoaded:e=>{$(`扫描到 ${e.length} 个包,正在校验 Longzai Intelligence 依赖新鲜度...`)}});return n},zw=e=>{let t=/* @__PURE__ */ new Set;for(let n of e)for(let e of n.resolved)e.name.startsWith(Tw)&&e.resolveError!=null&&t.add(e.name);return[...t]},Bw=(e,t,n)=>{let r=0;for(let i of e){let e=i.resolved.filter(e=>!e.update||!e.name.startsWith(Tw)?!1:n?t.has(e.name):!t.has(e.name));if(e.length!==0){r+=e.length,$(`\n${i.name||i.relative}:`);for(let t of e){let e=t.diff??``,r=n?`,回退基线`:``;$(` ${t.name}: ${t.currentVersion} -> ${t.targetVersion} ${e}${r}`)}}}return r};function Vw(e){let t=e;for(;;){if(p(l(t,`longzai-intelligence-globals`))||p(l(t,`lzi-architecture.yaml`)))return t;let e=l(t,`..`);if(e===t)return;t=e}}function Hw(e){return e.filter(e=>p(l(e.path,`package.json`))).map(e=>({name:e.project,dir:e.path}))}async function Uw(e){if(e.projectScope!==void 0){let t=await NC({scopeIds:[e.projectScope]});return t.ok||(IC(`错误: 项目范围解析失败: ${t.error.message}`),IC(`提示: 请确认 .env 配置 LZI_PROJECT_REGISTRY_ROOT 与 LZI_PROJECT_SCOPE_ROOTS`),process.exit(1)),{registryRoot:t.value.registryRoot,scopeId:e.projectScope,projects:Hw(t.value.projects),source:`env`}}let t=Vw(e.cwd??process.cwd());t===void 0&&(IC(`错误: 未定位产品群聚合根(一级子目录应存在 longzai-intelligence-globals 仓)`),IC(`提示: 请自产品群内任意仓库运行,或使用 --project-scope <id> 显式圈定范围`),process.exit(1));let n=o(t),r=l(t,`longzai-intelligence-project-registry`);p(l(r,`scopes`))||(IC(`错误: registry 声明域缺失: ${l(r,`scopes`)}`),IC(`提示: 请确认 longzai-intelligence-project-registry 仓已在聚合根就位`),process.exit(1));let i=await NC({registryRoot:r,scopeIds:[n],scopeRoots:/* @__PURE__ */ new Map([[n,t]])});return i.ok||(IC(`错误: 项目范围解析失败: ${i.error.message}`),process.exit(1)),{registryRoot:r,scopeId:n,projects:Hw(i.value.projects),source:`structure`}}const Ww=(e,t)=>Bun.spawnSync([`git`,`diff`,`--quiet`,`HEAD`,`--`,t],{cwd:e,stdout:`pipe`,stderr:`pipe`}).exitCode===0,Gw=e=>{let t=e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`("${t}/[^"]+":\\s*")[^"]*(")`,`g`)},Kw=e=>{let t=e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`("${t}":\\s*")[^"]*(")`,`g`)},qw=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),Jw=e=>/^[~^]?\d/.test(e),Yw=(e,t)=>`${/^[~^]/.exec(e)?.[0]??``}${t}`,Xw=e=>{let t=Bun.spawnSync([`git`,`ls-files`,`--`,`*/package.json`],{cwd:e,stdout:`pipe`,stderr:`pipe`});return t.exitCode===0?[`package.json`,...(t.stdout?.toString()??``).trim().split(`
329
- `).map(e=>e.trim()).filter(e=>e.length>0).filter(t=>p(l(e,t)))]:[`package.json`]},Zw=(e,t,n)=>Bun.spawnSync([`git`,`commit`,...t,`-m`,n],{cwd:e,stdout:`pipe`,stderr:`pipe`}).exitCode===0,Qw=async(e,t,n,r)=>{let i=await Bun.file(e).text(),a=[],o=[],s=[],c;for(t.lastIndex=0;(c=t.exec(i))!==null;){let e=c[0],t=c[1]??``,i=c[2]??``,a=/^"([^"]+)"/.exec(t)?.[1]??``,o=e.slice(t.length,e.length-i.length),l=n(a,o);o!==l&&Jw(o)&&!r.has(a)&&s.push({name:a,oldVersion:o,targetVersion:l,prefix:t,suffix:i})}if(s.length===0)return{matchedPackages:a,changes:o};let l=i;for(let e of s){let t=RegExp(`("${qw(e.name)}":\\s*")[^"]*(")`);l=l.replace(t,`$1${e.targetVersion}$2`),a.push(e.name),o.push({name:e.name,from:e.oldVersion,to:e.targetVersion})}return await Bun.write(e,l),{matchedPackages:a,changes:o}},$w=async(e,t,n,r)=>{let i=await Bun.file(e).text(),a=[],o=[];t.lastIndex=0;let s;for(;(s=t.exec(i))!==null;){let e=s[0],t=s[1]??``,i=s[2]??``,c=/^"([^"]+)"/.exec(t)?.[1]??``,l=e.slice(t.length,e.length-i.length),u=n(c,l);l!==u&&Jw(l)&&!r.has(c)&&(a.push(c),o.push({name:c,from:l,to:u}))}return{matchedPackages:a,changes:o}},eT=async(e,t,n,r,i)=>{let{name:a,dir:o}=e,s=await ww(o),c=Xw(o),u=[],d=[],f=[],p=[];for(let e of c){let r=l(o,e),a=await $w(r,t,n,s);if(a.matchedPackages.length!==0){if(!Ww(o,e))f.push(e);else{if(i)u.push(...a.matchedPackages),d.push(...a.changes);else{let e=await Qw(r,t,n,s);u.push(...e.matchedPackages),d.push(...e.changes)}p.push(e)}}}return p.length===0?f.length>0?{name:a,dir:o,matchedPackages:u,changes:d,skippedFiles:f,status:`skipped-dirty`,reason:`package.json 已有未提交改动:${f.join(`,`)}`}:{name:a,dir:o,matchedPackages:u,changes:d,status:`skipped-nochange`,reason:`无匹配 scope 或已是目标版本`}:i||Zw(o,p,r)?{name:a,dir:o,matchedPackages:u,changes:d,skippedFiles:f,status:`success`}:{name:a,dir:o,matchedPackages:u,changes:d,skippedFiles:f,status:`failed`,reason:`git commit 失败,文件已修改,需人工介入`}},tT=async(e,t)=>{let n=/* @__PURE__ */ new Set;for(let r of e){let e=Xw(r.dir);for(let i of e){let e=l(r.dir,i),a=await Bun.file(e).text();t.lastIndex=0;let o;for(;(o=t.exec(a))!==null;){let e=o[1]??``,t=/^"([^"]+)"/.exec(e)?.[1];t&&n.add(t)}}}return[...n]},nT=async(e,t)=>{let n=/* @__PURE__ */ new Map,r=[],i=0,a=async e=>{let t=await wx(e),i=t.tags?.latest;if(i===void 0){let n=t.error instanceof Error?t.error.message:t.error??`未找到 dist-tags.latest`;r.push({name:e,reason:n})}else n.set(e,i)},o=async()=>{for(;i<e.length;){let t=e[i];i++,t!==void 0&&await a(t)}},s=Array.from({length:Math.min(t,e.length)},()=>o());if(await Promise.all(s),r.length>0){IC(`${PC.RED}错误: 部分包查询 npm latest 失败,已中止(0 文件改动、0 提交)${PC.RESET}`);for(let e of r)IC(` ${e.name}: ${e.reason}`);process.exit(1)}return n},rT=async e=>{let{scope:t,package:n,version:r,message:i,dryRun:a}=e;if(t===void 0==(n===void 0)){process.stderr.write(`错误: upgrade-across 需要在 --scope <@scope> 与 --package <包名> 之间恰选其一
330
- `),process.exitCode=1;return}let o=t??n??``,s=e.concurrency??10,c=await Uw({projectScope:e.projectScope}),l=r===void 0,u=l?`latest(各自 npm 最新)`:r,d=i??(l?`chore: 升级 ${o} 版本至最新`:`chore: 升级 ${o} 版本至 ${r.replace(/^[~^]/,``)}`),f=n===void 0?Gw(o):Kw(n);$(`${PC.BLUE}═══ version upgrade-across ═══${PC.RESET}`),$(`项目获取来源: ${c.source===`structure`?`结构锚点(cwd 上溯聚合根)`:`显式圈定(--project-scope)`}`),$(`registry: ${c.registryRoot}`),$(`项目范围: ${c.scopeId}`),$(`升级范围: ${n===void 0?`${o} 下的所有包`:`${o}(精确包名)`} -> ${u}`),$(`并发数: ${s}`),a&&$(`${PC.YELLOW}[dry-run] 预览模式,不写文件、不提交${PC.RESET}`),$(``);let p=c.projects;$(`发现 ${p.length} 个子项目,并发处理(并发 ${s})...`),$(``);let m;if(l){let e=await tT(p,f);if(e.length===0){$(`${PC.YELLOW}未匹配到任何 ${t} 下的包,结束${PC.RESET}`);return}$(`匹配到 ${e.length} 个 ${t} 下的包,查询 npm latest...`);let n=await nT(e,s);m=(e,t)=>Yw(t,n.get(e)??``)}else{let e=r??``;m=()=>e}let h=[],g=0,_=p.length;await(async(e,t)=>{let n=0,r=async()=>{for(;n<e.length;){let t=e[n];if(n++,t===void 0)break;let r=await eT(t,f,m,d,a);h.push(r),g++;let i=r.status===`success`?`${PC.GREEN}✓${PC.RESET}`:r.status===`failed`?`${PC.RED}✗${PC.RESET}`:`·`;$(` [${g}/${_}] ${i} ${t.name}`)}},i=Array.from({length:Math.min(t,e.length)},()=>r());await Promise.all(i)})(p,s),$(``),iT(h,a)},iT=(e,t)=>{let n=e.filter(e=>e.status===`success`),r=e.filter(e=>e.status===`skipped-dirty`),i=e.filter(e=>e.status===`skipped-nochange`),a=e.filter(e=>e.status===`failed`);$(`${PC.BLUE}═══ 处理结果 ═══${PC.RESET}`);let o=t?`将提交`:`已提交`;$(`${PC.GREEN}✓ ${o}: ${n.length}${PC.RESET}`);for(let e of n){let t=e.changes.map(e=>`${e.name.split(`/`).pop()}: ${e.from} → ${e.to}`).join(`, `);$(` ${e.name}`),$(` ${t}`),e.skippedFiles!==void 0&&e.skippedFiles.length>0&&$(` ⚠ 脏文件跳过:${e.skippedFiles.join(`,`)}`)}if(r.length>0){$(``),$(`${PC.YELLOW}⚠ 跳过(文件已改动): ${r.length}${PC.RESET}`);for(let e of r)$(` ${e.name}: ${e.reason}`)}if(i.length>0&&($(``),$(`跳过(无匹配/已是目标版本): ${i.length}`)),a.length>0){$(``),$(`${PC.RED}✗ 失败(需人工介入): ${a.length}${PC.RESET}`);for(let e of a)$(` ${e.name}: ${e.reason}`),$(` ${e.changes.map(e=>`${e.name.split(`/`).pop()}: ${e.from} → ${e.to}`).join(`, `)}`)}$(``),$(`${PC.BLUE}汇总: ${n.length} ${o} / ${r.length} 跳过(dirty) / ${i.length} 跳过(无变更) / ${a.length} 失败${PC.RESET}`),!t&&n.length>0&&($(``),$(`下一步:推送到远程`),$(` bun push-all`)),a.length>0&&(process.exitCode=1)},aT=e=>[`${e}/*`,`${e}-*/*`],oT=Lc([`default`,`major`,`minor`,`patch`,`latest`,`newest`]).default(`default`),sT=async e=>{let t=(await LC()).upgrade??{},n=e.mode||t.mode||`default`,r=oT.safeParse(n),i=r.success?r.data:`default`,a=[...e.scope?aT(e.scope):[],...t.include??[]],{packages:o}=await XS({cwd:process.cwd(),mode:i,write:!e.dryRun&&e.write,recursive:t.recursive??!0,timeout:t.timeout??3e4,retries:t.retries??3,exclude:t.exclude??[],include:a,depFields:t.depFields,ignorePaths:t.ignorePaths??[],concurrency:t.concurrency??10,force:!1,all:!1,install:!1,update:!1,interactive:!1,group:!0,includeLocked:e.locked===!0,timediff:!0,nodecompat:!0,loglevel:`info`,silent:!1,failOnOutdated:!1},{afterPackagesLoaded:e=>{$(`扫描到 ${e.length} 个包,正在检查依赖更新...`)},beforePackageStart:e=>{$(`正在检查 ${e.name||e.relative}...`)},afterPackageEnd:e=>{let t=e.resolved.filter(e=>e.update).length;$(t>0?` ✓ ${e.name||e.relative}: 发现 ${t} 个可更新依赖`:` ✓ ${e.name||e.relative}: 所有依赖已是最新`)},afterPackageWrite:e=>{$(` 📝 已写入 ${e.name||e.relative}`)}}),s=0;$(`
331
- --- 检查结果 ---`);for(let e of o){let t=e.resolved.filter(e=>e.update);if(t.length>0){s+=t.length,$(`\n${e.name||e.relative}:`);for(let e of t){let t=e.diff??``;$(` ${e.name}: ${e.currentVersion} -> ${e.targetVersion} (${t})`)}}}s===0?$(`所有依赖已是最新版本`):($(`\n共发现 ${s} 个可更新依赖`),e.write?$(`已写入 package.json`):$(`使用 --write 参数写入 package.json`))};function cT(e){Qd(e,{name:`upgrade`,description:`检查依赖版本更新`,arguments:[{signature:`[mode]`,description:`升级模式(major/minor/patch/latest/newest)`},{signature:`[scope]`,description:`可选。仅升级指定 scope 族的依赖(如 @longzai-intelligence-oxlint 或族根 @longzai-intelligence),内部展开为 include @scope/* 与 @scope-*/*`}],options:[{flags:`--write`,description:`将更新写入 package.json`},{flags:`--dry-run`,description:`仅预览`},{flags:`--locked`,description:`包含精确锁定版本的依赖(默认跳过以数字开头的精确 pin)`}],schema:Dc({write:_c().optional(),dryRun:_c().optional(),locked:_c().optional()}),action:async(e,t)=>{let n=t[0],r=t[1];await sT({mode:n,write:e.write===!0,dryRun:e.dryRun===!0,locked:e.locked,scope:r})}}),Qd(e,{name:`upgrade-across`,description:`跨产品群批量升级依赖(项目清单经 project-registry 声明域获取)`,options:[{flags:`--scope <scope>`,description:`依赖 scope(与 --package 二选一,如 @longzai-intelligence-builder),升级该 scope 下所有包`},{flags:`--package <name>`,description:`完整包名(与 --scope 二选一,如 @longzai-intelligence-markdown/data-engine),仅升级该包`},{flags:`--target <version>`,description:`目标版本号(可选,如 ^0.0.8。省略时自动取每个匹配包的 npm latest)`},{flags:`-m, --message <message>`,description:`自定义提交信息`},{flags:`--project-scope <id>`,description:`显式圈定项目范围(缺省自动取当前 edition 范围)`},{flags:`--concurrency <n>`,description:`并发数(默认 10)`},{flags:`--dry-run`,description:`仅预览(不写文件、不提交)`}],schema:Dc({scope:U().optional(),target:U().optional(),message:U().optional(),config:U().optional(),package:U().optional(),concurrency:pl().int().positive().optional(),projectScope:U().optional(),dryRun:_c().optional()}),action:async e=>{e.scope===void 0==(e.package===void 0)&&(process.stderr.write(`错误: upgrade-across 需要在 --scope <@scope> 与 --package <包名> 之间恰选其一
318
+ `,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=c(s(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=c(s(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}}})),Xb=/* @__PURE__ */ L((e=>{var t=Hb(),n=Tb(),r=Eb(),i=Xy(),a=Q(),o=Jb(),s=Yb();function c(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new o.LineCounter||null,prettyErrors:t}}function l(e,n={}){let{lineCounter:i,prettyErrors:a}=c(n),o=new s.Parser(i?.addNewLine),l=new t.Composer(n),u=null;for(let t of l.compose(o.parse(e),!0,e.length))if(!u)u=t;else if(u.options.logLevel!==`silent`){u.errors.push(new r.YAMLParseError(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return a&&i&&(u.errors.forEach(r.prettifyError(e,i)),u.warnings.forEach(r.prettifyError(e,i))),u}e.parse=function(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let a=l(e,n);if(!a)return null;if(a.warnings.forEach(e=>i.warn(a.options.logLevel,e)),a.errors.length>0){if(a.options.logLevel!==`silent`)throw a.errors[0];a.errors=[]}return a.toJS(Object.assign({reviver:r},n))},e.parseAllDocuments=function(e,n={}){let{lineCounter:i,prettyErrors:a}=c(n),o=new s.Parser(i?.addNewLine),l=new t.Composer(n),u=Array.from(l.compose(o.parse(e)));if(a&&i)for(let t of u)t.errors.forEach(r.prettifyError(e,i)),t.warnings.forEach(r.prettifyError(e,i));return u.length>0?u:Object.assign([],{empty:!0},l.streamInfo())},e.parseDocument=l,e.stringify=function(e,t,r){let i=null;if(typeof t==`function`||Array.isArray(t)?i=t:r===void 0&&t&&(r=t),typeof r==`string`&&(r=r.length),typeof r==`number`){let e=Math.round(r);r=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=r??t??{};if(!e)return}return a.isDocument(e)&&!i?e.toString(r):new n.Document(e,i,r).toString(r)}})),Zb=(/* @__PURE__ */ L((e=>{var t=Hb(),n=Tb(),r=Cb(),i=Eb(),a=Vy(),o=Q(),s=$y(),c=Hy(),l=tb(),u=rb();Kb();var d=qb(),f=Jb(),p=Yb(),m=Xb(),h=Fy();e.Composer=t.Composer,e.Document=n.Document,e.Schema=r.Schema,e.YAMLError=i.YAMLError,e.YAMLParseError=i.YAMLParseError,e.YAMLWarning=i.YAMLWarning,e.Alias=a.Alias,e.isAlias=o.isAlias,e.isCollection=o.isCollection,e.isDocument=o.isDocument,e.isMap=o.isMap,e.isNode=o.isNode,e.isPair=o.isPair,e.isScalar=o.isScalar,e.isSeq=o.isSeq,e.Pair=s.Pair,e.Scalar=c.Scalar,e.YAMLMap=l.YAMLMap,e.YAMLSeq=u.YAMLSeq,e.Lexer=d.Lexer,e.LineCounter=f.LineCounter,e.Parser=p.Parser,e.parse=m.parse,e.parseAllDocuments=m.parseAllDocuments,e.parseDocument=m.parseDocument,e.stringify=m.stringify,e.visit=h.visit,e.visitAsync=h.visitAsync})))();function Qb(e){let t=(0,Zb.parseDocument)(e),n=!1;function r(r){e=r,t=(0,Zb.parseDocument)(e),n=!1}function i(e,r){let i=e.length===1?t.contents:t.getIn(e.slice(0,-1));i||(i=t.createNode({}),t.setIn(e.slice(0,-1),i));let a=e[e.length-1],o=i.items.find(e=>typeof e.key==`string`?e.key===a:e.key.value===a),s=i.items.map(e=>typeof e.key==`string`?e.key:String(e.key.value));if(!o){let e=0;for(;e<s.length&&!(s[e].localeCompare(a)>0);e++);o=new Zb.Pair(a,r),i.items.splice(e,0,o),n=!0}else if((0,Zb.isAlias)(o.value)){let e=$b(t,o.value);e&&e.value!==r&&(e.value=r,n=!0)}else!o.value||typeof o.value==`string`?o.value!==r&&(o.value=r,n=!0):o.value.value!==r&&(o.value.value=r,n=!0)}function a(e,n,r){let i=t.toJSON()||{},a=e==="default"?i.catalog?.[n]:i.catalogs?.[e]?.[n];if(a===r)return{conflicts:!1,newCatalogName:e,existingSpecifier:a};if(a){let t=ex(r);return{conflicts:!0,existingSpecifier:a,newCatalogName:e==="default"?`conflicts_${n}_${t}`:`conflicts_${e}_${t}`}}return{conflicts:!1,newCatalogName:e}}function o(e,t,n){let{newCatalogName:r}=a(e,t,n);s(r,t,n)}function s(e,n,r){let a=t.toJSON()?.catalogs?.default!==void 0;i(e==="default"&&!a?[`catalog`,n]:[`catalogs`,e,n],r)}function c(e){let n=[],r=t.toJSON()||{};if(r.catalogs)for(let t of Object.keys(r.catalogs))r.catalogs[t]?.[e]&&n.push(t);return r.catalog&&r.catalog[e]&&n.push(`default`),n}return{getDocument(){return t},setContent:r,hasChanged:()=>n,toJSON:()=>t.toJSON(),toString:n=>{let r=e.split(`'`).length>=e.split(`"`).length;return t.toString({singleQuote:r,...n})},setPath:i,setPackage:s,setPackageNoConflicts:o,getPackageCatalogs:c,hasSpecifierConflicts:a}}function $b(e,t){let n;return(0,Zb.visit)(e,{Scalar:(e,r,i)=>{r.anchor===t.source&&typeof r.value==`string`&&(n=r)}}),n}function ex(e){return e.replace(/\^/g,`h`).replace(/~/g,`t`).replace(/\./g,`_`).replace(/</g,`l`).replace(/>/g,`g`).replace(/=/g,`e`).replace(/\*/g,`s`).replace(/@/g,`a`).replace(/\|/g,`p`).replace(/&/g,`n`).replace(/-/g,`m`).replace(/\+/g,`u`).replace(/\s/g,`_`)}function tx(e){return e??=[],Array.isArray(e)?e:[e]}function nx(e){return typeof e==`object`&&!!e&&`json`in e&&typeof e.json==`function`}function rx(e){if(nx(e))return e.json();throw TypeError(`response does not implement json()`)}const ix=3e4,ax=`version-upgrade@npm node/${y.version}`,ox=Object.assign((e,t)=>{let n=new Headers(t?.headers);return n.set(`user-agent`,ax),Ev(e,{...t,headers:n})},{preconnect:()=>{}});async function sx(e,t,n,r){let i;for(let a=0;a<=r;a++)try{return await Promise.race([e(),new Promise((e,i)=>setTimeout(()=>i(/* @__PURE__ */ Error(`Timeout requesting "${t}" (attempt ${a+1}/${r+1})`)),n))])}catch(e){if(i=e instanceof Error?e:Error(String(e)),a<r){let e=Math.min(1e3*2**a,1e4);await new Promise(t=>setTimeout(t,e))}}throw i??Error(`Unexpected state: all retries exhausted for "${t}" but no error captured`)}async function cx(e,t=!1,n,r=ix,i=3){let a=await sx(()=>g_(e,{cwd:n,force:t,fetch:ox,metadata:!0,throw:!1}),e,r,i);if(!dx(a))throw Error(`Invalid package metadata received for "${e}"`);let o=a;if(`error`in o)throw Error(`Failed to fetch package "${e}": ${o.error}`);return ux(o)}async function lx(e,t=ix,n=3){let r=await sx(()=>ox(new URL(`${e}/meta.json`,`https://jsr.io/`),{headers:{accept:`application/json`}}).then(e=>rx(e)),e,t,n);if(!fx(r))throw Error(`Invalid JSR package metadata received for "${e}"`);let i=r;return{versions:Object.keys(i.versions),tags:{latest:i.latest}}}function ux(e){let t=Object.keys(e.versionsMeta),n=Object.fromEntries(Object.entries(e.versionsMeta).flatMap(([e,t])=>t.deprecated==null?[]:[[e,t.deprecated]])),r=Object.fromEntries(Object.entries(e.versionsMeta).map(([e,t])=>[e,t.engines?.node]).filter(([,e])=>e)),i=Object.fromEntries(Object.entries(e.versionsMeta).map(([e,t])=>[e,t.provenance]).filter(([,e])=>e)),a=Object.fromEntries(Object.entries(e.versionsMeta).map(([e,t])=>[e,t.integrity]).filter(([,e])=>e));return{tags:e.distTags,versions:t,time:{...Object.fromEntries(Object.entries(e.versionsMeta).filter(([,e])=>e.time).map(([e,t])=>[e,t.time])),created:e.timeCreated,modified:e.timeModified},nodeSemver:r,provenance:i,deprecated:Object.keys(n).length>0?n:void 0,integrity:a}}function dx(e){return typeof e==`object`&&!!e&&`versionsMeta`in e&&`distTags`in e}function fx(e){return typeof e==`object`&&!!e&&`scope`in e&&`name`in e&&`latest`in e&&`versions`in e}let px=null;const mx=()=>(px===null&&(px=Sd(`packages/version-upgrade/src/io/cache`)),px),hx=(0,km.default)(`version-upgrade:cache`);let gx={},_x=!1;const vx=Tm(ce.tmpdir(),`version-upgrade`),yx=Tm(vx,`cache.json`),bx=18e5;function xx(){return Date.now()}function Sx(e){return xx()-e}async function Cx(){p(yx)&&Sx(m(yx).mtimeMs)<bx?(hx(`cache loaded from ${yx}`),gx=JSON.parse(await h.readFile(yx,`utf-8`))):hx(`no cache found`)}async function wx(){if(_x)try{await h.mkdir(vx,{recursive:!0}),await h.writeFile(yx,JSON.stringify(gx),`utf-8`),hx(`cache saved to ${yx}`)}catch(e){mx().error(`Failed to save cache`,e instanceof Error?e:Error(String(e)))}}async function Tx(e,t=`npm`,n,r,i){let a,o=`${t}:${e}`;if(gx[o]){if(Sx(gx[o].cacheTime)<bx)return hx(`cache hit for ${o}`),gx[o].data;delete gx[o]}try{let a=t===`jsr`?await lx(e,r,i):await cx(e,!1,n,r,i);if(a)return gx[o]={data:a,cacheTime:xx()},_x=!0,a}catch(e){a=e}return{tags:{},versions:[],error:a instanceof Error&&a.message||String(a),deprecated:{}}}const Ex=[`**/node_modules/**`,`**/dist/**`,`**/public/**`,`**/fixture/**`,`**/fixtures/**`];function Dx(e,t=[]){if(!e)return{};let n={};for(let[r,i]of Object.entries(e))if(typeof i==`object`&&i){let e={};for(let[t,n]of Object.entries(i))e[t]=n;n={...n,...Dx(e,[...t,r])}}else typeof i==`string`&&(n[r]={version:i,parents:t});return n}function Ox(e,t){let n=t.split(`.`).reduce((e,t)=>{if(typeof e==`object`&&e){let n={};for(let[t,r]of Object.entries(e))n[t]=r;return n[t]}},e);if(typeof n==`object`&&n){let e={};for(let[t,r]of Object.entries(n))e[t]=r;return Dx(e)}return{}}function kx(e){if(typeof e==`object`&&e&&!Array.isArray(e)){let t={};for(let[n,r]of Object.entries(e))t[n]=r;return t}return{}}function Ax(e,t,n){let r=t.split(`.`),i=r.pop();if(i===void 0)return;let a=e;for(let e of r){(typeof a[e]!=`object`||a[e]===null)&&(a[e]={});let t=kx(a[e]);a[e]=t,a=t}a[i]=n}function jx(e,t,n){return Object.entries(Ox(e,t)||{}).map(([e,{version:r,parents:i}])=>Mx({name:e,version:r,type:t,shouldUpdate:n,parents:i}))}function Mx({name:e,version:t,type:n,shouldUpdate:r,parents:i,hexHash:a}){let o={name:e,currentVersion:t,parents:i,source:n,update:r(e)};return a&&(o.hexHash=a),o}function Nx(e,t){let n={};return e.filter(e=>e.source===t).sort((e,t)=>(e.aliasName||e.name).localeCompare(t.aliasName||t.name)).forEach(e=>{let t=e.update?e.targetVersion:e.currentVersion,r=n;if(e.parents&&e.parents.length>0){let t=n;for(let n of e.parents){(typeof t[n]!=`object`||t[n]===null)&&(t[n]={});let e=kx(t[n]);t[n]=e,t=e}r=t}if(e.aliasName===void 0)r[e.name]=t;else{let n=e.protocol?`${e.protocol}:`:``;r[e.aliasName]=`${n}${e.protocol===`jsr`?t:Px(e,t)}`}}),n}function Px(e,t){let n=t?`@${t}`:``;return`${e.name}${n}`}async function Fx(e,t,n,r){let i=Tm(t.cwd??``,e),a=r??JSON.parse(await N(i,`utf-8`)),o=[];function s(t,r){let o=Object.entries(r).map(([e,t])=>Mx({name:e,version:t,type:`bun-workspace`,shouldUpdate:n}));return{name:t,private:!0,version:``,type:`bun-workspace`,relative:e,filepath:i,raw:a,deps:o,resolved:[]}}let c=a?.workspaces;if(c&&typeof c==`object`){let e=Rx(c);if(e.catalog&&typeof e.catalog==`object`&&o.push(s(`bun-catalog:default`,zx(e.catalog))),e.catalogs&&typeof e.catalogs==`object`){let t=Bx(e.catalogs);for(let e of Object.keys(t)){let n=t[e];n&&o.push(s(`bun-catalog:${e}`,n))}}}return o}async function Ix(e,t){let n=Nx(e.resolved,`bun-workspace`);if(Object.keys(n).length&&e.name.startsWith(`bun-catalog:`)){let t=e.name.replace(`bun-catalog:`,``),r=Rx(e.raw.workspaces??{});if(e.raw.workspaces=r,t==="default")r.catalog={...zx(r.catalog??{}),...zx(n)};else{let e=Bx(r.catalogs??{});r.catalogs=e,e[t]||(e[t]={}),e[t]={...e[t],...zx(n)}}await Lx(e.filepath,e.raw)}}async function Lx(e,t){let n;try{n=Fv(await N(e,`utf-8`)).indent}catch{}let r=JSON.stringify(t,null,n||` `);await F(e,`${r}\n`,`utf-8`)}function Rx(e){if(typeof e==`object`&&e&&!Array.isArray(e)){let t={};for(let[n,r]of Object.entries(e))t[n]=r;return t}return{}}function zx(e){if(typeof e==`object`&&e&&!Array.isArray(e)){let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}return{}}function Bx(e){if(typeof e==`object`&&e&&!Array.isArray(e)){let t={};for(let[n,r]of Object.entries(e))if(typeof r==`object`&&r&&!Array.isArray(r)){let e={};for(let[t,n]of Object.entries(r))typeof n==`string`&&(e[t]=n);t[n]=e}return t}return{}}let Vx=null;const Hx=()=>(Vx===null&&(Vx=Sd(`packages/version-upgrade/src/addons/vscode`)),Vx);function Ux(e,t){if(typeof e==`object`&&e){for(let[n,r]of Object.entries(e))if(n===t&&typeof r==`string`)return r}}function Wx(e){return e!=null&&Ux(e.engines,`vscode`)!==void 0}function Gx(e){for(let t of[`dependencies`,`devDependencies`,`peerDependencies`]){let n=Ux(e[t],`@types/vscode`);if(n!==void 0)return n}return``}const Kx=[{beforeWrite(e){if(!Wx(e.raw)||e.raw==null)return;let t=e.raw,n=Gx(t);if(!n||n.includes(`:`))return;let r=t.engines,i=Ux(r,`vscode`);if(!i)return;let a=Ny(i),o=Ny(n);if(a&&o&&ny(o,a)){Hx().info(`[taze addon] Updated VS Code engine field to ${n}`);let e=/[>^<:~]/.test(n)?n:`^${n}`;if(typeof r==`object`&&r){let n={};for(let[t,i]of Object.entries(r))n[t]=t===`vscode`?e:i;t.engines=n}}}}];function qx(e){return ue.from(e.slice(7),`base64`).toString(`hex`)}function Jx(e){return typeof e==`object`&&!!e&&`version`in e&&typeof e.version==`string`}const Yx=[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`,`packageManager`,`pnpm.overrides`,`resolutions`,`overrides`];function Xx(e,t){return t.depFields?.[e]===!1?!1:e!==`peerDependencies`||!!t.peer}async function Zx(e,t,n,r){let i=Tm(t.cwd??``,e),a=r??await gS(i),o=[];for(let e of Yx)if(Xx(e,t)){if(e===`packageManager`){let e=a.packageManager;if(typeof e==`string`){let t=e.indexOf(`@`),r=t>0?e.slice(0,t):``,i=t>0?e.slice(t+1):``,a=i.indexOf(`+`),s=a>=0?i.slice(0,a):i,c=a>=0?i.slice(a+1):``,l=c.indexOf(`.`),u=l>=0?c.slice(l+1):void 0;o.push(Mx({name:r,version:`^${s}`,type:`packageManager`,shouldUpdate:n,hexHash:u}))}}else o.push(...jx(a,e,n))}let s=typeof a.name==`string`?a.name:``,c=typeof a.version==`string`?a.version:``;return[{name:s,private:!!a.private,version:c,type:`package.json`,relative:e,filepath:i,raw:a,deps:o,resolved:[]}]}async function Qx(e,t){let n=!1;for(let r of Yx)if(Xx(r,t)){if(r===`packageManager`){let t=Object.entries(Nx(e.resolved,`packageManager`))[0];if(t){e.raw||={};let[r,i]=t,a=typeof i==`string`?i.replace(`^`,``):String(i),o=`${r}@${a}`,s=e.resolved.find(e=>e.source===`packageManager`&&e.name===r);if(s?.hexHash){let e=s.pkgData?.integrity?.[a];if(e){let t=qx(e);o=`${o}+sha512.${t}`}}e.raw.packageManager=o,n=!0}}else{let t=Ox(e.raw,r),i=Nx(e.resolved,r),a={};for(let[e,n]of Object.entries(t||{}))Jx(n)&&(a[e]=n.version);for(let[e,t]of Object.entries(i||{}))a[e]=t;Object.keys(a).length>0&&(Ax(e.raw,r,a),n=!0)}}if(n){for(let n of t.addons||Kx)await n.beforeWrite?.(e,t);await _S(e.filepath,e.raw||{})}}const $x=[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`,`packageManager`,`pnpm.overrides`,`resolutions`,`overrides`];function eS(e,t){return e===`peerDependencies`?!!t.peer:t.depFields?.[e]!==!1}async function tS(e){let t=await se.readFile(e,`utf-8`);if(!t)return new Zb.Document({});let n=(0,Zb.parseDocument)(t,{merge:!0}),r=n.toJS();if(n.errors.length||typeof r!=`object`||Array.isArray(r))throw TypeError(`Invalid package.yaml structure in ${e}`);return n}async function nS(e,t){let{amount:n,type:r}=await se.readFile(e,`utf-8`).then(Fv).catch(()=>({amount:2,type:`space`})),i=(0,Zb.stringify)(t,{indent:(r===`tab`?2:n)??2,aliasDuplicateObjects:!1,lineWidth:0}).replace(/^(\s*)"(@[^":]+)":/gm,`$1'$2':`);await se.writeFile(e,i,`utf-8`)}async function rS(e,t,n){let r=Tm(t.cwd??``,e),i=await tS(r),a=[];for(let e of $x)if(eS(e,t)){if(e===`packageManager`){let t=i.get(e);if(typeof t==`string`){let e=t.split(`@`),r=e[0]??``,i=(e[1]??``).split(`+`)[0];a.push(Mx({name:r,version:`^${i??``}`,type:`packageManager`,shouldUpdate:n}))}}else{let t={},r=i.toJS();if(typeof r==`object`&&r&&!Array.isArray(r))for(let[e,n]of Object.entries(r))t[e]=n;a.push(...jx(t,e,n))}}let o=i.get(`name`),s=i.get(`version`);return[{name:typeof o==`string`?o:``,private:!!i.get(`private`),version:typeof s==`string`?s:``,type:`package.yaml`,relative:e,filepath:r,get raw(){return i.toJS()},deps:a,yamlDocument:i,resolved:[]}]}async function iS(e,t){let n=!1;if(e.type!==`package.yaml`)throw Error(`Package type is not supported`);let r=e.yamlDocument||new Zb.Document(e.raw);for(let i of $x)if(eS(i,t)){if(i===`packageManager`){let t=Object.entries(Nx(e.resolved,`packageManager`))[0];if(t){let[e,i]=t,a=typeof i==`string`?i.replace(`^`,``):``;r.set(`packageManager`,`${e}@${a}`),n=!0}}else{let t=Ox(aS(r),i);t&&Object.keys(t).length>0&&(Object.entries(Nx(e.resolved,i)).forEach(([e,t])=>r.setIn([...i.split(`.`),e],t)),n=!0)}}if(n){for(let n of t.addons||Kx)await n.beforeWrite?.(e,t);await nS(e.filepath,r)}}function aS(e){let t=e.toJS();if(typeof t==`object`&&t&&!Array.isArray(t)){let e={};for(let[n,r]of Object.entries(t))e[n]=r;return e}return{}}async function oS(e,t,n){let r=Tm(t.cwd??``,e),i=Qb(await N(r,`utf-8`)),a=i.getDocument().toJSON(),o=[];function s(t,o){let s=Object.entries(o).map(([e,t])=>Mx({name:e,version:t,type:`pnpm-workspace`,shouldUpdate:n}));return{name:t,private:!0,version:``,type:`pnpm-workspace.yaml`,relative:e,filepath:r,raw:a,context:i,deps:s,resolved:[]}}if(a?.catalog&&o.push(s(`pnpm-catalog:default`,a.catalog)),a?.catalogs)for(let e of Object.keys(a.catalogs))o.push(s(`pnpm-catalog:${e}`,a.catalogs[e]));return a?.overrides&&o.push(s(`pnpm-workspace:overrides`,a.overrides)),o}async function sS(e,t){let n=Nx(e.resolved,`pnpm-workspace`);if(Object.keys(n).length){if(e.name.startsWith(`pnpm-catalog:`)){let t=e.name.replace(`pnpm-catalog:`,``);for(let[r,i]of Object.entries(n))typeof i==`string`&&e.context.setPackage(t,r,i)}else{let t=e.name.replace(`pnpm-workspace:`,``).split(/\./g);for(let[r,i]of Object.entries(n))e.context.setPath([...t,r],i)}e.context.hasChanged()&&await cS(e,e.context)}}function cS(e,t){return F(e.filepath,t.toString(),`utf8`)}async function lS(e,t,n){let r=Tm(t.cwd??``,e),i=Qb(await N(r,`utf-8`)),a=i.getDocument().toJSON(),o=[];function s(t,o){let s=Object.entries(o).map(([e,t])=>Mx({name:e,version:t,type:`yarn-workspace`,shouldUpdate:n}));return{name:t,private:!0,version:``,type:`.yarnrc.yml`,relative:e,filepath:r,raw:a,context:i,deps:s,resolved:[]}}if(a?.catalog&&o.push(s(`yarn-catalog:default`,a.catalog)),a?.catalogs)for(let e of Object.keys(a.catalogs))o.push(s(`yarn-catalog:${e}`,a.catalogs[e]));return o}async function uS(e,t){let n=Nx(e.resolved,`yarn-workspace`);if(Object.keys(n).length){if(e.name.startsWith(`yarn-catalog:`)){let t=e.name.replace(`yarn-catalog:`,``);for(let[r,i]of Object.entries(n))typeof i==`string`&&e.context.setPackage(t,r,i)}else{let t=e.name.replace(`yarn-workspace:`,``).split(/\./g);for(let[r,i]of Object.entries(n))e.context.setPath([...t,r],i)}e.context.hasChanged()&&await dS(e,e.context)}}function dS(e,t){return F(e.filepath,t.toString(),`utf8`)}function fS(e){return e.replace(/[.+?^${}()|[\]\\]/g,`\\$&`)}function pS(e){if(e.startsWith(`/`)){let t=e.lastIndexOf(`/`),n=e.substring(1,t),r=e.substring(t+1,e.length);return new RegExp(n,r)}return RegExp(`^${fS(e).replace(/\*+/g,`.*?`)}$`)}function mS(e,t=!0){if(!e||e.length===0)return()=>t;let n=tx(e).flatMap(e=>e.split(`,`)).map(pS);return e=>{for(let t of n)if(t.test(e))return!0;return!1}}function hS(e,t){let n=mS(e,!0),r=mS(t,!1);return e=>!r(e)&&n(e)}async function gS(e){return JSON.parse(await h.readFile(e,`utf-8`))}async function _S(e,t){let n=Fv(await h.readFile(e,`utf-8`)).indent||` `;await h.writeFile(e,`${JSON.stringify(t,null,n)}\n`,`utf-8`)}async function vS(e,t){switch(e.type){case`package.json`:return Qx(e,t);case`package.yaml`:return iS(e,t);case`pnpm-workspace.yaml`:return sS(e,t);case`bun-workspace`:return Ix(e,t);case`.yarnrc.yml`:return uS(e,t);default:throw Error(`Unsupported package type: ${e.type}`)}}async function yS(e,t,n){if(e.endsWith(`pnpm-workspace.yaml`))return oS(e,t,n);if(e.endsWith(`.yarnrc.yml`))return lS(e,t,n);if(e.endsWith(`package.yaml`))return rS(e,t,n);if(e.endsWith(`package.json`)){let r=Tm(t.cwd??``,e);try{let i=await gS(r),a=i?.workspaces;if(a&&typeof a==`object`&&(`catalog`in a||`catalogs`in a)){let r=Tm(t.cwd||y.cwd());if(p(Cm(r,`bun.lockb`))||p(Cm(r,`bun.lock`))){let r=await Fx(e,t,n,i),a=await Zx(e,t,n,i);return[...r,...a]}}return Zx(e,t,n,i)}catch{}}return Zx(e,t,n)}async function bS(e){let t=[],n=Tm(e.cwd||y.cwd()),r=hS(e.include,e.exclude);if(e.recursive){let n=await Bp(`**/package.yaml`,{ignore:Ex.concat(e.ignorePaths||[]),cwd:e.cwd,onlyFiles:!0,dot:!1,expandDirectories:!1}),r=await Bp(`**/package.json`,{ignore:Ex.concat(e.ignorePaths||[]),cwd:e.cwd,onlyFiles:!0,dot:!1,expandDirectories:!1}),i=/* @__PURE__ */ new Set;for(let e of n){t.push(e);let n=Om(e);i.add(n)}for(let e of r){let n=Om(e);i.has(n)||t.push(e)}}else t=await Bp(`package.{yaml,json}`,{cwd:n});return t=t.sort((e,t)=>e.localeCompare(t)),e.ignoreOtherWorkspaces&&(t=(await Promise.all(t.map(async e=>{if(!e.includes(`/`))return[e];let t=Cm(n,e),r=Rv(`.git`,{cwd:t,last:n});if(r&&Om(r)!==n)return[];let i=Rv(`pnpm-workspace.yaml`,{cwd:t,last:n});if(i&&Om(i)!==n)return[];let a=Rv(`.yarnrc.yml`,{cwd:t,last:n});if(a&&Om(a)!==n)return[];let o=Rv(`bun.lockb`,{cwd:t,last:n})||Rv(`bun.lock`,{cwd:t,last:n});return o&&Om(o)!==n?[]:[e]}))).flat()),p(Cm(n,`pnpm-workspace.yaml`))&&t.unshift(`pnpm-workspace.yaml`),p(Cm(n,`.yarnrc.yml`))&&t.unshift(`.yarnrc.yml`),(await Promise.all(t.map(t=>yS(t,e,r)))).flat()}const xS={error:-1,major:0,minor:1,patch:2,"":3};function SS(e){return e.sort((e,t)=>xS[e.diff||``]-xS[t.diff||``])}function CS(e,t){if(t.packageMode){for(let n of Object.keys(t.packageMode))if(pS(n).test(e))return t.packageMode[n]}}function wS(e,t){let n=[];for(let r of tx(t.maturityPeriodExclude).flatMap(e=>e.split(`,`))){let t=r.trim();if(!t)continue;let i=t.startsWith(`/`)?-1:t.lastIndexOf(`@`);if(!pS(i>0?t.slice(0,i):t).test(e))continue;if(i<=0)return!0;let a=t.slice(i+1).split(`||`).map(e=>e.trim()).filter(Boolean);n.push(...a)}return n}function TS(e,t){for(let n of t)if(My(e,n,{includePrerelease:!0}))return!0;return!1}const ES=new t;function DS(e){return e.match(/(@[^/]+\/)?([^/]+)/g)||[]}function OS(e){return e.match(/[^>]+/g)||[]}function kS(e){return/^(?:https?:|git\+|github:)/.test(e)}function AS(e){return/^(?:link|file|workspace|catalog):/.test(e)}function jS(e){return/^(?:npm|jsr):/.test(e)}function MS(e){return e===`npm`?`npm`:e===`jsr`?`jsr`:`npm`}function NS(e){let t=e.indexOf(`:`),n=MS(e.slice(0,t)),r=e.slice(t+1);if(n===`npm`){let e=r.lastIndexOf(`@`);return e>0?{protocol:n,name:r.substring(0,e),version:r.substring(e+1)}:{protocol:n,name:r,version:``}}return{protocol:n,name:``,version:r}}function PS(e){let t=[`>=`,`<=`,`>`,`<`,`~`,`^`],n=e.trim();if(n===`*`||n===``)return`*`;if(n[0]===`~`||n[0]===`^`)return n[0];for(let e of t)if(n.startsWith(e))return e;if(n.includes(`x`)){let e=n.split(`.`);if(e[0]===`x`)return`*`;if(e[1]===`x`)return`^`;if(e[2]===`x`)return`~`}return n.length>0&&n.charCodeAt(0)>=48&&n.charCodeAt(0)<=57?``:null}function FS(e,t){if(!Py(e))return null;if(t==="default")return e;let n=Ny(e);return n?{major:`>=`,minor:`^`,patch:`~`}[t]+n:null}function IS(e,t){return e==null||t==null?null:t===`*`?`*`:t+e}function LS(e,t){return IS(t,PS(e))}function RS(e,t,n,r){let i=null;if(n===`latest`){let t=r.latest;i=t!=null&&e.includes(t)?t:e.at(-1)??null}else if(n===`newest`)i=e.at(-1)??null;else if(n===`next`){let t=r.next;i=t!=null&&e.includes(t)?t:e.at(-1)??null}else if(n===`stable`){let n=FS(t,`default`);if(!n)return;e.filter(e=>!e.includes(`-`)).forEach(e=>{My(e,n)&&(!i||ny(e,i))&&(i=e)})}else if(n==="default"&&(t===`*`||t.trim()===``))return;else{let a=FS(t,n);if(!a)throw Error(`invalid_range`);let o=r.latest??null;o&&!My(o,a)&&(o=null),e.forEach(e=>{My(e,a)&&(o&&!ay(e,o)||i&&!ny(e,i)||(i=e))})}if(i)return i}function zS(e,t){return e.filter(e=>!t[e])}function BS(e,t,n){if(!t||n<=0)return e;let r=/* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).getTime()-n*24*60*60*1e3);return e.filter(e=>{let n=t[e];return!n||new Date(n)<r})}function VS(e,t,n){let{tags:r}=e.pkgData,i=HS(e,n);if(i.length!==0)return e.filteredVersions=i,RS(i,e.currentVersion,t,r)}function HS(e,t){let{versions:n,deprecated:r,time:i}=e.pkgData,a=n;r&&Object.keys(r).length>0&&(a=zS(a,r));let o=wS(e.name,t);if(t.maturityPeriod&&t.maturityPeriod>0&&o!==!0){let e=a;if(a=BS(e,i,t.maturityPeriod),o.length>0){let t=new Set(a);a=e.filter(e=>t.has(e)||TS(e,o))}}return a}function US(e,t,n){let r=VS(e,`latest`,n);return r&&ny(r,t)?r:void 0}function WS(e,t,n=!0,r=!1){let i=/^\d+/.test(e.currentVersion);if(i&&!r)e.targetVersion=e.currentVersion,e.targetVersionTime=e.currentVersionTime,e.diff=null,e.update=!1;else{if(e.targetVersion=LS(e.currentVersion,t)||e.currentVersion,e.targetVersionTime=e.pkgData.time?.[t],e.currentProvenance=e.pkgData.provenance?.[e.currentVersion],e.targetProvenance=e.pkgData.provenance?.[e.targetVersion],e.provenanceDowngraded=!(!e.currentProvenance||e.targetProvenance)||e.currentProvenance===`trustedPublisher`&&e.targetProvenance===!0,i&&ty(e.currentVersion,e.targetVersion)){let{versions:t,time:n={},tags:r}=e.pkgData,i=RS(e.filteredVersions??t,e.currentVersion,`minor`,r);i&&(e.targetVersion=i,e.targetVersionTime=n[e.targetVersion])}try{let t=Ny(e.currentVersion),n=Ny(e.targetVersion);if(!t||!n)throw Error(`invalid_version`);e.currentVersionTime=e.pkgData.time?.[t.toString()],e.diff=GS(t,n),e.update=e.diff!==null&&iy(t,n)}catch(t){if(!n)throw t;e.targetVersion=e.currentVersion,e.diff=`error`,e.update=!1}}}function GS(e,t){if(ty(e,t))return null;let n=My(t,`~${e}`,{includePrerelease:!0}),r=My(t,`^${e}`,{includePrerelease:!0}),i=My(t,`>=${e}`,{includePrerelease:!0});return n?r?`patch`:`major`:r?`minor`:i?`major`:`error`}function KS(e,t){return{...e,diff:null,targetVersion:e.currentVersion,update:!1,provenanceDowngraded:!1,pkgData:{tags:{},versions:[]},...t}}function qS(e){return e!=null&&e!==`ignore`?e:`default`}async function JS(e,t,n=()=>!0){let r={...e,diff:null,targetVersion:e.currentVersion,update:e.update,provenanceDowngraded:!1,pkgData:{tags:{},versions:[]}},i=CS(r.name,t),a=t.mode,o=i?i===a?a:a==="default"?i:`ignore`:a;if(AS(e.currentVersion)||kS(e.currentVersion)||!e.update||!await Promise.resolve(n(e))||o===`ignore`)return KS(e);if(jS(e.currentVersion)){let{name:t,version:n,protocol:i}=NS(e.currentVersion);if(r.name=t||r.name,r.currentVersion=n,r.aliasName=e.name,r.protocol=i,!n)return KS(e,{name:r.name,currentVersion:n,aliasName:e.name,protocol:i})}let s=r.name;r.source===`resolutions`?s=DS(r.name).pop()??r.name:r.source===`pnpm.overrides`&&(s=OS(r.name).pop()??r.name);let c=await Tx(s,r.protocol,t.cwd,t.timeout,t.retries),{error:l,deprecated:u}=c;r.pkgData=c;let d=null,f;if(l==null)try{if(u&&typeof u==`object`&&r.currentVersion&&u[r.currentVersion])return KS(e,{name:r.name,currentVersion:r.currentVersion,aliasName:r.aliasName,protocol:r.protocol});if(f=VS(r,qS(o),t),!f)return KS(e,{name:r.name,currentVersion:r.currentVersion,aliasName:r.aliasName,protocol:r.protocol,pkgData:c})}catch(e){d=e instanceof Error?e.message:String(e)}else d=l;f?WS(r,f,void 0,t.includeLocked):r.targetVersion=r.currentVersion,r.targetVersion===r.currentVersion&&(r.diff=null,r.update=!1);try{let e=Ny(f||r.targetVersion||``);e&&(r.latestVersionAvailable=US(r,e,t));let{nodecompat:n=!0}=t;if(n){let t=y.version,{nodeSemver:n}=r.pkgData;if(n&&e?.version&&e?.version in n){let i=n[e.version];r.nodeCompatibleVersion={compatible:i!=null&&My(t,i),semver:i??``}}}}catch{}return d&&(r.diff=`error`,r.update=!1,r.resolveError=d),r}async function YS(e,t,n=()=>!0,r=()=>{}){let i=e.length,a=0,{concurrency:o=10}=t,s=ES.getStore()||dm(o);return Promise.all(e.map(e=>s.add(async()=>{let o=await JS(e,t,n);return a+=1,r(e.name,a,i),o})))}async function XS(e,t,n,r){let i=await YS(e.deps,t,n,(t,n,i)=>r?.(e.name,t,n,i));return SS(i),e.resolved=i,e}async function ZS(e,t={}){e.force||await Cx();let n=await bS(e);t.afterPackagesLoaded?.(n);let r=n.filter(e=>e.private).map(e=>e.name).filter(e=>e),i=e=>!r.includes(e.name),a=0,o=(e,n,r,i)=>{a++,t.onDependencyResolved?.(e,n,a,i)},s=dm(e.concurrency||10);return await ES.run(s,()=>Promise.all(n.map(async n=>{t.beforePackageStart?.(n),await QS(n,e,i,{...t,onDependencyResolved:o}),t.afterPackageEnd?.(n)}))),t.afterPackagesEnd?.(n),await wx(),{packages:n}}async function QS(e,t,n=()=>!0,r={}){await XS(e,t,n,r.onDependencyResolved);let{resolved:i}=e,a=i.filter(e=>e.update);return t.write&&a.length&&await Promise.resolve(r.beforePackageWrite?.(e))!==!1&&(await vS(e,t),r.afterPackageWrite?.(e)),e}function $S(e){return{ok:!0,value:e}}function eC(e){return{ok:!1,error:e}}const tC=/^[a-z][a-z0-9-]*$/,nC=[`edition-root`,`customer-root`,`single-repo`],rC=Lc([`high`,`normal`,`low`]),iC=Lc(nC),aC=/\S/,oC=Ec({id:U().regex(tC,`范围 id 非法(应为小写字母开头的字母数字连字符)`),kind:iC,remotes:Cc(U().regex(aC,`远程位置非法(不得为空串或纯空白)`)).default([]),tags:Cc(U().regex(aC,`标签非法(不得为空串或纯空白)`)).default([]),priority:rC.default(`normal`),excludes:Cc(U().min(1)).default([]),projectPriorities:Fc(U(),rC).default({})}).check(e=>{e.value.kind===`single-repo`&&(e.value.excludes.length>0&&e.issues.push({code:`custom`,input:e.value,path:[`excludes`],message:`single-repo 范围禁用 excludes(声明的即唯一项目,如需排除请改用 edition-root/customer-root)`}),Object.keys(e.value.projectPriorities).length>0&&e.issues.push({code:`custom`,input:e.value,path:[`projectPriorities`],message:`single-repo 范围禁用 projectPriorities(优先级直接设于 scope 级)`}))}),sC=`scopes`,cC=/^[a-z][a-z0-9-]*\.scope\.ts$/;async function lC(e){let t=l(e,sC);if(!p(t))return eC({code:`SCOPES_DIR_MISSING`,message:`声明域目录缺失:${t}(应为 project-registry 仓根下 ${sC}/,含 *.scope.ts 声明文件)`});let n=_(t).filter(e=>cC.test(e)).sort((e,t)=>e<t?-1:1);if(n.length===0)return eC({code:`SCOPE_REGISTRY_EMPTY`,message:`范围声明域为空:${t}(无 *.scope.ts——范围消失属配置事故,如需清空请显式移除 registryRoot 配置)`});let r=/* @__PURE__ */ new Set,i=[];for(let e of n){let n=l(t,e),a=await import(S(n).href),o=oC.safeParse(a.default);if(!o.success){let e=o.error.issues[0];return eC({code:`SCOPE_DECLARATION_INVALID`,message:`范围声明结构非法:${n}(${e?.path.join(`.`)??``} ${e?.message??``})`})}let s=e.replace(/\.scope\.ts$/,``);if(o.data.id!==s)return eC({code:`SCOPE_ID_MISMATCH`,message:`范围 id 与文件名不一致:${n}(id=${o.data.id},应为 ${s}——命名即身份)`});if(r.has(o.data.id))return eC({code:`SCOPE_ID_CONFLICT`,message:`范围 id 重复:${o.data.id}(声明域内同 id 即同范围,不得重复声明)`});r.add(o.data.id),i.push(o.data)}return $S(i)}const uC=`LZI_PROJECT_REGISTRY_ROOT`,dC=`LZI_PROJECT_MARKDOWN_REGISTRY_ROOT`,fC=`LZI_PROJECT_SCOPE_ROOTS`,pC=`LZI_PROJECT_MARKDOWN_SCOPE_ROOTS`,mC=/^[a-z][a-z0-9-]*=\/\S+$/;function hC(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e!==``)}function gC(e){let t=/* @__PURE__ */ new Map;for(let n of hC(e)){if(!mC.test(n))return eC({message:`范围根映射段非法:${n}(应为 id=绝对路径 形态,id 为小写字母开头的字母数字连字符)`});let e=n.indexOf(`=`),r=n.slice(0,e),i=d(n.slice(e+1));if(t.has(r))return eC({message:`范围根映射 id 重复:${r}(同一范围不得重复映射)`});t.set(r,i)}return $S(t)}function _C(e,t,n,r){return e!==void 0&&t!==void 0&&e.trim()!==t.trim()?eC({code:`ACQUISITION_ENV_INVALID`,message:`环境变量双名冲突:${n} 与 ${r} 同时在场且值不一致(请统一使用新名 ${n})`,variables:[n,r]}):$S({value:e??t,variables:e===void 0?t===void 0?[]:[r]:[n]})}function vC(e=process.env){let t=_C(e[uC],e[dC],uC,dC);if(!t.ok)return eC(t.error);let n=_C(e[fC],e[pC],fC,pC);if(!n.ok)return eC(n.error);let r;if(n.value.value!==void 0){let e=gC(n.value.value);if(!e.ok)return eC({code:`ACQUISITION_ENV_INVALID`,message:e.error.message,variables:[...n.value.variables]});r=e.value}return $S({registryRoot:t.value.value===void 0?void 0:d(t.value.value.trim()),scopeRoots:r})}const yC=/^[A-Za-z0-9_][A-Za-z0-9._-]*$/;function bC(e,t){return e.name<t.name?-1:+(e.name>t.name)}function xC(e){return p(l(e,`.git`))}function SC(e,t){return t.get(e.id)}function CC(e,t,n,r){if(n.has(e.id))return eC({code:`SCOPE_ID_CONFLICT`,message:`范围 id 冲突:${e.id}(声明域内不得重复)`});n.add(e.id);let i=SC(e,t);return i===void 0?eC({code:`SCOPE_ROOT_UNMAPPED`,message:`范围根未映射:${e.id}(声明零本地路径,请在 .env 的 LZI_PROJECT_SCOPE_ROOTS 或 LZI_PROJECT_MARKDOWN_SCOPE_ROOTS 补 id=绝对路径 映射)`}):p(i)?$S({def:e,root:i,sourceId:r}):eC({code:`DIR_NOT_FOUND`,message:`范围根不存在:${i}(范围 ${e.id} 机内映射目标)`})}function wC(e,t){let n=[],r=[];for(let i of[..._(e.root,{withFileTypes:!0})].sort(bC)){if(i.name.startsWith(`.`))continue;if(!i.isDirectory()){r.push({scope:e.def.id,entry:i.name,reason:`ROOT_FILE`});continue}if(e.def.excludes.includes(i.name)){r.push({scope:e.def.id,entry:i.name,reason:`EXCLUDED`});continue}let a=l(e.root,i.name);t!==void 0&&d(a)===d(t)?r.push({scope:e.def.id,entry:i.name,reason:`EXCLUDED_PATH`}):!xC(a)||!yC.test(i.name)?r.push({scope:e.def.id,entry:i.name,reason:`NOT_A_REPO`}):n.push({scope:e.def.id,scopeKind:e.def.kind,priority:e.def.projectPriorities[i.name]??e.def.priority,sourceId:e.sourceId,project:i.name,path:a})}return{scope:e.def.id,scopeKind:e.def.kind,priority:e.def.priority,scopeRoot:e.root,sourceId:e.sourceId,projects:n,skipped:r}}function TC(e,t){let n=o(e.root);return t!==void 0&&d(e.root)===d(t)||!xC(e.root)||!yC.test(n)?eC({code:`SCOPE_ROOT_INVALID`,message:`single-repo 范围根非法:${e.root}(应为含 .git 的合规项目目录,且不得为排除路径)`}):$S({scope:e.def.id,scopeKind:`single-repo`,priority:e.def.priority,scopeRoot:e.root,sourceId:e.sourceId,projects:[{scope:e.def.id,scopeKind:`single-repo`,priority:e.def.priority,sourceId:e.sourceId,project:n,path:e.root}]})}function EC(e,t,n){let r=[],i=[],a=/* @__PURE__ */ new Set,o=/* @__PURE__ */ new Map;for(let s of e){let e=CC(s,n.scopeRoots,a,n.sourceId);if(!e.ok)return eC(e.error);let c,l=[];if(s.kind===`single-repo`){let n=TC(e.value,t);if(!n.ok)return eC(n.error);c=n.value}else{let n=wC(e.value,t);c=n,l=n.skipped}for(let e of c.projects){let t=o.get(e.project);if(t!==void 0)return eC({code:`PROJECT_NAME_CONFLICT`,message:`项目名跨范围冲突:${e.project}(${t} 与 ${e.scope} 均含此名;归档平铺要求项目名全局唯一,可在后登记范围的 excludes 中显式排除)`});o.set(e.project,e.scope)}r.push(c),i.push(...l)}return r.sort((e,t)=>e.scope<t.scope?-1:+(e.scope>t.scope)),i.sort((e,t)=>e.scope===t.scope?e.entry<t.entry?-1:+(e.entry>t.entry):e.scope<t.scope?-1:1),$S({scopes:r,skipped:i})}const DC=b(i);function OC(e){return typeof e==`object`&&!!e&&`stderr`in e}async function kC(e,t){try{let{stdout:n}=await DC(`git`,[`-C`,e,...t],{encoding:`utf8`});return{ok:!0,stdout:n.trim()}}catch(e){let t=OC(e)?e.stderr:void 0;return{ok:!1,stderr:typeof t==`string`?t:String(e)}}}function AC(e){return typeof e==`object`&&!!e}function jC(e){let t=l(e,`package.json`);if(!p(t))return{packageName:null,description:null};let n;try{n=JSON.parse(g(t,`utf8`))}catch{return{packageName:null,description:null}}if(!AC(n))return{packageName:null,description:null};let r=n.name,i=n.description;return{packageName:typeof r==`string`&&r!==``?r:null,description:typeof i==`string`&&i!==``?i:null}}async function MC(e){let t=await kC(e.path,[`rev-parse`,`--git-dir`]);if(!t.ok)return eC({code:`INSPECT_FAILED`,scope:e.scope,project:e.project,message:`仓库健康探测失败:${e.path}(${t.stderr})`});let n=await kC(e.path,[`remote`,`get-url`,`origin`]),r=n.ok&&n.stdout!==``?n.stdout:null,i=jC(e.path);return $S({scope:e.scope,scopeKind:e.scopeKind,priority:e.priority,sourceId:e.sourceId,project:e.project,projectPath:e.path,remoteUrl:r,packageName:i.packageName,description:i.description})}async function NC(e,t,n){let r=Math.max(1,Math.floor(t)),i=[],a=0;for(;a<e.length;){let t=e.slice(a,a+r),o=await Promise.all(t.map((e,t)=>n(e,a+t)));i.push(...o),a+=r}return i}async function PC(e={}){let t=vC(e.processEnv??process.env);if(!t.ok)return eC(t.error);let n=e.registryRoot??t.value.registryRoot;if(n===void 0)return eC({code:`ACQUISITION_ENV_INVALID`,message:`未定位 registry 仓根(请在 .env 配置 LZI_PROJECT_REGISTRY_ROOT 或显式传入 registryRoot)`});let r=await lC(n);if(!r.ok)return eC(r.error);let i=e.scopeRoots??t.value.scopeRoots??/* @__PURE__ */ new Map,a=e.scopeIds===void 0?void 0:new Set(e.scopeIds),o=a===void 0?[]:[...a].filter(e=>!r.value.some(t=>t.id===e));if(o.length>0)return eC({code:`SCOPE_SELECTOR_UNKNOWN`,message:`圈定的范围 id 不在声明域:${o.join(`、`)}(合法范围 id:${r.value.map(e=>e.id).join(`、`)})`});let s=r.value,c=[];if(a!==void 0){s=r.value.filter(e=>a.has(e.id));let e=s.filter(e=>!i.has(e.id)).map(e=>e.id);if(e.length>0)return eC({code:`SCOPE_ROOT_UNMAPPED`,message:`范围根未映射:${e.join(`、`)}(声明零本地路径,请在 .env 的 LZI_PROJECT_SCOPE_ROOTS 补 id=绝对路径 映射)`})}else if(s=r.value.filter(e=>i.has(e.id)),c=r.value.filter(e=>!i.has(e.id)).map(e=>e.id),s.length===0)return eC({code:`SCOPE_ROOT_UNMAPPED`,message:`范围根未映射:${r.value.map(e=>e.id).join(`、`)}(本机未配置任何范围根映射,请在 .env 的 LZI_PROJECT_SCOPE_ROOTS 补 id=绝对路径 映射)`});let l=EC(s,e.excludePath,{scopeRoots:i,sourceId:`scope-declarations`});if(!l.ok)return eC(l.error);let u=l.value.scopes.flatMap(e=>[...e.projects]),d=[],f=/* @__PURE__ */ new Map;if(e.inspect===!0){let e=await NC(u,16,async e=>MC(e));for(let t of e)t.ok?f.set(t.value.project,t.value):d.push({scope:t.error.scope,project:t.error.project,message:t.error.message})}let p=u.map(e=>{let t=f.get(e.project);return{scope:e.scope,scopeKind:e.scopeKind,priority:e.priority,sourceId:e.sourceId,project:e.project,path:e.path,remoteUrl:t?.remoteUrl??null,packageName:t?.packageName??null,description:t?.description??null}});return $S({registryRoot:n,scopes:l.value.scopes,projects:p,skipped:l.value.skipped,unmappedScopes:c,inspectFailures:d,inspected:e.inspect===!0})}const FC={RED:`\x1B[0;31m`,GREEN:`\x1B[0;32m`,YELLOW:`\x1B[1;33m`,BLUE:`\x1B[0;34m`,RESET:`\x1B[0m`};function IC(e){return e.map(e=>{if(typeof e==`string`)return e;if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}).join(` `)}function $(...e){process.stdout.write(`${IC(e)}\n`)}function LC(...e){process.stderr.write(`${IC(e)}\n`)}const RC=async()=>{let e=await lm();return e?(e.source===`legacy-dev-tools`&&$(`提示: 经 lzi-dev.config.ts 共享读取依赖工具配置,建议补建 lzi-dependencies.config.ts`),e.config):($(`提示: 未找到配置文件 lzi-dependencies.config.ts,使用默认配置`),{})},zC=[`**/node_modules/**`,`**/oh_modules/**`,`**/target/**`,`**/dist/**`,`**/build/**`,`**/.turbo/**`],BC=e=>!e||e.length===0?zC:[...zC,...e],VC=[`-contract`,`-implementation`,`-infrastructure`,`-main`,`-domain`],HC=[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`],UC=[`api`,`contract`,`implementation`,`infrastructure`,`main`,`ui`,`testing`],WC=Tc({name:U().optional(),dependencies:Fc(U(),yc()).optional(),devDependencies:Fc(U(),yc()).optional(),peerDependencies:Fc(U(),yc()).optional(),optionalDependencies:Fc(U(),yc()).optional()}),GC=(e,t)=>t.includes(`/domains/`)?!0:VC.some(t=>e.endsWith(t)),KC=async()=>{let e=process.cwd();$(`正在扫描 ${e} 的分层边界...`);let t=await RC(),n=BC(t.boundary?.ignorePaths),r=new Set(t.boundary?.allowlist??[]),i=await qC(e,n,r)+JC(e,r);i===0?$(`分层边界检查通过,packages 层无领域契约依赖且领域目录层名合规`):(LC(`共 ${i} 处分层边界违例,处置口径见 Packages 与 Domains 边界指南 BOUNDARY-001,豁免须经特别申请登记于 lzi-dependencies.config.ts 的 boundary.allowlist`),process.exit(Math.min(i,255)))},qC=async(e,t,n)=>{$(`
319
+ --- 依赖方向 ---`);let r=await Bp(`packages/**/package.json`,{cwd:e,ignore:t,onlyFiles:!0,dot:!1}),i=0,a=0;for(let t of r){let r=null;try{let n=WC.safeParse(await Bun.file(l(e,t)).json());r=n.success?n.data:null}catch{r=null}if(r!==null){i+=1;for(let e of HC){let i=r[e];if(i!==void 0)for(let[o,s]of Object.entries(i)){let i=typeof s==`string`?s:`非字符串取值`;GC(o,i)&&!n.has(o)&&(a+=1,$(` ${r.name??t} ${t}`),$(` ${e} ${o} ${i}`))}}}}return $(`扫描到 ${i} 个 packages 层清单,登记豁免条目 ${n.size} 项`),a===0?($(`packages 层清单未依赖 domains 层领域契约包`),0):($(`共 ${a} 处 packages 层依赖领域契约包`),a)},JC=(e,t)=>{$(`
320
+ --- 领域目录形态 ---`);let n=l(e,`domains`);if(!p(n))return $(`未发现 domains 目录,本段跳过`),0;let r=0,i=0;for(let e of _(n,{withFileTypes:!0})){if(!e.isDirectory())continue;r+=1;let a=_(l(n,e.name),{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name);for(let n of a){if(UC.includes(n))continue;let r=`${e.name}/${n}`;t.has(r)||(i+=1,$(` ${e.name} ${r}`))}}return $(`扫描到 ${r} 个领域目录`),i===0?($(`全部领域目录层名合规`),0):($(`共 ${i} 处领域目录层名不合规`),i)},YC=[`electron`,`electron-vite`],XC=`@longzai-intelligence-electron/cli`,ZC=[`lzi-electron`,`electron-vite`],QC=[`electron-vite`],$C=(e,t)=>{if(t.endsWith(`/*`)){let n=t.slice(0,-1);return e.startsWith(n)}return e===t},ew=(e,t)=>{let n=[];for(let[r,i]of Object.entries(e)){if(t.has(r))continue;let e=YC.find(e=>$C(r,e));e!==void 0&&n.push({dependency:r,rootRange:i,pattern:e})}return n},tw=(e,t)=>{let n=[];for(let[r,i]of Object.entries(t??{}))for(let t of ZC)i.includes(t)&&n.push({relPath:e,detail:`脚本 ${r} 含 ${t}`});return n},nw=e=>{let t=e??{};return QC.some(e=>t[e]!==void 0)},rw=e=>(e??{})[XC]!==void 0,iw=Tc({name:U().optional(),workspaces:yc().optional(),scripts:Fc(U(),U()).optional(),devDependencies:Fc(U(),U()).optional()}),aw=async()=>{let e=process.cwd();$(`正在扫描 ${e} 下的 package.json 文件...`);let t=null;try{let n=iw.safeParse(await Bun.file(`${e}/package.json`).json());t=n.success?n.data:null}catch{t=null}t===null&&($(`未找到可解析的 workspace 根 package.json,请在仓库根目录执行本命令`),process.exit(1));let n=await RC(),r=BC(n.hoisting?.ignorePaths),i=new Set(n.hoisting?.allowlist??[]),a=new Set(n.hoisting?.rootAllowlist??[]),o=t.devDependencies??{},s=await Bp(`**/package.json`,{cwd:e,ignore:r,onlyFiles:!0,dot:!1}),c=0,l=[],d=[...tw(`package.json`,t.scripts),...nw(t.devDependencies)?[{relPath:`package.json`,detail:`开发依赖 electron-vite`}]:[]],f=rw(t.devDependencies);for(let t of s){if(t===`package.json`)continue;let n=null;try{let r=iw.safeParse(await Bun.file(`${e}/${t}`).json());n=r.success?r.data:null}catch{n=null}if(n===null||n.workspaces!==void 0)continue;let r=n.devDependencies??{};if(d.push(...tw(t,n.scripts)),nw(r)&&d.push({relPath:t,detail:`开发依赖 electron-vite`}),rw(r)&&(f=!0),Object.keys(r).length!==0){c+=1;for(let[a,s]of Object.entries(r)){let r=o[a];r===void 0||i.has(a)||l.push({packageName:n.name??t,relPath:u(e,`${e}/${t}`),dependency:a,subRange:s,rootRange:r,drifted:s!==r})}}}$(`找到 ${c} 个子包,根声明开发依赖 ${Object.keys(o).length} 项`);let p=l.length;if(p===0)$(`所有子包均未重复声明根已有的开发依赖`);else{$(`
321
+ 以下子包重复声明根已有的开发依赖:`);for(let e of l){let t=e.drifted?` 版本漂移`:``;$(` ${e.packageName} ${e.relPath}`),$(` ${e.dependency} 子声明 ${e.subRange} 根声明 ${e.rootRange}${t}`)}$(`共 ${p} 处重复声明,处置口径见 ADR 0036`)}let m=ew(o,a);if(m.length>0){$(`
322
+ 以下 workspace 根声明了技术栈专属依赖,判定口径 ADR 0036 第 3 节:`);for(let e of m)$(` ${e.dependency} 根声明 ${e.rootRange} 命中禁入模式 ${e.pattern}`);$(`共 ${m.length} 处根禁入声明,处置口径:迁移至栈子包 devDependencies 或径直移除`)}let h=d.length>0&&!f;if(h){$(`\n仓内存在 electron 构建面痕迹但全仓未声明 ${XC}:`);for(let e of d)$(` ${e.relPath} ${e.detail}`);$(`处置口径:在 workspace 根 devDependencies 声明 ${XC}`)}p+m.length+ +!!h!==0&&($(`\n归位汇总: 重复声明 ${p} 处,根禁入 ${m.length} 处,栈引擎缺失 ${+!!h} 项`),process.exit(1))},ow=Tc({name:U().optional(),overrides:Fc(U(),yc()).optional(),pnpm:Tc({overrides:Fc(U(),yc()).optional()}).optional(),resolutions:Fc(U(),yc()).optional()}),sw=e=>typeof e==`string`?e:`嵌套对象`,cw=async()=>{let e=process.cwd();$(`正在扫描 ${e} 下的 package.json 文件...`);let t=null;try{let n=ow.safeParse(await Bun.file(`${e}/package.json`).json());t=n.success?n.data:null}catch{t=null}t===null&&($(`未找到可解析的仓库根 package.json,请在仓库根目录执行本命令`),process.exit(1));let n=await RC(),r=BC(n.overrides?.ignorePaths),i=new Set(n.overrides?.allowlist??[]),a=await Bp(`**/package.json`,{cwd:e,ignore:r,onlyFiles:!0,dot:!1}),o=0,s=[];for(let t of a){let n=null;try{let r=ow.safeParse(await Bun.file(`${e}/${t}`).json());n=r.success?r.data:null}catch{n=null}if(n===null)continue;o+=1;let r=[[`overrides`,n.overrides??{}],[`pnpm.overrides`,n.pnpm?.overrides??{}],[`resolutions`,n.resolutions??{}]];for(let[a,o]of r)for(let[r,c]of Object.entries(o))i.has(r)||s.push({packageName:n.name??t,relPath:u(e,`${e}/${t}`),field:a,entry:r,value:sw(c)})}if($(`扫描到 ${o} 个清单,登记豁免条目 ${i.size} 项`),s.length===0)$(`全部清单均未声明未豁免的 overrides 族强制版本字段`);else{$(`
323
+ 以下清单声明了未豁免的 overrides 族强制版本字段:`);for(let e of s)$(` ${e.packageName} ${e.relPath}`),$(` ${e.field} ${e.entry} ${e.value}`);$(`共 ${s.length} 处强制版本条目,处置口径见 ADR 0153,豁免须经特别申请登记于 lzi-dependencies.config.ts 的 overrides.allowlist`),process.exit(1)}},lw=(e,t)=>{let n=e.filter(e=>e.relativePath.startsWith(`apps/`));if(n.length===0)return{inScope:!1,violations:[]};let r=[];for(let e of n){let n=e.name??e.relativePath;if(t.has(n))continue;let i=Object.keys(e.exports??{}).filter(e=>e!==`.`);i.length!==0&&r.push({packageName:n,relPath:e.relativePath,extraExits:i})}return{inScope:!0,violations:r}},uw=/* @__PURE__ */ new Set(/* @__PURE__ */ `@longzai-intelligence-agent-tools/cli.@longzai-intelligence-agent-tools/config.@longzai-intelligence-api/cli.@longzai-intelligence-api/config.@longzai-intelligence-api/core.@longzai-intelligence-builder/cli.@longzai-intelligence-builder/config.@longzai-intelligence-builder/core.@longzai-intelligence-builder/dual.@longzai-intelligence-builder/esm.@longzai-intelligence-builder/utils.@longzai-intelligence-bun/cli.@longzai-intelligence-bun/config.@longzai-intelligence-bun/presets.@longzai-intelligence-changelog/cli.@longzai-intelligence-changelog/config.@longzai-intelligence-decision/cli.@longzai-intelligence-decision/config.@longzai-intelligence-debts/cli.@longzai-intelligence-debts/config.@longzai-intelligence-dependencies/cli.@longzai-intelligence-dependencies/config.@longzai-intelligence-dev-tools/cli.@longzai-intelligence-dev-tools/config.@longzai-intelligence-dev-tools/vite-plugin.@longzai-intelligence-env/cli.@longzai-intelligence-env/config.@longzai-intelligence-env/core.@longzai-intelligence-features/cli.@longzai-intelligence-features/config.@longzai-intelligence-features/ledger.@longzai-intelligence-globals/cli.@longzai-intelligence-git/cli.@longzai-intelligence-git/config.@longzai-intelligence-issues/cli.@longzai-intelligence-issues/config.@longzai-intelligence-ledger/cli.@longzai-intelligence-ledger/config.@longzai-intelligence-ledger/core.@longzai-intelligence-markdown/cli.@longzai-intelligence-markdown/config.@longzai-intelligence-oxfmt/config.@longzai-intelligence-oxlint/architecture-core-plugin.@longzai-intelligence-oxlint/architecture-domain-plugin.@longzai-intelligence-oxlint/architecture-electron-plugin.@longzai-intelligence-oxlint/architecture-library-plugin.@longzai-intelligence-oxlint/architecture-plugin.@longzai-intelligence-oxlint/cli.@longzai-intelligence-oxlint/code-style-plugin.@longzai-intelligence-oxlint/composer-plugin.@longzai-intelligence-oxlint/core.@longzai-intelligence-oxlint/design-rules-plugin.@longzai-intelligence-oxlint/elysia-route-plugin.@longzai-intelligence-oxlint/eslint-config-plugin.@longzai-intelligence-oxlint/file-naming-plugin.@longzai-intelligence-oxlint/lzi-builder-config-plugin.@longzai-intelligence-oxlint/lzi-config-plugin.@longzai-intelligence-oxlint/nestjs-route-plugin.@longzai-intelligence-oxlint/oxlint-config.@longzai-intelligence-oxlint/package-json-plugin.@longzai-intelligence-oxlint/perfectionist-plugin.@longzai-intelligence-oxlint/presets.@longzai-intelligence-oxlint/react-plugin.@longzai-intelligence-oxlint/schema-type-separation-plugin.@longzai-intelligence-oxlint/stylistic-plugin.@longzai-intelligence-oxlint/testing.@longzai-intelligence-oxlint/tsconfig-plugin.@longzai-intelligence-oxlint/tsdoc-plugin.@longzai-intelligence-oxlint/tsdown-config-plugin.@longzai-intelligence-oxlint/tsup-config-plugin.@longzai-intelligence-oxlint/typeorm-plugin.@longzai-intelligence-oxlint/typescript-eslint-plugin.@longzai-intelligence-oxlint/utils.@longzai-intelligence-oxlint/vitest-config-plugin.@longzai-intelligence-oxlint/zod-plugin.@longzai-intelligence-release/cli.@longzai-intelligence-release/config.@longzai-intelligence-screenshots/cli.@longzai-intelligence-screenshots/config.@longzai-intelligence-screenshots/ledger.@longzai-intelligence-shared-config/core.@longzai-intelligence-standards/cli.@longzai-intelligence-standards/config.@longzai-intelligence-taro/cli.@longzai-intelligence-tsconfig/cli.@longzai-intelligence-tsconfig/config.@longzai-intelligence-tsconfig/core.@longzai-intelligence-tsgo/cli.@longzai-intelligence-typescript/bun-config.@longzai-intelligence-version/cli.@longzai-intelligence-version/config.@longzai-intelligence-vitest/config.@longzai-intelligence-vscode/cli.@longzai-intelligence-vscode/config.@longzai-intelligence-assignments/cli.@longzai-intelligence-assignments/config.@longzai-intelligence-changeset/core.@longzai-intelligence-clean/cli.@longzai-intelligence-clean/config.@longzai-intelligence-cli/cli.@longzai-intelligence-cli/core.@longzai-intelligence-cli/standard.@longzai-intelligence-config/cli.@longzai-intelligence-config/core.@longzai-intelligence-config/registry.@longzai-intelligence-deploy/cli.@longzai-intelligence-deploy/config.@longzai-intelligence-dimensions/cli.@longzai-intelligence-dimensions/config.@longzai-intelligence-dimensions/core.@longzai-intelligence-docs/cli.@longzai-intelligence-docs/compile-plugin.@longzai-intelligence-docs/config.@longzai-intelligence-docs/core.@longzai-intelligence-docs/eslint-plugin-markdown-links.@longzai-intelligence-docs/numbering-plugin.@longzai-intelligence-electron/cli.@longzai-intelligence-electron/config.@longzai-intelligence-evaluations/config.@longzai-intelligence-findings/cli.@longzai-intelligence-findings/config.@longzai-intelligence-findings/ledger.@longzai-intelligence-git-commit/cli.@longzai-intelligence-git-commit/config.@longzai-intelligence-git-swarm/cli.@longzai-intelligence-git-swarm/config.@longzai-intelligence-lint/cli.@longzai-intelligence-mechanisms/cli.@longzai-intelligence-mechanisms/config.@longzai-intelligence-mechanisms/core.@longzai-intelligence-npm-registry/cli.@longzai-intelligence-npm-registry/config.@longzai-intelligence-pitfalls/cli.@longzai-intelligence-pitfalls/config.@longzai-intelligence-pitfalls/ledger.@longzai-intelligence-plans/cli.@longzai-intelligence-plans/config.@longzai-intelligence-port/cli.@longzai-intelligence-port/core.@longzai-intelligence-port/registry.@longzai-intelligence-prettier/config.@longzai-intelligence-prettier/markdown-plugin.@longzai-intelligence-progress-board/cli.@longzai-intelligence-progress-board/config.@longzai-intelligence-project-registry/core.@longzai-intelligence-readme/cli.@longzai-intelligence-readme/config.@longzai-intelligence-readme/core.@longzai-intelligence-records/cli.@longzai-intelligence-records/config.@longzai-intelligence-records/ledger.@longzai-intelligence-reflections/cli.@longzai-intelligence-reflections/config.@longzai-intelligence-reflections/ledger.@longzai-intelligence-remote-machine/config.@longzai-intelligence-report-markdown/cli.@longzai-intelligence-report-markdown/config.@longzai-intelligence-runtime-registry/cli.@longzai-intelligence-runtime/cli.@longzai-intelligence-runtime/config.@longzai-intelligence-scripts/cli.@longzai-intelligence-scripts/config.@longzai-intelligence-scripts/core.@longzai-intelligence-specs/cli.@longzai-intelligence-specs/config.@longzai-intelligence-specs/ledger.@longzai-intelligence-stories/cli.@longzai-intelligence-stories/config.@longzai-intelligence-testing/cli.@longzai-intelligence-testing/config.@longzai-intelligence-testing/registry.@longzai-intelligence-typecheck/cli.@longzai-intelligence-typecheck/presets.@longzai-intelligence-toolchain/cli.@longzai-intelligence-toolchain/config.@longzai-intelligence-tsdoc/cli.@longzai-intelligence-tsdoc/config.@longzai-intelligence-vite/cli.@longzai-intelligence-wifi/cli.@longzai-intelligence-wifi/config.@longzai-intelligence-growth/cli.@longzai-intelligence-growth/config.@longzai-intelligence-growth/core.@longzai-intelligence-inbox/cli.@longzai-intelligence-inbox/config.@longzai-intelligence-inbox/core.@longzai-intelligence-kol/cli.@longzai-intelligence-kol/config.@longzai-intelligence-kol/core.@longzai-intelligence-one-digest/cli.@longzai-intelligence-one-digest/config.@longzai-intelligence-one-digest/core.@longzai-intelligence-closed-loop-markdown/cli.@longzai-intelligence-closed-loop-markdown/config.@longzai-intelligence-code-report/config.@longzai-intelligence-competition-registry/registry.@longzai-intelligence-crossref-markdown/cli.@longzai-intelligence-crossref-markdown/config.@longzai-intelligence-disk-space-markdown/config.@longzai-intelligence-github-trending-markdown/cli.@longzai-intelligence-github-trending-markdown/config.@longzai-intelligence-input-markdown/cli.@longzai-intelligence-input-markdown/config.@longzai-intelligence-journals-markdown/cli.@longzai-intelligence-journals-markdown/config.@longzai-intelligence-journals/config.@longzai-intelligence-knowledge-markdown/cli.@longzai-intelligence-knowledge-markdown/config.@longzai-intelligence-kol-markdown/cli.@longzai-intelligence-kol-markdown/config.@longzai-intelligence-music-video/config.@longzai-intelligence-nation/config.@longzai-intelligence-okr-markdown/config.@longzai-intelligence-open-router-markdown/cli.@longzai-intelligence-open-router-markdown/config.@longzai-intelligence-paper-report/cli.@longzai-intelligence-paper-report/config.@longzai-intelligence-philosophy-markdown/config.@longzai-intelligence-project-markdown/config.@longzai-intelligence-roadmap-markdown/config.@longzai-intelligence-rss-markdown/cli.@longzai-intelligence-rss-markdown/config.@longzai-intelligence-schedule-markdown/config.@longzai-intelligence-task-markdown/config.@longzai-intelligence-workflow-markdown/config.@longzai-intelligence-bilibili-markdown-private/cli.@longzai-intelligence-bilibili-markdown-private/config.@longzai-intelligence-douyin-markdown-private/cli.@longzai-intelligence-douyin-markdown-private/config.@longzai-intelligence-law-markdown-private/cli.@longzai-intelligence-law-markdown-private/config.@longzai-intelligence-release-workflow-private/publish-repository-plugin.@longzai-intelligence-release-workflow-private/workflow-repository-plugin.@longzai-intelligence-research-report-markdown-private/cli.@longzai-intelligence-research-report-markdown-private/config.@longzai-intelligence-research-report-private/core.@longzai-intelligence-runtime-registry-private/data.@longzai-intelligence-strategy-consulting-markdown-private/cli.@longzai-intelligence-strategy-consulting-markdown-private/config.@longzai-intelligence-twitter-markdown-private/cli.@longzai-intelligence-twitter-markdown-private/config.@longzai-intelligence-xiaohongshu-markdown-private/cli.@longzai-intelligence-xiaohongshu-markdown-private/config.@longzai-intelligence-youtube-markdown-private/cli.@longzai-intelligence-youtube-markdown-private/config.@longzai-intelligence-youtube-private/config.@longzai-intelligence-zhihu-markdown-private/config`.split(`.`)),dw=[`dependencies`,`devDependencies`],fw=(e,t)=>{if(e.workspaces===void 0)return{inScope:!1,violations:[]};let n=[];for(let r of dw){let i=e[r]??{};for(let[e]of Object.entries(i))e.startsWith(`@longzai-intelligence-`)&&!t.has(e)&&(uw.has(e)||n.push({dependency:e,field:r}))}return{inScope:!0,violations:n}},pw=[`dependencies`,`devDependencies`],mw=e=>e.startsWith(`@longzai-intelligence`)&&e.includes(`/`),hw=e=>e.slice(0,e.lastIndexOf(`/`)),gw=(e,t)=>{let n=[];for(let r of e){let e=/* @__PURE__ */ new Map;for(let n of pw){let i=r[n]??{};for(let[r,a]of Object.entries(i)){if(!mw(r)||a.startsWith(`workspace:`))continue;let i=hw(r);if(t.has(i))continue;let o=e.get(i)??[];o.push({dependency:r,field:n,specifier:a}),e.set(i,o)}}for(let[t,i]of e)new Set(i.map(e=>e.specifier)).size<=1||n.push({manifest:r.relativePath,scope:t,members:i})}return n},_w=[`dependencies`,`devDependencies`],vw=e=>typeof e==`string`&&e.length>0,yw=e=>{if(typeof e!=`object`||!e)return;let t=Reflect.get(e,`packages`);return Array.isArray(t)?t:void 0},bw=e=>{if(Array.isArray(e))return e.filter(vw);let t=yw(e);return t===void 0?null:t.filter(vw)},xw=(e,t)=>{let n=[];for(let r of e)for(let e of _w){let i=r[e]??{};for(let[a,o]of Object.entries(i))t.has(a)&&!o.startsWith(`workspace:`)&&n.push({manifest:r.relativePath,dependency:a,field:e,currentVersion:o})}return n},Sw=async(e,t,n=process.cwd())=>{let r=[...new Set(e.map(e=>`${e}/package.json`))],i=[...new Set(await Bp(r,{cwd:n,ignore:[`**/node_modules/**`],onlyFiles:!0,dot:!1}))],a=[];for(let e of i){let r=null;try{let i=t.safeParse(await Bun.file(`${n}/${e}`).json());r=i.success?i.data:null}catch{r=null}r!==null&&a.push({relativePath:e,...r})}return a},Cw=Tc({workspaces:yc().optional()}),ww=Tc({name:U().optional()}),Tw=async e=>{let t=null;try{let n=Cw.safeParse(await Bun.file(`${e}/package.json`).json());if(!n.success)return/* @__PURE__ */ new Set;t=n.data}catch{return/* @__PURE__ */ new Set}let n=bw(t?.workspaces);if(n===null||n.length===0)return/* @__PURE__ */ new Set;let r=await Sw(n,ww,e);return new Set(r.map(e=>e.name).filter(e=>typeof e==`string`))},Ew=`@longzai-intelligence`,Dw=Tc({workspaces:yc().optional(),dependencies:Fc(U(),U()).optional(),devDependencies:Fc(U(),U()).optional()}),Ow=Tc({name:U().optional(),dependencies:Fc(U(),U()).optional(),devDependencies:Fc(U(),U()).optional()}),kw=Tc({name:U().optional(),exports:Fc(U(),yc()).optional()}),Aw=Tc({dependencies:Fc(U(),U()).optional(),devDependencies:Fc(U(),U()).optional()}),jw=async()=>{let e=await Mw(),t=await Pw(),n=await Fw(),r=await Lw(),i=process.env.npm_config_registry;process.env.npm_config_registry=`https://registry.npmjs.org/`;let a;try{a=await zw(void 0)}finally{i===void 0?delete process.env.npm_config_registry:process.env.npm_config_registry=i}let o=Bw(a);$(`
324
+ --- 检查结果 ---`);let s=0;if(s+=Vw(a,new Set(o),!1),o.length>0){$(`\n回退基线:${o.length} 个内部包在 npm 无记录,按本机 registry 配置复查`);let e=await zw(o);s+=Vw(e,new Set(o),!0)}s===0?$(`全部 Longzai Intelligence 包依赖均为最新版`):LC(`\n共 ${s} 个内部包依赖非最新版,修复指引: 在仓根执行 lzi-dependencies upgrade --write 或 bun run version:upgrade`);let c=e+t+n+r+s;c!==0&&process.exit(Math.min(c,255))},Mw=async()=>{let e=null;try{let t=Dw.safeParse(await Bun.file(`${process.cwd()}/package.json`).json());e=t.success?t.data:null}catch{e=null}if(e===null)return 0;let t=fw(e,await Nw());if(!t.inScope)return 0;if($(`
325
+ --- 根清单依赖准入 ---`),t.violations.length===0)return $(`工作区根清单未发现业务依赖`),0;for(let e of t.violations)$(` ${e.dependency} ${e.field}`);return $(`共 ${t.violations.length} 处业务依赖出现在工作区根清单,业务依赖应下沉到实际使用的子包,处置口径见 ADR 0182`),t.violations.length},Nw=async()=>{let e=await RC();return new Set(e.rootManifest?.allowlist??[])},Pw=async()=>{let e=null;try{let t=Dw.safeParse(await Bun.file(`${process.cwd()}/package.json`).json());e=t.success?t.data:null}catch{e=null}if(e===null)return 0;let t=bw(e.workspaces);if(t===null||t.length===0)return 0;let n=await Sw(t,Ow),r=new Set(n.map(e=>e.name).filter(e=>typeof e==`string`));if(r.size===0)return 0;$(`
326
+ --- 自仓引用协议 ---`);let i={relativePath:`package.json`,dependencies:e.dependencies,devDependencies:e.devDependencies},a=xw([i,...n],r);if(a.length===0)return $(`全部自仓引用均使用 workspace 协议`),0;for(let e of a)$(` ${e.manifest} ${e.dependency} ${e.field} ${e.currentVersion}`);return $(`共 ${a.length} 处自仓引用未使用 workspace 协议,修复指引:将引用值恢复为 workspace:* 后执行 bun install`),a.length},Fw=async()=>{let e=null;try{let t=Dw.safeParse(await Bun.file(`${process.cwd()}/package.json`).json());e=t.success?t.data:null}catch{e=null}if(e===null)return 0;let t=bw(e.workspaces);if(t===null||t.length===0)return 0;let n=await Sw(t,kw),r=lw(n,await Iw());if(!r.inScope)return 0;if($(`
327
+ --- 应用包出口形态 ---`),r.violations.length===0)return $(`apps 层应用包 exports 形态全部合规`),0;for(let e of r.violations)$(` ${e.relPath} ${e.extraExits.join(` `)}`);return $(`共 ${r.violations.length} 个 apps 层应用包存在多出口 exports,应用包 exports 只允许无或单一根出口,跨应用复用一律经根出口取件,处置口径见 ADR 0198`),r.violations.length},Iw=async()=>{let e=await RC();return new Set(e.appExports?.allowlist??[])},Lw=async()=>{let e=null;try{let t=Dw.safeParse(await Bun.file(`${process.cwd()}/package.json`).json());e=t.success?t.data:null}catch{e=null}if(e===null)return 0;let t=bw(e.workspaces),n=t===null||t.length===0?[]:await Sw(t,Aw);$(`
328
+ --- 同 scope 版本锁步 ---`);let r={relativePath:`package.json`,dependencies:e.dependencies,devDependencies:e.devDependencies},i=gw([r,...n],await Rw());if(i.length===0)return $(`同 scope 内部分包声明取值全部一致`),0;for(let e of i){$(` ${e.manifest} ${e.scope}`);for(let t of e.members)$(` ${t.dependency} ${t.field} ${t.specifier}`)}return $(`共 ${i.length} 组同 scope 分包声明版本不一致,同 scope 各分包声明取值应完全一致,对齐后执行 bun install,豁免须经特别申请登记于 lzi-dependencies.config.ts 的 lockstep.allowlist`),i.length},Rw=async()=>{let e=await RC();return new Set(e.lockstep?.allowlist??[])},zw=async e=>{let t=(await RC()).upgrade??{},{packages:n}=await ZS({cwd:process.cwd(),mode:`latest`,write:!1,recursive:t.recursive??!0,timeout:t.timeout??3e4,retries:t.retries??3,exclude:t.exclude??[],include:e===void 0?t.include??[]:[...e],depFields:t.depFields,ignorePaths:t.ignorePaths??[],concurrency:t.concurrency??10,force:!1,all:!1,install:!1,update:!1,interactive:!1,group:!0,includeLocked:!1,timediff:!0,nodecompat:!0,loglevel:`silent`,silent:!0,failOnOutdated:!1},{afterPackagesLoaded:e=>{$(`扫描到 ${e.length} 个包,正在校验 Longzai Intelligence 依赖新鲜度...`)}});return n},Bw=e=>{let t=/* @__PURE__ */ new Set;for(let n of e)for(let e of n.resolved)e.name.startsWith(Ew)&&e.resolveError!=null&&t.add(e.name);return[...t]},Vw=(e,t,n)=>{let r=0;for(let i of e){let e=i.resolved.filter(e=>!e.update||!e.name.startsWith(Ew)?!1:n?t.has(e.name):!t.has(e.name));if(e.length!==0){r+=e.length,$(`\n${i.name||i.relative}:`);for(let t of e){let e=t.diff??``,r=n?`,回退基线`:``;$(` ${t.name}: ${t.currentVersion} -> ${t.targetVersion} ${e}${r}`)}}}return r};function Hw(e){let t=e;for(;;){if(p(l(t,`longzai-intelligence-globals`))||p(l(t,`lzi-architecture.yaml`)))return t;let e=l(t,`..`);if(e===t)return;t=e}}function Uw(e){return e.filter(e=>p(l(e.path,`package.json`))).map(e=>({name:e.project,dir:e.path}))}async function Ww(e){if(e.projectScope!==void 0){let t=await PC({scopeIds:[e.projectScope]});return t.ok||(LC(`错误: 项目范围解析失败: ${t.error.message}`),LC(`提示: 请确认 .env 配置 LZI_PROJECT_REGISTRY_ROOT 与 LZI_PROJECT_SCOPE_ROOTS`),process.exit(1)),{registryRoot:t.value.registryRoot,scopeId:e.projectScope,projects:Uw(t.value.projects),source:`env`}}let t=Hw(e.cwd??process.cwd());t===void 0&&(LC(`错误: 未定位产品群聚合根(一级子目录应存在 longzai-intelligence-globals 仓)`),LC(`提示: 请自产品群内任意仓库运行,或使用 --project-scope <id> 显式圈定范围`),process.exit(1));let n=o(t),r=l(t,`longzai-intelligence-project-registry`);p(l(r,`scopes`))||(LC(`错误: registry 声明域缺失: ${l(r,`scopes`)}`),LC(`提示: 请确认 longzai-intelligence-project-registry 仓已在聚合根就位`),process.exit(1));let i=await PC({registryRoot:r,scopeIds:[n],scopeRoots:/* @__PURE__ */ new Map([[n,t]])});return i.ok||(LC(`错误: 项目范围解析失败: ${i.error.message}`),process.exit(1)),{registryRoot:r,scopeId:n,projects:Uw(i.value.projects),source:`structure`}}const Gw=(e,t)=>Bun.spawnSync([`git`,`diff`,`--quiet`,`HEAD`,`--`,t],{cwd:e,stdout:`pipe`,stderr:`pipe`}).exitCode===0,Kw=e=>{let t=e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`("${t}/[^"]+":\\s*")[^"]*(")`,`g`)},qw=e=>{let t=e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`("${t}":\\s*")[^"]*(")`,`g`)},Jw=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),Yw=e=>/^[~^]?\d/.test(e),Xw=(e,t)=>`${/^[~^]/.exec(e)?.[0]??``}${t}`,Zw=e=>{let t=Bun.spawnSync([`git`,`ls-files`,`--`,`*/package.json`],{cwd:e,stdout:`pipe`,stderr:`pipe`});return t.exitCode===0?[`package.json`,...(t.stdout?.toString()??``).trim().split(`
329
+ `).map(e=>e.trim()).filter(e=>e.length>0).filter(t=>p(l(e,t)))]:[`package.json`]},Qw=(e,t,n)=>Bun.spawnSync([`git`,`commit`,...t,`-m`,n],{cwd:e,stdout:`pipe`,stderr:`pipe`}).exitCode===0,$w=async(e,t,n,r)=>{let i=await Bun.file(e).text(),a=[],o=[],s=[],c;for(t.lastIndex=0;(c=t.exec(i))!==null;){let e=c[0],t=c[1]??``,i=c[2]??``,a=/^"([^"]+)"/.exec(t)?.[1]??``,o=e.slice(t.length,e.length-i.length),l=n(a,o);o!==l&&Yw(o)&&!r.has(a)&&s.push({name:a,oldVersion:o,targetVersion:l,prefix:t,suffix:i})}if(s.length===0)return{matchedPackages:a,changes:o};let l=i;for(let e of s){let t=RegExp(`("${Jw(e.name)}":\\s*")[^"]*(")`);l=l.replace(t,`$1${e.targetVersion}$2`),a.push(e.name),o.push({name:e.name,from:e.oldVersion,to:e.targetVersion})}return await Bun.write(e,l),{matchedPackages:a,changes:o}},eT=async(e,t,n,r)=>{let i=await Bun.file(e).text(),a=[],o=[];t.lastIndex=0;let s;for(;(s=t.exec(i))!==null;){let e=s[0],t=s[1]??``,i=s[2]??``,c=/^"([^"]+)"/.exec(t)?.[1]??``,l=e.slice(t.length,e.length-i.length),u=n(c,l);l!==u&&Yw(l)&&!r.has(c)&&(a.push(c),o.push({name:c,from:l,to:u}))}return{matchedPackages:a,changes:o}},tT=async(e,t,n,r,i)=>{let{name:a,dir:o}=e,s=await Tw(o),c=Zw(o),u=[],d=[],f=[],p=[];for(let e of c){let r=l(o,e),a=await eT(r,t,n,s);if(a.matchedPackages.length!==0){if(!Gw(o,e))f.push(e);else{if(i)u.push(...a.matchedPackages),d.push(...a.changes);else{let e=await $w(r,t,n,s);u.push(...e.matchedPackages),d.push(...e.changes)}p.push(e)}}}return p.length===0?f.length>0?{name:a,dir:o,matchedPackages:u,changes:d,skippedFiles:f,status:`skipped-dirty`,reason:`package.json 已有未提交改动:${f.join(`,`)}`}:{name:a,dir:o,matchedPackages:u,changes:d,status:`skipped-nochange`,reason:`无匹配 scope 或已是目标版本`}:i||Qw(o,p,r)?{name:a,dir:o,matchedPackages:u,changes:d,skippedFiles:f,status:`success`}:{name:a,dir:o,matchedPackages:u,changes:d,skippedFiles:f,status:`failed`,reason:`git commit 失败,文件已修改,需人工介入`}},nT=async(e,t)=>{let n=/* @__PURE__ */ new Set;for(let r of e){let e=Zw(r.dir);for(let i of e){let e=l(r.dir,i),a=await Bun.file(e).text();t.lastIndex=0;let o;for(;(o=t.exec(a))!==null;){let e=o[1]??``,t=/^"([^"]+)"/.exec(e)?.[1];t&&n.add(t)}}}return[...n]},rT=async(e,t)=>{let n=/* @__PURE__ */ new Map,r=[],i=0,a=async e=>{let t=await Tx(e),i=t.tags?.latest;if(i===void 0){let n=t.error instanceof Error?t.error.message:t.error??`未找到 dist-tags.latest`;r.push({name:e,reason:n})}else n.set(e,i)},o=async()=>{for(;i<e.length;){let t=e[i];i++,t!==void 0&&await a(t)}},s=Array.from({length:Math.min(t,e.length)},()=>o());if(await Promise.all(s),r.length>0){LC(`${FC.RED}错误: 部分包查询 npm latest 失败,已中止(0 文件改动、0 提交)${FC.RESET}`);for(let e of r)LC(` ${e.name}: ${e.reason}`);process.exit(1)}return n},iT=async e=>{let{scope:t,package:n,version:r,message:i,dryRun:a}=e;if(t===void 0==(n===void 0)){process.stderr.write(`错误: upgrade-across 需要在 --scope <@scope> 与 --package <包名> 之间恰选其一
330
+ `),process.exitCode=1;return}let o=t??n??``,s=e.concurrency??10,c=await Ww({projectScope:e.projectScope}),l=r===void 0,u=l?`latest(各自 npm 最新)`:r,d=i??(l?`chore: 升级 ${o} 版本至最新`:`chore: 升级 ${o} 版本至 ${r.replace(/^[~^]/,``)}`),f=n===void 0?Kw(o):qw(n);$(`${FC.BLUE}═══ version upgrade-across ═══${FC.RESET}`),$(`项目获取来源: ${c.source===`structure`?`结构锚点(cwd 上溯聚合根)`:`显式圈定(--project-scope)`}`),$(`registry: ${c.registryRoot}`),$(`项目范围: ${c.scopeId}`),$(`升级范围: ${n===void 0?`${o} 下的所有包`:`${o}(精确包名)`} -> ${u}`),$(`并发数: ${s}`),a&&$(`${FC.YELLOW}[dry-run] 预览模式,不写文件、不提交${FC.RESET}`),$(``);let p=c.projects;$(`发现 ${p.length} 个子项目,并发处理(并发 ${s})...`),$(``);let m;if(l){let e=await nT(p,f);if(e.length===0){$(`${FC.YELLOW}未匹配到任何 ${t} 下的包,结束${FC.RESET}`);return}$(`匹配到 ${e.length} 个 ${t} 下的包,查询 npm latest...`);let n=await rT(e,s);m=(e,t)=>Xw(t,n.get(e)??``)}else{let e=r??``;m=()=>e}let h=[],g=0,_=p.length;await(async(e,t)=>{let n=0,r=async()=>{for(;n<e.length;){let t=e[n];if(n++,t===void 0)break;let r=await tT(t,f,m,d,a);h.push(r),g++;let i=r.status===`success`?`${FC.GREEN}✓${FC.RESET}`:r.status===`failed`?`${FC.RED}✗${FC.RESET}`:`·`;$(` [${g}/${_}] ${i} ${t.name}`)}},i=Array.from({length:Math.min(t,e.length)},()=>r());await Promise.all(i)})(p,s),$(``),aT(h,a)},aT=(e,t)=>{let n=e.filter(e=>e.status===`success`),r=e.filter(e=>e.status===`skipped-dirty`),i=e.filter(e=>e.status===`skipped-nochange`),a=e.filter(e=>e.status===`failed`);$(`${FC.BLUE}═══ 处理结果 ═══${FC.RESET}`);let o=t?`将提交`:`已提交`;$(`${FC.GREEN}✓ ${o}: ${n.length}${FC.RESET}`);for(let e of n){let t=e.changes.map(e=>`${e.name.split(`/`).pop()}: ${e.from} → ${e.to}`).join(`, `);$(` ${e.name}`),$(` ${t}`),e.skippedFiles!==void 0&&e.skippedFiles.length>0&&$(` ⚠ 脏文件跳过:${e.skippedFiles.join(`,`)}`)}if(r.length>0){$(``),$(`${FC.YELLOW}⚠ 跳过(文件已改动): ${r.length}${FC.RESET}`);for(let e of r)$(` ${e.name}: ${e.reason}`)}if(i.length>0&&($(``),$(`跳过(无匹配/已是目标版本): ${i.length}`)),a.length>0){$(``),$(`${FC.RED}✗ 失败(需人工介入): ${a.length}${FC.RESET}`);for(let e of a)$(` ${e.name}: ${e.reason}`),$(` ${e.changes.map(e=>`${e.name.split(`/`).pop()}: ${e.from} → ${e.to}`).join(`, `)}`)}$(``),$(`${FC.BLUE}汇总: ${n.length} ${o} / ${r.length} 跳过(dirty) / ${i.length} 跳过(无变更) / ${a.length} 失败${FC.RESET}`),!t&&n.length>0&&($(``),$(`下一步:推送到远程`),$(` bun push-all`)),a.length>0&&(process.exitCode=1)},oT=e=>[`${e}/*`,`${e}-*/*`],sT=Lc([`default`,`major`,`minor`,`patch`,`latest`,`newest`]).default(`default`),cT=async e=>{let t=(await RC()).upgrade??{},n=e.mode||t.mode||`default`,r=sT.safeParse(n),i=r.success?r.data:`default`,a=[...e.scope?oT(e.scope):[],...t.include??[]],{packages:o}=await ZS({cwd:process.cwd(),mode:i,write:!e.dryRun&&e.write,recursive:t.recursive??!0,timeout:t.timeout??3e4,retries:t.retries??3,exclude:t.exclude??[],include:a,depFields:t.depFields,ignorePaths:t.ignorePaths??[],concurrency:t.concurrency??10,force:!1,all:!1,install:!1,update:!1,interactive:!1,group:!0,includeLocked:e.locked===!0,timediff:!0,nodecompat:!0,loglevel:`info`,silent:!1,failOnOutdated:!1},{afterPackagesLoaded:e=>{$(`扫描到 ${e.length} 个包,正在检查依赖更新...`)},beforePackageStart:e=>{$(`正在检查 ${e.name||e.relative}...`)},afterPackageEnd:e=>{let t=e.resolved.filter(e=>e.update).length;$(t>0?` ✓ ${e.name||e.relative}: 发现 ${t} 个可更新依赖`:` ✓ ${e.name||e.relative}: 所有依赖已是最新`)},afterPackageWrite:e=>{$(` 📝 已写入 ${e.name||e.relative}`)}}),s=0;$(`
331
+ --- 检查结果 ---`);for(let e of o){let t=e.resolved.filter(e=>e.update);if(t.length>0){s+=t.length,$(`\n${e.name||e.relative}:`);for(let e of t){let t=e.diff??``;$(` ${e.name}: ${e.currentVersion} -> ${e.targetVersion} (${t})`)}}}s===0?$(`所有依赖已是最新版本`):($(`\n共发现 ${s} 个可更新依赖`),e.write?$(`已写入 package.json`):$(`使用 --write 参数写入 package.json`))};function lT(e){$d(e,{name:`upgrade`,description:`检查依赖版本更新`,arguments:[{signature:`[mode]`,description:`升级模式(major/minor/patch/latest/newest)`},{signature:`[scope]`,description:`可选。仅升级指定 scope 族的依赖(如 @longzai-intelligence-oxlint 或族根 @longzai-intelligence),内部展开为 include @scope/* 与 @scope-*/*`}],options:[{flags:`--write`,description:`将更新写入 package.json`},{flags:`--dry-run`,description:`仅预览`},{flags:`--locked`,description:`包含精确锁定版本的依赖(默认跳过以数字开头的精确 pin)`}],schema:Dc({write:_c().optional(),dryRun:_c().optional(),locked:_c().optional()}),action:async(e,t)=>{let n=t[0],r=t[1];await cT({mode:n,write:e.write===!0,dryRun:e.dryRun===!0,locked:e.locked,scope:r})}}),$d(e,{name:`upgrade-across`,description:`跨产品群批量升级依赖(项目清单经 project-registry 声明域获取)`,options:[{flags:`--scope <scope>`,description:`依赖 scope(与 --package 二选一,如 @longzai-intelligence-builder),升级该 scope 下所有包`},{flags:`--package <name>`,description:`完整包名(与 --scope 二选一,如 @longzai-intelligence-markdown/data-engine),仅升级该包`},{flags:`--target <version>`,description:`目标版本号(可选,如 ^0.0.8。省略时自动取每个匹配包的 npm latest)`},{flags:`-m, --message <message>`,description:`自定义提交信息`},{flags:`--project-scope <id>`,description:`显式圈定项目范围(缺省自动取当前 edition 范围)`},{flags:`--concurrency <n>`,description:`并发数(默认 10)`},{flags:`--dry-run`,description:`仅预览(不写文件、不提交)`}],schema:Dc({scope:U().optional(),target:U().optional(),message:U().optional(),config:U().optional(),package:U().optional(),concurrency:pl().int().positive().optional(),projectScope:U().optional(),dryRun:_c().optional()}),action:async e=>{e.scope===void 0==(e.package===void 0)&&(process.stderr.write(`错误: upgrade-across 需要在 --scope <@scope> 与 --package <包名> 之间恰选其一
332
332
  `),process.stderr.write(`示例: --scope @longzai-intelligence-builder 或 --package @longzai-intelligence-markdown/data-engine
333
- `),process.exit(1)),await rT({scope:e.scope,package:e.package,version:e.target,message:e.message,projectScope:e.projectScope,concurrency:e.concurrency,dryRun:e.dryRun===!0})}}),Qd(e,{name:`check`,description:`依赖声明聚合检查,覆盖根清单准入、自仓引用协议、应用包出口形态、同 scope 版本锁步与依赖新鲜度`,schema:Dc({}),action:async()=>{await Aw()}})}function lT(e){Qd(e,{name:`hoisting check`,description:`归位三段检查:子包重复声明根依赖、根声明技术栈专属依赖与构建面痕迹引擎声明完备`,schema:Dc({}),action:async()=>{await iw()}})}function uT(e){Qd(e,{name:`overrides check`,description:`检查 package.json 是否声明未豁免的强制版本字段`,schema:Dc({}),action:async()=>{await sw()}})}function dT(e){Qd(e,{name:`boundary check`,description:`检查 packages 层包是否依赖 domains 层领域契约包并校验领域目录层名合规`,schema:Dc({}),action:async()=>{await GC()}})}function fT(){let e=Kd({name:`lzi-dependencies`,description:`Longzai Intelligence 依赖版本管理工具`,version:`0.0.25`});return cT(e),lT(e),uT(e),dT(e),e}async function pT(){await fT().parseAsync(process.argv)}import.meta.main===!0&&await pT();export{fT as buildProgram};
333
+ `),process.exit(1)),await iT({scope:e.scope,package:e.package,version:e.target,message:e.message,projectScope:e.projectScope,concurrency:e.concurrency,dryRun:e.dryRun===!0})}}),$d(e,{name:`check`,description:`依赖声明聚合检查,覆盖根清单准入、自仓引用协议、应用包出口形态、同 scope 版本锁步与依赖新鲜度`,schema:Dc({}),action:async()=>{await jw()}})}function uT(e){$d(e,{name:`hoisting check`,description:`归位三段检查:子包重复声明根依赖、根声明技术栈专属依赖与构建面痕迹引擎声明完备`,schema:Dc({}),action:async()=>{await aw()}})}function dT(e){$d(e,{name:`overrides check`,description:`检查 package.json 是否声明未豁免的强制版本字段`,schema:Dc({}),action:async()=>{await cw()}})}function fT(e){$d(e,{name:`boundary check`,description:`检查 packages 层包是否依赖 domains 层领域契约包并校验领域目录层名合规`,schema:Dc({}),action:async()=>{await KC()}})}function pT(){let e=qd({name:`lzi-dependencies`,description:`Longzai Intelligence 依赖版本管理工具`,version:`0.0.26`});return lT(e),uT(e),dT(e),fT(e),e}async function mT(){await pT().parseAsync(process.argv)}import.meta.main===!0&&await mT();export{pT as buildProgram};